@factorialco/f0-react 8.28.4 → 8.29.1

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.
Files changed (30) hide show
  1. package/dist/{ChatPdfThumbnail-QKm8T1iP.js → ChatPdfThumbnail--HnCaaQC.js} +1 -1
  2. package/dist/{ChatPostComposerDialog-DF5B8NLo.js → ChatPostComposerDialog-C5JzmnKq.js} +3 -3
  3. package/dist/{DocumentToolbar-BAa5mh7x.js → DocumentToolbar-CtautqpV.js} +2 -2
  4. package/dist/{DocxViewer-CYBh46FI.js → DocxViewer-DyU-P-1j.js} +2 -2
  5. package/dist/{F0AiProcessingOverlay-3H79lgMd.js → F0AiProcessingOverlay-ClRdyNTM.js} +1 -1
  6. package/dist/{F0CanvasPanel-DAEeI3lV.js → F0CanvasPanel-CLTvOws3.js} +1836 -1812
  7. package/dist/{F0Map-B7PwCmUl.js → F0Map-Ba9xJQAg.js} +1266 -1134
  8. package/dist/{F0VideoPlayer-CNvEtJ9U.js → F0VideoPlayer-qELgTiVB.js} +2 -2
  9. package/dist/{MapProvider-WM9ZFI_s.js → MapProvider-BW5mMnwW.js} +2 -2
  10. package/dist/{SheetViewer-CvQ24W5k.js → SheetViewer-B4kQl9ga.js} +3 -3
  11. package/dist/{TextViewer-uZnjAB6W.js → TextViewer-BWQP1d3n.js} +2 -2
  12. package/dist/ai.d.ts +6 -6
  13. package/dist/ai.js +2 -2
  14. package/dist/component-status.d.ts +6 -6
  15. package/dist/component-status.js +1 -1
  16. package/dist/{experimental-Bzwkrec6.js → experimental-CsZkmz04.js} +7 -7
  17. package/dist/experimental.d.ts +37 -11
  18. package/dist/experimental.js +18 -17
  19. package/dist/f0.d.ts +6 -6
  20. package/dist/f0.js +10 -10
  21. package/dist/i18n-provider-defaults.d.ts +6 -6
  22. package/dist/{index-Ck8-Kqxo.js → index-Brm1jjpr.js} +195 -145
  23. package/dist/index-CAvvLGxX.js +4 -0
  24. package/dist/index-CiB_exG2.js +358 -0
  25. package/dist/{index-BuHr35P1.js → index-D4gasE7u.js} +15 -15
  26. package/dist/{index-B1tQWotf.js → index-fsK8SRpw.js} +3 -3
  27. package/dist/{pdfWorker-C8Mu95m3.js → pdfWorker-DL7XjnXc.js} +2 -2
  28. package/package.json +1 -1
  29. package/dist/index-98s6Ae16.js +0 -322
  30. package/dist/index-D4H-LP6r.js +0 -4
@@ -1,322 +0,0 @@
1
- import { o as E } from "./F0CanvasPanel-DAEeI3lV.js";
2
- const P = 5.3, G = 11 - P, S = (e) => {
3
- let t, n;
4
- return {
5
- set: (s) => {
6
- if (!s) {
7
- n?.remove(), n = 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(";"), n = e.add(t, s, { beneath: !0 });
19
- return;
20
- }
21
- n?.setPosition(s);
22
- }
23
- };
24
- }, _ = (e) => e.map(([t, n]) => ({ lat: n, 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 n = () => {
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
- n(), 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: n
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, n) => {
82
- e.addEventListener("load", () => t(), { once: !0 }), e.addEventListener("error", () => n(C()), { once: !0 });
83
- }), K = (e) => new Promise((t, n) => {
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(), n(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(), n = /* @__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 r = document.createElement("div");
114
- return r.style.cssText = "position:absolute;left:0;top:0;width:0;height:0", r;
115
- };
116
- s = o(), a = o();
117
- for (const r of t)
118
- (r.beneath ? a : s).appendChild(r.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, n.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 r = { element: c, at: h, beneath: o?.beneath ?? !1 };
139
- t.add(r), c.style.position = "absolute", (r.beneath ? a : s)?.appendChild(c);
140
- const d = f();
141
- return d && u(r, d), {
142
- setPosition: (i) => {
143
- r.at = i;
144
- const m = f();
145
- m && u(r, m);
146
- },
147
- remove: () => {
148
- t.delete(r), c.remove();
149
- }
150
- };
151
- },
152
- onReady: (c) => l ? (c(), () => {
153
- }) : (n.add(c), () => n.delete(c)),
154
- isReady: () => l,
155
- destroy: () => {
156
- p = !0, l = !1, n.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 n = 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 + n) / (1 - n)) / (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 n = 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(n), a = S(s), l = W(n);
200
- let p = !1;
201
- const u = () => n.getZoom() ?? e.zoom, x = () => {
202
- const o = n.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 r = y();
210
- if (!r)
211
- return null;
212
- const d = O(o);
213
- return {
214
- x: (d.x - r.centre.x) * r.scale + r.half.x,
215
- y: (d.y - r.centre.y) * r.scale + r.half.y
216
- };
217
- }, c = (o) => {
218
- const r = y();
219
- return r ? N({
220
- x: r.centre.x + (o.x - r.half.x) / r.scale,
221
- y: r.centre.y + (o.y - r.half.y) / r.scale
222
- }) : null;
223
- }, h = (o) => {
224
- n.panTo(w(o.center)), o.zoom !== void 0 && n.setZoom(o.zoom);
225
- };
226
- return {
227
- provider: "google",
228
- capabilities: V,
229
- native: () => n,
230
- isAlive: () => !p,
231
- destroy: () => {
232
- p = !0, l.destroy(), a.set(null), s.destroy(), t.remove();
233
- },
234
- on: (o, r) => {
235
- if (o === "ready")
236
- return s.onReady(r);
237
- if (o === "resize") {
238
- const i = new ResizeObserver(() => r());
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 = r, () => {
244
- i.gm_authFailure = m;
245
- };
246
- }
247
- const d = n.addListener(q[o], r);
248
- return () => d.remove();
249
- },
250
- project: f,
251
- unproject: c,
252
- getZoom: u,
253
- getCenter: x,
254
- jumpTo: (o) => {
255
- n.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, r) => {
264
- const d = new google.maps.LatLngBounds();
265
- o.forEach((m) => d.extend(w(m)));
266
- const i = r?.gutter ?? 0;
267
- if (n.fitBounds(d, {
268
- top: i,
269
- right: i,
270
- bottom: i,
271
- left: i
272
- }), r?.maxZoom !== void 0) {
273
- const m = n.getZoom();
274
- m !== void 0 && m > r.maxZoom && n.setZoom(r.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, r) => {
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 = r?.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
- r?.maxZoom ?? 1 / 0
297
- );
298
- return { center: z, zoom: F };
299
- },
300
- addDomMarker: s.add,
301
- setLines: (o, r) => l.set(o, r?.onClick),
302
- setCurrentLocation: (o) => a.set(o),
303
- zoomIn: () => n.setZoom(u() + 1),
304
- zoomOut: () => n.setZoom(u() - 1),
305
- // Google re-reads its container on its own; there is nothing to poke.
306
- resize: () => {
307
- },
308
- applyStyle: (o) => n.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,4 +0,0 @@
1
- import { F as r } from "./F0VideoPlayer-CNvEtJ9U.js";
2
- export {
3
- r as F0VideoPlayer
4
- };