@wordpress/fields 0.24.0 → 0.24.1-next.ff1cebbba.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/README.md +1 -1
  2. package/build/actions/delete-post.js +168 -117
  3. package/build/actions/delete-post.js.map +7 -1
  4. package/build/actions/duplicate-pattern.js +42 -43
  5. package/build/actions/duplicate-pattern.js.map +7 -1
  6. package/build/actions/duplicate-post.js +104 -93
  7. package/build/actions/duplicate-post.js.map +7 -1
  8. package/build/actions/duplicate-template-part.js +71 -63
  9. package/build/actions/duplicate-template-part.js.map +7 -1
  10. package/build/actions/export-pattern.js +60 -45
  11. package/build/actions/export-pattern.js.map +7 -1
  12. package/build/actions/index.js +71 -94
  13. package/build/actions/index.js.map +7 -1
  14. package/build/actions/permanently-delete-post.js +161 -132
  15. package/build/actions/permanently-delete-post.js.map +7 -1
  16. package/build/actions/rename-post.js +77 -83
  17. package/build/actions/rename-post.js.map +7 -1
  18. package/build/actions/reorder-page.js +76 -73
  19. package/build/actions/reorder-page.js.map +7 -1
  20. package/build/actions/reset-post.js +214 -165
  21. package/build/actions/reset-post.js.map +7 -1
  22. package/build/actions/restore-post.js +91 -75
  23. package/build/actions/restore-post.js.map +7 -1
  24. package/build/actions/trash-post.js +167 -127
  25. package/build/actions/trash-post.js.map +7 -1
  26. package/build/actions/utils.js +48 -41
  27. package/build/actions/utils.js.map +7 -1
  28. package/build/actions/view-post-revisions.js +39 -35
  29. package/build/actions/view-post-revisions.js.map +7 -1
  30. package/build/actions/view-post.js +31 -28
  31. package/build/actions/view-post.js.map +7 -1
  32. package/build/components/create-template-part-modal/index.js +213 -169
  33. package/build/components/create-template-part-modal/index.js.map +7 -1
  34. package/build/components/create-template-part-modal/utils.js +48 -48
  35. package/build/components/create-template-part-modal/utils.js.map +7 -1
  36. package/build/fields/author/author-view.js +63 -69
  37. package/build/fields/author/author-view.js.map +7 -1
  38. package/build/fields/author/index.js +43 -29
  39. package/build/fields/author/index.js.map +7 -1
  40. package/build/fields/comment-status/index.js +42 -32
  41. package/build/fields/comment-status/index.js.map +7 -1
  42. package/build/fields/date/date-view.js +84 -58
  43. package/build/fields/date/date-view.js.map +7 -1
  44. package/build/fields/date/index.js +39 -25
  45. package/build/fields/date/index.js.map +7 -1
  46. package/build/fields/discussion/index.js +36 -32
  47. package/build/fields/discussion/index.js.map +7 -1
  48. package/build/fields/featured-image/featured-image-edit.js +115 -97
  49. package/build/fields/featured-image/featured-image-edit.js.map +7 -1
  50. package/build/fields/featured-image/featured-image-view.js +41 -34
  51. package/build/fields/featured-image/featured-image-view.js.map +7 -1
  52. package/build/fields/featured-image/index.js +31 -26
  53. package/build/fields/featured-image/index.js.map +7 -1
  54. package/build/fields/index.js +83 -118
  55. package/build/fields/index.js.map +7 -1
  56. package/build/fields/order/index.js +28 -23
  57. package/build/fields/order/index.js.map +7 -1
  58. package/build/fields/page-title/index.js +42 -30
  59. package/build/fields/page-title/index.js.map +7 -1
  60. package/build/fields/page-title/view.js +38 -41
  61. package/build/fields/page-title/view.js.map +7 -1
  62. package/build/fields/parent/index.js +31 -26
  63. package/build/fields/parent/index.js.map +7 -1
  64. package/build/fields/parent/parent-edit.js +200 -168
  65. package/build/fields/parent/parent-edit.js.map +7 -1
  66. package/build/fields/parent/parent-view.js +40 -31
  67. package/build/fields/parent/parent-view.js.map +7 -1
  68. package/build/fields/parent/utils.js +29 -16
  69. package/build/fields/parent/utils.js.map +7 -1
  70. package/build/fields/password/edit.js +67 -53
  71. package/build/fields/password/edit.js.map +7 -1
  72. package/build/fields/password/index.js +40 -26
  73. package/build/fields/password/index.js.map +7 -1
  74. package/build/fields/pattern-title/index.js +42 -30
  75. package/build/fields/pattern-title/index.js.map +7 -1
  76. package/build/fields/pattern-title/view.js +43 -41
  77. package/build/fields/pattern-title/view.js.map +7 -1
  78. package/build/fields/ping-status/index.js +66 -47
  79. package/build/fields/ping-status/index.js.map +7 -1
  80. package/build/fields/slug/index.js +41 -27
  81. package/build/fields/slug/index.js.map +7 -1
  82. package/build/fields/slug/slug-edit.js +116 -107
  83. package/build/fields/slug/slug-edit.js.map +7 -1
  84. package/build/fields/slug/slug-view.js +30 -23
  85. package/build/fields/slug/slug-view.js.map +7 -1
  86. package/build/fields/slug/utils.js +32 -20
  87. package/build/fields/slug/utils.js.map +7 -1
  88. package/build/fields/status/index.js +43 -29
  89. package/build/fields/status/index.js.map +7 -1
  90. package/build/fields/status/status-elements.js +58 -44
  91. package/build/fields/status/status-elements.js.map +7 -1
  92. package/build/fields/status/status-view.js +42 -36
  93. package/build/fields/status/status-view.js.map +7 -1
  94. package/build/fields/template/index.js +29 -24
  95. package/build/fields/template/index.js.map +7 -1
  96. package/build/fields/template/template-edit.js +167 -142
  97. package/build/fields/template/template-edit.js.map +7 -1
  98. package/build/fields/template-title/index.js +42 -30
  99. package/build/fields/template-title/index.js.map +7 -1
  100. package/build/fields/title/index.js +42 -32
  101. package/build/fields/title/index.js.map +7 -1
  102. package/build/fields/title/view.js +57 -39
  103. package/build/fields/title/view.js.map +7 -1
  104. package/build/index.js +39 -36
  105. package/build/index.js.map +7 -1
  106. package/build/lock-unlock.js +31 -14
  107. package/build/lock-unlock.js.map +7 -1
  108. package/build/mutation/index.js +91 -76
  109. package/build/mutation/index.js.map +7 -1
  110. package/build/types.js +16 -5
  111. package/build/types.js.map +7 -1
  112. package/build-module/actions/delete-post.js +155 -107
  113. package/build-module/actions/delete-post.js.map +7 -1
  114. package/build-module/actions/duplicate-pattern.js +24 -36
  115. package/build-module/actions/duplicate-pattern.js.map +7 -1
  116. package/build-module/actions/duplicate-post.js +87 -84
  117. package/build-module/actions/duplicate-post.js.map +7 -1
  118. package/build-module/actions/duplicate-template-part.js +51 -58
  119. package/build-module/actions/duplicate-template-part.js.map +7 -1
  120. package/build-module/actions/export-pattern.js +40 -39
  121. package/build-module/actions/export-pattern.js.map +7 -1
  122. package/build-module/actions/index.js +29 -14
  123. package/build-module/actions/index.js.map +7 -1
  124. package/build-module/actions/permanently-delete-post.js +146 -125
  125. package/build-module/actions/permanently-delete-post.js.map +7 -1
  126. package/build-module/actions/rename-post.js +63 -77
  127. package/build-module/actions/rename-post.js.map +7 -1
  128. package/build-module/actions/reorder-page.js +58 -65
  129. package/build-module/actions/reorder-page.js.map +7 -1
  130. package/build-module/actions/reset-post.js +185 -152
  131. package/build-module/actions/reset-post.js.map +7 -1
  132. package/build-module/actions/restore-post.js +72 -68
  133. package/build-module/actions/restore-post.js.map +7 -1
  134. package/build-module/actions/trash-post.js +152 -119
  135. package/build-module/actions/trash-post.js.map +7 -1
  136. package/build-module/actions/utils.js +23 -34
  137. package/build-module/actions/utils.js.map +7 -1
  138. package/build-module/actions/view-post-revisions.js +21 -31
  139. package/build-module/actions/view-post-revisions.js.map +7 -1
  140. package/build-module/actions/view-post.js +12 -23
  141. package/build-module/actions/view-post.js.map +7 -1
  142. package/build-module/components/create-template-part-modal/index.js +201 -154
  143. package/build-module/components/create-template-part-modal/index.js.map +7 -1
  144. package/build-module/components/create-template-part-modal/utils.js +26 -43
  145. package/build-module/components/create-template-part-modal/utils.js.map +7 -1
  146. package/build-module/fields/author/author-view.js +34 -62
  147. package/build-module/fields/author/author-view.js.map +7 -1
  148. package/build-module/fields/author/index.js +14 -24
  149. package/build-module/fields/author/index.js.map +7 -1
  150. package/build-module/fields/comment-status/index.js +24 -29
  151. package/build-module/fields/comment-status/index.js.map +7 -1
  152. package/build-module/fields/date/date-view.js +66 -53
  153. package/build-module/fields/date/date-view.js.map +7 -1
  154. package/build-module/fields/date/index.js +10 -20
  155. package/build-module/fields/date/index.js.map +7 -1
  156. package/build-module/fields/discussion/index.js +18 -29
  157. package/build-module/fields/discussion/index.js.map +7 -1
  158. package/build-module/fields/featured-image/featured-image-edit.js +93 -90
  159. package/build-module/fields/featured-image/featured-image-edit.js.map +7 -1
  160. package/build-module/fields/featured-image/featured-image-view.js +20 -29
  161. package/build-module/fields/featured-image/featured-image-view.js.map +7 -1
  162. package/build-module/fields/featured-image/index.js +11 -21
  163. package/build-module/fields/featured-image/index.js.map +7 -1
  164. package/build-module/fields/index.js +35 -17
  165. package/build-module/fields/index.js.map +7 -1
  166. package/build-module/fields/order/index.js +10 -20
  167. package/build-module/fields/order/index.js.map +7 -1
  168. package/build-module/fields/page-title/index.js +13 -25
  169. package/build-module/fields/page-title/index.js.map +7 -1
  170. package/build-module/fields/page-title/view.js +20 -37
  171. package/build-module/fields/page-title/view.js.map +7 -1
  172. package/build-module/fields/parent/index.js +11 -21
  173. package/build-module/fields/parent/index.js.map +7 -1
  174. package/build-module/fields/parent/parent-edit.js +172 -160
  175. package/build-module/fields/parent/parent-edit.js.map +7 -1
  176. package/build-module/fields/parent/parent-view.js +19 -27
  177. package/build-module/fields/parent/parent-view.js.map +7 -1
  178. package/build-module/fields/parent/utils.js +8 -13
  179. package/build-module/fields/parent/utils.js.map +7 -1
  180. package/build-module/fields/password/edit.js +53 -48
  181. package/build-module/fields/password/edit.js.map +7 -1
  182. package/build-module/fields/password/index.js +11 -21
  183. package/build-module/fields/password/index.js.map +7 -1
  184. package/build-module/fields/pattern-title/index.js +13 -25
  185. package/build-module/fields/pattern-title/index.js.map +7 -1
  186. package/build-module/fields/pattern-title/view.js +21 -34
  187. package/build-module/fields/pattern-title/view.js.map +7 -1
  188. package/build-module/fields/ping-status/index.js +48 -43
  189. package/build-module/fields/ping-status/index.js.map +7 -1
  190. package/build-module/fields/slug/index.js +11 -21
  191. package/build-module/fields/slug/index.js.map +7 -1
  192. package/build-module/fields/slug/slug-edit.js +101 -100
  193. package/build-module/fields/slug/slug-edit.js.map +7 -1
  194. package/build-module/fields/slug/slug-view.js +9 -16
  195. package/build-module/fields/slug/slug-view.js.map +7 -1
  196. package/build-module/fields/slug/utils.js +9 -13
  197. package/build-module/fields/slug/utils.js.map +7 -1
  198. package/build-module/fields/status/index.js +13 -23
  199. package/build-module/fields/status/index.js.map +7 -1
  200. package/build-module/fields/status/status-elements.js +47 -40
  201. package/build-module/fields/status/status-elements.js.map +7 -1
  202. package/build-module/fields/status/status-view.js +14 -31
  203. package/build-module/fields/status/status-view.js.map +7 -1
  204. package/build-module/fields/template/index.js +10 -18
  205. package/build-module/fields/template/index.js.map +7 -1
  206. package/build-module/fields/template/template-edit.js +147 -130
  207. package/build-module/fields/template/template-edit.js.map +7 -1
  208. package/build-module/fields/template-title/index.js +13 -25
  209. package/build-module/fields/template-title/index.js.map +7 -1
  210. package/build-module/fields/title/index.js +13 -27
  211. package/build-module/fields/title/index.js.map +7 -1
  212. package/build-module/fields/title/view.js +25 -32
  213. package/build-module/fields/title/view.js.map +7 -1
  214. package/build-module/index.js +7 -4
  215. package/build-module/index.js.map +7 -1
  216. package/build-module/lock-unlock.js +8 -7
  217. package/build-module/lock-unlock.js.map +7 -1
  218. package/build-module/mutation/index.js +70 -72
  219. package/build-module/mutation/index.js.map +7 -1
  220. package/build-module/types.js +1 -2
  221. package/build-module/types.js.map +7 -1
  222. package/build-style/style-rtl.css +4 -139
  223. package/build-style/style.css +4 -139
  224. package/build-types/fields/author/author-view.d.ts.map +1 -1
  225. package/build-types/fields/discussion/index.d.ts.map +1 -1
  226. package/build-types/fields/featured-image/featured-image-edit.d.ts +2 -2
  227. package/build-types/fields/featured-image/featured-image-edit.d.ts.map +1 -1
  228. package/build-types/fields/featured-image/featured-image-view.d.ts +5 -2
  229. package/build-types/fields/featured-image/featured-image-view.d.ts.map +1 -1
  230. package/build-types/fields/featured-image/index.d.ts +3 -3
  231. package/build-types/fields/featured-image/index.d.ts.map +1 -1
  232. package/build-types/types.d.ts +18 -0
  233. package/build-types/types.d.ts.map +1 -1
  234. package/package.json +34 -27
  235. package/src/components/create-template-part-modal/style.scss +4 -0
  236. package/src/fields/author/author-view.tsx +3 -17
  237. package/src/fields/discussion/index.tsx +1 -0
  238. package/src/fields/featured-image/featured-image-edit.tsx +2 -2
  239. package/src/fields/featured-image/featured-image-view.tsx +3 -15
  240. package/src/fields/featured-image/index.ts +3 -3
  241. package/src/fields/featured-image/style.scss +3 -0
  242. package/src/fields/template/style.scss +4 -0
  243. package/src/fields/title/style.scss +1 -1
  244. package/src/style.scss +9 -8
  245. package/src/types.ts +18 -0
  246. package/tsconfig.tsbuildinfo +1 -1
  247. package/build/index.native.js +0 -2
  248. package/build/index.native.js.map +0 -1
  249. package/build-module/index.native.js +0 -2
  250. package/build-module/index.native.js.map +0 -1
@@ -1,48 +1,66 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var view_exports = {};
30
+ __export(view_exports, {
31
+ BaseTitleView: () => BaseTitleView,
32
+ default: () => TitleView
6
33
  });
7
- exports.BaseTitleView = BaseTitleView;
8
- exports.default = TitleView;
9
- var _clsx = _interopRequireDefault(require("clsx"));
10
- var _components = require("@wordpress/components");
11
- var _i18n = require("@wordpress/i18n");
12
- var _utils = require("../../actions/utils");
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- /**
15
- * External dependencies
16
- */
17
-
18
- /**
19
- * WordPress dependencies
20
- */
21
-
22
- /**
23
- * Internal dependencies
24
- */
25
-
34
+ module.exports = __toCommonJS(view_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_clsx = __toESM(require("clsx"));
37
+ var import_components = require("@wordpress/components");
38
+ var import_i18n = require("@wordpress/i18n");
39
+ var import_utils = require("../../actions/utils");
26
40
  function BaseTitleView({
27
41
  item,
28
42
  className,
29
43
  children
30
44
  }) {
31
- const renderedTitle = (0, _utils.getItemTitle)(item);
32
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
33
- className: (0, _clsx.default)('fields-field__title', className),
34
- alignment: "center",
35
- justify: "flex-start",
36
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
37
- children: renderedTitle || (0, _i18n.__)('(no title)')
38
- }), children]
39
- });
45
+ const renderedTitle = (0, import_utils.getItemTitle)(item);
46
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
47
+ import_components.__experimentalHStack,
48
+ {
49
+ className: (0, import_clsx.default)("fields-field__title", className),
50
+ alignment: "center",
51
+ justify: "flex-start",
52
+ children: [
53
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: renderedTitle || (0, import_i18n.__)("(no title)") }),
54
+ children
55
+ ]
56
+ }
57
+ );
40
58
  }
41
- function TitleView({
42
- item
43
- }) {
44
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(BaseTitleView, {
45
- item: item
46
- });
59
+ function TitleView({ item }) {
60
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseTitleView, { item });
47
61
  }
48
- //# sourceMappingURL=view.js.map
62
+ // Annotate the CommonJS export names for ESM import in node:
63
+ 0 && (module.exports = {
64
+ BaseTitleView
65
+ });
66
+ //# sourceMappingURL=view.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_utils","_jsxRuntime","BaseTitleView","item","className","children","renderedTitle","getItemTitle","jsxs","__experimentalHStack","clsx","alignment","justify","jsx","__","TitleView"],"sources":["@wordpress/fields/src/fields/title/view.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { CommonPost } from '../../types';\nimport { getItemTitle } from '../../actions/utils';\n\nexport function BaseTitleView( {\n\titem,\n\tclassName,\n\tchildren,\n}: {\n\titem: CommonPost;\n\tclassName?: string;\n\tchildren?: ReactNode;\n} ) {\n\tconst renderedTitle = getItemTitle( item );\n\treturn (\n\t\t<HStack\n\t\t\tclassName={ clsx( 'fields-field__title', className ) }\n\t\t\talignment=\"center\"\n\t\t\tjustify=\"flex-start\"\n\t\t>\n\t\t\t<span>{ renderedTitle || __( '(no title)' ) }</span>\n\t\t\t{ children }\n\t\t</HStack>\n\t);\n}\n\nexport default function TitleView( { item }: { item: CommonPost } ) {\n\treturn <BaseTitleView item={ item } />;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAMA,IAAAG,MAAA,GAAAH,OAAA;AAAmD,IAAAI,WAAA,GAAAJ,OAAA;AAhBnD;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;;AAIO,SAASK,aAAaA,CAAE;EAC9BC,IAAI;EACJC,SAAS;EACTC;AAKD,CAAC,EAAG;EACH,MAAMC,aAAa,GAAG,IAAAC,mBAAY,EAAEJ,IAAK,CAAC;EAC1C,oBACC,IAAAF,WAAA,CAAAO,IAAA,EAACV,WAAA,CAAAW,oBAAM;IACNL,SAAS,EAAG,IAAAM,aAAI,EAAE,qBAAqB,EAAEN,SAAU,CAAG;IACtDO,SAAS,EAAC,QAAQ;IAClBC,OAAO,EAAC,YAAY;IAAAP,QAAA,gBAEpB,IAAAJ,WAAA,CAAAY,GAAA;MAAAR,QAAA,EAAQC,aAAa,IAAI,IAAAQ,QAAE,EAAE,YAAa;IAAC,CAAQ,CAAC,EAClDT,QAAQ;EAAA,CACH,CAAC;AAEX;AAEe,SAASU,SAASA,CAAE;EAAEZ;AAA2B,CAAC,EAAG;EACnE,oBAAO,IAAAF,WAAA,CAAAY,GAAA,EAACX,aAAa;IAACC,IAAI,EAAGA;EAAM,CAAE,CAAC;AACvC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/fields/title/view.tsx"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { CommonPost } from '../../types';\nimport { getItemTitle } from '../../actions/utils';\n\nexport function BaseTitleView( {\n\titem,\n\tclassName,\n\tchildren,\n}: {\n\titem: CommonPost;\n\tclassName?: string;\n\tchildren?: ReactNode;\n} ) {\n\tconst renderedTitle = getItemTitle( item );\n\treturn (\n\t\t<HStack\n\t\t\tclassName={ clsx( 'fields-field__title', className ) }\n\t\t\talignment=\"center\"\n\t\t\tjustify=\"flex-start\"\n\t\t>\n\t\t\t<span>{ renderedTitle || __( '(no title)' ) }</span>\n\t\t\t{ children }\n\t\t</HStack>\n\t);\n}\n\nexport default function TitleView( { item }: { item: CommonPost } ) {\n\treturn <BaseTitleView item={ item } />;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BE;AA1BF,kBAAiB;AAMjB,wBAA+C;AAC/C,kBAAmB;AAMnB,mBAA6B;AAEtB,SAAS,cAAe;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AACD,GAII;AACH,QAAM,oBAAgB,2BAAc,IAAK;AACzC,SACC;AAAA,IAAC,kBAAAA;AAAA,IAAA;AAAA,MACA,eAAY,YAAAC,SAAM,uBAAuB,SAAU;AAAA,MACnD,WAAU;AAAA,MACV,SAAQ;AAAA,MAER;AAAA,oDAAC,UAAO,+BAAiB,gBAAI,YAAa,GAAG;AAAA,QAC3C;AAAA;AAAA;AAAA,EACH;AAEF;AAEe,SAAR,UAA4B,EAAE,KAAK,GAA0B;AACnE,SAAO,4CAAC,iBAAc,MAAc;AACrC;",
6
+ "names": ["HStack", "clsx"]
7
+ }
package/build/index.js CHANGED
@@ -1,41 +1,44 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- var _exportNames = {
8
- CreateTemplatePartModal: true
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
9
11
  };
10
- Object.defineProperty(exports, "CreateTemplatePartModal", {
11
- enumerable: true,
12
- get: function () {
13
- return _createTemplatePartModal.default;
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
17
  }
18
+ return to;
19
+ };
20
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var index_exports = {};
31
+ __export(index_exports, {
32
+ CreateTemplatePartModal: () => import_create_template_part_modal.default
15
33
  });
16
- var _fields = require("./fields");
17
- Object.keys(_fields).forEach(function (key) {
18
- if (key === "default" || key === "__esModule") return;
19
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
20
- if (key in exports && exports[key] === _fields[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _fields[key];
25
- }
26
- });
27
- });
28
- var _actions = require("./actions");
29
- Object.keys(_actions).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
32
- if (key in exports && exports[key] === _actions[key]) return;
33
- Object.defineProperty(exports, key, {
34
- enumerable: true,
35
- get: function () {
36
- return _actions[key];
37
- }
38
- });
34
+ module.exports = __toCommonJS(index_exports);
35
+ __reExport(index_exports, require("./fields"), module.exports);
36
+ __reExport(index_exports, require("./actions"), module.exports);
37
+ var import_create_template_part_modal = __toESM(require("./components/create-template-part-modal"));
38
+ // Annotate the CommonJS export names for ESM import in node:
39
+ 0 && (module.exports = {
40
+ CreateTemplatePartModal,
41
+ ...require("./fields"),
42
+ ...require("./actions")
39
43
  });
40
- var _createTemplatePartModal = _interopRequireDefault(require("./components/create-template-part-modal"));
41
- //# sourceMappingURL=index.js.map
44
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_fields","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_actions","_createTemplatePartModal","_interopRequireDefault"],"sources":["@wordpress/fields/src/index.ts"],"sourcesContent":["export * from './fields';\nexport * from './actions';\nexport { default as CreateTemplatePartModal } from './components/create-template-part-modal';\nexport type { BasePostWithEmbeddedAuthor, BasePost, PostType } from './types';\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,QAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,QAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,QAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,QAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,wBAAA,GAAAC,sBAAA,CAAAf,OAAA","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts"],
4
+ "sourcesContent": ["export * from './fields';\nexport * from './actions';\nexport { default as CreateTemplatePartModal } from './components/create-template-part-modal';\nexport type { BasePostWithEmbeddedAuthor, BasePost, PostType } from './types';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,qBAAd;AACA,0BAAc,sBADd;AAEA,wCAAmD;",
6
+ "names": []
7
+ }
@@ -1,18 +1,35 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var lock_unlock_exports = {};
20
+ __export(lock_unlock_exports, {
21
+ lock: () => lock,
22
+ unlock: () => unlock
5
23
  });
6
- exports.unlock = exports.lock = void 0;
7
- var _privateApis = require("@wordpress/private-apis");
8
- /**
9
- * WordPress dependencies
10
- */
11
-
12
- const {
24
+ module.exports = __toCommonJS(lock_unlock_exports);
25
+ var import_private_apis = require("@wordpress/private-apis");
26
+ const { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
27
+ "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
28
+ "@wordpress/fields"
29
+ );
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
13
32
  lock,
14
33
  unlock
15
- } = (0, _privateApis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/fields');
16
- exports.unlock = unlock;
17
- exports.lock = lock;
18
- //# sourceMappingURL=lock-unlock.js.map
34
+ });
35
+ //# sourceMappingURL=lock-unlock.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_privateApis","require","lock","unlock","__dangerousOptInToUnstableAPIsOnlyForCoreModules","exports"],"sources":["@wordpress/fields/src/lock-unlock.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/fields'\n\t);\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAEO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5B,IAAAC,6DAAgD,EAC/C,+HAA+H,EAC/H,mBACD,CAAC;AAACC,OAAA,CAAAF,MAAA,GAAAA,MAAA;AAAAE,OAAA,CAAAH,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/lock-unlock.ts"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/fields'\n\t);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAiE;AAC1D,MAAM,EAAE,MAAM,OAAO,QAC3B;AAAA,EACC;AAAA,EACA;AACD;",
6
+ "names": []
7
+ }
@@ -1,32 +1,41 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var mutation_exports = {};
20
+ __export(mutation_exports, {
21
+ deletePostWithNotices: () => deletePostWithNotices,
22
+ editPostWithNotices: () => editPostWithNotices
5
23
  });
6
- exports.editPostWithNotices = exports.deletePostWithNotices = void 0;
7
- var _notices = require("@wordpress/notices");
8
- var _coreData = require("@wordpress/core-data");
9
- var _data = require("@wordpress/data");
10
- /**
11
- * WordPress dependencies
12
- */
13
-
14
- /**
15
- * Internal dependencies
16
- */
17
-
24
+ module.exports = __toCommonJS(mutation_exports);
25
+ var import_notices = require("@wordpress/notices");
26
+ var import_core_data = require("@wordpress/core-data");
27
+ var import_data = require("@wordpress/data");
18
28
  function getErrorMessagesFromPromises(allSettledResults) {
19
- const errorMessages = new Set();
20
- // If there was at lease one failure.
29
+ const errorMessages = /* @__PURE__ */ new Set();
21
30
  if (allSettledResults.length === 1) {
22
31
  const typedError = allSettledResults[0];
23
32
  if (typedError.reason?.message) {
24
33
  errorMessages.add(typedError.reason.message);
25
34
  }
26
35
  } else {
27
- const failedPromises = allSettledResults.filter(({
28
- status
29
- }) => status === 'rejected');
36
+ const failedPromises = allSettledResults.filter(
37
+ ({ status }) => status === "rejected"
38
+ );
30
39
  for (const failedPromise of failedPromises) {
31
40
  const typedError = failedPromise;
32
41
  if (typedError.reason?.message) {
@@ -37,25 +46,20 @@ function getErrorMessagesFromPromises(allSettledResults) {
37
46
  return errorMessages;
38
47
  }
39
48
  const deletePostWithNotices = async (posts, notice, callbacks) => {
40
- const {
41
- createSuccessNotice,
42
- createErrorNotice
43
- } = (0, _data.dispatch)(_notices.store);
44
- const {
45
- deleteEntityRecord
46
- } = (0, _data.dispatch)(_coreData.store);
47
- const allSettledResults = await Promise.allSettled(posts.map(post => {
48
- return deleteEntityRecord('postType', post.type, post.id, {
49
- force: true
50
- }, {
51
- throwOnError: true
52
- });
53
- }));
54
- // If all the promises were fulfilled with success.
55
- if (allSettledResults.every(({
56
- status
57
- }) => status === 'fulfilled')) {
58
- var _notice$success$type;
49
+ const { createSuccessNotice, createErrorNotice } = (0, import_data.dispatch)(import_notices.store);
50
+ const { deleteEntityRecord } = (0, import_data.dispatch)(import_core_data.store);
51
+ const allSettledResults = await Promise.allSettled(
52
+ posts.map((post) => {
53
+ return deleteEntityRecord(
54
+ "postType",
55
+ post.type,
56
+ post.id,
57
+ { force: true },
58
+ { throwOnError: true }
59
+ );
60
+ })
61
+ );
62
+ if (allSettledResults.every(({ status }) => status === "fulfilled")) {
59
63
  let successMessage;
60
64
  if (allSettledResults.length === 1) {
61
65
  successMessage = notice.success.messages.getMessage(posts[0]);
@@ -63,77 +67,88 @@ const deletePostWithNotices = async (posts, notice, callbacks) => {
63
67
  successMessage = notice.success.messages.getBatchMessage(posts);
64
68
  }
65
69
  createSuccessNotice(successMessage, {
66
- type: (_notice$success$type = notice.success.type) !== null && _notice$success$type !== void 0 ? _notice$success$type : 'snackbar',
70
+ type: notice.success.type ?? "snackbar",
67
71
  id: notice.success.id
68
72
  });
69
73
  callbacks.onActionPerformed?.(posts);
70
74
  } else {
71
- var _notice$error$type;
72
75
  const errorMessages = getErrorMessagesFromPromises(allSettledResults);
73
- let errorMessage = '';
76
+ let errorMessage = "";
74
77
  if (allSettledResults.length === 1) {
75
78
  errorMessage = notice.error.messages.getMessage(errorMessages);
76
79
  } else {
77
80
  errorMessage = notice.error.messages.getBatchMessage(errorMessages);
78
81
  }
79
82
  createErrorNotice(errorMessage, {
80
- type: (_notice$error$type = notice.error.type) !== null && _notice$error$type !== void 0 ? _notice$error$type : 'snackbar',
83
+ type: notice.error.type ?? "snackbar",
81
84
  id: notice.error.id
82
85
  });
83
86
  callbacks.onActionError?.();
84
87
  }
85
88
  };
86
- exports.deletePostWithNotices = deletePostWithNotices;
87
89
  const editPostWithNotices = async (postsWithUpdates, notice, callbacks) => {
88
- const {
89
- createSuccessNotice,
90
- createErrorNotice
91
- } = (0, _data.dispatch)(_notices.store);
92
- const {
93
- editEntityRecord,
94
- saveEditedEntityRecord
95
- } = (0, _data.dispatch)(_coreData.store);
96
- await Promise.allSettled(postsWithUpdates.map(post => {
97
- return editEntityRecord('postType', post.originalPost.type, post.originalPost.id, {
98
- ...post.changes
99
- });
100
- }));
101
- const allSettledResults = await Promise.allSettled(postsWithUpdates.map(post => {
102
- return saveEditedEntityRecord('postType', post.originalPost.type, post.originalPost.id, {
103
- throwOnError: true
104
- });
105
- }));
106
- // If all the promises were fulfilled with success.
107
- if (allSettledResults.every(({
108
- status
109
- }) => status === 'fulfilled')) {
110
- var _notice$success$type2;
90
+ const { createSuccessNotice, createErrorNotice } = (0, import_data.dispatch)(import_notices.store);
91
+ const { editEntityRecord, saveEditedEntityRecord } = (0, import_data.dispatch)(import_core_data.store);
92
+ await Promise.allSettled(
93
+ postsWithUpdates.map((post) => {
94
+ return editEntityRecord(
95
+ "postType",
96
+ post.originalPost.type,
97
+ post.originalPost.id,
98
+ {
99
+ ...post.changes
100
+ }
101
+ );
102
+ })
103
+ );
104
+ const allSettledResults = await Promise.allSettled(
105
+ postsWithUpdates.map((post) => {
106
+ return saveEditedEntityRecord(
107
+ "postType",
108
+ post.originalPost.type,
109
+ post.originalPost.id,
110
+ {
111
+ throwOnError: true
112
+ }
113
+ );
114
+ })
115
+ );
116
+ if (allSettledResults.every(({ status }) => status === "fulfilled")) {
111
117
  let successMessage;
112
118
  if (allSettledResults.length === 1) {
113
- successMessage = notice.success.messages.getMessage(postsWithUpdates[0].originalPost);
119
+ successMessage = notice.success.messages.getMessage(
120
+ postsWithUpdates[0].originalPost
121
+ );
114
122
  } else {
115
- successMessage = notice.success.messages.getBatchMessage(postsWithUpdates.map(post => post.originalPost));
123
+ successMessage = notice.success.messages.getBatchMessage(
124
+ postsWithUpdates.map((post) => post.originalPost)
125
+ );
116
126
  }
117
127
  createSuccessNotice(successMessage, {
118
- type: (_notice$success$type2 = notice.success.type) !== null && _notice$success$type2 !== void 0 ? _notice$success$type2 : 'snackbar',
128
+ type: notice.success.type ?? "snackbar",
119
129
  id: notice.success.id
120
130
  });
121
- callbacks.onActionPerformed?.(postsWithUpdates.map(post => post.originalPost));
131
+ callbacks.onActionPerformed?.(
132
+ postsWithUpdates.map((post) => post.originalPost)
133
+ );
122
134
  } else {
123
- var _notice$error$type2;
124
135
  const errorMessages = getErrorMessagesFromPromises(allSettledResults);
125
- let errorMessage = '';
136
+ let errorMessage = "";
126
137
  if (allSettledResults.length === 1) {
127
138
  errorMessage = notice.error.messages.getMessage(errorMessages);
128
139
  } else {
129
140
  errorMessage = notice.error.messages.getBatchMessage(errorMessages);
130
141
  }
131
142
  createErrorNotice(errorMessage, {
132
- type: (_notice$error$type2 = notice.error.type) !== null && _notice$error$type2 !== void 0 ? _notice$error$type2 : 'snackbar',
143
+ type: notice.error.type ?? "snackbar",
133
144
  id: notice.error.id
134
145
  });
135
146
  callbacks.onActionError?.();
136
147
  }
137
148
  };
138
- exports.editPostWithNotices = editPostWithNotices;
139
- //# sourceMappingURL=index.js.map
149
+ // Annotate the CommonJS export names for ESM import in node:
150
+ 0 && (module.exports = {
151
+ deletePostWithNotices,
152
+ editPostWithNotices
153
+ });
154
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_notices","require","_coreData","_data","getErrorMessagesFromPromises","allSettledResults","errorMessages","Set","length","typedError","reason","message","add","failedPromises","filter","status","failedPromise","deletePostWithNotices","posts","notice","callbacks","createSuccessNotice","createErrorNotice","dispatch","noticesStore","deleteEntityRecord","coreStore","Promise","allSettled","map","post","type","id","force","throwOnError","every","_notice$success$type","successMessage","success","messages","getMessage","getBatchMessage","onActionPerformed","_notice$error$type","errorMessage","error","onActionError","exports","editPostWithNotices","postsWithUpdates","editEntityRecord","saveEditedEntityRecord","originalPost","changes","_notice$success$type2","_notice$error$type2"],"sources":["@wordpress/fields/src/mutation/index.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { dispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport type { CoreDataError, Post } from '../types';\n\nfunction getErrorMessagesFromPromises< T >(\n\tallSettledResults: PromiseSettledResult< T >[]\n) {\n\tconst errorMessages = new Set< string >();\n\t// If there was at lease one failure.\n\tif ( allSettledResults.length === 1 ) {\n\t\tconst typedError = allSettledResults[ 0 ] as {\n\t\t\treason?: CoreDataError;\n\t\t};\n\t\tif ( typedError.reason?.message ) {\n\t\t\terrorMessages.add( typedError.reason.message );\n\t\t}\n\t} else {\n\t\tconst failedPromises = allSettledResults.filter(\n\t\t\t( { status } ) => status === 'rejected'\n\t\t);\n\t\tfor ( const failedPromise of failedPromises ) {\n\t\t\tconst typedError = failedPromise as {\n\t\t\t\treason?: CoreDataError;\n\t\t\t};\n\t\t\tif ( typedError.reason?.message ) {\n\t\t\t\terrorMessages.add( typedError.reason.message );\n\t\t\t}\n\t\t}\n\t}\n\treturn errorMessages;\n}\n\nexport type NoticeSettings< T extends Post > = {\n\tsuccess: {\n\t\tid?: string;\n\t\ttype?: string;\n\t\tmessages: {\n\t\t\tgetMessage: ( posts: T ) => string;\n\t\t\tgetBatchMessage: ( posts: T[] ) => string;\n\t\t};\n\t};\n\terror: {\n\t\tid?: string;\n\t\ttype?: string;\n\t\tmessages: {\n\t\t\tgetMessage: ( errors: Set< string > ) => string;\n\t\t\tgetBatchMessage: ( errors: Set< string > ) => string;\n\t\t};\n\t};\n};\n\nexport const deletePostWithNotices = async < T extends Post >(\n\tposts: T[],\n\tnotice: NoticeSettings< T >,\n\tcallbacks: {\n\t\tonActionPerformed?: ( posts: T[] ) => void;\n\t\tonActionError?: () => void;\n\t}\n) => {\n\tconst { createSuccessNotice, createErrorNotice } = dispatch( noticesStore );\n\tconst { deleteEntityRecord } = dispatch( coreStore );\n\tconst allSettledResults = await Promise.allSettled(\n\t\tposts.map( ( post ) => {\n\t\t\treturn deleteEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpost.type,\n\t\t\t\tpost.id,\n\t\t\t\t{ force: true },\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\t\t} )\n\t);\n\t// If all the promises were fulfilled with success.\n\tif ( allSettledResults.every( ( { status } ) => status === 'fulfilled' ) ) {\n\t\tlet successMessage;\n\t\tif ( allSettledResults.length === 1 ) {\n\t\t\tsuccessMessage = notice.success.messages.getMessage( posts[ 0 ] );\n\t\t} else {\n\t\t\tsuccessMessage = notice.success.messages.getBatchMessage( posts );\n\t\t}\n\t\tcreateSuccessNotice( successMessage, {\n\t\t\ttype: notice.success.type ?? 'snackbar',\n\t\t\tid: notice.success.id,\n\t\t} );\n\t\tcallbacks.onActionPerformed?.( posts );\n\t} else {\n\t\tconst errorMessages = getErrorMessagesFromPromises( allSettledResults );\n\t\tlet errorMessage = '';\n\t\tif ( allSettledResults.length === 1 ) {\n\t\t\terrorMessage = notice.error.messages.getMessage( errorMessages );\n\t\t} else {\n\t\t\terrorMessage =\n\t\t\t\tnotice.error.messages.getBatchMessage( errorMessages );\n\t\t}\n\n\t\tcreateErrorNotice( errorMessage, {\n\t\t\ttype: notice.error.type ?? 'snackbar',\n\t\t\tid: notice.error.id,\n\t\t} );\n\t\tcallbacks.onActionError?.();\n\t}\n};\n\nexport const editPostWithNotices = async < T extends Post >(\n\tpostsWithUpdates: {\n\t\toriginalPost: T;\n\t\tchanges: Partial< T >;\n\t}[],\n\tnotice: NoticeSettings< T >,\n\tcallbacks: {\n\t\tonActionPerformed?: ( posts: T[] ) => void;\n\t\tonActionError?: () => void;\n\t}\n) => {\n\tconst { createSuccessNotice, createErrorNotice } = dispatch( noticesStore );\n\tconst { editEntityRecord, saveEditedEntityRecord } = dispatch( coreStore );\n\tawait Promise.allSettled(\n\t\tpostsWithUpdates.map( ( post ) => {\n\t\t\treturn editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpost.originalPost.type,\n\t\t\t\tpost.originalPost.id,\n\t\t\t\t{\n\t\t\t\t\t...post.changes,\n\t\t\t\t}\n\t\t\t);\n\t\t} )\n\t);\n\tconst allSettledResults = await Promise.allSettled(\n\t\tpostsWithUpdates.map( ( post ) => {\n\t\t\treturn saveEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpost.originalPost.type,\n\t\t\t\tpost.originalPost.id,\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t} )\n\t);\n\t// If all the promises were fulfilled with success.\n\tif ( allSettledResults.every( ( { status } ) => status === 'fulfilled' ) ) {\n\t\tlet successMessage;\n\t\tif ( allSettledResults.length === 1 ) {\n\t\t\tsuccessMessage = notice.success.messages.getMessage(\n\t\t\t\tpostsWithUpdates[ 0 ].originalPost\n\t\t\t);\n\t\t} else {\n\t\t\tsuccessMessage = notice.success.messages.getBatchMessage(\n\t\t\t\tpostsWithUpdates.map( ( post ) => post.originalPost )\n\t\t\t);\n\t\t}\n\t\tcreateSuccessNotice( successMessage, {\n\t\t\ttype: notice.success.type ?? 'snackbar',\n\t\t\tid: notice.success.id,\n\t\t} );\n\t\tcallbacks.onActionPerformed?.(\n\t\t\tpostsWithUpdates.map( ( post ) => post.originalPost )\n\t\t);\n\t} else {\n\t\tconst errorMessages = getErrorMessagesFromPromises( allSettledResults );\n\t\tlet errorMessage = '';\n\t\tif ( allSettledResults.length === 1 ) {\n\t\t\terrorMessage = notice.error.messages.getMessage( errorMessages );\n\t\t} else {\n\t\t\terrorMessage =\n\t\t\t\tnotice.error.messages.getBatchMessage( errorMessages );\n\t\t}\n\n\t\tcreateErrorNotice( errorMessage, {\n\t\t\ttype: notice.error.type ?? 'snackbar',\n\t\t\tid: notice.error.id,\n\t\t} );\n\t\tcallbacks.onActionError?.();\n\t}\n};\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA;AACA;AACA;;AAGA,SAASG,4BAA4BA,CACpCC,iBAA8C,EAC7C;EACD,MAAMC,aAAa,GAAG,IAAIC,GAAG,CAAW,CAAC;EACzC;EACA,IAAKF,iBAAiB,CAACG,MAAM,KAAK,CAAC,EAAG;IACrC,MAAMC,UAAU,GAAGJ,iBAAiB,CAAE,CAAC,CAEtC;IACD,IAAKI,UAAU,CAACC,MAAM,EAAEC,OAAO,EAAG;MACjCL,aAAa,CAACM,GAAG,CAAEH,UAAU,CAACC,MAAM,CAACC,OAAQ,CAAC;IAC/C;EACD,CAAC,MAAM;IACN,MAAME,cAAc,GAAGR,iBAAiB,CAACS,MAAM,CAC9C,CAAE;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AC;IACHZ,SAAS,CAACsB,iBAAiB,GAC1BO,gBAAgB,CAACpB,GAAG,CAAIC,IAAI,IAAMA,IAAI,CAACsB,YAAa,CACrD,CAAC;EACF,CAAC,MAAM;IAAA,IAAAG,mBAAA;IACN,MAAMjD,aAAa,GAAGF,4BAA4B,CAAEC,iBAAkB,CAAC;IACvE,IAAIuC,YAAY,GAAG,EAAE;IACrB,IAAKvC,iBAAiB,CAACG,MAAM,KAAK,CAAC,EAAG;MACrCoC,YAAY,GAAGzB,MAAM,CAAC0B,KAAK,CAACN,QAAQ,CAACC,UAAU,CAAElC,aAAc,CAAC;IACjE,CAAC,MAAM;MACNsC,YAAY,GACXzB,MAAM,CAAC0B,KAAK,CAACN,QAAQ,CAACE,eAAe,CAAEnC,aAAc,CAAC;IACxD;IAEAgB,iBAAiB,CAAEsB,YAAY,EAAE;MAChCb,IAAI,GAAAwB,mBAAA,GAAEpC,MAAM,CAAC0B,KAAK,CAACd,IAAI,cAAAwB,mBAAA,cAAAA,mBAAA,GAAI,UAAU;MACrCvB,EAAE,EAAEb,MAAM,CAAC0B,KAAK,CAACb;IAClB,CAAE,CAAC;IACHZ,SAAS,CAAC0B,aAAa,GAAG,CAAC;EAC5B;AACD,CAAC;AAACC,OAAA,CAAAC,mBAAA,GAAAA,mBAAA","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/mutation/index.ts"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { dispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport type { CoreDataError, Post } from '../types';\n\nfunction getErrorMessagesFromPromises< T >(\n\tallSettledResults: PromiseSettledResult< T >[]\n) {\n\tconst errorMessages = new Set< string >();\n\t// If there was at lease one failure.\n\tif ( allSettledResults.length === 1 ) {\n\t\tconst typedError = allSettledResults[ 0 ] as {\n\t\t\treason?: CoreDataError;\n\t\t};\n\t\tif ( typedError.reason?.message ) {\n\t\t\terrorMessages.add( typedError.reason.message );\n\t\t}\n\t} else {\n\t\tconst failedPromises = allSettledResults.filter(\n\t\t\t( { status } ) => status === 'rejected'\n\t\t);\n\t\tfor ( const failedPromise of failedPromises ) {\n\t\t\tconst typedError = failedPromise as {\n\t\t\t\treason?: CoreDataError;\n\t\t\t};\n\t\t\tif ( typedError.reason?.message ) {\n\t\t\t\terrorMessages.add( typedError.reason.message );\n\t\t\t}\n\t\t}\n\t}\n\treturn errorMessages;\n}\n\nexport type NoticeSettings< T extends Post > = {\n\tsuccess: {\n\t\tid?: string;\n\t\ttype?: string;\n\t\tmessages: {\n\t\t\tgetMessage: ( posts: T ) => string;\n\t\t\tgetBatchMessage: ( posts: T[] ) => string;\n\t\t};\n\t};\n\terror: {\n\t\tid?: string;\n\t\ttype?: string;\n\t\tmessages: {\n\t\t\tgetMessage: ( errors: Set< string > ) => string;\n\t\t\tgetBatchMessage: ( errors: Set< string > ) => string;\n\t\t};\n\t};\n};\n\nexport const deletePostWithNotices = async < T extends Post >(\n\tposts: T[],\n\tnotice: NoticeSettings< T >,\n\tcallbacks: {\n\t\tonActionPerformed?: ( posts: T[] ) => void;\n\t\tonActionError?: () => void;\n\t}\n) => {\n\tconst { createSuccessNotice, createErrorNotice } = dispatch( noticesStore );\n\tconst { deleteEntityRecord } = dispatch( coreStore );\n\tconst allSettledResults = await Promise.allSettled(\n\t\tposts.map( ( post ) => {\n\t\t\treturn deleteEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpost.type,\n\t\t\t\tpost.id,\n\t\t\t\t{ force: true },\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\t\t} )\n\t);\n\t// If all the promises were fulfilled with success.\n\tif ( allSettledResults.every( ( { status } ) => status === 'fulfilled' ) ) {\n\t\tlet successMessage;\n\t\tif ( allSettledResults.length === 1 ) {\n\t\t\tsuccessMessage = notice.success.messages.getMessage( posts[ 0 ] );\n\t\t} else {\n\t\t\tsuccessMessage = notice.success.messages.getBatchMessage( posts );\n\t\t}\n\t\tcreateSuccessNotice( successMessage, {\n\t\t\ttype: notice.success.type ?? 'snackbar',\n\t\t\tid: notice.success.id,\n\t\t} );\n\t\tcallbacks.onActionPerformed?.( posts );\n\t} else {\n\t\tconst errorMessages = getErrorMessagesFromPromises( allSettledResults );\n\t\tlet errorMessage = '';\n\t\tif ( allSettledResults.length === 1 ) {\n\t\t\terrorMessage = notice.error.messages.getMessage( errorMessages );\n\t\t} else {\n\t\t\terrorMessage =\n\t\t\t\tnotice.error.messages.getBatchMessage( errorMessages );\n\t\t}\n\n\t\tcreateErrorNotice( errorMessage, {\n\t\t\ttype: notice.error.type ?? 'snackbar',\n\t\t\tid: notice.error.id,\n\t\t} );\n\t\tcallbacks.onActionError?.();\n\t}\n};\n\nexport const editPostWithNotices = async < T extends Post >(\n\tpostsWithUpdates: {\n\t\toriginalPost: T;\n\t\tchanges: Partial< T >;\n\t}[],\n\tnotice: NoticeSettings< T >,\n\tcallbacks: {\n\t\tonActionPerformed?: ( posts: T[] ) => void;\n\t\tonActionError?: () => void;\n\t}\n) => {\n\tconst { createSuccessNotice, createErrorNotice } = dispatch( noticesStore );\n\tconst { editEntityRecord, saveEditedEntityRecord } = dispatch( coreStore );\n\tawait Promise.allSettled(\n\t\tpostsWithUpdates.map( ( post ) => {\n\t\t\treturn editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpost.originalPost.type,\n\t\t\t\tpost.originalPost.id,\n\t\t\t\t{\n\t\t\t\t\t...post.changes,\n\t\t\t\t}\n\t\t\t);\n\t\t} )\n\t);\n\tconst allSettledResults = await Promise.allSettled(\n\t\tpostsWithUpdates.map( ( post ) => {\n\t\t\treturn saveEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpost.originalPost.type,\n\t\t\t\tpost.originalPost.id,\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t} )\n\t);\n\t// If all the promises were fulfilled with success.\n\tif ( allSettledResults.every( ( { status } ) => status === 'fulfilled' ) ) {\n\t\tlet successMessage;\n\t\tif ( allSettledResults.length === 1 ) {\n\t\t\tsuccessMessage = notice.success.messages.getMessage(\n\t\t\t\tpostsWithUpdates[ 0 ].originalPost\n\t\t\t);\n\t\t} else {\n\t\t\tsuccessMessage = notice.success.messages.getBatchMessage(\n\t\t\t\tpostsWithUpdates.map( ( post ) => post.originalPost )\n\t\t\t);\n\t\t}\n\t\tcreateSuccessNotice( successMessage, {\n\t\t\ttype: notice.success.type ?? 'snackbar',\n\t\t\tid: notice.success.id,\n\t\t} );\n\t\tcallbacks.onActionPerformed?.(\n\t\t\tpostsWithUpdates.map( ( post ) => post.originalPost )\n\t\t);\n\t} else {\n\t\tconst errorMessages = getErrorMessagesFromPromises( allSettledResults );\n\t\tlet errorMessage = '';\n\t\tif ( allSettledResults.length === 1 ) {\n\t\t\terrorMessage = notice.error.messages.getMessage( errorMessages );\n\t\t} else {\n\t\t\terrorMessage =\n\t\t\t\tnotice.error.messages.getBatchMessage( errorMessages );\n\t\t}\n\n\t\tcreateErrorNotice( errorMessage, {\n\t\t\ttype: notice.error.type ?? 'snackbar',\n\t\t\tid: notice.error.id,\n\t\t} );\n\t\tcallbacks.onActionError?.();\n\t}\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAsC;AACtC,uBAAmC;AACnC,kBAAyB;AAOzB,SAAS,6BACR,mBACC;AACD,QAAM,gBAAgB,oBAAI,IAAc;AAExC,MAAK,kBAAkB,WAAW,GAAI;AACrC,UAAM,aAAa,kBAAmB,CAAE;AAGxC,QAAK,WAAW,QAAQ,SAAU;AACjC,oBAAc,IAAK,WAAW,OAAO,OAAQ;AAAA,IAC9C;AAAA,EACD,OAAO;AACN,UAAM,iBAAiB,kBAAkB;AAAA,MACxC,CAAE,EAAE,OAAO,MAAO,WAAW;AAAA,IAC9B;AACA,eAAY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,QAAK,kBAAkB,WAAW,GAAI;AACrC,qBAAe,OAAO,MAAM,SAAS,WAAY,aAAc;AAAA,IAChE,OAAO;AACN,qBACC,OAAO,MAAM,SAAS,gBAAiB,aAAc;AAAA,IACvD;AAEA,sBAAmB,cAAc;AAAA,MAChC,MAAM,OAAO,MAAM,QAAQ;AAAA,MAC3B,IAAI,OAAO,MAAM;AAAA,IAClB,CAAE;AACF,cAAU,gBAAgB;AAAA,EAC3B;AACD;",
6
+ "names": ["noticesStore", "coreStore"]
7
+ }
package/build/types.js CHANGED
@@ -1,6 +1,17 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- //# sourceMappingURL=types.js.map
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
17
+ //# sourceMappingURL=types.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":[],"sources":["@wordpress/fields/src/types.ts"],"sourcesContent":["type PostStatus =\n\t| 'publish'\n\t| 'draft'\n\t| 'pending'\n\t| 'private'\n\t| 'future'\n\t| 'auto-draft'\n\t| 'trash';\n\nexport interface CommonPost {\n\tstatus?: PostStatus;\n\ttitle: string | { rendered: string } | { raw: string };\n\tcontent: string | { raw: string; rendered: string };\n\ttype: string;\n\tid: string | number;\n\tblocks?: Object[];\n\t_links?: Links;\n}\n\ninterface Links {\n\t'predecessor-version'?: { href: string; id: number }[];\n\t'version-history'?: { href: string; count: number }[];\n\t[ key: string ]: { href: string }[] | undefined;\n}\n\ninterface Author {\n\tname: string;\n\tavatar_urls: Record< string, string >;\n}\n\ninterface EmbeddedAuthor {\n\tauthor: Author[];\n}\n\n/**\n * BasePost interface used for all post types.\n */\nexport interface BasePost extends CommonPost {\n\tcomment_status?: 'open' | 'closed';\n\texcerpt?: string | { raw: string; rendered: string };\n\tmeta?: Record< string, any >;\n\tparent?: number;\n\tpassword?: string;\n\ttemplate?: string;\n\tformat?: string;\n\tfeatured_media?: number;\n\tmenu_order?: number;\n\tping_status?: 'open' | 'closed';\n\tlink?: string;\n\tslug?: string;\n\tpermalink_template?: string;\n\tdate?: string;\n\tmodified?: string;\n\tauthor?: number;\n}\n\nexport interface BasePostWithEmbeddedAuthor extends BasePost {\n\t_embedded: EmbeddedAuthor;\n}\n\nexport interface Template extends CommonPost {\n\ttype: 'wp_template';\n\tis_custom: boolean;\n\tsource: string;\n\torigin: string;\n\tplugin?: string;\n\thas_theme_file: boolean;\n\tid: string;\n}\n\nexport interface TemplatePart extends CommonPost {\n\ttype: 'wp_template_part';\n\tsource: string;\n\torigin: string;\n\thas_theme_file: boolean;\n\tid: string;\n\tarea: string;\n\tplugin?: string;\n}\n\nexport interface Pattern extends CommonPost {\n\tslug: string;\n\ttitle: { raw: string };\n\twp_pattern_sync_status: string;\n}\n\nexport type Post = Template | TemplatePart | Pattern | BasePost;\n\nexport type PostWithPermissions = Post & {\n\tpermissions: {\n\t\tdelete: boolean;\n\t\tupdate: boolean;\n\t};\n};\n\nexport interface PostType {\n\tslug: string;\n\tviewable: boolean;\n\tsupports?: {\n\t\t'page-attributes'?: boolean;\n\t\ttitle?: boolean;\n\t\trevisions?: boolean;\n\t\tauthor?: string;\n\t\tthumbnail?: string;\n\t\tcomments?: string;\n\t\teditor?: boolean;\n\t\ttrackbacks?: boolean;\n\t};\n}\n\n// Will be unnecessary after typescript 5.0 upgrade.\nexport type CoreDataError = { message?: string; code?: string };\n"],"mappings":"","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/types.ts"],
4
+ "sourcesContent": ["type PostStatus =\n\t| 'publish'\n\t| 'draft'\n\t| 'pending'\n\t| 'private'\n\t| 'future'\n\t| 'auto-draft'\n\t| 'trash';\n\nexport interface CommonPost {\n\tstatus?: PostStatus;\n\ttitle: string | { rendered: string } | { raw: string };\n\tcontent: string | { raw: string; rendered: string };\n\ttype: string;\n\tid: string | number;\n\tblocks?: Object[];\n\t_links?: Links;\n}\n\ninterface Links {\n\t'predecessor-version'?: { href: string; id: number }[];\n\t'version-history'?: { href: string; count: number }[];\n\t[ key: string ]: { href: string }[] | undefined;\n}\n\ninterface Author {\n\tname: string;\n\tavatar_urls: Record< string, string >;\n}\n\ninterface EmbeddedAuthor {\n\tauthor: Author[];\n}\n\n/**\n * BasePost interface used for all post types.\n */\nexport interface BasePost extends CommonPost {\n\tcomment_status?: 'open' | 'closed';\n\texcerpt?: string | { raw: string; rendered: string };\n\tmeta?: Record< string, any >;\n\tparent?: number;\n\tpassword?: string;\n\ttemplate?: string;\n\tformat?: string;\n\tfeatured_media?: number;\n\tmenu_order?: number;\n\tping_status?: 'open' | 'closed';\n\tlink?: string;\n\tslug?: string;\n\tpermalink_template?: string;\n\tdate?: string;\n\tmodified?: string;\n\tauthor?: number;\n}\n\nexport interface BasePostWithEmbeddedAuthor extends BasePost {\n\t_embedded: EmbeddedAuthor;\n}\n\ninterface FeaturedMedia {\n\ttitle: {\n\t\trendered: string;\n\t};\n\tsource_url: string;\n\tmedia_details: {\n\t\tsizes: Record< string, { width: number; source_url: string } >;\n\t};\n}\n\ninterface EmbeddedFeaturedMedia {\n\t'wp:featuredmedia': FeaturedMedia[];\n}\n\nexport interface BasePostWithEmbeddedFeaturedMedia extends BasePost {\n\t_embedded: EmbeddedFeaturedMedia;\n}\n\nexport interface Template extends CommonPost {\n\ttype: 'wp_template';\n\tis_custom: boolean;\n\tsource: string;\n\torigin: string;\n\tplugin?: string;\n\thas_theme_file: boolean;\n\tid: string;\n}\n\nexport interface TemplatePart extends CommonPost {\n\ttype: 'wp_template_part';\n\tsource: string;\n\torigin: string;\n\thas_theme_file: boolean;\n\tid: string;\n\tarea: string;\n\tplugin?: string;\n}\n\nexport interface Pattern extends CommonPost {\n\tslug: string;\n\ttitle: { raw: string };\n\twp_pattern_sync_status: string;\n}\n\nexport type Post = Template | TemplatePart | Pattern | BasePost;\n\nexport type PostWithPermissions = Post & {\n\tpermissions: {\n\t\tdelete: boolean;\n\t\tupdate: boolean;\n\t};\n};\n\nexport interface PostType {\n\tslug: string;\n\tviewable: boolean;\n\tsupports?: {\n\t\t'page-attributes'?: boolean;\n\t\ttitle?: boolean;\n\t\trevisions?: boolean;\n\t\tauthor?: string;\n\t\tthumbnail?: string;\n\t\tcomments?: string;\n\t\teditor?: boolean;\n\t\ttrackbacks?: boolean;\n\t};\n}\n\n// Will be unnecessary after typescript 5.0 upgrade.\nexport type CoreDataError = { message?: string; code?: string };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }