@wordpress/customize-widgets 6.0.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/block-appender/index.cjs +24 -41
- package/build/components/block-appender/index.cjs.map +1 -7
- package/build/components/block-inspector-button/index.cjs +24 -52
- package/build/components/block-inspector-button/index.cjs.map +1 -7
- package/build/components/customize-widgets/index.cjs +76 -97
- package/build/components/customize-widgets/index.cjs.map +1 -7
- package/build/components/customize-widgets/use-clear-selected-block.cjs +58 -67
- package/build/components/customize-widgets/use-clear-selected-block.cjs.map +1 -7
- package/build/components/error-boundary/index.cjs +115 -155
- package/build/components/error-boundary/index.cjs.map +1 -7
- package/build/components/focus-control/index.cjs +44 -84
- package/build/components/focus-control/index.cjs.map +1 -7
- package/build/components/focus-control/use-blocks-focus-control.cjs +28 -49
- package/build/components/focus-control/use-blocks-focus-control.cjs.map +1 -7
- package/build/components/header/index.cjs +84 -122
- package/build/components/header/index.cjs.map +1 -7
- package/build/components/inserter/index.cjs +43 -78
- package/build/components/inserter/index.cjs.map +1 -7
- package/build/components/inserter/use-inserter.cjs +22 -54
- package/build/components/inserter/use-inserter.cjs.map +1 -7
- package/build/components/keyboard-shortcut-help-modal/config.cjs +88 -85
- package/build/components/keyboard-shortcut-help-modal/config.cjs.map +1 -7
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.cjs +40 -57
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.cjs.map +1 -7
- package/build/components/keyboard-shortcut-help-modal/index.cjs +103 -165
- package/build/components/keyboard-shortcut-help-modal/index.cjs.map +1 -7
- package/build/components/keyboard-shortcut-help-modal/shortcut.cjs +37 -76
- package/build/components/keyboard-shortcut-help-modal/shortcut.cjs.map +1 -7
- package/build/components/keyboard-shortcuts/index.cjs +70 -100
- package/build/components/keyboard-shortcuts/index.cjs.map +1 -7
- package/build/components/more-menu/index.cjs +103 -151
- package/build/components/more-menu/index.cjs.map +1 -7
- package/build/components/sidebar-block-editor/index.cjs +122 -155
- package/build/components/sidebar-block-editor/index.cjs.map +1 -7
- package/build/components/sidebar-block-editor/sidebar-adapter.cjs +207 -270
- package/build/components/sidebar-block-editor/sidebar-adapter.cjs.map +1 -7
- package/build/components/sidebar-block-editor/sidebar-editor-provider.cjs +40 -50
- package/build/components/sidebar-block-editor/sidebar-editor-provider.cjs.map +1 -7
- package/build/components/sidebar-block-editor/use-sidebar-block-editor.cjs +75 -110
- package/build/components/sidebar-block-editor/use-sidebar-block-editor.cjs.map +1 -7
- package/build/components/sidebar-controls/index.cjs +27 -53
- package/build/components/sidebar-controls/index.cjs.map +1 -7
- package/build/components/welcome-guide/index.cjs +70 -94
- package/build/components/welcome-guide/index.cjs.map +1 -7
- package/build/controls/inserter-outer-section.cjs +68 -110
- package/build/controls/inserter-outer-section.cjs.map +1 -7
- package/build/controls/inspector-section.cjs +57 -90
- package/build/controls/inspector-section.cjs.map +1 -7
- package/build/controls/sidebar-control.cjs +55 -69
- package/build/controls/sidebar-control.cjs.map +1 -7
- package/build/controls/sidebar-section.cjs +79 -103
- package/build/controls/sidebar-section.cjs.map +1 -7
- package/build/filters/index.cjs +8 -5
- package/build/filters/move-to-sidebar.cjs +62 -78
- package/build/filters/move-to-sidebar.cjs.map +1 -7
- package/build/filters/replace-media-upload.cjs +11 -9
- package/build/filters/replace-media-upload.cjs.map +1 -7
- package/build/filters/wide-widget-display.cjs +20 -20
- package/build/filters/wide-widget-display.cjs.map +1 -7
- package/build/index.cjs +84 -91
- package/build/index.cjs.map +1 -7
- package/build/lock-unlock.cjs +10 -35
- package/build/lock-unlock.cjs.map +1 -7
- package/build/store/actions.cjs +49 -32
- package/build/store/actions.cjs.map +1 -7
- package/build/store/constants.cjs +12 -29
- package/build/store/constants.cjs.map +1 -7
- package/build/store/index.cjs +49 -41
- package/build/store/index.cjs.map +1 -7
- package/build/store/reducer.cjs +20 -33
- package/build/store/reducer.cjs.map +1 -7
- package/build/store/selectors.cjs +47 -38
- package/build/store/selectors.cjs.map +1 -7
- package/build/utils.cjs +81 -108
- package/build/utils.cjs.map +1 -7
- package/build-module/components/block-appender/index.mjs +18 -23
- package/build-module/components/block-appender/index.mjs.map +1 -7
- package/build-module/components/block-inspector-button/index.mjs +15 -28
- package/build-module/components/block-inspector-button/index.mjs.map +1 -7
- package/build-module/components/customize-widgets/index.mjs +45 -73
- package/build-module/components/customize-widgets/index.mjs.map +1 -7
- package/build-module/components/customize-widgets/use-clear-selected-block.mjs +52 -46
- package/build-module/components/customize-widgets/use-clear-selected-block.mjs.map +1 -7
- package/build-module/components/error-boundary/index.mjs +103 -128
- package/build-module/components/error-boundary/index.mjs.map +1 -7
- package/build-module/components/focus-control/index.mjs +37 -66
- package/build-module/components/focus-control/index.mjs.map +1 -7
- package/build-module/components/focus-control/use-blocks-focus-control.mjs +21 -27
- package/build-module/components/focus-control/use-blocks-focus-control.mjs.map +1 -7
- package/build-module/components/header/index.mjs +55 -92
- package/build-module/components/header/index.mjs.map +1 -7
- package/build-module/components/inserter/index.mjs +33 -53
- package/build-module/components/inserter/index.mjs.map +1 -7
- package/build-module/components/inserter/use-inserter.mjs +17 -34
- package/build-module/components/inserter/use-inserter.mjs.map +1 -7
- package/build-module/components/keyboard-shortcut-help-modal/config.mjs +83 -61
- package/build-module/components/keyboard-shortcut-help-modal/config.mjs.map +1 -7
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.mjs +19 -33
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.mjs.map +1 -7
- package/build-module/components/keyboard-shortcut-help-modal/index.mjs +75 -139
- package/build-module/components/keyboard-shortcut-help-modal/index.mjs.map +1 -7
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs +31 -55
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs.map +1 -7
- package/build-module/components/keyboard-shortcuts/index.mjs +62 -79
- package/build-module/components/keyboard-shortcuts/index.mjs.map +1 -7
- package/build-module/components/more-menu/index.mjs +76 -128
- package/build-module/components/more-menu/index.mjs.map +1 -7
- package/build-module/components/sidebar-block-editor/index.mjs +86 -128
- package/build-module/components/sidebar-block-editor/index.mjs.map +1 -7
- package/build-module/components/sidebar-block-editor/sidebar-adapter.mjs +202 -250
- package/build-module/components/sidebar-block-editor/sidebar-adapter.mjs.map +1 -7
- package/build-module/components/sidebar-block-editor/sidebar-editor-provider.mjs +17 -25
- package/build-module/components/sidebar-block-editor/sidebar-editor-provider.mjs.map +1 -7
- package/build-module/components/sidebar-block-editor/use-sidebar-block-editor.mjs +54 -86
- package/build-module/components/sidebar-block-editor/use-sidebar-block-editor.mjs.map +1 -7
- package/build-module/components/sidebar-controls/index.mjs +19 -27
- package/build-module/components/sidebar-controls/index.mjs.map +1 -7
- package/build-module/components/welcome-guide/index.mjs +62 -71
- package/build-module/components/welcome-guide/index.mjs.map +1 -7
- package/build-module/controls/inserter-outer-section.mjs +61 -88
- package/build-module/controls/inserter-outer-section.mjs.map +1 -7
- package/build-module/controls/inspector-section.mjs +52 -70
- package/build-module/controls/inspector-section.mjs.map +1 -7
- package/build-module/controls/sidebar-control.mjs +33 -45
- package/build-module/controls/sidebar-control.mjs.map +1 -7
- package/build-module/controls/sidebar-section.mjs +59 -80
- package/build-module/controls/sidebar-section.mjs.map +1 -7
- package/build-module/filters/index.mjs +0 -2
- package/build-module/filters/move-to-sidebar.mjs +52 -79
- package/build-module/filters/move-to-sidebar.mjs.map +1 -7
- package/build-module/filters/replace-media-upload.mjs +5 -8
- package/build-module/filters/replace-media-upload.mjs.map +1 -7
- package/build-module/filters/wide-widget-display.mjs +13 -18
- package/build-module/filters/wide-widget-display.mjs.map +1 -7
- package/build-module/index.mjs +53 -71
- package/build-module/index.mjs.map +1 -7
- package/build-module/lock-unlock.mjs +5 -10
- package/build-module/lock-unlock.mjs.map +1 -7
- package/build-module/store/actions.mjs +44 -8
- package/build-module/store/actions.mjs.map +1 -7
- package/build-module/store/constants.mjs +7 -5
- package/build-module/store/constants.mjs.map +1 -7
- package/build-module/store/index.mjs +15 -11
- package/build-module/store/index.mjs.map +1 -7
- package/build-module/store/reducer.mjs +15 -13
- package/build-module/store/reducer.mjs.map +1 -7
- package/build-module/store/selectors.mjs +41 -13
- package/build-module/store/selectors.mjs.map +1 -7
- package/build-module/utils.mjs +74 -82
- package/build-module/utils.mjs.map +1 -7
- package/package.json +27 -27
- package/src/components/customize-widgets/index.jsx +2 -2
- package/src/components/welcome-guide/index.jsx +6 -2
- package/build/filters/index.cjs.map +0 -7
- package/build-module/filters/index.mjs.map +0 -7
|
@@ -1,80 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
5
|
+
});
|
|
6
|
+
// \0rolldown/runtime.js
|
|
1
7
|
var __create = Object.create;
|
|
2
8
|
var __defProp = Object.defineProperty;
|
|
3
9
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
10
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
11
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
12
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
13
|
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
15
|
+
key = keys[i];
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: ((k) => from[k]).bind(null, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
18
22
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
let _wordpress_data = require("@wordpress/data");
|
|
28
|
+
let ___components_sidebar_block_editor_sidebar_adapter_js = require("../components/sidebar-block-editor/sidebar-adapter.cjs");
|
|
29
|
+
___components_sidebar_block_editor_sidebar_adapter_js = __toESM(___components_sidebar_block_editor_sidebar_adapter_js);
|
|
30
|
+
let __inserter_outer_section_js = require("./inserter-outer-section.cjs");
|
|
31
|
+
__inserter_outer_section_js = __toESM(__inserter_outer_section_js);
|
|
32
|
+
let ___store_index_js = require("../store/index.cjs");
|
|
29
33
|
// packages/customize-widgets/src/controls/sidebar-control.js
|
|
30
|
-
|
|
31
|
-
__export(sidebar_control_exports, {
|
|
32
|
-
default: () => getSidebarControl
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(sidebar_control_exports);
|
|
35
|
-
var import_data = require("@wordpress/data");
|
|
36
|
-
var import_sidebar_adapter = __toESM(require("../components/sidebar-block-editor/sidebar-adapter.cjs"));
|
|
37
|
-
var import_inserter_outer_section = __toESM(require("./inserter-outer-section.cjs"));
|
|
38
|
-
var import_store = require("../store/index.cjs");
|
|
39
|
-
var getInserterId = (controlId) => `widgets-inserter-${controlId}`;
|
|
34
|
+
const getInserterId = (controlId) => `widgets-inserter-${controlId}`;
|
|
40
35
|
function getSidebarControl() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (!expanded) {
|
|
69
|
-
(0, import_data.dispatch)(import_store.store).setIsInserterOpened(
|
|
70
|
-
false
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
this.subscribers.forEach(
|
|
74
|
-
(subscriber) => subscriber(expanded, args)
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
};
|
|
36
|
+
const { wp: { customize } } = window;
|
|
37
|
+
return class SidebarControl extends customize.Control {
|
|
38
|
+
constructor(...args) {
|
|
39
|
+
super(...args);
|
|
40
|
+
this.subscribers = /* @__PURE__ */ new Set();
|
|
41
|
+
}
|
|
42
|
+
ready() {
|
|
43
|
+
const InserterOuterSection = (0, __inserter_outer_section_js.default)();
|
|
44
|
+
this.inserter = new InserterOuterSection(getInserterId(this.id), {});
|
|
45
|
+
customize.section.add(this.inserter);
|
|
46
|
+
this.sectionInstance = customize.section(this.section());
|
|
47
|
+
this.inspector = this.sectionInstance.inspector;
|
|
48
|
+
this.sidebarAdapter = new ___components_sidebar_block_editor_sidebar_adapter_js.default(this.setting, customize);
|
|
49
|
+
}
|
|
50
|
+
subscribe(callback) {
|
|
51
|
+
this.subscribers.add(callback);
|
|
52
|
+
return () => {
|
|
53
|
+
this.subscribers.delete(callback);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
onChangeSectionExpanded(expanded, args) {
|
|
57
|
+
if (!args.unchanged) {
|
|
58
|
+
if (!expanded) (0, _wordpress_data.dispatch)(___store_index_js.store).setIsInserterOpened(false);
|
|
59
|
+
this.subscribers.forEach((subscriber) => subscriber(expanded, args));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
79
63
|
}
|
|
80
|
-
|
|
64
|
+
exports.default = getSidebarControl;
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=sidebar-control.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/controls/sidebar-control.js"],
|
|
4
|
-
"sourcesContent": ["import { dispatch } from '@wordpress/data';\nimport SidebarAdapter from '../components/sidebar-block-editor/sidebar-adapter';\nimport getInserterOuterSection from './inserter-outer-section';\nimport { store as customizeWidgetsStore } from '../store';\n\nconst getInserterId = ( controlId ) => `widgets-inserter-${ controlId }`;\n\nexport default function getSidebarControl() {\n\tconst {\n\t\twp: { customize },\n\t} = window;\n\n\treturn class SidebarControl extends customize.Control {\n\t\tconstructor( ...args ) {\n\t\t\tsuper( ...args );\n\n\t\t\tthis.subscribers = new Set();\n\t\t}\n\n\t\tready() {\n\t\t\tconst InserterOuterSection = getInserterOuterSection();\n\t\t\tthis.inserter = new InserterOuterSection(\n\t\t\t\tgetInserterId( this.id ),\n\t\t\t\t{}\n\t\t\t);\n\t\t\tcustomize.section.add( this.inserter );\n\n\t\t\tthis.sectionInstance = customize.section( this.section() );\n\n\t\t\tthis.inspector = this.sectionInstance.inspector;\n\n\t\t\tthis.sidebarAdapter = new SidebarAdapter( this.setting, customize );\n\t\t}\n\n\t\tsubscribe( callback ) {\n\t\t\tthis.subscribers.add( callback );\n\n\t\t\treturn () => {\n\t\t\t\tthis.subscribers.delete( callback );\n\t\t\t};\n\t\t}\n\n\t\tonChangeSectionExpanded( expanded, args ) {\n\t\t\tif ( ! args.unchanged ) {\n\t\t\t\t// Close the inserter when the section collapses.\n\t\t\t\tif ( ! expanded ) {\n\t\t\t\t\tdispatch( customizeWidgetsStore ).setIsInserterOpened(\n\t\t\t\t\t\tfalse\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tthis.subscribers.forEach( ( subscriber ) =>\n\t\t\t\t\tsubscriber( expanded, args )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t};\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAyB;AACzB,6BAA2B;AAC3B,oCAAoC;AACpC,mBAA+C;AAE/C,IAAM,gBAAgB,CAAE,cAAe,oBAAqB,SAAU;AAEvD,SAAR,oBAAqC;AAC3C,QAAM;AAAA,IACL,IAAI,EAAE,UAAU;AAAA,EACjB,IAAI;AAEJ,SAAO,MAAM,uBAAuB,UAAU,QAAQ;AAAA,IACrD,eAAgB,MAAO;AACtB,YAAO,GAAG,IAAK;AAEf,WAAK,cAAc,oBAAI,IAAI;AAAA,IAC5B;AAAA,IAEA,QAAQ;AACP,YAAM,2BAAuB,8BAAAA,SAAwB;AACrD,WAAK,WAAW,IAAI;AAAA,QACnB,cAAe,KAAK,EAAG;AAAA,QACvB,CAAC;AAAA,MACF;AACA,gBAAU,QAAQ,IAAK,KAAK,QAAS;AAErC,WAAK,kBAAkB,UAAU,QAAS,KAAK,QAAQ,CAAE;AAEzD,WAAK,YAAY,KAAK,gBAAgB;AAEtC,WAAK,iBAAiB,IAAI,uBAAAC,QAAgB,KAAK,SAAS,SAAU;AAAA,IACnE;AAAA,IAEA,UAAW,UAAW;AACrB,WAAK,YAAY,IAAK,QAAS;AAE/B,aAAO,MAAM;AACZ,aAAK,YAAY,OAAQ,QAAS;AAAA,MACnC;AAAA,IACD;AAAA,IAEA,wBAAyB,UAAU,MAAO;AACzC,UAAK,CAAE,KAAK,WAAY;AAEvB,YAAK,CAAE,UAAW;AACjB,oCAAU,aAAAC,KAAsB,EAAE;AAAA,YACjC;AAAA,UACD;AAAA,QACD;AAEA,aAAK,YAAY;AAAA,UAAS,CAAE,eAC3B,WAAY,UAAU,IAAK;AAAA,QAC5B;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;",
|
|
6
|
-
"names": ["getInserterOuterSection", "SidebarAdapter", "customizeWidgetsStore"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"sidebar-control.cjs","names":["getInserterOuterSection","SidebarAdapter","customizeWidgetsStore"],"sources":["../../src/controls/sidebar-control.js"],"sourcesContent":["import { dispatch } from '@wordpress/data';\nimport SidebarAdapter from '../components/sidebar-block-editor/sidebar-adapter';\nimport getInserterOuterSection from './inserter-outer-section';\nimport { store as customizeWidgetsStore } from '../store';\n\nconst getInserterId = ( controlId ) => `widgets-inserter-${ controlId }`;\n\nexport default function getSidebarControl() {\n\tconst {\n\t\twp: { customize },\n\t} = window;\n\n\treturn class SidebarControl extends customize.Control {\n\t\tconstructor( ...args ) {\n\t\t\tsuper( ...args );\n\n\t\t\tthis.subscribers = new Set();\n\t\t}\n\n\t\tready() {\n\t\t\tconst InserterOuterSection = getInserterOuterSection();\n\t\t\tthis.inserter = new InserterOuterSection(\n\t\t\t\tgetInserterId( this.id ),\n\t\t\t\t{}\n\t\t\t);\n\t\t\tcustomize.section.add( this.inserter );\n\n\t\t\tthis.sectionInstance = customize.section( this.section() );\n\n\t\t\tthis.inspector = this.sectionInstance.inspector;\n\n\t\t\tthis.sidebarAdapter = new SidebarAdapter( this.setting, customize );\n\t\t}\n\n\t\tsubscribe( callback ) {\n\t\t\tthis.subscribers.add( callback );\n\n\t\t\treturn () => {\n\t\t\t\tthis.subscribers.delete( callback );\n\t\t\t};\n\t\t}\n\n\t\tonChangeSectionExpanded( expanded, args ) {\n\t\t\tif ( ! args.unchanged ) {\n\t\t\t\t// Close the inserter when the section collapses.\n\t\t\t\tif ( ! expanded ) {\n\t\t\t\t\tdispatch( customizeWidgetsStore ).setIsInserterOpened(\n\t\t\t\t\t\tfalse\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tthis.subscribers.forEach( ( subscriber ) =>\n\t\t\t\t\tsubscriber( expanded, args )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,iBAAkB,cAAe,oBAAqB;AAE5D,SAAwB,oBAAoB;CAC3C,MAAM,EACL,IAAI,EAAE,gBACH;CAEJ,OAAO,MAAM,uBAAuB,UAAU,QAAQ;EACrD,YAAa,GAAG,MAAO;GACtB,MAAO,GAAG,IAAK;GAEf,KAAK,8BAAc,IAAI,IAAI;EAC5B;EAEA,QAAQ;GACP,MAAM,wBAAA,GAAuBA,4BAAAA,QAAAA,CAAwB;GACrD,KAAK,WAAW,IAAI,qBACnB,cAAe,KAAK,EAAG,GACvB,CAAC,CACF;GACA,UAAU,QAAQ,IAAK,KAAK,QAAS;GAErC,KAAK,kBAAkB,UAAU,QAAS,KAAK,QAAQ,CAAE;GAEzD,KAAK,YAAY,KAAK,gBAAgB;GAEtC,KAAK,iBAAiB,IAAIC,sDAAAA,QAAgB,KAAK,SAAS,SAAU;EACnE;EAEA,UAAW,UAAW;GACrB,KAAK,YAAY,IAAK,QAAS;GAE/B,aAAa;IACZ,KAAK,YAAY,OAAQ,QAAS;GACnC;EACD;EAEA,wBAAyB,UAAU,MAAO;GACzC,IAAK,CAAE,KAAK,WAAY;IAEvB,IAAK,CAAE,UACN,CAAA,GAAA,gBAAA,SAAA,CAAUC,kBAAAA,KAAsB,CAAC,CAAC,oBACjC,KACD;IAGD,KAAK,YAAY,SAAW,eAC3B,WAAY,UAAU,IAAK,CAC5B;GACD;EACD;CACD;AACD"}
|
|
@@ -1,114 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
5
|
+
});
|
|
6
|
+
// \0rolldown/runtime.js
|
|
1
7
|
var __create = Object.create;
|
|
2
8
|
var __defProp = Object.defineProperty;
|
|
3
9
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
10
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
11
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
12
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
13
|
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
15
|
+
key = keys[i];
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: ((k) => from[k]).bind(null, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
18
22
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
let _wordpress_i18n = require("@wordpress/i18n");
|
|
28
|
+
let __inspector_section_js = require("./inspector-section.cjs");
|
|
29
|
+
__inspector_section_js = __toESM(__inspector_section_js);
|
|
29
30
|
// packages/customize-widgets/src/controls/sidebar-section.js
|
|
30
|
-
|
|
31
|
-
__export(sidebar_section_exports, {
|
|
32
|
-
default: () => getSidebarSection
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(sidebar_section_exports);
|
|
35
|
-
var import_i18n = require("@wordpress/i18n");
|
|
36
|
-
var import_inspector_section = __toESM(require("./inspector-section.cjs"));
|
|
37
|
-
var getInspectorSectionId = (sidebarId) => `widgets-inspector-${sidebarId}`;
|
|
31
|
+
const getInspectorSectionId = (sidebarId) => `widgets-inspector-${sidebarId}`;
|
|
38
32
|
function getSidebarSection() {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
this.contentContainer.closest(".wp-full-overlay").addClass("section-open");
|
|
94
|
-
this.contentContainer.removeClass("open");
|
|
95
|
-
}
|
|
96
|
-
const handleTransitionEnd = () => {
|
|
97
|
-
this.contentContainer.removeClass("busy");
|
|
98
|
-
args.completeCallback();
|
|
99
|
-
};
|
|
100
|
-
if (isReducedMotion) {
|
|
101
|
-
handleTransitionEnd();
|
|
102
|
-
} else {
|
|
103
|
-
this.contentContainer.one(
|
|
104
|
-
"transitionend",
|
|
105
|
-
handleTransitionEnd
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
} else {
|
|
109
|
-
super.onChangeExpanded(expanded, args);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
};
|
|
33
|
+
const { wp: { customize } } = window;
|
|
34
|
+
const reduceMotionMediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
35
|
+
let isReducedMotion = reduceMotionMediaQuery.matches;
|
|
36
|
+
reduceMotionMediaQuery.addEventListener("change", (event) => {
|
|
37
|
+
isReducedMotion = event.matches;
|
|
38
|
+
});
|
|
39
|
+
return class SidebarSection extends customize.Section {
|
|
40
|
+
ready() {
|
|
41
|
+
const InspectorSection = (0, __inspector_section_js.default)();
|
|
42
|
+
this.inspector = new InspectorSection(getInspectorSectionId(this.id), {
|
|
43
|
+
title: (0, _wordpress_i18n.__)("Block Settings"),
|
|
44
|
+
parentSection: this,
|
|
45
|
+
customizeAction: [
|
|
46
|
+
(0, _wordpress_i18n.__)("Customizing"),
|
|
47
|
+
(0, _wordpress_i18n.__)("Widgets"),
|
|
48
|
+
this.params.title
|
|
49
|
+
].join(" ▸ ")
|
|
50
|
+
});
|
|
51
|
+
customize.section.add(this.inspector);
|
|
52
|
+
this.contentContainer[0].classList.add("customize-widgets__sidebar-section");
|
|
53
|
+
}
|
|
54
|
+
hasSubSectionOpened() {
|
|
55
|
+
return this.inspector.expanded();
|
|
56
|
+
}
|
|
57
|
+
onChangeExpanded(expanded, _args) {
|
|
58
|
+
const controls = this.controls();
|
|
59
|
+
const args = {
|
|
60
|
+
..._args,
|
|
61
|
+
completeCallback() {
|
|
62
|
+
controls.forEach((control) => {
|
|
63
|
+
control.onChangeSectionExpanded?.(expanded, args);
|
|
64
|
+
});
|
|
65
|
+
_args.completeCallback?.();
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
if (args.manualTransition) {
|
|
69
|
+
if (expanded) {
|
|
70
|
+
this.contentContainer.addClass(["busy", "open"]);
|
|
71
|
+
this.contentContainer.removeClass("is-sub-section-open");
|
|
72
|
+
this.contentContainer.closest(".wp-full-overlay").addClass("section-open");
|
|
73
|
+
} else {
|
|
74
|
+
this.contentContainer.addClass(["busy", "is-sub-section-open"]);
|
|
75
|
+
this.contentContainer.closest(".wp-full-overlay").addClass("section-open");
|
|
76
|
+
this.contentContainer.removeClass("open");
|
|
77
|
+
}
|
|
78
|
+
const handleTransitionEnd = () => {
|
|
79
|
+
this.contentContainer.removeClass("busy");
|
|
80
|
+
args.completeCallback();
|
|
81
|
+
};
|
|
82
|
+
if (isReducedMotion) handleTransitionEnd();
|
|
83
|
+
else this.contentContainer.one("transitionend", handleTransitionEnd);
|
|
84
|
+
} else super.onChangeExpanded(expanded, args);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
113
87
|
}
|
|
114
|
-
|
|
88
|
+
exports.default = getSidebarSection;
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=sidebar-section.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/controls/sidebar-section.js"],
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport getInspectorSection from './inspector-section';\n\nconst getInspectorSectionId = ( sidebarId ) =>\n\t`widgets-inspector-${ sidebarId }`;\n\nexport default function getSidebarSection() {\n\tconst {\n\t\twp: { customize },\n\t} = window;\n\n\tconst reduceMotionMediaQuery = window.matchMedia(\n\t\t'(prefers-reduced-motion: reduce)'\n\t);\n\tlet isReducedMotion = reduceMotionMediaQuery.matches;\n\treduceMotionMediaQuery.addEventListener( 'change', ( event ) => {\n\t\tisReducedMotion = event.matches;\n\t} );\n\n\treturn class SidebarSection extends customize.Section {\n\t\tready() {\n\t\t\tconst InspectorSection = getInspectorSection();\n\t\t\tthis.inspector = new InspectorSection(\n\t\t\t\tgetInspectorSectionId( this.id ),\n\t\t\t\t{\n\t\t\t\t\ttitle: __( 'Block Settings' ),\n\t\t\t\t\tparentSection: this,\n\t\t\t\t\tcustomizeAction: [\n\t\t\t\t\t\t__( 'Customizing' ),\n\t\t\t\t\t\t__( 'Widgets' ),\n\t\t\t\t\t\tthis.params.title,\n\t\t\t\t\t].join( ' ▸ ' ),\n\t\t\t\t}\n\t\t\t);\n\t\t\tcustomize.section.add( this.inspector );\n\t\t\tthis.contentContainer[ 0 ].classList.add(\n\t\t\t\t'customize-widgets__sidebar-section'\n\t\t\t);\n\t\t}\n\t\thasSubSectionOpened() {\n\t\t\treturn this.inspector.expanded();\n\t\t}\n\t\tonChangeExpanded( expanded, _args ) {\n\t\t\tconst controls = this.controls();\n\t\t\tconst args = {\n\t\t\t\t..._args,\n\t\t\t\tcompleteCallback() {\n\t\t\t\t\tcontrols.forEach( ( control ) => {\n\t\t\t\t\t\tcontrol.onChangeSectionExpanded?.( expanded, args );\n\t\t\t\t\t} );\n\t\t\t\t\t_args.completeCallback?.();\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tif ( args.manualTransition ) {\n\t\t\t\tif ( expanded ) {\n\t\t\t\t\tthis.contentContainer.addClass( [ 'busy', 'open' ] );\n\t\t\t\t\tthis.contentContainer.removeClass( 'is-sub-section-open' );\n\t\t\t\t\tthis.contentContainer\n\t\t\t\t\t\t.closest( '.wp-full-overlay' )\n\t\t\t\t\t\t.addClass( 'section-open' );\n\t\t\t\t} else {\n\t\t\t\t\tthis.contentContainer.addClass( [\n\t\t\t\t\t\t'busy',\n\t\t\t\t\t\t'is-sub-section-open',\n\t\t\t\t\t] );\n\t\t\t\t\tthis.contentContainer\n\t\t\t\t\t\t.closest( '.wp-full-overlay' )\n\t\t\t\t\t\t.addClass( 'section-open' );\n\t\t\t\t\tthis.contentContainer.removeClass( 'open' );\n\t\t\t\t}\n\n\t\t\t\tconst handleTransitionEnd = () => {\n\t\t\t\t\tthis.contentContainer.removeClass( 'busy' );\n\t\t\t\t\targs.completeCallback();\n\t\t\t\t};\n\n\t\t\t\tif ( isReducedMotion ) {\n\t\t\t\t\thandleTransitionEnd();\n\t\t\t\t} else {\n\t\t\t\t\tthis.contentContainer.one(\n\t\t\t\t\t\t'transitionend',\n\t\t\t\t\t\thandleTransitionEnd\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tsuper.onChangeExpanded( expanded, args );\n\t\t\t}\n\t\t}\n\t};\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,+BAAgC;AAEhC,IAAM,wBAAwB,CAAE,cAC/B,qBAAsB,SAAU;AAElB,SAAR,oBAAqC;AAC3C,QAAM;AAAA,IACL,IAAI,EAAE,UAAU;AAAA,EACjB,IAAI;AAEJ,QAAM,yBAAyB,OAAO;AAAA,IACrC;AAAA,EACD;AACA,MAAI,kBAAkB,uBAAuB;AAC7C,yBAAuB,iBAAkB,UAAU,CAAE,UAAW;AAC/D,sBAAkB,MAAM;AAAA,EACzB,CAAE;AAEF,SAAO,MAAM,uBAAuB,UAAU,QAAQ;AAAA,IACrD,QAAQ;AACP,YAAM,uBAAmB,yBAAAA,SAAoB;AAC7C,WAAK,YAAY,IAAI;AAAA,QACpB,sBAAuB,KAAK,EAAG;AAAA,QAC/B;AAAA,UACC,WAAO,gBAAI,gBAAiB;AAAA,UAC5B,eAAe;AAAA,UACf,iBAAiB;AAAA,gBAChB,gBAAI,aAAc;AAAA,gBAClB,gBAAI,SAAU;AAAA,YACd,KAAK,OAAO;AAAA,UACb,EAAE,KAAM,KAAM;AAAA,QACf;AAAA,MACD;AACA,gBAAU,QAAQ,IAAK,KAAK,SAAU;AACtC,WAAK,iBAAkB,CAAE,EAAE,UAAU;AAAA,QACpC;AAAA,MACD;AAAA,IACD;AAAA,IACA,sBAAsB;AACrB,aAAO,KAAK,UAAU,SAAS;AAAA,IAChC;AAAA,IACA,iBAAkB,UAAU,OAAQ;AACnC,YAAM,WAAW,KAAK,SAAS;AAC/B,YAAM,OAAO;AAAA,QACZ,GAAG;AAAA,QACH,mBAAmB;AAClB,mBAAS,QAAS,CAAE,YAAa;AAChC,oBAAQ,0BAA2B,UAAU,IAAK;AAAA,UACnD,CAAE;AACF,gBAAM,mBAAmB;AAAA,QAC1B;AAAA,MACD;AAEA,UAAK,KAAK,kBAAmB;AAC5B,YAAK,UAAW;AACf,eAAK,iBAAiB,SAAU,CAAE,QAAQ,MAAO,CAAE;AACnD,eAAK,iBAAiB,YAAa,qBAAsB;AACzD,eAAK,iBACH,QAAS,kBAAmB,EAC5B,SAAU,cAAe;AAAA,QAC5B,OAAO;AACN,eAAK,iBAAiB,SAAU;AAAA,YAC/B;AAAA,YACA;AAAA,UACD,CAAE;AACF,eAAK,iBACH,QAAS,kBAAmB,EAC5B,SAAU,cAAe;AAC3B,eAAK,iBAAiB,YAAa,MAAO;AAAA,QAC3C;AAEA,cAAM,sBAAsB,MAAM;AACjC,eAAK,iBAAiB,YAAa,MAAO;AAC1C,eAAK,iBAAiB;AAAA,QACvB;AAEA,YAAK,iBAAkB;AACtB,8BAAoB;AAAA,QACrB,OAAO;AACN,eAAK,iBAAiB;AAAA,YACrB;AAAA,YACA;AAAA,UACD;AAAA,QACD;AAAA,MACD,OAAO;AACN,cAAM,iBAAkB,UAAU,IAAK;AAAA,MACxC;AAAA,IACD;AAAA,EACD;AACD;",
|
|
6
|
-
"names": ["getInspectorSection"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"sidebar-section.cjs","names":["getInspectorSection","__"],"sources":["../../src/controls/sidebar-section.js"],"sourcesContent":["import { __ } from '@wordpress/i18n';\nimport getInspectorSection from './inspector-section';\n\nconst getInspectorSectionId = ( sidebarId ) =>\n\t`widgets-inspector-${ sidebarId }`;\n\nexport default function getSidebarSection() {\n\tconst {\n\t\twp: { customize },\n\t} = window;\n\n\tconst reduceMotionMediaQuery = window.matchMedia(\n\t\t'(prefers-reduced-motion: reduce)'\n\t);\n\tlet isReducedMotion = reduceMotionMediaQuery.matches;\n\treduceMotionMediaQuery.addEventListener( 'change', ( event ) => {\n\t\tisReducedMotion = event.matches;\n\t} );\n\n\treturn class SidebarSection extends customize.Section {\n\t\tready() {\n\t\t\tconst InspectorSection = getInspectorSection();\n\t\t\tthis.inspector = new InspectorSection(\n\t\t\t\tgetInspectorSectionId( this.id ),\n\t\t\t\t{\n\t\t\t\t\ttitle: __( 'Block Settings' ),\n\t\t\t\t\tparentSection: this,\n\t\t\t\t\tcustomizeAction: [\n\t\t\t\t\t\t__( 'Customizing' ),\n\t\t\t\t\t\t__( 'Widgets' ),\n\t\t\t\t\t\tthis.params.title,\n\t\t\t\t\t].join( ' ▸ ' ),\n\t\t\t\t}\n\t\t\t);\n\t\t\tcustomize.section.add( this.inspector );\n\t\t\tthis.contentContainer[ 0 ].classList.add(\n\t\t\t\t'customize-widgets__sidebar-section'\n\t\t\t);\n\t\t}\n\t\thasSubSectionOpened() {\n\t\t\treturn this.inspector.expanded();\n\t\t}\n\t\tonChangeExpanded( expanded, _args ) {\n\t\t\tconst controls = this.controls();\n\t\t\tconst args = {\n\t\t\t\t..._args,\n\t\t\t\tcompleteCallback() {\n\t\t\t\t\tcontrols.forEach( ( control ) => {\n\t\t\t\t\t\tcontrol.onChangeSectionExpanded?.( expanded, args );\n\t\t\t\t\t} );\n\t\t\t\t\t_args.completeCallback?.();\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tif ( args.manualTransition ) {\n\t\t\t\tif ( expanded ) {\n\t\t\t\t\tthis.contentContainer.addClass( [ 'busy', 'open' ] );\n\t\t\t\t\tthis.contentContainer.removeClass( 'is-sub-section-open' );\n\t\t\t\t\tthis.contentContainer\n\t\t\t\t\t\t.closest( '.wp-full-overlay' )\n\t\t\t\t\t\t.addClass( 'section-open' );\n\t\t\t\t} else {\n\t\t\t\t\tthis.contentContainer.addClass( [\n\t\t\t\t\t\t'busy',\n\t\t\t\t\t\t'is-sub-section-open',\n\t\t\t\t\t] );\n\t\t\t\t\tthis.contentContainer\n\t\t\t\t\t\t.closest( '.wp-full-overlay' )\n\t\t\t\t\t\t.addClass( 'section-open' );\n\t\t\t\t\tthis.contentContainer.removeClass( 'open' );\n\t\t\t\t}\n\n\t\t\t\tconst handleTransitionEnd = () => {\n\t\t\t\t\tthis.contentContainer.removeClass( 'busy' );\n\t\t\t\t\targs.completeCallback();\n\t\t\t\t};\n\n\t\t\t\tif ( isReducedMotion ) {\n\t\t\t\t\thandleTransitionEnd();\n\t\t\t\t} else {\n\t\t\t\t\tthis.contentContainer.one(\n\t\t\t\t\t\t'transitionend',\n\t\t\t\t\t\thandleTransitionEnd\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tsuper.onChangeExpanded( expanded, args );\n\t\t\t}\n\t\t}\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM,yBAA0B,cAC/B,qBAAsB;AAEvB,SAAwB,oBAAoB;CAC3C,MAAM,EACL,IAAI,EAAE,gBACH;CAEJ,MAAM,yBAAyB,OAAO,WACrC,kCACD;CACA,IAAI,kBAAkB,uBAAuB;CAC7C,uBAAuB,iBAAkB,WAAY,UAAW;EAC/D,kBAAkB,MAAM;CACzB,CAAE;CAEF,OAAO,MAAM,uBAAuB,UAAU,QAAQ;EACrD,QAAQ;GACP,MAAM,oBAAA,GAAmBA,uBAAAA,QAAAA,CAAoB;GAC7C,KAAK,YAAY,IAAI,iBACpB,sBAAuB,KAAK,EAAG,GAC/B;IACC,QAAA,GAAOC,gBAAAA,GAAAA,CAAI,gBAAiB;IAC5B,eAAe;IACf,iBAAiB;MAChBA,GAAAA,gBAAAA,GAAAA,CAAI,aAAc;MAClBA,GAAAA,gBAAAA,GAAAA,CAAI,SAAU;KACd,KAAK,OAAO;IACb,CAAC,CAAC,KAAM,KAAM;GACf,CACD;GACA,UAAU,QAAQ,IAAK,KAAK,SAAU;GACtC,KAAK,iBAAkB,EAAG,CAAC,UAAU,IACpC,oCACD;EACD;EACA,sBAAsB;GACrB,OAAO,KAAK,UAAU,SAAS;EAChC;EACA,iBAAkB,UAAU,OAAQ;GACnC,MAAM,WAAW,KAAK,SAAS;GAC/B,MAAM,OAAO;IACZ,GAAG;IACH,mBAAmB;KAClB,SAAS,SAAW,YAAa;MAChC,QAAQ,0BAA2B,UAAU,IAAK;KACnD,CAAE;KACF,MAAM,mBAAmB;IAC1B;GACD;GAEA,IAAK,KAAK,kBAAmB;IAC5B,IAAK,UAAW;KACf,KAAK,iBAAiB,SAAU,CAAE,QAAQ,MAAO,CAAE;KACnD,KAAK,iBAAiB,YAAa,qBAAsB;KACzD,KAAK,iBACH,QAAS,kBAAmB,CAAC,CAC7B,SAAU,cAAe;IAC5B,OAAO;KACN,KAAK,iBAAiB,SAAU,CAC/B,QACA,qBACD,CAAE;KACF,KAAK,iBACH,QAAS,kBAAmB,CAAC,CAC7B,SAAU,cAAe;KAC3B,KAAK,iBAAiB,YAAa,MAAO;IAC3C;IAEA,MAAM,4BAA4B;KACjC,KAAK,iBAAiB,YAAa,MAAO;KAC1C,KAAK,iBAAiB;IACvB;IAEA,IAAK,iBACJ,oBAAoB;SAEpB,KAAK,iBAAiB,IACrB,iBACA,mBACD;GAEF,OACC,MAAM,iBAAkB,UAAU,IAAK;EAEzC;CACD;AACD"}
|
package/build/filters/index.cjs
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
5
|
+
});
|
|
6
|
+
require("./move-to-sidebar.cjs");
|
|
7
|
+
require("./replace-media-upload.cjs");
|
|
8
|
+
require("./wide-widget-display.cjs");
|
|
@@ -1,79 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
5
|
+
});
|
|
6
|
+
let _wordpress_block_editor = require("@wordpress/block-editor");
|
|
7
|
+
let _wordpress_compose = require("@wordpress/compose");
|
|
8
|
+
let _wordpress_data = require("@wordpress/data");
|
|
9
|
+
let _wordpress_hooks = require("@wordpress/hooks");
|
|
10
|
+
let _wordpress_widgets = require("@wordpress/widgets");
|
|
11
|
+
let ___components_sidebar_controls_index_jsx = require("../components/sidebar-controls/index.cjs");
|
|
12
|
+
let ___components_focus_control_index_jsx = require("../components/focus-control/index.cjs");
|
|
13
|
+
let ___utils_js = require("../utils.cjs");
|
|
14
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
1
15
|
// packages/customize-widgets/src/filters/move-to-sidebar.jsx
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
widgetId = addedWidgetIds.reverse().find((id) => !!id);
|
|
51
|
-
}
|
|
52
|
-
focusWidget(widgetId);
|
|
53
|
-
}
|
|
54
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
55
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BlockEdit, { ...props }, "edit"),
|
|
56
|
-
hasMultipleSidebars && canInsertBlockInSidebar && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57
|
-
import_widgets.MoveToWidgetArea,
|
|
58
|
-
{
|
|
59
|
-
widgetAreas: sidebarControls.map(
|
|
60
|
-
(sidebarControl) => ({
|
|
61
|
-
id: sidebarControl.id,
|
|
62
|
-
name: sidebarControl.params.label,
|
|
63
|
-
description: sidebarControl.params.description
|
|
64
|
-
})
|
|
65
|
-
),
|
|
66
|
-
currentWidgetAreaId: activeSidebarControl?.id,
|
|
67
|
-
onSelect: moveToSidebar
|
|
68
|
-
}
|
|
69
|
-
) })
|
|
70
|
-
] });
|
|
71
|
-
},
|
|
72
|
-
"withMoveToSidebarToolbarItem"
|
|
73
|
-
);
|
|
74
|
-
(0, import_hooks.addFilter)(
|
|
75
|
-
"editor.BlockEdit",
|
|
76
|
-
"core/customize-widgets/block-edit",
|
|
77
|
-
withMoveToSidebarToolbarItem
|
|
78
|
-
);
|
|
79
|
-
//# sourceMappingURL=move-to-sidebar.cjs.map
|
|
16
|
+
const withMoveToSidebarToolbarItem = (0, _wordpress_compose.createHigherOrderComponent)((BlockEdit) => (props) => {
|
|
17
|
+
let widgetId = (0, _wordpress_widgets.getWidgetIdFromBlock)(props);
|
|
18
|
+
const sidebarControls = (0, ___components_sidebar_controls_index_jsx.useSidebarControls)();
|
|
19
|
+
const activeSidebarControl = (0, ___components_sidebar_controls_index_jsx.useActiveSidebarControl)();
|
|
20
|
+
const hasMultipleSidebars = sidebarControls?.length > 1;
|
|
21
|
+
const blockName = props.name;
|
|
22
|
+
const clientId = props.clientId;
|
|
23
|
+
const canInsertBlockInSidebar = (0, _wordpress_data.useSelect)((select) => {
|
|
24
|
+
return select(_wordpress_block_editor.store).canInsertBlockType(blockName, "");
|
|
25
|
+
}, [blockName]);
|
|
26
|
+
const block = (0, _wordpress_data.useSelect)((select) => select(_wordpress_block_editor.store).getBlock(clientId), [clientId]);
|
|
27
|
+
const { removeBlock } = (0, _wordpress_data.useDispatch)(_wordpress_block_editor.store);
|
|
28
|
+
const [, focusWidget] = (0, ___components_focus_control_index_jsx.useFocusControl)();
|
|
29
|
+
function moveToSidebar(sidebarControlId) {
|
|
30
|
+
const newSidebarControl = sidebarControls.find((sidebarControl) => sidebarControl.id === sidebarControlId);
|
|
31
|
+
if (widgetId) {
|
|
32
|
+
/**
|
|
33
|
+
* If there's a widgetId, move it to the other sidebar.
|
|
34
|
+
*/
|
|
35
|
+
const oldSetting = activeSidebarControl.setting;
|
|
36
|
+
const newSetting = newSidebarControl.setting;
|
|
37
|
+
oldSetting(oldSetting().filter((id) => id !== widgetId));
|
|
38
|
+
newSetting([...newSetting(), widgetId]);
|
|
39
|
+
} else {
|
|
40
|
+
/**
|
|
41
|
+
* If there isn't a widgetId, it's most likely a inner block.
|
|
42
|
+
* First, remove the block in the original sidebar,
|
|
43
|
+
* then, create a new widget in the new sidebar and get back its widgetId.
|
|
44
|
+
*/
|
|
45
|
+
const sidebarAdapter = newSidebarControl.sidebarAdapter;
|
|
46
|
+
removeBlock(clientId);
|
|
47
|
+
widgetId = sidebarAdapter.setWidgets([...sidebarAdapter.getWidgets(), (0, ___utils_js.blockToWidget)(block)]).reverse().find((id) => !!id);
|
|
48
|
+
}
|
|
49
|
+
focusWidget(widgetId);
|
|
50
|
+
}
|
|
51
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BlockEdit, { ...props }, "edit"), hasMultipleSidebars && canInsertBlockInSidebar && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_block_editor.BlockControls, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_widgets.MoveToWidgetArea, {
|
|
52
|
+
widgetAreas: sidebarControls.map((sidebarControl) => ({
|
|
53
|
+
id: sidebarControl.id,
|
|
54
|
+
name: sidebarControl.params.label,
|
|
55
|
+
description: sidebarControl.params.description
|
|
56
|
+
})),
|
|
57
|
+
currentWidgetAreaId: activeSidebarControl?.id,
|
|
58
|
+
onSelect: moveToSidebar
|
|
59
|
+
}) })] });
|
|
60
|
+
}, "withMoveToSidebarToolbarItem");
|
|
61
|
+
(0, _wordpress_hooks.addFilter)("editor.BlockEdit", "core/customize-widgets/block-edit", withMoveToSidebarToolbarItem);
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=move-to-sidebar.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/filters/move-to-sidebar.jsx"],
|
|
4
|
-
"sourcesContent": ["import {\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';\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 key=\"edit\" { ...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"],
|
|
5
|
-
"mappings": ";AAAA,0BAGO;AACP,qBAA2C;AAC3C,kBAAuC;AACvC,mBAA0B;AAC1B,qBAAuD;AACvD,8BAGO;AACP,2BAAgC;AAChC,mBAA8B;AAgE3B;AA9DH,IAAM,mCAA+B;AAAA,EACpC,CAAE,cAAe,CAAE,UAAW;AAC7B,QAAI,eAAW,qCAAsB,KAAM;AAC3C,UAAM,sBAAkB,4CAAmB;AAC3C,UAAM,2BAAuB,iDAAwB;AACrD,UAAM,sBAAsB,iBAAiB,SAAS;AACtD,UAAM,YAAY,MAAM;AACxB,UAAM,WAAW,MAAM;AACvB,UAAM,8BAA0B;AAAA,MAC/B,CAAE,WAAY;AAGb,eAAO,OAAQ,oBAAAA,KAAiB,EAAE;AAAA,UACjC;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA,CAAE,SAAU;AAAA,IACb;AACA,UAAM,YAAQ;AAAA,MACb,CAAE,WAAY,OAAQ,oBAAAA,KAAiB,EAAE,SAAU,QAAS;AAAA,MAC5D,CAAE,QAAS;AAAA,IACZ;AACA,UAAM,EAAE,YAAY,QAAI,yBAAa,oBAAAA,KAAiB;AACtD,UAAM,CAAE,EAAE,WAAY,QAAI,sCAAgB;AAE1C,aAAS,cAAe,kBAAmB;AAC1C,YAAM,oBAAoB,gBAAgB;AAAA,QACzC,CAAE,mBAAoB,eAAe,OAAO;AAAA,MAC7C;AAEA,UAAK,UAAW;AAIf,cAAM,aAAa,qBAAqB;AACxC,cAAM,aAAa,kBAAkB;AAErC,mBAAY,WAAW,EAAE,OAAQ,CAAE,OAAQ,OAAO,QAAS,CAAE;AAC7D,mBAAY,CAAE,GAAG,WAAW,GAAG,QAAS,CAAE;AAAA,MAC3C,OAAO;AAMN,cAAM,iBAAiB,kBAAkB;AAEzC,oBAAa,QAAS;AACtB,cAAM,iBAAiB,eAAe,WAAY;AAAA,UACjD,GAAG,eAAe,WAAW;AAAA,cAC7B,4BAAe,KAAM;AAAA,QACtB,CAAE;AAEF,mBAAW,eAAe,QAAQ,EAAE,KAAM,CAAE,OAAQ,CAAC,CAAE,EAAG;AAAA,MAC3D;AAGA,kBAAa,QAAS;AAAA,IACvB;AAEA,WACC,4EACC;AAAA,kDAAC,aAAuB,GAAG,SAAZ,MAAoB;AAAA,MACjC,uBAAuB,2BACxB,4CAAC,qCACA;AAAA,QAAC;AAAA;AAAA,UACA,aAAc,gBAAgB;AAAA,YAC7B,CAAE,oBAAsB;AAAA,cACvB,IAAI,eAAe;AAAA,cACnB,MAAM,eAAe,OAAO;AAAA,cAC5B,aACC,eAAe,OAAO;AAAA,YACxB;AAAA,UACD;AAAA,UACA,qBAAsB,sBAAsB;AAAA,UAC5C,UAAW;AAAA;AAAA,MACZ,GACD;AAAA,OAEF;AAAA,EAEF;AAAA,EACA;AACD;AAAA,IAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
|
-
"names": ["blockEditorStore"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"move-to-sidebar.cjs","names":["createHigherOrderComponent","getWidgetIdFromBlock","useSidebarControls","useActiveSidebarControl","useSelect","blockEditorStore","useDispatch","useFocusControl","blockToWidget","BlockControls","MoveToWidgetArea","addFilter"],"sources":["../../src/filters/move-to-sidebar.jsx"],"sourcesContent":["import {\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';\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 key=\"edit\" { ...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"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAM,gCAAA,GAA+BA,mBAAAA,2BAAAA,EAClC,eAAiB,UAAW;CAC7B,IAAI,YAAA,GAAWC,mBAAAA,qBAAAA,CAAsB,KAAM;CAC3C,MAAM,mBAAA,GAAkBC,yCAAAA,mBAAAA,CAAmB;CAC3C,MAAM,wBAAA,GAAuBC,yCAAAA,wBAAAA,CAAwB;CACrD,MAAM,sBAAsB,iBAAiB,SAAS;CACtD,MAAM,YAAY,MAAM;CACxB,MAAM,WAAW,MAAM;CACvB,MAAM,2BAAA,GAA0BC,gBAAAA,UAAAA,EAC7B,WAAY;EAGb,OAAO,OAAQC,wBAAAA,KAAiB,CAAC,CAAC,mBACjC,WACA,EACD;CACD,GACA,CAAE,SAAU,CACb;CACA,MAAM,SAAA,GAAQD,gBAAAA,UAAAA,EACX,WAAY,OAAQC,wBAAAA,KAAiB,CAAC,CAAC,SAAU,QAAS,GAC5D,CAAE,QAAS,CACZ;CACA,MAAM,EAAE,iBAAA,GAAgBC,gBAAAA,YAAAA,CAAaD,wBAAAA,KAAiB;CACtD,MAAM,GAAI,gBAAA,GAAgBE,sCAAAA,gBAAAA,CAAgB;CAE1C,SAAS,cAAe,kBAAmB;EAC1C,MAAM,oBAAoB,gBAAgB,MACvC,mBAAoB,eAAe,OAAO,gBAC7C;EAEA,IAAK,UAAW;;;;GAIf,MAAM,aAAa,qBAAqB;GACxC,MAAM,aAAa,kBAAkB;GAErC,WAAY,WAAW,CAAC,CAAC,QAAU,OAAQ,OAAO,QAAS,CAAE;GAC7D,WAAY,CAAE,GAAG,WAAW,GAAG,QAAS,CAAE;EAC3C,OAAO;;;;;;GAMN,MAAM,iBAAiB,kBAAkB;GAEzC,YAAa,QAAS;GAMtB,WALuB,eAAe,WAAY,CACjD,GAAG,eAAe,WAAW,IAAA,GAC7BC,YAAAA,cAAAA,CAAe,KAAM,CACtB,CAEwB,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAQ,OAAQ,CAAC,CAAE,EAAG;EAC3D;EAGA,YAAa,QAAS;CACvB;CAEA,OACC,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD,EAAsB,GAAK,MAAS,GAArB,MAAqB,GAClC,uBAAuB,2BACxB,iBAAA,GAAA,kBAAA,IAAA,CAACC,wBAAAA,eAAD,EAAA,UACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,kBAAD;EACC,aAAc,gBAAgB,KAC3B,oBAAsB;GACvB,IAAI,eAAe;GACnB,MAAM,eAAe,OAAO;GAC5B,aACC,eAAe,OAAO;EACxB,EACD;EACA,qBAAsB,sBAAsB;EAC5C,UAAW;CACX,CAAA,EACa,CAAA,CAEf,EAAA,CAAA;AAEJ,GACA,8BACD;CAEAC,GAAAA,iBAAAA,UAAAA,CACC,oBACA,qCACA,4BACD"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
5
|
+
});
|
|
6
|
+
let _wordpress_hooks = require("@wordpress/hooks");
|
|
7
|
+
let _wordpress_media_utils = require("@wordpress/media-utils");
|
|
1
8
|
// packages/customize-widgets/src/filters/replace-media-upload.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"editor.MediaUpload",
|
|
7
|
-
"core/edit-widgets/replace-media-upload",
|
|
8
|
-
replaceMediaUpload
|
|
9
|
-
);
|
|
10
|
-
//# sourceMappingURL=replace-media-upload.cjs.map
|
|
9
|
+
const replaceMediaUpload = () => _wordpress_media_utils.MediaUpload;
|
|
10
|
+
(0, _wordpress_hooks.addFilter)("editor.MediaUpload", "core/edit-widgets/replace-media-upload", replaceMediaUpload);
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=replace-media-upload.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/filters/replace-media-upload.js"],
|
|
4
|
-
"sourcesContent": ["import { addFilter } from '@wordpress/hooks';\nimport { MediaUpload } from '@wordpress/media-utils';\n\nconst replaceMediaUpload = () => MediaUpload;\n\naddFilter(\n\t'editor.MediaUpload',\n\t'core/edit-widgets/replace-media-upload',\n\treplaceMediaUpload\n);\n"],
|
|
5
|
-
"mappings": ";AAAA,mBAA0B;AAC1B,yBAA4B;AAE5B,IAAM,qBAAqB,MAAM;AAAA,IAEjC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"replace-media-upload.cjs","names":["MediaUpload","addFilter"],"sources":["../../src/filters/replace-media-upload.js"],"sourcesContent":["import { addFilter } from '@wordpress/hooks';\nimport { MediaUpload } from '@wordpress/media-utils';\n\nconst replaceMediaUpload = () => MediaUpload;\n\naddFilter(\n\t'editor.MediaUpload',\n\t'core/edit-widgets/replace-media-upload',\n\treplaceMediaUpload\n);\n"],"mappings":";;;;;;;;AAGA,MAAM,2BAA2BA,uBAAAA;CAEjCC,GAAAA,iBAAAA,UAAAA,CACC,sBACA,0CACA,kBACD"}
|