@wordpress/editor 14.7.1-next.5368f64a9.0 → 14.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +1 -1
- package/build/bindings/post-meta.js +42 -7
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/block-manager/index.js +45 -66
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/document-bar/index.js +20 -28
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/editor-history/redo.js +2 -4
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +2 -4
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/editor-interface/index.js +1 -2
- package/build/components/editor-interface/index.js.map +1 -1
- package/build/components/error-boundary/index.js +2 -4
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/global-styles-provider/index.js +21 -12
- package/build/components/global-styles-provider/index.js.map +1 -1
- package/build/components/header/index.js +4 -4
- package/build/components/header/index.js.map +1 -1
- package/build/components/media-categories/index.js +1 -0
- package/build/components/media-categories/index.js.map +1 -1
- package/build/components/post-excerpt/panel.js +2 -5
- package/build/components/post-excerpt/panel.js.map +1 -1
- package/build/components/post-featured-image/index.js +6 -12
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-format/index.js +2 -4
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-last-revision/index.js +2 -4
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-locked-modal/index.js +4 -8
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-publish-panel/index.js +2 -4
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +2 -4
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +2 -4
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-status/index.js +1 -0
- package/build/components/post-status/index.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -4
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +2 -4
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-url/index.js +8 -7
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +5 -57
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/save-publish-panels/index.js +4 -10
- package/build/components/save-publish-panels/index.js.map +1 -1
- package/build/components/zoom-out-toggle/index.js +38 -0
- package/build/components/zoom-out-toggle/index.js.map +1 -0
- package/build/dataviews/store/private-actions.js +4 -10
- package/build/dataviews/store/private-actions.js.map +1 -1
- package/build-module/bindings/post-meta.js +40 -7
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/block-manager/index.js +46 -67
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/document-bar/index.js +22 -28
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/editor-history/redo.js +2 -4
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js +2 -4
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/editor-interface/index.js +1 -2
- package/build-module/components/editor-interface/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +2 -4
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +21 -12
- package/build-module/components/global-styles-provider/index.js.map +1 -1
- package/build-module/components/header/index.js +4 -4
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/media-categories/index.js +1 -0
- package/build-module/components/media-categories/index.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +2 -5
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +6 -12
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/index.js +2 -4
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +2 -4
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +4 -8
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +2 -4
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -4
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +2 -4
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-status/index.js +1 -0
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -4
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +2 -4
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-url/index.js +9 -8
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +5 -57
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/save-publish-panels/index.js +4 -10
- package/build-module/components/save-publish-panels/index.js.map +1 -1
- package/build-module/components/zoom-out-toggle/index.js +31 -0
- package/build-module/components/zoom-out-toggle/index.js.map +1 -0
- package/build-module/dataviews/store/private-actions.js +2 -8
- package/build-module/dataviews/store/private-actions.js.map +1 -1
- package/build-style/style-rtl.css +38 -23
- package/build-style/style.css +38 -23
- package/build-types/bindings/post-meta.d.ts +4 -1
- package/build-types/bindings/post-meta.d.ts.map +1 -1
- package/build-types/components/block-manager/index.d.ts +1 -2
- package/build-types/components/block-manager/index.d.ts.map +1 -1
- package/build-types/components/document-bar/index.d.ts +7 -6
- package/build-types/components/document-bar/index.d.ts.map +1 -1
- package/build-types/components/editor-history/redo.d.ts.map +1 -1
- package/build-types/components/editor-history/undo.d.ts.map +1 -1
- package/build-types/components/editor-interface/index.d.ts +1 -2
- package/build-types/components/editor-interface/index.d.ts.map +1 -1
- package/build-types/components/error-boundary/index.d.ts.map +1 -1
- package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
- package/build-types/components/header/index.d.ts +2 -2
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/post-format/index.d.ts.map +1 -1
- package/build-types/components/post-last-revision/index.d.ts.map +1 -1
- package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -1
- package/build-types/components/post-status/index.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/most-used-terms.d.ts.map +1 -1
- package/build-types/components/post-url/index.d.ts.map +1 -1
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
- package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
- package/build-types/components/zoom-out-toggle/index.d.ts +3 -0
- package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -0
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/package.json +37 -36
- package/src/bindings/post-meta.js +56 -20
- package/src/components/block-manager/index.js +50 -67
- package/src/components/document-bar/index.js +29 -41
- package/src/components/document-bar/style.scss +33 -15
- package/src/components/editor-history/redo.js +1 -2
- package/src/components/editor-history/undo.js +1 -2
- package/src/components/editor-interface/index.js +1 -2
- package/src/components/error-boundary/index.js +1 -6
- package/src/components/global-styles-provider/index.js +50 -36
- package/src/components/header/index.js +8 -2
- package/src/components/post-excerpt/panel.js +1 -3
- package/src/components/post-featured-image/index.js +3 -6
- package/src/components/post-featured-image/style.scss +1 -5
- package/src/components/post-format/index.js +1 -2
- package/src/components/post-last-revision/index.js +1 -2
- package/src/components/post-locked-modal/index.js +2 -4
- package/src/components/post-panel-row/style.scss +1 -0
- package/src/components/post-publish-panel/index.js +1 -2
- package/src/components/post-publish-panel/maybe-post-format-panel.js +1 -2
- package/src/components/post-publish-panel/maybe-upload-media.js +1 -2
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
- package/src/components/post-status/index.js +1 -0
- package/src/components/post-status/style.scss +5 -0
- package/src/components/post-taxonomies/hierarchical-term-selector.js +1 -2
- package/src/components/post-taxonomies/most-used-terms.js +1 -2
- package/src/components/post-taxonomies/style.scss +0 -4
- package/src/components/post-url/index.js +9 -7
- package/src/components/preview-dropdown/index.js +26 -84
- package/src/components/save-publish-panels/index.js +2 -6
- package/src/components/zoom-out-toggle/index.js +34 -0
- package/src/dataviews/store/private-actions.ts +10 -8
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/dataviews/actions/duplicate-pattern.js +0 -48
- package/build/dataviews/actions/duplicate-pattern.js.map +0 -1
- package/build/dataviews/actions/duplicate-post.js +0 -146
- package/build/dataviews/actions/duplicate-post.js.map +0 -1
- package/build/dataviews/actions/duplicate-post.native.js +0 -9
- package/build/dataviews/actions/duplicate-post.native.js.map +0 -1
- package/build/dataviews/actions/export-pattern.js +0 -57
- package/build/dataviews/actions/export-pattern.js.map +0 -1
- package/build/dataviews/actions/export-pattern.native.js +0 -9
- package/build/dataviews/actions/export-pattern.native.js.map +0 -1
- package/build/dataviews/actions/permanently-delete-post.js +0 -109
- package/build/dataviews/actions/permanently-delete-post.js.map +0 -1
- package/build/dataviews/actions/reorder-page.js +0 -116
- package/build/dataviews/actions/reorder-page.js.map +0 -1
- package/build/dataviews/actions/reorder-page.native.js +0 -9
- package/build/dataviews/actions/reorder-page.native.js.map +0 -1
- package/build/dataviews/actions/view-post-revisions.js +0 -49
- package/build/dataviews/actions/view-post-revisions.js.map +0 -1
- package/build/dataviews/actions/view-post.js +0 -36
- package/build/dataviews/actions/view-post.js.map +0 -1
- package/build-module/dataviews/actions/duplicate-pattern.js +0 -39
- package/build-module/dataviews/actions/duplicate-pattern.js.map +0 -1
- package/build-module/dataviews/actions/duplicate-post.js +0 -139
- package/build-module/dataviews/actions/duplicate-post.js.map +0 -1
- package/build-module/dataviews/actions/duplicate-post.native.js +0 -3
- package/build-module/dataviews/actions/duplicate-post.native.js.map +0 -1
- package/build-module/dataviews/actions/export-pattern.js +0 -51
- package/build-module/dataviews/actions/export-pattern.js.map +0 -1
- package/build-module/dataviews/actions/export-pattern.native.js +0 -3
- package/build-module/dataviews/actions/export-pattern.native.js.map +0 -1
- package/build-module/dataviews/actions/permanently-delete-post.js +0 -102
- package/build-module/dataviews/actions/permanently-delete-post.js.map +0 -1
- package/build-module/dataviews/actions/reorder-page.js +0 -111
- package/build-module/dataviews/actions/reorder-page.js.map +0 -1
- package/build-module/dataviews/actions/reorder-page.native.js +0 -3
- package/build-module/dataviews/actions/reorder-page.native.js.map +0 -1
- package/build-module/dataviews/actions/view-post-revisions.js +0 -43
- package/build-module/dataviews/actions/view-post-revisions.js.map +0 -1
- package/build-module/dataviews/actions/view-post.js +0 -30
- package/build-module/dataviews/actions/view-post.js.map +0 -1
- package/build-types/dataviews/actions/duplicate-pattern.d.ts +0 -5
- package/build-types/dataviews/actions/duplicate-pattern.d.ts.map +0 -1
- package/build-types/dataviews/actions/duplicate-post.d.ts +0 -5
- package/build-types/dataviews/actions/duplicate-post.d.ts.map +0 -1
- package/build-types/dataviews/actions/duplicate-post.native.d.ts +0 -3
- package/build-types/dataviews/actions/duplicate-post.native.d.ts.map +0 -1
- package/build-types/dataviews/actions/export-pattern.d.ts +0 -8
- package/build-types/dataviews/actions/export-pattern.d.ts.map +0 -1
- package/build-types/dataviews/actions/export-pattern.native.d.ts +0 -3
- package/build-types/dataviews/actions/export-pattern.native.d.ts.map +0 -1
- package/build-types/dataviews/actions/permanently-delete-post.d.ts +0 -5
- package/build-types/dataviews/actions/permanently-delete-post.d.ts.map +0 -1
- package/build-types/dataviews/actions/reorder-page.d.ts +0 -8
- package/build-types/dataviews/actions/reorder-page.d.ts.map +0 -1
- package/build-types/dataviews/actions/reorder-page.native.d.ts +0 -3
- package/build-types/dataviews/actions/reorder-page.native.d.ts.map +0 -1
- package/build-types/dataviews/actions/view-post-revisions.d.ts +0 -8
- package/build-types/dataviews/actions/view-post-revisions.d.ts.map +0 -1
- package/build-types/dataviews/actions/view-post.d.ts +0 -8
- package/build-types/dataviews/actions/view-post.d.ts.map +0 -1
- package/src/dataviews/actions/duplicate-pattern.tsx +0 -40
- package/src/dataviews/actions/duplicate-post.native.tsx +0 -3
- package/src/dataviews/actions/duplicate-post.tsx +0 -174
- package/src/dataviews/actions/export-pattern.native.tsx +0 -3
- package/src/dataviews/actions/export-pattern.tsx +0 -76
- package/src/dataviews/actions/permanently-delete-post.tsx +0 -118
- package/src/dataviews/actions/reorder-page.native.tsx +0 -3
- package/src/dataviews/actions/reorder-page.tsx +0 -125
- package/src/dataviews/actions/view-post-revisions.tsx +0 -47
- package/src/dataviews/actions/view-post.tsx +0 -30
|
@@ -7,16 +7,17 @@
|
|
|
7
7
|
* ```jsx
|
|
8
8
|
* <DocumentBar />
|
|
9
9
|
* ```
|
|
10
|
-
* @param {Object}
|
|
11
|
-
* @param {string}
|
|
12
|
-
*
|
|
13
|
-
* @param {
|
|
14
|
-
*
|
|
10
|
+
* @param {Object} props The component props.
|
|
11
|
+
* @param {string} props.title A title for the document, defaulting to the document or
|
|
12
|
+
* template title currently being edited.
|
|
13
|
+
* @param {IconType} props.icon An icon for the document, no default.
|
|
14
|
+
* (A default icon indicating the document post type is no longer used.)
|
|
15
15
|
*
|
|
16
16
|
* @return {JSX.Element} The rendered DocumentBar component.
|
|
17
17
|
*/
|
|
18
18
|
export default function DocumentBar(props: {
|
|
19
19
|
title: string;
|
|
20
|
-
icon:
|
|
20
|
+
icon: IconType;
|
|
21
21
|
}): JSX.Element;
|
|
22
|
+
export type IconType = import("@wordpress/components").IconType;
|
|
22
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/document-bar/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/document-bar/index.js"],"names":[],"mappings":"AAmCA;;;;;;;;;;;;;;;;GAgBG;AACH,2CAPG;IAAwB,KAAK,EAArB,MAAM;IAEU,IAAI,EAApB,QAAQ;CAGhB,GAAS,GAAG,CAAC,OAAO,CAsJtB;uBAzKa,OAAO,uBAAuB,EAAE,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redo.d.ts","sourceRoot":"","sources":["../../../src/components/editor-history/redo.js"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"redo.d.ts","sourceRoot":"","sources":["../../../src/components/editor-history/redo.js"],"names":[],"mappings":";;kBA4Cc,OAAO,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"undo.d.ts","sourceRoot":"","sources":["../../../src/components/editor-history/undo.js"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"undo.d.ts","sourceRoot":"","sources":["../../../src/components/editor-history/undo.js"],"names":[],"mappings":";;kBAwCc,OAAO,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default function EditorInterface({ className, enableRegionNavigation, styles, children, forceIsDirty, contentRef, disableIframe, autoFocus, customSaveButton, customSavePanel, forceDisableBlockTools, title,
|
|
1
|
+
export default function EditorInterface({ className, enableRegionNavigation, styles, children, forceIsDirty, contentRef, disableIframe, autoFocus, customSaveButton, customSavePanel, forceDisableBlockTools, title, iframeProps, }: {
|
|
2
2
|
className: any;
|
|
3
3
|
enableRegionNavigation: any;
|
|
4
4
|
styles: any;
|
|
@@ -11,7 +11,6 @@ export default function EditorInterface({ className, enableRegionNavigation, sty
|
|
|
11
11
|
customSavePanel: any;
|
|
12
12
|
forceDisableBlockTools: any;
|
|
13
13
|
title: any;
|
|
14
|
-
icon: any;
|
|
15
14
|
iframeProps: any;
|
|
16
15
|
}): import("react").JSX.Element;
|
|
17
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/editor-interface/index.js"],"names":[],"mappings":"AA+CA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/editor-interface/index.js"],"names":[],"mappings":"AA+CA;;;;;;;;;;;;;;gCA8LC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/error-boundary/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/error-boundary/index.js"],"names":[],"mappings":";AAqCA;IAaC;;MAEC;IAdD,4BAMC;IAHA;;MAEC;IAGF,oCAEC;IAMD,cAoBC;CACD;0BAxEyB,oBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/global-styles-provider/index.js"],"names":[],"mappings":"AAuBA,mEAoBC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/global-styles-provider/index.js"],"names":[],"mappings":"AAuBA,mEAoBC;AAuID;;;;;;4BAjDa,WAAS,MAAM,YAEf,MAAM;;;;;;;4BAFN,WAAS,MAAM,YAEf,MAAM;EA8ElB;AAED;;uCAWC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export default Header;
|
|
2
|
-
declare function Header({ customSaveButton, forceIsDirty, forceDisableBlockTools, setEntitiesSavedStatesCallback, title,
|
|
2
|
+
declare function Header({ customSaveButton, forceIsDirty, forceDisableBlockTools, setEntitiesSavedStatesCallback, title, isEditorIframed, }: {
|
|
3
3
|
customSaveButton: any;
|
|
4
4
|
forceIsDirty: any;
|
|
5
5
|
forceDisableBlockTools: any;
|
|
6
6
|
setEntitiesSavedStatesCallback: any;
|
|
7
7
|
title: any;
|
|
8
|
-
|
|
8
|
+
isEditorIframed: any;
|
|
9
9
|
}): import("react").JSX.Element;
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/header/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/header/index.js"],"names":[],"mappings":";AA2CA;;;;;;;gCA2HC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-format/index.js"],"names":[],"mappings":"AAwCA;;;;;;;;;GASG;AACH,sCAFY,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-format/index.js"],"names":[],"mappings":"AAwCA;;;;;;;;;GASG;AACH,sCAFY,GAAG,CAAC,OAAO,CAuEtB;AAvGD;;;IAsBI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-last-revision/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-last-revision/index.js"],"names":[],"mappings":"AAuDA,uEAiBC;;AA7CD;;;;GAIG;AACH,qCAFY,SAAS,CAuBpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-locked-modal/index.js"],"names":[],"mappings":"AAsBA;;;;;GAKG;AACH,2CAFY,GAAG,CAAC,OAAO,GAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-locked-modal/index.js"],"names":[],"mappings":"AAsBA;;;;;GAKG;AACH,2CAFY,GAAG,CAAC,OAAO,GAAC,IAAI,CA4P3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-publish-panel/index.js"],"names":[],"mappings":"AAyBA;IACC,4BAGC;IAcD,iBAKC;IAjBD,yCAUC;IASD,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-publish-panel/index.js"],"names":[],"mappings":"AAyBA;IACC,4BAGC;IAcD,iBAKC;IAjBD,yCAUC;IASD,sCAiFC;CACD;;;0BAhIyB,oBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maybe-post-format-panel.d.ts","sourceRoot":"","sources":["../../../src/components/post-publish-panel/maybe-post-format-panel.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"maybe-post-format-panel.d.ts","sourceRoot":"","sources":["../../../src/components/post-publish-panel/maybe-post-format-panel.js"],"names":[],"mappings":"AAmCA,8EAkDC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maybe-upload-media.d.ts","sourceRoot":"","sources":["../../../src/components/post-publish-panel/maybe-upload-media.js"],"names":[],"mappings":"AA+GA,
|
|
1
|
+
{"version":3,"file":"maybe-upload-media.d.ts","sourceRoot":"","sources":["../../../src/components/post-publish-panel/maybe-upload-media.js"],"names":[],"mappings":"AA+GA,oFA8JC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-status/index.js"],"names":[],"mappings":"AAmFA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-status/index.js"],"names":[],"mappings":"AAmFA,yEAkMC;AArOD;;;;IA0BE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hierarchical-term-selector.d.ts","sourceRoot":"","sources":["../../../src/components/post-taxonomies/hierarchical-term-selector.js"],"names":[],"mappings":"AA2CA;;;;;;;GAOG;AACH,0CALW,MAAM,EAAE,SACR,MAAM,EAAE,GAEP,MAAM,EAAE,CAqCnB;AAED;;;;;;;GAOG;AACH,gCALW,MAAM,EAAE,UACR,MAAM,GAAC,MAAM,QACb,MAAM,GACL,MAAM,CAUjB;AAED;;;;;GAKG;AACH,8CAHW,MAAM,GACL,CAAC,CAAS,IAAM,EAAN,MAAM,KAAG,CAAC,MAAM,GAAC,OAAO,CAAC,CAAC,CAmC/C;AAED;;;;;;GAMG;AACH,mDAHG;IAAsB,IAAI,EAAlB,MAAM;CACd,GAAS,OAAO,
|
|
1
|
+
{"version":3,"file":"hierarchical-term-selector.d.ts","sourceRoot":"","sources":["../../../src/components/post-taxonomies/hierarchical-term-selector.js"],"names":[],"mappings":"AA2CA;;;;;;;GAOG;AACH,0CALW,MAAM,EAAE,SACR,MAAM,EAAE,GAEP,MAAM,EAAE,CAqCnB;AAED;;;;;;;GAOG;AACH,gCALW,MAAM,EAAE,UACR,MAAM,GAAC,MAAM,QACb,MAAM,GACL,MAAM,CAUjB;AAED;;;;;GAKG;AACH,8CAHW,MAAM,GACL,CAAC,CAAS,IAAM,EAAN,MAAM,KAAG,CAAC,MAAM,GAAC,OAAO,CAAC,CAAC,CAmC/C;AAED;;;;;;GAMG;AACH,mDAHG;IAAsB,IAAI,EAAlB,MAAM;CACd,GAAS,OAAO,CAsUlB;;;;;;;yBAzae,OAAO;;wJASC,CAAC;4BAGS,CAAC;;;;kCAIJ,OAAO;;6BAIJ,CAAC;yBASjC,CAAC,iCAC6B,OAChC;+BACQ,CAAA;0BAMyB,CAAA,2DAE3B,CAAC;0BACJ,CAAC;iCAEM,CAAC;iCACP,CAAC;wCAGS,CAAA;2BACsB,CAAC;kCASpC,CAAD;;;;;yBAI0B,OACxB;;wJAOW,CAAC;4BACX,CAAC;;;;kCAIuB,OAAO;;6BAGiB,CAAC;yBAG7C,CAAC,iCACuB,OAAO;+BACjB,CAAC;0BAKmC,CAAC,2DAEtD,CAAC;0BAEoB,CAAC;iCAMzB,CAAD;iCAA2C,CAAC;wCAED,CAAC;2BAES,CAAA;kCAInD,CAAC;;yBAGgB,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"most-used-terms.d.ts","sourceRoot":"","sources":["../../../src/components/post-taxonomies/most-used-terms.js"],"names":[],"mappings":"AAsBA;;;
|
|
1
|
+
{"version":3,"file":"most-used-terms.d.ts","sourceRoot":"","sources":["../../../src/components/post-taxonomies/most-used-terms.js"],"names":[],"mappings":"AAsBA;;;uCAsDC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-url/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-url/index.js"],"names":[],"mappings":"AA0BA;;;;;;;;;;;GAWG;AACH,wDAFY,SAAS,CAoJpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/preview-dropdown/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/preview-dropdown/index.js"],"names":[],"mappings":"AA8BA;;;uCAoIC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/save-publish-panels/index.js"],"names":[],"mappings":"AAqBA;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/save-publish-panels/index.js"],"names":[],"mappings":"AAqBA;;;;;gCAyFC;AA3FD;kHAoBmB,OACf;;EArBiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/zoom-out-toggle/index.js"],"names":[],"mappings":";AAUA,8DAqBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-actions.d.ts","sourceRoot":"","sources":["../../../src/dataviews/store/private-actions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"private-actions.d.ts","sourceRoot":"","sources":["../../../src/dataviews/store/private-actions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAyBnD,wBAAgB,oBAAoB,CAAE,IAAI,EACzC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAE,IAAI,CAAE;;;;;EAQtB;AAED,wBAAgB,sBAAsB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM;;;;;EAQhB;AAED,wBAAgB,UAAU,CAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;;;;EAMrD;AAED,eAAO,MAAM,uBAAuB,aACvB,MAAM,oBACI;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,kBA2EtC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.8.1",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -32,40 +32,41 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.16.0",
|
|
35
|
-
"@wordpress/a11y": "^4.
|
|
36
|
-
"@wordpress/api-fetch": "^7.
|
|
37
|
-
"@wordpress/blob": "^4.
|
|
38
|
-
"@wordpress/block-editor": "^14.
|
|
39
|
-
"@wordpress/blocks": "^13.
|
|
40
|
-
"@wordpress/commands": "^1.
|
|
41
|
-
"@wordpress/components": "^28.8.1
|
|
42
|
-
"@wordpress/compose": "^7.8.1
|
|
43
|
-
"@wordpress/core-data": "^7.
|
|
44
|
-
"@wordpress/data": "^10.
|
|
45
|
-
"@wordpress/dataviews": "^4.
|
|
46
|
-
"@wordpress/date": "^5.
|
|
47
|
-
"@wordpress/deprecated": "^4.
|
|
48
|
-
"@wordpress/dom": "^4.
|
|
49
|
-
"@wordpress/element": "^6.
|
|
50
|
-
"@wordpress/
|
|
51
|
-
"@wordpress/
|
|
52
|
-
"@wordpress/
|
|
53
|
-
"@wordpress/
|
|
54
|
-
"@wordpress/
|
|
55
|
-
"@wordpress/
|
|
56
|
-
"@wordpress/
|
|
57
|
-
"@wordpress/
|
|
58
|
-
"@wordpress/
|
|
59
|
-
"@wordpress/
|
|
60
|
-
"@wordpress/
|
|
61
|
-
"@wordpress/
|
|
62
|
-
"@wordpress/
|
|
63
|
-
"@wordpress/
|
|
64
|
-
"@wordpress/
|
|
65
|
-
"@wordpress/
|
|
66
|
-
"@wordpress/
|
|
67
|
-
"@wordpress/
|
|
68
|
-
"@wordpress/
|
|
35
|
+
"@wordpress/a11y": "^4.8.1",
|
|
36
|
+
"@wordpress/api-fetch": "^7.8.1",
|
|
37
|
+
"@wordpress/blob": "^4.8.1",
|
|
38
|
+
"@wordpress/block-editor": "^14.3.1",
|
|
39
|
+
"@wordpress/blocks": "^13.8.1",
|
|
40
|
+
"@wordpress/commands": "^1.8.1",
|
|
41
|
+
"@wordpress/components": "^28.8.1",
|
|
42
|
+
"@wordpress/compose": "^7.8.1",
|
|
43
|
+
"@wordpress/core-data": "^7.8.1",
|
|
44
|
+
"@wordpress/data": "^10.8.1",
|
|
45
|
+
"@wordpress/dataviews": "^4.4.1",
|
|
46
|
+
"@wordpress/date": "^5.8.1",
|
|
47
|
+
"@wordpress/deprecated": "^4.8.1",
|
|
48
|
+
"@wordpress/dom": "^4.8.1",
|
|
49
|
+
"@wordpress/element": "^6.8.1",
|
|
50
|
+
"@wordpress/fields": "^0.0.1",
|
|
51
|
+
"@wordpress/hooks": "^4.8.1",
|
|
52
|
+
"@wordpress/html-entities": "^4.8.1",
|
|
53
|
+
"@wordpress/i18n": "^5.8.1",
|
|
54
|
+
"@wordpress/icons": "^10.8.1",
|
|
55
|
+
"@wordpress/interface": "^6.8.1",
|
|
56
|
+
"@wordpress/keyboard-shortcuts": "^5.8.1",
|
|
57
|
+
"@wordpress/keycodes": "^4.8.1",
|
|
58
|
+
"@wordpress/media-utils": "^5.8.1",
|
|
59
|
+
"@wordpress/notices": "^5.8.1",
|
|
60
|
+
"@wordpress/patterns": "^2.8.1",
|
|
61
|
+
"@wordpress/plugins": "^7.8.1",
|
|
62
|
+
"@wordpress/preferences": "^4.8.1",
|
|
63
|
+
"@wordpress/private-apis": "^1.8.1",
|
|
64
|
+
"@wordpress/reusable-blocks": "^5.8.1",
|
|
65
|
+
"@wordpress/rich-text": "^7.8.1",
|
|
66
|
+
"@wordpress/server-side-render": "^5.8.1",
|
|
67
|
+
"@wordpress/url": "^4.8.1",
|
|
68
|
+
"@wordpress/warning": "^3.8.1",
|
|
69
|
+
"@wordpress/wordcount": "^4.8.1",
|
|
69
70
|
"change-case": "^4.1.2",
|
|
70
71
|
"client-zip": "^2.4.5",
|
|
71
72
|
"clsx": "^2.1.1",
|
|
@@ -85,5 +86,5 @@
|
|
|
85
86
|
"publishConfig": {
|
|
86
87
|
"access": "public"
|
|
87
88
|
},
|
|
88
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "cf707c1f25a2716e310cc8f9afcc8554405c79ac"
|
|
89
90
|
}
|
|
@@ -7,22 +7,50 @@ import { store as coreDataStore } from '@wordpress/core-data';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { store as editorStore } from '../store';
|
|
10
|
+
import { unlock } from '../lock-unlock';
|
|
11
|
+
|
|
12
|
+
function getMetadata( registry, context, registeredFields ) {
|
|
13
|
+
let metaFields = {};
|
|
14
|
+
const type = registry.select( editorStore ).getCurrentPostType();
|
|
15
|
+
const { getEditedEntityRecord } = registry.select( coreDataStore );
|
|
16
|
+
|
|
17
|
+
if ( context?.postType && context?.postId ) {
|
|
18
|
+
metaFields = getEditedEntityRecord(
|
|
19
|
+
'postType',
|
|
20
|
+
context?.postType,
|
|
21
|
+
context?.postId
|
|
22
|
+
).meta;
|
|
23
|
+
} else if ( type === 'wp_template' ) {
|
|
24
|
+
// Populate the `metaFields` object with the default values.
|
|
25
|
+
Object.entries( registeredFields || {} ).forEach(
|
|
26
|
+
( [ key, props ] ) => {
|
|
27
|
+
if ( props.default ) {
|
|
28
|
+
metaFields[ key ] = props.default;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return metaFields;
|
|
35
|
+
}
|
|
10
36
|
|
|
11
37
|
export default {
|
|
12
38
|
name: 'core/post-meta',
|
|
13
39
|
getValues( { registry, context, bindings } ) {
|
|
14
|
-
const
|
|
15
|
-
.select( coreDataStore )
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
)?.meta;
|
|
40
|
+
const { getRegisteredPostMeta } = unlock(
|
|
41
|
+
registry.select( coreDataStore )
|
|
42
|
+
);
|
|
43
|
+
const registeredFields = getRegisteredPostMeta( context?.postType );
|
|
44
|
+
const metaFields = getMetadata( registry, context, registeredFields );
|
|
45
|
+
|
|
21
46
|
const newValues = {};
|
|
22
47
|
for ( const [ attributeName, source ] of Object.entries( bindings ) ) {
|
|
23
|
-
// Use the
|
|
48
|
+
// Use the value, the field label, or the field key.
|
|
49
|
+
const metaKey = source.args.key;
|
|
24
50
|
newValues[ attributeName ] =
|
|
25
|
-
|
|
51
|
+
metaFields?.[ metaKey ] ??
|
|
52
|
+
registeredFields?.[ metaKey ]?.title ??
|
|
53
|
+
metaKey;
|
|
26
54
|
}
|
|
27
55
|
return newValues;
|
|
28
56
|
},
|
|
@@ -82,23 +110,31 @@ export default {
|
|
|
82
110
|
return true;
|
|
83
111
|
},
|
|
84
112
|
getFieldsList( { registry, context } ) {
|
|
85
|
-
const
|
|
86
|
-
.select( coreDataStore )
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
context?.postId
|
|
91
|
-
).meta;
|
|
113
|
+
const { getRegisteredPostMeta } = unlock(
|
|
114
|
+
registry.select( coreDataStore )
|
|
115
|
+
);
|
|
116
|
+
const registeredFields = getRegisteredPostMeta( context?.postType );
|
|
117
|
+
const metaFields = getMetadata( registry, context, registeredFields );
|
|
92
118
|
|
|
93
119
|
if ( ! metaFields || ! Object.keys( metaFields ).length ) {
|
|
94
120
|
return null;
|
|
95
121
|
}
|
|
96
122
|
|
|
97
|
-
// Remove footnotes or private keys from the list of fields.
|
|
98
123
|
return Object.fromEntries(
|
|
99
|
-
Object.entries( metaFields )
|
|
100
|
-
|
|
101
|
-
|
|
124
|
+
Object.entries( metaFields )
|
|
125
|
+
// Remove footnotes or private keys from the list of fields.
|
|
126
|
+
.filter(
|
|
127
|
+
( [ key ] ) =>
|
|
128
|
+
key !== 'footnotes' && key.charAt( 0 ) !== '_'
|
|
129
|
+
)
|
|
130
|
+
// Return object with label and value.
|
|
131
|
+
.map( ( [ key, value ] ) => [
|
|
132
|
+
key,
|
|
133
|
+
{
|
|
134
|
+
label: registeredFields?.[ key ]?.title || key,
|
|
135
|
+
value,
|
|
136
|
+
},
|
|
137
|
+
] )
|
|
102
138
|
);
|
|
103
139
|
},
|
|
104
140
|
};
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { store as blocksStore } from '@wordpress/blocks';
|
|
5
|
-
import {
|
|
5
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
6
6
|
import { SearchControl, Button } from '@wordpress/components';
|
|
7
7
|
import { __, _n, sprintf } from '@wordpress/i18n';
|
|
8
8
|
import { useEffect, useState } from '@wordpress/element';
|
|
9
|
-
import { useDebounce
|
|
9
|
+
import { useDebounce } from '@wordpress/compose';
|
|
10
10
|
import { speak } from '@wordpress/a11y';
|
|
11
11
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
12
12
|
|
|
@@ -17,21 +17,48 @@ import { unlock } from '../../lock-unlock';
|
|
|
17
17
|
import { store as editorStore } from '../../store';
|
|
18
18
|
import BlockManagerCategory from './category';
|
|
19
19
|
|
|
20
|
-
function BlockManager( {
|
|
21
|
-
blockTypes,
|
|
22
|
-
categories,
|
|
23
|
-
hasBlockSupport,
|
|
24
|
-
isMatchingSearchTerm,
|
|
25
|
-
numberOfHiddenBlocks,
|
|
26
|
-
enableAllBlockTypes,
|
|
27
|
-
} ) {
|
|
20
|
+
export default function BlockManager() {
|
|
28
21
|
const debouncedSpeak = useDebounce( speak, 500 );
|
|
29
22
|
const [ search, setSearch ] = useState( '' );
|
|
23
|
+
const { showBlockTypes } = unlock( useDispatch( editorStore ) );
|
|
30
24
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
const {
|
|
26
|
+
blockTypes,
|
|
27
|
+
categories,
|
|
28
|
+
hasBlockSupport,
|
|
29
|
+
isMatchingSearchTerm,
|
|
30
|
+
numberOfHiddenBlocks,
|
|
31
|
+
} = useSelect( ( select ) => {
|
|
32
|
+
// Some hidden blocks become unregistered
|
|
33
|
+
// by removing for instance the plugin that registered them, yet
|
|
34
|
+
// they're still remain as hidden by the user's action.
|
|
35
|
+
// We consider "hidden", blocks which were hidden and
|
|
36
|
+
// are still registered.
|
|
37
|
+
const _blockTypes = select( blocksStore ).getBlockTypes();
|
|
38
|
+
const hiddenBlockTypes = (
|
|
39
|
+
select( preferencesStore ).get( 'core', 'hiddenBlockTypes' ) ?? []
|
|
40
|
+
).filter( ( hiddenBlock ) => {
|
|
41
|
+
return _blockTypes.some(
|
|
42
|
+
( registeredBlock ) => registeredBlock.name === hiddenBlock
|
|
43
|
+
);
|
|
44
|
+
} );
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
blockTypes: _blockTypes,
|
|
48
|
+
categories: select( blocksStore ).getCategories(),
|
|
49
|
+
hasBlockSupport: select( blocksStore ).hasBlockSupport,
|
|
50
|
+
isMatchingSearchTerm: select( blocksStore ).isMatchingSearchTerm,
|
|
51
|
+
numberOfHiddenBlocks:
|
|
52
|
+
Array.isArray( hiddenBlockTypes ) && hiddenBlockTypes.length,
|
|
53
|
+
};
|
|
54
|
+
}, [] );
|
|
55
|
+
|
|
56
|
+
function enableAllBlockTypes( newBlockTypes ) {
|
|
57
|
+
const blockNames = newBlockTypes.map( ( { name } ) => name );
|
|
58
|
+
showBlockTypes( blockNames );
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const filteredBlockTypes = blockTypes.filter(
|
|
35
62
|
( blockType ) =>
|
|
36
63
|
hasBlockSupport( blockType, 'inserter', true ) &&
|
|
37
64
|
( ! search || isMatchingSearchTerm( blockType, search ) ) &&
|
|
@@ -44,14 +71,14 @@ function BlockManager( {
|
|
|
44
71
|
if ( ! search ) {
|
|
45
72
|
return;
|
|
46
73
|
}
|
|
47
|
-
const count =
|
|
74
|
+
const count = filteredBlockTypes.length;
|
|
48
75
|
const resultsFoundMessage = sprintf(
|
|
49
76
|
/* translators: %d: number of results. */
|
|
50
77
|
_n( '%d result found.', '%d results found.', count ),
|
|
51
78
|
count
|
|
52
79
|
);
|
|
53
80
|
debouncedSpeak( resultsFoundMessage );
|
|
54
|
-
}, [
|
|
81
|
+
}, [ filteredBlockTypes?.length, search, debouncedSpeak ] );
|
|
55
82
|
|
|
56
83
|
return (
|
|
57
84
|
<div className="editor-block-manager__content">
|
|
@@ -67,10 +94,11 @@ function BlockManager( {
|
|
|
67
94
|
numberOfHiddenBlocks
|
|
68
95
|
) }
|
|
69
96
|
<Button
|
|
70
|
-
|
|
71
|
-
__next40pxDefaultSize={ false }
|
|
97
|
+
__next40pxDefaultSize
|
|
72
98
|
variant="link"
|
|
73
|
-
onClick={ () =>
|
|
99
|
+
onClick={ () =>
|
|
100
|
+
enableAllBlockTypes( filteredBlockTypes )
|
|
101
|
+
}
|
|
74
102
|
>
|
|
75
103
|
{ __( 'Reset' ) }
|
|
76
104
|
</Button>
|
|
@@ -90,7 +118,7 @@ function BlockManager( {
|
|
|
90
118
|
aria-label={ __( 'Available block types' ) }
|
|
91
119
|
className="editor-block-manager__results"
|
|
92
120
|
>
|
|
93
|
-
{
|
|
121
|
+
{ filteredBlockTypes.length === 0 && (
|
|
94
122
|
<p className="editor-block-manager__no-results">
|
|
95
123
|
{ __( 'No blocks found.' ) }
|
|
96
124
|
</p>
|
|
@@ -99,7 +127,7 @@ function BlockManager( {
|
|
|
99
127
|
<BlockManagerCategory
|
|
100
128
|
key={ category.slug }
|
|
101
129
|
title={ category.title }
|
|
102
|
-
blockTypes={
|
|
130
|
+
blockTypes={ filteredBlockTypes.filter(
|
|
103
131
|
( blockType ) =>
|
|
104
132
|
blockType.category === category.slug
|
|
105
133
|
) }
|
|
@@ -107,7 +135,7 @@ function BlockManager( {
|
|
|
107
135
|
) ) }
|
|
108
136
|
<BlockManagerCategory
|
|
109
137
|
title={ __( 'Uncategorized' ) }
|
|
110
|
-
blockTypes={
|
|
138
|
+
blockTypes={ filteredBlockTypes.filter(
|
|
111
139
|
( { category } ) => ! category
|
|
112
140
|
) }
|
|
113
141
|
/>
|
|
@@ -115,48 +143,3 @@ function BlockManager( {
|
|
|
115
143
|
</div>
|
|
116
144
|
);
|
|
117
145
|
}
|
|
118
|
-
|
|
119
|
-
export default compose( [
|
|
120
|
-
withSelect( ( select ) => {
|
|
121
|
-
const {
|
|
122
|
-
getBlockTypes,
|
|
123
|
-
getCategories,
|
|
124
|
-
hasBlockSupport,
|
|
125
|
-
isMatchingSearchTerm,
|
|
126
|
-
} = select( blocksStore );
|
|
127
|
-
const { get } = select( preferencesStore );
|
|
128
|
-
|
|
129
|
-
// Some hidden blocks become unregistered
|
|
130
|
-
// by removing for instance the plugin that registered them, yet
|
|
131
|
-
// they're still remain as hidden by the user's action.
|
|
132
|
-
// We consider "hidden", blocks which were hidden and
|
|
133
|
-
// are still registered.
|
|
134
|
-
const blockTypes = getBlockTypes();
|
|
135
|
-
const hiddenBlockTypes = (
|
|
136
|
-
get( 'core', 'hiddenBlockTypes' ) ?? []
|
|
137
|
-
).filter( ( hiddenBlock ) => {
|
|
138
|
-
return blockTypes.some(
|
|
139
|
-
( registeredBlock ) => registeredBlock.name === hiddenBlock
|
|
140
|
-
);
|
|
141
|
-
} );
|
|
142
|
-
const numberOfHiddenBlocks =
|
|
143
|
-
Array.isArray( hiddenBlockTypes ) && hiddenBlockTypes.length;
|
|
144
|
-
|
|
145
|
-
return {
|
|
146
|
-
blockTypes,
|
|
147
|
-
categories: getCategories(),
|
|
148
|
-
hasBlockSupport,
|
|
149
|
-
isMatchingSearchTerm,
|
|
150
|
-
numberOfHiddenBlocks,
|
|
151
|
-
};
|
|
152
|
-
} ),
|
|
153
|
-
withDispatch( ( dispatch ) => {
|
|
154
|
-
const { showBlockTypes } = unlock( dispatch( editorStore ) );
|
|
155
|
-
return {
|
|
156
|
-
enableAllBlockTypes: ( blockTypes ) => {
|
|
157
|
-
const blockNames = blockTypes.map( ( { name } ) => name );
|
|
158
|
-
showBlockTypes( blockNames );
|
|
159
|
-
},
|
|
160
|
-
};
|
|
161
|
-
} ),
|
|
162
|
-
] )( BlockManager );
|