@factorialco/f0-react 12.10.0 → 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.
- package/dist/ArchiveThumbnail-cs8kx5Zf.js +70 -0
- package/dist/ArchiveViewer-BXUH8Lm5.js +172 -0
- package/dist/{ChatPostComposerDialog-DcmLrQk6.js → ChatPostComposerDialog-CGil1xkf.js} +4 -4
- package/dist/{CoachmarkProvider-XfLjB3dH.js → CoachmarkProvider-cZnuTk79.js} +29938 -29932
- package/dist/CodeThumbnail-Dcer4AyK.js +31 -0
- package/dist/CodeViewer-DFBwdIFm.js +98 -0
- package/dist/DocumentToolbar-vZEyzJ89.js +74 -0
- package/dist/{DocxThumbnail-kHTNnwW0.js → DocxThumbnail-CK9vFoTB.js} +2 -2
- package/dist/{DocxViewer-CqHgSExq.js → DocxViewer-DQV5Kv1n.js} +25 -23
- package/dist/ExternalLink-RdKU698E.js +22 -0
- package/dist/{F0AiProcessingOverlay-H23WHd7F.js → F0AiProcessingOverlay-DjGkQ2Nc.js} +1349 -1345
- package/dist/{popover-BjrPOMeQ.js → F0Button-FXkThQ9H.js} +3164 -8587
- package/dist/{F0CanvasPanel--hLKeQvg.js → F0CanvasPanel-BgDo2LWP.js} +9436 -9008
- package/dist/F0DocumentViewer-BXifXzUW.js +79 -0
- package/dist/F0DocumentViewer-DWuIFBHu.js +3 -0
- package/dist/F0Icon-Cj0USbCF.js +202 -0
- package/dist/{F0Map-hvgCUGk8.js → F0Map-Dwev4u-_.js} +189 -188
- package/dist/{F0Select-B-ZxVjXG.js → F0Select-BWWdEd7l.js} +6696 -6726
- package/dist/{F0Text-D92NWQRd.js → F0Text-DMZW7dhN.js} +25 -41
- package/dist/{F0VideoPlayer-CNp5hXgp.js → F0VideoPlayer-BmCmHG87.js} +412 -408
- package/dist/F0VideoPlayer-C8oYUUZM.js +1 -0
- package/dist/HtmlThumbnail-BAgkBH2r.js +60 -0
- package/dist/HtmlViewer-FRfNoxhP.js +208 -0
- package/dist/LockLocked-gdodYvT_.js +41 -0
- package/dist/{Map-eIXVKc1x.js → Map-BxGPElF2.js} +57 -54
- package/dist/{PdfThumbnail-CCSmwxQU.js → PdfThumbnail-CpGZz5Kq.js} +5 -5
- package/dist/PdfViewer-C81MK43i.js +296 -0
- package/dist/SandboxedHtmlFrame-B6YWhgyg.js +309 -0
- package/dist/{SheetViewer-BN5UYkEZ.js → SheetViewer-DPGpMNqq.js} +36 -26
- package/dist/TextThumbnail-DKNxh344.js +15 -0
- package/dist/{TextViewer-Bt0_dYB-.js → TextViewer-BH42AeG8.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-D-MJbPvE.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 +2711 -2702
- package/dist/{exports-BByQBwpi.d.ts → exports-C0yM5usu.d.ts} +1 -1
- package/dist/f0.d.ts +130 -8
- package/dist/f0.js +751 -745
- 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-CyebkDAD.js +114 -0
- package/dist/i18n-provider-BBhzYHef.js +150 -0
- package/dist/{i18n-provider-defaults-p0UGTA_k.js → i18n-provider-defaults-BUagKwGN.js} +32 -1
- package/dist/{i18n-provider-defaults-DQxuUMpU.d.ts → i18n-provider-defaults-CTDMMs-y.d.ts} +31 -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-CduxMW5L.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/lua-BlZiakwh.js +46 -0
- package/dist/makefile-D3841Yg4.js +57 -0
- package/dist/{maplibre-Bywi9z2G.js → maplibre-g-8NG-3q.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-D5NB2V5s.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-CQztsDta.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/scss-AMxHqh46.js +155 -0
- package/dist/skeleton-DqejhQgn.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-0IygMI4H.js +52 -0
- package/dist/{types-UMYBr8Mi.d.ts → types-DlwD3i9z.d.ts} +3 -95
- package/dist/typescript-Bv8uKU6V.js +516 -0
- package/dist/{useData-B7LYSzh0.js → useData-Dkq5W4r6.js} +4917 -4876
- 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/F0VideoPlayer-D4bZBBLK.js +0 -1
- package/dist/TextThumbnail-X04JgaNI.js +0 -26
- package/dist/dist-DvxtFKDL.js +0 -78
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { L as e } from "./tooltip-BX4dSfeL.js";
|
|
2
|
+
import { i as t, t as n } from "./highlight-CyebkDAD.js";
|
|
3
|
+
import { t as r } from "./useThumbnailText-DwXQvLIe.js";
|
|
4
|
+
import { useEffect as i, useState as a } from "react";
|
|
5
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
6
|
+
//#region src/elements/primitives/_primitives/F0Attachments/components/thumbnails/CodeThumbnail.tsx
|
|
7
|
+
var s = 4096, c = 12, l = ({ url: l, language: u, onError: d, onRendered: f }) => {
|
|
8
|
+
let p = r(l, s, {
|
|
9
|
+
onError: d,
|
|
10
|
+
onLoaded: f
|
|
11
|
+
})?.split("\n").slice(0, c).join("\n") ?? null, [m, h] = a(null);
|
|
12
|
+
if (i(() => {
|
|
13
|
+
if (p === null) return;
|
|
14
|
+
let e = !1;
|
|
15
|
+
return t(p, u).then((t) => {
|
|
16
|
+
e || h(t);
|
|
17
|
+
}), () => {
|
|
18
|
+
e = !0;
|
|
19
|
+
};
|
|
20
|
+
}, [p, u]), p === null) return null;
|
|
21
|
+
let g = e("m-0 overflow-hidden whitespace-pre bg-f1-background p-3 text-left font-mono text-sm leading-5 text-f1-foreground", n);
|
|
22
|
+
return m ? /* @__PURE__ */ o("pre", {
|
|
23
|
+
className: g,
|
|
24
|
+
dangerouslySetInnerHTML: { __html: m }
|
|
25
|
+
}) : /* @__PURE__ */ o("pre", {
|
|
26
|
+
className: g,
|
|
27
|
+
children: p
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { l as default };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { r as e } from "./i18n-provider-BBhzYHef.js";
|
|
2
|
+
import { t } from "./skeleton-DqejhQgn.js";
|
|
3
|
+
import { L as n } from "./tooltip-BX4dSfeL.js";
|
|
4
|
+
import { _r as r, sc as i } from "./F0CanvasPanel-BgDo2LWP.js";
|
|
5
|
+
import { xt as a } from "./F0Select-BWWdEd7l.js";
|
|
6
|
+
import { t as o } from "./purify.es-ZpfdAuNV.js";
|
|
7
|
+
import { n as s, t as c } from "./DocumentToolbar-vZEyzJ89.js";
|
|
8
|
+
import { a as l, i as u, n as d, o as f, r as p, t as m } from "./highlight-CyebkDAD.js";
|
|
9
|
+
import { t as h } from "./useFetchedText-BR3_KLXx.js";
|
|
10
|
+
import { useEffect as g, useMemo as _, useState as v } from "react";
|
|
11
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
12
|
+
//#region src/addons/documents/F0DocumentViewer/components/CodeView.tsx
|
|
13
|
+
var S = ({ text: e, language: t, wrap: r = !1, label: i, zoom: a = 1, className: s }) => {
|
|
14
|
+
let [c, l] = v(null);
|
|
15
|
+
g(() => {
|
|
16
|
+
let n = !1;
|
|
17
|
+
if (t) return u(e, t).then((t) => {
|
|
18
|
+
!n && t !== null && l({
|
|
19
|
+
text: e,
|
|
20
|
+
html: t
|
|
21
|
+
});
|
|
22
|
+
}), () => {
|
|
23
|
+
n = !0;
|
|
24
|
+
};
|
|
25
|
+
}, [e, t]);
|
|
26
|
+
let f = _(() => {
|
|
27
|
+
let t = 1;
|
|
28
|
+
for (let n = 0; n < e.length; n++) e.charCodeAt(n) === 10 && t++;
|
|
29
|
+
return e.endsWith("\n") && t--, Array.from({ length: Math.max(t, 1) }, (e, t) => t + 1).join("\n");
|
|
30
|
+
}, [e]), p = c?.text === e ? c.html : null, h = _(() => p === null ? null : o.sanitize(p, d), [p]);
|
|
31
|
+
return /* @__PURE__ */ b("div", {
|
|
32
|
+
role: "region",
|
|
33
|
+
"aria-label": i,
|
|
34
|
+
tabIndex: 0,
|
|
35
|
+
className: n("min-h-0 grow overflow-auto bg-f1-background focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-f1-border-selected", s),
|
|
36
|
+
children: /* @__PURE__ */ x("div", {
|
|
37
|
+
style: { zoom: a },
|
|
38
|
+
className: n("flex font-mono text-sm leading-5", r ? "w-full" : "w-max min-w-full"),
|
|
39
|
+
children: [r ? null : /* @__PURE__ */ b("div", {
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
className: "sticky left-0 shrink-0 select-none whitespace-pre border-0 border-r border-solid border-f1-border-secondary bg-f1-background py-4 pl-4 pr-3 text-right text-f1-foreground-secondary",
|
|
42
|
+
children: f
|
|
43
|
+
}), /* @__PURE__ */ b("pre", {
|
|
44
|
+
className: n("m-0 min-w-0 grow px-4 py-4 font-mono text-f1-foreground", r ? "whitespace-pre-wrap break-words" : "whitespace-pre", m),
|
|
45
|
+
children: h === null ? /* @__PURE__ */ b("code", { children: e }) : /* @__PURE__ */ b("code", { dangerouslySetInnerHTML: { __html: h } })
|
|
46
|
+
})]
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
}, C = 2097152, w = ({ url: n, filename: o, language: u, withCredentials: d = !0, actions: m, toolbar: g = "top", hideDownload: _ = !1 }) => {
|
|
50
|
+
let w = e(), T = s(), { text: E, failed: D } = h(n, {
|
|
51
|
+
withCredentials: d,
|
|
52
|
+
maxChars: C
|
|
53
|
+
}), [O, k] = v(null), A = O ?? (E !== null && !p(E)), j = f(u) ?? l(o), M = o ?? "", N = /* @__PURE__ */ b(c, {
|
|
54
|
+
url: n,
|
|
55
|
+
filename: o,
|
|
56
|
+
withCredentials: d,
|
|
57
|
+
actions: m,
|
|
58
|
+
zoom: T,
|
|
59
|
+
placement: g,
|
|
60
|
+
hideDownload: _,
|
|
61
|
+
endContent: E === null ? null : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(a, {
|
|
62
|
+
label: w.pdfViewer.wrapLines,
|
|
63
|
+
icon: i,
|
|
64
|
+
selected: A,
|
|
65
|
+
onSelectedChange: k
|
|
66
|
+
}), /* @__PURE__ */ b(r, {
|
|
67
|
+
valueToCopy: E,
|
|
68
|
+
variant: "outline",
|
|
69
|
+
size: "md",
|
|
70
|
+
copyTooltipLabel: w.pdfViewer.copyCode,
|
|
71
|
+
copiedTooltipLabel: w.pdfViewer.copied
|
|
72
|
+
})] })
|
|
73
|
+
});
|
|
74
|
+
return /* @__PURE__ */ x("div", {
|
|
75
|
+
className: "relative flex h-full w-full flex-col bg-f1-background",
|
|
76
|
+
children: [
|
|
77
|
+
g === "top" ? N : null,
|
|
78
|
+
D ? /* @__PURE__ */ b("div", {
|
|
79
|
+
className: "flex min-h-0 grow items-center justify-center text-f1-foreground-secondary",
|
|
80
|
+
children: w.pdfViewer.previewFailed
|
|
81
|
+
}) : E === null ? /* @__PURE__ */ b(t, {
|
|
82
|
+
role: "status",
|
|
83
|
+
"aria-busy": !0,
|
|
84
|
+
"aria-label": w.pdfViewer.loading,
|
|
85
|
+
className: "min-h-0 w-full grow rounded-none"
|
|
86
|
+
}) : /* @__PURE__ */ b(S, {
|
|
87
|
+
text: E,
|
|
88
|
+
language: j,
|
|
89
|
+
wrap: A,
|
|
90
|
+
zoom: T.scale,
|
|
91
|
+
label: w.t("pdfViewer.codeRegion", { name: M })
|
|
92
|
+
}),
|
|
93
|
+
g === "floating" ? N : null
|
|
94
|
+
]
|
|
95
|
+
});
|
|
96
|
+
}, T = (e) => /* @__PURE__ */ b(w, { ...e }, e.url);
|
|
97
|
+
//#endregion
|
|
98
|
+
export { C as CODE_MAX_CHARS, T as default };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { r as e } from "./i18n-provider-BBhzYHef.js";
|
|
2
|
+
import { Ns as t } from "./F0CanvasPanel-BgDo2LWP.js";
|
|
3
|
+
import { q as n } from "./useData-Dkq5W4r6.js";
|
|
4
|
+
import { dr as r, t as i } from "./F0Select-BWWdEd7l.js";
|
|
5
|
+
import { a, c as o, n as s, o as c, r as l, s as u, t as d } from "./toolbarStyles-0IygMI4H.js";
|
|
6
|
+
import { useCallback as f, useMemo as p, useState as m } from "react";
|
|
7
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
8
|
+
//#region src/addons/documents/F0DocumentViewer/components/DocumentToolbar.tsx
|
|
9
|
+
var _ = () => {
|
|
10
|
+
let [e, t] = m(1);
|
|
11
|
+
return {
|
|
12
|
+
scale: e,
|
|
13
|
+
zoomIn: f(() => t((e) => u(e) ?? e), []),
|
|
14
|
+
zoomOut: f(() => t((e) => c(e) ?? e), []),
|
|
15
|
+
setScale: t
|
|
16
|
+
};
|
|
17
|
+
}, v = ({ url: c, filename: u, withCredentials: f, actions: m, zoom: _, placement: v = "top", hideDownload: y = !1, endContent: b, children: x }) => {
|
|
18
|
+
let { pdfViewer: S } = e(), C = p(() => a.map((e) => ({
|
|
19
|
+
value: e,
|
|
20
|
+
label: `${Number(e) * 100}%`
|
|
21
|
+
})), []);
|
|
22
|
+
return !x && !_ && !b && y && !m?.length || v === "none" ? null : /* @__PURE__ */ g("div", {
|
|
23
|
+
role: "toolbar",
|
|
24
|
+
"aria-label": S.toolbar,
|
|
25
|
+
"data-placement": v,
|
|
26
|
+
className: d(v),
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ h("div", {
|
|
29
|
+
className: s(v, "min-w-0 flex-1 basis-0 overflow-x-auto"),
|
|
30
|
+
children: x
|
|
31
|
+
}),
|
|
32
|
+
_ ? /* @__PURE__ */ g("div", {
|
|
33
|
+
className: s(v, "shrink-0"),
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ h(l, {
|
|
36
|
+
label: S.zoomOut,
|
|
37
|
+
onClick: _.zoomOut,
|
|
38
|
+
icon: n
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ h(l, {
|
|
41
|
+
label: S.zoomIn,
|
|
42
|
+
onClick: _.zoomIn,
|
|
43
|
+
icon: r
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ h(i, {
|
|
46
|
+
hideLabel: !0,
|
|
47
|
+
label: S.scaleSelector,
|
|
48
|
+
options: C,
|
|
49
|
+
value: String(_.scale),
|
|
50
|
+
onChange: (e) => _.setScale(Number(e))
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
}) : null,
|
|
54
|
+
/* @__PURE__ */ g("div", {
|
|
55
|
+
className: s(v, "flex-1 basis-0 justify-end"),
|
|
56
|
+
children: [
|
|
57
|
+
b,
|
|
58
|
+
y ? null : /* @__PURE__ */ h(l, {
|
|
59
|
+
label: S.download,
|
|
60
|
+
onClick: () => void o(c, u, f),
|
|
61
|
+
icon: t
|
|
62
|
+
}),
|
|
63
|
+
m?.map((e, t) => /* @__PURE__ */ h(l, {
|
|
64
|
+
label: e.label,
|
|
65
|
+
onClick: e.onClick,
|
|
66
|
+
icon: e.icon
|
|
67
|
+
}, `${e.label}-${t}`))
|
|
68
|
+
]
|
|
69
|
+
})
|
|
70
|
+
]
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
//#endregion
|
|
74
|
+
export { _ as n, v as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./renderDocx-
|
|
1
|
+
import { t as e } from "./renderDocx-BW-uDyaZ.js";
|
|
2
2
|
import { useEffect as t, useRef as n, useState as r } from "react";
|
|
3
3
|
import { jsx as i } from "react/jsx-runtime";
|
|
4
4
|
//#region src/elements/primitives/_primitives/F0Attachments/components/thumbnails/DocxThumbnail.tsx
|
|
@@ -29,7 +29,7 @@ var a = ({ url: a, width: o, onError: s, onRendered: c }) => {
|
|
|
29
29
|
n = !0;
|
|
30
30
|
};
|
|
31
31
|
}, [a, o]), /* @__PURE__ */ i("div", {
|
|
32
|
-
className: "overflow-hidden bg-
|
|
32
|
+
className: "overflow-hidden bg-[#fff] text-left",
|
|
33
33
|
children: /* @__PURE__ */ i("div", {
|
|
34
34
|
ref: l,
|
|
35
35
|
style: u === null ? void 0 : {
|
|
@@ -1,62 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t
|
|
3
|
-
import { n
|
|
1
|
+
import { r as e } from "./i18n-provider-BBhzYHef.js";
|
|
2
|
+
import { t } from "./skeleton-DqejhQgn.js";
|
|
3
|
+
import { n, t as r } from "./DocumentToolbar-vZEyzJ89.js";
|
|
4
|
+
import { t as i } from "./renderDocx-BW-uDyaZ.js";
|
|
4
5
|
import { useEffect as a, useRef as o, useState as s } from "react";
|
|
5
6
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
7
|
//#region src/addons/documents/F0DocumentViewer/components/DocxViewer.tsx
|
|
7
|
-
var u = ({ url: u, filename: d, withCredentials: f = !0, actions: p, toolbar: m = "top" }) => {
|
|
8
|
-
let
|
|
8
|
+
var u = ({ url: u, filename: d, withCredentials: f = !0, actions: p, toolbar: m = "top", hideDownload: h = !1 }) => {
|
|
9
|
+
let g = e(), _ = n(), v = o(null), [y, b] = s("loading");
|
|
9
10
|
a(() => {
|
|
10
|
-
let e =
|
|
11
|
+
let e = v.current;
|
|
11
12
|
if (!e) return;
|
|
12
13
|
let t = !1;
|
|
13
|
-
return
|
|
14
|
+
return b("loading"), fetch(u, { credentials: f ? "include" : "same-origin" }).then((e) => {
|
|
14
15
|
if (!e.ok) throw Error(`${e.status}`);
|
|
15
16
|
return e.blob();
|
|
16
|
-
}).then(async (
|
|
17
|
-
t || (await n
|
|
17
|
+
}).then(async (n) => {
|
|
18
|
+
t || (await i(n, e, {
|
|
18
19
|
inWrapper: !0,
|
|
19
20
|
breakPages: !0
|
|
20
|
-
}), t ||
|
|
21
|
+
}), t || b("ready"));
|
|
21
22
|
}).catch(() => {
|
|
22
|
-
t ||
|
|
23
|
+
t || b("failed");
|
|
23
24
|
}), () => {
|
|
24
25
|
t = !0;
|
|
25
26
|
};
|
|
26
27
|
}, [u, f]);
|
|
27
|
-
let
|
|
28
|
+
let x = /* @__PURE__ */ c(r, {
|
|
28
29
|
url: u,
|
|
29
30
|
filename: d,
|
|
30
31
|
withCredentials: f,
|
|
31
32
|
actions: p,
|
|
32
|
-
zoom:
|
|
33
|
-
placement: m
|
|
33
|
+
zoom: _,
|
|
34
|
+
placement: m,
|
|
35
|
+
hideDownload: h
|
|
34
36
|
});
|
|
35
37
|
return /* @__PURE__ */ l("div", {
|
|
36
38
|
className: "relative flex h-full w-full flex-col bg-f1-background",
|
|
37
39
|
children: [
|
|
38
|
-
m === "top" ?
|
|
40
|
+
m === "top" ? x : null,
|
|
39
41
|
/* @__PURE__ */ l("div", {
|
|
40
42
|
className: "relative min-h-0 grow overflow-auto bg-f1-background-secondary",
|
|
41
43
|
children: [
|
|
42
|
-
|
|
44
|
+
y === "loading" ? /* @__PURE__ */ c(t, {
|
|
43
45
|
role: "status",
|
|
44
46
|
"aria-busy": !0,
|
|
45
|
-
"aria-label":
|
|
47
|
+
"aria-label": g.pdfViewer.loading,
|
|
46
48
|
className: "absolute inset-0 h-full w-full rounded-none"
|
|
47
49
|
}) : null,
|
|
48
|
-
|
|
50
|
+
y === "failed" ? /* @__PURE__ */ c("div", {
|
|
49
51
|
className: "flex h-full w-full items-center justify-center bg-f1-background text-f1-foreground-secondary",
|
|
50
|
-
children:
|
|
52
|
+
children: g.pdfViewer.previewFailed
|
|
51
53
|
}) : null,
|
|
52
54
|
/* @__PURE__ */ c("div", {
|
|
53
|
-
ref:
|
|
54
|
-
className:
|
|
55
|
-
style: { zoom:
|
|
55
|
+
ref: v,
|
|
56
|
+
className: y === "failed" ? "hidden" : void 0,
|
|
57
|
+
style: { zoom: _.scale }
|
|
56
58
|
})
|
|
57
59
|
]
|
|
58
60
|
}),
|
|
59
|
-
m === "floating" ?
|
|
61
|
+
m === "floating" ? x : null
|
|
60
62
|
]
|
|
61
63
|
});
|
|
62
64
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { forwardRef as e } from "react";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
var r = e((e, r) => /* @__PURE__ */ n("svg", {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
fill: "none",
|
|
6
|
+
viewBox: "0 0 24 24",
|
|
7
|
+
ref: r,
|
|
8
|
+
...e,
|
|
9
|
+
children: [/* @__PURE__ */ t("path", {
|
|
10
|
+
stroke: "currentColor",
|
|
11
|
+
strokeLinecap: "round",
|
|
12
|
+
strokeLinejoin: "round",
|
|
13
|
+
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"
|
|
14
|
+
}), /* @__PURE__ */ t("path", {
|
|
15
|
+
stroke: "currentColor",
|
|
16
|
+
strokeLinecap: "round",
|
|
17
|
+
strokeLinejoin: "round",
|
|
18
|
+
d: "M12.5 11.5L20 4M20 4H15.5M20 4V8.5"
|
|
19
|
+
})]
|
|
20
|
+
}));
|
|
21
|
+
//#endregion
|
|
22
|
+
export { r as t };
|