@wordpress/edit-widgets 5.19.3 → 5.20.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/blocks/widget-area/edit/index.js +6 -5
- package/build/blocks/widget-area/edit/index.js.map +1 -1
- package/build/blocks/widget-area/edit/inner-blocks.js +4 -3
- package/build/blocks/widget-area/edit/inner-blocks.js.map +1 -1
- package/build/components/error-boundary/index.js +5 -4
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/header/index.js +12 -11
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/undo-redo/redo.js +2 -2
- package/build/components/header/undo-redo/redo.js.map +1 -1
- package/build/components/header/undo-redo/undo.js +2 -2
- package/build/components/header/undo-redo/undo.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +15 -15
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +8 -7
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/layout/index.js +5 -5
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/interface.js +9 -8
- package/build/components/layout/interface.js.map +1 -1
- package/build/components/layout/unsaved-changes-warning.js +1 -1
- package/build/components/layout/unsaved-changes-warning.js.map +1 -1
- package/build/components/more-menu/index.js +15 -14
- package/build/components/more-menu/index.js.map +1 -1
- package/build/components/more-menu/tools-more-menu-group.js +2 -2
- package/build/components/more-menu/tools-more-menu-group.js.map +1 -1
- package/build/components/notices/index.js +4 -4
- package/build/components/notices/index.js.map +1 -1
- package/build/components/save-button/index.js +2 -2
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/secondary-sidebar/index.js +3 -3
- package/build/components/secondary-sidebar/index.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +7 -6
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +7 -6
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +9 -8
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar/widget-areas.js +7 -6
- package/build/components/sidebar/widget-areas.js.map +1 -1
- package/build/components/welcome-guide/index.js +23 -22
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/widget-areas-block-editor-content/index.js +5 -4
- package/build/components/widget-areas-block-editor-content/index.js.map +1 -1
- package/build/components/widget-areas-block-editor-provider/index.js +4 -3
- package/build/components/widget-areas-block-editor-provider/index.js.map +1 -1
- package/build/filters/move-to-widget-area.js +3 -3
- package/build/filters/move-to-widget-area.js.map +1 -1
- package/build/index.js +3 -2
- package/build/index.js.map +1 -1
- package/build-module/blocks/widget-area/edit/index.js +1 -1
- package/build-module/blocks/widget-area/edit/inner-blocks.js +1 -1
- package/build-module/components/error-boundary/index.js +1 -1
- package/build-module/components/header/index.js +1 -1
- package/build-module/components/header/undo-redo/redo.js +1 -1
- package/build-module/components/header/undo-redo/undo.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -1
- package/build-module/components/layout/index.js +1 -1
- package/build-module/components/layout/interface.js +1 -1
- package/build-module/components/layout/unsaved-changes-warning.js +1 -1
- package/build-module/components/layout/unsaved-changes-warning.js.map +1 -1
- package/build-module/components/more-menu/index.js +1 -1
- package/build-module/components/more-menu/tools-more-menu-group.js +1 -1
- package/build-module/components/notices/index.js +1 -1
- package/build-module/components/save-button/index.js +1 -1
- package/build-module/components/secondary-sidebar/index.js +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -1
- package/build-module/components/sidebar/index.js +1 -1
- package/build-module/components/sidebar/widget-areas.js +1 -1
- package/build-module/components/welcome-guide/index.js +1 -1
- package/build-module/components/widget-areas-block-editor-content/index.js +1 -1
- package/build-module/components/widget-areas-block-editor-provider/index.js +3 -3
- package/build-module/components/widget-areas-block-editor-provider/index.js.map +1 -1
- package/build-module/filters/move-to-widget-area.js +1 -1
- package/build-module/index.js +1 -1
- package/build-style/style-rtl.css +11 -10
- package/build-style/style.css +11 -10
- package/package.json +28 -28
- package/src/components/layout/unsaved-changes-warning.js +1 -1
- package/src/components/widget-areas-block-editor-provider/index.js +2 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_components","_compose","_data","_element","_i18n","_icons","_keycodes","_store","ListViewSidebar","listViewToggleElement","setIsListViewOpened","useDispatch","editWidgetsStore","dropZoneElement","setDropZoneElement","useState","focusOnMountRef","useFocusOnMount","closeListView","useCallback","focus","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","preventDefault","_react","createElement","className","onKeyDown","__","Button","icon","closeSmall","label","onClick","ref","useMergeRefs","__experimentalListView"],"sources":["@wordpress/edit-widgets/src/components/secondary-sidebar/list-view-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport { useFocusOnMount, useMergeRefs } from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { useCallback, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function ListViewSidebar( { listViewToggleElement } ) {\n\tconst { setIsListViewOpened } = useDispatch( editWidgetsStore );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\n\t// When closing the list view, focus should return to the toggle button.\n\tconst closeListView = useCallback( () => {\n\t\tsetIsListViewOpened( false );\n\t\tlistViewToggleElement?.focus();\n\t}, [ listViewToggleElement, setIsListViewOpened ] );\n\n\tconst closeOnEscape = useCallback(\n\t\t( event ) => {\n\t\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcloseListView();\n\t\t\t}\n\t\t},\n\t\t[ closeListView ]\n\t);\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-widgets-editor__list-view-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t>\n\t\t\t<div className=\"edit-widgets-editor__list-view-panel-header\">\n\t\t\t\t<strong>{ __( 'List View' ) }</strong>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ closeListView }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-widgets-editor__list-view-panel-content\"\n\t\t\t\tref={ useMergeRefs( [ focusOnMountRef, setDropZoneElement ] ) }\n\t\t\t>\n\t\t\t\t<ListView dropZoneElement={ dropZoneElement } />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AAfA;AACA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AA8C;MACxDQ,GAAG,EAAG,IAAAC,qBAAY,EAAE,CAAEtB,eAAe,EAAEF,kBAAkB,CAAG;IAAG,GAE/D,IAAAa,MAAA,CAAAC,aAAA,EAAC9B,YAAA,CAAAyC,sBAAQ;MAAC1B,eAAe,EAAGA;IAAiB,CAAE,CAC3C,CACD;EAAC;AAER"}
|
|
@@ -5,8 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = Sidebar;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
10
11
|
var _i18n = require("@wordpress/i18n");
|
|
11
12
|
var _interface = require("@wordpress/interface");
|
|
12
13
|
var _blockEditor = require("@wordpress/block-editor");
|
|
@@ -45,7 +46,7 @@ function ComplementaryAreaTab({
|
|
|
45
46
|
const {
|
|
46
47
|
enableComplementaryArea
|
|
47
48
|
} = (0, _data.useDispatch)(_interface.store);
|
|
48
|
-
return (0,
|
|
49
|
+
return (0, _react.createElement)(_components.Button, {
|
|
49
50
|
onClick: () => enableComplementaryArea(_store.store.name, identifier),
|
|
50
51
|
className: (0, _classnames.default)('edit-widgets-sidebar__panel-tab', {
|
|
51
52
|
'is-active': isActive
|
|
@@ -110,13 +111,13 @@ function Sidebar() {
|
|
|
110
111
|
enableComplementaryArea('core/edit-widgets', WIDGET_AREAS_IDENTIFIER);
|
|
111
112
|
}
|
|
112
113
|
}, [hasSelectedNonAreaBlock, enableComplementaryArea]);
|
|
113
|
-
return (0,
|
|
114
|
+
return (0, _react.createElement)(_interface.ComplementaryArea, {
|
|
114
115
|
className: "edit-widgets-sidebar",
|
|
115
|
-
header: (0,
|
|
116
|
+
header: (0, _react.createElement)("ul", null, (0, _react.createElement)("li", null, (0, _react.createElement)(ComplementaryAreaTab, {
|
|
116
117
|
identifier: WIDGET_AREAS_IDENTIFIER,
|
|
117
118
|
label: selectedWidgetAreaBlock ? selectedWidgetAreaBlock.attributes.name : (0, _i18n.__)('Widget Areas'),
|
|
118
119
|
isActive: currentArea === WIDGET_AREAS_IDENTIFIER
|
|
119
|
-
})), (0,
|
|
120
|
+
})), (0, _react.createElement)("li", null, (0, _react.createElement)(ComplementaryAreaTab, {
|
|
120
121
|
identifier: BLOCK_INSPECTOR_IDENTIFIER,
|
|
121
122
|
label: (0, _i18n.__)('Block'),
|
|
122
123
|
isActive: currentArea === BLOCK_INSPECTOR_IDENTIFIER
|
|
@@ -129,12 +130,12 @@ function Sidebar() {
|
|
|
129
130
|
identifier: currentArea,
|
|
130
131
|
icon: (0, _i18n.isRTL)() ? _icons.drawerLeft : _icons.drawerRight,
|
|
131
132
|
isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT
|
|
132
|
-
}, currentArea === WIDGET_AREAS_IDENTIFIER && (0,
|
|
133
|
+
}, currentArea === WIDGET_AREAS_IDENTIFIER && (0, _react.createElement)(_widgetAreas.default, {
|
|
133
134
|
selectedWidgetAreaId: selectedWidgetAreaBlock?.attributes.id
|
|
134
|
-
}), currentArea === BLOCK_INSPECTOR_IDENTIFIER && (hasSelectedNonAreaBlock ? (0,
|
|
135
|
+
}), currentArea === BLOCK_INSPECTOR_IDENTIFIER && (hasSelectedNonAreaBlock ? (0, _react.createElement)(_blockEditor.BlockInspector, null) :
|
|
135
136
|
// Pretend that Widget Areas are part of the UI by not
|
|
136
137
|
// showing the Block Inspector when one is selected.
|
|
137
|
-
(0,
|
|
138
|
+
(0, _react.createElement)("span", {
|
|
138
139
|
className: "block-editor-block-inspector__no-blocks"
|
|
139
140
|
}, (0, _i18n.__)('No block selected.'))));
|
|
140
141
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_classnames","_interopRequireDefault","_i18n","_interface","_blockEditor","_icons","_components","_data","_widgetAreas","_store","SIDEBAR_ACTIVE_BY_DEFAULT","Platform","select","web","native","BLOCK_INSPECTOR_IDENTIFIER","WIDGET_AREAS_IDENTIFIER","ComplementaryAreaTab","identifier","label","isActive","enableComplementaryArea","useDispatch","interfaceStore","createElement","Button","onClick","editWidgetsStore","name","className","classnames","sprintf","__","Sidebar","currentArea","hasSelectedNonAreaBlock","isGeneralSidebarOpen","selectedWidgetAreaBlock","useSelect","getSelectedBlock","getBlock","getBlockParentsByBlockName","blockEditorStore","getActiveComplementaryArea","selectedBlock","activeArea","currentSelection","widgetAreaBlock","clientId","useEffect","ComplementaryArea","header","attributes","headerClassName","title","closeLabel","scope","icon","isRTL","drawerLeft","drawerRight","isActiveByDefault","default","selectedWidgetAreaId","id","BlockInspector"],"sources":["@wordpress/edit-widgets/src/components/sidebar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, Platform } from '@wordpress/element';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\n\nconst BLOCK_INSPECTOR_IDENTIFIER = 'edit-widgets/block-inspector';\n\n// Widget areas were one called block areas, so use 'edit-widgets/block-areas'\n// for backwards compatibility.\nconst WIDGET_AREAS_IDENTIFIER = 'edit-widgets/block-areas';\n\n/**\n * Internal dependencies\n */\nimport WidgetAreas from './widget-areas';\nimport { store as editWidgetsStore } from '../../store';\n\nfunction ComplementaryAreaTab( { identifier, label, isActive } ) {\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\treturn (\n\t\t<Button\n\t\t\tonClick={ () =>\n\t\t\t\tenableComplementaryArea( editWidgetsStore.name, identifier )\n\t\t\t}\n\t\t\tclassName={ classnames( 'edit-widgets-sidebar__panel-tab', {\n\t\t\t\t'is-active': isActive,\n\t\t\t} ) }\n\t\t\taria-label={\n\t\t\t\tisActive\n\t\t\t\t\t? // translators: %s: sidebar label e.g: \"Widget Areas\".\n\t\t\t\t\t sprintf( __( '%s (selected)' ), label )\n\t\t\t\t\t: label\n\t\t\t}\n\t\t\tdata-label={ label }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n\nexport default function Sidebar() {\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst {\n\t\tcurrentArea,\n\t\thasSelectedNonAreaBlock,\n\t\tisGeneralSidebarOpen,\n\t\tselectedWidgetAreaBlock,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSelectedBlock, getBlock, getBlockParentsByBlockName } =\n\t\t\tselect( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\n\t\tconst selectedBlock = getSelectedBlock();\n\n\t\tconst activeArea = getActiveComplementaryArea( editWidgetsStore.name );\n\n\t\tlet currentSelection = activeArea;\n\t\tif ( ! currentSelection ) {\n\t\t\tif ( selectedBlock ) {\n\t\t\t\tcurrentSelection = BLOCK_INSPECTOR_IDENTIFIER;\n\t\t\t} else {\n\t\t\t\tcurrentSelection = WIDGET_AREAS_IDENTIFIER;\n\t\t\t}\n\t\t}\n\n\t\tlet widgetAreaBlock;\n\t\tif ( selectedBlock ) {\n\t\t\tif ( selectedBlock.name === 'core/widget-area' ) {\n\t\t\t\twidgetAreaBlock = selectedBlock;\n\t\t\t} else {\n\t\t\t\twidgetAreaBlock = getBlock(\n\t\t\t\t\tgetBlockParentsByBlockName(\n\t\t\t\t\t\tselectedBlock.clientId,\n\t\t\t\t\t\t'core/widget-area'\n\t\t\t\t\t)[ 0 ]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tcurrentArea: currentSelection,\n\t\t\thasSelectedNonAreaBlock: !! (\n\t\t\t\tselectedBlock && selectedBlock.name !== 'core/widget-area'\n\t\t\t),\n\t\t\tisGeneralSidebarOpen: !! activeArea,\n\t\t\tselectedWidgetAreaBlock: widgetAreaBlock,\n\t\t};\n\t}, [] );\n\n\t// currentArea, and isGeneralSidebarOpen are intentionally left out from the dependencies,\n\t// because we want to run the effect when a block is selected/unselected and not when the sidebar state changes.\n\tuseEffect( () => {\n\t\tif (\n\t\t\thasSelectedNonAreaBlock &&\n\t\t\tcurrentArea === WIDGET_AREAS_IDENTIFIER &&\n\t\t\tisGeneralSidebarOpen\n\t\t) {\n\t\t\tenableComplementaryArea(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\tBLOCK_INSPECTOR_IDENTIFIER\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\t! hasSelectedNonAreaBlock &&\n\t\t\tcurrentArea === BLOCK_INSPECTOR_IDENTIFIER &&\n\t\t\tisGeneralSidebarOpen\n\t\t) {\n\t\t\tenableComplementaryArea(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\tWIDGET_AREAS_IDENTIFIER\n\t\t\t);\n\t\t}\n\t}, [ hasSelectedNonAreaBlock, enableComplementaryArea ] );\n\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tclassName=\"edit-widgets-sidebar\"\n\t\t\theader={\n\t\t\t\t<ul>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<ComplementaryAreaTab\n\t\t\t\t\t\t\tidentifier={ WIDGET_AREAS_IDENTIFIER }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tselectedWidgetAreaBlock\n\t\t\t\t\t\t\t\t\t? selectedWidgetAreaBlock.attributes.name\n\t\t\t\t\t\t\t\t\t: __( 'Widget Areas' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisActive={ currentArea === WIDGET_AREAS_IDENTIFIER }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<ComplementaryAreaTab\n\t\t\t\t\t\t\tidentifier={ BLOCK_INSPECTOR_IDENTIFIER }\n\t\t\t\t\t\t\tlabel={ __( 'Block' ) }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\tcurrentArea === BLOCK_INSPECTOR_IDENTIFIER\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t}\n\t\t\theaderClassName=\"edit-widgets-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\tscope=\"core/edit-widgets\"\n\t\t\tidentifier={ currentArea }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t{ currentArea === WIDGET_AREAS_IDENTIFIER && (\n\t\t\t\t<WidgetAreas\n\t\t\t\t\tselectedWidgetAreaId={\n\t\t\t\t\t\tselectedWidgetAreaBlock?.attributes.id\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ currentArea === BLOCK_INSPECTOR_IDENTIFIER &&\n\t\t\t\t( hasSelectedNonAreaBlock ? (\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t) : (\n\t\t\t\t\t// Pretend that Widget Areas are part of the UI by not\n\t\t\t\t\t// showing the Block Inspector when one is selected.\n\t\t\t\t\t<span className=\"block-editor-block-inspector__no-blocks\">\n\t\t\t\t\t\t{ __( 'No block selected.' ) }\n\t\t\t\t\t</span>\n\t\t\t\t) ) }\n\t\t</ComplementaryArea>\n\t);\n}\n"],"mappings":";;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AALA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAMA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAI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AAKnB,0BAA0B,KACzCoB,uBAAuB,GACxB,IAAArC,QAAA,CAAA0B,aAAA,EAACpB,YAAA,CAAA6D,cAAc,MAAE,CAAC;EAElB;EACA;EACA,IAAAnE,QAAA,CAAA0B,aAAA;IAAMK,SAAS,EAAC;EAAyC,GACtD,IAAAG,QAAE,EAAE,oBAAqB,CACtB,CACN,CACgB,CAAC;AAEtB"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_i18n","_interface","_blockEditor","_icons","_components","_data","_widgetAreas","_store","SIDEBAR_ACTIVE_BY_DEFAULT","Platform","select","web","native","BLOCK_INSPECTOR_IDENTIFIER","WIDGET_AREAS_IDENTIFIER","ComplementaryAreaTab","identifier","label","isActive","enableComplementaryArea","useDispatch","interfaceStore","_react","createElement","Button","onClick","editWidgetsStore","name","className","classnames","sprintf","__","Sidebar","currentArea","hasSelectedNonAreaBlock","isGeneralSidebarOpen","selectedWidgetAreaBlock","useSelect","getSelectedBlock","getBlock","getBlockParentsByBlockName","blockEditorStore","getActiveComplementaryArea","selectedBlock","activeArea","currentSelection","widgetAreaBlock","clientId","useEffect","ComplementaryArea","header","attributes","headerClassName","title","closeLabel","scope","icon","isRTL","drawerLeft","drawerRight","isActiveByDefault","default","selectedWidgetAreaId","id","BlockInspector"],"sources":["@wordpress/edit-widgets/src/components/sidebar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, Platform } from '@wordpress/element';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\n\nconst BLOCK_INSPECTOR_IDENTIFIER = 'edit-widgets/block-inspector';\n\n// Widget areas were one called block areas, so use 'edit-widgets/block-areas'\n// for backwards compatibility.\nconst WIDGET_AREAS_IDENTIFIER = 'edit-widgets/block-areas';\n\n/**\n * Internal dependencies\n */\nimport WidgetAreas from './widget-areas';\nimport { store as editWidgetsStore } from '../../store';\n\nfunction ComplementaryAreaTab( { identifier, label, isActive } ) {\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\treturn (\n\t\t<Button\n\t\t\tonClick={ () =>\n\t\t\t\tenableComplementaryArea( editWidgetsStore.name, identifier )\n\t\t\t}\n\t\t\tclassName={ classnames( 'edit-widgets-sidebar__panel-tab', {\n\t\t\t\t'is-active': isActive,\n\t\t\t} ) }\n\t\t\taria-label={\n\t\t\t\tisActive\n\t\t\t\t\t? // translators: %s: sidebar label e.g: \"Widget Areas\".\n\t\t\t\t\t sprintf( __( '%s (selected)' ), label )\n\t\t\t\t\t: label\n\t\t\t}\n\t\t\tdata-label={ label }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n\nexport default function Sidebar() {\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst {\n\t\tcurrentArea,\n\t\thasSelectedNonAreaBlock,\n\t\tisGeneralSidebarOpen,\n\t\tselectedWidgetAreaBlock,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSelectedBlock, getBlock, getBlockParentsByBlockName } =\n\t\t\tselect( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\n\t\tconst selectedBlock = getSelectedBlock();\n\n\t\tconst activeArea = getActiveComplementaryArea( editWidgetsStore.name );\n\n\t\tlet currentSelection = activeArea;\n\t\tif ( ! currentSelection ) {\n\t\t\tif ( selectedBlock ) {\n\t\t\t\tcurrentSelection = BLOCK_INSPECTOR_IDENTIFIER;\n\t\t\t} else {\n\t\t\t\tcurrentSelection = WIDGET_AREAS_IDENTIFIER;\n\t\t\t}\n\t\t}\n\n\t\tlet widgetAreaBlock;\n\t\tif ( selectedBlock ) {\n\t\t\tif ( selectedBlock.name === 'core/widget-area' ) {\n\t\t\t\twidgetAreaBlock = selectedBlock;\n\t\t\t} else {\n\t\t\t\twidgetAreaBlock = getBlock(\n\t\t\t\t\tgetBlockParentsByBlockName(\n\t\t\t\t\t\tselectedBlock.clientId,\n\t\t\t\t\t\t'core/widget-area'\n\t\t\t\t\t)[ 0 ]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tcurrentArea: currentSelection,\n\t\t\thasSelectedNonAreaBlock: !! (\n\t\t\t\tselectedBlock && selectedBlock.name !== 'core/widget-area'\n\t\t\t),\n\t\t\tisGeneralSidebarOpen: !! activeArea,\n\t\t\tselectedWidgetAreaBlock: widgetAreaBlock,\n\t\t};\n\t}, [] );\n\n\t// currentArea, and isGeneralSidebarOpen are intentionally left out from the dependencies,\n\t// because we want to run the effect when a block is selected/unselected and not when the sidebar state changes.\n\tuseEffect( () => {\n\t\tif (\n\t\t\thasSelectedNonAreaBlock &&\n\t\t\tcurrentArea === WIDGET_AREAS_IDENTIFIER &&\n\t\t\tisGeneralSidebarOpen\n\t\t) {\n\t\t\tenableComplementaryArea(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\tBLOCK_INSPECTOR_IDENTIFIER\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\t! hasSelectedNonAreaBlock &&\n\t\t\tcurrentArea === BLOCK_INSPECTOR_IDENTIFIER &&\n\t\t\tisGeneralSidebarOpen\n\t\t) {\n\t\t\tenableComplementaryArea(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\tWIDGET_AREAS_IDENTIFIER\n\t\t\t);\n\t\t}\n\t}, [ hasSelectedNonAreaBlock, enableComplementaryArea ] );\n\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tclassName=\"edit-widgets-sidebar\"\n\t\t\theader={\n\t\t\t\t<ul>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<ComplementaryAreaTab\n\t\t\t\t\t\t\tidentifier={ WIDGET_AREAS_IDENTIFIER }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tselectedWidgetAreaBlock\n\t\t\t\t\t\t\t\t\t? selectedWidgetAreaBlock.attributes.name\n\t\t\t\t\t\t\t\t\t: __( 'Widget Areas' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisActive={ currentArea === WIDGET_AREAS_IDENTIFIER }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<ComplementaryAreaTab\n\t\t\t\t\t\t\tidentifier={ BLOCK_INSPECTOR_IDENTIFIER }\n\t\t\t\t\t\t\tlabel={ __( 'Block' ) }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\tcurrentArea === BLOCK_INSPECTOR_IDENTIFIER\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t}\n\t\t\theaderClassName=\"edit-widgets-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\tscope=\"core/edit-widgets\"\n\t\t\tidentifier={ currentArea }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t{ currentArea === WIDGET_AREAS_IDENTIFIER && (\n\t\t\t\t<WidgetAreas\n\t\t\t\t\tselectedWidgetAreaId={\n\t\t\t\t\t\tselectedWidgetAreaBlock?.attributes.id\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ currentArea === BLOCK_INSPECTOR_IDENTIFIER &&\n\t\t\t\t( hasSelectedNonAreaBlock ? (\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t) : (\n\t\t\t\t\t// Pretend that Widget Areas are part of the UI by not\n\t\t\t\t\t// showing the Block Inspector when one is selected.\n\t\t\t\t\t<span className=\"block-editor-block-inspector__no-blocks\">\n\t\t\t\t\t\t{ __( 'No block selected.' ) }\n\t\t\t\t\t</span>\n\t\t\t\t) ) }\n\t\t</ComplementaryArea>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAIA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AAgBA,IAAAQ,YAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AAtCA;AACA;AACA;;AAGA;AACA;AACA;;AAgBA,MAAMU,yBAAyB,GAAGC,iBAAQ,CAACC,MAAM,CAAE;EAClDC,GAAG,EAAE,IAAI;EACTC,MAAM,EAAE;AACT,CAAE,CAAC;AAEH,MAAMC,0BAA0B,GAAG,8BAA8B;;AAEjE;AACA;AACA,MAAMC,uBAAuB,GAAG,0BAA0B;;AAE1D;AACA;AACA;;AAIA,SAASC,oBAAoBA,CAAE;EAAEC,UAAU;EAAEC,KAAK;EAAEC;AAAS,CAAC,EAAG;EAChE,MAAM;IAAEC;EAAwB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,gBAAe,CAAC;EACjE,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACnB,WAAA,CAAAoB,MAAM;IACNC,OAAO,EAAGA,CAAA,KACTN,uBAAuB,CAAEO,YAAgB,CAACC,IAAI,EAAEX,UAAW,CAC3D;IACDY,SAAS,EAAG,IAAAC,mBAAU,EAAE,iCAAiC,EAAE;MAC1D,WAAW,EAAEX;IACd,C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AAvB,QAAE,EAAE,gBAAiB,CAAG;IACrCwB,KAAK,EAAC,mBAAmB;IACzBvC,UAAU,EAAGiB,WAAa;IAC1BuB,IAAI,EAAG,IAAAC,WAAK,EAAC,CAAC,GAAGC,iBAAU,GAAGC,kBAAa;IAC3CC,iBAAiB,EAAGpD;EAA2B,GAE7CyB,WAAW,KAAKnB,uBAAuB,IACxC,IAAAQ,MAAA,CAAAC,aAAA,EAACjB,YAAA,CAAAuD,OAAW;IACXC,oBAAoB,EACnB1B,uBAAuB,EAAEe,UAAU,CAACY;EACpC,CACD,CACD,EACC9B,WAAW,KAAKpB,0BAA0B,KACzCqB,uBAAuB,GACxB,IAAAZ,MAAA,CAAAC,aAAA,EAACrB,YAAA,CAAA8D,cAAc,MAAE,CAAC;EAElB;EACA;EACA,IAAA1C,MAAA,CAAAC,aAAA;IAAMK,SAAS,EAAC;EAAyC,GACtD,IAAAG,QAAE,EAAE,oBAAqB,CACtB,CACN,CACgB,CAAC;AAEtB"}
|
|
@@ -4,8 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = WidgetAreas;
|
|
7
|
-
var
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _data = require("@wordpress/data");
|
|
9
|
+
var _element = require("@wordpress/element");
|
|
9
10
|
var _icons = require("@wordpress/icons");
|
|
10
11
|
var _blockEditor = require("@wordpress/block-editor");
|
|
11
12
|
var _components = require("@wordpress/components");
|
|
@@ -34,13 +35,13 @@ function WidgetAreas({
|
|
|
34
35
|
} else {
|
|
35
36
|
description = selectedWidgetArea.description;
|
|
36
37
|
}
|
|
37
|
-
return (0,
|
|
38
|
+
return (0, _react.createElement)("div", {
|
|
38
39
|
className: "edit-widgets-widget-areas"
|
|
39
|
-
}, (0,
|
|
40
|
+
}, (0, _react.createElement)("div", {
|
|
40
41
|
className: "edit-widgets-widget-areas__top-container"
|
|
41
|
-
}, (0,
|
|
42
|
+
}, (0, _react.createElement)(_blockEditor.BlockIcon, {
|
|
42
43
|
icon: _icons.blockDefault
|
|
43
|
-
}), (0,
|
|
44
|
+
}), (0, _react.createElement)("div", null, (0, _react.createElement)("p", {
|
|
44
45
|
// Use `dangerouslySetInnerHTML` to keep backwards
|
|
45
46
|
// compatibility. Basic markup in the description is an
|
|
46
47
|
// established feature of WordPress.
|
|
@@ -48,7 +49,7 @@ function WidgetAreas({
|
|
|
48
49
|
dangerouslySetInnerHTML: {
|
|
49
50
|
__html: (0, _dom.safeHTML)(description)
|
|
50
51
|
}
|
|
51
|
-
}), widgetAreas?.length === 0 && (0,
|
|
52
|
+
}), widgetAreas?.length === 0 && (0, _react.createElement)("p", null, (0, _i18n.__)('Your theme does not contain any Widget Areas.')), !selectedWidgetArea && (0, _react.createElement)(_components.Button, {
|
|
52
53
|
href: (0, _url.addQueryArgs)('customize.php', {
|
|
53
54
|
'autofocus[panel]': 'widgets',
|
|
54
55
|
return: window.location.pathname
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_data","require","_element","_icons","_blockEditor","_components","_i18n","_url","_dom","_store","WidgetAreas","selectedWidgetAreaId","widgetAreas","useSelect","select","editWidgetsStore","getWidgetAreas","selectedWidgetArea","useMemo","find","widgetArea","id","description","__","_react","createElement","className","BlockIcon","icon","blockDefault","dangerouslySetInnerHTML","__html","safeHTML","length","Button","href","addQueryArgs","return","window","location","pathname","variant"],"sources":["@wordpress/edit-widgets/src/components/sidebar/widget-areas.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { blockDefault } from '@wordpress/icons';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { safeHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function WidgetAreas( { selectedWidgetAreaId } ) {\n\tconst widgetAreas = useSelect(\n\t\t( select ) => select( editWidgetsStore ).getWidgetAreas(),\n\t\t[]\n\t);\n\n\tconst selectedWidgetArea = useMemo(\n\t\t() =>\n\t\t\tselectedWidgetAreaId &&\n\t\t\twidgetAreas?.find(\n\t\t\t\t( widgetArea ) => widgetArea.id === selectedWidgetAreaId\n\t\t\t),\n\t\t[ selectedWidgetAreaId, widgetAreas ]\n\t);\n\n\tlet description;\n\tif ( ! selectedWidgetArea ) {\n\t\tdescription = __(\n\t\t\t'Widget Areas are global parts in your site’s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer.'\n\t\t);\n\t} else if ( selectedWidgetAreaId === 'wp_inactive_widgets' ) {\n\t\tdescription = __(\n\t\t\t'Blocks in this Widget Area will not be displayed in your site.'\n\t\t);\n\t} else {\n\t\tdescription = selectedWidgetArea.description;\n\t}\n\n\treturn (\n\t\t<div className=\"edit-widgets-widget-areas\">\n\t\t\t<div className=\"edit-widgets-widget-areas__top-container\">\n\t\t\t\t<BlockIcon icon={ blockDefault } />\n\t\t\t\t<div>\n\t\t\t\t\t<p\n\t\t\t\t\t\t// Use `dangerouslySetInnerHTML` to keep backwards\n\t\t\t\t\t\t// compatibility. Basic markup in the description is an\n\t\t\t\t\t\t// established feature of WordPress.\n\t\t\t\t\t\t// @see https://github.com/WordPress/gutenberg/issues/33106\n\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t__html: safeHTML( description ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ widgetAreas?.length === 0 && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Your theme does not contain any Widget Areas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! selectedWidgetArea && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\thref={ addQueryArgs( 'customize.php', {\n\t\t\t\t\t\t\t\t'autofocus[panel]': 'widgets',\n\t\t\t\t\t\t\t\treturn: window.location.pathname,\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Manage with live preview' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AAfA;AACA;AACA;;AAUA;AACA;AACA;;AAGe,SAASS,WAAWA,CAAE;EAAEC;AAAqB,CAAC,EAAG;EAC/D,MAAMC,WAAW,GAAG,IAAAC,eAAS,EAC1BC,MAAM,IAAMA,MAAM,CAAEC,YAAiB,CAAC,CAACC,cAAc,CAAC,CAAC,EACzD,EACD,CAAC;EAED,MAAMC,kBAAkB,GAAG,IAAAC,gBAAO,EACjC,MACCP,oBAAoB,IACpBC,WAAW,EAAEO,IAAI,CACdC,UAAU,IAAMA,UAAU,CAACC,EAAE,KAAKV,oBACrC,CAAC,EACF,CAAEA,oBAAoB,EAAEC,WAAW,CACpC,CAAC;EAED,IAAIU,WAAW;EACf,IAAK,CAAEL,kBAAkB,EAAG;IAC3BK,WAAW,GAAG,IAAAC,QAAE,EACf,uJACD,CAAC;EACF,CAAC,MAAM,IAAKZ,oBAAoB,KAAK,qBAAqB,EAAG;IAC5DW,WAAW,GAAG,IAAAC,QAAE,EACf,gEACD,CAAC;EACF,CAAC,MAAM;IACND,WAAW,GAAGL,kBAAkB,CAACK,WAAW;EAC7C;EAEA,OACC,IAAAE,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAA2B,GACzC,IAAAF,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAA0C,GACxD,IAAAF,MAAA,CAAAC,aAAA,EAACrB,YAAA,CAAAuB,SAAS;IAACC,IAAI,EAAGC;EAAc,CAAE,CAAC,EACnC,IAAAL,MAAA,CAAAC,aAAA,eACC,IAAAD,MAAA,CAAAC,aAAA;IACC;IACA;IACA;IACA;IACAK,uBAAuB,EAAG;MACzBC,MAAM,EAAE,IAAAC,aAAQ,EAAEV,WAAY;IAC/B;EAAG,CACH,CAAC,EACAV,WAAW,EAAEqB,MAAM,KAAK,CAAC,IAC1B,IAAAT,MAAA,CAAAC,aAAA,aACG,IAAAF,QAAE,EACH,+CACD,CACE,CACH,EACC,CAAEN,kBAAkB,IACrB,IAAAO,MAAA,CAAAC,aAAA,EAACpB,WAAA,CAAA6B,MAAM;IACNC,IAAI,EAAG,IAAAC,iBAAY,EAAE,eAAe,EAAE;MACrC,kBAAkB,EAAE,SAAS;MAC7BC,MAAM,EAAEC,MAAM,CAACC,QAAQ,CAACC;IACzB,CAAE,CAAG;IACLC,OAAO,EAAC;EAAU,GAEhB,IAAAlB,QAAE,EAAE,0BAA2B,CAC1B,CAEL,CACD,CACD,CAAC;AAER"}
|
|
@@ -4,10 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = WelcomeGuide;
|
|
7
|
-
var
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _data = require("@wordpress/data");
|
|
9
9
|
var _components = require("@wordpress/components");
|
|
10
10
|
var _i18n = require("@wordpress/i18n");
|
|
11
|
+
var _element = require("@wordpress/element");
|
|
11
12
|
var _preferences = require("@wordpress/preferences");
|
|
12
13
|
var _store = require("../../store");
|
|
13
14
|
/**
|
|
@@ -32,65 +33,65 @@ function WelcomeGuide() {
|
|
|
32
33
|
}
|
|
33
34
|
const isEntirelyBlockWidgets = widgetAreas?.every(widgetArea => widgetArea.id === 'wp_inactive_widgets' || widgetArea.widgets.every(widgetId => widgetId.startsWith('block-')));
|
|
34
35
|
const numWidgetAreas = (_widgetAreas$filter$l = widgetAreas?.filter(widgetArea => widgetArea.id !== 'wp_inactive_widgets').length) !== null && _widgetAreas$filter$l !== void 0 ? _widgetAreas$filter$l : 0;
|
|
35
|
-
return (0,
|
|
36
|
+
return (0, _react.createElement)(_components.Guide, {
|
|
36
37
|
className: "edit-widgets-welcome-guide",
|
|
37
38
|
contentLabel: (0, _i18n.__)('Welcome to block Widgets'),
|
|
38
39
|
finishButtonText: (0, _i18n.__)('Get started'),
|
|
39
40
|
onFinish: () => toggle('core/edit-widgets', 'welcomeGuide'),
|
|
40
41
|
pages: [{
|
|
41
|
-
image: (0,
|
|
42
|
+
image: (0, _react.createElement)(WelcomeGuideImage, {
|
|
42
43
|
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg",
|
|
43
44
|
animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif"
|
|
44
45
|
}),
|
|
45
|
-
content: (0,
|
|
46
|
+
content: (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)("h1", {
|
|
46
47
|
className: "edit-widgets-welcome-guide__heading"
|
|
47
|
-
}, (0, _i18n.__)('Welcome to block Widgets')), isEntirelyBlockWidgets ? (0,
|
|
48
|
+
}, (0, _i18n.__)('Welcome to block Widgets')), isEntirelyBlockWidgets ? (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)("p", {
|
|
48
49
|
className: "edit-widgets-welcome-guide__text"
|
|
49
50
|
}, (0, _i18n.sprintf)(
|
|
50
51
|
// Translators: %s: Number of block areas in the current theme.
|
|
51
|
-
(0, _i18n._n)('Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.', 'Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.', numWidgetAreas), numWidgetAreas))) : (0,
|
|
52
|
+
(0, _i18n._n)('Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.', 'Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.', numWidgetAreas), numWidgetAreas))) : (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)("p", {
|
|
52
53
|
className: "edit-widgets-welcome-guide__text"
|
|
53
|
-
}, (0, _i18n.__)('You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.')), (0,
|
|
54
|
+
}, (0, _i18n.__)('You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.')), (0, _react.createElement)("p", {
|
|
54
55
|
className: "edit-widgets-welcome-guide__text"
|
|
55
|
-
}, (0,
|
|
56
|
+
}, (0, _react.createElement)("strong", null, (0, _i18n.__)('Want to stick with the old widgets?')), ' ', (0, _react.createElement)(_components.ExternalLink, {
|
|
56
57
|
href: (0, _i18n.__)('https://wordpress.org/plugins/classic-widgets/')
|
|
57
58
|
}, (0, _i18n.__)('Get the Classic Widgets plugin.')))))
|
|
58
59
|
}, {
|
|
59
|
-
image: (0,
|
|
60
|
+
image: (0, _react.createElement)(WelcomeGuideImage, {
|
|
60
61
|
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg",
|
|
61
62
|
animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif"
|
|
62
63
|
}),
|
|
63
|
-
content: (0,
|
|
64
|
+
content: (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)("h1", {
|
|
64
65
|
className: "edit-widgets-welcome-guide__heading"
|
|
65
|
-
}, (0, _i18n.__)('Make each block your own')), (0,
|
|
66
|
+
}, (0, _i18n.__)('Make each block your own')), (0, _react.createElement)("p", {
|
|
66
67
|
className: "edit-widgets-welcome-guide__text"
|
|
67
68
|
}, (0, _i18n.__)('Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.')))
|
|
68
69
|
}, {
|
|
69
|
-
image: (0,
|
|
70
|
+
image: (0, _react.createElement)(WelcomeGuideImage, {
|
|
70
71
|
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg",
|
|
71
72
|
animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif"
|
|
72
73
|
}),
|
|
73
|
-
content: (0,
|
|
74
|
+
content: (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)("h1", {
|
|
74
75
|
className: "edit-widgets-welcome-guide__heading"
|
|
75
|
-
}, (0, _i18n.__)('Get to know the block library')), (0,
|
|
76
|
+
}, (0, _i18n.__)('Get to know the block library')), (0, _react.createElement)("p", {
|
|
76
77
|
className: "edit-widgets-welcome-guide__text"
|
|
77
78
|
}, (0, _element.createInterpolateElement)((0, _i18n.__)('All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'), {
|
|
78
|
-
InserterIconImage: (0,
|
|
79
|
+
InserterIconImage: (0, _react.createElement)("img", {
|
|
79
80
|
className: "edit-widgets-welcome-guide__inserter-icon",
|
|
80
81
|
alt: (0, _i18n.__)('inserter'),
|
|
81
82
|
src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"
|
|
82
83
|
})
|
|
83
84
|
})))
|
|
84
85
|
}, {
|
|
85
|
-
image: (0,
|
|
86
|
+
image: (0, _react.createElement)(WelcomeGuideImage, {
|
|
86
87
|
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg",
|
|
87
88
|
animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif"
|
|
88
89
|
}),
|
|
89
|
-
content: (0,
|
|
90
|
+
content: (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)("h1", {
|
|
90
91
|
className: "edit-widgets-welcome-guide__heading"
|
|
91
|
-
}, (0, _i18n.__)('Learn how to use the block editor')), (0,
|
|
92
|
+
}, (0, _i18n.__)('Learn how to use the block editor')), (0, _react.createElement)("p", {
|
|
92
93
|
className: "edit-widgets-welcome-guide__text"
|
|
93
|
-
}, (0, _i18n.__)('New to the block editor? Want to learn more about using it? '), (0,
|
|
94
|
+
}, (0, _i18n.__)('New to the block editor? Want to learn more about using it? '), (0, _react.createElement)(_components.ExternalLink, {
|
|
94
95
|
href: (0, _i18n.__)('https://wordpress.org/documentation/article/wordpress-block-editor/')
|
|
95
96
|
}, (0, _i18n.__)("Here's a detailed guide."))))
|
|
96
97
|
}]
|
|
@@ -100,12 +101,12 @@ function WelcomeGuideImage({
|
|
|
100
101
|
nonAnimatedSrc,
|
|
101
102
|
animatedSrc
|
|
102
103
|
}) {
|
|
103
|
-
return (0,
|
|
104
|
+
return (0, _react.createElement)("picture", {
|
|
104
105
|
className: "edit-widgets-welcome-guide__image"
|
|
105
|
-
}, (0,
|
|
106
|
+
}, (0, _react.createElement)("source", {
|
|
106
107
|
srcSet: nonAnimatedSrc,
|
|
107
108
|
media: "(prefers-reduced-motion: reduce)"
|
|
108
|
-
}), (0,
|
|
109
|
+
}), (0, _react.createElement)("img", {
|
|
109
110
|
src: animatedSrc,
|
|
110
111
|
width: "312",
|
|
111
112
|
height: "240",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_components","_i18n","_preferences","_store","WelcomeGuide","_widgetAreas$filter$l","isActive","useSelect","select","preferencesStore","get","toggle","useDispatch","widgetAreas","editWidgetsStore","getWidgetAreas","per_page","isEntirelyBlockWidgets","every","widgetArea","id","widgets","widgetId","startsWith","numWidgetAreas","filter","length","createElement","Guide","className","contentLabel","__","finishButtonText","onFinish","pages","image","WelcomeGuideImage","nonAnimatedSrc","animatedSrc","content","Fragment","sprintf","_n","ExternalLink","href","createInterpolateElement","InserterIconImage","alt","src","srcSet","media","width","height"],"sources":["@wordpress/edit-widgets/src/components/welcome-guide/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { ExternalLink, Guide } from '@wordpress/components';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function WelcomeGuide() {\n\tconst isActive = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'welcomeGuide'\n\t\t\t),\n\t\t[]\n\t);\n\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst widgetAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editWidgetsStore ).getWidgetAreas( { per_page: -1 } ),\n\t\t[]\n\t);\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\tconst isEntirelyBlockWidgets = widgetAreas?.every(\n\t\t( widgetArea ) =>\n\t\t\twidgetArea.id === 'wp_inactive_widgets' ||\n\t\t\twidgetArea.widgets.every( ( widgetId ) =>\n\t\t\t\twidgetId.startsWith( 'block-' )\n\t\t\t)\n\t);\n\n\tconst numWidgetAreas =\n\t\twidgetAreas?.filter(\n\t\t\t( widgetArea ) => widgetArea.id !== 'wp_inactive_widgets'\n\t\t).length ?? 0;\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-widgets-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to block Widgets' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-widgets', 'welcomeGuide' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Welcome to block Widgets' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t{ isEntirelyBlockWidgets ? (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// Translators: %s: Number of block areas in the current theme.\n\t\t\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t\t\t'Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.',\n\t\t\t\t\t\t\t\t\t\t\t\t'Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.',\n\t\t\t\t\t\t\t\t\t\t\t\tnumWidgetAreas\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tnumWidgetAreas\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</p>\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\t<>\n\t\t\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Want to stick with the old widgets?'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</strong>{ ' ' }\n\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/plugins/classic-widgets/'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Get the Classic Widgets plugin.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</>\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\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Make each block your own' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Get to know the block library' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tInserterIconImage: (\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-widgets-welcome-guide__inserter-icon\"\n\t\t\t\t\t\t\t\t\t\t\t\talt={ __( 'inserter' ) }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\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</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Learn how to use the block editor' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'New to the block editor? Want to learn more about using it? '\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\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\t\t{ __( \"Here's a detailed guide.\" ) }\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t</p>\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/>\n\t);\n}\n\nfunction WelcomeGuideImage( { nonAnimatedSrc, animatedSrc } ) {\n\treturn (\n\t\t<picture className=\"edit-widgets-welcome-guide__image\">\n\t\t\t<source\n\t\t\t\tsrcSet={ nonAnimatedSrc }\n\t\t\t\tmedia=\"(prefers-reduced-motion: reduce)\"\n\t\t\t/>\n\t\t\t<img src={ animatedSrc } width=\"312\" height=\"240\" alt=\"\" />\n\t\t</picture>\n\t);\n}\n"],"mappings":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AAA,CAAA8B,aAAA,EAAA9B,QAAA,CAAA2C,QAAA,QACC,IAAA3C,QAAA,CAAA8B,aAAA;QAAIE,SAAS,EAAC;MAAqC,GAChD,IAAAE,QAAE,EAAE,mCAAoC,CACvC,CAAC,EACL,IAAAlC,QAAA,CAAA8B,aAAA;QAAGE,SAAS,EAAC;MAAkC,GAC5C,IAAAE,QAAE,EACH,8DACD,CAAC,EACD,IAAAlC,QAAA,CAAA8B,aAAA,EAAC3B,WAAA,CAAA2C,YAAY;QACZC,IAAI,EAAG,IAAAb,QAAE,EACR,qEACD;MAAG,GAED,IAAAA,QAAE,EAAE,0BAA2B,CACpB,CACZ,CACF;IAEJ,CAAC;EACC,CACH,CAAC;AAEJ;AAEA,SAASK,iBAAiBA,CAAE;EAAEC,cAAc;EAAEC;AAAY,CAAC,EAAG;EAC7D,OACC,IAAAzC,QAAA,CAAA8B,aAAA;IAASE,SAAS,EAAC;EAAmC,GACrD,IAAAhC,QAAA,CAAA8B,aAAA;IACCsB,MAAM,EAAGZ,cAAgB;IACzBa,KAAK,EAAC;EAAkC,CACxC,CAAC,EACF,IAAArD,QAAA,CAAA8B,aAAA;IAAKqB,GAAG,EAAGV,WAAa;IAACa,KAAK,EAAC,KAAK;IAACC,MAAM,EAAC,KAAK;IAACL,GAAG,EAAC;EAAE,CAAE,CAClD,CAAC;AAEZ"}
|
|
1
|
+
{"version":3,"names":["_data","require","_components","_i18n","_element","_preferences","_store","WelcomeGuide","_widgetAreas$filter$l","isActive","useSelect","select","preferencesStore","get","toggle","useDispatch","widgetAreas","editWidgetsStore","getWidgetAreas","per_page","isEntirelyBlockWidgets","every","widgetArea","id","widgets","widgetId","startsWith","numWidgetAreas","filter","length","_react","createElement","Guide","className","contentLabel","__","finishButtonText","onFinish","pages","image","WelcomeGuideImage","nonAnimatedSrc","animatedSrc","content","Fragment","sprintf","_n","ExternalLink","href","createInterpolateElement","InserterIconImage","alt","src","srcSet","media","width","height"],"sources":["@wordpress/edit-widgets/src/components/welcome-guide/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { ExternalLink, Guide } from '@wordpress/components';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function WelcomeGuide() {\n\tconst isActive = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'welcomeGuide'\n\t\t\t),\n\t\t[]\n\t);\n\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst widgetAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editWidgetsStore ).getWidgetAreas( { per_page: -1 } ),\n\t\t[]\n\t);\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\tconst isEntirelyBlockWidgets = widgetAreas?.every(\n\t\t( widgetArea ) =>\n\t\t\twidgetArea.id === 'wp_inactive_widgets' ||\n\t\t\twidgetArea.widgets.every( ( widgetId ) =>\n\t\t\t\twidgetId.startsWith( 'block-' )\n\t\t\t)\n\t);\n\n\tconst numWidgetAreas =\n\t\twidgetAreas?.filter(\n\t\t\t( widgetArea ) => widgetArea.id !== 'wp_inactive_widgets'\n\t\t).length ?? 0;\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-widgets-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to block Widgets' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-widgets', 'welcomeGuide' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Welcome to block Widgets' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t{ isEntirelyBlockWidgets ? (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// Translators: %s: Number of block areas in the current theme.\n\t\t\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t\t\t'Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.',\n\t\t\t\t\t\t\t\t\t\t\t\t'Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.',\n\t\t\t\t\t\t\t\t\t\t\t\tnumWidgetAreas\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tnumWidgetAreas\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</p>\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\t<>\n\t\t\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Want to stick with the old widgets?'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</strong>{ ' ' }\n\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/plugins/classic-widgets/'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Get the Classic Widgets plugin.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</>\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\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Make each block your own' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Get to know the block library' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tInserterIconImage: (\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-widgets-welcome-guide__inserter-icon\"\n\t\t\t\t\t\t\t\t\t\t\t\talt={ __( 'inserter' ) }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\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</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Learn how to use the block editor' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'New to the block editor? Want to learn more about using it? '\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\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\t\t{ __( \"Here's a detailed guide.\" ) }\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t</p>\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/>\n\t);\n}\n\nfunction WelcomeGuideImage( { nonAnimatedSrc, animatedSrc } ) {\n\treturn (\n\t\t<picture className=\"edit-widgets-welcome-guide__image\">\n\t\t\t<source\n\t\t\t\tsrcSet={ nonAnimatedSrc }\n\t\t\t\tmedia=\"(prefers-reduced-motion: reduce)\"\n\t\t\t/>\n\t\t\t<img src={ animatedSrc } width=\"312\" height=\"240\" alt=\"\" />\n\t\t</picture>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,O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,EAAC;MAAkC,GAC5C,IAAAE,QAAE,EACH,8DACD,CAAC,EACD,IAAAL,MAAA,CAAAC,aAAA,EAAC7B,WAAA,CAAA6C,YAAY;QACZC,IAAI,EAAG,IAAAb,QAAE,EACR,qEACD;MAAG,GAED,IAAAA,QAAE,EAAE,0BAA2B,CACpB,CACZ,CACF;IAEJ,CAAC;EACC,CACH,CAAC;AAEJ;AAEA,SAASK,iBAAiBA,CAAE;EAAEC,cAAc;EAAEC;AAAY,CAAC,EAAG;EAC7D,OACC,IAAAZ,MAAA,CAAAC,aAAA;IAASE,SAAS,EAAC;EAAmC,GACrD,IAAAH,MAAA,CAAAC,aAAA;IACCsB,MAAM,EAAGZ,cAAgB;IACzBa,KAAK,EAAC;EAAkC,CACxC,CAAC,EACF,IAAAxB,MAAA,CAAAC,aAAA;IAAKqB,GAAG,EAAGV,WAAa;IAACa,KAAK,EAAC,KAAK;IAACC,MAAM,EAAC,KAAK;IAACL,GAAG,EAAC;EAAE,CAAE,CAClD,CAAC;AAEZ"}
|
|
@@ -5,9 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = WidgetAreasBlockEditorContent;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _blockEditor = require("@wordpress/block-editor");
|
|
10
10
|
var _data = require("@wordpress/data");
|
|
11
|
+
var _element = require("@wordpress/element");
|
|
11
12
|
var _preferences = require("@wordpress/preferences");
|
|
12
13
|
var _notices = _interopRequireDefault(require("../notices"));
|
|
13
14
|
var _keyboardShortcuts = _interopRequireDefault(require("../keyboard-shortcuts"));
|
|
@@ -26,12 +27,12 @@ function WidgetAreasBlockEditorContent({
|
|
|
26
27
|
const styles = (0, _element.useMemo)(() => {
|
|
27
28
|
return hasThemeStyles ? blockEditorSettings.styles : [];
|
|
28
29
|
}, [blockEditorSettings, hasThemeStyles]);
|
|
29
|
-
return (0,
|
|
30
|
+
return (0, _react.createElement)("div", {
|
|
30
31
|
className: "edit-widgets-block-editor"
|
|
31
|
-
}, (0,
|
|
32
|
+
}, (0, _react.createElement)(_notices.default, null), (0, _react.createElement)(_blockEditor.BlockTools, null, (0, _react.createElement)(_keyboardShortcuts.default, null), (0, _react.createElement)(_blockEditor.__unstableEditorStyles, {
|
|
32
33
|
styles: styles,
|
|
33
34
|
scope: ".editor-styles-wrapper"
|
|
34
|
-
}), (0,
|
|
35
|
+
}), (0, _react.createElement)(_blockEditor.BlockSelectionClearer, null, (0, _react.createElement)(_blockEditor.WritingFlow, null, (0, _react.createElement)(_blockEditor.BlockList, {
|
|
35
36
|
className: "edit-widgets-main-block-list"
|
|
36
37
|
})))));
|
|
37
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_data","_element","_preferences","_notices","_interopRequireDefault","_keyboardShortcuts","WidgetAreasBlockEditorContent","blockEditorSettings","hasThemeStyles","useSelect","select","preferencesStore","get","styles","useMemo","_react","createElement","className","default","BlockTools","__unstableEditorStyles","scope","BlockSelectionClearer","WritingFlow","BlockList"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-content/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockList,\n\tBlockTools,\n\tBlockSelectionClearer,\n\tWritingFlow,\n\t__unstableEditorStyles as EditorStyles,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport Notices from '../notices';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\n\nexport default function WidgetAreasBlockEditorContent( {\n\tblockEditorSettings,\n} ) {\n\tconst hasThemeStyles = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'themeStyles'\n\t\t\t),\n\t\t[]\n\t);\n\n\tconst styles = useMemo( () => {\n\t\treturn hasThemeStyles ? blockEditorSettings.styles : [];\n\t}, [ blockEditorSettings, hasThemeStyles ] );\n\n\treturn (\n\t\t<div className=\"edit-widgets-block-editor\">\n\t\t\t<Notices />\n\t\t\t<BlockTools>\n\t\t\t\t<KeyboardShortcuts />\n\t\t\t\t<EditorStyles\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tscope=\".editor-styles-wrapper\"\n\t\t\t\t/>\n\t\t\t\t<BlockSelectionClearer>\n\t\t\t\t\t<WritingFlow>\n\t\t\t\t\t\t<BlockList className=\"edit-widgets-main-block-list\" />\n\t\t\t\t\t</WritingFlow>\n\t\t\t\t</BlockSelectionClearer>\n\t\t\t</BlockTools>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAD,sBAAA,CAAAL,OAAA;AAlBA;AACA;AACA;;AAYA;AACA;AACA;;AAIe,SAASO,6BAA6BA,CAAE;EACtDC;AACD,CAAC,EAAG;EACH,MAAMC,cAAc,GAAG,IAAAC,eAAS,EAC7BC,MAAM,IACP,CAAC,CAAEA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,GAAG,CAChC,mBAAmB,EACnB,aACD,CAAC,EACF,EACD,CAAC;EAED,MAAMC,MAAM,GAAG,IAAAC,gBAAO,EAAE,MAAM;IAC7B,OAAON,cAAc,GAAGD,mBAAmB,CAACM,MAAM,GAAG,EAAE;EACxD,CAAC,EAAE,CAAEN,mBAAmB,EAAEC,cAAc,CAAG,CAAC;EAE5C,OACC,IAAAO,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAA2B,GACzC,IAAAF,MAAA,CAAAC,aAAA,EAACb,QAAA,CAAAe,OAAO,MAAE,CAAC,EACX,IAAAH,MAAA,CAAAC,aAAA,EAAClB,YAAA,CAAAqB,UAAU,QACV,IAAAJ,MAAA,CAAAC,aAAA,EAACX,kBAAA,CAAAa,OAAiB,MAAE,CAAC,EACrB,IAAAH,MAAA,CAAAC,aAAA,EAAClB,YAAA,CAAAsB,sBAAY;IACZP,MAAM,EAAGA,MAAQ;IACjBQ,KAAK,EAAC;EAAwB,CAC9B,CAAC,EACF,IAAAN,MAAA,CAAAC,aAAA,EAAClB,YAAA,CAAAwB,qBAAqB,QACrB,IAAAP,MAAA,CAAAC,aAAA,EAAClB,YAAA,CAAAyB,WAAW,QACX,IAAAR,MAAA,CAAAC,aAAA,EAAClB,YAAA,CAAA0B,SAAS;IAACP,SAAS,EAAC;EAA8B,CAAE,CACzC,CACS,CACZ,CACR,CAAC;AAER"}
|
|
@@ -5,11 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = WidgetAreasBlockEditorProvider;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _components = require("@wordpress/components");
|
|
10
10
|
var _mediaUtils = require("@wordpress/media-utils");
|
|
11
11
|
var _data = require("@wordpress/data");
|
|
12
12
|
var _coreData = require("@wordpress/core-data");
|
|
13
|
+
var _element = require("@wordpress/element");
|
|
13
14
|
var _blockEditor = require("@wordpress/block-editor");
|
|
14
15
|
var _patterns = require("@wordpress/patterns");
|
|
15
16
|
var _preferences = require("@wordpress/preferences");
|
|
@@ -83,14 +84,14 @@ function WidgetAreasBlockEditorProvider({
|
|
|
83
84
|
const [blocks, onInput, onChange] = (0, _coreData.useEntityBlockEditor)(_utils.KIND, _utils.POST_TYPE, {
|
|
84
85
|
id: (0, _utils.buildWidgetAreasPostId)()
|
|
85
86
|
});
|
|
86
|
-
return (0,
|
|
87
|
+
return (0, _react.createElement)(_components.SlotFillProvider, null, (0, _react.createElement)(_keyboardShortcuts.default.Register, null), (0, _react.createElement)(ExperimentalBlockEditorProvider, {
|
|
87
88
|
value: blocks,
|
|
88
89
|
onInput: onInput,
|
|
89
90
|
onChange: onChange,
|
|
90
91
|
settings: settings,
|
|
91
92
|
useSubRegistry: false,
|
|
92
93
|
...props
|
|
93
|
-
},
|
|
94
|
+
}, children, (0, _react.createElement)(PatternsMenuItems, {
|
|
94
95
|
rootClientId: widgetAreaId
|
|
95
96
|
})));
|
|
96
97
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_components","require","_mediaUtils","_data","_coreData","_element","_blockEditor","_patterns","_preferences","_keyboardShortcuts","_interopRequireDefault","_utils","_useLastSelectedWidgetArea","_store","_constants","_lockUnlock","ExperimentalBlockEditorProvider","unlock","blockEditorPrivateApis","PatternsMenuItems","editPatternsPrivateApis","WidgetAreasBlockEditorProvider","blockEditorSettings","children","props","mediaPermissions","useResourcePermissions","reusableBlocks","isFixedToolbarActive","keepCaretInsideBlock","useSelect","select","widgetAreas","editWidgetsStore","getWidgetAreas","widgets","getWidgets","ALLOW_REUSABLE_BLOCKS","coreStore","getEntityRecords","preferencesStore","get","setIsInserterOpened","useDispatch","settings","useMemo","mediaUploadBlockEditor","canCreate","onError","argumentsObject","uploadMedia","wpAllowedMimeTypes","allowedMimeTypes","message","__experimentalReusableBlocks","hasFixedToolbar","mediaUpload","templateLock","__experimentalSetIsInserterOpened","widgetAreaId","useLastSelectedWidgetArea","blocks","onInput","onChange","useEntityBlockEditor","KIND","POST_TYPE","id","buildWidgetAreasPostId","_react","createElement","SlotFillProvider","default","Register","value","useSubRegistry","rootClientId"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SlotFillProvider } from '@wordpress/components';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n\tuseResourcePermissions,\n} from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport { buildWidgetAreasPostId, KIND, POST_TYPE } from '../../store/utils';\nimport useLastSelectedWidgetArea from '../../hooks/use-last-selected-widget-area';\nimport { store as editWidgetsStore } from '../../store';\nimport { ALLOW_REUSABLE_BLOCKS } from '../../constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\nexport default function WidgetAreasBlockEditorProvider( {\n\tblockEditorSettings,\n\tchildren,\n\t...props\n} ) {\n\tconst mediaPermissions = useResourcePermissions( 'media' );\n\tconst { reusableBlocks, isFixedToolbarActive, keepCaretInsideBlock } =\n\t\tuseSelect(\n\t\t\t( select ) => ( {\n\t\t\t\twidgetAreas: select( editWidgetsStore ).getWidgetAreas(),\n\t\t\t\twidgets: select( editWidgetsStore ).getWidgets(),\n\t\t\t\treusableBlocks: ALLOW_REUSABLE_BLOCKS\n\t\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t'wp_block'\n\t\t\t\t\t )\n\t\t\t\t\t: [],\n\t\t\t\tisFixedToolbarActive: !! select( preferencesStore ).get(\n\t\t\t\t\t'core/edit-widgets',\n\t\t\t\t\t'fixedToolbar'\n\t\t\t\t),\n\t\t\t\tkeepCaretInsideBlock: !! select( preferencesStore ).get(\n\t\t\t\t\t'core/edit-widgets',\n\t\t\t\t\t'keepCaretInsideBlock'\n\t\t\t\t),\n\t\t\t} ),\n\t\t\t[]\n\t\t);\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst settings = useMemo( () => {\n\t\tlet mediaUploadBlockEditor;\n\t\tif ( mediaPermissions.canCreate ) {\n\t\t\tmediaUploadBlockEditor = ( { onError, ...argumentsObject } ) => {\n\t\t\t\tuploadMedia( {\n\t\t\t\t\twpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,\n\t\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t\t...argumentsObject,\n\t\t\t\t} );\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...blockEditorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\thasFixedToolbar: isFixedToolbarActive,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: mediaUploadBlockEditor,\n\t\t\ttemplateLock: 'all',\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t};\n\t}, [\n\t\tblockEditorSettings,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tmediaPermissions.canCreate,\n\t\treusableBlocks,\n\t\tsetIsInserterOpened,\n\t] );\n\n\tconst widgetAreaId = useLastSelectedWidgetArea();\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\tKIND,\n\t\tPOST_TYPE,\n\t\t{ id: buildWidgetAreasPostId() }\n\t);\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<KeyboardShortcuts.Register />\n\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\tvalue={ blocks }\n\t\t\t\tonInput={ onInput }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tsettings={ settings }\n\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t<PatternsMenuItems rootClientId={ widgetAreaId } />\n\t\t\t</ExperimentalBlockEditorProvider>\n\t\t</SlotFillProvider>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,W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ChB,IAAAF,MAAA,CAAAC,aAAA,EAAC7D,kBAAA,CAAA+D,OAAiB,CAACC,QAAQ,MAAE,CAAC,EAC9B,IAAAJ,MAAA,CAAAC,aAAA,EAACtD,+BAA+B;IAC/B0D,KAAK,EAAGb,MAAQ;IAChBC,OAAO,EAAGA,OAAS;IACnBC,QAAQ,EAAGA,QAAU;IACrBnB,QAAQ,EAAGA,QAAU;IACrB+B,cAAc,EAAG,KAAO;IAAA,GACnBnD;EAAK,GAERD,QAAQ,EACV,IAAA8C,MAAA,CAAAC,aAAA,EAACnD,iBAAiB;IAACyD,YAAY,EAAGjB;EAAc,CAAE,CAClB,CAChB,CAAC;AAErB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _react = require("react");
|
|
4
4
|
var _blockEditor = require("@wordpress/block-editor");
|
|
5
5
|
var _compose = require("@wordpress/compose");
|
|
6
6
|
var _data = require("@wordpress/data");
|
|
@@ -42,9 +42,9 @@ const withMoveToWidgetAreaToolbarItem = (0, _compose.createHigherOrderComponent)
|
|
|
42
42
|
} = (0, _data.useDispatch)(_store.store);
|
|
43
43
|
const hasMultipleWidgetAreas = widgetAreas?.length > 1;
|
|
44
44
|
const isMoveToWidgetAreaVisible = blockName !== 'core/widget-area' && hasMultipleWidgetAreas && canInsertBlockInWidgetArea;
|
|
45
|
-
return (0,
|
|
45
|
+
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(BlockEdit, {
|
|
46
46
|
...props
|
|
47
|
-
}), isMoveToWidgetAreaVisible && (0,
|
|
47
|
+
}), isMoveToWidgetAreaVisible && (0, _react.createElement)(_blockEditor.BlockControls, null, (0, _react.createElement)(_widgets.MoveToWidgetArea, {
|
|
48
48
|
widgetAreas: widgetAreas,
|
|
49
49
|
currentWidgetAreaId: currentWidgetAreaId,
|
|
50
50
|
onSelect: widgetAreaId => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blockEditor","require","_compose","_data","_hooks","_widgets","_store","withMoveToWidgetAreaToolbarItem","createHigherOrderComponent","BlockEdit","props","clientId","name","blockName","widgetAreas","currentWidgetAreaId","canInsertBlockInWidgetArea","useSelect","select","selectors","editWidgetsStore","widgetAreaBlock","getParentWidgetAreaBlock","getWidgetAreas","attributes","id","moveBlockToWidgetArea","useDispatch","hasMultipleWidgetAreas","length","isMoveToWidgetAreaVisible","
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_compose","_data","_hooks","_widgets","_store","withMoveToWidgetAreaToolbarItem","createHigherOrderComponent","BlockEdit","props","clientId","name","blockName","widgetAreas","currentWidgetAreaId","canInsertBlockInWidgetArea","useSelect","select","selectors","editWidgetsStore","widgetAreaBlock","getParentWidgetAreaBlock","getWidgetAreas","attributes","id","moveBlockToWidgetArea","useDispatch","hasMultipleWidgetAreas","length","isMoveToWidgetAreaVisible","_react","createElement","Fragment","BlockControls","MoveToWidgetArea","onSelect","widgetAreaId","addFilter"],"sources":["@wordpress/edit-widgets/src/filters/move-to-widget-area.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { BlockControls } from '@wordpress/block-editor';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\nimport { MoveToWidgetArea } from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../store';\n\nconst withMoveToWidgetAreaToolbarItem = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { clientId, name: blockName } = props;\n\t\tconst { widgetAreas, currentWidgetAreaId, canInsertBlockInWidgetArea } =\n\t\t\tuseSelect(\n\t\t\t\t( select ) => {\n\t\t\t\t\t// Component won't display for a widget area, so don't run selectors.\n\t\t\t\t\tif ( blockName === 'core/widget-area' ) {\n\t\t\t\t\t\treturn {};\n\t\t\t\t\t}\n\n\t\t\t\t\tconst selectors = select( editWidgetsStore );\n\n\t\t\t\t\tconst widgetAreaBlock =\n\t\t\t\t\t\tselectors.getParentWidgetAreaBlock( clientId );\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\twidgetAreas: selectors.getWidgetAreas(),\n\t\t\t\t\t\tcurrentWidgetAreaId: widgetAreaBlock?.attributes?.id,\n\t\t\t\t\t\tcanInsertBlockInWidgetArea:\n\t\t\t\t\t\t\tselectors.canInsertBlockInWidgetArea( blockName ),\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t[ clientId, blockName ]\n\t\t\t);\n\n\t\tconst { moveBlockToWidgetArea } = useDispatch( editWidgetsStore );\n\t\tconst hasMultipleWidgetAreas = widgetAreas?.length > 1;\n\t\tconst isMoveToWidgetAreaVisible =\n\t\t\tblockName !== 'core/widget-area' &&\n\t\t\thasMultipleWidgetAreas &&\n\t\t\tcanInsertBlockInWidgetArea;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ isMoveToWidgetAreaVisible && (\n\t\t\t\t\t<BlockControls>\n\t\t\t\t\t\t<MoveToWidgetArea\n\t\t\t\t\t\t\twidgetAreas={ widgetAreas }\n\t\t\t\t\t\t\tcurrentWidgetAreaId={ currentWidgetAreaId }\n\t\t\t\t\t\t\tonSelect={ ( widgetAreaId ) => {\n\t\t\t\t\t\t\t\tmoveBlockToWidgetArea(\n\t\t\t\t\t\t\t\t\tprops.clientId,\n\t\t\t\t\t\t\t\t\twidgetAreaId\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\t'withMoveToWidgetAreaToolbarItem'\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-widgets/block-edit',\n\twithMoveToWidgetAreaToolbarItem\n);\n"],"mappings":";;;AAIA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OA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,IAAAC,MAAA,CAAAC,aAAA,EAAChC,YAAA,CAAAkC,aAAa,QACb,IAAAH,MAAA,CAAAC,aAAA,EAAC3B,QAAA,CAAA8B,gBAAgB;IAChBrB,WAAW,EAAGA,WAAa;IAC3BC,mBAAmB,EAAGA,mBAAqB;IAC3CqB,QAAQ,EAAKC,YAAY,IAAM;MAC9BX,qBAAqB,CACpBhB,KAAK,CAACC,QAAQ,EACd0B,YACD,CAAC;IACF;EAAG,CACH,CACa,CAEf,CAAC;AAEL,CAAC,EACD,iCACD,CAAC;AAED,IAAAC,gBAAS,EACR,kBAAkB,EAClB,8BAA8B,EAC9B/B,+BACD,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -13,10 +13,11 @@ Object.defineProperty(exports, "store", {
|
|
|
13
13
|
return _store.store;
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
var
|
|
16
|
+
var _react = require("react");
|
|
17
17
|
var _blocks = require("@wordpress/blocks");
|
|
18
18
|
var _data = require("@wordpress/data");
|
|
19
19
|
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
20
|
+
var _element = require("@wordpress/element");
|
|
20
21
|
var _blockLibrary = require("@wordpress/block-library");
|
|
21
22
|
var _coreData = require("@wordpress/core-data");
|
|
22
23
|
var _widgets = require("@wordpress/widgets");
|
|
@@ -74,7 +75,7 @@ function initializeEditor(id, settings) {
|
|
|
74
75
|
// do this will result in errors in the default block parser.
|
|
75
76
|
// see: https://github.com/WordPress/gutenberg/issues/33097
|
|
76
77
|
(0, _blocks.setFreeformContentHandlerName)('core/html');
|
|
77
|
-
root.render((0,
|
|
78
|
+
root.render((0, _react.createElement)(_layout.default, {
|
|
78
79
|
blockEditorSettings: settings
|
|
79
80
|
}));
|
|
80
81
|
return root;
|