@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
@@ -0,0 +1,109 @@
1
+ import { LifeCycleWatcher } from '../../std/index.js';
2
+ import { GfxControllerIdentifier, } from '../../std/gfx/index.js';
3
+ import { computed, signal } from '@preact/signals-core';
4
+ import { EditPropsStore } from './edit-props-store.js';
5
+ import { EditorSettingProvider } from './editor-setting-service.js';
6
+ /**
7
+ * The four levels of ADR 0031 §11, nearest decision first: the viewer's own
8
+ * override, the document's "saved for everyone" setting, the host's default
9
+ * (`edgelessShowGrid`), and the library default — on. `undefined` at a level
10
+ * means "nobody decided here".
11
+ */
12
+ export function resolveCanvasGrid(levels) {
13
+ if (levels.local !== undefined) {
14
+ return { visible: levels.local, source: 'local' };
15
+ }
16
+ if (levels.document !== undefined) {
17
+ return { visible: levels.document, source: 'document' };
18
+ }
19
+ if (levels.host !== undefined) {
20
+ return { visible: levels.host, source: 'host' };
21
+ }
22
+ return { visible: true, source: 'library' };
23
+ }
24
+ /**
25
+ * What a surface stored for everyone, read reactively. Previews (the
26
+ * read-only edgeless preview, a surface-ref) follow THIS and the library
27
+ * default only: they are a picture of the document, not a viewer's session,
28
+ * so neither a viewer override nor a host default reaches them.
29
+ */
30
+ export function documentShowsGrid(surface) {
31
+ return surface?.props.showGrid$.value !== false;
32
+ }
33
+ /**
34
+ * The canvas grid as THIS viewer sees it (ADR 0031 §11).
35
+ *
36
+ * - **The toggle is local**: it writes the viewer's override, an
37
+ * `EditPropsStore` `localStorage` prop keyed by document id like the
38
+ * viewport, so it survives a reload and produces no Yjs update — a reader
39
+ * may toggle it too.
40
+ * - **"Save for everyone"** writes the current state into the surface's
41
+ * `showGrid` and clears the saver's override, so they see what everyone
42
+ * sees. Refused on a read-only store; writes nothing when the document
43
+ * already says the same.
44
+ *
45
+ * Both containers that paint the grid (the edgeless root's background and
46
+ * the surface container) and the PNG export read `visible$`.
47
+ */
48
+ export class CanvasGrid extends LifeCycleWatcher {
49
+ constructor() {
50
+ super(...arguments);
51
+ this._local$ = signal(undefined);
52
+ this._resolved$ = computed(() => resolveCanvasGrid({
53
+ local: this._local$.value,
54
+ document: this._surface()?.props.showGrid$.value,
55
+ host: this.std.getOptional(EditorSettingProvider)?.setting$.value
56
+ .edgelessShowGrid,
57
+ }));
58
+ /** Whether this viewer sees the grid. */
59
+ this.visible$ = computed(() => this._resolved$.value.visible);
60
+ /** Which level decided `visible$`. */
61
+ this.source$ = computed(() => this._resolved$.value.source);
62
+ }
63
+ static { this.key = 'canvas-grid'; }
64
+ _surface() {
65
+ return this.std.get(GfxControllerIdentifier).surface$.value;
66
+ }
67
+ /**
68
+ * Flip the grid for this viewer only. Answers the new visibility.
69
+ */
70
+ toggle() {
71
+ const visible = !this.visible$.peek();
72
+ this._local$.value = visible;
73
+ this.std.getOptional(EditPropsStore)?.setStorage('localShowGrid', visible);
74
+ return visible;
75
+ }
76
+ /**
77
+ * Store what this viewer sees as the document's setting, and drop their
78
+ * override. Answers the saved value, or `null` when nothing was written
79
+ * (read-only store, no surface, or the document already said so).
80
+ */
81
+ saveForEveryone() {
82
+ const surface = this._surface();
83
+ if (!surface || this.std.store.readonly)
84
+ return null;
85
+ const visible = this.visible$.peek();
86
+ this._clearLocal();
87
+ if (surface.props.showGrid === visible)
88
+ return null;
89
+ this.std.store.captureSync();
90
+ this.std.store.transact(() => {
91
+ surface.props.showGrid = visible;
92
+ });
93
+ this.std.store.captureSync();
94
+ return visible;
95
+ }
96
+ _clearLocal() {
97
+ if (this._local$.peek() === undefined)
98
+ return;
99
+ this._local$.value = undefined;
100
+ this.std.getOptional(EditPropsStore)?.removeStorage('localShowGrid');
101
+ }
102
+ mounted() {
103
+ super.mounted();
104
+ const stored = this.std
105
+ .getOptional(EditPropsStore)
106
+ ?.getStorage('localShowGrid');
107
+ this._local$.value = stored ?? undefined;
108
+ }
109
+ }
@@ -0,0 +1,64 @@
1
+ import { LifeCycleWatcher } from '../../std/index.js';
2
+ import { type ReadonlySignal } from '@preact/signals-core';
3
+ /**
4
+ * Hide is LOCAL by default (ADR 0031 §1, §8): what this viewer hid on this
5
+ * document's canvas, and nothing anybody else can see.
6
+ *
7
+ * - **Never written to the document.** The ids live in a signal and persist
8
+ * through `EditPropsStore`'s `localHiddenElements`, a `localStorage` prop
9
+ * keyed by document id exactly like the viewport — so a reload keeps them
10
+ * (open point 7, resolved at acceptance) and no Yjs update is ever produced.
11
+ * - **Pruned on load**: ids the document no longer has are dropped the first
12
+ * time the surface is there to ask, so the list does not grow forever.
13
+ * - **Not `display`**: the canvas text editor owns that flag and closing it on
14
+ * a locally hidden text would unhide it.
15
+ *
16
+ * The signal is registered into `gfx.localVisibility`, the per-editor hook the
17
+ * renderers, the DOM block views, pointer picking and the marquee read. It is
18
+ * never read by `grid.search`: rules, legends and semantic exports count a
19
+ * hidden element, because hiding is not deleting.
20
+ *
21
+ * Not gated by `store.readonly`: hiding is a way of LOOKING at a document, so
22
+ * a reader may do it — nothing they do here reaches the document.
23
+ *
24
+ * Whole user layers hide the same way (stage 7): a second set of ids, kept
25
+ * and persisted beside the first (`localHiddenLayers`), registered with
26
+ * `gfx.localVisibility.registerLayers` — every model whose effective layer
27
+ * is in it is hidden for this viewer.
28
+ */
29
+ export declare class CanvasLocalVisibility extends LifeCycleWatcher {
30
+ static key: string;
31
+ private readonly _hiddenIds$;
32
+ private readonly _hiddenLayerIds$;
33
+ private _disposers;
34
+ /** The ids this viewer hid. */
35
+ get hiddenIds$(): ReadonlySignal<ReadonlySet<string>>;
36
+ /** The user layers this viewer hid. */
37
+ get hiddenLayerIds$(): ReadonlySignal<ReadonlySet<string>>;
38
+ isHidden(id: string): boolean;
39
+ /** Hide whole user layers for this viewer. Answers how many changed. */
40
+ hideLayers(ids: Iterable<string>): number;
41
+ /** Show user layers again. Answers how many were hidden. */
42
+ showLayers(ids: Iterable<string>): number;
43
+ /** Hide `ids`. Answers how many were not hidden yet. */
44
+ hide(ids: Iterable<string>): number;
45
+ /** Show `ids` again. Answers how many were hidden. */
46
+ show(ids: Iterable<string>): number;
47
+ /**
48
+ * Show every element this viewer hid. Answers how many were hidden.
49
+ * Hidden layers are {@link showAllLayers}'s, so each count reports one
50
+ * target.
51
+ */
52
+ showAll(): number;
53
+ /** Show every layer this viewer hid. Answers how many were hidden. */
54
+ showAllLayers(): number;
55
+ private _commitLayers;
56
+ private _commit;
57
+ mounted(): void;
58
+ /**
59
+ * Restore the hidden layers, pruned of layers the surface no longer has —
60
+ * the first time the surface is there to ask.
61
+ */
62
+ private _restoreLayers;
63
+ unmounted(): void;
64
+ }
@@ -0,0 +1,192 @@
1
+ import { LifeCycleWatcher } from '../../std/index.js';
2
+ import { DEFAULT_LAYER_ID, GfxControllerIdentifier } from '../../std/gfx/index.js';
3
+ import { effect, signal } from '@preact/signals-core';
4
+ import { EditPropsStore } from './edit-props-store.js';
5
+ /**
6
+ * Hide is LOCAL by default (ADR 0031 §1, §8): what this viewer hid on this
7
+ * document's canvas, and nothing anybody else can see.
8
+ *
9
+ * - **Never written to the document.** The ids live in a signal and persist
10
+ * through `EditPropsStore`'s `localHiddenElements`, a `localStorage` prop
11
+ * keyed by document id exactly like the viewport — so a reload keeps them
12
+ * (open point 7, resolved at acceptance) and no Yjs update is ever produced.
13
+ * - **Pruned on load**: ids the document no longer has are dropped the first
14
+ * time the surface is there to ask, so the list does not grow forever.
15
+ * - **Not `display`**: the canvas text editor owns that flag and closing it on
16
+ * a locally hidden text would unhide it.
17
+ *
18
+ * The signal is registered into `gfx.localVisibility`, the per-editor hook the
19
+ * renderers, the DOM block views, pointer picking and the marquee read. It is
20
+ * never read by `grid.search`: rules, legends and semantic exports count a
21
+ * hidden element, because hiding is not deleting.
22
+ *
23
+ * Not gated by `store.readonly`: hiding is a way of LOOKING at a document, so
24
+ * a reader may do it — nothing they do here reaches the document.
25
+ *
26
+ * Whole user layers hide the same way (stage 7): a second set of ids, kept
27
+ * and persisted beside the first (`localHiddenLayers`), registered with
28
+ * `gfx.localVisibility.registerLayers` — every model whose effective layer
29
+ * is in it is hidden for this viewer.
30
+ */
31
+ export class CanvasLocalVisibility extends LifeCycleWatcher {
32
+ constructor() {
33
+ super(...arguments);
34
+ this._hiddenIds$ = signal(new Set());
35
+ this._hiddenLayerIds$ = signal(new Set());
36
+ this._disposers = [];
37
+ }
38
+ static { this.key = 'canvas-local-visibility'; }
39
+ /** The ids this viewer hid. */
40
+ get hiddenIds$() {
41
+ return this._hiddenIds$;
42
+ }
43
+ /** The user layers this viewer hid. */
44
+ get hiddenLayerIds$() {
45
+ return this._hiddenLayerIds$;
46
+ }
47
+ isHidden(id) {
48
+ return this._hiddenIds$.value.has(id);
49
+ }
50
+ /** Hide whole user layers for this viewer. Answers how many changed. */
51
+ hideLayers(ids) {
52
+ const next = new Set(this._hiddenLayerIds$.peek());
53
+ let changed = 0;
54
+ for (const id of ids) {
55
+ if (next.has(id))
56
+ continue;
57
+ next.add(id);
58
+ changed++;
59
+ }
60
+ if (changed)
61
+ this._commitLayers(next);
62
+ return changed;
63
+ }
64
+ /** Show user layers again. Answers how many were hidden. */
65
+ showLayers(ids) {
66
+ const next = new Set(this._hiddenLayerIds$.peek());
67
+ let changed = 0;
68
+ for (const id of ids) {
69
+ if (next.delete(id))
70
+ changed++;
71
+ }
72
+ if (changed)
73
+ this._commitLayers(next);
74
+ return changed;
75
+ }
76
+ /** Hide `ids`. Answers how many were not hidden yet. */
77
+ hide(ids) {
78
+ const next = new Set(this._hiddenIds$.peek());
79
+ let changed = 0;
80
+ for (const id of ids) {
81
+ if (next.has(id))
82
+ continue;
83
+ next.add(id);
84
+ changed++;
85
+ }
86
+ if (changed)
87
+ this._commit(next);
88
+ return changed;
89
+ }
90
+ /** Show `ids` again. Answers how many were hidden. */
91
+ show(ids) {
92
+ const next = new Set(this._hiddenIds$.peek());
93
+ let changed = 0;
94
+ for (const id of ids) {
95
+ if (next.delete(id))
96
+ changed++;
97
+ }
98
+ if (changed)
99
+ this._commit(next);
100
+ return changed;
101
+ }
102
+ /**
103
+ * Show every element this viewer hid. Answers how many were hidden.
104
+ * Hidden layers are {@link showAllLayers}'s, so each count reports one
105
+ * target.
106
+ */
107
+ showAll() {
108
+ const count = this._hiddenIds$.peek().size;
109
+ if (count)
110
+ this._commit(new Set());
111
+ return count;
112
+ }
113
+ /** Show every layer this viewer hid. Answers how many were hidden. */
114
+ showAllLayers() {
115
+ const count = this._hiddenLayerIds$.peek().size;
116
+ if (count)
117
+ this._commitLayers(new Set());
118
+ return count;
119
+ }
120
+ _commitLayers(next) {
121
+ this._hiddenLayerIds$.value = next;
122
+ this.std
123
+ .getOptional(EditPropsStore)
124
+ ?.setStorage('localHiddenLayers', [...next]);
125
+ }
126
+ _commit(next) {
127
+ this._hiddenIds$.value = next;
128
+ this.std
129
+ .getOptional(EditPropsStore)
130
+ ?.setStorage('localHiddenElements', [...next]);
131
+ }
132
+ mounted() {
133
+ super.mounted();
134
+ const gfx = this.std.get(GfxControllerIdentifier);
135
+ this._disposers.push(gfx.localVisibility.register(this._hiddenIds$));
136
+ this._disposers.push(gfx.localVisibility.registerLayers(this._hiddenLayerIds$));
137
+ this._restoreLayers();
138
+ const stored = this.std.getOptional(EditPropsStore)?.getStorage('localHiddenElements') ??
139
+ [];
140
+ if (!stored.length)
141
+ return;
142
+ // The surface may arrive after mount; prune the first time it is there.
143
+ let pruned = false;
144
+ const stop = effect(() => {
145
+ if (pruned || !gfx.surface$.value)
146
+ return;
147
+ pruned = true;
148
+ const kept = stored.filter(id => gfx.getElementById(id) !== null);
149
+ if (kept.length === stored.length) {
150
+ this._hiddenIds$.value = new Set(kept);
151
+ }
152
+ else {
153
+ this._commit(new Set(kept));
154
+ }
155
+ });
156
+ this._disposers.push(stop);
157
+ }
158
+ /**
159
+ * Restore the hidden layers, pruned of layers the surface no longer has —
160
+ * the first time the surface is there to ask.
161
+ */
162
+ _restoreLayers() {
163
+ const gfx = this.std.get(GfxControllerIdentifier);
164
+ const stored = this.std.getOptional(EditPropsStore)?.getStorage('localHiddenLayers') ??
165
+ [];
166
+ if (!stored.length)
167
+ return;
168
+ let pruned = false;
169
+ const stop = effect(() => {
170
+ const surface = gfx.surface$.value;
171
+ if (pruned || !surface)
172
+ return;
173
+ pruned = true;
174
+ const layers = surface.props.layers ?? {};
175
+ // The default layer exists with or without its record (ADR 0031
176
+ // amendments): a hide of it is never a layer the document lost.
177
+ const kept = stored.filter(id => id === DEFAULT_LAYER_ID || id in layers);
178
+ if (kept.length === stored.length) {
179
+ this._hiddenLayerIds$.value = new Set(kept);
180
+ }
181
+ else {
182
+ this._commitLayers(new Set(kept));
183
+ }
184
+ });
185
+ this._disposers.push(stop);
186
+ }
187
+ unmounted() {
188
+ this._disposers.forEach(dispose => dispose());
189
+ this._disposers = [];
190
+ super.unmounted();
191
+ }
192
+ }
@@ -47,6 +47,25 @@ declare const LocalPropsSchema: z.ZodObject<{
47
47
  presentNoFrameToastShown: z.ZodBoolean;
48
48
  autoHideEmbedHTMLFullScreenToolbar: z.ZodBoolean;
49
49
  connectorCenterAnchor: z.ZodDefault<z.ZodBoolean>;
50
+ /**
51
+ * The ids this viewer hid on this document's canvas (ADR 0031 §8). Per
52
+ * viewer and per document, like the viewport; never written to the
53
+ * document. Owned by `CanvasLocalVisibility`.
54
+ */
55
+ localHiddenElements: z.ZodArray<z.ZodString, "many">;
56
+ /**
57
+ * The user layers this viewer hid on this document's canvas (ADR 0031 §8,
58
+ * stage 7). Same owner, same key scheme, same lifetime as
59
+ * `localHiddenElements`; a separate key so the element list keeps the shape
60
+ * it already has in viewers' storage.
61
+ */
62
+ localHiddenLayers: z.ZodArray<z.ZodString, "many">;
63
+ /**
64
+ * This viewer's grid override on this document's canvas (ADR 0031 §11),
65
+ * keyed like the viewport. Absent = the document, the host or the library
66
+ * decides. Owned by `CanvasGrid`.
67
+ */
68
+ localShowGrid: z.ZodBoolean;
50
69
  }, "strip", z.ZodTypeAny, {
51
70
  viewport: {
52
71
  centerX: number;
@@ -62,6 +81,9 @@ declare const LocalPropsSchema: z.ZodObject<{
62
81
  presentNoFrameToastShown: boolean;
63
82
  autoHideEmbedHTMLFullScreenToolbar: boolean;
64
83
  connectorCenterAnchor: boolean;
84
+ localHiddenElements: string[];
85
+ localHiddenLayers: string[];
86
+ localShowGrid: boolean;
65
87
  }, {
66
88
  viewport: {
67
89
  centerX: number;
@@ -76,6 +98,9 @@ declare const LocalPropsSchema: z.ZodObject<{
76
98
  presentHideToolbar: boolean;
77
99
  presentNoFrameToastShown: boolean;
78
100
  autoHideEmbedHTMLFullScreenToolbar: boolean;
101
+ localHiddenElements: string[];
102
+ localHiddenLayers: string[];
103
+ localShowGrid: boolean;
79
104
  connectorCenterAnchor?: boolean | undefined;
80
105
  }>;
81
106
  type SessionProps = z.infer<typeof SessionPropsSchema>;
@@ -416,6 +441,8 @@ export declare class EditPropsStore extends LifeCycleWatcher {
416
441
  * session that turns read-only before unmounting stops writing too.
417
442
  */
418
443
  saveViewport(viewport: StorageProps['viewport']): void;
444
+ /** Forget a stored prop, so the next `getStorage` answers `null`. */
445
+ removeStorage(key: StoragePropsKey): void;
419
446
  setStorage<T extends StoragePropsKey>(key: T, value: StorageProps[T]): void;
420
447
  unmounted(): void;
421
448
  }
@@ -37,6 +37,25 @@ const LocalPropsSchema = z.object({
37
37
  presentNoFrameToastShown: z.boolean(),
38
38
  autoHideEmbedHTMLFullScreenToolbar: z.boolean(),
39
39
  connectorCenterAnchor: z.boolean().default(false),
40
+ /**
41
+ * The ids this viewer hid on this document's canvas (ADR 0031 §8). Per
42
+ * viewer and per document, like the viewport; never written to the
43
+ * document. Owned by `CanvasLocalVisibility`.
44
+ */
45
+ localHiddenElements: z.array(z.string()),
46
+ /**
47
+ * The user layers this viewer hid on this document's canvas (ADR 0031 §8,
48
+ * stage 7). Same owner, same key scheme, same lifetime as
49
+ * `localHiddenElements`; a separate key so the element list keeps the shape
50
+ * it already has in viewers' storage.
51
+ */
52
+ localHiddenLayers: z.array(z.string()),
53
+ /**
54
+ * This viewer's grid override on this document's canvas (ADR 0031 §11),
55
+ * keyed like the viewport. Absent = the document, the host or the library
56
+ * decides. Owned by `CanvasGrid`.
57
+ */
58
+ localShowGrid: z.boolean(),
40
59
  });
41
60
  function isLocalProp(key) {
42
61
  return key in LocalPropsSchema.shape;
@@ -45,6 +64,11 @@ function isSessionProp(key) {
45
64
  return key in SessionPropsSchema.shape;
46
65
  }
47
66
  function customizer(_target, source) {
67
+ // `mergeWith` assigns a primitive source as-is whatever the customizer says,
68
+ // so only an object can need one; skipping the schema parse for the rest is
69
+ // what keeps a paste of N elements from parsing every prop of every one.
70
+ if (source === null || typeof source !== 'object')
71
+ return;
48
72
  if (ColorSchema.safeParse(source).success ||
49
73
  source instanceof Y.Text ||
50
74
  source instanceof Y.Array ||
@@ -107,6 +131,12 @@ export class EditPropsStore extends LifeCycleWatcher {
107
131
  return 'blocksuite:embedHTML:autoHideFullScreenToolbar';
108
132
  case 'connectorCenterAnchor':
109
133
  return 'blocksuite:connector:centerAnchor';
134
+ case 'localHiddenElements':
135
+ return 'blocksuite:' + id + ':localHiddenElements';
136
+ case 'localHiddenLayers':
137
+ return 'blocksuite:' + id + ':localHiddenLayers';
138
+ case 'localShowGrid':
139
+ return 'blocksuite:' + id + ':localShowGrid';
110
140
  default:
111
141
  return key;
112
142
  }
@@ -171,6 +201,10 @@ export class EditPropsStore extends LifeCycleWatcher {
171
201
  return;
172
202
  this.setStorage('viewport', viewport);
173
203
  }
204
+ /** Forget a stored prop, so the next `getStorage` answers `null`. */
205
+ removeStorage(key) {
206
+ this._getStorage(key).removeItem(this._getStorageKey(key));
207
+ }
174
208
  setStorage(key, value) {
175
209
  const oldValue = this.getStorage(key);
176
210
  this._getStorage(key).setItem(this._getStorageKey(key), JSON.stringify(value));
@@ -5,6 +5,7 @@ import { z } from 'zod';
5
5
  export declare const GeneralSettingSchema: z.ZodObject<{
6
6
  edgelessScrollZoom: z.ZodDefault<z.ZodBoolean>;
7
7
  edgelessDisableScheduleUpdate: z.ZodDefault<z.ZodBoolean>;
8
+ edgelessShowGrid: z.ZodOptional<z.ZodBoolean>;
8
9
  docCanvasPreferView: z.ZodDefault<z.ZodEnum<["affine:embed-linked-doc", "affine:embed-synced-doc"]>>;
9
10
  } & {
10
11
  connector: z.ZodDefault<z.ZodObject<{
@@ -1479,6 +1480,7 @@ export declare const GeneralSettingSchema: z.ZodObject<{
1479
1480
  textHorizontalAlign?: import("../../affine-model/index.js").TextAlign | undefined;
1480
1481
  textVerticalAlign?: import("../../affine-model/index.js").TextVerticalAlign | undefined;
1481
1482
  };
1483
+ edgelessShowGrid?: boolean | undefined;
1482
1484
  }, {
1483
1485
  text?: {
1484
1486
  color: string | {
@@ -1512,6 +1514,7 @@ export declare const GeneralSettingSchema: z.ZodObject<{
1512
1514
  } | undefined;
1513
1515
  edgelessScrollZoom?: boolean | undefined;
1514
1516
  edgelessDisableScheduleUpdate?: boolean | undefined;
1517
+ edgelessShowGrid?: boolean | undefined;
1515
1518
  docCanvasPreferView?: "affine:embed-linked-doc" | "affine:embed-synced-doc" | undefined;
1516
1519
  connector?: {
1517
1520
  mode: import("../../affine-model/index.js").ConnectorMode;
@@ -5,6 +5,13 @@ export const GeneralSettingSchema = z
5
5
  .object({
6
6
  edgelessScrollZoom: z.boolean().default(false),
7
7
  edgelessDisableScheduleUpdate: z.boolean().default(false),
8
+ // The host's (or the user's) default for the canvas grid (ADR 0031 §11,
9
+ // level 3). No default on purpose: absent means the host did not decide,
10
+ // and the library default — on — applies. A viewer's own toggle and a
11
+ // document saved "for everyone" both win over it.
12
+ // A line comment, not JSDoc: see the guard in
13
+ // `affine/all/src/__tests__/zod-schema-jsdoc.unit.spec.ts`.
14
+ edgelessShowGrid: z.boolean().optional(),
8
15
  docCanvasPreferView: z
9
16
  .enum(['affine:embed-linked-doc', 'affine:embed-synced-doc'])
10
17
  .default('affine:embed-synced-doc'),
@@ -14,6 +14,10 @@ export interface BlockSuiteFlags {
14
14
  enable_mobile_keyboard_toolbar: boolean;
15
15
  enable_mobile_linked_doc_menu: boolean;
16
16
  enable_block_meta: boolean;
17
+ /**
18
+ * @deprecated No longer read: the Callout entries follow the `callout` key
19
+ * of `OPTIONAL_BLOCKS` alone, so `{ callout: false }` is the switch.
20
+ */
17
21
  enable_callout: boolean;
18
22
  enable_edgeless_scribbled_style: boolean;
19
23
  enable_table_virtual_scroll: boolean;
@@ -2,6 +2,8 @@ export * from './artefact-catalogue-service.js';
2
2
  export * from './audit-service.js';
3
3
  export * from './auto-clear-selection-service.js';
4
4
  export * from './block-meta-service.js';
5
+ export * from './canvas-grid.js';
6
+ export * from './canvas-local-visibility.js';
5
7
  export * from './citation-service/index.js';
6
8
  export * from './command-usage-service.js';
7
9
  export * from './comment-service/index.js';
@@ -28,6 +30,7 @@ export * from './parse-url-service.js';
28
30
  export * from './pivot-materiality-publisher.js';
29
31
  export * from './pivot-properties-service.js';
30
32
  export * from './quick-search-service.js';
33
+ export * from './selection-pane-service.js';
31
34
  export * from './sidebar-service.js';
32
35
  export * from './telemetry-service/index.js';
33
36
  export * from './theme-service.js';
@@ -2,6 +2,8 @@ export * from './artefact-catalogue-service.js';
2
2
  export * from './audit-service.js';
3
3
  export * from './auto-clear-selection-service.js';
4
4
  export * from './block-meta-service.js';
5
+ export * from './canvas-grid.js';
6
+ export * from './canvas-local-visibility.js';
5
7
  export * from './citation-service/index.js';
6
8
  export * from './command-usage-service.js';
7
9
  export * from './comment-service/index.js';
@@ -28,6 +30,7 @@ export * from './parse-url-service.js';
28
30
  export * from './pivot-materiality-publisher.js';
29
31
  export * from './pivot-properties-service.js';
30
32
  export * from './quick-search-service.js';
33
+ export * from './selection-pane-service.js';
31
34
  export * from './sidebar-service.js';
32
35
  export * from './telemetry-service/index.js';
33
36
  export * from './theme-service.js';
@@ -0,0 +1,44 @@
1
+ import type { ExtensionType } from '../../store/index.js';
2
+ /**
3
+ * The selection pane (ADR 0031 §12): a list of the canvas elements by z-order,
4
+ * top first, with groups, lock, a filter by frame, and
5
+ * drag-to-reorder — PowerPoint's pane, on a Labre canvas.
6
+ *
7
+ * The seam is shaped exactly like `ArtefactCatalogueService`, and was
8
+ * challenged against it first: the catalogue's `open(owner)` is scoped to a
9
+ * framework, and stretching it to a second panel would have changed the
10
+ * signature of a shipped seam. So one more seam, two verbs, nothing else.
11
+ *
12
+ * Everything a pane draws is enumerable from the library without this seam:
13
+ * the rows from `selectionPaneTree(std)` (ids only, z-order, top first), the
14
+ * wordings from the element and the translation seam, and every action from
15
+ * the command registry (`canvas.element.reorder`, `canvas.element.lock`,
16
+ * `canvas.element.unlock`, `canvas.group.rename`), run through `runCommand`
17
+ * so the read-only check and the telemetry happen once whoever draws the
18
+ * pixels.
19
+ */
20
+ export interface SelectionPaneService {
21
+ /** Show the pane. */
22
+ open(): void;
23
+ /** Put it away. Writes nothing. */
24
+ close(): void;
25
+ }
26
+ export declare const SelectionPaneProvider: import("../../global/di/types.js").ServiceIdentifier<SelectionPaneService> & (<U extends SelectionPaneService = SelectionPaneService>(variant: import("../../global/di/types.js").ServiceVariant) => import("../../global/di/types.js").ServiceIdentifier<U>);
27
+ /**
28
+ * Host override seam: replace the library's pane with the host's own — or
29
+ * switch it off entirely.
30
+ *
31
+ * **Replace** — a host with its own sidebar registers this extension; its
32
+ * implementation answers {@link SelectionPaneProvider}, the edgeless toolbar's
33
+ * button and the `canvas.selectionPane.toggle` command then call it, and the
34
+ * library's panel is never asked to open.
35
+ *
36
+ * **Disable** — pass `null`. The provider answers nothing: the toolbar button
37
+ * is not rendered and the toggle command is unavailable, because a control
38
+ * that opens nothing is a lie. A cold-assembly switch, decided when the editor
39
+ * is put together (ADR 0031 §13: no flag key for it).
40
+ *
41
+ * `di.override`, like `ArtefactCatalogueExtension`, so a host registering
42
+ * after the library's own default always wins.
43
+ */
44
+ export declare function SelectionPaneExtension(service: SelectionPaneService | null): ExtensionType;
@@ -0,0 +1,28 @@
1
+ import { createIdentifier } from '../../global/di/index.js';
2
+ export const SelectionPaneProvider = createIdentifier('AffineSelectionPane');
3
+ /**
4
+ * Host override seam: replace the library's pane with the host's own — or
5
+ * switch it off entirely.
6
+ *
7
+ * **Replace** — a host with its own sidebar registers this extension; its
8
+ * implementation answers {@link SelectionPaneProvider}, the edgeless toolbar's
9
+ * button and the `canvas.selectionPane.toggle` command then call it, and the
10
+ * library's panel is never asked to open.
11
+ *
12
+ * **Disable** — pass `null`. The provider answers nothing: the toolbar button
13
+ * is not rendered and the toggle command is unavailable, because a control
14
+ * that opens nothing is a lie. A cold-assembly switch, decided when the editor
15
+ * is put together (ADR 0031 §13: no flag key for it).
16
+ *
17
+ * `di.override`, like `ArtefactCatalogueExtension`, so a host registering
18
+ * after the library's own default always wins.
19
+ */
20
+ export function SelectionPaneExtension(service) {
21
+ return {
22
+ setup: di => {
23
+ // `null` rides through the factory on purpose: `getOptional` then
24
+ // reports the pane as absent, which is the whole disable story.
25
+ di.override(SelectionPaneProvider, () => service);
26
+ },
27
+ };
28
+ }