@factorialco/f0-react 11.10.1 → 11.12.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/{ChatPostComposerDialog-s4prfEkC.js → ChatPostComposerDialog-3j5zits7.js} +4 -4
- package/dist/{CoachmarkProvider-DxDuinVA.js → CoachmarkProvider-BqDQTbBm.js} +2044 -2044
- package/dist/{DocumentToolbar-BuctnVHN.js → DocumentToolbar-BVXSCk6Q.js} +5 -5
- package/dist/{DocxViewer-CAGBzliC.js → DocxViewer-CJW0E-Dc.js} +2 -2
- package/dist/{F0AiProcessingOverlay-Dl_56dL9.js → F0AiProcessingOverlay-C4TJg7Ty.js} +511 -511
- package/dist/{F0CanvasPanel-C8MuYy_8.js → F0CanvasPanel-LsH7koo5.js} +2677 -2654
- package/dist/{F0DocumentViewer-C9gCxjxk.js → F0DocumentViewer-C559_ubP.js} +35 -35
- package/dist/F0DocumentViewer-DGjeNx30.js +3 -0
- package/dist/{F0Map-D4esyFFE.js → F0Map-CQndAu_Q.js} +100 -100
- package/dist/{F0Select-dBwkgMBc.js → F0Select-CY_CcXQ2.js} +1030 -1030
- package/dist/{F0Text-D0_mpu2P.js → F0Text-MLpPbWjh.js} +12 -12
- package/dist/{F0VideoPlayer-CUUQmvVm.js → F0VideoPlayer-BQG87AwT.js} +38 -38
- package/dist/F0VideoPlayer-iQW4yQlk.js +1 -0
- package/dist/{Map-DFCc5qR0.js → Map-DrtKJWqp.js} +17 -17
- package/dist/{PdfThumbnail-D09QDkNP.js → PdfThumbnail-V-2qCeAL.js} +1 -1
- package/dist/{SheetViewer-Cvd2xwE5.js → SheetViewer-nMaleah4.js} +4 -4
- package/dist/{TextViewer-Bk0Xz1nv.js → TextViewer-DktXuGxN.js} +2 -2
- package/dist/ai.d.ts +3 -3
- package/dist/ai.js +5 -5
- package/dist/component-status.js +1 -1
- package/dist/{dist-r1yM6TIs.js → dist-BB2MlAD_.js} +1 -1
- package/dist/experimental.d.ts +69 -4
- package/dist/experimental.js +5983 -5645
- package/dist/{exports-DsGJH4CD.d.ts → exports-YFGEaBWt.d.ts} +1 -1
- package/dist/f0.d.ts +4 -4
- package/dist/f0.js +326 -326
- package/dist/{i18n-provider-defaults-D7TVD4xk.js → i18n-provider-defaults-DD76Cjbd.js} +5 -0
- package/dist/{i18n-provider-defaults-14y_lreJ.d.ts → i18n-provider-defaults-iAsTLZ8q.d.ts} +6 -0
- package/dist/i18n-provider-defaults.d.ts +1 -1
- package/dist/i18n-provider-defaults.js +1 -1
- package/dist/{index-CL4pclEl.d.ts → index-Br3UrbPk.d.ts} +18 -1
- package/dist/{maplibre-B5inXAW8.js → maplibre-BaPc6h37.js} +1 -1
- package/dist/{pdfWorker-5t9rytw2.js → pdfWorker-Di6OBsJs.js} +1 -1
- package/dist/{popover-DquDnBKd.js → popover-C8rmkngm.js} +2 -2
- package/dist/{posts-DgzHTT_B.js → posts-DGtDUrKT.js} +2 -0
- package/dist/styles.css +1 -1
- package/dist/{types-Di2cYBLz.d.ts → types-CpvhOpCV.d.ts} +2 -2
- package/dist/{useData-BEZesy_8.js → useData-DqN-h3iG.js} +287 -287
- package/package.json +1 -1
- package/dist/F0DocumentViewer-CUkiuREP.js +0 -3
- package/dist/F0VideoPlayer-rLZ5qvuq.js +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ht as e, b as t, cr as n, fn as r, on as i, or as a } from "./popover-C8rmkngm.js";
|
|
2
2
|
import { L as o } from "./tooltip-BX4dSfeL.js";
|
|
3
|
-
import { _o as s, ka as c, ks as l, wo as u } from "./F0CanvasPanel-
|
|
4
|
-
import { K as d, Y as f } from "./useData-
|
|
5
|
-
import { Er as p, dr as m, t as h } from "./F0Select-
|
|
6
|
-
import { i as ee, n as g, r as _ } from "./pdfWorker-
|
|
3
|
+
import { _o as s, ka as c, ks as l, wo as u } from "./F0CanvasPanel-LsH7koo5.js";
|
|
4
|
+
import { K as d, Y as f } from "./useData-DqN-h3iG.js";
|
|
5
|
+
import { Er as p, dr as m, t as h } from "./F0Select-CY_CcXQ2.js";
|
|
6
|
+
import { i as ee, n as g, r as _ } from "./pdfWorker-Di6OBsJs.js";
|
|
7
7
|
import { Suspense as v, forwardRef as y, lazy as b, useCallback as x, useEffect as S, useMemo as C, useRef as w, useState as T } from "react";
|
|
8
8
|
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
9
9
|
import './F0DocumentViewer.css';//#region src/addons/documents/F0DocumentViewer/components/PdfLoadingState.tsx
|
|
10
|
-
var O = ({ label: e, width: t, height:
|
|
10
|
+
var O = ({ label: e, width: t, height: n }) => /* @__PURE__ */ E("div", {
|
|
11
11
|
role: "status",
|
|
12
12
|
"aria-label": e,
|
|
13
13
|
"aria-live": "polite",
|
|
14
14
|
"aria-busy": !0,
|
|
15
15
|
className: "F0DocumentViewer__page mx-auto w-fit px-4 pt-4 last:pb-4",
|
|
16
|
-
children: /* @__PURE__ */ E(
|
|
16
|
+
children: /* @__PURE__ */ E(r, {
|
|
17
17
|
style: {
|
|
18
18
|
width: t,
|
|
19
|
-
height:
|
|
19
|
+
height: n
|
|
20
20
|
},
|
|
21
21
|
className: "rounded-lg border border-solid border-f1-border-secondary shadow-md"
|
|
22
22
|
})
|
|
@@ -27,8 +27,8 @@ var O = ({ label: e, width: t, height: r }) => /* @__PURE__ */ E("div", {
|
|
|
27
27
|
hideLabel: !0,
|
|
28
28
|
variant: "outline",
|
|
29
29
|
size: i
|
|
30
|
-
}), A = (e) => o("z-10 flex flex-row items-center gap-2", e === "top" ? "F0DocumentViewer__surface sticky top-0 justify-between px-6 py-4" : "absolute bottom-4 left-1/2 w-max max-w-[calc(100%-2rem)] -translate-x-1/2 gap-4 rounded-xl bg-f1-background-inverse p-2 text-f1-foreground-inverse shadow-lg backdrop-blur-sm"), j = (e, t) => o("flex flex-row items-center gap-2", e === "floating" && "dark", t), M = ({ toolbarRef: e, currentPage: t, totalPages: n, hasDocument:
|
|
31
|
-
let { pdfViewer: O } =
|
|
30
|
+
}), A = (e) => o("z-10 flex flex-row items-center gap-2", e === "top" ? "F0DocumentViewer__surface sticky top-0 justify-between px-6 py-4" : "absolute bottom-4 left-1/2 w-max max-w-[calc(100%-2rem)] -translate-x-1/2 gap-4 rounded-xl bg-f1-background-inverse p-2 text-f1-foreground-inverse shadow-lg backdrop-blur-sm"), j = (e, t) => o("flex flex-row items-center gap-2", e === "floating" && "dark", t), M = ({ toolbarRef: e, currentPage: t, totalPages: n, hasDocument: r, selectedScale: a, scaleOptions: c, onPreviousPage: ee, onNextPage: g, onZoomIn: _, onZoomOut: v, onScaleChange: y, rotatable: b, onRotate: x, onPrint: S, onDownload: C, actions: w, placement: T }) => {
|
|
31
|
+
let { pdfViewer: O } = i(), M = j(T);
|
|
32
32
|
return /* @__PURE__ */ D("div", {
|
|
33
33
|
ref: e,
|
|
34
34
|
role: "toolbar",
|
|
@@ -36,7 +36,7 @@ var O = ({ label: e, width: t, height: r }) => /* @__PURE__ */ E("div", {
|
|
|
36
36
|
"data-placement": T,
|
|
37
37
|
className: A(T),
|
|
38
38
|
children: [
|
|
39
|
-
|
|
39
|
+
r ? /* @__PURE__ */ D("span", {
|
|
40
40
|
"aria-live": "polite",
|
|
41
41
|
className: o("whitespace-nowrap text-sm font-medium", T === "top" ? "text-f1-foreground-secondary" : "pl-2 text-f1-foreground-inverse"),
|
|
42
42
|
children: [
|
|
@@ -111,7 +111,7 @@ var O = ({ label: e, width: t, height: r }) => /* @__PURE__ */ E("div", {
|
|
|
111
111
|
}, te = (e, t) => t ? (N(e, t) + .001) / t : e, N = (e, t) => Math.round(t * e), ne = (e, t, n) => N(e, n) === N(t, n), re = (e, t = window.devicePixelRatio || 1) => {
|
|
112
112
|
e && e.width !== 0 && e.height !== 0 && (e.style.width = `${e.width / t}px`, e.style.height = `${e.height / t}px`);
|
|
113
113
|
}, P = () => {
|
|
114
|
-
let { pdfViewer: e } =
|
|
114
|
+
let { pdfViewer: e } = i();
|
|
115
115
|
return /* @__PURE__ */ D("div", {
|
|
116
116
|
role: "status",
|
|
117
117
|
"aria-busy": "true",
|
|
@@ -121,13 +121,13 @@ var O = ({ label: e, width: t, height: r }) => /* @__PURE__ */ E("div", {
|
|
|
121
121
|
children: [/* @__PURE__ */ D("div", {
|
|
122
122
|
className: "flex flex-row items-center justify-between gap-2 px-6 py-4",
|
|
123
123
|
children: [
|
|
124
|
-
/* @__PURE__ */ E(
|
|
125
|
-
/* @__PURE__ */ E(
|
|
126
|
-
/* @__PURE__ */ E(
|
|
124
|
+
/* @__PURE__ */ E(r, { className: "h-8 w-24 rounded-md" }),
|
|
125
|
+
/* @__PURE__ */ E(r, { className: "h-8 w-40 rounded-md" }),
|
|
126
|
+
/* @__PURE__ */ E(r, { className: "h-8 w-20 rounded-md" })
|
|
127
127
|
]
|
|
128
128
|
}), /* @__PURE__ */ E("div", {
|
|
129
129
|
className: "flex flex-1 justify-center p-4",
|
|
130
|
-
children: /* @__PURE__ */ E(
|
|
130
|
+
children: /* @__PURE__ */ E(r, { className: "h-full w-full max-w-[600px] rounded-md" })
|
|
131
131
|
})]
|
|
132
132
|
});
|
|
133
133
|
}, F = async (e) => {
|
|
@@ -186,9 +186,9 @@ var O = ({ label: e, width: t, height: r }) => /* @__PURE__ */ E("div", {
|
|
|
186
186
|
//#endregion
|
|
187
187
|
//#region src/addons/documents/F0DocumentViewer/F0DocumentViewer.tsx
|
|
188
188
|
g();
|
|
189
|
-
var z = b(() => import("./SheetViewer-
|
|
190
|
-
let { kind:
|
|
191
|
-
if (
|
|
189
|
+
var z = b(() => import("./SheetViewer-nMaleah4.js")), B = b(() => import("./DocxViewer-CJW0E-Dc.js")), V = b(() => import("./TextViewer-DktXuGxN.js")), ue = 48, de = 150, H = y((e, t) => {
|
|
190
|
+
let { kind: n = "pdf", mimeType: i, toolbar: a = "top", ...o } = e;
|
|
191
|
+
if (n === "pdf") return /* @__PURE__ */ E(U, {
|
|
192
192
|
ref: t,
|
|
193
193
|
toolbar: a,
|
|
194
194
|
...o
|
|
@@ -199,23 +199,23 @@ var z = b(() => import("./SheetViewer-Cvd2xwE5.js")), B = b(() => import("./Docx
|
|
|
199
199
|
...y,
|
|
200
200
|
className: "F0DocumentViewer__surface relative flex h-full w-full flex-col overflow-hidden border border-solid border-f1-border-secondary",
|
|
201
201
|
children: /* @__PURE__ */ D(v, {
|
|
202
|
-
fallback: /* @__PURE__ */ E(
|
|
202
|
+
fallback: /* @__PURE__ */ E(r, { className: "h-full w-full rounded-none" }),
|
|
203
203
|
children: [
|
|
204
|
-
|
|
204
|
+
n === "sheet" ? /* @__PURE__ */ E(z, {
|
|
205
205
|
url: s,
|
|
206
206
|
filename: c,
|
|
207
207
|
withCredentials: u,
|
|
208
208
|
actions: l,
|
|
209
209
|
toolbar: a
|
|
210
210
|
}) : null,
|
|
211
|
-
|
|
211
|
+
n === "docx" ? /* @__PURE__ */ E(B, {
|
|
212
212
|
url: s,
|
|
213
213
|
filename: c,
|
|
214
214
|
withCredentials: u,
|
|
215
215
|
actions: l,
|
|
216
216
|
toolbar: a
|
|
217
217
|
}) : null,
|
|
218
|
-
|
|
218
|
+
n === "text" ? /* @__PURE__ */ E(V, {
|
|
219
219
|
url: s,
|
|
220
220
|
name: c ?? "",
|
|
221
221
|
mimeType: i,
|
|
@@ -228,8 +228,8 @@ var z = b(() => import("./SheetViewer-Cvd2xwE5.js")), B = b(() => import("./Docx
|
|
|
228
228
|
});
|
|
229
229
|
});
|
|
230
230
|
H.displayName = "F0DocumentViewer";
|
|
231
|
-
var U = y((
|
|
232
|
-
let { url:
|
|
231
|
+
var U = y((t, n) => {
|
|
232
|
+
let { url: a, filename: o = "document.pdf", page: s = 0, pagesToDisplay: c = [], initialScale: l = "page-width", withCredentials: u = !0, rotatable: d = !1, initialRotation: f = 0, onRotationChange: p, onPdfLoaded: m, onPageChange: h, actions: g, toolbar: v = "top", ...y } = t, { pdfViewer: b } = i(), k = Math.max(2, typeof window > "u" ? 1 : window.devicePixelRatio || 1), [A, j] = T(null), [N, P] = T([]), [F, I] = T(1), [R, z] = T(0), [B, V] = T(l), [H, U] = T(f), W = w(null), G = w(null), K = w([]), q = c.length > 0 ? c.length : A?.numPages, J = x(() => v === "top" ? G.current?.offsetHeight ?? 0 : 0, [v]), fe = N.find(Boolean), pe = (fe?.originalWidth ?? 595) * F, Y = (fe?.originalHeight ?? 842) * F, me = C(() => [
|
|
233
233
|
{
|
|
234
234
|
value: "page-width",
|
|
235
235
|
label: b.pageWidth
|
|
@@ -243,9 +243,9 @@ var U = y((e, t) => {
|
|
|
243
243
|
label: `${Number(e) * 100}%`
|
|
244
244
|
}))
|
|
245
245
|
], [b.pageWidth, b.pageFit]), he = C(() => ({
|
|
246
|
-
url:
|
|
246
|
+
url: a,
|
|
247
247
|
withCredentials: u
|
|
248
|
-
}), [
|
|
248
|
+
}), [a, u]), X = x((e) => {
|
|
249
249
|
let t = (q ?? 1) - 1, n = Math.min(Math.max(e, 0), t), r = K.current[n], i = r?.offsetParent;
|
|
250
250
|
r && i instanceof HTMLElement && (i.scrollTop = r.offsetTop - J() - 10);
|
|
251
251
|
}, [q, J]), Z = x((e) => {
|
|
@@ -295,7 +295,7 @@ var U = y((e, t) => {
|
|
|
295
295
|
}, [A, o]);
|
|
296
296
|
S(() => {
|
|
297
297
|
j(null), P([]), K.current = [];
|
|
298
|
-
}, [
|
|
298
|
+
}, [a]), S(() => {
|
|
299
299
|
X(s);
|
|
300
300
|
}, [s, X]), S(() => {
|
|
301
301
|
R > 0 && h?.(R);
|
|
@@ -305,7 +305,7 @@ var U = y((e, t) => {
|
|
|
305
305
|
(B === "page-width" || B === "page-fit") && Z(B);
|
|
306
306
|
}, [H]);
|
|
307
307
|
let $ = w();
|
|
308
|
-
|
|
308
|
+
e({
|
|
309
309
|
ref: W,
|
|
310
310
|
onResize: () => {
|
|
311
311
|
clearTimeout($.current), $.current = setTimeout(() => {
|
|
@@ -343,14 +343,14 @@ var U = y((e, t) => {
|
|
|
343
343
|
actions: g
|
|
344
344
|
};
|
|
345
345
|
return /* @__PURE__ */ D("div", {
|
|
346
|
-
ref:
|
|
346
|
+
ref: n,
|
|
347
347
|
...y,
|
|
348
348
|
className: "F0DocumentViewer__surface relative flex h-full w-full flex-col overflow-hidden border border-solid border-f1-border-secondary",
|
|
349
349
|
children: [/* @__PURE__ */ D("div", {
|
|
350
350
|
ref: W,
|
|
351
351
|
onScroll: xe,
|
|
352
352
|
className: "F0DocumentViewer__surface relative flex h-full flex-col overflow-auto [scrollbar-gutter:stable_both-edges]",
|
|
353
|
-
children: [v === "top" ? /* @__PURE__ */ E(M, { ...we }) : null,
|
|
353
|
+
children: [v === "top" ? /* @__PURE__ */ E(M, { ...we }) : null, a ? /* @__PURE__ */ E(ee, {
|
|
354
354
|
file: he,
|
|
355
355
|
onLoadSuccess: be,
|
|
356
356
|
loading: /* @__PURE__ */ E(O, {
|
|
@@ -359,16 +359,16 @@ var U = y((e, t) => {
|
|
|
359
359
|
height: Y
|
|
360
360
|
}),
|
|
361
361
|
children: A ? Array.from({ length: q ?? 0 }).map((e, t) => {
|
|
362
|
-
let
|
|
362
|
+
let n = (c.length > 0 ? c[t] : t) + 1;
|
|
363
363
|
return /* @__PURE__ */ E("div", {
|
|
364
364
|
className: "F0DocumentViewer__page mx-auto w-fit px-4 pt-4 last:pb-4",
|
|
365
365
|
children: /* @__PURE__ */ E(_, {
|
|
366
366
|
className: "overflow-hidden rounded-lg border border-solid border-f1-border-secondary shadow-md",
|
|
367
|
-
pageNumber:
|
|
367
|
+
pageNumber: n,
|
|
368
368
|
scale: te(F, H === 90 || H === 270 ? N[t]?.originalHeight : N[t]?.originalWidth),
|
|
369
369
|
rotate: H,
|
|
370
370
|
devicePixelRatio: k,
|
|
371
|
-
loading: /* @__PURE__ */ E(
|
|
371
|
+
loading: /* @__PURE__ */ E(r, { style: {
|
|
372
372
|
width: pe,
|
|
373
373
|
height: Y
|
|
374
374
|
} }),
|
|
@@ -395,6 +395,6 @@ var U = y((e, t) => {
|
|
|
395
395
|
});
|
|
396
396
|
});
|
|
397
397
|
U.displayName = "PdfViewerBase";
|
|
398
|
-
var W =
|
|
398
|
+
var W = n(a("F0DocumentViewer", c(H, P))), G = W;
|
|
399
399
|
//#endregion
|
|
400
400
|
export { oe as a, j as c, se as i, k as l, G as n, I as o, L as r, A as s, W as t };
|