@formicoidea/labre-core 0.32.0 → 0.34.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 (308) hide show
  1. package/dist/_pkgs/affine-block-attachment/attachment-block.js +3 -3
  2. package/dist/_pkgs/affine-block-attachment/configs/toolbar.d.ts +2 -2
  3. package/dist/_pkgs/affine-block-attachment/configs/toolbar.js +9 -7
  4. package/dist/_pkgs/affine-block-bookmark/configs/toolbar.js +12 -12
  5. package/dist/_pkgs/affine-block-callout/callout-block.js +1 -1
  6. package/dist/_pkgs/affine-block-code/code-block-inline.js +1 -1
  7. package/dist/_pkgs/affine-block-code/code-block.js +2 -2
  8. package/dist/_pkgs/affine-block-code/code-toolbar/config.js +9 -1
  9. package/dist/_pkgs/affine-block-code/code-toolbar/index.js +1 -1
  10. package/dist/_pkgs/affine-block-database/data-source.js +1 -2
  11. package/dist/_pkgs/affine-block-database/database-block.js +2 -2
  12. package/dist/_pkgs/affine-block-database/external-data-source.js +1 -1
  13. package/dist/_pkgs/affine-block-edgeless-text/edgeless-text-block.js +1 -1
  14. package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/config.js +1 -1
  15. package/dist/_pkgs/affine-block-embed/common/render-linked-doc.js +3 -3
  16. package/dist/_pkgs/affine-block-embed/configs/toolbar.js +11 -11
  17. package/dist/_pkgs/affine-block-embed/embed-figma-block/embed-figma-service.js +1 -1
  18. package/dist/_pkgs/affine-block-embed/embed-html-block/configs/toolbar.js +5 -5
  19. package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.d.ts +7 -7
  20. package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.js +14 -14
  21. package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.js +2 -2
  22. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/toolbar.js +10 -10
  23. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-linked-doc-block.js +4 -4
  24. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/utils.js +1 -1
  25. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/components/embed-synced-doc-card.js +5 -4
  26. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/configs/toolbar.js +10 -10
  27. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-synced-doc-block.js +1 -1
  28. package/dist/_pkgs/affine-block-frame/frame-manager.js +3 -1
  29. package/dist/_pkgs/affine-block-frame/frame-tool.js +1 -1
  30. package/dist/_pkgs/affine-block-frame/frame-toolbar.js +2 -2
  31. package/dist/_pkgs/affine-block-image/components/page-image-block.js +1 -1
  32. package/dist/_pkgs/affine-block-image/configs/toolbar.js +4 -4
  33. package/dist/_pkgs/affine-block-image/image-edgeless-block.js +1 -1
  34. package/dist/_pkgs/affine-block-list/utils/forward-delete.js +1 -1
  35. package/dist/_pkgs/affine-block-note/commands/select-block.js +1 -1
  36. package/dist/_pkgs/affine-block-note/commands/select-blocks-between.js +1 -1
  37. package/dist/_pkgs/affine-block-note/configs/toolbar.js +2 -2
  38. package/dist/_pkgs/affine-block-note/move-block.js +1 -1
  39. package/dist/_pkgs/affine-block-paragraph/utils/forward-delete.js +2 -2
  40. package/dist/_pkgs/affine-block-paragraph/utils/merge-with-prev.js +1 -1
  41. package/dist/_pkgs/affine-block-root/configs/toolbar.d.ts +6 -4
  42. package/dist/_pkgs/affine-block-root/configs/toolbar.js +6 -6
  43. package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/misc.d.ts +10 -10
  44. package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/misc.js +4 -4
  45. package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/more.d.ts +7 -7
  46. package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/more.js +9 -9
  47. package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.js +1 -1
  48. package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.js +3 -1
  49. package/dist/_pkgs/affine-block-root/edgeless/utils/clipboard-utils.js +1 -1
  50. package/dist/_pkgs/affine-block-surface/adapters/markdown/element-adapter/type.js +1 -1
  51. package/dist/_pkgs/affine-block-surface/adapters/plain-text/element-adapter/type.js +1 -1
  52. package/dist/_pkgs/affine-block-surface/element-model/index.d.ts +18 -3
  53. package/dist/_pkgs/affine-block-surface/element-model/index.js +12 -2
  54. package/dist/_pkgs/affine-block-surface/extensions/audit.js +23 -6
  55. package/dist/_pkgs/affine-block-surface/extensions/crud-extension.js +10 -5
  56. package/dist/_pkgs/affine-block-surface/extensions/editor-anchored-panel.js +2 -1
  57. package/dist/_pkgs/affine-block-surface/extensions/element-renderer.js +1 -1
  58. package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.js +1 -1
  59. package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +4 -0
  60. package/dist/_pkgs/affine-block-surface/extensions/index.js +4 -0
  61. package/dist/_pkgs/affine-block-surface/extensions/interchange-import.d.ts +172 -0
  62. package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +404 -0
  63. package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +323 -0
  64. package/dist/_pkgs/affine-block-surface/extensions/interchange.js +64 -0
  65. package/dist/_pkgs/affine-block-surface/extensions/map-quality-widget.js +61 -61
  66. package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.d.ts +248 -0
  67. package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.js +248 -0
  68. package/dist/_pkgs/affine-block-surface/extensions/reading-widget.js +78 -80
  69. package/dist/_pkgs/affine-block-surface/extensions/reading.js +2 -2
  70. package/dist/_pkgs/affine-block-surface/extensions/spotlight.d.ts +21 -0
  71. package/dist/_pkgs/affine-block-surface/extensions/spotlight.js +17 -3
  72. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.d.ts +107 -0
  73. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +958 -0
  74. package/dist/_pkgs/affine-block-surface/extensions/validation.d.ts +809 -20
  75. package/dist/_pkgs/affine-block-surface/extensions/validation.js +1661 -50
  76. package/dist/_pkgs/affine-block-surface/extensions/violation-detail-widget.d.ts +50 -6
  77. package/dist/_pkgs/affine-block-surface/extensions/violation-detail-widget.js +129 -32
  78. package/dist/_pkgs/affine-block-surface/framework-background/def.d.ts +289 -0
  79. package/dist/_pkgs/affine-block-surface/framework-background/def.js +126 -1
  80. package/dist/_pkgs/affine-block-surface/framework-background/labels.d.ts +42 -2
  81. package/dist/_pkgs/affine-block-surface/framework-background/labels.js +80 -4
  82. package/dist/_pkgs/affine-block-surface/framework-background/renderer.js +172 -11
  83. package/dist/_pkgs/affine-block-surface/index.d.ts +1 -0
  84. package/dist/_pkgs/affine-block-surface/index.js +1 -0
  85. package/dist/_pkgs/affine-block-surface/renderer/element-highlight-overlay.d.ts +17 -0
  86. package/dist/_pkgs/affine-block-surface/renderer/element-highlight-overlay.js +66 -0
  87. package/dist/_pkgs/affine-block-surface/renderer/overlay.js +1 -1
  88. package/dist/_pkgs/affine-block-surface/view.js +5 -0
  89. package/dist/_pkgs/affine-block-surface-ref/configs/toolbar.js +4 -4
  90. package/dist/_pkgs/affine-block-surface-ref/portal/note.js +2 -2
  91. package/dist/_pkgs/affine-block-table/commands.js +1 -1
  92. package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.js +1 -1
  93. package/dist/_pkgs/affine-components/embed-card-modal/embed-card-edit-modal.js +1 -1
  94. package/dist/_pkgs/affine-components/filterable-list/styles.js +1 -1
  95. package/dist/_pkgs/affine-components/highlight-dropdown-menu/highlight-duotone-icon.js +8 -8
  96. package/dist/_pkgs/affine-components/highlight-dropdown-menu/text-duotone-icon.js +11 -11
  97. package/dist/_pkgs/affine-components/icons/text.js +426 -426
  98. package/dist/_pkgs/affine-components/open-doc-dropdown-menu/dropdown-menu.d.ts +2 -0
  99. package/dist/_pkgs/affine-components/peek/peekable.js +1 -1
  100. package/dist/_pkgs/affine-components/resource/resource.js +2 -0
  101. package/dist/_pkgs/affine-components/toolbar/index.d.ts +1 -0
  102. package/dist/_pkgs/affine-components/toolbar/index.js +1 -0
  103. package/dist/_pkgs/affine-components/toolbar/menu-button.js +1 -1
  104. package/dist/_pkgs/affine-components/toolbar/picker-menu.d.ts +55 -0
  105. package/dist/_pkgs/affine-components/toolbar/picker-menu.js +47 -0
  106. package/dist/_pkgs/affine-components/view-dropdown-menu/dropdown-menu.js +27 -14
  107. package/dist/_pkgs/affine-fragment-frame-panel/body/frame-panel-body.js +2 -2
  108. package/dist/_pkgs/affine-fragment-frame-panel/header/frame-panel-header.js +2 -2
  109. package/dist/_pkgs/affine-fragment-frame-panel/header/frames-setting-menu.js +1 -1
  110. package/dist/_pkgs/affine-fragment-outline/mobile-outline-panel.js +1 -1
  111. package/dist/_pkgs/affine-gfx-brush/toolbar/components/pen/pen-tool-button.js +1 -1
  112. package/dist/_pkgs/affine-gfx-connector/connector-manager.js +7 -10
  113. package/dist/_pkgs/affine-gfx-connector/connector-tool.d.ts +19 -1
  114. package/dist/_pkgs/affine-gfx-connector/connector-tool.js +10 -2
  115. package/dist/_pkgs/affine-gfx-connector/connector-watcher.js +1 -4
  116. package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.js +2 -1
  117. package/dist/_pkgs/affine-gfx-connector/direction/invert-direction.js +1 -3
  118. package/dist/_pkgs/affine-gfx-connector/element-renderer/index.js +1 -1
  119. package/dist/_pkgs/affine-gfx-connector/element-renderer/utils.js +1 -1
  120. package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +1 -1
  121. package/dist/_pkgs/affine-gfx-mindmap/adapter/markdown/index.js +1 -1
  122. package/dist/_pkgs/affine-gfx-mindmap/adapter/utils.js +1 -1
  123. package/dist/_pkgs/affine-gfx-mindmap/templates/index.js +583 -4
  124. package/dist/_pkgs/affine-gfx-mindmap/toolbar/mindmap-menu.js +23 -23
  125. package/dist/_pkgs/affine-gfx-mindmap/toolbar/mindmap-tool-button.js +5 -1
  126. package/dist/_pkgs/affine-gfx-mindmap/view/utils.js +1 -1
  127. package/dist/_pkgs/affine-gfx-note/overlay/overlay.js +1 -1
  128. package/dist/_pkgs/affine-gfx-note/toolbar/note-senior-button.js +1 -1
  129. package/dist/_pkgs/affine-gfx-shape/consts.js +1 -1
  130. package/dist/_pkgs/affine-gfx-shape/draggable/shape-draggable.js +1 -1
  131. package/dist/_pkgs/affine-gfx-shape/element-renderer/shape/polygon.js +17 -9
  132. package/dist/_pkgs/affine-gfx-shape/element-renderer/shape/utils.js +8 -3
  133. package/dist/_pkgs/affine-gfx-shape/element-view.js +19 -12
  134. package/dist/_pkgs/affine-gfx-shape/overlay/polygon-drawing-overlay.js +1 -1
  135. package/dist/_pkgs/affine-gfx-shape/overlay/polygon-vertex-editing-overlay.js +12 -7
  136. package/dist/_pkgs/affine-gfx-shape/overlay/shape-overlay.js +1 -1
  137. package/dist/_pkgs/affine-gfx-shape/polygon-tool.js +4 -2
  138. package/dist/_pkgs/affine-gfx-shape/shape-tool.js +1 -1
  139. package/dist/_pkgs/affine-gfx-shape/text/edgeless-shape-text-editor.js +1 -3
  140. package/dist/_pkgs/affine-gfx-template/builtin/other.js +66 -17
  141. package/dist/_pkgs/affine-gfx-template/toolbar/overlay-scrollbar.js +1 -1
  142. package/dist/_pkgs/affine-gfx-template/toolbar/template-panel.js +1 -1
  143. package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +1 -1
  144. package/dist/_pkgs/affine-inline-link/command.js +1 -1
  145. package/dist/_pkgs/affine-inline-link/link-node/configs/toolbar.d.ts +4 -4
  146. package/dist/_pkgs/affine-inline-link/link-node/configs/toolbar.js +6 -6
  147. package/dist/_pkgs/affine-inline-preset/command/format-block.js +1 -1
  148. package/dist/_pkgs/affine-inline-preset/command/format-native.js +2 -2
  149. package/dist/_pkgs/affine-inline-preset/command/format-text.js +1 -1
  150. package/dist/_pkgs/affine-inline-preset/inline-spec.js +1 -1
  151. package/dist/_pkgs/affine-inline-reference/reference-node/configs/toolbar.d.ts +4 -4
  152. package/dist/_pkgs/affine-inline-reference/reference-node/configs/toolbar.js +6 -6
  153. package/dist/_pkgs/affine-inline-reference/reference-node/reference-node.js +1 -1
  154. package/dist/_pkgs/affine-model/elements/bpmn/node.d.ts +40 -7
  155. package/dist/_pkgs/affine-model/elements/bpmn/node.js +4 -2
  156. package/dist/_pkgs/affine-model/elements/bpmn/pool.d.ts +135 -17
  157. package/dist/_pkgs/affine-model/elements/bpmn/pool.js +148 -26
  158. package/dist/_pkgs/affine-model/elements/c4/board.d.ts +88 -0
  159. package/dist/_pkgs/affine-model/elements/c4/board.js +128 -0
  160. package/dist/_pkgs/affine-model/elements/c4/boundary.d.ts +63 -0
  161. package/dist/_pkgs/affine-model/elements/c4/boundary.js +134 -0
  162. package/dist/_pkgs/affine-model/elements/c4/index.d.ts +3 -0
  163. package/dist/_pkgs/affine-model/elements/c4/index.js +3 -0
  164. package/dist/_pkgs/affine-model/elements/c4/node.d.ts +97 -0
  165. package/dist/_pkgs/affine-model/elements/c4/node.js +130 -0
  166. package/dist/_pkgs/affine-model/elements/connector/connector.js +1 -1
  167. package/dist/_pkgs/affine-model/elements/context-map/context-map.d.ts +27 -0
  168. package/dist/_pkgs/affine-model/elements/context-map/context-map.js +94 -0
  169. package/dist/_pkgs/affine-model/elements/context-map/index.d.ts +1 -0
  170. package/dist/_pkgs/affine-model/elements/context-map/index.js +1 -0
  171. package/dist/_pkgs/affine-model/elements/core-domain/core-domain.d.ts +34 -17
  172. package/dist/_pkgs/affine-model/elements/core-domain/core-domain.js +28 -26
  173. package/dist/_pkgs/affine-model/elements/cynefin/cynefin.d.ts +7 -2
  174. package/dist/_pkgs/affine-model/elements/cynefin/cynefin.js +9 -4
  175. package/dist/_pkgs/affine-model/elements/edgy/board.d.ts +7 -2
  176. package/dist/_pkgs/affine-model/elements/edgy/board.js +9 -4
  177. package/dist/_pkgs/affine-model/elements/edgy/facets.d.ts +20 -3
  178. package/dist/_pkgs/affine-model/elements/edgy/facets.js +13 -4
  179. package/dist/_pkgs/affine-model/elements/estuarine/estuarine.d.ts +7 -2
  180. package/dist/_pkgs/affine-model/elements/estuarine/estuarine.js +9 -4
  181. package/dist/_pkgs/affine-model/elements/event-storming/event-storming.d.ts +36 -0
  182. package/dist/_pkgs/affine-model/elements/event-storming/event-storming.js +103 -0
  183. package/dist/_pkgs/affine-model/elements/event-storming/index.d.ts +1 -0
  184. package/dist/_pkgs/affine-model/elements/event-storming/index.js +1 -0
  185. package/dist/_pkgs/affine-model/elements/framework-background/background.d.ts +7 -2
  186. package/dist/_pkgs/affine-model/elements/framework-background/background.js +9 -4
  187. package/dist/_pkgs/affine-model/elements/framework-background/hit-test.d.ts +48 -0
  188. package/dist/_pkgs/affine-model/elements/framework-background/hit-test.js +55 -0
  189. package/dist/_pkgs/affine-model/elements/framework-background/index.d.ts +1 -0
  190. package/dist/_pkgs/affine-model/elements/framework-background/index.js +1 -0
  191. package/dist/_pkgs/affine-model/elements/index.d.ts +11 -0
  192. package/dist/_pkgs/affine-model/elements/index.js +3 -0
  193. package/dist/_pkgs/affine-model/elements/shape/api/polygon.js +2 -8
  194. package/dist/_pkgs/affine-shared/adapters/html/block-adapter.js +1 -1
  195. package/dist/_pkgs/affine-shared/adapters/markdown/block-adapter.js +1 -1
  196. package/dist/_pkgs/affine-shared/adapters/markdown/delta-converter.js +1 -1
  197. package/dist/_pkgs/affine-shared/adapters/notion-html/block-adapter.js +1 -1
  198. package/dist/_pkgs/affine-shared/adapters/notion-html/delta-converter.js +1 -1
  199. package/dist/_pkgs/affine-shared/adapters/plain-text/block-adapter.js +1 -1
  200. package/dist/_pkgs/affine-shared/adapters/plain-text/delta-converter.js +1 -1
  201. package/dist/_pkgs/affine-shared/adapters/utils/color.js +5 -2
  202. package/dist/_pkgs/affine-shared/commands/model-crud/draft-selected-models.js +1 -1
  203. package/dist/_pkgs/affine-shared/commands/selection/focus-block-end.js +1 -1
  204. package/dist/_pkgs/affine-shared/commands/selection/focus-block-start.js +1 -1
  205. package/dist/_pkgs/affine-shared/consts/index.d.ts +10 -0
  206. package/dist/_pkgs/affine-shared/consts/index.js +10 -0
  207. package/dist/_pkgs/affine-shared/services/artefact-catalogue-service.d.ts +55 -0
  208. package/dist/_pkgs/affine-shared/services/artefact-catalogue-service.js +35 -0
  209. package/dist/_pkgs/affine-shared/services/audit-service.d.ts +11 -0
  210. package/dist/_pkgs/affine-shared/services/command-usage-service.d.ts +31 -0
  211. package/dist/_pkgs/affine-shared/services/command-usage-service.js +109 -0
  212. package/dist/_pkgs/affine-shared/services/comment-service/block-comment-manager.js +1 -1
  213. package/dist/_pkgs/affine-shared/services/doc-display-meta-service.js +1 -1
  214. package/dist/_pkgs/affine-shared/services/edit-props-store.d.ts +11 -0
  215. package/dist/_pkgs/affine-shared/services/edit-props-store.js +15 -0
  216. package/dist/_pkgs/affine-shared/services/embed-iframe/embed-iframe-config.js +1 -1
  217. package/dist/_pkgs/affine-shared/services/index.d.ts +2 -0
  218. package/dist/_pkgs/affine-shared/services/index.js +2 -0
  219. package/dist/_pkgs/affine-shared/services/pivot-materiality-publisher.js +2 -1
  220. package/dist/_pkgs/affine-shared/services/telemetry-service/lifecycle.d.ts +73 -1
  221. package/dist/_pkgs/affine-shared/services/toolbar-service/action.d.ts +32 -0
  222. package/dist/_pkgs/affine-shared/services/toolbar-service/action.js +16 -0
  223. package/dist/_pkgs/affine-shared/services/toolbar-service/flags.d.ts +10 -0
  224. package/dist/_pkgs/affine-shared/services/toolbar-service/flags.js +32 -1
  225. package/dist/_pkgs/affine-shared/services/toolbar-service/registry.d.ts +44 -0
  226. package/dist/_pkgs/affine-shared/services/toolbar-service/registry.js +161 -3
  227. package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +106 -0
  228. package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +201 -0
  229. package/dist/_pkgs/affine-shared/services/translation-service/index.d.ts +1 -0
  230. package/dist/_pkgs/affine-shared/services/translation-service/index.js +1 -0
  231. package/dist/_pkgs/affine-shared/services/universe-tag-defs-service.js +5 -3
  232. package/dist/_pkgs/affine-shared/test-utils/affine-template.js +1 -1
  233. package/dist/_pkgs/affine-shared/utils/edgeless.js +1 -1
  234. package/dist/_pkgs/affine-shared/utils/file/filesys.d.ts +34 -0
  235. package/dist/_pkgs/affine-shared/utils/file/filesys.js +48 -7
  236. package/dist/_pkgs/affine-shared/utils/zod-schema.js +1 -3
  237. package/dist/_pkgs/affine-widget-drag-handle/utils.js +1 -1
  238. package/dist/_pkgs/affine-widget-edgeless-auto-connect/index.js +1 -1
  239. package/dist/_pkgs/affine-widget-edgeless-dragging-area/edgeless-dragging-area-rect.js +1 -1
  240. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-default.d.ts +14 -0
  241. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-default.js +40 -0
  242. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.d.ts +158 -0
  243. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.js +572 -0
  244. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/catalogue-groups.d.ts +41 -0
  245. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/catalogue-groups.js +49 -0
  246. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/chord-format.d.ts +13 -0
  247. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/chord-format.js +50 -0
  248. package/dist/_pkgs/affine-widget-edgeless-toolbar/edgeless-toolbar.d.ts +6 -0
  249. package/dist/_pkgs/affine-widget-edgeless-toolbar/edgeless-toolbar.js +15 -5
  250. package/dist/_pkgs/affine-widget-edgeless-toolbar/effects.d.ts +2 -0
  251. package/dist/_pkgs/affine-widget-edgeless-toolbar/effects.js +2 -0
  252. package/dist/_pkgs/affine-widget-edgeless-toolbar/extension/index.d.ts +7 -0
  253. package/dist/_pkgs/affine-widget-edgeless-toolbar/index.d.ts +4 -0
  254. package/dist/_pkgs/affine-widget-edgeless-toolbar/index.js +4 -0
  255. package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.d.ts +19 -0
  256. package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.js +51 -10
  257. package/dist/_pkgs/affine-widget-edgeless-toolbar/view.js +9 -0
  258. package/dist/_pkgs/affine-widget-keyboard-toolbar/config.js +2 -1
  259. package/dist/_pkgs/affine-widget-keyboard-toolbar/icons.js +98 -98
  260. package/dist/_pkgs/affine-widget-keyboard-toolbar/keyboard-tool-panel.js +1 -1
  261. package/dist/_pkgs/affine-widget-linked-doc/import-doc/import-doc.js +1 -1
  262. package/dist/_pkgs/affine-widget-linked-doc/linked-doc-popover.js +1 -1
  263. package/dist/_pkgs/affine-widget-page-dragging-area/index.js +1 -1
  264. package/dist/_pkgs/affine-widget-remote-selection/doc/doc-remote-selection.js +1 -1
  265. package/dist/_pkgs/affine-widget-slash-menu/config.js +2 -1
  266. package/dist/_pkgs/affine-widget-toolbar/toolbar.js +11 -2
  267. package/dist/_pkgs/affine-widget-toolbar/utils.d.ts +19 -2
  268. package/dist/_pkgs/affine-widget-toolbar/utils.js +28 -9
  269. package/dist/_pkgs/data-view/core/group-by/renderer/boolean-group.js +11 -11
  270. package/dist/_pkgs/data-view/core/utils/menu-title.js +17 -17
  271. package/dist/_pkgs/data-view/view-presets/calendar/pc/actions.js +8 -12
  272. package/dist/_pkgs/data-view/view-presets/calendar/pc/view.js +52 -40
  273. package/dist/_pkgs/data-view/view-presets/table/mobile/group.js +3 -1
  274. package/dist/_pkgs/data-view/view-presets/table/pc/group.js +3 -1
  275. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/top/group-title.js +18 -18
  276. package/dist/_pkgs/std/clipboard/utils.js +4 -1
  277. package/dist/_pkgs/std/extension/command-registry.d.ts +195 -5
  278. package/dist/_pkgs/std/extension/command-registry.js +218 -4
  279. package/dist/_pkgs/std/extension/shortcut.js +2 -1
  280. package/dist/_pkgs/std/extension/translation-manifest.d.ts +46 -1
  281. package/dist/_pkgs/std/extension/translation-manifest.js +58 -0
  282. package/dist/_pkgs/std/gfx/grid.js +1 -1
  283. package/dist/_pkgs/std/gfx/highlight.d.ts +84 -0
  284. package/dist/_pkgs/std/gfx/highlight.js +112 -0
  285. package/dist/_pkgs/std/gfx/index.d.ts +2 -1
  286. package/dist/_pkgs/std/gfx/index.js +1 -0
  287. package/dist/_pkgs/std/gfx/interactivity/gfx-view-event-handler.js +17 -3
  288. package/dist/_pkgs/std/gfx/model/surface/element-model.d.ts +160 -0
  289. package/dist/_pkgs/std/gfx/model/surface/element-model.js +75 -1
  290. package/dist/_pkgs/std/gfx/model/surface/role.js +5 -3
  291. package/dist/_pkgs/std/gfx/model/surface/surface-model.js +2 -1
  292. package/dist/_pkgs/std/gfx/selection.js +1 -1
  293. package/dist/_pkgs/std/gfx/viewport.js +1 -1
  294. package/dist/_pkgs/std/inline/extensions/inline-manager.js +1 -1
  295. package/dist/_pkgs/std/inline/extensions/markdown-matcher.js +1 -1
  296. package/dist/_pkgs/std/scope/std-scope.d.ts +2 -1
  297. package/dist/_pkgs/std/scope/std-scope.js +2 -0
  298. package/dist/_pkgs/std/utils/gfx.js +2 -0
  299. package/dist/_pkgs/store/model/store/crud.js +4 -1
  300. package/dist/commands.js +1 -1
  301. package/dist/extensions/command-usage.d.ts +23 -0
  302. package/dist/extensions/command-usage.js +37 -0
  303. package/dist/extensions/view.js +12 -0
  304. package/dist/frameworks.js +32 -0
  305. package/dist/shortcuts.d.ts +20 -6
  306. package/dist/shortcuts.js +7 -9
  307. package/dist/translations.js +98 -3
  308. package/package.json +13 -1
@@ -1,5 +1,5 @@
1
1
  import { toast } from '../../../affine-components/toast/index.js';
2
- import { ActionPlacement, EmbedIframeService, EmbedOptionProvider, } from '../../../affine-shared/services/index.js';
2
+ import { ActionPlacement, EmbedIframeService, EmbedOptionProvider, TOOLBAR_CARD_VIEW, TOOLBAR_DELETE, TOOLBAR_EMBED_VIEW, TOOLBAR_INLINE_VIEW, toolbarActionLabel, } from '../../../affine-shared/services/index.js';
3
3
  import { CopyIcon, DeleteIcon, EditIcon, UnlinkIcon, } from '@blocksuite/icons/lit';
4
4
  import { BlockSelection } from '../../../std/index.js';
5
5
  import { signal } from '@preact/signals-core';
@@ -79,12 +79,12 @@ export const builtinInlineLinkToolbarConfig = {
79
79
  actions: [
80
80
  {
81
81
  id: 'inline',
82
- label: 'Inline view',
82
+ labelWording: TOOLBAR_INLINE_VIEW,
83
83
  disabled: true,
84
84
  },
85
85
  {
86
86
  id: 'card',
87
- label: 'Card view',
87
+ labelWording: TOOLBAR_CARD_VIEW,
88
88
  run(ctx) {
89
89
  const target = ctx.message$.peek()?.element;
90
90
  if (!(target instanceof AffineLink))
@@ -133,7 +133,7 @@ export const builtinInlineLinkToolbarConfig = {
133
133
  },
134
134
  {
135
135
  id: 'embed',
136
- label: 'Embed view',
136
+ labelWording: TOOLBAR_EMBED_VIEW,
137
137
  when(ctx) {
138
138
  const target = ctx.message$.peek()?.element;
139
139
  if (!(target instanceof AffineLink))
@@ -210,7 +210,7 @@ export const builtinInlineLinkToolbarConfig = {
210
210
  if (!(target instanceof AffineLink))
211
211
  return null;
212
212
  const actions = this.actions.map(action => ({ ...action }));
213
- const viewType$ = signal(actions[0].label);
213
+ const viewType$ = signal(toolbarActionLabel(ctx.std, actions[0]));
214
214
  const onToggle = (e) => {
215
215
  const opened = e.detail;
216
216
  if (!opened)
@@ -280,7 +280,7 @@ export const builtinInlineLinkToolbarConfig = {
280
280
  {
281
281
  placement: ActionPlacement.More,
282
282
  id: 'c.delete',
283
- label: 'Delete',
283
+ labelWording: TOOLBAR_DELETE,
284
284
  icon: DeleteIcon(),
285
285
  variant: 'destructive',
286
286
  run(ctx) {
@@ -1,5 +1,5 @@
1
1
  import { getSelectedBlocksCommand } from '../../affine-shared/commands/index.js';
2
- import { INLINE_ROOT_ATTR, } from '../../std/inline/index.js';
2
+ import { INLINE_ROOT_ATTR } from '../../std/inline/index.js';
3
3
  import { FORMAT_BLOCK_SUPPORT_FLAVOURS } from './consts.js';
4
4
  // for block selection
5
5
  export const formatBlockCommand = (ctx, next) => {
@@ -1,5 +1,5 @@
1
- import { BLOCK_ID_ATTR, } from '../../std/index.js';
2
- import { INLINE_ROOT_ATTR, } from '../../std/inline/index.js';
1
+ import { BLOCK_ID_ATTR } from '../../std/index.js';
2
+ import { INLINE_ROOT_ATTR } from '../../std/inline/index.js';
3
3
  import { FORMAT_NATIVE_SUPPORT_FLAVOURS } from './consts.js';
4
4
  // for native range
5
5
  export const formatNativeCommand = (ctx, next) => {
@@ -1,6 +1,6 @@
1
1
  import { clearMarksOnDiscontinuousInput } from '../../affine-rich-text/index.js';
2
2
  import { getSelectedBlocksCommand } from '../../affine-shared/commands/index.js';
3
- import { INLINE_ROOT_ATTR, } from '../../std/inline/index.js';
3
+ import { INLINE_ROOT_ATTR } from '../../std/inline/index.js';
4
4
  import { FORMAT_TEXT_SUPPORT_FLAVOURS } from './consts.js';
5
5
  // for text selection
6
6
  export const formatTextCommand = (ctx, next) => {
@@ -1,4 +1,4 @@
1
- import { InlineSpecExtension, } from '../std/inline/index.js';
1
+ import { InlineSpecExtension } from '../std/inline/index.js';
2
2
  import { html } from 'lit';
3
3
  import { z } from 'zod';
4
4
  export const BoldInlineSpecExtension = InlineSpecExtension({
@@ -7,17 +7,17 @@ export declare const builtinInlineReferenceToolbarConfig: {
7
7
  id: string;
8
8
  actions: ({
9
9
  id: string;
10
- label: string;
10
+ labelWording: import("../../../affine-shared/services/index.js").ChromeWording;
11
11
  disabled: true;
12
12
  run?: undefined;
13
13
  } | {
14
14
  id: string;
15
- label: string;
15
+ labelWording: import("../../../affine-shared/services/index.js").ChromeWording;
16
16
  run(ctx: import("../../../affine-shared/services/index.js").ToolbarContext): void;
17
17
  disabled?: undefined;
18
18
  } | {
19
19
  id: string;
20
- label: string;
20
+ labelWording: import("../../../affine-shared/services/index.js").ChromeWording;
21
21
  disabled(ctx: import("../../../affine-shared/services/index.js").ToolbarContext): boolean;
22
22
  run(ctx: import("../../../affine-shared/services/index.js").ToolbarContext): void;
23
23
  })[];
@@ -26,7 +26,7 @@ export declare const builtinInlineReferenceToolbarConfig: {
26
26
  }, {
27
27
  readonly placement: ActionPlacement.More;
28
28
  readonly id: "c.delete";
29
- readonly label: "Delete";
29
+ readonly labelWording: import("../../../affine-shared/services/index.js").ChromeWording;
30
30
  readonly icon: import("lit-html").TemplateResult<1>;
31
31
  readonly variant: "destructive";
32
32
  readonly run: (ctx: import("../../../affine-shared/services/index.js").ToolbarContext) => void;
@@ -1,5 +1,5 @@
1
1
  import { notifyLinkedDocSwitchedToEmbed } from '../../../affine-components/notification/index.js';
2
- import { ActionPlacement, DocDisplayMetaProvider, } from '../../../affine-shared/services/index.js';
2
+ import { ActionPlacement, DocDisplayMetaProvider, TOOLBAR_CARD_VIEW, TOOLBAR_DELETE, TOOLBAR_EMBED_VIEW, TOOLBAR_INLINE_VIEW, toolbarActionLabel, } from '../../../affine-shared/services/index.js';
3
3
  import { cloneReferenceInfoWithoutAliases, isInsideBlockByFlavour, } from '../../../affine-shared/utils/index.js';
4
4
  import { DeleteIcon } from '@blocksuite/icons/lit';
5
5
  import { BlockSelection } from '../../../std/index.js';
@@ -38,12 +38,12 @@ export const builtinInlineReferenceToolbarConfig = {
38
38
  actions: [
39
39
  {
40
40
  id: 'inline',
41
- label: 'Inline view',
41
+ labelWording: TOOLBAR_INLINE_VIEW,
42
42
  disabled: true,
43
43
  },
44
44
  {
45
45
  id: 'card',
46
- label: 'Card view',
46
+ labelWording: TOOLBAR_CARD_VIEW,
47
47
  run(ctx) {
48
48
  const target = ctx.message$.peek()?.element;
49
49
  if (!(target instanceof AffineReference))
@@ -78,7 +78,7 @@ export const builtinInlineReferenceToolbarConfig = {
78
78
  },
79
79
  {
80
80
  id: 'embed',
81
- label: 'Embed view',
81
+ labelWording: TOOLBAR_EMBED_VIEW,
82
82
  disabled(ctx) {
83
83
  const target = ctx.message$.peek()?.element;
84
84
  if (!(target instanceof AffineReference))
@@ -140,7 +140,7 @@ export const builtinInlineReferenceToolbarConfig = {
140
140
  if (!(target instanceof AffineReference))
141
141
  return null;
142
142
  const actions = this.actions.map(action => ({ ...action }));
143
- const viewType$ = signal(actions[0].label);
143
+ const viewType$ = signal(toolbarActionLabel(ctx.std, actions[0]));
144
144
  const onToggle = (e) => {
145
145
  const opened = e.detail;
146
146
  if (!opened)
@@ -174,7 +174,7 @@ export const builtinInlineReferenceToolbarConfig = {
174
174
  {
175
175
  placement: ActionPlacement.More,
176
176
  id: 'c.delete',
177
- label: 'Delete',
177
+ labelWording: TOOLBAR_DELETE,
178
178
  icon: DeleteIcon(),
179
179
  variant: 'destructive',
180
180
  run(ctx) {
@@ -34,7 +34,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
34
34
  };
35
35
  import { whenHover } from '../../affine-components/hover/index.js';
36
36
  import { Peekable } from '../../affine-components/peek/index.js';
37
- import { DEFAULT_DOC_NAME, REFERENCE_NODE, } from '../../affine-shared/consts/index.js';
37
+ import { DEFAULT_DOC_NAME, REFERENCE_NODE } from '../../affine-shared/consts/index.js';
38
38
  import { DocDisplayMetaProvider, ToolbarRegistryIdentifier, } from '../../affine-shared/services/index.js';
39
39
  import { affineTextStyles } from '../../affine-shared/styles/index.js';
40
40
  import { cloneReferenceInfo, referenceToNode, } from '../../affine-shared/utils/index.js';
@@ -1,17 +1,50 @@
1
1
  import { ShapeElementModel } from '../shape/index.js';
2
2
  /**
3
- * The BPMN flow-object nodes shipped in v1. Each maps onto a native shape:
4
- * - `startEvent` / `endEvent` → an ellipse (thin green / thick red ring)
5
- * - `task` → a rounded rectangle with editable inner text
6
- * - `gatewayExclusive` → a diamond decorated with an X glyph
3
+ * The BPMN artefacts the pack draws — the **descriptive conformance subclass**
4
+ * of BPMN 2.0. Each maps onto a native shape, decorated by a glyph where the
5
+ * notation asks for one:
6
+ *
7
+ * - events (ellipse) — `startEvent` / `endEvent` plain, plus the message and
8
+ * timer starts and the message and terminate ends;
9
+ * - activities (rect) — `task` plain, plus the user and service tasks, the
10
+ * collapsed sub-process and the call activity;
11
+ * - gateways (diamond) — `gatewayExclusive` (X) and `gatewayParallel` (+);
12
+ * - data & artifacts — `dataObject`, `dataStore` and `textAnnotation`, whose
13
+ * silhouettes (folded page, cylinder, open bracket) are drawn by the glyph
14
+ * over a native rect with its own stroke and fill turned off;
15
+ * - `group` — a dashed rounded rectangle drawn AROUND things.
16
+ *
17
+ * `group` is the odd one and deliberately so. Every other kind is a node the
18
+ * process is made of; a group is a lasso somebody drew round part of it. The
19
+ * spec (BPMN 2.0.2 §10.4) exempts it from every connection and containment
20
+ * constraint there is — it cannot be attached to a sequence or message flow, it
21
+ * is not bounded by the pool or lane it overlaps, and it may straddle several
22
+ * pools at once. Nothing here has to enforce that, because a group is unfilled:
23
+ * it is hit near its border and on its label, so it never steals a click from
24
+ * what it encloses, and what it encloses never becomes its content.
25
+ *
26
+ * ## Compatibility
27
+ *
28
+ * This union is only ever WIDENED, and it is widened with new VALUES of the
29
+ * existing `kind` string field — no new field, no schema change, no migration
30
+ * and no backfill. The precedent is `wardley`'s (`gfx/wardley/src/roles.ts`):
31
+ * a process drawn before today carries one of the four original values, loads
32
+ * unchanged and paints exactly as it always did.
33
+ *
34
+ * The expanded (drilled-in) sub-process is deliberately NOT here: `subProcess`
35
+ * is the COLLAPSED representation only — a task-sized rectangle with the `+`
36
+ * marker. An expanded sub-process is a container with its own flow inside it,
37
+ * which is a containment model this pack does not have yet.
7
38
  */
8
- export type BpmnNodeKind = 'startEvent' | 'endEvent' | 'task' | 'gatewayExclusive';
39
+ export type BpmnNodeKind = 'startEvent' | 'startEventMessage' | 'startEventTimer' | 'endEvent' | 'endEventMessage' | 'endEventTerminate' | 'task' | 'taskUser' | 'taskService' | 'subProcess' | 'callActivity' | 'gatewayExclusive' | 'gatewayParallel' | 'dataObject' | 'dataStore' | 'textAnnotation' | 'group';
9
40
  /**
10
41
  * A BPMN flow-object node. Extends {@link ShapeElementModel} (a native shape)
11
42
  * so it inherits ALL shape behaviour — editable stroke width / colors, inner
12
43
  * text, native resize, the shape context toolbar — for free. `kind`
13
- * discriminates the four basics; only `gatewayExclusive` is decorated with a
14
- * glyph (the X) by the renderer (the others are plain native shapes).
44
+ * discriminates the artefacts and drives the RENDERING alone; what a node
45
+ * MEANS is the `role` stamped on it at creation (`gfx/bpmn/src/roles.ts`).
46
+ * The plain start event, end event and task are undecorated native shapes;
47
+ * every other kind is decorated with a glyph by the renderer.
15
48
  *
16
49
  * Mirrors {@link EdgyNodeElementModel}.
17
50
  */
@@ -38,8 +38,10 @@ import { ShapeElementModel } from '../shape/index.js';
38
38
  * A BPMN flow-object node. Extends {@link ShapeElementModel} (a native shape)
39
39
  * so it inherits ALL shape behaviour — editable stroke width / colors, inner
40
40
  * text, native resize, the shape context toolbar — for free. `kind`
41
- * discriminates the four basics; only `gatewayExclusive` is decorated with a
42
- * glyph (the X) by the renderer (the others are plain native shapes).
41
+ * discriminates the artefacts and drives the RENDERING alone; what a node
42
+ * MEANS is the `role` stamped on it at creation (`gfx/bpmn/src/roles.ts`).
43
+ * The plain start event, end event and task are undecorated native shapes;
44
+ * every other kind is decorated with a glyph by the renderer.
43
45
  *
44
46
  * Mirrors {@link EdgyNodeElementModel}.
45
47
  */
@@ -1,30 +1,148 @@
1
- import type { IVec, SerializedXYWH } from '../../../global/gfx/index.js';
2
- import { Bound } from '../../../global/gfx/index.js';
3
- import type { BaseElementProps } from '../../../std/gfx/index.js';
4
- import { GfxPrimitiveElementModel } from '../../../std/gfx/index.js';
5
- export type BpmnPoolProps = BaseElementProps & {
1
+ import type { SerializedXYWH } from '../../../global/gfx/index.js';
2
+ import type { PointTestOptions } from '../../../std/gfx/index.js';
3
+ import type { FrameworkBackgroundProps } from '../framework-background/index.js';
4
+ import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
5
+ /**
6
+ * Width of the participant band — the left margin strip the pool name is
7
+ * written up, in model units.
8
+ *
9
+ * Declared HERE, in the model, and re-exported by `@labre/affine-gfx-bpmn`
10
+ * rather than the other way round. The pool's own hit test needs it (a pool is
11
+ * clickable by its title bands as well as its border, the bpmn.io convention),
12
+ * and `affine-model` cannot reach into `affine-block-surface` where the
13
+ * declaration is resolved. One number, owned by the layer that both the
14
+ * declaration and the hit test can read.
15
+ */
16
+ export declare const POOL_BAND_WIDTH = 28;
17
+ /**
18
+ * Width of a lane's own title band — the strip immediately inside the
19
+ * participant band, with the lane name turned on its side.
20
+ *
21
+ * Four units narrower than {@link POOL_BAND_WIDTH}, and for the same reason the
22
+ * lane font is two points smaller: the two strips sit side by side, so the
23
+ * subordinate one has to say so. Identical widths read as a single 56-unit
24
+ * gutter rather than as a participant containing lanes, which is exactly the
25
+ * relationship the picture has to carry.
26
+ *
27
+ * NO fill, divider only — what bpmn.io, Camunda and Visio all draw.
28
+ */
29
+ export declare const POOL_LANE_BAND_WIDTH = 24;
30
+ /**
31
+ * One LANE (couloir) of a pool: a horizontal band the participant's own work is
32
+ * divided into — "Sales", "Back office", "Automated".
33
+ *
34
+ * The shape of a {@link BackgroundInstanceZoneItem} in
35
+ * `@labre/affine-block-surface`, and deliberately the same three fields: the
36
+ * primitive paints an instance partition from that structure, the audit reports
37
+ * it from that structure, and a lane that had a shape of its own would be a
38
+ * fourth place the two have to agree.
39
+ *
40
+ * `size` is a relative WEIGHT, not a height in model units: lanes share the
41
+ * plot in proportion to their sizes, so a pool dragged taller redistributes the
42
+ * extra space instead of leaving a gap under the last band. `2` reads as "twice
43
+ * the other one", which is the only thing a lane's height ever means.
44
+ */
45
+ export interface BpmnLane {
46
+ /** Stable id, generated at creation. Never the name: a lane can be renamed. */
47
+ id: string;
48
+ /** The lane name, written horizontally in its top-left corner. */
49
+ name?: string;
50
+ /** Relative weight — see above. Must be a finite number greater than zero. */
51
+ size: number;
52
+ }
53
+ export type BpmnPoolProps = FrameworkBackgroundProps & {
6
54
  /** The participant name shown in the left band — edited inline on dblclick. */
7
55
  name?: string;
8
- /** When false the resize handles are hidden — toggled from the toolbar. */
9
- resizeEnabled?: boolean;
56
+ /** The pool's own partition into lanes. Absent until the first one is added. */
57
+ lanes?: BpmnLane[];
10
58
  };
11
59
  /**
12
60
  * A BPMN "pool": a participant container drawn as a rounded-rect frame with a
13
- * vertical name band on the left. It is a background element (like the wardley
14
- * / cynefin backgrounds): the user drops flow-object nodes on top of it. Lanes
15
- * are deliberately out of scope for v1.
61
+ * vertical name band on the left. It is a framework background like every other
62
+ * one in the library — the user drops flow-object nodes on top of it, and a
63
+ * connector never snaps to it.
64
+ *
65
+ * The geometry of a passive canvas comes from
66
+ * {@link FrameworkBackgroundElementModel}: this class used to restate all five
67
+ * of those overrides verbatim, which is exactly the kind of copy that drifts.
68
+ * The persisted type is still `bpmnPool`, and the first four fields below are
69
+ * the four it has always written, in the same order, with the same defaults.
16
70
  *
17
- * Mirrors the other framework background elements.
71
+ * What it LOOKS like is declared, not coded: see `BPMN_POOL_BACKGROUND` in
72
+ * `@labre/affine-gfx-bpmn`.
18
73
  */
19
- export declare class BpmnPoolElementModel extends GfxPrimitiveElementModel<BpmnPoolProps> {
74
+ export declare class BpmnPoolElementModel extends FrameworkBackgroundElementModel<BpmnPoolProps> {
20
75
  get type(): string;
21
- get connectable(): boolean;
22
- containsBound(bounds: Bound): boolean;
23
- getLineIntersections(start: IVec, end: IVec): import("../../../global/gfx/index.js").PointLocation[] | null;
24
- getNearestPoint(point: IVec): IVec;
25
- includesPoint(x: number, y: number): boolean;
26
76
  accessor name: string;
27
77
  accessor resizeEnabled: boolean;
28
78
  accessor rotate: number;
29
79
  accessor xywh: SerializedXYWH;
80
+ /**
81
+ * The pool's own partition into lanes, in top-to-bottom order.
82
+ *
83
+ * The FIFTH field, and the only one that is optional. It mirrors
84
+ * `validationExceptions` on the base element model exactly, for the same three
85
+ * reasons:
86
+ *
87
+ * - **`undefined`, not `[]`.** `@field()`'s `init` writes nothing for an
88
+ * `undefined` default, so a pool that has no lane stays byte-identical to
89
+ * one created before this field existed: optional field, no schema version
90
+ * bump, no migration, and every document already on disk opens and paints
91
+ * exactly as it did (pinned by `pool-background.unit.spec.ts`, whose
92
+ * fixture carries no `lanes` key). Removing the last lane goes back through
93
+ * `clearField`, which deletes the KEY rather than leaving a phantom one.
94
+ * - **Flat JSON on purpose.** Element serialization is one level deep, and a
95
+ * value a Yjs update can encode is the contract `_assignElementProp`
96
+ * enforces. A nested `Y.Map` is what `tags` needs and this does not (see
97
+ * `docs/adr/0007`): a lane list is one atomic choice about how a single
98
+ * participant's own band is cut, authored by whoever is drawing the
99
+ * process — not an accumulating multi-key set different people qualify
100
+ * concurrently. The trade is stated so it is reviewed, not discovered:
101
+ * two peers reordering the lanes at the same moment resolve
102
+ * last-write-wins, one whole list winning over the other.
103
+ * - **Declared HERE and not on the base class.** A lane is a subdivision of a
104
+ * pool and of nothing else, and the accessor is what carries the value
105
+ * through a copy, a paste or a template insertion, so a duplicated pool
106
+ * arrives with its lanes.
107
+ *
108
+ * What it MEANS is declared, not coded: `BPMN_POOL_BACKGROUND.instanceZones`
109
+ * in `@labre/affine-gfx-bpmn` names this prop, and the framework-background
110
+ * primitive paints the dividers and the names from it.
111
+ */
112
+ accessor lanes: BpmnLane[] | undefined;
113
+ /**
114
+ * A pool is picked by its BORDER — and by its TITLE BANDS, which is the one
115
+ * carve-out the recette kept (issue #194).
116
+ *
117
+ * That is the bpmn.io convention, and it is the convention because the bands
118
+ * are the only part of a pool that is the pool rather than the process drawn
119
+ * on it: the participant strip on the left carries the participant's name,
120
+ * the lane strip beside it carries the lane names, and nothing is ever
121
+ * dropped on either. The flow area is where the work goes, so a click there
122
+ * belongs to whatever is under the pointer.
123
+ *
124
+ * ## Where the geometry comes from
125
+ *
126
+ * The two strips run the FULL height of the pool: the participant band is the
127
+ * whole left margin, and the lane bands partition that same height between
128
+ * them with no gap — so their union is one vertical strip
129
+ * `POOL_LANE_BAND_WIDTH` wide, whatever the lanes' individual weights are.
130
+ * Which means this test needs no lane arithmetic at all, only the two widths
131
+ * (declared above, and read from here by the framework declaration) and the
132
+ * answer to "does this pool have a usable lane".
133
+ *
134
+ * The zoom-grown rename targets — the touch-sized boxes a double-click aims
135
+ * at — are the VIEW's business and stay in `pool-hit.ts`; what is painted is
136
+ * what is selectable, which is the promise this test has to keep.
137
+ */
138
+ includesPoint(x: number, y: number, options?: PointTestOptions): boolean;
139
+ /**
140
+ * Whether at least one lane is drawn — the only thing the hit test needs to
141
+ * know about the partition.
142
+ *
143
+ * Mirrors what `backgroundInstanceZones` keeps (a string id, a finite size
144
+ * greater than zero): a malformed row is dropped there and paints no band, so
145
+ * it must not make a band clickable here either.
146
+ */
147
+ private get hasUsableLane();
30
148
  }
@@ -32,18 +32,51 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
32
32
  }
33
33
  return useValue ? value : void 0;
34
34
  };
35
- import { Bound, getPointsFromBoundWithRotation, linePolygonIntersects, pointInPolygon, polygonNearestPoint, } from '../../../global/gfx/index.js';
36
- import { field, GfxPrimitiveElementModel } from '../../../std/gfx/index.js';
35
+ import { rotatePoint } from '../../../global/gfx/index.js';
36
+ import { field } from '../../../std/gfx/index.js';
37
+ import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
38
+ /**
39
+ * Width of the participant band — the left margin strip the pool name is
40
+ * written up, in model units.
41
+ *
42
+ * Declared HERE, in the model, and re-exported by `@labre/affine-gfx-bpmn`
43
+ * rather than the other way round. The pool's own hit test needs it (a pool is
44
+ * clickable by its title bands as well as its border, the bpmn.io convention),
45
+ * and `affine-model` cannot reach into `affine-block-surface` where the
46
+ * declaration is resolved. One number, owned by the layer that both the
47
+ * declaration and the hit test can read.
48
+ */
49
+ export const POOL_BAND_WIDTH = 28;
50
+ /**
51
+ * Width of a lane's own title band — the strip immediately inside the
52
+ * participant band, with the lane name turned on its side.
53
+ *
54
+ * Four units narrower than {@link POOL_BAND_WIDTH}, and for the same reason the
55
+ * lane font is two points smaller: the two strips sit side by side, so the
56
+ * subordinate one has to say so. Identical widths read as a single 56-unit
57
+ * gutter rather than as a participant containing lanes, which is exactly the
58
+ * relationship the picture has to carry.
59
+ *
60
+ * NO fill, divider only — what bpmn.io, Camunda and Visio all draw.
61
+ */
62
+ export const POOL_LANE_BAND_WIDTH = 24;
37
63
  /**
38
64
  * A BPMN "pool": a participant container drawn as a rounded-rect frame with a
39
- * vertical name band on the left. It is a background element (like the wardley
40
- * / cynefin backgrounds): the user drops flow-object nodes on top of it. Lanes
41
- * are deliberately out of scope for v1.
65
+ * vertical name band on the left. It is a framework background like every other
66
+ * one in the library — the user drops flow-object nodes on top of it, and a
67
+ * connector never snaps to it.
68
+ *
69
+ * The geometry of a passive canvas comes from
70
+ * {@link FrameworkBackgroundElementModel}: this class used to restate all five
71
+ * of those overrides verbatim, which is exactly the kind of copy that drifts.
72
+ * The persisted type is still `bpmnPool`, and the first four fields below are
73
+ * the four it has always written, in the same order, with the same defaults.
42
74
  *
43
- * Mirrors the other framework background elements.
75
+ * What it LOOKS like is declared, not coded: see `BPMN_POOL_BACKGROUND` in
76
+ * `@labre/affine-gfx-bpmn`.
44
77
  */
45
78
  let BpmnPoolElementModel = (() => {
46
- let _classSuper = GfxPrimitiveElementModel;
79
+ let _classSuper = FrameworkBackgroundElementModel;
47
80
  let _name_decorators;
48
81
  let _name_initializers = [];
49
82
  let _name_extraInitializers = [];
@@ -56,6 +89,9 @@ let BpmnPoolElementModel = (() => {
56
89
  let _xywh_decorators;
57
90
  let _xywh_initializers = [];
58
91
  let _xywh_extraInitializers = [];
92
+ let _lanes_decorators;
93
+ let _lanes_initializers = [];
94
+ let _lanes_extraInitializers = [];
59
95
  return class BpmnPoolElementModel extends _classSuper {
60
96
  static {
61
97
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
@@ -63,33 +99,17 @@ let BpmnPoolElementModel = (() => {
63
99
  _resizeEnabled_decorators = [field(true)];
64
100
  _rotate_decorators = [field(0)];
65
101
  _xywh_decorators = [field()];
102
+ _lanes_decorators = [field()];
66
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);
67
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);
68
105
  __esDecorate(this, null, _rotate_decorators, { kind: "accessor", name: "rotate", static: false, private: false, access: { has: obj => "rotate" in obj, get: obj => obj.rotate, set: (obj, value) => { obj.rotate = value; } }, metadata: _metadata }, _rotate_initializers, _rotate_extraInitializers);
69
106
  __esDecorate(this, null, _xywh_decorators, { kind: "accessor", name: "xywh", static: false, private: false, access: { has: obj => "xywh" in obj, get: obj => obj.xywh, set: (obj, value) => { obj.xywh = value; } }, metadata: _metadata }, _xywh_initializers, _xywh_extraInitializers);
107
+ __esDecorate(this, null, _lanes_decorators, { kind: "accessor", name: "lanes", static: false, private: false, access: { has: obj => "lanes" in obj, get: obj => obj.lanes, set: (obj, value) => { obj.lanes = value; } }, metadata: _metadata }, _lanes_initializers, _lanes_extraInitializers);
70
108
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
71
109
  }
72
110
  get type() {
73
111
  return 'bpmnPool';
74
112
  }
75
- get connectable() {
76
- return false;
77
- }
78
- containsBound(bounds) {
79
- const points = getPointsFromBoundWithRotation(this);
80
- return points.some(point => bounds.containsPoint(point));
81
- }
82
- getLineIntersections(start, end) {
83
- const points = getPointsFromBoundWithRotation(this);
84
- return linePolygonIntersects(start, end, points);
85
- }
86
- getNearestPoint(point) {
87
- return polygonNearestPoint(Bound.deserialize(this.xywh).points, point);
88
- }
89
- includesPoint(x, y) {
90
- const points = getPointsFromBoundWithRotation(this);
91
- return pointInPolygon([x, y], points);
92
- }
93
113
  #name_accessor_storage = __runInitializers(this, _name_initializers, 'Pool');
94
114
  get name() { return this.#name_accessor_storage; }
95
115
  set name(value) { this.#name_accessor_storage = value; }
@@ -102,9 +122,111 @@ let BpmnPoolElementModel = (() => {
102
122
  #xywh_accessor_storage = (__runInitializers(this, _rotate_extraInitializers), __runInitializers(this, _xywh_initializers, '[0,0,560,200]'));
103
123
  get xywh() { return this.#xywh_accessor_storage; }
104
124
  set xywh(value) { this.#xywh_accessor_storage = value; }
125
+ #lanes_accessor_storage = (__runInitializers(this, _xywh_extraInitializers), __runInitializers(this, _lanes_initializers, undefined));
126
+ /**
127
+ * The pool's own partition into lanes, in top-to-bottom order.
128
+ *
129
+ * The FIFTH field, and the only one that is optional. It mirrors
130
+ * `validationExceptions` on the base element model exactly, for the same three
131
+ * reasons:
132
+ *
133
+ * - **`undefined`, not `[]`.** `@field()`'s `init` writes nothing for an
134
+ * `undefined` default, so a pool that has no lane stays byte-identical to
135
+ * one created before this field existed: optional field, no schema version
136
+ * bump, no migration, and every document already on disk opens and paints
137
+ * exactly as it did (pinned by `pool-background.unit.spec.ts`, whose
138
+ * fixture carries no `lanes` key). Removing the last lane goes back through
139
+ * `clearField`, which deletes the KEY rather than leaving a phantom one.
140
+ * - **Flat JSON on purpose.** Element serialization is one level deep, and a
141
+ * value a Yjs update can encode is the contract `_assignElementProp`
142
+ * enforces. A nested `Y.Map` is what `tags` needs and this does not (see
143
+ * `docs/adr/0007`): a lane list is one atomic choice about how a single
144
+ * participant's own band is cut, authored by whoever is drawing the
145
+ * process — not an accumulating multi-key set different people qualify
146
+ * concurrently. The trade is stated so it is reviewed, not discovered:
147
+ * two peers reordering the lanes at the same moment resolve
148
+ * last-write-wins, one whole list winning over the other.
149
+ * - **Declared HERE and not on the base class.** A lane is a subdivision of a
150
+ * pool and of nothing else, and the accessor is what carries the value
151
+ * through a copy, a paste or a template insertion, so a duplicated pool
152
+ * arrives with its lanes.
153
+ *
154
+ * What it MEANS is declared, not coded: `BPMN_POOL_BACKGROUND.instanceZones`
155
+ * in `@labre/affine-gfx-bpmn` names this prop, and the framework-background
156
+ * primitive paints the dividers and the names from it.
157
+ */
158
+ get lanes() { return this.#lanes_accessor_storage; }
159
+ set lanes(value) { this.#lanes_accessor_storage = value; }
160
+ /**
161
+ * A pool is picked by its BORDER — and by its TITLE BANDS, which is the one
162
+ * carve-out the recette kept (issue #194).
163
+ *
164
+ * That is the bpmn.io convention, and it is the convention because the bands
165
+ * are the only part of a pool that is the pool rather than the process drawn
166
+ * on it: the participant strip on the left carries the participant's name,
167
+ * the lane strip beside it carries the lane names, and nothing is ever
168
+ * dropped on either. The flow area is where the work goes, so a click there
169
+ * belongs to whatever is under the pointer.
170
+ *
171
+ * ## Where the geometry comes from
172
+ *
173
+ * The two strips run the FULL height of the pool: the participant band is the
174
+ * whole left margin, and the lane bands partition that same height between
175
+ * them with no gap — so their union is one vertical strip
176
+ * `POOL_LANE_BAND_WIDTH` wide, whatever the lanes' individual weights are.
177
+ * Which means this test needs no lane arithmetic at all, only the two widths
178
+ * (declared above, and read from here by the framework declaration) and the
179
+ * answer to "does this pool have a usable lane".
180
+ *
181
+ * The zoom-grown rename targets — the touch-sized boxes a double-click aims
182
+ * at — are the VIEW's business and stay in `pool-hit.ts`; what is painted is
183
+ * what is selectable, which is the promise this test has to keep.
184
+ */
185
+ includesPoint(x, y, options) {
186
+ if (super.includesPoint(x, y, options))
187
+ return true;
188
+ const [ex, ey, w, h] = this.deserializedXYWH;
189
+ // Element-local coordinates, undoing the element rotation about its centre
190
+ // — the bands are axis-aligned inside the pool, not on the canvas.
191
+ let lx = x - ex;
192
+ let ly = y - ey;
193
+ const rotate = this.rotate ?? 0;
194
+ if (rotate) {
195
+ const [ux, uy] = rotatePoint([x, y], [ex + w / 2, ey + h / 2], -rotate);
196
+ lx = ux - ex;
197
+ ly = uy - ey;
198
+ }
199
+ if (ly < 0 || ly > h || lx < 0)
200
+ return false;
201
+ // Clamped to a pool narrower than its own margin — the degenerate case the
202
+ // renderer clamps too.
203
+ const band = Math.min(POOL_BAND_WIDTH, w);
204
+ const lanes = this.hasUsableLane
205
+ ? Math.min(POOL_LANE_BAND_WIDTH, w - band)
206
+ : 0;
207
+ return lx <= band + Math.max(lanes, 0);
208
+ }
209
+ /**
210
+ * Whether at least one lane is drawn — the only thing the hit test needs to
211
+ * know about the partition.
212
+ *
213
+ * Mirrors what `backgroundInstanceZones` keeps (a string id, a finite size
214
+ * greater than zero): a malformed row is dropped there and paints no band, so
215
+ * it must not make a band clickable here either.
216
+ */
217
+ get hasUsableLane() {
218
+ const lanes = this.lanes;
219
+ if (!Array.isArray(lanes))
220
+ return false;
221
+ return lanes.some(lane => typeof lane?.id === 'string' &&
222
+ lane.id !== '' &&
223
+ typeof lane.size === 'number' &&
224
+ Number.isFinite(lane.size) &&
225
+ lane.size > 0);
226
+ }
105
227
  constructor() {
106
228
  super(...arguments);
107
- __runInitializers(this, _xywh_extraInitializers);
229
+ __runInitializers(this, _lanes_extraInitializers);
108
230
  }
109
231
  };
110
232
  })();