@wordpress/customize-widgets 4.12.0 → 4.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/block-appender/index.js +2 -6
- package/build/components/block-appender/index.js.map +1 -1
- package/build/components/block-inspector-button/index.js +4 -7
- package/build/components/block-inspector-button/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +2 -1
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +1 -1
- package/build/components/keyboard-shortcuts/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/filters/move-to-sidebar.js +2 -1
- package/build/filters/move-to-sidebar.js.map +1 -1
- package/build/filters/wide-widget-display.js +2 -6
- package/build/filters/wide-widget-display.js.map +1 -1
- package/build/{private-apis.js → lock-unlock.js} +1 -1
- package/build/lock-unlock.js.map +1 -0
- package/build-module/components/block-appender/index.js +2 -3
- package/build-module/components/block-appender/index.js.map +1 -1
- package/build-module/components/block-inspector-button/index.js +4 -4
- package/build-module/components/block-inspector-button/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +2 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +1 -1
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/sidebar-block-editor/sidebar-editor-provider.js +1 -1
- package/build-module/components/sidebar-block-editor/sidebar-editor-provider.js.map +1 -1
- package/build-module/filters/move-to-sidebar.js +2 -1
- package/build-module/filters/move-to-sidebar.js.map +1 -1
- package/build-module/filters/wide-widget-display.js +2 -3
- package/build-module/filters/wide-widget-display.js.map +1 -1
- package/build-module/{private-apis.js → lock-unlock.js} +1 -1
- package/build-module/lock-unlock.js.map +1 -0
- package/build-style/style-rtl.css +25 -0
- package/build-style/style.css +25 -0
- package/package.json +22 -22
- package/src/components/keyboard-shortcuts/index.js +1 -1
- package/src/components/sidebar-block-editor/sidebar-editor-provider.js +1 -1
- package/src/style.scss +31 -0
- package/build/private-apis.js.map +0 -1
- package/build-module/private-apis.js.map +0 -1
- /package/src/{private-apis.js → lock-unlock.js} +0 -0
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -9,8 +7,6 @@ exports.default = BlockAppender;
|
|
|
9
7
|
|
|
10
8
|
var _element = require("@wordpress/element");
|
|
11
9
|
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
10
|
var _blockEditor = require("@wordpress/block-editor");
|
|
15
11
|
|
|
16
12
|
var _data = require("@wordpress/data");
|
|
@@ -34,8 +30,8 @@ function BlockAppender(props) {
|
|
|
34
30
|
}
|
|
35
31
|
}
|
|
36
32
|
}, [isBlocksListEmpty]);
|
|
37
|
-
return (0, _element.createElement)(_blockEditor.ButtonBlockAppender,
|
|
33
|
+
return (0, _element.createElement)(_blockEditor.ButtonBlockAppender, { ...props,
|
|
38
34
|
ref: ref
|
|
39
|
-
})
|
|
35
|
+
});
|
|
40
36
|
}
|
|
41
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/components/block-appender/index.js"],"names":["BlockAppender","props","ref","isBlocksListEmpty","select","blockEditorStore","getBlockCount","current","ownerDocument","activeElement","body","focus"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/components/block-appender/index.js"],"names":["BlockAppender","props","ref","isBlocksListEmpty","select","blockEditorStore","getBlockCount","current","ownerDocument","activeElement","body","focus"],"mappings":";;;;;;;AAGA;;AACA;;AAIA;;AARA;AACA;AACA;AAQe,SAASA,aAAT,CAAwBC,KAAxB,EAAgC;AAC9C,QAAMC,GAAG,GAAG,sBAAZ;AACA,QAAMC,iBAAiB,GAAG,qBACvBC,MAAF,IAAcA,MAAM,CAAEC,kBAAF,CAAN,CAA2BC,aAA3B,OAA+C,CADpC,CAA1B,CAF8C,CAM9C;AACA;;AACA,0BAAW,MAAM;AAChB,QAAKH,iBAAiB,IAAID,GAAG,CAACK,OAA9B,EAAwC;AACvC,YAAM;AAAEC,QAAAA;AAAF,UAAoBN,GAAG,CAACK,OAA9B;;AAEA,UACC,CAAEC,aAAa,CAACC,aAAhB,IACAD,aAAa,CAACC,aAAd,KAAgCD,aAAa,CAACE,IAF/C,EAGE;AACDR,QAAAA,GAAG,CAACK,OAAJ,CAAYI,KAAZ;AACA;AACD;AACD,GAXD,EAWG,CAAER,iBAAF,CAXH;AAaA,SAAO,4BAAC,gCAAD,OAA0BF,KAA1B;AAAkC,IAAA,GAAG,EAAGC;AAAxC,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport {\n\tButtonBlockAppender,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\n\nexport default function BlockAppender( props ) {\n\tconst ref = useRef();\n\tconst isBlocksListEmpty = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlockCount() === 0\n\t);\n\n\t// Move the focus to the block appender to prevent focus from\n\t// being lost when emptying the widget area.\n\tuseEffect( () => {\n\t\tif ( isBlocksListEmpty && ref.current ) {\n\t\t\tconst { ownerDocument } = ref.current;\n\n\t\t\tif (\n\t\t\t\t! ownerDocument.activeElement ||\n\t\t\t\townerDocument.activeElement === ownerDocument.body\n\t\t\t) {\n\t\t\t\tref.current.focus();\n\t\t\t}\n\t\t}\n\t}, [ isBlocksListEmpty ] );\n\n\treturn <ButtonBlockAppender { ...props } ref={ ref } />;\n}\n"]}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -9,8 +7,6 @@ exports.default = void 0;
|
|
|
9
7
|
|
|
10
8
|
var _element = require("@wordpress/element");
|
|
11
9
|
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
10
|
var _i18n = require("@wordpress/i18n");
|
|
15
11
|
|
|
16
12
|
var _components = require("@wordpress/components");
|
|
@@ -29,7 +25,7 @@ function BlockInspectorButton({
|
|
|
29
25
|
}) {
|
|
30
26
|
const selectedBlockClientId = (0, _data.useSelect)(select => select(_blockEditor.store).getSelectedBlockClientId(), []);
|
|
31
27
|
const selectedBlock = (0, _element.useMemo)(() => document.getElementById(`block-${selectedBlockClientId}`), [selectedBlockClientId]);
|
|
32
|
-
return (0, _element.createElement)(_components.MenuItem,
|
|
28
|
+
return (0, _element.createElement)(_components.MenuItem, {
|
|
33
29
|
onClick: () => {
|
|
34
30
|
// Open the inspector.
|
|
35
31
|
inspector.open({
|
|
@@ -37,8 +33,9 @@ function BlockInspectorButton({
|
|
|
37
33
|
}); // Then close the dropdown menu.
|
|
38
34
|
|
|
39
35
|
closeMenu();
|
|
40
|
-
}
|
|
41
|
-
|
|
36
|
+
},
|
|
37
|
+
...props
|
|
38
|
+
}, (0, _i18n.__)('Show more settings'));
|
|
42
39
|
}
|
|
43
40
|
|
|
44
41
|
var _default = BlockInspectorButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/components/block-inspector-button/index.js"],"names":["BlockInspectorButton","inspector","closeMenu","props","selectedBlockClientId","select","blockEditorStore","getSelectedBlockClientId","selectedBlock","document","getElementById","open","returnFocusWhenClose"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/components/block-inspector-button/index.js"],"names":["BlockInspectorButton","inspector","closeMenu","props","selectedBlockClientId","select","blockEditorStore","getSelectedBlockClientId","selectedBlock","document","getElementById","open","returnFocusWhenClose"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAPA;AACA;AACA;AAOA,SAASA,oBAAT,CAA+B;AAAEC,EAAAA,SAAF;AAAaC,EAAAA,SAAb;AAAwB,KAAGC;AAA3B,CAA/B,EAAoE;AACnE,QAAMC,qBAAqB,GAAG,qBAC3BC,MAAF,IAAcA,MAAM,CAAEC,kBAAF,CAAN,CAA2BC,wBAA3B,EADe,EAE7B,EAF6B,CAA9B;AAKA,QAAMC,aAAa,GAAG,sBACrB,MAAMC,QAAQ,CAACC,cAAT,CAA0B,SAASN,qBAAuB,EAA1D,CADe,EAErB,CAAEA,qBAAF,CAFqB,CAAtB;AAKA,SACC,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACf;AACAH,MAAAA,SAAS,CAACU,IAAV,CAAgB;AACfC,QAAAA,oBAAoB,EAAEJ;AADP,OAAhB,EAFe,CAKf;;AACAN,MAAAA,SAAS;AACT,KARF;AAAA,OASMC;AATN,KAWG,cAAI,oBAAJ,CAXH,CADD;AAeA;;eAEcH,oB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction BlockInspectorButton( { inspector, closeMenu, ...props } ) {\n\tconst selectedBlockClientId = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSelectedBlockClientId(),\n\t\t[]\n\t);\n\n\tconst selectedBlock = useMemo(\n\t\t() => document.getElementById( `block-${ selectedBlockClientId }` ),\n\t\t[ selectedBlockClientId ]\n\t);\n\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\t// Open the inspector.\n\t\t\t\tinspector.open( {\n\t\t\t\t\treturnFocusWhenClose: selectedBlock,\n\t\t\t\t} );\n\t\t\t\t// Then close the dropdown menu.\n\t\t\t\tcloseMenu();\n\t\t\t} }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ __( 'Show more settings' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default BlockInspectorButton;\n"]}
|
|
@@ -53,7 +53,8 @@ const ShortcutList = ({
|
|
|
53
53
|
key: index
|
|
54
54
|
}, typeof shortcut === 'string' ? (0, _element.createElement)(_dynamicShortcut.default, {
|
|
55
55
|
name: shortcut
|
|
56
|
-
}) : (0, _element.createElement)(_shortcut.default, shortcut
|
|
56
|
+
}) : (0, _element.createElement)(_shortcut.default, { ...shortcut
|
|
57
|
+
}))))
|
|
57
58
|
/* eslint-enable jsx-a11y/no-redundant-roles */
|
|
58
59
|
;
|
|
59
60
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/components/keyboard-shortcut-help-modal/index.js"],"names":["ShortcutList","shortcuts","map","shortcut","index","ShortcutSection","title","className","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","keyboardShortcutsStore","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","registerShortcut","name","category","description","keyCombination","modifier","character","ariaLabel","textFormattingShortcuts"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAIA;;AAKA;;AACA;;AACA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AAKA,MAAMA,YAAY,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF;AACpB;AACD;AACA;AACA;;AACC;AACA;AACC,EAAA,SAAS,EAAC,+DADX;AAEC,EAAA,IAAI,EAAC;AAFN,GAIGA,SAAS,CAACC,GAAV,CAAe,CAAEC,QAAF,EAAYC,KAAZ,KAChB;AACC,EAAA,SAAS,EAAC,0DADX;AAEC,EAAA,GAAG,EAAGA;AAFP,GAIG,OAAOD,QAAP,KAAoB,QAApB,GACD,4BAAC,wBAAD;AAAiB,EAAA,IAAI,EAAGA;AAAxB,EADC,GAGD,4BAAC,iBAAD,
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/components/keyboard-shortcut-help-modal/index.js"],"names":["ShortcutList","shortcuts","map","shortcut","index","ShortcutSection","title","className","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","keyboardShortcutsStore","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","registerShortcut","name","category","description","keyCombination","modifier","character","ariaLabel","textFormattingShortcuts"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAIA;;AAKA;;AACA;;AACA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AAKA,MAAMA,YAAY,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF;AACpB;AACD;AACA;AACA;;AACC;AACA;AACC,EAAA,SAAS,EAAC,+DADX;AAEC,EAAA,IAAI,EAAC;AAFN,GAIGA,SAAS,CAACC,GAAV,CAAe,CAAEC,QAAF,EAAYC,KAAZ,KAChB;AACC,EAAA,SAAS,EAAC,0DADX;AAEC,EAAA,GAAG,EAAGA;AAFP,GAIG,OAAOD,QAAP,KAAoB,QAApB,GACD,4BAAC,wBAAD;AAAiB,EAAA,IAAI,EAAGA;AAAxB,EADC,GAGD,4BAAC,iBAAD,OAAeA;AAAf,EAPF,CADC,CAJH;AAiBA;AAvBD;;AA0BA,MAAME,eAAe,GAAG,CAAE;AAAEC,EAAAA,KAAF;AAASL,EAAAA,SAAT;AAAoBM,EAAAA;AAApB,CAAF,KACvB;AACC,EAAA,SAAS,EAAG,yBACX,yDADW,EAEXA,SAFW;AADb,GAMG,CAAC,CAAED,KAAH,IACD;AAAI,EAAA,SAAS,EAAC;AAAd,GACGA,KADH,CA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D;AACC,IAAA,KAAK,EAAG,cAAI,kBAAJ,CADT;AAEC,IAAA,YAAY,EAAC;AAFd,IATD,EAcC,4BAAC,uBAAD;AACC,IAAA,KAAK,EAAG,cAAI,qBAAJ,CADT;AAEC,IAAA,YAAY,EAAC;AAFd,IAdD,EAmBC,4BAAC,uBAAD;AACC,IAAA,KAAK,EAAG,cAAI,iBAAJ,CADT;AAEC,IAAA,YAAY,EAAC,OAFd;AAGC,IAAA,mBAAmB,EAAG,CACrB;AACCK,MAAAA,cAAc,EAAE;AAAEE,QAAAA,SAAS,EAAE;AAAb,OADjB;AAECH,MAAAA,WAAW,EAAE,cACZ,qDADY,CAFd;;AAKC;AACAI,MAAAA,SAAS,EAAE,cAAI,eAAJ;AANZ,KADqB;AAHvB,IAnBD,EAiCC,4BAAC,eAAD;AACC,IAAA,KAAK,EAAG,cAAI,iBAAJ,CADT;AAEC,IAAA,SAAS,EAAGC;AAFb,IAjCD,CADD;AAwCA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { textFormattingShortcuts } from './config';\nimport Shortcut from './shortcut';\nimport DynamicShortcut from './dynamic-shortcut';\n\nconst ShortcutList = ( { shortcuts } ) => (\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t<ul\n\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal__shortcut-list\"\n\t\trole=\"list\"\n\t>\n\t\t{ shortcuts.map( ( shortcut, index ) => (\n\t\t\t<li\n\t\t\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal__shortcut\"\n\t\t\t\tkey={ index }\n\t\t\t>\n\t\t\t\t{ typeof shortcut === 'string' ? (\n\t\t\t\t\t<DynamicShortcut name={ shortcut } />\n\t\t\t\t) : (\n\t\t\t\t\t<Shortcut { ...shortcut } />\n\t\t\t\t) }\n\t\t\t</li>\n\t\t) ) }\n\t</ul>\n\t/* eslint-enable jsx-a11y/no-redundant-roles */\n);\n\nconst ShortcutSection = ( { title, shortcuts, className } ) => (\n\t<section\n\t\tclassName={ classnames(\n\t\t\t'customize-widgets-keyboard-shortcut-help-modal__section',\n\t\t\tclassName\n\t\t) }\n\t>\n\t\t{ !! title && (\n\t\t\t<h2 className=\"customize-widgets-keyboard-shortcut-help-modal__section-title\">\n\t\t\t\t{ title }\n\t\t\t</h2>\n\t\t) }\n\t\t<ShortcutList shortcuts={ shortcuts } />\n\t</section>\n);\n\nconst ShortcutCategorySection = ( {\n\ttitle,\n\tcategoryName,\n\tadditionalShortcuts = [],\n} ) => {\n\tconst categoryShortcuts = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( keyboardShortcutsStore ).getCategoryShortcuts(\n\t\t\t\tcategoryName\n\t\t\t);\n\t\t},\n\t\t[ categoryName ]\n\t);\n\n\treturn (\n\t\t<ShortcutSection\n\t\t\ttitle={ title }\n\t\t\tshortcuts={ categoryShortcuts.concat( additionalShortcuts ) }\n\t\t/>\n\t);\n};\n\nexport default function KeyboardShortcutHelpModal( {\n\tisModalActive,\n\ttoggleModal,\n} ) {\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tregisterShortcut( {\n\t\tname: 'core/customize-widgets/keyboard-shortcuts',\n\t\tcategory: 'main',\n\t\tdescription: __( 'Display these keyboard shortcuts.' ),\n\t\tkeyCombination: {\n\t\t\tmodifier: 'access',\n\t\t\tcharacter: 'h',\n\t\t},\n\t} );\n\n\tuseShortcut( 'core/customize-widgets/keyboard-shortcuts', toggleModal );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal\"\n\t\t\ttitle={ __( 'Keyboard shortcuts' ) }\n\t\t\tonRequestClose={ toggleModal }\n\t\t>\n\t\t\t<ShortcutSection\n\t\t\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/customize-widgets/keyboard-shortcuts' ] }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Global shortcuts' ) }\n\t\t\t\tcategoryName=\"global\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Selection shortcuts' ) }\n\t\t\t\tcategoryName=\"selection\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Block shortcuts' ) }\n\t\t\t\tcategoryName=\"block\"\n\t\t\t\tadditionalShortcuts={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyCombination: { character: '/' },\n\t\t\t\t\t\tdescription: __(\n\t\t\t\t\t\t\t'Change the block type after adding a new paragraph.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t/* translators: The forward-slash character. e.g. '/'. */\n\t\t\t\t\t\tariaLabel: __( 'Forward-slash' ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t\t<ShortcutSection\n\t\t\t\ttitle={ __( 'Text formatting' ) }\n\t\t\t\tshortcuts={ textFormattingShortcuts }\n\t\t\t/>\n\t\t</Modal>\n\t);\n}\n"]}
|
|
@@ -127,7 +127,7 @@ function KeyboardShortcutsRegister() {
|
|
|
127
127
|
}
|
|
128
128
|
});
|
|
129
129
|
registerShortcut({
|
|
130
|
-
name:
|
|
130
|
+
name: 'core/customize-widgets/transform-heading-to-paragraph',
|
|
131
131
|
category: 'block-library',
|
|
132
132
|
description: (0, _i18n.__)('Transform heading to paragraph.'),
|
|
133
133
|
keyCombination: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/components/keyboard-shortcuts/index.js"],"names":["KeyboardShortcuts","undo","redo","save","replaceBlocks","blockEditorStore","getBlockName","getSelectedBlockClientId","getBlockAttributes","handleTextLevelShortcut","event","level","preventDefault","destinationBlockName","currentClientId","blockName","attributes","textAlign","destinationTextAlign","content","forEach","KeyboardShortcutsRegister","registerShortcut","unregisterShortcut","keyboardShortcutsStore","name","category","description","keyCombination","modifier","character","aliases","Register"],"mappings":";;;;;;;AAGA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AAZA;AACA;AACA;AAYA,SAASA,iBAAT,CAA4B;AAAEC,EAAAA,IAAF;AAAQC,EAAAA,IAAR;AAAcC,EAAAA;AAAd,CAA5B,EAAmD;AAClD,QAAM;AAAEC,IAAAA;AAAF,MAAoB,uBAAaC,kBAAb,CAA1B;AACA,QAAM;AAAEC,IAAAA,YAAF;AAAgBC,IAAAA,wBAAhB;AAA0CC,IAAAA;AAA1C,MACL,qBAAWH,kBAAX,CADD;;AAGA,QAAMI,uBAAuB,GAAG,CAAEC,KAAF,EAASC,KAAT,KAAoB;AACnDD,IAAAA,KAAK,CAACE,cAAN;AACA,UAAMC,oBAAoB,GACzBF,KAAK,KAAK,CAAV,GAAc,gBAAd,GAAiC,cADlC;AAEA,UAAMG,eAAe,GAAGP,wBAAwB,EAAhD;;AACA,QAAKO,eAAe,KAAK,IAAzB,EAAgC;AAC/B;AACA;;AACD,UAAMC,SAAS,GAAGT,YAAY,CAAEQ,eAAF,CAA9B;;AACA,QAAKC,SAAS,KAAK,gBAAd,IAAkCA,SAAS,KAAK,cAArD,EAAsE;AACrE;AACA;;AACD,UAAMC,UAAU,GAAGR,kBAAkB,CAAEM,eAAF,CAArC;AACA,UAAMG,SAAS,GACdF,SAAS,KAAK,gBAAd,GAAiC,OAAjC,GAA2C,WAD5C;AAEA,UAAMG,oBAAoB,GACzBL,oBAAoB,KAAK,gBAAzB,GAA4C,OAA5C,GAAsD,WADvD;AA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AAAA,SAAS,EAAE;AAFI;AAJC,KAAF,CAAhB;AAUAR,IAAAA,gBAAgB,CAAE;AACjBG,MAAAA,IAAI,EAAE,6BADW;AAEjBC,MAAAA,QAAQ,EAAE,QAFO;AAGjBC,MAAAA,WAAW,EAAE,cAAI,sBAAJ,CAHI;AAIjBC,MAAAA,cAAc,EAAE;AACfC,QAAAA,QAAQ,EAAE,cADK;AAEfC,QAAAA,SAAS,EAAE;AAFI,OAJC;AAQjB;AACA;AACA;AACA;AACAC,MAAAA,OAAO,EAAE,6BACN,EADM,GAEN,CACA;AACCF,QAAAA,QAAQ,EAAE,SADX;AAECC,QAAAA,SAAS,EAAE;AAFZ,OADA;AAdc,KAAF,CAAhB;AAsBAR,IAAAA,gBAAgB,CAAE;AACjBG,MAAAA,IAAI,EAAE,6BADW;AAEjBC,MAAAA,QAAQ,EAAE,QAFO;AAGjBC,MAAAA,WAAW,EAAE,cAAI,oBAAJ,CAHI;AAIjBC,MAAAA,cAAc,EAAE;AACfC,QAAAA,QAAQ,EAAE,SADK;AAEfC,QAAAA,SAAS,EAAE;AAFI;AAJC,KAAF,CAAhB;AAUAR,IAAAA,gBAAgB,CAAE;AACjBG,MAAAA,IAAI,
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/components/keyboard-shortcuts/index.js"],"names":["KeyboardShortcuts","undo","redo","save","replaceBlocks","blockEditorStore","getBlockName","getSelectedBlockClientId","getBlockAttributes","handleTextLevelShortcut","event","level","preventDefault","destinationBlockName","currentClientId","blockName","attributes","textAlign","destinationTextAlign","content","forEach","KeyboardShortcutsRegister","registerShortcut","unregisterShortcut","keyboardShortcutsStore","name","category","description","keyCombination","modifier","character","aliases","Register"],"mappings":";;;;;;;AAGA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AAZA;AACA;AACA;AAYA,SAASA,iBAAT,CAA4B;AAAEC,EAAAA,IAAF;AAAQC,EAAAA,IAAR;AAAcC,EAAAA;AAAd,CAA5B,EAAmD;AACl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{\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\n\nfunction KeyboardShortcuts( { undo, redo, save } ) {\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { getBlockName, getSelectedBlockClientId, getBlockAttributes } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst handleTextLevelShortcut = ( event, level ) => {\n\t\tevent.preventDefault();\n\t\tconst destinationBlockName =\n\t\t\tlevel === 0 ? 'core/paragraph' : 'core/heading';\n\t\tconst currentClientId = getSelectedBlockClientId();\n\t\tif ( currentClientId === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst blockName = getBlockName( currentClientId );\n\t\tif ( blockName !== 'core/paragraph' && blockName !== 'core/heading' ) {\n\t\t\treturn;\n\t\t}\n\t\tconst attributes = getBlockAttributes( currentClientId );\n\t\tconst textAlign =\n\t\t\tblockName === 'core/paragraph' ? 'align' : 'textAlign';\n\t\tconst destinationTextAlign =\n\t\t\tdestinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';\n\n\t\treplaceBlocks(\n\t\t\tcurrentClientId,\n\t\t\tcreateBlock( destinationBlockName, {\n\t\t\t\tlevel,\n\t\t\t\tcontent: attributes.content,\n\t\t\t\t...{ [ destinationTextAlign ]: attributes[ textAlign ] },\n\t\t\t} )\n\t\t);\n\t};\n\n\tuseShortcut( 'core/customize-widgets/undo', ( event ) => {\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/customize-widgets/redo', ( event ) => {\n\t\tredo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/customize-widgets/save', ( event ) => {\n\t\tevent.preventDefault();\n\t\tsave();\n\t} );\n\n\tuseShortcut(\n\t\t'core/customize-widgets/transform-heading-to-paragraph',\n\t\t( event ) => handleTextLevelShortcut( event, 0 )\n\t);\n\n\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t//the loop is based off on a constant therefore\n\t\t//the hook will execute the same way every time\n\t\t//eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseShortcut(\n\t\t\t`core/customize-widgets/transform-paragraph-to-heading-${ level }`,\n\t\t\t( event ) => handleTextLevelShortcut( event, level )\n\t\t);\n\t} );\n\n\treturn null;\n}\n\nfunction KeyboardShortcutsRegister() {\n\tconst { registerShortcut, unregisterShortcut } = useDispatch(\n\t\tkeyboardShortcutsStore\n\t);\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t\t// Disable on Apple OS because it conflicts with the browser's\n\t\t\t// history shortcut. It's a fine alias for both Windows and Linux.\n\t\t\t// Since there's no conflict for Ctrl+Shift+Z on both Windows and\n\t\t\t// Linux, we keep it as the default for consistency.\n\t\t\taliases: isAppleOS()\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmodifier: 'primary',\n\t\t\t\t\t\t\tcharacter: 'y',\n\t\t\t\t\t\t},\n\t\t\t\t ],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/transform-heading-to-paragraph',\n\t\t\tcategory: 'block-library',\n\t\t\tdescription: __( 'Transform heading to paragraph.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: `0`,\n\t\t\t},\n\t\t} );\n\n\t\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t\tregisterShortcut( {\n\t\t\t\tname: `core/customize-widgets/transform-paragraph-to-heading-${ level }`,\n\t\t\t\tcategory: 'block-library',\n\t\t\t\tdescription: __( 'Transform paragraph to heading.' ),\n\t\t\t\tkeyCombination: {\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: `${ level }`,\n\t\t\t\t},\n\t\t\t} );\n\t\t} );\n\n\t\treturn () => {\n\t\t\tunregisterShortcut( 'core/customize-widgets/undo' );\n\t\t\tunregisterShortcut( 'core/customize-widgets/redo' );\n\t\t\tunregisterShortcut( 'core/customize-widgets/save' );\n\t\t};\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nKeyboardShortcuts.Register = KeyboardShortcutsRegister;\nexport default KeyboardShortcuts;\n"]}
|
|
@@ -15,7 +15,7 @@ var _useSidebarBlockEditor = _interopRequireDefault(require("./use-sidebar-block
|
|
|
15
15
|
|
|
16
16
|
var _useBlocksFocusControl = _interopRequireDefault(require("../focus-control/use-blocks-focus-control"));
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* WordPress dependencies
|
|
@@ -26,7 +26,7 @@ var _privateApis = require("../../private-apis");
|
|
|
26
26
|
*/
|
|
27
27
|
const {
|
|
28
28
|
ExperimentalBlockEditorProvider
|
|
29
|
-
} = (0,
|
|
29
|
+
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
30
30
|
|
|
31
31
|
function SidebarEditorProvider({
|
|
32
32
|
sidebar,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/components/sidebar-block-editor/sidebar-editor-provider.js"],"names":["ExperimentalBlockEditorProvider","blockEditorPrivateApis","SidebarEditorProvider","sidebar","settings","children","blocks","onInput","onChange"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AAEA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAsC,
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/components/sidebar-block-editor/sidebar-editor-provider.js"],"names":["ExperimentalBlockEditorProvider","blockEditorPrivateApis","SidebarEditorProvider","sidebar","settings","children","blocks","onInput","onChange"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AAEA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAsC,wBAAQC,wBAAR,CAA5C;;AAEe,SAASC,qBAAT,CAAgC;AAC9CC,EAAAA,OAD8C;AAE9CC,EAAAA,QAF8C;AAG9CC,EAAAA;AAH8C,CAAhC,EAIX;AACH,QAAM,CAAEC,MAAF,EAAUC,OAAV,EAAmBC,QAAnB,IAAgC,oCAAuBL,OAAvB,CAAtC;AAEA,sCAAuBG,MAAvB;AAEA,SACC,4BAAC,+BAAD;AACC,IAAA,KAAK,EAAGA,MADT;AAEC,IAAA,OAAO,EAAGC,OAFX;AAGC,IAAA,QAAQ,EAAGC,QAHZ;AAIC,IAAA,QAAQ,EAAGJ,QAJZ;AAKC,IAAA,cAAc,EAAG;AALlB,KAOGC,QAPH,CADD;AAWA","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"]}
|
|
@@ -71,7 +71,8 @@ const withMoveToSidebarToolbarItem = (0, _compose.createHigherOrderComponent)(Bl
|
|
|
71
71
|
focusWidget(widgetId);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(BlockEdit, props
|
|
74
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(BlockEdit, { ...props
|
|
75
|
+
}), hasMultipleSidebars && canInsertBlockInSidebar && (0, _element.createElement)(_blockEditor.BlockControls, null, (0, _element.createElement)(_widgets.MoveToWidgetArea, {
|
|
75
76
|
widgetAreas: sidebarControls.map(sidebarControl => ({
|
|
76
77
|
id: sidebarControl.id,
|
|
77
78
|
name: sidebarControl.params.label,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/filters/move-to-sidebar.js"],"names":["withMoveToSidebarToolbarItem","BlockEdit","props","widgetId","sidebarControls","activeSidebarControl","hasMultipleSidebars","length","blockName","name","clientId","canInsertBlockInSidebar","select","blockEditorStore","canInsertBlockType","block","getBlock","removeBlock","focusWidget","moveToSidebar","sidebarControlId","newSidebarControl","find","sidebarControl","id","oldSetting","setting","newSetting","filter","sidebarAdapter","addedWidgetIds","setWidgets","getWidg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BJ,EAAF,IAAUA,EAAE,KAAKrB,QAAtC,CAAF,CAAV;AACAwB,MAAAA,UAAU,CAAE,CAAE,GAAGA,UAAU,EAAf,EAAmBxB,QAAnB,CAAF,CAAV;AACA,KATD,MASO;AACN;AACJ;AACA;AACA;AACA;AACI,YAAM0B,cAAc,GAAGR,iBAAiB,CAACQ,cAAzC;AAEAZ,MAAAA,WAAW,CAAEP,QAAF,CAAX;AACA,YAAMoB,cAAc,GAAGD,cAAc,CAACE,UAAf,CAA2B,CACjD,GAAGF,cAAc,CAACG,UAAf,EAD8C,EAEjD,0BAAejB,KAAf,CAFiD,CAA3B,CAAvB,CATM,CAaN;;AACAZ,MAAAA,QAAQ,GAAG2B,cAAc,CAACG,OAAf,GAAyBX,IAAzB,CAAiCE,EAAF,IAAU,CAAC,CAAEA,EAA5C,CAAX;AACA,KA7ByC,CA+B1C;;;AACAN,IAAAA,WAAW,CAAEf,QAAF,CAAX;AACA;;AAED,SACC,qDACC,4BAAC,SAAD,
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/filters/move-to-sidebar.js"],"names":["withMoveToSidebarToolbarItem","BlockEdit","props","widgetId","sidebarControls","activeSidebarControl","hasMultipleSidebars","length","blockName","name","clientId","canInsertBlockInSidebar","select","blockEditorStore","canInsertBlockType","block","getBlock","removeBlock","focusWidget","moveToSidebar","sidebarControlId","newSidebarControl","find","sidebarControl","id","oldSetting","setting","newSetting","filter","sidebarAdapter","addedWidgetIds","setWidgets","getWidgets","reverse","map","params","label","description"],"mappings":";;;;AAGA;;AAIA;;AACA;;AACA;;AACA;;AAKA;;AAIA;;AACA;;AApBA;AACA;AACA;;AAUA;AACA;AACA;AAQA,MAAMA,4BAA4B,GAAG,yCAClCC,SAAF,IAAmBC,KAAF,IAAa;AAC7B,MAAIC,QAAQ,GAAG,mCAAsBD,KAAtB,CAAf;AACA,QAAME,eAAe,GAAG,0CAAxB;AACA,QAAMC,oBAAoB,GAAG,+CAA7B;AACA,QAAMC,mB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AA2B,CACjD,GAAGF,cAAc,CAACG,UAAf,EAD8C,EAEjD,0BAAejB,KAAf,CAFiD,CAA3B,CAAvB,CATM,CAaN;;AACAZ,MAAAA,QAAQ,GAAG2B,cAAc,CAACG,OAAf,GAAyBX,IAAzB,CAAiCE,EAAF,IAAU,CAAC,CAAEA,EAA5C,CAAX;AACA,KA7ByC,CA+B1C;;;AACAN,IAAAA,WAAW,CAAEf,QAAF,CAAX;AACA;;AAED,SACC,qDACC,4BAAC,SAAD,OAAgBD;AAAhB,IADD,EAEGI,mBAAmB,IAAIK,uBAAvB,IACD,4BAAC,0BAAD,QACC,4BAAC,yBAAD;AACC,IAAA,WAAW,EAAGP,eAAe,CAAC8B,GAAhB,CACXX,cAAF,KAAwB;AACvBC,MAAAA,EAAE,EAAED,cAAc,CAACC,EADI;AAEvBf,MAAAA,IAAI,EAAEc,cAAc,CAACY,MAAf,CAAsBC,KAFL;AAGvBC,MAAAA,WAAW,EACVd,cAAc,CAACY,MAAf,CAAsBE;AAJA,KAAxB,CADa,CADf;AASC,IAAA,mBAAmB,EAAGhC,oBAAoB,EAAEmB,EAT7C;AAUC,IAAA,QAAQ,EAAGL;AAVZ,IADD,CAHF,CADD;AAqBA,CAlFmC,EAmFpC,8BAnFoC,CAArC;AAsFA,sBACC,kBADD,EAEC,mCAFD,EAGCnB,4BAHD","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\naddFilter(\n\t'editor.BlockEdit',\n\t'core/customize-widgets/block-edit',\n\twithMoveToSidebarToolbarItem\n);\n"]}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
var _element = require("@wordpress/element");
|
|
6
4
|
|
|
7
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
|
-
|
|
9
5
|
var _compose = require("@wordpress/compose");
|
|
10
6
|
|
|
11
7
|
var _hooks = require("@wordpress/hooks");
|
|
@@ -23,9 +19,9 @@ const withWideWidgetDisplay = (0, _compose.createHigherOrderComponent)(BlockEdit
|
|
|
23
19
|
idBase
|
|
24
20
|
} = props.attributes;
|
|
25
21
|
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;
|
|
26
|
-
return (0, _element.createElement)(BlockEdit,
|
|
22
|
+
return (0, _element.createElement)(BlockEdit, { ...props,
|
|
27
23
|
isWide: isWide
|
|
28
|
-
})
|
|
24
|
+
});
|
|
29
25
|
}, 'withWideWidgetDisplay');
|
|
30
26
|
(0, _hooks.addFilter)('editor.BlockEdit', 'core/customize-widgets/wide-widget-display', withWideWidgetDisplay);
|
|
31
27
|
//# sourceMappingURL=wide-widget-display.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/filters/wide-widget-display.js"],"names":["wp","window","withWideWidgetDisplay","BlockEdit","props","idBase","attributes","isWide","customize","Widgets","data","availableWidgets","find","widget","id_base","is_wide"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/filters/wide-widget-display.js"],"names":["wp","window","withWideWidgetDisplay","BlockEdit","props","idBase","attributes","isWide","customize","Widgets","data","availableWidgets","find","widget","id_base","is_wide"],"mappings":";;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAASC,MAAf;AAEA,MAAMC,qBAAqB,GAAG,yCAC3BC,SAAF,IAAmBC,KAAF,IAAa;AAAA;;AAC7B,QAAM;AAAEC,IAAAA;AAAF,MAAaD,KAAK,CAACE,UAAzB;AACA,QAAMC,MAAM,4BACXP,EAAE,CAACQ,SAAH,CAAaC,OAAb,CAAqBC,IAArB,CAA0BC,gBAA1B,CAA2CC,IAA3C,CACGC,MAAF,IAAcA,MAAM,CAACC,OAAP,KAAmBT,MADlC,GAEGU,OAHQ,yEAGG,KAHf;AAKA,SAAO,4BAAC,SAAD,OAAgBX,KAAhB;AAAwB,IAAA,MAAM,EAAGG;AAAjC,IAAP;AACA,CAT4B,EAU7B,uBAV6B,CAA9B;AAaA,sBACC,kBADD,EAEC,4CAFD,EAGCL,qBAHD","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"]}
|
|
@@ -16,4 +16,4 @@ const {
|
|
|
16
16
|
} = (0, _privateApis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.', '@wordpress/customize-widgets');
|
|
17
17
|
exports.unlock = unlock;
|
|
18
18
|
exports.lock = lock;
|
|
19
|
-
//# sourceMappingURL=
|
|
19
|
+
//# sourceMappingURL=lock-unlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/lock-unlock.js"],"names":["lock","unlock"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IACZ,mEACC,8GADD,EAEC,8BAFD,CADM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',\n\t\t'@wordpress/customize-widgets'\n\t);\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import { createElement } from "@wordpress/element";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -23,8 +22,8 @@ export default function BlockAppender(props) {
|
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
}, [isBlocksListEmpty]);
|
|
26
|
-
return createElement(ButtonBlockAppender,
|
|
25
|
+
return createElement(ButtonBlockAppender, { ...props,
|
|
27
26
|
ref: ref
|
|
28
|
-
})
|
|
27
|
+
});
|
|
29
28
|
}
|
|
30
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/components/block-appender/index.js"],"names":["useRef","useEffect","ButtonBlockAppender","store","blockEditorStore","useSelect","BlockAppender","props","ref","isBlocksListEmpty","select","getBlockCount","current","ownerDocument","activeElement","body","focus"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/components/block-appender/index.js"],"names":["useRef","useEffect","ButtonBlockAppender","store","blockEditorStore","useSelect","BlockAppender","props","ref","isBlocksListEmpty","select","getBlockCount","current","ownerDocument","activeElement","body","focus"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,EAAiBC,SAAjB,QAAkC,oBAAlC;AACA,SACCC,mBADD,EAECC,KAAK,IAAIC,gBAFV,QAGO,yBAHP;AAIA,SAASC,SAAT,QAA0B,iBAA1B;AAEA,eAAe,SAASC,aAAT,CAAwBC,KAAxB,EAAgC;AAC9C,QAAMC,GAAG,GAAGR,MAAM,EAAlB;AACA,QAAMS,iBAAiB,GAAGJ,SAAS,CAChCK,MAAF,IAAcA,MAAM,CAAEN,gBAAF,CAAN,CAA2BO,aAA3B,OAA+C,CAD3B,CAAnC,CAF8C,CAM9C;AACA;;AACAV,EAAAA,SAAS,CAAE,MAAM;AAChB,QAAKQ,iBAAiB,IAAID,GAAG,CAACI,OAA9B,EAAwC;AACvC,YAAM;AAAEC,QAAAA;AAAF,UAAoBL,GAAG,CAACI,OAA9B;;AAEA,UACC,CAAEC,aAAa,CAACC,aAAhB,IACAD,aAAa,CAACC,aAAd,KAAgCD,aAAa,CAACE,IAF/C,EAGE;AACDP,QAAAA,GAAG,CAACI,OAAJ,CAAYI,KAAZ;AACA;AACD;AACD,GAXQ,EAWN,CAAEP,iBAAF,CAXM,CAAT;AAaA,SAAO,cAAC,mBAAD,OAA0BF,KAA1B;AAAkC,IAAA,GAAG,EAAGC;AAAxC,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport {\n\tButtonBlockAppender,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\n\nexport default function BlockAppender( props ) {\n\tconst ref = useRef();\n\tconst isBlocksListEmpty = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlockCount() === 0\n\t);\n\n\t// Move the focus to the block appender to prevent focus from\n\t// being lost when emptying the widget area.\n\tuseEffect( () => {\n\t\tif ( isBlocksListEmpty && ref.current ) {\n\t\t\tconst { ownerDocument } = ref.current;\n\n\t\t\tif (\n\t\t\t\t! ownerDocument.activeElement ||\n\t\t\t\townerDocument.activeElement === ownerDocument.body\n\t\t\t) {\n\t\t\t\tref.current.focus();\n\t\t\t}\n\t\t}\n\t}, [ isBlocksListEmpty ] );\n\n\treturn <ButtonBlockAppender { ...props } ref={ ref } />;\n}\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import { createElement } from "@wordpress/element";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -17,7 +16,7 @@ function BlockInspectorButton({
|
|
|
17
16
|
}) {
|
|
18
17
|
const selectedBlockClientId = useSelect(select => select(blockEditorStore).getSelectedBlockClientId(), []);
|
|
19
18
|
const selectedBlock = useMemo(() => document.getElementById(`block-${selectedBlockClientId}`), [selectedBlockClientId]);
|
|
20
|
-
return createElement(MenuItem,
|
|
19
|
+
return createElement(MenuItem, {
|
|
21
20
|
onClick: () => {
|
|
22
21
|
// Open the inspector.
|
|
23
22
|
inspector.open({
|
|
@@ -25,8 +24,9 @@ function BlockInspectorButton({
|
|
|
25
24
|
}); // Then close the dropdown menu.
|
|
26
25
|
|
|
27
26
|
closeMenu();
|
|
28
|
-
}
|
|
29
|
-
|
|
27
|
+
},
|
|
28
|
+
...props
|
|
29
|
+
}, __('Show more settings'));
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export default BlockInspectorButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/components/block-inspector-button/index.js"],"names":["useMemo","__","MenuItem","useSelect","store","blockEditorStore","BlockInspectorButton","inspector","closeMenu","props","selectedBlockClientId","select","getSelectedBlockClientId","selectedBlock","document","getElementById","open","returnFocusWhenClose"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/components/block-inspector-button/index.js"],"names":["useMemo","__","MenuItem","useSelect","store","blockEditorStore","BlockInspectorButton","inspector","closeMenu","props","selectedBlockClientId","select","getSelectedBlockClientId","selectedBlock","document","getElementById","open","returnFocusWhenClose"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,QAAT,QAAyB,uBAAzB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;;AAEA,SAASC,oBAAT,CAA+B;AAAEC,EAAAA,SAAF;AAAaC,EAAAA,SAAb;AAAwB,KAAGC;AAA3B,CAA/B,EAAoE;AACnE,QAAMC,qBAAqB,GAAGP,SAAS,CACpCQ,MAAF,IAAcA,MAAM,CAAEN,gBAAF,CAAN,CAA2BO,wBAA3B,EADwB,EAEtC,EAFsC,CAAvC;AAKA,QAAMC,aAAa,GAAGb,OAAO,CAC5B,MAAMc,QAAQ,CAACC,cAAT,CAA0B,SAASL,qBAAuB,EAA1D,CADsB,EAE5B,CAAEA,qBAAF,CAF4B,CAA7B;AAKA,SACC,cAAC,QAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACf;AACAH,MAAAA,SAAS,CAACS,IAAV,CAAgB;AACfC,QAAAA,oBAAoB,EAAEJ;AADP,OAAhB,EAFe,CAKf;;AACAL,MAAAA,SAAS;AACT,KARF;AAAA,OASMC;AATN,KAWGR,EAAE,CAAE,oBAAF,CAXL,CADD;AAeA;;AAED,eAAeK,oBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction BlockInspectorButton( { inspector, closeMenu, ...props } ) {\n\tconst selectedBlockClientId = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSelectedBlockClientId(),\n\t\t[]\n\t);\n\n\tconst selectedBlock = useMemo(\n\t\t() => document.getElementById( `block-${ selectedBlockClientId }` ),\n\t\t[ selectedBlockClientId ]\n\t);\n\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\t// Open the inspector.\n\t\t\t\tinspector.open( {\n\t\t\t\t\treturnFocusWhenClose: selectedBlock,\n\t\t\t\t} );\n\t\t\t\t// Then close the dropdown menu.\n\t\t\t\tcloseMenu();\n\t\t\t} }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ __( 'Show more settings' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default BlockInspectorButton;\n"]}
|
|
@@ -37,7 +37,8 @@ createElement("ul", {
|
|
|
37
37
|
key: index
|
|
38
38
|
}, typeof shortcut === 'string' ? createElement(DynamicShortcut, {
|
|
39
39
|
name: shortcut
|
|
40
|
-
}) : createElement(Shortcut, shortcut
|
|
40
|
+
}) : createElement(Shortcut, { ...shortcut
|
|
41
|
+
}))))
|
|
41
42
|
/* eslint-enable jsx-a11y/no-redundant-roles */
|
|
42
43
|
;
|
|
43
44
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/components/keyboard-shortcut-help-modal/index.js"],"names":["classnames","Modal","__","useShortcut","store","keyboardShortcutsStore","useDispatch","useSelect","textFormattingShortcuts","Shortcut","DynamicShortcut","ShortcutList","shortcuts","map","shortcut","index","ShortcutSection","title","className","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","registerShortcut","name","category","description","keyCombination","modifier","character","ariaLabel"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,KAAT,QAAsB,uBAAtB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SACCC,WADD,EAECC,KAAK,IAAIC,sBAFV,QAGO,+BAHP;AAIA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AAEA;AACA;AACA;;AACA,SAASC,uBAAT,QAAwC,UAAxC;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,eAAP,MAA4B,oBAA5B;;AAEA,MAAMC,YAAY,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF;AACpB;AACD;AACA;AACA;;AACC;AACA;AACC,EAAA,SAAS,EAAC,+DADX;AAEC,EAAA,IAAI,EAAC;AAFN,GAIGA,SAAS,CAACC,GAAV,CAAe,CAAEC,QAAF,EAAYC,KAAZ,KAChB;AACC,EAAA,SAAS,EAAC,0DADX;AAEC,EAAA,GAAG,EAAGA;AAFP,GAIG,OAAOD,QAAP,KAAoB,QAApB,GACD,cAAC,eAAD;AAAiB,EAAA,IAAI,EAAGA;AAAxB,EADC,GAGD,cAAC,QAAD,
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/components/keyboard-shortcut-help-modal/index.js"],"names":["classnames","Modal","__","useShortcut","store","keyboardShortcutsStore","useDispatch","useSelect","textFormattingShortcuts","Shortcut","DynamicShortcut","ShortcutList","shortcuts","map","shortcut","index","ShortcutSection","title","className","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","registerShortcut","name","category","description","keyCombination","modifier","character","ariaLabel"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,KAAT,QAAsB,uBAAtB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SACCC,WADD,EAECC,KAAK,IAAIC,sBAFV,QAGO,+BAHP;AAIA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AAEA;AACA;AACA;;AACA,SAASC,uBAAT,QAAwC,UAAxC;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,eAAP,MAA4B,oBAA5B;;AAEA,MAAMC,YAAY,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF;AACpB;AACD;AACA;AACA;;AACC;AACA;AACC,EAAA,SAAS,EAAC,+DADX;AAEC,EAAA,IAAI,EAAC;AAFN,GAIGA,SAAS,CAACC,GAAV,CAAe,CAAEC,QAAF,EAAYC,KAAZ,KAChB;AACC,EAAA,SAAS,EAAC,0DADX;AAEC,EAAA,GAAG,EAAGA;AAFP,GAIG,OAAOD,QAAP,KAAoB,QAApB,GACD,cAAC,eAAD;AAAiB,EAAA,IAAI,EAAGA;AAAxB,EADC,GAGD,cAAC,QAAD,OAAeA;AAAf,EAPF,CADC,CAJH;AAiBA;AAvBD;;AA0BA,MAAME,eAAe,GAAG,CAA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ACtB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,KAAD;AACC,IAAA,SAAS,EAAC,gDADX;AAEC,IAAA,KAAK,EAAGzB,EAAE,CAAE,oBAAF,CAFX;AAGC,IAAA,cAAc,EAAG0B;AAHlB,KAKC,cAAC,eAAD;AACC,IAAA,SAAS,EAAC,gEADX;AAEC,IAAA,SAAS,EAAG,CAAE,2CAAF;AAFb,IALD,EASC,cAAC,uBAAD;AACC,IAAA,KAAK,EAAG1B,EAAE,CAAE,kBAAF,CADX;AAEC,IAAA,YAAY,EAAC;AAFd,IATD,EAcC,cAAC,uBAAD;AACC,IAAA,KAAK,EAAGA,EAAE,CAAE,qBAAF,CADX;AAEC,IAAA,YAAY,EAAC;AAFd,IAdD,EAmBC,cAAC,uBAAD;AACC,IAAA,KAAK,EAAGA,EAAE,CAAE,iBAAF,CADX;AAEC,IAAA,YAAY,EAAC,OAFd;AAGC,IAAA,mBAAmB,EAAG,CACrB;AACC+B,MAAAA,cAAc,EAAE;AAAEE,QAAAA,SAAS,EAAE;AAAb,OADjB;AAECH,MAAAA,WAAW,EAAE9B,EAAE,CACd,qDADc,CAFhB;;AAKC;AACAkC,MAAAA,SAAS,EAAElC,EAAE,CAAE,eAAF;AANd,KADqB;AAHvB,IAnBD,EAiCC,cAAC,eAAD;AACC,IAAA,KAAK,EAAGA,EAAE,CAAE,iBAAF,CADX;AAEC,IAAA,SAAS,EAAGM;AAFb,IAjCD,CADD;AAwCA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { textFormattingShortcuts } from './config';\nimport Shortcut from './shortcut';\nimport DynamicShortcut from './dynamic-shortcut';\n\nconst ShortcutList = ( { shortcuts } ) => (\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t<ul\n\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal__shortcut-list\"\n\t\trole=\"list\"\n\t>\n\t\t{ shortcuts.map( ( shortcut, index ) => (\n\t\t\t<li\n\t\t\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal__shortcut\"\n\t\t\t\tkey={ index }\n\t\t\t>\n\t\t\t\t{ typeof shortcut === 'string' ? (\n\t\t\t\t\t<DynamicShortcut name={ shortcut } />\n\t\t\t\t) : (\n\t\t\t\t\t<Shortcut { ...shortcut } />\n\t\t\t\t) }\n\t\t\t</li>\n\t\t) ) }\n\t</ul>\n\t/* eslint-enable jsx-a11y/no-redundant-roles */\n);\n\nconst ShortcutSection = ( { title, shortcuts, className } ) => (\n\t<section\n\t\tclassName={ classnames(\n\t\t\t'customize-widgets-keyboard-shortcut-help-modal__section',\n\t\t\tclassName\n\t\t) }\n\t>\n\t\t{ !! title && (\n\t\t\t<h2 className=\"customize-widgets-keyboard-shortcut-help-modal__section-title\">\n\t\t\t\t{ title }\n\t\t\t</h2>\n\t\t) }\n\t\t<ShortcutList shortcuts={ shortcuts } />\n\t</section>\n);\n\nconst ShortcutCategorySection = ( {\n\ttitle,\n\tcategoryName,\n\tadditionalShortcuts = [],\n} ) => {\n\tconst categoryShortcuts = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( keyboardShortcutsStore ).getCategoryShortcuts(\n\t\t\t\tcategoryName\n\t\t\t);\n\t\t},\n\t\t[ categoryName ]\n\t);\n\n\treturn (\n\t\t<ShortcutSection\n\t\t\ttitle={ title }\n\t\t\tshortcuts={ categoryShortcuts.concat( additionalShortcuts ) }\n\t\t/>\n\t);\n};\n\nexport default function KeyboardShortcutHelpModal( {\n\tisModalActive,\n\ttoggleModal,\n} ) {\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tregisterShortcut( {\n\t\tname: 'core/customize-widgets/keyboard-shortcuts',\n\t\tcategory: 'main',\n\t\tdescription: __( 'Display these keyboard shortcuts.' ),\n\t\tkeyCombination: {\n\t\t\tmodifier: 'access',\n\t\t\tcharacter: 'h',\n\t\t},\n\t} );\n\n\tuseShortcut( 'core/customize-widgets/keyboard-shortcuts', toggleModal );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal\"\n\t\t\ttitle={ __( 'Keyboard shortcuts' ) }\n\t\t\tonRequestClose={ toggleModal }\n\t\t>\n\t\t\t<ShortcutSection\n\t\t\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/customize-widgets/keyboard-shortcuts' ] }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Global shortcuts' ) }\n\t\t\t\tcategoryName=\"global\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Selection shortcuts' ) }\n\t\t\t\tcategoryName=\"selection\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Block shortcuts' ) }\n\t\t\t\tcategoryName=\"block\"\n\t\t\t\tadditionalShortcuts={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyCombination: { character: '/' },\n\t\t\t\t\t\tdescription: __(\n\t\t\t\t\t\t\t'Change the block type after adding a new paragraph.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t/* translators: The forward-slash character. e.g. '/'. */\n\t\t\t\t\t\tariaLabel: __( 'Forward-slash' ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t\t<ShortcutSection\n\t\t\t\ttitle={ __( 'Text formatting' ) }\n\t\t\t\tshortcuts={ textFormattingShortcuts }\n\t\t\t/>\n\t\t</Modal>\n\t);\n}\n"]}
|
|
@@ -114,7 +114,7 @@ function KeyboardShortcutsRegister() {
|
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
116
|
registerShortcut({
|
|
117
|
-
name:
|
|
117
|
+
name: 'core/customize-widgets/transform-heading-to-paragraph',
|
|
118
118
|
category: 'block-library',
|
|
119
119
|
description: __('Transform heading to paragraph.'),
|
|
120
120
|
keyCombination: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/components/keyboard-shortcuts/index.js"],"names":["useEffect","useShortcut","store","keyboardShortcutsStore","isAppleOS","useDispatch","useSelect","__","blockEditorStore","createBlock","KeyboardShortcuts","undo","redo","save","replaceBlocks","getBlockName","getSelectedBlockClientId","getBlockAttributes","handleTextLevelShortcut","event","level","preventDefault","destinationBlockName","currentClientId","blockName","attributes","textAlign","destinationTextAlign","content","forEach","KeyboardShortcutsRegister","registerShortcut","unregisterShortcut","name","category","description","keyCombination","modifier","character","aliases","Register"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,oBAA1B;AACA,SACCC,WADD,EAECC,KAAK,IAAIC,sBAFV,QAGO,+BAHP;AAIA,SAASC,SAAT,QAA0B,qBAA1B;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASL,KAAK,IAAIM,gBAAlB,QAA0C,yBAA1C;AACA,SAASC,WAAT,QAA4B,mBAA5B;;AAEA,SAASC,iBAAT,CAA4B;AAAEC,EAAAA,IAAF;AAAQC,EAAAA,IAAR;AAAcC,EAAAA;AAAd,CAA5B,EAAmD;AAClD,QAAM;AAAEC,IAAAA;AAAF,MAAoBT,WAAW,CAAEG,gBAAF,CAArC;AACA,QAAM;AAAEO,IAAAA,YAAF;AAAgBC,IAAAA,wBAAhB;AAA0CC,IAAAA;AAA1C,MACLX,SAAS,CAAEE,gBAAF,CADV;;AAGA,QAAMU,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I,EAAE,6BADW;AAEjBC,MAAAA,QAAQ,EAAE,QAFO;AAGjBC,MAAAA,WAAW,EAAE5B,EAAE,CAAE,oBAAF,CAHE;AAIjB6B,MAAAA,cAAc,EAAE;AACfC,QAAAA,QAAQ,EAAE,SADK;AAEfC,QAAAA,SAAS,EAAE;AAFI;AAJC,KAAF,CAAhB;AAUAP,IAAAA,gBAAgB,CAAE;AACjBE,MAAAA,IAAI,
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/components/keyboard-shortcuts/index.js"],"names":["useEffect","useShortcut","store","keyboardShortcutsStore","isAppleOS","useDispatch","useSelect","__","blockEditorStore","createBlock","KeyboardShortcuts","undo","redo","save","replaceBlocks","getBlockName","getSelectedBlockClientId","getBlockAttributes","handleTextLevelShortcut","event","level","preventDefault","destinationBlockName","currentClientId","blockName","attributes","textAlign","destinationTextAlign","content","forEach","KeyboardShortcutsRegister","registerShortcut","unregisterShortcut","name","category","description","keyCombination","modifier","character","aliases","Register"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,oBAA1B;AACA,SACCC,WADD,EAECC,KAAK,IAAIC,sBAFV,QAGO,+BAHP;AAIA,SAASC,SAAT,QAA0B,qBAA1B;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASL,KAAK,IAAIM,gBAAlB,QAA0C,yBAA1C;AACA,SAASC,WAAT,QAA4B,mBAA5B;;AAEA,SAASC,iBAAT,CAA4B;AAAEC,EAAAA,IAAF;AAAQC,EAAAA,IAAR;AAAcC,EAAAA;AAAd,CAA5B,EAAmD;AAClD,QAAM;AAAEC,IAAAA;AAAF,MAAoBT,WAAW,CAAEG,gBAAF,CAArC;AACA,QAAM;AAAEO,IAAAA,YAAF;AAAgBC,IAAAA,wBAAhB;AAA0CC,IAAAA;AAA1C,MACLX,SAAS,CAAEE,gBAAF,CADV;;AAGA,QAAMU,uBAAuB,GAAG,C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ress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\n\nfunction KeyboardShortcuts( { undo, redo, save } ) {\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { getBlockName, getSelectedBlockClientId, getBlockAttributes } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst handleTextLevelShortcut = ( event, level ) => {\n\t\tevent.preventDefault();\n\t\tconst destinationBlockName =\n\t\t\tlevel === 0 ? 'core/paragraph' : 'core/heading';\n\t\tconst currentClientId = getSelectedBlockClientId();\n\t\tif ( currentClientId === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst blockName = getBlockName( currentClientId );\n\t\tif ( blockName !== 'core/paragraph' && blockName !== 'core/heading' ) {\n\t\t\treturn;\n\t\t}\n\t\tconst attributes = getBlockAttributes( currentClientId );\n\t\tconst textAlign =\n\t\t\tblockName === 'core/paragraph' ? 'align' : 'textAlign';\n\t\tconst destinationTextAlign =\n\t\t\tdestinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';\n\n\t\treplaceBlocks(\n\t\t\tcurrentClientId,\n\t\t\tcreateBlock( destinationBlockName, {\n\t\t\t\tlevel,\n\t\t\t\tcontent: attributes.content,\n\t\t\t\t...{ [ destinationTextAlign ]: attributes[ textAlign ] },\n\t\t\t} )\n\t\t);\n\t};\n\n\tuseShortcut( 'core/customize-widgets/undo', ( event ) => {\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/customize-widgets/redo', ( event ) => {\n\t\tredo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/customize-widgets/save', ( event ) => {\n\t\tevent.preventDefault();\n\t\tsave();\n\t} );\n\n\tuseShortcut(\n\t\t'core/customize-widgets/transform-heading-to-paragraph',\n\t\t( event ) => handleTextLevelShortcut( event, 0 )\n\t);\n\n\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t//the loop is based off on a constant therefore\n\t\t//the hook will execute the same way every time\n\t\t//eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseShortcut(\n\t\t\t`core/customize-widgets/transform-paragraph-to-heading-${ level }`,\n\t\t\t( event ) => handleTextLevelShortcut( event, level )\n\t\t);\n\t} );\n\n\treturn null;\n}\n\nfunction KeyboardShortcutsRegister() {\n\tconst { registerShortcut, unregisterShortcut } = useDispatch(\n\t\tkeyboardShortcutsStore\n\t);\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t\t// Disable on Apple OS because it conflicts with the browser's\n\t\t\t// history shortcut. It's a fine alias for both Windows and Linux.\n\t\t\t// Since there's no conflict for Ctrl+Shift+Z on both Windows and\n\t\t\t// Linux, we keep it as the default for consistency.\n\t\t\taliases: isAppleOS()\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmodifier: 'primary',\n\t\t\t\t\t\t\tcharacter: 'y',\n\t\t\t\t\t\t},\n\t\t\t\t ],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/transform-heading-to-paragraph',\n\t\t\tcategory: 'block-library',\n\t\t\tdescription: __( 'Transform heading to paragraph.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: `0`,\n\t\t\t},\n\t\t} );\n\n\t\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t\tregisterShortcut( {\n\t\t\t\tname: `core/customize-widgets/transform-paragraph-to-heading-${ level }`,\n\t\t\t\tcategory: 'block-library',\n\t\t\t\tdescription: __( 'Transform paragraph to heading.' ),\n\t\t\t\tkeyCombination: {\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: `${ level }`,\n\t\t\t\t},\n\t\t\t} );\n\t\t} );\n\n\t\treturn () => {\n\t\t\tunregisterShortcut( 'core/customize-widgets/undo' );\n\t\t\tunregisterShortcut( 'core/customize-widgets/redo' );\n\t\t\tunregisterShortcut( 'core/customize-widgets/save' );\n\t\t};\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nKeyboardShortcuts.Register = KeyboardShortcutsRegister;\nexport default KeyboardShortcuts;\n"]}
|
|
@@ -10,7 +10,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
|
10
10
|
|
|
11
11
|
import useSidebarBlockEditor from './use-sidebar-block-editor';
|
|
12
12
|
import useBlocksFocusControl from '../focus-control/use-blocks-focus-control';
|
|
13
|
-
import { unlock } from '../../
|
|
13
|
+
import { unlock } from '../../lock-unlock';
|
|
14
14
|
const {
|
|
15
15
|
ExperimentalBlockEditorProvider
|
|
16
16
|
} = unlock(blockEditorPrivateApis);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/components/sidebar-block-editor/sidebar-editor-provider.js"],"names":["privateApis","blockEditorPrivateApis","useSidebarBlockEditor","useBlocksFocusControl","unlock","ExperimentalBlockEditorProvider","SidebarEditorProvider","sidebar","settings","children","blocks","onInput","onChange"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,OAAOC,qBAAP,MAAkC,2CAAlC;AAEA,SAASC,MAAT,QAAuB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/components/sidebar-block-editor/sidebar-editor-provider.js"],"names":["privateApis","blockEditorPrivateApis","useSidebarBlockEditor","useBlocksFocusControl","unlock","ExperimentalBlockEditorProvider","SidebarEditorProvider","sidebar","settings","children","blocks","onInput","onChange"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,OAAOC,qBAAP,MAAkC,2CAAlC;AAEA,SAASC,MAAT,QAAuB,mBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAsCD,MAAM,CAAEH,sBAAF,CAAlD;AAEA,eAAe,SAASK,qBAAT,CAAgC;AAC9CC,EAAAA,OAD8C;AAE9CC,EAAAA,QAF8C;AAG9CC,EAAAA;AAH8C,CAAhC,EAIX;AACH,QAAM,CAAEC,MAAF,EAAUC,OAAV,EAAmBC,QAAnB,IAAgCV,qBAAqB,CAAEK,OAAF,CAA3D;AAEAJ,EAAAA,qBAAqB,CAAEO,MAAF,CAArB;AAEA,SACC,cAAC,+BAAD;AACC,IAAA,KAAK,EAAGA,MADT;AAEC,IAAA,OAAO,EAAGC,OAFX;AAGC,IAAA,QAAQ,EAAGC,QAHZ;AAIC,IAAA,QAAQ,EAAGJ,QAJZ;AAKC,IAAA,cAAc,EAAG;AALlB,KAOGC,QAPH,CADD;AAWA","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"]}
|
|
@@ -61,7 +61,8 @@ const withMoveToSidebarToolbarItem = createHigherOrderComponent(BlockEdit => pro
|
|
|
61
61
|
focusWidget(widgetId);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
return createElement(Fragment, null, createElement(BlockEdit, props
|
|
64
|
+
return createElement(Fragment, null, createElement(BlockEdit, { ...props
|
|
65
|
+
}), hasMultipleSidebars && canInsertBlockInSidebar && createElement(BlockControls, null, createElement(MoveToWidgetArea, {
|
|
65
66
|
widgetAreas: sidebarControls.map(sidebarControl => ({
|
|
66
67
|
id: sidebarControl.id,
|
|
67
68
|
name: sidebarControl.params.label,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/filters/move-to-sidebar.js"],"names":["BlockControls","store","blockEditorStore","createHigherOrderComponent","useSelect","useDispatch","addFilter","MoveToWidgetArea","getWidgetIdFromBlock","useSidebarControls","useActiveSidebarControl","useFocusControl","blockToWidget","withMoveToSidebarToolbarItem","BlockEdit","props","widgetId","sidebarControls","activeSidebarControl","hasMultipleSidebars","length","blockName","name","clientId","canInsertBlockInSidebar","select","canInsertBlockType","block","getBlock","removeBlock","focusWidget","moveToSidebar","sidebarControlId","newSidebarControl","find","sidebarControl","id","oldSetting","setting","newSetting","filter","sidebarAdapter","addedWidgetIds","setWidgets","getWidgets","reverse","map","params","label","description"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,aADD,EAECC,KAAK,IAAIC,gBAFV,QAGO,yBAHP;AAIA,SAASC,0BAAT,QAA2C,oBAA3C;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,gBAAT,EAA2BC,oBAA3B,QAAuD,oBAAvD;AAEA;AACA;AACA;;AACA,SACCC,kBADD,EAECC,uBAFD,QAGO,gCAHP;AAIA,SAASC,eAAT,QAAgC,6BAAhC;AACA,SAASC,aAAT,QAA8B,UAA9B;AAEA,MAAMC,4BAA4B,GAAGV,0BAA0B,CAC5DW,SAAF,IAAmBC,KAAF,IAAa;AAC7B,MAAIC,QAAQ,GAAGR,oBAAoB,CAAEO,KAAF,CAAnC;AACA,QAAME,eAAe,GAAGR,kBAAkB,EAA1C;AACA,QAAMS,oBAAoB,GAAGR,uBAAuB,EAApD;AACA,QAAMS,mBAAmB,GAAGF,eAAe,EAAEG,MAAjB,GAA0B,CAAtD;AACA,QAAMC,SAAS,GAAGN,KAAK,CAACO,IAAxB;AACA,QAAMC,QAAQ,GAAGR,KAAK,CAACQ,QAAvB;AACA,QAAMC,uBAAuB,GAAGpB,SAAS,CACtCqB,MAAF,IAAc;AACb;AACA;AACA,WAAOA,MAAM,CAAEvB,gBAAF,CAAN,CAA2BwB,kBAA3B,CACNL,SADM,EAEN,EAFM,CAAP;AAIA,GARuC,EASxC,CAAEA,SAAF,CATwC,CAAzC;AAWA,QAAMM,KAAK,GAAGvB,SAAS,CACpBqB,MAAF,IAAcA,MAAM,CAAEvB,gBAAF,CAAN,CAA2B0B,QAA3B,CAAqCL,QAArC,CADQ,EAEtB,CAAEA,QAAF,CAFsB,CAAvB;AAIA,QAAM;AAAEM,IAAAA;AAAF,MAAkBxB,WAAW,CAAEH,gBAAF,CAAnC;AACA,QAAM,GAAI4B,WAAJ,IAAoBnB,eAAe,EAAzC;;AAEA,WAASoB,aAAT,CAAwBC,gBAAxB,EAA2C;AAC1C,UAAMC,iBAAiB,GAAGhB,eAAe,CAACiB,IAAhB,CACvBC,cAAF,IAAsBA,cAAc,CAACC,EAAf,KAAsBJ,gBADnB,CAA1B;;AAIA,QAAKhB,QAAL,EAAgB;AACf;AACJ;AACA;AACI,YAAMqB,UAAU,GAAGnB,oBAAoB,CAACoB,OAAxC;AACA,YAAMC,UAAU,GAAGN,iBAAiB,CAACK,OAArC;AAEAD,MAAAA,UAAU,CAAEA,UAAU,GAAGG,MAAb,CAAuBJ,EAAF,IAAUA,EAAE,KAAKpB,QAAtC,CAAF,CAAV;AACAuB,MAAAA,UAAU,CAAE,CAAE,GAAGA,UAAU,EAAf,EAAmBvB,QAAnB,CAAF,CAAV;AACA,KATD,MASO;AACN;AACJ;AACA;AACA;AACA;AACI,YAAMyB,cAAc,GAAGR,iBAAiB,CAACQ,cAAzC;AAEAZ,MAAAA,WAAW,CAAEN,QAAF,CAAX;AACA,YAAMmB,cAAc,GAAGD,cAAc,CAACE,UAAf,CAA2B,CACjD,GAAGF,cAAc,CAACG,UAAf,EAD8C,EAEjDhC,aAAa,CAAEe,KAAF,CAFoC,CAA3B,CAAvB,CATM,CAaN;;AACAX,MAAAA,QAAQ,GAAG0B,cAAc,CAACG,OAAf,GAAyBX,IAAzB,CAAiCE,EAAF,IAAU,CAAC,CAAEA,EAA5C,CAAX;AACA,KA7ByC,CA+B1C;;;AACAN,IAAAA,WAAW,CAAEd,QAAF,CAAX;AACA;;AAED,SACC,8BACC,cAAC,SAAD,
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/filters/move-to-sidebar.js"],"names":["BlockControls","store","blockEditorStore","createHigherOrderComponent","useSelect","useDispatch","addFilter","MoveToWidgetArea","getWidgetIdFromBlock","useSidebarControls","useActiveSidebarControl","useFocusControl","blockToWidget","withMoveToSidebarToolbarItem","BlockEdit","props","widgetId","sidebarControls","activeSidebarControl","hasMultipleSidebars","length","blockName","name","clientId","canInsertBlockInSidebar","select","canInsertBlockType","block","getBlock","removeBlock","focusWidget","moveToSidebar","sidebarControlId","newSidebarControl","find","sidebarControl","id","oldSetting","setting","newSetting","filter","sidebarAdapter","addedWidgetIds","setWidgets","getWidgets","reverse","map","params","label","description"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,aADD,EAECC,KAAK,IAAIC,gBAFV,QAGO,yBAHP;AAIA,SAASC,0BAAT,QAA2C,oBAA3C;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,gBAAT,EAA2BC,oBAA3B,QAAuD,oBAAvD;AAEA;AACA;AACA;;AACA,SACCC,kBADD,EAECC,uBAFD,QAGO,gCAHP;AAIA,SAASC,eAAT,QAAgC,6BAAhC;AACA,SAASC,aAAT,QAA8B,UAA9B;AAEA,MAAMC,4BAA4B,GAAGV,0BAA0B,CAC5DW,SAAF,IAAmBC,KAAF,IAAa;AAC7B,MAAIC,QAAQ,GAAGR,oBAAoB,CAAEO,KAAF,CAAnC;AACA,QAAME,eAAe,GAAGR,kBAAkB,EAA1C;AACA,QAAMS,oBAAoB,GAAGR,uBAAuB,EAApD;AACA,QAAMS,mBAAmB,GAAGF,eAAe,EAAEG,MAAjB,GAA0B,CAAtD;AACA,QAAMC,SAAS,GAAGN,KAAK,CAACO,IAAxB;AACA,QAAMC,QAAQ,GAAGR,KAAK,CAACQ,QAAvB;AACA,QAAMC,uBAAuB,GAAGpB,SAAS,CACtCqB,MAAF,IAAc;AACb;AACA;AACA,WAAOA,MAAM,CAAEvB,gBAAF,CAAN,CAA2BwB,kBAA3B,CACNL,SADM,EAEN,EAFM,CAAP;AAIA,GARuC,EASxC,CAAEA,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;AACA;;AAED,SACC,8BACC,cAAC,SAAD,OAAgBD;AAAhB,IADD,EAEGI,mBAAmB,IAAIK,uBAAvB,IACD,cAAC,aAAD,QACC,cAAC,gBAAD;AACC,IAAA,WAAW,EAAGP,eAAe,CAAC6B,GAAhB,CACXX,cAAF,KAAwB;AACvBC,MAAAA,EAAE,EAAED,cAAc,CAACC,EADI;AAEvBd,MAAAA,IAAI,EAAEa,cAAc,CAACY,MAAf,CAAsBC,KAFL;AAGvBC,MAAAA,WAAW,EACVd,cAAc,CAACY,MAAf,CAAsBE;AAJA,KAAxB,CADa,CADf;AASC,IAAA,mBAAmB,EAAG/B,oBAAoB,EAAEkB,EAT7C;AAUC,IAAA,QAAQ,EAAGL;AAVZ,IADD,CAHF,CADD;AAqBA,CAlF6D,EAmF9D,8BAnF8D,CAA/D;AAsFAzB,SAAS,CACR,kBADQ,EAER,mCAFQ,EAGRO,4BAHQ,CAAT","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\naddFilter(\n\t'editor.BlockEdit',\n\t'core/customize-widgets/block-edit',\n\twithMoveToSidebarToolbarItem\n);\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import { createElement } from "@wordpress/element";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -16,9 +15,9 @@ const withWideWidgetDisplay = createHigherOrderComponent(BlockEdit => props => {
|
|
|
16
15
|
idBase
|
|
17
16
|
} = props.attributes;
|
|
18
17
|
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 createElement(BlockEdit,
|
|
18
|
+
return createElement(BlockEdit, { ...props,
|
|
20
19
|
isWide: isWide
|
|
21
|
-
})
|
|
20
|
+
});
|
|
22
21
|
}, 'withWideWidgetDisplay');
|
|
23
22
|
addFilter('editor.BlockEdit', 'core/customize-widgets/wide-widget-display', withWideWidgetDisplay);
|
|
24
23
|
//# sourceMappingURL=wide-widget-display.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/filters/wide-widget-display.js"],"names":["createHigherOrderComponent","addFilter","wp","window","withWideWidgetDisplay","BlockEdit","props","idBase","attributes","isWide","customize","Widgets","data","availableWidgets","find","widget","id_base","is_wide"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/filters/wide-widget-display.js"],"names":["createHigherOrderComponent","addFilter","wp","window","withWideWidgetDisplay","BlockEdit","props","idBase","attributes","isWide","customize","Widgets","data","availableWidgets","find","widget","id_base","is_wide"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,0BAAT,QAA2C,oBAA3C;AACA,SAASC,SAAT,QAA0B,kBAA1B;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAASC,MAAf;AAEA,MAAMC,qBAAqB,GAAGJ,0BAA0B,CACrDK,SAAF,IAAmBC,KAAF,IAAa;AAAA;;AAC7B,QAAM;AAAEC,IAAAA;AAAF,MAAaD,KAAK,CAACE,UAAzB;AACA,QAAMC,MAAM,4BACXP,EAAE,CAACQ,SAAH,CAAaC,OAAb,CAAqBC,IAArB,CAA0BC,gBAA1B,CAA2CC,IAA3C,CACGC,MAAF,IAAcA,MAAM,CAACC,OAAP,KAAmBT,MADlC,GAEGU,OAHQ,yEAGG,KAHf;AAKA,SAAO,cAAC,SAAD,OAAgBX,KAAhB;AAAwB,IAAA,MAAM,EAAGG;AAAjC,IAAP;AACA,CATsD,EAUvD,uBAVuD,CAAxD;AAaAR,SAAS,CACR,kBADQ,EAER,4CAFQ,EAGRG,qBAHQ,CAAT","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"]}
|
|
@@ -6,4 +6,4 @@ export const {
|
|
|
6
6
|
lock,
|
|
7
7
|
unlock
|
|
8
8
|
} = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.', '@wordpress/customize-widgets');
|
|
9
|
-
//# sourceMappingURL=
|
|
9
|
+
//# sourceMappingURL=lock-unlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/lock-unlock.js"],"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAT,QAAiE,yBAAjE;AAEA,OAAO,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IACZF,gDAAgD,CAC/C,8GAD+C,EAE/C,8BAF+C,CAD1C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',\n\t\t'@wordpress/customize-widgets'\n\t);\n"]}
|
|
@@ -322,4 +322,29 @@
|
|
|
322
322
|
.customize-widgets-popover *::before,
|
|
323
323
|
.customize-widgets-popover *::after {
|
|
324
324
|
box-sizing: inherit;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
Fixed bloock toolbar overrides. We can't detect each editor instance
|
|
329
|
+
in the styles of the block editor component so we need to override
|
|
330
|
+
the fixed styles here because the breakpoint css does not fire in the
|
|
331
|
+
customizer's left panel.
|
|
332
|
+
*/
|
|
333
|
+
.block-editor-block-contextual-toolbar.is-fixed {
|
|
334
|
+
position: sticky;
|
|
335
|
+
top: 0;
|
|
336
|
+
right: 0;
|
|
337
|
+
z-index: 6;
|
|
338
|
+
width: calc(100% + 2 * 12px);
|
|
339
|
+
overflow-y: hidden;
|
|
340
|
+
border: none;
|
|
341
|
+
border-bottom: 1px solid #e0e0e0;
|
|
342
|
+
border-radius: 0;
|
|
343
|
+
}
|
|
344
|
+
.block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar .components-toolbar-group,
|
|
345
|
+
.block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar .components-toolbar {
|
|
346
|
+
border-left-color: #e0e0e0;
|
|
347
|
+
}
|
|
348
|
+
.block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
|
|
349
|
+
margin-right: -12px;
|
|
325
350
|
}
|
package/build-style/style.css
CHANGED
|
@@ -322,4 +322,29 @@
|
|
|
322
322
|
.customize-widgets-popover *::before,
|
|
323
323
|
.customize-widgets-popover *::after {
|
|
324
324
|
box-sizing: inherit;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
Fixed bloock toolbar overrides. We can't detect each editor instance
|
|
329
|
+
in the styles of the block editor component so we need to override
|
|
330
|
+
the fixed styles here because the breakpoint css does not fire in the
|
|
331
|
+
customizer's left panel.
|
|
332
|
+
*/
|
|
333
|
+
.block-editor-block-contextual-toolbar.is-fixed {
|
|
334
|
+
position: sticky;
|
|
335
|
+
top: 0;
|
|
336
|
+
left: 0;
|
|
337
|
+
z-index: 6;
|
|
338
|
+
width: calc(100% + 2 * 12px);
|
|
339
|
+
overflow-y: hidden;
|
|
340
|
+
border: none;
|
|
341
|
+
border-bottom: 1px solid #e0e0e0;
|
|
342
|
+
border-radius: 0;
|
|
343
|
+
}
|
|
344
|
+
.block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar .components-toolbar-group,
|
|
345
|
+
.block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar .components-toolbar {
|
|
346
|
+
border-right-color: #e0e0e0;
|
|
347
|
+
}
|
|
348
|
+
.block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
|
|
349
|
+
margin-left: -12px;
|
|
325
350
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/customize-widgets",
|
|
3
|
-
"version": "4.12.
|
|
3
|
+
"version": "4.12.1",
|
|
4
4
|
"description": "Widgets blocks in Customizer Module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -24,26 +24,26 @@
|
|
|
24
24
|
"react-native": "src/index",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.16.0",
|
|
27
|
-
"@wordpress/block-editor": "^12.3.
|
|
28
|
-
"@wordpress/block-library": "^8.12.
|
|
29
|
-
"@wordpress/blocks": "^12.12.
|
|
30
|
-
"@wordpress/components": "^25.1.
|
|
31
|
-
"@wordpress/compose": "^6.12.
|
|
32
|
-
"@wordpress/core-data": "^6.12.
|
|
33
|
-
"@wordpress/data": "^9.5.
|
|
34
|
-
"@wordpress/dom": "^3.35.
|
|
35
|
-
"@wordpress/element": "^5.12.
|
|
36
|
-
"@wordpress/hooks": "^3.35.
|
|
37
|
-
"@wordpress/i18n": "^4.35.
|
|
38
|
-
"@wordpress/icons": "^9.26.
|
|
39
|
-
"@wordpress/interface": "^5.12.
|
|
40
|
-
"@wordpress/is-shallow-equal": "^4.35.
|
|
41
|
-
"@wordpress/keyboard-shortcuts": "^4.12.
|
|
42
|
-
"@wordpress/keycodes": "^3.35.
|
|
43
|
-
"@wordpress/media-utils": "^4.26.
|
|
44
|
-
"@wordpress/preferences": "^3.12.
|
|
45
|
-
"@wordpress/private-apis": "^0.17.
|
|
46
|
-
"@wordpress/widgets": "^3.12.
|
|
27
|
+
"@wordpress/block-editor": "^12.3.1",
|
|
28
|
+
"@wordpress/block-library": "^8.12.1",
|
|
29
|
+
"@wordpress/blocks": "^12.12.1",
|
|
30
|
+
"@wordpress/components": "^25.1.1",
|
|
31
|
+
"@wordpress/compose": "^6.12.1",
|
|
32
|
+
"@wordpress/core-data": "^6.12.1",
|
|
33
|
+
"@wordpress/data": "^9.5.1",
|
|
34
|
+
"@wordpress/dom": "^3.35.1",
|
|
35
|
+
"@wordpress/element": "^5.12.1",
|
|
36
|
+
"@wordpress/hooks": "^3.35.1",
|
|
37
|
+
"@wordpress/i18n": "^4.35.1",
|
|
38
|
+
"@wordpress/icons": "^9.26.1",
|
|
39
|
+
"@wordpress/interface": "^5.12.1",
|
|
40
|
+
"@wordpress/is-shallow-equal": "^4.35.1",
|
|
41
|
+
"@wordpress/keyboard-shortcuts": "^4.12.1",
|
|
42
|
+
"@wordpress/keycodes": "^3.35.1",
|
|
43
|
+
"@wordpress/media-utils": "^4.26.1",
|
|
44
|
+
"@wordpress/preferences": "^3.12.1",
|
|
45
|
+
"@wordpress/private-apis": "^0.17.1",
|
|
46
|
+
"@wordpress/widgets": "^3.12.1",
|
|
47
47
|
"classnames": "^2.3.1",
|
|
48
48
|
"fast-deep-equal": "^3.1.3"
|
|
49
49
|
},
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "ce5639111c30763dbdf07f40eeb136ea6030ecf1"
|
|
58
58
|
}
|
|
@@ -127,7 +127,7 @@ function KeyboardShortcutsRegister() {
|
|
|
127
127
|
} );
|
|
128
128
|
|
|
129
129
|
registerShortcut( {
|
|
130
|
-
name:
|
|
130
|
+
name: 'core/customize-widgets/transform-heading-to-paragraph',
|
|
131
131
|
category: 'block-library',
|
|
132
132
|
description: __( 'Transform heading to paragraph.' ),
|
|
133
133
|
keyCombination: {
|
|
@@ -9,7 +9,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
|
9
9
|
import useSidebarBlockEditor from './use-sidebar-block-editor';
|
|
10
10
|
import useBlocksFocusControl from '../focus-control/use-blocks-focus-control';
|
|
11
11
|
|
|
12
|
-
import { unlock } from '../../
|
|
12
|
+
import { unlock } from '../../lock-unlock';
|
|
13
13
|
|
|
14
14
|
const { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );
|
|
15
15
|
|
package/src/style.scss
CHANGED
|
@@ -17,3 +17,34 @@
|
|
|
17
17
|
.customize-widgets-popover {
|
|
18
18
|
@include reset;
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
Fixed bloock toolbar overrides. We can't detect each editor instance
|
|
23
|
+
in the styles of the block editor component so we need to override
|
|
24
|
+
the fixed styles here because the breakpoint css does not fire in the
|
|
25
|
+
customizer's left panel.
|
|
26
|
+
*/
|
|
27
|
+
.block-editor-block-contextual-toolbar {
|
|
28
|
+
&.is-fixed {
|
|
29
|
+
position: sticky;
|
|
30
|
+
top: 0;
|
|
31
|
+
left: 0;
|
|
32
|
+
z-index: z-index(".block-editor-block-list__insertion-point");
|
|
33
|
+
width: calc(100% + 2 * 12px); //12px is the padding of customizer sidebar content
|
|
34
|
+
|
|
35
|
+
overflow-y: hidden;
|
|
36
|
+
|
|
37
|
+
border: none;
|
|
38
|
+
border-bottom: $border-width solid $gray-200;
|
|
39
|
+
border-radius: 0;
|
|
40
|
+
|
|
41
|
+
.block-editor-block-toolbar .components-toolbar-group,
|
|
42
|
+
.block-editor-block-toolbar .components-toolbar {
|
|
43
|
+
border-right-color: $gray-200;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.is-collapsed {
|
|
47
|
+
margin-left: -12px; //12px is the padding of customizer sidebar content
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/private-apis.js"],"names":["lock","unlock"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IACZ,mEACC,8GADD,EAEC,8BAFD,CADM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',\n\t\t'@wordpress/customize-widgets'\n\t);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/private-apis.js"],"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAT,QAAiE,yBAAjE;AAEA,OAAO,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IACZF,gDAAgD,CAC/C,8GAD+C,EAE/C,8BAF+C,CAD1C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',\n\t\t'@wordpress/customize-widgets'\n\t);\n"]}
|
|
File without changes
|