@factorialco/f0-react 4.45.0 → 4.46.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 (34) hide show
  1. package/dist/ChatDocxThumbnail-B3DMs45n.js +48 -0
  2. package/dist/ChatPdfThumbnail-BFbYv0sb.js +38 -0
  3. package/dist/ChatSheetThumbnail-BvnxT-4A.js +38 -0
  4. package/dist/ChatTextThumbnail-yVt_iYi7.js +33 -0
  5. package/dist/{DocumentToolbar-CW3DaM_j.js → DocumentToolbar-BLcBoeNU.js} +5 -5
  6. package/dist/DocxViewer-C0K6oFym.js +68 -0
  7. package/dist/{F0AiProcessingOverlay-rViVqtAb.js → F0AiProcessingOverlay-BZka5wSN.js} +713 -761
  8. package/dist/{F0CanvasPanel-VGTPb68G.js → F0CanvasPanel-BDwye32b.js} +10679 -10600
  9. package/dist/{LocationMap-CdKO0X5V.js → LocationMap-NloaE37G.js} +1 -1
  10. package/dist/Printer-B7iDPx2r.js +54 -0
  11. package/dist/SheetViewer-1AsPdzFt.js +108 -0
  12. package/dist/{TextViewer-DXDZcvag.js → TextViewer-Ba0xZQdy.js} +2 -2
  13. package/dist/_commonjs-dynamic-modules-BpilXLfW.js +6 -0
  14. package/dist/ai.d.ts +30 -1
  15. package/dist/ai.js +2 -2
  16. package/dist/component-status.js +1 -1
  17. package/dist/{DocxViewer-Dpj4i6ig.js → docx-preview-CSg41tKY.js} +971 -1034
  18. package/dist/experimental.d.ts +20 -3
  19. package/dist/experimental.js +10210 -6404
  20. package/dist/f0.css +1 -1
  21. package/dist/f0.d.ts +30 -1
  22. package/dist/f0.js +65853 -299
  23. package/dist/{index-CNi_8WQC.js → index-3x-af82e.js} +92 -92
  24. package/dist/index-BuP079h-.js +545 -0
  25. package/dist/index.css +1 -1
  26. package/dist/index2.css +1 -0
  27. package/dist/pdfWorker-XwYoO_oV.js +13118 -0
  28. package/dist/pdfWorker.css +1 -0
  29. package/dist/sheetPreview-5qeAOp0W.js +35 -0
  30. package/dist/styles.css +1 -1
  31. package/package.json +2 -1
  32. package/tailwind.config.ts +8 -0
  33. package/dist/SheetViewer-huUU5vFM.js +0 -137
  34. package/dist/f0-C3TJ0moH.js +0 -79279
@@ -1,5 +1,5 @@
1
1
  import { jsx as O_ } from "react/jsx-runtime";
2
- import { n as V_ } from "./F0CanvasPanel-VGTPb68G.js";
2
+ import { n as V_ } from "./F0CanvasPanel-BDwye32b.js";
3
3
  import { useRef as Ru, useEffect as yd, useState as j_ } from "react";
4
4
  import './LocationMap.css';var Lu = { exports: {} };
5
5
  var N_ = Lu.exports, Uf;
@@ -0,0 +1,54 @@
1
+ import { jsxs as e, jsx as o } from "react/jsx-runtime";
2
+ import { forwardRef as t } from "react";
3
+ const n = (r, C) => /* @__PURE__ */ e(
4
+ "svg",
5
+ {
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ fill: "none",
8
+ viewBox: "0 0 24 24",
9
+ ref: C,
10
+ ...r,
11
+ children: [
12
+ /* @__PURE__ */ o(
13
+ "path",
14
+ {
15
+ stroke: "currentColor",
16
+ strokeLinejoin: "round",
17
+ d: "M4 13V11.8C4 10.1198 4 9.27976 4.32698 8.63803C4.6146 8.07354 5.07354 7.6146 5.63803 7.32698C6.27976 7 7.11984 7 8.8 7H15.2C16.8802 7 17.7202 7 18.362 7.32698C18.9265 7.6146 19.3854 8.07354 19.673 8.63803C20 9.27976 20 10.1198 20 11.8V13C20 13.93 20 14.395 19.8978 14.7765C19.6204 15.8117 18.8117 16.6204 17.7765 16.8978C17.395 17 16.93 17 16 17V15.6C16 15.0399 16 14.7599 15.891 14.546C15.7951 14.3578 15.6422 14.2049 15.454 14.109C15.2401 14 14.9601 14 14.4 14H9.6C9.03995 14 8.75992 14 8.54601 14.109C8.35785 14.2049 8.20487 14.3578 8.10899 14.546C8 14.7599 8 15.0399 8 15.6V17C7.07003 17 6.60504 17 6.22354 16.8978C5.18827 16.6204 4.37962 15.8117 4.10222 14.7765C4 14.395 4 13.93 4 13Z",
18
+ vectorEffect: "non-scaling-stroke"
19
+ }
20
+ ),
21
+ /* @__PURE__ */ o(
22
+ "path",
23
+ {
24
+ stroke: "currentColor",
25
+ strokeLinejoin: "round",
26
+ d: "M17 7V7C17 5.34315 15.6569 4 14 4H10C8.34315 4 7 5.34315 7 7V7",
27
+ vectorEffect: "non-scaling-stroke"
28
+ }
29
+ ),
30
+ /* @__PURE__ */ o(
31
+ "path",
32
+ {
33
+ stroke: "currentColor",
34
+ strokeLinejoin: "round",
35
+ d: "M16 16.8V15.6C16 15.0399 16 14.7599 15.891 14.546C15.7951 14.3578 15.6422 14.2049 15.454 14.109C15.2401 14 14.9601 14 14.4 14H9.6C9.03995 14 8.75992 14 8.54601 14.109C8.35785 14.2049 8.20487 14.3578 8.10899 14.546C8 14.7599 8 15.0399 8 15.6V16.8C8 17.9201 8 18.4802 8.21799 18.908C8.40973 19.2843 8.71569 19.5903 9.09202 19.782C9.51984 20 10.0799 20 11.2 20H12.8C13.9201 20 14.4802 20 14.908 19.782C15.2843 19.5903 15.5903 19.2843 15.782 18.908C16 18.4802 16 17.9201 16 16.8Z",
36
+ vectorEffect: "non-scaling-stroke"
37
+ }
38
+ ),
39
+ /* @__PURE__ */ o(
40
+ "circle",
41
+ {
42
+ cx: 17,
43
+ cy: 11,
44
+ r: 1,
45
+ fill: "currentColor",
46
+ vectorEffect: "non-scaling-stroke"
47
+ }
48
+ )
49
+ ]
50
+ }
51
+ ), i = t(n);
52
+ export {
53
+ i as F
54
+ };
@@ -0,0 +1,108 @@
1
+ import { jsxs as a, jsx as r, Fragment as N } from "react/jsx-runtime";
2
+ import { useState as i, useEffect as k } from "react";
3
+ import { u as v, T as S, h as V, S as R } from "./F0CanvasPanel-BDwye32b.js";
4
+ import { f as z, c as E } from "./sheetPreview-5qeAOp0W.js";
5
+ import { u as _, D as j } from "./DocumentToolbar-BLcBoeNU.js";
6
+ const g = 1e3, F = 100, G = ({
7
+ url: n,
8
+ filename: y,
9
+ withCredentials: d = !0,
10
+ actions: x
11
+ }) => {
12
+ const c = v(), f = _(), [t, m] = i(null), [w, l] = i(!1), [u, b] = i(0);
13
+ k(() => {
14
+ let e = !1;
15
+ return m(null), l(!1), b(0), z(n, {
16
+ maxRows: g,
17
+ maxCols: F,
18
+ withCredentials: d
19
+ }).then((o) => {
20
+ e || (o.length === 0 ? l(!0) : m(o));
21
+ }).catch(() => {
22
+ e || l(!0);
23
+ }), () => {
24
+ e = !0;
25
+ };
26
+ }, [n, d]);
27
+ const s = t ? t[Math.min(u, t.length - 1)] : null, h = s ? E(s.rows) : [];
28
+ return /* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col bg-f1-background", children: [
29
+ /* @__PURE__ */ r(
30
+ j,
31
+ {
32
+ url: n,
33
+ filename: y,
34
+ withCredentials: d,
35
+ actions: x,
36
+ zoom: f,
37
+ children: t && t.length > 1 && /* @__PURE__ */ r(
38
+ S,
39
+ {
40
+ type: "single",
41
+ size: "sm",
42
+ value: String(u),
43
+ onValueChange: (e) => {
44
+ e && b(Number(e));
45
+ },
46
+ className: "justify-start",
47
+ children: t.map((e, o) => /* @__PURE__ */ r(
48
+ V,
49
+ {
50
+ value: String(o),
51
+ className: "whitespace-nowrap",
52
+ children: e.name
53
+ },
54
+ `${e.name}-${o}`
55
+ ))
56
+ }
57
+ )
58
+ }
59
+ ),
60
+ w ? /* @__PURE__ */ r("div", { className: "flex min-h-0 grow items-center justify-center text-f1-foreground-secondary", children: c.pdfViewer.previewFailed }) : s ? /* @__PURE__ */ a(N, { children: [
61
+ /* @__PURE__ */ r("div", { className: "min-h-0 grow overflow-auto", children: /* @__PURE__ */ a(
62
+ "table",
63
+ {
64
+ className: "border-collapse text-sm",
65
+ style: { zoom: f.scale },
66
+ children: [
67
+ /* @__PURE__ */ r("thead", { children: /* @__PURE__ */ a("tr", { children: [
68
+ /* @__PURE__ */ r("th", { className: "sticky top-0 z-10 border border-solid border-f1-border-secondary bg-f1-background-secondary px-2 py-1" }),
69
+ h.map((e) => /* @__PURE__ */ r(
70
+ "th",
71
+ {
72
+ className: "sticky top-0 z-10 border border-solid border-f1-border-secondary bg-f1-background-secondary px-2 py-1 text-center font-medium text-f1-foreground-secondary",
73
+ children: e
74
+ },
75
+ e
76
+ ))
77
+ ] }) }),
78
+ /* @__PURE__ */ r("tbody", { children: s.rows.map((e, o) => /* @__PURE__ */ a("tr", { children: [
79
+ /* @__PURE__ */ r("td", { className: "border border-solid border-f1-border-secondary bg-f1-background-secondary px-2 py-1 text-center text-f1-foreground-secondary", children: o + 1 }),
80
+ h.map((I, p) => /* @__PURE__ */ r(
81
+ "td",
82
+ {
83
+ className: "whitespace-nowrap border border-solid border-f1-border-secondary px-2 py-1 text-f1-foreground",
84
+ children: e[p] ?? ""
85
+ },
86
+ p
87
+ ))
88
+ ] }, o)) })
89
+ ]
90
+ }
91
+ ) }),
92
+ s.truncatedRows && /* @__PURE__ */ r("div", { className: "shrink-0 border-0 border-t border-solid border-f1-border-secondary px-3 py-1.5 text-sm text-f1-foreground-secondary", children: c.t("pdfViewer.showingFirstRows.other", {
93
+ count: g
94
+ }) })
95
+ ] }) : /* @__PURE__ */ r(
96
+ R,
97
+ {
98
+ role: "status",
99
+ "aria-busy": !0,
100
+ "aria-label": c.pdfViewer.loading,
101
+ className: "min-h-0 w-full grow rounded-none"
102
+ }
103
+ )
104
+ ] });
105
+ };
106
+ export {
107
+ G as default
108
+ };
@@ -1,7 +1,7 @@
1
1
  import { jsxs as b, jsx as e } from "react/jsx-runtime";
2
2
  import { useState as _, useEffect as h } from "react";
3
- import { u as x, S as p, p as w } from "./F0CanvasPanel-VGTPb68G.js";
4
- import { u as y, D as g } from "./DocumentToolbar-CW3DaM_j.js";
3
+ import { u as x, S as p, p as w } from "./F0CanvasPanel-BDwye32b.js";
4
+ import { u as y, D as g } from "./DocumentToolbar-BLcBoeNU.js";
5
5
  const k = 2 * 1024 * 1024, v = [
6
6
  "[&_h1]:mb-3 [&_h1]:mt-6 [&_h1]:text-2xl [&_h1]:font-semibold",
7
7
  "[&_h2]:mb-2 [&_h2]:mt-5 [&_h2]:text-xl [&_h2]:font-semibold",
@@ -0,0 +1,6 @@
1
+ function r(o) {
2
+ throw new Error('Could not dynamically require "' + o + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
3
+ }
4
+ export {
5
+ r as c
6
+ };
package/dist/ai.d.ts CHANGED
@@ -260,6 +260,15 @@ export declare type AiChatProviderProps = {
260
260
  * @default "right"
261
261
  */
262
262
  side?: "left" | "right";
263
+ /**
264
+ * Edge hosted side-panel content (`setPanelContent`) docks to. Defaults to
265
+ * `side`, keeping everything in one panel. Set it to the opposite edge to
266
+ * split them — e.g. communications: conversations dock left while the AI
267
+ * chat keeps its right-side panel and toggle. The two are still exclusive
268
+ * (opening one swaps the other out); only the main content moves during
269
+ * the swap, uncovering the incoming panel in place.
270
+ */
271
+ panelContentSide?: "left" | "right";
263
272
  /**
264
273
  * Greeting phrase(s) shown by the welcome screen when the chat is empty.
265
274
  * A single string renders once; an array rotates through phrases. Purely
@@ -519,6 +528,16 @@ declare type AiChatProviderReturnValue = {
519
528
  setPanelContent: (content: SidePanelContent | null) => void;
520
529
  /** Clear the custom panel content and fall back to the F0.ai chat. */
521
530
  clearPanelContent: () => void;
531
+ /**
532
+ * Id of the hosted content that was showing when the page last unloaded,
533
+ * pending restoration. The panel holds a skeleton (no AI-chat flash) until
534
+ * the host re-mounts it via `setPanelContent`, cancels via
535
+ * `cancelPanelContentRestore` (content no longer accessible), or a safety
536
+ * timeout falls back to the AI chat.
537
+ */
538
+ restoringPanelContentId: string | null;
539
+ /** Give up on restoring the persisted panel content — show the AI chat. */
540
+ cancelPanelContentRestore: () => void;
522
541
  /**
523
542
  * Edge the whole side panel docks to — the AI chat, hosted content and the
524
543
  * canvas all follow it. Defaults to "right". Hosts flip it to "left" for a
@@ -528,6 +547,14 @@ declare type AiChatProviderReturnValue = {
528
547
  panelSide: "left" | "right";
529
548
  /** Set which edge the side panel docks to. */
530
549
  setPanelSide: React.Dispatch<React.SetStateAction<"left" | "right">>;
550
+ /**
551
+ * Edge hosted panel content (`setPanelContent`) docks to. Defaults to
552
+ * `panelSide`; when it differs, the AI chat and hosted content render in
553
+ * separate windows, one per edge, still mutually exclusive.
554
+ */
555
+ panelContentSide: "left" | "right";
556
+ /** Set which edge hosted panel content docks to. */
557
+ setPanelContentSide: React.Dispatch<React.SetStateAction<"left" | "right">>;
531
558
  } & Pick<AiChatState, "agent" | "chatHeader" | "chatMessages" | "chatInput" | "disclaimer" | "resizable" | "entityRefs" | "canvasActions" | "canvasEntities" | "credits" | "employeeCredits" | "creditWarning" | "fileAttachments" | "onTranscribe"> & {
532
559
  /** The current canvas content, or null when canvas is closed */
533
560
  canvasContent: CanvasContent | null;
@@ -552,6 +579,8 @@ declare interface AiChatState {
552
579
  enabled: boolean;
553
580
  /** Initial edge the panel docks to. @default "right" */
554
581
  side?: "left" | "right";
582
+ /** Initial edge hosted panel content docks to. Defaults to `side`. */
583
+ panelContentSide?: "left" | "right";
555
584
  agent?: string;
556
585
  initialMessage?: string | string[];
557
586
  chatHeader?: React.ReactNode;
@@ -3008,7 +3037,7 @@ export declare interface F0AiChatProps {
3008
3037
  /**
3009
3038
  * @experimental This is an experimental component use it at your own risk
3010
3039
  */
3011
- export declare const F0AiChatProvider: ({ enabled, side, initialMessage, chatHeader, chatMessages, chatInput, welcomeScreenSuggestions, welcomeScreenCards, disclaimer, resizable, defaultVisualizationMode, lockVisualizationMode, historyEnabled, footer, VoiceMode, entityRefs, canvasActions, canvasEntities, credits, employeeCredits, creditWarning, fileAttachments, onTranscribe, onThumbsUp, onThumbsDown, children, agent, tracking, }: AiChatProviderProps) => JSX_2.Element;
3040
+ export declare const F0AiChatProvider: ({ enabled, side, panelContentSide, initialMessage, chatHeader, chatMessages, chatInput, welcomeScreenSuggestions, welcomeScreenCards, disclaimer, resizable, defaultVisualizationMode, lockVisualizationMode, historyEnabled, footer, VoiceMode, entityRefs, canvasActions, canvasEntities, credits, employeeCredits, creditWarning, fileAttachments, onTranscribe, onThumbsUp, onThumbsDown, children, agent, tracking, }: AiChatProviderProps) => JSX_2.Element;
3012
3041
 
3013
3042
  /**
3014
3043
  * Headless chat composer.
package/dist/ai.js CHANGED
@@ -1,6 +1,6 @@
1
- import { C as e, D as r, c as t, F as i, a as o, f as n, g as F, d as C, e as l, I as A, P as d, b as u, u as h } from "./F0CanvasPanel-VGTPb68G.js";
1
+ import { C as e, D as r, c as t, F as i, a as o, f as n, g as F, d as C, e as l, I as A, P as d, b as u, u as h } from "./F0CanvasPanel-BDwye32b.js";
2
2
  import { defaultTranslations as c } from "./i18n-provider-defaults.js";
3
- import { A as P, C as T, t as p, s as v, v as g, y as f, l as y, i as S, q as x, z as b, B as k, p as H, r as O, j as V, e as w, g as B, k as M, F as z, T as D, w as L, h as j, a as q, n as E, m as G, o as R, b as J, f as K, x as N, c as Q, d as U, u as W } from "./F0AiProcessingOverlay-rViVqtAb.js";
3
+ import { A as P, C as T, t as p, s as v, v as g, y as f, l as y, i as S, q as x, z as b, B as k, p as H, r as O, j as V, e as w, g as B, k as M, F as z, T as D, w as L, h as j, a as q, n as E, m as G, o as R, b as J, f as K, x as N, c as Q, d as U, u as W } from "./F0AiProcessingOverlay-BZka5wSN.js";
4
4
  export {
5
5
  P as AiChatTranslationsProvider,
6
6
  e as ChatSpinner,