@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
@@ -1,8 +1,8 @@
1
1
  import { EdgelessCRUDIdentifier } from '../../affine-block-surface/index.js';
2
- import { packColor, } from '../../affine-components/color-picker/index.js';
2
+ import { frameworkPaletteGroups, packColor, } from '../../affine-components/color-picker/index.js';
3
3
  import { createTextActions, normalizeTextBound } from '../../affine-gfx-text/index.js';
4
4
  import { ConnectorElementModel, ConnectorMode, DEFAULT_FRONT_ENDPOINT_STYLE, DEFAULT_REAR_ENDPOINT_STYLE, DefaultTheme, LineWidth, PointStyle, resolveColor, StrokeStyle, } from '../../affine-model/index.js';
5
- import { ToolbarModuleExtension, translateKey, } from '../../affine-shared/services/index.js';
5
+ import { CONNECTOR_SOURCE_LABEL, CONNECTOR_TARGET_LABEL, MENU_ARIA_STYLE, ToolbarModuleExtension, translateKey, } from '../../affine-shared/services/index.js';
6
6
  import { getMostCommonResolvedValue, getMostCommonValue, } from '../../affine-shared/utils/index.js';
7
7
  import { getRootBlock, LINE_STYLE_LIST, renderMenu, } from '../../affine-widget-edgeless-toolbar/index.js';
8
8
  import { Bound } from '../../global/gfx/index.js';
@@ -14,8 +14,20 @@ import { isConnectorWithLabel } from '../connector-manager.js';
14
14
  import { INVERT_EDGE_DIRECTION, invertEdgeDirection, } from '../direction/invert-direction.js';
15
15
  import { asTypedEdge, edgeIsBound, roleVocabularies, } from '../direction/typed-edge.js';
16
16
  import { mountConnectorLabelEditor } from '../text/index.js';
17
- import { CONNECTOR_ADD_TEXT, CONNECTOR_LABEL_END_POINT_STYLE, CONNECTOR_LABEL_SHAPE, CONNECTOR_LABEL_START_POINT_STYLE, CONNECTOR_LABEL_STROKE_STYLE, CONNECTOR_LABEL_STYLE, CONNECTOR_MODE_WORDING, CONNECTOR_TOOLTIP_CONNECTOR_SHAPE, CONNECTOR_TOOLTIP_FLIP_DIRECTION, } from '../translations.js';
18
- const FRONT_ENDPOINT_STYLE_LIST = [
17
+ import { EndPointDiamondHollowIcon, EndPointTriangleHollowIcon, StartPointDiamondHollowIcon, StartPointTriangleHollowIcon, } from './hollow-endpoint-icons.js';
18
+ import { CONNECTOR_ADD_TEXT, CONNECTOR_END_POINT_STYLE_MENU_ARIA, CONNECTOR_LABEL_END_POINT_STYLE, CONNECTOR_LABEL_SHAPE, CONNECTOR_LABEL_START_POINT_STYLE, CONNECTOR_LABEL_STROKE_STYLE, CONNECTOR_LABEL_STYLE, CONNECTOR_MODE_WORDING, CONNECTOR_SHAPE_MENU_ARIA, CONNECTOR_START_POINT_STYLE_MENU_ARIA, CONNECTOR_TOOLTIP_CONNECTOR_SHAPE, CONNECTOR_TOOLTIP_FLIP_DIRECTION, } from '../translations.js';
19
+ /**
20
+ * Every `PointStyle` must appear in BOTH lists.
21
+ *
22
+ * `renderMenu` paints the menu's trigger with
23
+ * `renderCurrentMenuItemWith(items, currentValue, 'icon')`, which returns
24
+ * `undefined` for a value the list does not carry — an unlisted style gives a
25
+ * blank button, so a connector created by a framework (or imported) with that
26
+ * head shows an empty endpoint control. There is no test that can catch a
27
+ * forgotten entry at the type level; `endpoint-style.unit.spec.ts` asserts the
28
+ * coverage instead.
29
+ */
30
+ export const FRONT_ENDPOINT_STYLE_LIST = [
19
31
  {
20
32
  value: PointStyle.None,
21
33
  icon: StartPointIcon(),
@@ -28,6 +40,10 @@ const FRONT_ENDPOINT_STYLE_LIST = [
28
40
  value: PointStyle.Triangle,
29
41
  icon: StartPointTriangleIcon(),
30
42
  },
43
+ {
44
+ value: PointStyle.TriangleHollow,
45
+ icon: StartPointTriangleHollowIcon(),
46
+ },
31
47
  {
32
48
  value: PointStyle.Circle,
33
49
  icon: StartPointCircleIcon(),
@@ -36,12 +52,20 @@ const FRONT_ENDPOINT_STYLE_LIST = [
36
52
  value: PointStyle.Diamond,
37
53
  icon: StartPointDiamondIcon(),
38
54
  },
55
+ {
56
+ value: PointStyle.DiamondHollow,
57
+ icon: StartPointDiamondHollowIcon(),
58
+ },
39
59
  ];
40
- const REAR_ENDPOINT_STYLE_LIST = [
60
+ export const REAR_ENDPOINT_STYLE_LIST = [
41
61
  {
42
62
  value: PointStyle.Diamond,
43
63
  icon: EndPointDiamondIcon(),
44
64
  },
65
+ {
66
+ value: PointStyle.DiamondHollow,
67
+ icon: EndPointDiamondHollowIcon(),
68
+ },
45
69
  {
46
70
  value: PointStyle.Circle,
47
71
  icon: EndPointCircleIcon(),
@@ -50,6 +74,10 @@ const REAR_ENDPOINT_STYLE_LIST = [
50
74
  value: PointStyle.Triangle,
51
75
  icon: EndPointTriangleIcon(),
52
76
  },
77
+ {
78
+ value: PointStyle.TriangleHollow,
79
+ icon: EndPointTriangleHollowIcon(),
80
+ },
53
81
  {
54
82
  value: PointStyle.Arrow,
55
83
  icon: EndPointArrowIcon(),
@@ -127,6 +155,9 @@ export const connectorToolbarConfig = {
127
155
  }
128
156
  updateModelsWith(ctx, models, 'strokeStyle', value);
129
157
  };
158
+ // A link belongs to what it links: the carousel opens on the framework
159
+ // of its endpoints, else of the board it crosses (`docs/adr/0027`).
160
+ const carousel = frameworkPaletteGroups(ctx.std, models, DefaultTheme.Palettes);
130
161
  return html `
131
162
  <edgeless-color-picker-button
132
163
  class="stroke-color"
@@ -137,6 +168,8 @@ export const connectorToolbarConfig = {
137
168
  .hollowCircle=${true}
138
169
  .originalColor=${firstModel.stroke}
139
170
  .enableCustomColor=${enableCustomColor}
171
+ .paletteGroups=${carousel.groups}
172
+ .activeGroupKey=${carousel.activeKey}
140
173
  .std=${ctx.std}
141
174
  >
142
175
  <edgeless-line-styles-panel
@@ -171,10 +204,16 @@ export const connectorToolbarConfig = {
171
204
  updateModelsWith(ctx, models, field, value);
172
205
  };
173
206
  return renderMenu({
174
- label: translateKey(ctx.std, ...CONNECTOR_LABEL_STYLE),
207
+ // `label` stays the ENGLISH literal and `labelWording` carries the
208
+ // key: `renderMenu` resolves it, and the menu shell's accessible
209
+ // name no longer has to be sewn onto a translated word (#390).
210
+ label: CONNECTOR_LABEL_STYLE[1],
211
+ labelWording: CONNECTOR_LABEL_STYLE,
212
+ menuAriaWording: MENU_ARIA_STYLE,
175
213
  items: LINE_STYLE_LIST,
176
214
  currentValue: rough,
177
215
  onPick,
216
+ std: ctx.std,
178
217
  });
179
218
  },
180
219
  },
@@ -193,10 +232,13 @@ export const connectorToolbarConfig = {
193
232
  updateModelsWith(ctx, models, field, value);
194
233
  };
195
234
  return renderMenu({
196
- label: translateKey(ctx.std, ...CONNECTOR_LABEL_START_POINT_STYLE),
235
+ label: CONNECTOR_LABEL_START_POINT_STYLE[1],
236
+ labelWording: CONNECTOR_LABEL_START_POINT_STYLE,
237
+ menuAriaWording: CONNECTOR_START_POINT_STYLE_MENU_ARIA,
197
238
  items: FRONT_ENDPOINT_STYLE_LIST,
198
239
  currentValue: pointStyle,
199
240
  onPick,
241
+ std: ctx.std,
200
242
  });
201
243
  },
202
244
  },
@@ -260,10 +302,13 @@ export const connectorToolbarConfig = {
260
302
  updateModelsWith(ctx, models, field, value);
261
303
  };
262
304
  return renderMenu({
263
- label: translateKey(ctx.std, ...CONNECTOR_LABEL_END_POINT_STYLE),
305
+ label: CONNECTOR_LABEL_END_POINT_STYLE[1],
306
+ labelWording: CONNECTOR_LABEL_END_POINT_STYLE,
307
+ menuAriaWording: CONNECTOR_END_POINT_STYLE_MENU_ARIA,
264
308
  items: REAR_ENDPOINT_STYLE_LIST,
265
309
  currentValue: pointStyle,
266
310
  onPick,
311
+ std: ctx.std,
267
312
  });
268
313
  },
269
314
  },
@@ -328,11 +373,15 @@ export const connectorToolbarConfig = {
328
373
  key: translateKey(ctx.std, ...CONNECTOR_MODE_WORDING[item.value]),
329
374
  }));
330
375
  return renderMenu({
331
- label: translateKey(ctx.std, ...CONNECTOR_LABEL_SHAPE),
332
- tooltip: translateKey(ctx.std, ...CONNECTOR_TOOLTIP_CONNECTOR_SHAPE),
376
+ label: CONNECTOR_LABEL_SHAPE[1],
377
+ labelWording: CONNECTOR_LABEL_SHAPE,
378
+ menuAriaWording: CONNECTOR_SHAPE_MENU_ARIA,
379
+ tooltip: CONNECTOR_TOOLTIP_CONNECTOR_SHAPE[1],
380
+ tooltipWording: CONNECTOR_TOOLTIP_CONNECTOR_SHAPE,
333
381
  items,
334
382
  currentValue: mode,
335
383
  onPick,
384
+ std: ctx.std,
336
385
  });
337
386
  },
338
387
  },
@@ -360,6 +409,41 @@ export const connectorToolbarConfig = {
360
409
  mountConnectorLabelEditor(model, rootBlock);
361
410
  },
362
411
  },
412
+ /**
413
+ * The two END labels (`docs/adr/0018` phase 2).
414
+ *
415
+ * After the caption and its style controls, because that is the order the
416
+ * notation itself has: an association is named in the middle and adorned at
417
+ * its ends. Each entry appears only while its own end is bare — an end
418
+ * label that exists is edited by double-clicking it, exactly as the caption
419
+ * is, and `g.text` has always hidden itself on the same rule.
420
+ *
421
+ * Wordings, not literals: the row is a host's UI, and a hard-coded "Source
422
+ * label" is the one word a translated editor cannot translate (#183).
423
+ */
424
+ ...['source', 'target'].map(end => ({
425
+ id: end === 'source' ? 'h.source-label' : 'h.target-label',
426
+ tooltipWording: end === 'source' ? CONNECTOR_SOURCE_LABEL : CONNECTOR_TARGET_LABEL,
427
+ labelWording: end === 'source' ? CONNECTOR_SOURCE_LABEL : CONNECTOR_TARGET_LABEL,
428
+ icon: AddTextIcon(),
429
+ when(ctx) {
430
+ const models = ctx.getSurfaceModelsByType(ConnectorElementModel);
431
+ if (models.length !== 1)
432
+ return false;
433
+ return end === 'source'
434
+ ? !models[0].sourceLabel
435
+ : !models[0].targetLabel;
436
+ },
437
+ run(ctx) {
438
+ const model = ctx.getCurrentModelByType(ConnectorElementModel);
439
+ if (!model)
440
+ return;
441
+ const rootBlock = getRootBlock(ctx);
442
+ if (!rootBlock)
443
+ return;
444
+ mountConnectorLabelEditor(model, rootBlock, undefined, { which: end });
445
+ },
446
+ })),
363
447
  // id: `g.text`
364
448
  ...createTextActions(ConnectorElementModel, 'connector', (ctx, model, props) => {
365
449
  if (!isConnectorWithLabel(model))
@@ -0,0 +1,8 @@
1
+ /** Front (start) hollow diamond — the head sits at the left end of the stub. */
2
+ export declare const StartPointDiamondHollowIcon: () => import("lit-html").TemplateResult<1>;
3
+ /** Rear (end) hollow diamond — the head sits at the right end of the stub. */
4
+ export declare const EndPointDiamondHollowIcon: () => import("lit-html").TemplateResult<1>;
5
+ /** Front (start) hollow closed triangle. */
6
+ export declare const StartPointTriangleHollowIcon: () => import("lit-html").TemplateResult<1>;
7
+ /** Rear (end) hollow closed triangle. */
8
+ export declare const EndPointTriangleHollowIcon: () => import("lit-html").TemplateResult<1>;
@@ -0,0 +1,118 @@
1
+ import { html } from 'lit';
2
+ /**
3
+ * The four toolbar icons for the hollow UML endpoint heads.
4
+ *
5
+ * Hand-authored because `@blocksuite/icons` has no hollow variant of its
6
+ * `StartPoint*` / `EndPoint*` set. They mirror that set deliberately: the same
7
+ * `0 0 24 24` viewBox and the same `1em` box, so a hollow entry lines up
8
+ * pixel-for-pixel with the filled neighbour it sits next to in the endpoint
9
+ * menus. The difference is only the paint — the shipped icons merge stub and
10
+ * head into one `fill='currentColor'` path, these draw the stub as a stroked
11
+ * line and leave the head `fill="none"` so the reader sees the hollow head the
12
+ * canvas will actually draw.
13
+ *
14
+ * Each is a function returning a `TemplateResult`, matching how the
15
+ * `@blocksuite/icons` lit icons are called at the use site
16
+ * (`StartPointDiamondIcon()`).
17
+ */
18
+ const ICON_STYLE = 'user-select:none;flex-shrink:0;';
19
+ /** Front (start) hollow diamond — the head sits at the left end of the stub. */
20
+ export const StartPointDiamondHollowIcon = () => html `
21
+ <svg
22
+ xmlns="http://www.w3.org/2000/svg"
23
+ viewBox="0 0 24 24"
24
+ width="1em"
25
+ height="1em"
26
+ fill="none"
27
+ style=${ICON_STYLE}
28
+ >
29
+ <path
30
+ d="M21 12H11"
31
+ stroke="currentColor"
32
+ stroke-width="1.5"
33
+ stroke-linecap="round"
34
+ />
35
+ <path
36
+ d="M11 12L7 8L3 12L7 16Z"
37
+ fill="none"
38
+ stroke="currentColor"
39
+ stroke-width="1.5"
40
+ stroke-linejoin="round"
41
+ />
42
+ </svg>
43
+ `;
44
+ /** Rear (end) hollow diamond — the head sits at the right end of the stub. */
45
+ export const EndPointDiamondHollowIcon = () => html `
46
+ <svg
47
+ xmlns="http://www.w3.org/2000/svg"
48
+ viewBox="0 0 24 24"
49
+ width="1em"
50
+ height="1em"
51
+ fill="none"
52
+ style=${ICON_STYLE}
53
+ >
54
+ <path
55
+ d="M3 12H13"
56
+ stroke="currentColor"
57
+ stroke-width="1.5"
58
+ stroke-linecap="round"
59
+ />
60
+ <path
61
+ d="M13 12L17 8L21 12L17 16Z"
62
+ fill="none"
63
+ stroke="currentColor"
64
+ stroke-width="1.5"
65
+ stroke-linejoin="round"
66
+ />
67
+ </svg>
68
+ `;
69
+ /** Front (start) hollow closed triangle. */
70
+ export const StartPointTriangleHollowIcon = () => html `
71
+ <svg
72
+ xmlns="http://www.w3.org/2000/svg"
73
+ viewBox="0 0 24 24"
74
+ width="1em"
75
+ height="1em"
76
+ fill="none"
77
+ style=${ICON_STYLE}
78
+ >
79
+ <path
80
+ d="M21 12H10.5"
81
+ stroke="currentColor"
82
+ stroke-width="1.5"
83
+ stroke-linecap="round"
84
+ />
85
+ <path
86
+ d="M10.5 7.5L3 12L10.5 16.5Z"
87
+ fill="none"
88
+ stroke="currentColor"
89
+ stroke-width="1.5"
90
+ stroke-linejoin="round"
91
+ />
92
+ </svg>
93
+ `;
94
+ /** Rear (end) hollow closed triangle. */
95
+ export const EndPointTriangleHollowIcon = () => html `
96
+ <svg
97
+ xmlns="http://www.w3.org/2000/svg"
98
+ viewBox="0 0 24 24"
99
+ width="1em"
100
+ height="1em"
101
+ fill="none"
102
+ style=${ICON_STYLE}
103
+ >
104
+ <path
105
+ d="M3 12H13.5"
106
+ stroke="currentColor"
107
+ stroke-width="1.5"
108
+ stroke-linecap="round"
109
+ />
110
+ <path
111
+ d="M13.5 7.5L21 12L13.5 16.5Z"
112
+ fill="none"
113
+ stroke="currentColor"
114
+ stroke-width="1.5"
115
+ stroke-linejoin="round"
116
+ />
117
+ </svg>
118
+ `;
@@ -20,9 +20,12 @@ export declare const CONNECTOR_LABEL_CONNECTOR: ChromeWording;
20
20
  export declare const CONNECTOR_LABEL_STROKE_STYLE: ChromeWording;
21
21
  export declare const CONNECTOR_LABEL_STYLE: ChromeWording;
22
22
  export declare const CONNECTOR_LABEL_START_POINT_STYLE: ChromeWording;
23
+ export declare const CONNECTOR_START_POINT_STYLE_MENU_ARIA: ChromeWording;
23
24
  export declare const CONNECTOR_TOOLTIP_FLIP_DIRECTION: ChromeWording;
24
25
  export declare const CONNECTOR_LABEL_END_POINT_STYLE: ChromeWording;
26
+ export declare const CONNECTOR_END_POINT_STYLE_MENU_ARIA: ChromeWording;
25
27
  export declare const CONNECTOR_LABEL_SHAPE: ChromeWording;
28
+ export declare const CONNECTOR_SHAPE_MENU_ARIA: ChromeWording;
26
29
  export declare const CONNECTOR_TOOLTIP_CONNECTOR_SHAPE: ChromeWording;
27
30
  /**
28
31
  * "Add text" — the contextual-toolbar action AND the label editor's own
@@ -44,6 +44,18 @@ export const CONNECTOR_LABEL_START_POINT_STYLE = [
44
44
  'com.labre.connector.toolbar.start-point-style',
45
45
  'Start point style',
46
46
  ];
47
+ /* ── The menu shells' accessible names (#390) ─────────────────────────────
48
+ *
49
+ * Each `aria-label` is its own wording rather than `` `${label}-menu` ``: the
50
+ * four labels above go through the seam, so the composition read "style de
51
+ * point de départ-menu" on a French host. Fallbacks are the exact identifiers
52
+ * the composition produced in English. The plain "Style" menu reuses the
53
+ * shared `MENU_ARIA_STYLE` — three toolbars draw that same menu.
54
+ */
55
+ export const CONNECTOR_START_POINT_STYLE_MENU_ARIA = [
56
+ 'com.labre.connector.toolbar.start-point-style-menu',
57
+ 'start point style-menu',
58
+ ];
47
59
  export const CONNECTOR_TOOLTIP_FLIP_DIRECTION = [
48
60
  'com.labre.connector.toolbar.flip-direction',
49
61
  'Flip direction',
@@ -52,10 +64,18 @@ export const CONNECTOR_LABEL_END_POINT_STYLE = [
52
64
  'com.labre.connector.toolbar.end-point-style',
53
65
  'End point style',
54
66
  ];
67
+ export const CONNECTOR_END_POINT_STYLE_MENU_ARIA = [
68
+ 'com.labre.connector.toolbar.end-point-style-menu',
69
+ 'end point style-menu',
70
+ ];
55
71
  export const CONNECTOR_LABEL_SHAPE = [
56
72
  'com.labre.connector.toolbar.shape',
57
73
  'Shape',
58
74
  ];
75
+ export const CONNECTOR_SHAPE_MENU_ARIA = [
76
+ 'com.labre.connector.toolbar.shape-menu',
77
+ 'shape-menu',
78
+ ];
59
79
  export const CONNECTOR_TOOLTIP_CONNECTOR_SHAPE = [
60
80
  'com.labre.connector.toolbar.connector-shape',
61
81
  'Connector shape',
@@ -72,8 +92,11 @@ export const CONNECTOR_WORDINGS = [
72
92
  CONNECTOR_LABEL_CONNECTOR,
73
93
  CONNECTOR_LABEL_STROKE_STYLE,
74
94
  CONNECTOR_LABEL_START_POINT_STYLE,
95
+ CONNECTOR_START_POINT_STYLE_MENU_ARIA,
75
96
  CONNECTOR_TOOLTIP_FLIP_DIRECTION,
76
97
  CONNECTOR_LABEL_END_POINT_STYLE,
98
+ CONNECTOR_END_POINT_STYLE_MENU_ARIA,
77
99
  CONNECTOR_LABEL_SHAPE,
100
+ CONNECTOR_SHAPE_MENU_ARIA,
78
101
  CONNECTOR_TOOLTIP_CONNECTOR_SHAPE,
79
102
  ];
@@ -1,5 +1,41 @@
1
- import { type ConnectorElementModel } from '../../affine-model/index.js';
1
+ import { CONNECTOR_END_LABEL_GRAB, type ConnectorElementModel } from '../../affine-model/index.js';
2
+ import { type IVec, type XYWH } from '../../global/gfx/index.js';
2
3
  import { type DragEndContext, type DragMoveContext, type DragStartContext, GfxElementModelView } from '../../std/gfx/index.js';
4
+ import { type ConnectorLabelWhich } from '../text/edgeless-connector-label-editor.js';
5
+ /**
6
+ * How close to an endpoint a double-click has to land to mean "the label of
7
+ * THAT end" (`docs/adr/0018` phase 2).
8
+ *
9
+ * Re-exported rather than declared: the number is the model's now, because the
10
+ * connector's own HIT TEST has to claim the same discs — a gesture the
11
+ * dispatcher never delivers is a gesture no picker gets to interpret
12
+ * (`connectorEndNear`, and the PO's recette of 14/09/2026). Kept exported here
13
+ * because this is where every caller has always reached for it.
14
+ */
15
+ export { CONNECTOR_END_LABEL_GRAB };
16
+ /** What {@link pickConnectorLabelWhich} needs, and nothing more. */
17
+ export type ConnectorLabelHitTarget = {
18
+ absolutePath: readonly IVec[];
19
+ sourceLabelXYWH?: XYWH;
20
+ targetLabelXYWH?: XYWH;
21
+ };
22
+ /**
23
+ * Which of a connector's three labels a point is asking for.
24
+ *
25
+ * The order is what makes the gesture predictable:
26
+ *
27
+ * 1. an END LABEL BOX under the pointer — an existing label is edited where it
28
+ * is drawn, never re-created somewhere else;
29
+ * 2. otherwise, within {@link CONNECTOR_END_LABEL_GRAB} of an ENDPOINT — the
30
+ * nearer end, which is where a label the connector does not have yet gets
31
+ * created;
32
+ * 3. otherwise the CENTRE, which is what a double-click on a connector has
33
+ * always meant and stays the answer everywhere else on the line.
34
+ *
35
+ * Pure, and exported, because the ordering is the whole behaviour and a spec
36
+ * that had to drive a real pointer to check it would test the dispatcher.
37
+ */
38
+ export declare function pickConnectorLabelWhich(connector: ConnectorLabelHitTarget, point: IVec, grab?: number): ConnectorLabelWhich;
3
39
  export declare class ConnectorElementView extends GfxElementModelView<ConnectorElementModel> {
4
40
  static type: string;
5
41
  onDragStart: (context: DragStartContext) => void;
@@ -1,7 +1,55 @@
1
- import { LocalShapeElementModel, } from '../../affine-model/index.js';
2
- import { Bound, serializeXYWH, Vec } from '../../global/gfx/index.js';
1
+ import { CONNECTOR_END_LABEL_GRAB, LocalShapeElementModel, } from '../../affine-model/index.js';
2
+ import { Bound, serializeXYWH, Vec, } from '../../global/gfx/index.js';
3
3
  import { generateKeyBetween, GfxElementModelView, GfxViewInteractionExtension, } from '../../std/gfx/index.js';
4
- import { mountConnectorLabelEditor } from '../text/edgeless-connector-label-editor.js';
4
+ import { mountConnectorLabelEditor, } from '../text/edgeless-connector-label-editor.js';
5
+ /**
6
+ * How close to an endpoint a double-click has to land to mean "the label of
7
+ * THAT end" (`docs/adr/0018` phase 2).
8
+ *
9
+ * Re-exported rather than declared: the number is the model's now, because the
10
+ * connector's own HIT TEST has to claim the same discs — a gesture the
11
+ * dispatcher never delivers is a gesture no picker gets to interpret
12
+ * (`connectorEndNear`, and the PO's recette of 14/09/2026). Kept exported here
13
+ * because this is where every caller has always reached for it.
14
+ */
15
+ export { CONNECTOR_END_LABEL_GRAB };
16
+ /**
17
+ * Which of a connector's three labels a point is asking for.
18
+ *
19
+ * The order is what makes the gesture predictable:
20
+ *
21
+ * 1. an END LABEL BOX under the pointer — an existing label is edited where it
22
+ * is drawn, never re-created somewhere else;
23
+ * 2. otherwise, within {@link CONNECTOR_END_LABEL_GRAB} of an ENDPOINT — the
24
+ * nearer end, which is where a label the connector does not have yet gets
25
+ * created;
26
+ * 3. otherwise the CENTRE, which is what a double-click on a connector has
27
+ * always meant and stays the answer everywhere else on the line.
28
+ *
29
+ * Pure, and exported, because the ordering is the whole behaviour and a spec
30
+ * that had to drive a real pointer to check it would test the dispatcher.
31
+ */
32
+ export function pickConnectorLabelWhich(connector, point, grab = CONNECTOR_END_LABEL_GRAB) {
33
+ const boxes = [
34
+ ['source', connector.sourceLabelXYWH],
35
+ ['target', connector.targetLabelXYWH],
36
+ ];
37
+ for (const [end, box] of boxes) {
38
+ if (box && Bound.fromXYWH(box).isPointInBound(point))
39
+ return end;
40
+ }
41
+ const path = connector.absolutePath;
42
+ if (path.length) {
43
+ const first = path[0];
44
+ const last = path[path.length - 1];
45
+ const toSource = Vec.dist(point, [first[0], first[1]]);
46
+ const toTarget = Vec.dist(point, [last[0], last[1]]);
47
+ if (Math.min(toSource, toTarget) <= grab) {
48
+ return toSource <= toTarget ? 'source' : 'target';
49
+ }
50
+ }
51
+ return 'center';
52
+ }
5
53
  export class ConnectorElementView extends GfxElementModelView {
6
54
  constructor() {
7
55
  super(...arguments);
@@ -21,6 +69,30 @@ export class ConnectorElementView extends GfxElementModelView {
21
69
  static { this.type = 'connector'; }
22
70
  onCreated() {
23
71
  super.onCreated();
72
+ // What the GRID must offer before any hit test is asked. The grid indexes a
73
+ // connector by its `responseBound` — the box of its PATH — and the end-label
74
+ // grab discs stick out of it by up to `CONNECTOR_END_LABEL_GRAB`, so without
75
+ // this nothing is ever a candidate out there and
76
+ // `ConnectorElementModel.endGrabIncludesPoint` never gets asked. It widens
77
+ // the CANDIDATE set only: what is picked, hovered and selected is still
78
+ // decided by the model's own `includesPoint`.
79
+ //
80
+ // Set from the view rather than defaulted on the model because it is a
81
+ // LOCAL fact about this peer's pointer, which is exactly what
82
+ // `responseExtension` is for — nothing about it is written to the document.
83
+ //
84
+ // NOT gated on the model's `role`, although `endGrabIncludesPoint` is
85
+ // (a generalist connector keeps its hairline). Two reasons, and both are
86
+ // about `onCreated` running exactly once: a connector acquires its role
87
+ // AFTER creation often enough — an import writes the element then types it,
88
+ // a morph retypes it, a paste re-creates it — and a halo decided at that one
89
+ // moment would be missing for every one of those. And it costs nothing to
90
+ // keep: the extension widens the CANDIDATE set only, and the authority on
91
+ // what a point actually hits is the model, which now declines.
92
+ this.model.responseExtension = [
93
+ CONNECTOR_END_LABEL_GRAB,
94
+ CONNECTOR_END_LABEL_GRAB,
95
+ ];
24
96
  this._initLabelMoving();
25
97
  }
26
98
  _initLabelMoving() {
@@ -28,12 +100,14 @@ export class ConnectorElementView extends GfxElementModelView {
28
100
  if (this.model.isLocked()) {
29
101
  return;
30
102
  }
31
- const enterLabelEditor = (evt) => {
103
+ const enterLabelEditor = (evt, which = 'center') => {
32
104
  const edgeless = this.std.view.getBlock(this.std.store.root.id);
33
105
  if (edgeless && !this.model.isLocked()) {
34
- mountConnectorLabelEditor(this.model, edgeless, this.gfx.viewport.toModelCoord(evt.x, evt.y));
106
+ mountConnectorLabelEditor(this.model, edgeless, this.gfx.viewport.toModelCoord(evt.x, evt.y), { which });
35
107
  }
36
108
  };
109
+ /** Which label the pointer is asking for, in model coordinates. */
110
+ const labelEndAt = (evt) => pickConnectorLabelWhich(this.model, this.gfx.viewport.toModelCoord(evt.x, evt.y));
37
111
  const getCurrentPosition = (evt) => {
38
112
  const [x, y] = this.gfx.viewport.toModelCoord(evt.x, evt.y);
39
113
  return {
@@ -64,7 +138,10 @@ export class ConnectorElementView extends GfxElementModelView {
64
138
  clientY: 0,
65
139
  };
66
140
  view.on('dblclick', evt => {
67
- enterLabelEditor(evt);
141
+ // This view IS the centre label's box, so the answer is not up for
142
+ // discussion — a short connector whose caption sits within grabbing
143
+ // distance of an arrowhead still edits its caption when you click it.
144
+ enterLabelEditor(evt, 'center');
68
145
  });
69
146
  view.on('dragstart', evt => {
70
147
  startPoint = getCurrentPosition(evt);
@@ -130,9 +207,21 @@ export class ConnectorElementView extends GfxElementModelView {
130
207
  }));
131
208
  updateLabelElement();
132
209
  this.on('dblclick', evt => {
133
- if (!curLabelElement) {
134
- enterLabelEditor(evt);
210
+ // The centre label, when it exists, is a local element with its own view
211
+ // and its own `dblclick` above: anything that lands inside its box is
212
+ // already spoken for, and answering here too would mount two editors.
213
+ if (curLabelElement &&
214
+ Bound.deserialize(curLabelElement.xywh).isPointInBound(this.gfx.viewport.toModelCoord(evt.x, evt.y))) {
215
+ return;
135
216
  }
217
+ const which = labelEndAt(evt);
218
+ // Outside that box, `center` means what it meant before this tranche:
219
+ // open the caption editor when there is no caption yet, and otherwise do
220
+ // nothing (the caption is edited by clicking the caption). The two ends
221
+ // are new, and they answer whether the connector has a caption or not.
222
+ if (which === 'center' && curLabelElement)
223
+ return;
224
+ enterLabelEditor(evt, which);
136
225
  });
137
226
  }
138
227
  }
@@ -77,7 +77,7 @@ export const createGroupCommand = (ctx, next) => {
77
77
  return pre;
78
78
  }, {}),
79
79
  // Translated HERE and once: the title is document content the moment it
80
- // lands (ADR 0016), so the host's catalogue is asked at placement and
80
+ // lands (ADR 0023), so the host's catalogue is asked at placement and
81
81
  // never again — a renamed group keeps its name.
82
82
  title: translateKey(std, ...GROUP_SEED_NAME, { n: groups.length + 1 }),
83
83
  });
@@ -1,6 +1,5 @@
1
1
  import { StoreExtensionProvider, } from '../affine-ext-loader/index.js';
2
2
  import { groupToMarkdownAdapterMatcher, groupToPlainTextAdapterMatcher, } from './adapter/index.js';
3
- import { groupRelationWatcherExtension } from './group-watcher.js';
4
3
  export class GroupStoreExtension extends StoreExtensionProvider {
5
4
  constructor() {
6
5
  super(...arguments);
@@ -10,6 +9,5 @@ export class GroupStoreExtension extends StoreExtensionProvider {
10
9
  super.setup(context);
11
10
  context.register(groupToPlainTextAdapterMatcher);
12
11
  context.register(groupToMarkdownAdapterMatcher);
13
- context.register(groupRelationWatcherExtension);
14
12
  }
15
13
  }
@@ -1,16 +1,15 @@
1
- import { type ChromeWording } from '../affine-shared/services/index.js';
1
+ import { type ChromeWording, GROUP_SEED_NAME } from '../affine-shared/services/index.js';
2
2
  /**
3
- * The group's own seed: the default title a newly created group is stamped
4
- * with (`Group 2`), written into the document at creation
5
- * (`createGroupCommand`). Resolved at PLACEMENT and never again — a group
6
- * renamed by its author keeps its name, and a group created before this key
7
- * existed keeps the plain text it was given.
3
+ * The group's own seed — the default title a newly created group is stamped
4
+ * with (`Group 2`), written into the document by `createGroupCommand`.
8
5
  *
9
- * `{{n}}` is the group's 1-based ordinal among the groups already on the doc;
10
- * see the translation-service README on why a count carries a param rather
11
- * than its own key.
6
+ * It now LIVES in `@labre/affine-shared`, because the surface block's legend
7
+ * groups the box it draws and cannot import this package (`gfx-group` depends
8
+ * on the surface block, not the other way round). Re-exported here unchanged,
9
+ * and still listed by {@link GROUP_WORDINGS} below, so the key manifest sees
10
+ * exactly the one `seed` entry it always has.
12
11
  */
13
- export declare const GROUP_SEED_NAME: ChromeWording;
12
+ export { GROUP_SEED_NAME };
14
13
  /**
15
14
  * This package's contribution to the translation-key manifest — a single seed,
16
15
  * listed in `PACKAGE_SEED_WORDINGS` under source `seed`
@@ -1,19 +1,15 @@
1
- import { TOOLBAR_INSERT_INTO_PAGE, TOOLBAR_RENAME, TOOLBAR_UNGROUP, } from '../affine-shared/services/index.js';
1
+ import { GROUP_SEED_NAME, TOOLBAR_INSERT_INTO_PAGE, TOOLBAR_RENAME, TOOLBAR_UNGROUP, } from '../affine-shared/services/index.js';
2
2
  /**
3
- * The group's own seed: the default title a newly created group is stamped
4
- * with (`Group 2`), written into the document at creation
5
- * (`createGroupCommand`). Resolved at PLACEMENT and never again — a group
6
- * renamed by its author keeps its name, and a group created before this key
7
- * existed keeps the plain text it was given.
3
+ * The group's own seed — the default title a newly created group is stamped
4
+ * with (`Group 2`), written into the document by `createGroupCommand`.
8
5
  *
9
- * `{{n}}` is the group's 1-based ordinal among the groups already on the doc;
10
- * see the translation-service README on why a count carries a param rather
11
- * than its own key.
6
+ * It now LIVES in `@labre/affine-shared`, because the surface block's legend
7
+ * groups the box it draws and cannot import this package (`gfx-group` depends
8
+ * on the surface block, not the other way round). Re-exported here unchanged,
9
+ * and still listed by {@link GROUP_WORDINGS} below, so the key manifest sees
10
+ * exactly the one `seed` entry it always has.
12
11
  */
13
- export const GROUP_SEED_NAME = [
14
- 'com.labre.group.seed.name',
15
- 'Group {{n}}',
16
- ];
12
+ export { GROUP_SEED_NAME };
17
13
  /**
18
14
  * This package's contribution to the translation-key manifest — a single seed,
19
15
  * listed in `PACKAGE_SEED_WORDINGS` under source `seed`