@factorialco/f0-react 8.28.4 → 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.
Files changed (30) hide show
  1. package/dist/{ChatPdfThumbnail-QKm8T1iP.js → ChatPdfThumbnail-Dj7xNA9A.js} +1 -1
  2. package/dist/{ChatPostComposerDialog-DF5B8NLo.js → ChatPostComposerDialog-BX6memv2.js} +3 -3
  3. package/dist/{DocumentToolbar-BAa5mh7x.js → DocumentToolbar-kzj-lnsk.js} +2 -2
  4. package/dist/{DocxViewer-CYBh46FI.js → DocxViewer-Dbi2Iu1v.js} +2 -2
  5. package/dist/{F0AiProcessingOverlay-3H79lgMd.js → F0AiProcessingOverlay-B0cBiNJx.js} +1 -1
  6. package/dist/{F0CanvasPanel-DAEeI3lV.js → F0CanvasPanel-CruNufKc.js} +18 -18
  7. package/dist/{F0Map-B7PwCmUl.js → F0Map-vyJ9l9av.js} +1266 -1134
  8. package/dist/{F0VideoPlayer-CNvEtJ9U.js → F0VideoPlayer-B4Tyl9fv.js} +2 -2
  9. package/dist/{MapProvider-WM9ZFI_s.js → MapProvider-DpAl-lEe.js} +2 -2
  10. package/dist/{SheetViewer-CvQ24W5k.js → SheetViewer-Q6MZNxhH.js} +3 -3
  11. package/dist/{TextViewer-uZnjAB6W.js → TextViewer-CUzoNSgl.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-yqG2fG7V.js} +7 -7
  17. package/dist/experimental.d.ts +35 -10
  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-Bigrthbl.js +4 -0
  23. package/dist/{index-BuHr35P1.js → index-CHdKPPbt.js} +15 -15
  24. package/dist/{index-Ck8-Kqxo.js → index-CJqhKIrf.js} +195 -145
  25. package/dist/index-D86jd9Uj.js +358 -0
  26. package/dist/{index-B1tQWotf.js → index-DIiH9OpT.js} +3 -3
  27. package/dist/{pdfWorker-C8Mu95m3.js → pdfWorker-C1_PScVO.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
@@ -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, z as Ce, u as X, A as Te, x 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-DAEeI3lV.js";
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-C8Mu95m3.js";
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 = ({
@@ -238,7 +238,7 @@ import './index2.css';const Ge = ({
238
238
  }), i;
239
239
  };
240
240
  ze();
241
- const ot = Y(() => import("./SheetViewer-CvQ24W5k.js")), nt = Y(() => import("./DocxViewer-CYBh46FI.js")), rt = Y(() => import("./TextViewer-uZnjAB6W.js")), se = 48, at = 150, ue = ce((e, t) => {
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 });
@@ -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 { al as invariant } from "./F0CanvasPanel-DAEeI3lV.js";
5
- import { f as dequal } from "./MapProvider-WM9ZFI_s.js";
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: {} };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factorialco/f0-react",
3
- "version": "8.28.4",
3
+ "version": "8.29.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/factorialco/f0.git",