@factorialco/f0-react 7.23.0 → 7.24.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/{ChatPdfThumbnail-BBAjTpRO.js → ChatPdfThumbnail-2_8sBW1U.js} +1 -1
- package/dist/{ChatPostComposerDialog-CzzBwu4c.js → ChatPostComposerDialog-BGEl20rM.js} +3 -3
- package/dist/{DocumentToolbar-CLmAa1CS.js → DocumentToolbar-BDDt63-g.js} +2 -2
- package/dist/{DocxViewer-17wM_5Ub.js → DocxViewer-Dt2nHTXV.js} +2 -2
- package/dist/{F0AiProcessingOverlay-Crv3v_qi.js → F0AiProcessingOverlay-nojpvoxK.js} +285 -285
- package/dist/{F0CanvasPanel-B2aaoYnV.js → F0CanvasPanel-DnlpQoxW.js} +639 -638
- package/dist/F0Map-C7hMGlk_.js +2499 -0
- package/dist/{F0VideoPlayer-aMaViir7.js → F0VideoPlayer-DKPfOJBp.js} +79 -79
- package/dist/{MapProvider-cgH29EcL.js → MapProvider-DNpgap--.js} +8174 -8124
- package/dist/{SheetViewer-DRvoh1Ht.js → SheetViewer-Wd4Fmg4a.js} +2 -2
- package/dist/{TextViewer-t6wTzXs4.js → TextViewer-C3OMcE58.js} +2 -2
- package/dist/ai.d.ts +22 -12
- package/dist/ai.js +2 -2
- package/dist/component-status.d.ts +12 -12
- package/dist/component-status.js +2 -2
- package/dist/{experimental-7owBUBms.js → experimental-DZvuUsDE.js} +11859 -13903
- package/dist/experimental.d.ts +367 -92
- package/dist/experimental.js +291 -284
- package/dist/f0.d.ts +182 -12
- package/dist/f0.js +6005 -6007
- package/dist/i18n-provider-defaults.d.ts +22 -12
- package/dist/i18n-provider-defaults.js +11 -1
- package/dist/index-B1UwLgNv.js +256 -0
- package/dist/index-BUqW79F1.js +4 -0
- package/dist/{index-CyVOH26Y.js → index-CCea6fTM.js} +1 -1
- package/dist/index-eeXQJkem.js +410 -0
- package/dist/{index-zELO6ifF.js → index-ekx-EJga.js} +31 -31
- package/dist/{pdfWorker-tk-Ol5j0.js → pdfWorker-CK4gerrz.js} +3 -3
- package/dist/styles.css +1 -1
- package/dist/{tooltip-BElsa4MF.js → tooltip-CrXp1Uaz.js} +2 -2
- package/package.json +1 -1
- package/dist/index-C2NRpdhB.js +0 -4
- package/dist/index-DnEPnn6A.js +0 -255
- /package/dist/{experimental.css → maplibre-gl.css} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as L } from "./F0CanvasPanel-
|
|
1
|
+
import { n as L } from "./F0CanvasPanel-DnlpQoxW.js";
|
|
2
2
|
const O = (e) => e.map(([n, s]) => ({ lat: s, lng: n })), x = (e, n) => ({
|
|
3
3
|
strokeColor: n && e.hover?.color || e.color,
|
|
4
4
|
strokeWeight: n && e.hover?.width || e.width,
|
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
import { jsxs as k, jsx as o, Fragment as rn } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as p, useEffect as v, useMemo as M, useCallback as A, useState as w } from "react";
|
|
3
|
+
import { o as En, q as Fn, r as ln, s as Tn, t as Dn, v as Pn, w as Bn, x as Ln, u as sn } from "./F0CanvasPanel-DnlpQoxW.js";
|
|
4
|
+
import { d as L, f as on, u as In } from "./tooltip-CrXp1Uaz.js";
|
|
5
|
+
import { a as cn, u as Qn, S as jn } from "./MapProvider-DNpgap--.js";
|
|
6
|
+
import { a as Kn, b as Un, R as tn } from "./F0Map-C7hMGlk_.js";
|
|
7
|
+
const R = 3, _n = ({
|
|
8
|
+
title: e,
|
|
9
|
+
count: t,
|
|
10
|
+
ariaLabel: r,
|
|
11
|
+
avatars: a,
|
|
12
|
+
onClick: i,
|
|
13
|
+
dataTestId: s
|
|
14
|
+
}) => /* @__PURE__ */ k(
|
|
15
|
+
"button",
|
|
16
|
+
{
|
|
17
|
+
type: "button",
|
|
18
|
+
onClick: i,
|
|
19
|
+
"aria-label": r,
|
|
20
|
+
"data-testid": s,
|
|
21
|
+
className: L(
|
|
22
|
+
"flex h-8 items-center gap-2 rounded-md pl-3 pr-1.5",
|
|
23
|
+
"hover:bg-f1-background-hover",
|
|
24
|
+
on()
|
|
25
|
+
),
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ o("span", { className: "whitespace-nowrap", children: /* @__PURE__ */ o(
|
|
28
|
+
En,
|
|
29
|
+
{
|
|
30
|
+
variant: "label",
|
|
31
|
+
content: e,
|
|
32
|
+
markdown: !1,
|
|
33
|
+
className: "text-f1-foreground-secondary"
|
|
34
|
+
}
|
|
35
|
+
) }),
|
|
36
|
+
a && a.length > 0 ? (
|
|
37
|
+
// `sm`: at `xs` the "+N" bubble becomes an ellipsis, and the number is
|
|
38
|
+
// the point. The rest go in as `remainingCount`, not items, which would
|
|
39
|
+
// make the bubble a button inside this button.
|
|
40
|
+
/* @__PURE__ */ o(
|
|
41
|
+
Fn,
|
|
42
|
+
{
|
|
43
|
+
type: "person",
|
|
44
|
+
avatars: a.slice(0, R),
|
|
45
|
+
remainingCount: t > R ? t - R : void 0,
|
|
46
|
+
size: "sm",
|
|
47
|
+
max: R,
|
|
48
|
+
noTooltip: !0
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
) : /* @__PURE__ */ o(ln, { value: t, size: "sm" })
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
), an = ({
|
|
55
|
+
title: e,
|
|
56
|
+
count: t,
|
|
57
|
+
open: r,
|
|
58
|
+
onOpenChange: a,
|
|
59
|
+
defaultOpen: i = !0,
|
|
60
|
+
children: s,
|
|
61
|
+
dataTestId: l
|
|
62
|
+
}) => {
|
|
63
|
+
const [c = i, u] = In({
|
|
64
|
+
prop: r,
|
|
65
|
+
defaultProp: i,
|
|
66
|
+
onChange: a
|
|
67
|
+
});
|
|
68
|
+
return /* @__PURE__ */ k(Tn, { open: c, onOpenChange: u, "data-testid": l, children: [
|
|
69
|
+
/* @__PURE__ */ o(Dn, { asChild: !0, children: /* @__PURE__ */ k(
|
|
70
|
+
"button",
|
|
71
|
+
{
|
|
72
|
+
type: "button",
|
|
73
|
+
className: L(
|
|
74
|
+
// Wider than its rows, padded so the title aligns with them.
|
|
75
|
+
"flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left",
|
|
76
|
+
"hover:bg-f1-background-hover",
|
|
77
|
+
on()
|
|
78
|
+
),
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ o("span", { className: "min-w-0 flex-1", children: /* @__PURE__ */ o(cn, { variant: "label", content: e, markdown: !1, ellipsis: !0 }) }),
|
|
81
|
+
/* @__PURE__ */ o(ln, { value: t, size: "sm" }),
|
|
82
|
+
/* @__PURE__ */ o(
|
|
83
|
+
"span",
|
|
84
|
+
{
|
|
85
|
+
className: L(
|
|
86
|
+
"flex shrink-0 text-f1-icon transition-transform duration-200 motion-reduce:transition-none",
|
|
87
|
+
c && "rotate-180"
|
|
88
|
+
),
|
|
89
|
+
children: /* @__PURE__ */ o(Pn, { icon: Bn, size: "sm" })
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
) }),
|
|
95
|
+
/* @__PURE__ */ o(Ln, { className: "px-0.5", children: s })
|
|
96
|
+
] });
|
|
97
|
+
}, Wn = ({
|
|
98
|
+
rows: e,
|
|
99
|
+
unplaced: t,
|
|
100
|
+
placed: r,
|
|
101
|
+
matches: a,
|
|
102
|
+
notOnMapOpen: i,
|
|
103
|
+
onNotOnMapOpenChange: s
|
|
104
|
+
}) => {
|
|
105
|
+
const l = sn();
|
|
106
|
+
return /* @__PURE__ */ o("div", { className: "flex h-full min-h-0 flex-col gap-1 overflow-y-auto px-1 pb-1.5 pt-0.5", children: a ? (
|
|
107
|
+
// Section rows step in 2px; so do matches, to stay where they were.
|
|
108
|
+
/* @__PURE__ */ o("div", { className: "px-0.5", "data-testid": "map-panel-search-results", children: a.length > 0 ? e(a) : /* @__PURE__ */ o("div", { className: "px-2 py-1.5", children: /* @__PURE__ */ o(
|
|
109
|
+
cn,
|
|
110
|
+
{
|
|
111
|
+
variant: "description",
|
|
112
|
+
content: l.select.noResults,
|
|
113
|
+
markdown: !1
|
|
114
|
+
}
|
|
115
|
+
) }) })
|
|
116
|
+
) : /* @__PURE__ */ k(rn, { children: [
|
|
117
|
+
t.length > 0 ? /* @__PURE__ */ o(
|
|
118
|
+
an,
|
|
119
|
+
{
|
|
120
|
+
title: l.collections.map.notOnMap,
|
|
121
|
+
count: t.length,
|
|
122
|
+
open: i,
|
|
123
|
+
onOpenChange: s,
|
|
124
|
+
dataTestId: "map-panel-not-on-map",
|
|
125
|
+
children: e(t)
|
|
126
|
+
}
|
|
127
|
+
) : null,
|
|
128
|
+
/* @__PURE__ */ o(
|
|
129
|
+
an,
|
|
130
|
+
{
|
|
131
|
+
title: l.collections.map.onMap,
|
|
132
|
+
count: r.length,
|
|
133
|
+
dataTestId: "map-panel-on-map",
|
|
134
|
+
children: e(r)
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
] }) });
|
|
138
|
+
}, Xn = ({
|
|
139
|
+
querySignature: e,
|
|
140
|
+
records: t,
|
|
141
|
+
markerKey: r,
|
|
142
|
+
isLoading: a,
|
|
143
|
+
reframe: i
|
|
144
|
+
}) => {
|
|
145
|
+
const s = p(null), l = p(
|
|
146
|
+
null
|
|
147
|
+
), c = p(null);
|
|
148
|
+
return v(() => {
|
|
149
|
+
s.current !== null && s.current !== e && (l.current = { records: t, markerKey: r }), s.current = e;
|
|
150
|
+
}, [e, t, r]), v(() => {
|
|
151
|
+
const u = l.current;
|
|
152
|
+
if (!u || a || u.records === t)
|
|
153
|
+
return;
|
|
154
|
+
l.current = null;
|
|
155
|
+
const E = c.current;
|
|
156
|
+
c.current = null, u.markerKey !== r ? i() : E?.();
|
|
157
|
+
}, [a, t, r, i]), {
|
|
158
|
+
/** Runs `fn` now, or once a pending query lands without new markers. */
|
|
159
|
+
ifUnchanged: (u) => {
|
|
160
|
+
l.current ? c.current = u : u();
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
}, $n = ({
|
|
164
|
+
selectedId: e,
|
|
165
|
+
search: t,
|
|
166
|
+
zoomedInRef: r,
|
|
167
|
+
fitToMarkers: a,
|
|
168
|
+
ifUnchanged: i
|
|
169
|
+
}) => {
|
|
170
|
+
const s = p(null);
|
|
171
|
+
v(() => {
|
|
172
|
+
const c = s.current;
|
|
173
|
+
s.current = e, c && !e && r.current && a(), e || (r.current = !1);
|
|
174
|
+
}, [e, a, r]);
|
|
175
|
+
const l = p(t);
|
|
176
|
+
v(() => {
|
|
177
|
+
const c = l.current;
|
|
178
|
+
l.current = t, !(!c || t) && (r.current && i(a), r.current = !1);
|
|
179
|
+
}, [t, a, r]);
|
|
180
|
+
}, qn = (e, {
|
|
181
|
+
coordinates: t,
|
|
182
|
+
label: r,
|
|
183
|
+
marker: a,
|
|
184
|
+
recordId: i
|
|
185
|
+
}) => {
|
|
186
|
+
const s = {
|
|
187
|
+
points: [],
|
|
188
|
+
placed: [],
|
|
189
|
+
unplaced: [],
|
|
190
|
+
placedIds: /* @__PURE__ */ new Set(),
|
|
191
|
+
unplacedKinds: /* @__PURE__ */ new Map()
|
|
192
|
+
};
|
|
193
|
+
for (const l of e) {
|
|
194
|
+
const c = i(l), u = t(l);
|
|
195
|
+
if (!Array.isArray(u)) {
|
|
196
|
+
s.unplaced.push(l), s.unplacedKinds.set(c, u?.kind ?? null);
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
s.placedIds.add(c), s.placed.push(l), s.points.push({
|
|
200
|
+
id: c,
|
|
201
|
+
coordinates: u,
|
|
202
|
+
label: r?.(l),
|
|
203
|
+
...a?.(l) ?? { variant: "default" }
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
return s;
|
|
207
|
+
}, zn = (e) => e.every((t) => t.variant === "employee") ? e.map(({ firstName: t, lastName: r, src: a }) => ({
|
|
208
|
+
firstName: t,
|
|
209
|
+
lastName: r,
|
|
210
|
+
src: a
|
|
211
|
+
})) : null, Hn = ({
|
|
212
|
+
hasSidebar: e,
|
|
213
|
+
panel: t,
|
|
214
|
+
expanded: r,
|
|
215
|
+
onToggle: a,
|
|
216
|
+
unplacedCount: i,
|
|
217
|
+
countButton: s,
|
|
218
|
+
search: l
|
|
219
|
+
}) => e ? {
|
|
220
|
+
sidebar: t,
|
|
221
|
+
sidebarExpanded: r,
|
|
222
|
+
onSidebarToggle: a,
|
|
223
|
+
sidebarToggleAddon: i > 0 ? s : void 0,
|
|
224
|
+
sidebarHeaderStart: l
|
|
225
|
+
} : {}, ee = ({
|
|
226
|
+
source: e,
|
|
227
|
+
coordinates: t,
|
|
228
|
+
label: r,
|
|
229
|
+
marker: a,
|
|
230
|
+
getRecordId: i,
|
|
231
|
+
selectedRecordId: s,
|
|
232
|
+
onSelect: l,
|
|
233
|
+
revealRecordId: c,
|
|
234
|
+
searchSelectionNonce: u,
|
|
235
|
+
viewportInset: E,
|
|
236
|
+
initialViewport: un,
|
|
237
|
+
showControls: pn,
|
|
238
|
+
projection: dn,
|
|
239
|
+
provider: fn,
|
|
240
|
+
markerLimit: mn,
|
|
241
|
+
ariaLabel: hn,
|
|
242
|
+
sidebar: I,
|
|
243
|
+
sidebarSearchText: C,
|
|
244
|
+
detail: F,
|
|
245
|
+
onSidebarToggle: gn,
|
|
246
|
+
onLoadData: vn,
|
|
247
|
+
onLoadError: bn
|
|
248
|
+
}) => {
|
|
249
|
+
const Q = sn(), j = Math.min(
|
|
250
|
+
mn ?? tn,
|
|
251
|
+
tn
|
|
252
|
+
), Mn = M(
|
|
253
|
+
() => e.dataAdapter.paginationType ? { ...e.dataAdapter, perPage: j } : e.dataAdapter,
|
|
254
|
+
[e.dataAdapter, j]
|
|
255
|
+
), { data: Cn, paginationInfo: K, isInitialLoading: U, isLoading: xn } = Qn({ ...e, dataAdapter: Mn }, { onError: bn }), d = Cn.records;
|
|
256
|
+
v(() => {
|
|
257
|
+
vn({
|
|
258
|
+
totalItems: K?.total || d.length,
|
|
259
|
+
filters: e.currentFilters,
|
|
260
|
+
search: e.currentSearch,
|
|
261
|
+
isInitialLoading: U,
|
|
262
|
+
data: d
|
|
263
|
+
});
|
|
264
|
+
}, [K?.total, d]);
|
|
265
|
+
const f = A(
|
|
266
|
+
(n) => i ? i(n) : String(n.id),
|
|
267
|
+
[i]
|
|
268
|
+
), { points: _, placed: T, unplaced: m, placedIds: x, unplacedKinds: W } = M(
|
|
269
|
+
() => qn(d, { coordinates: t, label: r, marker: a, recordId: f }),
|
|
270
|
+
[d, t, r, a, f]
|
|
271
|
+
), [On, Sn] = w(
|
|
272
|
+
null
|
|
273
|
+
), h = s !== void 0 ? s : On, O = p(null), X = p(null), $ = p(h);
|
|
274
|
+
$.current = h;
|
|
275
|
+
const D = p(!1), b = A(
|
|
276
|
+
(n) => {
|
|
277
|
+
if (n !== null && n === O.current) {
|
|
278
|
+
O.current = null;
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
X.current = n, n !== null && (D.current = !1), s === void 0 && Sn(n), l?.(
|
|
282
|
+
n === null ? null : d.find((g) => f(g) === n) ?? null
|
|
283
|
+
);
|
|
284
|
+
},
|
|
285
|
+
[l, d, f, s]
|
|
286
|
+
), S = p(null), N = A(
|
|
287
|
+
(n) => {
|
|
288
|
+
b(n), x.has(n) && S.current && (O.current = n, S.current.focusMarker(n), O.current = null, D.current = !0);
|
|
289
|
+
},
|
|
290
|
+
[x, b]
|
|
291
|
+
), q = p(l);
|
|
292
|
+
q.current = l, v(
|
|
293
|
+
() => () => {
|
|
294
|
+
(X.current !== null || $.current !== null) && q.current?.(null);
|
|
295
|
+
},
|
|
296
|
+
[]
|
|
297
|
+
);
|
|
298
|
+
const [P, Nn] = w(!1), [yn, z] = w(!1), [B, H] = w(""), J = (n) => {
|
|
299
|
+
n !== P && (Nn(n), gn?.(n));
|
|
300
|
+
}, An = () => {
|
|
301
|
+
z(!0), H(""), J(!0);
|
|
302
|
+
}, Z = M(
|
|
303
|
+
() => ({
|
|
304
|
+
select: (n) => n ? N(f(n)) : b(null),
|
|
305
|
+
selectedRecordId: h,
|
|
306
|
+
placement: (n) => {
|
|
307
|
+
const g = f(n);
|
|
308
|
+
return x.has(g) ? "placed" : W.get(g) ?? "unplaced";
|
|
309
|
+
}
|
|
310
|
+
}),
|
|
311
|
+
[N, b, f, h, x, W]
|
|
312
|
+
), y = h ? d.find((n) => f(n) === h) ?? null : null, G = p(null);
|
|
313
|
+
y && (G.current = y);
|
|
314
|
+
const V = y ?? G.current, Y = A(() => S.current?.fitToMarkers(), []), wn = Xn({
|
|
315
|
+
querySignature: JSON.stringify({
|
|
316
|
+
filters: e.currentFilters ?? {},
|
|
317
|
+
search: e.currentSearch ?? ""
|
|
318
|
+
}),
|
|
319
|
+
records: d,
|
|
320
|
+
markerKey: _.map((n) => n.id).join(","),
|
|
321
|
+
isLoading: xn,
|
|
322
|
+
reframe: Y
|
|
323
|
+
});
|
|
324
|
+
$n({
|
|
325
|
+
selectedId: h,
|
|
326
|
+
search: e.currentSearch,
|
|
327
|
+
zoomedInRef: D,
|
|
328
|
+
fitToMarkers: Y,
|
|
329
|
+
ifUnchanged: wn.ifUnchanged
|
|
330
|
+
});
|
|
331
|
+
const nn = p(null);
|
|
332
|
+
v(() => {
|
|
333
|
+
const n = `${c}:${u ?? 0}`;
|
|
334
|
+
!c || nn.current === n || !d.some((g) => f(g) === c) || (nn.current = n, N(c));
|
|
335
|
+
}, [c, u, d, f, N]);
|
|
336
|
+
const Rn = M(() => {
|
|
337
|
+
const n = B.trim().toLowerCase();
|
|
338
|
+
return !C || !n ? null : [...m, ...T].filter(
|
|
339
|
+
(g) => C(g).toLowerCase().includes(n)
|
|
340
|
+
);
|
|
341
|
+
}, [C, B, m, T]), kn = M(
|
|
342
|
+
() => a ? zn(m.map(a)) : null,
|
|
343
|
+
[m, a]
|
|
344
|
+
), en = "flex h-full min-h-0 flex-1 flex-col border-0 border-t border-solid border-f1-border-secondary";
|
|
345
|
+
return U ? /* @__PURE__ */ o("div", { className: en, children: /* @__PURE__ */ o(Kn, {}) }) : /* @__PURE__ */ o("div", { className: en, children: /* @__PURE__ */ o(
|
|
346
|
+
Un,
|
|
347
|
+
{
|
|
348
|
+
ref: S,
|
|
349
|
+
markers: _,
|
|
350
|
+
selectedMarkerId: h,
|
|
351
|
+
onMarkerSelect: b,
|
|
352
|
+
centerOnMarkerClick: !0,
|
|
353
|
+
viewportInset: E,
|
|
354
|
+
initialViewport: un,
|
|
355
|
+
showControls: pn,
|
|
356
|
+
projection: dn,
|
|
357
|
+
provider: fn,
|
|
358
|
+
ariaLabel: hn,
|
|
359
|
+
...Hn({
|
|
360
|
+
hasSidebar: !!I,
|
|
361
|
+
panel: /* @__PURE__ */ o(
|
|
362
|
+
Wn,
|
|
363
|
+
{
|
|
364
|
+
rows: (n) => I?.(n, Z),
|
|
365
|
+
unplaced: m,
|
|
366
|
+
placed: T,
|
|
367
|
+
matches: Rn,
|
|
368
|
+
notOnMapOpen: yn,
|
|
369
|
+
onNotOnMapOpenChange: z
|
|
370
|
+
}
|
|
371
|
+
),
|
|
372
|
+
expanded: P,
|
|
373
|
+
onToggle: () => J(!P),
|
|
374
|
+
unplacedCount: m.length,
|
|
375
|
+
countButton: /* @__PURE__ */ o(
|
|
376
|
+
_n,
|
|
377
|
+
{
|
|
378
|
+
title: Q.collections.map.notOnMap,
|
|
379
|
+
count: m.length,
|
|
380
|
+
ariaLabel: Q.t("collections.map.notOnMapCount", {
|
|
381
|
+
count: m.length
|
|
382
|
+
}),
|
|
383
|
+
avatars: kn,
|
|
384
|
+
onClick: An,
|
|
385
|
+
dataTestId: "map-not-on-map"
|
|
386
|
+
}
|
|
387
|
+
),
|
|
388
|
+
search: C ? /* @__PURE__ */ o(
|
|
389
|
+
jn,
|
|
390
|
+
{
|
|
391
|
+
value: B,
|
|
392
|
+
onChange: (n) => H(n ?? ""),
|
|
393
|
+
variant: "ghost",
|
|
394
|
+
expandedWidth: "fill"
|
|
395
|
+
}
|
|
396
|
+
) : void 0
|
|
397
|
+
}),
|
|
398
|
+
detail: F ? V ? F(V, Z) : (
|
|
399
|
+
// oxlint-disable-next-line react/jsx-no-useless-fragment -- a node, not null: see above
|
|
400
|
+
/* @__PURE__ */ o(rn, {})
|
|
401
|
+
) : null,
|
|
402
|
+
detailOpen: !!y,
|
|
403
|
+
clearSelectionOnBackgroundClick: !F,
|
|
404
|
+
fullScreen: !0
|
|
405
|
+
}
|
|
406
|
+
) });
|
|
407
|
+
};
|
|
408
|
+
export {
|
|
409
|
+
ee as MapCollection
|
|
410
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { S as L,
|
|
1
|
+
import { S as L, y as ye, u as q, z as Se, w as Re, i as ke, j as _e, k as Ne, A as Ce, l as Le, B as Fe, E as Ve, G as Te } from "./F0CanvasPanel-DnlpQoxW.js";
|
|
2
2
|
import { jsx as t, jsxs as y } from "react/jsx-runtime";
|
|
3
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-
|
|
4
|
+
import { e as Ee, D as Ue, P as je, c as De } from "./pdfWorker-CK4gerrz.js";
|
|
5
5
|
import { F as We } from "./Printer-BD-FEi_2.js";
|
|
6
|
-
import { d as ae } from "./tooltip-
|
|
6
|
+
import { d as ae } from "./tooltip-CrXp1Uaz.js";
|
|
7
7
|
import './index2.css';const Oe = ({
|
|
8
8
|
label: o,
|
|
9
9
|
width: a,
|
|
@@ -39,7 +39,7 @@ import './index2.css';const Oe = ({
|
|
|
39
39
|
variant: "outline",
|
|
40
40
|
size: i
|
|
41
41
|
}
|
|
42
|
-
),
|
|
42
|
+
), G = "flex flex-row items-center gap-2", Be = ({
|
|
43
43
|
toolbarRef: o,
|
|
44
44
|
currentPage: a,
|
|
45
45
|
totalPages: e,
|
|
@@ -57,7 +57,7 @@ import './index2.css';const Oe = ({
|
|
|
57
57
|
onDownload: x,
|
|
58
58
|
actions: h
|
|
59
59
|
}) => {
|
|
60
|
-
const { pdfViewer: c } =
|
|
60
|
+
const { pdfViewer: c } = q();
|
|
61
61
|
return /* @__PURE__ */ y(
|
|
62
62
|
"div",
|
|
63
63
|
{
|
|
@@ -69,7 +69,7 @@ import './index2.css';const Oe = ({
|
|
|
69
69
|
"px-6 py-4"
|
|
70
70
|
),
|
|
71
71
|
children: [
|
|
72
|
-
/* @__PURE__ */ y("div", { className:
|
|
72
|
+
/* @__PURE__ */ y("div", { className: G, children: [
|
|
73
73
|
i ? /* @__PURE__ */ y(
|
|
74
74
|
"span",
|
|
75
75
|
{
|
|
@@ -101,7 +101,7 @@ import './index2.css';const Oe = ({
|
|
|
101
101
|
}
|
|
102
102
|
)
|
|
103
103
|
] }),
|
|
104
|
-
/* @__PURE__ */ y("div", { className:
|
|
104
|
+
/* @__PURE__ */ y("div", { className: G, children: [
|
|
105
105
|
/* @__PURE__ */ t(
|
|
106
106
|
R,
|
|
107
107
|
{
|
|
@@ -129,7 +129,7 @@ import './index2.css';const Oe = ({
|
|
|
129
129
|
}
|
|
130
130
|
)
|
|
131
131
|
] }),
|
|
132
|
-
/* @__PURE__ */ y("div", { className:
|
|
132
|
+
/* @__PURE__ */ y("div", { className: G, children: [
|
|
133
133
|
P ? /* @__PURE__ */ t(
|
|
134
134
|
R,
|
|
135
135
|
{
|
|
@@ -170,7 +170,7 @@ import './index2.css';const Oe = ({
|
|
|
170
170
|
}, re = async (o) => {
|
|
171
171
|
const a = await o.saveDocument();
|
|
172
172
|
return new Blob([new Uint8Array(a)], { type: "application/pdf" });
|
|
173
|
-
},
|
|
173
|
+
}, $e = async (o) => {
|
|
174
174
|
if (!o)
|
|
175
175
|
return;
|
|
176
176
|
const a = URL.createObjectURL(await re(o)), e = document.createElement("iframe");
|
|
@@ -199,7 +199,7 @@ import './index2.css';const Oe = ({
|
|
|
199
199
|
}
|
|
200
200
|
const l = document.createElement("a");
|
|
201
201
|
l.href = i, l.download = a ?? "", l.rel = "noreferrer", s || (l.target = "_blank"), document.body.appendChild(l), l.click(), l.remove(), s && URL.revokeObjectURL(s);
|
|
202
|
-
},
|
|
202
|
+
}, Z = [
|
|
203
203
|
"0.5",
|
|
204
204
|
"0.75",
|
|
205
205
|
"1",
|
|
@@ -208,7 +208,7 @@ import './index2.css';const Oe = ({
|
|
|
208
208
|
"2",
|
|
209
209
|
"3",
|
|
210
210
|
"4"
|
|
211
|
-
], ie =
|
|
211
|
+
], ie = Z.map(Number), Me = (o) => ie.find((a) => a > o), Ie = (o) => [...ie].reverse().find((a) => a < o), Ae = (o, a, e) => {
|
|
212
212
|
let i = null, s = 0;
|
|
213
213
|
return a.forEach((l, d) => {
|
|
214
214
|
if (!l)
|
|
@@ -227,7 +227,7 @@ import './index2.css';const Oe = ({
|
|
|
227
227
|
}), i;
|
|
228
228
|
};
|
|
229
229
|
Ee();
|
|
230
|
-
const
|
|
230
|
+
const Ge = J(() => import("./SheetViewer-Wd4Fmg4a.js")), Ze = J(() => import("./DocxViewer-Dt2nHTXV.js")), qe = J(() => import("./TextViewer-C3OMcE58.js")), oe = 48, le = ne(
|
|
231
231
|
(o, a) => {
|
|
232
232
|
const { kind: e = "pdf", mimeType: i, ...s } = o;
|
|
233
233
|
if (e === "pdf")
|
|
@@ -259,7 +259,7 @@ const qe = J(() => import("./SheetViewer-DRvoh1Ht.js")), Ge = J(() => import("./
|
|
|
259
259
|
fallback: /* @__PURE__ */ t(L, { className: "h-full w-full rounded-none" }),
|
|
260
260
|
children: [
|
|
261
261
|
e === "sheet" ? /* @__PURE__ */ t(
|
|
262
|
-
|
|
262
|
+
Ge,
|
|
263
263
|
{
|
|
264
264
|
url: l,
|
|
265
265
|
filename: d,
|
|
@@ -268,7 +268,7 @@ const qe = J(() => import("./SheetViewer-DRvoh1Ht.js")), Ge = J(() => import("./
|
|
|
268
268
|
}
|
|
269
269
|
) : null,
|
|
270
270
|
e === "docx" ? /* @__PURE__ */ t(
|
|
271
|
-
|
|
271
|
+
Ze,
|
|
272
272
|
{
|
|
273
273
|
url: l,
|
|
274
274
|
filename: d,
|
|
@@ -277,7 +277,7 @@ const qe = J(() => import("./SheetViewer-DRvoh1Ht.js")), Ge = J(() => import("./
|
|
|
277
277
|
}
|
|
278
278
|
) : null,
|
|
279
279
|
e === "text" ? /* @__PURE__ */ t(
|
|
280
|
-
|
|
280
|
+
qe,
|
|
281
281
|
{
|
|
282
282
|
url: l,
|
|
283
283
|
name: d ?? "",
|
|
@@ -309,11 +309,11 @@ const se = ne((o, a) => {
|
|
|
309
309
|
onPageChange: g,
|
|
310
310
|
actions: H,
|
|
311
311
|
...x
|
|
312
|
-
} = o, { pdfViewer: h } =
|
|
312
|
+
} = o, { pdfViewer: h } = q(), [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 = l.length > 0 ? l.length : c?.numPages, X = _.find(Boolean), Y = (X?.originalWidth ?? 595) * N, ee = (X?.originalHeight ?? 842) * N, de = te(
|
|
313
313
|
() => [
|
|
314
314
|
{ value: "page-width", label: h.pageWidth },
|
|
315
315
|
{ value: "page-fit", label: h.pageFit },
|
|
316
|
-
...
|
|
316
|
+
...Z.map((n) => ({
|
|
317
317
|
value: n,
|
|
318
318
|
label: `${Number(n) * 100}%`
|
|
319
319
|
}))
|
|
@@ -330,7 +330,7 @@ const se = ne((o, a) => {
|
|
|
330
330
|
const r = _[S - 1], f = I.current;
|
|
331
331
|
if (!r || !f)
|
|
332
332
|
return;
|
|
333
|
-
const u = j.current?.offsetHeight ?? 0, C = E === 90 || E === 270,
|
|
333
|
+
const u = j.current?.offsetHeight ?? 0, C = E === 90 || E === 270, $ = C ? r.originalHeight : r.originalWidth, ve = C ? r.originalWidth : r.originalHeight, xe = n === "page-width" ? (f.clientWidth - oe) / $ : (f.clientHeight - u - oe) / ve;
|
|
334
334
|
z(xe), M(n);
|
|
335
335
|
},
|
|
336
336
|
[_, S, E]
|
|
@@ -343,18 +343,18 @@ const se = ne((o, a) => {
|
|
|
343
343
|
z(Number(n)), M(n);
|
|
344
344
|
},
|
|
345
345
|
[O]
|
|
346
|
-
),
|
|
346
|
+
), B = w((n) => {
|
|
347
347
|
if (n === void 0)
|
|
348
348
|
return;
|
|
349
349
|
z(n);
|
|
350
|
-
const r =
|
|
350
|
+
const r = Z.find((f) => Number(f) === n);
|
|
351
351
|
r && M(r);
|
|
352
352
|
}, []), me = w(
|
|
353
|
-
() =>
|
|
354
|
-
[N,
|
|
353
|
+
() => B(Me(N)),
|
|
354
|
+
[N, B]
|
|
355
355
|
), pe = w(
|
|
356
|
-
() =>
|
|
357
|
-
[N,
|
|
356
|
+
() => B(Ie(N)),
|
|
357
|
+
[N, B]
|
|
358
358
|
), ge = w(() => {
|
|
359
359
|
ce((n) => {
|
|
360
360
|
const r = (n + 90) % 360;
|
|
@@ -378,7 +378,7 @@ const se = ne((o, a) => {
|
|
|
378
378
|
);
|
|
379
379
|
f && Q(f);
|
|
380
380
|
}, []), we = w(() => {
|
|
381
|
-
|
|
381
|
+
$e(c);
|
|
382
382
|
}, [c]), Pe = w(() => {
|
|
383
383
|
ze(c, i);
|
|
384
384
|
}, [c, i]);
|
|
@@ -415,7 +415,7 @@ const se = ne((o, a) => {
|
|
|
415
415
|
className: "F0PdfViewer__surface relative flex h-full flex-col overflow-auto [scrollbar-gutter:stable_both-edges]",
|
|
416
416
|
children: [
|
|
417
417
|
/* @__PURE__ */ t(
|
|
418
|
-
|
|
418
|
+
Be,
|
|
419
419
|
{
|
|
420
420
|
toolbarRef: j,
|
|
421
421
|
currentPage: S,
|
|
@@ -477,11 +477,11 @@ const se = ne((o, a) => {
|
|
|
477
477
|
},
|
|
478
478
|
onLoadSuccess: (u) => {
|
|
479
479
|
K((C) => {
|
|
480
|
-
const
|
|
481
|
-
return
|
|
480
|
+
const $ = [...C];
|
|
481
|
+
return $[r] = {
|
|
482
482
|
originalWidth: u.originalWidth,
|
|
483
483
|
originalHeight: u.originalHeight
|
|
484
|
-
},
|
|
484
|
+
}, $;
|
|
485
485
|
});
|
|
486
486
|
}
|
|
487
487
|
}
|
|
@@ -500,7 +500,7 @@ const se = ne((o, a) => {
|
|
|
500
500
|
});
|
|
501
501
|
se.displayName = "PdfViewerBase";
|
|
502
502
|
const Je = () => {
|
|
503
|
-
const { pdfViewer: o } =
|
|
503
|
+
const { pdfViewer: o } = q();
|
|
504
504
|
return /* @__PURE__ */ y(
|
|
505
505
|
"div",
|
|
506
506
|
{
|
|
@@ -549,7 +549,7 @@ export {
|
|
|
549
549
|
R as T,
|
|
550
550
|
Ie as a,
|
|
551
551
|
at as d,
|
|
552
|
-
|
|
552
|
+
Z as f,
|
|
553
553
|
rt as i,
|
|
554
554
|
Me as n,
|
|
555
555
|
Ke as p
|
|
@@ -1,8 +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 { e as clsx } from "./tooltip-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { e as clsx } from "./tooltip-CrXp1Uaz.js";
|
|
4
|
+
import { aj as invariant } from "./F0CanvasPanel-DnlpQoxW.js";
|
|
5
|
+
import { e as dequal } from "./MapProvider-DNpgap--.js";
|
|
6
6
|
import { a as getAugmentedNamespace, g as getDefaultExportFromCjs } from "./_commonjsHelpers-ByX85dGu.js";
|
|
7
7
|
import { c as commonjsRequire } from "./_commonjs-dynamic-modules-BpilXLfW.js";
|
|
8
8
|
import './pdfWorker.css';var pdf$1 = { exports: {} };
|