Commit Graph

1895 Commits

Author SHA1 Message Date
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
Damián Suárez 17c8354ad9
[Product Block Editor]: Be able to dismiss AdviceCard instances (#43124)
* introduce packages/js/data/src/user/types.ts pref

* be able to dismiss the Upsells advice

* rename user pref key

* typify product_advice_card_dismissed prop

* store is dismissed state in the user pref

* delegate the dismiss state to the component

* changelog

* remove console.log :'(

* fix TS issue

* fix TS issue

* changelog
2024-01-04 12:17:03 -03:00
Ron Rennick 8550da9959
bump php version in packages/js/*/composer.json (#42020)
* bump php version in packages/js/*/composer.json

* add package changelogs

---------

Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
2024-01-04 10:18:34 -04:00
Maikel Perez f34bb52f9e
Linked product list (#43145)
* Create and register product-linked-list-field block

* Add upsells and cross-sells blocks to the simple product template

* Create formatted price component

* Add linked product table to the linked product list block

* Add remove product button to each product row

* Add see product page button

* Add link to the product name so it can be edited in a new tab

* Fix some styles

* Add product search field to the linked product list block

* Fix styles

* Add changelog files

* Fix linter error

* Fix rebase conflicts

* Use useProductEntityProp instead of useEntityProp within product-linked-list-field block

* Move the product list to its own component

* Move the product select to its own component

* Move the product image to its own component

* Fix linter error
2024-01-04 08:34:53 -05:00
Damián Suárez b6f8ab94f5
[Woo beta tester]: add User Preference panel (#43125)
* introduce UserPreference panel

* render user preference panel

* expose UserPreferences type

* introduce force mode to update user pref

* rename global object with `__wcbt`

* changelog

* changelog
2024-01-03 17:42:18 -03:00
Damián Suárez 84ed581215
[Product Block Editor]: add className prop to ButtonWithDropdownMenu component (#43136)
* add className to the ButtonWithDropdownMenu cmp

* chnagelog

* move changelog file location
2024-01-03 08:34:05 -03:00
Tomek Wytrębowicz f35b6e2f9c
Fix sizing of `<SelectControl>` & UI bug for `<ReportFilters>` (#42969)
Fix the style of select control components 

Set `box-sizing` to `border-box`, to prevent `<SelectControl>` from being wider than its container.
2024-01-02 22:42:19 +01:00
Fernando Marichal 89c82f00e6
Add tooltip attribute to Pricing field (#43144)
* Add tooltip attr to Pricing field

* Remove Fragment reference

* Add tooltip to regular price

* Add tooltip to sale price

* Remove "labelToShow" const

* Add changelog
2023-12-29 16:42:59 -03:00
Fernando Marichal cb9bd1ae76
Revert "Show feedback bar only once (#41787)" (#43178)
* Revert "Show feedback bar only once (#41787)"

This reverts commit defa590f32.

* Add changelog
2023-12-29 16:33:59 -03:00
Alexandre Lara 4efd2123a3
[Docs] Update links from WooCommerce.com to Woo.com for the Woo Blocks documentation (#43055)
* Update woocommerce.com URLs in documentation and code files

* Add changelog

* Fix github repository link in extend-rest-api-add-custom-fields.md

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* Add github reporter (#42974)

* Add github reporter

* Add changelog

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>

* Fix product task redirect to support grouped and external products (#43051)

* Rearrange product redirection logic to better accept grouped and external produc types

* Add changelog

* Modify feedback modal actions (#43005)

* Adapt feedback modal actions

* Add changelogs

* Modify comments

* Fix tests

* Fix test

* Update class-wc-gateway-bacs.php (#43054)

* Update class-wc-gateway-bacs.php

Fix typo in textdomain

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

---------

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

* [Product Block Editor]: Add `Linked product` tab (#43009)

* add linked-products to group IDs

* add Linked Products tab

* tweak hideConditions condition

* changelog

* fix typo in doc comment

* Introduce a product type selection within the new experience (#41823)

* Create a relation between the product type and the product block template

* Add 'patterns' to name the kind of products that can be created for a specific template

* Resolve template using its id as a template query param

* Rename ProductEditPattern to ProductTemplate

* Rename get_patterns hook to woocommerce_product_editor_get_product_templates

* Return the list of templates to the client

* Set layout template events as array

* Register the layout template based on the product template or the post type in case of product variations

* Registering non supported product types

* Create and register the woocommerce/product-details-section-description block

* Add the product type to the section description

* Create product type selector

* Fix menu item style

* Highlight selected menu item

* Set the selected product template

* Set product template title to lowercase in the content description

* Rename blocks by blockTemplates under the AbstractBlockTemplate class

* Rename to woocommerce_product_editor_product_templates filter

* Remove product_template_ prefix from the supported_product_types map

* Rename get_formatted to to_JSON and convert the props to client side like

* Refactor get_product_templates

* Fix icon resolution

* Add a confirmation modal for unsupported product templates

* Add changelog files

* Remove product types using for testing

* Fix redirection when changing to a non supported product template

* Set the change button state to busy when it is saving the product

* Fix php linter errors

* Fix rebase conflict

* Move ProductTemplate to Automattic\WooCommerce\Admin\Features\ProductBlockEditor namespace

* Add the to_json definition to the BlockTemplateInterface

* Create default product template by custom product type if it does not have a template associated yet

* Fix some comments and product template creation validation

* Add support to load the product template icon from an external resource

* Fix php linter

* Fix the changelog description

* [Experimental] Interactivity Dropdown multi-select mode, ratings filter and introduce each directive (#42981)


---------
Co-authored-by: David Arenas <david.arenas@automattic.com>

* Introduce the transient files engine (#42877)

Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>

* Change marketplace install API request to POST instead of GET (#43033)

* Change marketplace install API to using POST instead of GET
* Fix linting error
* Add changefile(s) from automation for the following project(s): woocommerce

---------

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

* Prep trunk for 8.6 cycle (#43021)

Prep trunk for 8.6 cycle with version bump to 8.6.0-dev

Co-authored-by: WooCommerce Bot <no-reply@woo.com>

* Add Playwright tests for All Reviews, Reviews by Product and Reviews by Category blocks (#42903)

* Remove Reviews blocks Puppeteer tests

* Minor code cleanup

* Typos

* Create publishAndVisitPost() editor util

* Fix subcategories when importing products in Playwright and add reviews

* Add Reviews blocks tests in Playwright

* More typos

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

* Create a 'reviews' object in data.ts so we can store reviews data in one single place

* Update test so instead of creating a new post in each test, we go to the already-created post

* Add source comments to reviews data to match it with the script

---------

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

* Release: Remove 8.5 change files (#43022)

Delete changelog files from 8.5 release

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
Co-authored-by: Alex López <alex.lopez@automattic.com>

* Delete changelog files based on PR 43033 (#43079)

Delete changelog files for 43033

Co-authored-by: WooCommerce Bot <no-reply@woo.com>

* Delete changelog files based on PR 43051 (#43081)

Delete changelog files for 43051

Co-authored-by: WooCommerce Bot <no-reply@woo.com>

* Interactive Price Filter: use `context` instead of `state` (#42980)

* feat: use context instead of state

* fix: temporary move the context to inner element for diffing to work

* fix: update context before navigation for optimistic UI

* Load google analytics gtag script asynchronously in WooCommerce Blocks (#43040)

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

* set WOOCOMMERCE_BLOCKS_PHASE to 1 for the production build (#43074)

* set WOOCOMMERCE_BLOCKS_PHASE to 1 for the production build

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

---------

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

* Revert "Fix schedule sales error" (#43094)

Revert "Fix schedule sales error (#42700)"

This reverts commit 9b800aa179.

* [Product Block Editor]: add Linked product sections. First approach. (#43013)

* add Linked products, Upsell section

* changelog

* add Cross-lens section

* add links to the Upsell sections

* changelog

* fix lint issues

* fix lint issus

* fix linting issue :-|

* check whether the linked product group is defined

* [Product Block Editor]: introduce ShoppingBags component (#43042)

* add ShoppingBags component

* Add ShoppingBag story

* changelog

* Fix: Collection data being leaked between Collection Filters blocks (#43044)

* fix: CYS - change heading color (#43076)

* fix: CYS - change heading color

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>

* Delete changelog files based on PR 43074 (#43118)

Delete changelog files for 43074

Co-authored-by: WooCommerce Bot <no-reply@woo.com>

* [Product Block Editor]: fix feature flag to hide the Linked products (#43119)

* fix flag to hide/show product editor

* changelog

* Add changelog

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Jonathan Lane <lanej0@users.noreply.github.com>
Co-authored-by: Jon Lane <jon.lane@automattic.com>
Co-authored-by: louwie17 <lourensschep@gmail.com>
Co-authored-by: Fernando Marichal <fernando.marichal@automattic.com>
Co-authored-by: Marc Guay <marc.guay@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Damián Suárez <rdsuarez@gmail.com>
Co-authored-by: Maikel David Pérez Gómez <maikel.perez@automattic.com>
Co-authored-by: Sam Seay <samueljseay@gmail.com>
Co-authored-by: Néstor Soriano <konamiman@konamiman.com>
Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
Co-authored-by: Kyle Nel <22053773+kdevnel@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: WooCommerce Bot <no-reply@woo.com>
Co-authored-by: Alex López <alex.lopez@automattic.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-12-29 12:28:11 -03:00
Damián Suárez b36023e8aa
[Product Block Editor]: render empty state for the Cross-sells section (#43143)
* introduce cross-sells product field block

* export Cross-sell block

* add Cross-sells block instance into the Cross-sell section

* fix importing image bug

* changelog

* changelog

* remove unexpected console.log instance
2023-12-28 09:06:01 -05:00
Niels Lange 591adc6248
Fix typo introduced in #43116 (#43148)
* Fix typo introduced in #43116

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-28 14:14:50 +07:00
Damián Suárez 35a4f077cf
[Product Block Editor]: render empty state for the Upsells section (#43116)
* Upsells block: scafolding

* export Upsells block

* add Upsells block into the Upsells section

* render empty state for the Upsells section

* iadd hardcoded isEmpty flag

* changelog
2023-12-27 19:40:03 -03:00
Damián Suárez 378f610d3a
[Product Block Editor]: add CashRegister image component (#43127)
* rename shipping bags folder

* introduce CashRegister image component

* simplify Shopping bags story

* changelog

* clean svg code

* remove unused React lib from story
2023-12-27 19:38:51 -03:00
Damián Suárez ccdfb16fc8
[Product Block Editor]: Introduce ButtonWithDropdownMenuProps component (#43103)
* first approach

* improve story. fix TS issues

* support `variant` prop

* add position props

* add offset popover prop

* reorganize popover props

* changelog

* set component roles

* rotate chevron when opened

* Introduce defaultOpen prop

* export component

* improve story

* ensure 1px of gap

* reorganize types

* change API. Add Readme,md

* dropdownButtonLabel is optional

* fix border-radious

* minor change in doc

* pass down defaultOpen prop
2023-12-27 12:29:37 -03:00
Maikel David Pérez Gómez 2a4c4e8e1e
Product template association (#43120)
* Load the product template from the product meta data

* Save product template id as part of the product meta data

* Add changelog file

* Fix linter error
2023-12-26 15:11:17 -05:00
Damián Suárez 5ee2447145
[Product Block Editor]: Introduce AdviceCard component (#43082)
* introduce AdviceCard component

* import advice card styles

* add onDismiss() prop

* tweak border style

* implement dashed border

* log the onDismiss function

* changelog

* tweak layout

* tweak card border style
2023-12-26 15:54:29 -03:00
Damián Suárez 67e01c1f6b
[Product Block Editor]: introduce ShoppingBags component (#43042)
* add ShoppingBags component

* Add ShoppingBag story

* changelog
2023-12-25 09:21:29 -03:00
Damián Suárez 7be2481381
[Product Block Editor]: add Linked product sections. First approach. (#43013)
* add Linked products, Upsell section

* changelog

* add Cross-lens section

* add links to the Upsell sections

* changelog

* fix lint issues

* fix lint issus

* fix linting issue :-|

* check whether the linked product group is defined
2023-12-22 18:44:44 -03:00
Maikel David Pérez Gómez a592a473d3
Introduce a product type selection within the new experience (#41823)
* Create a relation between the product type and the product block template

* Add 'patterns' to name the kind of products that can be created for a specific template

* Resolve template using its id as a template query param

* Rename ProductEditPattern to ProductTemplate

* Rename get_patterns hook to woocommerce_product_editor_get_product_templates

* Return the list of templates to the client

* Set layout template events as array

* Register the layout template based on the product template or the post type in case of product variations

* Registering non supported product types

* Create and register the woocommerce/product-details-section-description block

* Add the product type to the section description

* Create product type selector

* Fix menu item style

* Highlight selected menu item

* Set the selected product template

* Set product template title to lowercase in the content description

* Rename blocks by blockTemplates under the AbstractBlockTemplate class

* Rename to woocommerce_product_editor_product_templates filter

* Remove product_template_ prefix from the supported_product_types map

* Rename get_formatted to to_JSON and convert the props to client side like

* Refactor get_product_templates

* Fix icon resolution

* Add a confirmation modal for unsupported product templates

* Add changelog files

* Remove product types using for testing

* Fix redirection when changing to a non supported product template

* Set the change button state to busy when it is saving the product

* Fix php linter errors

* Fix rebase conflict

* Move ProductTemplate to Automattic\WooCommerce\Admin\Features\ProductBlockEditor namespace

* Add the to_json definition to the BlockTemplateInterface

* Create default product template by custom product type if it does not have a template associated yet

* Fix some comments and product template creation validation

* Add support to load the product template icon from an external resource

* Fix php linter

* Fix the changelog description
2023-12-21 18:45:31 -05:00
Fernando Marichal 350fb94d8d
Modify feedback modal actions (#43005)
* Adapt feedback modal actions

* Add changelogs

* Modify comments

* Fix tests

* Fix test
2023-12-21 15:42:47 -03:00
Nathan Silveira 0dac985d8e
Prepare @woocommerce/product-editor for 1.2.0 release (#42991)
* Prepare @woocommerce/product-editor for 1.2.0 release

* Fix typo
2023-12-20 11:46:12 -03:00
Nathan Silveira 8a07e61db5
Expose Taxonomy and TaxonomyMetadata types (#42962)
* Expose Taxonomy and TaxonomyMetadata types

* Apply suggestions from code review

Co-authored-by: Damián Suárez <rdsuarez@gmail.com>

---------

Co-authored-by: Damián Suárez <rdsuarez@gmail.com>
2023-12-20 10:06:34 -03:00
Nathan Silveira ddd877441c
Add useProductMetadata hook (#42961)
* Add useProductMetadata hook to perform update in multiple meta entries at same time

* Update type to string

* Add test

* Remove unused parameters
2023-12-19 17:17:08 -03:00
Nathan Silveira f83a2a8ae8
Add step prop to NumberControl (#42928)
* Add step prop to NumberControl

* Add step to block attributes as well

* Add documentation
2023-12-19 15:43:36 -03:00
Damián Suárez 5d20ab5ffa
[Product Block Editor]: expose Label component (#42959)
* expose Label component

* changelog
2023-12-19 15:16:50 -03:00
Nathan Silveira 1cf4b20fdd
Support HTML in checkbox-control tooltip (#42926)
* Support HTML in checkbox-control tooltip

* Add HTML support for tooltip in label
2023-12-19 14:44:42 -03:00
Damián Suárez 3faedf24d9
[Product Block Editor]: add story for Label component (#42953)
* [Product Block Editor]: add story for Label component

* changelog

* add simple Label story

* add Product Editor pkg to Storybook app:
2023-12-19 13:09:30 -03:00
Maikel David Pérez Gómez cecf452faa
Move action button ( reorder and add products ) inline with the section header (#42929)
* Create BlockSlotFill component

* Add section-actions BlockSlot to the section-block

* Fill the section actions BlockSlot from the ProductList action buttons

* Add changelog file

* Use the BlockSlot/BlockFill to define the description of a section-block

* Pick the closest ancestor that contains the Slot
2023-12-18 15:53:59 -05:00
Maikel David Pérez Gómez 1c3843e4ec
Remove list/sale price from the General tab in grouped products (#42909)
* List and sale price should not be visible in the general tab for grouped products.

* Add changelog files

* Fix lint error
2023-12-18 16:26:38 -04:00
Nathan Silveira 09bcb3fcac
Add support for appending a unique string to the filename for the wp/v2/media endpoint (#42702)
* Extract 'downloadable product' class and include it for API endpoint calls as well

* Re-add mediauploader component

* Restore UploadFilesMenuItem

* Provide additionalData type

* Restore MediaUploader component

* Lint PHP

* Add changelogs

* Update pnpm-lock

* Revert "Update pnpm-lock"

This reverts commit b61ee5813aa0b7b8b1ea8e71423bedbb6f876139.

* Revert pnpm-lock.yaml

* Fix unit tests

* Use WC_ABSPATH
2023-12-18 14:12:44 -03:00
Christopher Allford bf29119032
Updated PNPM to ^8.12.1 (#42860) 2023-12-18 20:31:49 +13:00
Nathan Silveira ac50320fae
Fix menu not being pinned correctly with certain screen widths (#42791)
* Fix menu not being pinned correctly with certain screen widths

* Move changelog
2023-12-15 12:41:40 -03:00
louwie17 90dc5bad2e
Address some deprecation warnings (#41845)
* Remove use of deprecated conditional block

* Remove use of deprecated context usage

* Remove use of deprecated positoin on Dropdown in favour of popoverProps

* Add changelogs

* Remove unused import

* Fix lint errors

* Remove popoverProps.position with popoverProps.placement

* Update missed items replacing position to placement

* Fix lint error

* Fix placement position

* Update changelogs
2023-12-15 09:45:06 -04:00
Nathan Silveira 2f8ac30097
Prepare create-product-editor-block for 1.3.0 (#42844) 2023-12-15 10:31:05 -03:00
Damián Suárez d996008219
[Product Block Editor]: propagate content from description inner blocks to Modal editor (#42768)
* set description like the property to update

* switch between summary block and block preview

* add todo: comment

* femove duplicated doc comment block

* Use a quick check to improve performance

* expose getContentFromFreeform() helper fn

* parse freeform content to valid blocks

* changelog

* fix TS issue

* changelog
2023-12-15 09:20:02 -03:00
Matt Sherman bf4bdfff3e Changelog 2023-12-14 15:22:04 -05:00
Matt Sherman a31fec1927 Fix typos 2023-12-14 15:21:05 -05:00
louwie17 b406a084e4
Add reorder grouped products option (#42766)
* Add re-order modal

* Consolidate some of the styling and components

* Add changelog

* Only show reorder when products are added, and remove 'x' from reorder modal
2023-12-14 16:01:55 -04:00
Christopher Allford e46d6bd207
Fixed `watch:build` Race Conditions (#42802)
There's currently a bug with `wireit` that makes the watch crash.
Swiching over to `nodemon` until that is resolved will
keep that from happening.
2023-12-13 18:25:16 -08:00
Nathan Silveira 35a68e212c
Update template to use new function register_block_type_from_metadata (#42711) 2023-12-13 10:38:33 -03:00
Christopher Allford 4c4e89bc98
Enhance Build Watching (#42712)
Similarly to `build:project`, a new `watch:build:project`
script will watch individual projects for changes. The
`watch:build` script has been updated so that it does
a deep watch in the same vein as `build`. We have also
hooked up tool-level watching for faster performance.
2023-12-12 12:43:48 -08:00
Damián Suárez 8b9651276a Merge branch 'trunk' into update/product-editor-use-block-preview-in-description-block 2023-12-12 16:56:53 -03:00
Ron Rennick 76b4f39116
remove woocommerce-blocks from text domain substitution (#42017)
* remove woocommerce-blocks from text domain substitution

* restore prior art commented out

* add internal-js-tests composer.json

* covert internal-js-tests/changelog to a folder

* update blocks composer.json

* fix path, add composer install to changelog script

* add woo-ai changelog

* add composer install to beta tester changelog script

* add composer.json to woocommerce-admin

* add changelog folder & file to woocommerce-admin

* add composer install to woocommerce changelog script

---------

Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
2023-12-12 15:38:20 -04:00
Christopher Allford 4e89debd0c
Fix Jest Preset (#42707)
When using a preset we need to keep in mind that the transformation
paths are relative to the preset, not the consuming package. We get
around this by using `<rootDir>` in the transform paths. However,
doing this means fixing the root directory for all of the jest tests.
This keeps the tests working in the same way but lets us fix the
preset too.
2023-12-12 09:58:13 -08:00
Damián Suárez fcb9b60ced Merge branch 'trunk' into update/product-editor-use-block-preview-in-description-block 2023-12-12 10:59:47 -03:00
Christopher Allford 1c635cda6f
Optimized `wireit` Fingerprinting File Inputs (#42684)
Having an explicit `"files"` definition will allow us to fingerprint
dependencies in `wireit` more granularly. This avoids problems
that can be caused by different source files and directories that
trigger a rebuild in a dependee before a dependent finishes.
2023-12-11 16:21:35 -08:00
Nathan Silveira 120a3dba87
Add meta_data type to Product (#41961) 2023-12-11 14:45:00 -03:00
Damián Suárez 5901533b4a move changelog file to proper location 2023-12-11 14:43:23 -03:00
Damián Suárez b7e4d06a42 set viewport width to 800px 2023-12-11 10:07:56 -03:00
Damián Suárez 871469de7e set 320px height when description has content 2023-12-11 10:06:44 -03:00
Damián Suárez f919a5526f tweak preview box padding 2023-12-11 10:06:44 -03:00
Damián Suárez 8b84134bff clean unused styles 2023-12-11 10:06:44 -03:00
Damián Suárez 61d5b16d30 set preview viewport to 960px 2023-12-11 10:06:44 -03:00
Damián Suárez ff9df643ef get rid of cover element 2023-12-11 10:06:44 -03:00
Damián Suárez 789c849666 replace ContentPreview with BlockPreview core cmp 2023-12-11 10:06:44 -03:00
Christopher Allford 11521bf8e6 Linting Fixes 2023-12-09 23:49:53 -08:00
Christopher Allford a8fd8fafa5 Applied Linting Fixes 2023-12-09 23:32:45 -08:00
Christopher Allford 9bc3e97bbf Load CJS `memize` 2023-12-09 23:18:30 -08:00
Christopher Allford 96af36bf1f Locked `wireit` Version 2023-12-09 21:56:12 -08:00
Christopher Allford a08fdf8698 Updated Lock File 2023-12-09 15:57:05 -08:00
Christopher Allford 4d0cde4b4b Lock File Update 2023-12-09 15:35:55 -08:00
Christopher Allford d244662669 Synchronized Dependencies 2023-12-09 14:40:16 -08:00
Christopher Allford fa011a431b Removed Unnecessary `run` From `pnpm` 2023-12-09 14:36:22 -08:00
Christopher Allford 1e4d55b36a Updated Documentation 2023-12-09 14:30:29 -08:00
Christopher Allford b0d896c3e3 Refactored Monorepo Setup Action
This makes some adjustments for consistency in style as well as making
improvements to usability and performance. It also updates all of the
pinned hashes to pull in any fixes that have been made.
2023-12-09 14:28:37 -08:00
Christopher Allford fb6424e6f2 Applied Consistent Outputs 2023-12-09 14:26:36 -08:00
Christopher Allford e1fb89ba7f Fixed Test Command 2023-12-09 14:26:36 -08:00
Christopher Allford d015950e86 Wireit Dependencies Set 2023-12-09 14:24:51 -08:00
Christopher Allford 3d79d5f204 Removed Turbo References 2023-12-09 14:22:04 -08:00
Christopher Allford e729417335 Revised Test Command
We will never run all tests concurrently so this is better.
2023-12-09 14:14:47 -08:00
Christopher Allford 40852f2fb6 Fixed Test Commands 2023-12-09 14:13:32 -08:00
Christopher Allford eca3d9754c Add Wireit: Remaining Packages 2023-12-09 14:09:14 -08:00
Christopher Allford 97b5cc48fd Add Wireit: Lots of packages! 2023-12-09 14:05:39 -08:00
Christopher Allford ea67b99607 Sorted Package Files 2023-12-09 13:40:51 -08:00
Christopher Allford ab209bff91 Reverted Wireit Package Changes
We're going to use an automatic script to make these changes.
2023-12-09 13:40:46 -08:00
Christopher Allford 429e896087 Fixed Invalid TSConfig Files 2023-12-09 13:38:55 -08:00
Christopher Allford e73d0a48ac Changed `build:project:js` To `build:project:esm` 2023-12-09 13:37:39 -08:00
Christopher Allford 6a7e884baf Added Wireit: @woocommerce/admin-layout 2023-12-09 13:37:37 -08:00
Christopher Allford b816fa7be8 Added Wireit: @woocommerce/admin-e2e-tests 2023-12-09 13:24:56 -08:00
Christopher Allford df32d8e967 Added `wireit` Dependency
We're adding this to _every_ package since they have their own
configuration and scripts to run. This also keeps them
isolated so that they can operate independently.
2023-12-09 13:11:15 -08:00
Christopher Allford c936b5339e Removed Unnecessary `.gitignore` Files 2023-12-09 13:01:12 -08:00
Christopher Allford 5bbb9edc6d Renamed WooCommerce Plugin Package
In order to prevent supply-chain attacks we have renamed
the package. The new name is `@woocommerce/plugin-woocommerce`.
2023-12-09 12:59:24 -08:00
Christopher Allford 6c8207541a Resolved Type Errors 2023-12-09 12:08:16 -08:00
Christopher Allford b26488c8bb Builds Now Functional 2023-12-09 08:15:27 -08:00
Christopher Allford fbb38a973a Fixed Product Editor Type Errors 2023-12-09 07:54:20 -08:00
Christopher Allford bc65f9687b Updated Syncpack Dependencies 2023-12-09 07:16:39 -08:00
Christopher Allford 3a88cc739a Updated Dependencies 2023-12-09 07:12:20 -08:00
Christopher Allford 91f027d5bd Fixed `@woocommerce/ai` Build
It was missing some webpack plugins.
2023-12-09 05:20:50 -08:00
Nathan Silveira a91683b9bf
Prepare for @woocommerce/create-product-editor-block release 1.2.0 (#41951)
* Add changelog for 1.2.0

* Add additional changelog
2023-12-08 10:11:51 -03:00
Damián Suárez 4508f8764c fix tests 2023-12-07 20:22:49 -03:00
Damián Suárez 1cc78c7ce1 changelog 2023-12-07 19:35:06 -03:00
Damián Suárez d602d928e5 allow focusing to description block 2023-12-07 19:35:06 -03:00
Damián Suárez 74e2e166c0 don't allow focusing to Preview component 2023-12-07 19:35:06 -03:00
Damián Suárez 69914eea34 set initial blocks from the store 2023-12-07 19:35:06 -03:00
Damián Suárez c296776121 parse and set iframe blocks when clicking on toolbar button 2023-12-07 19:35:06 -03:00
Damián Suárez 52c95d242c fix checking description is defined 2023-12-07 19:35:06 -03:00
Damián Suárez b7aeaecb3b load description styles 2023-12-07 19:35:06 -03:00
Damián Suárez b24ddef6c0 tweak description preview 2023-12-07 19:35:06 -03:00
Damián Suárez d336a1c508 show full editor toolbar button when blocks 2023-12-07 19:35:05 -03:00
Damián Suárez beca44c12b react -> extract full editor toolbar button cpm 2023-12-07 19:35:05 -03:00
Damián Suárez f573a0a4b4 use kebab-case to file names 2023-12-07 19:35:05 -03:00
Damián Suárez 25626b8df0 fix TS issues 2023-12-07 19:35:05 -03:00
Damián Suárez ba52220f39 introduce _templateBlockId attr to Product block 2023-12-07 19:35:05 -03:00
Damián Suárez 23c8d67821 remove Add/Update button 2023-12-07 19:35:05 -03:00
Damián Suárez b3c606d249 extend Description block with toolbar button 2023-12-07 19:35:05 -03:00
Damián Suárez 100263a64b introduce wooBlockwithFullEditorToolbarButton HOC 2023-12-07 19:35:05 -03:00
Damián Suárez bcd6669721 add hooks dependency 2023-12-07 19:35:05 -03:00
Damián Suárez 5f91f74a93 silent useInnerBlocksProps TS issue 2023-12-07 19:35:05 -03:00
Damián Suárez 5f9c5fc4d6 description block uses inner blocks 2023-12-07 19:35:05 -03:00
Nathan Silveira 7d8bb9be3f
Add @woocommerce/product-editor as an npm devDependency to create-product-editor-block (#41886)
* Add legacy-peer-deps flag

* Add @woocommerce/product-editor as an npm devDependency

* Use wooBlockProps hook
2023-12-07 16:12:18 -03:00
Maikel David Pérez Gómez 37c965735d
Create section description block (#41929)
* Create section description block

* Add changelog files

* Change section description block to receive its content from the attributes instead of innerBlocks
2023-12-07 14:11:23 -05:00
Fernando Marichal defa590f32
Show feedback bar only once (#41787)
* Show feedback bar only once

* Add changelog

* Add isFeedbackBarHidden

* rename showFeedbackBarOnce

---------

Co-authored-by: Fernando Marichal <fernandomarichal@fernandos-mbp.lan>
2023-12-07 12:40:12 -03:00
Damián Suárez e494d53aee introduce showBackButton prop 2023-12-06 17:38:47 -03:00
Damián Suárez 035280b426 do not sub registry for the Product Editor 2023-12-06 17:38:10 -03:00
Damián Suárez f58405f1a3 dispatching action to close from modal cmp 2023-12-06 17:38:10 -03:00
Damián Suárez 39778dadf4 fix prettier issue 2023-12-06 17:38:10 -03:00
Damián Suárez 3f39802848 minor doc comment 2023-12-06 17:38:10 -03:00
Damián Suárez 42a9ed7087 remove useSubRegistry prop 2023-12-06 17:38:10 -03:00
Damián Suárez 26f44671a2 do not memoize parsed blocks 2023-12-06 17:38:10 -03:00
Damián Suárez adefe04c84 set the Modal editor content when clicking 2023-12-06 17:38:10 -03:00
Damián Suárez c9a4a1aab7 add a line break (minor) 2023-12-06 17:38:10 -03:00
Damián Suárez 7bd4c1b8cb rename store actions, consts, etc 2023-12-06 17:38:10 -03:00
Damián Suárez be31dd7ae1 handler parsing blocks and redering the preview 2023-12-06 17:38:09 -03:00
Damián Suárez 05e2eeb958 set should update blocks when onSave() 2023-12-06 17:38:09 -03:00
Damián Suárez 137d23b6fd register when modal editor blocks change 2023-12-06 17:38:09 -03:00
Damián Suárez d0d744627d decouple Modal and Product editor 2023-12-06 17:38:09 -03:00
Damián Suárez c3b6b61f82 set modal editor blocks with empty array when not defined 2023-12-06 17:38:09 -03:00
Damián Suárez 6962e6c0aa changelog 2023-12-06 17:38:09 -03:00
Damián Suárez b60d723982 move the Modal editor out of the block instance 2023-12-06 17:38:09 -03:00
Damián Suárez 388c980cf5 onChange and onClose are optional 2023-12-06 17:38:09 -03:00
Damián Suárez 5003dff2db store iFrame blocks in the store instead on the local state 2023-12-06 17:38:09 -03:00
Damián Suárez 2c1ff8a66e store modal editor blocks in the woo state 2023-12-06 17:38:09 -03:00