@factorialco/f0-react 8.28.3 → 8.29.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/{ChatDocxThumbnail-D5hDwmp7.js → ChatDocxThumbnail-DTpOzL9A.js} +7 -7
- package/dist/{ChatPdfThumbnail-Cf74m771.js → ChatPdfThumbnail-Dj7xNA9A.js} +1 -1
- package/dist/{ChatPostComposerDialog-pRNELk68.js → ChatPostComposerDialog-BX6memv2.js} +3 -3
- package/dist/{ChatSheetThumbnail-D8aN1W_0.js → ChatSheetThumbnail-CyiwSdZJ.js} +1 -1
- package/dist/{DocumentToolbar-C4DUcWl7.js → DocumentToolbar-kzj-lnsk.js} +2 -2
- package/dist/{DocxViewer-M4FGdd_h.js → DocxViewer-Dbi2Iu1v.js} +7 -7
- package/dist/{F0AiProcessingOverlay-Cpx37q3a.js → F0AiProcessingOverlay-B0cBiNJx.js} +1 -1
- package/dist/{F0CanvasPanel-CRTe0CIF.js → F0CanvasPanel-CruNufKc.js} +191 -191
- package/dist/{F0Map-BywRoarL.js → F0Map-vyJ9l9av.js} +1266 -1134
- package/dist/{F0VideoPlayer-DUv08bcV.js → F0VideoPlayer-B4Tyl9fv.js} +18 -18
- package/dist/{MapProvider-CTtL5mc3.js → MapProvider-DpAl-lEe.js} +2 -2
- package/dist/SheetViewer-Q6MZNxhH.js +123 -0
- package/dist/{TextViewer-54DAaDA1.js → TextViewer-CUzoNSgl.js} +2 -2
- package/dist/ai.js +2 -2
- package/dist/component-status.js +1 -1
- package/dist/{experimental-STLmChcB.js → experimental-yqG2fG7V.js} +179 -179
- package/dist/experimental.d.ts +29 -4
- package/dist/experimental.js +54 -53
- package/dist/f0.js +10 -10
- package/dist/index-Bigrthbl.js +4 -0
- package/dist/{index-BXS__6p-.js → index-CHdKPPbt.js} +3 -3
- package/dist/{index-CKzBQYgd.js → index-CJqhKIrf.js} +195 -145
- package/dist/index-D86jd9Uj.js +358 -0
- package/dist/{index-9MKvlApA.js → index-DIiH9OpT.js} +28 -28
- package/dist/{pdfWorker-DACTjTuR.js → pdfWorker-C1_PScVO.js} +2 -2
- package/dist/{docx-preview-BaRDMyPN.js → renderDocx-CVEzw9MK.js} +920 -901
- package/dist/sheetPreview-Bqj3xODH.js +51 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/SheetViewer-BK9NNMZ9.js +0 -111
- package/dist/index-D0rQW0DI.js +0 -4
- package/dist/index-DFrzKaGA.js +0 -322
- package/dist/sheetPreview-Djc-YyVs.js +0 -37
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import { y as A } from "./F0CanvasPanel-CruNufKc.js";
|
|
2
|
+
const G = (e) => {
|
|
3
|
+
const t = /* @__PURE__ */ new Map();
|
|
4
|
+
return {
|
|
5
|
+
set: (r) => {
|
|
6
|
+
const c = new Set(r.map((a) => a.id));
|
|
7
|
+
t.forEach((a, l) => {
|
|
8
|
+
c.has(l) || (a.setMap(null), t.delete(l));
|
|
9
|
+
}), r.forEach((a) => {
|
|
10
|
+
const l = {
|
|
11
|
+
paths: a.ring.map(([y, g]) => ({ lat: g, lng: y })),
|
|
12
|
+
clickable: !1,
|
|
13
|
+
// Beneath the polylines, which sit at the default zIndex.
|
|
14
|
+
zIndex: -1,
|
|
15
|
+
fillColor: a.color,
|
|
16
|
+
fillOpacity: a.fillOpacity,
|
|
17
|
+
strokeColor: a.color,
|
|
18
|
+
strokeOpacity: 1,
|
|
19
|
+
strokeWeight: a.strokeWidth
|
|
20
|
+
}, p = t.get(a.id);
|
|
21
|
+
p ? p.setOptions(l) : t.set(a.id, new google.maps.Polygon({ ...l, map: e }));
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
destroy: () => {
|
|
25
|
+
t.forEach((r) => r.setMap(null)), t.clear();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}, k = 5.3, _ = 11 - k, B = (e) => {
|
|
29
|
+
let t, s;
|
|
30
|
+
return {
|
|
31
|
+
set: (r) => {
|
|
32
|
+
if (!r) {
|
|
33
|
+
s?.remove(), s = void 0, t = void 0;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (!t) {
|
|
37
|
+
t = document.createElement("div"), t.style.cssText = [
|
|
38
|
+
`width:${k * 2}px`,
|
|
39
|
+
`height:${k * 2}px`,
|
|
40
|
+
"border-radius:50%",
|
|
41
|
+
`background:hsl(${A.malibu[60]})`,
|
|
42
|
+
`box-shadow:0 0 0 ${_}px hsl(${A.malibu[50]} / 0.3)`,
|
|
43
|
+
"pointer-events:none"
|
|
44
|
+
].join(";"), s = e.add(t, r, { beneath: !0 });
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
s?.setPosition(r);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}, H = (e) => e.map(([t, s]) => ({ lat: s, lng: t })), P = (e, t) => ({
|
|
51
|
+
strokeColor: t && e.hover?.color || e.color,
|
|
52
|
+
strokeWeight: t && e.hover?.width || e.width,
|
|
53
|
+
strokeOpacity: e.dashed ? 0 : (t ? e.hover?.opacity : void 0) ?? e.opacity,
|
|
54
|
+
// Google has no dash array on a stroke: a dashed line is an invisible stroke
|
|
55
|
+
// carrying repeated dot symbols, spaced to match MapLibre's [1.5, 2.8].
|
|
56
|
+
icons: e.dashed ? [
|
|
57
|
+
{
|
|
58
|
+
icon: {
|
|
59
|
+
path: "M 0,-1 0,1",
|
|
60
|
+
strokeOpacity: (t ? e.hover?.opacity : void 0) ?? e.opacity,
|
|
61
|
+
strokeWeight: t && e.hover?.width || e.width,
|
|
62
|
+
scale: 1
|
|
63
|
+
},
|
|
64
|
+
offset: "0",
|
|
65
|
+
repeat: `${(t && e.hover?.width || e.width) * 2.9}px`
|
|
66
|
+
}
|
|
67
|
+
] : void 0
|
|
68
|
+
}), K = (e) => {
|
|
69
|
+
let t = [];
|
|
70
|
+
const s = () => {
|
|
71
|
+
for (const r of t)
|
|
72
|
+
r.listeners.forEach((c) => c.remove()), r.polyline.setMap(null);
|
|
73
|
+
t = [];
|
|
74
|
+
};
|
|
75
|
+
return {
|
|
76
|
+
set: (r, c) => {
|
|
77
|
+
s(), t = r.map((a) => {
|
|
78
|
+
const l = new google.maps.Polyline({
|
|
79
|
+
map: e,
|
|
80
|
+
path: H(a.coordinates),
|
|
81
|
+
clickable: !!c,
|
|
82
|
+
...P(a, !1)
|
|
83
|
+
}), p = [];
|
|
84
|
+
return c && p.push(
|
|
85
|
+
l.addListener("mouseover", () => {
|
|
86
|
+
l.setOptions(P(a, !0)), e.setOptions({ draggableCursor: "pointer" });
|
|
87
|
+
}),
|
|
88
|
+
l.addListener("mouseout", () => {
|
|
89
|
+
l.setOptions(P(a, !1)), e.setOptions({ draggableCursor: null });
|
|
90
|
+
}),
|
|
91
|
+
l.addListener("click", () => c(a.id))
|
|
92
|
+
), { line: a, polyline: l, listeners: p };
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
destroy: s
|
|
96
|
+
};
|
|
97
|
+
}, C = "__f0GoogleMapsReady", R = "https://maps.googleapis.com/maps/api/js";
|
|
98
|
+
let w;
|
|
99
|
+
const z = () => new Error("F0Map: the Google Maps JavaScript API failed to load."), T = () => window.google?.maps, D = async () => {
|
|
100
|
+
const e = T();
|
|
101
|
+
if (e?.importLibrary) {
|
|
102
|
+
await e.importLibrary("maps");
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (!e?.Map)
|
|
106
|
+
throw z();
|
|
107
|
+
}, U = (e) => new Promise((t, s) => {
|
|
108
|
+
e.addEventListener("load", () => t(), { once: !0 }), e.addEventListener("error", () => s(z()), { once: !0 });
|
|
109
|
+
}), N = (e) => new Promise((t, s) => {
|
|
110
|
+
const r = window;
|
|
111
|
+
r[C] = () => {
|
|
112
|
+
Reflect.deleteProperty(r, C), t();
|
|
113
|
+
};
|
|
114
|
+
const c = document.createElement("script");
|
|
115
|
+
c.async = !0, c.src = R + `?key=${encodeURIComponent(e)}&v=weekly&loading=async&libraries=maps&callback=${C}`, c.onerror = () => {
|
|
116
|
+
c.remove(), s(z());
|
|
117
|
+
}, document.head.appendChild(c);
|
|
118
|
+
}), V = (e) => {
|
|
119
|
+
if (w)
|
|
120
|
+
return w;
|
|
121
|
+
const t = document.querySelector(
|
|
122
|
+
`script[src^="${R}"]`
|
|
123
|
+
);
|
|
124
|
+
return w = (T() ? Promise.resolve() : t ? U(t) : N(e)).then(D).catch((r) => {
|
|
125
|
+
throw w = void 0, r;
|
|
126
|
+
}), w;
|
|
127
|
+
}, q = (e) => {
|
|
128
|
+
const t = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
|
|
129
|
+
let r, c, a = !1, l = !1;
|
|
130
|
+
const p = (d, u) => {
|
|
131
|
+
const m = u.fromLatLngToDivPixel(
|
|
132
|
+
new google.maps.LatLng(d.at[1], d.at[0])
|
|
133
|
+
);
|
|
134
|
+
m && (d.element.style.transform = `translate(${m.x}px, ${m.y}px) translate(-50%, -50%)`);
|
|
135
|
+
};
|
|
136
|
+
class y extends google.maps.OverlayView {
|
|
137
|
+
onAdd() {
|
|
138
|
+
const u = this.getPanes(), m = () => {
|
|
139
|
+
const o = document.createElement("div");
|
|
140
|
+
return o.style.cssText = "position:absolute;left:0;top:0;width:0;height:0", o;
|
|
141
|
+
};
|
|
142
|
+
r = m(), c = m();
|
|
143
|
+
for (const o of t)
|
|
144
|
+
(o.beneath ? c : r).appendChild(o.element);
|
|
145
|
+
u?.overlayMouseTarget.appendChild(r), u?.mapPane.appendChild(c);
|
|
146
|
+
}
|
|
147
|
+
draw() {
|
|
148
|
+
const u = this.getProjection();
|
|
149
|
+
if (u) {
|
|
150
|
+
for (const m of t)
|
|
151
|
+
p(m, u);
|
|
152
|
+
a || (a = !0, s.forEach((m) => m()));
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
onRemove() {
|
|
156
|
+
r?.remove(), c?.remove(), r = void 0, c = void 0;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
const g = new y();
|
|
160
|
+
g.setMap(e);
|
|
161
|
+
const v = () => l ? void 0 : g.getProjection();
|
|
162
|
+
return {
|
|
163
|
+
add: (d, u, m) => {
|
|
164
|
+
const o = { element: d, at: u, beneath: m?.beneath ?? !1 };
|
|
165
|
+
t.add(o), d.style.position = "absolute", (o.beneath ? c : r)?.appendChild(d);
|
|
166
|
+
const n = v();
|
|
167
|
+
return n && p(o, n), {
|
|
168
|
+
setPosition: (h) => {
|
|
169
|
+
o.at = h;
|
|
170
|
+
const i = v();
|
|
171
|
+
i && p(o, i);
|
|
172
|
+
},
|
|
173
|
+
remove: () => {
|
|
174
|
+
t.delete(o), d.remove();
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
},
|
|
178
|
+
onReady: (d) => a ? (d(), () => {
|
|
179
|
+
}) : (s.add(d), () => s.delete(d)),
|
|
180
|
+
isReady: () => a,
|
|
181
|
+
destroy: () => {
|
|
182
|
+
l = !0, a = !1, s.clear();
|
|
183
|
+
for (const d of t)
|
|
184
|
+
d.element.remove();
|
|
185
|
+
t.clear(), g.setMap(null);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
}, L = 256, I = ([e, t]) => {
|
|
189
|
+
const s = Math.min(
|
|
190
|
+
Math.max(Math.sin(t * Math.PI / 180), -0.9999),
|
|
191
|
+
0.9999
|
|
192
|
+
);
|
|
193
|
+
return {
|
|
194
|
+
x: L * (0.5 + e / 360),
|
|
195
|
+
y: L * (0.5 - Math.log((1 + s) / (1 - s)) / (4 * Math.PI))
|
|
196
|
+
};
|
|
197
|
+
}, J = ({ x: e, y: t }) => [
|
|
198
|
+
(e / L - 0.5) * 360,
|
|
199
|
+
Math.atan(Math.sinh(Math.PI * (1 - 2 * t / L))) * 180 / Math.PI
|
|
200
|
+
], Q = {
|
|
201
|
+
globeProjection: !1,
|
|
202
|
+
/**
|
|
203
|
+
* The getters report the destination in the same tick, so a flight in
|
|
204
|
+
* progress cannot be read even though the renderer glides.
|
|
205
|
+
*/
|
|
206
|
+
observableFlight: !1
|
|
207
|
+
}, j = (e) => e, b = ([e, t]) => ({ lat: t, lng: e }), x = (e) => Math.floor(e + 1e-6), X = {
|
|
208
|
+
move: "bounds_changed",
|
|
209
|
+
zoom: "zoom_changed",
|
|
210
|
+
click: "click",
|
|
211
|
+
styled: "idle"
|
|
212
|
+
}, Y = (e) => {
|
|
213
|
+
const t = document.createElement("div");
|
|
214
|
+
t.style.cssText = "position:absolute;inset:0", e.container.appendChild(t);
|
|
215
|
+
const s = new google.maps.Map(t, {
|
|
216
|
+
center: b(e.center),
|
|
217
|
+
zoom: x(e.zoom),
|
|
218
|
+
minZoom: e.minZoom,
|
|
219
|
+
maxZoom: e.maxZoom,
|
|
220
|
+
// No `mapId` deliberately: with one, `styles` is ignored and the theme is
|
|
221
|
+
// immutable after the first render, so a light/dark swap means a teardown.
|
|
222
|
+
styles: j(e.style),
|
|
223
|
+
disableDefaultUI: !0,
|
|
224
|
+
// A gesture follows the fingers; `idle` then settles on a whole level.
|
|
225
|
+
isFractionalZoomEnabled: !0,
|
|
226
|
+
// Also removes the attribution bar's shortcuts button.
|
|
227
|
+
keyboardShortcuts: !1,
|
|
228
|
+
gestureHandling: e.interactive ? e.cooperativeGestures ? "cooperative" : "greedy" : "none"
|
|
229
|
+
});
|
|
230
|
+
s.addListener("idle", () => {
|
|
231
|
+
const o = s.getZoom();
|
|
232
|
+
o !== void 0 && Math.abs(o - Math.round(o)) > 1e-6 && s.setZoom(Math.round(o));
|
|
233
|
+
});
|
|
234
|
+
const r = q(s), c = B(r), a = K(s), l = G(s);
|
|
235
|
+
let p = !1;
|
|
236
|
+
const y = () => s.getZoom() ?? e.zoom, g = () => {
|
|
237
|
+
const o = s.getCenter();
|
|
238
|
+
return o ? [o.lng(), o.lat()] : e.center;
|
|
239
|
+
}, v = () => p || !r.isReady() ? null : {
|
|
240
|
+
scale: 2 ** y(),
|
|
241
|
+
centre: I(g()),
|
|
242
|
+
half: { x: t.clientWidth / 2, y: t.clientHeight / 2 }
|
|
243
|
+
}, d = (o) => {
|
|
244
|
+
const n = v();
|
|
245
|
+
if (!n)
|
|
246
|
+
return null;
|
|
247
|
+
const h = I(o);
|
|
248
|
+
return {
|
|
249
|
+
x: (h.x - n.centre.x) * n.scale + n.half.x,
|
|
250
|
+
y: (h.y - n.centre.y) * n.scale + n.half.y
|
|
251
|
+
};
|
|
252
|
+
}, u = (o) => {
|
|
253
|
+
const n = v();
|
|
254
|
+
return n ? J({
|
|
255
|
+
x: n.centre.x + (o.x - n.half.x) / n.scale,
|
|
256
|
+
y: n.centre.y + (o.y - n.half.y) / n.scale
|
|
257
|
+
}) : null;
|
|
258
|
+
}, m = (o) => {
|
|
259
|
+
s.panTo(b(o.center)), o.zoom !== void 0 && s.setZoom(x(o.zoom));
|
|
260
|
+
};
|
|
261
|
+
return {
|
|
262
|
+
provider: "google",
|
|
263
|
+
capabilities: Q,
|
|
264
|
+
native: () => s,
|
|
265
|
+
isAlive: () => !p,
|
|
266
|
+
destroy: () => {
|
|
267
|
+
p = !0, a.destroy(), l.destroy(), c.set(null), r.destroy(), t.remove();
|
|
268
|
+
},
|
|
269
|
+
on: (o, n) => {
|
|
270
|
+
if (o === "ready")
|
|
271
|
+
return r.onReady(n);
|
|
272
|
+
if (o === "resize") {
|
|
273
|
+
const i = new ResizeObserver(() => n());
|
|
274
|
+
return i.observe(e.container), () => i.disconnect();
|
|
275
|
+
}
|
|
276
|
+
if (o === "error") {
|
|
277
|
+
const i = window, f = i.gm_authFailure;
|
|
278
|
+
return i.gm_authFailure = n, () => {
|
|
279
|
+
i.gm_authFailure = f;
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
const h = s.addListener(X[o], n);
|
|
283
|
+
return () => h.remove();
|
|
284
|
+
},
|
|
285
|
+
project: d,
|
|
286
|
+
unproject: u,
|
|
287
|
+
getZoom: y,
|
|
288
|
+
getCenter: g,
|
|
289
|
+
jumpTo: (o) => {
|
|
290
|
+
s.moveCamera({
|
|
291
|
+
center: b(o.center),
|
|
292
|
+
...o.zoom === void 0 ? {} : { zoom: x(o.zoom) }
|
|
293
|
+
});
|
|
294
|
+
},
|
|
295
|
+
easeTo: m,
|
|
296
|
+
// No coupled pan+zoom arc exists here; the renderer glides on its own.
|
|
297
|
+
flyTo: m,
|
|
298
|
+
fitCoordinates: (o, n) => {
|
|
299
|
+
const h = new google.maps.LatLngBounds();
|
|
300
|
+
o.forEach((f) => h.extend(b(f)));
|
|
301
|
+
const i = n?.gutter ?? 0;
|
|
302
|
+
if (s.fitBounds(h, {
|
|
303
|
+
top: i,
|
|
304
|
+
right: i,
|
|
305
|
+
bottom: i,
|
|
306
|
+
left: i
|
|
307
|
+
}), n?.maxZoom !== void 0) {
|
|
308
|
+
const f = s.getZoom();
|
|
309
|
+
f !== void 0 && f > n.maxZoom && s.setZoom(x(n.maxZoom));
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
// Google has no `cameraForBounds`: the pixel box at the current zoom gives
|
|
313
|
+
// the scale change to fit, which is a zoom delta.
|
|
314
|
+
cameraForCoordinates: (o, n) => {
|
|
315
|
+
if (o.length === 0)
|
|
316
|
+
return null;
|
|
317
|
+
const h = o.map(d);
|
|
318
|
+
if (h.some((M) => M === null))
|
|
319
|
+
return null;
|
|
320
|
+
const i = h.map((M) => M.x), f = h.map((M) => M.y), Z = u({
|
|
321
|
+
x: (Math.min(...i) + Math.max(...i)) / 2,
|
|
322
|
+
y: (Math.min(...f) + Math.max(...f)) / 2
|
|
323
|
+
});
|
|
324
|
+
if (!Z)
|
|
325
|
+
return null;
|
|
326
|
+
const E = n?.gutter ?? 0, $ = Math.max(Math.max(...i) - Math.min(...i), 1), S = Math.max(Math.max(...f) - Math.min(...f), 1), O = {
|
|
327
|
+
width: Math.max(e.container.clientWidth - E * 2, 1),
|
|
328
|
+
height: Math.max(e.container.clientHeight - E * 2, 1)
|
|
329
|
+
}, F = Math.min(O.width / $, O.height / S), W = Math.min(
|
|
330
|
+
y() + Math.log2(F),
|
|
331
|
+
n?.maxZoom ?? 1 / 0
|
|
332
|
+
);
|
|
333
|
+
return { center: Z, zoom: x(W) };
|
|
334
|
+
},
|
|
335
|
+
addDomMarker: r.add,
|
|
336
|
+
setLines: (o, n) => a.set(o, n?.onClick),
|
|
337
|
+
setAreas: (o) => l.set(o),
|
|
338
|
+
setCurrentLocation: (o) => c.set(o),
|
|
339
|
+
zoomIn: () => s.setZoom(y() + 1),
|
|
340
|
+
zoomOut: () => s.setZoom(y() - 1),
|
|
341
|
+
// Google re-reads its container on its own; there is nothing to poke.
|
|
342
|
+
resize: () => {
|
|
343
|
+
},
|
|
344
|
+
applyStyle: (o) => s.setOptions({ styles: j(o) }),
|
|
345
|
+
setGlobeProjection: () => {
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
}, te = async (e) => {
|
|
349
|
+
if (!e?.apiKey)
|
|
350
|
+
throw new Error(
|
|
351
|
+
"F0Map: the google provider needs an apiKey on <F0Provider map={{ config: { apiKey } }}>."
|
|
352
|
+
);
|
|
353
|
+
return await V(e.apiKey), Y;
|
|
354
|
+
};
|
|
355
|
+
export {
|
|
356
|
+
Y as createGoogleAdapter,
|
|
357
|
+
te as loadGoogleAdapter
|
|
358
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as E,
|
|
1
|
+
import { S as E, z as Ce, u as X, A as Te, w as Le, j as Fe, k as De, l as Ve, B as Ee, m as He, E as Ue, G as Oe, H as We, J as je } from "./F0CanvasPanel-CruNufKc.js";
|
|
2
2
|
import { jsx as r, jsxs as P } from "react/jsx-runtime";
|
|
3
3
|
import { lazy as Y, forwardRef as ce, Suspense as $e, useState as U, useRef as A, useCallback as w, useMemo as ie, useEffect as V } from "react";
|
|
4
|
-
import { e as ze, D as Me, P as Be, c as Ie } from "./pdfWorker-
|
|
4
|
+
import { e as ze, D as Me, P as Be, c as Ie } from "./pdfWorker-C1_PScVO.js";
|
|
5
5
|
import { F as Ae } from "./Printer-BD-FEi_2.js";
|
|
6
6
|
import { d as G } from "./tooltip-CrXp1Uaz.js";
|
|
7
7
|
import './index2.css';const Ge = ({
|
|
@@ -58,22 +58,22 @@ import './index2.css';const Ge = ({
|
|
|
58
58
|
onZoomIn: u,
|
|
59
59
|
onZoomOut: b,
|
|
60
60
|
onScaleChange: N,
|
|
61
|
-
rotatable:
|
|
61
|
+
rotatable: y,
|
|
62
62
|
onRotate: x,
|
|
63
63
|
onPrint: O,
|
|
64
64
|
onDownload: m,
|
|
65
65
|
actions: C,
|
|
66
|
-
placement:
|
|
66
|
+
placement: v
|
|
67
67
|
}) => {
|
|
68
|
-
const { pdfViewer: p } = X(), g = qe(
|
|
68
|
+
const { pdfViewer: p } = X(), g = qe(v);
|
|
69
69
|
return /* @__PURE__ */ P(
|
|
70
70
|
"div",
|
|
71
71
|
{
|
|
72
72
|
ref: e,
|
|
73
73
|
role: "toolbar",
|
|
74
74
|
"aria-label": p.toolbar,
|
|
75
|
-
"data-placement":
|
|
76
|
-
className: Ze(
|
|
75
|
+
"data-placement": v,
|
|
76
|
+
className: Ze(v),
|
|
77
77
|
children: [
|
|
78
78
|
i ? /* @__PURE__ */ P(
|
|
79
79
|
"span",
|
|
@@ -81,7 +81,7 @@ import './index2.css';const Ge = ({
|
|
|
81
81
|
"aria-live": "polite",
|
|
82
82
|
className: G(
|
|
83
83
|
"whitespace-nowrap text-sm font-medium",
|
|
84
|
-
|
|
84
|
+
v === "top" ? "text-f1-foreground-secondary" : "pl-2 text-f1-foreground-inverse"
|
|
85
85
|
),
|
|
86
86
|
children: [
|
|
87
87
|
t,
|
|
@@ -139,7 +139,7 @@ import './index2.css';const Ge = ({
|
|
|
139
139
|
)
|
|
140
140
|
] }),
|
|
141
141
|
/* @__PURE__ */ P("div", { className: g, children: [
|
|
142
|
-
|
|
142
|
+
y ? /* @__PURE__ */ r(
|
|
143
143
|
_,
|
|
144
144
|
{
|
|
145
145
|
label: p.rotate,
|
|
@@ -224,21 +224,21 @@ import './index2.css';const Ge = ({
|
|
|
224
224
|
return t.forEach((s, c) => {
|
|
225
225
|
if (!s)
|
|
226
226
|
return;
|
|
227
|
-
const h = s.offsetHeight, u = s.offsetTop, b = u + h, N = e.offsetHeight - o,
|
|
228
|
-
if (!(
|
|
227
|
+
const h = s.offsetHeight, u = s.offsetTop, b = u + h, N = e.offsetHeight - o, y = e.scrollTop + o, x = y + N;
|
|
228
|
+
if (!(y < b && x > u))
|
|
229
229
|
return;
|
|
230
230
|
let m;
|
|
231
|
-
if (
|
|
231
|
+
if (y <= u)
|
|
232
232
|
m = x > b ? h : x - u;
|
|
233
233
|
else {
|
|
234
|
-
let C =
|
|
234
|
+
let C = y - u;
|
|
235
235
|
x < b && (C += b - x), m = h - C;
|
|
236
236
|
}
|
|
237
237
|
m > l && (l = m, i = c + 1);
|
|
238
238
|
}), i;
|
|
239
239
|
};
|
|
240
240
|
ze();
|
|
241
|
-
const ot = Y(() => import("./SheetViewer-
|
|
241
|
+
const ot = Y(() => import("./SheetViewer-Q6MZNxhH.js")), nt = Y(() => import("./DocxViewer-Dbi2Iu1v.js")), rt = Y(() => import("./TextViewer-CUzoNSgl.js")), se = 48, at = 150, ue = ce((e, t) => {
|
|
242
242
|
const { kind: o = "pdf", mimeType: i, toolbar: l = "top", ...s } = e;
|
|
243
243
|
if (o === "pdf")
|
|
244
244
|
return /* @__PURE__ */ r(me, { ref: t, toolbar: l, ...s });
|
|
@@ -248,12 +248,12 @@ const ot = Y(() => import("./SheetViewer-BK9NNMZ9.js")), nt = Y(() => import("./
|
|
|
248
248
|
actions: u,
|
|
249
249
|
withCredentials: b = !0,
|
|
250
250
|
page: N,
|
|
251
|
-
pagesToDisplay:
|
|
251
|
+
pagesToDisplay: y,
|
|
252
252
|
initialScale: x,
|
|
253
253
|
rotatable: O,
|
|
254
254
|
initialRotation: m,
|
|
255
255
|
onRotationChange: C,
|
|
256
|
-
onPdfLoaded:
|
|
256
|
+
onPdfLoaded: v,
|
|
257
257
|
onPageChange: p,
|
|
258
258
|
...g
|
|
259
259
|
} = s;
|
|
@@ -311,12 +311,12 @@ const me = ce((e, t) => {
|
|
|
311
311
|
rotatable: u = !1,
|
|
312
312
|
initialRotation: b = 0,
|
|
313
313
|
onRotationChange: N,
|
|
314
|
-
onPdfLoaded:
|
|
314
|
+
onPdfLoaded: y,
|
|
315
315
|
onPageChange: x,
|
|
316
316
|
actions: O,
|
|
317
317
|
toolbar: m = "top",
|
|
318
318
|
...C
|
|
319
|
-
} = e, { pdfViewer:
|
|
319
|
+
} = e, { pdfViewer: v } = X(), p = Math.max(
|
|
320
320
|
2,
|
|
321
321
|
typeof window > "u" ? 1 : window.devicePixelRatio || 1
|
|
322
322
|
), [g, R] = U(null), [S, ee] = U([]), [T, Z] = U(1), [k, te] = U(0), [L, q] = U(c), [F, ge] = U(b), $ = A(null), J = A(null), W = A([]), z = s.length > 0 ? s.length : g?.numPages, M = w(
|
|
@@ -324,14 +324,14 @@ const me = ce((e, t) => {
|
|
|
324
324
|
[m]
|
|
325
325
|
), oe = S.find(Boolean), ne = (oe?.originalWidth ?? 595) * T, re = (oe?.originalHeight ?? 842) * T, he = ie(
|
|
326
326
|
() => [
|
|
327
|
-
{ value: "page-width", label:
|
|
328
|
-
{ value: "page-fit", label:
|
|
327
|
+
{ value: "page-width", label: v.pageWidth },
|
|
328
|
+
{ value: "page-fit", label: v.pageFit },
|
|
329
329
|
...Q.map((n) => ({
|
|
330
330
|
value: n,
|
|
331
331
|
label: `${Number(n) * 100}%`
|
|
332
332
|
}))
|
|
333
333
|
],
|
|
334
|
-
[
|
|
334
|
+
[v.pageWidth, v.pageFit]
|
|
335
335
|
), be = ie(() => ({ url: o, withCredentials: h }), [o, h]), H = w(
|
|
336
336
|
(n) => {
|
|
337
337
|
const a = (z ?? 1) - 1, d = Math.min(Math.max(n, 0), a), f = W.current[d], D = f?.offsetParent;
|
|
@@ -365,21 +365,21 @@ const me = ce((e, t) => {
|
|
|
365
365
|
}, []), xe = w(
|
|
366
366
|
() => B(Ye(T)),
|
|
367
367
|
[T, B]
|
|
368
|
-
),
|
|
368
|
+
), ve = w(
|
|
369
369
|
() => B(et(T)),
|
|
370
370
|
[T, B]
|
|
371
|
-
),
|
|
371
|
+
), ye = w(() => {
|
|
372
372
|
ge((n) => {
|
|
373
373
|
const a = (n + 90) % 360;
|
|
374
374
|
return N?.(a), a;
|
|
375
375
|
});
|
|
376
376
|
}, [N]), Pe = w(
|
|
377
377
|
(n) => {
|
|
378
|
-
R(n),
|
|
378
|
+
R(n), y?.(n), setTimeout(() => {
|
|
379
379
|
te(l + 1), H(l);
|
|
380
380
|
}, 0);
|
|
381
381
|
},
|
|
382
|
-
[
|
|
382
|
+
[y, l, H]
|
|
383
383
|
), Re = w(
|
|
384
384
|
(n) => {
|
|
385
385
|
const a = n.target;
|
|
@@ -440,10 +440,10 @@ const me = ce((e, t) => {
|
|
|
440
440
|
onPreviousPage: () => H(k - 2),
|
|
441
441
|
onNextPage: () => H(k),
|
|
442
442
|
onZoomIn: xe,
|
|
443
|
-
onZoomOut:
|
|
443
|
+
onZoomOut: ve,
|
|
444
444
|
onScaleChange: we,
|
|
445
445
|
rotatable: u,
|
|
446
|
-
onRotate:
|
|
446
|
+
onRotate: ye,
|
|
447
447
|
onPrint: Se,
|
|
448
448
|
onDownload: ke,
|
|
449
449
|
actions: O
|
|
@@ -471,7 +471,7 @@ const me = ce((e, t) => {
|
|
|
471
471
|
loading: /* @__PURE__ */ r(
|
|
472
472
|
Ge,
|
|
473
473
|
{
|
|
474
|
-
label:
|
|
474
|
+
label: v.loading,
|
|
475
475
|
width: ne,
|
|
476
476
|
height: re
|
|
477
477
|
}
|
|
@@ -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
3
|
import { e as clsx } from "./tooltip-CrXp1Uaz.js";
|
|
4
|
-
import {
|
|
5
|
-
import { f as dequal } from "./MapProvider-
|
|
4
|
+
import { al as invariant } from "./F0CanvasPanel-CruNufKc.js";
|
|
5
|
+
import { f as dequal } from "./MapProvider-DpAl-lEe.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: {} };
|