@floegence/floe-webapp-core 0.86.42 → 0.86.44

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/pptx.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ import { type SlideHandle } from '@aiden0z/pptx-renderer/browser';
2
+ export interface PptxSurfaceOptions {
3
+ signal?: AbortSignal;
4
+ onNodeError?: (nodeId: string, error: unknown) => void;
5
+ }
6
+ /** A read-only presentation. External relationships never acquire network authority. */
7
+ export declare class PptxDocumentSurface {
8
+ private readonly viewer;
9
+ readonly hasExternalLinks: boolean;
10
+ private readonly handles;
11
+ private disposed;
12
+ private constructor();
13
+ get pageCount(): number;
14
+ get pageWidth(): number;
15
+ get pageHeight(): number;
16
+ static open(bytes: Uint8Array<ArrayBuffer>, options?: PptxSurfaceOptions): Promise<PptxDocumentSurface>;
17
+ renderPage(index: number, container: HTMLElement): SlideHandle;
18
+ dispose(): void;
19
+ }
package/dist/pptx.js ADDED
@@ -0,0 +1,100 @@
1
+ import g from "./node_modules/.pnpm/dompurify@3.4.16/node_modules/dompurify/dist/purify.es.js";
2
+ import { parseZip as p, buildPresentation as m, PptxViewer as v, RECOMMENDED_ZIP_LIMITS as E } from "./node_modules/.pnpm/@aiden0z_pptx-renderer@1.3.0_pdfjs-dist@6.3.289/node_modules/@aiden0z/pptx-renderer/dist/aiden0z-pptx-renderer.browser.es.js";
3
+ class f {
4
+ constructor(r, s) {
5
+ this.viewer = r, this.hasExternalLinks = s;
6
+ }
7
+ viewer;
8
+ hasExternalLinks;
9
+ handles = /* @__PURE__ */ new Set();
10
+ disposed = !1;
11
+ get pageCount() {
12
+ return this.viewer.slideCount;
13
+ }
14
+ get pageWidth() {
15
+ return this.viewer.slideWidth;
16
+ }
17
+ get pageHeight() {
18
+ return this.viewer.slideHeight;
19
+ }
20
+ static async open(r, s = {}) {
21
+ if (s.signal?.throwIfAborted(), r.byteLength > 20 * 1024 * 1024)
22
+ throw new Error("Presentation exceeds the 20 MiB preview limit.");
23
+ const e = await p(r.slice().buffer, E);
24
+ s.signal?.throwIfAborted();
25
+ let a = !1;
26
+ const l = (i) => {
27
+ const n = new DOMParser().parseFromString(i, "application/xml");
28
+ if (n.doctype || n.querySelector("parsererror"))
29
+ throw new Error("Invalid presentation relationships.");
30
+ for (const o of [...n.getElementsByTagNameNS("*", "Relationship")]) {
31
+ const d = o.getAttribute("Target") ?? "";
32
+ ((o.getAttribute("TargetMode") ?? "").toLowerCase() === "external" || /^(?:[a-z][a-z0-9+.-]*:|[/\\]{2})/i.test(d.trim())) && (o.remove(), a = !0);
33
+ }
34
+ return new XMLSerializer().serializeToString(n);
35
+ };
36
+ e.presentationRels = l(e.presentationRels);
37
+ for (const i of [
38
+ e.slideRels,
39
+ e.slideLayoutRels,
40
+ e.slideMasterRels,
41
+ e.chartRels
42
+ ])
43
+ if (i) for (const [n, o] of i) i.set(n, l(o));
44
+ for (const [i, n] of e.media) {
45
+ if (!i.toLowerCase().endsWith(".svg")) continue;
46
+ const o = g.sanitize(new TextDecoder().decode(n), {
47
+ USE_PROFILES: { svg: !0, svgFilters: !0 },
48
+ ADD_TAGS: ["use"],
49
+ FORBID_TAGS: ["style", "foreignObject"],
50
+ FORBID_ATTR: ["style"]
51
+ }), d = new DOMParser().parseFromString(o, "image/svg+xml");
52
+ if (d.querySelector("parsererror")) throw new Error("Invalid SVG in presentation.");
53
+ for (const u of [...d.querySelectorAll("*")])
54
+ for (const h of [...u.attributes])
55
+ (h.localName === "href" && !h.value.startsWith("#") || [...h.value.matchAll(/url\(\s*(['"]?)(.*?)\1\s*\)/gi)].some(
56
+ (w) => !w[2].startsWith("#")
57
+ )) && u.removeAttributeNode(h);
58
+ e.media.set(
59
+ i,
60
+ new TextEncoder().encode(new XMLSerializer().serializeToString(d))
61
+ );
62
+ }
63
+ const t = m(e, { lazySlides: !0 });
64
+ if (!t.slides.length || t.slides.length > 1e3 || !Number.isFinite(t.width) || !Number.isFinite(t.height) || t.width <= 0 || t.height <= 0 || t.width > 2e4 || t.height > 2e4)
65
+ throw new Error("Invalid presentation dimensions or page count.");
66
+ s.signal?.throwIfAborted();
67
+ const c = new v(document.createElement("div"), {
68
+ pdfjs: !1,
69
+ onNodeError: s.onNodeError
70
+ });
71
+ return c.load(t), new f(c, a);
72
+ }
73
+ renderPage(r, s) {
74
+ if (this.disposed) throw new Error("Presentation is closed.");
75
+ if (!Number.isInteger(r) || r < 0 || r >= this.pageCount)
76
+ throw new RangeError("Invalid presentation page.");
77
+ const e = this.viewer.renderSlideToContainer(r, s, 1);
78
+ if (!e) throw new Error("Presentation page could not be rendered.");
79
+ let a = !1;
80
+ const l = () => {
81
+ a || (a = !0, this.handles.delete(t), e.dispose());
82
+ }, t = {
83
+ element: e.element,
84
+ ready: e.ready,
85
+ dispose: l,
86
+ [Symbol.dispose]: l
87
+ };
88
+ return this.handles.add(t), t;
89
+ }
90
+ dispose() {
91
+ if (!this.disposed) {
92
+ this.disposed = !0;
93
+ for (const r of this.handles) r.dispose();
94
+ this.handles.clear(), this.viewer.destroy();
95
+ }
96
+ }
97
+ }
98
+ export {
99
+ f as PptxDocumentSurface
100
+ };
@@ -3,8 +3,8 @@ export declare const CLASSIC_LIGHT_CSS_TOKENS: {
3
3
  '--floe-window-titlebar-background': "var(--popover)";
4
4
  '--background': "#f8f7f2";
5
5
  '--foreground': "#303a34";
6
- '--inline-code-foreground': "#4C6544";
7
- '--inline-code-background': "#EAEBE4";
6
+ '--inline-code-foreground': "#1559B5";
7
+ '--inline-code-background': "#EEF0EF";
8
8
  '--primary': "#465a43";
9
9
  '--primary-foreground': "#f8faf5";
10
10
  '--secondary': "#eeefe8";
@@ -76,8 +76,8 @@ export declare const CLASSIC_DARK_CSS_TOKENS: {
76
76
  '--floe-window-titlebar-background': "var(--popover)";
77
77
  '--background': "#202223";
78
78
  '--foreground': "#e5e6e2";
79
- '--inline-code-foreground': "#BBC9AF";
80
- '--inline-code-background': "#2E3130";
79
+ '--inline-code-foreground': "#6CDCEB";
80
+ '--inline-code-background': "#263032";
81
81
  '--primary': "#bccbb8";
82
82
  '--primary-foreground': "#20291f";
83
83
  '--secondary': "#303435";
@@ -17,8 +17,8 @@ const d = {
17
17
  "--floe-window-titlebar-background": "var(--popover)",
18
18
  "--background": "#f8f7f2",
19
19
  "--foreground": "#303a34",
20
- "--inline-code-foreground": "#4C6544",
21
- "--inline-code-background": "#EAEBE4",
20
+ "--inline-code-foreground": "#1559B5",
21
+ "--inline-code-background": "#EEF0EF",
22
22
  "--primary": "#465a43",
23
23
  "--primary-foreground": "#f8faf5",
24
24
  "--secondary": "#eeefe8",
@@ -86,8 +86,8 @@ const d = {
86
86
  "--floe-window-titlebar-background": "var(--popover)",
87
87
  "--background": "#202223",
88
88
  "--foreground": "#e5e6e2",
89
- "--inline-code-foreground": "#BBC9AF",
90
- "--inline-code-background": "#2E3130",
89
+ "--inline-code-foreground": "#6CDCEB",
90
+ "--inline-code-background": "#263032",
91
91
  "--primary": "#bccbb8",
92
92
  "--primary-foreground": "#20291f",
93
93
  "--secondary": "#303435",
@@ -328,7 +328,7 @@ const C = {
328
328
  }, D = [
329
329
  o({
330
330
  name: "porcelain-light",
331
- inlineCode: { foreground: "#795C40", background: "#EAE5DF" },
331
+ inlineCode: { foreground: "#006A85", background: "#E9EBE8" },
332
332
  displayName: "Porcelain Light",
333
333
  description: "Original Redeven warm ivory and blue-gray ink, with quiet modern surfaces.",
334
334
  fileIconColors: {
@@ -368,7 +368,7 @@ const C = {
368
368
  C,
369
369
  o({
370
370
  name: "paper",
371
- inlineCode: { foreground: "#775D3F", background: "#EBE5DA" },
371
+ inlineCode: { foreground: "#006D82", background: "#EAEBE3" },
372
372
  displayName: "Paper",
373
373
  description: "Warm paper and deep ink for focused reading.",
374
374
  mode: "light",
@@ -390,7 +390,7 @@ const C = {
390
390
  }),
391
391
  o({
392
392
  name: "mist",
393
- inlineCode: { foreground: "#3B607C", background: "#E0E7ED" },
393
+ inlineCode: { foreground: "#975006", background: "#EAECEC" },
394
394
  displayName: "Mist",
395
395
  description: "Cool, quiet layers for monitoring and dense data.",
396
396
  mode: "light",
@@ -412,7 +412,7 @@ const C = {
412
412
  }),
413
413
  o({
414
414
  name: "meadow",
415
- inlineCode: { foreground: "#3C684C", background: "#E0E9DF" },
415
+ inlineCode: { foreground: "#1858B9", background: "#E4EDEA" },
416
416
  displayName: "Meadow",
417
417
  description: "Natural greens for collaborative daily work.",
418
418
  mode: "light",
@@ -434,7 +434,7 @@ const C = {
434
434
  }),
435
435
  o({
436
436
  name: "citrus",
437
- inlineCode: { foreground: "#865622", background: "#F5E8D2" },
437
+ inlineCode: { foreground: "#08627D", background: "#F4EEDC" },
438
438
  displayName: "Citrus",
439
439
  description: "Warm cream and amber for lively commercial work.",
440
440
  mode: "light",
@@ -456,7 +456,7 @@ const C = {
456
456
  }),
457
457
  o({
458
458
  name: "lilac",
459
- inlineCode: { foreground: "#71548B", background: "#EAE4F1" },
459
+ inlineCode: { foreground: "#006D68", background: "#EAEAF3" },
460
460
  displayName: "Lilac",
461
461
  description: "Soft violet structure for creative and client work.",
462
462
  mode: "light",
@@ -478,7 +478,7 @@ const C = {
478
478
  }),
479
479
  o({
480
480
  name: "light-plus",
481
- inlineCode: { foreground: "#355F8B", background: "#EFF2F6" },
481
+ inlineCode: { foreground: "#006D77", background: "#F4F8F9" },
482
482
  displayName: "Light+",
483
483
  description: "VS Code clarity with crisp blue actions and neutral chrome.",
484
484
  mode: "light",
@@ -509,7 +509,7 @@ const C = {
509
509
  }),
510
510
  o({
511
511
  name: "quiet-light",
512
- inlineCode: { foreground: "#625987", background: "#E9E9EC" },
512
+ inlineCode: { foreground: "#96520D", background: "#F1EEEB" },
513
513
  displayName: "Quiet Light",
514
514
  description: "Soft gray surfaces and calm indigo for long coding sessions.",
515
515
  mode: "light",
@@ -540,7 +540,7 @@ const C = {
540
540
  }),
541
541
  o({
542
542
  name: "solarized-light",
543
- inlineCode: { foreground: "#426C70", background: "#EEEBDA" },
543
+ inlineCode: { foreground: "#135BA7", background: "#F2EFE0" },
544
544
  displayName: "Solarized Light",
545
545
  description: "Solarized warmth with measured cyan, green, and amber syntax.",
546
546
  mode: "light",
@@ -571,7 +571,7 @@ const C = {
571
571
  }),
572
572
  o({
573
573
  name: "github-light",
574
- inlineCode: { foreground: "#3E6085", background: "#E7ECF1" },
574
+ inlineCode: { foreground: "#96500C", background: "#F2F0EF" },
575
575
  displayName: "GitHub Light",
576
576
  description: "Clean repository neutrals with familiar blue and green accents.",
577
577
  mode: "light",
@@ -602,7 +602,7 @@ const C = {
602
602
  }),
603
603
  o({
604
604
  name: "hc-light",
605
- inlineCode: { foreground: "#000078", background: "#EBEBF4" },
605
+ inlineCode: { foreground: "#00499C", background: "#F4F7FB" },
606
606
  displayName: "High Contrast Light",
607
607
  description: "Maximum edge definition for bright environments and low vision.",
608
608
  mode: "light",
@@ -633,7 +633,7 @@ const C = {
633
633
  }),
634
634
  o({
635
635
  name: "porcelain-dark",
636
- inlineCode: { foreground: "#AAC7BD", background: "#1A1D1D" },
636
+ inlineCode: { foreground: "#E7B75A", background: "#1C1913" },
637
637
  displayName: "Porcelain Dark",
638
638
  description: "Warm white text and neutral controls on a near-black canvas with quiet charcoal surfaces.",
639
639
  mode: "dark",
@@ -667,7 +667,7 @@ const C = {
667
667
  y,
668
668
  o({
669
669
  name: "ink",
670
- inlineCode: { foreground: "#A5B9D7", background: "#192330" },
670
+ inlineCode: { foreground: "#F3BE62", background: "#1C2125" },
671
671
  displayName: "Ink",
672
672
  description: "Blue-black focus with a restrained engineering blue.",
673
673
  mode: "dark",
@@ -689,7 +689,7 @@ const C = {
689
689
  }),
690
690
  o({
691
691
  name: "slate",
692
- inlineCode: { foreground: "#B1C0D1", background: "#252A32" },
692
+ inlineCode: { foreground: "#E9BD66", background: "#272727" },
693
693
  displayName: "Slate",
694
694
  description: "Neutral graphite layers for enterprise operations.",
695
695
  mode: "dark",
@@ -711,7 +711,7 @@ const C = {
711
711
  }),
712
712
  o({
713
713
  name: "forest",
714
- inlineCode: { foreground: "#9DCDB7", background: "#182A25" },
714
+ inlineCode: { foreground: "#E6BD6A", background: "#1B261D" },
715
715
  displayName: "Forest",
716
716
  description: "Deep greens and copper for calm live monitoring.",
717
717
  mode: "dark",
@@ -733,7 +733,7 @@ const C = {
733
733
  }),
734
734
  o({
735
735
  name: "ember",
736
- inlineCode: { foreground: "#D9B09D", background: "#2E1F21" },
736
+ inlineCode: { foreground: "#66D8DF", background: "#222024" },
737
737
  displayName: "Ember",
738
738
  description: "Charcoal warmth for releases and high-attention work.",
739
739
  mode: "dark",
@@ -755,7 +755,7 @@ const C = {
755
755
  }),
756
756
  o({
757
757
  name: "ocean",
758
- inlineCode: { foreground: "#9BCDDC", background: "#142A35" },
758
+ inlineCode: { foreground: "#EDC36C", background: "#18272A" },
759
759
  displayName: "Ocean",
760
760
  description: "High-clarity cyan for streams, terminals, and tools.",
761
761
  mode: "dark",
@@ -777,7 +777,7 @@ const C = {
777
777
  }),
778
778
  o({
779
779
  name: "dark-plus",
780
- inlineCode: { foreground: "#A8C3DC", background: "#2A2D2F" },
780
+ inlineCode: { foreground: "#79DEBE", background: "#252C2A" },
781
781
  displayName: "Dark+",
782
782
  description: "The familiar VS Code dark workbench with balanced syntax color.",
783
783
  mode: "dark",
@@ -808,7 +808,7 @@ const C = {
808
808
  }),
809
809
  o({
810
810
  name: "monokai",
811
- inlineCode: { foreground: "#CDD3A4", background: "#36372E" },
811
+ inlineCode: { foreground: "#70DDEA", background: "#2C3631" },
812
812
  displayName: "Monokai",
813
813
  description: "Warm charcoal with vivid pink, green, cyan, and yellow code.",
814
814
  mode: "dark",
@@ -839,7 +839,7 @@ const C = {
839
839
  }),
840
840
  o({
841
841
  name: "nord",
842
- inlineCode: { foreground: "#AFC8D1", background: "#3A414D" },
842
+ inlineCode: { foreground: "#F0C675", background: "#3D3F44" },
843
843
  displayName: "Nord",
844
844
  description: "Arctic blue-gray surfaces with restrained frost accents.",
845
845
  mode: "dark",
@@ -870,7 +870,7 @@ const C = {
870
870
  }),
871
871
  o({
872
872
  name: "dracula",
873
- inlineCode: { foreground: "#CAB5E2", background: "#373745" },
873
+ inlineCode: { foreground: "#6FE0B5", background: "#2D3840" },
874
874
  displayName: "Dracula",
875
875
  description: "Deep violet charcoal with bright pink, green, and cyan syntax.",
876
876
  mode: "dark",
@@ -901,7 +901,7 @@ const C = {
901
901
  }),
902
902
  o({
903
903
  name: "abyss",
904
- inlineCode: { foreground: "#95C4DA", background: "#0D1D29" },
904
+ inlineCode: { foreground: "#F1C56B", background: "#121A1E" },
905
905
  displayName: "Abyss",
906
906
  description: "Near-black ocean depth with electric cyan tool highlights.",
907
907
  mode: "dark",
@@ -932,7 +932,7 @@ const C = {
932
932
  }),
933
933
  o({
934
934
  name: "studio",
935
- inlineCode: { foreground: "#BCB8CE", background: "#29282C" },
935
+ inlineCode: { foreground: "#79C9F0", background: "#21272C" },
936
936
  displayName: "Studio",
937
937
  description: "Neutral near-black workspace: clean dark surfaces with zero color cast.",
938
938
  mode: "dark",
@@ -963,7 +963,7 @@ const C = {
963
963
  }),
964
964
  o({
965
965
  name: "graphite",
966
- inlineCode: { foreground: "#A9C5C6", background: "#292B2D" },
966
+ inlineCode: { foreground: "#6DDEC9", background: "#222B2B" },
967
967
  displayName: "Graphite",
968
968
  description: "macOS system dark: neutral warm surfaces, system-blue active state, teal and amber chart palette.",
969
969
  mode: "dark",