@wordpress/editor 14.11.0 → 14.12.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 (165) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +0 -8
  3. package/build/components/collab-sidebar/add-comment.js +5 -6
  4. package/build/components/collab-sidebar/add-comment.js.map +1 -1
  5. package/build/components/collab-sidebar/index.js +75 -73
  6. package/build/components/collab-sidebar/index.js.map +1 -1
  7. package/build/components/commands/index.js +142 -34
  8. package/build/components/commands/index.js.map +1 -1
  9. package/build/components/create-template-part-modal/index.js +1 -0
  10. package/build/components/create-template-part-modal/index.js.map +1 -1
  11. package/build/components/document-bar/index.js +9 -3
  12. package/build/components/document-bar/index.js.map +1 -1
  13. package/build/components/document-tools/index.js +8 -4
  14. package/build/components/document-tools/index.js.map +1 -1
  15. package/build/components/editor-interface/index.js +1 -2
  16. package/build/components/editor-interface/index.js.map +1 -1
  17. package/build/components/global-styles-provider/index.js +20 -8
  18. package/build/components/global-styles-provider/index.js.map +1 -1
  19. package/build/components/header/index.js +10 -12
  20. package/build/components/header/index.js.map +1 -1
  21. package/build/components/more-menu/index.js +9 -7
  22. package/build/components/more-menu/index.js.map +1 -1
  23. package/build/components/post-taxonomies/flat-term-selector.js +10 -8
  24. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  25. package/build/components/post-template/swap-template-button.js +0 -3
  26. package/build/components/post-template/swap-template-button.js.map +1 -1
  27. package/build/components/post-transform-panel/index.js +0 -3
  28. package/build/components/post-transform-panel/index.js.map +1 -1
  29. package/build/components/preferences-modal/index.js +26 -22
  30. package/build/components/preferences-modal/index.js.map +1 -1
  31. package/build/components/preview-dropdown/index.js +23 -4
  32. package/build/components/preview-dropdown/index.js.map +1 -1
  33. package/build/components/provider/use-block-editor-settings.js +10 -9
  34. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  35. package/build/components/sidebar/post-summary.js +2 -2
  36. package/build/components/sidebar/post-summary.js.map +1 -1
  37. package/build/components/start-page-options/index.js +0 -3
  38. package/build/components/start-page-options/index.js.map +1 -1
  39. package/build/components/start-template-options/index.js +0 -3
  40. package/build/components/start-template-options/index.js.map +1 -1
  41. package/build/components/visual-editor/index.js +5 -2
  42. package/build/components/visual-editor/index.js.map +1 -1
  43. package/build/store/actions.js +65 -16
  44. package/build/store/actions.js.map +1 -1
  45. package/build/store/constants.js +0 -2
  46. package/build/store/constants.js.map +1 -1
  47. package/build/store/index.js +0 -4
  48. package/build/store/index.js.map +1 -1
  49. package/build/store/selectors.js +2 -2
  50. package/build/store/selectors.js.map +1 -1
  51. package/build-module/components/collab-sidebar/add-comment.js +5 -6
  52. package/build-module/components/collab-sidebar/add-comment.js.map +1 -1
  53. package/build-module/components/collab-sidebar/index.js +76 -74
  54. package/build-module/components/collab-sidebar/index.js.map +1 -1
  55. package/build-module/components/commands/index.js +145 -38
  56. package/build-module/components/commands/index.js.map +1 -1
  57. package/build-module/components/create-template-part-modal/index.js +1 -0
  58. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  59. package/build-module/components/document-bar/index.js +10 -4
  60. package/build-module/components/document-bar/index.js.map +1 -1
  61. package/build-module/components/document-tools/index.js +8 -4
  62. package/build-module/components/document-tools/index.js.map +1 -1
  63. package/build-module/components/editor-interface/index.js +1 -2
  64. package/build-module/components/editor-interface/index.js.map +1 -1
  65. package/build-module/components/global-styles-provider/index.js +20 -8
  66. package/build-module/components/global-styles-provider/index.js.map +1 -1
  67. package/build-module/components/header/index.js +10 -12
  68. package/build-module/components/header/index.js.map +1 -1
  69. package/build-module/components/more-menu/index.js +9 -7
  70. package/build-module/components/more-menu/index.js.map +1 -1
  71. package/build-module/components/post-taxonomies/flat-term-selector.js +10 -8
  72. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  73. package/build-module/components/post-template/swap-template-button.js +0 -3
  74. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  75. package/build-module/components/post-transform-panel/index.js +0 -3
  76. package/build-module/components/post-transform-panel/index.js.map +1 -1
  77. package/build-module/components/preferences-modal/index.js +26 -22
  78. package/build-module/components/preferences-modal/index.js.map +1 -1
  79. package/build-module/components/preview-dropdown/index.js +24 -5
  80. package/build-module/components/preview-dropdown/index.js.map +1 -1
  81. package/build-module/components/provider/use-block-editor-settings.js +11 -10
  82. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  83. package/build-module/components/sidebar/post-summary.js +2 -2
  84. package/build-module/components/sidebar/post-summary.js.map +1 -1
  85. package/build-module/components/start-page-options/index.js +0 -3
  86. package/build-module/components/start-page-options/index.js.map +1 -1
  87. package/build-module/components/start-template-options/index.js +0 -3
  88. package/build-module/components/start-template-options/index.js.map +1 -1
  89. package/build-module/components/visual-editor/index.js +5 -2
  90. package/build-module/components/visual-editor/index.js.map +1 -1
  91. package/build-module/store/actions.js +61 -14
  92. package/build-module/store/actions.js.map +1 -1
  93. package/build-module/store/constants.js +0 -2
  94. package/build-module/store/constants.js.map +1 -1
  95. package/build-module/store/index.js +0 -4
  96. package/build-module/store/index.js.map +1 -1
  97. package/build-module/store/selectors.js +2 -2
  98. package/build-module/store/selectors.js.map +1 -1
  99. package/build-style/style-rtl.css +22 -6
  100. package/build-style/style.css +22 -6
  101. package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
  102. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  103. package/build-types/components/commands/index.d.ts.map +1 -1
  104. package/build-types/components/create-template-part-modal/index.d.ts.map +1 -1
  105. package/build-types/components/document-bar/index.d.ts.map +1 -1
  106. package/build-types/components/document-tools/index.d.ts.map +1 -1
  107. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  108. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  109. package/build-types/components/header/index.d.ts +1 -2
  110. package/build-types/components/header/index.d.ts.map +1 -1
  111. package/build-types/components/more-menu/index.d.ts.map +1 -1
  112. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  113. package/build-types/components/post-template/hooks.d.ts +2 -2
  114. package/build-types/components/post-template/swap-template-button.d.ts.map +1 -1
  115. package/build-types/components/post-transform-panel/index.d.ts.map +1 -1
  116. package/build-types/components/preferences-modal/index.d.ts.map +1 -1
  117. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  118. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  119. package/build-types/components/start-page-options/index.d.ts.map +1 -1
  120. package/build-types/components/start-template-options/index.d.ts.map +1 -1
  121. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  122. package/build-types/dataviews/store/reducer.d.ts +5 -2
  123. package/build-types/dataviews/store/reducer.d.ts.map +1 -1
  124. package/build-types/lock-unlock.d.ts +2 -2
  125. package/build-types/store/actions.d.ts +9 -1
  126. package/build-types/store/actions.d.ts.map +1 -1
  127. package/build-types/store/constants.d.ts +0 -2
  128. package/build-types/store/constants.d.ts.map +1 -1
  129. package/build-types/store/index.d.ts +9 -11
  130. package/build-types/store/index.d.ts.map +1 -1
  131. package/build-types/store/reducer.d.ts +24 -4
  132. package/build-types/store/reducer.d.ts.map +1 -1
  133. package/build-types/store/selectors.d.ts +3 -3
  134. package/build-types/store/selectors.d.ts.map +1 -1
  135. package/package.json +4 -3
  136. package/src/components/collab-sidebar/add-comment.js +17 -20
  137. package/src/components/collab-sidebar/index.js +79 -88
  138. package/src/components/commands/index.js +390 -270
  139. package/src/components/create-template-part-modal/index.js +1 -0
  140. package/src/components/document-bar/index.js +10 -1
  141. package/src/components/document-bar/style.scss +13 -0
  142. package/src/components/document-tools/index.js +7 -1
  143. package/src/components/editor-interface/index.js +0 -1
  144. package/src/components/global-styles-provider/index.js +20 -8
  145. package/src/components/header/index.js +18 -10
  146. package/src/components/more-menu/index.js +12 -7
  147. package/src/components/plugin-post-publish-panel/test/__snapshots__/index.js.snap +1 -1
  148. package/src/components/post-taxonomies/flat-term-selector.js +8 -8
  149. package/src/components/post-template/swap-template-button.js +0 -3
  150. package/src/components/post-transform-panel/index.js +0 -3
  151. package/src/components/preferences-modal/index.js +26 -19
  152. package/src/components/preferences-modal/test/index.js +1 -1
  153. package/src/components/preview-dropdown/index.js +45 -16
  154. package/src/components/provider/use-block-editor-settings.js +10 -9
  155. package/src/components/sidebar/post-summary.js +1 -1
  156. package/src/components/sidebar/style.scss +1 -3
  157. package/src/components/start-page-options/index.js +0 -3
  158. package/src/components/start-template-options/index.js +0 -3
  159. package/src/components/visual-editor/index.js +7 -1
  160. package/src/components/visual-editor/style.scss +11 -0
  161. package/src/store/actions.js +110 -33
  162. package/src/store/constants.ts +0 -2
  163. package/src/store/index.js +0 -4
  164. package/src/store/selectors.js +2 -2
  165. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/more-menu/index.js"],"names":[],"mappings":"AA4BA,gEAiIC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/more-menu/index.js"],"names":[],"mappings":"AA4BA,gEAsIC"}
@@ -1 +1 @@
1
- {"version":3,"file":"flat-term-selector.d.ts","sourceRoot":"","sources":["../../../src/components/post-taxonomies/flat-term-selector.js"],"names":[],"mappings":"AA2DA;;;;;;;;GAQG;AACH,oEALG;IAAuB,IAAI,EAAnB,MAAM;IACS,uBAAuB,EAAtC,OAAO;CAEf,GAAS,GAAG,CAAC,OAAO,CA+PtB;;;;;;;yBAzRW,OAAO;;wJASX,CAAC;4BAGJ,CAAC;;;;kCAQE,OAAO;;6BAEmC,CAAvB;yBACiC,CAAC,iCAC3C,OAAO;+BAAmD,CAAC;0BAA2F,CAAA,2DAA4D,CAAA;0BAEzM,CAAC;iCAE5B,CAAA;iCAA2C,CAAC;wCAE3B,CAAA;2BACgC,CAAA;kCAIG,CAAC;;;;;yBAIoF,OAAM;;wJActG,CAAC;4BAElB,CAAC;;;;kCAIhB,OAAM;;6BAC2B,CAAC;yBAKT,CAAC,iCAI5B,OACL;+BAEK,CAAN;0BAGS,CAAC,2DAEM,CAAC;0BACT,CAAC;iCAEW,CAAC;iCAEL,CAAC;wCAGR,CAAC;2BAEN,CAAC;kCAUH,CAAD;;yBAIe,OAAO"}
1
+ {"version":3,"file":"flat-term-selector.d.ts","sourceRoot":"","sources":["../../../src/components/post-taxonomies/flat-term-selector.js"],"names":[],"mappings":"AAkEA;;;;;;;;GAQG;AACH,oEALG;IAAuB,IAAI,EAAnB,MAAM;IACS,uBAAuB,EAAtC,OAAO;CAEf,GAAS,GAAG,CAAC,OAAO,CAwPtB;;;;;;;yBAzRW,OAAO;;wJASX,CAAC;4BAGJ,CAAC;;;;kCAOM,OAAO;;6BACJ,CAAC;yBAId,CAAC,iCAGwB,OAAO;+BAEgB,CAAV;0BACmB,CAAC,2DACjB,CAAC;0BAAwC,CAAC;iCAA4C,CAAA;iCAA2C,CAAC;wCAEtJ,CAAC;2BAEM,CAAC;kCAET,CAAC;;;;;yBAK4C,OACjE;;wJAKA,CAAF;4BAOa,CAAC;;;;kCAMM,OACpB;;6BAAyD,CAAC;yBAGvB,CAAC,iCACT,OACvB;+BACA,CAAA;0BAI6B,CAAC,2DAKb,CAAA;0BAEb,CAAC;iCACF,CAAH;iCAEW,CAAC;wCAGT,CAAD;2BAIF,CAAC;kCAGW,CAAC;;yBAOf,OAAK"}
@@ -1,6 +1,6 @@
1
1
  export function useEditedPostContext(): {
2
- postId: any;
3
- postType: any;
2
+ postId: number | null;
3
+ postType: string;
4
4
  };
5
5
  export function useAllowSwitchingTemplates(): boolean;
6
6
  export function useAvailableTemplates(postType: any): false | (import("@wordpress/core-data").Attachment<any> | import("@wordpress/core-data").Comment<any> | import("@wordpress/core-data").GlobalStylesRevision<any> | import("@wordpress/core-data").MenuLocation<any> | import("@wordpress/core-data").NavMenu<any> | import("@wordpress/core-data").NavMenuItem<any> | import("@wordpress/core-data").Page<any> | import("@wordpress/core-data").Plugin<any> | import("@wordpress/core-data").Post<any> | import("@wordpress/core-data").PostRevision<any> | import("@wordpress/core-data").Settings<any> | import("@wordpress/core-data").Sidebar<any> | import("@wordpress/core-data").Taxonomy<any> | import("@wordpress/core-data").Theme<any> | import("@wordpress/core-data").User<any> | import("@wordpress/core-data").Type<any> | import("@wordpress/core-data").Widget<any> | import("@wordpress/core-data").WidgetType<any> | import("@wordpress/core-data").WpTemplate<any> | import("@wordpress/core-data").WpTemplatePart<any> | Partial<import("@wordpress/core-data").Attachment<any> | import("@wordpress/core-data").Comment<any> | import("@wordpress/core-data").GlobalStylesRevision<any> | import("@wordpress/core-data").MenuLocation<any> | import("@wordpress/core-data").NavMenu<any> | import("@wordpress/core-data").NavMenuItem<any> | import("@wordpress/core-data").Page<any> | import("@wordpress/core-data").Plugin<any> | import("@wordpress/core-data").Post<any> | import("@wordpress/core-data").PostRevision<any> | import("@wordpress/core-data").Settings<any> | import("@wordpress/core-data").Sidebar<any> | import("@wordpress/core-data").Taxonomy<any> | import("@wordpress/core-data").Theme<any> | import("@wordpress/core-data").User<any> | import("@wordpress/core-data").Type<any> | import("@wordpress/core-data").Widget<any> | import("@wordpress/core-data").WidgetType<any> | import("@wordpress/core-data").WpTemplate<any> | import("@wordpress/core-data").WpTemplatePart<any>>)[] | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"swap-template-button.d.ts","sourceRoot":"","sources":["../../../src/components/post-template/swap-template-button.js"],"names":[],"mappings":"AAkBA;;uCAyCC"}
1
+ {"version":3,"file":"swap-template-button.d.ts","sourceRoot":"","sources":["../../../src/components/post-template/swap-template-button.js"],"names":[],"mappings":"AAiBA;;uCAyCC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-transform-panel/index.js"],"names":[],"mappings":"AA2EA,iFAeC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-transform-panel/index.js"],"names":[],"mappings":"AAwEA,iFAeC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/preferences-modal/index.js"],"names":[],"mappings":"AAqCA;;uCAgTC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/preferences-modal/index.js"],"names":[],"mappings":"AAqCA;;uCAiBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/preview-dropdown/index.js"],"names":[],"mappings":"AAgCA;;;uCA0IC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/preview-dropdown/index.js"],"names":[],"mappings":"AAgCA;;;uCAuKC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-block-editor-settings.d.ts","sourceRoot":"","sources":["../../../src/components/provider/use-block-editor-settings.js"],"names":[],"mappings":";AAoGA;;;;;;;;;GASG;AACH,kDAPW,MAAM,YACN,MAAM,UACN,MAAM,iBACN,MAAM,GAEL,MAAM,CA8PjB"}
1
+ {"version":3,"file":"use-block-editor-settings.d.ts","sourceRoot":"","sources":["../../../src/components/provider/use-block-editor-settings.js"],"names":[],"mappings":";AAgGA;;;;;;;;;GASG;AACH,kDAPW,MAAM,YACN,MAAM,UACN,MAAM,iBACN,MAAM,GAEL,MAAM,CAmQjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/start-page-options/index.js"],"names":[],"mappings":"AAuBA,wCA0CC;AAqDD,+EAyBC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/start-page-options/index.js"],"names":[],"mappings":"AAsBA,wCA0CC;AAmDD,+EAyBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/start-template-options/index.js"],"names":[],"mappings":"AA0KA,mFAoDC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/start-template-options/index.js"],"names":[],"mappings":"AAuKA,mFAoDC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/visual-editor/index.js"],"names":[],"mappings":";AAmGA;;;;;;;gCAwYC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/visual-editor/index.js"],"names":[],"mappings":";AAmGA;;;;;;;gCA8YC"}
@@ -6,13 +6,16 @@ export type State = {
6
6
  actions: ActionState;
7
7
  isReady: ReadyState;
8
8
  };
9
- declare const _default: import("redux").Reducer<import("redux").CombinedState<{
9
+ declare const _default: import("redux").Reducer<{
10
10
  actions: {
11
11
  [x: string]: Record<string, Action<any>[]> | {
12
12
  [x: string]: Action<any>[] | (Action<unknown> | Action<any>)[];
13
13
  };
14
14
  };
15
15
  isReady: ReadyState;
16
- }>, ReduxAction>;
16
+ }, ReduxAction, Partial<{
17
+ actions: never;
18
+ isReady: never;
19
+ }>>;
17
20
  export default _default;
18
21
  //# sourceMappingURL=reducer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../../src/dataviews/store/reducer.ts"],"names":[],"mappings":"AAIA,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,GACvE,UAAU,CAAE,cAAc,mBAAmB,EAAE,UAAU,CAAE,CAAC;AAE/D,MAAM,MAAM,WAAW,GAAG,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,GAAG,CAAE,EAAE,CAAE,CAAE,CAAC;AAC9E,MAAM,MAAM,UAAU,GAAG,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,CAAE,CAAC;AACrE,MAAM,MAAM,KAAK,GAAG;IACnB,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,UAAU,CAAC;CACpB,CAAC;;;;;;;;;AAkDF,wBAGI"}
1
+ {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../../src/dataviews/store/reducer.ts"],"names":[],"mappings":"AAIA,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,GACvE,UAAU,CAAE,cAAc,mBAAmB,EAAE,UAAU,CAAE,CAAC;AAE/D,MAAM,MAAM,WAAW,GAAG,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,GAAG,CAAE,EAAE,CAAE,CAAE,CAAC;AAC9E,MAAM,MAAM,UAAU,GAAG,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,CAAE,CAAC;AACrE,MAAM,MAAM,KAAK,GAAG;IACnB,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,UAAU,CAAC;CACpB,CAAC;;;;;;;;;;;;AAkDF,wBAGI"}
@@ -1,3 +1,3 @@
1
- export const lock: (object: any, privateData: any) => void;
2
- export const unlock: (object: any) => any;
1
+ export const lock: (object: Record<symbol, WeakKey>, privateData: unknown) => void;
2
+ export const unlock: (object: Record<symbol, WeakKey>) => any;
3
3
  //# sourceMappingURL=lock-unlock.d.ts.map
@@ -248,10 +248,18 @@ export function toggleEditorPanelOpened(panelName: string): ({ registry }: {
248
248
  registry: any;
249
249
  }) => void;
250
250
  export function setIsInserterOpened(value: boolean | Object): Object;
251
- export function toggleDistractionFree(): ({ dispatch, registry }: {
251
+ export function toggleDistractionFree({ createNotice }?: {
252
+ createNotice?: boolean | undefined;
253
+ } | undefined): ({ dispatch, registry }: {
252
254
  dispatch: any;
253
255
  registry: any;
254
256
  }) => void;
257
+ export function toggleSpotlightMode(): ({ registry }: {
258
+ registry: any;
259
+ }) => void;
260
+ export function toggleTopToolbar(): ({ registry }: {
261
+ registry: any;
262
+ }) => void;
255
263
  export function switchEditorMode(mode: string): ({ dispatch, registry }: {
256
264
  dispatch: any;
257
265
  registry: any;
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/store/actions.js"],"names":[],"mappings":"AA0EA;;;;;;;GAOG;AACH,gDAFY,MAAM,CAUjB;AAED;;;;;GAKG;AACH;;EAOC;AAED;;;;;;GAMG;AACH,8BAHY,MAAM,CAWjB;AAED;;;;;;GAMG;AACH,uCAFW,MAAM,UAQhB;AAED;;;;;;;GAOG;AACH,wCALW,MAAM,UACN,MAAM,GAEL,MAAM,CAQjB;AA4KD;;;;GAIG;AACH;;EAOC;AAqGD;;;;GAIG;AACH;;EAOC;AAED;;;;;GAKG;AACH,qCAHW,MAAM,GACL,MAAM,CAOjB;AAwBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,yCAxCW,MAAM,GAsCL,MAAM,CAOjB;AAED;;;;;;;;;;;;GAYG;AACH,2CAVW,MAAM,GAQL,MAAM,CAOjB;AAED;;;;;;;;;;;;GAYG;AACH,6CAVW,MAAM,GAQL,MAAM,CAOjB;AAED;;;;;;;;;;;;GAYG;AACH,+CAVW,MAAM,GAQL,MAAM,CAOjB;AA6CD;;;EAKC;AAyBD;;;;;;GAMG;AACH,0CAJW,MAAM,GAEL,MAAM,CAOjB;AAiED;;;;;;GAMG;AACH,6CAJW,MAAM,GAEL,MAAM,CAOjB;AAsCD;;;;;GAKG;AACH,4CAHW,OAAO,GACN,MAAM,CAOjB;AAiGD;;;;;GAKG;AACH,sCAFY,MAAM,CAMjB;AAED;;;;;GAKG;AACH,uCAFY,MAAM,CAMjB;AAED;;;;GAIG;AACH,wCAFY,MAAM,CAMjB;AAj4BM,kCAJI,MAAM,SACN,MAAM,YACN,YAAM;;WAiCf;AAiHK,gCA1BI,MAAM,WACN,MAAM,GAuBL,MAAM,CAShB;AAOK,mCAFI,MAAM;;;;oBA8Hf;AAmBK;;;;oBA2BL;AAUK,iDAFI,MAAM,OAAC;;;oBAqBhB;AAEK;;;;;mBAkBL;AAKK;;WAIL;AAKK;;WAIL;AAgCK;;WAML;AAKK;;WAML;AAsHK,2DAFK,MAAM,OAAA;;;;WA8BhB;AAwBK,uCAFI,MAAM;;;;WAef;AAuBK,oDAJI,MAAM,GAEL,MAAM,CA0BhB;AAOK,mDAFI,MAAM;;WAyBf;AAgCK,2CAbI,OAAO,GAAC,MAAM,GAWb,MAAM,CAoBhB;AAoBK;;;WA0DL;AAOK,uCAFI,MAAM;;;WAyBf;AA2CD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC"}
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/store/actions.js"],"names":[],"mappings":"AA0EA;;;;;;;GAOG;AACH,gDAFY,MAAM,CAUjB;AAED;;;;;GAKG;AACH;;EAOC;AAED;;;;;;GAMG;AACH,8BAHY,MAAM,CAWjB;AAED;;;;;;GAMG;AACH,uCAFW,MAAM,UAQhB;AAED;;;;;;;GAOG;AACH,wCALW,MAAM,UACN,MAAM,GAEL,MAAM,CAQjB;AA4KD;;;;GAIG;AACH;;EAOC;AAqGD;;;;GAIG;AACH;;EAOC;AAED;;;;;GAKG;AACH,qCAHW,MAAM,GACL,MAAM,CAOjB;AAwBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,yCAxCW,MAAM,GAsCL,MAAM,CAOjB;AAED;;;;;;;;;;;;GA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;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC"}
@@ -7,8 +7,6 @@
7
7
  export declare const EDIT_MERGE_PROPERTIES: Set<string>;
8
8
  /**
9
9
  * Constant for the store module (or reducer) key.
10
- *
11
- * @type {string}
12
10
  */
13
11
  export declare const STORE_NAME = "core/editor";
14
12
  export declare const SAVE_POST_NOTICE_ID = "SAVE_POST_NOTICE_ID";
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/store/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,aAAwB,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,UAAU,gBAAgB,CAAC;AAExC,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AACzD,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAC3D,eAAO,MAAM,wBAAwB,QAA4B,CAAC;AAClE,eAAO,MAAM,gBAAgB,QAAY,CAAC;AAC1C,eAAO,MAAM,mBAAmB,UAAoC,CAAC;AACrE,eAAO,MAAM,mCAAmC,kBAAkB,CAAC;AACnE,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAChD,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAC1D,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAC5C,eAAO,MAAM,oBAAoB,kBAAkB,CAAC;AACpD,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC;AACF,eAAO,MAAM,mBAAmB,UAAwC,CAAC;AACzE,eAAO,MAAM,iBAAiB,UAI7B,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/store/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,aAAwB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,UAAU,gBAAgB,CAAC;AAExC,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AACzD,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAC3D,eAAO,MAAM,wBAAwB,QAA4B,CAAC;AAClE,eAAO,MAAM,gBAAgB,QAAY,CAAC;AAC1C,eAAO,MAAM,mBAAmB,UAAoC,CAAC;AACrE,eAAO,MAAM,mCAAmC,kBAAkB,CAAC;AACnE,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAChD,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAC1D,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAC5C,eAAO,MAAM,oBAAoB,kBAAkB,CAAC;AACpD,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC;AACF,eAAO,MAAM,mBAAmB,UAAwC,CAAC;AACzE,eAAO,MAAM,iBAAiB,UAI7B,CAAC"}
@@ -1,17 +1,15 @@
1
- /**
2
- * Post editor data store configuration.
3
- *
4
- * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore
5
- *
6
- * @type {Object}
7
- */
8
- export const storeConfig: Object;
1
+ export namespace storeConfig {
2
+ export { reducer };
3
+ export { selectors };
4
+ export { actions };
5
+ }
9
6
  /**
10
7
  * Store definition for the editor namespace.
11
8
  *
12
9
  * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
13
- *
14
- * @type {Object}
15
10
  */
16
- export const store: Object;
11
+ export const store: import("@wordpress/data/build-types/types").StoreDescriptor<import("@wordpress/data/build-types/types").ReduxStoreConfig<any, typeof actions, typeof selectors>>;
12
+ import reducer from './reducer';
13
+ import * as selectors from './selectors';
14
+ import * as actions from './actions';
17
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.js"],"names":[],"mappings":"AAgBA;;;;;;GAMG;AACH,0BAFU,MAAM,CAMd;AAEF;;;;;;GAMG;AACH,oBAFU,MAAM,CAIZ"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.js"],"names":[],"mappings":";;;;;AA2BA;;;;GAIG;AACH,qLAEI;oBA1BgB,WAAW;2BACJ,aAAa;yBACf,WAAW"}
@@ -176,7 +176,7 @@ export function listViewToggleRef(state?: Object): Object;
176
176
  */
177
177
  export function inserterSidebarToggleRef(state?: Object): Object;
178
178
  export function publishSidebarActive(state: boolean | undefined, action: any): boolean;
179
- declare const _default: import("redux").Reducer<import("redux").CombinedState<{
179
+ declare const _default: import("redux").Reducer<{
180
180
  postId: any;
181
181
  postType: any;
182
182
  templateId: any;
@@ -195,15 +195,35 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
195
195
  listViewPanel: any;
196
196
  listViewToggleRef: Object;
197
197
  publishSidebarActive: boolean;
198
- dataviews: import("redux").CombinedState<{
198
+ dataviews: {
199
199
  actions: {
200
200
  [x: string]: Record<string, import("@wordpress/dataviews").Action<any>[]> | {
201
201
  [x: string]: import("@wordpress/dataviews").Action<any>[] | (import("@wordpress/dataviews").Action<unknown> | import("@wordpress/dataviews").Action<any>)[];
202
202
  };
203
203
  };
204
204
  isReady: import("../dataviews/store/reducer").ReadyState;
205
- }>;
206
- }>, any>;
205
+ };
206
+ }, any, Partial<{
207
+ postId: null | undefined;
208
+ postType: null | undefined;
209
+ templateId: null | undefined;
210
+ saving: Object | undefined;
211
+ deleting: Object | undefined;
212
+ postLock: PostLockState | undefined;
213
+ template: Object | undefined;
214
+ postSavingLock: PostLockState | undefined;
215
+ editorSettings: Object | undefined;
216
+ postAutosavingLock: PostLockState | undefined;
217
+ renderingMode: string | undefined;
218
+ deviceType: Object | undefined;
219
+ removedPanels: any[] | undefined;
220
+ blockInserterPanel: Object | undefined;
221
+ inserterSidebarToggleRef: Object | undefined;
222
+ listViewPanel: Object | undefined;
223
+ listViewToggleRef: Object | undefined;
224
+ publishSidebarActive: boolean | undefined;
225
+ dataviews: never;
226
+ }>>;
207
227
  export default _default;
208
228
  /**
209
229
  * Post Lock State.
@@ -1 +1 @@
1
- {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/store/reducer.js"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,uCAJW,GAAC,GAEA,GAAC,CAQZ;AAED;;;;;;;;GAQG;AACH,+BALW,MAAM,KACN,MAAM,GAEL,OAAO,CASlB;AAED;;;;;;;;;GASG;AACH,mDALW,MAAM,kBACN,MAAM,GAEL,OAAO,CAOlB;AAED;;;;;;;;;GASG;AACH,6CALW,MAAM,kBACN,MAAM,GAEL,OAAO,CAYlB;AAED,kEAOC;AAED,sEAOC;AAED,oEAOC;AAED;;;;;;;GAOG;AACH,gCALW,MAAM,sBACN,MAAM,GAEL,OAAO,CAYlB;AAED;;;;;;;;GAQG;AACH,8BALW,MAAM,sBACN,MAAM,GAEL,MAAM,CAajB;AAED;;;;;;;GAOG;AACH,gCALW,MAAM,sBACN,MAAM,GAEL,MAAM,CAYjB;AAED;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AACH,gCALW,aAAa,sBACb,MAAM,GAEL,aAAa,CASxB;AAED;;;;;;;;;GASG;AACH,sCALW,aAAa,sBACb,MAAM,GAEL,aAAa,CAcxB;AAED;;;;;;;;;GASG;AACH,0CALW,aAAa,sBACb,MAAM,GAEL,aAAa,CAcxB;AAED;;;;;;;GAOG;AACH,sCALW,MAAM,sBACN,MAAM,GAEL,MAAM,CAYjB;AAED,2EAOC;AAED;;;;;;;GAOG;AACH,kCALW,MAAM,sBACN,MAAM,GAEL,MAAM,CASjB;AAED;;;;;;;GAOG;AACH,gEAJW,MAAM,SAahB;AAED;;;;;;;;GAQG;AACH,0CAHW,MAAM,sBACN,MAAM,OAUhB;AAED;;;;;;;;GAQG;AACH,qCAHW,MAAM,sBACN,MAAM,OAUhB;AAED;;;;;;GAMG;AACH,0CAHW,MAAM,GACL,MAAM,CAIjB;AAED;;;;;;GAMG;AACH,iDAHW,MAAM,GACL,MAAM,CAIjB;AAED,uFAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA9Ma,OAAO;;;;gBACN,OAAO,OAAA;;;;oBACP,OAAO,OAAA;;;;UACP,MAAM,OAAA"}
1
+ {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/store/reducer.js"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,uCAJW,GAAC,GAEA,GAAC,CAQZ;AAED;;;;;;;;GAQG;AACH,+BALW,MAAM,KACN,MAAM,GAEL,OAAO,CASlB;AAED;;;;;;;;;GASG;AACH,mDALW,MAAM,kBACN,MAAM,GAEL,OAAO,CAOlB;AAED;;;;;;;;;GASG;AACH,6CALW,MAAM,kBACN,MAAM,GAEL,OAAO,CAYlB;AAED,kEAOC;AAED,sEAOC;AAED,oEAOC;AAED;;;;;;;GAOG;AACH,gCALW,MAAM,sBACN,MAAM,GAEL,OAAO,CAYlB;AAED;;;;;;;;GAQG;AACH,8BALW,MAAM,sBACN,MAAM,GAEL,MAAM,CAajB;AAED;;;;;;;GAOG;AACH,gCALW,MAAM,sBACN,MAAM,GAEL,MAAM,CAYjB;AAED;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AACH,gCALW,aAAa,sBACb,MAAM,GAEL,aAAa,CASxB;AAED;;;;;;;;;GASG;AACH,sCALW,aAAa,sBACb,MAAM,GAEL,aAAa,CAcxB;AAED;;;;;;;;;GASG;AACH,0CALW,aAAa,sBACb,MAAM,GAEL,aAAa,CAcxB;AAED;;;;;;;GAOG;AACH,sCALW,MAAM,sBACN,MAAM,GAEL,MAAM,CAYjB;AAED,2EAOC;AAED;;;;;;;GAOG;AACH,kCALW,MAAM,sBACN,MAAM,GAEL,MAAM,CASjB;AAED;;;;;;;GAOG;AACH,gEAJW,MAAM,SAahB;AAED;;;;;;;;GAQG;AACH,0CAHW,MAAM,sBACN,MAAM,OAUhB;AAED;;;;;;;;GAQG;AACH,qCAHW,MAAM,sBACN,MAAM,OAUhB;AAED;;;;;;GAMG;AACH,0CAHW,MAAM,GACL,MAAM,CAIjB;AAED;;;;;;GAMG;AACH,iDAHW,MAAM,GACL,MAAM,CAIjB;AAED,uFAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA9Ma,OAAO;;;;gBACN,OAAO,OAAA;;;;oBACP,OAAO,OAAA;;;;UACP,MAAM,OAAA"}
@@ -128,12 +128,12 @@ export function isCurrentPostPending(state: Object): boolean;
128
128
  /**
129
129
  * Return true if the current post has already been published.
130
130
  *
131
- * @param {Object} state Global application state.
132
- * @param {Object?} currentPost Explicit current post for bypassing registry selector.
131
+ * @param {Object} state Global application state.
132
+ * @param {Object} [currentPost] Explicit current post for bypassing registry selector.
133
133
  *
134
134
  * @return {boolean} Whether the post has been published.
135
135
  */
136
- export function isCurrentPostPublished(state: Object, currentPost: Object | null): boolean;
136
+ export function isCurrentPostPublished(state: Object, currentPost?: Object | undefined): boolean;
137
137
  /**
138
138
  * Returns true if post is already scheduled.
139
139
  *
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/store/selectors.js"],"names":[],"mappings":"AAgEA;;;;;;;GAOG;AACH,uCAJW,MAAM,GAEL,OAAO,CAIlB;AAED;;;;;;GAMG;AACH,yCAJW,MAAM,GAEL,OAAO,CAKlB;AA+CD;;;;;;;GAOG;AACH,sCAJW,MAAM,GAEL,OAAO,CAIlB;AAgCD;;;;;;;;;;;GAWG;AACH,0CATW,MAAM,GAOL,MAAM,CAIjB;AAED;;;;;;;GAOG;AACH,wCAJW,MAAM,GAEJ,MAAM,OAAA,CAIlB;AAED;;;;;;GAMG;AACH,4CAJW,MAAM,GAEL,MAAM,OAAC,CAIlB;AAED;;;;;;GAMG;AACH,oDAJW,MAAM,GAEL,MAAM,CAMjB;AAED;;;;;;;GAOG;AACH,oDAJW,MAAM,GAEJ,MAAM,OAAA,CAOlB;AAsBD;;;;;;;GAOG;AACH,+CALW,MAAM,iBACN,MAAM,GAEL,GAAC,CAkBZ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EG;AACH,qCAAuE;AAEvE;;GAEG;AACH,uCAA2E;AAE3E;;GAEG;AACH,6CAEE;AAEF;;GAEG;AACH,8CAEE;AAEF;;GAEG;AACH,yCAA+E;AAE/E;;GAEG;AACH,wCAA6E;AAE7E;;GAEG;AACH,0CACgD;AAEhD;;GAEG;AACH,oCAAqE;AAErE;;GAEG;AACH,gCAA6D;AAE7D;;GAEG;AACH,kDAEE;AAEF;;GAEG;AACH,8CAEE;AAEF;;GAEG;AACH,oDAEE;AAEF;;GAEG;AACH,uCAA2E;AAE3E;;GAEG;AACH,mCAAmE;AAEnE;;GAEG;AACH,uCAA2E;AAE3E;;GAEG;AACH,0CACgD;AAEhD;;GAEG;AACH,wCAA6E;AAE7E;;GAEG;AACH,wCAA6E;AAE7E;;GAEG;AACH,4CAEE;AAaF;;;;;;GAMG;AACH,kHASE;AAEF;;;;;;;GAOG;AACH,wHAcE;AAEF;;;;;;;GAOG;AACH,oHAgCE;AAEF;;;;;;GAMG;AACH,wCAQE;;;;;;;;cAzlBY,MAAM;;;;kBACN,MAAM;;;;;YACN,MAAM"}
1
+ {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/store/selectors.js"],"names":[],"mappings":"AAgEA;;;;;;;GAOG;AACH,uCAJW,MAAM,GAEL,OAAO,CAIlB;AAED;;;;;;GAMG;AACH,yCAJW,MAAM,GAEL,OAAO,CAKlB;AA+CD;;;;;;;GAOG;AACH,sCAJW,MAAM,GAEL,OAAO,CAIlB;AAgCD;;;;;;;;;;;GAWG;AACH,0CATW,MAAM,GAOL,MAAM,CAIjB;AAED;;;;;;;GAOG;AACH,wCAJW,MAAM,GAEJ,MAAM,OAAA,CAIlB;AAED;;;;;;GAMG;AACH,4CAJW,MAAM,GAEL,MAAM,OAAC,CAIlB;AAED;;;;;;GAMG;AACH,oDAJW,MAAM,GAEL,MAAM,CAMjB;AAED;;;;;;;GAOG;AACH,oDAJW,MAAM,GAEJ,MAAM,OAAA,CAOlB;AAsBD;;;;;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EE;AAEF;;GAEG;AACH,qCAAuE;AAEvE;;GAEG;AACH,qCAAuE;AAEvE;;GAEG;AACH,uCAA2E;AAE3E;;GAEG;AACH,6CAEE;AAEF;;GAEG;AACH,8CAEE;AAEF;;GAEG;AACH,yCAA+E;AAE/E;;GAEG;AACH,wCAA6E;AAE7E;;GAEG;AACH,0CACgD;AAEhD;;GAEG;AACH,oCAAqE;AAErE;;GAEG;AACH,gCAA6D;AAE7D;;GAEG;AACH,kDAEE;AAEF;;GAEG;AACH,8CAEE;AAEF;;GAEG;AACH,oDAEE;AAEF;;GAEG;AACH,uCAA2E;AAE3E;;GAEG;AACH,mCAAmE;AAEnE;;GAEG;AACH,uCAA2E;AAE3E;;GAEG;AACH,0CACgD;AAEhD;;GAEG;AACH,wCAA6E;AAE7E;;GAEG;AACH,wCAA6E;AAE7E;;GAEG;AACH,4CAEE;AAaF;;;;;;GAMG;AACH,kHASE;AAEF;;;;;;;GAOG;AACH,wHAcE;AAEF;;;;;;;GAOG;AACH,oHAgCE;AAEF;;;;;;GAMG;AACH,wCAQE;;;;;;;;cAzlBY,MAAM;;;;kBACN,MAAM;;;;;YACN,MAAM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/editor",
3
- "version": "14.11.0",
3
+ "version": "14.12.0",
4
4
  "description": "Enhanced block editor for WordPress posts.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -25,6 +25,8 @@
25
25
  "main": "build/index.js",
26
26
  "module": "build-module/index.js",
27
27
  "react-native": "src/index",
28
+ "wpScript": true,
29
+ "types": "build-types",
28
30
  "sideEffects": [
29
31
  "build-style/**",
30
32
  "src/**/*.scss",
@@ -86,6 +88,5 @@
86
88
  "publishConfig": {
87
89
  "access": "public"
88
90
  },
89
- "wpScript": true,
90
- "gitHead": "dcf4613b33b0eda14e203ac30f700ed0db70347f"
91
+ "gitHead": "510540d99f3d222a96f08d3d7b66c9e7a726f705"
91
92
  }
@@ -35,25 +35,22 @@ export function AddComment( {
35
35
  // State to manage the comment thread.
36
36
  const [ inputComment, setInputComment ] = useState( '' );
37
37
 
38
- const {
39
- defaultAvatar,
40
- clientId,
41
- blockCommentId,
42
- showAddCommentBoard,
43
- currentUser,
44
- } = useSelect( ( select ) => {
45
- const { getSettings } = select( blockEditorStore );
46
- const { __experimentalDiscussionSettings } = getSettings();
47
- const selectedBlock = select( blockEditorStore ).getSelectedBlock();
48
- const userData = select( coreStore ).getCurrentUser();
49
- return {
50
- defaultAvatar: __experimentalDiscussionSettings?.avatarURL,
51
- clientId: selectedBlock?.clientId,
52
- blockCommentId: selectedBlock?.attributes?.blockCommentId,
53
- showAddCommentBoard: showCommentBoard,
54
- currentUser: userData,
55
- };
56
- } );
38
+ const { defaultAvatar, clientId, blockCommentId, currentUser } = useSelect(
39
+ ( select ) => {
40
+ const { getSettings, getSelectedBlock } =
41
+ select( blockEditorStore );
42
+ const { __experimentalDiscussionSettings } = getSettings();
43
+ const selectedBlock = getSelectedBlock();
44
+ const userData = select( coreStore ).getCurrentUser();
45
+ return {
46
+ defaultAvatar: __experimentalDiscussionSettings?.avatarURL,
47
+ clientId: selectedBlock?.clientId,
48
+ blockCommentId: selectedBlock?.attributes?.blockCommentId,
49
+ currentUser: userData,
50
+ };
51
+ },
52
+ []
53
+ );
57
54
 
58
55
  const userAvatar =
59
56
  currentUser && currentUser.avatar_urls && currentUser.avatar_urls[ 48 ]
@@ -69,7 +66,7 @@ export function AddComment( {
69
66
  setInputComment( '' );
70
67
  };
71
68
 
72
- if ( ! showAddCommentBoard || ! clientId || undefined !== blockCommentId ) {
69
+ if ( ! showCommentBoard || ! clientId || undefined !== blockCommentId ) {
73
70
  return null;
74
71
  }
75
72
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
5
  import { useSelect, useDispatch, resolveSelect } from '@wordpress/data';
6
- import { useState, useEffect, useMemo } from '@wordpress/element';
6
+ import { useState, useMemo } from '@wordpress/element';
7
7
  import { comment as commentIcon } from '@wordpress/icons';
8
8
  import { addFilter } from '@wordpress/hooks';
9
9
  import { store as noticesStore } from '@wordpress/notices';
@@ -22,8 +22,6 @@ import { store as editorStore } from '../../store';
22
22
  import AddCommentButton from './comment-button';
23
23
  import AddCommentToolbarButton from './comment-button-toolbar';
24
24
 
25
- const threadsEmptyArray = [];
26
-
27
25
  const isBlockCommentExperimentEnabled =
28
26
  window?.__experimentalEnableBlockComment;
29
27
  const modifyBlockCommentAttributes = ( settings ) => {
@@ -46,59 +44,30 @@ addFilter(
46
44
  modifyBlockCommentAttributes
47
45
  );
48
46
 
49
- /**
50
- * Renders the Collab sidebar.
51
- */
52
- export default function CollabSidebar() {
47
+ function CollabSidebarContent( { showCommentBoard, setShowCommentBoard } ) {
53
48
  const { createNotice } = useDispatch( noticesStore );
54
49
  const { saveEntityRecord, deleteEntityRecord } = useDispatch( coreStore );
55
50
  const { getEntityRecord } = resolveSelect( coreStore );
56
- const { enableComplementaryArea } = useDispatch( interfaceStore );
57
- const [ blockCommentID, setBlockCommentID ] = useState( null );
58
- const [ showCommentBoard, setShowCommentBoard ] = useState( false );
59
- const { postId } = useSelect( ( select ) => {
60
- return {
61
- postId: select( editorStore ).getCurrentPostId(),
62
- };
63
- }, [] );
64
51
 
65
- const postStatus = useSelect( ( select ) => {
66
- const post = select( editorStore ).getCurrentPost();
67
- return { postStatus: post?.status };
68
- }, [] );
69
-
70
- const threads = useSelect(
71
- ( select ) => {
72
- if ( ! postId ) {
73
- return threadsEmptyArray;
74
- }
75
- const { getEntityRecords } = select( coreStore );
76
- const data = getEntityRecords( 'root', 'comment', {
77
- post: postId,
78
- type: 'block_comment',
79
- status: 'any',
80
- per_page: 100,
81
- } );
82
- return data || threadsEmptyArray;
83
- },
84
- [ postId ]
85
- );
52
+ const { postId, threads } = useSelect( ( select ) => {
53
+ const { getCurrentPostId } = select( editorStore );
54
+ const _postId = getCurrentPostId();
55
+ const data = !! _postId
56
+ ? select( coreStore ).getEntityRecords( 'root', 'comment', {
57
+ post: _postId,
58
+ type: 'block_comment',
59
+ status: 'any',
60
+ per_page: 100,
61
+ } )
62
+ : null;
86
63
 
87
- const clientId = useSelect( ( select ) => {
88
- const { getSelectedBlockClientId } = select( blockEditorStore );
89
- return getSelectedBlockClientId();
64
+ return {
65
+ postId: _postId,
66
+ threads: data,
67
+ };
90
68
  }, [] );
91
69
 
92
- const blockDetails = useSelect(
93
- ( select ) => {
94
- return clientId
95
- ? select( blockEditorStore ).getBlock( clientId )
96
- : null;
97
- },
98
- [ clientId ]
99
- );
100
-
101
- // Get the dispatch functions to save the comment and update the block attributes.
70
+ const { getSelectedBlockClientId } = useSelect( blockEditorStore );
102
71
  const { updateBlockAttributes } = useDispatch( blockEditorStore );
103
72
 
104
73
  // Process comments to build the tree structure
@@ -107,7 +76,7 @@ export default function CollabSidebar() {
107
76
  const compare = {};
108
77
  const result = [];
109
78
 
110
- const filteredComments = threads.filter(
79
+ const filteredComments = ( threads ?? [] ).filter(
111
80
  ( comment ) => comment.status !== 'trash'
112
81
  );
113
82
 
@@ -130,11 +99,6 @@ export default function CollabSidebar() {
130
99
  return result;
131
100
  }, [ threads ] );
132
101
 
133
- const openCollabBoard = () => {
134
- setShowCommentBoard( true );
135
- enableComplementaryArea( 'core', 'edit-post/collab-sidebar' );
136
- };
137
-
138
102
  // Function to save the comment.
139
103
  const addNewComment = async ( comment, parentCommentId ) => {
140
104
  const args = {
@@ -159,7 +123,7 @@ export default function CollabSidebar() {
159
123
  if ( savedRecord ) {
160
124
  // If it's a main comment, update the block attributes with the comment id.
161
125
  if ( ! parentCommentId ) {
162
- updateBlockAttributes( clientId, {
126
+ updateBlockAttributes( getSelectedBlockClientId(), {
163
127
  blockCommentId: savedRecord?.id,
164
128
  } );
165
129
  }
@@ -241,7 +205,7 @@ export default function CollabSidebar() {
241
205
  await deleteEntityRecord( 'root', 'comment', commentId );
242
206
 
243
207
  if ( childComment && ! childComment.parent ) {
244
- updateBlockAttributes( clientId, {
208
+ updateBlockAttributes( getSelectedBlockClientId(), {
245
209
  blockCommentId: undefined,
246
210
  } );
247
211
  }
@@ -257,50 +221,77 @@ export default function CollabSidebar() {
257
221
  );
258
222
  };
259
223
 
260
- useEffect( () => {
261
- if ( blockDetails ) {
262
- setBlockCommentID( blockDetails?.attributes.blockCommentId );
263
- }
264
- }, [ postId, clientId ] );
224
+ return (
225
+ <div className="editor-collab-sidebar-panel">
226
+ <AddComment
227
+ onSubmit={ addNewComment }
228
+ showCommentBoard={ showCommentBoard }
229
+ setShowCommentBoard={ setShowCommentBoard }
230
+ />
231
+ <Comments
232
+ threads={ resultComments }
233
+ onEditComment={ onEditComment }
234
+ onAddReply={ addNewComment }
235
+ onCommentDelete={ onCommentDelete }
236
+ onCommentResolve={ onCommentResolve }
237
+ />
238
+ </div>
239
+ );
240
+ }
241
+
242
+ /**
243
+ * Renders the Collab sidebar.
244
+ */
245
+ export default function CollabSidebar() {
246
+ const [ showCommentBoard, setShowCommentBoard ] = useState( false );
247
+ const { enableComplementaryArea } = useDispatch( interfaceStore );
248
+
249
+ const { postStatus } = useSelect( ( select ) => {
250
+ return {
251
+ postStatus:
252
+ select( editorStore ).getEditedPostAttribute( 'status' ),
253
+ };
254
+ }, [] );
255
+
256
+ const { blockCommentId } = useSelect( ( select ) => {
257
+ const { getBlockAttributes, getSelectedBlockClientId } =
258
+ select( blockEditorStore );
259
+ const _clientId = getSelectedBlockClientId();
260
+
261
+ return {
262
+ blockCommentId: _clientId
263
+ ? getBlockAttributes( _clientId )?.blockCommentId
264
+ : null,
265
+ };
266
+ }, [] );
267
+
268
+ const openCollabBoard = () => {
269
+ setShowCommentBoard( true );
270
+ enableComplementaryArea( 'core', 'edit-post/collab-sidebar' );
271
+ };
265
272
 
266
273
  // Check if the experimental flag is enabled.
267
- if (
268
- ! isBlockCommentExperimentEnabled ||
269
- postStatus.postStatus === 'publish'
270
- ) {
274
+ if ( ! isBlockCommentExperimentEnabled || postStatus === 'publish' ) {
271
275
  return null; // or maybe return some message indicating no threads are available.
272
276
  }
273
277
 
278
+ const AddCommentComponent = blockCommentId
279
+ ? AddCommentToolbarButton
280
+ : AddCommentButton;
281
+
274
282
  return (
275
283
  <>
276
- { ! blockCommentID && (
277
- <AddCommentButton onClick={ openCollabBoard } />
278
- ) }
279
-
280
- { blockCommentID > 0 && (
281
- <AddCommentToolbarButton onClick={ openCollabBoard } />
282
- ) }
284
+ <AddCommentComponent onClick={ openCollabBoard } />
283
285
  <PluginSidebar
284
286
  identifier={ collabSidebarName }
285
287
  // translators: Comments sidebar title
286
288
  title={ __( 'Comments' ) }
287
289
  icon={ commentIcon }
288
290
  >
289
- <div className="editor-collab-sidebar-panel">
290
- <AddComment
291
- threads={ resultComments }
292
- onSubmit={ addNewComment }
293
- showCommentBoard={ showCommentBoard }
294
- setShowCommentBoard={ setShowCommentBoard }
295
- />
296
- <Comments
297
- threads={ resultComments }
298
- onEditComment={ onEditComment }
299
- onAddReply={ addNewComment }
300
- onCommentDelete={ onCommentDelete }
301
- onCommentResolve={ onCommentResolve }
302
- />
303
- </div>
291
+ <CollabSidebarContent
292
+ showCommentBoard={ showCommentBoard }
293
+ setShowCommentBoard={ setShowCommentBoard }
294
+ />
304
295
  </PluginSidebar>
305
296
  </>
306
297
  );