@factorialco/f0-react 6.88.3 → 6.88.4

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.
@@ -1,28 +1,28 @@
1
- import { jsxs as i, jsx as l } from "react/jsx-runtime";
2
- import { useState as u, useCallback as m, useMemo as p } from "react";
3
- import { u as x, i as w, j as k, k as S, l as C } from "./F0CanvasPanel-CpgOQnbI.js";
4
- import { n as g, a as h, f as v, T as r, d as F } from "./index-BP9845Kl.js";
1
+ import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
+ import { useState as b, useCallback as m, useMemo as p } from "react";
3
+ import { u as x, i as w, j as k, k as S, l as C } from "./F0CanvasPanel-CHIKqAx1.js";
4
+ import { n as g, a as h, f as v, T as n, d as F } from "./index-ChySRaDP.js";
5
5
  const D = () => {
6
- const [t, a] = u(1), n = m(
6
+ const [r, a] = b(1), t = m(
7
7
  () => a((e) => g(e) ?? e),
8
8
  []
9
9
  ), c = m(
10
10
  () => a((e) => h(e) ?? e),
11
11
  []
12
12
  );
13
- return { scale: t, zoomIn: n, zoomOut: c, setScale: a };
13
+ return { scale: r, zoomIn: t, zoomOut: c, setScale: a };
14
14
  }, I = ({
15
- url: t,
15
+ url: r,
16
16
  filename: a,
17
- withCredentials: n,
17
+ withCredentials: t,
18
18
  actions: c,
19
19
  zoom: e,
20
20
  children: f
21
21
  }) => {
22
22
  const { pdfViewer: s } = x(), d = p(
23
- () => v.map((o) => ({
24
- value: o,
25
- label: `${Number(o) * 100}%`
23
+ () => v.map((l) => ({
24
+ value: l,
25
+ label: `${Number(l) * 100}%`
26
26
  })),
27
27
  []
28
28
  );
@@ -33,54 +33,54 @@ const D = () => {
33
33
  "aria-label": s.toolbar,
34
34
  className: "F0PdfViewer__surface sticky top-0 z-10 flex flex-row items-center justify-between gap-2 px-6 py-4",
35
35
  children: [
36
- /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 basis-0 flex-row items-center gap-2 overflow-x-auto", children: f }),
37
- e && /* @__PURE__ */ i("div", { className: "flex shrink-0 flex-row items-center gap-2", children: [
38
- /* @__PURE__ */ l(
39
- r,
36
+ /* @__PURE__ */ o("div", { className: "flex min-w-0 flex-1 basis-0 flex-row items-center gap-2 overflow-x-auto", children: f }),
37
+ e ? /* @__PURE__ */ i("div", { className: "flex shrink-0 flex-row items-center gap-2", children: [
38
+ /* @__PURE__ */ o(
39
+ n,
40
40
  {
41
41
  label: s.zoomOut,
42
42
  onClick: e.zoomOut,
43
43
  icon: w
44
44
  }
45
45
  ),
46
- /* @__PURE__ */ l(
47
- r,
46
+ /* @__PURE__ */ o(
47
+ n,
48
48
  {
49
49
  label: s.zoomIn,
50
50
  onClick: e.zoomIn,
51
51
  icon: k
52
52
  }
53
53
  ),
54
- /* @__PURE__ */ l(
54
+ /* @__PURE__ */ o(
55
55
  S,
56
56
  {
57
57
  hideLabel: !0,
58
58
  label: s.scaleSelector,
59
59
  options: d,
60
60
  value: String(e.scale),
61
- onChange: (o) => e.setScale(Number(o))
61
+ onChange: (l) => e.setScale(Number(l))
62
62
  }
63
63
  )
64
- ] }),
64
+ ] }) : null,
65
65
  /* @__PURE__ */ i("div", { className: "flex flex-1 basis-0 flex-row items-center justify-end gap-2", children: [
66
- /* @__PURE__ */ l(
67
- r,
66
+ /* @__PURE__ */ o(
67
+ n,
68
68
  {
69
69
  label: s.download,
70
70
  onClick: () => {
71
- F(t, a, n);
71
+ F(r, a, t);
72
72
  },
73
73
  icon: C
74
74
  }
75
75
  ),
76
- c?.map((o, b) => /* @__PURE__ */ l(
77
- r,
76
+ c?.map((l, u) => /* @__PURE__ */ o(
77
+ n,
78
78
  {
79
- label: o.label,
80
- onClick: o.onClick,
81
- icon: o.icon
79
+ label: l.label,
80
+ onClick: l.onClick,
81
+ icon: l.icon
82
82
  },
83
- `${o.label}-${b}`
83
+ `${l.label}-${u}`
84
84
  ))
85
85
  ] })
86
86
  ]
@@ -1,18 +1,18 @@
1
1
  import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
2
  import { r as g } from "./docx-preview-BaRDMyPN.js";
3
3
  import { useRef as h, useState as b, useEffect as p } from "react";
4
- import { u as v, S as w } from "./F0CanvasPanel-CpgOQnbI.js";
5
- import { u as x, D as y } from "./DocumentToolbar-p4qZSVUD.js";
4
+ import { u as v, S as w } from "./F0CanvasPanel-CHIKqAx1.js";
5
+ import { u as x, D as y } from "./DocumentToolbar-yRNLFw0I.js";
6
6
  const V = ({
7
7
  url: o,
8
8
  filename: d,
9
9
  withCredentials: a = !0,
10
10
  actions: m
11
11
  }) => {
12
- const s = v(), i = x(), f = h(null), [l, n] = b("loading");
12
+ const s = v(), i = x(), u = h(null), [l, n] = b("loading");
13
13
  return p(() => {
14
- const u = f.current;
15
- if (!u)
14
+ const f = u.current;
15
+ if (!f)
16
16
  return;
17
17
  let r = !1;
18
18
  return n("loading"), fetch(o, { credentials: a ? "include" : "same-origin" }).then((e) => {
@@ -21,7 +21,7 @@ const V = ({
21
21
  return e.blob();
22
22
  }).then((e) => {
23
23
  if (!r)
24
- return g(e, u, void 0, {
24
+ return g(e, f, void 0, {
25
25
  inWrapper: !0,
26
26
  breakPages: !0
27
27
  }).then(() => {
@@ -44,7 +44,7 @@ const V = ({
44
44
  }
45
45
  ),
46
46
  /* @__PURE__ */ c("div", { className: "relative min-h-0 grow overflow-auto bg-f1-background-secondary", children: [
47
- l === "loading" && /* @__PURE__ */ t(
47
+ l === "loading" ? /* @__PURE__ */ t(
48
48
  w,
49
49
  {
50
50
  role: "status",
@@ -52,12 +52,12 @@ const V = ({
52
52
  "aria-label": s.pdfViewer.loading,
53
53
  className: "absolute inset-0 h-full w-full rounded-none"
54
54
  }
55
- ),
56
- l === "failed" && /* @__PURE__ */ t("div", { className: "flex h-full w-full items-center justify-center bg-f1-background text-f1-foreground-secondary", children: s.pdfViewer.previewFailed }),
55
+ ) : null,
56
+ l === "failed" ? /* @__PURE__ */ t("div", { className: "flex h-full w-full items-center justify-center bg-f1-background text-f1-foreground-secondary", children: s.pdfViewer.previewFailed }) : null,
57
57
  /* @__PURE__ */ t(
58
58
  "div",
59
59
  {
60
- ref: f,
60
+ ref: u,
61
61
  className: l === "failed" ? "hidden" : void 0,
62
62
  style: { zoom: i.scale }
63
63
  }