@wordpress/patterns 2.32.0 → 2.32.1-next.47f435fc9.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 (105) hide show
  1. package/build/api/index.js +35 -29
  2. package/build/api/index.js.map +7 -1
  3. package/build/components/allow-overrides-modal.js +149 -112
  4. package/build/components/allow-overrides-modal.js.map +7 -1
  5. package/build/components/category-selector.js +59 -38
  6. package/build/components/category-selector.js.map +7 -1
  7. package/build/components/create-pattern-modal.js +162 -111
  8. package/build/components/create-pattern-modal.js.map +7 -1
  9. package/build/components/duplicate-pattern-modal.js +85 -66
  10. package/build/components/duplicate-pattern-modal.js.map +7 -1
  11. package/build/components/index.js +50 -33
  12. package/build/components/index.js.map +7 -1
  13. package/build/components/overrides-panel.js +44 -39
  14. package/build/components/overrides-panel.js.map +7 -1
  15. package/build/components/pattern-convert-button.js +144 -133
  16. package/build/components/pattern-convert-button.js.map +7 -1
  17. package/build/components/pattern-overrides-block-controls.js +109 -109
  18. package/build/components/pattern-overrides-block-controls.js.map +7 -1
  19. package/build/components/pattern-overrides-controls.js +86 -69
  20. package/build/components/pattern-overrides-controls.js.map +7 -1
  21. package/build/components/patterns-manage-button.js +96 -97
  22. package/build/components/patterns-manage-button.js.map +7 -1
  23. package/build/components/rename-pattern-category-modal.js +122 -111
  24. package/build/components/rename-pattern-category-modal.js.map +7 -1
  25. package/build/components/rename-pattern-modal.js +95 -73
  26. package/build/components/rename-pattern-modal.js.map +7 -1
  27. package/build/components/reset-overrides-control.js +61 -57
  28. package/build/components/reset-overrides-control.js.map +7 -1
  29. package/build/constants.js +57 -23
  30. package/build/constants.js.map +7 -1
  31. package/build/index.js +27 -24
  32. package/build/index.js.map +7 -1
  33. package/build/lock-unlock.js +31 -15
  34. package/build/lock-unlock.js.map +7 -1
  35. package/build/private-apis.js +71 -48
  36. package/build/private-apis.js.map +7 -1
  37. package/build/private-hooks.js +57 -69
  38. package/build/private-hooks.js.map +7 -1
  39. package/build/store/actions.js +72 -85
  40. package/build/store/actions.js.map +7 -1
  41. package/build/store/constants.js +27 -10
  42. package/build/store/constants.js.map +7 -1
  43. package/build/store/index.js +50 -44
  44. package/build/store/index.js.map +7 -1
  45. package/build/store/reducer.js +30 -14
  46. package/build/store/reducer.js.map +7 -1
  47. package/build/store/selectors.js +26 -13
  48. package/build/store/selectors.js.map +7 -1
  49. package/build-module/api/index.js +14 -25
  50. package/build-module/api/index.js.map +7 -1
  51. package/build-module/components/allow-overrides-modal.js +131 -103
  52. package/build-module/components/allow-overrides-modal.js.map +7 -1
  53. package/build-module/components/category-selector.js +35 -29
  54. package/build-module/components/category-selector.js.map +7 -1
  55. package/build-module/components/create-pattern-modal.js +137 -99
  56. package/build-module/components/create-pattern-modal.js.map +7 -1
  57. package/build-module/components/duplicate-pattern-modal.js +53 -58
  58. package/build-module/components/duplicate-pattern-modal.js.map +7 -1
  59. package/build-module/components/index.js +22 -26
  60. package/build-module/components/index.js.map +7 -1
  61. package/build-module/components/overrides-panel.js +30 -34
  62. package/build-module/components/overrides-panel.js.map +7 -1
  63. package/build-module/components/pattern-convert-button.js +120 -125
  64. package/build-module/components/pattern-convert-button.js.map +7 -1
  65. package/build-module/components/pattern-overrides-block-controls.js +100 -103
  66. package/build-module/components/pattern-overrides-block-controls.js.map +7 -1
  67. package/build-module/components/pattern-overrides-controls.js +69 -58
  68. package/build-module/components/pattern-overrides-controls.js.map +7 -1
  69. package/build-module/components/patterns-manage-button.js +78 -91
  70. package/build-module/components/patterns-manage-button.js.map +7 -1
  71. package/build-module/components/rename-pattern-category-modal.js +106 -101
  72. package/build-module/components/rename-pattern-category-modal.js.map +7 -1
  73. package/build-module/components/rename-pattern-modal.js +80 -64
  74. package/build-module/components/rename-pattern-modal.js.map +7 -1
  75. package/build-module/components/reset-overrides-control.js +46 -51
  76. package/build-module/components/reset-overrides-control.js.map +7 -1
  77. package/build-module/constants.js +29 -18
  78. package/build-module/constants.js.map +7 -1
  79. package/build-module/index.js +6 -6
  80. package/build-module/index.js.map +7 -1
  81. package/build-module/lock-unlock.js +8 -7
  82. package/build-module/lock-unlock.js.map +7 -1
  83. package/build-module/private-apis.js +31 -18
  84. package/build-module/private-apis.js.map +7 -1
  85. package/build-module/private-hooks.js +35 -64
  86. package/build-module/private-hooks.js.map +7 -1
  87. package/build-module/store/actions.js +44 -74
  88. package/build-module/store/actions.js.map +7 -1
  89. package/build-module/store/constants.js +5 -5
  90. package/build-module/store/constants.js.map +7 -1
  91. package/build-module/store/index.js +13 -32
  92. package/build-module/store/index.js.map +7 -1
  93. package/build-module/store/reducer.js +9 -8
  94. package/build-module/store/reducer.js.map +7 -1
  95. package/build-module/store/selectors.js +5 -9
  96. package/build-module/store/selectors.js.map +7 -1
  97. package/build-style/style-rtl.css +3 -138
  98. package/build-style/style.css +3 -138
  99. package/package.json +24 -17
  100. package/src/components/style.scss +5 -0
  101. package/src/style.scss +2 -1
  102. package/build/index.native.js +0 -18
  103. package/build/index.native.js.map +0 -1
  104. package/build-module/index.native.js +0 -11
  105. package/build-module/index.native.js.map +0 -1
@@ -1 +1,7 @@
1
- {"version":3,"names":["STORE_NAME","exports"],"sources":["@wordpress/patterns/src/store/constants.js"],"sourcesContent":["/**\n * Module Constants\n */\nexport const STORE_NAME = 'core/patterns';\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACO,MAAMA,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,eAAe","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/store/constants.js"],
4
+ "sourcesContent": ["/**\n * Module Constants\n */\nexport const STORE_NAME = 'core/patterns';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,aAAa;",
6
+ "names": []
7
+ }
@@ -1,48 +1,54 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var store_exports = {};
29
+ __export(store_exports, {
30
+ store: () => store,
31
+ storeConfig: () => storeConfig
6
32
  });
7
- exports.storeConfig = exports.store = void 0;
8
- var _data = require("@wordpress/data");
9
- var _reducer = _interopRequireDefault(require("./reducer"));
10
- var actions = _interopRequireWildcard(require("./actions"));
11
- var _constants = require("./constants");
12
- var selectors = _interopRequireWildcard(require("./selectors"));
13
- var _lockUnlock = require("../lock-unlock");
14
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
- /**
17
- * WordPress dependencies
18
- */
19
-
20
- /**
21
- * Internal dependencies
22
- */
23
-
24
- /**
25
- * Post editor data store configuration.
26
- *
27
- * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore
28
- *
29
- * @type {Object}
30
- */
31
- const storeConfig = exports.storeConfig = {
32
- reducer: _reducer.default
33
+ module.exports = __toCommonJS(store_exports);
34
+ var import_data = require("@wordpress/data");
35
+ var import_reducer = __toESM(require("./reducer"));
36
+ var actions = __toESM(require("./actions"));
37
+ var import_constants = require("./constants");
38
+ var selectors = __toESM(require("./selectors"));
39
+ var import_lock_unlock = require("../lock-unlock");
40
+ const storeConfig = {
41
+ reducer: import_reducer.default
33
42
  };
34
-
35
- /**
36
- * Store definition for the editor namespace.
37
- *
38
- * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
39
- *
40
- * @type {Object}
41
- */
42
- const store = exports.store = (0, _data.createReduxStore)(_constants.STORE_NAME, {
43
+ const store = (0, import_data.createReduxStore)(import_constants.STORE_NAME, {
43
44
  ...storeConfig
44
45
  });
45
- (0, _data.register)(store);
46
- (0, _lockUnlock.unlock)(store).registerPrivateActions(actions);
47
- (0, _lockUnlock.unlock)(store).registerPrivateSelectors(selectors);
48
- //# sourceMappingURL=index.js.map
46
+ (0, import_data.register)(store);
47
+ (0, import_lock_unlock.unlock)(store).registerPrivateActions(actions);
48
+ (0, import_lock_unlock.unlock)(store).registerPrivateSelectors(selectors);
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ store,
52
+ storeConfig
53
+ });
54
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_data","require","_reducer","_interopRequireDefault","actions","_interopRequireWildcard","_constants","selectors","_lockUnlock","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","storeConfig","exports","reducer","store","createReduxStore","STORE_NAME","register","unlock","registerPrivateActions","registerPrivateSelectors"],"sources":["@wordpress/patterns/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport { STORE_NAME } from './constants';\nimport * as selectors from './selectors';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Post editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore\n *\n * @type {Object}\n */\nexport const storeConfig = {\n\treducer,\n};\n\n/**\n * Store definition for the editor namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\t...storeConfig,\n} );\n\nregister( store );\nunlock( store ).registerPrivateActions( actions );\nunlock( store ).registerPrivateSelectors( selectors );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAF,uBAAA,CAAAJ,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAAwC,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAA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,sBAAgB,EAAEC,qBAAU,EAAE;EAClD,GAAGL;AACJ,CAAE,CAAC;AAEH,IAAAM,cAAQ,EAAEH,KAAM,CAAC;AACjB,IAAAI,kBAAM,EAAEJ,KAAM,CAAC,CAACK,sBAAsB,CAAEjC,OAAQ,CAAC;AACjD,IAAAgC,kBAAM,EAAEJ,KAAM,CAAC,CAACM,wBAAwB,CAAE/B,SAAU,CAAC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/store/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport { STORE_NAME } from './constants';\nimport * as selectors from './selectors';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Post editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore\n *\n * @type {Object}\n */\nexport const storeConfig = {\n\treducer,\n};\n\n/**\n * Store definition for the editor namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\t...storeConfig,\n} );\n\nregister( store );\nunlock( store ).registerPrivateActions( actions );\nunlock( store ).registerPrivateSelectors( selectors );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA2C;AAK3C,qBAAoB;AACpB,cAAyB;AACzB,uBAA2B;AAC3B,gBAA2B;AAC3B,yBAAuB;AAShB,MAAM,cAAc;AAAA,EAC1B,wBAAAA;AACD;AASO,MAAM,YAAQ,8BAAkB,6BAAY;AAAA,EAClD,GAAG;AACJ,CAAE;AAAA,IAEF,sBAAU,KAAM;AAAA,IAChB,2BAAQ,KAAM,EAAE,uBAAwB,OAAQ;AAAA,IAChD,2BAAQ,KAAM,EAAE,yBAA0B,SAAU;",
6
+ "names": ["reducer"]
7
+ }
@@ -1,17 +1,29 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var reducer_exports = {};
19
+ __export(reducer_exports, {
20
+ default: () => reducer_default,
21
+ isEditingPattern: () => isEditingPattern
5
22
  });
6
- exports.default = void 0;
7
- exports.isEditingPattern = isEditingPattern;
8
- var _data = require("@wordpress/data");
9
- /**
10
- * WordPress dependencies
11
- */
12
-
23
+ module.exports = __toCommonJS(reducer_exports);
24
+ var import_data = require("@wordpress/data");
13
25
  function isEditingPattern(state = {}, action) {
14
- if (action?.type === 'SET_EDITING_PATTERN') {
26
+ if (action?.type === "SET_EDITING_PATTERN") {
15
27
  return {
16
28
  ...state,
17
29
  [action.clientId]: action.isEditing
@@ -19,7 +31,11 @@ function isEditingPattern(state = {}, action) {
19
31
  }
20
32
  return state;
21
33
  }
22
- var _default = exports.default = (0, _data.combineReducers)({
34
+ var reducer_default = (0, import_data.combineReducers)({
35
+ isEditingPattern
36
+ });
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
23
39
  isEditingPattern
24
40
  });
25
- //# sourceMappingURL=reducer.js.map
41
+ //# sourceMappingURL=reducer.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_data","require","isEditingPattern","state","action","type","clientId","isEditing","_default","exports","default","combineReducers"],"sources":["@wordpress/patterns/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\nexport function isEditingPattern( state = {}, action ) {\n\tif ( action?.type === 'SET_EDITING_PATTERN' ) {\n\t\treturn {\n\t\t\t...state,\n\t\t\t[ action.clientId ]: action.isEditing,\n\t\t};\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tisEditingPattern,\n} );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,SAASC,gBAAgBA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EACtD,IAAKA,MAAM,EAAEC,IAAI,KAAK,qBAAqB,EAAG;IAC7C,OAAO;MACN,GAAGF,KAAK;MACR,CAAEC,MAAM,CAACE,QAAQ,GAAIF,MAAM,CAACG;IAC7B,CAAC;EACF;EAEA,OAAOJ,KAAK;AACb;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,qBAAe,EAAE;EAC/BT;AACD,CAAE,CAAC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/store/reducer.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\nexport function isEditingPattern( state = {}, action ) {\n\tif ( action?.type === 'SET_EDITING_PATTERN' ) {\n\t\treturn {\n\t\t\t...state,\n\t\t\t[ action.clientId ]: action.isEditing,\n\t\t};\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tisEditingPattern,\n} );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAgC;AAEzB,SAAS,iBAAkB,QAAQ,CAAC,GAAG,QAAS;AACtD,MAAK,QAAQ,SAAS,uBAAwB;AAC7C,WAAO;AAAA,MACN,GAAG;AAAA,MACH,CAAE,OAAO,QAAS,GAAG,OAAO;AAAA,IAC7B;AAAA,EACD;AAEA,SAAO;AACR;AAEA,IAAO,sBAAQ,6BAAiB;AAAA,EAC/B;AACD,CAAE;",
6
+ "names": []
7
+ }
@@ -1,17 +1,30 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var selectors_exports = {};
19
+ __export(selectors_exports, {
20
+ isEditingPattern: () => isEditingPattern
5
21
  });
6
- exports.isEditingPattern = isEditingPattern;
7
- /**
8
- * Returns true if pattern is in the editing state.
9
- *
10
- * @param {Object} state Global application state.
11
- * @param {number} clientId the clientID of the block.
12
- * @return {boolean} Whether the pattern is in the editing state.
13
- */
22
+ module.exports = __toCommonJS(selectors_exports);
14
23
  function isEditingPattern(state, clientId) {
15
24
  return state.isEditingPattern[clientId];
16
25
  }
17
- //# sourceMappingURL=selectors.js.map
26
+ // Annotate the CommonJS export names for ESM import in node:
27
+ 0 && (module.exports = {
28
+ isEditingPattern
29
+ });
30
+ //# sourceMappingURL=selectors.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["isEditingPattern","state","clientId"],"sources":["@wordpress/patterns/src/store/selectors.js"],"sourcesContent":["/**\n * Returns true if pattern is in the editing state.\n *\n * @param {Object} state Global application state.\n * @param {number} clientId the clientID of the block.\n * @return {boolean} Whether the pattern is in the editing state.\n */\nexport function isEditingPattern( state, clientId ) {\n\treturn state.isEditingPattern[ clientId ];\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gBAAgBA,CAAEC,KAAK,EAAEC,QAAQ,EAAG;EACnD,OAAOD,KAAK,CAACD,gBAAgB,CAAEE,QAAQ,CAAE;AAC1C","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/store/selectors.js"],
4
+ "sourcesContent": ["/**\n * Returns true if pattern is in the editing state.\n *\n * @param {Object} state Global application state.\n * @param {number} clientId the clientID of the block.\n * @return {boolean} Whether the pattern is in the editing state.\n */\nexport function isEditingPattern( state, clientId ) {\n\treturn state.isEditingPattern[ clientId ];\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,SAAS,iBAAkB,OAAO,UAAW;AACnD,SAAO,MAAM,iBAAkB,QAAS;AACzC;",
6
+ "names": []
7
+ }
@@ -1,32 +1,21 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { PARTIAL_SYNCING_SUPPORTED_BLOCKS } from '../constants';
5
-
6
- /**
7
- * Determines whether a block is overridable.
8
- *
9
- * @param {WPBlock} block The block to test.
10
- *
11
- * @return {boolean} `true` if a block is overridable, `false` otherwise.
12
- */
13
- export function isOverridableBlock(block) {
14
- return Object.keys(PARTIAL_SYNCING_SUPPORTED_BLOCKS).includes(block.name) && !!block.attributes.metadata?.name && !!block.attributes.metadata?.bindings && Object.values(block.attributes.metadata.bindings).some(binding => binding.source === 'core/pattern-overrides');
1
+ import { PARTIAL_SYNCING_SUPPORTED_BLOCKS } from "../constants";
2
+ function isOverridableBlock(block) {
3
+ return Object.keys(PARTIAL_SYNCING_SUPPORTED_BLOCKS).includes(
4
+ block.name
5
+ ) && !!block.attributes.metadata?.name && !!block.attributes.metadata?.bindings && Object.values(block.attributes.metadata.bindings).some(
6
+ (binding) => binding.source === "core/pattern-overrides"
7
+ );
15
8
  }
16
-
17
- /**
18
- * Determines whether the blocks list has overridable blocks.
19
- *
20
- * @param {WPBlock[]} blocks The blocks list.
21
- *
22
- * @return {boolean} `true` if the list has overridable blocks, `false` otherwise.
23
- */
24
- export function hasOverridableBlocks(blocks) {
25
- return blocks.some(block => {
9
+ function hasOverridableBlocks(blocks) {
10
+ return blocks.some((block) => {
26
11
  if (isOverridableBlock(block)) {
27
12
  return true;
28
13
  }
29
14
  return hasOverridableBlocks(block.innerBlocks);
30
15
  });
31
16
  }
32
- //# sourceMappingURL=index.js.map
17
+ export {
18
+ hasOverridableBlocks,
19
+ isOverridableBlock
20
+ };
21
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["PARTIAL_SYNCING_SUPPORTED_BLOCKS","isOverridableBlock","block","Object","keys","includes","name","attributes","metadata","bindings","values","some","binding","source","hasOverridableBlocks","blocks","innerBlocks"],"sources":["@wordpress/patterns/src/api/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { PARTIAL_SYNCING_SUPPORTED_BLOCKS } from '../constants';\n\n/**\n * Determines whether a block is overridable.\n *\n * @param {WPBlock} block The block to test.\n *\n * @return {boolean} `true` if a block is overridable, `false` otherwise.\n */\nexport function isOverridableBlock( block ) {\n\treturn (\n\t\tObject.keys( PARTIAL_SYNCING_SUPPORTED_BLOCKS ).includes(\n\t\t\tblock.name\n\t\t) &&\n\t\t!! block.attributes.metadata?.name &&\n\t\t!! block.attributes.metadata?.bindings &&\n\t\tObject.values( block.attributes.metadata.bindings ).some(\n\t\t\t( binding ) => binding.source === 'core/pattern-overrides'\n\t\t)\n\t);\n}\n\n/**\n * Determines whether the blocks list has overridable blocks.\n *\n * @param {WPBlock[]} blocks The blocks list.\n *\n * @return {boolean} `true` if the list has overridable blocks, `false` otherwise.\n */\nexport function hasOverridableBlocks( blocks ) {\n\treturn blocks.some( ( block ) => {\n\t\tif ( isOverridableBlock( block ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn hasOverridableBlocks( block.innerBlocks );\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gCAAgC,QAAQ,cAAc;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAAEC,KAAK,EAAG;EAC3C,OACCC,MAAM,CAACC,IAAI,CAAEJ,gCAAiC,CAAC,CAACK,QAAQ,CACvDH,KAAK,CAACI,IACP,CAAC,IACD,CAAC,CAAEJ,KAAK,CAACK,UAAU,CAACC,QAAQ,EAAEF,IAAI,IAClC,CAAC,CAAEJ,KAAK,CAACK,UAAU,CAACC,QAAQ,EAAEC,QAAQ,IACtCN,MAAM,CAACO,MAAM,CAAER,KAAK,CAACK,UAAU,CAACC,QAAQ,CAACC,QAAS,CAAC,CAACE,IAAI,CACrDC,OAAO,IAAMA,OAAO,CAACC,MAAM,KAAK,wBACnC,CAAC;AAEH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAAEC,MAAM,EAAG;EAC9C,OAAOA,MAAM,CAACJ,IAAI,CAAIT,KAAK,IAAM;IAChC,IAAKD,kBAAkB,CAAEC,KAAM,CAAC,EAAG;MAClC,OAAO,IAAI;IACZ;IACA,OAAOY,oBAAoB,CAAEZ,KAAK,CAACc,WAAY,CAAC;EACjD,CAAE,CAAC;AACJ","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/api/index.js"],
4
+ "sourcesContent": ["/**\n * Internal dependencies\n */\nimport { PARTIAL_SYNCING_SUPPORTED_BLOCKS } from '../constants';\n\n/**\n * Determines whether a block is overridable.\n *\n * @param {WPBlock} block The block to test.\n *\n * @return {boolean} `true` if a block is overridable, `false` otherwise.\n */\nexport function isOverridableBlock( block ) {\n\treturn (\n\t\tObject.keys( PARTIAL_SYNCING_SUPPORTED_BLOCKS ).includes(\n\t\t\tblock.name\n\t\t) &&\n\t\t!! block.attributes.metadata?.name &&\n\t\t!! block.attributes.metadata?.bindings &&\n\t\tObject.values( block.attributes.metadata.bindings ).some(\n\t\t\t( binding ) => binding.source === 'core/pattern-overrides'\n\t\t)\n\t);\n}\n\n/**\n * Determines whether the blocks list has overridable blocks.\n *\n * @param {WPBlock[]} blocks The blocks list.\n *\n * @return {boolean} `true` if the list has overridable blocks, `false` otherwise.\n */\nexport function hasOverridableBlocks( blocks ) {\n\treturn blocks.some( ( block ) => {\n\t\tif ( isOverridableBlock( block ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn hasOverridableBlocks( block.innerBlocks );\n\t} );\n}\n"],
5
+ "mappings": "AAGA,SAAS,wCAAwC;AAS1C,SAAS,mBAAoB,OAAQ;AAC3C,SACC,OAAO,KAAM,gCAAiC,EAAE;AAAA,IAC/C,MAAM;AAAA,EACP,KACA,CAAC,CAAE,MAAM,WAAW,UAAU,QAC9B,CAAC,CAAE,MAAM,WAAW,UAAU,YAC9B,OAAO,OAAQ,MAAM,WAAW,SAAS,QAAS,EAAE;AAAA,IACnD,CAAE,YAAa,QAAQ,WAAW;AAAA,EACnC;AAEF;AASO,SAAS,qBAAsB,QAAS;AAC9C,SAAO,OAAO,KAAM,CAAE,UAAW;AAChC,QAAK,mBAAoB,KAAM,GAAI;AAClC,aAAO;AAAA,IACR;AACA,WAAO,qBAAsB,MAAM,WAAY;AAAA,EAChD,CAAE;AACH;",
6
+ "names": []
7
+ }
@@ -1,14 +1,18 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { __experimentalHStack as HStack, __experimentalVStack as VStack, Button, __experimentalText as Text, TextControl, Modal } from '@wordpress/components';
5
- import { __, sprintf } from '@wordpress/i18n';
6
- import { useState, useId } from '@wordpress/element';
7
- import { speak } from '@wordpress/a11y';
8
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
- export function AllowOverridesModal({
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import {
3
+ __experimentalHStack as HStack,
4
+ __experimentalVStack as VStack,
5
+ Button,
6
+ __experimentalText as Text,
7
+ TextControl,
8
+ Modal
9
+ } from "@wordpress/components";
10
+ import { __, sprintf } from "@wordpress/i18n";
11
+ import { useState, useId } from "@wordpress/element";
12
+ import { speak } from "@wordpress/a11y";
13
+ function AllowOverridesModal({
10
14
  placeholder,
11
- initialName = '',
15
+ initialName = "",
12
16
  onClose,
13
17
  onSave
14
18
  }) {
@@ -17,104 +21,128 @@ export function AllowOverridesModal({
17
21
  const isNameValid = !!editedBlockName.trim();
18
22
  const handleSubmit = () => {
19
23
  if (editedBlockName !== initialName) {
20
- const message = sprintf(/* translators: %s: new name/label for the block */
21
- __('Block name changed to: "%s".'), editedBlockName);
22
-
23
- // Must be assertive to immediately announce change.
24
- speak(message, 'assertive');
24
+ const message = sprintf(
25
+ /* translators: %s: new name/label for the block */
26
+ __('Block name changed to: "%s".'),
27
+ editedBlockName
28
+ );
29
+ speak(message, "assertive");
25
30
  }
26
31
  onSave(editedBlockName);
27
-
28
- // Immediate close avoids ability to hit save multiple times.
29
32
  onClose();
30
33
  };
31
- return /*#__PURE__*/_jsx(Modal, {
32
- title: __('Enable overrides'),
33
- onRequestClose: onClose,
34
- focusOnMount: "firstContentElement",
35
- aria: {
36
- describedby: descriptionId
37
- },
38
- size: "small",
39
- children: /*#__PURE__*/_jsx("form", {
40
- onSubmit: event => {
41
- event.preventDefault();
42
- if (!isNameValid) {
43
- return;
34
+ return /* @__PURE__ */ jsx(
35
+ Modal,
36
+ {
37
+ title: __("Enable overrides"),
38
+ onRequestClose: onClose,
39
+ focusOnMount: "firstContentElement",
40
+ aria: { describedby: descriptionId },
41
+ size: "small",
42
+ children: /* @__PURE__ */ jsx(
43
+ "form",
44
+ {
45
+ onSubmit: (event) => {
46
+ event.preventDefault();
47
+ if (!isNameValid) {
48
+ return;
49
+ }
50
+ handleSubmit();
51
+ },
52
+ children: /* @__PURE__ */ jsxs(VStack, { spacing: "6", children: [
53
+ /* @__PURE__ */ jsx(Text, { id: descriptionId, children: __(
54
+ "Overrides are changes you make to a block within a synced pattern instance. Use overrides to customize a synced pattern instance to suit its new context. Name this block to specify an override."
55
+ ) }),
56
+ /* @__PURE__ */ jsx(
57
+ TextControl,
58
+ {
59
+ __nextHasNoMarginBottom: true,
60
+ __next40pxDefaultSize: true,
61
+ value: editedBlockName,
62
+ label: __("Name"),
63
+ help: __(
64
+ 'For example, if you are creating a recipe pattern, you use "Recipe Title", "Recipe Description", etc.'
65
+ ),
66
+ placeholder,
67
+ onChange: setEditedBlockName
68
+ }
69
+ ),
70
+ /* @__PURE__ */ jsxs(HStack, { justify: "right", children: [
71
+ /* @__PURE__ */ jsx(
72
+ Button,
73
+ {
74
+ __next40pxDefaultSize: true,
75
+ variant: "tertiary",
76
+ onClick: onClose,
77
+ children: __("Cancel")
78
+ }
79
+ ),
80
+ /* @__PURE__ */ jsx(
81
+ Button,
82
+ {
83
+ __next40pxDefaultSize: true,
84
+ "aria-disabled": !isNameValid,
85
+ variant: "primary",
86
+ type: "submit",
87
+ children: __("Enable")
88
+ }
89
+ )
90
+ ] })
91
+ ] })
44
92
  }
45
- handleSubmit();
46
- },
47
- children: /*#__PURE__*/_jsxs(VStack, {
48
- spacing: "6",
49
- children: [/*#__PURE__*/_jsx(Text, {
50
- id: descriptionId,
51
- children: __('Overrides are changes you make to a block within a synced pattern instance. Use overrides to customize a synced pattern instance to suit its new context. Name this block to specify an override.')
52
- }), /*#__PURE__*/_jsx(TextControl, {
53
- __nextHasNoMarginBottom: true,
54
- __next40pxDefaultSize: true,
55
- value: editedBlockName,
56
- label: __('Name'),
57
- help: __('For example, if you are creating a recipe pattern, you use "Recipe Title", "Recipe Description", etc.'),
58
- placeholder: placeholder,
59
- onChange: setEditedBlockName
60
- }), /*#__PURE__*/_jsxs(HStack, {
61
- justify: "right",
62
- children: [/*#__PURE__*/_jsx(Button, {
63
- __next40pxDefaultSize: true,
64
- variant: "tertiary",
65
- onClick: onClose,
66
- children: __('Cancel')
67
- }), /*#__PURE__*/_jsx(Button, {
68
- __next40pxDefaultSize: true,
69
- "aria-disabled": !isNameValid,
70
- variant: "primary",
71
- type: "submit",
72
- children: __('Enable')
73
- })]
74
- })]
75
- })
76
- })
77
- });
93
+ )
94
+ }
95
+ );
78
96
  }
79
- export function DisallowOverridesModal({
80
- onClose,
81
- onSave
82
- }) {
97
+ function DisallowOverridesModal({ onClose, onSave }) {
83
98
  const descriptionId = useId();
84
- return /*#__PURE__*/_jsx(Modal, {
85
- title: __('Disable overrides'),
86
- onRequestClose: onClose,
87
- aria: {
88
- describedby: descriptionId
89
- },
90
- size: "small",
91
- children: /*#__PURE__*/_jsx("form", {
92
- onSubmit: event => {
93
- event.preventDefault();
94
- onSave();
95
- onClose();
96
- },
97
- children: /*#__PURE__*/_jsxs(VStack, {
98
- spacing: "6",
99
- children: [/*#__PURE__*/_jsx(Text, {
100
- id: descriptionId,
101
- children: __('Are you sure you want to disable overrides? Disabling overrides will revert all applied overrides for this block throughout instances of this pattern.')
102
- }), /*#__PURE__*/_jsxs(HStack, {
103
- justify: "right",
104
- children: [/*#__PURE__*/_jsx(Button, {
105
- __next40pxDefaultSize: true,
106
- variant: "tertiary",
107
- onClick: onClose,
108
- children: __('Cancel')
109
- }), /*#__PURE__*/_jsx(Button, {
110
- __next40pxDefaultSize: true,
111
- variant: "primary",
112
- type: "submit",
113
- children: __('Disable')
114
- })]
115
- })]
116
- })
117
- })
118
- });
99
+ return /* @__PURE__ */ jsx(
100
+ Modal,
101
+ {
102
+ title: __("Disable overrides"),
103
+ onRequestClose: onClose,
104
+ aria: { describedby: descriptionId },
105
+ size: "small",
106
+ children: /* @__PURE__ */ jsx(
107
+ "form",
108
+ {
109
+ onSubmit: (event) => {
110
+ event.preventDefault();
111
+ onSave();
112
+ onClose();
113
+ },
114
+ children: /* @__PURE__ */ jsxs(VStack, { spacing: "6", children: [
115
+ /* @__PURE__ */ jsx(Text, { id: descriptionId, children: __(
116
+ "Are you sure you want to disable overrides? Disabling overrides will revert all applied overrides for this block throughout instances of this pattern."
117
+ ) }),
118
+ /* @__PURE__ */ jsxs(HStack, { justify: "right", children: [
119
+ /* @__PURE__ */ jsx(
120
+ Button,
121
+ {
122
+ __next40pxDefaultSize: true,
123
+ variant: "tertiary",
124
+ onClick: onClose,
125
+ children: __("Cancel")
126
+ }
127
+ ),
128
+ /* @__PURE__ */ jsx(
129
+ Button,
130
+ {
131
+ __next40pxDefaultSize: true,
132
+ variant: "primary",
133
+ type: "submit",
134
+ children: __("Disable")
135
+ }
136
+ )
137
+ ] })
138
+ ] })
139
+ }
140
+ )
141
+ }
142
+ );
119
143
  }
120
- //# sourceMappingURL=allow-overrides-modal.js.map
144
+ export {
145
+ AllowOverridesModal,
146
+ DisallowOverridesModal
147
+ };
148
+ //# sourceMappingURL=allow-overrides-modal.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","Button","__experimentalText","Text","TextControl","Modal","__","sprintf","useState","useId","speak","jsx","_jsx","jsxs","_jsxs","AllowOverridesModal","placeholder","initialName","onClose","onSave","editedBlockName","setEditedBlockName","descriptionId","isNameValid","trim","handleSubmit","message","title","onRequestClose","focusOnMount","aria","describedby","size","children","onSubmit","event","preventDefault","spacing","id","__nextHasNoMarginBottom","__next40pxDefaultSize","value","label","help","onChange","justify","variant","onClick","type","DisallowOverridesModal"],"sources":["@wordpress/patterns/src/components/allow-overrides-modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\t__experimentalText as Text,\n\tTextControl,\n\tModal,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useState, useId } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\n\nexport function AllowOverridesModal( {\n\tplaceholder,\n\tinitialName = '',\n\tonClose,\n\tonSave,\n} ) {\n\tconst [ editedBlockName, setEditedBlockName ] = useState( initialName );\n\tconst descriptionId = useId();\n\n\tconst isNameValid = !! editedBlockName.trim();\n\n\tconst handleSubmit = () => {\n\t\tif ( editedBlockName !== initialName ) {\n\t\t\tconst message = sprintf(\n\t\t\t\t/* translators: %s: new name/label for the block */\n\t\t\t\t__( 'Block name changed to: \"%s\".' ),\n\t\t\t\teditedBlockName\n\t\t\t);\n\n\t\t\t// Must be assertive to immediately announce change.\n\t\t\tspeak( message, 'assertive' );\n\t\t}\n\t\tonSave( editedBlockName );\n\n\t\t// Immediate close avoids ability to hit save multiple times.\n\t\tonClose();\n\t};\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Enable overrides' ) }\n\t\t\tonRequestClose={ onClose }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\taria={ { describedby: descriptionId } }\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form\n\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\tif ( ! isNameValid ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\thandleSubmit();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<VStack spacing=\"6\">\n\t\t\t\t\t<Text id={ descriptionId }>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Overrides are changes you make to a block within a synced pattern instance. Use overrides to customize a synced pattern instance to suit its new context. Name this block to specify an override.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Text>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ editedBlockName }\n\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'For example, if you are creating a recipe pattern, you use \"Recipe Title\", \"Recipe Description\", etc.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\t\tonChange={ setEditedBlockName }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\taria-disabled={ ! isNameValid }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Enable' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n\nexport function DisallowOverridesModal( { onClose, onSave } ) {\n\tconst descriptionId = useId();\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Disable overrides' ) }\n\t\t\tonRequestClose={ onClose }\n\t\t\taria={ { describedby: descriptionId } }\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form\n\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tonSave();\n\t\t\t\t\tonClose();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<VStack spacing=\"6\">\n\t\t\t\t\t<Text id={ descriptionId }>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Are you sure you want to disable overrides? Disabling overrides will revert all applied overrides for this block throughout instances of this pattern.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Text>\n\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Disable' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,EACNC,kBAAkB,IAAIC,IAAI,EAC1BC,WAAW,EACXC,KAAK,QACC,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,QAAQ,EAAEC,KAAK,QAAQ,oBAAoB;AACpD,SAASC,KAAK,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAExC,OAAO,SAASC,mBAAmBA,CAAE;EACpCC,WAAW;EACXC,WAAW,GAAG,EAAE;EAChBC,OAAO;EACPC;AACD,CAAC,EAAG;EACH,MAAM,CAAEC,eAAe,EAAEC,kBAAkB,CAAE,GAAGb,QAAQ,CAAES,WAAY,CAAC;EACvE,MAAMK,aAAa,GAAGb,KAAK,CAAC,CAAC;EAE7B,MAAMc,WAAW,GAAG,CAAC,CAAEH,eAAe,CAACI,IAAI,CAAC,CAAC;EAE7C,MAAMC,YAAY,GAAGA,CAAA,KAAM;IAC1B,IAAKL,eAAe,KAAKH,WAAW,EAAG;MACtC,MAAMS,OAAO,GAAGnB,OAAO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,EAEX3B,EAAE,CAAE,SAAU;UAAC,CACV,CAAC;QAAA,CACF,CAAC;MAAA,CACF;IAAC,CACJ;EAAC,CACD,CAAC;AAEV","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/allow-overrides-modal.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\t__experimentalText as Text,\n\tTextControl,\n\tModal,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useState, useId } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\n\nexport function AllowOverridesModal( {\n\tplaceholder,\n\tinitialName = '',\n\tonClose,\n\tonSave,\n} ) {\n\tconst [ editedBlockName, setEditedBlockName ] = useState( initialName );\n\tconst descriptionId = useId();\n\n\tconst isNameValid = !! editedBlockName.trim();\n\n\tconst handleSubmit = () => {\n\t\tif ( editedBlockName !== initialName ) {\n\t\t\tconst message = sprintf(\n\t\t\t\t/* translators: %s: new name/label for the block */\n\t\t\t\t__( 'Block name changed to: \"%s\".' ),\n\t\t\t\teditedBlockName\n\t\t\t);\n\n\t\t\t// Must be assertive to immediately announce change.\n\t\t\tspeak( message, 'assertive' );\n\t\t}\n\t\tonSave( editedBlockName );\n\n\t\t// Immediate close avoids ability to hit save multiple times.\n\t\tonClose();\n\t};\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Enable overrides' ) }\n\t\t\tonRequestClose={ onClose }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\taria={ { describedby: descriptionId } }\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form\n\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\tif ( ! isNameValid ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\thandleSubmit();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<VStack spacing=\"6\">\n\t\t\t\t\t<Text id={ descriptionId }>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Overrides are changes you make to a block within a synced pattern instance. Use overrides to customize a synced pattern instance to suit its new context. Name this block to specify an override.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Text>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ editedBlockName }\n\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'For example, if you are creating a recipe pattern, you use \"Recipe Title\", \"Recipe Description\", etc.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\t\tonChange={ setEditedBlockName }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\taria-disabled={ ! isNameValid }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Enable' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n\nexport function DisallowOverridesModal( { onClose, onSave } ) {\n\tconst descriptionId = useId();\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Disable overrides' ) }\n\t\t\tonRequestClose={ onClose }\n\t\t\taria={ { describedby: descriptionId } }\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form\n\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tonSave();\n\t\t\t\t\tonClose();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<VStack spacing=\"6\">\n\t\t\t\t\t<Text id={ descriptionId }>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Are you sure you want to disable overrides? Disabling overrides will revert all applied overrides for this block throughout instances of this pattern.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Text>\n\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Disable' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"],
5
+ "mappings": "AA+DK,cAgBA,YAhBA;AA5DL;AAAA,EACC,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB;AAAA,EACA,sBAAsB;AAAA,EACtB;AAAA,EACA;AAAA,OACM;AACP,SAAS,IAAI,eAAe;AAC5B,SAAS,UAAU,aAAa;AAChC,SAAS,aAAa;AAEf,SAAS,oBAAqB;AAAA,EACpC;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AACD,GAAI;AACH,QAAM,CAAE,iBAAiB,kBAAmB,IAAI,SAAU,WAAY;AACtE,QAAM,gBAAgB,MAAM;AAE5B,QAAM,cAAc,CAAC,CA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