@wordpress/customize-widgets 4.19.2 → 4.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/components/block-appender/index.js +2 -1
- package/build/components/block-appender/index.js.map +1 -1
- package/build/components/block-inspector-button/index.js +2 -1
- package/build/components/block-inspector-button/index.js.map +1 -1
- package/build/components/customize-widgets/index.js +6 -5
- package/build/components/customize-widgets/index.js.map +1 -1
- package/build/components/error-boundary/index.js +4 -3
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/focus-control/index.js +2 -1
- package/build/components/focus-control/index.js.map +1 -1
- package/build/components/header/index.js +8 -7
- package/build/components/header/index.js.map +1 -1
- package/build/components/inserter/index.js +7 -7
- package/build/components/inserter/index.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/more-menu/index.js +13 -12
- package/build/components/more-menu/index.js.map +1 -1
- package/build/components/sidebar-block-editor/index.js +11 -10
- package/build/components/sidebar-block-editor/index.js.map +1 -1
- package/build/components/sidebar-block-editor/sidebar-editor-provider.js +2 -2
- package/build/components/sidebar-block-editor/sidebar-editor-provider.js.map +1 -1
- package/build/components/sidebar-controls/index.js +2 -1
- package/build/components/sidebar-controls/index.js.map +1 -1
- package/build/components/welcome-guide/index.js +13 -13
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/filters/move-to-sidebar.js +3 -3
- package/build/filters/move-to-sidebar.js.map +1 -1
- package/build/filters/wide-widget-display.js +2 -2
- package/build/filters/wide-widget-display.js.map +1 -1
- package/build/index.js +2 -1
- package/build/index.js.map +1 -1
- package/build/store/actions.js +1 -1
- package/build/store/actions.js.map +1 -1
- package/build-module/components/block-appender/index.js +1 -1
- package/build-module/components/block-inspector-button/index.js +1 -1
- package/build-module/components/customize-widgets/index.js +1 -1
- package/build-module/components/error-boundary/index.js +1 -1
- package/build-module/components/focus-control/index.js +1 -1
- package/build-module/components/header/index.js +1 -1
- package/build-module/components/inserter/index.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/more-menu/index.js +1 -1
- package/build-module/components/sidebar-block-editor/index.js +1 -1
- package/build-module/components/sidebar-block-editor/sidebar-editor-provider.js +1 -1
- package/build-module/components/sidebar-controls/index.js +1 -1
- package/build-module/components/welcome-guide/index.js +1 -1
- package/build-module/filters/move-to-sidebar.js +1 -1
- package/build-module/filters/wide-widget-display.js +1 -1
- package/build-module/index.js +1 -1
- package/build-module/store/actions.js +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-style/style-rtl.css +1 -1
- package/build-style/style.css +1 -1
- package/package.json +22 -22
- package/src/store/actions.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_keycodes","KeyCombination","keyCombination","forceAriaLabel","shortcut","modifier","displayShortcutList","character","ariaLabel","shortcutAriaLabel","createElement","className","Array","isArray","map","index","Fragment","key","Shortcut","description","aliases","alias","_default","exports","default"],"sources":["@wordpress/customize-widgets/src/components/keyboard-shortcut-help-modal/shortcut.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\n\nfunction KeyCombination( { keyCombination, forceAriaLabel } ) {\n\tconst shortcut = keyCombination.modifier\n\t\t? displayShortcutList[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst ariaLabel = keyCombination.modifier\n\t\t? shortcutAriaLabel[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ ( Array.isArray( shortcut ) ? shortcut : [ shortcut ] ).map(\n\t\t\t\t( character, index ) => {\n\t\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<kbd\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ character }\n\t\t\t\t\t\t</kbd>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t) }\n\t\t</kbd>\n\t);\n}\n\nfunction Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"customize-widgets-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"customize-widgets-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t\t<KeyCombination\n\t\t\t\t\t\tkeyCombination={ alias }\n\t\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Shortcut;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","_keycodes","KeyCombination","keyCombination","forceAriaLabel","shortcut","modifier","displayShortcutList","character","ariaLabel","shortcutAriaLabel","_react","createElement","className","Array","isArray","map","index","Fragment","key","Shortcut","description","aliases","alias","_default","exports","default"],"sources":["@wordpress/customize-widgets/src/components/keyboard-shortcut-help-modal/shortcut.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\n\nfunction KeyCombination( { keyCombination, forceAriaLabel } ) {\n\tconst shortcut = keyCombination.modifier\n\t\t? displayShortcutList[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst ariaLabel = keyCombination.modifier\n\t\t? shortcutAriaLabel[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ ( Array.isArray( shortcut ) ? shortcut : [ shortcut ] ).map(\n\t\t\t\t( character, index ) => {\n\t\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<kbd\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ character }\n\t\t\t\t\t\t</kbd>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t) }\n\t\t</kbd>\n\t);\n}\n\nfunction Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"customize-widgets-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"customize-widgets-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t\t<KeyCombination\n\t\t\t\t\t\tkeyCombination={ alias }\n\t\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Shortcut;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,SAASE,cAAcA,CAAE;EAAEC,cAAc;EAAEC;AAAe,CAAC,EAAG;EAC7D,MAAMC,QAAQ,GAAGF,cAAc,CAACG,QAAQ,GACrCC,6BAAmB,CAAEJ,cAAc,CAACG,QAAQ,CAAE,CAC9CH,cAAc,CAACK,SACf,CAAC,GACDL,cAAc,CAACK,SAAS;EAC3B,MAAMC,SAAS,GAAGN,cAAc,CAACG,QAAQ,GACtCI,2BAAiB,CAAEP,cAAc,CAACG,QAAQ,CAAE,CAC5CH,cAAc,CAACK,SACf,CAAC,GACDL,cAAc,CAACK,SAAS;EAE3B,OACC,IAAAG,MAAA,CAAAC,aAAA;IACCC,SAAS,EAAC,0EAA0E;IACpF,cAAaT,cAAc,IAAIK;EAAW,GAExC,CAAEK,KAAK,CAACC,OAAO,CAAEV,QAAS,CAAC,GAAGA,QAAQ,GAAG,CAAEA,QAAQ,CAAE,EAAGW,GAAG,CAC5D,CAAER,SAAS,EAAES,KAAK,KAAM;IACvB,IAAKT,SAAS,KAAK,GAAG,EAAG;MACxB,OAAO,IAAAG,MAAA,CAAAC,aAAA,EAACb,QAAA,CAAAmB,QAAQ;QAACC,GAAG,EAAGF;MAAO,GAAGT,SAAqB,CAAC;IACxD;IAEA,OACC,IAAAG,MAAA,CAAAC,aAAA;MACCO,GAAG,EAAGF,KAAO;MACbJ,SAAS,EAAC;IAA8D,GAEtEL,SACE,CAAC;EAER,CACD,CACI,CAAC;AAER;AAEA,SAASY,QAAQA,CAAE;EAAEC,WAAW;EAAElB,cAAc;EAAEmB,OAAO,GAAG,EAAE;EAAEb;AAAU,CAAC,EAAG;EAC7E,OACC,IAAAE,MAAA,CAAAC,aAAA,EAAAb,QAAA,CAAAmB,QAAA,QACC,IAAAP,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAAsE,GAClFQ,WACE,CAAC,EACN,IAAAV,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAA+D,GAC7E,IAAAF,MAAA,CAAAC,aAAA,EAACV,cAAc;IACdC,cAAc,EAAGA,cAAgB;IACjCC,cAAc,EAAGK;EAAW,CAC5B,CAAC,EACAa,OAAO,CAACN,GAAG,CAAE,CAAEO,KAAK,EAAEN,KAAK,KAC5B,IAAAN,MAAA,CAAAC,aAAA,EAACV,cAAc;IACdC,cAAc,EAAGoB,KAAO;IACxBnB,cAAc,EAAGK,SAAW;IAC5BU,GAAG,EAAGF;EAAO,CACb,CACA,CACE,CACJ,CAAC;AAEL;AAAC,IAAAO,QAAA,GAEcJ,QAAQ;AAAAK,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -5,8 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = MoreMenu;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _components = require("@wordpress/components");
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
10
11
|
var _i18n = require("@wordpress/i18n");
|
|
11
12
|
var _icons = require("@wordpress/icons");
|
|
12
13
|
var _keycodes = require("@wordpress/keycodes");
|
|
@@ -26,47 +27,47 @@ function MoreMenu() {
|
|
|
26
27
|
const [isKeyboardShortcutsModalActive, setIsKeyboardShortcutsModalVisible] = (0, _element.useState)(false);
|
|
27
28
|
const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive);
|
|
28
29
|
(0, _keyboardShortcuts.useShortcut)('core/customize-widgets/keyboard-shortcuts', toggleKeyboardShortcutsModal);
|
|
29
|
-
return (0,
|
|
30
|
+
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_interface.MoreMenuDropdown, {
|
|
30
31
|
as: _components.ToolbarDropdownMenu
|
|
31
|
-
}, () => (0,
|
|
32
|
+
}, () => (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.MenuGroup, {
|
|
32
33
|
label: (0, _i18n._x)('View', 'noun')
|
|
33
|
-
}, (0,
|
|
34
|
+
}, (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
|
|
34
35
|
scope: "core/customize-widgets",
|
|
35
36
|
name: "fixedToolbar",
|
|
36
37
|
label: (0, _i18n.__)('Top toolbar'),
|
|
37
38
|
info: (0, _i18n.__)('Access all block and document tools in a single place'),
|
|
38
39
|
messageActivated: (0, _i18n.__)('Top toolbar activated'),
|
|
39
40
|
messageDeactivated: (0, _i18n.__)('Top toolbar deactivated')
|
|
40
|
-
})), (0,
|
|
41
|
+
})), (0, _react.createElement)(_components.MenuGroup, {
|
|
41
42
|
label: (0, _i18n.__)('Tools')
|
|
42
|
-
}, (0,
|
|
43
|
+
}, (0, _react.createElement)(_components.MenuItem, {
|
|
43
44
|
onClick: () => {
|
|
44
45
|
setIsKeyboardShortcutsModalVisible(true);
|
|
45
46
|
},
|
|
46
47
|
shortcut: _keycodes.displayShortcut.access('h')
|
|
47
|
-
}, (0, _i18n.__)('Keyboard shortcuts')), (0,
|
|
48
|
+
}, (0, _i18n.__)('Keyboard shortcuts')), (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
|
|
48
49
|
scope: "core/customize-widgets",
|
|
49
50
|
name: "welcomeGuide",
|
|
50
51
|
label: (0, _i18n.__)('Welcome Guide')
|
|
51
|
-
}), (0,
|
|
52
|
+
}), (0, _react.createElement)(_components.MenuItem, {
|
|
52
53
|
role: "menuitem",
|
|
53
54
|
icon: _icons.external,
|
|
54
55
|
href: (0, _i18n.__)('https://wordpress.org/documentation/article/block-based-widgets-editor/'),
|
|
55
56
|
target: "_blank",
|
|
56
57
|
rel: "noopener noreferrer"
|
|
57
|
-
}, (0, _i18n.__)('Help'), (0,
|
|
58
|
+
}, (0, _i18n.__)('Help'), (0, _react.createElement)(_components.VisuallyHidden, {
|
|
58
59
|
as: "span"
|
|
59
60
|
}, /* translators: accessibility text */
|
|
60
|
-
(0, _i18n.__)('(opens in a new tab)')))), (0,
|
|
61
|
+
(0, _i18n.__)('(opens in a new tab)')))), (0, _react.createElement)(_components.MenuGroup, {
|
|
61
62
|
label: (0, _i18n.__)('Preferences')
|
|
62
|
-
}, (0,
|
|
63
|
+
}, (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
|
|
63
64
|
scope: "core/customize-widgets",
|
|
64
65
|
name: "keepCaretInsideBlock",
|
|
65
66
|
label: (0, _i18n.__)('Contain text cursor inside block'),
|
|
66
67
|
info: (0, _i18n.__)('Aids screen readers by stopping text caret from leaving blocks.'),
|
|
67
68
|
messageActivated: (0, _i18n.__)('Contain text cursor inside block activated'),
|
|
68
69
|
messageDeactivated: (0, _i18n.__)('Contain text cursor inside block deactivated')
|
|
69
|
-
})))), (0,
|
|
70
|
+
})))), (0, _react.createElement)(_keyboardShortcutHelpModal.default, {
|
|
70
71
|
isModalActive: isKeyboardShortcutsModalActive,
|
|
71
72
|
toggleModal: toggleKeyboardShortcutsModal
|
|
72
73
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_components","require","_element","_i18n","_icons","_keycodes","_keyboardShortcuts","_interface","_preferences","_keyboardShortcutHelpModal","_interopRequireDefault","MoreMenu","isKeyboardShortcutsModalActive","setIsKeyboardShortcutsModalVisible","useState","toggleKeyboardShortcutsModal","useShortcut","_react","createElement","Fragment","MoreMenuDropdown","as","ToolbarDropdownMenu","MenuGroup","label","_x","PreferenceToggleMenuItem","scope","name","__","info","messageActivated","messageDeactivated","MenuItem","onClick","shortcut","displayShortcut","access","role","icon","external","href","target","rel","VisuallyHidden","default","isModalActive","toggleModal"],"sources":["@wordpress/customize-widgets/src/components/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tToolbarDropdownMenu,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { external } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { MoreMenuDropdown } from '@wordpress/interface';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\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/customize-widgets/keyboard-shortcuts',\n\t\ttoggleKeyboardShortcutsModal\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<MoreMenuDropdown as={ ToolbarDropdownMenu }>\n\t\t\t\t{ () => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/customize-widgets\"\n\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\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) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar 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'Top toolbar 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</MenuGroup>\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/customize-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</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/customize-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</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</MoreMenuDropdown>\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"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,UAAA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AA,CAAAC,aAAA,EAACT,0BAAA,CAAAoC,OAAyB;IACzBC,aAAa,EAAGlC,8BAAgC;IAChDmC,WAAW,EAAGhC;EAA8B,CAC5C,CACA,CAAC;AAEL"}
|
|
@@ -5,9 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = SidebarBlockEditor;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _coreData = require("@wordpress/core-data");
|
|
10
10
|
var _data = require("@wordpress/data");
|
|
11
|
+
var _element = require("@wordpress/element");
|
|
11
12
|
var _blockEditor = require("@wordpress/block-editor");
|
|
12
13
|
var _mediaUtils = require("@wordpress/media-utils");
|
|
13
14
|
var _preferences = require("@wordpress/preferences");
|
|
@@ -80,37 +81,37 @@ function SidebarBlockEditor({
|
|
|
80
81
|
};
|
|
81
82
|
}, [hasUploadPermissions, blockEditorSettings, isFixedToolbarActive, keepCaretInsideBlock, setIsInserterOpened]);
|
|
82
83
|
if (isWelcomeGuideActive) {
|
|
83
|
-
return (0,
|
|
84
|
+
return (0, _react.createElement)(_welcomeGuide.default, {
|
|
84
85
|
sidebar: sidebar
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
|
-
return (0,
|
|
88
|
+
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_keyboardShortcuts.default.Register, null), (0, _react.createElement)(_sidebarEditorProvider.default, {
|
|
88
89
|
sidebar: sidebar,
|
|
89
90
|
settings: settings
|
|
90
|
-
}, (0,
|
|
91
|
+
}, (0, _react.createElement)(_keyboardShortcuts.default, {
|
|
91
92
|
undo: sidebar.undo,
|
|
92
93
|
redo: sidebar.redo,
|
|
93
94
|
save: sidebar.save
|
|
94
|
-
}), (0,
|
|
95
|
+
}), (0, _react.createElement)(_header.default, {
|
|
95
96
|
sidebar: sidebar,
|
|
96
97
|
inserter: inserter,
|
|
97
98
|
isInserterOpened: isInserterOpened,
|
|
98
99
|
setIsInserterOpened: setIsInserterOpened,
|
|
99
100
|
isFixedToolbarActive: isFixedToolbarActive
|
|
100
|
-
}), (0,
|
|
101
|
+
}), (0, _react.createElement)(_blockEditor.BlockTools, null, (0, _react.createElement)(BlockCanvas, {
|
|
101
102
|
shouldIframe: false,
|
|
102
103
|
styles: settings.defaultEditorStyles,
|
|
103
104
|
height: "100%"
|
|
104
|
-
}, (0,
|
|
105
|
+
}, (0, _react.createElement)(_blockEditor.BlockList, {
|
|
105
106
|
renderAppender: _blockAppender.default
|
|
106
107
|
}))), (0, _element.createPortal)(
|
|
107
108
|
// This is a temporary hack to prevent button component inside <BlockInspector>
|
|
108
109
|
// from submitting form when type="button" is not specified.
|
|
109
|
-
(0,
|
|
110
|
+
(0, _react.createElement)("form", {
|
|
110
111
|
onSubmit: event => event.preventDefault()
|
|
111
|
-
}, (0,
|
|
112
|
+
}, (0, _react.createElement)(_blockEditor.BlockInspector, null)), inspector.contentContainer[0])), (0, _react.createElement)(_blockEditor.__unstableBlockSettingsMenuFirstItem, null, ({
|
|
112
113
|
onClose
|
|
113
|
-
}) => (0,
|
|
114
|
+
}) => (0, _react.createElement)(_blockInspectorButton.default, {
|
|
114
115
|
inspector: inspector,
|
|
115
116
|
closeMenu: onClose
|
|
116
117
|
})));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_coreData","require","_data","_element","_blockEditor","_mediaUtils","_preferences","_blockInspectorButton","_interopRequireDefault","_header","_useInserter","_sidebarEditorProvider","_welcomeGuide","_keyboardShortcuts","_blockAppender","_lockUnlock","ExperimentalBlockCanvas","BlockCanvas","unlock","blockEditorPrivateApis","SidebarBlockEditor","blockEditorSettings","sidebar","inserter","inspector","isInserterOpened","setIsInserterOpened","useInserter","hasUploadPermissions","isFixedToolbarActive","keepCaretInsideBlock","isWelcomeGuideActive","useSelect","select","_select$canUser","get","preferencesStore","coreStore","canUser","settings","useMemo","mediaUploadBlockEditor","onError","argumentsObject","uploadMedia","wpAllowedMimeTypes","allowedMimeTypes","message","__experimentalSetIsInserterOpened","mediaUpload","hasFixedToolbar","__unstableHasCustomAppender","_react","createElement","default","Fragment","Register","undo","redo","save","BlockTools","shouldIframe","styles","defaultEditorStyles","height","BlockList","renderAppender","BlockAppender","createPortal","onSubmit","event","preventDefault","BlockInspector","contentContainer","__unstableBlockSettingsMenuFirstItem","onClose","closeMenu"],"sources":["@wordpress/customize-widgets/src/components/sidebar-block-editor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, createPortal } from '@wordpress/element';\nimport {\n\tBlockList,\n\tBlockTools,\n\tBlockInspector,\n\tprivateApis as blockEditorPrivateApis,\n\t__unstableBlockSettingsMenuFirstItem,\n} from '@wordpress/block-editor';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport BlockInspectorButton from '../block-inspector-button';\nimport Header from '../header';\nimport useInserter from '../inserter/use-inserter';\nimport SidebarEditorProvider from './sidebar-editor-provider';\nimport WelcomeGuide from '../welcome-guide';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport BlockAppender from '../block-appender';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockCanvas: BlockCanvas } = unlock(\n\tblockEditorPrivateApis\n);\n\nexport default function SidebarBlockEditor( {\n\tblockEditorSettings,\n\tsidebar,\n\tinserter,\n\tinspector,\n} ) {\n\tconst [ isInserterOpened, setIsInserterOpened ] = useInserter( inserter );\n\tconst {\n\t\thasUploadPermissions,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tisWelcomeGuideActive,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\treturn {\n\t\t\thasUploadPermissions:\n\t\t\t\tselect( coreStore ).canUser( 'create', 'media' ) ?? true,\n\t\t\tisFixedToolbarActive: !! get(\n\t\t\t\t'core/customize-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! get(\n\t\t\t\t'core/customize-widgets',\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tisWelcomeGuideActive: !! get(\n\t\t\t\t'core/customize-widgets',\n\t\t\t\t'welcomeGuide'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst settings = useMemo( () => {\n\t\tlet mediaUploadBlockEditor;\n\t\tif ( hasUploadPermissions ) {\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\n\t\treturn {\n\t\t\t...blockEditorSettings,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tmediaUpload: mediaUploadBlockEditor,\n\t\t\thasFixedToolbar: isFixedToolbarActive,\n\t\t\tkeepCaretInsideBlock,\n\t\t\t__unstableHasCustomAppender: true,\n\t\t};\n\t}, [\n\t\thasUploadPermissions,\n\t\tblockEditorSettings,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tsetIsInserterOpened,\n\t] );\n\n\tif ( isWelcomeGuideActive ) {\n\t\treturn <WelcomeGuide sidebar={ sidebar } />;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<KeyboardShortcuts.Register />\n\n\t\t\t<SidebarEditorProvider sidebar={ sidebar } settings={ settings }>\n\t\t\t\t<KeyboardShortcuts\n\t\t\t\t\tundo={ sidebar.undo }\n\t\t\t\t\tredo={ sidebar.redo }\n\t\t\t\t\tsave={ sidebar.save }\n\t\t\t\t/>\n\n\t\t\t\t<Header\n\t\t\t\t\tsidebar={ sidebar }\n\t\t\t\t\tinserter={ inserter }\n\t\t\t\t\tisInserterOpened={ isInserterOpened }\n\t\t\t\t\tsetIsInserterOpened={ setIsInserterOpened }\n\t\t\t\t\tisFixedToolbarActive={ isFixedToolbarActive }\n\t\t\t\t/>\n\n\t\t\t\t<BlockTools>\n\t\t\t\t\t<BlockCanvas\n\t\t\t\t\t\tshouldIframe={ false }\n\t\t\t\t\t\tstyles={ settings.defaultEditorStyles }\n\t\t\t\t\t\theight=\"100%\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList renderAppender={ BlockAppender } />\n\t\t\t\t\t</BlockCanvas>\n\t\t\t\t</BlockTools>\n\n\t\t\t\t{ createPortal(\n\t\t\t\t\t// This is a temporary hack to prevent button component inside <BlockInspector>\n\t\t\t\t\t// from submitting form when type=\"button\" is not specified.\n\t\t\t\t\t<form onSubmit={ ( event ) => event.preventDefault() }>\n\t\t\t\t\t\t<BlockInspector />\n\t\t\t\t\t</form>,\n\t\t\t\t\tinspector.contentContainer[ 0 ]\n\t\t\t\t) }\n\t\t\t</SidebarEditorProvider>\n\n\t\t\t<__unstableBlockSettingsMenuFirstItem>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<BlockInspectorButton\n\t\t\t\t\t\tinspector={ inspector }\n\t\t\t\t\t\tcloseMenu={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</__unstableBlockSettingsMenuFirstItem>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAOA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,qBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,YAAA,GAAAF,sBAAA,CAAA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5C,OAAA,CAAA6C,OAAM;IACNhC,OAAO,EAAGA,OAAS;IACnBC,QAAQ,EAAGA,QAAU;IACrBE,gBAAgB,EAAGA,gBAAkB;IACrCC,mBAAmB,EAAGA,mBAAqB;IAC3CG,oBAAoB,EAAGA;EAAsB,CAC7C,CAAC,EAEF,IAAAuB,MAAA,CAAAC,aAAA,EAACjD,YAAA,CAAAwD,UAAU,QACV,IAAAR,MAAA,CAAAC,aAAA,EAACpC,WAAW;IACX4C,YAAY,EAAG,KAAO;IACtBC,MAAM,EAAGvB,QAAQ,CAACwB,mBAAqB;IACvCC,MAAM,EAAC;EAAM,GAEb,IAAAZ,MAAA,CAAAC,aAAA,EAACjD,YAAA,CAAA6D,SAAS;IAACC,cAAc,EAAGC;EAAe,CAAE,CACjC,CACF,CAAC,EAEX,IAAAC,qBAAY;EACb;EACA;EACA,IAAAhB,MAAA,CAAAC,aAAA;IAAMgB,QAAQ,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC;EAAG,GACrD,IAAAnB,MAAA,CAAAC,aAAA,EAACjD,YAAA,CAAAoE,cAAc,MAAE,CACZ,CAAC,EACPhD,SAAS,CAACiD,gBAAgB,CAAE,CAAC,CAC9B,CACsB,CAAC,EAExB,IAAArB,MAAA,CAAAC,aAAA,EAACjD,YAAA,CAAAsE,oCAAoC,QAClC,CAAE;IAAEC;EAAQ,CAAC,KACd,IAAAvB,MAAA,CAAAC,aAAA,EAAC9C,qBAAA,CAAA+C,OAAoB;IACpB9B,SAAS,EAAGA,SAAW;IACvBoD,SAAS,EAAGD;EAAS,CACrB,CAEmC,CACrC,CAAC;AAEL"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = SidebarEditorProvider;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _blockEditor = require("@wordpress/block-editor");
|
|
10
10
|
var _useSidebarBlockEditor = _interopRequireDefault(require("./use-sidebar-block-editor"));
|
|
11
11
|
var _useBlocksFocusControl = _interopRequireDefault(require("../focus-control/use-blocks-focus-control"));
|
|
@@ -28,7 +28,7 @@ function SidebarEditorProvider({
|
|
|
28
28
|
}) {
|
|
29
29
|
const [blocks, onInput, onChange] = (0, _useSidebarBlockEditor.default)(sidebar);
|
|
30
30
|
(0, _useBlocksFocusControl.default)(blocks);
|
|
31
|
-
return (0,
|
|
31
|
+
return (0, _react.createElement)(ExperimentalBlockEditorProvider, {
|
|
32
32
|
value: blocks,
|
|
33
33
|
onInput: onInput,
|
|
34
34
|
onChange: onChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blockEditor","require","_useSidebarBlockEditor","_interopRequireDefault","_useBlocksFocusControl","_lockUnlock","ExperimentalBlockEditorProvider","unlock","blockEditorPrivateApis","SidebarEditorProvider","sidebar","settings","children","blocks","onInput","onChange","useSidebarBlockEditor","useBlocksFocusControl","
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_useSidebarBlockEditor","_interopRequireDefault","_useBlocksFocusControl","_lockUnlock","ExperimentalBlockEditorProvider","unlock","blockEditorPrivateApis","SidebarEditorProvider","sidebar","settings","children","blocks","onInput","onChange","useSidebarBlockEditor","useBlocksFocusControl","_react","createElement","value","useSubRegistry"],"sources":["@wordpress/customize-widgets/src/components/sidebar-block-editor/sidebar-editor-provider.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport useSidebarBlockEditor from './use-sidebar-block-editor';\nimport useBlocksFocusControl from '../focus-control/use-blocks-focus-control';\n\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\n\nexport default function SidebarEditorProvider( {\n\tsidebar,\n\tsettings,\n\tchildren,\n} ) {\n\tconst [ blocks, onInput, onChange ] = useSidebarBlockEditor( sidebar );\n\n\tuseBlocksFocusControl( blocks );\n\n\treturn (\n\t\t<ExperimentalBlockEditorProvider\n\t\t\tvalue={ blocks }\n\t\t\tonInput={ onInput }\n\t\t\tonChange={ onChange }\n\t\t\tsettings={ settings }\n\t\t\tuseSubRegistry={ false }\n\t\t>\n\t\t\t{ children }\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,sBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAMA,MAAM;EAAEK;AAAgC,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAE7D,SAASC,qBAAqBA,CAAE;EAC9CC,OAAO;EACPC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAM,CAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAE,GAAG,IAAAC,8BAAqB,EAAEN,OAAQ,CAAC;EAEtE,IAAAO,8BAAqB,EAAEJ,MAAO,CAAC;EAE/B,OACC,IAAAK,MAAA,CAAAC,aAAA,EAACb,+BAA+B;IAC/Bc,KAAK,EAAGP,MAAQ;IAChBC,OAAO,EAAGA,OAAS;IACnBC,QAAQ,EAAGA,QAAU;IACrBJ,QAAQ,EAAGA,QAAU;IACrBU,cAAc,EAAG;EAAO,GAEtBT,QAC8B,CAAC;AAEpC"}
|
|
@@ -7,6 +7,7 @@ exports.SidebarControlsContext = void 0;
|
|
|
7
7
|
exports.default = SidebarControls;
|
|
8
8
|
exports.useActiveSidebarControl = useActiveSidebarControl;
|
|
9
9
|
exports.useSidebarControls = useSidebarControls;
|
|
10
|
+
var _react = require("react");
|
|
10
11
|
var _element = require("@wordpress/element");
|
|
11
12
|
/**
|
|
12
13
|
* WordPress dependencies
|
|
@@ -23,7 +24,7 @@ function SidebarControls({
|
|
|
23
24
|
sidebarControls,
|
|
24
25
|
activeSidebarControl
|
|
25
26
|
}), [sidebarControls, activeSidebarControl]);
|
|
26
|
-
return (0,
|
|
27
|
+
return (0, _react.createElement)(SidebarControlsContext.Provider, {
|
|
27
28
|
value: context
|
|
28
29
|
}, children);
|
|
29
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","SidebarControlsContext","createContext","exports","SidebarControls","sidebarControls","activeSidebarControl","children","context","useMemo","createElement","Provider","value","useSidebarControls","useContext","useActiveSidebarControl"],"sources":["@wordpress/customize-widgets/src/components/sidebar-controls/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useMemo, useContext } from '@wordpress/element';\n\nexport const SidebarControlsContext = createContext();\n\nexport default function SidebarControls( {\n\tsidebarControls,\n\tactiveSidebarControl,\n\tchildren,\n} ) {\n\tconst context = useMemo(\n\t\t() => ( {\n\t\t\tsidebarControls,\n\t\t\tactiveSidebarControl,\n\t\t} ),\n\t\t[ sidebarControls, activeSidebarControl ]\n\t);\n\n\treturn (\n\t\t<SidebarControlsContext.Provider value={ context }>\n\t\t\t{ children }\n\t\t</SidebarControlsContext.Provider>\n\t);\n}\n\nexport function useSidebarControls() {\n\tconst { sidebarControls } = useContext( SidebarControlsContext );\n\n\treturn sidebarControls;\n}\n\nexport function useActiveSidebarControl() {\n\tconst { activeSidebarControl } = useContext( SidebarControlsContext );\n\n\treturn activeSidebarControl;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","SidebarControlsContext","createContext","exports","SidebarControls","sidebarControls","activeSidebarControl","children","context","useMemo","_react","createElement","Provider","value","useSidebarControls","useContext","useActiveSidebarControl"],"sources":["@wordpress/customize-widgets/src/components/sidebar-controls/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useMemo, useContext } from '@wordpress/element';\n\nexport const SidebarControlsContext = createContext();\n\nexport default function SidebarControls( {\n\tsidebarControls,\n\tactiveSidebarControl,\n\tchildren,\n} ) {\n\tconst context = useMemo(\n\t\t() => ( {\n\t\t\tsidebarControls,\n\t\t\tactiveSidebarControl,\n\t\t} ),\n\t\t[ sidebarControls, activeSidebarControl ]\n\t);\n\n\treturn (\n\t\t<SidebarControlsContext.Provider value={ context }>\n\t\t\t{ children }\n\t\t</SidebarControlsContext.Provider>\n\t);\n}\n\nexport function useSidebarControls() {\n\tconst { sidebarControls } = useContext( SidebarControlsContext );\n\n\treturn sidebarControls;\n}\n\nexport function useActiveSidebarControl() {\n\tconst { activeSidebarControl } = useContext( SidebarControlsContext );\n\n\treturn activeSidebarControl;\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAMC,sBAAsB,GAAG,IAAAC,sBAAa,EAAC,CAAC;AAACC,OAAA,CAAAF,sBAAA,GAAAA,sBAAA;AAEvC,SAASG,eAAeA,CAAE;EACxCC,eAAe;EACfC,oBAAoB;EACpBC;AACD,CAAC,EAAG;EACH,MAAMC,OAAO,GAAG,IAAAC,gBAAO,EACtB,OAAQ;IACPJ,eAAe;IACfC;EACD,CAAC,CAAE,EACH,CAAED,eAAe,EAAEC,oBAAoB,CACxC,CAAC;EAED,OACC,IAAAI,MAAA,CAAAC,aAAA,EAACV,sBAAsB,CAACW,QAAQ;IAACC,KAAK,EAAGL;EAAS,GAC/CD,QAC8B,CAAC;AAEpC;AAEO,SAASO,kBAAkBA,CAAA,EAAG;EACpC,MAAM;IAAET;EAAgB,CAAC,GAAG,IAAAU,mBAAU,EAAEd,sBAAuB,CAAC;EAEhE,OAAOI,eAAe;AACvB;AAEO,SAASW,uBAAuBA,CAAA,EAAG;EACzC,MAAM;IAAEV;EAAqB,CAAC,GAAG,IAAAS,mBAAU,EAAEd,sBAAuB,CAAC;EAErE,OAAOK,oBAAoB;AAC5B"}
|
|
@@ -4,7 +4,7 @@ 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 _i18n = require("@wordpress/i18n");
|
|
9
9
|
var _components = require("@wordpress/components");
|
|
10
10
|
var _data = require("@wordpress/data");
|
|
@@ -20,36 +20,36 @@ function WelcomeGuide({
|
|
|
20
20
|
toggle
|
|
21
21
|
} = (0, _data.useDispatch)(_preferences.store);
|
|
22
22
|
const isEntirelyBlockWidgets = sidebar.getWidgets().every(widget => widget.id.startsWith('block-'));
|
|
23
|
-
return (0,
|
|
23
|
+
return (0, _react.createElement)("div", {
|
|
24
24
|
className: "customize-widgets-welcome-guide"
|
|
25
|
-
}, (0,
|
|
25
|
+
}, (0, _react.createElement)("div", {
|
|
26
26
|
className: "customize-widgets-welcome-guide__image__wrapper"
|
|
27
|
-
}, (0,
|
|
27
|
+
}, (0, _react.createElement)("picture", null, (0, _react.createElement)("source", {
|
|
28
28
|
srcSet: "https://s.w.org/images/block-editor/welcome-editor.svg",
|
|
29
29
|
media: "(prefers-reduced-motion: reduce)"
|
|
30
|
-
}), (0,
|
|
30
|
+
}), (0, _react.createElement)("img", {
|
|
31
31
|
className: "customize-widgets-welcome-guide__image",
|
|
32
32
|
src: "https://s.w.org/images/block-editor/welcome-editor.gif",
|
|
33
33
|
width: "312",
|
|
34
34
|
height: "240",
|
|
35
35
|
alt: ""
|
|
36
|
-
}))), (0,
|
|
36
|
+
}))), (0, _react.createElement)("h1", {
|
|
37
37
|
className: "customize-widgets-welcome-guide__heading"
|
|
38
|
-
}, (0, _i18n.__)('Welcome to block Widgets')), (0,
|
|
38
|
+
}, (0, _i18n.__)('Welcome to block Widgets')), (0, _react.createElement)("p", {
|
|
39
39
|
className: "customize-widgets-welcome-guide__text"
|
|
40
|
-
}, isEntirelyBlockWidgets ? (0, _i18n.__)('Your theme provides 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.') : (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,
|
|
40
|
+
}, isEntirelyBlockWidgets ? (0, _i18n.__)('Your theme provides 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.') : (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)(_components.Button, {
|
|
41
41
|
className: "customize-widgets-welcome-guide__button",
|
|
42
42
|
variant: "primary",
|
|
43
43
|
onClick: () => toggle('core/customize-widgets', 'welcomeGuide')
|
|
44
|
-
}, (0, _i18n.__)('Got it')), (0,
|
|
44
|
+
}, (0, _i18n.__)('Got it')), (0, _react.createElement)("hr", {
|
|
45
45
|
className: "customize-widgets-welcome-guide__separator"
|
|
46
|
-
}), !isEntirelyBlockWidgets && (0,
|
|
46
|
+
}), !isEntirelyBlockWidgets && (0, _react.createElement)("p", {
|
|
47
47
|
className: "customize-widgets-welcome-guide__more-info"
|
|
48
|
-
}, (0, _i18n.__)('Want to stick with the old widgets?'), (0,
|
|
48
|
+
}, (0, _i18n.__)('Want to stick with the old widgets?'), (0, _react.createElement)("br", null), (0, _react.createElement)(_components.ExternalLink, {
|
|
49
49
|
href: (0, _i18n.__)('https://wordpress.org/plugins/classic-widgets/')
|
|
50
|
-
}, (0, _i18n.__)('Get the Classic Widgets plugin.'))), (0,
|
|
50
|
+
}, (0, _i18n.__)('Get the Classic Widgets plugin.'))), (0, _react.createElement)("p", {
|
|
51
51
|
className: "customize-widgets-welcome-guide__more-info"
|
|
52
|
-
}, (0, _i18n.__)('New to the block editor?'), (0,
|
|
52
|
+
}, (0, _i18n.__)('New to the block editor?'), (0, _react.createElement)("br", null), (0, _react.createElement)(_components.ExternalLink, {
|
|
53
53
|
href: (0, _i18n.__)('https://wordpress.org/documentation/article/wordpress-block-editor/')
|
|
54
54
|
}, (0, _i18n.__)("Here's a detailed guide."))));
|
|
55
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_data","_preferences","WelcomeGuide","sidebar","toggle","useDispatch","preferencesStore","isEntirelyBlockWidgets","getWidgets","every","widget","id","startsWith","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_data","_preferences","WelcomeGuide","sidebar","toggle","useDispatch","preferencesStore","isEntirelyBlockWidgets","getWidgets","every","widget","id","startsWith","_react","createElement","className","srcSet","media","src","width","height","alt","__","Button","variant","onClick","ExternalLink","href"],"sources":["@wordpress/customize-widgets/src/components/welcome-guide/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Button, ExternalLink } from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\nexport default function WelcomeGuide( { sidebar } ) {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst isEntirelyBlockWidgets = sidebar\n\t\t.getWidgets()\n\t\t.every( ( widget ) => widget.id.startsWith( 'block-' ) );\n\n\treturn (\n\t\t<div className=\"customize-widgets-welcome-guide\">\n\t\t\t<div className=\"customize-widgets-welcome-guide__image__wrapper\">\n\t\t\t\t<picture>\n\t\t\t\t\t<source\n\t\t\t\t\t\tsrcSet=\"https://s.w.org/images/block-editor/welcome-editor.svg\"\n\t\t\t\t\t\tmedia=\"(prefers-reduced-motion: reduce)\"\n\t\t\t\t\t/>\n\t\t\t\t\t<img\n\t\t\t\t\t\tclassName=\"customize-widgets-welcome-guide__image\"\n\t\t\t\t\t\tsrc=\"https://s.w.org/images/block-editor/welcome-editor.gif\"\n\t\t\t\t\t\twidth=\"312\"\n\t\t\t\t\t\theight=\"240\"\n\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t/>\n\t\t\t\t</picture>\n\t\t\t</div>\n\t\t\t<h1 className=\"customize-widgets-welcome-guide__heading\">\n\t\t\t\t{ __( 'Welcome to block Widgets' ) }\n\t\t\t</h1>\n\t\t\t<p className=\"customize-widgets-welcome-guide__text\">\n\t\t\t\t{ isEntirelyBlockWidgets\n\t\t\t\t\t? __(\n\t\t\t\t\t\t\t'Your theme provides 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 )\n\t\t\t\t\t: __(\n\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 ) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\tclassName=\"customize-widgets-welcome-guide__button\"\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tonClick={ () =>\n\t\t\t\t\ttoggle( 'core/customize-widgets', 'welcomeGuide' )\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t{ __( 'Got it' ) }\n\t\t\t</Button>\n\t\t\t<hr className=\"customize-widgets-welcome-guide__separator\" />\n\t\t\t{ ! isEntirelyBlockWidgets && (\n\t\t\t\t<p className=\"customize-widgets-welcome-guide__more-info\">\n\t\t\t\t\t{ __( 'Want to stick with the old widgets?' ) }\n\t\t\t\t\t<br />\n\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t'https://wordpress.org/plugins/classic-widgets/'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Get the Classic Widgets plugin.' ) }\n\t\t\t\t\t</ExternalLink>\n\t\t\t\t</p>\n\t\t\t) }\n\t\t\t<p className=\"customize-widgets-welcome-guide__more-info\">\n\t\t\t\t{ __( 'New to the block editor?' ) }\n\t\t\t\t<br />\n\t\t\t\t<ExternalLink\n\t\t\t\t\thref={ __(\n\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ __( \"Here's a detailed guide.\" ) }\n\t\t\t\t</ExternalLink>\n\t\t\t</p>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAA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rB,MAAM,CAAE,wBAAwB,EAAE,cAAe;EACjD,GAEC,IAAAkB,QAAE,EAAE,QAAS,CACR,CAAC,EACT,IAAAT,MAAA,CAAAC,aAAA;IAAIC,SAAS,EAAC;EAA4C,CAAE,CAAC,EAC3D,CAAER,sBAAsB,IACzB,IAAAM,MAAA,CAAAC,aAAA;IAAGC,SAAS,EAAC;EAA4C,GACtD,IAAAO,QAAE,EAAE,qCAAsC,CAAC,EAC7C,IAAAT,MAAA,CAAAC,aAAA,YAAK,CAAC,EACN,IAAAD,MAAA,CAAAC,aAAA,EAACf,WAAA,CAAA2B,YAAY;IACZC,IAAI,EAAG,IAAAL,QAAE,EACR,gDACD;EAAG,GAED,IAAAA,QAAE,EAAE,iCAAkC,CAC3B,CACZ,CACH,EACD,IAAAT,MAAA,CAAAC,aAAA;IAAGC,SAAS,EAAC;EAA4C,GACtD,IAAAO,QAAE,EAAE,0BAA2B,CAAC,EAClC,IAAAT,MAAA,CAAAC,aAAA,YAAK,CAAC,EACN,IAAAD,MAAA,CAAAC,aAAA,EAACf,WAAA,CAAA2B,YAAY;IACZC,IAAI,EAAG,IAAAL,QAAE,EACR,qEACD;EAAG,GAED,IAAAA,QAAE,EAAE,0BAA2B,CACpB,CACZ,CACC,CAAC;AAER"}
|
|
@@ -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");
|
|
@@ -60,9 +60,9 @@ const withMoveToSidebarToolbarItem = (0, _compose.createHigherOrderComponent)(Bl
|
|
|
60
60
|
// Move focus to the moved widget and expand the sidebar.
|
|
61
61
|
focusWidget(widgetId);
|
|
62
62
|
}
|
|
63
|
-
return (0,
|
|
63
|
+
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(BlockEdit, {
|
|
64
64
|
...props
|
|
65
|
-
}), hasMultipleSidebars && canInsertBlockInSidebar && (0,
|
|
65
|
+
}), hasMultipleSidebars && canInsertBlockInSidebar && (0, _react.createElement)(_blockEditor.BlockControls, null, (0, _react.createElement)(_widgets.MoveToWidgetArea, {
|
|
66
66
|
widgetAreas: sidebarControls.map(sidebarControl => ({
|
|
67
67
|
id: sidebarControl.id,
|
|
68
68
|
name: sidebarControl.params.label,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blockEditor","require","_compose","_data","_hooks","_widgets","_sidebarControls","_focusControl","_utils","withMoveToSidebarToolbarItem","createHigherOrderComponent","BlockEdit","props","widgetId","getWidgetIdFromBlock","sidebarControls","useSidebarControls","activeSidebarControl","useActiveSidebarControl","hasMultipleSidebars","length","blockName","name","clientId","canInsertBlockInSidebar","useSelect","select","blockEditorStore","canInsertBlockType","block","getBlock","removeBlock","useDispatch","focusWidget","useFocusControl","moveToSidebar","sidebarControlId","newSidebarControl","find","sidebarControl","id","oldSetting","setting","newSetting","filter","sidebarAdapter","addedWidgetIds","setWidgets","getWidgets","blockToWidget","reverse","
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_compose","_data","_hooks","_widgets","_sidebarControls","_focusControl","_utils","withMoveToSidebarToolbarItem","createHigherOrderComponent","BlockEdit","props","widgetId","getWidgetIdFromBlock","sidebarControls","useSidebarControls","activeSidebarControl","useActiveSidebarControl","hasMultipleSidebars","length","blockName","name","clientId","canInsertBlockInSidebar","useSelect","select","blockEditorStore","canInsertBlockType","block","getBlock","removeBlock","useDispatch","focusWidget","useFocusControl","moveToSidebar","sidebarControlId","newSidebarControl","find","sidebarControl","id","oldSetting","setting","newSetting","filter","sidebarAdapter","addedWidgetIds","setWidgets","getWidgets","blockToWidget","reverse","_react","createElement","Fragment","BlockControls","MoveToWidgetArea","widgetAreas","map","params","label","description","currentWidgetAreaId","onSelect","addFilter"],"sources":["@wordpress/customize-widgets/src/filters/move-to-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\nimport { MoveToWidgetArea, getWidgetIdFromBlock } from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseSidebarControls,\n\tuseActiveSidebarControl,\n} from '../components/sidebar-controls';\nimport { useFocusControl } from '../components/focus-control';\nimport { blockToWidget } from '../utils';\n\nconst withMoveToSidebarToolbarItem = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tlet widgetId = getWidgetIdFromBlock( props );\n\t\tconst sidebarControls = useSidebarControls();\n\t\tconst activeSidebarControl = useActiveSidebarControl();\n\t\tconst hasMultipleSidebars = sidebarControls?.length > 1;\n\t\tconst blockName = props.name;\n\t\tconst clientId = props.clientId;\n\t\tconst canInsertBlockInSidebar = useSelect(\n\t\t\t( select ) => {\n\t\t\t\t// Use an empty string to represent the root block list, which\n\t\t\t\t// in the customizer editor represents a sidebar/widget area.\n\t\t\t\treturn select( blockEditorStore ).canInsertBlockType(\n\t\t\t\t\tblockName,\n\t\t\t\t\t''\n\t\t\t\t);\n\t\t\t},\n\t\t\t[ blockName ]\n\t\t);\n\t\tconst block = useSelect(\n\t\t\t( select ) => select( blockEditorStore ).getBlock( clientId ),\n\t\t\t[ clientId ]\n\t\t);\n\t\tconst { removeBlock } = useDispatch( blockEditorStore );\n\t\tconst [ , focusWidget ] = useFocusControl();\n\n\t\tfunction moveToSidebar( sidebarControlId ) {\n\t\t\tconst newSidebarControl = sidebarControls.find(\n\t\t\t\t( sidebarControl ) => sidebarControl.id === sidebarControlId\n\t\t\t);\n\n\t\t\tif ( widgetId ) {\n\t\t\t\t/**\n\t\t\t\t * If there's a widgetId, move it to the other sidebar.\n\t\t\t\t */\n\t\t\t\tconst oldSetting = activeSidebarControl.setting;\n\t\t\t\tconst newSetting = newSidebarControl.setting;\n\n\t\t\t\toldSetting( oldSetting().filter( ( id ) => id !== widgetId ) );\n\t\t\t\tnewSetting( [ ...newSetting(), widgetId ] );\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If there isn't a widgetId, it's most likely a inner block.\n\t\t\t\t * First, remove the block in the original sidebar,\n\t\t\t\t * then, create a new widget in the new sidebar and get back its widgetId.\n\t\t\t\t */\n\t\t\t\tconst sidebarAdapter = newSidebarControl.sidebarAdapter;\n\n\t\t\t\tremoveBlock( clientId );\n\t\t\t\tconst addedWidgetIds = sidebarAdapter.setWidgets( [\n\t\t\t\t\t...sidebarAdapter.getWidgets(),\n\t\t\t\t\tblockToWidget( block ),\n\t\t\t\t] );\n\t\t\t\t// The last non-null id is the added widget's id.\n\t\t\t\twidgetId = addedWidgetIds.reverse().find( ( id ) => !! id );\n\t\t\t}\n\n\t\t\t// Move focus to the moved widget and expand the sidebar.\n\t\t\tfocusWidget( widgetId );\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ hasMultipleSidebars && canInsertBlockInSidebar && (\n\t\t\t\t\t<BlockControls>\n\t\t\t\t\t\t<MoveToWidgetArea\n\t\t\t\t\t\t\twidgetAreas={ sidebarControls.map(\n\t\t\t\t\t\t\t\t( sidebarControl ) => ( {\n\t\t\t\t\t\t\t\t\tid: sidebarControl.id,\n\t\t\t\t\t\t\t\t\tname: sidebarControl.params.label,\n\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\tsidebarControl.params.description,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tcurrentWidgetAreaId={ activeSidebarControl?.id }\n\t\t\t\t\t\t\tonSelect={ moveToSidebar }\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'withMoveToSidebarToolbarItem'\n);\n\na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/C,QAAA,CAAAkD,gBAAgB;IAChBC,WAAW,EAAGzC,eAAe,CAAC0C,GAAG,CAC9BlB,cAAc,KAAQ;MACvBC,EAAE,EAAED,cAAc,CAACC,EAAE;MACrBlB,IAAI,EAAEiB,cAAc,CAACmB,MAAM,CAACC,KAAK;MACjCC,WAAW,EACVrB,cAAc,CAACmB,MAAM,CAACE;IACxB,CAAC,CACF,CAAG;IACHC,mBAAmB,EAAG5C,oBAAoB,EAAEuB,EAAI;IAChDsB,QAAQ,EAAG3B;EAAe,CAC1B,CACa,CAEf,CAAC;AAEL,CAAC,EACD,8BACD,CAAC;AAED,IAAA4B,gBAAS,EACR,kBAAkB,EAClB,mCAAmC,EACnCtD,4BACD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _react = require("react");
|
|
4
4
|
var _compose = require("@wordpress/compose");
|
|
5
5
|
var _hooks = require("@wordpress/hooks");
|
|
6
6
|
/**
|
|
@@ -16,7 +16,7 @@ const withWideWidgetDisplay = (0, _compose.createHigherOrderComponent)(BlockEdit
|
|
|
16
16
|
idBase
|
|
17
17
|
} = props.attributes;
|
|
18
18
|
const isWide = (_wp$customize$Widgets = wp.customize.Widgets.data.availableWidgets.find(widget => widget.id_base === idBase)?.is_wide) !== null && _wp$customize$Widgets !== void 0 ? _wp$customize$Widgets : false;
|
|
19
|
-
return (0,
|
|
19
|
+
return (0, _react.createElement)(BlockEdit, {
|
|
20
20
|
...props,
|
|
21
21
|
isWide: isWide
|
|
22
22
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","_hooks","wp","window","withWideWidgetDisplay","createHigherOrderComponent","BlockEdit","props","_wp$customize$Widgets","idBase","attributes","isWide","customize","Widgets","data","availableWidgets","find","widget","id_base","is_wide","
|
|
1
|
+
{"version":3,"names":["_compose","require","_hooks","wp","window","withWideWidgetDisplay","createHigherOrderComponent","BlockEdit","props","_wp$customize$Widgets","idBase","attributes","isWide","customize","Widgets","data","availableWidgets","find","widget","id_base","is_wide","_react","createElement","addFilter"],"sources":["@wordpress/customize-widgets/src/filters/wide-widget-display.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\nconst { wp } = window;\n\nconst withWideWidgetDisplay = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { idBase } = props.attributes;\n\t\tconst isWide =\n\t\t\twp.customize.Widgets.data.availableWidgets.find(\n\t\t\t\t( widget ) => widget.id_base === idBase\n\t\t\t)?.is_wide ?? false;\n\n\t\treturn <BlockEdit { ...props } isWide={ isWide } />;\n\t},\n\t'withWideWidgetDisplay'\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/customize-widgets/wide-widget-display',\n\twithWideWidgetDisplay\n);\n"],"mappings":";;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAM;EAAEE;AAAG,CAAC,GAAGC,MAAM;AAErB,MAAMC,qBAAqB,GAAG,IAAAC,mCAA0B,EACrDC,SAAS,IAAQC,KAAK,IAAM;EAAA,IAAAC,qBAAA;EAC7B,MAAM;IAAEC;EAAO,CAAC,GAAGF,KAAK,CAACG,UAAU;EACnC,MAAMC,MAAM,IAAAH,qBAAA,GACXN,EAAE,CAACU,SAAS,CAACC,OAAO,CAACC,IAAI,CAACC,gBAAgB,CAACC,IAAI,CAC5CC,MAAM,IAAMA,MAAM,CAACC,OAAO,KAAKT,MAClC,CAAC,EAAEU,OAAO,cAAAX,qBAAA,cAAAA,qBAAA,GAAI,KAAK;EAEpB,OAAO,IAAAY,MAAA,CAAAC,aAAA,EAACf,SAAS;IAAA,GAAMC,KAAK;IAAGI,MAAM,EAAGA;EAAQ,CAAE,CAAC;AACpD,CAAC,EACD,uBACD,CAAC;AAED,IAAAW,gBAAS,EACR,kBAAkB,EAClB,4CAA4C,EAC5ClB,qBACD,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "store", {
|
|
|
11
11
|
return _store.store;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
+
var _react = require("react");
|
|
14
15
|
var _element = require("@wordpress/element");
|
|
15
16
|
var _blockLibrary = require("@wordpress/block-library");
|
|
16
17
|
var _widgets = require("@wordpress/widgets");
|
|
@@ -78,7 +79,7 @@ function initialize(editorName, blockEditorSettings) {
|
|
|
78
79
|
sidebarControls.push(control);
|
|
79
80
|
}
|
|
80
81
|
});
|
|
81
|
-
(0, _element.createRoot)(container).render((0,
|
|
82
|
+
(0, _element.createRoot)(container).render((0, _react.createElement)(_customizeWidgets.default, {
|
|
82
83
|
api: wp.customize,
|
|
83
84
|
sidebarControls: sidebarControls,
|
|
84
85
|
blockEditorSettings: blockEditorSettings
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_blockLibrary","_widgets","_blocks","_data","_preferences","_customizeWidgets","_interopRequireDefault","_sidebarSection","_sidebarControl","_store","wp","window","DISABLED_BLOCKS","ENABLE_EXPERIMENTAL_FSE_BLOCKS","initialize","editorName","blockEditorSettings","dispatch","preferencesStore","setDefaults","fixedToolbar","welcomeGuide","blocksStore","reapplyBlockTypeFilters","coreBlocks","__experimentalGetCoreBlocks","filter","block","includes","name","startsWith","registerCoreBlocks","registerLegacyWidgetBlock","process","env","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","registerLegacyWidgetVariations","registerWidgetGroupBlock","setFreeformContentHandlerName","SidebarControl","getSidebarControl","customize","sectionConstructor","sidebar","getSidebarSection","controlConstructor","sidebar_block_editor","container","document","createElement","body","appendChild","bind","sidebarControls","control","each","push","createRoot","render","default","api"],"sources":["@wordpress/customize-widgets/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRoot } from '@wordpress/element';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterLegacyWidgetVariations,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tsetFreeformContentHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport CustomizeWidgets from './components/customize-widgets';\nimport getSidebarSection from './controls/sidebar-section';\nimport getSidebarControl from './controls/sidebar-control';\nimport './filters';\n\nconst { wp } = window;\n\nconst DISABLED_BLOCKS = [\n\t'core/more',\n\t'core/block',\n\t'core/freeform',\n\t'core/template-part',\n];\nconst ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;\n\n/**\n * Initializes the widgets block editor in the customizer.\n *\n * @param {string} editorName The editor name.\n * @param {Object} blockEditorSettings Block editor settings.\n */\nexport function initialize( editorName, blockEditorSettings ) {\n\tdispatch( preferencesStore ).setDefaults( 'core/customize-widgets', {\n\t\tfixedToolbar: false,\n\t\twelcomeGuide: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter( ( block ) => {\n\t\treturn ! (\n\t\t\tDISABLED_BLOCKS.includes( block.name ) ||\n\t\t\tblock.name.startsWith( 'core/post' ) ||\n\t\t\tblock.name.startsWith( 'core/query' ) ||\n\t\t\tblock.name.startsWith( 'core/site' ) ||\n\t\t\tblock.name.startsWith( 'core/navigation' )\n\t\t);\n\t} );\n\tregisterCoreBlocks( coreBlocks );\n\tregisterLegacyWidgetBlock();\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS,\n\t\t} );\n\t}\n\tregisterLegacyWidgetVariations( blockEditorSettings );\n\tregisterWidgetGroupBlock();\n\n\t// As we are unregistering `core/freeform` to avoid the Classic block, we must\n\t// replace it with something as the default freeform content handler. Failure to\n\t// do this will result in errors in the default block parser.\n\t// see: https://github.com/WordPress/gutenberg/issues/33097\n\tsetFreeformContentHandlerName( 'core/html' );\n\n\tconst SidebarControl = getSidebarControl( blockEditorSettings );\n\n\twp.customize.sectionConstructor.sidebar = getSidebarSection();\n\twp.customize.controlConstructor.sidebar_block_editor = SidebarControl;\n\n\tconst container = document.createElement( 'div' );\n\tdocument.body.appendChild( container );\n\n\twp.customize.bind( 'ready', () => {\n\t\tconst sidebarControls = [];\n\t\twp.customize.control.each( ( control ) => {\n\t\t\tif ( control instanceof SidebarControl ) {\n\t\t\t\tsidebarControls.push( control );\n\t\t\t}\n\t\t} );\n\n\t\tcreateRoot( container ).render(\n\t\t\t<CustomizeWidgets\n\t\t\t\tapi={ wp.customize }\n\t\t\t\tsidebarControls={ sidebarControls }\n\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t/>\n\t\t);\n\t} );\n}\nexport { store } from './store';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","_blockLibrary","_widgets","_blocks","_data","_preferences","_customizeWidgets","_interopRequireDefault","_sidebarSection","_sidebarControl","_store","wp","window","DISABLED_BLOCKS","ENABLE_EXPERIMENTAL_FSE_BLOCKS","initialize","editorName","blockEditorSettings","dispatch","preferencesStore","setDefaults","fixedToolbar","welcomeGuide","blocksStore","reapplyBlockTypeFilters","coreBlocks","__experimentalGetCoreBlocks","filter","block","includes","name","startsWith","registerCoreBlocks","registerLegacyWidgetBlock","process","env","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","registerLegacyWidgetVariations","registerWidgetGroupBlock","setFreeformContentHandlerName","SidebarControl","getSidebarControl","customize","sectionConstructor","sidebar","getSidebarSection","controlConstructor","sidebar_block_editor","container","document","createElement","body","appendChild","bind","sidebarControls","control","each","push","createRoot","render","_react","default","api"],"sources":["@wordpress/customize-widgets/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRoot } from '@wordpress/element';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterLegacyWidgetVariations,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tsetFreeformContentHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport CustomizeWidgets from './components/customize-widgets';\nimport getSidebarSection from './controls/sidebar-section';\nimport getSidebarControl from './controls/sidebar-control';\nimport './filters';\n\nconst { wp } = window;\n\nconst DISABLED_BLOCKS = [\n\t'core/more',\n\t'core/block',\n\t'core/freeform',\n\t'core/template-part',\n];\nconst ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;\n\n/**\n * Initializes the widgets block editor in the customizer.\n *\n * @param {string} editorName The editor name.\n * @param {Object} blockEditorSettings Block editor settings.\n */\nexport function initialize( editorName, blockEditorSettings ) {\n\tdispatch( preferencesStore ).setDefaults( 'core/customize-widgets', {\n\t\tfixedToolbar: false,\n\t\twelcomeGuide: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter( ( block ) => {\n\t\treturn ! (\n\t\t\tDISABLED_BLOCKS.includes( block.name ) ||\n\t\t\tblock.name.startsWith( 'core/post' ) ||\n\t\t\tblock.name.startsWith( 'core/query' ) ||\n\t\t\tblock.name.startsWith( 'core/site' ) ||\n\t\t\tblock.name.startsWith( 'core/navigation' )\n\t\t);\n\t} );\n\tregisterCoreBlocks( coreBlocks );\n\tregisterLegacyWidgetBlock();\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS,\n\t\t} );\n\t}\n\tregisterLegacyWidgetVariations( blockEditorSettings );\n\tregisterWidgetGroupBlock();\n\n\t// As we are unregistering `core/freeform` to avoid the Classic block, we must\n\t// replace it with something as the default freeform content handler. Failure to\n\t// do this will result in errors in the default block parser.\n\t// see: https://github.com/WordPress/gutenberg/issues/33097\n\tsetFreeformContentHandlerName( 'core/html' );\n\n\tconst SidebarControl = getSidebarControl( blockEditorSettings );\n\n\twp.customize.sectionConstructor.sidebar = getSidebarSection();\n\twp.customize.controlConstructor.sidebar_block_editor = SidebarControl;\n\n\tconst container = document.createElement( 'div' );\n\tdocument.body.appendChild( container );\n\n\twp.customize.bind( 'ready', () => {\n\t\tconst sidebarControls = [];\n\t\twp.customize.control.each( ( control ) => {\n\t\t\tif ( control instanceof SidebarControl ) {\n\t\t\t\tsidebarControls.push( control );\n\t\t\t}\n\t\t} );\n\n\t\tcreateRoot( container ).render(\n\t\t\t<CustomizeWidgets\n\t\t\t\tapi={ wp.customize }\n\t\t\t\tsidebarControls={ sidebarControls }\n\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t/>\n\t\t);\n\t} );\n}\nexport { store } from './store';\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAH,OAAA;AAIA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,iBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,eAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,eAAA,GAAAF,sBAAA,CAAAP,OAAA;AACAA,OA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AC,qCAA6B,EAAE,WAAY,CAAC;EAE5C,MAAMC,cAAc,GAAG,IAAAC,uBAAiB,EAAE1B,mBAAoB,CAAC;EAE/DN,EAAE,CAACiC,SAAS,CAACC,kBAAkB,CAACC,OAAO,GAAG,IAAAC,uBAAiB,EAAC,CAAC;EAC7DpC,EAAE,CAACiC,SAAS,CAACI,kBAAkB,CAACC,oBAAoB,GAAGP,cAAc;EAErE,MAAMQ,SAAS,GAAGC,QAAQ,CAACC,aAAa,CAAE,KAAM,CAAC;EACjDD,QAAQ,CAACE,IAAI,CAACC,WAAW,CAAEJ,SAAU,CAAC;EAEtCvC,EAAE,CAACiC,SAAS,CAACW,IAAI,CAAE,OAAO,EAAE,MAAM;IACjC,MAAMC,eAAe,GAAG,EAAE;IAC1B7C,EAAE,CAACiC,SAAS,CAACa,OAAO,CAACC,IAAI,CAAID,OAAO,IAAM;MACzC,IAAKA,OAAO,YAAYf,cAAc,EAAG;QACxCc,eAAe,CAACG,IAAI,CAAEF,OAAQ,CAAC;MAChC;IACD,CAAE,CAAC;IAEH,IAAAG,mBAAU,EAAEV,SAAU,CAAC,CAACW,MAAM,CAC7B,IAAAC,MAAA,CAAAV,aAAA,EAAC9C,iBAAA,CAAAyD,OAAgB;MAChBC,GAAG,EAAGrD,EAAE,CAACiC,SAAW;MACpBY,eAAe,EAAGA,eAAiB;MACnCvC,mBAAmB,EAAGA;IAAqB,CAC3C,CACF,CAAC;EACF,CAAE,CAAC;AACJ"}
|
package/build/store/actions.js
CHANGED
|
@@ -16,11 +16,11 @@ exports.setIsInserterOpened = setIsInserterOpened;
|
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
18
|
* ```js
|
|
19
|
+
* import { useState } from 'react';
|
|
19
20
|
* import { store as customizeWidgetsStore } from '@wordpress/customize-widgets';
|
|
20
21
|
* import { __ } from '@wordpress/i18n';
|
|
21
22
|
* import { useDispatch } from '@wordpress/data';
|
|
22
23
|
* import { Button } from '@wordpress/components';
|
|
23
|
-
* import { useState } from '@wordpress/element';
|
|
24
24
|
*
|
|
25
25
|
* const ExampleComponent = () => {
|
|
26
26
|
* const { setIsInserterOpened } = useDispatch( customizeWidgetsStore );
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["setIsInserterOpened","value","type"],"sources":["@wordpress/customize-widgets/src/store/actions.js"],"sourcesContent":["/**\n * Returns an action object used to open/close the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @example\n * ```js\n * import {
|
|
1
|
+
{"version":3,"names":["setIsInserterOpened","value","type"],"sources":["@wordpress/customize-widgets/src/store/actions.js"],"sourcesContent":["/**\n * Returns an action object used to open/close the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @example\n * ```js\n * import { useState } from 'react';\n * import { store as customizeWidgetsStore } from '@wordpress/customize-widgets';\n * import { __ } from '@wordpress/i18n';\n * import { useDispatch } from '@wordpress/data';\n * import { Button } from '@wordpress/components';\n *\n * const ExampleComponent = () => {\n * const { setIsInserterOpened } = useDispatch( customizeWidgetsStore );\n * const [ isOpen, setIsOpen ] = useState( false );\n *\n * return (\n * <Button\n * onClick={ () => {\n * setIsInserterOpened( ! isOpen );\n * setIsOpen( ! isOpen );\n * } }\n * >\n * { __( 'Open/close inserter' ) }\n * </Button>\n * );\n * };\n * ```\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,mBAAmBA,CAAEC,KAAK,EAAG;EAC5C,OAAO;IACNC,IAAI,EAAE,wBAAwB;IAC9BD;EACD,CAAC;AACF"}
|