@wordpress/editor 13.30.0 → 13.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/bindings/index.js +3 -1
- package/build/bindings/index.js.map +1 -1
- package/build/components/document-bar/index.js +2 -2
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-outline/index.js +1 -1
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js +10 -16
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build/components/entities-saved-states/index.js +17 -3
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/error-boundary/index.native.js +133 -0
- package/build/components/error-boundary/index.native.js.map +1 -0
- package/build/components/index.js +9 -8
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +9 -1
- package/build/components/index.native.js.map +1 -1
- package/build/components/plugin-document-setting-panel/index.js +123 -0
- package/build/components/plugin-document-setting-panel/index.js.map +1 -0
- package/build/components/post-featured-image/index.js +3 -8
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-featured-image/panel.js +7 -3
- package/build/components/post-featured-image/panel.js.map +1 -1
- package/build/components/post-sync-status/index.js +0 -72
- package/build/components/post-sync-status/index.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +7 -3
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/provider/index.js +1 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-hide-blocks-from-inserter.js +4 -3
- package/build/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
- package/build/private-apis.js +0 -2
- package/build/private-apis.js.map +1 -1
- package/build-module/bindings/index.js +3 -1
- package/build-module/bindings/index.js.map +1 -1
- package/build-module/components/document-bar/index.js +2 -2
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/index.js +1 -1
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +10 -16
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +18 -4
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.native.js +125 -0
- package/build-module/components/error-boundary/index.native.js.map +1 -0
- package/build-module/components/index.js +2 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +1 -0
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/plugin-document-setting-panel/index.js +115 -0
- package/build-module/components/plugin-document-setting-panel/index.js.map +1 -0
- package/build-module/components/post-featured-image/index.js +4 -9
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-featured-image/panel.js +6 -2
- package/build-module/components/post-featured-image/panel.js.map +1 -1
- package/build-module/components/post-sync-status/index.js +2 -73
- package/build-module/components/post-sync-status/index.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +7 -3
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/provider/index.js +1 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-hide-blocks-from-inserter.js +4 -3
- package/build-module/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
- package/build-module/private-apis.js +0 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-style/style-rtl.css +8 -8
- package/build-style/style.css +8 -8
- package/package.json +34 -32
- package/src/bindings/index.js +4 -1
- package/src/components/document-bar/index.js +3 -2
- package/src/components/document-outline/index.js +2 -1
- package/src/components/entities-saved-states/hooks/use-is-dirty.js +18 -22
- package/src/components/entities-saved-states/index.js +33 -8
- package/src/components/entities-saved-states/test/use-is-dirty.js +3 -0
- package/src/components/error-boundary/index.native.js +192 -0
- package/src/components/error-boundary/style.native.scss +116 -0
- package/src/components/index.js +2 -4
- package/src/components/index.native.js +1 -0
- package/src/components/plugin-document-setting-panel/index.js +121 -0
- package/src/components/post-featured-image/index.js +6 -15
- package/src/components/post-featured-image/panel.js +9 -3
- package/src/components/post-featured-image/style.scss +8 -13
- package/src/components/post-sync-status/index.js +1 -94
- package/src/components/post-taxonomies/flat-term-selector.js +13 -8
- package/src/components/provider/index.js +1 -1
- package/src/components/provider/use-hide-blocks-from-inserter.js +5 -3
- package/src/private-apis.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","store","coreStore","useMemo","useState","
|
|
1
|
+
{"version":3,"names":["useSelect","store","coreStore","useMemo","useState","useIsDirty","editedEntities","siteEdits","siteEntityConfig","select","__experimentalGetDirtyEntityRecords","getEntityRecordEdits","getEntityConfig","dirtyEntityRecords","_siteEntityConfig$met","editedEntitiesWithoutSite","filter","record","kind","name","siteEntityLabels","meta","labels","editedSiteEntities","property","push","title","unselectedEntities","_setUnselectedEntities","setUnselectedEntities","key","checked","elt","isDirty","length"],"sources":["@wordpress/editor/src/components/entities-saved-states/hooks/use-is-dirty.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMemo, useState } from '@wordpress/element';\n\nexport const useIsDirty = () => {\n\tconst { editedEntities, siteEdits, siteEntityConfig } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tgetEntityRecordEdits,\n\t\t\t\tgetEntityConfig,\n\t\t\t} = select( coreStore );\n\n\t\t\treturn {\n\t\t\t\teditedEntities: __experimentalGetDirtyEntityRecords(),\n\t\t\t\tsiteEdits: getEntityRecordEdits( 'root', 'site' ),\n\t\t\t\tsiteEntityConfig: getEntityConfig( 'root', 'site' ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst dirtyEntityRecords = useMemo( () => {\n\t\t// Remove site object and decouple into its edited pieces.\n\t\tconst editedEntitiesWithoutSite = editedEntities.filter(\n\t\t\t( record ) => ! ( record.kind === 'root' && record.name === 'site' )\n\t\t);\n\n\t\tconst siteEntityLabels = siteEntityConfig?.meta?.labels ?? {};\n\t\tconst editedSiteEntities = [];\n\t\tfor ( const property in siteEdits ) {\n\t\t\teditedSiteEntities.push( {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t\ttitle: siteEntityLabels[ property ] || property,\n\t\t\t\tproperty,\n\t\t\t} );\n\t\t}\n\n\t\treturn [ ...editedEntitiesWithoutSite, ...editedSiteEntities ];\n\t}, [ editedEntities, siteEdits, siteEntityConfig ] );\n\n\t// Unchecked entities to be ignored by save function.\n\tconst [ unselectedEntities, _setUnselectedEntities ] = useState( [] );\n\n\tconst setUnselectedEntities = (\n\t\t{ kind, name, key, property },\n\t\tchecked\n\t) => {\n\t\tif ( checked ) {\n\t\t\t_setUnselectedEntities(\n\t\t\t\tunselectedEntities.filter(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind !== kind ||\n\t\t\t\t\t\telt.name !== name ||\n\t\t\t\t\t\telt.key !== key ||\n\t\t\t\t\t\telt.property !== property\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t_setUnselectedEntities( [\n\t\t\t\t...unselectedEntities,\n\t\t\t\t{ kind, name, key, property },\n\t\t\t] );\n\t\t}\n\t};\n\n\tconst isDirty = dirtyEntityRecords.length - unselectedEntities.length > 0;\n\n\treturn {\n\t\tdirtyEntityRecords,\n\t\tisDirty,\n\t\tsetUnselectedEntities,\n\t\tunselectedEntities,\n\t};\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;AAEtD,OAAO,MAAMC,UAAU,GAAGA,CAAA,KAAM;EAC/B,MAAM;IAAEC,cAAc;IAAEC,SAAS;IAAEC;EAAiB,CAAC,GAAGR,SAAS,CAC9DS,MAAM,IAAM;IACb,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AAO,KACH;IACJ,IAAKA,OAAO,EAAG;MACdH,sBAAsB,CACrBD,kBAAkB,CAACX,MAAM,CACtBgB,GAAG,IACJA,GAAG,CAACd,IAAI,KAAKA,IAAI,IACjBc,GAAG,CAACb,IAAI,KAAKA,IAAI,IACjBa,GAAG,CAACF,GAAG,KAAKA,GAAG,IACfE,GAAG,CAACR,QAAQ,KAAKA,QACnB,CACD,CAAC;IACF,CAAC,MAAM;MACNI,sBAAsB,CAAE,CACvB,GAAGD,kBAAkB,EACrB;QAAET,IAAI;QAAEC,IAAI;QAAEW,GAAG;QAAEN;MAAS,CAAC,CAC5B,CAAC;IACJ;EACD,CAAC;EAED,MAAMS,OAAO,GAAGpB,kBAAkB,CAACqB,MAAM,GAAGP,kBAAkB,CAACO,MAAM,GAAG,CAAC;EAEzE,OAAO;IACNrB,kBAAkB;IAClBoB,OAAO;IACPJ,qBAAqB;IACrBF;EACD,CAAC;AACF,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { useSelect, useDispatch } from '@wordpress/data';
|
|
|
8
8
|
import { useCallback, useRef, createInterpolateElement } from '@wordpress/element';
|
|
9
9
|
import { store as coreStore } from '@wordpress/core-data';
|
|
10
10
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
11
|
-
import { __experimentalUseDialog as useDialog } from '@wordpress/compose';
|
|
11
|
+
import { __experimentalUseDialog as useDialog, useInstanceId } from '@wordpress/compose';
|
|
12
12
|
import { store as noticesStore } from '@wordpress/notices';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -24,11 +24,13 @@ function identity(values) {
|
|
|
24
24
|
return values;
|
|
25
25
|
}
|
|
26
26
|
export default function EntitiesSavedStates({
|
|
27
|
-
close
|
|
27
|
+
close,
|
|
28
|
+
renderDialog = undefined
|
|
28
29
|
}) {
|
|
29
30
|
const isDirtyProps = useIsDirty();
|
|
30
31
|
return createElement(EntitiesSavedStatesExtensible, {
|
|
31
32
|
close: close,
|
|
33
|
+
renderDialog: renderDialog,
|
|
32
34
|
...isDirtyProps
|
|
33
35
|
});
|
|
34
36
|
}
|
|
@@ -38,6 +40,7 @@ export function EntitiesSavedStatesExtensible({
|
|
|
38
40
|
onSave = identity,
|
|
39
41
|
saveEnabled: saveEnabledProp = undefined,
|
|
40
42
|
saveLabel = __('Save'),
|
|
43
|
+
renderDialog = undefined,
|
|
41
44
|
dirtyEntityRecords,
|
|
42
45
|
isDirty,
|
|
43
46
|
setUnselectedEntities,
|
|
@@ -148,10 +151,15 @@ export function EntitiesSavedStatesExtensible({
|
|
|
148
151
|
const [saveDialogRef, saveDialogProps] = useDialog({
|
|
149
152
|
onClose: () => dismissPanel()
|
|
150
153
|
});
|
|
154
|
+
const dialogLabel = useInstanceId(EntitiesSavedStatesExtensible, 'label');
|
|
155
|
+
const dialogDescription = useInstanceId(EntitiesSavedStatesExtensible, 'description');
|
|
151
156
|
return createElement("div", {
|
|
152
157
|
ref: saveDialogRef,
|
|
153
158
|
...saveDialogProps,
|
|
154
|
-
className: "entities-saved-states__panel"
|
|
159
|
+
className: "entities-saved-states__panel",
|
|
160
|
+
role: renderDialog ? 'dialog' : undefined,
|
|
161
|
+
"aria-labelledby": renderDialog ? dialogLabel : undefined,
|
|
162
|
+
"aria-describedby": renderDialog ? dialogDescription : undefined
|
|
155
163
|
}, createElement(Flex, {
|
|
156
164
|
className: "entities-saved-states__panel-header",
|
|
157
165
|
gap: 2
|
|
@@ -161,6 +169,7 @@ export function EntitiesSavedStatesExtensible({
|
|
|
161
169
|
ref: saveButtonRef,
|
|
162
170
|
variant: "primary",
|
|
163
171
|
disabled: !saveEnabled,
|
|
172
|
+
__experimentalIsFocusable: true,
|
|
164
173
|
onClick: saveCheckedEntities,
|
|
165
174
|
className: "editor-entities-saved-states__save-button"
|
|
166
175
|
}, saveLabel), createElement(FlexItem, {
|
|
@@ -170,9 +179,14 @@ export function EntitiesSavedStatesExtensible({
|
|
|
170
179
|
onClick: dismissPanel
|
|
171
180
|
}, __('Cancel'))), createElement("div", {
|
|
172
181
|
className: "entities-saved-states__text-prompt"
|
|
182
|
+
}, createElement("div", {
|
|
183
|
+
className: "entities-saved-states__text-prompt--header-wrapper",
|
|
184
|
+
id: renderDialog ? dialogLabel : undefined
|
|
173
185
|
}, createElement("strong", {
|
|
174
186
|
className: "entities-saved-states__text-prompt--header"
|
|
175
|
-
}, __('Are you ready to save?')), additionalPrompt, createElement("p",
|
|
187
|
+
}, __('Are you ready to save?')), additionalPrompt), createElement("p", {
|
|
188
|
+
id: renderDialog ? dialogDescription : undefined
|
|
189
|
+
}, isDirty ? createInterpolateElement(sprintf( /* translators: %d: number of site changes waiting to be saved. */
|
|
176
190
|
_n('There is <strong>%d site change</strong> waiting to be saved.', 'There are <strong>%d site changes</strong> waiting to be saved.', sortedPartitionedSavables.length), sortedPartitionedSavables.length), {
|
|
177
191
|
strong: createElement("strong", null)
|
|
178
192
|
}) : __('Select the items you want to save.'))), sortedPartitionedSavables.map(list => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","Flex","FlexItem","__","_n","sprintf","useSelect","useDispatch","useCallback","useRef","createInterpolateElement","store","coreStore","blockEditorStore","__experimentalUseDialog","useDialog","noticesStore","EntityTypeList","useIsDirty","PUBLISH_ON_SAVE_ENTITIES","kind","name","identity","values","EntitiesSavedStates","close","isDirtyProps","createElement","EntitiesSavedStatesExtensible","additionalPrompt","undefined","onSave","saveEnabled","saveEnabledProp","saveLabel","dirtyEntityRecords","isDirty","setUnselectedEntities","unselectedEntities","saveButtonRef","editEntityRecord","saveEditedEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","__unstableMarkLastChangeAsPersistent","createSuccessNotice","createErrorNotice","removeNotice","partitionedSavables","reduce","acc","record","push","site","siteSavables","wp_template","templateSavables","wp_template_part","templatePartSavables","contentSavables","sortedPartitionedSavables","Object","filter","Array","isArray","homeUrl","select","getUnstableBase","home","saveCheckedEntities","saveNoticeId","entitiesToSave","key","property","some","elt","siteItemsToSave","pendingSavedRecords","forEach","typeToPublish","status","length","Promise","all","then","value","type","id","actions","label","url","catch","error","dismissPanel","saveDialogRef","saveDialogProps","onClose","ref","className","gap","isBlock","as","variant","disabled","onClick","strong","map","list"],"sources":["@wordpress/editor/src/components/entities-saved-states/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Flex, FlexItem } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseCallback,\n\tuseRef,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { __experimentalUseDialog as useDialog } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport EntityTypeList from './entity-type-list';\nimport { useIsDirty } from './hooks/use-is-dirty';\n\nconst PUBLISH_ON_SAVE_ENTITIES = [\n\t{\n\t\tkind: 'postType',\n\t\tname: 'wp_navigation',\n\t},\n];\n\nfunction identity( values ) {\n\treturn values;\n}\n\nexport default function EntitiesSavedStates( { close } ) {\n\tconst isDirtyProps = useIsDirty();\n\treturn (\n\t\t<EntitiesSavedStatesExtensible close={ close } { ...isDirtyProps } />\n\t);\n}\n\nexport function EntitiesSavedStatesExtensible( {\n\tadditionalPrompt = undefined,\n\tclose,\n\tonSave = identity,\n\tsaveEnabled: saveEnabledProp = undefined,\n\tsaveLabel = __( 'Save' ),\n\n\tdirtyEntityRecords,\n\tisDirty,\n\tsetUnselectedEntities,\n\tunselectedEntities,\n} ) {\n\tconst saveButtonRef = useRef();\n\tconst {\n\t\teditEntityRecord,\n\t\tsaveEditedEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { __unstableMarkLastChangeAsPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst { createSuccessNotice, createErrorNotice, removeNotice } =\n\t\tuseDispatch( noticesStore );\n\n\t// To group entities by type.\n\tconst partitionedSavables = dirtyEntityRecords.reduce( ( acc, record ) => {\n\t\tconst { name } = record;\n\t\tif ( ! acc[ name ] ) {\n\t\t\tacc[ name ] = [];\n\t\t}\n\t\tacc[ name ].push( record );\n\t\treturn acc;\n\t}, {} );\n\n\t// Sort entity groups.\n\tconst {\n\t\tsite: siteSavables,\n\t\twp_template: templateSavables,\n\t\twp_template_part: templatePartSavables,\n\t\t...contentSavables\n\t} = partitionedSavables;\n\tconst sortedPartitionedSavables = [\n\t\tsiteSavables,\n\t\ttemplateSavables,\n\t\ttemplatePartSavables,\n\t\t...Object.values( contentSavables ),\n\t].filter( Array.isArray );\n\n\tconst saveEnabled = saveEnabledProp ?? isDirty;\n\n\tconst { homeUrl } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetUnstableBase, // Site index.\n\t\t} = select( coreStore );\n\t\treturn {\n\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t};\n\t}, [] );\n\n\tconst saveCheckedEntities = () => {\n\t\tconst saveNoticeId = 'site-editor-save-success';\n\t\tremoveNotice( saveNoticeId );\n\t\tconst entitiesToSave = dirtyEntityRecords.filter(\n\t\t\t( { kind, name, key, property } ) => {\n\t\t\t\treturn ! unselectedEntities.some(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === kind &&\n\t\t\t\t\t\telt.name === name &&\n\t\t\t\t\t\telt.key === key &&\n\t\t\t\t\t\telt.property === property\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\tclose( entitiesToSave );\n\n\t\tconst siteItemsToSave = [];\n\t\tconst pendingSavedRecords = [];\n\t\tentitiesToSave.forEach( ( { kind, name, key, property } ) => {\n\t\t\tif ( 'root' === kind && 'site' === name ) {\n\t\t\t\tsiteItemsToSave.push( property );\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tPUBLISH_ON_SAVE_ENTITIES.some(\n\t\t\t\t\t\t( typeToPublish ) =>\n\t\t\t\t\t\t\ttypeToPublish.kind === kind &&\n\t\t\t\t\t\t\ttypeToPublish.name === name\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\teditEntityRecord( kind, name, key, { status: 'publish' } );\n\t\t\t\t}\n\n\t\t\t\tpendingSavedRecords.push(\n\t\t\t\t\tsaveEditedEntityRecord( kind, name, key )\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\t\tif ( siteItemsToSave.length ) {\n\t\t\tpendingSavedRecords.push(\n\t\t\t\tsaveSpecifiedEntityEdits(\n\t\t\t\t\t'root',\n\t\t\t\t\t'site',\n\t\t\t\t\tundefined,\n\t\t\t\t\tsiteItemsToSave\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t__unstableMarkLastChangeAsPersistent();\n\n\t\tPromise.all( pendingSavedRecords )\n\t\t\t.then( ( values ) => {\n\t\t\t\treturn onSave( values );\n\t\t\t} )\n\t\t\t.then( ( values ) => {\n\t\t\t\tif (\n\t\t\t\t\tvalues.some( ( value ) => typeof value === 'undefined' )\n\t\t\t\t) {\n\t\t\t\t\tcreateErrorNotice( __( 'Saving failed.' ) );\n\t\t\t\t} else {\n\t\t\t\t\tcreateSuccessNotice( __( 'Site updated.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: saveNoticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View site' ),\n\t\t\t\t\t\t\t\turl: homeUrl,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( ( error ) =>\n\t\t\t\tcreateErrorNotice( `${ __( 'Saving failed.' ) } ${ error }` )\n\t\t\t);\n\t};\n\n\t// Explicitly define this with no argument passed. Using `close` on\n\t// its own will use the event object in place of the expected saved entities.\n\tconst dismissPanel = useCallback( () => close(), [ close ] );\n\n\tconst [ saveDialogRef, saveDialogProps ] = useDialog( {\n\t\tonClose: () => dismissPanel(),\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tref={ saveDialogRef }\n\t\t\t{ ...saveDialogProps }\n\t\t\tclassName=\"entities-saved-states__panel\"\n\t\t>\n\t\t\t<Flex className=\"entities-saved-states__panel-header\" gap={ 2 }>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tref={ saveButtonRef }\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tdisabled={ ! saveEnabled }\n\t\t\t\t\tonClick={ saveCheckedEntities }\n\t\t\t\t\tclassName=\"editor-entities-saved-states__save-button\"\n\t\t\t\t>\n\t\t\t\t\t{ saveLabel }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ dismissPanel }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\n\t\t\t<div className=\"entities-saved-states__text-prompt\">\n\t\t\t\t<strong className=\"entities-saved-states__text-prompt--header\">\n\t\t\t\t\t{ __( 'Are you ready to save?' ) }\n\t\t\t\t</strong>\n\t\t\t\t{ additionalPrompt }\n\t\t\t\t<p>\n\t\t\t\t\t{ isDirty\n\t\t\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %d: number of site changes waiting to be saved. */\n\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t'There is <strong>%d site change</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\t'There are <strong>%d site changes</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\tsortedPartitionedSavables.length\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tsortedPartitionedSavables.length\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{ strong: <strong /> }\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Select the items you want to save.' ) }\n\t\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t{ sortedPartitionedSavables.map( ( list ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityTypeList\n\t\t\t\t\t\tkey={ list[ 0 ].name }\n\t\t\t\t\t\tlist={ list }\n\t\t\t\t\t\tunselectedEntities={ unselectedEntities }\n\t\t\t\t\t\tsetUnselectedEntities={ setUnselectedEntities }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,uBAAuB;AAC9D,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,WAAW,EACXC,MAAM,EACNC,wBAAwB,QAClB,oBAAoB;AAC3B,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,uBAAuB,IAAIC,SAAS,QAAQ,oBAAoB;AACzE,SAASJ,KAAK,IAAIK,YAAY,QAAQ,oBAAoB;;AAE1D;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,SAASC,UAAU,QAAQ,sBAAsB;AAEjD,MAAMC,wBAAwB,GAAG,CAChC;EACCC,IAAI,EAAE,UAAU;EAChBC,IAAI,EAAE;AACP,CAAC,CACD;AAED,SAASC,QAAQA,CAAEC,MAAM,EAAG;EAC3B,OAAOA,MAAM;AACd;AAEA,eAAe,SAASC,mBAAmBA,CAAE;EAAEC;AAAM,CAAC,EAAG;EACxD,MAAMC,YAAY,GAAGR,UAAU,CAAC,CAAC;EACjC,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,aAAA,eAAS;EAAE,CACrB,CAAC,GACDxB,EAAE,CAAE,oCAAqC,CAC1C,CACC,CAAC,EAEJyD,yBAAyB,CAAC8C,GAAG,CAAIC,IAAI,IAAM;IAC5C,OACChF,aAAA,CAACV,cAAc;MACduD,GAAG,EAAGmC,IAAI,CAAE,CAAC,CAAE,CAACtF,IAAM;MACtBsF,IAAI,EAAGA,IAAM;MACbrE,kBAAkB,EAAGA,kBAAoB;MACzCD,qBAAqB,EAAGA;IAAuB,CAC/C,CAAC;EAEJ,CAAE,CACE,CAAC;AAER"}
|
|
1
|
+
{"version":3,"names":["Button","Flex","FlexItem","__","_n","sprintf","useSelect","useDispatch","useCallback","useRef","createInterpolateElement","store","coreStore","blockEditorStore","__experimentalUseDialog","useDialog","useInstanceId","noticesStore","EntityTypeList","useIsDirty","PUBLISH_ON_SAVE_ENTITIES","kind","name","identity","values","EntitiesSavedStates","close","renderDialog","undefined","isDirtyProps","createElement","EntitiesSavedStatesExtensible","additionalPrompt","onSave","saveEnabled","saveEnabledProp","saveLabel","dirtyEntityRecords","isDirty","setUnselectedEntities","unselectedEntities","saveButtonRef","editEntityRecord","saveEditedEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","__unstableMarkLastChangeAsPersistent","createSuccessNotice","createErrorNotice","removeNotice","partitionedSavables","reduce","acc","record","push","site","siteSavables","wp_template","templateSavables","wp_template_part","templatePartSavables","contentSavables","sortedPartitionedSavables","Object","filter","Array","isArray","homeUrl","select","getUnstableBase","home","saveCheckedEntities","saveNoticeId","entitiesToSave","key","property","some","elt","siteItemsToSave","pendingSavedRecords","forEach","typeToPublish","status","length","Promise","all","then","value","type","id","actions","label","url","catch","error","dismissPanel","saveDialogRef","saveDialogProps","onClose","dialogLabel","dialogDescription","ref","className","role","gap","isBlock","as","variant","disabled","__experimentalIsFocusable","onClick","strong","map","list"],"sources":["@wordpress/editor/src/components/entities-saved-states/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Flex, FlexItem } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseCallback,\n\tuseRef,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport {\n\t__experimentalUseDialog as useDialog,\n\tuseInstanceId,\n} from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport EntityTypeList from './entity-type-list';\nimport { useIsDirty } from './hooks/use-is-dirty';\n\nconst PUBLISH_ON_SAVE_ENTITIES = [\n\t{\n\t\tkind: 'postType',\n\t\tname: 'wp_navigation',\n\t},\n];\n\nfunction identity( values ) {\n\treturn values;\n}\n\nexport default function EntitiesSavedStates( {\n\tclose,\n\trenderDialog = undefined,\n} ) {\n\tconst isDirtyProps = useIsDirty();\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\tclose={ close }\n\t\t\trenderDialog={ renderDialog }\n\t\t\t{ ...isDirtyProps }\n\t\t/>\n\t);\n}\n\nexport function EntitiesSavedStatesExtensible( {\n\tadditionalPrompt = undefined,\n\tclose,\n\tonSave = identity,\n\tsaveEnabled: saveEnabledProp = undefined,\n\tsaveLabel = __( 'Save' ),\n\trenderDialog = undefined,\n\n\tdirtyEntityRecords,\n\tisDirty,\n\tsetUnselectedEntities,\n\tunselectedEntities,\n} ) {\n\tconst saveButtonRef = useRef();\n\tconst {\n\t\teditEntityRecord,\n\t\tsaveEditedEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { __unstableMarkLastChangeAsPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst { createSuccessNotice, createErrorNotice, removeNotice } =\n\t\tuseDispatch( noticesStore );\n\n\t// To group entities by type.\n\tconst partitionedSavables = dirtyEntityRecords.reduce( ( acc, record ) => {\n\t\tconst { name } = record;\n\t\tif ( ! acc[ name ] ) {\n\t\t\tacc[ name ] = [];\n\t\t}\n\t\tacc[ name ].push( record );\n\t\treturn acc;\n\t}, {} );\n\n\t// Sort entity groups.\n\tconst {\n\t\tsite: siteSavables,\n\t\twp_template: templateSavables,\n\t\twp_template_part: templatePartSavables,\n\t\t...contentSavables\n\t} = partitionedSavables;\n\tconst sortedPartitionedSavables = [\n\t\tsiteSavables,\n\t\ttemplateSavables,\n\t\ttemplatePartSavables,\n\t\t...Object.values( contentSavables ),\n\t].filter( Array.isArray );\n\n\tconst saveEnabled = saveEnabledProp ?? isDirty;\n\n\tconst { homeUrl } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetUnstableBase, // Site index.\n\t\t} = select( coreStore );\n\t\treturn {\n\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t};\n\t}, [] );\n\n\tconst saveCheckedEntities = () => {\n\t\tconst saveNoticeId = 'site-editor-save-success';\n\t\tremoveNotice( saveNoticeId );\n\t\tconst entitiesToSave = dirtyEntityRecords.filter(\n\t\t\t( { kind, name, key, property } ) => {\n\t\t\t\treturn ! unselectedEntities.some(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === kind &&\n\t\t\t\t\t\telt.name === name &&\n\t\t\t\t\t\telt.key === key &&\n\t\t\t\t\t\telt.property === property\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\tclose( entitiesToSave );\n\n\t\tconst siteItemsToSave = [];\n\t\tconst pendingSavedRecords = [];\n\t\tentitiesToSave.forEach( ( { kind, name, key, property } ) => {\n\t\t\tif ( 'root' === kind && 'site' === name ) {\n\t\t\t\tsiteItemsToSave.push( property );\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tPUBLISH_ON_SAVE_ENTITIES.some(\n\t\t\t\t\t\t( typeToPublish ) =>\n\t\t\t\t\t\t\ttypeToPublish.kind === kind &&\n\t\t\t\t\t\t\ttypeToPublish.name === name\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\teditEntityRecord( kind, name, key, { status: 'publish' } );\n\t\t\t\t}\n\n\t\t\t\tpendingSavedRecords.push(\n\t\t\t\t\tsaveEditedEntityRecord( kind, name, key )\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\t\tif ( siteItemsToSave.length ) {\n\t\t\tpendingSavedRecords.push(\n\t\t\t\tsaveSpecifiedEntityEdits(\n\t\t\t\t\t'root',\n\t\t\t\t\t'site',\n\t\t\t\t\tundefined,\n\t\t\t\t\tsiteItemsToSave\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t__unstableMarkLastChangeAsPersistent();\n\n\t\tPromise.all( pendingSavedRecords )\n\t\t\t.then( ( values ) => {\n\t\t\t\treturn onSave( values );\n\t\t\t} )\n\t\t\t.then( ( values ) => {\n\t\t\t\tif (\n\t\t\t\t\tvalues.some( ( value ) => typeof value === 'undefined' )\n\t\t\t\t) {\n\t\t\t\t\tcreateErrorNotice( __( 'Saving failed.' ) );\n\t\t\t\t} else {\n\t\t\t\t\tcreateSuccessNotice( __( 'Site updated.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: saveNoticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View site' ),\n\t\t\t\t\t\t\t\turl: homeUrl,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( ( error ) =>\n\t\t\t\tcreateErrorNotice( `${ __( 'Saving failed.' ) } ${ error }` )\n\t\t\t);\n\t};\n\n\t// Explicitly define this with no argument passed. Using `close` on\n\t// its own will use the event object in place of the expected saved entities.\n\tconst dismissPanel = useCallback( () => close(), [ close ] );\n\n\tconst [ saveDialogRef, saveDialogProps ] = useDialog( {\n\t\tonClose: () => dismissPanel(),\n\t} );\n\tconst dialogLabel = useInstanceId( EntitiesSavedStatesExtensible, 'label' );\n\tconst dialogDescription = useInstanceId(\n\t\tEntitiesSavedStatesExtensible,\n\t\t'description'\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={ saveDialogRef }\n\t\t\t{ ...saveDialogProps }\n\t\t\tclassName=\"entities-saved-states__panel\"\n\t\t\trole={ renderDialog ? 'dialog' : undefined }\n\t\t\taria-labelledby={ renderDialog ? dialogLabel : undefined }\n\t\t\taria-describedby={ renderDialog ? dialogDescription : undefined }\n\t\t>\n\t\t\t<Flex className=\"entities-saved-states__panel-header\" gap={ 2 }>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tref={ saveButtonRef }\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tdisabled={ ! saveEnabled }\n\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t\tonClick={ saveCheckedEntities }\n\t\t\t\t\tclassName=\"editor-entities-saved-states__save-button\"\n\t\t\t\t>\n\t\t\t\t\t{ saveLabel }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ dismissPanel }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\n\t\t\t<div className=\"entities-saved-states__text-prompt\">\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"entities-saved-states__text-prompt--header-wrapper\"\n\t\t\t\t\tid={ renderDialog ? dialogLabel : undefined }\n\t\t\t\t>\n\t\t\t\t\t<strong className=\"entities-saved-states__text-prompt--header\">\n\t\t\t\t\t\t{ __( 'Are you ready to save?' ) }\n\t\t\t\t\t</strong>\n\t\t\t\t\t{ additionalPrompt }\n\t\t\t\t</div>\n\t\t\t\t<p id={ renderDialog ? dialogDescription : undefined }>\n\t\t\t\t\t{ isDirty\n\t\t\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %d: number of site changes waiting to be saved. */\n\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t'There is <strong>%d site change</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\t'There are <strong>%d site changes</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\tsortedPartitionedSavables.length\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tsortedPartitionedSavables.length\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{ strong: <strong /> }\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Select the items you want to save.' ) }\n\t\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t{ sortedPartitionedSavables.map( ( list ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityTypeList\n\t\t\t\t\t\tkey={ list[ 0 ].name }\n\t\t\t\t\t\tlist={ list }\n\t\t\t\t\t\tunselectedEntities={ unselectedEntities }\n\t\t\t\t\t\tsetUnselectedEntities={ setUnselectedEntities }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,uBAAuB;AAC9D,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,WAAW,EACXC,MAAM,EACNC,wBAAwB,QAClB,oBAAoB;AAC3B,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,yBAAyB;AACnE,SACCC,uBAAuB,IAAIC,SAAS,EACpCC,aAAa,QACP,oBAAoB;AAC3B,SAASL,KAAK,IAAIM,YAAY,QAAQ,oBAAoB;;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;EAEJ,CAAE,CACE,CAAC;AAER"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { createElement } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* External dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
6
|
+
import Clipboard from '@react-native-clipboard/clipboard';
|
|
7
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* WordPress dependencies
|
|
11
|
+
*/
|
|
12
|
+
import { Component } from '@wordpress/element';
|
|
13
|
+
import { __ } from '@wordpress/i18n';
|
|
14
|
+
import { select } from '@wordpress/data';
|
|
15
|
+
import { logException } from '@wordpress/react-native-bridge';
|
|
16
|
+
import { usePreferredColorSchemeStyle, withPreferredColorScheme } from '@wordpress/compose';
|
|
17
|
+
import { warning } from '@wordpress/icons';
|
|
18
|
+
import { Icon } from '@wordpress/components';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Internal dependencies
|
|
22
|
+
*/
|
|
23
|
+
import { store as editorStore } from '../../store';
|
|
24
|
+
import styles from './style.scss';
|
|
25
|
+
function getContent() {
|
|
26
|
+
try {
|
|
27
|
+
// While `select` in a component is generally discouraged, it is
|
|
28
|
+
// used here because it (a) reduces the chance of data loss in the
|
|
29
|
+
// case of additional errors by performing a direct retrieval and
|
|
30
|
+
// (b) avoids the performance cost associated with unnecessary
|
|
31
|
+
// content serialization throughout the lifetime of a non-erroring
|
|
32
|
+
// application.
|
|
33
|
+
return select(editorStore).getEditedPostContent();
|
|
34
|
+
} catch (error) {}
|
|
35
|
+
}
|
|
36
|
+
function CopyButton({
|
|
37
|
+
text,
|
|
38
|
+
label,
|
|
39
|
+
accessibilityLabel,
|
|
40
|
+
accessibilityHint,
|
|
41
|
+
secondary = false
|
|
42
|
+
}) {
|
|
43
|
+
const containerStyle = usePreferredColorSchemeStyle(styles['copy-button__container'], styles['copy-button__container--dark']);
|
|
44
|
+
const containerSecondaryStyle = usePreferredColorSchemeStyle(styles['copy-button__container--secondary'], styles['copy-button__container--secondary-dark']);
|
|
45
|
+
const textStyle = usePreferredColorSchemeStyle(styles['copy-button__text'], styles['copy-button__text--dark']);
|
|
46
|
+
const textSecondaryStyle = usePreferredColorSchemeStyle(styles['copy-button__text--secondary'], styles['copy-button__text--secondary-dark']);
|
|
47
|
+
return createElement(TouchableOpacity, {
|
|
48
|
+
activeOpacity: 0.5,
|
|
49
|
+
accessibilityLabel: accessibilityLabel,
|
|
50
|
+
style: [containerStyle, secondary && containerSecondaryStyle],
|
|
51
|
+
accessibilityRole: 'button',
|
|
52
|
+
accessibilityHint: accessibilityHint,
|
|
53
|
+
onPress: () => {
|
|
54
|
+
Clipboard.setString(typeof text === 'function' ? text() : text || '');
|
|
55
|
+
}
|
|
56
|
+
}, createElement(Text, {
|
|
57
|
+
style: [textStyle, secondary && textSecondaryStyle]
|
|
58
|
+
}, label));
|
|
59
|
+
}
|
|
60
|
+
class ErrorBoundary extends Component {
|
|
61
|
+
constructor() {
|
|
62
|
+
super(...arguments);
|
|
63
|
+
this.state = {
|
|
64
|
+
error: null
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
componentDidCatch(error) {
|
|
68
|
+
logException(error, {
|
|
69
|
+
context: {
|
|
70
|
+
component_stack: error.componentStack
|
|
71
|
+
},
|
|
72
|
+
isHandled: true,
|
|
73
|
+
handledBy: 'Editor-level Error Boundary'
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
static getDerivedStateFromError(error) {
|
|
77
|
+
return {
|
|
78
|
+
error
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
render() {
|
|
82
|
+
const {
|
|
83
|
+
error
|
|
84
|
+
} = this.state;
|
|
85
|
+
if (!error) {
|
|
86
|
+
return this.props.children;
|
|
87
|
+
}
|
|
88
|
+
const {
|
|
89
|
+
getStylesFromColorScheme
|
|
90
|
+
} = this.props;
|
|
91
|
+
const iconContainerStyle = getStylesFromColorScheme(styles['error-boundary__icon-container'], styles['error-boundary__icon-container--dark']);
|
|
92
|
+
const titleStyle = getStylesFromColorScheme(styles['error-boundary__title'], styles['error-boundary__title--dark']);
|
|
93
|
+
const messageStyle = getStylesFromColorScheme(styles['error-boundary__message'], styles['error-boundary__message--dark']);
|
|
94
|
+
return createElement(SafeAreaView, null, createElement(ScrollView, {
|
|
95
|
+
style: styles['error-boundary__scroll'],
|
|
96
|
+
contentContainerStyle: styles['error-boundary__scroll-container']
|
|
97
|
+
}, createElement(View, {
|
|
98
|
+
style: styles['error-boundary__container']
|
|
99
|
+
}, createElement(View, {
|
|
100
|
+
style: iconContainerStyle
|
|
101
|
+
}, createElement(Icon, {
|
|
102
|
+
icon: warning,
|
|
103
|
+
...styles['error-boundary__icon']
|
|
104
|
+
})), createElement(Text, {
|
|
105
|
+
style: titleStyle
|
|
106
|
+
}, __('The editor has encountered an unexpected error')), createElement(Text, {
|
|
107
|
+
style: messageStyle
|
|
108
|
+
}, __('You can copy your post text in case your content is impacted. Copy error details to debug and share with support.')), createElement(View, {
|
|
109
|
+
style: styles['error-boundary__actions-container']
|
|
110
|
+
}, createElement(CopyButton, {
|
|
111
|
+
label: __('Copy post text'),
|
|
112
|
+
accessibilityLabel: __('Button to copy post text'),
|
|
113
|
+
accessibilityHint: __('Tap here to copy post text'),
|
|
114
|
+
text: getContent
|
|
115
|
+
}), createElement(CopyButton, {
|
|
116
|
+
label: __('Copy error details'),
|
|
117
|
+
accessibilityLabel: __('Button to copy error details'),
|
|
118
|
+
accessibilityHint: __('Tap here to copy error details'),
|
|
119
|
+
text: error.stack,
|
|
120
|
+
secondary: true
|
|
121
|
+
})))));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
export default withPreferredColorScheme(ErrorBoundary);
|
|
125
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ScrollView","Text","TouchableOpacity","View","Clipboard","SafeAreaView","Component","__","select","logException","usePreferredColorSchemeStyle","withPreferredColorScheme","warning","Icon","store","editorStore","styles","getContent","getEditedPostContent","error","CopyButton","text","label","accessibilityLabel","accessibilityHint","secondary","containerStyle","containerSecondaryStyle","textStyle","textSecondaryStyle","createElement","activeOpacity","style","accessibilityRole","onPress","setString","ErrorBoundary","constructor","arguments","state","componentDidCatch","context","component_stack","componentStack","isHandled","handledBy","getDerivedStateFromError","render","props","children","getStylesFromColorScheme","iconContainerStyle","titleStyle","messageStyle","contentContainerStyle","icon","stack"],"sources":["@wordpress/editor/src/components/error-boundary/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { ScrollView, Text, TouchableOpacity, View } from 'react-native';\nimport Clipboard from '@react-native-clipboard/clipboard';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { select } from '@wordpress/data';\nimport { logException } from '@wordpress/react-native-bridge';\nimport {\n\tusePreferredColorSchemeStyle,\n\twithPreferredColorScheme,\n} from '@wordpress/compose';\nimport { warning } from '@wordpress/icons';\nimport { Icon } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport styles from './style.scss';\n\nfunction getContent() {\n\ttry {\n\t\t// While `select` in a component is generally discouraged, it is\n\t\t// used here because it (a) reduces the chance of data loss in the\n\t\t// case of additional errors by performing a direct retrieval and\n\t\t// (b) avoids the performance cost associated with unnecessary\n\t\t// content serialization throughout the lifetime of a non-erroring\n\t\t// application.\n\t\treturn select( editorStore ).getEditedPostContent();\n\t} catch ( error ) {}\n}\n\nfunction CopyButton( {\n\ttext,\n\tlabel,\n\taccessibilityLabel,\n\taccessibilityHint,\n\tsecondary = false,\n} ) {\n\tconst containerStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'copy-button__container' ],\n\t\tstyles[ 'copy-button__container--dark' ]\n\t);\n\n\tconst containerSecondaryStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'copy-button__container--secondary' ],\n\t\tstyles[ 'copy-button__container--secondary-dark' ]\n\t);\n\n\tconst textStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'copy-button__text' ],\n\t\tstyles[ 'copy-button__text--dark' ]\n\t);\n\n\tconst textSecondaryStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'copy-button__text--secondary' ],\n\t\tstyles[ 'copy-button__text--secondary-dark' ]\n\t);\n\n\treturn (\n\t\t<TouchableOpacity\n\t\t\tactiveOpacity={ 0.5 }\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\tstyle={ [ containerStyle, secondary && containerSecondaryStyle ] }\n\t\t\taccessibilityRole={ 'button' }\n\t\t\taccessibilityHint={ accessibilityHint }\n\t\t\tonPress={ () => {\n\t\t\t\tClipboard.setString(\n\t\t\t\t\ttypeof text === 'function' ? text() : text || ''\n\t\t\t\t);\n\t\t\t} }\n\t\t>\n\t\t\t<Text style={ [ textStyle, secondary && textSecondaryStyle ] }>\n\t\t\t\t{ label }\n\t\t\t</Text>\n\t\t</TouchableOpacity>\n\t);\n}\n\nclass ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tlogException( error, {\n\t\t\tcontext: {\n\t\t\t\tcomponent_stack: error.componentStack,\n\t\t\t},\n\t\t\tisHandled: true,\n\t\t\thandledBy: 'Editor-level Error Boundary',\n\t\t} );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tconst { error } = this.state;\n\t\tif ( ! error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\tconst { getStylesFromColorScheme } = this.props;\n\n\t\tconst iconContainerStyle = getStylesFromColorScheme(\n\t\t\tstyles[ 'error-boundary__icon-container' ],\n\t\t\tstyles[ 'error-boundary__icon-container--dark' ]\n\t\t);\n\n\t\tconst titleStyle = getStylesFromColorScheme(\n\t\t\tstyles[ 'error-boundary__title' ],\n\t\t\tstyles[ 'error-boundary__title--dark' ]\n\t\t);\n\n\t\tconst messageStyle = getStylesFromColorScheme(\n\t\t\tstyles[ 'error-boundary__message' ],\n\t\t\tstyles[ 'error-boundary__message--dark' ]\n\t\t);\n\n\t\treturn (\n\t\t\t<SafeAreaView>\n\t\t\t\t<ScrollView\n\t\t\t\t\tstyle={ styles[ 'error-boundary__scroll' ] }\n\t\t\t\t\tcontentContainerStyle={\n\t\t\t\t\t\tstyles[ 'error-boundary__scroll-container' ]\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<View style={ styles[ 'error-boundary__container' ] }>\n\t\t\t\t\t\t<View style={ iconContainerStyle }>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ warning }\n\t\t\t\t\t\t\t\t{ ...styles[ 'error-boundary__icon' ] }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t\t<Text style={ titleStyle }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'The editor has encountered an unexpected error'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<Text style={ messageStyle }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'You can copy your post text in case your content is impacted. Copy error details to debug and share with support.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\tstyles[ 'error-boundary__actions-container' ]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CopyButton\n\t\t\t\t\t\t\t\tlabel={ __( 'Copy post text' ) }\n\t\t\t\t\t\t\t\taccessibilityLabel={ __(\n\t\t\t\t\t\t\t\t\t'Button to copy post text'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\taccessibilityHint={ __(\n\t\t\t\t\t\t\t\t\t'Tap here to copy post text'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttext={ getContent }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<CopyButton\n\t\t\t\t\t\t\t\tlabel={ __( 'Copy error details' ) }\n\t\t\t\t\t\t\t\taccessibilityLabel={ __(\n\t\t\t\t\t\t\t\t\t'Button to copy error details'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\taccessibilityHint={ __(\n\t\t\t\t\t\t\t\t\t'Tap here to copy error details'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttext={ error.stack }\n\t\t\t\t\t\t\t\tsecondary\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</View>\n\t\t\t\t</ScrollView>\n\t\t\t</SafeAreaView>\n\t\t);\n\t}\n}\n\nexport default withPreferredColorScheme( ErrorBoundary );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AACvE,OAAOC,SAAS,MAAM,mCAAmC;AACzD,SAASC,YAAY,QAAQ,gCAAgC;;AAE7D;AACA;AACA;AACA,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,iBAAiB;AACxC,SAASC,YAAY,QAAQ,gCAAgC;AAC7D,SACCC,4BAA4B,EAC5BC,wBAAwB,QAClB,oBAAoB;AAC3B,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SAASC,IAAI,QAAQ,uBAAuB;;AAE5C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAClD,OAAOC,MAAM,MAAM,cAAc;AAEjC,SAASC,UAAUA,CAAA,EAAG;EACrB,IAAI;IACH;IACA;IACA;IACA;IACA;IACA;IACA,OAA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EAAGmB;IAAoB,GACjCrB,aAAA,CAACjB,IAAI;MACJ0C,IAAI,EAAG3C,OAAS;MAAA,GACXI,MAAM,CAAE,sBAAsB;IAAE,CACrC,CACI,CAAC,EACPc,aAAA,CAAC7B,IAAI;MAAC+B,KAAK,EAAGoB;IAAY,GACvB7C,EAAE,CACH,gDACD,CACK,CAAC,EACPuB,aAAA,CAAC7B,IAAI;MAAC+B,KAAK,EAAGqB;IAAc,GACzB9C,EAAE,CACH,mHACD,CACK,CAAC,EACPuB,aAAA,CAAC3B,IAAI;MACJ6B,KAAK,EACJhB,MAAM,CAAE,mCAAmC;IAC3C,GAEDc,aAAA,CAACV,UAAU;MACVE,KAAK,EAAGf,EAAE,CAAE,gBAAiB,CAAG;MAChCgB,kBAAkB,EAAGhB,EAAE,CACtB,0BACD,CAAG;MACHiB,iBAAiB,EAAGjB,EAAE,CACrB,4BACD,CAAG;MACHc,IAAI,EAAGJ;IAAY,CACnB,CAAC,EACFa,aAAA,CAACV,UAAU;MACVE,KAAK,EAAGf,EAAE,CAAE,oBAAqB,CAAG;MACpCgB,kBAAkB,EAAGhB,EAAE,CACtB,8BACD,CAAG;MACHiB,iBAAiB,EAAGjB,EAAE,CACrB,gCACD,CAAG;MACHc,IAAI,EAAGF,KAAK,CAACqC,KAAO;MACpB/B,SAAS;IAAA,CACT,CACI,CACD,CACK,CACC,CAAC;EAEjB;AACD;AAEA,eAAed,wBAAwB,CAAEyB,aAAc,CAAC"}
|
|
@@ -26,6 +26,7 @@ export { default as PageAttributesOrder } from './page-attributes/order';
|
|
|
26
26
|
export { default as PageAttributesPanel } from './page-attributes/panel';
|
|
27
27
|
export { default as PageAttributesParent } from './page-attributes/parent';
|
|
28
28
|
export { default as PageTemplate } from './post-template/classic-theme';
|
|
29
|
+
export { default as PluginDocumentSettingPanel } from './plugin-document-setting-panel';
|
|
29
30
|
export { default as PostTemplatePanel } from './post-template/panel';
|
|
30
31
|
export { default as PostAuthor } from './post-author';
|
|
31
32
|
export { default as PostAuthorCheck } from './post-author/check';
|
|
@@ -61,7 +62,7 @@ export { default as PostSlugCheck } from './post-slug/check';
|
|
|
61
62
|
export { default as PostSticky } from './post-sticky';
|
|
62
63
|
export { default as PostStickyCheck } from './post-sticky/check';
|
|
63
64
|
export { default as PostSwitchToDraftButton } from './post-switch-to-draft-button';
|
|
64
|
-
export { default as PostSyncStatus
|
|
65
|
+
export { default as PostSyncStatus } from './post-sync-status';
|
|
65
66
|
export { default as PostTaxonomies } from './post-taxonomies';
|
|
66
67
|
export { FlatTermSelector as PostTaxonomiesFlatTermSelector } from './post-taxonomies/flat-term-selector';
|
|
67
68
|
export { HierarchicalTermSelector as PostTaxonomiesHierarchicalTermSelector } from './post-taxonomies/hierarchical-term-selector';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EditorKeyboardShortcuts","default","AutosaveMonitor","DocumentBar","DocumentOutline","DocumentOutlineCheck","EditorKeyboardShortcutsRegister","EditorHistoryRedo","EditorHistoryUndo","EditorNotices","EditorSnackbars","EntitiesSavedStates","useIsDirty","useEntitiesSavedStatesIsDirty","ErrorBoundary","LocalAutosaveMonitor","PageAttributesCheck","PageAttributesOrder","PageAttributesPanel","PageAttributesParent","PageTemplate","PostTemplatePanel","PostAuthor","PostAuthorCheck","PostAuthorPanel","PostComments","PostDiscussionPanel","PostExcerpt","PostExcerptCheck","PostExcerptPanel","PostFeaturedImage","PostFeaturedImageCheck","PostFeaturedImagePanel","PostFormat","PostFormatCheck","PostLastRevision","PostLastRevisionCheck","PostLastRevisionPanel","PostLockedModal","PostPendingStatus","PostPendingStatusCheck","PostPingbacks","PostPreviewButton","PostPublishButton","PostPublishButtonLabel","PostPublishPanel","PostSavedState","PostSchedule","PostScheduleCheck","PostScheduleLabel","usePostScheduleLabel","PostSchedulePanel","PostSlug","PostSlugCheck","PostSticky","PostStickyCheck","PostSwitchToDraftButton","PostSyncStatus","PostSyncStatusModal","PostTaxonomies","FlatTermSelector","PostTaxonomiesFlatTermSelector","HierarchicalTermSelector","PostTaxonomiesHierarchicalTermSelector","PostTaxonomiesCheck","PostTaxonomiesPanel","PostTextEditor","PostTitle","PostTitleRaw","PostTrash","PostTrashCheck","PostTypeSupportCheck","PostURL","PostURLCheck","PostURLLabel","usePostURLLabel","PostURLPanel","PostVisibility","PostVisibilityLabel","usePostVisibilityLabel","PostVisibilityCheck","TableOfContents","ThemeSupportCheck","UnsavedChangesWarning","WordCount","TimeToRead","CharacterCount","EditorProvider","VisualEditorGlobalKeyboardShortcuts","TextEditorGlobalKeyboardShortcuts"],"sources":["@wordpress/editor/src/components/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport EditorKeyboardShortcuts from './global-keyboard-shortcuts';\n\n// Block Creation Components.\nexport * from './autocompleters';\n\n// Post Related Components.\nexport { default as AutosaveMonitor } from './autosave-monitor';\nexport { default as DocumentBar } from './document-bar';\nexport { default as DocumentOutline } from './document-outline';\nexport { default as DocumentOutlineCheck } from './document-outline/check';\nexport { EditorKeyboardShortcuts };\nexport { default as EditorKeyboardShortcutsRegister } from './global-keyboard-shortcuts/register-shortcuts';\nexport { default as EditorHistoryRedo } from './editor-history/redo';\nexport { default as EditorHistoryUndo } from './editor-history/undo';\nexport { default as EditorNotices } from './editor-notices';\nexport { default as EditorSnackbars } from './editor-snackbars';\nexport { default as EntitiesSavedStates } from './entities-saved-states';\nexport { useIsDirty as useEntitiesSavedStatesIsDirty } from './entities-saved-states/hooks/use-is-dirty';\nexport { default as ErrorBoundary } from './error-boundary';\nexport { default as LocalAutosaveMonitor } from './local-autosave-monitor';\nexport { default as PageAttributesCheck } from './page-attributes/check';\nexport { default as PageAttributesOrder } from './page-attributes/order';\nexport { default as PageAttributesPanel } from './page-attributes/panel';\nexport { default as PageAttributesParent } from './page-attributes/parent';\nexport { default as PageTemplate } from './post-template/classic-theme';\nexport { default as PostTemplatePanel } from './post-template/panel';\nexport { default as PostAuthor } from './post-author';\nexport { default as PostAuthorCheck } from './post-author/check';\nexport { default as PostAuthorPanel } from './post-author/panel';\nexport { default as PostComments } from './post-comments';\nexport { default as PostDiscussionPanel } from './post-discussion/panel';\nexport { default as PostExcerpt } from './post-excerpt';\nexport { default as PostExcerptCheck } from './post-excerpt/check';\nexport { default as PostExcerptPanel } from './post-excerpt/panel';\nexport { default as PostFeaturedImage } from './post-featured-image';\nexport { default as PostFeaturedImageCheck } from './post-featured-image/check';\nexport { default as PostFeaturedImagePanel } from './post-featured-image/panel';\nexport { default as PostFormat } from './post-format';\nexport { default as PostFormatCheck } from './post-format/check';\nexport { default as PostLastRevision } from './post-last-revision';\nexport { default as PostLastRevisionCheck } from './post-last-revision/check';\nexport { default as PostLastRevisionPanel } from './post-last-revision/panel';\nexport { default as PostLockedModal } from './post-locked-modal';\nexport { default as PostPendingStatus } from './post-pending-status';\nexport { default as PostPendingStatusCheck } from './post-pending-status/check';\nexport { default as PostPingbacks } from './post-pingbacks';\nexport { default as PostPreviewButton } from './post-preview-button';\nexport { default as PostPublishButton } from './post-publish-button';\nexport { default as PostPublishButtonLabel } from './post-publish-button/label';\nexport { default as PostPublishPanel } from './post-publish-panel';\nexport { default as PostSavedState } from './post-saved-state';\nexport { default as PostSchedule } from './post-schedule';\nexport { default as PostScheduleCheck } from './post-schedule/check';\nexport {\n\tdefault as PostScheduleLabel,\n\tusePostScheduleLabel,\n} from './post-schedule/label';\nexport { default as PostSchedulePanel } from './post-schedule/panel';\nexport { default as PostSlug } from './post-slug';\nexport { default as PostSlugCheck } from './post-slug/check';\nexport { default as PostSticky } from './post-sticky';\nexport { default as PostStickyCheck } from './post-sticky/check';\nexport { default as PostSwitchToDraftButton } from './post-switch-to-draft-button';\nexport {\n\tdefault as PostSyncStatus,\n\tPostSyncStatusModal,\n} from './post-sync-status';\nexport { default as PostTaxonomies } from './post-taxonomies';\nexport { FlatTermSelector as PostTaxonomiesFlatTermSelector } from './post-taxonomies/flat-term-selector';\nexport { HierarchicalTermSelector as PostTaxonomiesHierarchicalTermSelector } from './post-taxonomies/hierarchical-term-selector';\nexport { default as PostTaxonomiesCheck } from './post-taxonomies/check';\nexport { default as PostTaxonomiesPanel } from './post-taxonomies/panel';\nexport { default as PostTextEditor } from './post-text-editor';\nexport { default as PostTitle } from './post-title';\nexport { default as PostTitleRaw } from './post-title/post-title-raw';\nexport { default as PostTrash } from './post-trash';\nexport { default as PostTrashCheck } from './post-trash/check';\nexport { default as PostTypeSupportCheck } from './post-type-support-check';\nexport { default as PostURL } from './post-url';\nexport { default as PostURLCheck } from './post-url/check';\nexport { default as PostURLLabel, usePostURLLabel } from './post-url/label';\nexport { default as PostURLPanel } from './post-url/panel';\nexport { default as PostVisibility } from './post-visibility';\nexport {\n\tdefault as PostVisibilityLabel,\n\tusePostVisibilityLabel,\n} from './post-visibility/label';\nexport { default as PostVisibilityCheck } from './post-visibility/check';\nexport { default as TableOfContents } from './table-of-contents';\nexport { default as ThemeSupportCheck } from './theme-support-check';\nexport { default as UnsavedChangesWarning } from './unsaved-changes-warning';\nexport { default as WordCount } from './word-count';\nexport { default as TimeToRead } from './time-to-read';\nexport { default as CharacterCount } from './character-count';\n\n// State Related Components.\nexport { default as EditorProvider } from './provider';\n\nexport * from './deprecated';\nexport const VisualEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;\nexport const TextEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,uBAAuB,MAAM,6BAA6B;;AAEjE;AACA,cAAc,kBAAkB;;AAEhC;AACA,SAASC,OAAO,IAAIC,eAAe,QAAQ,oBAAoB;AAC/D,SAASD,OAAO,IAAIE,WAAW,QAAQ,gBAAgB;AACvD,SAASF,OAAO,IAAIG,eAAe,QAAQ,oBAAoB;AAC/D,SAASH,OAAO,IAAII,oBAAoB,QAAQ,0BAA0B;AAC1E,SAASL,uBAAuB;AAChC,SAASC,OAAO,IAAIK,+BAA+B,QAAQ,gDAAgD;AAC3G,SAASL,OAAO,IAAIM,iBAAiB,QAAQ,uB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,QAAQ,mBAAmB;;AAE7D;AACA,SAASrF,OAAO,IAAIsF,cAAc,QAAQ,YAAY;AAEtD,cAAc,cAAc;AAC5B,OAAO,MAAMC,mCAAmC,GAAGxF,uBAAuB;AAC1E,OAAO,MAAMyF,iCAAiC,GAAGzF,uBAAuB"}
|
|
1
|
+
{"version":3,"names":["EditorKeyboardShortcuts","default","AutosaveMonitor","DocumentBar","DocumentOutline","DocumentOutlineCheck","EditorKeyboardShortcutsRegister","EditorHistoryRedo","EditorHistoryUndo","EditorNotices","EditorSnackbars","EntitiesSavedStates","useIsDirty","useEntitiesSavedStatesIsDirty","ErrorBoundary","LocalAutosaveMonitor","PageAttributesCheck","PageAttributesOrder","PageAttributesPanel","PageAttributesParent","PageTemplate","PluginDocumentSettingPanel","PostTemplatePanel","PostAuthor","PostAuthorCheck","PostAuthorPanel","PostComments","PostDiscussionPanel","PostExcerpt","PostExcerptCheck","PostExcerptPanel","PostFeaturedImage","PostFeaturedImageCheck","PostFeaturedImagePanel","PostFormat","PostFormatCheck","PostLastRevision","PostLastRevisionCheck","PostLastRevisionPanel","PostLockedModal","PostPendingStatus","PostPendingStatusCheck","PostPingbacks","PostPreviewButton","PostPublishButton","PostPublishButtonLabel","PostPublishPanel","PostSavedState","PostSchedule","PostScheduleCheck","PostScheduleLabel","usePostScheduleLabel","PostSchedulePanel","PostSlug","PostSlugCheck","PostSticky","PostStickyCheck","PostSwitchToDraftButton","PostSyncStatus","PostTaxonomies","FlatTermSelector","PostTaxonomiesFlatTermSelector","HierarchicalTermSelector","PostTaxonomiesHierarchicalTermSelector","PostTaxonomiesCheck","PostTaxonomiesPanel","PostTextEditor","PostTitle","PostTitleRaw","PostTrash","PostTrashCheck","PostTypeSupportCheck","PostURL","PostURLCheck","PostURLLabel","usePostURLLabel","PostURLPanel","PostVisibility","PostVisibilityLabel","usePostVisibilityLabel","PostVisibilityCheck","TableOfContents","ThemeSupportCheck","UnsavedChangesWarning","WordCount","TimeToRead","CharacterCount","EditorProvider","VisualEditorGlobalKeyboardShortcuts","TextEditorGlobalKeyboardShortcuts"],"sources":["@wordpress/editor/src/components/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport EditorKeyboardShortcuts from './global-keyboard-shortcuts';\n\n// Block Creation Components.\nexport * from './autocompleters';\n\n// Post Related Components.\nexport { default as AutosaveMonitor } from './autosave-monitor';\nexport { default as DocumentBar } from './document-bar';\nexport { default as DocumentOutline } from './document-outline';\nexport { default as DocumentOutlineCheck } from './document-outline/check';\nexport { EditorKeyboardShortcuts };\nexport { default as EditorKeyboardShortcutsRegister } from './global-keyboard-shortcuts/register-shortcuts';\nexport { default as EditorHistoryRedo } from './editor-history/redo';\nexport { default as EditorHistoryUndo } from './editor-history/undo';\nexport { default as EditorNotices } from './editor-notices';\nexport { default as EditorSnackbars } from './editor-snackbars';\nexport { default as EntitiesSavedStates } from './entities-saved-states';\nexport { useIsDirty as useEntitiesSavedStatesIsDirty } from './entities-saved-states/hooks/use-is-dirty';\nexport { default as ErrorBoundary } from './error-boundary';\nexport { default as LocalAutosaveMonitor } from './local-autosave-monitor';\nexport { default as PageAttributesCheck } from './page-attributes/check';\nexport { default as PageAttributesOrder } from './page-attributes/order';\nexport { default as PageAttributesPanel } from './page-attributes/panel';\nexport { default as PageAttributesParent } from './page-attributes/parent';\nexport { default as PageTemplate } from './post-template/classic-theme';\nexport { default as PluginDocumentSettingPanel } from './plugin-document-setting-panel';\nexport { default as PostTemplatePanel } from './post-template/panel';\nexport { default as PostAuthor } from './post-author';\nexport { default as PostAuthorCheck } from './post-author/check';\nexport { default as PostAuthorPanel } from './post-author/panel';\nexport { default as PostComments } from './post-comments';\nexport { default as PostDiscussionPanel } from './post-discussion/panel';\nexport { default as PostExcerpt } from './post-excerpt';\nexport { default as PostExcerptCheck } from './post-excerpt/check';\nexport { default as PostExcerptPanel } from './post-excerpt/panel';\nexport { default as PostFeaturedImage } from './post-featured-image';\nexport { default as PostFeaturedImageCheck } from './post-featured-image/check';\nexport { default as PostFeaturedImagePanel } from './post-featured-image/panel';\nexport { default as PostFormat } from './post-format';\nexport { default as PostFormatCheck } from './post-format/check';\nexport { default as PostLastRevision } from './post-last-revision';\nexport { default as PostLastRevisionCheck } from './post-last-revision/check';\nexport { default as PostLastRevisionPanel } from './post-last-revision/panel';\nexport { default as PostLockedModal } from './post-locked-modal';\nexport { default as PostPendingStatus } from './post-pending-status';\nexport { default as PostPendingStatusCheck } from './post-pending-status/check';\nexport { default as PostPingbacks } from './post-pingbacks';\nexport { default as PostPreviewButton } from './post-preview-button';\nexport { default as PostPublishButton } from './post-publish-button';\nexport { default as PostPublishButtonLabel } from './post-publish-button/label';\nexport { default as PostPublishPanel } from './post-publish-panel';\nexport { default as PostSavedState } from './post-saved-state';\nexport { default as PostSchedule } from './post-schedule';\nexport { default as PostScheduleCheck } from './post-schedule/check';\nexport {\n\tdefault as PostScheduleLabel,\n\tusePostScheduleLabel,\n} from './post-schedule/label';\nexport { default as PostSchedulePanel } from './post-schedule/panel';\nexport { default as PostSlug } from './post-slug';\nexport { default as PostSlugCheck } from './post-slug/check';\nexport { default as PostSticky } from './post-sticky';\nexport { default as PostStickyCheck } from './post-sticky/check';\nexport { default as PostSwitchToDraftButton } from './post-switch-to-draft-button';\nexport { default as PostSyncStatus } from './post-sync-status';\nexport { default as PostTaxonomies } from './post-taxonomies';\nexport { FlatTermSelector as PostTaxonomiesFlatTermSelector } from './post-taxonomies/flat-term-selector';\nexport { HierarchicalTermSelector as PostTaxonomiesHierarchicalTermSelector } from './post-taxonomies/hierarchical-term-selector';\nexport { default as PostTaxonomiesCheck } from './post-taxonomies/check';\nexport { default as PostTaxonomiesPanel } from './post-taxonomies/panel';\nexport { default as PostTextEditor } from './post-text-editor';\nexport { default as PostTitle } from './post-title';\nexport { default as PostTitleRaw } from './post-title/post-title-raw';\nexport { default as PostTrash } from './post-trash';\nexport { default as PostTrashCheck } from './post-trash/check';\nexport { default as PostTypeSupportCheck } from './post-type-support-check';\nexport { default as PostURL } from './post-url';\nexport { default as PostURLCheck } from './post-url/check';\nexport { default as PostURLLabel, usePostURLLabel } from './post-url/label';\nexport { default as PostURLPanel } from './post-url/panel';\nexport { default as PostVisibility } from './post-visibility';\nexport {\n\tdefault as PostVisibilityLabel,\n\tusePostVisibilityLabel,\n} from './post-visibility/label';\nexport { default as PostVisibilityCheck } from './post-visibility/check';\nexport { default as TableOfContents } from './table-of-contents';\nexport { default as ThemeSupportCheck } from './theme-support-check';\nexport { default as UnsavedChangesWarning } from './unsaved-changes-warning';\nexport { default as WordCount } from './word-count';\nexport { default as TimeToRead } from './time-to-read';\nexport { default as CharacterCount } from './character-count';\n\n// State Related Components.\nexport { default as EditorProvider } from './provider';\n\nexport * from './deprecated';\nexport const VisualEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;\nexport const TextEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,uBAAuB,MAAM,6BAA6B;;AAEjE;AACA,cAAc,kBAAkB;;AAEhC;AACA,SAASC,OAAO,IAAIC,eAAe,QAAQ,oBAAoB;AAC/D,SAASD,OAAO,IAAIE,WAAW,QAAQ,gBAAgB;AACvD,SAASF,OAAO,IAAIG,eAAe,QAAQ,oBAAoB;AAC/D,SAASH,OAAO,IAAII,oBAAoB,QAAQ,0BAA0B;AAC1E,SAASL,uBAAuB;AAChC,SAASC,OAAO,IAAIK,+BAA+B,QAAQ,gDAAgD;AAC3G,SAASL,OAAO,IAAIM,iBAAiB,QAAQ,uBAAuB;AACpE,SAASN,OAAO,IAAIO,iBAAiB,QAAQ,uBAAuB;AACpE,SAASP,OAAO,IAAIQ,aAAa,QAAQ,kBAAkB;AAC3D,SAASR,OAAO,IAAIS,eAAe,QAAQ,oBAAoB;AAC/D,SAAST,OAAO,IAAIU,mBAAmB,QAAQ,yBAAyB;AACxE,SAASC,UAAU,IAAIC,6BAA6B,QAAQ,4CAA4C;AACxG,SAASZ,OAAO,IAAIa,aAAa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// Other Components.
|
|
11
11
|
export { default as EditorHelpTopics } from './editor-help';
|
|
12
12
|
export { default as OfflineStatus } from './offline-status';
|
|
13
|
+
export { default as ErrorBoundary } from './error-boundary';
|
|
13
14
|
export * from './deprecated';
|
|
14
15
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","AutosaveMonitor","PostTitle","EditorHistoryRedo","EditorHistoryUndo","EditorProvider","EditorHelpTopics","OfflineStatus"],"sources":["@wordpress/editor/src/components/index.native.js"],"sourcesContent":["// Post Related Components.\nexport { default as AutosaveMonitor } from './autosave-monitor';\nexport { default as PostTitle } from './post-title';\nexport { default as EditorHistoryRedo } from './editor-history/redo';\nexport { default as EditorHistoryUndo } from './editor-history/undo';\n\n// State Related Components.\nexport { default as EditorProvider } from './provider';\n\n// Other Components.\nexport { default as EditorHelpTopics } from './editor-help';\nexport { default as OfflineStatus } from './offline-status';\n\nexport * from './deprecated';\n"],"mappings":"AAAA;AACA,SAASA,OAAO,IAAIC,eAAe,QAAQ,oBAAoB;AAC/D,SAASD,OAAO,IAAIE,SAAS,QAAQ,cAAc;AACnD,SAASF,OAAO,IAAIG,iBAAiB,QAAQ,uBAAuB;AACpE,SAASH,OAAO,IAAII,iBAAiB,QAAQ,uBAAuB;;AAEpE;AACA,SAASJ,OAAO,IAAIK,cAAc,QAAQ,YAAY;;AAEtD;AACA,SAASL,OAAO,IAAIM,gBAAgB,QAAQ,eAAe;AAC3D,SAASN,OAAO,IAAIO,aAAa,QAAQ,kBAAkB;AAE3D,cAAc,cAAc"}
|
|
1
|
+
{"version":3,"names":["default","AutosaveMonitor","PostTitle","EditorHistoryRedo","EditorHistoryUndo","EditorProvider","EditorHelpTopics","OfflineStatus","ErrorBoundary"],"sources":["@wordpress/editor/src/components/index.native.js"],"sourcesContent":["// Post Related Components.\nexport { default as AutosaveMonitor } from './autosave-monitor';\nexport { default as PostTitle } from './post-title';\nexport { default as EditorHistoryRedo } from './editor-history/redo';\nexport { default as EditorHistoryUndo } from './editor-history/undo';\n\n// State Related Components.\nexport { default as EditorProvider } from './provider';\n\n// Other Components.\nexport { default as EditorHelpTopics } from './editor-help';\nexport { default as OfflineStatus } from './offline-status';\nexport { default as ErrorBoundary } from './error-boundary';\n\nexport * from './deprecated';\n"],"mappings":"AAAA;AACA,SAASA,OAAO,IAAIC,eAAe,QAAQ,oBAAoB;AAC/D,SAASD,OAAO,IAAIE,SAAS,QAAQ,cAAc;AACnD,SAASF,OAAO,IAAIG,iBAAiB,QAAQ,uBAAuB;AACpE,SAASH,OAAO,IAAII,iBAAiB,QAAQ,uBAAuB;;AAEpE;AACA,SAASJ,OAAO,IAAIK,cAAc,QAAQ,YAAY;;AAEtD;AACA,SAASL,OAAO,IAAIM,gBAAgB,QAAQ,eAAe;AAC3D,SAASN,OAAO,IAAIO,aAAa,QAAQ,kBAAkB;AAC3D,SAASP,OAAO,IAAIQ,aAAa,QAAQ,kBAAkB;AAE3D,cAAc,cAAc"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { createElement, Fragment } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* WordPress dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { createSlotFill, PanelBody } from '@wordpress/components';
|
|
6
|
+
import { usePluginContext } from '@wordpress/plugins';
|
|
7
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
8
|
+
import warning from '@wordpress/warning';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import EnablePluginDocumentSettingPanelOption from '../preferences-modal/enable-plugin-document-setting-panel';
|
|
14
|
+
import { store as editorStore } from '../../store';
|
|
15
|
+
const {
|
|
16
|
+
Fill,
|
|
17
|
+
Slot
|
|
18
|
+
} = createSlotFill('PluginDocumentSettingPanel');
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Renders items below the Status & Availability panel in the Document Sidebar.
|
|
22
|
+
*
|
|
23
|
+
* @param {Object} props Component properties.
|
|
24
|
+
* @param {string} props.name Required. A machine-friendly name for the panel.
|
|
25
|
+
* @param {string} [props.className] An optional class name added to the row.
|
|
26
|
+
* @param {string} [props.title] The title of the panel
|
|
27
|
+
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
|
|
28
|
+
* @param {Element} props.children Children to be rendered
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```js
|
|
32
|
+
* // Using ES5 syntax
|
|
33
|
+
* var el = React.createElement;
|
|
34
|
+
* var __ = wp.i18n.__;
|
|
35
|
+
* var registerPlugin = wp.plugins.registerPlugin;
|
|
36
|
+
* var PluginDocumentSettingPanel = wp.editor.PluginDocumentSettingPanel;
|
|
37
|
+
*
|
|
38
|
+
* function MyDocumentSettingPlugin() {
|
|
39
|
+
* return el(
|
|
40
|
+
* PluginDocumentSettingPanel,
|
|
41
|
+
* {
|
|
42
|
+
* className: 'my-document-setting-plugin',
|
|
43
|
+
* title: 'My Panel',
|
|
44
|
+
* name: 'my-panel',
|
|
45
|
+
* },
|
|
46
|
+
* __( 'My Document Setting Panel' )
|
|
47
|
+
* );
|
|
48
|
+
* }
|
|
49
|
+
*
|
|
50
|
+
* registerPlugin( 'my-document-setting-plugin', {
|
|
51
|
+
* render: MyDocumentSettingPlugin
|
|
52
|
+
* } );
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```jsx
|
|
57
|
+
* // Using ESNext syntax
|
|
58
|
+
* import { registerPlugin } from '@wordpress/plugins';
|
|
59
|
+
* import { PluginDocumentSettingPanel } from '@wordpress/editor';
|
|
60
|
+
*
|
|
61
|
+
* const MyDocumentSettingTest = () => (
|
|
62
|
+
* <PluginDocumentSettingPanel className="my-document-setting-plugin" title="My Panel" name="my-panel">
|
|
63
|
+
* <p>My Document Setting Panel</p>
|
|
64
|
+
* </PluginDocumentSettingPanel>
|
|
65
|
+
* );
|
|
66
|
+
*
|
|
67
|
+
* registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @return {Component} The component to be rendered.
|
|
71
|
+
*/
|
|
72
|
+
const PluginDocumentSettingPanel = ({
|
|
73
|
+
name,
|
|
74
|
+
className,
|
|
75
|
+
title,
|
|
76
|
+
icon,
|
|
77
|
+
children
|
|
78
|
+
}) => {
|
|
79
|
+
const {
|
|
80
|
+
name: pluginName
|
|
81
|
+
} = usePluginContext();
|
|
82
|
+
const panelName = `${pluginName}/${name}`;
|
|
83
|
+
const {
|
|
84
|
+
opened,
|
|
85
|
+
isEnabled
|
|
86
|
+
} = useSelect(select => {
|
|
87
|
+
const {
|
|
88
|
+
isEditorPanelOpened,
|
|
89
|
+
isEditorPanelEnabled
|
|
90
|
+
} = select(editorStore);
|
|
91
|
+
return {
|
|
92
|
+
opened: isEditorPanelOpened(panelName),
|
|
93
|
+
isEnabled: isEditorPanelEnabled(panelName)
|
|
94
|
+
};
|
|
95
|
+
}, [panelName]);
|
|
96
|
+
const {
|
|
97
|
+
toggleEditorPanelOpened
|
|
98
|
+
} = useDispatch(editorStore);
|
|
99
|
+
if (undefined === name) {
|
|
100
|
+
typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warning('PluginDocumentSettingPanel requires a name property.') : void 0;
|
|
101
|
+
}
|
|
102
|
+
return createElement(Fragment, null, createElement(EnablePluginDocumentSettingPanelOption, {
|
|
103
|
+
label: title,
|
|
104
|
+
panelName: panelName
|
|
105
|
+
}), createElement(Fill, null, isEnabled && createElement(PanelBody, {
|
|
106
|
+
className: className,
|
|
107
|
+
title: title,
|
|
108
|
+
icon: icon,
|
|
109
|
+
opened: opened,
|
|
110
|
+
onToggle: () => toggleEditorPanelOpened(panelName)
|
|
111
|
+
}, children)));
|
|
112
|
+
};
|
|
113
|
+
PluginDocumentSettingPanel.Slot = Slot;
|
|
114
|
+
export default PluginDocumentSettingPanel;
|
|
115
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createSlotFill","PanelBody","usePluginContext","useDispatch","useSelect","warning","EnablePluginDocumentSettingPanelOption","store","editorStore","Fill","Slot","PluginDocumentSettingPanel","name","className","title","icon","children","pluginName","panelName","opened","isEnabled","select","isEditorPanelOpened","isEditorPanelEnabled","toggleEditorPanelOpened","undefined","SCRIPT_DEBUG","createElement","Fragment","label","onToggle"],"sources":["@wordpress/editor/src/components/plugin-document-setting-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { usePluginContext } from '@wordpress/plugins';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport EnablePluginDocumentSettingPanelOption from '../preferences-modal/enable-plugin-document-setting-panel';\nimport { store as editorStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' );\n\n/**\n * Renders items below the Status & Availability panel in the Document Sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} props.name Required. A machine-friendly name for the panel.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {string} [props.title] The title of the panel\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n * @param {Element} props.children Children to be rendered\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var el = React.createElement;\n * var __ = wp.i18n.__;\n * var registerPlugin = wp.plugins.registerPlugin;\n * var PluginDocumentSettingPanel = wp.editor.PluginDocumentSettingPanel;\n *\n * function MyDocumentSettingPlugin() {\n * \treturn el(\n * \t\tPluginDocumentSettingPanel,\n * \t\t{\n * \t\t\tclassName: 'my-document-setting-plugin',\n * \t\t\ttitle: 'My Panel',\n * \t\t\tname: 'my-panel',\n * \t\t},\n * \t\t__( 'My Document Setting Panel' )\n * \t);\n * }\n *\n * registerPlugin( 'my-document-setting-plugin', {\n * \t\trender: MyDocumentSettingPlugin\n * } );\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { registerPlugin } from '@wordpress/plugins';\n * import { PluginDocumentSettingPanel } from '@wordpress/editor';\n *\n * const MyDocumentSettingTest = () => (\n * \t\t<PluginDocumentSettingPanel className=\"my-document-setting-plugin\" title=\"My Panel\" name=\"my-panel\">\n *\t\t\t<p>My Document Setting Panel</p>\n *\t\t</PluginDocumentSettingPanel>\n *\t);\n *\n * registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nconst PluginDocumentSettingPanel = ( {\n\tname,\n\tclassName,\n\ttitle,\n\ticon,\n\tchildren,\n} ) => {\n\tconst { name: pluginName } = usePluginContext();\n\tconst panelName = `${ pluginName }/${ name }`;\n\tconst { opened, isEnabled } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isEditorPanelOpened, isEditorPanelEnabled } =\n\t\t\t\tselect( editorStore );\n\n\t\t\treturn {\n\t\t\t\topened: isEditorPanelOpened( panelName ),\n\t\t\t\tisEnabled: isEditorPanelEnabled( panelName ),\n\t\t\t};\n\t\t},\n\t\t[ panelName ]\n\t);\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( undefined === name ) {\n\t\twarning( 'PluginDocumentSettingPanel requires a name property.' );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<EnablePluginDocumentSettingPanelOption\n\t\t\t\tlabel={ title }\n\t\t\t\tpanelName={ panelName }\n\t\t\t/>\n\t\t\t<Fill>\n\t\t\t\t{ isEnabled && (\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\topened={ opened }\n\t\t\t\t\t\tonToggle={ () => toggleEditorPanelOpened( panelName ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\nPluginDocumentSettingPanel.Slot = Slot;\n\nexport default PluginDocumentSettingPanel;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,SAAS,QAAQ,uBAAuB;AACjE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,OAAOC,sCAAsC,MAAM,2DAA2D;AAC9G,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGV,cAAc,CAAE,4BAA6B,CAAC;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMW,0BAA0B,GAAGA,CAAE;EACpCC,IAAI;EACJC,SAAS;EACTC,KAAK;EACLC,IAAI;EACJC;AACD,CAAC,KAAM;EACN,MAAM;IAAEJ,IAAI,EAAEK;EAAW,CAAC,GAAGf,gBAAgB,CAAC,CAAC;EAC/C,MAAMgB,SAAS,GAAI,GAAGD,UAAY,IAAIL,IAAM,EAAC;EAC7C,MAAM;IAAEO,MAAM;IAAEC;EAAU,CAAC,GAAGhB,SAAS,CACpCiB,MAAM,IAAM;IACb,MAAM;MAAEC,mBAAmB;MAAEC;IAAqB,CAAC,GAClDF,MAAM,CAAEb,WAAY,CAAC;IAEtB,OAAO;MACNW,MAAM,EAAEG,mBAAmB,CAAEJ,SAAU,CAAC;MACxCE,SAAS,EAAEG,oBAAoB,CAAEL,SAAU;IAC5C,CAAC;EACF,CAAC,EACD,CAAEA,SAAS,CACZ,CAAC;EACD,MAAM;IAAEM;EAAwB,CAAC,GAAGrB,WAAW,CAAEK,WAAY,CAAC;EAE9D,IAAKiB,SAAS,KAAKb,IAAI,EAAG;IACzB,OAAAc,YAAA,oBAAAA,YAAA,YAAArB,OAAO,CAAE,sDAAuD,CAAC;EAClE;EAEA,OACCsB,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACrB,sCAAsC;IACtCuB,KAAK,EAAGf,KAAO;IACfI,SAAS,EAAGA;EAAW,CACvB,CAAC,EACFS,aAAA,CAAClB,IAAI,QACFW,SAAS,IACVO,aAAA,CAAC1B,SAAS;IACTY,SAAS,EAAGA,SAAW;IACvBC,KAAK,EAAGA,KAAO;IACfC,IAAI,EAAGA,IAAM;IACbI,MAAM,EAAGA,MAAQ;IACjBW,QAAQ,EAAGA,CAAA,KAAMN,uBAAuB,CAAEN,SAAU;EAAG,GAErDF,QACQ,CAEP,CACL,CAAC;AAEL,CAAC;AAEDL,0BAA0B,CAACD,IAAI,GAAGA,IAAI;AAEtC,eAAeC,0BAA0B"}
|
|
@@ -4,7 +4,7 @@ import { createElement } from "react";
|
|
|
4
4
|
*/
|
|
5
5
|
import { __, sprintf } from '@wordpress/i18n';
|
|
6
6
|
import { applyFilters } from '@wordpress/hooks';
|
|
7
|
-
import { DropZone, Button, Spinner,
|
|
7
|
+
import { DropZone, Button, Spinner, withNotices, withFilters, __experimentalHStack as HStack } from '@wordpress/components';
|
|
8
8
|
import { isBlobURL } from '@wordpress/blob';
|
|
9
9
|
import { useState, useRef } from '@wordpress/element';
|
|
10
10
|
import { compose } from '@wordpress/compose';
|
|
@@ -70,8 +70,6 @@ function PostFeaturedImage({
|
|
|
70
70
|
getSettings
|
|
71
71
|
} = useSelect(blockEditorStore);
|
|
72
72
|
const {
|
|
73
|
-
mediaWidth,
|
|
74
|
-
mediaHeight,
|
|
75
73
|
mediaSourceUrl
|
|
76
74
|
} = getMediaDetails(media, currentPostId);
|
|
77
75
|
function onDropFiles(filesList) {
|
|
@@ -121,14 +119,11 @@ function PostFeaturedImage({
|
|
|
121
119
|
onClick: open,
|
|
122
120
|
"aria-label": !featuredImageId ? null : __('Edit or replace the image'),
|
|
123
121
|
"aria-describedby": !featuredImageId ? null : `editor-post-featured-image-${featuredImageId}-describedby`
|
|
124
|
-
}, !!featuredImageId && media && createElement(
|
|
125
|
-
|
|
126
|
-
naturalHeight: mediaHeight,
|
|
127
|
-
isInline: true
|
|
128
|
-
}, createElement("img", {
|
|
122
|
+
}, !!featuredImageId && media && createElement("img", {
|
|
123
|
+
className: "editor-post-featured-image__preview-image",
|
|
129
124
|
src: mediaSourceUrl,
|
|
130
125
|
alt: ""
|
|
131
|
-
})
|
|
126
|
+
}), isLoading && createElement(Spinner, null), !featuredImageId && !isLoading && (postType?.labels?.set_featured_image || DEFAULT_SET_FEATURE_IMAGE_LABEL)), !!featuredImageId && createElement(HStack, {
|
|
132
127
|
className: "editor-post-featured-image__actions"
|
|
133
128
|
}, createElement(Button, {
|
|
134
129
|
className: "editor-post-featured-image__action",
|