@factorialco/f0-react 12.10.0 → 12.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/ArchiveThumbnail-b34U-zTc.js +70 -0
- package/dist/ArchiveViewer-BpmryW7A.js +172 -0
- package/dist/{ChatPostComposerDialog-DcmLrQk6.js → ChatPostComposerDialog-Cr207fXs.js} +4 -4
- package/dist/{CoachmarkProvider-XfLjB3dH.js → CoachmarkProvider-CsytVD-X.js} +29764 -29935
- package/dist/CodeThumbnail-8NiQ3uzU.js +31 -0
- package/dist/CodeViewer-BNZqt-5s.js +98 -0
- package/dist/DocumentToolbar-DUe9R1rU.js +74 -0
- package/dist/{DocxThumbnail-kHTNnwW0.js → DocxThumbnail-CK9vFoTB.js} +2 -2
- package/dist/{DocxViewer-CqHgSExq.js → DocxViewer-BUMy2iL7.js} +25 -23
- package/dist/ExternalLink-RdKU698E.js +22 -0
- package/dist/{F0AiProcessingOverlay-H23WHd7F.js → F0AiProcessingOverlay-CiUTeBwG.js} +1388 -1384
- package/dist/F0Alert-Ca8sBfXN.js +102 -0
- package/dist/F0AudioPlayer-BefDLQA2.js +1083 -0
- package/dist/F0AudioPlayer-CNb4kXOk.js +3 -0
- package/dist/{popover-BjrPOMeQ.js → F0Button-d91IgOnc.js} +3164 -8587
- package/dist/{F0CanvasPanel--hLKeQvg.js → F0CanvasPanel-BOo_mxBl.js} +10286 -9593
- package/dist/F0DocumentViewer-CaYAO9ok.js +3 -0
- package/dist/F0DocumentViewer-h0XY5tgT.js +90 -0
- package/dist/F0Icon-DmCBV0gK.js +202 -0
- package/dist/{F0Map-hvgCUGk8.js → F0Map-b1uYlF_H.js} +614 -613
- package/dist/F0SegmentedControl-DXoAzTmH.js +103 -0
- package/dist/{F0Select-B-ZxVjXG.js → F0Select-BZ20yXKy.js} +9172 -9251
- package/dist/{F0VideoPlayer-CNp5hXgp.js → F0VideoPlayer-D85XCpqh.js} +390 -430
- package/dist/F0VideoPlayer-_zLFiEIp.js +1 -0
- package/dist/HtmlThumbnail-BJuJkuvu.js +60 -0
- package/dist/HtmlViewer-DxOnMV30.js +208 -0
- package/dist/LayoutGroup-BGb5jMxE.js +57 -0
- package/dist/LockLocked-gdodYvT_.js +41 -0
- package/dist/{Map-eIXVKc1x.js → Map-BOMgctnS.js} +55 -52
- package/dist/{PdfThumbnail-CCSmwxQU.js → PdfThumbnail-98PDy4ud.js} +5 -5
- package/dist/PdfViewer-nBnKrTYD.js +296 -0
- package/dist/SandboxedHtmlFrame-B95lWsIP.js +309 -0
- package/dist/{SheetViewer-BN5UYkEZ.js → SheetViewer-CD9SHbXJ.js} +36 -26
- package/dist/TextThumbnail-DKNxh344.js +15 -0
- package/dist/{TextViewer-Bt0_dYB-.js → TextViewer-DxRBCXzV.js} +44 -41
- package/dist/ai.d.ts +3 -3
- package/dist/ai.js +5 -5
- package/dist/bash-BcZBmoDA.js +169 -0
- package/dist/c-Dv-5_kUQ.js +187 -0
- package/dist/component-status.js +2 -2
- package/dist/core-C0MCmPil.js +842 -0
- package/dist/cpp-CMQhucZt.js +236 -0
- package/dist/csharp-CuDKSCf2.js +260 -0
- package/dist/css-Dta7Q4Li.js +145 -0
- package/dist/dart-po7Eq73d.js +134 -0
- package/dist/diff-IgsQP-8T.js +39 -0
- package/dist/dist-CFY0KELA.js +55 -0
- package/dist/dist-DtILhk4w.js +253 -0
- package/dist/dist-zvwuNflP.js +59 -0
- package/dist/dockerfile-B4Bz9I5u.js +34 -0
- package/dist/dos-1TcyLtUq.js +57 -0
- package/dist/elixir-BnEjyLGa.js +189 -0
- package/dist/erlang-tgri7ZSv.js +218 -0
- package/dist/experimental.d.ts +24 -4
- package/dist/experimental.js +5957 -5752
- package/dist/{exports-BByQBwpi.d.ts → exports-cxvNeHfV.d.ts} +1 -1
- package/dist/f0.d.ts +130 -8
- package/dist/f0.js +1969 -3034
- package/dist/fetchText-o_GOtiv3.js +54 -0
- package/dist/go-CEVmppuo.js +144 -0
- package/dist/graphql-BWwc-u8d.js +67 -0
- package/dist/groovy-BELuqtd6.js +127 -0
- package/dist/haskell-Cxh7aaFM.js +138 -0
- package/dist/highlight-CqFL-_MG.js +114 -0
- package/dist/i18n-provider-Bdgo-LeP.js +150 -0
- package/dist/{i18n-provider-defaults-p0UGTA_k.js → i18n-provider-defaults-B9vdZZeS.js} +35 -1
- package/dist/{i18n-provider-defaults-DQxuUMpU.d.ts → i18n-provider-defaults-DyPn8R7T.d.ts} +34 -0
- package/dist/i18n-provider-defaults.d.ts +1 -1
- package/dist/i18n-provider-defaults.js +1 -1
- package/dist/{index-D3nEDg8x.d.ts → index-DF8ubeg6.d.ts} +1 -1
- package/dist/ini-DA-F0rRr.js +88 -0
- package/dist/java-Bujnoc_f.js +174 -0
- package/dist/javascript-BeEhpXRE.js +431 -0
- package/dist/json-CxvE7tEw.js +42 -0
- package/dist/kotlin-DOwDGI_m.js +206 -0
- package/dist/less-DWlR-e-o.js +196 -0
- package/dist/localized-BrUgGMzm.js +46 -0
- package/dist/lua-BlZiakwh.js +46 -0
- package/dist/makefile-D3841Yg4.js +57 -0
- package/dist/{maplibre-Bywi9z2G.js → maplibre-Ip4Qe9dM.js} +1 -1
- package/dist/markdown-D1wNG79U.js +178 -0
- package/dist/objectivec-DxtRzTBy.js +117 -0
- package/dist/ownValue-D4uSXt0d.js +4 -0
- package/dist/{pdfWorker-CKgxOaCl.js → pdfWorker-DMjHHAyP.js} +12 -9
- package/dist/pdfWorkerConfig-BwllKt1K.js +8 -0
- package/dist/perl-BWRmkuyz.js +192 -0
- package/dist/php-CjwybYSP.js +300 -0
- package/dist/popover-ics24JxK.js +4486 -0
- package/dist/{posts-DGtDUrKT.js → posts-BHRBUAYJ.js} +2 -0
- package/dist/powershell-CgKcNA5Q.js +188 -0
- package/dist/properties-Bc45MTzW.js +38 -0
- package/dist/protobuf-Bv_xSUaI.js +61 -0
- package/dist/purify.es-ZpfdAuNV.js +545 -0
- package/dist/python-D8PdGjgy.js +238 -0
- package/dist/r-DA-9ZIdU.js +140 -0
- package/dist/{renderDocx-_UmnE-yc.js → renderDocx-BW-uDyaZ.js} +2 -0
- package/dist/ruby-Bqr16BpN.js +262 -0
- package/dist/rust-BCvJMwk8.js +182 -0
- package/dist/scala-Du8mOD2z.js +162 -0
- package/dist/scrollarea-cxaFAWG5.js +691 -0
- package/dist/scss-AMxHqh46.js +155 -0
- package/dist/skeleton-AC0Fb8zj.js +72 -0
- package/dist/sql-BbYSgcOA.js +118 -0
- package/dist/styles.css +1 -1
- package/dist/swift-DRKtalPn.js +575 -0
- package/dist/toolbarStyles-lTj_42zD.js +52 -0
- package/dist/{types-UMYBr8Mi.d.ts → types-geibVrTM.d.ts} +3 -95
- package/dist/typescript-Bv8uKU6V.js +516 -0
- package/dist/{useData-B7LYSzh0.js → useData-BYkiGUHX.js} +4734 -5375
- package/dist/useFetchedText-BR3_KLXx.js +38 -0
- package/dist/useThumbnailText-DwXQvLIe.js +22 -0
- package/dist/xml-BVpP05uE.js +162 -0
- package/dist/yaml-BNe2WG-i.js +144 -0
- package/dist/zipTree-B2zUYl6b.js +247 -0
- package/package.json +2 -1
- package/dist/DocumentToolbar-CqbY6eID.js +0 -70
- package/dist/F0DocumentViewer-BN-2IVgz.js +0 -400
- package/dist/F0DocumentViewer-D1G3M2J_.js +0 -3
- package/dist/F0Text-D92NWQRd.js +0 -81
- package/dist/F0VideoPlayer-D4bZBBLK.js +0 -1
- package/dist/TextThumbnail-X04JgaNI.js +0 -26
- 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 { _o as s, ka as c, ks as l, wo as u } from "./F0CanvasPanel--hLKeQvg.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-CKgxOaCl.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: s
|
|
91
|
-
}) : null,
|
|
92
|
-
/* @__PURE__ */ E(k, {
|
|
93
|
-
label: O.print,
|
|
94
|
-
onClick: S,
|
|
95
|
-
icon: u
|
|
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-BN5UYkEZ.js")), B = b(() => import("./DocxViewer-CqHgSExq.js")), V = b(() => import("./TextViewer-Bt0_dYB-.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 };
|
package/dist/F0Text-D92NWQRd.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { Yn as e, ar as t, er as n, nr as r } from "./popover-BjrPOMeQ.js";
|
|
2
|
-
import { z as i } from "./useData-B7LYSzh0.js";
|
|
3
|
-
import { createContext as a, forwardRef as o, useCallback as s, useContext as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
4
|
-
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
5
|
-
//#region ../../node_modules/.pnpm/motion@12.17.0_@emotion+is-prop-valid@1.3.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/motion/dist/es/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs
|
|
6
|
-
var m = a(null);
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region ../../node_modules/.pnpm/motion@12.17.0_@emotion+is-prop-valid@1.3.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/motion/dist/es/framer-motion/dist/es/utils/use-is-mounted.mjs
|
|
9
|
-
function h() {
|
|
10
|
-
let e = u(!1);
|
|
11
|
-
return n(() => (e.current = !0, () => {
|
|
12
|
-
e.current = !1;
|
|
13
|
-
}), []), e;
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region ../../node_modules/.pnpm/motion@12.17.0_@emotion+is-prop-valid@1.3.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/motion/dist/es/framer-motion/dist/es/utils/use-force-update.mjs
|
|
17
|
-
function g() {
|
|
18
|
-
let t = h(), [n, r] = d(0), i = s(() => {
|
|
19
|
-
t.current && r(n + 1);
|
|
20
|
-
}, [n]);
|
|
21
|
-
return [s(() => e.postRender(i), [i]), n];
|
|
22
|
-
}
|
|
23
|
-
//#endregion
|
|
24
|
-
//#region ../../node_modules/.pnpm/motion@12.17.0_@emotion+is-prop-valid@1.3.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/motion/dist/es/framer-motion/dist/es/projection/node/group.mjs
|
|
25
|
-
var _ = (e) => !e.isLayoutDirty && e.willUpdate(!1);
|
|
26
|
-
function v() {
|
|
27
|
-
let e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new WeakMap(), n = () => e.forEach(_);
|
|
28
|
-
return {
|
|
29
|
-
add: (r) => {
|
|
30
|
-
e.add(r), t.set(r, r.addEventListener("willUpdate", n));
|
|
31
|
-
},
|
|
32
|
-
remove: (r) => {
|
|
33
|
-
e.delete(r);
|
|
34
|
-
let i = t.get(r);
|
|
35
|
-
i && (i(), t.delete(r)), n();
|
|
36
|
-
},
|
|
37
|
-
dirty: n
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
//#endregion
|
|
41
|
-
//#region ../../node_modules/.pnpm/motion@12.17.0_@emotion+is-prop-valid@1.3.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/motion/dist/es/framer-motion/dist/es/components/LayoutGroup/index.mjs
|
|
42
|
-
var y = (e) => e === !0, b = (e) => y(e === !0) || e === "id", x = ({ children: e, id: t, inherit: n = !0 }) => {
|
|
43
|
-
let i = c(r), a = c(m), [o, s] = g(), d = u(null), p = i.id || a;
|
|
44
|
-
d.current === null && (b(n) && p && (t = t ? p + "-" + t : p), d.current = {
|
|
45
|
-
id: t,
|
|
46
|
-
group: y(n) && i.group || v()
|
|
47
|
-
});
|
|
48
|
-
let h = l(() => ({
|
|
49
|
-
...d.current,
|
|
50
|
-
forceRender: o
|
|
51
|
-
}), [s]);
|
|
52
|
-
return f(r.Provider, {
|
|
53
|
-
value: h,
|
|
54
|
-
children: e
|
|
55
|
-
});
|
|
56
|
-
}, S = o((e, t) => /* @__PURE__ */ p("svg", {
|
|
57
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
58
|
-
fill: "none",
|
|
59
|
-
viewBox: "0 0 24 24",
|
|
60
|
-
ref: t,
|
|
61
|
-
...e,
|
|
62
|
-
children: [/* @__PURE__ */ f("path", {
|
|
63
|
-
stroke: "currentColor",
|
|
64
|
-
strokeLinecap: "round",
|
|
65
|
-
strokeLinejoin: "round",
|
|
66
|
-
d: "M16.9497 7.05026L12 12L7.05025 16.9498"
|
|
67
|
-
}), /* @__PURE__ */ f("path", {
|
|
68
|
-
stroke: "currentColor",
|
|
69
|
-
strokeLinecap: "round",
|
|
70
|
-
strokeLinejoin: "round",
|
|
71
|
-
d: "M12 12L7.05025 7.05026L16.9497 16.9498"
|
|
72
|
-
})]
|
|
73
|
-
})), C = o((e, t) => /* @__PURE__ */ f(i, {
|
|
74
|
-
ref: t,
|
|
75
|
-
markdown: e.markdown ?? !0,
|
|
76
|
-
...e
|
|
77
|
-
}));
|
|
78
|
-
C.displayName = "F0Text";
|
|
79
|
-
var w = t(C);
|
|
80
|
-
//#endregion
|
|
81
|
-
export { S as n, x as r, w as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { t as F0VideoPlayer } from "./F0VideoPlayer-CNp5hXgp.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 };
|
package/dist/dist-DvxtFKDL.js
DELETED
|
@@ -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 };
|