@wordpress/editor 13.26.0 → 13.27.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/index.js +20 -0
- package/build/bindings/index.js.map +1 -0
- package/build/bindings/post-meta.js +52 -0
- package/build/bindings/post-meta.js.map +1 -0
- package/build/components/block-manager/category.js +106 -0
- package/build/components/block-manager/category.js.map +1 -0
- package/build/components/block-manager/checklist.js +35 -0
- package/build/components/block-manager/checklist.js.map +1 -0
- package/build/components/block-manager/index.js +130 -0
- package/build/components/block-manager/index.js.map +1 -0
- package/build/components/document-tools/index.js +58 -52
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-canvas/index.js +4 -4
- package/build/components/editor-canvas/index.js.map +1 -1
- package/build/components/editor-notices/index.js +11 -11
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +38 -7
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/index.js +1 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/offline-status/index.native.js +1 -3
- package/build/components/offline-status/index.native.js.map +1 -1
- package/build/components/post-locked-modal/index.js +1 -1
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-saved-state/index.js +10 -24
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/check.js +5 -16
- package/build/components/post-schedule/check.js.map +1 -1
- package/build/components/preferences-modal/enable-panel.js +42 -0
- package/build/components/preferences-modal/enable-panel.js.map +1 -0
- package/build/components/preferences-modal/enable-plugin-document-setting-panel.js +33 -0
- package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -0
- package/build/components/preferences-modal/index.js +186 -0
- package/build/components/preferences-modal/index.js.map +1 -0
- package/build/components/provider/disable-non-page-content-blocks.js +1 -4
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +34 -8
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/hooks/pattern-partial-syncing.js +12 -8
- package/build/hooks/pattern-partial-syncing.js.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/private-apis.js +6 -2
- package/build/private-apis.js.map +1 -1
- package/build/store/defaults.js +2 -0
- package/build/store/defaults.js.map +1 -1
- package/build/store/private-actions.js +33 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +1 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build-module/bindings/index.js +15 -0
- package/build-module/bindings/index.js.map +1 -0
- package/build-module/bindings/post-meta.js +45 -0
- package/build-module/bindings/post-meta.js.map +1 -0
- package/build-module/components/block-manager/category.js +97 -0
- package/build-module/components/block-manager/category.js.map +1 -0
- package/build-module/components/block-manager/checklist.js +27 -0
- package/build-module/components/block-manager/checklist.js.map +1 -0
- package/build-module/components/block-manager/index.js +121 -0
- package/build-module/components/block-manager/index.js.map +1 -0
- package/build-module/components/document-tools/index.js +58 -52
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-canvas/index.js +4 -4
- package/build-module/components/editor-canvas/index.js.map +1 -1
- package/build-module/components/editor-notices/index.js +12 -12
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +39 -8
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +1 -1
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/offline-status/index.native.js +1 -3
- package/build-module/components/offline-status/index.native.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +1 -1
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +11 -25
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/check.js +6 -15
- package/build-module/components/post-schedule/check.js.map +1 -1
- package/build-module/components/preferences-modal/enable-panel.js +34 -0
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -0
- package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js +24 -0
- package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +179 -0
- package/build-module/components/preferences-modal/index.js.map +1 -0
- package/build-module/components/provider/disable-non-page-content-blocks.js +1 -4
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +35 -9
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/hooks/pattern-partial-syncing.js +12 -8
- package/build-module/hooks/pattern-partial-syncing.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/private-apis.js +6 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/defaults.js +2 -0
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/private-actions.js +29 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +1 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-style/style-rtl.css +80 -12
- package/build-style/style.css +80 -12
- package/package.json +33 -33
- package/src/bindings/index.js +13 -0
- package/src/bindings/post-meta.js +42 -0
- package/src/components/block-manager/category.js +96 -0
- package/src/components/block-manager/checklist.js +30 -0
- package/src/components/block-manager/index.js +160 -0
- package/src/components/block-manager/style.scss +82 -0
- package/src/components/document-tools/index.js +9 -1
- package/src/components/editor-canvas/index.js +3 -2
- package/src/components/editor-notices/index.js +11 -12
- package/src/components/editor-notices/style.scss +0 -1
- package/src/components/entities-saved-states/entity-type-list.js +47 -5
- package/src/components/entities-saved-states/index.js +7 -7
- package/src/components/entities-saved-states/style.scss +4 -0
- package/src/components/offline-status/index.native.js +2 -4
- package/src/components/post-locked-modal/index.js +1 -1
- package/src/components/post-locked-modal/style.scss +0 -6
- package/src/components/post-saved-state/index.js +30 -47
- package/src/components/post-schedule/check.js +10 -14
- package/src/components/post-schedule/test/check.js +24 -9
- package/src/components/preferences-modal/enable-panel.js +30 -0
- package/src/components/preferences-modal/enable-plugin-document-setting-panel.js +23 -0
- package/src/components/preferences-modal/index.js +269 -0
- package/src/components/preferences-modal/test/index.js +28 -0
- package/src/components/provider/disable-non-page-content-blocks.js +3 -3
- package/src/components/provider/use-block-editor-settings.js +45 -17
- package/src/hooks/pattern-partial-syncing.js +26 -29
- package/src/index.js +1 -0
- package/src/private-apis.js +6 -2
- package/src/store/defaults.js +2 -0
- package/src/store/private-actions.js +49 -0
- package/src/store/private-selectors.js +1 -1
- package/src/style.scss +1 -1
- package/src/components/editor-canvas/style.scss +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EditorCanvas","ExperimentalEditorProvider","lock","EntitiesSavedStatesExtensible","useBlockEditorSettings","DocumentTools","InserterSidebar","ListViewSidebar","PostPanelRow","PostViewLink","PreviewDropdown","
|
|
1
|
+
{"version":3,"names":["EditorCanvas","ExperimentalEditorProvider","lock","EnablePluginDocumentSettingPanelOption","EntitiesSavedStatesExtensible","useBlockEditorSettings","DocumentTools","InserterSidebar","ListViewSidebar","PluginPostExcerpt","PostPanelRow","PostViewLink","PreviewDropdown","PreferencesModal","privateApis"],"sources":["@wordpress/editor/src/private-apis.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport EditorCanvas from './components/editor-canvas';\nimport { ExperimentalEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport EnablePluginDocumentSettingPanelOption from './components/preferences-modal/enable-plugin-document-setting-panel';\nimport { EntitiesSavedStatesExtensible } from './components/entities-saved-states';\nimport useBlockEditorSettings from './components/provider/use-block-editor-settings';\nimport DocumentTools from './components/document-tools';\nimport InserterSidebar from './components/inserter-sidebar';\nimport ListViewSidebar from './components/list-view-sidebar';\nimport PluginPostExcerpt from './components/post-excerpt/plugin';\nimport PostPanelRow from './components/post-panel-row';\nimport PostViewLink from './components/post-view-link';\nimport PreviewDropdown from './components/preview-dropdown';\nimport PreferencesModal from './components/preferences-modal';\n\nexport const privateApis = {};\nlock( privateApis, {\n\tDocumentTools,\n\tEditorCanvas,\n\tExperimentalEditorProvider,\n\tEnablePluginDocumentSettingPanelOption,\n\tEntitiesSavedStatesExtensible,\n\tInserterSidebar,\n\tListViewSidebar,\n\tPluginPostExcerpt,\n\tPostPanelRow,\n\tPostViewLink,\n\tPreviewDropdown,\n\tPreferencesModal,\n\n\t// This is a temporary private API while we're updating the site editor to use EditorProvider.\n\tuseBlockEditorSettings,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,YAAY,MAAM,4BAA4B;AACrD,SAASC,0BAA0B,QAAQ,uBAAuB;AAClE,SAASC,IAAI,QAAQ,eAAe;AACpC,OAAOC,sCAAsC,MAAM,qEAAqE;AACxH,SAASC,6BAA6B,QAAQ,oCAAoC;AAClF,OAAOC,sBAAsB,MAAM,iDAAiD;AACpF,OAAOC,aAAa,MAAM,6BAA6B;AACvD,OAAOC,eAAe,MAAM,+BAA+B;AAC3D,OAAOC,eAAe,MAAM,gCAAgC;AAC5D,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,OAAOC,YAAY,MAAM,6BAA6B;AACtD,OAAOC,YAAY,MAAM,6BAA6B;AACtD,OAAOC,eAAe,MAAM,+BAA+B;AAC3D,OAAOC,gBAAgB,MAAM,gCAAgC;AAE7D,OAAO,MAAMC,WAAW,GAAG,CAAC,CAAC;AAC7BZ,IAAI,CAAEY,WAAW,EAAE;EAClBR,aAAa;EACbN,YAAY;EACZC,0BAA0B;EAC1BE,sCAAsC;EACtCC,6BAA6B;EAC7BG,eAAe;EACfC,eAAe;EACfC,iBAAiB;EACjBC,YAAY;EACZC,YAAY;EACZC,eAAe;EACfC,gBAAgB;EAEhB;EACAR;AACD,CAAE,CAAC"}
|
|
@@ -9,6 +9,7 @@ import { SETTINGS_DEFAULTS } from '@wordpress/block-editor';
|
|
|
9
9
|
* @property {boolean|Array} allowedBlockTypes Allowed block types
|
|
10
10
|
* @property {boolean} richEditingEnabled Whether rich editing is enabled or not
|
|
11
11
|
* @property {boolean} codeEditingEnabled Whether code editing is enabled or not
|
|
12
|
+
* @property {boolean} fontLibraryEnabled Whether the font library is enabled or not.
|
|
12
13
|
* @property {boolean} enableCustomFields Whether the WordPress custom fields are enabled or not.
|
|
13
14
|
* true = the user has opted to show the Custom Fields panel at the bottom of the editor.
|
|
14
15
|
* false = the user has opted to hide the Custom Fields panel at the bottom of the editor.
|
|
@@ -25,6 +26,7 @@ export const EDITOR_SETTINGS_DEFAULTS = {
|
|
|
25
26
|
...SETTINGS_DEFAULTS,
|
|
26
27
|
richEditingEnabled: true,
|
|
27
28
|
codeEditingEnabled: true,
|
|
29
|
+
fontLibraryEnabled: true,
|
|
28
30
|
enableCustomFields: undefined,
|
|
29
31
|
defaultRenderingMode: 'post-only'
|
|
30
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SETTINGS_DEFAULTS","EDITOR_SETTINGS_DEFAULTS","richEditingEnabled","codeEditingEnabled","enableCustomFields","undefined","defaultRenderingMode"],"sources":["@wordpress/editor/src/store/defaults.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SETTINGS_DEFAULTS } from '@wordpress/block-editor';\n\n/**\n * The default post editor settings.\n *\n * @property {boolean|Array} allowedBlockTypes Allowed block types\n * @property {boolean} richEditingEnabled Whether rich editing is enabled or not\n * @property {boolean} codeEditingEnabled Whether code editing is enabled or not\n * @property {boolean} enableCustomFields Whether the WordPress custom fields are enabled or not.\n * true = the user has opted to show the Custom Fields panel at the bottom of the editor.\n * false = the user has opted to hide the Custom Fields panel at the bottom of the editor.\n * undefined = the current environment does not support Custom Fields, so the option toggle in Preferences -> Panels to enable the Custom Fields panel is not displayed.\n * @property {number} autosaveInterval How often in seconds the post will be auto-saved via the REST API.\n * @property {number} localAutosaveInterval How often in seconds the post will be backed up to sessionStorage.\n * @property {Array?} availableTemplates The available post templates\n * @property {boolean} disablePostFormats Whether or not the post formats are disabled\n * @property {Array?} allowedMimeTypes List of allowed mime types and file extensions\n * @property {number} maxUploadFileSize Maximum upload file size\n * @property {boolean} supportsLayout Whether the editor supports layouts.\n */\nexport const EDITOR_SETTINGS_DEFAULTS = {\n\t...SETTINGS_DEFAULTS,\n\n\trichEditingEnabled: true,\n\tcodeEditingEnabled: true,\n\tenableCustomFields: undefined,\n\tdefaultRenderingMode: 'post-only',\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,yBAAyB;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,GAAG;EACvC,GAAGD,iBAAiB;EAEpBE,kBAAkB,EAAE,IAAI;EACxBC,kBAAkB,EAAE,IAAI;EACxBC,kBAAkB,EAAEC,SAAS;EAC7BC,oBAAoB,EAAE;AACvB,CAAC"}
|
|
1
|
+
{"version":3,"names":["SETTINGS_DEFAULTS","EDITOR_SETTINGS_DEFAULTS","richEditingEnabled","codeEditingEnabled","fontLibraryEnabled","enableCustomFields","undefined","defaultRenderingMode"],"sources":["@wordpress/editor/src/store/defaults.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SETTINGS_DEFAULTS } from '@wordpress/block-editor';\n\n/**\n * The default post editor settings.\n *\n * @property {boolean|Array} allowedBlockTypes Allowed block types\n * @property {boolean} richEditingEnabled Whether rich editing is enabled or not\n * @property {boolean} codeEditingEnabled Whether code editing is enabled or not\n * @property {boolean} fontLibraryEnabled Whether the font library is enabled or not.\n * @property {boolean} enableCustomFields Whether the WordPress custom fields are enabled or not.\n * true = the user has opted to show the Custom Fields panel at the bottom of the editor.\n * false = the user has opted to hide the Custom Fields panel at the bottom of the editor.\n * undefined = the current environment does not support Custom Fields, so the option toggle in Preferences -> Panels to enable the Custom Fields panel is not displayed.\n * @property {number} autosaveInterval How often in seconds the post will be auto-saved via the REST API.\n * @property {number} localAutosaveInterval How often in seconds the post will be backed up to sessionStorage.\n * @property {Array?} availableTemplates The available post templates\n * @property {boolean} disablePostFormats Whether or not the post formats are disabled\n * @property {Array?} allowedMimeTypes List of allowed mime types and file extensions\n * @property {number} maxUploadFileSize Maximum upload file size\n * @property {boolean} supportsLayout Whether the editor supports layouts.\n */\nexport const EDITOR_SETTINGS_DEFAULTS = {\n\t...SETTINGS_DEFAULTS,\n\n\trichEditingEnabled: true,\n\tcodeEditingEnabled: true,\n\tfontLibraryEnabled: true,\n\tenableCustomFields: undefined,\n\tdefaultRenderingMode: 'post-only',\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,yBAAyB;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,GAAG;EACvC,GAAGD,iBAAiB;EAEpBE,kBAAkB,EAAE,IAAI;EACxBC,kBAAkB,EAAE,IAAI;EACxBC,kBAAkB,EAAE,IAAI;EACxBC,kBAAkB,EAAEC,SAAS;EAC7BC,oBAAoB,EAAE;AACvB,CAAC"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { store as coreStore } from '@wordpress/core-data';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
import { store as noticesStore } from '@wordpress/notices';
|
|
7
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Returns an action object used to set which template is currently being used/edited.
|
|
@@ -41,4 +42,32 @@ export const createTemplate = template => async ({
|
|
|
41
42
|
}]
|
|
42
43
|
});
|
|
43
44
|
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Update the provided block types to be visible.
|
|
48
|
+
*
|
|
49
|
+
* @param {string[]} blockNames Names of block types to show.
|
|
50
|
+
*/
|
|
51
|
+
export const showBlockTypes = blockNames => ({
|
|
52
|
+
registry
|
|
53
|
+
}) => {
|
|
54
|
+
var _registry$select$get;
|
|
55
|
+
const existingBlockNames = (_registry$select$get = registry.select(preferencesStore).get('core', 'hiddenBlockTypes')) !== null && _registry$select$get !== void 0 ? _registry$select$get : [];
|
|
56
|
+
const newBlockNames = existingBlockNames.filter(type => !(Array.isArray(blockNames) ? blockNames : [blockNames]).includes(type));
|
|
57
|
+
registry.dispatch(preferencesStore).set('core', 'hiddenBlockTypes', newBlockNames);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Update the provided block types to be hidden.
|
|
62
|
+
*
|
|
63
|
+
* @param {string[]} blockNames Names of block types to hide.
|
|
64
|
+
*/
|
|
65
|
+
export const hideBlockTypes = blockNames => ({
|
|
66
|
+
registry
|
|
67
|
+
}) => {
|
|
68
|
+
var _registry$select$get2;
|
|
69
|
+
const existingBlockNames = (_registry$select$get2 = registry.select(preferencesStore).get('core', 'hiddenBlockTypes')) !== null && _registry$select$get2 !== void 0 ? _registry$select$get2 : [];
|
|
70
|
+
const mergedBlockNames = new Set([...existingBlockNames, ...(Array.isArray(blockNames) ? blockNames : [blockNames])]);
|
|
71
|
+
registry.dispatch(preferencesStore).set('core', 'hiddenBlockTypes', [...mergedBlockNames]);
|
|
72
|
+
};
|
|
44
73
|
//# sourceMappingURL=private-actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","coreStore","__","noticesStore","setCurrentTemplateId","id","type","createTemplate","template","select","dispatch","registry","savedTemplate","saveEntityRecord","editEntityRecord","getCurrentPostType","getCurrentPostId","slug","createSuccessNotice","actions","label","onClick","setRenderingMode","getEditorSettings","defaultRenderingMode"],"sources":["@wordpress/editor/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Returns an action object used to set which template is currently being used/edited.\n *\n * @param {string} id Template Id.\n *\n * @return {Object} Action object.\n */\nexport function setCurrentTemplateId( id ) {\n\treturn {\n\t\ttype: 'SET_CURRENT_TEMPLATE_ID',\n\t\tid,\n\t};\n}\n\n/**\n * Create a block based template.\n *\n * @param {Object?} template Template to create and assign.\n */\nexport const createTemplate =\n\t( template ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst savedTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tselect.getCurrentPostType(),\n\t\t\t\tselect.getCurrentPostId(),\n\t\t\t\t{\n\t\t\t\t\ttemplate: savedTemplate.slug,\n\t\t\t\t}\n\t\t\t);\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createSuccessNotice(\n\t\t\t\t__( \"Custom template created. You're in template mode now.\" ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\tdispatch.setRenderingMode(\n\t\t\t\t\t\t\t\t\tselect.getEditorSettings()\n\t\t\t\t\t\t\t\t\t\t.defaultRenderingMode\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASF,KAAK,IAAIG,YAAY,QAAQ,oBAAoB;;
|
|
1
|
+
{"version":3,"names":["store","coreStore","__","noticesStore","preferencesStore","setCurrentTemplateId","id","type","createTemplate","template","select","dispatch","registry","savedTemplate","saveEntityRecord","editEntityRecord","getCurrentPostType","getCurrentPostId","slug","createSuccessNotice","actions","label","onClick","setRenderingMode","getEditorSettings","defaultRenderingMode","showBlockTypes","blockNames","_registry$select$get","existingBlockNames","get","newBlockNames","filter","Array","isArray","includes","set","hideBlockTypes","_registry$select$get2","mergedBlockNames","Set"],"sources":["@wordpress/editor/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Returns an action object used to set which template is currently being used/edited.\n *\n * @param {string} id Template Id.\n *\n * @return {Object} Action object.\n */\nexport function setCurrentTemplateId( id ) {\n\treturn {\n\t\ttype: 'SET_CURRENT_TEMPLATE_ID',\n\t\tid,\n\t};\n}\n\n/**\n * Create a block based template.\n *\n * @param {Object?} template Template to create and assign.\n */\nexport const createTemplate =\n\t( template ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst savedTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tselect.getCurrentPostType(),\n\t\t\t\tselect.getCurrentPostId(),\n\t\t\t\t{\n\t\t\t\t\ttemplate: savedTemplate.slug,\n\t\t\t\t}\n\t\t\t);\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createSuccessNotice(\n\t\t\t\t__( \"Custom template created. You're in template mode now.\" ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\tdispatch.setRenderingMode(\n\t\t\t\t\t\t\t\t\tselect.getEditorSettings()\n\t\t\t\t\t\t\t\t\t\t.defaultRenderingMode\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t};\n\n/**\n * Update the provided block types to be visible.\n *\n * @param {string[]} blockNames Names of block types to show.\n */\nexport const showBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst newBlockNames = existingBlockNames.filter(\n\t\t\t( type ) =>\n\t\t\t\t! (\n\t\t\t\t\tArray.isArray( blockNames ) ? blockNames : [ blockNames ]\n\t\t\t\t).includes( type )\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'hiddenBlockTypes', newBlockNames );\n\t};\n\n/**\n * Update the provided block types to be hidden.\n *\n * @param {string[]} blockNames Names of block types to hide.\n */\nexport const hideBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst mergedBlockNames = new Set( [\n\t\t\t...existingBlockNames,\n\t\t\t...( Array.isArray( blockNames ) ? blockNames : [ blockNames ] ),\n\t\t] );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'hiddenBlockTypes', [ ...mergedBlockNames ] );\n\t};\n"],"mappings":"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"}
|
|
@@ -26,7 +26,7 @@ export const getInsertionPoint = createRegistrySelector(select => state => {
|
|
|
26
26
|
return state.blockInserterPanel;
|
|
27
27
|
}
|
|
28
28
|
if (getRenderingMode(state) === 'template-locked') {
|
|
29
|
-
const [postContentClientId] = select(blockEditorStore).
|
|
29
|
+
const [postContentClientId] = select(blockEditorStore).getBlocksByName('core/post-content');
|
|
30
30
|
if (postContentClientId) {
|
|
31
31
|
return {
|
|
32
32
|
rootClientId: postContentClientId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","blockEditorStore","createRegistrySelector","getRenderingMode","EMPTY_INSERTION_POINT","rootClientId","undefined","insertionIndex","filterValue","getInsertionPoint","select","state","blockInserterPanel","postContentClientId","
|
|
1
|
+
{"version":3,"names":["store","blockEditorStore","createRegistrySelector","getRenderingMode","EMPTY_INSERTION_POINT","rootClientId","undefined","insertionIndex","filterValue","getInsertionPoint","select","state","blockInserterPanel","postContentClientId","getBlocksByName","getListViewToggleRef","listViewToggleRef"],"sources":["@wordpress/editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { getRenderingMode } from './selectors';\n\nconst EMPTY_INSERTION_POINT = {\n\trootClientId: undefined,\n\tinsertionIndex: undefined,\n\tfilterValue: undefined,\n};\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const getInsertionPoint = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\treturn state.blockInserterPanel;\n\t\t}\n\n\t\tif ( getRenderingMode( state ) === 'template-locked' ) {\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tselect( blockEditorStore ).getBlocksByName(\n\t\t\t\t\t'core/post-content'\n\t\t\t\t);\n\t\t\tif ( postContentClientId ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\tinsertionIndex: undefined,\n\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn EMPTY_INSERTION_POINT;\n\t}\n);\n\nexport function getListViewToggleRef( state ) {\n\treturn state.listViewToggleRef;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,sBAAsB,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,aAAa;AAE9C,MAAMC,qBAAqB,GAAG;EAC7BC,YAAY,EAAEC,SAAS;EACvBC,cAAc,EAAED,SAAS;EACzBE,WAAW,EAAEF;AACd,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,iBAAiB,GAAGP,sBAAsB,CACpDQ,MAAM,IAAQC,KAAK,IAAM;EAC1B,IAAK,OAAOA,KAAK,CAACC,kBAAkB,KAAK,QAAQ,EAAG;IACnD,OAAOD,KAAK,CAACC,kBAAkB;EAChC;EAEA,IAAKT,gBAAgB,CAAEQ,KAAM,CAAC,KAAK,iBAAiB,EAAG;IACtD,MAAM,CAAEE,mBAAmB,CAAE,GAC5BH,MAAM,CAAET,gBAAiB,CAAC,CAACa,eAAe,CACzC,mBACD,CAAC;IACF,IAAKD,mBAAmB,EAAG;MAC1B,OAAO;QACNR,YAAY,EAAEQ,mBAAmB;QACjCN,cAAc,EAAED,SAAS;QACzBE,WAAW,EAAEF;MACd,CAAC;IACF;EACD;EAEA,OAAOF,qBAAqB;AAC7B,CACD,CAAC;AAED,OAAO,SAASW,oBAAoBA,CAAEJ,KAAK,EAAG;EAC7C,OAAOA,KAAK,CAACK,iBAAiB;AAC/B"}
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
--wp-block-synced-color: #7a00df;
|
|
99
99
|
--wp-block-synced-color--rgb: 122, 0, 223;
|
|
100
100
|
}
|
|
101
|
-
@media (
|
|
101
|
+
@media (min-resolution: 192dpi) {
|
|
102
102
|
:root {
|
|
103
103
|
--wp-admin-border-width-focus: 1.5px;
|
|
104
104
|
}
|
|
@@ -142,6 +142,81 @@
|
|
|
142
142
|
color: var(--wp-admin-theme-color);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
.editor-block-manager__no-results {
|
|
146
|
+
font-style: italic;
|
|
147
|
+
padding: 24px 0;
|
|
148
|
+
text-align: center;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.editor-block-manager__search {
|
|
152
|
+
margin: 16px 0;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.editor-block-manager__disabled-blocks-count {
|
|
156
|
+
border: 1px solid #ddd;
|
|
157
|
+
border-width: 1px 0;
|
|
158
|
+
box-shadow: 32px 0 0 0 #fff, -32px 0 0 0 #fff;
|
|
159
|
+
padding: 8px;
|
|
160
|
+
background-color: #fff;
|
|
161
|
+
text-align: center;
|
|
162
|
+
position: sticky;
|
|
163
|
+
top: -5px;
|
|
164
|
+
z-index: 2;
|
|
165
|
+
}
|
|
166
|
+
.editor-block-manager__disabled-blocks-count ~ .editor-block-manager__results .editor-block-manager__category-title {
|
|
167
|
+
top: 31px;
|
|
168
|
+
}
|
|
169
|
+
.editor-block-manager__disabled-blocks-count .is-link {
|
|
170
|
+
margin-right: 12px;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.editor-block-manager__category {
|
|
174
|
+
margin: 0 0 24px 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.editor-block-manager__category-title {
|
|
178
|
+
position: sticky;
|
|
179
|
+
top: -4px;
|
|
180
|
+
padding: 16px 0;
|
|
181
|
+
background-color: #fff;
|
|
182
|
+
z-index: 1;
|
|
183
|
+
}
|
|
184
|
+
.editor-block-manager__category-title .components-checkbox-control__label {
|
|
185
|
+
font-weight: 600;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.editor-block-manager__checklist {
|
|
189
|
+
margin-top: 0;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.editor-block-manager__category-title,
|
|
193
|
+
.editor-block-manager__checklist-item {
|
|
194
|
+
border-bottom: 1px solid #ddd;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.editor-block-manager__checklist-item {
|
|
198
|
+
display: flex;
|
|
199
|
+
justify-content: space-between;
|
|
200
|
+
align-items: center;
|
|
201
|
+
margin-bottom: 0;
|
|
202
|
+
padding: 8px 16px 8px 0;
|
|
203
|
+
}
|
|
204
|
+
.components-modal__content .editor-block-manager__checklist-item.components-checkbox-control__input-container {
|
|
205
|
+
margin: 0 8px;
|
|
206
|
+
}
|
|
207
|
+
.editor-block-manager__checklist-item .block-editor-block-icon {
|
|
208
|
+
margin-left: 10px;
|
|
209
|
+
fill: #1e1e1e;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.editor-block-manager__results {
|
|
213
|
+
border-top: 1px solid #ddd;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.editor-block-manager__disabled-blocks-count + .editor-block-manager__results {
|
|
217
|
+
border-top-width: 0;
|
|
218
|
+
}
|
|
219
|
+
|
|
145
220
|
.editor-document-bar {
|
|
146
221
|
display: flex;
|
|
147
222
|
align-items: center;
|
|
@@ -456,7 +531,6 @@
|
|
|
456
531
|
.components-editor-notices__dismissible .components-notice,
|
|
457
532
|
.components-editor-notices__pinned .components-notice {
|
|
458
533
|
box-sizing: border-box;
|
|
459
|
-
margin: 0;
|
|
460
534
|
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
|
|
461
535
|
padding: 0 12px;
|
|
462
536
|
min-height: 60px;
|
|
@@ -484,6 +558,10 @@
|
|
|
484
558
|
margin-bottom: 12px;
|
|
485
559
|
}
|
|
486
560
|
|
|
561
|
+
.entities-saved-states__description-heading {
|
|
562
|
+
font-size: 13px;
|
|
563
|
+
}
|
|
564
|
+
|
|
487
565
|
.editor-error-boundary {
|
|
488
566
|
margin: auto;
|
|
489
567
|
max-width: 780px;
|
|
@@ -753,12 +831,6 @@
|
|
|
753
831
|
padding: 16px;
|
|
754
832
|
}
|
|
755
833
|
|
|
756
|
-
@media (min-width: 600px) {
|
|
757
|
-
.editor-post-locked-modal {
|
|
758
|
-
max-width: 480px;
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
|
|
762
834
|
.editor-post-locked-modal__buttons {
|
|
763
835
|
margin-top: 24px;
|
|
764
836
|
}
|
|
@@ -1415,8 +1487,4 @@
|
|
|
1415
1487
|
}
|
|
1416
1488
|
.editor-template-validation-notice .components-button {
|
|
1417
1489
|
margin-right: 5px;
|
|
1418
|
-
}
|
|
1419
|
-
|
|
1420
|
-
.editor-canvas__iframe.has-history {
|
|
1421
|
-
padding: 48px 48px 0;
|
|
1422
1490
|
}
|
package/build-style/style.css
CHANGED
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
--wp-block-synced-color: #7a00df;
|
|
99
99
|
--wp-block-synced-color--rgb: 122, 0, 223;
|
|
100
100
|
}
|
|
101
|
-
@media (
|
|
101
|
+
@media (min-resolution: 192dpi) {
|
|
102
102
|
:root {
|
|
103
103
|
--wp-admin-border-width-focus: 1.5px;
|
|
104
104
|
}
|
|
@@ -142,6 +142,81 @@
|
|
|
142
142
|
color: var(--wp-admin-theme-color);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
.editor-block-manager__no-results {
|
|
146
|
+
font-style: italic;
|
|
147
|
+
padding: 24px 0;
|
|
148
|
+
text-align: center;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.editor-block-manager__search {
|
|
152
|
+
margin: 16px 0;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.editor-block-manager__disabled-blocks-count {
|
|
156
|
+
border: 1px solid #ddd;
|
|
157
|
+
border-width: 1px 0;
|
|
158
|
+
box-shadow: -32px 0 0 0 #fff, 32px 0 0 0 #fff;
|
|
159
|
+
padding: 8px;
|
|
160
|
+
background-color: #fff;
|
|
161
|
+
text-align: center;
|
|
162
|
+
position: sticky;
|
|
163
|
+
top: -5px;
|
|
164
|
+
z-index: 2;
|
|
165
|
+
}
|
|
166
|
+
.editor-block-manager__disabled-blocks-count ~ .editor-block-manager__results .editor-block-manager__category-title {
|
|
167
|
+
top: 31px;
|
|
168
|
+
}
|
|
169
|
+
.editor-block-manager__disabled-blocks-count .is-link {
|
|
170
|
+
margin-left: 12px;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.editor-block-manager__category {
|
|
174
|
+
margin: 0 0 24px 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.editor-block-manager__category-title {
|
|
178
|
+
position: sticky;
|
|
179
|
+
top: -4px;
|
|
180
|
+
padding: 16px 0;
|
|
181
|
+
background-color: #fff;
|
|
182
|
+
z-index: 1;
|
|
183
|
+
}
|
|
184
|
+
.editor-block-manager__category-title .components-checkbox-control__label {
|
|
185
|
+
font-weight: 600;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.editor-block-manager__checklist {
|
|
189
|
+
margin-top: 0;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.editor-block-manager__category-title,
|
|
193
|
+
.editor-block-manager__checklist-item {
|
|
194
|
+
border-bottom: 1px solid #ddd;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.editor-block-manager__checklist-item {
|
|
198
|
+
display: flex;
|
|
199
|
+
justify-content: space-between;
|
|
200
|
+
align-items: center;
|
|
201
|
+
margin-bottom: 0;
|
|
202
|
+
padding: 8px 0 8px 16px;
|
|
203
|
+
}
|
|
204
|
+
.components-modal__content .editor-block-manager__checklist-item.components-checkbox-control__input-container {
|
|
205
|
+
margin: 0 8px;
|
|
206
|
+
}
|
|
207
|
+
.editor-block-manager__checklist-item .block-editor-block-icon {
|
|
208
|
+
margin-right: 10px;
|
|
209
|
+
fill: #1e1e1e;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.editor-block-manager__results {
|
|
213
|
+
border-top: 1px solid #ddd;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.editor-block-manager__disabled-blocks-count + .editor-block-manager__results {
|
|
217
|
+
border-top-width: 0;
|
|
218
|
+
}
|
|
219
|
+
|
|
145
220
|
.editor-document-bar {
|
|
146
221
|
display: flex;
|
|
147
222
|
align-items: center;
|
|
@@ -456,7 +531,6 @@
|
|
|
456
531
|
.components-editor-notices__dismissible .components-notice,
|
|
457
532
|
.components-editor-notices__pinned .components-notice {
|
|
458
533
|
box-sizing: border-box;
|
|
459
|
-
margin: 0;
|
|
460
534
|
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
|
|
461
535
|
padding: 0 12px;
|
|
462
536
|
min-height: 60px;
|
|
@@ -484,6 +558,10 @@
|
|
|
484
558
|
margin-bottom: 12px;
|
|
485
559
|
}
|
|
486
560
|
|
|
561
|
+
.entities-saved-states__description-heading {
|
|
562
|
+
font-size: 13px;
|
|
563
|
+
}
|
|
564
|
+
|
|
487
565
|
.editor-error-boundary {
|
|
488
566
|
margin: auto;
|
|
489
567
|
max-width: 780px;
|
|
@@ -753,12 +831,6 @@
|
|
|
753
831
|
padding: 16px;
|
|
754
832
|
}
|
|
755
833
|
|
|
756
|
-
@media (min-width: 600px) {
|
|
757
|
-
.editor-post-locked-modal {
|
|
758
|
-
max-width: 480px;
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
|
|
762
834
|
.editor-post-locked-modal__buttons {
|
|
763
835
|
margin-top: 24px;
|
|
764
836
|
}
|
|
@@ -1419,8 +1491,4 @@
|
|
|
1419
1491
|
}
|
|
1420
1492
|
.editor-template-validation-notice .components-button {
|
|
1421
1493
|
margin-left: 5px;
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
.editor-canvas__iframe.has-history {
|
|
1425
|
-
padding: 48px 48px 0;
|
|
1426
1494
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.27.0",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,40 +27,40 @@
|
|
|
27
27
|
"sideEffects": [
|
|
28
28
|
"build-style/**",
|
|
29
29
|
"src/**/*.scss",
|
|
30
|
-
"{src,build,build-module}/{index.js,store/index.js,hooks/**}"
|
|
30
|
+
"{src,build,build-module}/{index.js,store/index.js,hooks/**,bindings/**}"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/a11y": "^3.
|
|
35
|
-
"@wordpress/api-fetch": "^6.
|
|
36
|
-
"@wordpress/blob": "^3.
|
|
37
|
-
"@wordpress/block-editor": "^12.
|
|
38
|
-
"@wordpress/blocks": "^12.
|
|
39
|
-
"@wordpress/commands": "^0.
|
|
40
|
-
"@wordpress/components": "^25.
|
|
41
|
-
"@wordpress/compose": "^6.
|
|
42
|
-
"@wordpress/core-data": "^6.
|
|
43
|
-
"@wordpress/data": "^9.
|
|
44
|
-
"@wordpress/date": "^4.
|
|
45
|
-
"@wordpress/deprecated": "^3.
|
|
46
|
-
"@wordpress/dom": "^3.
|
|
47
|
-
"@wordpress/element": "^5.
|
|
48
|
-
"@wordpress/hooks": "^3.
|
|
49
|
-
"@wordpress/html-entities": "^3.
|
|
50
|
-
"@wordpress/i18n": "^4.
|
|
51
|
-
"@wordpress/icons": "^9.
|
|
52
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
53
|
-
"@wordpress/keycodes": "^3.
|
|
54
|
-
"@wordpress/media-utils": "^4.
|
|
55
|
-
"@wordpress/notices": "^4.
|
|
56
|
-
"@wordpress/patterns": "^1.
|
|
57
|
-
"@wordpress/preferences": "^3.
|
|
58
|
-
"@wordpress/private-apis": "^0.
|
|
59
|
-
"@wordpress/reusable-blocks": "^4.
|
|
60
|
-
"@wordpress/rich-text": "^6.
|
|
61
|
-
"@wordpress/server-side-render": "^4.
|
|
62
|
-
"@wordpress/url": "^3.
|
|
63
|
-
"@wordpress/wordcount": "^3.
|
|
34
|
+
"@wordpress/a11y": "^3.50.0",
|
|
35
|
+
"@wordpress/api-fetch": "^6.47.0",
|
|
36
|
+
"@wordpress/blob": "^3.50.0",
|
|
37
|
+
"@wordpress/block-editor": "^12.18.0",
|
|
38
|
+
"@wordpress/blocks": "^12.27.0",
|
|
39
|
+
"@wordpress/commands": "^0.21.0",
|
|
40
|
+
"@wordpress/components": "^25.16.0",
|
|
41
|
+
"@wordpress/compose": "^6.27.0",
|
|
42
|
+
"@wordpress/core-data": "^6.27.0",
|
|
43
|
+
"@wordpress/data": "^9.20.0",
|
|
44
|
+
"@wordpress/date": "^4.50.0",
|
|
45
|
+
"@wordpress/deprecated": "^3.50.0",
|
|
46
|
+
"@wordpress/dom": "^3.50.0",
|
|
47
|
+
"@wordpress/element": "^5.27.0",
|
|
48
|
+
"@wordpress/hooks": "^3.50.0",
|
|
49
|
+
"@wordpress/html-entities": "^3.50.0",
|
|
50
|
+
"@wordpress/i18n": "^4.50.0",
|
|
51
|
+
"@wordpress/icons": "^9.41.0",
|
|
52
|
+
"@wordpress/keyboard-shortcuts": "^4.27.0",
|
|
53
|
+
"@wordpress/keycodes": "^3.50.0",
|
|
54
|
+
"@wordpress/media-utils": "^4.41.0",
|
|
55
|
+
"@wordpress/notices": "^4.18.0",
|
|
56
|
+
"@wordpress/patterns": "^1.11.0",
|
|
57
|
+
"@wordpress/preferences": "^3.27.0",
|
|
58
|
+
"@wordpress/private-apis": "^0.32.0",
|
|
59
|
+
"@wordpress/reusable-blocks": "^4.27.0",
|
|
60
|
+
"@wordpress/rich-text": "^6.27.0",
|
|
61
|
+
"@wordpress/server-side-render": "^4.27.0",
|
|
62
|
+
"@wordpress/url": "^3.51.0",
|
|
63
|
+
"@wordpress/wordcount": "^3.50.0",
|
|
64
64
|
"classnames": "^2.3.1",
|
|
65
65
|
"date-fns": "^2.28.0",
|
|
66
66
|
"memize": "^2.1.0",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "45de2cb4212fed7f2763e95f10300d1ff9d0ec08"
|
|
79
79
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
5
|
+
import { dispatch } from '@wordpress/data';
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { unlock } from '../lock-unlock';
|
|
10
|
+
import postMeta from './post-meta';
|
|
11
|
+
|
|
12
|
+
const { registerBlockBindingsSource } = unlock( dispatch( blockEditorStore ) );
|
|
13
|
+
registerBlockBindingsSource( postMeta );
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useEntityProp } from '@wordpress/core-data';
|
|
5
|
+
import { useSelect } from '@wordpress/data';
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { store as editorStore } from '../store';
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
name: 'post_meta',
|
|
14
|
+
label: __( 'Post Meta' ),
|
|
15
|
+
useSource( props, sourceAttributes ) {
|
|
16
|
+
const { getCurrentPostType } = useSelect( editorStore );
|
|
17
|
+
const { context } = props;
|
|
18
|
+
const { value: metaKey } = sourceAttributes;
|
|
19
|
+
const postType = context.postType
|
|
20
|
+
? context.postType
|
|
21
|
+
: getCurrentPostType();
|
|
22
|
+
const [ meta, setMeta ] = useEntityProp(
|
|
23
|
+
'postType',
|
|
24
|
+
context.postType,
|
|
25
|
+
'meta',
|
|
26
|
+
context.postId
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
if ( postType === 'wp_template' ) {
|
|
30
|
+
return { placeholder: metaKey };
|
|
31
|
+
}
|
|
32
|
+
const metaValue = meta[ metaKey ];
|
|
33
|
+
const updateMetaValue = ( newValue ) => {
|
|
34
|
+
setMeta( { ...meta, [ metaKey ]: newValue } );
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
placeholder: metaKey,
|
|
38
|
+
useValue: [ metaValue, updateMetaValue ],
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
lockAttributesEditing: true,
|
|
42
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useMemo, useCallback } from '@wordpress/element';
|
|
5
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
6
|
+
import { useInstanceId } from '@wordpress/compose';
|
|
7
|
+
import { CheckboxControl } from '@wordpress/components';
|
|
8
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import BlockTypesChecklist from './checklist';
|
|
14
|
+
import { store as editorStore } from '../../store';
|
|
15
|
+
import { unlock } from '../../lock-unlock';
|
|
16
|
+
|
|
17
|
+
function BlockManagerCategory( { title, blockTypes } ) {
|
|
18
|
+
const instanceId = useInstanceId( BlockManagerCategory );
|
|
19
|
+
const { allowedBlockTypes, hiddenBlockTypes } = useSelect( ( select ) => {
|
|
20
|
+
const { getEditorSettings } = select( editorStore );
|
|
21
|
+
const { get } = select( preferencesStore );
|
|
22
|
+
return {
|
|
23
|
+
allowedBlockTypes: getEditorSettings().allowedBlockTypes,
|
|
24
|
+
hiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),
|
|
25
|
+
};
|
|
26
|
+
}, [] );
|
|
27
|
+
const filteredBlockTypes = useMemo( () => {
|
|
28
|
+
if ( allowedBlockTypes === true ) {
|
|
29
|
+
return blockTypes;
|
|
30
|
+
}
|
|
31
|
+
return blockTypes.filter( ( { name } ) => {
|
|
32
|
+
return allowedBlockTypes?.includes( name );
|
|
33
|
+
} );
|
|
34
|
+
}, [ allowedBlockTypes, blockTypes ] );
|
|
35
|
+
const { showBlockTypes, hideBlockTypes } = unlock(
|
|
36
|
+
useDispatch( editorStore )
|
|
37
|
+
);
|
|
38
|
+
const toggleVisible = useCallback(
|
|
39
|
+
( blockName, nextIsChecked ) => {
|
|
40
|
+
if ( nextIsChecked ) {
|
|
41
|
+
showBlockTypes( blockName );
|
|
42
|
+
} else {
|
|
43
|
+
hideBlockTypes( blockName );
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
[ showBlockTypes, hideBlockTypes ]
|
|
47
|
+
);
|
|
48
|
+
const toggleAllVisible = useCallback(
|
|
49
|
+
( nextIsChecked ) => {
|
|
50
|
+
const blockNames = blockTypes.map( ( { name } ) => name );
|
|
51
|
+
if ( nextIsChecked ) {
|
|
52
|
+
showBlockTypes( blockNames );
|
|
53
|
+
} else {
|
|
54
|
+
hideBlockTypes( blockNames );
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
[ blockTypes, showBlockTypes, hideBlockTypes ]
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
if ( ! filteredBlockTypes.length ) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const checkedBlockNames = filteredBlockTypes
|
|
65
|
+
.map( ( { name } ) => name )
|
|
66
|
+
.filter( ( type ) => ! ( hiddenBlockTypes ?? [] ).includes( type ) );
|
|
67
|
+
|
|
68
|
+
const titleId = 'editor-block-manager__category-title-' + instanceId;
|
|
69
|
+
|
|
70
|
+
const isAllChecked = checkedBlockNames.length === filteredBlockTypes.length;
|
|
71
|
+
const isIndeterminate = ! isAllChecked && checkedBlockNames.length > 0;
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<div
|
|
75
|
+
role="group"
|
|
76
|
+
aria-labelledby={ titleId }
|
|
77
|
+
className="editor-block-manager__category"
|
|
78
|
+
>
|
|
79
|
+
<CheckboxControl
|
|
80
|
+
__nextHasNoMarginBottom
|
|
81
|
+
checked={ isAllChecked }
|
|
82
|
+
onChange={ toggleAllVisible }
|
|
83
|
+
className="editor-block-manager__category-title"
|
|
84
|
+
indeterminate={ isIndeterminate }
|
|
85
|
+
label={ <span id={ titleId }>{ title }</span> }
|
|
86
|
+
/>
|
|
87
|
+
<BlockTypesChecklist
|
|
88
|
+
blockTypes={ filteredBlockTypes }
|
|
89
|
+
value={ checkedBlockNames }
|
|
90
|
+
onItemChange={ toggleVisible }
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export default BlockManagerCategory;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { BlockIcon } from '@wordpress/block-editor';
|
|
5
|
+
import { CheckboxControl } from '@wordpress/components';
|
|
6
|
+
|
|
7
|
+
function BlockTypesChecklist( { blockTypes, value, onItemChange } ) {
|
|
8
|
+
return (
|
|
9
|
+
<ul className="editor-block-manager__checklist">
|
|
10
|
+
{ blockTypes.map( ( blockType ) => (
|
|
11
|
+
<li
|
|
12
|
+
key={ blockType.name }
|
|
13
|
+
className="editor-block-manager__checklist-item"
|
|
14
|
+
>
|
|
15
|
+
<CheckboxControl
|
|
16
|
+
__nextHasNoMarginBottom
|
|
17
|
+
label={ blockType.title }
|
|
18
|
+
checked={ value.includes( blockType.name ) }
|
|
19
|
+
onChange={ ( ...args ) =>
|
|
20
|
+
onItemChange( blockType.name, ...args )
|
|
21
|
+
}
|
|
22
|
+
/>
|
|
23
|
+
<BlockIcon icon={ blockType.icon } />
|
|
24
|
+
</li>
|
|
25
|
+
) ) }
|
|
26
|
+
</ul>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default BlockTypesChecklist;
|