@wordpress/edit-widgets 6.32.0 → 6.32.1-next.47f435fc9.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/blocks/widget-area/block.json +26 -0
- package/build/blocks/widget-area/edit/index.js +94 -87
- package/build/blocks/widget-area/edit/index.js.map +7 -1
- package/build/blocks/widget-area/edit/inner-blocks.js +68 -50
- package/build/blocks/widget-area/edit/inner-blocks.js.map +7 -1
- package/build/blocks/widget-area/edit/use-is-dragging-within.js +34 -40
- package/build/blocks/widget-area/edit/use-is-dragging-within.js.map +7 -1
- package/build/blocks/widget-area/index.js +49 -52
- package/build/blocks/widget-area/index.js.map +7 -1
- package/build/components/error-boundary/index.js +49 -51
- package/build/components/error-boundary/index.js.map +7 -1
- package/build/components/header/document-tools/index.js +104 -74
- package/build/components/header/document-tools/index.js.map +7 -1
- package/build/components/header/index.js +81 -62
- package/build/components/header/index.js.map +7 -1
- package/build/components/header/undo-redo/redo.js +50 -38
- package/build/components/header/undo-redo/redo.js.map +7 -1
- package/build/components/header/undo-redo/undo.js +49 -37
- package/build/components/header/undo-redo/undo.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +74 -71
- package/build/components/keyboard-shortcut-help-modal/config.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +61 -44
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +154 -103
- package/build/components/keyboard-shortcut-help-modal/index.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +74 -56
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
- package/build/components/keyboard-shortcuts/index.js +89 -82
- package/build/components/keyboard-shortcuts/index.js.map +7 -1
- package/build/components/layout/index.js +75 -49
- package/build/components/layout/index.js.map +7 -1
- package/build/components/layout/interface.js +89 -75
- package/build/components/layout/interface.js.map +7 -1
- package/build/components/layout/unsaved-changes-warning.js +35 -42
- package/build/components/layout/unsaved-changes-warning.js.map +7 -1
- package/build/components/more-menu/index.js +189 -108
- package/build/components/more-menu/index.js.map +7 -1
- package/build/components/more-menu/tools-more-menu-group.js +29 -23
- package/build/components/more-menu/tools-more-menu-group.js.map +7 -1
- package/build/components/notices/index.js +62 -48
- package/build/components/notices/index.js.map +7 -1
- package/build/components/save-button/index.js +55 -47
- package/build/components/save-button/index.js.map +7 -1
- package/build/components/secondary-sidebar/index.js +41 -34
- package/build/components/secondary-sidebar/index.js.map +7 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +55 -46
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +7 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +76 -67
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +7 -1
- package/build/components/sidebar/index.js +149 -138
- package/build/components/sidebar/index.js.map +7 -1
- package/build/components/sidebar/widget-areas.js +73 -57
- package/build/components/sidebar/widget-areas.js.map +7 -1
- package/build/components/welcome-guide/index.js +182 -137
- package/build/components/welcome-guide/index.js.map +7 -1
- package/build/components/widget-areas-block-editor-content/index.js +64 -43
- package/build/components/widget-areas-block-editor-content/index.js.map +7 -1
- package/build/components/widget-areas-block-editor-provider/index.js +115 -92
- package/build/components/widget-areas-block-editor-provider/index.js.map +7 -1
- package/build/constants.js +30 -8
- package/build/constants.js.map +7 -1
- package/build/filters/index.js +3 -5
- package/build/filters/index.js.map +7 -1
- package/build/filters/move-to-widget-area.js +52 -59
- package/build/filters/move-to-widget-area.js.map +7 -1
- package/build/filters/replace-media-upload.js +9 -11
- package/build/filters/replace-media-upload.js.map +7 -1
- package/build/hooks/use-last-selected-widget-area.js +38 -44
- package/build/hooks/use-last-selected-widget-area.js.map +7 -1
- package/build/hooks/use-widget-library-insertion-point.js +60 -55
- package/build/hooks/use-widget-library-insertion-point.js.map +7 -1
- package/build/index.js +86 -93
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -15
- package/build/lock-unlock.js.map +7 -1
- package/build/store/actions.js +181 -313
- package/build/store/actions.js.map +7 -1
- package/build/store/constants.js +27 -10
- package/build/store/constants.js.map +7 -1
- package/build/store/index.js +51 -51
- package/build/store/index.js.map +7 -1
- package/build/store/private-selectors.js +28 -7
- package/build/store/private-selectors.js.map +7 -1
- package/build/store/reducer.js +65 -118
- package/build/store/reducer.js.map +7 -1
- package/build/store/resolvers.js +64 -63
- package/build/store/resolvers.js.map +7 -1
- package/build/store/selectors.js +194 -231
- package/build/store/selectors.js.map +7 -1
- package/build/store/transformers.js +47 -41
- package/build/store/transformers.js.map +7 -1
- package/build/store/utils.js +47 -70
- package/build/store/utils.js.map +7 -1
- package/build-module/blocks/widget-area/block.json +26 -0
- package/build-module/blocks/widget-area/edit/index.js +63 -75
- package/build-module/blocks/widget-area/edit/index.js.map +7 -1
- package/build-module/blocks/widget-area/edit/inner-blocks.js +38 -41
- package/build-module/blocks/widget-area/edit/inner-blocks.js.map +7 -1
- package/build-module/blocks/widget-area/edit/use-is-dragging-within.js +14 -33
- package/build-module/blocks/widget-area/edit/use-is-dragging-within.js.map +7 -1
- package/build-module/blocks/widget-area/index.js +14 -46
- package/build-module/blocks/widget-area/index.js.map +7 -1
- package/build-module/components/error-boundary/index.js +30 -43
- package/build-module/components/error-boundary/index.js.map +7 -1
- package/build-module/components/header/document-tools/index.js +75 -66
- package/build-module/components/header/document-tools/index.js.map +7 -1
- package/build-module/components/header/index.js +52 -54
- package/build-module/components/header/index.js.map +7 -1
- package/build-module/components/header/undo-redo/redo.js +32 -32
- package/build-module/components/header/undo-redo/redo.js.map +7 -1
- package/build-module/components/header/undo-redo/undo.js +31 -31
- package/build-module/components/header/undo-redo/undo.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +62 -75
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +33 -37
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +130 -97
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +56 -50
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
- package/build-module/components/keyboard-shortcuts/index.js +73 -75
- package/build-module/components/keyboard-shortcuts/index.js.map +7 -1
- package/build-module/components/layout/index.js +46 -41
- package/build-module/components/layout/index.js.map +7 -1
- package/build-module/components/layout/interface.js +63 -66
- package/build-module/components/layout/interface.js.map +7 -1
- package/build-module/components/layout/unsaved-changes-warning.js +17 -37
- package/build-module/components/layout/unsaved-changes-warning.js.map +7 -1
- package/build-module/components/more-menu/index.js +167 -102
- package/build-module/components/more-menu/index.js.map +7 -1
- package/build-module/components/more-menu/tools-more-menu-group.js +11 -17
- package/build-module/components/more-menu/tools-more-menu-group.js.map +7 -1
- package/build-module/components/notices/index.js +43 -42
- package/build-module/components/notices/index.js.map +7 -1
- package/build-module/components/save-button/index.js +37 -41
- package/build-module/components/save-button/index.js.map +7 -1
- package/build-module/components/secondary-sidebar/index.js +14 -27
- package/build-module/components/secondary-sidebar/index.js.map +7 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +26 -38
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +7 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +57 -60
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +7 -1
- package/build-module/components/sidebar/index.js +129 -127
- package/build-module/components/sidebar/index.js.map +7 -1
- package/build-module/components/sidebar/widget-areas.js +53 -49
- package/build-module/components/sidebar/widget-areas.js.map +7 -1
- package/build-module/components/welcome-guide/index.js +165 -132
- package/build-module/components/welcome-guide/index.js.map +7 -1
- package/build-module/components/widget-areas-block-editor-content/index.js +43 -36
- package/build-module/components/widget-areas-block-editor-content/index.js.map +7 -1
- package/build-module/components/widget-areas-block-editor-provider/index.js +85 -83
- package/build-module/components/widget-areas-block-editor-provider/index.js.map +7 -1
- package/build-module/constants.js +7 -3
- package/build-module/constants.js.map +7 -1
- package/build-module/filters/index.js +3 -6
- package/build-module/filters/index.js.map +7 -1
- package/build-module/filters/move-to-widget-area.js +52 -57
- package/build-module/filters/move-to-widget-area.js.map +7 -1
- package/build-module/filters/replace-media-upload.js +8 -7
- package/build-module/filters/replace-media-upload.js.map +7 -1
- package/build-module/hooks/use-last-selected-widget-area.js +20 -39
- package/build-module/hooks/use-last-selected-widget-area.js.map +7 -1
- package/build-module/hooks/use-widget-library-insertion-point.js +42 -49
- package/build-module/hooks/use-widget-library-insertion-point.js.map +7 -1
- package/build-module/index.js +60 -72
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/store/actions.js +153 -293
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/constants.js +5 -5
- package/build-module/store/constants.js.map +7 -1
- package/build-module/store/index.js +16 -40
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/private-selectors.js +7 -3
- package/build-module/store/private-selectors.js.map +7 -1
- package/build-module/store/reducer.js +42 -111
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/resolvers.js +43 -51
- package/build-module/store/resolvers.js.map +7 -1
- package/build-module/store/selectors.js +171 -224
- package/build-module/store/selectors.js.map +7 -1
- package/build-module/store/transformers.js +23 -34
- package/build-module/store/transformers.js.map +7 -1
- package/build-module/store/utils.js +22 -63
- package/build-module/store/utils.js.map +7 -1
- package/build-style/style-rtl.css +216 -88
- package/build-style/style.css +216 -88
- package/package.json +36 -29
- package/src/blocks/widget-area/editor.scss +3 -0
- package/src/components/customizer-edit-widgets-initializer/style.scss +3 -0
- package/src/components/error-boundary/style.scss +2 -0
- package/src/components/header/style.scss +5 -0
- package/src/components/keyboard-shortcut-help-modal/style.scss +2 -0
- package/src/components/layout/style.scss +3 -0
- package/src/components/more-menu/style.scss +2 -0
- package/src/components/notices/style.scss +3 -0
- package/src/components/secondary-sidebar/style.scss +4 -0
- package/src/components/sidebar/style.scss +2 -0
- package/src/components/welcome-guide/style.scss +2 -0
- package/src/components/widget-areas-block-editor-content/style.scss +2 -0
- package/src/style.scss +16 -13
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/layout/interface.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { BlockBreadcrumb } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport Header from '../header';\nimport WidgetAreasBlockEditorContent from '../widget-areas-block-editor-content';\nimport { store as editWidgetsStore } from '../../store';\nimport SecondarySidebar from '../secondary-sidebar';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the widgets screen top bar landmark region. */\n\theader: __( 'Widgets top bar' ),\n\t/* translators: accessibility text for the widgets screen content landmark region. */\n\tbody: __( 'Widgets and blocks' ),\n\t/* translators: accessibility text for the widgets screen settings landmark region. */\n\tsidebar: __( 'Widgets settings' ),\n\t/* translators: accessibility text for the widgets screen footer landmark region. */\n\tfooter: __( 'Widgets footer' ),\n};\n\nfunction Interface( { blockEditorSettings } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } =\n\t\tuseDispatch( editWidgetsStore );\n\tconst {\n\t\thasBlockBreadCrumbsEnabled,\n\t\thasSidebarEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasSidebarEnabled: !! select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( editWidgetsStore.name ),\n\t\t\tisInserterOpened: !! select( editWidgetsStore ).isInserterOpened(),\n\t\t\tisListViewOpened: !! select( editWidgetsStore ).isListViewOpened(),\n\t\t\thasBlockBreadCrumbsEnabled: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( hasSidebarEnabled && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}, [ hasSidebarEnabled, isHugeViewport ] );\n\n\tuseEffect( () => {\n\t\tif ( ( isInserterOpened || isListViewOpened ) && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isListViewOpened, isHugeViewport ] );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\n\tconst hasSecondarySidebar = isListViewOpened || isInserterOpened;\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={ <Header /> }\n\t\t\tsecondarySidebar={ hasSecondarySidebar && <SecondarySidebar /> }\n\t\t\tsidebar={ <ComplementaryArea.Slot scope=\"core/edit-widgets\" /> }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<WidgetAreasBlockEditorContent\n\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\thasBlockBreadCrumbsEnabled &&\n\t\t\t\t! isMobileViewport && (\n\t\t\t\t\t<div className=\"edit-widgets-layout__footer\">\n\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ __( 'Widgets' ) } />\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t/>\n\t);\n}\n\nexport default Interface;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqFY;AAlFZ,qBAAiC;AACjC,0BAAgC;AAChC,qBAA0B;AAC1B,kBAAuC;AACvC,uBAIO;AACP,kBAAmB;AACnB,yBAA0C;AAK1C,oBAAmB;AACnB,+CAA0C;AAC1C,mBAA0C;AAC1C,+BAA6B;AAE7B,MAAM,kBAAkB;AAAA;AAAA,EAEvB,YAAQ,gBAAI,iBAAkB;AAAA;AAAA,EAE9B,UAAM,gBAAI,oBAAqB;AAAA;AAAA,EAE/B,aAAS,gBAAI,kBAAmB;AAAA;AAAA,EAEhC,YAAQ,gBAAI,gBAAiB;AAC9B;AAEA,SAAS,UAAW,EAAE,oBAAoB,GAAI;AAC7C,QAAM,uBAAmB,iCAAkB,UAAU,GAAI;AACzD,QAAM,qBAAiB,iCAAkB,QAAQ,IAAK;AACtD,QAAM,EAAE,qBAAqB,qBAAqB,oBAAoB,QACrE,yBAAa,aAAAA,KAAiB;AAC/B,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI;AAAA,IACH,CAAE,YAAc;AAAA,MACf,mBAAmB,CAAC,CAAE;AAAA,QACrB,iBAAAC;AAAA,MACD,EAAE,2BAA4B,aAAAD,MAAiB,IAAK;AAAA,MACpD,kBAAkB,CAAC,CAAE,OAAQ,aAAAA,KAAiB,EAAE,iBAAiB;AAAA,MACjE,kBAAkB,CAAC,CAAE,OAAQ,aAAAA,KAAiB,EAAE,iBAAiB;AAAA,MACjE,4BAA4B,CAAC,CAAE,OAAQ,mBAAAE,KAAiB,EAAE;AAAA,QACzD;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AAGA,gCAAW,MAAM;AAChB,QAAK,qBAAqB,CAAE,gBAAiB;AAC5C,0BAAqB,KAAM;AAC3B,0BAAqB,KAAM;AAAA,IAC5B;AAAA,EACD,GAAG,CAAE,mBAAmB,cAAe,CAAE;AAEzC,gCAAW,MAAM;AAChB,SAAO,oBAAoB,qBAAsB,CAAE,gBAAiB;AACnE,0BAAoB;AAAA,IACrB;AAAA,EACD,GAAG,CAAE,kBAAkB,kBAAkB,cAAe,CAAE;AAE1D,QAAM,wBAAwB,uBAC3B,gBAAI,WAAY,QAChB,gBAAI,eAAgB;AAEvB,QAAM,sBAAsB,oBAAoB;AAEhD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,QAAS;AAAA,QACR,GAAG;AAAA,QACH,kBAAkB;AAAA,MACnB;AAAA,MACA,QAAS,4CAAC,cAAAC,SAAA,EAAO;AAAA,MACjB,kBAAmB,uBAAuB,4CAAC,yBAAAC,SAAA,EAAiB;AAAA,MAC5D,SAAU,4CAAC,mCAAkB,MAAlB,EAAuB,OAAM,qBAAoB;AAAA,MAC5D,SACC,2EACC;AAAA,QAAC,yCAAAC;AAAA,QAAA;AAAA,UACA;AAAA;AAAA,MACD,GACD;AAAA,MAED,QACC,8BACA,CAAE,oBACD,4CAAC,SAAI,WAAU,+BACd,sDAAC,uCAAgB,mBAAgB,gBAAI,SAAU,GAAI,GACpD;AAAA;AAAA,EAGH;AAEF;AAEA,IAAO,oBAAQ;",
|
|
6
|
+
"names": ["editWidgetsStore", "interfaceStore", "preferencesStore", "Header", "SecondarySidebar", "WidgetAreasBlockEditorContent"]
|
|
7
|
+
}
|
|
@@ -1,56 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var unsaved_changes_warning_exports = {};
|
|
19
|
+
__export(unsaved_changes_warning_exports, {
|
|
20
|
+
default: () => UnsavedChangesWarning
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
/**
|
|
12
|
-
* WordPress dependencies
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Internal dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Warns the user if there are unsaved changes before leaving the editor.
|
|
21
|
-
*
|
|
22
|
-
* This is a duplicate of the component implemented in the editor package.
|
|
23
|
-
* Duplicated here as edit-widgets doesn't depend on editor.
|
|
24
|
-
*
|
|
25
|
-
* @return {Component} The component.
|
|
26
|
-
*/
|
|
22
|
+
module.exports = __toCommonJS(unsaved_changes_warning_exports);
|
|
23
|
+
var import_i18n = require("@wordpress/i18n");
|
|
24
|
+
var import_element = require("@wordpress/element");
|
|
25
|
+
var import_data = require("@wordpress/data");
|
|
26
|
+
var import_store = require("../../store");
|
|
27
27
|
function UnsavedChangesWarning() {
|
|
28
|
-
const isDirty = (0,
|
|
29
|
-
const {
|
|
30
|
-
getEditedWidgetAreas
|
|
31
|
-
} = select(_store.store);
|
|
28
|
+
const isDirty = (0, import_data.useSelect)((select) => {
|
|
29
|
+
const { getEditedWidgetAreas } = select(import_store.store);
|
|
32
30
|
const editedWidgetAreas = getEditedWidgetAreas();
|
|
33
31
|
return editedWidgetAreas?.length > 0;
|
|
34
32
|
}, []);
|
|
35
|
-
(0,
|
|
36
|
-
|
|
37
|
-
* Warns the user if there are unsaved changes before leaving the editor.
|
|
38
|
-
*
|
|
39
|
-
* @param {Event} event `beforeunload` event.
|
|
40
|
-
*
|
|
41
|
-
* @return {string | undefined} Warning prompt message, if unsaved changes exist.
|
|
42
|
-
*/
|
|
43
|
-
const warnIfUnsavedChanges = event => {
|
|
33
|
+
(0, import_element.useEffect)(() => {
|
|
34
|
+
const warnIfUnsavedChanges = (event) => {
|
|
44
35
|
if (isDirty) {
|
|
45
|
-
event.returnValue = (0,
|
|
36
|
+
event.returnValue = (0, import_i18n.__)(
|
|
37
|
+
"You have unsaved changes. If you proceed, they will be lost."
|
|
38
|
+
);
|
|
46
39
|
return event.returnValue;
|
|
47
40
|
}
|
|
48
41
|
};
|
|
49
|
-
window.addEventListener(
|
|
42
|
+
window.addEventListener("beforeunload", warnIfUnsavedChanges);
|
|
50
43
|
return () => {
|
|
51
|
-
window.removeEventListener(
|
|
44
|
+
window.removeEventListener("beforeunload", warnIfUnsavedChanges);
|
|
52
45
|
};
|
|
53
46
|
}, [isDirty]);
|
|
54
47
|
return null;
|
|
55
48
|
}
|
|
56
|
-
//# sourceMappingURL=unsaved-changes-warning.js.map
|
|
49
|
+
//# sourceMappingURL=unsaved-changes-warning.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/layout/unsaved-changes-warning.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\n/**\n * Warns the user if there are unsaved changes before leaving the editor.\n *\n * This is a duplicate of the component implemented in the editor package.\n * Duplicated here as edit-widgets doesn't depend on editor.\n *\n * @return {Component} The component.\n */\nexport default function UnsavedChangesWarning() {\n\tconst isDirty = useSelect( ( select ) => {\n\t\tconst { getEditedWidgetAreas } = select( editWidgetsStore );\n\t\tconst editedWidgetAreas = getEditedWidgetAreas();\n\n\t\treturn editedWidgetAreas?.length > 0;\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Warns the user if there are unsaved changes before leaving the editor.\n\t\t *\n\t\t * @param {Event} event `beforeunload` event.\n\t\t *\n\t\t * @return {string | undefined} Warning prompt message, if unsaved changes exist.\n\t\t */\n\t\tconst warnIfUnsavedChanges = ( event ) => {\n\t\t\tif ( isDirty ) {\n\t\t\t\tevent.returnValue = __(\n\t\t\t\t\t'You have unsaved changes. If you proceed, they will be lost.'\n\t\t\t\t);\n\t\t\t\treturn event.returnValue;\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener( 'beforeunload', warnIfUnsavedChanges );\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'beforeunload', warnIfUnsavedChanges );\n\t\t};\n\t}, [ isDirty ] );\n\n\treturn null;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,qBAA0B;AAC1B,kBAA0B;AAK1B,mBAA0C;AAU3B,SAAR,wBAAyC;AAC/C,QAAM,cAAU,uBAAW,CAAE,WAAY;AACxC,UAAM,EAAE,qBAAqB,IAAI,OAAQ,aAAAA,KAAiB;AAC1D,UAAM,oBAAoB,qBAAqB;AAE/C,WAAO,mBAAmB,SAAS;AAAA,EACpC,GAAG,CAAC,CAAE;AAEN,gCAAW,MAAM;AAQhB,UAAM,uBAAuB,CAAE,UAAW;AACzC,UAAK,SAAU;AACd,cAAM,kBAAc;AAAA,UACnB;AAAA,QACD;AACA,eAAO,MAAM;AAAA,MACd;AAAA,IACD;AAEA,WAAO,iBAAkB,gBAAgB,oBAAqB;AAE9D,WAAO,MAAM;AACZ,aAAO,oBAAqB,gBAAgB,oBAAqB;AAAA,IAClE;AAAA,EACD,GAAG,CAAE,OAAQ,CAAE;AAEf,SAAO;AACR;",
|
|
6
|
+
"names": ["editWidgetsStore"]
|
|
7
|
+
}
|
|
@@ -1,113 +1,194 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var more_menu_exports = {};
|
|
29
|
+
__export(more_menu_exports, {
|
|
30
|
+
default: () => MoreMenu
|
|
6
31
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
/**
|
|
20
|
-
* WordPress dependencies
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Internal dependencies
|
|
25
|
-
*/
|
|
26
|
-
|
|
32
|
+
module.exports = __toCommonJS(more_menu_exports);
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
var import_components = require("@wordpress/components");
|
|
35
|
+
var import_element = require("@wordpress/element");
|
|
36
|
+
var import_i18n = require("@wordpress/i18n");
|
|
37
|
+
var import_icons = require("@wordpress/icons");
|
|
38
|
+
var import_preferences = require("@wordpress/preferences");
|
|
39
|
+
var import_keycodes = require("@wordpress/keycodes");
|
|
40
|
+
var import_keyboard_shortcuts = require("@wordpress/keyboard-shortcuts");
|
|
41
|
+
var import_compose = require("@wordpress/compose");
|
|
42
|
+
var import_keyboard_shortcut_help_modal = __toESM(require("../keyboard-shortcut-help-modal"));
|
|
43
|
+
var import_tools_more_menu_group = __toESM(require("./tools-more-menu-group"));
|
|
27
44
|
function MoreMenu() {
|
|
28
|
-
const [
|
|
45
|
+
const [
|
|
46
|
+
isKeyboardShortcutsModalActive,
|
|
47
|
+
setIsKeyboardShortcutsModalVisible
|
|
48
|
+
] = (0, import_element.useState)(false);
|
|
29
49
|
const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive);
|
|
30
|
-
(0,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
name: "welcomeGuide",
|
|
66
|
-
label: (0, _i18n.__)('Welcome Guide')
|
|
67
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.MenuItem, {
|
|
68
|
-
role: "menuitem",
|
|
69
|
-
icon: _icons.external,
|
|
70
|
-
href: (0, _i18n.__)('https://wordpress.org/documentation/article/block-based-widgets-editor/'),
|
|
71
|
-
target: "_blank",
|
|
72
|
-
rel: "noopener noreferrer",
|
|
73
|
-
children: [(0, _i18n.__)('Help'), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.VisuallyHidden, {
|
|
74
|
-
as: "span",
|
|
75
|
-
children: /* translators: accessibility text */
|
|
76
|
-
(0, _i18n.__)('(opens in a new tab)')
|
|
77
|
-
})]
|
|
78
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_toolsMoreMenuGroup.default.Slot, {
|
|
79
|
-
fillProps: {
|
|
80
|
-
onClose
|
|
50
|
+
(0, import_keyboard_shortcuts.useShortcut)(
|
|
51
|
+
"core/edit-widgets/keyboard-shortcuts",
|
|
52
|
+
toggleKeyboardShortcutsModal
|
|
53
|
+
);
|
|
54
|
+
const isLargeViewport = (0, import_compose.useViewportMatch)("medium");
|
|
55
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57
|
+
import_components.DropdownMenu,
|
|
58
|
+
{
|
|
59
|
+
icon: import_icons.moreVertical,
|
|
60
|
+
label: (0, import_i18n.__)("Options"),
|
|
61
|
+
popoverProps: {
|
|
62
|
+
placement: "bottom-end",
|
|
63
|
+
className: "more-menu-dropdown__content"
|
|
64
|
+
},
|
|
65
|
+
toggleProps: {
|
|
66
|
+
tooltipPosition: "bottom",
|
|
67
|
+
size: "compact"
|
|
68
|
+
},
|
|
69
|
+
children: (onClose) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
70
|
+
isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.MenuGroup, { label: (0, import_i18n._x)("View", "noun"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
|
+
import_preferences.PreferenceToggleMenuItem,
|
|
72
|
+
{
|
|
73
|
+
scope: "core/edit-widgets",
|
|
74
|
+
name: "fixedToolbar",
|
|
75
|
+
label: (0, import_i18n.__)("Top toolbar"),
|
|
76
|
+
info: (0, import_i18n.__)(
|
|
77
|
+
"Access all block and document tools in a single place"
|
|
78
|
+
),
|
|
79
|
+
messageActivated: (0, import_i18n.__)(
|
|
80
|
+
"Top toolbar activated"
|
|
81
|
+
),
|
|
82
|
+
messageDeactivated: (0, import_i18n.__)(
|
|
83
|
+
"Top toolbar deactivated"
|
|
84
|
+
)
|
|
81
85
|
}
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
86
|
+
) }),
|
|
87
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.MenuGroup, { label: (0, import_i18n.__)("Tools"), children: [
|
|
88
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
89
|
+
import_components.MenuItem,
|
|
90
|
+
{
|
|
91
|
+
onClick: () => {
|
|
92
|
+
setIsKeyboardShortcutsModalVisible(true);
|
|
93
|
+
},
|
|
94
|
+
shortcut: import_keycodes.displayShortcut.access("h"),
|
|
95
|
+
children: (0, import_i18n.__)("Keyboard shortcuts")
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
99
|
+
import_preferences.PreferenceToggleMenuItem,
|
|
100
|
+
{
|
|
101
|
+
scope: "core/edit-widgets",
|
|
102
|
+
name: "welcomeGuide",
|
|
103
|
+
label: (0, import_i18n.__)("Welcome Guide")
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
107
|
+
import_components.MenuItem,
|
|
108
|
+
{
|
|
109
|
+
role: "menuitem",
|
|
110
|
+
icon: import_icons.external,
|
|
111
|
+
href: (0, import_i18n.__)(
|
|
112
|
+
"https://wordpress.org/documentation/article/block-based-widgets-editor/"
|
|
113
|
+
),
|
|
114
|
+
target: "_blank",
|
|
115
|
+
rel: "noopener noreferrer",
|
|
116
|
+
children: [
|
|
117
|
+
(0, import_i18n.__)("Help"),
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.VisuallyHidden, {
|
|
119
|
+
as: "span",
|
|
120
|
+
/* translators: accessibility text */
|
|
121
|
+
children: (0, import_i18n.__)("(opens in a new tab)")
|
|
122
|
+
})
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
127
|
+
import_tools_more_menu_group.default.Slot,
|
|
128
|
+
{
|
|
129
|
+
fillProps: { onClose }
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
] }),
|
|
133
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.MenuGroup, { label: (0, import_i18n.__)("Preferences"), children: [
|
|
134
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
135
|
+
import_preferences.PreferenceToggleMenuItem,
|
|
136
|
+
{
|
|
137
|
+
scope: "core/edit-widgets",
|
|
138
|
+
name: "keepCaretInsideBlock",
|
|
139
|
+
label: (0, import_i18n.__)(
|
|
140
|
+
"Contain text cursor inside block"
|
|
141
|
+
),
|
|
142
|
+
info: (0, import_i18n.__)(
|
|
143
|
+
"Aids screen readers by stopping text caret from leaving blocks."
|
|
144
|
+
),
|
|
145
|
+
messageActivated: (0, import_i18n.__)(
|
|
146
|
+
"Contain text cursor inside block activated"
|
|
147
|
+
),
|
|
148
|
+
messageDeactivated: (0, import_i18n.__)(
|
|
149
|
+
"Contain text cursor inside block deactivated"
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
154
|
+
import_preferences.PreferenceToggleMenuItem,
|
|
155
|
+
{
|
|
156
|
+
scope: "core/edit-widgets",
|
|
157
|
+
name: "themeStyles",
|
|
158
|
+
info: (0, import_i18n.__)(
|
|
159
|
+
"Make the editor look like your theme."
|
|
160
|
+
),
|
|
161
|
+
label: (0, import_i18n.__)("Use theme styles")
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
165
|
+
import_preferences.PreferenceToggleMenuItem,
|
|
166
|
+
{
|
|
167
|
+
scope: "core/edit-widgets",
|
|
168
|
+
name: "showBlockBreadcrumbs",
|
|
169
|
+
label: (0, import_i18n.__)("Display block breadcrumbs"),
|
|
170
|
+
info: (0, import_i18n.__)(
|
|
171
|
+
"Shows block breadcrumbs at the bottom of the editor."
|
|
172
|
+
),
|
|
173
|
+
messageActivated: (0, import_i18n.__)(
|
|
174
|
+
"Display block breadcrumbs activated"
|
|
175
|
+
),
|
|
176
|
+
messageDeactivated: (0, import_i18n.__)(
|
|
177
|
+
"Display block breadcrumbs deactivated"
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
] })
|
|
182
|
+
] })
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
186
|
+
import_keyboard_shortcut_help_modal.default,
|
|
187
|
+
{
|
|
188
|
+
isModalActive: isKeyboardShortcutsModalActive,
|
|
189
|
+
toggleModal: toggleKeyboardShortcutsModal
|
|
190
|
+
}
|
|
191
|
+
)
|
|
192
|
+
] });
|
|
112
193
|
}
|
|
113
|
-
//# sourceMappingURL=index.js.map
|
|
194
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/more-menu/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tDropdownMenu,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { external, moreVertical } from '@wordpress/icons';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ToolsMoreMenuGroup from './tools-more-menu-group';\n\nexport default function MoreMenu() {\n\tconst [\n\t\tisKeyboardShortcutsModalActive,\n\t\tsetIsKeyboardShortcutsModalVisible,\n\t] = useState( false );\n\tconst toggleKeyboardShortcutsModal = () =>\n\t\tsetIsKeyboardShortcutsModalVisible( ! isKeyboardShortcutsModalActive );\n\n\tuseShortcut(\n\t\t'core/edit-widgets/keyboard-shortcuts',\n\t\ttoggleKeyboardShortcutsModal\n\t);\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tplacement: 'bottom-end',\n\t\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t\t} }\n\t\t\t\ttoggleProps={ {\n\t\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\t\tsize: 'compact',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ ( onClose ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsKeyboardShortcutsModalVisible( true );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tname=\"welcomeGuide\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/block-based-widgets-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<ToolsMoreMenuGroup.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Preferences' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tname=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tname=\"themeStyles\"\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\t\tname=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Display block breadcrumbs activated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Display block breadcrumbs deactivated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t\t<KeyboardShortcutHelpModal\n\t\t\t\tisModalActive={ isKeyboardShortcutsModalActive }\n\t\t\t\ttoggleModal={ toggleKeyboardShortcutsModal }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["ToolsMoreMenuGroup", "KeyboardShortcutHelpModal"]
|
|
7
|
+
}
|
|
@@ -1,24 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var tools_more_menu_group_exports = {};
|
|
19
|
+
__export(tools_more_menu_group_exports, {
|
|
20
|
+
default: () => tools_more_menu_group_default
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Slot
|
|
16
|
-
} = (0, _components.createSlotFill)('EditWidgetsToolsMoreMenuGroup');
|
|
17
|
-
ToolsMoreMenuGroup.Slot = ({
|
|
18
|
-
fillProps
|
|
19
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Slot, {
|
|
20
|
-
fillProps: fillProps,
|
|
21
|
-
children: fills => fills.length > 0 && fills
|
|
22
|
-
});
|
|
23
|
-
var _default = exports.default = ToolsMoreMenuGroup;
|
|
24
|
-
//# sourceMappingURL=tools-more-menu-group.js.map
|
|
22
|
+
module.exports = __toCommonJS(tools_more_menu_group_exports);
|
|
23
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
|
+
var import_components = require("@wordpress/components");
|
|
25
|
+
const { Fill: ToolsMoreMenuGroup, Slot } = (0, import_components.createSlotFill)(
|
|
26
|
+
"EditWidgetsToolsMoreMenuGroup"
|
|
27
|
+
);
|
|
28
|
+
ToolsMoreMenuGroup.Slot = ({ fillProps }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Slot, { fillProps, children: (fills) => fills.length > 0 && fills });
|
|
29
|
+
var tools_more_menu_group_default = ToolsMoreMenuGroup;
|
|
30
|
+
//# sourceMappingURL=tools-more-menu-group.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/more-menu/tools-more-menu-group.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } = createSlotFill(\n\t'EditWidgetsToolsMoreMenuGroup'\n);\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) => fills.length > 0 && fills }\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUC;AAPD,wBAA+B;AAE/B,MAAM,EAAE,MAAM,oBAAoB,KAAK,QAAI;AAAA,EAC1C;AACD;AAEA,mBAAmB,OAAO,CAAE,EAAE,UAAU,MACvC,4CAAC,QAAK,WACH,WAAE,UAAW,MAAM,SAAS,KAAK,OACpC;AAGD,IAAO,gCAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|