@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,30 +1,36 @@
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 patterns_manage_button_exports = {};
19
+ __export(patterns_manage_button_exports, {
20
+ default: () => patterns_manage_button_default
5
21
  });
6
- exports.default = void 0;
7
- var _components = require("@wordpress/components");
8
- var _i18n = require("@wordpress/i18n");
9
- var _blocks = require("@wordpress/blocks");
10
- var _data = require("@wordpress/data");
11
- var _blockEditor = require("@wordpress/block-editor");
12
- var _url = require("@wordpress/url");
13
- var _coreData = require("@wordpress/core-data");
14
- var _store = require("../store");
15
- var _lockUnlock = require("../lock-unlock");
16
- var _jsxRuntime = require("react/jsx-runtime");
17
- /**
18
- * WordPress dependencies
19
- */
20
-
21
- /**
22
- * Internal dependencies
23
- */
24
-
25
- function PatternsManageButton({
26
- clientId
27
- }) {
22
+ module.exports = __toCommonJS(patterns_manage_button_exports);
23
+ var import_jsx_runtime = require("react/jsx-runtime");
24
+ var import_components = require("@wordpress/components");
25
+ var import_i18n = require("@wordpress/i18n");
26
+ var import_blocks = require("@wordpress/blocks");
27
+ var import_data = require("@wordpress/data");
28
+ var import_block_editor = require("@wordpress/block-editor");
29
+ var import_url = require("@wordpress/url");
30
+ var import_core_data = require("@wordpress/core-data");
31
+ var import_store = require("../store");
32
+ var import_lock_unlock = require("../lock-unlock");
33
+ function PatternsManageButton({ clientId }) {
28
34
  const {
29
35
  attributes,
30
36
  canDetach,
@@ -32,78 +38,71 @@ function PatternsManageButton({
32
38
  managePatternsUrl,
33
39
  isSyncedPattern,
34
40
  isUnsyncedPattern
35
- } = (0, _data.useSelect)(select => {
36
- const {
37
- canRemoveBlock,
38
- getBlock
39
- } = select(_blockEditor.store);
40
- const {
41
- canUser
42
- } = select(_coreData.store);
43
- const block = getBlock(clientId);
44
- const _isUnsyncedPattern = window?.__experimentalContentOnlyPatternInsertion && !!block?.attributes?.metadata?.patternName;
45
- const _isSyncedPattern = !!block && (0, _blocks.isReusableBlock)(block) && !!canUser('update', {
46
- kind: 'postType',
47
- name: 'wp_block',
48
- id: block.attributes.ref
49
- });
50
- return {
51
- attributes: block.attributes,
52
- // For unsynced patterns, detaching is simply removing the `patternName` attribute.
53
- // For synced patterns, the `core:block` block is replaced with its inner blocks,
54
- // so checking whether `canRemoveBlock` is possible is required.
55
- canDetach: _isUnsyncedPattern || _isSyncedPattern && canRemoveBlock(clientId),
56
- isUnsyncedPattern: _isUnsyncedPattern,
57
- isSyncedPattern: _isSyncedPattern,
58
- isVisible: _isUnsyncedPattern || _isSyncedPattern,
59
- // The site editor and templates both check whether the user
60
- // has edit_theme_options capabilities. We can leverage that here
61
- // and omit the manage patterns link if the user can't access it.
62
- managePatternsUrl: canUser('create', {
63
- kind: 'postType',
64
- name: 'wp_template'
65
- }) ? (0, _url.addQueryArgs)('site-editor.php', {
66
- p: '/pattern'
67
- }) : (0, _url.addQueryArgs)('edit.php', {
68
- post_type: 'wp_block'
69
- })
70
- };
71
- }, [clientId]);
72
- const {
73
- updateBlockAttributes
74
- } = (0, _data.useDispatch)(_blockEditor.store);
75
-
76
- // Ignore reason: false positive of the lint rule.
77
- // eslint-disable-next-line @wordpress/no-unused-vars-before-return
78
- const {
79
- convertSyncedPatternToStatic
80
- } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
41
+ } = (0, import_data.useSelect)(
42
+ (select) => {
43
+ const { canRemoveBlock, getBlock } = select(import_block_editor.store);
44
+ const { canUser } = select(import_core_data.store);
45
+ const block = getBlock(clientId);
46
+ const _isUnsyncedPattern = window?.__experimentalContentOnlyPatternInsertion && !!block?.attributes?.metadata?.patternName;
47
+ const _isSyncedPattern = !!block && (0, import_blocks.isReusableBlock)(block) && !!canUser("update", {
48
+ kind: "postType",
49
+ name: "wp_block",
50
+ id: block.attributes.ref
51
+ });
52
+ return {
53
+ attributes: block.attributes,
54
+ // For unsynced patterns, detaching is simply removing the `patternName` attribute.
55
+ // For synced patterns, the `core:block` block is replaced with its inner blocks,
56
+ // so checking whether `canRemoveBlock` is possible is required.
57
+ canDetach: _isUnsyncedPattern || _isSyncedPattern && canRemoveBlock(clientId),
58
+ isUnsyncedPattern: _isUnsyncedPattern,
59
+ isSyncedPattern: _isSyncedPattern,
60
+ isVisible: _isUnsyncedPattern || _isSyncedPattern,
61
+ // The site editor and templates both check whether the user
62
+ // has edit_theme_options capabilities. We can leverage that here
63
+ // and omit the manage patterns link if the user can't access it.
64
+ managePatternsUrl: canUser("create", {
65
+ kind: "postType",
66
+ name: "wp_template"
67
+ }) ? (0, import_url.addQueryArgs)("site-editor.php", {
68
+ p: "/pattern"
69
+ }) : (0, import_url.addQueryArgs)("edit.php", {
70
+ post_type: "wp_block"
71
+ })
72
+ };
73
+ },
74
+ [clientId]
75
+ );
76
+ const { updateBlockAttributes } = (0, import_data.useDispatch)(import_block_editor.store);
77
+ const { convertSyncedPatternToStatic } = (0, import_lock_unlock.unlock)(
78
+ (0, import_data.useDispatch)(import_store.store)
79
+ );
81
80
  if (!isVisible) {
82
81
  return null;
83
82
  }
84
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
85
- children: [canDetach && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
86
- onClick: () => {
87
- if (isSyncedPattern) {
88
- convertSyncedPatternToStatic(clientId);
89
- }
90
- if (isUnsyncedPattern) {
91
- var _attributes$metadata;
92
- const {
93
- patternName,
94
- ...attributesWithoutPatternName
95
- } = (_attributes$metadata = attributes?.metadata) !== null && _attributes$metadata !== void 0 ? _attributes$metadata : {};
96
- updateBlockAttributes(clientId, {
97
- metadata: attributesWithoutPatternName
98
- });
99
- }
100
- },
101
- children: (0, _i18n.__)('Detach')
102
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
103
- href: managePatternsUrl,
104
- children: (0, _i18n.__)('Manage patterns')
105
- })]
106
- });
83
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
84
+ canDetach && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
85
+ import_components.MenuItem,
86
+ {
87
+ onClick: () => {
88
+ if (isSyncedPattern) {
89
+ convertSyncedPatternToStatic(clientId);
90
+ }
91
+ if (isUnsyncedPattern) {
92
+ const {
93
+ patternName,
94
+ ...attributesWithoutPatternName
95
+ } = attributes?.metadata ?? {};
96
+ updateBlockAttributes(clientId, {
97
+ metadata: attributesWithoutPatternName
98
+ });
99
+ }
100
+ },
101
+ children: (0, import_i18n.__)("Detach")
102
+ }
103
+ ),
104
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.MenuItem, { href: managePatternsUrl, children: (0, import_i18n.__)("Manage patterns") })
105
+ ] });
107
106
  }
108
- var _default = exports.default = PatternsManageButton;
109
- //# sourceMappingURL=patterns-manage-button.js.map
107
+ var patterns_manage_button_default = PatternsManageButton;
108
+ //# sourceMappingURL=patterns-manage-button.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_components","require","_i18n","_blocks","_data","_blockEditor","_url","_coreData","_store","_lockUnlock","_jsxRuntime","PatternsManageButton","clientId","attributes","canDetach","isVisible","managePatternsUrl","isSyncedPattern","isUnsyncedPattern","useSelect","select","canRemoveBlock","getBlock","blockEditorStore","canUser","coreStore","block","_isUnsyncedPattern","window","__experimentalContentOnlyPatternInsertion","metadata","patternName","_isSyncedPattern","isReusableBlock","kind","name","id","ref","addQueryArgs","p","post_type","updateBlockAttributes","useDispatch","convertSyncedPatternToStatic","unlock","patternsStore","jsxs","Fragment","children","jsx","MenuItem","onClick","_attributes$metadata","attributesWithoutPatternName","__","href","_default","exports","default"],"sources":["@wordpress/patterns/src/components/patterns-manage-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { isReusableBlock } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { addQueryArgs } from '@wordpress/url';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as patternsStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\nfunction PatternsManageButton( { clientId } ) {\n\tconst {\n\t\tattributes,\n\t\tcanDetach,\n\t\tisVisible,\n\t\tmanagePatternsUrl,\n\t\tisSyncedPattern,\n\t\tisUnsyncedPattern,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { canRemoveBlock, getBlock } = select( blockEditorStore );\n\t\t\tconst { canUser } = select( coreStore );\n\t\t\tconst block = getBlock( clientId );\n\n\t\t\tconst _isUnsyncedPattern =\n\t\t\t\twindow?.__experimentalContentOnlyPatternInsertion &&\n\t\t\t\t!! block?.attributes?.metadata?.patternName;\n\n\t\t\tconst _isSyncedPattern =\n\t\t\t\t!! block &&\n\t\t\t\tisReusableBlock( block ) &&\n\t\t\t\t!! canUser( 'update', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'wp_block',\n\t\t\t\t\tid: block.attributes.ref,\n\t\t\t\t} );\n\n\t\t\treturn {\n\t\t\t\tattributes: block.attributes,\n\t\t\t\t// For unsynced patterns, detaching is simply removing the `patternName` attribute.\n\t\t\t\t// For synced patterns, the `core:block` block is replaced with its inner blocks,\n\t\t\t\t// so checking whether `canRemoveBlock` is possible is required.\n\t\t\t\tcanDetach:\n\t\t\t\t\t_isUnsyncedPattern ||\n\t\t\t\t\t( _isSyncedPattern && canRemoveBlock( clientId ) ),\n\t\t\t\tisUnsyncedPattern: _isUnsyncedPattern,\n\t\t\t\tisSyncedPattern: _isSyncedPattern,\n\t\t\t\tisVisible: _isUnsyncedPattern || _isSyncedPattern,\n\t\t\t\t// The site editor and templates both check whether the user\n\t\t\t\t// has edit_theme_options capabilities. We can leverage that here\n\t\t\t\t// and omit the manage patterns link if the user can't access it.\n\t\t\t\tmanagePatternsUrl: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'wp_template',\n\t\t\t\t} )\n\t\t\t\t\t? addQueryArgs( 'site-editor.php', {\n\t\t\t\t\t\t\tp: '/pattern',\n\t\t\t\t\t } )\n\t\t\t\t\t: addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\tpost_type: 'wp_block',\n\t\t\t\t\t } ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\t// Ignore reason: false positive of the lint rule.\n\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\tconst { convertSyncedPatternToStatic } = unlock(\n\t\tuseDispatch( patternsStore )\n\t);\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ canDetach && (\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tif ( isSyncedPattern ) {\n\t\t\t\t\t\t\tconvertSyncedPatternToStatic( clientId );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( isUnsyncedPattern ) {\n\t\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\t\tpatternName,\n\t\t\t\t\t\t\t\t...attributesWithoutPatternName\n\t\t\t\t\t\t\t} = attributes?.metadata ?? {};\n\t\t\t\t\t\t\tupdateBlockAttributes( clientId, {\n\t\t\t\t\t\t\t\tmetadata: attributesWithoutPatternName,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Detach' ) }\n\t\t\t\t</MenuItem>\n\t\t\t) }\n\t\t\t<MenuItem href={ managePatternsUrl }>\n\t\t\t\t{ __( 'Manage patterns' ) }\n\t\t\t</MenuItem>\n\t\t</>\n\t);\n}\n\nexport default PatternsManageButton;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,O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AE,iBAAkB;IAAC,CAChB,CAAC;EAAA,CACV,CAAC;AAEL;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc/C,oBAAoB","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/patterns-manage-button.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { isReusableBlock } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { addQueryArgs } from '@wordpress/url';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as patternsStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\nfunction PatternsManageButton( { clientId } ) {\n\tconst {\n\t\tattributes,\n\t\tcanDetach,\n\t\tisVisible,\n\t\tmanagePatternsUrl,\n\t\tisSyncedPattern,\n\t\tisUnsyncedPattern,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { canRemoveBlock, getBlock } = select( blockEditorStore );\n\t\t\tconst { canUser } = select( coreStore );\n\t\t\tconst block = getBlock( clientId );\n\n\t\t\tconst _isUnsyncedPattern =\n\t\t\t\twindow?.__experimentalContentOnlyPatternInsertion &&\n\t\t\t\t!! block?.attributes?.metadata?.patternName;\n\n\t\t\tconst _isSyncedPattern =\n\t\t\t\t!! block &&\n\t\t\t\tisReusableBlock( block ) &&\n\t\t\t\t!! canUser( 'update', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'wp_block',\n\t\t\t\t\tid: block.attributes.ref,\n\t\t\t\t} );\n\n\t\t\treturn {\n\t\t\t\tattributes: block.attributes,\n\t\t\t\t// For unsynced patterns, detaching is simply removing the `patternName` attribute.\n\t\t\t\t// For synced patterns, the `core:block` block is replaced with its inner blocks,\n\t\t\t\t// so checking whether `canRemoveBlock` is possible is required.\n\t\t\t\tcanDetach:\n\t\t\t\t\t_isUnsyncedPattern ||\n\t\t\t\t\t( _isSyncedPattern && canRemoveBlock( clientId ) ),\n\t\t\t\tisUnsyncedPattern: _isUnsyncedPattern,\n\t\t\t\tisSyncedPattern: _isSyncedPattern,\n\t\t\t\tisVisible: _isUnsyncedPattern || _isSyncedPattern,\n\t\t\t\t// The site editor and templates both check whether the user\n\t\t\t\t// has edit_theme_options capabilities. We can leverage that here\n\t\t\t\t// and omit the manage patterns link if the user can't access it.\n\t\t\t\tmanagePatternsUrl: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'wp_template',\n\t\t\t\t} )\n\t\t\t\t\t? addQueryArgs( 'site-editor.php', {\n\t\t\t\t\t\t\tp: '/pattern',\n\t\t\t\t\t } )\n\t\t\t\t\t: addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\tpost_type: 'wp_block',\n\t\t\t\t\t } ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\t// Ignore reason: false positive of the lint rule.\n\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\tconst { convertSyncedPatternToStatic } = unlock(\n\t\tuseDispatch( patternsStore )\n\t);\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ canDetach && (\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tif ( isSyncedPattern ) {\n\t\t\t\t\t\t\tconvertSyncedPatternToStatic( clientId );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( isUnsyncedPattern ) {\n\t\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\t\tpatternName,\n\t\t\t\t\t\t\t\t...attributesWithoutPatternName\n\t\t\t\t\t\t\t} = attributes?.metadata ?? {};\n\t\t\t\t\t\t\tupdateBlockAttributes( clientId, {\n\t\t\t\t\t\t\t\tmetadata: attributesWithoutPatternName,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Detach' ) }\n\t\t\t\t</MenuItem>\n\t\t\t) }\n\t\t\t<MenuItem href={ managePatternsUrl }>\n\t\t\t\t{ __( 'Manage patterns' ) }\n\t\t\t</MenuItem>\n\t\t</>\n\t);\n}\n\nexport default PatternsManageButton;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsFE;AAnFF,wBAAyB;AACzB,kBAAmB;AACnB,oBAAgC;AAChC,kBAAuC;AACvC,0BAA0C;AAC1C,iBAA6B;AAC7B,uBAAmC;AAKnC,mBAAuC;AACvC,yBAAuB;AAEvB,SAAS,qBAAsB,EAAE,SAAS,GAAI;AAC7C,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI;AAAA,IACH,CAAE,WAAY;AACb,YAAM,EAAE,gBAAgB,SAAS,IAAI,OAAQ,oBAAAA,KAAiB;AAC9D,YAAM,EAAE,QAAQ,IAAI,OAAQ,iBAAAC,KAAU;AACtC,YAAM,QAAQ,SAAU,QAAS;AAEjC,YAAM,qBACL,QAAQ,6CACR,CAAC,CAAE,OAAO,YAAY,UAAU;AAEjC,YAAM,mBACL,CAAC,CAAE,aACH,+BAAiB,KAAM,KACvB,CAAC,CAAE,QAAS,UAAU;AAAA,QACrB,MAAM;AAAA,QACN,MAAM;AAAA,QACN,IAAI,MAAM,WAAW;AAAA,MACtB,CAAE;AAEH,aAAO;AAAA,QACN,YAAY,MAAM;AAAA;AAAA;AAAA;AAAA,QAIlB,WACC,sBACE,oBAAoB,eAAgB,QAAS;AAAA,QAChD,mBAAmB;AAAA,QACnB,iBAAiB;AAAA,QACjB,WAAW,sBAAsB;AAAA;AAAA;AAAA;AAAA,QAIjC,mBAAmB,QAAS,UAAU;AAAA,UACrC,MAAM;AAAA,UACN,MAAM;AAAA,QACP,CAAE,QACC,yBAAc,mBAAmB;AAAA,UACjC,GAAG;AAAA,QACH,CAAE,QACF,yBAAc,YAAY;AAAA,UAC1B,WAAW;AAAA,QACX,CAAE;AAAA,MACN;AAAA,IACD;AAAA,IACA,CAAE,QAAS;AAAA,EACZ;AAEA,QAAM,EAAE,sBAAsB,QAAI,yBAAa,oBAAAD,KAAiB;AAIhE,QAAM,EAAE,6BAA6B,QAAI;AAAA,QACxC,yBAAa,aAAAE,KAAc;AAAA,EAC5B;AAEA,MAAK,CAAE,WAAY;AAClB,WAAO;AAAA,EACR;AAEA,SACC,4EACG;AAAA,iBACD;AAAA,MAAC;AAAA;AAAA,QACA,SAAU,MAAM;AACf,cAAK,iBAAkB;AACtB,yCAA8B,QAAS;AAAA,UACxC;AAEA,cAAK,mBAAoB;AACxB,kBAAM;AAAA,cACL;AAAA,cACA,GAAG;AAAA,YACJ,IAAI,YAAY,YAAY,CAAC;AAC7B,kCAAuB,UAAU;AAAA,cAChC,UAAU;AAAA,YACX,CAAE;AAAA,UACH;AAAA,QACD;AAAA,QAEE,8BAAI,QAAS;AAAA;AAAA,IAChB;AAAA,IAED,4CAAC,8BAAS,MAAO,mBACd,8BAAI,iBAAkB,GACzB;AAAA,KACD;AAEF;AAEA,IAAO,iCAAQ;",
6
+ "names": ["blockEditorStore", "coreStore", "patternsStore"]
7
+ }
@@ -1,27 +1,35 @@
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 rename_pattern_category_modal_exports = {};
19
+ __export(rename_pattern_category_modal_exports, {
20
+ default: () => RenamePatternCategoryModal
5
21
  });
6
- exports.default = RenamePatternCategoryModal;
7
- var _components = require("@wordpress/components");
8
- var _coreData = require("@wordpress/core-data");
9
- var _data = require("@wordpress/data");
10
- var _element = require("@wordpress/element");
11
- var _htmlEntities = require("@wordpress/html-entities");
12
- var _i18n = require("@wordpress/i18n");
13
- var _notices = require("@wordpress/notices");
14
- var _a11y = require("@wordpress/a11y");
15
- var _categorySelector = require("./category-selector");
16
- var _jsxRuntime = require("react/jsx-runtime");
17
- /**
18
- * WordPress dependencies
19
- */
20
-
21
- /**
22
- * Internal dependencies
23
- */
24
-
22
+ module.exports = __toCommonJS(rename_pattern_category_modal_exports);
23
+ var import_jsx_runtime = require("react/jsx-runtime");
24
+ var import_components = require("@wordpress/components");
25
+ var import_core_data = require("@wordpress/core-data");
26
+ var import_data = require("@wordpress/data");
27
+ var import_element = require("@wordpress/element");
28
+ var import_html_entities = require("@wordpress/html-entities");
29
+ var import_i18n = require("@wordpress/i18n");
30
+ var import_notices = require("@wordpress/notices");
31
+ var import_a11y = require("@wordpress/a11y");
32
+ var import_category_selector = require("./category-selector");
25
33
  function RenamePatternCategoryModal({
26
34
  category,
27
35
  existingCategories,
@@ -30,127 +38,130 @@ function RenamePatternCategoryModal({
30
38
  onSuccess,
31
39
  ...props
32
40
  }) {
33
- const id = (0, _element.useId)();
34
- const textControlRef = (0, _element.useRef)();
35
- const [name, setName] = (0, _element.useState)((0, _htmlEntities.decodeEntities)(category.name));
36
- const [isSaving, setIsSaving] = (0, _element.useState)(false);
37
- const [validationMessage, setValidationMessage] = (0, _element.useState)(false);
38
- const validationMessageId = validationMessage ? `patterns-rename-pattern-category-modal__validation-message-${id}` : undefined;
39
- const {
40
- saveEntityRecord,
41
- invalidateResolution
42
- } = (0, _data.useDispatch)(_coreData.store);
43
- const {
44
- createErrorNotice,
45
- createSuccessNotice
46
- } = (0, _data.useDispatch)(_notices.store);
47
- const onChange = newName => {
41
+ const id = (0, import_element.useId)();
42
+ const textControlRef = (0, import_element.useRef)();
43
+ const [name, setName] = (0, import_element.useState)((0, import_html_entities.decodeEntities)(category.name));
44
+ const [isSaving, setIsSaving] = (0, import_element.useState)(false);
45
+ const [validationMessage, setValidationMessage] = (0, import_element.useState)(false);
46
+ const validationMessageId = validationMessage ? `patterns-rename-pattern-category-modal__validation-message-${id}` : void 0;
47
+ const { saveEntityRecord, invalidateResolution } = (0, import_data.useDispatch)(import_core_data.store);
48
+ const { createErrorNotice, createSuccessNotice } = (0, import_data.useDispatch)(import_notices.store);
49
+ const onChange = (newName) => {
48
50
  if (validationMessage) {
49
- setValidationMessage(undefined);
51
+ setValidationMessage(void 0);
50
52
  }
51
53
  setName(newName);
52
54
  };
53
- const onSave = async event => {
55
+ const onSave = async (event) => {
54
56
  event.preventDefault();
55
57
  if (isSaving) {
56
58
  return;
57
59
  }
58
60
  if (!name || name === category.name) {
59
- const message = (0, _i18n.__)('Please enter a new name for this category.');
60
- (0, _a11y.speak)(message, 'assertive');
61
+ const message = (0, import_i18n.__)("Please enter a new name for this category.");
62
+ (0, import_a11y.speak)(message, "assertive");
61
63
  setValidationMessage(message);
62
64
  textControlRef.current?.focus();
63
65
  return;
64
66
  }
65
-
66
- // Check existing categories to avoid creating duplicates.
67
- if (existingCategories.patternCategories.find(existingCategory => {
68
- // Compare the id so that the we don't disallow the user changing the case of their current category
69
- // (i.e. renaming 'test' to 'Test').
67
+ if (existingCategories.patternCategories.find((existingCategory) => {
70
68
  return existingCategory.id !== category.id && existingCategory.label.toLowerCase() === name.toLowerCase();
71
69
  })) {
72
- const message = (0, _i18n.__)('This category already exists. Please use a different name.');
73
- (0, _a11y.speak)(message, 'assertive');
70
+ const message = (0, import_i18n.__)(
71
+ "This category already exists. Please use a different name."
72
+ );
73
+ (0, import_a11y.speak)(message, "assertive");
74
74
  setValidationMessage(message);
75
75
  textControlRef.current?.focus();
76
76
  return;
77
77
  }
78
78
  try {
79
79
  setIsSaving(true);
80
-
81
- // User pattern category properties may differ as they can be
82
- // normalized for use alongside template part areas, core pattern
83
- // categories etc. As a result we won't just destructure the passed
84
- // category object.
85
- const savedRecord = await saveEntityRecord('taxonomy', _categorySelector.CATEGORY_SLUG, {
86
- id: category.id,
87
- slug: category.slug,
88
- name
89
- });
90
- invalidateResolution('getUserPatternCategories');
80
+ const savedRecord = await saveEntityRecord(
81
+ "taxonomy",
82
+ import_category_selector.CATEGORY_SLUG,
83
+ {
84
+ id: category.id,
85
+ slug: category.slug,
86
+ name
87
+ }
88
+ );
89
+ invalidateResolution("getUserPatternCategories");
91
90
  onSuccess?.(savedRecord);
92
91
  onClose();
93
- createSuccessNotice((0, _i18n.__)('Pattern category renamed.'), {
94
- type: 'snackbar',
95
- id: 'pattern-category-update'
92
+ createSuccessNotice((0, import_i18n.__)("Pattern category renamed."), {
93
+ type: "snackbar",
94
+ id: "pattern-category-update"
96
95
  });
97
96
  } catch (error) {
98
97
  onError?.();
99
98
  createErrorNotice(error.message, {
100
- type: 'snackbar',
101
- id: 'pattern-category-update'
99
+ type: "snackbar",
100
+ id: "pattern-category-update"
102
101
  });
103
102
  } finally {
104
103
  setIsSaving(false);
105
- setName('');
104
+ setName("");
106
105
  }
107
106
  };
108
107
  const onRequestClose = () => {
109
108
  onClose();
110
- setName('');
109
+ setName("");
111
110
  };
112
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Modal, {
113
- title: (0, _i18n.__)('Rename'),
114
- onRequestClose: onRequestClose,
115
- ...props,
116
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("form", {
117
- onSubmit: onSave,
118
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
119
- spacing: "5",
120
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
121
- spacing: "2",
122
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextControl, {
123
- ref: textControlRef,
124
- __nextHasNoMarginBottom: true,
125
- __next40pxDefaultSize: true,
126
- label: (0, _i18n.__)('Name'),
127
- value: name,
128
- onChange: onChange,
129
- "aria-describedby": validationMessageId,
130
- required: true
131
- }), validationMessage && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
132
- className: "patterns-rename-pattern-category-modal__validation-message",
133
- id: validationMessageId,
134
- children: validationMessage
135
- })]
136
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
137
- justify: "right",
138
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
139
- __next40pxDefaultSize: true,
140
- variant: "tertiary",
141
- onClick: onRequestClose,
142
- children: (0, _i18n.__)('Cancel')
143
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
144
- __next40pxDefaultSize: true,
145
- variant: "primary",
146
- type: "submit",
147
- "aria-disabled": !name || name === category.name || isSaving,
148
- isBusy: isSaving,
149
- children: (0, _i18n.__)('Save')
150
- })]
151
- })]
152
- })
153
- })
154
- });
111
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
112
+ import_components.Modal,
113
+ {
114
+ title: (0, import_i18n.__)("Rename"),
115
+ onRequestClose,
116
+ ...props,
117
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("form", { onSubmit: onSave, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: "5", children: [
118
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: "2", children: [
119
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
120
+ import_components.TextControl,
121
+ {
122
+ ref: textControlRef,
123
+ __nextHasNoMarginBottom: true,
124
+ __next40pxDefaultSize: true,
125
+ label: (0, import_i18n.__)("Name"),
126
+ value: name,
127
+ onChange,
128
+ "aria-describedby": validationMessageId,
129
+ required: true
130
+ }
131
+ ),
132
+ validationMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
133
+ "span",
134
+ {
135
+ className: "patterns-rename-pattern-category-modal__validation-message",
136
+ id: validationMessageId,
137
+ children: validationMessage
138
+ }
139
+ )
140
+ ] }),
141
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "right", children: [
142
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
143
+ import_components.Button,
144
+ {
145
+ __next40pxDefaultSize: true,
146
+ variant: "tertiary",
147
+ onClick: onRequestClose,
148
+ children: (0, import_i18n.__)("Cancel")
149
+ }
150
+ ),
151
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
152
+ import_components.Button,
153
+ {
154
+ __next40pxDefaultSize: true,
155
+ variant: "primary",
156
+ type: "submit",
157
+ "aria-disabled": !name || name === category.name || isSaving,
158
+ isBusy: isSaving,
159
+ children: (0, import_i18n.__)("Save")
160
+ }
161
+ )
162
+ ] })
163
+ ] }) })
164
+ }
165
+ );
155
166
  }
156
- //# sourceMappingURL=rename-pattern-category-modal.js.map
167
+ //# sourceMappingURL=rename-pattern-category-modal.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_components","require","_coreData","_data","_element","_htmlEntities","_i18n","_notices","_a11y","_categorySelector","_jsxRuntime","RenamePatternCategoryModal","category","existingCategories","onClose","onError","onSuccess","props","id","useId","textControlRef","useRef","name","setName","useState","decodeEntities","isSaving","setIsSaving","validationMessage","setValidationMessage","validationMessageId","undefined","saveEntityRecord","invalidateResolution","useDispatch","coreStore","createErrorNotice","createSuccessNotice","noticesStore","onChange","newName","onSave","event","preventDefault","message","__","speak","current","focus","patternCategories","find","existingCategory","label","toLowerCase","savedRecord","CATEGORY_SLUG","slug","type","error","onRequestClose","jsx","Modal","title","children","onSubmit","jsxs","__experimentalVStack","spacing","TextControl","ref","__nextHasNoMarginBottom","__next40pxDefaultSize","value","required","className","__experimentalHStack","justify","Button","variant","onClick","isBusy"],"sources":["@wordpress/patterns/src/components/rename-pattern-category-modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tModal,\n\tButton,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useDispatch } from '@wordpress/data';\nimport { useId, useRef, useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { CATEGORY_SLUG } from './category-selector';\n\nexport default function RenamePatternCategoryModal( {\n\tcategory,\n\texistingCategories,\n\tonClose,\n\tonError,\n\tonSuccess,\n\t...props\n} ) {\n\tconst id = useId();\n\tconst textControlRef = useRef();\n\tconst [ name, setName ] = useState( decodeEntities( category.name ) );\n\tconst [ isSaving, setIsSaving ] = useState( false );\n\tconst [ validationMessage, setValidationMessage ] = useState( false );\n\tconst validationMessageId = validationMessage\n\t\t? `patterns-rename-pattern-category-modal__validation-message-${ id }`\n\t\t: undefined;\n\n\tconst { saveEntityRecord, invalidateResolution } = useDispatch( coreStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst onChange = ( newName ) => {\n\t\tif ( validationMessage ) {\n\t\t\tsetValidationMessage( undefined );\n\t\t}\n\t\tsetName( newName );\n\t};\n\n\tconst onSave = async ( event ) => {\n\t\tevent.preventDefault();\n\n\t\tif ( isSaving ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! name || name === category.name ) {\n\t\t\tconst message = __( 'Please enter a new name for this category.' );\n\t\t\tspeak( message, 'assertive' );\n\t\t\tsetValidationMessage( message );\n\t\t\ttextControlRef.current?.focus();\n\t\t\treturn;\n\t\t}\n\n\t\t// Check existing categories to avoid creating duplicates.\n\t\tif (\n\t\t\texistingCategories.patternCategories.find( ( existingCategory ) => {\n\t\t\t\t// Compare the id so that the we don't disallow the user changing the case of their current category\n\t\t\t\t// (i.e. renaming 'test' to 'Test').\n\t\t\t\treturn (\n\t\t\t\t\texistingCategory.id !== category.id &&\n\t\t\t\t\texistingCategory.label.toLowerCase() === name.toLowerCase()\n\t\t\t\t);\n\t\t\t} )\n\t\t) {\n\t\t\tconst message = __(\n\t\t\t\t'This category already exists. Please use a different name.'\n\t\t\t);\n\t\t\tspeak( message, 'assertive' );\n\t\t\tsetValidationMessage( message );\n\t\t\ttextControlRef.current?.focus();\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tsetIsSaving( true );\n\n\t\t\t// User pattern category properties may differ as they can be\n\t\t\t// normalized for use alongside template part areas, core pattern\n\t\t\t// categories etc. As a result we won't just destructure the passed\n\t\t\t// category object.\n\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t'taxonomy',\n\t\t\t\tCATEGORY_SLUG,\n\t\t\t\t{\n\t\t\t\t\tid: category.id,\n\t\t\t\t\tslug: category.slug,\n\t\t\t\t\tname,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tinvalidateResolution( 'getUserPatternCategories' );\n\t\t\tonSuccess?.( savedRecord );\n\t\t\tonClose();\n\n\t\t\tcreateSuccessNotice( __( 'Pattern category renamed.' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tid: 'pattern-category-update',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\tonError?.();\n\t\t\tcreateErrorNotice( error.message, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tid: 'pattern-category-update',\n\t\t\t} );\n\t\t} finally {\n\t\t\tsetIsSaving( false );\n\t\t\tsetName( '' );\n\t\t}\n\t};\n\n\tconst onRequestClose = () => {\n\t\tonClose();\n\t\tsetName( '' );\n\t};\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Rename' ) }\n\t\t\tonRequestClose={ onRequestClose }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<form onSubmit={ onSave }>\n\t\t\t\t<VStack spacing=\"5\">\n\t\t\t\t\t<VStack spacing=\"2\">\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\tref={ textControlRef }\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\tvalue={ name }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\taria-describedby={ validationMessageId }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ validationMessage && (\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName=\"patterns-rename-pattern-category-modal__validation-message\"\n\t\t\t\t\t\t\t\tid={ validationMessageId }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ validationMessage }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\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={ onRequestClose }\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\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\taria-disabled={\n\t\t\t\t\t\t\t\t! name || name === category.name || isSaving\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisBusy={ isSaving }\n\t\t\t\t\t\t>\n\t\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AAW;YACXC,GAAG,EAAGjD,cAAgB;YACtBkD,uBAAuB;YACvBC,qBAAqB;YACrBnB,KAAK,EAAG,IAAAP,QAAE,EAAE,MAAO,CAAG;YACtB2B,KAAK,EAAGlD,IAAM;YACdiB,QAAQ,EAAGA,QAAU;YACrB,oBAAmBT,mBAAqB;YACxC2C,QAAQ;UAAA,CACR,CAAC,EACA7C,iBAAiB,iBAClB,IAAAlB,WAAA,CAAAkD,GAAA;YACCc,SAAS,EAAC,4DAA4D;YACtExD,EAAE,EAAGY,mBAAqB;YAAAiC,QAAA,EAExBnC;UAAiB,CACd,CACN;QAAA,CACM,CAAC,eACT,IAAAlB,WAAA,CAAAuD,IAAA,EAACjE,WAAA,CAAA2E,oBAAM;UAACC,OAAO,EAAC,OAAO;UAAAb,QAAA,gBACtB,IAAArD,WAAA,CAAAkD,GAAA,EAAC5D,WAAA,CAAA6E,MAAM;YACNN,qBAAqB;YACrBO,OAAO,EAAC,UAAU;YAClBC,OAAO,EAAGpB,cAAgB;YAAAI,QAAA,EAExB,IAAAlB,QAAE,EAAE,QAAS;UAAC,CACT,CAAC,eACT,IAAAnC,WAAA,CAAAkD,GAAA,EAAC5D,WAAA,CAAA6E,MAAM;YACNN,qBAAqB;YACrBO,OAAO,EAAC,SAAS;YACjBrB,IAAI,EAAC,QAAQ;YACb,iBACC,CAAEnC,IAAI,IAAIA,IAAI,KAAKV,QAAQ,CAACU,IAAI,IAAII,QACpC;YACDsD,MAAM,EAAGtD,QAAU;YAAAqC,QAAA,EAEjB,IAAAlB,QAAE,EAAE,MAAO;UAAC,CACP,CAAC;QAAA,CACF,CAAC;MAAA,CACF;IAAC,CACJ;EAAC,CACD,CAAC;AAEV","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/rename-pattern-category-modal.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tModal,\n\tButton,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useDispatch } from '@wordpress/data';\nimport { useId, useRef, useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { CATEGORY_SLUG } from './category-selector';\n\nexport default function RenamePatternCategoryModal( {\n\tcategory,\n\texistingCategories,\n\tonClose,\n\tonError,\n\tonSuccess,\n\t...props\n} ) {\n\tconst id = useId();\n\tconst textControlRef = useRef();\n\tconst [ name, setName ] = useState( decodeEntities( category.name ) );\n\tconst [ isSaving, setIsSaving ] = useState( false );\n\tconst [ validationMessage, setValidationMessage ] = useState( false );\n\tconst validationMessageId = validationMessage\n\t\t? `patterns-rename-pattern-category-modal__validation-message-${ id }`\n\t\t: undefined;\n\n\tconst { saveEntityRecord, invalidateResolution } = useDispatch( coreStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst onChange = ( newName ) => {\n\t\tif ( validationMessage ) {\n\t\t\tsetValidationMessage( undefined );\n\t\t}\n\t\tsetName( newName );\n\t};\n\n\tconst onSave = async ( event ) => {\n\t\tevent.preventDefault();\n\n\t\tif ( isSaving ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! name || name === category.name ) {\n\t\t\tconst message = __( 'Please enter a new name for this category.' );\n\t\t\tspeak( message, 'assertive' );\n\t\t\tsetValidationMessage( message );\n\t\t\ttextControlRef.current?.focus();\n\t\t\treturn;\n\t\t}\n\n\t\t// Check existing categories to avoid creating duplicates.\n\t\tif (\n\t\t\texistingCategories.patternCategories.find( ( existingCategory ) => {\n\t\t\t\t// Compare the id so that the we don't disallow the user changing the case of their current category\n\t\t\t\t// (i.e. renaming 'test' to 'Test').\n\t\t\t\treturn (\n\t\t\t\t\texistingCategory.id !== category.id &&\n\t\t\t\t\texistingCategory.label.toLowerCase() === name.toLowerCase()\n\t\t\t\t);\n\t\t\t} )\n\t\t) {\n\t\t\tconst message = __(\n\t\t\t\t'This category already exists. Please use a different name.'\n\t\t\t);\n\t\t\tspeak( message, 'assertive' );\n\t\t\tsetValidationMessage( message );\n\t\t\ttextControlRef.current?.focus();\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tsetIsSaving( true );\n\n\t\t\t// User pattern category properties may differ as they can be\n\t\t\t// normalized for use alongside template part areas, core pattern\n\t\t\t// categories etc. As a result we won't just destructure the passed\n\t\t\t// category object.\n\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t'taxonomy',\n\t\t\t\tCATEGORY_SLUG,\n\t\t\t\t{\n\t\t\t\t\tid: category.id,\n\t\t\t\t\tslug: category.slug,\n\t\t\t\t\tname,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tinvalidateResolution( 'getUserPatternCategories' );\n\t\t\tonSuccess?.( savedRecord );\n\t\t\tonClose();\n\n\t\t\tcreateSuccessNotice( __( 'Pattern category renamed.' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tid: 'pattern-category-update',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\tonError?.();\n\t\t\tcreateErrorNotice( error.message, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tid: 'pattern-category-update',\n\t\t\t} );\n\t\t} finally {\n\t\t\tsetIsSaving( false );\n\t\t\tsetName( '' );\n\t\t}\n\t};\n\n\tconst onRequestClose = () => {\n\t\tonClose();\n\t\tsetName( '' );\n\t};\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Rename' ) }\n\t\t\tonRequestClose={ onRequestClose }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<form onSubmit={ onSave }>\n\t\t\t\t<VStack spacing=\"5\">\n\t\t\t\t\t<VStack spacing=\"2\">\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\tref={ textControlRef }\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\tvalue={ name }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\taria-describedby={ validationMessageId }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ validationMessage && (\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName=\"patterns-rename-pattern-category-modal__validation-message\"\n\t\t\t\t\t\t\t\tid={ validationMessageId }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ validationMessage }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\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={ onRequestClose }\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\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\taria-disabled={\n\t\t\t\t\t\t\t\t! name || name === category.name || isSaving\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisBusy={ isSaving }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Save' ) }\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": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwIK;AArIL,wBAMO;AACP,uBAAmC;AACnC,kBAA4B;AAC5B,qBAAwC;AACxC,2BAA+B;AAC/B,kBAAmB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