@wordpress/preferences 4.33.1 → 4.34.1-next.2f1c7c01b.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 (135) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +10 -10
  3. package/build/components/index.js +3 -0
  4. package/build/components/index.js.map +2 -2
  5. package/build/components/preference-base-option/index.js +11 -2
  6. package/build/components/preference-base-option/index.js.map +3 -3
  7. package/build/components/preference-base-option/types.js +19 -0
  8. package/build/components/preference-base-option/types.js.map +7 -0
  9. package/build/components/preference-toggle-control/index.js +6 -3
  10. package/build/components/preference-toggle-control/index.js.map +3 -3
  11. package/build/components/preference-toggle-menu-item/index.js +5 -2
  12. package/build/components/preference-toggle-menu-item/index.js.map +3 -3
  13. package/build/components/preferences-modal/index.js +8 -2
  14. package/build/components/preferences-modal/index.js.map +3 -3
  15. package/build/components/preferences-modal/types.js +19 -0
  16. package/build/components/preferences-modal/types.js.map +7 -0
  17. package/build/components/preferences-modal-section/index.js +4 -1
  18. package/build/components/preferences-modal-section/index.js.map +3 -3
  19. package/build/components/preferences-modal-tabs/index.js +30 -21
  20. package/build/components/preferences-modal-tabs/index.js.map +3 -3
  21. package/build/index.js +3 -0
  22. package/build/index.js.map +2 -2
  23. package/build/lock-unlock.js +4 -1
  24. package/build/lock-unlock.js.map +2 -2
  25. package/build/private-apis.js +4 -1
  26. package/build/private-apis.js.map +2 -2
  27. package/build/store/actions.js +3 -0
  28. package/build/store/actions.js.map +3 -3
  29. package/build/store/constants.js +4 -1
  30. package/build/store/constants.js.map +3 -3
  31. package/build/store/index.js +4 -1
  32. package/build/store/index.js.map +3 -3
  33. package/build/store/reducer.js +4 -1
  34. package/build/store/reducer.js.map +3 -3
  35. package/build/store/selectors.js +10 -5
  36. package/build/store/selectors.js.map +3 -3
  37. package/build/store/types.js +19 -0
  38. package/build/store/types.js.map +7 -0
  39. package/build-module/components/index.js +1 -0
  40. package/build-module/components/index.js.map +2 -2
  41. package/build-module/components/preference-base-option/index.js +9 -2
  42. package/build-module/components/preference-base-option/index.js.map +3 -3
  43. package/build-module/components/preference-base-option/types.js +1 -0
  44. package/build-module/components/preference-base-option/types.js.map +7 -0
  45. package/build-module/components/preference-toggle-control/index.js +4 -3
  46. package/build-module/components/preference-toggle-control/index.js.map +3 -3
  47. package/build-module/components/preference-toggle-menu-item/index.js +3 -2
  48. package/build-module/components/preference-toggle-menu-item/index.js.map +3 -3
  49. package/build-module/components/preferences-modal/index.js +6 -2
  50. package/build-module/components/preferences-modal/index.js.map +3 -3
  51. package/build-module/components/preferences-modal/types.js +1 -0
  52. package/build-module/components/preferences-modal/types.js.map +7 -0
  53. package/build-module/components/preferences-modal-section/index.js +2 -1
  54. package/build-module/components/preferences-modal-section/index.js.map +3 -3
  55. package/build-module/components/preferences-modal-tabs/index.js +28 -21
  56. package/build-module/components/preferences-modal-tabs/index.js.map +3 -3
  57. package/build-module/index.js +1 -0
  58. package/build-module/index.js.map +2 -2
  59. package/build-module/lock-unlock.js +2 -1
  60. package/build-module/lock-unlock.js.map +2 -2
  61. package/build-module/private-apis.js +2 -1
  62. package/build-module/private-apis.js.map +2 -2
  63. package/build-module/store/actions.js +1 -0
  64. package/build-module/store/actions.js.map +3 -3
  65. package/build-module/store/constants.js +2 -1
  66. package/build-module/store/constants.js.map +3 -3
  67. package/build-module/store/index.js +2 -1
  68. package/build-module/store/index.js.map +3 -3
  69. package/build-module/store/reducer.js +2 -1
  70. package/build-module/store/reducer.js.map +3 -3
  71. package/build-module/store/selectors.js +8 -5
  72. package/build-module/store/selectors.js.map +3 -3
  73. package/build-module/store/types.js +1 -0
  74. package/build-module/store/types.js.map +7 -0
  75. package/build-types/components/index.d.ts +2 -0
  76. package/build-types/components/index.d.ts.map +1 -0
  77. package/build-types/components/preference-base-option/index.d.ts +7 -0
  78. package/build-types/components/preference-base-option/index.d.ts.map +1 -0
  79. package/build-types/components/preference-base-option/types.d.ts +11 -0
  80. package/build-types/components/preference-base-option/types.d.ts.map +1 -0
  81. package/build-types/components/preference-toggle-control/index.d.ts +9 -0
  82. package/build-types/components/preference-toggle-control/index.d.ts.map +1 -0
  83. package/build-types/components/preference-toggle-menu-item/index.d.ts +18 -0
  84. package/build-types/components/preference-toggle-menu-item/index.d.ts.map +1 -0
  85. package/build-types/components/preferences-modal/index.d.ts +6 -0
  86. package/build-types/components/preferences-modal/index.d.ts.map +1 -0
  87. package/build-types/components/preferences-modal/types.d.ts +11 -0
  88. package/build-types/components/preferences-modal/types.d.ts.map +1 -0
  89. package/build-types/components/preferences-modal-section/index.d.ts +8 -0
  90. package/build-types/components/preferences-modal-section/index.d.ts.map +1 -0
  91. package/build-types/components/preferences-modal-tabs/index.d.ts +9 -0
  92. package/build-types/components/preferences-modal-tabs/index.d.ts.map +1 -0
  93. package/build-types/index.d.ts +4 -0
  94. package/build-types/index.d.ts.map +1 -0
  95. package/build-types/lock-unlock.d.ts +2 -0
  96. package/build-types/lock-unlock.d.ts.map +1 -0
  97. package/build-types/private-apis.d.ts +2 -0
  98. package/build-types/private-apis.d.ts.map +1 -0
  99. package/build-types/store/actions.d.ts +69 -0
  100. package/build-types/store/actions.d.ts.map +1 -0
  101. package/build-types/store/constants.d.ts +5 -0
  102. package/build-types/store/constants.d.ts.map +1 -0
  103. package/build-types/store/index.d.ts +10 -0
  104. package/build-types/store/index.d.ts.map +1 -0
  105. package/build-types/store/reducer.d.ts +39 -0
  106. package/build-types/store/reducer.d.ts.map +1 -0
  107. package/build-types/store/selectors.d.ts +16 -0
  108. package/build-types/store/selectors.d.ts.map +1 -0
  109. package/build-types/store/types.d.ts +27 -0
  110. package/build-types/store/types.d.ts.map +1 -0
  111. package/package.json +16 -12
  112. package/src/components/preference-base-option/{index.js → index.tsx} +11 -1
  113. package/src/components/preference-base-option/types.ts +10 -0
  114. package/src/components/preference-toggle-control/{index.js → index.tsx} +9 -2
  115. package/src/components/preference-toggle-menu-item/{index.js → index.tsx} +14 -2
  116. package/src/components/preferences-modal/{index.js → index.tsx} +8 -1
  117. package/src/components/preferences-modal/types.ts +11 -0
  118. package/src/components/preferences-modal-section/{index.js → index.tsx} +7 -1
  119. package/src/components/preferences-modal-tabs/{index.js → index.tsx} +13 -3
  120. package/src/store/{actions.js → actions.ts} +48 -18
  121. package/src/store/{constants.js → constants.ts} +0 -2
  122. package/src/store/{index.js → index.ts} +6 -3
  123. package/src/store/{reducer.js → reducer.ts} +23 -10
  124. package/src/store/selectors.ts +67 -0
  125. package/src/store/types.ts +29 -0
  126. package/tsconfig.json +16 -0
  127. package/tsconfig.tsbuildinfo +1 -0
  128. package/src/store/selectors.js +0 -57
  129. /package/src/components/{index.js → index.ts} +0 -0
  130. /package/src/{index.js → index.ts} +0 -0
  131. /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
  132. /package/src/{private-apis.js → private-apis.ts} +0 -0
  133. /package/src/store/test/{actions.js → actions.ts} +0 -0
  134. /package/src/store/test/{reducer.js → reducer.ts} +0 -0
  135. /package/src/store/test/{selectors.js → selectors.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 4.34.0 (2025-10-29)
6
+
7
+ ### Internal
8
+
9
+ - TypeScript conversion
10
+
5
11
  ## 4.33.0 (2025-10-17)
6
12
 
7
13
  ## 4.32.0 (2025-10-01)
package/README.md CHANGED
@@ -165,7 +165,7 @@ function MyEditorMenu() {
165
165
 
166
166
  The following set of dispatching action creators are available on the object returned by `wp.data.dispatch( 'core/preferences' )`:
167
167
 
168
- <!-- START TOKEN(Autogenerated actions|src/store/actions.js) -->
168
+ <!-- START TOKEN(Autogenerated actions|src/store/actions.ts) -->
169
169
 
170
170
  #### set
171
171
 
@@ -179,7 +179,7 @@ _Parameters_
179
179
 
180
180
  _Returns_
181
181
 
182
- - `Object`: Action object.
182
+ - `SetAction`: Action object.
183
183
 
184
184
  #### setDefaults
185
185
 
@@ -188,11 +188,11 @@ Returns an action object used in signalling that preference defaults should be s
188
188
  _Parameters_
189
189
 
190
190
  - _scope_ `string`: The preference scope (e.g. core/edit-post).
191
- - _defaults_ `Object<string, *>`: A key/value map of preference names to values.
191
+ - _defaults_ `ScopedDefaults`: A key/value map of preference names to values.
192
192
 
193
193
  _Returns_
194
194
 
195
- - `Object`: Action object.
195
+ - `SetDefaultsAction`: Action object.
196
196
 
197
197
  #### setPersistenceLayer
198
198
 
@@ -207,11 +207,11 @@ When a persistence layer is set, the preferences store will:
207
207
 
208
208
  _Parameters_
209
209
 
210
- - _persistenceLayer_ `WPPreferencesPersistenceLayer`: The persistence layer.
210
+ - _persistenceLayer_ `WPPreferencesPersistenceLayer< D >`: The persistence layer.
211
211
 
212
212
  _Returns_
213
213
 
214
- - `Object`: Action object.
214
+ - `Promise< SetPersistenceLayerAction< D > >`: Action object.
215
215
 
216
216
  #### toggle
217
217
 
@@ -222,13 +222,13 @@ _Parameters_
222
222
  - _scope_ `string`: The preference scope (e.g. core/edit-post).
223
223
  - _name_ `string`: The preference name.
224
224
 
225
- <!-- END TOKEN(Autogenerated actions|src/store/actions.js) -->
225
+ <!-- END TOKEN(Autogenerated actions|src/store/actions.ts) -->
226
226
 
227
227
  ### Selectors
228
228
 
229
229
  The following selectors are available on the object returned by `wp.data.select( 'core/preferences' )`:
230
230
 
231
- <!-- START TOKEN(Autogenerated selectors|src/store/selectors.js) -->
231
+ <!-- START TOKEN(Autogenerated selectors|src/store/selectors.ts) -->
232
232
 
233
233
  #### get
234
234
 
@@ -236,7 +236,7 @@ Returns a boolean indicating whether a prefer is active for a particular scope.
236
236
 
237
237
  _Parameters_
238
238
 
239
- - _state_ `Object`: The store state.
239
+ - _state_ `StoreState`: The store state.
240
240
  - _scope_ `string`: The scope of the feature (e.g. core/edit-post).
241
241
  - _name_ `string`: The name of the feature.
242
242
 
@@ -244,7 +244,7 @@ _Returns_
244
244
 
245
245
  - `*`: Is the feature enabled?
246
246
 
247
- <!-- END TOKEN(Autogenerated selectors|src/store/selectors.js) -->
247
+ <!-- END TOKEN(Autogenerated selectors|src/store/selectors.ts) -->
248
248
 
249
249
  ## Contributing to this package
250
250
 
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -25,6 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
26
  mod
26
27
  ));
27
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // packages/preferences/src/components/index.ts
28
31
  var components_exports = {};
29
32
  __export(components_exports, {
30
33
  PreferenceToggleMenuItem: () => import_preference_toggle_menu_item.default
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/components/index.js"],
3
+ "sources": ["../../src/components/index.ts"],
4
4
  "sourcesContent": ["export { default as PreferenceToggleMenuItem } from './preference-toggle-menu-item';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yCAAoD;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yCAAoD;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -15,14 +16,22 @@ var __copyProps = (to, from, except, desc) => {
15
16
  return to;
16
17
  };
17
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/preferences/src/components/preference-base-option/index.tsx
18
21
  var preference_base_option_exports = {};
19
22
  __export(preference_base_option_exports, {
20
23
  default: () => preference_base_option_default
21
24
  });
22
25
  module.exports = __toCommonJS(preference_base_option_exports);
23
- var import_jsx_runtime = require("react/jsx-runtime");
24
26
  var import_components = require("@wordpress/components");
25
- function BaseOption({ help, label, isChecked, onChange, children }) {
27
+ var import_jsx_runtime = require("react/jsx-runtime");
28
+ function BaseOption({
29
+ help,
30
+ label,
31
+ isChecked,
32
+ onChange,
33
+ children
34
+ }) {
26
35
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "preference-base-option", children: [
27
36
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
28
37
  import_components.ToggleControl,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/components/preference-base-option/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { ToggleControl } from '@wordpress/components';\n\nfunction BaseOption( { help, label, isChecked, onChange, children } ) {\n\treturn (\n\t\t<div className=\"preference-base-option\">\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\thelp={ help }\n\t\t\t\tlabel={ label }\n\t\t\t\tchecked={ isChecked }\n\t\t\t\tonChange={ onChange }\n\t\t\t/>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default BaseOption;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOE;AAJF,wBAA8B;AAE9B,SAAS,WAAY,EAAE,MAAM,OAAO,WAAW,UAAU,SAAS,GAAI;AACrE,SACC,6CAAC,SAAI,WAAU,0BACd;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,yBAAuB;AAAA,QACvB;AAAA,QACA;AAAA,QACA,SAAU;AAAA,QACV;AAAA;AAAA,IACD;AAAA,IACE;AAAA,KACH;AAEF;AAEA,IAAO,iCAAQ;",
3
+ "sources": ["../../../src/components/preference-base-option/index.tsx"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { ToggleControl } from '@wordpress/components';\n/**\n * Internal dependencies\n */\nimport type { BaseOptionProps } from './types';\n\nfunction BaseOption( {\n\thelp,\n\tlabel,\n\tisChecked,\n\tonChange,\n\tchildren,\n}: BaseOptionProps ) {\n\treturn (\n\t\t<div className=\"preference-base-option\">\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\thelp={ help }\n\t\t\t\tlabel={ label }\n\t\t\t\tchecked={ isChecked }\n\t\t\t\tonChange={ onChange }\n\t\t\t/>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default BaseOption;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAA8B;AAc5B;AARF,SAAS,WAAY;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAqB;AACpB,SACC,6CAAC,SAAI,WAAU,0BACd;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,yBAAuB;AAAA,QACvB;AAAA,QACA;AAAA,QACA,SAAU;AAAA,QACV;AAAA;AAAA,IACD;AAAA,IACE;AAAA,KACH;AAEF;AAEA,IAAO,iCAAQ;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // packages/preferences/src/components/preference-base-option/types.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
19
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/preference-base-option/types.ts"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport type { ToggleControl } from '@wordpress/components';\n\ntype ToggleControlProps = Parameters< typeof ToggleControl >[ 0 ];\nexport type BaseOptionProps = Pick<\n\tToggleControlProps,\n\t'help' | 'label' | 'onChange'\n> & { isChecked?: ToggleControlProps[ 'checked' ]; children?: React.ReactNode };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -25,15 +26,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
26
  mod
26
27
  ));
27
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // packages/preferences/src/components/preference-toggle-control/index.tsx
28
31
  var preference_toggle_control_exports = {};
29
32
  __export(preference_toggle_control_exports, {
30
33
  default: () => preference_toggle_control_default
31
34
  });
32
35
  module.exports = __toCommonJS(preference_toggle_control_exports);
33
- var import_jsx_runtime = require("react/jsx-runtime");
34
36
  var import_data = require("@wordpress/data");
35
37
  var import_store = require("../../store");
36
38
  var import_preference_base_option = __toESM(require("../preference-base-option"));
39
+ var import_jsx_runtime = require("react/jsx-runtime");
37
40
  function PreferenceToggleControl(props) {
38
41
  const {
39
42
  scope,
@@ -54,9 +57,9 @@ function PreferenceToggleControl(props) {
54
57
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
55
58
  import_preference_base_option.default,
56
59
  {
60
+ ...remainingProps,
57
61
  onChange,
58
- isChecked,
59
- ...remainingProps
62
+ isChecked
60
63
  }
61
64
  );
62
65
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/components/preference-toggle-control/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as preferencesStore } from '../../store';\nimport PreferenceBaseOption from '../preference-base-option';\n\nfunction PreferenceToggleControl( props ) {\n\tconst {\n\t\tscope,\n\t\tfeatureName,\n\t\tonToggle = () => {},\n\t\t...remainingProps\n\t} = props;\n\tconst isChecked = useSelect(\n\t\t( select ) => !! select( preferencesStore ).get( scope, featureName ),\n\t\t[ scope, featureName ]\n\t);\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst onChange = () => {\n\t\tonToggle();\n\t\ttoggle( scope, featureName );\n\t};\n\n\treturn (\n\t\t<PreferenceBaseOption\n\t\t\tonChange={ onChange }\n\t\t\tisChecked={ isChecked }\n\t\t\t{ ...remainingProps }\n\t\t/>\n\t);\n}\n\nexport default PreferenceToggleControl;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BE;AA1BF,kBAAuC;AAKvC,mBAA0C;AAC1C,oCAAiC;AAEjC,SAAS,wBAAyB,OAAQ;AACzC,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA,WAAW,MAAM;AAAA,IAAC;AAAA,IAClB,GAAG;AAAA,EACJ,IAAI;AACJ,QAAM,gBAAY;AAAA,IACjB,CAAE,WAAY,CAAC,CAAE,OAAQ,aAAAA,KAAiB,EAAE,IAAK,OAAO,WAAY;AAAA,IACpE,CAAE,OAAO,WAAY;AAAA,EACtB;AACA,QAAM,EAAE,OAAO,QAAI,yBAAa,aAAAA,KAAiB;AACjD,QAAM,WAAW,MAAM;AACtB,aAAS;AACT,WAAQ,OAAO,WAAY;AAAA,EAC5B;AAEA,SACC;AAAA,IAAC,8BAAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA;AAAA,MACE,GAAG;AAAA;AAAA,EACN;AAEF;AAEA,IAAO,oCAAQ;",
3
+ "sources": ["../../../src/components/preference-toggle-control/index.tsx"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as preferencesStore } from '../../store';\nimport type { BaseOptionProps } from '../preference-base-option/types';\nimport PreferenceBaseOption from '../preference-base-option';\n\nexport type PreferenceToggleControlProps = {\n\tscope: string;\n\tfeatureName: string;\n\tonToggle: () => void;\n} & Omit< BaseOptionProps, 'onChange' | 'isChecked' >;\n\nfunction PreferenceToggleControl( props: PreferenceToggleControlProps ) {\n\tconst {\n\t\tscope,\n\t\tfeatureName,\n\t\tonToggle = () => {},\n\t\t...remainingProps\n\t} = props;\n\tconst isChecked = useSelect(\n\t\t( select ) => !! select( preferencesStore ).get( scope, featureName ),\n\t\t[ scope, featureName ]\n\t);\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst onChange = () => {\n\t\tonToggle();\n\t\ttoggle( scope, featureName );\n\t};\n\n\treturn (\n\t\t<PreferenceBaseOption\n\t\t\t{ ...remainingProps }\n\t\t\tonChange={ onChange }\n\t\t\tisChecked={ isChecked }\n\t\t/>\n\t);\n}\n\nexport default PreferenceToggleControl;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuC;AAKvC,mBAA0C;AAE1C,oCAAiC;AA0B/B;AAlBF,SAAS,wBAAyB,OAAsC;AACvE,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA,WAAW,MAAM;AAAA,IAAC;AAAA,IAClB,GAAG;AAAA,EACJ,IAAI;AACJ,QAAM,gBAAY;AAAA,IACjB,CAAE,WAAY,CAAC,CAAE,OAAQ,aAAAA,KAAiB,EAAE,IAAK,OAAO,WAAY;AAAA,IACpE,CAAE,OAAO,WAAY;AAAA,EACtB;AACA,QAAM,EAAE,OAAO,QAAI,yBAAa,aAAAA,KAAiB;AACjD,QAAM,WAAW,MAAM;AACtB,aAAS;AACT,WAAQ,OAAO,WAAY;AAAA,EAC5B;AAEA,SACC;AAAA,IAAC,8BAAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACL;AAAA,MACA;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,oCAAQ;",
6
6
  "names": ["preferencesStore", "PreferenceBaseOption"]
7
7
  }
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -15,18 +16,20 @@ var __copyProps = (to, from, except, desc) => {
15
16
  return to;
16
17
  };
17
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/preferences/src/components/preference-toggle-menu-item/index.tsx
18
21
  var preference_toggle_menu_item_exports = {};
19
22
  __export(preference_toggle_menu_item_exports, {
20
23
  default: () => PreferenceToggleMenuItem
21
24
  });
22
25
  module.exports = __toCommonJS(preference_toggle_menu_item_exports);
23
- var import_jsx_runtime = require("react/jsx-runtime");
24
26
  var import_data = require("@wordpress/data");
25
27
  var import_components = require("@wordpress/components");
26
28
  var import_i18n = require("@wordpress/i18n");
27
29
  var import_icons = require("@wordpress/icons");
28
30
  var import_a11y = require("@wordpress/a11y");
29
31
  var import_store = require("../../store");
32
+ var import_jsx_runtime = require("react/jsx-runtime");
30
33
  function PreferenceToggleMenuItem({
31
34
  scope,
32
35
  name,
@@ -64,7 +67,7 @@ function PreferenceToggleMenuItem({
64
67
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
65
68
  import_components.MenuItem,
66
69
  {
67
- icon: isActive && import_icons.check,
70
+ icon: isActive ? import_icons.check : null,
68
71
  isSelected: isActive,
69
72
  onClick: () => {
70
73
  onToggle();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/components/preference-toggle-menu-item/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { MenuItem } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { store as preferencesStore } from '../../store';\n\nexport default function PreferenceToggleMenuItem( {\n\tscope,\n\tname,\n\tlabel,\n\tinfo,\n\tmessageActivated,\n\tmessageDeactivated,\n\tshortcut,\n\thandleToggling = true,\n\tonToggle = () => null,\n\tdisabled = false,\n} ) {\n\tconst isActive = useSelect(\n\t\t( select ) => !! select( preferencesStore ).get( scope, name ),\n\t\t[ scope, name ]\n\t);\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst speakMessage = () => {\n\t\tif ( isActive ) {\n\t\t\tconst message =\n\t\t\t\tmessageDeactivated ||\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: preference name, e.g. 'Fullscreen mode' */\n\t\t\t\t\t__( 'Preference deactivated - %s' ),\n\t\t\t\t\tlabel\n\t\t\t\t);\n\t\t\tspeak( message );\n\t\t} else {\n\t\t\tconst message =\n\t\t\t\tmessageActivated ||\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: preference name, e.g. 'Fullscreen mode' */\n\t\t\t\t\t__( 'Preference activated - %s' ),\n\t\t\t\t\tlabel\n\t\t\t\t);\n\t\t\tspeak( message );\n\t\t}\n\t};\n\n\treturn (\n\t\t<MenuItem\n\t\t\ticon={ isActive && check }\n\t\t\tisSelected={ isActive }\n\t\t\tonClick={ () => {\n\t\t\t\tonToggle();\n\t\t\t\tif ( handleToggling ) {\n\t\t\t\t\ttoggle( scope, name );\n\t\t\t\t}\n\t\t\t\tspeakMessage();\n\t\t\t} }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tinfo={ info }\n\t\t\tshortcut={ shortcut }\n\t\t\tdisabled={ disabled }\n\t\t>\n\t\t\t{ label }\n\t\t</MenuItem>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsDE;AAnDF,kBAAuC;AACvC,wBAAyB;AACzB,kBAA4B;AAC5B,mBAAsB;AACtB,kBAAsB;AAKtB,mBAA0C;AAE3B,SAAR,yBAA2C;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,WAAW,MAAM;AAAA,EACjB,WAAW;AACZ,GAAI;AACH,QAAM,eAAW;AAAA,IAChB,CAAE,WAAY,CAAC,CAAE,OAAQ,aAAAA,KAAiB,EAAE,IAAK,OAAO,IAAK;AAAA,IAC7D,CAAE,OAAO,IAAK;AAAA,EACf;AACA,QAAM,EAAE,OAAO,QAAI,yBAAa,aAAAA,KAAiB;AACjD,QAAM,eAAe,MAAM;AAC1B,QAAK,UAAW;AACf,YAAM,UACL,0BACA;AAAA;AAAA,YAEC,gBAAI,6BAA8B;AAAA,QAClC;AAAA,MACD;AACD,6BAAO,OAAQ;AAAA,IAChB,OAAO;AACN,YAAM,UACL,wBACA;AAAA;AAAA,YAEC,gBAAI,2BAA4B;AAAA,QAChC;AAAA,MACD;AACD,6BAAO,OAAQ;AAAA,IAChB;AAAA,EACD;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAO,YAAY;AAAA,MACnB,YAAa;AAAA,MACb,SAAU,MAAM;AACf,iBAAS;AACT,YAAK,gBAAiB;AACrB,iBAAQ,OAAO,IAAK;AAAA,QACrB;AACA,qBAAa;AAAA,MACd;AAAA,MACA,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MAEE;AAAA;AAAA,EACH;AAEF;",
3
+ "sources": ["../../../src/components/preference-toggle-menu-item/index.tsx"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { MenuItem } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { store as preferencesStore } from '../../store';\n\ntype PreferenceToggleMenuItemProps = {\n\tscope: string;\n\tname: string;\n\tlabel: string;\n\tinfo?: string;\n\tmessageActivated?: string;\n\tmessageDeactivated?: string;\n\tshortcut?: string | { display: string; ariaLabel: string };\n\thandleToggling?: boolean;\n\tonToggle?: () => void;\n\tdisabled?: boolean;\n};\nexport default function PreferenceToggleMenuItem( {\n\tscope,\n\tname,\n\tlabel,\n\tinfo,\n\tmessageActivated,\n\tmessageDeactivated,\n\tshortcut,\n\thandleToggling = true,\n\tonToggle = () => null,\n\tdisabled = false,\n}: PreferenceToggleMenuItemProps ) {\n\tconst isActive = useSelect(\n\t\t( select ) => !! select( preferencesStore ).get( scope, name ),\n\t\t[ scope, name ]\n\t);\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst speakMessage = () => {\n\t\tif ( isActive ) {\n\t\t\tconst message =\n\t\t\t\tmessageDeactivated ||\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: preference name, e.g. 'Fullscreen mode' */\n\t\t\t\t\t__( 'Preference deactivated - %s' ),\n\t\t\t\t\tlabel\n\t\t\t\t);\n\t\t\tspeak( message );\n\t\t} else {\n\t\t\tconst message =\n\t\t\t\tmessageActivated ||\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: preference name, e.g. 'Fullscreen mode' */\n\t\t\t\t\t__( 'Preference activated - %s' ),\n\t\t\t\t\tlabel\n\t\t\t\t);\n\t\t\tspeak( message );\n\t\t}\n\t};\n\n\treturn (\n\t\t<MenuItem\n\t\t\ticon={ isActive ? check : null }\n\t\t\tisSelected={ isActive }\n\t\t\tonClick={ () => {\n\t\t\t\tonToggle();\n\t\t\t\tif ( handleToggling ) {\n\t\t\t\t\ttoggle( scope, name );\n\t\t\t\t}\n\t\t\t\tspeakMessage();\n\t\t\t} }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tinfo={ info }\n\t\t\tshortcut={ shortcut }\n\t\t\tdisabled={ disabled }\n\t\t>\n\t\t\t{ label }\n\t\t</MenuItem>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuC;AACvC,wBAAyB;AACzB,kBAA4B;AAC5B,mBAAsB;AACtB,kBAAsB;AAKtB,mBAA0C;AAsDxC;AAxCa,SAAR,yBAA2C;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,WAAW,MAAM;AAAA,EACjB,WAAW;AACZ,GAAmC;AAClC,QAAM,eAAW;AAAA,IAChB,CAAE,WAAY,CAAC,CAAE,OAAQ,aAAAA,KAAiB,EAAE,IAAK,OAAO,IAAK;AAAA,IAC7D,CAAE,OAAO,IAAK;AAAA,EACf;AACA,QAAM,EAAE,OAAO,QAAI,yBAAa,aAAAA,KAAiB;AACjD,QAAM,eAAe,MAAM;AAC1B,QAAK,UAAW;AACf,YAAM,UACL,0BACA;AAAA;AAAA,YAEC,gBAAI,6BAA8B;AAAA,QAClC;AAAA,MACD;AACD,6BAAO,OAAQ;AAAA,IAChB,OAAO;AACN,YAAM,UACL,wBACA;AAAA;AAAA,YAEC,gBAAI,2BAA4B;AAAA,QAChC;AAAA,MACD;AACD,6BAAO,OAAQ;AAAA,IAChB;AAAA,EACD;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAO,WAAW,qBAAQ;AAAA,MAC1B,YAAa;AAAA,MACb,SAAU,MAAM;AACf,iBAAS;AACT,YAAK,gBAAiB;AACrB,iBAAQ,OAAO,IAAK;AAAA,QACrB;AACA,qBAAa;AAAA,MACd;AAAA,MACA,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MAEE;AAAA;AAAA,EACH;AAEF;",
6
6
  "names": ["preferencesStore"]
7
7
  }
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -15,15 +16,20 @@ var __copyProps = (to, from, except, desc) => {
15
16
  return to;
16
17
  };
17
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/preferences/src/components/preferences-modal/index.tsx
18
21
  var preferences_modal_exports = {};
19
22
  __export(preferences_modal_exports, {
20
23
  default: () => PreferencesModal
21
24
  });
22
25
  module.exports = __toCommonJS(preferences_modal_exports);
23
- var import_jsx_runtime = require("react/jsx-runtime");
24
26
  var import_components = require("@wordpress/components");
25
27
  var import_i18n = require("@wordpress/i18n");
26
- function PreferencesModal({ closeModal, children }) {
28
+ var import_jsx_runtime = require("react/jsx-runtime");
29
+ function PreferencesModal({
30
+ closeModal,
31
+ children
32
+ }) {
27
33
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
28
34
  import_components.Modal,
29
35
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/components/preferences-modal/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport default function PreferencesModal( { closeModal, children } ) {\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"preferences-modal\"\n\t\t\ttitle={ __( 'Preferences' ) }\n\t\t\tonRequestClose={ closeModal }\n\t\t>\n\t\t\t{ children }\n\t\t</Modal>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQE;AALF,wBAAsB;AACtB,kBAAmB;AAEJ,SAAR,iBAAmC,EAAE,YAAY,SAAS,GAAI;AACpE,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,WAAQ,gBAAI,aAAc;AAAA,MAC1B,gBAAiB;AAAA,MAEf;AAAA;AAAA,EACH;AAEF;",
3
+ "sources": ["../../../src/components/preferences-modal/index.tsx"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n/**\n * Internal dependencies\n */\nimport type { PreferencesModalProps } from './types';\n\nexport default function PreferencesModal( {\n\tcloseModal,\n\tchildren,\n}: PreferencesModalProps ) {\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"preferences-modal\"\n\t\t\ttitle={ __( 'Preferences' ) }\n\t\t\tonRequestClose={ closeModal }\n\t\t>\n\t\t\t{ children }\n\t\t</Modal>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAsB;AACtB,kBAAmB;AAWjB;AALa,SAAR,iBAAmC;AAAA,EACzC;AAAA,EACA;AACD,GAA2B;AAC1B,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,WAAQ,gBAAI,aAAc;AAAA,MAC1B,gBAAiB;AAAA,MAEf;AAAA;AAAA,EACH;AAEF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // packages/preferences/src/components/preferences-modal/types.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
19
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/preferences-modal/types.ts"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport type { Modal } from '@wordpress/components';\n\ntype ModalProps = Parameters< typeof Modal >[ 0 ];\n\nexport type PreferencesModalProps = {\n\tcloseModal: ModalProps[ 'onRequestClose' ];\n\tchildren: React.ReactNode;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -15,13 +16,15 @@ var __copyProps = (to, from, except, desc) => {
15
16
  return to;
16
17
  };
17
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/preferences/src/components/preferences-modal-section/index.tsx
18
21
  var preferences_modal_section_exports = {};
19
22
  __export(preferences_modal_section_exports, {
20
23
  default: () => preferences_modal_section_default
21
24
  });
22
25
  module.exports = __toCommonJS(preferences_modal_section_exports);
23
26
  var import_jsx_runtime = require("react/jsx-runtime");
24
- const Section = ({ description, title, children }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("fieldset", { className: "preferences-modal__section", children: [
27
+ var Section = ({ description, title, children }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("fieldset", { className: "preferences-modal__section", children: [
25
28
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("legend", { className: "preferences-modal__section-legend", children: [
26
29
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "preferences-modal__section-title", children: title }),
27
30
  description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "preferences-modal__section-description", children: description })
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/components/preferences-modal-section/index.js"],
4
- "sourcesContent": ["const Section = ( { description, title, children } ) => (\n\t<fieldset className=\"preferences-modal__section\">\n\t\t<legend className=\"preferences-modal__section-legend\">\n\t\t\t<h2 className=\"preferences-modal__section-title\">{ title }</h2>\n\t\t\t{ description && (\n\t\t\t\t<p className=\"preferences-modal__section-description\">\n\t\t\t\t\t{ description }\n\t\t\t\t</p>\n\t\t\t) }\n\t\t</legend>\n\t\t<div className=\"preferences-modal__section-content\">{ children }</div>\n\t</fieldset>\n);\n\nexport default Section;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEE;AAFF,MAAM,UAAU,CAAE,EAAE,aAAa,OAAO,SAAS,MAChD,6CAAC,cAAS,WAAU,8BACnB;AAAA,+CAAC,YAAO,WAAU,qCACjB;AAAA,gDAAC,QAAG,WAAU,oCAAqC,iBAAO;AAAA,IACxD,eACD,4CAAC,OAAE,WAAU,0CACV,uBACH;AAAA,KAEF;AAAA,EACA,4CAAC,SAAI,WAAU,sCAAuC,UAAU;AAAA,GACjE;AAGD,IAAO,oCAAQ;",
3
+ "sources": ["../../../src/components/preferences-modal-section/index.tsx"],
4
+ "sourcesContent": ["export type SectionProps = {\n\tdescription?: React.ReactNode;\n\ttitle?: React.ReactNode;\n\tchildren?: React.ReactNode;\n};\n\nconst Section = ( { description, title, children }: SectionProps ) => (\n\t<fieldset className=\"preferences-modal__section\">\n\t\t<legend className=\"preferences-modal__section-legend\">\n\t\t\t<h2 className=\"preferences-modal__section-title\">{ title }</h2>\n\t\t\t{ description && (\n\t\t\t\t<p className=\"preferences-modal__section-description\">\n\t\t\t\t\t{ description }\n\t\t\t\t</p>\n\t\t\t) }\n\t\t</legend>\n\t\t<div className=\"preferences-modal__section-content\">{ children }</div>\n\t</fieldset>\n);\n\nexport default Section;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQE;AAFF,IAAM,UAAU,CAAE,EAAE,aAAa,OAAO,SAAS,MAChD,6CAAC,cAAS,WAAU,8BACnB;AAAA,+CAAC,YAAO,WAAU,qCACjB;AAAA,gDAAC,QAAG,WAAU,oCAAqC,iBAAO;AAAA,IACxD,eACD,4CAAC,OAAE,WAAU,0CACV,uBACH;AAAA,KAEF;AAAA,EACA,4CAAC,SAAI,WAAU,sCAAuC,UAAU;AAAA,GACjE;AAGD,IAAO,oCAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -15,21 +16,25 @@ var __copyProps = (to, from, except, desc) => {
15
16
  return to;
16
17
  };
17
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/preferences/src/components/preferences-modal-tabs/index.tsx
18
21
  var preferences_modal_tabs_exports = {};
19
22
  __export(preferences_modal_tabs_exports, {
20
23
  default: () => PreferencesModalTabs
21
24
  });
22
25
  module.exports = __toCommonJS(preferences_modal_tabs_exports);
23
- var import_jsx_runtime = require("react/jsx-runtime");
24
26
  var import_compose = require("@wordpress/compose");
25
27
  var import_components = require("@wordpress/components");
26
28
  var import_element = require("@wordpress/element");
27
29
  var import_icons = require("@wordpress/icons");
28
30
  var import_i18n = require("@wordpress/i18n");
29
31
  var import_lock_unlock = require("../../lock-unlock");
30
- const { Tabs } = (0, import_lock_unlock.unlock)(import_components.privateApis);
31
- const PREFERENCES_MENU = "preferences-menu";
32
- function PreferencesModalTabs({ sections }) {
32
+ var import_jsx_runtime = require("react/jsx-runtime");
33
+ var { Tabs } = (0, import_lock_unlock.unlock)(import_components.privateApis);
34
+ var PREFERENCES_MENU = "preferences-menu";
35
+ function PreferencesModalTabs({
36
+ sections
37
+ }) {
33
38
  const isLargeViewport = (0, import_compose.useViewportMatch)("medium");
34
39
  const [activeMenu, setActiveMenu] = (0, import_element.useState)(PREFERENCES_MENU);
35
40
  const { tabs, sectionsContentMap } = (0, import_element.useMemo)(() => {
@@ -83,23 +88,26 @@ function PreferencesModalTabs({ sections }) {
83
88
  } else {
84
89
  modalContent = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.Navigator, { initialPath: "/", className: "preferences__provider", children: [
85
90
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Navigator.Screen, { path: "/", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Card, { isBorderless: true, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalItemGroup, { children: tabs.map((tab) => {
86
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
87
- import_components.Navigator.Button,
88
- {
89
- path: `/${tab.name}`,
90
- as: import_components.__experimentalItem,
91
- isAction: true,
92
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "space-between", children: [
93
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalTruncate, { children: tab.title }) }),
94
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
95
- import_icons.Icon,
96
- {
97
- icon: (0, import_i18n.isRTL)() ? import_icons.chevronLeft : import_icons.chevronRight
98
- }
99
- ) })
100
- ] })
101
- },
102
- tab.name
91
+ return (
92
+ // @ts-expect-error: Navigator.Button is currently typed in a way that prevents Item from being passed in
93
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
94
+ import_components.Navigator.Button,
95
+ {
96
+ path: `/${tab.name}`,
97
+ as: import_components.__experimentalItem,
98
+ isAction: true,
99
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "space-between", children: [
100
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalTruncate, { children: tab.title }) }),
101
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
102
+ import_icons.Icon,
103
+ {
104
+ icon: (0, import_i18n.isRTL)() ? import_icons.chevronLeft : import_icons.chevronRight
105
+ }
106
+ ) })
107
+ ] })
108
+ },
109
+ tab.name
110
+ )
103
111
  );
104
112
  }) }) }) }) }),
105
113
  sections.length && sections.map((section) => {
@@ -115,6 +123,7 @@ function PreferencesModalTabs({ sections }) {
115
123
  justify: "left",
116
124
  size: "small",
117
125
  gap: "6",
126
+ as: "div",
118
127
  children: [
119
128
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
120
129
  import_components.Navigator.BackButton,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/components/preferences-modal-tabs/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tNavigator,\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n\t__experimentalTruncate as Truncate,\n\tFlexItem,\n\tCard,\n\tCardHeader,\n\tCardBody,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useMemo, useState } from '@wordpress/element';\nimport { chevronLeft, chevronRight, Icon } from '@wordpress/icons';\nimport { isRTL, __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst PREFERENCES_MENU = 'preferences-menu';\n\nexport default function PreferencesModalTabs( { sections } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\t// This is also used to sync the two different rendered components\n\t// between small and large viewports.\n\tconst [ activeMenu, setActiveMenu ] = useState( PREFERENCES_MENU );\n\t/**\n\t * Create helper objects from `sections` for easier data handling.\n\t * `tabs` is used for creating the `Tabs` and `sectionsContentMap`\n\t * is used for easier access to active tab's content.\n\t */\n\tconst { tabs, sectionsContentMap } = useMemo( () => {\n\t\tlet mappedTabs = {\n\t\t\ttabs: [],\n\t\t\tsectionsContentMap: {},\n\t\t};\n\t\tif ( sections.length ) {\n\t\t\tmappedTabs = sections.reduce(\n\t\t\t\t( accumulator, { name, tabLabel: title, content } ) => {\n\t\t\t\t\taccumulator.tabs.push( { name, title } );\n\t\t\t\t\taccumulator.sectionsContentMap[ name ] = content;\n\t\t\t\t\treturn accumulator;\n\t\t\t\t},\n\t\t\t\t{ tabs: [], sectionsContentMap: {} }\n\t\t\t);\n\t\t}\n\t\treturn mappedTabs;\n\t}, [ sections ] );\n\n\tlet modalContent;\n\t// We render different components based on the viewport size.\n\tif ( isLargeViewport ) {\n\t\tmodalContent = (\n\t\t\t<div className=\"preferences__tabs\">\n\t\t\t\t<Tabs\n\t\t\t\t\tdefaultTabId={\n\t\t\t\t\t\tactiveMenu !== PREFERENCES_MENU ? activeMenu : undefined\n\t\t\t\t\t}\n\t\t\t\t\tonSelect={ setActiveMenu }\n\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t>\n\t\t\t\t\t<Tabs.TabList className=\"preferences__tabs-tablist\">\n\t\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\t\ttabId={ tab.name }\n\t\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\t\tclassName=\"preferences__tabs-tab\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</Tabs.TabList>\n\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\t\t\ttabId={ tab.name }\n\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\tclassName=\"preferences__tabs-tabpanel\"\n\t\t\t\t\t\t\tfocusable={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sectionsContentMap[ tab.name ] || null }\n\t\t\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t\t) ) }\n\t\t\t\t</Tabs>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tmodalContent = (\n\t\t\t<Navigator initialPath=\"/\" className=\"preferences__provider\">\n\t\t\t\t<Navigator.Screen path=\"/\">\n\t\t\t\t\t<Card isBorderless size=\"small\">\n\t\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => {\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<Navigator.Button\n\t\t\t\t\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\t\t\t\t\tpath={ `/${ tab.name }` }\n\t\t\t\t\t\t\t\t\t\t\tas={ Item }\n\t\t\t\t\t\t\t\t\t\t\tisAction\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Truncate>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisRTL()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? chevronLeft\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: chevronRight\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t\t\t</Navigator.Button>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t</CardBody>\n\t\t\t\t\t</Card>\n\t\t\t\t</Navigator.Screen>\n\t\t\t\t{ sections.length &&\n\t\t\t\t\tsections.map( ( section ) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Navigator.Screen\n\t\t\t\t\t\t\t\tkey={ `${ section.name }-menu` }\n\t\t\t\t\t\t\t\tpath={ `/${ section.name }` }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Card isBorderless size=\"large\">\n\t\t\t\t\t\t\t\t\t<CardHeader\n\t\t\t\t\t\t\t\t\t\tisBorderless={ false }\n\t\t\t\t\t\t\t\t\t\tjustify=\"left\"\n\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\tgap=\"6\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Navigator.BackButton\n\t\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t\tisRTL()\n\t\t\t\t\t\t\t\t\t\t\t\t\t? chevronRight\n\t\t\t\t\t\t\t\t\t\t\t\t\t: chevronLeft\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<Text size=\"16\">\n\t\t\t\t\t\t\t\t\t\t\t{ section.tabLabel }\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t</CardHeader>\n\t\t\t\t\t\t\t\t\t<CardBody>{ section.content }</CardBody>\n\t\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t\t</Navigator.Screen>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t</Navigator>\n\t\t);\n\t}\n\n\treturn modalContent;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgEI;AA7DJ,qBAAiC;AACjC,wBAYO;AACP,qBAAkC;AAClC,mBAAgD;AAChD,kBAA0B;AAK1B,yBAAuB;AAEvB,MAAM,EAAE,KAAK,QAAI,2BAAQ,kBAAAA,WAAsB;AAE/C,MAAM,mBAAmB;AAEV,SAAR,qBAAuC,EAAE,SAAS,GAAI;AAC5D,QAAM,sBAAkB,iCAAkB,QAAS;AAInD,QAAM,CAAE,YAAY,aAAc,QAAI,yBAAU,gBAAiB;AAMjE,QAAM,EAAE,MAAM,mBAAmB,QAAI,wBAAS,MAAM;AACnD,QAAI,aAAa;AAAA,MAChB,MAAM,CAAC;AAAA,MACP,oBAAoB,CAAC;AAAA,IACtB;AACA,QAAK,SAAS,QAAS;AACtB,mBAAa,SAAS;AAAA,QACrB,CAAE,aAAa,EAAE,MAAM,UAAU,OAAO,QAAQ,MAAO;AACtD,sBAAY,KAAK,KAAM,EAAE,MAAM,MAAM,CAAE;AACvC,sBAAY,mBAAoB,IAAK,IAAI;AACzC,iBAAO;AAAA,QACR;AAAA,QACA,EAAE,MAAM,CAAC,GAAG,oBAAoB,CAAC,EAAE;AAAA,MACpC;AAAA,IACD;AACA,WAAO;AAAA,EACR,GAAG,CAAE,QAAS,CAAE;AAEhB,MAAI;AAEJ,MAAK,iBAAkB;AACtB,mBACC,4CAAC,SAAI,WAAU,qBACd;AAAA,MAAC;AAAA;AAAA,QACA,cACC,eAAe,mBAAmB,aAAa;AAAA,QAEhD,UAAW;AAAA,QACX,aAAY;AAAA,QAEZ;AAAA,sDAAC,KAAK,SAAL,EAAa,WAAU,6BACrB,eAAK,IAAK,CAAE,QACb;AAAA,YAAC,KAAK;AAAA,YAAL;AAAA,cACA,OAAQ,IAAI;AAAA,cAEZ,WAAU;AAAA,cAER,cAAI;AAAA;AAAA,YAHA,IAAI;AAAA,UAIX,CACC,GACH;AAAA,UACE,KAAK,IAAK,CAAE,QACb;AAAA,YAAC,KAAK;AAAA,YAAL;AAAA,cACA,OAAQ,IAAI;AAAA,cAEZ,WAAU;AAAA,cACV,WAAY;AAAA,cAEV,6BAAoB,IAAI,IAAK,KAAK;AAAA;AAAA,YAJ9B,IAAI;AAAA,UAKX,CACC;AAAA;AAAA;AAAA,IACH,GACD;AAAA,EAEF,OAAO;AACN,mBACC,6CAAC,+BAAU,aAAY,KAAI,WAAU,yBACpC;AAAA,kDAAC,4BAAU,QAAV,EAAiB,MAAK,KACtB,sDAAC,0BAAK,cAAY,MAAC,MAAK,SACvB,sDAAC,8BACA,sDAAC,kBAAAC,yBAAA,EACE,eAAK,IAAK,CAAE,QAAS;AACtB,eACC;AAAA,UAAC,4BAAU;AAAA,UAAV;AAAA,YAEA,MAAO,IAAK,IAAI,IAAK;AAAA,YACrB,IAAK,kBAAAC;AAAA,YACL,UAAQ;AAAA,YAER,uDAAC,kBAAAC,sBAAA,EAAO,SAAQ,iBACf;AAAA,0DAAC,8BACA,sDAAC,kBAAAC,wBAAA,EACE,cAAI,OACP,GACD;AAAA,cACA,4CAAC,8BACA;AAAA,gBAAC;AAAA;AAAA,kBACA,UACC,mBAAM,IACH,2BACA;AAAA;AAAA,cAEL,GACD;AAAA,eACD;AAAA;AAAA,UApBM,IAAI;AAAA,QAqBX;AAAA,MAEF,CAAE,GACH,GACD,GACD,GACD;AAAA,MACE,SAAS,UACV,SAAS,IAAK,CAAE,YAAa;AAC5B,eACC;AAAA,UAAC,4BAAU;AAAA,UAAV;AAAA,YAEA,MAAO,IAAK,QAAQ,IAAK;AAAA,YAEzB,uDAAC,0BAAK,cAAY,MAAC,MAAK,SACvB;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACA,cAAe;AAAA,kBACf,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,KAAI;AAAA,kBAEJ;AAAA;AAAA,sBAAC,4BAAU;AAAA,sBAAV;AAAA,wBACA,UACC,mBAAM,IACH,4BACA;AAAA,wBAEJ,WAAQ,gBAAI,MAAO;AAAA;AAAA,oBACpB;AAAA,oBACA,4CAAC,kBAAAC,oBAAA,EAAK,MAAK,MACR,kBAAQ,UACX;AAAA;AAAA;AAAA,cACD;AAAA,cACA,4CAAC,8BAAW,kBAAQ,SAAS;AAAA,eAC9B;AAAA;AAAA,UAvBM,GAAI,QAAQ,IAAK;AAAA,QAwBxB;AAAA,MAEF,CAAE;AAAA,OACJ;AAAA,EAEF;AAEA,SAAO;AACR;",
3
+ "sources": ["../../../src/components/preferences-modal-tabs/index.tsx"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tNavigator,\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n\t__experimentalTruncate as Truncate,\n\tFlexItem,\n\tCard,\n\tCardHeader,\n\tCardBody,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useMemo, useState } from '@wordpress/element';\nimport { chevronLeft, chevronRight, Icon } from '@wordpress/icons';\nimport { isRTL, __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst PREFERENCES_MENU = 'preferences-menu';\n\nexport type PreferencesModalTabsProps = {\n\tsections: { name: string; tabLabel: string; content: React.ReactNode }[];\n};\nexport default function PreferencesModalTabs( {\n\tsections,\n}: PreferencesModalTabsProps ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\t// This is also used to sync the two different rendered components\n\t// between small and large viewports.\n\tconst [ activeMenu, setActiveMenu ] = useState( PREFERENCES_MENU );\n\t/**\n\t * Create helper objects from `sections` for easier data handling.\n\t * `tabs` is used for creating the `Tabs` and `sectionsContentMap`\n\t * is used for easier access to active tab's content.\n\t */\n\tconst { tabs, sectionsContentMap } = useMemo( () => {\n\t\tlet mappedTabs: {\n\t\t\ttabs: { name: string; title: string }[];\n\t\t\tsectionsContentMap: Record< string, React.ReactNode >;\n\t\t} = {\n\t\t\ttabs: [],\n\t\t\tsectionsContentMap: {},\n\t\t};\n\t\tif ( sections.length ) {\n\t\t\tmappedTabs = sections.reduce< typeof mappedTabs >(\n\t\t\t\t( accumulator, { name, tabLabel: title, content } ) => {\n\t\t\t\t\taccumulator.tabs.push( { name, title } );\n\t\t\t\t\taccumulator.sectionsContentMap[ name ] = content;\n\t\t\t\t\treturn accumulator;\n\t\t\t\t},\n\t\t\t\t{ tabs: [], sectionsContentMap: {} }\n\t\t\t);\n\t\t}\n\t\treturn mappedTabs;\n\t}, [ sections ] );\n\n\tlet modalContent;\n\t// We render different components based on the viewport size.\n\tif ( isLargeViewport ) {\n\t\tmodalContent = (\n\t\t\t<div className=\"preferences__tabs\">\n\t\t\t\t<Tabs\n\t\t\t\t\tdefaultTabId={\n\t\t\t\t\t\tactiveMenu !== PREFERENCES_MENU ? activeMenu : undefined\n\t\t\t\t\t}\n\t\t\t\t\tonSelect={ setActiveMenu }\n\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t>\n\t\t\t\t\t<Tabs.TabList className=\"preferences__tabs-tablist\">\n\t\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\t\ttabId={ tab.name }\n\t\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\t\tclassName=\"preferences__tabs-tab\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</Tabs.TabList>\n\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\t\t\ttabId={ tab.name }\n\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\tclassName=\"preferences__tabs-tabpanel\"\n\t\t\t\t\t\t\tfocusable={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sectionsContentMap[ tab.name ] || null }\n\t\t\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t\t) ) }\n\t\t\t\t</Tabs>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tmodalContent = (\n\t\t\t<Navigator initialPath=\"/\" className=\"preferences__provider\">\n\t\t\t\t<Navigator.Screen path=\"/\">\n\t\t\t\t\t<Card isBorderless size=\"small\">\n\t\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => {\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t// @ts-expect-error: Navigator.Button is currently typed in a way that prevents Item from being passed in\n\t\t\t\t\t\t\t\t\t\t<Navigator.Button\n\t\t\t\t\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\t\t\t\t\tpath={ `/${ tab.name }` }\n\t\t\t\t\t\t\t\t\t\t\tas={ Item }\n\t\t\t\t\t\t\t\t\t\t\tisAction\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Truncate>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisRTL()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? chevronLeft\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: chevronRight\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t\t\t</Navigator.Button>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t</CardBody>\n\t\t\t\t\t</Card>\n\t\t\t\t</Navigator.Screen>\n\t\t\t\t{ sections.length &&\n\t\t\t\t\tsections.map( ( section ) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Navigator.Screen\n\t\t\t\t\t\t\t\tkey={ `${ section.name }-menu` }\n\t\t\t\t\t\t\t\tpath={ `/${ section.name }` }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Card isBorderless size=\"large\">\n\t\t\t\t\t\t\t\t\t<CardHeader\n\t\t\t\t\t\t\t\t\t\tisBorderless={ false }\n\t\t\t\t\t\t\t\t\t\tjustify=\"left\"\n\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\tgap=\"6\"\n\t\t\t\t\t\t\t\t\t\tas=\"div\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Navigator.BackButton\n\t\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t\tisRTL()\n\t\t\t\t\t\t\t\t\t\t\t\t\t? chevronRight\n\t\t\t\t\t\t\t\t\t\t\t\t\t: chevronLeft\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<Text size=\"16\">\n\t\t\t\t\t\t\t\t\t\t\t{ section.tabLabel }\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t</CardHeader>\n\t\t\t\t\t\t\t\t\t<CardBody>{ section.content }</CardBody>\n\t\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t\t</Navigator.Screen>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t</Navigator>\n\t\t);\n\t}\n\n\treturn modalContent;\n}\n"],
5
+ "mappings": "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",
6
6
  "names": ["componentsPrivateApis", "ItemGroup", "Item", "HStack", "Truncate", "Text"]
7
7
  }
package/build/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -16,6 +17,8 @@ var __copyProps = (to, from, except, desc) => {
16
17
  };
17
18
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // packages/preferences/src/index.ts
19
22
  var index_exports = {};
20
23
  __export(index_exports, {
21
24
  store: () => import_store.store
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/index.js"],
3
+ "sources": ["../src/index.ts"],
4
4
  "sourcesContent": ["export * from './components';\nexport { store } from './store';\nexport * from './private-apis';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,yBAAd;AACA,mBAAsB;AACtB,0BAAc,2BAFd;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,yBAAd;AACA,mBAAsB;AACtB,0BAAc,2BAFd;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -15,6 +16,8 @@ var __copyProps = (to, from, except, desc) => {
15
16
  return to;
16
17
  };
17
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/preferences/src/lock-unlock.ts
18
21
  var lock_unlock_exports = {};
19
22
  __export(lock_unlock_exports, {
20
23
  lock: () => lock,
@@ -22,7 +25,7 @@ __export(lock_unlock_exports, {
22
25
  });
23
26
  module.exports = __toCommonJS(lock_unlock_exports);
24
27
  var import_private_apis = require("@wordpress/private-apis");
25
- const { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
28
+ var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
26
29
  "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
27
30
  "@wordpress/preferences"
28
31
  );
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/lock-unlock.js"],
3
+ "sources": ["../src/lock-unlock.ts"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/preferences'\n\t);\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAiE;AAC1D,MAAM,EAAE,MAAM,OAAO,QAC3B;AAAA,EACC;AAAA,EACA;AACD;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAiE;AAC1D,IAAM,EAAE,MAAM,OAAO,QAC3B;AAAA,EACC;AAAA,EACA;AACD;",
6
6
  "names": []
7
7
  }