@wordpress/editor 14.17.0 → 14.18.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/build/bindings/pattern-overrides.js +0 -1
- package/build/bindings/pattern-overrides.js.map +1 -1
- package/build/bindings/post-meta.js +0 -1
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/autocompleters/user.js +0 -1
- package/build/components/autocompleters/user.js.map +1 -1
- package/build/components/block-removal-warnings/index.js +0 -1
- package/build/components/block-removal-warnings/index.js.map +1 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js +0 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/collab-sidebar/comments.js +0 -1
- package/build/components/collab-sidebar/comments.js.map +1 -1
- package/build/components/collab-sidebar/index.js +0 -1
- package/build/components/collab-sidebar/index.js.map +1 -1
- package/build/components/collab-sidebar/utils.js +0 -1
- package/build/components/collab-sidebar/utils.js.map +1 -1
- package/build/components/deprecated.js +0 -1
- package/build/components/deprecated.js.map +1 -1
- package/build/components/document-outline/index.js +0 -1
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/editor/index.js +9 -5
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-help/index.native.js +0 -1
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-notices/index.js +0 -1
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/editor-snackbars/index.js +0 -1
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +0 -1
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js +0 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build/components/entities-saved-states/index.js +0 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +0 -1
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/list-view-sidebar/index.js +0 -1
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/local-autosave-monitor/index.js +0 -1
- package/build/components/local-autosave-monitor/index.js.map +1 -1
- package/build/components/mode-switcher/index.js +0 -1
- package/build/components/mode-switcher/index.js.map +1 -1
- package/build/components/page-attributes/parent.js +8 -5
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-actions/actions.js +0 -1
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +0 -1
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-author/check.js +3 -4
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/combobox.js +4 -2
- package/build/components/post-author/combobox.js.map +1 -1
- package/build/components/post-author/hook.js +8 -5
- package/build/components/post-author/hook.js.map +1 -1
- package/build/components/post-fields/index.js +0 -1
- package/build/components/post-fields/index.js.map +1 -1
- package/build/components/post-format/index.js +0 -1
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-format/panel.js +0 -1
- package/build/components/post-format/panel.js.map +1 -1
- package/build/components/post-publish-button/index.js +0 -1
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js +2 -4
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +0 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +0 -1
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-publish-panel/media-util.js +0 -1
- package/build/components/post-publish-panel/media-util.js.map +1 -1
- package/build/components/post-saved-state/index.js +0 -1
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/index.js +0 -1
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-taxonomies/check.js +1 -1
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +2 -3
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -3
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +1 -2
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +0 -1
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-template/classic-theme.js +0 -1
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-template/swap-template-button.js +0 -1
- package/build/components/post-template/swap-template-button.js.map +1 -1
- package/build/components/post-transform-panel/hooks.js +0 -1
- package/build/components/post-transform-panel/hooks.js.map +1 -1
- package/build/components/post-type-support-check/index.js +0 -1
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/preferences-modal/block-visibility.js +0 -1
- package/build/components/preferences-modal/block-visibility.js.map +1 -1
- package/build/components/preferences-modal/index.js +0 -1
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js +0 -1
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/index.js +0 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +0 -1
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +0 -1
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/sidebar/index.js +0 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/start-template-options/index.js +0 -1
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/template-part-content-panel/index.js +0 -1
- package/build/components/template-part-content-panel/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +0 -1
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/components/visual-editor/use-select-nearest-editable-block.js +0 -1
- package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build/dataviews/store/private-actions.js +0 -1
- package/build/dataviews/store/private-actions.js.map +1 -1
- package/build/dataviews/store/reducer.js +0 -1
- package/build/dataviews/store/reducer.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js +0 -1
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/hooks/pattern-overrides.js +0 -1
- package/build/hooks/pattern-overrides.js.map +1 -1
- package/build/private-apis.js +2 -0
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +0 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +0 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +0 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +0 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/reducer.native.js +0 -1
- package/build/store/reducer.native.js.map +1 -1
- package/build/store/selectors.js +0 -1
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-template-info.js +0 -1
- package/build/utils/get-template-info.js.map +1 -1
- package/build/utils/terms.js +0 -1
- package/build/utils/terms.js.map +1 -1
- package/build-module/bindings/pattern-overrides.js +0 -1
- package/build-module/bindings/pattern-overrides.js.map +1 -1
- package/build-module/bindings/post-meta.js +0 -1
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/autocompleters/user.js +0 -1
- package/build-module/components/autocompleters/user.js.map +1 -1
- package/build-module/components/block-removal-warnings/index.js +0 -1
- package/build-module/components/block-removal-warnings/index.js.map +1 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +0 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build-module/components/collab-sidebar/comments.js +0 -1
- package/build-module/components/collab-sidebar/comments.js.map +1 -1
- package/build-module/components/collab-sidebar/index.js +0 -1
- package/build-module/components/collab-sidebar/index.js.map +1 -1
- package/build-module/components/collab-sidebar/utils.js +0 -1
- package/build-module/components/collab-sidebar/utils.js.map +1 -1
- package/build-module/components/deprecated.js +0 -1
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/document-outline/index.js +0 -1
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/editor/index.js +9 -5
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +0 -1
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-notices/index.js +0 -1
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +0 -1
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +0 -1
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +0 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +0 -1
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/list-view-sidebar/index.js +0 -1
- package/build-module/components/list-view-sidebar/index.js.map +1 -1
- package/build-module/components/local-autosave-monitor/index.js +0 -1
- package/build-module/components/local-autosave-monitor/index.js.map +1 -1
- package/build-module/components/mode-switcher/index.js +0 -1
- package/build-module/components/mode-switcher/index.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +8 -5
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/post-actions/actions.js +0 -1
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +0 -1
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-author/check.js +3 -4
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/combobox.js +4 -2
- package/build-module/components/post-author/combobox.js.map +1 -1
- package/build-module/components/post-author/hook.js +8 -5
- package/build-module/components/post-author/hook.js.map +1 -1
- package/build-module/components/post-fields/index.js +0 -1
- package/build-module/components/post-fields/index.js.map +1 -1
- package/build-module/components/post-format/index.js +0 -1
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-format/panel.js +0 -1
- package/build-module/components/post-format/panel.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +0 -1
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +2 -4
- package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js +0 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js +1 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +0 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-publish-panel/media-util.js +0 -1
- package/build-module/components/post-publish-panel/media-util.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +0 -1
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/index.js +0 -1
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-taxonomies/check.js +1 -1
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +2 -3
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -3
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +1 -2
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +0 -1
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +0 -1
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js +0 -1
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-transform-panel/hooks.js +0 -1
- package/build-module/components/post-transform-panel/hooks.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js +0 -1
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/preferences-modal/block-visibility.js +0 -1
- package/build-module/components/preferences-modal/block-visibility.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +0 -1
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +0 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/index.js +0 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +0 -1
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +0 -1
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/sidebar/index.js +0 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +0 -1
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/template-part-content-panel/index.js +0 -1
- package/build-module/components/template-part-content-panel/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +0 -1
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js +0 -1
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build-module/dataviews/store/private-actions.js +0 -1
- package/build-module/dataviews/store/private-actions.js.map +1 -1
- package/build-module/dataviews/store/reducer.js +0 -1
- package/build-module/dataviews/store/reducer.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js +0 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/hooks/pattern-overrides.js +0 -1
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/private-apis.js +3 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +0 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +0 -1
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +0 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +0 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/reducer.native.js +0 -1
- package/build-module/store/reducer.native.js.map +1 -1
- package/build-module/store/selectors.js +0 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-template-info.js +0 -1
- package/build-module/utils/get-template-info.js.map +1 -1
- package/build-module/utils/terms.js +0 -1
- package/build-module/utils/terms.js.map +1 -1
- package/build-types/components/editor/index.d.ts.map +1 -1
- package/build-types/components/page-attributes/parent.d.ts.map +1 -1
- package/build-types/components/post-author/check.d.ts.map +1 -1
- package/build-types/components/post-author/combobox.d.ts.map +1 -1
- package/build-types/components/post-author/hook.d.ts +1 -0
- package/build-types/components/post-author/hook.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-category-panel.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/index.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/private-apis.d.ts.map +1 -1
- package/package.json +37 -37
- package/src/components/editor/index.js +24 -13
- package/src/components/page-attributes/parent.js +55 -38
- package/src/components/post-author/check.js +7 -4
- package/src/components/post-author/combobox.js +3 -1
- package/src/components/post-author/hook.js +4 -3
- package/src/components/post-publish-panel/maybe-category-panel.js +6 -2
- package/src/components/post-publish-panel/maybe-tags-panel.js +5 -1
- package/src/components/post-taxonomies/check.js +5 -3
- package/src/components/post-taxonomies/flat-term-selector.js +2 -2
- package/src/components/post-taxonomies/hierarchical-term-selector.js +2 -2
- package/src/components/post-taxonomies/index.js +5 -1
- package/src/components/post-taxonomies/test/index.js +32 -18
- package/src/private-apis.js +7 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["decodeEntities","buildTermsTree","flatTerms","flatTermsWithParentAndChildren","map","term","children","parent","undefined","some","termsByParent","reduce","acc","push","fillWithChildren","terms","id","length","unescapeString","arg","unescapeTerm","name","unescapeTerms"],"sources":["@wordpress/editor/src/utils/terms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Returns terms in a tree form.\n *\n * @param {Array} flatTerms Array of terms in flat format.\n *\n * @return {Array} Array of terms in tree format.\n */\nexport function buildTermsTree( flatTerms ) {\n\tconst flatTermsWithParentAndChildren = flatTerms.map( ( term ) => {\n\t\treturn {\n\t\t\tchildren: [],\n\t\t\tparent: undefined,\n\t\t\t...term,\n\t\t};\n\t} );\n\n\t// All terms should have a `parent` because we're about to index them by it.\n\tif (\n\t\tflatTermsWithParentAndChildren.some(\n\t\t\t( { parent } ) => parent === undefined\n\t\t)\n\t) {\n\t\treturn flatTermsWithParentAndChildren;\n\t}\n\n\tconst termsByParent = flatTermsWithParentAndChildren.reduce(\n\t\t( acc, term ) => {\n\t\t\tconst { parent } = term;\n\t\t\tif ( ! acc[ parent ] ) {\n\t\t\t\tacc[ parent ] = [];\n\t\t\t}\n\t\t\tacc[ parent ].push( term );\n\t\t\treturn acc;\n\t\t},\n\t\t{}\n\t);\n\n\tconst fillWithChildren = ( terms ) => {\n\t\treturn terms.map( ( term ) => {\n\t\t\tconst children = termsByParent[ term.id ];\n\t\t\treturn {\n\t\t\t\t...term,\n\t\t\t\tchildren:\n\t\t\t\t\tchildren && children.length\n\t\t\t\t\t\t? fillWithChildren( children )\n\t\t\t\t\t\t: [],\n\t\t\t};\n\t\t} );\n\t};\n\n\treturn fillWithChildren( termsByParent[ '0' ] || [] );\n}\n\nexport const unescapeString = ( arg ) => {\n\treturn decodeEntities( arg );\n};\n\n/**\n * Returns a term object with name unescaped.\n *\n * @param {Object} term The term object to unescape.\n *\n * @return {Object} Term object with name property unescaped.\n */\nexport const unescapeTerm = ( term ) => {\n\treturn {\n\t\t...term,\n\t\tname: unescapeString( term.name ),\n\t};\n};\n\n/**\n * Returns an array of term objects with names unescaped.\n * The unescape of each term is performed using the unescapeTerm function.\n *\n * @param {Object[]} terms Array of term objects to unescape.\n *\n * @return {Object[]} Array of term objects unescaped.\n */\nexport const unescapeTerms = ( terms ) => {\n\treturn ( terms ?? [] ).map( unescapeTerm );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["decodeEntities","buildTermsTree","flatTerms","flatTermsWithParentAndChildren","map","term","children","parent","undefined","some","termsByParent","reduce","acc","push","fillWithChildren","terms","id","length","unescapeString","arg","unescapeTerm","name","unescapeTerms"],"sources":["@wordpress/editor/src/utils/terms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Returns terms in a tree form.\n *\n * @param {Array} flatTerms Array of terms in flat format.\n *\n * @return {Array} Array of terms in tree format.\n */\nexport function buildTermsTree( flatTerms ) {\n\tconst flatTermsWithParentAndChildren = flatTerms.map( ( term ) => {\n\t\treturn {\n\t\t\tchildren: [],\n\t\t\tparent: undefined,\n\t\t\t...term,\n\t\t};\n\t} );\n\n\t// All terms should have a `parent` because we're about to index them by it.\n\tif (\n\t\tflatTermsWithParentAndChildren.some(\n\t\t\t( { parent } ) => parent === undefined\n\t\t)\n\t) {\n\t\treturn flatTermsWithParentAndChildren;\n\t}\n\n\tconst termsByParent = flatTermsWithParentAndChildren.reduce(\n\t\t( acc, term ) => {\n\t\t\tconst { parent } = term;\n\t\t\tif ( ! acc[ parent ] ) {\n\t\t\t\tacc[ parent ] = [];\n\t\t\t}\n\t\t\tacc[ parent ].push( term );\n\t\t\treturn acc;\n\t\t},\n\t\t{}\n\t);\n\n\tconst fillWithChildren = ( terms ) => {\n\t\treturn terms.map( ( term ) => {\n\t\t\tconst children = termsByParent[ term.id ];\n\t\t\treturn {\n\t\t\t\t...term,\n\t\t\t\tchildren:\n\t\t\t\t\tchildren && children.length\n\t\t\t\t\t\t? fillWithChildren( children )\n\t\t\t\t\t\t: [],\n\t\t\t};\n\t\t} );\n\t};\n\n\treturn fillWithChildren( termsByParent[ '0' ] || [] );\n}\n\nexport const unescapeString = ( arg ) => {\n\treturn decodeEntities( arg );\n};\n\n/**\n * Returns a term object with name unescaped.\n *\n * @param {Object} term The term object to unescape.\n *\n * @return {Object} Term object with name property unescaped.\n */\nexport const unescapeTerm = ( term ) => {\n\treturn {\n\t\t...term,\n\t\tname: unescapeString( term.name ),\n\t};\n};\n\n/**\n * Returns an array of term objects with names unescaped.\n * The unescape of each term is performed using the unescapeTerm function.\n *\n * @param {Object[]} terms Array of term objects to unescape.\n *\n * @return {Object[]} Array of term objects unescaped.\n */\nexport const unescapeTerms = ( terms ) => {\n\treturn ( terms ?? [] ).map( unescapeTerm );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAEC,SAAS,EAAG;EAC3C,MAAMC,8BAA8B,GAAGD,SAAS,CAACE,GAAG,CAAIC,IAAI,IAAM;IACjE,OAAO;MACNC,QAAQ,EAAE,EAAE;MACZC,MAAM,EAAEC,SAAS;MACjB,GAAGH;IACJ,CAAC;EACF,CAAE,CAAC;;EAEH;EACA,IACCF,8BAA8B,CAACM,IAAI,CAClC,CAAE;IAAEF;EAAO,CAAC,KAAMA,MAAM,KAAKC,SAC9B,CAAC,EACA;IACD,OAAOL,8BAA8B;EACtC;EAEA,MAAMO,aAAa,GAAGP,8BAA8B,CAACQ,MAAM,CAC1D,CAAEC,GAAG,EAAEP,IAAI,KAAM;IAChB,MAAM;MAAEE;IAAO,CAAC,GAAGF,IAAI;IACvB,IAAK,CAAEO,GAAG,CAAEL,MAAM,CAAE,EAAG;MACtBK,GAAG,CAAEL,MAAM,CAAE,GAAG,EAAE;IACnB;IACAK,GAAG,CAAEL,MAAM,CAAE,CAACM,IAAI,CAAER,IAAK,CAAC;IAC1B,OAAOO,GAAG;EACX,CAAC,EACD,CAAC,CACF,CAAC;EAED,MAAME,gBAAgB,GAAKC,KAAK,IAAM;IACrC,OAAOA,KAAK,CAACX,GAAG,CAAIC,IAAI,IAAM;MAC7B,MAAMC,QAAQ,GAAGI,aAAa,CAAEL,IAAI,CAACW,EAAE,CAAE;MACzC,OAAO;QACN,GAAGX,IAAI;QACPC,QAAQ,EACPA,QAAQ,IAAIA,QAAQ,CAACW,MAAM,GACxBH,gBAAgB,CAAER,QAAS,CAAC,GAC5B;MACL,CAAC;IACF,CAAE,CAAC;EACJ,CAAC;EAED,OAAOQ,gBAAgB,CAAEJ,aAAa,CAAE,GAAG,CAAE,IAAI,EAAG,CAAC;AACtD;AAEA,OAAO,MAAMQ,cAAc,GAAKC,GAAG,IAAM;EACxC,OAAOnB,cAAc,CAAEmB,GAAI,CAAC;AAC7B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,GAAKf,IAAI,IAAM;EACvC,OAAO;IACN,GAAGA,IAAI;IACPgB,IAAI,EAAEH,cAAc,CAAEb,IAAI,CAACgB,IAAK;EACjC,CAAC;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAKP,KAAK,IAAM;EACzC,OAAO,CAAEA,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE,EAAGX,GAAG,CAAEgB,YAAa,CAAC;AAC3C,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/editor/index.js"],"names":[],"mappings":";AAgBA;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/editor/index.js"],"names":[],"mappings":";AAgBA;;;;;;;;;;;gCAgFC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parent.d.ts","sourceRoot":"","sources":["../../../src/components/page-attributes/parent.js"],"names":[],"mappings":"AAsDA;;;;;GAKG;AACH,wCAFY,KAAK,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"parent.d.ts","sourceRoot":"","sources":["../../../src/components/page-attributes/parent.js"],"names":[],"mappings":"AAsDA;;;;;GAKG;AACH,wCAFY,KAAK,CAAC,SAAS,CAsJ1B;AAkCD,yDA4EC;AAtRM,qEAYN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/components/post-author/check.js"],"names":[],"mappings":"AAaA;;;;;;;;GAQG;AACH,sDALG;IAA+B,QAAQ,EAA/B,KAAK,CAAC,SAAS;CAEvB,GAAS,KAAK,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/components/post-author/check.js"],"names":[],"mappings":"AAaA;;;;;;;;GAQG;AACH,sDALG;IAA+B,QAAQ,EAA/B,KAAK,CAAC,SAAS;CAEvB,GAAS,KAAK,CAAC,SAAS,CA0B1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../src/components/post-author/combobox.js"],"names":[],"mappings":"AAeA,
|
|
1
|
+
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../src/components/post-author/combobox.js"],"names":[],"mappings":"AAeA,0EA0CC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/components/post-author/hook.js"],"names":[],"mappings":"AAeA
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/components/post-author/hook.js"],"names":[],"mappings":"AAeA;;;;;EAyDC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maybe-category-panel.d.ts","sourceRoot":"","sources":["../../../src/components/post-publish-panel/maybe-category-panel.js"],"names":[],"mappings":";AAeA,
|
|
1
|
+
{"version":3,"file":"maybe-category-panel.d.ts","sourceRoot":"","sources":["../../../src/components/post-publish-panel/maybe-category-panel.js"],"names":[],"mappings":";AAeA,0EAqEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maybe-tags-panel.d.ts","sourceRoot":"","sources":["../../../src/components/post-publish-panel/maybe-tags-panel.js"],"names":[],"mappings":";AAmCA,
|
|
1
|
+
{"version":3,"file":"maybe-tags-panel.d.ts","sourceRoot":"","sources":["../../../src/components/post-publish-panel/maybe-tags-panel.js"],"names":[],"mappings":";AAmCA,sEAyCC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/components/post-taxonomies/check.js"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,0DAJG;IAA+B,QAAQ,EAA/B,KAAK,CAAC,SAAS;CAEvB,GAAS,KAAK,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/components/post-taxonomies/check.js"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,0DAJG;IAA+B,QAAQ,EAA/B,KAAK,CAAC,SAAS;CAEvB,GAAS,KAAK,CAAC,SAAS,CAmB1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flat-term-selector.d.ts","sourceRoot":"","sources":["../../../src/components/post-taxonomies/flat-term-selector.js"],"names":[],"mappings":"AAkEA;;;;;;;;GAQG;AACH,oEALG;IAAuB,IAAI,EAAnB,MAAM;IACS,uBAAuB,EAAtC,OAAO;CAEf,GAAS,KAAK,CAAC,SAAS,CAwP1B;;;;;;;yBAzRW,OAAO;;wJASX,CAAC;4BAGJ,CAAC;;;;kCAOM,OAAO;;6BACJ,CAAC;yBAId,CAAC,iCAGwB,OAAO;+BAEgB,CAAV;0BACY,CAAC,2DACjB,CAAC;0BAAwC,CAAC;iCAA2C,CAAC;iCAA2C,CAAC;wCAEtJ,CAAC;2BAEE,CAAC;kCAET,CAAC;;;;;yBAK4C,OAAO;;wJAI8E,CAAC;4BAS5I,CAAC;;;;kCAMM,OAAO;;6BAC8B,CAAC;
|
|
1
|
+
{"version":3,"file":"flat-term-selector.d.ts","sourceRoot":"","sources":["../../../src/components/post-taxonomies/flat-term-selector.js"],"names":[],"mappings":"AAkEA;;;;;;;;GAQG;AACH,oEALG;IAAuB,IAAI,EAAnB,MAAM;IACS,uBAAuB,EAAtC,OAAO;CAEf,GAAS,KAAK,CAAC,SAAS,CAwP1B;;;;;;;yBAzRW,OAAO;;wJASX,CAAC;4BAGJ,CAAC;;;;kCAOM,OAAO;;6BACJ,CAAC;yBAId,CAAC,iCAGwB,OAAO;+BAEgB,CAAV;0BACY,CAAC,2DACjB,CAAC;0BAAwC,CAAC;iCAA2C,CAAC;iCAA2C,CAAC;wCAEtJ,CAAC;2BAEE,CAAC;kCAET,CAAC;;;;;yBAK4C,OAAO;;wJAI8E,CAAC;4BAS5I,CAAC;;;;kCAMM,OAAO;;6BAC8B,CAAC;yBAG1B,CAAA,iCAAiC,OAAO;+BAE7C,CAAC;0BAIR,CAAC,2DAEC,CAAC;0BAIG,CAAC;iCAET,CAAA;iCACA,CAAL;wCAIM,CAAC;2BAGH,CAAC;kCAGkC,CAAC;;yBAG5B,OACV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-taxonomies/index.js"],"names":[],"mappings":"AAgBA;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-taxonomies/index.js"],"names":[],"mappings":"AAgBA;;kCAsCC"}
|
|
@@ -3,6 +3,6 @@ export function useEditedPostContext(): {
|
|
|
3
3
|
postType: string;
|
|
4
4
|
};
|
|
5
5
|
export function useAllowSwitchingTemplates(): boolean;
|
|
6
|
-
export function useAvailableTemplates(postType: any): false | (import("@wordpress/core-data").UnstableBase<any> | import("@wordpress/core-data").Attachment<any> | import("@wordpress/core-data").Comment<any> | import("@wordpress/core-data").GlobalStylesRevision<any> | import("@wordpress/core-data").MenuLocation<any> | import("@wordpress/core-data").NavMenu<any> | import("@wordpress/core-data").NavMenuItem<any> | import("@wordpress/core-data").Page<any> | import("@wordpress/core-data").Plugin<any> | import("@wordpress/core-data").Post<any> | import("@wordpress/core-data").PostStatusObject<any> | import("@wordpress/core-data").PostRevision<any> | import("@wordpress/core-data").Settings<any> | import("@wordpress/core-data").Sidebar<any> | import("@wordpress/core-data").Taxonomy<any> | import("@wordpress/core-data").Theme<any> | import("@wordpress/core-data").User<any> | import("@wordpress/core-data").Type<any> | import("@wordpress/core-data").Widget<any> | import("@wordpress/core-data").WidgetType<any> | import("@wordpress/core-data").WpTemplate<any> | import("@wordpress/core-data").WpTemplatePart<any> | Partial<import("@wordpress/core-data").UnstableBase<any> | import("@wordpress/core-data").Attachment<any> | import("@wordpress/core-data").Comment<any> | import("@wordpress/core-data").GlobalStylesRevision<any> | import("@wordpress/core-data").MenuLocation<any> | import("@wordpress/core-data").NavMenu<any> | import("@wordpress/core-data").NavMenuItem<any> | import("@wordpress/core-data").Page<any> | import("@wordpress/core-data").Plugin<any> | import("@wordpress/core-data").Post<any> | import("@wordpress/core-data").PostStatusObject<any> | import("@wordpress/core-data").PostRevision<any> | import("@wordpress/core-data").Settings<any> | import("@wordpress/core-data").Sidebar<any> | import("@wordpress/core-data").Taxonomy<any> | import("@wordpress/core-data").Theme<any> | import("@wordpress/core-data").User<any> | import("@wordpress/core-data").Type<any> | import("@wordpress/core-data").Widget<any> | import("@wordpress/core-data").WidgetType<any> | import("@wordpress/core-data").WpTemplate<any> | import("@wordpress/core-data").WpTemplatePart<any>>)[] | undefined;
|
|
6
|
+
export function useAvailableTemplates(postType: any): false | (import("@wordpress/core-data").UnstableBase<any> | import("@wordpress/core-data").Attachment<any> | import("@wordpress/core-data").Comment<any> | import("@wordpress/core-data").GlobalStylesRevision<any> | import("@wordpress/core-data").MenuLocation<any> | import("@wordpress/core-data").NavMenu<any> | import("@wordpress/core-data").NavMenuItem<any> | import("@wordpress/core-data").Page<any> | import("@wordpress/core-data").Plugin<any> | import("@wordpress/core-data").Post<any> | import("@wordpress/core-data").PostStatusObject<any> | import("@wordpress/core-data").PostRevision<any> | import("@wordpress/core-data").Settings<any> | import("@wordpress/core-data").Sidebar<any> | import("@wordpress/core-data").Taxonomy<any> | import("@wordpress/core-data").Term<any> | import("@wordpress/core-data").Theme<any> | import("@wordpress/core-data").User<any> | import("@wordpress/core-data").Type<any> | import("@wordpress/core-data").Widget<any> | import("@wordpress/core-data").WidgetType<any> | import("@wordpress/core-data").WpTemplate<any> | import("@wordpress/core-data").WpTemplatePart<any> | Partial<import("@wordpress/core-data").UnstableBase<any> | import("@wordpress/core-data").Attachment<any> | import("@wordpress/core-data").Comment<any> | import("@wordpress/core-data").GlobalStylesRevision<any> | import("@wordpress/core-data").MenuLocation<any> | import("@wordpress/core-data").NavMenu<any> | import("@wordpress/core-data").NavMenuItem<any> | import("@wordpress/core-data").Page<any> | import("@wordpress/core-data").Plugin<any> | import("@wordpress/core-data").Post<any> | import("@wordpress/core-data").PostStatusObject<any> | import("@wordpress/core-data").PostRevision<any> | import("@wordpress/core-data").Settings<any> | import("@wordpress/core-data").Sidebar<any> | import("@wordpress/core-data").Taxonomy<any> | import("@wordpress/core-data").Term<any> | import("@wordpress/core-data").Theme<any> | import("@wordpress/core-data").User<any> | import("@wordpress/core-data").Type<any> | import("@wordpress/core-data").Widget<any> | import("@wordpress/core-data").WidgetType<any> | import("@wordpress/core-data").WpTemplate<any> | import("@wordpress/core-data").WpTemplatePart<any>>)[] | undefined;
|
|
7
7
|
export function useCurrentTemplateSlug(): any;
|
|
8
8
|
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/components/post-template/hooks.js"],"names":[],"mappings":"AAYA;;;EAQC;AACD,sDA0BC;AAaD,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/components/post-template/hooks.js"],"names":[],"mappings":"AAYA;;;EAQC;AACD,sDA0BC;AAaD,yuEAeC;AAED,8CAuBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-apis.d.ts","sourceRoot":"","sources":["../src/private-apis.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"private-apis.d.ts","sourceRoot":"","sources":["../src/private-apis.js"],"names":[],"mappings":"AAmCA,6BAA8B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.18.0",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -34,41 +34,41 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/runtime": "7.25.7",
|
|
37
|
-
"@wordpress/a11y": "^4.
|
|
38
|
-
"@wordpress/api-fetch": "^7.
|
|
39
|
-
"@wordpress/blob": "^4.
|
|
40
|
-
"@wordpress/block-editor": "^14.
|
|
41
|
-
"@wordpress/blocks": "^14.
|
|
42
|
-
"@wordpress/commands": "^1.
|
|
43
|
-
"@wordpress/components": "^29.
|
|
44
|
-
"@wordpress/compose": "^7.
|
|
45
|
-
"@wordpress/core-data": "^7.
|
|
46
|
-
"@wordpress/data": "^10.
|
|
47
|
-
"@wordpress/dataviews": "^4.
|
|
48
|
-
"@wordpress/date": "^5.
|
|
49
|
-
"@wordpress/deprecated": "^4.
|
|
50
|
-
"@wordpress/dom": "^4.
|
|
51
|
-
"@wordpress/element": "^6.
|
|
52
|
-
"@wordpress/fields": "^0.
|
|
53
|
-
"@wordpress/hooks": "^4.
|
|
54
|
-
"@wordpress/html-entities": "^4.
|
|
55
|
-
"@wordpress/i18n": "^5.
|
|
56
|
-
"@wordpress/icons": "^10.
|
|
57
|
-
"@wordpress/interface": "^9.
|
|
58
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
59
|
-
"@wordpress/keycodes": "^4.
|
|
60
|
-
"@wordpress/media-utils": "^5.
|
|
61
|
-
"@wordpress/notices": "^5.
|
|
62
|
-
"@wordpress/patterns": "^2.
|
|
63
|
-
"@wordpress/plugins": "^7.
|
|
64
|
-
"@wordpress/preferences": "^4.
|
|
65
|
-
"@wordpress/private-apis": "^1.
|
|
66
|
-
"@wordpress/reusable-blocks": "^5.
|
|
67
|
-
"@wordpress/rich-text": "^7.
|
|
68
|
-
"@wordpress/server-side-render": "^5.
|
|
69
|
-
"@wordpress/url": "^4.
|
|
70
|
-
"@wordpress/warning": "^3.
|
|
71
|
-
"@wordpress/wordcount": "^4.
|
|
37
|
+
"@wordpress/a11y": "^4.18.0",
|
|
38
|
+
"@wordpress/api-fetch": "^7.18.0",
|
|
39
|
+
"@wordpress/blob": "^4.18.0",
|
|
40
|
+
"@wordpress/block-editor": "^14.13.0",
|
|
41
|
+
"@wordpress/blocks": "^14.7.0",
|
|
42
|
+
"@wordpress/commands": "^1.18.0",
|
|
43
|
+
"@wordpress/components": "^29.4.0",
|
|
44
|
+
"@wordpress/compose": "^7.18.0",
|
|
45
|
+
"@wordpress/core-data": "^7.18.0",
|
|
46
|
+
"@wordpress/data": "^10.18.0",
|
|
47
|
+
"@wordpress/dataviews": "^4.14.0",
|
|
48
|
+
"@wordpress/date": "^5.18.0",
|
|
49
|
+
"@wordpress/deprecated": "^4.18.0",
|
|
50
|
+
"@wordpress/dom": "^4.18.0",
|
|
51
|
+
"@wordpress/element": "^6.18.0",
|
|
52
|
+
"@wordpress/fields": "^0.10.0",
|
|
53
|
+
"@wordpress/hooks": "^4.18.0",
|
|
54
|
+
"@wordpress/html-entities": "^4.18.0",
|
|
55
|
+
"@wordpress/i18n": "^5.18.0",
|
|
56
|
+
"@wordpress/icons": "^10.18.0",
|
|
57
|
+
"@wordpress/interface": "^9.3.0",
|
|
58
|
+
"@wordpress/keyboard-shortcuts": "^5.18.0",
|
|
59
|
+
"@wordpress/keycodes": "^4.18.0",
|
|
60
|
+
"@wordpress/media-utils": "^5.18.0",
|
|
61
|
+
"@wordpress/notices": "^5.18.0",
|
|
62
|
+
"@wordpress/patterns": "^2.18.0",
|
|
63
|
+
"@wordpress/plugins": "^7.18.0",
|
|
64
|
+
"@wordpress/preferences": "^4.18.0",
|
|
65
|
+
"@wordpress/private-apis": "^1.18.0",
|
|
66
|
+
"@wordpress/reusable-blocks": "^5.18.0",
|
|
67
|
+
"@wordpress/rich-text": "^7.18.0",
|
|
68
|
+
"@wordpress/server-side-render": "^5.18.0",
|
|
69
|
+
"@wordpress/url": "^4.18.0",
|
|
70
|
+
"@wordpress/warning": "^3.18.0",
|
|
71
|
+
"@wordpress/wordcount": "^4.18.0",
|
|
72
72
|
"change-case": "^4.1.2",
|
|
73
73
|
"client-zip": "^2.4.5",
|
|
74
74
|
"clsx": "^2.1.1",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"access": "public"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "afe4fb333177642180ac020f1030c5685eab7183"
|
|
92
92
|
}
|
|
@@ -31,12 +31,17 @@ function Editor( {
|
|
|
31
31
|
extraSidebarPanels,
|
|
32
32
|
...props
|
|
33
33
|
} ) {
|
|
34
|
-
const { post, template, hasLoadedPost } = useSelect(
|
|
34
|
+
const { post, template, hasLoadedPost, error } = useSelect(
|
|
35
35
|
( select ) => {
|
|
36
|
-
const {
|
|
37
|
-
|
|
36
|
+
const {
|
|
37
|
+
getEntityRecord,
|
|
38
|
+
getResolutionError,
|
|
39
|
+
hasFinishedResolution,
|
|
40
|
+
} = select( coreStore );
|
|
41
|
+
|
|
42
|
+
const postArgs = [ 'postType', postType, postId ];
|
|
38
43
|
return {
|
|
39
|
-
post: getEntityRecord(
|
|
44
|
+
post: getEntityRecord( ...postArgs ),
|
|
40
45
|
template: templateId
|
|
41
46
|
? getEntityRecord(
|
|
42
47
|
'postType',
|
|
@@ -44,11 +49,12 @@ function Editor( {
|
|
|
44
49
|
templateId
|
|
45
50
|
)
|
|
46
51
|
: undefined,
|
|
47
|
-
hasLoadedPost: hasFinishedResolution(
|
|
48
|
-
'
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
hasLoadedPost: hasFinishedResolution(
|
|
53
|
+
'getEntityRecord',
|
|
54
|
+
postArgs
|
|
55
|
+
),
|
|
56
|
+
error: getResolutionError( 'getEntityRecord', postArgs )
|
|
57
|
+
?.message,
|
|
52
58
|
};
|
|
53
59
|
},
|
|
54
60
|
[ postType, postId, templateId ]
|
|
@@ -57,10 +63,15 @@ function Editor( {
|
|
|
57
63
|
return (
|
|
58
64
|
<>
|
|
59
65
|
{ hasLoadedPost && ! post && (
|
|
60
|
-
<Notice
|
|
61
|
-
{
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
<Notice
|
|
67
|
+
status={ !! error ? 'error' : 'warning' }
|
|
68
|
+
isDismissible={ false }
|
|
69
|
+
>
|
|
70
|
+
{ ! error
|
|
71
|
+
? __(
|
|
72
|
+
"You attempted to edit an item that doesn't exist. Perhaps it was deleted?"
|
|
73
|
+
)
|
|
74
|
+
: error }
|
|
64
75
|
</Notice>
|
|
65
76
|
) }
|
|
66
77
|
{ !! post && (
|
|
@@ -61,47 +61,63 @@ export const getItemPriority = ( name, searchValue ) => {
|
|
|
61
61
|
export function PageAttributesParent() {
|
|
62
62
|
const { editPost } = useDispatch( editorStore );
|
|
63
63
|
const [ fieldValue, setFieldValue ] = useState( false );
|
|
64
|
-
const {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
64
|
+
const {
|
|
65
|
+
isHierarchical,
|
|
66
|
+
parentPostId,
|
|
67
|
+
parentPostTitle,
|
|
68
|
+
pageItems,
|
|
69
|
+
isLoading,
|
|
70
|
+
} = useSelect(
|
|
71
|
+
( select ) => {
|
|
72
|
+
const {
|
|
73
|
+
getPostType,
|
|
74
|
+
getEntityRecords,
|
|
75
|
+
getEntityRecord,
|
|
76
|
+
isResolving,
|
|
77
|
+
} = select( coreStore );
|
|
78
|
+
const { getCurrentPostId, getEditedPostAttribute } =
|
|
79
|
+
select( editorStore );
|
|
80
|
+
const postTypeSlug = getEditedPostAttribute( 'type' );
|
|
81
|
+
const pageId = getEditedPostAttribute( 'parent' );
|
|
82
|
+
const pType = getPostType( postTypeSlug );
|
|
83
|
+
const postId = getCurrentPostId();
|
|
84
|
+
const postIsHierarchical = pType?.hierarchical ?? false;
|
|
85
|
+
const query = {
|
|
86
|
+
per_page: 100,
|
|
87
|
+
exclude: postId,
|
|
88
|
+
parent_exclude: postId,
|
|
89
|
+
orderby: 'menu_order',
|
|
90
|
+
order: 'asc',
|
|
91
|
+
_fields: 'id,title,parent',
|
|
92
|
+
};
|
|
84
93
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
94
|
+
// Perform a search when the field is changed.
|
|
95
|
+
if ( !! fieldValue ) {
|
|
96
|
+
query.search = fieldValue;
|
|
97
|
+
}
|
|
89
98
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
const parentPost = pageId
|
|
100
|
+
? getEntityRecord( 'postType', postTypeSlug, pageId )
|
|
101
|
+
: null;
|
|
93
102
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
return {
|
|
104
|
+
isHierarchical: postIsHierarchical,
|
|
105
|
+
parentPostId: pageId,
|
|
106
|
+
parentPostTitle: parentPost ? getTitle( parentPost ) : '',
|
|
107
|
+
pageItems: postIsHierarchical
|
|
108
|
+
? getEntityRecords( 'postType', postTypeSlug, query )
|
|
109
|
+
: null,
|
|
110
|
+
isLoading: postIsHierarchical
|
|
111
|
+
? isResolving( 'getEntityRecords', [
|
|
112
|
+
'postType',
|
|
113
|
+
postTypeSlug,
|
|
114
|
+
query,
|
|
115
|
+
] )
|
|
116
|
+
: false,
|
|
117
|
+
};
|
|
118
|
+
},
|
|
119
|
+
[ fieldValue ]
|
|
120
|
+
);
|
|
105
121
|
|
|
106
122
|
const parentOptions = useMemo( () => {
|
|
107
123
|
const getOptionsFromTree = ( tree, level = 0 ) => {
|
|
@@ -187,6 +203,7 @@ export function PageAttributesParent() {
|
|
|
187
203
|
onFilterValueChange={ debounce( handleKeydown, 300 ) }
|
|
188
204
|
onChange={ handleChange }
|
|
189
205
|
hideLabelFromVision
|
|
206
|
+
isLoading={ isLoading }
|
|
190
207
|
/>
|
|
191
208
|
);
|
|
192
209
|
}
|
|
@@ -23,11 +23,14 @@ import { AUTHORS_QUERY } from './constants';
|
|
|
23
23
|
export default function PostAuthorCheck( { children } ) {
|
|
24
24
|
const { hasAssignAuthorAction, hasAuthors } = useSelect( ( select ) => {
|
|
25
25
|
const post = select( editorStore ).getCurrentPost();
|
|
26
|
-
const
|
|
26
|
+
const canAssignAuthor = post?._links?.[ 'wp:action-assign-author' ]
|
|
27
|
+
? true
|
|
28
|
+
: false;
|
|
27
29
|
return {
|
|
28
|
-
hasAssignAuthorAction:
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
hasAssignAuthorAction: canAssignAuthor,
|
|
31
|
+
hasAuthors: canAssignAuthor
|
|
32
|
+
? select( coreStore ).getUsers( AUTHORS_QUERY )?.length >= 1
|
|
33
|
+
: false,
|
|
31
34
|
};
|
|
32
35
|
}, [] );
|
|
33
36
|
|
|
@@ -17,7 +17,8 @@ export default function PostAuthorCombobox() {
|
|
|
17
17
|
const [ fieldValue, setFieldValue ] = useState();
|
|
18
18
|
|
|
19
19
|
const { editPost } = useDispatch( editorStore );
|
|
20
|
-
const { authorId, authorOptions } =
|
|
20
|
+
const { authorId, authorOptions, isLoading } =
|
|
21
|
+
useAuthorsQuery( fieldValue );
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* Handle author selection.
|
|
@@ -51,6 +52,7 @@ export default function PostAuthorCombobox() {
|
|
|
51
52
|
onChange={ handleSelect }
|
|
52
53
|
allowReset={ false }
|
|
53
54
|
hideLabelFromVision
|
|
55
|
+
isLoading={ isLoading }
|
|
54
56
|
/>
|
|
55
57
|
);
|
|
56
58
|
}
|
|
@@ -14,9 +14,9 @@ import { store as editorStore } from '../../store';
|
|
|
14
14
|
import { AUTHORS_QUERY, BASE_QUERY } from './constants';
|
|
15
15
|
|
|
16
16
|
export function useAuthorsQuery( search ) {
|
|
17
|
-
const { authorId, authors, postAuthor } = useSelect(
|
|
17
|
+
const { authorId, authors, postAuthor, isLoading } = useSelect(
|
|
18
18
|
( select ) => {
|
|
19
|
-
const { getUser, getUsers } = select( coreStore );
|
|
19
|
+
const { getUser, getUsers, isResolving } = select( coreStore );
|
|
20
20
|
const { getEditedPostAttribute } = select( editorStore );
|
|
21
21
|
const _authorId = getEditedPostAttribute( 'author' );
|
|
22
22
|
const query = { ...AUTHORS_QUERY };
|
|
@@ -30,6 +30,7 @@ export function useAuthorsQuery( search ) {
|
|
|
30
30
|
authorId: _authorId,
|
|
31
31
|
authors: getUsers( query ),
|
|
32
32
|
postAuthor: getUser( _authorId, BASE_QUERY ),
|
|
33
|
+
isLoading: isResolving( 'getUsers', [ query ] ),
|
|
33
34
|
};
|
|
34
35
|
},
|
|
35
36
|
[ search ]
|
|
@@ -68,5 +69,5 @@ export function useAuthorsQuery( search ) {
|
|
|
68
69
|
return [ ...currentAuthor, ...fetchedAuthors ];
|
|
69
70
|
}, [ authors, postAuthor ] );
|
|
70
71
|
|
|
71
|
-
return { authorId, authorOptions, postAuthor };
|
|
72
|
+
return { authorId, authorOptions, postAuthor, isLoading };
|
|
72
73
|
}
|
|
@@ -16,8 +16,12 @@ import { store as editorStore } from '../../store';
|
|
|
16
16
|
function MaybeCategoryPanel() {
|
|
17
17
|
const hasNoCategory = useSelect( ( select ) => {
|
|
18
18
|
const postType = select( editorStore ).getCurrentPostType();
|
|
19
|
-
const { canUser, getEntityRecord
|
|
20
|
-
const categoriesTaxonomy =
|
|
19
|
+
const { canUser, getEntityRecord } = select( coreStore );
|
|
20
|
+
const categoriesTaxonomy = getEntityRecord(
|
|
21
|
+
'root',
|
|
22
|
+
'taxonomy',
|
|
23
|
+
'category'
|
|
24
|
+
);
|
|
21
25
|
const defaultCategoryId = canUser( 'read', {
|
|
22
26
|
kind: 'root',
|
|
23
27
|
name: 'site',
|
|
@@ -36,7 +36,11 @@ const TagsPanel = () => {
|
|
|
36
36
|
const MaybeTagsPanel = () => {
|
|
37
37
|
const { hasTags, isPostTypeSupported } = useSelect( ( select ) => {
|
|
38
38
|
const postType = select( editorStore ).getCurrentPostType();
|
|
39
|
-
const tagsTaxonomy = select( coreStore ).
|
|
39
|
+
const tagsTaxonomy = select( coreStore ).getEntityRecord(
|
|
40
|
+
'root',
|
|
41
|
+
'taxonomy',
|
|
42
|
+
'post_tag'
|
|
43
|
+
);
|
|
40
44
|
const _isPostTypeSupported = tagsTaxonomy?.types?.includes( postType );
|
|
41
45
|
const areTagsFetched = tagsTaxonomy !== undefined;
|
|
42
46
|
const tags =
|
|
@@ -20,9 +20,11 @@ import { store as editorStore } from '../../store';
|
|
|
20
20
|
export default function PostTaxonomiesCheck( { children } ) {
|
|
21
21
|
const hasTaxonomies = useSelect( ( select ) => {
|
|
22
22
|
const postType = select( editorStore ).getCurrentPostType();
|
|
23
|
-
const taxonomies = select( coreStore ).
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const taxonomies = select( coreStore ).getEntityRecords(
|
|
24
|
+
'root',
|
|
25
|
+
'taxonomy',
|
|
26
|
+
{ per_page: -1 }
|
|
27
|
+
);
|
|
26
28
|
return taxonomies?.some( ( taxonomy ) =>
|
|
27
29
|
taxonomy.types.includes( postType )
|
|
28
30
|
);
|
|
@@ -100,10 +100,10 @@ export function FlatTermSelector( { slug, __nextHasNoMarginBottom } ) {
|
|
|
100
100
|
( select ) => {
|
|
101
101
|
const { getCurrentPost, getEditedPostAttribute } =
|
|
102
102
|
select( editorStore );
|
|
103
|
-
const { getEntityRecords,
|
|
103
|
+
const { getEntityRecords, getEntityRecord, hasFinishedResolution } =
|
|
104
104
|
select( coreStore );
|
|
105
105
|
const post = getCurrentPost();
|
|
106
|
-
const _taxonomy =
|
|
106
|
+
const _taxonomy = getEntityRecord( 'root', 'taxonomy', slug );
|
|
107
107
|
const _termIds = _taxonomy
|
|
108
108
|
? getEditedPostAttribute( _taxonomy.rest_base )
|
|
109
109
|
: EMPTY_ARRAY;
|
|
@@ -175,9 +175,9 @@ export function HierarchicalTermSelector( { slug } ) {
|
|
|
175
175
|
( select ) => {
|
|
176
176
|
const { getCurrentPost, getEditedPostAttribute } =
|
|
177
177
|
select( editorStore );
|
|
178
|
-
const {
|
|
178
|
+
const { getEntityRecord, getEntityRecords, isResolving } =
|
|
179
179
|
select( coreStore );
|
|
180
|
-
const _taxonomy =
|
|
180
|
+
const _taxonomy = getEntityRecord( 'root', 'taxonomy', slug );
|
|
181
181
|
const post = getCurrentPost();
|
|
182
182
|
|
|
183
183
|
return {
|
|
@@ -18,7 +18,11 @@ export function PostTaxonomies( { taxonomyWrapper = identity } ) {
|
|
|
18
18
|
const { postType, taxonomies } = useSelect( ( select ) => {
|
|
19
19
|
return {
|
|
20
20
|
postType: select( editorStore ).getCurrentPostType(),
|
|
21
|
-
taxonomies: select( coreStore ).
|
|
21
|
+
taxonomies: select( coreStore ).getEntityRecords(
|
|
22
|
+
'root',
|
|
23
|
+
'taxonomy',
|
|
24
|
+
{ per_page: -1 }
|
|
25
|
+
),
|
|
22
26
|
};
|
|
23
27
|
}, [] );
|
|
24
28
|
const visibleTaxonomies = ( taxonomies ?? [] ).filter(
|
|
@@ -44,6 +44,19 @@ describe( 'PostTaxonomies', () => {
|
|
|
44
44
|
},
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
+
const allTaxonomies = [ genresTaxonomy, categoriesTaxonomy ];
|
|
48
|
+
|
|
49
|
+
const hidesUI = [
|
|
50
|
+
genresTaxonomy,
|
|
51
|
+
{
|
|
52
|
+
...categoriesTaxonomy,
|
|
53
|
+
types: [ 'post', 'page', 'book' ],
|
|
54
|
+
visibility: {
|
|
55
|
+
show_ui: false,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
|
|
47
60
|
beforeEach( () => {
|
|
48
61
|
jest.spyOn( select( editorStore ), 'getCurrentPost' ).mockReturnValue( {
|
|
49
62
|
_links: {
|
|
@@ -70,8 +83,8 @@ describe( 'PostTaxonomies', () => {
|
|
|
70
83
|
},
|
|
71
84
|
} );
|
|
72
85
|
|
|
73
|
-
jest.spyOn( select( coreStore ), '
|
|
74
|
-
( slug ) => {
|
|
86
|
+
jest.spyOn( select( coreStore ), 'getEntityRecord' ).mockImplementation(
|
|
87
|
+
( kind, name, slug ) => {
|
|
75
88
|
switch ( slug ) {
|
|
76
89
|
case 'category': {
|
|
77
90
|
return categoriesTaxonomy;
|
|
@@ -91,8 +104,11 @@ describe( 'PostTaxonomies', () => {
|
|
|
91
104
|
select( editorStore ),
|
|
92
105
|
'getCurrentPostType'
|
|
93
106
|
).mockReturnValue( 'page' );
|
|
94
|
-
jest.spyOn(
|
|
95
|
-
|
|
107
|
+
jest.spyOn(
|
|
108
|
+
select( coreStore ),
|
|
109
|
+
'getEntityRecords'
|
|
110
|
+
).mockImplementation( ( kind, name ) =>
|
|
111
|
+
kind === 'root' && name === 'taxonomy' ? taxonomies : null
|
|
96
112
|
);
|
|
97
113
|
|
|
98
114
|
const { container } = render( <PostTaxonomies /> );
|
|
@@ -105,10 +121,12 @@ describe( 'PostTaxonomies', () => {
|
|
|
105
121
|
select( editorStore ),
|
|
106
122
|
'getCurrentPostType'
|
|
107
123
|
).mockReturnValue( 'book' );
|
|
108
|
-
jest.spyOn(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
124
|
+
jest.spyOn(
|
|
125
|
+
select( coreStore ),
|
|
126
|
+
'getEntityRecords'
|
|
127
|
+
).mockImplementation( ( kind, name ) =>
|
|
128
|
+
kind === 'root' && name === 'taxonomy' ? allTaxonomies : null
|
|
129
|
+
);
|
|
112
130
|
|
|
113
131
|
render( <PostTaxonomies /> );
|
|
114
132
|
|
|
@@ -129,16 +147,12 @@ describe( 'PostTaxonomies', () => {
|
|
|
129
147
|
select( editorStore ),
|
|
130
148
|
'getCurrentPostType'
|
|
131
149
|
).mockReturnValue( 'book' );
|
|
132
|
-
jest.spyOn(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
show_ui: false,
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
] );
|
|
150
|
+
jest.spyOn(
|
|
151
|
+
select( coreStore ),
|
|
152
|
+
'getEntityRecords'
|
|
153
|
+
).mockImplementation( ( kind, name ) =>
|
|
154
|
+
kind === 'root' && name === 'taxonomy' ? hidesUI : null
|
|
155
|
+
);
|
|
142
156
|
|
|
143
157
|
render( <PostTaxonomies /> );
|
|
144
158
|
|