@wordpress/customize-widgets 6.0.0 → 6.2.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.
Files changed (163) hide show
  1. package/build/components/block-appender/index.cjs +24 -41
  2. package/build/components/block-appender/index.cjs.map +1 -7
  3. package/build/components/block-inspector-button/index.cjs +24 -52
  4. package/build/components/block-inspector-button/index.cjs.map +1 -7
  5. package/build/components/customize-widgets/index.cjs +76 -97
  6. package/build/components/customize-widgets/index.cjs.map +1 -7
  7. package/build/components/customize-widgets/use-clear-selected-block.cjs +58 -67
  8. package/build/components/customize-widgets/use-clear-selected-block.cjs.map +1 -7
  9. package/build/components/error-boundary/index.cjs +115 -155
  10. package/build/components/error-boundary/index.cjs.map +1 -7
  11. package/build/components/focus-control/index.cjs +44 -84
  12. package/build/components/focus-control/index.cjs.map +1 -7
  13. package/build/components/focus-control/use-blocks-focus-control.cjs +28 -49
  14. package/build/components/focus-control/use-blocks-focus-control.cjs.map +1 -7
  15. package/build/components/header/index.cjs +84 -122
  16. package/build/components/header/index.cjs.map +1 -7
  17. package/build/components/inserter/index.cjs +43 -78
  18. package/build/components/inserter/index.cjs.map +1 -7
  19. package/build/components/inserter/use-inserter.cjs +22 -54
  20. package/build/components/inserter/use-inserter.cjs.map +1 -7
  21. package/build/components/keyboard-shortcut-help-modal/config.cjs +88 -85
  22. package/build/components/keyboard-shortcut-help-modal/config.cjs.map +1 -7
  23. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.cjs +40 -57
  24. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.cjs.map +1 -7
  25. package/build/components/keyboard-shortcut-help-modal/index.cjs +103 -165
  26. package/build/components/keyboard-shortcut-help-modal/index.cjs.map +1 -7
  27. package/build/components/keyboard-shortcut-help-modal/shortcut.cjs +38 -76
  28. package/build/components/keyboard-shortcut-help-modal/shortcut.cjs.map +1 -7
  29. package/build/components/keyboard-shortcuts/index.cjs +70 -100
  30. package/build/components/keyboard-shortcuts/index.cjs.map +1 -7
  31. package/build/components/more-menu/index.cjs +102 -151
  32. package/build/components/more-menu/index.cjs.map +1 -7
  33. package/build/components/sidebar-block-editor/index.cjs +122 -155
  34. package/build/components/sidebar-block-editor/index.cjs.map +1 -7
  35. package/build/components/sidebar-block-editor/sidebar-adapter.cjs +207 -270
  36. package/build/components/sidebar-block-editor/sidebar-adapter.cjs.map +1 -7
  37. package/build/components/sidebar-block-editor/sidebar-editor-provider.cjs +40 -50
  38. package/build/components/sidebar-block-editor/sidebar-editor-provider.cjs.map +1 -7
  39. package/build/components/sidebar-block-editor/use-sidebar-block-editor.cjs +75 -110
  40. package/build/components/sidebar-block-editor/use-sidebar-block-editor.cjs.map +1 -7
  41. package/build/components/sidebar-controls/index.cjs +27 -53
  42. package/build/components/sidebar-controls/index.cjs.map +1 -7
  43. package/build/components/welcome-guide/index.cjs +70 -94
  44. package/build/components/welcome-guide/index.cjs.map +1 -7
  45. package/build/controls/inserter-outer-section.cjs +68 -110
  46. package/build/controls/inserter-outer-section.cjs.map +1 -7
  47. package/build/controls/inspector-section.cjs +57 -90
  48. package/build/controls/inspector-section.cjs.map +1 -7
  49. package/build/controls/sidebar-control.cjs +55 -69
  50. package/build/controls/sidebar-control.cjs.map +1 -7
  51. package/build/controls/sidebar-section.cjs +79 -103
  52. package/build/controls/sidebar-section.cjs.map +1 -7
  53. package/build/filters/index.cjs +8 -5
  54. package/build/filters/move-to-sidebar.cjs +62 -78
  55. package/build/filters/move-to-sidebar.cjs.map +1 -7
  56. package/build/filters/replace-media-upload.cjs +11 -9
  57. package/build/filters/replace-media-upload.cjs.map +1 -7
  58. package/build/filters/wide-widget-display.cjs +20 -20
  59. package/build/filters/wide-widget-display.cjs.map +1 -7
  60. package/build/index.cjs +84 -91
  61. package/build/index.cjs.map +1 -7
  62. package/build/lock-unlock.cjs +10 -35
  63. package/build/lock-unlock.cjs.map +1 -7
  64. package/build/store/actions.cjs +49 -32
  65. package/build/store/actions.cjs.map +1 -7
  66. package/build/store/constants.cjs +12 -29
  67. package/build/store/constants.cjs.map +1 -7
  68. package/build/store/index.cjs +49 -41
  69. package/build/store/index.cjs.map +1 -7
  70. package/build/store/reducer.cjs +20 -33
  71. package/build/store/reducer.cjs.map +1 -7
  72. package/build/store/selectors.cjs +47 -38
  73. package/build/store/selectors.cjs.map +1 -7
  74. package/build/utils.cjs +81 -108
  75. package/build/utils.cjs.map +1 -7
  76. package/build-module/components/block-appender/index.mjs +18 -23
  77. package/build-module/components/block-appender/index.mjs.map +1 -7
  78. package/build-module/components/block-inspector-button/index.mjs +15 -28
  79. package/build-module/components/block-inspector-button/index.mjs.map +1 -7
  80. package/build-module/components/customize-widgets/index.mjs +45 -73
  81. package/build-module/components/customize-widgets/index.mjs.map +1 -7
  82. package/build-module/components/customize-widgets/use-clear-selected-block.mjs +52 -46
  83. package/build-module/components/customize-widgets/use-clear-selected-block.mjs.map +1 -7
  84. package/build-module/components/error-boundary/index.mjs +104 -129
  85. package/build-module/components/error-boundary/index.mjs.map +1 -7
  86. package/build-module/components/focus-control/index.mjs +37 -66
  87. package/build-module/components/focus-control/index.mjs.map +1 -7
  88. package/build-module/components/focus-control/use-blocks-focus-control.mjs +21 -27
  89. package/build-module/components/focus-control/use-blocks-focus-control.mjs.map +1 -7
  90. package/build-module/components/header/index.mjs +55 -92
  91. package/build-module/components/header/index.mjs.map +1 -7
  92. package/build-module/components/inserter/index.mjs +33 -53
  93. package/build-module/components/inserter/index.mjs.map +1 -7
  94. package/build-module/components/inserter/use-inserter.mjs +17 -34
  95. package/build-module/components/inserter/use-inserter.mjs.map +1 -7
  96. package/build-module/components/keyboard-shortcut-help-modal/config.mjs +83 -61
  97. package/build-module/components/keyboard-shortcut-help-modal/config.mjs.map +1 -7
  98. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.mjs +19 -33
  99. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.mjs.map +1 -7
  100. package/build-module/components/keyboard-shortcut-help-modal/index.mjs +75 -139
  101. package/build-module/components/keyboard-shortcut-help-modal/index.mjs.map +1 -7
  102. package/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs +32 -55
  103. package/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs.map +1 -7
  104. package/build-module/components/keyboard-shortcuts/index.mjs +62 -79
  105. package/build-module/components/keyboard-shortcuts/index.mjs.map +1 -7
  106. package/build-module/components/more-menu/index.mjs +75 -128
  107. package/build-module/components/more-menu/index.mjs.map +1 -7
  108. package/build-module/components/sidebar-block-editor/index.mjs +86 -128
  109. package/build-module/components/sidebar-block-editor/index.mjs.map +1 -7
  110. package/build-module/components/sidebar-block-editor/sidebar-adapter.mjs +202 -250
  111. package/build-module/components/sidebar-block-editor/sidebar-adapter.mjs.map +1 -7
  112. package/build-module/components/sidebar-block-editor/sidebar-editor-provider.mjs +17 -25
  113. package/build-module/components/sidebar-block-editor/sidebar-editor-provider.mjs.map +1 -7
  114. package/build-module/components/sidebar-block-editor/use-sidebar-block-editor.mjs +54 -86
  115. package/build-module/components/sidebar-block-editor/use-sidebar-block-editor.mjs.map +1 -7
  116. package/build-module/components/sidebar-controls/index.mjs +19 -27
  117. package/build-module/components/sidebar-controls/index.mjs.map +1 -7
  118. package/build-module/components/welcome-guide/index.mjs +62 -71
  119. package/build-module/components/welcome-guide/index.mjs.map +1 -7
  120. package/build-module/controls/inserter-outer-section.mjs +61 -88
  121. package/build-module/controls/inserter-outer-section.mjs.map +1 -7
  122. package/build-module/controls/inspector-section.mjs +52 -70
  123. package/build-module/controls/inspector-section.mjs.map +1 -7
  124. package/build-module/controls/sidebar-control.mjs +33 -45
  125. package/build-module/controls/sidebar-control.mjs.map +1 -7
  126. package/build-module/controls/sidebar-section.mjs +59 -80
  127. package/build-module/controls/sidebar-section.mjs.map +1 -7
  128. package/build-module/filters/index.mjs +0 -2
  129. package/build-module/filters/move-to-sidebar.mjs +52 -79
  130. package/build-module/filters/move-to-sidebar.mjs.map +1 -7
  131. package/build-module/filters/replace-media-upload.mjs +5 -8
  132. package/build-module/filters/replace-media-upload.mjs.map +1 -7
  133. package/build-module/filters/wide-widget-display.mjs +13 -18
  134. package/build-module/filters/wide-widget-display.mjs.map +1 -7
  135. package/build-module/index.mjs +53 -71
  136. package/build-module/index.mjs.map +1 -7
  137. package/build-module/lock-unlock.mjs +5 -10
  138. package/build-module/lock-unlock.mjs.map +1 -7
  139. package/build-module/store/actions.mjs +44 -8
  140. package/build-module/store/actions.mjs.map +1 -7
  141. package/build-module/store/constants.mjs +7 -5
  142. package/build-module/store/constants.mjs.map +1 -7
  143. package/build-module/store/index.mjs +15 -11
  144. package/build-module/store/index.mjs.map +1 -7
  145. package/build-module/store/reducer.mjs +15 -13
  146. package/build-module/store/reducer.mjs.map +1 -7
  147. package/build-module/store/selectors.mjs +41 -13
  148. package/build-module/store/selectors.mjs.map +1 -7
  149. package/build-module/utils.mjs +74 -82
  150. package/build-module/utils.mjs.map +1 -7
  151. package/build-style/style-rtl.css +23 -5
  152. package/build-style/style.css +23 -5
  153. package/package.json +27 -27
  154. package/src/components/customize-widgets/index.jsx +2 -2
  155. package/src/components/error-boundary/index.jsx +2 -2
  156. package/src/components/header/style.scss +16 -5
  157. package/src/components/inserter/style.scss +8 -0
  158. package/src/components/keyboard-shortcut-help-modal/shortcut.jsx +1 -0
  159. package/src/components/keyboard-shortcut-help-modal/style.scss +1 -1
  160. package/src/components/more-menu/index.jsx +0 -1
  161. package/src/components/welcome-guide/index.jsx +6 -2
  162. package/build/filters/index.cjs.map +0 -7
  163. 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
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
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
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
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_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
- var sidebar_control_exports = {};
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
- const {
42
- wp: { customize }
43
- } = window;
44
- return class SidebarControl extends customize.Control {
45
- constructor(...args) {
46
- super(...args);
47
- this.subscribers = /* @__PURE__ */ new Set();
48
- }
49
- ready() {
50
- const InserterOuterSection = (0, import_inserter_outer_section.default)();
51
- this.inserter = new InserterOuterSection(
52
- getInserterId(this.id),
53
- {}
54
- );
55
- customize.section.add(this.inserter);
56
- this.sectionInstance = customize.section(this.section());
57
- this.inspector = this.sectionInstance.inspector;
58
- this.sidebarAdapter = new import_sidebar_adapter.default(this.setting, customize);
59
- }
60
- subscribe(callback) {
61
- this.subscribers.add(callback);
62
- return () => {
63
- this.subscribers.delete(callback);
64
- };
65
- }
66
- onChangeSectionExpanded(expanded, args) {
67
- if (!args.unchanged) {
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
- //# sourceMappingURL=sidebar-control.cjs.map
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
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
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
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
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
- var sidebar_section_exports = {};
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
- const {
40
- wp: { customize }
41
- } = window;
42
- const reduceMotionMediaQuery = window.matchMedia(
43
- "(prefers-reduced-motion: reduce)"
44
- );
45
- let isReducedMotion = reduceMotionMediaQuery.matches;
46
- reduceMotionMediaQuery.addEventListener("change", (event) => {
47
- isReducedMotion = event.matches;
48
- });
49
- return class SidebarSection extends customize.Section {
50
- ready() {
51
- const InspectorSection = (0, import_inspector_section.default)();
52
- this.inspector = new InspectorSection(
53
- getInspectorSectionId(this.id),
54
- {
55
- title: (0, import_i18n.__)("Block Settings"),
56
- parentSection: this,
57
- customizeAction: [
58
- (0, import_i18n.__)("Customizing"),
59
- (0, import_i18n.__)("Widgets"),
60
- this.params.title
61
- ].join(" ▸ ")
62
- }
63
- );
64
- customize.section.add(this.inspector);
65
- this.contentContainer[0].classList.add(
66
- "customize-widgets__sidebar-section"
67
- );
68
- }
69
- hasSubSectionOpened() {
70
- return this.inspector.expanded();
71
- }
72
- onChangeExpanded(expanded, _args) {
73
- const controls = this.controls();
74
- const args = {
75
- ..._args,
76
- completeCallback() {
77
- controls.forEach((control) => {
78
- control.onChangeSectionExpanded?.(expanded, args);
79
- });
80
- _args.completeCallback?.();
81
- }
82
- };
83
- if (args.manualTransition) {
84
- if (expanded) {
85
- this.contentContainer.addClass(["busy", "open"]);
86
- this.contentContainer.removeClass("is-sub-section-open");
87
- this.contentContainer.closest(".wp-full-overlay").addClass("section-open");
88
- } else {
89
- this.contentContainer.addClass([
90
- "busy",
91
- "is-sub-section-open"
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
- //# sourceMappingURL=sidebar-section.cjs.map
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"}
@@ -1,5 +1,8 @@
1
- // packages/customize-widgets/src/filters/index.js
2
- var import_move_to_sidebar = require("./move-to-sidebar.cjs");
3
- var import_replace_media_upload = require("./replace-media-upload.cjs");
4
- var import_wide_widget_display = require("./wide-widget-display.cjs");
5
- //# sourceMappingURL=index.cjs.map
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
- var import_block_editor = require("@wordpress/block-editor");
3
- var import_compose = require("@wordpress/compose");
4
- var import_data = require("@wordpress/data");
5
- var import_hooks = require("@wordpress/hooks");
6
- var import_widgets = require("@wordpress/widgets");
7
- var import_sidebar_controls = require("../components/sidebar-controls/index.cjs");
8
- var import_focus_control = require("../components/focus-control/index.cjs");
9
- var import_utils = require("../utils.cjs");
10
- var import_jsx_runtime = require("react/jsx-runtime");
11
- var withMoveToSidebarToolbarItem = (0, import_compose.createHigherOrderComponent)(
12
- (BlockEdit) => (props) => {
13
- let widgetId = (0, import_widgets.getWidgetIdFromBlock)(props);
14
- const sidebarControls = (0, import_sidebar_controls.useSidebarControls)();
15
- const activeSidebarControl = (0, import_sidebar_controls.useActiveSidebarControl)();
16
- const hasMultipleSidebars = sidebarControls?.length > 1;
17
- const blockName = props.name;
18
- const clientId = props.clientId;
19
- const canInsertBlockInSidebar = (0, import_data.useSelect)(
20
- (select) => {
21
- return select(import_block_editor.store).canInsertBlockType(
22
- blockName,
23
- ""
24
- );
25
- },
26
- [blockName]
27
- );
28
- const block = (0, import_data.useSelect)(
29
- (select) => select(import_block_editor.store).getBlock(clientId),
30
- [clientId]
31
- );
32
- const { removeBlock } = (0, import_data.useDispatch)(import_block_editor.store);
33
- const [, focusWidget] = (0, import_focus_control.useFocusControl)();
34
- function moveToSidebar(sidebarControlId) {
35
- const newSidebarControl = sidebarControls.find(
36
- (sidebarControl) => sidebarControl.id === sidebarControlId
37
- );
38
- if (widgetId) {
39
- const oldSetting = activeSidebarControl.setting;
40
- const newSetting = newSidebarControl.setting;
41
- oldSetting(oldSetting().filter((id) => id !== widgetId));
42
- newSetting([...newSetting(), widgetId]);
43
- } else {
44
- const sidebarAdapter = newSidebarControl.sidebarAdapter;
45
- removeBlock(clientId);
46
- const addedWidgetIds = sidebarAdapter.setWidgets([
47
- ...sidebarAdapter.getWidgets(),
48
- (0, import_utils.blockToWidget)(block)
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
- var import_hooks = require("@wordpress/hooks");
3
- var import_media_utils = require("@wordpress/media-utils");
4
- var replaceMediaUpload = () => import_media_utils.MediaUpload;
5
- (0, import_hooks.addFilter)(
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"}