@wordpress/editor 14.0.3 → 14.2.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 (279) hide show
  1. package/CHANGELOG.md +16 -12
  2. package/README.md +189 -24
  3. package/build/components/create-template-part-modal/index.js +2 -0
  4. package/build/components/create-template-part-modal/index.js.map +1 -1
  5. package/build/components/document-bar/index.js +11 -4
  6. package/build/components/document-bar/index.js.map +1 -1
  7. package/build/components/editor/index.js +18 -24
  8. package/build/components/editor/index.js.map +1 -1
  9. package/build/components/editor-interface/index.js +3 -1
  10. package/build/components/editor-interface/index.js.map +1 -1
  11. package/build/components/entities-saved-states/hooks/use-is-dirty.js +9 -0
  12. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  13. package/build/components/entities-saved-states/index.js +28 -0
  14. package/build/components/entities-saved-states/index.js.map +1 -1
  15. package/build/components/global-keyboard-shortcuts/index.js +1 -1
  16. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  17. package/build/components/header/index.js +6 -2
  18. package/build/components/header/index.js.map +1 -1
  19. package/build/components/index.js +15 -0
  20. package/build/components/index.js.map +1 -1
  21. package/build/components/post-actions/actions.js +286 -263
  22. package/build/components/post-actions/actions.js.map +1 -1
  23. package/build/components/post-actions/index.js +2 -0
  24. package/build/components/post-actions/index.js.map +1 -1
  25. package/build/components/post-publish-button/index.js +4 -0
  26. package/build/components/post-publish-button/index.js.map +1 -1
  27. package/build/components/post-publish-button/label.js +5 -0
  28. package/build/components/post-publish-button/label.js.map +1 -1
  29. package/build/components/post-publish-panel/index.js +4 -0
  30. package/build/components/post-publish-panel/index.js.map +1 -1
  31. package/build/components/post-slug/check.js +8 -1
  32. package/build/components/post-slug/check.js.map +1 -1
  33. package/build/components/post-slug/index.js +6 -0
  34. package/build/components/post-slug/index.js.map +1 -1
  35. package/build/components/post-status/index.js +2 -1
  36. package/build/components/post-status/index.js.map +1 -1
  37. package/build/components/post-sticky/check.js +8 -0
  38. package/build/components/post-sticky/check.js.map +1 -1
  39. package/build/components/post-sticky/index.js +13 -13
  40. package/build/components/post-sticky/index.js.map +1 -1
  41. package/build/components/post-switch-to-draft-button/index.js +11 -2
  42. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  43. package/build/components/post-sync-status/index.js +5 -1
  44. package/build/components/post-sync-status/index.js.map +1 -1
  45. package/build/components/post-taxonomies/check.js +8 -0
  46. package/build/components/post-taxonomies/check.js.map +1 -1
  47. package/build/components/post-taxonomies/flat-term-selector.js +14 -2
  48. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  49. package/build/components/post-taxonomies/index.js +9 -0
  50. package/build/components/post-taxonomies/index.js.map +1 -1
  51. package/build/components/post-taxonomies/panel.js +10 -0
  52. package/build/components/post-taxonomies/panel.js.map +1 -1
  53. package/build/components/post-template/create-new-template-modal.js +2 -0
  54. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  55. package/build/components/post-title/index.js +4 -8
  56. package/build/components/post-title/index.js.map +1 -1
  57. package/build/components/post-title/post-title-raw.js +3 -7
  58. package/build/components/post-title/post-title-raw.js.map +1 -1
  59. package/build/components/post-trash/check.js +8 -0
  60. package/build/components/post-trash/check.js.map +1 -1
  61. package/build/components/post-trash/index.js +5 -1
  62. package/build/components/post-trash/index.js.map +1 -1
  63. package/build/components/provider/index.js +18 -15
  64. package/build/components/provider/index.js.map +1 -1
  65. package/build/components/sidebar/index.js +2 -1
  66. package/build/components/sidebar/index.js.map +1 -1
  67. package/build/components/sidebar/post-summary.js +2 -3
  68. package/build/components/sidebar/post-summary.js.map +1 -1
  69. package/build/components/table-of-contents/index.js +11 -0
  70. package/build/components/table-of-contents/index.js.map +1 -1
  71. package/build/components/template-part-content-panel/index.js +70 -0
  72. package/build/components/template-part-content-panel/index.js.map +1 -0
  73. package/build/components/template-part-menu-items/convert-to-regular.js +38 -0
  74. package/build/components/template-part-menu-items/convert-to-regular.js.map +1 -0
  75. package/build/components/template-part-menu-items/convert-to-template-part.js +77 -0
  76. package/build/components/template-part-menu-items/convert-to-template-part.js.map +1 -0
  77. package/build/components/template-part-menu-items/index.js +67 -0
  78. package/build/components/template-part-menu-items/index.js.map +1 -0
  79. package/build/components/template-part-menu-items/index.native.js +10 -0
  80. package/build/components/template-part-menu-items/index.native.js.map +1 -0
  81. package/build/components/theme-support-check/index.js +9 -0
  82. package/build/components/theme-support-check/index.js.map +1 -1
  83. package/build/components/time-to-read/index.js +6 -0
  84. package/build/components/time-to-read/index.js.map +1 -1
  85. package/build/components/word-count/index.js +5 -1
  86. package/build/components/word-count/index.js.map +1 -1
  87. package/build/dataviews/api.js +61 -0
  88. package/build/dataviews/api.js.map +1 -0
  89. package/build/dataviews/store/private-actions.js +28 -0
  90. package/build/dataviews/store/private-actions.js.map +1 -0
  91. package/build/dataviews/store/private-selectors.js +20 -0
  92. package/build/dataviews/store/private-selectors.js.map +1 -0
  93. package/build/dataviews/store/reducer.js +36 -0
  94. package/build/dataviews/store/reducer.js.map +1 -0
  95. package/build/index.js +12 -0
  96. package/build/index.js.map +1 -1
  97. package/build/private-apis.js +0 -6
  98. package/build/private-apis.js.map +1 -1
  99. package/build/private-apis.native.js +0 -2
  100. package/build/private-apis.native.js.map +1 -1
  101. package/build/store/private-actions.js +21 -0
  102. package/build/store/private-actions.js.map +1 -1
  103. package/build/store/private-selectors.js +5 -0
  104. package/build/store/private-selectors.js.map +1 -1
  105. package/build/store/reducer.js +4 -1
  106. package/build/store/reducer.js.map +1 -1
  107. package/build-module/components/create-template-part-modal/index.js +2 -0
  108. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  109. package/build-module/components/document-bar/index.js +11 -4
  110. package/build-module/components/document-bar/index.js.map +1 -1
  111. package/build-module/components/editor/index.js +19 -24
  112. package/build-module/components/editor/index.js.map +1 -1
  113. package/build-module/components/editor-interface/index.js +3 -1
  114. package/build-module/components/editor-interface/index.js.map +1 -1
  115. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +10 -0
  116. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  117. package/build-module/components/entities-saved-states/index.js +28 -0
  118. package/build-module/components/entities-saved-states/index.js.map +1 -1
  119. package/build-module/components/global-keyboard-shortcuts/index.js +1 -1
  120. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  121. package/build-module/components/header/index.js +6 -2
  122. package/build-module/components/header/index.js.map +1 -1
  123. package/build-module/components/index.js +16 -0
  124. package/build-module/components/index.js.map +1 -1
  125. package/build-module/components/post-actions/actions.js +286 -263
  126. package/build-module/components/post-actions/actions.js.map +1 -1
  127. package/build-module/components/post-actions/index.js +2 -0
  128. package/build-module/components/post-actions/index.js.map +1 -1
  129. package/build-module/components/post-publish-button/index.js +4 -0
  130. package/build-module/components/post-publish-button/index.js.map +1 -1
  131. package/build-module/components/post-publish-button/label.js +6 -0
  132. package/build-module/components/post-publish-button/label.js.map +1 -1
  133. package/build-module/components/post-publish-panel/index.js +4 -0
  134. package/build-module/components/post-publish-panel/index.js.map +1 -1
  135. package/build-module/components/post-slug/check.js +9 -0
  136. package/build-module/components/post-slug/check.js.map +1 -1
  137. package/build-module/components/post-slug/index.js +6 -0
  138. package/build-module/components/post-slug/index.js.map +1 -1
  139. package/build-module/components/post-status/index.js +2 -1
  140. package/build-module/components/post-status/index.js.map +1 -1
  141. package/build-module/components/post-sticky/check.js +9 -0
  142. package/build-module/components/post-sticky/check.js.map +1 -1
  143. package/build-module/components/post-sticky/index.js +15 -13
  144. package/build-module/components/post-sticky/index.js.map +1 -1
  145. package/build-module/components/post-switch-to-draft-button/index.js +10 -1
  146. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  147. package/build-module/components/post-sync-status/index.js +6 -0
  148. package/build-module/components/post-sync-status/index.js.map +1 -1
  149. package/build-module/components/post-taxonomies/check.js +9 -0
  150. package/build-module/components/post-taxonomies/check.js.map +1 -1
  151. package/build-module/components/post-taxonomies/flat-term-selector.js +14 -2
  152. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  153. package/build-module/components/post-taxonomies/index.js +9 -0
  154. package/build-module/components/post-taxonomies/index.js.map +1 -1
  155. package/build-module/components/post-taxonomies/panel.js +10 -0
  156. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  157. package/build-module/components/post-template/create-new-template-modal.js +2 -0
  158. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  159. package/build-module/components/post-title/index.js +4 -8
  160. package/build-module/components/post-title/index.js.map +1 -1
  161. package/build-module/components/post-title/post-title-raw.js +3 -7
  162. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  163. package/build-module/components/post-trash/check.js +9 -0
  164. package/build-module/components/post-trash/check.js.map +1 -1
  165. package/build-module/components/post-trash/index.js +6 -0
  166. package/build-module/components/post-trash/index.js.map +1 -1
  167. package/build-module/components/provider/index.js +18 -15
  168. package/build-module/components/provider/index.js.map +1 -1
  169. package/build-module/components/sidebar/index.js +2 -1
  170. package/build-module/components/sidebar/index.js.map +1 -1
  171. package/build-module/components/sidebar/post-summary.js +2 -3
  172. package/build-module/components/sidebar/post-summary.js.map +1 -1
  173. package/build-module/components/table-of-contents/index.js +11 -0
  174. package/build-module/components/table-of-contents/index.js.map +1 -1
  175. package/build-module/components/template-part-content-panel/index.js +63 -0
  176. package/build-module/components/template-part-content-panel/index.js.map +1 -0
  177. package/build-module/components/template-part-menu-items/convert-to-regular.js +31 -0
  178. package/build-module/components/template-part-menu-items/convert-to-regular.js.map +1 -0
  179. package/build-module/components/template-part-menu-items/convert-to-template-part.js +71 -0
  180. package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -0
  181. package/build-module/components/template-part-menu-items/index.js +59 -0
  182. package/build-module/components/template-part-menu-items/index.js.map +1 -0
  183. package/build-module/components/template-part-menu-items/index.native.js +4 -0
  184. package/build-module/components/template-part-menu-items/index.native.js.map +1 -0
  185. package/build-module/components/theme-support-check/index.js +10 -0
  186. package/build-module/components/theme-support-check/index.js.map +1 -1
  187. package/build-module/components/time-to-read/index.js +6 -0
  188. package/build-module/components/time-to-read/index.js.map +1 -1
  189. package/build-module/components/word-count/index.js +6 -0
  190. package/build-module/components/word-count/index.js.map +1 -1
  191. package/build-module/dataviews/api.js +54 -0
  192. package/build-module/dataviews/api.js.map +1 -0
  193. package/build-module/dataviews/store/private-actions.js +21 -0
  194. package/build-module/dataviews/store/private-actions.js.map +1 -0
  195. package/build-module/dataviews/store/private-selectors.js +14 -0
  196. package/build-module/dataviews/store/private-selectors.js.map +1 -0
  197. package/build-module/dataviews/store/reducer.js +29 -0
  198. package/build-module/dataviews/store/reducer.js.map +1 -0
  199. package/build-module/index.js +1 -0
  200. package/build-module/index.js.map +1 -1
  201. package/build-module/private-apis.js +0 -6
  202. package/build-module/private-apis.js.map +1 -1
  203. package/build-module/private-apis.native.js +0 -2
  204. package/build-module/private-apis.native.js.map +1 -1
  205. package/build-module/store/private-actions.js +1 -0
  206. package/build-module/store/private-actions.js.map +1 -1
  207. package/build-module/store/private-selectors.js +4 -0
  208. package/build-module/store/private-selectors.js.map +1 -1
  209. package/build-module/store/reducer.js +3 -1
  210. package/build-module/store/reducer.js.map +1 -1
  211. package/build-style/style-rtl.css +10 -9
  212. package/build-style/style.css +10 -9
  213. package/build-types/dataviews/store/private-actions.d.ts +17 -0
  214. package/build-types/dataviews/store/private-actions.d.ts.map +1 -0
  215. package/build-types/dataviews/store/private-selectors.d.ts +10 -0
  216. package/build-types/dataviews/store/private-selectors.d.ts.map +1 -0
  217. package/build-types/dataviews/store/reducer.d.ts +11 -0
  218. package/build-types/dataviews/store/reducer.d.ts.map +1 -0
  219. package/package.json +35 -35
  220. package/src/components/create-template-part-modal/index.js +2 -0
  221. package/src/components/create-template-part-modal/style.scss +0 -6
  222. package/src/components/document-bar/index.js +11 -4
  223. package/src/components/editor/index.js +23 -28
  224. package/src/components/editor-interface/index.js +2 -0
  225. package/src/components/entities-saved-states/hooks/use-is-dirty.js +9 -0
  226. package/src/components/entities-saved-states/index.js +26 -0
  227. package/src/components/global-keyboard-shortcuts/index.js +1 -1
  228. package/src/components/header/index.js +2 -1
  229. package/src/components/index.js +16 -0
  230. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -3
  231. package/src/components/post-actions/actions.js +376 -387
  232. package/src/components/post-actions/index.js +2 -0
  233. package/src/components/post-card-panel/style.scss +4 -0
  234. package/src/components/post-panel-row/style.scss +1 -1
  235. package/src/components/post-publish-button/index.js +3 -0
  236. package/src/components/post-publish-button/label.js +5 -0
  237. package/src/components/post-publish-panel/index.js +3 -0
  238. package/src/components/post-slug/check.js +8 -0
  239. package/src/components/post-slug/index.js +5 -0
  240. package/src/components/post-status/index.js +2 -0
  241. package/src/components/post-status/style.scss +5 -0
  242. package/src/components/post-sticky/check.js +8 -0
  243. package/src/components/post-sticky/index.js +14 -12
  244. package/src/components/post-sticky/style.scss +3 -2
  245. package/src/components/post-switch-to-draft-button/index.js +10 -1
  246. package/src/components/post-sync-status/index.js +5 -0
  247. package/src/components/post-taxonomies/check.js +8 -0
  248. package/src/components/post-taxonomies/flat-term-selector.js +13 -2
  249. package/src/components/post-taxonomies/index.js +8 -0
  250. package/src/components/post-taxonomies/panel.js +9 -0
  251. package/src/components/post-template/create-new-template-modal.js +2 -0
  252. package/src/components/post-title/index.js +2 -5
  253. package/src/components/post-title/post-title-raw.js +2 -5
  254. package/src/components/post-trash/check.js +8 -0
  255. package/src/components/post-trash/index.js +5 -0
  256. package/src/components/provider/index.js +17 -17
  257. package/src/components/sidebar/index.js +2 -0
  258. package/src/components/sidebar/post-summary.js +1 -3
  259. package/src/components/table-of-contents/index.js +10 -0
  260. package/src/components/template-part-content-panel/index.js +62 -0
  261. package/src/components/template-part-menu-items/convert-to-regular.js +32 -0
  262. package/src/components/template-part-menu-items/convert-to-template-part.js +75 -0
  263. package/src/components/template-part-menu-items/index.js +59 -0
  264. package/src/components/template-part-menu-items/index.native.js +3 -0
  265. package/src/components/theme-support-check/index.js +9 -0
  266. package/src/components/time-to-read/index.js +5 -0
  267. package/src/components/word-count/index.js +5 -0
  268. package/src/dataviews/api.js +55 -0
  269. package/src/dataviews/store/private-actions.ts +30 -0
  270. package/src/dataviews/store/private-selectors.ts +15 -0
  271. package/src/dataviews/store/reducer.ts +44 -0
  272. package/src/index.js +1 -0
  273. package/src/private-apis.js +0 -6
  274. package/src/private-apis.native.js +0 -2
  275. package/src/store/private-actions.js +1 -0
  276. package/src/store/private-selectors.js +5 -0
  277. package/src/store/reducer.js +2 -0
  278. package/tsconfig.json +36 -0
  279. package/tsconfig.tsbuildinfo +1 -0
@@ -645,11 +645,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
645
645
  .editor-create-template-part-modal {
646
646
  z-index: 1000001;
647
647
  }
648
- @media (min-width: 600px) {
649
- .editor-create-template-part-modal .components-modal__frame {
650
- max-width: 500px;
651
- }
652
- }
653
648
 
654
649
  .editor-create-template-part-modal__area-radio-group {
655
650
  width: 100%;
@@ -1277,7 +1272,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
1277
1272
  .editor-keyboard-shortcut-help-modal__shortcut-description {
1278
1273
  flex: 1;
1279
1274
  margin: 0;
1280
- flex-basis: auto;
1281
1275
  }
1282
1276
  .editor-keyboard-shortcut-help-modal__shortcut-key-combination {
1283
1277
  display: block;
@@ -1475,6 +1469,9 @@ body.is-fullscreen-mode .interface-interface-skeleton {
1475
1469
  .editor-post-card-panel__icon.is-sync {
1476
1470
  fill: var(--wp-block-synced-color);
1477
1471
  }
1472
+ .editor-post-card-panel__icon.is-sync + .editor-post-card-panel__title {
1473
+ color: var(--wp-block-synced-color);
1474
+ }
1478
1475
 
1479
1476
  .editor-post-card-panel__title-badge {
1480
1477
  background: #f0f0f0;
@@ -1672,7 +1669,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
1672
1669
  }
1673
1670
 
1674
1671
  .editor-post-panel__row-label {
1675
- width: 30%;
1672
+ width: 38%;
1676
1673
  flex-shrink: 0;
1677
1674
  min-height: 32px;
1678
1675
  display: flex;
@@ -2002,9 +1999,13 @@ body.is-fullscreen-mode .interface-interface-skeleton {
2002
1999
  padding: 0;
2003
2000
  margin-bottom: 8px;
2004
2001
  }
2002
+ .editor-change-status__content p.components-base-control__help:has(.components-checkbox-control__help) {
2003
+ margin-top: 4px;
2004
+ }
2005
2005
 
2006
- .editor-post-sticky__toggle-control {
2007
- padding: 6px 12px;
2006
+ .editor-post-sticky__checkbox-control {
2007
+ border-top: 1px solid #e0e0e0;
2008
+ padding-top: 16px;
2008
2009
  }
2009
2010
 
2010
2011
  .editor-post-sync-status__value {
@@ -0,0 +1,17 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import type { Action, AnyItem } from '@wordpress/dataviews';
5
+ export declare function registerEntityAction<Item extends AnyItem>(kind: string, name: string, config: Action<Item>): {
6
+ type: "REGISTER_ENTITY_ACTION";
7
+ kind: string;
8
+ name: string;
9
+ config: Action<Item>;
10
+ };
11
+ export declare function unregisterEntityAction(kind: string, name: string, actionId: string): {
12
+ type: "UNREGISTER_ENTITY_ACTION";
13
+ kind: string;
14
+ name: string;
15
+ actionId: string;
16
+ };
17
+ //# sourceMappingURL=private-actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private-actions.d.ts","sourceRoot":"","sources":["../../../src/dataviews/store/private-actions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE5D,wBAAgB,oBAAoB,CAAE,IAAI,SAAS,OAAO,EACzD,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAE,IAAI,CAAE;;;;;EAQtB;AAED,wBAAgB,sBAAsB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM;;;;;EAQhB"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import type { Action } from '@wordpress/dataviews';
5
+ /**
6
+ * Internal dependencies
7
+ */
8
+ import type { State } from './reducer';
9
+ export declare function getEntityActions(state: State, kind: string, name: string): Action<any>[];
10
+ //# sourceMappingURL=private-selectors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private-selectors.d.ts","sourceRoot":"","sources":["../../../src/dataviews/store/private-selectors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD;;GAEG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAIvC,wBAAgB,gBAAgB,CAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAEzE"}
@@ -0,0 +1,11 @@
1
+ import type { Action } from '@wordpress/dataviews';
2
+ type ReduxAction = ReturnType<typeof import('./private-actions').registerEntityAction> | ReturnType<typeof import('./private-actions').unregisterEntityAction>;
3
+ export type ActionState = Record<string, Record<string, Action<any>[]>>;
4
+ export type State = {
5
+ actions: ActionState;
6
+ };
7
+ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
8
+ actions: never;
9
+ }>, ReduxAction>;
10
+ export default _default;
11
+ //# sourceMappingURL=reducer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../../src/dataviews/store/reducer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,KAAK,WAAW,GACb,UAAU,CAAE,cAAc,mBAAmB,EAAE,oBAAoB,CAAE,GACrE,UAAU,CAAE,cAAc,mBAAmB,EAAE,sBAAsB,CAAE,CAAC;AAE3E,MAAM,MAAM,WAAW,GAAG,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,GAAG,CAAE,EAAE,CAAE,CAAE,CAAC;AAC9E,MAAM,MAAM,KAAK,GAAG;IACnB,OAAO,EAAE,WAAW,CAAC;CACrB,CAAC;;;;AA2BF,wBAEI"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/editor",
3
- "version": "14.0.3",
3
+ "version": "14.2.0",
4
4
  "description": "Enhanced block editor for WordPress posts.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -32,39 +32,39 @@
32
32
  ],
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.16.0",
35
- "@wordpress/a11y": "^4.0.1",
36
- "@wordpress/api-fetch": "^7.0.1",
37
- "@wordpress/blob": "^4.0.1",
38
- "@wordpress/block-editor": "^13.0.3",
39
- "@wordpress/blocks": "^13.0.3",
40
- "@wordpress/commands": "^1.0.3",
41
- "@wordpress/components": "^28.0.3",
42
- "@wordpress/compose": "^7.0.1",
43
- "@wordpress/core-data": "^7.0.3",
44
- "@wordpress/data": "^10.0.2",
45
- "@wordpress/date": "^5.0.1",
46
- "@wordpress/deprecated": "^4.0.1",
47
- "@wordpress/dom": "^4.0.1",
48
- "@wordpress/element": "^6.0.1",
49
- "@wordpress/hooks": "^4.0.1",
50
- "@wordpress/html-entities": "^4.0.1",
51
- "@wordpress/i18n": "^5.0.1",
52
- "@wordpress/icons": "^10.0.2",
53
- "@wordpress/interface": "^6.0.3",
54
- "@wordpress/keyboard-shortcuts": "^5.0.2",
55
- "@wordpress/keycodes": "^4.0.1",
56
- "@wordpress/media-utils": "^5.0.1",
57
- "@wordpress/notices": "^5.0.2",
58
- "@wordpress/patterns": "^2.0.3",
59
- "@wordpress/plugins": "^7.0.3",
60
- "@wordpress/preferences": "^4.0.3",
61
- "@wordpress/private-apis": "^1.0.2",
62
- "@wordpress/reusable-blocks": "^5.0.3",
63
- "@wordpress/rich-text": "^7.0.2",
64
- "@wordpress/server-side-render": "^5.0.3",
65
- "@wordpress/url": "^4.0.1",
66
- "@wordpress/warning": "^3.0.1",
67
- "@wordpress/wordcount": "^4.0.1",
35
+ "@wordpress/a11y": "^4.2.0",
36
+ "@wordpress/api-fetch": "^7.2.0",
37
+ "@wordpress/blob": "^4.2.0",
38
+ "@wordpress/block-editor": "^13.2.0",
39
+ "@wordpress/blocks": "^13.2.0",
40
+ "@wordpress/commands": "^1.2.0",
41
+ "@wordpress/components": "^28.2.0",
42
+ "@wordpress/compose": "^7.2.0",
43
+ "@wordpress/core-data": "^7.2.0",
44
+ "@wordpress/data": "^10.2.0",
45
+ "@wordpress/date": "^5.2.0",
46
+ "@wordpress/deprecated": "^4.2.0",
47
+ "@wordpress/dom": "^4.2.0",
48
+ "@wordpress/element": "^6.2.0",
49
+ "@wordpress/hooks": "^4.2.0",
50
+ "@wordpress/html-entities": "^4.2.0",
51
+ "@wordpress/i18n": "^5.2.0",
52
+ "@wordpress/icons": "^10.2.0",
53
+ "@wordpress/interface": "^6.2.0",
54
+ "@wordpress/keyboard-shortcuts": "^5.2.0",
55
+ "@wordpress/keycodes": "^4.2.0",
56
+ "@wordpress/media-utils": "^5.2.0",
57
+ "@wordpress/notices": "^5.2.0",
58
+ "@wordpress/patterns": "^2.2.0",
59
+ "@wordpress/plugins": "^7.2.0",
60
+ "@wordpress/preferences": "^4.2.0",
61
+ "@wordpress/private-apis": "^1.2.0",
62
+ "@wordpress/reusable-blocks": "^5.2.0",
63
+ "@wordpress/rich-text": "^7.2.0",
64
+ "@wordpress/server-side-render": "^5.2.0",
65
+ "@wordpress/url": "^4.2.0",
66
+ "@wordpress/warning": "^3.2.0",
67
+ "@wordpress/wordcount": "^4.2.0",
68
68
  "change-case": "^4.1.2",
69
69
  "client-zip": "^2.4.5",
70
70
  "clsx": "^2.1.1",
@@ -83,5 +83,5 @@
83
83
  "publishConfig": {
84
84
  "access": "public"
85
85
  },
86
- "gitHead": "9dd5f8dcfa4fc7242e5d48be20ee789ad087b432"
86
+ "gitHead": "aa5b14bb5bdbb8d8a02914e154c3bc1c2f18ace6"
87
87
  }
@@ -53,6 +53,8 @@ export default function CreateTemplatePartModal( {
53
53
  title={ modalTitle || defaultModalTitle }
54
54
  onRequestClose={ restProps.closeModal }
55
55
  overlayClassName="editor-create-template-part-modal"
56
+ focusOnMount="firstContentElement"
57
+ size="medium"
56
58
  >
57
59
  <CreateTemplatePartModalContents { ...restProps } />
58
60
  </Modal>
@@ -1,11 +1,5 @@
1
1
  .editor-create-template-part-modal {
2
2
  z-index: z-index(".editor-create-template-part-modal");
3
-
4
- .components-modal__frame {
5
- @include break-small {
6
- max-width: 500px;
7
- }
8
- }
9
3
  }
10
4
 
11
5
  .editor-create-template-part-modal__area-radio-group {
@@ -52,10 +52,15 @@ const MotionButton = motion( Button );
52
52
  * ```jsx
53
53
  * <DocumentBar />
54
54
  * ```
55
+ * @param {Object} props The component props.
56
+ * @param {string} props.title A title for the document, defaulting to the document or
57
+ * template title currently being edited.
58
+ * @param {import("@wordpress/components").IconType} props.icon An icon for the document, defaulting to an icon for document
59
+ * or template currently being edited.
55
60
  *
56
61
  * @return {JSX.Element} The rendered DocumentBar component.
57
62
  */
58
- export default function DocumentBar() {
63
+ export default function DocumentBar( props ) {
59
64
  const {
60
65
  postType,
61
66
  documentTitle,
@@ -111,7 +116,9 @@ export default function DocumentBar() {
111
116
  const isTemplate = TEMPLATE_POST_TYPES.includes( postType );
112
117
  const isGlobalEntity = GLOBAL_POST_TYPES.includes( postType );
113
118
  const hasBackButton = !! onNavigateToPreviousEntityRecord;
114
- const title = isTemplate ? templateTitle : documentTitle;
119
+ const entityTitle = isTemplate ? templateTitle : documentTitle;
120
+ const title = props.title || entityTitle;
121
+ const icon = props.icon || templateIcon;
115
122
 
116
123
  const mounted = useRef( false );
117
124
  useEffect( () => {
@@ -180,12 +187,12 @@ export default function DocumentBar() {
180
187
  isReducedMotion ? { duration: 0 } : undefined
181
188
  }
182
189
  >
183
- <BlockIcon icon={ templateIcon } />
190
+ <BlockIcon icon={ icon } />
184
191
  <Text
185
192
  size="body"
186
193
  as="h1"
187
194
  aria-label={
188
- TYPE_LABELS[ postType ]
195
+ ! props.title && TYPE_LABELS[ postType ]
189
196
  ? // eslint-disable-next-line @wordpress/valid-sprintf
190
197
  sprintf( TYPE_LABELS[ postType ], title )
191
198
  : undefined
@@ -20,20 +20,16 @@ function Editor( {
20
20
  templateId,
21
21
  settings,
22
22
  children,
23
+ initialEdits,
23
24
 
24
25
  // This could be part of the settings.
25
26
  onActionPerformed,
26
27
 
27
28
  // The following abstractions are not ideal but necessary
28
29
  // to account for site editor and post editor differences for now.
29
- className,
30
- styles,
31
- customSaveButton,
32
- forceDisableBlockTools,
33
- title,
34
- iframeProps,
30
+ extraContent,
35
31
  extraSidebarPanels,
36
- enableRegionNavigation = true,
32
+ ...props
37
33
  } ) {
38
34
  const { post, template, hasLoadedPost } = useSelect(
39
35
  ( select ) => {
@@ -59,12 +55,7 @@ function Editor( {
59
55
  );
60
56
 
61
57
  return (
62
- <ExperimentalEditorProvider
63
- post={ post }
64
- __unstableTemplate={ template }
65
- settings={ settings }
66
- useSubRegistry={ false }
67
- >
58
+ <>
68
59
  { hasLoadedPost && ! post && (
69
60
  <Notice status="warning" isDismissible={ false }>
70
61
  { __(
@@ -72,21 +63,25 @@ function Editor( {
72
63
  ) }
73
64
  </Notice>
74
65
  ) }
75
- <EditorInterface
76
- className={ className }
77
- styles={ styles }
78
- enableRegionNavigation={ enableRegionNavigation }
79
- customSaveButton={ customSaveButton }
80
- forceDisableBlockTools={ forceDisableBlockTools }
81
- title={ title }
82
- iframeProps={ iframeProps }
83
- />
84
- <Sidebar
85
- onActionPerformed={ onActionPerformed }
86
- extraPanels={ extraSidebarPanels }
87
- />
88
- { children }
89
- </ExperimentalEditorProvider>
66
+ { !! post && (
67
+ <ExperimentalEditorProvider
68
+ post={ post }
69
+ __unstableTemplate={ template }
70
+ settings={ settings }
71
+ initialEdits={ initialEdits }
72
+ useSubRegistry={ false }
73
+ >
74
+ <EditorInterface { ...props }>
75
+ { extraContent }
76
+ </EditorInterface>
77
+ <Sidebar
78
+ onActionPerformed={ onActionPerformed }
79
+ extraPanels={ extraSidebarPanels }
80
+ />
81
+ { children }
82
+ </ExperimentalEditorProvider>
83
+ ) }
84
+ </>
90
85
  );
91
86
  }
92
87
 
@@ -57,6 +57,7 @@ export default function EditorInterface( {
57
57
  customSaveButton,
58
58
  forceDisableBlockTools,
59
59
  title,
60
+ icon,
60
61
  iframeProps,
61
62
  } ) {
62
63
  const {
@@ -140,6 +141,7 @@ export default function EditorInterface( {
140
141
  customSaveButton={ customSaveButton }
141
142
  forceDisableBlockTools={ forceDisableBlockTools }
142
143
  title={ title }
144
+ icon={ icon }
143
145
  />
144
146
  )
145
147
  }
@@ -5,6 +5,15 @@ import { useSelect } from '@wordpress/data';
5
5
  import { store as coreStore } from '@wordpress/core-data';
6
6
  import { useMemo, useState } from '@wordpress/element';
7
7
 
8
+ /**
9
+ * Custom hook that determines if any entities are dirty (edited) and provides a way to manage selected/unselected entities.
10
+ *
11
+ * @return {Object} An object containing the following properties:
12
+ * - dirtyEntityRecords: An array of dirty entity records.
13
+ * - isDirty: A boolean indicating if there are any dirty entity records.
14
+ * - setUnselectedEntities: A function to set the unselected entities.
15
+ * - unselectedEntities: An array of unselected entities.
16
+ */
8
17
  export const useIsDirty = () => {
9
18
  const { editedEntities, siteEdits, siteEntityConfig } = useSelect(
10
19
  ( select ) => {
@@ -26,6 +26,15 @@ function identity( values ) {
26
26
  return values;
27
27
  }
28
28
 
29
+ /**
30
+ * Renders the component for managing saved states of entities.
31
+ *
32
+ * @param {Object} props The component props.
33
+ * @param {Function} props.close The function to close the dialog.
34
+ * @param {Function} props.renderDialog The function to render the dialog.
35
+ *
36
+ * @return {JSX.Element} The rendered component.
37
+ */
29
38
  export default function EntitiesSavedStates( {
30
39
  close,
31
40
  renderDialog = undefined,
@@ -40,6 +49,23 @@ export default function EntitiesSavedStates( {
40
49
  );
41
50
  }
42
51
 
52
+ /**
53
+ * Renders a panel for saving entities with dirty records.
54
+ *
55
+ * @param {Object} props The component props.
56
+ * @param {string} props.additionalPrompt Additional prompt to display.
57
+ * @param {Function} props.close Function to close the panel.
58
+ * @param {Function} props.onSave Function to call when saving entities.
59
+ * @param {boolean} props.saveEnabled Flag indicating if save is enabled.
60
+ * @param {string} props.saveLabel Label for the save button.
61
+ * @param {Function} props.renderDialog Function to render a custom dialog.
62
+ * @param {Array} props.dirtyEntityRecords Array of dirty entity records.
63
+ * @param {boolean} props.isDirty Flag indicating if there are dirty entities.
64
+ * @param {Function} props.setUnselectedEntities Function to set unselected entities.
65
+ * @param {Array} props.unselectedEntities Array of unselected entities.
66
+ *
67
+ * @return {JSX.Element} The rendered component.
68
+ */
43
69
  export function EntitiesSavedStatesExtensible( {
44
70
  additionalPrompt = undefined,
45
71
  close,
@@ -12,7 +12,7 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
12
12
  import { store as editorStore } from '../../store';
13
13
 
14
14
  /**
15
- * Component handles the keyboard shortcuts for the editor.
15
+ * Handles the keyboard shortcuts for the editor.
16
16
  *
17
17
  * It provides functionality for various keyboard shortcuts such as toggling editor mode,
18
18
  * toggling distraction-free mode, undo/redo, saving the post, toggling list view,
@@ -51,6 +51,7 @@ function Header( {
51
51
  forceDisableBlockTools,
52
52
  setEntitiesSavedStatesCallback,
53
53
  title,
54
+ icon,
54
55
  } ) {
55
56
  const isWideViewport = useViewportMatch( 'large' );
56
57
  const isLargeViewport = useViewportMatch( 'medium' );
@@ -116,7 +117,7 @@ function Header( {
116
117
  ! isBlockToolsCollapsed && hasTopToolbar,
117
118
  } ) }
118
119
  >
119
- { ! title ? <DocumentBar /> : title }
120
+ <DocumentBar title={ title } icon={ icon } />
120
121
  </div>
121
122
  </motion.div>
122
123
  <motion.div
@@ -105,5 +105,21 @@ export { default as CharacterCount } from './character-count';
105
105
  export { default as EditorProvider } from './provider';
106
106
 
107
107
  export * from './deprecated';
108
+
109
+ /**
110
+ * Handles the keyboard shortcuts for the editor.
111
+ *
112
+ * It provides functionality for various keyboard shortcuts such as toggling editor mode,
113
+ * toggling distraction-free mode, undo/redo, saving the post, toggling list view,
114
+ * and toggling the sidebar.
115
+ */
108
116
  export const VisualEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;
117
+
118
+ /**
119
+ * Handles the keyboard shortcuts for the editor.
120
+ *
121
+ * It provides functionality for various keyboard shortcuts such as toggling editor mode,
122
+ * toggling distraction-free mode, undo/redo, saving the post, toggling list view,
123
+ * and toggling the sidebar.
124
+ */
109
125
  export const TextEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;
@@ -33,9 +33,6 @@
33
33
  &__shortcut-description {
34
34
  flex: 1;
35
35
  margin: 0;
36
-
37
- // IE 11 flex item fix - ensure the item does not collapse.
38
- flex-basis: auto;
39
36
  }
40
37
 
41
38
  &__shortcut-key-combination {