fika-editor 3.6.14 → 3.7.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.
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "fika-editor",
4
- "packageVersion": "3.6.14",
5
- "generatedAt": "2026-11-24T05:58:21.563Z",
4
+ "packageVersion": "3.7.0",
5
+ "generatedAt": "2026-11-24T08:17:57.406Z",
6
6
  "summary": "Authoring guidance for the Fika agentic bridge. SLIDE NUMBERS START AT 1 everywhere: payload.index, result.data.slideIndex, screenshot.slideIndex, getState().slideIndex, selectedSlideIndexes, plan.slides[].index, and plan.loudIndex are the SAME 1-based number — never subtract or add 1. First slide = 1; last existing = slideCount; omit index to append; index === slideCount+1 also appends; 1 ≤ index ≤ slideCount on createFromLayout REPLACES that slide. The recommended way to build a deck from scratch: (1) ONE bootstrap call deck.setup({ styleId, slideCount, title? }) — applies the visual identity, returns the composition plan (anchors + loud slide), and optionally builds the title slide together; prefer this over separate styles.catalog / deck.applyStyle / deck.planComposition, then (2) for each slide pick a recipe + visual variant from layouts.catalog and add it with slides.createFromLayout({ layoutId, variantId, slots }), preferring a variant whose anchor matches the plan (when variantId is omitted the engine picks a filled/full-width match; an explicit variantId is kept). The engine themes, positions, sanitizes slot markers the layout already draws, AND auto-fits every text box (via responsive measurement) so content does not overflow, and it runs a deterministic QA pass on each slide (overlap / contrast / density / monotony) so you can fix issues in the same turn. Author slot content as Markdown/plain text or structured values (arrays for bullets, { labels, series } for charts) — never hand-written HTML. Host-registered templates (deck.applyTemplate + slides.insertFromTemplate) are optional when the embed host supplies them. Avoid blank slides.create / hand-placed elements unless no layout fits. Pair this with the machine schema (command payload/return types) in the same manifest.",
7
- "commandCount": 201,
7
+ "commandCount": 202,
8
8
  "designSystem": {
9
9
  "summary": "Fika lays elements out in a fixed pixel coordinate space, not inches. Prefer the styles + layouts flow (deck.applyStyle + slides.createFromLayout) so colors, contrast, fonts and layout are chosen for you instead of hand-picked. Host-registered templates (deck.applyTemplate + slides.insertFromTemplate) are optional when the embed host supplies them. These tokens describe the *fallback* defaults for manual placement only.",
10
10
  "coordinateSystem": {
@@ -188,7 +188,7 @@
188
188
  },
189
189
  {
190
190
  "id": "media",
191
- "commandCount": 4,
191
+ "commandCount": 5,
192
192
  "title": "Media",
193
193
  "summary": "JSON-safe image/video/audio source assignment with mime/ext inference.",
194
194
  "whenToUse": "Attach already-resolved media URLs to elements."
@@ -712,7 +712,7 @@
712
712
  {
713
713
  "name": "slides.create",
714
714
  "domain": "slides",
715
- "payload": "{ slide?: Partial<Slide>; index?: number; select?: boolean }",
715
+ "payload": "{ slide?: Partial<Slide>; index?: number; anchor?: FikaSlideInsertAnchorInput; select?: boolean }",
716
716
  "returns": "Slide",
717
717
  "optional": true,
718
718
  "doc": {
@@ -731,6 +731,12 @@
731
731
  "required": false,
732
732
  "description": "1-based insert position; omit or pass slideCount+1 to append. First slide is 1."
733
733
  },
734
+ {
735
+ "name": "anchor",
736
+ "type": "FikaSlideInsertAnchorInput",
737
+ "required": false,
738
+ "description": "Stable neighbor anchor ({ position, afterSlideId, beforeSlideId, fallbackIndex }) resolved against the live slide order when index is omitted."
739
+ },
734
740
  {
735
741
  "name": "select",
736
742
  "type": "boolean",
@@ -899,7 +905,27 @@
899
905
  "payload": "FikaInsertSlidesInput",
900
906
  "returns": "FikaInsertSlidesResult",
901
907
  "doc": {
902
- "summary": "Insert a slide at a specific index (same payload as slides.create plus index).",
908
+ "summary": "Insert one or more slides at a specific 1-based index or stable neighbor anchor.",
909
+ "params": [
910
+ {
911
+ "name": "slides",
912
+ "type": "Slide | Slide[]",
913
+ "required": true,
914
+ "description": "Slide or slides to insert with remapped IDs."
915
+ },
916
+ {
917
+ "name": "index",
918
+ "type": "number",
919
+ "required": false,
920
+ "description": "1-based insert position; omit to resolve from anchor or append."
921
+ },
922
+ {
923
+ "name": "anchor",
924
+ "type": "FikaSlideInsertAnchorInput",
925
+ "required": false,
926
+ "description": "Stable neighbor anchor ({ position, afterSlideId, beforeSlideId, fallbackIndex }) resolved against live slide order when index is omitted."
927
+ }
928
+ ],
903
929
  "related": [
904
930
  "slides.create",
905
931
  "slides.move"
@@ -1821,8 +1847,92 @@
1821
1847
  {
1822
1848
  "name": "media.setImageSource",
1823
1849
  "domain": "media",
1824
- "payload": "{ elementId: string; slideId?: string; asset: FikaMediaAssetInput; patch?: Partial<PPTImageElement> }",
1825
- "returns": "PPTImageElement"
1850
+ "payload": "FikaSetImageSourcePayload",
1851
+ "returns": "PPTImageElement",
1852
+ "doc": {
1853
+ "summary": "Resolve or replace an image element's source by elementId or pending mediaState.slotId, preserving aspect ratio and user edits.",
1854
+ "details": "Locates the target image across slides (surviving slide reorder). Computes centered cover crop or contain fit when natural dimensions are provided, clears mediaState on resolution, and skips stale async writes when onlyIfPending:true and the element is already resolved.",
1855
+ "params": [
1856
+ {
1857
+ "name": "elementId",
1858
+ "type": "string",
1859
+ "required": false,
1860
+ "description": "Target image element ID (optional when slotId is provided)."
1861
+ },
1862
+ {
1863
+ "name": "slotId",
1864
+ "type": "string",
1865
+ "required": false,
1866
+ "description": "Target pending image mediaState.slotId across the deck."
1867
+ },
1868
+ {
1869
+ "name": "asset",
1870
+ "type": "FikaMediaAssetInput",
1871
+ "required": false,
1872
+ "description": "Image URL, data URL, or FikaMediaAsset object (width/height used for aspect-preserving fit)."
1873
+ },
1874
+ {
1875
+ "name": "fit",
1876
+ "type": "'cover' | 'contain'",
1877
+ "required": false,
1878
+ "description": "Aspect-preserving fit mode when natural dimensions are supplied (defaults to mediaState.fit or 'cover')."
1879
+ },
1880
+ {
1881
+ "name": "natural",
1882
+ "type": "{ width: number; height: number }",
1883
+ "required": false,
1884
+ "description": "Natural pixel dimensions of the resolved image."
1885
+ },
1886
+ {
1887
+ "name": "onlyIfPending",
1888
+ "type": "boolean",
1889
+ "required": false,
1890
+ "description": "When true, avoids overwriting an image that is no longer pending."
1891
+ }
1892
+ ],
1893
+ "related": [
1894
+ "media.setImageState",
1895
+ "images.setSource"
1896
+ ]
1897
+ }
1898
+ },
1899
+ {
1900
+ "name": "media.setImageState",
1901
+ "domain": "media",
1902
+ "payload": "FikaSetImageStatePayload",
1903
+ "returns": "PPTImageElement",
1904
+ "doc": {
1905
+ "summary": "Update or clear a single native image element's async mediaState (pending, ready, error) without affecting sibling elements or slides.",
1906
+ "params": [
1907
+ {
1908
+ "name": "elementId",
1909
+ "type": "string",
1910
+ "required": false,
1911
+ "description": "Target image element ID (optional when slotId is provided)."
1912
+ },
1913
+ {
1914
+ "name": "slotId",
1915
+ "type": "string",
1916
+ "required": false,
1917
+ "description": "Target image mediaState.slotId across the deck."
1918
+ },
1919
+ {
1920
+ "name": "state",
1921
+ "type": "ImageMediaState | null",
1922
+ "required": true,
1923
+ "description": "New ImageMediaState ({ status, slotId?, aspectRatio?, fit?, label?, error? }) or null to clear."
1924
+ },
1925
+ {
1926
+ "name": "onlyIfPending",
1927
+ "type": "boolean",
1928
+ "required": false,
1929
+ "description": "When true, ignores stale state writes if the image is already ready with a non-empty src."
1930
+ }
1931
+ ],
1932
+ "related": [
1933
+ "media.setImageSource"
1934
+ ]
1935
+ }
1826
1936
  },
1827
1937
  {
1828
1938
  "name": "media.setVideoSource",
@@ -2581,7 +2691,7 @@
2581
2691
  "FikaInsertElementsResult": "export interface FikaInsertElementsResult { slideId: string; elements: PPTElement[]; animations: PPTAnimation[]; remap: Omit<FikaIdRemap, 'slideIds'> & { slideIds?: FikaIdMap } }",
2582
2692
  "FikaInsertFromTemplateInput": "export interface FikaInsertFromTemplateInput { templateId: string; slug: string; index?: number; select?: boolean; applyTemplateTheme?: boolean }",
2583
2693
  "FikaInsertFromTemplateResult": "export interface FikaInsertFromTemplateResult { slideId: string; slideIndex: number; templateId: string; slug: string; elementIds: string[]; textElementIds: string[]; placeholderElementIds: string[] }",
2584
- "FikaInsertSlidesInput": "export interface FikaInsertSlidesInput { slides: Slide | Slide[]; index?: number; select?: boolean; preserveExternalSlideLinks?: boolean }",
2694
+ "FikaInsertSlidesInput": "export interface FikaInsertSlidesInput { slides: Slide | Slide[]; index?: number; anchor?: FikaSlideInsertAnchorInput; select?: boolean; preserveExternalSlideLinks?: boolean }",
2585
2695
  "FikaInsertSlidesResult": "export interface FikaInsertSlidesResult { slides: Slide[]; remap: FikaIdRemap }",
2586
2696
  "FikaJsonPrimitive": "export type FikaJsonPrimitive = string | number | boolean | null",
2587
2697
  "FikaJsonValue": "export type FikaJsonValue = FikaJsonPrimitive | FikaJsonValue[] | { [key: string]: FikaJsonValue }",
@@ -2611,6 +2721,9 @@
2611
2721
  "FikaSearchReplaceResult": "export interface FikaSearchReplaceResult { count: number }",
2612
2722
  "FikaSearchResult": "export interface FikaSearchResult { slideId: string; elementId: string; elementType: PPTElement['type']; path: string; match: string; start?: number; end?: number; row?: number; col?: number }",
2613
2723
  "FikaSectionRange": "export interface FikaSectionRange { slideId: string; index: number; section: NonNullable<Slide['sectionTag']>; startIndex: number; endIndex: number; slideIds: string[] }",
2724
+ "FikaSetImageSourceOptions": "export interface FikaSetImageSourceOptions { slideId?: string; slotId?: string; fit?: ImageMediaFit; natural?: { width: number; height: number }; onlyIfPending?: boolean }",
2725
+ "FikaSetImageSourcePayload": "export interface FikaSetImageSourcePayload extends FikaSetImageSourceOptions { elementId?: string; asset?: FikaMediaAssetInput; src?: string; patch?: Partial<PPTImageElement> }",
2726
+ "FikaSetImageStatePayload": "export interface FikaSetImageStatePayload { elementId?: string; slotId?: string; slideId?: string; state: ImageMediaState | null; onlyIfPending?: boolean }",
2614
2727
  "FikaSetupDeckInput": "export interface FikaSetupDeckInput { styleId: string; slideCount: number; hints?: CompositionSlideHint[]; title?: FikaSetupTitleInput }",
2615
2728
  "FikaSetupDeckResult": "export interface FikaSetupDeckResult { styleId: string; theme: SlideTheme; plan: CompositionPlan; motif: FikaStyleMotif; styles: FikaStyleSummary[]; titleSlideId?: string; titleBuilt?: boolean }",
2616
2729
  "FikaSetupTitleInput": "export interface FikaSetupTitleInput { slots: Record<string, unknown>; variantId?: string }",
@@ -2658,6 +2771,9 @@
2658
2771
  "ImageClipDataRange": "export type ImageClipDataRange = [[number, number], [number, number]]",
2659
2772
  "ImageElementClip": "export interface ImageElementClip { range: ImageClipDataRange; shape: string }",
2660
2773
  "ImageElementFilters": "export interface ImageElementFilters { 'blur'?: string; 'brightness'?: string; 'contrast'?: string; 'grayscale'?: string; 'saturate'?: string; 'hue-rotate'?: string; 'sepia'?: string; 'invert'?: string; 'opacity'?: string }",
2774
+ "ImageMediaFit": "export type ImageMediaFit = 'cover' | 'contain'",
2775
+ "ImageMediaState": "export interface ImageMediaState { slotId?: string; status: ImageMediaStatus; aspectRatio?: number; fit?: ImageMediaFit; label?: string; error?: string }",
2776
+ "ImageMediaStatus": "export type ImageMediaStatus = 'pending' | 'ready' | 'error'",
2661
2777
  "ImageType": "export type ImageType = 'pageFigure' | 'itemFigure' | 'background'",
2662
2778
  "LinePoint": "export type LinePoint = '' | 'arrow' | 'dot'",
2663
2779
  "LineStyleType": "export type LineStyleType = 'solid' | 'dashed' | 'dotted'",
@@ -2673,7 +2789,7 @@
2673
2789
  "PPTElementLink": "export interface PPTElementLink { type: ElementLinkType; target: string }",
2674
2790
  "PPTElementOutline": "export interface PPTElementOutline { style?: LineStyleType; width?: number; color?: string; radius?: number }",
2675
2791
  "PPTElementShadow": "export interface PPTElementShadow { h: number; v: number; blur: number; color: string }",
2676
- "PPTImageElement": "export interface PPTImageElement extends PPTBaseElement { type: 'image'; altText?: string; fixedRatio: boolean; src: string; outline?: PPTElementOutline; filters?: ImageElementFilters; clip?: ImageElementClip; flipH?: boolean; flipV?: boolean; shadow?: PPTElementShadow; radius?: number; colorMask?: string; imageType?: ImageType; qrCode?: { text: string; errorCorrection: 'L' | 'M' | 'Q' | 'H'; foreground: string; background: string }; photoFrame?: { layout: string; cell: number; gutter: number; empty: boolean; sourceWidth?: number; sourceHeight?: number } }",
2792
+ "PPTImageElement": "export interface PPTImageElement extends PPTBaseElement { type: 'image'; altText?: string; fixedRatio: boolean; src: string; outline?: PPTElementOutline; filters?: ImageElementFilters; clip?: ImageElementClip; flipH?: boolean; flipV?: boolean; shadow?: PPTElementShadow; radius?: number; colorMask?: string; imageType?: ImageType; qrCode?: { text: string; errorCorrection: 'L' | 'M' | 'Q' | 'H'; foreground: string; background: string }; photoFrame?: { layout: string; cell: number; gutter: number; empty: boolean; sourceWidth?: number; sourceHeight?: number }; mediaState?: ImageMediaState }",
2677
2793
  "PPTLatexElement": "export interface PPTLatexElement extends PPTBaseElement { type: 'latex'; latex: string; path: string; color: string; strokeWidth: number; viewBox: [number, number]; fixedRatio: boolean }",
2678
2794
  "PPTLineElement": "export interface PPTLineElement extends Omit<PPTBaseElement, 'height' | 'rotate'> { type: 'line'; start: [number, number]; end: [number, number]; style: LineStyleType; color: string; points: [LinePoint, LinePoint]; shadow?: PPTElementShadow; broken?: [number, number]; broken2?: [number, number]; broken2Direction?: Broken2LineDirection; curve?: [number, number]; cubic?: [[number, number], [number, number]] }",
2679
2795
  "PPTMermaidElement": "export interface PPTMermaidElement extends PPTBaseElement { type: 'mermaid'; code: string }",
@@ -2684,7 +2800,7 @@
2684
2800
  "SectionTag": "export interface SectionTag { id: string; title?: string }",
2685
2801
  "ShapePathFormulasKeys": "export declare const enum ShapePathFormulasKeys { ROUND_RECT = \"roundRect\", ROUND_RECT_DIAGONAL = \"roundRectDiagonal\", ROUND_RECT_SINGLE = \"roundRectSingle\", ROUND_RECT_SAMESIDE = \"roundRectSameSide\", CUT_RECT_DIAGONAL = \"cutRectDiagonal\", CUT_RECT_SINGLE = \"cutRectSingle\", CUT_RECT_SAMESIDE = \"cutRectSameSide\", CUT_ROUND_RECT = \"cutRoundRect\", MESSAGE = \"message\", ROUND_MESSAGE = \"roundMessage\", L = \"L\", RING_RECT = \"ringRect\", PLUS = \"plus\", TRIANGLE = \"triangle\", PARALLELOGRAM_LEFT = \"parallelogramLeft\", PARALLELOGRAM_RIGHT = \"parallelogramRight\", TRAPEZOID = \"trapezoid\", BULLET = \"bullet\", INDICATOR = \"indicator\", DONUT = \"donut\", DIAGSTRIPE = \"diagStripe\" }",
2686
2802
  "ShapeText": "export interface ShapeText { content: string; defaultFontName: string; defaultColor: string; align: TextAlignVertical; lineHeight?: number; wordSpace?: number; paragraphSpace?: number; inset?: TextInset; type?: TextType; fixedHeight?: boolean; minFontSize?: number }",
2687
- "Slide": "export interface Slide { workspaceLabels?: WorkspaceLabel[]; canvasPosition?: { x: number; y: number }; canvasName?: string; id: string; elements: PPTElement[]; guides?: SlideGuide[]; notes?: Note[]; remark?: string; background?: SlideBackground; animations?: PPTAnimation[]; turningMode?: TurningMode; sectionTag?: SectionTag; type?: SlideType; sourcePackageId?: string; skeleton?: boolean }",
2803
+ "Slide": "export interface Slide { workspaceLabels?: WorkspaceLabel[]; canvasPosition?: { x: number; y: number }; canvasName?: string; id: string; elements: PPTElement[]; guides?: SlideGuide[]; notes?: Note[]; remark?: string; background?: SlideBackground; animations?: PPTAnimation[]; turningMode?: TurningMode; sectionTag?: SectionTag; type?: SlideType; sourcePackageId?: string; skeleton?: boolean; aiRequestId?: string }",
2688
2804
  "SlideBackground": "export interface SlideBackground { type: SlideBackgroundType; color?: string; image?: SlideBackgroundImage; gradient?: Gradient }",
2689
2805
  "SlideBackgroundImage": "export interface SlideBackgroundImage { src: string; size: SlideBackgroundImageSize }",
2690
2806
  "SlideBackgroundImageSize": "export type SlideBackgroundImageSize = 'cover' | 'contain' | 'repeat'",