Commit Graph

1698 Commits

Author SHA1 Message Date
Matt Sherman 489322d084 Always set templateLock to all 2023-11-14 15:14:57 -05:00
Nathan Silveira 55766ac140
Template API: Conditional disabling support (#41307)
* Add disable conditions functionality to back-end

* Evaluate _templateBlockDisableConditions in registerWooBlockType

* Add 'disabled' support for number, pricing, and text

* Add disabled support for checkbox

* Add disabled for taxonomy block

* Add changelogs

* Update documentation

* Add unit tests

* Augment attribute with disabled in back-end

* Fix disabled styling

* Remove disabled from toggle since it's being added for all blocks

* Improve CSS for disabled fields

* Only add disabled attribute when it's not added on the block json and refactor

* Allow adding disable conditions in the constructor

* Fix lint issue

* Fix test

* Add disableConditions to dependencies
2023-11-14 13:17:34 -03:00
Matt Sherman 11f593fe3c Changelog 2023-11-13 15:05:52 -05:00
Matt Sherman e766673829 Remove template from settings type (unused) 2023-11-13 14:50:57 -05:00
Nathan Silveira 703936e307
Remove FullScreenMode component from new product editor (#41375)
Remove FullScreenMode component since it seems we're not using it for anything
2023-11-13 16:11:32 -03:00
Nathan Silveira 8d731f8a43
Show global attribute slug without 'pa_' prefix (#41333)
* Show global attribute slug without 'pa_' prefix

* Make implementation more robust
2023-11-13 15:39:58 -03:00
Fernando Marichal b24591432d
Add `popoverProps` to DatePicker (#41404)
* Add `popoverProps` to DatePicker

* Add changelog

* Move changelog

* Add popoverProps to README.md

* Fix lint

* Fix lint again
2023-11-13 14:45:31 -03:00
Leif Singer be76c3c341
update references to woocommerce.com to now reference woo.com (#41241) 2023-11-10 20:47:58 +01:00
Fernando Marichal 811e0c079b
Fix date range and UI in Analytics (#41372)
* Fix date range and ui in Analytics

* Add changelogs

* Modify default behavior

* Remove changelog
2023-11-10 16:01:52 -03:00
Fernando Marichal 05c96d8cf0
Fix block header style in description modal (#41338)
* Fix block header style in description modal

* Add changelog
2023-11-10 11:57:51 -04:00
Leif Singer 030d67531f Woocommerce → WooCommerce (when used in prose only) 2023-11-10 16:13:06 +01:00
Leif Singer 641208c449 fix linter findings in js/components 2023-11-10 15:49:08 +01:00
Leif Singer eb5a8a65f8 add changelog files 2023-11-10 15:49:08 +01:00
Leif Singer 9edad5270d appease the linter 2023-11-10 15:49:08 +01:00
Leif Singer 808a0fc54f update references to woocommerce.com to now reference woo.com 2023-11-10 15:49:08 +01:00
Fernando Marichal 21b24d9ef2
Add custom image in downloads editor (#41342)
* Add custom image in downloads editor

* Add changelog
2023-11-10 09:44:49 -04:00
Fernando Marichal f5156e2860
Fix toggle chart views within Analytics Overview (#41329)
* Fix component blur

* Add changelog
2023-11-10 09:35:58 -04:00
Maikel David Pérez Gómez e5b1ee338e
Update the select all behavior in the variations table (#41008)
* We display the number of selected items, e.g., '5 selected'

* We display a number of all existing items next to the button, e.g., "Select all (25)".

* When only some items are selected on the page, we show an additional button that says "Select page (X)" where X stands for the number of rows on the page. Clicking it selects all rows on the page.

* Clicking "Select all" selects all existing items

* Add changelog file

* Add tracking events

* Saving progress on variations table

* Manage tracking events and error handling

* Hide edition features when at least one variation is selected

* Fix linter errors

* Resolve rebase conflicts

* Remove use selection hook since is not needed anymore

* Fix filter items vertical alignment

* Add changelog files

* Fix inconsistent loading and variations state

* Do not show EmptyTableState when the product has variations but the filter get empty list

* Invalidate cache state before generating variations

* Fix select all after filtering variations

* Remove delete variations from the selection list

* Retreive the product after generating variations

* Fix linter

* Invalidate variations cache after generating variations
2023-11-09 08:25:27 -05:00
Fernando Marichal fd8a5604ba
Add empty state to images block (#41165)
* Add svgs

* Add image place holder

* Refactor components

* Fix styles

* Add changelog

* Remove comment

* Add text translation

* Remove line
2023-11-08 12:36:08 -03:00
Moon 54a00b282a
CYS - make the progress bar move forward in small segments (#41279)
* Add 2 additional steps between the loader steps

* Support onChange callback

* Add loader progress transition

* Add smooth transition story

* Set the initial percentage to 5 to make the transition smoother

* Add changefile(s) from automation for the following project(s): @woocommerce/onboarding, woocommerce

* Add smooth-transition class to the progressbar

* Fix lint

* Update AssembleHubLoader

* Fix e2e

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2023-11-08 16:50:15 +08:00
Nathan Silveira 68a538cb17
Add animation for variable product tour and tweak logic (#41250)
* Add fade-in animation

* Show variable product tour only when product editor tour was already dismissed

* Add changelog
2023-11-07 15:18:49 -03:00
Fernando Marichal 5c4c926474
Update selected item styling dropdown (#41217)
* Update dropdown item style

* Add changelog
2023-11-07 12:59:08 -03:00
Fernando Marichal 02e163aadc
Update section description design (#41251)
* Modify tooltip helper text

* Update section header design

* Add changelog

* Add components changelog
2023-11-07 12:58:52 -03:00
Nathan Silveira 2a30735b28
[Product Block Editor] Show onboarding tour within description block editor (#41161)
* Copy WelcomeGuide from gutenberg

* Remove CSS copied from guide component since it's not influencing the product Welcome Guide and it's interfering with the block editor welcome guide

* Fix issue with box-sizing

* Fix lint issues

* Show guide only when modal is open

* Add changelog

* Remove template and fix issue with component not re-rendering

* Add comment

* Add additional changelog

* Rename component
2023-11-06 16:38:33 -03:00
Matt Sherman 20fac52381
Product Editor: Select product name block initially if set to autofocus (#41189) 2023-11-06 14:08:12 -05:00
Nathan Silveira 87db3d20a6
Add attribute empty state image when no attribute has been added (#40956)
* Add attribute empty state image when no attribute has been added

* Render attribute skeleton as HTML
2023-11-06 14:05:22 -03:00
Matt Sherman 2f65ad23a5 Changelog 2023-11-06 10:58:10 -05:00
Matt Sherman 6544a9cf69 Select product name block initially 2023-11-06 10:58:10 -05:00
Fernando Marichal b1b9e11323
Add preview and replace button to downloads edit (#40835)
* Add image replace

# Conflicts:
#	packages/js/product-editor/src/blocks/product-fields/downloads/edit-downloads-modal/edit-downloads-modal.tsx

* Add image and replace button

* Change styles

* Add changelog

* Verify the file is an image

* Fix image size

* Fix styles

* Changed left padding

* Fix image gap

* Fix style
2023-11-03 17:07:07 -03:00
Matt Sherman 18faf14db7 Update changelog 2023-11-03 09:16:14 -04:00
Matt Sherman afbe61a4f7 Move PluginArea into BlockEditor so plugins can get block info 2023-11-03 09:16:14 -04:00
Matt Sherman fc2fa8598b Changelog 2023-11-03 09:16:14 -04:00
Matt Sherman 15d46e478c Add PostTypeContext 2023-11-03 09:16:14 -04:00
Matt Sherman eae4dc1b9c Changelog 2023-11-01 15:54:55 -04:00
Matt Sherman 94c7112c00 Only select on focus in currency and number fields if still has focus 2023-11-01 15:54:03 -04:00
Maikel David Pérez Gómez 6b44a969d0
Add filters to Variation table (#40978)
* Create product variations filter component

* Add slug to the product and variation attributes
This is needed to be able to filter variations by specific attribute slugs

* Add support to filter variations by many attribute options

* Integrate attribute options filter in variations table

* Fix rebase conflicts

* Set initial filter values

* Improve intial filter values and cache invalidation

* Add changelog files

* Fix linter errors

* Fix unit tests

* Change the min amount of options to show the search input

* Fix invalid cache key generation for the datastore

* Fix unit tests

* Fix linter errors

* Fix js tests

* Add terms pagination for varition filters

* Load terms on demand plus pagination

* Show selected option names as the dropdown button toggle text

* Fix invalida state when reset and on close the popover

* Revert adding selected options as part of the dropdown toggle text

---------

Co-authored-by: Fernando Marichal <ultimoround@gmail.com>
2023-10-31 13:29:48 -04:00
Fernando Marichal bae33f34de
Fix attributes modal incorrect notice (#40976)
* Remove modal copy

* Fix styles

* Add changelog

* Fix build error
2023-10-31 13:18:32 -03:00
Matt Sherman 17ed81c24f
Order menu items in product editor's more menu (kebab menu) (#41104) 2023-10-31 10:45:20 -04:00
Nathan Silveira 1037d9a8b0
Add __experimentalRole: 'content' to block properties (#41045)
* Add __experimentalRole: 'content' to block properties

* Revert change in versions
2023-10-31 11:29:10 -03:00
Nathan Silveira 164ae0984c
Fix double scroll in General tab and image upload overlapping (#40977)
Fix double scroll in General tab and image upload overlapping with other blocks
2023-10-31 11:10:40 -03:00
github-actions[bot] 3a265c3afd
Prepare Packages for Release (#41065)
Co-authored-by: opr <opr@users.noreply.github.com>
2023-10-31 02:02:59 -07:00
Matt Sherman 16d8215119 Changelog 2023-10-30 15:00:18 -04:00
Matt Sherman c83f581932 Add support for ordering product more menu items 2023-10-30 14:59:37 -04:00
Matt Sherman affbb01136 Changelog 2023-10-30 14:44:08 -04:00
Matt Sherman a921863e40 Remove SlotFillProvider from editor 2023-10-30 14:39:01 -04:00
Maikel David Pérez Gómez 65408410fb
Unable to select the values from the dropdown menu on the "Products > Add New > Product Catalog" page (#41093)
* Fix unable to select the values from the select tree control

* Add changelog file
2023-10-30 12:06:59 -04:00
Thomas Roberts 0baec4e003
Add `@woocommerce/blocks-components` to `dependency-extraction-webpack-plugin` packages list (#41042)
Co-authored-by: github-actions <github-actions@github.com>
2023-10-27 02:21:46 -07:00
Leif Singer 1ed69451a5
integrate-plugin: remove superfluous test scripts (#41053)
* remove superfluous test scripts

* Add changefile(s) from automation for the following project(s): @woocommerce/integrate-plugin

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-10-27 00:16:31 +02:00
Nathan Silveira 81cb9e9458
Add tooltip next to label for text and number blocks (#40908)
* Create initial version of TextControl

* Extract 'label' component for reusability

* Reduce gap

* Add label component to number control and add tooltip and required attributes

* Add changelog

* Remove unused CSS

* Add tooltip to type definitions

* Update doc for number block

* Add text block documentation

* Update parameters definition

* Set label to 'mandatory' in TypeScript

* Set label to mandatory

* Organize to alphabetical order

* Refactor required validation to be more consistent with name field

* Generify documentation

* Use createInterpolateElement for label with required indicator
2023-10-26 15:35:39 -03:00
Fernando Marichal 898eb30f7e
[Single Variation] Add missing tracks events (#40996)
* Add note prop

* Add note for single variation

* Add event recording for generic toggle

* Add changelog

* Add parent_id to toggle event

* move logic inside recordProductEvent

* Modify postType
2023-10-26 00:45:53 -03:00
Nathan Silveira a8e4b27df2
Fix 'Hide in product catalog' being unchecked for variations (#41007)
* Don't touch status attribute in variations

* Add missing validate for variations
2023-10-25 16:52:23 -03:00
Wacław Jacek 3d5b58b7d6
Remove dependency on Jetpack from Shipping and Tax task list items (#39992)
* Remove dependency on Jetpack from WCS&T's task list item

- Remove installing Jetpack-the-plugin from WooCommerce Shipping &
Tax WC Home task list and recommended extensions area.

- Update Jetpack auth link generation to use getJetpackAuthUrl().

- Remove references of Jetpack-the-plugin from WCS&T onboarding
as the extension will now use the Jetpack Connection package
for establishing a connection between WPCOM infrastructure
and a Woo site.

* Update WooCommerce Tax flow in WC Home task list

* Inline the agreementText variable

* Add missing pluginSlugs prop to <Plugins> instance for WC Tax

* Fix WC Tax extension name in API response

* Remove Jetpack from copy in Tax task header

* Fix MD034/no-bare-urls MD linting violation

* Fix experimental shipping recommendation tests

* Add changelogs requested by linter

* Add changefile(s) from automation for the following project(s): @woocommerce/components, woocommerce

* Remove mention of Jetpack from ExperimentalShippingRecommendation

* Fix text wrapping bug in WC Tax onboarding task

* Add changefile(s) from automation for the following project(s): @woocommerce/components, woocommerce

* Use isResolving() to detect pending auth URL fetch

* Replace unused hasErrors with ref to error

* Fix lint

* Jetpack auth URL prefetching

* Revert "Jetpack auth URL prefetching"

This reverts commit 2b79000e20.

* Add PrefetchJetpackAuthUrl component to remove Connect button load time

* Replace URL prefetching in component with useEffect

* Fix: Accept redirect URL as param instead of prop

* Fix lint

* Remove prefetching. Make Connect button always available

* Fix ExperimentalShippingRecommendation incompatibility with new Connect behavior

* Handle empty object errors in Connect

* Display TOS above WooCommerce Shipping & Tax installation buttons (#40863)

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-10-25 22:39:43 +08:00
louwie17 3f7eb0ce31
Invalidate variations upon generation and fix formatted name (#40905)
* Invalidate variations upon generation and fix formatted name

* Add aditional invalidates to keep cache up to date

* Update formatted name to always return attribute term name list
2023-10-25 08:45:58 -04:00
Nathan Silveira bc04234732
Fix checkbox not working when checkedValue is provided (#40979) 2023-10-25 00:29:53 -03:00
RJ e01e6f8b2a
add: core profiler email marketing opt in (#40869)
* add: core profiler email marketing opt in

* tests

* changed mailchimp feature flag

* fix: made experiment name static

* lint
2023-10-24 17:07:26 +02:00
Maikel David Pérez Gómez 791af33e95
Empty state for uncreated/empty variations (#40940)
* Move empty-variations-image to the images folder so it can be used in other components

* Create TableEmptyState component

* Add TableEmptyState to the Variations table component

* Add changelog file

* Fix linter error
2023-10-23 15:21:42 -04:00
Fernando Marichal 469a76a82f
Show error message when single variation price is empty (#40885)
* Show notice when price is empty

* Add changelog

* Add variation check

* Allow multiple errors

* Show unique errors

* Change error text

* Rename wpError to wpErrors

* Show single error

* Add error type

* Refactor catch
2023-10-23 16:19:00 -03:00
Maikel David Pérez Gómez eff2b8cca3
Update default visibility settings for variation options (#40949)
* Replace hidden icon by seen icon

* The 'visible' icon is only shown when the Show in product details box in the variation option is checked

* The tooltip displayed when the user hovers over the 'hidden' icon is updated to: Visible in product details

* On hover, the cursor changes to help

* Add changelog file
2023-10-23 14:19:33 -03:00
Maikel David Pérez Gómez 16ce05109f
Add a loading state for the new product form (#40939)
* Create product page skeleton

* Load skeleton in product and variation pages

* Let each page to define own loading/skeleton when the router is resolving the page.

* Add changelog files

* Fix linter error

* Fix unit test
2023-10-23 12:47:26 -04:00
Maikel David Pérez Gómez 50ff379f25
Delete variations from the single page does not reflect correctly in the parent product (#40900)
* Invalidate resolution for paginated variations after removing any from the single variation page

* Add changelog file

* Invalidate resolution also for getProductVariationsTotalCount
2023-10-20 13:06:02 -03:00
louwie17 fbac42aafc
Update variation switcher logic to not loop (#40901) 2023-10-20 11:17:30 -04:00
Matt Sherman 3fa5573706
Template API: Deprecate woocommerce/conditional block (#40883) 2023-10-20 09:53:06 -04:00
Nathan Silveira 3d182f342f
Create React component wrappers for the checkbox and number blocks (#40828)
* Add @woocommerce/number to @woocommerce/components

* Create a component for checkbox and use it on the block

* Create a component for number and use it on the block

* Add changelogs

* Remove scss import

* Rename Numbercontrol prop

* Expose useProductEntityProp

* Move components to product-editor package and fix UI bug created in checkbox component

* Revert unnecessary changes in components and update changelogs

* Revert changes in use-number-input-props

* Fix issue in checkbox

* Revert css change
2023-10-20 10:52:56 -03:00
Fernando Marichal 3426692606
Hide `Switch to draft` button on single variation page (#40856)
* Hide Switch to draft when variable product

* Add changelog

* Change changelog
2023-10-20 09:32:06 -04:00
Matt Sherman 61ef8a9fa2 Changelog 2023-10-19 15:34:32 -04:00
Matt Sherman 60fde2be96 Deprecate woocommerce/conditional block 2023-10-19 15:32:40 -04:00
Maikel David Pérez Gómez 8827e42bd7
Set prices button from the variations notice is not updating the right amount of variations (#40876)
* Improve has_price filter so it can matches when the price record does not exist or it's empty/null

* Get the exact variation ids of those ones that do not have price

* Add changelog files

* Fix linter errors
2023-10-19 13:14:08 -04:00
Matt Sherman 613a63b0ef
Template API: Conditional visibility support (#40722) 2023-10-19 12:02:05 -04:00
Matt Sherman df2a0eb337 Remove productType from ProductEditorContext interface 2023-10-19 11:20:20 -04:00
Fernando Marichal b0113ee555
Add edit downloads modal (#40599)
* Create edit downloads modal

* Add modal to downloads

# Conflicts:
#	packages/js/product-editor/src/blocks/product-fields/downloads/edit.tsx

* Refactor removeHandler

* Fix EditDownloadsModal

* Refactor onSave

* Add changelog

* Fix onRemove

* Fix styles

* Fix lint

* Fix lint

* Fix modal closing when copyToClipboard
2023-10-19 11:09:04 -04:00
Daniel Mallory e4b1657f98
Remove references to Sofort (#40745)
* Removing all references to Sofort in the various locations we show payment method information.

* Adding changelogs.
2023-10-19 13:45:48 +01:00
Matt Sherman 7fd28367d8 Remove order attribute from tab block 2023-10-19 08:28:14 -04:00
Matt Sherman 4605f7ee57 Set tab order based on block's order 2023-10-19 08:23:44 -04:00
Matt Sherman 97dc41e2aa Remove productType from context (it was really just postType, which is already in context) 2023-10-19 07:43:09 -04:00
Matt Sherman abd71af40a Switch conditional block to use postType from context instead of productType 2023-10-19 07:33:29 -04:00
Matt Sherman b40f9d2035 Switch productType to postType in context augmentation 2023-10-19 07:30:53 -04:00
Matt Sherman f399196b39 Changelog 2023-10-18 18:57:27 -04:00
Matt Sherman 4a49683a69 Changelog 2023-10-18 18:57:22 -04:00
Matt Sherman 6b6ffd184e Remove unused imports 2023-10-18 18:44:32 -04:00
Matt Sherman 8a1709a275 Make useEvaluationContext param optional 2023-10-18 18:41:40 -04:00
Matt Sherman d14124c513 Fix up registerWooBlockType unit test 2023-10-18 18:41:22 -04:00
Matt Sherman 076939f2e4 Ignore ts error about lack of types for @wordpress/data 2023-10-18 15:43:26 -04:00
Matt Sherman 48d5cca0b8 Fix block registration for downloads 2023-10-18 15:16:17 -04:00
Matt Sherman 6b55e7c096 Refactor client-side usesContext augmentation 2023-10-18 15:16:17 -04:00
Matt Sherman a4002105a4 Refactor client-side attribute augmentation 2023-10-18 15:16:17 -04:00
Matt Sherman 23b2953934 Fix block registration on notice-edit-single-variation 2023-10-18 15:16:17 -04:00
Matt Sherman 2981f14a5b Fix block registration for downloads 2023-10-18 15:16:17 -04:00
Matt Sherman b256841135 Use getEditedEntityRecord to get product 2023-10-18 15:16:17 -04:00
Matt Sherman f466d84bf5 Remove editedProduct from usesContext 2023-10-18 15:16:17 -04:00
Matt Sherman 67e3d72095 Add productType to ProductEditorContext interface 2023-10-18 15:16:17 -04:00
Matt Sherman 6f53697df2 Remove console.log 2023-10-18 15:16:17 -04:00
Matt Sherman aa942771e5 Fix up TS errors 2023-10-18 15:16:17 -04:00
Matt Sherman ea6dc94897 Move useEvaluationContext implementation to product-editor 2023-10-18 15:16:17 -04:00
Matt Sherman 334a10a9a4 useEvaluationContext hook 2023-10-18 15:16:17 -04:00
Matt Sherman e244c8e025 Improve useSelect implementation 2023-10-18 15:16:17 -04:00
Matt Sherman 09b0cdcef7 Memoize block context 2023-10-18 15:16:17 -04:00
Matt Sherman 86a0a15588 Include productType in context; don't include editedProduct 2023-10-18 15:16:17 -04:00
Matt Sherman 7161534f96 Conditional visibility implementation with useSelect 2023-10-18 15:16:17 -04:00
Matt Sherman 5845bcb768 Conditional visibility implementation with context 2023-10-18 15:16:17 -04:00
Matt Sherman 6f2e89adcb Use registerProductEditorBlockType for variations 2023-10-18 15:16:17 -04:00
Matt Sherman cb15fbcd34 Use registerProductEditorBlockType for variation-options 2023-10-18 15:16:17 -04:00
Matt Sherman dbc3c7a77b Use registerProductEditorBlockType for variation-items 2023-10-18 15:16:17 -04:00
Matt Sherman 9d492800f3 Use registerProductEditorBlockType for tag 2023-10-18 15:16:17 -04:00
Matt Sherman 271258a0c4 Use registerProductEditorBlockType for summary 2023-10-18 15:16:16 -04:00
Matt Sherman ca9b5c3dd9 Use registerProductEditorBlockType for shipping-dimensions 2023-10-18 15:16:16 -04:00
Matt Sherman 686ad5c026 Use registerProductEditorBlockType for shipping-class 2023-10-18 15:16:16 -04:00
Matt Sherman e366809711 Use registerProductEditorBlockType for schedule-sale 2023-10-18 15:16:16 -04:00
Matt Sherman d92d34f9fe Use registerProductEditorBlockType for sale-price 2023-10-18 15:16:16 -04:00
Matt Sherman c937b3eea9 Use registerProductEditorBlockType for regular-price 2023-10-18 15:16:16 -04:00
Matt Sherman c4bd765eb6 Use registerProductEditorBlockType for password 2023-10-18 15:16:16 -04:00
Matt Sherman 6596e9c05c Use registerProductEditorBlockType for notice 2023-10-18 15:16:16 -04:00
Matt Sherman b3e0b2af93 Use registerProductEditorBlockType for name 2023-10-18 15:16:16 -04:00
Matt Sherman 8574fdec36 Use registerProductEditorBlockType for inventory-sku 2023-10-18 15:16:16 -04:00
Matt Sherman 9b161c6667 Use registerProductEditorBlockType for inventory-quantity 2023-10-18 15:16:16 -04:00
Matt Sherman 0d03ad93b3 Use registerProductEditorBlockType for inventory-email 2023-10-18 15:16:16 -04:00
Matt Sherman ccdccc2de3 Use registerProductEditorBlockType for images 2023-10-18 15:16:16 -04:00
Matt Sherman 3324fe2787 Use registerProductEditorBlockType for description 2023-10-18 15:16:16 -04:00
Matt Sherman f9aa73c7d3 Use registerProductEditorBlockType for catalog-visibility 2023-10-18 15:16:16 -04:00
Matt Sherman 8fee2c1669 Use registerProductEditorBlockType for attributes 2023-10-18 15:16:16 -04:00
Matt Sherman 2296f910c9 Use registerProductEditorBlockType for toggle 2023-10-18 15:16:16 -04:00
Matt Sherman f2feaa7d55 Use registerProductEditorBlockType for text 2023-10-18 15:16:16 -04:00
Matt Sherman d082491e1d Use registerProductEditorBlockType for taxonomy 2023-10-18 15:16:16 -04:00
Matt Sherman 7a04b3909e Use registerProductEditorBlockType for tab 2023-10-18 15:16:16 -04:00
Matt Sherman 3afe5d8233 Use registerProductEditorBlockType for section 2023-10-18 15:16:16 -04:00
Matt Sherman aa9ed2d88a Use registerProductEditorBlockType for radio 2023-10-18 15:16:16 -04:00
Matt Sherman 9bb83c1745 Use registerProductEditorBlockType for pricing 2023-10-18 15:16:16 -04:00
Matt Sherman 63d18234f8 Use registerProductEditorBlockType for number 2023-10-18 15:16:16 -04:00
Matt Sherman 57d1c4a0a7 Use registerProductEditorBlockType for conditional 2023-10-18 15:16:16 -04:00
Matt Sherman f3eea29421 Use registerProductEditorBlockType for collapsible 2023-10-18 15:16:16 -04:00
Matt Sherman bf8ea9a016 Use registerProductEditorBlockType for checkbox 2023-10-18 15:16:16 -04:00
Matt Sherman 7448e78aa7 Implement registerProductEditorBlockType 2023-10-18 15:16:16 -04:00
Matt Sherman c616e0c7c9
Add @woocommerce/block-templates dependencies (#40849) 2023-10-18 14:41:23 -04:00
Matt Sherman 51dec2db53 Add @wordpress/data to dependencies 2023-10-18 13:31:46 -04:00
Maikel David Pérez Gómez 40a410ae1f
Product Shipping: New class should automatically create a slug (#40847)
* Remove empty values from the shipping class request so slug can be generated server side

* Add changelog file
2023-10-18 13:04:14 -04:00
Matt Sherman 8ca38b6df2 Add react dependencies 2023-10-18 12:07:23 -04:00
Matt Sherman a1e38b0b25 Add @woocommerce/element to dependencies 2023-10-18 11:58:31 -04:00
Matt Sherman 375717c655 Changelog 2023-10-18 11:38:21 -04:00
Matt Sherman ef268fe545 Add @woocommerce/expression-evaluation dependency 2023-10-18 11:37:10 -04:00
Maikel David Pérez Gómez 51c9b9051e
[Downloads] Manage limits (#40797)
* Create ManageDownloadLimitsModal component

* Integrate ManageDownloadLimitsModal with product downloads block

* Add changelog file

* When there's at least 1 file uploaded, we add a Manage limits button to the Downloads section heading

* Both fields only accept numbers

* Add suffix to each input

* Add integer validation message

* Fix validation to support -1 and 0 values
2023-10-18 10:15:43 -04:00
Maikel David Pérez Gómez 39019d2750
Manage single variation as virtual (#40809)
* Add virtual section to the product variation template

* Add changelog file

* Let the toogle block to use inverted value to be checked

* Fix virtual toggle to be inverted

* Add changelog file
2023-10-18 10:47:33 -03:00
louwie17 cee08e44d9
Hide header on variation edit page and remove use of `:has()` CSS selector (#40843)
* Make sure we hide the header on the variation edit page and remove use of has()

* Add changelogs
2023-10-18 09:22:55 -03:00
RJ 1e86558083
fix: cys design-with-api loader should not loop (#40829) 2023-10-18 15:14:51 +08:00
Joel Thiessen b2197bb423
[Woo AI] Add background removal feature for the legacy product editor images (#40833)
Co-authored-by: Joel <dygerati@gmail.com>
Co-authored-by: Thomas Shellberg <6723003+tommyshellberg@users.noreply.github.com>
Co-authored-by: Nima Karimi <73110514+nima-karimi@users.noreply.github.com>
2023-10-17 14:27:24 -07:00
Maikel David Pérez Gómez 5dedfd7ebe
Add Downloads section to the single variation page (#40807)
* Add support to downloads block to use the context postType

* Register the downloads block into the ProductVariationTemplate

* Add changelog files

* Fix compilation error

* Fix download block init function
2023-10-17 16:58:53 -03:00
Moon fdc2401fcc
Fix badge size issue when a number larger than 3 digits is used (#40624)
* Fix badge design issue for big numbers

* Add changefile(s) from automation for the following project(s): @woocommerce/components

* Update packages/js/components/src/badge/style.scss

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2023-10-17 12:30:41 -07:00
Ismael Martín Alabarce c598a88d77
Manually prepare packages for release (#40826)
Manually run package release prepare for @woocommerce/components

To avoid GH workflow issues
2023-10-17 16:32:20 +02:00
Fernando Marichal b1451b8cf8
Display notice at the top single variations (#40679)
* Rename notice component

* Add notice-edit-single-variation

# Conflicts:
#	packages/js/product-editor/src/blocks/style.scss

* Add dismiss button to notice

* Add use-notice hook

* Refactor hook

* Changes in notice

* Rename

# Conflicts:
#	packages/js/product-editor/src/blocks/product-fields/notice/index.ts

* Create helper class

* Add notice block to general tab

* Add notice to other tabs

# Conflicts:
#	plugins/woocommerce/src/Admin/Features/ProductBlockEditor/ProductTemplates/ProductVariationTemplate.php

* Change comment

* Add parent product name to copy

* Fix lint

* Removed space

* Add changelogs

* Refactor notice block

* Remove context

* Refactor useConfirmUnsavedProductChanges

* Add useConfirmUnsavedProductChanges to Notice block

* fix lint

* Add return to `registerWooBlockType`

* Remove `useConfirmUnsavedProductChanges`

* Fix links styles

* Remove ProductEditorHelper use

* Remove ProductEditorHelper

* Refactor noticeLink

* Fix isResolving issue
2023-10-16 15:07:50 -04:00
Nathan Silveira c3ffd5af95
Add 'min' and 'max' attributes to number block (#40715)
* Add 'min' and 'max' attributes to number block

* Rename string
2023-10-16 12:07:17 +00:00
Ismael Martín Alabarce 8f533167f7
Add PhoneNumberInput component – cooldown (#40335)
* Move component from WooPayments

* Expose component on the package

And include its style sheet.

* Add missing global typing

* Fallback to alpha2 codes

when wcSettings.countries is not available

* Add build data script and its output

* Move defaults to their own file

* Add readme and JSDocs

* Add storyboard examples

* Add JS unit and snapshot tests

* Move `DataType` to a `types.ts` file

To get rid of the type definition in the build data script

* Fix markdown issues

* Add changefile(s) from automation for the following project(s): @woocommerce/components

* Minor markdown update

* Fix input sanitization

* Add component output to storybook examples

* Remove consecutive spaces or hyphens from input sanitization

* Improve consecutive character sanitization

Move it to the component keyDown event to avoid the caret to be displaced

* Ensure imports from @wordpress/element

* Refactor to avoid using lodash

* Add changefile(s) from automation for the following project(s): @woocommerce/components

* Use $gray-5 for highlighted items for better contrast

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-10-16 10:19:36 +02:00
louwie17 7f25060044
Variation switching when deleting (#40780)
* Add variation switcher hook for easier use across multiple components

* Add unregister function for validation

* Add changelogs

* Remove stray console

* Add unRegisterValidator function
2023-10-13 19:25:58 -04:00
Maikel David Pérez Gómez df2bf33bcd
Add edit button to each variation to redirect to the single variation page (#40709)
* Add edit button to each variation to redirect to the single variation page

* Add changelog file

* Fix blocks and plugin registration

* Add router redirection

* Fix css conflicts with the prev experience

* Fix linter errors

* Add changelog file
2023-10-13 16:22:11 -04:00
Maikel David Pérez Gómez 177f8bbe6b
[Virtual] ‘Needs shipping’ toggle (#40735)
* Add virtual section and block to the Shipping tab

* Set shipping disabled when the product is virtual

* Add changelog files

* Fix linter errors
2023-10-13 16:19:32 -04:00
Maikel David Pérez Gómez ff062eed4d
Add new file dropdown menu (#40731)
* Create downloads menu component

* Add the menu to the downloads section

* Create upload-files-menu-item component

* Add upload-files-menu-item to the downloads menu

* Create media-library-menu-item component

* Fix media library menu item zindex conflict with the media upload modal

* Create insert-url-menu-item component

* Add insert-url-menu-item to the downloads menu

* Add support for digital product when product-virtual-downloadable feature is enabled

* Add changelog files

* Remove non needed style

* Fix linter errors

* Fix redirection logic

* Keep drop zone on to of the table

* Avoid duplicate files

* Stringify download ids before persist them

* Fix summary block property value under SimpleProductTemplate

* Fix linter error
2023-10-13 15:25:37 -04:00
Maikel David Pérez Gómez 985d9596d6
Add Delete variation item to the editor actions menu (#40672)
* Create DeleteVariationMenuItem to be added to the Header's MoreMenu

* Move registration menu item fills to each product/variation page

* Export RemoveConfirmationModal from the product editor package

* Request for variation deletion

* Show notice when deleting variation

* Redirect to parent product page after deleting the variation

* Add tracking event

* Manage isRemoving state under RemoveConfirmationModal

* Add changelog files

* Fix linter error

* Fix delete variation modal title

* Add tracking events

* Use the right prop to get the variation name

* Add name and parent_id to the ProductVariation type definition

* Add changelog file

* Feedback modal should get the correct product id when editing a variation

* Fix rebase conflicts

* Fix unit test
2023-10-12 15:59:13 -04:00
louwie17 c4c56f3fc8
Add variation switcher in footer for variation page (#40713)
* Add variation switcher in footer for variation page

* Add productId to make sure template is updated correctly

* Don't show bar when less then 2 variations.

* Add class for when page is scrolled to bottom

* Add changelogs

* Add tracks

* Fix lint error

* Fix css lint issues
2023-10-12 11:56:48 -03:00
Fernando Marichal ff51b07da3
Change the blocks editor header to support variations (#40606)
* Add variation name and parent id to REST API

* Add variation title

* Add changelog

* Change changelog

* Fix lint

* Add changelog

* Fix typo

* Modify header check
2023-10-11 15:34:26 -03:00
Maikel David Pérez Gómez 2cff75c73c
Add virtual and downloads related controls to variation management flows (#40567)
* Add Toggle shipping item to the variations quick actions menu

* Add Downloads -> Set download limit item to the variations quick actions menu

* Add Downloads -> Set download expiry item to the variations quick actions menu

* Add Downloads -> Upload files item to the variations quick actions menu

* Add changelog file

* Fix some styles conflicts and set default uploaded files

* Hide the toggle shipping and downloads menu items behind the feature flag product-virtual-downloadable

* Fix unit tests
2023-10-11 12:50:00 -04:00
Maikel David Pérez Gómez eb9a8b3cde
[Downloads] File list (#40526)
* Add downloads section

* Create and register the downloads block

* Conditionally remove the upload button from the media upload component

* Create upload image component

* Add media uploader component to the downloads block

* Add downloads table

* Add remove file feature to the downloads table

* Set downloadable to false when there are no download files

* Add support to remove uploaded file

* If the file has a custom name added by the user, we show it first. The actual file name is then shown in a second line.

* Add changelog files

* Fix linter error

* Address feedback from comments

* Fix allowed media types

* Register the new feature flag product-virtual-downloadable

* Hide the downloads section behind the feature flag product-virtual-downloadable

* Update editor settings after sync blocks with template

* Get allowedMimeTypes from the editor settings

* Fix linter errors
2023-10-11 10:37:41 -04:00
Maikel David Pérez Gómez e0a138b27b
Complete General tab for Single Variation page (#40633)
* Add description to the Variation details section

* Add Image section block to the Single Variation page

* Add support to the checkbox block for changing non boolean properties and extend it to use the entity context

* Register the product-variation-visibility block into the ProductVariationTemplate

* Null is a valid value but not updafined

* Fix type definitions

* Add changelog files

* Fix linter errors

* Add changelog file

* Change onValue and offValue for checkedValue and unchackedValue for the checkbox block to avoid event naming conflicts

* Set multiple value dynamically into the media uploader component

* Prevent uploading multiple files when multiple is set to false

* Remove cover label when multiple is set to false

* Fix DropZone min height in Image section

* Fix rebase conflict

* Fix linter error
2023-10-10 09:42:26 -04:00
louwie17 98876f54d9
Add pricing tab for variations (#40642)
* Update blocks with postType context

* Add tax class

* Pass context into get_tax_class

* Add parent option

* Add changelog

* Update changelog

* Add isRequired attribute to regular price block for use in variations

* Add additional condition to avoid error in date time picker

* Add changelog

* Fix lint errors
2023-10-10 08:55:05 -03:00
Matt Sherman 8ac66ab2b7
Template API: Expression evaluation package (#40556) 2023-10-09 09:22:17 -04:00
Nathan Silveira a1226d5e30
Add support for 'meta_data.' property format for reusable blocks (#40600)
* Add support to multiple types in useProductEntityProp

* Migrate 'checkbox' to useProductEntityProp

* Migrate 'pricing' to useProductEntityProp

* Migrate 'radio' to useProductEntityProp

* Migrate 'taxonomy' to useProductEntityProp

* Migrate 'text' to useProductEntityProp

* Migrate 'toggle' to useProductEntityProp

* Add changelog

* Update unit tests

* Add postType context to generic blocks and use-product-entity-props and add code review suggestions

* Use postType for meta_data as well

* Fix unit tests
2023-10-09 12:34:37 +00:00
Matt Sherman 2abd3eee38 Initial documentation 2023-10-08 08:13:54 -04:00
Matt Sherman 7a950f51b6 Changelog 2023-10-08 07:03:17 -04:00
Christopher Allford 1c30563ffc
Separate PHP and JS Unit Tests (#40639)
Since some projects might have both kinds of tests we are
going to have a `test:php` and a `test:js` script for each.
2023-10-06 15:41:47 -07:00
Maikel David Pérez Gómez d1656e12e5
Add Shipping tab to the single variation page (#40637)
* Fix shipping blocks ids into ProductVariationTemplate

* Add support to postType context to product-shipping-class-field block

* Add support to postType context to product-shipping-dimensions-fields block

* Add changelog files
2023-10-06 13:47:45 -04:00
Maikel David Pérez Gómez 5d97297c89
Add Inventory tab to the single variation page (#40636)
* Remove advance section from the inventory section in the ProductVariationTemplate

* Add support to postType context to product-sku-field block

* Add support to postType context to product-toggle-field block

* Add support to postType context to product-inventory-quantity-field block

* Add support to postType context to product-radio-field block

* Fix inventory blocks ids into ProductVariationTemplate

* Add changelog files
2023-10-06 13:45:27 -04:00
Nathan Silveira 129f11df9e
Create woocommerce/product-number-field block (#40619)
* Add initial structure for number block

* Add more attributes and remove currenty formatting

* Add changelog

* Refactor

* Add readme

* Remove unused import

* Add changelog

* Use 'formatNumber' and 'parseNumber' functions from useProductHelper hook

* Use 36px default size

* Fix README
2023-10-06 16:21:33 +00:00
Maikel David Pérez Gómez a918e79093
Setup the product editor to support the product variation (#40605)
* Initial changes needed to get product variation to load in its own form

* Allow the publishing of an individual variation

* Address some PR feedback and do some general cleanup

* Update template with new attribute name

* Add changelogs

* Update label of note field and allow for optional param in summary block

* Remove helpText in variation note field

* Fix PHP lint errors

* Make editor type more abstract

---------

Co-authored-by: Lourens Schep <lourensschep@gmail.com>
2023-10-05 15:27:54 -03:00
louwie17 a28a552bbf
Add initial migration script (#40564)
* Add initial integrate plugin package

* Add changelog

* Make plugin data parsing less strict, to support bad formatting

* Update package dependency

* Remove unused code
2023-10-05 09:35:50 -03:00
Matt Sherman fd2c07cac0 Clean up ConditionalExpression rule 2023-10-04 20:12:40 -04:00
Matt Sherman eb71f43bdc Implement conditional expressions 2023-10-04 19:52:39 -04:00
Matt Sherman 0646031217 Implement multiline comments and be more forgiving of extra whitespace 2023-10-04 15:47:06 -04:00
Matt Sherman 1812a76f8d Test with complex expression with arithmetic, relational, and logical operators 2023-10-04 10:02:15 -04:00
Matt Sherman 83c3ff365a Implement arithmetic expressions 2023-10-04 09:59:39 -04:00
Matt Sherman 11653fe327 Rearrange tests to match grammar order 2023-10-04 09:54:15 -04:00
Matt Sherman e7e9e30884 Test NOT with parenthesis 2023-10-04 09:52:54 -04:00
Nathan Silveira 793e4a821d
Split product editor blocks into separate directory structures (#40571)
* Create 'generic' and 'product-fields' and separate blocks between the two

* Refactor 'BlockRegistry' to include new directory structure

* Increment README

* Add param documentation

* Add changelogs

* Lint markdown

* Add block directory doc

* Fix jest test

* Update handbook reference
2023-10-04 13:51:25 +00:00
Matt Sherman 99b06b67a2 Tests for complex expressions 2023-10-04 09:38:52 -04:00
Matt Sherman 18992e7891 Implement relational expressions 2023-10-04 09:33:21 -04:00
Matt Sherman f47bb0db37 Refactor to evaluate function 2023-10-04 09:25:49 -04:00
Matt Sherman f0a6045ca0 Simplify IdentifierName processing 2023-10-03 19:45:20 -04:00
Matt Sherman f331099c64 Support multiline expressions 2023-10-03 19:39:47 -04:00
Matt Sherman b51b652ebd Signed number tests 2023-10-03 19:23:39 -04:00
Matt Sherman d82737fb81 Implement unary expressions 2023-10-03 19:13:56 -04:00
Matt Sherman 6237c8caea Refactor logical expressions and implement equality expressions 2023-10-03 19:04:46 -04:00
Matt Sherman a5fec1fa6e Extract OR and AND operators 2023-10-03 15:43:40 -04:00
Matt Sherman e9180206b0 String literals 2023-10-03 13:56:45 -04:00
Nathan Silveira 00d14debd4
Create woocommerce/product-text-field block (#40337)
* Add new block woocommerce/product-input-field

* Add required attribute

* Add 'required' validation

* Add validationRegex attribute

* Add changelog

* Use existing meta_data field

* Add validationErrorMessage attribute

* Rename block

* Rename path

* Create 'useMetaEntityProp' hook

* Add changelog

* Add comment to translators

* Rename init function

* Add minLength and maxLength attributes

* Fix wrong copied line

* Fix typescript issues

* Refactor hook to use property name instead of isMeta boolean

* Rename hook

* Add tests to useProductEntityProp

* Fix bug: the meta property shouldn't contain "meta_data."

* Implement code review suggestions

* Use 'useWooBlockProps' hook
2023-10-03 15:12:07 +00:00
Nathan Silveira bda564ad67
Add reusable blocks documentation for remaining blocks (#40521)
* Add documentation for woocommerce/product-radio-field

* Update woocommerce/product-taxonomy-field documentation

* Rename checkbox section for consistency

* Edit pricing attribute name for consistency

* Add documentation for woocommerce/product-pricing-field

* Add 'conditional' documentation

* Update README.md

* Add usage text

* Add documentation to collapsible

* Fix details across all readmes

* Add changelog

* Try adding video html tag

* Allow video html tag

* Fix wrong position in doc

* Rename 'name' to 'property' on InputControl props

* Fix mistake in label position
2023-10-03 12:49:46 +00:00
Fernando Marichal e224445bf6
Add missing Tracks events to attribute modals (#40517)
* Add tracks events

* Add remove icon recording

* Add tracking to new product modal

* Add changelog

* Remove not used `recordEvent`
2023-10-03 08:26:39 -03:00
Matt Sherman 32964d8556 Null, boolean, and numeric literals 2023-10-02 20:50:59 -04:00
Matt Sherman f6ee58a4ce Change case of grammar rules 2023-10-02 19:58:02 -04:00
Fernando Marichal 2e74ab84e8
Fix dropdown and list behavior in attributes variation modals (#40496)
* Fix selectors alignment

* Modify icon

* Hide placeholder when an item has been selected

* Fix methods

* Add changelog
2023-10-02 17:18:05 -03:00
Matt Sherman 0f55dff6de Initial grammar 2023-10-02 15:12:44 -04:00
Matt Sherman fcf099b780 Initial @woocommerce/expression-evaluation package 2023-10-02 15:12:30 -04:00
Matt Sherman 0885808c07
Template API: Store edited product in context (#40450) 2023-10-02 15:09:49 -04:00
Nathan Silveira 1903b3a759
Update Product Editor Handbook (#40514)
* Rename title

* Remove common-tasks section as it's currently made redundant by template API documentation

* Create index for reusable blocks doc

* Update reference to the handbook

* Add references to new documentation to the handbook

* Add changelog

* Update README.md
2023-10-02 12:59:35 +00:00
Chi-Hsuan Huang de1fe1bf96
Fix Customize Your Store UI bugs (#40456)
* Add woocommerce_customize_store_ai_suggestions option to allowed list

* Add z-index=1 to tour-kit close btn to ensure it's clickable

* Fix cys container classname

* Fix color palette border style and frame spinner position

* Fix janky ai loader

* Add changelog

* Fix classname and section header spacing

* Fix cannot save cys logo changes

* Add use-selected-pattern hoook to add selected style to pattern

* Fix opacity preview issue

* Revert interval change

* Add test

* Fix findPatternByBlock

* Fix range input focus style

* Fix lint
2023-10-02 16:28:13 +08:00
Maikel David Pérez Gómez 69eebe4f17
Fix when adding new attributes, input fields keep the focus styling (#40519)
* Fix invalid focus state of the experimental select control

* Add changelog file

* Fix regression setting readOnlyWhenClosed to false by default

* Add changelog file
2023-09-29 17:31:21 -03:00