@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,109 @@
1
+ import { CommandUsageIdentifier, } from '../../std/index.js';
2
+ /**
3
+ * Where `createLocalCommandUsageStore` persists. Namespaced like the rest of
4
+ * Labre's browser-local state, and versionless on purpose: the shape is two
5
+ * numbers per command, and a reader that does not recognise an entry drops it.
6
+ */
7
+ export const COMMAND_USAGE_KEY = 'labre:command-usage';
8
+ /**
9
+ * Enough for every command of every framework several times over (the registry
10
+ * holds 76 today), small enough that the JSON stays a few kilobytes. Overflow
11
+ * evicts the least recently used entry, so the measure a ranking cares about —
12
+ * what this user reached for lately — is the last thing lost.
13
+ */
14
+ const MAX_ENTRIES = 200;
15
+ /**
16
+ * `localStorage` throws outright in a few environments (private mode quotas,
17
+ * sandboxed frames, some test runners), and a usage measure is never important
18
+ * enough to take a command down with it — every access is therefore
19
+ * best-effort. Same rule and same shape as the icon picker's recent store.
20
+ */
21
+ const storage = () => {
22
+ try {
23
+ return globalThis.localStorage ?? null;
24
+ }
25
+ catch {
26
+ return null;
27
+ }
28
+ };
29
+ const readUsage = () => {
30
+ try {
31
+ const raw = storage()?.getItem(COMMAND_USAGE_KEY);
32
+ if (!raw)
33
+ return {};
34
+ const parsed = JSON.parse(raw);
35
+ if (!parsed || typeof parsed !== 'object')
36
+ return {};
37
+ // Entry by entry: one corrupted record must not discard the whole table.
38
+ const usage = {};
39
+ for (const [id, value] of Object.entries(parsed)) {
40
+ const { c, t } = (value ?? {});
41
+ if (typeof c === 'number' && typeof t === 'number')
42
+ usage[id] = { c, t };
43
+ }
44
+ return usage;
45
+ }
46
+ catch {
47
+ return {};
48
+ }
49
+ };
50
+ const writeUsage = (usage) => {
51
+ try {
52
+ storage()?.setItem(COMMAND_USAGE_KEY, JSON.stringify(usage));
53
+ }
54
+ catch {
55
+ // best-effort: this session keeps working, the measure just misses a run
56
+ }
57
+ };
58
+ /** Keeps the {@link MAX_ENTRIES} most recently used entries, nothing else. */
59
+ const evictOverflow = (usage) => {
60
+ const ids = Object.keys(usage);
61
+ if (ids.length <= MAX_ENTRIES)
62
+ return usage;
63
+ const kept = ids
64
+ .sort((a, b) => usage[b].t - usage[a].t)
65
+ .slice(0, MAX_ENTRIES);
66
+ return Object.fromEntries(kept.map(id => [id, usage[id]]));
67
+ };
68
+ /**
69
+ * The default {@link CommandUsageStore}: recency and frequency in this
70
+ * browser's `localStorage`, per command id.
71
+ *
72
+ * It measures only. Nothing ranks anything here — PF6's "seven most-recent +
73
+ * six most-used" sub-menu reads these numbers, and a host that
74
+ * wants the measure to follow the user across devices replaces the whole store
75
+ * through {@link CommandUsageExtension}.
76
+ */
77
+ export function createLocalCommandUsageStore() {
78
+ return {
79
+ record: (command) => {
80
+ const usage = readUsage();
81
+ const previous = usage[command.id];
82
+ usage[command.id] = { c: (previous?.c ?? 0) + 1, t: Date.now() };
83
+ writeUsage(evictOverflow(usage));
84
+ },
85
+ statsOf: (commandId) => {
86
+ const entry = readUsage()[commandId];
87
+ return entry ? { count: entry.c, lastUsedAt: entry.t } : undefined;
88
+ },
89
+ };
90
+ }
91
+ /**
92
+ * Host override seam: replace the browser-local measure with the host's own.
93
+ *
94
+ * This is where a host persists command usage in ITS database — so the ranking
95
+ * follows the user from laptop to browser to tablet instead of restarting at
96
+ * zero, which is exactly what a "most-used" sub-menu is judged on. The library
97
+ * ships the local store as the default (`CommandUsageViewExtension`) and never
98
+ * requires a host to care.
99
+ *
100
+ * Mirrors `EditorSettingExtension` / `KeymapOverrideExtension`: `di.override`,
101
+ * so a host registering after the library's own extensions always wins.
102
+ */
103
+ export function CommandUsageExtension(store) {
104
+ return {
105
+ setup: di => {
106
+ di.override(CommandUsageIdentifier, () => store);
107
+ },
108
+ };
109
+ }
@@ -1,6 +1,6 @@
1
1
  import { DividerBlockModel } from '../../../affine-model/index.js';
2
2
  import { DisposableGroup } from '../../../global/disposable/index.js';
3
- import { BlockSelection, LifeCycleWatcher, TextSelection, } from '../../../std/index.js';
3
+ import { BlockSelection, LifeCycleWatcher, TextSelection } from '../../../std/index.js';
4
4
  import { signal } from '@preact/signals-core';
5
5
  import { getSelectedBlocksCommand } from '../../commands/index.js';
6
6
  import { ImageSelection } from '../../selection/index.js';
@@ -1,5 +1,5 @@
1
1
  import { createIdentifier } from '../../global/di/index.js';
2
- import { disposeMember, } from '../../global/disposable/index.js';
2
+ import { disposeMember } from '../../global/disposable/index.js';
3
3
  import { AliasIcon, BlockLinkIcon, DeleteIcon, EdgelessIcon, LinkedEdgelessIcon, LinkedPageIcon, PageIcon, } from '@blocksuite/icons/lit';
4
4
  import { LifeCycleWatcher, StdIdentifier } from '../../std/index.js';
5
5
  import { computed, signal, } from '@preact/signals-core';
@@ -405,6 +405,17 @@ export declare class EditPropsStore extends LifeCycleWatcher {
405
405
  dispose(): void;
406
406
  getStorage<T extends StoragePropsKey>(key: T): StorageProps[T] | null;
407
407
  recordLastProps(key: LastPropsKey, props: Partial<LastProps[LastPropsKey]>): void;
408
+ /**
409
+ * Remember the edgeless viewport of the current editing session, so the next
410
+ * mount of this doc reopens where the user left it.
411
+ *
412
+ * The storage key is shared by every mount of the same doc, so a read-only
413
+ * mount — an embedded preview, a mini map — must not overwrite what the full
414
+ * editor remembered: a preview is not an editing session. Readonly is read
415
+ * here, at save time (the edgeless root block saves on unmount), so a
416
+ * session that turns read-only before unmounting stops writing too.
417
+ */
418
+ saveViewport(viewport: StorageProps['viewport']): void;
408
419
  setStorage<T extends StoragePropsKey>(key: T, value: StorageProps[T]): void;
409
420
  unmounted(): void;
410
421
  }
@@ -156,6 +156,21 @@ export class EditPropsStore extends LifeCycleWatcher {
156
156
  const nextProps = mergeWith(clonedeep(innerProps), { [key]: overrideProps }, customizer);
157
157
  this.innerProps$.value = OptionalPropsSchema.parse(nextProps);
158
158
  }
159
+ /**
160
+ * Remember the edgeless viewport of the current editing session, so the next
161
+ * mount of this doc reopens where the user left it.
162
+ *
163
+ * The storage key is shared by every mount of the same doc, so a read-only
164
+ * mount — an embedded preview, a mini map — must not overwrite what the full
165
+ * editor remembered: a preview is not an editing session. Readonly is read
166
+ * here, at save time (the edgeless root block saves on unmount), so a
167
+ * session that turns read-only before unmounting stops writing too.
168
+ */
169
+ saveViewport(viewport) {
170
+ if (this.std.store.readonly)
171
+ return;
172
+ this.setStorage('viewport', viewport);
173
+ }
159
174
  setStorage(key, value) {
160
175
  const oldValue = this.getStorage(key);
161
176
  this._getStorage(key).setItem(this._getStorageKey(key), JSON.stringify(value));
@@ -1,4 +1,4 @@
1
- import { createIdentifier, } from '../../../global/di/index.js';
1
+ import { createIdentifier } from '../../../global/di/index.js';
2
2
  export const EmbedIframeConfigIdentifier = createIdentifier('EmbedIframeConfig');
3
3
  export function EmbedIframeConfigExtension(config) {
4
4
  const identifier = EmbedIframeConfigIdentifier(config.name);
@@ -1,7 +1,9 @@
1
+ export * from './artefact-catalogue-service.js';
1
2
  export * from './audit-service.js';
2
3
  export * from './auto-clear-selection-service.js';
3
4
  export * from './block-meta-service.js';
4
5
  export * from './citation-service/index.js';
6
+ export * from './command-usage-service.js';
5
7
  export * from './comment-service/index.js';
6
8
  export * from './doc-display-meta-service.js';
7
9
  export * from './doc-mode-service.js';
@@ -1,7 +1,9 @@
1
+ export * from './artefact-catalogue-service.js';
1
2
  export * from './audit-service.js';
2
3
  export * from './auto-clear-selection-service.js';
3
4
  export * from './block-meta-service.js';
4
5
  export * from './citation-service/index.js';
6
+ export * from './command-usage-service.js';
5
7
  export * from './comment-service/index.js';
6
8
  export * from './doc-display-meta-service.js';
7
9
  export * from './doc-mode-service.js';
@@ -110,7 +110,8 @@ export class PivotMaterialityPublisher extends LifeCycleWatcher {
110
110
  // there is nobody to announce to, so nothing is subscribed and the whole
111
111
  // watcher costs one lookup. Binding and qualification keep working: they
112
112
  // are element-local writes and never needed the host.
113
- if (!this.std.getOptional(PivotPropertiesProvider)?.publishOccurrenceMaterialities) {
113
+ if (!this.std.getOptional(PivotPropertiesProvider)
114
+ ?.publishOccurrenceMaterialities) {
114
115
  return;
115
116
  }
116
117
  // The surface is a SIGNAL, not a fact: it can legitimately be null at mount
@@ -34,7 +34,7 @@ export type BlockLifecycleEvents = {
34
34
  * manipulated ('background:classic', 'node:market', 'connector:link'…).
35
35
  */
36
36
  export interface FrameworkElementEvent extends TelemetryEvent {
37
- framework: 'wardley' | 'edgy' | 'cynefin' | 'bpmn' | 'event-storming' | 'core-domain' | 'context-map';
37
+ framework: 'wardley' | 'edgy' | 'cynefin' | 'bpmn' | 'c4' | 'event-storming' | 'core-domain' | 'context-map';
38
38
  element: string;
39
39
  }
40
40
  /**
@@ -101,11 +101,83 @@ export interface EdgeDirectionEvent extends TelemetryEvent {
101
101
  /** How many edges the single gesture reversed. */
102
102
  elementCount: number;
103
103
  }
104
+ /**
105
+ * A framework element became a NEARBY kind of itself — a task said more
106
+ * precisely as a user task, a start event as a timer start — from its own
107
+ * contextual toolbar, in one atomic write.
108
+ *
109
+ * **A new event name, for the reason {@link FrameworkPromotionEvent} gives.**
110
+ * ADR 0003 § 2 defines the creation event as UI intent emitted at INSERTION
111
+ * sites, and a morph inserts nothing: no element is created, destroyed or
112
+ * swapped, no id changes, no geometry moves and no connector is re-pointed.
113
+ * Reusing `FrameworkElementAdded` would count a drawn-then-refined artefact
114
+ * twice and inflate "elements added per framework" permanently.
115
+ *
116
+ * Worth measuring on its own, too. The set of reachable kinds is DATA a
117
+ * framework declares by hand, and the only evidence that a declared family is
118
+ * the right family is how often it is actually crossed — a pair nobody ever
119
+ * morphs between did not need to be offered, and a morph users reach for
120
+ * constantly says the palette led them to the wrong artefact first.
121
+ *
122
+ * Ids only: the two roles, and their framework. Never a kind's board content,
123
+ * never the element ids, never the label anybody typed.
124
+ */
125
+ export interface FrameworkElementMorphedEvent extends TelemetryEvent {
126
+ page?: 'whiteboard editor';
127
+ /**
128
+ * Owning framework — the declaration's own wire key, matching what
129
+ * `reportCommandTelemetry` sends for that framework's commands.
130
+ *
131
+ * OPTIONAL for the same reason it is on {@link FrameworkPromotionEvent}: the
132
+ * capability is generic, and an element type may one day declare a morph
133
+ * without belonging to a framework the union names. Absent rather than
134
+ * `'unknown'`, per the repo convention.
135
+ */
136
+ framework?: FrameworkId;
137
+ /** Role id the selection carried, when they all carried the same one. */
138
+ fromRole?: string;
139
+ /** Role id it now carries. */
140
+ toRole?: string;
141
+ /** How many elements the single gesture actually rewrote. */
142
+ elementCount: number;
143
+ }
144
+ /**
145
+ * A framework VIEW was told which level it draws — a C4 board set to Context,
146
+ * Container or Component, or put back to a free sketch.
147
+ *
148
+ * **A new event name, for the reason {@link FrameworkPromotionEvent} gives.**
149
+ * Nothing is inserted, nothing is morphed and no level of requirement changes:
150
+ * the author is stating what the sheet IS, which is a fact none of the existing
151
+ * events describes. Reusing one of them would corrupt the funnel it belongs to.
152
+ *
153
+ * Worth measuring on its own, and for the same reason a profile change is: this
154
+ * is an OPTIONAL declaration nothing forces, so how often it is made is the only
155
+ * evidence that asking for it was worth the toolbar entry — and a level users
156
+ * set and then clear is a rule pack that argued with a drawing they meant.
157
+ *
158
+ * Ids only: the framework and the level's own closed vocabulary. Never the
159
+ * board's title, never what is drawn on it.
160
+ */
161
+ export interface FrameworkViewLevelEvent extends TelemetryEvent {
162
+ page?: 'whiteboard editor';
163
+ /** Owning framework of the view, e.g. `c4`. */
164
+ framework: FrameworkId;
165
+ /**
166
+ * The level now in force, from the framework's own closed vocabulary —
167
+ * `'none'` when the view has been put back to declaring nothing, which is a
168
+ * value the dashboard needs as much as the others.
169
+ */
170
+ level: string;
171
+ /** The one it replaces, when the view declared one. */
172
+ previousLevel?: string;
173
+ }
104
174
  export type FrameworkDiagramEvents = {
105
175
  FrameworkElementAdded: FrameworkElementEvent;
106
176
  FrameworkToolPicked: FrameworkElementEvent;
107
177
  FrameworkLegendCreated: FrameworkElementEvent;
108
178
  FrameworkElementPromoted: FrameworkPromotionEvent;
179
+ FrameworkElementMorphed: FrameworkElementMorphedEvent;
180
+ FrameworkViewLevelSet: FrameworkViewLevelEvent;
109
181
  EdgeDirectionInverted: EdgeDirectionEvent;
110
182
  };
111
183
  /**
@@ -1,4 +1,6 @@
1
+ import type { BlockStdScope } from '../../../std/index.js';
1
2
  import type { TemplateResult } from 'lit';
3
+ import { type ChromeWording } from '../translation-service/index.js';
2
4
  import type { ToolbarContext } from './context.js';
3
5
  export declare enum ActionPlacement {
4
6
  Start = 0,
@@ -25,9 +27,28 @@ type ActionBase = {
25
27
  };
26
28
  export type ToolbarAction = ActionBase & {
27
29
  label?: string;
30
+ /**
31
+ * The same word as {@link label}, said as an i18n key with its English
32
+ * default — resolved against the host's catalogue when the row is built, and
33
+ * written over `label` there (`combine`, in the toolbar widget).
34
+ *
35
+ * It exists because `label` is a VALUE and the translation seam needs `std`:
36
+ * a literal here is the one wording a host cannot override, which is what
37
+ * left a fully translated editor saying "Duplicate" and "Card view" in
38
+ * English (#183). Declaring the pair keeps a call site one line — the shape a
39
+ * static label already had — instead of pushing every entry that has words
40
+ * into a `generate`.
41
+ *
42
+ * Wordings are declared once in `@labre/affine-shared/services`
43
+ * (`CHROME_WORDINGS`), which is also what the key manifest walks — a pair
44
+ * spelt inline at a call site would be a key no host is ever offered.
45
+ */
46
+ labelWording?: ChromeWording;
28
47
  showLabel?: boolean;
29
48
  icon?: TemplateResult;
30
49
  tooltip?: string | TemplateResult;
50
+ /** {@link labelWording}, for the tooltip. Written over `tooltip`. */
51
+ tooltipWording?: ChromeWording;
31
52
  variant?: 'destructive';
32
53
  disabled?: ((cx: ToolbarContext) => boolean) | boolean;
33
54
  content?: ((cx: ToolbarContext) => TemplateResult | null) | (TemplateResult | null);
@@ -45,4 +66,15 @@ export type ToolbarActionGroupGenerator = ActionBase & {
45
66
  };
46
67
  export type ToolbarGenericAction = ToolbarAction | ToolbarActionGenerator | ToolbarActionGroup | ToolbarActionGroupGenerator;
47
68
  export type ToolbarActions<T extends ActionBase = ToolbarGenericAction> = T[];
69
+ /**
70
+ * What an entry SAYS, whether it declared a wording or a literal label.
71
+ *
72
+ * The row itself never needs this — `combine` resolves `labelWording` onto
73
+ * `label` before anything is drawn. It exists for the entries a widget renders
74
+ * ITSELF out of the raw declarations, which is exactly what the view switcher
75
+ * does: `content(ctx)` hands its own children to `affine-view-dropdown-menu`,
76
+ * so those never pass through `combine` and would otherwise be the one control
77
+ * in the editor left saying "Card view" in English (#183).
78
+ */
79
+ export declare function toolbarActionLabel(std: BlockStdScope, action: ToolbarAction): string;
48
80
  export {};
@@ -1,3 +1,4 @@
1
+ import { translateKey } from '../translation-service/index.js';
1
2
  export var ActionPlacement;
2
3
  (function (ActionPlacement) {
3
4
  ActionPlacement[ActionPlacement["Start"] = 0] = "Start";
@@ -5,3 +6,18 @@ export var ActionPlacement;
5
6
  ActionPlacement[ActionPlacement["End"] = 2] = "End";
6
7
  ActionPlacement[ActionPlacement["More"] = 4] = "More";
7
8
  })(ActionPlacement || (ActionPlacement = {}));
9
+ /**
10
+ * What an entry SAYS, whether it declared a wording or a literal label.
11
+ *
12
+ * The row itself never needs this — `combine` resolves `labelWording` onto
13
+ * `label` before anything is drawn. It exists for the entries a widget renders
14
+ * ITSELF out of the raw declarations, which is exactly what the view switcher
15
+ * does: `content(ctx)` hands its own children to `affine-view-dropdown-menu`,
16
+ * so those never pass through `combine` and would otherwise be the one control
17
+ * in the editor left saying "Card view" in English (#183).
18
+ */
19
+ export function toolbarActionLabel(std, action) {
20
+ return action.labelWording
21
+ ? translateKey(std, ...action.labelWording)
22
+ : (action.label ?? '');
23
+ }
@@ -9,11 +9,21 @@ export declare enum Flag {
9
9
  Accepting = 64
10
10
  }
11
11
  export declare class Flags {
12
+ #private;
12
13
  value$: import("@preact/signals-core").Signal<Flag>;
14
+ get revision(): number;
15
+ get revision$(): import("@preact/signals-core").Signal<number>;
13
16
  get value(): Flag;
14
17
  toggle(flag: Flag, activated: boolean): void;
15
18
  check(flag: Flag, value?: Flag): boolean;
16
19
  contains(flag: number, value?: Flag): boolean;
20
+ /**
21
+ * Forces subscribers to re-run while keeping `flag` activated.
22
+ *
23
+ * The revision bump is what actually notifies; the batch keeps both writes
24
+ * in a single notification so the toolbar never sees a transient
25
+ * {@link Flag.None} frame.
26
+ */
17
27
  refresh(flag: Flag): void;
18
28
  reset(): void;
19
29
  hide(): void;
@@ -16,6 +16,30 @@ export var Flag;
16
16
  export class Flags {
17
17
  constructor() {
18
18
  this.value$ = signal(Flag.None);
19
+ /**
20
+ * Bumped on every {@link Flags.refresh} call.
21
+ *
22
+ * `refresh` intentionally leaves `value$` unchanged, so it cannot be used as
23
+ * a repaint channel on its own: since `@preact/signals-core` 1.14 a `batch`
24
+ * that ends on its initial value notifies nobody. Subscribers that must
25
+ * re-run on a forced refresh have to read this revision counter as well.
26
+ */
27
+ this.#revision$ = signal(0);
28
+ }
29
+ /**
30
+ * Bumped on every {@link Flags.refresh} call.
31
+ *
32
+ * `refresh` intentionally leaves `value$` unchanged, so it cannot be used as
33
+ * a repaint channel on its own: since `@preact/signals-core` 1.14 a `batch`
34
+ * that ends on its initial value notifies nobody. Subscribers that must
35
+ * re-run on a forced refresh have to read this revision counter as well.
36
+ */
37
+ #revision$;
38
+ get revision() {
39
+ return this.#revision$.peek();
40
+ }
41
+ get revision$() {
42
+ return this.#revision$;
19
43
  }
20
44
  get value() {
21
45
  return this.value$.peek();
@@ -33,10 +57,17 @@ export class Flags {
33
57
  contains(flag, value = this.value) {
34
58
  return (flag & value) !== Flag.None;
35
59
  }
60
+ /**
61
+ * Forces subscribers to re-run while keeping `flag` activated.
62
+ *
63
+ * The revision bump is what actually notifies; the batch keeps both writes
64
+ * in a single notification so the toolbar never sees a transient
65
+ * {@link Flag.None} frame.
66
+ */
36
67
  refresh(flag) {
37
68
  batch(() => {
38
- this.toggle(flag, false);
39
69
  this.toggle(flag, true);
70
+ this.#revision$.value++;
40
71
  });
41
72
  }
42
73
  reset() {
@@ -8,7 +8,19 @@ import type { ToolbarModule } from './module.js';
8
8
  export declare const ToolbarModuleIdentifier: import("../../../global/di/types.js").ServiceIdentifier<ToolbarModule> & (<U extends ToolbarModule = ToolbarModule>(variant: import("../../../global/di/types.js").ServiceVariant) => import("../../../global/di/types.js").ServiceIdentifier<U>);
9
9
  export declare const ToolbarRegistryIdentifier: import("../../../global/di/types.js").ServiceIdentifier<ToolbarRegistryExtension> & (<U extends ToolbarRegistryExtension = ToolbarRegistryExtension>(variant: import("../../../global/di/types.js").ServiceVariant) => import("../../../global/di/types.js").ServiceIdentifier<U>);
10
10
  export declare function ToolbarModuleExtension(module: ToolbarModule): ExtensionType;
11
+ /** The flavour a DI variant speaks for, owner suffix and all. */
12
+ export declare function toolbarModuleFlavour(variant: string): string;
13
+ /**
14
+ * A second (or third) module on one flavour, named by who contributes it.
15
+ *
16
+ * The owner is never shown and never parsed back — it exists so two
17
+ * contributors cannot claim one DI variant. Use a stable, framework-scoped
18
+ * name (`c4-morph`), because it is the identity the container refuses
19
+ * duplicates on.
20
+ */
21
+ export declare function toolbarModuleKey(flavour: string, owner: string): string;
11
22
  export declare class ToolbarRegistryExtension extends Extension {
23
+ #private;
12
24
  readonly std: BlockStdScope;
13
25
  flavour$: import("@preact/signals-core").Signal<string>;
14
26
  elementsMap$: import("@preact/signals-core").Signal<Map<string, GfxModel[]>>;
@@ -20,8 +32,40 @@ export declare class ToolbarRegistryExtension extends Extension {
20
32
  placement$: import("@preact/signals-core").Signal<ToolbarPlacement>;
21
33
  flags: Flags;
22
34
  constructor(std: BlockStdScope);
35
+ /**
36
+ * Every module of every flavour, keyed by the DI variant it was registered
37
+ * under — which for a shared flavour carries an owner suffix. Read
38
+ * {@link modulesFor} instead unless the variant itself is the question.
39
+ */
23
40
  get modules(): Map<string, ToolbarModule>;
41
+ /**
42
+ * Every module contributing to one flavour's row — the bare-key module
43
+ * first, then the owner-suffixed ones in registration order.
44
+ */
45
+ modulesFor(flavour: string): readonly ToolbarModule[];
46
+ /**
47
+ * The config registered under the flavour ITSELF, or `null`.
48
+ *
49
+ * Deliberately not "the first module of this flavour". The callers of this
50
+ * method ask a question about one identified registration — does this block
51
+ * flavour have a toolbar of its own, where does that toolbar sit — and an
52
+ * owner-suffixed contributor is an ADDITION to a row, not a stand-in for the
53
+ * module that defines it. Answering with a contributor would make the reply
54
+ * depend on which frameworks a host happened to switch on: with `wardley`
55
+ * off and `c4` on, `custom:affine:surface:group` has no bare module at all,
56
+ * and returning C4's morph there would let a placement (or a `has`-style
57
+ * probe) be decided by a menu that only some builds ship.
58
+ */
24
59
  getModuleBy(flavour: string): import("./config.js").ToolbarModuleConfig | null;
60
+ /**
61
+ * Where a flavour's row sits: the first module of it that actually SAYS.
62
+ *
63
+ * A row is one row however many modules contribute to it, so the placement
64
+ * is a property of the flavour and not of a registration — and a contributor
65
+ * that declares none must not be read as declaring the default. Scanning for
66
+ * the first module with a `placement` keeps the answer the same whether the
67
+ * framework that states it is registered first, last, or under an owner.
68
+ */
25
69
  getModulePlacement(flavour: string, fallback?: ToolbarPlacement): ToolbarPlacement;
26
70
  static setup(di: Container): void;
27
71
  }