@wordpress/block-library 9.35.1-next.16d95556a.0 → 9.35.1-next.dc3f6d3c1.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 (161) hide show
  1. package/build/audio/index.js +26 -0
  2. package/build/audio/index.js.map +2 -2
  3. package/build/breadcrumbs/edit.js +1 -1
  4. package/build/breadcrumbs/edit.js.map +2 -2
  5. package/build/button/index.js +22 -0
  6. package/build/button/index.js.map +2 -2
  7. package/build/code/index.js +12 -0
  8. package/build/code/index.js.map +2 -2
  9. package/build/cover/index.js +22 -0
  10. package/build/cover/index.js.map +2 -2
  11. package/build/details/index.js +12 -0
  12. package/build/details/index.js.map +2 -2
  13. package/build/file/index.js +33 -0
  14. package/build/file/index.js.map +2 -2
  15. package/build/heading/index.js +12 -0
  16. package/build/heading/index.js.map +2 -2
  17. package/build/html/modal.js +126 -144
  18. package/build/html/modal.js.map +2 -2
  19. package/build/image/index.js +46 -0
  20. package/build/image/index.js.map +2 -2
  21. package/build/list-item/index.js +13 -0
  22. package/build/list-item/index.js.map +2 -2
  23. package/build/media-text/index.js +28 -0
  24. package/build/media-text/index.js.map +2 -2
  25. package/build/more/index.js +13 -0
  26. package/build/more/index.js.map +2 -2
  27. package/build/navigation/block.json +2 -2
  28. package/build/navigation-link/block.json +2 -1
  29. package/build/navigation-link/edit.js +6 -0
  30. package/build/navigation-link/edit.js.map +2 -2
  31. package/build/navigation-link/index.js +22 -0
  32. package/build/navigation-link/index.js.map +2 -2
  33. package/build/navigation-link/shared/controls.js +15 -19
  34. package/build/navigation-link/shared/controls.js.map +2 -2
  35. package/build/navigation-link/shared/index.js +4 -0
  36. package/build/navigation-link/shared/index.js.map +2 -2
  37. package/build/navigation-link/shared/use-entity-binding.js +3 -2
  38. package/build/navigation-link/shared/use-entity-binding.js.map +2 -2
  39. package/build/navigation-submenu/block.json +2 -1
  40. package/build/navigation-submenu/index.js +22 -0
  41. package/build/navigation-submenu/index.js.map +2 -2
  42. package/build/paragraph/index.js +12 -0
  43. package/build/paragraph/index.js.map +2 -2
  44. package/build/post-comments-count/edit.js +1 -2
  45. package/build/post-comments-count/edit.js.map +2 -2
  46. package/build/post-comments-link/edit.js +10 -7
  47. package/build/post-comments-link/edit.js.map +2 -2
  48. package/build/preformatted/index.js +12 -0
  49. package/build/preformatted/index.js.map +2 -2
  50. package/build/pullquote/index.js +20 -0
  51. package/build/pullquote/index.js.map +2 -2
  52. package/build/search/index.js +28 -0
  53. package/build/search/index.js.map +2 -2
  54. package/build/social-link/index.js +22 -0
  55. package/build/social-link/index.js.map +2 -2
  56. package/build/social-links/edit.js +1 -1
  57. package/build/social-links/edit.js.map +1 -1
  58. package/build/tabs/view.js +17 -4
  59. package/build/tabs/view.js.map +2 -2
  60. package/build/verse/index.js +12 -0
  61. package/build/verse/index.js.map +2 -2
  62. package/build/video/index.js +27 -0
  63. package/build/video/index.js.map +2 -2
  64. package/build-module/audio/index.js +26 -0
  65. package/build-module/audio/index.js.map +2 -2
  66. package/build-module/breadcrumbs/edit.js +1 -1
  67. package/build-module/breadcrumbs/edit.js.map +2 -2
  68. package/build-module/button/index.js +22 -0
  69. package/build-module/button/index.js.map +2 -2
  70. package/build-module/code/index.js +12 -0
  71. package/build-module/code/index.js.map +2 -2
  72. package/build-module/cover/index.js +22 -0
  73. package/build-module/cover/index.js.map +2 -2
  74. package/build-module/details/index.js +12 -0
  75. package/build-module/details/index.js.map +2 -2
  76. package/build-module/file/index.js +34 -1
  77. package/build-module/file/index.js.map +2 -2
  78. package/build-module/heading/index.js +12 -0
  79. package/build-module/heading/index.js.map +2 -2
  80. package/build-module/html/modal.js +127 -145
  81. package/build-module/html/modal.js.map +2 -2
  82. package/build-module/image/index.js +46 -0
  83. package/build-module/image/index.js.map +2 -2
  84. package/build-module/list-item/index.js +13 -0
  85. package/build-module/list-item/index.js.map +2 -2
  86. package/build-module/media-text/index.js +28 -0
  87. package/build-module/media-text/index.js.map +2 -2
  88. package/build-module/more/index.js +13 -0
  89. package/build-module/more/index.js.map +2 -2
  90. package/build-module/navigation/block.json +2 -2
  91. package/build-module/navigation-link/block.json +2 -1
  92. package/build-module/navigation-link/edit.js +20 -4
  93. package/build-module/navigation-link/edit.js.map +2 -2
  94. package/build-module/navigation-link/index.js +23 -1
  95. package/build-module/navigation-link/index.js.map +2 -2
  96. package/build-module/navigation-link/shared/controls.js +12 -18
  97. package/build-module/navigation-link/shared/controls.js.map +2 -2
  98. package/build-module/navigation-link/shared/index.js +3 -1
  99. package/build-module/navigation-link/shared/index.js.map +2 -2
  100. package/build-module/navigation-link/shared/use-entity-binding.js +3 -2
  101. package/build-module/navigation-link/shared/use-entity-binding.js.map +2 -2
  102. package/build-module/navigation-submenu/block.json +2 -1
  103. package/build-module/navigation-submenu/index.js +23 -1
  104. package/build-module/navigation-submenu/index.js.map +2 -2
  105. package/build-module/paragraph/index.js +12 -0
  106. package/build-module/paragraph/index.js.map +2 -2
  107. package/build-module/post-comments-count/edit.js +1 -3
  108. package/build-module/post-comments-count/edit.js.map +2 -2
  109. package/build-module/post-comments-link/edit.js +10 -8
  110. package/build-module/post-comments-link/edit.js.map +2 -2
  111. package/build-module/preformatted/index.js +12 -0
  112. package/build-module/preformatted/index.js.map +2 -2
  113. package/build-module/pullquote/index.js +20 -0
  114. package/build-module/pullquote/index.js.map +2 -2
  115. package/build-module/search/index.js +28 -0
  116. package/build-module/search/index.js.map +2 -2
  117. package/build-module/social-link/index.js +22 -0
  118. package/build-module/social-link/index.js.map +2 -2
  119. package/build-module/social-links/edit.js +1 -1
  120. package/build-module/social-links/edit.js.map +1 -1
  121. package/build-module/tabs/view.js +17 -4
  122. package/build-module/tabs/view.js.map +2 -2
  123. package/build-module/verse/index.js +12 -0
  124. package/build-module/verse/index.js.map +2 -2
  125. package/build-module/video/index.js +27 -0
  126. package/build-module/video/index.js.map +2 -2
  127. package/package.json +37 -37
  128. package/src/audio/index.js +27 -0
  129. package/src/breadcrumbs/edit.js +4 -2
  130. package/src/breadcrumbs/index.php +112 -30
  131. package/src/button/index.js +23 -0
  132. package/src/code/index.js +13 -0
  133. package/src/cover/index.js +23 -0
  134. package/src/details/index.js +13 -0
  135. package/src/file/index.js +35 -1
  136. package/src/heading/index.js +13 -0
  137. package/src/html/modal.js +8 -28
  138. package/src/image/index.js +47 -0
  139. package/src/list-item/index.js +14 -0
  140. package/src/media-text/index.js +29 -0
  141. package/src/more/index.js +14 -0
  142. package/src/navigation/block.json +2 -2
  143. package/src/navigation-link/block.json +2 -1
  144. package/src/navigation-link/edit.js +27 -4
  145. package/src/navigation-link/index.js +24 -1
  146. package/src/navigation-link/shared/controls.js +13 -17
  147. package/src/navigation-link/shared/index.js +1 -1
  148. package/src/navigation-link/shared/use-entity-binding.js +5 -2
  149. package/src/navigation-submenu/block.json +2 -1
  150. package/src/navigation-submenu/index.js +24 -1
  151. package/src/paragraph/index.js +13 -0
  152. package/src/post-comments-count/edit.js +1 -9
  153. package/src/post-comments-link/edit.js +8 -18
  154. package/src/preformatted/index.js +13 -0
  155. package/src/pullquote/index.js +21 -0
  156. package/src/search/index.js +29 -0
  157. package/src/social-link/index.js +23 -0
  158. package/src/social-links/edit.js +1 -1
  159. package/src/tabs/view.js +19 -4
  160. package/src/verse/index.js +13 -0
  161. package/src/video/index.js +28 -0
@@ -38,7 +38,6 @@ var import_block_editor = require("@wordpress/block-editor");
38
38
  var import_element = require("@wordpress/element");
39
39
  var import_api_fetch = __toESM(require("@wordpress/api-fetch"));
40
40
  var import_url = require("@wordpress/url");
41
- var import_i18n = require("@wordpress/i18n");
42
41
  var import_jsx_runtime = require("react/jsx-runtime");
43
42
  function PostCommentsCountEdit({
44
43
  attributes,
@@ -84,7 +83,7 @@ function PostCommentsCountEdit({
84
83
  }
85
84
  }
86
85
  ) }),
87
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...blockProps, style: blockStyles, children: hasPostAndComments ? commentsCount : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.Warning, { children: (0, import_i18n.__)("Post Comments Count block: post not found.") }) })
86
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...blockProps, style: blockStyles, children: hasPostAndComments ? commentsCount : "0" })
88
87
  ] });
89
88
  }
90
89
  //# sourceMappingURL=edit.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/post-comments-count/edit.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tWarning,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { useState, useEffect } from '@wordpress/element';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __ } from '@wordpress/i18n';\n\nexport default function PostCommentsCountEdit( {\n\tattributes,\n\tcontext,\n\tsetAttributes,\n} ) {\n\tconst { textAlign } = attributes;\n\tconst { postId } = context;\n\tconst [ commentsCount, setCommentsCount ] = useState();\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( ! postId ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentPostId = postId;\n\t\tapiFetch( {\n\t\t\tpath: addQueryArgs( '/wp/v2/comments', {\n\t\t\t\tpost: postId,\n\t\t\t} ),\n\t\t\tparse: false,\n\t\t} ).then( ( res ) => {\n\t\t\t// Stale requests will have the `currentPostId` of an older closure.\n\t\t\tif ( currentPostId === postId ) {\n\t\t\t\tsetCommentsCount( res.headers.get( 'X-WP-Total' ) );\n\t\t\t}\n\t\t} );\n\t}, [ postId ] );\n\n\tconst hasPostAndComments = postId && commentsCount !== undefined;\n\tconst blockStyles = {\n\t\t...blockProps.style,\n\t\ttextDecoration: hasPostAndComments\n\t\t\t? blockProps.style?.textDecoration\n\t\t\t: undefined,\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</BlockControls>\n\t\t\t<div { ...blockProps } style={ blockStyles }>\n\t\t\t\t{ hasPostAndComments ? (\n\t\t\t\t\tcommentsCount\n\t\t\t\t) : (\n\t\t\t\t\t<Warning>\n\t\t\t\t\t\t{ __( 'Post Comments Count block: post not found.' ) }\n\t\t\t\t\t</Warning>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,0BAKO;AACP,qBAAoC;AACpC,uBAAqB;AACrB,iBAA6B;AAC7B,kBAAmB;AA2CjB;AAzCa,SAAR,sBAAwC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,EAAE,UAAU,IAAI;AACtB,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,CAAE,eAAe,gBAAiB,QAAI,yBAAS;AACrD,QAAM,iBAAa,mCAAe;AAAA,IACjC,eAAW,YAAAA,SAAM;AAAA,MAChB,CAAE,kBAAmB,SAAU,EAAG,GAAG;AAAA,IACtC,CAAE;AAAA,EACH,CAAE;AAEF,gCAAW,MAAM;AAChB,QAAK,CAAE,QAAS;AACf;AAAA,IACD;AACA,UAAM,gBAAgB;AACtB,yBAAAC,SAAU;AAAA,MACT,UAAM,yBAAc,mBAAmB;AAAA,QACtC,MAAM;AAAA,MACP,CAAE;AAAA,MACF,OAAO;AAAA,IACR,CAAE,EAAE,KAAM,CAAE,QAAS;AAEpB,UAAK,kBAAkB,QAAS;AAC/B,yBAAkB,IAAI,QAAQ,IAAK,YAAa,CAAE;AAAA,MACnD;AAAA,IACD,CAAE;AAAA,EACH,GAAG,CAAE,MAAO,CAAE;AAEd,QAAM,qBAAqB,UAAU,kBAAkB;AACvD,QAAM,cAAc;AAAA,IACnB,GAAG,WAAW;AAAA,IACd,gBAAgB,qBACb,WAAW,OAAO,iBAClB;AAAA,EACJ;AAEA,SACC,4EACC;AAAA,gDAAC,qCAAc,OAAM,SACpB;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ;AAAA,QACR,UAAW,CAAE,cAAe;AAC3B,wBAAe,EAAE,WAAW,UAAU,CAAE;AAAA,QACzC;AAAA;AAAA,IACD,GACD;AAAA,IACA,4CAAC,SAAM,GAAG,YAAa,OAAQ,aAC5B,+BACD,gBAEA,4CAAC,+BACE,8BAAI,4CAA6C,GACpD,GAEF;AAAA,KACD;AAEF;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { useState, useEffect } from '@wordpress/element';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\n\nexport default function PostCommentsCountEdit( {\n\tattributes,\n\tcontext,\n\tsetAttributes,\n} ) {\n\tconst { textAlign } = attributes;\n\tconst { postId } = context;\n\tconst [ commentsCount, setCommentsCount ] = useState();\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( ! postId ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentPostId = postId;\n\t\tapiFetch( {\n\t\t\tpath: addQueryArgs( '/wp/v2/comments', {\n\t\t\t\tpost: postId,\n\t\t\t} ),\n\t\t\tparse: false,\n\t\t} ).then( ( res ) => {\n\t\t\t// Stale requests will have the `currentPostId` of an older closure.\n\t\t\tif ( currentPostId === postId ) {\n\t\t\t\tsetCommentsCount( res.headers.get( 'X-WP-Total' ) );\n\t\t\t}\n\t\t} );\n\t}, [ postId ] );\n\n\tconst hasPostAndComments = postId && commentsCount !== undefined;\n\tconst blockStyles = {\n\t\t...blockProps.style,\n\t\ttextDecoration: hasPostAndComments\n\t\t\t? blockProps.style?.textDecoration\n\t\t\t: undefined,\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</BlockControls>\n\t\t\t<div { ...blockProps } style={ blockStyles }>\n\t\t\t\t{ hasPostAndComments ? commentsCount : '0' }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,0BAIO;AACP,qBAAoC;AACpC,uBAAqB;AACrB,iBAA6B;AA2C3B;AAzCa,SAAR,sBAAwC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,EAAE,UAAU,IAAI;AACtB,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,CAAE,eAAe,gBAAiB,QAAI,yBAAS;AACrD,QAAM,iBAAa,mCAAe;AAAA,IACjC,eAAW,YAAAA,SAAM;AAAA,MAChB,CAAE,kBAAmB,SAAU,EAAG,GAAG;AAAA,IACtC,CAAE;AAAA,EACH,CAAE;AAEF,gCAAW,MAAM;AAChB,QAAK,CAAE,QAAS;AACf;AAAA,IACD;AACA,UAAM,gBAAgB;AACtB,yBAAAC,SAAU;AAAA,MACT,UAAM,yBAAc,mBAAmB;AAAA,QACtC,MAAM;AAAA,MACP,CAAE;AAAA,MACF,OAAO;AAAA,IACR,CAAE,EAAE,KAAM,CAAE,QAAS;AAEpB,UAAK,kBAAkB,QAAS;AAC/B,yBAAkB,IAAI,QAAQ,IAAK,YAAa,CAAE;AAAA,MACnD;AAAA,IACD,CAAE;AAAA,EACH,GAAG,CAAE,MAAO,CAAE;AAEd,QAAM,qBAAqB,UAAU,kBAAkB;AACvD,QAAM,cAAc;AAAA,IACnB,GAAG,WAAW;AAAA,IACd,gBAAgB,qBACb,WAAW,OAAO,iBAClB;AAAA,EACJ;AAEA,SACC,4EACC;AAAA,gDAAC,qCAAc,OAAM,SACpB;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ;AAAA,QACR,UAAW,CAAE,cAAe;AAC3B,wBAAe,EAAE,WAAW,UAAU,CAAE;AAAA,QACzC;AAAA;AAAA,IACD,GACD;AAAA,IACA,4CAAC,SAAM,GAAG,YAAa,OAAQ,aAC5B,+BAAqB,gBAAgB,KACxC;AAAA,KACD;AAEF;",
6
6
  "names": ["clsx", "apiFetch"]
7
7
  }
@@ -75,10 +75,6 @@ function PostCommentsLinkEdit({ context, attributes, setAttributes }) {
75
75
  ),
76
76
  [postType, postId]
77
77
  );
78
- if (!post) {
79
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.Warning, { children: (0, import_i18n.__)("Post Comments Link block: post not found.") }) });
80
- }
81
- const { link } = post;
82
78
  let commentsText;
83
79
  if (commentsCount !== void 0) {
84
80
  const commentsNumber = parseInt(commentsCount);
@@ -102,14 +98,21 @@ function PostCommentsLinkEdit({ context, attributes, setAttributes }) {
102
98
  }
103
99
  }
104
100
  ) }),
105
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...blockProps, children: link && commentsText !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
101
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...blockProps, children: post?.link && commentsText !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
106
102
  "a",
107
103
  {
108
- href: link + "#comments",
104
+ href: post?.link + "#comments",
109
105
  onClick: (event) => event.preventDefault(),
110
106
  children: commentsText
111
107
  }
112
- ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.Warning, { children: (0, import_i18n.__)("Post Comments Link block: post not found.") }) })
108
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
109
+ "a",
110
+ {
111
+ href: "#post-comments-link-pseudo-link",
112
+ onClick: (event) => event.preventDefault(),
113
+ children: (0, import_i18n.__)("No comments")
114
+ }
115
+ ) })
113
116
  ] });
114
117
  }
115
118
  var edit_default = PostCommentsLinkEdit;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/post-comments-link/edit.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tWarning,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nfunction PostCommentsLinkEdit( { context, attributes, setAttributes } ) {\n\tconst { textAlign } = attributes;\n\tconst { postType, postId } = context;\n\tconst [ commentsCount, setCommentsCount ] = useState();\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( ! postId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentPostId = postId;\n\t\tapiFetch( {\n\t\t\tpath: addQueryArgs( '/wp/v2/comments', {\n\t\t\t\tpost: postId,\n\t\t\t} ),\n\t\t\tparse: false,\n\t\t} ).then( ( res ) => {\n\t\t\t// Stale requests will have the `currentPostId` of an older closure.\n\t\t\tif ( currentPostId === postId ) {\n\t\t\t\tsetCommentsCount( res.headers.get( 'X-WP-Total' ) );\n\t\t\t}\n\t\t} );\n\t}, [ postId ] );\n\n\tconst post = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t),\n\t\t[ postType, postId ]\n\t);\n\n\tif ( ! post ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ __( 'Post Comments Link block: post not found.' ) }\n\t\t\t\t</Warning>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst { link } = post;\n\n\tlet commentsText;\n\tif ( commentsCount !== undefined ) {\n\t\tconst commentsNumber = parseInt( commentsCount );\n\n\t\tif ( commentsNumber === 0 ) {\n\t\t\tcommentsText = __( 'No comments' );\n\t\t} else {\n\t\t\tcommentsText = sprintf(\n\t\t\t\t/* translators: %s: Number of comments */\n\t\t\t\t_n( '%s comment', '%s comments', commentsNumber ),\n\t\t\t\tcommentsNumber.toLocaleString()\n\t\t\t);\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</BlockControls>\n\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ link && commentsText !== undefined ? (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={ link + '#comments' }\n\t\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ commentsText }\n\t\t\t\t\t</a>\n\t\t\t\t) : (\n\t\t\t\t\t<Warning>\n\t\t\t\t\t\t{ __(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nD,GACD;AAAA,EAEF;AAEA,QAAM,EAAE,KAAK,IAAI;AAEjB,MAAI;AACJ,MAAK,kBAAkB,QAAY;AAClC,UAAM,iBAAiB,SAAU,aAAc;AAE/C,QAAK,mBAAmB,GAAI;AAC3B,yBAAe,gBAAI,aAAc;AAAA,IAClC,OAAO;AACN,yBAAe;AAAA;AAAA,YAEd,gBAAI,cAAc,eAAe,cAAe;AAAA,QAChD,eAAe,eAAe;AAAA,MAC/B;AAAA,IACD;AAAA,EACD;AAEA,SACC,4EACC;AAAA,gDAAC,qCAAc,OAAM,SACpB;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ;AAAA,QACR,UAAW,CAAE,cAAe;AAC3B,wBAAe,EAAE,WAAW,UAAU,CAAE;AAAA,QACzC;AAAA;AAAA,IACD,GACD;AAAA,IAEA,4CAAC,SAAM,GAAG,YACP,kBAAQ,iBAAiB,SAC1B;AAAA,MAAC;AAAA;AAAA,QACA,MAAO,OAAO;AAAA,QACd,SAAU,CAAE,UAAW,MAAM,eAAe;AAAA,QAE1C;AAAA;AAAA,IACH,IAEA,4CAAC,+BACE,8BAAI,2CAA4C,GACnD,GAEF;AAAA,KACD;AAEF;AAEA,IAAO,eAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nfunction PostCommentsLinkEdit( { context, attributes, setAttributes } ) {\n\tconst { textAlign } = attributes;\n\tconst { postType, postId } = context;\n\tconst [ commentsCount, setCommentsCount ] = useState();\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( ! postId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentPostId = postId;\n\t\tapiFetch( {\n\t\t\tpath: addQueryArgs( '/wp/v2/comments', {\n\t\t\t\tpost: postId,\n\t\t\t} ),\n\t\t\tparse: false,\n\t\t} ).then( ( res ) => {\n\t\t\t// Stale requests will have the `currentPostId` of an older closure.\n\t\t\tif ( currentPostId === postId ) {\n\t\t\t\tsetCommentsCount( res.headers.get( 'X-WP-Total' ) );\n\t\t\t}\n\t\t} );\n\t}, [ postId ] );\n\n\tconst post = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t),\n\t\t[ postType, postId ]\n\t);\n\n\tlet commentsText;\n\tif ( commentsCount !== undefined ) {\n\t\tconst commentsNumber = parseInt( commentsCount );\n\n\t\tif ( commentsNumber === 0 ) {\n\t\t\tcommentsText = __( 'No comments' );\n\t\t} else {\n\t\t\tcommentsText = sprintf(\n\t\t\t\t/* translators: %s: Number of comments */\n\t\t\t\t_n( '%s comment', '%s comments', commentsNumber ),\n\t\t\t\tcommentsNumber.toLocaleString()\n\t\t\t);\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</BlockControls>\n\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ post?.link && commentsText !== undefined ? (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={ post?.link + '#comments' }\n\t\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ commentsText }\n\t\t\t\t\t</a>\n\t\t\t\t) : (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref=\"#post-comments-link-pseudo-link\"\n\t\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'No comments' ) }\n\t\t\t\t\t</a>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default PostCommentsLinkEdit;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,0BAIO;AACP,qBAAoC;AACpC,kBAA0B;AAC1B,uBAAqB;AACrB,iBAA6B;AAC7B,kBAAgC;AAChC,uBAAmC;AA0DjC;AAxDF,SAAS,qBAAsB,EAAE,SAAS,YAAY,cAAc,GAAI;AACvE,QAAM,EAAE,UAAU,IAAI;AACtB,QAAM,EAAE,UAAU,OAAO,IAAI;AAC7B,QAAM,CAAE,eAAe,gBAAiB,QAAI,yBAAS;AAErD,QAAM,iBAAa,mCAAe;AAAA,IACjC,eAAW,YAAAA,SAAM;AAAA,MAChB,CAAE,kBAAmB,SAAU,EAAG,GAAG;AAAA,IACtC,CAAE;AAAA,EACH,CAAE;AAEF,gCAAW,MAAM;AAChB,QAAK,CAAE,QAAS;AACf;AAAA,IACD;AAEA,UAAM,gBAAgB;AACtB,yBAAAC,SAAU;AAAA,MACT,UAAM,yBAAc,mBAAmB;AAAA,QACtC,MAAM;AAAA,MACP,CAAE;AAAA,MACF,OAAO;AAAA,IACR,CAAE,EAAE,KAAM,CAAE,QAAS;AAEpB,UAAK,kBAAkB,QAAS;AAC/B,yBAAkB,IAAI,QAAQ,IAAK,YAAa,CAAE;AAAA,MACnD;AAAA,IACD,CAAE;AAAA,EACH,GAAG,CAAE,MAAO,CAAE;AAEd,QAAM,WAAO;AAAA,IACZ,CAAE,WACD,OAAQ,iBAAAC,KAAU,EAAE;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACD,CAAE,UAAU,MAAO;AAAA,EACpB;AAEA,MAAI;AACJ,MAAK,kBAAkB,QAAY;AAClC,UAAM,iBAAiB,SAAU,aAAc;AAE/C,QAAK,mBAAmB,GAAI;AAC3B,yBAAe,gBAAI,aAAc;AAAA,IAClC,OAAO;AACN,yBAAe;AAAA;AAAA,YAEd,gBAAI,cAAc,eAAe,cAAe;AAAA,QAChD,eAAe,eAAe;AAAA,MAC/B;AAAA,IACD;AAAA,EACD;AAEA,SACC,4EACC;AAAA,gDAAC,qCAAc,OAAM,SACpB;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ;AAAA,QACR,UAAW,CAAE,cAAe;AAC3B,wBAAe,EAAE,WAAW,UAAU,CAAE;AAAA,QACzC;AAAA;AAAA,IACD,GACD;AAAA,IAEA,4CAAC,SAAM,GAAG,YACP,gBAAM,QAAQ,iBAAiB,SAChC;AAAA,MAAC;AAAA;AAAA,QACA,MAAO,MAAM,OAAO;AAAA,QACpB,SAAU,CAAE,UAAW,MAAM,eAAe;AAAA,QAE1C;AAAA;AAAA,IACH,IAEA;AAAA,MAAC;AAAA;AAAA,QACA,MAAK;AAAA,QACL,SAAU,CAAE,UAAW,MAAM,eAAe;AAAA,QAE1C,8BAAI,aAAc;AAAA;AAAA,IACrB,GAEF;AAAA,KACD;AAEF;AAEA,IAAO,eAAQ;",
6
6
  "names": ["clsx", "apiFetch", "coreStore"]
7
7
  }
@@ -65,6 +65,18 @@ var settings = {
65
65
  };
66
66
  }
67
67
  };
68
+ if (window.__experimentalContentOnlyPatternInsertion) {
69
+ settings.fields = [
70
+ {
71
+ label: (0, import_i18n.__)("Content"),
72
+ type: "RichText",
73
+ shownByDefault: true,
74
+ mapping: {
75
+ value: "content"
76
+ }
77
+ }
78
+ ];
79
+ }
68
80
  var init = () => (0, import_init_block.default)({ name, metadata: import_block.default, settings });
69
81
  // Annotate the CommonJS export names for ESM import in node:
70
82
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/preformatted/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { preformatted as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\t/* eslint-disable @wordpress/i18n-no-collapsible-whitespace */\n\t\t\t// translators: Sample content for the Preformatted block. Can be replaced with a more locale-adequate work.\n\t\t\tcontent: __(\n\t\t\t\t'EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\\nWindow, very small in the distance, illuminated.\\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;'\n\t\t\t),\n\t\t\t/* eslint-enable @wordpress/i18n-no-collapsible-whitespace */\n\t\t},\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tmerge( attributes, attributesToMerge ) {\n\t\treturn {\n\t\t\tcontent: attributes.content + '\\n\\n' + attributesToMerge.content,\n\t\t};\n\t},\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAAqC;AAKrC,wBAAsB;AACtB,kBAAiB;AACjB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA;AAAA;AAAA,MAGX,aAAS;AAAA,QACR;AAAA,MACD;AAAA;AAAA,IAED;AAAA,EACD;AAAA,EACA,8BAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,MAAO,YAAY,mBAAoB;AACtC,WAAO;AAAA,MACN,SAAS,WAAW,UAAU,SAAS,kBAAkB;AAAA,IAC1D;AAAA,EACD;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { preformatted as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\t/* eslint-disable @wordpress/i18n-no-collapsible-whitespace */\n\t\t\t// translators: Sample content for the Preformatted block. Can be replaced with a more locale-adequate work.\n\t\t\tcontent: __(\n\t\t\t\t'EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\\nWindow, very small in the distance, illuminated.\\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;'\n\t\t\t),\n\t\t\t/* eslint-enable @wordpress/i18n-no-collapsible-whitespace */\n\t\t},\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tmerge( attributes, attributesToMerge ) {\n\t\treturn {\n\t\t\tcontent: attributes.content + '\\n\\n' + attributesToMerge.content,\n\t\t};\n\t},\n};\n\nif ( window.__experimentalContentOnlyPatternInsertion ) {\n\tsettings.fields = [\n\t\t{\n\t\t\tlabel: __( 'Content' ),\n\t\t\ttype: 'RichText',\n\t\t\tshownByDefault: true,\n\t\t\tmapping: {\n\t\t\t\tvalue: 'content',\n\t\t\t},\n\t\t},\n\t];\n}\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAAqC;AAKrC,wBAAsB;AACtB,kBAAiB;AACjB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA;AAAA;AAAA,MAGX,aAAS;AAAA,QACR;AAAA,MACD;AAAA;AAAA,IAED;AAAA,EACD;AAAA,EACA,8BAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,MAAO,YAAY,mBAAoB;AACtC,WAAO;AAAA,MACN,SAAS,WAAW,UAAU,SAAS,kBAAkB;AAAA,IAC1D;AAAA,EACD;AACD;AAEA,IAAK,OAAO,2CAA4C;AACvD,WAAS,SAAS;AAAA,IACjB;AAAA,MACC,WAAO,gBAAI,SAAU;AAAA,MACrB,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,SAAS;AAAA,QACR,OAAO;AAAA,MACR;AAAA,IACD;AAAA,EACD;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
6
6
  "names": ["metadata", "icon", "transforms", "edit", "save", "initBlock", "metadata"]
7
7
  }
@@ -63,6 +63,26 @@ var settings = {
63
63
  save: import_save.default,
64
64
  deprecated: import_deprecated.default
65
65
  };
66
+ if (window.__experimentalContentOnlyPatternInsertion) {
67
+ settings.fields = [
68
+ {
69
+ label: (0, import_i18n.__)("Content"),
70
+ type: "RichText",
71
+ shownByDefault: true,
72
+ mapping: {
73
+ value: "value"
74
+ }
75
+ },
76
+ {
77
+ label: (0, import_i18n.__)("Citation"),
78
+ type: "RichText",
79
+ shownByDefault: false,
80
+ mapping: {
81
+ value: "citation"
82
+ }
83
+ }
84
+ ];
85
+ }
66
86
  var init = () => (0, import_init_block.default)({ name, metadata: import_block.default, settings });
67
87
  // Annotate the CommonJS export names for ESM import in node:
68
88
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/pullquote/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { pullquote as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tvalue:\n\t\t\t\t// translators: Quote serving as example for the Pullquote block. Attributed to Matt Mullenweg.\n\t\t\t\t__(\n\t\t\t\t\t'One of the hardest things to do in technology is disrupt yourself.'\n\t\t\t\t),\n\t\t\tcitation: __( 'Matt Mullenweg' ),\n\t\t},\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAAkC;AAKlC,wBAAsB;AACtB,wBAAuB;AACvB,kBAAiB;AACjB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX;AAAA;AAAA,YAEC;AAAA,UACC;AAAA,QACD;AAAA;AAAA,MACD,cAAU,gBAAI,gBAAiB;AAAA,IAChC;AAAA,EACD;AAAA,EACA,8BAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,8BAAAC;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { pullquote as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tvalue:\n\t\t\t\t// translators: Quote serving as example for the Pullquote block. Attributed to Matt Mullenweg.\n\t\t\t\t__(\n\t\t\t\t\t'One of the hardest things to do in technology is disrupt yourself.'\n\t\t\t\t),\n\t\t\tcitation: __( 'Matt Mullenweg' ),\n\t\t},\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nif ( window.__experimentalContentOnlyPatternInsertion ) {\n\tsettings.fields = [\n\t\t{\n\t\t\tlabel: __( 'Content' ),\n\t\t\ttype: 'RichText',\n\t\t\tshownByDefault: true,\n\t\t\tmapping: {\n\t\t\t\tvalue: 'value',\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Citation' ),\n\t\t\ttype: 'RichText',\n\t\t\tshownByDefault: false,\n\t\t\tmapping: {\n\t\t\t\tvalue: 'citation',\n\t\t\t},\n\t\t},\n\t];\n}\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAAkC;AAKlC,wBAAsB;AACtB,wBAAuB;AACvB,kBAAiB;AACjB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX;AAAA;AAAA,YAEC;AAAA,UACC;AAAA,QACD;AAAA;AAAA,MACD,cAAU,gBAAI,gBAAiB;AAAA,IAChC;AAAA,EACD;AAAA,EACA,8BAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,8BAAAC;AACD;AAEA,IAAK,OAAO,2CAA4C;AACvD,WAAS,SAAS;AAAA,IACjB;AAAA,MACC,WAAO,gBAAI,SAAU;AAAA,MACrB,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,SAAS;AAAA,QACR,OAAO;AAAA,MACR;AAAA,IACD;AAAA,IACA;AAAA,MACC,WAAO,gBAAI,UAAW;AAAA,MACtB,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,SAAS;AAAA,QACR,OAAO;AAAA,MACR;AAAA,IACD;AAAA,EACD;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
6
6
  "names": ["metadata", "icon", "transforms", "edit", "save", "deprecated", "initBlock", "metadata"]
7
7
  }
@@ -52,6 +52,34 @@ var settings = {
52
52
  variations: import_variations.default,
53
53
  edit: import_edit.default
54
54
  };
55
+ if (window.__experimentalContentOnlyPatternInsertion) {
56
+ settings.fields = [
57
+ {
58
+ label: (0, import_i18n.__)("Label"),
59
+ type: "RichText",
60
+ shownByDefault: true,
61
+ mapping: {
62
+ value: "label"
63
+ }
64
+ },
65
+ {
66
+ label: (0, import_i18n.__)("Button text"),
67
+ type: "RichText",
68
+ shownByDefault: false,
69
+ mapping: {
70
+ value: "buttonText"
71
+ }
72
+ },
73
+ {
74
+ label: (0, import_i18n.__)("Placeholder"),
75
+ type: "RichText",
76
+ shownByDefault: false,
77
+ mapping: {
78
+ value: "placeholder"
79
+ }
80
+ }
81
+ ];
82
+ }
55
83
  var init = () => (0, import_init_block.default)({ name, metadata: import_block.default, settings });
56
84
  // Annotate the CommonJS export names for ESM import in node:
57
85
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/search/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { search 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 variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: { buttonText: __( 'Search' ), label: __( 'Search' ) },\n\t\tviewportWidth: 400,\n\t},\n\tvariations,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAA+B;AAK/B,wBAAsB;AACtB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,SAAS;AAAA,IACR,YAAY,EAAE,gBAAY,gBAAI,QAAS,GAAG,WAAO,gBAAI,QAAS,EAAE;AAAA,IAChE,eAAe;AAAA,EAChB;AAAA,EACA,8BAAAC;AAAA,EACA,kBAAAC;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { search 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 variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: { buttonText: __( 'Search' ), label: __( 'Search' ) },\n\t\tviewportWidth: 400,\n\t},\n\tvariations,\n\tedit,\n};\n\nif ( window.__experimentalContentOnlyPatternInsertion ) {\n\tsettings.fields = [\n\t\t{\n\t\t\tlabel: __( 'Label' ),\n\t\t\ttype: 'RichText',\n\t\t\tshownByDefault: true,\n\t\t\tmapping: {\n\t\t\t\tvalue: 'label',\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Button text' ),\n\t\t\ttype: 'RichText',\n\t\t\tshownByDefault: false,\n\t\t\tmapping: {\n\t\t\t\tvalue: 'buttonText',\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Placeholder' ),\n\t\t\ttype: 'RichText',\n\t\t\tshownByDefault: false,\n\t\t\tmapping: {\n\t\t\t\tvalue: 'placeholder',\n\t\t\t},\n\t\t},\n\t];\n}\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAA+B;AAK/B,wBAAsB;AACtB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,SAAS;AAAA,IACR,YAAY,EAAE,gBAAY,gBAAI,QAAS,GAAG,WAAO,gBAAI,QAAS,EAAE;AAAA,IAChE,eAAe;AAAA,EAChB;AAAA,EACA,8BAAAC;AAAA,EACA,kBAAAC;AACD;AAEA,IAAK,OAAO,2CAA4C;AACvD,WAAS,SAAS;AAAA,IACjB;AAAA,MACC,WAAO,gBAAI,OAAQ;AAAA,MACnB,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,SAAS;AAAA,QACR,OAAO;AAAA,MACR;AAAA,IACD;AAAA,IACA;AAAA,MACC,WAAO,gBAAI,aAAc;AAAA,MACzB,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,SAAS;AAAA,QACR,OAAO;AAAA,MACR;AAAA,IACD;AAAA,IACA;AAAA,MACC,WAAO,gBAAI,aAAc;AAAA,MACzB,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,SAAS;AAAA,QACR,OAAO;AAAA,MACR;AAAA,IACD;AAAA,EACD;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
6
6
  "names": ["metadata", "icon", "variations", "edit", "initBlock", "metadata"]
7
7
  }
@@ -36,6 +36,7 @@ __export(social_link_exports, {
36
36
  settings: () => settings
37
37
  });
38
38
  module.exports = __toCommonJS(social_link_exports);
39
+ var import_i18n = require("@wordpress/i18n");
39
40
  var import_icons = require("@wordpress/icons");
40
41
  var import_init_block = __toESM(require("../utils/init-block"));
41
42
  var import_edit = __toESM(require("./edit"));
@@ -47,6 +48,27 @@ var settings = {
47
48
  edit: import_edit.default,
48
49
  variations: import_variations.default
49
50
  };
51
+ if (window.__experimentalContentOnlyPatternInsertion) {
52
+ settings.fields = [
53
+ {
54
+ label: (0, import_i18n.__)("Link"),
55
+ type: "Link",
56
+ shownByDefault: true,
57
+ mapping: {
58
+ href: "url",
59
+ rel: "rel"
60
+ }
61
+ },
62
+ {
63
+ label: (0, import_i18n.__)("Label"),
64
+ type: "RichText",
65
+ shownByDefault: false,
66
+ mapping: {
67
+ value: "label"
68
+ }
69
+ }
70
+ ];
71
+ }
50
72
  var init = () => (0, import_init_block.default)({ name, metadata: import_block.default, settings });
51
73
  // Annotate the CommonJS export names for ESM import in node:
52
74
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/social-link/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { share as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport edit from './edit';\nimport metadata from './block.json';\nimport variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tvariations,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,mBAA8B;AAK9B,wBAAsB;AACtB,kBAAiB;AACjB,mBAAqB;AACrB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,8BAAAC;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { share as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport edit from './edit';\nimport metadata from './block.json';\nimport variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tvariations,\n};\n\nif ( window.__experimentalContentOnlyPatternInsertion ) {\n\tsettings.fields = [\n\t\t{\n\t\t\tlabel: __( 'Link' ),\n\t\t\ttype: 'Link',\n\t\t\tshownByDefault: true,\n\t\t\tmapping: {\n\t\t\t\thref: 'url',\n\t\t\t\trel: 'rel',\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Label' ),\n\t\t\ttype: 'RichText',\n\t\t\tshownByDefault: false,\n\t\t\tmapping: {\n\t\t\t\tvalue: 'label',\n\t\t\t},\n\t\t},\n\t];\n}\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAA8B;AAK9B,wBAAsB;AACtB,kBAAiB;AACjB,mBAAqB;AACrB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,8BAAAC;AACD;AAEA,IAAK,OAAO,2CAA4C;AACvD,WAAS,SAAS;AAAA,IACjB;AAAA,MACC,WAAO,gBAAI,MAAO;AAAA,MAClB,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,SAAS;AAAA,QACR,MAAM;AAAA,QACN,KAAK;AAAA,MACN;AAAA,IACD;AAAA,IACA;AAAA,MACC,WAAO,gBAAI,OAAQ;AAAA,MACnB,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,SAAS;AAAA,QACR,OAAO;AAAA,MACR;AAAA,IACD;AAAA,EACD;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
6
6
  "names": ["metadata", "icon", "edit", "variations", "initBlock", "metadata"]
7
7
  }
@@ -171,7 +171,7 @@ function SocialLinksEdit(props) {
171
171
  {
172
172
  __next40pxDefaultSize: true,
173
173
  __nextHasNoMarginBottom: true,
174
- label: (0, import_i18n.__)("Icon Size"),
174
+ label: (0, import_i18n.__)("Icon size"),
175
175
  onChange: (newSize) => {
176
176
  setAttributes({
177
177
  size: newSize === "" ? void 0 : newSize
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/social-links/edit.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseInnerBlocksProps,\n\tuseBlockProps,\n\tInspectorControls,\n\tContrastChecker,\n\twithColors,\n\tInnerBlocks,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tToggleControl,\n\tSelectControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst sizeOptions = [\n\t{ label: __( 'Default' ), value: '' },\n\t{ label: __( 'Small' ), value: 'has-small-icon-size' },\n\t{ label: __( 'Normal' ), value: 'has-normal-icon-size' },\n\t{ label: __( 'Large' ), value: 'has-large-icon-size' },\n\t{ label: __( 'Huge' ), value: 'has-huge-icon-size' },\n];\n\nexport function SocialLinksEdit( props ) {\n\tconst {\n\t\tclientId,\n\t\tattributes,\n\t\ticonBackgroundColor,\n\t\ticonColor,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tsetIconBackgroundColor,\n\t\tsetIconColor,\n\t} = props;\n\n\tconst {\n\t\ticonBackgroundColorValue,\n\t\ticonColorValue,\n\t\topenInNewTab,\n\t\tshowLabels,\n\t\tsize,\n\t} = attributes;\n\n\tconst { hasSocialIcons, hasSelectedChild } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockCount, hasSelectedInnerBlock } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn {\n\t\t\t\thasSocialIcons: getBlockCount( clientId ) > 0,\n\t\t\t\thasSelectedChild: hasSelectedInnerBlock( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst hasAnySelected = isSelected || hasSelectedChild;\n\n\tconst logosOnly = attributes.className?.includes( 'is-style-logos-only' );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\t// Remove icon background color when logos only style is selected or\n\t// restore it when any other style is selected.\n\tuseEffect( () => {\n\t\tif ( logosOnly ) {\n\t\t\tlet restore;\n\t\t\tsetAttributes( ( prev ) => {\n\t\t\t\trestore = {\n\t\t\t\t\ticonBackgroundColor: prev.iconBackgroundColor,\n\t\t\t\t\ticonBackgroundColorValue: prev.iconBackgroundColorValue,\n\t\t\t\t\tcustomIconBackgroundColor: prev.customIconBackgroundColor,\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\ticonBackgroundColor: undefined,\n\t\t\t\t\ticonBackgroundColorValue: undefined,\n\t\t\t\t\tcustomIconBackgroundColor: undefined,\n\t\t\t\t};\n\t\t\t} );\n\n\t\t\treturn () => setAttributes( { ...restore } );\n\t\t}\n\t}, [ logosOnly, setAttributes ] );\n\n\t// Fallback color values are used maintain selections in case switching\n\t// themes and named colors in palette do not match.\n\tconst className = clsx( size, {\n\t\t'has-visible-labels': showLabels,\n\t\t'has-icon-color': iconColor.color || iconColorValue,\n\t\t'has-icon-background-color':\n\t\t\ticonBackgroundColor.color || iconBackgroundColorValue,\n\t} );\n\n\tconst blockProps = useBlockProps( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplateLock: false,\n\t\torientation: attributes.layout?.orientation ?? 'horizontal',\n\t\t__experimentalAppenderTagName: 'li',\n\t\trenderAppender:\n\t\t\t! hasSocialIcons || hasAnySelected\n\t\t\t\t? InnerBlocks.ButtonBlockAppender\n\t\t\t\t: undefined,\n\t} );\n\n\tconst colorSettings = [\n\t\t{\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconColor.color || iconColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconColor( colorValue );\n\t\t\t\tsetAttributes( { iconColorValue: colorValue } );\n\t\t\t},\n\t\t\tlabel: __( 'Icon color' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconColor( undefined );\n\t\t\t\tsetAttributes( { iconColorValue: undefined } );\n\t\t\t},\n\t\t},\n\t];\n\n\tif ( ! logosOnly ) {\n\t\tcolorSettings.push( {\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconBackgroundColor.color || iconBackgroundColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconBackgroundColor( colorValue );\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ticonBackgroundColorValue: colorValue,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tlabel: __( 'Icon background' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconBackgroundColor( undefined );\n\t\t\t\tsetAttributes( { iconBackgroundColorValue: undefined } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\treturn (\n\t\t<>\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\topenInNewTab: false,\n\t\t\t\t\t\t\tshowLabels: false,\n\t\t\t\t\t\t\tsize: undefined,\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\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! size }\n\t\t\t\t\t\tlabel={ __( 'Icon size' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { size: undefined } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Icon Size' ) }\n\t\t\t\t\t\t\tonChange={ ( newSize ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tsize: newSize === '' ? undefined : newSize,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tvalue={ size ?? '' }\n\t\t\t\t\t\t\toptions={ sizeOptions }\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\tisShownByDefault\n\t\t\t\t\t\tlabel={ __( 'Show text' ) }\n\t\t\t\t\t\thasValue={ () => !! showLabels }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showLabels: false } )\n\t\t\t\t\t\t}\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={ __( 'Show text' ) }\n\t\t\t\t\t\t\tchecked={ showLabels }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showLabels: ! showLabels } )\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\tisShownByDefault\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\thasValue={ () => !! openInNewTab }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: false } )\n\t\t\t\t\t\t}\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={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\topenInNewTab: ! openInNewTab,\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</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t{ colorGradientSettings.hasColorsOrGradients && (\n\t\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t\t{ colorSettings.map(\n\t\t\t\t\t\t( { onChange, label, value, resetAllFilter } ) => (\n\t\t\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t\t\tkey={ `social-links-color-${ label }` }\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcolorValue: value,\n\t\t\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\t\t\tonColorChange: onChange,\n\t\t\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\t\t\tresetAllFilter,\n\t\t\t\t\t\t\t\t\t\tenableAlpha: true,\n\t\t\t\t\t\t\t\t\t\tclearable: true,\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\tpanelId={ clientId }\n\t\t\t\t\t\t\t\t{ ...colorGradientSettings }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! logosOnly && (\n\t\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\ttextColor: iconColorValue,\n\t\t\t\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisLargeText={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<ul { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n\nconst iconColorAttributes = {\n\ticonColor: 'icon-color',\n\ticonBackgroundColor: 'icon-background-color',\n};\n\nexport default withColors( iconColorAttributes )( SocialLinksEdit );\n"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseInnerBlocksProps,\n\tuseBlockProps,\n\tInspectorControls,\n\tContrastChecker,\n\twithColors,\n\tInnerBlocks,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tToggleControl,\n\tSelectControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst sizeOptions = [\n\t{ label: __( 'Default' ), value: '' },\n\t{ label: __( 'Small' ), value: 'has-small-icon-size' },\n\t{ label: __( 'Normal' ), value: 'has-normal-icon-size' },\n\t{ label: __( 'Large' ), value: 'has-large-icon-size' },\n\t{ label: __( 'Huge' ), value: 'has-huge-icon-size' },\n];\n\nexport function SocialLinksEdit( props ) {\n\tconst {\n\t\tclientId,\n\t\tattributes,\n\t\ticonBackgroundColor,\n\t\ticonColor,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tsetIconBackgroundColor,\n\t\tsetIconColor,\n\t} = props;\n\n\tconst {\n\t\ticonBackgroundColorValue,\n\t\ticonColorValue,\n\t\topenInNewTab,\n\t\tshowLabels,\n\t\tsize,\n\t} = attributes;\n\n\tconst { hasSocialIcons, hasSelectedChild } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockCount, hasSelectedInnerBlock } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn {\n\t\t\t\thasSocialIcons: getBlockCount( clientId ) > 0,\n\t\t\t\thasSelectedChild: hasSelectedInnerBlock( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst hasAnySelected = isSelected || hasSelectedChild;\n\n\tconst logosOnly = attributes.className?.includes( 'is-style-logos-only' );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\t// Remove icon background color when logos only style is selected or\n\t// restore it when any other style is selected.\n\tuseEffect( () => {\n\t\tif ( logosOnly ) {\n\t\t\tlet restore;\n\t\t\tsetAttributes( ( prev ) => {\n\t\t\t\trestore = {\n\t\t\t\t\ticonBackgroundColor: prev.iconBackgroundColor,\n\t\t\t\t\ticonBackgroundColorValue: prev.iconBackgroundColorValue,\n\t\t\t\t\tcustomIconBackgroundColor: prev.customIconBackgroundColor,\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\ticonBackgroundColor: undefined,\n\t\t\t\t\ticonBackgroundColorValue: undefined,\n\t\t\t\t\tcustomIconBackgroundColor: undefined,\n\t\t\t\t};\n\t\t\t} );\n\n\t\t\treturn () => setAttributes( { ...restore } );\n\t\t}\n\t}, [ logosOnly, setAttributes ] );\n\n\t// Fallback color values are used maintain selections in case switching\n\t// themes and named colors in palette do not match.\n\tconst className = clsx( size, {\n\t\t'has-visible-labels': showLabels,\n\t\t'has-icon-color': iconColor.color || iconColorValue,\n\t\t'has-icon-background-color':\n\t\t\ticonBackgroundColor.color || iconBackgroundColorValue,\n\t} );\n\n\tconst blockProps = useBlockProps( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplateLock: false,\n\t\torientation: attributes.layout?.orientation ?? 'horizontal',\n\t\t__experimentalAppenderTagName: 'li',\n\t\trenderAppender:\n\t\t\t! hasSocialIcons || hasAnySelected\n\t\t\t\t? InnerBlocks.ButtonBlockAppender\n\t\t\t\t: undefined,\n\t} );\n\n\tconst colorSettings = [\n\t\t{\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconColor.color || iconColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconColor( colorValue );\n\t\t\t\tsetAttributes( { iconColorValue: colorValue } );\n\t\t\t},\n\t\t\tlabel: __( 'Icon color' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconColor( undefined );\n\t\t\t\tsetAttributes( { iconColorValue: undefined } );\n\t\t\t},\n\t\t},\n\t];\n\n\tif ( ! logosOnly ) {\n\t\tcolorSettings.push( {\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconBackgroundColor.color || iconBackgroundColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconBackgroundColor( colorValue );\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ticonBackgroundColorValue: colorValue,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tlabel: __( 'Icon background' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconBackgroundColor( undefined );\n\t\t\t\tsetAttributes( { iconBackgroundColorValue: undefined } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\treturn (\n\t\t<>\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\topenInNewTab: false,\n\t\t\t\t\t\t\tshowLabels: false,\n\t\t\t\t\t\t\tsize: undefined,\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\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! size }\n\t\t\t\t\t\tlabel={ __( 'Icon size' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { size: undefined } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Icon size' ) }\n\t\t\t\t\t\t\tonChange={ ( newSize ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tsize: newSize === '' ? undefined : newSize,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tvalue={ size ?? '' }\n\t\t\t\t\t\t\toptions={ sizeOptions }\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\tisShownByDefault\n\t\t\t\t\t\tlabel={ __( 'Show text' ) }\n\t\t\t\t\t\thasValue={ () => !! showLabels }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showLabels: false } )\n\t\t\t\t\t\t}\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={ __( 'Show text' ) }\n\t\t\t\t\t\t\tchecked={ showLabels }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showLabels: ! showLabels } )\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\tisShownByDefault\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\thasValue={ () => !! openInNewTab }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: false } )\n\t\t\t\t\t\t}\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={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\topenInNewTab: ! openInNewTab,\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</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t{ colorGradientSettings.hasColorsOrGradients && (\n\t\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t\t{ colorSettings.map(\n\t\t\t\t\t\t( { onChange, label, value, resetAllFilter } ) => (\n\t\t\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t\t\tkey={ `social-links-color-${ label }` }\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcolorValue: value,\n\t\t\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\t\t\tonColorChange: onChange,\n\t\t\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\t\t\tresetAllFilter,\n\t\t\t\t\t\t\t\t\t\tenableAlpha: true,\n\t\t\t\t\t\t\t\t\t\tclearable: true,\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\tpanelId={ clientId }\n\t\t\t\t\t\t\t\t{ ...colorGradientSettings }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! logosOnly && (\n\t\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\ttextColor: iconColorValue,\n\t\t\t\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisLargeText={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<ul { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n\nconst iconColorAttributes = {\n\ticonColor: 'icon-color',\n\ticonBackgroundColor: 'icon-background-color',\n};\n\nexport default withColors( iconColorAttributes )( SocialLinksEdit );\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,qBAA0B;AAC1B,0BAUO;AACP,wBAKO;AACP,kBAAmB;AACnB,kBAA0B;AAK1B,mBAA+C;AAiI7C;AA/HF,IAAM,cAAc;AAAA,EACnB,EAAE,WAAO,gBAAI,SAAU,GAAG,OAAO,GAAG;AAAA,EACpC,EAAE,WAAO,gBAAI,OAAQ,GAAG,OAAO,sBAAsB;AAAA,EACrD,EAAE,WAAO,gBAAI,QAAS,GAAG,OAAO,uBAAuB;AAAA,EACvD,EAAE,WAAO,gBAAI,OAAQ,GAAG,OAAO,sBAAsB;AAAA,EACrD,EAAE,WAAO,gBAAI,MAAO,GAAG,OAAO,qBAAqB;AACpD;AAEO,SAAS,gBAAiB,OAAQ;AACxC,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI;AAEJ,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI;AAEJ,QAAM,EAAE,gBAAgB,iBAAiB,QAAI;AAAA,IAC5C,CAAE,WAAY;AACb,YAAM,EAAE,eAAe,sBAAsB,IAC5C,OAAQ,oBAAAA,K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AA,QAepC;AAAA,MAEF;AAAA,MACE,CAAE,aACH;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,YACJ,WAAW;AAAA,YACX,iBAAiB;AAAA,UAClB;AAAA,UACA,aAAc;AAAA;AAAA,MACf;AAAA,OAEF;AAAA,IAED,4CAAC,QAAK,GAAG,kBAAmB;AAAA,KAC7B;AAEF;AAEA,IAAM,sBAAsB;AAAA,EAC3B,WAAW;AAAA,EACX,qBAAqB;AACtB;AAEA,IAAO,mBAAQ,gCAAY,mBAAoB,EAAG,eAAgB;",
6
6
  "names": ["blockEditorStore", "clsx", "useMultipleOriginColorsAndGradients", "ToolsPanel", "ToolsPanelItem", "ColorGradientSettingsDropdown"]
7
7
  }
@@ -3,8 +3,23 @@
3
3
  // packages/block-library/src/tabs/view.js
4
4
  var import_interactivity = require("@wordpress/interactivity");
5
5
  function createReadOnlyProxy(obj) {
6
+ const arrayMutationMethods = /* @__PURE__ */ new Set([
7
+ "push",
8
+ "pop",
9
+ "shift",
10
+ "unshift",
11
+ "splice",
12
+ "sort",
13
+ "reverse",
14
+ "copyWithin",
15
+ "fill"
16
+ ]);
6
17
  return new Proxy(obj, {
7
18
  get(target, prop) {
19
+ if (Array.isArray(target) && arrayMutationMethods.has(prop)) {
20
+ return () => {
21
+ };
22
+ }
8
23
  const value = target[prop];
9
24
  if (typeof value === "object" && value !== null) {
10
25
  return createReadOnlyProxy(value);
@@ -173,21 +188,19 @@ var { actions: privateActions, state: privateState } = (0, import_interactivity.
173
188
  /**
174
189
  * Gets the index of the active tab element whether it
175
190
  * is a tab label or tab panel.
176
- * Public API for third-party access.
177
191
  *
178
192
  * @type {number|null}
179
193
  */
180
194
  get tabIndex() {
181
- return createReadOnlyProxy(privateState.tabIndex);
195
+ return privateState.tabIndex;
182
196
  },
183
197
  /**
184
198
  * Whether the tab panel or tab label is the active tab.
185
- * Public API for third-party access.
186
199
  *
187
200
  * @type {boolean}
188
201
  */
189
202
  get isActiveTab() {
190
- return createReadOnlyProxy(privateState.isActiveTab);
203
+ return privateState.isActiveTab;
191
204
  }
192
205
  },
193
206
  actions: {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/tabs/view.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tstore,\n\tgetContext,\n\tgetElement,\n\twithSyncEvent,\n} from '@wordpress/interactivity';\n\nfunction createReadOnlyProxy( obj ) {\n\treturn new Proxy( obj, {\n\t\tget( target, prop ) {\n\t\t\tconst value = target[ prop ];\n\t\t\tif ( typeof value === 'object' && value !== null ) {\n\t\t\t\treturn createReadOnlyProxy( value );\n\t\t\t}\n\t\t\treturn value;\n\t\t},\n\t\tset() {\n\t\t\treturn false;\n\t\t},\n\t\tdeleteProperty() {\n\t\t\treturn false;\n\t\t},\n\t} );\n}\n\n// Private store for internal tabs functionality and security.\nconst { actions: privateActions, state: privateState } = store(\n\t'core/tabs/private',\n\t{\n\t\tstate: {\n\t\t\t/**\n\t\t\t * Gets a contextually aware list of tabs for the current tabs block.\n\t\t\t *\n\t\t\t * @type {Array}\n\t\t\t */\n\t\t\tget tabsList() {\n\t\t\t\tconst context = getContext();\n\t\t\t\tconst tabsId = context?.tabsId;\n\t\t\t\tconst tabsList = privateState[ tabsId ];\n\t\t\t\treturn tabsList;\n\t\t\t},\n\t\t\t/**\n\t\t\t * Gets the index of the active tab element whether it\n\t\t\t * is a tab label or tab panel.\n\t\t\t *\n\t\t\t * @type {number|null}\n\t\t\t */\n\t\t\tget tabIndex() {\n\t\t\t\tconst { attributes } = getElement();\n\t\t\t\tconst tabId = attributes?.id?.replace( 'tab__', '' ) || null;\n\t\t\t\tif ( ! tabId ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tconst { tabsList } = privateState;\n\t\t\t\tconst tabIndex = tabsList.findIndex( ( t ) => t.id === tabId );\n\t\t\t\treturn tabIndex;\n\t\t\t},\n\t\t\t/**\n\t\t\t * Whether the tab panel or tab label is the active tab.\n\t\t\t *\n\t\t\t * @type {boolean}\n\t\t\t */\n\t\t\tget isActiveTab() {\n\t\t\t\tconst { activeTabIndex } = getContext();\n\t\t\t\tconst { tabIndex } = privateState;\n\t\t\t\treturn activeTabIndex === tabIndex;\n\t\t\t},\n\t\t\t/**\n\t\t\t * The value of the tabindex attribute.\n\t\t\t *\n\t\t\t * @type {false|string}\n\t\t\t */\n\t\t\tget tabIndexAttribute() {\n\t\t\t\treturn privateState.isActiveTab ? -1 : 0;\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\t/**\n\t\t\t * Handles the keydown events for the tab label and tabs controller.\n\t\t\t *\n\t\t\t * @param {KeyboardEvent} event The keydown event.\n\t\t\t */\n\t\t\thandleTabKeyDown: withSyncEvent( ( event ) => {\n\t\t\t\t// If this is the enter key then lets get the tab index from context and set the active tab to that index.\n\t\t\t\tconst { isVertical } = getContext();\n\t\t\t\tif ( event.key === 'Enter' ) {\n\t\t\t\t\tconst { tabIndex } = privateState;\n\t\t\t\t\tif ( tabIndex !== null ) {\n\t\t\t\t\t\tprivateActions.setActiveTab( tabIndex );\n\t\t\t\t\t}\n\t\t\t\t} else if ( event.key === 'ArrowRight' && ! isVertical ) {\n\t\t\t\t\tconst { tabIndex } = privateState;\n\t\t\t\t\tif ( tabIndex !== null ) {\n\t\t\t\t\t\tprivateActions.setActiveTab( tabIndex + 1 );\n\t\t\t\t\t}\n\t\t\t\t} else if ( event.key === 'ArrowLeft' && ! isVertical ) {\n\t\t\t\t\tconst { tabIndex } = privateState;\n\t\t\t\t\tif ( tabIndex !== null ) {\n\t\t\t\t\t\tprivateActions.setActiveTab( tabIndex - 1 );\n\t\t\t\t\t}\n\t\t\t\t} else if ( event.key === 'ArrowDown' && isVertical ) {\n\t\t\t\t\tconst { tabIndex } = privateState;\n\t\t\t\t\tif ( tabIndex !== null ) {\n\t\t\t\t\t\tprivateActions.setActiveTab( tabIndex + 1 );\n\t\t\t\t\t}\n\t\t\t\t} else if ( event.key === 'ArrowUp' && isVertical ) {\n\t\t\t\t\tconst { tabIndex } = privateState;\n\t\t\t\t\tif ( tabIndex !== null ) {\n\t\t\t\t\t\tprivateActions.setActiveTab( tabIndex - 1 );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} ),\n\t\t\t/**\n\t\t\t * Handles the click event for the tab label.\n\t\t\t *\n\t\t\t * @param {MouseEvent} event The click event.\n\t\t\t */\n\t\t\thandleTabClick: withSyncEvent( ( event ) => {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tconst { tabIndex } = privateState;\n\t\t\t\tif ( tabIndex !== null ) {\n\t\t\t\t\tprivateActions.setActiveTab( tabIndex );\n\t\t\t\t}\n\t\t\t} ),\n\t\t\t/**\n\t\t\t * Sets the active tab index (internal implementation).\n\t\t\t *\n\t\t\t * @param {number} tabIndex The index of the active tab.\n\t\t\t * @param {boolean} scrollToTab Whether to scroll to the tab element.\n\t\t\t */\n\t\t\tsetActiveTab: ( tabIndex, scrollToTab = false ) => {\n\t\t\t\tconst context = getContext();\n\t\t\t\tcontext.activeTabIndex = tabIndex;\n\t\t\t\tif ( scrollToTab ) {\n\t\t\t\t\tconst tabId = privateState.tabsList[ tabIndex ].id;\n\t\t\t\t\tconst tabElement = document.getElementById( tabId );\n\t\t\t\t\tif ( tabElement ) {\n\t\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\t\ttabElement.scrollIntoView( { behavior: 'smooth' } );\n\t\t\t\t\t\t}, 100 );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\tcallbacks: {\n\t\t\t/**\n\t\t\t * When the tabs are initialized, we need to check if there is a hash in the url and if so if it exists in the current tabsList, set the active tab to that index.\n\t\t\t *\n\t\t\t */\n\t\t\tonTabsInit: () => {\n\t\t\t\tconst { tabsList } = privateState;\n\t\t\t\tif ( tabsList.length === 0 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst { hash } = window.location;\n\t\t\t\tconst tabId = hash.replace( '#', '' );\n\t\t\t\tconst tabIndex = tabsList.findIndex( ( t ) => t.id === tabId );\n\t\t\t\t// Check if tabIndex is a positive number and if so we'll auto activate that tab.\n\t\t\t\tif ( tabIndex >= 0 ) {\n\t\t\t\t\tprivateActions.setActiveTab( tabIndex, true );\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tlock: true,\n\t}\n);\n\n// Public store for third-party extensibility.\nstore( 'core/tabs', {\n\tstate: {\n\t\t/**\n\t\t * Gets a contextually aware list of tabs for the current tabs block.\n\t\t * Public API for third-party access.\n\t\t *\n\t\t * @type {Array}\n\t\t */\n\t\tget tabsList() {\n\t\t\treturn createReadOnlyProxy( privateState.tabsList );\n\t\t},\n\t\t/**\n\t\t * Gets the index of the active tab element whether it\n\t\t * is a tab label or tab panel.\n\t\t * Public API for third-party access.\n\t\t *\n\t\t * @type {number|null}\n\t\t */\n\t\tget tabIndex() {\n\t\t\treturn createReadOnlyProxy( privateState.tabIndex );\n\t\t},\n\t\t/**\n\t\t * Whether the tab panel or tab label is the active tab.\n\t\t * Public API for third-party access.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tget isActiveTab() {\n\t\t\treturn createReadOnlyProxy( privateState.isActiveTab );\n\t\t},\n\t},\n\tactions: {\n\t\t/**\n\t\t * Sets the active tab index.\n\t\t * Public API for third-party programmatic tab activation.\n\t\t *\n\t\t * @param {number} tabIndex The index of the active tab.\n\t\t * @param {boolean} scrollToTab Whether to scroll to the tab element.\n\t\t */\n\t\tsetActiveTab: ( tabIndex, scrollToTab = false ) => {\n\t\t\tprivateActions.setActiveTab( tabIndex, scrollToTab );\n\t\t},\n\t},\n} );\n"],
5
- "mappings": ";;;AAGA,2BAKO;AAEP,SAAS,oBAAqB,KAAM;AACnC,SAAO,IAAI,MAAO,KAAK;AAAA,IACtB,IAAK,QAAQ,MAAO;AACnB,YAAM,QAAQ,OAAQ,IAAK;AAC3B,UAAK,OAAO,UAAU,YAAY,U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AA;AAAA;AAAA,MAKV,YAAY,MAAM;AACjB,cAAM,EAAE,SAAS,IAAI;AACrB,YAAK,SAAS,WAAW,GAAI;AAC5B;AAAA,QACD;AACA,cAAM,EAAE,KAAK,IAAI,OAAO;AACxB,cAAM,QAAQ,KAAK,QAAS,KAAK,EAAG;AACpC,cAAM,WAAW,SAAS,UAAW,CAAE,MAAO,EAAE,OAAO,KAAM;AAE7D,YAAK,YAAY,GAAI;AACpB,yBAAe,aAAc,UAAU,IAAK;AAAA,QAC7C;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,MAAM;AAAA,EACP;AACD;AAAA,IAGA,4BAAO,aAAa;AAAA,EACnB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAON,IAAI,WAAW;AACd,aAAO,oBAAqB,aAAa,QAAS;AAAA,IACnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,IAAI,WAAW;AACd,aAAO,oBAAqB,aAAa,QAAS;AAAA,IACnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,IAAI,cAAc;AACjB,aAAO,oBAAqB,aAAa,WAAY;AAAA,IACtD;AAAA,EACD;AAAA,EACA,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQR,cAAc,CAAE,UAAU,cAAc,UAAW;AAClD,qBAAe,aAAc,UAAU,WAAY;AAAA,IACpD;AAAA,EACD;AACD,CAAE;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tstore,\n\tgetContext,\n\tgetElement,\n\twithSyncEvent,\n} from '@wordpress/interactivity';\n\nfunction createReadOnlyProxy( obj ) {\n\tconst arrayMutationMethods = new Set( [\n\t\t'push',\n\t\t'pop',\n\t\t'shift',\n\t\t'unshift',\n\t\t'splice',\n\t\t'sort',\n\t\t'reverse',\n\t\t'copyWithin',\n\t\t'fill',\n\t] );\n\n\treturn new Proxy( obj, {\n\t\tget( target, prop ) {\n\t\t\t// If accessing an array mutation method, return a no-op function.\n\t\t\tif ( Array.isArray( target ) && arrayMutationMethods.has( prop ) ) {\n\t\t\t\treturn () => {};\n\t\t\t}\n\n\t\t\tconst value = target[ prop ];\n\t\t\tif ( typeof value === 'object' && value !== null ) {\n\t\t\t\treturn createReadOnlyProxy( value );\n\t\t\t}\n\t\t\treturn value;\n\t\t},\n\t\tset() {\n\t\t\treturn false;\n\t\t},\n\t\tdeleteProperty() {\n\t\t\treturn false;\n\t\t},\n\t} );\n}\n\n// Private store for internal tabs functionality and security.\nconst { actions: privateActions, state: privateState } = store(\n\t'core/tabs/private',\n\t{\n\t\tstate: {\n\t\t\t/**\n\t\t\t * Gets a contextually aware list of tabs for the current tabs block.\n\t\t\t *\n\t\t\t * @type {Array}\n\t\t\t */\n\t\t\tget tabsList() {\n\t\t\t\tconst context = getContext();\n\t\t\t\tconst tabsId = context?.tabsId;\n\t\t\t\tconst tabsList = privateState[ tabsId ];\n\t\t\t\treturn tabsList;\n\t\t\t},\n\t\t\t/**\n\t\t\t * Gets the index of the active tab element whether it\n\t\t\t * is a tab label or tab panel.\n\t\t\t *\n\t\t\t * @type {number|null}\n\t\t\t */\n\t\t\tget tabIndex() {\n\t\t\t\tconst { attributes } = getElement();\n\t\t\t\tconst tabId = attributes?.id?.replace( 'tab__', '' ) || null;\n\t\t\t\tif ( ! tabId ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tconst { tabsList } = privateState;\n\t\t\t\tconst tabIndex = tabsList.findIndex( ( t ) => t.id === tabId );\n\t\t\t\treturn tabIndex;\n\t\t\t},\n\t\t\t/**\n\t\t\t * Whether the tab panel or tab label is the active tab.\n\t\t\t *\n\t\t\t * @type {boolean}\n\t\t\t */\n\t\t\tget isActiveTab() {\n\t\t\t\tconst { activeTabIndex } = getContext();\n\t\t\t\tconst { tabIndex } = privateState;\n\t\t\t\treturn activeTabIndex === tabIndex;\n\t\t\t},\n\t\t\t/**\n\t\t\t * The value of the tabindex attribute.\n\t\t\t *\n\t\t\t * @type {false|string}\n\t\t\t */\n\t\t\tget tabIndexAttribute() {\n\t\t\t\treturn privateState.isActiveTab ? -1 : 0;\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\t/**\n\t\t\t * Handles the keydown events for the tab label and tabs controller.\n\t\t\t *\n\t\t\t * @param {KeyboardEvent} event The keydown event.\n\t\t\t */\n\t\t\thandleTabKeyDown: withSyncEvent( ( event ) => {\n\t\t\t\t// If this is the enter key then lets get the tab index from context and set the active tab to that index.\n\t\t\t\tconst { isVertical } = getContext();\n\t\t\t\tif ( event.key === 'Enter' ) {\n\t\t\t\t\tconst { tabIndex } = privateState;\n\t\t\t\t\tif ( tabIndex !== null ) {\n\t\t\t\t\t\tprivateActions.setActiveTab( tabIndex );\n\t\t\t\t\t}\n\t\t\t\t} else if ( event.key === 'ArrowRight' && ! isVertical ) {\n\t\t\t\t\tconst { tabIndex } = privateState;\n\t\t\t\t\tif ( tabIndex !== null ) {\n\t\t\t\t\t\tprivateActions.setActiveTab( tabIndex + 1 );\n\t\t\t\t\t}\n\t\t\t\t} else if ( event.key === 'ArrowLeft' && ! isVertical ) {\n\t\t\t\t\tconst { tabIndex } = privateState;\n\t\t\t\t\tif ( tabIndex !== null ) {\n\t\t\t\t\t\tprivateActions.setActiveTab( tabIndex - 1 );\n\t\t\t\t\t}\n\t\t\t\t} else if ( event.key === 'ArrowDown' && isVertical ) {\n\t\t\t\t\tconst { tabIndex } = privateState;\n\t\t\t\t\tif ( tabIndex !== null ) {\n\t\t\t\t\t\tprivateActions.setActiveTab( tabIndex + 1 );\n\t\t\t\t\t}\n\t\t\t\t} else if ( event.key === 'ArrowUp' && isVertical ) {\n\t\t\t\t\tconst { tabIndex } = privateState;\n\t\t\t\t\tif ( tabIndex !== null ) {\n\t\t\t\t\t\tprivateActions.setActiveTab( tabIndex - 1 );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} ),\n\t\t\t/**\n\t\t\t * Handles the click event for the tab label.\n\t\t\t *\n\t\t\t * @param {MouseEvent} event The click event.\n\t\t\t */\n\t\t\thandleTabClick: withSyncEvent( ( event ) => {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tconst { tabIndex } = privateState;\n\t\t\t\tif ( tabIndex !== null ) {\n\t\t\t\t\tprivateActions.setActiveTab( tabIndex );\n\t\t\t\t}\n\t\t\t} ),\n\t\t\t/**\n\t\t\t * Sets the active tab index (internal implementation).\n\t\t\t *\n\t\t\t * @param {number} tabIndex The index of the active tab.\n\t\t\t * @param {boolean} scrollToTab Whether to scroll to the tab element.\n\t\t\t */\n\t\t\tsetActiveTab: ( tabIndex, scrollToTab = false ) => {\n\t\t\t\tconst context = getContext();\n\t\t\t\tcontext.activeTabIndex = tabIndex;\n\t\t\t\tif ( scrollToTab ) {\n\t\t\t\t\tconst tabId = privateState.tabsList[ tabIndex ].id;\n\t\t\t\t\tconst tabElement = document.getElementById( tabId );\n\t\t\t\t\tif ( tabElement ) {\n\t\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\t\ttabElement.scrollIntoView( { behavior: 'smooth' } );\n\t\t\t\t\t\t}, 100 );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\tcallbacks: {\n\t\t\t/**\n\t\t\t * When the tabs are initialized, we need to check if there is a hash in the url and if so if it exists in the current tabsList, set the active tab to that index.\n\t\t\t *\n\t\t\t */\n\t\t\tonTabsInit: () => {\n\t\t\t\tconst { tabsList } = privateState;\n\t\t\t\tif ( tabsList.length === 0 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst { hash } = window.location;\n\t\t\t\tconst tabId = hash.replace( '#', '' );\n\t\t\t\tconst tabIndex = tabsList.findIndex( ( t ) => t.id === tabId );\n\t\t\t\t// Check if tabIndex is a positive number and if so we'll auto activate that tab.\n\t\t\t\tif ( tabIndex >= 0 ) {\n\t\t\t\t\tprivateActions.setActiveTab( tabIndex, true );\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tlock: true,\n\t}\n);\n\n// Public store for third-party extensibility.\nstore( 'core/tabs', {\n\tstate: {\n\t\t/**\n\t\t * Gets a contextually aware list of tabs for the current tabs block.\n\t\t * Public API for third-party access.\n\t\t *\n\t\t * @type {Array}\n\t\t */\n\t\tget tabsList() {\n\t\t\treturn createReadOnlyProxy( privateState.tabsList );\n\t\t},\n\t\t/**\n\t\t * Gets the index of the active tab element whether it\n\t\t * is a tab label or tab panel.\n\t\t *\n\t\t * @type {number|null}\n\t\t */\n\t\tget tabIndex() {\n\t\t\treturn privateState.tabIndex;\n\t\t},\n\t\t/**\n\t\t * Whether the tab panel or tab label is the active tab.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tget isActiveTab() {\n\t\t\treturn privateState.isActiveTab;\n\t\t},\n\t},\n\tactions: {\n\t\t/**\n\t\t * Sets the active tab index.\n\t\t * Public API for third-party programmatic tab activation.\n\t\t *\n\t\t * @param {number} tabIndex The index of the active tab.\n\t\t * @param {boolean} scrollToTab Whether to scroll to the tab element.\n\t\t */\n\t\tsetActiveTab: ( tabIndex, scrollToTab = false ) => {\n\t\t\tprivateActions.setActiveTab( tabIndex, scrollToTab );\n\t\t},\n\t},\n} );\n"],
5
+ "mappings": ";;;AAGA,2BAKO;AAEP,SAAS,oBAAqB,KAAM;AACnC,QAAM,uBAAuB,oBAAI,IAAK;AAAA,IACrC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AAEF,SAAO,IAAI,MAAO,KAAK;AAAA,IACtB,IAAK,QAAQ,MAAO;AAEnB,UAAK,MAAM,QAAS,MAAO,KAAK,qBAAqB,IAAK,IAAK,GAAI;AAClE,eAAO,MAAM;AAAA,QAAC;AAAA,MACf;AAEA,YAAM,QAAQ,OAAQ,IAAK;AAC3B,UAAK,OAAO,U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AA;AAAA;AAAA;AAAA;AAAA,MAKV,YAAY,MAAM;AACjB,cAAM,EAAE,SAAS,IAAI;AACrB,YAAK,SAAS,WAAW,GAAI;AAC5B;AAAA,QACD;AACA,cAAM,EAAE,KAAK,IAAI,OAAO;AACxB,cAAM,QAAQ,KAAK,QAAS,KAAK,EAAG;AACpC,cAAM,WAAW,SAAS,UAAW,CAAE,MAAO,EAAE,OAAO,KAAM;AAE7D,YAAK,YAAY,GAAI;AACpB,yBAAe,aAAc,UAAU,IAAK;AAAA,QAC7C;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,MAAM;AAAA,EACP;AACD;AAAA,IAGA,4BAAO,aAAa;AAAA,EACnB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAON,IAAI,WAAW;AACd,aAAO,oBAAqB,aAAa,QAAS;AAAA,IACnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,IAAI,WAAW;AACd,aAAO,aAAa;AAAA,IACrB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,IAAI,cAAc;AACjB,aAAO,aAAa;AAAA,IACrB;AAAA,EACD;AAAA,EACA,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQR,cAAc,CAAE,UAAU,cAAc,UAAW;AAClD,qBAAe,aAAc,UAAU,WAAY;AAAA,IACpD;AAAA,EACD;AACD,CAAE;",
6
6
  "names": []
7
7
  }
@@ -67,6 +67,18 @@ var settings = {
67
67
  edit: import_edit.default,
68
68
  save: import_save.default
69
69
  };
70
+ if (window.__experimentalContentOnlyPatternInsertion) {
71
+ settings.fields = [
72
+ {
73
+ label: (0, import_i18n.__)("Content"),
74
+ type: "RichText",
75
+ shownByDefault: true,
76
+ mapping: {
77
+ value: "content"
78
+ }
79
+ }
80
+ ];
81
+ }
70
82
  var init = () => (0, import_init_block.default)({ name, metadata: import_block.default, settings });
71
83
  // Annotate the CommonJS export names for ESM import in node:
72
84
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/verse/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { verse as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\t/* eslint-disable @wordpress/i18n-no-collapsible-whitespace */\n\t\t\t// translators: Sample content for the Verse block. Can be replaced with a more locale-adequate work.\n\t\t\tcontent: __(\n\t\t\t\t'WHAT was he doing, the great god Pan,\\n\tDown in the reeds by the river?\\nSpreading ruin and scattering ban,\\nSplashing and paddling with hoofs of a goat,\\nAnd breaking the golden lilies afloat\\n With the dragon-fly on the river.'\n\t\t\t),\n\t\t\t/* eslint-enable @wordpress/i18n-no-collapsible-whitespace */\n\t\t},\n\t},\n\ttransforms,\n\tdeprecated,\n\tmerge( attributes, attributesToMerge ) {\n\t\treturn {\n\t\t\tcontent: attributes.content + '\\n\\n' + attributesToMerge.content,\n\t\t};\n\t},\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAA8B;AAK9B,wBAAsB;AACtB,wBAAuB;AACvB,kBAAiB;AACjB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA;AAAA;AAAA,MAGX,aAAS;AAAA,QACR;AAAA,MACD;AAAA;AAAA,IAED;AAAA,EACD;AAAA,EACA,8BAAAC;AAAA,EACA,8BAAAC;AAAA,EACA,MAAO,YAAY,mBAAoB;AACtC,WAAO;AAAA,MACN,SAAS,WAAW,UAAU,SAAS,kBAAkB;AAAA,IAC1D;AAAA,EACD;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { verse as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\t/* eslint-disable @wordpress/i18n-no-collapsible-whitespace */\n\t\t\t// translators: Sample content for the Verse block. Can be replaced with a more locale-adequate work.\n\t\t\tcontent: __(\n\t\t\t\t'WHAT was he doing, the great god Pan,\\n\tDown in the reeds by the river?\\nSpreading ruin and scattering ban,\\nSplashing and paddling with hoofs of a goat,\\nAnd breaking the golden lilies afloat\\n With the dragon-fly on the river.'\n\t\t\t),\n\t\t\t/* eslint-enable @wordpress/i18n-no-collapsible-whitespace */\n\t\t},\n\t},\n\ttransforms,\n\tdeprecated,\n\tmerge( attributes, attributesToMerge ) {\n\t\treturn {\n\t\t\tcontent: attributes.content + '\\n\\n' + attributesToMerge.content,\n\t\t};\n\t},\n\tedit,\n\tsave,\n};\n\nif ( window.__experimentalContentOnlyPatternInsertion ) {\n\tsettings.fields = [\n\t\t{\n\t\t\tlabel: __( 'Content' ),\n\t\t\ttype: 'RichText',\n\t\t\tshownByDefault: true,\n\t\t\tmapping: {\n\t\t\t\tvalue: 'content',\n\t\t\t},\n\t\t},\n\t];\n}\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAA8B;AAK9B,wBAAsB;AACtB,wBAAuB;AACvB,kBAAiB;AACjB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA;AAAA;AAAA,MAGX,aAAS;AAAA,QACR;AAAA,MACD;AAAA;AAAA,IAED;AAAA,EACD;AAAA,EACA,8BAAAC;AAAA,EACA,8BAAAC;AAAA,EACA,MAAO,YAAY,mBAAoB;AACtC,WAAO;AAAA,MACN,SAAS,WAAW,UAAU,SAAS,kBAAkB;AAAA,IAC1D;AAAA,EACD;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AACD;AAEA,IAAK,OAAO,2CAA4C;AACvD,WAAS,SAAS;AAAA,IACjB;AAAA,MACC,WAAO,gBAAI,SAAU;AAAA,MACrB,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,SAAS;AAAA,QACR,OAAO;AAAA,MACR;AAAA,IACD;AAAA,EACD;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
6
6
  "names": ["metadata", "icon", "transforms", "deprecated", "edit", "save", "initBlock", "metadata"]
7
7
  }
@@ -59,6 +59,33 @@ var settings = {
59
59
  edit: import_edit.default,
60
60
  save: import_save.default
61
61
  };
62
+ if (window.__experimentalContentOnlyPatternInsertion) {
63
+ settings.fields = [
64
+ {
65
+ label: (0, import_i18n.__)("Video"),
66
+ type: "Media",
67
+ shownByDefault: true,
68
+ mapping: {
69
+ id: "id",
70
+ src: "src",
71
+ caption: "caption",
72
+ poster: "poster"
73
+ },
74
+ args: {
75
+ allowedTypes: ["video"],
76
+ multiple: false
77
+ }
78
+ },
79
+ {
80
+ label: (0, import_i18n.__)("Caption"),
81
+ type: "RichText",
82
+ shownByDefault: false,
83
+ mapping: {
84
+ value: "caption"
85
+ }
86
+ }
87
+ ];
88
+ }
62
89
  var init = () => (0, import_init_block.default)({ name, metadata: import_block.default, settings });
63
90
  // Annotate the CommonJS export names for ESM import in node:
64
91
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/video/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { video as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tsrc: 'https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm',\n\t\t\t// translators: Caption accompanying a video of the wood thrush singing, which serves as an example for the Video block.\n\t\t\tcaption: __( 'Wood thrush singing in Central Park, NYC.' ),\n\t\t},\n\t},\n\ttransforms,\n\tdeprecated,\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAA8B;AAK9B,wBAAsB;AACtB,wBAAuB;AACvB,kBAAiB;AACjB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX,KAAK;AAAA;AAAA,MAEL,aAAS,gBAAI,2CAA4C;AAAA,IAC1D;AAAA,EACD;AAAA,EACA,8BAAAC;AAAA,EACA,8BAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { video as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tsrc: 'https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm',\n\t\t\t// translators: Caption accompanying a video of the wood thrush singing, which serves as an example for the Video block.\n\t\t\tcaption: __( 'Wood thrush singing in Central Park, NYC.' ),\n\t\t},\n\t},\n\ttransforms,\n\tdeprecated,\n\tedit,\n\tsave,\n};\n\nif ( window.__experimentalContentOnlyPatternInsertion ) {\n\tsettings.fields = [\n\t\t{\n\t\t\tlabel: __( 'Video' ),\n\t\t\ttype: 'Media',\n\t\t\tshownByDefault: true,\n\t\t\tmapping: {\n\t\t\t\tid: 'id',\n\t\t\t\tsrc: 'src',\n\t\t\t\tcaption: 'caption',\n\t\t\t\tposter: 'poster',\n\t\t\t},\n\t\t\targs: {\n\t\t\t\tallowedTypes: [ 'video' ],\n\t\t\t\tmultiple: false,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Caption' ),\n\t\t\ttype: 'RichText',\n\t\t\tshownByDefault: false,\n\t\t\tmapping: {\n\t\t\t\tvalue: 'caption',\n\t\t\t},\n\t\t},\n\t];\n}\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAA8B;AAK9B,wBAAsB;AACtB,wBAAuB;AACvB,kBAAiB;AACjB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX,KAAK;AAAA;AAAA,MAEL,aAAS,gBAAI,2CAA4C;AAAA,IAC1D;AAAA,EACD;AAAA,EACA,8BAAAC;AAAA,EACA,8BAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AACD;AAEA,IAAK,OAAO,2CAA4C;AACvD,WAAS,SAAS;AAAA,IACjB;AAAA,MACC,WAAO,gBAAI,OAAQ;AAAA,MACnB,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,SAAS;AAAA,QACR,IAAI;AAAA,QACJ,KAAK;AAAA,QACL,SAAS;AAAA,QACT,QAAQ;AAAA,MACT;AAAA,MACA,MAAM;AAAA,QACL,cAAc,CAAE,OAAQ;AAAA,QACxB,UAAU;AAAA,MACX;AAAA,IACD;AAAA,IACA;AAAA,MACC,WAAO,gBAAI,SAAU;AAAA,MACrB,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,SAAS;AAAA,QACR,OAAO;AAAA,MACR;AAAA,IACD;AAAA,EACD;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
6
6
  "names": ["metadata", "icon", "transforms", "deprecated", "edit", "save", "initBlock", "metadata"]
7
7
  }
@@ -1,4 +1,5 @@
1
1
  // packages/block-library/src/audio/index.js
2
+ import { __ } from "@wordpress/i18n";
2
3
  import { audio as icon } from "@wordpress/icons";
3
4
  import initBlock from "../utils/init-block";
4
5
  import deprecated from "./deprecated";
@@ -20,6 +21,31 @@ var settings = {
20
21
  edit,
21
22
  save
22
23
  };
24
+ if (window.__experimentalContentOnlyPatternInsertion) {
25
+ settings.fields = [
26
+ {
27
+ label: __("Audio"),
28
+ type: "Media",
29
+ shownByDefault: true,
30
+ mapping: {
31
+ id: "id",
32
+ src: "src"
33
+ },
34
+ args: {
35
+ allowedTypes: ["audio"],
36
+ multiple: false
37
+ }
38
+ },
39
+ {
40
+ label: __("Caption"),
41
+ type: "RichText",
42
+ shownByDefault: false,
43
+ mapping: {
44
+ value: "caption"
45
+ }
46
+ }
47
+ ];
48
+ }
23
49
  var init = () => initBlock({ name, metadata, settings });
24
50
  export {
25
51
  init,