fika-editor 3.2.9 → 3.3.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 (103) hide show
  1. package/dist/embed/{824.js → 6104.js} +18 -18
  2. package/dist/embed/agentic-manifest.json +46 -10
  3. package/dist/embed/chunks/1131.js +1 -1
  4. package/dist/embed/chunks/2407.js +1 -1
  5. package/dist/embed/chunks/2807.js +1 -1
  6. package/dist/embed/chunks/3888.js +1 -1
  7. package/dist/embed/chunks/5216.js +1 -1
  8. package/dist/embed/chunks/574.js +1 -1
  9. package/dist/embed/chunks/655.js +1 -0
  10. package/dist/embed/chunks/862.js +1 -1
  11. package/dist/embed/chunks/9657.js +1 -1
  12. package/dist/embed/chunks/9800.js +1 -1
  13. package/dist/embed/fika-embed.css +1 -1
  14. package/dist/embed/fika-embed.js +18 -4
  15. package/dist/layout/types/slides.js +1 -0
  16. package/dist/layout/utils/resizeDeck.js +257 -0
  17. package/dist/types/components/Button.d.ts +2 -2
  18. package/dist/types/configs/theme.d.ts +2 -0
  19. package/dist/types/embed/agentic/canvasContext.d.ts +4 -0
  20. package/dist/types/embed/agentic/canvasOperations.d.ts +3 -0
  21. package/dist/types/embed/agentic/types.d.ts +118 -0
  22. package/dist/types/embed/index.d.ts +3 -0
  23. package/dist/types/embed/render.d.ts +4 -0
  24. package/dist/types/embed/types.d.ts +3 -2
  25. package/dist/types/hooks/textCreationDefaults.d.ts +2 -0
  26. package/dist/types/hooks/useAnimationFrameCallback.d.ts +6 -0
  27. package/dist/types/hooks/useResizeDeck.d.ts +1 -0
  28. package/dist/types/i18n/cs/myna/index.d.ts +3 -0
  29. package/dist/types/i18n/en/myna/index.d.ts +3 -0
  30. package/dist/types/i18n/i18n-react.d.ts +2 -0
  31. package/dist/types/i18n/i18n-types.d.ts +2888 -1341
  32. package/dist/types/i18n/i18n-util.async.d.ts +1 -0
  33. package/dist/types/i18n/i18n-util.d.ts +1 -0
  34. package/dist/types/i18n/pl/myna/index.d.ts +3 -0
  35. package/dist/types/i18n/sk/myna/index.d.ts +3 -0
  36. package/dist/types/paint/slidePainter.d.ts +11 -0
  37. package/dist/types/store/slides.d.ts +241 -1
  38. package/dist/types/types/slides.d.ts +53 -0
  39. package/dist/types/utils/applyDesignTheme.d.ts +1 -1
  40. package/dist/types/utils/canvasFit.d.ts +17 -0
  41. package/dist/types/utils/canvasHitTest.d.ts +4 -0
  42. package/dist/types/utils/designColorRoles.d.ts +10 -0
  43. package/dist/types/utils/element.d.ts +27 -0
  44. package/dist/types/utils/elementPaint.d.ts +129 -0
  45. package/dist/types/utils/frameDomClip.d.ts +3 -0
  46. package/dist/types/utils/nestedFrames.d.ts +19 -0
  47. package/dist/types/utils/pageGuides.d.ts +6 -0
  48. package/dist/types/utils/renderMetrics.d.ts +2 -0
  49. package/dist/types/utils/resizeDeck.d.ts +11 -0
  50. package/dist/types/utils/selectInsertedElements.d.ts +2 -0
  51. package/dist/types/utils/transferPageElements.d.ts +3 -0
  52. package/dist/types/views/Editor/Canvas/MynaRulers.d.ts +17 -0
  53. package/dist/types/views/Editor/Canvas/ViewportBackground.d.ts +3 -1
  54. package/dist/types/views/Editor/Canvas/hooks/useDragElement.d.ts +2 -1
  55. package/dist/types/views/Editor/Canvas/hooks/useDrop.d.ts +1 -1
  56. package/dist/types/views/Editor/Canvas/hooks/useViewportSize.d.ts +1 -0
  57. package/dist/types/views/Editor/Canvas/index.d.ts +4 -1
  58. package/dist/types/views/Editor/EditorHeader/index.d.ts +4 -2
  59. package/dist/types/views/Editor/index.d.ts +3 -2
  60. package/dist/types/views/Myna/MynaAssetsPanel.d.ts +28 -0
  61. package/dist/types/views/Myna/MynaDownload.d.ts +4 -0
  62. package/dist/types/views/Myna/MynaDrawer.d.ts +9 -0
  63. package/dist/types/views/Myna/MynaElementsPanel.d.ts +12 -0
  64. package/dist/types/views/Myna/MynaFrameTitles.d.ts +6 -0
  65. package/dist/types/views/Myna/MynaFramesHierarchy.d.ts +1 -0
  66. package/dist/types/views/Myna/MynaFramesPanel.d.ts +6 -0
  67. package/dist/types/views/Myna/MynaHeader.d.ts +5 -0
  68. package/dist/types/views/Myna/MynaInspector.d.ts +2 -0
  69. package/dist/types/views/Myna/MynaLayersPanel.d.ts +1 -0
  70. package/dist/types/views/Myna/MynaPageCanvas.d.ts +14 -0
  71. package/dist/types/views/Myna/MynaPageLayoutControls.d.ts +1 -0
  72. package/dist/types/views/Myna/MynaPageOutline.d.ts +1 -0
  73. package/dist/types/views/Myna/MynaPageOverflow.d.ts +9 -0
  74. package/dist/types/views/Myna/MynaPagesPanel.d.ts +14 -0
  75. package/dist/types/views/Myna/MynaQrPanel.d.ts +1 -0
  76. package/dist/types/views/Myna/MynaTemplateLibrary.d.ts +3 -0
  77. package/dist/types/views/Myna/MynaViewSettings.d.ts +2 -0
  78. package/dist/types/views/Myna/MynaWorkspace.d.ts +1 -0
  79. package/dist/types/views/Myna/MynaZoomControl.d.ts +3 -0
  80. package/dist/types/views/Myna/WorkspaceLabels.d.ts +8 -0
  81. package/dist/types/views/Myna/WorkspaceObjects.d.ts +9 -0
  82. package/dist/types/views/Myna/catalog.d.ts +233 -0
  83. package/dist/types/views/Myna/exportPages.d.ts +2 -0
  84. package/dist/types/views/Myna/inspectorLabels.d.ts +30 -0
  85. package/dist/types/views/Myna/libraryMessages.d.ts +28 -0
  86. package/dist/types/views/Myna/pageLayout.d.ts +22 -0
  87. package/dist/types/views/Myna/pageSnapping.d.ts +41 -0
  88. package/dist/types/views/Myna/pdf.d.ts +10 -0
  89. package/dist/types/views/Myna/photoFrameLabels.d.ts +28 -0
  90. package/dist/types/views/Myna/photoFrameUpload.d.ts +5 -0
  91. package/dist/types/views/Myna/photoFrames.d.ts +11 -0
  92. package/dist/types/views/Myna/qrCode.d.ts +7 -0
  93. package/dist/types/views/Myna/qrMessages.d.ts +18 -0
  94. package/dist/types/views/Myna/svg.d.ts +21 -0
  95. package/dist/types/views/Myna/svgWatermark.d.ts +2 -0
  96. package/dist/types/views/Myna/templateLibrary.d.ts +26 -0
  97. package/dist/types/views/Myna/viewStore.d.ts +14 -0
  98. package/dist/types/views/Myna/workspaceLabels.d.ts +10 -0
  99. package/dist/types/views/Myna/workspaceSelectors.d.ts +17 -0
  100. package/docs/AGENTIC_BRIDGE.md +23 -0
  101. package/docs/EMBED.md +33 -0
  102. package/docs/MYNA.md +247 -0
  103. package/package.json +15 -4
@@ -0,0 +1,3 @@
1
+ export default function MynaTemplateLibrary({ locale }: {
2
+ locale: string;
3
+ }): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ /** View preferences remain available in read-only mode; clearing guides edits the page. */
2
+ export default function MynaViewSettings(): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function MynaWorkspace(): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare function fitMynaSelection(): void;
2
+ export declare function fitMynaPages(): void;
3
+ export default function MynaZoomControl(): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ export declare function WorkspaceLabelsPanel(): import("react").JSX.Element;
2
+ export declare const WorkspaceLabelsCanvas: import("react").MemoExoticComponent<({ left, top, originX, originY, scale }: {
3
+ left: number;
4
+ top: number;
5
+ originX: number;
6
+ originY: number;
7
+ scale: number;
8
+ }) => import("react").JSX.Element>;
@@ -0,0 +1,9 @@
1
+ import type { WorkspaceLabel } from '../../types/slides';
2
+ export declare function WorkspaceObjectsPanel(): import("react").JSX.Element;
3
+ export declare function WorkspaceObject({ label, owner, x, y, scale }: {
4
+ label: WorkspaceLabel;
5
+ owner: string;
6
+ x: number;
7
+ y: number;
8
+ scale: number;
9
+ }): import("react").JSX.Element;
@@ -0,0 +1,233 @@
1
+ import type { TranslationFunctions } from '../../i18n/i18n-types';
2
+ type MynaTranslations = TranslationFunctions['myna'];
3
+ import type { FikaDocument } from '../../embed/types';
4
+ import type { PPTTextElement, Slide } from '../../types/slides';
5
+ export declare const MYNA_FORMATS: readonly [{
6
+ readonly name: 'Social post';
7
+ readonly width: 1080;
8
+ readonly height: 1080;
9
+ }, {
10
+ readonly name: 'Portrait post';
11
+ readonly width: 1080;
12
+ readonly height: 1350;
13
+ }, {
14
+ readonly name: 'Story';
15
+ readonly width: 1080;
16
+ readonly height: 1920;
17
+ }, {
18
+ readonly name: 'Presentation';
19
+ readonly width: 1920;
20
+ readonly height: 1080;
21
+ }, {
22
+ readonly name: 'A4 portrait';
23
+ readonly width: 794;
24
+ readonly height: 1123;
25
+ }, {
26
+ readonly name: 'A4 landscape';
27
+ readonly width: 1123;
28
+ readonly height: 794;
29
+ }, {
30
+ readonly name: 'Poster';
31
+ readonly width: 1200;
32
+ readonly height: 1800;
33
+ }, {
34
+ readonly name: 'Video thumbnail';
35
+ readonly width: 1280;
36
+ readonly height: 720;
37
+ }, {
38
+ readonly name: 'Business card';
39
+ readonly width: 1050;
40
+ readonly height: 600;
41
+ }, {
42
+ readonly name: 'Banner';
43
+ readonly width: 1500;
44
+ readonly height: 500;
45
+ }];
46
+ export declare const MYNA_TEMPLATES: readonly [{
47
+ readonly id: 'studio';
48
+ readonly name: 'Creative studio';
49
+ readonly category: 'Social';
50
+ readonly background: '#ede9df';
51
+ readonly ink: '#282c24';
52
+ readonly accent: '#d7f36b';
53
+ readonly heading: 'Ideas into\nimpact.';
54
+ readonly eyebrow: 'THE CREATIVE EDIT';
55
+ readonly body: 'A little curiosity. A fresh perspective.\nSomething worth sharing.';
56
+ readonly layout: 'editorial';
57
+ }, {
58
+ readonly id: 'botanical';
59
+ readonly name: 'Grow together';
60
+ readonly category: 'Education';
61
+ readonly background: '#e9efdf';
62
+ readonly ink: '#183f33';
63
+ readonly accent: '#aec68c';
64
+ readonly heading: 'Room to\ngrow.';
65
+ readonly eyebrow: 'LEARN SOMETHING NEW';
66
+ readonly body: 'Small steps. Big discoveries.\nYour next chapter starts here.';
67
+ readonly layout: 'organic';
68
+ }, {
69
+ readonly id: 'workshop';
70
+ readonly name: 'The workshop';
71
+ readonly category: 'Events';
72
+ readonly background: '#29243c';
73
+ readonly ink: '#fff5e9';
74
+ readonly accent: '#e8b3f1';
75
+ readonly heading: 'Make it\nhappen.';
76
+ readonly eyebrow: 'A HANDS-ON WORKSHOP';
77
+ readonly body: 'Bring your ideas. Find your people.\nCreate something extraordinary.';
78
+ readonly layout: 'poster';
79
+ }, {
80
+ readonly id: 'launch';
81
+ readonly name: 'Fresh launch';
82
+ readonly category: 'Marketing';
83
+ readonly background: '#f6e1d6';
84
+ readonly ink: '#4b2c2e';
85
+ readonly accent: '#eb7754';
86
+ readonly heading: 'Meet your\nnew favorite.';
87
+ readonly eyebrow: 'SOMETHING GOOD IS HERE';
88
+ readonly body: 'Thoughtfully made. Ready for you.\nDiscover the collection.';
89
+ readonly layout: 'editorial';
90
+ }, {
91
+ readonly id: 'lesson';
92
+ readonly name: 'A curious mind';
93
+ readonly category: 'Education';
94
+ readonly background: '#edf1fa';
95
+ readonly ink: '#253762';
96
+ readonly accent: '#b0c5f0';
97
+ readonly heading: 'Stay\ncurious.';
98
+ readonly eyebrow: 'TODAY’S BIG QUESTION';
99
+ readonly body: 'What will you discover today?\nExplore. Experiment. Explain.';
100
+ readonly layout: 'organic';
101
+ }, {
102
+ readonly id: 'quote';
103
+ readonly name: 'Words to keep';
104
+ readonly category: 'Social';
105
+ readonly background: '#f8efdc';
106
+ readonly ink: '#524431';
107
+ readonly accent: '#dec48d';
108
+ readonly heading: 'Good things\ntake time.';
109
+ readonly eyebrow: 'A NOTE TO YOURSELF';
110
+ readonly body: 'Keep showing up.\nThe best is still ahead.';
111
+ readonly layout: 'poster';
112
+ }];
113
+ /** Resolve labels at insertion time; existing document content never changes with the UI locale. */
114
+ export declare function getMynaTemplates(t?: MynaTranslations): ({
115
+ id: 'studio';
116
+ category: 'Social';
117
+ background: '#ede9df';
118
+ ink: '#282c24';
119
+ accent: '#d7f36b';
120
+ layout: 'editorial';
121
+ name: import("typesafe-i18n").LocalizedString;
122
+ heading: import("typesafe-i18n").LocalizedString;
123
+ eyebrow: import("typesafe-i18n").LocalizedString;
124
+ body: import("typesafe-i18n").LocalizedString;
125
+ categoryName: import("typesafe-i18n").LocalizedString;
126
+ } | {
127
+ id: 'botanical';
128
+ category: 'Education';
129
+ background: '#e9efdf';
130
+ ink: '#183f33';
131
+ accent: '#aec68c';
132
+ layout: 'organic';
133
+ name: import("typesafe-i18n").LocalizedString;
134
+ heading: import("typesafe-i18n").LocalizedString;
135
+ eyebrow: import("typesafe-i18n").LocalizedString;
136
+ body: import("typesafe-i18n").LocalizedString;
137
+ categoryName: import("typesafe-i18n").LocalizedString;
138
+ } | {
139
+ id: 'workshop';
140
+ category: 'Events';
141
+ background: '#29243c';
142
+ ink: '#fff5e9';
143
+ accent: '#e8b3f1';
144
+ layout: 'poster';
145
+ name: import("typesafe-i18n").LocalizedString;
146
+ heading: import("typesafe-i18n").LocalizedString;
147
+ eyebrow: import("typesafe-i18n").LocalizedString;
148
+ body: import("typesafe-i18n").LocalizedString;
149
+ categoryName: import("typesafe-i18n").LocalizedString;
150
+ } | {
151
+ id: 'launch';
152
+ category: 'Marketing';
153
+ background: '#f6e1d6';
154
+ ink: '#4b2c2e';
155
+ accent: '#eb7754';
156
+ layout: 'editorial';
157
+ name: import("typesafe-i18n").LocalizedString;
158
+ heading: import("typesafe-i18n").LocalizedString;
159
+ eyebrow: import("typesafe-i18n").LocalizedString;
160
+ body: import("typesafe-i18n").LocalizedString;
161
+ categoryName: import("typesafe-i18n").LocalizedString;
162
+ } | {
163
+ id: 'lesson';
164
+ category: 'Education';
165
+ background: '#edf1fa';
166
+ ink: '#253762';
167
+ accent: '#b0c5f0';
168
+ layout: 'organic';
169
+ name: import("typesafe-i18n").LocalizedString;
170
+ heading: import("typesafe-i18n").LocalizedString;
171
+ eyebrow: import("typesafe-i18n").LocalizedString;
172
+ body: import("typesafe-i18n").LocalizedString;
173
+ categoryName: import("typesafe-i18n").LocalizedString;
174
+ } | {
175
+ id: 'quote';
176
+ category: 'Social';
177
+ background: '#f8efdc';
178
+ ink: '#524431';
179
+ accent: '#dec48d';
180
+ layout: 'poster';
181
+ name: import("typesafe-i18n").LocalizedString;
182
+ heading: import("typesafe-i18n").LocalizedString;
183
+ eyebrow: import("typesafe-i18n").LocalizedString;
184
+ body: import("typesafe-i18n").LocalizedString;
185
+ categoryName: import("typesafe-i18n").LocalizedString;
186
+ })[];
187
+ export declare function getMynaFormats(t?: MynaTranslations): ({
188
+ width: 1080;
189
+ height: 1080;
190
+ name: import("typesafe-i18n").LocalizedString;
191
+ } | {
192
+ width: 1080;
193
+ height: 1350;
194
+ name: import("typesafe-i18n").LocalizedString;
195
+ } | {
196
+ width: 1080;
197
+ height: 1920;
198
+ name: import("typesafe-i18n").LocalizedString;
199
+ } | {
200
+ width: 1920;
201
+ height: 1080;
202
+ name: import("typesafe-i18n").LocalizedString;
203
+ } | {
204
+ width: 794;
205
+ height: 1123;
206
+ name: import("typesafe-i18n").LocalizedString;
207
+ } | {
208
+ width: 1123;
209
+ height: 794;
210
+ name: import("typesafe-i18n").LocalizedString;
211
+ } | {
212
+ width: 1200;
213
+ height: 1800;
214
+ name: import("typesafe-i18n").LocalizedString;
215
+ } | {
216
+ width: 1280;
217
+ height: 720;
218
+ name: import("typesafe-i18n").LocalizedString;
219
+ } | {
220
+ width: 1050;
221
+ height: 600;
222
+ name: import("typesafe-i18n").LocalizedString;
223
+ } | {
224
+ width: 1500;
225
+ height: 500;
226
+ name: import("typesafe-i18n").LocalizedString;
227
+ })[];
228
+ export declare function validMynaSize(width: number, height: number): boolean;
229
+ export declare function createMynaPage(templateId: string, width: number, height: number, t?: MynaTranslations): Slide;
230
+ export declare function createMynaDocument(t?: MynaTranslations): FikaDocument;
231
+ /** A font pairing is two independently editable text boxes in one movable group. */
232
+ export declare function createMynaTextPair(heading: string, font: string, width: number, height: number, color: string, t?: MynaTranslations): PPTTextElement[];
233
+ export {};
@@ -0,0 +1,2 @@
1
+ /** One-based page specification, preserving the user's order and removing duplicates. */
2
+ export declare function parseExportPages(value: string, count: number): number[] | null;
@@ -0,0 +1,30 @@
1
+ /** Myna inspector copy kept independent from generated dictionaries. */
2
+ declare const en: {
3
+ page: string;
4
+ selection: string;
5
+ selected: string;
6
+ appearance: string;
7
+ typography: string;
8
+ image: string;
9
+ geometry: string;
10
+ arrange: string;
11
+ motion: string;
12
+ transition: string;
13
+ design: string;
14
+ pageHint: string;
15
+ multiHint: string;
16
+ readOnly: string;
17
+ text: string;
18
+ shape: string;
19
+ line: string;
20
+ chart: string;
21
+ table: string;
22
+ latex: string;
23
+ code: string;
24
+ video: string;
25
+ audio: string;
26
+ photo: string;
27
+ };
28
+ type Labels = Record<keyof typeof en, string>;
29
+ export declare const inspectorLabels: (locale: string) => Labels;
30
+ export {};
@@ -0,0 +1,28 @@
1
+ declare const en: {
2
+ title: string;
3
+ hint: string;
4
+ name: string;
5
+ save: string;
6
+ saving: string;
7
+ search: string;
8
+ all: string;
9
+ favorites: string;
10
+ recent: string;
11
+ empty: string;
12
+ use: string;
13
+ rename: string;
14
+ remove: string;
15
+ confirm: string;
16
+ cancel: string;
17
+ favorite: string;
18
+ unfavorite: string;
19
+ saved: string;
20
+ added: string;
21
+ failed: string;
22
+ unreadable: string;
23
+ pages: string;
24
+ fit: string;
25
+ };
26
+ export type LibraryMessages = typeof en;
27
+ export declare const libraryMessages: (locale: string) => LibraryMessages;
28
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { Slide } from '../../types/slides';
2
+ export interface PagePosition {
3
+ x: number;
4
+ y: number;
5
+ }
6
+ export type PageArrangement = 'grid' | 'horizontal' | 'vertical';
7
+ export declare const PAGE_GAP = 120;
8
+ /** Explicit positions may intentionally overlap. Only new, unpositioned pages avoid collisions. */
9
+ export declare function resolvePagePositions(slides: readonly Pick<Slide, 'id' | 'canvasPosition'>[], width: number, height: number): Map<string, PagePosition>;
10
+ export declare function arrangePagePositions(slides: readonly Pick<Slide, 'id'>[], width: number, height: number, arrangement: PageArrangement): Map<string, PagePosition>;
11
+ export declare function pageLayoutBounds(slides: readonly Pick<Slide, 'id' | 'canvasPosition'>[], width: number, height: number, positions?: Map<string, PagePosition>): {
12
+ x: number;
13
+ y: number;
14
+ width: number;
15
+ height: number;
16
+ };
17
+ /** Move complete groups with their element-linked notes and animations; page-local geometry is retained. */
18
+ export declare function movePageElements(source: Slide, target: Slide, selectedIds: readonly string[]): {
19
+ source: Slide;
20
+ target: Slide;
21
+ movedIds: string[];
22
+ };
@@ -0,0 +1,41 @@
1
+ /** Geometry is in document coordinates; tolerance is measured in screen pixels. */
2
+ export interface PageSnapRect {
3
+ id: string;
4
+ x: number;
5
+ y: number;
6
+ width: number;
7
+ height: number;
8
+ }
9
+ export interface PageSnapGuide {
10
+ axis: 'x' | 'y';
11
+ position: number;
12
+ start: number;
13
+ end: number;
14
+ }
15
+ export interface PageSnapSpacing {
16
+ axis: 'x' | 'y';
17
+ from: number;
18
+ to: number;
19
+ cross: number;
20
+ distance: number;
21
+ }
22
+ export interface PageSnapOptions {
23
+ moving: readonly PageSnapRect[];
24
+ stationary: readonly PageSnapRect[];
25
+ dx: number;
26
+ dy: number;
27
+ scale: number;
28
+ thresholdPx?: number;
29
+ gridSize?: number;
30
+ customGuides?: readonly PageSnapGuide[];
31
+ /** Constrain movement to this axis. */
32
+ axis?: 'x' | 'y';
33
+ }
34
+ export interface PageSnapResult {
35
+ dx: number;
36
+ dy: number;
37
+ guides: PageSnapGuide[];
38
+ spacing: PageSnapSpacing[];
39
+ }
40
+ /** Applies a single translation to a selection, retaining its internal layout. */
41
+ export declare function snapPageDrag(options: PageSnapOptions): PageSnapResult;
@@ -0,0 +1,10 @@
1
+ /** Flattened, multipage PDF export. Each JPEG preserves the canvas rendering. */
2
+ export interface MynaPdfPage {
3
+ jpeg: Uint8Array;
4
+ pixelWidth: number;
5
+ pixelHeight: number;
6
+ /** PDF points (1/72 inch), independent of the raster resolution. */
7
+ width: number;
8
+ height: number;
9
+ }
10
+ export declare function createMynaPdf(pages: MynaPdfPage[]): Uint8Array;
@@ -0,0 +1,28 @@
1
+ declare const en: {
2
+ title: string;
3
+ hint: string;
4
+ rect: string;
5
+ roundRect: string;
6
+ ellipse: string;
7
+ two: string;
8
+ three: string;
9
+ four: string;
10
+ six: string;
11
+ nine: string;
12
+ hero: string;
13
+ fill: string;
14
+ crop: string;
15
+ clear: string;
16
+ gutter: string;
17
+ swap: string;
18
+ cell: string;
19
+ error: string;
20
+ busy: string;
21
+ document: string;
22
+ empty: string;
23
+ };
24
+ type Labels = {
25
+ [K in keyof typeof en]: string;
26
+ };
27
+ export declare const photoFrameLabels: Record<string, Labels>;
28
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare function loadPhotoFrameImage(input: string | File): Promise<{
2
+ width: number;
3
+ height: number;
4
+ src: string;
5
+ }>;
@@ -0,0 +1,11 @@
1
+ import type { PPTImageElement, ImageClipDataRange } from '../../types/slides';
2
+ export declare const FRAME_LAYOUTS: readonly ['rect', 'roundRect', 'ellipse', 'two', 'three', 'four', 'six', 'nine', 'hero'];
3
+ export type FrameLayout = typeof FRAME_LAYOUTS[number];
4
+ export declare const FRAME_PLACEHOLDER: string;
5
+ /** Cell rectangles in fractional grid units. Mixed-span hero keeps a large left cell. */
6
+ export declare function frameCells(layout: FrameLayout): number[][];
7
+ export declare function coverRange(sourceWidth: number, sourceHeight: number, width: number, height: number): ImageClipDataRange;
8
+ export declare function createPhotoFrames(layout: FrameLayout, width: number, height: number, gutter?: number, name?: string): PPTImageElement[];
9
+ /** Uses current bounds, so moved/resized native groups keep their current location. */
10
+ export declare function layoutPhotoFrames(elements: PPTImageElement[], gutter: number): PPTImageElement[];
11
+ export declare function fillPhotoFrame(element: PPTImageElement, src: string, sourceWidth: number, sourceHeight: number): PPTImageElement;
@@ -0,0 +1,7 @@
1
+ import type { PPTImageElement } from '../../types/slides';
2
+ export type QrCodeOptions = NonNullable<PPTImageElement['qrCode']>;
3
+ export declare const DEFAULT_QR: QrCodeOptions;
4
+ export declare function validateQrOptions(options: QrCodeOptions): void;
5
+ /** Encoder owns all QR structure/error correction. SVG is only a vector rendering of its module matrix. */
6
+ export declare function qrSvg(options: QrCodeOptions): string;
7
+ export declare const qrImageSrc: (options: QrCodeOptions) => string;
@@ -0,0 +1,18 @@
1
+ declare const en: {
2
+ title: string;
3
+ hint: string;
4
+ content: string;
5
+ correction: string;
6
+ foreground: string;
7
+ background: string;
8
+ insert: string;
9
+ update: string;
10
+ text: string;
11
+ contrast: string;
12
+ error: string;
13
+ select: string;
14
+ size: string;
15
+ };
16
+ type Messages = typeof en;
17
+ export declare const qrMessages: (locale: string) => Messages;
18
+ export {};
@@ -0,0 +1,21 @@
1
+ import type { Slide, SlideTheme } from '../../types/slides';
2
+ export interface MynaSvgTarget {
3
+ slide: Slide;
4
+ theme: SlideTheme;
5
+ viewportSize: number;
6
+ viewportRatio: number;
7
+ }
8
+ export interface MynaSvgOptions {
9
+ selectedIds?: readonly string[];
10
+ transparentBackground?: boolean;
11
+ signal?: AbortSignal;
12
+ }
13
+ export interface MynaSvgResult {
14
+ blob: Blob;
15
+ svg: string;
16
+ width: number;
17
+ height: number;
18
+ warnings: string[];
19
+ }
20
+ /** Portable SVG with editable vector primitives; complex unsupported objects are isolated raster fallbacks. */
21
+ export declare function exportMynaSvg(target: MynaSvgTarget, options?: MynaSvgOptions): Promise<MynaSvgResult>;
@@ -0,0 +1,2 @@
1
+ import type { FikaExportWatermark } from '../../configs/exportWatermark';
2
+ export declare function watermarkSvg(svg: string, width: number, height: number, watermark: FikaExportWatermark, background: string): Promise<Blob>;
@@ -0,0 +1,26 @@
1
+ import type { Slide, SlideTheme } from '../../types/slides';
2
+ export declare const TEMPLATE_LIBRARY_KEY = "fika:myna:personal-templates:v1";
3
+ export declare const TEMPLATE_LIBRARY_LIMIT: number;
4
+ export interface PersonalTemplate {
5
+ id: string;
6
+ name: string;
7
+ width: number;
8
+ height: number;
9
+ slides: Slide[];
10
+ theme: SlideTheme;
11
+ createdAt: number;
12
+ updatedAt: number;
13
+ lastUsedAt: number;
14
+ favorite: boolean;
15
+ }
16
+ export interface LibraryStorage {
17
+ getItem(key: string): string | null;
18
+ setItem(key: string, value: string): void;
19
+ }
20
+ export declare function readTemplateLibrary(storage: LibraryStorage): PersonalTemplate[];
21
+ export declare function writeTemplateLibrary(storage: LibraryStorage, templates: PersonalTemplate[]): void;
22
+ /** Materialize session-only media before persisting. Remote links remain links, visibly disclosed in the UI. */
23
+ export declare function portableTemplateSlides(slides: readonly Slide[]): Promise<Slide[]>;
24
+ /** Clone every identity and reference. Never re-use IDs from a stored design. */
25
+ export declare function instantiateTemplate(template: PersonalTemplate, width: number, height: number): Slide[];
26
+ export declare function rankTemplates(templates: PersonalTemplate[], width: number, height: number, sort?: 'match' | 'recent'): PersonalTemplate[];
@@ -0,0 +1,14 @@
1
+ export interface MynaViewPreferences {
2
+ showRulers: boolean;
3
+ showGuides: boolean;
4
+ snapToGuides: boolean;
5
+ guidesLocked: boolean;
6
+ snapPages: boolean;
7
+ snapPagesToGrid: boolean;
8
+ showGrid: boolean;
9
+ gridSize: number;
10
+ }
11
+ export interface MynaViewState extends MynaViewPreferences {
12
+ setPreference: <K extends keyof MynaViewPreferences>(key: K, value: MynaViewPreferences[K]) => void;
13
+ }
14
+ export declare const useMynaViewStore: import("zustand").UseBoundStore<import("zustand").StoreApi<MynaViewState>>;
@@ -0,0 +1,10 @@
1
+ import type { WorkspaceLabel, Slide } from '../../types/slides';
2
+ /** Conservative text extents for workspace camera fitting; labels remain non-artwork. */
3
+ export declare function workspaceLabelsBounds(slides: readonly Slide[], pageWidth?: number, pageHeight?: number): {
4
+ minX: number;
5
+ minY: number;
6
+ maxX: number;
7
+ maxY: number;
8
+ };
9
+ /** Sections grow to include their explicit member pages, without changing page positions. */
10
+ export declare function workspaceObjectRect(label: WorkspaceLabel, slides: readonly Pick<Slide, 'id' | 'canvasPosition'>[], width: number, height: number): WorkspaceLabel;
@@ -0,0 +1,17 @@
1
+ import type { Slide } from '../../types/slides';
2
+ type Source = {
3
+ slides: Slide[];
4
+ };
5
+ export type WorkspacePage = Pick<Slide, 'id' | 'canvasName' | 'canvasPosition' | 'guides'>;
6
+ export type WorkspaceAnnotations = Pick<Slide, 'id' | 'workspaceLabels'>;
7
+ export declare const selectWorkspacePages: (state: Source) => WorkspacePage[];
8
+ export declare const selectWorkspacePageNames: (state: Source) => Pick<Slide, "canvasName" | "id">[];
9
+ export declare const selectWorkspaceAnnotations: (state: Source) => WorkspaceAnnotations[];
10
+ export declare const useWorkspacePages: () => WorkspacePage[];
11
+ export declare const useWorkspaceAnnotations: () => WorkspaceAnnotations[];
12
+ export declare const selectWorkspacePageSummaries: (state: Source) => {
13
+ id: string;
14
+ canvasName?: string;
15
+ summary: string;
16
+ }[];
17
+ export {};
@@ -527,3 +527,26 @@ properties to existing slide content. For example, `{ theme: { fontName:
527
527
  families without resetting backgrounds, text colors, chart palettes or sizes.
528
528
  Inline property removal is restricted to style declarations; background-color,
529
529
  border-color and literal CSS examples in lesson text are preserved.
530
+
531
+ ## Canvas authoring with compact context
532
+
533
+ Myna uses the same native document and command bus. `canvas.get` returns a bounded
534
+ page overview plus element IDs, geometry, frame relationships, and short text
535
+ excerpts for one page. It excludes image bytes, SVG paths, and rich-text HTML.
536
+ The default read is 40 elements with 160 text characters each; `offset`, `limit`
537
+ (maximum 100), and `textLimit` (maximum 500) let hosts request only what is needed.
538
+
539
+ `canvas.apply` accepts `{ operations: [...] }` (1–100 operations) and returns only
540
+ operation acknowledgements and IDs. One call is one undoable transaction, and a
541
+ failure rolls back the entire call. Operations are `title`, `viewport`, `page`,
542
+ `pageUpdate`, `text`, `textUpdate`, `shape`, `element`, `update`, and `remove`.
543
+ Use explicit IDs to reference newly created pages/elements in the same call.
544
+ Text is authored as Markdown with fixed-size boxes. `textUpdate` preserves the
545
+ existing first-run typography unless `style` overrides it. The `element` and
546
+ `update` operations expose native artwork types and nested-frame properties.
547
+ Existing bridge commands remain available for specialized editing.
548
+
549
+ For an initial invitation, batch the title, viewport, page, decorative shapes,
550
+ and text. For a revision, read only the target page and send targeted operations;
551
+ do not resend the document or automatically attach a screenshot on every turn.
552
+ The first `page` operation reuses an untouched, unnamed empty starter page.
package/docs/EMBED.md CHANGED
@@ -519,3 +519,36 @@ Application uses the picker implementation and creates one undo step for the
519
519
  whole deck. Unknown IDs fail without changing the presentation. Hosts should
520
520
  include the small catalog in agent context so applying a named theme needs only
521
521
  one call, without a preceding discovery request.
522
+
523
+ ### Content-aware canvas resizing
524
+
525
+ `controller.deck.setViewport({ ratio: 0.75 })` fits the entire deck to 4:3 in
526
+ one undo step, using the same operation as the size menu and custom size dialog.
527
+ It identifies full-width headings and independent body columns, distributes
528
+ rows through their available height, scales type with its boxes, preserves media
529
+ proportions and groups, remaps connectors, and anchors vector edge decorations.
530
+ It consumes spare vertical gutters before shrinking type when returning to a
531
+ shorter canvas. It preserves the authored composition rather than inventing a
532
+ new reading order or cropping photographs. Imported objects already outside the
533
+ canvas may still need manual correction.
534
+
535
+ Hosts authoring slides into a differently sized deck can use the pure,
536
+ DOM-free `resizeDeckSlides(slides, from, to)` export from `fika-editor/layout`;
537
+ `from` and `to` are `{ width, height }`. Raw document loading remains available
538
+ through `deck.set` / `deck.patch` with `slides` and `viewport` supplied together.
539
+
540
+ Host design themes can opt into `preserveColorRoles: true` to keep pale panels,
541
+ neutral surfaces and saturated accents separate during theme application.
542
+ Text is retinted against the actual panel beneath it, including badge and table
543
+ cell fills. Named `Decor` shapes become soft accents on the selected background.
544
+ Reapplying a selected theme is supported, including for older generated decks.
545
+
546
+
547
+ ## Myna graphic design mode
548
+
549
+ Pass `viewMode: 'canva'` (or its `'myna'` alias) to open the Myna design
550
+ workspace. Omit `document` for its square editable starter, or provide any
551
+ ordinary Fika document and viewport. `createMynaDocument()` and `MYNA_FORMATS`
552
+ are exported for hosts that need the starter or format catalog. The same
553
+ controller, history, media uploader, read-only options, and change callbacks
554
+ apply. See [Myna integration and capabilities](./MYNA.md).