@formicoidea/labre-core 0.41.0 → 0.43.1

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 (343) hide show
  1. package/LICENSE +384 -0
  2. package/dist/_pkgs/affine-block-bookmark/bookmark-block.js +2 -2
  3. package/dist/_pkgs/affine-block-data-view/configs/tooltips.js +1 -1
  4. package/dist/_pkgs/affine-block-database/configs/tooltips.js +1 -1
  5. package/dist/_pkgs/affine-block-edgeless-text/edgeless-text-block.js +4 -2
  6. package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/config.js +7 -1
  7. package/dist/_pkgs/affine-block-embed/common/iframe-sandbox.d.ts +39 -0
  8. package/dist/_pkgs/affine-block-embed/common/iframe-sandbox.js +39 -0
  9. package/dist/_pkgs/affine-block-embed/embed-figma-block/embed-figma-block.js +4 -1
  10. package/dist/_pkgs/affine-block-embed/embed-github-block/embed-github-block.js +2 -1
  11. package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-error-card.d.ts +14 -1
  12. package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-error-card.js +21 -2
  13. package/dist/_pkgs/affine-block-embed/embed-iframe-block/consts.js +2 -0
  14. package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.d.ts +2 -1
  15. package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.js +41 -11
  16. package/dist/_pkgs/affine-block-embed/embed-iframe-block/types.d.ts +16 -0
  17. package/dist/_pkgs/affine-block-embed/embed-iframe-block/types.js +17 -1
  18. package/dist/_pkgs/affine-block-embed/embed-iframe-block/utils.d.ts +8 -0
  19. package/dist/_pkgs/affine-block-embed/embed-iframe-block/utils.js +19 -0
  20. package/dist/_pkgs/affine-block-embed/embed-loom-block/embed-loom-block.js +4 -1
  21. package/dist/_pkgs/affine-block-embed/embed-youtube-block/embed-youtube-block.js +4 -1
  22. package/dist/_pkgs/affine-block-embed/index.d.ts +1 -0
  23. package/dist/_pkgs/affine-block-embed/index.js +1 -0
  24. package/dist/_pkgs/affine-block-embed/translations.d.ts +8 -0
  25. package/dist/_pkgs/affine-block-embed/translations.js +28 -0
  26. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-linked-doc-block.js +4 -2
  27. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-synced-doc-block.js +2 -2
  28. package/dist/_pkgs/affine-block-frame/frame-manager.js +6 -3
  29. package/dist/_pkgs/affine-block-frame/frame-tool.js +1 -1
  30. package/dist/_pkgs/affine-block-frame/frame-toolbar.js +6 -1
  31. package/dist/_pkgs/affine-block-list/list-keymap.js +7 -0
  32. package/dist/_pkgs/affine-block-list/utils/get-list-icon.js +3 -1
  33. package/dist/_pkgs/affine-block-note/configs/tooltips.js +1 -1
  34. package/dist/_pkgs/affine-block-note/note-keymap.js +7 -1
  35. package/dist/_pkgs/affine-block-paragraph/paragraph-keymap.js +7 -1
  36. package/dist/_pkgs/affine-block-root/adapters/html.js +2 -2
  37. package/dist/_pkgs/affine-block-root/commands/copy-link-commands.d.ts +2 -0
  38. package/dist/_pkgs/affine-block-root/commands/copy-link-commands.js +155 -0
  39. package/dist/_pkgs/affine-block-root/commands/pivot-commands.js +1 -8
  40. package/dist/_pkgs/affine-block-root/commands/tag-commands.js +1 -8
  41. package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.d.ts +9 -0
  42. package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.js +51 -0
  43. package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.d.ts +22 -0
  44. package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.js +46 -0
  45. package/dist/_pkgs/affine-block-root/edgeless/utils/pinch-zoom.d.ts +21 -0
  46. package/dist/_pkgs/affine-block-root/edgeless/utils/pinch-zoom.js +24 -0
  47. package/dist/_pkgs/affine-block-root/edgeless/utils/query.js +8 -0
  48. package/dist/_pkgs/affine-block-root/index.d.ts +1 -0
  49. package/dist/_pkgs/affine-block-root/index.js +1 -0
  50. package/dist/_pkgs/affine-block-root/keyboard/keymap.js +1 -16
  51. package/dist/_pkgs/affine-block-root/view.js +2 -0
  52. package/dist/_pkgs/affine-block-surface/element-model/index.d.ts +21 -3
  53. package/dist/_pkgs/affine-block-surface/element-model/index.js +14 -2
  54. package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.d.ts +23 -0
  55. package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.js +89 -0
  56. package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.d.ts +7 -0
  57. package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.js +5 -0
  58. package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.d.ts +41 -0
  59. package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.js +70 -0
  60. package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.d.ts +49 -0
  61. package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.js +257 -0
  62. package/dist/_pkgs/affine-block-surface/extensions/export-svg/tagged-path.d.ts +16 -0
  63. package/dist/_pkgs/affine-block-surface/extensions/export-svg/tagged-path.js +24 -0
  64. package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.d.ts +24 -0
  65. package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.js +66 -0
  66. package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +4 -0
  67. package/dist/_pkgs/affine-block-surface/extensions/index.js +4 -0
  68. package/dist/_pkgs/affine-block-surface/extensions/interchange-import.d.ts +66 -4
  69. package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +253 -11
  70. package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +18 -0
  71. package/dist/_pkgs/affine-block-surface/extensions/legend-toolbar.d.ts +81 -0
  72. package/dist/_pkgs/affine-block-surface/extensions/legend-toolbar.js +81 -0
  73. package/dist/_pkgs/affine-block-surface/extensions/legend.d.ts +144 -0
  74. package/dist/_pkgs/affine-block-surface/extensions/legend.js +495 -0
  75. package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.js +4 -0
  76. package/dist/_pkgs/affine-block-surface/extensions/reading-widget.d.ts +17 -3
  77. package/dist/_pkgs/affine-block-surface/extensions/reading-widget.js +35 -13
  78. package/dist/_pkgs/affine-block-surface/extensions/reading.d.ts +61 -1
  79. package/dist/_pkgs/affine-block-surface/extensions/reading.js +85 -39
  80. package/dist/_pkgs/affine-block-surface/extensions/record-action.d.ts +66 -0
  81. package/dist/_pkgs/affine-block-surface/extensions/record-action.js +145 -0
  82. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.d.ts +3 -0
  83. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.js +23 -0
  84. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.d.ts +1 -1
  85. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +12 -4
  86. package/dist/_pkgs/affine-block-surface/extensions/validation.d.ts +253 -28
  87. package/dist/_pkgs/affine-block-surface/extensions/validation.js +489 -41
  88. package/dist/_pkgs/affine-block-surface/framework-background/background-view.d.ts +115 -0
  89. package/dist/_pkgs/affine-block-surface/framework-background/background-view.js +185 -0
  90. package/dist/_pkgs/affine-block-surface/framework-background/fit.d.ts +36 -0
  91. package/dist/_pkgs/affine-block-surface/framework-background/fit.js +30 -0
  92. package/dist/_pkgs/affine-block-surface/framework-background/index.d.ts +2 -0
  93. package/dist/_pkgs/affine-block-surface/framework-background/index.js +2 -0
  94. package/dist/_pkgs/affine-block-surface/framework-background/labels.d.ts +16 -1
  95. package/dist/_pkgs/affine-block-surface/framework-background/labels.js +31 -21
  96. package/dist/_pkgs/affine-block-surface/framework-background/renderer.js +29 -5
  97. package/dist/_pkgs/affine-block-surface/framework-background/stacking.d.ts +6 -4
  98. package/dist/_pkgs/affine-block-surface/framework-background/stacking.js +56 -8
  99. package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.d.ts +12 -0
  100. package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.js +15 -0
  101. package/dist/_pkgs/affine-block-surface/renderer/element-highlight-overlay.js +2 -7
  102. package/dist/_pkgs/affine-block-surface/view.js +8 -1
  103. package/dist/_pkgs/affine-block-surface-ref/configs/slash-menu.js +1 -1
  104. package/dist/_pkgs/affine-block-surface-ref/configs/tooltips.js +2 -2
  105. package/dist/_pkgs/affine-components/color-picker/button.d.ts +56 -1
  106. package/dist/_pkgs/affine-components/color-picker/button.js +168 -23
  107. package/dist/_pkgs/affine-components/color-picker/framework-palette.d.ts +106 -0
  108. package/dist/_pkgs/affine-components/color-picker/framework-palette.js +177 -0
  109. package/dist/_pkgs/affine-components/color-picker/index.d.ts +2 -0
  110. package/dist/_pkgs/affine-components/color-picker/index.js +2 -0
  111. package/dist/_pkgs/affine-components/color-picker/palette-carousel.d.ts +85 -0
  112. package/dist/_pkgs/affine-components/color-picker/palette-carousel.js +445 -0
  113. package/dist/_pkgs/affine-components/color-picker/styles.js +1 -1
  114. package/dist/_pkgs/affine-components/context-menu/button.js +3 -1
  115. package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.d.ts +31 -1
  116. package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.js +189 -63
  117. package/dist/_pkgs/affine-components/icons/ai.js +3 -3
  118. package/dist/_pkgs/affine-components/icons/list.js +7 -1
  119. package/dist/_pkgs/affine-components/resource/resource.js +29 -16
  120. package/dist/_pkgs/affine-components/size-dropdown-menu/dropdown-menu.js +6 -1
  121. package/dist/_pkgs/affine-components/toolbar/index.d.ts +1 -1
  122. package/dist/_pkgs/affine-components/toolbar/index.js +1 -1
  123. package/dist/_pkgs/affine-components/toolbar/menu-button.d.ts +7 -0
  124. package/dist/_pkgs/affine-components/toolbar/menu-button.js +30 -0
  125. package/dist/_pkgs/affine-components/toolbar/picker-menu.d.ts +16 -1
  126. package/dist/_pkgs/affine-components/toolbar/picker-menu.js +2 -2
  127. package/dist/_pkgs/affine-components/toolbar/toolbar.d.ts +1 -0
  128. package/dist/_pkgs/affine-components/toolbar/toolbar.js +67 -0
  129. package/dist/_pkgs/affine-components/translations.d.ts +8 -0
  130. package/dist/_pkgs/affine-components/translations.js +17 -0
  131. package/dist/_pkgs/affine-foundation/view.js +2 -1
  132. package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card-title-editor.js +1 -1
  133. package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card.js +1 -1
  134. package/dist/_pkgs/affine-gfx-brush/element-renderer.js +2 -2
  135. package/dist/_pkgs/affine-gfx-brush/toolbar/components/eraser/icons.js +1 -1
  136. package/dist/_pkgs/affine-gfx-brush/toolbar/configs/brush.js +6 -1
  137. package/dist/_pkgs/affine-gfx-brush/toolbar/configs/highlighter.js +6 -1
  138. package/dist/_pkgs/affine-gfx-connector/connector-manager.d.ts +9 -1
  139. package/dist/_pkgs/affine-gfx-connector/connector-manager.js +61 -0
  140. package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.d.ts +11 -2
  141. package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.js +11 -2
  142. package/dist/_pkgs/affine-gfx-connector/element-renderer/connector-dom/index.d.ts +7 -1
  143. package/dist/_pkgs/affine-gfx-connector/element-renderer/connector-dom/index.js +87 -17
  144. package/dist/_pkgs/affine-gfx-connector/element-renderer/index.js +78 -17
  145. package/dist/_pkgs/affine-gfx-connector/element-renderer/utils.d.ts +24 -2
  146. package/dist/_pkgs/affine-gfx-connector/element-renderer/utils.js +31 -8
  147. package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.d.ts +124 -3
  148. package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.js +219 -56
  149. package/dist/_pkgs/affine-gfx-connector/text/text.d.ts +13 -4
  150. package/dist/_pkgs/affine-gfx-connector/text/text.js +13 -44
  151. package/dist/_pkgs/affine-gfx-connector/toolbar/config.d.ts +56 -0
  152. package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +94 -10
  153. package/dist/_pkgs/affine-gfx-connector/toolbar/hollow-endpoint-icons.d.ts +8 -0
  154. package/dist/_pkgs/affine-gfx-connector/toolbar/hollow-endpoint-icons.js +118 -0
  155. package/dist/_pkgs/affine-gfx-connector/translations.d.ts +3 -0
  156. package/dist/_pkgs/affine-gfx-connector/translations.js +23 -0
  157. package/dist/_pkgs/affine-gfx-connector/view/view.d.ts +37 -1
  158. package/dist/_pkgs/affine-gfx-connector/view/view.js +97 -8
  159. package/dist/_pkgs/affine-gfx-group/command/group-api.js +1 -1
  160. package/dist/_pkgs/affine-gfx-group/store.js +0 -2
  161. package/dist/_pkgs/affine-gfx-group/translations.d.ts +9 -10
  162. package/dist/_pkgs/affine-gfx-group/translations.js +9 -13
  163. package/dist/_pkgs/affine-gfx-mindmap/indicator-overlay/index.js +6 -2
  164. package/dist/_pkgs/affine-gfx-mindmap/templates/index.js +1 -1
  165. package/dist/_pkgs/affine-gfx-mindmap/toolbar/basket-elements.js +1 -1
  166. package/dist/_pkgs/affine-gfx-mindmap/toolbar/config.js +4 -2
  167. package/dist/_pkgs/affine-gfx-mindmap/toolbar/utils/import-mindmap.js +2 -2
  168. package/dist/_pkgs/affine-gfx-mindmap/translations.d.ts +7 -1
  169. package/dist/_pkgs/affine-gfx-mindmap/translations.js +11 -1
  170. package/dist/_pkgs/affine-gfx-shape/element-renderer/highlighter.js +2 -2
  171. package/dist/_pkgs/affine-gfx-shape/overlay/polygon-drawing-overlay.d.ts +6 -0
  172. package/dist/_pkgs/affine-gfx-shape/overlay/polygon-drawing-overlay.js +30 -1
  173. package/dist/_pkgs/affine-gfx-shape/polygon-tool.d.ts +20 -1
  174. package/dist/_pkgs/affine-gfx-shape/polygon-tool.js +9 -1
  175. package/dist/_pkgs/affine-gfx-shape/toolbar/config.js +10 -3
  176. package/dist/_pkgs/affine-gfx-shape/toolbar/palette-color-action.js +11 -1
  177. package/dist/_pkgs/affine-gfx-shape/translations.d.ts +7 -0
  178. package/dist/_pkgs/affine-gfx-shape/translations.js +11 -0
  179. package/dist/_pkgs/affine-gfx-template/builtin/other.js +14 -8
  180. package/dist/_pkgs/affine-gfx-template/snapshot-from-action.js +32 -119
  181. package/dist/_pkgs/affine-gfx-template/toolbar/template-loading.js +1 -1
  182. package/dist/_pkgs/affine-gfx-template/toolbar/template-type.d.ts +1 -1
  183. package/dist/_pkgs/affine-gfx-template/translations.d.ts +5 -0
  184. package/dist/_pkgs/affine-gfx-template/translations.js +38 -0
  185. package/dist/_pkgs/affine-gfx-text/dblclick-add-edgeless-text.d.ts +13 -1
  186. package/dist/_pkgs/affine-gfx-text/dblclick-add-edgeless-text.js +19 -4
  187. package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.d.ts +41 -0
  188. package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.js +60 -4
  189. package/dist/_pkgs/affine-gfx-text/toolbar/actions.d.ts +8 -1
  190. package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +14 -2
  191. package/dist/_pkgs/affine-gfx-text/translations.d.ts +9 -0
  192. package/dist/_pkgs/affine-gfx-text/translations.js +14 -1
  193. package/dist/_pkgs/affine-inline-latex/latex-node/latex-editor-menu.js +2 -1
  194. package/dist/_pkgs/affine-inline-preset/markdown.js +5 -1
  195. package/dist/_pkgs/affine-model/consts/connector.d.ts +28 -2
  196. package/dist/_pkgs/affine-model/consts/connector.js +26 -0
  197. package/dist/_pkgs/affine-model/consts/text.d.ts +15 -2
  198. package/dist/_pkgs/affine-model/consts/text.js +25 -1
  199. package/dist/_pkgs/affine-model/elements/bpmn/pool.js +1 -1
  200. package/dist/_pkgs/affine-model/elements/brush/brush.js +1 -1
  201. package/dist/_pkgs/affine-model/elements/c4/board.js +1 -1
  202. package/dist/_pkgs/affine-model/elements/c4/boundary.js +1 -1
  203. package/dist/_pkgs/affine-model/elements/connector/connector.d.ts +135 -0
  204. package/dist/_pkgs/affine-model/elements/connector/connector.js +246 -5
  205. package/dist/_pkgs/affine-model/elements/connector/end-label.d.ts +83 -0
  206. package/dist/_pkgs/affine-model/elements/connector/end-label.js +119 -0
  207. package/dist/_pkgs/affine-model/elements/connector/index.d.ts +1 -0
  208. package/dist/_pkgs/affine-model/elements/connector/index.js +1 -0
  209. package/dist/_pkgs/affine-model/elements/context-map/context-map.js +1 -1
  210. package/dist/_pkgs/affine-model/elements/core-domain/core-domain.d.ts +28 -0
  211. package/dist/_pkgs/affine-model/elements/core-domain/core-domain.js +129 -2
  212. package/dist/_pkgs/affine-model/elements/cynefin/cynefin.d.ts +8 -0
  213. package/dist/_pkgs/affine-model/elements/cynefin/cynefin.js +45 -2
  214. package/dist/_pkgs/affine-model/elements/edgy/board.js +1 -1
  215. package/dist/_pkgs/affine-model/elements/edgy/facets.js +1 -1
  216. package/dist/_pkgs/affine-model/elements/estuarine/estuarine.d.ts +6 -0
  217. package/dist/_pkgs/affine-model/elements/estuarine/estuarine.js +36 -2
  218. package/dist/_pkgs/affine-model/elements/event-storming/event-storming.d.ts +18 -7
  219. package/dist/_pkgs/affine-model/elements/event-storming/event-storming.js +23 -8
  220. package/dist/_pkgs/affine-model/elements/framework-background/background.d.ts +16 -0
  221. package/dist/_pkgs/affine-model/elements/framework-background/background.js +18 -0
  222. package/dist/_pkgs/affine-model/elements/highlighter/highlighter.js +1 -1
  223. package/dist/_pkgs/affine-model/elements/index.d.ts +8 -0
  224. package/dist/_pkgs/affine-model/elements/index.js +1 -0
  225. package/dist/_pkgs/affine-model/elements/shape/shape.js +1 -1
  226. package/dist/_pkgs/affine-model/elements/text/text.js +1 -1
  227. package/dist/_pkgs/affine-model/elements/uml/band.d.ts +39 -0
  228. package/dist/_pkgs/affine-model/elements/uml/band.js +31 -0
  229. package/dist/_pkgs/affine-model/elements/uml/diagram.d.ts +158 -0
  230. package/dist/_pkgs/affine-model/elements/uml/diagram.js +229 -0
  231. package/dist/_pkgs/affine-model/elements/uml/fragment.d.ts +161 -0
  232. package/dist/_pkgs/affine-model/elements/uml/fragment.js +205 -0
  233. package/dist/_pkgs/affine-model/elements/uml/index.d.ts +8 -0
  234. package/dist/_pkgs/affine-model/elements/uml/index.js +8 -0
  235. package/dist/_pkgs/affine-model/elements/uml/lifeline.d.ts +77 -0
  236. package/dist/_pkgs/affine-model/elements/uml/lifeline.js +89 -0
  237. package/dist/_pkgs/affine-model/elements/uml/node.d.ts +142 -0
  238. package/dist/_pkgs/affine-model/elements/uml/node.js +190 -0
  239. package/dist/_pkgs/affine-model/elements/uml/partition.d.ts +106 -0
  240. package/dist/_pkgs/affine-model/elements/uml/partition.js +172 -0
  241. package/dist/_pkgs/affine-model/elements/uml/region.d.ts +75 -0
  242. package/dist/_pkgs/affine-model/elements/uml/region.js +150 -0
  243. package/dist/_pkgs/affine-model/elements/uml/subject.d.ts +37 -0
  244. package/dist/_pkgs/affine-model/elements/uml/subject.js +108 -0
  245. package/dist/_pkgs/affine-model/elements/wardley/wardley.js +1 -1
  246. package/dist/_pkgs/affine-shared/services/embed-iframe/embed-iframe-config.d.ts +1 -0
  247. package/dist/_pkgs/affine-shared/services/font-loader/config.d.ts +18 -0
  248. package/dist/_pkgs/affine-shared/services/font-loader/config.js +82 -50
  249. package/dist/_pkgs/affine-shared/services/pivot-materiality-publisher.js +1 -9
  250. package/dist/_pkgs/affine-shared/services/telemetry-service/document-damage-watcher.d.ts +53 -0
  251. package/dist/_pkgs/affine-shared/services/telemetry-service/document-damage-watcher.js +95 -0
  252. package/dist/_pkgs/affine-shared/services/telemetry-service/index.d.ts +1 -0
  253. package/dist/_pkgs/affine-shared/services/telemetry-service/index.js +1 -0
  254. package/dist/_pkgs/affine-shared/services/telemetry-service/lifecycle.d.ts +26 -1
  255. package/dist/_pkgs/affine-shared/services/telemetry-service/telemetry-service.d.ts +2 -2
  256. package/dist/_pkgs/affine-shared/services/theme-service.d.ts +19 -0
  257. package/dist/_pkgs/affine-shared/services/theme-service.js +24 -0
  258. package/dist/_pkgs/affine-shared/services/toolbar-service/command-action.d.ts +34 -0
  259. package/dist/_pkgs/affine-shared/services/toolbar-service/command-action.js +63 -0
  260. package/dist/_pkgs/affine-shared/services/toolbar-service/index.d.ts +1 -0
  261. package/dist/_pkgs/affine-shared/services/toolbar-service/index.js +1 -0
  262. package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +97 -7
  263. package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +178 -7
  264. package/dist/_pkgs/affine-shared/styles/index.d.ts +1 -0
  265. package/dist/_pkgs/affine-shared/styles/index.js +1 -0
  266. package/dist/_pkgs/affine-shared/styles/motion.d.ts +14 -0
  267. package/dist/_pkgs/affine-shared/styles/motion.js +38 -0
  268. package/dist/_pkgs/affine-shared/utils/event.d.ts +10 -0
  269. package/dist/_pkgs/affine-shared/utils/event.js +20 -0
  270. package/dist/_pkgs/affine-shared/utils/file/filesys.d.ts +16 -0
  271. package/dist/_pkgs/affine-shared/utils/file/filesys.js +25 -0
  272. package/dist/_pkgs/affine-shared/utils/index.d.ts +1 -0
  273. package/dist/_pkgs/affine-shared/utils/index.js +1 -0
  274. package/dist/_pkgs/affine-shared/utils/link-preview-refresh.d.ts +12 -0
  275. package/dist/_pkgs/affine-shared/utils/link-preview-refresh.js +13 -0
  276. package/dist/_pkgs/affine-widget-edgeless-dragging-area/edgeless-dragging-area-rect.js +2 -2
  277. package/dist/_pkgs/affine-widget-edgeless-selected-rect/utils.js +5 -1
  278. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.d.ts +12 -4
  279. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.js +27 -4
  280. package/dist/_pkgs/affine-widget-edgeless-toolbar/config/types.d.ts +15 -0
  281. package/dist/_pkgs/affine-widget-edgeless-toolbar/config/utils.d.ts +1 -1
  282. package/dist/_pkgs/affine-widget-edgeless-toolbar/config/utils.js +7 -2
  283. package/dist/_pkgs/affine-widget-edgeless-toolbar/create-popper.js +13 -0
  284. package/dist/_pkgs/affine-widget-edgeless-toolbar/index.d.ts +2 -0
  285. package/dist/_pkgs/affine-widget-edgeless-toolbar/index.js +2 -0
  286. package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.d.ts +80 -0
  287. package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.js +270 -81
  288. package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/senior-menu-selection.d.ts +15 -0
  289. package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/senior-menu-selection.js +15 -0
  290. package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-family-panel.d.ts +18 -0
  291. package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-family-panel.js +52 -6
  292. package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-weight-and-style-panel.js +8 -1
  293. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-ghost-overlay.d.ts +42 -0
  294. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-ghost-overlay.js +100 -0
  295. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-placement-tool.d.ts +100 -0
  296. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-placement-tool.js +274 -0
  297. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/index.d.ts +3 -0
  298. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/index.js +3 -0
  299. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/translate-created.d.ts +25 -0
  300. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/translate-created.js +67 -0
  301. package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.d.ts +6 -0
  302. package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.js +10 -0
  303. package/dist/_pkgs/affine-widget-edgeless-toolbar/view.js +5 -0
  304. package/dist/_pkgs/affine-widget-frame-title/edgeless-frame-title-editor.js +2 -1
  305. package/dist/_pkgs/affine-widget-slash-menu/translations.d.ts +16 -0
  306. package/dist/_pkgs/affine-widget-slash-menu/translations.js +23 -1
  307. package/dist/_pkgs/affine-widget-toolbar/utils.js +57 -14
  308. package/dist/_pkgs/data-view/core/detail/field.js +2 -1
  309. package/dist/_pkgs/data-view/core/filter/literal/define.js +3 -1
  310. package/dist/_pkgs/data-view/core/group-by/renderer/boolean-group.js +1 -1
  311. package/dist/_pkgs/data-view/property-presets/checkbox/cell-renderer.js +8 -2
  312. package/dist/_pkgs/data-view/view-presets/kanban/pc/cell.js +1 -1
  313. package/dist/_pkgs/data-view/view-presets/kanban/pc/controller/drag.js +2 -1
  314. package/dist/_pkgs/data-view/view-presets/table/pc/controller/drag.js +2 -1
  315. package/dist/_pkgs/data-view/view-presets/table/pc/controller/selection.js +1 -1
  316. package/dist/_pkgs/data-view/view-presets/table/pc/header/vertical-indicator.js +2 -1
  317. package/dist/_pkgs/data-view/view-presets/table/pc/row/row-select-checkbox.js +3 -1
  318. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/drag.js +2 -1
  319. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/selection.js +1 -1
  320. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/top/header/vertical-indicator.js +2 -1
  321. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/row/row-header.js +3 -1
  322. package/dist/_pkgs/global/gfx/xywh.js +7 -0
  323. package/dist/_pkgs/std/extension/command-registry.d.ts +158 -1
  324. package/dist/_pkgs/std/extension/command-registry.js +22 -0
  325. package/dist/_pkgs/std/gfx/index.d.ts +1 -1
  326. package/dist/_pkgs/std/gfx/interactivity/gfx-view-event-handler.d.ts +12 -0
  327. package/dist/_pkgs/std/gfx/interactivity/gfx-view-event-handler.js +20 -1
  328. package/dist/_pkgs/std/gfx/interactivity/manager.d.ts +10 -0
  329. package/dist/_pkgs/std/gfx/interactivity/manager.js +12 -0
  330. package/dist/_pkgs/std/gfx/model/surface/element-model.js +12 -7
  331. package/dist/_pkgs/std/gfx/model/surface/role.d.ts +10 -5
  332. package/dist/_pkgs/std/gfx/model/surface/surface-model.d.ts +56 -0
  333. package/dist/_pkgs/std/gfx/model/surface/surface-model.js +84 -3
  334. package/dist/_pkgs/std/gfx/view/view.d.ts +11 -2
  335. package/dist/_pkgs/std/gfx/view/view.js +16 -2
  336. package/dist/commands.d.ts +6 -0
  337. package/dist/commands.js +10 -2
  338. package/dist/frameworks.d.ts +9 -0
  339. package/dist/frameworks.js +19 -0
  340. package/dist/translations.js +21 -0
  341. package/package.json +13 -4
  342. package/dist/_pkgs/affine-gfx-group/group-watcher.d.ts +0 -1
  343. package/dist/_pkgs/affine-gfx-group/group-watcher.js +0 -20
@@ -0,0 +1,53 @@
1
+ import { LifeCycleWatcher } from '../../../std/index.js';
2
+ import type { SurfaceElementDamage, SurfaceElementDamageReport } from '../../../std/gfx/index.js';
3
+ /**
4
+ * The whole surface API this watcher touches, named structurally on purpose:
5
+ * it is also the entire harness a unit spec has to stand up, and it keeps the
6
+ * watcher from caring which block flavour grew a `damagedElements` map next.
7
+ */
8
+ export type DamageReportingSurface = {
9
+ readonly damagedElements: ReadonlyMap<string, SurfaceElementDamage>;
10
+ readonly elementDamaged: {
11
+ subscribe(next: (report: SurfaceElementDamageReport) => void): {
12
+ unsubscribe(): void;
13
+ };
14
+ };
15
+ };
16
+ export declare function isDamageReportingSurface(model: unknown): model is DamageReportingSurface;
17
+ /**
18
+ * Reports `DocumentDamaged` — how many documents open carrying elements the
19
+ * editor cannot draw (#318, follow-up of #321).
20
+ *
21
+ * **Why a state read and not only a subscription.** The surface builds its
22
+ * element models when the block model is created, well before any view or
23
+ * `LifeCycleWatcher` is mounted, so every element the document OPENED with is
24
+ * already damaged by the time this watcher exists. It therefore reads
25
+ * `surface.damagedElements` once at mount for the opening batch, and only then
26
+ * subscribes for what a remote sync delivers afterwards.
27
+ *
28
+ * **One event per batch, elements deduplicated for the watcher's lifetime.**
29
+ * A sync can deliver several damaged elements in one go; sending one event per
30
+ * element would make "how many damaged documents" unreadable, and re-sending an
31
+ * id already counted would make it wrong. Later arrivals are therefore
32
+ * aggregated in a microtask and filtered against what was already reported.
33
+ *
34
+ * `page` is left unset here for the reason `BlockLifecycleTelemetryWatcher`
35
+ * leaves it unset: this is store plumbing, it has no editor mode to state, and
36
+ * a damaged document is damaged in either one.
37
+ *
38
+ * Inert when no `TelemetryService` is injected.
39
+ */
40
+ export declare class DocumentDamageTelemetryWatcher extends LifeCycleWatcher {
41
+ static readonly key = "document-damage-telemetry";
42
+ /** Ids already counted, so a document never counts an element twice. */
43
+ private readonly _counted;
44
+ private readonly _pending;
45
+ private _flushScheduled;
46
+ private _stopped;
47
+ private _subscriptions;
48
+ private _telemetry?;
49
+ mounted(): void;
50
+ unmounted(): void;
51
+ private _schedule;
52
+ private _flush;
53
+ }
@@ -0,0 +1,95 @@
1
+ import { LifeCycleWatcher } from '../../../std/index.js';
2
+ import { TelemetryProvider, } from './telemetry-service.js';
3
+ export function isDamageReportingSurface(model) {
4
+ const candidate = model;
5
+ return (!!candidate &&
6
+ candidate.damagedElements instanceof Map &&
7
+ typeof candidate.elementDamaged?.subscribe === 'function');
8
+ }
9
+ /**
10
+ * Reports `DocumentDamaged` — how many documents open carrying elements the
11
+ * editor cannot draw (#318, follow-up of #321).
12
+ *
13
+ * **Why a state read and not only a subscription.** The surface builds its
14
+ * element models when the block model is created, well before any view or
15
+ * `LifeCycleWatcher` is mounted, so every element the document OPENED with is
16
+ * already damaged by the time this watcher exists. It therefore reads
17
+ * `surface.damagedElements` once at mount for the opening batch, and only then
18
+ * subscribes for what a remote sync delivers afterwards.
19
+ *
20
+ * **One event per batch, elements deduplicated for the watcher's lifetime.**
21
+ * A sync can deliver several damaged elements in one go; sending one event per
22
+ * element would make "how many damaged documents" unreadable, and re-sending an
23
+ * id already counted would make it wrong. Later arrivals are therefore
24
+ * aggregated in a microtask and filtered against what was already reported.
25
+ *
26
+ * `page` is left unset here for the reason `BlockLifecycleTelemetryWatcher`
27
+ * leaves it unset: this is store plumbing, it has no editor mode to state, and
28
+ * a damaged document is damaged in either one.
29
+ *
30
+ * Inert when no `TelemetryService` is injected.
31
+ */
32
+ export class DocumentDamageTelemetryWatcher extends LifeCycleWatcher {
33
+ constructor() {
34
+ super(...arguments);
35
+ /** Ids already counted, so a document never counts an element twice. */
36
+ this._counted = new Set();
37
+ this._pending = new Set();
38
+ this._flushScheduled = false;
39
+ this._stopped = false;
40
+ this._subscriptions = [];
41
+ }
42
+ static { this.key = 'document-damage-telemetry'; }
43
+ mounted() {
44
+ const telemetry = this.std.getOptional(TelemetryProvider);
45
+ if (!telemetry)
46
+ return;
47
+ this._telemetry = telemetry;
48
+ // Structural, not `instanceof SurfaceBlockModel`: the watcher needs two
49
+ // members, not a class, and the guard is what states that.
50
+ const surfaces = this.std.store.getModelsByFlavour('affine:surface').filter(isDamageReportingSurface);
51
+ for (const surface of surfaces) {
52
+ for (const id of surface.damagedElements.keys())
53
+ this._pending.add(id);
54
+ this._subscriptions.push(surface.elementDamaged.subscribe(({ id }) => {
55
+ this._pending.add(id);
56
+ this._schedule();
57
+ }));
58
+ }
59
+ // The opening batch, synchronously: it is complete already, and nothing
60
+ // gained by making the host wait a tick for the number it opened with.
61
+ this._flush();
62
+ }
63
+ unmounted() {
64
+ this._stopped = true;
65
+ for (const subscription of this._subscriptions)
66
+ subscription.unsubscribe();
67
+ this._subscriptions = [];
68
+ this._pending.clear();
69
+ this._counted.clear();
70
+ this._telemetry = undefined;
71
+ super.unmounted();
72
+ }
73
+ _schedule() {
74
+ if (this._flushScheduled)
75
+ return;
76
+ this._flushScheduled = true;
77
+ queueMicrotask(() => {
78
+ this._flushScheduled = false;
79
+ if (!this._stopped)
80
+ this._flush();
81
+ });
82
+ }
83
+ _flush() {
84
+ const fresh = [...this._pending].filter(id => !this._counted.has(id));
85
+ this._pending.clear();
86
+ if (fresh.length === 0)
87
+ return;
88
+ for (const id of fresh)
89
+ this._counted.add(id);
90
+ this._telemetry?.track('DocumentDamaged', {
91
+ reason: 'missing-xywh',
92
+ elementCount: fresh.length,
93
+ });
94
+ }
95
+ }
@@ -1,6 +1,7 @@
1
1
  export * from './block-lifecycle-watcher.js';
2
2
  export * from './citation.js';
3
3
  export * from './database.js';
4
+ export * from './document-damage-watcher.js';
4
5
  export * from './lifecycle.js';
5
6
  export * from './link.js';
6
7
  export * from './noop.js';
@@ -1,6 +1,7 @@
1
1
  export * from './block-lifecycle-watcher.js';
2
2
  export * from './citation.js';
3
3
  export * from './database.js';
4
+ export * from './document-damage-watcher.js';
4
5
  export * from './lifecycle.js';
5
6
  export * from './link.js';
6
7
  export * from './noop.js';
@@ -34,7 +34,7 @@ export type BlockLifecycleEvents = {
34
34
  * manipulated ('background:classic', 'node:market', 'connector:link'…).
35
35
  */
36
36
  export interface FrameworkElementEvent extends TelemetryEvent {
37
- framework: 'wardley' | 'edgy' | 'cynefin' | 'bpmn' | 'c4' | 'event-storming' | 'core-domain' | 'context-map';
37
+ framework: 'wardley' | 'edgy' | 'cynefin' | 'bpmn' | 'c4' | 'event-storming' | 'core-domain' | 'context-map' | 'uml';
38
38
  element: string;
39
39
  }
40
40
  /**
@@ -295,3 +295,28 @@ export type AuditEvents = {
295
295
  MapAuditCompleted: MapAuditCompletedEvent;
296
296
  MapAuditInterrupted: MapAuditInterruptedEvent;
297
297
  };
298
+ /**
299
+ * A document was opened carrying elements the editor cannot draw — today, a
300
+ * surface element whose `xywh` never arrived (#318), which reads a zero-size
301
+ * bound and paints nothing.
302
+ *
303
+ * **Not a lifecycle event and not a user gesture: a health event.** The block
304
+ * taxonomy describes what someone did; this one describes what a document IS
305
+ * when it lands, which no existing event can say. It was already reported as a
306
+ * `console.warn` by the surface model — invisible to analytics, and therefore
307
+ * unable to answer the one question that matters after the app-side
308
+ * persistence fix: *how many documents open damaged*. The metric the dashboard
309
+ * reads is the count of DISTINCT documents, not of events.
310
+ *
311
+ * Counts only. Never an element id, never a type name, never board content.
312
+ */
313
+ export interface DocumentDamagedEvent extends TelemetryEvent {
314
+ page?: 'doc editor' | 'whiteboard editor';
315
+ /** What is wrong with the elements this event counts. */
316
+ reason: 'missing-xywh';
317
+ /** How many damaged elements this batch found. */
318
+ elementCount: number;
319
+ }
320
+ export type DocumentHealthEvents = {
321
+ DocumentDamaged: DocumentDamagedEvent;
322
+ };
@@ -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, FrameworkDiagramEvents, ValidationEvents } from './lifecycle.js';
5
+ import type { AuditEvents, BlockLifecycleEvents, 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 & {
10
+ export type TelemetryEventMap = OutDatabaseAllEvents & LinkToolbarEvents & SlashMenuEvents & CodeBlockEvents & NoteEvents & CitationEvents & BlockLifecycleEvents & FrameworkDiagramEvents & ValidationEvents & AuditEvents & DocumentHealthEvents & {
11
11
  DocCreated: DocCreatedEvent;
12
12
  Link: TelemetryEvent;
13
13
  LinkedDocCreated: LinkedDocCreatedEvent;
@@ -59,6 +59,25 @@ export declare class ThemeService extends Extension {
59
59
  getColorValue(color: Color, fallback?: Color, real?: boolean, theme?: ColorScheme): string;
60
60
  getCssVariableColor(property: string, theme?: ColorScheme): string;
61
61
  }
62
+ /**
63
+ * The CSS variable the chrome accent lives behind — the token `DESIGN.md`'s
64
+ * Borrowed Blue Rule names. Kept here so a canvas painter can reach the accent
65
+ * by NAME rather than by value.
66
+ */
67
+ export declare const CHROME_ACCENT_CSS_VARIABLE = "--affine-primary-color";
68
+ /**
69
+ * The chrome accent resolved for the theme in force, ready to be handed to a
70
+ * `CanvasRenderingContext2D` (`strokeStyle`, `fillStyle`), which cannot take a
71
+ * `var(…)`.
72
+ *
73
+ * Canvas painters used to write the AFFiNE blue out as a hex, which made it
74
+ * unreachable for a host re-skin: the DOM followed `--affine-primary-color`
75
+ * while the canvas stayed on the literal. The last-resort value, for the case
76
+ * where no `ThemeProvider` is registered, is READ from the upstream theme
77
+ * rather than spelled out, so no module holds a copy of the hex
78
+ * (`brand-hex.unit.spec.ts` enforces that).
79
+ */
80
+ export declare function getChromeAccentColor(std: BlockStdScope): string;
62
81
  export declare class ThemeObserver {
63
82
  private readonly observer;
64
83
  theme$: Signal<ColorScheme>;
@@ -104,6 +104,30 @@ export class ThemeService extends Extension {
104
104
  return property;
105
105
  }
106
106
  }
107
+ /**
108
+ * The CSS variable the chrome accent lives behind — the token `DESIGN.md`'s
109
+ * Borrowed Blue Rule names. Kept here so a canvas painter can reach the accent
110
+ * by NAME rather than by value.
111
+ */
112
+ export const CHROME_ACCENT_CSS_VARIABLE = '--affine-primary-color';
113
+ /**
114
+ * The chrome accent resolved for the theme in force, ready to be handed to a
115
+ * `CanvasRenderingContext2D` (`strokeStyle`, `fillStyle`), which cannot take a
116
+ * `var(…)`.
117
+ *
118
+ * Canvas painters used to write the AFFiNE blue out as a hex, which made it
119
+ * unreachable for a host re-skin: the DOM followed `--affine-primary-color`
120
+ * while the canvas stayed on the literal. The last-resort value, for the case
121
+ * where no `ThemeProvider` is registered, is READ from the upstream theme
122
+ * rather than spelled out, so no module holds a copy of the hex
123
+ * (`brand-hex.unit.spec.ts` enforces that).
124
+ */
125
+ export function getChromeAccentColor(std) {
126
+ return (std
127
+ .getOptional(ThemeProvider)
128
+ ?.getCssVariableColor(CHROME_ACCENT_CSS_VARIABLE) ??
129
+ combinedLightCssVariables[CHROME_ACCENT_CSS_VARIABLE]);
130
+ }
107
131
  export class ThemeObserver {
108
132
  constructor() {
109
133
  const COLOR_SCHEMES = Object.values(ColorScheme);
@@ -0,0 +1,34 @@
1
+ import type { TemplateResult } from 'lit';
2
+ import { type ToolbarActionGenerator } from './action.js';
3
+ /**
4
+ * A "⋮" entry that INVOKES a registered command instead of restating what it
5
+ * does — the shape `docs/adr/0010` M3 introduced, and the reason an export has
6
+ * one behaviour, one availability rule and one telemetry emission whether it is
7
+ * reached from here, from the catalogue, from the palette, from
8
+ * Settings › Shortcuts or from the agent.
9
+ *
10
+ * Two things the widget imposes: a menu line is drawn from `label` (a tooltip
11
+ * on a line that is already words would be a second copy of them), and
12
+ * `placement: ActionPlacement.More` is what partitions it out of the row in the
13
+ * first place — `renderToolbar` splits on exactly that flag, and the entries it
14
+ * collects come from every module contributing to the element, so a framework
15
+ * can add to the "⋮" without owning it.
16
+ *
17
+ * `generate` rather than a static entry because the i18n seam needs `std`:
18
+ * `translateKey` is what reaches the host's catalogue, and a hard-coded English
19
+ * label would be the one wording a host could not override.
20
+ *
21
+ * ## Why it lives here
22
+ *
23
+ * It was written three times — BPMN's pool row, C4's board row and Wardley's
24
+ * map row — each copy a few words of comment apart from the others, because a
25
+ * framework's toolbar has no layer below it to share with. The generic SVG
26
+ * export (`export.svg`, ADR 0025) is the fourth caller and the first that is
27
+ * not a framework at all, which is what settles the question: the shape belongs
28
+ * to the toolbar service, beside the module registry it plugs into, not to
29
+ * whichever framework happened to need it first.
30
+ *
31
+ * `translateKey` lives in this same package, and `@labre/std` is already a
32
+ * dependency of it, so nothing here closes an import cycle.
33
+ */
34
+ export declare function commandMoreAction(id: string, commandId: string, labelKey: string, labelFallback: string, icon: TemplateResult): ToolbarActionGenerator;
@@ -0,0 +1,63 @@
1
+ import { getRegisteredCommands, runCommand } from '../../../std/index.js';
2
+ import { translateKey } from '../translation-service/index.js';
3
+ import { ActionPlacement } from './action.js';
4
+ /** The registered command an entry drives, or `undefined` when it is not. */
5
+ const findCommand = (ctx, id) => getRegisteredCommands(ctx.std).find(candidate => candidate.id === id);
6
+ /**
7
+ * A "⋮" entry that INVOKES a registered command instead of restating what it
8
+ * does — the shape `docs/adr/0010` M3 introduced, and the reason an export has
9
+ * one behaviour, one availability rule and one telemetry emission whether it is
10
+ * reached from here, from the catalogue, from the palette, from
11
+ * Settings › Shortcuts or from the agent.
12
+ *
13
+ * Two things the widget imposes: a menu line is drawn from `label` (a tooltip
14
+ * on a line that is already words would be a second copy of them), and
15
+ * `placement: ActionPlacement.More` is what partitions it out of the row in the
16
+ * first place — `renderToolbar` splits on exactly that flag, and the entries it
17
+ * collects come from every module contributing to the element, so a framework
18
+ * can add to the "⋮" without owning it.
19
+ *
20
+ * `generate` rather than a static entry because the i18n seam needs `std`:
21
+ * `translateKey` is what reaches the host's catalogue, and a hard-coded English
22
+ * label would be the one wording a host could not override.
23
+ *
24
+ * ## Why it lives here
25
+ *
26
+ * It was written three times — BPMN's pool row, C4's board row and Wardley's
27
+ * map row — each copy a few words of comment apart from the others, because a
28
+ * framework's toolbar has no layer below it to share with. The generic SVG
29
+ * export (`export.svg`, ADR 0025) is the fourth caller and the first that is
30
+ * not a framework at all, which is what settles the question: the shape belongs
31
+ * to the toolbar service, beside the module registry it plugs into, not to
32
+ * whichever framework happened to need it first.
33
+ *
34
+ * `translateKey` lives in this same package, and `@labre/std` is already a
35
+ * dependency of it, so nothing here closes an import cycle.
36
+ */
37
+ export function commandMoreAction(id, commandId, labelKey, labelFallback, icon) {
38
+ return {
39
+ id,
40
+ placement: ActionPlacement.More,
41
+ when: (ctx) => {
42
+ const command = findCommand(ctx, commandId);
43
+ return command !== undefined && (command.when?.(ctx.std) ?? true);
44
+ },
45
+ generate: (ctx) => ({
46
+ icon,
47
+ label: translateKey(ctx.std, labelKey, labelFallback),
48
+ run: (runCtx) => {
49
+ const command = findCommand(runCtx, commandId);
50
+ if (!command)
51
+ return;
52
+ // The same `source` the row's own entries report: the "⋮" is a
53
+ // degradation of the row, not a surface of its own, and the
54
+ // `ElementCreationSource` union deliberately names places rather than
55
+ // widths (`docs/adr/0008`).
56
+ runCommand(runCtx.std, command, {
57
+ surface: 'contextual-toolbar',
58
+ source: 'toolbar:general',
59
+ });
60
+ },
61
+ }),
62
+ };
63
+ }
@@ -1,4 +1,5 @@
1
1
  export * from './action.js';
2
+ export * from './command-action.js';
2
3
  export * from './config.js';
3
4
  export * from './context.js';
4
5
  export { Flag as ToolbarFlag } from './flags.js';
@@ -1,4 +1,5 @@
1
1
  export * from './action.js';
2
+ export * from './command-action.js';
2
3
  export * from './config.js';
3
4
  export * from './context.js';
4
5
  export { Flag as ToolbarFlag } from './flags.js';
@@ -38,6 +38,18 @@ export declare const TOAST_LINKED_DOC_CREATED: ChromeWording;
38
38
  export declare const TOAST_NOTE_REMOVED_FROM_PAGE: ChromeWording;
39
39
  export declare const TOAST_FRAME_INSERTED_INTO_PAGE: ChromeWording;
40
40
  export declare const TOAST_NO_LINK_FOUND: ChromeWording;
41
+ /**
42
+ * What the `doc.copyLink` command says once the document's URL is on the
43
+ * clipboard.
44
+ *
45
+ * Its own wording rather than {@link TOAST_COPIED_TO_CLIPBOARD}: that one
46
+ * reports a SLICE copy (blocks, elements, an image) and this one reports a
47
+ * link, and the two are told apart by nothing else on screen. Its own wording
48
+ * rather than the inline link toolbar's "Copied link to clipboard" too — that
49
+ * key belongs to `@labre/affine-inline-link` and names the `href` a delta
50
+ * already carried, not a document address the host just generated.
51
+ */
52
+ export declare const TOAST_LINK_COPIED: ChromeWording;
41
53
  export declare const TOOLBAR_BRING_TO_FRONT: ChromeWording;
42
54
  export declare const TOOLBAR_SEND_TO_BACK: ChromeWording;
43
55
  export declare const TOOLBAR_COPY: ChromeWording;
@@ -93,6 +105,35 @@ export declare const SYNCED_DOC_EMPTY_PREVIEW: ChromeWording;
93
105
  * copies of it in eight manifests would be eight keys for one tooltip.
94
106
  */
95
107
  export declare const BOARD_RESIZE_TOGGLE: ChromeWording;
108
+ /**
109
+ * The orientation toggle a BANDED background carries: the one gesture that
110
+ * turns a frame drawn in columns into the same frame drawn in rows.
111
+ *
112
+ * Declared beside the resize toggle for the same reason and with the same
113
+ * scope: it names a behaviour of the frame primitive — where the name band
114
+ * sits and which way the bands run — rather than anything a notation calls its
115
+ * own. A UML activity partition is the first frame to use it (§15.6.4 draws
116
+ * swimlanes either way and says the choice means nothing); a BPMN pool is the
117
+ * obvious second, and a second key for it would be a second tooltip for one
118
+ * word.
119
+ */
120
+ export declare const BOARD_ORIENTATION_TOGGLE: ChromeWording;
121
+ /**
122
+ * The gesture that divides a banded background one band further — the button a
123
+ * frame carrying zones offers next to the two above.
124
+ *
125
+ * Declared here with them, and for the third time for the same reason: it names
126
+ * a behaviour of the generic frame primitive (a background whose `instanceZones`
127
+ * are a list the author grows) rather than anything a notation calls its own. A
128
+ * UML combined fragment is the first frame to use it — §17.6.4's second operand
129
+ * is a band added to a box that has one — and a BPMN pool's lane is the obvious
130
+ * second the day it stops reaching this through a command of its own.
131
+ *
132
+ * "Band" and not "operand" or "lane": the word has to be true of every frame
133
+ * that offers the button, and each notation's own noun is already written on
134
+ * the element the button is attached to.
135
+ */
136
+ export declare const BOARD_ADD_BAND: ChromeWording;
96
137
  /**
97
138
  * The legend button, in the two wordings the boards actually use: the notation
98
139
  * boards say "notation", Wardley says "components".
@@ -103,6 +144,19 @@ export declare const BOARD_RESIZE_TOGGLE: ChromeWording;
103
144
  */
104
145
  export declare const BOARD_LEGEND_NOTATION: ChromeWording;
105
146
  export declare const BOARD_LEGEND_COMPONENTS: ChromeWording;
147
+ /**
148
+ * The two END labels a connector can carry beside its caption — where UML
149
+ * writes a multiplicity and a role name (`docs/adr/0018` phase 2).
150
+ *
151
+ * Declared here and not in the UML pack for the same reason the resize toggle
152
+ * is: they name a part of the generic CONNECTOR, which every framework draws,
153
+ * and a stored connector keeps its end labels with the UML tooling switched off
154
+ * (`docs/adr/0009`). "Source" and "target" are the connector's own words for
155
+ * its two ends, already the vocabulary of `frontEndpointStyle` /
156
+ * `rearEndpointStyle` and of the direction commands.
157
+ */
158
+ export declare const CONNECTOR_SOURCE_LABEL: ChromeWording;
159
+ export declare const CONNECTOR_TARGET_LABEL: ChromeWording;
106
160
  export declare const NOTE_SHADOW_NONE: ChromeWording;
107
161
  export declare const NOTE_SHADOW_BOX: ChromeWording;
108
162
  export declare const NOTE_SHADOW_STICKER: ChromeWording;
@@ -136,14 +190,19 @@ export declare const TEXT_FORMAT_ITALIC: ChromeWording;
136
190
  export declare const TEXT_FORMAT_UNDERLINE: ChromeWording;
137
191
  export declare const TEXT_FORMAT_STRIKETHROUGH: ChromeWording;
138
192
  /**
139
- * The three font weights and the one non-default font style a text toolbar
140
- * offers — said identically by the toolbar's own "current selection" label
141
- * (`gfx/text`) and by the popup menu that picks them
142
- * (`widgets/edgeless-toolbar`).
193
+ * The font weights and the one non-default font style a text toolbar offers —
194
+ * said identically by the toolbar's own "current selection" label (`gfx/text`)
195
+ * and by the popup menu that picks them (`widgets/edgeless-toolbar`).
143
196
  */
144
197
  export declare const FONT_WEIGHT_LIGHT: ChromeWording;
145
198
  export declare const FONT_WEIGHT_REGULAR: ChromeWording;
146
199
  export declare const FONT_WEIGHT_SEMIBOLD: ChromeWording;
200
+ /**
201
+ * An alias (L7 dedupe): the heaviest canvas weight is said with the same word
202
+ * as the prose toolbar's {@link TEXT_FORMAT_BOLD}, so it shares its one key —
203
+ * exactly as {@link FONT_STYLE_ITALIC} does below.
204
+ */
205
+ export declare const FONT_WEIGHT_BOLD: ChromeWording;
147
206
  /**
148
207
  * An alias (L7 dedupe): the same word as {@link TEXT_FORMAT_ITALIC}, one key.
149
208
  */
@@ -236,13 +295,36 @@ export declare const BLOCK_TYPE_QUOTE_DESCRIPTION: ChromeWording;
236
295
  export declare const BLOCK_TYPE_DIVIDER: ChromeWording;
237
296
  export declare const BLOCK_TYPE_DIVIDER_DESCRIPTION: ChromeWording;
238
297
  /**
239
- * The auto-legend BOX title every framework's `createAutoLegend` draws
240
- * (`AutoLegendSpec.title`, `@labre/affine-gfx-ddd-shared`) — "Legend" itself,
298
+ * The automatic legend BOX title the shared engine draws
299
+ * (`createBoardLegend`, `@labre/affine-block-surface`) — "Legend" itself,
241
300
  * distinct from the {@link BOARD_LEGEND_NOTATION} / {@link BOARD_LEGEND_COMPONENTS}
242
301
  * toolbar BUTTONS that create it. Declared here because it is the same word on
243
- * every board that has one: the three DDD tools, EDGY and C4 alike.
302
+ * every board that has one, and a board's own command may override it
303
+ * (`CommandLegendBox.titleWording`).
244
304
  */
245
305
  export declare const BOARD_LEGEND_TITLE: ChromeWording;
306
+ /**
307
+ * The group's own seed: the default title a newly created group is stamped
308
+ * with (`Group 2`), written into the document at creation. Resolved at
309
+ * PLACEMENT and never again — a group renamed by its author keeps its name,
310
+ * and a group created before this key existed keeps the plain text it was
311
+ * given.
312
+ *
313
+ * `{{n}}` is the group's 1-based ordinal among the groups already on the doc;
314
+ * see this service's README on why a count carries a param rather than its own
315
+ * key.
316
+ *
317
+ * ## Why it sits here rather than with the group package
318
+ *
319
+ * Two packages group elements and neither may import the other's translations:
320
+ * `@labre/affine-gfx-group`, which owns the gesture, and
321
+ * `@labre/affine-block-surface`, whose legend groups the box it just drew and
322
+ * which `gfx-group` DEPENDS ON. This layer is below both. It is deliberately
323
+ * NOT listed in {@link CHROME_WORDINGS}: the key stays declared by the group
324
+ * package under source `seed` (`GROUP_WORDINGS`), so the manifest is
325
+ * byte-identical to what it was — one key, one source.
326
+ */
327
+ export declare const GROUP_SEED_NAME: ChromeWording;
246
328
  /**
247
329
  * "Undo" said by the link package's quick-tool button (dense + full) and by
248
330
  * the generic notification's own undo action
@@ -287,6 +369,13 @@ export declare const PALETTE_NAME_MEDIUM_BLUE: ChromeWording;
287
369
  export declare const PALETTE_NAME_MEDIUM_PURPLE: ChromeWording;
288
370
  export declare const PALETTE_NAME_MEDIUM_MAGENTA: ChromeWording;
289
371
  export declare const PALETTE_NAME_MEDIUM_GREY: ChromeWording;
372
+ export declare const PALETTE_NAME_HEAVY_RED: ChromeWording;
373
+ export declare const PALETTE_NAME_HEAVY_ORANGE: ChromeWording;
374
+ export declare const PALETTE_NAME_HEAVY_YELLOW: ChromeWording;
375
+ export declare const PALETTE_NAME_HEAVY_GREEN: ChromeWording;
376
+ export declare const PALETTE_NAME_HEAVY_BLUE: ChromeWording;
377
+ export declare const PALETTE_NAME_HEAVY_PURPLE: ChromeWording;
378
+ export declare const PALETTE_NAME_HEAVY_MAGENTA: ChromeWording;
290
379
  /**
291
380
  * Keyed by the exact `Palette.key` string the default theme's tables produce
292
381
  * (`buildPalettes`, `packages/affine/model/src/themes/{default,utils}.ts`) —
@@ -294,6 +383,7 @@ export declare const PALETTE_NAME_MEDIUM_GREY: ChromeWording;
294
383
  * falls back to when a swatch declares no `labelWording` of its own.
295
384
  */
296
385
  export declare const PALETTE_NAME_WORDINGS: Readonly<Record<string, ChromeWording>>;
386
+ export declare const MENU_ARIA_STYLE: ChromeWording;
297
387
  export declare const CHROME_CLIPBOARD_FILE_TOO_LARGE: ChromeWording;
298
388
  export declare const CHROME_CLIPBOARD_SIZE_LIMIT: ChromeWording;
299
389
  export declare const TOOLBAR_CAPTION: ChromeWording;