@factorialco/f0-react 7.35.0 → 7.36.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-BDgzIfCN.js → ChatPdfThumbnail-DtfR1SAC.js} +1 -1
- package/dist/{ChatPostComposerDialog-SVcKg-wn.js → ChatPostComposerDialog-CxaeR8Vv.js} +3 -3
- package/dist/{DocumentToolbar-gJWaStGV.js → DocumentToolbar-Cu151FpB.js} +2 -2
- package/dist/{DocxViewer-BXXgJXpj.js → DocxViewer-BqD75taI.js} +2 -2
- package/dist/{F0AiProcessingOverlay-BsKOOcJf.js → F0AiProcessingOverlay-Bwmzd2o8.js} +2648 -2524
- package/dist/{F0CanvasPanel-B8GTWbHT.js → F0CanvasPanel-DvxjOp3m.js} +21410 -21296
- package/dist/{F0Map-Bva6_CXT.js → F0Map-CGZjOG11.js} +564 -483
- package/dist/{F0VideoPlayer-COE_GnIT.js → F0VideoPlayer-B_IfaZ6N.js} +2 -2
- package/dist/{MapProvider-D7fCPtpO.js → MapProvider-By9Tk09N.js} +2 -2
- package/dist/{SheetViewer-BX20kP4V.js → SheetViewer-CspxsxLt.js} +2 -2
- package/dist/{TextViewer-DUWw3Q54.js → TextViewer-DIsaa4Y4.js} +2 -2
- package/dist/ai.d.ts +159 -17
- package/dist/ai.js +2 -2
- package/dist/component-status.d.ts +10 -10
- package/dist/component-status.js +1 -1
- package/dist/{experimental-uK79fur-.js → experimental-BD0iEWNv.js} +7 -7
- package/dist/experimental.d.ts +69 -20
- package/dist/experimental.js +58 -58
- package/dist/f0.d.ts +166 -19
- package/dist/f0.js +12 -20
- package/dist/i18n-provider-defaults.d.ts +12 -10
- package/dist/i18n-provider-defaults.js +2 -0
- package/dist/{index-BJw_9Cag.js → index-DUKAr0H2.js} +3 -3
- package/dist/{index-D7YSSoL3.js → index-DcQIDzx6.js} +2 -2
- package/dist/index-DcZSmX1C.js +322 -0
- package/dist/index-DtGGGJrE.js +4 -0
- package/dist/{index-BDGCJ0_G.js → index-UiHhshSR.js} +3 -3
- package/dist/{pdfWorker-DG2DNdLq.js → pdfWorker-By8Miy58.js} +2 -2
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/index-Bgs0HZ5x.js +0 -4
- package/dist/index-C3iCeJK1.js +0 -281
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { n as E } from "./F0CanvasPanel-DvxjOp3m.js";
|
|
2
|
+
const P = 5.3, G = 11 - P, S = (e) => {
|
|
3
|
+
let t, r;
|
|
4
|
+
return {
|
|
5
|
+
set: (s) => {
|
|
6
|
+
if (!s) {
|
|
7
|
+
r?.remove(), r = void 0, t = void 0;
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (!t) {
|
|
11
|
+
t = document.createElement("div"), t.style.cssText = [
|
|
12
|
+
`width:${P * 2}px`,
|
|
13
|
+
`height:${P * 2}px`,
|
|
14
|
+
"border-radius:50%",
|
|
15
|
+
`background:hsl(${E.malibu[60]})`,
|
|
16
|
+
`box-shadow:0 0 0 ${G}px hsl(${E.malibu[50]} / 0.3)`,
|
|
17
|
+
"pointer-events:none"
|
|
18
|
+
].join(";"), r = e.add(t, s, { beneath: !0 });
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
r?.setPosition(s);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}, _ = (e) => e.map(([t, r]) => ({ lat: r, lng: t })), b = (e, t) => ({
|
|
25
|
+
strokeColor: t && e.hover?.color || e.color,
|
|
26
|
+
strokeWeight: t && e.hover?.width || e.width,
|
|
27
|
+
strokeOpacity: e.dashed ? 0 : (t ? e.hover?.opacity : void 0) ?? e.opacity,
|
|
28
|
+
// Google has no dash array on a stroke: a dashed line is an invisible stroke
|
|
29
|
+
// carrying repeated dot symbols, spaced to match MapLibre's [1.5, 2.8].
|
|
30
|
+
icons: e.dashed ? [
|
|
31
|
+
{
|
|
32
|
+
icon: {
|
|
33
|
+
path: "M 0,-1 0,1",
|
|
34
|
+
strokeOpacity: (t ? e.hover?.opacity : void 0) ?? e.opacity,
|
|
35
|
+
strokeWeight: t && e.hover?.width || e.width,
|
|
36
|
+
scale: 1
|
|
37
|
+
},
|
|
38
|
+
offset: "0",
|
|
39
|
+
repeat: `${(t && e.hover?.width || e.width) * 2.9}px`
|
|
40
|
+
}
|
|
41
|
+
] : void 0
|
|
42
|
+
}), W = (e) => {
|
|
43
|
+
let t = [];
|
|
44
|
+
const r = () => {
|
|
45
|
+
for (const s of t)
|
|
46
|
+
s.listeners.forEach((a) => a.remove()), s.polyline.setMap(null);
|
|
47
|
+
t = [];
|
|
48
|
+
};
|
|
49
|
+
return {
|
|
50
|
+
set: (s, a) => {
|
|
51
|
+
r(), t = s.map((l) => {
|
|
52
|
+
const p = new google.maps.Polyline({
|
|
53
|
+
map: e,
|
|
54
|
+
path: _(l.coordinates),
|
|
55
|
+
clickable: !!a,
|
|
56
|
+
...b(l, !1)
|
|
57
|
+
}), u = [];
|
|
58
|
+
return a && u.push(
|
|
59
|
+
p.addListener("mouseover", () => {
|
|
60
|
+
p.setOptions(b(l, !0)), e.setOptions({ draggableCursor: "pointer" });
|
|
61
|
+
}),
|
|
62
|
+
p.addListener("mouseout", () => {
|
|
63
|
+
p.setOptions(b(l, !1)), e.setOptions({ draggableCursor: null });
|
|
64
|
+
}),
|
|
65
|
+
p.addListener("click", () => a(l.id))
|
|
66
|
+
), { line: l, polyline: p, listeners: u };
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
destroy: r
|
|
70
|
+
};
|
|
71
|
+
}, L = "__f0GoogleMapsReady", j = "https://maps.googleapis.com/maps/api/js";
|
|
72
|
+
let v;
|
|
73
|
+
const C = () => new Error("F0Map: the Google Maps JavaScript API failed to load."), A = () => window.google?.maps, B = async () => {
|
|
74
|
+
const e = A();
|
|
75
|
+
if (e?.importLibrary) {
|
|
76
|
+
await e.importLibrary("maps");
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (!e?.Map)
|
|
80
|
+
throw C();
|
|
81
|
+
}, H = (e) => new Promise((t, r) => {
|
|
82
|
+
e.addEventListener("load", () => t(), { once: !0 }), e.addEventListener("error", () => r(C()), { once: !0 });
|
|
83
|
+
}), K = (e) => new Promise((t, r) => {
|
|
84
|
+
const s = window;
|
|
85
|
+
s[L] = () => {
|
|
86
|
+
Reflect.deleteProperty(s, L), t();
|
|
87
|
+
};
|
|
88
|
+
const a = document.createElement("script");
|
|
89
|
+
a.async = !0, a.src = j + `?key=${encodeURIComponent(e)}&v=weekly&loading=async&libraries=maps&callback=${L}`, a.onerror = () => {
|
|
90
|
+
a.remove(), r(C());
|
|
91
|
+
}, document.head.appendChild(a);
|
|
92
|
+
}), D = (e) => {
|
|
93
|
+
if (v)
|
|
94
|
+
return v;
|
|
95
|
+
const t = document.querySelector(
|
|
96
|
+
`script[src^="${j}"]`
|
|
97
|
+
);
|
|
98
|
+
return v = (A() ? Promise.resolve() : t ? H(t) : K(e)).then(B).catch((s) => {
|
|
99
|
+
throw v = void 0, s;
|
|
100
|
+
}), v;
|
|
101
|
+
}, U = (e) => {
|
|
102
|
+
const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
103
|
+
let s, a, l = !1, p = !1;
|
|
104
|
+
const u = (c, h) => {
|
|
105
|
+
const o = h.fromLatLngToDivPixel(
|
|
106
|
+
new google.maps.LatLng(c.at[1], c.at[0])
|
|
107
|
+
);
|
|
108
|
+
o && (c.element.style.transform = `translate(${o.x}px, ${o.y}px) translate(-50%, -50%)`);
|
|
109
|
+
};
|
|
110
|
+
class x extends google.maps.OverlayView {
|
|
111
|
+
onAdd() {
|
|
112
|
+
const h = this.getPanes(), o = () => {
|
|
113
|
+
const n = document.createElement("div");
|
|
114
|
+
return n.style.cssText = "position:absolute;left:0;top:0;width:0;height:0", n;
|
|
115
|
+
};
|
|
116
|
+
s = o(), a = o();
|
|
117
|
+
for (const n of t)
|
|
118
|
+
(n.beneath ? a : s).appendChild(n.element);
|
|
119
|
+
h?.overlayMouseTarget.appendChild(s), h?.mapPane.appendChild(a);
|
|
120
|
+
}
|
|
121
|
+
draw() {
|
|
122
|
+
const h = this.getProjection();
|
|
123
|
+
if (h) {
|
|
124
|
+
for (const o of t)
|
|
125
|
+
u(o, h);
|
|
126
|
+
l || (l = !0, r.forEach((o) => o()));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
onRemove() {
|
|
130
|
+
s?.remove(), a?.remove(), s = void 0, a = void 0;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
const y = new x();
|
|
134
|
+
y.setMap(e);
|
|
135
|
+
const f = () => p ? void 0 : y.getProjection();
|
|
136
|
+
return {
|
|
137
|
+
add: (c, h, o) => {
|
|
138
|
+
const n = { element: c, at: h, beneath: o?.beneath ?? !1 };
|
|
139
|
+
t.add(n), c.style.position = "absolute", (n.beneath ? a : s)?.appendChild(c);
|
|
140
|
+
const d = f();
|
|
141
|
+
return d && u(n, d), {
|
|
142
|
+
setPosition: (i) => {
|
|
143
|
+
n.at = i;
|
|
144
|
+
const m = f();
|
|
145
|
+
m && u(n, m);
|
|
146
|
+
},
|
|
147
|
+
remove: () => {
|
|
148
|
+
t.delete(n), c.remove();
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
},
|
|
152
|
+
onReady: (c) => l ? (c(), () => {
|
|
153
|
+
}) : (r.add(c), () => r.delete(c)),
|
|
154
|
+
isReady: () => l,
|
|
155
|
+
destroy: () => {
|
|
156
|
+
p = !0, l = !1, r.clear();
|
|
157
|
+
for (const c of t)
|
|
158
|
+
c.element.remove();
|
|
159
|
+
t.clear(), y.setMap(null);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
}, M = 256, O = ([e, t]) => {
|
|
163
|
+
const r = Math.min(
|
|
164
|
+
Math.max(Math.sin(t * Math.PI / 180), -0.9999),
|
|
165
|
+
0.9999
|
|
166
|
+
);
|
|
167
|
+
return {
|
|
168
|
+
x: M * (0.5 + e / 360),
|
|
169
|
+
y: M * (0.5 - Math.log((1 + r) / (1 - r)) / (4 * Math.PI))
|
|
170
|
+
};
|
|
171
|
+
}, N = ({ x: e, y: t }) => [
|
|
172
|
+
(e / M - 0.5) * 360,
|
|
173
|
+
Math.atan(Math.sinh(Math.PI * (1 - 2 * t / M))) * 180 / Math.PI
|
|
174
|
+
], V = {
|
|
175
|
+
globeProjection: !1,
|
|
176
|
+
/**
|
|
177
|
+
* The getters report the destination in the same tick, so a flight in
|
|
178
|
+
* progress cannot be read even though the renderer glides.
|
|
179
|
+
*/
|
|
180
|
+
observableFlight: !1
|
|
181
|
+
}, I = (e) => e, w = ([e, t]) => ({ lat: t, lng: e }), q = {
|
|
182
|
+
move: "bounds_changed",
|
|
183
|
+
zoom: "zoom_changed",
|
|
184
|
+
click: "click",
|
|
185
|
+
styled: "idle"
|
|
186
|
+
}, J = (e) => {
|
|
187
|
+
const t = document.createElement("div");
|
|
188
|
+
t.style.cssText = "position:absolute;inset:0", e.container.appendChild(t);
|
|
189
|
+
const r = new google.maps.Map(t, {
|
|
190
|
+
center: w(e.center),
|
|
191
|
+
zoom: e.zoom,
|
|
192
|
+
minZoom: e.minZoom,
|
|
193
|
+
maxZoom: e.maxZoom,
|
|
194
|
+
// No `mapId` deliberately: with one, `styles` is ignored and the theme is
|
|
195
|
+
// immutable after the first render, so a light/dark swap means a teardown.
|
|
196
|
+
styles: I(e.style),
|
|
197
|
+
disableDefaultUI: !0,
|
|
198
|
+
gestureHandling: e.interactive ? e.cooperativeGestures ? "cooperative" : "greedy" : "none"
|
|
199
|
+
}), s = U(r), a = S(s), l = W(r);
|
|
200
|
+
let p = !1;
|
|
201
|
+
const u = () => r.getZoom() ?? e.zoom, x = () => {
|
|
202
|
+
const o = r.getCenter();
|
|
203
|
+
return o ? [o.lng(), o.lat()] : e.center;
|
|
204
|
+
}, y = () => p || !s.isReady() ? null : {
|
|
205
|
+
scale: 2 ** u(),
|
|
206
|
+
centre: O(x()),
|
|
207
|
+
half: { x: t.clientWidth / 2, y: t.clientHeight / 2 }
|
|
208
|
+
}, f = (o) => {
|
|
209
|
+
const n = y();
|
|
210
|
+
if (!n)
|
|
211
|
+
return null;
|
|
212
|
+
const d = O(o);
|
|
213
|
+
return {
|
|
214
|
+
x: (d.x - n.centre.x) * n.scale + n.half.x,
|
|
215
|
+
y: (d.y - n.centre.y) * n.scale + n.half.y
|
|
216
|
+
};
|
|
217
|
+
}, c = (o) => {
|
|
218
|
+
const n = y();
|
|
219
|
+
return n ? N({
|
|
220
|
+
x: n.centre.x + (o.x - n.half.x) / n.scale,
|
|
221
|
+
y: n.centre.y + (o.y - n.half.y) / n.scale
|
|
222
|
+
}) : null;
|
|
223
|
+
}, h = (o) => {
|
|
224
|
+
r.panTo(w(o.center)), o.zoom !== void 0 && r.setZoom(o.zoom);
|
|
225
|
+
};
|
|
226
|
+
return {
|
|
227
|
+
provider: "google",
|
|
228
|
+
capabilities: V,
|
|
229
|
+
native: () => r,
|
|
230
|
+
isAlive: () => !p,
|
|
231
|
+
destroy: () => {
|
|
232
|
+
p = !0, l.destroy(), a.set(null), s.destroy(), t.remove();
|
|
233
|
+
},
|
|
234
|
+
on: (o, n) => {
|
|
235
|
+
if (o === "ready")
|
|
236
|
+
return s.onReady(n);
|
|
237
|
+
if (o === "resize") {
|
|
238
|
+
const i = new ResizeObserver(() => n());
|
|
239
|
+
return i.observe(e.container), () => i.disconnect();
|
|
240
|
+
}
|
|
241
|
+
if (o === "error") {
|
|
242
|
+
const i = window, m = i.gm_authFailure;
|
|
243
|
+
return i.gm_authFailure = n, () => {
|
|
244
|
+
i.gm_authFailure = m;
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
const d = r.addListener(q[o], n);
|
|
248
|
+
return () => d.remove();
|
|
249
|
+
},
|
|
250
|
+
project: f,
|
|
251
|
+
unproject: c,
|
|
252
|
+
getZoom: u,
|
|
253
|
+
getCenter: x,
|
|
254
|
+
jumpTo: (o) => {
|
|
255
|
+
r.moveCamera({
|
|
256
|
+
center: w(o.center),
|
|
257
|
+
...o.zoom === void 0 ? {} : { zoom: o.zoom }
|
|
258
|
+
});
|
|
259
|
+
},
|
|
260
|
+
easeTo: h,
|
|
261
|
+
// No coupled pan+zoom arc exists here; the renderer glides on its own.
|
|
262
|
+
flyTo: h,
|
|
263
|
+
fitCoordinates: (o, n) => {
|
|
264
|
+
const d = new google.maps.LatLngBounds();
|
|
265
|
+
o.forEach((m) => d.extend(w(m)));
|
|
266
|
+
const i = n?.gutter ?? 0;
|
|
267
|
+
if (r.fitBounds(d, {
|
|
268
|
+
top: i,
|
|
269
|
+
right: i,
|
|
270
|
+
bottom: i,
|
|
271
|
+
left: i
|
|
272
|
+
}), n?.maxZoom !== void 0) {
|
|
273
|
+
const m = r.getZoom();
|
|
274
|
+
m !== void 0 && m > n.maxZoom && r.setZoom(n.maxZoom);
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
// Google has no `cameraForBounds`: the pixel box at the current zoom gives
|
|
278
|
+
// the scale change to fit, which is a zoom delta.
|
|
279
|
+
cameraForCoordinates: (o, n) => {
|
|
280
|
+
if (o.length === 0)
|
|
281
|
+
return null;
|
|
282
|
+
const d = o.map(f);
|
|
283
|
+
if (d.some((g) => g === null))
|
|
284
|
+
return null;
|
|
285
|
+
const i = d.map((g) => g.x), m = d.map((g) => g.y), z = c({
|
|
286
|
+
x: (Math.min(...i) + Math.max(...i)) / 2,
|
|
287
|
+
y: (Math.min(...m) + Math.max(...m)) / 2
|
|
288
|
+
});
|
|
289
|
+
if (!z)
|
|
290
|
+
return null;
|
|
291
|
+
const Z = n?.gutter ?? 0, R = Math.max(Math.max(...i) - Math.min(...i), 1), T = Math.max(Math.max(...m) - Math.min(...m), 1), k = {
|
|
292
|
+
width: Math.max(e.container.clientWidth - Z * 2, 1),
|
|
293
|
+
height: Math.max(e.container.clientHeight - Z * 2, 1)
|
|
294
|
+
}, $ = Math.min(k.width / R, k.height / T), F = Math.min(
|
|
295
|
+
u() + Math.log2($),
|
|
296
|
+
n?.maxZoom ?? 1 / 0
|
|
297
|
+
);
|
|
298
|
+
return { center: z, zoom: F };
|
|
299
|
+
},
|
|
300
|
+
addDomMarker: s.add,
|
|
301
|
+
setLines: (o, n) => l.set(o, n?.onClick),
|
|
302
|
+
setCurrentLocation: (o) => a.set(o),
|
|
303
|
+
zoomIn: () => r.setZoom(u() + 1),
|
|
304
|
+
zoomOut: () => r.setZoom(u() - 1),
|
|
305
|
+
// Google re-reads its container on its own; there is nothing to poke.
|
|
306
|
+
resize: () => {
|
|
307
|
+
},
|
|
308
|
+
applyStyle: (o) => r.setOptions({ styles: I(o) }),
|
|
309
|
+
setGlobeProjection: () => {
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
}, X = async (e) => {
|
|
313
|
+
if (!e?.apiKey)
|
|
314
|
+
throw new Error(
|
|
315
|
+
"F0Map: the google provider needs an apiKey on <F0Provider map={{ config: { apiKey } }}>."
|
|
316
|
+
);
|
|
317
|
+
return await D(e.apiKey), J;
|
|
318
|
+
};
|
|
319
|
+
export {
|
|
320
|
+
J as createGoogleAdapter,
|
|
321
|
+
X as loadGoogleAdapter
|
|
322
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
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-DvxjOp3m.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-By8Miy58.js";
|
|
5
5
|
import { F as We } from "./Printer-BD-FEi_2.js";
|
|
6
6
|
import { d as ae } from "./tooltip-CrXp1Uaz.js";
|
|
7
7
|
import './index2.css';const Oe = ({
|
|
@@ -227,7 +227,7 @@ import './index2.css';const Oe = ({
|
|
|
227
227
|
}), i;
|
|
228
228
|
};
|
|
229
229
|
Ee();
|
|
230
|
-
const Ge = J(() => import("./SheetViewer-
|
|
230
|
+
const Ge = J(() => import("./SheetViewer-CspxsxLt.js")), Ze = J(() => import("./DocxViewer-BqD75taI.js")), qe = J(() => import("./TextViewer-DIsaa4Y4.js")), oe = 48, le = ne(
|
|
231
231
|
(o, a) => {
|
|
232
232
|
const { kind: e = "pdf", mimeType: i, ...s } = o;
|
|
233
233
|
if (e === "pdf")
|
|
@@ -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 { aj as invariant } from "./F0CanvasPanel-
|
|
5
|
-
import { f as dequal } from "./MapProvider-
|
|
4
|
+
import { aj as invariant } from "./F0CanvasPanel-DvxjOp3m.js";
|
|
5
|
+
import { f as dequal } from "./MapProvider-By9Tk09N.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: {} };
|