Merge branch 'trunk' into add/sync_of_deleted_orders

This commit is contained in:
Nestor Soriano 2023-07-03 14:34:20 +09:00
commit 79a6c798de
No known key found for this signature in database
GPG Key ID: 08110F3518C12CAD
459 changed files with 6387 additions and 3762 deletions

View File

@ -35,7 +35,8 @@ Please take a moment to review the [project readme](https://github.com/woocommer
- Ensure you stick to the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/).
- Run our build process described in the document on [how to set up WooCommerce development environment](https://github.com/woocommerce/woocommerce/wiki/How-to-set-up-WooCommerce-development-environment), it will install our pre-commit hook, code sniffs, dependencies, and more.
- Whenever possible please fix pre-existing code standards errors in the files that you change. It is ok to skip that for larger files or complex fixes.
- Before pushing commits to GitHub, check your code against our code standards. For PHP code in the WooCommerce Core project you can do this by running `pnpm --filter=woocommerce run lint:php:changes:branch`.
- Whenever possible, please fix pre-existing code standards errors in code that you change.
- Ensure you use LF line endings in your code editor. Use [EditorConfig](http://editorconfig.org/) if your editor supports it so that indentation, line endings and other settings are auto configured.
- When committing, reference your issue number (#1234) and include a note about the fix.
- Ensure that your code supports the minimum supported versions of PHP and WordPress; this is shown at the top of the `readme.txt` file.

View File

@ -1,9 +1,9 @@
### Submission Review Guidelines:
- I have followed the [WooCommerce Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) and the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/).
- I have checked to ensure there aren't other open [Pull Requests](https://github.com/woocommerce/woocommerce/pulls) for the same update/change.
- I have reviewed my code for [security best practices](https://developer.wordpress.org/apis/security/).
- Following the above guidelines will result in quick merges and clear and detailed feedback when appropriate.
- I have followed the [WooCommerce Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) and the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/).
- I have checked to ensure there aren't other open [Pull Requests](https://github.com/woocommerce/woocommerce/pulls) for the same update/change.
- I have reviewed my code for [security best practices](https://developer.wordpress.org/apis/security/).
- Following the above guidelines will result in quick merges and clear and detailed feedback when appropriate.
<!-- You can erase any parts of this template not applicable to your Pull Request. -->
@ -28,3 +28,37 @@ Using the [WooCommerce Testing Instructions Guide](https://github.com/woocommerc
3.
<!-- End testing instructions -->
### Changelog entry
<!-- You can optionally choose to enter a changelog entry by checking the box and supplying data. -->
- [ ] Automatically create a changelog entry from the details below.
<details>
#### Significance
<!-- Choose only one -->
- [ ] Patch
- [ ] Minor
- [ ] Major
#### Type
<!-- Choose only one -->
- [ ] Fix - Fixes an existing bug
- [ ] Add - Adds functionality
- [ ] Update - Update existing functionality
- [ ] Dev - Development related task
- [ ] Tweak - A minor adjustment to the codebase
- [ ] Performance - Address performance issues
- [ ] Enhancement
#### Message <!-- Add a changelog message here -->
#### Comment <!-- If the changes in this pull request don't warrant a changelog entry, you can alternatively supply a comment here. Note that comments are only accepted with a significance of "Patch" -->
</details>

View File

@ -29,7 +29,7 @@ runs:
- name: Setup PNPM
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd
with:
version: '8.3.1'
version: '8.6.5'
- name: Setup Node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
@ -43,7 +43,7 @@ runs:
with:
php-version: ${{ inputs.php-version }}
coverage: none
tools: phpcs, sirbrillig/phpcs-changed:2.10.2
tools: phpcs, sirbrillig/phpcs-changed:2.11.1
- name: Cache Composer Dependencies
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8

View File

@ -61,6 +61,12 @@
'plugin: woocommerce':
- plugins/woocommerce/**/*
'plugin: woocommerce beta tester':
- plugins/woocommerce-beta-tester/**/*
'plugin: woo-ai':
- plugins/woo-ai/**/*
'focus: react admin [team:Ghidorah]':
- plugins/woocommerce/src/Admin/**/*
- plugins/woocommerce/src/Internal/Admin/**/*

View File

@ -1,287 +0,0 @@
name: Bump WP L-2 Support
on:
workflow_dispatch:
inputs:
releaseBranch:
description: Provide the release branch you want to bump the WP L-2 support. Example release/6.9. Note that trunk will also be bumped to match.
default: ''
required: true
permissions: {}
env:
GIT_COMMITTER_NAME: 'WooCommerce Bot'
GIT_COMMITTER_EMAIL: 'no-reply@woocommerce.com'
GIT_AUTHOR_NAME: 'WooCommerce Bot'
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
jobs:
check-release-branch-exists:
name: Check for existence of release branch
runs-on: ubuntu-20.04
steps:
- name: Check for release branch
id: release-branch-check
uses: actions/github-script@v6
with:
script: |
// This will throw an error for non-200 responses, which prevents subsequent jobs from completing, as desired.
await github.request( 'GET /repos/{owner}/{repo}/branches/{branch}', {
owner: context.repo.owner,
repo: context.repo.repo,
branch: '${{ inputs.releaseBranch }}',
} );
validate-bump:
name: Validate and bump WP L-2 support version
runs-on: ubuntu-20.04
needs: check-release-branch-exists
if: success()
permissions:
actions: write
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: Get latest WP version
id: latestWP
uses: actions/github-script@v6
with:
script: |
const https = require( 'https' );
https.get( 'https://api.wordpress.org/core/stable-check/1.0/', ( resp ) => {
let data = '';
// A chunk of data has been received.
resp.on( 'data', ( chunk ) => {
data += chunk;
} );
// The whole response has been received. Print out the result.
resp.on( 'end', () => {
JSON.parse(data, ( key, val ) => {
if ( val === 'latest' ) {
core.setOutput( 'version', key )
}
} );
} );
} ).on( 'error', ( err ) => {
console.log( 'Error: ' + err.message );
} );
- name: Get L-2 WP version
id: l2Version
if: steps.latestWP.outputs.version != '' && steps.latestWP.outputs.version != null
uses: actions/github-script@v6
with:
script: |
const version = "${{ steps.latestWP.outputs.version }}";
const latestWPVersionMajor = version.split( '.' )[0];
const latestWPVersionMinor = version.split( '.' )[1];
const l2 = (parseInt( ( latestWPVersionMajor + latestWPVersionMinor ), 10 ) - 2 ).toString();
const l2Major = l2.split( '' )[0];
const l2Minor = l2.split( '' )[1];
core.setOutput( 'version', l2Major + '.' + l2Minor );
- name: Git fetch the release branch
run: git fetch origin ${{ inputs.releaseBranch }}
- name: Checkout release branch
run: git checkout ${{ inputs.releaseBranch }}
- name: Create a PR branch based on release branch
run: git checkout -b WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/${{ inputs.releaseBranch }}
- name: Check if WP L-2 support needs to be bumped the release branch
id: readmeWPVersion
if: steps.l2Version.outputs.version != '' && steps.l2Version.outputs.version != null
uses: actions/github-script@v6
with:
script: |
const fs = require( 'node:fs' );
const l2Version = "${{ steps.l2Version.outputs.version }}";
let readme = '';
fs.readFile( './plugins/woocommerce/readme.txt', 'utf-8', function( err, data ) {
if ( err ) {
console.error( err );
}
readme = data.split( "\n" );
const newReadme = [];
let needsChange = false;
for ( const line of readme ) {
if ( line.match( /Requires\sat\sleast:\s\d+\.\d/ ) ) {
const readmeVersion = line.match( /\d+\.\d/ );
// If the versions don't match, means we need to make a change.
if ( readmeVersion != l2Version ) {
needsChange = true;
newReadme.push( 'Requires at least: ' + l2Version );
continue;
}
}
newReadme.push( line );
}
if ( needsChange ) {
fs.writeFile( './plugins/woocommerce/readme.txt', newReadme.join( "\n" ), err => {
if ( err ) {
core.setFailed( `Unable to bump the WP L-2 support version. ${err}` );
}
core.setOutput( 'needsChange', needsChange );
// Copy the readme.txt file to the root of VM to be used later.
fs.writeFile( '../../readme.txt', newReadme.join( "\n" ), err => {
if ( err ) {
core.setFailed( `Unable to copy the readme.txt file to the root of VM. ${err}` );
}
} );
} );
} else {
core.setFailed( 'No changes needed. WP Version is L-2 compatible.' );
}
} );
- name: Commit changes
if: steps.readmeWPVersion.outputs.needsChange == 'true'
run: git commit --no-verify -am "Update readme.txt WP L-2 support version."
- name: Push changes
if: steps.readmeWPVersion.outputs.needsChange == 'true'
run: git push origin WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/${{ inputs.releaseBranch }}
- name: Push the PR up to GitHub
id: release-branch-pr
if: steps.readmeWPVersion.outputs.needsChange == 'true'
uses: actions/github-script@v6
with:
script: |
const PRBody = "This PR bumps the WP version to L-2 compatible for the release branch ${{ inputs.releaseBranch }}.\n";
const pr = await github.rest.pulls.create( {
owner: context.repo.owner,
repo: context.repo.repo,
title: "Bump WP Version to L-2 compatible for ${{ inputs.releaseBranch }}",
head: "WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/${{ inputs.releaseBranch }}",
base: "${{ inputs.releaseBranch }}",
body: PRBody
} );
if ( pr.status != 201 ) {
core.setFailed( "Unable to push WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/${{ inputs.releaseBranch }} to GitHub." );
}
core.setOutput( 'pr', pr.data.number );
await github.rest.pulls.requestReviewers( {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr.data.number,
reviewers: [ context.actor ]
} );
- name: Checkout trunk branch
if: steps.release-branch-pr.outputs.pr != '' && steps.release-branch-pr.outputs.pr != null
run: git checkout trunk
- name: Create a branch based on trunk branch
if: steps.release-branch-pr.outputs.pr != '' && steps.release-branch-pr.outputs.pr != null
run: git checkout -b WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/trunk
- name: Check if WP L-2 support needs to be bumped for trunk
id: readmeWPVersionTrunk
if: steps.release-branch-pr.outputs.pr != '' && steps.release-branch-pr.outputs.pr != null
uses: actions/github-script@v6
with:
script: |
const fs = require( 'node:fs' );
const l2Version = "${{ steps.l2Version.outputs.version }}";
let readme = '';
fs.readFile( './plugins/woocommerce/readme.txt', 'utf-8', function( err, data ) {
if ( err ) {
console.error( err );
}
readme = data.split( "\n" );
const newReadme = [];
let needsChange = false;
for ( const line of readme ) {
if ( line.match( /Requires\sat\sleast:\s\d+\.\d/ ) ) {
const readmeVersion = line.match( /\d+\.\d/ );
// If the versions don't match, means we need to make a change.
if ( readmeVersion != l2Version ) {
needsChange = true;
newReadme.push( 'Requires at least: ' + l2Version );
continue;
}
}
newReadme.push( line );
}
if ( needsChange ) {
fs.writeFile( './plugins/woocommerce/readme.txt', newReadme.join( "\n" ), err => {
if ( err ) {
core.setFailed( `Unable to bump the WP L-2 support version. ${err}` );
}
core.setOutput( 'needsChange', needsChange );
// Copy the readme.txt file to the root of VM to be used later.
fs.writeFile( '../../readme.txt', newReadme.join( "\n" ), err => {
if ( err ) {
core.setFailed( `Unable to copy the readme.txt file to the root of VM. ${err}` );
}
} );
} );
} else {
core.setFailed( 'No changes needed. WP Version is L-2 compatible.' );
}
} );
- name: Commit changes
if: steps.readmeWPVersionTrunk.outputs.needsChange == 'true'
run: git commit --no-verify -am "Update readme.txt WP L-2 support version."
- name: Push changes
if: steps.readmeWPVersionTrunk.outputs.needsChange == 'true'
run: git push origin WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/trunk
- name: Push the PR up to GitHub
if: steps.readmeWPVersionTrunk.outputs.needsChange == 'true'
uses: actions/github-script@v6
with:
script: |
const PRBody = "This PR bumps the WP version to L-2 compatible for trunk.\n";
const pr = await github.rest.pulls.create( {
owner: context.repo.owner,
repo: context.repo.repo,
title: "Bump WP Version to L-2 compatible for trunk",
head: "WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/trunk",
base: "trunk",
body: PRBody
} );
if ( pr.status != 201 ) {
core.setFailed( "Unable to push WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/trunk to GitHub." );
}
await github.rest.pulls.requestReviewers( {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr.data.number,
reviewers: [ context.actor ]
} );

View File

@ -1,10 +1,46 @@
name: 'Changelog Auto Add'
on: workflow_dispatch
on:
pull_request:
types: [opened, synchronize, reopened, edited]
workflow_dispatch:
inputs:
prNumber:
description: Pull request number
required: true
jobs:
hello-world:
name: 'Hello World'
add-changelog:
name: 'Add changelog to PR'
if: ${{ github.event.pull_request.user.login != 'github-actions[bot]' }}
runs-on: ubuntu-20.04
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Hello
run: echo "Hello World"
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PNPM
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd
with:
version: '8.6.5'
- name: Setup Node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
with:
node-version-file: .nvmrc
cache: pnpm
registry-url: 'https://registry.npmjs.org'
- name: Install prerequisites
run: |
pnpm install --filter monorepo-utils --ignore-scripts
# ignore scripts speeds up setup signficantly, but we still need to build monorepo utils
pnpm build
working-directory: tools/monorepo-utils
- name: Add changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm utils changefile ${{github.event.number || inputs.prNumber}} -o ${{ github.repository_owner }}

View File

@ -336,7 +336,7 @@ jobs:
uses: archive/github-actions-slack@v2.0.0
with:
slack-bot-user-oauth-access-token: ${{ secrets.CODE_FREEZE_BOT_TOKEN }}
slack-channel: ${{ inputs.slackChannelOverride || secrets.WOO_RELEASE_SLACK_CHANNEL }}
slack-channel: ${{ inputs.slackChannelOverride || secrets.WOO_RELEASE_SLACK_NOTIFICATION_CHANNEL }}
slack-text: |
:warning-8c: Code freeze violation. PR(s) created that breaks the Code Freeze for '${{ needs.prep.outputs.release }}' :ice_cube:
@ -347,7 +347,7 @@ jobs:
uses: archive/github-actions-slack@v2.0.0
with:
slack-bot-user-oauth-access-token: ${{ secrets.CODE_FREEZE_BOT_TOKEN }}
slack-channel: ${{ inputs.slackChannelOverride || secrets.WOO_RELEASE_SLACK_CHANNEL }}
slack-channel: ${{ inputs.slackChannelOverride || secrets.WOO_RELEASE_SLACK_NOTIFICATION_CHANNEL }}
slack-text: |
:warning-8c: Code freeze violation. PR(s) created that breaks the Code Freeze for '${{ needs.prep.outputs.release }}' :ice_cube:

View File

@ -23,7 +23,7 @@ jobs:
uses: ./.github/actions/setup-woocommerce-monorepo
- name: Lint
run: pnpm run -r --filter='release-posts' --filter='woocommerce/client/admin...' --filter='!@woocommerce/e2e*' --filter='!@woocommerce/api' --color lint
run: pnpm run -r --filter='release-posts' --filter='woocommerce/client/admin...' --filter='@woocommerce/monorepo-utils' --filter='!@woocommerce/e2e*' --filter='!@woocommerce/api' --color lint
- name: Test
run: pnpm run test --filter='woocommerce/client/admin...' --filter='!@woocommerce/e2e*' --filter='!@woocommerce/api' --color

View File

@ -3,7 +3,7 @@ on:
workflow_dispatch:
inputs:
packages:
description: 'Enter a specific package to release, or packages separated by commas, ie @woocommerce/components,@woocommerce/number. Leaving this input to the default "-a" will prepare to release all eligible packages. When releasing a package for the first time, pass the "--initialRelease" flag.'
description: 'Enter a specific package to release, or packages separated by commas, ie @woocommerce/components,@woocommerce/number. Leaving this input to the default "-a" will prepare to release all eligible packages.'
required: false
default: '-a'

View File

@ -44,7 +44,7 @@ jobs:
- name: Setup PNPM
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd
with:
version: '8.3.1'
version: '8.6.5'
- name: Setup Node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
@ -106,7 +106,7 @@ jobs:
- name: Setup PNPM
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd
with:
version: '8.3.1'
version: '8.6.5'
- name: Setup Node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c

View File

@ -31,9 +31,3 @@ if [ $? -ne 0 ]; then
exit 1
fi
# Ensure both branches are tracked or check-changelogger-use will fail. Note we pass hooksPath
# to avoid running the pre-commit hook.
git -c core.hooksPath=/dev/null checkout $PROTECTED_BRANCH --quiet
git -c core.hooksPath=/dev/null checkout $CURRENT_BRANCH --quiet
php tools/monorepo/check-changelogger-use.php $PROTECTED_BRANCH $CURRENT_BRANCH

View File

@ -1,5 +1,181 @@
== Changelog ==
= 7.8.1 2023-06-27 =
**WooCommerce**
* Update - Update WooCommerce Blocks to 10.2.4 [#38891](https://github.com/woocommerce/woocommerce/pull/38891)
* Fix - Do not show "Adding new attribute failed" error message when loading of product screens is interrupted by page unload. [[#38815]](https://github.com/woocommerce/woocommerce/pull/38815)
* Tweak - Always pass default product type options to product_type_options filter. [[#38854]](https://github.com/woocommerce/woocommerce/pull/38854)
= 7.8.0 2023-06-13 =
**WooCommerce**
* Fix - Fix a bug where text overlapped the image in the task list header. [#38585](https://github.com/woocommerce/woocommerce/pull/38585)
* Fix - Fix issue where undefined query params where not removed from links, causing unexpected behaviour in Analytics. [#38542](https://github.com/woocommerce/woocommerce/pull/38542)
* Fix - Above notification threshold when "Out of stock threshold" filed value is empty [[#37855]](https://github.com/woocommerce/woocommerce/pull/37855)
* Fix - Added numeric check for Regular price in bulk edits. [[#37812]](https://github.com/woocommerce/woocommerce/pull/37812)
* Fix - add missing aria-label attributes to help tips [[#37808]](https://github.com/woocommerce/woocommerce/pull/37808)
* Fix - add refunded_payment property in the create refund response [[#37816]](https://github.com/woocommerce/woocommerce/pull/37816)
* Fix - Add support to verify specific order types. [[#38318]](https://github.com/woocommerce/woocommerce/pull/38318)
* Fix - Add the product name to the "Remove from cart" button's aria-label in the cart and mini cart. [[#37830]](https://github.com/woocommerce/woocommerce/pull/37830)
* Fix - Clear floats in Twenty Twenty Three theme on Related products and Upsells. [[#37877]](https://github.com/woocommerce/woocommerce/pull/37877)
* Fix - Ensure the remove icon shows properly on smaller screens when using the Twenty Twenty One theme [[#37859]](https://github.com/woocommerce/woocommerce/pull/37859)
* Fix - Fix "Add store details" task fails to mark as completed for selecting Nigeria based address [[#38181]](https://github.com/woocommerce/woocommerce/pull/38181)
* Fix - Fix: when order is deleted child orders should be deleted too, not set to parent id 0, unless the post type for the order is hierarchical [[#38199]](https://github.com/woocommerce/woocommerce/pull/38199)
* Fix - Fix activity panel not showing unread when closed [[#38173]](https://github.com/woocommerce/woocommerce/pull/38173)
* Fix - Fix decimal points for SEK, HUF and CZK currencies [[#37834]](https://github.com/woocommerce/woocommerce/pull/37834)
* Fix - Fixed Cross-Sells display variable product [[#37616]](https://github.com/woocommerce/woocommerce/pull/37616)
* Fix - Fixes a race condition when adding the first attribute form to the product edit screen. [[#38354]](https://github.com/woocommerce/woocommerce/pull/38354)
* Fix - Fix get_options deprecation notice [[#38289]](https://github.com/woocommerce/woocommerce/pull/38289)
* Fix - Fix loading sample product's progress message is misaligned if Gutenberg plugin is enabled [[#38107]](https://github.com/woocommerce/woocommerce/pull/38107)
* Fix - fix logout vs log out typo [[#35232]](https://github.com/woocommerce/woocommerce/pull/35232)
* Fix - Fix product task import for cases when user locale is en_US [[#38089]](https://github.com/woocommerce/woocommerce/pull/38089)
* Fix - Fix race condition that caused some store alerts to be undismissable [[#38047]](https://github.com/woocommerce/woocommerce/pull/38047)
* Fix - Fix shipping tour layout context error [[#38183]](https://github.com/woocommerce/woocommerce/pull/38183)
* Fix - fix stock status is not correct in JSON structure data if product is onbackorder [[#37837]](https://github.com/woocommerce/woocommerce/pull/37837)
* Fix - Fix task list progress title when no tasks are completed [[#38092]](https://github.com/woocommerce/woocommerce/pull/38092)
* Fix - Fix tracks user ID mismatch between PHP and JS when Jetpack is active and connected [[#38094]](https://github.com/woocommerce/woocommerce/pull/38094)
* Fix - Fix wc-experimental not translated issue [[#38108]](https://github.com/woocommerce/woocommerce/pull/38108)
* Fix - Fix wrong file name in error message in update-wp-env.php. [[#37891]](https://github.com/woocommerce/woocommerce/pull/37891)
* Fix - For the Twenty Twenty One theme, reduce padding within notices on smaller screens [[#37862]](https://github.com/woocommerce/woocommerce/pull/37862)
* Fix - Hide state selector for Ethiopia and Rwanda addresses [[#35481]](https://github.com/woocommerce/woocommerce/pull/35481)
* Fix - Hide upload logo step in Personalize task if theme doesn't support it [[#38161]](https://github.com/woocommerce/woocommerce/pull/38161)
* Fix - No warning shown for zero price. [[#37817]](https://github.com/woocommerce/woocommerce/pull/37817)
* Fix - Prevented an issue with height flickering when selecting a variation [[#38115]](https://github.com/woocommerce/woocommerce/pull/38115)
* Fix - Prevent login call if the user is already logged in. [[#37850]](https://github.com/woocommerce/woocommerce/pull/37850)
* Fix - Prevents error in Customers API endpoint when date_created value is missing [[#37860]](https://github.com/woocommerce/woocommerce/pull/37860)
* Fix - Removed aria-disabled attribute from "Update Cart" button as it already has a disabled attribute. [[#37820]](https://github.com/woocommerce/woocommerce/pull/37820)
* Fix - Remove the default text in "Additional content" being sent for all emails when the field is empty for Admin New Order email [[#37883]](https://github.com/woocommerce/woocommerce/pull/37883)
* Fix - Removing auto-draft as wc post type to resolve publish time bug. [[#38099]](https://github.com/woocommerce/woocommerce/pull/38099)
* Fix - replace title HTML attribute with aria-label for quantity input field [[#37811]](https://github.com/woocommerce/woocommerce/pull/37811)
* Fix - Save an order created via the REST API to prevent overrides from 3rd party plugins or themes if they try to add fees to the order. [[#37845]](https://github.com/woocommerce/woocommerce/pull/37845)
* Fix - Show correct confirmation message when removing an attribute from a product. [[#38355]](https://github.com/woocommerce/woocommerce/pull/38355)
* Fix - Show correct variations count when generating a single variation. [[#37876]](https://github.com/woocommerce/woocommerce/pull/37876)
* Fix - skip k6 api order RUD tests on non-existent order when C test fails [[#37887]](https://github.com/woocommerce/woocommerce/pull/37887)
* Fix - skip k6 batch update when batch create fails [[#38282]](https://github.com/woocommerce/woocommerce/pull/38282)
* Fix - Support strict SQL modes in HPOS migration that dont allow zero date values. [[#38332]](https://github.com/woocommerce/woocommerce/pull/38332)
* Fix - use correct escaping function [[#36868]](https://github.com/woocommerce/woocommerce/pull/36868)
* Fix - Use waitUntil instead of waitForLoadState in page.goto() and page.click(). [[#37831]](https://github.com/woocommerce/woocommerce/pull/37831)
* Fix - When creating default storefront pages, the site language (and not the language of the current user) should be used. [[#37795]](https://github.com/woocommerce/woocommerce/pull/37795)
* Fix - Fix Layout Controller forwarding arrays from the URL query string. [#38593](https://github.com/woocommerce/woocommerce/pull/38593)
* Add - Added SSR to WCCOM endpoints. [#38433](https://github.com/woocommerce/woocommerce/pull/38433)
* Add - Add admin-side order edit lock for HPOS. [[#38230]](https://github.com/woocommerce/woocommerce/pull/38230)
* Add - Add a filter to exclude Jetpack from suggested free extensions REST endpoint. [[#38286]](https://github.com/woocommerce/woocommerce/pull/38286)
* Add - Add a function to get the aria-describedby description for the add to cart button.
Add default description for the Select options button. [[#37880]](https://github.com/woocommerce/woocommerce/pull/37880)
* Add - Add Business Location page to the new core profiler [[#38019]](https://github.com/woocommerce/woocommerce/pull/38019)
* Add - Add core profiler "Welcome to Woo" page [[#37952]](https://github.com/woocommerce/woocommerce/pull/37952)
* Add - Add core profiler user profile page [[#38328]](https://github.com/woocommerce/woocommerce/pull/38328)
* Add - Add description block to product editor template [[#37852]](https://github.com/woocommerce/woocommerce/pull/37852)
* Add - Add e2e test for Merchant > Pages > Can create a new page [[#38238]](https://github.com/woocommerce/woocommerce/pull/38238)
* Add - Add e2e test for Merchant > Posts > Can create a new post [[#38041]](https://github.com/woocommerce/woocommerce/pull/38041)
* Add - Added async fetching for extensions and countries lists in new core profiler [[#38270]](https://github.com/woocommerce/woocommerce/pull/38270)
* Add - Added scaffolding for new core profiler [[#37628]](https://github.com/woocommerce/woocommerce/pull/37628)
* Add - Add HPOS specific k6 test suite [[#37665]](https://github.com/woocommerce/woocommerce/pull/37665)
* Add - Adding order attributes to product tabs template. [[#38081]](https://github.com/woocommerce/woocommerce/pull/38081)
* Add - Add navigation and progress-bar componentns for the new core profiler [[#37741]](https://github.com/woocommerce/woocommerce/pull/37741)
* Add - Add Sale price validation#37985 [[#38078]](https://github.com/woocommerce/woocommerce/pull/38078)
* Add - add support for minlenght in the template [[#37840]](https://github.com/woocommerce/woocommerce/pull/37840)
* Add - Add tinymce scripts to product editor pages [[#38175]](https://github.com/woocommerce/woocommerce/pull/38175)
* Add - Add unresolved assets for iframe editors to editor settings [[#37570]](https://github.com/woocommerce/woocommerce/pull/37570)
* Add - Add WooCommerce Admin page class to body of every page [[#38281]](https://github.com/woocommerce/woocommerce/pull/38281)
* Add - Create orders as 'auto-draft' by default in admin. [[#37643]](https://github.com/woocommerce/woocommerce/pull/37643)
* Add - Get feature flags from client side [[#37122]](https://github.com/woocommerce/woocommerce/pull/37122)
* Add - Only register blocks when user navigates to the product edit page#38200 [[#38303]](https://github.com/woocommerce/woocommerce/pull/38303)
* Add - Show the number of variations imported [[#37829]](https://github.com/woocommerce/woocommerce/pull/37829)
* Add - Track stock quantity for this product should be disabled when Enable stock management within settings is disabled, and enabled otherwise [[#37957]](https://github.com/woocommerce/woocommerce/pull/37957)
* Add - Update List price Pricing link on the general tab to navigate to the Pricing tab [[#37961]](https://github.com/woocommerce/woocommerce/pull/37961)
* Add - Update shipping class block to match new designs#38044 [[#38301]](https://github.com/woocommerce/woocommerce/pull/38301)
* Update - Update WooCommerce Blocks to 10.2.3 [#38663](https://github.com/woocommerce/woocommerce/pull/38663)
* Update - Update WooCommerce Blocks to 10.2.2 [#38545](https://github.com/woocommerce/woocommerce/pull/38545)
* Update - Update WooCommerce Blocks to 10.2.1 [#38449](https://github.com/woocommerce/woocommerce/pull/38449)
* Update - Add action hooks to WC_Abstract_Order::remove_order_items [[#37822]](https://github.com/woocommerce/woocommerce/pull/37822)
* Update - Add new REST endpoints at onboarding/plugins to support async plugin installation with real time error tracking. [[#38174]](https://github.com/woocommerce/woocommerce/pull/38174)
* Update - add pagination navigation below Settings Tax list table [[#37916]](https://github.com/woocommerce/woocommerce/pull/37916)
* Update - Add support for `showHeader` config in router config to hide header if needed. [[#38247]](https://github.com/woocommerce/woocommerce/pull/38247)
* Update - Add tracks events to shipping settings [[#38305]](https://github.com/woocommerce/woocommerce/pull/38305)
* Update - Always show the product variations empty state with message when there are no "used for variations" attributes on a product. [[#38358]](https://github.com/woocommerce/woocommerce/pull/38358)
* Update - Change product-category-metabox JS/style enqueue logic [[#38076]](https://github.com/woocommerce/woocommerce/pull/38076)
* Update - Fallback to simply not display any prices rather than empty prices and re-enable Purchase unit tests [[#38163]](https://github.com/woocommerce/woocommerce/pull/38163)
* Update - In the WC Tracker, group payment methods and origins ignoring unique ids within their names. [[#37951]](https://github.com/woocommerce/woocommerce/pull/37951)
* Update - Loading svgs in product block template by URL. [[#37869]](https://github.com/woocommerce/woocommerce/pull/37869)
* Update - Make all fields in the tax location form mandatory [[#38137]](https://github.com/woocommerce/woocommerce/pull/38137)
* Update - Moving AddNewShippingClass modal to product-editor package. [[#37968]](https://github.com/woocommerce/woocommerce/pull/37968)
* Update - Moving product attributes components to product-editor package. [[#38051]](https://github.com/woocommerce/woocommerce/pull/38051)
* Update - Moving product block editor styling to prdouct editor package. [[#37805]](https://github.com/woocommerce/woocommerce/pull/37805)
* Update - Only add product template when new editor feature flag is enabled. [[#38276]](https://github.com/woocommerce/woocommerce/pull/38276)
* Update - Remove Core onboarding usage of woocommerce_updated hook [[#38158]](https://github.com/woocommerce/woocommerce/pull/38158)
* Update - Remove sample data from product templates [[#38343]](https://github.com/woocommerce/woocommerce/pull/38343)
* Update - Replacing hardcoded info and error notices with the correct wp_print_notice functions. [[#37514]](https://github.com/woocommerce/woocommerce/pull/37514)
* Update - Update Category product metabox with an async dropdown search control rendered with React. [[#36869]](https://github.com/woocommerce/woocommerce/pull/36869)
* Update - Update current block names to reflect use case and avoid conflicts#37704 [[#37851]](https://github.com/woocommerce/woocommerce/pull/37851)
* Update - Updated product description tips text. [[#38070]](https://github.com/woocommerce/woocommerce/pull/38070)
* Update - Update empty state for product attributes tab. [[#38126]](https://github.com/woocommerce/woocommerce/pull/38126)
* Update - Update Payfast's title and logo [[#38090]](https://github.com/woocommerce/woocommerce/pull/38090)
* Update - Update product template to include category section and block. [[#37295]](https://github.com/woocommerce/woocommerce/pull/37295)
* Update - Update transformers doc with examples [[#38176]](https://github.com/woocommerce/woocommerce/pull/38176)
* Update - Update WooCommerce Blocks to 10.2.0 [[#38246]](https://github.com/woocommerce/woocommerce/pull/38246)
* Update - Update Woo to L-1 support policy for 7.8 [[#37970]](https://github.com/woocommerce/woocommerce/pull/37970)
* Update - Updating product editor block template to include stock status and refactor others. [[#37906]](https://github.com/woocommerce/woocommerce/pull/37906)
* Update - Updating the usage of LayoutContext and moving to admin-layout package. [[#37720]](https://github.com/woocommerce/woocommerce/pull/37720)
* Update - Use snackbar instead of alert when showing generated variations message. [[#38103]](https://github.com/woocommerce/woocommerce/pull/38103)
* Update - Woo Blocks 10.0.4 [[#38135]](https://github.com/woocommerce/woocommerce/pull/38135)
* Dev - Added model based testing for new core profiler [[#38154]](https://github.com/woocommerce/woocommerce/pull/38154)
* Dev - Added xstate inspector toggling via localStorage flag and dev node environment, and eslint xstate plugin [[#38022]](https://github.com/woocommerce/woocommerce/pull/38022)
* Dev - Add Gutenberg nightly and latest stable into the daily and release smoke tests. [[#38287]](https://github.com/woocommerce/woocommerce/pull/38287)
* Dev - Add instruction to run Playwright UI mode in E2E readme. [[#38197]](https://github.com/woocommerce/woocommerce/pull/38197)
* Dev - Add missing woocommerce_run_on_woocommerce_admin_updated hook for the scheduled action registered in RemoteInboxNotificationsEngine [[#38159]](https://github.com/woocommerce/woocommerce/pull/38159)
* Dev - Add the ability to skip the `review-testing-instructions` workflow when the PR is from an external contributor. [[#37813]](https://github.com/woocommerce/woocommerce/pull/37813)
* Dev - Break down the "create-variable-product" spec into smaller specs. [[#38335]](https://github.com/woocommerce/woocommerce/pull/38335)
* Dev - Cleanup task list and organize tasks file structure [[#38271]](https://github.com/woocommerce/woocommerce/pull/38271)
* Dev - Correct URL and assertion in merchant/add-order perf test. [[#37719]](https://github.com/woocommerce/woocommerce/pull/37719)
* Dev - Increase default timeout and test timeout of create-variable-product spec. [[#38321]](https://github.com/woocommerce/woocommerce/pull/38321)
* Dev - Migrate tasks fills index.js, purchase.tsx and related utils to TS [[#37725]](https://github.com/woocommerce/woocommerce/pull/37725)
* Dev - Modify 'WC_Settings_Tracking' to allow dropdown options recording for WooCommerce Settings [[#38035]](https://github.com/woocommerce/woocommerce/pull/38035)
* Dev - Optimize installation routine by reducing the number of DELETE statments for admin notices. [[#37472]](https://github.com/woocommerce/woocommerce/pull/37472)
* Dev - Register server-side tracking during rest requests [[#37796]](https://github.com/woocommerce/woocommerce/pull/37796)
* Dev - Remove daily.playwright.config.js and references to it. [[#38336]](https://github.com/woocommerce/woocommerce/pull/38336)
* Dev - Removed wp-env workaround since the bug has been fixed [[#38326]](https://github.com/woocommerce/woocommerce/pull/38326)
* Dev - remove unused deasync dependency [[#37821]](https://github.com/woocommerce/woocommerce/pull/37821)
* Dev - Remove `qs` dependency from `woocommerce-admin` [[#35128]](https://github.com/woocommerce/woocommerce/pull/35128)
* Dev - Update Playwright to 1.33 and introduce UI command [[#38100]](https://github.com/woocommerce/woocommerce/pull/38100)
* Dev - Update pnpm to version 8. [[#37915]](https://github.com/woocommerce/woocommerce/pull/37915)
* Dev - Update stable tag to 7.6.1 [[#38006]](https://github.com/woocommerce/woocommerce/pull/38006)
* Dev - Update tasklist documentation/example [[#38245]](https://github.com/woocommerce/woocommerce/pull/38245)
* Dev - Update the E2E test timeout to 90 sec, and update the E2E README. [[#38288]](https://github.com/woocommerce/woocommerce/pull/38288)
* Dev - Update the WSL setup instructions in the readme. [[#37819]](https://github.com/woocommerce/woocommerce/pull/37819)
* Dev - Use locator.fill to fill variation values in the form instead of page.fill [[#37854]](https://github.com/woocommerce/woocommerce/pull/37854)
* Dev - Variations - Remove separator between buttons and empty state screen [[#38123]](https://github.com/woocommerce/woocommerce/pull/38123)
* Dev - Variations - Rename Generate variations button after variations are created. [[#38084]](https://github.com/woocommerce/woocommerce/pull/38084)
* Tweak - Add a 24px spacing to store management body [[#38088]](https://github.com/woocommerce/woocommerce/pull/38088)
* Tweak - Add context to translatable strings for credit card labels. [[#36364]](https://github.com/woocommerce/woocommerce/pull/36364)
* Tweak - Add product type options tracking to product publish and update events. [[#38017]](https://github.com/woocommerce/woocommerce/pull/38017)
* Tweak - Correct spelling errors [[#37887]](https://github.com/woocommerce/woocommerce/pull/37887)
* Tweak - Fix spelling errors in Remote Inbox Notifications Transformers documentation. [[#38387]](https://github.com/woocommerce/woocommerce/pull/38387)
* Tweak - Fix styling of product data field descriptions, including checkboxes and radio buttons. [[#38066]](https://github.com/woocommerce/woocommerce/pull/38066)
* Tweak - Fix typo in a function comment. [[#37829]](https://github.com/woocommerce/woocommerce/pull/37829)
* Tweak - Improve spacing of product gallery thumbs when using the Twenty Twenty-Two theme. [[#35491]](https://github.com/woocommerce/woocommerce/pull/35491)
* Tweak - Makes more information available to handlers for the `checkout_place_order` (and related) events. [[#38147]](https://github.com/woocommerce/woocommerce/pull/38147)
* Tweak - Update plugin listing description [[#38074]](https://github.com/woocommerce/woocommerce/pull/38074)
* Tweak - Update usage of AdvancedFilter to use createInterpolateElement formats. [[#37967]](https://github.com/woocommerce/woocommerce/pull/37967)
* Performance - Compute if any order is pending, when deciding to process next migration batch [[#38165]](https://github.com/woocommerce/woocommerce/pull/38165)
* Performance - Removed global enqueue of wc-cart-fragments. Moved to the cart widget (its main consumer). [[#35530]](https://github.com/woocommerce/woocommerce/pull/35530)
* Enhancement - Add default styles for product meta in the TT3 order details table [[#38172]](https://github.com/woocommerce/woocommerce/pull/38172)
* Enhancement - Added a button to download SSR to a file. [[#38110]](https://github.com/woocommerce/woocommerce/pull/38110)
* Enhancement - Added missing button element classes in account orders and downloads pages [[#37933]](https://github.com/woocommerce/woocommerce/pull/37933)
* Enhancement - Add order note to display held stock inventory to provide more visibility to merchants. [[#37833]](https://github.com/woocommerce/woocommerce/pull/37833)
* Enhancement - Change from using a figure to using a div around the single product image to improve accessibility [[#37853]](https://github.com/woocommerce/woocommerce/pull/37853)
* Enhancement - Fix comment list styling in TT2 [[#37894]](https://github.com/woocommerce/woocommerce/pull/37894)
* Enhancement - Fixed the attributes table styling in TT3 tabs content area [[#37895]](https://github.com/woocommerce/woocommerce/pull/37895)
* Enhancement - Order is search with the phone number and linked with the customer/user account. [[#37844]](https://github.com/woocommerce/woocommerce/pull/37844)
* Enhancement - Print blocks-based CSS classes only when a FSE theme is used [[#37631]](https://github.com/woocommerce/woocommerce/pull/37631)
* Enhancement - Rename tracks event product_attributes_add to product_attributes_save on the product page and update attributes [[#38278]](https://github.com/woocommerce/woocommerce/pull/38278)
* Enhancement - When deleting an administrator user, any existing webhook(s) owned to the user being deleted are re-assigned to the nominated user if the "Attribute all content to" option is chosen, or re-assigned to user id zero. This helps avoid `woocommerce_rest_cannot_view` webhook payload errors. [[#37814]](https://github.com/woocommerce/woocommerce/pull/37814)
= 7.7.2 2023-06-01 =
**WooCommerce**

View File

@ -5,7 +5,7 @@
"homepage": "https://woocommerce.com/",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"private": true,
"repository": {

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Update pnpm monorepo-wide to 8.6.5

View File

@ -6,7 +6,7 @@
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/admin-e2e-tests/README.md",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"repository": {
"type": "git",

View File

@ -5,7 +5,7 @@
"main": "index.js",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"scripts": {
"e2e": "jest",

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Update pnpm monorepo-wide to 8.6.5

View File

@ -6,7 +6,7 @@
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/api/README.md",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"repository": {
"type": "git",

View File

@ -21,14 +21,46 @@ View [the full Component documentation](https://woocommerce.github.io/woocommerc
import { Card } from '@woocommerce/components';
export default function MyCard() {
return (
<Card title="Store Performance" description="Key performance metrics">
<p>Your stuff in a Card.</p>
</Card>
);
return (
<Card title="Store Performance" description="Key performance metrics">
<p>Your stuff in a Card.</p>
</Card>
);
}
```
Many components include CSS to add style, you will need to add in order to appear correctly. Within WooCommerce, add the `wc-components` stylesheet as a dependency of your plugin's stylesheet. See [wp_enqueue_style documentation](https://developer.wordpress.org/reference/functions/wp_enqueue_style/#parameters) for how to specify dependencies.
In non-WordPress projects, link to the `build-style/card/style.css` file directly, it is located at `node_modules/@woocommerce/components/build-style/<component_name>/style.css`.
## Usage with tests
If you are using these components in a project that uses Jest for testing, you may get an error that looks like this:
```bash
Cannot find module '@woocommerce/settings' from 'node_modules/@woocommerce/experimental/node_modules/@woocommerce/navigation/build/index.js'
```
To fix this, you will need to mock the `@woocommerce/settings` because it's an alias that points to the `window.wcSettings`, which in turn comes from and is maintained by the [WC Blocks](https://github.com/woocommerce/woocommerce-blocks) package, the front-end code for this is located [here](https://href.li/?https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/trunk/assets/js/settings/shared).
This can be done by adding the following to your Jest config:
```js
module.exports = {
moduleNameMapper: {
'@woocommerce/settings': path.resolve(
__dirname,
'./mock/woocommerce-settings'
),
}
setupFiles: [
path.resolve( __dirname, 'build/setup-globals.js' ),
],
// ...other config
}
```
Then, you will need to create the following files:
1. Create a new file called woocommerce-settings.js in the ./mock directory. You can find the content for this file [here](https://github.com/woocommerce/woocommerce/blob/trunk/packages/js/internal-js-tests/src/mocks/woocommerce-settings.js#L1).
2. Next, create a file named setup-globals.js. You can find the content for this file [here](https://github.com/woocommerce/woocommerce/blob/trunk/packages/js/internal-js-tests/src/setup-globals.js#L44). The purpose of this file is to mock the wcSettings global variable.

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Update pnpm monorepo-wide to 8.6.5

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
Add instructions on how to run the tests when using @woocommerce/components

View File

@ -0,0 +1,4 @@
Significance: minor
Type: add
Add callback for the media uploader component when gallery is opened

View File

@ -6,7 +6,7 @@
"license": "GPL-3.0-or-later",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"keywords": [
"wordpress",

View File

@ -34,6 +34,7 @@ type MediaUploaderProps = {
message: string;
file: File;
} ) => void;
onMediaGalleryOpen?: () => void;
onUpload?: ( files: MediaItem[] ) => void;
onFileUploadChange?: ( files: MediaItem[] ) => void;
uploadMedia?: ( options: UploadMediaOptions ) => Promise< void >;
@ -49,6 +50,7 @@ export const MediaUploader = ( {
multipleSelect = false,
onError = () => null,
onFileUploadChange = () => null,
onMediaGalleryOpen = () => null,
onUpload = () => null,
onSelect = () => null,
uploadMedia = wpUploadMedia,
@ -96,7 +98,13 @@ export const MediaUploader = ( {
allowedTypes={ allowedMediaTypes }
multiple={ multipleSelect }
render={ ( { open } ) => (
<Button variant="secondary" onClick={ open }>
<Button
variant="secondary"
onClick={ () => {
onMediaGalleryOpen();
open();
} }
>
{ buttonText }
</Button>
) }

View File

@ -0,0 +1,3 @@
vendor
node_modules
.turbo

View File

@ -0,0 +1,12 @@
# Changelog
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.1.0](https://www.npmjs.com/package/@woocommerce/create-product-editor-block/v/1.1.0) - 2023-06-29
- Minor - Update pnpm monorepo-wide to 8.6.5 [#38990]
## [1.0.0](https://www.npmjs.com/package/@woocommerce/create-product-editor-block/v/1.0.0) - 2023-06-28
- Minor - Initial version of @woocommerce/create-product-editor-block [#38263]
- Minor - Do not add script prop to generated block.json [#38496]

View File

@ -1,4 +0,0 @@
Significance: minor
Type: add
Initial version of @woocommerce/create-product-editor-block

View File

@ -0,0 +1,5 @@
Significance: patch
Type: tweak
Comment: Updated package.json to include publishConfig, which was needed for initial bootstrap.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: update
Do not add script prop to generated block.json

View File

@ -1,11 +1,13 @@
{
"name": "@woocommerce/create-product-editor-block",
"version": "0.0.1",
"version": "1.1.0",
"description": "A template to be used with `@wordpress/create-block` to create a Product Editor block.",
"author": "Automattic",
"license": "GPL-3.0-or-later",
"main": "index.js",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"scripts": {
"postinstall": "composer install",
@ -15,11 +17,15 @@
"type": "git",
"url": "git+https://github.com/woocommerce/woocommerce.git"
},
"keywords": [],
"author": "",
"license": "GPL-3.0+",
"keywords": [
"wordpress",
"woocommerce"
],
"bugs": {
"url": "https://github.com/woocommerce/woocommerce/issues"
},
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/create-product-editor-block-extensionv#readme"
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/create-product-editor-block-extensionv#readme",
"publishConfig": {
"access": "public"
}
}

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Update pnpm monorepo-wide to 8.6.5

View File

@ -5,7 +5,7 @@
"main": "index.js",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"scripts": {
"postinstall": "composer install",

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Update pnpm monorepo-wide to 8.6.5

View File

@ -6,7 +6,7 @@
"license": "GPL-3.0-or-later",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"keywords": [
"wordpress",

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Update pnpm monorepo-wide to 8.6.5

View File

@ -11,7 +11,7 @@
],
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/currency/README.md",
"repository": {

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Update pnpm monorepo-wide to 8.6.5

View File

@ -10,7 +10,7 @@
],
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/customer-effort-score/README.md",
"repository": {

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Update pnpm monorepo-wide to 8.6.5

View File

@ -11,7 +11,7 @@
],
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/data/README.md",
"repository": {

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Update pnpm monorepo-wide to 8.6.5

View File

@ -11,7 +11,7 @@
],
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/date/README.md",
"repository": {

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Update pnpm monorepo-wide to 8.6.5

View File

@ -10,7 +10,7 @@
],
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/dependency-extraction-webpack-plugin/README.md",
"repository": {

View File

@ -10,7 +10,7 @@
"license": "GPL-3.0+",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"main": "build/index.js",
"module": "build-module/index.js",

View File

@ -12,7 +12,7 @@
],
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/e2e-environment/README.md",
"bugs": {

View File

@ -10,7 +10,7 @@
"license": "GPL-3.0+",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"main": "build/index.js",
"module": "build-module/index.js",

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Update pnpm monorepo-wide to 8.6.5

View File

@ -6,7 +6,7 @@
"license": "GPL-2.0-or-later",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"keywords": [
"wordpress",

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Update pnpm monorepo-wide to 8.6.5

View File

@ -6,7 +6,7 @@
"license": "GPL-3.0-or-later",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"keywords": [
"wordpress",

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Update pnpm monorepo-wide to 8.6.5

View File

@ -6,7 +6,7 @@
"license": "GPL-2.0-or-later",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"keywords": [
"wordpress",

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Update pnpm monorepo-wide to 8.6.5

View File

@ -5,7 +5,7 @@
"main": "index.js",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"scripts": {
"postinstall": "composer install",

View File

@ -6,7 +6,7 @@
"main": "build.js",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"bin": {
"e2e-builds": "./build.js"

View File

@ -6,7 +6,7 @@
"license": "GPL-2.0-or-later",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/internal-js-tests/README.md",
"repository": {

View File

@ -6,7 +6,7 @@
"license": "GPL-2.0-or-later",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"keywords": [
"wordpress",

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Update pnpm monorepo-wide to 8.6.5

View File

@ -6,7 +6,7 @@
"license": "GPL-3.0-or-later",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"keywords": [
"wordpress",

View File

@ -6,7 +6,7 @@
"license": "GPL-2.0-or-later",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"keywords": [
"wordpress",

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Update pnpm monorepo-wide to 8.6.5

View File

@ -6,7 +6,7 @@
"license": "GPL-3.0-or-later",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"keywords": [
"wordpress",

View File

@ -2,16 +2,27 @@
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [3.4.0](https://www.npmjs.com/package/@woocommerce/onboarding/v/3.4.0) - 2023-06-20
- Minor - Added getCountry utility for splitting colon delimited country:state strings [#38536]
- Minor - Replace use of interpolateComponents with createInterpolateElement. [#38536]
- Minor - Fix lint issues [#38536]
- Minor - Moved geolocation country matching functions to @woocommerce/onboarding [#38536]
- Minor - Sync @wordpress package versions via syncpack. [#38536]
- Minor - Update pnpm to version 8. [#38536]
- Patch - Update webpack config to use @woocommerce/internal-style-build's parser config [#38536]
- Patch - Fix a word case typo. [#38536]
## [3.3.0](https://www.npmjs.com/package/@woocommerce/onboarding/v/3.3.0) - 2023-02-14
- Patch - Added in missing TS definitions in package.json [#36701]
- Patch - Fix wcpay benefits padding [#36701]
- Patch - Cleanup product task experiment [#36701]
- Patch - Update eslint to 8.32.0 across the monorepo. [#36701]
- Minor - Add WooOnboardingTaskListHeader component [#36701]
- Minor - Adjust build/test scripts to remove -- -- that was required for pnpm 6. [#36701]
- Patch - Cleanup product task experiment [#36701]
- Minor - Fix node and pnpm versions via engines [#36701]
- Minor - Match TypeScript version with syncpack [#36701]
- Patch - Update eslint to 8.32.0 across the monorepo. [#36701]
- Minor - Update pnpm version constraint to 7.13.3 to avoid auto-install-peers issues [#36701]
## [3.2.0](https://www.npmjs.com/package/@woocommerce/onboarding/v/3.2.0) - 2022-07-08

View File

@ -1,4 +0,0 @@
Significance: minor
Type: add
Added getCountry utility for splitting colon delimited country:state strings

View File

@ -1,4 +0,0 @@
Significance: minor
Type: dev
Moved geolocation country matching functions to @woocommerce/onboarding

View File

@ -1,4 +0,0 @@
Significance: minor
Type: dev
Sync @wordpress package versions via syncpack.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: dev
Fix lint issues

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Update pnpm monorepo-wide to 8.6.5

View File

@ -1,4 +0,0 @@
Significance: minor
Type: dev
Update pnpm to version 8.

View File

@ -1,5 +0,0 @@
Significance: patch
Type: dev
Comment: TypeScript build change

View File

@ -1,5 +0,0 @@
Significance: patch
Type: dev
Comment: Configuration change only

View File

@ -1,4 +0,0 @@
Significance: minor
Type: update
Replace use of interpolateComponents with createInterpolateElement.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: tweak
Fix a word case typo.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: dev
Update webpack config to use @woocommerce/internal-style-build's parser config

View File

@ -1,3 +0,0 @@
Significance: patch
Type: dev

View File

@ -1,12 +1,12 @@
{
"name": "@woocommerce/onboarding",
"version": "3.3.0",
"version": "3.4.0",
"description": "Onboarding utilities.",
"author": "Automattic",
"license": "GPL-3.0-or-later",
"engines": {
"node": "^16.14.1",
"pnpm": "^8.3.1"
"pnpm": "^8.6.5"
},
"keywords": [
"wordpress",

View File

@ -0,0 +1,4 @@
Significance: minor
Type: add
Add the list view component and button to the modal editor

View File

@ -0,0 +1,4 @@
Significance: minor
Type: add
Add missing track events to product editing experience

View File

@ -5,6 +5,7 @@ import { __ } from '@wordpress/i18n';
import { createElement, useState } from '@wordpress/element';
import { parse, serialize } from '@wordpress/blocks';
import { Button } from '@wordpress/components';
import { recordEvent } from '@woocommerce/tracks';
import { useBlockProps } from '@wordpress/block-editor';
import { useEntityProp } from '@wordpress/core-data';
@ -31,7 +32,10 @@ export function Edit() {
<div { ...blockProps }>
<Button
variant="secondary"
onClick={ () => setIsModalOpen( true ) }
onClick={ () => {
setIsModalOpen( true );
recordEvent( 'product_add_description_click' );
} }
>
{ description.length
? __( 'Edit description', 'woocommerce' )

View File

@ -87,6 +87,9 @@ export function Edit() {
multipleSelect={ true }
onError={ () => null }
onFileUploadChange={ onFileUpload }
onMediaGalleryOpen={ () => {
recordEvent( 'product_images_media_gallery_open' );
} }
onSelect={ ( files ) => {
const newImages = files.filter(
( img: Image ) =>

View File

@ -16,6 +16,7 @@ import {
Link,
} from '@woocommerce/components';
import { getAdminLink } from '@woocommerce/settings';
import { recordEvent } from '@woocommerce/tracks';
/**
* Internal dependencies
@ -182,7 +183,10 @@ export const AttributeControl: React.FC< AttributeControlProps > = ( {
<Button
variant="secondary"
className="woocommerce-add-attribute-list-item__add-button"
onClick={ openNewModal }
onClick={ () => {
openNewModal();
recordEvent( 'product_add_attributes_click' );
} }
>
{ uiStrings.newAttributeListItemLabel }
</Button>

View File

@ -23,6 +23,7 @@ import {
* Internal dependencies
*/
import { EnhancedProductAttribute } from '../../hooks/use-product-attributes';
import { TRACKS_SOURCE } from '../../constants';
type NarrowedQueryAttribute = Pick< QueryProductAttribute, 'id' | 'name' >;
@ -112,7 +113,7 @@ export const AttributeInputField: React.FC< AttributeInputFieldProps > = ( {
onSelect={ ( attribute ) => {
if ( isNewAttributeListItem( attribute ) ) {
recordEvent( 'product_attribute_add_custom_attribute', {
new_product_page: true,
source: TRACKS_SOURCE,
} );
}
onChange(

View File

@ -19,6 +19,11 @@ import {
QueryProductAttribute,
} from '@woocommerce/data';
/**
* Internal dependencies
*/
import { TRACKS_SOURCE } from '../../constants';
type CreateAttributeTermModalProps = {
initialAttributeTermName: string;
attributeId: number;
@ -41,7 +46,7 @@ export const CreateAttributeTermModal: React.FC<
const onAdd = async ( attribute: Partial< ProductAttributeTerm > ) => {
recordEvent( 'product_attribute_term_add', {
new_product_page: true,
source: TRACKS_SOURCE,
} );
setIsCreating( true );
try {
@ -51,14 +56,14 @@ export const CreateAttributeTermModal: React.FC<
attribute_id: attributeId,
} );
recordEvent( 'product_attribute_term_add_success', {
new_product_page: true,
source: TRACKS_SOURCE,
} );
invalidateResolutionForStoreSelector( 'getProductAttributes' );
setIsCreating( false );
onCreated( newAttribute );
} catch ( e ) {
recordEvent( 'product_attribute_term_add_failed', {
new_product_page: true,
source: TRACKS_SOURCE,
} );
createNotice(
'error',

View File

@ -28,6 +28,7 @@ import {
mapFromCategoriesToTreeItems,
mapFromCategoryToTreeItem,
} from './category-field';
import { TRACKS_SOURCE } from '../../constants';
type CreateCategoryModalProps = {
initialCategoryName?: string;
@ -61,7 +62,7 @@ export const CreateCategoryModal: React.FC< CreateCategoryModalProps > = ( {
const onSave = async () => {
recordEvent( 'product_category_add', {
new_product_page: true,
source: TRACKS_SOURCE,
} );
setIsCreating( true );
try {

View File

@ -13,6 +13,11 @@ import { cleanForSlug } from '@wordpress/url';
import { Product } from '@woocommerce/data';
import { recordEvent } from '@woocommerce/tracks';
/**
* Internal dependencies
*/
import { TRACKS_SOURCE } from '../../constants';
type EditProductLinkModalProps = {
product: Product;
permalinkPrefix: string;
@ -40,7 +45,7 @@ export const EditProductLinkModal: React.FC< EditProductLinkModalProps > = ( {
const onSave = async () => {
recordEvent( 'product_update_slug', {
new_product_page: true,
source: TRACKS_SOURCE,
product_id: product.id,
product_type: product.type,
} );

View File

@ -2,11 +2,11 @@
* External dependencies
*/
import { createElement, Fragment } from '@wordpress/element';
import { recordEvent } from '@woocommerce/tracks';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore No types for this exist yet.
// eslint-disable-next-line @woocommerce/dependency-group
import { MoreMenuDropdown } from '@wordpress/interface';
//import { displayShortcut } from '@wordpress/keycodes';
/**
* Internal dependencies
@ -17,6 +17,9 @@ export const MoreMenu = () => {
return (
<>
<MoreMenuDropdown
toggleProps={ {
onClick: () => recordEvent( 'product_dropdown_click' ),
} }
popoverProps={ {
className: 'woocommerce-product-header__more-menu',
} }

View File

@ -1,11 +1,12 @@
/**
* External dependencies
*/
import { Product } from '@woocommerce/data';
import { getNewPath, navigateTo } from '@woocommerce/navigation';
import { Button } from '@wordpress/components';
import { useDispatch } from '@wordpress/data';
import { createElement } from '@wordpress/element';
import { getNewPath, navigateTo } from '@woocommerce/navigation';
import { Product } from '@woocommerce/data';
import { recordEvent } from '@woocommerce/tracks';
import { useDispatch } from '@wordpress/data';
/**
* Internal dependencies
@ -13,6 +14,7 @@ import { createElement } from '@wordpress/element';
import { getProductErrorMessage } from '../../../utils/get-product-error-message';
import { usePreview } from '../hooks/use-preview';
import { PreviewButtonProps } from './types';
import { TRACKS_SOURCE } from '../../../constants';
export function PreviewButton( {
productStatus,
@ -23,6 +25,9 @@ export function PreviewButton( {
const previewButtonProps = usePreview( {
productStatus,
...props,
onClick() {
recordEvent( 'product_preview_changes', { source: TRACKS_SOURCE } );
},
onSaveSuccess( savedProduct: Product ) {
if ( productStatus === 'auto-draft' ) {
const url = getNewPath( {}, `/product/${ savedProduct.id }` );

View File

@ -31,10 +31,12 @@ export function PublishButton( {
productStatus,
...props,
onPublishSuccess( savedProduct: Product ) {
recordProductEvent( 'product_update', savedProduct );
const isPublished = productStatus === 'publish';
if ( isPublished ) {
recordProductEvent( 'product_update', savedProduct );
}
const noticeContent = isPublished
? __( 'Product updated.', 'woocommerce' )
: __( 'Product added.', 'woocommerce' );

View File

@ -6,8 +6,10 @@ import { createContext } from '@wordpress/element';
type EditorContextType = {
hasRedo: boolean;
hasUndo: boolean;
isDocumentOverviewOpened: boolean;
isInserterOpened: boolean;
redo: () => void;
setIsDocumentOverviewOpened: ( value: boolean ) => void;
setIsInserterOpened: ( value: boolean ) => void;
undo: () => void;
};
@ -15,8 +17,10 @@ type EditorContextType = {
export const EditorContext = createContext< EditorContextType >( {
hasRedo: false,
hasUndo: false,
isDocumentOverviewOpened: false,
isInserterOpened: false,
redo: () => {},
setIsDocumentOverviewOpened: () => {},
setIsInserterOpened: () => {},
undo: () => {},
} );

View File

@ -0,0 +1,41 @@
/**
* External dependencies
*/
import { Button } from '@wordpress/components';
import { createElement, forwardRef, useContext } from '@wordpress/element';
import { listView as listViewIcon } from '@wordpress/icons';
import { __ } from '@wordpress/i18n';
import { Ref } from 'react';
/**
* Internal dependencies
*/
import { DocumentOverviewProps } from './types';
import { EditorContext } from '../../context';
export const DocumentOverview = forwardRef(
function ForwardedRefDocumentOverview(
props: DocumentOverviewProps,
ref: Ref< HTMLButtonElement >
) {
const { isDocumentOverviewOpened, setIsDocumentOverviewOpened } =
useContext( EditorContext );
function handleClick() {
setIsDocumentOverviewOpened( ! isDocumentOverviewOpened );
}
return (
<Button
{ ...props }
ref={ ref }
icon={ listViewIcon }
isPressed={ isDocumentOverviewOpened }
/* translators: button label text should, if possible, be under 16 characters. */
label={ __( 'Document overview', 'woocommerce' ) }
onClick={ handleClick }
className="document-overview"
/>
);
}
);

View File

@ -0,0 +1,2 @@
export * from './document-overview';
export * from './types';

View File

@ -0,0 +1 @@
export type DocumentOverviewProps = { [ key: string ]: unknown };

View File

@ -31,6 +31,7 @@ import { Button, ToolbarItem } from '@wordpress/components';
import { EditorContext } from '../context';
import EditorHistoryRedo from './editor-history-redo';
import EditorHistoryUndo from './editor-history-undo';
import { DocumentOverview } from './document-overview';
export function HeaderToolbar() {
const { isInserterOpened, setIsInserterOpened } =
@ -114,6 +115,7 @@ export function HeaderToolbar() {
) }
<ToolbarItem as={ EditorHistoryUndo } />
<ToolbarItem as={ EditorHistoryRedo } />
<ToolbarItem as={ DocumentOverview } />
</>
) }
</div>

View File

@ -53,6 +53,7 @@ export function IframeEditor( {
setBlocks,
} );
const [ isInserterOpened, setIsInserterOpened ] = useState( false );
const [ isListViewOpened, setIsListViewOpened ] = useState( false );
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore This action exists in the block editor store.
const { clearSelectedBlock, updateSettings } =
@ -80,8 +81,10 @@ export function IframeEditor( {
hasRedo,
hasUndo,
isInserterOpened,
isDocumentOverviewOpened: isListViewOpened,
redo,
setIsInserterOpened,
setIsDocumentOverviewOpened: setIsListViewOpened,
undo,
} }
>

View File

@ -0,0 +1,111 @@
/**
* External dependencies
*/
import { Button, TabPanel } from '@wordpress/components';
import {
useFocusOnMount,
useFocusReturn,
useMergeRefs,
} from '@wordpress/compose';
import {
createElement,
useRef,
useState,
useContext,
} from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { closeSmall } from '@wordpress/icons';
import {
// @ts-expect-error Module "@wordpress/block-editor" has no exported member '__experimentalListView'
__experimentalListView as ListView,
} from '@wordpress/block-editor';
/**
* Internal dependencies
*/
import { EditorContext } from '../../context';
export function DocumentOverviewSidebar() {
const { setIsDocumentOverviewOpened: setIsListViewOpened } =
useContext( EditorContext );
// This hook handles focus when the sidebar first renders.
const focusOnMountRef = useFocusOnMount( 'firstElement' );
// The next 2 hooks handle focus for when the sidebar closes and returning focus to the element that had focus before sidebar opened.
const headerFocusReturnRef = useFocusReturn();
const contentFocusReturnRef = useFocusReturn();
function closeOnEscape( event: React.KeyboardEvent< HTMLDivElement > ) {
if ( event.code === 'Escape' && ! event.defaultPrevented ) {
event.preventDefault();
setIsListViewOpened( false );
}
}
// Use internal state instead of a ref to make sure that the component
// re-renders when the dropZoneElement updates.
const [ dropZoneElement, setDropZoneElement ] = useState( null );
// Tracks our current tab.
const [ tab, setTab ] = useState( 'list-view' );
// This ref refers to the list view application area.
const listViewRef = useRef< HTMLDivElement >( null );
// Must merge the refs together so focus can be handled properly in the next function.
const listViewContainerRef = useMergeRefs( [
contentFocusReturnRef,
focusOnMountRef,
listViewRef,
setDropZoneElement,
] );
/**
* Render tab content for a given tab name.
*
* @param tabName The name of the tab to render.
*/
function renderTabContent( tabName: string ) {
if ( tabName === 'list-view' ) {
return <ListView dropZoneElement={ dropZoneElement } />;
}
return null;
}
return (
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
<div
className="woocommerce-iframe-editor__document-overview-sidebar"
onKeyDown={ closeOnEscape }
>
<Button
className="woocommerce-iframe-editor__document-overview-sidebar-close-button"
ref={ headerFocusReturnRef }
icon={ closeSmall }
label={ __( 'Close', 'woocommerce' ) }
onClick={ () => setIsListViewOpened( false ) }
/>
<TabPanel
className="woocommerce-iframe-editor__document-overview-sidebar-tab-panel"
initialTabName={ tab }
onSelect={ setTab }
tabs={ [
{
name: 'list-view',
title: 'List View',
className:
'woocommerce-iframe-editor__document-overview-sidebar-tab-item',
},
] }
>
{ ( currentTab ) => (
<div
className="woocommerce-iframe-editor__document-overview-sidebar-tab-content"
ref={ listViewContainerRef }
>
{ renderTabContent( currentTab.name ) }
</div>
) }
</TabPanel>
</div>
);
}

View File

@ -0,0 +1 @@
export * from './document-overview-sidebar';

View File

@ -0,0 +1,39 @@
.woocommerce-iframe-editor__document-overview-sidebar {
position: relative;
width: 350px;
height: 100%;
border-right: 1px solid $gray-400;
&-close-button {
position: absolute;
right: calc($grid-unit - 2px);
top: calc($grid-unit - 2px);
}
&-tab-panel {
height: 100%;
.components-tab-panel__tabs {
padding-right: $grid-unit-60;
border-bottom: 1px solid $gray-400;
}
.components-tab-panel__tab-content {
display: flex;
flex-direction: column;
height: calc(100% - $grid-unit-60);
}
}
&-tab-content {
height: 100%;
overflow-x: hidden;
overflow-y: auto;
padding: $grid-unit calc($grid-unit - 2px);
.block-editor-list-view-tree {
margin: 0;
width: 100%;
}
}
}

View File

@ -8,13 +8,19 @@ import { createElement, useContext } from '@wordpress/element';
*/
import { EditorContext } from '../context';
import InserterSidebar from './inserter-sidebar';
import { DocumentOverviewSidebar } from './document-overview-sidebar';
export function SecondarySidebar() {
const { isInserterOpened } = useContext( EditorContext );
const { isInserterOpened, isDocumentOverviewOpened: isListViewOpened } =
useContext( EditorContext );
if ( isInserterOpened ) {
return <InserterSidebar />;
}
if ( isListViewOpened ) {
return <DocumentOverviewSidebar />;
}
return null;
}

Some files were not shown because too many files have changed in this diff Show More