@wordpress/block-library 9.30.1-next.836ecdcae.0 → 9.30.1-next.a730c9c8c.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 (209) hide show
  1. package/build/button/edit.js +6 -1
  2. package/build/button/edit.js.map +1 -1
  3. package/build/button/edit.native.js +1 -1
  4. package/build/button/edit.native.js.map +1 -1
  5. package/build/buttons/index.js +2 -1
  6. package/build/buttons/index.js.map +1 -1
  7. package/build/categories/edit.js +3 -1
  8. package/build/categories/edit.js.map +1 -1
  9. package/build/image/edit.native.js +1 -1
  10. package/build/image/edit.native.js.map +1 -1
  11. package/build/image/image.js +5 -8
  12. package/build/image/image.js.map +1 -1
  13. package/build/image/save.js +6 -2
  14. package/build/image/save.js.map +1 -1
  15. package/build/index.js +4 -0
  16. package/build/index.js.map +1 -1
  17. package/build/navigation/edit/index.js +0 -1
  18. package/build/navigation/edit/index.js.map +1 -1
  19. package/build/navigation-link/block-inserter.js +69 -0
  20. package/build/navigation-link/block-inserter.js.map +1 -0
  21. package/build/navigation-link/dialog-wrapper.js +80 -0
  22. package/build/navigation-link/dialog-wrapper.js.map +1 -0
  23. package/build/navigation-link/link-ui.js +34 -82
  24. package/build/navigation-link/link-ui.js.map +1 -1
  25. package/build/navigation-link/page-creator.js +12 -18
  26. package/build/navigation-link/page-creator.js.map +1 -1
  27. package/build/post-date/edit.js +2 -1
  28. package/build/post-date/edit.js.map +1 -1
  29. package/build/post-featured-image/edit.js +7 -2
  30. package/build/post-featured-image/edit.js.map +1 -1
  31. package/build/post-title/edit.js +8 -2
  32. package/build/post-title/edit.js.map +1 -1
  33. package/build/query/edit/pattern-selection.js +9 -1
  34. package/build/query/edit/pattern-selection.js.map +1 -1
  35. package/build/query/index.js +2 -1
  36. package/build/query/index.js.map +1 -1
  37. package/build/rss/edit.js +6 -1
  38. package/build/rss/edit.js.map +1 -1
  39. package/build/site-tagline/index.js +1 -0
  40. package/build/site-tagline/index.js.map +1 -1
  41. package/build/social-link/edit.js +6 -1
  42. package/build/social-link/edit.js.map +1 -1
  43. package/build/social-links/index.js +2 -1
  44. package/build/social-links/index.js.map +1 -1
  45. package/build/spacer/edit.js +2 -1
  46. package/build/spacer/edit.js.map +1 -1
  47. package/build/table-of-contents/edit.js +33 -9
  48. package/build/table-of-contents/edit.js.map +1 -1
  49. package/build/table-of-contents/index.js +4 -0
  50. package/build/table-of-contents/index.js.map +1 -1
  51. package/build/table-of-contents/list.js +6 -3
  52. package/build/table-of-contents/list.js.map +1 -1
  53. package/build/table-of-contents/save.js +6 -3
  54. package/build/table-of-contents/save.js.map +1 -1
  55. package/build/term-template/edit.js +318 -0
  56. package/build/term-template/edit.js.map +1 -0
  57. package/build/term-template/index.js +109 -0
  58. package/build/term-template/index.js.map +1 -0
  59. package/build/term-template/save.js +16 -0
  60. package/build/term-template/save.js.map +1 -0
  61. package/build/term-template/variations.js +83 -0
  62. package/build/term-template/variations.js.map +1 -0
  63. package/build/terms-query/edit.js +20 -0
  64. package/build/terms-query/edit.js.map +1 -0
  65. package/build/terms-query/index.js +83 -0
  66. package/build/terms-query/index.js.map +1 -0
  67. package/build/terms-query/inspector-controls.js +231 -0
  68. package/build/terms-query/inspector-controls.js.map +1 -0
  69. package/build/terms-query/save.js +24 -0
  70. package/build/terms-query/save.js.map +1 -0
  71. package/build/terms-query/terms-query-content.js +71 -0
  72. package/build/terms-query/terms-query-content.js.map +1 -0
  73. package/build/utils/hooks.js +3 -0
  74. package/build/utils/hooks.js.map +1 -1
  75. package/build-module/button/edit.js +7 -2
  76. package/build-module/button/edit.js.map +1 -1
  77. package/build-module/button/edit.native.js +1 -1
  78. package/build-module/button/edit.native.js.map +1 -1
  79. package/build-module/buttons/index.js +2 -1
  80. package/build-module/buttons/index.js.map +1 -1
  81. package/build-module/categories/edit.js +3 -1
  82. package/build-module/categories/edit.js.map +1 -1
  83. package/build-module/image/edit.native.js +1 -1
  84. package/build-module/image/edit.native.js.map +1 -1
  85. package/build-module/image/image.js +5 -8
  86. package/build-module/image/image.js.map +1 -1
  87. package/build-module/image/save.js +6 -2
  88. package/build-module/image/save.js.map +1 -1
  89. package/build-module/index.js +4 -0
  90. package/build-module/index.js.map +1 -1
  91. package/build-module/navigation/edit/index.js +0 -1
  92. package/build-module/navigation/edit/index.js.map +1 -1
  93. package/build-module/navigation-link/block-inserter.js +61 -0
  94. package/build-module/navigation-link/block-inserter.js.map +1 -0
  95. package/build-module/navigation-link/dialog-wrapper.js +75 -0
  96. package/build-module/navigation-link/dialog-wrapper.js.map +1 -0
  97. package/build-module/navigation-link/link-ui.js +37 -85
  98. package/build-module/navigation-link/link-ui.js.map +1 -1
  99. package/build-module/navigation-link/page-creator.js +12 -19
  100. package/build-module/navigation-link/page-creator.js.map +1 -1
  101. package/build-module/post-date/edit.js +3 -2
  102. package/build-module/post-date/edit.js.map +1 -1
  103. package/build-module/post-featured-image/edit.js +9 -4
  104. package/build-module/post-featured-image/edit.js.map +1 -1
  105. package/build-module/post-title/edit.js +9 -3
  106. package/build-module/post-title/edit.js.map +1 -1
  107. package/build-module/query/edit/pattern-selection.js +9 -1
  108. package/build-module/query/edit/pattern-selection.js.map +1 -1
  109. package/build-module/query/index.js +2 -1
  110. package/build-module/query/index.js.map +1 -1
  111. package/build-module/rss/edit.js +8 -3
  112. package/build-module/rss/edit.js.map +1 -1
  113. package/build-module/site-tagline/index.js +1 -0
  114. package/build-module/site-tagline/index.js.map +1 -1
  115. package/build-module/social-link/edit.js +8 -3
  116. package/build-module/social-link/edit.js.map +1 -1
  117. package/build-module/social-links/index.js +2 -1
  118. package/build-module/social-links/index.js.map +1 -1
  119. package/build-module/spacer/edit.js +3 -2
  120. package/build-module/spacer/edit.js.map +1 -1
  121. package/build-module/table-of-contents/edit.js +35 -11
  122. package/build-module/table-of-contents/edit.js.map +1 -1
  123. package/build-module/table-of-contents/index.js +4 -0
  124. package/build-module/table-of-contents/index.js.map +1 -1
  125. package/build-module/table-of-contents/list.js +6 -3
  126. package/build-module/table-of-contents/list.js.map +1 -1
  127. package/build-module/table-of-contents/save.js +6 -3
  128. package/build-module/table-of-contents/save.js.map +1 -1
  129. package/build-module/term-template/edit.js +310 -0
  130. package/build-module/term-template/edit.js.map +1 -0
  131. package/build-module/term-template/index.js +102 -0
  132. package/build-module/term-template/index.js.map +1 -0
  133. package/build-module/term-template/save.js +9 -0
  134. package/build-module/term-template/save.js.map +1 -0
  135. package/build-module/term-template/variations.js +76 -0
  136. package/build-module/term-template/variations.js.map +1 -0
  137. package/build-module/terms-query/edit.js +12 -0
  138. package/build-module/terms-query/edit.js.map +1 -0
  139. package/build-module/terms-query/index.js +76 -0
  140. package/build-module/terms-query/index.js.map +1 -0
  141. package/build-module/terms-query/inspector-controls.js +224 -0
  142. package/build-module/terms-query/inspector-controls.js.map +1 -0
  143. package/build-module/terms-query/save.js +17 -0
  144. package/build-module/terms-query/save.js.map +1 -0
  145. package/build-module/terms-query/terms-query-content.js +63 -0
  146. package/build-module/terms-query/terms-query-content.js.map +1 -0
  147. package/build-module/utils/hooks.js +3 -0
  148. package/build-module/utils/hooks.js.map +1 -1
  149. package/build-style/editor-rtl.css +24 -0
  150. package/build-style/editor.css +24 -0
  151. package/build-style/style-rtl.css +16 -0
  152. package/build-style/style.css +16 -0
  153. package/build-style/term-template/editor-rtl.css +160 -0
  154. package/build-style/term-template/editor.css +160 -0
  155. package/build-style/term-template/style-rtl.css +146 -0
  156. package/build-style/term-template/style.css +146 -0
  157. package/build-style/terms-query/style-rtl.css +140 -0
  158. package/build-style/terms-query/style.css +140 -0
  159. package/build-types/table-of-contents/list.d.ts +2 -1
  160. package/build-types/table-of-contents/list.d.ts.map +1 -1
  161. package/package.json +35 -35
  162. package/src/button/edit.js +12 -1
  163. package/src/button/edit.native.js +1 -1
  164. package/src/buttons/block.json +2 -1
  165. package/src/categories/edit.js +2 -1
  166. package/src/editor.scss +1 -0
  167. package/src/image/edit.native.js +1 -1
  168. package/src/image/image.js +5 -8
  169. package/src/image/save.js +7 -1
  170. package/src/index.js +4 -0
  171. package/src/navigation/edit/index.js +0 -1
  172. package/src/navigation-link/block-inserter.js +65 -0
  173. package/src/navigation-link/dialog-wrapper.js +74 -0
  174. package/src/navigation-link/link-ui.js +32 -95
  175. package/src/navigation-link/page-creator.js +13 -20
  176. package/src/post-date/edit.js +64 -53
  177. package/src/post-date/index.php +5 -13
  178. package/src/post-featured-image/edit.js +19 -3
  179. package/src/post-title/edit.js +14 -2
  180. package/src/query/block.json +2 -1
  181. package/src/query/edit/pattern-selection.js +10 -1
  182. package/src/rss/edit.js +13 -2
  183. package/src/site-tagline/block.json +1 -0
  184. package/src/social-link/edit.js +13 -2
  185. package/src/social-links/block.json +2 -1
  186. package/src/spacer/edit.js +5 -1
  187. package/src/style.scss +2 -0
  188. package/src/table-of-contents/block.json +4 -0
  189. package/src/table-of-contents/edit.js +58 -21
  190. package/src/table-of-contents/list.tsx +7 -2
  191. package/src/table-of-contents/save.js +7 -3
  192. package/src/term-template/block.json +73 -0
  193. package/src/term-template/edit.js +391 -0
  194. package/src/term-template/editor.scss +26 -0
  195. package/src/term-template/index.js +26 -0
  196. package/src/term-template/index.php +224 -0
  197. package/src/term-template/save.js +8 -0
  198. package/src/term-template/style.scss +12 -0
  199. package/src/term-template/variations.js +87 -0
  200. package/src/terms-query/block.json +49 -0
  201. package/src/terms-query/edit.js +10 -0
  202. package/src/terms-query/index.js +24 -0
  203. package/src/terms-query/index.php +44 -0
  204. package/src/terms-query/inspector-controls.js +239 -0
  205. package/src/terms-query/save.js +10 -0
  206. package/src/terms-query/style.scss +6 -0
  207. package/src/terms-query/terms-query-content.js +74 -0
  208. package/src/utils/hooks.js +4 -0
  209. package/tsconfig.tsbuildinfo +1 -1
@@ -6,9 +6,10 @@ import type { MouseEvent, ReactElement } from 'react';
6
6
  * Internal dependencies
7
7
  */
8
8
  import type { NestedHeadingData } from './utils';
9
- export default function TableOfContentsList({ nestedHeadingList, disableLinkActivation, onClick, }: {
9
+ export default function TableOfContentsList({ nestedHeadingList, disableLinkActivation, onClick, ordered, }: {
10
10
  nestedHeadingList: NestedHeadingData[];
11
11
  disableLinkActivation?: boolean;
12
12
  onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
13
+ ordered?: boolean;
13
14
  }): ReactElement;
14
15
  //# sourceMappingURL=list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/table-of-contents/list.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAEtD;;GAEG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAIjD,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAE,EAC5C,iBAAiB,EACjB,qBAAqB,EACrB,OAAO,GACP,EAAE;IACF,iBAAiB,EAAE,iBAAiB,EAAE,CAAC;IACvC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,CAAE,KAAK,EAAE,UAAU,CAAE,iBAAiB,CAAE,KAAM,IAAI,CAAC;CAC7D,GAAI,YAAY,CAgDhB"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/table-of-contents/list.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAEtD;;GAEG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAIjD,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAE,EAC5C,iBAAiB,EACjB,qBAAqB,EACrB,OAAO,EACP,OAAc,GACd,EAAE;IACF,iBAAiB,EAAE,iBAAiB,EAAE,CAAC;IACvC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,CAAE,KAAK,EAAE,UAAU,CAAE,iBAAiB,CAAE,KAAM,IAAI,CAAC;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB,GAAI,YAAY,CAmDhB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "9.30.1-next.836ecdcae.0",
3
+ "version": "9.30.1-next.a730c9c8c.0",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -42,39 +42,39 @@
42
42
  ],
43
43
  "dependencies": {
44
44
  "@babel/runtime": "7.25.7",
45
- "@wordpress/a11y": "^4.30.1-next.836ecdcae.0",
46
- "@wordpress/api-fetch": "^7.30.1-next.836ecdcae.0",
47
- "@wordpress/autop": "^4.30.1-next.836ecdcae.0",
48
- "@wordpress/blob": "^4.30.1-next.836ecdcae.0",
49
- "@wordpress/block-editor": "^15.3.1-next.836ecdcae.0",
50
- "@wordpress/blocks": "^15.3.1-next.836ecdcae.0",
51
- "@wordpress/components": "^30.3.2-next.836ecdcae.0",
52
- "@wordpress/compose": "^7.30.1-next.836ecdcae.0",
53
- "@wordpress/core-data": "^7.30.1-next.836ecdcae.0",
54
- "@wordpress/data": "^10.30.1-next.836ecdcae.0",
55
- "@wordpress/date": "^5.30.1-next.836ecdcae.0",
56
- "@wordpress/deprecated": "^4.30.1-next.836ecdcae.0",
57
- "@wordpress/dom": "^4.30.1-next.836ecdcae.0",
58
- "@wordpress/element": "^6.30.1-next.836ecdcae.0",
59
- "@wordpress/escape-html": "^3.30.1-next.836ecdcae.0",
60
- "@wordpress/hooks": "^4.30.1-next.836ecdcae.0",
61
- "@wordpress/html-entities": "^4.30.1-next.836ecdcae.0",
62
- "@wordpress/i18n": "^6.3.1-next.836ecdcae.0",
63
- "@wordpress/icons": "^10.30.1-next.836ecdcae.0",
64
- "@wordpress/interactivity": "^6.30.1-next.836ecdcae.0",
65
- "@wordpress/interactivity-router": "^2.30.1-next.836ecdcae.0",
66
- "@wordpress/keyboard-shortcuts": "^5.30.1-next.836ecdcae.0",
67
- "@wordpress/keycodes": "^4.30.1-next.836ecdcae.0",
68
- "@wordpress/notices": "^5.30.1-next.836ecdcae.0",
69
- "@wordpress/patterns": "^2.30.1-next.836ecdcae.0",
70
- "@wordpress/primitives": "^4.30.1-next.836ecdcae.0",
71
- "@wordpress/private-apis": "^1.30.1-next.836ecdcae.0",
72
- "@wordpress/reusable-blocks": "^5.30.1-next.836ecdcae.0",
73
- "@wordpress/rich-text": "^7.30.1-next.836ecdcae.0",
74
- "@wordpress/server-side-render": "^6.6.1-next.836ecdcae.0",
75
- "@wordpress/url": "^4.30.1-next.836ecdcae.0",
76
- "@wordpress/viewport": "^6.30.1-next.836ecdcae.0",
77
- "@wordpress/wordcount": "^4.30.1-next.836ecdcae.0",
45
+ "@wordpress/a11y": "^4.30.1-next.a730c9c8c.0",
46
+ "@wordpress/api-fetch": "^7.30.1-next.a730c9c8c.0",
47
+ "@wordpress/autop": "^4.30.1-next.a730c9c8c.0",
48
+ "@wordpress/blob": "^4.30.1-next.a730c9c8c.0",
49
+ "@wordpress/block-editor": "^15.3.1-next.a730c9c8c.0",
50
+ "@wordpress/blocks": "^15.3.1-next.a730c9c8c.0",
51
+ "@wordpress/components": "^30.3.2-next.a730c9c8c.0",
52
+ "@wordpress/compose": "^7.30.1-next.a730c9c8c.0",
53
+ "@wordpress/core-data": "^7.30.1-next.a730c9c8c.0",
54
+ "@wordpress/data": "^10.30.1-next.a730c9c8c.0",
55
+ "@wordpress/date": "^5.30.1-next.a730c9c8c.0",
56
+ "@wordpress/deprecated": "^4.30.1-next.a730c9c8c.0",
57
+ "@wordpress/dom": "^4.30.1-next.a730c9c8c.0",
58
+ "@wordpress/element": "^6.30.1-next.a730c9c8c.0",
59
+ "@wordpress/escape-html": "^3.30.1-next.a730c9c8c.0",
60
+ "@wordpress/hooks": "^4.30.1-next.a730c9c8c.0",
61
+ "@wordpress/html-entities": "^4.30.1-next.a730c9c8c.0",
62
+ "@wordpress/i18n": "^6.3.1-next.a730c9c8c.0",
63
+ "@wordpress/icons": "^10.30.1-next.a730c9c8c.0",
64
+ "@wordpress/interactivity": "^6.30.1-next.a730c9c8c.0",
65
+ "@wordpress/interactivity-router": "^2.30.1-next.a730c9c8c.0",
66
+ "@wordpress/keyboard-shortcuts": "^5.30.1-next.a730c9c8c.0",
67
+ "@wordpress/keycodes": "^4.30.1-next.a730c9c8c.0",
68
+ "@wordpress/notices": "^5.30.1-next.a730c9c8c.0",
69
+ "@wordpress/patterns": "^2.30.1-next.a730c9c8c.0",
70
+ "@wordpress/primitives": "^4.30.1-next.a730c9c8c.0",
71
+ "@wordpress/private-apis": "^1.30.1-next.a730c9c8c.0",
72
+ "@wordpress/reusable-blocks": "^5.30.1-next.a730c9c8c.0",
73
+ "@wordpress/rich-text": "^7.30.1-next.a730c9c8c.0",
74
+ "@wordpress/server-side-render": "^6.6.1-next.a730c9c8c.0",
75
+ "@wordpress/url": "^4.30.1-next.a730c9c8c.0",
76
+ "@wordpress/viewport": "^6.30.1-next.a730c9c8c.0",
77
+ "@wordpress/wordcount": "^4.30.1-next.a730c9c8c.0",
78
78
  "change-case": "^4.1.2",
79
79
  "clsx": "^2.1.1",
80
80
  "colord": "^2.7.0",
@@ -92,5 +92,5 @@
92
92
  "publishConfig": {
93
93
  "access": "public"
94
94
  },
95
- "gitHead": "3e60b4c1e78d7b27acbf1d7dd172bbd64358a0f2"
95
+ "gitHead": "85a580bd2c55f811c8969b42dbb10209d19d514e"
96
96
  }
@@ -27,6 +27,7 @@ import {
27
27
  TextControl,
28
28
  ToolbarButton,
29
29
  Popover,
30
+ ExternalLink,
30
31
  __experimentalToolsPanel as ToolsPanel,
31
32
  __experimentalToolsPanelItem as ToolsPanelItem,
32
33
  __experimentalToggleGroupControl as ToggleGroupControl,
@@ -474,7 +475,17 @@ function ButtonEdit( props ) {
474
475
  <TextControl
475
476
  __next40pxDefaultSize
476
477
  __nextHasNoMarginBottom
477
- label={ __( 'Link rel' ) }
478
+ label={ __( 'Link relation' ) }
479
+ help={ createInterpolateElement(
480
+ __(
481
+ 'The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document.'
482
+ ),
483
+ {
484
+ a: (
485
+ <ExternalLink href="https://developer.mozilla.org/docs/Web/HTML/Attributes/rel" />
486
+ ),
487
+ }
488
+ ) }
478
489
  value={ rel || '' }
479
490
  onChange={ ( newRel ) =>
480
491
  setAttributes( { rel: newRel } )
@@ -180,7 +180,7 @@ function ButtonEdit( props ) {
180
180
  label: __( 'Open in new tab' ),
181
181
  },
182
182
  linkRel: {
183
- label: __( 'Link Rel' ),
183
+ label: __( 'Link relation' ),
184
184
  placeholder: _x( 'None', 'Link rel attribute value placeholder' ),
185
185
  },
186
186
  };
@@ -62,7 +62,8 @@
62
62
  },
63
63
  "interactivity": {
64
64
  "clientNavigation": true
65
- }
65
+ },
66
+ "contentRole": true
66
67
  },
67
68
  "editorStyle": "wp-block-buttons-editor",
68
69
  "style": "wp-block-buttons"
@@ -52,7 +52,8 @@ export default function CategoriesEdit( {
52
52
 
53
53
  const { records: allTaxonomies, isResolvingTaxonomies } = useEntityRecords(
54
54
  'root',
55
- 'taxonomy'
55
+ 'taxonomy',
56
+ { per_page: -1 }
56
57
  );
57
58
 
58
59
  const taxonomies = allTaxonomies?.filter( ( t ) => t.visibility.public );
package/src/editor.scss CHANGED
@@ -46,6 +46,7 @@
46
46
  @import "./table/editor.scss";
47
47
  @import "./tag-cloud/editor.scss";
48
48
  @import "./template-part/editor.scss";
49
+ @import "./term-template/editor.scss";
49
50
  @import "./text-columns/editor.scss";
50
51
  @import "./video/editor.scss";
51
52
  @import "./query/editor.scss";
@@ -147,7 +147,7 @@ function LinkSettings( {
147
147
  label: __( 'Open in new tab' ),
148
148
  },
149
149
  linkRel: {
150
- label: __( 'Link Rel' ),
150
+ label: __( 'Link relation' ),
151
151
  placeholder: _x( 'None', 'Link rel attribute value placeholder' ),
152
152
  },
153
153
  };
@@ -625,7 +625,7 @@ export default function Image( {
625
625
  lockAltControlsMessage,
626
626
  lockTitleControls = false,
627
627
  lockTitleControlsMessage,
628
- lockCaption = false,
628
+ hideCaptionControls = false,
629
629
  } = useSelect(
630
630
  ( select ) => {
631
631
  if ( ! isSingleSelected ) {
@@ -635,6 +635,7 @@ export default function Image( {
635
635
  url: urlBinding,
636
636
  alt: altBinding,
637
637
  title: titleBinding,
638
+ caption: captionBinding,
638
639
  } = metadata?.bindings || {};
639
640
  const hasParentPattern = !! context[ 'pattern/overrides' ];
640
641
  const urlBindingSource = getBlockBindingsSource(
@@ -658,10 +659,7 @@ export default function Image( {
658
659
  // Disable editing the link of the URL if the image is inside a pattern instance.
659
660
  // This is a temporary solution until we support overriding the link on the frontend.
660
661
  hasParentPattern || arePatternOverridesEnabled,
661
- lockCaption:
662
- // Disable editing the caption if the image is inside a pattern instance.
663
- // This is a temporary solution until we support overriding the caption on the frontend.
664
- hasParentPattern,
662
+ hideCaptionControls: !! captionBinding,
665
663
  lockAltControls:
666
664
  !! altBinding &&
667
665
  ! altBindingSource?.canUserEditValue?.( {
@@ -1147,10 +1145,9 @@ export default function Image( {
1147
1145
  label={ __( 'Image caption text' ) }
1148
1146
  showToolbarButton={
1149
1147
  isSingleSelected &&
1150
- hasNonContentControls &&
1151
- ! arePatternOverridesEnabled
1148
+ ( hasNonContentControls || isContentOnlyMode ) &&
1149
+ ! hideCaptionControls
1152
1150
  }
1153
- readOnly={ lockCaption }
1154
1151
  />
1155
1152
  </>
1156
1153
  );
package/src/image/save.js CHANGED
@@ -31,6 +31,7 @@ export default function save( { attributes } ) {
31
31
  linkTarget,
32
32
  sizeSlug,
33
33
  title,
34
+ metadata: { bindings = {} } = {},
34
35
  } = attributes;
35
36
 
36
37
  const newRel = ! rel ? undefined : rel;
@@ -70,6 +71,11 @@ export default function save( { attributes } ) {
70
71
  />
71
72
  );
72
73
 
74
+ const displayCaption =
75
+ ! RichText.isEmpty( caption ) ||
76
+ bindings.caption ||
77
+ bindings?.__default?.source === 'core/pattern-overrides';
78
+
73
79
  const figure = (
74
80
  <>
75
81
  { href ? (
@@ -84,7 +90,7 @@ export default function save( { attributes } ) {
84
90
  ) : (
85
91
  image
86
92
  ) }
87
- { ! RichText.isEmpty( caption ) && (
93
+ { displayCaption && (
88
94
  <RichText.Content
89
95
  className={ __experimentalGetElementClassName( 'caption' ) }
90
96
  tagName="figcaption"
package/src/index.js CHANGED
@@ -122,6 +122,8 @@ import * as tableOfContents from './table-of-contents';
122
122
  import * as tagCloud from './tag-cloud';
123
123
  import * as templatePart from './template-part';
124
124
  import * as termDescription from './term-description';
125
+ import * as termsQuery from './terms-query';
126
+ import * as termTemplate from './term-template';
125
127
  import * as textColumns from './text-columns';
126
128
  import * as verse from './verse';
127
129
  import * as video from './video';
@@ -244,6 +246,8 @@ const getAllBlocks = () => {
244
246
  blocks.push( accordionContent );
245
247
  blocks.push( accordionHeader );
246
248
  blocks.push( accordionPanel );
249
+ blocks.push( termsQuery );
250
+ blocks.push( termTemplate );
247
251
  }
248
252
 
249
253
  if ( window?.__experimentalEnableFormBlocks ) {
@@ -112,7 +112,6 @@ function NavigationAddPageButton( { clientId } ) {
112
112
  <ToolbarButton
113
113
  name="add-page"
114
114
  icon={ page }
115
- title={ __( 'Add page' ) }
116
115
  onClick={ onAddPage }
117
116
  >
118
117
  { __( 'Add page' ) }
@@ -0,0 +1,65 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { useSelect } from '@wordpress/data';
6
+ import {
7
+ store as blockEditorStore,
8
+ privateApis as blockEditorPrivateApis,
9
+ } from '@wordpress/block-editor';
10
+
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+ import DialogWrapper from './dialog-wrapper';
15
+ import { unlock } from '../lock-unlock';
16
+
17
+ const { PrivateQuickInserter: QuickInserter } = unlock(
18
+ blockEditorPrivateApis
19
+ );
20
+
21
+ /**
22
+ * Component for inserting blocks within the Navigation Link UI.
23
+ *
24
+ * @param {Object} props Component props.
25
+ * @param {string} props.clientId Client ID of the navigation link block.
26
+ * @param {Function} props.onBack Callback when user wants to go back.
27
+ * @param {Function} props.onBlockInsert Callback when a block is inserted.
28
+ */
29
+ function LinkUIBlockInserter( { clientId, onBack, onBlockInsert } ) {
30
+ const { rootBlockClientId } = useSelect(
31
+ ( select ) => {
32
+ const { getBlockRootClientId } = select( blockEditorStore );
33
+
34
+ return {
35
+ rootBlockClientId: getBlockRootClientId( clientId ),
36
+ };
37
+ },
38
+ [ clientId ]
39
+ );
40
+
41
+ if ( ! clientId ) {
42
+ return null;
43
+ }
44
+
45
+ return (
46
+ <DialogWrapper
47
+ className="link-ui-block-inserter"
48
+ title={ __( 'Add block' ) }
49
+ description={ __( 'Choose a block to add to your Navigation.' ) }
50
+ onBack={ onBack }
51
+ >
52
+ <QuickInserter
53
+ rootClientId={ rootBlockClientId }
54
+ clientId={ clientId }
55
+ isAppender={ false }
56
+ prioritizePatterns={ false }
57
+ selectBlockOnInsert={ ! onBlockInsert }
58
+ onSelect={ onBlockInsert ? onBlockInsert : undefined }
59
+ hasSearch={ false }
60
+ />
61
+ </DialogWrapper>
62
+ );
63
+ }
64
+
65
+ export default LinkUIBlockInserter;
@@ -0,0 +1,74 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { Button, VisuallyHidden } from '@wordpress/components';
5
+ import { __, isRTL } from '@wordpress/i18n';
6
+ import { chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';
7
+ import { useInstanceId, useFocusOnMount } from '@wordpress/compose';
8
+
9
+ /**
10
+ * Shared BackButton component for consistent navigation across LinkUI sub-components.
11
+ *
12
+ * @param {Object} props Component props.
13
+ * @param {string} props.className CSS class name for the button.
14
+ * @param {Function} props.onBack Callback when user wants to go back.
15
+ */
16
+ function BackButton( { className, onBack } ) {
17
+ return (
18
+ <Button
19
+ className={ className }
20
+ icon={ isRTL() ? chevronRightSmall : chevronLeftSmall }
21
+ onClick={ ( e ) => {
22
+ e.preventDefault();
23
+ onBack();
24
+ } }
25
+ size="small"
26
+ >
27
+ { __( 'Back' ) }
28
+ </Button>
29
+ );
30
+ }
31
+
32
+ /**
33
+ * Shared DialogWrapper component for consistent dialog structure across LinkUI sub-components.
34
+ *
35
+ * @param {Object} props Component props.
36
+ * @param {string} props.className CSS class name for the dialog container.
37
+ * @param {string} props.title Dialog title for accessibility.
38
+ * @param {string} props.description Dialog description for accessibility.
39
+ * @param {Function} props.onBack Callback when user wants to go back.
40
+ * @param {Object} props.children Child components to render inside the dialog.
41
+ */
42
+ function DialogWrapper( { className, title, description, onBack, children } ) {
43
+ const dialogTitleId = useInstanceId(
44
+ DialogWrapper,
45
+ 'link-ui-dialog-title'
46
+ );
47
+ const dialogDescriptionId = useInstanceId(
48
+ DialogWrapper,
49
+ 'link-ui-dialog-description'
50
+ );
51
+ const focusOnMountRef = useFocusOnMount( 'firstElement' );
52
+ const backButtonClassName = `${ className }__back`;
53
+
54
+ return (
55
+ <div
56
+ className={ className }
57
+ role="dialog"
58
+ aria-labelledby={ dialogTitleId }
59
+ aria-describedby={ dialogDescriptionId }
60
+ ref={ focusOnMountRef }
61
+ >
62
+ <VisuallyHidden>
63
+ <h2 id={ dialogTitleId }>{ title }</h2>
64
+ <p id={ dialogDescriptionId }>{ description }</p>
65
+ </VisuallyHidden>
66
+
67
+ <BackButton className={ backButtonClassName } onBack={ onBack } />
68
+
69
+ { children }
70
+ </div>
71
+ );
72
+ }
73
+
74
+ export default DialogWrapper;
@@ -8,13 +8,8 @@ import {
8
8
  VisuallyHidden,
9
9
  __experimentalVStack as VStack,
10
10
  } from '@wordpress/components';
11
- import { __, isRTL } from '@wordpress/i18n';
12
- import {
13
- LinkControl,
14
- store as blockEditorStore,
15
- privateApis as blockEditorPrivateApis,
16
- useBlockEditingMode,
17
- } from '@wordpress/block-editor';
11
+ import { __ } from '@wordpress/i18n';
12
+ import { LinkControl, useBlockEditingMode } from '@wordpress/block-editor';
18
13
  import {
19
14
  useMemo,
20
15
  useState,
@@ -23,19 +18,14 @@ import {
23
18
  forwardRef,
24
19
  } from '@wordpress/element';
25
20
  import { useResourcePermissions } from '@wordpress/core-data';
26
- import { useSelect } from '@wordpress/data';
27
- import { chevronLeftSmall, chevronRightSmall, plus } from '@wordpress/icons';
28
- import { useInstanceId, useFocusOnMount } from '@wordpress/compose';
21
+ import { plus } from '@wordpress/icons';
22
+ import { useInstanceId } from '@wordpress/compose';
29
23
 
30
24
  /**
31
25
  * Internal dependencies
32
26
  */
33
- import { unlock } from '../lock-unlock';
34
27
  import { LinkUIPageCreator } from './page-creator';
35
-
36
- const { PrivateQuickInserter: QuickInserter } = unlock(
37
- blockEditorPrivateApis
38
- );
28
+ import LinkUIBlockInserter from './block-inserter';
39
29
 
40
30
  /**
41
31
  * Given the Link block's type attribute, return the query params to give to
@@ -75,74 +65,6 @@ export function getSuggestionsQuery( type, kind ) {
75
65
  }
76
66
  }
77
67
 
78
- function LinkUIBlockInserter( { clientId, onBack, onBlockInsert } ) {
79
- const { rootBlockClientId } = useSelect(
80
- ( select ) => {
81
- const { getBlockRootClientId } = select( blockEditorStore );
82
-
83
- return {
84
- rootBlockClientId: getBlockRootClientId( clientId ),
85
- };
86
- },
87
- [ clientId ]
88
- );
89
-
90
- const focusOnMountRef = useFocusOnMount( 'firstElement' );
91
-
92
- const dialogTitleId = useInstanceId(
93
- LinkControl,
94
- `link-ui-block-inserter__title`
95
- );
96
- const dialogDescriptionId = useInstanceId(
97
- LinkControl,
98
- `link-ui-block-inserter__description`
99
- );
100
-
101
- if ( ! clientId ) {
102
- return null;
103
- }
104
-
105
- return (
106
- <div
107
- className="link-ui-block-inserter"
108
- role="dialog"
109
- aria-labelledby={ dialogTitleId }
110
- aria-describedby={ dialogDescriptionId }
111
- ref={ focusOnMountRef }
112
- >
113
- <VisuallyHidden>
114
- <h2 id={ dialogTitleId }>{ __( 'Add block' ) }</h2>
115
-
116
- <p id={ dialogDescriptionId }>
117
- { __( 'Choose a block to add to your Navigation.' ) }
118
- </p>
119
- </VisuallyHidden>
120
-
121
- <Button
122
- className="link-ui-block-inserter__back"
123
- icon={ isRTL() ? chevronRightSmall : chevronLeftSmall }
124
- onClick={ ( e ) => {
125
- e.preventDefault();
126
- onBack();
127
- } }
128
- size="small"
129
- >
130
- { __( 'Back' ) }
131
- </Button>
132
-
133
- <QuickInserter
134
- rootClientId={ rootBlockClientId }
135
- clientId={ clientId }
136
- isAppender={ false }
137
- prioritizePatterns={ false }
138
- selectBlockOnInsert={ ! onBlockInsert }
139
- onSelect={ onBlockInsert ? onBlockInsert : undefined }
140
- hasSearch={ false }
141
- />
142
- </div>
143
- );
144
- }
145
-
146
68
  function UnforwardedLinkUI( props, ref ) {
147
69
  const { label, url, opensInNewTab, type, kind } = props.link;
148
70
  const postType = type || 'page';
@@ -176,11 +98,11 @@ function UnforwardedLinkUI( props, ref ) {
176
98
 
177
99
  const dialogTitleId = useInstanceId(
178
100
  LinkUI,
179
- `link-ui-link-control__title`
101
+ 'link-ui-link-control__title'
180
102
  );
181
103
  const dialogDescriptionId = useInstanceId(
182
104
  LinkUI,
183
- `link-ui-link-control__description`
105
+ 'link-ui-link-control__description'
184
106
  );
185
107
 
186
108
  const blockEditingMode = useBlockEditingMode();
@@ -220,8 +142,13 @@ function UnforwardedLinkUI( props, ref ) {
220
142
  onChange={ props.onChange }
221
143
  onRemove={ props.onRemove }
222
144
  onCancel={ props.onCancel }
223
- renderControlBottom={ () =>
224
- ! link?.url?.length && (
145
+ renderControlBottom={ () => {
146
+ // Don't show the tools when there is submitted link (preview state).
147
+ if ( link?.url?.length ) {
148
+ return null;
149
+ }
150
+
151
+ return (
225
152
  <LinkUITools
226
153
  focusAddBlockButton={ focusAddBlockButton }
227
154
  focusAddPageButton={ focusAddPageButton }
@@ -233,11 +160,16 @@ function UnforwardedLinkUI( props, ref ) {
233
160
  setAddingPage( true );
234
161
  setFocusAddPageButton( false );
235
162
  } }
236
- canCreatePage={ permissions.canCreate }
237
- blockEditingMode={ blockEditingMode }
163
+ canAddPage={
164
+ permissions?.canCreate &&
165
+ type === 'page'
166
+ }
167
+ canAddBlock={
168
+ blockEditingMode === 'default'
169
+ }
238
170
  />
239
- )
240
- }
171
+ );
172
+ } }
241
173
  />
242
174
  </div>
243
175
  ) }
@@ -277,8 +209,8 @@ const LinkUITools = ( {
277
209
  setAddingPage,
278
210
  focusAddBlockButton,
279
211
  focusAddPageButton,
280
- canCreatePage,
281
- blockEditingMode,
212
+ canAddPage,
213
+ canAddBlock,
282
214
  } ) => {
283
215
  const blockInserterAriaRole = 'listbox';
284
216
  const addBlockButtonRef = useRef();
@@ -298,9 +230,14 @@ const LinkUITools = ( {
298
230
  }
299
231
  }, [ focusAddPageButton ] );
300
232
 
233
+ // Don't render anything if neither button should be shown
234
+ if ( ! canAddPage && ! canAddBlock ) {
235
+ return null;
236
+ }
237
+
301
238
  return (
302
239
  <VStack spacing={ 0 } className="link-ui-tools">
303
- { canCreatePage && (
240
+ { canAddPage && (
304
241
  <Button
305
242
  __next40pxDefaultSize
306
243
  ref={ addPageButtonRef }
@@ -314,7 +251,7 @@ const LinkUITools = ( {
314
251
  { __( 'Create page' ) }
315
252
  </Button>
316
253
  ) }
317
- { blockEditingMode === 'default' && (
254
+ { canAddBlock && (
318
255
  <Button
319
256
  __next40pxDefaultSize
320
257
  ref={ addBlockButtonRef }