@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,72 +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 author_view_exports = {};
30
+ __export(author_view_exports, {
31
+ default: () => author_view_default
6
32
  });
7
- exports.default = void 0;
8
- var _clsx = _interopRequireDefault(require("clsx"));
9
- var _i18n = require("@wordpress/i18n");
10
- var _element = require("@wordpress/element");
11
- var _icons = require("@wordpress/icons");
12
- var _components = require("@wordpress/components");
13
- var _data = require("@wordpress/data");
14
- var _coreData = require("@wordpress/core-data");
15
- var _jsxRuntime = require("react/jsx-runtime");
16
- /**
17
- * External dependencies
18
- */
19
-
20
- /**
21
- * WordPress dependencies
22
- */
23
-
24
- /**
25
- * Internal dependencies
26
- */
27
-
28
- function AuthorView({
29
- item
30
- }) {
31
- const {
32
- text,
33
- imageUrl
34
- } = (0, _data.useSelect)(select => {
35
- const {
36
- getEntityRecord
37
- } = select(_coreData.store);
38
- let user;
39
- if (!!item.author) {
40
- user = getEntityRecord('root', 'user', item.author);
41
- }
42
- return {
43
- imageUrl: user?.avatar_urls?.[48],
44
- text: user?.name
45
- };
46
- }, [item]);
47
- const [isImageLoaded, setIsImageLoaded] = (0, _element.useState)(false);
48
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
49
- alignment: "left",
50
- spacing: 0,
51
- children: [!!imageUrl && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
52
- className: (0, _clsx.default)('page-templates-author-field__avatar', {
53
- 'is-loaded': isImageLoaded
54
- }),
55
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
56
- onLoad: () => setIsImageLoaded(true),
57
- alt: (0, _i18n.__)('Author avatar'),
58
- src: imageUrl
59
- })
60
- }), !imageUrl && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
61
- className: "page-templates-author-field__icon",
62
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
63
- icon: _icons.commentAuthorAvatar
64
- })
65
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
66
- className: "page-templates-author-field__name",
67
- children: text
68
- })]
69
- });
33
+ module.exports = __toCommonJS(author_view_exports);
34
+ var import_jsx_runtime = require("react/jsx-runtime");
35
+ var import_clsx = __toESM(require("clsx"));
36
+ var import_i18n = require("@wordpress/i18n");
37
+ var import_element = require("@wordpress/element");
38
+ var import_icons = require("@wordpress/icons");
39
+ var import_components = require("@wordpress/components");
40
+ function AuthorView({ item }) {
41
+ const text = item?._embedded?.author?.[0]?.name;
42
+ const imageUrl = item?._embedded?.author?.[0]?.avatar_urls?.[48];
43
+ const [isImageLoaded, setIsImageLoaded] = (0, import_element.useState)(false);
44
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { alignment: "left", spacing: 0, children: [
45
+ !!imageUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
46
+ "div",
47
+ {
48
+ className: (0, import_clsx.default)("page-templates-author-field__avatar", {
49
+ "is-loaded": isImageLoaded
50
+ }),
51
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
52
+ "img",
53
+ {
54
+ onLoad: () => setIsImageLoaded(true),
55
+ alt: (0, import_i18n.__)("Author avatar"),
56
+ src: imageUrl
57
+ }
58
+ )
59
+ }
60
+ ),
61
+ !imageUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "page-templates-author-field__icon", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Icon, { icon: import_icons.commentAuthorAvatar }) }),
62
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "page-templates-author-field__name", children: text })
63
+ ] });
70
64
  }
71
- var _default = exports.default = AuthorView;
72
- //# sourceMappingURL=author-view.js.map
65
+ var author_view_default = AuthorView;
66
+ //# sourceMappingURL=author-view.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_icons","_components","_data","_coreData","_jsxRuntime","AuthorView","item","text","imageUrl","useSelect","select","getEntityRecord","coreStore","user","author","avatar_urls","name","isImageLoaded","setIsImageLoaded","useState","jsxs","__experimentalHStack","alignment","spacing","children","jsx","className","clsx","onLoad","alt","__","src","Icon","icon","authorIcon","_default","exports","default"],"sources":["@wordpress/fields/src/fields/author/author-view.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { commentAuthorAvatar as authorIcon } from '@wordpress/icons';\nimport { __experimentalHStack as HStack, Icon } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { User } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport type { BasePostWithEmbeddedAuthor } from '../../types';\n\nfunction AuthorView( { item }: { item: BasePostWithEmbeddedAuthor } ) {\n\tconst { text, imageUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\tlet user: User | undefined;\n\t\t\tif ( !! item.author ) {\n\t\t\t\tuser = getEntityRecord( 'root', 'user', item.author );\n\t\t\t}\n\t\t\treturn {\n\t\t\t\timageUrl: user?.avatar_urls?.[ 48 ],\n\t\t\t\ttext: user?.name,\n\t\t\t};\n\t\t},\n\t\t[ item ]\n\t);\n\tconst [ isImageLoaded, setIsImageLoaded ] = useState( false );\n\treturn (\n\t\t<HStack alignment=\"left\" spacing={ 0 }>\n\t\t\t{ !! imageUrl && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ clsx( 'page-templates-author-field__avatar', {\n\t\t\t\t\t\t'is-loaded': isImageLoaded,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t<img\n\t\t\t\t\t\tonLoad={ () => setIsImageLoaded( true ) }\n\t\t\t\t\t\talt={ __( 'Author avatar' ) }\n\t\t\t\t\t\tsrc={ imageUrl }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ ! imageUrl && (\n\t\t\t\t<div className=\"page-templates-author-field__icon\">\n\t\t\t\t\t<Icon icon={ authorIcon } />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<span className=\"page-templates-author-field__name\">{ text }</span>\n\t\t</HStack>\n\t);\n}\n\nexport default AuthorView;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAA0D,IAAAO,WAAA,GAAAP,OAAA;AAb1D;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAGA,SAASQ,UAAUA,CAAE;EAAEC;AAA2C,CAAC,EAAG;EACrE,MAAM;IAAEC,IAAI;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EACjCC,MAAM,IAAM;IACb,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAEE,eAAU,CAAC;IAC/C,IAAIC,IAAsB;IAC1B,IAAK,CAAC,CAAEP,IAAI,CAACQ,MAAM,EAAG;MACrBD,IAAI,GAAGF,eAAe,CAAE,MAAM,EAAE,MAAM,EAAEL,IAAI,CAACQ,MAAO,CAAC;IACtD;IACA,OAAO;MACNN,QAAQ,EAAEK,IAAI,EAAEE,WAAW,GAAI,EAAE,CAAE;MACnCR,IAAI,EAAEM,IAAI,EAAEG;IACb,CAAC;EACF,CAAC,EACD,CAAEV,IAAI,CACP,CAAC;EACD,MAAM,CAAEW,aAAa,EAAEC,gBAAgB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EAC7D,oBACC,IAAAf,WAAA,CAAAgB,IAAA,EAACnB,WAAA,CAAAoB,oBAAM;IAACC,SAAS,EAAC,MAAM;IAACC,OAAO,EAAG,CAAG;IAAAC,QAAA,GACnC,CAAC,CAAEhB,QAAQ,iBACZ,IAAAJ,WAAA,CAAAqB,GAAA;MACCC,SAAS,EAAG,IAAAC,aAAI,EAAE,qCAAqC,EAAE;QACxD,WAAW,EAAEV;MACd,CAAE,CAAG;MAAAO,QAAA,eAEL,IAAApB,WAAA,CAAAqB,GAAA;QACCG,MAAM,EAAGA,CAAA,KAAMV,gBAAgB,CAAE,IAAK,CAAG;QACzCW,GAAG,EAAG,IAAAC,QAAE,EAAE,eAAgB,CAAG;QAC7BC,GAAG,EAAGvB;MAAU,CAChB;IAAC,CACE,CACL,EACC,CAAEA,QAAQ,iBACX,IAAAJ,WAAA,CAAAqB,GAAA;MAAKC,SAAS,EAAC,mCAAmC;MAAAF,QAAA,eACjD,IAAApB,WAAA,CAAAqB,GAAA,EAACxB,WAAA,CAAA+B,IAAI;QAACC,IAAI,EAAGC;MAAY,CAAE;IAAC,CACxB,CACL,eACD,IAAA9B,WAAA,CAAAqB,GAAA;MAAMC,SAAS,EAAC,mCAAmC;MAAAF,QAAA,EAAGjB;IAAI,CAAQ,CAAC;EAAA,CAC5D,CAAC;AAEX;AAAC,IAAA4B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEchC,UAAU","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/fields/author/author-view.tsx"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { commentAuthorAvatar as authorIcon } from '@wordpress/icons';\nimport { __experimentalHStack as HStack, Icon } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport type { BasePostWithEmbeddedAuthor } from '../../types';\n\nfunction AuthorView( { item }: { item: BasePostWithEmbeddedAuthor } ) {\n\tconst text = item?._embedded?.author?.[ 0 ]?.name;\n\tconst imageUrl = item?._embedded?.author?.[ 0 ]?.avatar_urls?.[ 48 ];\n\n\tconst [ isImageLoaded, setIsImageLoaded ] = useState( false );\n\treturn (\n\t\t<HStack alignment=\"left\" spacing={ 0 }>\n\t\t\t{ !! imageUrl && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ clsx( 'page-templates-author-field__avatar', {\n\t\t\t\t\t\t'is-loaded': isImageLoaded,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t<img\n\t\t\t\t\t\tonLoad={ () => setIsImageLoaded( true ) }\n\t\t\t\t\t\talt={ __( 'Author avatar' ) }\n\t\t\t\t\t\tsrc={ imageUrl }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ ! imageUrl && (\n\t\t\t\t<div className=\"page-templates-author-field__icon\">\n\t\t\t\t\t<Icon icon={ authorIcon } />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<span className=\"page-templates-author-field__name\">{ text }</span>\n\t\t</HStack>\n\t);\n}\n\nexport default AuthorView;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBE;AArBF,kBAAiB;AAKjB,kBAAmB;AACnB,qBAAyB;AACzB,mBAAkD;AAClD,wBAAqD;AAOrD,SAAS,WAAY,EAAE,KAAK,GAA0C;AACrE,QAAM,OAAO,MAAM,WAAW,SAAU,CAAE,GAAG;AAC7C,QAAM,WAAW,MAAM,WAAW,SAAU,CAAE,GAAG,cAAe,EAAG;AAEnE,QAAM,CAAE,eAAe,gBAAiB,QAAI,yBAAU,KAAM;AAC5D,SACC,6CAAC,kBAAAA,sBAAA,EAAO,WAAU,QAAO,SAAU,GAChC;AAAA,KAAC,CAAE,YACJ;AAAA,MAAC;AAAA;AAAA,QACA,eAAY,YAAAC,SAAM,uCAAuC;AAAA,UACxD,aAAa;AAAA,QACd,CAAE;AAAA,QAEF;AAAA,UAAC;AAAA;AAAA,YACA,QAAS,MAAM,iBAAkB,IAAK;AAAA,YACtC,SAAM,gBAAI,eAAgB;AAAA,YAC1B,KAAM;AAAA;AAAA,QACP;AAAA;AAAA,IACD;AAAA,IAEC,CAAE,YACH,4CAAC,SAAI,WAAU,qCACd,sDAAC,0BAAK,MAAO,aAAAC,qBAAa,GAC3B;AAAA,IAED,4CAAC,UAAK,WAAU,qCAAsC,gBAAM;AAAA,KAC7D;AAEF;AAEA,IAAO,sBAAQ;",
6
+ "names": ["HStack", "clsx", "authorIcon"]
7
+ }
@@ -1,38 +1,52 @@
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 author_exports = {};
30
+ __export(author_exports, {
31
+ default: () => author_default
6
32
  });
7
- exports.default = void 0;
8
- var _i18n = require("@wordpress/i18n");
9
- var _authorView = _interopRequireDefault(require("./author-view"));
10
- /**
11
- * WordPress dependencies
12
- */
13
-
14
- /**
15
- * Internal dependencies
16
- */
17
-
33
+ module.exports = __toCommonJS(author_exports);
34
+ var import_i18n = require("@wordpress/i18n");
35
+ var import_author_view = __toESM(require("./author-view"));
18
36
  const authorField = {
19
- label: (0, _i18n.__)('Author'),
20
- id: 'author',
21
- type: 'integer',
37
+ label: (0, import_i18n.__)("Author"),
38
+ id: "author",
39
+ type: "integer",
22
40
  elements: [],
23
- render: _authorView.default,
41
+ render: import_author_view.default,
24
42
  sort: (a, b, direction) => {
25
- const nameA = a._embedded?.author?.[0]?.name || '';
26
- const nameB = b._embedded?.author?.[0]?.name || '';
27
- return direction === 'asc' ? nameA.localeCompare(nameB) : nameB.localeCompare(nameA);
43
+ const nameA = a._embedded?.author?.[0]?.name || "";
44
+ const nameB = b._embedded?.author?.[0]?.name || "";
45
+ return direction === "asc" ? nameA.localeCompare(nameB) : nameB.localeCompare(nameA);
28
46
  },
29
47
  filterBy: {
30
- operators: ['isAny', 'isNone']
48
+ operators: ["isAny", "isNone"]
31
49
  }
32
50
  };
33
-
34
- /**
35
- * Author field for BasePost.
36
- */
37
- var _default = exports.default = authorField;
38
- //# sourceMappingURL=index.js.map
51
+ var author_default = authorField;
52
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_i18n","require","_authorView","_interopRequireDefault","authorField","label","__","id","type","elements","render","AuthorView","sort","a","b","direction","nameA","_embedded","author","name","nameB","localeCompare","filterBy","operators","_default","exports","default"],"sources":["@wordpress/fields/src/fields/author/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport type { Field } from '@wordpress/dataviews';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { BasePostWithEmbeddedAuthor } from '../../types';\nimport AuthorView from './author-view';\n\nconst authorField: Field< BasePostWithEmbeddedAuthor > = {\n\tlabel: __( 'Author' ),\n\tid: 'author',\n\ttype: 'integer',\n\telements: [],\n\trender: AuthorView,\n\tsort: ( a, b, direction ) => {\n\t\tconst nameA = a._embedded?.author?.[ 0 ]?.name || '';\n\t\tconst nameB = b._embedded?.author?.[ 0 ]?.name || '';\n\n\t\treturn direction === 'asc'\n\t\t\t? nameA.localeCompare( nameB )\n\t\t\t: nameB.localeCompare( nameA );\n\t},\n\n\tfilterBy: {\n\t\toperators: [ 'isAny', 'isNone' ],\n\t},\n};\n\n/**\n * Author field for BasePost.\n */\nexport default authorField;\n"],"mappings":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,MAAMG,WAAgD,GAAG;EACxDC,KAAK,EAAE,IAAAC,QAAE,EAAE,QAAS,CAAC;EACrBC,EAAE,EAAE,QAAQ;EACZC,IAAI,EAAE,SAAS;EACfC,QAAQ,EAAE,EAAE;EACZC,MAAM,EAAEC,mBAAU;EAClBC,IAAI,EAAEA,CAAEC,CAAC,EAAEC,CAAC,EAAEC,SAAS,KAAM;IAC5B,MAAMC,KAAK,GAAGH,CAAC,CAACI,SAAS,EAAEC,MAAM,GAAI,CAAC,CAAE,EAAEC,IAAI,IAAI,EAAE;IACpD,MAAMC,KAAK,GAAGN,CAAC,CAACG,SAAS,EAAEC,MAAM,GAAI,CAAC,CAAE,EAAEC,IAAI,IAAI,EAAE;IAEpD,OAAOJ,SAAS,KAAK,KAAK,GACvBC,KAAK,CAACK,aAAa,CAAED,KAAM,CAAC,GAC5BA,KAAK,CAACC,aAAa,CAAEL,KAAM,CAAC;EAChC,CAAC;EAEDM,QAAQ,EAAE;IACTC,SAAS,EAAE,CAAE,OAAO,EAAE,QAAQ;EAC/B;AACD,CAAC;;AAED;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGetB,WAAW","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/fields/author/index.tsx"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport type { Field } from '@wordpress/dataviews';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { BasePostWithEmbeddedAuthor } from '../../types';\nimport AuthorView from './author-view';\n\nconst authorField: Field< BasePostWithEmbeddedAuthor > = {\n\tlabel: __( 'Author' ),\n\tid: 'author',\n\ttype: 'integer',\n\telements: [],\n\trender: AuthorView,\n\tsort: ( a, b, direction ) => {\n\t\tconst nameA = a._embedded?.author?.[ 0 ]?.name || '';\n\t\tconst nameB = b._embedded?.author?.[ 0 ]?.name || '';\n\n\t\treturn direction === 'asc'\n\t\t\t? nameA.localeCompare( nameB )\n\t\t\t: nameB.localeCompare( nameA );\n\t},\n\n\tfilterBy: {\n\t\toperators: [ 'isAny', 'isNone' ],\n\t},\n};\n\n/**\n * Author field for BasePost.\n */\nexport default authorField;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAmB;AAMnB,yBAAuB;AAEvB,MAAM,cAAmD;AAAA,EACxD,WAAO,gBAAI,QAAS;AAAA,EACpB,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,UAAU,CAAC;AAAA,EACX,QAAQ,mBAAAA;AAAA,EACR,MAAM,CAAE,GAAG,GAAG,cAAe;AAC5B,UAAM,QAAQ,EAAE,WAAW,SAAU,CAAE,GAAG,QAAQ;AAClD,UAAM,QAAQ,EAAE,WAAW,SAAU,CAAE,GAAG,QAAQ;AAElD,WAAO,cAAc,QAClB,MAAM,cAAe,KAAM,IAC3B,MAAM,cAAe,KAAM;AAAA,EAC/B;AAAA,EAEA,UAAU;AAAA,IACT,WAAW,CAAE,SAAS,QAAS;AAAA,EAChC;AACD;AAKA,IAAO,iBAAQ;",
6
+ "names": ["AuthorView"]
7
+ }
@@ -1,39 +1,49 @@
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 comment_status_exports = {};
20
+ __export(comment_status_exports, {
21
+ default: () => comment_status_default
5
22
  });
6
- exports.default = void 0;
7
- var _i18n = require("@wordpress/i18n");
8
- /**
9
- * WordPress dependencies
10
- */
11
-
12
- /**
13
- * Internal dependencies
14
- */
15
-
23
+ module.exports = __toCommonJS(comment_status_exports);
24
+ var import_i18n = require("@wordpress/i18n");
16
25
  const commentStatusField = {
17
- id: 'comment_status',
18
- label: (0, _i18n.__)('Comments'),
19
- type: 'text',
20
- Edit: 'radio',
26
+ id: "comment_status",
27
+ label: (0, import_i18n.__)("Comments"),
28
+ type: "text",
29
+ Edit: "radio",
21
30
  enableSorting: false,
22
31
  enableHiding: false,
23
32
  filterBy: false,
24
- elements: [{
25
- value: 'open',
26
- label: (0, _i18n.__)('Open'),
27
- description: (0, _i18n.__)('Visitors can add new comments and replies.')
28
- }, {
29
- value: 'closed',
30
- label: (0, _i18n.__)('Closed'),
31
- description: (0, _i18n.__)('Visitors cannot add new comments or replies. Existing comments remain visible.')
32
- }]
33
+ elements: [
34
+ {
35
+ value: "open",
36
+ label: (0, import_i18n.__)("Open"),
37
+ description: (0, import_i18n.__)("Visitors can add new comments and replies.")
38
+ },
39
+ {
40
+ value: "closed",
41
+ label: (0, import_i18n.__)("Closed"),
42
+ description: (0, import_i18n.__)(
43
+ "Visitors cannot add new comments or replies. Existing comments remain visible."
44
+ )
45
+ }
46
+ ]
33
47
  };
34
-
35
- /**
36
- * Comment status field for BasePost.
37
- */
38
- var _default = exports.default = commentStatusField;
39
- //# sourceMappingURL=index.js.map
48
+ var comment_status_default = commentStatusField;
49
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_i18n","require","commentStatusField","id","label","__","type","Edit","enableSorting","enableHiding","filterBy","elements","value","description","_default","exports","default"],"sources":["@wordpress/fields/src/fields/comment-status/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport type { Field } from '@wordpress/dataviews';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nconst commentStatusField: Field< BasePost > = {\n\tid: 'comment_status',\n\tlabel: __( 'Comments' ),\n\ttype: 'text',\n\tEdit: 'radio',\n\tenableSorting: false,\n\tenableHiding: false,\n\tfilterBy: false,\n\telements: [\n\t\t{\n\t\t\tvalue: 'open',\n\t\t\tlabel: __( 'Open' ),\n\t\t\tdescription: __( 'Visitors can add new comments and replies.' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'closed',\n\t\t\tlabel: __( 'Closed' ),\n\t\t\tdescription: __(\n\t\t\t\t'Visitors cannot add new comments or replies. Existing comments remain visible.'\n\t\t\t),\n\t\t},\n\t],\n};\n\n/**\n * Comment status field for BasePost.\n */\nexport default commentStatusField;\n"],"mappings":";;;;;;AAIA,IAAAA,KAAA,GAAAC,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;;AAGA,MAAMC,kBAAqC,GAAG;EAC7CC,EAAE,EAAE,gBAAgB;EACpBC,KAAK,EAAE,IAAAC,QAAE,EAAE,UAAW,CAAC;EACvBC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,OAAO;EACbC,aAAa,EAAE,KAAK;EACpBC,YAAY,EAAE,KAAK;EACnBC,QAAQ,EAAE,KAAK;EACfC,QAAQ,EAAE,CACT;IACCC,KAAK,EAAE,MAAM;IACbR,KAAK,EAAE,IAAAC,QAAE,EAAE,MAAO,CAAC;IACnBQ,WAAW,EAAE,IAAAR,QAAE,EAAE,4CAA6C;EAC/D,CAAC,EACD;IACCO,KAAK,EAAE,QAAQ;IACfR,KAAK,EAAE,IAAAC,QAAE,EAAE,QAAS,CAAC;IACrBQ,WAAW,EAAE,IAAAR,QAAE,EACd,gFACD;EACD,CAAC;AAEH,CAAC;;AAED;AACA;AACA;AAFA,IAAAS,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGed,kBAAkB","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/fields/comment-status/index.tsx"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport type { Field } from '@wordpress/dataviews';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nconst commentStatusField: Field< BasePost > = {\n\tid: 'comment_status',\n\tlabel: __( 'Comments' ),\n\ttype: 'text',\n\tEdit: 'radio',\n\tenableSorting: false,\n\tenableHiding: false,\n\tfilterBy: false,\n\telements: [\n\t\t{\n\t\t\tvalue: 'open',\n\t\t\tlabel: __( 'Open' ),\n\t\t\tdescription: __( 'Visitors can add new comments and replies.' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'closed',\n\t\t\tlabel: __( 'Closed' ),\n\t\t\tdescription: __(\n\t\t\t\t'Visitors cannot add new comments or replies. Existing comments remain visible.'\n\t\t\t),\n\t\t},\n\t],\n};\n\n/**\n * Comment status field for BasePost.\n */\nexport default commentStatusField;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAmB;AAOnB,MAAM,qBAAwC;AAAA,EAC7C,IAAI;AAAA,EACJ,WAAO,gBAAI,UAAW;AAAA,EACtB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,eAAe;AAAA,EACf,cAAc;AAAA,EACd,UAAU;AAAA,EACV,UAAU;AAAA,IACT;AAAA,MACC,OAAO;AAAA,MACP,WAAO,gBAAI,MAAO;AAAA,MAClB,iBAAa,gBAAI,4CAA6C;AAAA,IAC/D;AAAA,IACA;AAAA,MACC,OAAO;AAAA,MACP,WAAO,gBAAI,QAAS;AAAA,MACpB,iBAAa;AAAA,QACZ;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAKA,IAAO,yBAAQ;",
6
+ "names": []
7
+ }
@@ -1,69 +1,95 @@
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 date_view_exports = {};
20
+ __export(date_view_exports, {
21
+ default: () => date_view_default
5
22
  });
6
- exports.default = void 0;
7
- var _i18n = require("@wordpress/i18n");
8
- var _element = require("@wordpress/element");
9
- var _date = require("@wordpress/date");
10
- var _jsxRuntime = require("react/jsx-runtime");
11
- /**
12
- * WordPress dependencies
13
- */
14
-
15
- /**
16
- * Internal dependencies
17
- */
18
-
19
- const getFormattedDate = dateToDisplay => (0, _date.dateI18n)((0, _date.getSettings)().formats.datetimeAbbreviated, (0, _date.getDate)(dateToDisplay));
20
- const DateView = ({
21
- item
22
- }) => {
23
- var _item$status, _item$modified, _item$date4, _item$date5;
24
- const isDraftOrPrivate = ['draft', 'private'].includes((_item$status = item.status) !== null && _item$status !== void 0 ? _item$status : '');
23
+ module.exports = __toCommonJS(date_view_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
25
+ var import_i18n = require("@wordpress/i18n");
26
+ var import_element = require("@wordpress/element");
27
+ var import_date = require("@wordpress/date");
28
+ const getFormattedDate = (dateToDisplay) => (0, import_date.dateI18n)(
29
+ (0, import_date.getSettings)().formats.datetimeAbbreviated,
30
+ (0, import_date.getDate)(dateToDisplay)
31
+ );
32
+ const DateView = ({ item }) => {
33
+ const isDraftOrPrivate = ["draft", "private"].includes(
34
+ item.status ?? ""
35
+ );
25
36
  if (isDraftOrPrivate) {
26
- var _item$date;
27
- return (0, _element.createInterpolateElement)((0, _i18n.sprintf)(/* translators: %s: page creation or modification date. */
28
- (0, _i18n.__)('<span>Modified: <time>%s</time></span>'), getFormattedDate((_item$date = item.date) !== null && _item$date !== void 0 ? _item$date : null)), {
29
- span: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {}),
30
- time: /*#__PURE__*/(0, _jsxRuntime.jsx)("time", {})
31
- });
37
+ return (0, import_element.createInterpolateElement)(
38
+ (0, import_i18n.sprintf)(
39
+ /* translators: %s: page creation or modification date. */
40
+ (0, import_i18n.__)("<span>Modified: <time>%s</time></span>"),
41
+ getFormattedDate(item.date ?? null)
42
+ ),
43
+ {
44
+ span: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {}),
45
+ time: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("time", {})
46
+ }
47
+ );
32
48
  }
33
- const isScheduled = item.status === 'future';
49
+ const isScheduled = item.status === "future";
34
50
  if (isScheduled) {
35
- var _item$date2;
36
- return (0, _element.createInterpolateElement)((0, _i18n.sprintf)(/* translators: %s: page creation date */
37
- (0, _i18n.__)('<span>Scheduled: <time>%s</time></span>'), getFormattedDate((_item$date2 = item.date) !== null && _item$date2 !== void 0 ? _item$date2 : null)), {
38
- span: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {}),
39
- time: /*#__PURE__*/(0, _jsxRuntime.jsx)("time", {})
40
- });
51
+ return (0, import_element.createInterpolateElement)(
52
+ (0, import_i18n.sprintf)(
53
+ /* translators: %s: page creation date */
54
+ (0, import_i18n.__)("<span>Scheduled: <time>%s</time></span>"),
55
+ getFormattedDate(item.date ?? null)
56
+ ),
57
+ {
58
+ span: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {}),
59
+ time: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("time", {})
60
+ }
61
+ );
41
62
  }
42
- const isPublished = item.status === 'publish';
63
+ const isPublished = item.status === "publish";
43
64
  if (isPublished) {
44
- var _item$date3;
45
- return (0, _element.createInterpolateElement)((0, _i18n.sprintf)(/* translators: %s: page creation time */
46
- (0, _i18n.__)('<span>Published: <time>%s</time></span>'), getFormattedDate((_item$date3 = item.date) !== null && _item$date3 !== void 0 ? _item$date3 : null)), {
47
- span: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {}),
48
- time: /*#__PURE__*/(0, _jsxRuntime.jsx)("time", {})
49
- });
65
+ return (0, import_element.createInterpolateElement)(
66
+ (0, import_i18n.sprintf)(
67
+ /* translators: %s: page creation time */
68
+ (0, import_i18n.__)("<span>Published: <time>%s</time></span>"),
69
+ getFormattedDate(item.date ?? null)
70
+ ),
71
+ {
72
+ span: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {}),
73
+ time: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("time", {})
74
+ }
75
+ );
50
76
  }
51
-
52
- // Pending posts show the modified date if it's newer.
53
- const dateToDisplay = (0, _date.getDate)((_item$modified = item.modified) !== null && _item$modified !== void 0 ? _item$modified : null) > (0, _date.getDate)((_item$date4 = item.date) !== null && _item$date4 !== void 0 ? _item$date4 : null) ? item.modified : item.date;
54
- const isPending = item.status === 'pending';
77
+ const dateToDisplay = (0, import_date.getDate)(item.modified ?? null) > (0, import_date.getDate)(item.date ?? null) ? item.modified : item.date;
78
+ const isPending = item.status === "pending";
55
79
  if (isPending) {
56
- return (0, _element.createInterpolateElement)((0, _i18n.sprintf)(/* translators: %s: page creation or modification date. */
57
- (0, _i18n.__)('<span>Modified: <time>%s</time></span>'), getFormattedDate(dateToDisplay !== null && dateToDisplay !== void 0 ? dateToDisplay : null)), {
58
- span: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {}),
59
- time: /*#__PURE__*/(0, _jsxRuntime.jsx)("time", {})
60
- });
80
+ return (0, import_element.createInterpolateElement)(
81
+ (0, import_i18n.sprintf)(
82
+ /* translators: %s: page creation or modification date. */
83
+ (0, import_i18n.__)("<span>Modified: <time>%s</time></span>"),
84
+ getFormattedDate(dateToDisplay ?? null)
85
+ ),
86
+ {
87
+ span: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {}),
88
+ time: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("time", {})
89
+ }
90
+ );
61
91
  }
62
-
63
- // Unknow status.
64
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("time", {
65
- children: getFormattedDate((_item$date5 = item.date) !== null && _item$date5 !== void 0 ? _item$date5 : null)
66
- });
92
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("time", { children: getFormattedDate(item.date ?? null) });
67
93
  };
68
- var _default = exports.default = DateView;
69
- //# sourceMappingURL=date-view.js.map
94
+ var date_view_default = DateView;
95
+ //# sourceMappingURL=date-view.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_i18n","require","_element","_date","_jsxRuntime","getFormattedDate","dateToDisplay","dateI18n","getSettings","formats","datetimeAbbreviated","getDate","DateView","item","_item$status","_item$modified","_item$date4","_item$date5","isDraftOrPrivate","includes","status","_item$date","createInterpolateElement","sprintf","__","date","span","jsx","time","isScheduled","_item$date2","isPublished","_item$date3","modified","isPending","children","_default","exports","default"],"sources":["@wordpress/fields/src/fields/date/date-view.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { dateI18n, getDate, getSettings } from '@wordpress/date';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nconst getFormattedDate = ( dateToDisplay: string | null ) =>\n\tdateI18n(\n\t\tgetSettings().formats.datetimeAbbreviated,\n\t\tgetDate( dateToDisplay )\n\t);\n\nconst DateView = ( { item }: { item: BasePost } ) => {\n\tconst isDraftOrPrivate = [ 'draft', 'private' ].includes(\n\t\titem.status ?? ''\n\t);\n\tif ( isDraftOrPrivate ) {\n\t\treturn createInterpolateElement(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: page creation or modification date. */\n\t\t\t\t__( '<span>Modified: <time>%s</time></span>' ),\n\t\t\t\tgetFormattedDate( item.date ?? null )\n\t\t\t),\n\t\t\t{\n\t\t\t\tspan: <span />,\n\t\t\t\ttime: <time />,\n\t\t\t}\n\t\t);\n\t}\n\n\tconst isScheduled = item.status === 'future';\n\tif ( isScheduled ) {\n\t\treturn createInterpolateElement(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: page creation date */\n\t\t\t\t__( '<span>Scheduled: <time>%s</time></span>' ),\n\t\t\t\tgetFormattedDate( item.date ?? null )\n\t\t\t),\n\t\t\t{\n\t\t\t\tspan: <span />,\n\t\t\t\ttime: <time />,\n\t\t\t}\n\t\t);\n\t}\n\n\tconst isPublished = item.status === 'publish';\n\tif ( isPublished ) {\n\t\treturn createInterpolateElement(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: page creation time */\n\t\t\t\t__( '<span>Published: <time>%s</time></span>' ),\n\t\t\t\tgetFormattedDate( item.date ?? null )\n\t\t\t),\n\t\t\t{\n\t\t\t\tspan: <span />,\n\t\t\t\ttime: <time />,\n\t\t\t}\n\t\t);\n\t}\n\n\t// Pending posts show the modified date if it's newer.\n\tconst dateToDisplay =\n\t\tgetDate( item.modified ?? null ) > getDate( item.date ?? null )\n\t\t\t? item.modified\n\t\t\t: item.date;\n\n\tconst isPending = item.status === 'pending';\n\tif ( isPending ) {\n\t\treturn createInterpolateElement(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: page creation or modification date. */\n\t\t\t\t__( '<span>Modified: <time>%s</time></span>' ),\n\t\t\t\tgetFormattedDate( dateToDisplay ?? null )\n\t\t\t),\n\t\t\t{\n\t\t\t\tspan: <span />,\n\t\t\t\ttime: <time />,\n\t\t\t}\n\t\t);\n\t}\n\n\t// Unknow status.\n\treturn <time>{ getFormattedDate( item.date ?? null ) }</time>;\n};\n\nexport default DateView;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAAiE,IAAAG,WAAA,GAAAH,OAAA;AALjE;AACA;AACA;;AAKA;AACA;AACA;;AAGA,MAAMI,gBAAgB,GAAKC,aAA4B,IACtD,IAAAC,cAAQ,EACP,IAAAC,iBAAW,EAAC,CAAC,CAACC,OAAO,CAACC,mBAAmB,EACzC,IAAAC,aAAO,EAAEL,aAAc,CACxB,CAAC;AAEF,MAAMM,QAAQ,GAAGA,CAAE;EAAEC;AAAyB,CAAC,KAAM;EAAA,IAAAC,YAAA,EAAAC,cAAA,EAAAC,WAAA,EAAAC,WAAA;EACpD,MAAMC,gBAAgB,GAAG,CAAE,OAAO,EAAE,SAAS,CAAE,CAACC,QAAQ,EAAAL,YAAA,GACvDD,IAAI,CAACO,MAAM,cAAAN,YAAA,cAAAA,YAAA,GAAI,EAChB,CAAC;EACD,IAAKI,gBAAgB,EAAG;IAAA,IAAAG,UAAA;IACvB,OAAO,IAAAC,iCAAwB,EAC9B,IAAAC,aAAO,EACN;IACA,IAAAC,QAAE,EAAE,wCAAyC,CAAC,EAC9CnB,gBAAgB,EAAAgB,UAAA,GAAER,IAAI,CAACY,IAAI,cAAAJ,UAAA,cAAAA,UAAA,GAAI,IAAK,CACrC,CAAC,EACD;MACCK,IAAI,eAAE,IAAAtB,WAAA,CAAAuB,GAAA,YAAO,CAAC;MACdC,IAAI,eAAE,IAAAxB,WAAA,CAAAuB,GAAA,YAAO;IACd,CACD,CAAC;EACF;EAEA,MAAME,WAAW,GAAGhB,IAAI,CAACO,MAAM,KAAK,QAAQ;EAC5C,IAAKS,WAAW,EAAG;IAAA,IAAAC,WAAA;IAClB,OAAO,IAAAR,iCAAwB,EAC9B,IAAAC,aAAO,EACN;IACA,IAAAC,QAAE,EAAE,yCAA0C,CAAC,EAC/CnB,gBAAgB,EAAAyB,WAAA,GAAEjB,IAAI,CAACY,IAAI,cAAAK,WAAA,cAAAA,WAAA,GAAI,IAAK,CACrC,CAAC,EACD;MACCJ,IAAI,eAAE,IAAAtB,WAAA,CAAAuB,GAAA,YAAO,CAAC;MACdC,IAAI,eAAE,IAAAxB,WAAA,CAAAuB,GAAA,YAAO;IACd,CACD,CAAC;EACF;EAEA,MAAMI,WAAW,GAAGlB,IAAI,CAACO,MAAM,KAAK,SAAS;EAC7C,IAAKW,WAAW,EAAG;IAAA,IAAAC,WAAA;IAClB,OAAO,IAAAV,iCAAwB,EAC9B,IAAAC,aAAO,EACN;IACA,IAAAC,QAAE,EAAE,yCAA0C,CAAC,EAC/CnB,gBAAgB,EAAA2B,WAAA,GAAEnB,IAAI,CAACY,IAAI,cAAAO,WAAA,cAAAA,WAAA,GAAI,IAAK,CACrC,CAAC,EACD;MACCN,IAAI,eAAE,IAAAtB,WAAA,CAAAuB,GAAA,YAAO,CAAC;MACdC,IAAI,eAAE,IAAAxB,WAAA,CAAAuB,GAAA,YAAO;IACd,CACD,CAAC;EACF;;EAEA;EACA,MAAMrB,aAAa,GAClB,IAAAK,aAAO,GAAAI,cAAA,GAAEF,IAAI,CAACoB,QAAQ,cAAAlB,cAAA,cAAAA,cAAA,GAAI,IAAK,CAAC,GAAG,IAAAJ,aAAO,GAAAK,WAAA,GAAEH,IAAI,CAACY,IAAI,cAAAT,WAAA,cAAAA,WAAA,GAAI,IAAK,CAAC,GAC5DH,IAAI,CAACoB,QAAQ,GACbpB,IAAI,CAACY,IAAI;EAEb,MAAMS,SAAS,GAAGrB,IAAI,CAACO,MAAM,KAAK,SAAS;EAC3C,IAAKc,SAAS,EAAG;IAChB,OAAO,IAAAZ,iCAAwB,EAC9B,IAAAC,aAAO,EACN;IACA,IAAAC,QAAE,EAAE,wCAAyC,CAAC,EAC9CnB,gBAAgB,CAAEC,aAAa,aAAbA,aAAa,cAAbA,aAAa,GAAI,IAAK,CACzC,CAAC,EACD;MACCoB,IAAI,eAAE,IAAAtB,WAAA,CAAAuB,GAAA,YAAO,CAAC;MACdC,IAAI,eAAE,IAAAxB,WAAA,CAAAuB,GAAA,YAAO;IACd,CACD,CAAC;EACF;;EAEA;EACA,oBAAO,IAAAvB,WAAA,CAAAuB,GAAA;IAAAQ,QAAA,EAAQ9B,gBAAgB,EAAAY,WAAA,GAAEJ,IAAI,CAACY,IAAI,cAAAR,WAAA,cAAAA,WAAA,GAAI,IAAK;EAAC,CAAQ,CAAC;AAC9D,CAAC;AAAC,IAAAmB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa1B,QAAQ","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/fields/date/date-view.tsx"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { dateI18n, getDate, getSettings } from '@wordpress/date';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nconst getFormattedDate = ( dateToDisplay: string | null ) =>\n\tdateI18n(\n\t\tgetSettings().formats.datetimeAbbreviated,\n\t\tgetDate( dateToDisplay )\n\t);\n\nconst DateView = ( { item }: { item: BasePost } ) => {\n\tconst isDraftOrPrivate = [ 'draft', 'private' ].includes(\n\t\titem.status ?? ''\n\t);\n\tif ( isDraftOrPrivate ) {\n\t\treturn createInterpolateElement(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: page creation or modification date. */\n\t\t\t\t__( '<span>Modified: <time>%s</time></span>' ),\n\t\t\t\tgetFormattedDate( item.date ?? null )\n\t\t\t),\n\t\t\t{\n\t\t\t\tspan: <span />,\n\t\t\t\ttime: <time />,\n\t\t\t}\n\t\t);\n\t}\n\n\tconst isScheduled = item.status === 'future';\n\tif ( isScheduled ) {\n\t\treturn createInterpolateElement(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: page creation date */\n\t\t\t\t__( '<span>Scheduled: <time>%s</time></span>' ),\n\t\t\t\tgetFormattedDate( item.date ?? null )\n\t\t\t),\n\t\t\t{\n\t\t\t\tspan: <span />,\n\t\t\t\ttime: <time />,\n\t\t\t}\n\t\t);\n\t}\n\n\tconst isPublished = item.status === 'publish';\n\tif ( isPublished ) {\n\t\treturn createInterpolateElement(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: page creation time */\n\t\t\t\t__( '<span>Published: <time>%s</time></span>' ),\n\t\t\t\tgetFormattedDate( item.date ?? null )\n\t\t\t),\n\t\t\t{\n\t\t\t\tspan: <span />,\n\t\t\t\ttime: <time />,\n\t\t\t}\n\t\t);\n\t}\n\n\t// Pending posts show the modified date if it's newer.\n\tconst dateToDisplay =\n\t\tgetDate( item.modified ?? null ) > getDate( item.date ?? null )\n\t\t\t? item.modified\n\t\t\t: item.date;\n\n\tconst isPending = item.status === 'pending';\n\tif ( isPending ) {\n\t\treturn createInterpolateElement(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: page creation or modification date. */\n\t\t\t\t__( '<span>Modified: <time>%s</time></span>' ),\n\t\t\t\tgetFormattedDate( dateToDisplay ?? null )\n\t\t\t),\n\t\t\t{\n\t\t\t\tspan: <span />,\n\t\t\t\ttime: <time />,\n\t\t\t}\n\t\t);\n\t}\n\n\t// Unknow status.\n\treturn <time>{ getFormattedDate( item.date ?? null ) }</time>;\n};\n\nexport default DateView;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BU;AA3BV,kBAA4B;AAC5B,qBAAyC;AACzC,kBAA+C;AAO/C,MAAM,mBAAmB,CAAE,sBAC1B;AAAA,MACC,yBAAY,EAAE,QAAQ;AAAA,MACtB,qBAAS,aAAc;AACxB;AAED,MAAM,WAAW,CAAE,EAAE,KAAK,MAA2B;AACpD,QAAM,mBAAmB,CAAE,SAAS,SAAU,EAAE;AAAA,IAC/C,KAAK,UAAU;AAAA,EAChB;AACA,MAAK,kBAAmB;AACvB,eAAO;AAAA,UACN;AAAA;AAAA,YAEC,gBAAI,wCAAyC;AAAA,QAC7C,iBAAkB,KAAK,QAAQ,IAAK;AAAA,MACrC;AAAA,MACA;AAAA,QACC,MAAM,4CAAC,UAAK;AAAA,QACZ,MAAM,4CAAC,UAAK;AAAA,MACb;AAAA,IACD;AAAA,EACD;AAEA,QAAM,cAAc,KAAK,WAAW;AACpC,MAAK,aAAc;AAClB,eAAO;AAAA,UACN;AAAA;AAAA,YAEC,gBAAI,yCAA0C;AAAA,QAC9C,iBAAkB,KAAK,QAAQ,IAAK;AAAA,MACrC;AAAA,MACA;AAAA,QACC,MAAM,4CAAC,UAAK;AAAA,QACZ,MAAM,4CAAC,UAAK;AAAA,MACb;AAAA,IACD;AAAA,EACD;AAEA,QAAM,cAAc,KAAK,WAAW;AACpC,MAAK,aAAc;AAClB,eAAO;AAAA,UACN;AAAA;AAAA,YAEC,gBAAI,yCAA0C;AAAA,QAC9C,iBAAkB,KAAK,QAAQ,IAAK;AAAA,MACrC;AAAA,MACA;AAAA,QACC,MAAM,4CAAC,UAAK;AAAA,QACZ,MAAM,4CAAC,UAAK;AAAA,MACb;AAAA,IACD;AAAA,EACD;AAGA,QAAM,oBACL,qBAAS,KAAK,YAAY,IAAK,QAAI,qBAAS,KAAK,QAAQ,IAAK,IAC3D,KAAK,WACL,KAAK;AAET,QAAM,YAAY,KAAK,WAAW;AAClC,MAAK,WAAY;AAChB,eAAO;AAAA,UACN;AAAA;AAAA,YAEC,gBAAI,wCAAyC;AAAA,QAC7C,iBAAkB,iBAAiB,IAAK;AAAA,MACzC;AAAA,MACA;AAAA,QACC,MAAM,4CAAC,UAAK;AAAA,QACZ,MAAM,4CAAC,UAAK;AAAA,MACb;AAAA,IACD;AAAA,EACD;AAGA,SAAO,4CAAC,UAAO,2BAAkB,KAAK,QAAQ,IAAK,GAAG;AACvD;AAEA,IAAO,oBAAQ;",
6
+ "names": []
7
+ }
@@ -1,30 +1,44 @@
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 date_exports = {};
30
+ __export(date_exports, {
31
+ default: () => date_default
6
32
  });
7
- exports.default = void 0;
8
- var _i18n = require("@wordpress/i18n");
9
- var _dateView = _interopRequireDefault(require("./date-view"));
10
- /**
11
- * WordPress dependencies
12
- */
13
-
14
- /**
15
- * Internal dependencies
16
- */
17
-
33
+ module.exports = __toCommonJS(date_exports);
34
+ var import_i18n = require("@wordpress/i18n");
35
+ var import_date_view = __toESM(require("./date-view"));
18
36
  const dateField = {
19
- id: 'date',
20
- type: 'datetime',
21
- label: (0, _i18n.__)('Date'),
22
- render: _dateView.default,
37
+ id: "date",
38
+ type: "datetime",
39
+ label: (0, import_i18n.__)("Date"),
40
+ render: import_date_view.default,
23
41
  filterBy: false
24
42
  };
25
-
26
- /**
27
- * Date field for BasePost.
28
- */
29
- var _default = exports.default = dateField;
30
- //# sourceMappingURL=index.js.map
43
+ var date_default = dateField;
44
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_i18n","require","_dateView","_interopRequireDefault","dateField","id","type","label","__","render","DateView","filterBy","_default","exports","default"],"sources":["@wordpress/fields/src/fields/date/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport type { Field } from '@wordpress/dataviews';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\nimport DateView from './date-view';\n\nconst dateField: Field< BasePost > = {\n\tid: 'date',\n\ttype: 'datetime',\n\tlabel: __( 'Date' ),\n\trender: DateView,\n\tfilterBy: false,\n};\n\n/**\n * Date field for BasePost.\n */\nexport default dateField;\n"],"mappings":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,MAAMG,SAA4B,GAAG;EACpCC,EAAE,EAAE,MAAM;EACVC,IAAI,EAAE,UAAU;EAChBC,KAAK,EAAE,IAAAC,QAAE,EAAE,MAAO,CAAC;EACnBC,MAAM,EAAEC,iBAAQ;EAChBC,QAAQ,EAAE;AACX,CAAC;;AAED;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGeV,SAAS","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/fields/date/index.tsx"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport type { Field } from '@wordpress/dataviews';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\nimport DateView from './date-view';\n\nconst dateField: Field< BasePost > = {\n\tid: 'date',\n\ttype: 'datetime',\n\tlabel: __( 'Date' ),\n\trender: DateView,\n\tfilterBy: false,\n};\n\n/**\n * Date field for BasePost.\n */\nexport default dateField;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAmB;AAMnB,uBAAqB;AAErB,MAAM,YAA+B;AAAA,EACpC,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,WAAO,gBAAI,MAAO;AAAA,EAClB,QAAQ,iBAAAA;AAAA,EACR,UAAU;AACX;AAKA,IAAO,eAAQ;",
6
+ "names": ["DateView"]
7
+ }