@wordpress/editor 14.42.0 → 14.43.1-next.v.202604091042.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +8 -0
- package/build/components/autocompleters/index.cjs +3 -0
- package/build/components/autocompleters/index.cjs.map +2 -2
- package/build/components/autocompleters/link.cjs +71 -0
- package/build/components/autocompleters/link.cjs.map +7 -0
- package/build/components/collaborators-overlay/cursor-dom-utils.cjs +1 -1
- package/build/components/collaborators-overlay/cursor-dom-utils.cjs.map +2 -2
- package/build/components/collaborators-overlay/cursor-registry.cjs +86 -0
- package/build/components/collaborators-overlay/cursor-registry.cjs.map +7 -0
- package/build/components/collaborators-overlay/index.cjs +7 -2
- package/build/components/collaborators-overlay/index.cjs.map +2 -2
- package/build/components/collaborators-overlay/overlay-iframe-styles.cjs +1 -1
- package/build/components/collaborators-overlay/overlay-iframe-styles.cjs.map +2 -2
- package/build/components/collaborators-overlay/overlay.cjs +31 -1
- package/build/components/collaborators-overlay/overlay.cjs.map +2 -2
- package/build/components/collaborators-overlay/timing-utils.cjs +1 -1
- package/build/components/collaborators-overlay/timing-utils.cjs.map +2 -2
- package/build/components/collaborators-overlay/use-render-cursors.cjs.map +2 -2
- package/build/components/collaborators-presence/index.cjs +14 -4
- package/build/components/collaborators-presence/index.cjs.map +2 -2
- package/build/components/collaborators-presence/list.cjs +20 -4
- package/build/components/collaborators-presence/list.cjs.map +2 -2
- package/build/components/error-boundary/index.cjs +1 -1
- package/build/components/error-boundary/index.cjs.map +2 -2
- package/build/components/post-card-panel/index.cjs +4 -15
- package/build/components/post-card-panel/index.cjs.map +2 -2
- package/build/components/post-content-information/index.cjs +10 -13
- package/build/components/post-content-information/index.cjs.map +2 -2
- package/build/components/post-revisions-panel/index.cjs +164 -0
- package/build/components/post-revisions-panel/index.cjs.map +7 -0
- package/build/components/post-revisions-preview/revisions-slider.cjs +23 -12
- package/build/components/post-revisions-preview/revisions-slider.cjs.map +2 -2
- package/build/components/post-template/create-new-template-modal.cjs +39 -46
- package/build/components/post-template/create-new-template-modal.cjs.map +2 -2
- package/build/components/post-template/hooks.cjs +52 -6
- package/build/components/post-template/hooks.cjs.map +2 -2
- package/build/components/post-template/swap-template-button.cjs +31 -20
- package/build/components/post-template/swap-template-button.cjs.map +2 -2
- package/build/components/post-title/index.cjs +2 -2
- package/build/components/post-title/index.cjs.map +2 -2
- package/build/components/preferences-modal/index.cjs +35 -27
- package/build/components/preferences-modal/index.cjs.map +2 -2
- package/build/components/revision-block-diff/index.cjs +9 -32
- package/build/components/revision-block-diff/index.cjs.map +3 -3
- package/build/components/revision-diff-panel/index.cjs +68 -0
- package/build/components/revision-diff-panel/index.cjs.map +7 -0
- package/build/components/revision-fields-diff/index.cjs +96 -0
- package/build/components/revision-fields-diff/index.cjs.map +7 -0
- package/build/components/sidebar/dataform-post-summary.cjs +8 -53
- package/build/components/sidebar/dataform-post-summary.cjs.map +2 -2
- package/build/components/sidebar/index.cjs +25 -22
- package/build/components/sidebar/index.cjs.map +3 -3
- package/build/components/sidebar/post-revision-summary.cjs +74 -0
- package/build/components/sidebar/post-revision-summary.cjs.map +7 -0
- package/build/components/sidebar/post-summary.cjs +35 -42
- package/build/components/sidebar/post-summary.cjs.map +3 -3
- package/build/components/style-book/index.cjs +4 -3
- package/build/components/style-book/index.cjs.map +2 -2
- package/build/components/styles-canvas/revisions.cjs +2 -2
- package/build/components/styles-canvas/revisions.cjs.map +1 -1
- package/build/components/sync-connection-error-modal/index.cjs +58 -75
- package/build/components/sync-connection-error-modal/index.cjs.map +3 -3
- package/build/components/sync-connection-error-modal/use-retry-countdown.cjs +32 -9
- package/build/components/sync-connection-error-modal/use-retry-countdown.cjs.map +2 -2
- package/build/components/template-actions-panel/block-theme-content.cjs +188 -0
- package/build/components/template-actions-panel/block-theme-content.cjs.map +7 -0
- package/build/components/template-actions-panel/classic-theme-content.cjs +159 -0
- package/build/components/template-actions-panel/classic-theme-content.cjs.map +7 -0
- package/build/components/template-actions-panel/index.cjs +59 -0
- package/build/components/template-actions-panel/index.cjs.map +7 -0
- package/build/dataviews/store/private-actions.cjs +2 -0
- package/build/dataviews/store/private-actions.cjs.map +2 -2
- package/build/hooks/default-autocompleters.cjs +1 -1
- package/build/hooks/default-autocompleters.cjs.map +2 -2
- package/build/store/private-actions.cjs +15 -1
- package/build/store/private-actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +42 -19
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +1 -1
- package/build/store/reducer.cjs.map +2 -2
- package/build-module/components/autocompleters/index.mjs +4 -2
- package/build-module/components/autocompleters/index.mjs.map +2 -2
- package/build-module/components/autocompleters/link.mjs +40 -0
- package/build-module/components/autocompleters/link.mjs.map +7 -0
- package/build-module/components/collaborators-overlay/cursor-dom-utils.mjs +1 -1
- package/build-module/components/collaborators-overlay/cursor-dom-utils.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/cursor-registry.mjs +61 -0
- package/build-module/components/collaborators-overlay/cursor-registry.mjs.map +7 -0
- package/build-module/components/collaborators-overlay/index.mjs +7 -2
- package/build-module/components/collaborators-overlay/index.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs +1 -1
- package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/overlay.mjs +32 -2
- package/build-module/components/collaborators-overlay/overlay.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/timing-utils.mjs +1 -1
- package/build-module/components/collaborators-overlay/timing-utils.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/use-render-cursors.mjs.map +2 -2
- package/build-module/components/collaborators-presence/index.mjs +14 -4
- package/build-module/components/collaborators-presence/index.mjs.map +2 -2
- package/build-module/components/collaborators-presence/list.mjs +20 -4
- package/build-module/components/collaborators-presence/list.mjs.map +2 -2
- package/build-module/components/error-boundary/index.mjs +1 -1
- package/build-module/components/error-boundary/index.mjs.map +2 -2
- package/build-module/components/post-card-panel/index.mjs +6 -17
- package/build-module/components/post-card-panel/index.mjs.map +2 -2
- package/build-module/components/post-content-information/index.mjs +6 -13
- package/build-module/components/post-content-information/index.mjs.map +2 -2
- package/build-module/components/post-revisions-panel/index.mjs +139 -0
- package/build-module/components/post-revisions-panel/index.mjs.map +7 -0
- package/build-module/components/post-revisions-preview/revisions-slider.mjs +23 -12
- package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
- package/build-module/components/post-template/create-new-template-modal.mjs +39 -46
- package/build-module/components/post-template/create-new-template-modal.mjs.map +2 -2
- package/build-module/components/post-template/hooks.mjs +53 -7
- package/build-module/components/post-template/hooks.mjs.map +2 -2
- package/build-module/components/post-template/swap-template-button.mjs +27 -20
- package/build-module/components/post-template/swap-template-button.mjs.map +2 -2
- package/build-module/components/post-title/index.mjs +2 -2
- package/build-module/components/post-title/index.mjs.map +2 -2
- package/build-module/components/preferences-modal/index.mjs +35 -27
- package/build-module/components/preferences-modal/index.mjs.map +2 -2
- package/build-module/components/revision-block-diff/index.mjs +9 -32
- package/build-module/components/revision-block-diff/index.mjs.map +2 -2
- package/build-module/components/revision-diff-panel/index.mjs +37 -0
- package/build-module/components/revision-diff-panel/index.mjs.map +7 -0
- package/build-module/components/revision-fields-diff/index.mjs +65 -0
- package/build-module/components/revision-fields-diff/index.mjs.map +7 -0
- package/build-module/components/sidebar/dataform-post-summary.mjs +8 -53
- package/build-module/components/sidebar/dataform-post-summary.mjs.map +2 -2
- package/build-module/components/sidebar/index.mjs +25 -22
- package/build-module/components/sidebar/index.mjs.map +2 -2
- package/build-module/components/sidebar/post-revision-summary.mjs +43 -0
- package/build-module/components/sidebar/post-revision-summary.mjs.map +7 -0
- package/build-module/components/sidebar/post-summary.mjs +31 -42
- package/build-module/components/sidebar/post-summary.mjs.map +2 -2
- package/build-module/components/style-book/index.mjs +4 -3
- package/build-module/components/style-book/index.mjs.map +2 -2
- package/build-module/components/styles-canvas/revisions.mjs +2 -2
- package/build-module/components/styles-canvas/revisions.mjs.map +1 -1
- package/build-module/components/sync-connection-error-modal/index.mjs +58 -76
- package/build-module/components/sync-connection-error-modal/index.mjs.map +2 -2
- package/build-module/components/sync-connection-error-modal/use-retry-countdown.mjs +33 -10
- package/build-module/components/sync-connection-error-modal/use-retry-countdown.mjs.map +2 -2
- package/build-module/components/template-actions-panel/block-theme-content.mjs +167 -0
- package/build-module/components/template-actions-panel/block-theme-content.mjs.map +7 -0
- package/build-module/components/template-actions-panel/classic-theme-content.mjs +138 -0
- package/build-module/components/template-actions-panel/classic-theme-content.mjs.map +7 -0
- package/build-module/components/template-actions-panel/index.mjs +28 -0
- package/build-module/components/template-actions-panel/index.mjs.map +7 -0
- package/build-module/dataviews/store/private-actions.mjs +5 -1
- package/build-module/dataviews/store/private-actions.mjs.map +2 -2
- package/build-module/hooks/default-autocompleters.mjs +2 -2
- package/build-module/hooks/default-autocompleters.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +15 -1
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +42 -19
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +1 -1
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-style/style-rtl.css +124 -44
- package/build-style/style.css +124 -44
- package/build-types/bindings/post-data.d.ts +3 -3
- package/build-types/bindings/term-data.d.ts +14 -14
- package/build-types/components/autocompleters/index.d.ts +1 -0
- package/build-types/components/autocompleters/link.d.ts +12 -0
- package/build-types/components/autocompleters/link.d.ts.map +1 -0
- package/build-types/components/collaborators-overlay/cursor-registry.d.ts +36 -0
- package/build-types/components/collaborators-overlay/cursor-registry.d.ts.map +1 -0
- package/build-types/components/collaborators-overlay/index.d.ts +7 -4
- package/build-types/components/collaborators-overlay/index.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/overlay-iframe-styles.d.ts +1 -1
- package/build-types/components/collaborators-overlay/overlay-iframe-styles.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/overlay.d.ts +4 -1
- package/build-types/components/collaborators-overlay/overlay.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/use-render-cursors.d.ts.map +1 -1
- package/build-types/components/collaborators-presence/index.d.ts.map +1 -1
- package/build-types/components/collaborators-presence/list.d.ts +4 -1
- package/build-types/components/collaborators-presence/list.d.ts.map +1 -1
- package/build-types/components/keyboard-shortcut-help-modal/config.d.ts +11 -11
- package/build-types/components/post-actions/set-as-homepage.d.ts +1 -1
- package/build-types/components/post-actions/set-as-posts-page.d.ts +1 -1
- package/build-types/components/post-card-panel/index.d.ts.map +1 -1
- package/build-types/components/post-content-information/index.d.ts +4 -1
- package/build-types/components/post-content-information/index.d.ts.map +1 -1
- package/build-types/components/post-format/index.d.ts +10 -10
- package/build-types/components/post-locked-modal/index.d.ts +2 -2
- package/build-types/components/post-revisions-panel/index.d.ts +2 -0
- package/build-types/components/post-revisions-panel/index.d.ts.map +1 -0
- package/build-types/components/post-revisions-preview/revisions-slider.d.ts.map +1 -1
- package/build-types/components/post-status/index.d.ts +10 -10
- package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -1
- package/build-types/components/post-template/hooks.d.ts +1 -1
- package/build-types/components/post-template/hooks.d.ts.map +1 -1
- package/build-types/components/post-template/swap-template-button.d.ts +4 -0
- package/build-types/components/post-template/swap-template-button.d.ts.map +1 -1
- package/build-types/components/post-visibility/utils.d.ts +6 -6
- package/build-types/components/revision-block-diff/index.d.ts.map +1 -1
- package/build-types/components/revision-diff-panel/index.d.ts +14 -0
- package/build-types/components/revision-diff-panel/index.d.ts.map +1 -0
- package/build-types/components/revision-fields-diff/index.d.ts +6 -0
- package/build-types/components/revision-fields-diff/index.d.ts.map +1 -0
- package/build-types/components/sidebar/dataform-post-summary.d.ts.map +1 -1
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/components/sidebar/post-revision-summary.d.ts +2 -0
- package/build-types/components/sidebar/post-revision-summary.d.ts.map +1 -0
- package/build-types/components/sidebar/post-summary.d.ts +3 -0
- package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
- package/build-types/components/style-book/index.d.ts +2 -1
- package/build-types/components/style-book/index.d.ts.map +1 -1
- package/build-types/components/sync-connection-error-modal/index.d.ts +0 -14
- package/build-types/components/sync-connection-error-modal/index.d.ts.map +1 -1
- package/build-types/components/sync-connection-error-modal/use-retry-countdown.d.ts.map +1 -1
- package/build-types/components/template-actions-panel/block-theme-content.d.ts +2 -0
- package/build-types/components/template-actions-panel/block-theme-content.d.ts.map +1 -0
- package/build-types/components/template-actions-panel/classic-theme-content.d.ts +2 -0
- package/build-types/components/template-actions-panel/classic-theme-content.d.ts.map +1 -0
- package/build-types/components/template-actions-panel/index.d.ts +2 -0
- package/build-types/components/template-actions-panel/index.d.ts.map +1 -0
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +10 -10
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/utils/pageTypeBadge.d.ts +1 -1
- package/build-types/utils/pageTypeBadge.d.ts.map +1 -1
- package/package.json +45 -44
- package/src/components/autocompleters/index.js +1 -0
- package/src/components/autocompleters/link.js +47 -0
- package/src/components/autocompleters/style.scss +6 -0
- package/src/components/collaborators-overlay/cursor-dom-utils.ts +1 -1
- package/src/components/collaborators-overlay/cursor-registry.ts +96 -0
- package/src/components/collaborators-overlay/index.tsx +12 -4
- package/src/components/collaborators-overlay/overlay-iframe-styles.ts +1 -1
- package/src/components/collaborators-overlay/overlay.tsx +45 -1
- package/src/components/collaborators-overlay/timing-utils.ts +1 -1
- package/src/components/collaborators-overlay/use-render-cursors.ts +4 -2
- package/src/components/collaborators-presence/index.tsx +9 -1
- package/src/components/collaborators-presence/list.tsx +25 -1
- package/src/components/error-boundary/index.js +1 -1
- package/src/components/error-boundary/index.native.js +1 -1
- package/src/components/post-card-panel/index.js +7 -21
- package/src/components/post-content-information/index.js +5 -16
- package/src/components/post-revisions-panel/index.js +151 -0
- package/src/components/post-revisions-panel/style.scss +16 -0
- package/src/components/post-revisions-preview/revisions-slider.js +23 -19
- package/src/components/post-template/create-new-template-modal.js +1 -4
- package/src/components/post-template/hooks.js +65 -9
- package/src/components/post-template/style.scss +0 -6
- package/src/components/post-template/swap-template-button.js +30 -21
- package/src/components/post-title/index.js +3 -3
- package/src/components/preferences-modal/index.js +37 -25
- package/src/components/revision-block-diff/index.js +8 -43
- package/src/components/revision-diff-panel/index.js +59 -0
- package/src/components/revision-fields-diff/index.js +91 -0
- package/src/components/sidebar/dataform-post-summary.js +8 -55
- package/src/components/sidebar/index.js +33 -22
- package/src/components/sidebar/post-revision-summary.js +50 -0
- package/src/components/sidebar/post-summary.js +22 -40
- package/src/components/sidebar/style.scss +7 -0
- package/src/components/style-book/index.js +4 -2
- package/src/components/styles-canvas/revisions.js +2 -2
- package/src/components/sync-connection-error-modal/index.tsx +128 -155
- package/src/components/sync-connection-error-modal/use-retry-countdown.ts +46 -10
- package/src/components/template-actions-panel/block-theme-content.js +196 -0
- package/src/components/template-actions-panel/classic-theme-content.js +170 -0
- package/src/components/template-actions-panel/index.js +32 -0
- package/src/components/template-actions-panel/style.scss +39 -0
- package/src/dataviews/store/private-actions.ts +6 -0
- package/src/hooks/default-autocompleters.js +2 -2
- package/src/hooks/test/default-autocompleters.js +2 -2
- package/src/store/private-actions.js +18 -2
- package/src/store/private-selectors.js +43 -22
- package/src/store/reducer.js +9 -8
- package/src/style.scss +3 -1
- /package/src/components/{revision-block-diff → revision-diff-panel}/style.scss +0 -0
|
@@ -35,7 +35,7 @@ var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var {
|
|
37
37
|
ExperimentalBlockEditorProvider,
|
|
38
|
-
|
|
38
|
+
BlockStyleVariationOverridesWithConfig
|
|
39
39
|
} = (0, import_lock_unlock.unlock)(import_block_editor.privateApis);
|
|
40
40
|
function isObjectEmpty(object) {
|
|
41
41
|
return !object || Object.keys(object).length === 0;
|
|
@@ -107,7 +107,7 @@ function StylesCanvasRevisions({ path }, ref) {
|
|
|
107
107
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockList, { renderAppender: false }),
|
|
108
108
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.__unstableEditorStyles, { styles: editorStyles }),
|
|
109
109
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
-
|
|
110
|
+
BlockStyleVariationOverridesWithConfig,
|
|
111
111
|
{
|
|
112
112
|
config: mergedConfig
|
|
113
113
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/styles-canvas/revisions.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Disabled } from '@wordpress/components';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, forwardRef } from '@wordpress/element';\nimport { useGlobalStylesRevisions } from '@wordpress/global-styles-ui';\nimport { mergeGlobalStyles } from '@wordpress/global-styles-engine';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStyles } from '../global-styles/hooks';\nimport { useGlobalStylesOutputWithConfig } from '../../hooks/use-global-styles-output';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tExperimentalBlockEditorProvider,\n\
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Disabled } from '@wordpress/components';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, forwardRef } from '@wordpress/element';\nimport { useGlobalStylesRevisions } from '@wordpress/global-styles-ui';\nimport { mergeGlobalStyles } from '@wordpress/global-styles-engine';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStyles } from '../global-styles/hooks';\nimport { useGlobalStylesOutputWithConfig } from '../../hooks/use-global-styles-output';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tExperimentalBlockEditorProvider,\n\tBlockStyleVariationOverridesWithConfig,\n} = unlock( blockEditorPrivateApis );\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\n/**\n * Revisions content component for global styles.\n * Coordinates with ScreenRevisions through the path parameter to display\n * the currently selected revision.\n *\n * @param {Object} props Component props.\n * @param {string} props.path Current path in global styles.\n * @param {React.ForwardedRef} ref Ref to the Revisions component.\n * @return {React.JSX.Element} The Revisions component or null if loading.\n */\nfunction StylesCanvasRevisions( { path }, ref ) {\n\tconst blocks = useSelect( ( select ) => {\n\t\t// This is not ideal: it's like a loop (reading from block-editor to render it).\n\t\treturn select( blockEditorStore ).getBlocks();\n\t}, [] );\n\tconst { user: userConfig, base: baseConfig } = useGlobalStyles();\n\n\t// Fetch all revisions (includes unsaved, parent, and enriched with authors)\n\tconst { revisions, isLoading } = useGlobalStylesRevisions();\n\n\t// Parse revision ID from path (e.g., \"/revisions/123\" -> \"123\")\n\tconst revisionId = useMemo( () => {\n\t\tconst match = path?.match( /^\\/revisions\\/(.+)$/ );\n\t\treturn match ? match[ 1 ] : null;\n\t}, [ path ] );\n\n\t// Find the selected revision from the fetched list\n\tconst selectedRevision = useMemo( () => {\n\t\tif ( ! revisionId || ! revisions.length ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn revisions.find(\n\t\t\t( rev ) => String( rev.id ) === String( revisionId )\n\t\t);\n\t}, [ revisionId, revisions ] );\n\n\t// Use the selected revision's config if available, otherwise use current user config\n\tconst displayConfig = selectedRevision || userConfig;\n\n\t// Merge the display config with the base config\n\tconst mergedConfig = useMemo( () => {\n\t\tif (\n\t\t\t! isObjectEmpty( displayConfig ) &&\n\t\t\t! isObjectEmpty( baseConfig )\n\t\t) {\n\t\t\treturn mergeGlobalStyles( baseConfig, displayConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, displayConfig ] );\n\n\tconst renderedBlocksArray = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tisPreviewMode: true,\n\t\t} ),\n\t\t[ originalSettings ]\n\t);\n\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst editorStyles =\n\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( displayConfig )\n\t\t\t? globalStyles\n\t\t\t: settings.styles;\n\n\tif ( isLoading ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Iframe\n\t\t\tref={ ref }\n\t\t\tclassName=\"editor-revisions__iframe\"\n\t\t\tname=\"revisions\"\n\t\t\ttabIndex={ 0 }\n\t\t>\n\t\t\t<style>\n\t\t\t\t{\n\t\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\t\t`.is-root-container { display: flow-root; }`\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<Disabled className=\"editor-revisions__example-preview__content\">\n\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\tvalue={ renderedBlocksArray }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t>\n\t\t\t\t\t<BlockList renderAppender={ false } />\n\t\t\t\t\t{ /*\n\t\t\t\t\t * Styles are printed inside the block editor provider,\n\t\t\t\t\t * so they can access any registered style overrides.\n\t\t\t\t\t */ }\n\t\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t\t<BlockStyleVariationOverridesWithConfig\n\t\t\t\t\t\tconfig={ mergedConfig }\n\t\t\t\t\t/>\n\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t</Disabled>\n\t\t</Iframe>\n\t);\n}\nexport default forwardRef( StylesCanvasRevisions );\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAyB;AACzB,0BAMO;AACP,kBAA0B;AAC1B,qBAAoC;AACpC,8BAAyC;AACzC,kCAAkC;AAKlC,mBAAgC;AAChC,sCAAgD;AAChD,yBAAuB;AAgGpB;AA9FH,IAAM;AAAA,EACL;AAAA,EACA;AACD,QAAI,2BAAQ,oBAAAA,WAAuB;AAEnC,SAAS,cAAe,QAAS;AAChC,SAAO,CAAE,UAAU,OAAO,KAAM,MAAO,EAAE,WAAW;AACrD;AAYA,SAAS,sBAAuB,EAAE,KAAK,GAAG,KAAM;AAC/C,QAAM,aAAS,uBAAW,CAAE,WAAY;AAEvC,WAAO,OAAQ,oBAAAC,KAAiB,EAAE,UAAU;AAAA,EAC7C,GAAG,CAAC,CAAE;AACN,QAAM,EAAE,MAAM,YAAY,MAAM,WAAW,QAAI,8BAAgB;AAG/D,QAAM,EAAE,WAAW,UAAU,QAAI,kDAAyB;AAG1D,QAAM,iBAAa,wBAAS,MAAM;AACjC,UAAM,QAAQ,MAAM,MAAO,qBAAsB;AACjD,WAAO,QAAQ,MAAO,CAAE,IAAI;AAAA,EAC7B,GAAG,CAAE,IAAK,CAAE;AAGZ,QAAM,uBAAmB,wBAAS,MAAM;AACvC,QAAK,CAAE,cAAc,CAAE,UAAU,QAAS;AACzC,aAAO;AAAA,IACR;AACA,WAAO,UAAU;AAAA,MAChB,CAAE,QAAS,OAAQ,IAAI,EAAG,MAAM,OAAQ,UAAW;AA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ACD;AAAA;AAAA;AAAA,EACD;AAEF;AACA,IAAO,wBAAQ,2BAAY,qBAAsB;",
|
|
6
6
|
"names": ["blockEditorPrivateApis", "blockEditorStore", "Iframe", "EditorStyles"]
|
|
7
7
|
}
|
|
@@ -29,6 +29,7 @@ var import_blocks = require("@wordpress/blocks");
|
|
|
29
29
|
var import_core_data = require("@wordpress/core-data");
|
|
30
30
|
var import_block_editor = require("@wordpress/block-editor");
|
|
31
31
|
var import_components = require("@wordpress/components");
|
|
32
|
+
var import_hooks = require("@wordpress/hooks");
|
|
32
33
|
var import_element = require("@wordpress/element");
|
|
33
34
|
var import_i18n = require("@wordpress/i18n");
|
|
34
35
|
var import_sync_error_messages = require("../../utils/sync-error-messages.cjs");
|
|
@@ -38,33 +39,73 @@ var import_use_retry_countdown = require("./use-retry-countdown.cjs");
|
|
|
38
39
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
40
|
var { BlockCanvasCover } = (0, import_lock_unlock.unlock)(import_block_editor.privateApis);
|
|
40
41
|
var { retrySyncConnection } = (0, import_lock_unlock.unlock)(import_core_data.privateApis);
|
|
41
|
-
var INITIAL_DISCONNECTED_DEBOUNCE_MS =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
var INITIAL_DISCONNECTED_DEBOUNCE_MS = 2e4;
|
|
43
|
+
function SyncConnectionErrorModal() {
|
|
44
|
+
const [hasInitialized, setHasInitialized] = (0, import_element.useState)(false);
|
|
45
|
+
const [showModal, setShowModal] = (0, import_element.useState)(false);
|
|
46
|
+
const { connectionStatus, isCollaborationEnabled, postType } = (0, import_data.useSelect)(
|
|
47
|
+
(selectFn) => {
|
|
48
|
+
const currentPostType = selectFn(import_store.store).getCurrentPostType();
|
|
49
|
+
return {
|
|
50
|
+
connectionStatus: selectFn(import_core_data.store).getSyncConnectionStatus() || null,
|
|
51
|
+
isCollaborationEnabled: selectFn(
|
|
52
|
+
import_store.store
|
|
53
|
+
).isCollaborationEnabledForCurrentPost(),
|
|
54
|
+
postType: currentPostType ? selectFn(import_core_data.store).getPostType(currentPostType) : null
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
[]
|
|
58
|
+
);
|
|
59
|
+
const { onManualRetry, secondsRemaining } = (0, import_use_retry_countdown.useRetryCountdown)(connectionStatus);
|
|
51
60
|
const copyButtonRef = (0, import_compose.useCopyToClipboard)(() => {
|
|
52
61
|
const blocks = (0, import_data.select)(import_block_editor.store).getBlocks();
|
|
53
62
|
return (0, import_blocks.serialize)(blocks);
|
|
54
63
|
});
|
|
64
|
+
(0, import_element.useEffect)(() => {
|
|
65
|
+
const timeout = setTimeout(() => {
|
|
66
|
+
setHasInitialized(true);
|
|
67
|
+
}, INITIAL_DISCONNECTED_DEBOUNCE_MS);
|
|
68
|
+
return () => clearTimeout(timeout);
|
|
69
|
+
}, []);
|
|
70
|
+
const canRetry = connectionStatus && "disconnected" === connectionStatus.status && (connectionStatus.canManuallyRetry || connectionStatus.willAutoRetryInMs);
|
|
71
|
+
(0, import_element.useEffect)(() => {
|
|
72
|
+
if ("connected" === connectionStatus?.status) {
|
|
73
|
+
setShowModal(false);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (connectionStatus?.status && "connecting" !== connectionStatus.status && (!canRetry || connectionStatus.backgroundRetriesFailed)) {
|
|
77
|
+
setShowModal(true);
|
|
78
|
+
}
|
|
79
|
+
}, [connectionStatus, canRetry]);
|
|
80
|
+
if (!isCollaborationEnabled || !hasInitialized || !showModal) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
const error = connectionStatus && "error" in connectionStatus ? connectionStatus?.error : void 0;
|
|
84
|
+
if (!canRetry && (0, import_hooks.applyFilters)(
|
|
85
|
+
"editor.isSyncConnectionErrorHandled",
|
|
86
|
+
false,
|
|
87
|
+
error?.code
|
|
88
|
+
) !== false) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
const manualRetry = connectionStatus && "canManuallyRetry" in connectionStatus && connectionStatus.canManuallyRetry ? () => {
|
|
92
|
+
onManualRetry();
|
|
93
|
+
retrySyncConnection();
|
|
94
|
+
} : void 0;
|
|
95
|
+
const messages = (0, import_sync_error_messages.getSyncErrorMessages)(error);
|
|
55
96
|
let retryCountdownText = "";
|
|
56
97
|
let isRetrying = false;
|
|
57
|
-
if (
|
|
98
|
+
if (secondsRemaining && secondsRemaining > 0) {
|
|
58
99
|
retryCountdownText = (0, import_i18n.sprintf)(
|
|
59
100
|
/* translators: %d: number of seconds until retry */
|
|
60
101
|
(0, import_i18n._n)(
|
|
61
102
|
"Retrying connection in %d second\u2026",
|
|
62
103
|
"Retrying connection in %d seconds\u2026",
|
|
63
|
-
|
|
104
|
+
secondsRemaining
|
|
64
105
|
),
|
|
65
|
-
|
|
106
|
+
secondsRemaining
|
|
66
107
|
);
|
|
67
|
-
} else if (0 ===
|
|
108
|
+
} else if (0 === secondsRemaining) {
|
|
68
109
|
isRetrying = true;
|
|
69
110
|
retryCountdownText = (0, import_i18n.__)("Retrying\u2026");
|
|
70
111
|
}
|
|
@@ -72,7 +113,7 @@ function DefaultSyncConnectionErrorModal(props) {
|
|
|
72
113
|
if (postType?.slug) {
|
|
73
114
|
editPostHref = `edit.php?post_type=${postType.slug}`;
|
|
74
115
|
}
|
|
75
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BlockCanvasCover.Fill, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
76
117
|
import_components.Modal,
|
|
77
118
|
{
|
|
78
119
|
overlayClassName: "editor-sync-connection-error-modal",
|
|
@@ -82,9 +123,9 @@ function DefaultSyncConnectionErrorModal(props) {
|
|
|
82
123
|
shouldCloseOnClickOutside: false,
|
|
83
124
|
shouldCloseOnEsc: false,
|
|
84
125
|
size: "medium",
|
|
85
|
-
title,
|
|
126
|
+
title: messages.title,
|
|
86
127
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: 6, children: [
|
|
87
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: description }),
|
|
128
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: messages.description }),
|
|
88
129
|
retryCountdownText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "editor-sync-connection-error-modal__retry-countdown", children: retryCountdownText }),
|
|
89
130
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "right", children: [
|
|
90
131
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -126,64 +167,6 @@ function DefaultSyncConnectionErrorModal(props) {
|
|
|
126
167
|
] })
|
|
127
168
|
] })
|
|
128
169
|
}
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
var FilteredSyncConnectionErrorModal = globalThis.IS_GUTENBERG_PLUGIN ? (0, import_components.withFilters)("editor.SyncConnectionErrorModal")(
|
|
132
|
-
DefaultSyncConnectionErrorModal
|
|
133
|
-
) : DefaultSyncConnectionErrorModal;
|
|
134
|
-
function SyncConnectionErrorModal() {
|
|
135
|
-
const [hasInitialized, setHasInitialized] = (0, import_element.useState)(false);
|
|
136
|
-
const [showModal, setShowModal] = (0, import_element.useState)(false);
|
|
137
|
-
const { connectionStatus, isCollaborationEnabled, postType } = (0, import_data.useSelect)(
|
|
138
|
-
(selectFn) => {
|
|
139
|
-
const currentPostType = selectFn(import_store.store).getCurrentPostType();
|
|
140
|
-
return {
|
|
141
|
-
connectionStatus: selectFn(import_core_data.store).getSyncConnectionStatus() || null,
|
|
142
|
-
isCollaborationEnabled: selectFn(
|
|
143
|
-
import_store.store
|
|
144
|
-
).isCollaborationEnabledForCurrentPost(),
|
|
145
|
-
postType: currentPostType ? selectFn(import_core_data.store).getPostType(currentPostType) : null
|
|
146
|
-
};
|
|
147
|
-
},
|
|
148
|
-
[]
|
|
149
|
-
);
|
|
150
|
-
const { onManualRetry, secondsRemaining } = (0, import_use_retry_countdown.useRetryCountdown)(connectionStatus);
|
|
151
|
-
const isConnected = "connected" === connectionStatus?.status;
|
|
152
|
-
(0, import_element.useEffect)(() => {
|
|
153
|
-
const timeout = setTimeout(() => {
|
|
154
|
-
setHasInitialized(true);
|
|
155
|
-
}, INITIAL_DISCONNECTED_DEBOUNCE_MS);
|
|
156
|
-
return () => clearTimeout(timeout);
|
|
157
|
-
}, []);
|
|
158
|
-
(0, import_element.useEffect)(() => {
|
|
159
|
-
if (isConnected) {
|
|
160
|
-
setShowModal(false);
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
const timeout = setTimeout(() => {
|
|
164
|
-
setShowModal(true);
|
|
165
|
-
}, DISCONNECTED_DEBOUNCE_MS);
|
|
166
|
-
return () => clearTimeout(timeout);
|
|
167
|
-
}, [isConnected]);
|
|
168
|
-
if (!isCollaborationEnabled || !hasInitialized || !showModal) {
|
|
169
|
-
return null;
|
|
170
|
-
}
|
|
171
|
-
const error = connectionStatus && "error" in connectionStatus ? connectionStatus?.error : void 0;
|
|
172
|
-
const manualRetry = connectionStatus && "canManuallyRetry" in connectionStatus && connectionStatus.canManuallyRetry ? () => {
|
|
173
|
-
onManualRetry();
|
|
174
|
-
retrySyncConnection();
|
|
175
|
-
} : void 0;
|
|
176
|
-
const messages = (0, import_sync_error_messages.getSyncErrorMessages)(error);
|
|
177
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BlockCanvasCover.Fill, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
178
|
-
FilteredSyncConnectionErrorModal,
|
|
179
|
-
{
|
|
180
|
-
description: messages.description,
|
|
181
|
-
error,
|
|
182
|
-
manualRetry,
|
|
183
|
-
postType,
|
|
184
|
-
secondsRemainingUntilAutoRetry: secondsRemaining,
|
|
185
|
-
title: messages.title
|
|
186
|
-
}
|
|
187
170
|
) });
|
|
188
171
|
}
|
|
189
172
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sync-connection-error-modal/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, select } from '@wordpress/data';\nimport { useCopyToClipboard } from '@wordpress/compose';\n// @ts-ignore No exported types.\nimport { serialize } from '@wordpress/blocks';\nimport {\n\tstore as coreDataStore,\n\tprivateApis as coreDataPrivateApis,\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAkC;AAClC,qBAAmC;AAEnC,oBAA0B;AAC1B,
|
|
6
|
-
"names": ["coreDataPrivateApis", "
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, select } from '@wordpress/data';\nimport { useCopyToClipboard } from '@wordpress/compose';\n// @ts-ignore No exported types.\nimport { serialize } from '@wordpress/blocks';\nimport {\n\tstore as coreDataStore,\n\tprivateApis as coreDataPrivateApis,\n} from '@wordpress/core-data';\n// @ts-expect-error - No type declarations available for @wordpress/block-editor\n// prettier-ignore\nimport { privateApis, store as blockEditorStore } from '@wordpress/block-editor';\nimport {\n\tButton,\n\tModal,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { applyFilters } from '@wordpress/hooks';\nimport { useState, useEffect } from '@wordpress/element';\nimport { __, sprintf, _n } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getSyncErrorMessages } from '../../utils/sync-error-messages';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useRetryCountdown } from './use-retry-countdown';\n\nconst { BlockCanvasCover } = unlock( privateApis );\nconst { retrySyncConnection } = unlock( coreDataPrivateApis );\n\n// Debounce time for initial disconnected status to allow connection to establish.\nconst INITIAL_DISCONNECTED_DEBOUNCE_MS = 20000;\n\n/**\n * Sync connection modal that displays when any entity reports a disconnection.\n * Uses BlockCanvasCover.Fill to render in the block canvas.\n *\n * @return The modal component or null if not disconnected.\n */\nexport function SyncConnectionErrorModal() {\n\tconst [ hasInitialized, setHasInitialized ] = useState( false );\n\tconst [ showModal, setShowModal ] = useState( false );\n\n\tconst { connectionStatus, isCollaborationEnabled, postType } = useSelect(\n\t\t( selectFn ) => {\n\t\t\tconst currentPostType =\n\t\t\t\tselectFn( editorStore ).getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tconnectionStatus:\n\t\t\t\t\tselectFn( coreDataStore ).getSyncConnectionStatus() || null,\n\t\t\t\tisCollaborationEnabled:\n\t\t\t\t\tselectFn(\n\t\t\t\t\t\teditorStore\n\t\t\t\t\t).isCollaborationEnabledForCurrentPost(),\n\t\t\t\tpostType: currentPostType\n\t\t\t\t\t? selectFn( coreDataStore ).getPostType( currentPostType )\n\t\t\t\t\t: null,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { onManualRetry, secondsRemaining } =\n\t\tuseRetryCountdown( connectionStatus );\n\n\tconst copyButtonRef = useCopyToClipboard( () => {\n\t\tconst blocks = select( blockEditorStore ).getBlocks();\n\t\treturn serialize( blocks );\n\t} );\n\n\t// Set hasInitialized after a debounce to give extra time on initial load.\n\tuseEffect( () => {\n\t\tconst timeout = setTimeout( () => {\n\t\t\tsetHasInitialized( true );\n\t\t}, INITIAL_DISCONNECTED_DEBOUNCE_MS );\n\n\t\treturn () => clearTimeout( timeout );\n\t}, [] );\n\n\t// Show the modal when disconnected and either retries are exhausted or\n\t// no retry is available (unrecoverable error). Hide on reconnect.\n\t// The 'connecting' state is ignored so the modal preserves its current\n\t// visibility during active retry attempts.\n\tconst canRetry =\n\t\tconnectionStatus &&\n\t\t'disconnected' === connectionStatus.status &&\n\t\t( connectionStatus.canManuallyRetry ||\n\t\t\tconnectionStatus.willAutoRetryInMs );\n\n\tuseEffect( () => {\n\t\tif ( 'connected' === connectionStatus?.status ) {\n\t\t\tsetShowModal( false );\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tconnectionStatus?.status &&\n\t\t\t'connecting' !== connectionStatus.status &&\n\t\t\t( ! canRetry || connectionStatus.backgroundRetriesFailed )\n\t\t) {\n\t\t\tsetShowModal( true );\n\t\t}\n\t}, [ connectionStatus, canRetry ] );\n\n\tif ( ! isCollaborationEnabled || ! hasInitialized || ! showModal ) {\n\t\treturn null;\n\t}\n\n\tconst error =\n\t\tconnectionStatus && 'error' in connectionStatus\n\t\t\t? connectionStatus?.error\n\t\t\t: undefined;\n\n\t// For unrecoverable errors (no retry available), allow plugins to handle\n\t// the error themselves. If a plugin returns a value other than false, it\n\t// signals that it has taken over error display and the default modal is\n\t// suppressed.\n\t//\n\t// @example\n\t// ```js\n\t// wp.hooks.addFilter(\n\t// 'editor.isSyncConnectionErrorHandled',\n\t// 'my-plugin/handle-sync-error',\n\t// ( isHandled, errorCode ) => {\n\t// if ( errorCode === 'connection-limit-exceeded' ) {\n\t// return true; // Plugin handles this error via its own UI.\n\t// }\n\t// return isHandled;\n\t// }\n\t// );\n\t// ```\n\tif (\n\t\t! canRetry &&\n\t\tapplyFilters(\n\t\t\t'editor.isSyncConnectionErrorHandled',\n\t\t\tfalse,\n\t\t\terror?.code\n\t\t) !== false\n\t) {\n\t\treturn null;\n\t}\n\n\tconst manualRetry =\n\t\tconnectionStatus &&\n\t\t'canManuallyRetry' in connectionStatus &&\n\t\tconnectionStatus.canManuallyRetry\n\t\t\t? () => {\n\t\t\t\t\tonManualRetry();\n\t\t\t\t\tretrySyncConnection();\n\t\t\t }\n\t\t\t: undefined;\n\n\tconst messages = getSyncErrorMessages( error );\n\n\tlet retryCountdownText: string = '';\n\tlet isRetrying = false;\n\tif ( secondsRemaining && secondsRemaining > 0 ) {\n\t\tretryCountdownText = sprintf(\n\t\t\t/* translators: %d: number of seconds until retry */\n\t\t\t_n(\n\t\t\t\t'Retrying connection in %d second\\u2026',\n\t\t\t\t'Retrying connection in %d seconds\\u2026',\n\t\t\t\tsecondsRemaining\n\t\t\t),\n\t\t\tsecondsRemaining\n\t\t);\n\t} else if ( 0 === secondsRemaining ) {\n\t\tisRetrying = true;\n\t\tretryCountdownText = __( 'Retrying\\u2026' );\n\t}\n\n\tlet editPostHref = 'edit.php';\n\tif ( postType?.slug ) {\n\t\teditPostHref = `edit.php?post_type=${ postType.slug }`;\n\t}\n\n\treturn (\n\t\t<BlockCanvasCover.Fill>\n\t\t\t<Modal\n\t\t\t\toverlayClassName=\"editor-sync-connection-error-modal\"\n\t\t\t\tisDismissible={ false }\n\t\t\t\tonRequestClose={ () => {} }\n\t\t\t\tshouldCloseOnClickOutside={ false }\n\t\t\t\tshouldCloseOnEsc={ false }\n\t\t\t\tsize=\"medium\"\n\t\t\t\ttitle={ messages.title }\n\t\t\t>\n\t\t\t\t<VStack spacing={ 6 }>\n\t\t\t\t\t<p>{ messages.description }</p>\n\t\t\t\t\t{ retryCountdownText && (\n\t\t\t\t\t\t<p className=\"editor-sync-connection-error-modal__retry-countdown\">\n\t\t\t\t\t\t\t{ retryCountdownText }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\thref={ editPostHref }\n\t\t\t\t\t\t\tisDestructive\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: Post type name (e.g., \"Posts\", \"Pages\"). */\n\t\t\t\t\t\t\t\t__( 'Back to %s' ),\n\t\t\t\t\t\t\t\tpostType?.labels?.name ?? __( 'Posts' )\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tref={ copyButtonRef }\n\t\t\t\t\t\t\tvariant={ manualRetry ? 'secondary' : 'primary' }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Copy Post Content' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t{ manualRetry && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\taria-disabled={ isRetrying }\n\t\t\t\t\t\t\t\tdisabled={ isRetrying }\n\t\t\t\t\t\t\t\tisBusy={ isRetrying }\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\tonClick={ manualRetry }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Retry' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</Modal>\n\t\t</BlockCanvasCover.Fill>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAkC;AAClC,qBAAmC;AAEnC,oBAA0B;AAC1B,uBAGO;AAGP,0BAAuD;AACvD,wBAKO;AACP,mBAA6B;AAC7B,qBAAoC;AACpC,kBAAgC;AAKhC,iCAAqC;AACrC,mBAAqC;AACrC,yBAAuB;AACvB,iCAAkC;AAmK7B;AAjKL,IAAM,EAAE,iBAAiB,QAAI,2BAAQ,+BAAY;AACjD,IAAM,EAAE,oBAAoB,QAAI,2BAAQ,iBAAAA,WAAoB;AAG5D,IAAM,mCAAmC;AAQlC,SAAS,2BAA2B;AAC1C,QAAM,CAAE,gBAAgB,iBAAkB,QAAI,yBAAU,KAAM;AAC9D,QAAM,CAAE,WAAW,YAAa,QAAI,yBAAU,KAAM;AAEpD,QAAM,EAAE,kBAAkB,wBAAwB,SAAS,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AA;AAAA,UAC3B;AAAA,UACE,eACD;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,wBAAsB;AAAA,cACtB,iBAAgB;AAAA,cAChB,UAAW;AAAA,cACX,QAAS;AAAA,cACT,SAAQ;AAAA,cACR,SAAU;AAAA,cAER,8BAAI,OAAQ;AAAA;AAAA,UACf;AAAA,WAEF;AAAA,SACD;AAAA;AAAA,EACD,GACD;AAEF;",
|
|
6
|
+
"names": ["coreDataPrivateApis", "editorStore", "coreDataStore", "blockEditorStore", "VStack", "HStack"]
|
|
7
7
|
}
|
|
@@ -26,12 +26,14 @@ module.exports = __toCommonJS(use_retry_countdown_exports);
|
|
|
26
26
|
var import_element = require("@wordpress/element");
|
|
27
27
|
function useRetryCountdown(connectionStatus) {
|
|
28
28
|
const [secondsRemaining, setSecondsRemaining] = (0, import_element.useState)();
|
|
29
|
+
const hasRetriedRef = (0, import_element.useRef)(false);
|
|
29
30
|
(0, import_element.useEffect)(() => {
|
|
30
31
|
if (!connectionStatus) {
|
|
31
32
|
return;
|
|
32
33
|
}
|
|
33
34
|
if ("connected" === connectionStatus.status) {
|
|
34
35
|
setSecondsRemaining(void 0);
|
|
36
|
+
hasRetriedRef.current = false;
|
|
35
37
|
return;
|
|
36
38
|
}
|
|
37
39
|
if ("disconnected" !== connectionStatus.status || !connectionStatus.willAutoRetryInMs) {
|
|
@@ -39,18 +41,39 @@ function useRetryCountdown(connectionStatus) {
|
|
|
39
41
|
}
|
|
40
42
|
const { willAutoRetryInMs: retryInMs } = connectionStatus;
|
|
41
43
|
const retryAt = Date.now() + retryInMs;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
setSecondsRemaining(
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
const hasRetried = hasRetriedRef.current;
|
|
45
|
+
hasRetriedRef.current = true;
|
|
46
|
+
if (hasRetried) {
|
|
47
|
+
setSecondsRemaining(0);
|
|
48
|
+
}
|
|
49
|
+
let countdownIntervalId = null;
|
|
50
|
+
const startCountdown = () => {
|
|
51
|
+
setSecondsRemaining(Math.ceil((retryAt - Date.now()) / 1e3));
|
|
52
|
+
countdownIntervalId = setInterval(() => {
|
|
53
|
+
const remaining = Math.ceil((retryAt - Date.now()) / 1e3);
|
|
54
|
+
setSecondsRemaining(Math.max(0, remaining));
|
|
55
|
+
if (remaining <= 0 && countdownIntervalId) {
|
|
56
|
+
clearInterval(countdownIntervalId);
|
|
57
|
+
}
|
|
58
|
+
}, 1e3);
|
|
59
|
+
};
|
|
60
|
+
const retryingDelayId = hasRetried ? setTimeout(startCountdown, 500) : null;
|
|
61
|
+
if (!retryingDelayId) {
|
|
62
|
+
startCountdown();
|
|
63
|
+
}
|
|
64
|
+
return () => {
|
|
65
|
+
if (retryingDelayId) {
|
|
66
|
+
clearTimeout(retryingDelayId);
|
|
67
|
+
}
|
|
68
|
+
if (countdownIntervalId) {
|
|
69
|
+
clearInterval(countdownIntervalId);
|
|
48
70
|
}
|
|
49
|
-
}
|
|
50
|
-
return () => clearInterval(intervalId);
|
|
71
|
+
};
|
|
51
72
|
}, [connectionStatus]);
|
|
52
73
|
return {
|
|
53
|
-
onManualRetry: () =>
|
|
74
|
+
onManualRetry: () => {
|
|
75
|
+
setSecondsRemaining(0);
|
|
76
|
+
},
|
|
54
77
|
secondsRemaining
|
|
55
78
|
};
|
|
56
79
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sync-connection-error-modal/use-retry-countdown.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport type { ConnectionStatus } from '@wordpress/core-data';\nimport { useState, useEffect } from '@wordpress/element';\n\ninterface UseRetryCountdownResult {\n\tonManualRetry: () => void;\n\tsecondsRemaining?: number;\n}\n\nexport function useRetryCountdown(\n\tconnectionStatus?: ConnectionStatus | null\n): UseRetryCountdownResult {\n\tconst [ secondsRemaining, setSecondsRemaining ] = useState< number >();\n\n\tuseEffect( () => {\n\t\tif ( ! connectionStatus ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Only clear countdown when explicitly connected.\n\t\tif ( 'connected' === connectionStatus.status ) {\n\t\t\tsetSecondsRemaining( undefined );\n\t\t\treturn;\n\t\t}\n\n\t\t// For transient states (e.g. 'connecting' during a retry attempt)\n\t\t// or when retryInMs is not yet available, keep the previous\n\t\t// countdown value to avoid a brief flash.\n\t\tif (\n\t\t\t'disconnected' !== connectionStatus.status ||\n\t\t\t! connectionStatus.willAutoRetryInMs\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { willAutoRetryInMs: retryInMs } = connectionStatus;\n\t\tconst retryAt = Date.now() + retryInMs;\n\t\tsetSecondsRemaining( Math.ceil(
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport type { ConnectionStatus } from '@wordpress/core-data';\nimport { useState, useEffect, useRef } from '@wordpress/element';\n\ninterface UseRetryCountdownResult {\n\tonManualRetry: () => void;\n\tsecondsRemaining?: number;\n}\n\nexport function useRetryCountdown(\n\tconnectionStatus?: ConnectionStatus | null\n): UseRetryCountdownResult {\n\tconst [ secondsRemaining, setSecondsRemaining ] = useState< number >();\n\tconst hasRetriedRef = useRef( false );\n\n\tuseEffect( () => {\n\t\tif ( ! connectionStatus ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Only clear countdown when explicitly connected.\n\t\tif ( 'connected' === connectionStatus.status ) {\n\t\t\tsetSecondsRemaining( undefined );\n\t\t\thasRetriedRef.current = false;\n\t\t\treturn;\n\t\t}\n\n\t\t// For transient states (e.g. 'connecting' during a retry attempt)\n\t\t// or when retryInMs is not yet available, keep the previous\n\t\t// countdown value to avoid a brief flash.\n\t\tif (\n\t\t\t'disconnected' !== connectionStatus.status ||\n\t\t\t! connectionStatus.willAutoRetryInMs\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { willAutoRetryInMs: retryInMs } = connectionStatus;\n\t\tconst retryAt = Date.now() + retryInMs;\n\n\t\t// After a retry attempt (manual or automatic), show \"Retrying...\"\n\t\t// for 500ms before starting the next countdown. Skip the delay on\n\t\t// the very first disconnect so the countdown starts immediately.\n\t\tconst hasRetried = hasRetriedRef.current;\n\t\thasRetriedRef.current = true;\n\n\t\tif ( hasRetried ) {\n\t\t\tsetSecondsRemaining( 0 );\n\t\t}\n\n\t\tlet countdownIntervalId: ReturnType< typeof setInterval > | null = null;\n\n\t\tconst startCountdown = () => {\n\t\t\tsetSecondsRemaining( Math.ceil( ( retryAt - Date.now() ) / 1000 ) );\n\n\t\t\tcountdownIntervalId = setInterval( () => {\n\t\t\t\tconst remaining = Math.ceil( ( retryAt - Date.now() ) / 1000 );\n\t\t\t\tsetSecondsRemaining( Math.max( 0, remaining ) );\n\n\t\t\t\tif ( remaining <= 0 && countdownIntervalId ) {\n\t\t\t\t\tclearInterval( countdownIntervalId );\n\t\t\t\t}\n\t\t\t}, 1000 );\n\t\t};\n\n\t\tconst retryingDelayId = hasRetried\n\t\t\t? setTimeout( startCountdown, 500 )\n\t\t\t: null;\n\n\t\tif ( ! retryingDelayId ) {\n\t\t\tstartCountdown();\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( retryingDelayId ) {\n\t\t\t\tclearTimeout( retryingDelayId );\n\t\t\t}\n\n\t\t\tif ( countdownIntervalId ) {\n\t\t\t\tclearInterval( countdownIntervalId );\n\t\t\t}\n\t\t};\n\t}, [ connectionStatus ] );\n\n\treturn {\n\t\tonManualRetry: () => {\n\t\t\tsetSecondsRemaining( 0 );\n\t\t},\n\t\tsecondsRemaining,\n\t};\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,qBAA4C;AAOrC,SAAS,kBACf,kBAC0B;AAC1B,QAAM,CAAE,k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,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/editor/src/components/template-actions-panel/block-theme-content.js
|
|
31
|
+
var block_theme_content_exports = {};
|
|
32
|
+
__export(block_theme_content_exports, {
|
|
33
|
+
default: () => TemplateActionsPanelContent
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(block_theme_content_exports);
|
|
36
|
+
var import_data = require("@wordpress/data");
|
|
37
|
+
var import_core_data = require("@wordpress/core-data");
|
|
38
|
+
var import_block_editor = require("@wordpress/block-editor");
|
|
39
|
+
var import_components = require("@wordpress/components");
|
|
40
|
+
var import_element = require("@wordpress/element");
|
|
41
|
+
var import_i18n = require("@wordpress/i18n");
|
|
42
|
+
var import_html_entities = require("@wordpress/html-entities");
|
|
43
|
+
var import_notices = require("@wordpress/notices");
|
|
44
|
+
var import_preferences = require("@wordpress/preferences");
|
|
45
|
+
var import_store = require("../../store/index.cjs");
|
|
46
|
+
var import_create_new_template_modal = __toESM(require("../post-template/create-new-template-modal.cjs"));
|
|
47
|
+
var import_swap_template_button = require("../post-template/swap-template-button.cjs");
|
|
48
|
+
var import_hooks = require("../post-template/hooks.cjs");
|
|
49
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
|
+
function TemplateActionsPanelContent() {
|
|
51
|
+
const templateId = (0, import_data.useSelect)(
|
|
52
|
+
(select) => select(import_store.store).getCurrentTemplateId(),
|
|
53
|
+
[]
|
|
54
|
+
);
|
|
55
|
+
const [isCreateModalOpen, setIsCreateModalOpen] = (0, import_element.useState)(false);
|
|
56
|
+
const [isSwapModalOpen, setIsSwapModalOpen] = (0, import_element.useState)(false);
|
|
57
|
+
const availableTemplates = (0, import_hooks.useAvailableTemplates)();
|
|
58
|
+
const hasSwapTargets = !!availableTemplates?.length;
|
|
59
|
+
const {
|
|
60
|
+
onNavigateToEntityRecord,
|
|
61
|
+
canCreateTemplate,
|
|
62
|
+
hasGoBack,
|
|
63
|
+
getEditorSettings
|
|
64
|
+
} = (0, import_data.useSelect)((select) => {
|
|
65
|
+
const { getEditorSettings: _getEditorSettings } = select(import_store.store);
|
|
66
|
+
const editorSettings = _getEditorSettings();
|
|
67
|
+
return {
|
|
68
|
+
onNavigateToEntityRecord: editorSettings.onNavigateToEntityRecord,
|
|
69
|
+
canCreateTemplate: !!select(import_core_data.store).canUser("create", {
|
|
70
|
+
kind: "postType",
|
|
71
|
+
name: "wp_template"
|
|
72
|
+
}),
|
|
73
|
+
hasGoBack: editorSettings.hasOwnProperty(
|
|
74
|
+
"onNavigateToPreviousEntityRecord"
|
|
75
|
+
),
|
|
76
|
+
getEditorSettings: _getEditorSettings
|
|
77
|
+
};
|
|
78
|
+
}, []);
|
|
79
|
+
const { get: getPreference } = (0, import_data.useSelect)(import_preferences.store);
|
|
80
|
+
const { createSuccessNotice } = (0, import_data.useDispatch)(import_notices.store);
|
|
81
|
+
const { editedRecord: template, hasResolved } = (0, import_core_data.useEntityRecord)(
|
|
82
|
+
"postType",
|
|
83
|
+
"wp_template",
|
|
84
|
+
templateId
|
|
85
|
+
);
|
|
86
|
+
const [blocks] = (0, import_core_data.useEntityBlockEditor)("postType", "wp_template", {
|
|
87
|
+
id: templateId
|
|
88
|
+
});
|
|
89
|
+
if (!hasResolved) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
const notificationAction = hasGoBack ? [
|
|
93
|
+
{
|
|
94
|
+
label: (0, import_i18n.__)("Go back"),
|
|
95
|
+
onClick: () => getEditorSettings().onNavigateToPreviousEntityRecord()
|
|
96
|
+
}
|
|
97
|
+
] : void 0;
|
|
98
|
+
const mayShowTemplateEditNotice = () => {
|
|
99
|
+
if (!getPreference("core/edit-site", "welcomeGuideTemplate")) {
|
|
100
|
+
createSuccessNotice(
|
|
101
|
+
(0, import_i18n.__)(
|
|
102
|
+
"Editing template. Changes made here affect all posts and pages that use the template."
|
|
103
|
+
),
|
|
104
|
+
{ type: "snackbar", actions: notificationAction }
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const templateName = (0, import_html_entities.decodeEntities)(template.title);
|
|
109
|
+
const previewContent = !!blocks?.length && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockPreview.Async, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockPreview, { blocks }) });
|
|
110
|
+
const renderPreview = () => {
|
|
111
|
+
if (!previewContent) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
if (hasSwapTargets) {
|
|
115
|
+
const tooltipText = (0, import_i18n.__)("Change template");
|
|
116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Tooltip, { text: tooltipText, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
className: "editor-template-actions-panel__preview",
|
|
120
|
+
role: "button",
|
|
121
|
+
tabIndex: 0,
|
|
122
|
+
"aria-label": tooltipText,
|
|
123
|
+
onClick: () => setIsSwapModalOpen(true),
|
|
124
|
+
onKeyPress: () => setIsSwapModalOpen(true),
|
|
125
|
+
children: previewContent
|
|
126
|
+
}
|
|
127
|
+
) });
|
|
128
|
+
}
|
|
129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-template-actions-panel__preview", children: previewContent });
|
|
130
|
+
};
|
|
131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
132
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
133
|
+
import_components.PanelBody,
|
|
134
|
+
{
|
|
135
|
+
title: (0, import_i18n.sprintf)(
|
|
136
|
+
/* translators: %s: template name */
|
|
137
|
+
(0, import_i18n.__)("Template: %s"),
|
|
138
|
+
templateName
|
|
139
|
+
),
|
|
140
|
+
initialOpen: false,
|
|
141
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { children: [
|
|
142
|
+
renderPreview(),
|
|
143
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { children: [
|
|
144
|
+
onNavigateToEntityRecord && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
145
|
+
import_components.Button,
|
|
146
|
+
{
|
|
147
|
+
className: "editor-template-actions-panel__action",
|
|
148
|
+
__next40pxDefaultSize: true,
|
|
149
|
+
variant: "secondary",
|
|
150
|
+
onClick: () => {
|
|
151
|
+
onNavigateToEntityRecord({
|
|
152
|
+
postId: template.id,
|
|
153
|
+
postType: "wp_template"
|
|
154
|
+
});
|
|
155
|
+
mayShowTemplateEditNotice();
|
|
156
|
+
},
|
|
157
|
+
children: (0, import_i18n.__)("Edit")
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
canCreateTemplate && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
161
|
+
import_components.Button,
|
|
162
|
+
{
|
|
163
|
+
className: "editor-template-actions-panel__action",
|
|
164
|
+
__next40pxDefaultSize: true,
|
|
165
|
+
variant: "secondary",
|
|
166
|
+
onClick: () => setIsCreateModalOpen(true),
|
|
167
|
+
children: (0, import_i18n.__)("Create new")
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
] })
|
|
171
|
+
] })
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
isCreateModalOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
175
|
+
import_create_new_template_modal.default,
|
|
176
|
+
{
|
|
177
|
+
onClose: () => setIsCreateModalOpen(false)
|
|
178
|
+
}
|
|
179
|
+
),
|
|
180
|
+
isSwapModalOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
181
|
+
import_swap_template_button.SwapTemplateModal,
|
|
182
|
+
{
|
|
183
|
+
onRequestClose: () => setIsSwapModalOpen(false)
|
|
184
|
+
}
|
|
185
|
+
)
|
|
186
|
+
] });
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=block-theme-content.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/template-actions-panel/block-theme-content.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseEntityRecord,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport { BlockPreview } from '@wordpress/block-editor';\nimport {\n\tPanelBody,\n\tButton,\n\tTooltip,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport CreateNewTemplateModal from '../post-template/create-new-template-modal';\nimport { SwapTemplateModal } from '../post-template/swap-template-button';\nimport { useAvailableTemplates } from '../post-template/hooks';\n\nexport default function TemplateActionsPanelContent() {\n\tconst templateId = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentTemplateId(),\n\t\t[]\n\t);\n\tconst [ isCreateModalOpen, setIsCreateModalOpen ] = useState( false );\n\tconst [ isSwapModalOpen, setIsSwapModalOpen ] = useState( false );\n\n\tconst availableTemplates = useAvailableTemplates();\n\tconst hasSwapTargets = !! availableTemplates?.length;\n\n\tconst {\n\t\tonNavigateToEntityRecord,\n\t\tcanCreateTemplate,\n\t\thasGoBack,\n\t\tgetEditorSettings,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings: _getEditorSettings } = select( editorStore );\n\t\tconst editorSettings = _getEditorSettings();\n\t\treturn {\n\t\t\tonNavigateToEntityRecord: editorSettings.onNavigateToEntityRecord,\n\t\t\tcanCreateTemplate: !! select( coreStore ).canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} ),\n\t\t\thasGoBack: editorSettings.hasOwnProperty(\n\t\t\t\t'onNavigateToPreviousEntityRecord'\n\t\t\t),\n\t\t\tgetEditorSettings: _getEditorSettings,\n\t\t};\n\t}, [] );\n\n\tconst { get: getPreference } = useSelect( preferencesStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst { editedRecord: template, hasResolved } = useEntityRecord(\n\t\t'postType',\n\t\t'wp_template',\n\t\ttemplateId\n\t);\n\n\tconst [ blocks ] = useEntityBlockEditor( 'postType', 'wp_template', {\n\t\tid: templateId,\n\t} );\n\n\tif ( ! hasResolved ) {\n\t\treturn null;\n\t}\n\n\t// The site editor does not have a `onNavigateToPreviousEntityRecord` setting as it uses its own routing\n\t// and assigns its own backlink to focusMode pages.\n\tconst notificationAction = hasGoBack\n\t\t? [\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord(),\n\t\t\t\t},\n\t\t ]\n\t\t: undefined;\n\n\tconst mayShowTemplateEditNotice = () => {\n\t\tif ( ! getPreference( 'core/edit-site', 'welcomeGuideTemplate' ) ) {\n\t\t\tcreateSuccessNotice(\n\t\t\t\t__(\n\t\t\t\t\t'Editing template. Changes made here affect all posts and pages that use the template.'\n\t\t\t\t),\n\t\t\t\t{ type: 'snackbar', actions: notificationAction }\n\t\t\t);\n\t\t}\n\t};\n\n\tconst templateName = decodeEntities( template.title );\n\n\tconst previewContent = !! blocks?.length && (\n\t\t<BlockPreview.Async>\n\t\t\t<BlockPreview blocks={ blocks } />\n\t\t</BlockPreview.Async>\n\t);\n\n\tconst renderPreview = () => {\n\t\tif ( ! previewContent ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( hasSwapTargets ) {\n\t\t\tconst tooltipText = __( 'Change template' );\n\t\t\treturn (\n\t\t\t\t<Tooltip text={ tooltipText }>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"editor-template-actions-panel__preview\"\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\ttabIndex={ 0 }\n\t\t\t\t\t\taria-label={ tooltipText }\n\t\t\t\t\t\tonClick={ () => setIsSwapModalOpen( true ) }\n\t\t\t\t\t\tonKeyPress={ () => setIsSwapModalOpen( true ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ previewContent }\n\t\t\t\t\t</div>\n\t\t\t\t</Tooltip>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div className=\"editor-template-actions-panel__preview\">\n\t\t\t\t{ previewContent }\n\t\t\t</div>\n\t\t);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ sprintf(\n\t\t\t\t\t/* translators: %s: template name */\n\t\t\t\t\t__( 'Template: %s' ),\n\t\t\t\t\ttemplateName\n\t\t\t\t) }\n\t\t\t\tinitialOpen={ false }\n\t\t\t>\n\t\t\t\t<VStack>\n\t\t\t\t\t{ renderPreview() }\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t{ onNavigateToEntityRecord && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"editor-template-actions-panel__action\"\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\t\t\t\t\t\tpostId: template.id,\n\t\t\t\t\t\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\tmayShowTemplateEditNotice();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ canCreateTemplate && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"editor-template-actions-panel__action\"\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tonClick={ () => setIsCreateModalOpen( true ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Create new' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</PanelBody>\n\t\t\t{ isCreateModalOpen && (\n\t\t\t\t<CreateNewTemplateModal\n\t\t\t\t\tonClose={ () => setIsCreateModalOpen( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isSwapModalOpen && (\n\t\t\t\t<SwapTemplateModal\n\t\t\t\t\tonRequestClose={ () => setIsSwapModalOpen( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuC;AACvC,uBAIO;AACP,0BAA6B;AAC7B,wBAMO;AACP,qBAAyB;AACzB,kBAA4B;AAC5B,2BAA+B;AAC/B,qBAAsC;AACtC,yBAA0C;AAK1C,mBAAqC;AACrC,uCAAmC;AACnC,kCAAkC;AAClC,mBAAsC;AA8EnC;AA5EY,SAAR,8BAA+C;AACrD,QAAM,iBAAa;AAAA,IAClB,CAAE,WAAY,OAAQ,aAAAA,KAAY,EAAE,qBAAqB;AAAA,IACzD,CAAC;AAAA,EACF;AACA,QAAM,CAAE,mBAAmB,oBAAqB,QAAI,yBAAU,KAAM;AACpE,QAAM,CAAE,iBAAiB,kBAAmB,QAAI,yBAAU,KAAM;AAEhE,QAAM,yBAAqB,oCAAsB;AACjD,QAAM,iBAAiB,CAAC,CAAE,oBAAoB;AAE9C,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI,uBAAW,CAAE,WAAY;AAC5B,UAAM,EAAE,mBAAmB,mBAAmB,IAAI,OAAQ,aAAAA,KAAY;AACtE,UAAM,iBAAiB,mBAAmB;AAC1C,WAAO;AAAA,MACN,0BAA0B,eAAe;AAAA,M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;AAAA,UACV,MAAK;AAAA,UACL,UAAW;AAAA,UACX,cAAa;AAAA,UACb,SAAU,MAAM,mBAAoB,IAAK;AAAA,UACzC,YAAa,MAAM,mBAAoB,IAAK;AAAA,UAE1C;AAAA;AAAA,MACH,GACD;AAAA,IAEF;AAEA,WACC,4CAAC,SAAI,WAAU,0CACZ,0BACH;AAAA,EAEF;AAEA,SACC,4EACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,WAAQ;AAAA;AAAA,cAEP,gBAAI,cAAe;AAAA,UACnB;AAAA,QACD;AAAA,QACA,aAAc;AAAA,QAEd,uDAAC,kBAAAC,sBAAA,EACE;AAAA,wBAAc;AAAA,UAChB,6CAAC,kBAAAC,sBAAA,EACE;AAAA,wCACD;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBACV,uBAAqB;AAAA,gBACrB,SAAQ;AAAA,gBACR,SAAU,MAAM;AACf,2CAA0B;AAAA,oBACzB,QAAQ,SAAS;AAAA,oBACjB,UAAU;AAAA,kBACX,CAAE;AACF,4CAA0B;AAAA,gBAC3B;AAAA,gBAEE,8BAAI,MAAO;AAAA;AAAA,YACd;AAAA,YAEC,qBACD;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBACV,uBAAqB;AAAA,gBACrB,SAAQ;AAAA,gBACR,SAAU,MAAM,qBAAsB,IAAK;AAAA,gBAEzC,8BAAI,YAAa;AAAA;AAAA,YACpB;AAAA,aAEF;AAAA,WACD;AAAA;AAAA,IACD;AAAA,IACE,qBACD;AAAA,MAAC,iCAAAC;AAAA,MAAA;AAAA,QACA,SAAU,MAAM,qBAAsB,KAAM;AAAA;AAAA,IAC7C;AAAA,IAEC,mBACD;AAAA,MAAC;AAAA;AAAA,QACA,gBAAiB,MAAM,mBAAoB,KAAM;AAAA;AAAA,IAClD;AAAA,KAEF;AAEF;",
|
|
6
|
+
"names": ["editorStore", "coreStore", "preferencesStore", "noticesStore", "VStack", "HStack", "CreateNewTemplateModal"]
|
|
7
|
+
}
|