@wordpress/block-library 9.26.1-next.719a03cbe.0 → 9.27.1-next.46f643fa0.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 (170) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/categories/edit.js +15 -3
  3. package/build/categories/edit.js.map +1 -1
  4. package/build/cover/edit/block-controls.js +4 -2
  5. package/build/cover/edit/block-controls.js.map +1 -1
  6. package/build/cover/edit/index.js +6 -3
  7. package/build/cover/edit/index.js.map +1 -1
  8. package/build/cover/edit/inspector-controls.js +13 -4
  9. package/build/cover/edit/inspector-controls.js.map +1 -1
  10. package/build/cover/index.js +6 -0
  11. package/build/cover/index.js.map +1 -1
  12. package/build/cover/save.js +3 -1
  13. package/build/cover/save.js.map +1 -1
  14. package/build/file/edit.js +2 -1
  15. package/build/file/edit.js.map +1 -1
  16. package/build/latest-posts/edit.js +0 -2
  17. package/build/latest-posts/edit.js.map +1 -1
  18. package/build/media-text/edit.js +2 -2
  19. package/build/media-text/edit.js.map +1 -1
  20. package/build/navigation-link/edit.js +32 -15
  21. package/build/navigation-link/edit.js.map +1 -1
  22. package/build/navigation-link/update-attributes.js +112 -14
  23. package/build/navigation-link/update-attributes.js.map +1 -1
  24. package/build/navigation-submenu/edit.js +19 -2
  25. package/build/navigation-submenu/edit.js.map +1 -1
  26. package/build/paragraph/edit.js +2 -2
  27. package/build/paragraph/edit.js.map +1 -1
  28. package/build/post-content/edit.js +78 -16
  29. package/build/post-content/edit.js.map +1 -1
  30. package/build/post-content/index.js +6 -0
  31. package/build/post-content/index.js.map +1 -1
  32. package/build/post-date/deprecated.js +104 -1
  33. package/build/post-date/deprecated.js.map +1 -1
  34. package/build/post-date/edit.js +32 -32
  35. package/build/post-date/edit.js.map +1 -1
  36. package/build/post-date/index.js +4 -4
  37. package/build/post-date/index.js.map +1 -1
  38. package/build/post-date/variations.js +32 -3
  39. package/build/post-date/variations.js.map +1 -1
  40. package/build/separator/edit.js +5 -30
  41. package/build/separator/edit.js.map +1 -1
  42. package/build/site-tagline/index.js +1 -1
  43. package/build/social-link/variations.js +51 -49
  44. package/build/social-link/variations.js.map +1 -1
  45. package/build/utils/poster-image.js +93 -0
  46. package/build/utils/poster-image.js.map +1 -0
  47. package/build/video/edit.js +7 -6
  48. package/build/video/edit.js.map +1 -1
  49. package/build/video/tracks-editor.js +95 -104
  50. package/build/video/tracks-editor.js.map +1 -1
  51. package/build/video/tracks.js +6 -2
  52. package/build/video/tracks.js.map +1 -1
  53. package/build-module/categories/edit.js +15 -3
  54. package/build-module/categories/edit.js.map +1 -1
  55. package/build-module/cover/edit/block-controls.js +4 -2
  56. package/build-module/cover/edit/block-controls.js.map +1 -1
  57. package/build-module/cover/edit/index.js +6 -3
  58. package/build-module/cover/edit/index.js.map +1 -1
  59. package/build-module/cover/edit/inspector-controls.js +12 -4
  60. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  61. package/build-module/cover/index.js +6 -0
  62. package/build-module/cover/index.js.map +1 -1
  63. package/build-module/cover/save.js +3 -1
  64. package/build-module/cover/save.js.map +1 -1
  65. package/build-module/file/edit.js +2 -1
  66. package/build-module/file/edit.js.map +1 -1
  67. package/build-module/latest-posts/edit.js +0 -2
  68. package/build-module/latest-posts/edit.js.map +1 -1
  69. package/build-module/media-text/edit.js +2 -2
  70. package/build-module/media-text/edit.js.map +1 -1
  71. package/build-module/navigation-link/edit.js +32 -15
  72. package/build-module/navigation-link/edit.js.map +1 -1
  73. package/build-module/navigation-link/update-attributes.js +113 -15
  74. package/build-module/navigation-link/update-attributes.js.map +1 -1
  75. package/build-module/navigation-submenu/edit.js +20 -3
  76. package/build-module/navigation-submenu/edit.js.map +1 -1
  77. package/build-module/paragraph/edit.js +2 -2
  78. package/build-module/paragraph/edit.js.map +1 -1
  79. package/build-module/post-content/edit.js +80 -18
  80. package/build-module/post-content/edit.js.map +1 -1
  81. package/build-module/post-content/index.js +6 -0
  82. package/build-module/post-content/index.js.map +1 -1
  83. package/build-module/post-date/deprecated.js +104 -1
  84. package/build-module/post-date/deprecated.js.map +1 -1
  85. package/build-module/post-date/edit.js +35 -35
  86. package/build-module/post-date/edit.js.map +1 -1
  87. package/build-module/post-date/index.js +4 -4
  88. package/build-module/post-date/index.js.map +1 -1
  89. package/build-module/post-date/variations.js +32 -3
  90. package/build-module/post-date/variations.js.map +1 -1
  91. package/build-module/separator/edit.js +6 -31
  92. package/build-module/separator/edit.js.map +1 -1
  93. package/build-module/site-tagline/index.js +1 -1
  94. package/build-module/social-link/variations.js +52 -50
  95. package/build-module/social-link/variations.js.map +1 -1
  96. package/build-module/utils/poster-image.js +85 -0
  97. package/build-module/utils/poster-image.js.map +1 -0
  98. package/build-module/video/edit.js +7 -6
  99. package/build-module/video/edit.js.map +1 -1
  100. package/build-module/video/tracks-editor.js +96 -105
  101. package/build-module/video/tracks-editor.js.map +1 -1
  102. package/build-module/video/tracks.js +6 -2
  103. package/build-module/video/tracks.js.map +1 -1
  104. package/build-style/archives/editor-rtl.css +0 -4
  105. package/build-style/archives/editor.css +0 -4
  106. package/build-style/editor-rtl.css +67 -18
  107. package/build-style/editor.css +67 -18
  108. package/build-style/file/style-rtl.css +1 -1
  109. package/build-style/file/style.css +1 -1
  110. package/build-style/navigation/editor-rtl.css +6 -6
  111. package/build-style/navigation/editor.css +6 -6
  112. package/build-style/navigation/style-rtl.css +1 -0
  113. package/build-style/navigation/style.css +1 -0
  114. package/build-style/page-list/editor-rtl.css +0 -4
  115. package/build-style/page-list/editor.css +0 -4
  116. package/build-style/style-rtl.css +3 -1
  117. package/build-style/style.css +3 -1
  118. package/build-style/video/editor-rtl.css +0 -4
  119. package/build-style/video/editor.css +0 -4
  120. package/build-style/video/style-rtl.css +1 -0
  121. package/build-style/video/style.css +1 -0
  122. package/package.json +35 -35
  123. package/src/archives/editor.scss +0 -4
  124. package/src/categories/edit.js +13 -1
  125. package/src/comments-pagination/index.php +7 -2
  126. package/src/cover/block.json +6 -0
  127. package/src/cover/edit/block-controls.js +22 -17
  128. package/src/cover/edit/index.js +4 -1
  129. package/src/cover/edit/inspector-controls.js +15 -2
  130. package/src/cover/save.js +2 -0
  131. package/src/editor.scss +1 -0
  132. package/src/file/edit.js +4 -1
  133. package/src/file/style.scss +1 -1
  134. package/src/latest-posts/edit.js +0 -2
  135. package/src/media-text/edit.js +1 -1
  136. package/src/navigation/style.scss +1 -0
  137. package/src/navigation-link/edit.js +28 -16
  138. package/src/navigation-link/test/edit.js +738 -6
  139. package/src/navigation-link/update-attributes.js +125 -12
  140. package/src/navigation-submenu/edit.js +21 -1
  141. package/src/page-list/editor.scss +0 -6
  142. package/src/paragraph/edit.js +2 -2
  143. package/src/post-content/block.json +6 -0
  144. package/src/post-content/edit.js +71 -19
  145. package/src/post-content/index.php +11 -4
  146. package/src/post-date/block.json +4 -4
  147. package/src/post-date/deprecated.js +104 -1
  148. package/src/post-date/edit.js +74 -86
  149. package/src/post-date/index.php +55 -28
  150. package/src/post-date/variations.js +37 -3
  151. package/src/post-featured-image/index.php +3 -2
  152. package/src/separator/edit.js +8 -43
  153. package/src/site-tagline/block.json +1 -1
  154. package/src/social-link/README.md +21 -0
  155. package/src/social-link/index.php +49 -49
  156. package/src/social-link/variations.js +51 -49
  157. package/src/utils/poster-image.js +131 -0
  158. package/src/utils/poster-image.scss +75 -0
  159. package/src/video/edit.js +8 -6
  160. package/src/video/editor.scss +0 -6
  161. package/src/video/index.php +91 -0
  162. package/src/video/style.native.scss +1 -0
  163. package/src/video/style.scss +1 -0
  164. package/src/video/tracks-editor.js +93 -103
  165. package/src/video/tracks.js +2 -1
  166. package/build/video/poster-image.js +0 -81
  167. package/build/video/poster-image.js.map +0 -1
  168. package/build-module/video/poster-image.js +0 -74
  169. package/build-module/video/poster-image.js.map +0 -1
  170. package/src/video/poster-image.js +0 -86
@@ -1 +1 @@
1
- {"version":3,"names":["_migrateFontFamily","_interopRequireDefault","require","v1","attributes","textAlign","type","format","isLink","default","supports","html","color","gradients","link","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalLetterSpacing","save","migrate","migrateFontFamily","isEligible","style","fontFamily","_default","exports"],"sources":["@wordpress/block-library/src/post-date/deprecated.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport migrateFontFamily from '../utils/migrate-font-family';\n\nconst v1 = {\n\tattributes: {\n\t\ttextAlign: {\n\t\t\ttype: 'string',\n\t\t},\n\t\tformat: {\n\t\t\ttype: 'string',\n\t\t},\n\t\tisLink: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t},\n\t},\n\tsupports: {\n\t\thtml: false,\n\t\tcolor: {\n\t\t\tgradients: true,\n\t\t\tlink: true,\n\t\t},\n\t\ttypography: {\n\t\t\tfontSize: true,\n\t\t\tlineHeight: true,\n\t\t\t__experimentalFontFamily: true,\n\t\t\t__experimentalFontWeight: true,\n\t\t\t__experimentalFontStyle: true,\n\t\t\t__experimentalTextTransform: true,\n\t\t\t__experimentalLetterSpacing: true,\n\t\t},\n\t},\n\tsave() {\n\t\treturn null;\n\t},\n\tmigrate: migrateFontFamily,\n\tisEligible( { style } ) {\n\t\treturn style?.typography?.fontFamily;\n\t},\n};\n\n/**\n * New deprecations need to be placed first\n * for them to have higher priority.\n *\n * Old deprecations may need to be updated as well.\n *\n * See block-deprecation.md\n */\nexport default [ v1 ];\n"],"mappings":";;;;;;;AAGA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,EAAE,GAAG;EACVC,UAAU,EAAE;IACXC,SAAS,EAAE;MACVC,IAAI,EAAE;IACP,CAAC;IACDC,MAAM,EAAE;MACPD,IAAI,EAAE;IACP,CAAC;IACDE,MAAM,EAAE;MACPF,IAAI,EAAE,SAAS;MACfG,OAAO,EAAE;IACV;EACD,CAAC;EACDC,QAAQ,EAAE;IACTC,IAAI,EAAE,KAAK;IACXC,KAAK,EAAE;MACNC,SAAS,EAAE,IAAI;MACfC,IAAI,EAAE;IACP,CAAC;IACDC,UAAU,EAAE;MACXC,QAAQ,EAAE,IAAI;MACdC,UAAU,EAAE,IAAI;MAChBC,wBAAwB,EAAE,IAAI;MAC9BC,wBAAwB,EAAE,IAAI;MAC9BC,uBAAuB,EAAE,IAAI;MAC7BC,2BAA2B,EAAE,IAAI;MACjCC,2BAA2B,EAAE;IAC9B;EACD,CAAC;EACDC,IAAIA,CAAA,EAAG;IACN,OAAO,IAAI;EACZ,CAAC;EACDC,OAAO,EAAEC,0BAAiB;EAC1BC,UAAUA,CAAE;IAAEC;EAAM,CAAC,EAAG;IACvB,OAAOA,KAAK,EAAEZ,UAAU,EAAEa,UAAU;EACrC;AACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAC,QAAA,GAAAC,OAAA,CAAArB,OAAA,GAQe,CAAEN,EAAE,CAAE","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_migrateFontFamily","v2","attributes","textAlign","type","format","isLink","default","role","displayType","supports","html","color","gradients","link","__experimentalDefaultControls","background","text","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","interactivity","clientNavigation","__experimentalBorder","radius","width","style","save","migrate","className","metadata","otherAttributes","clsx","bindings","datetime","source","args","key","isEligible","v1","migrateFontFamily","fontFamily","_default","exports"],"sources":["@wordpress/block-library/src/post-date/deprecated.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport migrateFontFamily from '../utils/migrate-font-family';\n\nconst v2 = {\n\tattributes: {\n\t\ttextAlign: {\n\t\t\ttype: 'string',\n\t\t},\n\t\tformat: {\n\t\t\ttype: 'string',\n\t\t},\n\t\tisLink: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\trole: 'content',\n\t\t},\n\t\tdisplayType: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'date',\n\t\t},\n\t},\n\tsupports: {\n\t\thtml: false,\n\t\tcolor: {\n\t\t\tgradients: true,\n\t\t\tlink: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tbackground: true,\n\t\t\t\ttext: true,\n\t\t\t\tlink: true,\n\t\t\t},\n\t\t},\n\t\tspacing: {\n\t\t\tmargin: true,\n\t\t\tpadding: true,\n\t\t},\n\t\ttypography: {\n\t\t\tfontSize: true,\n\t\t\tlineHeight: true,\n\t\t\t__experimentalFontFamily: true,\n\t\t\t__experimentalFontWeight: true,\n\t\t\t__experimentalFontStyle: true,\n\t\t\t__experimentalTextTransform: true,\n\t\t\t__experimentalTextDecoration: true,\n\t\t\t__experimentalLetterSpacing: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tfontSize: true,\n\t\t\t},\n\t\t},\n\t\tinteractivity: {\n\t\t\tclientNavigation: true,\n\t\t},\n\t\t__experimentalBorder: {\n\t\t\tradius: true,\n\t\t\tcolor: true,\n\t\t\twidth: true,\n\t\t\tstyle: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tradius: true,\n\t\t\t\tcolor: true,\n\t\t\t\twidth: true,\n\t\t\t\tstyle: true,\n\t\t\t},\n\t\t},\n\t},\n\tsave() {\n\t\treturn null;\n\t},\n\tmigrate( { className, displayType, metadata, ...otherAttributes } ) {\n\t\tif ( displayType === 'date' || displayType === 'modified' ) {\n\t\t\tif ( displayType === 'modified' ) {\n\t\t\t\tclassName = clsx(\n\t\t\t\t\tclassName,\n\t\t\t\t\t'wp-block-post-date__modified-date'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...otherAttributes,\n\t\t\t\tclassName,\n\t\t\t\tmetadata: {\n\t\t\t\t\t...metadata,\n\t\t\t\t\tbindings: {\n\t\t\t\t\t\tdatetime: {\n\t\t\t\t\t\t\tsource: 'core/post-data',\n\t\t\t\t\t\t\targs: { key: displayType },\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t},\n\tisEligible( attributes ) {\n\t\t// If there's neither an explicit `datetime` attribute nor a block binding for that attribute,\n\t\t// then we're dealing with an old version of the block.\n\t\treturn (\n\t\t\t! attributes.datetime && ! attributes?.metadata?.bindings?.datetime\n\t\t);\n\t},\n};\n\nconst v1 = {\n\tattributes: {\n\t\ttextAlign: {\n\t\t\ttype: 'string',\n\t\t},\n\t\tformat: {\n\t\t\ttype: 'string',\n\t\t},\n\t\tisLink: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t},\n\t},\n\tsupports: {\n\t\thtml: false,\n\t\tcolor: {\n\t\t\tgradients: true,\n\t\t\tlink: true,\n\t\t},\n\t\ttypography: {\n\t\t\tfontSize: true,\n\t\t\tlineHeight: true,\n\t\t\t__experimentalFontFamily: true,\n\t\t\t__experimentalFontWeight: true,\n\t\t\t__experimentalFontStyle: true,\n\t\t\t__experimentalTextTransform: true,\n\t\t\t__experimentalLetterSpacing: true,\n\t\t},\n\t},\n\tsave() {\n\t\treturn null;\n\t},\n\tmigrate: migrateFontFamily,\n\tisEligible( { style } ) {\n\t\treturn style?.typography?.fontFamily;\n\t},\n};\n\n/**\n * New deprecations need to be placed first\n * for them to have higher priority.\n *\n * Old deprecations may need to be updated as well.\n *\n * See block-deprecation.md\n */\nexport default [ v2, v1 ];\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,kBAAA,GAAAF,sBAAA,CAAAC,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAME,EAAE,GAAG;EACVC,UAAU,EAAE;IACXC,SAAS,EAAE;MACVC,IAAI,EAAE;IACP,CAAC;IACDC,MAAM,EAAE;MACPD,IAAI,EAAE;IACP,CAAC;IACDE,MAAM,EAAE;MACPF,IAAI,EAAE,SAAS;MACfG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EACrC;AACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAC,QAAA,GAAAC,OAAA,CAAA7C,OAAA,GAQe,CAAEN,EAAE,EAAE+C,EAAE,CAAE","ignoreList":[]}
@@ -32,22 +32,22 @@ var _jsxRuntime = require("react/jsx-runtime");
32
32
 
33
33
  function PostDateEdit({
34
34
  attributes: {
35
+ datetime,
35
36
  textAlign,
36
37
  format,
37
38
  isLink,
38
- displayType
39
+ metadata
39
40
  },
40
41
  context: {
41
- postId,
42
42
  postType: postTypeSlug,
43
43
  queryId
44
44
  },
45
45
  setAttributes
46
46
  }) {
47
+ const displayType = metadata?.bindings?.datetime?.source === 'core/post-data' && metadata?.bindings?.datetime?.args?.key;
47
48
  const blockProps = (0, _blockEditor.useBlockProps)({
48
49
  className: (0, _clsx.default)({
49
- [`has-text-align-${textAlign}`]: textAlign,
50
- [`wp-block-post-date__modified-date`]: displayType === 'modified'
50
+ [`has-text-align-${textAlign}`]: textAlign
51
51
  })
52
52
  });
53
53
  const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
@@ -59,19 +59,32 @@ function PostDateEdit({
59
59
  const popoverProps = (0, _element.useMemo)(() => ({
60
60
  anchor: popoverAnchor
61
61
  }), [popoverAnchor]);
62
+ const {
63
+ __unstableMarkNextChangeAsNotPersistent
64
+ } = (0, _data.useDispatch)(_blockEditor.store);
65
+
66
+ // We need to set the datetime to a default value upon first loading
67
+ // to discern the block from its legacy version (which would default
68
+ // to the containing post's publish date).
69
+ (0, _element.useEffect)(() => {
70
+ if (datetime === undefined) {
71
+ __unstableMarkNextChangeAsNotPersistent();
72
+ setAttributes({
73
+ datetime: new Date()
74
+ });
75
+ }
76
+ }, [datetime]);
62
77
  const isDescendentOfQueryLoop = Number.isFinite(queryId);
63
78
  const dateSettings = (0, _date.getSettings)();
64
79
  const [siteFormat = dateSettings.formats.date] = (0, _coreData.useEntityProp)('root', 'site', 'date_format');
65
80
  const [siteTimeFormat = dateSettings.formats.time] = (0, _coreData.useEntityProp)('root', 'site', 'time_format');
66
- const [date, setDate] = (0, _coreData.useEntityProp)('postType', postTypeSlug, displayType, postId);
67
81
  const postType = (0, _data.useSelect)(select => postTypeSlug ? select(_coreData.store).getPostType(postTypeSlug) : null, [postTypeSlug]);
68
- const dateLabel = displayType === 'date' ? (0, _i18n.__)('Post Date') : (0, _i18n.__)('Post Modified Date');
69
- let postDate = date ? /*#__PURE__*/(0, _jsxRuntime.jsx)("time", {
70
- dateTime: (0, _date.dateI18n)('c', date),
82
+ let postDate = /*#__PURE__*/(0, _jsxRuntime.jsx)("time", {
83
+ dateTime: (0, _date.dateI18n)('c', datetime),
71
84
  ref: setPopoverAnchor,
72
- children: format === 'human-diff' ? (0, _date.humanTimeDiff)(date) : (0, _date.dateI18n)(format || siteFormat, date)
73
- }) : dateLabel;
74
- if (isLink && date) {
85
+ children: format === 'human-diff' ? (0, _date.humanTimeDiff)(datetime) : (0, _date.dateI18n)(format || siteFormat, datetime)
86
+ });
87
+ if (isLink && datetime) {
75
88
  postDate = /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
76
89
  href: "#post-date-pseudo-link",
77
90
  onClick: event => event.preventDefault(),
@@ -88,14 +101,17 @@ function PostDateEdit({
88
101
  textAlign: nextAlign
89
102
  });
90
103
  }
91
- }), date && displayType === 'date' && !isDescendentOfQueryLoop && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarGroup, {
104
+ }), displayType !== 'modified' && !isDescendentOfQueryLoop && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarGroup, {
92
105
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Dropdown, {
93
106
  popoverProps: popoverProps,
94
107
  renderContent: ({
95
108
  onClose
96
109
  }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.__experimentalPublishDateTimePicker, {
97
- currentDate: date,
98
- onChange: setDate,
110
+ title: displayType === 'date' ? (0, _i18n.__)('Publish Date') : (0, _i18n.__)('Date'),
111
+ currentDate: datetime,
112
+ onChange: newDatetime => setAttributes({
113
+ datetime: newDatetime
114
+ }),
99
115
  is12Hour: is12HourFormat(siteTimeFormat),
100
116
  onClose: onClose,
101
117
  dateOrder: /* translators: Order of day, month, and year. Available formats are 'dmy', 'mdy', and 'ymd'. */
@@ -126,9 +142,9 @@ function PostDateEdit({
126
142
  label: (0, _i18n.__)('Settings'),
127
143
  resetAll: () => {
128
144
  setAttributes({
145
+ datetime: undefined,
129
146
  format: undefined,
130
- isLink: false,
131
- displayType: 'date'
147
+ isLink: false
132
148
  });
133
149
  },
134
150
  dropdownMenuProps: dropdownMenuProps,
@@ -165,22 +181,6 @@ function PostDateEdit({
165
181
  }),
166
182
  checked: isLink
167
183
  })
168
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
169
- hasValue: () => displayType !== 'date',
170
- label: (0, _i18n.__)('Display last modified date'),
171
- onDeselect: () => setAttributes({
172
- displayType: 'date'
173
- }),
174
- isShownByDefault: true,
175
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
176
- __nextHasNoMarginBottom: true,
177
- label: (0, _i18n.__)('Display last modified date'),
178
- onChange: value => setAttributes({
179
- displayType: value ? 'modified' : 'date'
180
- }),
181
- checked: displayType === 'modified',
182
- help: (0, _i18n.__)('Only shows if the post has been modified')
183
- })
184
184
  })]
185
185
  })
186
186
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_coreData","_element","_date","_blockEditor","_components","_i18n","_icons","_keycodes","_data","_hooks","_jsxRuntime","PostDateEdit","attributes","textAlign","format","isLink","displayType","context","postId","postType","postTypeSlug","queryId","setAttributes","blockProps","useBlockProps","className","clsx","dropdownMenuProps","useToolsPanelDropdownMenuProps","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","isDescendentOfQueryLoop","Number","isFinite","dateSettings","getDateSettings","siteFormat","formats","date","useEntityProp","siteTimeFormat","time","setDate","useSelect","select","coreStore","getPostType","dateLabel","__","postDate","jsx","dateTime","dateI18n","ref","children","humanTimeDiff","href","onClick","event","preventDefault","jsxs","Fragment","BlockControls","group","AlignmentControl","value","onChange","nextAlign","ToolbarGroup","Dropdown","renderContent","onClose","__experimentalPublishDateTimePicker","currentDate","is12Hour","is12HourFormat","dateOrder","_x","renderToggle","isOpen","onToggle","openOnArrowDown","keyCode","DOWN","ToolbarButton","icon","edit","title","onKeyDown","InspectorControls","__experimentalToolsPanel","label","resetAll","undefined","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","__experimentalDateFormatPicker","defaultFormat","nextFormat","labels","singular_name","sprintf","toLowerCase","ToggleControl","__nextHasNoMarginBottom","checked","help","test"],"sources":["@wordpress/block-library/src/post-date/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useMemo, useState } from '@wordpress/element';\nimport {\n\tdateI18n,\n\thumanTimeDiff,\n\tgetSettings as getDateSettings,\n} from '@wordpress/date';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\t__experimentalDateFormatPicker as DateFormatPicker,\n\t__experimentalPublishDateTimePicker as PublishDateTimePicker,\n} from '@wordpress/block-editor';\nimport {\n\tDropdown,\n\tToolbarGroup,\n\tToolbarButton,\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { edit } from '@wordpress/icons';\nimport { DOWN } from '@wordpress/keycodes';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function PostDateEdit( {\n\tattributes: { textAlign, format, isLink, displayType },\n\tcontext: { postId, postType: postTypeSlug, queryId },\n\tsetAttributes,\n} ) {\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t\t[ `wp-block-post-date__modified-date` ]: displayType === 'modified',\n\t\t} ),\n\t} );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( { anchor: popoverAnchor } ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst dateSettings = getDateSettings();\n\tconst [ siteFormat = dateSettings.formats.date ] = useEntityProp(\n\t\t'root',\n\t\t'site',\n\t\t'date_format'\n\t);\n\tconst [ siteTimeFormat = dateSettings.formats.time ] = useEntityProp(\n\t\t'root',\n\t\t'site',\n\t\t'time_format'\n\t);\n\tconst [ date, setDate ] = useEntityProp(\n\t\t'postType',\n\t\tpostTypeSlug,\n\t\tdisplayType,\n\t\tpostId\n\t);\n\n\tconst postType = useSelect(\n\t\t( select ) =>\n\t\t\tpostTypeSlug\n\t\t\t\t? select( coreStore ).getPostType( postTypeSlug )\n\t\t\t\t: null,\n\t\t[ postTypeSlug ]\n\t);\n\n\tconst dateLabel =\n\t\tdisplayType === 'date' ? __( 'Post Date' ) : __( 'Post Modified Date' );\n\n\tlet postDate = date ? (\n\t\t<time dateTime={ dateI18n( 'c', date ) } ref={ setPopoverAnchor }>\n\t\t\t{ format === 'human-diff'\n\t\t\t\t? humanTimeDiff( date )\n\t\t\t\t: dateI18n( format || siteFormat, date ) }\n\t\t</time>\n\t) : (\n\t\tdateLabel\n\t);\n\n\tif ( isLink && date ) {\n\t\tpostDate = (\n\t\t\t<a\n\t\t\t\thref=\"#post-date-pseudo-link\"\n\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t>\n\t\t\t\t{ postDate }\n\t\t\t</a>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ date &&\n\t\t\t\t\tdisplayType === 'date' &&\n\t\t\t\t\t! isDescendentOfQueryLoop && (\n\t\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t\t<PublishDateTimePicker\n\t\t\t\t\t\t\t\t\t\tcurrentDate={ date }\n\t\t\t\t\t\t\t\t\t\tonChange={ setDate }\n\t\t\t\t\t\t\t\t\t\tis12Hour={ is12HourFormat(\n\t\t\t\t\t\t\t\t\t\t\tsiteTimeFormat\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\tdateOrder={\n\t\t\t\t\t\t\t\t\t\t\t/* translators: Order of day, month, and year. Available formats are 'dmy', 'mdy', and 'ymd'. */\n\t\t\t\t\t\t\t\t\t\t\t_x( 'dmy', 'date order' )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => {\n\t\t\t\t\t\t\t\t\tconst openOnArrowDown = ( event ) => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t! isOpen &&\n\t\t\t\t\t\t\t\t\t\t\tevent.keyCode === DOWN\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\t\tonToggle();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\t\t\t\t\ttitle={ __( 'Change Date' ) }\n\t\t\t\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\t\t\t\tonKeyDown={ openOnArrowDown }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t\t) }\n\t\t\t</BlockControls>\n\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tformat: undefined,\n\t\t\t\t\t\t\tisLink: false,\n\t\t\t\t\t\t\tdisplayType: 'date',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => !! format }\n\t\t\t\t\t\tlabel={ __( 'Date Format' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { format: undefined } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<DateFormatPicker\n\t\t\t\t\t\t\tformat={ format }\n\t\t\t\t\t\t\tdefaultFormat={ siteFormat }\n\t\t\t\t\t\t\tonChange={ ( nextFormat ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { format: nextFormat } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => isLink !== false }\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\tpostType?.labels.singular_name\n\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t\t\t\t\t\t__( 'Link to %s' ),\n\t\t\t\t\t\t\t\t\t\tpostType.labels.singular_name.toLowerCase()\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: __( 'Link to post' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { isLink: false } ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tpostType?.labels.singular_name\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t\t\t\t\t\t\t__( 'Link to %s' ),\n\t\t\t\t\t\t\t\t\t\t\tpostType.labels.singular_name.toLowerCase()\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: __( 'Link to post' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { isLink: ! isLink } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => displayType !== 'date' }\n\t\t\t\t\t\tlabel={ __( 'Display last modified date' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { displayType: 'date' } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Display last modified date' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tdisplayType: value ? 'modified' : 'date',\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ displayType === 'modified' }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Only shows if the post has been modified'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\n\t\t\t<div { ...blockProps }>{ postDate }</div>\n\t\t</>\n\t);\n}\n\nexport function is12HourFormat( format ) {\n\t// To know if the time format is a 12 hour time, look for any of the 12 hour\n\t// format characters: 'a', 'A', 'g', and 'h'. The character must be\n\t// unescaped, i.e. not preceded by a '\\'. Coincidentally, 'aAgh' is how I\n\t// feel when working with regular expressions.\n\t// https://www.php.net/manual/en/datetime.format.php\n\treturn /(?:^|[^\\\\])[aAgh]/.test( format );\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,YAAA,GAAAJ,OAAA;AAQA,IAAAK,WAAA,GAAAL,OAAA;AAQA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA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AC,CACa,CAAC;MAAA,CACN;IAAC,CACK,CAAC,eAEpB,IAAA1C,WAAA,CAAA4C,GAAA;MAAA,GAAU/B,UAAU;MAAAmC,QAAA,EAAKL;IAAQ,CAAO,CAAC;EAAA,CACxC,CAAC;AAEL;AAEO,SAAS0B,cAAcA,CAAEjE,MAAM,EAAG;EACxC;EACA;EACA;EACA;EACA;EACA,OAAO,mBAAmB,CAACmG,IAAI,CAAEnG,MAAO,CAAC;AAC1C","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_coreData","_element","_date","_blockEditor","_components","_i18n","_icons","_keycodes","_data","_hooks","_jsxRuntime","PostDateEdit","attributes","datetime","textAlign","format","isLink","metadata","context","postType","postTypeSlug","queryId","setAttributes","displayType","bindings","source","args","key","blockProps","useBlockProps","className","clsx","dropdownMenuProps","useToolsPanelDropdownMenuProps","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","__unstableMarkNextChangeAsNotPersistent","useDispatch","blockEditorStore","useEffect","undefined","Date","isDescendentOfQueryLoop","Number","isFinite","dateSettings","getDateSettings","siteFormat","formats","date","useEntityProp","siteTimeFormat","time","useSelect","select","coreStore","getPostType","postDate","jsx","dateTime","dateI18n","ref","children","humanTimeDiff","href","onClick","event","preventDefault","jsxs","Fragment","BlockControls","group","AlignmentControl","value","onChange","nextAlign","ToolbarGroup","Dropdown","renderContent","onClose","__experimentalPublishDateTimePicker","title","__","currentDate","newDatetime","is12Hour","is12HourFormat","dateOrder","_x","renderToggle","isOpen","onToggle","openOnArrowDown","keyCode","DOWN","ToolbarButton","icon","edit","onKeyDown","InspectorControls","__experimentalToolsPanel","label","resetAll","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","__experimentalDateFormatPicker","defaultFormat","nextFormat","labels","singular_name","sprintf","toLowerCase","ToggleControl","__nextHasNoMarginBottom","checked","test"],"sources":["@wordpress/block-library/src/post-date/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useMemo, useState } from '@wordpress/element';\nimport {\n\tdateI18n,\n\thumanTimeDiff,\n\tgetSettings as getDateSettings,\n} from '@wordpress/date';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tstore as blockEditorStore,\n\tuseBlockProps,\n\t__experimentalDateFormatPicker as DateFormatPicker,\n\t__experimentalPublishDateTimePicker as PublishDateTimePicker,\n} from '@wordpress/block-editor';\nimport {\n\tDropdown,\n\tToolbarGroup,\n\tToolbarButton,\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { edit } from '@wordpress/icons';\nimport { DOWN } from '@wordpress/keycodes';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function PostDateEdit( {\n\tattributes: { datetime, textAlign, format, isLink, metadata },\n\tcontext: { postType: postTypeSlug, queryId },\n\tsetAttributes,\n} ) {\n\tconst displayType =\n\t\tmetadata?.bindings?.datetime?.source === 'core/post-data' &&\n\t\tmetadata?.bindings?.datetime?.args?.key;\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( { anchor: popoverAnchor } ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\t// We need to set the datetime to a default value upon first loading\n\t// to discern the block from its legacy version (which would default\n\t// to the containing post's publish date).\n\tuseEffect( () => {\n\t\tif ( datetime === undefined ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { datetime: new Date() } );\n\t\t}\n\t}, [ datetime ] );\n\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst dateSettings = getDateSettings();\n\tconst [ siteFormat = dateSettings.formats.date ] = useEntityProp(\n\t\t'root',\n\t\t'site',\n\t\t'date_format'\n\t);\n\tconst [ siteTimeFormat = dateSettings.formats.time ] = useEntityProp(\n\t\t'root',\n\t\t'site',\n\t\t'time_format'\n\t);\n\n\tconst postType = useSelect(\n\t\t( select ) =>\n\t\t\tpostTypeSlug\n\t\t\t\t? select( coreStore ).getPostType( postTypeSlug )\n\t\t\t\t: null,\n\t\t[ postTypeSlug ]\n\t);\n\n\tlet postDate = (\n\t\t<time dateTime={ dateI18n( 'c', datetime ) } ref={ setPopoverAnchor }>\n\t\t\t{ format === 'human-diff'\n\t\t\t\t? humanTimeDiff( datetime )\n\t\t\t\t: dateI18n( format || siteFormat, datetime ) }\n\t\t</time>\n\t);\n\n\tif ( isLink && datetime ) {\n\t\tpostDate = (\n\t\t\t<a\n\t\t\t\thref=\"#post-date-pseudo-link\"\n\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t>\n\t\t\t\t{ postDate }\n\t\t\t</a>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ displayType !== 'modified' && ! isDescendentOfQueryLoop && (\n\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t<PublishDateTimePicker\n\t\t\t\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t\t\t\tdisplayType === 'date'\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Publish Date' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Date' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcurrentDate={ datetime }\n\t\t\t\t\t\t\t\t\tonChange={ ( newDatetime ) =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\tdatetime: newDatetime,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tis12Hour={ is12HourFormat(\n\t\t\t\t\t\t\t\t\t\tsiteTimeFormat\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\tdateOrder={\n\t\t\t\t\t\t\t\t\t\t/* translators: Order of day, month, and year. Available formats are 'dmy', 'mdy', and 'ymd'. */\n\t\t\t\t\t\t\t\t\t\t_x( 'dmy', 'date order' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => {\n\t\t\t\t\t\t\t\tconst openOnArrowDown = ( event ) => {\n\t\t\t\t\t\t\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\tonToggle();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\t\t\t\ttitle={ __( 'Change Date' ) }\n\t\t\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\t\t\tonKeyDown={ openOnArrowDown }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t) }\n\t\t\t</BlockControls>\n\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tdatetime: undefined,\n\t\t\t\t\t\t\tformat: undefined,\n\t\t\t\t\t\t\tisLink: false,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => !! format }\n\t\t\t\t\t\tlabel={ __( 'Date Format' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { format: undefined } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<DateFormatPicker\n\t\t\t\t\t\t\tformat={ format }\n\t\t\t\t\t\t\tdefaultFormat={ siteFormat }\n\t\t\t\t\t\t\tonChange={ ( nextFormat ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { format: nextFormat } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => isLink !== false }\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\tpostType?.labels.singular_name\n\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t\t\t\t\t\t__( 'Link to %s' ),\n\t\t\t\t\t\t\t\t\t\tpostType.labels.singular_name.toLowerCase()\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: __( 'Link to post' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { isLink: false } ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tpostType?.labels.singular_name\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t\t\t\t\t\t\t__( 'Link to %s' ),\n\t\t\t\t\t\t\t\t\t\t\tpostType.labels.singular_name.toLowerCase()\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: __( 'Link to post' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { isLink: ! isLink } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\n\t\t\t<div { ...blockProps }>{ postDate }</div>\n\t\t</>\n\t);\n}\n\nexport function is12HourFormat( format ) {\n\t// To know if the time format is a 12 hour time, look for any of the 12 hour\n\t// format characters: 'a', 'A', 'g', and 'h'. The character must be\n\t// unescaped, i.e. not preceded by a '\\'. Coincidentally, 'aAgh' is how I\n\t// feel when working with regular expressions.\n\t// https://www.php.net/manual/en/datetime.format.php\n\treturn /(?:^|[^\\\\])[aAgh]/.test( format );\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAA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;IAAC,CACK,CAAC,eAEpB,IAAAN,WAAA,CAAAoD,GAAA;MAAA,GAAUlC,UAAU;MAAAsC,QAAA,EAAKL;IAAQ,CAAO,CAAC;EAAA,CACxC,CAAC;AAEL;AAEO,SAAS6B,cAAcA,CAAE3E,MAAM,EAAG;EACxC;EACA;EACA;EACA;EACA;EACA,OAAO,mBAAmB,CAAC0G,IAAI,CAAE1G,MAAO,CAAC;AAC1C","ignoreList":[]}
@@ -25,6 +25,10 @@ const metadata = exports.metadata = {
25
25
  description: "Display the publish date for an entry such as a post or page.",
26
26
  textdomain: "default",
27
27
  attributes: {
28
+ datetime: {
29
+ type: "string",
30
+ role: "content"
31
+ },
28
32
  textAlign: {
29
33
  type: "string"
30
34
  },
@@ -35,10 +39,6 @@ const metadata = exports.metadata = {
35
39
  type: "boolean",
36
40
  "default": false,
37
41
  role: "content"
38
- },
39
- displayType: {
40
- type: "string",
41
- "default": "date"
42
42
  }
43
43
  },
44
44
  usesContext: ["postId", "postType", "queryId"],
@@ -1 +1 @@
1
- {"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","_deprecated","_variations","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","textAlign","type","format","isLink","role","displayType","usesContext","example","viewportWidth","supports","html","color","gradients","link","__experimentalDefaultControls","background","text","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","interactivity","clientNavigation","__experimentalBorder","radius","width","style","settings","icon","edit","deprecated","variations","init","initBlock"],"sources":["@wordpress/block-library/src/post-date/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postDate as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport deprecated from './deprecated';\nimport variations from './variations';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon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AAA;AASA,MAAM;EAAExC;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAGnB,MAAMyC,QAAQ,GAAA5C,OAAA,CAAA4C,QAAA,GAAG;EACvBC,IAAI,EAAJA,eAAI;EACJC,IAAI,EAAJA,aAAI;EACJC,UAAU,EAAVA,mBAAU;EACVC,UAAU,EAAVA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAE/C,IAAI;EAAEJ,QAAQ;EAAE6C;AAAS,CAAE,CAAC;AAAC5C,OAAA,CAAAiD,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","_deprecated","_variations","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","datetime","type","role","textAlign","format","isLink","usesContext","example","viewportWidth","supports","html","color","gradients","link","__experimentalDefaultControls","background","text","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","interactivity","clientNavigation","__experimentalBorder","radius","width","style","settings","icon","edit","deprecated","variations","init","initBlock"],"sources":["@wordpress/block-library/src/post-date/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postDate as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport deprecated from './deprecated';\nimport variations from './variations';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tdeprecated,\n\tvariations,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA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UAAU,EAAVA,mBAAU;EACVC,UAAU,EAAVA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAE/C,IAAI;EAAEJ,QAAQ;EAAE6C;AAAS,CAAE,CAAC;AAAC5C,OAAA,CAAAiD,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -11,14 +11,43 @@ var _icons = require("@wordpress/icons");
11
11
  */
12
12
 
13
13
  const variations = [{
14
+ name: 'post-date',
15
+ title: (0, _i18n.__)('Post Date'),
16
+ description: (0, _i18n.__)("Display a post's publish date."),
17
+ attributes: {
18
+ metadata: {
19
+ bindings: {
20
+ datetime: {
21
+ source: 'core/post-data',
22
+ args: {
23
+ key: 'date'
24
+ }
25
+ }
26
+ }
27
+ }
28
+ },
29
+ scope: ['block', 'inserter', 'transform'],
30
+ isActive: blockAttributes => blockAttributes?.metadata?.bindings?.datetime?.source === 'core/post-data' && blockAttributes?.metadata?.bindings?.datetime?.args?.key === 'date',
31
+ icon: _icons.postDate
32
+ }, {
14
33
  name: 'post-date-modified',
15
34
  title: (0, _i18n.__)('Modified Date'),
16
35
  description: (0, _i18n.__)("Display a post's last updated date."),
17
36
  attributes: {
18
- displayType: 'modified'
37
+ metadata: {
38
+ bindings: {
39
+ datetime: {
40
+ source: 'core/post-data',
41
+ args: {
42
+ key: 'modified'
43
+ }
44
+ }
45
+ }
46
+ },
47
+ className: 'wp-block-post-date__modified-date'
19
48
  },
20
- scope: ['block', 'inserter'],
21
- isActive: blockAttributes => blockAttributes.displayType === 'modified',
49
+ scope: ['block', 'inserter', 'transform'],
50
+ isActive: blockAttributes => blockAttributes?.metadata?.bindings?.datetime?.source === 'core/post-data' && blockAttributes?.metadata?.bindings?.datetime?.args?.key === 'modified',
22
51
  icon: _icons.postDate
23
52
  }];
24
53
  var _default = exports.default = variations;
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_icons","variations","name","title","__","description","attributes","displayType","scope","isActive","blockAttributes","icon","postDate","_default","exports","default"],"sources":["@wordpress/block-library/src/post-date/variations.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { postDate } from '@wordpress/icons';\n\nconst variations = [\n\t{\n\t\tname: 'post-date-modified',\n\t\ttitle: __( 'Modified Date' ),\n\t\tdescription: __( \"Display a post's last updated date.\" ),\n\t\tattributes: { displayType: 'modified' },\n\t\tscope: [ 'block', 'inserter' ],\n\t\tisActive: ( blockAttributes ) =>\n\t\t\tblockAttributes.displayType === 'modified',\n\t\ticon: postDate,\n\t},\n];\n\nexport default variations;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,UAAU,GAAG,CAClB;EACCC,IAAI,EAAE,oBAAoB;EAC1BC,KAAK,EAAE,IAAAC,QAAE,EAAE,eAAgB,CAAC;EAC5BC,WAAW,EAAE,IAAAD,QAAE,EAAE,qCAAsC,CAAC;EACxDE,UAAU,EAAE;IAAEC,WAAW,EAAE;EAAW,CAAC;EACvCC,KAAK,EAAE,CAAE,OAAO,EAAE,UAAU,CAAE;EAC9BC,QAAQ,EAAIC,eAAe,IAC1BA,eAAe,CAACH,WAAW,KAAK,UAAU;EAC3CI,IAAI,EAAEC;AACP,CAAC,CACD;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEad,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_icons","variations","name","title","__","description","attributes","metadata","bindings","datetime","source","args","key","scope","isActive","blockAttributes","icon","postDate","className","_default","exports","default"],"sources":["@wordpress/block-library/src/post-date/variations.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { postDate } from '@wordpress/icons';\n\nconst variations = [\n\t{\n\t\tname: 'post-date',\n\t\ttitle: __( 'Post Date' ),\n\t\tdescription: __( \"Display a post's publish date.\" ),\n\t\tattributes: {\n\t\t\tmetadata: {\n\t\t\t\tbindings: {\n\t\t\t\t\tdatetime: {\n\t\t\t\t\t\tsource: 'core/post-data',\n\t\t\t\t\t\targs: { key: 'date' },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tscope: [ 'block', 'inserter', 'transform' ],\n\t\tisActive: ( blockAttributes ) =>\n\t\t\tblockAttributes?.metadata?.bindings?.datetime?.source ===\n\t\t\t\t'core/post-data' &&\n\t\t\tblockAttributes?.metadata?.bindings?.datetime?.args?.key === 'date',\n\t\ticon: postDate,\n\t},\n\t{\n\t\tname: 'post-date-modified',\n\t\ttitle: __( 'Modified Date' ),\n\t\tdescription: __( \"Display a post's last updated date.\" ),\n\t\tattributes: {\n\t\t\tmetadata: {\n\t\t\t\tbindings: {\n\t\t\t\t\tdatetime: {\n\t\t\t\t\t\tsource: 'core/post-data',\n\t\t\t\t\t\targs: { key: 'modified' },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tclassName: 'wp-block-post-date__modified-date',\n\t\t},\n\t\tscope: [ 'block', 'inserter', 'transform' ],\n\t\tisActive: ( blockAttributes ) =>\n\t\t\tblockAttributes?.metadata?.bindings?.datetime?.source ===\n\t\t\t\t'core/post-data' &&\n\t\t\tblockAttributes?.metadata?.bindings?.datetime?.args?.key ===\n\t\t\t\t'modified',\n\t\ticon: postDate,\n\t},\n];\n\nexport default variations;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,UAAU,GAAG,CAClB;EACCC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE,IAAAC,QAAE,EAAE,WAAY,CAAC;EACxBC,WAAW,EAAE,IAAAD,QAAE,EAAE,gCAAiC,CAAC;EACnDE,UAAU,EAAE;IACXC,QAAQ,EAAE;MACTC,QAAQ,EAAE;QACTC,QAAQ,EAAE;UACTC,MAAM,EAAE,gBAAgB;UACxBC,IAAI,EAAE;YAAEC,GAAG,EAAE;UAAO;QACrB;MACD;IACD;EACD,CAAC;EACDC,KAAK,EAAE,CAAE,OAAO,EAAE,UAAU,EAAE,WAAW,CAAE;EAC3CC,QAAQ,EAAIC,eAAe,IAC1BA,eAAe,EAAER,QAAQ,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,MAAM,KACpD,gBAAgB,IACjBK,eAAe,EAAER,QAAQ,EAAEC,QAAQ,EAAEC,QAAQ,EAAEE,IAAI,EAAEC,GAAG,KAAK,MAAM;EACpEI,IAAI,EAAEC;AACP,CAAC,EACD;EACCf,IAAI,EAAE,oBAAoB;EAC1BC,KAAK,EAAE,IAAAC,QAAE,EAAE,eAAgB,CAAC;EAC5BC,WAAW,EAAE,IAAAD,QAAE,EAAE,qCAAsC,CAAC;EACxDE,UAAU,EAAE;IACXC,QAAQ,EAAE;MACTC,QAAQ,EAAE;QACTC,QAAQ,EAAE;UACTC,MAAM,EAAE,gBAAgB;UACxBC,IAAI,EAAE;YAAEC,GAAG,EAAE;UAAW;QACzB;MACD;IACD,CAAC;IACDM,SAAS,EAAE;EACZ,CAAC;EACDL,KAAK,EAAE,CAAE,OAAO,EAAE,UAAU,EAAE,WAAW,CAAE;EAC3CC,QAAQ,EAAIC,eAAe,IAC1BA,eAAe,EAAER,QAAQ,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,MAAM,KACpD,gBAAgB,IACjBK,eAAe,EAAER,QAAQ,EAAEC,QAAQ,EAAEC,QAAQ,EAAEE,IAAI,EAAEC,GAAG,KACvD,UAAU;EACZI,IAAI,EAAEC;AACP,CAAC,CACD;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEapB,UAAU","ignoreList":[]}
@@ -6,12 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = SeparatorEdit;
8
8
  var _clsx = _interopRequireDefault(require("clsx"));
9
- var _components = require("@wordpress/components");
10
9
  var _blockEditor = require("@wordpress/block-editor");
11
- var _element = require("@wordpress/element");
10
+ var _components = require("@wordpress/components");
12
11
  var _i18n = require("@wordpress/i18n");
13
12
  var _useDeprecatedOpacity = _interopRequireDefault(require("./use-deprecated-opacity"));
14
- var _hooks = require("../utils/hooks");
15
13
  var _jsxRuntime = require("react/jsx-runtime");
16
14
  /**
17
15
  * External dependencies
@@ -60,7 +58,6 @@ function SeparatorEdit({
60
58
  const colorProps = (0, _blockEditor.__experimentalUseColorProps)(attributes);
61
59
  const currentColor = colorProps?.style?.backgroundColor;
62
60
  const hasCustomColor = !!style?.color?.background;
63
- const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
64
61
  (0, _useDeprecatedOpacity.default)(opacity, currentColor, setAttributes);
65
62
 
66
63
  // The dots styles uses text for the dots, to change those dots color is
@@ -79,32 +76,10 @@ function SeparatorEdit({
79
76
  const Wrapper = tagName === 'hr' ? _components.HorizontalRule : tagName;
80
77
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
81
78
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
82
- children: _element.Platform.isNative ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PanelBody, {
83
- title: (0, _i18n.__)('Settings'),
84
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(HtmlElementControl, {
85
- tagName: tagName,
86
- setAttributes: setAttributes
87
- })
88
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanel, {
89
- label: (0, _i18n.__)('Settings'),
90
- resetAll: () => {
91
- setAttributes({
92
- tagName: 'hr'
93
- });
94
- },
95
- dropdownMenuProps: dropdownMenuProps,
96
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
97
- hasValue: () => tagName !== 'hr',
98
- label: (0, _i18n.__)('HTML element'),
99
- onDeselect: () => setAttributes({
100
- tagName: 'hr'
101
- }),
102
- isShownByDefault: true,
103
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(HtmlElementControl, {
104
- tagName: tagName,
105
- setAttributes: setAttributes
106
- })
107
- })
79
+ group: "advanced",
80
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(HtmlElementControl, {
81
+ tagName: tagName,
82
+ setAttributes: setAttributes
108
83
  })
109
84
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, {
110
85
  ...(0, _blockEditor.useBlockProps)({
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_blockEditor","_element","_i18n","_useDeprecatedOpacity","_hooks","_jsxRuntime","HtmlElementControl","tagName","setAttributes","jsx","SelectControl","label","__","value","onChange","newValue","options","help","__next40pxDefaultSize","__nextHasNoMarginBottom","SeparatorEdit","attributes","backgroundColor","opacity","style","colorProps","useColorProps","currentColor","hasCustomColor","color","background","dropdownMenuProps","useToolsPanelDropdownMenuProps","useDeprecatedOpacity","colorClass","getColorClassName","className","clsx","styles","Wrapper","HorizontalRule","jsxs","Fragment","children","InspectorControls","Platform","isNative","PanelBody","title","__experimentalToolsPanel","resetAll","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","useBlockProps","undefined"],"sources":["@wordpress/block-library/src/separator/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tHorizontalRule,\n\tSelectControl,\n\tPanelBody,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport {\n\tuseBlockProps,\n\tgetColorClassName,\n\t__experimentalUseColorProps as useColorProps,\n\tInspectorControls,\n} from '@wordpress/block-editor';\nimport { Platform } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useDeprecatedOpacity from './use-deprecated-opacity';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst HtmlElementControl = ( { tagName, setAttributes } ) => {\n\treturn (\n\t\t<SelectControl\n\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\tvalue={ tagName }\n\t\t\tonChange={ ( newValue ) => setAttributes( { tagName: newValue } ) }\n\t\t\toptions={ [\n\t\t\t\t{ label: __( 'Default (<hr>)' ), value: 'hr' },\n\t\t\t\t{ label: '<div>', value: 'div' },\n\t\t\t] }\n\t\t\thelp={\n\t\t\t\ttagName === 'hr'\n\t\t\t\t\t? __(\n\t\t\t\t\t\t\t'Only select <hr> if the separator conveys important information and should be announced by screen readers.'\n\t\t\t\t\t )\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'The <div> element should only be used if the block is a design element with no semantic meaning.'\n\t\t\t\t\t )\n\t\t\t}\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t/>\n\t);\n};\n\nexport default function SeparatorEdit( { attributes, setAttributes } ) {\n\tconst { backgroundColor, opacity, style, tagName } = attributes;\n\tconst colorProps = useColorProps( attributes );\n\tconst currentColor = colorProps?.style?.backgroundColor;\n\tconst hasCustomColor = !! style?.color?.background;\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tuseDeprecatedOpacity( opacity, currentColor, setAttributes );\n\n\t// The dots styles uses text for the dots, to change those dots color is\n\t// using color, not backgroundColor.\n\tconst colorClass = getColorClassName( 'color', backgroundColor );\n\n\tconst className = clsx(\n\t\t{\n\t\t\t'has-text-color': backgroundColor || currentColor,\n\t\t\t[ colorClass ]: colorClass,\n\t\t\t'has-css-opacity': opacity === 'css',\n\t\t\t'has-alpha-channel-opacity': opacity === 'alpha-channel',\n\t\t},\n\t\tcolorProps.className\n\t);\n\n\tconst styles = {\n\t\tcolor: currentColor,\n\t\tbackgroundColor: currentColor,\n\t};\n\tconst Wrapper = tagName === 'hr' ? HorizontalRule : tagName;\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t{ Platform.isNative ? (\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t<HtmlElementControl\n\t\t\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) : (\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tsetAttributes( { tagName: 'hr' } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => tagName !== 'hr' }\n\t\t\t\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { tagName: 'hr' } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<HtmlElementControl\n\t\t\t\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t\t<Wrapper\n\t\t\t\t{ ...useBlockProps( {\n\t\t\t\t\tclassName,\n\t\t\t\t\tstyle: hasCustomColor ? styles : undefined,\n\t\t\t\t} ) }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAOA,IAAAE,YAAA,GAAAF,OAAA;AAMA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,qBAAA,GAAAN,sBAAA,CAAAC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,CAAAoD,4BAAc;UACdC,QAAQ,EAAGA,CAAA,KAAM7C,OAAO,KAAK,IAAM;UACnCI,KAAK,EAAG,IAAAC,QAAE,EAAE,cAAe,CAAG;UAC9ByC,UAAU,EAAGA,CAAA,KACZ7C,aAAa,CAAE;YAAED,OAAO,EAAE;UAAK,CAAE,CACjC;UACD+C,gBAAgB;UAAAX,QAAA,eAEhB,IAAAtC,WAAA,CAAAI,GAAA,EAACH,kBAAkB;YAClBC,OAAO,EAAGA,OAAS;YACnBC,aAAa,EAAGA;UAAe,CAC/B;QAAC,CACa;MAAC,CACN;IACZ,CACiB,CAAC,eACpB,IAAAH,WAAA,CAAAI,GAAA,EAAC8B,OAAO;MAAA,GACF,IAAAgB,0BAAa,EAAE;QACnBnB,SAAS;QACTZ,KAAK,EAAEI,cAAc,GAAGU,MAAM,GAAGkB;MAClC,CAAE;IAAC,CACH,CAAC;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_components","_i18n","_useDeprecatedOpacity","_jsxRuntime","HtmlElementControl","tagName","setAttributes","jsx","SelectControl","label","__","value","onChange","newValue","options","help","__next40pxDefaultSize","__nextHasNoMarginBottom","SeparatorEdit","attributes","backgroundColor","opacity","style","colorProps","useColorProps","currentColor","hasCustomColor","color","background","useDeprecatedOpacity","colorClass","getColorClassName","className","clsx","styles","Wrapper","HorizontalRule","jsxs","Fragment","children","InspectorControls","group","useBlockProps","undefined"],"sources":["@wordpress/block-library/src/separator/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetColorClassName,\n\tInspectorControls,\n\tuseBlockProps,\n\t__experimentalUseColorProps as useColorProps,\n} from '@wordpress/block-editor';\nimport { HorizontalRule, SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useDeprecatedOpacity from './use-deprecated-opacity';\n\nconst HtmlElementControl = ( { tagName, setAttributes } ) => {\n\treturn (\n\t\t<SelectControl\n\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\tvalue={ tagName }\n\t\t\tonChange={ ( newValue ) => setAttributes( { tagName: newValue } ) }\n\t\t\toptions={ [\n\t\t\t\t{ label: __( 'Default (<hr>)' ), value: 'hr' },\n\t\t\t\t{ label: '<div>', value: 'div' },\n\t\t\t] }\n\t\t\thelp={\n\t\t\t\ttagName === 'hr'\n\t\t\t\t\t? __(\n\t\t\t\t\t\t\t'Only select <hr> if the separator conveys important information and should be announced by screen readers.'\n\t\t\t\t\t )\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'The <div> element should only be used if the block is a design element with no semantic meaning.'\n\t\t\t\t\t )\n\t\t\t}\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t/>\n\t);\n};\n\nexport default function SeparatorEdit( { attributes, setAttributes } ) {\n\tconst { backgroundColor, opacity, style, tagName } = attributes;\n\tconst colorProps = useColorProps( attributes );\n\tconst currentColor = colorProps?.style?.backgroundColor;\n\tconst hasCustomColor = !! style?.color?.background;\n\n\tuseDeprecatedOpacity( opacity, currentColor, setAttributes );\n\n\t// The dots styles uses text for the dots, to change those dots color is\n\t// using color, not backgroundColor.\n\tconst colorClass = getColorClassName( 'color', backgroundColor );\n\n\tconst className = clsx(\n\t\t{\n\t\t\t'has-text-color': backgroundColor || currentColor,\n\t\t\t[ colorClass ]: colorClass,\n\t\t\t'has-css-opacity': opacity === 'css',\n\t\t\t'has-alpha-channel-opacity': opacity === 'alpha-channel',\n\t\t},\n\t\tcolorProps.className\n\t);\n\n\tconst styles = {\n\t\tcolor: currentColor,\n\t\tbackgroundColor: currentColor,\n\t};\n\tconst Wrapper = tagName === 'hr' ? HorizontalRule : tagName;\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<HtmlElementControl\n\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<Wrapper\n\t\t\t\t{ ...useBlockProps( {\n\t\t\t\t\tclassName,\n\t\t\t\t\tstyle: hasCustomColor ? styles : undefined,\n\t\t\t\t} ) }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,qBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAA4D,IAAAK,WAAA,GAAAL,OAAA;AApB5D;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAGA,MAAMM,kBAAkB,GAAGA,CAAE;EAAEC,OAAO;EAAEC;AAAc,CAAC,KAAM;EAC5D,oBACC,IAAAH,WAAA,CAAAI,GAAA,EAACP,WAAA,CAAAQ,aAAa;IACbC,KAAK,EAAG,IAAAC,QAAE,EAAE,cAAe,CAAG;IAC9BC,KAAK,EAAGN,OAAS;IACjBO,QAAQ,EAAKC,QAAQ,IAAMP,aAAa,CAAE;MAAED,OAAO,EAAEQ;IAAS,CAAE,CAAG;IACnEC,OAAO,EAAG,CACT;MAAEL,KAAK,EAAE,IAAAC,QAAE,EAAE,gBAAiB,CAAC;MAAEC,KAAK,EAAE;IAAK,CAAC,EAC9C;MAAEF,KAAK,EAAE,OAAO;MAAEE,KAAK,EAAE;IAAM,CAAC,CAC9B;IACHI,IAAI,EACHV,OAAO,KAAK,IAAI,GACb,IAAAK,QAAE,EACF,4GACA,CAAC,GACD,IAAAA,QAAE,EACF,kGACA,CACH;IACDM,qBAAqB;IACrBC,uBAAuB;EAAA,CACvB,CAAC;AAEJ,CAAC;AAEc,SAASC,aAAaA,CAAE;EAAEC,UAAU;EAAEb;AAAc,CAAC,EAAG;EACtE,MAAM;IAAEc,eA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MAAM,GAAGS;MAClC,CAAE;IAAC,CACH,CAAC;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
@@ -18,7 +18,7 @@ const metadata = exports.metadata = {
18
18
  name: "core/site-tagline",
19
19
  title: "Site Tagline",
20
20
  category: "theme",
21
- description: "Describe in a few words what the site is about. The tagline can be used in search results or when sharing on social networks even if it\u2019s not displayed in the theme design.",
21
+ description: "Describe in a few words what this site is about. This is important for search results, sharing on social media, and gives overall clarity to visitors.",
22
22
  keywords: ["description"],
23
23
  textdomain: "default",
24
24
  attributes: {