@factorialco/f0-react 12.9.1 → 12.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 (113) hide show
  1. package/dist/ArchiveThumbnail-cs8kx5Zf.js +70 -0
  2. package/dist/ArchiveViewer-BXUH8Lm5.js +172 -0
  3. package/dist/{ChatPostComposerDialog-CWTlUs36.js → ChatPostComposerDialog-CGil1xkf.js} +4 -4
  4. package/dist/{CoachmarkProvider-BMunnTvE.js → CoachmarkProvider-cZnuTk79.js} +21047 -21041
  5. package/dist/CodeThumbnail-Dcer4AyK.js +31 -0
  6. package/dist/CodeViewer-DFBwdIFm.js +98 -0
  7. package/dist/DocumentToolbar-vZEyzJ89.js +74 -0
  8. package/dist/{DocxThumbnail-kHTNnwW0.js → DocxThumbnail-CK9vFoTB.js} +2 -2
  9. package/dist/{DocxViewer-C1yw4Yqt.js → DocxViewer-DQV5Kv1n.js} +25 -23
  10. package/dist/ExternalLink-RdKU698E.js +22 -0
  11. package/dist/{F0AiProcessingOverlay-cdj77_VP.js → F0AiProcessingOverlay-DjGkQ2Nc.js} +1903 -1795
  12. package/dist/{popover-BjrPOMeQ.js → F0Button-FXkThQ9H.js} +3164 -8587
  13. package/dist/{F0CanvasPanel-DPEwyR89.js → F0CanvasPanel-BgDo2LWP.js} +3704 -3274
  14. package/dist/F0DocumentViewer-BXifXzUW.js +79 -0
  15. package/dist/F0DocumentViewer-DWuIFBHu.js +3 -0
  16. package/dist/F0Icon-Cj0USbCF.js +202 -0
  17. package/dist/{F0Map-ZSo-alK8.js → F0Map-Dwev4u-_.js} +199 -191
  18. package/dist/{F0Select-B-ZxVjXG.js → F0Select-BWWdEd7l.js} +6696 -6726
  19. package/dist/{F0Text-D92NWQRd.js → F0Text-DMZW7dhN.js} +25 -41
  20. package/dist/{F0VideoPlayer-B1-tEFuq.js → F0VideoPlayer-BmCmHG87.js} +206 -202
  21. package/dist/F0VideoPlayer-C8oYUUZM.js +1 -0
  22. package/dist/HtmlThumbnail-BAgkBH2r.js +60 -0
  23. package/dist/HtmlViewer-FRfNoxhP.js +208 -0
  24. package/dist/LockLocked-gdodYvT_.js +41 -0
  25. package/dist/{Map-B_Hw6nIS.js → Map-BxGPElF2.js} +56 -53
  26. package/dist/{PdfThumbnail-BWqOqM04.js → PdfThumbnail-CpGZz5Kq.js} +5 -5
  27. package/dist/PdfViewer-C81MK43i.js +296 -0
  28. package/dist/SandboxedHtmlFrame-B6YWhgyg.js +309 -0
  29. package/dist/{SheetViewer-B8JTSi3B.js → SheetViewer-DPGpMNqq.js} +36 -26
  30. package/dist/TextThumbnail-DKNxh344.js +15 -0
  31. package/dist/{TextViewer-CEZd1H8u.js → TextViewer-BH42AeG8.js} +44 -41
  32. package/dist/ai.d.ts +3 -3
  33. package/dist/ai.js +5 -5
  34. package/dist/bash-BcZBmoDA.js +169 -0
  35. package/dist/c-Dv-5_kUQ.js +187 -0
  36. package/dist/component-status.js +2 -2
  37. package/dist/core-C0MCmPil.js +842 -0
  38. package/dist/cpp-CMQhucZt.js +236 -0
  39. package/dist/csharp-CuDKSCf2.js +260 -0
  40. package/dist/css-Dta7Q4Li.js +145 -0
  41. package/dist/dart-po7Eq73d.js +134 -0
  42. package/dist/diff-IgsQP-8T.js +39 -0
  43. package/dist/dist-D-MJbPvE.js +59 -0
  44. package/dist/dockerfile-B4Bz9I5u.js +34 -0
  45. package/dist/dos-1TcyLtUq.js +57 -0
  46. package/dist/elixir-BnEjyLGa.js +189 -0
  47. package/dist/erlang-tgri7ZSv.js +218 -0
  48. package/dist/experimental.d.ts +24 -4
  49. package/dist/experimental.js +5080 -4883
  50. package/dist/{exports-BdFDYdp1.d.ts → exports-C0yM5usu.d.ts} +13 -2
  51. package/dist/f0.d.ts +130 -8
  52. package/dist/f0.js +751 -745
  53. package/dist/fetchText-o_GOtiv3.js +54 -0
  54. package/dist/go-CEVmppuo.js +144 -0
  55. package/dist/graphql-BWwc-u8d.js +67 -0
  56. package/dist/groovy-BELuqtd6.js +127 -0
  57. package/dist/haskell-Cxh7aaFM.js +138 -0
  58. package/dist/highlight-CyebkDAD.js +114 -0
  59. package/dist/i18n-provider-BBhzYHef.js +150 -0
  60. package/dist/{i18n-provider-defaults-p0UGTA_k.js → i18n-provider-defaults-BUagKwGN.js} +32 -1
  61. package/dist/{i18n-provider-defaults-DQxuUMpU.d.ts → i18n-provider-defaults-CTDMMs-y.d.ts} +31 -0
  62. package/dist/i18n-provider-defaults.d.ts +1 -1
  63. package/dist/i18n-provider-defaults.js +1 -1
  64. package/dist/{index-DIwa_k8B.d.ts → index-CduxMW5L.d.ts} +16 -2
  65. package/dist/ini-DA-F0rRr.js +88 -0
  66. package/dist/java-Bujnoc_f.js +174 -0
  67. package/dist/javascript-BeEhpXRE.js +431 -0
  68. package/dist/json-CxvE7tEw.js +42 -0
  69. package/dist/kotlin-DOwDGI_m.js +206 -0
  70. package/dist/less-DWlR-e-o.js +196 -0
  71. package/dist/lua-BlZiakwh.js +46 -0
  72. package/dist/makefile-D3841Yg4.js +57 -0
  73. package/dist/{maplibre-BSY0r3_z.js → maplibre-g-8NG-3q.js} +1 -1
  74. package/dist/markdown-D1wNG79U.js +178 -0
  75. package/dist/objectivec-DxtRzTBy.js +117 -0
  76. package/dist/ownValue-D4uSXt0d.js +4 -0
  77. package/dist/{pdfWorker-DRgGoc3T.js → pdfWorker-D5NB2V5s.js} +12 -9
  78. package/dist/pdfWorkerConfig-BwllKt1K.js +8 -0
  79. package/dist/perl-BWRmkuyz.js +192 -0
  80. package/dist/php-CjwybYSP.js +300 -0
  81. package/dist/popover-CQztsDta.js +4486 -0
  82. package/dist/{posts-DGtDUrKT.js → posts-BHRBUAYJ.js} +2 -0
  83. package/dist/powershell-CgKcNA5Q.js +188 -0
  84. package/dist/properties-Bc45MTzW.js +38 -0
  85. package/dist/protobuf-Bv_xSUaI.js +61 -0
  86. package/dist/purify.es-ZpfdAuNV.js +545 -0
  87. package/dist/python-D8PdGjgy.js +238 -0
  88. package/dist/r-DA-9ZIdU.js +140 -0
  89. package/dist/{renderDocx-_UmnE-yc.js → renderDocx-BW-uDyaZ.js} +2 -0
  90. package/dist/ruby-Bqr16BpN.js +262 -0
  91. package/dist/rust-BCvJMwk8.js +182 -0
  92. package/dist/scala-Du8mOD2z.js +162 -0
  93. package/dist/scss-AMxHqh46.js +155 -0
  94. package/dist/skeleton-DqejhQgn.js +72 -0
  95. package/dist/sql-BbYSgcOA.js +118 -0
  96. package/dist/styles.css +1 -1
  97. package/dist/swift-DRKtalPn.js +575 -0
  98. package/dist/toolbarStyles-0IygMI4H.js +52 -0
  99. package/dist/{types-hr47rxX3.d.ts → types-DlwD3i9z.d.ts} +3 -95
  100. package/dist/typescript-Bv8uKU6V.js +516 -0
  101. package/dist/{useData-B7LYSzh0.js → useData-Dkq5W4r6.js} +4917 -4876
  102. package/dist/useFetchedText-BR3_KLXx.js +38 -0
  103. package/dist/useThumbnailText-DwXQvLIe.js +22 -0
  104. package/dist/xml-BVpP05uE.js +162 -0
  105. package/dist/yaml-BNe2WG-i.js +144 -0
  106. package/dist/zipTree-B2zUYl6b.js +247 -0
  107. package/package.json +2 -1
  108. package/dist/DocumentToolbar-iHZHYbFM.js +0 -70
  109. package/dist/F0DocumentViewer-CzNVxjsJ.js +0 -3
  110. package/dist/F0DocumentViewer-sRCjFb2O.js +0 -400
  111. package/dist/F0VideoPlayer-B4Nu7ugx.js +0 -1
  112. package/dist/TextThumbnail-X04JgaNI.js +0 -26
  113. package/dist/dist-DvxtFKDL.js +0 -78
@@ -1,400 +0,0 @@
1
- import { ar as e, b as t, ln as n, rn as r, rr as i, zt as a } from "./popover-BjrPOMeQ.js";
2
- import { L as o } from "./tooltip-BX4dSfeL.js";
3
- import { Co as s, Oa as c, Os as l, go as u } from "./F0CanvasPanel-DPEwyR89.js";
4
- import { X as d, q as f } from "./useData-B7LYSzh0.js";
5
- import { Er as p, dr as m, t as h } from "./F0Select-B-ZxVjXG.js";
6
- import { i as ee, n as g, r as _ } from "./pdfWorker-DRgGoc3T.js";
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
- import { jsx as E, jsxs as D } from "react/jsx-runtime";
9
- import './F0DocumentViewer.css';//#region src/addons/documents/F0DocumentViewer/components/PdfLoadingState.tsx
10
- var O = ({ label: e, width: t, height: r }) => /* @__PURE__ */ E("div", {
11
- role: "status",
12
- "aria-label": e,
13
- "aria-live": "polite",
14
- "aria-busy": !0,
15
- className: "F0DocumentViewer__page mx-auto w-fit px-4 pt-4 last:pb-4",
16
- children: /* @__PURE__ */ E(n, {
17
- style: {
18
- width: t,
19
- height: r
20
- },
21
- className: "rounded-lg border border-solid border-f1-border-secondary shadow-md"
22
- })
23
- }), k = ({ label: e, icon: n, onClick: r, size: i = "md" }) => /* @__PURE__ */ E(t, {
24
- label: e,
25
- icon: n,
26
- onClick: r,
27
- hideLabel: !0,
28
- variant: "outline",
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);
32
- return /* @__PURE__ */ D("div", {
33
- ref: e,
34
- role: "toolbar",
35
- "aria-label": O.toolbar,
36
- "data-placement": T,
37
- className: A(T),
38
- children: [
39
- i ? /* @__PURE__ */ D("span", {
40
- "aria-live": "polite",
41
- className: o("whitespace-nowrap text-sm font-medium", T === "top" ? "text-f1-foreground-secondary" : "pl-2 text-f1-foreground-inverse"),
42
- children: [
43
- t,
44
- " / ",
45
- n
46
- ]
47
- }) : null,
48
- /* @__PURE__ */ D("div", {
49
- className: M,
50
- children: [/* @__PURE__ */ E(k, {
51
- label: O.previousPage,
52
- onClick: ee,
53
- icon: p,
54
- size: "sm"
55
- }), /* @__PURE__ */ E(k, {
56
- label: O.nextPage,
57
- onClick: g,
58
- icon: d,
59
- size: "sm"
60
- })]
61
- }),
62
- /* @__PURE__ */ D("div", {
63
- className: M,
64
- children: [
65
- /* @__PURE__ */ E(k, {
66
- label: O.zoomOut,
67
- onClick: v,
68
- icon: f
69
- }),
70
- /* @__PURE__ */ E(k, {
71
- label: O.zoomIn,
72
- onClick: _,
73
- icon: m
74
- }),
75
- /* @__PURE__ */ E(h, {
76
- hideLabel: !0,
77
- label: O.scaleSelector,
78
- options: c,
79
- value: a,
80
- onChange: (e) => y(e)
81
- })
82
- ]
83
- }),
84
- /* @__PURE__ */ D("div", {
85
- className: M,
86
- children: [
87
- b ? /* @__PURE__ */ E(k, {
88
- label: O.rotate,
89
- onClick: x,
90
- icon: u
91
- }) : null,
92
- /* @__PURE__ */ E(k, {
93
- label: O.print,
94
- onClick: S,
95
- icon: s
96
- }),
97
- /* @__PURE__ */ E(k, {
98
- label: O.download,
99
- onClick: C,
100
- icon: l
101
- }),
102
- w?.map((e, t) => /* @__PURE__ */ E(k, {
103
- label: e.label,
104
- onClick: e.onClick,
105
- icon: e.icon
106
- }, `${e.label}-${t}`))
107
- ]
108
- })
109
- ]
110
- });
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
- e && e.width !== 0 && e.height !== 0 && (e.style.width = `${e.width / t}px`, e.style.height = `${e.height / t}px`);
113
- }, P = () => {
114
- let { pdfViewer: e } = r();
115
- return /* @__PURE__ */ D("div", {
116
- role: "status",
117
- "aria-busy": "true",
118
- "aria-live": "polite",
119
- "aria-label": e.loading,
120
- className: o("F0DocumentViewer__surface flex h-full w-full flex-col overflow-hidden", "border border-solid border-f1-border-secondary"),
121
- children: [/* @__PURE__ */ D("div", {
122
- className: "flex flex-row items-center justify-between gap-2 px-6 py-4",
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" })
127
- ]
128
- }), /* @__PURE__ */ E("div", {
129
- className: "flex flex-1 justify-center p-4",
130
- children: /* @__PURE__ */ E(n, { className: "h-full w-full max-w-[600px] rounded-md" })
131
- })]
132
- });
133
- }, F = async (e) => {
134
- let t = await e.saveDocument();
135
- return new Blob([new Uint8Array(t)], { type: "application/pdf" });
136
- }, ie = async (e) => {
137
- if (!e) return;
138
- let t = URL.createObjectURL(await F(e)), n = document.createElement("iframe");
139
- n.style.display = "none", n.src = t, n.onload = () => {
140
- n.focus(), n.contentWindow?.print();
141
- let e = () => {
142
- URL.revokeObjectURL(t), n.remove();
143
- };
144
- n.contentWindow?.addEventListener("afterprint", e), setTimeout(e, 6e4);
145
- }, document.body.appendChild(n);
146
- }, ae = async (e, t) => {
147
- if (!e) return;
148
- let n = URL.createObjectURL(await F(e)), r = document.createElement("a");
149
- r.href = n, r.download = t.length > 0 ? t : "document.pdf", document.body.appendChild(r), r.click(), r.remove(), URL.revokeObjectURL(n);
150
- }, I = async (e, t, n = !0) => {
151
- let r = e, i;
152
- try {
153
- let t = await fetch(e, { credentials: n ? "include" : "same-origin" });
154
- if (!t.ok) throw Error(`${t.status}`);
155
- i = URL.createObjectURL(await t.blob()), r = i;
156
- } catch {}
157
- let a = document.createElement("a");
158
- a.href = r, a.download = t ?? "", a.rel = "noreferrer", i || (a.target = "_blank"), document.body.appendChild(a), a.click(), a.remove(), i && URL.revokeObjectURL(i);
159
- }, L = [
160
- "0.5",
161
- "0.75",
162
- "1",
163
- "1.25",
164
- "1.5",
165
- "2",
166
- "3",
167
- "4"
168
- ], R = L.map(Number), oe = (e) => R.find((t) => t > e), se = (e) => [...R].reverse().find((t) => t < e), ce = (e, t, n) => {
169
- let r = n.width / t.width;
170
- return e === "page-width" ? r : Math.min(r, n.height / t.height);
171
- }, le = (e, t, n) => {
172
- let r = null, i = 0;
173
- return t.forEach((t, a) => {
174
- if (!t) return;
175
- let o = t.offsetHeight, s = t.offsetTop, c = s + o, l = e.offsetHeight - n, u = e.scrollTop + n, d = u + l;
176
- if (!(u < c && d > s)) return;
177
- let f;
178
- if (u <= s) f = d > c ? o : d - s;
179
- else {
180
- let e = u - s;
181
- d < c && (e += c - d), f = o - e;
182
- }
183
- f > i && (i = f, r = a + 1);
184
- }), r;
185
- };
186
- //#endregion
187
- //#region src/addons/documents/F0DocumentViewer/F0DocumentViewer.tsx
188
- g();
189
- var z = b(() => import("./SheetViewer-B8JTSi3B.js")), B = b(() => import("./DocxViewer-C1yw4Yqt.js")), V = b(() => import("./TextViewer-CEZd1H8u.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, {
192
- ref: t,
193
- toolbar: a,
194
- ...o
195
- });
196
- let { url: s, filename: c, actions: l, withCredentials: u = !0, page: d, pagesToDisplay: f, initialScale: p, rotatable: m, initialRotation: h, onRotationChange: ee, onPdfLoaded: g, onPageChange: _, ...y } = o;
197
- return /* @__PURE__ */ E("div", {
198
- ref: t,
199
- ...y,
200
- className: "F0DocumentViewer__surface relative flex h-full w-full flex-col overflow-hidden border border-solid border-f1-border-secondary",
201
- children: /* @__PURE__ */ D(v, {
202
- fallback: /* @__PURE__ */ E(n, { className: "h-full w-full rounded-none" }),
203
- children: [
204
- r === "sheet" ? /* @__PURE__ */ E(z, {
205
- url: s,
206
- filename: c,
207
- withCredentials: u,
208
- actions: l,
209
- toolbar: a
210
- }) : null,
211
- r === "docx" ? /* @__PURE__ */ E(B, {
212
- url: s,
213
- filename: c,
214
- withCredentials: u,
215
- actions: l,
216
- toolbar: a
217
- }) : null,
218
- r === "text" ? /* @__PURE__ */ E(V, {
219
- url: s,
220
- name: c ?? "",
221
- mimeType: i,
222
- withCredentials: u,
223
- actions: l,
224
- toolbar: a
225
- }) : null
226
- ]
227
- })
228
- });
229
- });
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(() => [
233
- {
234
- value: "page-width",
235
- label: b.pageWidth
236
- },
237
- {
238
- value: "page-fit",
239
- label: b.pageFit
240
- },
241
- ...L.map((e) => ({
242
- value: e,
243
- label: `${Number(e) * 100}%`
244
- }))
245
- ], [b.pageWidth, b.pageFit]), he = C(() => ({
246
- url: i,
247
- withCredentials: u
248
- }), [i, u]), X = x((e) => {
249
- let t = (q ?? 1) - 1, n = Math.min(Math.max(e, 0), t), r = K.current[n], i = r?.offsetParent;
250
- r && i instanceof HTMLElement && (i.scrollTop = r.offsetTop - J() - 10);
251
- }, [q, J]), Z = x((e) => {
252
- let t = N[R - 1], n = W.current;
253
- if (!t || !n) return;
254
- let r = G.current?.offsetHeight ?? 0, i = H === 90 || H === 270, a = (e) => i ? e.originalHeight : e.originalWidth, o = a(t), s = i ? t.originalWidth : t.originalHeight, c = e === "page-fit" ? Math.max(...N.filter(Boolean).map(a)) : o, l = ce(e, {
255
- width: c,
256
- height: s
257
- }, {
258
- width: n.clientWidth - ue,
259
- height: n.clientHeight - r - ue
260
- });
261
- I((e) => ne(e, l, c) ? e : l), V(e);
262
- }, [
263
- N,
264
- R,
265
- H
266
- ]), ge = x((e) => {
267
- e === "page-width" || e === "page-fit" ? Z(e) : (I(Number(e)), V(e));
268
- }, [Z]), Q = x((e) => {
269
- if (e === void 0) return;
270
- I(e);
271
- let t = L.find((t) => Number(t) === e);
272
- t && V(t);
273
- }, []), _e = x(() => Q(oe(F)), [F, Q]), ve = x(() => Q(se(F)), [F, Q]), ye = x(() => {
274
- U((e) => {
275
- let t = (e + 90) % 360;
276
- return p?.(t), t;
277
- });
278
- }, [p]), be = x((e) => {
279
- j(e), m?.(e), setTimeout(() => {
280
- z(s + 1), X(s);
281
- }, 0);
282
- }, [
283
- m,
284
- s,
285
- X
286
- ]), xe = x((e) => {
287
- let t = e.target;
288
- if (!(t instanceof HTMLElement)) return;
289
- let n = le(t, K.current, J());
290
- n && z(n);
291
- }, [J]), Se = x(() => {
292
- ie(A);
293
- }, [A]), Ce = x(() => {
294
- ae(A, o);
295
- }, [A, o]);
296
- S(() => {
297
- j(null), P([]), K.current = [];
298
- }, [i]), S(() => {
299
- X(s);
300
- }, [s, X]), S(() => {
301
- R > 0 && h?.(R);
302
- }, [R, h]), S(() => {
303
- N.length > 0 && (l === "page-width" || l === "page-fit") && Z(l);
304
- }, [N.length, l]), S(() => {
305
- (B === "page-width" || B === "page-fit") && Z(B);
306
- }, [H]);
307
- let $ = w();
308
- a({
309
- ref: W,
310
- onResize: () => {
311
- clearTimeout($.current), $.current = setTimeout(() => {
312
- (B === "page-width" || B === "page-fit") && Z(B);
313
- }, de);
314
- }
315
- }), S(function() {
316
- return () => clearTimeout($.current);
317
- }, []), S(() => {
318
- let e = W.current;
319
- if (!e) return;
320
- let t = (e) => {
321
- let t = e.target;
322
- t instanceof HTMLAnchorElement && (t.target = "_blank", t.rel = "noopener noreferrer");
323
- };
324
- return e.addEventListener("click", t, !0), () => e.removeEventListener("click", t, !0);
325
- }, []);
326
- let we = {
327
- toolbarRef: G,
328
- placement: v,
329
- currentPage: R,
330
- totalPages: q,
331
- hasDocument: !!A?.numPages,
332
- selectedScale: B,
333
- scaleOptions: me,
334
- onPreviousPage: () => X(R - 2),
335
- onNextPage: () => X(R),
336
- onZoomIn: _e,
337
- onZoomOut: ve,
338
- onScaleChange: ge,
339
- rotatable: d,
340
- onRotate: ye,
341
- onPrint: Se,
342
- onDownload: Ce,
343
- actions: g
344
- };
345
- return /* @__PURE__ */ D("div", {
346
- ref: t,
347
- ...y,
348
- className: "F0DocumentViewer__surface relative flex h-full w-full flex-col overflow-hidden border border-solid border-f1-border-secondary",
349
- children: [/* @__PURE__ */ D("div", {
350
- ref: W,
351
- onScroll: xe,
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, {
354
- file: he,
355
- onLoadSuccess: be,
356
- loading: /* @__PURE__ */ E(O, {
357
- label: b.loading,
358
- width: pe,
359
- height: Y
360
- }),
361
- children: A ? Array.from({ length: q ?? 0 }).map((e, t) => {
362
- let r = (c.length > 0 ? c[t] : t) + 1;
363
- return /* @__PURE__ */ E("div", {
364
- className: "F0DocumentViewer__page mx-auto w-fit px-4 pt-4 last:pb-4",
365
- children: /* @__PURE__ */ E(_, {
366
- className: "overflow-hidden rounded-lg border border-solid border-f1-border-secondary shadow-md",
367
- pageNumber: r,
368
- scale: te(F, H === 90 || H === 270 ? N[t]?.originalHeight : N[t]?.originalWidth),
369
- rotate: H,
370
- devicePixelRatio: k,
371
- loading: /* @__PURE__ */ E(n, { style: {
372
- width: pe,
373
- height: Y
374
- } }),
375
- renderForms: !0,
376
- renderTextLayer: !0,
377
- inputRef: (e) => {
378
- K.current[t] = e;
379
- },
380
- onRenderSuccess: () => re(K.current[t]?.querySelector("canvas"), k),
381
- onLoadSuccess: (e) => {
382
- P((n) => {
383
- let r = [...n];
384
- return r[t] = {
385
- originalWidth: e.originalWidth,
386
- originalHeight: e.originalHeight
387
- }, r;
388
- });
389
- }
390
- })
391
- }, t);
392
- }) : null
393
- }) : null]
394
- }), v === "floating" ? /* @__PURE__ */ E(M, { ...we }) : null]
395
- });
396
- });
397
- U.displayName = "PdfViewerBase";
398
- var W = e(i("F0DocumentViewer", c(H, P))), G = W;
399
- //#endregion
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 };
@@ -1 +0,0 @@
1
- export { t as F0VideoPlayer } from "./F0VideoPlayer-B1-tEFuq.js";
@@ -1,26 +0,0 @@
1
- import { useEffect as e, useRef as t, useState as n } from "react";
2
- import { jsx as r } from "react/jsx-runtime";
3
- //#region src/elements/primitives/_primitives/F0Attachments/components/thumbnails/TextThumbnail.tsx
4
- var i = 4096, a = ({ url: a, onError: o, onRendered: s }) => {
5
- let [c, l] = n(null), u = t(o);
6
- u.current = o;
7
- let d = t(s);
8
- return d.current = s, e(() => {
9
- let e = !1;
10
- return fetch(a).then((e) => {
11
- if (!e.ok) throw Error(`${e.status}`);
12
- return e.text();
13
- }).then((t) => {
14
- e || (t.trim() === "" ? u.current() : (l(t.slice(0, i)), d.current()));
15
- }).catch(() => {
16
- e || u.current();
17
- }), () => {
18
- e = !0;
19
- };
20
- }, [a]), c === null ? null : /* @__PURE__ */ r("pre", {
21
- className: "m-0 whitespace-pre-wrap break-words bg-f1-background p-3 text-left font-mono text-sm leading-5 text-f1-foreground-secondary",
22
- children: c
23
- });
24
- };
25
- //#endregion
26
- export { a as default };
@@ -1,78 +0,0 @@
1
- import { C as e, T as t, k as n } from "./popover-BjrPOMeQ.js";
2
- import r, { forwardRef as i } from "react";
3
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
4
- var s = i((e, t) => /* @__PURE__ */ o("svg", {
5
- xmlns: "http://www.w3.org/2000/svg",
6
- fill: "none",
7
- viewBox: "0 0 24 24",
8
- ref: t,
9
- ...e,
10
- children: [/* @__PURE__ */ a("path", {
11
- stroke: "currentColor",
12
- strokeLinecap: "round",
13
- strokeLinejoin: "round",
14
- d: "M10 5H8C6.34315 5 5 6.34315 5 8V16C5 17.6569 6.34315 19 8 19H16C17.6569 19 19 17.6569 19 16V13.5"
15
- }), /* @__PURE__ */ a("path", {
16
- stroke: "currentColor",
17
- strokeLinecap: "round",
18
- strokeLinejoin: "round",
19
- d: "M12.5 11.5L20 4M20 4H15.5M20 4V8.5"
20
- })]
21
- }));
22
- //#endregion
23
- //#region ../../node_modules/.pnpm/@radix-ui+react-collection@1.1.1_@types+react-dom@18.3.1_@types+react@18.3.18_react-dom_8b50dd17dda88491984286d0a66c0706/node_modules/@radix-ui/react-collection/dist/index.mjs
24
- function c(i) {
25
- let o = i + "CollectionProvider", [s, c] = n(o), [l, u] = s(o, {
26
- collectionRef: { current: null },
27
- itemMap: /* @__PURE__ */ new Map()
28
- }), d = (e) => {
29
- let { scope: t, children: n } = e, i = r.useRef(null), o = r.useRef(/* @__PURE__ */ new Map()).current;
30
- return /* @__PURE__ */ a(l, {
31
- scope: t,
32
- itemMap: o,
33
- collectionRef: i,
34
- children: n
35
- });
36
- };
37
- d.displayName = o;
38
- let f = i + "CollectionSlot", p = r.forwardRef((n, r) => {
39
- let { scope: i, children: o } = n, s = u(f, i), c = t(r, s.collectionRef);
40
- return /* @__PURE__ */ a(e, {
41
- ref: c,
42
- children: o
43
- });
44
- });
45
- p.displayName = f;
46
- let m = i + "CollectionItemSlot", h = "data-radix-collection-item", g = r.forwardRef((n, i) => {
47
- let { scope: o, children: s, ...c } = n, l = r.useRef(null), d = t(i, l), f = u(m, o);
48
- return r.useEffect(() => (f.itemMap.set(l, {
49
- ref: l,
50
- ...c
51
- }), () => void f.itemMap.delete(l))), /* @__PURE__ */ a(e, {
52
- [h]: "",
53
- ref: d,
54
- children: s
55
- });
56
- });
57
- g.displayName = m;
58
- function _(e) {
59
- let t = u(i + "CollectionConsumer", e);
60
- return r.useCallback(() => {
61
- let e = t.collectionRef.current;
62
- if (!e) return [];
63
- let n = Array.from(e.querySelectorAll(`[${h}]`));
64
- return Array.from(t.itemMap.values()).sort((e, t) => n.indexOf(e.ref.current) - n.indexOf(t.ref.current));
65
- }, [t.collectionRef, t.itemMap]);
66
- }
67
- return [
68
- {
69
- Provider: d,
70
- Slot: p,
71
- ItemSlot: g
72
- },
73
- _,
74
- c
75
- ];
76
- }
77
- //#endregion
78
- export { s as n, c as t };