@factorialco/f0-react 14.9.2 → 14.9.3

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.
@@ -4,7 +4,7 @@ import { useCallback as i, useEffect as a, useRef as o, useState as s } from "re
4
4
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
5
5
  //#region \0virtual:f0-component-status-data
6
6
  var u = {
7
- generatedAt: "2026-11-12T20:19:51.076Z",
7
+ generatedAt: "2026-11-12T21:45:06.818Z",
8
8
  stats: {
9
9
  total: 314,
10
10
  byStatus: {
@@ -14684,46 +14684,46 @@ var FO = ({ item: e, active: t }) => {
14684
14684
  className: B("group/item flex items-center rounded", s ? "bg-f1-background-secondary" : "hover:bg-f1-background-secondary"),
14685
14685
  children: [c, /* @__PURE__ */ Q(IO, { pin: a })]
14686
14686
  }) : c;
14687
- }, RO = ({ item: e, tooltip: t, dragConstraints: n, onRemove: r, index: i, total: a, onMove: o, onReorderFinish: s, isSortable: c = !0 }) => {
14688
- let l = ql() === "two-level", u = R(), { isDragging: d, setIsDragging: f, draggedItemId: p, setDraggedItemId: m } = PO(), { isActive: h } = Rn(), g = h(e.href, { exact: e.exactMatch }), _ = Y(!1), [v, y] = X(!1), b = i === 0, x = i === a - 1, S = a === 1, C = J(function() {
14687
+ }, RO = ({ item: e, tooltip: t, onRemove: n, index: r, total: i, onMove: a, onReorderFinish: o, isSortable: s = !0 }) => {
14688
+ let c = ql() === "two-level", l = R(), { isDragging: u, setIsDragging: d, draggedItemId: f, setDraggedItemId: p } = PO(), { isActive: m } = Rn(), h = m(e.href, { exact: e.exactMatch }), g = Y(!1), [_, v] = X(!1), y = r === 0, b = r === i - 1, x = i === 1, S = J(function() {
14689
14689
  let t = [];
14690
- return !S && !b && t.push({
14691
- label: u.actions.moveUp,
14692
- onClick: () => o?.(i, i - 1),
14690
+ return !x && !y && t.push({
14691
+ label: l.actions.moveUp,
14692
+ onClick: () => a?.(r, r - 1),
14693
14693
  icon: ci
14694
- }), !S && !x && t.push({
14695
- label: u.actions.moveDown,
14696
- onClick: () => o?.(i, i + 1),
14694
+ }), !x && !b && t.push({
14695
+ label: l.actions.moveDown,
14696
+ onClick: () => a?.(r, r + 1),
14697
14697
  icon: Ja
14698
14698
  }), t.length > 0 && t.push({ type: "separator" }), t.push({
14699
- label: u.favorites.remove,
14700
- onClick: () => r?.(e),
14699
+ label: l.favorites.remove,
14700
+ onClick: () => n?.(e),
14701
14701
  icon: xi,
14702
14702
  critical: !0
14703
14703
  }), t;
14704
14704
  }, [
14705
- S,
14706
- b,
14707
14705
  x,
14708
- u,
14709
- o,
14710
- i,
14706
+ y,
14707
+ b,
14708
+ l,
14709
+ a,
14711
14710
  r,
14711
+ n,
14712
14712
  e
14713
- ]), w = () => {
14714
- f(!0), y(!1), m(e.href || null), _.current = !0;
14715
- }, T = () => {
14716
- f(!1), m(null), s(), setTimeout(() => {
14717
- _.current = !1;
14713
+ ]), C = () => {
14714
+ d(!0), v(!1), p(e.href || null), g.current = !0;
14715
+ }, w = () => {
14716
+ d(!1), p(null), o(), setTimeout(() => {
14717
+ g.current = !1;
14718
14718
  }, 0);
14719
- }, E = d && p === e.href, D = J(function() {
14720
- return B("group relative cursor-pointer select-none list-none rounded backdrop-blur-sm active:cursor-grabbing", c && "touch-none", g ? "bg-f1-background-secondary text-f1-foreground" : "hover:bg-f1-background-secondary", v && "bg-f1-background-secondary", E && "bg-f1-background-secondary");
14719
+ }, T = u && f === e.href, E = J(function() {
14720
+ return B("group relative cursor-pointer select-none list-none rounded backdrop-blur-sm active:cursor-grabbing", s && "touch-none", h ? "bg-f1-background-secondary text-f1-foreground" : "hover:bg-f1-background-secondary", _ && "bg-f1-background-secondary", T && "bg-f1-background-secondary");
14721
14721
  }, [
14722
- g,
14723
- v,
14724
- E,
14725
- c
14726
- ]), O = J(function() {
14722
+ h,
14723
+ _,
14724
+ T,
14725
+ s
14726
+ ]), D = J(function() {
14727
14727
  return /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q("div", {
14728
14728
  className: "flex w-full items-center justify-between px-1.5 py-1.5",
14729
14729
  children: /* @__PURE__ */ Q(HO, {
@@ -14732,12 +14732,12 @@ var FO = ({ item: e, active: t }) => {
14732
14732
  onClick: e.onClick,
14733
14733
  href: e.href,
14734
14734
  exactMatch: e.exactMatch,
14735
- className: B("flex w-[calc(100%-24px-2px)] items-center gap-1.5 no-underline", E && "pointer-events-none"),
14735
+ className: B("flex w-[calc(100%-24px-2px)] items-center gap-1.5 no-underline", T && "pointer-events-none"),
14736
14736
  draggable: !1,
14737
14737
  children: [e.type === "icon" ? /* @__PURE__ */ Q(W, {
14738
14738
  icon: e.icon,
14739
14739
  size: "md",
14740
- className: B(!l && "transition-colors", g ? "text-f1-icon-bold" : "text-f1-icon")
14740
+ className: B(!c && "transition-colors", h ? "text-f1-icon-bold" : "text-f1-icon")
14741
14741
  }) : e.avatar ? /* @__PURE__ */ Q(As, {
14742
14742
  size: "xs",
14743
14743
  avatar: e.avatar
@@ -14751,11 +14751,11 @@ var FO = ({ item: e, active: t }) => {
14751
14751
  })
14752
14752
  })
14753
14753
  }), /* @__PURE__ */ Q("div", {
14754
- className: B("absolute inset-y-1 right-1 z-10 flex h-6 w-6 items-center justify-center rounded-sm opacity-0 transition-opacity duration-100 hover:bg-f1-background-secondary group-hover:opacity-100", v && "bg-f1-background-secondary opacity-100", E && "opacity-100"),
14754
+ className: B("absolute inset-y-1 right-1 z-10 flex h-6 w-6 items-center justify-center rounded-sm opacity-0 transition-opacity duration-100 hover:bg-f1-background-secondary group-hover:opacity-100", _ && "bg-f1-background-secondary opacity-100", T && "opacity-100"),
14755
14755
  children: /* @__PURE__ */ Q($a, {
14756
- open: v,
14757
- onOpenChange: y,
14758
- items: C,
14756
+ open: _,
14757
+ onOpenChange: v,
14758
+ items: S,
14759
14759
  children: /* @__PURE__ */ Q("div", {
14760
14760
  className: "flex items-center justify-center",
14761
14761
  role: "list",
@@ -14768,56 +14768,52 @@ var FO = ({ item: e, active: t }) => {
14768
14768
  })] });
14769
14769
  }, [
14770
14770
  e,
14771
- g,
14772
- l,
14773
- v,
14774
- E,
14775
- C,
14771
+ h,
14772
+ c,
14773
+ _,
14774
+ T,
14775
+ S,
14776
14776
  t
14777
14777
  ]);
14778
- return c ? /* @__PURE__ */ Q(hn, {
14778
+ return s ? /* @__PURE__ */ Q(hn, {
14779
14779
  value: e,
14780
14780
  drag: "y",
14781
- dragConstraints: n,
14782
- dragElastic: .1,
14783
- onDragStart: w,
14784
- onDragEnd: T,
14785
- className: D,
14781
+ onDragStart: C,
14782
+ onDragEnd: w,
14783
+ className: E,
14786
14784
  whileDrag: { scale: 1.05 },
14787
- children: O
14785
+ children: D
14788
14786
  }) : /* @__PURE__ */ Q("div", {
14789
- className: D,
14790
- children: O
14791
- });
14792
- }, zO = ({ category: e, isSortable: t = !1, dragConstraints: n, onCollapse: r, onDragEnd: i, currentOrder: a }) => {
14793
- let o = ql() === "two-level", { isDragging: s, setIsDragging: c } = PO(), l = Y(!1), u = dn(), d = () => {
14794
- c(!0), l.current = !0;
14795
- }, f = () => {
14796
- c(!1), setTimeout(() => {
14797
- l.current = !1, a && i?.(a);
14787
+ className: E,
14788
+ children: D
14789
+ });
14790
+ }, zO = ({ category: e, isSortable: t = !1, onCollapse: n, onDragEnd: r, currentOrder: i }) => {
14791
+ let a = ql() === "two-level", { isDragging: o, setIsDragging: s } = PO(), c = Y(!1), l = dn(), u = () => {
14792
+ s(!0), c.current = !0;
14793
+ }, d = () => {
14794
+ s(!1), setTimeout(() => {
14795
+ c.current = !1, i && r?.(i);
14798
14796
  }, 0);
14799
- }, p = /* @__PURE__ */ Q(gE, {
14797
+ }, f = /* @__PURE__ */ Q(gE, {
14800
14798
  title: e.title,
14801
14799
  isOpen: e.isOpen,
14802
14800
  isRoot: e.isRoot,
14803
14801
  onCollapse: (t) => {
14804
- !s && !l.current && r?.(e, t);
14802
+ !o && !c.current && n?.(e, t);
14805
14803
  },
14806
- isDragging: s,
14807
- wasDragging: l,
14804
+ isDragging: o,
14805
+ wasDragging: c,
14808
14806
  children: /* @__PURE__ */ Q("div", {
14809
- className: B("flex flex-col gap-0.5", s && !l.current && "pointer-events-none"),
14807
+ className: B("flex flex-col gap-0.5", o && !c.current && "pointer-events-none"),
14810
14808
  children: e.items.map((e) => /* @__PURE__ */ Q(LO, { item: e }, `${e.href ?? ""}|${e.label}`))
14811
14809
  })
14812
14810
  });
14813
14811
  return t ? /* @__PURE__ */ Q(hn, {
14814
14812
  id: e.id,
14815
14813
  value: e,
14816
- dragConstraints: n,
14817
- dragElastic: .1,
14818
- dragControls: u,
14819
- onDragStart: d,
14820
- onDragEnd: f,
14814
+ dragControls: l,
14815
+ onDragStart: u,
14816
+ onDragEnd: d,
14821
14817
  layout: !0,
14822
14818
  layoutId: `category-${e.id}`,
14823
14819
  initial: { opacity: 1 },
@@ -14848,7 +14844,7 @@ var FO = ({ item: e, active: t }) => {
14848
14844
  1.275
14849
14845
  ]
14850
14846
  },
14851
- layout: s || !o ? {
14847
+ layout: o || !a ? {
14852
14848
  type: "spring",
14853
14849
  bounce: .1,
14854
14850
  damping: 15
@@ -14861,8 +14857,8 @@ var FO = ({ item: e, active: t }) => {
14861
14857
  backdropFilter: "blur(4px)"
14862
14858
  },
14863
14859
  className: "relative",
14864
- children: p
14865
- }) : p;
14860
+ children: f
14861
+ }) : f;
14866
14862
  };
14867
14863
  function BO({ tree: e, onCollapse: t, onSort: n, onFavoritesChange: r, favorites: i }) {
14868
14864
  let a = Y(null), o = e.filter((e) => e.isSortable === !1), s = J(function() {
@@ -14892,69 +14888,67 @@ function BO({ tree: e, onCollapse: t, onSort: n, onFavoritesChange: r, favorites
14892
14888
  }) });
14893
14889
  }
14894
14890
  function VO({ nonSortableItems: e, sortableItems: t, setSortableItems: n, containerRef: r, onCollapse: i, onDragEnd: a, favorites: o = [], onFavoritesChange: s, forceUpdate: c, disableDragging: l = !1 }) {
14895
- let u = R(), { isDragging: d } = PO(), f = e.some((e) => e.isRoot), p = e.filter((e) => !e.isRoot).length > 0, m = t.length > 0, h = Y(null), [g, _] = X(o), v = o.length > 0;
14891
+ let u = R(), { isDragging: d } = PO(), f = e.some((e) => e.isRoot), p = e.filter((e) => !e.isRoot).length > 0, m = t.length > 0, [h, g] = X(o), _ = o.length > 0;
14896
14892
  K(function() {
14897
- JSON.stringify(o) !== JSON.stringify(g) && _(o);
14893
+ JSON.stringify(o) !== JSON.stringify(h) && g(o);
14898
14894
  }, [o]);
14899
- let y = (e) => {
14900
- _(e);
14901
- }, b = G(function(e) {
14902
- let t = g.filter((t) => t.href !== e.href);
14903
- _(t), s?.(t);
14904
- }, [g, s]), x = G(function(e, t) {
14905
- if (t < 0 || t >= g.length) return;
14906
- let n = [...g], [r] = n.splice(e, 1);
14907
- n.splice(t, 0, r), _(n), s?.(n);
14908
- }, [g, s]), [S, C] = X(!1), w = Y(null);
14895
+ let v = (e) => {
14896
+ g(e);
14897
+ }, y = G(function(e) {
14898
+ let t = h.filter((t) => t.href !== e.href);
14899
+ g(t), s?.(t);
14900
+ }, [h, s]), b = G(function(e, t) {
14901
+ if (t < 0 || t >= h.length) return;
14902
+ let n = [...h], [r] = n.splice(e, 1);
14903
+ n.splice(t, 0, r), g(n), s?.(n);
14904
+ }, [h, s]), [x, S] = X(!1), C = Y(null);
14909
14905
  K(function() {
14910
- t.length > 0 && !S && (n([...t]), C(!0));
14906
+ t.length > 0 && !x && (n([...t]), S(!0));
14911
14907
  }, [
14912
14908
  t,
14913
14909
  n,
14914
- S
14910
+ x
14915
14911
  ]), K(function() {
14916
14912
  let e = () => {
14917
- w.current !== null && window.clearTimeout(w.current), w.current = window.setTimeout(() => {
14913
+ C.current !== null && window.clearTimeout(C.current), C.current = window.setTimeout(() => {
14918
14914
  r.current && t.length > 0 && c();
14919
14915
  }, 50);
14920
14916
  };
14921
14917
  return window.addEventListener("resize", e), () => {
14922
- window.removeEventListener("resize", e), w.current !== null && window.clearTimeout(w.current);
14918
+ window.removeEventListener("resize", e), C.current !== null && window.clearTimeout(C.current);
14923
14919
  };
14924
14920
  }, [
14925
14921
  r,
14926
14922
  t,
14927
14923
  c
14928
14924
  ]);
14929
- let T = "flex flex-col gap-0.5", E = J(function() {
14930
- return g.reduce((e, t, n) => (t.label in e || (e[t.label] = []), e[t.label].push(n), e), {});
14931
- }, [g]), D = J(function() {
14932
- return v && g.map((e, t) => /* @__PURE__ */ Q(RO, {
14925
+ let w = "flex flex-col gap-0.5", T = J(function() {
14926
+ return h.reduce((e, t, n) => (t.label in e || (e[t.label] = []), e[t.label].push(n), e), {});
14927
+ }, [h]), E = J(function() {
14928
+ return _ && h.map((e, t) => /* @__PURE__ */ Q(RO, {
14933
14929
  isSortable: !l,
14934
- tooltip: (E[e.label] ?? []).length > 1 ? e.tooltip : void 0,
14930
+ tooltip: (T[e.label] ?? []).length > 1 ? e.tooltip : void 0,
14935
14931
  item: e,
14936
- dragConstraints: h,
14937
- onRemove: b,
14932
+ onRemove: y,
14938
14933
  index: t,
14939
- total: g.length,
14940
- onMove: x,
14934
+ total: h.length,
14935
+ onMove: b,
14941
14936
  onReorderFinish: () => {
14942
- s?.(g);
14937
+ s?.(h);
14943
14938
  }
14944
14939
  }, `${e.href}-${e.label}`));
14945
14940
  }, [
14946
- v,
14947
- g,
14948
- E,
14941
+ _,
14942
+ h,
14943
+ T,
14944
+ y,
14949
14945
  b,
14950
- x,
14951
14946
  s,
14952
14947
  l
14953
- ]), O = "flex flex-col gap-3", k = J(function() {
14948
+ ]), D = "flex flex-col gap-3", O = J(function() {
14954
14949
  return t.map((e) => /* @__PURE__ */ Q(zO, {
14955
14950
  category: e,
14956
14951
  isSortable: !l,
14957
- dragConstraints: r,
14958
14952
  onCollapse: i,
14959
14953
  onDragEnd: a,
14960
14954
  currentOrder: t
@@ -14962,7 +14956,6 @@ function VO({ nonSortableItems: e, sortableItems: t, setSortableItems: n, contai
14962
14956
  }, [
14963
14957
  t,
14964
14958
  l,
14965
- r,
14966
14959
  i,
14967
14960
  a
14968
14961
  ]);
@@ -14976,22 +14969,19 @@ function VO({ nonSortableItems: e, sortableItems: t, setSortableItems: n, contai
14976
14969
  onCollapse: i
14977
14970
  }, `fixed-${t}`))
14978
14971
  }) : null,
14979
- v ? /* @__PURE__ */ Q("div", {
14972
+ _ ? /* @__PURE__ */ Q("div", {
14980
14973
  className: "mt-3 flex w-full flex-col gap-3 bg-transparent px-3",
14981
14974
  children: /* @__PURE__ */ Q(gE, {
14982
14975
  title: u.favorites.favorites,
14983
- children: /* @__PURE__ */ Q("div", {
14984
- ref: h,
14985
- children: l ? /* @__PURE__ */ Q("div", {
14986
- className: T,
14987
- children: D
14988
- }) : /* @__PURE__ */ Q(We, {
14989
- axis: "y",
14990
- values: g,
14991
- onReorder: y,
14992
- className: T,
14993
- children: D
14994
- })
14976
+ children: l ? /* @__PURE__ */ Q("div", {
14977
+ className: w,
14978
+ children: E
14979
+ }) : /* @__PURE__ */ Q(We, {
14980
+ axis: "y",
14981
+ values: h,
14982
+ onReorder: v,
14983
+ className: w,
14984
+ children: E
14995
14985
  })
14996
14986
  })
14997
14987
  }) : null,
@@ -15006,15 +14996,15 @@ function VO({ nonSortableItems: e, sortableItems: t, setSortableItems: n, contai
15006
14996
  className: B("mt-3 flex w-full flex-col gap-3 bg-transparent px-3 [&_li]:list-none"),
15007
14997
  ref: r,
15008
14998
  children: l ? /* @__PURE__ */ Q("div", {
15009
- className: O,
15010
- children: k
14999
+ className: D,
15000
+ children: O
15011
15001
  }) : /* @__PURE__ */ Q(We, {
15012
15002
  axis: "y",
15013
15003
  values: t,
15014
15004
  onReorder: n,
15015
15005
  layoutScroll: !0,
15016
- className: O,
15017
- children: k
15006
+ className: D,
15007
+ children: O
15018
15008
  })
15019
15009
  }) : null
15020
15010
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factorialco/f0-react",
3
- "version": "14.9.2",
3
+ "version": "14.9.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/factorialco/f0.git",
@@ -235,7 +235,6 @@
235
235
  "livekit-client": "^2.17.0",
236
236
  "lucide-react": "^0.383.0",
237
237
  "maplibre-gl": "^5.24.0",
238
- "motion": "^12.34.5",
239
238
  "nanoid": "^5.0.7",
240
239
  "pdfjs-dist": "4.8.69",
241
240
  "react": "18.3.1",