@factorialco/f0-react 4.25.0 → 4.27.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.
@@ -1734,6 +1734,18 @@ declare type CardImageSize = (typeof cardImageSizes)[number];
1734
1734
 
1735
1735
  declare const cardImageSizes: readonly ["xs", "sm", "md", "lg", "xl"];
1736
1736
 
1737
+ declare type CardMetadata = {
1738
+ /** Leading icon. Optional — when omitted the row renders just the value. */
1739
+ icon?: IconType;
1740
+ property: Exclude<CardMetadataProperty, {
1741
+ type: "file";
1742
+ }>;
1743
+ } | {
1744
+ property: Extract<CardMetadataProperty, {
1745
+ type: "file";
1746
+ }>;
1747
+ };
1748
+
1737
1749
  /**
1738
1750
  * Card metadata property renderers.
1739
1751
  * Each metadata item consists of an icon and a property with its data.
@@ -6230,6 +6242,19 @@ declare type GraphVisualizationOptions<R extends RecordType, Filters extends Fil
6230
6242
  loadNodePath?: (nodeId: string) => Promise<R[]>;
6231
6243
  /** Optional parent accessor used when linking the revealed ancestor path. */
6232
6244
  getParentId?: (record: R) => string | null;
6245
+ /**
6246
+ * Opt into two-phase (viewport-driven) hydration. When provided, the tree is
6247
+ * built from whatever lightweight records `childrenFilters`/`fetchData`
6248
+ * return, and the full record is fetched — batched, once per node — only for
6249
+ * the nodes that enter the viewport, via this loader. The returned records
6250
+ * replace each node's `data` (matched by node id) and clear its loading
6251
+ * placeholder. Best paired with `enableNodeWindowing`. Omit for the current
6252
+ * eager behavior (structure and data fetched together per expansion).
6253
+ *
6254
+ * The "lightness" of the initial records is entirely the source's choice and
6255
+ * transparent to the hook — no special adapter mode is required.
6256
+ */
6257
+ loadNodeData?: (ids: string[]) => Promise<R[]>;
6233
6258
  /**
6234
6259
  * Id of the node representing the current user. When set, a "Find me" button
6235
6260
  * is shown in the controls that centers the viewport on that node.
@@ -6247,6 +6272,22 @@ declare type GraphVisualizationOptions<R extends RecordType, Filters extends Fil
6247
6272
  maxZoom?: number;
6248
6273
  /** Whether to render the zoom/fit controls. Defaults to `true`. */
6249
6274
  showControls?: boolean;
6275
+ /**
6276
+ * Opt into F0Graph node-array windowing (pass-through). Only the nodes near
6277
+ * the viewport are handed to React Flow — for very large trees (thousands of
6278
+ * expand-visible nodes). Off by default; non-breaking.
6279
+ */
6280
+ enableNodeWindowing?: boolean;
6281
+ /** Flow-space px kept materialized around the viewport (pass-through). */
6282
+ nodeWindowPadding?: number;
6283
+ /**
6284
+ * Viewport-driven data loading (pass-through). Called (debounced + batched)
6285
+ * with the ids of nodes that entered the viewport, so the consumer can
6286
+ * hydrate rich data on demand. Best paired with `enableNodeWindowing`.
6287
+ */
6288
+ loadVisibleNodeData?: (ids: string[]) => void;
6289
+ /** Debounce (ms) before flushing a batch of newly-visible ids (pass-through). */
6290
+ visibleDataDebounceMs?: number;
6250
6291
  };
6251
6292
 
6252
6293
  declare type GraphVisualizationSettings = {
@@ -6773,10 +6814,7 @@ declare type KanbanVisualizationOptions<Record extends RecordType, _Filters exte
6773
6814
  title?: (record: Record) => string;
6774
6815
  description?: (record: Record) => string;
6775
6816
  avatar?: (record: Record) => CardAvatarVariant;
6776
- metadata?: (record: Record) => ReadonlyArray<{
6777
- icon: IconType;
6778
- property: CardMetadataProperty;
6779
- }>;
6817
+ metadata?: (record: Record) => ReadonlyArray<CardMetadata>;
6780
6818
  onMove?: KanbanOnMove<Record>;
6781
6819
  onCreate?: KanbanOnCreate;
6782
6820
  };
@@ -2,8 +2,8 @@ import { h as Va, B as Ga, i as Ka, j as qa, k as wn, l as lt, m as tt, n as Ya,
2
2
  import { cD as vm, cC as ym, cP as wm, cz as Nm, cA as Cm, cs as km, ct as Im, ct as Sm, cu as Fm, cS as Tm, cB as Am, cL as Em, cM as Rm, cQ as Dm, cv as Pm, cF as Lm, cE as Om, cw as _m, cx as zm, cN as $m, cT as Bm, cO as Mm, cR as jm, cK as Wm, cH as Hm, cJ as Um, cG as Vm, cy as Gm, cI as Km } from "./F0CanvasPanel-CYITfwlc.js";
3
3
  import { jsx as t, jsxs as d, Fragment as fe } from "react/jsx-runtime";
4
4
  import Te, { forwardRef as de, useRef as z, useTransition as Qi, useState as R, useLayoutEffect as Je, useId as Qt, useContext as Le, createContext as Ie, useEffect as K, useCallback as U, useMemo as J, Fragment as qe, isValidElement as Ji, cloneElement as jr, memo as Wr, Children as Hr } from "react";
5
- import { C as Xi, P as Zi, a as it, M as eo, p as to, b as no, R as Fn, c as Ur, u as ro, d as ao, e as so, f as io, g as oo, O as Vr, h as Gr, S as lo, A as co, B as uo, L as fo, i as mo, V as ho, j as po, k as go, l as bo } from "./useDataCollectionSource-DMGVHA_H.js";
6
- import { r as Ym, s as Qm, o as Jm, H as Xm, t as Zm, z as eh, a8 as th, G as nh, q as rh, aa as ah, a9 as sh, Q as ih, ad as oh, F as lh, Y as ch, U as dh, J as uh, af as fh, K as mh, Z as hh, _ as ph, v as gh, ab as bh, ac as xh, N as vh, $ as yh, a5 as wh, a7 as Nh, w as Ch, y as kh, D as Ih, W as Sh, ae as Fh, X as Th, T as Ah, ag as Eh, x as Rh, E as Dh, m as Ph, n as Lh, a1 as Oh, a2 as _h, a6 as zh, I as $h, a3 as Bh, a0 as Mh, a4 as jh } from "./useDataCollectionSource-DMGVHA_H.js";
5
+ import { C as Xi, P as Zi, a as it, M as eo, p as to, b as no, R as Fn, c as Ur, u as ro, d as ao, e as so, f as io, g as oo, O as Vr, h as Gr, S as lo, A as co, B as uo, L as fo, i as mo, V as ho, j as po, k as go, l as bo } from "./useDataCollectionSource-C4LIvKAw.js";
6
+ import { r as Ym, s as Qm, o as Jm, H as Xm, t as Zm, z as eh, a8 as th, G as nh, q as rh, aa as ah, a9 as sh, Q as ih, ad as oh, F as lh, Y as ch, U as dh, J as uh, af as fh, K as mh, Z as hh, _ as ph, v as gh, ab as bh, ac as xh, N as vh, $ as yh, a5 as wh, a7 as Nh, w as Ch, y as kh, D as Ih, W as Sh, ae as Fh, X as Th, T as Ah, ag as Eh, x as Rh, E as Dh, m as Ph, n as Lh, a1 as Oh, a2 as _h, a6 as zh, I as $h, a3 as Bh, a0 as Mh, a4 as jh } from "./useDataCollectionSource-C4LIvKAw.js";
7
7
  const xo = Va("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.d.ts CHANGED
@@ -12072,6 +12072,19 @@ declare type GraphVisualizationOptions<R extends RecordType, Filters extends Fil
12072
12072
  loadNodePath?: (nodeId: string) => Promise<R[]>;
12073
12073
  /** Optional parent accessor used when linking the revealed ancestor path. */
12074
12074
  getParentId?: (record: R) => string | null;
12075
+ /**
12076
+ * Opt into two-phase (viewport-driven) hydration. When provided, the tree is
12077
+ * built from whatever lightweight records `childrenFilters`/`fetchData`
12078
+ * return, and the full record is fetched — batched, once per node — only for
12079
+ * the nodes that enter the viewport, via this loader. The returned records
12080
+ * replace each node's `data` (matched by node id) and clear its loading
12081
+ * placeholder. Best paired with `enableNodeWindowing`. Omit for the current
12082
+ * eager behavior (structure and data fetched together per expansion).
12083
+ *
12084
+ * The "lightness" of the initial records is entirely the source's choice and
12085
+ * transparent to the hook — no special adapter mode is required.
12086
+ */
12087
+ loadNodeData?: (ids: string[]) => Promise<R[]>;
12075
12088
  /**
12076
12089
  * Id of the node representing the current user. When set, a "Find me" button
12077
12090
  * is shown in the controls that centers the viewport on that node.
@@ -12089,6 +12102,22 @@ declare type GraphVisualizationOptions<R extends RecordType, Filters extends Fil
12089
12102
  maxZoom?: number;
12090
12103
  /** Whether to render the zoom/fit controls. Defaults to `true`. */
12091
12104
  showControls?: boolean;
12105
+ /**
12106
+ * Opt into F0Graph node-array windowing (pass-through). Only the nodes near
12107
+ * the viewport are handed to React Flow — for very large trees (thousands of
12108
+ * expand-visible nodes). Off by default; non-breaking.
12109
+ */
12110
+ enableNodeWindowing?: boolean;
12111
+ /** Flow-space px kept materialized around the viewport (pass-through). */
12112
+ nodeWindowPadding?: number;
12113
+ /**
12114
+ * Viewport-driven data loading (pass-through). Called (debounced + batched)
12115
+ * with the ids of nodes that entered the viewport, so the consumer can
12116
+ * hydrate rich data on demand. Best paired with `enableNodeWindowing`.
12117
+ */
12118
+ loadVisibleNodeData?: (ids: string[]) => void;
12119
+ /** Debounce (ms) before flushing a batch of newly-visible ids (pass-through). */
12120
+ visibleDataDebounceMs?: number;
12092
12121
  };
12093
12122
 
12094
12123
  declare type GraphVisualizationSettings = {
@@ -12750,10 +12779,7 @@ declare type KanbanVisualizationOptions<Record extends RecordType, _Filters exte
12750
12779
  title?: (record: Record) => string;
12751
12780
  description?: (record: Record) => string;
12752
12781
  avatar?: (record: Record) => CardAvatarVariant;
12753
- metadata?: (record: Record) => ReadonlyArray<{
12754
- icon: IconType;
12755
- property: CardMetadataProperty;
12756
- }>;
12782
+ metadata?: (record: Record) => ReadonlyArray<CardMetadata>;
12757
12783
  onMove?: KanbanOnMove<Record>;
12758
12784
  onCreate?: KanbanOnCreate;
12759
12785
  };
package/dist/f0.js CHANGED
@@ -6,8 +6,8 @@ import React__default, { forwardRef, useRef, useImperativeHandle, Children, crea
6
6
  import { D as AIButton, E as ForwardRef$1, G as animate, H as ForwardRef$f, I as ForwardRef$j, J as ForwardRef$k, K as ForwardRef$o, L as ForwardRef$t, M as ForwardRef$x, N as ForwardRef$z, O as F0Box, P as ForwardRef$J, Q as ForwardRef$K, R as ForwardRef$L, S as ForwardRef$M, U as ForwardRef$N, F as FormCardValueFormatterProvider } from "./F0AiProcessingOverlay--OAyX7JL.js";
7
7
  import { A as ta, C as ea, t as ia, s as aa, v as na, y as la, l as ra, i as sa, q as oa, z as ca, B as da, p as ua, r as ha, j as ma, e as pa, g as ba, k as Za, T as ya, w as Ma, h as Na, a as ga, n as Wa, m as Ta, o as Ga, b as fa, f as va, x as La, c as Ya, d as Xa, u as Sa } from "./F0AiProcessingOverlay--OAyX7JL.js";
8
8
  import { createPortal, unstable_batchedUpdates } from "react-dom";
9
- import { C as Carousel, F as F0SegmentedControl, ah as isFieldRequired, ai as evaluateRenderIf, aj as buildDynamicSchema, ak as renderFieldInput, al as useF0Form, am as F0Form, G as F0ActionBar, an as F0FormSection, ao as nanoid, ap as dequal, Y as F0TableOfContent, a8 as Dialog$1, aq as FormMessage, Q as F0NumberInput, ar as EmojiPicker, as as data, c as ReorderItem, R as ReorderGroup, u as useDragControls, W as ResourceHeader, O as OneEmptyState, at as UpsellRequestResponseDialog, au as Label$1, av as UpsellingButton, o as BaseBanner, d as useDataCollectionSource, $ as OneDataCollection, aw as extractDisplayValue, ax as navigationFilterTypes, ay as NavigationFilters, az as DialogDescription, aA as PrivacyModeProvider, M as MotionConfig } from "./useDataCollectionSource-DMGVHA_H.js";
10
- import { r as Va, s as Ia, H as Ra, t as wa, z as za, aR as Da, aQ as Ca, aM as ka, aC as Oa, aB as Fa, aD as ja, aE as Ea, aa as Ua, a9 as Ja, ad as Pa, U as Ka, J as Ha, af as Aa, K as Qa, v as Ba, aS as $a, ab as qa, ac as tn, N as en, w as an, P as nn, y as ln, D as rn, ae as sn, T as on, ag as dn, x as un, E as hn, aU as mn, m as pn, n as bn, aL as Zn, aH as yn, aG as Mn, aT as Nn, a6 as gn, aJ as Wn, aK as Tn, I as Gn, aV as fn, aW as vn, e as Ln, aN as Yn, aO as Xn, aP as Sn, aI as xn, f as Vn, h as In, aF as Rn, aX as wn } from "./useDataCollectionSource-DMGVHA_H.js";
9
+ import { C as Carousel, F as F0SegmentedControl, ah as isFieldRequired, ai as evaluateRenderIf, aj as buildDynamicSchema, ak as renderFieldInput, al as useF0Form, am as F0Form, G as F0ActionBar, an as F0FormSection, ao as nanoid, ap as dequal, Y as F0TableOfContent, a8 as Dialog$1, aq as FormMessage, Q as F0NumberInput, ar as EmojiPicker, as as data, c as ReorderItem, R as ReorderGroup, u as useDragControls, W as ResourceHeader, O as OneEmptyState, at as UpsellRequestResponseDialog, au as Label$1, av as UpsellingButton, o as BaseBanner, d as useDataCollectionSource, $ as OneDataCollection, aw as extractDisplayValue, ax as navigationFilterTypes, ay as NavigationFilters, az as DialogDescription, aA as PrivacyModeProvider, M as MotionConfig } from "./useDataCollectionSource-C4LIvKAw.js";
10
+ import { r as Va, s as Ia, H as Ra, t as wa, z as za, aR as Da, aQ as Ca, aM as ka, aC as Oa, aB as Fa, aD as ja, aE as Ea, aa as Ua, a9 as Ja, ad as Pa, U as Ka, J as Ha, af as Aa, K as Qa, v as Ba, aS as $a, ab as qa, ac as tn, N as en, w as an, P as nn, y as ln, D as rn, ae as sn, T as on, ag as dn, x as un, E as hn, aU as mn, m as pn, n as bn, aL as Zn, aH as yn, aG as Mn, aT as Nn, a6 as gn, aJ as Wn, aK as Tn, I as Gn, aV as fn, aW as vn, e as Ln, aN as Yn, aO as Xn, aP as Sn, aI as xn, f as Vn, h as In, aF as Rn, aX as wn } from "./useDataCollectionSource-C4LIvKAw.js";
11
11
  import { utils, write as writeSync } from "./xlsx-Bedf3nwD.js";
12
12
  import { defaultTranslations as Dn } from "./i18n-provider-defaults.js";
13
13
  import './f0.css';const CAROUSEL_COLUMNS = {