@wordpress/customize-widgets 5.32.0 → 5.32.1-next.ff1cebbba.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 (164) hide show
  1. package/build/components/block-appender/index.js +33 -27
  2. package/build/components/block-appender/index.js.map +7 -1
  3. package/build/components/block-inspector-button/index.js +51 -36
  4. package/build/components/block-inspector-button/index.js.map +7 -1
  5. package/build/components/customize-widgets/index.js +83 -61
  6. package/build/components/customize-widgets/index.js.map +7 -1
  7. package/build/components/customize-widgets/use-clear-selected-block.js +56 -63
  8. package/build/components/customize-widgets/use-clear-selected-block.js.map +7 -1
  9. package/build/components/error-boundary/index.js +46 -45
  10. package/build/components/error-boundary/index.js.map +7 -1
  11. package/build/components/focus-control/index.js +69 -57
  12. package/build/components/focus-control/index.js.map +7 -1
  13. package/build/components/focus-control/use-blocks-focus-control.js +38 -31
  14. package/build/components/focus-control/use-blocks-focus-control.js.map +7 -1
  15. package/build/components/header/index.js +110 -71
  16. package/build/components/header/index.js.map +7 -1
  17. package/build/components/inserter/index.js +77 -53
  18. package/build/components/inserter/index.js.map +7 -1
  19. package/build/components/inserter/use-inserter.js +46 -29
  20. package/build/components/inserter/use-inserter.js.map +7 -1
  21. package/build/components/keyboard-shortcut-help-modal/config.js +74 -71
  22. package/build/components/keyboard-shortcut-help-modal/config.js.map +7 -1
  23. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +61 -44
  24. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
  25. package/build/components/keyboard-shortcut-help-modal/index.js +155 -110
  26. package/build/components/keyboard-shortcut-help-modal/index.js.map +7 -1
  27. package/build/components/keyboard-shortcut-help-modal/shortcut.js +76 -56
  28. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
  29. package/build/components/keyboard-shortcuts/index.js +60 -51
  30. package/build/components/keyboard-shortcuts/index.js.map +7 -1
  31. package/build/components/more-menu/index.js +151 -90
  32. package/build/components/more-menu/index.js.map +7 -1
  33. package/build/components/sidebar-block-editor/index.js +133 -105
  34. package/build/components/sidebar-block-editor/index.js.map +7 -1
  35. package/build/components/sidebar-block-editor/sidebar-adapter.js +73 -67
  36. package/build/components/sidebar-block-editor/sidebar-adapter.js.map +7 -1
  37. package/build/components/sidebar-block-editor/sidebar-editor-provider.js +51 -33
  38. package/build/components/sidebar-block-editor/sidebar-editor-provider.js.map +7 -1
  39. package/build/components/sidebar-block-editor/use-sidebar-block-editor.js +100 -79
  40. package/build/components/sidebar-block-editor/use-sidebar-block-editor.js.map +7 -1
  41. package/build/components/sidebar-controls/index.js +45 -31
  42. package/build/components/sidebar-controls/index.js.map +7 -1
  43. package/build/components/welcome-guide/index.js +86 -58
  44. package/build/components/welcome-guide/index.js.map +7 -1
  45. package/build/controls/inserter-outer-section.js +49 -58
  46. package/build/controls/inserter-outer-section.js.map +7 -1
  47. package/build/controls/inspector-section.js +30 -36
  48. package/build/controls/inspector-section.js.map +7 -1
  49. package/build/controls/sidebar-control.js +51 -30
  50. package/build/controls/sidebar-control.js.map +7 -1
  51. package/build/controls/sidebar-section.js +71 -39
  52. package/build/controls/sidebar-section.js.map +7 -1
  53. package/build/filters/index.js +4 -6
  54. package/build/filters/index.js.map +7 -1
  55. package/build/filters/move-to-sidebar.js +77 -79
  56. package/build/filters/move-to-sidebar.js.map +7 -1
  57. package/build/filters/replace-media-upload.js +9 -11
  58. package/build/filters/replace-media-upload.js.map +7 -1
  59. package/build/filters/wide-widget-display.js +20 -25
  60. package/build/filters/wide-widget-display.js.map +7 -1
  61. package/build/index.js +81 -70
  62. package/build/index.js.map +7 -1
  63. package/build/lock-unlock.js +31 -15
  64. package/build/lock-unlock.js.map +7 -1
  65. package/build/store/actions.js +27 -44
  66. package/build/store/actions.js.map +7 -1
  67. package/build/store/constants.js +27 -10
  68. package/build/store/constants.js.map +7 -1
  69. package/build/store/index.js +44 -40
  70. package/build/store/index.js.map +7 -1
  71. package/build/store/reducer.js +25 -19
  72. package/build/store/reducer.js.map +7 -1
  73. package/build/store/selectors.js +31 -44
  74. package/build/store/selectors.js.map +7 -1
  75. package/build/utils.js +45 -73
  76. package/build/utils.js.map +7 -1
  77. package/build-module/components/block-appender/index.js +17 -20
  78. package/build-module/components/block-appender/index.js.map +7 -1
  79. package/build-module/components/block-inspector-button/index.js +33 -30
  80. package/build-module/components/block-inspector-button/index.js.map +7 -1
  81. package/build-module/components/customize-widgets/index.js +52 -51
  82. package/build-module/components/customize-widgets/index.js.map +7 -1
  83. package/build-module/components/customize-widgets/use-clear-selected-block.js +38 -58
  84. package/build-module/components/customize-widgets/use-clear-selected-block.js.map +7 -1
  85. package/build-module/components/error-boundary/index.js +27 -37
  86. package/build-module/components/error-boundary/index.js.map +7 -1
  87. package/build-module/components/focus-control/index.js +50 -45
  88. package/build-module/components/focus-control/index.js.map +7 -1
  89. package/build-module/components/focus-control/use-blocks-focus-control.js +17 -22
  90. package/build-module/components/focus-control/use-blocks-focus-control.js.map +7 -1
  91. package/build-module/components/header/index.js +81 -63
  92. package/build-module/components/header/index.js.map +7 -1
  93. package/build-module/components/inserter/index.js +59 -47
  94. package/build-module/components/inserter/index.js.map +7 -1
  95. package/build-module/components/inserter/use-inserter.js +28 -23
  96. package/build-module/components/inserter/use-inserter.js.map +7 -1
  97. package/build-module/components/keyboard-shortcut-help-modal/config.js +62 -75
  98. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +7 -1
  99. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +33 -37
  100. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
  101. package/build-module/components/keyboard-shortcut-help-modal/index.js +130 -103
  102. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +7 -1
  103. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +58 -50
  104. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
  105. package/build-module/components/keyboard-shortcuts/index.js +44 -44
  106. package/build-module/components/keyboard-shortcuts/index.js.map +7 -1
  107. package/build-module/components/more-menu/index.js +129 -84
  108. package/build-module/components/more-menu/index.js.map +7 -1
  109. package/build-module/components/sidebar-block-editor/index.js +109 -96
  110. package/build-module/components/sidebar-block-editor/index.js.map +7 -1
  111. package/build-module/components/sidebar-block-editor/sidebar-adapter.js +54 -59
  112. package/build-module/components/sidebar-block-editor/sidebar-adapter.js.map +7 -1
  113. package/build-module/components/sidebar-block-editor/sidebar-editor-provider.js +22 -25
  114. package/build-module/components/sidebar-block-editor/sidebar-editor-provider.js.map +7 -1
  115. package/build-module/components/sidebar-block-editor/use-sidebar-block-editor.js +70 -70
  116. package/build-module/components/sidebar-block-editor/use-sidebar-block-editor.js.map +7 -1
  117. package/build-module/components/sidebar-controls/index.js +24 -25
  118. package/build-module/components/sidebar-controls/index.js.map +7 -1
  119. package/build-module/components/welcome-guide/index.js +68 -52
  120. package/build-module/components/welcome-guide/index.js.map +7 -1
  121. package/build-module/controls/inserter-outer-section.js +31 -52
  122. package/build-module/controls/inserter-outer-section.js.map +7 -1
  123. package/build-module/controls/inspector-section.js +13 -32
  124. package/build-module/controls/inspector-section.js.map +7 -1
  125. package/build-module/controls/sidebar-control.js +22 -22
  126. package/build-module/controls/sidebar-control.js.map +7 -1
  127. package/build-module/controls/sidebar-section.js +43 -32
  128. package/build-module/controls/sidebar-section.js.map +7 -1
  129. package/build-module/filters/index.js +4 -7
  130. package/build-module/filters/index.js.map +7 -1
  131. package/build-module/filters/move-to-sidebar.js +83 -76
  132. package/build-module/filters/move-to-sidebar.js.map +7 -1
  133. package/build-module/filters/replace-media-upload.js +8 -7
  134. package/build-module/filters/replace-media-upload.js.map +7 -1
  135. package/build-module/filters/wide-widget-display.js +20 -22
  136. package/build-module/filters/wide-widget-display.js.map +7 -1
  137. package/build-module/index.js +53 -51
  138. package/build-module/index.js.map +7 -1
  139. package/build-module/lock-unlock.js +8 -7
  140. package/build-module/lock-unlock.js.map +7 -1
  141. package/build-module/store/actions.js +6 -40
  142. package/build-module/store/actions.js.map +7 -1
  143. package/build-module/store/constants.js +5 -5
  144. package/build-module/store/constants.js.map +7 -1
  145. package/build-module/store/index.js +10 -30
  146. package/build-module/store/index.js.map +7 -1
  147. package/build-module/store/reducer.js +7 -14
  148. package/build-module/store/reducer.js.map +7 -1
  149. package/build-module/store/selectors.js +10 -40
  150. package/build-module/store/selectors.js.map +7 -1
  151. package/build-module/utils.js +21 -66
  152. package/build-module/utils.js.map +7 -1
  153. package/build-style/style-rtl.css +14 -149
  154. package/build-style/style.css +14 -149
  155. package/package.json +30 -23
  156. package/src/components/block-inspector-button/style.scss +3 -0
  157. package/src/components/header/style.scss +5 -0
  158. package/src/components/inserter/style.scss +3 -0
  159. package/src/components/keyboard-shortcut-help-modal/style.scss +2 -0
  160. package/src/components/more-menu/style.scss +2 -0
  161. package/src/components/sidebar-block-editor/style.scss +2 -0
  162. package/src/components/welcome-guide/style.scss +2 -0
  163. package/src/controls/style.scss +2 -0
  164. package/src/style.scss +10 -8
@@ -1,8 +1,6 @@
1
- export default function getInspectorSection() {
1
+ function getInspectorSection() {
2
2
  const {
3
- wp: {
4
- customize
5
- }
3
+ wp: { customize }
6
4
  } = window;
7
5
  return class InspectorSection extends customize.Section {
8
6
  constructor(id, options) {
@@ -19,7 +17,9 @@ export default function getInspectorSection() {
19
17
  this.triggerActiveCallbacks();
20
18
  }
21
19
  ready() {
22
- this.contentContainer[0].classList.add('customize-widgets-layout__inspector');
20
+ this.contentContainer[0].classList.add(
21
+ "customize-widgets-layout__inspector"
22
+ );
23
23
  }
24
24
  isContextuallyActive() {
25
25
  return this.isOpen;
@@ -35,8 +35,9 @@ export default function getInspectorSection() {
35
35
  this.parentSection.expand({
36
36
  manualTransition: true,
37
37
  completeCallback: () => {
38
- // Return focus after finishing the transition.
39
- if (this.returnFocusWhenClose && !this.contentContainer[0].contains(this.returnFocusWhenClose)) {
38
+ if (this.returnFocusWhenClose && !this.contentContainer[0].contains(
39
+ this.returnFocusWhenClose
40
+ )) {
40
41
  this.returnFocusWhenClose.focus();
41
42
  }
42
43
  }
@@ -44,9 +45,7 @@ export default function getInspectorSection() {
44
45
  }
45
46
  }
46
47
  }
47
- open({
48
- returnFocusWhenClose
49
- } = {}) {
48
+ open({ returnFocusWhenClose } = {}) {
50
49
  this.isOpen = true;
51
50
  this.returnFocusWhenClose = returnFocusWhenClose;
52
51
  this.expand({
@@ -59,33 +58,15 @@ export default function getInspectorSection() {
59
58
  });
60
59
  }
61
60
  collapse(options) {
62
- // Overridden collapse() function. Mostly call the parent collapse(), but also
63
- // move our .isOpen to false.
64
- // Initially, I tried tracking this with onChangeExpanded(), but it doesn't work
65
- // because the block settings sidebar is a layer "on top of" the G editor sidebar.
66
- //
67
- // For example, when closing the block settings sidebar, the G
68
- // editor sidebar would display, and onChangeExpanded in
69
- // inspector-section would run with expanded=true, but I want
70
- // isOpen to be false when the block settings is closed.
71
61
  this.isOpen = false;
72
62
  super.collapse(options);
73
63
  }
74
64
  triggerActiveCallbacks() {
75
- // Manually fire the callbacks associated with moving this.active
76
- // from false to true. "active" is always true for this section,
77
- // and "isContextuallyActive" reflects if the block settings
78
- // sidebar is currently visible, that is, it has replaced the main
79
- // Gutenberg view.
80
- // The WP customizer only checks ".isContextuallyActive()" when
81
- // ".active" changes values. But our ".active" never changes value.
82
- // The WP customizer never foresaw a section being used a way we
83
- // fit the block settings sidebar into a section. By manually
84
- // triggering the "this.active" callbacks, we force the WP
85
- // customizer to query our .isContextuallyActive() function and
86
- // update its view of our status.
87
65
  this.active.callbacks.fireWith(this.active, [false, true]);
88
66
  }
89
67
  };
90
68
  }
91
- //# sourceMappingURL=inspector-section.js.map
69
+ export {
70
+ getInspectorSection as default
71
+ };
72
+ //# sourceMappingURL=inspector-section.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["getInspectorSection","wp","customize","window","InspectorSection","Section","constructor","id","options","parentSection","returnFocusWhenClose","_isOpen","isOpen","value","triggerActiveCallbacks","ready","contentContainer","classList","add","isContextuallyActive","onChangeExpanded","expanded","args","unchanged","collapse","manualTransition","expand","completeCallback","contains","focus","open","allowMultiple","close","active","callbacks","fireWith"],"sources":["@wordpress/customize-widgets/src/controls/inspector-section.js"],"sourcesContent":["export default function getInspectorSection() {\n\tconst {\n\t\twp: { customize },\n\t} = window;\n\n\treturn class InspectorSection extends customize.Section {\n\t\tconstructor( id, options ) {\n\t\t\tsuper( id, options );\n\n\t\t\tthis.parentSection = options.parentSection;\n\n\t\t\tthis.returnFocusWhenClose = null;\n\t\t\tthis._isOpen = false;\n\t\t}\n\t\tget isOpen() {\n\t\t\treturn this._isOpen;\n\t\t}\n\t\tset isOpen( value ) {\n\t\t\tthis._isOpen = value;\n\t\t\tthis.triggerActiveCallbacks();\n\t\t}\n\t\tready() {\n\t\t\tthis.contentContainer[ 0 ].classList.add(\n\t\t\t\t'customize-widgets-layout__inspector'\n\t\t\t);\n\t\t}\n\t\tisContextuallyActive() {\n\t\t\treturn this.isOpen;\n\t\t}\n\t\tonChangeExpanded( expanded, args ) {\n\t\t\tsuper.onChangeExpanded( expanded, args );\n\n\t\t\tif ( this.parentSection && ! args.unchanged ) {\n\t\t\t\tif ( expanded ) {\n\t\t\t\t\tthis.parentSection.collapse( {\n\t\t\t\t\t\tmanualTransition: true,\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tthis.parentSection.expand( {\n\t\t\t\t\t\tmanualTransition: true,\n\t\t\t\t\t\tcompleteCallback: () => {\n\t\t\t\t\t\t\t// Return focus after finishing the transition.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tthis.returnFocusWhenClose &&\n\t\t\t\t\t\t\t\t! this.contentContainer[ 0 ].contains(\n\t\t\t\t\t\t\t\t\tthis.returnFocusWhenClose\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tthis.returnFocusWhenClose.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\topen( { returnFocusWhenClose } = {} ) {\n\t\t\tthis.isOpen = true;\n\t\t\tthis.returnFocusWhenClose = returnFocusWhenClose;\n\n\t\t\tthis.expand( {\n\t\t\t\tallowMultiple: true,\n\t\t\t} );\n\t\t}\n\t\tclose() {\n\t\t\tthis.collapse( {\n\t\t\t\tallowMultiple: true,\n\t\t\t} );\n\t\t}\n\t\tcollapse( options ) {\n\t\t\t// Overridden collapse() function. Mostly call the parent collapse(), but also\n\t\t\t// move our .isOpen to false.\n\t\t\t// Initially, I tried tracking this with onChangeExpanded(), but it doesn't work\n\t\t\t// because the block settings sidebar is a layer \"on top of\" the G editor sidebar.\n\t\t\t//\n\t\t\t// For example, when closing the block settings sidebar, the G\n\t\t\t// editor sidebar would display, and onChangeExpanded in\n\t\t\t// inspector-section would run with expanded=true, but I want\n\t\t\t// isOpen to be false when the block settings is closed.\n\t\t\tthis.isOpen = false;\n\t\t\tsuper.collapse( options );\n\t\t}\n\t\ttriggerActiveCallbacks() {\n\t\t\t// Manually fire the callbacks associated with moving this.active\n\t\t\t// from false to true. \"active\" is always true for this section,\n\t\t\t// and \"isContextuallyActive\" reflects if the block settings\n\t\t\t// sidebar is currently visible, that is, it has replaced the main\n\t\t\t// Gutenberg view.\n\t\t\t// The WP customizer only checks \".isContextuallyActive()\" when\n\t\t\t// \".active\" changes values. But our \".active\" never changes value.\n\t\t\t// The WP customizer never foresaw a section being used a way we\n\t\t\t// fit the block settings sidebar into a section. By manually\n\t\t\t// triggering the \"this.active\" callbacks, we force the WP\n\t\t\t// customizer to query our .isContextuallyActive() function and\n\t\t\t// update its view of our status.\n\t\t\tthis.active.callbacks.fireWith( this.active, [ false, true ] );\n\t\t}\n\t};\n}\n"],"mappings":"AAAA,eAAe,SAASA,mBAAmBA,CAAA,EAAG;EAC7C,MAAM;IACLC,EAAE,EAAE;MAAEC;IAAU;EACjB,CAAC,GAAGC,MAAM;EAEV,OAAO,MAAMC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AAC;cAClC;YACD;UACD,CAAE,CAAC;QACJ;MACD;IACD;IACAC,IAAIA,CAAE;MAAEpB;IAAqB,CAAC,GAAG,CAAC,CAAC,EAAG;MACrC,IAAI,CAACE,MAAM,GAAG,IAAI;MAClB,IAAI,CAACF,oBAAoB,GAAGA,oBAAoB;MAEhD,IAAI,CAACgB,MAAM,CAAE;QACZK,aAAa,EAAE;MAChB,CAAE,CAAC;IACJ;IACAC,KAAKA,CAAA,EAAG;MACP,IAAI,CAACR,QAAQ,CAAE;QACdO,aAAa,EAAE;MAChB,CAAE,CAAC;IACJ;IACAP,QAAQA,CAAEhB,OAAO,EAAG;MACnB;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA,IAAI,CAACI,MAAM,GAAG,KAAK;MACnB,KAAK,CAACY,QAAQ,CAAEhB,OAAQ,CAAC;IAC1B;IACAM,sBAAsBA,CAAA,EAAG;MACxB;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA,IAAI,CAACmB,MAAM,CAACC,SAAS,CAACC,QAAQ,CAAE,IAAI,CAACF,MAAM,EAAE,CAAE,KAAK,EAAE,IAAI,CAAG,CAAC;IAC/D;EACD,CAAC;AACF","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/controls/inspector-section.js"],
4
+ "sourcesContent": ["export default function getInspectorSection() {\n\tconst {\n\t\twp: { customize },\n\t} = window;\n\n\treturn class InspectorSection extends customize.Section {\n\t\tconstructor( id, options ) {\n\t\t\tsuper( id, options );\n\n\t\t\tthis.parentSection = options.parentSection;\n\n\t\t\tthis.returnFocusWhenClose = null;\n\t\t\tthis._isOpen = false;\n\t\t}\n\t\tget isOpen() {\n\t\t\treturn this._isOpen;\n\t\t}\n\t\tset isOpen( value ) {\n\t\t\tthis._isOpen = value;\n\t\t\tthis.triggerActiveCallbacks();\n\t\t}\n\t\tready() {\n\t\t\tthis.contentContainer[ 0 ].classList.add(\n\t\t\t\t'customize-widgets-layout__inspector'\n\t\t\t);\n\t\t}\n\t\tisContextuallyActive() {\n\t\t\treturn this.isOpen;\n\t\t}\n\t\tonChangeExpanded( expanded, args ) {\n\t\t\tsuper.onChangeExpanded( expanded, args );\n\n\t\t\tif ( this.parentSection && ! args.unchanged ) {\n\t\t\t\tif ( expanded ) {\n\t\t\t\t\tthis.parentSection.collapse( {\n\t\t\t\t\t\tmanualTransition: true,\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tthis.parentSection.expand( {\n\t\t\t\t\t\tmanualTransition: true,\n\t\t\t\t\t\tcompleteCallback: () => {\n\t\t\t\t\t\t\t// Return focus after finishing the transition.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tthis.returnFocusWhenClose &&\n\t\t\t\t\t\t\t\t! this.contentContainer[ 0 ].contains(\n\t\t\t\t\t\t\t\t\tthis.returnFocusWhenClose\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tthis.returnFocusWhenClose.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\topen( { returnFocusWhenClose } = {} ) {\n\t\t\tthis.isOpen = true;\n\t\t\tthis.returnFocusWhenClose = returnFocusWhenClose;\n\n\t\t\tthis.expand( {\n\t\t\t\tallowMultiple: true,\n\t\t\t} );\n\t\t}\n\t\tclose() {\n\t\t\tthis.collapse( {\n\t\t\t\tallowMultiple: true,\n\t\t\t} );\n\t\t}\n\t\tcollapse( options ) {\n\t\t\t// Overridden collapse() function. Mostly call the parent collapse(), but also\n\t\t\t// move our .isOpen to false.\n\t\t\t// Initially, I tried tracking this with onChangeExpanded(), but it doesn't work\n\t\t\t// because the block settings sidebar is a layer \"on top of\" the G editor sidebar.\n\t\t\t//\n\t\t\t// For example, when closing the block settings sidebar, the G\n\t\t\t// editor sidebar would display, and onChangeExpanded in\n\t\t\t// inspector-section would run with expanded=true, but I want\n\t\t\t// isOpen to be false when the block settings is closed.\n\t\t\tthis.isOpen = false;\n\t\t\tsuper.collapse( options );\n\t\t}\n\t\ttriggerActiveCallbacks() {\n\t\t\t// Manually fire the callbacks associated with moving this.active\n\t\t\t// from false to true. \"active\" is always true for this section,\n\t\t\t// and \"isContextuallyActive\" reflects if the block settings\n\t\t\t// sidebar is currently visible, that is, it has replaced the main\n\t\t\t// Gutenberg view.\n\t\t\t// The WP customizer only checks \".isContextuallyActive()\" when\n\t\t\t// \".active\" changes values. But our \".active\" never changes value.\n\t\t\t// The WP customizer never foresaw a section being used a way we\n\t\t\t// fit the block settings sidebar into a section. By manually\n\t\t\t// triggering the \"this.active\" callbacks, we force the WP\n\t\t\t// customizer to query our .isContextuallyActive() function and\n\t\t\t// update its view of our status.\n\t\t\tthis.active.callbacks.fireWith( this.active, [ false, true ] );\n\t\t}\n\t};\n}\n"],
5
+ "mappings": "AAAe,SAAR,sBAAuC;AAC7C,QAAM;AAAA,IACL,IAAI,EAAE,UAAU;AAAA,EACjB,IAAI;AAEJ,SAAO,MAAM,yBAAyB,UAAU,QAAQ;AAAA,IACvD,YAAa,IAAI,SAAU;AAC1B,YAAO,IAAI,OAAQ;AAEnB,WAAK,gBAAgB,QAAQ;AAE7B,WAAK,uBAAuB;AAC5B,WAAK,UAAU;AAAA,IAChB;AAAA,IACA,IAAI,SAAS;AACZ,aAAO,KAAK;AAAA,IACb;AAAA,IACA,IAAI,OAAQ,OAAQ;AACnB,WAAK,UAAU;AACf,WAAK,uBAAuB;AAAA,IAC7B;AAAA,IACA,QAAQ;AACP,WAAK,iBAAkB,CAAE,EAAE,UAAU;AAAA,QACpC;AAAA,MACD;AAAA,IACD;AAAA,IACA,uBAAuB;AACtB,aAAO,KAAK;AAAA,IACb;AAAA,IACA,iBAAkB,UAAU,MAAO;AAClC,YAAM,iBAAkB,UAAU,IAAK;AAEvC,UAAK,KAAK,iBAAiB,CAAE,KAAK,WAAY;AAC7C,YAAK,UAAW;AACf,eAAK,cAAc,SAAU;AAAA,YAC5B,kBAAkB;AAAA,UACnB,CAAE;AAAA,QACH,OAAO;AACN,eAAK,cAAc,OAAQ;AAAA,YAC1B,kBAAkB;AAAA,YAClB,kBAAkB,MAAM;AAEvB,kBACC,KAAK,wBACL,CAAE,KAAK,iBAAkB,CAAE,EAAE;AAAA,gBAC5B,KAAK;AAAA,cACN,GACC;AACD,qBAAK,qBAAqB,MAAM;AAAA,cACjC;AAAA,YACD;AAAA,UACD,CAAE;AAAA,QACH;AAAA,MACD;AAAA,IACD;AAAA,IACA,KAAM,EAAE,qBAAqB,IAAI,CAAC,GAAI;AACrC,WAAK,SAAS;AACd,WAAK,uBAAuB;AAE5B,WAAK,OAAQ;AAAA,QACZ,eAAe;AAAA,MAChB,CAAE;AAAA,IACH;AAAA,IACA,QAAQ;AACP,WAAK,SAAU;AAAA,QACd,eAAe;AAAA,MAChB,CAAE;AAAA,IACH;AAAA,IACA,SAAU,SAAU;AAUnB,WAAK,SAAS;AACd,YAAM,SAAU,OAAQ;AAAA,IACzB;AAAA,IACA,yBAAyB;AAaxB,WAAK,OAAO,UAAU,SAAU,KAAK,QAAQ,CAAE,OAAO,IAAK,CAAE;AAAA,IAC9D;AAAA,EACD;AACD;",
6
+ "names": []
7
+ }
@@ -1,29 +1,23 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { dispatch } from '@wordpress/data';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import SidebarAdapter from '../components/sidebar-block-editor/sidebar-adapter';
10
- import getInserterOuterSection from './inserter-outer-section';
11
- import { store as customizeWidgetsStore } from '../store';
12
- const getInserterId = controlId => `widgets-inserter-${controlId}`;
13
- export default function getSidebarControl() {
1
+ import { dispatch } from "@wordpress/data";
2
+ import SidebarAdapter from "../components/sidebar-block-editor/sidebar-adapter";
3
+ import getInserterOuterSection from "./inserter-outer-section";
4
+ import { store as customizeWidgetsStore } from "../store";
5
+ const getInserterId = (controlId) => `widgets-inserter-${controlId}`;
6
+ function getSidebarControl() {
14
7
  const {
15
- wp: {
16
- customize
17
- }
8
+ wp: { customize }
18
9
  } = window;
19
10
  return class SidebarControl extends customize.Control {
20
11
  constructor(...args) {
21
12
  super(...args);
22
- this.subscribers = new Set();
13
+ this.subscribers = /* @__PURE__ */ new Set();
23
14
  }
24
15
  ready() {
25
16
  const InserterOuterSection = getInserterOuterSection();
26
- this.inserter = new InserterOuterSection(getInserterId(this.id), {});
17
+ this.inserter = new InserterOuterSection(
18
+ getInserterId(this.id),
19
+ {}
20
+ );
27
21
  customize.section.add(this.inserter);
28
22
  this.sectionInstance = customize.section(this.section());
29
23
  this.inspector = this.sectionInstance.inspector;
@@ -37,13 +31,19 @@ export default function getSidebarControl() {
37
31
  }
38
32
  onChangeSectionExpanded(expanded, args) {
39
33
  if (!args.unchanged) {
40
- // Close the inserter when the section collapses.
41
34
  if (!expanded) {
42
- dispatch(customizeWidgetsStore).setIsInserterOpened(false);
35
+ dispatch(customizeWidgetsStore).setIsInserterOpened(
36
+ false
37
+ );
43
38
  }
44
- this.subscribers.forEach(subscriber => subscriber(expanded, args));
39
+ this.subscribers.forEach(
40
+ (subscriber) => subscriber(expanded, args)
41
+ );
45
42
  }
46
43
  }
47
44
  };
48
45
  }
49
- //# sourceMappingURL=sidebar-control.js.map
46
+ export {
47
+ getSidebarControl as default
48
+ };
49
+ //# sourceMappingURL=sidebar-control.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["dispatch","SidebarAdapter","getInserterOuterSection","store","customizeWidgetsStore","getInserterId","controlId","getSidebarControl","wp","customize","window","SidebarControl","Control","constructor","args","subscribers","Set","ready","InserterOuterSection","inserter","id","section","add","sectionInstance","inspector","sidebarAdapter","setting","subscribe","callback","delete","onChangeSectionExpanded","expanded","unchanged","setIsInserterOpened","forEach","subscriber"],"sources":["@wordpress/customize-widgets/src/controls/sidebar-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { dispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\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":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,iBAAiB;;AAE1C;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oDAAoD;AAC/E,OAAOC,uBAAuB,MAAM,0BAA0B;AAC9D,SAASC,KAAK,IAAIC,qBAAqB,QAAQ,UAAU;AAEzD,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,CACpD,KACD,CAAC;QACF;QAEA,IAAI,CAAClB,WAAW,CAACmB,OAAO,CAAIC,UAAU,IACrCA,UAAU,CAAEJ,QAAQ,EAAEjB,IAAK,CAC5B,CAAC;MACF;IACD;EACD,CAAC;AACF","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/controls/sidebar-control.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { dispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\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\tth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dependencies
3
- */
4
- import { __ } from '@wordpress/i18n';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import getInspectorSection from './inspector-section';
10
- const getInspectorSectionId = sidebarId => `widgets-inspector-${sidebarId}`;
11
- export default function getSidebarSection() {
1
+ import { __ } from "@wordpress/i18n";
2
+ import getInspectorSection from "./inspector-section";
3
+ const getInspectorSectionId = (sidebarId) => `widgets-inspector-${sidebarId}`;
4
+ function getSidebarSection() {
12
5
  const {
13
- wp: {
14
- customize
15
- }
6
+ wp: { customize }
16
7
  } = window;
17
- const reduceMotionMediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)');
8
+ const reduceMotionMediaQuery = window.matchMedia(
9
+ "(prefers-reduced-motion: reduce)"
10
+ );
18
11
  let isReducedMotion = reduceMotionMediaQuery.matches;
19
- reduceMotionMediaQuery.addEventListener('change', event => {
12
+ reduceMotionMediaQuery.addEventListener("change", (event) => {
20
13
  isReducedMotion = event.matches;
21
14
  });
22
15
  return class SidebarSection extends customize.Section {
23
16
  ready() {
24
17
  const InspectorSection = getInspectorSection();
25
- this.inspector = new InspectorSection(getInspectorSectionId(this.id), {
26
- title: __('Block Settings'),
27
- parentSection: this,
28
- customizeAction: [__('Customizing'), __('Widgets'), this.params.title].join(' ▸ ')
29
- });
18
+ this.inspector = new InspectorSection(
19
+ getInspectorSectionId(this.id),
20
+ {
21
+ title: __("Block Settings"),
22
+ parentSection: this,
23
+ customizeAction: [
24
+ __("Customizing"),
25
+ __("Widgets"),
26
+ this.params.title
27
+ ].join(" \u25B8 ")
28
+ }
29
+ );
30
30
  customize.section.add(this.inspector);
31
- this.contentContainer[0].classList.add('customize-widgets__sidebar-section');
31
+ this.contentContainer[0].classList.add(
32
+ "customize-widgets__sidebar-section"
33
+ );
32
34
  }
33
35
  hasSubSectionOpened() {
34
36
  return this.inspector.expanded();
@@ -38,7 +40,7 @@ export default function getSidebarSection() {
38
40
  const args = {
39
41
  ..._args,
40
42
  completeCallback() {
41
- controls.forEach(control => {
43
+ controls.forEach((control) => {
42
44
  control.onChangeSectionExpanded?.(expanded, args);
43
45
  });
44
46
  _args.completeCallback?.();
@@ -46,22 +48,28 @@ export default function getSidebarSection() {
46
48
  };
47
49
  if (args.manualTransition) {
48
50
  if (expanded) {
49
- this.contentContainer.addClass(['busy', 'open']);
50
- this.contentContainer.removeClass('is-sub-section-open');
51
- this.contentContainer.closest('.wp-full-overlay').addClass('section-open');
51
+ this.contentContainer.addClass(["busy", "open"]);
52
+ this.contentContainer.removeClass("is-sub-section-open");
53
+ this.contentContainer.closest(".wp-full-overlay").addClass("section-open");
52
54
  } else {
53
- this.contentContainer.addClass(['busy', 'is-sub-section-open']);
54
- this.contentContainer.closest('.wp-full-overlay').addClass('section-open');
55
- this.contentContainer.removeClass('open');
55
+ this.contentContainer.addClass([
56
+ "busy",
57
+ "is-sub-section-open"
58
+ ]);
59
+ this.contentContainer.closest(".wp-full-overlay").addClass("section-open");
60
+ this.contentContainer.removeClass("open");
56
61
  }
57
62
  const handleTransitionEnd = () => {
58
- this.contentContainer.removeClass('busy');
63
+ this.contentContainer.removeClass("busy");
59
64
  args.completeCallback();
60
65
  };
61
66
  if (isReducedMotion) {
62
67
  handleTransitionEnd();
63
68
  } else {
64
- this.contentContainer.one('transitionend', handleTransitionEnd);
69
+ this.contentContainer.one(
70
+ "transitionend",
71
+ handleTransitionEnd
72
+ );
65
73
  }
66
74
  } else {
67
75
  super.onChangeExpanded(expanded, args);
@@ -69,4 +77,7 @@ export default function getSidebarSection() {
69
77
  }
70
78
  };
71
79
  }
72
- //# sourceMappingURL=sidebar-section.js.map
80
+ export {
81
+ getSidebarSection as default
82
+ };
83
+ //# sourceMappingURL=sidebar-section.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["__","getInspectorSection","getInspectorSectionId","sidebarId","getSidebarSection","wp","customize","window","reduceMotionMediaQuery","matchMedia","isReducedMotion","matches","addEventListener","event","SidebarSection","Section","ready","InspectorSection","inspector","id","title","parentSection","customizeAction","params","join","section","add","contentContainer","classList","hasSubSectionOpened","expanded","onChangeExpanded","_args","controls","args","completeCallback","forEach","control","onChangeSectionExpanded","manualTransition","addClass","removeClass","closest","handleTransitionEnd","one"],"sources":["@wordpress/customize-widgets/src/controls/sidebar-section.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\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":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,qBAAqB;AAErD,MAAMC,qBAAqB,GAAKC,SAAS,IACxC,qBAAsBA,SAAS,EAAG;AAEnC,eAAe,SAASC,iBAAiBA,CAAA,EAAG;EAC3C,MAAM;IACLC,EAAE,EAAE;MAAEC;IAAU;EACjB,CAAC,GAA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I,IAAK,CAAC;UACpD,CAAE,CAAC;UACHF,KAAK,CAACG,gBAAgB,GAAG,CAAC;QAC3B;MACD,CAAC;MAED,IAAKD,IAAI,CAACK,gBAAgB,EAAG;QAC5B,IAAKT,QAAQ,EAAG;UACf,IAAI,CAACH,gBAAgB,CAACa,QAAQ,CAAE,CAAE,MAAM,EAAE,MAAM,CAAG,CAAC;UACpD,IAAI,CAACb,gBAAgB,CAACc,WAAW,CAAE,qBAAsB,CAAC;UAC1D,IAAI,CAACd,gBAAgB,CACnBe,OAAO,CAAE,kBAAmB,CAAC,CAC7BF,QAAQ,CAAE,cAAe,CAAC;QAC7B,CAAC,MAAM;UACN,IAAI,CAACb,gBAAgB,CAACa,QAAQ,CAAE,CAC/B,MAAM,EACN,qBAAqB,CACpB,CAAC;UACH,IAAI,CAACb,gBAAgB,CACnBe,OAAO,CAAE,kBAAmB,CAAC,CAC7BF,QAAQ,CAAE,cAAe,CAAC;UAC5B,IAAI,CAACb,gBAAgB,CAACc,WAAW,CAAE,MAAO,CAAC;QAC5C;QAEA,MAAME,mBAAmB,GAAGA,CAAA,KAAM;UACjC,IAAI,CAAChB,gBAAgB,CAACc,WAAW,CAAE,MAAO,CAAC;UAC3CP,IAAI,CAACC,gBAAgB,CAAC,CAAC;QACxB,CAAC;QAED,IAAKzB,eAAe,EAAG;UACtBiC,mBAAmB,CAAC,CAAC;QACtB,CAAC,MAAM;UACN,IAAI,CAAChB,gBAAgB,CAACiB,GAAG,CACxB,eAAe,EACfD,mBACD,CAAC;QACF;MACD,CAAC,MAAM;QACN,KAAK,CAACZ,gBAAgB,CAAED,QAAQ,EAAEI,IAAK,CAAC;MACzC;IACD;EACD,CAAC;AACF","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/controls/sidebar-section.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\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( ' \u25B8 ' ),\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": "AAGA,SAAS,UAAU;AAKnB,OAAO,yBAAyB;AAEhC,MAAM,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,mBAAmB,oBAAoB;AAC7C,WAAK,YAAY,IAAI;AAAA,QACpB,sBAAuB,KAAK,EAAG;AAAA,QAC/B;AAAA,UACC,OAAO,GAAI,gBAAiB;AAAA,UAC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
6
+ "names": []
7
+ }
@@ -1,7 +1,4 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import './move-to-sidebar';
5
- import './replace-media-upload';
6
- import './wide-widget-display';
7
- //# sourceMappingURL=index.js.map
1
+ import "./move-to-sidebar";
2
+ import "./replace-media-upload";
3
+ import "./wide-widget-display";
4
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":[],"sources":["@wordpress/customize-widgets/src/filters/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './move-to-sidebar';\nimport './replace-media-upload';\nimport './wide-widget-display';\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,mBAAmB;AAC1B,OAAO,wBAAwB;AAC/B,OAAO,uBAAuB","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/filters/index.js"],
4
+ "sourcesContent": ["/**\n * Internal dependencies\n */\nimport './move-to-sidebar';\nimport './replace-media-upload';\nimport './wide-widget-display';\n"],
5
+ "mappings": "AAGA,OAAO;AACP,OAAO;AACP,OAAO;",
6
+ "names": []
7
+ }
@@ -1,77 +1,84 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { BlockControls, store as blockEditorStore } from '@wordpress/block-editor';
5
- import { createHigherOrderComponent } from '@wordpress/compose';
6
- import { useSelect, useDispatch } from '@wordpress/data';
7
- import { addFilter } from '@wordpress/hooks';
8
- import { MoveToWidgetArea, getWidgetIdFromBlock } from '@wordpress/widgets';
9
-
10
- /**
11
- * Internal dependencies
12
- */
13
- import { useSidebarControls, useActiveSidebarControl } from '../components/sidebar-controls';
14
- import { useFocusControl } from '../components/focus-control';
15
- import { blockToWidget } from '../utils';
16
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
17
- const withMoveToSidebarToolbarItem = createHigherOrderComponent(BlockEdit => props => {
18
- let widgetId = getWidgetIdFromBlock(props);
19
- const sidebarControls = useSidebarControls();
20
- const activeSidebarControl = useActiveSidebarControl();
21
- const hasMultipleSidebars = sidebarControls?.length > 1;
22
- const blockName = props.name;
23
- const clientId = props.clientId;
24
- const canInsertBlockInSidebar = useSelect(select => {
25
- // Use an empty string to represent the root block list, which
26
- // in the customizer editor represents a sidebar/widget area.
27
- return select(blockEditorStore).canInsertBlockType(blockName, '');
28
- }, [blockName]);
29
- const block = useSelect(select => select(blockEditorStore).getBlock(clientId), [clientId]);
30
- const {
31
- removeBlock
32
- } = useDispatch(blockEditorStore);
33
- const [, focusWidget] = useFocusControl();
34
- function moveToSidebar(sidebarControlId) {
35
- const newSidebarControl = sidebarControls.find(sidebarControl => sidebarControl.id === sidebarControlId);
36
- if (widgetId) {
37
- /**
38
- * If there's a widgetId, move it to the other sidebar.
39
- */
40
- const oldSetting = activeSidebarControl.setting;
41
- const newSetting = newSidebarControl.setting;
42
- oldSetting(oldSetting().filter(id => id !== widgetId));
43
- newSetting([...newSetting(), widgetId]);
44
- } else {
45
- /**
46
- * If there isn't a widgetId, it's most likely a inner block.
47
- * First, remove the block in the original sidebar,
48
- * then, create a new widget in the new sidebar and get back its widgetId.
49
- */
50
- const sidebarAdapter = newSidebarControl.sidebarAdapter;
51
- removeBlock(clientId);
52
- const addedWidgetIds = sidebarAdapter.setWidgets([...sidebarAdapter.getWidgets(), blockToWidget(block)]);
53
- // The last non-null id is the added widget's id.
54
- widgetId = addedWidgetIds.reverse().find(id => !!id);
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import {
3
+ BlockControls,
4
+ store as blockEditorStore
5
+ } from "@wordpress/block-editor";
6
+ import { createHigherOrderComponent } from "@wordpress/compose";
7
+ import { useSelect, useDispatch } from "@wordpress/data";
8
+ import { addFilter } from "@wordpress/hooks";
9
+ import { MoveToWidgetArea, getWidgetIdFromBlock } from "@wordpress/widgets";
10
+ import {
11
+ useSidebarControls,
12
+ useActiveSidebarControl
13
+ } from "../components/sidebar-controls";
14
+ import { useFocusControl } from "../components/focus-control";
15
+ import { blockToWidget } from "../utils";
16
+ const withMoveToSidebarToolbarItem = createHigherOrderComponent(
17
+ (BlockEdit) => (props) => {
18
+ let widgetId = getWidgetIdFromBlock(props);
19
+ const sidebarControls = useSidebarControls();
20
+ const activeSidebarControl = useActiveSidebarControl();
21
+ const hasMultipleSidebars = sidebarControls?.length > 1;
22
+ const blockName = props.name;
23
+ const clientId = props.clientId;
24
+ const canInsertBlockInSidebar = useSelect(
25
+ (select) => {
26
+ return select(blockEditorStore).canInsertBlockType(
27
+ blockName,
28
+ ""
29
+ );
30
+ },
31
+ [blockName]
32
+ );
33
+ const block = useSelect(
34
+ (select) => select(blockEditorStore).getBlock(clientId),
35
+ [clientId]
36
+ );
37
+ const { removeBlock } = useDispatch(blockEditorStore);
38
+ const [, focusWidget] = useFocusControl();
39
+ function moveToSidebar(sidebarControlId) {
40
+ const newSidebarControl = sidebarControls.find(
41
+ (sidebarControl) => sidebarControl.id === sidebarControlId
42
+ );
43
+ if (widgetId) {
44
+ const oldSetting = activeSidebarControl.setting;
45
+ const newSetting = newSidebarControl.setting;
46
+ oldSetting(oldSetting().filter((id) => id !== widgetId));
47
+ newSetting([...newSetting(), widgetId]);
48
+ } else {
49
+ const sidebarAdapter = newSidebarControl.sidebarAdapter;
50
+ removeBlock(clientId);
51
+ const addedWidgetIds = sidebarAdapter.setWidgets([
52
+ ...sidebarAdapter.getWidgets(),
53
+ blockToWidget(block)
54
+ ]);
55
+ widgetId = addedWidgetIds.reverse().find((id) => !!id);
56
+ }
57
+ focusWidget(widgetId);
55
58
  }
56
-
57
- // Move focus to the moved widget and expand the sidebar.
58
- focusWidget(widgetId);
59
- }
60
- return /*#__PURE__*/_jsxs(_Fragment, {
61
- children: [/*#__PURE__*/_jsx(BlockEdit, {
62
- ...props
63
- }, "edit"), hasMultipleSidebars && canInsertBlockInSidebar && /*#__PURE__*/_jsx(BlockControls, {
64
- children: /*#__PURE__*/_jsx(MoveToWidgetArea, {
65
- widgetAreas: sidebarControls.map(sidebarControl => ({
66
- id: sidebarControl.id,
67
- name: sidebarControl.params.label,
68
- description: sidebarControl.params.description
69
- })),
70
- currentWidgetAreaId: activeSidebarControl?.id,
71
- onSelect: moveToSidebar
72
- })
73
- })]
74
- });
75
- }, 'withMoveToSidebarToolbarItem');
76
- addFilter('editor.BlockEdit', 'core/customize-widgets/block-edit', withMoveToSidebarToolbarItem);
77
- //# sourceMappingURL=move-to-sidebar.js.map
59
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
60
+ /* @__PURE__ */ jsx(BlockEdit, { ...props }, "edit"),
61
+ hasMultipleSidebars && canInsertBlockInSidebar && /* @__PURE__ */ jsx(BlockControls, { children: /* @__PURE__ */ jsx(
62
+ MoveToWidgetArea,
63
+ {
64
+ widgetAreas: sidebarControls.map(
65
+ (sidebarControl) => ({
66
+ id: sidebarControl.id,
67
+ name: sidebarControl.params.label,
68
+ description: sidebarControl.params.description
69
+ })
70
+ ),
71
+ currentWidgetAreaId: activeSidebarControl?.id,
72
+ onSelect: moveToSidebar
73
+ }
74
+ ) })
75
+ ] });
76
+ },
77
+ "withMoveToSidebarToolbarItem"
78
+ );
79
+ addFilter(
80
+ "editor.BlockEdit",
81
+ "core/customize-widgets/block-edit",
82
+ withMoveToSidebarToolbarItem
83
+ );
84
+ //# sourceMappingURL=move-to-sidebar.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["BlockControls","store","blockEditorStore","createHigherOrderComponent","useSelect","useDispatch","addFilter","MoveToWidgetArea","getWidgetIdFromBlock","useSidebarControls","useActiveSidebarControl","useFocusControl","blockToWidget","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","withMoveToSidebarToolbarItem","BlockEdit","props","widgetId","sidebarControls","activeSidebarControl","hasMultipleSidebars","length","blockName","name","clientId","canInsertBlockInSidebar","select","canInsertBlockType","block","getBlock","removeBlock","focusWidget","moveToSidebar","sidebarControlId","newSidebarControl","find","sidebarControl","id","oldSetting","setting","newSetting","filter","sidebarAdapter","addedWidgetIds","setWidgets","getWidgets","reverse","children","widgetAreas","map","params","label","description","currentWidgetAreaId","onSelect"],"sources":["@wordpress/customize-widgets/src/filters/move-to-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\nimport { MoveToWidgetArea, getWidgetIdFromBlock } from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseSidebarControls,\n\tuseActiveSidebarControl,\n} from '../components/sidebar-controls';\nimport { useFocusControl } from '../components/focus-control';\nimport { blockToWidget } from '../utils';\n\nconst withMoveToSidebarToolbarItem = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tlet widgetId = getWidgetIdFromBlock( props );\n\t\tconst sidebarControls = useSidebarControls();\n\t\tconst activeSidebarControl = useActiveSidebarControl();\n\t\tconst hasMultipleSidebars = sidebarControls?.length > 1;\n\t\tconst blockName = props.name;\n\t\tconst clientId = props.clientId;\n\t\tconst canInsertBlockInSidebar = useSelect(\n\t\t\t( select ) => {\n\t\t\t\t// Use an empty string to represent the root block list, which\n\t\t\t\t// in the customizer editor represents a sidebar/widget area.\n\t\t\t\treturn select( blockEditorStore ).canInsertBlockType(\n\t\t\t\t\tblockName,\n\t\t\t\t\t''\n\t\t\t\t);\n\t\t\t},\n\t\t\t[ blockName ]\n\t\t);\n\t\tconst block = useSelect(\n\t\t\t( select ) => select( blockEditorStore ).getBlock( clientId ),\n\t\t\t[ clientId ]\n\t\t);\n\t\tconst { removeBlock } = useDispatch( blockEditorStore );\n\t\tconst [ , focusWidget ] = useFocusControl();\n\n\t\tfunction moveToSidebar( sidebarControlId ) {\n\t\t\tconst newSidebarControl = sidebarControls.find(\n\t\t\t\t( sidebarControl ) => sidebarControl.id === sidebarControlId\n\t\t\t);\n\n\t\t\tif ( widgetId ) {\n\t\t\t\t/**\n\t\t\t\t * If there's a widgetId, move it to the other sidebar.\n\t\t\t\t */\n\t\t\t\tconst oldSetting = activeSidebarControl.setting;\n\t\t\t\tconst newSetting = newSidebarControl.setting;\n\n\t\t\t\toldSetting( oldSetting().filter( ( id ) => id !== widgetId ) );\n\t\t\t\tnewSetting( [ ...newSetting(), widgetId ] );\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If there isn't a widgetId, it's most likely a inner block.\n\t\t\t\t * First, remove the block in the original sidebar,\n\t\t\t\t * then, create a new widget in the new sidebar and get back its widgetId.\n\t\t\t\t */\n\t\t\t\tconst sidebarAdapter = newSidebarControl.sidebarAdapter;\n\n\t\t\t\tremoveBlock( clientId );\n\t\t\t\tconst addedWidgetIds = sidebarAdapter.setWidgets( [\n\t\t\t\t\t...sidebarAdapter.getWidgets(),\n\t\t\t\t\tblockToWidget( block ),\n\t\t\t\t] );\n\t\t\t\t// The last non-null id is the added widget's id.\n\t\t\t\twidgetId = addedWidgetIds.reverse().find( ( id ) => !! id );\n\t\t\t}\n\n\t\t\t// Move focus to the moved widget and expand the sidebar.\n\t\t\tfocusWidget( widgetId );\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit 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":"AAAA;AACA;AACA;AACA,SACCA,aAAa,EACbC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,0BAA0B,QAAQ,oBAAoB;AAC/D,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,gBAAgB,EAAEC,oBAAoB,QAAQ,oBAAoB;;AAE3E;AACA;AACA;AACA,SACCC,kBAAkB,EAClBC,uBAAuB,QACjB,gCAAgC;AACvC,SAASC,eAAe,QAAQ,6BAA6B;AAC7D,SAASC,aAAa,QAAQ,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEzC,MAAMC,4BAA4B,GAAGhB,0BAA0B,CAC5DiB,SAAS,IAAQC,KAAK,IAAM;EAC7B,IAAIC,QAAQ,GAAGd,oBAAoB,CAAEa,KAAM,CAAC;EAC5C,MAAME,eAAe,GAAGd,kBAAkB,CAAC,CAAC;EAC5C,MAAMe,oBAAoB,GAAGd,uBAAuB,CAAC,CAAC;EACtD,MAAMe,mBAAmB,GAAGF,eAAe,EAAEG,MAAM,GAAG,CAAC;EACvD,MAAMC,SAAS,GAAGN,KAAK,CAACO,IAAI;EAC5B,MAAMC,QAAQ,GAAGR,KAAK,CAACQ,QAAQ;EAC/B,MAAMC,uBAAuB,GAAG1B,SAAS,CACtC2B,MAAM,IAAM;IACb;IACA;IACA,OAAOA,MAAM,CAAE7B,gBAAiB,CAAC,CAAC8B,kBAAkB,CACnDL,SAAS,EACT,EACD,CAAC;EACF,CAAC,EACD,CAAEA,SAAS,CACZ,CAAC;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oC,QAAA,gBACCtC,IAAA,CAACM,SAAS;MAAA,GAAiBC;IAAK,GAAjB,MAAqB,CAAC,EACnCI,mBAAmB,IAAIK,uBAAuB,iBAC/ChB,IAAA,CAACd,aAAa;MAAAoD,QAAA,eACbtC,IAAA,CAACP,gBAAgB;QAChB8C,WAAW,EAAG9B,eAAe,CAAC+B,GAAG,CAC9Bb,cAAc,KAAQ;UACvBC,EAAE,EAAED,cAAc,CAACC,EAAE;UACrBd,IAAI,EAAEa,cAAc,CAACc,MAAM,CAACC,KAAK;UACjCC,WAAW,EACVhB,cAAc,CAACc,MAAM,CAACE;QACxB,CAAC,CACF,CAAG;QACHC,mBAAmB,EAAGlC,oBAAoB,EAAEkB,EAAI;QAChDiB,QAAQ,EAAGtB;MAAe,CAC1B;IAAC,CACY,CACf;EAAA,CACA,CAAC;AAEL,CAAC,EACD,8BACD,CAAC;AAED/B,SAAS,CACR,kBAAkB,EAClB,mCAAmC,EACnCa,4BACD,CAAC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/filters/move-to-sidebar.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\nimport { MoveToWidgetArea, getWidgetIdFromBlock } from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseSidebarControls,\n\tuseActiveSidebarControl,\n} from '../components/sidebar-controls';\nimport { useFocusControl } from '../components/focus-control';\nimport { blockToWidget } from '../utils';\n\nconst withMoveToSidebarToolbarItem = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tlet widgetId = getWidgetIdFromBlock( props );\n\t\tconst sidebarControls = useSidebarControls();\n\t\tconst activeSidebarControl = useActiveSidebarControl();\n\t\tconst hasMultipleSidebars = sidebarControls?.length > 1;\n\t\tconst blockName = props.name;\n\t\tconst clientId = props.clientId;\n\t\tconst canInsertBlockInSidebar = useSelect(\n\t\t\t( select ) => {\n\t\t\t\t// Use an empty string to represent the root block list, which\n\t\t\t\t// in the customizer editor represents a sidebar/widget area.\n\t\t\t\treturn select( blockEditorStore ).canInsertBlockType(\n\t\t\t\t\tblockName,\n\t\t\t\t\t''\n\t\t\t\t);\n\t\t\t},\n\t\t\t[ blockName ]\n\t\t);\n\t\tconst block = useSelect(\n\t\t\t( select ) => select( blockEditorStore ).getBlock( clientId ),\n\t\t\t[ clientId ]\n\t\t);\n\t\tconst { removeBlock } = useDispatch( blockEditorStore );\n\t\tconst [ , focusWidget ] = useFocusControl();\n\n\t\tfunction moveToSidebar( sidebarControlId ) {\n\t\t\tconst newSidebarControl = sidebarControls.find(\n\t\t\t\t( sidebarControl ) => sidebarControl.id === sidebarControlId\n\t\t\t);\n\n\t\t\tif ( widgetId ) {\n\t\t\t\t/**\n\t\t\t\t * If there's a widgetId, move it to the other sidebar.\n\t\t\t\t */\n\t\t\t\tconst oldSetting = activeSidebarControl.setting;\n\t\t\t\tconst newSetting = newSidebarControl.setting;\n\n\t\t\t\toldSetting( oldSetting().filter( ( id ) => id !== widgetId ) );\n\t\t\t\tnewSetting( [ ...newSetting(), widgetId ] );\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If there isn't a widgetId, it's most likely a inner block.\n\t\t\t\t * First, remove the block in the original sidebar,\n\t\t\t\t * then, create a new widget in the new sidebar and get back its widgetId.\n\t\t\t\t */\n\t\t\t\tconst sidebarAdapter = newSidebarControl.sidebarAdapter;\n\n\t\t\t\tremoveBlock( clientId );\n\t\t\t\tconst addedWidgetIds = sidebarAdapter.setWidgets( [\n\t\t\t\t\t...sidebarAdapter.getWidgets(),\n\t\t\t\t\tblockToWidget( block ),\n\t\t\t\t] );\n\t\t\t\t// The last non-null id is the added widget's id.\n\t\t\t\twidgetId = addedWidgetIds.reverse().find( ( id ) => !! id );\n\t\t\t}\n\n\t\t\t// Move focus to the moved widget and expand the sidebar.\n\t\t\tfocusWidget( widgetId );\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit 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": "AAoFG,mBACC,KADD;AAjFH;AAAA,EACC;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,kCAAkC;AAC3C,SAAS,WAAW,mBAAmB;AACvC,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB,4BAA4B;AAKvD;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAE9B,MAAM,+BAA+B;AAAA,EACpC,CAAE,cAAe,CAAE,UAAW;AAC7B,QAAI,WAAW,qBAAsB,KAAM;AAC3C,UAAM,kBAAkB,mBAAmB;AAC3C,UAAM,uBAAuB,wBAAwB;AACrD,UAAM,sBAAsB,iBAAiB,SAAS;AACtD,U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AO;AAAA,YACxB;AAAA,UACD;AAAA,UACA,qBAAsB,sBAAsB;AAAA,UAC5C,UAAW;AAAA;AAAA,MACZ,GACD;AAAA,OAEF;AAAA,EAEF;AAAA,EACA;AACD;AAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
6
+ "names": []
7
+ }
@@ -1,8 +1,9 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { addFilter } from '@wordpress/hooks';
5
- import { MediaUpload } from '@wordpress/media-utils';
1
+ import { addFilter } from "@wordpress/hooks";
2
+ import { MediaUpload } from "@wordpress/media-utils";
6
3
  const replaceMediaUpload = () => MediaUpload;
7
- addFilter('editor.MediaUpload', 'core/edit-widgets/replace-media-upload', replaceMediaUpload);
8
- //# sourceMappingURL=replace-media-upload.js.map
4
+ addFilter(
5
+ "editor.MediaUpload",
6
+ "core/edit-widgets/replace-media-upload",
7
+ replaceMediaUpload
8
+ );
9
+ //# sourceMappingURL=replace-media-upload.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["addFilter","MediaUpload","replaceMediaUpload"],"sources":["@wordpress/customize-widgets/src/filters/replace-media-upload.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { 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":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,WAAW,QAAQ,wBAAwB;AAEpD,MAAMC,kBAAkB,GAAGA,CAAA,KAAMD,WAAW;AAE5CD,SAAS,CACR,oBAAoB,EACpB,wCAAwC,EACxCE,kBACD,CAAC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/filters/replace-media-upload.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { 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": "AAGA,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAE5B,MAAM,qBAAqB,MAAM;AAEjC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
6
+ "names": []
7
+ }