@formicoidea/labre-core 0.49.0 → 0.51.0

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 (241) hide show
  1. package/dist/_pkgs/affine-block-attachment/asset-picker.d.ts +24 -0
  2. package/dist/_pkgs/affine-block-attachment/asset-picker.js +87 -0
  3. package/dist/_pkgs/affine-block-attachment/configs/slash-menu.js +3 -20
  4. package/dist/_pkgs/affine-block-attachment/index.d.ts +1 -0
  5. package/dist/_pkgs/affine-block-attachment/index.js +1 -0
  6. package/dist/_pkgs/affine-block-attachment/utils.d.ts +9 -1
  7. package/dist/_pkgs/affine-block-attachment/utils.js +9 -0
  8. package/dist/_pkgs/affine-block-bookmark/adapters/markdown/markdown.js +14 -1
  9. package/dist/_pkgs/affine-block-bookmark/adapters/notion-html.js +5 -1
  10. package/dist/_pkgs/affine-block-database/adapters/markdown.js +5 -3
  11. package/dist/_pkgs/affine-block-embed/common/adapters/html.js +5 -3
  12. package/dist/_pkgs/affine-block-embed/common/adapters/markdown.js +11 -0
  13. package/dist/_pkgs/affine-block-frame/frame-template.d.ts +58 -0
  14. package/dist/_pkgs/affine-block-frame/frame-template.js +207 -0
  15. package/dist/_pkgs/affine-block-frame/frame-toolbar.js +19 -3
  16. package/dist/_pkgs/affine-block-frame/index.d.ts +1 -0
  17. package/dist/_pkgs/affine-block-frame/index.js +1 -0
  18. package/dist/_pkgs/affine-block-frame/translations.d.ts +7 -0
  19. package/dist/_pkgs/affine-block-frame/translations.js +16 -1
  20. package/dist/_pkgs/affine-block-frame/view.js +6 -0
  21. package/dist/_pkgs/affine-block-image/asset-picker.d.ts +63 -0
  22. package/dist/_pkgs/affine-block-image/asset-picker.js +183 -0
  23. package/dist/_pkgs/affine-block-image/commands/insert-images.d.ts +5 -0
  24. package/dist/_pkgs/affine-block-image/commands/insert-images.js +8 -8
  25. package/dist/_pkgs/affine-block-image/components/page-image-block.d.ts +11 -0
  26. package/dist/_pkgs/affine-block-image/components/page-image-block.js +81 -12
  27. package/dist/_pkgs/affine-block-image/configs/replace-action.d.ts +9 -0
  28. package/dist/_pkgs/affine-block-image/configs/replace-action.js +27 -0
  29. package/dist/_pkgs/affine-block-image/configs/toolbar.js +6 -0
  30. package/dist/_pkgs/affine-block-image/crop/crop-controller.d.ts +46 -0
  31. package/dist/_pkgs/affine-block-image/crop/crop-controller.js +104 -0
  32. package/dist/_pkgs/affine-block-image/crop/crop-math.d.ts +70 -0
  33. package/dist/_pkgs/affine-block-image/crop/crop-math.js +141 -0
  34. package/dist/_pkgs/affine-block-image/crop/crop-overlay.d.ts +57 -0
  35. package/dist/_pkgs/affine-block-image/crop/crop-overlay.js +343 -0
  36. package/dist/_pkgs/affine-block-image/crop/crop-toolbar.d.ts +12 -0
  37. package/dist/_pkgs/affine-block-image/crop/crop-toolbar.js +78 -0
  38. package/dist/_pkgs/affine-block-image/crop/write-crop.d.ts +16 -0
  39. package/dist/_pkgs/affine-block-image/crop/write-crop.js +57 -0
  40. package/dist/_pkgs/affine-block-image/edgeless-clipboard-config.js +4 -1
  41. package/dist/_pkgs/affine-block-image/effects.js +2 -0
  42. package/dist/_pkgs/affine-block-image/image-block.d.ts +2 -0
  43. package/dist/_pkgs/affine-block-image/image-block.js +2 -0
  44. package/dist/_pkgs/affine-block-image/image-edgeless-block.d.ts +2 -0
  45. package/dist/_pkgs/affine-block-image/image-edgeless-block.js +36 -8
  46. package/dist/_pkgs/affine-block-image/image-resize-manager.js +15 -0
  47. package/dist/_pkgs/affine-block-image/index.d.ts +1 -0
  48. package/dist/_pkgs/affine-block-image/index.js +1 -0
  49. package/dist/_pkgs/affine-block-image/translations.d.ts +15 -0
  50. package/dist/_pkgs/affine-block-image/translations.js +43 -0
  51. package/dist/_pkgs/affine-block-image/utils.d.ts +13 -0
  52. package/dist/_pkgs/affine-block-image/utils.js +10 -1
  53. package/dist/_pkgs/affine-block-root/clipboard/page-clipboard.js +5 -0
  54. package/dist/_pkgs/affine-block-root/commands/page-export-commands.d.ts +2 -0
  55. package/dist/_pkgs/affine-block-root/commands/page-export-commands.js +71 -0
  56. package/dist/_pkgs/affine-block-root/index.d.ts +1 -0
  57. package/dist/_pkgs/affine-block-root/index.js +1 -0
  58. package/dist/_pkgs/affine-block-root/view.js +8 -0
  59. package/dist/_pkgs/affine-block-surface/extensions/drawio-export/capability.d.ts +30 -0
  60. package/dist/_pkgs/affine-block-surface/extensions/drawio-export/capability.js +44 -0
  61. package/dist/_pkgs/affine-block-surface/extensions/drawio-export/colors.d.ts +26 -0
  62. package/dist/_pkgs/affine-block-surface/extensions/drawio-export/colors.js +82 -0
  63. package/dist/_pkgs/affine-block-surface/extensions/drawio-export/command.d.ts +18 -0
  64. package/dist/_pkgs/affine-block-surface/extensions/drawio-export/command.js +91 -0
  65. package/dist/_pkgs/affine-block-surface/extensions/drawio-export/index.d.ts +3 -0
  66. package/dist/_pkgs/affine-block-surface/extensions/drawio-export/index.js +3 -0
  67. package/dist/_pkgs/affine-block-surface/extensions/drawio-export/writer.d.ts +50 -0
  68. package/dist/_pkgs/affine-block-surface/extensions/drawio-export/writer.js +732 -0
  69. package/dist/_pkgs/affine-block-surface/extensions/export-manager/draw-image-block.d.ts +12 -0
  70. package/dist/_pkgs/affine-block-surface/extensions/export-manager/draw-image-block.js +15 -0
  71. package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.js +7 -1
  72. package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.d.ts +7 -1
  73. package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.js +60 -1
  74. package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.d.ts +2 -2
  75. package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.js +2 -2
  76. package/dist/_pkgs/affine-block-surface/extensions/export-svg/marker-version.d.ts +6 -0
  77. package/dist/_pkgs/affine-block-surface/extensions/export-svg/marker-version.js +8 -0
  78. package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.d.ts +28 -1
  79. package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.js +66 -6
  80. package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.d.ts +2 -7
  81. package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.js +2 -6
  82. package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +2 -0
  83. package/dist/_pkgs/affine-block-surface/extensions/index.js +2 -0
  84. package/dist/_pkgs/affine-block-surface/extensions/interchange-export.d.ts +84 -0
  85. package/dist/_pkgs/affine-block-surface/extensions/interchange-export.js +150 -0
  86. package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +24 -2
  87. package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +23 -2
  88. package/dist/_pkgs/affine-block-surface/extensions/interchange.js +4 -1
  89. package/dist/_pkgs/affine-block-surface/extensions/legend-role.d.ts +18 -0
  90. package/dist/_pkgs/affine-block-surface/extensions/legend-role.js +20 -0
  91. package/dist/_pkgs/affine-block-surface/extensions/legend.d.ts +2 -19
  92. package/dist/_pkgs/affine-block-surface/extensions/legend.js +2 -18
  93. package/dist/_pkgs/affine-block-surface/extensions/svg-sanitize.d.ts +67 -0
  94. package/dist/_pkgs/affine-block-surface/extensions/svg-sanitize.js +235 -0
  95. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.d.ts +1 -0
  96. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.js +9 -0
  97. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.d.ts +17 -13
  98. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +52 -80
  99. package/dist/_pkgs/affine-block-surface/extensions/xml-element.d.ts +98 -0
  100. package/dist/_pkgs/affine-block-surface/extensions/xml-element.js +261 -0
  101. package/dist/_pkgs/affine-block-surface/extensions/xml-reader.d.ts +238 -0
  102. package/dist/_pkgs/affine-block-surface/extensions/xml-reader.js +570 -0
  103. package/dist/_pkgs/affine-block-surface/framework-background/def.js +1 -1
  104. package/dist/_pkgs/affine-block-surface/interchange-headless.d.ts +29 -0
  105. package/dist/_pkgs/affine-block-surface/interchange-headless.js +32 -0
  106. package/dist/_pkgs/affine-block-surface/view.js +22 -2
  107. package/dist/_pkgs/affine-block-table/adapters/utils.js +24 -1
  108. package/dist/_pkgs/affine-components/color-picker/color-panel.d.ts +11 -0
  109. package/dist/_pkgs/affine-components/color-picker/color-panel.js +87 -12
  110. package/dist/_pkgs/affine-components/color-picker/framework-palette.d.ts +8 -0
  111. package/dist/_pkgs/affine-components/color-picker/framework-palette.js +11 -3
  112. package/dist/_pkgs/affine-components/color-picker/icons.d.ts +9 -0
  113. package/dist/_pkgs/affine-components/color-picker/icons.js +12 -0
  114. package/dist/_pkgs/affine-gfx-note/toolbar/note-menu.js +5 -8
  115. package/dist/_pkgs/affine-gfx-template/contribute.d.ts +14 -4
  116. package/dist/_pkgs/affine-gfx-template/contribute.js +47 -6
  117. package/dist/_pkgs/affine-gfx-template/toolbar/builtin-templates.d.ts +7 -2
  118. package/dist/_pkgs/affine-gfx-template/toolbar/builtin-templates.js +14 -40
  119. package/dist/_pkgs/affine-gfx-template/toolbar/resolve-name.d.ts +1 -1
  120. package/dist/_pkgs/affine-gfx-template/toolbar/resolve-name.js +1 -1
  121. package/dist/_pkgs/affine-gfx-template/toolbar/template-panel.d.ts +4 -4
  122. package/dist/_pkgs/affine-gfx-template/toolbar/template-panel.js +9 -9
  123. package/dist/_pkgs/affine-gfx-template/toolbar/template-type.d.ts +2 -4
  124. package/dist/_pkgs/affine-gfx-template/translations.d.ts +5 -0
  125. package/dist/_pkgs/affine-gfx-template/translations.js +9 -0
  126. package/dist/_pkgs/affine-inline-footnote/adapters/markdown/inline-delta.js +6 -0
  127. package/dist/_pkgs/affine-inline-footnote/adapters/markdown/markdown-inline.js +7 -0
  128. package/dist/_pkgs/affine-inline-link/adapters/html/html-inline.js +4 -1
  129. package/dist/_pkgs/affine-inline-link/adapters/html/inline-delta.js +3 -1
  130. package/dist/_pkgs/affine-inline-link/adapters/markdown/inline-delta.js +4 -1
  131. package/dist/_pkgs/affine-inline-link/adapters/notion-html/html-inline.js +2 -1
  132. package/dist/_pkgs/affine-inline-link/link-node/affine-link.d.ts +7 -0
  133. package/dist/_pkgs/affine-inline-link/link-node/affine-link.js +37 -0
  134. package/dist/_pkgs/affine-inline-link/link-node/index.d.ts +1 -0
  135. package/dist/_pkgs/affine-inline-link/link-node/index.js +1 -0
  136. package/dist/_pkgs/affine-inline-link/link-node/propose-views.d.ts +22 -0
  137. package/dist/_pkgs/affine-inline-link/link-node/propose-views.js +59 -0
  138. package/dist/_pkgs/affine-model/blocks/database/types.d.ts +28 -0
  139. package/dist/_pkgs/affine-model/blocks/image/image-crop.d.ts +48 -0
  140. package/dist/_pkgs/affine-model/blocks/image/image-crop.js +78 -0
  141. package/dist/_pkgs/affine-model/blocks/image/image-model.d.ts +6 -0
  142. package/dist/_pkgs/affine-model/blocks/image/image-model.js +2 -0
  143. package/dist/_pkgs/affine-model/blocks/image/index.d.ts +1 -0
  144. package/dist/_pkgs/affine-model/blocks/image/index.js +1 -0
  145. package/dist/_pkgs/affine-model/consts/shape.d.ts +2 -0
  146. package/dist/_pkgs/affine-model/consts/shape.js +5 -0
  147. package/dist/_pkgs/affine-model/elements/bpmn/consts.d.ts +31 -0
  148. package/dist/_pkgs/affine-model/elements/bpmn/consts.js +31 -0
  149. package/dist/_pkgs/affine-model/elements/bpmn/index.d.ts +1 -0
  150. package/dist/_pkgs/affine-model/elements/bpmn/index.js +1 -0
  151. package/dist/_pkgs/affine-model/elements/bpmn/pool.d.ts +0 -25
  152. package/dist/_pkgs/affine-model/elements/bpmn/pool.js +1 -25
  153. package/dist/_pkgs/affine-model/elements/shape/shape.d.ts +0 -2
  154. package/dist/_pkgs/affine-model/elements/shape/shape.js +1 -2
  155. package/dist/_pkgs/affine-model/elements/uml/consts.d.ts +133 -0
  156. package/dist/_pkgs/affine-model/elements/uml/consts.js +107 -0
  157. package/dist/_pkgs/affine-model/elements/uml/diagram.d.ts +1 -79
  158. package/dist/_pkgs/affine-model/elements/uml/diagram.js +1 -53
  159. package/dist/_pkgs/affine-model/elements/uml/fragment.d.ts +0 -15
  160. package/dist/_pkgs/affine-model/elements/uml/fragment.js +1 -15
  161. package/dist/_pkgs/affine-model/elements/uml/index.d.ts +1 -0
  162. package/dist/_pkgs/affine-model/elements/uml/index.js +1 -0
  163. package/dist/_pkgs/affine-model/elements/uml/partition.d.ts +0 -20
  164. package/dist/_pkgs/affine-model/elements/uml/partition.js +1 -20
  165. package/dist/_pkgs/affine-model/elements/uml/region.d.ts +0 -11
  166. package/dist/_pkgs/affine-model/elements/uml/region.js +1 -11
  167. package/dist/_pkgs/affine-model/headless.d.ts +19 -0
  168. package/dist/_pkgs/affine-model/headless.js +19 -0
  169. package/dist/_pkgs/affine-shared/headless.d.ts +10 -0
  170. package/dist/_pkgs/affine-shared/headless.js +10 -0
  171. package/dist/_pkgs/affine-shared/services/asset-picker-service.d.ts +63 -0
  172. package/dist/_pkgs/affine-shared/services/asset-picker-service.js +20 -0
  173. package/dist/_pkgs/affine-shared/services/data-source-picker-service.d.ts +6 -3
  174. package/dist/_pkgs/affine-shared/services/frame-template-service.d.ts +83 -0
  175. package/dist/_pkgs/affine-shared/services/frame-template-service.js +17 -0
  176. package/dist/_pkgs/affine-shared/services/index.d.ts +2 -0
  177. package/dist/_pkgs/affine-shared/services/index.js +2 -0
  178. package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +6 -0
  179. package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +10 -0
  180. package/dist/_pkgs/affine-widget-drag-handle/watchers/drag-event-watcher.js +8 -3
  181. package/dist/_pkgs/affine-widget-keyboard-toolbar/config.js +4 -16
  182. package/dist/_pkgs/affine-widget-linked-doc/transformers/html.d.ts +7 -0
  183. package/dist/_pkgs/affine-widget-linked-doc/transformers/html.js +25 -24
  184. package/dist/_pkgs/affine-widget-linked-doc/transformers/index.d.ts +1 -1
  185. package/dist/_pkgs/affine-widget-linked-doc/transformers/markdown.d.ts +7 -0
  186. package/dist/_pkgs/affine-widget-linked-doc/transformers/markdown.js +26 -25
  187. package/dist/_pkgs/affine-widget-linked-doc/transformers/utils.d.ts +23 -0
  188. package/dist/_pkgs/affine-widget-linked-doc/transformers/utils.js +14 -0
  189. package/dist/_pkgs/data-view/core/common/properties.d.ts +29 -0
  190. package/dist/_pkgs/data-view/core/common/properties.js +110 -8
  191. package/dist/_pkgs/data-view/core/common/property-menu.d.ts +44 -1
  192. package/dist/_pkgs/data-view/core/common/property-menu.js +100 -3
  193. package/dist/_pkgs/data-view/core/component/tags/color-carousel.d.ts +41 -0
  194. package/dist/_pkgs/data-view/core/component/tags/color-carousel.js +199 -0
  195. package/dist/_pkgs/data-view/core/component/tags/color-menu.d.ts +49 -0
  196. package/dist/_pkgs/data-view/core/component/tags/color-menu.js +123 -0
  197. package/dist/_pkgs/data-view/core/component/tags/index.d.ts +3 -0
  198. package/dist/_pkgs/data-view/core/component/tags/index.js +3 -0
  199. package/dist/_pkgs/data-view/core/component/tags/multi-tag-select.d.ts +8 -1
  200. package/dist/_pkgs/data-view/core/component/tags/multi-tag-select.js +21 -20
  201. package/dist/_pkgs/data-view/core/component/tags/softened-colors.d.ts +42 -0
  202. package/dist/_pkgs/data-view/core/component/tags/softened-colors.js +79 -0
  203. package/dist/_pkgs/data-view/core/data-view.d.ts +8 -1
  204. package/dist/_pkgs/data-view/core/data-view.js +18 -2
  205. package/dist/_pkgs/data-view/core/effect.js +2 -1
  206. package/dist/_pkgs/data-view/core/filter/eval.d.ts +6 -1
  207. package/dist/_pkgs/data-view/core/filter/eval.js +7 -2
  208. package/dist/_pkgs/data-view/core/group-by/renderer/select-group.d.ts +3 -0
  209. package/dist/_pkgs/data-view/core/group-by/renderer/select-group.js +119 -71
  210. package/dist/_pkgs/data-view/core/view/color-rules.d.ts +85 -0
  211. package/dist/_pkgs/data-view/core/view/color-rules.js +165 -0
  212. package/dist/_pkgs/data-view/core/view/index.d.ts +1 -0
  213. package/dist/_pkgs/data-view/core/view/index.js +1 -0
  214. package/dist/_pkgs/data-view/property-presets/multi-select/cell-renderer.js +1 -0
  215. package/dist/_pkgs/data-view/property-presets/select/cell-renderer.js +1 -0
  216. package/dist/_pkgs/data-view/translations.d.ts +34 -0
  217. package/dist/_pkgs/data-view/translations.js +80 -0
  218. package/dist/_pkgs/data-view/view-presets/gallery/gallery-view.js +7 -1
  219. package/dist/_pkgs/data-view/view-presets/kanban/mobile/card.js +6 -1
  220. package/dist/_pkgs/data-view/view-presets/kanban/pc/card.js +6 -1
  221. package/dist/_pkgs/data-view/view-presets/list/list-view.js +4 -0
  222. package/dist/_pkgs/data-view/view-presets/table/mobile/row.js +3 -0
  223. package/dist/_pkgs/data-view/view-presets/table/pc/header/database-header-column.d.ts +3 -1
  224. package/dist/_pkgs/data-view/view-presets/table/pc/header/database-header-column.js +149 -175
  225. package/dist/_pkgs/data-view/view-presets/table/pc/row/row.js +6 -0
  226. package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/color-rules-menu.d.ts +12 -0
  227. package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/color-rules-menu.js +206 -0
  228. package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-options.js +16 -2
  229. package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-settings.d.ts +4 -2
  230. package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-settings.js +11 -2
  231. package/dist/commands.js +5 -2
  232. package/dist/host-panels.d.ts +21 -1
  233. package/dist/host-panels.js +50 -10
  234. package/dist/interchange.d.ts +1 -0
  235. package/dist/interchange.js +1 -0
  236. package/dist/model/headless.d.ts +1 -0
  237. package/dist/model/headless.js +1 -0
  238. package/dist/shared/headless.d.ts +1 -0
  239. package/dist/shared/headless.js +1 -0
  240. package/dist/translations.js +8 -1
  241. package/package.json +13 -1
@@ -34,7 +34,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
34
34
  };
35
35
  import { menu, popMenu, popupTargetFromElement, } from '../../../../../affine-components/context-menu/index.js';
36
36
  import { unsafeCSSVarV2 } from '../../../../../affine-shared/theme/index.js';
37
- import { ArrowRightSmallIcon, DeleteIcon, DuplicateIcon, FilterIcon, GroupingIcon, InfoIcon, LayoutIcon, MoreHorizontalIcon, OpenInNewIcon, SortIcon, } from '@blocksuite/icons/lit';
37
+ import { ArrowRightSmallIcon, DeleteIcon, DuplicateIcon, FilterIcon, GroupingIcon, InfoIcon, LayoutIcon, MoreHorizontalIcon, OpenInNewIcon, PaletteIcon, SortIcon, } from '@blocksuite/icons/lit';
38
38
  import { stdContext } from '../../../../../std/index.js';
39
39
  import { consume } from '@lit/context';
40
40
  import { css, html } from 'lit';
@@ -48,7 +48,8 @@ import { englishWording, wordingOf, } from '../../../../core/utils/wording.js';
48
48
  import { WidgetBase } from '../../../../core/widget/widget-base.js';
49
49
  import { popFilterRoot } from '../../../quick-setting-bar/filter/root-panel-view.js';
50
50
  import { popSortRoot } from '../../../quick-setting-bar/sort/root-panel.js';
51
- import { DATA_VIEW_OPEN_IN } from '../../../../translations.js';
51
+ import { DATA_VIEW_COLOR_RULES, DATA_VIEW_OPEN_IN, } from '../../../../translations.js';
52
+ import { viewColorRules } from '../../../../core/view/color-rules.js';
52
53
  import { openInCurrent, openInOptions, openViewSetting, popViewSetting, viewSettingAvailable, } from './view-settings.js';
53
54
  const styles = css `
54
55
  .affine-database-toolbar-item.more-action {
@@ -254,6 +255,19 @@ const createSettingMenus = (target, dataViewLogic, reopen, wording) => {
254
255
  },
255
256
  }));
256
257
  }
258
+ if (viewSettingAvailable(dataViewLogic, 'color-rules')) {
259
+ const ruleCount = viewColorRules(view.manager.dataSource.viewDataGet(view.id)).length;
260
+ settingItems.push(menu.action({
261
+ name: wording(DATA_VIEW_COLOR_RULES),
262
+ prefix: PaletteIcon(),
263
+ postfix: html ` <div style="font-size: 14px;">${ruleCount || ''}</div>
264
+ ${ArrowRightSmallIcon()}`,
265
+ testId: 'dv-view-setting-color-rules',
266
+ select: () => {
267
+ openViewSetting(target, dataViewLogic, 'color-rules', reopen, wording);
268
+ },
269
+ }));
270
+ }
257
271
  const openIn = openInMenu(dataViewLogic, reopen, wording);
258
272
  if (openIn)
259
273
  settingItems.push(openIn);
@@ -12,10 +12,12 @@ import type { Wording } from '../../../../core/utils/wording.js';
12
12
  * library's own menu are one code path: same menus, same writes, same
13
13
  * "back" to the view settings. Open: a later minor may add a key.
14
14
  */
15
- export type ViewSettingKey = 'layout' | 'properties' | 'group' | 'open-in';
15
+ export type ViewSettingKey = 'layout' | 'properties' | 'group' | 'open-in' | 'color-rules';
16
16
  /**
17
17
  * Whether the current view offers `key`: grouping needs the group trait,
18
- * "Open pages in" a source whose rows are pages (B8). A read-only or
18
+ * "Open pages in" a source whose rows are pages (B8), conditional colours
19
+ * the filter trait, whose conditions a rule is made of (ADR 0036; the
20
+ * calendar has none, and paints no rule). A read-only or
19
21
  * fallback view offers nothing: its settings menu is not drawn either.
20
22
  */
21
23
  export declare function viewSettingAvailable(dataViewLogic: DataViewUILogicBase, key: ViewSettingKey): boolean;
@@ -3,12 +3,14 @@ import { CenterPeekIcon, ExpandFullIcon, RightSidebarIcon, } from '@blocksuite/i
3
3
  import { html } from 'lit';
4
4
  import { styleMap } from 'lit/directives/style-map.js';
5
5
  import { popPropertiesSetting } from '../../../../core/common/properties.js';
6
+ import { filterTraitKey } from '../../../../core/filter/trait.js';
6
7
  import { popGroupSetting, popSelectGroupByProperty, } from '../../../../core/group-by/setting.js';
7
8
  import { groupTraitKey } from '../../../../core/group-by/trait.js';
8
9
  import { renderUniLit, } from '../../../../core/index.js';
9
10
  import { rowsArePages, viewOpenIn, viewOpenInSet, } from '../../../../core/view/open-in.js';
10
11
  import { PropertiesPanelOpenerKey } from '../../../../core/view-manager/properties-panel-opener.js';
11
12
  import { DATA_VIEW_OPEN_IN, DATA_VIEW_OPEN_IN_CENTER, DATA_VIEW_OPEN_IN_FULL, DATA_VIEW_OPEN_IN_SIDE, } from '../../../../translations.js';
13
+ import { popColorRules } from './color-rules-menu.js';
12
14
  /** The three places a row's page opens, in the stored order (ADR 0035 §8). */
13
15
  const OPEN_IN_CHOICES = [
14
16
  { mode: 'side', wording: DATA_VIEW_OPEN_IN_SIDE, icon: RightSidebarIcon },
@@ -17,7 +19,9 @@ const OPEN_IN_CHOICES = [
17
19
  ];
18
20
  /**
19
21
  * Whether the current view offers `key`: grouping needs the group trait,
20
- * "Open pages in" a source whose rows are pages (B8). A read-only or
22
+ * "Open pages in" a source whose rows are pages (B8), conditional colours
23
+ * the filter trait, whose conditions a rule is made of (ADR 0036; the
24
+ * calendar has none, and paints no rule). A read-only or
21
25
  * fallback view offers nothing: its settings menu is not drawn either.
22
26
  */
23
27
  export function viewSettingAvailable(dataViewLogic, key) {
@@ -29,6 +33,8 @@ export function viewSettingAvailable(dataViewLogic, key) {
29
33
  return !!view.traitGet(groupTraitKey);
30
34
  case 'open-in':
31
35
  return rowsArePages(view.manager.dataSource);
36
+ case 'color-rules':
37
+ return !!view.traitGet(filterTraitKey);
32
38
  case 'layout':
33
39
  case 'properties':
34
40
  return true;
@@ -160,7 +166,7 @@ export function openViewSetting(target, dataViewLogic, key, reopen, wording) {
160
166
  openPanel(view.id);
161
167
  return;
162
168
  }
163
- popPropertiesSetting(target, { view, onBack: reopen });
169
+ popPropertiesSetting(target, { view, onBack: reopen, wording });
164
170
  return;
165
171
  }
166
172
  case 'group': {
@@ -183,5 +189,8 @@ export function openViewSetting(target, dataViewLogic, key, reopen, wording) {
183
189
  options: openInOptions(dataViewLogic, reopen, wording),
184
190
  });
185
191
  return;
192
+ case 'color-rules':
193
+ popColorRules(target, dataViewLogic, reopen, wording);
194
+ return;
186
195
  }
187
196
  }
package/dist/commands.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { frameCommands } from './_pkgs/affine-block-frame/index.js';
2
- import { copyLinkCommands, coreCommands, pivotCommands, readingCommands, tagCommands, } from './_pkgs/affine-block-root/index.js';
3
- import { auditCommands, canvasExportCommands, canvasGridCommands, exportSvgCommands, mapQualityCommands, selectionPaneCommands, userLayerCommands, } from './_pkgs/affine-block-surface/index.js';
2
+ import { copyLinkCommands, coreCommands, pageExportCommands, pivotCommands, readingCommands, tagCommands, } from './_pkgs/affine-block-root/index.js';
3
+ import { auditCommands, canvasDrawioExportCommands, canvasExportCommands, canvasGridCommands, canvasSvgExportCommands, exportSvgCommands, mapQualityCommands, selectionPaneCommands, userLayerCommands, } from './_pkgs/affine-block-surface/index.js';
4
4
  import { edgeDirectionCommands } from './_pkgs/affine-gfx-connector/index.js';
5
5
  import { shapeCommands } from './_pkgs/affine-gfx-shape/index.js';
6
6
  import { toCommandManifestEntry, } from './_pkgs/std/index.js';
@@ -49,6 +49,7 @@ export function getCommands(flags) {
49
49
  return buildCommandRegistry([
50
50
  ...coreCommands,
51
51
  ...copyLinkCommands,
52
+ ...pageExportCommands,
52
53
  ...pivotCommands,
53
54
  ...tagCommands,
54
55
  ...readingCommands,
@@ -59,6 +60,8 @@ export function getCommands(flags) {
59
60
  ...frameCommands,
60
61
  ...canvasGridCommands,
61
62
  ...canvasExportCommands,
63
+ ...canvasDrawioExportCommands,
64
+ ...canvasSvgExportCommands,
62
65
  ...userLayerCommands,
63
66
  ...edgeDirectionCommands,
64
67
  ...(isCapabilityEnabled(flags, 'ai-audit') ? auditCommands : []),
@@ -1,5 +1,6 @@
1
1
  import { type FramePreview } from './_pkgs/affine-fragment-frame-panel/index.js';
2
2
  import type { FrameBlockModel } from './_pkgs/affine-model/index.js';
3
+ import { type TranslationParams } from './_pkgs/affine-shared/services/index.js';
3
4
  import { type BlockStdScope, type CommandFile } from './_pkgs/std/index.js';
4
5
  /**
5
6
  * `@labre/affine/host-panels` — the verbs a host's own panel calls (ADR 0034
@@ -121,6 +122,13 @@ export interface ViewAction {
121
122
  label: string;
122
123
  /** The `com.labre.*` key behind {@link label}, for a host that translates itself. */
123
124
  labelKey: string;
125
+ /**
126
+ * The `{{name}}` values {@link labelKey} is filled with, for a host that
127
+ * translates itself — present only on a label that has placeholders (the
128
+ * framework exports: `{ framework, extension }`, the framework's name
129
+ * already resolved). {@link label} has them filled in.
130
+ */
131
+ labelParams?: TranslationParams;
124
132
  /** Stable asset key; `getCommandIcon(std, iconKey)` is the library's icon. */
125
133
  iconKey?: string;
126
134
  /** Present only on a toggle: the state a check mark shows. */
@@ -143,7 +151,8 @@ export interface ViewActionResult {
143
151
  /**
144
152
  * The actions proper to the view the editor shows now, in their declared
145
153
  * order: the commands registered on the `'view-menu'` surface whose `scope`
146
- * is this mode (or `'global'`) and whose `when` holds.
154
+ * is this mode (or `'global'`) and whose `when` holds, and on the canvas
155
+ * one export per framework format the interchange registry can write.
147
156
  *
148
157
  * `mode` is the view the host shows; omitted, it is read from
149
158
  * `DocModeProvider`, and a provider that does not know (the library default
@@ -157,6 +166,17 @@ export interface ViewActionResult {
157
166
  * mode switch: the `std` is rebuilt.
158
167
  */
159
168
  export declare function getViewActions(std: BlockStdScope, mode?: 'page' | 'edgeless'): ViewAction[];
169
+ /**
170
+ * The exports of the view the editor shows now — the `'export'` section of
171
+ * {@link getViewActions}, in the same order: what a host lists in ONE
172
+ * "Export…" menu. On the page: Markdown and HTML. On the canvas: PNG and PDF
173
+ * (with an `ExportManager`), draw.io, SVG (with a canvas renderer), one entry
174
+ * per framework format the registry writes (`canvas.export.<framework>.<format>`,
175
+ * listed while the board holds that framework's elements), then Markdown and
176
+ * HTML. Every one resolves {@link runViewAction} with `{ file }` and downloads
177
+ * nothing.
178
+ */
179
+ export declare function getViewExports(std: BlockStdScope, mode?: 'page' | 'edgeless'): ViewAction[];
160
180
  /**
161
181
  * Run one entry of {@link getViewActions} by its id, through `runCommand`'s
162
182
  * bottleneck (usage and telemetry recorded once), and wait for it.
@@ -1,8 +1,10 @@
1
1
  import { EdgelessFrameManagerIdentifier } from './_pkgs/affine-block-frame/index.js';
2
2
  import { AFFINE_FRAME_PREVIEW, } from './_pkgs/affine-fragment-frame-panel/index.js';
3
- import { DocModeProvider, translateKey } from './_pkgs/affine-shared/services/index.js';
3
+ import { interchangeExportActions } from './_pkgs/affine-block-surface/index.js';
4
+ import { DocModeProvider, translateKey, } from './_pkgs/affine-shared/services/index.js';
4
5
  import { getRegisteredCommands, isCommandAvailable, runCommandAsync, } from './_pkgs/std/index.js';
5
6
  import { GfxControllerIdentifier } from './_pkgs/std/gfx/index.js';
7
+ import { frameworkDescriptor } from './frameworks.js';
6
8
  /**
7
9
  * `@labre/affine/host-panels` — the verbs a host's own panel calls (ADR 0034
8
10
  * §4, docs/integrate/08-host-panels.md).
@@ -129,10 +131,35 @@ export function createFramePreview(std, frame, options = {}) {
129
131
  preview.fillScreen = options.fillScreen;
130
132
  return preview;
131
133
  }
134
+ /**
135
+ * Everything on the `'view-menu'` surface: the registered commands, then
136
+ * one export per framework `*:export` capability in the interchange registry
137
+ * (`interchangeExportActions`, ADR 0034 amendment of 2026-10-14) — derived
138
+ * at read time, so what a flag removed from the registry is not listed.
139
+ */
140
+ function viewMenuEntries(std) {
141
+ const registered = getRegisteredCommands(std)
142
+ .filter(command => command.surfaces.includes('view-menu'))
143
+ .map(command => ({ command }));
144
+ const derived = interchangeExportActions(std).map(({ command, capability }) => {
145
+ const framework = frameworkDescriptor(capability.framework);
146
+ return {
147
+ command,
148
+ labelParams: {
149
+ framework: framework
150
+ ? translateKey(std, framework.labelKey, framework.labelFallback)
151
+ : capability.framework,
152
+ extension: capability.format.extensions[0],
153
+ },
154
+ };
155
+ });
156
+ return [...registered, ...derived];
157
+ }
132
158
  /**
133
159
  * The actions proper to the view the editor shows now, in their declared
134
160
  * order: the commands registered on the `'view-menu'` surface whose `scope`
135
- * is this mode (or `'global'`) and whose `when` holds.
161
+ * is this mode (or `'global'`) and whose `when` holds, and on the canvas
162
+ * one export per framework format the interchange registry can write.
136
163
  *
137
164
  * `mode` is the view the host shows; omitted, it is read from
138
165
  * `DocModeProvider`, and a provider that does not know (the library default
@@ -147,21 +174,34 @@ export function createFramePreview(std, frame, options = {}) {
147
174
  */
148
175
  export function getViewActions(std, mode) {
149
176
  const view = mode ?? std.getOptional(DocModeProvider)?.getEditorMode();
150
- return getRegisteredCommands(std)
151
- .filter(command => command.surfaces.includes('view-menu'))
152
- .filter(command => command.scope === 'global' || !view || command.scope === view)
153
- .filter(command => !command.when || command.when(std))
154
- .sort((a, b) => (a.order ?? 0) - (b.order ?? 0))
155
- .map(command => ({
177
+ return viewMenuEntries(std)
178
+ .filter(({ command }) => command.scope === 'global' || !view || command.scope === view)
179
+ .filter(({ command }) => !command.when || command.when(std))
180
+ .sort((a, b) => (a.command.order ?? 0) - (b.command.order ?? 0))
181
+ .map(({ command, labelParams }) => ({
156
182
  id: command.id,
157
183
  section: command.category ?? 'display',
158
- label: translateKey(std, command.labelKey, command.labelFallback),
184
+ label: translateKey(std, command.labelKey, command.labelFallback, labelParams),
159
185
  labelKey: command.labelKey,
186
+ ...(labelParams ? { labelParams } : {}),
160
187
  ...(command.iconKey ? { iconKey: command.iconKey } : {}),
161
188
  ...(command.checked ? { checked: command.checked(std) } : {}),
162
189
  disabled: !isCommandAvailable(std, command),
163
190
  }));
164
191
  }
192
+ /**
193
+ * The exports of the view the editor shows now — the `'export'` section of
194
+ * {@link getViewActions}, in the same order: what a host lists in ONE
195
+ * "Export…" menu. On the page: Markdown and HTML. On the canvas: PNG and PDF
196
+ * (with an `ExportManager`), draw.io, SVG (with a canvas renderer), one entry
197
+ * per framework format the registry writes (`canvas.export.<framework>.<format>`,
198
+ * listed while the board holds that framework's elements), then Markdown and
199
+ * HTML. Every one resolves {@link runViewAction} with `{ file }` and downloads
200
+ * nothing.
201
+ */
202
+ export function getViewExports(std, mode) {
203
+ return getViewActions(std, mode).filter(action => action.section === 'export');
204
+ }
165
205
  /**
166
206
  * Run one entry of {@link getViewActions} by its id, through `runCommand`'s
167
207
  * bottleneck (usage and telemetry recorded once), and wait for it.
@@ -174,7 +214,7 @@ export function getViewActions(std, mode) {
174
214
  * with no file.
175
215
  */
176
216
  export async function runViewAction(std, id) {
177
- const command = getRegisteredCommands(std).find(candidate => candidate.id === id && candidate.surfaces.includes('view-menu'));
217
+ const command = viewMenuEntries(std).find(entry => entry.command.id === id)?.command;
178
218
  if (!command)
179
219
  return {};
180
220
  if (command.when && !command.when(std))
@@ -0,0 +1 @@
1
+ export * from './_pkgs/affine-block-surface/interchange-headless.js';
@@ -0,0 +1 @@
1
+ export * from './_pkgs/affine-block-surface/interchange-headless.js';
@@ -0,0 +1 @@
1
+ export * from '../_pkgs/affine-model/headless.js';
@@ -0,0 +1 @@
1
+ export * from '../_pkgs/affine-model/headless.js';
@@ -0,0 +1 @@
1
+ export * from '../_pkgs/affine-shared/headless.js';
@@ -0,0 +1 @@
1
+ export * from '../_pkgs/affine-shared/headless.js';
@@ -5,7 +5,7 @@ import { EMBED_WORDINGS } from './_pkgs/affine-block-embed/translations.js';
5
5
  import { EMBED_DOC_WORDINGS } from './_pkgs/affine-block-embed-doc/translations.js';
6
6
  import { FRAME_CHROME_WORDINGS, FRAME_WORDINGS, } from './_pkgs/affine-block-frame/translations.js';
7
7
  import { IMAGE_WORDINGS } from './_pkgs/affine-block-image/translations.js';
8
- import { EXEMPTION_FALLBACK, EXPORT_SVG_WORDINGS, PROVENANCE_FALLBACK, READING_FRAME_WORDINGS, SEVERITY_FALLBACK, SVG_SKETCH_WORDINGS, USER_LAYER_SEED_WORDINGS, } from './_pkgs/affine-block-surface/index.js';
8
+ import { EXEMPTION_FALLBACK, EXPORT_SVG_WORDINGS, INTERCHANGE_EXPORT_WORDINGS, PROVENANCE_FALLBACK, READING_FRAME_WORDINGS, SEVERITY_FALLBACK, SVG_SKETCH_WORDINGS, USER_LAYER_SEED_WORDINGS, } from './_pkgs/affine-block-surface/index.js';
9
9
  import { SURFACE_REF_CHROME_WORDINGS, SURFACE_REF_WORDINGS, } from './_pkgs/affine-block-surface-ref/translations.js';
10
10
  import { ADAPTER_PANEL_WORDINGS } from './_pkgs/affine-fragment-adapter-panel/translations.js';
11
11
  import { DOC_TITLE_WORDINGS } from './_pkgs/affine-fragment-doc-title/translations.js';
@@ -243,6 +243,12 @@ const CHROME_KEYS = [
243
243
  'com.labre.interchange.import.readonly',
244
244
  'This page became read-only while the file was being read, so nothing was imported.',
245
245
  ],
246
+ // The host's upload ceiling (`FileSizeLimitProvider`) applied to an import,
247
+ // before the file is read. `{{size}}` is the formatted ceiling.
248
+ [
249
+ 'com.labre.interchange.import.too-large',
250
+ 'This file is larger than {{size}}, the most this editor imports.',
251
+ ],
246
252
  [
247
253
  'com.labre.interchange.import.remarks',
248
254
  'What the import could not keep as it was',
@@ -317,6 +323,7 @@ const PACKAGE_WORDINGS = [
317
323
  ROOT_CHROME_WORDINGS,
318
324
  SVG_SKETCH_WORDINGS,
319
325
  EXPORT_SVG_WORDINGS,
326
+ INTERCHANGE_EXPORT_WORDINGS,
320
327
  READING_FRAME_WORDINGS,
321
328
  STD_WORDINGS,
322
329
  ATTACHMENT_WORDINGS,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@formicoidea/labre-core",
3
3
  "description": "Labre editor — the full BlockSuite-derived editor as one package.",
4
- "version": "0.49.0",
4
+ "version": "0.51.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "author": "lajola",
@@ -18,6 +18,10 @@
18
18
  "types": "./dist/effects.d.ts",
19
19
  "import": "./dist/effects.js"
20
20
  },
21
+ "./interchange": {
22
+ "types": "./dist/interchange.d.ts",
23
+ "import": "./dist/interchange.js"
24
+ },
21
25
  "./ext-loader": {
22
26
  "types": "./dist/ext-loader/index.d.ts",
23
27
  "import": "./dist/ext-loader/index.js"
@@ -778,6 +782,10 @@
778
782
  "types": "./dist/shared/consts.d.ts",
779
783
  "import": "./dist/shared/consts.js"
780
784
  },
785
+ "./shared/headless": {
786
+ "types": "./dist/shared/headless.d.ts",
787
+ "import": "./dist/shared/headless.js"
788
+ },
781
789
  "./shared/selection": {
782
790
  "types": "./dist/shared/selection.d.ts",
783
791
  "import": "./dist/shared/selection.js"
@@ -834,6 +842,10 @@
834
842
  "types": "./dist/model/index.d.ts",
835
843
  "import": "./dist/model/index.js"
836
844
  },
845
+ "./model/headless": {
846
+ "types": "./dist/model/headless.d.ts",
847
+ "import": "./dist/model/headless.js"
848
+ },
837
849
  "./sync": {
838
850
  "types": "./dist/sync/index.d.ts",
839
851
  "import": "./dist/sync/index.js"