@formicoidea/labre-core 0.41.0 → 0.43.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/LICENSE +384 -0
  2. package/dist/_pkgs/affine-block-bookmark/bookmark-block.js +2 -2
  3. package/dist/_pkgs/affine-block-data-view/configs/tooltips.js +1 -1
  4. package/dist/_pkgs/affine-block-database/configs/tooltips.js +1 -1
  5. package/dist/_pkgs/affine-block-edgeless-text/edgeless-text-block.js +4 -2
  6. package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/config.js +7 -1
  7. package/dist/_pkgs/affine-block-embed/common/iframe-sandbox.d.ts +39 -0
  8. package/dist/_pkgs/affine-block-embed/common/iframe-sandbox.js +39 -0
  9. package/dist/_pkgs/affine-block-embed/embed-figma-block/embed-figma-block.js +4 -1
  10. package/dist/_pkgs/affine-block-embed/embed-github-block/embed-github-block.js +2 -1
  11. package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-error-card.d.ts +14 -1
  12. package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-error-card.js +21 -2
  13. package/dist/_pkgs/affine-block-embed/embed-iframe-block/consts.js +2 -0
  14. package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.d.ts +2 -1
  15. package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.js +41 -11
  16. package/dist/_pkgs/affine-block-embed/embed-iframe-block/types.d.ts +16 -0
  17. package/dist/_pkgs/affine-block-embed/embed-iframe-block/types.js +17 -1
  18. package/dist/_pkgs/affine-block-embed/embed-iframe-block/utils.d.ts +8 -0
  19. package/dist/_pkgs/affine-block-embed/embed-iframe-block/utils.js +19 -0
  20. package/dist/_pkgs/affine-block-embed/embed-loom-block/embed-loom-block.js +4 -1
  21. package/dist/_pkgs/affine-block-embed/embed-youtube-block/embed-youtube-block.js +4 -1
  22. package/dist/_pkgs/affine-block-embed/index.d.ts +1 -0
  23. package/dist/_pkgs/affine-block-embed/index.js +1 -0
  24. package/dist/_pkgs/affine-block-embed/translations.d.ts +8 -0
  25. package/dist/_pkgs/affine-block-embed/translations.js +28 -0
  26. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-linked-doc-block.js +4 -2
  27. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-synced-doc-block.js +2 -2
  28. package/dist/_pkgs/affine-block-frame/frame-manager.js +6 -3
  29. package/dist/_pkgs/affine-block-frame/frame-tool.js +1 -1
  30. package/dist/_pkgs/affine-block-frame/frame-toolbar.js +6 -1
  31. package/dist/_pkgs/affine-block-list/list-keymap.js +7 -0
  32. package/dist/_pkgs/affine-block-list/utils/get-list-icon.js +3 -1
  33. package/dist/_pkgs/affine-block-note/configs/tooltips.js +1 -1
  34. package/dist/_pkgs/affine-block-note/note-keymap.js +7 -1
  35. package/dist/_pkgs/affine-block-paragraph/paragraph-keymap.js +7 -1
  36. package/dist/_pkgs/affine-block-root/adapters/html.js +2 -2
  37. package/dist/_pkgs/affine-block-root/commands/copy-link-commands.d.ts +2 -0
  38. package/dist/_pkgs/affine-block-root/commands/copy-link-commands.js +155 -0
  39. package/dist/_pkgs/affine-block-root/commands/pivot-commands.js +1 -8
  40. package/dist/_pkgs/affine-block-root/commands/tag-commands.js +1 -8
  41. package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.d.ts +9 -0
  42. package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.js +51 -0
  43. package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.d.ts +22 -0
  44. package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.js +46 -0
  45. package/dist/_pkgs/affine-block-root/edgeless/utils/pinch-zoom.d.ts +21 -0
  46. package/dist/_pkgs/affine-block-root/edgeless/utils/pinch-zoom.js +24 -0
  47. package/dist/_pkgs/affine-block-root/edgeless/utils/query.js +8 -0
  48. package/dist/_pkgs/affine-block-root/index.d.ts +1 -0
  49. package/dist/_pkgs/affine-block-root/index.js +1 -0
  50. package/dist/_pkgs/affine-block-root/keyboard/keymap.js +1 -16
  51. package/dist/_pkgs/affine-block-root/view.js +2 -0
  52. package/dist/_pkgs/affine-block-surface/element-model/index.d.ts +21 -3
  53. package/dist/_pkgs/affine-block-surface/element-model/index.js +14 -2
  54. package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.d.ts +23 -0
  55. package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.js +89 -0
  56. package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.d.ts +7 -0
  57. package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.js +5 -0
  58. package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.d.ts +41 -0
  59. package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.js +70 -0
  60. package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.d.ts +49 -0
  61. package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.js +257 -0
  62. package/dist/_pkgs/affine-block-surface/extensions/export-svg/tagged-path.d.ts +16 -0
  63. package/dist/_pkgs/affine-block-surface/extensions/export-svg/tagged-path.js +24 -0
  64. package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.d.ts +24 -0
  65. package/dist/_pkgs/affine-block-surface/extensions/export-svg/toolbar.js +66 -0
  66. package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +4 -0
  67. package/dist/_pkgs/affine-block-surface/extensions/index.js +4 -0
  68. package/dist/_pkgs/affine-block-surface/extensions/interchange-import.d.ts +66 -4
  69. package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +253 -11
  70. package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +18 -0
  71. package/dist/_pkgs/affine-block-surface/extensions/legend-toolbar.d.ts +81 -0
  72. package/dist/_pkgs/affine-block-surface/extensions/legend-toolbar.js +81 -0
  73. package/dist/_pkgs/affine-block-surface/extensions/legend.d.ts +144 -0
  74. package/dist/_pkgs/affine-block-surface/extensions/legend.js +495 -0
  75. package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.js +4 -0
  76. package/dist/_pkgs/affine-block-surface/extensions/reading-widget.d.ts +17 -3
  77. package/dist/_pkgs/affine-block-surface/extensions/reading-widget.js +35 -13
  78. package/dist/_pkgs/affine-block-surface/extensions/reading.d.ts +61 -1
  79. package/dist/_pkgs/affine-block-surface/extensions/reading.js +85 -39
  80. package/dist/_pkgs/affine-block-surface/extensions/record-action.d.ts +66 -0
  81. package/dist/_pkgs/affine-block-surface/extensions/record-action.js +145 -0
  82. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.d.ts +3 -0
  83. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.js +23 -0
  84. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.d.ts +1 -1
  85. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +12 -4
  86. package/dist/_pkgs/affine-block-surface/extensions/validation.d.ts +253 -28
  87. package/dist/_pkgs/affine-block-surface/extensions/validation.js +489 -41
  88. package/dist/_pkgs/affine-block-surface/framework-background/background-view.d.ts +115 -0
  89. package/dist/_pkgs/affine-block-surface/framework-background/background-view.js +185 -0
  90. package/dist/_pkgs/affine-block-surface/framework-background/fit.d.ts +36 -0
  91. package/dist/_pkgs/affine-block-surface/framework-background/fit.js +30 -0
  92. package/dist/_pkgs/affine-block-surface/framework-background/index.d.ts +2 -0
  93. package/dist/_pkgs/affine-block-surface/framework-background/index.js +2 -0
  94. package/dist/_pkgs/affine-block-surface/framework-background/labels.d.ts +16 -1
  95. package/dist/_pkgs/affine-block-surface/framework-background/labels.js +31 -21
  96. package/dist/_pkgs/affine-block-surface/framework-background/renderer.js +29 -5
  97. package/dist/_pkgs/affine-block-surface/framework-background/stacking.d.ts +6 -4
  98. package/dist/_pkgs/affine-block-surface/framework-background/stacking.js +56 -8
  99. package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.d.ts +12 -0
  100. package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.js +15 -0
  101. package/dist/_pkgs/affine-block-surface/renderer/element-highlight-overlay.js +2 -7
  102. package/dist/_pkgs/affine-block-surface/view.js +8 -1
  103. package/dist/_pkgs/affine-block-surface-ref/configs/slash-menu.js +1 -1
  104. package/dist/_pkgs/affine-block-surface-ref/configs/tooltips.js +2 -2
  105. package/dist/_pkgs/affine-components/color-picker/button.d.ts +56 -1
  106. package/dist/_pkgs/affine-components/color-picker/button.js +168 -23
  107. package/dist/_pkgs/affine-components/color-picker/framework-palette.d.ts +106 -0
  108. package/dist/_pkgs/affine-components/color-picker/framework-palette.js +177 -0
  109. package/dist/_pkgs/affine-components/color-picker/index.d.ts +2 -0
  110. package/dist/_pkgs/affine-components/color-picker/index.js +2 -0
  111. package/dist/_pkgs/affine-components/color-picker/palette-carousel.d.ts +85 -0
  112. package/dist/_pkgs/affine-components/color-picker/palette-carousel.js +445 -0
  113. package/dist/_pkgs/affine-components/color-picker/styles.js +1 -1
  114. package/dist/_pkgs/affine-components/context-menu/button.js +3 -1
  115. package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.d.ts +31 -1
  116. package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.js +189 -63
  117. package/dist/_pkgs/affine-components/icons/ai.js +3 -3
  118. package/dist/_pkgs/affine-components/icons/list.js +7 -1
  119. package/dist/_pkgs/affine-components/resource/resource.js +29 -16
  120. package/dist/_pkgs/affine-components/size-dropdown-menu/dropdown-menu.js +6 -1
  121. package/dist/_pkgs/affine-components/toolbar/index.d.ts +1 -1
  122. package/dist/_pkgs/affine-components/toolbar/index.js +1 -1
  123. package/dist/_pkgs/affine-components/toolbar/menu-button.d.ts +7 -0
  124. package/dist/_pkgs/affine-components/toolbar/menu-button.js +30 -0
  125. package/dist/_pkgs/affine-components/toolbar/picker-menu.d.ts +16 -1
  126. package/dist/_pkgs/affine-components/toolbar/picker-menu.js +2 -2
  127. package/dist/_pkgs/affine-components/toolbar/toolbar.d.ts +1 -0
  128. package/dist/_pkgs/affine-components/toolbar/toolbar.js +67 -0
  129. package/dist/_pkgs/affine-components/translations.d.ts +8 -0
  130. package/dist/_pkgs/affine-components/translations.js +17 -0
  131. package/dist/_pkgs/affine-foundation/view.js +2 -1
  132. package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card-title-editor.js +1 -1
  133. package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card.js +1 -1
  134. package/dist/_pkgs/affine-gfx-brush/element-renderer.js +2 -2
  135. package/dist/_pkgs/affine-gfx-brush/toolbar/components/eraser/icons.js +1 -1
  136. package/dist/_pkgs/affine-gfx-brush/toolbar/configs/brush.js +6 -1
  137. package/dist/_pkgs/affine-gfx-brush/toolbar/configs/highlighter.js +6 -1
  138. package/dist/_pkgs/affine-gfx-connector/connector-manager.d.ts +9 -1
  139. package/dist/_pkgs/affine-gfx-connector/connector-manager.js +61 -0
  140. package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.d.ts +11 -2
  141. package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.js +11 -2
  142. package/dist/_pkgs/affine-gfx-connector/element-renderer/connector-dom/index.d.ts +7 -1
  143. package/dist/_pkgs/affine-gfx-connector/element-renderer/connector-dom/index.js +87 -17
  144. package/dist/_pkgs/affine-gfx-connector/element-renderer/index.js +78 -17
  145. package/dist/_pkgs/affine-gfx-connector/element-renderer/utils.d.ts +24 -2
  146. package/dist/_pkgs/affine-gfx-connector/element-renderer/utils.js +31 -8
  147. package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.d.ts +124 -3
  148. package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.js +219 -56
  149. package/dist/_pkgs/affine-gfx-connector/text/text.d.ts +13 -4
  150. package/dist/_pkgs/affine-gfx-connector/text/text.js +13 -44
  151. package/dist/_pkgs/affine-gfx-connector/toolbar/config.d.ts +56 -0
  152. package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +94 -10
  153. package/dist/_pkgs/affine-gfx-connector/toolbar/hollow-endpoint-icons.d.ts +8 -0
  154. package/dist/_pkgs/affine-gfx-connector/toolbar/hollow-endpoint-icons.js +118 -0
  155. package/dist/_pkgs/affine-gfx-connector/translations.d.ts +3 -0
  156. package/dist/_pkgs/affine-gfx-connector/translations.js +23 -0
  157. package/dist/_pkgs/affine-gfx-connector/view/view.d.ts +37 -1
  158. package/dist/_pkgs/affine-gfx-connector/view/view.js +97 -8
  159. package/dist/_pkgs/affine-gfx-group/command/group-api.js +1 -1
  160. package/dist/_pkgs/affine-gfx-group/store.js +0 -2
  161. package/dist/_pkgs/affine-gfx-group/translations.d.ts +9 -10
  162. package/dist/_pkgs/affine-gfx-group/translations.js +9 -13
  163. package/dist/_pkgs/affine-gfx-mindmap/indicator-overlay/index.js +6 -2
  164. package/dist/_pkgs/affine-gfx-mindmap/templates/index.js +1 -1
  165. package/dist/_pkgs/affine-gfx-mindmap/toolbar/basket-elements.js +1 -1
  166. package/dist/_pkgs/affine-gfx-mindmap/toolbar/config.js +4 -2
  167. package/dist/_pkgs/affine-gfx-mindmap/toolbar/utils/import-mindmap.js +2 -2
  168. package/dist/_pkgs/affine-gfx-mindmap/translations.d.ts +7 -1
  169. package/dist/_pkgs/affine-gfx-mindmap/translations.js +11 -1
  170. package/dist/_pkgs/affine-gfx-shape/element-renderer/highlighter.js +2 -2
  171. package/dist/_pkgs/affine-gfx-shape/overlay/polygon-drawing-overlay.d.ts +6 -0
  172. package/dist/_pkgs/affine-gfx-shape/overlay/polygon-drawing-overlay.js +30 -1
  173. package/dist/_pkgs/affine-gfx-shape/polygon-tool.d.ts +20 -1
  174. package/dist/_pkgs/affine-gfx-shape/polygon-tool.js +9 -1
  175. package/dist/_pkgs/affine-gfx-shape/toolbar/config.js +10 -3
  176. package/dist/_pkgs/affine-gfx-shape/toolbar/palette-color-action.js +11 -1
  177. package/dist/_pkgs/affine-gfx-shape/translations.d.ts +7 -0
  178. package/dist/_pkgs/affine-gfx-shape/translations.js +11 -0
  179. package/dist/_pkgs/affine-gfx-template/builtin/other.js +14 -8
  180. package/dist/_pkgs/affine-gfx-template/snapshot-from-action.js +32 -119
  181. package/dist/_pkgs/affine-gfx-template/toolbar/template-loading.js +1 -1
  182. package/dist/_pkgs/affine-gfx-template/toolbar/template-type.d.ts +1 -1
  183. package/dist/_pkgs/affine-gfx-template/translations.d.ts +5 -0
  184. package/dist/_pkgs/affine-gfx-template/translations.js +38 -0
  185. package/dist/_pkgs/affine-gfx-text/dblclick-add-edgeless-text.d.ts +13 -1
  186. package/dist/_pkgs/affine-gfx-text/dblclick-add-edgeless-text.js +19 -4
  187. package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.d.ts +41 -0
  188. package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.js +60 -4
  189. package/dist/_pkgs/affine-gfx-text/toolbar/actions.d.ts +8 -1
  190. package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +14 -2
  191. package/dist/_pkgs/affine-gfx-text/translations.d.ts +9 -0
  192. package/dist/_pkgs/affine-gfx-text/translations.js +14 -1
  193. package/dist/_pkgs/affine-inline-latex/latex-node/latex-editor-menu.js +2 -1
  194. package/dist/_pkgs/affine-inline-preset/markdown.js +5 -1
  195. package/dist/_pkgs/affine-model/consts/connector.d.ts +28 -2
  196. package/dist/_pkgs/affine-model/consts/connector.js +26 -0
  197. package/dist/_pkgs/affine-model/consts/text.d.ts +15 -2
  198. package/dist/_pkgs/affine-model/consts/text.js +25 -1
  199. package/dist/_pkgs/affine-model/elements/bpmn/pool.js +1 -1
  200. package/dist/_pkgs/affine-model/elements/brush/brush.js +1 -1
  201. package/dist/_pkgs/affine-model/elements/c4/board.js +1 -1
  202. package/dist/_pkgs/affine-model/elements/c4/boundary.js +1 -1
  203. package/dist/_pkgs/affine-model/elements/connector/connector.d.ts +135 -0
  204. package/dist/_pkgs/affine-model/elements/connector/connector.js +246 -5
  205. package/dist/_pkgs/affine-model/elements/connector/end-label.d.ts +83 -0
  206. package/dist/_pkgs/affine-model/elements/connector/end-label.js +119 -0
  207. package/dist/_pkgs/affine-model/elements/connector/index.d.ts +1 -0
  208. package/dist/_pkgs/affine-model/elements/connector/index.js +1 -0
  209. package/dist/_pkgs/affine-model/elements/context-map/context-map.js +1 -1
  210. package/dist/_pkgs/affine-model/elements/core-domain/core-domain.d.ts +28 -0
  211. package/dist/_pkgs/affine-model/elements/core-domain/core-domain.js +129 -2
  212. package/dist/_pkgs/affine-model/elements/cynefin/cynefin.d.ts +8 -0
  213. package/dist/_pkgs/affine-model/elements/cynefin/cynefin.js +45 -2
  214. package/dist/_pkgs/affine-model/elements/edgy/board.js +1 -1
  215. package/dist/_pkgs/affine-model/elements/edgy/facets.js +1 -1
  216. package/dist/_pkgs/affine-model/elements/estuarine/estuarine.d.ts +6 -0
  217. package/dist/_pkgs/affine-model/elements/estuarine/estuarine.js +36 -2
  218. package/dist/_pkgs/affine-model/elements/event-storming/event-storming.d.ts +18 -7
  219. package/dist/_pkgs/affine-model/elements/event-storming/event-storming.js +23 -8
  220. package/dist/_pkgs/affine-model/elements/framework-background/background.d.ts +16 -0
  221. package/dist/_pkgs/affine-model/elements/framework-background/background.js +18 -0
  222. package/dist/_pkgs/affine-model/elements/highlighter/highlighter.js +1 -1
  223. package/dist/_pkgs/affine-model/elements/index.d.ts +8 -0
  224. package/dist/_pkgs/affine-model/elements/index.js +1 -0
  225. package/dist/_pkgs/affine-model/elements/shape/shape.js +1 -1
  226. package/dist/_pkgs/affine-model/elements/text/text.js +1 -1
  227. package/dist/_pkgs/affine-model/elements/uml/band.d.ts +39 -0
  228. package/dist/_pkgs/affine-model/elements/uml/band.js +31 -0
  229. package/dist/_pkgs/affine-model/elements/uml/diagram.d.ts +158 -0
  230. package/dist/_pkgs/affine-model/elements/uml/diagram.js +229 -0
  231. package/dist/_pkgs/affine-model/elements/uml/fragment.d.ts +161 -0
  232. package/dist/_pkgs/affine-model/elements/uml/fragment.js +205 -0
  233. package/dist/_pkgs/affine-model/elements/uml/index.d.ts +8 -0
  234. package/dist/_pkgs/affine-model/elements/uml/index.js +8 -0
  235. package/dist/_pkgs/affine-model/elements/uml/lifeline.d.ts +77 -0
  236. package/dist/_pkgs/affine-model/elements/uml/lifeline.js +89 -0
  237. package/dist/_pkgs/affine-model/elements/uml/node.d.ts +142 -0
  238. package/dist/_pkgs/affine-model/elements/uml/node.js +190 -0
  239. package/dist/_pkgs/affine-model/elements/uml/partition.d.ts +106 -0
  240. package/dist/_pkgs/affine-model/elements/uml/partition.js +172 -0
  241. package/dist/_pkgs/affine-model/elements/uml/region.d.ts +75 -0
  242. package/dist/_pkgs/affine-model/elements/uml/region.js +150 -0
  243. package/dist/_pkgs/affine-model/elements/uml/subject.d.ts +37 -0
  244. package/dist/_pkgs/affine-model/elements/uml/subject.js +108 -0
  245. package/dist/_pkgs/affine-model/elements/wardley/wardley.js +1 -1
  246. package/dist/_pkgs/affine-shared/services/embed-iframe/embed-iframe-config.d.ts +1 -0
  247. package/dist/_pkgs/affine-shared/services/font-loader/config.d.ts +18 -0
  248. package/dist/_pkgs/affine-shared/services/font-loader/config.js +82 -50
  249. package/dist/_pkgs/affine-shared/services/pivot-materiality-publisher.js +1 -9
  250. package/dist/_pkgs/affine-shared/services/telemetry-service/document-damage-watcher.d.ts +53 -0
  251. package/dist/_pkgs/affine-shared/services/telemetry-service/document-damage-watcher.js +95 -0
  252. package/dist/_pkgs/affine-shared/services/telemetry-service/index.d.ts +1 -0
  253. package/dist/_pkgs/affine-shared/services/telemetry-service/index.js +1 -0
  254. package/dist/_pkgs/affine-shared/services/telemetry-service/lifecycle.d.ts +26 -1
  255. package/dist/_pkgs/affine-shared/services/telemetry-service/telemetry-service.d.ts +2 -2
  256. package/dist/_pkgs/affine-shared/services/theme-service.d.ts +19 -0
  257. package/dist/_pkgs/affine-shared/services/theme-service.js +24 -0
  258. package/dist/_pkgs/affine-shared/services/toolbar-service/command-action.d.ts +34 -0
  259. package/dist/_pkgs/affine-shared/services/toolbar-service/command-action.js +63 -0
  260. package/dist/_pkgs/affine-shared/services/toolbar-service/index.d.ts +1 -0
  261. package/dist/_pkgs/affine-shared/services/toolbar-service/index.js +1 -0
  262. package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +97 -7
  263. package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +178 -7
  264. package/dist/_pkgs/affine-shared/styles/index.d.ts +1 -0
  265. package/dist/_pkgs/affine-shared/styles/index.js +1 -0
  266. package/dist/_pkgs/affine-shared/styles/motion.d.ts +14 -0
  267. package/dist/_pkgs/affine-shared/styles/motion.js +38 -0
  268. package/dist/_pkgs/affine-shared/utils/event.d.ts +10 -0
  269. package/dist/_pkgs/affine-shared/utils/event.js +20 -0
  270. package/dist/_pkgs/affine-shared/utils/file/filesys.d.ts +16 -0
  271. package/dist/_pkgs/affine-shared/utils/file/filesys.js +25 -0
  272. package/dist/_pkgs/affine-shared/utils/index.d.ts +1 -0
  273. package/dist/_pkgs/affine-shared/utils/index.js +1 -0
  274. package/dist/_pkgs/affine-shared/utils/link-preview-refresh.d.ts +12 -0
  275. package/dist/_pkgs/affine-shared/utils/link-preview-refresh.js +13 -0
  276. package/dist/_pkgs/affine-widget-edgeless-dragging-area/edgeless-dragging-area-rect.js +2 -2
  277. package/dist/_pkgs/affine-widget-edgeless-selected-rect/utils.js +5 -1
  278. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.d.ts +12 -4
  279. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.js +27 -4
  280. package/dist/_pkgs/affine-widget-edgeless-toolbar/config/types.d.ts +15 -0
  281. package/dist/_pkgs/affine-widget-edgeless-toolbar/config/utils.d.ts +1 -1
  282. package/dist/_pkgs/affine-widget-edgeless-toolbar/config/utils.js +7 -2
  283. package/dist/_pkgs/affine-widget-edgeless-toolbar/create-popper.js +13 -0
  284. package/dist/_pkgs/affine-widget-edgeless-toolbar/index.d.ts +2 -0
  285. package/dist/_pkgs/affine-widget-edgeless-toolbar/index.js +2 -0
  286. package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.d.ts +80 -0
  287. package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/command-menu.js +270 -81
  288. package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/senior-menu-selection.d.ts +15 -0
  289. package/dist/_pkgs/affine-widget-edgeless-toolbar/menu/senior-menu-selection.js +15 -0
  290. package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-family-panel.d.ts +18 -0
  291. package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-family-panel.js +52 -6
  292. package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-weight-and-style-panel.js +8 -1
  293. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-ghost-overlay.d.ts +42 -0
  294. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-ghost-overlay.js +100 -0
  295. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-placement-tool.d.ts +100 -0
  296. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/artefact-placement-tool.js +274 -0
  297. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/index.d.ts +3 -0
  298. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/index.js +3 -0
  299. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/translate-created.d.ts +25 -0
  300. package/dist/_pkgs/affine-widget-edgeless-toolbar/placement/translate-created.js +67 -0
  301. package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.d.ts +6 -0
  302. package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.js +10 -0
  303. package/dist/_pkgs/affine-widget-edgeless-toolbar/view.js +5 -0
  304. package/dist/_pkgs/affine-widget-frame-title/edgeless-frame-title-editor.js +2 -1
  305. package/dist/_pkgs/affine-widget-slash-menu/translations.d.ts +16 -0
  306. package/dist/_pkgs/affine-widget-slash-menu/translations.js +23 -1
  307. package/dist/_pkgs/affine-widget-toolbar/utils.js +57 -14
  308. package/dist/_pkgs/data-view/core/detail/field.js +2 -1
  309. package/dist/_pkgs/data-view/core/filter/literal/define.js +3 -1
  310. package/dist/_pkgs/data-view/core/group-by/renderer/boolean-group.js +1 -1
  311. package/dist/_pkgs/data-view/property-presets/checkbox/cell-renderer.js +8 -2
  312. package/dist/_pkgs/data-view/view-presets/kanban/pc/cell.js +1 -1
  313. package/dist/_pkgs/data-view/view-presets/kanban/pc/controller/drag.js +2 -1
  314. package/dist/_pkgs/data-view/view-presets/table/pc/controller/drag.js +2 -1
  315. package/dist/_pkgs/data-view/view-presets/table/pc/controller/selection.js +1 -1
  316. package/dist/_pkgs/data-view/view-presets/table/pc/header/vertical-indicator.js +2 -1
  317. package/dist/_pkgs/data-view/view-presets/table/pc/row/row-select-checkbox.js +3 -1
  318. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/drag.js +2 -1
  319. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/selection.js +1 -1
  320. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/top/header/vertical-indicator.js +2 -1
  321. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/row/row-header.js +3 -1
  322. package/dist/_pkgs/global/gfx/xywh.js +7 -0
  323. package/dist/_pkgs/std/extension/command-registry.d.ts +158 -1
  324. package/dist/_pkgs/std/extension/command-registry.js +22 -0
  325. package/dist/_pkgs/std/gfx/index.d.ts +1 -1
  326. package/dist/_pkgs/std/gfx/interactivity/gfx-view-event-handler.d.ts +12 -0
  327. package/dist/_pkgs/std/gfx/interactivity/gfx-view-event-handler.js +20 -1
  328. package/dist/_pkgs/std/gfx/interactivity/manager.d.ts +10 -0
  329. package/dist/_pkgs/std/gfx/interactivity/manager.js +12 -0
  330. package/dist/_pkgs/std/gfx/model/surface/element-model.js +12 -7
  331. package/dist/_pkgs/std/gfx/model/surface/role.d.ts +10 -5
  332. package/dist/_pkgs/std/gfx/model/surface/surface-model.d.ts +56 -0
  333. package/dist/_pkgs/std/gfx/model/surface/surface-model.js +84 -3
  334. package/dist/_pkgs/std/gfx/view/view.d.ts +11 -2
  335. package/dist/_pkgs/std/gfx/view/view.js +16 -2
  336. package/dist/commands.d.ts +6 -0
  337. package/dist/commands.js +10 -2
  338. package/dist/frameworks.d.ts +9 -0
  339. package/dist/frameworks.js +19 -0
  340. package/dist/translations.js +21 -0
  341. package/package.json +13 -4
  342. package/dist/_pkgs/affine-gfx-group/group-watcher.d.ts +0 -1
  343. package/dist/_pkgs/affine-gfx-group/group-watcher.js +0 -20
@@ -52,6 +52,21 @@ export const TOAST_NO_LINK_FOUND = [
52
52
  'com.labre.toast.no-link-found',
53
53
  'No link found',
54
54
  ];
55
+ /**
56
+ * What the `doc.copyLink` command says once the document's URL is on the
57
+ * clipboard.
58
+ *
59
+ * Its own wording rather than {@link TOAST_COPIED_TO_CLIPBOARD}: that one
60
+ * reports a SLICE copy (blocks, elements, an image) and this one reports a
61
+ * link, and the two are told apart by nothing else on screen. Its own wording
62
+ * rather than the inline link toolbar's "Copied link to clipboard" too — that
63
+ * key belongs to `@labre/affine-inline-link` and names the `href` a delta
64
+ * already carried, not a document address the host just generated.
65
+ */
66
+ export const TOAST_LINK_COPIED = [
67
+ 'com.labre.toast.link-copied',
68
+ 'Link copied',
69
+ ];
55
70
  /* ── Toolbars and menus ───────────────────────────────────────────────── */
56
71
  export const TOOLBAR_BRING_TO_FRONT = [
57
72
  'com.labre.toolbar.bring-to-front',
@@ -161,6 +176,41 @@ export const BOARD_RESIZE_TOGGLE = [
161
176
  'com.labre.board.toolbar.resize-toggle',
162
177
  'Enable / lock resizing',
163
178
  ];
179
+ /**
180
+ * The orientation toggle a BANDED background carries: the one gesture that
181
+ * turns a frame drawn in columns into the same frame drawn in rows.
182
+ *
183
+ * Declared beside the resize toggle for the same reason and with the same
184
+ * scope: it names a behaviour of the frame primitive — where the name band
185
+ * sits and which way the bands run — rather than anything a notation calls its
186
+ * own. A UML activity partition is the first frame to use it (§15.6.4 draws
187
+ * swimlanes either way and says the choice means nothing); a BPMN pool is the
188
+ * obvious second, and a second key for it would be a second tooltip for one
189
+ * word.
190
+ */
191
+ export const BOARD_ORIENTATION_TOGGLE = [
192
+ 'com.labre.board.toolbar.orientation-toggle',
193
+ 'Vertical / horizontal bands',
194
+ ];
195
+ /**
196
+ * The gesture that divides a banded background one band further — the button a
197
+ * frame carrying zones offers next to the two above.
198
+ *
199
+ * Declared here with them, and for the third time for the same reason: it names
200
+ * a behaviour of the generic frame primitive (a background whose `instanceZones`
201
+ * are a list the author grows) rather than anything a notation calls its own. A
202
+ * UML combined fragment is the first frame to use it — §17.6.4's second operand
203
+ * is a band added to a box that has one — and a BPMN pool's lane is the obvious
204
+ * second the day it stops reaching this through a command of its own.
205
+ *
206
+ * "Band" and not "operand" or "lane": the word has to be true of every frame
207
+ * that offers the button, and each notation's own noun is already written on
208
+ * the element the button is attached to.
209
+ */
210
+ export const BOARD_ADD_BAND = [
211
+ 'com.labre.board.toolbar.add-band',
212
+ 'Add a band',
213
+ ];
164
214
  /**
165
215
  * The legend button, in the two wordings the boards actually use: the notation
166
216
  * boards say "notation", Wardley says "components".
@@ -177,6 +227,26 @@ export const BOARD_LEGEND_COMPONENTS = [
177
227
  'com.labre.board.toolbar.legend.components',
178
228
  'Generate the legend (components present)',
179
229
  ];
230
+ /* ── The connector's own labels ───────────────────────────────────────── */
231
+ /**
232
+ * The two END labels a connector can carry beside its caption — where UML
233
+ * writes a multiplicity and a role name (`docs/adr/0018` phase 2).
234
+ *
235
+ * Declared here and not in the UML pack for the same reason the resize toggle
236
+ * is: they name a part of the generic CONNECTOR, which every framework draws,
237
+ * and a stored connector keeps its end labels with the UML tooling switched off
238
+ * (`docs/adr/0009`). "Source" and "target" are the connector's own words for
239
+ * its two ends, already the vocabulary of `frontEndpointStyle` /
240
+ * `rearEndpointStyle` and of the direction commands.
241
+ */
242
+ export const CONNECTOR_SOURCE_LABEL = [
243
+ 'com.labre.connector.toolbar.source-label',
244
+ 'Source label',
245
+ ];
246
+ export const CONNECTOR_TARGET_LABEL = [
247
+ 'com.labre.connector.toolbar.target-label',
248
+ 'Target label',
249
+ ];
180
250
  /* ── Note shadow styles ────────────────────────────────────────────────
181
251
  * The note block's own shadow options, shared verbatim between the surface
182
252
  * toolbar's style panel (blocks/note) and the edgeless senior menu's shadow
@@ -271,10 +341,9 @@ export const TEXT_FORMAT_STRIKETHROUGH = [
271
341
  ];
272
342
  /* ── Font weight / style ────────────────────────────────────────────────── */
273
343
  /**
274
- * The three font weights and the one non-default font style a text toolbar
275
- * offers — said identically by the toolbar's own "current selection" label
276
- * (`gfx/text`) and by the popup menu that picks them
277
- * (`widgets/edgeless-toolbar`).
344
+ * The font weights and the one non-default font style a text toolbar offers —
345
+ * said identically by the toolbar's own "current selection" label (`gfx/text`)
346
+ * and by the popup menu that picks them (`widgets/edgeless-toolbar`).
278
347
  */
279
348
  export const FONT_WEIGHT_LIGHT = [
280
349
  'com.labre.font.weight.light',
@@ -288,6 +357,12 @@ export const FONT_WEIGHT_SEMIBOLD = [
288
357
  'com.labre.font.weight.semibold',
289
358
  'Semibold',
290
359
  ];
360
+ /**
361
+ * An alias (L7 dedupe): the heaviest canvas weight is said with the same word
362
+ * as the prose toolbar's {@link TEXT_FORMAT_BOLD}, so it shares its one key —
363
+ * exactly as {@link FONT_STYLE_ITALIC} does below.
364
+ */
365
+ export const FONT_WEIGHT_BOLD = TEXT_FORMAT_BOLD;
291
366
  /**
292
367
  * An alias (L7 dedupe): the same word as {@link TEXT_FORMAT_ITALIC}, one key.
293
368
  */
@@ -472,16 +547,42 @@ export const BLOCK_TYPE_DIVIDER_DESCRIPTION = [
472
547
  'Visually separate content.',
473
548
  ];
474
549
  /**
475
- * The auto-legend BOX title every framework's `createAutoLegend` draws
476
- * (`AutoLegendSpec.title`, `@labre/affine-gfx-ddd-shared`) — "Legend" itself,
550
+ * The automatic legend BOX title the shared engine draws
551
+ * (`createBoardLegend`, `@labre/affine-block-surface`) — "Legend" itself,
477
552
  * distinct from the {@link BOARD_LEGEND_NOTATION} / {@link BOARD_LEGEND_COMPONENTS}
478
553
  * toolbar BUTTONS that create it. Declared here because it is the same word on
479
- * every board that has one: the three DDD tools, EDGY and C4 alike.
554
+ * every board that has one, and a board's own command may override it
555
+ * (`CommandLegendBox.titleWording`).
480
556
  */
481
557
  export const BOARD_LEGEND_TITLE = [
482
558
  'com.labre.board.legend.title',
483
559
  'Legend',
484
560
  ];
561
+ /**
562
+ * The group's own seed: the default title a newly created group is stamped
563
+ * with (`Group 2`), written into the document at creation. Resolved at
564
+ * PLACEMENT and never again — a group renamed by its author keeps its name,
565
+ * and a group created before this key existed keeps the plain text it was
566
+ * given.
567
+ *
568
+ * `{{n}}` is the group's 1-based ordinal among the groups already on the doc;
569
+ * see this service's README on why a count carries a param rather than its own
570
+ * key.
571
+ *
572
+ * ## Why it sits here rather than with the group package
573
+ *
574
+ * Two packages group elements and neither may import the other's translations:
575
+ * `@labre/affine-gfx-group`, which owns the gesture, and
576
+ * `@labre/affine-block-surface`, whose legend groups the box it just drew and
577
+ * which `gfx-group` DEPENDS ON. This layer is below both. It is deliberately
578
+ * NOT listed in {@link CHROME_WORDINGS}: the key stays declared by the group
579
+ * package under source `seed` (`GROUP_WORDINGS`), so the manifest is
580
+ * byte-identical to what it was — one key, one source.
581
+ */
582
+ export const GROUP_SEED_NAME = [
583
+ 'com.labre.group.seed.name',
584
+ 'Group {{n}}',
585
+ ];
485
586
  /* ── Undo, wherever a quick-tool or a notification offers it ──────────── */
486
587
  /**
487
588
  * "Undo" said by the link package's quick-tool button (dense + full) and by
@@ -653,6 +754,40 @@ export const PALETTE_NAME_MEDIUM_GREY = [
653
754
  'com.labre.palette-name.medium-grey',
654
755
  'MediumGrey',
655
756
  ];
757
+ /*
758
+ * The `Heavy` row (`DefaultTheme.Palettes`, seven colours and no grey). It was
759
+ * missing from the table until #390 — the row rendered its raw `Palette.key`
760
+ * next to translated neighbours. The exhaustiveness test in
761
+ * `packages/affine/all` now compares this table to the theme.
762
+ */
763
+ export const PALETTE_NAME_HEAVY_RED = [
764
+ 'com.labre.palette-name.heavy-red',
765
+ 'HeavyRed',
766
+ ];
767
+ export const PALETTE_NAME_HEAVY_ORANGE = [
768
+ 'com.labre.palette-name.heavy-orange',
769
+ 'HeavyOrange',
770
+ ];
771
+ export const PALETTE_NAME_HEAVY_YELLOW = [
772
+ 'com.labre.palette-name.heavy-yellow',
773
+ 'HeavyYellow',
774
+ ];
775
+ export const PALETTE_NAME_HEAVY_GREEN = [
776
+ 'com.labre.palette-name.heavy-green',
777
+ 'HeavyGreen',
778
+ ];
779
+ export const PALETTE_NAME_HEAVY_BLUE = [
780
+ 'com.labre.palette-name.heavy-blue',
781
+ 'HeavyBlue',
782
+ ];
783
+ export const PALETTE_NAME_HEAVY_PURPLE = [
784
+ 'com.labre.palette-name.heavy-purple',
785
+ 'HeavyPurple',
786
+ ];
787
+ export const PALETTE_NAME_HEAVY_MAGENTA = [
788
+ 'com.labre.palette-name.heavy-magenta',
789
+ 'HeavyMagenta',
790
+ ];
656
791
  /**
657
792
  * Keyed by the exact `Palette.key` string the default theme's tables produce
658
793
  * (`buildPalettes`, `packages/affine/model/src/themes/{default,utils}.ts`) —
@@ -687,7 +822,30 @@ export const PALETTE_NAME_WORDINGS = {
687
822
  MediumPurple: PALETTE_NAME_MEDIUM_PURPLE,
688
823
  MediumMagenta: PALETTE_NAME_MEDIUM_MAGENTA,
689
824
  MediumGrey: PALETTE_NAME_MEDIUM_GREY,
825
+ HeavyRed: PALETTE_NAME_HEAVY_RED,
826
+ HeavyOrange: PALETTE_NAME_HEAVY_ORANGE,
827
+ HeavyYellow: PALETTE_NAME_HEAVY_YELLOW,
828
+ HeavyGreen: PALETTE_NAME_HEAVY_GREEN,
829
+ HeavyBlue: PALETTE_NAME_HEAVY_BLUE,
830
+ HeavyPurple: PALETTE_NAME_HEAVY_PURPLE,
831
+ HeavyMagenta: PALETTE_NAME_HEAVY_MAGENTA,
690
832
  };
833
+ /* ── Menu shells' accessible names (#390) ─────────────────────────────────
834
+ *
835
+ * The `aria-label` of an `editor-menu-button` is a wording of its OWN, never
836
+ * `` `${translatedLabel}-menu` `` — sewing a suffix onto a translated word
837
+ * gave "changer le type de forme-menu" to a French host. The precedent is
838
+ * `ROOT_ALIGNMENT_MENU_ARIA` (`blocks/root`). The fallbacks are the exact
839
+ * identifiers the composition produced in English, so a catalogue-less
840
+ * playground reads what it always read.
841
+ *
842
+ * This one is HERE and not in a package because three toolbars draw a menu
843
+ * called "Style" (shape, mindmap, connector) — one shared word, one key.
844
+ */
845
+ export const MENU_ARIA_STYLE = [
846
+ 'com.labre.menu-aria.style',
847
+ 'style-menu',
848
+ ];
691
849
  /* ── Clipboard size-limit toasts (adapters/clipboard/utils.ts) ────────── */
692
850
  export const CHROME_CLIPBOARD_FILE_TOO_LARGE = [
693
851
  'com.labre.clipboard.file-too-large',
@@ -1003,6 +1161,7 @@ export const CHROME_WORDINGS = [
1003
1161
  TOAST_NOTE_REMOVED_FROM_PAGE,
1004
1162
  TOAST_FRAME_INSERTED_INTO_PAGE,
1005
1163
  TOAST_NO_LINK_FOUND,
1164
+ TOAST_LINK_COPIED,
1006
1165
  TOOLBAR_BRING_TO_FRONT,
1007
1166
  TOOLBAR_SEND_TO_BACK,
1008
1167
  TOOLBAR_COPY,
@@ -1024,8 +1183,12 @@ export const CHROME_WORDINGS = [
1024
1183
  LINKED_DOC_EMPTY_PREVIEW,
1025
1184
  SYNCED_DOC_EMPTY_PREVIEW,
1026
1185
  BOARD_RESIZE_TOGGLE,
1186
+ BOARD_ORIENTATION_TOGGLE,
1187
+ BOARD_ADD_BAND,
1027
1188
  BOARD_LEGEND_NOTATION,
1028
1189
  BOARD_LEGEND_COMPONENTS,
1190
+ CONNECTOR_SOURCE_LABEL,
1191
+ CONNECTOR_TARGET_LABEL,
1029
1192
  NOTE_SHADOW_NONE,
1030
1193
  NOTE_SHADOW_BOX,
1031
1194
  NOTE_SHADOW_STICKER,
@@ -1150,4 +1313,12 @@ export const CHROME_WORDINGS = [
1150
1313
  PALETTE_NAME_MEDIUM_PURPLE,
1151
1314
  PALETTE_NAME_MEDIUM_MAGENTA,
1152
1315
  PALETTE_NAME_MEDIUM_GREY,
1316
+ PALETTE_NAME_HEAVY_RED,
1317
+ PALETTE_NAME_HEAVY_ORANGE,
1318
+ PALETTE_NAME_HEAVY_YELLOW,
1319
+ PALETTE_NAME_HEAVY_GREEN,
1320
+ PALETTE_NAME_HEAVY_BLUE,
1321
+ PALETTE_NAME_HEAVY_PURPLE,
1322
+ PALETTE_NAME_HEAVY_MAGENTA,
1323
+ MENU_ARIA_STYLE,
1153
1324
  ];
@@ -1,4 +1,5 @@
1
1
  export { fontBaseStyle, fontSMStyle, fontXSStyle } from './font.js';
2
+ export { reducedMotionStyle, SPRING_DURATION_MS, SPRING_EASING, springDuration, springEasing, } from './motion.js';
2
3
  export { panelBaseColorsStyle, panelBaseStyle } from './panel.js';
3
4
  export { scrollbarStyle } from './scrollbar-style.js';
4
5
  export { affineTextStyles } from './text.js';
@@ -1,4 +1,5 @@
1
1
  export { fontBaseStyle, fontSMStyle, fontXSStyle } from './font.js';
2
+ export { reducedMotionStyle, SPRING_DURATION_MS, SPRING_EASING, springDuration, springEasing, } from './motion.js';
2
3
  export { panelBaseColorsStyle, panelBaseStyle } from './panel.js';
3
4
  export { scrollbarStyle } from './scrollbar-style.js';
4
5
  export { affineTextStyles } from './text.js';
@@ -0,0 +1,14 @@
1
+ /** easeOutBack: travel, overshoot a little, settle. */
2
+ export declare const SPRING_EASING = "cubic-bezier(0.34, 1.56, 0.64, 1)";
3
+ /** The house tempo of the edgeless chrome, in milliseconds. */
4
+ export declare const SPRING_DURATION_MS = 240;
5
+ /** {@link SPRING_EASING} for a `css` template. */
6
+ export declare const springEasing: import("lit").CSSResult;
7
+ /** {@link SPRING_DURATION_MS} for a `css` template. */
8
+ export declare const springDuration: import("lit").CSSResult;
9
+ /**
10
+ * Every animation and transition inside `container` off when the reader asked
11
+ * the OS for less motion. The end state is the resting state in each case, so
12
+ * dropping the animation loses nothing but the travel.
13
+ */
14
+ export declare const reducedMotionStyle: (container: string) => import("lit").CSSResult;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * The chrome's motion tokens — the first of them, and deliberately only the
3
+ * values the library had already converged on by hand.
4
+ *
5
+ * The edgeless chrome has been animating at ~0.23-0.24s since upstream
6
+ * (`edgeless-toolbar.ts`, `create-popper.ts`, `date-picker/style.ts`, `toast`),
7
+ * and the fork's one overshoot curve is the senior toolbar's "pop upright"
8
+ * (`gfx/mindmap/src/toolbar/senior-tool.ts`): `cubic-bezier(0.34, 1.56, 0.64, 1)`,
9
+ * the standard easeOutBack. Nothing exported it, so the second component that
10
+ * wanted a springy settle would have invented a third easing. This module is
11
+ * where it stops being a literal.
12
+ *
13
+ * `springEasing` overshoots by design — only use it on a transform that has
14
+ * room to overshoot (a slide, a scale, a rotation), never on a colour or on
15
+ * anything whose end value must never be passed.
16
+ */
17
+ import { css, unsafeCSS } from 'lit';
18
+ /** easeOutBack: travel, overshoot a little, settle. */
19
+ export const SPRING_EASING = 'cubic-bezier(0.34, 1.56, 0.64, 1)';
20
+ /** The house tempo of the edgeless chrome, in milliseconds. */
21
+ export const SPRING_DURATION_MS = 240;
22
+ /** {@link SPRING_EASING} for a `css` template. */
23
+ export const springEasing = unsafeCSS(SPRING_EASING);
24
+ /** {@link SPRING_DURATION_MS} for a `css` template. */
25
+ export const springDuration = unsafeCSS(`${SPRING_DURATION_MS}ms`);
26
+ /**
27
+ * Every animation and transition inside `container` off when the reader asked
28
+ * the OS for less motion. The end state is the resting state in each case, so
29
+ * dropping the animation loses nothing but the travel.
30
+ */
31
+ export const reducedMotionStyle = (container) => css `
32
+ @media (prefers-reduced-motion: reduce) {
33
+ ${unsafeCSS(container)}, ${unsafeCSS(container)} * {
34
+ animation: none !important;
35
+ transition: none !important;
36
+ }
37
+ }
38
+ `;
@@ -19,6 +19,16 @@ export declare function isMiddleButtonPressed(e: MouseEvent): boolean;
19
19
  export declare function isRightButtonPressed(e: MouseEvent): boolean;
20
20
  export declare function stopPropagation(event: Event): void;
21
21
  export declare function isControlledKeyboardEvent(e: KeyboardEvent): boolean;
22
+ /**
23
+ * The editor swallows Tab, Shift-Tab and Enter so that indentation and block
24
+ * splitting stay under the control of the block-scoped handlers. That would
25
+ * however trap the focus on the native controls the editor renders (the
26
+ * collapse button of headings and lists, for instance), which then could
27
+ * neither be reached, left nor activated with the keyboard. When the event
28
+ * originates from such a control — and not from editable text — the native
29
+ * behaviour is let through.
30
+ */
31
+ export declare function isNativeFocusableTarget(target: EventTarget | null): boolean;
22
32
  export declare function isNewTabTrigger(event?: MouseEvent): boolean;
23
33
  export declare function isNewViewTrigger(event?: MouseEvent): boolean;
24
34
  export declare function on<T extends HTMLElement, K extends keyof M, M = HTMLElementEventMap>(element: T, event: K, handler: (ev: M[K]) => void, options?: boolean | AddEventListenerOptions): () => void;
@@ -37,6 +37,26 @@ export function stopPropagation(event) {
37
37
  export function isControlledKeyboardEvent(e) {
38
38
  return e.ctrlKey || e.metaKey || e.altKey;
39
39
  }
40
+ // The editor host itself carries `tabindex="0"` so that it can receive the
41
+ // keystrokes aimed at a block selection; it is the editing surface, not a
42
+ // control, hence the exclusion.
43
+ const NATIVE_FOCUSABLE_SELECTOR = 'button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"]):not(editor-host)';
44
+ /**
45
+ * The editor swallows Tab, Shift-Tab and Enter so that indentation and block
46
+ * splitting stay under the control of the block-scoped handlers. That would
47
+ * however trap the focus on the native controls the editor renders (the
48
+ * collapse button of headings and lists, for instance), which then could
49
+ * neither be reached, left nor activated with the keyboard. When the event
50
+ * originates from such a control — and not from editable text — the native
51
+ * behaviour is let through.
52
+ */
53
+ export function isNativeFocusableTarget(target) {
54
+ if (!(target instanceof Element))
55
+ return false;
56
+ if (target instanceof HTMLElement && target.isContentEditable)
57
+ return false;
58
+ return !!target.closest(NATIVE_FOCUSABLE_SELECTOR);
59
+ }
40
60
  export function isNewTabTrigger(event) {
41
61
  return event
42
62
  ? (event.ctrlKey || event.metaKey || event.button === 1) && !event.altKey
@@ -52,6 +52,22 @@ export declare function openSingleFileWith(acceptType?: AcceptTypes): Promise<Fi
52
52
  */
53
53
  export declare function openSingleFileWithSpec(spec: FilePickerSpec): Promise<File | null>;
54
54
  export declare function getImageFilesFromLocal(): Promise<File[]>;
55
+ /**
56
+ * A name a file system will accept, minus the extension.
57
+ *
58
+ * The sanitiser the framework exports each wrote for themselves
59
+ * (`wardleySafeFilename`, `c4SafeFilename`, BPMN's) — same five steps, same
60
+ * 120-character ceiling — lifted here for the callers that belong to no
61
+ * framework at all. The generic SVG export (ADR 0025) is the first of them: it
62
+ * writes a file for ELEVEN kinds of board, so it has no framework's fallback to
63
+ * borrow and takes one as a parameter instead.
64
+ *
65
+ * The three framework copies stay where they are: each is part of an
66
+ * interchange capability with its own format id and its own declared fallback
67
+ * (`map`, `board`, `process`), and rewriting them to call this one would touch
68
+ * three exported APIs for no behaviour change.
69
+ */
70
+ export declare function safeFilename(raw: string | undefined, fallback: string): string;
55
71
  export declare function downloadBlob(blob: Blob, name: string): void;
56
72
  /**
57
73
  * Because the image block and attachment block have different props.
@@ -188,6 +188,31 @@ export async function getImageFilesFromLocal() {
188
188
  const files = await openFilesWith('Images');
189
189
  return files ?? [];
190
190
  }
191
+ /**
192
+ * A name a file system will accept, minus the extension.
193
+ *
194
+ * The sanitiser the framework exports each wrote for themselves
195
+ * (`wardleySafeFilename`, `c4SafeFilename`, BPMN's) — same five steps, same
196
+ * 120-character ceiling — lifted here for the callers that belong to no
197
+ * framework at all. The generic SVG export (ADR 0025) is the first of them: it
198
+ * writes a file for ELEVEN kinds of board, so it has no framework's fallback to
199
+ * borrow and takes one as a parameter instead.
200
+ *
201
+ * The three framework copies stay where they are: each is part of an
202
+ * interchange capability with its own format id and its own declared fallback
203
+ * (`map`, `board`, `process`), and rewriting them to call this one would touch
204
+ * three exported APIs for no behaviour change.
205
+ */
206
+ export function safeFilename(raw, fallback) {
207
+ const safe = (raw ?? '')
208
+ .trim()
209
+ .replaceAll(/[\\/:*?"<>|]/g, '-')
210
+ .replaceAll(/\s+/g, ' ')
211
+ .trim()
212
+ .slice(0, 120)
213
+ .replace(/[. ]+$/, '');
214
+ return safe || fallback;
215
+ }
191
216
  export function downloadBlob(blob, name) {
192
217
  const dataURL = URL.createObjectURL(blob);
193
218
  const tmpLink = document.createElement('a');
@@ -13,6 +13,7 @@ export * from './fractional-indexing.js';
13
13
  export * from './image.js';
14
14
  export * from './insert.js';
15
15
  export * from './is-abort-error.js';
16
+ export * from './link-preview-refresh.js';
16
17
  export * from './math.js';
17
18
  export * from './model/index.js';
18
19
  export * from './popper-position.js';
@@ -13,6 +13,7 @@ export * from './fractional-indexing.js';
13
13
  export * from './image.js';
14
14
  export * from './insert.js';
15
15
  export * from './is-abort-error.js';
16
+ export * from './link-preview-refresh.js';
16
17
  export * from './math.js';
17
18
  export * from './model/index.js';
18
19
  export * from './popper-position.js';
@@ -0,0 +1,12 @@
1
+ import type { Store } from '../../store/index.js';
2
+ /**
3
+ * Whether a bookmark or embed card must refetch its link preview after a props
4
+ * change.
5
+ *
6
+ * `BlockModel.propsUpdated` carries the key only, so a subscriber cannot tell a
7
+ * local edit from an update that arrived from another peer. A readonly peer
8
+ * receives the change like everyone else; the author is the one who refetches
9
+ * and syncs the result. Without this guard every reader of the document races
10
+ * the author to rewrite the same title, description and image.
11
+ */
12
+ export declare function shouldRefreshOnPropsUpdate(store: Store, key: string): boolean;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Whether a bookmark or embed card must refetch its link preview after a props
3
+ * change.
4
+ *
5
+ * `BlockModel.propsUpdated` carries the key only, so a subscriber cannot tell a
6
+ * local edit from an update that arrived from another peer. A readonly peer
7
+ * receives the change like everyone else; the author is the one who refetches
8
+ * and syncs the result. Without this guard every reader of the document races
9
+ * the author to rewrite the same title, description and image.
10
+ */
11
+ export function shouldRefreshOnPropsUpdate(store, key) {
12
+ return key === 'url' && !store.readonly;
13
+ }
@@ -10,11 +10,11 @@ export class EdgelessDraggingAreaRectWidget extends WidgetComponent {
10
10
  static { this.styles = css `
11
11
  .affine-edgeless-dragging-area {
12
12
  position: absolute;
13
- background: ${unsafeCSS(cssVarV2('edgeless/selection/selectionMarqueeBackground', '#1E96EB14'))};
13
+ background: ${unsafeCSS(cssVarV2('edgeless/selection/selectionMarqueeBackground'))};
14
14
  box-sizing: border-box;
15
15
  border-width: 1px;
16
16
  border-style: solid;
17
- border-color: ${unsafeCSS(cssVarV2('edgeless/selection/selectionMarqueeBorder', '#1E96EB'))};
17
+ border-color: ${unsafeCSS(cssVarV2('edgeless/selection/selectionMarqueeBorder'))};
18
18
 
19
19
  z-index: 1;
20
20
  pointer-events: none;
@@ -1,6 +1,7 @@
1
1
  import { EdgelessCRUDIdentifier, isNoteBlock, Overlay, } from '../affine-block-surface/index.js';
2
2
  import { ShapeFactory } from '../affine-gfx-shape/index.js';
3
3
  import { getShapeRadius, getShapeType, GroupElementModel, ShapeElementModel, } from '../affine-model/index.js';
4
+ import { getChromeAccentColor } from '../affine-shared/services/index.js';
4
5
  import { BlockSuiteError, ErrorCode } from '../global/exceptions/index.js';
5
6
  import { Bound, normalizeDegAngle } from '../global/gfx/index.js';
6
7
  import { assertType } from '../global/utils/index.js';
@@ -33,7 +34,10 @@ export class AutoCompleteTextOverlay extends AutoCompleteTargetOverlay {
33
34
  render(ctx, _rc) {
34
35
  const [x, y, w, h] = this.xywh;
35
36
  ctx.globalAlpha = 0.4;
36
- ctx.strokeStyle = '#1e96eb';
37
+ // The accent read from the theme, not a literal: a canvas context cannot
38
+ // take a `var(…)`, so the token is resolved here (DESIGN.md, The Borrowed
39
+ // Blue Rule).
40
+ ctx.strokeStyle = getChromeAccentColor(this.gfx.std);
37
41
  ctx.lineWidth = 1;
38
42
  ctx.strokeRect(x, y, w, h);
39
43
  // fill text placeholder
@@ -138,11 +138,19 @@ export declare class EdgelessArtefactCatalogueWidget extends WidgetComponent<Roo
138
138
  */
139
139
  private _chord;
140
140
  /**
141
- * Run the command. The panel STAYS OPEN.
141
+ * Arm an artefact, run anything else. The panel STAYS OPEN either way.
142
142
  *
143
- * `runCommand` is the one bottleneck (ADR 0008): the telemetry and the usage
144
- * measure are emitted there, and `surface: 'catalogue'` is what makes this
145
- * panel distinguishable from the sub-menu in the numbers.
143
+ * An artefact row arms the placement tool exactly as the senior menu's does
144
+ * (PO decision, 2026-09-16): the ghost goes under the cursor and the click on
145
+ * the canvas says where. The panel is one gesture away from the board, so it
146
+ * can stay open behind the ghost.
147
+ *
148
+ * For everything else `runCommand` is the one bottleneck (ADR 0008): the
149
+ * telemetry and the usage measure are emitted there, and `surface:
150
+ * 'catalogue'` is what makes this panel distinguishable from the sub-menu in
151
+ * the numbers. An armed artefact reports at PLACEMENT instead, through the
152
+ * tool, so its `surface` reads `'senior-menu'` — the row it belongs to,
153
+ * whichever surface offered it.
146
154
  *
147
155
  * Staying open is the PO's call (recette, 27/08/2026), reversing the first
148
156
  * default: a catalogue is where a user furnishes a diagram, and furnishing is
@@ -37,9 +37,11 @@ import { TOUCH_TARGET_MIN_PX } from '../../affine-shared/consts/index.js';
37
37
  import { CATALOGUE_OTHER, translateKey } from '../../affine-shared/services/index.js';
38
38
  import { IS_MAC } from '../../global/env/index.js';
39
39
  import { getCommandIcon, CommandUsageIdentifier, getCommandsForSurface, isCommandAvailable, normalizeLegacyCombo, rankCommandsByUsage, runCommand, ShortcutOverrideIdentifier, WidgetComponent, WidgetViewExtension, } from '../../std/index.js';
40
+ import { GfxControllerIdentifier } from '../../std/gfx/index.js';
40
41
  import { css, html, nothing, unsafeCSS } from 'lit';
41
42
  import { state } from 'lit/decorators.js';
42
43
  import { literal, unsafeStatic } from 'lit/static-html.js';
44
+ import { armArtefact, armedArtefact, } from '../placement/artefact-placement-tool.js';
43
45
  import { CATALOGUE_CATEGORY_KEY_PREFIX, groupCommandsByCategory, humanizeCategory, } from './catalogue-groups.js';
44
46
  import { formatChord } from './chord-format.js';
45
47
  export const EDGELESS_ARTEFACT_CATALOGUE_WIDGET = 'edgeless-artefact-catalogue-widget';
@@ -122,6 +124,15 @@ let EdgelessArtefactCatalogueWidget = (() => {
122
124
  // it is in another tree, and its own click already landed.
123
125
  if (event.composedPath().includes(this))
124
126
  return;
127
+ // So does the click that PLACES the artefact this panel just armed. A row
128
+ // taps to arm since 2026-09-16, and the gesture that finishes it is a click
129
+ // on the canvas — which is also the click-away. Read literally, the panel
130
+ // would dismiss itself halfway through its own interaction, and furnishing
131
+ // a diagram would cost a re-open per artefact: exactly the open-click-reopen
132
+ // the PO reversed on 27/08/2026. The placement returns to the default tool,
133
+ // so the NEXT click outside puts the panel away as it always has.
134
+ if (armedArtefact(this.std.get(GfxControllerIdentifier)))
135
+ return;
125
136
  this.closePanel();
126
137
  };
127
138
  /**
@@ -437,11 +448,19 @@ let EdgelessArtefactCatalogueWidget = (() => {
437
448
  return keys.length ? formatChord(keys, IS_MAC) : null;
438
449
  }
439
450
  /**
440
- * Run the command. The panel STAYS OPEN.
451
+ * Arm an artefact, run anything else. The panel STAYS OPEN either way.
452
+ *
453
+ * An artefact row arms the placement tool exactly as the senior menu's does
454
+ * (PO decision, 2026-09-16): the ghost goes under the cursor and the click on
455
+ * the canvas says where. The panel is one gesture away from the board, so it
456
+ * can stay open behind the ghost.
441
457
  *
442
- * `runCommand` is the one bottleneck (ADR 0008): the telemetry and the usage
443
- * measure are emitted there, and `surface: 'catalogue'` is what makes this
444
- * panel distinguishable from the sub-menu in the numbers.
458
+ * For everything else `runCommand` is the one bottleneck (ADR 0008): the
459
+ * telemetry and the usage measure are emitted there, and `surface:
460
+ * 'catalogue'` is what makes this panel distinguishable from the sub-menu in
461
+ * the numbers. An armed artefact reports at PLACEMENT instead, through the
462
+ * tool, so its `surface` reads `'senior-menu'` — the row it belongs to,
463
+ * whichever surface offered it.
445
464
  *
446
465
  * Staying open is the PO's call (recette, 27/08/2026), reversing the first
447
466
  * default: a catalogue is where a user furnishes a diagram, and furnishing is
@@ -450,6 +469,10 @@ let EdgelessArtefactCatalogueWidget = (() => {
450
469
  * or a click on the canvas.
451
470
  */
452
471
  _invoke(command) {
472
+ if (command.kind === 'artefact') {
473
+ armArtefact(this.std.get(GfxControllerIdentifier), command.owner, command);
474
+ return;
475
+ }
453
476
  runCommand(this.std, command, {
454
477
  surface: 'catalogue',
455
478
  source: 'toolbar:general',
@@ -25,6 +25,21 @@ export type Menu<T> = {
25
25
  tooltip?: string;
26
26
  /** {@link tooltip}, for the translation seam. */
27
27
  tooltipWording?: ChromeWording;
28
+ /**
29
+ * The accessible name of the MENU shell (`aria-label` on
30
+ * `editor-menu-button`) — its own key, never a composition (#390).
31
+ *
32
+ * Before this field the shell's name was sewn together as
33
+ * `` `${resolvedLabel.toLowerCase()}-menu` ``, which was a stable
34
+ * identifier while `label` was English and became half-translated
35
+ * ("changer le type de forme-menu") the day `label` joined the seam. The
36
+ * precedent is `ROOT_ALIGNMENT_MENU_ARIA` (`blocks/root`): a menu's aria is
37
+ * a wording of its own.
38
+ *
39
+ * Left out, the name is composed from the ENGLISH {@link label}, so a
40
+ * caller that declares nothing keeps exactly the identifier it had.
41
+ */
42
+ menuAriaWording?: ChromeWording;
28
43
  items: MenuItem<T>[];
29
44
  currentValue: T;
30
45
  onPick: (value: T) => void;
@@ -7,6 +7,6 @@ export declare function renderCurrentMenuItemWith<T, F extends keyof MenuItem<T>
7
7
  * resolved through `std` when the caller has one, else its `key` literal.
8
8
  */
9
9
  export declare function resolveMenuItemLabel<T>(items: MenuItem<T>[], currentValue: T, std?: BlockStdScope): string | undefined;
10
- export declare function renderMenu<T>({ label, labelWording, tooltip, tooltipWording, icon, items, currentValue, onPick, std, }: Menu<T>): import("lit-html").TemplateResult<1>;
10
+ export declare function renderMenu<T>({ label, labelWording, tooltip, tooltipWording, menuAriaWording, icon, items, currentValue, onPick, std, }: Menu<T>): import("lit-html").TemplateResult<1>;
11
11
  export declare function renderMenuItems<T>(items: MenuItem<T>[], currentValue: T, onPick: (value: T) => void, std?: BlockStdScope): unknown;
12
12
  export declare function getRootBlock(ctx: ToolbarContext): BlockComponent | null;