@wordpress/editor 14.7.1-next.1f6eadc42.0 → 14.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +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 +43 -62
- 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-interface/index.js +1 -2
- package/build/components/editor-interface/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 +3 -5
- 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-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/save-publish-panels/index.js +4 -10
- package/build/components/save-publish-panels/index.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 +44 -63
- 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-interface/index.js +1 -2
- package/build-module/components/editor-interface/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 +3 -5
- 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-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/save-publish-panels/index.js +4 -10
- package/build-module/components/save-publish-panels/index.js.map +1 -1
- package/build-style/style-rtl.css +37 -18
- package/build-style/style.css +37 -18
- 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-interface/index.d.ts +1 -2
- package/build-types/components/editor-interface/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-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/save-publish-panels/index.d.ts.map +1 -1
- package/package.json +36 -36
- package/src/bindings/post-meta.js +56 -20
- package/src/components/block-manager/index.js +49 -65
- package/src/components/document-bar/index.js +29 -41
- package/src/components/document-bar/style.scss +33 -15
- package/src/components/editor-interface/index.js +1 -2
- package/src/components/global-styles-provider/index.js +50 -36
- package/src/components/header/index.js +3 -6
- package/src/components/post-panel-row/style.scss +1 -0
- 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/save-publish-panels/index.js +2 -6
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useDispatch","Button","createSlotFill","__","useCallback","EntitiesSavedStates","PostPublishPanel","PluginPrePublishPanel","PluginPostPublishPanel","store","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Fill","Slot","ActionsPanelFill","SavePublishPanels","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","isEntitiesSavedStatesOpen","forceIsDirtyPublishPanel","closePublishSidebar","togglePublishSidebar","publishSidebarOpened","isPublishable","isDirty","hasOtherEntitiesChanges","select","isPublishSidebarOpened","isEditedPostPublishable","isCurrentPostPublished","isEditedPostDirty","hasNonPostEntityChanges","_hasOtherEntitiesChanges","openEntitiesSavedStates","unmountableContent","onClose","forceIsDirty","PrePublishExtension","PostPublishExtension","className","children","__next40pxDefaultSize","variant","onClick","disabled","accessibleWhenDisabled","close","bubblesVirtually"],"sources":["@wordpress/editor/src/components/save-publish-panels/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, createSlotFill } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport EntitiesSavedStates from '../entities-saved-states';\nimport PostPublishPanel from '../post-publish-panel';\nimport PluginPrePublishPanel from '../plugin-pre-publish-panel';\nimport PluginPostPublishPanel from '../plugin-post-publish-panel';\nimport { store as editorStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'ActionsPanel' );\n\nexport const ActionsPanelFill = Fill;\n\nexport default function SavePublishPanels( {\n\tsetEntitiesSavedStatesCallback,\n\tcloseEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n\tforceIsDirtyPublishPanel,\n} ) {\n\tconst { closePublishSidebar, togglePublishSidebar } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tpublishSidebarOpened,\n\t\tisPublishable,\n\t\tisDirty,\n\t\thasOtherEntitiesChanges,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisPublishSidebarOpened,\n\t\t\tisEditedPostPublishable,\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostDirty,\n\t\t\thasNonPostEntityChanges,\n\t\t} = select( editorStore );\n\t\tconst _hasOtherEntitiesChanges = hasNonPostEntityChanges();\n\t\treturn {\n\t\t\tpublishSidebarOpened: isPublishSidebarOpened(),\n\t\t\tisPublishable:\n\t\t\t\t! isCurrentPostPublished() && isEditedPostPublishable(),\n\t\t\tisDirty: _hasOtherEntitiesChanges || isEditedPostDirty(),\n\t\t\thasOtherEntitiesChanges: _hasOtherEntitiesChanges,\n\t\t};\n\t}, [] );\n\n\tconst openEntitiesSavedStates = useCallback(\n\t\t() => setEntitiesSavedStatesCallback( true ),\n\t\t[]\n\t);\n\n\t// It is ok for these components to be unmounted when not in visual use.\n\t// We don't want more than one present at a time, decide which to render.\n\tlet unmountableContent;\n\tif ( publishSidebarOpened ) {\n\t\tunmountableContent = (\n\t\t\t<PostPublishPanel\n\t\t\t\tonClose={ closePublishSidebar }\n\t\t\t\tforceIsDirty={ forceIsDirtyPublishPanel }\n\t\t\t\tPrePublishExtension={ PluginPrePublishPanel.Slot }\n\t\t\t\tPostPublishExtension={ PluginPostPublishPanel.Slot }\n\t\t\t/>\n\t\t);\n\t} else if ( isPublishable && ! hasOtherEntitiesChanges ) {\n\t\tunmountableContent = (\n\t\t\t<div className=\"editor-layout__toggle-publish-panel\">\n\t\t\t\t<Button\n\t\t\t\t\
|
|
1
|
+
{"version":3,"names":["useSelect","useDispatch","Button","createSlotFill","__","useCallback","EntitiesSavedStates","PostPublishPanel","PluginPrePublishPanel","PluginPostPublishPanel","store","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Fill","Slot","ActionsPanelFill","SavePublishPanels","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","isEntitiesSavedStatesOpen","forceIsDirtyPublishPanel","closePublishSidebar","togglePublishSidebar","publishSidebarOpened","isPublishable","isDirty","hasOtherEntitiesChanges","select","isPublishSidebarOpened","isEditedPostPublishable","isCurrentPostPublished","isEditedPostDirty","hasNonPostEntityChanges","_hasOtherEntitiesChanges","openEntitiesSavedStates","unmountableContent","onClose","forceIsDirty","PrePublishExtension","PostPublishExtension","className","children","__next40pxDefaultSize","variant","onClick","disabled","accessibleWhenDisabled","close","bubblesVirtually"],"sources":["@wordpress/editor/src/components/save-publish-panels/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, createSlotFill } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport EntitiesSavedStates from '../entities-saved-states';\nimport PostPublishPanel from '../post-publish-panel';\nimport PluginPrePublishPanel from '../plugin-pre-publish-panel';\nimport PluginPostPublishPanel from '../plugin-post-publish-panel';\nimport { store as editorStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'ActionsPanel' );\n\nexport const ActionsPanelFill = Fill;\n\nexport default function SavePublishPanels( {\n\tsetEntitiesSavedStatesCallback,\n\tcloseEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n\tforceIsDirtyPublishPanel,\n} ) {\n\tconst { closePublishSidebar, togglePublishSidebar } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tpublishSidebarOpened,\n\t\tisPublishable,\n\t\tisDirty,\n\t\thasOtherEntitiesChanges,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisPublishSidebarOpened,\n\t\t\tisEditedPostPublishable,\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostDirty,\n\t\t\thasNonPostEntityChanges,\n\t\t} = select( editorStore );\n\t\tconst _hasOtherEntitiesChanges = hasNonPostEntityChanges();\n\t\treturn {\n\t\t\tpublishSidebarOpened: isPublishSidebarOpened(),\n\t\t\tisPublishable:\n\t\t\t\t! isCurrentPostPublished() && isEditedPostPublishable(),\n\t\t\tisDirty: _hasOtherEntitiesChanges || isEditedPostDirty(),\n\t\t\thasOtherEntitiesChanges: _hasOtherEntitiesChanges,\n\t\t};\n\t}, [] );\n\n\tconst openEntitiesSavedStates = useCallback(\n\t\t() => setEntitiesSavedStatesCallback( true ),\n\t\t[]\n\t);\n\n\t// It is ok for these components to be unmounted when not in visual use.\n\t// We don't want more than one present at a time, decide which to render.\n\tlet unmountableContent;\n\tif ( publishSidebarOpened ) {\n\t\tunmountableContent = (\n\t\t\t<PostPublishPanel\n\t\t\t\tonClose={ closePublishSidebar }\n\t\t\t\tforceIsDirty={ forceIsDirtyPublishPanel }\n\t\t\t\tPrePublishExtension={ PluginPrePublishPanel.Slot }\n\t\t\t\tPostPublishExtension={ PluginPostPublishPanel.Slot }\n\t\t\t/>\n\t\t);\n\t} else if ( isPublishable && ! hasOtherEntitiesChanges ) {\n\t\tunmountableContent = (\n\t\t\t<div className=\"editor-layout__toggle-publish-panel\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ togglePublishSidebar }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open publish panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tunmountableContent = (\n\t\t\t<div className=\"editor-layout__toggle-entities-saved-states-panel\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ openEntitiesSavedStates }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\tdisabled={ ! isDirty }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Since EntitiesSavedStates controls its own panel, we can keep it\n\t// always mounted to retain its own component state (such as checkboxes).\n\treturn (\n\t\t<>\n\t\t\t{ isEntitiesSavedStatesOpen && (\n\t\t\t\t<EntitiesSavedStates close={ closeEntitiesSavedStates } />\n\t\t\t) }\n\t\t\t<Slot bubblesVirtually />\n\t\t\t{ ! isEntitiesSavedStatesOpen && unmountableContent }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,MAAM,EAAEC,cAAc,QAAQ,uBAAuB;AAC9D,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,OAAOC,gBAAgB,MAAM,uBAAuB;AACpD,OAAOC,qBAAqB,MAAM,6BAA6B;AAC/D,OAAOC,sBAAsB,MAAM,8BAA8B;AACjE,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEnD,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGhB,cAAc,CAAE,cAAe,CAAC;AAEvD,OAAO,MAAMiB,gBAAgB,GAAGF,IAAI;AAEpC,eAAe,SAASG,iBAAiBA,CAAE;EAC1CC,8BAA8B;EAC9BC,wBAAwB;EACxBC,yBAAyB;EACzBC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,mBAAmB;IAAEC;EAAqB,CAAC,GAClD1B,WAAW,CAAEU,WAAY,CAAC;EAC3B,MAAM;IACLiB,oBAAoB;IACpBC,aAAa;IACbC,OAAO;IACPC;EACD,CAAC,GAAG/B,SAAS,CAAIgC,MAAM,IAAM;IAC5B,MAAM;MACLC,sBAAsB;MACtBC,uBAAuB;MACvBC,sBAAsB;MACtBC,iBAAiB;MACjBC;IACD,CAAC,GAAGL,MAAM,CAAErB,WAAY,CAAC;IACzB,MAAM2B,wBAAwB,GAAGD,uBAAuB,CAAC,CAAC;IAC1D,OAAO;MACNT,oBAAoB,EAAEK,sBAAsB,CAAC,CAAC;MAC9CJ,aAAa,EACZ,CAAEM,sBAAsB,CAAC,CAAC,IAAID,uBAAuB,CAAC,CAAC;MACxDJ,OAAO,EAAEQ,wBAAwB,IAAIF,iBAAiB,CAAC,CAAC;MACxDL,uBAAuB,EAAEO;IAC1B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,uBAAuB,GAAGlC,WAAW,CAC1C,MAAMiB,8BAA8B,CAAE,IAAK,CAAC,EAC5C,EACD,CAAC;;EAED;EACA;EACA,IAAIkB,kBAAkB;EACtB,IAAKZ,oBAAoB,EAAG;IAC3BY,kBAAkB,gBACjB3B,IAAA,CAACN,gBAAgB;MAChBkC,OAAO,EAAGf,mBAAqB;MAC/BgB,YAAY,EAAGjB,wBAA0B;MACzCkB,mBAAmB,EAAGnC,qBAAqB,CAACW,IAAM;MAClDyB,oBAAoB,EAAGnC,sBAAsB,CAACU;IAAM,CACpD,CACD;EACF,CAAC,MAAM,IAAKU,aAAa,IAAI,CAAEE,uBAAuB,EAAG;IACxDS,kBAAkB,gBACjB3B,IAAA;MAAKgC,SAAS,EAAC,qCAAqC;MAAAC,QAAA,eACnDjC,IAAA,CAACX,MAAM;QACN6C,qBAAqB;QACrBC,OAAO,EAAC,WAAW;QACnBC,OAAO,EAAGtB,oBAAsB;QAChC,iBAAgB,KAAO;QAAAmB,QAAA,EAErB1C,EAAE,CAAE,oBAAqB;MAAC,CACrB;IAAC,CACL,CACL;EACF,CAAC,MAAM;IACNoC,kBAAkB,gBACjB3B,IAAA;MAAKgC,SAAS,EAAC,mDAAmD;MAAAC,QAAA,eACjEjC,IAAA,CAACX,MAAM;QACN6C,qBAAqB;QACrBC,OAAO,EAAC,WAAW;QACnBC,OAAO,EAAGV,uBAAyB;QACnC,iBAAgB,KAAO;QACvBW,QAAQ,EAAG,CAAEpB,OAAS;QACtBqB,sBAAsB;QAAAL,QAAA,EAEpB1C,EAAE,CAAE,iBAAkB;MAAC,CAClB;IAAC,CACL,CACL;EACF;;EAEA;EACA;EACA,oBACCa,KAAA,CAAAF,SAAA;IAAA+B,QAAA,GACGtB,yBAAyB,iBAC1BX,IAAA,CAACP,mBAAmB;MAAC8C,KAAK,EAAG7B;IAA0B,CAAE,CACzD,eACDV,IAAA,CAACM,IAAI;MAACkC,gBAAgB;IAAA,CAAE,CAAC,EACvB,CAAE7B,yBAAyB,IAAIgB,kBAAkB;EAAA,CAClD,CAAC;AAEL","ignoreList":[]}
|
|
@@ -728,6 +728,11 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
728
728
|
.editor-document-bar .components-button:hover {
|
|
729
729
|
background: #e0e0e0;
|
|
730
730
|
}
|
|
731
|
+
@media screen and (min-width: 782px) and (max-width: 960px) {
|
|
732
|
+
.editor-document-bar.has-back-button .editor-document-bar__post-type-label {
|
|
733
|
+
display: none;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
731
736
|
|
|
732
737
|
.editor-document-bar__command {
|
|
733
738
|
flex-grow: 1;
|
|
@@ -736,32 +741,44 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
736
741
|
}
|
|
737
742
|
|
|
738
743
|
.editor-document-bar__title {
|
|
739
|
-
flex: 1;
|
|
740
744
|
overflow: hidden;
|
|
741
745
|
color: #1e1e1e;
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
justify-content: center;
|
|
745
|
-
align-items: center;
|
|
746
|
+
margin: 0 auto;
|
|
747
|
+
max-width: 70%;
|
|
746
748
|
}
|
|
747
749
|
@media (min-width: 782px) {
|
|
748
750
|
.editor-document-bar__title {
|
|
749
751
|
padding-right: 24px;
|
|
750
752
|
}
|
|
751
753
|
}
|
|
752
|
-
.editor-document-bar.is-global .editor-document-bar__title {
|
|
753
|
-
color: var(--wp-block-synced-color);
|
|
754
|
-
}
|
|
755
|
-
.editor-document-bar__title .block-editor-block-icon {
|
|
756
|
-
min-width: 24px;
|
|
757
|
-
flex-shrink: 0;
|
|
758
|
-
}
|
|
759
754
|
.editor-document-bar__title h1 {
|
|
755
|
+
display: flex;
|
|
756
|
+
align-items: center;
|
|
757
|
+
justify-content: center;
|
|
758
|
+
font-weight: 400;
|
|
760
759
|
white-space: nowrap;
|
|
761
760
|
overflow: hidden;
|
|
762
|
-
|
|
763
|
-
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
.editor-document-bar__post-title {
|
|
764
764
|
color: currentColor;
|
|
765
|
+
flex: 1;
|
|
766
|
+
overflow: hidden;
|
|
767
|
+
text-overflow: ellipsis;
|
|
768
|
+
}
|
|
769
|
+
.editor-document-bar.is-global .editor-document-bar__post-title {
|
|
770
|
+
color: var(--wp-block-synced-color);
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
.editor-document-bar__post-type-label {
|
|
774
|
+
flex: 0;
|
|
775
|
+
color: #2f2f2f;
|
|
776
|
+
padding-right: 4px;
|
|
777
|
+
}
|
|
778
|
+
@media screen and (max-width: 600px) {
|
|
779
|
+
.editor-document-bar__post-type-label {
|
|
780
|
+
display: none;
|
|
781
|
+
}
|
|
765
782
|
}
|
|
766
783
|
|
|
767
784
|
.editor-document-bar__shortcut {
|
|
@@ -1022,7 +1039,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
1022
1039
|
max-width: 780px;
|
|
1023
1040
|
padding: 20px;
|
|
1024
1041
|
margin-top: 60px;
|
|
1025
|
-
box-shadow: 0
|
|
1042
|
+
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 27px rgba(0, 0, 0, 0.07), 0 30px 36px rgba(0, 0, 0, 0.04), 0 50px 43px rgba(0, 0, 0, 0.02);
|
|
1026
1043
|
}
|
|
1027
1044
|
|
|
1028
1045
|
.editor-header {
|
|
@@ -1704,6 +1721,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
1704
1721
|
white-space: normal;
|
|
1705
1722
|
text-wrap: balance;
|
|
1706
1723
|
text-wrap: pretty;
|
|
1724
|
+
height: auto;
|
|
1707
1725
|
min-height: 32px;
|
|
1708
1726
|
}
|
|
1709
1727
|
.editor-post-panel__row-control .components-dropdown {
|
|
@@ -1988,6 +2006,10 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
1988
2006
|
.editor-post-status.is-read-only {
|
|
1989
2007
|
padding: 6px 12px;
|
|
1990
2008
|
}
|
|
2009
|
+
.editor-post-status .editor-post-status__toggle.editor-post-status__toggle {
|
|
2010
|
+
padding-top: 4px;
|
|
2011
|
+
padding-bottom: 4px;
|
|
2012
|
+
}
|
|
1991
2013
|
|
|
1992
2014
|
.editor-change-status__password-fieldset,
|
|
1993
2015
|
.editor-change-status__publish-date-wrapper {
|
|
@@ -2048,9 +2070,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
2048
2070
|
display: inline-block;
|
|
2049
2071
|
margin-left: 8px;
|
|
2050
2072
|
}
|
|
2051
|
-
.editor-post-taxonomies__flat-term-most-used-list .components-button {
|
|
2052
|
-
font-size: 12px;
|
|
2053
|
-
}
|
|
2054
2073
|
|
|
2055
2074
|
.editor-post-template__swap-template-modal {
|
|
2056
2075
|
z-index: 1000001;
|
package/build-style/style.css
CHANGED
|
@@ -728,6 +728,11 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
728
728
|
.editor-document-bar .components-button:hover {
|
|
729
729
|
background: #e0e0e0;
|
|
730
730
|
}
|
|
731
|
+
@media screen and (min-width: 782px) and (max-width: 960px) {
|
|
732
|
+
.editor-document-bar.has-back-button .editor-document-bar__post-type-label {
|
|
733
|
+
display: none;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
731
736
|
|
|
732
737
|
.editor-document-bar__command {
|
|
733
738
|
flex-grow: 1;
|
|
@@ -736,32 +741,44 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
736
741
|
}
|
|
737
742
|
|
|
738
743
|
.editor-document-bar__title {
|
|
739
|
-
flex: 1;
|
|
740
744
|
overflow: hidden;
|
|
741
745
|
color: #1e1e1e;
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
justify-content: center;
|
|
745
|
-
align-items: center;
|
|
746
|
+
margin: 0 auto;
|
|
747
|
+
max-width: 70%;
|
|
746
748
|
}
|
|
747
749
|
@media (min-width: 782px) {
|
|
748
750
|
.editor-document-bar__title {
|
|
749
751
|
padding-left: 24px;
|
|
750
752
|
}
|
|
751
753
|
}
|
|
752
|
-
.editor-document-bar.is-global .editor-document-bar__title {
|
|
753
|
-
color: var(--wp-block-synced-color);
|
|
754
|
-
}
|
|
755
|
-
.editor-document-bar__title .block-editor-block-icon {
|
|
756
|
-
min-width: 24px;
|
|
757
|
-
flex-shrink: 0;
|
|
758
|
-
}
|
|
759
754
|
.editor-document-bar__title h1 {
|
|
755
|
+
display: flex;
|
|
756
|
+
align-items: center;
|
|
757
|
+
justify-content: center;
|
|
758
|
+
font-weight: 400;
|
|
760
759
|
white-space: nowrap;
|
|
761
760
|
overflow: hidden;
|
|
762
|
-
|
|
763
|
-
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
.editor-document-bar__post-title {
|
|
764
764
|
color: currentColor;
|
|
765
|
+
flex: 1;
|
|
766
|
+
overflow: hidden;
|
|
767
|
+
text-overflow: ellipsis;
|
|
768
|
+
}
|
|
769
|
+
.editor-document-bar.is-global .editor-document-bar__post-title {
|
|
770
|
+
color: var(--wp-block-synced-color);
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
.editor-document-bar__post-type-label {
|
|
774
|
+
flex: 0;
|
|
775
|
+
color: #2f2f2f;
|
|
776
|
+
padding-left: 4px;
|
|
777
|
+
}
|
|
778
|
+
@media screen and (max-width: 600px) {
|
|
779
|
+
.editor-document-bar__post-type-label {
|
|
780
|
+
display: none;
|
|
781
|
+
}
|
|
765
782
|
}
|
|
766
783
|
|
|
767
784
|
.editor-document-bar__shortcut {
|
|
@@ -1022,7 +1039,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
1022
1039
|
max-width: 780px;
|
|
1023
1040
|
padding: 20px;
|
|
1024
1041
|
margin-top: 60px;
|
|
1025
|
-
box-shadow: 0
|
|
1042
|
+
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 27px rgba(0, 0, 0, 0.07), 0 30px 36px rgba(0, 0, 0, 0.04), 0 50px 43px rgba(0, 0, 0, 0.02);
|
|
1026
1043
|
}
|
|
1027
1044
|
|
|
1028
1045
|
.editor-header {
|
|
@@ -1704,6 +1721,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
1704
1721
|
white-space: normal;
|
|
1705
1722
|
text-wrap: balance;
|
|
1706
1723
|
text-wrap: pretty;
|
|
1724
|
+
height: auto;
|
|
1707
1725
|
min-height: 32px;
|
|
1708
1726
|
}
|
|
1709
1727
|
.editor-post-panel__row-control .components-dropdown {
|
|
@@ -1988,6 +2006,10 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
1988
2006
|
.editor-post-status.is-read-only {
|
|
1989
2007
|
padding: 6px 12px;
|
|
1990
2008
|
}
|
|
2009
|
+
.editor-post-status .editor-post-status__toggle.editor-post-status__toggle {
|
|
2010
|
+
padding-top: 4px;
|
|
2011
|
+
padding-bottom: 4px;
|
|
2012
|
+
}
|
|
1991
2013
|
|
|
1992
2014
|
.editor-change-status__password-fieldset,
|
|
1993
2015
|
.editor-change-status__publish-date-wrapper {
|
|
@@ -2048,9 +2070,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
2048
2070
|
display: inline-block;
|
|
2049
2071
|
margin-right: 8px;
|
|
2050
2072
|
}
|
|
2051
|
-
.editor-post-taxonomies__flat-term-most-used-list .components-button {
|
|
2052
|
-
font-size: 12px;
|
|
2053
|
-
}
|
|
2054
2073
|
|
|
2055
2074
|
.editor-post-template__swap-template-modal {
|
|
2056
2075
|
z-index: 1000001;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-meta.d.ts","sourceRoot":"","sources":["../../src/bindings/post-meta.js"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"post-meta.d.ts","sourceRoot":"","sources":["../../src/bindings/post-meta.js"],"names":[],"mappings":";;IAsCC;;;;WAiBC;IACD;;;;aAUC;IACD;;;;gBA2CC;IACD;;;;;;;;aA2BC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/block-manager/index.js"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/block-manager/index.js"],"names":[],"mappings":"AAmBA,oEA6HC"}
|
|
@@ -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,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/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":";AA2CA;;;;;;;
|
|
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-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/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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.8.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,41 +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.
|
|
42
|
-
"@wordpress/compose": "^7.8.
|
|
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.
|
|
35
|
+
"@wordpress/a11y": "^4.8.0",
|
|
36
|
+
"@wordpress/api-fetch": "^7.8.0",
|
|
37
|
+
"@wordpress/blob": "^4.8.0",
|
|
38
|
+
"@wordpress/block-editor": "^14.3.0",
|
|
39
|
+
"@wordpress/blocks": "^13.8.0",
|
|
40
|
+
"@wordpress/commands": "^1.8.0",
|
|
41
|
+
"@wordpress/components": "^28.8.0",
|
|
42
|
+
"@wordpress/compose": "^7.8.0",
|
|
43
|
+
"@wordpress/core-data": "^7.8.0",
|
|
44
|
+
"@wordpress/data": "^10.8.0",
|
|
45
|
+
"@wordpress/dataviews": "^4.4.0",
|
|
46
|
+
"@wordpress/date": "^5.8.0",
|
|
47
|
+
"@wordpress/deprecated": "^4.8.0",
|
|
48
|
+
"@wordpress/dom": "^4.8.0",
|
|
49
|
+
"@wordpress/element": "^6.8.0",
|
|
50
50
|
"@wordpress/fields": "^0.0.1",
|
|
51
|
-
"@wordpress/hooks": "^4.
|
|
52
|
-
"@wordpress/html-entities": "^4.
|
|
53
|
-
"@wordpress/i18n": "^5.
|
|
54
|
-
"@wordpress/icons": "^10.
|
|
55
|
-
"@wordpress/interface": "^6.
|
|
56
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
57
|
-
"@wordpress/keycodes": "^4.
|
|
58
|
-
"@wordpress/media-utils": "^5.8.
|
|
59
|
-
"@wordpress/notices": "^5.
|
|
60
|
-
"@wordpress/patterns": "^2.
|
|
61
|
-
"@wordpress/plugins": "^7.
|
|
62
|
-
"@wordpress/preferences": "^4.
|
|
63
|
-
"@wordpress/private-apis": "^1.
|
|
64
|
-
"@wordpress/reusable-blocks": "^5.
|
|
65
|
-
"@wordpress/rich-text": "^7.
|
|
66
|
-
"@wordpress/server-side-render": "^5.
|
|
67
|
-
"@wordpress/url": "^4.
|
|
68
|
-
"@wordpress/warning": "^3.
|
|
69
|
-
"@wordpress/wordcount": "^4.
|
|
51
|
+
"@wordpress/hooks": "^4.8.0",
|
|
52
|
+
"@wordpress/html-entities": "^4.8.0",
|
|
53
|
+
"@wordpress/i18n": "^5.8.0",
|
|
54
|
+
"@wordpress/icons": "^10.8.0",
|
|
55
|
+
"@wordpress/interface": "^6.8.0",
|
|
56
|
+
"@wordpress/keyboard-shortcuts": "^5.8.0",
|
|
57
|
+
"@wordpress/keycodes": "^4.8.0",
|
|
58
|
+
"@wordpress/media-utils": "^5.8.0",
|
|
59
|
+
"@wordpress/notices": "^5.8.0",
|
|
60
|
+
"@wordpress/patterns": "^2.8.0",
|
|
61
|
+
"@wordpress/plugins": "^7.8.0",
|
|
62
|
+
"@wordpress/preferences": "^4.8.0",
|
|
63
|
+
"@wordpress/private-apis": "^1.8.0",
|
|
64
|
+
"@wordpress/reusable-blocks": "^5.8.0",
|
|
65
|
+
"@wordpress/rich-text": "^7.8.0",
|
|
66
|
+
"@wordpress/server-side-render": "^5.8.0",
|
|
67
|
+
"@wordpress/url": "^4.8.0",
|
|
68
|
+
"@wordpress/warning": "^3.8.0",
|
|
69
|
+
"@wordpress/wordcount": "^4.8.0",
|
|
70
70
|
"change-case": "^4.1.2",
|
|
71
71
|
"client-zip": "^2.4.5",
|
|
72
72
|
"clsx": "^2.1.1",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "cecf5e14d317aa67407f77a7e5c8b6a43016bd42"
|
|
90
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
|
};
|