fika-editor 3.0.40 → 3.0.41
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.
- package/dist/embed/agentic-manifest.json +2 -2
- package/dist/embed/fika-embed.css +1 -1
- package/dist/embed/fika-embed.js +3 -3
- package/dist/types/embed/reveal.d.ts +32 -0
- package/dist/types/embed/types.d.ts +19 -0
- package/dist/types/store/main.d.ts +18 -0
- package/dist/types/utils/revealHtml.d.ts +12 -0
- package/dist/types/views/Editor/Canvas/AiRevealBadge.d.ts +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "AI is writing" reveal of a freshly generated slide.
|
|
3
|
+
*
|
|
4
|
+
* Non-text elements (pictures, shapes, lines, charts, formulas…) pop in one
|
|
5
|
+
* after another with a tiny stagger; text boxes are then typed out and tables
|
|
6
|
+
* are filled cell by cell, in element order. The store is written directly on
|
|
7
|
+
* every frame (no history snapshots, host `onChange` muted) and the final
|
|
8
|
+
* content lands through the regular `slides.update` command once, so undo and
|
|
9
|
+
* autosave only ever see the finished slide.
|
|
10
|
+
*/
|
|
11
|
+
import type { Slide } from '../types/slides';
|
|
12
|
+
export interface FikaRevealOptions {
|
|
13
|
+
/** Badge text shown next to the caret (host-localized). Omit for no badge. */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** Aborting jumps straight to the finished slide. */
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
/** Typing speed in characters per second. Default 80. */
|
|
18
|
+
charsPerSecond?: number;
|
|
19
|
+
/** Upper bound for the whole reveal in ms. Default 9000. */
|
|
20
|
+
maxDurationMs?: number;
|
|
21
|
+
/** `false` skips the animation and applies the slide at once. */
|
|
22
|
+
animate?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface RevealDeps {
|
|
25
|
+
/** Suppress host change notifications while frames are written. */
|
|
26
|
+
mute(): void;
|
|
27
|
+
unmute(): void;
|
|
28
|
+
/** Apply the finished slide through the command pipeline (history + change event). */
|
|
29
|
+
commit(slideId: string, patch: Partial<Slide>): Promise<void>;
|
|
30
|
+
isDestroyed(): boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare function revealSlide(slideId: string, patch: Partial<Slide>, options: FikaRevealOptions, deps: RevealDeps): Promise<void>;
|
|
@@ -4,7 +4,9 @@ import type { FikaMediaConfig } from '../configs/mediaUpload';
|
|
|
4
4
|
import type { Locales } from '../i18n/locale';
|
|
5
5
|
import type { Slide, SlideTheme, SlideTemplate } from '../types/slides';
|
|
6
6
|
import type { FikaAgentApi, FikaDeckViewport, FikaSlideReference } from './agentic/types';
|
|
7
|
+
import type { FikaRevealOptions } from './reveal';
|
|
7
8
|
export type { FikaExportMediaResolver };
|
|
9
|
+
export type { FikaRevealOptions };
|
|
8
10
|
export type { FikaMediaConfig, FikaMediaConstraints, FikaMediaKind, FikaMediaSizeLimit, FikaMediaUploadProgress, FikaMediaUploadRequest, FikaMediaUploadResult, FikaMediaUploader, FikaXhrMediaUploaderOptions } from '../configs/mediaUpload';
|
|
9
11
|
export interface FikaTemplatePayload {
|
|
10
12
|
title?: string;
|
|
@@ -126,6 +128,12 @@ export interface FikaMountOptions {
|
|
|
126
128
|
* Exiting the slideshow re-enters it, so the page stays a pure viewer.
|
|
127
129
|
*/
|
|
128
130
|
viewMode?: FikaViewMode;
|
|
131
|
+
/**
|
|
132
|
+
* Start in view-only mode: the user can browse slides but not select, edit,
|
|
133
|
+
* insert, reorder or delete anything. Host and agent commands still apply.
|
|
134
|
+
* Toggle later with `controller.setReadOnly`.
|
|
135
|
+
*/
|
|
136
|
+
readOnly?: boolean;
|
|
129
137
|
}
|
|
130
138
|
export type FikaImportApplyMode = import('../utils/importApply').ImportApplyMode;
|
|
131
139
|
export interface FikaImportPptxOptions {
|
|
@@ -193,6 +201,17 @@ export interface FikaController extends FikaAgentApi {
|
|
|
193
201
|
nextSlide(): void;
|
|
194
202
|
previousSlide(): void;
|
|
195
203
|
setZoom(scale: number): void;
|
|
204
|
+
/** Toggle view-only mode (see `FikaMountOptions.readOnly`). */
|
|
205
|
+
setReadOnly(readOnly: boolean): void;
|
|
206
|
+
isReadOnly(): boolean;
|
|
207
|
+
/**
|
|
208
|
+
* Apply `patch` to an existing slide with an "AI is writing" reveal: pictures,
|
|
209
|
+
* shapes and other non-text elements pop in with a small stagger, text boxes
|
|
210
|
+
* are typed out and tables filled cell by cell, with an optional badge next
|
|
211
|
+
* to the caret. Resolves once the finished slide has been committed (one
|
|
212
|
+
* history step, one `onChange`). Aborting the signal finishes at once.
|
|
213
|
+
*/
|
|
214
|
+
revealSlide(slideId: string, patch: Partial<Slide>, options?: FikaRevealOptions): Promise<void>;
|
|
196
215
|
enterPresentation(): void;
|
|
197
216
|
exitPresentation(): void;
|
|
198
217
|
destroy(): void;
|
|
@@ -38,6 +38,22 @@ export interface MainState {
|
|
|
38
38
|
rightPanelCollapsed: boolean;
|
|
39
39
|
rightPanelPinned: 'open' | 'closed' | null;
|
|
40
40
|
openPanelOnTextSelection: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Host-driven view-only mode: the user can browse slides but not select,
|
|
43
|
+
* edit, insert, reorder or delete anything. Host/agent commands still apply.
|
|
44
|
+
*/
|
|
45
|
+
readOnly: boolean;
|
|
46
|
+
/** Live "AI is writing" reveal driven by `controller.revealSlide`; null when idle. */
|
|
47
|
+
aiReveal: AiRevealState | null;
|
|
48
|
+
}
|
|
49
|
+
export interface AiRevealState {
|
|
50
|
+
slideId: string;
|
|
51
|
+
/** Element currently being written; null while non-text elements pop in. */
|
|
52
|
+
elementId: string | null;
|
|
53
|
+
/** Host-localized badge text. Empty string hides the badge. */
|
|
54
|
+
label: string;
|
|
55
|
+
/** Bumped on every reveal frame so the badge re-measures the caret. */
|
|
56
|
+
tick: number;
|
|
41
57
|
}
|
|
42
58
|
export interface MainActions {
|
|
43
59
|
setActiveElementIdList: (activeElementIdList: string[]) => void;
|
|
@@ -75,6 +91,8 @@ export interface MainActions {
|
|
|
75
91
|
setOpenPanelOnTextSelection: (on: boolean) => void;
|
|
76
92
|
revealRightPanelForTextRange: () => void;
|
|
77
93
|
applyRightPanelAuto: (width: number, narrowPx: number) => void;
|
|
94
|
+
setReadOnly: (readOnly: boolean) => void;
|
|
95
|
+
setAiReveal: (reveal: Omit<AiRevealState, 'tick'> | null) => void;
|
|
78
96
|
}
|
|
79
97
|
export type MainStore = MainState & MainActions;
|
|
80
98
|
export declare const databaseId: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Progressive "typing" prefixes of rich-text HTML.
|
|
3
|
+
*
|
|
4
|
+
* A prefix keeps the markup well-formed: text nodes are cut mid-run, atomic
|
|
5
|
+
* nodes (inline math, images, line breaks) are either fully in or fully out,
|
|
6
|
+
* and elements left with nothing visible after the cut are dropped so no
|
|
7
|
+
* empty paragraphs flash before their text arrives.
|
|
8
|
+
*/
|
|
9
|
+
/** Total typing units in `html` (characters plus a fixed weight per atomic node). */
|
|
10
|
+
export declare function revealUnits(html: string): number;
|
|
11
|
+
/** The first `units` typing units of `html` as well-formed HTML. */
|
|
12
|
+
export declare function revealPrefix(html: string, units: number): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small "AI is writing" pill that trails the caret of the element currently
|
|
3
|
+
* being revealed by `controller.revealSlide`, or sits at the top-right of an
|
|
4
|
+
* element without text.
|
|
5
|
+
*/
|
|
6
|
+
declare const AiRevealBadge: import("react").MemoExoticComponent<({ canvasRef }: {
|
|
7
|
+
canvasRef: {
|
|
8
|
+
current: HTMLElement | null;
|
|
9
|
+
};
|
|
10
|
+
}) => import("react").JSX.Element>;
|
|
11
|
+
export default AiRevealBadge;
|