@factorialco/f0-react 11.10.0 → 11.11.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 (41) hide show
  1. package/dist/{ChatPostComposerDialog-s4prfEkC.js → ChatPostComposerDialog-BqAJZqD9.js} +4 -4
  2. package/dist/{CoachmarkProvider-DxDuinVA.js → CoachmarkProvider-DCHKWnIq.js} +2044 -2044
  3. package/dist/{DocumentToolbar-BuctnVHN.js → DocumentToolbar-BU9PTMlI.js} +5 -5
  4. package/dist/{DocxViewer-CAGBzliC.js → DocxViewer-8FiXi45s.js} +2 -2
  5. package/dist/{F0AiProcessingOverlay-Dl_56dL9.js → F0AiProcessingOverlay-L6LooNzN.js} +511 -511
  6. package/dist/{F0CanvasPanel-C8MuYy_8.js → F0CanvasPanel-D--qira6.js} +2641 -2623
  7. package/dist/{F0DocumentViewer-C9gCxjxk.js → F0DocumentViewer-C7Wv7NTY.js} +35 -35
  8. package/dist/F0DocumentViewer-DACK-OvI.js +3 -0
  9. package/dist/{F0Map-D4esyFFE.js → F0Map-DbbjpLjI.js} +100 -100
  10. package/dist/{F0Select-dBwkgMBc.js → F0Select-CY_CcXQ2.js} +1030 -1030
  11. package/dist/{F0Text-D0_mpu2P.js → F0Text-MLpPbWjh.js} +12 -12
  12. package/dist/{F0VideoPlayer-CUUQmvVm.js → F0VideoPlayer-BFo3wQQU.js} +38 -38
  13. package/dist/F0VideoPlayer-D7RCk_24.js +1 -0
  14. package/dist/{Map-DFCc5qR0.js → Map-BfheF0i_.js} +17 -17
  15. package/dist/{PdfThumbnail-D09QDkNP.js → PdfThumbnail-B8kgKi-5.js} +1 -1
  16. package/dist/{SheetViewer-Cvd2xwE5.js → SheetViewer-Dy1cNTbd.js} +4 -4
  17. package/dist/{TextViewer-Bk0Xz1nv.js → TextViewer-DSec8GUk.js} +2 -2
  18. package/dist/ai.d.ts +3 -3
  19. package/dist/ai.js +5 -5
  20. package/dist/component-status.js +1 -1
  21. package/dist/{dist-r1yM6TIs.js → dist-BB2MlAD_.js} +1 -1
  22. package/dist/experimental.d.ts +85 -4
  23. package/dist/experimental.js +5370 -5027
  24. package/dist/{exports-DsGJH4CD.d.ts → exports-CJtG_boZ.d.ts} +1 -1
  25. package/dist/f0.d.ts +4 -4
  26. package/dist/f0.js +326 -326
  27. package/dist/{i18n-provider-defaults-D7TVD4xk.js → i18n-provider-defaults-DD76Cjbd.js} +5 -0
  28. package/dist/{i18n-provider-defaults-14y_lreJ.d.ts → i18n-provider-defaults-iAsTLZ8q.d.ts} +6 -0
  29. package/dist/i18n-provider-defaults.d.ts +1 -1
  30. package/dist/i18n-provider-defaults.js +1 -1
  31. package/dist/{index-CL4pclEl.d.ts → index-DGmIutN2.d.ts} +1 -1
  32. package/dist/{maplibre-B5inXAW8.js → maplibre-Dg0SWOg-.js} +1 -1
  33. package/dist/{pdfWorker-5t9rytw2.js → pdfWorker-CK_VPj2f.js} +1 -1
  34. package/dist/{popover-DquDnBKd.js → popover-C8rmkngm.js} +2 -2
  35. package/dist/{posts-DgzHTT_B.js → posts-DGtDUrKT.js} +2 -0
  36. package/dist/styles.css +1 -1
  37. package/dist/{types-Di2cYBLz.d.ts → types-BkW50Whp.d.ts} +2 -2
  38. package/dist/{useData-BEZesy_8.js → useData-DqN-h3iG.js} +287 -287
  39. package/package.json +1 -1
  40. package/dist/F0DocumentViewer-CUkiuREP.js +0 -3
  41. package/dist/F0VideoPlayer-rLZ5qvuq.js +0 -1
@@ -1,22 +1,22 @@
1
- import { ar as e, b as t, ln as n, rn as r, rr as i, zt as a } from "./popover-DquDnBKd.js";
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-C8MuYy_8.js";
4
- import { K as d, Y as f } from "./useData-BEZesy_8.js";
5
- import { Er as p, dr as m, t as h } from "./F0Select-dBwkgMBc.js";
6
- import { i as ee, n as g, r as _ } from "./pdfWorker-5t9rytw2.js";
3
+ import { _o as s, ka as c, ks as l, wo as u } from "./F0CanvasPanel-D--qira6.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-CK_VPj2f.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: r }) => /* @__PURE__ */ E("div", {
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(n, {
16
+ children: /* @__PURE__ */ E(r, {
17
17
  style: {
18
18
  width: t,
19
- height: r
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: i, 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 } = r(), M = j(T);
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
- i ? /* @__PURE__ */ D("span", {
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 } = r();
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(n, { className: "h-8 w-24 rounded-md" }),
125
- /* @__PURE__ */ E(n, { className: "h-8 w-40 rounded-md" }),
126
- /* @__PURE__ */ E(n, { className: "h-8 w-20 rounded-md" })
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(n, { className: "h-full w-full max-w-[600px] rounded-md" })
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-Cvd2xwE5.js")), B = b(() => import("./DocxViewer-CAGBzliC.js")), V = b(() => import("./TextViewer-Bk0Xz1nv.js")), ue = 48, de = 150, H = y((e, t) => {
190
- let { kind: r = "pdf", mimeType: i, toolbar: a = "top", ...o } = e;
191
- if (r === "pdf") return /* @__PURE__ */ E(U, {
189
+ var z = b(() => import("./SheetViewer-Dy1cNTbd.js")), B = b(() => import("./DocxViewer-8FiXi45s.js")), V = b(() => import("./TextViewer-DSec8GUk.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(n, { className: "h-full w-full rounded-none" }),
202
+ fallback: /* @__PURE__ */ E(r, { className: "h-full w-full rounded-none" }),
203
203
  children: [
204
- r === "sheet" ? /* @__PURE__ */ E(z, {
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
- r === "docx" ? /* @__PURE__ */ E(B, {
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
- r === "text" ? /* @__PURE__ */ E(V, {
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((e, t) => {
232
- let { url: i, 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 } = e, { pdfViewer: b } = r(), 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(() => [
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: i,
246
+ url: a,
247
247
  withCredentials: u
248
- }), [i, u]), X = x((e) => {
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
- }, [i]), S(() => {
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
- a({
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: t,
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, i ? /* @__PURE__ */ E(ee, {
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 r = (c.length > 0 ? c[t] : t) + 1;
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: r,
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(n, { style: {
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 = e(i("F0DocumentViewer", c(H, P))), G = 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 };
@@ -0,0 +1,3 @@
1
+ import "./pdfWorker-CK_VPj2f.js";
2
+ export { t as F0DocumentViewer } from "./F0DocumentViewer-C7Wv7NTY.js";
3
+ import "./f0.js";