@wordpress/customize-widgets 4.3.2 → 4.4.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/focus-control/index.js +7 -1
- package/build/components/focus-control/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.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/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/{experiments.js → private-apis.js} +3 -3
- package/build/private-apis.js.map +1 -0
- package/build-module/components/focus-control/index.js +7 -1
- package/build-module/components/focus-control/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/sidebar-block-editor/sidebar-editor-provider.js +3 -3
- package/build-module/components/sidebar-block-editor/sidebar-editor-provider.js.map +1 -1
- package/build-module/index.js +3 -3
- package/build-module/index.js.map +1 -1
- package/build-module/{experiments.js → private-apis.js} +2 -2
- package/build-module/private-apis.js.map +1 -0
- package/package.json +22 -22
- package/src/components/focus-control/index.js +9 -4
- package/src/components/keyboard-shortcut-help-modal/config.js +1 -1
- package/src/components/sidebar-block-editor/sidebar-editor-provider.js +3 -3
- package/src/index.js +3 -4
- package/src/{experiments.js → private-apis.js} +1 -1
- package/build/experiments.js.map +0 -1
- package/build-module/experiments.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -55,14 +55,20 @@ function FocusControl(_ref) {
|
|
|
55
55
|
focusWidget(widgetId);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
let previewBound = false;
|
|
59
|
+
|
|
58
60
|
function handleReady() {
|
|
59
61
|
api.previewer.preview.bind('focus-control-for-setting', handleFocus);
|
|
62
|
+
previewBound = true;
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
api.previewer.bind('ready', handleReady);
|
|
63
66
|
return () => {
|
|
64
67
|
api.previewer.unbind('ready', handleReady);
|
|
65
|
-
|
|
68
|
+
|
|
69
|
+
if (previewBound) {
|
|
70
|
+
api.previewer.preview.unbind('focus-control-for-setting', handleFocus);
|
|
71
|
+
}
|
|
66
72
|
};
|
|
67
73
|
}, [api, focusWidget]);
|
|
68
74
|
const context = (0, _element.useMemo)(() => [focusedWidgetIdRef, focusWidget], [focusedWidgetIdRef, focusWidget]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/components/focus-control/index.js"],"names":["FocusControlContext","FocusControl","api","sidebarControls","children","focusedWidgetIdRef","setFocusedWidgetIdRef","current","focusWidget","widgetId","sidebarControl","widgets","setting","get","includes","sectionInstance","expand","completeCallback","handleFocus","settingId","handleReady","previewer","preview","bind","unbind","context","useFocusControl"],"mappings":";;;;;;;;AAGA;;AAYA;;AAfA;AACA;AACA;;AAUA;AACA;AACA;AAGA,MAAMA,mBAAmB,GAAG,6BAA5B;;AAEe,SAASC,YAAT,OAA4D;AAAA,MAArC;AAAEC,IAAAA,GAAF;AAAOC,IAAAA,eAAP;AAAwBC,IAAAA;AAAxB,GAAqC;AAC1E,QAAM,CAAEC,kBAAF,EAAsBC,qBAAtB,IAAgD,uBAAU;AAC/DC,IAAAA,OAAO,EAAE;AADsD,GAAV,CAAtD;AAIA,QAAMC,WAAW,GAAG,0BACjBC,QAAF,IAAgB;AACf,SAAM,MAAMC,cAAZ,IAA8BP,eAA9B,EAAgD;AAC/C,YAAMQ,OAAO,GAAGD,cAAc,CAACE,OAAf,CAAuBC,GAAvB,EAAhB;;AAEA,UAAKF,OAAO,CAACG,QAAR,CAAkBL,QAAlB,CAAL,EAAoC;AACnCC,QAAAA,cAAc,CAACK,eAAf,CAA+BC,MAA/B,CAAuC;AACtC;AACA;AACAC,UAAAA,gBAAgB,GAAG;AAClB;AACA;AACAX,YAAAA,qBAAqB,CAAE;AAAEC,cAAAA,OAAO,EAAEE;AAAX,aAAF,CAArB;AACA;;AAPqC,SAAvC;AAUA;AACA;AACD;AACD,GAnBkB,EAoBnB,CAAEN,eAAF,CApBmB,CAApB;AAuBA,0BAAW,MAAM;AAChB,aAASe,WAAT,CAAsBC,SAAtB,EAAkC;AACjC,YAAMV,QAAQ,GAAG,gCAAqBU,SAArB,CAAjB;AAEAX,MAAAA,WAAW,CAAEC,QAAF,CAAX;AACA;;AAED,
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/components/focus-control/index.js"],"names":["FocusControlContext","FocusControl","api","sidebarControls","children","focusedWidgetIdRef","setFocusedWidgetIdRef","current","focusWidget","widgetId","sidebarControl","widgets","setting","get","includes","sectionInstance","expand","completeCallback","handleFocus","settingId","previewBound","handleReady","previewer","preview","bind","unbind","context","useFocusControl"],"mappings":";;;;;;;;AAGA;;AAYA;;AAfA;AACA;AACA;;AAUA;AACA;AACA;AAGA,MAAMA,mBAAmB,GAAG,6BAA5B;;AAEe,SAASC,YAAT,OAA4D;AAAA,MAArC;AAAEC,IAAAA,GAAF;AAAOC,IAAAA,eAAP;AAAwBC,IAAAA;AAAxB,GAAqC;AAC1E,QAAM,CAAEC,kBAAF,EAAsBC,qBAAtB,IAAgD,uBAAU;AAC/DC,IAAAA,OAAO,EAAE;AADsD,GAAV,CAAtD;AAIA,QAAMC,WAAW,GAAG,0BACjBC,QAAF,IAAgB;AACf,SAAM,MAAMC,cAAZ,IAA8BP,eAA9B,EAAgD;AAC/C,YAAMQ,OAAO,GAAGD,cAAc,CAACE,OAAf,CAAuBC,GAAvB,EAAhB;;AAEA,UAAKF,OAAO,CAACG,QAAR,CAAkBL,QAAlB,CAAL,EAAoC;AACnCC,QAAAA,cAAc,CAACK,eAAf,CAA+BC,MAA/B,CAAuC;AACtC;AACA;AACAC,UAAAA,gBAAgB,GAAG;AAClB;AACA;AACAX,YAAAA,qBAAqB,CAAE;AAAEC,cAAAA,OAAO,EAAEE;AAAX,aAAF,CAArB;AACA;;AAPqC,SAAvC;AAUA;AACA;AACD;AACD,GAnBkB,EAoBnB,CAAEN,eAAF,CApBmB,CAApB;AAuBA,0BAAW,MAAM;AAChB,aAASe,WAAT,CAAsBC,SAAtB,EAAkC;AACjC,YAAMV,QAAQ,GAAG,gCAAqBU,SAArB,CAAjB;AAEAX,MAAAA,WAAW,CAAEC,QAAF,CAAX;AACA;;AAED,QAAIW,YAAY,GAAG,KAAnB;;AAEA,aAASC,WAAT,GAAuB;AACtBnB,MAAAA,GAAG,CAACoB,SAAJ,CAAcC,OAAd,CAAsBC,IAAtB,CACC,2BADD,EAECN,WAFD;AAIAE,MAAAA,YAAY,GAAG,IAAf;AACA;;AAEDlB,IAAAA,GAAG,CAACoB,SAAJ,CAAcE,IAAd,CAAoB,OAApB,EAA6BH,WAA7B;AAEA,WAAO,MAAM;AACZnB,MAAAA,GAAG,CAACoB,SAAJ,CAAcG,MAAd,CAAsB,OAAtB,EAA+BJ,WAA/B;;AACA,UAAKD,YAAL,EAAoB;AACnBlB,QAAAA,GAAG,CAACoB,SAAJ,CAAcC,OAAd,CAAsBE,MAAtB,CACC,2BADD,EAECP,WAFD;AAIA;AACD,KARD;AASA,GA5BD,EA4BG,CAAEhB,GAAF,EAAOM,WAAP,CA5BH;AA8BA,QAAMkB,OAAO,GAAG,sBACf,MAAM,CAAErB,kBAAF,EAAsBG,WAAtB,CADS,EAEf,CAAEH,kBAAF,EAAsBG,WAAtB,CAFe,CAAhB;AAKA,SACC,4BAAC,mBAAD,CAAqB,QAArB;AAA8B,IAAA,KAAK,EAAGkB;AAAtC,KACGtB,QADH,CADD;AAKA;;AAEM,MAAMuB,eAAe,GAAG,MAAM,yBAAY3B,mBAAZ,CAA9B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseState,\n\tuseEffect,\n\tuseContext,\n\tuseCallback,\n\tuseMemo,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { settingIdToWidgetId } from '../../utils';\n\nconst FocusControlContext = createContext();\n\nexport default function FocusControl( { api, sidebarControls, children } ) {\n\tconst [ focusedWidgetIdRef, setFocusedWidgetIdRef ] = useState( {\n\t\tcurrent: null,\n\t} );\n\n\tconst focusWidget = useCallback(\n\t\t( widgetId ) => {\n\t\t\tfor ( const sidebarControl of sidebarControls ) {\n\t\t\t\tconst widgets = sidebarControl.setting.get();\n\n\t\t\t\tif ( widgets.includes( widgetId ) ) {\n\t\t\t\t\tsidebarControl.sectionInstance.expand( {\n\t\t\t\t\t\t// Schedule it after the complete callback so that\n\t\t\t\t\t\t// it won't be overridden by the \"Back\" button focus.\n\t\t\t\t\t\tcompleteCallback() {\n\t\t\t\t\t\t\t// Create a \"ref-like\" object every time to ensure\n\t\t\t\t\t\t\t// the same widget id can also triggers the focus control.\n\t\t\t\t\t\t\tsetFocusedWidgetIdRef( { current: widgetId } );\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[ sidebarControls ]\n\t);\n\n\tuseEffect( () => {\n\t\tfunction handleFocus( settingId ) {\n\t\t\tconst widgetId = settingIdToWidgetId( settingId );\n\n\t\t\tfocusWidget( widgetId );\n\t\t}\n\n\t\tlet previewBound = false;\n\n\t\tfunction handleReady() {\n\t\t\tapi.previewer.preview.bind(\n\t\t\t\t'focus-control-for-setting',\n\t\t\t\thandleFocus\n\t\t\t);\n\t\t\tpreviewBound = true;\n\t\t}\n\n\t\tapi.previewer.bind( 'ready', handleReady );\n\n\t\treturn () => {\n\t\t\tapi.previewer.unbind( 'ready', handleReady );\n\t\t\tif ( previewBound ) {\n\t\t\t\tapi.previewer.preview.unbind(\n\t\t\t\t\t'focus-control-for-setting',\n\t\t\t\t\thandleFocus\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\t}, [ api, focusWidget ] );\n\n\tconst context = useMemo(\n\t\t() => [ focusedWidgetIdRef, focusWidget ],\n\t\t[ focusedWidgetIdRef, focusWidget ]\n\t);\n\n\treturn (\n\t\t<FocusControlContext.Provider value={ context }>\n\t\t\t{ children }\n\t\t</FocusControlContext.Provider>\n\t);\n}\n\nexport const useFocusControl = () => useContext( FocusControlContext );\n"]}
|
|
@@ -38,7 +38,7 @@ const textFormattingShortcuts = [{
|
|
|
38
38
|
keyCombination: {
|
|
39
39
|
character: '[['
|
|
40
40
|
},
|
|
41
|
-
description: (0, _i18n.__)('Insert a link to a post or page')
|
|
41
|
+
description: (0, _i18n.__)('Insert a link to a post or page.')
|
|
42
42
|
}, {
|
|
43
43
|
keyCombination: {
|
|
44
44
|
modifier: 'primary',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/components/keyboard-shortcut-help-modal/config.js"],"names":["textFormattingShortcuts","keyCombination","modifier","character","description"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAMA,uBAAuB,GAAG,CACtC;AACCC,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,8BAAJ;AAFd,CADsC,EAKtC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,gCAAJ;AAFd,CALsC,EAStC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,wCAAJ;AAFd,CATsC,EAatC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,cAAZ;AAA4BC,IAAAA,SAAS,EAAE;AAAvC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,gBAAJ;AAFd,CAbsC,EAiBtC;AACCH,EAAAA,cAAc,EAAE;AAAEE,IAAAA,SAAS,EAAE;AAAb,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/components/keyboard-shortcut-help-modal/config.js"],"names":["textFormattingShortcuts","keyCombination","modifier","character","description"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAMA,uBAAuB,GAAG,CACtC;AACCC,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,8BAAJ;AAFd,CADsC,EAKtC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,gCAAJ;AAFd,CALsC,EAStC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,wCAAJ;AAFd,CATsC,EAatC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,cAAZ;AAA4BC,IAAAA,SAAS,EAAE;AAAvC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,gBAAJ;AAFd,CAbsC,EAiBtC;AACCH,EAAAA,cAAc,EAAE;AAAEE,IAAAA,SAAS,EAAE;AAAb,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,kCAAJ;AAFd,CAjBsC,EAqBtC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,8BAAJ;AAFd,CArBsC,EAyBtC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,QAAZ;AAAsBC,IAAAA,SAAS,EAAE;AAAjC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,kCAAJ;AAFd,CAzBsC,EA6BtC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,QAAZ;AAAsBC,IAAAA,SAAS,EAAE;AAAjC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,qCAAJ;AAFd,CA7BsC,CAAhC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const textFormattingShortcuts = [\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'b' },\n\t\tdescription: __( 'Make the selected text bold.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'i' },\n\t\tdescription: __( 'Make the selected text italic.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'k' },\n\t\tdescription: __( 'Convert the selected text into a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primaryShift', character: 'k' },\n\t\tdescription: __( 'Remove a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { character: '[[' },\n\t\tdescription: __( 'Insert a link to a post or page.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'u' },\n\t\tdescription: __( 'Underline the selected text.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: 'd' },\n\t\tdescription: __( 'Strikethrough the selected text.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: 'x' },\n\t\tdescription: __( 'Make the selected text inline code.' ),\n\t},\n];\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 _privateApis = require("../../private-apis");
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* WordPress dependencies
|
|
@@ -26,7 +26,7 @@ var _experiments = require("../../experiments");
|
|
|
26
26
|
*/
|
|
27
27
|
const {
|
|
28
28
|
ExperimentalBlockEditorProvider
|
|
29
|
-
} = (0,
|
|
29
|
+
} = (0, _privateApis.unlock)(_blockEditor.privateApis);
|
|
30
30
|
|
|
31
31
|
function SidebarEditorProvider(_ref) {
|
|
32
32
|
let {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/components/sidebar-block-editor/sidebar-editor-provider.js"],"names":["ExperimentalBlockEditorProvider","
|
|
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,yBAAQC,wBAAR,CAA5C;;AAEe,SAASC,qBAAT,OAIX;AAAA,MAJ2C;AAC9CC,IAAAA,OAD8C;AAE9CC,IAAAA,QAF8C;AAG9CC,IAAAA;AAH8C,GAI3C;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 '../../private-apis';\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"]}
|
package/build/index.js
CHANGED
|
@@ -85,11 +85,11 @@ function initialize(editorName, blockEditorSettings) {
|
|
|
85
85
|
sidebarControls.push(control);
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
|
-
(0, _element.
|
|
88
|
+
(0, _element.createRoot)(container).render((0, _element.createElement)(_customizeWidgets.default, {
|
|
89
89
|
api: wp.customize,
|
|
90
90
|
sidebarControls: sidebarControls,
|
|
91
91
|
blockEditorSettings: blockEditorSettings
|
|
92
|
-
})
|
|
92
|
+
}));
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/index.js"],"names":["wp","window","DISABLED_BLOCKS","ENABLE_EXPERIMENTAL_FSE_BLOCKS","initialize","editorName","blockEditorSettings","preferencesStore","setDefaults","fixedToolbar","welcomeGuide","blocksStore","__experimentalReapplyBlockTypeFilters","coreBlocks","filter","block","includes","name","startsWith","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","SidebarControl","customize","sectionConstructor","sidebar","controlConstructor","sidebar_block_editor","container","document","createElement","body","appendChild","bind","sidebarControls","control","each","push"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AAKA;;AAIA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AA3BA;AACA;AACA;;AAmBA;AACA;AACA;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAASC,MAAf;AAEA,MAAMC,eAAe,GAAG,CACvB,WADuB,EAEvB,YAFuB,EAGvB,eAHuB,EAIvB,oBAJuB,CAAxB;AAMA,MAAMC,8BAA8B,GAAG,KAAvC;AAEA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,UAAT,CAAqBC,UAArB,EAAiCC,mBAAjC,EAAuD;AAC7D,sBAAUC,kBAAV,EAA6BC,WAA7B,CAA0C,wBAA1C,EAAoE;AACnEC,IAAAA,YAAY,EAAE,KADqD;AAEnEC,IAAAA,YAAY,EAAE;AAFqD,GAApE;;AAKA,sBAAUC,aAAV,EAAwBC,qCAAxB;;AACA,QAAMC,UAAU,GAAG,iDAA8BC,MAA9B,CAAwCC,KAAF,IAAa;AACrE,WAAO,EACNb,eAAe,CAACc,QAAhB,CAA0BD,KAAK,CAACE,IAAhC,KACAF,KAAK,CAACE,IAAN,CAAWC,UAAX,CAAuB,WAAvB,CADA,IAEAH,KAAK,CAACE,IAAN,CAAWC,UAAX,CAAuB,YAAvB,CAFA,IAGAH,KAAK,CAACE,IAAN,CAAWC,UAAX,CAAuB,WAAvB,CAHA,IAIAH,KAAK,CAACE,IAAN,CAAWC,UAAX,CAAuB,iBAAvB,CALM,CAAP;AAOA,GARkB,CAAnB;AASA,wCAAoBL,UAApB;AACA;;AACA,MAAKM,OAAO,CAACC,GAAR,CAAYC,mBAAjB,EAAuC;AACtC,oEAA8C;AAC7CC,MAAAA,eAAe,EAAEnB;AAD4B,KAA9C;AAGA;;AACD,+CAAgCG,mBAAhC;AACA,2CAxB6D,CA0B7D;AACA;AACA;AACA;;AACA,6CAA+B,WAA/B;AAEA,QAAMiB,cAAc,GAAG,6BAAmBjB,mBAAnB,CAAvB;AAEAN,EAAAA,EAAE,CAACwB,SAAH,CAAaC,kBAAb,CAAgCC,OAAhC,GAA0C,8BAA1C;AACA1B,EAAAA,EAAE,CAACwB,SAAH,CAAaG,kBAAb,CAAgCC,oBAAhC,GAAuDL,cAAvD;AAEA,QAAMM,SAAS,GAAGC,QAAQ,CAACC,aAAT,CAAwB,KAAxB,CAAlB;AACAD,EAAAA,QAAQ,CAACE,IAAT,CAAcC,WAAd,CAA2BJ,SAA3B;AAEA7B,EAAAA,EAAE,CAACwB,SAAH,CAAaU,IAAb,CAAmB,OAAnB,EAA4B,MAAM;AACjC,UAAMC,eAAe,GAAG,EAAxB;AACAnC,IAAAA,EAAE,CAACwB,SAAH,CAAaY,OAAb,CAAqBC,IAArB,CAA6BD,OAAF,IAAe;AACzC,UAAKA,OAAO,YAAYb,cAAxB,EAAyC;AACxCY,QAAAA,eAAe,CAACG,IAAhB,CAAsBF,OAAtB;AACA;AACD,KAJD;AAMA,
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/index.js"],"names":["wp","window","DISABLED_BLOCKS","ENABLE_EXPERIMENTAL_FSE_BLOCKS","initialize","editorName","blockEditorSettings","preferencesStore","setDefaults","fixedToolbar","welcomeGuide","blocksStore","__experimentalReapplyBlockTypeFilters","coreBlocks","filter","block","includes","name","startsWith","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","SidebarControl","customize","sectionConstructor","sidebar","controlConstructor","sidebar_block_editor","container","document","createElement","body","appendChild","bind","sidebarControls","control","each","push","render"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AAKA;;AAIA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AA3BA;AACA;AACA;;AAmBA;AACA;AACA;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAASC,MAAf;AAEA,MAAMC,eAAe,GAAG,CACvB,WADuB,EAEvB,YAFuB,EAGvB,eAHuB,EAIvB,oBAJuB,CAAxB;AAMA,MA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J,SAA3B;AAEA7B,EAAAA,EAAE,CAACwB,SAAH,CAAaU,IAAb,CAAmB,OAAnB,EAA4B,MAAM;AACjC,UAAMC,eAAe,GAAG,EAAxB;AACAnC,IAAAA,EAAE,CAACwB,SAAH,CAAaY,OAAb,CAAqBC,IAArB,CAA6BD,OAAF,IAAe;AACzC,UAAKA,OAAO,YAAYb,cAAxB,EAAyC;AACxCY,QAAAA,eAAe,CAACG,IAAhB,CAAsBF,OAAtB;AACA;AACD,KAJD;AAMA,6BAAYP,SAAZ,EAAwBU,MAAxB,CACC,4BAAC,yBAAD;AACC,MAAA,GAAG,EAAGvC,EAAE,CAACwB,SADV;AAEC,MAAA,eAAe,EAAGW,eAFnB;AAGC,MAAA,mBAAmB,EAAG7B;AAHvB,MADD;AAOA,GAfD;AAgBA","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 ).__experimentalReapplyBlockTypeFilters();\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}\n"]}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.unlock = exports.lock = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _privateApis = require("@wordpress/private-apis");
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* WordPress dependencies
|
|
@@ -13,7 +13,7 @@ var _experiments = require("@wordpress/experiments");
|
|
|
13
13
|
const {
|
|
14
14
|
lock,
|
|
15
15
|
unlock
|
|
16
|
-
} = (0,
|
|
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=private-apis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -46,14 +46,20 @@ export default function FocusControl(_ref) {
|
|
|
46
46
|
focusWidget(widgetId);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
let previewBound = false;
|
|
50
|
+
|
|
49
51
|
function handleReady() {
|
|
50
52
|
api.previewer.preview.bind('focus-control-for-setting', handleFocus);
|
|
53
|
+
previewBound = true;
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
api.previewer.bind('ready', handleReady);
|
|
54
57
|
return () => {
|
|
55
58
|
api.previewer.unbind('ready', handleReady);
|
|
56
|
-
|
|
59
|
+
|
|
60
|
+
if (previewBound) {
|
|
61
|
+
api.previewer.preview.unbind('focus-control-for-setting', handleFocus);
|
|
62
|
+
}
|
|
57
63
|
};
|
|
58
64
|
}, [api, focusWidget]);
|
|
59
65
|
const context = useMemo(() => [focusedWidgetIdRef, focusWidget], [focusedWidgetIdRef, focusWidget]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/components/focus-control/index.js"],"names":["createContext","useState","useEffect","useContext","useCallback","useMemo","settingIdToWidgetId","FocusControlContext","FocusControl","api","sidebarControls","children","focusedWidgetIdRef","setFocusedWidgetIdRef","current","focusWidget","widgetId","sidebarControl","widgets","setting","get","includes","sectionInstance","expand","completeCallback","handleFocus","settingId","handleReady","previewer","preview","bind","unbind","context","useFocusControl"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,aADD,EAECC,QAFD,EAGCC,SAHD,EAICC,UAJD,EAKCC,WALD,EAMCC,OAND,QAOO,oBAPP;AASA;AACA;AACA;;AACA,SAASC,mBAAT,QAAoC,aAApC;AAEA,MAAMC,mBAAmB,GAAGP,aAAa,EAAzC;AAEA,eAAe,SAASQ,YAAT,OAA4D;AAAA,MAArC;AAAEC,IAAAA,GAAF;AAAOC,IAAAA,eAAP;AAAwBC,IAAAA;AAAxB,GAAqC;AAC1E,QAAM,CAAEC,kBAAF,EAAsBC,qBAAtB,IAAgDZ,QAAQ,CAAE;AAC/Da,IAAAA,OAAO,EAAE;AADsD,GAAF,CAA9D;AAIA,QAAMC,WAAW,GAAGX,WAAW,CAC5BY,QAAF,IAAgB;AACf,SAAM,MAAMC,cAAZ,IAA8BP,eAA9B,EAAgD;AAC/C,YAAMQ,OAAO,GAAGD,cAAc,CAACE,OAAf,CAAuBC,GAAvB,EAAhB;;AAEA,UAAKF,OAAO,CAACG,QAAR,CAAkBL,QAAlB,CAAL,EAAoC;AACnCC,QAAAA,cAAc,CAACK,eAAf,CAA+BC,MAA/B,CAAuC;AACtC;AACA;AACAC,UAAAA,gBAAgB,GAAG;AAClB;AACA;AACAX,YAAAA,qBAAqB,CAAE;AAAEC,cAAAA,OAAO,EAAEE;AAAX,aAAF,CAArB;AACA;;AAPqC,SAAvC;AAUA;AACA;AACD;AACD,GAnB6B,EAoB9B,CAAEN,eAAF,CApB8B,CAA/B;AAuBAR,EAAAA,SAAS,CAAE,MAAM;AAChB,aAASuB,WAAT,CAAsBC,SAAtB,EAAkC;AACjC,YAAMV,QAAQ,GAAGV,mBAAmB,CAAEoB,SAAF,CAApC;AAEAX,MAAAA,WAAW,CAAEC,QAAF,CAAX;AACA;;AAED,
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/components/focus-control/index.js"],"names":["createContext","useState","useEffect","useContext","useCallback","useMemo","settingIdToWidgetId","FocusControlContext","FocusControl","api","sidebarControls","children","focusedWidgetIdRef","setFocusedWidgetIdRef","current","focusWidget","widgetId","sidebarControl","widgets","setting","get","includes","sectionInstance","expand","completeCallback","handleFocus","settingId","previewBound","handleReady","previewer","preview","bind","unbind","context","useFocusControl"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,aADD,EAECC,QAFD,EAGCC,SAHD,EAICC,UAJD,EAKCC,WALD,EAMCC,OAND,QAOO,oBAPP;AASA;AACA;AACA;;AACA,SAASC,mBAAT,QAAoC,aAApC;AAEA,MAAMC,mBAAmB,GAAGP,aAAa,EAAzC;AAEA,eAAe,SAASQ,YAAT,OAA4D;AAAA,MAArC;AAAEC,IAAAA,GAAF;AAAOC,IAAAA,eAAP;AAAwBC,IAAAA;AAAxB,GAAqC;AAC1E,QAAM,CAAEC,kBAAF,EAAsBC,qBAAtB,IAAgDZ,QAAQ,CAAE;AAC/Da,IAAAA,OAAO,EAAE;AADsD,G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CAAT;AA8BA,QAAMkB,OAAO,GAAG5B,OAAO,CACtB,MAAM,CAAEO,kBAAF,EAAsBG,WAAtB,CADgB,EAEtB,CAAEH,kBAAF,EAAsBG,WAAtB,CAFsB,CAAvB;AAKA,SACC,cAAC,mBAAD,CAAqB,QAArB;AAA8B,IAAA,KAAK,EAAGkB;AAAtC,KACGtB,QADH,CADD;AAKA;AAED,OAAO,MAAMuB,eAAe,GAAG,MAAM/B,UAAU,CAAEI,mBAAF,CAAxC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseState,\n\tuseEffect,\n\tuseContext,\n\tuseCallback,\n\tuseMemo,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { settingIdToWidgetId } from '../../utils';\n\nconst FocusControlContext = createContext();\n\nexport default function FocusControl( { api, sidebarControls, children } ) {\n\tconst [ focusedWidgetIdRef, setFocusedWidgetIdRef ] = useState( {\n\t\tcurrent: null,\n\t} );\n\n\tconst focusWidget = useCallback(\n\t\t( widgetId ) => {\n\t\t\tfor ( const sidebarControl of sidebarControls ) {\n\t\t\t\tconst widgets = sidebarControl.setting.get();\n\n\t\t\t\tif ( widgets.includes( widgetId ) ) {\n\t\t\t\t\tsidebarControl.sectionInstance.expand( {\n\t\t\t\t\t\t// Schedule it after the complete callback so that\n\t\t\t\t\t\t// it won't be overridden by the \"Back\" button focus.\n\t\t\t\t\t\tcompleteCallback() {\n\t\t\t\t\t\t\t// Create a \"ref-like\" object every time to ensure\n\t\t\t\t\t\t\t// the same widget id can also triggers the focus control.\n\t\t\t\t\t\t\tsetFocusedWidgetIdRef( { current: widgetId } );\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[ sidebarControls ]\n\t);\n\n\tuseEffect( () => {\n\t\tfunction handleFocus( settingId ) {\n\t\t\tconst widgetId = settingIdToWidgetId( settingId );\n\n\t\t\tfocusWidget( widgetId );\n\t\t}\n\n\t\tlet previewBound = false;\n\n\t\tfunction handleReady() {\n\t\t\tapi.previewer.preview.bind(\n\t\t\t\t'focus-control-for-setting',\n\t\t\t\thandleFocus\n\t\t\t);\n\t\t\tpreviewBound = true;\n\t\t}\n\n\t\tapi.previewer.bind( 'ready', handleReady );\n\n\t\treturn () => {\n\t\t\tapi.previewer.unbind( 'ready', handleReady );\n\t\t\tif ( previewBound ) {\n\t\t\t\tapi.previewer.preview.unbind(\n\t\t\t\t\t'focus-control-for-setting',\n\t\t\t\t\thandleFocus\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\t}, [ api, focusWidget ] );\n\n\tconst context = useMemo(\n\t\t() => [ focusedWidgetIdRef, focusWidget ],\n\t\t[ focusedWidgetIdRef, focusWidget ]\n\t);\n\n\treturn (\n\t\t<FocusControlContext.Provider value={ context }>\n\t\t\t{ children }\n\t\t</FocusControlContext.Provider>\n\t);\n}\n\nexport const useFocusControl = () => useContext( FocusControlContext );\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/components/keyboard-shortcut-help-modal/config.js"],"names":["__","textFormattingShortcuts","keyCombination","modifier","character","description"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA,OAAO,MAAMC,uBAAuB,GAAG,CACtC;AACCC,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,8BAAF;AAFhB,CADsC,EAKtC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,gCAAF;AAFhB,CALsC,EAStC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,wCAAF;AAFhB,CATsC,EAatC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,cAAZ;AAA4BC,IAAAA,SAAS,EAAE;AAAvC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,gBAAF;AAFhB,CAbsC,EAiBtC;AACCE,EAAAA,cAAc,EAAE;AAAEE,IAAAA,SAAS,EAAE;AAAb,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/components/keyboard-shortcut-help-modal/config.js"],"names":["__","textFormattingShortcuts","keyCombination","modifier","character","description"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA,OAAO,MAAMC,uBAAuB,GAAG,CACtC;AACCC,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,8BAAF;AAFhB,CADsC,EAKtC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,gCAAF;AAFhB,CALsC,EAStC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,wCAAF;AAFhB,CATsC,EAatC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,cAAZ;AAA4BC,IAAAA,SAAS,EAAE;AAAvC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,gBAAF;AAFhB,CAbsC,EAiBtC;AACCE,EAAAA,cAAc,EAAE;AAAEE,IAAAA,SAAS,EAAE;AAAb,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,kCAAF;AAFhB,CAjBsC,EAqBtC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,8BAAF;AAFhB,CArBsC,EAyBtC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,QAAZ;AAAsBC,IAAAA,SAAS,EAAE;AAAjC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,kCAAF;AAFhB,CAzBsC,EA6BtC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,QAAZ;AAAsBC,IAAAA,SAAS,EAAE;AAAjC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,qCAAF;AAFhB,CA7BsC,CAAhC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const textFormattingShortcuts = [\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'b' },\n\t\tdescription: __( 'Make the selected text bold.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'i' },\n\t\tdescription: __( 'Make the selected text italic.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'k' },\n\t\tdescription: __( 'Convert the selected text into a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primaryShift', character: 'k' },\n\t\tdescription: __( 'Remove a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { character: '[[' },\n\t\tdescription: __( 'Insert a link to a post or page.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'u' },\n\t\tdescription: __( 'Underline the selected text.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: 'd' },\n\t\tdescription: __( 'Strikethrough the selected text.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: 'x' },\n\t\tdescription: __( 'Make the selected text inline code.' ),\n\t},\n];\n"]}
|
|
@@ -3,17 +3,17 @@ import { createElement } from "@wordpress/element";
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
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 '../../private-apis';
|
|
14
14
|
const {
|
|
15
15
|
ExperimentalBlockEditorProvider
|
|
16
|
-
} = unlock(
|
|
16
|
+
} = unlock(blockEditorPrivateApis);
|
|
17
17
|
export default function SidebarEditorProvider(_ref) {
|
|
18
18
|
let {
|
|
19
19
|
sidebar,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/components/sidebar-block-editor/sidebar-editor-provider.js"],"names":["
|
|
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,oBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAsCD,MAAM,CAAEH,sBAAF,CAAlD;AAEA,eAAe,SAASK,qBAAT,OAIX;AAAA,MAJ2C;AAC9CC,IAAAA,OAD8C;AAE9CC,IAAAA,QAF8C;AAG9CC,IAAAA;AAH8C,GAI3C;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 '../../private-apis';\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"]}
|
package/build-module/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createElement } from "@wordpress/element";
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { createRoot } from '@wordpress/element';
|
|
7
7
|
import { registerCoreBlocks, __experimentalGetCoreBlocks, __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';
|
|
8
8
|
import { registerLegacyWidgetBlock, registerLegacyWidgetVariations, registerWidgetGroupBlock } from '@wordpress/widgets';
|
|
9
9
|
import { setFreeformContentHandlerName, store as blocksStore } from '@wordpress/blocks';
|
|
@@ -69,11 +69,11 @@ export function initialize(editorName, blockEditorSettings) {
|
|
|
69
69
|
sidebarControls.push(control);
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
-
render(createElement(CustomizeWidgets, {
|
|
72
|
+
createRoot(container).render(createElement(CustomizeWidgets, {
|
|
73
73
|
api: wp.customize,
|
|
74
74
|
sidebarControls: sidebarControls,
|
|
75
75
|
blockEditorSettings: blockEditorSettings
|
|
76
|
-
})
|
|
76
|
+
}));
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/index.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/customize-widgets/src/index.js"],"names":["createRoot","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","registerLegacyWidgetBlock","registerLegacyWidgetVariations","registerWidgetGroupBlock","setFreeformContentHandlerName","store","blocksStore","dispatch","preferencesStore","CustomizeWidgets","getSidebarSection","getSidebarControl","wp","window","DISABLED_BLOCKS","ENABLE_EXPERIMENTAL_FSE_BLOCKS","initialize","editorName","blockEditorSettings","setDefaults","fixedToolbar","welcomeGuide","__experimentalReapplyBlockTypeFilters","coreBlocks","filter","block","includes","name","startsWith","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","SidebarControl","customize","sectionConstructor","sidebar","controlConstructor","sidebar_block_editor","container","document","createElement","body","appendChild","bind","sidebarControls","control","each","push","render"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,UA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AAG3B;AAHvB,MADD;AAOA,GAfD;AAgBA","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 ).__experimentalReapplyBlockTypeFilters();\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}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/
|
|
4
|
+
import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';
|
|
5
5
|
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=private-apis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/customize-widgets",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
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": "^11.
|
|
28
|
-
"@wordpress/block-library": "^8.
|
|
29
|
-
"@wordpress/blocks": "^12.
|
|
30
|
-
"@wordpress/components": "^23.
|
|
31
|
-
"@wordpress/compose": "^6.
|
|
32
|
-
"@wordpress/core-data": "^6.
|
|
33
|
-
"@wordpress/data": "^8.
|
|
34
|
-
"@wordpress/dom": "^3.
|
|
35
|
-
"@wordpress/element": "^5.
|
|
36
|
-
"@wordpress/
|
|
37
|
-
"@wordpress/
|
|
38
|
-
"@wordpress/
|
|
39
|
-
"@wordpress/
|
|
40
|
-
"@wordpress/
|
|
41
|
-
"@wordpress/
|
|
42
|
-
"@wordpress/
|
|
43
|
-
"@wordpress/
|
|
44
|
-
"@wordpress/
|
|
45
|
-
"@wordpress/
|
|
46
|
-
"@wordpress/widgets": "^3.
|
|
27
|
+
"@wordpress/block-editor": "^11.4.0",
|
|
28
|
+
"@wordpress/block-library": "^8.4.0",
|
|
29
|
+
"@wordpress/blocks": "^12.4.0",
|
|
30
|
+
"@wordpress/components": "^23.4.0",
|
|
31
|
+
"@wordpress/compose": "^6.4.0",
|
|
32
|
+
"@wordpress/core-data": "^6.4.0",
|
|
33
|
+
"@wordpress/data": "^8.4.0",
|
|
34
|
+
"@wordpress/dom": "^3.27.0",
|
|
35
|
+
"@wordpress/element": "^5.4.0",
|
|
36
|
+
"@wordpress/hooks": "^3.27.0",
|
|
37
|
+
"@wordpress/i18n": "^4.27.0",
|
|
38
|
+
"@wordpress/icons": "^9.18.0",
|
|
39
|
+
"@wordpress/interface": "^5.4.0",
|
|
40
|
+
"@wordpress/is-shallow-equal": "^4.27.0",
|
|
41
|
+
"@wordpress/keyboard-shortcuts": "^4.4.0",
|
|
42
|
+
"@wordpress/keycodes": "^3.27.0",
|
|
43
|
+
"@wordpress/media-utils": "^4.18.0",
|
|
44
|
+
"@wordpress/preferences": "^3.4.0",
|
|
45
|
+
"@wordpress/private-apis": "^0.9.0",
|
|
46
|
+
"@wordpress/widgets": "^3.4.0",
|
|
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": "c25ff895413bad4354c55c0c2d732552618b0d56"
|
|
58
58
|
}
|
|
@@ -52,21 +52,26 @@ export default function FocusControl( { api, sidebarControls, children } ) {
|
|
|
52
52
|
focusWidget( widgetId );
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
let previewBound = false;
|
|
56
|
+
|
|
55
57
|
function handleReady() {
|
|
56
58
|
api.previewer.preview.bind(
|
|
57
59
|
'focus-control-for-setting',
|
|
58
60
|
handleFocus
|
|
59
61
|
);
|
|
62
|
+
previewBound = true;
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
api.previewer.bind( 'ready', handleReady );
|
|
63
66
|
|
|
64
67
|
return () => {
|
|
65
68
|
api.previewer.unbind( 'ready', handleReady );
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
if ( previewBound ) {
|
|
70
|
+
api.previewer.preview.unbind(
|
|
71
|
+
'focus-control-for-setting',
|
|
72
|
+
handleFocus
|
|
73
|
+
);
|
|
74
|
+
}
|
|
70
75
|
};
|
|
71
76
|
}, [ api, focusWidget ] );
|
|
72
77
|
|
|
@@ -22,7 +22,7 @@ export const textFormattingShortcuts = [
|
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
keyCombination: { character: '[[' },
|
|
25
|
-
description: __( 'Insert a link to a post or page' ),
|
|
25
|
+
description: __( 'Insert a link to a post or page.' ),
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
keyCombination: { modifier: 'primary', character: 'u' },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
@@ -9,9 +9,9 @@ import { experiments as blockEditorExperiments } 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 '../../private-apis';
|
|
13
13
|
|
|
14
|
-
const { ExperimentalBlockEditorProvider } = unlock(
|
|
14
|
+
const { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );
|
|
15
15
|
|
|
16
16
|
export default function SidebarEditorProvider( {
|
|
17
17
|
sidebar,
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { createRoot } from '@wordpress/element';
|
|
5
5
|
import {
|
|
6
6
|
registerCoreBlocks,
|
|
7
7
|
__experimentalGetCoreBlocks,
|
|
@@ -91,13 +91,12 @@ export function initialize( editorName, blockEditorSettings ) {
|
|
|
91
91
|
}
|
|
92
92
|
} );
|
|
93
93
|
|
|
94
|
-
render(
|
|
94
|
+
createRoot( container ).render(
|
|
95
95
|
<CustomizeWidgets
|
|
96
96
|
api={ wp.customize }
|
|
97
97
|
sidebarControls={ sidebarControls }
|
|
98
98
|
blockEditorSettings={ blockEditorSettings }
|
|
99
|
-
|
|
100
|
-
container
|
|
99
|
+
/>
|
|
101
100
|
);
|
|
102
101
|
} );
|
|
103
102
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/
|
|
4
|
+
import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';
|
|
5
5
|
|
|
6
6
|
export const { lock, unlock } =
|
|
7
7
|
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
|
package/build/experiments.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/experiments.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/experiments';\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/experiments.js"],"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAT,QAAiE,wBAAjE;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/experiments';\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"]}
|