@formicoidea/labre-core 0.43.1 → 0.45.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 (263) hide show
  1. package/dist/_pkgs/affine-block-attachment/utils.js +4 -0
  2. package/dist/_pkgs/affine-block-bookmark/configs/toolbar.js +17 -4
  3. package/dist/_pkgs/affine-block-callout/commands/turn-into-callout.d.ts +29 -0
  4. package/dist/_pkgs/affine-block-callout/commands/turn-into-callout.js +81 -0
  5. package/dist/_pkgs/affine-block-callout/configs/slash-menu.js +6 -4
  6. package/dist/_pkgs/affine-block-callout/configs/turn-into.d.ts +8 -0
  7. package/dist/_pkgs/affine-block-callout/configs/turn-into.js +19 -0
  8. package/dist/_pkgs/affine-block-callout/translations.d.ts +4 -2
  9. package/dist/_pkgs/affine-block-callout/translations.js +4 -2
  10. package/dist/_pkgs/affine-block-callout/view.js +3 -0
  11. package/dist/_pkgs/affine-block-code/code-block-service.d.ts +13 -0
  12. package/dist/_pkgs/affine-block-code/code-block-service.js +26 -0
  13. package/dist/_pkgs/affine-block-code/code-block.d.ts +6 -0
  14. package/dist/_pkgs/affine-block-code/code-block.js +11 -2
  15. package/dist/_pkgs/affine-block-code/code-toolbar/components/lang-button.js +31 -8
  16. package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/config.d.ts +11 -0
  17. package/dist/_pkgs/affine-block-edgeless-text/svg-painter.d.ts +20 -0
  18. package/dist/_pkgs/affine-block-edgeless-text/svg-painter.js +76 -0
  19. package/dist/_pkgs/affine-block-edgeless-text/view.js +2 -0
  20. package/dist/_pkgs/affine-block-embed/configs/toolbar.js +11 -2
  21. package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.js +11 -2
  22. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-edgeless-linked-doc-block.js +3 -1
  23. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/configs/toolbar.js +7 -2
  24. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-edgeless-synced-doc-block.js +3 -1
  25. package/dist/_pkgs/affine-block-frame/frame-manager.d.ts +5 -0
  26. package/dist/_pkgs/affine-block-frame/frame-manager.js +48 -17
  27. package/dist/_pkgs/affine-block-frame/frame-tool.js +3 -1
  28. package/dist/_pkgs/affine-block-image/utils.js +4 -1
  29. package/dist/_pkgs/affine-block-latex/adapters/markdown/preprocessor.d.ts +8 -0
  30. package/dist/_pkgs/affine-block-latex/adapters/markdown/preprocessor.js +9 -5
  31. package/dist/_pkgs/affine-block-note/translations.d.ts +0 -1
  32. package/dist/_pkgs/affine-block-note/translations.js +0 -5
  33. package/dist/_pkgs/affine-block-root/configs/toolbar.js +17 -1
  34. package/dist/_pkgs/affine-block-root/edgeless/clipboard/clipboard.js +2 -1
  35. package/dist/_pkgs/affine-block-root/edgeless/clipboard/command.js +161 -83
  36. package/dist/_pkgs/affine-block-root/edgeless/clipboard/paste-order.d.ts +21 -0
  37. package/dist/_pkgs/affine-block-root/edgeless/clipboard/paste-order.js +85 -0
  38. package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.d.ts +6 -0
  39. package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.js +18 -1
  40. package/dist/_pkgs/affine-block-root/edgeless/utils/clone-utils.d.ts +9 -0
  41. package/dist/_pkgs/affine-block-root/edgeless/utils/clone-utils.js +28 -0
  42. package/dist/_pkgs/affine-block-root/keyboard/commands.js +9 -6
  43. package/dist/_pkgs/affine-block-root/preview/edgeless-root-preview-block.js +15 -2
  44. package/dist/_pkgs/affine-block-surface/adapters/markdown/element-adapter/type.d.ts +1 -1
  45. package/dist/_pkgs/affine-block-surface/element-model/index.d.ts +1 -1
  46. package/dist/_pkgs/affine-block-surface/element-model/index.js +1 -1
  47. package/dist/_pkgs/affine-block-surface/extensions/audit.js +13 -61
  48. package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/commands.d.ts +2 -0
  49. package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/commands.js +71 -0
  50. package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/index.d.ts +1 -0
  51. package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/index.js +1 -0
  52. package/dist/_pkgs/affine-block-surface/extensions/clipboard-config.js +4 -0
  53. package/dist/_pkgs/affine-block-surface/extensions/crud-extension.js +4 -0
  54. package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.d.ts +12 -0
  55. package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.js +27 -7
  56. package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.d.ts +2 -1
  57. package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.js +22 -3
  58. package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.d.ts +6 -3
  59. package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.js +4 -2
  60. package/dist/_pkgs/affine-block-surface/extensions/export-svg/parts.d.ts +63 -0
  61. package/dist/_pkgs/affine-block-surface/extensions/export-svg/parts.js +67 -0
  62. package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.d.ts +62 -5
  63. package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.js +98 -18
  64. package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.d.ts +14 -0
  65. package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.js +82 -1
  66. package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.d.ts +2 -2
  67. package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.js +112 -10
  68. package/dist/_pkgs/affine-block-surface/extensions/export-svg/translations.d.ts +13 -0
  69. package/dist/_pkgs/affine-block-surface/extensions/export-svg/translations.js +33 -0
  70. package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +3 -0
  71. package/dist/_pkgs/affine-block-surface/extensions/index.js +3 -0
  72. package/dist/_pkgs/affine-block-surface/extensions/reading-widget.d.ts +13 -6
  73. package/dist/_pkgs/affine-block-surface/extensions/reading-widget.js +26 -10
  74. package/dist/_pkgs/affine-block-surface/extensions/reading.d.ts +82 -6
  75. package/dist/_pkgs/affine-block-surface/extensions/reading.js +99 -21
  76. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/actions.d.ts +80 -0
  77. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/actions.js +248 -0
  78. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/commands.d.ts +82 -0
  79. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/commands.js +342 -0
  80. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/index.d.ts +3 -0
  81. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/index.js +3 -0
  82. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/tree.d.ts +137 -0
  83. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/tree.js +323 -0
  84. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.d.ts +112 -4
  85. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +86 -15
  86. package/dist/_pkgs/affine-block-surface/extensions/user-layers/actions.d.ts +76 -0
  87. package/dist/_pkgs/affine-block-surface/extensions/user-layers/actions.js +299 -0
  88. package/dist/_pkgs/affine-block-surface/extensions/user-layers/active-layer.d.ts +20 -0
  89. package/dist/_pkgs/affine-block-surface/extensions/user-layers/active-layer.js +34 -0
  90. package/dist/_pkgs/affine-block-surface/extensions/user-layers/commands.d.ts +67 -0
  91. package/dist/_pkgs/affine-block-surface/extensions/user-layers/commands.js +172 -0
  92. package/dist/_pkgs/affine-block-surface/extensions/user-layers/creation.d.ts +40 -0
  93. package/dist/_pkgs/affine-block-surface/extensions/user-layers/creation.js +69 -0
  94. package/dist/_pkgs/affine-block-surface/extensions/user-layers/index.d.ts +5 -0
  95. package/dist/_pkgs/affine-block-surface/extensions/user-layers/index.js +5 -0
  96. package/dist/_pkgs/affine-block-surface/extensions/user-layers/translations.d.ts +10 -0
  97. package/dist/_pkgs/affine-block-surface/extensions/user-layers/translations.js +14 -0
  98. package/dist/_pkgs/affine-block-surface/framework-background/facts.d.ts +55 -2
  99. package/dist/_pkgs/affine-block-surface/framework-background/facts.js +63 -1
  100. package/dist/_pkgs/affine-block-surface/framework-background/stacking.d.ts +16 -8
  101. package/dist/_pkgs/affine-block-surface/framework-background/stacking.js +26 -14
  102. package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.js +17 -3
  103. package/dist/_pkgs/affine-block-surface/renderer/dom-renderer.d.ts +3 -1
  104. package/dist/_pkgs/affine-block-surface/renderer/dom-renderer.js +22 -2
  105. package/dist/_pkgs/affine-block-surface/renderer/paint-predicate.d.ts +30 -0
  106. package/dist/_pkgs/affine-block-surface/renderer/paint-predicate.js +29 -0
  107. package/dist/_pkgs/affine-block-surface/surface-block.js +6 -0
  108. package/dist/_pkgs/affine-block-surface/surface-model.js +5 -0
  109. package/dist/_pkgs/affine-block-surface/surface-transformer.js +5 -0
  110. package/dist/_pkgs/affine-block-surface/tool/default-tool.js +28 -5
  111. package/dist/_pkgs/affine-block-surface/view.js +23 -1
  112. package/dist/_pkgs/affine-block-surface-ref/surface-ref-block.js +12 -2
  113. package/dist/_pkgs/affine-components/context-menu/button.js +14 -0
  114. package/dist/_pkgs/affine-components/filterable-list/index.js +30 -9
  115. package/dist/_pkgs/affine-components/icons/index.d.ts +0 -1
  116. package/dist/_pkgs/affine-components/icons/index.js +0 -1
  117. package/dist/_pkgs/affine-components/icons/text.d.ts +1 -0
  118. package/dist/_pkgs/affine-components/icons/text.js +11 -0
  119. package/dist/_pkgs/affine-fragment-adapter-panel/adapter-panel.d.ts +2 -2
  120. package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card.js +2 -2
  121. package/dist/_pkgs/affine-fragment-frame-panel/header/frame-panel-header.d.ts +1 -1
  122. package/dist/_pkgs/affine-fragment-frame-panel/header/frame-panel-header.js +8 -27
  123. package/dist/_pkgs/affine-fragment-frame-panel/index.d.ts +1 -0
  124. package/dist/_pkgs/affine-fragment-frame-panel/index.js +1 -0
  125. package/dist/_pkgs/affine-gfx-connector/element-renderer/connector-dom/index.js +3 -1
  126. package/dist/_pkgs/affine-gfx-connector/element-renderer/index.js +21 -4
  127. package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.js +3 -2
  128. package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +1 -1
  129. package/dist/_pkgs/affine-gfx-group/command/group-api.js +52 -1
  130. package/dist/_pkgs/affine-gfx-shape/element-renderer/shape/index.js +21 -3
  131. package/dist/_pkgs/affine-gfx-shape/text/edgeless-shape-text-editor.js +2 -0
  132. package/dist/_pkgs/affine-gfx-shape/toolbar/config.js +1 -1
  133. package/dist/_pkgs/affine-gfx-template/services/template-middlewares.d.ts +9 -0
  134. package/dist/_pkgs/affine-gfx-template/services/template-middlewares.js +23 -1
  135. package/dist/_pkgs/affine-gfx-template/services/template.js +2 -1
  136. package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.js +2 -1
  137. package/dist/_pkgs/affine-gfx-text/element-renderer/index.js +20 -3
  138. package/dist/_pkgs/affine-gfx-text/element-renderer/utils.d.ts +67 -1
  139. package/dist/_pkgs/affine-gfx-text/element-renderer/utils.js +101 -0
  140. package/dist/_pkgs/affine-gfx-text/toolbar/actions.d.ts +11 -0
  141. package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +53 -2
  142. package/dist/_pkgs/affine-gfx-text/toolbar/config.d.ts +11 -0
  143. package/dist/_pkgs/affine-gfx-text/toolbar/config.js +1 -1
  144. package/dist/_pkgs/affine-inline-preset/adapters/html/html-inline.d.ts +3 -0
  145. package/dist/_pkgs/affine-inline-preset/adapters/html/html-inline.js +31 -0
  146. package/dist/_pkgs/affine-inline-preset/adapters/html/inline-delta.d.ts +4 -0
  147. package/dist/_pkgs/affine-inline-preset/adapters/html/inline-delta.js +14 -0
  148. package/dist/_pkgs/affine-inline-preset/command/config.js +21 -3
  149. package/dist/_pkgs/affine-inline-preset/command/index.d.ts +1 -1
  150. package/dist/_pkgs/affine-inline-preset/command/index.js +1 -1
  151. package/dist/_pkgs/affine-inline-preset/command/text-style.d.ts +2 -1
  152. package/dist/_pkgs/affine-inline-preset/command/text-style.js +1 -0
  153. package/dist/_pkgs/affine-inline-preset/default-inline-manager.js +2 -1
  154. package/dist/_pkgs/affine-inline-preset/inline-spec.d.ts +4 -0
  155. package/dist/_pkgs/affine-inline-preset/inline-spec.js +14 -0
  156. package/dist/_pkgs/affine-inline-preset/translations.d.ts +2 -2
  157. package/dist/_pkgs/affine-inline-preset/translations.js +2 -2
  158. package/dist/_pkgs/affine-model/blocks/attachment/attachment-model.js +2 -0
  159. package/dist/_pkgs/affine-model/blocks/bookmark/bookmark-model.js +2 -0
  160. package/dist/_pkgs/affine-model/blocks/edgeless-text/edgeless-text-model.d.ts +1 -1
  161. package/dist/_pkgs/affine-model/blocks/edgeless-text/edgeless-text-model.js +2 -0
  162. package/dist/_pkgs/affine-model/blocks/embed/iframe/iframe-model.js +2 -0
  163. package/dist/_pkgs/affine-model/blocks/frame/frame-model.js +2 -0
  164. package/dist/_pkgs/affine-model/blocks/image/image-model.js +2 -0
  165. package/dist/_pkgs/affine-model/blocks/latex/latex-model.js +2 -0
  166. package/dist/_pkgs/affine-model/blocks/note/note-model.js +2 -0
  167. package/dist/_pkgs/affine-model/consts/text.d.ts +26 -0
  168. package/dist/_pkgs/affine-model/consts/text.js +25 -0
  169. package/dist/_pkgs/affine-model/elements/shape/shape.d.ts +6 -1
  170. package/dist/_pkgs/affine-model/elements/shape/shape.js +14 -1
  171. package/dist/_pkgs/affine-model/elements/text/text.d.ts +6 -1
  172. package/dist/_pkgs/affine-model/elements/text/text.js +13 -1
  173. package/dist/_pkgs/affine-model/utils/helper.js +2 -0
  174. package/dist/_pkgs/affine-rich-text/conversion.d.ts +25 -0
  175. package/dist/_pkgs/affine-rich-text/conversion.js +9 -0
  176. package/dist/_pkgs/affine-rich-text/index.d.ts +1 -1
  177. package/dist/_pkgs/affine-rich-text/index.js +1 -1
  178. package/dist/_pkgs/affine-shared/commands/model-crud/replace-selected-text-with-blocks.d.ts +1 -1
  179. package/dist/_pkgs/affine-shared/services/canvas-grid.d.ts +63 -0
  180. package/dist/_pkgs/affine-shared/services/canvas-grid.js +109 -0
  181. package/dist/_pkgs/affine-shared/services/canvas-local-visibility.d.ts +64 -0
  182. package/dist/_pkgs/affine-shared/services/canvas-local-visibility.js +192 -0
  183. package/dist/_pkgs/affine-shared/services/edit-props-store.d.ts +27 -0
  184. package/dist/_pkgs/affine-shared/services/edit-props-store.js +34 -0
  185. package/dist/_pkgs/affine-shared/services/editor-setting-service.d.ts +3 -0
  186. package/dist/_pkgs/affine-shared/services/editor-setting-service.js +7 -0
  187. package/dist/_pkgs/affine-shared/services/feature-flag-service.d.ts +4 -0
  188. package/dist/_pkgs/affine-shared/services/index.d.ts +3 -0
  189. package/dist/_pkgs/affine-shared/services/index.js +3 -0
  190. package/dist/_pkgs/affine-shared/services/selection-pane-service.d.ts +44 -0
  191. package/dist/_pkgs/affine-shared/services/selection-pane-service.js +28 -0
  192. package/dist/_pkgs/affine-shared/services/telemetry-service/lifecycle.d.ts +69 -0
  193. package/dist/_pkgs/affine-shared/services/telemetry-service/telemetry-service.d.ts +2 -2
  194. package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +5 -0
  195. package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +9 -0
  196. package/dist/_pkgs/affine-shared/styles/index.d.ts +1 -0
  197. package/dist/_pkgs/affine-shared/styles/index.js +1 -0
  198. package/dist/_pkgs/affine-shared/styles/panel-header.d.ts +31 -0
  199. package/dist/_pkgs/affine-shared/styles/panel-header.js +61 -0
  200. package/dist/_pkgs/affine-shared/styles/text.js +7 -7
  201. package/dist/_pkgs/affine-shared/types/index.d.ts +6 -0
  202. package/dist/_pkgs/affine-shared/utils/canvas-export-colors.d.ts +26 -0
  203. package/dist/_pkgs/affine-shared/utils/canvas-export-colors.js +127 -0
  204. package/dist/_pkgs/affine-shared/utils/file/filesys.d.ts +8 -11
  205. package/dist/_pkgs/affine-shared/utils/file/filesys.js +8 -11
  206. package/dist/_pkgs/affine-shared/utils/index.d.ts +2 -0
  207. package/dist/_pkgs/affine-shared/utils/index.js +2 -0
  208. package/dist/_pkgs/affine-shared/utils/label-mode.d.ts +47 -0
  209. package/dist/_pkgs/affine-shared/utils/label-mode.js +55 -0
  210. package/dist/_pkgs/affine-shared/utils/model/merge-to-code-model.js +7 -1
  211. package/dist/_pkgs/affine-shared/utils/model/transform-model.js +5 -0
  212. package/dist/_pkgs/affine-widget-edgeless-selected-rect/utils.js +10 -3
  213. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.js +25 -49
  214. package/dist/_pkgs/affine-widget-edgeless-toolbar/effects.d.ts +4 -0
  215. package/dist/_pkgs/affine-widget-edgeless-toolbar/effects.js +4 -0
  216. package/dist/_pkgs/affine-widget-edgeless-toolbar/index.d.ts +4 -0
  217. package/dist/_pkgs/affine-widget-edgeless-toolbar/index.js +4 -0
  218. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/drop.d.ts +61 -0
  219. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/drop.js +91 -0
  220. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/labels.d.ts +17 -0
  221. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/labels.js +95 -0
  222. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-default.d.ts +10 -0
  223. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-default.js +31 -0
  224. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-tool.d.ts +26 -0
  225. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-tool.js +82 -0
  226. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-widget.d.ts +170 -0
  227. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-widget.js +1381 -0
  228. package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.d.ts +52 -0
  229. package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.js +161 -1
  230. package/dist/_pkgs/affine-widget-edgeless-toolbar/view.js +10 -0
  231. package/dist/_pkgs/affine-widget-note-slicer/note-slicer.js +7 -3
  232. package/dist/_pkgs/std/gfx/controller.d.ts +13 -0
  233. package/dist/_pkgs/std/gfx/controller.js +22 -2
  234. package/dist/_pkgs/std/gfx/grid.d.ts +31 -2
  235. package/dist/_pkgs/std/gfx/index.d.ts +3 -1
  236. package/dist/_pkgs/std/gfx/index.js +3 -1
  237. package/dist/_pkgs/std/gfx/interactivity/manager.js +7 -0
  238. package/dist/_pkgs/std/gfx/layer.js +73 -5
  239. package/dist/_pkgs/std/gfx/local-visibility.d.ts +88 -0
  240. package/dist/_pkgs/std/gfx/local-visibility.js +217 -0
  241. package/dist/_pkgs/std/gfx/model/gfx-block-model.d.ts +13 -0
  242. package/dist/_pkgs/std/gfx/model/surface/element-model.d.ts +34 -0
  243. package/dist/_pkgs/std/gfx/model/surface/element-model.js +65 -1
  244. package/dist/_pkgs/std/gfx/model/surface/surface-model.d.ts +27 -0
  245. package/dist/_pkgs/std/gfx/model/surface/surface-model.js +43 -0
  246. package/dist/_pkgs/std/gfx/model/surface/user-layers.d.ts +68 -0
  247. package/dist/_pkgs/std/gfx/model/surface/user-layers.js +127 -0
  248. package/dist/_pkgs/std/utils/layer.d.ts +10 -0
  249. package/dist/_pkgs/std/utils/layer.js +64 -13
  250. package/dist/_pkgs/std/view/element/gfx-block-component.js +10 -2
  251. package/dist/commands.js +4 -1
  252. package/dist/translations.js +10 -6
  253. package/package.json +9 -2
  254. package/dist/_pkgs/affine-components/icons/file-icons-rc.d.ts +0 -1
  255. package/dist/_pkgs/affine-components/icons/file-icons-rc.js +0 -130
  256. package/dist/_pkgs/affine-shared/test-utils/affine-template.d.ts +0 -6
  257. package/dist/_pkgs/affine-shared/test-utils/affine-template.js +0 -258
  258. package/dist/_pkgs/affine-shared/test-utils/affine-test-utils.d.ts +0 -8
  259. package/dist/_pkgs/affine-shared/test-utils/affine-test-utils.js +0 -81
  260. package/dist/_pkgs/affine-shared/test-utils/create-test-host.d.ts +0 -23
  261. package/dist/_pkgs/affine-shared/test-utils/create-test-host.js +0 -187
  262. package/dist/_pkgs/affine-shared/test-utils/index.d.ts +0 -3
  263. package/dist/_pkgs/affine-shared/test-utils/index.js +0 -3
@@ -1,4 +1,4 @@
1
- import { reassociateConnectorsCommand } from '../../../affine-block-surface/index.js';
1
+ import { applyCreationLayer, reassociateConnectorsCommand, sourceLayerOf, } from '../../../affine-block-surface/index.js';
2
2
  import { toast } from '../../../affine-components/toast/index.js';
3
3
  import { BookmarkStyles, EmbedIframeBlockModel } from '../../../affine-model/index.js';
4
4
  import { EMBED_CARD_HEIGHT, EMBED_CARD_WIDTH, } from '../../../affine-shared/consts/index.js';
@@ -292,7 +292,16 @@ export const builtinSurfaceToolbarConfig = {
292
292
  const bounds = Bound.deserialize(xywh);
293
293
  bounds.w = EMBED_CARD_WIDTH[style];
294
294
  bounds.h = EMBED_CARD_HEIGHT[style];
295
- const newId = ctx.store.addBlock(flavour, { url, caption, style, xywh: bounds.serialize() }, parent);
295
+ // The card takes the iframe's place, layer included (ADR 0031 §6).
296
+ const props = {
297
+ url,
298
+ caption,
299
+ style,
300
+ xywh: bounds.serialize(),
301
+ layer: sourceLayerOf(model),
302
+ };
303
+ applyCreationLayer(ctx.std, props);
304
+ const newId = ctx.store.addBlock(flavour, props, parent);
296
305
  ctx.command.exec(reassociateConnectorsCommand, { oldId, newId });
297
306
  ctx.store.deleteBlock(model);
298
307
  // Selects new block
@@ -1,5 +1,5 @@
1
1
  import { createEmbedEdgelessBlockInteraction, toEdgelessEmbedBlock, } from '../../affine-block-embed/index.js';
2
- import { EdgelessCRUDIdentifier, reassociateConnectorsCommand, } from '../../affine-block-surface/index.js';
2
+ import { EdgelessCRUDIdentifier, reassociateConnectorsCommand, sourceLayerOf, } from '../../affine-block-surface/index.js';
3
3
  import { EmbedLinkedDocBlockSchema } from '../../affine-model/index.js';
4
4
  import { EMBED_CARD_HEIGHT, EMBED_CARD_WIDTH, } from '../../affine-shared/consts/index.js';
5
5
  import { cloneReferenceInfoWithoutAliases, isNewTabTrigger, isNewViewTrigger, } from '../../affine-shared/utils/index.js';
@@ -21,6 +21,8 @@ export class EmbedEdgelessLinkedDocBlockComponent extends toEdgelessEmbedBlock(E
21
21
  xywh: bound.serialize(),
22
22
  caption,
23
23
  ...cloneReferenceInfoWithoutAliases(this.referenceInfo$.peek()),
24
+ // In the linked doc's layer, not the active one (ADR 0031 §6).
25
+ layer: sourceLayerOf(this.model),
24
26
  }, surface);
25
27
  this.std.command.exec(reassociateConnectorsCommand, {
26
28
  oldId: id,
@@ -1,3 +1,4 @@
1
+ import { applyCreationLayer, sourceLayerOf } from '../../../affine-block-surface/index.js';
1
2
  import { toast } from '../../../affine-components/toast/index.js';
2
3
  import { EditorChevronDown } from '../../../affine-components/toolbar/index.js';
3
4
  import { DEFAULT_NOTE_HEIGHT, DEFAULT_NOTE_WIDTH, EmbedSyncedDocModel, NoteBlockModel, NoteDisplayMode, } from '../../../affine-model/index.js';
@@ -297,11 +298,15 @@ const builtinSurfaceToolbarConfig = {
297
298
  PADDING;
298
299
  const y = syncedDocModel.elementBound.y;
299
300
  const children = await draftedModels;
300
- const noteId = std.store.addBlock('affine:note', {
301
+ const props = {
301
302
  xywh: new Bound(x, y, DEFAULT_NOTE_WIDTH, DEFAULT_NOTE_HEIGHT).serialize(),
302
303
  index: gfx.layer.generateIndex(),
303
304
  displayMode: NoteDisplayMode.EdgelessOnly,
304
- }, ctx.store.root);
305
+ // Beside the synced doc, in its layer (ADR 0031 §6).
306
+ layer: sourceLayerOf(syncedDocModel),
307
+ };
308
+ applyCreationLayer(std, props);
309
+ const noteId = std.store.addBlock('affine:note', props, ctx.store.root);
305
310
  std.store.addBlock('affine:paragraph', {
306
311
  text: new Text([
307
312
  {
@@ -33,7 +33,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
33
33
  return useValue ? value : void 0;
34
34
  };
35
35
  import { toEdgelessEmbedBlock } from '../../affine-block-embed/index.js';
36
- import { EdgelessCRUDIdentifier, reassociateConnectorsCommand, } from '../../affine-block-surface/index.js';
36
+ import { EdgelessCRUDIdentifier, reassociateConnectorsCommand, sourceLayerOf, } from '../../affine-block-surface/index.js';
37
37
  import {} from '../../affine-model/index.js';
38
38
  import { EMBED_CARD_HEIGHT, EMBED_CARD_WIDTH, } from '../../affine-shared/consts/index.js';
39
39
  import { ThemeExtensionIdentifier, ThemeProvider, translateKey, } from '../../affine-shared/services/index.js';
@@ -170,6 +170,8 @@ let EmbedEdgelessSyncedDocBlockComponent = (() => {
170
170
  caption,
171
171
  ...this.referenceInfo,
172
172
  ...aliasInfo,
173
+ // In the synced doc's layer, not the active one (ADR 0031 §6).
174
+ layer: sourceLayerOf(this.model),
173
175
  }, surface);
174
176
  this.std.command.exec(reassociateConnectorsCommand, {
175
177
  oldId: id,
@@ -20,6 +20,9 @@ export declare const EdgelessFrameManagerIdentifier: import("../global/di/types.
20
20
  export declare class EdgelessFrameManager extends GfxExtension {
21
21
  static key: string;
22
22
  private readonly _disposable;
23
+ /** Canvas elements added locally, waiting for the adoption microtask. */
24
+ private readonly _pendingAdoptions;
25
+ private _pendingAdoptionTicks;
23
26
  /**
24
27
  * Get all sorted frames by presentation orderer,
25
28
  * the legacy frame that uses `index` as presentation order
@@ -67,6 +70,8 @@ export declare class EdgelessFrameManager extends GfxExtension {
67
70
  */
68
71
  private _watchFrameMoved;
69
72
  private _watchElementAdded;
73
+ /** A canvas element just added locally: the frame under it adopts it. */
74
+ private _adoptIfInFrame;
70
75
  /**
71
76
  * Whether `element` fully encloses `frame`.
72
77
  *
@@ -1,4 +1,4 @@
1
- import { indexOverBackgrounds, Overlay, stackedElementsOf, } from '../affine-block-surface/index.js';
1
+ import { applyCreationLayer, indexOverBackgrounds, Overlay, stackedElementsOf, } from '../affine-block-surface/index.js';
2
2
  import { FrameworkBackgroundElementModel } from '../affine-model/index.js';
3
3
  import { EditPropsStore, getChromeAccentColor, translateKey, } from '../affine-shared/services/index.js';
4
4
  import { DisposableGroup } from '../global/disposable/index.js';
@@ -103,6 +103,9 @@ export class EdgelessFrameManager extends GfxExtension {
103
103
  constructor(gfx) {
104
104
  super(gfx);
105
105
  this._disposable = new DisposableGroup();
106
+ /** Canvas elements added locally, waiting for the adoption microtask. */
107
+ this._pendingAdoptions = [];
108
+ this._pendingAdoptionTicks = 0;
106
109
  this._watchElementAdded();
107
110
  this._watchFrameMoved();
108
111
  }
@@ -158,6 +161,10 @@ export class EdgelessFrameManager extends GfxExtension {
158
161
  index: this.frameIndexAt(bound),
159
162
  presentationIndex: this.generatePresentationIndex(),
160
163
  });
164
+ // The viewer's active layer, like every new model (ADR 0031 §6). Not
165
+ // through the stamped CRUD `addBlock`: it would replace the index
166
+ // `frameIndexAt` just chose.
167
+ applyCreationLayer(this.gfx.std, props);
161
168
  const id = this.gfx.doc.addBlock('affine:frame', props, surfaceModel);
162
169
  const frameModel = this.gfx.getElementById(id);
163
170
  if (!frameModel || !isFrameBlock(frameModel)) {
@@ -231,7 +238,7 @@ export class EdgelessFrameManager extends GfxExtension {
231
238
  const { surface: surfaceModel, doc } = this.gfx;
232
239
  this._disposable.add(surfaceModel.elementAdded.subscribe(({ id, local }) => {
233
240
  const element = surfaceModel.getElementById(id);
234
- if (element && local) {
241
+ if (element && local && !surfaceModel.store.readonly) {
235
242
  // The entire frame detection logic must be in microtask for timing reasons:
236
243
  //
237
244
  // 1. For connectors: When elementAdded fires, connectors have invalid bounds [0,0,0,0]
@@ -248,22 +255,23 @@ export class EdgelessFrameManager extends GfxExtension {
248
255
  // - Connectors have proper bounds calculated (not [0,0,0,0])
249
256
  // - getFrameFromPoint() works correctly with valid element centers
250
257
  // - All element initialization is complete before frame detection
258
+ //
259
+ // One transaction (one update for the peers) adopts everything a
260
+ // single transaction added — a paste of N elements no longer sends N
261
+ // adoptions. Only the LAST microtask queued does the work, so each
262
+ // element is decided no earlier than its own microtask would have
263
+ // been, connector paths included.
264
+ this._pendingAdoptions.push(element);
265
+ this._pendingAdoptionTicks++;
251
266
  queueMicrotask(() => {
252
- const frame = this.getFrameFromPoint(element.elementBound.center);
253
- // if the container created with a frame, skip it.
254
- if (isGfxGroupCompatibleModel(element) &&
255
- frame &&
256
- element.hasChild(frame)) {
267
+ if (--this._pendingAdoptionTicks > 0)
268
+ return;
269
+ const elements = this._pendingAdoptions.splice(0);
270
+ if (surfaceModel.store.readonly)
257
271
  return;
258
- }
259
- // Only add elements that aren't already grouped and have a valid
260
- // frame, and never let the frame swallow a backdrop that encloses
261
- // it (e.g. a Wardley map background the frame was drawn on top of).
262
- if (!element.group &&
263
- frame &&
264
- !this._enclosesFrame(element, frame)) {
265
- this._adoptNewlyCreatedElement(frame, element);
266
- }
272
+ doc.transact(() => {
273
+ elements.forEach(element => this._adoptIfInFrame(element));
274
+ });
267
275
  });
268
276
  }
269
277
  }));
@@ -275,11 +283,18 @@ export class EdgelessFrameManager extends GfxExtension {
275
283
  // cannot write at all, which is how this surfaced (#251). See #242 for
276
284
  // the rule: a cascade reacts to local transactions, the receiving peer
277
285
  // trusts the sync.
278
- if (!payload.isLocal)
286
+ if (!payload.isLocal || doc.readonly)
279
287
  return;
280
288
  if (payload.type === 'add' &&
281
289
  payload.model instanceof GfxBlockElementModel &&
282
290
  renderableInEdgeless(doc, surfaceModel, payload.model)) {
291
+ // Same guard as the canvas half: a block that already has a parent
292
+ // (restored by undo with its group, or created by a transaction that
293
+ // also wrote its container) is not the frame's to take. Adopting it
294
+ // makes two containers claim one child, and the next duplicate
295
+ // copies that child twice.
296
+ if (payload.model.group)
297
+ return;
283
298
  const frame = this.getFrameFromPoint(payload.model.elementBound.center, isFrameBlock(payload.model) ? [payload.model] : []);
284
299
  if (!frame)
285
300
  return;
@@ -297,6 +312,22 @@ export class EdgelessFrameManager extends GfxExtension {
297
312
  }
298
313
  }));
299
314
  }
315
+ /** A canvas element just added locally: the frame under it adopts it. */
316
+ _adoptIfInFrame(element) {
317
+ const frame = this.getFrameFromPoint(element.elementBound.center);
318
+ if (!frame)
319
+ return;
320
+ // if the container created with a frame, skip it.
321
+ if (isGfxGroupCompatibleModel(element) && element.hasChild(frame)) {
322
+ return;
323
+ }
324
+ // Only add elements that aren't already grouped, and never let the frame
325
+ // swallow a backdrop that encloses it (e.g. a Wardley map background the
326
+ // frame was drawn on top of).
327
+ if (!element.group && !this._enclosesFrame(element, frame)) {
328
+ this._adoptNewlyCreatedElement(frame, element);
329
+ }
330
+ }
300
331
  /**
301
332
  * Whether `element` fully encloses `frame`.
302
333
  *
@@ -1,4 +1,4 @@
1
- import { DefaultTool, OverlayIdentifier } from '../affine-block-surface/index.js';
1
+ import { applyCreationLayer, DefaultTool, OverlayIdentifier, } from '../affine-block-surface/index.js';
2
2
  import { EditPropsStore, TelemetryProvider, translateKey, } from '../affine-shared/services/index.js';
3
3
  import { Bound, Vec } from '../global/gfx/index.js';
4
4
  import { BaseTool, getTopElements } from '../std/gfx/index.js';
@@ -61,6 +61,8 @@ export class FrameTool extends BaseTool {
61
61
  index: this.frameManager.frameIndexAt(bound),
62
62
  presentationIndex: this.frameManager.generatePresentationIndex(),
63
63
  });
64
+ // The active layer, as `EdgelessFrameManager._addFrameBlock` does.
65
+ applyCreationLayer(this.std, props);
64
66
  const id = this.doc.addBlock('affine:frame', props, this.gfx.surface);
65
67
  this.std.getOptional(TelemetryProvider)?.track('CanvasElementAdded', {
66
68
  control: 'canvas:draw',
@@ -1,4 +1,4 @@
1
- import { autoResizeElementsCommand } from '../affine-block-surface/index.js';
1
+ import { applyCreationLayer, autoResizeElementsCommand, } from '../affine-block-surface/index.js';
2
2
  import { toast } from '../affine-components/toast/index.js';
3
3
  import { ImageBlockSchema, } from '../affine-model/index.js';
4
4
  import { FileSizeLimitProvider, NativeClipboardProvider, TOAST_DOWNLOAD_IN_PROGRESS, TOAST_UPLOAD_SIZE_LIMIT, translateKey, } from '../affine-shared/services/index.js';
@@ -234,6 +234,9 @@ export async function addImages(std, files, options) {
234
234
  },
235
235
  };
236
236
  });
237
+ // The viewer's active layer, as the CRUD `addBlock` path stamps it
238
+ // (ADR 0031 §6): several blocks at once go straight to `store.addBlocks`.
239
+ blocks.forEach(({ blockProps }) => applyCreationLayer(std, blockProps));
237
240
  const blockIds = std.store.addBlocks(blocks, gfx.surface);
238
241
  gfx.selection.set({
239
242
  elements: blockIds,
@@ -1,4 +1,12 @@
1
1
  import { type MarkdownAdapterPreprocessor } from '../../../affine-shared/adapters/index.js';
2
+ /**
3
+ * Preprocess the content to protect code blocks and LaTeX expressions
4
+ * reference issue: https://github.com/remarkjs/react-markdown/issues/785
5
+ * reference comment: https://github.com/remarkjs/react-markdown/issues/785#issuecomment-2307567823
6
+ * @param content - The content to preprocess
7
+ * @returns The preprocessed content
8
+ */
9
+ export declare function preprocessLatex(content: string): string;
2
10
  export declare const LatexMarkdownPreprocessorExtension: import("../../../store/index.js").ExtensionType & {
3
11
  identifier: import("../../../global/di/types.js").ServiceIdentifier<MarkdownAdapterPreprocessor>;
4
12
  };
@@ -24,7 +24,7 @@ function escapeMhchem(text) {
24
24
  * @param content - The content to preprocess
25
25
  * @returns The preprocessed content
26
26
  */
27
- function preprocessLatex(content) {
27
+ export function preprocessLatex(content) {
28
28
  // Protect code blocks
29
29
  const codeBlocks = [];
30
30
  let preprocessedContent = content;
@@ -32,14 +32,18 @@ function preprocessLatex(content) {
32
32
  codeBlocks.push(code);
33
33
  return `<<CODE_BLOCK_${codeBlocks.length - 1}>>`;
34
34
  });
35
- // Protect existing LaTeX expressions
35
+ // Protect existing LaTeX expressions. Inline delimiters use Pandoc's
36
+ // whitespace and digit rules, with backslash parity preserved: a `$` opens
37
+ // math when not followed by a space, closes it when not preceded by one nor
38
+ // followed by a digit, and an odd backslash run escapes it.
36
39
  const latexExpressions = [];
37
- preprocessedContent = preprocessedContent.replace(/(\$\$[\s\S]*?\$\$|\\\[[\s\S]*?\\\]|\\\(.*?\\\))/g, match => {
40
+ preprocessedContent = preprocessedContent.replace(/(\$\$[\s\S]*?\$\$|\\\[[\s\S]*?\\\]|\\\(.*?\\\)|(?<!\\)(?:\\\\)*\$(?!\s)(?:[^\n$\\]|\\.)*?(?<!\s)\$(?!\d))/g, match => {
38
41
  latexExpressions.push(match);
39
42
  return `<<LATEX_${latexExpressions.length - 1}>>`;
40
43
  });
41
- // Escape dollar signs that are likely currency indicators
42
- preprocessedContent = preprocessedContent.replace(/\$(?=\d)/g, '\\$');
44
+ // Escape dollar signs that are likely currency indicators. An odd backslash
45
+ // run already escapes the dollar sign, so only an even run (or none) gets one.
46
+ preprocessedContent = preprocessedContent.replace(/(?<!\\)((?:\\\\)*)\$(?=\d)/g, '$1\\$');
43
47
  // Restore LaTeX expressions
44
48
  preprocessedContent = preprocessedContent.replace(/<<LATEX_(\d+)>>/g, (_, index) => latexExpressions[parseInt(index)]);
45
49
  // Restore code blocks
@@ -57,7 +57,6 @@ export declare const NOTE_BORDER_STYLE_LABEL: ChromeWording;
57
57
  /** An alias (L7 dedupe): the same word as {@link DISPLAY_MODE_SHOW_IN}, one key. */
58
58
  export declare const NOTE_DISPLAY_MODE_SHOW_IN: ChromeWording;
59
59
  export declare const NOTE_DISPLAY_MODE_LABEL: ChromeWording;
60
- export declare const NOTE_DISPLAY_MODE_TOOLTIP: ChromeWording;
61
60
  /** An alias (L7 dedupe): the same word as {@link DISPLAY_MODE_BOTH}, one key. */
62
61
  export declare const NOTE_DISPLAY_MODE_BOTH: ChromeWording;
63
62
  /** An alias (L7 dedupe): the same word as {@link DISPLAY_MODE_EDGELESS}, one key. */
@@ -143,10 +143,6 @@ export const NOTE_DISPLAY_MODE_LABEL = [
143
143
  'com.labre.note.display-mode.mode-label',
144
144
  'Mode',
145
145
  ];
146
- export const NOTE_DISPLAY_MODE_TOOLTIP = [
147
- 'com.labre.note.display-mode.tooltip',
148
- 'Display mode',
149
- ];
150
146
  /** An alias (L7 dedupe): the same word as {@link DISPLAY_MODE_BOTH}, one key. */
151
147
  export const NOTE_DISPLAY_MODE_BOTH = DISPLAY_MODE_BOTH;
152
148
  /** An alias (L7 dedupe): the same word as {@link DISPLAY_MODE_EDGELESS}, one key. */
@@ -237,7 +233,6 @@ export const NOTE_WORDINGS = [
237
233
  NOTE_STYLE_CUSTOM_COLOR,
238
234
  NOTE_STYLE_PANEL_LABEL,
239
235
  NOTE_DISPLAY_MODE_LABEL,
240
- NOTE_DISPLAY_MODE_TOOLTIP,
241
236
  NOTE_TOAST_DISPLAYED_IN_PAGE_MODE,
242
237
  NOTE_TOAST_REMOVED_FROM_PAGE_BODY,
243
238
  NOTE_TOAST_ADDED_TO_PAGE_BODY,
@@ -5,7 +5,7 @@ import { toast } from '../../affine-components/toast/index.js';
5
5
  import { EditorChevronDown } from '../../affine-components/toolbar/index.js';
6
6
  import { deleteTextCommand, formatBlockCommand, formatNativeCommand, formatTextCommand, isFormatSupported, textFormatConfigs, } from '../../affine-inline-preset/index.js';
7
7
  import { EmbedLinkedDocBlockSchema, EmbedSyncedDocBlockSchema, } from '../../affine-model/index.js';
8
- import { textConversionConfigs } from '../../affine-rich-text/index.js';
8
+ import { textConversionConfigs, TextConversionEntryIdentifier, } from '../../affine-rich-text/index.js';
9
9
  import { copySelectedModelsCommand, deleteSelectedModelsCommand, draftSelectedModelsCommand, duplicateSelectedModelsCommand, getBlockSelectionsCommand, getImageSelectionsCommand, getSelectedBlocksCommand, getSelectedModelsCommand, getTextSelectionCommand, } from '../../affine-shared/commands/index.js';
10
10
  import { ActionPlacement, blockCommentToolbarButton, TOAST_COPIED_TO_CLIPBOARD, TOOLBAR_COPY, TOOLBAR_DELETE, TOOLBAR_DUPLICATE, translateKey, } from '../../affine-shared/services/index.js';
11
11
  import { tableViewMeta } from '../../data-view/view-presets/index.js';
@@ -42,6 +42,11 @@ const conversionsActionGroup = {
42
42
  })
43
43
  .run();
44
44
  };
45
+ // Conversions a gated block package registers from its own view extension
46
+ // (#418): absent when its flag is off, so never listed statically here.
47
+ const contributed = [
48
+ ...std.provider.getAll(TextConversionEntryIdentifier).values(),
49
+ ].filter(entry => entry.when(std, selectedModels));
45
50
  return {
46
51
  content: html `
47
52
  <editor-menu-button
@@ -65,6 +70,17 @@ const conversionsActionGroup = {
65
70
  ${icon}<span class="label">${name}</span>
66
71
  </editor-menu-action>
67
72
  `)}
73
+ ${repeat(contributed, entry => entry.flavour, entry => {
74
+ const label = translateKey(std, ...entry.nameWording);
75
+ return html `
76
+ <editor-menu-action
77
+ aria-label=${label}
78
+ @click=${() => entry.run(std, selectedModels)}
79
+ >
80
+ ${entry.icon}<span class="label">${label}</span>
81
+ </editor-menu-action>
82
+ `;
83
+ })}
68
84
  </div>
69
85
  </editor-menu-button>
70
86
  `,
@@ -7,7 +7,7 @@ import { BookmarkStyles, DEFAULT_NOTE_HEIGHT, DEFAULT_NOTE_WIDTH, FrameBlockMode
7
7
  import { ClipboardAdapter, decodeClipboardBlobs, ImageProxyService, } from '../../../affine-shared/adapters/index.js';
8
8
  import { CANVAS_EXPORT_IGNORE_TAGS, EMBED_CARD_HEIGHT, EMBED_CARD_WIDTH, } from '../../../affine-shared/consts/index.js';
9
9
  import { EmbedOptionProvider, ParseDocUrlProvider, TelemetryProvider, } from '../../../affine-shared/services/index.js';
10
- import { convertToPng, isInsidePageEditor, isTopLevelBlock, isUrlInClipboard, matchModels, referenceToNode, } from '../../../affine-shared/utils/index.js';
10
+ import { convertToPng, isInsidePageEditor, isTopLevelBlock, isUrlInClipboard, matchModels, normalizeCanvasExportColors, referenceToNode, } from '../../../affine-shared/utils/index.js';
11
11
  import { DisposableGroup } from '../../../global/disposable/index.js';
12
12
  import { BlockSuiteError, ErrorCode } from '../../../global/exceptions/index.js';
13
13
  import { Bound, getCommonBound, Vec, } from '../../../global/gfx/index.js';
@@ -336,6 +336,7 @@ export class EdgelessClipboardController extends PageClipboard {
336
336
  }
337
337
  },
338
338
  onclone: async function (documentClone, element) {
339
+ normalizeCanvasExportColors(documentClone, element);
339
340
  // html2canvas can't support transform feature
340
341
  element.style.setProperty('transform', 'none');
341
342
  const layer = documentClone.querySelector('.affine-edgeless-layer');