@factorialco/f0-react 3.2.2 → 3.2.4

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.
@@ -2,8 +2,8 @@ import { h as ga, B as pa, i as ba, j as xa, k as Dt, l as Be, m as Te, n as va,
2
2
  import { c1 as Kc, c0 as qc, cd as Yc, bZ as Jc, b_ as Zc, bS as Xc, cg as Qc, bT as ed, bU as td, ch as nd, b$ as ad, c9 as rd, ca as id, ce as ld, bV as sd, c3 as od, c2 as cd, bW as dd, bX as ud, cb as fd, ci as md, cc as hd, cf as gd, c8 as pd, c5 as bd, c7 as xd, c4 as vd, bY as yd, c6 as wd } from "./F0CanvasPanel-C3fJQSVe.js";
3
3
  import { jsx as e, jsxs as o, Fragment as Z } from "react/jsx-runtime";
4
4
  import ue, { forwardRef as G, useRef as j, useTransition as ni, useState as D, useLayoutEffect as Tn, useId as pt, useContext as Pe, createContext as Qe, useEffect as W, useCallback as ne, useMemo as q, Fragment as ai, isValidElement as ri, cloneElement as zn, Children as Rn } from "react";
5
- import { C as ii, P as li, a as Bn, M as si, p as oi, b as ci, R as Mt, c as $n, u as di, d as ui, e as fi, f as mi, g as hi, h as Mn, S as gi, A as pi, B as bi, L as xi, i as vi, V as yi, j as wi, k as Ni, l as Ci, O as Ii } from "./useDataCollectionSource-Dd1Hv_zM.js";
6
- import { r as Cd, s as Id, o as kd, H as Sd, t as Fd, z as Ad, a8 as Ld, G as Od, q as Pd, aa as Ed, a9 as _d, Q as Dd, ad as Td, F as zd, Y as Rd, U as Bd, J as $d, af as Md, K as Wd, Z as jd, _ as Vd, v as Ud, ab as Hd, ac as Gd, N as Kd, $ as qd, a5 as Yd, a7 as Jd, w as Zd, y as Xd, D as Qd, W as eu, ae as tu, X as nu, T as au, ag as ru, x as iu, E as lu, m as su, n as ou, a1 as cu, a2 as du, a6 as uu, I as fu, a3 as mu, a0 as hu, a4 as gu } from "./useDataCollectionSource-Dd1Hv_zM.js";
5
+ import { C as ii, P as li, a as Bn, M as si, p as oi, b as ci, R as Mt, c as $n, u as di, d as ui, e as fi, f as mi, g as hi, h as Mn, S as gi, A as pi, B as bi, L as xi, i as vi, V as yi, j as wi, k as Ni, l as Ci, O as Ii } from "./useDataCollectionSource-DAyA5jD3.js";
6
+ import { r as Cd, s as Id, o as kd, H as Sd, t as Fd, z as Ad, a8 as Ld, G as Od, q as Pd, aa as Ed, a9 as _d, Q as Dd, ad as Td, F as zd, Y as Rd, U as Bd, J as $d, af as Md, K as Wd, Z as jd, _ as Vd, v as Ud, ab as Hd, ac as Gd, N as Kd, $ as qd, a5 as Yd, a7 as Jd, w as Zd, y as Xd, D as Qd, W as eu, ae as tu, X as nu, T as au, ag as ru, x as iu, E as lu, m as su, n as ou, a1 as cu, a2 as du, a6 as uu, I as fu, a3 as mu, a0 as hu, a4 as gu } from "./useDataCollectionSource-DAyA5jD3.js";
7
7
  const ki = ga("Search", [
8
8
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
9
9
  ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
package/dist/f0.js CHANGED
@@ -6,8 +6,8 @@ import _t, { forwardRef as Pr, useRef as fe, useImperativeHandle as _3, Children
6
6
  import { T as c2, y as S3, z as C3, B as T3, C as D3, D as f2, E as sv, G as Bx, H as d2, I as h2, J as v2, K as A3, L as M3, M as E3, N as L3, O as N3, F as I3 } from "./useChatHistory-shjDpEO2.js";
7
7
  import { A as Uge, s as Yge, t as Xge, w as qge, l as Zge, i as jge, q as Kge, x as Qge, p as Jge, r as eme, j as tme, e as rme, P as nme, g as ime, k as ame, h as ome, a as sme, n as lme, m as ume, o as cme, b as fme, f as dme, v as hme, c as vme, d as pme, u as gme } from "./useChatHistory-shjDpEO2.js";
8
8
  import { createPortal as zx, unstable_batchedUpdates as ud } from "react-dom";
9
- import { C as R3, F as k3, ah as p2, ai as P3, aj as O3, ak as B3, al as Vx, am as Fx, G as z3, an as V3, Y as F3, a8 as G3, ao as H3, Q as W3, ap as $3, aq as U3, c as $p, ar as zf, R as Gx, u as Hx, W as g2, O as Wx, as as m2, at as XS, au as $x, o as Y3, d as y2, $ as b2, av as X3, aw as q3, ax as Z3, ay as j3, az as K3, M as Q3 } from "./useDataCollectionSource-Dd1Hv_zM.js";
10
- import { r as yme, s as bme, H as _me, t as xme, z as wme, aQ as Sme, aP as Cme, aL as Tme, aB as Dme, aA as Ame, aC as Mme, aD as Eme, aa as Lme, a9 as Nme, ad as Ime, U as Rme, J as kme, af as Pme, K as Ome, v as Bme, aR as zme, ab as Vme, ac as Fme, N as Gme, w as Hme, P as Wme, y as $me, D as Ume, ae as Yme, T as Xme, ag as qme, x as Zme, E as jme, aT as Kme, m as Qme, n as Jme, aK as eye, aG as tye, aF as rye, aS as nye, a6 as iye, aI as aye, aJ as oye, I as sye, aU as lye, aV as uye, e as cye, aM as fye, aN as dye, aO as hye, aH as vye, f as pye, h as gye, aE as mye, aW as yye } from "./useDataCollectionSource-Dd1Hv_zM.js";
9
+ import { C as R3, F as k3, ah as p2, ai as P3, aj as O3, ak as B3, al as Vx, am as Fx, G as z3, an as V3, Y as F3, a8 as G3, ao as H3, Q as W3, ap as $3, aq as U3, c as $p, ar as zf, R as Gx, u as Hx, W as g2, O as Wx, as as m2, at as XS, au as $x, o as Y3, d as y2, $ as b2, av as X3, aw as q3, ax as Z3, ay as j3, az as K3, M as Q3 } from "./useDataCollectionSource-DAyA5jD3.js";
10
+ import { r as yme, s as bme, H as _me, t as xme, z as wme, aQ as Sme, aP as Cme, aL as Tme, aB as Dme, aA as Ame, aC as Mme, aD as Eme, aa as Lme, a9 as Nme, ad as Ime, U as Rme, J as kme, af as Pme, K as Ome, v as Bme, aR as zme, ab as Vme, ac as Fme, N as Gme, w as Hme, P as Wme, y as $me, D as Ume, ae as Yme, T as Xme, ag as qme, x as Zme, E as jme, aT as Kme, m as Qme, n as Jme, aK as eye, aG as tye, aF as rye, aS as nye, a6 as iye, aI as aye, aJ as oye, I as sye, aU as lye, aV as uye, e as cye, aM as fye, aN as dye, aO as hye, aH as vye, f as pye, h as gye, aE as mye, aW as yye } from "./useDataCollectionSource-DAyA5jD3.js";
11
11
  import { utils as Nl, write as _2 } from "./xlsx-Bedf3nwD.js";
12
12
  import { defaultTranslations as _ye } from "./i18n-provider-defaults.js";
13
13
  import './f0.css';const J3 = {
@@ -58498,25 +58498,26 @@ const Ace = (r) => ie(
58498
58498
  className: t,
58499
58499
  children: n,
58500
58500
  container: i,
58501
- ...a
58502
- }, o) => {
58503
- const [s, l] = ce(), u = fe(null), c = le(() => {
58504
- u.current && T3(
58505
- u.current,
58501
+ defaultContainerId: a = "content",
58502
+ ...o
58503
+ }, s) => {
58504
+ const [l, u] = ce(), c = fe(null), f = le(() => {
58505
+ c.current && T3(
58506
+ c.current,
58506
58507
  { x: [-15, 15, -10, 10, 0] },
58507
58508
  { duration: 0.3, ease: "easeInOut" }
58508
58509
  );
58509
- }, [u.current]);
58510
+ }, [c.current]);
58510
58511
  ge(() => {
58511
- l(i !== void 0 ? i : document.getElementById("content") ?? document.body);
58512
- }, [i]);
58513
- const f = VF();
58514
- return s === void 0 ? null : /* @__PURE__ */ z(pG, { container: s, children: [
58515
- f.showOverlay && /* @__PURE__ */ S(FF, {}),
58512
+ u(i !== void 0 ? i : document.getElementById(a) ?? document.getElementById("content") ?? document.body);
58513
+ }, [i, a]);
58514
+ const d = VF();
58515
+ return l === void 0 ? null : /* @__PURE__ */ z(pG, { container: l, children: [
58516
+ d.showOverlay && /* @__PURE__ */ S(FF, {}),
58516
58517
  /* @__PURE__ */ S(
58517
58518
  UI,
58518
58519
  {
58519
- ref: o,
58520
+ ref: s,
58520
58521
  className: ie(
58521
58522
  "fixed inset-0 z-50 flex items-center justify-center overflow-hidden",
58522
58523
  "data-[state=open]:animate-in data-[state=closed]:animate-out",
@@ -58528,28 +58529,28 @@ const Ace = (r) => ie(
58528
58529
  style: {
58529
58530
  transition: "all 2s 100ms !important"
58530
58531
  },
58531
- ...a,
58532
- onClick: (d) => {
58533
- if (a.onPointerDownOutside) {
58534
- const h = new CustomEvent("pointerdownoutside", {
58535
- detail: { originalEvent: d.nativeEvent }
58532
+ ...o,
58533
+ onClick: (h) => {
58534
+ if (o.onPointerDownOutside) {
58535
+ const v = new CustomEvent("pointerdownoutside", {
58536
+ detail: { originalEvent: h.nativeEvent }
58536
58537
  });
58537
- a.onPointerDownOutside(h);
58538
+ o.onPointerDownOutside(v);
58538
58539
  }
58539
- f.modal && c(), d.preventDefault(), d.stopPropagation();
58540
+ d.modal && f(), h.preventDefault(), h.stopPropagation();
58540
58541
  },
58541
58542
  children: /* @__PURE__ */ S(
58542
58543
  "div",
58543
58544
  {
58544
- ref: u,
58545
+ ref: c,
58545
58546
  className: ie(
58546
58547
  "relative flex w-[90%] flex-col rounded-xl bg-f1-background shadow-lg pointer-events-auto",
58547
58548
  "group-data-[state=open]/dialog:animate-in group-data-[state=closed]/dialog:animate-out overflow-hidden",
58548
58549
  Ace(e),
58549
58550
  t
58550
58551
  ),
58551
- onClick: (d) => {
58552
- d.preventDefault(), d.stopPropagation();
58552
+ onClick: (h) => {
58553
+ h.preventDefault(), h.stopPropagation();
58553
58554
  },
58554
58555
  children: n
58555
58556
  }
@@ -58596,24 +58597,25 @@ const Mce = () => gG("(max-width: 560px)", {
58596
58597
  modal: a = !1,
58597
58598
  showOverlay: o = !0,
58598
58599
  size: s = "md",
58599
- fullHeight: l = !1
58600
+ fullHeight: l = !1,
58601
+ container: u
58600
58602
  }) => {
58601
- const [u, c] = ce(null), f = le((b) => {
58602
- c(b);
58603
- }, []), d = Mce(), h = le(
58604
- (b) => {
58605
- e?.(b);
58603
+ const [c, f] = ce(null), d = le((w) => {
58604
+ f(w);
58605
+ }, []), h = Mce(), v = le(
58606
+ (w) => {
58607
+ e?.(w);
58606
58608
  },
58607
58609
  [e]
58608
- ), v = fe(void 0);
58610
+ ), p = fe(void 0);
58609
58611
  ge(() => {
58610
- v.current === !0 && !r && t(), v.current = r;
58612
+ p.current === !0 && !r && t(), p.current = r;
58611
58613
  }, [r, t]);
58612
- const p = se(() => n === "left" || n === "right", [n]), g = se(() => p ? "sm" : (s && n !== "center" && console.warn(
58614
+ const g = se(() => n === "left" || n === "right", [n]), m = se(() => g ? "sm" : (s && n !== "center" && console.warn(
58613
58615
  "F0Dialog: `size` prop is only applicable to center position"
58614
- ), s), [p, s, n]), m = (b) => {
58615
- a && b.preventDefault();
58616
- }, y = {
58616
+ ), s), [g, s, n]), y = (w) => {
58617
+ a && w.preventDefault();
58618
+ }, b = {
58617
58619
  left: "slideRight",
58618
58620
  right: "slideLeft",
58619
58621
  center: "zoom"
@@ -58624,9 +58626,9 @@ const Mce = () => gG("(max-width: 560px)", {
58624
58626
  isOpen: r,
58625
58627
  onClose: t,
58626
58628
  position: n,
58627
- portalContainer: u ?? null,
58629
+ portalContainer: c ?? null,
58628
58630
  shownBottomSheet: !0,
58629
- children: d ? /* @__PURE__ */ z(mG, { open: r, onOpenChange: h, children: [
58631
+ children: h ? /* @__PURE__ */ z(mG, { open: r, onOpenChange: v, children: [
58630
58632
  /* @__PURE__ */ S(
58631
58633
  yG,
58632
58634
  {
@@ -58636,7 +58638,7 @@ const Mce = () => gG("(max-width: 560px)", {
58636
58638
  /* @__PURE__ */ S(
58637
58639
  bG,
58638
58640
  {
58639
- ref: f,
58641
+ ref: d,
58640
58642
  className: "max-h-full bg-f1-background",
58641
58643
  children: i
58642
58644
  }
@@ -58647,23 +58649,25 @@ const Mce = () => gG("(max-width: 560px)", {
58647
58649
  Dce,
58648
58650
  {
58649
58651
  open: r,
58650
- onOpenChange: h,
58652
+ onOpenChange: v,
58651
58653
  modal: a,
58652
58654
  showOverlay: o,
58653
58655
  children: /* @__PURE__ */ S(
58654
58656
  GF,
58655
58657
  {
58656
- ref: f,
58658
+ ref: d,
58659
+ container: u,
58660
+ defaultContainerId: n === "center" ? "f0-overlay-root" : "content",
58657
58661
  wrapperClassName: Ece({ position: n }),
58658
58662
  className: ie(
58659
- Lce({ size: g }),
58663
+ Lce({ size: m }),
58660
58664
  l && "h-full"
58661
58665
  ),
58662
- animation: y[n],
58663
- onOpenAutoFocus: (b) => b.preventDefault(),
58664
- onEscapeKeyDown: m,
58665
- onPointerDownOutside: m,
58666
- onInteractOutside: m,
58666
+ animation: b[n],
58667
+ onOpenAutoFocus: (w) => w.preventDefault(),
58668
+ onEscapeKeyDown: y,
58669
+ onPointerDownOutside: y,
58670
+ onInteractOutside: y,
58667
58671
  children: i
58668
58672
  }
58669
58673
  )
@@ -58689,13 +58693,14 @@ const Mce = () => gG("(max-width: 560px)", {
58689
58693
  modal: h = !1,
58690
58694
  activeTabId: v,
58691
58695
  setActiveTabId: p,
58692
- disableContentPadding: g
58696
+ disableContentPadding: g,
58697
+ container: m
58693
58698
  }) => {
58694
- const [m, y] = ce(t);
58699
+ const [y, b] = ce(t);
58695
58700
  ge(() => {
58696
- y(t);
58701
+ b(t);
58697
58702
  }, [t]);
58698
- const b = se(() => /* @__PURE__ */ z(st, { children: [
58703
+ const _ = se(() => /* @__PURE__ */ z(st, { children: [
58699
58704
  /* @__PURE__ */ S(
58700
58705
  BF,
58701
58706
  {
@@ -58715,7 +58720,7 @@ const Mce = () => gG("(max-width: 560px)", {
58715
58720
  {
58716
58721
  primaryAction: o ?? [],
58717
58722
  secondaryAction: s ?? [],
58718
- onClose: () => y(!1)
58723
+ onClose: () => b(!1)
58719
58724
  }
58720
58725
  )
58721
58726
  ] }), [
@@ -58735,15 +58740,16 @@ const Mce = () => gG("(max-width: 560px)", {
58735
58740
  return /* @__PURE__ */ S(
58736
58741
  HF,
58737
58742
  {
58738
- isOpen: m,
58743
+ isOpen: y,
58739
58744
  onClose: e,
58740
58745
  position: i,
58741
58746
  size: a,
58742
58747
  modal: h,
58743
58748
  showOverlay: h,
58744
58749
  fullHeight: !0,
58745
- onOpenChange: y,
58746
- children: b
58750
+ onOpenChange: b,
58751
+ container: m,
58752
+ children: _
58747
58753
  }
58748
58754
  );
58749
58755
  }, Nce = IF, $F = (r) => {
@@ -58995,13 +59001,14 @@ const SS = ({
58995
59001
  setActiveTabId: v,
58996
59002
  disableContentPadding: p,
58997
59003
  variant: g = "default",
58998
- type: m = "default"
59004
+ type: m = "default",
59005
+ container: y
58999
59006
  }) => {
59000
- const [y, b] = ce(t);
59007
+ const [b, _] = ce(t);
59001
59008
  ge(() => {
59002
- b(t);
59009
+ _(t);
59003
59010
  }, [t]);
59004
- const _ = se(() => /* @__PURE__ */ z(st, { children: [
59011
+ const w = se(() => /* @__PURE__ */ z(st, { children: [
59005
59012
  g !== "notification" && /* @__PURE__ */ S(
59006
59013
  BF,
59007
59014
  {
@@ -59023,7 +59030,7 @@ const SS = ({
59023
59030
  secondaryAction: o ?? [],
59024
59031
  variant: g,
59025
59032
  type: m,
59026
- onClose: () => b(!1)
59033
+ onClose: () => _(!1)
59027
59034
  }
59028
59035
  )
59029
59036
  ] }), [
@@ -59045,13 +59052,14 @@ const SS = ({
59045
59052
  return /* @__PURE__ */ S(
59046
59053
  HF,
59047
59054
  {
59048
- isOpen: y,
59055
+ isOpen: b,
59049
59056
  onClose: e,
59050
59057
  position: "center",
59051
59058
  size: i,
59052
59059
  modal: d,
59053
- onOpenChange: b,
59054
- children: _
59060
+ onOpenChange: _,
59061
+ container: y,
59062
+ children: w
59055
59063
  }
59056
59064
  );
59057
59065
  }, Oce = IF, YF = (r) => {
@@ -67902,7 +67910,7 @@ const Nh = /* @__PURE__ */ new Set(), Cx = /* @__PURE__ */ new Set(), U0 = () =>
67902
67910
  const t = fe(null), [n, i] = ce(t.current);
67903
67911
  return b3(() => {
67904
67912
  i(t.current);
67905
- }, []), /* @__PURE__ */ S(uve.Provider, { value: { element: n }, children: /* @__PURE__ */ S(
67913
+ }, []), /* @__PURE__ */ S(uve.Provider, { value: { element: n }, children: /* @__PURE__ */ z(
67906
67914
  "div",
67907
67915
  {
67908
67916
  ref: t,
@@ -67910,7 +67918,10 @@ const Nh = /* @__PURE__ */ new Set(), Cx = /* @__PURE__ */ new Set(), U0 = () =>
67910
67918
  className: ie({
67911
67919
  "flex h-screen w-screen flex-col bg-[#F5F6F8] dark:bg-[#0D1625]": e
67912
67920
  }),
67913
- children: r
67921
+ children: [
67922
+ r,
67923
+ /* @__PURE__ */ S("div", { id: "f0-overlay-root", className: "contents" })
67924
+ ]
67914
67925
  }
67915
67926
  ) });
67916
67927
  }, fve = ({