fika-editor 3.6.9 → 3.6.11
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/{5370.js → 8558.js} +2 -2
- package/dist/embed/agentic-manifest.json +2 -2
- package/dist/embed/chunks/1938.js +1 -0
- package/dist/embed/chunks/2085.js +1 -0
- package/dist/embed/chunks/2258.js +7 -0
- package/dist/embed/chunks/4466.js +1 -0
- package/dist/embed/chunks/508.js +4 -0
- package/dist/embed/chunks/9541.js +1 -1
- package/dist/embed/chunks/9877.js +7 -0
- package/dist/embed/fika-embed.js +4 -4
- package/dist/types/components/Icon.d.ts +1 -0
- package/dist/types/configs/exportLanguage.d.ts +13 -0
- package/dist/types/configs/exportMetadata.d.ts +65 -0
- package/dist/types/embed/export.d.ts +1 -1
- package/dist/types/embed/index.d.ts +1 -0
- package/dist/types/embed/types.d.ts +20 -1
- package/dist/types/hooks/useExport.d.ts +5 -0
- package/dist/types/i18n/i18n-react.d.ts +10 -10
- package/dist/types/i18n/i18n-types.d.ts +9219 -9219
- package/dist/types/i18n/i18n-util.async.d.ts +5 -5
- package/dist/types/i18n/i18n-util.d.ts +5 -5
- package/dist/types/utils/exportLanguage.d.ts +6 -0
- package/dist/types/utils/pdfExportMetadata.d.ts +18 -0
- package/docs/EMBED.md +43 -2
- package/package.json +1 -1
- package/dist/embed/chunks/2596.js +0 -1
|
@@ -4,14 +4,14 @@ export declare const loadLocaleAsync: (locale: Locales) => Promise<void>;
|
|
|
4
4
|
export declare const loadAllLocalesAsync: () => Promise<void[]>;
|
|
5
5
|
export declare const loadFormatters: (locale: Locales) => void;
|
|
6
6
|
export declare const importNamespaceAsync: <Namespace extends Namespaces>(locale: Locales, namespace: Namespace) => Promise<{
|
|
7
|
+
canvas: import("./i18n-types").NamespaceCanvasTranslation;
|
|
7
8
|
configs: import("./i18n-types").NamespaceConfigsTranslation;
|
|
8
|
-
|
|
9
|
+
editor: import("./i18n-types").NamespaceEditorTranslation;
|
|
9
10
|
myna: import("./i18n-types").NamespaceMynaTranslation;
|
|
10
|
-
export: import("./i18n-types").NamespaceExportTranslation;
|
|
11
|
-
canvas: import("./i18n-types").NamespaceCanvasTranslation;
|
|
12
11
|
common: import("./i18n-types").NamespaceCommonTranslation;
|
|
13
|
-
|
|
14
|
-
screen: import("./i18n-types").NamespaceScreenTranslation;
|
|
12
|
+
mobile: import("./i18n-types").NamespaceMobileTranslation;
|
|
15
13
|
components: import("./i18n-types").NamespaceComponentsTranslation;
|
|
14
|
+
screen: import("./i18n-types").NamespaceScreenTranslation;
|
|
15
|
+
export: import("./i18n-types").NamespaceExportTranslation;
|
|
16
16
|
}[Namespace]>;
|
|
17
17
|
export declare const loadNamespaceAsync: <Namespace extends Namespaces>(locale: Locales, namespace: Namespace) => Promise<void>;
|
|
@@ -9,15 +9,15 @@ export declare const isNamespace: (namespace: string) => namespace is Namespaces
|
|
|
9
9
|
export declare const loadedLocales: Record<Locales, Translations>;
|
|
10
10
|
export declare const loadedFormatters: Record<Locales, Formatters>;
|
|
11
11
|
export declare const extendDictionary: <Base extends import("typesafe-i18n").BaseTranslation | {
|
|
12
|
+
canvas: import("./i18n-types").NamespaceCanvasTranslation;
|
|
12
13
|
configs: import("./i18n-types").NamespaceConfigsTranslation;
|
|
13
|
-
|
|
14
|
+
editor: import("./i18n-types").NamespaceEditorTranslation;
|
|
14
15
|
myna: import("./i18n-types").NamespaceMynaTranslation;
|
|
15
|
-
export: import("./i18n-types").NamespaceExportTranslation;
|
|
16
|
-
canvas: import("./i18n-types").NamespaceCanvasTranslation;
|
|
17
16
|
common: import("./i18n-types").NamespaceCommonTranslation;
|
|
18
|
-
|
|
19
|
-
screen: import("./i18n-types").NamespaceScreenTranslation;
|
|
17
|
+
mobile: import("./i18n-types").NamespaceMobileTranslation;
|
|
20
18
|
components: import("./i18n-types").NamespaceComponentsTranslation;
|
|
19
|
+
screen: import("./i18n-types").NamespaceScreenTranslation;
|
|
20
|
+
export: import("./i18n-types").NamespaceExportTranslation;
|
|
21
21
|
}, Translation extends Base>(base: Base, part: (Translation extends string ? string : Translation extends import("typesafe-i18n").BaseTranslation ? { [P in keyof Translation]?: Translation[P] extends infer T ? T extends Translation[P] ? T extends string ? string : T extends import("typesafe-i18n").BaseTranslation ? { [P_1 in keyof T]?: T[P_1] extends infer T_1 ? T_1 extends T[P_1] ? T_1 extends string ? string : T_1 extends import("typesafe-i18n").BaseTranslation ? { [P_2 in keyof T_1]?: T_1[P_2] extends infer T_2 ? T_2 extends T_1[P_2] ? T_2 extends string ? string : T_2 extends import("typesafe-i18n").BaseTranslation ? { [P_3 in keyof T_2]?: T_2[P_3] extends infer T_3 ? T_3 extends T_2[P_3] ? T_3 extends string ? string : T_3 extends import("typesafe-i18n").BaseTranslation ? { [P_4 in keyof T_3]?: T_3[P_4] extends infer T_4 ? T_4 extends T_3[P_4] ? T_4 extends string ? string : T_4 extends import("typesafe-i18n").BaseTranslation ? { [P_5 in keyof T_4]?: T_4[P_5] extends infer T_5 ? T_5 extends T_4[P_5] ? T_5 extends string ? string : T_5 extends import("typesafe-i18n").BaseTranslation ? { [P_6 in keyof T_5]?: T_5[P_6] extends infer T_6 ? T_6 extends T_5[P_6] ? T_6 extends string ? string : T_6 extends import("typesafe-i18n").BaseTranslation ? { [P_7 in keyof T_6]?: T_6[P_7] extends infer T_7 ? T_7 extends T_6[P_7] ? T_7 extends string ? string : T_7 extends import("typesafe-i18n").BaseTranslation ? { [P_8 in keyof T_7]?: T_7[P_8] extends infer T_8 ? T_8 extends T_7[P_8] ? T_8 extends string ? string : T_8 extends import("typesafe-i18n").BaseTranslation ? { [P_9 in keyof T_8]?: T_8[P_9] extends infer T_9 ? T_9 extends T_8[P_9] ? T_9 extends string ? string : T_9 extends import("typesafe-i18n").BaseTranslation ? { [P_10 in keyof T_9]?: /*elided*/ any; } : T_9 : never : never; } : T_8 : never : never; } : T_7 : never : never; } : T_6 : never : never; } : T_5 : never : never; } : T_4 : never : never; } : T_3 : never : never; } : T_2 : never : never; } : T_1 : never : never; } : T : never : never; } : Translation) extends infer T ? T extends (Translation extends string ? string : Translation extends import("typesafe-i18n").BaseTranslation ? { [P in keyof Translation]?: Translation[P] extends infer T ? T extends Translation[P] ? T extends string ? string : T extends import("typesafe-i18n").BaseTranslation ? { [P_1 in keyof T]?: T[P_1] extends infer T_1 ? T_1 extends T[P_1] ? T_1 extends string ? string : T_1 extends import("typesafe-i18n").BaseTranslation ? { [P_2 in keyof T_1]?: T_1[P_2] extends infer T_2 ? T_2 extends T_1[P_2] ? T_2 extends string ? string : T_2 extends import("typesafe-i18n").BaseTranslation ? { [P_3 in keyof T_2]?: T_2[P_3] extends infer T_3 ? T_3 extends T_2[P_3] ? T_3 extends string ? string : T_3 extends import("typesafe-i18n").BaseTranslation ? { [P_4 in keyof T_3]?: T_3[P_4] extends infer T_4 ? T_4 extends T_3[P_4] ? T_4 extends string ? string : T_4 extends import("typesafe-i18n").BaseTranslation ? { [P_5 in keyof T_4]?: T_4[P_5] extends infer T_5 ? T_5 extends T_4[P_5] ? T_5 extends string ? string : T_5 extends import("typesafe-i18n").BaseTranslation ? { [P_6 in keyof T_5]?: T_5[P_6] extends infer T_6 ? T_6 extends T_5[P_6] ? T_6 extends string ? string : T_6 extends import("typesafe-i18n").BaseTranslation ? { [P_7 in keyof T_6]?: T_6[P_7] extends infer T_7 ? T_7 extends T_6[P_7] ? T_7 extends string ? string : T_7 extends import("typesafe-i18n").BaseTranslation ? { [P_8 in keyof T_7]?: T_7[P_8] extends infer T_8 ? T_8 extends T_7[P_8] ? T_8 extends string ? string : T_8 extends import("typesafe-i18n").BaseTranslation ? { [P_9 in keyof T_8]?: T_8[P_9] extends infer T_9 ? T_9 extends T_8[P_9] ? T_9 extends string ? string : T_9 extends import("typesafe-i18n").BaseTranslation ? { [P_10 in keyof T_9]?: any; } : T_9 : never : never; } : T_8 : never : never; } : T_7 : never : never; } : T_6 : never : never; } : T_5 : never : never; } : T_4 : never : never; } : T_3 : never : never; } : T_2 : never : never; } : T_1 : never : never; } : T : never : never; } : Translation) ? T extends import("typesafe-i18n").BaseTranslation ? { [P in keyof T]?: T[P] extends infer T_1 ? T_1 extends T[P] ? T_1 extends import("typesafe-i18n").BaseTranslation ? { [P_1 in keyof T_1]?: T_1[P_1] extends infer T_2 ? T_2 extends T_1[P_1] ? T_2 extends import("typesafe-i18n").BaseTranslation ? { [P_2 in keyof T_2]?: T_2[P_2] extends infer T_3 ? T_3 extends T_2[P_2] ? T_3 extends import("typesafe-i18n").BaseTranslation ? { [P_3 in keyof T_3]?: T_3[P_3] extends infer T_4 ? T_4 extends T_3[P_3] ? T_4 extends import("typesafe-i18n").BaseTranslation ? { [P_4 in keyof T_4]?: T_4[P_4] extends infer T_5 ? T_5 extends T_4[P_4] ? T_5 extends import("typesafe-i18n").BaseTranslation ? { [P_5 in keyof T_5]?: T_5[P_5] extends infer T_6 ? T_6 extends T_5[P_5] ? T_6 extends import("typesafe-i18n").BaseTranslation ? { [P_6 in keyof T_6]?: T_6[P_6] extends infer T_7 ? T_7 extends T_6[P_6] ? T_7 extends import("typesafe-i18n").BaseTranslation ? { [P_7 in keyof T_7]?: T_7[P_7] extends infer T_8 ? T_8 extends T_7[P_7] ? T_8 extends import("typesafe-i18n").BaseTranslation ? { [P_8 in keyof T_8]?: T_8[P_8] extends infer T_9 ? T_9 extends T_8[P_8] ? T_9 extends import("typesafe-i18n").BaseTranslation ? { [P_9 in keyof T_9]?: T_9[P_9] extends infer T_10 ? T_10 extends T_9[P_9] ? T_10 extends import("typesafe-i18n").BaseTranslation ? { [P_10 in keyof T_10]?: /*elided*/ any; } : T_10 : never : never; } : T_9 : never : never; } : T_8 : never : never; } : T_7 : never : never; } : T_6 : never : never; } : T_5 : never : never; } : T_4 : never : never; } : T_3 : never : never; } : T_2 : never : never; } : T_1 : never : never; } : T : never : never) => Translation;
|
|
22
22
|
export declare const i18nString: (locale: Locales) => TranslateByString;
|
|
23
23
|
export declare const i18nObject: (locale: Locales) => TranslationFunctions;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PptxExportCommand } from './pptxExportCommands';
|
|
2
|
+
/**
|
|
3
|
+
* Give every recorded text run, table cell and chart the deck's proofing
|
|
4
|
+
* language. Runs with their own language (a quotation, a foreign word) keep it.
|
|
5
|
+
*/
|
|
6
|
+
export declare function applyPptxLanguage(commands: PptxExportCommand[], lang: string | null | undefined): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Writes host metadata (`exportMetadata`) into a pdf-lib document before save:
|
|
3
|
+
* - Info `Creator` / `Producer` = generator, `Title` = title (when given)
|
|
4
|
+
* - custom Info keys `AIGenerated`, `DigitalSourceType`, `AIStatement`
|
|
5
|
+
* - an XMP metadata stream on the catalog with `xmp:CreatorTool`,
|
|
6
|
+
* `pdf:Producer`, `dc:title`, `dc:description` (statement),
|
|
7
|
+
* `Iptc4xmpExt:DigitalSourceType` and the host's optional custom namespace.
|
|
8
|
+
*/
|
|
9
|
+
import { type PDFDocument } from 'pdf-lib';
|
|
10
|
+
import type { FikaExportMetadata } from '../configs/exportMetadata';
|
|
11
|
+
export declare function buildExportXmp(metadata: FikaExportMetadata, options?: {
|
|
12
|
+
title?: string;
|
|
13
|
+
date?: Date;
|
|
14
|
+
}): string;
|
|
15
|
+
export declare function applyPdfExportMetadata(pdf: PDFDocument, metadata: FikaExportMetadata, options?: {
|
|
16
|
+
title?: string;
|
|
17
|
+
date?: Date;
|
|
18
|
+
}): void;
|
package/docs/EMBED.md
CHANGED
|
@@ -312,6 +312,47 @@ The mark is written into the OOXML after generation, so it is identical for rege
|
|
|
312
312
|
|
|
313
313
|
OOXML is plain XML in a ZIP — a determined user can still strip the picture with a text editor. The mark is designed to defeat casual removal, not to be cryptographically enforced. If the resolver throws or the image cannot be loaded, the export fails with the standard export error instead of silently downloading a clean deck.
|
|
314
314
|
|
|
315
|
+
### Export metadata (AI labelling)
|
|
316
|
+
|
|
317
|
+
Hosts that must mark downloads as machine-generated in a machine-readable way (for example under EU AI Act art. 50) pass `exportMetadata`. Like `exportWatermark`, it is a resolver evaluated at the start of each PPTX and PDF export — the editor's export dialog, Myna's PDF download, and `exportPresentationPptx` / `exportPresentationPdf` when they get no explicit `metadata` option. It receives `{ format: 'pptx' | 'pdf', title }`; return `null` to keep Fika's default metadata.
|
|
318
|
+
|
|
319
|
+
```ts
|
|
320
|
+
await mountFika(host, {
|
|
321
|
+
exportMetadata: () => ({
|
|
322
|
+
generator: 'Acme', // producing application
|
|
323
|
+
aiGenerated: true,
|
|
324
|
+
digitalSourceType: 'http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia',
|
|
325
|
+
statement: 'Generated by AI in Acme', // optional disclosure text
|
|
326
|
+
// title: 'Override', // optional; defaults to the deck title
|
|
327
|
+
xmpNamespace: { // optional; PDF XMP only
|
|
328
|
+
uri: 'https://acme.example/ns/ai/1.0/',
|
|
329
|
+
prefix: 'acme',
|
|
330
|
+
properties: { aiGenerated: 'True' },
|
|
331
|
+
},
|
|
332
|
+
}),
|
|
333
|
+
})
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
What gets written:
|
|
337
|
+
|
|
338
|
+
| | PPTX | PDF |
|
|
339
|
+
| --- | --- | --- |
|
|
340
|
+
| `generator` | `docProps/app.xml` `<Application>`; custom property `Generator` | Info `Creator` and `Producer`; XMP `xmp:CreatorTool`, `pdf:Producer` |
|
|
341
|
+
| `aiGenerated` | custom property `AIGenerated` (`vt:bool`); `AI-generated` appended to `cp:keywords` when true | Info `AIGenerated` (`true` / `false`) |
|
|
342
|
+
| `digitalSourceType` | custom property `DigitalSourceType` | Info `DigitalSourceType`; XMP `Iptc4xmpExt:DigitalSourceType` |
|
|
343
|
+
| `statement` | `dc:description`, only when the deck has none | Info `AIStatement`; XMP `dc:description` |
|
|
344
|
+
| `title` | `dc:title` | Info `Title`; XMP `dc:title` |
|
|
345
|
+
| `xmpNamespace` | — | `xmlns:<prefix>="<uri>"` and one `<prefix>:<name>` element per property in the XMP packet |
|
|
346
|
+
|
|
347
|
+
PPTX metadata is applied to the finished package, so regenerated decks and retained source packages are labelled identically; `docProps/custom.xml` (plus its package relationship and content-type override) is created when missing, and foreign custom properties are kept. PDF gets an uncompressed XMP metadata stream (`/Type /Metadata /Subtype /XML`) on the catalog. Values are validated (`generator` and `digitalSourceType` non-empty, `aiGenerated` boolean, XML-safe XMP prefix and property names); a resolver that throws or returns invalid metadata fails the export instead of downloading an unlabelled file. Image exports (PNG/JPEG/SVG) are not covered.
|
|
348
|
+
|
|
349
|
+
Programmatic exports take the same resolver as `metadata`:
|
|
350
|
+
|
|
351
|
+
```ts
|
|
352
|
+
const pptx = await exportPresentationPptx(document, { metadata: () => aiLabel })
|
|
353
|
+
const pdf = await exportPresentationPdf(document, { metadata: null }) // no label even when mounted with exportMetadata
|
|
354
|
+
```
|
|
355
|
+
|
|
315
356
|
### Media uploads
|
|
316
357
|
|
|
317
358
|
The toolbar **Media** action (images, video, and audio) opens a local-file picker. Pexels / remote galleries are not used. Without a host `upload` callback, images become data URLs and audio/video become blob URLs — fine for demos, not for persistence.
|
|
@@ -574,7 +615,7 @@ high-resolution JPEG per page (2560 pixels wide by default), preserving slide
|
|
|
574
615
|
order and aspect ratio. PDF text is rasterized. No additional document IR is
|
|
575
616
|
required. Load `fika-embed.css` before PDF export so bundled fonts are available.
|
|
576
617
|
|
|
577
|
-
Options include `mediaResolver`, `watermark`, and `onProgress(completed, total, detail)`.
|
|
618
|
+
Options include `mediaResolver`, `watermark`, `metadata` (see [Export metadata](#export-metadata-ai-labelling)), and `onProgress(completed, total, detail)`.
|
|
578
619
|
The optional `detail` (`FikaExportProgress`) includes `phase` (`preparing`, `rendering`,
|
|
579
620
|
`packaging`, or `complete`) and normalized `progress` (0–1). Counted slides are
|
|
580
621
|
completed slides; packaging continues after all slides render, and `progress: 1`
|
|
@@ -591,7 +632,7 @@ to disable a resolver. PDF also accepts `width` (64 to 8192 pixels) and
|
|
|
591
632
|
embedded directly without decoding and recompressing each page. Rendering uses
|
|
592
633
|
bounded concurrency and skips idle waits when all resources are ready. Export
|
|
593
634
|
time still depends on slide count, image downloads, raster size, and hardware.
|
|
594
|
-
Required watermark and PDF image failures
|
|
635
|
+
Required watermark, metadata and PDF image failures
|
|
595
636
|
reject the promise. PPTX retains its existing partial-media warning behavior.
|
|
596
637
|
|
|
597
638
|
The native export dialog now offers `pptx`, `pdf`, and `json`; control their
|