@wordpress/editor 14.0.3 → 14.2.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 +16 -12
- package/README.md +189 -24
- package/build/components/create-template-part-modal/index.js +2 -0
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/document-bar/index.js +11 -4
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/editor/index.js +18 -24
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-interface/index.js +3 -1
- package/build/components/editor-interface/index.js.map +1 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js +9 -0
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build/components/entities-saved-states/index.js +28 -0
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/index.js +1 -1
- package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build/components/header/index.js +6 -2
- package/build/components/header/index.js.map +1 -1
- package/build/components/index.js +15 -0
- package/build/components/index.js.map +1 -1
- package/build/components/post-actions/actions.js +286 -263
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +2 -0
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +4 -0
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-button/label.js +5 -0
- package/build/components/post-publish-button/label.js.map +1 -1
- package/build/components/post-publish-panel/index.js +4 -0
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-slug/check.js +8 -1
- package/build/components/post-slug/check.js.map +1 -1
- package/build/components/post-slug/index.js +6 -0
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-status/index.js +2 -1
- package/build/components/post-status/index.js.map +1 -1
- package/build/components/post-sticky/check.js +8 -0
- package/build/components/post-sticky/check.js.map +1 -1
- package/build/components/post-sticky/index.js +13 -13
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-switch-to-draft-button/index.js +11 -2
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-sync-status/index.js +5 -1
- package/build/components/post-sync-status/index.js.map +1 -1
- package/build/components/post-taxonomies/check.js +8 -0
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +14 -2
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +9 -0
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/panel.js +10 -0
- package/build/components/post-taxonomies/panel.js.map +1 -1
- package/build/components/post-template/create-new-template-modal.js +2 -0
- package/build/components/post-template/create-new-template-modal.js.map +1 -1
- package/build/components/post-title/index.js +4 -8
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/post-title-raw.js +3 -7
- package/build/components/post-title/post-title-raw.js.map +1 -1
- package/build/components/post-trash/check.js +8 -0
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-trash/index.js +5 -1
- package/build/components/post-trash/index.js.map +1 -1
- package/build/components/provider/index.js +18 -15
- package/build/components/provider/index.js.map +1 -1
- package/build/components/sidebar/index.js +2 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar/post-summary.js +2 -3
- package/build/components/sidebar/post-summary.js.map +1 -1
- package/build/components/table-of-contents/index.js +11 -0
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/components/template-part-content-panel/index.js +70 -0
- package/build/components/template-part-content-panel/index.js.map +1 -0
- package/build/components/template-part-menu-items/convert-to-regular.js +38 -0
- package/build/components/template-part-menu-items/convert-to-regular.js.map +1 -0
- package/build/components/template-part-menu-items/convert-to-template-part.js +77 -0
- package/build/components/template-part-menu-items/convert-to-template-part.js.map +1 -0
- package/build/components/template-part-menu-items/index.js +67 -0
- package/build/components/template-part-menu-items/index.js.map +1 -0
- package/build/components/template-part-menu-items/index.native.js +10 -0
- package/build/components/template-part-menu-items/index.native.js.map +1 -0
- package/build/components/theme-support-check/index.js +9 -0
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/components/time-to-read/index.js +6 -0
- package/build/components/time-to-read/index.js.map +1 -1
- package/build/components/word-count/index.js +5 -1
- package/build/components/word-count/index.js.map +1 -1
- package/build/dataviews/api.js +61 -0
- package/build/dataviews/api.js.map +1 -0
- package/build/dataviews/store/private-actions.js +28 -0
- package/build/dataviews/store/private-actions.js.map +1 -0
- package/build/dataviews/store/private-selectors.js +20 -0
- package/build/dataviews/store/private-selectors.js.map +1 -0
- package/build/dataviews/store/reducer.js +36 -0
- package/build/dataviews/store/reducer.js.map +1 -0
- package/build/index.js +12 -0
- package/build/index.js.map +1 -1
- package/build/private-apis.js +0 -6
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +0 -2
- package/build/private-apis.native.js.map +1 -1
- package/build/store/private-actions.js +21 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +5 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +4 -1
- package/build/store/reducer.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +2 -0
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/document-bar/index.js +11 -4
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/editor/index.js +19 -24
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-interface/index.js +3 -1
- package/build-module/components/editor-interface/index.js.map +1 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +10 -0
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +28 -0
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/index.js +1 -1
- package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/header/index.js +6 -2
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/index.js +16 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/post-actions/actions.js +286 -263
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +2 -0
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +4 -0
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/label.js +6 -0
- package/build-module/components/post-publish-button/label.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +4 -0
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-slug/check.js +9 -0
- package/build-module/components/post-slug/check.js.map +1 -1
- package/build-module/components/post-slug/index.js +6 -0
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-status/index.js +2 -1
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-sticky/check.js +9 -0
- package/build-module/components/post-sticky/check.js.map +1 -1
- package/build-module/components/post-sticky/index.js +15 -13
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +10 -1
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-sync-status/index.js +6 -0
- package/build-module/components/post-sync-status/index.js.map +1 -1
- package/build-module/components/post-taxonomies/check.js +9 -0
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +14 -2
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +9 -0
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/panel.js +10 -0
- package/build-module/components/post-taxonomies/panel.js.map +1 -1
- package/build-module/components/post-template/create-new-template-modal.js +2 -0
- package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
- package/build-module/components/post-title/index.js +4 -8
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/post-title-raw.js +3 -7
- package/build-module/components/post-title/post-title-raw.js.map +1 -1
- package/build-module/components/post-trash/check.js +9 -0
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-trash/index.js +6 -0
- package/build-module/components/post-trash/index.js.map +1 -1
- package/build-module/components/provider/index.js +18 -15
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +2 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-summary.js +2 -3
- package/build-module/components/sidebar/post-summary.js.map +1 -1
- package/build-module/components/table-of-contents/index.js +11 -0
- package/build-module/components/table-of-contents/index.js.map +1 -1
- package/build-module/components/template-part-content-panel/index.js +63 -0
- package/build-module/components/template-part-content-panel/index.js.map +1 -0
- package/build-module/components/template-part-menu-items/convert-to-regular.js +31 -0
- package/build-module/components/template-part-menu-items/convert-to-regular.js.map +1 -0
- package/build-module/components/template-part-menu-items/convert-to-template-part.js +71 -0
- package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -0
- package/build-module/components/template-part-menu-items/index.js +59 -0
- package/build-module/components/template-part-menu-items/index.js.map +1 -0
- package/build-module/components/template-part-menu-items/index.native.js +4 -0
- package/build-module/components/template-part-menu-items/index.native.js.map +1 -0
- package/build-module/components/theme-support-check/index.js +10 -0
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/components/time-to-read/index.js +6 -0
- package/build-module/components/time-to-read/index.js.map +1 -1
- package/build-module/components/word-count/index.js +6 -0
- package/build-module/components/word-count/index.js.map +1 -1
- package/build-module/dataviews/api.js +54 -0
- package/build-module/dataviews/api.js.map +1 -0
- package/build-module/dataviews/store/private-actions.js +21 -0
- package/build-module/dataviews/store/private-actions.js.map +1 -0
- package/build-module/dataviews/store/private-selectors.js +14 -0
- package/build-module/dataviews/store/private-selectors.js.map +1 -0
- package/build-module/dataviews/store/reducer.js +29 -0
- package/build-module/dataviews/store/reducer.js.map +1 -0
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/private-apis.js +0 -6
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +0 -2
- package/build-module/private-apis.native.js.map +1 -1
- package/build-module/store/private-actions.js +1 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +4 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +3 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-style/style-rtl.css +10 -9
- package/build-style/style.css +10 -9
- package/build-types/dataviews/store/private-actions.d.ts +17 -0
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -0
- package/build-types/dataviews/store/private-selectors.d.ts +10 -0
- package/build-types/dataviews/store/private-selectors.d.ts.map +1 -0
- package/build-types/dataviews/store/reducer.d.ts +11 -0
- package/build-types/dataviews/store/reducer.d.ts.map +1 -0
- package/package.json +35 -35
- package/src/components/create-template-part-modal/index.js +2 -0
- package/src/components/create-template-part-modal/style.scss +0 -6
- package/src/components/document-bar/index.js +11 -4
- package/src/components/editor/index.js +23 -28
- package/src/components/editor-interface/index.js +2 -0
- package/src/components/entities-saved-states/hooks/use-is-dirty.js +9 -0
- package/src/components/entities-saved-states/index.js +26 -0
- package/src/components/global-keyboard-shortcuts/index.js +1 -1
- package/src/components/header/index.js +2 -1
- package/src/components/index.js +16 -0
- package/src/components/keyboard-shortcut-help-modal/style.scss +0 -3
- package/src/components/post-actions/actions.js +376 -387
- package/src/components/post-actions/index.js +2 -0
- package/src/components/post-card-panel/style.scss +4 -0
- package/src/components/post-panel-row/style.scss +1 -1
- package/src/components/post-publish-button/index.js +3 -0
- package/src/components/post-publish-button/label.js +5 -0
- package/src/components/post-publish-panel/index.js +3 -0
- package/src/components/post-slug/check.js +8 -0
- package/src/components/post-slug/index.js +5 -0
- package/src/components/post-status/index.js +2 -0
- package/src/components/post-status/style.scss +5 -0
- package/src/components/post-sticky/check.js +8 -0
- package/src/components/post-sticky/index.js +14 -12
- package/src/components/post-sticky/style.scss +3 -2
- package/src/components/post-switch-to-draft-button/index.js +10 -1
- package/src/components/post-sync-status/index.js +5 -0
- package/src/components/post-taxonomies/check.js +8 -0
- package/src/components/post-taxonomies/flat-term-selector.js +13 -2
- package/src/components/post-taxonomies/index.js +8 -0
- package/src/components/post-taxonomies/panel.js +9 -0
- package/src/components/post-template/create-new-template-modal.js +2 -0
- package/src/components/post-title/index.js +2 -5
- package/src/components/post-title/post-title-raw.js +2 -5
- package/src/components/post-trash/check.js +8 -0
- package/src/components/post-trash/index.js +5 -0
- package/src/components/provider/index.js +17 -17
- package/src/components/sidebar/index.js +2 -0
- package/src/components/sidebar/post-summary.js +1 -3
- package/src/components/table-of-contents/index.js +10 -0
- package/src/components/template-part-content-panel/index.js +62 -0
- package/src/components/template-part-menu-items/convert-to-regular.js +32 -0
- package/src/components/template-part-menu-items/convert-to-template-part.js +75 -0
- package/src/components/template-part-menu-items/index.js +59 -0
- package/src/components/template-part-menu-items/index.native.js +3 -0
- package/src/components/theme-support-check/index.js +9 -0
- package/src/components/time-to-read/index.js +5 -0
- package/src/components/word-count/index.js +5 -0
- package/src/dataviews/api.js +55 -0
- package/src/dataviews/store/private-actions.ts +30 -0
- package/src/dataviews/store/private-selectors.ts +15 -0
- package/src/dataviews/store/reducer.ts +44 -0
- package/src/index.js +1 -0
- package/src/private-apis.js +0 -6
- package/src/private-apis.native.js +0 -2
- package/src/store/private-actions.js +1 -0
- package/src/store/private-selectors.js +5 -0
- package/src/store/reducer.js +2 -0
- package/tsconfig.json +36 -0
- package/tsconfig.tsbuildinfo +1 -0
package/build-style/style.css
CHANGED
|
@@ -645,11 +645,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
645
645
|
.editor-create-template-part-modal {
|
|
646
646
|
z-index: 1000001;
|
|
647
647
|
}
|
|
648
|
-
@media (min-width: 600px) {
|
|
649
|
-
.editor-create-template-part-modal .components-modal__frame {
|
|
650
|
-
max-width: 500px;
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
648
|
|
|
654
649
|
.editor-create-template-part-modal__area-radio-group {
|
|
655
650
|
width: 100%;
|
|
@@ -1277,7 +1272,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
1277
1272
|
.editor-keyboard-shortcut-help-modal__shortcut-description {
|
|
1278
1273
|
flex: 1;
|
|
1279
1274
|
margin: 0;
|
|
1280
|
-
flex-basis: auto;
|
|
1281
1275
|
}
|
|
1282
1276
|
.editor-keyboard-shortcut-help-modal__shortcut-key-combination {
|
|
1283
1277
|
display: block;
|
|
@@ -1475,6 +1469,9 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
1475
1469
|
.editor-post-card-panel__icon.is-sync {
|
|
1476
1470
|
fill: var(--wp-block-synced-color);
|
|
1477
1471
|
}
|
|
1472
|
+
.editor-post-card-panel__icon.is-sync + .editor-post-card-panel__title {
|
|
1473
|
+
color: var(--wp-block-synced-color);
|
|
1474
|
+
}
|
|
1478
1475
|
|
|
1479
1476
|
.editor-post-card-panel__title-badge {
|
|
1480
1477
|
background: #f0f0f0;
|
|
@@ -1672,7 +1669,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
1672
1669
|
}
|
|
1673
1670
|
|
|
1674
1671
|
.editor-post-panel__row-label {
|
|
1675
|
-
width:
|
|
1672
|
+
width: 38%;
|
|
1676
1673
|
flex-shrink: 0;
|
|
1677
1674
|
min-height: 32px;
|
|
1678
1675
|
display: flex;
|
|
@@ -2002,9 +1999,13 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
2002
1999
|
padding: 0;
|
|
2003
2000
|
margin-bottom: 8px;
|
|
2004
2001
|
}
|
|
2002
|
+
.editor-change-status__content p.components-base-control__help:has(.components-checkbox-control__help) {
|
|
2003
|
+
margin-top: 4px;
|
|
2004
|
+
}
|
|
2005
2005
|
|
|
2006
|
-
.editor-post-
|
|
2007
|
-
|
|
2006
|
+
.editor-post-sticky__checkbox-control {
|
|
2007
|
+
border-top: 1px solid #e0e0e0;
|
|
2008
|
+
padding-top: 16px;
|
|
2008
2009
|
}
|
|
2009
2010
|
|
|
2010
2011
|
.editor-post-sync-status__value {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Action, AnyItem } from '@wordpress/dataviews';
|
|
5
|
+
export declare function registerEntityAction<Item extends AnyItem>(kind: string, name: string, config: Action<Item>): {
|
|
6
|
+
type: "REGISTER_ENTITY_ACTION";
|
|
7
|
+
kind: string;
|
|
8
|
+
name: string;
|
|
9
|
+
config: Action<Item>;
|
|
10
|
+
};
|
|
11
|
+
export declare function unregisterEntityAction(kind: string, name: string, actionId: string): {
|
|
12
|
+
type: "UNREGISTER_ENTITY_ACTION";
|
|
13
|
+
kind: string;
|
|
14
|
+
name: string;
|
|
15
|
+
actionId: string;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=private-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"private-actions.d.ts","sourceRoot":"","sources":["../../../src/dataviews/store/private-actions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE5D,wBAAgB,oBAAoB,CAAE,IAAI,SAAS,OAAO,EACzD,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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Action } from '@wordpress/dataviews';
|
|
5
|
+
/**
|
|
6
|
+
* Internal dependencies
|
|
7
|
+
*/
|
|
8
|
+
import type { State } from './reducer';
|
|
9
|
+
export declare function getEntityActions(state: State, kind: string, name: string): Action<any>[];
|
|
10
|
+
//# sourceMappingURL=private-selectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"private-selectors.d.ts","sourceRoot":"","sources":["../../../src/dataviews/store/private-selectors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD;;GAEG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAIvC,wBAAgB,gBAAgB,CAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAEzE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Action } from '@wordpress/dataviews';
|
|
2
|
+
type ReduxAction = ReturnType<typeof import('./private-actions').registerEntityAction> | ReturnType<typeof import('./private-actions').unregisterEntityAction>;
|
|
3
|
+
export type ActionState = Record<string, Record<string, Action<any>[]>>;
|
|
4
|
+
export type State = {
|
|
5
|
+
actions: ActionState;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import("redux").Reducer<import("redux").CombinedState<{
|
|
8
|
+
actions: never;
|
|
9
|
+
}>, ReduxAction>;
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=reducer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../../src/dataviews/store/reducer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,KAAK,WAAW,GACb,UAAU,CAAE,cAAc,mBAAmB,EAAE,oBAAoB,CAAE,GACrE,UAAU,CAAE,cAAc,mBAAmB,EAAE,sBAAsB,CAAE,CAAC;AAE3E,MAAM,MAAM,WAAW,GAAG,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,GAAG,CAAE,EAAE,CAAE,CAAE,CAAC;AAC9E,MAAM,MAAM,KAAK,GAAG;IACnB,OAAO,EAAE,WAAW,CAAC;CACrB,CAAC;;;;AA2BF,wBAEI"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "14.0
|
|
3
|
+
"version": "14.2.0",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -32,39 +32,39 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.16.0",
|
|
35
|
-
"@wordpress/a11y": "^4.0
|
|
36
|
-
"@wordpress/api-fetch": "^7.0
|
|
37
|
-
"@wordpress/blob": "^4.0
|
|
38
|
-
"@wordpress/block-editor": "^13.0
|
|
39
|
-
"@wordpress/blocks": "^13.0
|
|
40
|
-
"@wordpress/commands": "^1.0
|
|
41
|
-
"@wordpress/components": "^28.0
|
|
42
|
-
"@wordpress/compose": "^7.0
|
|
43
|
-
"@wordpress/core-data": "^7.0
|
|
44
|
-
"@wordpress/data": "^10.0
|
|
45
|
-
"@wordpress/date": "^5.0
|
|
46
|
-
"@wordpress/deprecated": "^4.0
|
|
47
|
-
"@wordpress/dom": "^4.0
|
|
48
|
-
"@wordpress/element": "^6.0
|
|
49
|
-
"@wordpress/hooks": "^4.0
|
|
50
|
-
"@wordpress/html-entities": "^4.0
|
|
51
|
-
"@wordpress/i18n": "^5.0
|
|
52
|
-
"@wordpress/icons": "^10.0
|
|
53
|
-
"@wordpress/interface": "^6.0
|
|
54
|
-
"@wordpress/keyboard-shortcuts": "^5.0
|
|
55
|
-
"@wordpress/keycodes": "^4.0
|
|
56
|
-
"@wordpress/media-utils": "^5.0
|
|
57
|
-
"@wordpress/notices": "^5.0
|
|
58
|
-
"@wordpress/patterns": "^2.0
|
|
59
|
-
"@wordpress/plugins": "^7.0
|
|
60
|
-
"@wordpress/preferences": "^4.0
|
|
61
|
-
"@wordpress/private-apis": "^1.0
|
|
62
|
-
"@wordpress/reusable-blocks": "^5.0
|
|
63
|
-
"@wordpress/rich-text": "^7.0
|
|
64
|
-
"@wordpress/server-side-render": "^5.0
|
|
65
|
-
"@wordpress/url": "^4.0
|
|
66
|
-
"@wordpress/warning": "^3.0
|
|
67
|
-
"@wordpress/wordcount": "^4.0
|
|
35
|
+
"@wordpress/a11y": "^4.2.0",
|
|
36
|
+
"@wordpress/api-fetch": "^7.2.0",
|
|
37
|
+
"@wordpress/blob": "^4.2.0",
|
|
38
|
+
"@wordpress/block-editor": "^13.2.0",
|
|
39
|
+
"@wordpress/blocks": "^13.2.0",
|
|
40
|
+
"@wordpress/commands": "^1.2.0",
|
|
41
|
+
"@wordpress/components": "^28.2.0",
|
|
42
|
+
"@wordpress/compose": "^7.2.0",
|
|
43
|
+
"@wordpress/core-data": "^7.2.0",
|
|
44
|
+
"@wordpress/data": "^10.2.0",
|
|
45
|
+
"@wordpress/date": "^5.2.0",
|
|
46
|
+
"@wordpress/deprecated": "^4.2.0",
|
|
47
|
+
"@wordpress/dom": "^4.2.0",
|
|
48
|
+
"@wordpress/element": "^6.2.0",
|
|
49
|
+
"@wordpress/hooks": "^4.2.0",
|
|
50
|
+
"@wordpress/html-entities": "^4.2.0",
|
|
51
|
+
"@wordpress/i18n": "^5.2.0",
|
|
52
|
+
"@wordpress/icons": "^10.2.0",
|
|
53
|
+
"@wordpress/interface": "^6.2.0",
|
|
54
|
+
"@wordpress/keyboard-shortcuts": "^5.2.0",
|
|
55
|
+
"@wordpress/keycodes": "^4.2.0",
|
|
56
|
+
"@wordpress/media-utils": "^5.2.0",
|
|
57
|
+
"@wordpress/notices": "^5.2.0",
|
|
58
|
+
"@wordpress/patterns": "^2.2.0",
|
|
59
|
+
"@wordpress/plugins": "^7.2.0",
|
|
60
|
+
"@wordpress/preferences": "^4.2.0",
|
|
61
|
+
"@wordpress/private-apis": "^1.2.0",
|
|
62
|
+
"@wordpress/reusable-blocks": "^5.2.0",
|
|
63
|
+
"@wordpress/rich-text": "^7.2.0",
|
|
64
|
+
"@wordpress/server-side-render": "^5.2.0",
|
|
65
|
+
"@wordpress/url": "^4.2.0",
|
|
66
|
+
"@wordpress/warning": "^3.2.0",
|
|
67
|
+
"@wordpress/wordcount": "^4.2.0",
|
|
68
68
|
"change-case": "^4.1.2",
|
|
69
69
|
"client-zip": "^2.4.5",
|
|
70
70
|
"clsx": "^2.1.1",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "aa5b14bb5bdbb8d8a02914e154c3bc1c2f18ace6"
|
|
87
87
|
}
|
|
@@ -53,6 +53,8 @@ export default function CreateTemplatePartModal( {
|
|
|
53
53
|
title={ modalTitle || defaultModalTitle }
|
|
54
54
|
onRequestClose={ restProps.closeModal }
|
|
55
55
|
overlayClassName="editor-create-template-part-modal"
|
|
56
|
+
focusOnMount="firstContentElement"
|
|
57
|
+
size="medium"
|
|
56
58
|
>
|
|
57
59
|
<CreateTemplatePartModalContents { ...restProps } />
|
|
58
60
|
</Modal>
|
|
@@ -52,10 +52,15 @@ const MotionButton = motion( Button );
|
|
|
52
52
|
* ```jsx
|
|
53
53
|
* <DocumentBar />
|
|
54
54
|
* ```
|
|
55
|
+
* @param {Object} props The component props.
|
|
56
|
+
* @param {string} props.title A title for the document, defaulting to the document or
|
|
57
|
+
* template title currently being edited.
|
|
58
|
+
* @param {import("@wordpress/components").IconType} props.icon An icon for the document, defaulting to an icon for document
|
|
59
|
+
* or template currently being edited.
|
|
55
60
|
*
|
|
56
61
|
* @return {JSX.Element} The rendered DocumentBar component.
|
|
57
62
|
*/
|
|
58
|
-
export default function DocumentBar() {
|
|
63
|
+
export default function DocumentBar( props ) {
|
|
59
64
|
const {
|
|
60
65
|
postType,
|
|
61
66
|
documentTitle,
|
|
@@ -111,7 +116,9 @@ export default function DocumentBar() {
|
|
|
111
116
|
const isTemplate = TEMPLATE_POST_TYPES.includes( postType );
|
|
112
117
|
const isGlobalEntity = GLOBAL_POST_TYPES.includes( postType );
|
|
113
118
|
const hasBackButton = !! onNavigateToPreviousEntityRecord;
|
|
114
|
-
const
|
|
119
|
+
const entityTitle = isTemplate ? templateTitle : documentTitle;
|
|
120
|
+
const title = props.title || entityTitle;
|
|
121
|
+
const icon = props.icon || templateIcon;
|
|
115
122
|
|
|
116
123
|
const mounted = useRef( false );
|
|
117
124
|
useEffect( () => {
|
|
@@ -180,12 +187,12 @@ export default function DocumentBar() {
|
|
|
180
187
|
isReducedMotion ? { duration: 0 } : undefined
|
|
181
188
|
}
|
|
182
189
|
>
|
|
183
|
-
<BlockIcon icon={
|
|
190
|
+
<BlockIcon icon={ icon } />
|
|
184
191
|
<Text
|
|
185
192
|
size="body"
|
|
186
193
|
as="h1"
|
|
187
194
|
aria-label={
|
|
188
|
-
TYPE_LABELS[ postType ]
|
|
195
|
+
! props.title && TYPE_LABELS[ postType ]
|
|
189
196
|
? // eslint-disable-next-line @wordpress/valid-sprintf
|
|
190
197
|
sprintf( TYPE_LABELS[ postType ], title )
|
|
191
198
|
: undefined
|
|
@@ -20,20 +20,16 @@ function Editor( {
|
|
|
20
20
|
templateId,
|
|
21
21
|
settings,
|
|
22
22
|
children,
|
|
23
|
+
initialEdits,
|
|
23
24
|
|
|
24
25
|
// This could be part of the settings.
|
|
25
26
|
onActionPerformed,
|
|
26
27
|
|
|
27
28
|
// The following abstractions are not ideal but necessary
|
|
28
29
|
// to account for site editor and post editor differences for now.
|
|
29
|
-
|
|
30
|
-
styles,
|
|
31
|
-
customSaveButton,
|
|
32
|
-
forceDisableBlockTools,
|
|
33
|
-
title,
|
|
34
|
-
iframeProps,
|
|
30
|
+
extraContent,
|
|
35
31
|
extraSidebarPanels,
|
|
36
|
-
|
|
32
|
+
...props
|
|
37
33
|
} ) {
|
|
38
34
|
const { post, template, hasLoadedPost } = useSelect(
|
|
39
35
|
( select ) => {
|
|
@@ -59,12 +55,7 @@ function Editor( {
|
|
|
59
55
|
);
|
|
60
56
|
|
|
61
57
|
return (
|
|
62
|
-
|
|
63
|
-
post={ post }
|
|
64
|
-
__unstableTemplate={ template }
|
|
65
|
-
settings={ settings }
|
|
66
|
-
useSubRegistry={ false }
|
|
67
|
-
>
|
|
58
|
+
<>
|
|
68
59
|
{ hasLoadedPost && ! post && (
|
|
69
60
|
<Notice status="warning" isDismissible={ false }>
|
|
70
61
|
{ __(
|
|
@@ -72,21 +63,25 @@ function Editor( {
|
|
|
72
63
|
) }
|
|
73
64
|
</Notice>
|
|
74
65
|
) }
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
66
|
+
{ !! post && (
|
|
67
|
+
<ExperimentalEditorProvider
|
|
68
|
+
post={ post }
|
|
69
|
+
__unstableTemplate={ template }
|
|
70
|
+
settings={ settings }
|
|
71
|
+
initialEdits={ initialEdits }
|
|
72
|
+
useSubRegistry={ false }
|
|
73
|
+
>
|
|
74
|
+
<EditorInterface { ...props }>
|
|
75
|
+
{ extraContent }
|
|
76
|
+
</EditorInterface>
|
|
77
|
+
<Sidebar
|
|
78
|
+
onActionPerformed={ onActionPerformed }
|
|
79
|
+
extraPanels={ extraSidebarPanels }
|
|
80
|
+
/>
|
|
81
|
+
{ children }
|
|
82
|
+
</ExperimentalEditorProvider>
|
|
83
|
+
) }
|
|
84
|
+
</>
|
|
90
85
|
);
|
|
91
86
|
}
|
|
92
87
|
|
|
@@ -57,6 +57,7 @@ export default function EditorInterface( {
|
|
|
57
57
|
customSaveButton,
|
|
58
58
|
forceDisableBlockTools,
|
|
59
59
|
title,
|
|
60
|
+
icon,
|
|
60
61
|
iframeProps,
|
|
61
62
|
} ) {
|
|
62
63
|
const {
|
|
@@ -140,6 +141,7 @@ export default function EditorInterface( {
|
|
|
140
141
|
customSaveButton={ customSaveButton }
|
|
141
142
|
forceDisableBlockTools={ forceDisableBlockTools }
|
|
142
143
|
title={ title }
|
|
144
|
+
icon={ icon }
|
|
143
145
|
/>
|
|
144
146
|
)
|
|
145
147
|
}
|
|
@@ -5,6 +5,15 @@ import { useSelect } from '@wordpress/data';
|
|
|
5
5
|
import { store as coreStore } from '@wordpress/core-data';
|
|
6
6
|
import { useMemo, useState } from '@wordpress/element';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Custom hook that determines if any entities are dirty (edited) and provides a way to manage selected/unselected entities.
|
|
10
|
+
*
|
|
11
|
+
* @return {Object} An object containing the following properties:
|
|
12
|
+
* - dirtyEntityRecords: An array of dirty entity records.
|
|
13
|
+
* - isDirty: A boolean indicating if there are any dirty entity records.
|
|
14
|
+
* - setUnselectedEntities: A function to set the unselected entities.
|
|
15
|
+
* - unselectedEntities: An array of unselected entities.
|
|
16
|
+
*/
|
|
8
17
|
export const useIsDirty = () => {
|
|
9
18
|
const { editedEntities, siteEdits, siteEntityConfig } = useSelect(
|
|
10
19
|
( select ) => {
|
|
@@ -26,6 +26,15 @@ function identity( values ) {
|
|
|
26
26
|
return values;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Renders the component for managing saved states of entities.
|
|
31
|
+
*
|
|
32
|
+
* @param {Object} props The component props.
|
|
33
|
+
* @param {Function} props.close The function to close the dialog.
|
|
34
|
+
* @param {Function} props.renderDialog The function to render the dialog.
|
|
35
|
+
*
|
|
36
|
+
* @return {JSX.Element} The rendered component.
|
|
37
|
+
*/
|
|
29
38
|
export default function EntitiesSavedStates( {
|
|
30
39
|
close,
|
|
31
40
|
renderDialog = undefined,
|
|
@@ -40,6 +49,23 @@ export default function EntitiesSavedStates( {
|
|
|
40
49
|
);
|
|
41
50
|
}
|
|
42
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Renders a panel for saving entities with dirty records.
|
|
54
|
+
*
|
|
55
|
+
* @param {Object} props The component props.
|
|
56
|
+
* @param {string} props.additionalPrompt Additional prompt to display.
|
|
57
|
+
* @param {Function} props.close Function to close the panel.
|
|
58
|
+
* @param {Function} props.onSave Function to call when saving entities.
|
|
59
|
+
* @param {boolean} props.saveEnabled Flag indicating if save is enabled.
|
|
60
|
+
* @param {string} props.saveLabel Label for the save button.
|
|
61
|
+
* @param {Function} props.renderDialog Function to render a custom dialog.
|
|
62
|
+
* @param {Array} props.dirtyEntityRecords Array of dirty entity records.
|
|
63
|
+
* @param {boolean} props.isDirty Flag indicating if there are dirty entities.
|
|
64
|
+
* @param {Function} props.setUnselectedEntities Function to set unselected entities.
|
|
65
|
+
* @param {Array} props.unselectedEntities Array of unselected entities.
|
|
66
|
+
*
|
|
67
|
+
* @return {JSX.Element} The rendered component.
|
|
68
|
+
*/
|
|
43
69
|
export function EntitiesSavedStatesExtensible( {
|
|
44
70
|
additionalPrompt = undefined,
|
|
45
71
|
close,
|
|
@@ -12,7 +12,7 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
|
12
12
|
import { store as editorStore } from '../../store';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Handles the keyboard shortcuts for the editor.
|
|
16
16
|
*
|
|
17
17
|
* It provides functionality for various keyboard shortcuts such as toggling editor mode,
|
|
18
18
|
* toggling distraction-free mode, undo/redo, saving the post, toggling list view,
|
|
@@ -51,6 +51,7 @@ function Header( {
|
|
|
51
51
|
forceDisableBlockTools,
|
|
52
52
|
setEntitiesSavedStatesCallback,
|
|
53
53
|
title,
|
|
54
|
+
icon,
|
|
54
55
|
} ) {
|
|
55
56
|
const isWideViewport = useViewportMatch( 'large' );
|
|
56
57
|
const isLargeViewport = useViewportMatch( 'medium' );
|
|
@@ -116,7 +117,7 @@ function Header( {
|
|
|
116
117
|
! isBlockToolsCollapsed && hasTopToolbar,
|
|
117
118
|
} ) }
|
|
118
119
|
>
|
|
119
|
-
{
|
|
120
|
+
<DocumentBar title={ title } icon={ icon } />
|
|
120
121
|
</div>
|
|
121
122
|
</motion.div>
|
|
122
123
|
<motion.div
|
package/src/components/index.js
CHANGED
|
@@ -105,5 +105,21 @@ export { default as CharacterCount } from './character-count';
|
|
|
105
105
|
export { default as EditorProvider } from './provider';
|
|
106
106
|
|
|
107
107
|
export * from './deprecated';
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Handles the keyboard shortcuts for the editor.
|
|
111
|
+
*
|
|
112
|
+
* It provides functionality for various keyboard shortcuts such as toggling editor mode,
|
|
113
|
+
* toggling distraction-free mode, undo/redo, saving the post, toggling list view,
|
|
114
|
+
* and toggling the sidebar.
|
|
115
|
+
*/
|
|
108
116
|
export const VisualEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Handles the keyboard shortcuts for the editor.
|
|
120
|
+
*
|
|
121
|
+
* It provides functionality for various keyboard shortcuts such as toggling editor mode,
|
|
122
|
+
* toggling distraction-free mode, undo/redo, saving the post, toggling list view,
|
|
123
|
+
* and toggling the sidebar.
|
|
124
|
+
*/
|
|
109
125
|
export const TextEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;
|