@formicoidea/labre-core 0.41.0 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) 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-edgeless-text/edgeless-toolbar/config.js +7 -1
  4. package/dist/_pkgs/affine-block-embed/embed-figma-block/embed-figma-block.js +2 -1
  5. package/dist/_pkgs/affine-block-embed/embed-github-block/embed-github-block.js +2 -1
  6. package/dist/_pkgs/affine-block-embed/embed-iframe-block/consts.d.ts +2 -0
  7. package/dist/_pkgs/affine-block-embed/embed-iframe-block/consts.js +5 -0
  8. package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.d.ts +1 -0
  9. package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.js +30 -8
  10. package/dist/_pkgs/affine-block-embed/embed-iframe-block/utils.d.ts +8 -0
  11. package/dist/_pkgs/affine-block-embed/embed-iframe-block/utils.js +19 -0
  12. package/dist/_pkgs/affine-block-embed/embed-loom-block/embed-loom-block.js +2 -1
  13. package/dist/_pkgs/affine-block-embed/embed-youtube-block/embed-youtube-block.js +2 -1
  14. package/dist/_pkgs/affine-block-frame/frame-manager.js +1 -1
  15. package/dist/_pkgs/affine-block-frame/frame-tool.js +1 -1
  16. package/dist/_pkgs/affine-block-frame/frame-toolbar.js +6 -1
  17. package/dist/_pkgs/affine-block-list/list-keymap.js +7 -0
  18. package/dist/_pkgs/affine-block-note/note-keymap.js +7 -1
  19. package/dist/_pkgs/affine-block-paragraph/paragraph-keymap.js +7 -1
  20. package/dist/_pkgs/affine-block-root/commands/pivot-commands.js +1 -8
  21. package/dist/_pkgs/affine-block-root/commands/tag-commands.js +1 -8
  22. package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.d.ts +9 -0
  23. package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.js +51 -0
  24. package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.d.ts +22 -0
  25. package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.js +46 -0
  26. package/dist/_pkgs/affine-block-root/edgeless/utils/pinch-zoom.d.ts +21 -0
  27. package/dist/_pkgs/affine-block-root/edgeless/utils/pinch-zoom.js +24 -0
  28. package/dist/_pkgs/affine-block-root/edgeless/utils/query.js +8 -0
  29. package/dist/_pkgs/affine-block-root/keyboard/keymap.js +1 -16
  30. package/dist/_pkgs/affine-block-surface/element-model/index.d.ts +21 -3
  31. package/dist/_pkgs/affine-block-surface/element-model/index.js +14 -2
  32. package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.d.ts +23 -0
  33. package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.js +89 -0
  34. package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.d.ts +7 -0
  35. package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.js +5 -0
  36. package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.d.ts +41 -0
  37. package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.js +70 -0
  38. package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.d.ts +49 -0
  39. package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.js +257 -0
  40. package/dist/_pkgs/affine-block-surface/extensions/export-svg/tagged-path.d.ts +16 -0
  41. package/dist/_pkgs/affine-block-surface/extensions/export-svg/tagged-path.js +24 -0
  42. package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.d.ts +24 -0
  43. package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.js +66 -0
  44. package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +4 -0
  45. package/dist/_pkgs/affine-block-surface/extensions/index.js +4 -0
  46. package/dist/_pkgs/affine-block-surface/extensions/interchange-import.d.ts +66 -4
  47. package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +241 -11
  48. package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +18 -0
  49. package/dist/_pkgs/affine-block-surface/extensions/legend-toolbar.d.ts +81 -0
  50. package/dist/_pkgs/affine-block-surface/extensions/legend-toolbar.js +81 -0
  51. package/dist/_pkgs/affine-block-surface/extensions/legend.d.ts +136 -0
  52. package/dist/_pkgs/affine-block-surface/extensions/legend.js +439 -0
  53. package/dist/_pkgs/affine-block-surface/extensions/reading-widget.d.ts +17 -3
  54. package/dist/_pkgs/affine-block-surface/extensions/reading-widget.js +35 -13
  55. package/dist/_pkgs/affine-block-surface/extensions/reading.d.ts +61 -1
  56. package/dist/_pkgs/affine-block-surface/extensions/reading.js +85 -39
  57. package/dist/_pkgs/affine-block-surface/extensions/record-action.d.ts +66 -0
  58. package/dist/_pkgs/affine-block-surface/extensions/record-action.js +145 -0
  59. package/dist/_pkgs/affine-block-surface/extensions/validation.d.ts +253 -28
  60. package/dist/_pkgs/affine-block-surface/extensions/validation.js +489 -41
  61. package/dist/_pkgs/affine-block-surface/framework-background/background-view.d.ts +115 -0
  62. package/dist/_pkgs/affine-block-surface/framework-background/background-view.js +185 -0
  63. package/dist/_pkgs/affine-block-surface/framework-background/index.d.ts +1 -0
  64. package/dist/_pkgs/affine-block-surface/framework-background/index.js +1 -0
  65. package/dist/_pkgs/affine-block-surface/framework-background/labels.d.ts +16 -1
  66. package/dist/_pkgs/affine-block-surface/framework-background/labels.js +31 -21
  67. package/dist/_pkgs/affine-block-surface/framework-background/renderer.js +29 -5
  68. package/dist/_pkgs/affine-block-surface/framework-background/stacking.d.ts +6 -4
  69. package/dist/_pkgs/affine-block-surface/framework-background/stacking.js +56 -8
  70. package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.d.ts +12 -0
  71. package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.js +15 -0
  72. package/dist/_pkgs/affine-block-surface/view.js +8 -1
  73. package/dist/_pkgs/affine-block-surface-ref/configs/slash-menu.js +1 -1
  74. package/dist/_pkgs/affine-components/color-picker/button.d.ts +56 -1
  75. package/dist/_pkgs/affine-components/color-picker/button.js +168 -23
  76. package/dist/_pkgs/affine-components/color-picker/framework-palette.d.ts +106 -0
  77. package/dist/_pkgs/affine-components/color-picker/framework-palette.js +177 -0
  78. package/dist/_pkgs/affine-components/color-picker/index.d.ts +2 -0
  79. package/dist/_pkgs/affine-components/color-picker/index.js +2 -0
  80. package/dist/_pkgs/affine-components/color-picker/palette-carousel.d.ts +85 -0
  81. package/dist/_pkgs/affine-components/color-picker/palette-carousel.js +440 -0
  82. package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.d.ts +31 -1
  83. package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.js +189 -63
  84. package/dist/_pkgs/affine-components/resource/resource.js +29 -16
  85. package/dist/_pkgs/affine-components/translations.d.ts +8 -0
  86. package/dist/_pkgs/affine-components/translations.js +17 -0
  87. package/dist/_pkgs/affine-foundation/view.js +2 -1
  88. package/dist/_pkgs/affine-gfx-brush/element-renderer.js +2 -2
  89. package/dist/_pkgs/affine-gfx-brush/toolbar/configs/brush.js +6 -1
  90. package/dist/_pkgs/affine-gfx-brush/toolbar/configs/highlighter.js +6 -1
  91. package/dist/_pkgs/affine-gfx-connector/connector-manager.d.ts +9 -1
  92. package/dist/_pkgs/affine-gfx-connector/connector-manager.js +61 -0
  93. package/dist/_pkgs/affine-gfx-connector/element-renderer/connector-dom/index.d.ts +7 -1
  94. package/dist/_pkgs/affine-gfx-connector/element-renderer/connector-dom/index.js +87 -17
  95. package/dist/_pkgs/affine-gfx-connector/element-renderer/index.js +78 -17
  96. package/dist/_pkgs/affine-gfx-connector/element-renderer/utils.d.ts +24 -2
  97. package/dist/_pkgs/affine-gfx-connector/element-renderer/utils.js +31 -8
  98. package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.d.ts +124 -3
  99. package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.js +216 -54
  100. package/dist/_pkgs/affine-gfx-connector/text/text.d.ts +13 -4
  101. package/dist/_pkgs/affine-gfx-connector/text/text.js +13 -44
  102. package/dist/_pkgs/affine-gfx-connector/toolbar/config.d.ts +56 -0
  103. package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +72 -4
  104. package/dist/_pkgs/affine-gfx-connector/toolbar/hollow-endpoint-icons.d.ts +8 -0
  105. package/dist/_pkgs/affine-gfx-connector/toolbar/hollow-endpoint-icons.js +118 -0
  106. package/dist/_pkgs/affine-gfx-connector/view/view.d.ts +37 -1
  107. package/dist/_pkgs/affine-gfx-connector/view/view.js +97 -8
  108. package/dist/_pkgs/affine-gfx-group/command/group-api.js +1 -1
  109. package/dist/_pkgs/affine-gfx-group/store.js +0 -2
  110. package/dist/_pkgs/affine-gfx-group/translations.d.ts +9 -10
  111. package/dist/_pkgs/affine-gfx-group/translations.js +9 -13
  112. package/dist/_pkgs/affine-gfx-mindmap/templates/index.js +1 -1
  113. package/dist/_pkgs/affine-gfx-mindmap/toolbar/basket-elements.js +1 -1
  114. package/dist/_pkgs/affine-gfx-mindmap/toolbar/utils/import-mindmap.js +2 -2
  115. package/dist/_pkgs/affine-gfx-mindmap/translations.d.ts +1 -1
  116. package/dist/_pkgs/affine-gfx-mindmap/translations.js +1 -1
  117. package/dist/_pkgs/affine-gfx-shape/element-renderer/highlighter.js +2 -2
  118. package/dist/_pkgs/affine-gfx-shape/overlay/polygon-drawing-overlay.d.ts +6 -0
  119. package/dist/_pkgs/affine-gfx-shape/overlay/polygon-drawing-overlay.js +30 -1
  120. package/dist/_pkgs/affine-gfx-shape/polygon-tool.d.ts +20 -1
  121. package/dist/_pkgs/affine-gfx-shape/polygon-tool.js +9 -1
  122. package/dist/_pkgs/affine-gfx-shape/toolbar/config.js +6 -1
  123. package/dist/_pkgs/affine-gfx-shape/toolbar/palette-color-action.js +11 -1
  124. package/dist/_pkgs/affine-gfx-template/builtin/other.js +1 -1
  125. package/dist/_pkgs/affine-gfx-template/snapshot-from-action.js +32 -119
  126. package/dist/_pkgs/affine-gfx-template/toolbar/template-type.d.ts +1 -1
  127. package/dist/_pkgs/affine-gfx-text/dblclick-add-edgeless-text.d.ts +13 -1
  128. package/dist/_pkgs/affine-gfx-text/dblclick-add-edgeless-text.js +19 -4
  129. package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.d.ts +41 -0
  130. package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.js +57 -2
  131. package/dist/_pkgs/affine-gfx-text/toolbar/actions.d.ts +8 -1
  132. package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +12 -2
  133. package/dist/_pkgs/affine-gfx-text/translations.d.ts +1 -0
  134. package/dist/_pkgs/affine-gfx-text/translations.js +2 -1
  135. package/dist/_pkgs/affine-inline-preset/markdown.js +5 -1
  136. package/dist/_pkgs/affine-model/consts/connector.d.ts +28 -2
  137. package/dist/_pkgs/affine-model/consts/connector.js +26 -0
  138. package/dist/_pkgs/affine-model/elements/bpmn/pool.js +1 -1
  139. package/dist/_pkgs/affine-model/elements/brush/brush.js +1 -1
  140. package/dist/_pkgs/affine-model/elements/c4/board.js +1 -1
  141. package/dist/_pkgs/affine-model/elements/c4/boundary.js +1 -1
  142. package/dist/_pkgs/affine-model/elements/connector/connector.d.ts +135 -0
  143. package/dist/_pkgs/affine-model/elements/connector/connector.js +246 -5
  144. package/dist/_pkgs/affine-model/elements/connector/end-label.d.ts +83 -0
  145. package/dist/_pkgs/affine-model/elements/connector/end-label.js +119 -0
  146. package/dist/_pkgs/affine-model/elements/connector/index.d.ts +1 -0
  147. package/dist/_pkgs/affine-model/elements/connector/index.js +1 -0
  148. package/dist/_pkgs/affine-model/elements/context-map/context-map.js +1 -1
  149. package/dist/_pkgs/affine-model/elements/core-domain/core-domain.d.ts +28 -0
  150. package/dist/_pkgs/affine-model/elements/core-domain/core-domain.js +129 -2
  151. package/dist/_pkgs/affine-model/elements/cynefin/cynefin.d.ts +8 -0
  152. package/dist/_pkgs/affine-model/elements/cynefin/cynefin.js +45 -2
  153. package/dist/_pkgs/affine-model/elements/edgy/board.js +1 -1
  154. package/dist/_pkgs/affine-model/elements/edgy/facets.js +1 -1
  155. package/dist/_pkgs/affine-model/elements/estuarine/estuarine.d.ts +6 -0
  156. package/dist/_pkgs/affine-model/elements/estuarine/estuarine.js +36 -2
  157. package/dist/_pkgs/affine-model/elements/event-storming/event-storming.d.ts +18 -7
  158. package/dist/_pkgs/affine-model/elements/event-storming/event-storming.js +23 -8
  159. package/dist/_pkgs/affine-model/elements/framework-background/background.d.ts +16 -0
  160. package/dist/_pkgs/affine-model/elements/framework-background/background.js +18 -0
  161. package/dist/_pkgs/affine-model/elements/highlighter/highlighter.js +1 -1
  162. package/dist/_pkgs/affine-model/elements/index.d.ts +8 -0
  163. package/dist/_pkgs/affine-model/elements/index.js +1 -0
  164. package/dist/_pkgs/affine-model/elements/shape/shape.js +1 -1
  165. package/dist/_pkgs/affine-model/elements/text/text.js +1 -1
  166. package/dist/_pkgs/affine-model/elements/uml/band.d.ts +39 -0
  167. package/dist/_pkgs/affine-model/elements/uml/band.js +31 -0
  168. package/dist/_pkgs/affine-model/elements/uml/diagram.d.ts +158 -0
  169. package/dist/_pkgs/affine-model/elements/uml/diagram.js +229 -0
  170. package/dist/_pkgs/affine-model/elements/uml/fragment.d.ts +161 -0
  171. package/dist/_pkgs/affine-model/elements/uml/fragment.js +205 -0
  172. package/dist/_pkgs/affine-model/elements/uml/index.d.ts +8 -0
  173. package/dist/_pkgs/affine-model/elements/uml/index.js +8 -0
  174. package/dist/_pkgs/affine-model/elements/uml/lifeline.d.ts +77 -0
  175. package/dist/_pkgs/affine-model/elements/uml/lifeline.js +89 -0
  176. package/dist/_pkgs/affine-model/elements/uml/node.d.ts +142 -0
  177. package/dist/_pkgs/affine-model/elements/uml/node.js +190 -0
  178. package/dist/_pkgs/affine-model/elements/uml/partition.d.ts +106 -0
  179. package/dist/_pkgs/affine-model/elements/uml/partition.js +172 -0
  180. package/dist/_pkgs/affine-model/elements/uml/region.d.ts +75 -0
  181. package/dist/_pkgs/affine-model/elements/uml/region.js +150 -0
  182. package/dist/_pkgs/affine-model/elements/uml/subject.d.ts +37 -0
  183. package/dist/_pkgs/affine-model/elements/uml/subject.js +108 -0
  184. package/dist/_pkgs/affine-model/elements/wardley/wardley.js +1 -1
  185. package/dist/_pkgs/affine-shared/services/embed-iframe/embed-iframe-config.d.ts +1 -0
  186. package/dist/_pkgs/affine-shared/services/font-loader/config.d.ts +7 -0
  187. package/dist/_pkgs/affine-shared/services/font-loader/config.js +43 -0
  188. package/dist/_pkgs/affine-shared/services/pivot-materiality-publisher.js +1 -9
  189. package/dist/_pkgs/affine-shared/services/telemetry-service/document-damage-watcher.d.ts +53 -0
  190. package/dist/_pkgs/affine-shared/services/telemetry-service/document-damage-watcher.js +95 -0
  191. package/dist/_pkgs/affine-shared/services/telemetry-service/index.d.ts +1 -0
  192. package/dist/_pkgs/affine-shared/services/telemetry-service/index.js +1 -0
  193. package/dist/_pkgs/affine-shared/services/telemetry-service/lifecycle.d.ts +26 -1
  194. package/dist/_pkgs/affine-shared/services/telemetry-service/telemetry-service.d.ts +2 -2
  195. package/dist/_pkgs/affine-shared/services/toolbar-service/command-action.d.ts +34 -0
  196. package/dist/_pkgs/affine-shared/services/toolbar-service/command-action.js +63 -0
  197. package/dist/_pkgs/affine-shared/services/toolbar-service/index.d.ts +1 -0
  198. package/dist/_pkgs/affine-shared/services/toolbar-service/index.js +1 -0
  199. package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +77 -7
  200. package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +97 -7
  201. package/dist/_pkgs/affine-shared/styles/index.d.ts +1 -0
  202. package/dist/_pkgs/affine-shared/styles/index.js +1 -0
  203. package/dist/_pkgs/affine-shared/styles/motion.d.ts +14 -0
  204. package/dist/_pkgs/affine-shared/styles/motion.js +38 -0
  205. package/dist/_pkgs/affine-shared/utils/event.d.ts +10 -0
  206. package/dist/_pkgs/affine-shared/utils/event.js +20 -0
  207. package/dist/_pkgs/affine-shared/utils/file/filesys.d.ts +16 -0
  208. package/dist/_pkgs/affine-shared/utils/file/filesys.js +25 -0
  209. package/dist/_pkgs/affine-shared/utils/index.d.ts +1 -0
  210. package/dist/_pkgs/affine-shared/utils/index.js +1 -0
  211. package/dist/_pkgs/affine-shared/utils/link-preview-refresh.d.ts +12 -0
  212. package/dist/_pkgs/affine-shared/utils/link-preview-refresh.js +13 -0
  213. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.d.ts +12 -4
  214. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.js +27 -4
  215. package/dist/_pkgs/affine-widget-edgeless-toolbar/create-popper.js +13 -0
  216. package/dist/_pkgs/affine-widget-edgeless-toolbar/index.d.ts +2 -0
  217. package/dist/_pkgs/affine-widget-edgeless-toolbar/index.js +2 -0
  218. package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.d.ts +80 -0
  219. package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.js +270 -81
  220. package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/senior-menu-selection.d.ts +15 -0
  221. package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/senior-menu-selection.js +15 -0
  222. package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-weight-and-style-panel.js +8 -1
  223. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-ghost-overlay.d.ts +42 -0
  224. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-ghost-overlay.js +100 -0
  225. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-placement-tool.d.ts +100 -0
  226. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-placement-tool.js +274 -0
  227. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/index.d.ts +3 -0
  228. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/index.js +3 -0
  229. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/translate-created.d.ts +25 -0
  230. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/translate-created.js +67 -0
  231. package/dist/_pkgs/affine-widget-edgeless-toolbar/view.js +5 -0
  232. package/dist/_pkgs/global/gfx/xywh.js +7 -0
  233. package/dist/_pkgs/std/extension/command-registry.d.ts +158 -1
  234. package/dist/_pkgs/std/extension/command-registry.js +22 -0
  235. package/dist/_pkgs/std/gfx/index.d.ts +1 -1
  236. package/dist/_pkgs/std/gfx/interactivity/gfx-view-event-handler.d.ts +12 -0
  237. package/dist/_pkgs/std/gfx/interactivity/gfx-view-event-handler.js +20 -1
  238. package/dist/_pkgs/std/gfx/interactivity/manager.d.ts +10 -0
  239. package/dist/_pkgs/std/gfx/interactivity/manager.js +12 -0
  240. package/dist/_pkgs/std/gfx/model/surface/element-model.js +12 -7
  241. package/dist/_pkgs/std/gfx/model/surface/surface-model.d.ts +56 -0
  242. package/dist/_pkgs/std/gfx/model/surface/surface-model.js +84 -3
  243. package/dist/_pkgs/std/gfx/view/view.d.ts +11 -2
  244. package/dist/_pkgs/std/gfx/view/view.js +16 -2
  245. package/dist/commands.d.ts +6 -0
  246. package/dist/commands.js +8 -1
  247. package/dist/frameworks.d.ts +9 -0
  248. package/dist/frameworks.js +19 -0
  249. package/dist/translations.js +16 -0
  250. package/package.json +9 -4
  251. package/dist/_pkgs/affine-gfx-group/group-watcher.d.ts +0 -1
  252. package/dist/_pkgs/affine-gfx-group/group-watcher.js +0 -20
@@ -2,14 +2,40 @@ export declare enum ConnectorEndpoint {
2
2
  Front = "Front",
3
3
  Rear = "Rear"
4
4
  }
5
+ /**
6
+ * The endpoint head painted at each end of a connector.
7
+ *
8
+ * **These string values are PERSISTED.** Every connector stores two of them
9
+ * (`frontEndpointStyle` / `rearEndpointStyle`, see
10
+ * `../elements/connector/connector.ts`), so the enum is **append-only**: a
11
+ * member may be added, never renamed, never removed, and never given a
12
+ * different string value. Renaming one would silently turn every stored
13
+ * connector that carries it into an unknown style.
14
+ *
15
+ * **Adding a member is safe in both directions.** The canvas `renderEndpoint`
16
+ * switch (`@labre/affine-gfx-connector`) and the DOM renderer's
17
+ * `createArrowMarker` both have **no `default` branch** on purpose: a client
18
+ * built before a member was added simply paints no head for it. The connector
19
+ * itself, its geometry, its label and its bindings all still load and still
20
+ * round-trip — degraded, never broken. The reverse is free: an older document
21
+ * only ever carries members that already existed.
22
+ *
23
+ * `TriangleHollow` and `DiamondHollow` are the UML 2.5.1 heads — a hollow
24
+ * closed triangle for generalization and realization, a hollow diamond for
25
+ * shared aggregation. They are the same geometry as `Triangle` / `Diamond`,
26
+ * filled with the notation card fill instead of the stroke colour; see
27
+ * `docs/adr/0016-hollow-endpoint-styles.md`.
28
+ */
5
29
  export declare enum PointStyle {
6
30
  Arrow = "Arrow",
7
31
  Circle = "Circle",
8
32
  Diamond = "Diamond",
9
33
  None = "None",
10
- Triangle = "Triangle"
34
+ Triangle = "Triangle",
35
+ TriangleHollow = "TriangleHollow",
36
+ DiamondHollow = "DiamondHollow"
11
37
  }
12
- export declare const PointStyleMap: Record<PointStyle, "Arrow" | "Circle" | "Diamond" | "None" | "Triangle">;
38
+ export declare const PointStyleMap: Record<PointStyle, "Arrow" | "Circle" | "Diamond" | "None" | "Triangle" | "TriangleHollow" | "DiamondHollow">;
13
39
  export declare const DEFAULT_FRONT_ENDPOINT_STYLE = PointStyle.None;
14
40
  export declare const DEFAULT_REAR_ENDPOINT_STYLE = PointStyle.Arrow;
15
41
  export declare const CONNECTOR_LABEL_MAX_WIDTH = 280;
@@ -4,6 +4,30 @@ export var ConnectorEndpoint;
4
4
  ConnectorEndpoint["Front"] = "Front";
5
5
  ConnectorEndpoint["Rear"] = "Rear";
6
6
  })(ConnectorEndpoint || (ConnectorEndpoint = {}));
7
+ /**
8
+ * The endpoint head painted at each end of a connector.
9
+ *
10
+ * **These string values are PERSISTED.** Every connector stores two of them
11
+ * (`frontEndpointStyle` / `rearEndpointStyle`, see
12
+ * `../elements/connector/connector.ts`), so the enum is **append-only**: a
13
+ * member may be added, never renamed, never removed, and never given a
14
+ * different string value. Renaming one would silently turn every stored
15
+ * connector that carries it into an unknown style.
16
+ *
17
+ * **Adding a member is safe in both directions.** The canvas `renderEndpoint`
18
+ * switch (`@labre/affine-gfx-connector`) and the DOM renderer's
19
+ * `createArrowMarker` both have **no `default` branch** on purpose: a client
20
+ * built before a member was added simply paints no head for it. The connector
21
+ * itself, its geometry, its label and its bindings all still load and still
22
+ * round-trip — degraded, never broken. The reverse is free: an older document
23
+ * only ever carries members that already existed.
24
+ *
25
+ * `TriangleHollow` and `DiamondHollow` are the UML 2.5.1 heads — a hollow
26
+ * closed triangle for generalization and realization, a hollow diamond for
27
+ * shared aggregation. They are the same geometry as `Triangle` / `Diamond`,
28
+ * filled with the notation card fill instead of the stroke colour; see
29
+ * `docs/adr/0016-hollow-endpoint-styles.md`.
30
+ */
7
31
  export var PointStyle;
8
32
  (function (PointStyle) {
9
33
  PointStyle["Arrow"] = "Arrow";
@@ -11,6 +35,8 @@ export var PointStyle;
11
35
  PointStyle["Diamond"] = "Diamond";
12
36
  PointStyle["None"] = "None";
13
37
  PointStyle["Triangle"] = "Triangle";
38
+ PointStyle["TriangleHollow"] = "TriangleHollow";
39
+ PointStyle["DiamondHollow"] = "DiamondHollow";
14
40
  })(PointStyle || (PointStyle = {}));
15
41
  export const PointStyleMap = createEnumMap(PointStyle);
16
42
  export const DEFAULT_FRONT_ENDPOINT_STYLE = PointStyle.None;
@@ -98,7 +98,7 @@ let BpmnPoolElementModel = (() => {
98
98
  _name_decorators = [field('Pool')];
99
99
  _resizeEnabled_decorators = [field(true)];
100
100
  _rotate_decorators = [field(0)];
101
- _xywh_decorators = [field()];
101
+ _xywh_decorators = [field('[0,0,0,0]')];
102
102
  _lanes_decorators = [field()];
103
103
  __esDecorate(this, null, _name_decorators, { kind: "accessor", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
104
104
  __esDecorate(this, null, _resizeEnabled_decorators, { kind: "accessor", name: "resizeEnabled", static: false, private: false, access: { has: obj => "resizeEnabled" in obj, get: obj => obj.resizeEnabled, set: (obj, value) => { obj.resizeEnabled = value; } }, metadata: _metadata }, _resizeEnabled_initializers, _resizeEnabled_extraInitializers);
@@ -109,7 +109,7 @@ let BrushElementModel = (() => {
109
109
  ...(instance.points[i][2] !== undefined ? [instance.points[i][2]] : []),
110
110
  ]),
111
111
  };
112
- }), field()];
112
+ }), field('[0,0,0,0]')];
113
113
  __esDecorate(this, null, _color_decorators, { kind: "accessor", name: "color", static: false, private: false, access: { has: obj => "color" in obj, get: obj => obj.color, set: (obj, value) => { obj.color = value; } }, metadata: _metadata }, _color_initializers, _color_extraInitializers);
114
114
  __esDecorate(this, null, _lineWidth_decorators, { kind: "accessor", name: "lineWidth", static: false, private: false, access: { has: obj => "lineWidth" in obj, get: obj => obj.lineWidth, set: (obj, value) => { obj.lineWidth = value; } }, metadata: _metadata }, _lineWidth_initializers, _lineWidth_extraInitializers);
115
115
  __esDecorate(this, null, _points_decorators, { kind: "accessor", name: "points", static: false, private: false, access: { has: obj => "points" in obj, get: obj => obj.points, set: (obj, value) => { obj.points = value; } }, metadata: _metadata }, _points_initializers, _points_extraInitializers);
@@ -93,7 +93,7 @@ let C4BoardElementModel = (() => {
93
93
  _name_decorators = [field('C4 diagram')];
94
94
  _resizeEnabled_decorators = [field(true)];
95
95
  _rotate_decorators = [field(0)];
96
- _xywh_decorators = [field()];
96
+ _xywh_decorators = [field('[0,0,0,0]')];
97
97
  _level_decorators = [field()];
98
98
  __esDecorate(this, null, _name_decorators, { kind: "accessor", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
99
99
  __esDecorate(this, null, _resizeEnabled_decorators, { kind: "accessor", name: "resizeEnabled", static: false, private: false, access: { has: obj => "resizeEnabled" in obj, get: obj => obj.resizeEnabled, set: (obj, value) => { obj.resizeEnabled = value; } }, metadata: _metadata }, _resizeEnabled_initializers, _resizeEnabled_extraInitializers);
@@ -67,7 +67,7 @@ let C4BoundaryElementModel = (() => {
67
67
  _name_decorators = [field('Boundary')];
68
68
  _resizeEnabled_decorators = [field(true)];
69
69
  _rotate_decorators = [field(0)];
70
- _xywh_decorators = [field()];
70
+ _xywh_decorators = [field('[0,0,0,0]')];
71
71
  _variant_decorators = [field()];
72
72
  __esDecorate(this, null, _name_decorators, { kind: "accessor", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
73
73
  __esDecorate(this, null, _resizeEnabled_decorators, { kind: "accessor", name: "resizeEnabled", static: false, private: false, access: { has: obj => "resizeEnabled" in obj, get: obj => obj.resizeEnabled, set: (obj, value) => { obj.resizeEnabled = value; } }, metadata: _metadata }, _resizeEnabled_initializers, _resizeEnabled_extraInitializers);
@@ -5,6 +5,7 @@ import { GfxPrimitiveElementModel } from '../../../std/gfx/index.js';
5
5
  import * as Y from 'yjs';
6
6
  import { ConnectorLabelOffsetAnchor, ConnectorMode, type PointStyle, StrokeStyle, type TextStyleProps } from '../../consts/index.js';
7
7
  import { type Color } from '../../themes/index.js';
8
+ import { type ConnectorLabelEnd } from './end-label.js';
8
9
  export type SerializedConnection = {
9
10
  id?: string;
10
11
  position?: `[${number},${number}]` | PointLocation;
@@ -30,6 +31,16 @@ export type ConnectorLabelProps = {
30
31
  labelOffset?: ConnectorLabelOffsetProps;
31
32
  labelStyle?: TextStyleProps;
32
33
  labelConstraints?: ConnectorLabelConstraintsProps;
34
+ /**
35
+ * The two END labels — a multiplicity, a role name, a qualifier — each
36
+ * anchored beside the endpoint it belongs to. See ADR 0020; they are FLAT
37
+ * rather than two nested records for the reason spelled out on the
38
+ * accessors.
39
+ */
40
+ sourceLabel?: Y.Text;
41
+ sourceLabelXYWH?: XYWH;
42
+ targetLabel?: Y.Text;
43
+ targetLabelXYWH?: XYWH;
33
44
  };
34
45
  export type SerializedConnectorElement = SerializedElement & {
35
46
  source: SerializedConnection;
@@ -78,6 +89,73 @@ export declare class ConnectorElementModel extends GfxPrimitiveElementModel<Conn
78
89
  getPointByOffsetDistance(offsetDistance?: number, bounds?: Bound): IVec;
79
90
  getRelativePointLocation(point: IVec): PointLocation;
80
91
  hasLabel(): boolean;
92
+ /** The content of one end's label, or `undefined` when it has none. */
93
+ endLabelText(end: ConnectorLabelEnd): Y.Text | undefined;
94
+ /** The box of one end's label, or `undefined` when nothing placed it yet. */
95
+ endLabelXYWH(end: ConnectorLabelEnd): XYWH | undefined;
96
+ /**
97
+ * Whether one end carries a label that should be PAINTED — the end-label
98
+ * twin of `hasLabel()`, gated on the same `labelDisplay` (one switch hides
99
+ * every caption on a connector, which is what the toolbar's toggle means)
100
+ * and on `endLabelEditing` instead of `labelEditing`, so mounting the editor
101
+ * on one end does not blank the other two labels.
102
+ */
103
+ hasEndLabel(end: ConnectorLabelEnd): boolean;
104
+ hasSourceLabel(): boolean;
105
+ hasTargetLabel(): boolean;
106
+ /** The boxes of the end labels that are currently painted, in end order. */
107
+ endLabelBoxes(): XYWH[];
108
+ endLabelIncludesPoint(end: ConnectorLabelEnd, point: IVec): boolean;
109
+ sourceLabelIncludesPoint(point: IVec): boolean;
110
+ targetLabelIncludesPoint(point: IVec): boolean;
111
+ /**
112
+ * Whether a point is reaching for one of the ENDS — the arrowhead, and the
113
+ * label that belongs beside it whether or not it exists yet.
114
+ *
115
+ * ## Why a hairline has to claim more than itself
116
+ *
117
+ * A connector is a stroke a few units wide, so its hit test is the line and
118
+ * nothing else — and an end label is the one thing on a connector that a user
119
+ * aims at BEFORE it exists (`docs/adr/0018`: they aim at the arrowhead). The
120
+ * picker that turns a double-click into "the source label" was written
121
+ * generously for exactly that, and it never got the chance: past `8` units off
122
+ * the stroke (plus half its width when the caller asks for a threshold —
123
+ * {@link includesPoint}'s own tolerance) nothing answered here, so the event
124
+ * reached no view at all and the editor's double-click-on-empty-canvas handler
125
+ * dropped a text block at the arrowhead instead. A text box appears, it is not
126
+ * the label, and the contextual menu's own entry works — which is precisely
127
+ * what the PO reported on 14/09/2026.
128
+ *
129
+ * ## …and why only a connector a FRAMEWORK typed claims it
130
+ *
131
+ * A `CONNECTOR_END_LABEL_GRAB` disc around each endpoint is a large
132
+ * thing to take out of the canvas, and the only gesture that needs it is the
133
+ * one that opens an END label — which is a notation's caption, never a plain
134
+ * arrow's. A connector carrying a `role` is exactly a connector some framework
135
+ * wrote (`uml:association`, `bpmn:sequenceFlow`); a generalist one keeps the
136
+ * hairline it has always had, so a double-click beside a whiteboard arrow
137
+ * still means "add text here" and a click there still reaches whatever is
138
+ * under it.
139
+ *
140
+ * ## …and why it gives the bound element right of way
141
+ *
142
+ * An endpoint sits ON the border of the node it is attached to, so half of
143
+ * every grab disc is INSIDE that node — and a node's body is the target of its
144
+ * own gestures (a UML classifier opens its name compartment there). Claiming
145
+ * that half would take the gesture away from the artefact and give it to the
146
+ * line touching it. So the disc stops at the bound element's own box, and what
147
+ * is left is the half the notation writes a multiplicity in: outside the box,
148
+ * beside the arrowhead.
149
+ *
150
+ * Resolved through the surface rather than remembered, and BOTH ways: a
151
+ * canvas element by id, and a BLOCK — a note, an image, an embed, a frame —
152
+ * through the store, because those are ends a framework binds too and the
153
+ * element resolver alone answers `undefined` for every one of them. It did,
154
+ * and the whole disc was then claimed inside the note. `null` is for an end
155
+ * bound to NOTHING: an unattached end is a free arrowhead in open canvas, and
156
+ * the whole disc around it is the author's target.
157
+ */
158
+ endGrabIncludesPoint(point: IVec): boolean;
81
159
  includesPoint(x: number, y: number, options?: PointTestOptions | undefined): boolean;
82
160
  labelIncludesPoint(point: IVec): boolean;
83
161
  moveTo(bound: Bound): void;
@@ -124,6 +202,16 @@ export declare class ConnectorElementModel extends GfxPrimitiveElementModel<Conn
124
202
  * Local control display and hide, mainly used in editing scenarios.
125
203
  */
126
204
  accessor labelEditing: boolean;
205
+ /**
206
+ * The end whose label is currently open in the DOM editor, if any — the
207
+ * end-label twin of `labelEditing`, and `@local()` for the same reason: it
208
+ * is a property of this client's editing session, not of the document.
209
+ *
210
+ * One selector rather than two booleans because only one label can be edited
211
+ * at a time, and because it is the same `'source' | 'target'` the editor's
212
+ * `which` argument carries.
213
+ */
214
+ accessor endLabelEditing: ConnectorLabelEnd | null;
127
215
  accessor mode: ConnectorMode;
128
216
  accessor path: PointLocation[];
129
217
  accessor rearEndpointStyle: PointStyle;
@@ -131,10 +219,57 @@ export declare class ConnectorElementModel extends GfxPrimitiveElementModel<Conn
131
219
  accessor rough: boolean | undefined;
132
220
  accessor roughness: number;
133
221
  accessor source: Connection;
222
+ /**
223
+ * The content of the label beside the SOURCE end — a multiplicity, a role
224
+ * name, a qualifier. `undefined` on every connector that has none, which is
225
+ * almost all of them.
226
+ *
227
+ * ### Why four flat fields and not two records
228
+ *
229
+ * A `Y.Text` nested inside a `Y.Map` inside the element's map would not be
230
+ * observed. The bridge that republishes a text edit as an element update is
231
+ * `watchText` in `syncElementFromY`
232
+ * (`packages/framework/std/src/gfx/model/surface/element-model.ts`): it walks
233
+ * the element's OWN `Y.Map`, and subscribes to every top-level value that is
234
+ * `instanceof Y.Text` — the centre `text` gets its observation from there and
235
+ * from nowhere else, which is why `text` carries no `@observe` decorator.
236
+ *
237
+ * Keeping the two end texts as top-level keys therefore buys the exact same
238
+ * observation, for free, on the exact same code path: type into an end label
239
+ * and the connector repaints, on this client and on every peer. A nested
240
+ * record would have needed an `@observe` bridge of its own, a second way of
241
+ * doing the one thing the centre label already does. ADR 0020.
242
+ *
243
+ * ### Absent by default
244
+ *
245
+ * `undefined` means the key is never written into the Y.Map at all (see the
246
+ * `@field()` `init`), so a connector that has no end label serialises
247
+ * byte-identically to one created before these fields existed: no migration,
248
+ * and an older build opens the document as a connector with two keys it does
249
+ * not read.
250
+ */
251
+ accessor sourceLabel: Y.Text | undefined;
252
+ /**
253
+ * The box of the source-end label, in the same absolute coordinates as
254
+ * `labelXYWH`. Absent until something places it — the pure default is
255
+ * `connectorEndLabelBox(path, 'source', size)`.
256
+ */
257
+ accessor sourceLabelXYWH: XYWH | undefined;
134
258
  accessor stroke: Color;
135
259
  accessor strokeStyle: StrokeStyle;
136
260
  accessor strokeWidth: number;
137
261
  accessor target: Connection;
262
+ /**
263
+ * The content of the label beside the TARGET end. See `sourceLabel` for why
264
+ * this is a flat `Y.Text` and what its absence guarantees.
265
+ */
266
+ accessor targetLabel: Y.Text | undefined;
267
+ /**
268
+ * The box of the target-end label, in the same absolute coordinates as
269
+ * `labelXYWH`. Absent until something places it — the pure default is
270
+ * `connectorEndLabelBox(path, 'target', size)`.
271
+ */
272
+ accessor targetLabelXYWH: XYWH | undefined;
138
273
  /**
139
274
  * The content of the label.
140
275
  */