@formicoidea/labre-core 0.58.0 → 0.60.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 (194) hide show
  1. package/architecture/code.c4 +175 -144
  2. package/architecture/domain.c4 +15 -9
  3. package/architecture/likec4.config.json +3 -3
  4. package/dist/_pkgs/affine-block-attachment/edgeless-clipboard-config.d.ts +3 -2
  5. package/dist/_pkgs/affine-block-attachment/edgeless-clipboard-config.js +18 -13
  6. package/dist/_pkgs/affine-block-callout/adapters/markdown.js +4 -1
  7. package/dist/_pkgs/affine-block-code/adapters/html.js +1 -1
  8. package/dist/_pkgs/affine-block-code/adapters/markdown/preprocessor.js +13 -1
  9. package/dist/_pkgs/affine-block-code/adapters/notion-html.js +1 -1
  10. package/dist/_pkgs/affine-block-code/code-block.d.ts +17 -2
  11. package/dist/_pkgs/affine-block-code/code-block.js +28 -23
  12. package/dist/_pkgs/affine-block-code/code-toolbar/components/lang-button.js +17 -4
  13. package/dist/_pkgs/affine-block-code/code-toolbar/components/preview-button.js +1 -1
  14. package/dist/_pkgs/affine-block-data-view/data-source.js +12 -5
  15. package/dist/_pkgs/affine-block-edgeless-text/edgeless-clipboard-config.d.ts +3 -2
  16. package/dist/_pkgs/affine-block-edgeless-text/edgeless-clipboard-config.js +8 -5
  17. package/dist/_pkgs/affine-block-image/asset-picker.d.ts +23 -2
  18. package/dist/_pkgs/affine-block-image/asset-picker.js +52 -12
  19. package/dist/_pkgs/affine-block-image/configs/replace-action.d.ts +8 -5
  20. package/dist/_pkgs/affine-block-image/configs/replace-action.js +8 -8
  21. package/dist/_pkgs/affine-block-image/configs/toolbar.js +2 -1
  22. package/dist/_pkgs/affine-block-image/crop/crop-controller.d.ts +15 -0
  23. package/dist/_pkgs/affine-block-image/crop/crop-controller.js +40 -2
  24. package/dist/_pkgs/affine-block-image/crop/crop-math.d.ts +22 -0
  25. package/dist/_pkgs/affine-block-image/crop/crop-math.js +55 -2
  26. package/dist/_pkgs/affine-block-image/crop/crop-overlay.d.ts +17 -3
  27. package/dist/_pkgs/affine-block-image/crop/crop-overlay.js +64 -6
  28. package/dist/_pkgs/affine-block-image/edgeless-clipboard-config.d.ts +3 -2
  29. package/dist/_pkgs/affine-block-image/edgeless-clipboard-config.js +20 -14
  30. package/dist/_pkgs/affine-block-image/image-block.js +1 -0
  31. package/dist/_pkgs/affine-block-image/image-edgeless-block.js +3 -0
  32. package/dist/_pkgs/affine-block-image/index.d.ts +2 -0
  33. package/dist/_pkgs/affine-block-image/index.js +2 -0
  34. package/dist/_pkgs/affine-block-image/replace/commands.d.ts +68 -0
  35. package/dist/_pkgs/affine-block-image/replace/commands.js +200 -0
  36. package/dist/_pkgs/affine-block-image/replace/replace-model.d.ts +44 -0
  37. package/dist/_pkgs/affine-block-image/replace/replace-model.js +168 -0
  38. package/dist/_pkgs/affine-block-image/replace/toolbar.d.ts +21 -0
  39. package/dist/_pkgs/affine-block-image/replace/toolbar.js +159 -0
  40. package/dist/_pkgs/affine-block-image/translations.d.ts +15 -2
  41. package/dist/_pkgs/affine-block-image/translations.js +35 -2
  42. package/dist/_pkgs/affine-block-image/utils.d.ts +7 -0
  43. package/dist/_pkgs/affine-block-image/utils.js +13 -0
  44. package/dist/_pkgs/affine-block-image/view.js +7 -0
  45. package/dist/_pkgs/affine-block-note/components/edgeless-page-block-title.d.ts +14 -5
  46. package/dist/_pkgs/affine-block-note/components/edgeless-page-block-title.js +18 -11
  47. package/dist/_pkgs/affine-block-note/config.d.ts +9 -2
  48. package/dist/_pkgs/affine-block-note/edgeless-clipboard-config.d.ts +3 -2
  49. package/dist/_pkgs/affine-block-note/edgeless-clipboard-config.js +8 -5
  50. package/dist/_pkgs/affine-block-paragraph/adapters/markdown.js +11 -0
  51. package/dist/_pkgs/affine-block-root/commands/invisible-characters-commands.d.ts +17 -0
  52. package/dist/_pkgs/affine-block-root/commands/invisible-characters-commands.js +123 -0
  53. package/dist/_pkgs/affine-block-root/edgeless/clipboard/command.js +82 -65
  54. package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.js +2 -0
  55. package/dist/_pkgs/affine-block-root/index.d.ts +1 -0
  56. package/dist/_pkgs/affine-block-root/index.js +1 -0
  57. package/dist/_pkgs/affine-block-root/translations.d.ts +6 -0
  58. package/dist/_pkgs/affine-block-root/translations.js +10 -0
  59. package/dist/_pkgs/affine-block-root/view.js +6 -1
  60. package/dist/_pkgs/affine-block-surface/commands/index.d.ts +1 -1
  61. package/dist/_pkgs/affine-block-surface/commands/index.js +1 -1
  62. package/dist/_pkgs/affine-block-surface/commands/reassociate-connectors.d.ts +9 -0
  63. package/dist/_pkgs/affine-block-surface/commands/reassociate-connectors.js +21 -12
  64. package/dist/_pkgs/affine-block-surface/extensions/clipboard-config.d.ts +33 -0
  65. package/dist/_pkgs/affine-block-surface/extensions/clipboard-config.js +53 -0
  66. package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +1 -0
  67. package/dist/_pkgs/affine-block-surface/extensions/index.js +1 -0
  68. package/dist/_pkgs/affine-block-surface/extensions/legend-label.d.ts +11 -0
  69. package/dist/_pkgs/affine-block-surface/extensions/legend-label.js +16 -0
  70. package/dist/_pkgs/affine-block-surface/extensions/legend.d.ts +1 -11
  71. package/dist/_pkgs/affine-block-surface/extensions/legend.js +2 -11
  72. package/dist/_pkgs/affine-block-surface/extensions/reading-toolbar.js +12 -12
  73. package/dist/_pkgs/affine-block-surface/extensions/toolbox.d.ts +62 -0
  74. package/dist/_pkgs/affine-block-surface/extensions/toolbox.js +1 -0
  75. package/dist/_pkgs/affine-block-surface/framework-background/background-view.js +2 -1
  76. package/dist/_pkgs/affine-block-surface/framework-background/band-widths.d.ts +104 -0
  77. package/dist/_pkgs/affine-block-surface/framework-background/band-widths.js +156 -0
  78. package/dist/_pkgs/affine-block-surface/framework-background/def.d.ts +87 -4
  79. package/dist/_pkgs/affine-block-surface/framework-background/def.js +26 -7
  80. package/dist/_pkgs/affine-block-surface/framework-background/ellipsis.d.ts +58 -0
  81. package/dist/_pkgs/affine-block-surface/framework-background/ellipsis.js +110 -0
  82. package/dist/_pkgs/affine-block-surface/framework-background/index.d.ts +3 -0
  83. package/dist/_pkgs/affine-block-surface/framework-background/index.js +3 -0
  84. package/dist/_pkgs/affine-block-surface/framework-background/labels.d.ts +12 -2
  85. package/dist/_pkgs/affine-block-surface/framework-background/labels.js +29 -5
  86. package/dist/_pkgs/affine-block-surface/framework-background/measure-text.d.ts +14 -0
  87. package/dist/_pkgs/affine-block-surface/framework-background/measure-text.js +31 -0
  88. package/dist/_pkgs/affine-block-surface/framework-background/renderer.d.ts +14 -1
  89. package/dist/_pkgs/affine-block-surface/framework-background/renderer.js +84 -31
  90. package/dist/_pkgs/affine-block-surface/interchange-headless.d.ts +2 -0
  91. package/dist/_pkgs/affine-block-surface/interchange-headless.js +2 -0
  92. package/dist/_pkgs/affine-block-table/adapters/html.js +26 -14
  93. package/dist/_pkgs/affine-block-table/adapters/utils.d.ts +1 -0
  94. package/dist/_pkgs/affine-block-table/adapters/utils.js +23 -5
  95. package/dist/_pkgs/affine-block-table/header-menu.d.ts +13 -0
  96. package/dist/_pkgs/affine-block-table/header-menu.js +25 -0
  97. package/dist/_pkgs/affine-block-table/selection-controller.d.ts +15 -0
  98. package/dist/_pkgs/affine-block-table/selection-controller.js +62 -0
  99. package/dist/_pkgs/affine-block-table/table-cell-css.d.ts +7 -0
  100. package/dist/_pkgs/affine-block-table/table-cell-css.js +10 -0
  101. package/dist/_pkgs/affine-block-table/table-cell.d.ts +8 -0
  102. package/dist/_pkgs/affine-block-table/table-cell.js +35 -3
  103. package/dist/_pkgs/affine-block-table/table-data-manager.d.ts +14 -0
  104. package/dist/_pkgs/affine-block-table/table-data-manager.js +44 -3
  105. package/dist/_pkgs/affine-block-table/translations.d.ts +14 -0
  106. package/dist/_pkgs/affine-block-table/translations.js +22 -0
  107. package/dist/_pkgs/affine-components/highlight-dropdown-menu/highlight-duotone-icon.js +8 -8
  108. package/dist/_pkgs/affine-components/highlight-dropdown-menu/text-duotone-icon.js +11 -11
  109. package/dist/_pkgs/affine-gfx-mindmap/toolbar/mindmap-tool-button.d.ts +2 -2
  110. package/dist/_pkgs/affine-gfx-template/builtin/other.d.ts +4 -0
  111. package/dist/_pkgs/affine-gfx-template/builtin/other.js +1 -1
  112. package/dist/_pkgs/affine-gfx-template/builtin/slides/build.d.ts +81 -0
  113. package/dist/_pkgs/affine-gfx-template/builtin/slides/build.js +276 -0
  114. package/dist/_pkgs/affine-gfx-template/builtin/slides/consts.d.ts +126 -0
  115. package/dist/_pkgs/affine-gfx-template/builtin/slides/consts.js +101 -0
  116. package/dist/_pkgs/affine-gfx-template/builtin/slides/index.d.ts +8 -0
  117. package/dist/_pkgs/affine-gfx-template/builtin/slides/index.js +27 -0
  118. package/dist/_pkgs/affine-gfx-template/builtin/slides/masks.d.ts +83 -0
  119. package/dist/_pkgs/affine-gfx-template/builtin/slides/masks.js +674 -0
  120. package/dist/_pkgs/affine-gfx-template/contribute.js +12 -17
  121. package/dist/_pkgs/affine-gfx-template/make-snapshot.d.ts +14 -2
  122. package/dist/_pkgs/affine-gfx-template/make-snapshot.js +6 -2
  123. package/dist/_pkgs/affine-gfx-template/services/template-middlewares.d.ts +12 -0
  124. package/dist/_pkgs/affine-gfx-template/services/template-middlewares.js +48 -0
  125. package/dist/_pkgs/affine-gfx-template/services/template.js +2 -1
  126. package/dist/_pkgs/affine-gfx-template/toolbar/builtin-templates.d.ts +15 -1
  127. package/dist/_pkgs/affine-gfx-template/toolbar/builtin-templates.js +33 -37
  128. package/dist/_pkgs/affine-gfx-template/toolbar/template-type.d.ts +6 -0
  129. package/dist/_pkgs/affine-gfx-template/translations.d.ts +94 -0
  130. package/dist/_pkgs/affine-gfx-template/translations.js +441 -2
  131. package/dist/_pkgs/affine-model/blocks/table/table-model.d.ts +4 -0
  132. package/dist/_pkgs/affine-model/blocks/table/table-model.js +4 -0
  133. package/dist/_pkgs/affine-model/elements/bpmn/node.d.ts +46 -3
  134. package/dist/_pkgs/affine-model/elements/bpmn/node.js +47 -4
  135. package/dist/_pkgs/affine-model/elements/bpmn/pool.d.ts +20 -0
  136. package/dist/_pkgs/affine-model/elements/bpmn/pool.js +33 -4
  137. package/dist/_pkgs/affine-model/elements/c4/board.d.ts +0 -22
  138. package/dist/_pkgs/affine-model/elements/c4/board.js +1 -22
  139. package/dist/_pkgs/affine-model/elements/c4/consts.d.ts +29 -0
  140. package/dist/_pkgs/affine-model/elements/c4/consts.js +29 -0
  141. package/dist/_pkgs/affine-model/elements/c4/index.d.ts +1 -0
  142. package/dist/_pkgs/affine-model/elements/c4/index.js +1 -0
  143. package/dist/_pkgs/affine-model/headless.d.ts +1 -0
  144. package/dist/_pkgs/affine-model/headless.js +1 -0
  145. package/dist/_pkgs/affine-shared/services/edit-props-store.d.ts +3 -16
  146. package/dist/_pkgs/affine-shared/services/edit-props-store.js +16 -16
  147. package/dist/_pkgs/affine-shared/services/editor-setting-service.d.ts +3 -0
  148. package/dist/_pkgs/affine-shared/services/editor-setting-service.js +4 -0
  149. package/dist/_pkgs/affine-shared/services/index.d.ts +1 -0
  150. package/dist/_pkgs/affine-shared/services/index.js +1 -0
  151. package/dist/_pkgs/affine-shared/services/invisible-characters.d.ts +33 -0
  152. package/dist/_pkgs/affine-shared/services/invisible-characters.js +63 -0
  153. package/dist/_pkgs/affine-shared/services/link-preview-service/link-preview-cache.d.ts +0 -9
  154. package/dist/_pkgs/affine-shared/services/link-preview-service/link-preview-cache.js +3 -9
  155. package/dist/_pkgs/affine-shared/services/telemetry-service/lifecycle.d.ts +26 -0
  156. package/dist/_pkgs/affine-shared/services/telemetry-service/telemetry-service.d.ts +4 -3
  157. package/dist/_pkgs/affine-shared/services/telemetry-service/types.d.ts +11 -0
  158. package/dist/_pkgs/affine-shared/utils/index.d.ts +1 -0
  159. package/dist/_pkgs/affine-shared/utils/index.js +1 -0
  160. package/dist/_pkgs/affine-shared/utils/invisible-characters.d.ts +42 -0
  161. package/dist/_pkgs/affine-shared/utils/invisible-characters.js +81 -0
  162. package/dist/_pkgs/affine-widget-edgeless-zoom-toolbar/index.js +26 -26
  163. package/dist/_pkgs/affine-widget-edgeless-zoom-toolbar/zoom-toolbar.js +13 -2
  164. package/dist/_pkgs/affine-widget-keyboard-toolbar/icons.js +98 -98
  165. package/dist/_pkgs/affine-widget-page-dragging-area/index.js +10 -10
  166. package/dist/_pkgs/affine-widget-viewport-overlay/index.js +13 -13
  167. package/dist/_pkgs/data-view/core/utils/menu-title.js +17 -17
  168. package/dist/_pkgs/data-view/view-presets/table/pc/header/column-header.js +6 -0
  169. package/dist/_pkgs/data-view/view-presets/table/pc/table-view-ui-logic.js +5 -2
  170. package/dist/_pkgs/std/clipboard/clipboard.d.ts +15 -1
  171. package/dist/_pkgs/std/clipboard/clipboard.js +18 -0
  172. package/dist/_pkgs/std/inline/components/embed-gap.js +1 -1
  173. package/dist/_pkgs/std/inline/components/v-line.js +1 -1
  174. package/dist/_pkgs/std/inline/components/v-text.d.ts +15 -2
  175. package/dist/_pkgs/std/inline/components/v-text.js +147 -15
  176. package/dist/_pkgs/std/inline/consts.d.ts +5 -0
  177. package/dist/_pkgs/std/inline/consts.js +5 -0
  178. package/dist/_pkgs/std/inline/utils/index.d.ts +1 -0
  179. package/dist/_pkgs/std/inline/utils/index.js +1 -0
  180. package/dist/_pkgs/std/inline/utils/invisible-characters.d.ts +57 -0
  181. package/dist/_pkgs/std/inline/utils/invisible-characters.js +162 -0
  182. package/dist/_pkgs/std/inline/utils/point-conversion.js +3 -3
  183. package/dist/_pkgs/std/inline/utils/text.d.ts +8 -0
  184. package/dist/_pkgs/std/inline/utils/text.js +11 -2
  185. package/dist/_pkgs/store/model/store/crud.d.ts +28 -0
  186. package/dist/_pkgs/store/model/store/crud.js +97 -30
  187. package/dist/_pkgs/store/model/store/query.js +3 -2
  188. package/dist/_pkgs/store/model/store/store.d.ts +21 -0
  189. package/dist/_pkgs/store/model/store/store.js +88 -21
  190. package/dist/_pkgs/store/transformer/transformer.d.ts +46 -0
  191. package/dist/_pkgs/store/transformer/transformer.js +72 -0
  192. package/dist/commands.js +6 -1
  193. package/dist/translations.js +2 -0
  194. package/package.json +3 -4
@@ -0,0 +1,126 @@
1
+ import { type Color, FontWeight } from '../../../affine-model/index.js';
2
+ /**
3
+ * The slide masks' one system: geometry, typography and the two paper
4
+ * variants. Every mask in `masks.ts` reads these and restates none of them,
5
+ * so a size or a colour changes here, once, for the whole set.
6
+ */
7
+ /** A 16:9 slide, the frame menu's own `16:9` preset (1600 × 900). */
8
+ export declare const SLIDE_WIDTH = 1600;
9
+ export declare const SLIDE_HEIGHT = 900;
10
+ /** The side margin every mask aligns its content on. */
11
+ export declare const SLIDE_MARGIN = 96;
12
+ /** Where the footer line (footer text, slide number) sits. */
13
+ export declare const SLIDE_FOOTER_Y = 846;
14
+ /**
15
+ * A slide is read from across a room: its type is the document's heading
16
+ * scale (DESIGN.md, The Title-Ratio Rule) times one factor, so the steps
17
+ * between levels stay the editor's own. 1.5 puts the title at 48 model units
18
+ * on a 1600-wide slide, the proportion of the PO's reference deck.
19
+ */
20
+ export declare const SLIDE_TYPE_FACTOR = 1.5;
21
+ export type SlideTextRole = 'display' | 'title' | 'heading' | 'body' | 'caption' | 'figure';
22
+ export type SlideType = {
23
+ fontSize: number;
24
+ fontWeight: FontWeight;
25
+ };
26
+ export declare const SLIDE_TYPE: Readonly<Record<SlideTextRole, SlideType>>;
27
+ /**
28
+ * What a text box adds to its font size per line. The renderer measures the
29
+ * real line box in the DOM (`getLineHeight`, `gfx/text`); the seeds only need
30
+ * a box tall enough not to overlap the next zone.
31
+ *
32
+ * ponytail: a fixed 1.25 ratio, close to Inter's measured line box. The
33
+ * ceiling is a host font with a taller line box, whose seeds would overlap
34
+ * by a few units until edited; the upgrade is measuring with `wrapText` and
35
+ * `getLineHeight` at placement, which needs a DOM the snapshot build has not.
36
+ */
37
+ export declare const SLIDE_LINE_HEIGHT = 1.25;
38
+ /**
39
+ * The colours a slide paints with. Only `{ light, dark }` pairs of the base
40
+ * palette or palette values that read on both papers: a mask's elements
41
+ * carry no role and sit on no framework board, so they are painted as stored
42
+ * on a dark canvas (ADR 0039, point 6). A raw hex would leave a white slide
43
+ * on a dark canvas; a pair inverts with the theme.
44
+ */
45
+ export type SlidePalette = {
46
+ /** The frame's background. */
47
+ paper: Color;
48
+ /** Titles, headings, body text, key figures. */
49
+ ink: Color;
50
+ /** Eyebrows, captions, footer, slide number, axis labels. */
51
+ muted: Color;
52
+ /** Hairlines, card outlines, the fill of a placeholder. */
53
+ hairline: Color;
54
+ /** The dashed outline of a fill zone. */
55
+ zoneStroke: Color;
56
+ };
57
+ /**
58
+ * Two variants, so the set reads as one deck: `paper`, a light slide that
59
+ * turns dark grey on a dark canvas, and `inverse`, the ink slide of a section
60
+ * divider, a statement or a quote, which swaps paper and ink.
61
+ */
62
+ export declare const SLIDE_PALETTES: {
63
+ readonly paper: {
64
+ readonly paper: Color;
65
+ readonly ink: string | {
66
+ normal: string;
67
+ } | {
68
+ dark: string;
69
+ light: string;
70
+ };
71
+ readonly muted: string | {
72
+ normal: string;
73
+ } | {
74
+ dark: string;
75
+ light: string;
76
+ };
77
+ readonly hairline: {
78
+ dark: string;
79
+ light: string;
80
+ };
81
+ readonly zoneStroke: string | {
82
+ normal: string;
83
+ } | {
84
+ dark: string;
85
+ light: string;
86
+ };
87
+ };
88
+ readonly inverse: {
89
+ readonly paper: string | {
90
+ normal: string;
91
+ } | {
92
+ dark: string;
93
+ light: string;
94
+ };
95
+ readonly ink: string | {
96
+ normal: string;
97
+ } | {
98
+ dark: string;
99
+ light: string;
100
+ };
101
+ readonly muted: string | {
102
+ normal: string;
103
+ } | {
104
+ dark: string;
105
+ light: string;
106
+ };
107
+ readonly hairline: string | {
108
+ normal: string;
109
+ } | {
110
+ dark: string;
111
+ light: string;
112
+ };
113
+ readonly zoneStroke: string | {
114
+ normal: string;
115
+ } | {
116
+ dark: string;
117
+ light: string;
118
+ };
119
+ };
120
+ };
121
+ export type SlideVariant = keyof typeof SLIDE_PALETTES;
122
+ /** Stroke widths, model units. */
123
+ export declare const SLIDE_HAIRLINE_WIDTH = 2;
124
+ export declare const SLIDE_ZONE_STROKE_WIDTH = 2;
125
+ /** Corner radius of a card or a fill zone. */
126
+ export declare const SLIDE_RADIUS = 12;
@@ -0,0 +1,101 @@
1
+ import { DefaultTheme, FontWeight } from '../../../affine-model/index.js';
2
+ import { HEADING_SCALE } from '../../../affine-shared/consts/index.js';
3
+ import { darkThemeV2, lightThemeV2 } from '@toeverything/theme/v2';
4
+ /**
5
+ * The slide masks' one system: geometry, typography and the two paper
6
+ * variants. Every mask in `masks.ts` reads these and restates none of them,
7
+ * so a size or a colour changes here, once, for the whole set.
8
+ */
9
+ /** A 16:9 slide, the frame menu's own `16:9` preset (1600 × 900). */
10
+ export const SLIDE_WIDTH = 1600;
11
+ export const SLIDE_HEIGHT = 900;
12
+ /** The side margin every mask aligns its content on. */
13
+ export const SLIDE_MARGIN = 96;
14
+ /** Where the footer line (footer text, slide number) sits. */
15
+ export const SLIDE_FOOTER_Y = 846;
16
+ /**
17
+ * A slide is read from across a room: its type is the document's heading
18
+ * scale (DESIGN.md, The Title-Ratio Rule) times one factor, so the steps
19
+ * between levels stay the editor's own. 1.5 puts the title at 48 model units
20
+ * on a 1600-wide slide, the proportion of the PO's reference deck.
21
+ */
22
+ export const SLIDE_TYPE_FACTOR = 1.5;
23
+ /**
24
+ * The doc title has no entry in `HEADING_SCALE` (it sits above the scale,
25
+ * DESIGN.md, Hierarchy: 700, 40px); the body is 15px. Both are restated
26
+ * here as the two values the scale does not carry.
27
+ */
28
+ const DOC_TITLE_SIZE = 40;
29
+ const BODY_SIZE = 15;
30
+ const CAPTION_SIZE = 12;
31
+ const size = (px) => Math.round(px * SLIDE_TYPE_FACTOR);
32
+ const weight = (value) => String(value);
33
+ export const SLIDE_TYPE = {
34
+ /** The cover's and a section's title: the doc title's tier. */
35
+ display: { fontSize: size(DOC_TITLE_SIZE), fontWeight: FontWeight.Bold },
36
+ /** Every slide's own title: H1. */
37
+ title: {
38
+ fontSize: size(HEADING_SCALE.h1.fontSize),
39
+ fontWeight: weight(HEADING_SCALE.h1.fontWeight),
40
+ },
41
+ /** A point's or a column's heading: H3. */
42
+ heading: {
43
+ fontSize: size(HEADING_SCALE.h3.fontSize),
44
+ fontWeight: weight(HEADING_SCALE.h3.fontWeight),
45
+ },
46
+ body: { fontSize: size(BODY_SIZE), fontWeight: FontWeight.Regular },
47
+ /** Footer, slide number, eyebrow, axis and placeholder labels. */
48
+ caption: { fontSize: size(CAPTION_SIZE), fontWeight: FontWeight.Regular },
49
+ /** A key figure: twice the slide title, the one number a slide is about. */
50
+ figure: {
51
+ fontSize: 2 * size(HEADING_SCALE.h1.fontSize),
52
+ fontWeight: FontWeight.Bold,
53
+ },
54
+ };
55
+ /**
56
+ * What a text box adds to its font size per line. The renderer measures the
57
+ * real line box in the DOM (`getLineHeight`, `gfx/text`); the seeds only need
58
+ * a box tall enough not to overlap the next zone.
59
+ *
60
+ * ponytail: a fixed 1.25 ratio, close to Inter's measured line box. The
61
+ * ceiling is a host font with a taller line box, whose seeds would overlap
62
+ * by a few units until edited; the upgrade is measuring with `wrapText` and
63
+ * `getLineHeight` at placement, which needs a DOM the snapshot build has not.
64
+ */
65
+ export const SLIDE_LINE_HEIGHT = 1.25;
66
+ const MEDIUM_GREY = DefaultTheme.StrokeColorShortMap['Grey'];
67
+ /**
68
+ * The theme's one grey that has a dark side, the note palette's grey
69
+ * (`#e6e6e6` / `#565656`). `DefaultTheme` maps no grey note, so the pair is
70
+ * read from the same theme tables `getColorByKey` reads.
71
+ */
72
+ const NOTE_GREY = {
73
+ dark: darkThemeV2['edgeless/note/grey'],
74
+ light: lightThemeV2['edgeless/note/grey'],
75
+ };
76
+ /**
77
+ * Two variants, so the set reads as one deck: `paper`, a light slide that
78
+ * turns dark grey on a dark canvas, and `inverse`, the ink slide of a section
79
+ * divider, a statement or a quote, which swaps paper and ink.
80
+ */
81
+ export const SLIDE_PALETTES = {
82
+ paper: {
83
+ paper: DefaultTheme.NoteBackgroundColorMap['White'],
84
+ ink: DefaultTheme.black,
85
+ muted: MEDIUM_GREY,
86
+ hairline: NOTE_GREY,
87
+ zoneStroke: MEDIUM_GREY,
88
+ },
89
+ inverse: {
90
+ paper: DefaultTheme.black,
91
+ ink: DefaultTheme.white,
92
+ muted: MEDIUM_GREY,
93
+ hairline: MEDIUM_GREY,
94
+ zoneStroke: MEDIUM_GREY,
95
+ },
96
+ };
97
+ /** Stroke widths, model units. */
98
+ export const SLIDE_HAIRLINE_WIDTH = 2;
99
+ export const SLIDE_ZONE_STROKE_WIDTH = 2;
100
+ /** Corner radius of a card or a fill zone. */
101
+ export const SLIDE_RADIUS = 12;
@@ -0,0 +1,8 @@
1
+ import type { TemplateCategory } from '../../toolbar/template-type.js';
2
+ /**
3
+ * The built-in "Slides" category: one 16:9 frame per mask, ready to fill.
4
+ * Built in and ungated like "Other": a frame, shapes, texts and connectors
5
+ * are core, so no flag can take the masks away (ADR 0009 gates a framework's
6
+ * tooling, and a slide belongs to no framework).
7
+ */
8
+ export declare const slidesTemplateCategory: TemplateCategory;
@@ -0,0 +1,27 @@
1
+ import { TEMPLATE_PANEL_CATEGORY_SLIDES } from '../../translations.js';
2
+ import { numberSlide, slidePreview, slideSnapshot } from './build.js';
3
+ import { SLIDE_MASKS } from './masks.js';
4
+ function slideTemplate(mask) {
5
+ const [nameKey, name] = mask.name;
6
+ return {
7
+ name,
8
+ nameKey,
9
+ keywords: mask.keywords,
10
+ type: 'template',
11
+ preview: slidePreview(mask),
12
+ content: slideSnapshot(mask),
13
+ localize: std => slideSnapshot(mask, std),
14
+ afterInsert: numberSlide,
15
+ };
16
+ }
17
+ /**
18
+ * The built-in "Slides" category: one 16:9 frame per mask, ready to fill.
19
+ * Built in and ungated like "Other": a frame, shapes, texts and connectors
20
+ * are core, so no flag can take the masks away (ADR 0009 gates a framework's
21
+ * tooling, and a slide belongs to no framework).
22
+ */
23
+ export const slidesTemplateCategory = {
24
+ name: TEMPLATE_PANEL_CATEGORY_SLIDES[1],
25
+ nameKey: TEMPLATE_PANEL_CATEGORY_SLIDES[0],
26
+ templates: SLIDE_MASKS.map(slideTemplate),
27
+ };
@@ -0,0 +1,83 @@
1
+ import type { ChromeWording, TranslationParams } from '../../../affine-shared/services/index.js';
2
+ import { type SlideTextRole, type SlideVariant } from './consts.js';
3
+ /**
4
+ * The slide masks, as DATA: a mask is the list of its zones, and one builder
5
+ * (`build.ts`) projects every mask into a frame, its elements and its preview.
6
+ * Positions are model units inside the 1600 x 900 frame; sizes, weights and
7
+ * colours are never written here, only a text ROLE and a TONE, which
8
+ * `consts.ts` resolves once for the whole set.
9
+ *
10
+ * The families and the reference slides each mask stands for are in
11
+ * `README.md` beside this file.
12
+ */
13
+ export type SlideAlign = 'left' | 'center' | 'right';
14
+ /** A text box: a seed (or plain digits) set in one role of the type scale. */
15
+ export type SlideTextZone = {
16
+ kind: 'text';
17
+ role: SlideTextRole;
18
+ /** The words, through the translation seam at placement (ADR 0023). */
19
+ seed?: ChromeWording;
20
+ params?: TranslationParams;
21
+ /** Digits that are no wording (an agenda's "01"). */
22
+ digits?: string;
23
+ x: number;
24
+ y: number;
25
+ w: number;
26
+ /** How many lines the box is sized for; the text wraps inside `w`. */
27
+ lines?: number;
28
+ align?: SlideAlign;
29
+ tone?: 'ink' | 'muted';
30
+ };
31
+ /** A fill zone: a dashed placeholder the author replaces with a picture. */
32
+ export type SlideImageZone = {
33
+ kind: 'image';
34
+ x: number;
35
+ y: number;
36
+ w: number;
37
+ h: number;
38
+ shape?: 'rect' | 'ellipse';
39
+ /** Its caption, `Image` unless said otherwise (`Logo`). */
40
+ label?: ChromeWording;
41
+ };
42
+ /** A structural outline: a card, a quadrant, a Venn circle, a step. */
43
+ export type SlideCardZone = {
44
+ kind: 'card';
45
+ x: number;
46
+ y: number;
47
+ w: number;
48
+ h: number;
49
+ shape?: 'rect' | 'ellipse';
50
+ /** A word set inside the card itself (a step, a milestone). */
51
+ label?: ChromeWording;
52
+ params?: TranslationParams;
53
+ /** `hairline` for a quiet card, `muted` for a line meant to be seen. */
54
+ stroke?: 'hairline' | 'muted';
55
+ /** A card filled with the hairline grey (a milestone bar). */
56
+ filled?: boolean;
57
+ };
58
+ /** A straight rule or arrow. */
59
+ export type SlideLineZone = {
60
+ kind: 'line';
61
+ from: [number, number];
62
+ to: [number, number];
63
+ arrow?: boolean;
64
+ };
65
+ /** A filled ink dot (a timeline's milestone). */
66
+ export type SlideDotZone = {
67
+ kind: 'dot';
68
+ x: number;
69
+ y: number;
70
+ size: number;
71
+ };
72
+ export type SlideZone = SlideTextZone | SlideImageZone | SlideCardZone | SlideLineZone | SlideDotZone;
73
+ export type SlideMask = {
74
+ id: string;
75
+ /** The tile's name, also the inserted frame's title. */
76
+ name: ChromeWording;
77
+ /** Plain English search words besides the name (`Template.keywords`). */
78
+ keywords: string[];
79
+ variant: SlideVariant;
80
+ zones: SlideZone[];
81
+ };
82
+ /** Every mask, in the panel's order: a deck reads top to bottom. */
83
+ export declare const SLIDE_MASKS: readonly SlideMask[];