Commit Graph

1930 Commits

Author SHA1 Message Date
Maikel Perez 3658ac2d0e
List Custom Fields for New Product Editor (#45360)
* Create woocommerce/product-custom-fields block

* Register woocommerce/product-custom-fields block

* Add product-custom-fields block to the simple product template

* Create useCustomFields hook

* Create empty state

* Create CustomFields component

* Add custom fields table

* Add custom field remove button

* Hide the custom fields table base on the toggle value

* Remove non list features

* Add changelog files

* Fix linter errors

* Fix empty state styles

* Fix php linter error

* Remove context from the woocommerce/product-custom-fields-toggle-field block definition since it is not used

* Change url for the Read more about custom fields
2024-03-11 11:48:55 -03:00
Matt Sherman 99dec31578
Product Editor: Remove editable outline (#45366)
* Remove outline for the block when it is editable

* Refactor block-editor-block-list__block CSS

* Changelog
2024-03-11 10:41:33 -04:00
Maikel Perez 0a90499e7b
Custom Fields for New Product Editor (#45291)
* Register metaboxhidden_product user meta as a user rest field

* Create useMetaboxHiddenProduct to manage the user metaboxhidden_product meta field

* Create woocommerce/product-custom-fields-toggle-field block

* Register woocommerce/product-custom-fields-toggle-field block

* Create product-custom-fields feature flag

* Hide custom fields behind the product-custom-fields feature flag

* Add changelog files

* Get default postcustom user meta value when the metaboxhidden_product does not exist yet in the user object
2024-03-11 10:55:31 -03:00
Fernando Marichal fce3aeb90f
Close prepublish panel before creating new product (#45397)
* Close prepublish panel before create new

* Add changelog

* Remove close fn from blockeditor

* Close panel after clicking outside

* Refactor useEffect

* Remove empty lines

* Replace mousedown with click event

* Replace click with mouseup
2024-03-11 10:10:36 -03:00
Fernando Marichal 9865701cbb
Add message after publishing a product to pre-publish panel (#44864)
* Add message after publishing product

* add styles

* Fix animation styles

* Fix panel footer

* Remove console.logs

* Add changelog

* Fix product url

* Remove preview

* Add post-publish-section and fix animation

* Add hook useProductURL

* Add postpublish

* Refactor usePreview

* Use PostPublishSection and PostPublishTitle

* move style

* modify styles

* Fix footer

* Fix copy

* Add ts-ignore

* Add CopyButtonProps

* Fix productStatus

* Rename isPublished
2024-03-07 09:08:51 -03:00
louwie17 c740988d55
Fix multiple warning in blocks in Atomic (#45283)
* Set multiple to true

* Add changelog
2024-03-04 17:18:58 -04:00
Maikel Perez d0f095df72
Add menu item to publish button with 'Move to trash' (#44940)
* Move products to trash

* Create useProductManager hook

* Use useProductManager hook in the publish button

* Create PublishButtonMenu

* Hide move to trash when the product is already in trash

* Fix linter error

* Add changelog file
2024-03-04 14:04:38 -03:00
Fernando Marichal f24eb2efa3
Modify product header (#44711)
* Create title-bar

* Remove div

* Refactor title

* Add visibility tags

* Visibility for variations

* Modify variation title

* Add changelog

* Remove isDraft and isScheduled

* Fix tag font-weight
2024-03-04 11:14:44 -03:00
Chi-Hsuan Huang 1f27a9e877
Revert " Temporarily commented out failing date package test due to the February 29th issue" (#45239)
Revert " Temporarily commented out failing date package test due to the Febru…"

This reverts commit b471e51734.
2024-03-01 22:12:09 +08:00
Moon da64238290
Add range operator in Remote Inbox Notification (#45201)
* Add range rule in Remote Inbox Notification

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

* Add range

* Add changefile(s) from automation for the following project(s): packages/php/remote-specs-validation, woocommerce

* Update README.md

* Fix lint errors

* Make sure right-hand is an array with two elemetns -- range

* Update README

* Lint fixes

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-29 13:02:38 -08:00
Ron Rennick c84d9d944a
pin simple-git in syncpack (#44902)
* pin simple-git in syncpack

* update pnpm-lock for simple-git

* add changelog for json linting

---------

Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
2024-02-29 13:30:24 -04:00
Chi-Hsuan Huang b471e51734
Temporarily commented out failing date package test due to the February 29th issue (#45202)
* Temporarily commented out a test due to February 29th issue

* Add changelog

* Fix lint
2024-02-29 11:23:45 +08:00
Moon 49b3e510cb
Allow JSON schema string (#45151)
* Receive JSON schema string from the constructor -- this is more flexible than accpeting a physical file

* Add changelog

* Add get_bundle_json method

* Update composer version
2024-02-27 00:34:41 -08:00
Chi-Hsuan Huang ec8bd31365
Improve webpack cache-busting version parameter by using file contents hash (#44838)
* Update webpack config to use file content hash for chunks and generate asset php for styles

* Use StyleAssetPlugin to generate style.asset.php

* Remove unneed ?ver=<version> code

* Use file hash from asset file when SCRIPT_DEBUG is off

- Use file hash to load scripts/styles ?ver=<file hash>
- Add register_style() method to WC_Admin_Assets

* Load payment method promotions in admin_enqueue_scripts

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

* Add json2php

* Update doc

* Update pnpm-lock.yaml

* Fix add_print_shipping_label_script

* Add a comment to style-asset-plugin.js

* Change register_style to use WC_ADMIN_DIST_CSS_FOLDER

* Reset the outputNormal object to avoid duplicate files

* Fix type error

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-27 08:07:53 +00:00
Fernando Marichal 3d3f6d64b8
Add `Always show pre-publish checks` checkbox (#44595)
* Add show-prepublish-checks-section

# Conflicts:
#	packages/js/product-editor/src/components/prepublish-panel/prepublish-panel.tsx

# Conflicts:
#	packages/js/product-editor/src/components/prepublish-panel/style.scss

* Add show-prepublish-checks hook

* Refactor prepublish panel button visiblity

# Conflicts:
#	packages/js/product-editor/src/components/header/header.tsx

# Conflicts:
#	packages/js/product-editor/src/components/header/header.tsx

* Fix footer styles

* Add changelogs

* Add content div

* Fix styles

# Conflicts:
#	packages/js/product-editor/src/components/prepublish-panel/style.scss

* Rename recorded action

* Fix styles

* Hide panel after unchecking option

* Improve resolving

* Add new E2E test for merchant transforming classic cart to cart block (#44926)

* Update the monorepo-utils gitignore to only include index.js and its license file. (#44932)

* Fixed `@woocommerce/plugin-woocommerce` Watch (#44930)

By default `nodemon` only watches for JS file changes. This expands the
config so that it watch the file extensions that are actually
produced by builds.

* Update core package.json to remove nightly ci config (#45096)

* Update core package.json to remove nightly ci config

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

---------

Co-authored-by: github-actions <github-actions@github.com>

* Update blocks build message (#44811)

* Update blocks build message

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

* Update plugins/woocommerce/src/Blocks/Domain/Bootstrap.php

Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com>

* Update plugins/woocommerce/src/Blocks/Domain/Bootstrap.php

Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com>

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com>

* [CYS on Core] Update the themes list on the intro screen (#44822)

* Update themes list on core. Update the themes data and remove hardcoded reference to free themes.

* Update styles for the Free, Paid and active cards.

* Add the color palletes to TT4 theme.

* Update the references for default and core themes.

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

* Update the link to TT4 theme

* Update default value for price.

---------

Co-authored-by: github-actions <github-actions@github.com>

---------

Co-authored-by: Veljko V <veljano@yahoo.com>
Co-authored-by: jonathansadowski <jonathansadowski@users.noreply.github.com>
Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Roy Ho <roykho77@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2024-02-26 07:38:48 -04:00
Maikel Perez 9498687d2c
Add menu item to publish button to schedule product updates (#44783)
* Add support for other Button Props to the ButtonWithDropdownMenu component

* Refactor the PublishButton to be used in the PrepublishPanel and the Header at the same time

* Prevent button behavior when it's visually disabled

* Improve date timezone calculation in the Schedule Section component

* Revert status to publish if it was future and the date is not in the future

* Get the product status from the edited product

* Create SchedulePublishModal component

* Integrate SchedulePublishModal component

* Change the edit schedule menu item style

* Fix date time formating

* Fix date time conversion across different timezones

* Update ScheduleSection to use useProductScheduled hook

* Add changelog file

* Fix linter error

* Hide the scheduling messages behind the product-pre-publish-modal feature flag

* Validate product before trying to schedule it

* Fix schedule section publish error
2024-02-23 10:14:50 -03:00
louwie17 ddbbccf5a3
Fix download buttons in downloads section (#44816)
* Remove use of subsection actions and fix add support for subsection and section in SectionActions

* Add changelog

* Make sure subsection description block will still work.
2024-02-20 14:35:27 -04:00
Nathan Silveira ff23d1ed21
Prepare @woocommerce/product-editor for release 1.4.0 (#44817)
Prepare for release 1.4.0
2024-02-20 18:33:11 +00:00
Damián Suárez 3b4cb31d4e
[Product Block Editor]: do not include current product in the suggested products list (#44815)
* exclude current product from suggested list

* changelog
2024-02-20 14:30:01 -04:00
Nathan Silveira 9fa9431534
Export Notice component in @woocommerce/product-editor (#44812) 2024-02-20 15:01:38 -03:00
Moon 0bc6c37aa6
Add JSON schema files for remote spec validation (#44484)
* Add build scripts

* add schemas

* Add more schemas

* Update readme

* Add wc-pay-promotions schema

* Add composer version

* Update pnpm-lock.yaml

* Add changelog

* Fix markdown lint errors

* Fix markdown lint errors

* Add RemoteSpecValidator

* Update README

* Add fixture tests

* Add bundle names

* Remove Tests\\ from namespace

* Remove version from package.json

* Update packages/php/remote-specs-validation/tests/RemoteSpecValidatorTest.php

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Update packages/php/remote-specs-validation/src/RemoteSpecValidator.php

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Update packages/php/remote-specs-validation/tests/RemoteSpecValidatorTest.php

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Update packages/php/remote-specs-validation/bin/build

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Update packages/php/remote-specs-validation/README.md

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Update lock file

* Fix markdown lint errors

* Revert package.json

* Update composer

* Use jetpack changelogger 3.3.0

* Update lock file with php 7.4

---------

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
2024-02-16 13:31:21 -08:00
Fernando Marichal 587ba79350
Modify pre-publish texts after scheduling product (#44652)
* Modify prepublish texts after scheduling product

* Add changelog
2024-02-16 13:06:05 -03:00
Fernando Marichal cb967f6dfd
Change Visibility section label when a password is set (#44624)
* Change visibility section label

* Add changelog

* Fix changelog
2024-02-16 08:54:37 -03:00
Alexandre Lara 452c522b95
[DOC] Resolve incorrect branch references in Gutenberg links (#44566)
* Fix Gutenberg links in the docs pointing to the wrong branch

* Add changefile(s) from automation for the following project(s): @woocommerce/notices, @woocommerce/eslint-plugin, @woocommerce/dependency-extraction-webpack-plugin, @woocommerce/components, woocommerce-blocks, woocommerce-beta-tester, woo-ai

* Fix markdown lint errors

* Fix wrong link in the docs

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-15 14:13:28 -03:00
Fernando Marichal f09bc85875
Fix pre-publish modal styles (#44562)
* Fix pre-publish modal styles

* Improve styles

* Add changelog

* Add vars to styles

# Conflicts:
#	packages/js/product-editor/src/components/prepublish-panel/style.scss

* Fix sidebar styles

* Add changelog

* add overflow auto

* Fix quotes
2024-02-15 09:36:59 -03:00
RJ 141c2e4399
add/explat experiment name validation (#44535) 2024-02-15 12:35:23 +08:00
Maikel Perez 5af88543eb
Add the collapsible Schedule section (#44563)
* Create schedule section within the pre-publish panel component

* Add publish date time picket to the schedule section

* Enhance schedule section title to show the selected date

* Change the text of the publish button to schedule once the product is scheduled

* Add changelog file

* Fix linter errors

* Set schedule text in pre publish button too

* Fix timezone offset from getSiteSettingsTimezoneAbbreviation when the onboarding wizard is skipped
2024-02-14 13:57:53 -03:00
Matt Sherman d279466eb3
[Product Editor] Fix blank editor flash when loading product (#43840)
* EditorLoadingContext

* Use EditorLoadingContext

* Remove fallbacks

* Make sure metadata exists before using it

* Add header loading state

* Do not return skeleton

* Use EditorLoadingContext

* Update editor loading state

* Remove ProductPageSkeleton

* Remove unused import

* Remove unused import

* Handle undefined variationId and parentId in VariationSwitcherFooter

* Remove ProductPageSkeleton

* Include productId in determination of whether editor is loading

* Handle variation loading

* Fix rebase merge conflict mistakes

* Fix layout margins

* Show welcome tour and feedback bar after editor has loaded

* Changelogs

* Make loading context experimental
2024-02-14 09:57:17 -05:00
Matt Sherman a619aba5ee
Product Editor: load translations (#44520)
* Clarify when the custom message is used in useConfirmUnsavedChanges

* Changelog

* Load translations for wc-navigation and wc-product-editor scripts

* Changelog
2024-02-13 15:38:04 -05:00
Fernando Marichal 75791b2aff
Add visibility section to pre-publish panel (#44434)
* Add visibility-section

* Fix generic checkbox

* Move visibility-section

* Add isPasswordRequired to store

* Change password checked

* Add tracks events

* Fix generic checkbox

* Add changelog

* Create reequire-password component

* Create CatalogVisibility component

* Use CatalogVisibility component

* Add changelog

* Fix lint

* Remove requirePassword from store

* Add useEffect to update checkbox

* Remove object spread from state

* Remove empty line

* Fix useEffect

* Refactor if in useEffect

* Refactor catalog-visibility

* Modify useEffect

* Remove not used import
2024-02-13 10:09:06 -03:00
Fernando Marichal dd64e2724a
Refactor section and subsection blocks (#44502)
* Add section-header component

* Use section-header and remove inventory-email scss

* Add changelog

* Rename file type
2024-02-09 15:47:02 -03:00
Maikel Perez f68467ff96
Filtering product variations by attributes that are not associated to any generated variations leads to blank variations results (#44505)
* Add empty state when filtering variations by attribute terms and the response is empty

* Add changelog file

* Fix linter errors
2024-02-09 15:46:34 -03:00
Maikel Perez 0d52fdb738
Toggle Visibility doesn't seem to work always as it should in the product variations (#44508)
* Fix toggle visibility on bach update variations

* Add changelog file
2024-02-09 15:46:24 -03:00
Fernando Marichal 30f66aa94f
[Product editor block]: Rename the Add button to Publish (#44461)
* Rename Publish button

* Fix e2e tests

* Add changelog

* Add WC changelog

* Modify "Product published" copy
2024-02-09 15:19:35 -03:00
Nathan Silveira 596bf271ab
Prepare product-editor package for release 2.0 (#44507) 2024-02-09 12:45:22 -04:00
Fernando Marichal a89d2572f0
Product Editor: Subsection block (#43725)
* Add SubsectionInterface

* Replace use of add_section inside sections

* Add Subsection class

* Add subsection block component

* Add subsection-description block

* Update deprecation note

* Add changelogs

* Fix lint

* Add get_subsection_by_id

* Add tests

* Fix ProductFormTemplate lint

* Fix CustomProductFormTemplateTest lint

* fix readme

* Fix lint

* Replace add_section with add_subsection

* Fix readme

* Fix markdown file multiple headings duplication
2024-02-08 15:44:49 -03:00
Paul Sealock c6e11562ac
Remote Specs Testing package: Add new package (#44419) 2024-02-08 12:46:26 +13:00
Fernando Marichal 19a78cd176
Add pre-publish sidebar (#44331)
* Add prepublish sidebar

* Add openPrepublishSidebar to store

* Add changelog

* Rename modal and small refactor

* Add feature flag

* Move prepublish sidebar

* change import path

* Rename classes

* Fix width

* Fix styles

* Rename prepublish panel

* Rename div class

* Remove onSuccess from PublishButton

* Fix panel position

* Use actions instead of sidebar

* Add wc-admin changelog

* Move changelog

* Fix lint
2024-02-07 15:30:33 -03:00
Guilherme Pressutto 4dcc7d8bf8
Make state optional when filling address with e2e-util (#44090)
Co-authored-by: Francesco <frosso@users.noreply.github.com>
2024-02-06 09:30:53 -08:00
Matt Sherman 68247d13de
Product Editor: Export recent SlotFills as __experimental (#44285)
* Make header slotfills experimental

* Make variation quick update menu items experimental

* Changelog
2024-02-06 09:33:24 -05:00
Maikel Perez 26bcbb0417
Add an empty state to the variations table when there are no options added yet (#44163)
* Create variation empty state when no variable attributes are asigned to the product

* Add changelog file

* Remove the Add new button when a custom empty state is set

* Conditionally invalidate resolution before requesting a new variations page
2024-02-05 18:00:37 -03:00
Matt Sherman 7e7b78f943
[create-product-editor-block] Fix product editor block registration (#44194)
* Use registerProductEditorBlockType

* Changelog

* Update changelog to provide more detail
2024-02-05 15:59:39 -05:00
Damián Suárez 35b5677860
[Product Block Editor]: fix the top area for the dashboard (#44370)
* fix the padding-top for the dashboard

* changelog
2024-02-05 15:11:21 -03:00
Damián Suárez 4492698340
[Product Block Editor]: use Label component to render Textarea field block label (#44222)
* use Label to render base control label

* changelog
2024-02-02 18:57:41 -03:00
Damián Suárez 207e8de73d
[Product Block Editor]: add plain and rich text mode to the Textarea field block (#44191)
* introduce `mode` attribute

* move block props to wrapper el

* render plain text mode

* minor const name change

* changelog

* add toolbar buttons only in rich-text mode

* set rich-text mode as default
2024-02-02 16:04:01 -04:00
Damián Suárez 951e5ecce6
[Product Block Editor]: redefine the app dashboard size (#44166)
* chnages how to define the editor dashboard size

* remove onBlur stuff from summary block

* add a @todo note about dashboard padding top

* changelog
2024-02-02 15:57:28 -04:00
Damián Suárez f1236696d9
[Product Block Editor]: use Textarea block in the variation description field (#44151)
* use text-area for variation desctiption field

* changelog

* tweak // Translators string

* use var to define textarea border color

* remove optional from description label
2024-02-02 15:50:36 -04:00
Maikel Perez eaa791f7da
Hide Downloads section under Toggle for product variations (#44152)
* Create DownloadableProductTrait for common downloadable blocks creation

* Use DownloadableProductTrait in SimpleProductTemplate

* Use DownloadableProductTrait in ProductVariationTemplate

* Remeber downloadable files in product variations

* Add changelog file

* Fix php linter error

* Unlink downloads and downloadable product props so they can be managed separately

* Remove invalid margin bottom from the uploader label

* Add changelog file
2024-02-02 10:04:42 -03:00
Nathan Silveira 862383e1eb
Fix invalid value being propagated on change event for number input (#44195) 2024-02-01 12:49:12 -03:00
Maikel Perez 861cc7cc02
Add common options to the variations options empty state (#44001)
* Always show Variation options and Variations sections within the Variations tab

* Remove woocommerce/product-variations-fields block since it's not needed anymore

* Create ProductTShirt image for variation options empty state

* Add renderCustomEmptyState to the attribute control component to be able to set a not default empty state

* Render a custom empty state for variation options

* Adds defaultSearch prop to NewAttributeModal so it can be used to start searching right after the modal is shown

* Let the empty state adds an attribute that matches a given text

* Add changelog files

* Fix linter errors
2024-02-01 11:18:23 -03:00
github-actions[bot] 495bf4eeb2
Prepare Packages for Release (#44211)
Automated change: Prep @woocommerce/create-woo-extension for release.

Co-authored-by: psealock <psealock@users.noreply.github.com>
2024-01-31 18:58:06 +13:00
Fernando Marichal e703b3d947
Add slotFills for header items (#43687)
* Add slotFills for header items

* Refactor plugin-header-items

* Add changelog

* Remove order prop

* Fix lint

* Change constant name

* Rename constant

* Add callback to fills

* Make icon not required

* Add fallback plugin
2024-01-30 16:58:20 -03:00
Damián Suárez 05aa24df0b
[Product Block Editor]: introduce note attribute to Label component (#44198)
* do not use createInterpolateElement

* introduce `note` to Label component

* changelog
2024-01-30 16:40:30 -03:00
Nathan Silveira e0728e6d11
Fix undefined meta_data on slow connections (#44197) 2024-01-30 18:08:08 +00:00
Damián Suárez 20fe832f8b
[Product Block Editor]: fix e2e test that happens in the text-area block (#44184)
* add components-summary-content class to rich text

* changelog
2024-01-30 12:33:52 -03:00
Nathan Silveira c1a5b60245
Add isLoading to useProductMetadata hook (#44156)
* Add isLoading to useProductMetadata hook

* Add unit test

* Rename `updateMetadata` to `update`

* Remove content from inside useSelect
2024-01-30 10:05:01 -03:00
Paul Sealock 740c5e40ae
Create-woo-extension: Update WC version (#44107)
* Update version

* Add changefile(s) from automation for the following project(s): @woocommerce/create-woo-extension

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-29 21:29:37 +00:00
Damián Suárez 74d0b39bb0
[Product Block Editor]: introduce TextArea field block (#44104)
* introduce TextAreaBlockEdit block

* reglister text area block

* use text-area block in the summary block

* changelog

* changelog

* fix whitespace lint issue

* remove unused types

* intrduce placehholder attribute

* property is the only required attribute

* tidy block attributes

* use useProductEntityProp()

* define fallback value

* remove unused CSS class

* organize attrs

* do not implement tooltip yet

* fix eslint error

* update text-area keywords
2024-01-29 17:14:17 -03:00
Nathan Silveira 8e79cfa3ea
Fix product editor UI misbehaving in Calypso (#44132)
* Fix product editor UI misbehaving in custom adminmenu widths (e.g. Calypso)

* Extract logic to useAdminSidebarWidth hook
2024-01-29 14:09:06 -05:00
Damián Suárez cd3feaa3dd
[Product Block Editor]: always show "loading" state when choosing suggested products (#44053)
* add forceRequest param

* changelog

* force request when getting suggestions for linked
2024-01-24 19:08:40 -03:00
Damián Suárez aaf9981e90
[Product Block Editor]: improve getting suggested products from linked product section (#44047)
* introduce getSuggestedProductsFor helper

* use suggested products to get choices

* update helper to the data store

* changelog
2024-01-24 18:11:31 -03:00
Damián Suárez 65d71fa1e2
Data: reduxify suggested products (#44043)
* use Thunks in wc/admin/products store

* first implementation

* changelog

* fixing tests

* remove unused __meta prop

* update constant name

* fix eslint issue
2024-01-24 16:56:41 -04:00
Matt Sherman 1ea439fb61
[Product Editor] Variation quick actions succeed when sku is inherited from parent (#44017) 2024-01-24 09:50:00 -05:00
Nathan Silveira c7d4c88270
Expose metadata as object from useProductMetadata hook (#43860)
* Add useParentMetadata hook

* Move functionality to existing useProductMetadata hook

* Update changelog

* Remove deleted hook from index

* Update useProductMetadata API and unit tests
2024-01-23 17:50:36 -03:00
Fernando Marichal 2acbb3d3fb
Add slotFill for variation menus (#43441)
* Add slotFills to main variation actions

* Add slotFills to groups

* Create variation-actions component

* Add references

* Remove file and change reference

* Add Dropdown

* Add styles

* Add changelog

* split variation-actions-menu

* Add tests

* Remove variation-actions-menu and variations-actions-menu

* Rename variation-actions and add tests

* Rename VariationSingleUpdateMenuItem

* Rename single-update

* Add supportsMultipleSelection and slotFill rename

* Add component export

* Rename groups

* Show multipleSelection items in both components

* Take fills as MenuItems

* Remove __experimental from slotFill

* Fix lint

* Add onClick to slotFill

* Rename constant QUICK_UPDATE, add new constant

* Add tests for getGroupName and getMenuItem

* Rename variation-actions tests

* fix test description

* Add onChange, onClose and selection to slots

* Refactor slotFill

* Refactor slotFill file

* Rename QuickUpdateMenu to MultipleUpdateMenu

* Modify tests

* Fix test name

* Improve import

* Always return array of selected items

* Create MenuGroup for every extension menu items

* Group fills
2024-01-23 11:27:03 -05:00
louwie17 1a4ebebf6a
Fix description toolbar with latest GB version (#43835)
* Initial changes to fix the toolbar in the iframe editor

* Moved toolbar to header and respect fixedToolbar preference

* Only render Gutenberg toolbar with specific version

* Update GB version

* Fix build issue

* Add fixed toolbar menu

* Remove unused import

* Add changelogs

* Fix lint errors

* Fix PHP lint error
2024-01-23 11:17:37 -04:00
Maikel Perez 26a546954a
Hide Downloads section under Toggle (#43864)
* Add Include downloads to show/hide the Downloads section

* Fix margin top for none first child nested sections

* Add changelog files

* Fix php linter errors
2024-01-23 12:12:52 -03:00
Maikel Perez 4c29a65378
Track Linked Products feature events (#43828)
* Track  (props:  ids,  ids)

* Track  ( props:  ( template id ),  : ( if unsupported or not ) )

* Track  ( props:  ( template id ) )

* Track  ( props: :  | , same as product value )

* Fix advice card to support persistent dismiss via a preference id or non persistent one using the local state

* Track  ( props: :  | , same as product value )

* Track  ( props: :  | , same as product value )

* Track  ( props: :  | , same as product value )

* Track  ( props: :  | , same as product value )

* Add changelog file

* Fix linter error

* Track linked_products_product_add when adding a new product to the linked product list
2024-01-22 14:18:31 -04:00
Christopher Allford db8da8d712
Properly Configured Wireit Production Builds (#43716) 2024-01-22 10:13:45 -08:00
Maikel Perez d174fb39db
[Enhancement] Add a featured product button (#43664)
* There's a star button on the right side of the name field. It's centered vertically.

* Clicking it marks the product as featured

* When hovered, we show a tooltip that reads: Mark as featured

* When clicked, the icon changes from star-outline to star-filled. Clicking it again reverts to the original icon.

* Add changelog file

* Change the tooltip text depending on the featured flag
2024-01-19 12:03:11 -03:00
Maikel Perez aa57be7c97
Hide the product type selector dropdown when click outside (#43798)
* Hide the product type selector dropdown when click outside

* Add changelog file
2024-01-19 08:32:59 -04:00
Matt Sherman 824dc6be51
Remove BlockTemplateRegistry (#43589) 2024-01-17 07:12:12 -05:00
Damián Suárez 8878f00707
[Product Block Editor]: show three products by default in the Linked Products tab (#43698)
* pick three products by default

* changelog
2024-01-17 05:33:18 -03:00
Matt Sherman 3838975b24
[Product Editor] Fix blank editor when clicking Add New while already in editor (#43702) 2024-01-16 13:04:48 -05:00
Damián Suárez 0d878afb8e
[Product Block Editor]: add loading for the `Choose products for me` button (#43656)
* store is loading when chossing products for me

* disable choose btn when it's loading

* changelog

* restore is busy animation styles when disables

* restore changes

* fiox rebase issue

* restore disabling button
2024-01-16 10:35:03 -03:00
Damián Suárez ea3504b372
[Product Block Editor]: exclude the current product from the suggested ones to use in the Linked Product tab (#43662)
* exclude the current product from the suggested list

* changelog
2024-01-16 09:05:04 -04:00
Damián Suárez 68fa0dd338
[Product Block Editor]: fallback with random products when no related products (#43584)
* add fallbackToRandomProducts option to getRelatedProducts()

* fallback to random when there isn't related products

* changelog

* update and tweak doc

* introduce POSTS_NUMBER_TO_PICK const
2024-01-16 09:13:55 -03:00
Christopher Allford 95bc1189e5
Update `wireit` & Optimize Builds (#43595)
This bumps the version to 0.14.3 so that we can take advantage of some
upstream improvements. It also makes some changes to the way our
builds and watches work to minimize the number of unnecessary
Node processes involved in the execution.
2024-01-15 14:06:55 -08:00
Fernando Marichal d929994afb
Show feedback prompt only once (#43164)
* Show feedback prompt only once

* Add changelog

* Fix feedback prompt

* Move changelog

* Fix feedback prompt visibility

* Add modalShown logic to ces
2024-01-15 13:44:38 -04:00
Damián Suárez 8974b86a04
[Product Block Editor]: relocate block actions in the sections area (#43555)
* handle section actions styles from section block

* rename DownloadBlockEdit

* remove unneeded wrap el from linked product list

* put Choose an Image button in the actions section

* move attribute control to block actions section

* changelog

* remove unused clientId prop

* tweak Image button

* remove `should show subtitle and "Add new" button` test
2024-01-15 11:02:54 -03:00
Christopher Allford 758df4854d
Use `ci-jobs` Utility For `ci.yml` Matrix (#43532)
This adds support for using the `pnpm utils ci-jobs` command in our `ci.yml` file. One of the bigger benefits to this change too is that we're now distributing a bundled version of the utils tool. This lets us run it without actually having to install the repo and will let us speed up any workflows that currently do.
2024-01-12 20:32:14 -08:00
Maikel Perez 4f8922aa0b
Remove Variable product template from the product template list (#43422)
* Remove variable-product-template from the product template list

* Add changelog files

* Redirect the variable product to the new experience now that is does not have a product template anymore

* Fix php linter error
2024-01-12 18:47:15 -03:00
louwie17 ec85c4bd4a
Fix variations initial load (#43583)
* Retrieve new variations if not already generating

* Add changelog

* Fix lint error
2024-01-12 17:13:22 -04:00
Matt Sherman ee6642e0c7
Product Editor: Load layout templates from the REST API (#43384)
* Move ProductTemplate type

* useProductTemplate

* Use useProductTemplate

* Use useLayoutTemplate

* Handle if window.productBlockEditorSettings doesn't exist

* Unit tests for useProductTemplate

* Fix fallback in useProductTemplate

* Remove layoutTemplates from ProductEditorSettings on client

* Fallback to simple-product layout template

* Unit test to verify the standard product template is used if product type is variable

* Use standard product template if product type is variable

* Unit test to verify product type is used to match if product template id matches a template with a different product type

* Make sure product type matches on product template, unless variable, in which case we match simple

* Remove layoutTemplates and layoutTemplateEvents from global

* Changelog

* Changelog

* Import types only
2024-01-12 11:54:35 -05:00
Damián Suárez ec2a3f839f
[Product Block Editor]: introduce `<SectionActions />` slot (#43540)
* pick clientId by using hook

* do not pass clientId to BlockFill component

* pick clientId from core hook

* introduce SectionActions slot component

* expose SectionActions slot component

* fix ts issue

* changelog

* fix closing component bug

* do not pass clientId to the BlockSlot instance

* revert changes in the description block

* fix name for the section actions component

* export section actions properly

* add a warning when the slot DOM doesn't exist

* define the name explicitely

* export SectionActions component name

* import SectionActions from product list cmp

* rename ProductListBlockEdit component fn
2024-01-12 10:20:39 -03:00
Nathan Silveira 97fecbd605
Replace Tooltip on Label and checkbox controls (#43513)
* Replace wordpress Tooltip with woocommerce Tooltip

* Add nowrap to links inside tooltip

* Add margin-left to tooltip

* Move logic to handle not opening multiple popovers to inside tooltip component

* Add changelogs

* Remove unused prop
2024-01-11 21:49:50 -03:00
Damián Suárez 47e1f50ae2
[Product Block Editor]: implement `Choose products for me` button (#43520)
* implement `Choose products for me` button

* clean

* selectSearchedProductDispatcher accepts products array

* rename component with LinkedProductListBlockEdit

* pull and set linked products from choose button

* changelog

* rollback minor changes

* fix typo in fn

* pull the related product from core entities

* minor
2024-01-11 17:33:07 -03:00
Damián Suárez d0d056c60e
Data: add selector to get related products (#43489)
* add getRelatedProducts to get related products

* changelog

* add a resolver to pull the related products

* minor jsdoc enhancement

* query Product params should be optional

* fix ES issue

* minor TS enhancement

* use createSelector() helper
2024-01-11 12:56:59 -03:00
Damián Suárez c487c84778
[Product Block Editor]: use AdviceCard empty state sections (#43405)
* use AdviceCard for Grouped product

* AdviceCard is not dismissible for grouped

* replace custom implementation with AdviceCard cmp

* changelog
2024-01-10 18:11:41 -03:00
Nathan Silveira 00d205626d
Use different delays for initial click and hold when incrementing number on NumberControl (#43479) 2024-01-10 17:38:09 -03:00
Maikel Perez 1ad48760c9
Redirect supported product types to the new experience based on the product template associated to it (#43341)
* Redirect supported product types to the new experience based on the product template associated to it

* Add changelog file

* Fix linter error

* Redirect using the product type first and then the associated product template

* Set the product template id also for unsupported product templates

* Add changelog file

* Remove supported_product_types from the RedirectionController since the product_templates is used instead

* Fix php linter error
2024-01-09 18:31:25 -03:00
Nathan Silveira 548987d758
Add step buttons for Number block and component (#43045)
* Add showStepButtons attribute for Number block and component

* Use native step buttons

* Revert "Use native step buttons"

This reverts commit 8425d17399.

* Use custom step buttons and hide them when field is not focused

* Revert type="number" as it's not working well with number formatting

* Disable autocomplete

* Remove leftover showStepButtons from documentation

* Prevent default event when pressing up/down

* Change to onKeyDown event

* Implement timeout to hold + and - buttons

* Remove unnecessary onBlur and prevent default event when onKeyUp

* Fix TS issue

* Update changelog
2024-01-09 18:08:38 -03:00
Matt Sherman 4114f989e5
Implement useLayoutTemplate hook (#43347)
* Add @wordpress/core-data dependency

* Update lock file

* Implement useLayoutTemplate

* Changelog

* Allow layoutTemplateId param to be undefined

* Only enable useEntityRecord when layoutTemplateId is set

* Workaround for query made when layoutTemplateID is not set

* Use getEntityConfig instead of getEntity

* Update comment with core-data version

* Add doc for useLayoutTemplate
2024-01-09 15:42:20 -05:00
Damián Suárez 9dce7fc71d
[Product Block Editor]: improve and tweak AdviceCard component (#43427)
* rename image prop with children

* update AdviceCard usage

* tweak AdviceCard styles

* tweak advice cards in the Linked Product feature

* changelog

* tweak story layout
2024-01-09 16:43:34 -03:00
Damián Suárez ed5c7b265c
[Product Block Editor]: Add new image components (#43383)
* remove unused image component

* add Shirt image component

* add Glasses image component

* changelog
2024-01-09 11:49:49 -03:00
Damián Suárez d9fd8cee20
[Product Block Editor]: tweak styles and layout of AdviceCard component (#43272)
* set max height for the AdviceCard component

* changelog

* remove Flex components

* tweak dismiss button size

* update changelog

* tweak layout depending on isDismissible or not

* set min-height fior advice card instead

* add bottom padding to card boddy
2024-01-08 15:45:56 -03:00
Nathan Silveira 245fea22ac
Provide recently updated data for the validate function in the useValidation hook (#43320)
* Allow providing recently updated data for the validate function in the useValidation hook

* set newData parameter as optional
2024-01-08 12:12:10 -03:00
Maikel Perez a7627fbf0e
Linked product list empty state (#43163)
* Add product search field to the linked product list block

* Add empty state to the linked product list block

* Fix AdviceCard styles

* Create skeleton for the linked product list block

* Fix linter errors

* Move the product list skeleton to the product list component folder

* Revert AdviceCard changes

* Remove upsells and cross-sells block to use linked-product-list block instead

* Add changelog files
2024-01-05 15:26:06 -05:00
Nathan Silveira d2636f55f8
Add HOC to hide inventory collapsible block when nothing is inside it (#43228)
* Add expression-evaluation package

* Export useEvaluationContext

* Add HOC to hide collapsible block when nothing is inside it

* Add changelog

* Create a separate place for WP hooks and move existing hook to it

* Reintroduce line deleted automatically

* Refactor to useSelect
2024-01-05 15:01:12 -03:00
Maikel Perez da04df38b4
Fix performance issue when modifying product metadata (#43299)
* Fix performance issue when modifying product metadata

* Add changelog file

* Fix linter error
2024-01-04 15:38:00 -05:00