Commit Graph

1505 Commits

Author SHA1 Message Date
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
Fernando Marichal 650cf476f0
Remove confirmation modal for dismissing unsaved attributes or variation options (#40500)
* Remove the confirmation modal

* Add changelog
2023-09-29 10:23:03 -04:00
Maikel David Pérez Gómez f6f7574f92
Fix the position and sizing of pagination controls in the variations table (#40439)
* Fix the position of pagination controls in the variations table

* Fix the sizing of controls in the variations table

* Add changelog file

* Fix linter errors
2023-09-29 09:48:01 -04:00
Maikel David Pérez Gómez 43a238d730
Show a summary when adding or removing variation option values (#40470)
* Fix server error when generating variations after delete an attribute term, stock_quentity=null and low_stock_amount=null brake

* Show a summary when adding or removing variation option values

* Fix linter error

* Make sure to show variations notice only if the attribute is used for variation
2023-09-29 09:59:55 -03:00
louwie17 1a3ecebc5e
Fix dropdown css conflict (#40494)
Increase specificity of WooCommerce dropdown to avoid overwrites
2023-09-28 17:08:19 -03:00
Maikel David Pérez Gómez 57529230ca
Font sizes differ between chips used in the variations options table and variations list (#40447)
* Fix font sizes difference between chips used in the variations options table and variations list

* Add changelog file

* Fix unit test
2023-09-28 15:13:03 -04:00
Fernando Marichal fd6ac01fcd
Improve copy in variation management notifications (#40467)
* Add method `getSnackbarText`

* Add single variation update/delete

* Add changelog

* Refactor method `getSnackbarText`

* Improve code
2023-09-28 14:38:42 -04:00
Fernando Marichal 86a535a224
Fix field label styling in the edit attribute modal (#40449)
* Add prop readOnlyWhenClosed

* Add changelog
2023-09-28 14:22:23 -04:00
Maikel David Pérez Gómez d8aa52d0a7
Hide list controls when no items are selected (#40434)
* The Select all and Clear selection buttons are only displayed when at least 1 item is selected

* Add changelog file
2023-09-28 10:14:48 -03:00
Maikel David Pérez Gómez 756b0a6171
Add cursor: not-allowed; to the disabled Quick updates button (#40448)
* Add cursor: not-allowed; to the disabled Quick updates button

* Add changelog file
2023-09-28 09:38:38 -03:00
Matt Sherman 435e24c58c Update Edit props type for variations 2023-09-27 23:42:29 -04:00
Matt Sherman 99839030e9 Update Edit props type for variation-options 2023-09-27 23:42:15 -04:00
Matt Sherman 1d21956def Update Edit props type for toggle 2023-09-27 23:42:05 -04:00
Matt Sherman f781940c27 Update Edit props type for taxonomy 2023-09-27 23:41:58 -04:00
Matt Sherman abe02a4d6c Update Edit props type for summary 2023-09-27 23:41:35 -04:00
Matt Sherman 2c0117183e Update Edit props type for shipping-dimensions 2023-09-27 23:41:27 -04:00
Matt Sherman db1f257895 Update Edit props type for shipping-class 2023-09-27 23:41:18 -04:00
Matt Sherman d0f02fe0d4 Update Edit props type for section 2023-09-27 23:41:09 -04:00
Matt Sherman de7bb63183 Update Edit props type for schedule-sale 2023-09-27 23:41:01 -04:00
Matt Sherman 0c4782a238 Update Edit props type for sale price 2023-09-27 23:40:52 -04:00
Matt Sherman 020a91e3fd Update Edit props type for regular-price 2023-09-27 23:40:43 -04:00
Matt Sherman 0ad7126f5f Update Edit props type for radio 2023-09-27 23:40:34 -04:00
Matt Sherman 5be0716466 Update Edit props type for pricing 2023-09-27 23:40:26 -04:00
Matt Sherman b56ced02c8 Update Edit props type for password 2023-09-27 23:40:19 -04:00
Matt Sherman 33e350d3d2 Update Edit props type for notice 2023-09-27 23:40:10 -04:00
Matt Sherman 2f11689672 Update Edit props type for name 2023-09-27 23:40:02 -04:00
Matt Sherman 120efa3022 Update Edit props type for inventory-sku 2023-09-27 23:39:55 -04:00
Matt Sherman db0c738b12 Update Edit props type for inventory-quantity 2023-09-27 23:39:43 -04:00
Matt Sherman 11d835aeb7 Update Edit props type for inventory-email 2023-09-27 23:39:31 -04:00
Matt Sherman b800b6ddcc Update Edit props type for images 2023-09-27 23:39:22 -04:00
Matt Sherman e28da2912a Update Edit props type for description 2023-09-27 23:39:12 -04:00
Matt Sherman 73815bdef7 Update Edit props type for collapsible 2023-09-27 23:39:03 -04:00
Matt Sherman 1a2041cef1 Update Edit props type for checkbox 2023-09-27 23:38:46 -04:00
Matt Sherman 857eb39b11 Update Edit props type for catalog-visibility 2023-09-27 23:38:38 -04:00
Matt Sherman ad2e50fb1c Update Edit props type for attributes 2023-09-27 23:38:23 -04:00
Matt Sherman 51370ac88a Update registerWooBlockType for variation-items 2023-09-27 17:18:20 -04:00
Matt Sherman 5bf2e92eff Update registerWooBlockType for tag 2023-09-27 17:18:08 -04:00
Matt Sherman 78fab5c8e3 Update registerWooBlockType for tab 2023-09-27 17:18:00 -04:00
Matt Sherman 898dd99be6 Update registerWooBlockType for conditional 2023-09-27 17:17:52 -04:00
Matt Sherman 57444b5a90 Fix tabs test 2023-09-27 17:00:54 -04:00
Matt Sherman e8184141a6 Changelog 2023-09-27 17:00:54 -04:00
Matt Sherman fd997269cd Remove unused import 2023-09-27 17:00:54 -04:00
Matt Sherman 9ce23c1026 Update conditional to use editedProduct from context 2023-09-27 17:00:51 -04:00
Matt Sherman 8aa42f433f Update context type for variation-items 2023-09-27 17:00:01 -04:00
Matt Sherman bd4c7847b9 Update context type for tag 2023-09-27 16:59:59 -04:00
Matt Sherman a2e9080150 Update context type for tab 2023-09-27 16:59:27 -04:00
Matt Sherman b6dc633e81 Fix typing for initBlock call in tab 2023-09-27 16:58:13 -04:00
Matt Sherman a4a44ef56b Fix typing for initBlock call in variation-items 2023-09-27 16:56:32 -04:00
Matt Sherman ef48cccc23 Fix typing for initBlock call in variations 2023-09-27 16:56:01 -04:00
Matt Sherman 57448d4627 Fix typing for initBlock call in variation-options 2023-09-27 16:55:29 -04:00
Matt Sherman 8a78340b30 Fix typing for initBlock call in toggle 2023-09-27 16:55:03 -04:00
Matt Sherman c2e60a4aa8 Fix typing for initBlock call in summary 2023-09-27 16:53:47 -04:00
Matt Sherman ac7ab2b1a0 Fix typing for initBlock call in shipping-dimensions 2023-09-27 16:53:15 -04:00
Matt Sherman ce4b7af7e8 Fix typing for initBlock call in shipping-class 2023-09-27 16:52:49 -04:00
Matt Sherman 8ff4f6b095 Fix typing for initBlock call in schedule-sale 2023-09-27 16:52:22 -04:00
Matt Sherman 9f55c320dc Fix typing for initBlock call in regular-price 2023-09-27 16:51:41 -04:00
Matt Sherman e94de74d00 Fix typing for initBlock call in section 2023-09-27 16:51:10 -04:00
Matt Sherman edaf1154d0 Fix typing for initBlock call in sale-price 2023-09-27 16:50:47 -04:00
Matt Sherman ed57f267fb Fix typing for initBlock call in radio 2023-09-27 16:49:35 -04:00
Matt Sherman dfaa1b7dfd Fix typing for initBlock call in pricing 2023-09-27 16:49:07 -04:00
Matt Sherman c8ad1de579 Fix typing for initBlock call in password 2023-09-27 16:48:41 -04:00
Matt Sherman 54209362a0 Fix typing for initBlock call in notice 2023-09-27 16:48:02 -04:00
Matt Sherman 4fc547dfb1 Fix typing for initBlock call in inventory-sku 2023-09-27 16:47:29 -04:00
Matt Sherman 1b64e7dd0e Fix typing for initBlock call in inventory-email 2023-09-27 16:46:41 -04:00
Matt Sherman 21929ccd25 Fix typing for initBlock call in inventory-quantity 2023-09-27 16:46:07 -04:00
Matt Sherman c507f02f47 Fix typing for initBlock call in description 2023-09-27 16:45:26 -04:00
Matt Sherman 4f72172426 Fix typing for initBlock call in checkbox 2023-09-27 16:44:56 -04:00
Matt Sherman 51e769d778 Fix typing for initBlock call in catalog-visibility 2023-09-27 16:43:59 -04:00
Matt Sherman a22e92bea3 Type context prop for BlockEditor 2023-09-27 16:42:25 -04:00
Matt Sherman 2f1a5f82ec Add ProductEditorContext and ProductEditorBlockEditProps interfaces 2023-09-27 16:40:56 -04:00
Matt Sherman 1e35d45c99
Template API: Expose template block id and order to client (#40263)
* Update unit tests to handle _templateBlockId and _templateBlockOrder

* Refactor get_formatted_template

* Initial @woocommerce/block-templates package

* Add block-templates to admin webpack

* Add block-templates to dependency-extraction-webpack-plugin

* Add block-templates to admin assets

* Add block-templates dependency

* Update name block

* Update syncpack

* Update regular price block

* Update tab block

* Update section block

* Add @wordpress/deprecated to package

* Deprecated initBlock

* Update attributes block

* Update catalog visibility block

* Update checkbox block

* Update conditional block

* Update collapsible block

* Allow additional props to be passed to useWooBlockProps

* Update inventory sku block

* Update inventory quantity block

* Update inventory email block

* Update images block

* Update description block

* Update radio block

* Update pricing block

* Update password block

* Update notice block

* Update shipping dimensions block

* Update shipping class block

* Update schedule sale block

* Update sale price block

* Update toggle block

* Update taxonomy block

* Update tag block

* Update summary block

* Update variations block

* Update variations options block

* Update variation items blocks

* Changelog

* Changelog

* Changelog

* Changelog

* Changelog

* Add test for registerWooBlockType

* Add @testing-library/react-hooks to devDependencies

* Add test for useWooBlockProps

* Document API

* Fix linting issues in README.md

* Fix tabs tests by mocking useWooBlockProps

* Allow header duplication under different nesting

* Remove unused import (fixes lint error)

* Update lock file
2023-09-27 13:38:56 -07:00
Nathan Silveira 8edcb06348
Add block documentation to woocommerce/product-checkbox-field (#40277)
* Rename block description

* Add documentation for product checkbox field

* Add changelog

* Improve README

* Add description to block's attributes

* Replace example

* Add markdown table with documentation

* Move image to developer.woocommerce.com

* Iterate documentation

* Address lints
2023-09-27 15:07:52 -03:00
Maikel David Pérez Gómez e6df583c65
Add a visibility toggle to the Quick actions list (#40464)
* Create toggle-visibility-menu-item component

* Add toggle-visibility-menu-item to variation-actions-menu

* Add toggle-visibility-menu-item to variations-actions-menu

* Add changelog file
2023-09-27 11:19:49 -04:00
Maikel David Pérez Gómez 6728e73505
Fix the visibility icon (#40419)
* Remove help icon on top of the hidden icon

* Remove help icon on top of the non filterable icon

* Add changelog file
2023-09-27 10:00:10 -04:00
Paul Sealock 7b9abcc79a
TreeSelectControl: Handle ROOT selection with individuallySelectParent (#40422)
* Handle selecting ROOT and includeParent

* changelog
2023-09-27 16:14:13 +13:00
Fernando Marichal 5fa98ace1a
Fix attribute list styles (#40378)
* Fix attribute list style

* Add changelog

* Move changelog

* Fix attributes style
2023-09-26 15:08:57 -04:00
Fernando Marichal a2efd31b6f
Open variation preview in a new tab (#40414)
* Open variation preview in new tab

* Add changelog

* Move changelog

* Add noreferrer
2023-09-26 12:17:21 -04:00
louwie17 247b8990d2
Add default price support to product variations (#40343)
* Optimize crud totalCount queries to avoid two requests

* Make use of same request params for totalCount as getVariations

* Add support for default_values when generating product variations

* Add test for default_values

* Add changelogs

* Only use default values of first variation

* Address some PR feedback

* Update types
2023-09-22 11:39:35 -03:00
Paul Sealock fb557cf21f
Components: TreeSelectControl - Make sure individuallySelectParent value is preserved (#40301)
* make sure individually selected parent value is preserved

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-09-22 10:20:08 +12:00
Fernando Marichal 1c497f3066
Update copy in the add variation options modal (#40280)
* Change add variation options modal copy

* Add changelog

* Clean component
2023-09-20 09:12:48 -03:00
Fernando Marichal f058e04046
Fix styling errors in variation actions in blocks product editor (#40220)
* Fix actions style

# Conflicts:
#	packages/js/product-editor/src/components/variations-table/styles.scss

* Add changelog

* Fix checkbox

* Refactor fix
2023-09-20 09:05:51 -03:00
louwie17 f9705a531b
Redirect to product editing page when product was still in auto draft (#40225)
* Redirect to product editing page when product was still in auto draft

* Make sure the prevent page does not show up when creating variations

* Add changelog and fix tests
2023-09-19 17:33:15 -03:00
louwie17 6337abc3c5
Add notice when variation prices are not set yet (#40281)
* Add notice dismissal and re-show upon validation

* Add support for notice actions

* Add changelogs

* Add set prices

* Fix build issues

* Add comment

* Replace additionalData with newData
2023-09-19 17:01:54 -03:00
Nathan Silveira 6dc109c3d8
Search for taxonomy with special characters (#40217)
* Decode html escaped characters in SelectTree

* Escape special characters when searching for taxonomies

* Add changelogs

* Remove unneeded decodeEntities

* Increment escapeHTML function to comply with what is happening in the legacy taxonomy editor

* Extract escapeHTML to @woocommerce/components
2023-09-19 14:49:19 -03:00
Fernando Marichal d72316490d
Fix error displaying block after removing variation (#40255)
* Fix error displaying block after removing variation

* Disable Add button

* Add changelog
2023-09-19 13:31:32 -03:00
Adrian Duffell 389dd1ac46
Remove link to outdated information in Components package documentation (#40015)
* Remove link to outdated information

* Add changelog
2023-09-18 16:14:08 +08:00
Fernando Marichal c661186499
Fix issue with deleting variations in new product editor (#40219)
* Fix onDelete param

* Add changelog
2023-09-15 17:20:47 -03:00
louwie17 9ea83d6382
Fix description styling and remove use of `woocommerce-page` in admin pages (#40218)
* Move the header data to the body as the header prop does not exist anymore

* Remove explicit setting of __unstableResolvedAssets given get_block_editor_settings already does this

* Remove use of woocommerce-page class in admin to avoid theme conflicts

* Add changelogs

* Revert change for quick test

* Two additional tweaks for admin related styling
2023-09-15 17:06:42 -03:00
louwie17 26f5cd5a9c
Update variation visibility icon in variations table (#40150)
* Create re-usuable hidden icon and re-use in variations table

* Add changelog
2023-09-15 15:51:28 -03:00
Nathan Silveira 95d7a6b86d
Improve Categories (Taxonomy) field UX (#40059)
* Add 'dialogNameHelpText' attribute to show on create taxonomy dialog

* Tweak CSS margins

* Add changelogs

* Rename "Save" to "Create" and set cancel button to Tertiary

* Add gray color to (optional)

* Create attribute to personalize label for parent
2023-09-14 16:02:16 -03:00
Nathan Silveira 2b5e3f2cb8
Decode HTML escaped string for tree-item and selected-items components (#40047) 2023-09-11 09:41:17 -03:00
Fernando Marichal 48016efaa6
Fix infinite category loading state (#40073)
* Fix loading state

* Add changelog

* Replace catch with finally
2023-09-08 08:58:34 -03:00