fika-editor 3.2.10 → 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 (97) hide show
  1. package/dist/embed/{824.js → 6104.js} +18 -18
  2. package/dist/embed/agentic-manifest.json +44 -8
  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/utils/resizeDeck.js +5 -0
  16. package/dist/types/components/Button.d.ts +2 -2
  17. package/dist/types/embed/agentic/canvasContext.d.ts +4 -0
  18. package/dist/types/embed/agentic/canvasOperations.d.ts +3 -0
  19. package/dist/types/embed/agentic/types.d.ts +118 -0
  20. package/dist/types/embed/index.d.ts +2 -0
  21. package/dist/types/embed/render.d.ts +4 -0
  22. package/dist/types/embed/types.d.ts +3 -2
  23. package/dist/types/hooks/textCreationDefaults.d.ts +2 -0
  24. package/dist/types/hooks/useAnimationFrameCallback.d.ts +6 -0
  25. package/dist/types/i18n/cs/myna/index.d.ts +3 -0
  26. package/dist/types/i18n/en/myna/index.d.ts +3 -0
  27. package/dist/types/i18n/i18n-react.d.ts +2 -0
  28. package/dist/types/i18n/i18n-types.d.ts +2888 -1341
  29. package/dist/types/i18n/i18n-util.async.d.ts +1 -0
  30. package/dist/types/i18n/i18n-util.d.ts +1 -0
  31. package/dist/types/i18n/pl/myna/index.d.ts +3 -0
  32. package/dist/types/i18n/sk/myna/index.d.ts +3 -0
  33. package/dist/types/paint/slidePainter.d.ts +11 -0
  34. package/dist/types/store/slides.d.ts +241 -1
  35. package/dist/types/types/slides.d.ts +53 -0
  36. package/dist/types/utils/canvasFit.d.ts +17 -0
  37. package/dist/types/utils/canvasHitTest.d.ts +4 -0
  38. package/dist/types/utils/element.d.ts +27 -0
  39. package/dist/types/utils/elementPaint.d.ts +129 -0
  40. package/dist/types/utils/frameDomClip.d.ts +3 -0
  41. package/dist/types/utils/nestedFrames.d.ts +19 -0
  42. package/dist/types/utils/pageGuides.d.ts +6 -0
  43. package/dist/types/utils/renderMetrics.d.ts +2 -0
  44. package/dist/types/utils/selectInsertedElements.d.ts +2 -0
  45. package/dist/types/utils/transferPageElements.d.ts +3 -0
  46. package/dist/types/views/Editor/Canvas/MynaRulers.d.ts +17 -0
  47. package/dist/types/views/Editor/Canvas/ViewportBackground.d.ts +3 -1
  48. package/dist/types/views/Editor/Canvas/hooks/useDragElement.d.ts +2 -1
  49. package/dist/types/views/Editor/Canvas/hooks/useDrop.d.ts +1 -1
  50. package/dist/types/views/Editor/Canvas/hooks/useViewportSize.d.ts +1 -0
  51. package/dist/types/views/Editor/Canvas/index.d.ts +4 -1
  52. package/dist/types/views/Editor/EditorHeader/index.d.ts +4 -2
  53. package/dist/types/views/Editor/index.d.ts +3 -2
  54. package/dist/types/views/Myna/MynaAssetsPanel.d.ts +28 -0
  55. package/dist/types/views/Myna/MynaDownload.d.ts +4 -0
  56. package/dist/types/views/Myna/MynaDrawer.d.ts +9 -0
  57. package/dist/types/views/Myna/MynaElementsPanel.d.ts +12 -0
  58. package/dist/types/views/Myna/MynaFrameTitles.d.ts +6 -0
  59. package/dist/types/views/Myna/MynaFramesHierarchy.d.ts +1 -0
  60. package/dist/types/views/Myna/MynaFramesPanel.d.ts +6 -0
  61. package/dist/types/views/Myna/MynaHeader.d.ts +5 -0
  62. package/dist/types/views/Myna/MynaInspector.d.ts +2 -0
  63. package/dist/types/views/Myna/MynaLayersPanel.d.ts +1 -0
  64. package/dist/types/views/Myna/MynaPageCanvas.d.ts +14 -0
  65. package/dist/types/views/Myna/MynaPageLayoutControls.d.ts +1 -0
  66. package/dist/types/views/Myna/MynaPageOutline.d.ts +1 -0
  67. package/dist/types/views/Myna/MynaPageOverflow.d.ts +9 -0
  68. package/dist/types/views/Myna/MynaPagesPanel.d.ts +14 -0
  69. package/dist/types/views/Myna/MynaQrPanel.d.ts +1 -0
  70. package/dist/types/views/Myna/MynaTemplateLibrary.d.ts +3 -0
  71. package/dist/types/views/Myna/MynaViewSettings.d.ts +2 -0
  72. package/dist/types/views/Myna/MynaWorkspace.d.ts +1 -0
  73. package/dist/types/views/Myna/MynaZoomControl.d.ts +3 -0
  74. package/dist/types/views/Myna/WorkspaceLabels.d.ts +8 -0
  75. package/dist/types/views/Myna/WorkspaceObjects.d.ts +9 -0
  76. package/dist/types/views/Myna/catalog.d.ts +233 -0
  77. package/dist/types/views/Myna/exportPages.d.ts +2 -0
  78. package/dist/types/views/Myna/inspectorLabels.d.ts +30 -0
  79. package/dist/types/views/Myna/libraryMessages.d.ts +28 -0
  80. package/dist/types/views/Myna/pageLayout.d.ts +22 -0
  81. package/dist/types/views/Myna/pageSnapping.d.ts +41 -0
  82. package/dist/types/views/Myna/pdf.d.ts +10 -0
  83. package/dist/types/views/Myna/photoFrameLabels.d.ts +28 -0
  84. package/dist/types/views/Myna/photoFrameUpload.d.ts +5 -0
  85. package/dist/types/views/Myna/photoFrames.d.ts +11 -0
  86. package/dist/types/views/Myna/qrCode.d.ts +7 -0
  87. package/dist/types/views/Myna/qrMessages.d.ts +18 -0
  88. package/dist/types/views/Myna/svg.d.ts +21 -0
  89. package/dist/types/views/Myna/svgWatermark.d.ts +2 -0
  90. package/dist/types/views/Myna/templateLibrary.d.ts +26 -0
  91. package/dist/types/views/Myna/viewStore.d.ts +14 -0
  92. package/dist/types/views/Myna/workspaceLabels.d.ts +10 -0
  93. package/dist/types/views/Myna/workspaceSelectors.d.ts +17 -0
  94. package/docs/AGENTIC_BRIDGE.md +23 -0
  95. package/docs/EMBED.md +10 -0
  96. package/docs/MYNA.md +247 -0
  97. package/package.json +5 -1
@@ -157,6 +157,11 @@ export function resizeDeckSlides(slides, from, to) {
157
157
  if (from.width === to.width && from.height === to.height)
158
158
  return result;
159
159
  for (const slide of result) {
160
+ // Guides describe page coordinates; resize them proportionally along their own axis.
161
+ if (slide.guides)
162
+ slide.guides = slide.guides.map(guide => ({ ...guide,
163
+ position: guide.position * (guide.axis === 'x' ? to.width / from.width : to.height / from.height),
164
+ }));
160
165
  const groups = new Map();
161
166
  for (const el of slide.elements) {
162
167
  if ((el.type === 'line' && !el.groupId) || isBackdrop(el, from) || isDecor(el, from) || edgeBand(el, from))
@@ -1,4 +1,4 @@
1
- import type { ReactNode } from 'react';
1
+ import type { ReactNode, MouseEvent } from 'react';
2
2
  export type IButtonProps = {
3
3
  checked?: boolean;
4
4
  disabled?: boolean;
@@ -6,7 +6,7 @@ export type IButtonProps = {
6
6
  size?: 'small' | 'normal';
7
7
  first?: boolean;
8
8
  last?: boolean;
9
- onClick?: () => void;
9
+ onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
10
10
  children?: ReactNode;
11
11
  style?: React.CSSProperties;
12
12
  className?: string;
@@ -0,0 +1,4 @@
1
+ import type { Slide } from '../../types/slides';
2
+ import type { FikaCanvasContext, FikaCanvasReadOptions } from './types';
3
+ /** Bounded summaries never contain image data, SVG paths, or full rich-text HTML. */
4
+ export declare function summarizeCanvas(slides: Slide[], activePageId: string | undefined, selectedIds: string[], width: number, ratio: number, options?: FikaCanvasReadOptions): FikaCanvasContext;
@@ -0,0 +1,3 @@
1
+ import type { FikaAgentCommand, FikaCanvasOperation } from './types';
2
+ /** Expand concise canvas operations into the existing validated native handlers. */
3
+ export declare function canvasOperationCommand(operation: FikaCanvasOperation): FikaAgentCommand;
@@ -1205,7 +1205,123 @@ export interface FikaAgentApi {
1205
1205
  import: FikaAgentImportApi;
1206
1206
  export: FikaAgentExportApi;
1207
1207
  }
1208
+ export type FikaCanvasOperation = {
1209
+ op: 'title';
1210
+ title: string;
1211
+ } | {
1212
+ op: 'viewport';
1213
+ width: number;
1214
+ height: number;
1215
+ } | {
1216
+ op: 'page';
1217
+ id?: string;
1218
+ name?: string;
1219
+ x?: number;
1220
+ y?: number;
1221
+ background?: string;
1222
+ } | {
1223
+ op: 'pageUpdate';
1224
+ id: string;
1225
+ patch: Partial<Slide>;
1226
+ } | {
1227
+ op: 'text';
1228
+ pageId?: string;
1229
+ id?: string;
1230
+ x: number;
1231
+ y: number;
1232
+ width: number;
1233
+ height: number;
1234
+ text: string;
1235
+ fontSize?: number;
1236
+ fontName?: string;
1237
+ color?: string;
1238
+ bold?: boolean;
1239
+ align?: 'left' | 'center' | 'right' | 'justify';
1240
+ } | {
1241
+ op: 'textUpdate';
1242
+ pageId?: string;
1243
+ id: string;
1244
+ text: string;
1245
+ style?: TextRunStyle;
1246
+ } | {
1247
+ op: 'shape';
1248
+ pageId?: string;
1249
+ id?: string;
1250
+ x: number;
1251
+ y: number;
1252
+ width: number;
1253
+ height: number;
1254
+ shape: 'rect' | 'ellipse';
1255
+ fill?: string;
1256
+ } | {
1257
+ op: 'element';
1258
+ pageId?: string;
1259
+ element: Partial<PPTElement> & {
1260
+ type: PPTElement['type'];
1261
+ };
1262
+ } | {
1263
+ op: 'update';
1264
+ pageId?: string;
1265
+ id: string;
1266
+ patch: Partial<PPTElement>;
1267
+ } | {
1268
+ op: 'remove';
1269
+ pageId?: string;
1270
+ id: string;
1271
+ };
1272
+ export interface FikaCanvasApplyResult {
1273
+ results: Array<{
1274
+ op: FikaCanvasOperation['op'];
1275
+ id?: string;
1276
+ pageId?: string;
1277
+ }>;
1278
+ }
1279
+ export interface FikaCanvasReadOptions {
1280
+ pageId?: string;
1281
+ offset?: number;
1282
+ limit?: number;
1283
+ textLimit?: number;
1284
+ }
1285
+ export interface FikaCanvasContext {
1286
+ viewport: {
1287
+ width: number;
1288
+ height: number;
1289
+ };
1290
+ activePageId?: string;
1291
+ selectedIds: string[];
1292
+ pageCount: number;
1293
+ pages: Array<{
1294
+ id: string;
1295
+ name?: string;
1296
+ x: number;
1297
+ y: number;
1298
+ elementCount: number;
1299
+ }>;
1300
+ pageId?: string;
1301
+ elementCount: number;
1302
+ offset: number;
1303
+ nextOffset?: number;
1304
+ elements: Array<{
1305
+ id: string;
1306
+ type: string;
1307
+ name?: string;
1308
+ x: number;
1309
+ y: number;
1310
+ width: number;
1311
+ height?: number;
1312
+ parentFrameId?: string;
1313
+ groupId?: string;
1314
+ frame?: {
1315
+ clipContent: boolean;
1316
+ };
1317
+ text?: string;
1318
+ }>;
1319
+ }
1208
1320
  export interface FikaCommandPayloadMap {
1321
+ 'canvas.get': FikaCanvasReadOptions | undefined;
1322
+ 'canvas.apply': {
1323
+ operations: FikaCanvasOperation[];
1324
+ };
1209
1325
  'deck.get': undefined;
1210
1326
  'deck.set': FikaDeckInput | FikaDocument;
1211
1327
  'deck.patch': FikaDeckPatch | Partial<FikaDocument>;
@@ -1902,6 +2018,8 @@ export interface FikaCommandPayloadMap {
1902
2018
  'view.exitPresentation': undefined;
1903
2019
  }
1904
2020
  export interface FikaCommandResultDataMap {
2021
+ 'canvas.get': FikaCanvasContext;
2022
+ 'canvas.apply': FikaCanvasApplyResult;
1905
2023
  'deck.get': FikaDeckDocument;
1906
2024
  'deck.set': FikaDeckDocument;
1907
2025
  'deck.patch': FikaDeckDocument;
@@ -13,3 +13,5 @@ export type { ChartData, ChartOptions, ChartType, Note, NoteReply, PPTAnimation,
13
13
  export type { FikaDesignTheme } from '../configs/designThemes';
14
14
  export { getFikaDefaultDesignThemes } from '../configs/designThemes';
15
15
  export { resizeDeckSlides, type SlideCanvas } from '../utils/resizeDeck';
16
+ /** Myna design-mode capabilities and editable starter document. */
17
+ export { createMynaDocument, MYNA_FORMATS } from '../views/Myna/catalog';
@@ -21,6 +21,10 @@ export interface FikaRenderSlideOptions {
21
21
  format?: 'image/png' | 'image/jpeg' | 'image/webp';
22
22
  /** Encoder quality for lossy formats (0–1). Default 0.9. */
23
23
  quality?: number;
24
+ /** Omit the page background for PNG/WebP without changing element colors. */
25
+ transparentBackground?: boolean;
26
+ /** Load original image pixels, using the host media resolver if needed. Fail if an image cannot load. */
27
+ fullResolutionImages?: boolean;
24
28
  }
25
29
  export interface FikaDeckAtlasOptions extends Omit<FikaRenderSlideOptions, 'width'> {
26
30
  /** Width of one slide tile in CSS px. Default 640. */
@@ -61,8 +61,8 @@ export interface FikaHeaderMenuItem {
61
61
  /** Fired when the entry is clicked (the dropdown closes first). */
62
62
  onSelect?: (id: string) => void;
63
63
  }
64
- /** `editor` is the default full editor; `presentation` boots straight into the fullscreen slideshow with no editor chrome. */
65
- export type FikaViewMode = 'editor' | 'presentation';
64
+ /** `editor`: presentation editor; `presentation`: viewer; `canva` (alias `myna`): Myna design workspace. */
65
+ export type FikaViewMode = 'editor' | 'presentation' | 'canva' | 'myna';
66
66
  export interface FikaMountOptions {
67
67
  /** Replacement design catalog in display order. Omit for Fika defaults; [] hides presets. Does not restyle the loaded document. */
68
68
  designThemes?: readonly FikaDesignTheme[];
@@ -135,6 +135,7 @@ export interface FikaMountOptions {
135
135
  */
136
136
  openPanelOnTextSelection?: boolean;
137
137
  /**
138
+ * `canva` (or `myna`) mounts the Myna graphic design workspace.
138
139
  * `presentation` mounts a presentation-only viewer: once the deck resolves,
139
140
  * the fullscreen slideshow starts immediately and the editor never renders.
140
141
  * Exiting the slideshow re-enters it, so the page stays a pure viewer.
@@ -0,0 +1,2 @@
1
+ /** Creation policy only; existing and imported text retains its authored sizing. */
2
+ export declare const FixedTextCreationContext: import("react").Context<boolean>;
@@ -0,0 +1,6 @@
1
+ /** Coalesce transient pointer input, with an explicit flush at the transaction boundary. */
2
+ export declare function useAnimationFrameCallback<T>(callback: (value: T) => void): {
3
+ schedule: (value: T) => void;
4
+ flush: () => void;
5
+ cancel: () => void;
6
+ };
@@ -0,0 +1,3 @@
1
+ import type { NamespaceMynaTranslation } from '../../i18n-types';
2
+ declare const myna: NamespaceMynaTranslation;
3
+ export default myna;
@@ -0,0 +1,3 @@
1
+ import type { BaseTranslation } from '../../i18n-types';
2
+ declare const myna: BaseTranslation;
3
+ export default myna;
@@ -1,6 +1,7 @@
1
1
  import type { Locales, TranslationFunctions } from './i18n-types';
2
2
  declare const TypesafeI18n: import("react").FunctionComponent<import("typesafe-i18n/react").TypesafeI18nProps<Locales>>, I18nContext: import("react").Context<import("typesafe-i18n/react").I18nContextType<Locales, {
3
3
  screen: import("./i18n-types").NamespaceScreenTranslation;
4
+ myna: import("./i18n-types").NamespaceMynaTranslation;
4
5
  export: import("./i18n-types").NamespaceExportTranslation;
5
6
  editor: import("./i18n-types").NamespaceEditorTranslation;
6
7
  mobile: import("./i18n-types").NamespaceMobileTranslation;
@@ -12,6 +13,7 @@ declare const TypesafeI18n: import("react").FunctionComponent<import("typesafe-i
12
13
  export { TypesafeI18n, I18nContext };
13
14
  export declare function useI18nContext(): import("typesafe-i18n/react").I18nContextType<Locales, {
14
15
  screen: import("./i18n-types").NamespaceScreenTranslation;
16
+ myna: import("./i18n-types").NamespaceMynaTranslation;
15
17
  export: import("./i18n-types").NamespaceExportTranslation;
16
18
  editor: import("./i18n-types").NamespaceEditorTranslation;
17
19
  mobile: import("./i18n-types").NamespaceMobileTranslation;