Commit Graph

1264 Commits

Author SHA1 Message Date
louwie17 f8c6c43721
Update/create product block package (#39023)
* Add publish config

* Add changelog
2023-06-30 15:23:13 -03:00
louwie17 8978f2a929
Prepare create product editor block package (#39022)
* Prepare create product editor block package

* Remove legacy message
2023-06-29 10:32:04 -03:00
Sam Seay 957fb2b07e
Update pnpm to 8.6.5 (#38990) 2023-06-29 16:51:29 +12:00
louwie17 cb0fb46e7b
Add gitignore to package and update package.json (#39007)
* Add .gitignore

* Update package.json

* Add changelog
2023-06-28 18:18:02 -03:00
louwie17 b11b17c17c
Added initial changelog and ran prepare package release (#39001)
* Added initial changelog and ran prepare package release

* Add gitkeep to changelog folder

* Remove legacy link that is not required
2023-06-28 14:55:25 -03:00
Maikel David Pérez Gómez ecd1795b44
Add the list view component and button to the modal editor (#38809)
* Add document overview opened state to the EditorContext

* Create document overview toolbar button

* Add document overview button to the header toolbar

* Create document overview sidebar

* Register document overview sidebar styles

* Set document overview sidebar visible when document overview button is pressed

* Add changelog file
2023-06-27 10:08:08 -04:00
Chi-Hsuan Huang 5db0fd4fce
Add instructions on how to run the tests when using @woocommerce/components (#38821)
* Add instructions on how to run the tests when using @woocommerce/components

* Add changelog
2023-06-26 17:05:49 +08:00
Joshua T Flowers 6bbc4dad1a
Add missing tracks events to product editor (#38728)
* Only record product update on already published products

* Add source into published product tracks event

* Add missing tracks options to product update event

* Track tab clicks in the editor

* Add source to tab clicks

* Record tracks on preview click

* Add events for media gallery, description, and attributes

* Add tracks events to more menu

* Replace new_product_page with source

* Add changelog entry

* Fix lint errors

* Add tracks for About the Editor menu item

* Add onClick event to AboutTheEditor menu item

* Use dropdown option event for classic editor menu click
2023-06-21 09:38:04 -07:00
github-actions[bot] 109b9bfb2e
Prepare Packages for Release (#38818)
Automated change: Prep @woocommerce/onboarding for release.

Co-authored-by: chihsuan <chihsuan@users.noreply.github.com>
2023-06-20 16:13:48 +08:00
Matt Sherman 7004396617
Set attributes to visible by default (#38777)
* Default visible to true if not explicitly set

* Refactor onAddingAttributes to reduce complexity

* Changelog

* Improve hasTermsOrOptions based on review suggestion
2023-06-16 18:02:16 -04:00
Fernando Marichal a40543c16d
Fix styles for modals (#38775)
* Fix obw modal

* Fix modal styles

* Add changelog

* Add changelogs

* Move __selection and __errors
2023-06-16 15:48:33 -03:00
Matt Sherman 9a6d9533c9
Keep showing product editor feedback bar after feedback modal shown (#38773)
* Show feedback bar even after feedback is given

* Changelog
2023-06-16 11:51:18 -04:00
Ismael Martín Alabarce 9a49ff72da
Update WCPay welcome page incentives (#38689)
* Initial refactor of components

Move out from index every UI component to make it easier to maintain.

* Initial implementation of new design

Some minor adjustments are missing, and I've added a few TODOs to complete later.

* Add changelog entry

* Finish design update

* Compress menu icon

* Add user's first name to heading copy

* Fetch and cache eligible incentive from WCPay API

Sharing its properties under `window.WcSettings.admin`

* Filter `allowed_promo_notes`

To be able to add those form WCPay API request

* Update JS side to use the new shared incentive details

* Ensure we cache requests even if there are no eligible incentives

* Fix a typo in WCPayBanner

* Move incentive preloaded data from wcSettings

to a new window variable which will be only loaded on WCPay welcome page.

* Simplify `has_wcpay` check

* Render sanitized HTML from incentive description

* Update get incentive logic to also cache non success responses

* Add incentive ID to page view track

* Add changelog entry for the onboarding package

* Update used options names

and add them to `get_default_option_permissions

* Differentiate every dismissed incentive

Reuse WCPay welcome page logic for notes display conditions

* Use tos_url instead of tos_link to match response

* Fix incentives endpoint request payload

* Back to preload incentive on admin shared settings

* Move promo notes filter to where it's used

to avoid any possible race conditions.

* Replace every occurrence of `WooCommerce Payments` with `WooPayments`

* Prevent modal large padding-bottom

* Prevent another global style override on modal

* Fix TS error coming from trunk merge

* Fix wrong style property

* Further restrict WCPay incentives to plugin not active and countries supported

* Adjust the meaning of has_wcpay

* Wait for dismiss option update before redirect

to prevent the side menu entry to be visible after redirecting back to WC admin.

* Enforce TOS asterix at the end of incentive description

* Remove underscore from priavate instance var.

* Fix ESLint error

* Fix SCSS linting issues

* Refine `has_wcpay` and `has_orders`

* Enforce consistent WooPayments branding

* Enforce stricter i18n calls with escape

* Update page title to match new branding

* docs: Enforce branding in code docs also

* Remove method that is unreliable to be used outside of onboarding

* Remove unused constant

* Missing new line

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

---------

Co-authored-by: Vlad Olaru <vlad@pixelgrade.com>
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
2023-06-16 16:32:58 +02:00
Ilyas Foo 1e72bb0401
Allow `plugins_page_skipped` parameter in Onboarding API endpoint (#38764)
* Append plugins_page_skipped parameter to onboarding API

* Changelog

* Rename property to is_plugins_page_skipped and fixed tests

* Changelog

* Fix lint
2023-06-16 18:06:58 +08:00
Moon 1a42094e5e
Fix Jetpack redirection issue when the auth endpoint returns an invalid url (#38760)
* Return full response from getJetpackAuth

* Add success and errors

* Redirect to Home in case of an error from getJetpackAuth endpoint

* Add changelog

* Use redirectToJetpackAuthPage

* Replace window.location.href with navigateTo

* Fix type issue with getJetpackAuthUrl

* Update plugins/woocommerce-admin/client/core-profiler/index.tsx

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

---------

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2023-06-16 00:56:30 -07:00
Moon 630faadb81
Update/implement connect to jetpack (#38674)
* Add install-and-activate-plugins-async action to onboarding

* Add label and learn_more_link types

* Use label and learn_more_link

* Remove unused imports

* ts fixes

* Visual changes on the plugin page

* Change CTA font size from 13px to 14px
* Change spacing between the chebox and logo to 24px
* Change heading font-weight to 500

* Fix css lint error

* Add back learn more link that was removed from rebase

* Add required packages

* Load Jetpack Config

* Add getJetpackAuthUrl to data/onboarding

* Add Connection Rest Auth -- seems like this is required for Jetpack to communicate back to the connected site

* Add jetpack-authorization-url REST API

* Redirect to Jetpack Auth page after the installatino process if jetpack was selected

* Require can_install_plugins permission for jetpack auth url endpoint

* Update packages/js/data/src/onboarding/resolvers.ts

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

* Update plugins/woocommerce/src/Admin/API/OnboardingPlugins.php

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

* Remove automattic/jetpack-sync and its config

* Support redirect_url and from params

* Do not redirect to Jetpack auth if it is already connected

* Add installed_ext_success=1

* Use woocommerce-core-profiler for from value

* Revert unrelated lock file changes

* Minor refactor

* Extracted out isJetpackConnected cond to a guard

* Added meta data for isJetpackConnected to prevent unwanted spinner

* Add Changelog

* Lint fix

* Move Jetpack Connection config init to class-woocommerce

* Add changelog

* Remove unnecessary require

* Note jetpack-authorization-url endpoint is experimental

* Fix broken test

* Add component to sendToJetPackAuthPage state

* Fix lint error

---------

Co-authored-by: rjchow <me@rjchow.com>
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
2023-06-15 20:28:18 -07:00
Joshua T Flowers 3ad98ec8b4
Add tool selector option to iframe editor (#38686)
* Add tool selector option to iframe editor

* Fix lint errors
2023-06-15 16:29:12 -07:00
Joshua T Flowers ce770bbfd2
Fix empty state for currency inputs in product editor (#38697) 2023-06-15 09:32:57 -07:00
Matt Sherman de6f77d8be
Fix transient notices overlapping product editor footer (take 2) (#38698)
* Use WooFooterItem for Footer

* Use WooFooterItem fill for TransientNotices

* Adjust TransientNotices styling to work in footer

* Fix footer width when in setup wizard

* Change export of TransientNotices from default to named

* Add border to footer

* Changelog

* Changelog

* Mock WooFooterItem to allow unit tests to pass

* Fix lint error in test
2023-06-14 16:32:28 -04:00
Fernando Marichal 47481490d8
CES modal modifications (#38643)
* Add extraFields prop

# Conflicts:
#	packages/js/product-editor/src/components/product-mvp-ces-footer/product-mvp-ces-footer.tsx

* Add changelog

* Add changelogs

* Fix styles

# Conflicts:
#	packages/js/product-editor/src/components/product-mvp-ces-footer/style.scss

* Add extraFields validation

* Remove files

* Add styles and js

* Modify the other share feedback form

* Change modal title

* Fix feedback-bar

* Fix return

* Fix params types

* Rename `extraFields` to `getExtraFieldsToBeShown`

* Fix styles

* Fix error handling

* Fix styles

* Rename prop

* Fix error message
2023-06-14 11:25:51 -03:00
Moon 620ff93e5a
Additional changes for the core profiler plugins page (#38616)
* Add install-and-activate-plugins-async action to onboarding

* Add label and learn_more_link types

* Use label and learn_more_link

* Fix type

* Add changelog

* Add changelog

* Add install_priority -- this will be used in the core profiler

* Sort selected plugins by install_priority for installation

* Remove unused imports

* dev: refactor installAndActivatePlugins to xstate

* ts fixes

* Sort plugins by install_priority

* Make sure WooCommerce Shipping is always visible

* Update free extension list content

* Updated WC payment description
* Updated logo images

* Visual changes on the plugin page

* Change CTA font size from 13px to 14px
* Change spacing between the chebox and logo to 24px
* Change heading font-weight to 500

* Fix css lint error

* Fix gray-900 variable name

* Hide learn more link on mobile view

* Add back learn more link that was removed from rebase

* Send pluginsAvailable to pluginInstallermachine

* Use is_activated to determine plugin availability and install status

* Update packages/js/data/src/onboarding/types.ts

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

* Update plugins/woocommerce/src/Internal/Admin/RemoteFreeExtensions/DefaultFreeExtensions.php

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

* Add back recordTracksPluginsLearnMoreLinkClicked

* Use install-and-activate-plugins-async when timer is up

* Record plugin and link with learn more linked clicked event

* Fix failign tests

* Add comment for install_priority

---------

Co-authored-by: rjchow <me@rjchow.com>
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
2023-06-13 15:03:03 -07:00
Matt Sherman ef6fe8567d
Create Product Editor Block: Do not add script prop to generated block.json (#38496)
* Remove script prop from generated block.json

* Changelog

* Remove style prop from generated block.json
2023-06-13 09:53:20 -04:00
Matt Sherman 0f8d274d7f
Remove editor-styles-wrapper class from product editor (#38681)
* Remove editor-styles-wrapper class from product editor

* Override default block margins and layout applied for themes without a theme.json file

* Changelog
2023-06-12 18:56:57 -04:00
Joshua T Flowers 93262ac019
Add editor history and undo/redo toolbar buttons (#38573)
* Add editor history and undo/redo behavior

* Add option to limit max editor history

* Move inserter properties to editor context

* Move editor toolbar to separate folder

* Add changelog entry

* Remove no longer needed editor provider
2023-06-12 14:23:22 -07:00
Joshua T Flowers 90e4ddbf29
Update product editor CES modal to match new designs (#38592)
* Add new fields and copy update to product CES modal

* Update styling for product CES modal

* Record email in tracks callback if provided

* Fix modal header spacing

* Fix record callback types

* Add optional tag styling

* Allow submitting form when a reason has been selected

* Fix modal padding bottom

* Update modal width to match designs

* Add changelog entries

* Update margin for legend

* Add props to doc comment

* Make className prop optional

* Update tests for recording score with email
2023-06-12 10:58:00 -07:00
Maikel David Pérez Gómez 72f7e6ebbb
Publishing product in classic editor redirects back to new editor (#38551)
* Changes the feature given it's id and a toggle value as a query param

* Swap classic editor and new product block editor url when product_block_editor feature changes

* Turn off the product_block_editor feature when user choose to use the classic editor

* Add changelog files

* Fix linter errors

* Add nonce to each feature change request

* Change the hooks name for better readability

* Use get_current_screen function to better identify if the current screen is the product creation or edition

* Add wp_die if the nonce verification failed

* Change regex for explode/parse_url for better reading
2023-06-09 11:18:40 -04:00
Matt Sherman dadc0eb777
Show feedback footer on product editor page (#38599) 2023-06-08 20:56:07 -04:00
Joshua T Flowers e09e8b8ab0
Show "Save draft" instead of "Saved" on initial product page (#38609) 2023-06-08 15:32:49 -07:00
Joshua T Flowers 4569fda5c1
Add iframe editor header toolbar and block inserter (#38549)
* Add initial toolbar and secondary sidebar

* Style the sidebar and inserter panel

* Adjust toolbar and modal paddings

* Move header toolbar styles to separate file

* Make header toolbar class names consistent with component

* Dont use experimental insertion index and fall back to default insertion point

* Add changelog entry
2023-06-08 12:14:25 -07:00
Maikel David Pérez Gómez 338bf6e45e
Product route not updated after save initially failed and succeeded after (#38507)
* Enhance error handling

* Use last persisted product status to show a right publish button label and notices

* Use last persisted product status to show a right preview button label and notices

* Use last persisted product status to show a right save draft button label and notices

* Uses the last persisted product to better compare it with the most recently updated product so the buttons can behave correctly

* Add changelog file

* Fix getProductErrorMessage unit test

* Fix notice message when create / update the product

* Get product id from within each button hook
2023-06-08 14:22:07 -04:00
Nathan Silveira 52fe3c4a5a
Product Editor Onboarding: Show spotlight for first time visitors (#38590)
* Add placeholder TourKit in product-page

* Create component and configure it to show to the right of wp menu

* Finish TourKit and start creating features guide

* Implement CSS changes and background color

* Create Wrapper to facilitate showing the tour and guide without relying on the options in the future

* Refactor
Add tracks events

* Add changelog

* Fix lint problems

* Fix CSS

* Refactor styles

* General refactor and extract BlockEditorGuide component

* Add changelog

* Fix lint issues
2023-06-06 12:06:26 -03:00
louwie17 bb0e8803a0
Replace interpolateComponents within onboarding package (#38423)
* Replace use of interpolateComponents with createInterpolateElement

* Remove @automattic/interpolate-components package from onboarding package

* Add changelog
2023-06-05 10:36:47 -03:00
Maikel David Pérez Gómez abcedbefe0
[MVP QA #1] Visual: spacings (#38325)
* Update the margin-left on the buttons in the top bar from 16px to 8px

* On mobile, the left and right body margins should be 32 px

* The inner padding in the tab in the top bar should be 12px, not 16px

* In the edit product link modal, let's set this modal’s width to 650 px and remove the line separating the header from the contents

* All modals should now have 8 px window radius

* In the feedback form, can we fix the buttons at the bottom

* The help icon in checkboxes small, detached from the item label, and vertically misaligned. Left margin of 4 px, no vertical adjustment; somehow it has a -2px set for the top margin)

* Fix block-editor-block-contextual-toolbar top position

* When the product is in a draft state, the button in the top bar should say Add, not Save. It should change into Update once it's published on the store

* Fix layout margin top

* Add ection support for blockGap and set title and description to optional

* Remove non needed control field margin bottom

* Fix schedule sale block spacing

* Remove non needed control field help text margin bottom

* Remove the sub section outer spacing

* Move pricing fields into a sub section block

* Fix collapsible-contet margin top

* Remove invalid inner block layout spacing

* Wrap sku, stock toogle and quantity within a sub section

* Group inventory advance section inner blocks into a sub section

* Fix linter error

* Add changelog files

* Fix php lint error

* Change unit names to fit GB definitions
see: b2c16f3c68/packages/base-styles/_variables.scss\#L31-L41
2023-06-01 13:56:31 -04:00
Sam Seay 664468f51a
Add a new plugin to the monorepo for the docs project (#38406) 2023-06-01 10:21:33 +12:00
Sam Seay 4f2fb497fd
Remove eslint-plugin-react plugin warnings from lint (#38512) 2023-06-01 08:27:06 +12:00
Joshua T Flowers a5e36377f9
Check for unsaved changes before leaving product editor (#38430)
* Check for unsaved changes before leaving product editor

* Add changelog entry

* Add hasEdit convenience method to useProductEdits hook
2023-05-31 10:14:12 -07:00
Sam Seay b076a7b521
Fix linter issues and update Syncpack (#38523) 2023-05-31 11:45:10 +12:00
Matt Sherman 4e530ba2e2
Prevent theme styles from being used in the block-based product editor (#38491) 2023-05-30 13:25:55 -04:00
Ilyas Foo edf95bf3f4
Update shipping partner suggestions to use data from API (#38457)
* Added shipping partner suggestions data handling in JS

* Add woocommerce services real info

* Add dynamic layout components, remove unused JS, added images to proper asset paths

* Changelog

* Update changelog and removed unused variable

* Remove console.log

* Lint fix

* Add shipping methods module in woocommerce/data

* Update data usage

* Revert "Added shipping partner suggestions data handling in JS"

This reverts commit 6a87ef2658.

* Lint fix
2023-05-30 15:56:32 +08:00
RJ ab18828e84
add: core profiler business info page (#38412)
* add: core profiler business info page
2023-05-30 15:05:38 +08:00
Matt Sherman 27574c98cd
Update DateTimePickerControl's dropdown positioning (#38466) 2023-05-29 16:12:28 -04:00
Matt Sherman f186403a77
Opt out of Reset and Help buttons in DateTimePickerControl (#38480) 2023-05-29 16:09:06 -04:00
Moon 6946ef384a
Core Profiler - Add extensions page (#38405)
* Initial design impl. without the full functionality

* Delete unused icons

* Add is_installed and plugins_page_skipped

* Add plugin-card component to render an installable plugin

* Implement plugins page

* Add loaders for plugins

* Add changelog

* Remove unused type

* Add changelog

* Remove unnecessary return statement

* Add obw/core-profiler

* Replace extensions with plugins

* Temp -- use window.location.href for Woo Home redirection

* Minor: code refactor

* Refactor isntallAndActivatedPlugins

* Skip plugins page when there is no available plugin

* Apply mobile styles

* Update plugins/woocommerce-admin/client/core-profiler/components/plugin-card/plugin-card.scss

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

* Update plugins/woocommerce-admin/client/core-profiler/components/plugin-card/plugin-card.scss

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

* Update plugins/woocommerce-admin/client/core-profiler/style.scss

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

* Bold errored plugin name

* Fix checkbox alignment

* Update changelog

* Fix object type for formatToParts function

* Fix lint issues

* Fix CSS lint issues

* Fallback to en-US when locale is not available

* Fix error with siteLocale

---------

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2023-05-29 07:45:30 -07:00
Christopher Allford 230bc04050
Updated `wp-env` To 8.0.0 (#38440) 2023-05-26 15:48:48 -07:00
Matt Sherman 2b12908a80
Add @woocommerce/create-product-editor-block package (#38263)
* Initial commit for create-product-editor-block

* Changelog

* Add stylelint support

* Install WooCommerce and WooCommerce Beta Tester in wp-env

* Set PHP and WordPress versions

* Enable product block editor after wp-env setup

* Lower priority for modifying template, so that the template is actual there!

* Update wp-env afterSetup command to use npx

* Update output README.md

* Update README for package

* Use long form of template parm name in README

* Remove unused example in block config

* Update block registration to handle both WP 6.2 and WP 6.3

* Include note about how to change version of WP and WC in README

* Update WP to 6.2.1

* Remove explicit enqueuing of block script and style

* Update minimum required versions of WordPress and PHP in generated plugin file

* Enable feature flag option after setup of wp-env

* Add minimum required WC version to generated plugin file

* Support wp-env lifecycleScripts

* Guard against product_block_editor not enabled or missing template

* Update lock file
2023-05-26 08:16:57 -04:00
Maikel David Pérez Gómez a43a418019
List price gets reset on blur when error is shown (#38414)
* List price gets reset on blur when error is shown

* Add changelog file

* Fix linter error
2023-05-24 13:53:28 -04:00
Joshua T Flowers 353e01eb65
Tweak typography and element spacing in product editor (#38351)
* Update header font size

* Remove icons from sections

* Update radio block label and spacing

* Make checkbox tooltips larger and vertically align

* Update description colors

* Update h4 font sizes in editor

* Add changelog entry

* Add core changelog entry

* Handle initial design feedback

* Remove copy of assets in client webpack config
2023-05-24 10:11:00 -04:00
Maikel David Pérez Gómez 195bcd2368
Limit 'email me when stock reaches' field to numerical only (#38353)
* Limit 'email me when stock reaches' field to numerical only

* Add changelog file
2023-05-22 06:59:58 -03:00
Maikel David Pérez Gómez e16792dc11
Make DateTimePickerControl a ForwardedRef (#38306)
* Forward ref the DateTimePickerControl

* Add changelog file

* Remove the component typing definition

* Integrate the forwardedRef component with the schedule-sale block

* Add changelog file
2023-05-22 06:55:07 -03:00
Chi-Hsuan Huang 4547922f3f
Add core profiler user profile page (#38328) 2023-05-22 11:21:16 +08:00
Nathan Silveira 5437ed50c3
Use SelectTree in Parent Category field (#38261)
* Increment label CSS to look the same as TextControl's label

* Migrate Parent Category field to SelectTree

* Add changelogs

* Fix unit test that was edited by mistake

* Revert css changes in select-control.scss

* Use BaseControl as label on SelectTree

* Increment changelog

* Increment changelogs

* Refactor test

* Refactor category-field functions and use them in related places

* Fix ordered list appearing empty
2023-05-19 12:45:11 -03:00
RJ 06e6f5012f
dev: moved geolocation utils from wccom to here (#38356) 2023-05-19 15:02:39 +08:00
louwie17 2843fbb7a8
Fix editor header hidden in Firefox (#38247)
* Update page config to add support for layout header/footer

* Fix lint error
2023-05-18 13:00:42 -03:00
Joshua T Flowers d17ca83b02
Add error specific messages to product save functionality (#38307)
* Allow errors to be thrown when saving entity records

* Show frontend error message when one exists

* Allow errors to be thrown in preview save entity

* Rename new util to getProductErrorMessage

* Add tests around error message util

* Add changelog entry
2023-05-18 05:28:28 -03:00
Joshua T Flowers 81e92392d5
Fix double scrollbars on product editor page (#38281)
* Refactor Layout component to functional component

* Add class to pages based on page path

* Add styling for interface skeleton on product pages

* Add changelog entries

* Move product page styles out of product editor package and into client

* Fix linting issues

* Check for location before checking path in page tracking

* Dont add body classes when no page path exists

* Record page view without router location for embed pages
2023-05-18 05:25:36 -03:00
Maikel David Pérez Gómez 470ecd0e7d
Fix validation behavior (#38194)
* Create ValidationContext

* Add ValidationProvider to the product editor

* Add new validation to the name block

* Add new validation to the Save button

* Store validations within a useRef instead of useState to improves re-renders

* Create find first visible and invalid element function

* Add focus first invalid element feat when submitting

* Integrate autofocus with name block

* Migrate sale-price block to the new validation system

* Add changelog file

* Migrate regular-price block to the new validation system

* Migrate schedule-sale block to the new validation system

* Migrate inventory-quantity block to the new validation system

* Migrate shipping-dimensions block to the new validation system

* Remove old validation hook

* Add validation to the save-draft button

* Add validation to the preview button

* Expose validation hooks to be used outside of the package

* Make sure the product is in fact saved before calling the onPublishSuccess
2023-05-17 01:01:30 -04:00
Joshua T Flowers 5b50bbc442
Wrap selected items in experimental select control (#38284) 2023-05-16 15:15:26 -07:00
Maikel David Pérez Gómez 4b3479595b
Only register blocks when user navigates to the product edit page (#38303)
* Remove block registration from within the Editor component

* Expose the initBlocks function to be used outside of the product package

* Register blocks within the ProductPage component

* Add changelog files

* Unregister blocks when product page gets unmounted
2023-05-16 07:41:26 -03:00
Joshua T Flowers 35e1fed2f9
Wait for editor changes to be debounced before closing modal (#38262)
* Wait for editor changes to be debounced before closing modal

* Handle PR feedback
2023-05-16 04:41:43 -03:00
RJ 8cd0f2f997
dev: added types for resolveSelect where applicable (#38241) 2023-05-16 08:55:50 +08:00
Maikel David Pérez Gómez 332094e87d
Update shipping class block to match new designs (#38301)
* Change the section title from Shipping fee to Shipping class

* Replace the radio buttons with a regular dropdown

* Add changelog files
2023-05-15 13:06:48 -04:00
Matt Sherman ac78d3de2b
Product Block Editor: Fix product summary field top margin (#38251)
* Fix product summary field margin

* Changelog
2023-05-12 10:45:03 -03:00
Nathan Silveira 581601f545
Add single selection mode to SelectTree (#38140)
* Add single mode for SelectTree

* Add storybook example for single selection in SelectTree

* Add changelog

* Improve type definitions and refactor code

* Add onRemove to story
2023-05-11 13:42:20 -03:00
Joshua T Flowers a587612934
Add editor styles to product editor and iframe editor (#38168)
* Add editor styles to product editor and iframe editor

* Make section title css selectors more specific

* Add changelog entry

* Remove additional commented component

* Remove unused import
2023-05-11 11:43:22 -03:00
Nathan Silveira f668ce72ac
Add tests to tracks events fired through JS (#38124)
* Add test for inbox_note_view event

* Add tracks test for Layout's page_view

* Add test to inbox_action_click

* Add tests to analytics_filter tracks event

* Add tracks event test to activity_panel_open

* Add tests to tracks event activity_panel_orders_orders_begin_fulfillment

* Add tracks tests to activity_panel_stock_update_stock

* Improve tests based on code review comments

* Mock recordEvent and recordPageView globally

* Add missing mock

* Improve inbox panel tests
2023-05-10 09:36:42 -03:00
Maikel David Pérez Gómez 227695386d
Fix spacing between pricing fields (#38146)
* Fix spacing between pricing fields

* Add changelog file

* Fix spacing between sale toggle and the next section
2023-05-09 19:13:56 -04:00
Chi-Hsuan Huang 4a237ca476
Migrate Purchase task and dashboard utils to TS (#37725)
* Fix onboarding productTypes TS define type

* Rename purchase.js -> purchase.tsx

* Rename utils.js -> utils.ts

* Migrate dashboard/util to TS

* Rename tasks fills to index.ts

* Migrate purchase task to TS

* Add changelog

* Fix types

* Update changelog
2023-05-09 11:28:57 +08:00
Joel Thiessen c76203cde5
Correcting spacing for image gallery block (#38151)
* Correcting spacing for image gallery component

* Adding changelog
2023-05-08 14:18:15 -03:00
Maikel David Pérez Gómez c265db936e
Add Sale price validation (#38078)
* Create sale-price block

* Create regular-price block

* Add changelog files

* Fix some typos in field validator names
2023-05-08 10:05:13 -04:00
Jeffrey Paul df0583f9b8
Fix/37502: Correct spelling errors. (#37887)
* change reference of Catpure to Capture

Co-Authored-By: Vikram  <93216400+vikrampm1@users.noreply.github.com>

* change reference of expicitly to explicitly

Co-Authored-By: Vikram  <93216400+vikrampm1@users.noreply.github.com>

* change reference 'cutted' to 'cut'

* change reference 'determening' to 'determining'

* change reference 'retreive' to 'retrieve'

* change reference 'neccessary' to 'necessary'

* change reference 'Fitler' to 'Filter'

* change reference of "seperate" to "separate"

Co-Authored-By: Ankit K Gupta <ankit.himcs@gmail.com>

* change reference of "wether" to "whether"

Co-Authored-By: Sumit Bagthariya <67687255+qasumitbagthariya@users.noreply.github.com>

* change reference of "staus" to "status"

* change reference of "retrive" to "retrieve"

* change references of "gatways" to "gateways"

* change references of "existant" to "existent"

* change reference of "requries" to "requires"

* change reference of "configuation" to "configuration"

* change reference of "processsing" to "processing"

* change reference of "represenation" to "representation"

* change reference of "dimentions" to "dimensions"

* change references of "reigster" to "register"

* change reference of "colum" to "column"

* change reference of "transtions" to "transitions"

* change references of "intially" to "initially"

* change references of "orignal" to "original"

* change references of "deprected" to "deprecated"

* change references of "paramter" to "parameter"

* change reference of "intance" to "instance"

* change reference of "elemets" to "elements"

* change references of "funcitons" to "functions"

* change reference of "specificed" to "specified"

* change references of "atributes" to "attributes"

* change reference of "tast" to "task"

* change reference of "chaning" to "changing"

* change reference of "retreiving" to "retrieving"

* change reference of "caluclation" to "calculation"

* change references of "Invaid" to "Invalid"

* change references of "paramaters" to "parameters"

* change reference of "Additonal" to "Additional"

* change reference of "teh" to "the"

* change reference of "evalutes" to "evaluates"

* change reference of "addedd" to "added"

* change reference of "excempt" to "exempt"

* change reference of "sequencially" to "sequentially"

* change reference of "previos" to "previous"

* change reference of "elegible" to "eligible"

* change references of "Boostrap" to "Bootstrap"

* change references of "compability" to "compatibility"

* change reference of "heirarchy" to "hierarchy"

* change references of "visibilty" to "visibility"

* change reference of "comparsion" to "comparison"

* change reference of "capabilties" to "capabilities"

* change reference of "datatores" to "datastores"

* change reference of "occured" to "occurred"

* change reference of "coresponding" to "corresponding"

* change references of "thier" to "their"

* change reference of "sucessfully" to "successfully"

* change reference of "insde" to "inside"

* change reference of "nagivation" to "navigation"

* change references of "visiblity" to "visibility"

* change reference of "documentaiton" to "documentation"

* change reference of "anayltics" to "analytics"

* change reference of "intalling" to "installing"

* change reference of "mininum" to "minimum"

* change references of "intial" to "initial"

* change reference of "Feld" to "Field"

* change reference of "taks" to "task"

* change reference of "trasnfer" to "transfer"

* change reference of "respone" to "response"

* change reference of "Extenstions" to "Extensions"

* change reference of "detault" to "default"

* change reference of "simultanious" to "simultaneous"

* change reference of "overides" to "overrides"

* change references of "Indvidual" to "Individual"

* change reference of "refering" to "referring"

* change reference of "aginst" to "against"

* change reference of "execuatable" to "executable"

* change reference of "repsonse" to "response"

* change reference of "documention" to "documentation"

* change reference of "asumed" to "assumed"

* change reference of "Minium" to "Minimum"

* change reference of "unqiue" to "unique"

* change references of "existance" to "existence"

* change reference of "compatability" to "compatibility"

* change reference of "Taxnomy" to "Taxonomy"

* change reference of "quering" to "querying"

* change reference of "retrun" to "return"

* change reference of "informations" to "information"

Co-Authored-By: Viktor Szépe <viktor@szepe.net>

* Add changelog

* Add changelog

* Fix typo

---------

Co-authored-by: Vikram  <93216400+vikrampm1@users.noreply.github.com>
Co-authored-by: Ankit K Gupta <ankit.himcs@gmail.com>
Co-authored-by: Sumit Bagthariya <67687255+qasumitbagthariya@users.noreply.github.com>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2023-05-08 15:55:09 +08:00
Joshua T Flowers c4806c3ac8
Show comma separated list in ready only mode of select tree control (#38052)
* Add read-only state to selected items in select control

* Only close menu on focus outside of select control

* Add changelog entry

* Remove errant comment out of onBlur line

* Fix regression of input focus behavior

* Hide input when in read only mode

* Turn off read only mode when focused

* Show select control input on single item dropdowns and when no selections have been made in multiple dropdowns

* Prevent focus loss when removing an item

* Prevent loss of field focus when clicking on selected item tags

* Fix broken assertion with comma separated list

* Add product editor changelog entry
2023-05-08 04:17:52 -03:00
Chi-Hsuan Huang 2a87e4d21c
Migrate select control component to TS (#37751)
* Migrate select control to TS

* Add changelog

* Migrate test to TS

* Change value type to be optional

* Fix missing prop
2023-05-08 12:18:27 +08:00
Joel Thiessen e7d67710fd
Restoring standard tabbing behavior in product block editor (#38105) 2023-05-05 12:39:39 -07:00
Joshua T Flowers f1db682cc6
Fix summary toolbar positioning and selection on blur (#38086)
* Remove block selection on summary input blur

* Move block props to wrapper around rich text

* Fix content ID and for label

* Add changelog entry

* Use useInstanceId instead of lodash uniqueId
2023-05-05 11:52:12 -07:00
Joshua T Flowers bb244484d3
Update shipping dimensions image in new product blocks editor (#38101)
* Update shipping dimensions image SVG

* Allow labels in shipping dimension SVG

* Add changelog entry
2023-05-05 09:15:35 -07:00
Joshua T Flowers 14ed88cd1f
Prevent double debouncing of iframe editor callback (#38087)
* Prevent double debouncing of iframe editor callback

* Add changelog entry
2023-05-05 09:15:07 -07:00
Nathan Silveira 95ca53675f
Fix TreeControl bugs in single selection mode (#38079)
* Add onFirstTreeItemBack hook

* Fix item not being selected on single mode when it had children

* Remove if statement that prevented items with children from being selected in single mode

* Add storybook example with onFirstTreeItemBack

* Remove onFirstTreeItemBack

* Replace radio button with checkbox

* Update changelog
2023-05-05 09:21:32 -03:00
Joshua T Flowers 4deb5b3f84
Remove drag and drop handle in product blocks editor (#38127)
* Remove drag and drop handle in product blocks editor

* Add changelog entry
2023-05-05 04:55:57 -03:00
louwie17 ce07458752
Update disable drag and drop within images block (#38045)
* Allow disabling of drag and drop within ImageGallery component

* Add changelogs

* Fix onReplace logic for images block

* Fixing linting error

---------

Co-authored-by: Joel <dygerati@gmail.com>
2023-05-05 04:45:26 -03:00
Chi-Hsuan Huang ef7bf6a28b
Update Payfast logo and title (#38090)
* Update Payfast title

* Update Payfast logo

* Add changelog

* Update Payfast 72x72 logo
2023-05-05 15:42:47 +08:00
Joel Thiessen 4729ea054b
Adding basic ordering to tab slot fill (#38081) 2023-05-04 10:57:19 -07:00
Chi-Hsuan Huang ea58ae339a
Add core profiler "Welcome to Woo!" page (#37952)
* Add core profiler - welcome to woo page

* Add changelog

* Update checkbox styles

* Update copies

* Add test

* Add enable prop to window.wcTracks type

* Add tracks

* Add explat changelog

* Fix import

* Update default tracking value

* Update copies

* Fix test

* using invoked promise instead of useState

- take advantage of xstate's built ins for side effects instead of  useEffect/hooks
- discovered that error result wasn't really handled in original useEffect
- use text labels instead of inline functions so that we can decouple the implementation from the machine model
- todo: can move the invoked function out elsewhere and also tests if needed (not necessary here because it's a simple call)

* use actions.choose instead of branching inside action 

- https://stately.ai/docs/xstate/transitions-and-choices/guarded-actions#the-choose-action
- makes it so that the machine model is serializeable
- todo: in the distant future i wonder if it might be tidier to have tracks be its own actor that just receives the same events that this machine does, that way it's just standalone instead of mixing up tracks with the implementation

* use dispatch instead of useDispatch

- decouples the implementation of the handler from the react component
- makes the handler testable on its own if needed
- makes the state machine testable without relying on external dependencies

* decoupled remaining function calls

* Fix lint error

* Fix style lint

* address xstate console warnings

- .withConfig() is a function call that returns a new object every invocation so we need to wrap it in useMemo to keep it stable

* Add optInDataSharing is false test

* Fix lint

---------

Co-authored-by: rjchow <me@rjchow.com>
2023-05-03 15:54:28 +08:00
Joel Thiessen 3679f019bb
Adding attributes block to product block editor. (#38051) 2023-05-02 21:13:48 -07:00
Joshua T Flowers 6b141fa2c6
Add fixed toolbar to modal editor (#38031) 2023-05-02 08:45:50 -07:00
Joel Thiessen 16b9191c0d
Adding shipping class option and modal (#37968) 2023-05-01 10:04:54 -07:00
Joshua T Flowers 8827d3fb9a
Add block inspector to modal iframe editor (#38011)
* Add block inspector to modal iframe editor

* Add changelog entry
2023-05-01 10:04:25 -07:00
Joel Thiessen d014e80a20
Fixing more menu width in product block editor header (#38053)
* Fixing more menu styles

* Adding changelog
2023-05-01 06:55:31 -03:00
Nathan Silveira 8fc6972161
Fix N/A displayed on re-enabling toggles for "Stats overview" panel after refreshing "Woocommerce > Home" page. (#38030)
* Fix N/A on stats overview on WooCommerce > Home

* Add changelogs

* Fix wrongfully added type definition
2023-04-28 16:15:10 -03:00
Maikel David Pérez Gómez a35f2c3d5d
Update List price Pricing link on the general tab to navigate to the Pricing tab (#37961)
* Update List price Pricing link on the general tab to navigate to the Pricing tab

* Add changelog files

* Simplify the event name to product_pricing_help_click
2023-04-28 11:33:56 -04:00
Maikel David Pérez Gómez 1514333162
Remove AUTO-DRAFT in product name field on create new product page (#37982)
* Remove AUTO-DRAFT in product name field on create new product page #37930

* Add changelog file

* Remove non needed useEffect import
2023-04-28 11:33:28 -04:00
Maikel David Pérez Gómez f3959d0700
Summary field remove 'inline image' and 'keyboard input' options (#38012)
* Summary field remove 'inline image' and 'keyboard input' options

* Add changelog file
2023-04-28 10:51:22 -04:00
Joshua T Flowers bf14b26846
Add modal editor for use in product editor (#37937)
* Add modal editor for use in product editor

* Allow title of modal to be modified by consumer

* Add changelog entry

* Remove errant style imports after rebase

* Handle PR feedback
2023-04-28 07:48:36 -07:00
louwie17 452fa75038
Remove strange block editor highlighting within product block editor (#38000)
* Remove or hide block highlighting within product block editor

* Add changelog
2023-04-28 08:31:14 -03:00
Moon 8f02ecbeba
Migrate Ellipsis Menu component to TS (#36405)
* Migrate ellipsis-menu to TS

* Add changelog

* Remove React.VFC -- it is deprecated in React 18

* Make renderContent props optional

* Allow KeyboardEvent

* Make onToggle optional

* Allow undefined for backward compatibility

* Remove unnecessary @ts-expect-error -- ellipsis menu is now in TS

* Make onToggle required

* Make event e required - backward compatibility

* Use toggleHandlerOverride to make it more readable

* Remove React.VFC -- it is deprecated in React 18
2023-04-27 17:00:35 -07:00
Joshua T Flowers 64dbeba260
Add ContentPreview component for previewing block content (#37990)
* Allow custom tags and attributes in sanitize html util

* Add ContentPreview component for previewing block content

* Add styling around preview area

* Add changelog entry

* Only show content preview area when content exists
2023-04-26 19:29:50 -07:00
Moon 4f484f144e
Migrate Rating component to TS (#36301)
* Convert rating to ts

* Add changelog

* Add gridicons type

* Fix style

* Change ReactElement to ReactNode

* Remove propTypes

* Remove React.VFC -- it is deprecated in React 18
2023-04-26 15:21:16 -07:00
Matt Sherman e81f8ae88f
Update AdvancedFilters to use createInterpolateElement instead of interpolateComponents (#37967) 2023-04-26 06:58:14 -04:00
psealock b726c62be5 Automated change: Prep @woocommerce/extend-cart-checkout-block for release. 2023-04-26 00:53:18 +00:00
Joel Thiessen 6f7eeeaf49
Refactoring LayoutContext and implementing with product editor (#37720) 2023-04-25 15:17:33 -07:00
Joshua T Flowers 48af8c1333
Add the product description block and callbacks for the IframeEditor (#37852)
* Add onChange and onClose callbacks to IframeEditor

* Add description block

* Add initial blocks to iframe editor

* Update button text when description already exists

* Remove unused editorStyle block property

* Debounce onChange callback

* Add changelog entry

* Handle PR feedback

* Fix up export after rebase
2023-04-25 11:05:25 -07:00
Sam Seay 7cbc3811d8
Update monorepo to pnpm 8 and Node to 16.14 (#37915) 2023-04-25 18:49:30 +12:00
Maikel David Pérez Gómez fb7e68a83d
Track stock quantity for this product should be disabled when Enable stock management within settings is disabled, and enabled otherwise (#37957)
* Track stock quantity for this product should be disabled when Enable stock management within settings is disabled, and enabled otherwise.

* Add changelog files
2023-04-24 13:42:45 -04:00
Joel Thiessen 3c5a96712a
Adding Stock status to inventory tab and toggle block (#37906) 2023-04-21 14:49:34 -07:00
Maikel David Pérez Gómez 1f2d735d0c
Update current block names to reflect use case and avoid conflicts (#37851)
* Change woocommerce/product-name to woocommerce/product-name-field

* Change woocommerce/product-summary to woocommerce/product-summary-field

* Change woocommerce/product-pricing to woocommerce/product-pricing-field

* Change woocommerce/product-radio to woocommerce/product-radio-field

* Change woocommerce/product-images to woocommerce/product-images-field

* Fix product name block invalid class name

* Move woocommerce/product-section to blocks folder

* Move woocommerce/product-tab to blocks folder

* Move woocommerce/product-collapsible to blocks folder

* Organize block registration, imports and styles

* Add changelog files

* Change woocommerce/product-category to woocommerce/product-category-field

* Change woocommerce/product-checkbox to woocommerce/product-checkbox-field

* Change woocommerce/product-inventory-email to woocommerce/product-inventory-email-field

* Change woocommerce/product-sku to woocommerce/product-sku-field

* Register woocommerce/product-schedule-sale-fields in server side

* Register woocommerce/product-track-inventory-fields in server side

* Fix invalid reference in tabs tests
2023-04-21 16:26:53 -04:00
Joel Thiessen 87da63eb3a
Moving section icon svgs to assets folder and loading by URL (#37869) 2023-04-21 11:53:06 -07:00
Joshua T Flowers 343d4d9fdf
Record tracks on product edit/update (#37770)
* Add auto-draft to product statuses

* Record event on draft save

* Record event on product update

* Add changelog entry

* Add data changelog

* Refactor to use shared function for recording product events

* Handle PR feedback
2023-04-21 09:51:59 -07:00
Joshua T Flowers 1cc5d0dd15
Disable toolbars in all relevant product editor blocks (#37912)
* Disable toolbars in all relevant product editor blocks

* Add changelog entry
2023-04-21 09:51:40 -07:00
louwie17 e88152ff3c
Add category field block (#37295)
* Add initial category block

* Add changelogs

* Add label to font family for block editor and fix template

* Fix rebase conflict and add content role

* Some styling changes for the category field

* Move category block to blocks folder and fix merge conflict.

* Address some styling issues, and update keywords

* Fix css lint error
2023-04-21 05:10:35 -03:00
Jarda Snajdr 8b8cc93f85
Rewrite the useOptionsHydration hook to not dispatch inside useSelect (#37882)
* Rewrite the useOptionsHydration hook to not dispatch inside useSelect

* Fix types of Options store to allow startResolution etc actions

* fixed tests and added changelog

---------

Co-authored-by: rjchow <me@rjchow.com>
2023-04-21 13:58:27 +08:00
Moon 4a52d6b82c
Rewrite withNavigationHydration to work with Gutenberg 15.5+ (#37901)
* Refactor withNavigationHydration to not dispatch inside useSelect

* Add changelog

* Remove unused import
2023-04-20 20:09:10 -07:00
Moon 83981c61b2
Rewrite the withPluginsHydration hook to not dispatch inside useSelect (#37896)
* Fix types to allow startResolutions etc actions

* Rewrite the usePluginsHydration hook to not dispatch inside useSelect

* Add changelog

* Remove unused import
2023-04-20 20:09:00 -07:00
Moon 85a71f8cee
Rewrite the withCurrentUserHydration hook to not dispatch inside useSelect (#37908)
* Rewrite withCurrentUserHydration hook to not dispatch inside useSelect

* Remove unused import

* Update comment
2023-04-20 20:08:48 -07:00
Joel Thiessen 7023a80937
Adding global product block editor styles (#37805)
* Removing unecessary class

* Organizing editor styles

* Tweaking global fonts

* Correcting section spacing and adding divider

* Adding header styles

* Refactoring block editor styles

* Tweaks to spacing

* Adding changelogs

* Removing uneeded styles

* Fixing colors and link decoration

* Unifying error styles
2023-04-20 05:21:23 -03:00
Maikel David Pérez Gómez 33798acd65
Add a11y support to collapsible content component (#37760)
* Improve a11y support to collapsible content component

* Add changelog file

* Change id pattern to
2023-04-19 18:04:05 -04:00
louwie17 b42da82e50
Update/34885 category field in product editor (#36869)
* Add initial custom meta box for product categories

* Make use of TreeSelectControl

* Update classnames

* Display selected items and sync with most used tab

* Always show placeholder and remove checklist container

* Reactify category metabox tabs

* Add create new category logic

* Remove unused markup

* Fix saving of empty category list

* Add callback when input is cleared as well

* Some small cleanup and refactoring.

* Add changelog

* Fix tree creation and style enqueue

* Auto fix lint errors

* Fix linting errors

* Fix css lint errors

* Add 100 limit, and address some PR feedback

* Fix some styling and warnings

* Remove unused code

* Address PR feedback

* Fix lint error

* Fix lint errors

* Address PR feedback

* Fix lint error

* Minor fixes and add tracking

* Add debounce

* Fix lint error

* Allow custom min filter amount and fix menu not showing after escaping input

* Allow single item to be cleared out of select control

* Fix bug where typed values did not show up

* Fix some styling issues

* Allow parents to be individually selected

* Address PR feedback and add error message

* Add changelogs

* Fix saving issue

* Add client side sorting and stop clearing field upon selection

* Update changelog

* Create feature flag for async product categories dropdown

* Fix lint errors

* Fix linting
2023-04-19 04:28:18 -03:00
Joshua T Flowers ebe879d5dd
Add IframeEditor component to product editor (#37570)
* Add initial modal editor

* Add in iframe editor styles

* Convert components to TS

* Sync dependencies

* Remove unused components and props

* Set min height to avoid jumpiness during resize

* Fix up private APIs dependency version

* Update ModalEditor name to IframeEditor

* Add changelog entry

* Remove IframeEditor from details block

* Update frozen lock file

* Add support for missing gutenberg assets function

* Fix lock file after rebase

* Use default editor settings when none are provided

* Remove currently unused editor styles

* Remove unused private apis package

* Fix php lint errors

* Remove unused import

* Pin keycodes version

* Remove another unused import from testing

* Add WC changelog entry
2023-04-18 10:52:28 -07:00
Maikel David Pérez Gómez 41545ec459
Invert the useValidation hook behavior to return an error instead of a boolean value (#37695)
* Invert the useValidation hook behavior to return an error instead of a boolean value

* Fix validation logic in schedule-sale and track-inventory blocks

* Add changelog file

* Add validations to product name block

* Fix shipping dimensions validations

* Fix shipping fee validations

* Add i18n error message example to readme.md

* Cover semantic issues
2023-04-17 23:54:15 -04:00
Joshua T Flowers ffcbaf5b3a
Move tabs to header and adjust title position (#37696)
* Move product editor tabs to header

* Update header styles to place tabs on bottom

* Center header title and adjust font size

* Style title and columns on mobile

* Add changelog entry

* Truncate longer titles

* Hide title on smaller viewports

* Truncate via css width instead of character count
2023-04-17 15:39:09 -07:00
Chi-Hsuan Huang a953904d84
Remove theme step from onboarding wizard (#37671)
* Remove theme step from onboarding wizard

* Remove theme step from e2e tests

* Deprecated "theme" prop from profileItem type

* Add changelog

* Remove theme product from dashboard

* Update packages/js/data/src/onboarding/types.ts

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

---------

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
2023-04-17 11:59:02 +08:00
Maikel David Pérez Gómez 42cc482ebc
Create shipping fee field block and initial shipping section (#37642)
* Setting up the Fees & dimensions section

* Create product shipping fee block

* Register product shipping fee block

* Add changelog files

* Fix php linter errors

* Add reusable radio field and move the radio block to the blocks folder

* Remove manually set block className because is autogenerated base on the block name
2023-04-14 22:44:28 -04:00
Maikel David Pérez Gómez 3f23301f3f
Create product shipping dimensions block (#37683)
* Move ShippingDimensionsImage component to @woocommerce/product-editor package

* Create woocommerce/product-shipping-dimensions-fields block

* Register woocommerce/product-shipping-dimensions-fields block

* Add changelog files

* Fix php linter error

* Change unused attr name to __contentEditable to better indicate the porpose

* Remove manually set block className because is autogenerated base on the block name
2023-04-14 14:08:57 -04:00
Joel Thiessen 83458a1dee
Adding inventory advanced section with radio and text fields (#37646) 2023-04-14 08:39:53 -07:00
louwie17 6e2c11f556
Select tree dropdown menu SlotFill support (#37574)
* Add initial select tree popover and modal story

* Add slot fill popover support

* Add changelog

* Remove unneeded use of combobox ref in select-tree

* Fix lint errors

* Address PR feedback and fix issue with parent select control

* Add changelog
2023-04-14 04:22:59 -03:00
Joel Thiessen 247787484a
Add inventory section and SKU blocks (#37623) 2023-04-13 15:33:25 -07:00
Joel Thiessen 038b97a318
Add edit product link modal under name field (#37612) 2023-04-13 08:56:47 -07:00
Joel Thiessen fb12ad20fd
Replacing rest_namespace modification with middleware due to blocks issues (#37621) 2023-04-13 08:45:50 -07:00
Ilyas Foo a02d0a8117
Fix invalid return callback ref warning (#37655)
* Fix invalid return in callback ref and add tests

* Changelog
2023-04-13 23:16:45 +08:00
Maikel David Pérez Gómez f5591b7c9a
Add track inventory field to inventory section (#37585) 2023-04-11 11:52:20 -07:00
Maikel David Pérez Gómez 8354ae2792
Create schedule sale pricing block (#37567)
* Create schedule sale pricing block

* Add auto show/hide and clean fields depending on the initial values

* Add validations to From and To dates fields

* Add changelog files

* Align block with the figma design

* Revert linter replacement in the editor global style.scss file

* Fix some words typos

* Move and rename schedule sale block to the blocks folder

* Load datetime format from @wordpress/date instead of using the woo options datastore

* Remove the min difference using by moment to compare dates from 'minute' to undefined

* Make sure the dates are normalized for comparison
2023-04-11 10:53:37 -04:00
Nathan Silveira fa4dd90401
Change link all variations label (#37632) 2023-04-11 11:44:27 -03:00
Darren Ethier 50593c5257
Fix issue that breaks the WooCommerce Home Page when Gutenberg 15.5 is active (#37641)
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
Co-authored-by: rjchow <me@rjchow.com>
2023-04-11 15:27:38 +08:00
Joshua T Flowers 7734027b4a
Add product radio block and tax class to product blocks editor (#37529)
* Add product radio block

* Wrap tax class radio in collapsible block

* Add link to description and sanitize HTML

* Add changelog entry

* Fix up php lint errors

* Add changelog entry

* Fix linting errors

* Remove unused import
2023-04-05 10:13:05 -07:00
Maikel David Pérez Gómez bb22fd5864
Prevent click event when buttons are aria-disabled (#37577)
* Prevent click event when buttons are aria-disabled

* Add changelog file
2023-04-05 12:55:22 -04:00
Maikel David Pérez Gómez f7572b4361
Move the Save draft and Preview buttons to the product editor header (#37461)
* Add preview button to the product editor header

* Publish the product on add or on save

* Add save draft button

* Save product changes before previewing it

* Add notice messages

* Fix linter errors

* Force the store page to be openned in a new tab after publishing the product

* Enable publish button when the status is not publish

* Add changelog files

* Fix some comment typos

* Address comment suggestions

* Move preview logic to its own component

* Move save draft logic to its own component

* Move publish logic to its own component
2023-04-04 11:30:39 -04:00
Nathan Silveira 6291d10112
Use SelectTree component in Category field (#37479)
* Migrate category field to TreeSelect

* Rename and refactor some props due to changes in SelectTree that were introduced afterwards

* add Changelog

* Rename type to a better name

* Add tests to select-tree and remove tests from category-field

* Restore ts change that broke build

* Run linter

* Fix broken tests

* Update test

* Import from wordpress instead of react
2023-04-04 09:28:19 -03:00
Ilyas Foo 502279dff1
Remove inbox notes exceeding characters warning (#37392)
* Removed inbox notes warning

* Changelog

* Removed dompurify dependency from data package

* Remove dompurify types
2023-04-03 19:13:36 +08:00
Maikel David Pérez Gómez 6df1cef307
Add Sale price and list price blocks to pricing tab with pricing section (#37513)
* Add pricing section to the pricing tab

* Add changelog file

* Fix php linter errors
2023-03-31 14:47:31 -03:00
Joshua T Flowers 85080f642b
Add block related assets entry points to product editor build (#37318)
* Add editorStyle properties to blocks

* Rename style.scss files to editor.scss

* Get block entry points for block related assets

* Copy block assets to core assets build folder

* Remove unusable dependency

* Add changelog entries

* Fix up RTL style builds for block assets

* Update copy-webpack-plugin dependency and lock file

* Fix up lock file after rebase

* Fix order of webpack rtl stylesheet builds to prevent additional stylsheets

* Fix up lock file after rebase

* Fix tsconfig
2023-03-31 10:36:40 -07:00
Joshua T Flowers 681391a50a
Add product images block to product editor (#37455)
* Add images block to the product editor

* Allow html in section block descriptions

* Add changelog entry

* Add client changelog entry

* Remove SVG related changes

* Fix up lock file after rebase

* Remove unused import

* Fix up php lint errors

* Move sanitize function to utils folder
2023-03-30 11:22:07 -07:00
Gan Eng Chin b2629c03db
Make Multichannel Marketing the default new UI for Marketing page (#37430) 2023-03-29 21:09:23 +08:00
Gan Eng Chin 34bd123448
Remove unused button-style mixins. 2023-03-29 19:06:40 +08:00
Chi-Hsuan Huang 19a119f0a8
Upstream changes from experimental-select-control back to @woocommerce/components (#36521)
* Add scrollIntoViewOnOpen and position props to menu

* Add ability to customize active item style

* Add menu toggle button

* Add changelog

* Fix changelog

* Rename toggle button classname

* Change default menu position

* Update toggle button story

* Add default value to getToggleButtonProps
2023-03-29 17:18:43 +08:00
Niels Lange 96a1e9cd7b
Update extend-cart-checkout-block dependency (#37191) 2023-03-29 09:39:46 +07:00
Joshua T Flowers 49cde4cad6
Content lock all blocks in the product editor (#37382)
* Lock all blocks in the product editor to content only

* Add changelog entry

* Add content role to summary field to allow editing

* Remove unused BlockControls
2023-03-28 15:18:00 -07:00
Christopher Allford 2f4f0bea54
Added Build File Caching (#37459)
Since these files can impact the build, we need to make sure to use
them as part of the cache key.
2023-03-28 12:48:20 -07:00
Matt Sherman 30ea6cfc71
Show spotlight when switching to variable product type (#37413)
* Show variable product tour
* Only show tour when product type is changed to variable
* Only show tour if it hasn't been shown before
* Add variable_product_tour_shown to UserPreferences type
* Store whether tour has been shown in user preferences
* Record Tracks events
* Add docblock for woocommerce_admin_get_user_data_fields filter
* Add test for tour
2023-03-28 13:49:40 -04:00
Matt Sherman eab7750208
Move product-editor CES-related components and utilities (#37131)
* Update package.json and lock file
* Move ProductMVPFeedbackModal to @woocommerce/product-editor
* Move ProductMVPFeedbackModalContainer to @woocommerce/product-editor
* Move ProductMVPCESFooter and useProductMVPCESFooter to @woocommerce/product-editor
* FIx mock of __experimentalUseProductMVPCESFooter in test
2023-03-28 13:38:08 -04:00
louwie17 bc42b853d8
Update product editor interpolate components (#37453)
* Remove use cases of `interpolateComponents`

* Remove from package json

* Add changelog
2023-03-28 04:15:17 -03:00
Niels Lange 9eeda1d853
Move .wp-env.json.mustache to root folder 2023-03-28 12:05:58 +07:00
Maikel David Pérez Gómez a5b104eaed
Add icon support to product section block (#37340)
* Add block icon component

* Use the block icon component within the section block

* Add changelog file

* Fix rebase conflicts

* Remove icon configuration from the client side

* Change the BlockIcon component to get the icon from the attributes first and then from the metadata

* Expose the BlockIcon to be used outside of the package

* Add the BlockIcon documentation

* Configure the block to support the new icon via attributes

* Set the icon to the block section in the server template definition

* Revert back index.tsx -> index.ts in the section block

* Fix php linter errors

* Add changelog file

* Fix php linter error

* Return null instead of a Fragment
2023-03-27 12:52:03 -03:00