@factorialco/f0-react 4.55.0 → 4.56.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.
@@ -1,8 +1,9 @@
1
- import { S as L, m as ye, u as Z, n as ne, o as Se, q as Re, i as ke, j as _e, k as Ne, r as Ce, l as Le, w as Fe, s as Ve, t as Te } from "./F0CanvasPanel-DvAledR4.js";
1
+ import { S as L, m as ye, u as Z, n as Se, o as Re, i as ke, j as _e, k as Ne, q as Ce, l as Le, w as Fe, r as Ve, s as Te } from "./F0CanvasPanel-BeVQHrJo.js";
2
2
  import { jsx as t, jsxs as y } from "react/jsx-runtime";
3
- import { lazy as J, forwardRef as ae, Suspense as He, useState as V, useRef as A, useMemo as te, useCallback as w, useEffect as T } from "react";
4
- import { e as Ee, D as Ue, P as je, c as De } from "./pdfWorker-CqQpWr5o.js";
3
+ import { lazy as J, forwardRef as ne, Suspense as He, useState as V, useRef as A, useMemo as te, useCallback as w, useEffect as T } from "react";
4
+ import { e as Ee, D as Ue, P as je, c as De } from "./pdfWorker-D-5ek9Um.js";
5
5
  import { F as We } from "./Printer-B7iDPx2r.js";
6
+ import { d as ae } from "./tooltip-BH6Se8A4.js";
6
7
  import './index.css';const Oe = ({
7
8
  label: o,
8
9
  width: a,
@@ -46,12 +47,12 @@ import './index.css';const Oe = ({
46
47
  selectedScale: l,
47
48
  scaleOptions: s,
48
49
  onPreviousPage: d,
49
- onNextPage: g,
50
+ onNextPage: p,
50
51
  onZoomIn: m,
51
52
  onZoomOut: v,
52
53
  onScaleChange: k,
53
54
  rotatable: P,
54
- onRotate: p,
55
+ onRotate: g,
55
56
  onPrint: H,
56
57
  onDownload: x,
57
58
  actions: h
@@ -63,7 +64,7 @@ import './index.css';const Oe = ({
63
64
  ref: o,
64
65
  role: "toolbar",
65
66
  "aria-label": c.toolbar,
66
- className: ne(
67
+ className: ae(
67
68
  "F0PdfViewer__surface sticky top-0 z-10 flex flex-row items-center justify-between gap-2",
68
69
  "px-6 py-4"
69
70
  ),
@@ -94,7 +95,7 @@ import './index.css';const Oe = ({
94
95
  R,
95
96
  {
96
97
  label: c.nextPage,
97
- onClick: g,
98
+ onClick: p,
98
99
  icon: Re,
99
100
  size: "sm"
100
101
  }
@@ -133,7 +134,7 @@ import './index.css';const Oe = ({
133
134
  R,
134
135
  {
135
136
  label: c.rotate,
136
- onClick: p,
137
+ onClick: g,
137
138
  icon: Ce
138
139
  }
139
140
  ),
@@ -183,7 +184,7 @@ import './index.css';const Oe = ({
183
184
  if (!o) return;
184
185
  const e = URL.createObjectURL(await re(o)), i = document.createElement("a");
185
186
  i.href = e, i.download = a.length > 0 ? a : "document.pdf", document.body.appendChild(i), i.click(), i.remove(), URL.revokeObjectURL(e);
186
- }, nt = async (o, a, e = !0) => {
187
+ }, at = async (o, a, e = !0) => {
187
188
  let i = o, l;
188
189
  try {
189
190
  const d = await fetch(o, {
@@ -208,32 +209,32 @@ import './index.css';const Oe = ({
208
209
  let i = null, l = 0;
209
210
  return a.forEach((s, d) => {
210
211
  if (!s) return;
211
- const g = s.offsetHeight, m = s.offsetTop, v = m + g, k = o.offsetHeight - e, P = o.scrollTop + e, p = P + k;
212
- if (!(P < v && p > m)) return;
212
+ const p = s.offsetHeight, m = s.offsetTop, v = m + p, k = o.offsetHeight - e, P = o.scrollTop + e, g = P + k;
213
+ if (!(P < v && g > m)) return;
213
214
  let x;
214
215
  if (P <= m)
215
- x = p > v ? g : p - m;
216
+ x = g > v ? p : g - m;
216
217
  else {
217
218
  let h = P - m;
218
- p < v && (h += v - p), x = g - h;
219
+ g < v && (h += v - g), x = p - h;
219
220
  }
220
221
  x > l && (l = x, i = d + 1);
221
222
  }), i;
222
223
  };
223
224
  Ee();
224
- const qe = J(() => import("./SheetViewer-DtfcXdoa.js")), Ge = J(() => import("./DocxViewer-B3DGLu2C.js")), Ze = J(() => import("./TextViewer-Drfvy4UM.js")), oe = 48, se = ae(
225
+ const qe = J(() => import("./SheetViewer-DOm6rD9f.js")), Ge = J(() => import("./DocxViewer-B6HTjpEm.js")), Ze = J(() => import("./TextViewer-BW9eWjT_.js")), oe = 48, se = ne(
225
226
  (o, a) => {
226
227
  const { kind: e = "pdf", mimeType: i, ...l } = o;
227
228
  if (e === "pdf") return /* @__PURE__ */ t(le, { ref: a, ...l });
228
229
  const {
229
230
  url: s,
230
231
  filename: d,
231
- actions: g,
232
+ actions: p,
232
233
  withCredentials: m = !0,
233
234
  page: v,
234
235
  pagesToDisplay: k,
235
236
  initialScale: P,
236
- rotatable: p,
237
+ rotatable: g,
237
238
  initialRotation: H,
238
239
  onRotationChange: x,
239
240
  onPdfLoaded: h,
@@ -257,7 +258,7 @@ const qe = J(() => import("./SheetViewer-DtfcXdoa.js")), Ge = J(() => import("./
257
258
  url: s,
258
259
  filename: d,
259
260
  withCredentials: m,
260
- actions: g
261
+ actions: p
261
262
  }
262
263
  ),
263
264
  e === "docx" && /* @__PURE__ */ t(
@@ -266,7 +267,7 @@ const qe = J(() => import("./SheetViewer-DtfcXdoa.js")), Ge = J(() => import("./
266
267
  url: s,
267
268
  filename: d,
268
269
  withCredentials: m,
269
- actions: g
270
+ actions: p
270
271
  }
271
272
  ),
272
273
  e === "text" && /* @__PURE__ */ t(
@@ -276,7 +277,7 @@ const qe = J(() => import("./SheetViewer-DtfcXdoa.js")), Ge = J(() => import("./
276
277
  name: d ?? "",
277
278
  mimeType: i,
278
279
  withCredentials: m,
279
- actions: g
280
+ actions: p
280
281
  }
281
282
  )
282
283
  ]
@@ -287,19 +288,19 @@ const qe = J(() => import("./SheetViewer-DtfcXdoa.js")), Ge = J(() => import("./
287
288
  }
288
289
  );
289
290
  se.displayName = "F0PdfViewer";
290
- const le = ae((o, a) => {
291
+ const le = ne((o, a) => {
291
292
  const {
292
293
  url: e,
293
294
  filename: i = "document.pdf",
294
295
  page: l = 0,
295
296
  pagesToDisplay: s = [],
296
297
  initialScale: d = "page-width",
297
- withCredentials: g = !0,
298
+ withCredentials: p = !0,
298
299
  rotatable: m = !1,
299
300
  initialRotation: v = 0,
300
301
  onRotationChange: k,
301
302
  onPdfLoaded: P,
302
- onPageChange: p,
303
+ onPageChange: g,
303
304
  actions: H,
304
305
  ...x
305
306
  } = o, { pdfViewer: h } = Z(), [c, b] = V(null), [_, K] = V([]), [N, z] = V(1), [S, Q] = V(0), [U, M] = V(d), [E, ce] = V(v), I = A(null), j = A(null), D = A([]), W = s.length > 0 ? s.length : c?.numPages, X = _.find(Boolean), Y = (X?.originalWidth ?? 595) * N, ee = (X?.originalHeight ?? 842) * N, de = te(
@@ -312,7 +313,7 @@ const le = ae((o, a) => {
312
313
  }))
313
314
  ],
314
315
  [h.pageWidth, h.pageFit]
315
- ), fe = te(() => ({ url: e, withCredentials: g }), [e, g]), F = w(
316
+ ), fe = te(() => ({ url: e, withCredentials: p }), [e, p]), F = w(
316
317
  (n) => {
317
318
  const r = (W ?? 1) - 1, f = Math.min(Math.max(n, 0), r), u = D.current[f], C = u?.offsetParent;
318
319
  u && C instanceof HTMLElement && (C.scrollTop = u.offsetTop - (j.current?.offsetHeight ?? 0) - 10);
@@ -343,10 +344,10 @@ const le = ae((o, a) => {
343
344
  }, []), me = w(
344
345
  () => $(Me(N)),
345
346
  [N, $]
346
- ), ge = w(
347
+ ), pe = w(
347
348
  () => $(Ie(N)),
348
349
  [N, $]
349
- ), pe = w(() => {
350
+ ), ge = w(() => {
350
351
  ce((n) => {
351
352
  const r = (n + 90) % 360;
352
353
  return k?.(r), r;
@@ -377,8 +378,8 @@ const le = ae((o, a) => {
377
378
  }, [e]), T(() => {
378
379
  F(l);
379
380
  }, [l, F]), T(() => {
380
- S > 0 && p?.(S);
381
- }, [S, p]), T(() => {
381
+ S > 0 && g?.(S);
382
+ }, [S, g]), T(() => {
382
383
  _.length > 0 && (d === "page-width" || d === "page-fit") && O(d);
383
384
  }, [_.length, d]), T(() => {
384
385
  (U === "page-width" || U === "page-fit") && O(U);
@@ -415,10 +416,10 @@ const le = ae((o, a) => {
415
416
  onPreviousPage: () => F(S - 2),
416
417
  onNextPage: () => F(S),
417
418
  onZoomIn: me,
418
- onZoomOut: ge,
419
+ onZoomOut: pe,
419
420
  onScaleChange: ue,
420
421
  rotatable: m,
421
- onRotate: pe,
422
+ onRotate: ge,
422
423
  onPrint: we,
423
424
  onDownload: Pe,
424
425
  actions: H
@@ -497,7 +498,7 @@ const Je = () => {
497
498
  "aria-busy": "true",
498
499
  "aria-live": "polite",
499
500
  "aria-label": o.loading,
500
- className: ne(
501
+ className: ae(
501
502
  "F0PdfViewer__surface flex h-full w-full flex-col overflow-hidden",
502
503
  "border border-solid border-f1-border-secondary"
503
504
  ),
@@ -527,7 +528,7 @@ const Je = () => {
527
528
  "F0PdfViewer",
528
529
  Te(se, Je)
529
530
  )
530
- ), at = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
531
+ ), rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
531
532
  __proto__: null,
532
533
  F0PdfViewer: Qe,
533
534
  configurePdfWorker: De,
@@ -537,9 +538,9 @@ export {
537
538
  Qe as F,
538
539
  R as T,
539
540
  Ie as a,
540
- nt as d,
541
+ at as d,
541
542
  G as f,
542
- at as i,
543
+ rt as i,
543
544
  Me as n,
544
545
  Ke as p
545
546
  };
@@ -1,7 +1,8 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { createContext, useReducer, forwardRef, useRef, useImperativeHandle, useEffect, useCallback, useMemo, useContext, useLayoutEffect } from "react";
3
- import { v as invariant, x as clsx } from "./F0CanvasPanel-DvAledR4.js";
4
- import { d as dequal } from "./index-BgFg3D88.js";
3
+ import { e as clsx } from "./tooltip-BH6Se8A4.js";
4
+ import { t as invariant } from "./F0CanvasPanel-BeVQHrJo.js";
5
+ import { d as dequal } from "./index-BF3g-R2k.js";
5
6
  import { a as getAugmentedNamespace, g as getDefaultExportFromCjs } from "./_commonjsHelpers-ByX85dGu.js";
6
7
  import { c as commonjsRequire } from "./_commonjs-dynamic-modules-BpilXLfW.js";
7
8
  import './pdfWorker.css';var pdf$1 = { exports: {} };