@formicoidea/labre-core 0.43.1 → 0.46.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 (300) 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-callout-into.d.ts +43 -0
  4. package/dist/_pkgs/affine-block-callout/commands/turn-callout-into.js +109 -0
  5. package/dist/_pkgs/affine-block-callout/commands/turn-into-callout.d.ts +29 -0
  6. package/dist/_pkgs/affine-block-callout/commands/turn-into-callout.js +81 -0
  7. package/dist/_pkgs/affine-block-callout/configs/slash-menu.js +6 -4
  8. package/dist/_pkgs/affine-block-callout/configs/toolbar.d.ts +65 -0
  9. package/dist/_pkgs/affine-block-callout/configs/toolbar.js +178 -0
  10. package/dist/_pkgs/affine-block-callout/configs/turn-into.d.ts +8 -0
  11. package/dist/_pkgs/affine-block-callout/configs/turn-into.js +19 -0
  12. package/dist/_pkgs/affine-block-callout/translations.d.ts +4 -2
  13. package/dist/_pkgs/affine-block-callout/translations.js +4 -2
  14. package/dist/_pkgs/affine-block-callout/view.js +10 -1
  15. package/dist/_pkgs/affine-block-code/code-block-service.d.ts +13 -0
  16. package/dist/_pkgs/affine-block-code/code-block-service.js +26 -0
  17. package/dist/_pkgs/affine-block-code/code-block.d.ts +6 -0
  18. package/dist/_pkgs/affine-block-code/code-block.js +11 -2
  19. package/dist/_pkgs/affine-block-code/code-toolbar/components/lang-button.js +31 -8
  20. package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/config.d.ts +11 -0
  21. package/dist/_pkgs/affine-block-edgeless-text/svg-painter.d.ts +20 -0
  22. package/dist/_pkgs/affine-block-edgeless-text/svg-painter.js +76 -0
  23. package/dist/_pkgs/affine-block-edgeless-text/view.js +2 -0
  24. package/dist/_pkgs/affine-block-embed/configs/toolbar.js +11 -2
  25. package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.js +11 -2
  26. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-edgeless-linked-doc-block.js +3 -1
  27. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/configs/toolbar.js +7 -2
  28. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-edgeless-synced-doc-block.js +3 -1
  29. package/dist/_pkgs/affine-block-frame/commands.d.ts +27 -0
  30. package/dist/_pkgs/affine-block-frame/commands.js +49 -0
  31. package/dist/_pkgs/affine-block-frame/frame-manager.d.ts +16 -6
  32. package/dist/_pkgs/affine-block-frame/frame-manager.js +58 -22
  33. package/dist/_pkgs/affine-block-frame/frame-order.d.ts +43 -0
  34. package/dist/_pkgs/affine-block-frame/frame-order.js +93 -0
  35. package/dist/_pkgs/affine-block-frame/frame-tool.js +3 -1
  36. package/dist/_pkgs/affine-block-frame/index.d.ts +2 -0
  37. package/dist/_pkgs/affine-block-frame/index.js +2 -0
  38. package/dist/_pkgs/affine-block-frame/present/frame-order-menu.d.ts +10 -2
  39. package/dist/_pkgs/affine-block-frame/present/frame-order-menu.js +32 -18
  40. package/dist/_pkgs/affine-block-frame/view.js +6 -0
  41. package/dist/_pkgs/affine-block-image/utils.js +4 -1
  42. package/dist/_pkgs/affine-block-latex/adapters/markdown/preprocessor.d.ts +8 -0
  43. package/dist/_pkgs/affine-block-latex/adapters/markdown/preprocessor.js +9 -5
  44. package/dist/_pkgs/affine-block-note/configs/toolbar.d.ts +19 -0
  45. package/dist/_pkgs/affine-block-note/configs/toolbar.js +38 -23
  46. package/dist/_pkgs/affine-block-note/translations.d.ts +2 -1
  47. package/dist/_pkgs/affine-block-note/translations.js +14 -6
  48. package/dist/_pkgs/affine-block-root/configs/toolbar.js +48 -3
  49. package/dist/_pkgs/affine-block-root/edgeless/clipboard/clipboard.js +2 -1
  50. package/dist/_pkgs/affine-block-root/edgeless/clipboard/command.js +161 -83
  51. package/dist/_pkgs/affine-block-root/edgeless/clipboard/paste-order.d.ts +21 -0
  52. package/dist/_pkgs/affine-block-root/edgeless/clipboard/paste-order.js +85 -0
  53. package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.d.ts +6 -0
  54. package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.js +18 -1
  55. package/dist/_pkgs/affine-block-root/edgeless/utils/clone-utils.d.ts +9 -0
  56. package/dist/_pkgs/affine-block-root/edgeless/utils/clone-utils.js +28 -0
  57. package/dist/_pkgs/affine-block-root/keyboard/commands.js +9 -6
  58. package/dist/_pkgs/affine-block-root/preview/edgeless-root-preview-block.js +15 -2
  59. package/dist/_pkgs/affine-block-root/translations.d.ts +7 -2
  60. package/dist/_pkgs/affine-block-root/translations.js +10 -13
  61. package/dist/_pkgs/affine-block-surface/adapters/markdown/element-adapter/type.d.ts +1 -1
  62. package/dist/_pkgs/affine-block-surface/element-model/index.d.ts +1 -1
  63. package/dist/_pkgs/affine-block-surface/element-model/index.js +1 -1
  64. package/dist/_pkgs/affine-block-surface/extensions/audit.js +13 -61
  65. package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/commands.d.ts +2 -0
  66. package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/commands.js +71 -0
  67. package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/index.d.ts +1 -0
  68. package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/index.js +1 -0
  69. package/dist/_pkgs/affine-block-surface/extensions/clipboard-config.js +4 -0
  70. package/dist/_pkgs/affine-block-surface/extensions/crud-extension.js +4 -0
  71. package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.d.ts +12 -0
  72. package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.js +27 -7
  73. package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.d.ts +2 -1
  74. package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.js +22 -3
  75. package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.d.ts +6 -3
  76. package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.js +4 -2
  77. package/dist/_pkgs/affine-block-surface/extensions/export-svg/parts.d.ts +63 -0
  78. package/dist/_pkgs/affine-block-surface/extensions/export-svg/parts.js +67 -0
  79. package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.d.ts +62 -5
  80. package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.js +98 -18
  81. package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.d.ts +14 -0
  82. package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.js +82 -1
  83. package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.d.ts +2 -2
  84. package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.js +112 -10
  85. package/dist/_pkgs/affine-block-surface/extensions/export-svg/translations.d.ts +13 -0
  86. package/dist/_pkgs/affine-block-surface/extensions/export-svg/translations.js +33 -0
  87. package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +3 -0
  88. package/dist/_pkgs/affine-block-surface/extensions/index.js +3 -0
  89. package/dist/_pkgs/affine-block-surface/extensions/reading-widget.d.ts +13 -6
  90. package/dist/_pkgs/affine-block-surface/extensions/reading-widget.js +26 -10
  91. package/dist/_pkgs/affine-block-surface/extensions/reading.d.ts +82 -6
  92. package/dist/_pkgs/affine-block-surface/extensions/reading.js +99 -21
  93. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/actions.d.ts +91 -0
  94. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/actions.js +285 -0
  95. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/commands.d.ts +80 -0
  96. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/commands.js +355 -0
  97. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/index.d.ts +3 -0
  98. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/index.js +3 -0
  99. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/tree.d.ts +137 -0
  100. package/dist/_pkgs/affine-block-surface/extensions/selection-pane/tree.js +323 -0
  101. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.d.ts +112 -4
  102. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +86 -15
  103. package/dist/_pkgs/affine-block-surface/extensions/user-layers/actions.d.ts +76 -0
  104. package/dist/_pkgs/affine-block-surface/extensions/user-layers/actions.js +299 -0
  105. package/dist/_pkgs/affine-block-surface/extensions/user-layers/active-layer.d.ts +20 -0
  106. package/dist/_pkgs/affine-block-surface/extensions/user-layers/active-layer.js +34 -0
  107. package/dist/_pkgs/affine-block-surface/extensions/user-layers/commands.d.ts +67 -0
  108. package/dist/_pkgs/affine-block-surface/extensions/user-layers/commands.js +172 -0
  109. package/dist/_pkgs/affine-block-surface/extensions/user-layers/creation.d.ts +40 -0
  110. package/dist/_pkgs/affine-block-surface/extensions/user-layers/creation.js +69 -0
  111. package/dist/_pkgs/affine-block-surface/extensions/user-layers/index.d.ts +5 -0
  112. package/dist/_pkgs/affine-block-surface/extensions/user-layers/index.js +5 -0
  113. package/dist/_pkgs/affine-block-surface/extensions/user-layers/translations.d.ts +10 -0
  114. package/dist/_pkgs/affine-block-surface/extensions/user-layers/translations.js +14 -0
  115. package/dist/_pkgs/affine-block-surface/framework-background/facts.d.ts +55 -2
  116. package/dist/_pkgs/affine-block-surface/framework-background/facts.js +63 -1
  117. package/dist/_pkgs/affine-block-surface/framework-background/stacking.d.ts +16 -8
  118. package/dist/_pkgs/affine-block-surface/framework-background/stacking.js +26 -14
  119. package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.js +17 -3
  120. package/dist/_pkgs/affine-block-surface/renderer/dom-renderer.d.ts +3 -1
  121. package/dist/_pkgs/affine-block-surface/renderer/dom-renderer.js +22 -2
  122. package/dist/_pkgs/affine-block-surface/renderer/paint-predicate.d.ts +30 -0
  123. package/dist/_pkgs/affine-block-surface/renderer/paint-predicate.js +29 -0
  124. package/dist/_pkgs/affine-block-surface/surface-block.js +6 -0
  125. package/dist/_pkgs/affine-block-surface/surface-model.js +5 -0
  126. package/dist/_pkgs/affine-block-surface/surface-transformer.js +5 -0
  127. package/dist/_pkgs/affine-block-surface/tool/default-tool.js +28 -5
  128. package/dist/_pkgs/affine-block-surface/view.js +23 -1
  129. package/dist/_pkgs/affine-block-surface-ref/surface-ref-block.js +12 -2
  130. package/dist/_pkgs/affine-components/context-menu/button.js +14 -0
  131. package/dist/_pkgs/affine-components/filterable-list/index.js +30 -9
  132. package/dist/_pkgs/affine-components/icons/index.d.ts +0 -1
  133. package/dist/_pkgs/affine-components/icons/index.js +0 -1
  134. package/dist/_pkgs/affine-components/icons/text.d.ts +1 -0
  135. package/dist/_pkgs/affine-components/icons/text.js +11 -0
  136. package/dist/_pkgs/affine-components/portal/portal.d.ts +1 -1
  137. package/dist/_pkgs/affine-foundation/view.d.ts +8 -8
  138. package/dist/_pkgs/affine-fragment-adapter-panel/adapter-panel.d.ts +2 -2
  139. package/dist/_pkgs/affine-fragment-frame-panel/body/frame-panel-body.d.ts +34 -2
  140. package/dist/_pkgs/affine-fragment-frame-panel/body/frame-panel-body.js +194 -81
  141. package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card.d.ts +7 -4
  142. package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card.js +9 -24
  143. package/dist/_pkgs/affine-fragment-frame-panel/header/frame-panel-header.d.ts +1 -1
  144. package/dist/_pkgs/affine-fragment-frame-panel/header/frame-panel-header.js +8 -27
  145. package/dist/_pkgs/affine-fragment-frame-panel/index.d.ts +2 -0
  146. package/dist/_pkgs/affine-fragment-frame-panel/index.js +2 -0
  147. package/dist/_pkgs/affine-gfx-connector/element-renderer/connector-dom/index.js +3 -1
  148. package/dist/_pkgs/affine-gfx-connector/element-renderer/index.js +21 -4
  149. package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.js +3 -2
  150. package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +1 -1
  151. package/dist/_pkgs/affine-gfx-group/command/group-api.js +52 -1
  152. package/dist/_pkgs/affine-gfx-shape/element-renderer/shape/index.js +21 -3
  153. package/dist/_pkgs/affine-gfx-shape/text/edgeless-shape-text-editor.js +2 -0
  154. package/dist/_pkgs/affine-gfx-shape/toolbar/config.js +1 -1
  155. package/dist/_pkgs/affine-gfx-template/services/template-middlewares.d.ts +9 -0
  156. package/dist/_pkgs/affine-gfx-template/services/template-middlewares.js +23 -1
  157. package/dist/_pkgs/affine-gfx-template/services/template.js +2 -1
  158. package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.js +2 -1
  159. package/dist/_pkgs/affine-gfx-text/element-renderer/index.js +20 -3
  160. package/dist/_pkgs/affine-gfx-text/element-renderer/utils.d.ts +67 -1
  161. package/dist/_pkgs/affine-gfx-text/element-renderer/utils.js +101 -0
  162. package/dist/_pkgs/affine-gfx-text/toolbar/actions.d.ts +11 -0
  163. package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +53 -2
  164. package/dist/_pkgs/affine-gfx-text/toolbar/config.d.ts +11 -0
  165. package/dist/_pkgs/affine-gfx-text/toolbar/config.js +1 -1
  166. package/dist/_pkgs/affine-inline-preset/adapters/html/html-inline.d.ts +3 -0
  167. package/dist/_pkgs/affine-inline-preset/adapters/html/html-inline.js +31 -0
  168. package/dist/_pkgs/affine-inline-preset/adapters/html/inline-delta.d.ts +4 -0
  169. package/dist/_pkgs/affine-inline-preset/adapters/html/inline-delta.js +14 -0
  170. package/dist/_pkgs/affine-inline-preset/command/config.js +21 -3
  171. package/dist/_pkgs/affine-inline-preset/command/index.d.ts +1 -1
  172. package/dist/_pkgs/affine-inline-preset/command/index.js +1 -1
  173. package/dist/_pkgs/affine-inline-preset/command/text-style.d.ts +2 -1
  174. package/dist/_pkgs/affine-inline-preset/command/text-style.js +1 -0
  175. package/dist/_pkgs/affine-inline-preset/default-inline-manager.js +2 -1
  176. package/dist/_pkgs/affine-inline-preset/inline-spec.d.ts +4 -0
  177. package/dist/_pkgs/affine-inline-preset/inline-spec.js +14 -0
  178. package/dist/_pkgs/affine-inline-preset/translations.d.ts +2 -2
  179. package/dist/_pkgs/affine-inline-preset/translations.js +2 -2
  180. package/dist/_pkgs/affine-model/blocks/attachment/attachment-model.js +2 -0
  181. package/dist/_pkgs/affine-model/blocks/bookmark/bookmark-model.js +2 -0
  182. package/dist/_pkgs/affine-model/blocks/edgeless-text/edgeless-text-model.d.ts +1 -1
  183. package/dist/_pkgs/affine-model/blocks/edgeless-text/edgeless-text-model.js +2 -0
  184. package/dist/_pkgs/affine-model/blocks/embed/iframe/iframe-model.js +2 -0
  185. package/dist/_pkgs/affine-model/blocks/frame/frame-model.js +2 -0
  186. package/dist/_pkgs/affine-model/blocks/image/image-model.js +2 -0
  187. package/dist/_pkgs/affine-model/blocks/latex/latex-model.js +2 -0
  188. package/dist/_pkgs/affine-model/blocks/note/note-model.js +2 -0
  189. package/dist/_pkgs/affine-model/consts/text.d.ts +26 -0
  190. package/dist/_pkgs/affine-model/consts/text.js +25 -0
  191. package/dist/_pkgs/affine-model/elements/shape/shape.d.ts +6 -1
  192. package/dist/_pkgs/affine-model/elements/shape/shape.js +14 -1
  193. package/dist/_pkgs/affine-model/elements/text/text.d.ts +6 -1
  194. package/dist/_pkgs/affine-model/elements/text/text.js +13 -1
  195. package/dist/_pkgs/affine-model/utils/helper.js +2 -0
  196. package/dist/_pkgs/affine-model/utils/types.d.ts +2 -2
  197. package/dist/_pkgs/affine-rich-text/conversion.d.ts +25 -0
  198. package/dist/_pkgs/affine-rich-text/conversion.js +9 -0
  199. package/dist/_pkgs/affine-rich-text/index.d.ts +1 -1
  200. package/dist/_pkgs/affine-rich-text/index.js +1 -1
  201. package/dist/_pkgs/affine-shared/commands/model-crud/replace-selected-text-with-blocks.d.ts +1 -1
  202. package/dist/_pkgs/affine-shared/services/canvas-grid.d.ts +63 -0
  203. package/dist/_pkgs/affine-shared/services/canvas-grid.js +109 -0
  204. package/dist/_pkgs/affine-shared/services/canvas-local-visibility.d.ts +64 -0
  205. package/dist/_pkgs/affine-shared/services/canvas-local-visibility.js +192 -0
  206. package/dist/_pkgs/affine-shared/services/edit-props-store.d.ts +31 -4
  207. package/dist/_pkgs/affine-shared/services/edit-props-store.js +34 -0
  208. package/dist/_pkgs/affine-shared/services/editor-setting-service.d.ts +3 -0
  209. package/dist/_pkgs/affine-shared/services/editor-setting-service.js +7 -0
  210. package/dist/_pkgs/affine-shared/services/feature-flag-service.d.ts +4 -0
  211. package/dist/_pkgs/affine-shared/services/font-loader/config.d.ts +2 -2
  212. package/dist/_pkgs/affine-shared/services/font-loader/font-loader-service.d.ts +3 -3
  213. package/dist/_pkgs/affine-shared/services/index.d.ts +4 -1
  214. package/dist/_pkgs/affine-shared/services/index.js +4 -1
  215. package/dist/_pkgs/affine-shared/services/link-preview-service/link-preview-storage.d.ts +4 -4
  216. package/dist/_pkgs/affine-shared/services/outline-panel-service.d.ts +31 -0
  217. package/dist/_pkgs/affine-shared/services/outline-panel-service.js +17 -0
  218. package/dist/_pkgs/affine-shared/services/selection-pane-service.d.ts +44 -0
  219. package/dist/_pkgs/affine-shared/services/selection-pane-service.js +28 -0
  220. package/dist/_pkgs/affine-shared/services/telemetry-service/lifecycle.d.ts +69 -0
  221. package/dist/_pkgs/affine-shared/services/telemetry-service/telemetry-service.d.ts +2 -2
  222. package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +16 -0
  223. package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +28 -0
  224. package/dist/_pkgs/affine-shared/styles/index.d.ts +1 -0
  225. package/dist/_pkgs/affine-shared/styles/index.js +1 -0
  226. package/dist/_pkgs/affine-shared/styles/panel-header.d.ts +31 -0
  227. package/dist/_pkgs/affine-shared/styles/panel-header.js +61 -0
  228. package/dist/_pkgs/affine-shared/styles/text.js +7 -7
  229. package/dist/_pkgs/affine-shared/types/index.d.ts +6 -0
  230. package/dist/_pkgs/affine-shared/utils/canvas-export-colors.d.ts +26 -0
  231. package/dist/_pkgs/affine-shared/utils/canvas-export-colors.js +127 -0
  232. package/dist/_pkgs/affine-shared/utils/file/filesys.d.ts +8 -11
  233. package/dist/_pkgs/affine-shared/utils/file/filesys.js +8 -11
  234. package/dist/_pkgs/affine-shared/utils/index.d.ts +3 -0
  235. package/dist/_pkgs/affine-shared/utils/index.js +3 -0
  236. package/dist/_pkgs/affine-shared/utils/label-mode.d.ts +47 -0
  237. package/dist/_pkgs/affine-shared/utils/label-mode.js +55 -0
  238. package/dist/_pkgs/affine-shared/utils/model/merge-to-code-model.js +7 -1
  239. package/dist/_pkgs/affine-shared/utils/model/transform-model.js +5 -0
  240. package/dist/_pkgs/affine-shared/utils/panel-reorder-drag.d.ts +85 -0
  241. package/dist/_pkgs/affine-shared/utils/panel-reorder-drag.js +162 -0
  242. package/dist/_pkgs/affine-widget-edgeless-selected-rect/utils.js +10 -3
  243. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.js +25 -49
  244. package/dist/_pkgs/affine-widget-edgeless-toolbar/effects.d.ts +4 -0
  245. package/dist/_pkgs/affine-widget-edgeless-toolbar/effects.js +4 -0
  246. package/dist/_pkgs/affine-widget-edgeless-toolbar/index.d.ts +4 -0
  247. package/dist/_pkgs/affine-widget-edgeless-toolbar/index.js +4 -0
  248. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/drop.d.ts +62 -0
  249. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/drop.js +94 -0
  250. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/labels.d.ts +17 -0
  251. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/labels.js +95 -0
  252. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-default.d.ts +10 -0
  253. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-default.js +31 -0
  254. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-tool.d.ts +26 -0
  255. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-tool.js +82 -0
  256. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-widget.d.ts +186 -0
  257. package/dist/_pkgs/affine-widget-edgeless-toolbar/selection-pane/selection-pane-widget.js +1417 -0
  258. package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.d.ts +52 -0
  259. package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.js +161 -1
  260. package/dist/_pkgs/affine-widget-edgeless-toolbar/view.js +10 -0
  261. package/dist/_pkgs/affine-widget-note-slicer/note-slicer.js +7 -3
  262. package/dist/_pkgs/std/gfx/controller.d.ts +13 -0
  263. package/dist/_pkgs/std/gfx/controller.js +22 -2
  264. package/dist/_pkgs/std/gfx/grid.d.ts +31 -2
  265. package/dist/_pkgs/std/gfx/index.d.ts +3 -1
  266. package/dist/_pkgs/std/gfx/index.js +3 -1
  267. package/dist/_pkgs/std/gfx/interactivity/manager.js +7 -0
  268. package/dist/_pkgs/std/gfx/layer.js +73 -5
  269. package/dist/_pkgs/std/gfx/local-visibility.d.ts +88 -0
  270. package/dist/_pkgs/std/gfx/local-visibility.js +217 -0
  271. package/dist/_pkgs/std/gfx/model/gfx-block-model.d.ts +13 -0
  272. package/dist/_pkgs/std/gfx/model/surface/element-model.d.ts +34 -0
  273. package/dist/_pkgs/std/gfx/model/surface/element-model.js +65 -1
  274. package/dist/_pkgs/std/gfx/model/surface/surface-model.d.ts +27 -0
  275. package/dist/_pkgs/std/gfx/model/surface/surface-model.js +43 -0
  276. package/dist/_pkgs/std/gfx/model/surface/user-layers.d.ts +68 -0
  277. package/dist/_pkgs/std/gfx/model/surface/user-layers.js +127 -0
  278. package/dist/_pkgs/std/scope/std-scope.d.ts +1 -1
  279. package/dist/_pkgs/std/utils/layer.d.ts +10 -0
  280. package/dist/_pkgs/std/utils/layer.js +64 -13
  281. package/dist/_pkgs/std/view/element/gfx-block-component.js +10 -2
  282. package/dist/commands.js +6 -1
  283. package/dist/host-panels.d.ts +90 -0
  284. package/dist/host-panels.js +111 -0
  285. package/dist/translations.js +10 -6
  286. package/package.json +13 -2
  287. package/dist/_pkgs/affine-components/icons/file-icons-rc.d.ts +0 -1
  288. package/dist/_pkgs/affine-components/icons/file-icons-rc.js +0 -130
  289. package/dist/_pkgs/affine-fragment-frame-panel/utils/drag.d.ts +0 -27
  290. package/dist/_pkgs/affine-fragment-frame-panel/utils/drag.js +0 -96
  291. package/dist/_pkgs/affine-shared/services/sidebar-service.d.ts +0 -8
  292. package/dist/_pkgs/affine-shared/services/sidebar-service.js +0 -7
  293. package/dist/_pkgs/affine-shared/test-utils/affine-template.d.ts +0 -6
  294. package/dist/_pkgs/affine-shared/test-utils/affine-template.js +0 -258
  295. package/dist/_pkgs/affine-shared/test-utils/affine-test-utils.d.ts +0 -8
  296. package/dist/_pkgs/affine-shared/test-utils/affine-test-utils.js +0 -81
  297. package/dist/_pkgs/affine-shared/test-utils/create-test-host.d.ts +0 -23
  298. package/dist/_pkgs/affine-shared/test-utils/create-test-host.js +0 -187
  299. package/dist/_pkgs/affine-shared/test-utils/index.d.ts +0 -3
  300. package/dist/_pkgs/affine-shared/test-utils/index.js +0 -3
@@ -6,13 +6,13 @@ export declare const fontConfigSchema: z.ZodObject<{
6
6
  style: z.ZodString;
7
7
  }, "strip", z.ZodTypeAny, {
8
8
  style: string;
9
- font: string;
10
9
  url: string;
10
+ font: string;
11
11
  weight: string;
12
12
  }, {
13
13
  style: string;
14
- font: string;
15
14
  url: string;
15
+ font: string;
16
16
  weight: string;
17
17
  }>;
18
18
  export type FontConfig = z.infer<typeof fontConfigSchema>;
@@ -36,18 +36,18 @@ export declare class FontLoaderService extends LifeCycleWatcher {
36
36
  }
37
37
  export declare const FontConfigIdentifier: import("../../../global/di/types.js").ServiceIdentifier<{
38
38
  style: string;
39
- font: string;
40
39
  url: string;
40
+ font: string;
41
41
  weight: string;
42
42
  }[]> & (<U extends {
43
43
  style: string;
44
- font: string;
45
44
  url: string;
45
+ font: string;
46
46
  weight: string;
47
47
  }[] = {
48
48
  style: string;
49
- font: string;
50
49
  url: string;
50
+ font: string;
51
51
  weight: string;
52
52
  }[]>(variant: import("../../../global/di/types.js").ServiceVariant) => import("../../../global/di/types.js").ServiceIdentifier<U>);
53
53
  export declare const FontConfigExtension: (fontConfig: FontConfig[]) => ExtensionType;
@@ -2,6 +2,8 @@ export * from './artefact-catalogue-service.js';
2
2
  export * from './audit-service.js';
3
3
  export * from './auto-clear-selection-service.js';
4
4
  export * from './block-meta-service.js';
5
+ export * from './canvas-grid.js';
6
+ export * from './canvas-local-visibility.js';
5
7
  export * from './citation-service/index.js';
6
8
  export * from './command-usage-service.js';
7
9
  export * from './comment-service/index.js';
@@ -23,12 +25,13 @@ export * from './linked-doc-creation-service.js';
23
25
  export * from './native-clipboard-service.js';
24
26
  export * from './notification-service.js';
25
27
  export * from './open-doc-config.js';
28
+ export * from './outline-panel-service.js';
26
29
  export * from './page-viewport-service.js';
27
30
  export * from './parse-url-service.js';
28
31
  export * from './pivot-materiality-publisher.js';
29
32
  export * from './pivot-properties-service.js';
30
33
  export * from './quick-search-service.js';
31
- export * from './sidebar-service.js';
34
+ export * from './selection-pane-service.js';
32
35
  export * from './telemetry-service/index.js';
33
36
  export * from './theme-service.js';
34
37
  export * from './toolbar-service/index.js';
@@ -2,6 +2,8 @@ export * from './artefact-catalogue-service.js';
2
2
  export * from './audit-service.js';
3
3
  export * from './auto-clear-selection-service.js';
4
4
  export * from './block-meta-service.js';
5
+ export * from './canvas-grid.js';
6
+ export * from './canvas-local-visibility.js';
5
7
  export * from './citation-service/index.js';
6
8
  export * from './command-usage-service.js';
7
9
  export * from './comment-service/index.js';
@@ -23,12 +25,13 @@ export * from './linked-doc-creation-service.js';
23
25
  export * from './native-clipboard-service.js';
24
26
  export * from './notification-service.js';
25
27
  export * from './open-doc-config.js';
28
+ export * from './outline-panel-service.js';
26
29
  export * from './page-viewport-service.js';
27
30
  export * from './parse-url-service.js';
28
31
  export * from './pivot-materiality-publisher.js';
29
32
  export * from './pivot-properties-service.js';
30
33
  export * from './quick-search-service.js';
31
- export * from './sidebar-service.js';
34
+ export * from './selection-pane-service.js';
32
35
  export * from './telemetry-service/index.js';
33
36
  export * from './theme-service.js';
34
37
  export * from './toolbar-service/index.js';
@@ -8,29 +8,29 @@ declare const _StorageSchema: z.ZodObject<{
8
8
  }, "strip", z.ZodTypeAny, {
9
9
  description?: string | null | undefined;
10
10
  title?: string | null | undefined;
11
- image?: string | null | undefined;
12
11
  icon?: string | null | undefined;
12
+ image?: string | null | undefined;
13
13
  }, {
14
14
  description?: string | null | undefined;
15
15
  title?: string | null | undefined;
16
- image?: string | null | undefined;
17
16
  icon?: string | null | undefined;
17
+ image?: string | null | undefined;
18
18
  }>>;
19
19
  expires: z.ZodOptional<z.ZodNumber>;
20
20
  }, "strip", z.ZodTypeAny, {
21
21
  data: Record<string, {
22
22
  description?: string | null | undefined;
23
23
  title?: string | null | undefined;
24
- image?: string | null | undefined;
25
24
  icon?: string | null | undefined;
25
+ image?: string | null | undefined;
26
26
  }>;
27
27
  expires?: number | undefined;
28
28
  }, {
29
29
  data: Record<string, {
30
30
  description?: string | null | undefined;
31
31
  title?: string | null | undefined;
32
- image?: string | null | undefined;
33
32
  icon?: string | null | undefined;
33
+ image?: string | null | undefined;
34
34
  }>;
35
35
  expires?: number | undefined;
36
36
  }>;
@@ -0,0 +1,31 @@
1
+ import type { ExtensionType } from '../../store/index.js';
2
+ /**
3
+ * The outline panel (ADR 0034 §1): the document's table of contents, drawn by
4
+ * the host beside the editor.
5
+ *
6
+ * The library never mounts an outline itself, so there is no default: a host
7
+ * that draws one registers this seam, a host that does not leaves it out. Its
8
+ * only caller in the library is the "View in TOC" link of the toast the note
9
+ * toolbar shows after a note's display mode changes
10
+ * (`blocks/note/src/configs/toolbar.ts`). Absent or `null`, that toast offers
11
+ * no link, because a link that opens nothing is a lie.
12
+ *
13
+ * It replaces the `open(tabId?)` seam inherited from AFFiNE (removed in 0.46,
14
+ * ADR 0034 §2): one caller, which opened a tab named by a string nobody typed
15
+ * anywhere else. Shaped exactly like `SelectionPaneService`, so every panel
16
+ * the library asks a host to show answers the same two verbs.
17
+ */
18
+ export interface OutlinePanelService {
19
+ /** Show the outline. */
20
+ open(): void;
21
+ /** Put it away. Writes nothing. */
22
+ close(): void;
23
+ }
24
+ export declare const OutlinePanelProvider: import("../../global/di/types.js").ServiceIdentifier<OutlinePanelService> & (<U extends OutlinePanelService = OutlinePanelService>(variant: import("../../global/di/types.js").ServiceVariant) => import("../../global/di/types.js").ServiceIdentifier<U>);
25
+ /**
26
+ * Host seam: the host's outline panel, or `null` to say there is none.
27
+ *
28
+ * `di.override`, like `SelectionPaneExtension`, so a later registration always
29
+ * wins and registering twice never throws at boot.
30
+ */
31
+ export declare function OutlinePanelExtension(service: OutlinePanelService | null): ExtensionType;
@@ -0,0 +1,17 @@
1
+ import { createIdentifier } from '../../global/di/index.js';
2
+ export const OutlinePanelProvider = createIdentifier('AffineOutlinePanel');
3
+ /**
4
+ * Host seam: the host's outline panel, or `null` to say there is none.
5
+ *
6
+ * `di.override`, like `SelectionPaneExtension`, so a later registration always
7
+ * wins and registering twice never throws at boot.
8
+ */
9
+ export function OutlinePanelExtension(service) {
10
+ return {
11
+ setup: di => {
12
+ // `null` rides through the factory on purpose: `getOptional` then
13
+ // reports the panel as absent, which is the whole "no link" story.
14
+ di.override(OutlinePanelProvider, () => service);
15
+ },
16
+ };
17
+ }
@@ -0,0 +1,44 @@
1
+ import type { ExtensionType } from '../../store/index.js';
2
+ /**
3
+ * The selection pane (ADR 0031 §12): a list of the canvas elements by z-order,
4
+ * top first, with groups, lock, a filter by frame, and
5
+ * drag-to-reorder — PowerPoint's pane, on a Labre canvas.
6
+ *
7
+ * The seam is shaped exactly like `ArtefactCatalogueService`, and was
8
+ * challenged against it first: the catalogue's `open(owner)` is scoped to a
9
+ * framework, and stretching it to a second panel would have changed the
10
+ * signature of a shipped seam. So one more seam, two verbs, nothing else.
11
+ *
12
+ * Everything a pane draws is enumerable from the library without this seam:
13
+ * the rows from `selectionPaneTree(std)` (ids only, z-order, top first), the
14
+ * wordings from the element and the translation seam, and every action from
15
+ * the command registry (`canvas.element.reorder`, `canvas.element.lock`,
16
+ * `canvas.element.unlock`, `canvas.group.rename`), run through `runCommand`
17
+ * so the read-only check and the telemetry happen once whoever draws the
18
+ * pixels.
19
+ */
20
+ export interface SelectionPaneService {
21
+ /** Show the pane. */
22
+ open(): void;
23
+ /** Put it away. Writes nothing. */
24
+ close(): void;
25
+ }
26
+ export declare const SelectionPaneProvider: import("../../global/di/types.js").ServiceIdentifier<SelectionPaneService> & (<U extends SelectionPaneService = SelectionPaneService>(variant: import("../../global/di/types.js").ServiceVariant) => import("../../global/di/types.js").ServiceIdentifier<U>);
27
+ /**
28
+ * Host override seam: replace the library's pane with the host's own — or
29
+ * switch it off entirely.
30
+ *
31
+ * **Replace** — a host with its own sidebar registers this extension; its
32
+ * implementation answers {@link SelectionPaneProvider}, the edgeless toolbar's
33
+ * button and the `canvas.selectionPane.toggle` command then call it, and the
34
+ * library's panel is never asked to open.
35
+ *
36
+ * **Disable** — pass `null`. The provider answers nothing: the toolbar button
37
+ * is not rendered and the toggle command is unavailable, because a control
38
+ * that opens nothing is a lie. A cold-assembly switch, decided when the editor
39
+ * is put together (ADR 0031 §13: no flag key for it).
40
+ *
41
+ * `di.override`, like `ArtefactCatalogueExtension`, so a host registering
42
+ * after the library's own default always wins.
43
+ */
44
+ export declare function SelectionPaneExtension(service: SelectionPaneService | null): ExtensionType;
@@ -0,0 +1,28 @@
1
+ import { createIdentifier } from '../../global/di/index.js';
2
+ export const SelectionPaneProvider = createIdentifier('AffineSelectionPane');
3
+ /**
4
+ * Host override seam: replace the library's pane with the host's own — or
5
+ * switch it off entirely.
6
+ *
7
+ * **Replace** — a host with its own sidebar registers this extension; its
8
+ * implementation answers {@link SelectionPaneProvider}, the edgeless toolbar's
9
+ * button and the `canvas.selectionPane.toggle` command then call it, and the
10
+ * library's panel is never asked to open.
11
+ *
12
+ * **Disable** — pass `null`. The provider answers nothing: the toolbar button
13
+ * is not rendered and the toggle command is unavailable, because a control
14
+ * that opens nothing is a lie. A cold-assembly switch, decided when the editor
15
+ * is put together (ADR 0031 §13: no flag key for it).
16
+ *
17
+ * `di.override`, like `ArtefactCatalogueExtension`, so a host registering
18
+ * after the library's own default always wins.
19
+ */
20
+ export function SelectionPaneExtension(service) {
21
+ return {
22
+ setup: di => {
23
+ // `null` rides through the factory on purpose: `getOptional` then
24
+ // reports the pane as absent, which is the whole disable story.
25
+ di.override(SelectionPaneProvider, () => service);
26
+ },
27
+ };
28
+ }
@@ -320,3 +320,72 @@ export interface DocumentDamagedEvent extends TelemetryEvent {
320
320
  export type DocumentHealthEvents = {
321
321
  DocumentDamaged: DocumentDamagedEvent;
322
322
  };
323
+ /**
324
+ * The selection pane was opened (ADR 0031 §14).
325
+ *
326
+ * Worth measuring for the reason any optional surface is: a pane nobody opens
327
+ * is chrome the toolbar pays a slot for. `source` is how the user got there —
328
+ * the edgeless toolbar's button, the palette (or the agent, which invokes by
329
+ * name as the palette does), or a bound chord. Opening only: closing reports
330
+ * nothing, and neither does a toggle that closes the pane.
331
+ *
332
+ * No ids at all: the event is about the pane, never about what it lists.
333
+ */
334
+ export interface SelectionPaneOpenedEvent extends TelemetryEvent {
335
+ page?: 'whiteboard editor';
336
+ source: 'toolbar' | 'palette' | 'shortcut';
337
+ }
338
+ /**
339
+ * Something on the canvas was hidden or shown (ADR 0031 §14).
340
+ *
341
+ * `scope: 'local'` is the viewer's own hide, which writes nothing to the
342
+ * document; `'everyone'` is "hide for everyone", which stores
343
+ * `hiddenForEveryone` on each element and syncs it.
344
+ * `target: 'layer'` is reserved for the layers stage. `count` is how many
345
+ * elements the ONE gesture actually changed — a gesture that changes nothing
346
+ * reports nothing.
347
+ *
348
+ * Counts only: never an element id, a type, a group title or any text.
349
+ */
350
+ export interface CanvasVisibilityChangedEvent extends TelemetryEvent {
351
+ page?: 'whiteboard editor';
352
+ target: 'element' | 'layer';
353
+ scope: 'local' | 'everyone';
354
+ hidden: boolean;
355
+ count: number;
356
+ }
357
+ /**
358
+ * The canvas grid was turned on or off (ADR 0031 §14).
359
+ *
360
+ * `scope: 'local'` is the viewer's own toggle, which writes nothing to the
361
+ * document; `'everyone'` is "Save for everyone", which stores the grid on the
362
+ * document. `visible` is the state after the gesture. A save that changes
363
+ * nothing in the document reports nothing.
364
+ */
365
+ export interface CanvasGridToggledEvent extends TelemetryEvent {
366
+ page?: 'whiteboard editor';
367
+ scope: 'local' | 'everyone';
368
+ visible: boolean;
369
+ }
370
+ /**
371
+ * The user layers changed (ADR 0031 §14).
372
+ *
373
+ * `layerCount` is how many layers the surface holds AFTER the gesture;
374
+ * `memberCount` is how many models the gesture moved (for `move-elements`)
375
+ * or deleted with the layer (for `delete`). A gesture that changes nothing
376
+ * reports nothing.
377
+ *
378
+ * Counts only: never a layer name, a layer id or any element text.
379
+ */
380
+ export interface CanvasLayerChangedEvent extends TelemetryEvent {
381
+ page?: 'whiteboard editor';
382
+ action: 'create' | 'rename' | 'reorder' | 'delete' | 'move-elements';
383
+ layerCount: number;
384
+ memberCount?: number;
385
+ }
386
+ export type CanvasPaneEvents = {
387
+ SelectionPaneOpened: SelectionPaneOpenedEvent;
388
+ CanvasVisibilityChanged: CanvasVisibilityChangedEvent;
389
+ CanvasGridToggled: CanvasGridToggledEvent;
390
+ CanvasLayerChanged: CanvasLayerChangedEvent;
391
+ };
@@ -2,12 +2,12 @@ import type { ExtensionType } from '../../../store/index.js';
2
2
  import type { CitationEvents } from './citation.js';
3
3
  import type { CodeBlockEvents } from './code-block.js';
4
4
  import type { OutDatabaseAllEvents } from './database.js';
5
- import type { AuditEvents, BlockLifecycleEvents, DocumentHealthEvents, FrameworkDiagramEvents, ValidationEvents } from './lifecycle.js';
5
+ import type { AuditEvents, BlockLifecycleEvents, CanvasPaneEvents, DocumentHealthEvents, FrameworkDiagramEvents, ValidationEvents } from './lifecycle.js';
6
6
  import type { LinkToolbarEvents } from './link.js';
7
7
  import type { NoteEvents } from './note.js';
8
8
  import type { SlashMenuEvents } from './slash-menu.js';
9
9
  import type { AttachmentReloadedEvent, AttachmentReloadedEventInToolbar, AttachmentUpgradedEvent, AttachmentUploadedEvent, BlockCreationEvent, DocCreatedEvent, EdgelessToolPickedEvent, ElementCreationEvent, ElementLockEvent, ElementUpdatedEvent, LatexEvent, LinkedDocCreatedEvent, LinkEvent, MindMapCollapseEvent, TelemetryEvent } from './types.js';
10
- export type TelemetryEventMap = OutDatabaseAllEvents & LinkToolbarEvents & SlashMenuEvents & CodeBlockEvents & NoteEvents & CitationEvents & BlockLifecycleEvents & FrameworkDiagramEvents & ValidationEvents & AuditEvents & DocumentHealthEvents & {
10
+ export type TelemetryEventMap = OutDatabaseAllEvents & LinkToolbarEvents & SlashMenuEvents & CodeBlockEvents & NoteEvents & CitationEvents & BlockLifecycleEvents & FrameworkDiagramEvents & ValidationEvents & AuditEvents & CanvasPaneEvents & DocumentHealthEvents & {
11
11
  DocCreated: DocCreatedEvent;
12
12
  Link: TelemetryEvent;
13
13
  LinkedDocCreated: LinkedDocCreatedEvent;
@@ -188,6 +188,11 @@ export declare const STYLE_MENU_LABEL: ChromeWording;
188
188
  export declare const TEXT_FORMAT_BOLD: ChromeWording;
189
189
  export declare const TEXT_FORMAT_ITALIC: ChromeWording;
190
190
  export declare const TEXT_FORMAT_UNDERLINE: ChromeWording;
191
+ /**
192
+ * Said by the canvas text toolbar's decoration toggles (`gfx/text`, beside
193
+ * {@link TEXT_FORMAT_UNDERLINE}) and by the inline format bar (ADR 0030).
194
+ */
195
+ export declare const TEXT_FORMAT_OVERLINE: ChromeWording;
191
196
  export declare const TEXT_FORMAT_STRIKETHROUGH: ChromeWording;
192
197
  /**
193
198
  * The font weights and the one non-default font style a text toolbar offers —
@@ -459,6 +464,17 @@ export declare const FILL_COLOR_LABEL: ChromeWording;
459
464
  * `ROOT_TOOLBAR_CREATE_LINKED_DOC` (`blocks/root`).
460
465
  */
461
466
  export declare const TOOLBAR_CREATE_LINKED_DOC_TITLE: ChromeWording;
467
+ /**
468
+ * "Turn into" — the block toolbar's conversions dropdown, said identically by
469
+ * the note's text row and the callout's own row (#468). Was
470
+ * `ROOT_TOOLBAR_TURN_INTO` (`blocks/root`); the key is kept.
471
+ */
472
+ export declare const TOOLBAR_TURN_INTO: ChromeWording;
473
+ /**
474
+ * …and that dropdown's accessible name. Was `ROOT_TOOLBAR_CONVERSIONS_ARIA`
475
+ * (`blocks/root`); the key is kept.
476
+ */
477
+ export declare const TOOLBAR_CONVERSIONS_ARIA: ChromeWording;
462
478
  /**
463
479
  * "Edgeless content" — the surface-ref placeholder's own generic reference
464
480
  * kind, said identically by the drag-handle preview's fallback label. Was
@@ -335,6 +335,14 @@ export const TEXT_FORMAT_UNDERLINE = [
335
335
  'com.labre.text-format.underline',
336
336
  'Underline',
337
337
  ];
338
+ /**
339
+ * Said by the canvas text toolbar's decoration toggles (`gfx/text`, beside
340
+ * {@link TEXT_FORMAT_UNDERLINE}) and by the inline format bar (ADR 0030).
341
+ */
342
+ export const TEXT_FORMAT_OVERLINE = [
343
+ 'com.labre.text-format.overline',
344
+ 'Overline',
345
+ ];
338
346
  export const TEXT_FORMAT_STRIKETHROUGH = [
339
347
  'com.labre.text-format.strikethrough',
340
348
  'Strikethrough',
@@ -1026,6 +1034,23 @@ export const TOOLBAR_CREATE_LINKED_DOC_TITLE = [
1026
1034
  'com.labre.root.toolbar.create-linked-doc',
1027
1035
  'Create Linked Doc',
1028
1036
  ];
1037
+ /**
1038
+ * "Turn into" — the block toolbar's conversions dropdown, said identically by
1039
+ * the note's text row and the callout's own row (#468). Was
1040
+ * `ROOT_TOOLBAR_TURN_INTO` (`blocks/root`); the key is kept.
1041
+ */
1042
+ export const TOOLBAR_TURN_INTO = [
1043
+ 'com.labre.root.toolbar.turn-into',
1044
+ 'Turn into',
1045
+ ];
1046
+ /**
1047
+ * …and that dropdown's accessible name. Was `ROOT_TOOLBAR_CONVERSIONS_ARIA`
1048
+ * (`blocks/root`); the key is kept.
1049
+ */
1050
+ export const TOOLBAR_CONVERSIONS_ARIA = [
1051
+ 'com.labre.root.toolbar.conversions',
1052
+ 'Conversions',
1053
+ ];
1029
1054
  /**
1030
1055
  * "Edgeless content" — the surface-ref placeholder's own generic reference
1031
1056
  * kind, said identically by the drag-handle preview's fallback label. Was
@@ -1203,6 +1228,7 @@ export const CHROME_WORDINGS = [
1203
1228
  TEXT_FORMAT_BOLD,
1204
1229
  TEXT_FORMAT_ITALIC,
1205
1230
  TEXT_FORMAT_UNDERLINE,
1231
+ TEXT_FORMAT_OVERLINE,
1206
1232
  TEXT_FORMAT_STRIKETHROUGH,
1207
1233
  FONT_WEIGHT_LIGHT,
1208
1234
  FONT_WEIGHT_REGULAR,
@@ -1274,6 +1300,8 @@ export const CHROME_WORDINGS = [
1274
1300
  COLOR_LABEL,
1275
1301
  FILL_COLOR_LABEL,
1276
1302
  TOOLBAR_CREATE_LINKED_DOC_TITLE,
1303
+ TOOLBAR_TURN_INTO,
1304
+ TOOLBAR_CONVERSIONS_ARIA,
1277
1305
  EDGELESS_CONTENT_LABEL,
1278
1306
  TOOLBAR_EDIT,
1279
1307
  TOOLBAR_REMOVE_LINK,
@@ -1,5 +1,6 @@
1
1
  export { fontBaseStyle, fontSMStyle, fontXSStyle } from './font.js';
2
2
  export { reducedMotionStyle, SPRING_DURATION_MS, SPRING_EASING, springDuration, springEasing, } from './motion.js';
3
3
  export { panelBaseColorsStyle, panelBaseStyle } from './panel.js';
4
+ export { PANEL_DRAG_THRESHOLD_PX, panelDragStarted, panelHeaderStyles, } from './panel-header.js';
4
5
  export { scrollbarStyle } from './scrollbar-style.js';
5
6
  export { affineTextStyles } from './text.js';
@@ -1,5 +1,6 @@
1
1
  export { fontBaseStyle, fontSMStyle, fontXSStyle } from './font.js';
2
2
  export { reducedMotionStyle, SPRING_DURATION_MS, SPRING_EASING, springDuration, springEasing, } from './motion.js';
3
3
  export { panelBaseColorsStyle, panelBaseStyle } from './panel.js';
4
+ export { PANEL_DRAG_THRESHOLD_PX, panelDragStarted, panelHeaderStyles, } from './panel-header.js';
4
5
  export { scrollbarStyle } from './scrollbar-style.js';
5
6
  export { affineTextStyles } from './text.js';
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The header of a side panel, as the frame panel draws it
3
+ * (`fragments/frame-panel`, `header/frame-panel-header.ts`): one 36px row,
4
+ * 8px side padding, no divider under it, a 14px / 500 secondary-text title
5
+ * and icon buttons whose glyph is secondary until hovered or active.
6
+ *
7
+ * Every side panel's header takes it from here — the frame panel, the
8
+ * selection pane and the artefact catalogue — so the three cannot drift
9
+ * apart (held by `panel-header-parity.unit.spec.ts` in `affine/all`). It lives
10
+ * this low because a widget may not import the frame panel: the frame panel
11
+ * depends on the frame block, which depends on the edgeless toolbar.
12
+ *
13
+ * A component opts in by adding the three classes to its own markup:
14
+ * `affine-panel-header` on the row, `affine-panel-header-title` on the title,
15
+ * `affine-panel-header-button` on each icon button.
16
+ */
17
+ export declare const panelHeaderStyles: import("lit").CSSResult;
18
+ /**
19
+ * Pointer travel, on either axis, before a press on a card or a row of a side
20
+ * panel becomes a drag rather than a click — the frame panel's threshold,
21
+ * shared with the selection pane so the two panels start a drag alike.
22
+ */
23
+ export declare const PANEL_DRAG_THRESHOLD_PX = 5;
24
+ /** Whether a press at `from` moved to `to` has travelled far enough to drag. */
25
+ export declare function panelDragStarted(from: {
26
+ x: number;
27
+ y: number;
28
+ }, to: {
29
+ x: number;
30
+ y: number;
31
+ }): boolean;
@@ -0,0 +1,61 @@
1
+ import { css } from 'lit';
2
+ import { fontSMStyle } from './font.js';
3
+ /**
4
+ * The header of a side panel, as the frame panel draws it
5
+ * (`fragments/frame-panel`, `header/frame-panel-header.ts`): one 36px row,
6
+ * 8px side padding, no divider under it, a 14px / 500 secondary-text title
7
+ * and icon buttons whose glyph is secondary until hovered or active.
8
+ *
9
+ * Every side panel's header takes it from here — the frame panel, the
10
+ * selection pane and the artefact catalogue — so the three cannot drift
11
+ * apart (held by `panel-header-parity.unit.spec.ts` in `affine/all`). It lives
12
+ * this low because a widget may not import the frame panel: the frame panel
13
+ * depends on the frame block, which depends on the edgeless toolbar.
14
+ *
15
+ * A component opts in by adding the three classes to its own markup:
16
+ * `affine-panel-header` on the row, `affine-panel-header-title` on the title,
17
+ * `affine-panel-header-button` on each icon button.
18
+ */
19
+ export const panelHeaderStyles = css `
20
+ .affine-panel-header {
21
+ display: flex;
22
+ flex: none;
23
+ width: 100%;
24
+ height: 36px;
25
+ align-items: center;
26
+ justify-content: space-between;
27
+ gap: 8px;
28
+ box-sizing: border-box;
29
+ padding: 0 8px;
30
+ }
31
+
32
+ ${fontSMStyle('.affine-panel-header-title')}
33
+
34
+ .affine-panel-header-title {
35
+ min-width: 0;
36
+ overflow: hidden;
37
+ text-overflow: ellipsis;
38
+ white-space: nowrap;
39
+ color: var(--affine-text-secondary-color);
40
+ }
41
+
42
+ .affine-panel-header-button svg {
43
+ color: var(--affine-icon-secondary);
44
+ }
45
+
46
+ .affine-panel-header-button:hover svg,
47
+ .affine-panel-header-button.active svg {
48
+ color: var(--affine-icon-color);
49
+ }
50
+ `;
51
+ /**
52
+ * Pointer travel, on either axis, before a press on a card or a row of a side
53
+ * panel becomes a drag rather than a click — the frame panel's threshold,
54
+ * shared with the selection pane so the two panels start a drag alike.
55
+ */
56
+ export const PANEL_DRAG_THRESHOLD_PX = 5;
57
+ /** Whether a press at `from` moved to `to` has travelled far enough to drag. */
58
+ export function panelDragStarted(from, to) {
59
+ return (Math.abs(from.x - to.x) >= PANEL_DRAG_THRESHOLD_PX ||
60
+ Math.abs(from.y - to.y) >= PANEL_DRAG_THRESHOLD_PX);
61
+ }
@@ -1,11 +1,11 @@
1
1
  export function affineTextStyles(props, override) {
2
- let textDecorations = '';
3
- if (props.underline) {
4
- textDecorations += 'underline';
5
- }
6
- if (props.strike) {
7
- textDecorations += ' line-through';
8
- }
2
+ const textDecorations = [
3
+ props.underline && 'underline',
4
+ props.overline && 'overline',
5
+ props.strike && 'line-through',
6
+ ]
7
+ .filter(Boolean)
8
+ .join(' ');
9
9
  let inlineCodeStyle = {};
10
10
  if (props.code) {
11
11
  inlineCodeStyle = {
@@ -24,6 +24,12 @@ export type AffineTextStyleAttributes = {
24
24
  bold?: true | null;
25
25
  italic?: true | null;
26
26
  underline?: true | null;
27
+ /**
28
+ * Declared at the affine level only, like `color`: the store's base
29
+ * attributes do not know it (ADR 0030 §5), and the editor schema is the
30
+ * intersection of those and every inline spec.
31
+ */
32
+ overline?: true | null;
27
33
  strike?: true | null;
28
34
  code?: true | null;
29
35
  color?: string | null;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Turns one colour the browser understands into `rgb()` / `rgba()`.
3
+ */
4
+ export type ResolveLegacyColor = (color: string) => string;
5
+ /**
6
+ * `value` with every modern colour function in it replaced by what `resolve`
7
+ * makes of it — the whole of `oklch(0.7 0.1 200)`, or each colour of a
8
+ * `box-shadow` list. A value with none comes back as the same string. Also
9
+ * what the `backgroundColor` option of html2canvas goes through.
10
+ */
11
+ export declare function toLegacyColors(value: string, resolve?: ResolveLegacyColor): string;
12
+ /**
13
+ * Rewrites, inline on the html2canvas CLONE, every computed colour html2canvas
14
+ * would choke on, so a host theme in `oklch()` (or the library's own
15
+ * `color-mix()`) cannot abort a PNG/PDF export or a "copy as image". Call it
16
+ * first in every `onclone`.
17
+ *
18
+ * html2canvas parses the computed style of the captured subtree AND of the
19
+ * clone's `<html>` and `<body>` (their background), so those two are covered
20
+ * too; shadow roots are already flattened into the clone by then. The resolved
21
+ * value is written over whatever produced it — a CSS variable, a stylesheet
22
+ * rule — as an `!important` inline declaration, which is what the computed
23
+ * style then reports. Every value is read before any is written, so the
24
+ * cascade is recomputed once rather than once per node.
25
+ */
26
+ export declare function normalizeCanvasExportColors(documentClone: Document, subtree: Element, resolve?: ResolveLegacyColor): void;