@factorialco/f0-react 8.28.3 → 8.28.4

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 (36) hide show
  1. package/dist/{ChatDocxThumbnail-D5hDwmp7.js → ChatDocxThumbnail-DTpOzL9A.js} +7 -7
  2. package/dist/{ChatPdfThumbnail-Cf74m771.js → ChatPdfThumbnail-QKm8T1iP.js} +1 -1
  3. package/dist/{ChatPostComposerDialog-pRNELk68.js → ChatPostComposerDialog-DF5B8NLo.js} +3 -3
  4. package/dist/{ChatSheetThumbnail-D8aN1W_0.js → ChatSheetThumbnail-CyiwSdZJ.js} +1 -1
  5. package/dist/{DocumentToolbar-C4DUcWl7.js → DocumentToolbar-BAa5mh7x.js} +2 -2
  6. package/dist/{DocxViewer-M4FGdd_h.js → DocxViewer-CYBh46FI.js} +7 -7
  7. package/dist/{F0AiProcessingOverlay-Cpx37q3a.js → F0AiProcessingOverlay-3H79lgMd.js} +1 -1
  8. package/dist/{F0CanvasPanel-CRTe0CIF.js → F0CanvasPanel-DAEeI3lV.js} +199 -199
  9. package/dist/{F0Map-BywRoarL.js → F0Map-B7PwCmUl.js} +4 -4
  10. package/dist/{F0VideoPlayer-DUv08bcV.js → F0VideoPlayer-CNvEtJ9U.js} +18 -18
  11. package/dist/{MapProvider-CTtL5mc3.js → MapProvider-WM9ZFI_s.js} +2 -2
  12. package/dist/SheetViewer-CvQ24W5k.js +123 -0
  13. package/dist/{TextViewer-54DAaDA1.js → TextViewer-uZnjAB6W.js} +2 -2
  14. package/dist/ai.d.ts +6 -6
  15. package/dist/ai.js +2 -2
  16. package/dist/component-status.d.ts +6 -6
  17. package/dist/component-status.js +1 -1
  18. package/dist/{experimental-STLmChcB.js → experimental-Bzwkrec6.js} +179 -179
  19. package/dist/experimental.d.ts +6 -6
  20. package/dist/experimental.js +40 -40
  21. package/dist/f0.d.ts +6 -6
  22. package/dist/f0.js +10 -10
  23. package/dist/i18n-provider-defaults.d.ts +6 -6
  24. package/dist/{index-DFrzKaGA.js → index-98s6Ae16.js} +62 -62
  25. package/dist/{index-9MKvlApA.js → index-B1tQWotf.js} +28 -28
  26. package/dist/{index-BXS__6p-.js → index-BuHr35P1.js} +15 -15
  27. package/dist/{index-CKzBQYgd.js → index-Ck8-Kqxo.js} +2 -2
  28. package/dist/index-D4H-LP6r.js +4 -0
  29. package/dist/{pdfWorker-DACTjTuR.js → pdfWorker-C8Mu95m3.js} +2 -2
  30. package/dist/{docx-preview-BaRDMyPN.js → renderDocx-CVEzw9MK.js} +920 -901
  31. package/dist/sheetPreview-Bqj3xODH.js +51 -0
  32. package/dist/styles.css +1 -1
  33. package/package.json +1 -1
  34. package/dist/SheetViewer-BK9NNMZ9.js +0 -111
  35. package/dist/index-D0rQW0DI.js +0 -4
  36. package/dist/sheetPreview-Djc-YyVs.js +0 -37
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factorialco/f0-react",
3
- "version": "8.28.3",
3
+ "version": "8.28.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/factorialco/f0.git",
@@ -1,111 +0,0 @@
1
- import { jsx as r, jsxs as n, Fragment as k } from "react/jsx-runtime";
2
- import { useState as f, useEffect as S } from "react";
3
- import { u as V, T as E, h as R, S as z } from "./F0CanvasPanel-CRTe0CIF.js";
4
- import { f as _, c as j } from "./sheetPreview-Djc-YyVs.js";
5
- import { u as F, D as I } from "./DocumentToolbar-C4DUcWl7.js";
6
- const x = 1e3, T = 100, O = ({
7
- url: a,
8
- filename: w,
9
- withCredentials: l = !0,
10
- actions: N,
11
- toolbar: c = "top"
12
- }) => {
13
- const d = V(), m = F(), [t, u] = f(null), [v, i] = f(!1), [h, b] = f(0);
14
- S(() => {
15
- let e = !1;
16
- return u(null), i(!1), b(0), _(a, {
17
- maxRows: x,
18
- maxCols: T,
19
- withCredentials: l
20
- }).then((o) => {
21
- e || (o.length === 0 ? i(!0) : u(o));
22
- }).catch(() => {
23
- e || i(!0);
24
- }), () => {
25
- e = !0;
26
- };
27
- }, [a, l]);
28
- const s = t ? t[Math.min(h, t.length - 1)] : null, p = s ? j(s.rows) : [], g = /* @__PURE__ */ r(
29
- I,
30
- {
31
- url: a,
32
- filename: w,
33
- withCredentials: l,
34
- actions: N,
35
- zoom: m,
36
- placement: c,
37
- children: t && t.length > 1 ? /* @__PURE__ */ r(
38
- E,
39
- {
40
- type: "single",
41
- size: "sm",
42
- value: String(h),
43
- onValueChange: (e) => {
44
- e && b(Number(e));
45
- },
46
- className: "justify-start",
47
- children: t.map((e, o) => /* @__PURE__ */ r(
48
- R,
49
- {
50
- value: String(o),
51
- className: "whitespace-nowrap",
52
- children: e.name
53
- },
54
- `${e.name}-${o}`
55
- ))
56
- }
57
- ) : null
58
- }
59
- );
60
- return /* @__PURE__ */ n("div", { className: "relative flex h-full w-full flex-col bg-f1-background", children: [
61
- c === "top" ? g : null,
62
- v ? /* @__PURE__ */ r("div", { className: "flex min-h-0 grow items-center justify-center text-f1-foreground-secondary", children: d.pdfViewer.previewFailed }) : s ? /* @__PURE__ */ n(k, { children: [
63
- /* @__PURE__ */ r("div", { className: "min-h-0 grow overflow-auto", children: /* @__PURE__ */ n(
64
- "table",
65
- {
66
- className: "border-collapse text-sm",
67
- style: { zoom: m.scale },
68
- children: [
69
- /* @__PURE__ */ r("thead", { children: /* @__PURE__ */ n("tr", { children: [
70
- /* @__PURE__ */ r("th", { className: "sticky top-0 z-10 border border-solid border-f1-border-secondary bg-f1-background-secondary px-2 py-1" }),
71
- p.map((e) => /* @__PURE__ */ r(
72
- "th",
73
- {
74
- 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",
75
- children: e
76
- },
77
- e
78
- ))
79
- ] }) }),
80
- /* @__PURE__ */ r("tbody", { children: s.rows.map((e, o) => /* @__PURE__ */ n("tr", { children: [
81
- /* @__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 }),
82
- p.map((W, y) => /* @__PURE__ */ r(
83
- "td",
84
- {
85
- className: "whitespace-nowrap border border-solid border-f1-border-secondary px-2 py-1 text-f1-foreground",
86
- children: e[y] ?? ""
87
- },
88
- y
89
- ))
90
- ] }, o)) })
91
- ]
92
- }
93
- ) }),
94
- 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: d.t("pdfViewer.showingFirstRows.other", {
95
- count: x
96
- }) }) : null
97
- ] }) : /* @__PURE__ */ r(
98
- z,
99
- {
100
- role: "status",
101
- "aria-busy": !0,
102
- "aria-label": d.pdfViewer.loading,
103
- className: "min-h-0 w-full grow rounded-none"
104
- }
105
- ),
106
- c === "floating" ? g : null
107
- ] });
108
- };
109
- export {
110
- O as default
111
- };
@@ -1,4 +0,0 @@
1
- import { F as r } from "./F0VideoPlayer-DUv08bcV.js";
2
- export {
3
- r as F0VideoPlayer
4
- };
@@ -1,37 +0,0 @@
1
- import { read as d, utils as c } from "./xlsx-CzlURDDb.js";
2
- const i = (n, { maxRows: o, maxCols: s }) => {
3
- const r = d(n, { type: "array" });
4
- return r.SheetNames.map((t) => {
5
- const a = r.Sheets[t], f = a?.["!ref"];
6
- if (!a || !f)
7
- return { name: t, rows: [], truncatedRows: !1 };
8
- const e = c.decode_range(f), h = e.e.r - e.s.r + 1 > o;
9
- e.e.r = Math.min(e.e.r, e.s.r + o - 1), e.e.c = Math.min(e.e.c, e.s.c + s - 1);
10
- const u = c.sheet_to_json(a, {
11
- header: 1,
12
- raw: !1,
13
- // formatted text, not raw values
14
- defval: "",
15
- range: e
16
- });
17
- return { name: t, rows: u, truncatedRows: h };
18
- });
19
- }, w = (n) => {
20
- const o = n.reduce((s, r) => Math.max(s, r.length), 0);
21
- return Array.from({ length: o }, (s, r) => c.encode_col(r));
22
- }, k = async (n, {
23
- maxRows: o,
24
- maxCols: s,
25
- withCredentials: r = !0
26
- }) => {
27
- const t = await fetch(n, {
28
- credentials: r ? "include" : "same-origin"
29
- });
30
- if (!t.ok)
31
- throw new Error(`Failed to fetch sheet: ${t.status}`);
32
- return i(await t.arrayBuffer(), { maxRows: o, maxCols: s });
33
- };
34
- export {
35
- w as c,
36
- k as f
37
- };