@wordpress/edit-site 4.12.0 → 4.12.1-next.d6164808d3.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/build/components/add-new-template/new-template.js +7 -2
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js +26 -12
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/global-styles/border-panel.js +3 -3
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +92 -6
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +3 -3
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +28 -21
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +42 -10
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +39 -5
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/header/document-actions/index.js +1 -0
- package/build/components/header/document-actions/index.js.map +1 -1
- package/build/components/header/index.js +5 -2
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/mode-switcher/index.js +0 -4
- package/build/components/header/mode-switcher/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +13 -3
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/sidebar/default-sidebar.js +11 -1
- package/build/components/sidebar/default-sidebar.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js +11 -1
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build/components/template-details/edit-template-title.js +1 -1
- package/build/components/template-details/edit-template-title.js.map +1 -1
- package/build/components/template-details/index.js +18 -8
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-details/template-part-area-selector.js +47 -0
- package/build/components/template-details/template-part-area-selector.js.map +1 -0
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +8 -3
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +26 -12
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +3 -3
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +90 -7
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +3 -3
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +29 -22
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +42 -10
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +39 -5
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/header/document-actions/index.js +1 -0
- package/build-module/components/header/document-actions/index.js.map +1 -1
- package/build-module/components/header/index.js +5 -2
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/mode-switcher/index.js +0 -4
- package/build-module/components/header/mode-switcher/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +13 -3
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/sidebar/default-sidebar.js +9 -1
- package/build-module/components/sidebar/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +9 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/template-details/edit-template-title.js +1 -1
- package/build-module/components/template-details/edit-template-title.js.map +1 -1
- package/build-module/components/template-details/index.js +18 -9
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-details/template-part-area-selector.js +35 -0
- package/build-module/components/template-details/template-part-area-selector.js.map +1 -0
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-style/style-rtl.css +4 -6
- package/build-style/style.css +4 -6
- package/package.json +29 -29
- package/src/components/add-new-template/new-template.js +13 -4
- package/src/components/block-editor/resizable-editor.js +28 -18
- package/src/components/editor/style.scss +1 -0
- package/src/components/global-styles/border-panel.js +3 -3
- package/src/components/global-styles/dimensions-panel.js +134 -30
- package/src/components/global-styles/hooks.js +3 -3
- package/src/components/global-styles/style.scss +3 -2
- package/src/components/global-styles/test/use-global-styles-output.js +16 -3
- package/src/components/global-styles/test/utils.js +68 -8
- package/src/components/global-styles/typography-panel.js +96 -94
- package/src/components/global-styles/use-global-styles-output.js +41 -14
- package/src/components/global-styles/utils.js +29 -4
- package/src/components/header/document-actions/index.js +3 -0
- package/src/components/header/index.js +4 -1
- package/src/components/header/mode-switcher/index.js +0 -3
- package/src/components/header/more-menu/index.js +7 -2
- package/src/components/sidebar/default-sidebar.js +12 -0
- package/src/components/sidebar/plugin-sidebar/index.js +12 -0
- package/src/components/template-details/edit-template-title.js +7 -3
- package/src/components/template-details/index.js +20 -7
- package/src/components/template-details/style.scss +0 -5
- package/src/components/template-details/template-part-area-selector.js +38 -0
- package/src/index.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/template-details/index.js"],"names":["__","Button","MenuGroup","MenuItem","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/template-details/index.js"],"names":["__","Button","MenuGroup","MenuItem","__experimentalVStack","VStack","__experimentalText","Text","useDispatch","useSelect","store","editorStore","isTemplateRevertable","editSiteStore","TemplateAreas","EditTemplateTitle","useLink","TemplatePartAreaSelector","TemplateDetails","template","onClose","title","description","select","__experimentalGetTemplateInfo","revertTemplate","browseAllLinkProps","postType","type","postId","undefined","isTemplatePart","canEditTitle","has_theme_file","is_custom","revert","id"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SACCC,MADD,EAECC,SAFD,EAGCC,QAHD,EAICC,oBAAoB,IAAIC,MAJzB,EAKCC,kBAAkB,IAAIC,IALvB,QAMO,uBANP;AAOA,SAASC,WAAT,EAAsBC,SAAtB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lB;AAAsD,IAAA,OAAO,EAAG;AAAhE,KACGY,YAAY,GACb,cAAC,iBAAD;AAAmB,IAAA,QAAQ,EAAGb;AAA9B,IADa,GAGb,cAAC,IAAD;AACC,IAAA,IAAI,EAAG,EADR;AAEC,IAAA,MAAM,EAAG,GAFV;AAGC,IAAA,SAAS,EAAC,mCAHX;AAIC,IAAA,EAAE,EAAC;AAJJ,KAMGE,KANH,CAJF,EAcGC,WAAW,IACZ,cAAC,IAAD;AACC,IAAA,IAAI,EAAC,MADN;AAEC,IAAA,SAAS,EAAC,yCAFX;AAGC,IAAA,EAAE,EAAC;AAHJ,KAKGA,WALH,CAfF,CADD,EA0BGS,cAAc,IACf;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,wBAAD;AAA0B,IAAA,EAAE,EAAGZ,QAAQ,CAACiB;AAAxC,IADD,CA3BF,EAgCC,cAAC,aAAD;AAAe,IAAA,4BAA4B,EAAGhB;AAA9C,IAhCD,EAkCGR,oBAAoB,CAAEO,QAAF,CAApB,IACD,cAAC,SAAD;AAAW,IAAA,SAAS,EAAC;AAArB,KACC,cAAC,QAAD;AACC,IAAA,SAAS,EAAC,2CADX;AAEC,IAAA,IAAI,EAAGnB,EAAE,CACR,4CADQ,CAFV;AAKC,IAAA,OAAO,EAAGmC;AALX,KAOGnC,EAAE,CAAE,sBAAF,CAPL,CADD,CAnCF,EAgDC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC;AADX,KAEM0B,kBAFN,GAIG,CAAAP,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAES,IAAV,MAAmB,aAAnB,GACC5B,EAAE,CAAE,sBAAF,CADH,GAECA,EAAE,CAAE,2BAAF,CANN,CAhDD,CADD;AA2DA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tMenuGroup,\n\tMenuItem,\n\t__experimentalVStack as VStack,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport { store as editSiteStore } from '../../store';\nimport TemplateAreas from './template-areas';\nimport EditTemplateTitle from './edit-template-title';\nimport { useLink } from '../routes/link';\nimport TemplatePartAreaSelector from './template-part-area-selector';\n\nexport default function TemplateDetails( { template, onClose } ) {\n\tconst { title, description } = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetTemplateInfo( template ),\n\t\t[]\n\t);\n\tconst { revertTemplate } = useDispatch( editSiteStore );\n\n\tconst browseAllLinkProps = useLink( {\n\t\t// TODO: We should update this to filter by template part's areas as well.\n\t\tpostType: template.type,\n\t\tpostId: undefined,\n\t} );\n\n\tconst isTemplatePart = template.type === 'wp_template_part';\n\n\t// Only user-created and non-default templates can change the name.\n\t// But any user-created template part can be renamed.\n\tconst canEditTitle = isTemplatePart\n\t\t? ! template.has_theme_file\n\t\t: template.is_custom && ! template.has_theme_file;\n\n\tif ( ! template ) {\n\t\treturn null;\n\t}\n\n\tconst revert = () => {\n\t\trevertTemplate( template );\n\t\tonClose();\n\t};\n\n\treturn (\n\t\t<div className=\"edit-site-template-details\">\n\t\t\t<VStack className=\"edit-site-template-details__group\" spacing={ 3 }>\n\t\t\t\t{ canEditTitle ? (\n\t\t\t\t\t<EditTemplateTitle template={ template } />\n\t\t\t\t) : (\n\t\t\t\t\t<Text\n\t\t\t\t\t\tsize={ 16 }\n\t\t\t\t\t\tweight={ 600 }\n\t\t\t\t\t\tclassName=\"edit-site-template-details__title\"\n\t\t\t\t\t\tas=\"p\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\n\t\t\t\t{ description && (\n\t\t\t\t\t<Text\n\t\t\t\t\t\tsize=\"body\"\n\t\t\t\t\t\tclassName=\"edit-site-template-details__description\"\n\t\t\t\t\t\tas=\"p\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ description }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t</VStack>\n\n\t\t\t{ isTemplatePart && (\n\t\t\t\t<div className=\"edit-site-template-details__group\">\n\t\t\t\t\t<TemplatePartAreaSelector id={ template.id } />\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t<TemplateAreas closeTemplateDetailsDropdown={ onClose } />\n\n\t\t\t{ isTemplateRevertable( template ) && (\n\t\t\t\t<MenuGroup className=\"edit-site-template-details__group edit-site-template-details__revert\">\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tclassName=\"edit-site-template-details__revert-button\"\n\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t'Use the template as supplied by the theme.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonClick={ revert }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Clear customizations' ) }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-template-details__show-all-button\"\n\t\t\t\t{ ...browseAllLinkProps }\n\t\t\t>\n\t\t\t\t{ template?.type === 'wp_template'\n\t\t\t\t\t? __( 'Browse all templates' )\n\t\t\t\t\t: __( 'Browse all template parts' ) }\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
7
|
+
import { SelectControl } from '@wordpress/components';
|
|
8
|
+
import { useEntityProp } from '@wordpress/core-data';
|
|
9
|
+
import { useSelect } from '@wordpress/data';
|
|
10
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
11
|
+
export default function TemplatePartAreaSelector(_ref) {
|
|
12
|
+
let {
|
|
13
|
+
id
|
|
14
|
+
} = _ref;
|
|
15
|
+
const [area, setArea] = useEntityProp('postType', 'wp_template_part', 'area', id);
|
|
16
|
+
const definedAreas = useSelect(select => select(editorStore).__experimentalGetDefaultTemplatePartAreas(), []);
|
|
17
|
+
const areaOptions = definedAreas.map(_ref2 => {
|
|
18
|
+
let {
|
|
19
|
+
label,
|
|
20
|
+
area: _area
|
|
21
|
+
} = _ref2;
|
|
22
|
+
return {
|
|
23
|
+
label,
|
|
24
|
+
value: _area
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
return createElement(SelectControl, {
|
|
28
|
+
label: __('Area'),
|
|
29
|
+
labelPosition: "top",
|
|
30
|
+
options: areaOptions,
|
|
31
|
+
value: area,
|
|
32
|
+
onChange: setArea
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=template-part-area-selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/template-details/template-part-area-selector.js"],"names":["__","SelectControl","useEntityProp","useSelect","store","editorStore","TemplatePartAreaSelector","id","area","setArea","definedAreas","select","__experimentalGetDefaultTemplatePartAreas","areaOptions","map","label","_area","value"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,aAAT,QAA8B,uBAA9B;AACA,SAASC,aAAT,QAA8B,sBAA9B;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AAEA,eAAe,SAASC,wBAAT,OAA4C;AAAA,MAAT;AAAEC,IAAAA;AAAF,GAAS;AAC1D,QAAM,CAAEC,IAAF,EAAQC,OAAR,IAAoBP,aAAa,CACtC,UADsC,EAEtC,kBAFsC,EAGtC,MAHsC,EAItCK,EAJsC,CAAvC;AAOA,QAAMG,YAAY,GAAGP,SAAS,CAC3BQ,MAAF,IACCA,MAAM,CAAEN,WAAF,CAAN,CAAsBO,yCAAtB,EAF4B,EAG7B,EAH6B,CAA9B;AAMA,QAAMC,WAAW,GAAGH,YAAY,CAACI,GAAb,CAAkB;AAAA,QAAE;AAAEC,MAAAA,KAAF;AAASP,MAAAA,IAAI,EAAEQ;AAAf,KAAF;AAAA,WAAgC;AACrED,MAAAA,KADqE;AAErEE,MAAAA,KAAK,EAAED;AAF8D,KAAhC;AAAA,GAAlB,CAApB;AAKA,SACC,cAAC,aAAD;AACC,IAAA,KAAK,EAAGhB,EAAE,CAAE,MAAF,CADX;AAEC,IAAA,aAAa,EAAC,KAFf;AAGC,IAAA,OAAO,EAAGa,WAHX;AAIC,IAAA,KAAK,EAAGL,IAJT;AAKC,IAAA,QAAQ,EAAGC;AALZ,IADD;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl } from '@wordpress/components';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function TemplatePartAreaSelector( { id } ) {\n\tconst [ area, setArea ] = useEntityProp(\n\t\t'postType',\n\t\t'wp_template_part',\n\t\t'area',\n\t\tid\n\t);\n\n\tconst definedAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetDefaultTemplatePartAreas(),\n\t\t[]\n\t);\n\n\tconst areaOptions = definedAreas.map( ( { label, area: _area } ) => ( {\n\t\tlabel,\n\t\tvalue: _area,\n\t} ) );\n\n\treturn (\n\t\t<SelectControl\n\t\t\tlabel={ __( 'Area' ) }\n\t\t\tlabelPosition=\"top\"\n\t\t\toptions={ areaOptions }\n\t\t\tvalue={ area }\n\t\t\tonChange={ setArea }\n\t\t/>\n\t);\n}\n"]}
|
package/build-module/index.js
CHANGED
|
@@ -55,7 +55,7 @@ export function reinitializeEditor(target, settings) {
|
|
|
55
55
|
keepCaretInsideBlock: false,
|
|
56
56
|
welcomeGuide: true,
|
|
57
57
|
welcomeGuideStyles: true,
|
|
58
|
-
|
|
58
|
+
showListViewByDefault: false
|
|
59
59
|
}); // Check if the block list view should be open by default.
|
|
60
60
|
|
|
61
61
|
if (select(preferencesStore).get('core/edit-site', 'showListViewByDefault')) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","select","render","unmountComponentAtNode","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","editorStore","interfaceStore","preferencesStore","__","viewportStore","getQueryArgs","editSiteStore","EditSiteApp","getIsListPage","ErrorBoundaryWarning","reinitializeEditor","target","settings","__unstableHomeTemplate","reboot","bind","setDefaults","editorMode","fixedToolbar","focusMode","keepCaretInsideBlock","welcomeGuide","welcomeGuideStyles","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","select","render","unmountComponentAtNode","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","editorStore","interfaceStore","preferencesStore","__","viewportStore","getQueryArgs","editSiteStore","EditSiteApp","getIsListPage","ErrorBoundaryWarning","reinitializeEditor","target","settings","__unstableHomeTemplate","reboot","bind","setDefaults","editorMode","fixedToolbar","focusMode","keepCaretInsideBlock","welcomeGuide","welcomeGuideStyles","showListViewByDefault","get","setIsListViewOpened","setDefaultComplementaryArea","updateSettings","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","isLandingOnListPage","window","location","href","setIsNavigationPanelOpened","isViewportMatch","initializeEditor","id","search","searchOptions","__experimentalFetchRichUrlData","document","getElementById","__experimentalReapplyBlockTypeFilters","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","default","__experimentalMainDashboardButton","__experimentalNavigationToggle","PluginSidebar","PluginSidebarMoreMenuItem","PluginMoreMenuItem"],"mappings":";;AAAA;AACA;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ArC,CAAN;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAAS0B,gBAAT,CAA2BC,EAA3B,EAA+B1B,QAA/B,EAA0C;AAChDA,EAAAA,QAAQ,CAAChB,kCAAT,GAA8C,CAAE2C,MAAF,EAAUC,aAAV,KAC7C3C,oBAAoB,CAAE0C,MAAF,EAAUC,aAAV,EAAyB5B,QAAzB,CADrB;;AAEAA,EAAAA,QAAQ,CAAC6B,8BAAT,GAA0C1C,YAA1C;AAEA,QAAMY,MAAM,GAAG+B,QAAQ,CAACC,cAAT,CAAyBL,EAAzB,CAAf;;AAEA9C,EAAAA,QAAQ,CAAEH,WAAF,CAAR,CAAwBuD,qCAAxB;;AACAtD,EAAAA,kBAAkB;;AAClB,MAAKuD,OAAO,CAACC,GAAR,CAAYC,mBAAjB,EAAuC;AACtCxD,IAAAA,4CAA4C,CAAE;AAC7CyD,MAAAA,eAAe,EAAE;AAD4B,KAAF,CAA5C;AAGA;;AAEDtC,EAAAA,kBAAkB,CAAEC,MAAF,EAAUC,QAAV,CAAlB;AACA;AAED,SAASqC,OAAO,IAAIC,iCAApB,QAA6D,oCAA7D;AACA,SAASD,OAAO,IAAIE,8BAApB,QAA0D,mDAA1D;AACA,SAASF,OAAO,IAAIG,aAApB,QAAyC,qCAAzC;AACA,SAASH,OAAO,IAAII,yBAApB,QAAqD,mDAArD;AACA,SAASJ,OAAO,IAAIK,kBAApB,QAA8C,2CAA9C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch, select } from '@wordpress/data';\nimport { render, unmountComponentAtNode } from '@wordpress/element';\nimport {\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\nimport { store as viewportStore } from '@wordpress/viewport';\nimport { getQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport EditSiteApp from './components/app';\nimport getIsListPage from './utils/get-is-list-page';\nimport ErrorBoundaryWarning from './components/error-boundary/warning';\n\n/**\n * Reinitializes the editor after the user chooses to reboot the editor after\n * an unhandled error occurs, replacing previously mounted editor element using\n * an initial state from prior to the crash.\n *\n * @param {Element} target DOM node in which editor is rendered.\n * @param {?Object} settings Editor settings object.\n */\nexport function reinitializeEditor( target, settings ) {\n\t// Display warning if editor wasn't able to resolve homepage template.\n\tif ( ! settings.__unstableHomeTemplate ) {\n\t\trender(\n\t\t\t<ErrorBoundaryWarning\n\t\t\t\tmessage={ __(\n\t\t\t\t\t'The editor is unable to find a block template for the homepage.'\n\t\t\t\t) }\n\t\t\t\tdashboardLink=\"index.php\"\n\t\t\t/>,\n\t\t\ttarget\n\t\t);\n\t\treturn;\n\t}\n\n\t// This will be a no-op if the target doesn't have any React nodes.\n\tunmountComponentAtNode( target );\n\tconst reboot = reinitializeEditor.bind( null, target, settings );\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\t{\n\t\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\t\teditorMode: 'visual',\n\t\t\tfixedToolbar: false,\n\t\t\tfocusMode: false,\n\t\t\tkeepCaretInsideBlock: false,\n\t\t\twelcomeGuide: true,\n\t\t\twelcomeGuideStyles: true,\n\t\t\tshowListViewByDefault: false,\n\t\t} );\n\n\t\t// Check if the block list view should be open by default.\n\t\tif (\n\t\t\tselect( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'showListViewByDefault'\n\t\t\t)\n\t\t) {\n\t\t\tdispatch( editSiteStore ).setIsListViewOpened( true );\n\t\t}\n\n\t\tdispatch( interfaceStore ).setDefaultComplementaryArea(\n\t\t\t'core/edit-site',\n\t\t\t'edit-site/template'\n\t\t);\n\n\t\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t\t// so that they can be selected with core/editor selectors in any editor.\n\t\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t\t// which internally uses updateEditorSettings as well.\n\t\tdispatch( editorStore ).updateEditorSettings( {\n\t\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t\t} );\n\n\t\tconst isLandingOnListPage = getIsListPage(\n\t\t\tgetQueryArgs( window.location.href )\n\t\t);\n\n\t\tif ( isLandingOnListPage ) {\n\t\t\t// Default the navigation panel to be opened when we're in a bigger\n\t\t\t// screen and land in the list screen.\n\t\t\tdispatch( editSiteStore ).setIsNavigationPanelOpened(\n\t\t\t\tselect( viewportStore ).isViewportMatch( 'medium' )\n\t\t\t);\n\t\t}\n\t}\n\n\trender( <EditSiteApp reboot={ reboot } />, target );\n}\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\n\tsettings.__experimentalFetchRichUrlData = fetchUrlData;\n\n\tconst target = document.getElementById( id );\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\tregisterCoreBlocks();\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\treinitializeEditor( target, settings );\n}\n\nexport { default as __experimentalMainDashboardButton } from './components/main-dashboard-button';\nexport { default as __experimentalNavigationToggle } from './components/navigation-sidebar/navigation-toggle';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\n"]}
|
|
@@ -722,8 +722,9 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
|
|
|
722
722
|
border-radius: 2px;
|
|
723
723
|
}
|
|
724
724
|
|
|
725
|
-
.edit-site-typography-
|
|
726
|
-
|
|
725
|
+
.edit-site-typography-panel__full-width-control {
|
|
726
|
+
grid-column: 1/-1;
|
|
727
|
+
max-width: 100%;
|
|
727
728
|
}
|
|
728
729
|
|
|
729
730
|
.edit-site-global-styles-screen-heading-color,
|
|
@@ -1901,6 +1902,7 @@ html.wp-toolbar {
|
|
|
1901
1902
|
position: relative;
|
|
1902
1903
|
height: 100%;
|
|
1903
1904
|
display: block;
|
|
1905
|
+
overflow: hidden;
|
|
1904
1906
|
}
|
|
1905
1907
|
.edit-site-visual-editor iframe {
|
|
1906
1908
|
display: block;
|
|
@@ -1962,11 +1964,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
1962
1964
|
.edit-site-template-details .edit-site-template-details__group + .edit-site-template-details__group {
|
|
1963
1965
|
border-top: 1px solid #ccc;
|
|
1964
1966
|
}
|
|
1965
|
-
.edit-site-template-details .edit-site-template-details__title {
|
|
1966
|
-
margin: 0;
|
|
1967
|
-
}
|
|
1968
1967
|
.edit-site-template-details .edit-site-template-details__description {
|
|
1969
|
-
margin: 12px 0 0;
|
|
1970
1968
|
color: #757575;
|
|
1971
1969
|
}
|
|
1972
1970
|
.edit-site-template-details .edit-site-template-details__group.edit-site-template-details__template-areas {
|
package/build-style/style.css
CHANGED
|
@@ -722,8 +722,9 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
|
|
|
722
722
|
border-radius: 2px;
|
|
723
723
|
}
|
|
724
724
|
|
|
725
|
-
.edit-site-typography-
|
|
726
|
-
|
|
725
|
+
.edit-site-typography-panel__full-width-control {
|
|
726
|
+
grid-column: 1/-1;
|
|
727
|
+
max-width: 100%;
|
|
727
728
|
}
|
|
728
729
|
|
|
729
730
|
.edit-site-global-styles-screen-heading-color,
|
|
@@ -1901,6 +1902,7 @@ html.wp-toolbar {
|
|
|
1901
1902
|
position: relative;
|
|
1902
1903
|
height: 100%;
|
|
1903
1904
|
display: block;
|
|
1905
|
+
overflow: hidden;
|
|
1904
1906
|
}
|
|
1905
1907
|
.edit-site-visual-editor iframe {
|
|
1906
1908
|
display: block;
|
|
@@ -1962,11 +1964,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
1962
1964
|
.edit-site-template-details .edit-site-template-details__group + .edit-site-template-details__group {
|
|
1963
1965
|
border-top: 1px solid #ccc;
|
|
1964
1966
|
}
|
|
1965
|
-
.edit-site-template-details .edit-site-template-details__title {
|
|
1966
|
-
margin: 0;
|
|
1967
|
-
}
|
|
1968
1967
|
.edit-site-template-details .edit-site-template-details__description {
|
|
1969
|
-
margin: 12px 0 0;
|
|
1970
1968
|
color: #757575;
|
|
1971
1969
|
}
|
|
1972
1970
|
.edit-site-template-details .edit-site-template-details__group.edit-site-template-details__template-areas {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "4.12.0",
|
|
3
|
+
"version": "4.12.1-next.d6164808d3.0",
|
|
4
4
|
"description": "Edit Site Page module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,33 +27,33 @@
|
|
|
27
27
|
"react-native": "src/index",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
|
-
"@wordpress/a11y": "^3.15.0",
|
|
31
|
-
"@wordpress/api-fetch": "^6.12.0",
|
|
32
|
-
"@wordpress/block-editor": "^9.7.0",
|
|
33
|
-
"@wordpress/block-library": "^7.12.0",
|
|
34
|
-
"@wordpress/blocks": "^11.14.0",
|
|
35
|
-
"@wordpress/components": "^
|
|
36
|
-
"@wordpress/compose": "^5.13.0",
|
|
37
|
-
"@wordpress/core-data": "^4.
|
|
38
|
-
"@wordpress/data": "^
|
|
39
|
-
"@wordpress/deprecated": "^3.15.0",
|
|
40
|
-
"@wordpress/editor": "^12.14.0",
|
|
41
|
-
"@wordpress/element": "^4.13.0",
|
|
42
|
-
"@wordpress/hooks": "^3.15.0",
|
|
43
|
-
"@wordpress/html-entities": "^3.15.0",
|
|
44
|
-
"@wordpress/i18n": "^4.15.0",
|
|
45
|
-
"@wordpress/icons": "^9.6.0",
|
|
46
|
-
"@wordpress/interface": "^4.14.0",
|
|
47
|
-
"@wordpress/keyboard-shortcuts": "^3.13.0",
|
|
48
|
-
"@wordpress/keycodes": "^3.15.0",
|
|
49
|
-
"@wordpress/media-utils": "^4.6.0",
|
|
50
|
-
"@wordpress/notices": "^3.15.0",
|
|
51
|
-
"@wordpress/plugins": "^4.13.0",
|
|
52
|
-
"@wordpress/preferences": "^2.7.0",
|
|
53
|
-
"@wordpress/reusable-blocks": "^3.13.0",
|
|
54
|
-
"@wordpress/style-engine": "^0.14.0",
|
|
55
|
-
"@wordpress/url": "^3.16.0",
|
|
56
|
-
"@wordpress/viewport": "^4.13.0",
|
|
30
|
+
"@wordpress/a11y": "^3.15.1-next.d6164808d3.0",
|
|
31
|
+
"@wordpress/api-fetch": "^6.12.1-next.d6164808d3.0",
|
|
32
|
+
"@wordpress/block-editor": "^9.7.1-next.d6164808d3.0",
|
|
33
|
+
"@wordpress/block-library": "^7.12.2-next.d6164808d3.0",
|
|
34
|
+
"@wordpress/blocks": "^11.14.1-next.d6164808d3.0",
|
|
35
|
+
"@wordpress/components": "^20.0.1-next.d6164808d3.0",
|
|
36
|
+
"@wordpress/compose": "^5.13.1-next.d6164808d3.0",
|
|
37
|
+
"@wordpress/core-data": "^4.14.1-next.d6164808d3.0",
|
|
38
|
+
"@wordpress/data": "^7.0.1-next.d6164808d3.0",
|
|
39
|
+
"@wordpress/deprecated": "^3.15.1-next.d6164808d3.0",
|
|
40
|
+
"@wordpress/editor": "^12.14.1-next.d6164808d3.0",
|
|
41
|
+
"@wordpress/element": "^4.13.1-next.d6164808d3.0",
|
|
42
|
+
"@wordpress/hooks": "^3.15.1-next.d6164808d3.0",
|
|
43
|
+
"@wordpress/html-entities": "^3.15.1-next.d6164808d3.0",
|
|
44
|
+
"@wordpress/i18n": "^4.15.1-next.d6164808d3.0",
|
|
45
|
+
"@wordpress/icons": "^9.6.1-next.d6164808d3.0",
|
|
46
|
+
"@wordpress/interface": "^4.14.1-next.d6164808d3.0",
|
|
47
|
+
"@wordpress/keyboard-shortcuts": "^3.13.1-next.d6164808d3.0",
|
|
48
|
+
"@wordpress/keycodes": "^3.15.1-next.d6164808d3.0",
|
|
49
|
+
"@wordpress/media-utils": "^4.6.1-next.d6164808d3.0",
|
|
50
|
+
"@wordpress/notices": "^3.15.1-next.d6164808d3.0",
|
|
51
|
+
"@wordpress/plugins": "^4.13.1-next.d6164808d3.0",
|
|
52
|
+
"@wordpress/preferences": "^2.7.1-next.d6164808d3.0",
|
|
53
|
+
"@wordpress/reusable-blocks": "^3.13.1-next.d6164808d3.0",
|
|
54
|
+
"@wordpress/style-engine": "^0.14.1-next.d6164808d3.0",
|
|
55
|
+
"@wordpress/url": "^3.16.1-next.d6164808d3.0",
|
|
56
|
+
"@wordpress/viewport": "^4.13.1-next.d6164808d3.0",
|
|
57
57
|
"classnames": "^2.3.1",
|
|
58
58
|
"downloadjs": "^1.4.7",
|
|
59
59
|
"history": "^5.1.0",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "ba8a396d2f418e53a6c4c50575582f3f3eb11ff7"
|
|
72
72
|
}
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
tag,
|
|
29
29
|
layout as customGenericTemplateIcon,
|
|
30
30
|
} from '@wordpress/icons';
|
|
31
|
-
import { __ } from '@wordpress/i18n';
|
|
31
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
32
32
|
import { store as noticesStore } from '@wordpress/notices';
|
|
33
33
|
|
|
34
34
|
/**
|
|
@@ -88,7 +88,8 @@ export default function NewTemplate( { postType } ) {
|
|
|
88
88
|
|
|
89
89
|
const history = useHistory();
|
|
90
90
|
const { saveEntityRecord } = useDispatch( coreStore );
|
|
91
|
-
const { createErrorNotice } =
|
|
91
|
+
const { createErrorNotice, createSuccessNotice } =
|
|
92
|
+
useDispatch( noticesStore );
|
|
92
93
|
const { setTemplate } = useDispatch( editSiteStore );
|
|
93
94
|
|
|
94
95
|
async function createTemplate( template, isWPSuggestion = true ) {
|
|
@@ -130,8 +131,16 @@ export default function NewTemplate( { postType } ) {
|
|
|
130
131
|
postId: newTemplate.id,
|
|
131
132
|
postType: newTemplate.type,
|
|
132
133
|
} );
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
createSuccessNotice(
|
|
135
|
+
sprintf(
|
|
136
|
+
// translators: %s: Title of the created template e.g: "Category".
|
|
137
|
+
__( '"%s" successfully created.' ),
|
|
138
|
+
title
|
|
139
|
+
),
|
|
140
|
+
{
|
|
141
|
+
type: 'snackbar',
|
|
142
|
+
}
|
|
143
|
+
);
|
|
135
144
|
} catch ( error ) {
|
|
136
145
|
const errorMessage =
|
|
137
146
|
error.message && error.code !== 'unknown_error'
|
|
@@ -57,20 +57,31 @@ function ResizableEditor( { enableResizing, settings, children, ...props } ) {
|
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
let
|
|
60
|
+
let timeoutId = null;
|
|
61
61
|
|
|
62
62
|
function resizeHeight() {
|
|
63
|
-
if ( !
|
|
64
|
-
// Throttle the updates on
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
if ( ! timeoutId ) {
|
|
64
|
+
// Throttle the updates on timeout. This code previously
|
|
65
|
+
// used `requestAnimationFrame`, but that seems to not
|
|
66
|
+
// always work before an iframe is ready.
|
|
67
|
+
timeoutId = iframe.contentWindow.setTimeout( () => {
|
|
68
|
+
const { readyState } = iframe.contentDocument;
|
|
69
|
+
|
|
70
|
+
// Continue deferring the timeout until the document is ready.
|
|
71
|
+
// Only then will it have a height.
|
|
72
|
+
if (
|
|
73
|
+
readyState !== 'interactive' &&
|
|
74
|
+
readyState !== 'complete'
|
|
75
|
+
) {
|
|
76
|
+
resizeHeight();
|
|
77
|
+
return;
|
|
72
78
|
}
|
|
73
|
-
|
|
79
|
+
|
|
80
|
+
setHeight( iframe.contentDocument.body.scrollHeight );
|
|
81
|
+
timeoutId = null;
|
|
82
|
+
|
|
83
|
+
// 30 frames per second.
|
|
84
|
+
}, 1000 / 30 );
|
|
74
85
|
}
|
|
75
86
|
}
|
|
76
87
|
|
|
@@ -82,11 +93,10 @@ function ResizableEditor( { enableResizing, settings, children, ...props } ) {
|
|
|
82
93
|
resizeObserver = new iframe.contentWindow.ResizeObserver(
|
|
83
94
|
resizeHeight
|
|
84
95
|
);
|
|
85
|
-
|
|
86
|
-
//
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
);
|
|
96
|
+
|
|
97
|
+
// Observe the body, since the `html` element seems to always
|
|
98
|
+
// have a height of `100%`.
|
|
99
|
+
resizeObserver.observe( iframe.contentDocument.body );
|
|
90
100
|
|
|
91
101
|
resizeHeight();
|
|
92
102
|
}
|
|
@@ -97,7 +107,7 @@ function ResizableEditor( { enableResizing, settings, children, ...props } ) {
|
|
|
97
107
|
registerObserver();
|
|
98
108
|
|
|
99
109
|
return () => {
|
|
100
|
-
iframe.contentWindow?.
|
|
110
|
+
iframe.contentWindow?.clearTimeout( timeoutId );
|
|
101
111
|
resizeObserver?.disconnect();
|
|
102
112
|
iframe.removeEventListener( 'load', registerObserver );
|
|
103
113
|
};
|
|
@@ -153,7 +163,7 @@ function ResizableEditor( { enableResizing, settings, children, ...props } ) {
|
|
|
153
163
|
} }
|
|
154
164
|
>
|
|
155
165
|
<Iframe
|
|
156
|
-
style={ enableResizing ?
|
|
166
|
+
style={ enableResizing ? { height } : deviceStyles }
|
|
157
167
|
head={
|
|
158
168
|
<>
|
|
159
169
|
<EditorStyles styles={ settings.styles } />
|
|
@@ -179,11 +179,11 @@ export default function BorderPanel( { name } ) {
|
|
|
179
179
|
<BorderBoxControl
|
|
180
180
|
colors={ colors }
|
|
181
181
|
enableAlpha={ true }
|
|
182
|
+
enableStyle={ showBorderStyle }
|
|
182
183
|
onChange={ onBorderChange }
|
|
183
|
-
showStyle={ showBorderStyle }
|
|
184
|
-
value={ border }
|
|
185
|
-
popoverPlacement="left-start"
|
|
186
184
|
popoverOffset={ 40 }
|
|
185
|
+
popoverPlacement="left-start"
|
|
186
|
+
value={ border }
|
|
187
187
|
__experimentalHasMultipleOrigins={ true }
|
|
188
188
|
__experimentalIsRenderedInSidebar={ true }
|
|
189
189
|
/>
|