fika-editor 3.0.1 → 3.0.2

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 (105) hide show
  1. package/dist/embed/947.js +144 -0
  2. package/dist/embed/agentic-manifest.json +186 -11
  3. package/dist/embed/chunks/1131.css +1 -1
  4. package/dist/embed/chunks/1131.js +1 -1
  5. package/dist/embed/chunks/1505.js +8 -0
  6. package/dist/embed/chunks/1904.js +1 -1
  7. package/dist/embed/chunks/2020.js +43 -37
  8. package/dist/embed/chunks/2289.js +1 -1
  9. package/dist/embed/chunks/2796.js +1 -1
  10. package/dist/embed/chunks/2807.js +1 -1
  11. package/dist/embed/chunks/3030.js +1 -1
  12. package/dist/embed/chunks/3729.js +3 -3
  13. package/dist/embed/chunks/4552.js +1 -1
  14. package/dist/embed/chunks/4625.js +1 -1
  15. package/dist/embed/chunks/4891.js +2 -2
  16. package/dist/embed/chunks/4950.js +1 -1
  17. package/dist/embed/chunks/4975.js +5 -5
  18. package/dist/embed/chunks/5216.js +1 -1
  19. package/dist/embed/chunks/5792.js +1 -1
  20. package/dist/embed/chunks/627.js +1 -1
  21. package/dist/embed/chunks/6567.js +1 -1
  22. package/dist/embed/chunks/717.js +2 -2
  23. package/dist/embed/chunks/7175.js +1 -1
  24. package/dist/embed/chunks/7311.js +1 -1
  25. package/dist/embed/chunks/7594.js +1 -1
  26. package/dist/embed/chunks/7854.js +1 -1
  27. package/dist/embed/chunks/788.js +1 -1
  28. package/dist/embed/chunks/7916.js +1 -1
  29. package/dist/embed/chunks/8212.js +1 -1
  30. package/dist/embed/chunks/8239.js +1 -1
  31. package/dist/embed/chunks/8645.js +1 -1
  32. package/dist/embed/chunks/8716.js +3 -3
  33. package/dist/embed/chunks/9121.js +1 -1
  34. package/dist/embed/chunks/9465.js +2 -2
  35. package/dist/embed/fika-embed.css +1 -1
  36. package/dist/embed/fika-embed.js +3 -2
  37. package/dist/types/components/Button.d.ts +2 -1
  38. package/dist/types/components/ColorSwatches.d.ts +2 -1
  39. package/dist/types/components/Draggable.d.ts +9 -4
  40. package/dist/types/configs/animation.d.ts +2 -0
  41. package/dist/types/configs/font.d.ts +0 -2
  42. package/dist/types/configs/templates.d.ts +1 -5
  43. package/dist/types/embed/agentic/templates.d.ts +2 -1
  44. package/dist/types/embed/agentic/types.d.ts +57 -1
  45. package/dist/types/hooks/useScreening.d.ts +5 -3
  46. package/dist/types/i18n/i18n-types.d.ts +4 -4
  47. package/dist/types/store/index.d.ts +2 -2
  48. package/dist/types/store/slides.d.ts +18 -3
  49. package/dist/types/types/injectKey.d.ts +6 -0
  50. package/dist/types/utils/canvasHitTest.d.ts +14 -2
  51. package/dist/types/utils/commitQueue.d.ts +13 -0
  52. package/dist/types/utils/cssLength.d.ts +8 -0
  53. package/dist/types/utils/database.d.ts +6 -1
  54. package/dist/types/utils/element.d.ts +18 -0
  55. package/dist/types/utils/imageBitmapCache.d.ts +14 -2
  56. package/dist/types/utils/imageSize.d.ts +9 -0
  57. package/dist/types/utils/liveElementSize.d.ts +20 -1
  58. package/dist/types/utils/mediaIntern.d.ts +12 -0
  59. package/dist/types/utils/placeholderLayout.d.ts +25 -6
  60. package/dist/types/utils/prosemirror/commitEditor.d.ts +3 -0
  61. package/dist/types/utils/prosemirror/index.d.ts +1 -0
  62. package/dist/types/utils/screening.d.ts +10 -0
  63. package/dist/types/utils/shapePaint.d.ts +23 -0
  64. package/dist/types/utils/simpleShape.d.ts +5 -0
  65. package/dist/types/utils/slideOrder.d.ts +10 -0
  66. package/dist/types/utils/snap.d.ts +9 -0
  67. package/dist/types/utils/tableCellStyle.d.ts +12 -0
  68. package/dist/types/utils/tableStyleTarget.d.ts +3 -0
  69. package/dist/types/utils/textContrast.d.ts +25 -1
  70. package/dist/types/utils/textFit.d.ts +31 -13
  71. package/dist/types/views/Editor/Canvas/Operate/ResizeHandler.d.ts +2 -1
  72. package/dist/types/views/Editor/Thumbnails/paneSize.d.ts +7 -3
  73. package/dist/types/views/Editor/Thumbnails/useThumbnailVirtualizer.d.ts +1 -0
  74. package/dist/types/views/components/ThumbnailSlide/LiveSlideThumb.d.ts +21 -0
  75. package/dist/types/views/components/ThumbnailSlide/index.d.ts +8 -0
  76. package/dist/types/views/components/ThumbnailSlide/paintedSlide.d.ts +1 -1
  77. package/dist/types/views/components/ThumbnailSlide/thumbSnapshot.d.ts +54 -0
  78. package/dist/types/views/components/element/TableElement/CustomTextarea.d.ts +2 -1
  79. package/dist/types/views/components/element/hooks/useAutoShapeTextHeight.d.ts +3 -1
  80. package/docs/RELEASE.md +2 -0
  81. package/package.json +8 -11
  82. package/dist/embed/350.js +0 -164
  83. package/dist/types/previewRaster/index.d.ts +0 -9
  84. package/dist/types/previewRaster/painters/background.d.ts +0 -2
  85. package/dist/types/previewRaster/painters/booth.d.ts +0 -13
  86. package/dist/types/previewRaster/painters/chart.d.ts +0 -2
  87. package/dist/types/previewRaster/painters/code.d.ts +0 -2
  88. package/dist/types/previewRaster/painters/image.d.ts +0 -2
  89. package/dist/types/previewRaster/painters/index.d.ts +0 -3
  90. package/dist/types/previewRaster/painters/line.d.ts +0 -2
  91. package/dist/types/previewRaster/painters/media.d.ts +0 -2
  92. package/dist/types/previewRaster/painters/shape.d.ts +0 -2
  93. package/dist/types/previewRaster/painters/table.d.ts +0 -2
  94. package/dist/types/previewRaster/painters/text.d.ts +0 -2
  95. package/dist/types/previewRaster/planSlideRaster.d.ts +0 -19
  96. package/dist/types/previewRaster/rasterCache.d.ts +0 -19
  97. package/dist/types/previewRaster/scheduler.d.ts +0 -4
  98. package/dist/types/previewRaster/stagePool.d.ts +0 -36
  99. package/dist/types/previewRaster/stats.d.ts +0 -10
  100. package/dist/types/previewRaster/subscribeSlides.d.ts +0 -10
  101. package/dist/types/previewRaster/types.d.ts +0 -12
  102. package/dist/types/utils/elementPaint.d.ts +0 -129
  103. package/dist/types/views/components/element/ChartElement/chartBooth.d.ts +0 -2
  104. /package/dist/embed/{350.css → 947.css} +0 -0
  105. /package/dist/types/{previewRaster → utils}/diffPaintedSlide.d.ts +0 -0
@@ -13,5 +13,6 @@ export type IButtonProps = {
13
13
  'data-tooltip'?: string;
14
14
  'data-export-format'?: string;
15
15
  'data-editor-insert'?: string;
16
+ 'data-align'?: string;
16
17
  };
17
- export default function Button({ checked, disabled, type, size, first, last, onClick, children, style, className, 'data-tooltip': dataTooltip, 'data-export-format': dataExportFormat, 'data-editor-insert': dataEditorInsert, }: IButtonProps): import("react").JSX.Element;
18
+ export default function Button({ checked, disabled, type, size, first, last, onClick, children, style, className, 'data-tooltip': dataTooltip, 'data-export-format': dataExportFormat, 'data-editor-insert': dataEditorInsert, 'data-align': dataAlign, }: IButtonProps): import("react").JSX.Element;
@@ -13,9 +13,10 @@ export type IColorSwatchesProps = {
13
13
  className?: string;
14
14
  style?: CSSProperties;
15
15
  'data-tooltip'?: string;
16
+ 'data-swatches'?: string;
16
17
  onUpdateModelValue?: (value: string) => void;
17
18
  };
18
19
  export declare const HIGHLIGHT_SWATCHES: string[];
19
- declare function ColorSwatches({ modelValue, extraColors, includeTheme, includeNeutrals, allowNone, noneValue, allowCustom, wrap, customTitle, noneTitle, className, style, 'data-tooltip': dataTooltip, onUpdateModelValue, }: IColorSwatchesProps): import("react").JSX.Element;
20
+ declare function ColorSwatches({ modelValue, extraColors, includeTheme, includeNeutrals, allowNone, noneValue, allowCustom, wrap, customTitle, noneTitle, className, style, 'data-tooltip': dataTooltip, 'data-swatches': dataSwatches, onUpdateModelValue, }: IColorSwatchesProps): import("react").JSX.Element;
20
21
  declare const _default: import("react").MemoExoticComponent<typeof ColorSwatches>;
21
22
  export default _default;
@@ -1,28 +1,33 @@
1
1
  import { type MouseEventHandler, type ReactNode } from 'react';
2
2
  import type { ThumbnailVirtualizerApi } from '../views/Editor/Thumbnails/useThumbnailVirtualizer';
3
+ import { type OverlayPaint } from './draggableLayout';
3
4
  type ItemRender = (args: {
4
5
  element: any;
5
6
  index: number;
6
7
  }) => ReactNode;
8
+ type OverlayRender = (paint: OverlayPaint) => ReactNode;
7
9
  type VirtualizerApi = ThumbnailVirtualizerApi;
8
- export default function Draggable({ modelValue, list, itemKey, item, children, className, onEnd, onUpdateModelValue, onContextMenu, disabled, handle, scrollRef, virtualItems, virtualizer, totalSize, }: {
10
+ /** Drag ghost for slide rails: the live slide DOM at thumb size. */
11
+ export declare const slideDragOverlay: OverlayRender;
12
+ export default function Draggable({ modelValue, list, itemKey, item, children, className, onEnd, onUpdateModelValue, onContextMenu, disabled, handle, scrollRef, virtualItems, virtualizer, totalSize, overlayRender, }: {
9
13
  modelValue?: any[];
10
14
  list?: any[];
11
15
  itemKey?: string | ((item: any) => string);
12
16
  item?: ItemRender;
13
17
  children?: ReactNode;
14
18
  className?: string;
15
- disabled?: boolean;
16
- handle?: string;
17
- onContextMenu?: MouseEventHandler<HTMLDivElement>;
18
19
  onEnd?: (event: {
19
20
  oldIndex: number;
20
21
  newIndex: number;
21
22
  }) => void;
22
23
  onUpdateModelValue?: (next: any[]) => void;
24
+ onContextMenu?: MouseEventHandler<HTMLDivElement>;
25
+ disabled?: boolean;
26
+ handle?: string;
23
27
  scrollRef?: VirtualizerApi['scrollRef'];
24
28
  virtualItems?: VirtualizerApi['virtualItems'];
25
29
  virtualizer?: VirtualizerApi['virtualizer'];
26
30
  totalSize?: number;
31
+ overlayRender?: OverlayRender;
27
32
  }): import("react").JSX.Element;
28
33
  export {};
@@ -259,6 +259,8 @@ interface SlideAnimation {
259
259
  label: string;
260
260
  value: TurningMode;
261
261
  }
262
+ /** Default slide-to-slide transition when a slide has no turningMode (PowerPoint-style: none). */
263
+ export declare const DEFAULT_TURNING_MODE: TurningMode;
262
264
  /** Locale-free slide transition values. Resolve labels via getSlideAnimations(). */
263
265
  export declare const SLIDE_ANIMATIONS: {
264
266
  value: TurningMode;
@@ -19,8 +19,6 @@ export interface FontOption {
19
19
  label: string;
20
20
  value: string;
21
21
  }
22
- /** CJK faces that used to ship with extras builds; strip them from templates. */
23
- export declare const EASTERN_EXTRAS_FONT_VALUES: string[];
24
22
  /** @deprecated Use FONT_VALUES — kept for loadGoogleFonts preset detection */
25
23
  export declare const FONTS: FontOption[];
26
24
  export declare function getFonts(): FontOption[];
@@ -8,12 +8,8 @@ export interface TemplatePayload {
8
8
  theme?: Partial<SlideTheme>;
9
9
  }
10
10
  export type TemplatePayloadLoader = () => Promise<TemplatePayload | Slide[]>;
11
- export interface TemplateNormalizationConfig {
12
- stripFontFamilies: string[];
13
- }
14
11
  export declare const setCustomTemplateLoaders: (loaders?: Record<string, TemplatePayloadLoader>) => void;
15
12
  export declare const listCustomTemplateIds: () => string[];
16
13
  export declare const isKnownTemplateId: (id: string) => any;
17
14
  export declare const loadConfiguredTemplate: (id: string) => Promise<Slide[] | TemplatePayload>;
18
- export declare const TEMPLATE_NORMALIZATION_CONFIG: TemplateNormalizationConfig;
19
- export declare const normalizeTemplatePayload: (payload: TemplatePayload | Slide[], LL: TranslationFunctions, config?: TemplateNormalizationConfig) => TemplatePayload;
15
+ export declare const normalizeTemplatePayload: (payload: TemplatePayload | Slide[], LL: TranslationFunctions) => TemplatePayload;
@@ -1,4 +1,4 @@
1
- import { type TemplatePayload } from '../../configs/templates';
1
+ import { type TemplatePayload, type TemplatePayloadLoader } from '../../configs/templates';
2
2
  import type { Slide, SlideTheme, SlideType } from '../../types/slides';
3
3
  export interface FikaTemplateSummary {
4
4
  id: string;
@@ -20,6 +20,7 @@ export interface FikaTemplateSlidesCatalogResult {
20
20
  slideCount: number;
21
21
  byType: FikaTemplateSlidesCatalog;
22
22
  }
23
+ export declare function registerTemplateLoaders(loaders?: Record<string, TemplatePayloadLoader>): void;
23
24
  export declare function listTemplateCatalog(): FikaTemplateSummary[];
24
25
  export declare function loadTemplatePayload(templateId: string): Promise<TemplatePayload>;
25
26
  export declare function buildTemplateSlidesCatalog(templateId: string): Promise<FikaTemplateSlidesCatalogResult>;
@@ -743,7 +743,7 @@ export interface FikaAgentTextApi {
743
743
  }): Promise<FikaCommandResult<PPTTextElement>>;
744
744
  }
745
745
  export interface FikaAgentShapesApi {
746
- presets(categoryKey?: ShapeCategoryKey): FikaShapePreset[];
746
+ presets(categoryKey?: ShapeCategoryKey | 'rect'): FikaShapePreset[];
747
747
  get(elementId: string, slideId?: string): PPTShapeElement | null;
748
748
  create(input?: FikaCreateShapeInput, meta?: FikaCommandMeta): Promise<FikaCommandResult<PPTShapeElement>>;
749
749
  patch(elementId: string, patch: FikaShapePatch, meta?: FikaCommandMeta & {
@@ -855,6 +855,7 @@ export interface FikaAgentChartsApi {
855
855
  }): Promise<FikaCommandResult<PPTChartElement>>;
856
856
  addSeries(elementId: string, series: number[], meta?: FikaCommandMeta & {
857
857
  slideId?: string;
858
+ legend?: string;
858
859
  }): Promise<FikaCommandResult<PPTChartElement>>;
859
860
  deleteSeries(elementId: string, index: number, meta?: FikaCommandMeta & {
860
861
  slideId?: string;
@@ -1255,6 +1256,7 @@ export interface FikaCommandPayloadMap {
1255
1256
  'slides.applyBackground': {
1256
1257
  background: SlideBackground;
1257
1258
  slideIds?: string[];
1259
+ slideId?: string | string[];
1258
1260
  };
1259
1261
  'slides.applyBackgroundToAll': {
1260
1262
  background: SlideBackground;
@@ -1364,10 +1366,12 @@ export interface FikaCommandPayloadMap {
1364
1366
  };
1365
1367
  'elements.lock': {
1366
1368
  elementId: string | string[];
1369
+ slideId?: string;
1367
1370
  locked?: boolean;
1368
1371
  };
1369
1372
  'elements.unlock': {
1370
1373
  elementId: string | string[];
1374
+ slideId?: string;
1371
1375
  };
1372
1376
  'elements.hide': {
1373
1377
  elementId: string | string[];
@@ -1451,6 +1455,48 @@ export interface FikaCommandPayloadMap {
1451
1455
  slideId?: string;
1452
1456
  direction?: FikaLineDirectionInput;
1453
1457
  };
1458
+ 'shapes.presets': {
1459
+ categoryKey?: ShapeCategoryKey | 'rect';
1460
+ } | undefined;
1461
+ 'shapes.create': FikaCreateShapeInput | undefined;
1462
+ 'shapes.patch': {
1463
+ elementId: string;
1464
+ slideId?: string;
1465
+ patch: FikaShapePatch;
1466
+ };
1467
+ 'shapes.update': {
1468
+ elementId: string;
1469
+ slideId?: string;
1470
+ patch: FikaShapePatch;
1471
+ };
1472
+ 'shapes.setPath': {
1473
+ elementId: string;
1474
+ slideId?: string;
1475
+ path: string;
1476
+ viewBox?: PPTShapeElement['viewBox'];
1477
+ fixedRatio?: boolean;
1478
+ };
1479
+ 'shapes.setFormula': {
1480
+ elementId: string;
1481
+ slideId?: string;
1482
+ pathFormula: PPTShapeElement['pathFormula'];
1483
+ keypoints?: number[];
1484
+ };
1485
+ 'shapes.setFill': {
1486
+ elementId: string;
1487
+ slideId?: string;
1488
+ fill: FikaShapeFillInput;
1489
+ };
1490
+ 'shapes.setOutline': {
1491
+ elementId: string;
1492
+ slideId?: string;
1493
+ outline?: FikaShapePatch['outline'];
1494
+ };
1495
+ 'shapes.setText': {
1496
+ elementId: string;
1497
+ slideId?: string;
1498
+ text?: Partial<ShapeText>;
1499
+ };
1454
1500
  'animations.list': {
1455
1501
  slideId?: string;
1456
1502
  elementId?: string;
@@ -1580,6 +1626,7 @@ export interface FikaCommandPayloadMap {
1580
1626
  elementId: string;
1581
1627
  slideId?: string;
1582
1628
  series: number[];
1629
+ legend?: string;
1583
1630
  };
1584
1631
  'charts.deleteSeries': {
1585
1632
  elementId: string;
@@ -1912,6 +1959,15 @@ export interface FikaCommandResultDataMap {
1912
1959
  'lines.setStyle': PPTLineElement;
1913
1960
  'lines.setArrowheads': PPTLineElement;
1914
1961
  'lines.setDirection': PPTLineElement;
1962
+ 'shapes.presets': FikaShapePreset[];
1963
+ 'shapes.create': PPTShapeElement;
1964
+ 'shapes.patch': PPTShapeElement;
1965
+ 'shapes.update': PPTShapeElement;
1966
+ 'shapes.setPath': PPTShapeElement;
1967
+ 'shapes.setFormula': PPTShapeElement;
1968
+ 'shapes.setFill': PPTShapeElement;
1969
+ 'shapes.setOutline': PPTShapeElement;
1970
+ 'shapes.setText': PPTShapeElement;
1915
1971
  'animations.list': PPTAnimation[];
1916
1972
  'animations.catalog': FikaAnimationCatalog;
1917
1973
  'animations.sequence': FikaAnimationSequenceStep[];
@@ -1,8 +1,10 @@
1
+ import { enterScreening, enterScreeningFromStart, exitScreening } from '../utils/screening';
1
2
  import { prefetchScreen } from '../views/Screen/lazy';
3
+ export { beginScreening, enterScreening, enterScreeningFromStart, exitScreening } from '../utils/screening';
2
4
  export default _default;
3
5
  declare function _default(): {
4
- enterScreening: () => void;
5
- enterScreeningFromStart: () => void;
6
- exitScreening: () => void;
6
+ enterScreening: typeof enterScreening;
7
+ enterScreeningFromStart: typeof enterScreeningFromStart;
8
+ exitScreening: typeof exitScreening;
7
9
  prefetchScreen: typeof prefetchScreen;
8
10
  };
@@ -3036,11 +3036,11 @@ export type NamespaceEditorTranslation = {
3036
3036
  };
3037
3037
  slideAnimation: {
3038
3038
  /**
3039
- * A​p​p​l​y​ ​t​o​ ​a​l​l​ ​s​l​i​d​e​s
3039
+ * U​s​e​ ​o​n​ ​e​v​e​r​y​ ​s​l​i​d​e
3040
3040
  */
3041
3041
  applyToAll: string;
3042
3042
  /**
3043
- * A​p​p​l​i​e​d​ ​t​o​ ​a​l​l​ ​s​l​i​d​e​s
3043
+ * O​n​ ​e​v​e​r​y​ ​s​l​i​d​e
3044
3044
  */
3045
3045
  appliedToAll: string;
3046
3046
  };
@@ -8185,11 +8185,11 @@ export type TranslationFunctions = {
8185
8185
  };
8186
8186
  slideAnimation: {
8187
8187
  /**
8188
- * Apply to all slides
8188
+ * Use on every slide
8189
8189
  */
8190
8190
  applyToAll: () => LocalizedString;
8191
8191
  /**
8192
- * Applied to all slides
8192
+ * On every slide
8193
8193
  */
8194
8194
  appliedToAll: () => LocalizedString;
8195
8195
  };
@@ -1,5 +1,5 @@
1
1
  import { useMainStore, selectHandleElement, selectActiveElementList } from './main';
2
- import { useSlidesStore, selectCurrentSlide, selectCurrentSlideAnimations, selectFormatedAnimations, selectSlideId, selectElementById, selectIsEmptySlide } from './slides';
2
+ import { useSlidesStore, selectCurrentSlide, selectSlideById, selectCurrentSlideAnimations, selectFormatedAnimations, selectSlideId, selectElementById, selectIsEmptySlide } from './slides';
3
3
  import { useSnapshotStore, selectCanUndo, selectCanRedo } from './snapshot';
4
4
  import { useKeyboardStore, selectCtrlOrShiftKeyActive, syncPointerModifiers } from './keyboard';
5
5
  import { useScreenStore } from './screen';
@@ -7,4 +7,4 @@ import { useImportConfirmStore } from './importConfirm';
7
7
  export declare const useActiveElementList: () => import("../embed").PPTElement[];
8
8
  export declare const useCurrentSlideAnimations: () => import("../embed").PPTAnimation[];
9
9
  export declare const useFormatedAnimations: () => import("./slides").FormatedAnimation[];
10
- export { useMainStore, selectHandleElement, selectActiveElementList, useSlidesStore, selectCurrentSlide, selectIsEmptySlide, selectCurrentSlideAnimations, selectFormatedAnimations, selectSlideId, selectElementById, useSnapshotStore, selectCanUndo, selectCanRedo, useKeyboardStore, selectCtrlOrShiftKeyActive, syncPointerModifiers, useScreenStore, useImportConfirmStore, };
10
+ export { useMainStore, selectHandleElement, selectActiveElementList, useSlidesStore, selectCurrentSlide, selectSlideById, selectIsEmptySlide, selectCurrentSlideAnimations, selectFormatedAnimations, selectSlideId, selectElementById, useSnapshotStore, selectCanUndo, selectCanRedo, useKeyboardStore, selectCtrlOrShiftKeyActive, syncPointerModifiers, useScreenStore, useImportConfirmStore, };
@@ -1,4 +1,9 @@
1
1
  import type { Slide, SlideTheme, PPTElement, PPTAnimation, SlideTemplate, ImportedSlideTemplate } from '../types/slides';
2
+ export type AddSlideOptions = {
3
+ index?: number;
4
+ select?: boolean;
5
+ keepSectionTag?: boolean;
6
+ };
2
7
  export declare function buildDefaultTemplates(): SlideTemplate[];
3
8
  interface RemovePropData {
4
9
  id: string;
@@ -34,10 +39,11 @@ export interface SlidesActions {
34
39
  setTemplates: (templates: SlideTemplate[]) => void;
35
40
  addImportedTemplate: (template: ImportedSlideTemplate) => void;
36
41
  replaceSlide: (slide: Slide, slideId?: string) => void;
37
- addSlide: (slide: Slide | Slide[]) => void;
42
+ addSlide: (slide: Slide | Slide[], options?: AddSlideOptions) => void;
38
43
  updateSlide: (props: Partial<Slide>, slideId?: string) => void;
39
44
  removeSlideProps: (data: RemovePropData) => void;
40
45
  deleteSlide: (slideId: string | string[]) => void;
46
+ moveSlide: (fromIndex: number, toIndex: number) => void;
41
47
  reorderSlides: (oldIndex: number, newIndex: number) => void;
42
48
  updateSlideIndex: (index: number) => void;
43
49
  addElement: (element: PPTElement | PPTElement[]) => void;
@@ -47,6 +53,13 @@ export interface SlidesActions {
47
53
  }
48
54
  export type SlidesStore = SlidesState & SlidesActions;
49
55
  export declare const selectCurrentSlide: (state: SlidesState) => Slide;
56
+ /**
57
+ * Slide by id — the owning slide for a rendered slide tree. Contrast and
58
+ * placeholder painting must resolve against THIS slide, not the editor's
59
+ * current one, or off-screen renders (thumbnail captures, presenter preview)
60
+ * inherit the wrong background/elements.
61
+ */
62
+ export declare const selectSlideById: (state: SlidesState, slideId: string | undefined) => Slide;
50
63
  export declare const selectIsEmptySlide: (state: SlidesState) => boolean;
51
64
  export declare const selectSlideId: (state: SlidesState) => string;
52
65
  export declare const selectElementById: (id: string) => (state: SlidesState) => PPTElement | undefined;
@@ -1658,10 +1671,11 @@ export declare const useSlidesStore: import("zustand").UseBoundStore<Omit<import
1658
1671
  setTemplates: (templates: SlideTemplate[]) => void;
1659
1672
  addImportedTemplate: (template: ImportedSlideTemplate) => void;
1660
1673
  replaceSlide: (slide: Slide, slideId?: string) => void;
1661
- addSlide: (slide: Slide | Slide[]) => void;
1674
+ addSlide: (slide: Slide | Slide[], options?: AddSlideOptions) => void;
1662
1675
  updateSlide: (props: Partial<Slide>, slideId?: string) => void;
1663
1676
  removeSlideProps: (data: RemovePropData) => void;
1664
1677
  deleteSlide: (slideId: string | string[]) => void;
1678
+ moveSlide: (fromIndex: number, toIndex: number) => void;
1665
1679
  reorderSlides: (oldIndex: number, newIndex: number) => void;
1666
1680
  updateSlideIndex: (index: number) => void;
1667
1681
  addElement: (element: PPTElement | PPTElement[]) => void;
@@ -3274,10 +3288,11 @@ export declare const useSlidesStore: import("zustand").UseBoundStore<Omit<import
3274
3288
  setTemplates: (templates: SlideTemplate[]) => void;
3275
3289
  addImportedTemplate: (template: ImportedSlideTemplate) => void;
3276
3290
  replaceSlide: (slide: Slide, slideId?: string) => void;
3277
- addSlide: (slide: Slide | Slide[]) => void;
3291
+ addSlide: (slide: Slide | Slide[], options?: AddSlideOptions) => void;
3278
3292
  updateSlide: (props: Partial<Slide>, slideId?: string) => void;
3279
3293
  removeSlideProps: (data: RemovePropData) => void;
3280
3294
  deleteSlide: (slideId: string | string[]) => void;
3295
+ moveSlide: (fromIndex: number, toIndex: number) => void;
3281
3296
  reorderSlides: (oldIndex: number, newIndex: number) => void;
3282
3297
  updateSlideIndex: (index: number) => void;
3283
3298
  addElement: (element: PPTElement | PPTElement[]) => void;
@@ -6,6 +6,12 @@ export type RadioGroupValue = {
6
6
  };
7
7
  export declare const SlideScaleContext: import("react").Context<number>;
8
8
  export declare const SlideIdContext: import("react").Context<string>;
9
+ /**
10
+ * True while the slide tree is rendered only to be rasterized (thumbnail
11
+ * stage). Elements that gate on "is the current slide" (media players) still
12
+ * render — paused — so captures match the editor canvas.
13
+ */
14
+ export declare const SlideCaptureContext: import("react").Context<boolean>;
9
15
  export declare const RadioGroupValueContext: import("react").Context<RadioGroupValue>;
10
16
  export declare const injectKeySlideScale: import("react").Context<number>;
11
17
  export declare const injectKeySlideId: import("react").Context<string>;
@@ -73,7 +73,16 @@ export interface VisualHitRect {
73
73
  height: number;
74
74
  rotate: number;
75
75
  zIndex: number;
76
+ /**
77
+ * Empty placeholder slot (dashed prompt, no authored content). It is a
78
+ * background affordance: any element carrying visible content that
79
+ * overlaps it wins the pointer regardless of z-order — users click the
80
+ * text they SEE, not the dashed frame behind it.
81
+ */
82
+ yieldToContent?: boolean;
76
83
  }
84
+ /** True when the element paints authored content the user can click "on". */
85
+ export declare function elementHasClickableContent(element: PPTElement): boolean;
77
86
  /**
78
87
  * Map a slide element to a hit rectangle in `.viewport-wrapper` visual pixels.
79
88
  *
@@ -121,16 +130,19 @@ export type VisualHitPlanInput = {
121
130
  export type VisualHitPlan = {
122
131
  hitRects: VisualHitRect[];
123
132
  occluderRects: VisualHitRect[];
133
+ /** Rects of elements painting authored content — they beat empty placeholder slots. */
134
+ contentRects: VisualHitRect[];
124
135
  };
125
136
  /**
126
137
  * Selected / editing / clipping boxes leave HitLayer so Operate or the live
127
138
  * editor can own the pointer. Those boxes must still punch holes in every
128
139
  * *lower* hit rect — otherwise the first click works, then hover/click/drag
129
- * fall through to the card underneath.
140
+ * fall through to the card underneath. Empty placeholder slots additionally
141
+ * yield to ANY overlapping content rect regardless of z-order.
130
142
  */
131
143
  export declare function collectVisualHitPlan(input: VisualHitPlanInput): VisualHitPlan;
132
144
  export declare function pointInAnyVisualHitRect(x: number, y: number, rects: VisualHitRect[]): boolean;
133
- /** Occluders that sit on top of `rect` (same stack level included). */
145
+ /** Occluders that sit on top of `rect` (same stack level included). Empty placeholder slots yield to every occluder. */
134
146
  export declare function occludersAboveRect(rect: VisualHitRect, occluders: VisualHitRect[]): VisualHitRect[];
135
147
  /**
136
148
  * Skip rebuilding hit rects when only HTML content changed,
@@ -0,0 +1,13 @@
1
+ type Flusher = () => void;
2
+ /** Pending editor/table drafts. Returns an unregister function. */
3
+ export declare function registerCommitFlusher(flush: Flusher): () => void;
4
+ /** Runs after drafts are persisted — canvas list sync, etc. */
5
+ export declare function registerAfterCommitDrain(flush: Flusher): () => void;
6
+ /** Persist in-flight drafts without leaving the editor. */
7
+ export declare function flushCommitQueue(): void;
8
+ /**
9
+ * Persist every in-flight draft, then sync dependents off the store.
10
+ * Presentation (and any other Activity hide) must call this before unmounting editors.
11
+ */
12
+ export declare function drainCommitQueue(): void;
13
+ export {};
@@ -0,0 +1,8 @@
1
+ /** Compact a CSS length so pixel-units can split it (`13.5 pt` → `13.5pt`). */
2
+ export declare const compactCssLength: (raw: string) => string;
3
+ /** Convert a CSS length to px. Unknown / keyword / % values return undefined. */
4
+ export declare const cssLengthToPx: (raw: string | null | undefined, basePx: number) => number | undefined;
5
+ export declare const cssLengthParts: (raw: string | null | undefined, basePx: number) => {
6
+ px?: number;
7
+ em?: number;
8
+ };
@@ -1,6 +1,6 @@
1
1
  import Dexie, { type EntityTable } from 'dexie';
2
2
  import type { Patch } from 'immer';
3
- import type { Slide } from '../types/slides';
3
+ import type { Slide, SlideTemplate, SlideTheme } from '../types/slides';
4
4
  export interface writingBoardImg {
5
5
  id: string;
6
6
  dataURL: string;
@@ -8,6 +8,11 @@ export interface writingBoardImg {
8
8
  export interface Snapshot {
9
9
  id: number;
10
10
  index: number;
11
+ title?: string;
12
+ theme?: SlideTheme;
13
+ viewportSize?: number;
14
+ viewportRatio?: number;
15
+ templates?: SlideTemplate[];
11
16
  slides?: Slide[];
12
17
  patches?: Patch[];
13
18
  inversePatches?: Patch[];
@@ -29,6 +29,11 @@ export declare const getRectRotatedOffset: (element: RotatedElementData) => {
29
29
  offsetX: number;
30
30
  offsetY: number;
31
31
  };
32
+ /**
33
+ * Local control points that define a line's painted path.
34
+ * Includes elbows so a bent/curved stroke is never clipped to the start–end chord.
35
+ */
36
+ export declare const getLineLocalPoints: (element: PPTLineElement) => [number, number][];
32
37
  /**
33
38
  * Axis-aligned bounds of a single element on the canvas.
34
39
  * @param element Element data
@@ -39,6 +44,19 @@ export declare const getElementRange: (element: PPTElement) => {
39
44
  minY: any;
40
45
  maxY: any;
41
46
  };
47
+ export type ElementRangeAlign = {
48
+ minX?: number;
49
+ maxX?: number;
50
+ centerX?: number;
51
+ minY?: number;
52
+ maxY?: number;
53
+ centerY?: number;
54
+ };
55
+ /**
56
+ * Shift left/top so the element's painted AABB matches the given edges or centers.
57
+ * Lines use control-point bounds, not the start–end chord.
58
+ */
59
+ export declare const alignElementToRange: (element: PPTElement, target: ElementRangeAlign) => void;
42
60
  /**
43
61
  * Combined axis-aligned bounds of multiple elements on the canvas.
44
62
  * @param elementList Elements to measure
@@ -1,6 +1,18 @@
1
1
  import type { Slide } from '../types/slides';
2
- export declare const getCachedImageBitmap: (src: string) => ImageBitmap | undefined;
3
- export declare const loadImageBitmap: (src: string) => Promise<ImageBitmap | null>;
2
+ export declare const PREVIEW_BITMAP_MAX_EDGE = 512;
3
+ export declare const PREVIEW_BITMAP_CACHE_MAX = 640;
4
+ export declare const FULL_BITMAP_CACHE_MAX = 64;
5
+ export type LoadImageBitmapOptions = {
6
+ maxEdge?: number;
7
+ };
8
+ export declare const subscribePreviewBitmaps: (fn: (src: string) => void) => () => void;
9
+ export declare const getCachedImageBitmap: (src: string, options?: LoadImageBitmapOptions) => ImageBitmap | undefined;
10
+ export declare const previewPaintHasMedia: (painted: Set<string> | undefined, srcs: readonly string[]) => boolean;
11
+ export declare const loadImageBitmap: (src: string, options?: LoadImageBitmapOptions) => Promise<ImageBitmap | null>;
12
+ export declare const loadPreviewImageBitmap: (src: string) => Promise<ImageBitmap>;
13
+ export declare const getCachedPreviewImageBitmap: (src: string) => ImageBitmap;
14
+ export declare const collectSlidePreviewSrcs: (slide: Slide) => string[];
4
15
  export declare const collectSlideImageSrcs: (slides: readonly Slide[]) => string[];
16
+ export declare const prefetchPreviewImageBitmaps: (srcs: readonly string[]) => void;
5
17
  export declare const revokeImageBitmapsNotIn: (keep: Iterable<string>) => void;
6
18
  export declare const syncImageBitmapsToSlides: (slides: readonly Slide[]) => void;
@@ -0,0 +1,9 @@
1
+ export type ImageSize = {
2
+ width: number;
3
+ height: number;
4
+ };
5
+ export declare const readImageSize: (buffer: ArrayBuffer | Uint8Array) => ImageSize | null;
6
+ export declare const resizeToMaxEdge: (width: number, height: number, maxEdge: number) => {
7
+ width: number;
8
+ height: number;
9
+ };
@@ -29,5 +29,24 @@ export type LivePaintExtras = {
29
29
  path?: string;
30
30
  viewBox?: readonly number[];
31
31
  };
32
- export declare const applyLiveSize: (id: string, left: number, top: number, width: number, height: number, canvasScale: number, extras?: LivePaintExtras) => void;
32
+ /** True when the element's height is text-driven (auto-height box). */
33
+ export declare const autoHeightInsetSum: (el: {
34
+ type?: string;
35
+ fixedHeight?: boolean;
36
+ vertical?: boolean;
37
+ inset?: readonly number[];
38
+ text?: {
39
+ fixedHeight?: boolean;
40
+ inset?: readonly number[];
41
+ } | null;
42
+ }) => number | null;
43
+ /**
44
+ * Height the auto-height element's text actually needs at its CURRENT live
45
+ * width (call after the width has been painted). scrollHeight reports the
46
+ * true content height even when the container still carries a stale height.
47
+ */
48
+ export declare const measureAutoTextHeight: (id: string, insetSum: number) => number | null;
49
+ export declare const applyLiveSize: (id: string, left: number, top: number, width: number, height: number, canvasScale: number, extras?: LivePaintExtras, options?: {
50
+ forceHeight?: boolean;
51
+ }) => void;
33
52
  export {};
@@ -0,0 +1,12 @@
1
+ import type { Slide } from '../types/slides';
2
+ export declare const isDataUrl: (src: string) => boolean;
3
+ export declare const onMediaInterned: (fn: (from: string, to: string) => void) => () => void;
4
+ /** Data URL and its blob: alias are the same bytes. */
5
+ export declare const bitmapSrcKeys: (src: string) => string[];
6
+ export declare const getInternedBlob: (src: string) => Blob | undefined;
7
+ export declare const startInternSlideMedia: (slide: Slide) => void;
8
+ export declare const internMediaSrc: (src: string) => Promise<string>;
9
+ export declare const visitSlideMediaSrcs: (slide: Slide, visit: (src: string) => void) => void;
10
+ export declare const collectSlideMediaSrcs: (slides: readonly Slide[]) => string[];
11
+ export declare const internSlidesMedia: (slides: Slide[]) => Promise<void>;
12
+ export declare const resetMediaInternForTests: () => void;
@@ -30,11 +30,18 @@ export interface TextBoxLayout {
30
30
  vAlign: TextAlignVertical;
31
31
  /** Flex-column vertical centering without locking box height (content slides title). */
32
32
  flexCenterInLayoutBox: boolean;
33
+ /** Empty placeholder slot (dashed prompt). */
34
+ emptyPlaceholder: boolean;
33
35
  /**
34
- * Definite `height` (not `auto`). True for explicit fixed-height and for an
35
- * *empty* placeholder slot (dashed box + centered prompt). A filled
36
- * auto-height title/subtitle unlocks so the box can grow with the text.
36
+ * Auto-height paint floored at the committed height (empty placeholder
37
+ * slots, filled content-slide titles): `height: auto` + `min-height`. The
38
+ * box grows with the text the same frame the text grows — no clip, and the
39
+ * painted box never lags behind its glyphs.
37
40
  */
41
+ slotFlooredAuto: boolean;
42
+ /** Flex-column paint: fixed boxes, empty slots, centered layout titles. */
43
+ flexColumn: boolean;
44
+ /** Definite px `height` paint: explicit fixed-height boxes only. */
38
45
  lockPaintHeight: boolean;
39
46
  }
40
47
  export declare const V_ALIGN_JUSTIFY: {
@@ -54,11 +61,23 @@ export declare const authoredTextFitSize: (el: Pick<PPTTextElement, 'placeholder
54
61
  export declare const textBoxPaintSize: (el: PPTTextElement, layout: TextBoxLayout) => {
55
62
  width: string;
56
63
  height: string;
64
+ minHeight: string;
57
65
  };
58
66
  export declare const textBoxFlexColumn: (layout: TextBoxLayout) => boolean;
59
67
  export declare const textBoxJustify: (layout: TextBoxLayout) => "center" | "flex-end" | "flex-start";
60
68
  /**
61
- * Empty slots keep the dashed frame. Filled auto-height follows the text —
62
- * including shrinking off the empty-slot floor so Enter can grow the box.
69
+ * The ONE rule for auto-height commits: the box tracks its text but never
70
+ * shrinks below its slot floor. Empty slots keep the dashed frame, filled
71
+ * content-slide titles keep their centered layout slot, every other filled
72
+ * box hugs the text. The floor never exceeds the current height, so an
73
+ * already-short slot is never surprise-grown. Returns null when the store
74
+ * height must not change.
63
75
  */
64
- export declare const shouldBlockPlaceholderHeightShrink: (el: PPTTextElement, measuredHeight: number, contentEmpty: boolean) => boolean;
76
+ export declare const textBoxAutoHeight: (el: PPTTextElement, layout: TextBoxLayout, measuredTextHeight: number) => number | null;
77
+ /** Slot floor for drag-time height measurements (store content, no live editor state). */
78
+ export declare const placeholderHeightFloor: (el: PPTTextElement, slideType?: Slide['type']) => number;
79
+ /**
80
+ * Fixed mode restores a placeholder to its slot: its "fixed size" is the
81
+ * designed slot, not whatever the text last hugged.
82
+ */
83
+ export declare const placeholderFixedRestoreHeight: (el: PPTTextElement) => number;
@@ -1,6 +1,9 @@
1
1
  import { editorHtmlLooksEmpty } from './commitPolicy';
2
2
  export { editorHtmlLooksEmpty, shouldWriteEditorHtml } from './commitPolicy';
3
3
  export declare const richTextHtmlLooksEmpty: typeof editorHtmlLooksEmpty;
4
+ export declare const storeHtmlForElement: (elementId: string) => string;
5
+ /** Activity remounts must not rebuild an empty view over store-owned text. */
6
+ export declare const resolveEditorMountHtml: (elementId: string, value: string) => string;
4
7
  /** Persist the live ProseMirror HTML. History is for explicit flushes, not every key. */
5
8
  export declare function commitLiveEditorToStore(elementId: string, options?: {
6
9
  history?: boolean;
@@ -1,5 +1,6 @@
1
1
  import { type DirectEditorProps, EditorView } from 'prosemirror-view';
2
2
  import { type PluginOptions } from './plugins/index';
3
+ export declare const normalizeFittedFontSizes: (html: string) => string;
3
4
  export declare const createDocument: (content: string) => import("prosemirror-model").Node;
4
5
  /** Same HTML the live editor paints, so static → edit cannot shift glyphs. */
5
6
  export declare const serializeRichTextHtml: (content: string) => string;
@@ -0,0 +1,10 @@
1
+ /** Drain live editors, then enter presentation. No fullscreen — embed/agentic. */
2
+ export declare function beginScreening(options?: {
3
+ fromStart?: boolean;
4
+ }): void;
5
+ /** Editor Present / F5: drain, screen, then request fullscreen. */
6
+ export declare function enterScreening(options?: {
7
+ fromStart?: boolean;
8
+ }): void;
9
+ export declare function enterScreeningFromStart(): void;
10
+ export declare function exitScreening(): void;