@factorialco/f0-react 4.44.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.
- package/dist/ChatDocxThumbnail-B3DMs45n.js +48 -0
- package/dist/ChatPdfThumbnail-BFbYv0sb.js +38 -0
- package/dist/ChatSheetThumbnail-BvnxT-4A.js +38 -0
- package/dist/ChatTextThumbnail-yVt_iYi7.js +33 -0
- package/dist/{DocumentToolbar-D3GqxyBD.js → DocumentToolbar-BLcBoeNU.js} +5 -5
- package/dist/DocxViewer-C0K6oFym.js +68 -0
- package/dist/{F0AiProcessingOverlay-rViVqtAb.js → F0AiProcessingOverlay-BZka5wSN.js} +713 -761
- package/dist/{F0CanvasPanel-VGTPb68G.js → F0CanvasPanel-BDwye32b.js} +10679 -10600
- package/dist/{LocationMap-CdKO0X5V.js → LocationMap-NloaE37G.js} +1 -1
- package/dist/Printer-B7iDPx2r.js +54 -0
- package/dist/SheetViewer-1AsPdzFt.js +108 -0
- package/dist/{TextViewer-Dn0MDAXs.js → TextViewer-Ba0xZQdy.js} +2 -2
- package/dist/_commonjs-dynamic-modules-BpilXLfW.js +6 -0
- package/dist/ai.d.ts +34 -1
- package/dist/ai.js +2 -2
- package/dist/component-status.js +1 -1
- package/dist/{DocxViewer-BIZmtyWY.js → docx-preview-CSg41tKY.js} +971 -1034
- package/dist/experimental.d.ts +31 -4
- package/dist/experimental.js +10210 -6404
- package/dist/f0.css +1 -1
- package/dist/f0.d.ts +74 -1
- package/dist/f0.js +65853 -299
- package/dist/i18n-provider-defaults.d.ts +4 -0
- package/dist/i18n-provider-defaults.js +5 -1
- package/dist/{index-DoDUaTro.js → index-3x-af82e.js} +14657 -14408
- package/dist/index-BuP079h-.js +545 -0
- package/dist/index.css +1 -1
- package/dist/index2.css +1 -0
- package/dist/pdfWorker-XwYoO_oV.js +13118 -0
- package/dist/pdfWorker.css +1 -0
- package/dist/sheetPreview-5qeAOp0W.js +35 -0
- package/dist/styles.css +1 -1
- package/package.json +2 -1
- package/tailwind.config.ts +8 -0
- package/dist/SheetViewer-HsR5toIL.js +0 -137
- package/dist/f0-BaDuQbAV.js +0 -79441
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@factorialco/f0-react",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.46.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": [
|
|
6
6
|
"assets",
|
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
"prosemirror-state": "^1.4.3",
|
|
93
93
|
"prosemirror-view": "^1.38.1",
|
|
94
94
|
"react-remove-scroll": "^2.7.1",
|
|
95
|
+
"react-virtuoso": "^4.18.11",
|
|
95
96
|
"rehype-stringify": "^10.0.1",
|
|
96
97
|
"remark-gfm": "^4.0.1",
|
|
97
98
|
"remark-parse": "^11.0.0",
|
package/tailwind.config.ts
CHANGED
|
@@ -26,10 +26,18 @@ export default {
|
|
|
26
26
|
from: { "--gradient-angle": "0deg" },
|
|
27
27
|
to: { "--gradient-angle": "360deg" },
|
|
28
28
|
},
|
|
29
|
+
// Chat typing indicator: a soft rise-and-dim wave with a rest phase
|
|
30
|
+
// (WhatsApp-style), instead of `bounce`'s hard ball-drop curve.
|
|
31
|
+
"typing-dot": {
|
|
32
|
+
"0%": { transform: "translateY(0)", opacity: "0.35" },
|
|
33
|
+
"22%": { transform: "translateY(-3px)", opacity: "1" },
|
|
34
|
+
"44%, 100%": { transform: "translateY(0)", opacity: "0.35" },
|
|
35
|
+
},
|
|
29
36
|
},
|
|
30
37
|
animation: {
|
|
31
38
|
...baseConfig.theme?.extend?.animation,
|
|
32
39
|
"rotate-gradient": "rotate-gradient 2s linear infinite",
|
|
40
|
+
"typing-dot": "typing-dot 1.3s ease-in-out infinite",
|
|
33
41
|
},
|
|
34
42
|
},
|
|
35
43
|
},
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { jsxs as m, jsx as r, Fragment as N } from "react/jsx-runtime";
|
|
2
|
-
import { useState as b, useEffect as S } from "react";
|
|
3
|
-
import { u as v, T as _, l as R, S as V } from "./F0CanvasPanel-VGTPb68G.js";
|
|
4
|
-
import { utils as p, read as E } from "./xlsx-CzlURDDb.js";
|
|
5
|
-
import { u as M, D as j } from "./DocumentToolbar-D3GqxyBD.js";
|
|
6
|
-
const z = (a, { maxRows: d, maxCols: s }) => {
|
|
7
|
-
const n = E(a, { type: "array" });
|
|
8
|
-
return n.SheetNames.map((t) => {
|
|
9
|
-
const i = n.Sheets[t], c = i?.["!ref"];
|
|
10
|
-
if (!i || !c) return { name: t, rows: [], truncatedRows: !1 };
|
|
11
|
-
const o = p.decode_range(c), h = o.e.r - o.s.r + 1 > d;
|
|
12
|
-
o.e.r = Math.min(o.e.r, o.s.r + d - 1), o.e.c = Math.min(o.e.c, o.s.c + s - 1);
|
|
13
|
-
const f = p.sheet_to_json(i, {
|
|
14
|
-
header: 1,
|
|
15
|
-
raw: !1,
|
|
16
|
-
// formatted text, not raw values
|
|
17
|
-
defval: "",
|
|
18
|
-
range: o
|
|
19
|
-
});
|
|
20
|
-
return { name: t, rows: f, truncatedRows: h };
|
|
21
|
-
});
|
|
22
|
-
}, F = (a) => {
|
|
23
|
-
const d = a.reduce((s, n) => Math.max(s, n.length), 0);
|
|
24
|
-
return Array.from({ length: d }, (s, n) => p.encode_col(n));
|
|
25
|
-
}, W = async (a, {
|
|
26
|
-
maxRows: d,
|
|
27
|
-
maxCols: s,
|
|
28
|
-
withCredentials: n = !0
|
|
29
|
-
}) => {
|
|
30
|
-
const t = await fetch(a, {
|
|
31
|
-
credentials: n ? "include" : "same-origin"
|
|
32
|
-
});
|
|
33
|
-
if (!t.ok) throw new Error(`Failed to fetch sheet: ${t.status}`);
|
|
34
|
-
return z(await t.arrayBuffer(), { maxRows: d, maxCols: s });
|
|
35
|
-
}, k = 1e3, A = 100, O = ({
|
|
36
|
-
url: a,
|
|
37
|
-
filename: d,
|
|
38
|
-
withCredentials: s = !0,
|
|
39
|
-
actions: n
|
|
40
|
-
}) => {
|
|
41
|
-
const t = v(), i = M(), [c, o] = b(null), [h, f] = b(!1), [g, y] = b(0);
|
|
42
|
-
S(() => {
|
|
43
|
-
let e = !1;
|
|
44
|
-
return o(null), f(!1), y(0), W(a, {
|
|
45
|
-
maxRows: k,
|
|
46
|
-
maxCols: A,
|
|
47
|
-
withCredentials: s
|
|
48
|
-
}).then((l) => {
|
|
49
|
-
e || (l.length === 0 ? f(!0) : o(l));
|
|
50
|
-
}).catch(() => {
|
|
51
|
-
e || f(!0);
|
|
52
|
-
}), () => {
|
|
53
|
-
e = !0;
|
|
54
|
-
};
|
|
55
|
-
}, [a, s]);
|
|
56
|
-
const u = c ? c[Math.min(g, c.length - 1)] : null, w = u ? F(u.rows) : [];
|
|
57
|
-
return /* @__PURE__ */ m("div", { className: "flex h-full w-full flex-col bg-f1-background", children: [
|
|
58
|
-
/* @__PURE__ */ r(
|
|
59
|
-
j,
|
|
60
|
-
{
|
|
61
|
-
url: a,
|
|
62
|
-
filename: d,
|
|
63
|
-
withCredentials: s,
|
|
64
|
-
actions: n,
|
|
65
|
-
zoom: i,
|
|
66
|
-
children: c && c.length > 1 && /* @__PURE__ */ r(
|
|
67
|
-
_,
|
|
68
|
-
{
|
|
69
|
-
type: "single",
|
|
70
|
-
size: "sm",
|
|
71
|
-
value: String(g),
|
|
72
|
-
onValueChange: (e) => {
|
|
73
|
-
e && y(Number(e));
|
|
74
|
-
},
|
|
75
|
-
className: "justify-start",
|
|
76
|
-
children: c.map((e, l) => /* @__PURE__ */ r(
|
|
77
|
-
R,
|
|
78
|
-
{
|
|
79
|
-
value: String(l),
|
|
80
|
-
className: "whitespace-nowrap",
|
|
81
|
-
children: e.name
|
|
82
|
-
},
|
|
83
|
-
`${e.name}-${l}`
|
|
84
|
-
))
|
|
85
|
-
}
|
|
86
|
-
)
|
|
87
|
-
}
|
|
88
|
-
),
|
|
89
|
-
h ? /* @__PURE__ */ r("div", { className: "flex min-h-0 grow items-center justify-center text-f1-foreground-secondary", children: t.pdfViewer.previewFailed }) : u ? /* @__PURE__ */ m(N, { children: [
|
|
90
|
-
/* @__PURE__ */ r("div", { className: "min-h-0 grow overflow-auto", children: /* @__PURE__ */ m(
|
|
91
|
-
"table",
|
|
92
|
-
{
|
|
93
|
-
className: "border-collapse text-sm",
|
|
94
|
-
style: { zoom: i.scale },
|
|
95
|
-
children: [
|
|
96
|
-
/* @__PURE__ */ r("thead", { children: /* @__PURE__ */ m("tr", { children: [
|
|
97
|
-
/* @__PURE__ */ r("th", { className: "sticky top-0 z-10 border border-solid border-f1-border-secondary bg-f1-background-secondary px-2 py-1" }),
|
|
98
|
-
w.map((e) => /* @__PURE__ */ r(
|
|
99
|
-
"th",
|
|
100
|
-
{
|
|
101
|
-
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",
|
|
102
|
-
children: e
|
|
103
|
-
},
|
|
104
|
-
e
|
|
105
|
-
))
|
|
106
|
-
] }) }),
|
|
107
|
-
/* @__PURE__ */ r("tbody", { children: u.rows.map((e, l) => /* @__PURE__ */ m("tr", { children: [
|
|
108
|
-
/* @__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: l + 1 }),
|
|
109
|
-
w.map((I, x) => /* @__PURE__ */ r(
|
|
110
|
-
"td",
|
|
111
|
-
{
|
|
112
|
-
className: "whitespace-nowrap border border-solid border-f1-border-secondary px-2 py-1 text-f1-foreground",
|
|
113
|
-
children: e[x] ?? ""
|
|
114
|
-
},
|
|
115
|
-
x
|
|
116
|
-
))
|
|
117
|
-
] }, l)) })
|
|
118
|
-
]
|
|
119
|
-
}
|
|
120
|
-
) }),
|
|
121
|
-
u.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: t.t("pdfViewer.showingFirstRows.other", {
|
|
122
|
-
count: k
|
|
123
|
-
}) })
|
|
124
|
-
] }) : /* @__PURE__ */ r(
|
|
125
|
-
V,
|
|
126
|
-
{
|
|
127
|
-
role: "status",
|
|
128
|
-
"aria-busy": !0,
|
|
129
|
-
"aria-label": t.pdfViewer.loading,
|
|
130
|
-
className: "min-h-0 w-full grow rounded-none"
|
|
131
|
-
}
|
|
132
|
-
)
|
|
133
|
-
] });
|
|
134
|
-
};
|
|
135
|
-
export {
|
|
136
|
-
O as default
|
|
137
|
-
};
|