@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
@@ -126,19 +126,25 @@ let FilterableListComponent = (() => {
126
126
  });
127
127
  }
128
128
  _filterItems() {
129
- const searchFilter = !this._filterText
130
- ? this.options.items
131
- : this.options.items.filter(item => item.name.startsWith(this._filterText.toLowerCase()) ||
132
- item.aliases?.some(alias => alias.startsWith(this._filterText.toLowerCase())));
133
- return searchFilter.sort((a, b) => {
134
- const isActiveA = this.options.active?.(a);
135
- const isActiveB = this.options.active?.(b);
129
+ const query = this._filterText.toLowerCase();
130
+ // A copy: the caller's array is its own state (the language button keeps
131
+ // its most-recently-used order in it), so sorting must not reorder it.
132
+ const ranked = this.options.items
133
+ .map(item => ({ item, rank: matchRank(item, query) }))
134
+ .filter(entry => entry.rank !== -1);
135
+ return ranked
136
+ .sort((a, b) => {
137
+ const isActiveA = this.options.active?.(a.item);
138
+ const isActiveB = this.options.active?.(b.item);
136
139
  if (isActiveA && !isActiveB)
137
140
  return -1;
138
141
  if (!isActiveA && isActiveB)
139
142
  return 1;
140
- return this.listFilter?.(a, b) ?? 0;
141
- });
143
+ if (a.rank !== b.rank)
144
+ return a.rank - b.rank;
145
+ return this.listFilter?.(a.item, b.item) ?? 0;
146
+ })
147
+ .map(entry => entry.item);
142
148
  }
143
149
  _scrollFocusedItemIntoView() {
144
150
  this.updateComplete
@@ -256,6 +262,21 @@ let FilterableListComponent = (() => {
256
262
  };
257
263
  })();
258
264
  export { FilterableListComponent };
265
+ /**
266
+ * Prefix match on both sides lowercased: 0 for a name or alias hit, 1 for a
267
+ * hit on the display label only (it sorts after an id hit), -1 for no match.
268
+ * An empty query matches everything at rank 0.
269
+ */
270
+ function matchRank(item, query) {
271
+ if (!query)
272
+ return 0;
273
+ const hits = (value) => !!value && value.toLowerCase().startsWith(query);
274
+ if (hits(item.name) || item.aliases?.some(hits))
275
+ return 0;
276
+ if (hits(item.label))
277
+ return 1;
278
+ return -1;
279
+ }
259
280
  export function showPopFilterableList({ options, filter, abortController = new AbortController(), referenceElement, container, maxHeight = 440, portalStyles, }) {
260
281
  const portalPadding = {
261
282
  top: PAGE_HEADER_HEIGHT + 12,
@@ -9,11 +9,11 @@ export const AIStarIcon = html `<svg
9
9
  <g clip-path="url(#clip0_7444_26654)">
10
10
  <path
11
11
  d="M9.40033 4.57585C9.36627 4.27519 9.11207 4.04792 8.80948 4.04761C8.50689 4.0473 8.25223 4.27405 8.21756 4.57465C7.99211 6.52928 7.40771 7.90373 6.46492 8.84651C5.52213 9.7893 4.14769 10.3737 2.19305 10.5991C1.89246 10.6338 1.66571 10.8885 1.66602 11.1911C1.66633 11.4937 1.8936 11.7479 2.19426 11.7819C4.11659 11.9997 5.52025 12.5838 6.48542 13.5315C7.44696 14.4757 8.04356 15.8498 8.21597 17.7908C8.24327 18.0981 8.50096 18.3337 8.80954 18.3333C9.11813 18.333 9.37528 18.0969 9.40189 17.7894C9.56714 15.8804 10.1632 14.4774 11.1295 13.5111C12.0958 12.5448 13.4988 11.9487 15.4078 11.7835C15.7153 11.7569 15.9514 11.4997 15.9517 11.1911C15.9521 10.8825 15.7165 10.6249 15.4092 10.5976C13.4683 10.4252 12.0941 9.82855 11.15 8.86701C10.2022 7.90184 9.61807 6.49818 9.40033 4.57585Z"
12
- fill="#1E96EB"
12
+ fill="var(--affine-primary-color)"
13
13
  />
14
14
  <path
15
15
  d="M15.7849 1.87208C15.7717 1.75516 15.6728 1.66678 15.5551 1.66666C15.4375 1.66654 15.3384 1.75472 15.3249 1.87162C15.2373 2.63175 15.01 3.16626 14.6434 3.5329C14.2767 3.89954 13.7422 4.1268 12.9821 4.21448C12.8652 4.22796 12.777 4.327 12.7771 4.44467C12.7772 4.56234 12.8656 4.6612 12.9826 4.67445C13.7301 4.75912 14.276 4.9863 14.6513 5.35485C15.0253 5.72203 15.2573 6.25642 15.3243 7.01121C15.335 7.13075 15.4352 7.22235 15.5552 7.22221C15.6752 7.22208 15.7752 7.13025 15.7855 7.01069C15.8498 6.26831 16.0816 5.72268 16.4574 5.3469C16.8332 4.97111 17.3788 4.73932 18.1212 4.67505C18.2407 4.6647 18.3325 4.5647 18.3327 4.44469C18.3328 4.32469 18.2412 4.22448 18.1217 4.21386C17.3669 4.14681 16.8325 3.9148 16.4653 3.54087C16.0968 3.16552 15.8696 2.61966 15.7849 1.87208Z"
16
- fill="#1E96EB"
16
+ fill="var(--affine-primary-color)"
17
17
  />
18
18
  </g>
19
19
  <defs>
@@ -46,7 +46,7 @@ export const AIStopIcon = html `<svg
46
46
  fill-rule="evenodd"
47
47
  clip-rule="evenodd"
48
48
  d="M17.0827 10C17.0827 13.912 13.9114 17.0834 9.99935 17.0834C6.08733 17.0834 2.91602 13.912 2.91602 10C2.91602 6.088 6.08733 2.91669 9.99935 2.91669C13.9114 2.91669 17.0827 6.088 17.0827 10ZM18.3327 10C18.3327 14.6024 14.6017 18.3334 9.99935 18.3334C5.39698 18.3334 1.66602 14.6024 1.66602 10C1.66602 5.39765 5.39698 1.66669 9.99935 1.66669C14.6017 1.66669 18.3327 5.39765 18.3327 10ZM8.33268 6.66669C7.41221 6.66669 6.66602 7.41288 6.66602 8.33335V11.6667C6.66602 12.5872 7.41221 13.3334 8.33268 13.3334H11.666C12.5865 13.3334 13.3327 12.5872 13.3327 11.6667V8.33335C13.3327 7.41288 12.5865 6.66669 11.666 6.66669H8.33268Z"
49
- fill="#1E96EB"
49
+ fill="var(--affine-primary-color)"
50
50
  />
51
51
  </g>
52
52
  <defs>
@@ -1,6 +1,5 @@
1
1
  export * from './ai.js';
2
2
  export * from './file-icons.js';
3
- export * from './file-icons-rc.js';
4
3
  export * from './import-export.js';
5
4
  export * from './list.js';
6
5
  export * from './loading.js';
@@ -1,6 +1,5 @@
1
1
  export * from './ai.js';
2
2
  export * from './file-icons.js';
3
- export * from './file-icons-rc.js';
4
3
  export * from './import-export.js';
5
4
  export * from './list.js';
6
5
  export * from './loading.js';
@@ -1,3 +1,9 @@
1
+ /**
2
+ * The chrome accent, reached through its token rather than written as a hex:
3
+ * the six-dot burst is chrome, so it has to follow the host's theme (DESIGN.md,
4
+ * The Borrowed Blue Rule).
5
+ */
6
+ const ACCENT = 'var(--affine-primary-color)';
1
7
  export const playCheckAnimation = async (refElement, { left = 0, size = 20 } = {}) => {
2
8
  const sparkingEl = document.createElement('div');
3
9
  sparkingEl.classList.add('affine-check-animation');
@@ -14,7 +20,7 @@ export const playCheckAnimation = async (refElement, { left = 0, size = 20 } = {
14
20
  refElement.append(sparkingEl);
15
21
  await sparkingEl.animate([
16
22
  {
17
- 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',
23
+ 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}`,
18
24
  },
19
25
  ], { duration: 240, easing: 'ease', fill: 'forwards' }).finished;
20
26
  await sparkingEl.animate([
@@ -29,6 +29,7 @@ export declare const DividerIcon: import("lit-html").TemplateResult<1>;
29
29
  export declare const BoldIcon: import("lit-html").TemplateResult<1>;
30
30
  export declare const ItalicIcon: import("lit-html").TemplateResult<1>;
31
31
  export declare const UnderlineIcon: import("lit-html").TemplateResult<1>;
32
+ export declare const OverlineIcon: import("lit-html").TemplateResult<1>;
32
33
  export declare const StrikethroughIcon: import("lit-html").TemplateResult<1>;
33
34
  export declare const CodeIcon: import("lit-html").TemplateResult<1>;
34
35
  export declare const LinkIcon: import("lit-html").TemplateResult<1>;
@@ -97,6 +97,17 @@ export const UnderlineIcon = icons.UnderLineIcon({
97
97
  width: '20',
98
98
  height: '20',
99
99
  });
100
+ /**
101
+ * The icon set ships no overline, so it is drawn here: the underline icon's
102
+ * own letter and rule, the rule moved above the letter (ADR 0030).
103
+ */
104
+ const OverlineSVG = svg `<path
105
+ fill="currentColor"
106
+ fill-rule="evenodd"
107
+ clip-rule="evenodd"
108
+ d="M4.458 3.064a.808.808 0 0 0 0 1.616h15.084a.808.808 0 1 0 0-1.616zM7.744 7.968a.808.808 0 1 0-1.616 0v7.003a5.656 5.656 0 1 0 11.313 0V7.968a.808.808 0 1 0-1.616 0v7.003a4.04 4.04 0 1 1-8.08 0z"
109
+ />`;
110
+ export const OverlineIcon = icon(OverlineSVG, 20);
100
111
  export const StrikethroughIcon = icons.StrikeThroughIcon({
101
112
  width: '20',
102
113
  height: '20',
@@ -218,9 +218,14 @@ let SizeDropdownMenu = (() => {
218
218
  const { sizes, format, type, icon, resolvedLabel: label, size$: { value: size }, } = this;
219
219
  const isCheckType = type === 'check';
220
220
  const placeholder = format?.(Math.trunc(size)) ?? Math.trunc(size);
221
+ // `class` is STATIC. It used to be `${label.toLowerCase()}-menu`, which
222
+ // made a CSS class depend on the host's language the day `label` joined
223
+ // the translation seam (#390) — `échelle-menu` in French. Nothing in the
224
+ // repo selects it (checked across the styles and both test suites): it is
225
+ // the stable identifier it was always meant to be.
221
226
  return html `
222
227
  <editor-menu-button
223
- class="${`${label.toLowerCase()}-menu`}"
228
+ class="size-menu"
224
229
  .contentPadding="${'8px'}"
225
230
  .button=${html `
226
231
  <editor-icon-button
@@ -1,7 +1,7 @@
1
1
  export { EditorChevronDown } from './chevron-down.js';
2
2
  export { ToolbarMoreMenuConfigExtension } from './config.js';
3
3
  export { EditorIconButton } from './icon-button.js';
4
- export { EditorMenuAction, EditorMenuButton, EditorMenuContent, } from './menu-button.js';
4
+ export { EDITOR_MENU_TOGGLE, EditorMenuAction, EditorMenuButton, EditorMenuContent, } from './menu-button.js';
5
5
  export { MenuContext } from './menu-context.js';
6
6
  export { type PickerMenu, type PickerMenuItem, renderCurrentPickerItemWith, renderPickerMenu, renderPickerMenuItems, } from './picker-menu.js';
7
7
  export { EditorToolbarSeparator } from './separator.js';
@@ -6,7 +6,7 @@ import { Tooltip } from './tooltip.js';
6
6
  export { EditorChevronDown } from './chevron-down.js';
7
7
  export { ToolbarMoreMenuConfigExtension } from './config.js';
8
8
  export { EditorIconButton } from './icon-button.js';
9
- export { EditorMenuAction, EditorMenuButton, EditorMenuContent, } from './menu-button.js';
9
+ export { EDITOR_MENU_TOGGLE, EditorMenuAction, EditorMenuButton, EditorMenuContent, } from './menu-button.js';
10
10
  export { MenuContext } from './menu-context.js';
11
11
  export { renderCurrentPickerItemWith, renderPickerMenu, renderPickerMenuItems, } from './picker-menu.js';
12
12
  export { EditorToolbarSeparator } from './separator.js';
@@ -1,5 +1,12 @@
1
1
  import { type ButtonPopperOptions } from '../../affine-shared/utils/index.js';
2
2
  import { LitElement, type PropertyValues, type TemplateResult } from 'lit';
3
+ /**
4
+ * A panel in a toolbar opened or closed, announced across shadow boundaries.
5
+ *
6
+ * `detail` is whether it is now open, and the deepest element of
7
+ * `composedPath()` is the button it belongs to.
8
+ */
9
+ export declare const EDITOR_MENU_TOGGLE = "editor-menu-toggle";
3
10
  declare const EditorMenuButton_base: typeof LitElement & import("../../global/utils/types.js").Constructor<import("../../global/lit/with-disposable.js").DisposableClass>;
4
11
  export declare class EditorMenuButton extends EditorMenuButton_base {
5
12
  static styles: import("lit").CSSResult;
@@ -37,6 +37,13 @@ import { createButtonPopper, } from '../../affine-shared/utils/index.js';
37
37
  import { WithDisposable } from '../../global/lit/index.js';
38
38
  import { css, html, LitElement, } from 'lit';
39
39
  import { property, query } from 'lit/decorators.js';
40
+ /**
41
+ * A panel in a toolbar opened or closed, announced across shadow boundaries.
42
+ *
43
+ * `detail` is whether it is now open, and the deepest element of
44
+ * `composedPath()` is the button it belongs to.
45
+ */
46
+ export const EDITOR_MENU_TOGGLE = 'editor-menu-toggle';
40
47
  let EditorMenuButton = (() => {
41
48
  let _classSuper = WithDisposable(LitElement);
42
49
  let __content_decorators;
@@ -97,6 +104,20 @@ let EditorMenuButton = (() => {
97
104
  else {
98
105
  delete this.dataset.open;
99
106
  }
107
+ // Said again, out loud, for whoever is holding this button — the row
108
+ // it sits on has to know, and `data-open` alone cannot tell it: a
109
+ // picker keeps its menu button inside its OWN shadow root, where no
110
+ // `querySelector` and no `MutationObserver` of the row's reaches. This
111
+ // one bubbles AND is composed, so it crosses every boundary between
112
+ // here and the row. See `EditorToolbar`, which stops clipping while a
113
+ // panel is open. The `toggle` event above is deliberately left as it
114
+ // is: it does not bubble, and things listen for it by that name.
115
+ this.dispatchEvent(new CustomEvent(EDITOR_MENU_TOGGLE, {
116
+ detail: opened,
117
+ bubbles: true,
118
+ cancelable: false,
119
+ composed: true,
120
+ }));
100
121
  },
101
122
  mainAxis: 0,
102
123
  offsetHeight: 6 * 4,
@@ -184,6 +205,15 @@ export class EditorMenuContent extends LitElement {
184
205
  .content-wrapper {
185
206
  overscroll-behavior: contain;
186
207
  overflow-y: auto;
208
+ /* Spelled out because CSS Overflow computes a visible axis to auto as
209
+ * soon as the other one is not visible: the overflow-y above would
210
+ * silently make this popup scrollable SIDEWAYS too. Anything animated by
211
+ * a positive translateX inside it — the palette carousel's incoming page,
212
+ * see color-picker/palette-carousel.ts — then grows the scrollable
213
+ * region for the length of the animation and flashes a horizontal
214
+ * scrollbar (issue #392). Not clip: combined with overflow-y: auto the
215
+ * spec falls it back to hidden anyway. */
216
+ overflow-x: hidden;
187
217
  padding: var(--content-padding, 0 6px);
188
218
  }
189
219
 
@@ -38,6 +38,21 @@ export type PickerMenu<T> = {
38
38
  label: string;
39
39
  icon?: TemplateResult;
40
40
  tooltip?: string;
41
+ /**
42
+ * The accessible name of the MENU shell (`aria-label` on
43
+ * `editor-menu-button`), which the caller supplies whole (#390).
44
+ *
45
+ * It used to be sewn together here as `` `${label.toLowerCase()}-menu` ``.
46
+ * That was a stable identifier while {@link label} was an English literal;
47
+ * once the caller started handing over a TRANSLATED label it became half a
48
+ * sentence in each language ("changer le type de forme-menu"). A menu's
49
+ * accessible name is its own wording, never a composition — the precedent
50
+ * is `ROOT_ALIGNMENT_MENU_ARIA` in `blocks/root`.
51
+ *
52
+ * Left out, the name is composed from {@link label} as before, so a caller
53
+ * that still passes an English literal is unaffected.
54
+ */
55
+ menuAria?: string;
41
56
  items: PickerMenuItem<T>[];
42
57
  currentValue: T;
43
58
  onPick: (value: T) => void;
@@ -51,5 +66,5 @@ export type PickerMenu<T> = {
51
66
  };
52
67
  /** The field of the item that currently matches — its icon, usually. */
53
68
  export declare function renderCurrentPickerItemWith<T, F extends keyof PickerMenuItem<T>>(items: PickerMenuItem<T>[], currentValue: T, field: F): PickerMenuItem<T>[F] | undefined;
54
- export declare function renderPickerMenu<T>({ label, tooltip, icon, items, currentValue, onPick, testId, }: PickerMenu<T>): TemplateResult<1>;
69
+ export declare function renderPickerMenu<T>({ label, tooltip, menuAria, icon, items, currentValue, onPick, testId, }: PickerMenu<T>): TemplateResult<1>;
55
70
  export declare function renderPickerMenuItems<T>(items: PickerMenuItem<T>[], currentValue: T, onPick: (value: T) => void, testId?: string): unknown;
@@ -6,11 +6,11 @@ import { EditorChevronDown } from './chevron-down.js';
6
6
  export function renderCurrentPickerItemWith(items, currentValue, field) {
7
7
  return items.find(({ value }) => value === currentValue)?.[field];
8
8
  }
9
- export function renderPickerMenu({ label, tooltip, icon, items, currentValue, onPick, testId, }) {
9
+ export function renderPickerMenu({ label, tooltip, menuAria, icon, items, currentValue, onPick, testId, }) {
10
10
  return html `
11
11
  <editor-menu-button
12
12
  data-testid=${ifDefined(testId)}
13
- aria-label="${`${label.toLowerCase()}-menu`}"
13
+ aria-label="${menuAria ?? `${label.toLowerCase()}-menu`}"
14
14
  .button=${html `
15
15
  <editor-icon-button
16
16
  data-testid=${ifDefined(testId ? `${testId}-button` : undefined)}
@@ -1,6 +1,7 @@
1
1
  import { LitElement } from 'lit';
2
2
  declare const EditorToolbar_base: typeof LitElement & import("../../global/utils/types.js").Constructor<import("../../global/lit/with-disposable.js").DisposableClass>;
3
3
  export declare class EditorToolbar extends EditorToolbar_base {
4
+ #private;
4
5
  static styles: import("lit").CSSResult;
5
6
  connectedCallback(): void;
6
7
  render(): import("lit-html").TemplateResult<1>;
@@ -2,6 +2,7 @@ import { panelBaseStyle } from '../../affine-shared/styles/index.js';
2
2
  import { stopPropagation } from '../../affine-shared/utils/index.js';
3
3
  import { WithDisposable } from '../../global/lit/index.js';
4
4
  import { css, html, LitElement } from 'lit';
5
+ import { EDITOR_MENU_TOGGLE } from './menu-button.js';
5
6
  export class EditorToolbar extends WithDisposable(LitElement) {
6
7
  static { this.styles = css `
7
8
  ${panelBaseStyle(':host')}
@@ -13,6 +14,27 @@ export class EditorToolbar extends WithDisposable(LitElement) {
13
14
  height: 36px;
14
15
  box-sizing: content-box;
15
16
  flex-wrap: nowrap;
17
+ /* And never outside its own background. The row's width is a max-width
18
+ the positioner writes; entries keep their natural width (below), so a
19
+ row that has nothing left to give up would otherwise paint its last
20
+ icons over the document, past the border and the shadow — which is
21
+ what a 420px window used to show.
22
+
23
+ Clipped on the X axis alone: overflow-x hidden would make the row a
24
+ scroll container on BOTH axes (a visible paired with a hidden computes
25
+ to auto) and swallow the dropdown panels, which are positioned inside
26
+ the row and hang above and below it. */
27
+ overflow-x: clip;
28
+ overflow-y: visible;
29
+ }
30
+
31
+ /* ...except while one of those panels is open. A clipping box is also what
32
+ floating-ui fits a panel into, so left in place the rule above would
33
+ squeeze a 176px menu into the width of the row that opened it — or, for
34
+ a dropdown at one end of the row, cut half of it off. See
35
+ syncOpenMenus below, which is what raises this attribute. */
36
+ :host([data-menu-open]) {
37
+ overflow: visible;
16
38
  }
17
39
 
18
40
  :host([data-without-bg]) {
@@ -35,6 +57,38 @@ export class EditorToolbar extends WithDisposable(LitElement) {
35
57
  fill: currentColor;
36
58
  }
37
59
  `; }
60
+ /** The panels open in this row right now, whatever opened them. */
61
+ #openMenus = new Set();
62
+ /**
63
+ * Says, on the row itself, whether one of its panels is open.
64
+ *
65
+ * Why an attribute at all: the row cannot ask the question in CSS. `:host()`
66
+ * takes a COMPOUND selector and `:has()` is not one, so
67
+ * `:host(:has([data-open]))` is not a rule browsers honour (Chromium
68
+ * 2026-09: it matches from the document, never from inside the shadow root).
69
+ *
70
+ * Why not a `querySelector` for `data-open`, which the buttons do raise:
71
+ * because it answers only for the buttons the row holds DIRECTLY. A colour
72
+ * picker keeps its menu button inside its own shadow root, where neither a
73
+ * `querySelector` nor a `MutationObserver` of this row can see it — and that
74
+ * is the row whose panel the clip was cutting in half
75
+ * (`framework-palette-carousel.spec.ts`). {@link EDITOR_MENU_TOGGLE} is
76
+ * composed, so it crosses every boundary, and it is raised before the panel
77
+ * is ever positioned.
78
+ *
79
+ * A panel whose button is taken off the row by a re-render never says it
80
+ * closed, so the set is swept of anything no longer in a document.
81
+ */
82
+ #syncOpenMenus() {
83
+ for (const menu of this.#openMenus) {
84
+ if (!menu.isConnected)
85
+ this.#openMenus.delete(menu);
86
+ }
87
+ if (this.#openMenus.size > 0)
88
+ this.dataset.menuOpen = 'true';
89
+ else
90
+ delete this.dataset.menuOpen;
91
+ }
38
92
  connectedCallback() {
39
93
  super.connectedCallback();
40
94
  this._disposables.addFromEvent(this, 'pointerdown', (e) => {
@@ -44,6 +98,19 @@ export class EditorToolbar extends WithDisposable(LitElement) {
44
98
  this._disposables.addFromEvent(this, 'wheel', stopPropagation, {
45
99
  passive: false,
46
100
  });
101
+ this._disposables.addFromEvent(this, EDITOR_MENU_TOGGLE, (e) => {
102
+ // The deepest element of the path, not `target`: a composed event that
103
+ // crosses a shadow boundary is retargeted to the host it came out of,
104
+ // and one host may hold more than one panel.
105
+ const menu = e.composedPath()[0];
106
+ if (!(menu instanceof Element))
107
+ return;
108
+ if (e.detail)
109
+ this.#openMenus.add(menu);
110
+ else
111
+ this.#openMenus.delete(menu);
112
+ this.#syncOpenMenus();
113
+ });
47
114
  }
48
115
  render() {
49
116
  return html `<slot></slot>`;
@@ -1,5 +1,5 @@
1
- import type { BlockStdScope } from '../../std/index.js';
2
- import type { Store, TransformerMiddleware } from '../../store/index.js';
1
+ import type { BlockStdScope } from '../std/index.js';
2
+ import type { Store, TransformerMiddleware } from '../store/index.js';
3
3
  import { LitElement, type PropertyValues } from 'lit';
4
4
  export declare const AFFINE_ADAPTER_PANEL = "affine-adapter-panel";
5
5
  declare const AdapterPanel_base: typeof LitElement & import("../global/utils/types.js").Constructor<import("../global/lit/with-disposable.js").DisposableClass>;
@@ -138,7 +138,7 @@ let FrameCardTitleEditor = (() => {
138
138
  background: 'var(--affine-background-primary-color)',
139
139
  border: '1px solid var(--affine-primary-color)',
140
140
  color: 'var(--affine-text-primary-color)',
141
- boxShadow: '0px 0px 0px 2px rgba(30, 150, 235, 0.30)',
141
+ boxShadow: '0px 0px 0px 2px color-mix(in srgb, var(--affine-primary-color) 30%, transparent)',
142
142
  zIndex: '1',
143
143
  display: 'block',
144
144
  });
@@ -32,6 +32,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
32
32
  }
33
33
  return useValue ? value : void 0;
34
34
  };
35
+ import { panelDragStarted } from '../../affine-shared/styles/index.js';
35
36
  import { on, once } from '../../affine-shared/utils/index.js';
36
37
  import { WithDisposable } from '../../global/lit/index.js';
37
38
  import { ShadowlessElement } from '../../std/index.js';
@@ -69,7 +70,7 @@ const styles = css `
69
70
  }
70
71
 
71
72
  .frame-card-container.selected .frame-card-body {
72
- border: 2px solid var(--light-brand-color, #1e96eb);
73
+ border: 2px solid var(--affine-primary-color);
73
74
  }
74
75
 
75
76
  .frame-card-container.dragging {
@@ -174,8 +175,7 @@ let FrameCard = (() => {
174
175
  return;
175
176
  const { clientX: startX, clientY: startY } = e;
176
177
  const disposeDragStart = on(this.ownerDocument, 'mousemove', e => {
177
- if (Math.abs(startX - e.clientX) < 5 &&
178
- Math.abs(startY - e.clientY) < 5) {
178
+ if (!panelDragStarted({ x: startX, y: startY }, { x: e.clientX, y: e.clientY })) {
179
179
  return;
180
180
  }
181
181
  if (this.status !== 'selected') {
@@ -3,7 +3,7 @@ import { LitElement, type PropertyValues } from 'lit';
3
3
  export declare const AFFINE_FRAME_PANEL_HEADER = "affine-frame-panel-header";
4
4
  declare const FramePanelHeader_base: typeof LitElement & import("../../global/utils/types.js").Constructor<import("../../global/lit/with-disposable.js").DisposableClass>;
5
5
  export declare class FramePanelHeader extends FramePanelHeader_base {
6
- static styles: import("lit").CSSResult;
6
+ static styles: import("lit").CSSResult[];
7
7
  private readonly _clearEdgelessDisposables;
8
8
  private _edgelessDisposables;
9
9
  private get _gfx();
@@ -35,6 +35,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
35
35
  import { PresentTool } from '../../affine-block-frame/index.js';
36
36
  import { EdgelessLegacySlotIdentifier } from '../../affine-block-surface/index.js';
37
37
  import { DocModeProvider, EditPropsStore, translateKey, } from '../../affine-shared/services/index.js';
38
+ import { panelHeaderStyles } from '../../affine-shared/styles/index.js';
38
39
  import { createButtonPopper } from '../../affine-shared/utils/index.js';
39
40
  import { DisposableGroup } from '../../global/disposable/index.js';
40
41
  import { WithDisposable } from '../../global/lit/index.js';
@@ -50,16 +51,6 @@ const styles = css `
50
51
  justify-content: start;
51
52
  }
52
53
 
53
- .frame-panel-header {
54
- display: flex;
55
- width: 100%;
56
- height: 36px;
57
- align-items: center;
58
- justify-content: space-between;
59
- box-sizing: border-box;
60
- padding: 0 8px;
61
- }
62
-
63
54
  .all-frames-setting {
64
55
  display: flex;
65
56
  align-items: center;
@@ -69,22 +60,9 @@ const styles = css `
69
60
  margin: 8px 4px;
70
61
  }
71
62
 
72
- .all-frames-setting-button svg {
73
- color: var(--affine-icon-secondary);
74
- }
75
-
76
- .all-frames-setting-button:hover svg,
77
- .all-frames-setting-button.active svg {
78
- color: var(--affine-icon-color);
79
- }
80
-
81
63
  .all-frames-setting-label {
82
64
  width: 68px;
83
65
  height: 22px;
84
- font-size: var(--affine-font-sm);
85
- font-weight: 500;
86
- line-height: 22px;
87
- color: var(--light-text-color-text-secondary-color, #8e8d91);
88
66
  }
89
67
 
90
68
  .frames-setting-container {
@@ -158,7 +136,9 @@ let FramePanelHeader = (() => {
158
136
  __esDecorate(this, null, _editorHost_decorators, { kind: "accessor", name: "editorHost", static: false, private: false, access: { has: obj => "editorHost" in obj, get: obj => obj.editorHost, set: (obj, value) => { obj.editorHost = value; } }, metadata: _metadata }, _editorHost_initializers, _editorHost_extraInitializers);
159
137
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
160
138
  }
161
- static { this.styles = styles; }
139
+ // The header row, title and icon button are every side panel's: they live in
140
+ // panelHeaderStyles so the selection pane and the catalogue draw the same.
141
+ static { this.styles = [panelHeaderStyles, styles]; }
162
142
  get _gfx() {
163
143
  return this.editorHost.std.get(GfxControllerIdentifier);
164
144
  }
@@ -194,13 +174,14 @@ let FramePanelHeader = (() => {
194
174
  }
195
175
  render() {
196
176
  const { std } = this.editorHost;
197
- return html `<div class="frame-panel-header">
177
+ return html `<div class="frame-panel-header affine-panel-header">
198
178
  <div class="all-frames-setting">
199
- <span class="all-frames-setting-label"
179
+ <span class="all-frames-setting-label affine-panel-header-title"
200
180
  >${translateKey(std, ...FRAME_PANEL_ALL_FRAMES_LABEL)}</span
201
181
  >
202
182
  <edgeless-tool-icon-button
203
- class="all-frames-setting-button ${this._settingPopperShow
183
+ class="all-frames-setting-button affine-panel-header-button ${this
184
+ ._settingPopperShow
204
185
  ? 'active'
205
186
  : ''}"
206
187
  .tooltip=${this._settingPopperShow
@@ -1 +1,2 @@
1
1
  export * from './frame-panel.js';
2
+ export * from './header/frame-panel-header.js';
@@ -1 +1,2 @@
1
1
  export * from './frame-panel.js';
2
+ export * from './header/frame-panel-header.js';
@@ -45,7 +45,7 @@ export const EdgelessEraserLightIcon = html `<svg
45
45
  />
46
46
  <path
47
47
  d="M27.5 16.5H33H34.6295C35.2048 16.5 35.706 16.8921 35.8443 17.4505L35.8583 17.5067C36.0615 18.3269 36.7242 18.9534 37.5545 19.1105C38.1029 19.2142 38.5 19.6934 38.5 20.2516V21.75V27.5V39V61.5H27.5V16.5Z"
48
- fill="#1E96EB"
48
+ fill="var(--affine-primary-color)"
49
49
  />
50
50
  <path
51
51
  d="M27.5 16.5H33H34.6295C35.2048 16.5 35.706 16.8921 35.8443 17.4505L35.8583 17.5067C36.0615 18.3269 36.7242 18.9534 37.5545 19.1105C38.1029 19.2142 38.5 19.6934 38.5 20.2516V21.75V27.5V39V61.5H27.5V16.5Z"
@@ -41,11 +41,20 @@ import { type TypedEdge } from './typed-edge.js';
41
41
  * a `@local()` field. The reveal is session state and leaves with the pointer.
42
42
  */
43
43
  /**
44
- * The one colour the reveal is drawn in — the house primary, i.e. the colour of
44
+ * The one colour the reveal is drawn in — the chrome accent, i.e. the colour of
45
45
  * an affordance rather than of ink. Deliberately NOT the framework's palette:
46
46
  * the label is the tool talking about the drawing, not part of the drawing.
47
+ *
48
+ * A TOKEN, not a hex: the chip is rendered in the DOM (`direction-widget.ts`),
49
+ * so it follows whatever the host sets `--affine-primary-color` to. The accent
50
+ * is AFFiNE's and due to be replaced — DESIGN.md, The Borrowed Blue Rule.
51
+ *
52
+ * It is the colour of EVERY typed edge of every framework: no role declares a
53
+ * `chipColor` any more (PO recette of 23/09/2026, after one that did produced
54
+ * two blues on one map). `affine/all/src/__tests__/direction-chip-accent.unit.spec.ts`
55
+ * reads the mounted vocabularies and keeps it that way.
47
56
  */
48
- export declare const EDGE_DIRECTION_COLOR = "#1e96eb";
57
+ export declare const EDGE_DIRECTION_COLOR = "var(--affine-primary-color)";
49
58
  /**
50
59
  * Where the label sits on a typed edge, and how it is turned.
51
60
  *
@@ -40,11 +40,20 @@ import { asTypedEdge, edgeIsBound, roleVocabularies, } from './typed-edge.js';
40
40
  * a `@local()` field. The reveal is session state and leaves with the pointer.
41
41
  */
42
42
  /**
43
- * The one colour the reveal is drawn in — the house primary, i.e. the colour of
43
+ * The one colour the reveal is drawn in — the chrome accent, i.e. the colour of
44
44
  * an affordance rather than of ink. Deliberately NOT the framework's palette:
45
45
  * the label is the tool talking about the drawing, not part of the drawing.
46
+ *
47
+ * A TOKEN, not a hex: the chip is rendered in the DOM (`direction-widget.ts`),
48
+ * so it follows whatever the host sets `--affine-primary-color` to. The accent
49
+ * is AFFiNE's and due to be replaced — DESIGN.md, The Borrowed Blue Rule.
50
+ *
51
+ * It is the colour of EVERY typed edge of every framework: no role declares a
52
+ * `chipColor` any more (PO recette of 23/09/2026, after one that did produced
53
+ * two blues on one map). `affine/all/src/__tests__/direction-chip-accent.unit.spec.ts`
54
+ * reads the mounted vocabularies and keeps it that way.
46
55
  */
47
- export const EDGE_DIRECTION_COLOR = '#1e96eb';
56
+ export const EDGE_DIRECTION_COLOR = 'var(--affine-primary-color)';
48
57
  const pathOf = (model) => {
49
58
  const path = model.absolutePath;
50
59
  return Array.isArray(path) && path.length >= 2 ? path : null;
@@ -1,3 +1,4 @@
1
+ import { textDecorationLine } from '../../../affine-gfx-text/index.js';
1
2
  import { ConnectorMode, DefaultTheme, } from '../../../affine-model/index.js';
2
3
  import { PointLocation, SVGPathBuilder } from '../../../global/gfx/index.js';
3
4
  import { isConnectorWithLabel } from '../../connector-manager.js';
@@ -207,7 +208,7 @@ function renderConnectorLabel(model, retained, renderer, zoom, slot) {
207
208
  return;
208
209
  }
209
210
  const [lx, ly, lw, lh] = content.xywh;
210
- const { labelStyle: { color, fontSize, fontWeight, fontStyle, fontFamily, textAlign, }, } = model;
211
+ const { labelStyle: { color, fontSize, fontWeight, fontStyle, fontFamily, textAlign, textDecoration, }, } = model;
211
212
  const labelElement = getOrCreateLabelElement(retained, slot);
212
213
  labelElement.style.position = 'absolute';
213
214
  labelElement.style.left = `${lx * zoom}px`;
@@ -231,6 +232,7 @@ function renderConnectorLabel(model, retained, renderer, zoom, slot) {
231
232
  labelElement.style.fontStyle = fontStyle;
232
233
  labelElement.style.fontFamily = fontFamily;
233
234
  labelElement.style.textAlign = textAlign;
235
+ labelElement.style.textDecorationLine = textDecorationLine(textDecoration);
234
236
  labelElement.style.lineHeight = '1.2';
235
237
  labelElement.style.whiteSpace = 'pre-wrap';
236
238
  labelElement.style.wordWrap = 'break-word';