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.
@@ -58,6 +58,7 @@ declare const ICONS: {
58
58
  readonly group: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
59
59
  readonly hand: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
60
60
  readonly highlighter: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
61
+ readonly history: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
61
62
  readonly image: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
62
63
  readonly indent: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
63
64
  readonly info: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Proofing language of the text in PPTX downloads.
3
+ *
4
+ * PowerPoint checks spelling, hyphenates and applies AutoCorrect per text run
5
+ * by its `lang` attribute. Without one every run is US English, so a Czech
6
+ * deck opens with every word underlined as a typo. The host names the deck's
7
+ * language (BCP-47, e.g. `cs` or `sk-SK`); runs that already carry a
8
+ * language keep it.
9
+ */
10
+ /** Region-qualified tag PowerPoint recognises (`cs` → `cs-CZ`), or null for an invalid tag. */
11
+ export declare function pptxLanguageTag(tag?: string | null): string | null;
12
+ export declare function setFikaExportLanguage(tag?: string | null): void;
13
+ export declare function getFikaExportLanguage(): string | null;
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Host-mandated document metadata for PPTX and PDF downloads.
3
+ *
4
+ * Lets a host mark exported files as machine-generated in a machine-readable
5
+ * way (for example to meet EU AI Act art. 50 transparency duties) without
6
+ * touching slide content. Like `exportWatermark`, the resolver runs at the
7
+ * start of every export, so the host can decide per download. Returning
8
+ * null/undefined leaves Fika's default metadata untouched. A resolver that
9
+ * throws, or metadata that cannot be written, fails the export — the engine
10
+ * never silently drops a label the host asked for.
11
+ */
12
+ /** Custom XMP namespace written next to the standard PDF XMP fields. */
13
+ export interface FikaExportMetadataXmpNamespace {
14
+ /** Namespace URI, e.g. `https://example.com/ns/ai/1.0/`. */
15
+ uri: string;
16
+ /** XML prefix, e.g. `acme`. Must not clash with `x`, `rdf`, `xml`, `xmp`, `pdf`, `dc` or `Iptc4xmpExt`. */
17
+ prefix: string;
18
+ /** Simple text properties, e.g. `{ aiGenerated: 'True' }`. Names must be XML names. */
19
+ properties: Record<string, string>;
20
+ }
21
+ export interface FikaExportMetadata {
22
+ /**
23
+ * Producing application. PPTX: `docProps/app.xml` `<Application>` and the
24
+ * `Generator` custom property. PDF: Info `Creator` / `Producer`,
25
+ * XMP `xmp:CreatorTool` / `pdf:Producer`.
26
+ */
27
+ generator: string;
28
+ /**
29
+ * Whether the content was generated by AI. PPTX: custom property
30
+ * `AIGenerated` (bool) and, when true, the `AI-generated` keyword.
31
+ * PDF: Info key `AIGenerated`.
32
+ */
33
+ aiGenerated: boolean;
34
+ /**
35
+ * IPTC digital source type URI, e.g.
36
+ * `http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia`.
37
+ * PPTX: custom property `DigitalSourceType`. PDF: Info key
38
+ * `DigitalSourceType`, XMP `Iptc4xmpExt:DigitalSourceType`.
39
+ */
40
+ digitalSourceType: string;
41
+ /**
42
+ * Human-readable disclosure, e.g. `Generated by AI in Acme`. PPTX:
43
+ * `dc:description` when the deck has none. PDF: Info key `AIStatement`,
44
+ * XMP `dc:description`.
45
+ */
46
+ statement?: string;
47
+ /** Overrides the document title (PPTX `dc:title`, PDF Info `Title` and XMP `dc:title`). */
48
+ title?: string;
49
+ /** Extra XMP namespace for host-specific flags (PDF only). */
50
+ xmpNamespace?: FikaExportMetadataXmpNamespace;
51
+ }
52
+ export interface FikaExportMetadataContext {
53
+ /** Format being written. */
54
+ format: 'pptx' | 'pdf';
55
+ /** Deck title at export time. */
56
+ title: string;
57
+ }
58
+ export type FikaExportMetadataResolver = (context: FikaExportMetadataContext) => FikaExportMetadata | null | undefined | Promise<FikaExportMetadata | null | undefined>;
59
+ export declare function setFikaExportMetadata(resolver?: FikaExportMetadataResolver | null): void;
60
+ export declare function getFikaExportMetadata(): FikaExportMetadataResolver | null;
61
+ /**
62
+ * Runs the resolver and validates the result. Returns a plain, structured-
63
+ * cloneable object (safe to post to the export worker) or null.
64
+ */
65
+ export declare function resolveExportMetadata(resolver: FikaExportMetadataResolver | null | undefined, context: FikaExportMetadataContext): Promise<FikaExportMetadata | null>;
@@ -7,7 +7,7 @@ export interface FikaExportProgress {
7
7
  /** Normalized 0..1; reaches 1 only when downloadable bytes are ready. */
8
8
  progress: number;
9
9
  }
10
- export interface FikaExportOptions extends Pick<PresentationExportOptions, 'mediaResolver' | 'watermark'> {
10
+ export interface FikaExportOptions extends Pick<PresentationExportOptions, 'mediaResolver' | 'watermark' | 'metadata' | 'language'> {
11
11
  /** Runtime assets/chunks when exporting before mounting an editor. */
12
12
  assetBaseUrl?: string;
13
13
  /** PDF raster width in pixels. Default 2560, maximum 8192. */
@@ -6,6 +6,7 @@ export type { FikaDeckAtlasOptions, FikaDeckAtlasSheet, FikaDeckAtlasTile, FikaR
6
6
  export type { ExportTabId, FikaExportTabsConfig } from '../configs/exportTabs';
7
7
  export type { FikaExportMediaResolver } from '../configs/exportMediaResolver';
8
8
  export type { FikaExportWatermark, FikaExportWatermarkPosition, FikaExportWatermarkResolver, FikaWatermarkSurface, } from '../configs/exportWatermark';
9
+ export type { FikaExportMetadata, FikaExportMetadataContext, FikaExportMetadataResolver, FikaExportMetadataXmpNamespace, } from '../configs/exportMetadata';
9
10
  export { createFikaMediaUploader, } from '../configs/mediaUpload';
10
11
  export type { FikaMediaConfig, FikaMediaConstraints, FikaMediaKind, FikaMediaSizeLimit, FikaMediaUploadProgress, FikaMediaUploadRequest, FikaMediaUploadResult, FikaMediaUploader, FikaXhrMediaUploaderOptions, } from '../configs/mediaUpload';
11
12
  export type * from './agentic/types';
@@ -2,6 +2,7 @@ import type { FikaDesignTheme } from '../configs/designThemes';
2
2
  import type { FikaExportTabsConfig } from '../configs/exportTabs';
3
3
  import type { FikaExportMediaResolver } from '../configs/exportMediaResolver';
4
4
  import type { FikaExportWatermark, FikaExportWatermarkPosition, FikaExportWatermarkResolver, FikaWatermarkSurface } from '../configs/exportWatermark';
5
+ import type { FikaExportMetadata, FikaExportMetadataContext, FikaExportMetadataResolver, FikaExportMetadataXmpNamespace } from '../configs/exportMetadata';
5
6
  import type { FikaMediaConfig } from '../configs/mediaUpload';
6
7
  import type { Locales } from '../i18n/locale';
7
8
  import type { Slide, SlideTheme, SlideTemplate } from '../types/slides';
@@ -9,6 +10,7 @@ import type { FikaAgentApi, FikaDeckViewport, FikaSlideReference } from './agent
9
10
  import type { FikaRevealOptions } from './reveal';
10
11
  export type { FikaExportMediaResolver };
11
12
  export type { FikaExportWatermark, FikaExportWatermarkPosition, FikaExportWatermarkResolver, FikaWatermarkSurface };
13
+ export type { FikaExportMetadata, FikaExportMetadataContext, FikaExportMetadataResolver, FikaExportMetadataXmpNamespace };
12
14
  export type { FikaRevealOptions };
13
15
  export type { FikaMediaConfig, FikaMediaConstraints, FikaMediaKind, FikaMediaSizeLimit, FikaMediaUploadProgress, FikaMediaUploadRequest, FikaMediaUploadResult, FikaMediaUploader, FikaXhrMediaUploaderOptions } from '../configs/mediaUpload';
14
16
  export interface FikaTemplatePayload {
@@ -53,7 +55,7 @@ export interface FikaHeaderMenuItem {
53
55
  /** Menu item label (host-localized). */
54
56
  label: string;
55
57
  /**
56
- * Optional Lucide kebab-case name (`link`, `share-2`, `globe`, `cloud`)
58
+ * Optional Lucide kebab-case name (`link`, `share-2`, `globe`, `cloud`, `history`)
57
59
  * rendered before the label. Only a curated set is supported; unknown names
58
60
  * render no icon.
59
61
  */
@@ -109,6 +111,23 @@ export interface FikaMountOptions {
109
111
  * Applies to regenerated decks and retained source packages alike.
110
112
  */
111
113
  exportWatermark?: FikaExportWatermarkResolver;
114
+ /**
115
+ * Machine-readable document metadata written into every PPTX and PDF
116
+ * download (editor export dialog and `exportPresentationPptx` /
117
+ * `exportPresentationPdf` without an explicit `metadata` option). Use it to
118
+ * label files as AI-generated: generator, IPTC digital source type, a
119
+ * disclosure statement and an optional custom XMP namespace. Evaluated at
120
+ * the start of each export; return null to keep Fika's defaults. A throwing
121
+ * resolver fails the export.
122
+ */
123
+ exportMetadata?: FikaExportMetadataResolver;
124
+ /**
125
+ * Language of the deck's text (BCP-47, e.g. `cs` or `sk-SK`) written to
126
+ * every PPTX text run, so PowerPoint checks spelling in that language
127
+ * instead of US English. Applies to the editor export dialog and to
128
+ * `exportPresentationPptx` without an explicit `language` option.
129
+ */
130
+ exportLanguage?: string;
112
131
  /**
113
132
  * Local media picker used by the unified Insert → Media action (images,
114
133
  * video, and audio). Pass `upload` to send files to your backend instead of
@@ -1,6 +1,7 @@
1
1
  import type { Slide, SlideTheme } from '../types/slides';
2
2
  import { type FikaExportMediaResolver } from '../configs/exportMediaResolver';
3
3
  import { type FikaExportWatermarkResolver } from '../configs/exportWatermark';
4
+ import { type FikaExportMetadataResolver } from '../configs/exportMetadata';
4
5
  /** A per-call deck snapshot: exporting never mounts or mutates an editor. */
5
6
  export interface PresentationExportState {
6
7
  slides: Slide[];
@@ -16,6 +17,10 @@ export interface PresentationExportOptions {
16
17
  hiddenElementIds?: string[];
17
18
  mediaResolver?: FikaExportMediaResolver | null;
18
19
  watermark?: FikaExportWatermarkResolver | null;
20
+ /** Document metadata for the written file; `undefined` falls back to the mounted `exportMetadata`. */
21
+ metadata?: FikaExportMetadataResolver | null;
22
+ /** Proofing language of the deck's text (BCP-47); `undefined` falls back to the mounted `exportLanguage`. */
23
+ language?: string | null;
19
24
  }
20
25
  export declare function createPresentationExporter({ slides, theme, viewportRatio, title, viewportSize, viewportWidthInches }: PresentationExportState, options?: PresentationExportOptions, job?: import("../utils/jobProgress").JobProgress): {
21
26
  exporting: boolean;
@@ -1,25 +1,25 @@
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
+ canvas: import("./i18n-types").NamespaceCanvasTranslation;
3
4
  configs: import("./i18n-types").NamespaceConfigsTranslation;
4
- mobile: import("./i18n-types").NamespaceMobileTranslation;
5
+ editor: import("./i18n-types").NamespaceEditorTranslation;
5
6
  myna: import("./i18n-types").NamespaceMynaTranslation;
6
- export: import("./i18n-types").NamespaceExportTranslation;
7
- canvas: import("./i18n-types").NamespaceCanvasTranslation;
8
7
  common: import("./i18n-types").NamespaceCommonTranslation;
9
- editor: import("./i18n-types").NamespaceEditorTranslation;
10
- screen: import("./i18n-types").NamespaceScreenTranslation;
8
+ mobile: import("./i18n-types").NamespaceMobileTranslation;
11
9
  components: import("./i18n-types").NamespaceComponentsTranslation;
10
+ screen: import("./i18n-types").NamespaceScreenTranslation;
11
+ export: import("./i18n-types").NamespaceExportTranslation;
12
12
  }, TranslationFunctions>>;
13
13
  export { TypesafeI18n, I18nContext };
14
14
  export declare function useI18nContext(): import("typesafe-i18n/react").I18nContextType<Locales, {
15
+ canvas: import("./i18n-types").NamespaceCanvasTranslation;
15
16
  configs: import("./i18n-types").NamespaceConfigsTranslation;
16
- mobile: import("./i18n-types").NamespaceMobileTranslation;
17
+ editor: import("./i18n-types").NamespaceEditorTranslation;
17
18
  myna: import("./i18n-types").NamespaceMynaTranslation;
18
- export: import("./i18n-types").NamespaceExportTranslation;
19
- canvas: import("./i18n-types").NamespaceCanvasTranslation;
20
19
  common: import("./i18n-types").NamespaceCommonTranslation;
21
- editor: import("./i18n-types").NamespaceEditorTranslation;
22
- screen: import("./i18n-types").NamespaceScreenTranslation;
20
+ mobile: import("./i18n-types").NamespaceMobileTranslation;
23
21
  components: import("./i18n-types").NamespaceComponentsTranslation;
22
+ screen: import("./i18n-types").NamespaceScreenTranslation;
23
+ export: import("./i18n-types").NamespaceExportTranslation;
24
24
  }, TranslationFunctions>;
25
25
  export declare const useI18nReact: typeof useI18nContext;