@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
@@ -0,0 +1,106 @@
1
+ /**
2
+ * The framework palettes a colour picker offers as a CAROUSEL, and the rule
3
+ * that decides which page it opens on (`docs/adr/0027`).
4
+ *
5
+ * Three pieces, in dependency order:
6
+ *
7
+ * 1. **The seam** — {@link FrameworkPaletteExtension}, registered from a
8
+ * framework's FLAG-GATED view extension. Offering hues is TOOLING, so a
9
+ * framework switched off disappears from the carousel while every colour it
10
+ * ever wrote stays exactly where it is (`docs/adr/0009`).
11
+ * 2. **The resolver** — {@link frameworkOfElement}: which framework a selected
12
+ * element belongs to, from what the document already says.
13
+ * 3. **The builder** — {@link frameworkPaletteGroups}: the carousel a toolbar
14
+ * hands the picker, base palette first and never hidden (DESIGN.md, "The
15
+ * Coexisting Palettes Rule").
16
+ *
17
+ * Nothing here is written to a document: a picked swatch is still a plain
18
+ * stored colour value, and `packages/affine/model` is untouched.
19
+ */
20
+ import { type Palette } from '../../affine-model/index.js';
21
+ import { type ChromeWording } from '../../affine-shared/services/index.js';
22
+ import { type BlockStdScope, type FrameworkId } from '../../std/index.js';
23
+ import { type GfxController, type GfxModel } from '../../std/gfx/index.js';
24
+ import type { ExtensionType } from '../../store/index.js';
25
+ import type { NamedPalette } from './types.js';
26
+ /**
27
+ * A framework's contribution to the carousel: its own name and its own hues.
28
+ *
29
+ * `palettes` is the framework's existing `*_PALETTE_LIST` — the same array its
30
+ * node toolbar already seeds its picker with — so registering one is a
31
+ * one-liner in the view extension and no palette is restated.
32
+ */
33
+ export type FrameworkPalette = {
34
+ framework: FrameworkId;
35
+ /** The framework's own name, as the carousel prints it. */
36
+ labelWording: ChromeWording;
37
+ palettes: NamedPalette[];
38
+ };
39
+ /**
40
+ * A framework registers its palette here, and nothing else registers one.
41
+ * Multi-instance, keyed by {@link FrameworkPalette.framework}, exactly like
42
+ * `TemplateCategoryIdentifier` (`gfx/template/src/contribute.ts`): two
43
+ * extensions claiming the same framework collide at set-up
44
+ * (`DuplicateServiceDefinitionError`) rather than showing the page twice.
45
+ */
46
+ export declare const FrameworkPaletteIdentifier: import("../../global/di/types.js").ServiceIdentifier<FrameworkPalette> & (<U extends FrameworkPalette = FrameworkPalette>(variant: import("../../global/di/types.js").ServiceVariant) => import("../../global/di/types.js").ServiceIdentifier<U>);
47
+ /**
48
+ * Register a framework's palette. Call it from `setup()` of the FLAG-GATED
49
+ * view extension, beside the senior tool:
50
+ *
51
+ * ```ts
52
+ * context.register(FrameworkPaletteExtension(WARDLEY_FRAMEWORK_PALETTE));
53
+ * ```
54
+ */
55
+ export declare function FrameworkPaletteExtension(...palettes: FrameworkPalette[]): ExtensionType;
56
+ /** One page of the carousel. */
57
+ export type PaletteGroup = {
58
+ /** {@link BASE_PALETTE_KEY} for the editor's own palette, else a `FrameworkId`. */
59
+ key: string;
60
+ /** Already resolved through the host's catalogue — ready to print. */
61
+ label: string;
62
+ palettes: readonly Palette[];
63
+ };
64
+ /** The whole carousel, plus the page it opens on. */
65
+ export type PaletteCarousel = {
66
+ groups: PaletteGroup[];
67
+ activeKey: string;
68
+ };
69
+ /** The key of the page that is never a framework's and never hidden. */
70
+ export declare const BASE_PALETTE_KEY = "default";
71
+ /**
72
+ * Which framework this element belongs to, read off the document.
73
+ *
74
+ * Three tiers, checked in order:
75
+ *
76
+ * 1. **Its own role's namespace.** A role id is `<framework>:<role>`, so a
77
+ * Wardley component says `wardley` and a Wardley map says it too — boards
78
+ * carry roles like everything else.
79
+ * 2. **For a connector, its ends.** A link is drawn between artefacts and
80
+ * belongs to what it links; a plain connector stamps no role of its own.
81
+ * Both ends must agree, otherwise the link crosses two notations and the
82
+ * board below gets the last word.
83
+ * 3. **The smallest board that contains it.** A native shape dropped on a
84
+ * Wardley map is being used as part of that map, whatever it stamps.
85
+ *
86
+ * `undefined` — a neutral element on the bare canvas — means "no framework",
87
+ * and the carousel then simply opens on the base palette.
88
+ */
89
+ export declare function frameworkOfElement(gfx: GfxController, model: GfxModel): FrameworkId | undefined;
90
+ /**
91
+ * The framework a whole selection belongs to — the one they all share, or
92
+ * `undefined` as soon as two of them disagree. A picker serving a mixed
93
+ * selection has no framework of origin to open on, so it opens on the base
94
+ * palette, which is true of every element in it.
95
+ */
96
+ export declare function frameworkOfSelection(gfx: GfxController, models: readonly GfxModel[]): FrameworkId | undefined;
97
+ /**
98
+ * The carousel a contextual toolbar hands its colour picker.
99
+ *
100
+ * The base palette is page one and is ALWAYS there (DESIGN.md, "The Coexisting
101
+ * Palettes Rule"); the frameworks whose tooling is on follow, in
102
+ * {@link FRAMEWORK_IDS} order so the pages read the same way on every board.
103
+ * `activeKey` is the framework of the selection when that framework is on the
104
+ * carousel, else the base palette.
105
+ */
106
+ export declare function frameworkPaletteGroups(std: BlockStdScope, models: readonly GfxModel[], basePalettes: readonly Palette[]): PaletteCarousel;
@@ -0,0 +1,177 @@
1
+ /**
2
+ * The framework palettes a colour picker offers as a CAROUSEL, and the rule
3
+ * that decides which page it opens on (`docs/adr/0027`).
4
+ *
5
+ * Three pieces, in dependency order:
6
+ *
7
+ * 1. **The seam** — {@link FrameworkPaletteExtension}, registered from a
8
+ * framework's FLAG-GATED view extension. Offering hues is TOOLING, so a
9
+ * framework switched off disappears from the carousel while every colour it
10
+ * ever wrote stays exactly where it is (`docs/adr/0009`).
11
+ * 2. **The resolver** — {@link frameworkOfElement}: which framework a selected
12
+ * element belongs to, from what the document already says.
13
+ * 3. **The builder** — {@link frameworkPaletteGroups}: the carousel a toolbar
14
+ * hands the picker, base palette first and never hidden (DESIGN.md, "The
15
+ * Coexisting Palettes Rule").
16
+ *
17
+ * Nothing here is written to a document: a picked swatch is still a plain
18
+ * stored colour value, and `packages/affine/model` is untouched.
19
+ */
20
+ import { ConnectorElementModel, FrameworkBackgroundElementModel, } from '../../affine-model/index.js';
21
+ import { translateKey, } from '../../affine-shared/services/index.js';
22
+ import { createIdentifier } from '../../global/di/index.js';
23
+ import { FRAMEWORK_IDS, frameworkOfRole, } from '../../std/index.js';
24
+ import { GfxControllerIdentifier, } from '../../std/gfx/index.js';
25
+ import { PALETTE_GROUP_DEFAULT } from '../translations.js';
26
+ /**
27
+ * A framework registers its palette here, and nothing else registers one.
28
+ * Multi-instance, keyed by {@link FrameworkPalette.framework}, exactly like
29
+ * `TemplateCategoryIdentifier` (`gfx/template/src/contribute.ts`): two
30
+ * extensions claiming the same framework collide at set-up
31
+ * (`DuplicateServiceDefinitionError`) rather than showing the page twice.
32
+ */
33
+ export const FrameworkPaletteIdentifier = createIdentifier('FrameworkPalette');
34
+ /**
35
+ * Register a framework's palette. Call it from `setup()` of the FLAG-GATED
36
+ * view extension, beside the senior tool:
37
+ *
38
+ * ```ts
39
+ * context.register(FrameworkPaletteExtension(WARDLEY_FRAMEWORK_PALETTE));
40
+ * ```
41
+ */
42
+ export function FrameworkPaletteExtension(...palettes) {
43
+ return {
44
+ setup: di => {
45
+ for (const palette of palettes) {
46
+ di.addImpl(FrameworkPaletteIdentifier(palette.framework), () => palette);
47
+ }
48
+ },
49
+ };
50
+ }
51
+ /** The key of the page that is never a framework's and never hidden. */
52
+ export const BASE_PALETTE_KEY = 'default';
53
+ /** The role an element carries, for the models that can carry one. */
54
+ function roleOf(model) {
55
+ return model.role;
56
+ }
57
+ /** Width × height of an element's bound — how "smallest board" is measured. */
58
+ function area(model) {
59
+ const { w, h } = model.elementBound;
60
+ return w * h;
61
+ }
62
+ /**
63
+ * The smallest framework board whose bound CONTAINS this element's.
64
+ *
65
+ * Smallest, so a C4 container boundary drawn inside a C4 board — or any board
66
+ * nested in another — wins over the sheet it sits on: the nearer frame is the
67
+ * one an author is working in. A board never answers about itself.
68
+ */
69
+ function containingBoard(gfx, model) {
70
+ const bound = model.elementBound;
71
+ let best;
72
+ for (const element of gfx.surface?.elementModels ?? []) {
73
+ if (!(element instanceof FrameworkBackgroundElementModel))
74
+ continue;
75
+ if (element.id === model.id)
76
+ continue;
77
+ if (!element.elementBound.contains(bound))
78
+ continue;
79
+ if (!best || area(element) < area(best))
80
+ best = element;
81
+ }
82
+ return best;
83
+ }
84
+ /**
85
+ * A node's framework: what it says about itself, else what it was dropped on.
86
+ *
87
+ * Kept apart from {@link frameworkOfElement} so a connector's endpoints are
88
+ * resolved without recursing back into the connector branch.
89
+ */
90
+ function frameworkOfNode(gfx, model) {
91
+ const own = frameworkOfRole(roleOf(model));
92
+ if (own)
93
+ return own;
94
+ const board = containingBoard(gfx, model);
95
+ return board ? frameworkOfRole(roleOf(board)) : undefined;
96
+ }
97
+ /** The single value shared by every item, or `undefined` if they disagree. */
98
+ function unanimous(values) {
99
+ return new Set(values).size === 1 ? values[0] : undefined;
100
+ }
101
+ /**
102
+ * Which framework this element belongs to, read off the document.
103
+ *
104
+ * Three tiers, checked in order:
105
+ *
106
+ * 1. **Its own role's namespace.** A role id is `<framework>:<role>`, so a
107
+ * Wardley component says `wardley` and a Wardley map says it too — boards
108
+ * carry roles like everything else.
109
+ * 2. **For a connector, its ends.** A link is drawn between artefacts and
110
+ * belongs to what it links; a plain connector stamps no role of its own.
111
+ * Both ends must agree, otherwise the link crosses two notations and the
112
+ * board below gets the last word.
113
+ * 3. **The smallest board that contains it.** A native shape dropped on a
114
+ * Wardley map is being used as part of that map, whatever it stamps.
115
+ *
116
+ * `undefined` — a neutral element on the bare canvas — means "no framework",
117
+ * and the carousel then simply opens on the base palette.
118
+ */
119
+ export function frameworkOfElement(gfx, model) {
120
+ const own = frameworkOfRole(roleOf(model));
121
+ if (own)
122
+ return own;
123
+ if (model instanceof ConnectorElementModel) {
124
+ const ends = [model.source?.id, model.target?.id]
125
+ .map(id => (id ? gfx.getElementById(id) : null))
126
+ .filter((end) => !!end)
127
+ .map(end => frameworkOfNode(gfx, end))
128
+ .filter((id) => !!id);
129
+ const fromEnds = unanimous(ends);
130
+ if (fromEnds)
131
+ return fromEnds;
132
+ }
133
+ const board = containingBoard(gfx, model);
134
+ return board ? frameworkOfRole(roleOf(board)) : undefined;
135
+ }
136
+ /**
137
+ * The framework a whole selection belongs to — the one they all share, or
138
+ * `undefined` as soon as two of them disagree. A picker serving a mixed
139
+ * selection has no framework of origin to open on, so it opens on the base
140
+ * palette, which is true of every element in it.
141
+ */
142
+ export function frameworkOfSelection(gfx, models) {
143
+ if (!models.length)
144
+ return undefined;
145
+ return unanimous(models.map(model => frameworkOfElement(gfx, model)));
146
+ }
147
+ /**
148
+ * The carousel a contextual toolbar hands its colour picker.
149
+ *
150
+ * The base palette is page one and is ALWAYS there (DESIGN.md, "The Coexisting
151
+ * Palettes Rule"); the frameworks whose tooling is on follow, in
152
+ * {@link FRAMEWORK_IDS} order so the pages read the same way on every board.
153
+ * `activeKey` is the framework of the selection when that framework is on the
154
+ * carousel, else the base palette.
155
+ */
156
+ export function frameworkPaletteGroups(std, models, basePalettes) {
157
+ const contributed = [
158
+ ...std.provider.getAll(FrameworkPaletteIdentifier).values(),
159
+ ].sort((a, b) => FRAMEWORK_IDS.indexOf(a.framework) - FRAMEWORK_IDS.indexOf(b.framework));
160
+ const groups = [
161
+ {
162
+ key: BASE_PALETTE_KEY,
163
+ label: translateKey(std, ...PALETTE_GROUP_DEFAULT),
164
+ palettes: basePalettes,
165
+ },
166
+ ...contributed.map(palette => ({
167
+ key: palette.framework,
168
+ label: translateKey(std, ...palette.labelWording),
169
+ palettes: palette.palettes,
170
+ })),
171
+ ];
172
+ const origin = frameworkOfSelection(std.get(GfxControllerIdentifier), models);
173
+ const activeKey = groups.some(group => group.key === origin)
174
+ ? origin
175
+ : BASE_PALETTE_KEY;
176
+ return { groups, activeKey };
177
+ }
@@ -5,6 +5,8 @@ import { EdgelessColorCustomButton } from './custom-button.js';
5
5
  export * from './button.js';
6
6
  export * from './color-panel.js';
7
7
  export * from './color-picker.js';
8
+ export * from './framework-palette.js';
9
+ export * from './palette-carousel.js';
8
10
  export * from './types.js';
9
11
  export * from './utils.js';
10
12
  export declare function effects(): void;
@@ -5,6 +5,8 @@ import { EdgelessColorCustomButton } from './custom-button.js';
5
5
  export * from './button.js';
6
6
  export * from './color-panel.js';
7
7
  export * from './color-picker.js';
8
+ export * from './framework-palette.js';
9
+ export * from './palette-carousel.js';
8
10
  export * from './types.js';
9
11
  export * from './utils.js';
10
12
  export function effects() {
@@ -0,0 +1,85 @@
1
+ /**
2
+ * The palette header a colour picker draws above its swatch grid when more than
3
+ * one palette is on offer (`docs/adr/0027`): the page's name, opening an inline
4
+ * list of every page IN PLACE of the grid, and a wheel over the panel paging
5
+ * like a carousel.
6
+ *
7
+ * A render helper and a stylesheet rather than a custom element: the two
8
+ * pickers that show it (`edgeless-color-picker-button` and
9
+ * `edgeless-shape-color-picker`) live in different shadow roots and already own
10
+ * their own `render()`, and a third element registered in `effects()` would buy
11
+ * nothing but a tag name.
12
+ *
13
+ * Everything here is driven by `click`, never by a default action.
14
+ * `editor-toolbar` cancels every `pointerdown` in its subtree — popper menus
15
+ * included — to keep the canvas selection and the focus where they are
16
+ * (`toolbar/toolbar.ts`), and a cancelled `pointerdown` suppresses the
17
+ * compatibility `mousedown` whose default action is the only thing that opens a
18
+ * native `<select>`. `click` survives that policy untouched, which is why the
19
+ * list is ours and not the platform's.
20
+ *
21
+ * The header is the PANEL'S TITLE, not a bar bolted on top of it: a compact,
22
+ * content-width trigger whose name starts on the very x the section labels
23
+ * ("Fill color", "Border color") and the swatch grid start on. Its hit area
24
+ * comes from padding cancelled by an equal negative margin, so the hover pill
25
+ * bleeds outward while the text itself stays on the panel's left grid line.
26
+ */
27
+ import { ColorScheme } from '../../affine-model/index.js';
28
+ import type { BlockStdScope } from '../../std/index.js';
29
+ import { nothing, type TemplateResult } from 'lit';
30
+ import type { PaletteGroup } from './framework-palette.js';
31
+ /** Include in the host component's `static styles`. */
32
+ export declare const paletteCarouselStyles: import("lit").CSSResult;
33
+ /**
34
+ * Where the new page comes FROM. `settle` is "from nowhere in particular": the
35
+ * first paint of a panel, and the list closing on the page it opened on.
36
+ */
37
+ export type PaletteCarouselDirection = 'next' | 'prev' | 'settle';
38
+ type CarouselOptions = {
39
+ groups: readonly PaletteGroup[];
40
+ index: number;
41
+ onPage: (index: number, direction: PaletteCarouselDirection) => void;
42
+ /** Whether the inline list of pages is showing instead of the swatch grid. */
43
+ open?: boolean;
44
+ /** Where the page on screen came from, for the entry animation. */
45
+ direction?: PaletteCarouselDirection;
46
+ };
47
+ /**
48
+ * The wheel handler each host binds on its own PANEL container — the header and
49
+ * the swatch grids alike, because "the mouse has to be on the name" was the
50
+ * second half of the recette's failure.
51
+ *
52
+ * Wrap-around in both directions: the pages are a ring, not a list, and the
53
+ * base palette is always one of them. The direction is the wheel's own sign,
54
+ * never the index delta, so wrapping from the last page to the first still
55
+ * comes in from the right.
56
+ */
57
+ export declare function paletteCarouselWheel(options: CarouselOptions): (e: WheelEvent) => void;
58
+ /**
59
+ * The swatches of the page on screen, wrapped so that paging slides them in.
60
+ * The host passes its own grid (both of them, in the shape picker, each in its
61
+ * own wrapper — same key, same timing, so the two move together).
62
+ *
63
+ * `keyed` is the whole mechanism: the wrapper is torn down and rebuilt on a
64
+ * page change, which restarts the CSS animation and, by the same token, cancels
65
+ * the one in flight. No JS animation, nothing to queue, and the swatches stay
66
+ * clickable throughout (a CSS animation never takes the pointer).
67
+ */
68
+ export declare function paletteCarouselPage(options: {
69
+ groups: readonly PaletteGroup[];
70
+ index: number;
71
+ direction?: PaletteCarouselDirection;
72
+ }, content: TemplateResult): import("lit-html/directive.js").DirectiveResult<typeof import("lit-html/directives/keyed.js").Keyed>;
73
+ /**
74
+ * The header row — and, when {@link CarouselOptions.open} is set, the list of
75
+ * pages the host draws INSTEAD of its swatch grid. `nothing` when there is
76
+ * nothing to page through, which is what every call site that passes no groups
77
+ * at all gets, so a picker with one palette renders exactly as it did before
78
+ * this existed.
79
+ */
80
+ export declare function renderPaletteCarousel(options: CarouselOptions & {
81
+ onToggle: (open: boolean) => void;
82
+ std?: BlockStdScope;
83
+ theme?: ColorScheme;
84
+ }): TemplateResult | typeof nothing;
85
+ export {};