@wordpress/editor 14.41.0 → 14.41.2-next.v.202603161435.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 (326) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/components/collab-sidebar/index.cjs +7 -4
  3. package/build/components/collab-sidebar/index.cjs.map +2 -2
  4. package/build/components/collab-sidebar/utils.cjs +13 -15
  5. package/build/components/collab-sidebar/utils.cjs.map +2 -2
  6. package/build/components/collaborators-overlay/avatar-iframe-styles.cjs +141 -0
  7. package/build/components/collaborators-overlay/avatar-iframe-styles.cjs.map +7 -0
  8. package/build/components/collaborators-overlay/collaborator-styles.cjs +38 -2
  9. package/build/components/collaborators-overlay/collaborator-styles.cjs.map +2 -2
  10. package/build/components/collaborators-overlay/compute-selection.cjs +181 -0
  11. package/build/components/collaborators-overlay/compute-selection.cjs.map +7 -0
  12. package/build/components/collaborators-overlay/cursor-dom-utils.cjs +243 -0
  13. package/build/components/collaborators-overlay/cursor-dom-utils.cjs.map +7 -0
  14. package/build/components/collaborators-overlay/overlay-iframe-styles.cjs +148 -0
  15. package/build/components/collaborators-overlay/overlay-iframe-styles.cjs.map +7 -0
  16. package/build/components/collaborators-overlay/overlay.cjs +100 -229
  17. package/build/components/collaborators-overlay/overlay.cjs.map +3 -3
  18. package/build/components/collaborators-overlay/use-block-highlighting.cjs +90 -42
  19. package/build/components/collaborators-overlay/use-block-highlighting.cjs.map +2 -2
  20. package/build/components/collaborators-overlay/use-debounced-recompute.cjs +49 -0
  21. package/build/components/collaborators-overlay/use-debounced-recompute.cjs.map +7 -0
  22. package/build/components/collaborators-overlay/use-render-cursors.cjs +80 -171
  23. package/build/components/collaborators-overlay/use-render-cursors.cjs.map +3 -3
  24. package/build/components/collaborators-presence/avatar/component.cjs +121 -0
  25. package/build/components/collaborators-presence/avatar/component.cjs.map +7 -0
  26. package/build/components/collaborators-presence/avatar/index.cjs +37 -0
  27. package/build/components/collaborators-presence/avatar/index.cjs.map +7 -0
  28. package/build/components/collaborators-presence/avatar/types.cjs +19 -0
  29. package/build/components/collaborators-presence/avatar/types.cjs.map +7 -0
  30. package/build/components/collaborators-presence/avatar/use-image-loading-status.cjs +44 -0
  31. package/build/components/collaborators-presence/avatar/use-image-loading-status.cjs.map +7 -0
  32. package/build/components/collaborators-presence/avatar-group/component.cjs +78 -0
  33. package/build/components/collaborators-presence/avatar-group/component.cjs.map +7 -0
  34. package/build/components/collaborators-presence/avatar-group/index.cjs +37 -0
  35. package/build/components/collaborators-presence/avatar-group/index.cjs.map +7 -0
  36. package/build/components/collaborators-presence/avatar-group/types.cjs +19 -0
  37. package/build/components/collaborators-presence/avatar-group/types.cjs.map +7 -0
  38. package/build/components/collaborators-presence/index.cjs +54 -17
  39. package/build/components/collaborators-presence/index.cjs.map +3 -3
  40. package/build/components/collaborators-presence/list.cjs +43 -37
  41. package/build/components/collaborators-presence/list.cjs.map +3 -3
  42. package/build/components/collaborators-presence/use-collaborator-notifications.cjs +79 -107
  43. package/build/components/collaborators-presence/use-collaborator-notifications.cjs.map +3 -3
  44. package/build/components/editor-interface/index.cjs +9 -6
  45. package/build/components/editor-interface/index.cjs.map +2 -2
  46. package/build/components/entities-saved-states/hooks/use-is-dirty.cjs +14 -5
  47. package/build/components/entities-saved-states/hooks/use-is-dirty.cjs.map +2 -2
  48. package/build/components/global-styles/index.cjs +15 -24
  49. package/build/components/global-styles/index.cjs.map +3 -3
  50. package/build/components/global-styles-sidebar/index.cjs +6 -3
  51. package/build/components/global-styles-sidebar/index.cjs.map +2 -2
  52. package/build/components/inserter-sidebar/index.cjs +2 -1
  53. package/build/components/inserter-sidebar/index.cjs.map +2 -2
  54. package/build/components/page-attributes/parent.cjs +2 -1
  55. package/build/components/page-attributes/parent.cjs.map +2 -2
  56. package/build/components/post-revisions-preview/revisions-canvas.cjs +8 -58
  57. package/build/components/post-revisions-preview/revisions-canvas.cjs.map +3 -3
  58. package/build/components/post-revisions-preview/revisions-slider.cjs +5 -1
  59. package/build/components/post-revisions-preview/revisions-slider.cjs.map +2 -2
  60. package/build/components/post-url/panel.cjs +1 -0
  61. package/build/components/post-url/panel.cjs.map +2 -2
  62. package/build/components/preferences-modal/index.cjs +24 -0
  63. package/build/components/preferences-modal/index.cjs.map +2 -2
  64. package/build/components/provider/disable-non-page-content-blocks.cjs +31 -28
  65. package/build/components/provider/disable-non-page-content-blocks.cjs.map +3 -3
  66. package/build/components/provider/index.cjs +17 -5
  67. package/build/components/provider/index.cjs.map +2 -2
  68. package/build/components/provider/use-block-editor-settings.cjs +21 -6
  69. package/build/components/provider/use-block-editor-settings.cjs.map +3 -3
  70. package/build/components/provider/{use-post-content-blocks.cjs → use-post-content-block-types.cjs} +8 -19
  71. package/build/components/provider/use-post-content-block-types.cjs.map +7 -0
  72. package/build/components/provider/use-revision-blocks.cjs +106 -0
  73. package/build/components/provider/use-revision-blocks.cjs.map +7 -0
  74. package/build/components/sidebar/dataform-post-summary.cjs +182 -0
  75. package/build/components/sidebar/dataform-post-summary.cjs.map +7 -0
  76. package/build/components/sidebar/header.cjs +1 -1
  77. package/build/components/sidebar/header.cjs.map +2 -2
  78. package/build/components/sidebar/post-summary.cjs +11 -0
  79. package/build/components/sidebar/post-summary.cjs.map +3 -3
  80. package/build/components/sync-connection-modal/index.cjs +8 -5
  81. package/build/components/sync-connection-modal/index.cjs.map +2 -2
  82. package/build/components/template-content-panel/index.cjs +35 -31
  83. package/build/components/template-content-panel/index.cjs.map +3 -3
  84. package/build/components/visual-editor/index.cjs +1 -1
  85. package/build/components/visual-editor/index.cjs.map +2 -2
  86. package/build/dataviews/store/private-actions.cjs +4 -0
  87. package/build/dataviews/store/private-actions.cjs.map +2 -2
  88. package/build/store/private-actions.cjs +11 -2
  89. package/build/store/private-actions.cjs.map +2 -2
  90. package/build/store/private-selectors.cjs +52 -13
  91. package/build/store/private-selectors.cjs.map +2 -2
  92. package/build/store/reducer.cjs +12 -0
  93. package/build/store/reducer.cjs.map +2 -2
  94. package/build/utils/media-upload/on-success.cjs +46 -0
  95. package/build/utils/media-upload/on-success.cjs.map +7 -0
  96. package/build-module/components/collab-sidebar/index.mjs +7 -4
  97. package/build-module/components/collab-sidebar/index.mjs.map +2 -2
  98. package/build-module/components/collab-sidebar/utils.mjs +13 -15
  99. package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
  100. package/build-module/components/collaborators-overlay/avatar-iframe-styles.mjs +128 -0
  101. package/build-module/components/collaborators-overlay/avatar-iframe-styles.mjs.map +7 -0
  102. package/build-module/components/collaborators-overlay/collaborator-styles.mjs +25 -1
  103. package/build-module/components/collaborators-overlay/collaborator-styles.mjs.map +2 -2
  104. package/build-module/components/collaborators-overlay/compute-selection.mjs +162 -0
  105. package/build-module/components/collaborators-overlay/compute-selection.mjs.map +7 -0
  106. package/build-module/components/collaborators-overlay/cursor-dom-utils.mjs +213 -0
  107. package/build-module/components/collaborators-overlay/cursor-dom-utils.mjs.map +7 -0
  108. package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs +130 -0
  109. package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs.map +7 -0
  110. package/build-module/components/collaborators-overlay/overlay.mjs +91 -230
  111. package/build-module/components/collaborators-overlay/overlay.mjs.map +2 -2
  112. package/build-module/components/collaborators-overlay/use-block-highlighting.mjs +91 -43
  113. package/build-module/components/collaborators-overlay/use-block-highlighting.mjs.map +2 -2
  114. package/build-module/components/collaborators-overlay/use-debounced-recompute.mjs +24 -0
  115. package/build-module/components/collaborators-overlay/use-debounced-recompute.mjs.map +7 -0
  116. package/build-module/components/collaborators-overlay/use-render-cursors.mjs +81 -172
  117. package/build-module/components/collaborators-overlay/use-render-cursors.mjs.map +2 -2
  118. package/build-module/components/collaborators-presence/avatar/component.mjs +90 -0
  119. package/build-module/components/collaborators-presence/avatar/component.mjs.map +7 -0
  120. package/build-module/components/collaborators-presence/avatar/index.mjs +6 -0
  121. package/build-module/components/collaborators-presence/avatar/index.mjs.map +7 -0
  122. package/build-module/components/collaborators-presence/avatar/types.mjs +1 -0
  123. package/build-module/components/collaborators-presence/avatar/types.mjs.map +7 -0
  124. package/build-module/components/collaborators-presence/avatar/use-image-loading-status.mjs +19 -0
  125. package/build-module/components/collaborators-presence/avatar/use-image-loading-status.mjs.map +7 -0
  126. package/build-module/components/collaborators-presence/avatar-group/component.mjs +47 -0
  127. package/build-module/components/collaborators-presence/avatar-group/component.mjs.map +7 -0
  128. package/build-module/components/collaborators-presence/avatar-group/index.mjs +6 -0
  129. package/build-module/components/collaborators-presence/avatar-group/index.mjs.map +7 -0
  130. package/build-module/components/collaborators-presence/avatar-group/types.mjs +1 -0
  131. package/build-module/components/collaborators-presence/avatar-group/types.mjs.map +7 -0
  132. package/build-module/components/collaborators-presence/index.mjs +45 -21
  133. package/build-module/components/collaborators-presence/index.mjs.map +2 -2
  134. package/build-module/components/collaborators-presence/list.mjs +35 -43
  135. package/build-module/components/collaborators-presence/list.mjs.map +2 -2
  136. package/build-module/components/collaborators-presence/use-collaborator-notifications.mjs +80 -108
  137. package/build-module/components/collaborators-presence/use-collaborator-notifications.mjs.map +2 -2
  138. package/build-module/components/editor-interface/index.mjs +10 -7
  139. package/build-module/components/editor-interface/index.mjs.map +2 -2
  140. package/build-module/components/entities-saved-states/hooks/use-is-dirty.mjs +14 -5
  141. package/build-module/components/entities-saved-states/hooks/use-is-dirty.mjs.map +2 -2
  142. package/build-module/components/global-styles/index.mjs +15 -24
  143. package/build-module/components/global-styles/index.mjs.map +2 -2
  144. package/build-module/components/global-styles-sidebar/index.mjs +6 -3
  145. package/build-module/components/global-styles-sidebar/index.mjs.map +2 -2
  146. package/build-module/components/inserter-sidebar/index.mjs +2 -1
  147. package/build-module/components/inserter-sidebar/index.mjs.map +2 -2
  148. package/build-module/components/page-attributes/parent.mjs +2 -1
  149. package/build-module/components/page-attributes/parent.mjs.map +2 -2
  150. package/build-module/components/post-revisions-preview/revisions-canvas.mjs +10 -63
  151. package/build-module/components/post-revisions-preview/revisions-canvas.mjs.map +2 -2
  152. package/build-module/components/post-revisions-preview/revisions-slider.mjs +5 -1
  153. package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
  154. package/build-module/components/post-url/panel.mjs +1 -0
  155. package/build-module/components/post-url/panel.mjs.map +2 -2
  156. package/build-module/components/preferences-modal/index.mjs +24 -0
  157. package/build-module/components/preferences-modal/index.mjs.map +2 -2
  158. package/build-module/components/provider/disable-non-page-content-blocks.mjs +31 -28
  159. package/build-module/components/provider/disable-non-page-content-blocks.mjs.map +2 -2
  160. package/build-module/components/provider/index.mjs +17 -5
  161. package/build-module/components/provider/index.mjs.map +2 -2
  162. package/build-module/components/provider/use-block-editor-settings.mjs +21 -6
  163. package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
  164. package/build-module/components/provider/use-post-content-block-types.mjs +23 -0
  165. package/build-module/components/provider/use-post-content-block-types.mjs.map +7 -0
  166. package/build-module/components/provider/use-revision-blocks.mjs +81 -0
  167. package/build-module/components/provider/use-revision-blocks.mjs.map +7 -0
  168. package/build-module/components/sidebar/dataform-post-summary.mjs +151 -0
  169. package/build-module/components/sidebar/dataform-post-summary.mjs.map +7 -0
  170. package/build-module/components/sidebar/header.mjs +1 -1
  171. package/build-module/components/sidebar/header.mjs.map +2 -2
  172. package/build-module/components/sidebar/post-summary.mjs +11 -0
  173. package/build-module/components/sidebar/post-summary.mjs.map +2 -2
  174. package/build-module/components/sync-connection-modal/index.mjs +8 -5
  175. package/build-module/components/sync-connection-modal/index.mjs.map +2 -2
  176. package/build-module/components/template-content-panel/index.mjs +25 -31
  177. package/build-module/components/template-content-panel/index.mjs.map +2 -2
  178. package/build-module/components/visual-editor/index.mjs +1 -1
  179. package/build-module/components/visual-editor/index.mjs.map +2 -2
  180. package/build-module/dataviews/store/private-actions.mjs +8 -1
  181. package/build-module/dataviews/store/private-actions.mjs.map +2 -2
  182. package/build-module/store/private-actions.mjs +10 -2
  183. package/build-module/store/private-actions.mjs.map +2 -2
  184. package/build-module/store/private-selectors.mjs +50 -12
  185. package/build-module/store/private-selectors.mjs.map +2 -2
  186. package/build-module/store/reducer.mjs +11 -0
  187. package/build-module/store/reducer.mjs.map +2 -2
  188. package/build-module/utils/media-upload/on-success.mjs +25 -0
  189. package/build-module/utils/media-upload/on-success.mjs.map +7 -0
  190. package/build-style/style-rtl.css +961 -159
  191. package/build-style/style.css +961 -159
  192. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  193. package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
  194. package/build-types/components/collaborators-overlay/avatar-iframe-styles.d.ts +11 -0
  195. package/build-types/components/collaborators-overlay/avatar-iframe-styles.d.ts.map +1 -0
  196. package/build-types/components/collaborators-overlay/collaborator-styles.d.ts +17 -2
  197. package/build-types/components/collaborators-overlay/collaborator-styles.d.ts.map +1 -1
  198. package/build-types/components/collaborators-overlay/compute-selection.d.ts +24 -0
  199. package/build-types/components/collaborators-overlay/compute-selection.d.ts.map +1 -0
  200. package/build-types/components/collaborators-overlay/cursor-dom-utils.d.ts +72 -0
  201. package/build-types/components/collaborators-overlay/cursor-dom-utils.d.ts.map +1 -0
  202. package/build-types/components/collaborators-overlay/overlay-iframe-styles.d.ts +6 -0
  203. package/build-types/components/collaborators-overlay/overlay-iframe-styles.d.ts.map +1 -0
  204. package/build-types/components/collaborators-overlay/overlay.d.ts.map +1 -1
  205. package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts +21 -5
  206. package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts.map +1 -1
  207. package/build-types/components/collaborators-overlay/use-debounced-recompute.d.ts +10 -0
  208. package/build-types/components/collaborators-overlay/use-debounced-recompute.d.ts.map +1 -0
  209. package/build-types/components/collaborators-overlay/use-render-cursors.d.ts +6 -1
  210. package/build-types/components/collaborators-overlay/use-render-cursors.d.ts.map +1 -1
  211. package/build-types/components/collaborators-presence/avatar/component.d.ts +7 -0
  212. package/build-types/components/collaborators-presence/avatar/component.d.ts.map +1 -0
  213. package/build-types/components/collaborators-presence/avatar/index.d.ts +3 -0
  214. package/build-types/components/collaborators-presence/avatar/index.d.ts.map +1 -0
  215. package/build-types/components/collaborators-presence/avatar/types.d.ts +66 -0
  216. package/build-types/components/collaborators-presence/avatar/types.d.ts.map +1 -0
  217. package/build-types/components/collaborators-presence/avatar/use-image-loading-status.d.ts +17 -0
  218. package/build-types/components/collaborators-presence/avatar/use-image-loading-status.d.ts.map +1 -0
  219. package/build-types/components/collaborators-presence/avatar-group/component.d.ts +7 -0
  220. package/build-types/components/collaborators-presence/avatar-group/component.d.ts.map +1 -0
  221. package/build-types/components/collaborators-presence/avatar-group/index.d.ts +3 -0
  222. package/build-types/components/collaborators-presence/avatar-group/index.d.ts.map +1 -0
  223. package/build-types/components/collaborators-presence/avatar-group/types.d.ts +14 -0
  224. package/build-types/components/collaborators-presence/avatar-group/types.d.ts.map +1 -0
  225. package/build-types/components/collaborators-presence/index.d.ts.map +1 -1
  226. package/build-types/components/collaborators-presence/list.d.ts +2 -1
  227. package/build-types/components/collaborators-presence/list.d.ts.map +1 -1
  228. package/build-types/components/collaborators-presence/use-collaborator-notifications.d.ts.map +1 -1
  229. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  230. package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts.map +1 -1
  231. package/build-types/components/global-styles/index.d.ts +2 -1
  232. package/build-types/components/global-styles/index.d.ts.map +1 -1
  233. package/build-types/components/global-styles-sidebar/index.d.ts.map +1 -1
  234. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
  235. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  236. package/build-types/components/post-author/hook.d.ts +1 -1
  237. package/build-types/components/post-revisions-preview/revisions-canvas.d.ts +2 -5
  238. package/build-types/components/post-revisions-preview/revisions-canvas.d.ts.map +1 -1
  239. package/build-types/components/post-revisions-preview/revisions-slider.d.ts.map +1 -1
  240. package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
  241. package/build-types/components/provider/index.d.ts.map +1 -1
  242. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  243. package/build-types/components/provider/use-post-content-block-types.d.ts +9 -0
  244. package/build-types/components/provider/use-post-content-block-types.d.ts.map +1 -0
  245. package/build-types/components/provider/use-revision-blocks.d.ts +10 -0
  246. package/build-types/components/provider/use-revision-blocks.d.ts.map +1 -0
  247. package/build-types/components/sidebar/dataform-post-summary.d.ts +4 -0
  248. package/build-types/components/sidebar/dataform-post-summary.d.ts.map +1 -0
  249. package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
  250. package/build-types/components/sync-connection-modal/index.d.ts.map +1 -1
  251. package/build-types/components/template-content-panel/index.d.ts.map +1 -1
  252. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  253. package/build-types/store/private-actions.d.ts +7 -0
  254. package/build-types/store/private-actions.d.ts.map +1 -1
  255. package/build-types/store/private-selectors.d.ts +7 -0
  256. package/build-types/store/private-selectors.d.ts.map +1 -1
  257. package/build-types/store/reducer.d.ts +14 -3
  258. package/build-types/store/reducer.d.ts.map +1 -1
  259. package/build-types/utils/media-upload/on-success.d.ts +9 -0
  260. package/build-types/utils/media-upload/on-success.d.ts.map +1 -0
  261. package/package.json +45 -44
  262. package/src/components/collab-sidebar/index.js +7 -4
  263. package/src/components/collab-sidebar/utils.js +9 -10
  264. package/src/components/collaborators-overlay/avatar-iframe-styles.ts +134 -0
  265. package/src/components/collaborators-overlay/collaborator-styles.ts +43 -2
  266. package/src/components/collaborators-overlay/compute-selection.ts +307 -0
  267. package/src/components/collaborators-overlay/cursor-dom-utils.ts +382 -0
  268. package/src/components/collaborators-overlay/overlay-iframe-styles.ts +131 -0
  269. package/src/components/collaborators-overlay/overlay.tsx +86 -226
  270. package/src/components/collaborators-overlay/use-block-highlighting.ts +147 -63
  271. package/src/components/collaborators-overlay/use-debounced-recompute.ts +32 -0
  272. package/src/components/collaborators-overlay/use-render-cursors.ts +113 -279
  273. package/src/components/collaborators-presence/avatar/component.tsx +123 -0
  274. package/src/components/collaborators-presence/avatar/index.ts +2 -0
  275. package/src/components/collaborators-presence/avatar/styles.scss +184 -0
  276. package/src/components/collaborators-presence/avatar/test/index.tsx +389 -0
  277. package/src/components/collaborators-presence/avatar/types.ts +66 -0
  278. package/src/components/collaborators-presence/avatar/use-image-loading-status.ts +36 -0
  279. package/src/components/collaborators-presence/avatar-group/component.tsx +55 -0
  280. package/src/components/collaborators-presence/avatar-group/index.ts +2 -0
  281. package/src/components/collaborators-presence/avatar-group/styles.scss +33 -0
  282. package/src/components/collaborators-presence/avatar-group/test/index.tsx +139 -0
  283. package/src/components/collaborators-presence/avatar-group/types.ts +13 -0
  284. package/src/components/collaborators-presence/index.tsx +34 -11
  285. package/src/components/collaborators-presence/list.tsx +44 -40
  286. package/src/components/collaborators-presence/styles/collaborators-list.scss +26 -19
  287. package/src/components/collaborators-presence/styles/collaborators-presence.scss +6 -2
  288. package/src/components/collaborators-presence/test/use-collaborator-notifications.ts +188 -246
  289. package/src/components/collaborators-presence/use-collaborator-notifications.ts +109 -166
  290. package/src/components/document-bar/style.scss +1 -1
  291. package/src/components/editor-interface/index.js +8 -6
  292. package/src/components/entities-saved-states/hooks/use-is-dirty.js +14 -5
  293. package/src/components/global-styles/index.js +20 -27
  294. package/src/components/global-styles-sidebar/index.js +3 -0
  295. package/src/components/inserter-sidebar/index.js +4 -1
  296. package/src/components/page-attributes/parent.js +2 -1
  297. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
  298. package/src/components/post-revisions-preview/revisions-canvas.js +15 -84
  299. package/src/components/post-revisions-preview/revisions-slider.js +6 -1
  300. package/src/components/post-url/panel.js +1 -0
  301. package/src/components/post-url/style.scss +5 -0
  302. package/src/components/preferences-modal/index.js +18 -0
  303. package/src/components/provider/disable-non-page-content-blocks.js +42 -40
  304. package/src/components/provider/index.js +20 -2
  305. package/src/components/provider/use-block-editor-settings.js +24 -8
  306. package/src/components/provider/use-post-content-block-types.js +30 -0
  307. package/src/components/provider/use-revision-blocks.js +105 -0
  308. package/src/components/sidebar/dataform-post-summary.js +170 -0
  309. package/src/components/sidebar/header.js +1 -1
  310. package/src/components/sidebar/post-summary.js +15 -0
  311. package/src/components/sync-connection-modal/index.js +12 -6
  312. package/src/components/sync-connection-modal/style.scss +5 -0
  313. package/src/components/template-content-panel/index.js +30 -38
  314. package/src/components/visual-editor/index.js +1 -1
  315. package/src/dataviews/store/private-actions.ts +14 -0
  316. package/src/store/private-actions.js +21 -2
  317. package/src/store/private-selectors.js +75 -10
  318. package/src/store/reducer.js +19 -0
  319. package/src/style.scss +3 -0
  320. package/src/utils/media-upload/on-success.js +34 -0
  321. package/build/components/provider/use-post-content-blocks.cjs.map +0 -7
  322. package/build-module/components/provider/use-post-content-blocks.mjs +0 -34
  323. package/build-module/components/provider/use-post-content-blocks.mjs.map +0 -7
  324. package/build-types/components/provider/use-post-content-blocks.d.ts +0 -2
  325. package/build-types/components/provider/use-post-content-blocks.d.ts.map +0 -1
  326. package/src/components/provider/use-post-content-blocks.js +0 -42
@@ -0,0 +1,243 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/editor/src/components/collaborators-overlay/cursor-dom-utils.ts
21
+ var cursor_dom_utils_exports = {};
22
+ __export(cursor_dom_utils_exports, {
23
+ findInnerBlockOffset: () => findInnerBlockOffset,
24
+ getBlocksBetween: () => getBlocksBetween,
25
+ getCursorPosition: () => getCursorPosition,
26
+ getFullBlockSelectionRects: () => getFullBlockSelectionRects,
27
+ getSelectionRects: () => getSelectionRects,
28
+ isNodeBefore: () => isNodeBefore
29
+ });
30
+ module.exports = __toCommonJS(cursor_dom_utils_exports);
31
+ var MAX_NODE_OFFSET_COUNT = 500;
32
+ var getCursorPosition = (absolutePositionIndex, blockElement, editorDocument, overlayRect) => {
33
+ if (absolutePositionIndex === null || !blockElement) {
34
+ return null;
35
+ }
36
+ return getOffsetPositionInBlock(
37
+ blockElement,
38
+ absolutePositionIndex,
39
+ editorDocument,
40
+ overlayRect
41
+ ) ?? null;
42
+ };
43
+ var getOffsetPositionInBlock = (blockElement, charOffset, editorDocument, overlayRect) => {
44
+ const { node, offset } = findInnerBlockOffset(
45
+ blockElement,
46
+ charOffset,
47
+ editorDocument
48
+ );
49
+ const cursorRange = editorDocument.createRange();
50
+ try {
51
+ cursorRange.setStart(node, offset);
52
+ } catch (error) {
53
+ return null;
54
+ }
55
+ cursorRange.collapse(true);
56
+ const cursorRect = cursorRange.getBoundingClientRect();
57
+ const blockRect = blockElement.getBoundingClientRect();
58
+ let cursorX = 0;
59
+ let cursorY = 0;
60
+ if (cursorRect.x === 0 && cursorRect.y === 0 && cursorRect.width === 0 && cursorRect.height === 0) {
61
+ cursorX = blockRect.left - overlayRect.left;
62
+ cursorY = blockRect.top - overlayRect.top;
63
+ } else {
64
+ cursorX = cursorRect.left - overlayRect.left;
65
+ cursorY = cursorRect.top - overlayRect.top;
66
+ }
67
+ let cursorHeight = cursorRect.height;
68
+ if (cursorHeight === 0) {
69
+ const view = editorDocument.defaultView ?? window;
70
+ cursorHeight = parseInt(view.getComputedStyle(blockElement).lineHeight, 10) || blockRect.height;
71
+ }
72
+ return {
73
+ x: cursorX,
74
+ y: cursorY,
75
+ height: cursorHeight
76
+ };
77
+ };
78
+ var getSelectionRects = (blockElement, startOffset, endOffset, editorDocument, overlayRect) => {
79
+ let normalizedStart = startOffset;
80
+ let normalizedEnd = endOffset;
81
+ if (normalizedStart > normalizedEnd) {
82
+ [normalizedStart, normalizedEnd] = [normalizedEnd, normalizedStart];
83
+ }
84
+ const startPos = findInnerBlockOffset(
85
+ blockElement,
86
+ normalizedStart,
87
+ editorDocument
88
+ );
89
+ const endPos = findInnerBlockOffset(
90
+ blockElement,
91
+ normalizedEnd,
92
+ editorDocument
93
+ );
94
+ const range = editorDocument.createRange();
95
+ try {
96
+ range.setStart(startPos.node, startPos.offset);
97
+ range.setEnd(endPos.node, endPos.offset);
98
+ } catch {
99
+ return null;
100
+ }
101
+ const clientRects = range.getClientRects();
102
+ const rects = [];
103
+ for (const rect of clientRects) {
104
+ if (rect.width === 0 && rect.height === 0) {
105
+ continue;
106
+ }
107
+ const x = rect.left - overlayRect.left;
108
+ const y = rect.top - overlayRect.top;
109
+ const isDuplicate = rects.some(
110
+ (r) => r.x === x && r.y === y && r.width === rect.width && r.height === rect.height
111
+ );
112
+ if (isDuplicate) {
113
+ continue;
114
+ }
115
+ rects.push({
116
+ x,
117
+ y,
118
+ width: rect.width,
119
+ height: rect.height
120
+ });
121
+ }
122
+ return rects.length > 0 ? rects : null;
123
+ };
124
+ var getFullBlockSelectionRects = (blockElement, editorDocument, overlayRect) => {
125
+ const range = editorDocument.createRange();
126
+ range.selectNodeContents(blockElement);
127
+ const clientRects = range.getClientRects();
128
+ const rects = [];
129
+ for (const rect of clientRects) {
130
+ if (rect.width === 0 && rect.height === 0) {
131
+ continue;
132
+ }
133
+ rects.push({
134
+ x: rect.left - overlayRect.left,
135
+ y: rect.top - overlayRect.top,
136
+ width: rect.width,
137
+ height: rect.height
138
+ });
139
+ }
140
+ if (rects.length === 0) {
141
+ const blockRect = blockElement.getBoundingClientRect();
142
+ if (blockRect.width > 0 && blockRect.height > 0) {
143
+ rects.push({
144
+ x: blockRect.left - overlayRect.left,
145
+ y: blockRect.top - overlayRect.top,
146
+ width: blockRect.width,
147
+ height: blockRect.height
148
+ });
149
+ }
150
+ }
151
+ return rects;
152
+ };
153
+ var getBlocksBetween = (startBlockId, endBlockId, editorDocument) => {
154
+ const allBlocks = editorDocument.querySelectorAll("[data-block]");
155
+ let startIndex = -1;
156
+ let endIndex = -1;
157
+ for (let i = 0; i < allBlocks.length; i++) {
158
+ const blockId = allBlocks[i].getAttribute("data-block");
159
+ if (blockId === startBlockId) {
160
+ startIndex = i;
161
+ }
162
+ if (blockId === endBlockId) {
163
+ endIndex = i;
164
+ }
165
+ }
166
+ if (startIndex === -1 || endIndex === -1) {
167
+ return [];
168
+ }
169
+ if (startIndex > endIndex) {
170
+ [startIndex, endIndex] = [endIndex, startIndex];
171
+ }
172
+ const result = [];
173
+ for (let i = startIndex + 1; i < endIndex; i++) {
174
+ result.push(allBlocks[i]);
175
+ }
176
+ return result;
177
+ };
178
+ var findInnerBlockOffset = (blockElement, offset, editorDocument) => {
179
+ const treeWalker = editorDocument.createTreeWalker(
180
+ blockElement,
181
+ NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT
182
+ // eslint-disable-line no-bitwise
183
+ );
184
+ let currentOffset = 0;
185
+ let lastTextNode = null;
186
+ let node = null;
187
+ let nodeCount = 1;
188
+ while (node = treeWalker.nextNode()) {
189
+ nodeCount++;
190
+ if (nodeCount > MAX_NODE_OFFSET_COUNT) {
191
+ if (lastTextNode) {
192
+ return { node: lastTextNode, offset: 0 };
193
+ }
194
+ return { node: blockElement, offset: 0 };
195
+ }
196
+ const nodeLength = node.nodeValue?.length ?? 0;
197
+ if (node.nodeType === Node.ELEMENT_NODE) {
198
+ if (node.nodeName === "BR") {
199
+ if (currentOffset + 1 >= offset) {
200
+ const nodeAfterBr = treeWalker.nextNode();
201
+ if (nodeAfterBr?.nodeType === Node.TEXT_NODE) {
202
+ return { node: nodeAfterBr, offset: 0 };
203
+ } else if (lastTextNode) {
204
+ return {
205
+ node: lastTextNode,
206
+ offset: lastTextNode.nodeValue?.length ?? 0
207
+ };
208
+ }
209
+ return { node: blockElement, offset: 0 };
210
+ }
211
+ currentOffset += 1;
212
+ continue;
213
+ } else {
214
+ continue;
215
+ }
216
+ }
217
+ if (nodeLength === 0) {
218
+ continue;
219
+ }
220
+ if (currentOffset + nodeLength >= offset) {
221
+ return { node, offset: offset - currentOffset };
222
+ }
223
+ currentOffset += nodeLength;
224
+ if (node.nodeType === Node.TEXT_NODE) {
225
+ lastTextNode = node;
226
+ }
227
+ }
228
+ if (lastTextNode && lastTextNode.nodeValue?.length) {
229
+ return { node: lastTextNode, offset: lastTextNode.nodeValue.length };
230
+ }
231
+ return { node: blockElement, offset: 0 };
232
+ };
233
+ var isNodeBefore = (a, b) => a.compareDocumentPosition(b) === Node.DOCUMENT_POSITION_FOLLOWING;
234
+ // Annotate the CommonJS export names for ESM import in node:
235
+ 0 && (module.exports = {
236
+ findInnerBlockOffset,
237
+ getBlocksBetween,
238
+ getCursorPosition,
239
+ getFullBlockSelectionRects,
240
+ getSelectionRects,
241
+ isNodeBefore
242
+ });
243
+ //# sourceMappingURL=cursor-dom-utils.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/collaborators-overlay/cursor-dom-utils.ts"],
4
+ "sourcesContent": ["export interface SelectionRect {\n\tx: number;\n\ty: number;\n\twidth: number;\n\theight: number;\n}\n\nexport interface CursorCoords {\n\tx: number;\n\ty: number;\n\theight: number;\n}\n\nconst MAX_NODE_OFFSET_COUNT = 500;\n\n/**\n * Given a selection, returns the coordinates of the cursor in the block.\n *\n * @param absolutePositionIndex - The absolute position index\n * @param blockElement - The block element (or null if deleted)\n * @param editorDocument - The editor document\n * @param overlayRect - Pre-computed bounding rect of the overlay element\n * @return The position of the cursor\n */\nexport const getCursorPosition = (\n\tabsolutePositionIndex: number | null,\n\tblockElement: HTMLElement | null,\n\teditorDocument: Document,\n\toverlayRect: DOMRect\n): CursorCoords | null => {\n\tif ( absolutePositionIndex === null || ! blockElement ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\tgetOffsetPositionInBlock(\n\t\t\tblockElement,\n\t\t\tabsolutePositionIndex,\n\t\t\teditorDocument,\n\t\t\toverlayRect\n\t\t) ?? null\n\t);\n};\n\n/**\n * Given a block element and a character offset, returns the coordinates for drawing a visual cursor in the block.\n *\n * @param blockElement - The block element\n * @param charOffset - The character offset\n * @param editorDocument - The editor document\n * @param overlayRect - Pre-computed bounding rect of the overlay element\n * @return The position of the cursor\n */\nconst getOffsetPositionInBlock = (\n\tblockElement: HTMLElement,\n\tcharOffset: number,\n\teditorDocument: Document,\n\toverlayRect: DOMRect\n) => {\n\tconst { node, offset } = findInnerBlockOffset(\n\t\tblockElement,\n\t\tcharOffset,\n\t\teditorDocument\n\t);\n\n\tconst cursorRange = editorDocument.createRange();\n\n\ttry {\n\t\tcursorRange.setStart( node, offset );\n\t} catch ( error ) {\n\t\treturn null;\n\t}\n\n\t// Ensure the range only represents single point in the DOM.\n\tcursorRange.collapse( true );\n\n\tconst cursorRect = cursorRange.getBoundingClientRect();\n\tconst blockRect = blockElement.getBoundingClientRect();\n\n\tlet cursorX = 0;\n\tlet cursorY = 0;\n\n\tif (\n\t\tcursorRect.x === 0 &&\n\t\tcursorRect.y === 0 &&\n\t\tcursorRect.width === 0 &&\n\t\tcursorRect.height === 0\n\t) {\n\t\t// This can happen for empty blocks.\n\t\tcursorX = blockRect.left - overlayRect.left;\n\t\tcursorY = blockRect.top - overlayRect.top;\n\t} else {\n\t\tcursorX = cursorRect.left - overlayRect.left;\n\t\tcursorY = cursorRect.top - overlayRect.top;\n\t}\n\n\tlet cursorHeight = cursorRect.height;\n\tif ( cursorHeight === 0 ) {\n\t\tconst view = editorDocument.defaultView ?? window;\n\t\tcursorHeight =\n\t\t\tparseInt( view.getComputedStyle( blockElement ).lineHeight, 10 ) ||\n\t\t\tblockRect.height;\n\t}\n\n\treturn {\n\t\tx: cursorX,\n\t\ty: cursorY,\n\t\theight: cursorHeight,\n\t};\n};\n\n/**\n * Computes selection highlight rectangles for a text range within a single block.\n *\n * @param blockElement - The block element\n * @param startOffset - Start character offset within the block\n * @param endOffset - End character offset within the block\n * @param editorDocument - The editor document\n * @param overlayRect - Pre-computed bounding rect of the overlay element\n * @return Array of selection rectangles relative to the overlay, or null on failure\n */\nexport const getSelectionRects = (\n\tblockElement: HTMLElement,\n\tstartOffset: number,\n\tendOffset: number,\n\teditorDocument: Document,\n\toverlayRect: DOMRect\n): SelectionRect[] | null => {\n\t// Normalize direction.\n\tlet normalizedStart = startOffset;\n\tlet normalizedEnd = endOffset;\n\tif ( normalizedStart > normalizedEnd ) {\n\t\t[ normalizedStart, normalizedEnd ] = [ normalizedEnd, normalizedStart ];\n\t}\n\n\tconst startPos = findInnerBlockOffset(\n\t\tblockElement,\n\t\tnormalizedStart,\n\t\teditorDocument\n\t);\n\tconst endPos = findInnerBlockOffset(\n\t\tblockElement,\n\t\tnormalizedEnd,\n\t\teditorDocument\n\t);\n\n\tconst range = editorDocument.createRange();\n\ttry {\n\t\trange.setStart( startPos.node, startPos.offset );\n\t\trange.setEnd( endPos.node, endPos.offset );\n\t} catch {\n\t\treturn null;\n\t}\n\n\tconst clientRects = range.getClientRects();\n\tconst rects: SelectionRect[] = [];\n\n\tfor ( const rect of clientRects ) {\n\t\tif ( rect.width === 0 && rect.height === 0 ) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst x = rect.left - overlayRect.left;\n\t\tconst y = rect.top - overlayRect.top;\n\n\t\t// Range.getClientRects() can return duplicate rects at inline\n\t\t// formatting boundaries (e.g. <em>, <strong>). Skip exact matches.\n\t\tconst isDuplicate = rects.some(\n\t\t\t( r ) =>\n\t\t\t\tr.x === x &&\n\t\t\t\tr.y === y &&\n\t\t\t\tr.width === rect.width &&\n\t\t\t\tr.height === rect.height\n\t\t);\n\t\tif ( isDuplicate ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\trects.push( {\n\t\t\tx,\n\t\t\ty,\n\t\t\twidth: rect.width,\n\t\t\theight: rect.height,\n\t\t} );\n\t}\n\n\treturn rects.length > 0 ? rects : null;\n};\n\n/**\n * Computes selection highlight rectangles for the full content of a block.\n * Used for intermediate blocks in a multi-block selection.\n *\n * @param blockElement - The block element\n * @param editorDocument - The editor document\n * @param overlayRect - Pre-computed bounding rect of the overlay element\n * @return Array of selection rectangles relative to the overlay\n */\nexport const getFullBlockSelectionRects = (\n\tblockElement: HTMLElement,\n\teditorDocument: Document,\n\toverlayRect: DOMRect\n): SelectionRect[] => {\n\tconst range = editorDocument.createRange();\n\trange.selectNodeContents( blockElement );\n\tconst clientRects = range.getClientRects();\n\tconst rects: SelectionRect[] = [];\n\n\tfor ( const rect of clientRects ) {\n\t\tif ( rect.width === 0 && rect.height === 0 ) {\n\t\t\tcontinue;\n\t\t}\n\t\trects.push( {\n\t\t\tx: rect.left - overlayRect.left,\n\t\t\ty: rect.top - overlayRect.top,\n\t\t\twidth: rect.width,\n\t\t\theight: rect.height,\n\t\t} );\n\t}\n\n\t// Fallback: if getClientRects returned nothing, use the block's bounding rect.\n\tif ( rects.length === 0 ) {\n\t\tconst blockRect = blockElement.getBoundingClientRect();\n\t\tif ( blockRect.width > 0 && blockRect.height > 0 ) {\n\t\t\trects.push( {\n\t\t\t\tx: blockRect.left - overlayRect.left,\n\t\t\t\ty: blockRect.top - overlayRect.top,\n\t\t\t\twidth: blockRect.width,\n\t\t\t\theight: blockRect.height,\n\t\t\t} );\n\t\t}\n\t}\n\n\treturn rects;\n};\n\n/**\n * Finds all block elements between two blocks in DOM order (exclusive of start and end).\n *\n * @param startBlockId - The clientId of the start block\n * @param endBlockId - The clientId of the end block\n * @param editorDocument - The editor document\n * @return Array of intermediate block HTMLElements in document order\n */\nexport const getBlocksBetween = (\n\tstartBlockId: string,\n\tendBlockId: string,\n\teditorDocument: Document\n): HTMLElement[] => {\n\tconst allBlocks =\n\t\teditorDocument.querySelectorAll< HTMLElement >( '[data-block]' );\n\n\tlet startIndex = -1;\n\tlet endIndex = -1;\n\n\tfor ( let i = 0; i < allBlocks.length; i++ ) {\n\t\tconst blockId = allBlocks[ i ].getAttribute( 'data-block' );\n\t\tif ( blockId === startBlockId ) {\n\t\t\tstartIndex = i;\n\t\t}\n\t\tif ( blockId === endBlockId ) {\n\t\t\tendIndex = i;\n\t\t}\n\t}\n\n\tif ( startIndex === -1 || endIndex === -1 ) {\n\t\treturn [];\n\t}\n\n\t// Normalize order.\n\tif ( startIndex > endIndex ) {\n\t\t[ startIndex, endIndex ] = [ endIndex, startIndex ];\n\t}\n\n\tconst result: HTMLElement[] = [];\n\tfor ( let i = startIndex + 1; i < endIndex; i++ ) {\n\t\tresult.push( allBlocks[ i ] );\n\t}\n\treturn result;\n};\n\n/**\n * Given a block element and a character offset, returns an exact inner node and offset for use in a range.\n *\n * @param blockElement - The block element\n * @param offset - The character offset\n * @param editorDocument - The editor document\n * @return The node and offset of the character at the offset\n */\nexport const findInnerBlockOffset = (\n\tblockElement: HTMLElement,\n\toffset: number,\n\teditorDocument: Document\n) => {\n\tconst treeWalker = editorDocument.createTreeWalker(\n\t\tblockElement,\n\t\tNodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT // eslint-disable-line no-bitwise\n\t);\n\n\tlet currentOffset = 0;\n\tlet lastTextNode: Node | null = null;\n\n\tlet node: Node | null = null;\n\tlet nodeCount = 1;\n\n\twhile ( ( node = treeWalker.nextNode() ) ) {\n\t\tnodeCount++;\n\n\t\tif ( nodeCount > MAX_NODE_OFFSET_COUNT ) {\n\t\t\t// If we've walked too many nodes, return the last text node or the beginning of the block.\n\t\t\tif ( lastTextNode ) {\n\t\t\t\treturn { node: lastTextNode, offset: 0 };\n\t\t\t}\n\t\t\treturn { node: blockElement, offset: 0 };\n\t\t}\n\n\t\tconst nodeLength = node.nodeValue?.length ?? 0;\n\n\t\tif ( node.nodeType === Node.ELEMENT_NODE ) {\n\t\t\tif ( node.nodeName === 'BR' ) {\n\t\t\t\t// Treat <br> as a single \"\\n\" character.\n\n\t\t\t\tif ( currentOffset + 1 >= offset ) {\n\t\t\t\t\t// If the <br> occurs right on the target offset, return the next text node.\n\t\t\t\t\tconst nodeAfterBr = treeWalker.nextNode();\n\n\t\t\t\t\tif ( nodeAfterBr?.nodeType === Node.TEXT_NODE ) {\n\t\t\t\t\t\treturn { node: nodeAfterBr, offset: 0 };\n\t\t\t\t\t} else if ( lastTextNode ) {\n\t\t\t\t\t\t// If there's no text node after the <br>, return the end offset of the last text node.\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tnode: lastTextNode,\n\t\t\t\t\t\t\toffset: lastTextNode.nodeValue?.length ?? 0,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\t// Just in case, if there's no last text node, return the beginning of the block.\n\t\t\t\t\treturn { node: blockElement, offset: 0 };\n\t\t\t\t}\n\n\t\t\t\t// The <br> is before the target offset. Count it as a single character.\n\t\t\t\tcurrentOffset += 1;\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t// Skip other element types.\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif ( nodeLength === 0 ) {\n\t\t\t// Skip empty nodes.\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( currentOffset + nodeLength >= offset ) {\n\t\t\t// This node exceeds the target offset. Return the node and the position of the offset within it.\n\t\t\treturn { node, offset: offset - currentOffset };\n\t\t}\n\n\t\tcurrentOffset += nodeLength;\n\n\t\tif ( node.nodeType === Node.TEXT_NODE ) {\n\t\t\tlastTextNode = node;\n\t\t}\n\t}\n\n\tif ( lastTextNode && lastTextNode.nodeValue?.length ) {\n\t\t// We didn't reach the target offset. Return the last text node's last character.\n\t\treturn { node: lastTextNode, offset: lastTextNode.nodeValue.length };\n\t}\n\n\t// We didn't find any text nodes. Return the beginning of the block.\n\treturn { node: blockElement, offset: 0 };\n};\n\n/**\n * Check if node `a` precedes node `b` in document order.\n *\n * @param a - First node.\n * @param b - Second node.\n * @return True if `a` comes before `b`.\n */\nexport const isNodeBefore = ( a: Node, b: Node ): boolean =>\n\ta.compareDocumentPosition( b ) === Node.DOCUMENT_POSITION_FOLLOWING;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,IAAM,wBAAwB;AAWvB,IAAM,oBAAoB,CAChC,uBACA,cACA,gBACA,gBACyB;AACzB,MAAK,0BAA0B,QAAQ,CAAE,cAAe;AACvD,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,KAAK;AAEP;AAWA,IAAM,2BAA2B,CAChC,cACA,YACA,gBACA,gBACI;AACJ,QAAM,EAAE,MAAM,OAAO,IAAI;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,QAAM,cAAc,eAAe,YAAY;AAE/C,MAAI;AACH,gBAAY,SAAU,MAAM,MAAO;AAAA,EACpC,SAAU,OAAQ;AACjB,WAAO;AAAA,EACR;AAGA,cAAY,SAAU,IAAK;AAE3B,QAAM,aAAa,YAAY,sBAAsB;AACrD,QAAM,YAAY,aAAa,sBAAsB;AAErD,MAAI,UAAU;AACd,MAAI,UAAU;AAEd,MACC,WAAW,MAAM,KACjB,WAAW,MAAM,KACjB,WAAW,UAAU,KACrB,WAAW,WAAW,GACrB;AAED,cAAU,UAAU,OAAO,YAAY;AACvC,cAAU,UAAU,MAAM,YAAY;AAAA,EACvC,OAAO;AACN,cAAU,WAAW,OAAO,YAAY;AACxC,cAAU,WAAW,MAAM,YAAY;AAAA,EACxC;AAEA,MAAI,eAAe,WAAW;AAC9B,MAAK,iBAAiB,GAAI;AACzB,UAAM,OAAO,eAAe,eAAe;AAC3C,mBACC,SAAU,KAAK,iBAAkB,YAAa,EAAE,YAAY,EAAG,KAC/D,UAAU;AAAA,EACZ;AAEA,SAAO;AAAA,IACN,GAAG;A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AAM,eAAe,CAAE,GAAS,MACtC,EAAE,wBAAyB,CAAE,MAAM,KAAK;",
6
+ "names": []
7
+ }
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/editor/src/components/collaborators-overlay/overlay-iframe-styles.ts
21
+ var overlay_iframe_styles_exports = {};
22
+ __export(overlay_iframe_styles_exports, {
23
+ OVERLAY_IFRAME_STYLES: () => OVERLAY_IFRAME_STYLES
24
+ });
25
+ module.exports = __toCommonJS(overlay_iframe_styles_exports);
26
+ var import_collaborator_styles = require("./collaborator-styles.cjs");
27
+ var OVERLAY_IFRAME_STYLES = `
28
+ .block-canvas-cover {
29
+ position: absolute;
30
+ top: 0;
31
+ left: 0;
32
+ width: 100%;
33
+ height: 100%;
34
+ pointer-events: none;
35
+ z-index: 20000;
36
+ }
37
+ .block-canvas-cover .collaborators-overlay-full {
38
+ position: absolute;
39
+ top: 0;
40
+ left: 0;
41
+ width: 100%;
42
+ height: 100%;
43
+ }
44
+ .block-canvas-cover .collaborators-overlay-fixed {
45
+ position: fixed;
46
+ width: 100%;
47
+ height: 100%;
48
+ }
49
+ .collaborators-overlay-user {
50
+ position: absolute;
51
+ }
52
+ /* Cursor lines render below avatar labels across all users. The parent
53
+ .collaborators-overlay-user has no z-index so it does not create a
54
+ stacking context \u2014 children participate in the shared overlay context. */
55
+ .collaborators-overlay-user-cursor {
56
+ position: absolute;
57
+ z-index: 0;
58
+ width: ${import_collaborator_styles.BORDER_WIDTH_FOCUS_FALLBACK};
59
+ border-radius: ${import_collaborator_styles.BORDER_WIDTH};
60
+ outline: ${import_collaborator_styles.BORDER_WIDTH} solid ${import_collaborator_styles.WHITE};
61
+ box-shadow: ${import_collaborator_styles.ELEVATION_X_SMALL};
62
+ animation: collaborators-overlay-cursor-blink 1s infinite;
63
+ }
64
+ .collaborators-overlay-selection-rect {
65
+ position: absolute;
66
+ opacity: 0.15;
67
+ pointer-events: none;
68
+ border-radius: 2px;
69
+ }
70
+
71
+ /* Overlay-specific positioning applied to the Avatar cursor label. */
72
+ .collaborators-overlay-user-label.editor-avatar {
73
+ position: absolute;
74
+ z-index: 1;
75
+ transform: translate(-11px, -100%);
76
+ margin-top: -${import_collaborator_styles.GRID_UNIT_05};
77
+ pointer-events: auto;
78
+ overflow: visible;
79
+ width: max-content;
80
+ }
81
+ /* Avatar positioned above a highlighted block as a label. */
82
+ .collaborators-overlay-block-label.editor-avatar {
83
+ position: absolute;
84
+ z-index: 1;
85
+ transform: translateY(calc(-100% - ${import_collaborator_styles.GRID_UNIT_10}));
86
+ pointer-events: auto;
87
+ overflow: visible;
88
+ width: max-content;
89
+ }
90
+
91
+ @keyframes collaborators-overlay-cursor-blink {
92
+ 0%, 45% { opacity: 1; }
93
+ 55%, 95% { opacity: 0; }
94
+ 100% { opacity: 1; }
95
+ }
96
+ .collaborators-overlay-cursor-highlighted .collaborators-overlay-user-cursor {
97
+ animation: collaborators-overlay-cursor-highlight 0.6s ease-in-out 3;
98
+ }
99
+ .collaborators-overlay-cursor-highlighted .collaborators-overlay-user-label {
100
+ animation: collaborators-overlay-label-highlight 0.6s ease-in-out 3;
101
+ }
102
+ @keyframes collaborators-overlay-cursor-highlight {
103
+ 0%, 100% {
104
+ transform: scale(1);
105
+ filter: drop-shadow(0 0 0 transparent);
106
+ }
107
+ 50% {
108
+ transform: scale(1.2);
109
+ filter: drop-shadow(0 0 8px currentColor);
110
+ }
111
+ }
112
+ @keyframes collaborators-overlay-label-highlight {
113
+ 0%, 100% {
114
+ transform: translate(-11px, -100%) scale(1);
115
+ filter: drop-shadow(0 0 0 transparent);
116
+ }
117
+ 50% {
118
+ transform: translate(-11px, -100%) scale(1.1);
119
+ filter: drop-shadow(0 0 6px currentColor);
120
+ }
121
+ }
122
+ .block-editor-block-list__block.is-collaborator-selected:not(:focus)::after {
123
+ content: "";
124
+ position: absolute;
125
+ pointer-events: none;
126
+ top: 0;
127
+ right: 0;
128
+ bottom: 0;
129
+ left: 0;
130
+ outline-color: var(--collaborator-outline-color);
131
+ outline-style: solid;
132
+ outline-width: calc(var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
133
+ outline-offset: calc(-1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
134
+ box-shadow: inset 0 0 0 calc(var(--wp-admin-border-width-focus, ${import_collaborator_styles.BORDER_WIDTH_FOCUS_FALLBACK}) + ${import_collaborator_styles.BORDER_WIDTH}) ${import_collaborator_styles.WHITE}, 0 0 0 ${import_collaborator_styles.BORDER_WIDTH} ${import_collaborator_styles.WHITE}, ${import_collaborator_styles.ELEVATION_X_SMALL};
135
+ z-index: 1;
136
+ }
137
+ @media (prefers-reduced-motion: reduce) {
138
+ .collaborators-overlay-user-label,
139
+ .collaborators-overlay-user-cursor {
140
+ animation: none;
141
+ }
142
+ }
143
+ `;
144
+ // Annotate the CommonJS export names for ESM import in node:
145
+ 0 && (module.exports = {
146
+ OVERLAY_IFRAME_STYLES
147
+ });
148
+ //# sourceMappingURL=overlay-iframe-styles.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/collaborators-overlay/overlay-iframe-styles.ts"],
4
+ "sourcesContent": ["/**\n * CSS for the collaborators overlay \u2014 cursor indicators, block highlights,\n * and positioning of Avatar labels inside the editor canvas iframe.\n */\n\nimport {\n\tBORDER_WIDTH,\n\tBORDER_WIDTH_FOCUS_FALLBACK,\n\tELEVATION_X_SMALL,\n\tGRID_UNIT_05,\n\tGRID_UNIT_10,\n\tWHITE,\n} from './collaborator-styles';\n\nexport const OVERLAY_IFRAME_STYLES = `\n.block-canvas-cover {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n\tpointer-events: none;\n\tz-index: 20000;\n}\n.block-canvas-cover .collaborators-overlay-full {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n}\n.block-canvas-cover .collaborators-overlay-fixed {\n\tposition: fixed;\n\twidth: 100%;\n\theight: 100%;\n}\n.collaborators-overlay-user {\n\tposition: absolute;\n}\n/* Cursor lines render below avatar labels across all users. The parent\n .collaborators-overlay-user has no z-index so it does not create a\n stacking context \u2014 children participate in the shared overlay context. */\n.collaborators-overlay-user-cursor {\n\tposition: absolute;\n\tz-index: 0;\n\twidth: ${ BORDER_WIDTH_FOCUS_FALLBACK };\n\tborder-radius: ${ BORDER_WIDTH };\n\toutline: ${ BORDER_WIDTH } solid ${ WHITE };\n\tbox-shadow: ${ ELEVATION_X_SMALL };\n\tanimation: collaborators-overlay-cursor-blink 1s infinite;\n}\n.collaborators-overlay-selection-rect {\n\tposition: absolute;\n\topacity: 0.15;\n\tpointer-events: none;\n\tborder-radius: 2px;\n}\n\n/* Overlay-specific positioning applied to the Avatar cursor label. */\n.collaborators-overlay-user-label.editor-avatar {\n\tposition: absolute;\n\tz-index: 1;\n\ttransform: translate(-11px, -100%);\n\tmargin-top: -${ GRID_UNIT_05 };\n\tpointer-events: auto;\n\toverflow: visible;\n\twidth: max-content;\n}\n/* Avatar positioned above a highlighted block as a label. */\n.collaborators-overlay-block-label.editor-avatar {\n\tposition: absolute;\n\tz-index: 1;\n\ttransform: translateY(calc(-100% - ${ GRID_UNIT_10 }));\n\tpointer-events: auto;\n\toverflow: visible;\n\twidth: max-content;\n}\n\n@keyframes collaborators-overlay-cursor-blink {\n\t0%, 45% { opacity: 1; }\n\t55%, 95% { opacity: 0; }\n\t100% { opacity: 1; }\n}\n.collaborators-overlay-cursor-highlighted .collaborators-overlay-user-cursor {\n\tanimation: collaborators-overlay-cursor-highlight 0.6s ease-in-out 3;\n}\n.collaborators-overlay-cursor-highlighted .collaborators-overlay-user-label {\n\tanimation: collaborators-overlay-label-highlight 0.6s ease-in-out 3;\n}\n@keyframes collaborators-overlay-cursor-highlight {\n\t0%, 100% {\n\t\ttransform: scale(1);\n\t\tfilter: drop-shadow(0 0 0 transparent);\n\t}\n\t50% {\n\t\ttransform: scale(1.2);\n\t\tfilter: drop-shadow(0 0 8px currentColor);\n\t}\n}\n@keyframes collaborators-overlay-label-highlight {\n\t0%, 100% {\n\t\ttransform: translate(-11px, -100%) scale(1);\n\t\tfilter: drop-shadow(0 0 0 transparent);\n\t}\n\t50% {\n\t\ttransform: translate(-11px, -100%) scale(1.1);\n\t\tfilter: drop-shadow(0 0 6px currentColor);\n\t}\n}\n.block-editor-block-list__block.is-collaborator-selected:not(:focus)::after {\n\tcontent: \"\";\n\tposition: absolute;\n\tpointer-events: none;\n\ttop: 0;\n\tright: 0;\n\tbottom: 0;\n\tleft: 0;\n\toutline-color: var(--collaborator-outline-color);\n\toutline-style: solid;\n\toutline-width: calc(var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));\n\toutline-offset: calc(-1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));\n\tbox-shadow: inset 0 0 0 calc(var(--wp-admin-border-width-focus, ${ BORDER_WIDTH_FOCUS_FALLBACK }) + ${ BORDER_WIDTH }) ${ WHITE }, 0 0 0 ${ BORDER_WIDTH } ${ WHITE }, ${ ELEVATION_X_SMALL };\n\tz-index: 1;\n}\n@media (prefers-reduced-motion: reduce) {\n\t.collaborators-overlay-user-label,\n\t.collaborators-overlay-user-cursor {\n\t\tanimation: none;\n\t}\n}\n`;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,iCAOO;AAEA,IAAM,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UA+B1B,sDAA4B;AAAA,kBACpB,uCAAa;AAAA,YACnB,uCAAa,UAAW,gCAAM;AAAA,eAC3B,4CAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAejB,uCAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sCASS,uCAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mEAiDgB,sDAA4B,OAAQ,uCAAa,KAAM,gCAAM,WAAY,uCAAa,IAAK,gCAAM,KAAM,4CAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
+ "names": []
7
+ }