@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
@@ -0,0 +1,103 @@
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
34
+ };
35
+ import { field } from '../../../std/gfx/index.js';
36
+ import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
37
+ /**
38
+ * The Event Storming board: the paper roll a Big Picture is stormed on.
39
+ *
40
+ * One axis and nothing else — TIME, running left to right along the bottom.
41
+ * That is the whole frame of reference Event Storming has: an event drawn to
42
+ * the left of another happened before it, and how HIGH a sticky sits means
43
+ * nothing at all (the vertical is where a workshop parks its unknowns, not a
44
+ * scale). Declaring the one axis and no zones is therefore the honest
45
+ * declaration, and it is what lets `es.against-timeline` say "this flow runs
46
+ * backwards" without inventing a second dimension nobody drew against.
47
+ *
48
+ * **Swimlanes are cut from v1** (plan § Coupes v1). A lane is a horizontal
49
+ * BAND with a name, which on this element would be a variant declaration
50
+ * (`variantProp: 'lanes'`) and a rule family that measures membership per lane.
51
+ * Neither exists yet, and shipping half of it — bands that paint but that no
52
+ * rule can read — would put a semantic on the vertical the framework does not
53
+ * have. The v2 note lives here so the day lanes land, the reason they were not
54
+ * here is on the record.
55
+ *
56
+ * Adds no field of its own beyond the primitive's `resizeEnabled`, so a board
57
+ * is byte-identical to what {@link FrameworkBackgroundElementModel} already
58
+ * persists. It is created 3200 × 1400 — a Big Picture is WIDE, because the
59
+ * timeline is the point — and freely resizable in both directions: the roll
60
+ * grows sideways all morning as events are remembered, and locking its
61
+ * proportion would fight the hand.
62
+ */
63
+ let EventStormingBoardElementModel = (() => {
64
+ let _classSuper = FrameworkBackgroundElementModel;
65
+ let _resizeEnabled_decorators;
66
+ let _resizeEnabled_initializers = [];
67
+ let _resizeEnabled_extraInitializers = [];
68
+ let _rotate_decorators;
69
+ let _rotate_initializers = [];
70
+ let _rotate_extraInitializers = [];
71
+ let _xywh_decorators;
72
+ let _xywh_initializers = [];
73
+ let _xywh_extraInitializers = [];
74
+ return class EventStormingBoardElementModel extends _classSuper {
75
+ static {
76
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
77
+ _resizeEnabled_decorators = [field(true)];
78
+ _rotate_decorators = [field(0)];
79
+ _xywh_decorators = [field()];
80
+ __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);
81
+ __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);
82
+ __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);
83
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
84
+ }
85
+ get type() {
86
+ return 'eventStorming';
87
+ }
88
+ #resizeEnabled_accessor_storage = __runInitializers(this, _resizeEnabled_initializers, true);
89
+ get resizeEnabled() { return this.#resizeEnabled_accessor_storage; }
90
+ set resizeEnabled(value) { this.#resizeEnabled_accessor_storage = value; }
91
+ #rotate_accessor_storage = (__runInitializers(this, _resizeEnabled_extraInitializers), __runInitializers(this, _rotate_initializers, 0));
92
+ get rotate() { return this.#rotate_accessor_storage; }
93
+ set rotate(value) { this.#rotate_accessor_storage = value; }
94
+ #xywh_accessor_storage = (__runInitializers(this, _rotate_extraInitializers), __runInitializers(this, _xywh_initializers, '[0,0,3200,1400]'));
95
+ get xywh() { return this.#xywh_accessor_storage; }
96
+ set xywh(value) { this.#xywh_accessor_storage = value; }
97
+ constructor() {
98
+ super(...arguments);
99
+ __runInitializers(this, _xywh_extraInitializers);
100
+ }
101
+ };
102
+ })();
103
+ export { EventStormingBoardElementModel };
@@ -0,0 +1 @@
1
+ export * from './event-storming.js';
@@ -0,0 +1 @@
1
+ export * from './event-storming.js';
@@ -1,6 +1,6 @@
1
1
  import type { IVec } from '../../../global/gfx/index.js';
2
2
  import { Bound } from '../../../global/gfx/index.js';
3
- import type { BaseElementProps } from '../../../std/gfx/index.js';
3
+ import type { BaseElementProps, PointTestOptions } from '../../../std/gfx/index.js';
4
4
  import { GfxPrimitiveElementModel } from '../../../std/gfx/index.js';
5
5
  /**
6
6
  * The props every framework background carries, whatever it draws.
@@ -38,5 +38,10 @@ export declare abstract class FrameworkBackgroundElementModel<Props extends Base
38
38
  containsBound(bounds: Bound): boolean;
39
39
  getLineIntersections(start: IVec, end: IVec): import("../../../global/gfx/index.js").PointLocation[] | null;
40
40
  getNearestPoint(point: IVec): IVec;
41
- includesPoint(x: number, y: number): boolean;
41
+ /**
42
+ * Picked by its BORDER band, not by its whole area — see
43
+ * {@link backgroundIncludesPoint} for the why and for what a caller asking
44
+ * about the visible extent (`ignoreTransparent: false`) still gets.
45
+ */
46
+ includesPoint(x: number, y: number, options?: PointTestOptions): boolean;
42
47
  }
@@ -1,5 +1,6 @@
1
- import { Bound, getPointsFromBoundWithRotation, linePolygonIntersects, pointInPolygon, polygonNearestPoint, } from '../../../global/gfx/index.js';
1
+ import { Bound, getPointsFromBoundWithRotation, linePolygonIntersects, polygonNearestPoint, } from '../../../global/gfx/index.js';
2
2
  import { GfxPrimitiveElementModel } from '../../../std/gfx/index.js';
3
+ import { backgroundIncludesPoint } from './hit-test.js';
3
4
  /**
4
5
  * The MODEL half of the framework-background primitive (PF2.1).
5
6
  *
@@ -35,8 +36,12 @@ export class FrameworkBackgroundElementModel extends GfxPrimitiveElementModel {
35
36
  getNearestPoint(point) {
36
37
  return polygonNearestPoint(Bound.deserialize(this.xywh).points, point);
37
38
  }
38
- includesPoint(x, y) {
39
- const points = getPointsFromBoundWithRotation(this);
40
- return pointInPolygon([x, y], points);
39
+ /**
40
+ * Picked by its BORDER band, not by its whole area — see
41
+ * {@link backgroundIncludesPoint} for the why and for what a caller asking
42
+ * about the visible extent (`ignoreTransparent: false`) still gets.
43
+ */
44
+ includesPoint(x, y, options) {
45
+ return backgroundIncludesPoint(this, x, y, options);
41
46
  }
42
47
  }
@@ -0,0 +1,48 @@
1
+ import type { IBound } from '../../../global/gfx/index.js';
2
+ import type { PointTestOptions } from '../../../std/gfx/index.js';
3
+ /**
4
+ * The width of the band a background is picked by, in SCREEN pixels.
5
+ *
6
+ * Ten is what every caller on the picking path already asks for
7
+ * (`getElementByPoint`, the default tool, the gfx view event handler all pass
8
+ * `hitThreshold: 10`); naming it here gives the one caller that passes nothing
9
+ * — the frame manager, which calls `includesPoint(x, y, {})` — the same band
10
+ * instead of a shape's 1-pixel default.
11
+ */
12
+ export declare const BACKGROUND_BORDER_HIT_THRESHOLD = 10;
13
+ /**
14
+ * Whether a point picks a framework background — THE hit test every background
15
+ * in the library shares.
16
+ *
17
+ * ## A background is picked by its border, not by its area
18
+ *
19
+ * A background is a passive canvas: the user drops nodes onto it and works on
20
+ * THEM. A hit test over the whole rectangle makes the backdrop compete with its
21
+ * own content for every click — it wins outright when it sits above in the
22
+ * paint order (`getElementByPoint` keeps the topmost hit), and it fills every
23
+ * gap when it sits below (the interior of an unfilled shape, the space beside a
24
+ * small node). Both were reported from the same recette (issue #194).
25
+ *
26
+ * So the band IS the affordance: within `hitThreshold` screen pixels of the
27
+ * (rotated) outline, and nowhere else. The threshold is divided by the zoom for
28
+ * the reason every shape divides it — a border band has to stay the same width
29
+ * under the pointer whatever the viewport is doing.
30
+ *
31
+ * ## The interior still answers "is the pointer on this element"
32
+ *
33
+ * `ignoreTransparent: false` is the existing way a caller says it is asking
34
+ * about the element's visible EXTENT rather than about what a click would pick
35
+ * — an unfilled shape answers the same two ways for the same reason
36
+ * (`rect.includesPoint`). Exactly two callers pass it: the default tool, which
37
+ * uses it to decide whether a press on an ALREADY-SELECTED element starts a
38
+ * move, and the connector manager, which never sees a background at all
39
+ * (`connectable` is false). So a selected background keeps being dragged from
40
+ * anywhere inside it, and only picking changed.
41
+ *
42
+ * ## What did NOT change
43
+ *
44
+ * `containsBound` / `intersectsBound` (the lasso), `getNearestPoint` and
45
+ * `getLineIntersections` are untouched: a rubber band that had to graze the
46
+ * outline would be a second regression dressed as a fix.
47
+ */
48
+ export declare function backgroundIncludesPoint(bounds: IBound, x: number, y: number, options?: PointTestOptions): boolean;
@@ -0,0 +1,55 @@
1
+ import { getPointsFromBoundWithRotation, pointInPolygon, pointOnPolygonStoke, } from '../../../global/gfx/index.js';
2
+ /**
3
+ * The width of the band a background is picked by, in SCREEN pixels.
4
+ *
5
+ * Ten is what every caller on the picking path already asks for
6
+ * (`getElementByPoint`, the default tool, the gfx view event handler all pass
7
+ * `hitThreshold: 10`); naming it here gives the one caller that passes nothing
8
+ * — the frame manager, which calls `includesPoint(x, y, {})` — the same band
9
+ * instead of a shape's 1-pixel default.
10
+ */
11
+ export const BACKGROUND_BORDER_HIT_THRESHOLD = 10;
12
+ /**
13
+ * Whether a point picks a framework background — THE hit test every background
14
+ * in the library shares.
15
+ *
16
+ * ## A background is picked by its border, not by its area
17
+ *
18
+ * A background is a passive canvas: the user drops nodes onto it and works on
19
+ * THEM. A hit test over the whole rectangle makes the backdrop compete with its
20
+ * own content for every click — it wins outright when it sits above in the
21
+ * paint order (`getElementByPoint` keeps the topmost hit), and it fills every
22
+ * gap when it sits below (the interior of an unfilled shape, the space beside a
23
+ * small node). Both were reported from the same recette (issue #194).
24
+ *
25
+ * So the band IS the affordance: within `hitThreshold` screen pixels of the
26
+ * (rotated) outline, and nowhere else. The threshold is divided by the zoom for
27
+ * the reason every shape divides it — a border band has to stay the same width
28
+ * under the pointer whatever the viewport is doing.
29
+ *
30
+ * ## The interior still answers "is the pointer on this element"
31
+ *
32
+ * `ignoreTransparent: false` is the existing way a caller says it is asking
33
+ * about the element's visible EXTENT rather than about what a click would pick
34
+ * — an unfilled shape answers the same two ways for the same reason
35
+ * (`rect.includesPoint`). Exactly two callers pass it: the default tool, which
36
+ * uses it to decide whether a press on an ALREADY-SELECTED element starts a
37
+ * move, and the connector manager, which never sees a background at all
38
+ * (`connectable` is false). So a selected background keeps being dragged from
39
+ * anywhere inside it, and only picking changed.
40
+ *
41
+ * ## What did NOT change
42
+ *
43
+ * `containsBound` / `intersectsBound` (the lasso), `getNearestPoint` and
44
+ * `getLineIntersections` are untouched: a rubber band that had to graze the
45
+ * outline would be a second regression dressed as a fix.
46
+ */
47
+ export function backgroundIncludesPoint(bounds, x, y, options) {
48
+ const point = [x, y];
49
+ const points = getPointsFromBoundWithRotation(bounds);
50
+ const threshold = (options?.hitThreshold ?? BACKGROUND_BORDER_HIT_THRESHOLD) /
51
+ (options?.zoom ?? 1);
52
+ if (pointOnPolygonStoke(point, points, threshold))
53
+ return true;
54
+ return options?.ignoreTransparent === false && pointInPolygon(point, points);
55
+ }
@@ -1 +1,2 @@
1
1
  export * from './background.js';
2
+ export * from './hit-test.js';
@@ -1 +1,2 @@
1
1
  export * from './background.js';
2
+ export * from './hit-test.js';
@@ -1,8 +1,11 @@
1
1
  import type { EdgelessTextBlockModel } from '../blocks/edgeless-text/edgeless-text-model.js';
2
2
  import type { BpmnNodeElementModel, BpmnPoolElementModel } from './bpmn/index.js';
3
3
  import type { BrushElementModel } from './brush/index.js';
4
+ import type { C4BoardElementModel, C4BoundaryElementModel, C4NodeElementModel } from './c4/index.js';
4
5
  import type { ConnectorElementModel } from './connector/index.js';
6
+ import type { ContextMapBoardElementModel } from './context-map/index.js';
5
7
  import type { CoreDomainChartElementModel } from './core-domain/index.js';
8
+ import type { EventStormingBoardElementModel } from './event-storming/index.js';
6
9
  import type { EdgyBoardElementModel, EdgyFacetsElementModel, EdgyNodeElementModel } from './edgy/index.js';
7
10
  import type { CynefinElementModel } from './cynefin/index.js';
8
11
  import type { EstuarineElementModel } from './estuarine/index.js';
@@ -14,11 +17,14 @@ import type { TextElementModel } from './text/index.js';
14
17
  import type { WardleyBackgroundElementModel, WardleyNodeElementModel } from './wardley/index.js';
15
18
  export * from './bpmn/index.js';
16
19
  export * from './brush/index.js';
20
+ export * from './c4/index.js';
17
21
  export * from './connector/index.js';
22
+ export * from './context-map/index.js';
18
23
  export * from './core-domain/index.js';
19
24
  export * from './cynefin/index.js';
20
25
  export * from './edgy/index.js';
21
26
  export * from './estuarine/index.js';
27
+ export * from './event-storming/index.js';
22
28
  export * from './framework-background/index.js';
23
29
  export * from './group/index.js';
24
30
  export * from './highlighter/index.js';
@@ -30,6 +36,9 @@ export type SurfaceElementModelMap = {
30
36
  bpmnNode: BpmnNodeElementModel;
31
37
  bpmnPool: BpmnPoolElementModel;
32
38
  brush: BrushElementModel;
39
+ c4Board: C4BoardElementModel;
40
+ c4Boundary: C4BoundaryElementModel;
41
+ c4Node: C4NodeElementModel;
33
42
  highlighter: HighlighterElementModel;
34
43
  connector: ConnectorElementModel;
35
44
  group: GroupElementModel;
@@ -44,6 +53,8 @@ export type SurfaceElementModelMap = {
44
53
  cynefin: CynefinElementModel;
45
54
  estuarine: EstuarineElementModel;
46
55
  coreDomain: CoreDomainChartElementModel;
56
+ contextMap: ContextMapBoardElementModel;
57
+ eventStorming: EventStormingBoardElementModel;
47
58
  };
48
59
  export type SurfaceTextModelMap = {
49
60
  text: TextElementModel;
@@ -1,10 +1,13 @@
1
1
  export * from './bpmn/index.js';
2
2
  export * from './brush/index.js';
3
+ export * from './c4/index.js';
3
4
  export * from './connector/index.js';
5
+ export * from './context-map/index.js';
4
6
  export * from './core-domain/index.js';
5
7
  export * from './cynefin/index.js';
6
8
  export * from './edgy/index.js';
7
9
  export * from './estuarine/index.js';
10
+ export * from './event-storming/index.js';
8
11
  export * from './framework-background/index.js';
9
12
  export * from './group/index.js';
10
13
  export * from './highlighter/index.js';
@@ -213,14 +213,8 @@ function pointOnBezierGeometry(element, px, py, hitThreshold) {
213
213
  const mt2 = mt * mt;
214
214
  const t2 = t * t;
215
215
  // Cubic Bezier: B(t) = (1-t)^3*P0 + 3(1-t)^2*t*P1 + 3(1-t)*t^2*P2 + t^3*P3
216
- const bx = mt2 * mt * cx +
217
- 3 * mt2 * t * cp1x +
218
- 3 * mt * t2 * cp2x +
219
- t2 * t * nx;
220
- const by = mt2 * mt * cy +
221
- 3 * mt2 * t * cp1y +
222
- 3 * mt * t2 * cp2y +
223
- t2 * t * ny;
216
+ const bx = mt2 * mt * cx + 3 * mt2 * t * cp1x + 3 * mt * t2 * cp2x + t2 * t * nx;
217
+ const by = mt2 * mt * cy + 3 * mt2 * t * cp1y + 3 * mt * t2 * cp2y + t2 * t * ny;
224
218
  const dbx = px - bx;
225
219
  const dby = py - by;
226
220
  if (dbx * dbx + dby * dby <= hitDistSq)
@@ -1,4 +1,4 @@
1
- import { createIdentifier, } from '../../../global/di/index.js';
1
+ import { createIdentifier } from '../../../global/di/index.js';
2
2
  export const BlockHtmlAdapterMatcherIdentifier = createIdentifier('BlockHtmlAdapterMatcher');
3
3
  export function BlockHtmlAdapterExtension(matcher) {
4
4
  const identifier = BlockHtmlAdapterMatcherIdentifier(matcher.flavour);
@@ -1,4 +1,4 @@
1
- import { createIdentifier, } from '../../../global/di/index.js';
1
+ import { createIdentifier } from '../../../global/di/index.js';
2
2
  export const BlockMarkdownAdapterMatcherIdentifier = createIdentifier('BlockMarkdownAdapterMatcher');
3
3
  export function BlockMarkdownAdapterExtension(matcher) {
4
4
  const identifier = BlockMarkdownAdapterMatcherIdentifier(matcher.flavour);
@@ -1,4 +1,4 @@
1
- import { createIdentifier, } from '../../../global/di/index.js';
1
+ import { createIdentifier } from '../../../global/di/index.js';
2
2
  import rehypeParse from 'rehype-parse';
3
3
  import { unified } from 'unified';
4
4
  import { rehypeInlineToBlock, rehypeWrapInlineElements, } from '../html/rehype-plugins/index.js';
@@ -1,4 +1,4 @@
1
- import { createIdentifier, } from '../../../global/di/index.js';
1
+ import { createIdentifier } from '../../../global/di/index.js';
2
2
  export const BlockNotionHtmlAdapterMatcherIdentifier = createIdentifier('BlockNotionHtmlAdapterMatcher');
3
3
  export function BlockNotionHtmlAdapterExtension(matcher) {
4
4
  const identifier = BlockNotionHtmlAdapterMatcherIdentifier(matcher.flavour);
@@ -1,4 +1,4 @@
1
- import { createIdentifier, } from '../../../global/di/index.js';
1
+ import { createIdentifier } from '../../../global/di/index.js';
2
2
  import isEqual from 'lodash-es/isEqual.js';
3
3
  import { DeltaASTConverter, } from '../types/delta-converter.js';
4
4
  export const NotionHtmlASTToDeltaMatcherIdentifier = createIdentifier('NotionHtmlASTToDeltaMatcher');
@@ -1,4 +1,4 @@
1
- import { createIdentifier, } from '../../../global/di/index.js';
1
+ import { createIdentifier } from '../../../global/di/index.js';
2
2
  export const BlockPlainTextAdapterMatcherIdentifier = createIdentifier('BlockPlainTextAdapterMatcher');
3
3
  export function BlockPlainTextAdapterExtension(matcher) {
4
4
  const identifier = BlockPlainTextAdapterMatcherIdentifier(matcher.flavour);
@@ -1,4 +1,4 @@
1
- import { createIdentifier, } from '../../../global/di/index.js';
1
+ import { createIdentifier } from '../../../global/di/index.js';
2
2
  import { DeltaASTConverter, } from '../types/delta-converter.js';
3
3
  export const InlineDeltaToPlainTextAdapterMatcherIdentifier = createIdentifier('InlineDeltaToPlainTextAdapterMatcher');
4
4
  export function InlineDeltaToPlainTextAdapterExtension(matcher) {
@@ -56,7 +56,9 @@ const parseHex = (value) => {
56
56
  const hex = value.slice(1);
57
57
  if (!/^[0-9a-f]+$/i.test(hex))
58
58
  return null;
59
- const expand = (part) => part.length === 1 ? Number.parseInt(part + part, 16) : Number.parseInt(part, 16);
59
+ const expand = (part) => part.length === 1
60
+ ? Number.parseInt(part + part, 16)
61
+ : Number.parseInt(part, 16);
60
62
  const size = hex.length === 3 || hex.length === 4 ? 1 : 2;
61
63
  if (hex.length !== size * 3 && hex.length !== size * 4)
62
64
  return null;
@@ -234,7 +236,8 @@ export const resolveNearestSupportedColor = (color) => {
234
236
  const target = rgbToOklab(parsed);
235
237
  const achromatic = target.chroma < ACHROMATIC_CHROMA_THRESHOLD;
236
238
  if (achromatic &&
237
- (target.l < DEFAULT_TEXT_LIGHTNESS_MIN || target.l > DEFAULT_TEXT_LIGHTNESS_MAX)) {
239
+ (target.l < DEFAULT_TEXT_LIGHTNESS_MIN ||
240
+ target.l > DEFAULT_TEXT_LIGHTNESS_MAX)) {
238
241
  return null;
239
242
  }
240
243
  let nearest;
@@ -1,4 +1,4 @@
1
- import { toDraftModel, } from '../../../store/index.js';
1
+ import { toDraftModel } from '../../../store/index.js';
2
2
  export const draftSelectedModelsCommand = (ctx, next) => {
3
3
  const models = ctx.selectedModels;
4
4
  if (!models) {
@@ -1,4 +1,4 @@
1
- import { TextSelection, } from '../../../std/index.js';
1
+ import { TextSelection } from '../../../std/index.js';
2
2
  /**
3
3
  * Focus the end of the block
4
4
  * @param focusBlock - The block to focus
@@ -1,4 +1,4 @@
1
- import { TextSelection, } from '../../../std/index.js';
1
+ import { TextSelection } from '../../../std/index.js';
2
2
  export const focusBlockStart = (ctx, next) => {
3
3
  const { focusBlock, std } = ctx;
4
4
  if (!focusBlock || !focusBlock.model.text)
@@ -4,6 +4,16 @@ export declare const EDGELESS_BLOCK_CHILD_PADDING = 24;
4
4
  export declare const EDGELESS_BLOCK_CHILD_BORDER_WIDTH = 2;
5
5
  export declare const PAGE_HEADER_HEIGHT = 53;
6
6
  export declare const EMBED_CARD_MIN_WIDTH = 450;
7
+ /**
8
+ * The smallest a thing you TAP may be, in CSS pixels.
9
+ *
10
+ * 44 is the figure both platform guidelines settle on (WCAG 2.2's target-size
11
+ * criterion asks for 24, which is a floor for a mouse, not a finger). Labre's
12
+ * boards are worked on a tablet in a workshop as often as on a laptop, so any
13
+ * list a user picks from — the artefact catalogue's rows are the first — sizes
14
+ * its rows from here rather than from whatever looked right in a screenshot.
15
+ */
16
+ export declare const TOUCH_TARGET_MIN_PX = 44;
7
17
  export declare const EMBED_CARD_WIDTH: Record<EmbedCardStyle, number>;
8
18
  export declare const EMBED_CARD_HEIGHT: Record<EmbedCardStyle, number>;
9
19
  export declare const EMBED_BLOCK_FLAVOUR_LIST: readonly ["affine:embed-github", "affine:embed-youtube", "affine:embed-figma", "affine:embed-linked-doc", "affine:embed-synced-doc", "affine:embed-html", "affine:embed-loom"];
@@ -6,6 +6,16 @@ export const EDGELESS_BLOCK_CHILD_BORDER_WIDTH = 2;
6
6
  // In AFFiNE, to avoid the option element to be covered by the header, we need to reserve the space for the header
7
7
  export const PAGE_HEADER_HEIGHT = 53;
8
8
  export const EMBED_CARD_MIN_WIDTH = 450;
9
+ /**
10
+ * The smallest a thing you TAP may be, in CSS pixels.
11
+ *
12
+ * 44 is the figure both platform guidelines settle on (WCAG 2.2's target-size
13
+ * criterion asks for 24, which is a floor for a mouse, not a finger). Labre's
14
+ * boards are worked on a tablet in a workshop as often as on a laptop, so any
15
+ * list a user picks from — the artefact catalogue's rows are the first — sizes
16
+ * its rows from here rather than from whatever looked right in a screenshot.
17
+ */
18
+ export const TOUCH_TARGET_MIN_PX = 44;
9
19
  export const EMBED_CARD_WIDTH = {
10
20
  horizontal: 752,
11
21
  horizontalThin: 752,
@@ -0,0 +1,55 @@
1
+ import type { CommandOwner } from '../../std/index.js';
2
+ import type { ExtensionType } from '../../store/index.js';
3
+ /**
4
+ * Consumer 2 of `docs/adr/0008`: the "more artefacts" sidepanel, which shows an
5
+ * owner's WHOLE `'catalogue'` surface by sub-category once its senior sub-menu
6
+ * has stopped being able to.
7
+ *
8
+ * The seam had to exist before either end of it, because the senior menu is
9
+ * what opens it — `selectSeniorMenuCommands` reports an overflow, the menu
10
+ * grows a trailing button, and that button needs somewhere to send the click.
11
+ * The library now ships the panel that answers by default
12
+ * (`edgeless-artefact-catalogue-widget`, registered next to the toolbar
13
+ * widget), and the menu still renders the button only when this provider
14
+ * answers — so an assembly that overrode the provider away shows no control
15
+ * that opens nothing.
16
+ *
17
+ * The contract is two verbs on purpose. Everything the panel needs to draw
18
+ * itself is already enumerable from the command registry
19
+ * (`getCommandsForSurface(std, owner, 'catalogue')`), so the seam carries the
20
+ * OWNER and nothing else — no list of entries, no open state, no rendering.
21
+ * That is what lets the two implementations be genuinely different things: the
22
+ * library's own left sidepanel, and a host's existing right-hand sidebar.
23
+ */
24
+ export interface ArtefactCatalogueService {
25
+ /** Show the catalogue, scoped to one framework's artefacts. */
26
+ open(owner: CommandOwner): void;
27
+ /** Put it away. Never touches the active senior tool. */
28
+ close(): void;
29
+ }
30
+ export declare const ArtefactCatalogueProvider: import("../../global/di/types.js").ServiceIdentifier<ArtefactCatalogueService> & (<U extends ArtefactCatalogueService = ArtefactCatalogueService>(variant: import("../../global/di/types.js").ServiceVariant) => import("../../global/di/types.js").ServiceIdentifier<U>);
31
+ /**
32
+ * Host override seam: replace the library's sidepanel with the host's own —
33
+ * or switch the catalogue off entirely.
34
+ *
35
+ * **Replace** — a host that already owns a sidebar (a right-hand inspector, a
36
+ * docked panel, a mobile sheet) registers this extension, its implementation
37
+ * answers {@link ArtefactCatalogueProvider}, and the library's widget is then
38
+ * never asked to open: the sub-menu's "More artefacts…" entry resolves ONE
39
+ * service, and `di.override` decides which. The host's own UI draws itself
40
+ * from the registry (`getCommandsForSurface(std, owner, 'catalogue')`,
41
+ * `getCommandIcon`) and creates through the one bottleneck
42
+ * (`runCommand(std, command, { surface: 'catalogue', … })`), so telemetry and
43
+ * the usage measure keep flowing wherever the pixels live.
44
+ *
45
+ * **Disable** — pass `null`. The provider then answers nothing, and every
46
+ * consumer reads that the honest way: the sub-menu's "More artefacts…" button
47
+ * is not rendered (a control that opens nothing is a lie), and the library's
48
+ * panel never opens. This is a cold-assembly switch, like the framework flags:
49
+ * decided when the editor is put together, not toggled mid-session.
50
+ *
51
+ * Mirrors `CommandUsageExtension` / `KeymapOverrideExtension`: `di.override`,
52
+ * so a host registering after the library's own extensions always wins,
53
+ * whatever the registration order turns out to be.
54
+ */
55
+ export declare function ArtefactCatalogueExtension(service: ArtefactCatalogueService | null): ExtensionType;
@@ -0,0 +1,35 @@
1
+ import { createIdentifier } from '../../global/di/index.js';
2
+ export const ArtefactCatalogueProvider = createIdentifier('AffineArtefactCatalogue');
3
+ /**
4
+ * Host override seam: replace the library's sidepanel with the host's own —
5
+ * or switch the catalogue off entirely.
6
+ *
7
+ * **Replace** — a host that already owns a sidebar (a right-hand inspector, a
8
+ * docked panel, a mobile sheet) registers this extension, its implementation
9
+ * answers {@link ArtefactCatalogueProvider}, and the library's widget is then
10
+ * never asked to open: the sub-menu's "More artefacts…" entry resolves ONE
11
+ * service, and `di.override` decides which. The host's own UI draws itself
12
+ * from the registry (`getCommandsForSurface(std, owner, 'catalogue')`,
13
+ * `getCommandIcon`) and creates through the one bottleneck
14
+ * (`runCommand(std, command, { surface: 'catalogue', … })`), so telemetry and
15
+ * the usage measure keep flowing wherever the pixels live.
16
+ *
17
+ * **Disable** — pass `null`. The provider then answers nothing, and every
18
+ * consumer reads that the honest way: the sub-menu's "More artefacts…" button
19
+ * is not rendered (a control that opens nothing is a lie), and the library's
20
+ * panel never opens. This is a cold-assembly switch, like the framework flags:
21
+ * decided when the editor is put together, not toggled mid-session.
22
+ *
23
+ * Mirrors `CommandUsageExtension` / `KeymapOverrideExtension`: `di.override`,
24
+ * so a host registering after the library's own extensions always wins,
25
+ * whatever the registration order turns out to be.
26
+ */
27
+ export function ArtefactCatalogueExtension(service) {
28
+ return {
29
+ setup: di => {
30
+ // `null` rides through the factory on purpose: `getOptional` then
31
+ // reports the catalogue as absent, which is the whole disable story.
32
+ di.override(ArtefactCatalogueProvider, () => service);
33
+ },
34
+ };
35
+ }
@@ -65,6 +65,17 @@ export interface AuditAxisFact {
65
65
  */
66
66
  export interface AuditZoneFact {
67
67
  id: string;
68
+ /**
69
+ * The user's own wording, when the zone is one THIS frame declares rather
70
+ * than one the framework does — a BPMN pool's lanes. Namespaced ids keep the
71
+ * two apart (`lane:sales` against `product`), and the name is what makes an
72
+ * instance zone worth reporting at all: `lane:2` says nothing to an assistant,
73
+ * "Facturation" says what the band is for.
74
+ *
75
+ * Absent on every framework zone, whose meaning is the framework's and whose
76
+ * wording is the host's to translate.
77
+ */
78
+ name?: string;
68
79
  rect: {
69
80
  x: number;
70
81
  y: number;
@@ -0,0 +1,31 @@
1
+ import { type CommandUsageStore } from '../../std/index.js';
2
+ import type { ExtensionType } from '../../store/index.js';
3
+ /**
4
+ * Where `createLocalCommandUsageStore` persists. Namespaced like the rest of
5
+ * Labre's browser-local state, and versionless on purpose: the shape is two
6
+ * numbers per command, and a reader that does not recognise an entry drops it.
7
+ */
8
+ export declare const COMMAND_USAGE_KEY = "labre:command-usage";
9
+ /**
10
+ * The default {@link CommandUsageStore}: recency and frequency in this
11
+ * browser's `localStorage`, per command id.
12
+ *
13
+ * It measures only. Nothing ranks anything here — PF6's "seven most-recent +
14
+ * six most-used" sub-menu reads these numbers, and a host that
15
+ * wants the measure to follow the user across devices replaces the whole store
16
+ * through {@link CommandUsageExtension}.
17
+ */
18
+ export declare function createLocalCommandUsageStore(): CommandUsageStore;
19
+ /**
20
+ * Host override seam: replace the browser-local measure with the host's own.
21
+ *
22
+ * This is where a host persists command usage in ITS database — so the ranking
23
+ * follows the user from laptop to browser to tablet instead of restarting at
24
+ * zero, which is exactly what a "most-used" sub-menu is judged on. The library
25
+ * ships the local store as the default (`CommandUsageViewExtension`) and never
26
+ * requires a host to care.
27
+ *
28
+ * Mirrors `EditorSettingExtension` / `KeymapOverrideExtension`: `di.override`,
29
+ * so a host registering after the library's own extensions always wins.
30
+ */
31
+ export declare function CommandUsageExtension(store: CommandUsageStore): ExtensionType;