diff --git a/.github/workflows/sync-backport-changelog.yml b/.github/workflows/sync-backport-changelog.yml index 46465cdaab58ad..76a87f89ba7030 100644 --- a/.github/workflows/sync-backport-changelog.yml +++ b/.github/workflows/sync-backport-changelog.yml @@ -14,10 +14,11 @@ jobs: with: fetch-depth: 2 # Fetch the last two commits to compare changes - name: Check for changes in backport-changelog + id: check-for-changes run: | - git diff --quiet HEAD^ HEAD -- backport-changelog || echo "changes=true" >> $GITHUB_OUTPUT + git diff --quiet HEAD^ HEAD -- backport-changelog || echo "HAS_CHANGES=1" >> "$GITHUB_OUTPUT" - name: Sync Issue - if: env.changes == 'true' + if: steps.check-for-changes.outputs.HAS_CHANGES uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: script: | @@ -52,18 +53,20 @@ jobs: const endDelimiter = ''; const autoGeneratedContent = `${startDelimiter}\n${processedChangelog}\n${endDelimiter}`; - const regex = new RegExp(`${startDelimiter}[\\s\\S]*${endDelimiter}`); + const existingBody = latestIssue.body ?? ''; + let newBody; - if (regex.test(latestIssue.body)) { + const regex = new RegExp(`${startDelimiter}[\\s\\S]*${endDelimiter}`); + if (regex.test(existingBody)) { // If delimiters exist, replace the content between them - newBody = latestIssue.body.replace(regex, autoGeneratedContent); + newBody = existingBody.replace(regex, autoGeneratedContent); } else { // If delimiters don't exist, append the new content at the end - newBody = `${latestIssue.body}\n\n${autoGeneratedContent}`; + newBody = `${existingBody}\n\n${autoGeneratedContent}`; } - if (newBody.trim() !== latestIssue.body.trim()) { + if (newBody.trim() !== existingBody.trim()) { await github.rest.issues.update({ owner: context.repo.owner, repo: context.repo.repo, diff --git a/backport-changelog/6.7/7020.md b/backport-changelog/6.7/7020.md new file mode 100644 index 00000000000000..8eacb220d340e5 --- /dev/null +++ b/backport-changelog/6.7/7020.md @@ -0,0 +1,3 @@ +https://github.com/WordPress/wordpress-develop/pull/7020 + +* https://github.com/WordPress/gutenberg/pull/63470 diff --git a/docs/reference-guides/interactivity-api/api-reference.md b/docs/reference-guides/interactivity-api/api-reference.md index 0f14906165160c..00030465415323 100644 --- a/docs/reference-guides/interactivity-api/api-reference.md +++ b/docs/reference-guides/interactivity-api/api-reference.md @@ -840,7 +840,7 @@ const { state } = store("myPlugin", { }); ``` -As mentioned above with [`wp-on`](#wp-on), [`wp-on-window`](#wp-on-window), and [`wp-on-document`](#wp-on-document), an async action should be used whenever the `async` versions of the aforementioned directives cannot be used due to the action requiring synchronous access to the `event` object. Synchronous access is reqired whenever the action needs to call `event.preventDefault()`, `event.stopPropagation()`, or `event.stopImmediatePropagation()`. To ensure that the action code does not contribute to a long task, you may manually yield to the main thread after calling the synchronous event API. For example: +As mentioned above with [`wp-on`](#wp-on), [`wp-on-window`](#wp-on-window), and [`wp-on-document`](#wp-on-document), an async action should be used whenever the `async` versions of the aforementioned directives cannot be used due to the action requiring synchronous access to the `event` object. Synchronous access is required whenever the action needs to call `event.preventDefault()`, `event.stopPropagation()`, or `event.stopImmediatePropagation()`. To ensure that the action code does not contribute to a long task, you may manually yield to the main thread after calling the synchronous event API. For example: ```js // Note: In WordPress 6.6 this splitTask function is exported by @wordpress/interactivity. diff --git a/lib/compat/wordpress-6.7/block-bindings.php b/lib/compat/wordpress-6.7/block-bindings.php new file mode 100644 index 00000000000000..4c82dc6683f370 --- /dev/null +++ b/lib/compat/wordpress-6.7/block-bindings.php @@ -0,0 +1,40 @@ + $source_properties ) { + // Add source with the label to editor settings. + $editor_settings['blockBindingsSources'][ $source_name ] = array( + 'label' => $source_properties->label, + ); + // Add `usesContext` property if exists. + if ( ! empty( $source_properties->uses_context ) ) { + $editor_settings['blockBindingsSources'][ $source_name ]['usesContext'] = $source_properties->uses_context; + } + } + } + return $editor_settings; +} + +add_filter( 'block_editor_settings_all', 'gutenberg_add_server_block_bindings_sources_to_editor_settings', 10 ); diff --git a/lib/experiments-page.php b/lib/experiments-page.php index ca5c87eec737be..74a133da05c976 100644 --- a/lib/experiments-page.php +++ b/lib/experiments-page.php @@ -184,7 +184,7 @@ function gutenberg_display_experiment_field( $args ) { */ function gutenberg_display_experiment_section() { ?> -
+ { + const { getCurrentTheme, canUser } = select( coreStore ); + return { + isBlockBasedTheme: getCurrentTheme()?.is_block_theme, + canCreateTemplatePart: canUser( 'create', { + kind: 'postType', + name: 'wp_template_part', + } ), + }; + }, + [] + ); + const [ showTitleModal, setShowTitleModal ] = useState( false ); const areaObject = useTemplatePartArea( area ); const createFromBlocks = useCreateTemplatePartFromBlocks( @@ -39,11 +56,19 @@ export default function TemplatePartPlaceholder( {