@formicoidea/labre-core 0.42.0 → 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 (367) 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-data-view/configs/tooltips.js +1 -1
  17. package/dist/_pkgs/affine-block-database/configs/tooltips.js +1 -1
  18. package/dist/_pkgs/affine-block-edgeless-text/edgeless-text-block.js +4 -2
  19. package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/config.d.ts +11 -0
  20. package/dist/_pkgs/affine-block-edgeless-text/svg-painter.d.ts +20 -0
  21. package/dist/_pkgs/affine-block-edgeless-text/svg-painter.js +76 -0
  22. package/dist/_pkgs/affine-block-edgeless-text/view.js +2 -0
  23. package/dist/_pkgs/affine-block-embed/common/iframe-sandbox.d.ts +39 -0
  24. package/dist/_pkgs/affine-block-embed/common/iframe-sandbox.js +39 -0
  25. package/dist/_pkgs/affine-block-embed/configs/toolbar.js +11 -2
  26. package/dist/_pkgs/affine-block-embed/embed-figma-block/embed-figma-block.js +2 -0
  27. package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-error-card.d.ts +14 -1
  28. package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-error-card.js +21 -2
  29. package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.js +11 -2
  30. package/dist/_pkgs/affine-block-embed/embed-iframe-block/consts.d.ts +0 -2
  31. package/dist/_pkgs/affine-block-embed/embed-iframe-block/consts.js +2 -5
  32. package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.d.ts +1 -1
  33. package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.js +14 -6
  34. package/dist/_pkgs/affine-block-embed/embed-iframe-block/types.d.ts +16 -0
  35. package/dist/_pkgs/affine-block-embed/embed-iframe-block/types.js +17 -1
  36. package/dist/_pkgs/affine-block-embed/embed-loom-block/embed-loom-block.js +2 -0
  37. package/dist/_pkgs/affine-block-embed/embed-youtube-block/embed-youtube-block.js +2 -0
  38. package/dist/_pkgs/affine-block-embed/index.d.ts +1 -0
  39. package/dist/_pkgs/affine-block-embed/index.js +1 -0
  40. package/dist/_pkgs/affine-block-embed/translations.d.ts +8 -0
  41. package/dist/_pkgs/affine-block-embed/translations.js +28 -0
  42. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-edgeless-linked-doc-block.js +3 -1
  43. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-linked-doc-block.js +4 -2
  44. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/configs/toolbar.js +7 -2
  45. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-edgeless-synced-doc-block.js +3 -1
  46. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-synced-doc-block.js +2 -2
  47. package/dist/_pkgs/affine-block-frame/frame-manager.d.ts +5 -0
  48. package/dist/_pkgs/affine-block-frame/frame-manager.js +53 -19
  49. package/dist/_pkgs/affine-block-frame/frame-tool.js +3 -1
  50. package/dist/_pkgs/affine-block-image/utils.js +4 -1
  51. package/dist/_pkgs/affine-block-latex/adapters/markdown/preprocessor.d.ts +8 -0
  52. package/dist/_pkgs/affine-block-latex/adapters/markdown/preprocessor.js +9 -5
  53. package/dist/_pkgs/affine-block-list/utils/get-list-icon.js +3 -1
  54. package/dist/_pkgs/affine-block-note/configs/tooltips.js +1 -1
  55. package/dist/_pkgs/affine-block-note/translations.d.ts +0 -1
  56. package/dist/_pkgs/affine-block-note/translations.js +0 -5
  57. package/dist/_pkgs/affine-block-root/adapters/html.js +2 -2
  58. package/dist/_pkgs/affine-block-root/commands/copy-link-commands.d.ts +2 -0
  59. package/dist/_pkgs/affine-block-root/commands/copy-link-commands.js +155 -0
  60. package/dist/_pkgs/affine-block-root/configs/toolbar.js +17 -1
  61. package/dist/_pkgs/affine-block-root/edgeless/clipboard/clipboard.js +2 -1
  62. package/dist/_pkgs/affine-block-root/edgeless/clipboard/command.js +161 -83
  63. package/dist/_pkgs/affine-block-root/edgeless/clipboard/paste-order.d.ts +21 -0
  64. package/dist/_pkgs/affine-block-root/edgeless/clipboard/paste-order.js +85 -0
  65. package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.d.ts +6 -0
  66. package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.js +18 -1
  67. package/dist/_pkgs/affine-block-root/edgeless/utils/clone-utils.d.ts +9 -0
  68. package/dist/_pkgs/affine-block-root/edgeless/utils/clone-utils.js +28 -0
  69. package/dist/_pkgs/affine-block-root/index.d.ts +1 -0
  70. package/dist/_pkgs/affine-block-root/index.js +1 -0
  71. package/dist/_pkgs/affine-block-root/keyboard/commands.js +9 -6
  72. package/dist/_pkgs/affine-block-root/preview/edgeless-root-preview-block.js +15 -2
  73. package/dist/_pkgs/affine-block-root/view.js +2 -0
  74. package/dist/_pkgs/affine-block-surface/adapters/markdown/element-adapter/type.d.ts +1 -1
  75. package/dist/_pkgs/affine-block-surface/element-model/index.d.ts +1 -1
  76. package/dist/_pkgs/affine-block-surface/element-model/index.js +1 -1
  77. package/dist/_pkgs/affine-block-surface/extensions/audit.js +13 -61
  78. package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/commands.d.ts +2 -0
  79. package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/commands.js +71 -0
  80. package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/index.d.ts +1 -0
  81. package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/index.js +1 -0
  82. package/dist/_pkgs/affine-block-surface/extensions/clipboard-config.js +4 -0
  83. package/dist/_pkgs/affine-block-surface/extensions/crud-extension.js +4 -0
  84. package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.d.ts +12 -0
  85. package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.js +27 -7
  86. package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.d.ts +2 -1
  87. package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.js +22 -3
  88. package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.d.ts +6 -3
  89. package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.js +4 -2
  90. package/dist/_pkgs/affine-block-surface/extensions/export-svg/parts.d.ts +63 -0
  91. package/dist/_pkgs/affine-block-surface/extensions/export-svg/parts.js +67 -0
  92. package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.d.ts +62 -5
  93. package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.js +98 -18
  94. package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.d.ts +14 -0
  95. package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.js +82 -1
  96. package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.d.ts +2 -2
  97. package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.js +112 -10
  98. package/dist/_pkgs/affine-block-surface/extensions/export-svg/translations.d.ts +13 -0
  99. package/dist/_pkgs/affine-block-surface/extensions/export-svg/translations.js +33 -0
  100. package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +3 -0
  101. package/dist/_pkgs/affine-block-surface/extensions/index.js +3 -0
  102. package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +13 -1
  103. package/dist/_pkgs/affine-block-surface/extensions/legend.d.ts +8 -0
  104. package/dist/_pkgs/affine-block-surface/extensions/legend.js +59 -3
  105. package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.js +4 -0
  106. package/dist/_pkgs/affine-block-surface/extensions/reading-widget.d.ts +13 -6
  107. package/dist/_pkgs/affine-block-surface/extensions/reading-widget.js +26 -10
  108. package/dist/_pkgs/affine-block-surface/extensions/reading.d.ts +82 -6
  109. package/dist/_pkgs/affine-block-surface/extensions/reading.js +99 -21
  110. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/actions.d.ts +80 -0
  111. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/actions.js +248 -0
  112. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/commands.d.ts +82 -0
  113. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/commands.js +342 -0
  114. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/index.d.ts +3 -0
  115. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/index.js +3 -0
  116. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/tree.d.ts +137 -0
  117. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/tree.js +323 -0
  118. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.d.ts +3 -0
  119. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.js +23 -0
  120. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.d.ts +112 -4
  121. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +98 -19
  122. package/dist/_pkgs/affine-block-surface/extensions/user-layers/actions.d.ts +76 -0
  123. package/dist/_pkgs/affine-block-surface/extensions/user-layers/actions.js +299 -0
  124. package/dist/_pkgs/affine-block-surface/extensions/user-layers/active-layer.d.ts +20 -0
  125. package/dist/_pkgs/affine-block-surface/extensions/user-layers/active-layer.js +34 -0
  126. package/dist/_pkgs/affine-block-surface/extensions/user-layers/commands.d.ts +67 -0
  127. package/dist/_pkgs/affine-block-surface/extensions/user-layers/commands.js +172 -0
  128. package/dist/_pkgs/affine-block-surface/extensions/user-layers/creation.d.ts +40 -0
  129. package/dist/_pkgs/affine-block-surface/extensions/user-layers/creation.js +69 -0
  130. package/dist/_pkgs/affine-block-surface/extensions/user-layers/index.d.ts +5 -0
  131. package/dist/_pkgs/affine-block-surface/extensions/user-layers/index.js +5 -0
  132. package/dist/_pkgs/affine-block-surface/extensions/user-layers/translations.d.ts +10 -0
  133. package/dist/_pkgs/affine-block-surface/extensions/user-layers/translations.js +14 -0
  134. package/dist/_pkgs/affine-block-surface/framework-background/background-view.js +1 -1
  135. package/dist/_pkgs/affine-block-surface/framework-background/facts.d.ts +55 -2
  136. package/dist/_pkgs/affine-block-surface/framework-background/facts.js +63 -1
  137. package/dist/_pkgs/affine-block-surface/framework-background/fit.d.ts +36 -0
  138. package/dist/_pkgs/affine-block-surface/framework-background/fit.js +30 -0
  139. package/dist/_pkgs/affine-block-surface/framework-background/index.d.ts +1 -0
  140. package/dist/_pkgs/affine-block-surface/framework-background/index.js +1 -0
  141. package/dist/_pkgs/affine-block-surface/framework-background/stacking.d.ts +16 -8
  142. package/dist/_pkgs/affine-block-surface/framework-background/stacking.js +26 -14
  143. package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.js +17 -3
  144. package/dist/_pkgs/affine-block-surface/renderer/dom-renderer.d.ts +3 -1
  145. package/dist/_pkgs/affine-block-surface/renderer/dom-renderer.js +22 -2
  146. package/dist/_pkgs/affine-block-surface/renderer/element-highlight-overlay.js +2 -7
  147. package/dist/_pkgs/affine-block-surface/renderer/paint-predicate.d.ts +30 -0
  148. package/dist/_pkgs/affine-block-surface/renderer/paint-predicate.js +29 -0
  149. package/dist/_pkgs/affine-block-surface/surface-block.js +6 -0
  150. package/dist/_pkgs/affine-block-surface/surface-model.js +5 -0
  151. package/dist/_pkgs/affine-block-surface/surface-transformer.js +5 -0
  152. package/dist/_pkgs/affine-block-surface/tool/default-tool.js +28 -5
  153. package/dist/_pkgs/affine-block-surface/view.js +23 -1
  154. package/dist/_pkgs/affine-block-surface-ref/configs/tooltips.js +2 -2
  155. package/dist/_pkgs/affine-block-surface-ref/surface-ref-block.js +12 -2
  156. package/dist/_pkgs/affine-components/color-picker/palette-carousel.js +5 -0
  157. package/dist/_pkgs/affine-components/color-picker/styles.js +1 -1
  158. package/dist/_pkgs/affine-components/context-menu/button.js +17 -1
  159. package/dist/_pkgs/affine-components/filterable-list/index.js +30 -9
  160. package/dist/_pkgs/affine-components/icons/ai.js +3 -3
  161. package/dist/_pkgs/affine-components/icons/index.d.ts +0 -1
  162. package/dist/_pkgs/affine-components/icons/index.js +0 -1
  163. package/dist/_pkgs/affine-components/icons/list.js +7 -1
  164. package/dist/_pkgs/affine-components/icons/text.d.ts +1 -0
  165. package/dist/_pkgs/affine-components/icons/text.js +11 -0
  166. package/dist/_pkgs/affine-components/size-dropdown-menu/dropdown-menu.js +6 -1
  167. package/dist/_pkgs/affine-components/toolbar/index.d.ts +1 -1
  168. package/dist/_pkgs/affine-components/toolbar/index.js +1 -1
  169. package/dist/_pkgs/affine-components/toolbar/menu-button.d.ts +7 -0
  170. package/dist/_pkgs/affine-components/toolbar/menu-button.js +30 -0
  171. package/dist/_pkgs/affine-components/toolbar/picker-menu.d.ts +16 -1
  172. package/dist/_pkgs/affine-components/toolbar/picker-menu.js +2 -2
  173. package/dist/_pkgs/affine-components/toolbar/toolbar.d.ts +1 -0
  174. package/dist/_pkgs/affine-components/toolbar/toolbar.js +67 -0
  175. package/dist/_pkgs/affine-fragment-adapter-panel/adapter-panel.d.ts +2 -2
  176. package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card-title-editor.js +1 -1
  177. package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card.js +3 -3
  178. package/dist/_pkgs/affine-fragment-frame-panel/header/frame-panel-header.d.ts +1 -1
  179. package/dist/_pkgs/affine-fragment-frame-panel/header/frame-panel-header.js +8 -27
  180. package/dist/_pkgs/affine-fragment-frame-panel/index.d.ts +1 -0
  181. package/dist/_pkgs/affine-fragment-frame-panel/index.js +1 -0
  182. package/dist/_pkgs/affine-gfx-brush/toolbar/components/eraser/icons.js +1 -1
  183. package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.d.ts +11 -2
  184. package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.js +11 -2
  185. package/dist/_pkgs/affine-gfx-connector/element-renderer/connector-dom/index.js +3 -1
  186. package/dist/_pkgs/affine-gfx-connector/element-renderer/index.js +21 -4
  187. package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.js +6 -4
  188. package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +24 -8
  189. package/dist/_pkgs/affine-gfx-connector/translations.d.ts +3 -0
  190. package/dist/_pkgs/affine-gfx-connector/translations.js +23 -0
  191. package/dist/_pkgs/affine-gfx-group/command/group-api.js +52 -1
  192. package/dist/_pkgs/affine-gfx-mindmap/indicator-overlay/index.js +6 -2
  193. package/dist/_pkgs/affine-gfx-mindmap/toolbar/config.js +4 -2
  194. package/dist/_pkgs/affine-gfx-mindmap/translations.d.ts +6 -0
  195. package/dist/_pkgs/affine-gfx-mindmap/translations.js +10 -0
  196. package/dist/_pkgs/affine-gfx-shape/element-renderer/shape/index.js +21 -3
  197. package/dist/_pkgs/affine-gfx-shape/text/edgeless-shape-text-editor.js +2 -0
  198. package/dist/_pkgs/affine-gfx-shape/toolbar/config.js +5 -3
  199. package/dist/_pkgs/affine-gfx-shape/translations.d.ts +7 -0
  200. package/dist/_pkgs/affine-gfx-shape/translations.js +11 -0
  201. package/dist/_pkgs/affine-gfx-template/builtin/other.js +13 -7
  202. package/dist/_pkgs/affine-gfx-template/services/template-middlewares.d.ts +9 -0
  203. package/dist/_pkgs/affine-gfx-template/services/template-middlewares.js +23 -1
  204. package/dist/_pkgs/affine-gfx-template/services/template.js +2 -1
  205. package/dist/_pkgs/affine-gfx-template/toolbar/template-loading.js +1 -1
  206. package/dist/_pkgs/affine-gfx-template/translations.d.ts +5 -0
  207. package/dist/_pkgs/affine-gfx-template/translations.js +38 -0
  208. package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.js +5 -3
  209. package/dist/_pkgs/affine-gfx-text/element-renderer/index.js +20 -3
  210. package/dist/_pkgs/affine-gfx-text/element-renderer/utils.d.ts +67 -1
  211. package/dist/_pkgs/affine-gfx-text/element-renderer/utils.js +101 -0
  212. package/dist/_pkgs/affine-gfx-text/toolbar/actions.d.ts +11 -0
  213. package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +56 -3
  214. package/dist/_pkgs/affine-gfx-text/toolbar/config.d.ts +11 -0
  215. package/dist/_pkgs/affine-gfx-text/toolbar/config.js +1 -1
  216. package/dist/_pkgs/affine-gfx-text/translations.d.ts +8 -0
  217. package/dist/_pkgs/affine-gfx-text/translations.js +12 -0
  218. package/dist/_pkgs/affine-inline-latex/latex-node/latex-editor-menu.js +2 -1
  219. package/dist/_pkgs/affine-inline-preset/adapters/html/html-inline.d.ts +3 -0
  220. package/dist/_pkgs/affine-inline-preset/adapters/html/html-inline.js +31 -0
  221. package/dist/_pkgs/affine-inline-preset/adapters/html/inline-delta.d.ts +4 -0
  222. package/dist/_pkgs/affine-inline-preset/adapters/html/inline-delta.js +14 -0
  223. package/dist/_pkgs/affine-inline-preset/command/config.js +21 -3
  224. package/dist/_pkgs/affine-inline-preset/command/index.d.ts +1 -1
  225. package/dist/_pkgs/affine-inline-preset/command/index.js +1 -1
  226. package/dist/_pkgs/affine-inline-preset/command/text-style.d.ts +2 -1
  227. package/dist/_pkgs/affine-inline-preset/command/text-style.js +1 -0
  228. package/dist/_pkgs/affine-inline-preset/default-inline-manager.js +2 -1
  229. package/dist/_pkgs/affine-inline-preset/inline-spec.d.ts +4 -0
  230. package/dist/_pkgs/affine-inline-preset/inline-spec.js +14 -0
  231. package/dist/_pkgs/affine-inline-preset/translations.d.ts +2 -2
  232. package/dist/_pkgs/affine-inline-preset/translations.js +2 -2
  233. package/dist/_pkgs/affine-model/blocks/attachment/attachment-model.js +2 -0
  234. package/dist/_pkgs/affine-model/blocks/bookmark/bookmark-model.js +2 -0
  235. package/dist/_pkgs/affine-model/blocks/edgeless-text/edgeless-text-model.d.ts +1 -1
  236. package/dist/_pkgs/affine-model/blocks/edgeless-text/edgeless-text-model.js +2 -0
  237. package/dist/_pkgs/affine-model/blocks/embed/iframe/iframe-model.js +2 -0
  238. package/dist/_pkgs/affine-model/blocks/frame/frame-model.js +2 -0
  239. package/dist/_pkgs/affine-model/blocks/image/image-model.js +2 -0
  240. package/dist/_pkgs/affine-model/blocks/latex/latex-model.js +2 -0
  241. package/dist/_pkgs/affine-model/blocks/note/note-model.js +2 -0
  242. package/dist/_pkgs/affine-model/consts/text.d.ts +41 -2
  243. package/dist/_pkgs/affine-model/consts/text.js +50 -1
  244. package/dist/_pkgs/affine-model/elements/shape/shape.d.ts +6 -1
  245. package/dist/_pkgs/affine-model/elements/shape/shape.js +14 -1
  246. package/dist/_pkgs/affine-model/elements/text/text.d.ts +6 -1
  247. package/dist/_pkgs/affine-model/elements/text/text.js +13 -1
  248. package/dist/_pkgs/affine-model/utils/helper.js +2 -0
  249. package/dist/_pkgs/affine-rich-text/conversion.d.ts +25 -0
  250. package/dist/_pkgs/affine-rich-text/conversion.js +9 -0
  251. package/dist/_pkgs/affine-rich-text/index.d.ts +1 -1
  252. package/dist/_pkgs/affine-rich-text/index.js +1 -1
  253. package/dist/_pkgs/affine-shared/commands/model-crud/replace-selected-text-with-blocks.d.ts +1 -1
  254. package/dist/_pkgs/affine-shared/services/canvas-grid.d.ts +63 -0
  255. package/dist/_pkgs/affine-shared/services/canvas-grid.js +109 -0
  256. package/dist/_pkgs/affine-shared/services/canvas-local-visibility.d.ts +64 -0
  257. package/dist/_pkgs/affine-shared/services/canvas-local-visibility.js +192 -0
  258. package/dist/_pkgs/affine-shared/services/edit-props-store.d.ts +27 -0
  259. package/dist/_pkgs/affine-shared/services/edit-props-store.js +34 -0
  260. package/dist/_pkgs/affine-shared/services/editor-setting-service.d.ts +3 -0
  261. package/dist/_pkgs/affine-shared/services/editor-setting-service.js +7 -0
  262. package/dist/_pkgs/affine-shared/services/feature-flag-service.d.ts +4 -0
  263. package/dist/_pkgs/affine-shared/services/font-loader/config.d.ts +13 -2
  264. package/dist/_pkgs/affine-shared/services/font-loader/config.js +43 -54
  265. package/dist/_pkgs/affine-shared/services/index.d.ts +3 -0
  266. package/dist/_pkgs/affine-shared/services/index.js +3 -0
  267. package/dist/_pkgs/affine-shared/services/selection-pane-service.d.ts +44 -0
  268. package/dist/_pkgs/affine-shared/services/selection-pane-service.js +28 -0
  269. package/dist/_pkgs/affine-shared/services/telemetry-service/lifecycle.d.ts +69 -0
  270. package/dist/_pkgs/affine-shared/services/telemetry-service/telemetry-service.d.ts +2 -2
  271. package/dist/_pkgs/affine-shared/services/theme-service.d.ts +19 -0
  272. package/dist/_pkgs/affine-shared/services/theme-service.js +24 -0
  273. package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +25 -0
  274. package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +90 -0
  275. package/dist/_pkgs/affine-shared/styles/index.d.ts +1 -0
  276. package/dist/_pkgs/affine-shared/styles/index.js +1 -0
  277. package/dist/_pkgs/affine-shared/styles/panel-header.d.ts +31 -0
  278. package/dist/_pkgs/affine-shared/styles/panel-header.js +61 -0
  279. package/dist/_pkgs/affine-shared/styles/text.js +7 -7
  280. package/dist/_pkgs/affine-shared/types/index.d.ts +6 -0
  281. package/dist/_pkgs/affine-shared/utils/canvas-export-colors.d.ts +26 -0
  282. package/dist/_pkgs/affine-shared/utils/canvas-export-colors.js +127 -0
  283. package/dist/_pkgs/affine-shared/utils/file/filesys.d.ts +8 -11
  284. package/dist/_pkgs/affine-shared/utils/file/filesys.js +8 -11
  285. package/dist/_pkgs/affine-shared/utils/index.d.ts +2 -0
  286. package/dist/_pkgs/affine-shared/utils/index.js +2 -0
  287. package/dist/_pkgs/affine-shared/utils/label-mode.d.ts +47 -0
  288. package/dist/_pkgs/affine-shared/utils/label-mode.js +55 -0
  289. package/dist/_pkgs/affine-shared/utils/model/merge-to-code-model.js +7 -1
  290. package/dist/_pkgs/affine-shared/utils/model/transform-model.js +5 -0
  291. package/dist/_pkgs/affine-widget-edgeless-dragging-area/edgeless-dragging-area-rect.js +2 -2
  292. package/dist/_pkgs/affine-widget-edgeless-selected-rect/utils.js +15 -4
  293. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.js +25 -49
  294. package/dist/_pkgs/affine-widget-edgeless-toolbar/config/types.d.ts +15 -0
  295. package/dist/_pkgs/affine-widget-edgeless-toolbar/config/utils.d.ts +1 -1
  296. package/dist/_pkgs/affine-widget-edgeless-toolbar/config/utils.js +7 -2
  297. package/dist/_pkgs/affine-widget-edgeless-toolbar/effects.d.ts +4 -0
  298. package/dist/_pkgs/affine-widget-edgeless-toolbar/effects.js +4 -0
  299. package/dist/_pkgs/affine-widget-edgeless-toolbar/index.d.ts +4 -0
  300. package/dist/_pkgs/affine-widget-edgeless-toolbar/index.js +4 -0
  301. package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-family-panel.d.ts +18 -0
  302. package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-family-panel.js +52 -6
  303. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/drop.d.ts +61 -0
  304. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/drop.js +91 -0
  305. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/labels.d.ts +17 -0
  306. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/labels.js +95 -0
  307. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-default.d.ts +10 -0
  308. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-default.js +31 -0
  309. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-tool.d.ts +26 -0
  310. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-tool.js +82 -0
  311. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-widget.d.ts +170 -0
  312. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-widget.js +1381 -0
  313. package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.d.ts +58 -0
  314. package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.js +171 -1
  315. package/dist/_pkgs/affine-widget-edgeless-toolbar/view.js +10 -0
  316. package/dist/_pkgs/affine-widget-frame-title/edgeless-frame-title-editor.js +2 -1
  317. package/dist/_pkgs/affine-widget-note-slicer/note-slicer.js +7 -3
  318. package/dist/_pkgs/affine-widget-slash-menu/translations.d.ts +16 -0
  319. package/dist/_pkgs/affine-widget-slash-menu/translations.js +23 -1
  320. package/dist/_pkgs/affine-widget-toolbar/utils.js +57 -14
  321. package/dist/_pkgs/data-view/core/detail/field.js +2 -1
  322. package/dist/_pkgs/data-view/core/filter/literal/define.js +3 -1
  323. package/dist/_pkgs/data-view/core/group-by/renderer/boolean-group.js +1 -1
  324. package/dist/_pkgs/data-view/property-presets/checkbox/cell-renderer.js +8 -2
  325. package/dist/_pkgs/data-view/view-presets/kanban/pc/cell.js +1 -1
  326. package/dist/_pkgs/data-view/view-presets/kanban/pc/controller/drag.js +2 -1
  327. package/dist/_pkgs/data-view/view-presets/table/pc/controller/drag.js +2 -1
  328. package/dist/_pkgs/data-view/view-presets/table/pc/controller/selection.js +1 -1
  329. package/dist/_pkgs/data-view/view-presets/table/pc/header/vertical-indicator.js +2 -1
  330. package/dist/_pkgs/data-view/view-presets/table/pc/row/row-select-checkbox.js +3 -1
  331. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/drag.js +2 -1
  332. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/selection.js +1 -1
  333. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/top/header/vertical-indicator.js +2 -1
  334. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/row/row-header.js +3 -1
  335. package/dist/_pkgs/std/gfx/controller.d.ts +13 -0
  336. package/dist/_pkgs/std/gfx/controller.js +22 -2
  337. package/dist/_pkgs/std/gfx/grid.d.ts +31 -2
  338. package/dist/_pkgs/std/gfx/index.d.ts +3 -1
  339. package/dist/_pkgs/std/gfx/index.js +3 -1
  340. package/dist/_pkgs/std/gfx/interactivity/manager.js +7 -0
  341. package/dist/_pkgs/std/gfx/layer.js +73 -5
  342. package/dist/_pkgs/std/gfx/local-visibility.d.ts +88 -0
  343. package/dist/_pkgs/std/gfx/local-visibility.js +217 -0
  344. package/dist/_pkgs/std/gfx/model/gfx-block-model.d.ts +13 -0
  345. package/dist/_pkgs/std/gfx/model/surface/element-model.d.ts +34 -0
  346. package/dist/_pkgs/std/gfx/model/surface/element-model.js +65 -1
  347. package/dist/_pkgs/std/gfx/model/surface/role.d.ts +10 -5
  348. package/dist/_pkgs/std/gfx/model/surface/surface-model.d.ts +27 -0
  349. package/dist/_pkgs/std/gfx/model/surface/surface-model.js +43 -0
  350. package/dist/_pkgs/std/gfx/model/surface/user-layers.d.ts +68 -0
  351. package/dist/_pkgs/std/gfx/model/surface/user-layers.js +127 -0
  352. package/dist/_pkgs/std/utils/layer.d.ts +10 -0
  353. package/dist/_pkgs/std/utils/layer.js +64 -13
  354. package/dist/_pkgs/std/view/element/gfx-block-component.js +10 -2
  355. package/dist/commands.js +6 -2
  356. package/dist/translations.js +15 -6
  357. package/package.json +13 -2
  358. package/dist/_pkgs/affine-components/icons/file-icons-rc.d.ts +0 -1
  359. package/dist/_pkgs/affine-components/icons/file-icons-rc.js +0 -130
  360. package/dist/_pkgs/affine-shared/test-utils/affine-template.d.ts +0 -6
  361. package/dist/_pkgs/affine-shared/test-utils/affine-template.js +0 -258
  362. package/dist/_pkgs/affine-shared/test-utils/affine-test-utils.d.ts +0 -8
  363. package/dist/_pkgs/affine-shared/test-utils/affine-test-utils.js +0 -81
  364. package/dist/_pkgs/affine-shared/test-utils/create-test-host.d.ts +0 -23
  365. package/dist/_pkgs/affine-shared/test-utils/create-test-host.js +0 -187
  366. package/dist/_pkgs/affine-shared/test-utils/index.d.ts +0 -3
  367. package/dist/_pkgs/affine-shared/test-utils/index.js +0 -3
@@ -11,5 +11,63 @@ import { type ChromeWording } from '../affine-shared/services/index.js';
11
11
  */
12
12
  export declare const EDGELESS_TOOLBAR_COMING_SOON: ChromeWording;
13
13
  export declare const EDGELESS_TOOLBAR_MORE_TOOLS: ChromeWording;
14
+ /**
15
+ * A family the element still carries but the host no longer configures
16
+ * (#396): the font picker keeps its name, greyed, with this mark. `{{name}}`
17
+ * is the family name, a proper name the host does not translate.
18
+ */
19
+ export declare const EDGELESS_TOOLBAR_FONT_FAMILY_UNAVAILABLE: ChromeWording;
20
+ /** The pane's title, and the toolbar button's tooltip. */
21
+ export declare const SELECTION_PANE_TITLE: ChromeWording;
22
+ /**
23
+ * The catalogue's own "Close": the same word on the same kind of side panel,
24
+ * so one key (L7 dedupe: one chrome word, one key). The manifest already
25
+ * declares it for the catalogue, so it is not listed again below.
26
+ */
27
+ export declare const SELECTION_PANE_CLOSE: ChromeWording;
28
+ /** What the pane says on a canvas with nothing on it, or nothing filtered. */
29
+ export declare const SELECTION_PANE_EMPTY: ChromeWording;
30
+ export declare const SELECTION_PANE_FILTER: ChromeWording;
31
+ /** The filter entry that shows every element again. */
32
+ export declare const SELECTION_PANE_FILTER_ALL: ChromeWording;
33
+ /** A frame offered by the filter; `{{name}}` is the frame's own title. */
34
+ export declare const SELECTION_PANE_FILTER_FRAME: ChromeWording;
35
+ /**
36
+ * Under a layer whose members the frame filter all leaves out: how many rows
37
+ * it holds. `{{count}}` is the number; the host pluralises.
38
+ */
39
+ export declare const SELECTION_PANE_LAYER_FILTERED: ChromeWording;
40
+ /** The eye of a visible row: hide it for this viewer only (ADR 0031 §8). */
41
+ export declare const SELECTION_PANE_HIDE: ChromeWording;
42
+ /** The eye of a row this viewer hid: show it again. */
43
+ export declare const SELECTION_PANE_SHOW: ChromeWording;
44
+ /**
45
+ * A row's menu entry that hides it for EVERYONE (ADR 0031 §7): written to
46
+ * the document, painted with the theme's warning tokens.
47
+ */
48
+ export declare const SELECTION_PANE_HIDE_FOR_EVERYONE: ChromeWording;
49
+ /** The same entry on a row hidden for everyone: show it to everyone again. */
50
+ export declare const SELECTION_PANE_SHOW_FOR_EVERYONE: ChromeWording;
51
+ /** The pane's head button that adds a user layer (ADR 0031 §2). */
52
+ export declare const SELECTION_PANE_NEW_LAYER: ChromeWording;
53
+ /** The hint on the active layer's row: where new elements land. */
54
+ export declare const SELECTION_PANE_ACTIVE_LAYER: ChromeWording;
55
+ /**
56
+ * A layer row's menu entry that deletes the layer WITH its members, in one
57
+ * undo step (ADR 0031 §10). Absent on the default layer.
58
+ */
59
+ export declare const SELECTION_PANE_DELETE_LAYER: ChromeWording;
60
+ /** The menu of a row, opened by a right click or its "more" button. */
61
+ export declare const SELECTION_PANE_ROW_MENU: ChromeWording;
62
+ /** The padlock of a locked row; the unlocked one reads `TOOLBAR_LOCK`. */
63
+ export declare const SELECTION_PANE_UNLOCK: ChromeWording;
64
+ export declare const SELECTION_PANE_EXPAND: ChromeWording;
65
+ export declare const SELECTION_PANE_COLLAPSE: ChromeWording;
66
+ /** One wording per element type and gfx block flavour the library ships. */
67
+ export declare const SELECTION_PANE_TYPE_WORDINGS: Readonly<Record<string, ChromeWording>>;
68
+ /** Every `affine:embed-*` flavour: the iframe embed's own word. */
69
+ export declare const SELECTION_PANE_TYPE_EMBED: ChromeWording;
70
+ /** A kind the library does not ship: a framework's own element type. */
71
+ export declare const SELECTION_PANE_TYPE_ELEMENT: ChromeWording;
14
72
  /** Every wording this package declares, in the order it renders them. */
15
73
  export declare const EDGELESS_TOOLBAR_WORDINGS: readonly ChromeWording[];
@@ -1,4 +1,4 @@
1
- import { ICON_BUTTON_COMING_SOON, } from '../affine-shared/services/index.js';
1
+ import { ATTACHMENT_LABEL, ICON_BUTTON_COMING_SOON, IMAGE_LABEL, TOOL_NAME_FRAME, TOOL_NAME_NOTE, } from '../affine-shared/services/index.js';
2
2
  /**
3
3
  * The generic edgeless toolbar's own wordings — not a specific tool's, the
4
4
  * toolbar chrome itself. `STYLE_GENERAL`/`STYLE_SCRIBBLED` (`config/consts.ts`'s
@@ -14,7 +14,177 @@ export const EDGELESS_TOOLBAR_MORE_TOOLS = [
14
14
  'com.labre.edgeless-toolbar.more-tools',
15
15
  'More Tools',
16
16
  ];
17
+ /**
18
+ * A family the element still carries but the host no longer configures
19
+ * (#396): the font picker keeps its name, greyed, with this mark. `{{name}}`
20
+ * is the family name, a proper name the host does not translate.
21
+ */
22
+ export const EDGELESS_TOOLBAR_FONT_FAMILY_UNAVAILABLE = [
23
+ 'com.labre.edgeless-toolbar.font-family-unavailable',
24
+ '{{name}} (unavailable)',
25
+ ];
26
+ /* ── Selection pane (ADR 0031) ────────────────────────────────────────── */
27
+ /** The pane's title, and the toolbar button's tooltip. */
28
+ export const SELECTION_PANE_TITLE = [
29
+ 'com.labre.selection-pane.title',
30
+ 'Selection pane',
31
+ ];
32
+ /**
33
+ * The catalogue's own "Close": the same word on the same kind of side panel,
34
+ * so one key (L7 dedupe: one chrome word, one key). The manifest already
35
+ * declares it for the catalogue, so it is not listed again below.
36
+ */
37
+ export const SELECTION_PANE_CLOSE = [
38
+ 'com.labre.catalogue.close',
39
+ 'Close',
40
+ ];
41
+ /** What the pane says on a canvas with nothing on it, or nothing filtered. */
42
+ export const SELECTION_PANE_EMPTY = [
43
+ 'com.labre.selection-pane.empty',
44
+ 'Nothing on the canvas',
45
+ ];
46
+ export const SELECTION_PANE_FILTER = [
47
+ 'com.labre.selection-pane.filter',
48
+ 'Filter',
49
+ ];
50
+ /** The filter entry that shows every element again. */
51
+ export const SELECTION_PANE_FILTER_ALL = [
52
+ 'com.labre.selection-pane.filter.all',
53
+ 'All elements',
54
+ ];
55
+ /** A frame offered by the filter; `{{name}}` is the frame's own title. */
56
+ export const SELECTION_PANE_FILTER_FRAME = [
57
+ 'com.labre.selection-pane.filter.frame',
58
+ 'Frame: {{name}}',
59
+ ];
60
+ /**
61
+ * Under a layer whose members the frame filter all leaves out: how many rows
62
+ * it holds. `{{count}}` is the number; the host pluralises.
63
+ */
64
+ export const SELECTION_PANE_LAYER_FILTERED = [
65
+ 'com.labre.selection-pane.layer.filtered',
66
+ '{{count}} hidden by the filter',
67
+ ];
68
+ /** The eye of a visible row: hide it for this viewer only (ADR 0031 §8). */
69
+ export const SELECTION_PANE_HIDE = [
70
+ 'com.labre.selection-pane.hide',
71
+ 'Hide for me',
72
+ ];
73
+ /** The eye of a row this viewer hid: show it again. */
74
+ export const SELECTION_PANE_SHOW = [
75
+ 'com.labre.selection-pane.show',
76
+ 'Show',
77
+ ];
78
+ /**
79
+ * A row's menu entry that hides it for EVERYONE (ADR 0031 §7): written to
80
+ * the document, painted with the theme's warning tokens.
81
+ */
82
+ export const SELECTION_PANE_HIDE_FOR_EVERYONE = [
83
+ 'com.labre.selection-pane.hide-for-everyone',
84
+ 'Hide for everyone',
85
+ ];
86
+ /** The same entry on a row hidden for everyone: show it to everyone again. */
87
+ export const SELECTION_PANE_SHOW_FOR_EVERYONE = [
88
+ 'com.labre.selection-pane.show-for-everyone',
89
+ 'Show for everyone',
90
+ ];
91
+ /** The pane's head button that adds a user layer (ADR 0031 §2). */
92
+ export const SELECTION_PANE_NEW_LAYER = [
93
+ 'com.labre.selection-pane.new-layer',
94
+ 'New layer',
95
+ ];
96
+ /** The hint on the active layer's row: where new elements land. */
97
+ export const SELECTION_PANE_ACTIVE_LAYER = [
98
+ 'com.labre.selection-pane.active-layer',
99
+ 'New elements go into this layer',
100
+ ];
101
+ /**
102
+ * A layer row's menu entry that deletes the layer WITH its members, in one
103
+ * undo step (ADR 0031 §10). Absent on the default layer.
104
+ */
105
+ export const SELECTION_PANE_DELETE_LAYER = [
106
+ 'com.labre.selection-pane.delete-layer',
107
+ 'Delete layer',
108
+ ];
109
+ /** The menu of a row, opened by a right click or its "more" button. */
110
+ export const SELECTION_PANE_ROW_MENU = [
111
+ 'com.labre.selection-pane.row-menu',
112
+ 'More actions',
113
+ ];
114
+ /** The padlock of a locked row; the unlocked one reads `TOOLBAR_LOCK`. */
115
+ export const SELECTION_PANE_UNLOCK = [
116
+ 'com.labre.selection-pane.unlock',
117
+ 'Unlock',
118
+ ];
119
+ export const SELECTION_PANE_EXPAND = [
120
+ 'com.labre.selection-pane.expand',
121
+ 'Expand',
122
+ ];
123
+ export const SELECTION_PANE_COLLAPSE = [
124
+ 'com.labre.selection-pane.collapse',
125
+ 'Collapse',
126
+ ];
127
+ /**
128
+ * The wording of a row whose element carries no text and no role: its KIND.
129
+ *
130
+ * The kinds the pane is the first to name get their own keys below; the
131
+ * others reuse the word their tool, slash entry or label already declares (L7
132
+ * dedupe: one chrome word, one key), restated here with the owner's exact
133
+ * fallback because this package cannot import every owner's table.
134
+ */
135
+ const SELECTION_PANE_OWN_TYPE_WORDINGS = {
136
+ shape: ['com.labre.selection-pane.type.shape', 'Shape'],
137
+ text: ['com.labre.selection-pane.type.text', 'Text'],
138
+ group: ['com.labre.selection-pane.type.group', 'Group'],
139
+ brush: ['com.labre.selection-pane.type.brush', 'Drawing'],
140
+ 'affine:bookmark': ['com.labre.selection-pane.type.bookmark', 'Link'],
141
+ 'affine:latex': ['com.labre.selection-pane.type.latex', 'Equation'],
142
+ };
143
+ /** One wording per element type and gfx block flavour the library ships. */
144
+ export const SELECTION_PANE_TYPE_WORDINGS = {
145
+ ...SELECTION_PANE_OWN_TYPE_WORDINGS,
146
+ 'affine:edgeless-text': SELECTION_PANE_OWN_TYPE_WORDINGS.text,
147
+ connector: ['com.labre.connector.toolbar.connector', 'Connector'],
148
+ mindmap: ['com.labre.surface-ref.type.mindmap', 'Mind map'],
149
+ highlighter: ['com.labre.highlight.label', 'Highlight'],
150
+ 'affine:frame': TOOL_NAME_FRAME,
151
+ 'affine:note': TOOL_NAME_NOTE,
152
+ 'affine:image': IMAGE_LABEL,
153
+ 'affine:attachment': ATTACHMENT_LABEL,
154
+ };
155
+ /** Every `affine:embed-*` flavour: the iframe embed's own word. */
156
+ export const SELECTION_PANE_TYPE_EMBED = [
157
+ 'com.labre.embed.iframe.slash.name',
158
+ 'Embed',
159
+ ];
160
+ /** A kind the library does not ship: a framework's own element type. */
161
+ export const SELECTION_PANE_TYPE_ELEMENT = [
162
+ 'com.labre.selection-pane.type.element',
163
+ 'Element',
164
+ ];
17
165
  /** Every wording this package declares, in the order it renders them. */
18
166
  export const EDGELESS_TOOLBAR_WORDINGS = [
19
167
  EDGELESS_TOOLBAR_MORE_TOOLS,
168
+ EDGELESS_TOOLBAR_FONT_FAMILY_UNAVAILABLE,
169
+ SELECTION_PANE_TITLE,
170
+ SELECTION_PANE_EMPTY,
171
+ SELECTION_PANE_FILTER,
172
+ SELECTION_PANE_FILTER_ALL,
173
+ SELECTION_PANE_FILTER_FRAME,
174
+ SELECTION_PANE_LAYER_FILTERED,
175
+ SELECTION_PANE_HIDE,
176
+ SELECTION_PANE_SHOW,
177
+ SELECTION_PANE_HIDE_FOR_EVERYONE,
178
+ SELECTION_PANE_SHOW_FOR_EVERYONE,
179
+ SELECTION_PANE_ROW_MENU,
180
+ SELECTION_PANE_NEW_LAYER,
181
+ SELECTION_PANE_ACTIVE_LAYER,
182
+ SELECTION_PANE_DELETE_LAYER,
183
+ SELECTION_PANE_UNLOCK,
184
+ SELECTION_PANE_EXPAND,
185
+ SELECTION_PANE_COLLAPSE,
186
+ // Only the kinds this pane names first; the reused words are declared by
187
+ // their owners.
188
+ ...Object.values(SELECTION_PANE_OWN_TYPE_WORDINGS),
189
+ SELECTION_PANE_TYPE_ELEMENT,
20
190
  ];
@@ -4,6 +4,9 @@ import { edgelessArtefactCatalogueWidget } from './catalogue/artefact-catalogue-
4
4
  import { edgelessToolbarWidget } from './edgeless-toolbar.js';
5
5
  import { effects } from './effects.js';
6
6
  import { ArtefactPlacementTool } from './placement/artefact-placement-tool.js';
7
+ import { selectionPaneDefaultExtension } from './selection-pane/selection-pane-default.js';
8
+ import { selectionPaneQuickTool } from './selection-pane/selection-pane-tool.js';
9
+ import { edgelessSelectionPaneWidget } from './selection-pane/selection-pane-widget.js';
7
10
  export class EdgelessToolbarViewExtension extends ViewExtensionProvider {
8
11
  constructor() {
9
12
  super(...arguments);
@@ -28,6 +31,13 @@ export class EdgelessToolbarViewExtension extends ViewExtensionProvider {
28
31
  // chrome driven by whatever commands are registered, so a framework whose
29
32
  // flag is off simply never arms it. See `docs/adr/0009`.
30
33
  context.register(ArtefactPlacementTool);
34
+ // The selection pane (ADR 0031), on the catalogue's terms: its panel,
35
+ // the default implementation of its seam, and its toolbar entry, all
36
+ // unconditional. A host replaces or switches it off through
37
+ // `SelectionPaneExtension`; nothing it lists is a flag's business.
38
+ context.register(edgelessSelectionPaneWidget);
39
+ context.register(selectionPaneDefaultExtension);
40
+ context.register(selectionPaneQuickTool);
31
41
  }
32
42
  }
33
43
  }
@@ -78,7 +78,8 @@ let EdgelessFrameTitleEditor = (() => {
78
78
  outline: none;
79
79
  z-index: 1;
80
80
  border: 1px solid var(--affine-primary-color);
81
- box-shadow: 0px 0px 0px 2px rgba(30, 150, 235, 0.3);
81
+ box-shadow: 0px 0px 0px 2px
82
+ color-mix(in srgb, var(--affine-primary-color) 30%, transparent);
82
83
  overflow: hidden;
83
84
  font-family: var(--affine-font-family);
84
85
  }
@@ -32,7 +32,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
32
32
  }
33
33
  return useValue ? value : void 0;
34
34
  };
35
- import { EdgelessLegacySlotIdentifier, getSurfaceComponent, isNoteBlock, } from '../affine-block-surface/index.js';
35
+ import { applyCreationLayer, EdgelessLegacySlotIdentifier, getSurfaceComponent, isNoteBlock, sourceLayerOf, } from '../affine-block-surface/index.js';
36
36
  import { DEFAULT_NOTE_HEIGHT, } from '../affine-model/index.js';
37
37
  import { EDGELESS_BLOCK_CHILD_PADDING } from '../affine-shared/consts/index.js';
38
38
  import { TelemetryProvider } from '../affine-shared/services/index.js';
@@ -192,13 +192,17 @@ let NoteSlicer = (() => {
192
192
  const [x, , width] = deserializeXYWH(xywh);
193
193
  const sliceVerticalPos = this._divingLinePositions[this._activeSlicerIndex].y;
194
194
  const newY = this.gfx.viewport.toModelCoord(x, sliceVerticalPos)[1];
195
- const newNoteId = this.store.addBlock('affine:note', {
195
+ const props = {
196
196
  background,
197
197
  displayMode,
198
198
  xywh: serializeXYWH(x, newY + NEW_NOTE_GAP, width, DEFAULT_NOTE_HEIGHT),
199
199
  index: originalIndex + 1,
200
200
  edgeless: restOfEdgeless,
201
- }, doc.root?.id, originalNoteIndex ? originalNoteIndex + 1 : undefined);
201
+ // The split-off half stays in its note's layer (ADR 0031 §6).
202
+ layer: sourceLayerOf(this._anchorNote),
203
+ };
204
+ applyCreationLayer(this.std, props);
205
+ const newNoteId = this.store.addBlock('affine:note', props, doc.root?.id, originalNoteIndex ? originalNoteIndex + 1 : undefined);
202
206
  doc.moveBlocks(resetBlocks, doc.getModelById(newNoteId));
203
207
  this._activeSlicerIndex = 0;
204
208
  this._selection.set({
@@ -53,12 +53,19 @@ export declare const SLASH_MENU_DELETE_DESCRIPTION: ChromeWording;
53
53
  * '<n>_<Name>@<i>'`, the `<Name>` between `_` and `@`):
54
54
  *
55
55
  * - `Basic` — callout, latex, note (paragraph/heading/list/quote/divider).
56
+ * - `List`, `Style` — note again, but written as TEMPLATE literals
57
+ * (`` `1_List@${index++}` ``, `` `2_Style@${index++}` ``,
58
+ * `blocks/note/src/configs/slash-menu.ts`), which is why the first
59
+ * inventory — a grep for `group: '` — missed both (#390).
56
60
  * - `Content & Media` — attachment, bookmark, image, latex, the generic embed
57
61
  * (iframe) block, and (postponed, `blocks/table`) table.
58
62
  * - `Page` — the linked-doc embed block.
59
63
  * - `Edgeless Element` — surface-ref.
60
64
  * - `Date`, `Actions` — this package's own groups (`./config.ts`).
61
65
  *
66
+ * The inventory covers template literals too: the `<Name>` is read between the
67
+ * `_` and the `@`, whichever way the group string was built.
68
+ *
62
69
  * NOT included: `Database`, used only by the postponed `blocks/database` and
63
70
  * `blocks/data-view` — the PO's decision excludes those surfaces, and
64
71
  * `Database` has no other user today. A framework or a later lot that adds a
@@ -67,6 +74,15 @@ export declare const SLASH_MENU_DELETE_DESCRIPTION: ChromeWording;
67
74
  * of this existed.
68
75
  */
69
76
  export declare const SLASH_MENU_GROUP_BASIC: ChromeWording;
77
+ export declare const SLASH_MENU_GROUP_LIST: ChromeWording;
78
+ /**
79
+ * An ALIAS, not a new key: `STYLE_MENU_LABEL` already carries the word
80
+ * `Style` in the chrome table, and a second key with the same fallback would
81
+ * fail the "un mot chrome, une clé" test. Listed in the group table below,
82
+ * NOT in `SLASH_MENU_WORDINGS` — an alias is walked once, from
83
+ * `CHROME_WORDINGS`, exactly like `SLASH_MENU_COPY` / `_DUPLICATE`.
84
+ */
85
+ export declare const SLASH_MENU_GROUP_STYLE: ChromeWording;
70
86
  export declare const SLASH_MENU_GROUP_CONTENT_MEDIA: ChromeWording;
71
87
  export declare const SLASH_MENU_GROUP_PAGE: ChromeWording;
72
88
  export declare const SLASH_MENU_GROUP_EDGELESS_ELEMENT: ChromeWording;
@@ -1,4 +1,4 @@
1
- import { TOOLBAR_COPY, TOOLBAR_DELETE, TOOLBAR_DUPLICATE, TOOLBAR_MOVE_DOWN, TOOLBAR_MOVE_UP, } from '../affine-shared/services/index.js';
1
+ import { STYLE_MENU_LABEL, TOOLBAR_COPY, TOOLBAR_DELETE, TOOLBAR_DUPLICATE, TOOLBAR_MOVE_DOWN, TOOLBAR_MOVE_UP, } from '../affine-shared/services/index.js';
2
2
  /**
3
3
  * The slash menu's own wordings — one `ChromeWording` per static config
4
4
  * literal (`name`, `description`, a tooltip's `caption`) that
@@ -91,12 +91,19 @@ export const SLASH_MENU_DELETE_DESCRIPTION = [
91
91
  * '<n>_<Name>@<i>'`, the `<Name>` between `_` and `@`):
92
92
  *
93
93
  * - `Basic` — callout, latex, note (paragraph/heading/list/quote/divider).
94
+ * - `List`, `Style` — note again, but written as TEMPLATE literals
95
+ * (`` `1_List@${index++}` ``, `` `2_Style@${index++}` ``,
96
+ * `blocks/note/src/configs/slash-menu.ts`), which is why the first
97
+ * inventory — a grep for `group: '` — missed both (#390).
94
98
  * - `Content & Media` — attachment, bookmark, image, latex, the generic embed
95
99
  * (iframe) block, and (postponed, `blocks/table`) table.
96
100
  * - `Page` — the linked-doc embed block.
97
101
  * - `Edgeless Element` — surface-ref.
98
102
  * - `Date`, `Actions` — this package's own groups (`./config.ts`).
99
103
  *
104
+ * The inventory covers template literals too: the `<Name>` is read between the
105
+ * `_` and the `@`, whichever way the group string was built.
106
+ *
100
107
  * NOT included: `Database`, used only by the postponed `blocks/database` and
101
108
  * `blocks/data-view` — the PO's decision excludes those surfaces, and
102
109
  * `Database` has no other user today. A framework or a later lot that adds a
@@ -108,6 +115,18 @@ export const SLASH_MENU_GROUP_BASIC = [
108
115
  'com.labre.slash-menu.group.basic',
109
116
  'Basic',
110
117
  ];
118
+ export const SLASH_MENU_GROUP_LIST = [
119
+ 'com.labre.slash-menu.group.list',
120
+ 'List',
121
+ ];
122
+ /**
123
+ * An ALIAS, not a new key: `STYLE_MENU_LABEL` already carries the word
124
+ * `Style` in the chrome table, and a second key with the same fallback would
125
+ * fail the "un mot chrome, une clé" test. Listed in the group table below,
126
+ * NOT in `SLASH_MENU_WORDINGS` — an alias is walked once, from
127
+ * `CHROME_WORDINGS`, exactly like `SLASH_MENU_COPY` / `_DUPLICATE`.
128
+ */
129
+ export const SLASH_MENU_GROUP_STYLE = STYLE_MENU_LABEL;
111
130
  export const SLASH_MENU_GROUP_CONTENT_MEDIA = [
112
131
  'com.labre.slash-menu.group.content-media',
113
132
  'Content & Media',
@@ -131,6 +150,8 @@ export const SLASH_MENU_GROUP_ACTIONS = [
131
150
  /** The group table, keyed by the raw group name `parseGroup` extracts. */
132
151
  const SLASH_MENU_GROUP_WORDINGS = {
133
152
  Basic: SLASH_MENU_GROUP_BASIC,
153
+ List: SLASH_MENU_GROUP_LIST,
154
+ Style: SLASH_MENU_GROUP_STYLE,
134
155
  'Content & Media': SLASH_MENU_GROUP_CONTENT_MEDIA,
135
156
  Page: SLASH_MENU_GROUP_PAGE,
136
157
  'Edgeless Element': SLASH_MENU_GROUP_EDGELESS_ELEMENT,
@@ -167,6 +188,7 @@ export const SLASH_MENU_WORDINGS = [
167
188
  SLASH_MENU_COPY_DUPLICATE_CAPTION,
168
189
  SLASH_MENU_DELETE_DESCRIPTION,
169
190
  SLASH_MENU_GROUP_BASIC,
191
+ SLASH_MENU_GROUP_LIST,
170
192
  SLASH_MENU_GROUP_CONTENT_MEDIA,
171
193
  SLASH_MENU_GROUP_PAGE,
172
194
  SLASH_MENU_GROUP_EDGELESS_ELEMENT,
@@ -23,6 +23,21 @@ export const sideMap = new Map([
23
23
  // has only one shape element
24
24
  ['affine:surface:shape', { top: 26, bottom: -26 }],
25
25
  ]);
26
+ /**
27
+ * The narrowest room the row is ever told it has.
28
+ *
29
+ * A cap is a `max-width`: below the width of what the row cannot give up, it
30
+ * stops being an instruction and becomes a guillotine — the entries past it are
31
+ * painted outside the row's own background, over the document. A floor keeps
32
+ * that from ever happening on a number nobody meant.
33
+ *
34
+ * 120px is a minimal row, drawn: three icon buttons — the "⋮" plus the two
35
+ * entries a menu is worth opening for — at {@link MENU_BUTTON_WIDTH} each, the
36
+ * two 8px gaps between them, one separator and its gap, and the row's own 6px
37
+ * of padding on either side. 109px, rounded up to leave the border its half
38
+ * pixel and the eye a little air.
39
+ */
40
+ const MIN_TOOLBAR_WIDTH = 120;
26
41
  export function autoUpdatePosition(signal, toolbar, referenceElement, flavour, placement, sideOptions, options = { elementResize: false },
27
42
  /**
28
43
  * Called whenever the room the row has just changed. This is the only place
@@ -51,22 +66,32 @@ onAvailableWidth) {
51
66
  }
52
67
  : {
53
68
  placement,
69
+ // ORDER MATTERS, and `size` comes LAST of the four — after `inline`,
70
+ // after `shift`, after `flip` — which is the order floating-ui
71
+ // documents for it and the order this row needs.
72
+ //
73
+ // `size` asks the question "how much room is there", and it has two
74
+ // different answers depending on whether a `shift` has already run:
75
+ //
76
+ // - **after `shift`** (`middlewareData.shift.enabled.x`): the room is
77
+ // `maximumClippingWidth` — the clipping box, less the padding. Which
78
+ // is the truth: it is where the row may be drawn, and `shift` will
79
+ // slide the row to fit inside it.
80
+ // - **before `shift`**, on an UNALIGNED placement (`'top'`, which is
81
+ // what a text selection's row uses), floating-ui falls back to
82
+ // `width - 2 × overflow` — the row's own width, less twice what a
83
+ // row CENTRED on the selection would stick out by. That number is
84
+ // not room at all. It is fine while the centred row fits, and the
85
+ // moment it would stick out by one pixel it collapses below the
86
+ // row's width and the entries start leaving for the "⋮" — with 900px
87
+ // of empty editor next to them, because `shift` was about to slide
88
+ // the row back in anyway. Worse, it is computed from a width `size`
89
+ // itself has just capped, so each `reset` makes it smaller: the
90
+ // format bar measured 75px of "room" inside a 420px window.
91
+ //
92
+ // See the cap's only reader, `availableWidthOf`.
54
93
  middleware: [
55
94
  offset(10 + offsetY),
56
- size({
57
- padding: 10,
58
- apply: ({ elements, availableWidth }) => {
59
- elements.floating.style.width = 'fit-content';
60
- // The room the row has. The toolbar never wraps and never
61
- // scrolls: past this width its entries give way, in the order
62
- // they declared, into the "⋮" menu — see `ToolbarFitter`.
63
- const capped = `${availableWidth}px`;
64
- if (elements.floating.style.maxWidth !== capped) {
65
- elements.floating.style.maxWidth = capped;
66
- onAvailableWidth?.();
67
- }
68
- },
69
- }),
70
95
  isInline ? inline() : undefined,
71
96
  shift(state => ({
72
97
  padding: {
@@ -88,6 +113,20 @@ onAvailableWidth) {
88
113
  // 25/08/2026, third video: the map background's row). Horizontal
89
114
  // placement belongs to `shift`, which slides — it never teleports.
90
115
  flip({ padding: 10, crossAxis: false, flipAlignment: false }),
116
+ size({
117
+ padding: 10,
118
+ apply: ({ elements, availableWidth }) => {
119
+ elements.floating.style.width = 'fit-content';
120
+ // The room the row has. The toolbar never wraps and never
121
+ // scrolls: past this width its entries give way, in the order
122
+ // they declared, into the "⋮" menu — see `ToolbarFitter`.
123
+ const capped = `${Math.max(availableWidth, MIN_TOOLBAR_WIDTH)}px`;
124
+ if (elements.floating.style.maxWidth !== capped) {
125
+ elements.floating.style.maxWidth = capped;
126
+ onAvailableWidth?.();
127
+ }
128
+ },
129
+ }),
91
130
  hide(),
92
131
  ],
93
132
  };
@@ -599,6 +638,10 @@ const MAX_FIT_ROUNDS = 3;
599
638
  * keeps its natural width under it, while an `inner` toolbar is pinned to the
600
639
  * exact width of the block it sits on. Anything else — a row nothing has
601
640
  * positioned yet — has all the room in the world and collapses nothing.
641
+ *
642
+ * The cap is the clipping box less its padding, never the row's own width: see
643
+ * the middleware order in {@link autoUpdatePosition}. It is floored at
644
+ * {@link MIN_TOOLBAR_WIDTH}.
602
645
  */
603
646
  function availableWidthOf(toolbar) {
604
647
  const max = Number.parseFloat(toolbar.style.maxWidth);
@@ -129,7 +129,8 @@ let RecordField = (() => {
129
129
  }
130
130
 
131
131
  .field-content.is-editing {
132
- box-shadow: 0px 0px 0px 2px rgba(30, 150, 235, 0.3);
132
+ box-shadow: 0px 0px 0px 2px
133
+ color-mix(in srgb, var(--affine-primary-color) 30%, transparent);
133
134
  }
134
135
 
135
136
  .field-content.is-focus {
@@ -83,7 +83,9 @@ export const allLiteralConfig = [
83
83
  items: type.element.data?.map(tag => {
84
84
  const selected = set.has(tag.id);
85
85
  const prefix = selected
86
- ? CheckBoxCheckSolidIcon({ style: `color:#1E96EB` })
86
+ ? CheckBoxCheckSolidIcon({
87
+ style: `color:var(--affine-primary-color)`,
88
+ })
87
89
  : CheckBoxUnIcon();
88
90
  return menu.action({
89
91
  name: tag.value,
@@ -15,7 +15,7 @@ export class BooleanGroupView extends BaseGroup {
15
15
  render() {
16
16
  return html ` <div class="data-view-group-title-boolean-view">
17
17
  ${this.value
18
- ? CheckBoxCheckSolidIcon({ style: `color:#1E96EB` })
18
+ ? CheckBoxCheckSolidIcon({ style: `color:var(--affine-primary-color)` })
19
19
  : CheckBoxUnIcon()}
20
20
  </div>`;
21
21
  }
@@ -40,6 +40,12 @@ import { BaseCellRenderer } from '../../core/property/index.js';
40
40
  import { createFromBaseCellRenderer } from '../../core/property/renderer.js';
41
41
  import { createIcon } from '../../core/utils/uni-icon.js';
42
42
  import { checkboxPropertyModelConfig } from './define.js';
43
+ /**
44
+ * The chrome accent, reached through its token rather than written as a hex:
45
+ * the six-dot burst is chrome, so it has to follow the host's theme (DESIGN.md,
46
+ * The Borrowed Blue Rule).
47
+ */
48
+ const ACCENT = 'var(--affine-primary-color)';
43
49
  const playCheckAnimation = async (refElement, { left = 0, size = 20 } = {}) => {
44
50
  const sparkingEl = document.createElement('div');
45
51
  sparkingEl.classList.add('affine-check-animation');
@@ -56,7 +62,7 @@ const playCheckAnimation = async (refElement, { left = 0, size = 20 } = {}) => {
56
62
  refElement.append(sparkingEl);
57
63
  await sparkingEl.animate([
58
64
  {
59
- boxShadow: '0 -18px 0 -8px #1e96eb, 16px -8px 0 -8px #1e96eb, 16px 8px 0 -8px #1e96eb, 0 18px 0 -8px #1e96eb, -16px 8px 0 -8px #1e96eb, -16px -8px 0 -8px #1e96eb',
65
+ boxShadow: `0 -18px 0 -8px ${ACCENT}, 16px -8px 0 -8px ${ACCENT}, 16px 8px 0 -8px ${ACCENT}, 0 18px 0 -8px ${ACCENT}, -16px 8px 0 -8px ${ACCENT}, -16px -8px 0 -8px ${ACCENT}`,
60
66
  },
61
67
  ], { duration: 240, easing: 'ease', fill: 'forwards' }).finished;
62
68
  await sparkingEl.animate([
@@ -120,7 +126,7 @@ let CheckboxCell = (() => {
120
126
  render() {
121
127
  const checked = this.value ?? false;
122
128
  const icon = checked
123
- ? CheckBoxCheckSolidIcon({ style: `color:#1E96EB` })
129
+ ? CheckBoxCheckSolidIcon({ style: `color:var(--affine-primary-color)` })
124
130
  : CheckBoxUnIcon();
125
131
  return html ` <div class="affine-database-checkbox-container">
126
132
  <div
@@ -156,7 +156,7 @@ let KanbanCell = (() => {
156
156
  ? '1px solid var(--affine-primary-color)'
157
157
  : '';
158
158
  this.style.boxShadow = this.isEditing$.value
159
- ? '0px 0px 0px 2px rgba(30, 150, 235, 0.30)'
159
+ ? '0px 0px 0px 2px color-mix(in srgb, var(--affine-primary-color) 30%, transparent)'
160
160
  : '';
161
161
  return html ` ${this.renderIcon()}
162
162
  ${renderUniLit(view, props, {
@@ -172,7 +172,8 @@ const createDropPreview = () => {
172
172
  div.style.height = '2px';
173
173
  div.style.borderRadius = '1px';
174
174
  div.style.backgroundColor = 'var(--affine-primary-color)';
175
- div.style.boxShadow = '0px 0px 8px 0px rgba(30, 150, 235, 0.35)';
175
+ div.style.boxShadow =
176
+ '0px 0px 8px 0px color-mix(in srgb, var(--affine-primary-color) 35%, transparent)';
176
177
  return {
177
178
  display(group, self, card) {
178
179
  const target = card ?? group.querySelector('.add-card');
@@ -156,7 +156,8 @@ const createDropPreview = () => {
156
156
  div.style.height = '2px';
157
157
  div.style.borderRadius = '1px';
158
158
  div.style.backgroundColor = 'var(--affine-primary-color)';
159
- div.style.boxShadow = '0px 0px 8px 0px rgba(30, 150, 235, 0.35)';
159
+ div.style.boxShadow =
160
+ '0px 0px 8px 0px color-mix(in srgb, var(--affine-primary-color) 35%, transparent)';
160
161
  return {
161
162
  display(x, y, width) {
162
163
  document.body.append(div);
@@ -967,7 +967,7 @@ let SelectionElement = (() => {
967
967
  ? 'dashed'
968
968
  : 'solid';
969
969
  div.style.boxShadow = isEditing
970
- ? '0px 0px 0px 2px rgba(30, 150, 235, 0.30)'
970
+ ? '0px 0px 0px 2px color-mix(in srgb, var(--affine-primary-color) 30%, transparent)'
971
971
  : 'unset';
972
972
  div.style.display = 'block';
973
973
  dragToFill.style.left = `${x + w}px`;
@@ -101,7 +101,8 @@ let TableVerticalIndicator = (() => {
101
101
  }
102
102
 
103
103
  .with-shadow.vertical-indicator::after {
104
- box-shadow: 0px 0px 8px 0px rgba(30, 150, 235, 0.35);
104
+ box-shadow: 0px 0px 8px 0px
105
+ color-mix(in srgb, var(--affine-primary-color) 35%, transparent);
105
106
  }
106
107
  `; }
107
108
  render() {
@@ -122,7 +122,9 @@ let RowSelectCheckbox = (() => {
122
122
  return html `
123
123
  <div class="${classString}">
124
124
  ${this.isSelected$.value
125
- ? CheckBoxCheckSolidIcon({ style: `color:#1E96EB` })
125
+ ? CheckBoxCheckSolidIcon({
126
+ style: `color:var(--affine-primary-color)`,
127
+ })
126
128
  : CheckBoxUnIcon()}
127
129
  </div>
128
130
  `;
@@ -177,7 +177,8 @@ const createDropPreview = () => {
177
177
  div.style.height = '2px';
178
178
  div.style.borderRadius = '1px';
179
179
  div.style.backgroundColor = 'var(--affine-primary-color)';
180
- div.style.boxShadow = '0px 0px 8px 0px rgba(30, 150, 235, 0.35)';
180
+ div.style.boxShadow =
181
+ '0px 0px 8px 0px color-mix(in srgb, var(--affine-primary-color) 35%, transparent)';
181
182
  return {
182
183
  display(x, y, width) {
183
184
  document.body.append(div);