fika-editor 3.5.10 → 3.6.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.
Files changed (30) hide show
  1. package/dist/embed/{7605.js → 5370.js} +9 -9
  2. package/dist/embed/agentic-manifest.json +4 -4
  3. package/dist/embed/chunks/1131.js +1 -1
  4. package/dist/embed/chunks/655.js +1 -1
  5. package/dist/embed/fika-embed.css +2 -2
  6. package/dist/embed/fika-embed.js +5 -5
  7. package/dist/layout/utils/resizeDeck.js +95 -3
  8. package/dist/types/embed/agentic/types.d.ts +2 -0
  9. package/dist/types/hooks/useExport.d.ts +2 -1
  10. package/dist/types/paint/slidePainter.d.ts +2 -1
  11. package/dist/types/store/slides.d.ts +10 -0
  12. package/dist/types/types/slides.d.ts +2 -0
  13. package/dist/types/utils/clipboard.d.ts +1 -1
  14. package/dist/types/utils/database.d.ts +1 -0
  15. package/dist/types/utils/emitter.d.ts +8 -0
  16. package/dist/types/utils/pptxSourcePackage.d.ts +1 -0
  17. package/dist/types/utils/prosemirror/table.d.ts +26 -0
  18. package/dist/types/utils/prosemirror/tableEditor.d.ts +17 -0
  19. package/dist/types/utils/resizeDeck.d.ts +6 -0
  20. package/dist/types/utils/searchText.d.ts +5 -0
  21. package/dist/types/utils/tableCellStyle.d.ts +1 -0
  22. package/dist/types/utils/tableExport.d.ts +4 -1
  23. package/dist/types/views/Editor/Canvas/ElementFloatLayer/FloatingToolbar/TextStyleControls.d.ts +5 -1
  24. package/dist/types/views/components/element/TableElement/EditableTable.d.ts +1 -1
  25. package/dist/types/views/components/element/TableElement/TableCellEditor.d.ts +14 -0
  26. package/dist/types/views/components/element/TableElement/utils.d.ts +2 -2
  27. package/docs/AGENTIC_BRIDGE.md +2 -0
  28. package/package.json +1 -1
  29. package/dist/embed/chunks/7463.js +0 -1
  30. package/dist/types/views/components/element/TableElement/CustomTextarea.d.ts +0 -13
@@ -100,7 +100,7 @@ function bodyColumns(boxes, from) {
100
100
  }
101
101
  function scalePixels(html, scale) {
102
102
  // CSS lengths only: do not rewrite lesson text containing quantities in px.
103
- return html.replace(/style=(['"])(.*?)\1/gi, (_, quote, css) => `style=${quote}${css.replace(/(-?\d+(?:\.\d+)?)px\b/g, (_m, n) => `${Number((Number(n) * scale).toFixed(4))}px`)}${quote}`);
103
+ return html.replace(/style=(['"])(.*?)\1/gi, (_, quote, css) => `style=${quote}${css.replace(/(-?\d+(?:\.\d+)?)(px|pt)\b/gi, (_m, n, unit) => `${Number(n) * scale}${unit}`)}${quote}`);
104
104
  }
105
105
  function scaleNumber(record, key, scale) {
106
106
  const obj = record;
@@ -126,9 +126,13 @@ function scaleTypography(el, scale) {
126
126
  el.cellMinHeight *= scale;
127
127
  for (const row of el.data)
128
128
  for (const cell of row) {
129
- cell.text = scalePixels(cell.text, scale);
129
+ if (cell.textFormat === 'html')
130
+ cell.text = scalePixels(cell.text, scale);
130
131
  if (cell.style?.fontsize)
131
132
  cell.style.fontsize = cell.style.fontsize.replace(/^(\d+(?:\.\d+)?)(px|pt)$/i, (_, value, unit) => `${Number(value) * scale}${unit}`);
133
+ if (cell.style)
134
+ for (const key of ['borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth'])
135
+ scaleNumber(cell.style, key, scale);
132
136
  }
133
137
  }
134
138
  if (el.type === 'chart')
@@ -137,12 +141,97 @@ function scaleTypography(el, scale) {
137
141
  el.fontSize *= scale;
138
142
  if (el.type === 'latex')
139
143
  el.strokeWidth *= scale;
140
- if ('outline' in el && el.outline)
144
+ if ('outline' in el && el.outline) {
141
145
  scaleNumber(el.outline, 'width', scale);
146
+ if ((el.outline.radius ?? 0) > 1)
147
+ scaleNumber(el.outline, 'radius', scale);
148
+ }
142
149
  if ('shadow' in el && el.shadow)
143
150
  for (const key of ['h', 'v', 'blur'])
144
151
  scaleNumber(el.shadow, key, scale);
145
152
  }
153
+ /** Change document units with one factor. No reflow, rounding of geometry, or
154
+ * independent text-box constraints: every distance keeps the same proportion.
155
+ */
156
+ export function scaleDeckSlides(slides, factor) {
157
+ if (!Number.isFinite(factor) || factor <= 0)
158
+ throw new Error('Scale must be finite and positive.');
159
+ const result = structuredClone(slides);
160
+ for (const slide of result) {
161
+ if (slide.guides)
162
+ for (const guide of slide.guides)
163
+ guide.position *= factor;
164
+ for (const el of slide.elements) {
165
+ el.left *= factor;
166
+ el.top *= factor;
167
+ el.width *= factor;
168
+ if (el.type === 'line') {
169
+ const point = (p) => [p[0] * factor, p[1] * factor];
170
+ el.start = point(el.start);
171
+ el.end = point(el.end);
172
+ if (el.broken)
173
+ el.broken = point(el.broken);
174
+ if (el.broken2)
175
+ el.broken2 = point(el.broken2);
176
+ if (el.curve)
177
+ el.curve = point(el.curve);
178
+ if (el.cubic)
179
+ el.cubic = [point(el.cubic[0]), point(el.cubic[1])];
180
+ }
181
+ else
182
+ el.height *= factor;
183
+ scaleTypography(el, factor);
184
+ if ('radius' in el)
185
+ scaleNumber(el, 'radius', factor);
186
+ }
187
+ }
188
+ return result;
189
+ }
190
+ /** Smallest authored font in editable text, table cells, charts and code. */
191
+ export function minimumDeckFontSize(slides) {
192
+ const sizes = [];
193
+ const add = (n) => { if (Number.isFinite(n) && n > 0)
194
+ sizes.push(n); };
195
+ const cssSize = (value) => {
196
+ const match = /^([\d.]+)(px|pt)?$/i.exec(value.trim());
197
+ if (match)
198
+ add(Number(match[1]) * (match[2]?.toLowerCase() === 'pt' ? 4 / 3 : 1));
199
+ };
200
+ const html = (content, fallback = 16) => {
201
+ if (!content.replace(/<[^>]*>/g, '').trim())
202
+ return;
203
+ let found = false;
204
+ for (const attribute of content.matchAll(/style=(['"])(.*?)\1/gi)) {
205
+ for (const declaration of attribute[2].matchAll(/(?:^|;)\s*font-size\s*:\s*([\d.]+(?:px|pt)?)/gi)) {
206
+ cssSize(declaration[1]);
207
+ found = true;
208
+ }
209
+ }
210
+ if (!found)
211
+ add(fallback);
212
+ };
213
+ for (const slide of slides)
214
+ for (const el of slide.elements) {
215
+ if (el.type === 'text')
216
+ html(el.content);
217
+ if (el.type === 'shape' && el.text)
218
+ html(el.text.content);
219
+ if (el.type === 'table')
220
+ for (const row of el.data)
221
+ for (const cell of row) {
222
+ if (!cell.text?.trim())
223
+ continue;
224
+ if (cell.style?.fontsize)
225
+ cssSize(cell.style.fontsize);
226
+ html(cell.text, parseFloat(cell.style?.fontsize ?? '16') * (/pt$/i.test(cell.style?.fontsize ?? '') ? 4 / 3 : 1));
227
+ }
228
+ if (el.type === 'chart')
229
+ add(el.options?.fontSize ?? 12);
230
+ if (el.type === 'code')
231
+ add(el.fontSize);
232
+ }
233
+ return sizes.length ? Math.min(...sizes) : undefined;
234
+ }
146
235
  /** Resize a deck without distorting media or changing reading order.
147
236
  * Uniformly scale content and typography, redistribute available space through
148
237
  * empty tracks, and keep decorative edge shapes attached to their canvas edge.
@@ -156,6 +245,9 @@ export function resizeDeckSlides(slides, from, to) {
156
245
  const result = structuredClone(slides);
157
246
  if (from.width === to.width && from.height === to.height)
158
247
  return result;
248
+ const factor = to.width / from.width;
249
+ if (Math.abs(to.height / from.height - factor) < 1e-9)
250
+ return scaleDeckSlides(slides, factor);
159
251
  for (const slide of result) {
160
252
  // Guides describe page coordinates; resize them proportionally along their own axis.
161
253
  if (slide.guides)
@@ -19,6 +19,8 @@ export type FikaCommandType = FikaKnownCommandType | (string & {});
19
19
  export interface FikaDeckViewport {
20
20
  size: number;
21
21
  ratio: number;
22
+ /** Physical page width for export. Legacy decks default to ten inches. */
23
+ widthInches?: number;
22
24
  }
23
25
  export type FikaSlideThemePatch = Omit<Partial<SlideTheme>, 'outline' | 'shadow'> & {
24
26
  outline?: Partial<SlideTheme['outline']>;
@@ -7,6 +7,7 @@ export interface PresentationExportState {
7
7
  theme: SlideTheme;
8
8
  viewportRatio: number;
9
9
  viewportSize: number;
10
+ viewportWidthInches?: number;
10
11
  title: string;
11
12
  }
12
13
  export interface PresentationExportOptions {
@@ -16,7 +17,7 @@ export interface PresentationExportOptions {
16
17
  mediaResolver?: FikaExportMediaResolver | null;
17
18
  watermark?: FikaExportWatermarkResolver | null;
18
19
  }
19
- export declare function createPresentationExporter({ slides, theme, viewportRatio, title, viewportSize }: PresentationExportState, options?: PresentationExportOptions, job?: import("../utils/jobProgress").JobProgress): {
20
+ export declare function createPresentationExporter({ slides, theme, viewportRatio, title, viewportSize, viewportWidthInches }: PresentationExportState, options?: PresentationExportOptions, job?: import("../utils/jobProgress").JobProgress): {
20
21
  exporting: boolean;
21
22
  exportProgress: number;
22
23
  exportSlide: number;
@@ -1,4 +1,4 @@
1
- import type { Slide, SlideTheme } from '../types/slides';
1
+ import type { Slide, SlideTheme, TableCellStyle } from '../types/slides';
2
2
  export type PaintSlideOptions = {
3
3
  /** Workspace-only projection. Exports and thumbnails retain page clipping. */
4
4
  workspaceBounds?: {
@@ -22,6 +22,7 @@ export type PaintSlideOptions = {
22
22
  /** Export-owned full-resolution images; thumbnails keep their lightweight cache. */
23
23
  imageBitmaps?: ReadonlyMap<string, ImageBitmap>;
24
24
  };
25
+ export declare const tableTextHtml: (text: string, style: TableCellStyle | undefined, fallback: string, textFormat?: 'html') => string;
25
26
  /**
26
27
  * Direct Slide JSON -> final-DPR canvas paint. No DOM tree, foreignObject
27
28
  * capture, intermediate PNG, or CSS-scale resampling is involved.
@@ -25,6 +25,7 @@ export interface SlidesState {
25
25
  slideIndex: number;
26
26
  viewportSize: number;
27
27
  viewportRatio: number;
28
+ viewportWidthInches: number | undefined;
28
29
  templates: SlideTemplate[];
29
30
  importedTemplates: ImportedSlideTemplate[];
30
31
  /** Used for newly added slides after "Use on every slide". Defaults to Rise. */
@@ -35,6 +36,7 @@ export interface SlidesActions {
35
36
  setTheme: (themeProps: Partial<SlideTheme>) => void;
36
37
  setViewportSize: (size: number) => void;
37
38
  setViewportRatio: (viewportRatio: number) => void;
39
+ setViewportWidthInches: (width: number | undefined) => void;
38
40
  setSlides: (slides: Slide[], themeProps?: Partial<SlideTheme>, options?: {
39
41
  clone?: boolean;
40
42
  }) => void;
@@ -718,6 +720,7 @@ export declare const useSlidesStore: import("zustand").UseBoundStore<Omit<import
718
720
  colspan: number;
719
721
  rowspan: number;
720
722
  text: string;
723
+ textFormat?: 'html';
721
724
  style?: {
722
725
  borderTopWidth?: number;
723
726
  borderRightWidth?: number;
@@ -938,6 +941,7 @@ export declare const useSlidesStore: import("zustand").UseBoundStore<Omit<import
938
941
  slideIndex: number;
939
942
  viewportSize: number;
940
943
  viewportRatio: number;
944
+ viewportWidthInches: number | undefined;
941
945
  templates: {
942
946
  name: string;
943
947
  id: string;
@@ -1559,6 +1563,7 @@ export declare const useSlidesStore: import("zustand").UseBoundStore<Omit<import
1559
1563
  colspan: number;
1560
1564
  rowspan: number;
1561
1565
  text: string;
1566
+ textFormat?: 'html';
1562
1567
  style?: {
1563
1568
  borderTopWidth?: number;
1564
1569
  borderRightWidth?: number;
@@ -1803,6 +1808,7 @@ export declare const useSlidesStore: import("zustand").UseBoundStore<Omit<import
1803
1808
  setTheme: (themeProps: Partial<SlideTheme>) => void;
1804
1809
  setViewportSize: (size: number) => void;
1805
1810
  setViewportRatio: (viewportRatio: number) => void;
1811
+ setViewportWidthInches: (width: number | undefined) => void;
1806
1812
  setSlides: (slides: Slide[], themeProps?: Partial<SlideTheme>, options?: {
1807
1813
  clone?: boolean;
1808
1814
  }) => void;
@@ -2469,6 +2475,7 @@ export declare const useSlidesStore: import("zustand").UseBoundStore<Omit<import
2469
2475
  colspan: number;
2470
2476
  rowspan: number;
2471
2477
  text: string;
2478
+ textFormat?: 'html';
2472
2479
  style?: {
2473
2480
  borderTopWidth?: number;
2474
2481
  borderRightWidth?: number;
@@ -2689,6 +2696,7 @@ export declare const useSlidesStore: import("zustand").UseBoundStore<Omit<import
2689
2696
  slideIndex: number;
2690
2697
  viewportSize: number;
2691
2698
  viewportRatio: number;
2699
+ viewportWidthInches: number | undefined;
2692
2700
  templates: {
2693
2701
  name: string;
2694
2702
  id: string;
@@ -3310,6 +3318,7 @@ export declare const useSlidesStore: import("zustand").UseBoundStore<Omit<import
3310
3318
  colspan: number;
3311
3319
  rowspan: number;
3312
3320
  text: string;
3321
+ textFormat?: 'html';
3313
3322
  style?: {
3314
3323
  borderTopWidth?: number;
3315
3324
  borderRightWidth?: number;
@@ -3554,6 +3563,7 @@ export declare const useSlidesStore: import("zustand").UseBoundStore<Omit<import
3554
3563
  setTheme: (themeProps: Partial<SlideTheme>) => void;
3555
3564
  setViewportSize: (size: number) => void;
3556
3565
  setViewportRatio: (viewportRatio: number) => void;
3566
+ setViewportWidthInches: (width: number | undefined) => void;
3557
3567
  setSlides: (slides: Slide[], themeProps?: Partial<SlideTheme>, options?: {
3558
3568
  clone?: boolean;
3559
3569
  }) => void;
@@ -428,6 +428,8 @@ export interface TableCell {
428
428
  colspan: number;
429
429
  rowspan: number;
430
430
  text: string;
431
+ /** Omitted for legacy plain text (including literal HTML); rich cells store sanitized HTML. */
432
+ textFormat?: 'html';
431
433
  style?: TableCellStyle;
432
434
  }
433
435
  /**
@@ -6,4 +6,4 @@ export declare const copyText: (text: string) => Promise<void>;
6
6
  export declare const readClipboard: () => Promise<string>;
7
7
  export declare const pasteCustomClipboardString: (text: string) => any;
8
8
  export declare const pasteExcelClipboardString: (text: string, allowSingleColumn?: boolean) => string[][] | null;
9
- export declare const pasteHTMLTableClipboardString: (text: string) => string[][] | null;
9
+ export declare const pasteHTMLTableClipboardString: (text: string, rich?: boolean) => string[][] | null;
@@ -12,6 +12,7 @@ export interface Snapshot {
12
12
  theme?: SlideTheme;
13
13
  viewportSize?: number;
14
14
  viewportRatio?: number;
15
+ viewportWidthInches?: number;
15
16
  templates?: SlideTemplate[];
16
17
  slides?: Slide[];
17
18
  patches?: Patch[];
@@ -1,7 +1,9 @@
1
1
  import { type Emitter } from 'mitt';
2
+ import type { TableTextAttrs } from './prosemirror/table';
2
3
  export declare const enum EmitterEvents {
3
4
  RICH_TEXT_COMMAND = "RICH_TEXT_COMMAND",
4
5
  TABLE_COMMAND = "TABLE_COMMAND",
6
+ TABLE_TEXT_ATTRS = "TABLE_TEXT_ATTRS",
5
7
  SYNC_RICH_TEXT_ATTRS_TO_STORE = "SYNC_RICH_TEXT_ATTRS_TO_STORE",
6
8
  OPEN_CHART_DATA_EDITOR = "OPEN_CHART_DATA_EDITOR",
7
9
  OPEN_LATEX_EDITOR = "OPEN_LATEX_EDITOR",
@@ -26,6 +28,7 @@ export interface TableCommand {
26
28
  /** Request to open the inline-math (MathLive) editor for a math node in a text element. */
27
29
  export interface OpenInlineMathPayload {
28
30
  elementId: string;
31
+ cellId?: string;
29
32
  /** Document position immediately before the math node (for `setNodeMarkup`). */
30
33
  pos: number;
31
34
  latex: string;
@@ -34,6 +37,7 @@ export interface OpenInlineMathPayload {
34
37
  /** Result of editing an inline-math node, applied back to its text element. */
35
38
  export interface ApplyInlineMathPayload {
36
39
  elementId: string;
40
+ cellId?: string;
37
41
  pos: number;
38
42
  latex: string;
39
43
  html: string;
@@ -42,6 +46,10 @@ export interface ApplyInlineMathPayload {
42
46
  type Events = {
43
47
  [EmitterEvents.RICH_TEXT_COMMAND]: RichTextCommand;
44
48
  [EmitterEvents.TABLE_COMMAND]: TableCommand;
49
+ [EmitterEvents.TABLE_TEXT_ATTRS]: {
50
+ elementId: string;
51
+ attrs: TableTextAttrs;
52
+ };
45
53
  [EmitterEvents.SYNC_RICH_TEXT_ATTRS_TO_STORE]: void;
46
54
  [EmitterEvents.OPEN_CHART_DATA_EDITOR]: void;
47
55
  [EmitterEvents.OPEN_LATEX_EDITOR]: void;
@@ -11,6 +11,7 @@ export interface SourcePackageDocument {
11
11
  theme: unknown;
12
12
  viewportSize: number;
13
13
  viewportRatio: number;
14
+ viewportWidthInches?: number;
14
15
  }
15
16
  /** Certify only a fully applied import; retaining bytes alone is not sufficient. */
16
17
  export declare function certifySourcePackageDocument(packageId: string, document: SourcePackageDocument): void;
@@ -0,0 +1,26 @@
1
+ import { Schema, type Node as PMNode } from 'prosemirror-model';
2
+ import { EditorState, type Transaction } from 'prosemirror-state';
3
+ import type { TableCell, TableCellStyle } from '../../types/slides';
4
+ export declare const tableSchema: Schema<"doc" | "hard_break" | "math" | "paragraph" | "text", "code" | "em" | "fontname" | "fontsize" | "forecolor" | "link" | "strikethrough" | "strong" | "subscript" | "superscript" | "underline">;
5
+ export declare const plainTextToTableHTML: (text: string) => string;
6
+ declare const markNames: {
7
+ readonly bold: 'strong';
8
+ readonly em: 'em';
9
+ readonly underline: 'underline';
10
+ readonly strikethrough: 'strikethrough';
11
+ readonly color: 'forecolor';
12
+ readonly fontsize: 'fontsize';
13
+ readonly fontname: 'fontname';
14
+ };
15
+ export type TableTextAttrs = Pick<TableCellStyle, keyof typeof markNames | 'align'> & {
16
+ clear?: boolean;
17
+ };
18
+ /** Convert complete delimited formulas, preserving surrounding text and marks. */
19
+ export declare function typesetTableMath(tr: Transaction): Transaction;
20
+ export declare function parseTableText(cell: Pick<TableCell, 'text' | 'textFormat' | 'style'>): PMNode;
21
+ /** Keep only math source in storage; generated glyph markup belongs to the view. */
22
+ export declare function serializeTableText(doc: PMNode, renderMath?: boolean): string;
23
+ export declare function setTableTextAttrs(state: EditorState, attrs: TableTextAttrs, all?: boolean): Transaction;
24
+ export declare function getTableTextAttrs(state: EditorState, defaults?: TableCellStyle): TableTextAttrs;
25
+ export declare function updateTableCellTextAttrs(cell: TableCell, attrs: TableTextAttrs): TableCell;
26
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { EditorState } from 'prosemirror-state';
2
+ import type { TableTextAttrs } from './table';
3
+ export interface TableEditorSession {
4
+ state: EditorState;
5
+ value: string;
6
+ }
7
+ export interface TableEditorHandle {
8
+ cellId: string;
9
+ getAttrs: () => TableTextAttrs;
10
+ applyAttrs: (attrs: TableTextAttrs) => {
11
+ text: string;
12
+ wholeCell: boolean;
13
+ } | null;
14
+ atBoundary: (boundary: 'start' | 'end') => boolean;
15
+ }
16
+ export declare const getTableEditor: (elementId: string) => TableEditorHandle;
17
+ export declare function registerTableEditor(elementId: string, editor: TableEditorHandle): () => void;
@@ -3,6 +3,12 @@ export interface SlideCanvas {
3
3
  width: number;
4
4
  height: number;
5
5
  }
6
+ /** Change document units with one factor. No reflow, rounding of geometry, or
7
+ * independent text-box constraints: every distance keeps the same proportion.
8
+ */
9
+ export declare function scaleDeckSlides(slides: readonly Slide[], factor: number): Slide[];
10
+ /** Smallest authored font in editable text, table cells, charts and code. */
11
+ export declare function minimumDeckFontSize(slides: readonly Slide[]): number | undefined;
6
12
  /** Resize a deck without distorting media or changing reading order.
7
13
  * Uniformly scale content and typography, redistribute available space through
8
14
  * empty tracks, and keep decorative edge shapes attached to their canvas edge.
@@ -8,3 +8,8 @@ export declare const getSearchText: (root: Node) => {
8
8
  }[];
9
9
  };
10
10
  export declare const getSearchHtmlText: (html: string) => string;
11
+ /** Apply visible-text ranges backwards so inline formatting and math remain intact. */
12
+ export declare const replaceSearchHtmlRanges: (html: string, ranges: {
13
+ start: number;
14
+ end: number;
15
+ }[], replacement: string) => string;
@@ -9,4 +9,5 @@ export declare function applyTableCellStyles(style: Partial<TableCellStyle>, opt
9
9
  cells?: string[];
10
10
  allCells?: boolean;
11
11
  history?: boolean;
12
+ clearText?: boolean;
12
13
  }): boolean;
@@ -1,6 +1,9 @@
1
1
  import type pptxgen from 'pptxgenjs-plus';
2
2
  import { type OmmlRunStyle } from './latexToOmml';
3
- /** Cells store plain text with TeX delimiters, unlike rich text elements.
3
+ import type { TableCell } from '../types/slides';
4
+ /** Rich cells use the same document as editing, including atomic native equations. */
5
+ export declare function richTableCellExportText(cell: TableCell, fallback: OmmlRunStyle, ratioPx2Pt: number): pptxgen.TextProps[];
6
+ /** Legacy cells store plain text with TeX delimiters.
4
7
  * Use the display parser's source boundaries and keep equations as editable
5
8
  * OMML runs. Never interpret ordinary cell text as HTML or Markdown.
6
9
  * Call after prepareLatexToOmml, just like the other PPTX math exporters.
@@ -1,2 +1,6 @@
1
- declare const TextStyleControls: import("react").MemoExoticComponent<() => import("react").JSX.Element>;
1
+ import type { TableTextAttrs } from '../../../../../utils/prosemirror/table';
2
+ declare const TextStyleControls: import("react").MemoExoticComponent<(props?: {
3
+ attrs?: TableTextAttrs;
4
+ onCommand?: (command: string, value?: string) => void;
5
+ }) => import("react").JSX.Element>;
2
6
  export default TextStyleControls;
@@ -11,7 +11,7 @@ export type IEditableTableProps = {
11
11
  editable?: boolean;
12
12
  onMouseDown?: (e: ReactMouseEvent) => void;
13
13
  } & {
14
- onChange?: (payload: TableCell[][]) => void;
14
+ onChange?: (payload: TableCell[][], ignoreHistory?: boolean) => void;
15
15
  onChangeColWidths?: (payload: number[]) => void;
16
16
  onChangeSelectedCells?: (payload: string[]) => void;
17
17
  };
@@ -0,0 +1,14 @@
1
+ import { type CSSProperties } from 'react';
2
+ import type { TableCell } from '../../../../types/slides';
3
+ import { type TableEditorSession } from '../../../../utils/prosemirror/tableEditor';
4
+ type Props = {
5
+ cell: TableCell;
6
+ elementId: string;
7
+ sessions: Map<string, TableEditorSession>;
8
+ className?: string;
9
+ style?: CSSProperties;
10
+ onUpdateValue: (value: string, ignoreHistory?: boolean) => void;
11
+ onInsertExcelData: (data: string[][], rich?: boolean) => void;
12
+ };
13
+ declare const TableCellEditor: import("react").MemoExoticComponent<(props: Props) => import("react").JSX.Element>;
14
+ export default TableCellEditor;
@@ -8,7 +8,7 @@ export declare const getCellStyle: (outline: PPTElementOutline, style?: TableCel
8
8
  /**
9
9
  * Compute table cell text layout styles from optional cell style.
10
10
  */
11
- export declare const getTextStyle: (_cellMinHeight: number, style?: TableCellStyle) => any;
11
+ export declare const getTextStyle: (_cellMinHeight: number, style?: TableCellStyle, rich?: boolean) => any;
12
12
  export declare const escapeCellText: (text: string) => string;
13
13
  /**
14
14
  * Render a table cell's stored source for display. Plain text is HTML-escaped
@@ -20,4 +20,4 @@ export declare const escapeCellText: (text: string) => string;
20
20
  * MathLive finishes loading (kicked off lazily here on first math encounter);
21
21
  * until then math segments fall back to their literal LaTeX source.
22
22
  */
23
- export declare const formatText: (text: string) => string;
23
+ export declare const formatText: (text: string, textFormat?: 'html') => string;
@@ -416,6 +416,8 @@ if (text.ok && text.data) {
416
416
 
417
417
  Domain helpers cover specialized model areas without requiring store access:
418
418
 
419
+ Table cells default to literal plain text, including TeX delimiters. Set `textFormat: 'html'` alongside `text` for rich cells, for example `{ textFormat: 'html', text: '<p>Area <strong>A</strong>: <span class="fika-math" data-latex="x^2"></span></p>' }`. Rich cells preserve inline formatting and editable equations through the editor and PowerPoint export/import. When replacing cell text with `tables.setCell`, include `textFormat` each time; omitting it selects plain text. `tables.setCellStyle` formats the whole cell, while editor controls format the selected text when a selection exists.
420
+
419
421
  ```ts
420
422
  await controller.tables.setCell(tableElementId, 0, 1, { text: 'Hypothesis' }, { slideId })
421
423
  await controller.charts.setData(chartElementId, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fika-editor",
3
- "version": "3.5.10",
3
+ "version": "3.6.0",
4
4
  "description": "Fika presentation editor embed bundle with a typed agentic bridge.",
5
5
  "type": "module",
6
6
  "main": "dist/embed/fika-embed.js",
@@ -1 +0,0 @@
1
- export const __rspack_esm_id=7463;export const __rspack_esm_ids=[7463];export const __webpack_modules__={99418(e,t,n){let r;function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}n.r(t);let i=Object.entries,a=Object.setPrototypeOf,l=Object.isFrozen,c=Object.getPrototypeOf,u=Object.getOwnPropertyDescriptor,s=Object.freeze,f=Object.seal,p=Object.create,m="u">typeof Reflect&&Reflect,d=m.apply,h=m.construct;s||(s=function(e){return e}),f||(f=function(e){return e}),d||(d=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return e.apply(t,r)}),h||(h=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});let g=z(Array.prototype.forEach),y=z(Array.prototype.lastIndexOf),b=z(Array.prototype.pop),T=z(Array.prototype.push),S=z(Array.prototype.splice),A=Array.isArray,_=z(String.prototype.toLowerCase),E=z(String.prototype.toString),w=z(String.prototype.match),v=z(String.prototype.replace),O=z(String.prototype.indexOf),N=z(String.prototype.trim),x=z(Number.prototype.toString),D=z(Boolean.prototype.toString),k="u"<typeof BigInt?null:z(BigInt.prototype.toString),R="u"<typeof Symbol?null:z(Symbol.prototype.toString),C=z(Object.prototype.hasOwnProperty),I=z(Object.prototype.toString),L=z(RegExp.prototype.test),M=(eb=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return h(eb,t)});function z(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return d(e,t,r)}}function P(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_;if(a&&a(e,null),!A(t))return e;let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){let e=n(o);e!==o&&(l(t)||(t[r]=e),o=e)}e[o]=!0}return e}function U(e){let t=p(null);for(let r of i(e)){var n=function(e){if(Array.isArray(e))return e}(r)||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,o,i,a=[],l=!0,c=!1;try{o=(t=t.call(e)).next,!1;for(;!(l=(n=o.call(t)).done)&&(a.push(n.value),2!==a.length);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw r}}return a}}(r)||function(e){if(e){if("string"==typeof e)return o(e,2);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?o(e,2):void 0}}(r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();let i=n[0],a=n[1];C(e,i)&&(A(a)?t[i]=function(e){for(let t=0;t<e.length;t++)C(e,t)||(e[t]=null);return e}(a):a&&"object"==typeof a&&a.constructor===Object?t[i]=U(a):t[i]=a)}return t}function F(e,t){for(;null!==e;){let n=u(e,t);if(n){if(n.get)return z(n.get);if("function"==typeof n.value)return z(n.value)}e=c(e)}return function(){return null}}let H=s(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),j=s(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),B=s(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),W=s(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Y=s(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),G=s(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),q=s(["#text"]),$=s(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),X=s(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),K=s(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),V=s(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Z=f(/{{[\w\W]*|^[\w\W]*}}/g),J=f(/<%[\w\W]*|^[\w\W]*%>/g),Q=f(/\${[\w\W]*/g),ee=f(/^data-[\-\w.\u00B7-\uFFFF]+$/),et=f(/^aria-[\-\w]+$/),en=f(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),er=f(/^(?:\w+script|data):/i),eo=f(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ei=f(/^html$/i),ea=f(/^[a-z][.\w]*(-[.\w]+)+$/i),el=f(/<[/\w!]/g),ec=f(/<[/\w]/g),eu=f(/<\/no(script|embed|frames)/i),es=f(/\/>/i),ef=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],ep=s(P({},ef)),em=(r={},g(ef,e=>{r[e]=f(RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),s(r)),ed=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null,r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}},eh=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},eg=function(e,t,n,r){return C(e,t)&&A(e[t])?P(r.base?U(r.base):{},e[t],r.transform):n},ey=function(e,t,n){let r=C(e,t)?e[t]:void 0;return r&&"object"==typeof r?U(r):n()};var eb,eT=function e(){let t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"u"<typeof window?null:window,o=t=>e(t);if(o.version="3.4.14",o.removed=[],!r||!r.document||9!==r.document.nodeType||!r.Element)return o.isSupported=!1,o;let a=r.document,l=a,c=l.currentScript;r.DocumentFragment;let u=r.HTMLTemplateElement,m=r.Node,d=r.Element,h=r.NodeFilter;void 0===r.NamedNodeMap&&(r.NamedNodeMap||r.MozNamedAttrMap),r.HTMLFormElement;let z=r.DOMParser,ef=r.trustedTypes,eb=d.prototype,eT=F(eb,"cloneNode"),eS=F(eb,"remove"),eA=F(eb,"nextSibling"),e_=F(eb,"childNodes"),eE=F(eb,"parentNode"),ew=F(eb,"shadowRoot"),ev=F(eb,"attributes"),eO=m&&m.prototype?F(m.prototype,"nodeType"):null,eN=m&&m.prototype?F(m.prototype,"nodeName"):null,ex=m&&m.prototype?F(m.prototype,"ownerDocument"):null,eD=function(e){return eO?eO(e):e.nodeType},ek=function(e){return eN?eN(e):e.nodeName};if("function"==typeof u){let e=a.createElement("template");e.content&&e.content.ownerDocument&&(a=e.content.ownerDocument)}let eR="",eC=!1,eI=0,eL=function(){if(eI>0)throw M('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},eM=function(e){eL(),eI++;try{return t.createHTML(e)}finally{eI--}},ez=function(e){eL(),eI++;try{return t.createScriptURL(e)}finally{eI--}},eP=a,eU=eP.implementation,eF=eP.createNodeIterator,eH=eP.createDocumentFragment,ej=eP.getElementsByTagName,eB=l.importNode,eW=eh();o.isSupported="function"==typeof i&&"function"==typeof eE&&eU&&void 0!==eU.createHTMLDocument;let eY=en,eG=null,eq=P({},[...H,...j,...B,...Y,...q]),e$=null,eX=P({},[...$,...X,...K,...V]),eK=Object.seal(p(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),eV=null,eZ=null,eJ=Object.seal(p(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),eQ=!0,e0=!0,e1=!1,e2=!0,e3=!1,e9=!0,e8=!1,e4=!1,e6=null,e7=null,e5=!1,te=!1,tt=!1,tn=!1,tr=!0,to=!1,ti="user-content-",ta=!0,tl=!1,tc={},tu=null,ts=P({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),tf=null,tp=P({},["audio","video","img","source","image","track"]),tm=null,td=P({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),th="http://www.w3.org/1998/Math/MathML",tg="http://www.w3.org/2000/svg",ty="http://www.w3.org/1999/xhtml",tb=ty,tT=!1,tS=null,tA=P({},[th,tg,ty],E),t_=s(["mi","mo","mn","ms","mtext"]),tE=P({},t_),tw=s(["annotation-xml"]),tv=P({},tw),tO=P({},["title","style","font","a","script"]),tN=null,tx=["application/xhtml+xml","text/html"],tD=null,tk=null,tR=a.createElement("form"),tC=function(e){return e instanceof RegExp||e instanceof Function},tI=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(tk&&tk===e)return;e&&"object"==typeof e||(e={}),e=U(e),tD="application/xhtml+xml"===(tN=-1===tx.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE)?E:_,eG=eg(e,"ALLOWED_TAGS",eq,{transform:tD}),e$=eg(e,"ALLOWED_ATTR",eX,{transform:tD}),tS=eg(e,"ALLOWED_NAMESPACES",tA,{transform:E}),tm=eg(e,"ADD_URI_SAFE_ATTR",td,{transform:tD,base:td}),tf=eg(e,"ADD_DATA_URI_TAGS",tp,{transform:tD,base:tp}),tu=eg(e,"FORBID_CONTENTS",ts,{transform:tD}),eV=eg(e,"FORBID_TAGS",U({}),{transform:tD}),eZ=eg(e,"FORBID_ATTR",U({}),{transform:tD}),tc=!!C(e,"USE_PROFILES")&&(e.USE_PROFILES&&"object"==typeof e.USE_PROFILES?U(e.USE_PROFILES):e.USE_PROFILES),eQ=!1!==e.ALLOW_ARIA_ATTR,e0=!1!==e.ALLOW_DATA_ATTR,e1=e.ALLOW_UNKNOWN_PROTOCOLS||!1,e2=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,e3=e.SAFE_FOR_TEMPLATES||!1,e9=!1!==e.SAFE_FOR_XML,e8=e.WHOLE_DOCUMENT||!1,te=e.RETURN_DOM||!1,tt=e.RETURN_DOM_FRAGMENT||!1,tn=e.RETURN_TRUSTED_TYPE||!1,e5=e.FORCE_BODY||!1,tr=!1!==e.SANITIZE_DOM,to=e.SANITIZE_NAMED_PROPS||!1,ta=!1!==e.KEEP_CONTENT,tl=e.IN_PLACE||!1,eY=!function(e){try{return L(e,""),!0}catch(e){return!1}}(e.ALLOWED_URI_REGEXP)?en:e.ALLOWED_URI_REGEXP,tb="string"==typeof e.NAMESPACE?e.NAMESPACE:ty,tE=ey(e,"MATHML_TEXT_INTEGRATION_POINTS",()=>P({},t_)),tv=ey(e,"HTML_INTEGRATION_POINTS",()=>P({},tw));let r=ey(e,"CUSTOM_ELEMENT_HANDLING",()=>p(null));if(eK=p(null),C(r,"tagNameCheck")&&tC(r.tagNameCheck)&&(eK.tagNameCheck=r.tagNameCheck),C(r,"attributeNameCheck")&&tC(r.attributeNameCheck)&&(eK.attributeNameCheck=r.attributeNameCheck),C(r,"allowCustomizedBuiltInElements")&&"boolean"==typeof r.allowCustomizedBuiltInElements&&(eK.allowCustomizedBuiltInElements=r.allowCustomizedBuiltInElements),f(eK),e3&&(e0=!1),tt&&(te=!0),tc&&(eG=P({},q),e$=p(null),!0===tc.html&&(P(eG,H),P(e$,$)),!0===tc.svg&&(P(eG,j),P(e$,X),P(e$,V)),!0===tc.svgFilters&&(P(eG,B),P(e$,X),P(e$,V)),!0===tc.mathMl&&(P(eG,Y),P(e$,K),P(e$,V))),eJ.tagCheck=null,eJ.attributeCheck=null,C(e,"ADD_TAGS")&&("function"==typeof e.ADD_TAGS?eJ.tagCheck=e.ADD_TAGS:A(e.ADD_TAGS)&&(eG===eq&&(eG=U(eG)),P(eG,e.ADD_TAGS,tD))),C(e,"ADD_ATTR")&&("function"==typeof e.ADD_ATTR?eJ.attributeCheck=e.ADD_ATTR:A(e.ADD_ATTR)&&(e$===eX&&(e$=U(e$)),P(e$,e.ADD_ATTR,tD))),C(e,"ADD_FORBID_CONTENTS")&&A(e.ADD_FORBID_CONTENTS)&&(tu===ts&&(tu=U(tu)),P(tu,e.ADD_FORBID_CONTENTS,tD)),ta&&(eG["#text"]=!0),e8&&P(eG,["html","head","body"]),eG.table&&(P(eG,["tbody"]),delete eV.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw M('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw M('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let n=t;t=e.TRUSTED_TYPES_POLICY;try{eR=eM("")}catch(e){throw t=n,e}}else null===e.TRUSTED_TYPES_POLICY?(t=void 0,eR=""):(void 0===t&&(eC||(n=ed(ef,c),eC=!0),t=n),t&&"string"==typeof eR&&(eR=eM("")));s&&s(e),tk=e},tL=P({},[...j,...B,...W]),tM=P({},[...Y,...G]),tz=function(e){var t,n,r;let o=eE(e);o&&o.tagName||(o={namespaceURI:tb,tagName:"template"});let i=_(e.tagName),a=_(o.tagName);return!!tS[e.namespaceURI]&&(e.namespaceURI===tg?(t=o).namespaceURI===ty?"svg"===i:t.namespaceURI===th?"svg"===i&&("annotation-xml"===a||tE[a]):!!tL[i]:e.namespaceURI===th?(n=o).namespaceURI===ty?"math"===i:n.namespaceURI===tg?"math"===i&&tv[a]:!!tM[i]:e.namespaceURI===ty?((r=o).namespaceURI!==tg||!!tv[a])&&(r.namespaceURI!==th||!!tE[a])&&!tM[i]&&(tO[i]||!tL[i]):"application/xhtml+xml"===tN&&!!tS[e.namespaceURI])},tP=function(e){T(o.removed,{element:e});try{eE(e).removeChild(e)}catch(t){if(eS(e),!eE(e))throw M("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},tU=function(e,t,n){try{e.removeAttributeNode(t)}catch(t){try{e.removeAttribute(n)}catch(e){}}},tF=function(e){tB(e);let t=e_(e);if(t){let e=[];g(t,t=>{T(e,t)}),g(e,e=>{try{eS(e)}catch(e){}})}let n=ev(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],o=r&&r.name;"string"==typeof o&&tU(e,r,o)}},tH=function(e,t,n){if(!n)try{n=t.getAttributeNode(e)}catch(e){n=null}T(o.removed,{attribute:n||null,from:t});try{n?t.removeAttributeNode(n):t.removeAttribute(e)}catch(n){try{t.removeAttribute(e)}catch(e){}}if("is"===e)if(te||tt)try{tP(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},tj=function(e){let t=ev(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],o=r&&r.name;"string"!=typeof o||e$[tD(o)]||tU(e,r,o)}},tB=function(e){let t=[e];for(;t.length>0;){let e=t.pop();1===eD(e)&&tj(e);let n=e_(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},tW=function(e,t){return!!e9&&("patchsrc"===e||"for"===e&&"label"!==t&&"output"!==t)},tY=function(e){if(!e9)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=eD(e);if(7===n||8===n&&L(ec,e.data)){try{eS(e)}catch(e){}continue}if(1===n){let t=tD(ek(e));try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&tW("for",t)&&e.removeAttribute("for")}catch(e){}}let r=e_(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},tG=function(e){let n=null,r=null;if(e5)e="<remove></remove>"+e;else{let t=w(e,/^[\r\n\t ]+/);r=t&&t[0]}"application/xhtml+xml"===tN&&tb===ty&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let o=t?eM(e):e;if(tb===ty)try{n=new z().parseFromString(o,tN)}catch(e){}if(!n||!n.documentElement){n=eU.createDocument(tb,"template",null);try{n.documentElement.innerHTML=tT?eR:o}catch(e){}}let i=n.body||n.documentElement;return(e&&r&&i.insertBefore(a.createTextNode(r),i.childNodes[0]||null),tb===ty)?ej.call(n,e8?"html":"body")[0]:e8?n.documentElement:i},tq=function(e){let t=ex?ex(e):e.ownerDocument;return eF.call(t||e,e,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},t$=function(e){return e=v(e,Z," "),e=v(e,J," "),e=v(e,Q," ")},tX=function(e){var t;e.normalize();let n=ex?ex(e):e.ownerDocument,r=eF.call(n||e,e,h.SHOW_TEXT|h.SHOW_COMMENT|h.SHOW_CDATA_SECTION|h.SHOW_PROCESSING_INSTRUCTION,null),o=r.nextNode();for(;o;)o.data=t$(o.data),o=r.nextNode();let i=null==(t=e.querySelectorAll)?void 0:t.call(e,"template");i&&g(i,e=>{tV(e.content)&&tX(e.content)})},tK=function(e){let t=eN?eN(e):null;return"string"==typeof t&&"form"===tD(t)&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||e.attributes!==ev(e)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes||e.nodeType!==eO(e)||e.childNodes!==e_(e))},tV=function(e){if(!eO||"object"!=typeof e||null===e)return!1;try{return 11===eO(e)}catch(e){return!1}},tZ=function(e){if(!eO||"object"!=typeof e||null===e)return!1;try{return"number"==typeof eO(e)}catch(e){return!1}};function tJ(e,t,n){0!==e.length&&g(e,e=>{e.call(o,t,n,tk)})}let tQ=function(e,t){if(e instanceof RegExp)return L(e,t);if(e instanceof Function){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return!!e(t,...r)}return!1},t0=function(e,t,n){if(!eV[t]&&t4(t)&&tQ(eK.tagNameCheck,t))return!1;if(ta&&!tu[t]){let t=eE(e),r=e_(e);if(r&&t){let o=r.length;for(let i=o-1;i>=0;--i){let o=e===n?eT(r[i],!0):r[i];t.insertBefore(o,eA(e))}}}return tP(e),!0},t1=function(e,t,n,r){return 0===e.length?t:t===n||t===r?U(t):t},t2=function(e,t){return e!==t&&null===eE(e)&&(tl&&tB(e),!0)},t3=function(e,t){if(tJ(eW.beforeSanitizeElements,e,null),t2(e,t))return!0;if(tK(e))return tP(e),!0;let n=tD(ek(e));if(eG=t1(eW.uponSanitizeElement,eG,eq,e6),tJ(eW.uponSanitizeElement,e,{tagName:n,allowedTags:eG}),t2(e,t))return!0;if(e9&&e.hasChildNodes()&&!tZ(e.firstElementChild)&&L(el,e.textContent)&&L(el,e.innerHTML)||e9&&e.namespaceURI===ty&&ep[n]&&(tZ(e.firstElementChild)||"string"==typeof e.textContent&&L(em[n],e.textContent))||7===e.nodeType||e9&&8===e.nodeType&&L(ec,e.data))return tP(e),!0;if(eV[n]||!(eJ.tagCheck instanceof Function&&eJ.tagCheck(n))&&!eG[n]){let r=t0(e,n,t);return!1===r&&tJ(eW.afterSanitizeElements,e,null),r}if(1===eD(e)&&!tz(e)||("noscript"===n||"noembed"===n||"noframes"===n)&&L(eu,e.innerHTML))return tP(e),!0;if(e3&&3===e.nodeType){let t=t$(e.textContent);e.textContent!==t&&(T(o.removed,{element:e.cloneNode()}),e.textContent=t)}return tJ(eW.afterSanitizeElements,e,null),!1},t9=function(e,t,n){if(eZ[t]||tW(t,e)||tr&&("id"===t||"name"===t)&&(n in a||n in tR))return!1;let r=e$[t]||eJ.attributeCheck instanceof Function&&eJ.attributeCheck(t,e);return!!(e0&&L(ee,t)||eQ&&L(et,t))||(r?!(!(tm[t]||L(eY,v(n,eo,"")))&&("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==O(n,"data:")||!tf[e])&&(!e1||L(er,v(n,eo,""))))||!n:t4(e)&&tQ(eK.tagNameCheck,e)&&tQ(eK.attributeNameCheck,t,e)||"is"===t&&eK.allowCustomizedBuiltInElements&&tQ(eK.tagNameCheck,n))},t8=P({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),t4=function(e){return!t8[_(e)]&&L(ea,e)},t6=function(e,n,r,o){if(t&&"object"==typeof ef&&"function"==typeof ef.getAttributeType&&!r)switch(ef.getAttributeType(e,n)){case"TrustedHTML":return eM(o);case"TrustedScriptURL":return ez(o)}return o},t7=function(e,t,n,r){try{n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),tK(e)?tP(e):b(o.removed)}catch(n){tH(t,e)}},t5=function(e){tJ(eW.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||tK(e))return;let n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:e$=t1(eW.uponSanitizeAttribute,e$,eX,e7),forceKeepAttr:void 0},r=t.length,o=tD(e.nodeName);for(;r--;){let i=t[r],a=i.name,l=i.namespaceURI,c=i.value,u=tD(a),s="value"===a?c:N(c);if(n.attrName=u,n.attrValue=s,n.keepAttr=!0,n.forceKeepAttr=void 0,tJ(eW.uponSanitizeAttribute,e,n),s=n.attrValue,to&&("id"===u||"name"===u)&&0!==O(s,ti)&&(tH(a,e,i),s=ti+s),e9&&L(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,s)||"attributename"===u&&w(s,"href")){tH(a,e,i);continue}if(!n.forceKeepAttr){if(!n.keepAttr||!e2&&L(es,s)||(e3&&(s=t$(s)),!t9(o,u,s))){tH(a,e,i);continue}(s=t6(o,u,l,s))!==c&&t7(e,a,l,s)}}tJ(eW.afterSanitizeAttributes,e,null)},ne=function(e){let t=null,n=tq(e);for(tJ(eW.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(tJ(eW.uponSanitizeShadowNode,t,null),t3(t,e),t5(t),tV(t.content)&&ne(t.content),1===eD(t)){let e=ew(t);tV(e)&&(nt(e),ne(e))}tJ(eW.afterSanitizeShadowDOM,e,null)},nt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){ne(e.shadow);continue}let n=e.node,r=1===eD(n),o=e_(n);if(o)for(let e=o.length-1;e>=0;--e)t.push({node:o[e],shadow:null});if(r){let e=eN?eN(n):null;if("string"==typeof e&&"template"===tD(e)){let e=n.content;tV(e)&&t.push({node:e,shadow:null})}}if(r){let e=ew(n);tV(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return o.sanitize=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,c=null;if((tT=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!tZ(e)&&"string"!=typeof(e=function(e){switch(typeof e){case"string":return e;case"number":return x(e);case"boolean":return D(e);case"bigint":return k?k(e):"0";case"symbol":return R?R(e):"Symbol()";case"undefined":default:return I(e);case"function":case"object":{if(null===e)return I(e);let t=F(e,"toString");if("function"==typeof t){let n=t(e);return"string"==typeof n?n:I(n)}return I(e)}}}(e)))throw M("dirty is not a string, aborting");if(!o.isSupported)return e;e4?(eG=e6,e$=e7):tI(n),(eW.uponSanitizeElement.length>0||eW.uponSanitizeAttribute.length>0)&&(eG=U(eG)),eW.uponSanitizeAttribute.length>0&&(e$=U(e$)),o.removed=[];let u=tl&&"string"!=typeof e&&tZ(e);if(u){tY(e);let t=ek(e);if("string"==typeof t){let n=tD(t);if(!eG[n]||eV[n])throw tF(e),M("root node is forbidden and cannot be sanitized in-place")}if(tK(e))throw tF(e),M("root node is clobbered and cannot be sanitized in-place");try{nt(e)}catch(t){throw tF(e),t}}else if(tZ(e))1===(i=(r=tG("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i),nt(i);else{if(!te&&!e3&&!e8&&-1===e.indexOf("<"))return t&&tn?eM(e):e;if(!(r=tG(e)))return te?null:tn?eR:""}r&&e5&&tP(r.firstChild);let s=u?e:r;try{let e=tq(s);for(;a=e.nextNode();)t3(a,s),t5(a),tV(a.content)&&ne(a.content)}catch(t){throw u&&(tF(e),g(o.removed,e=>{e.element&&tB(e.element)})),t}if(u)return g(o.removed,e=>{e.element&&tB(e.element)}),e3&&tX(e),e;if(te){if(e3&&tX(r),tt)for(c=eH.call(r.ownerDocument);r.firstChild;)c.appendChild(r.firstChild);else c=r;return(e$.shadowroot||e$.shadowrootmode)&&(c=eB.call(l,c,!0)),c}let f=e8?r.outerHTML:r.innerHTML;return e8&&eG["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&L(ei,r.ownerDocument.doctype.name)&&(f="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+f),e3&&(f=t$(f)),t&&tn?eM(f):f},o.setConfig=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};tI(e),e4=!0,e6=eG,e7=e$},o.clearConfig=function(){tk=null,e4=!1,e6=null,e7=null,t=n,eR=""},o.isValidAttribute=function(e,t,n){return tk||tI({}),t9(tD(e),tD(t),n)},o.addHook=function(e,t){"function"!=typeof t||C(eW,e)&&T(eW[e],t)},o.removeHook=function(e,t){if(C(eW,e)){if(void 0!==t){let n=y(eW[e],t);return -1===n?void 0:S(eW[e],n,1)[0]}return b(eW[e])}},o.removeHooks=function(e){C(eW,e)&&(eW[e]=[])},o.removeAllHooks=function(){eW=eh()},o}();n.d(t,{default:()=>eT})}};
@@ -1,13 +0,0 @@
1
- import { type CSSProperties } from 'react';
2
- export type TableCellCommitSource = 'blur' | 'unmount';
3
- export type ICustomTextareaProps = {
4
- value?: string;
5
- className?: string;
6
- style?: CSSProperties;
7
- } & {
8
- onUpdateValue?: (payload: string) => void;
9
- onCommitValue?: (payload: string, source?: TableCellCommitSource) => void;
10
- onInsertExcelData?: (payload: string[][]) => void;
11
- };
12
- declare const CustomTextarea: import("react").MemoExoticComponent<(props: ICustomTextareaProps) => import("react").JSX.Element>;
13
- export default CustomTextarea;