@factorialco/f0-react 4.30.2 → 4.32.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.
@@ -6267,6 +6267,34 @@ declare type GraphVisualizationOptions<R extends RecordType, Filters extends Fil
6267
6267
  * transparent to the hook — no special adapter mode is required.
6268
6268
  */
6269
6269
  loadNodeData?: (ids: string[]) => Promise<R[]>;
6270
+ /**
6271
+ * Apply targeted updates to the already-loaded tree **in place**, without the
6272
+ * full reset (and collapse to `defaultExpandDepth`) that a filter change
6273
+ * triggers. Use it to reflect real-time / collaborative changes while keeping
6274
+ * the user's current expansion and viewport.
6275
+ *
6276
+ * Bump `version` to apply a batch **once** (the number dedups against React
6277
+ * re-renders — reuse the same object identity freely):
6278
+ * - `upsert` records are matched by node id: an existing node has its `data`,
6279
+ * `childrenCount` and parent refreshed (re-parenting if `getParentId`
6280
+ * returns a new parent); an unknown record is inserted when it is attachable
6281
+ * (a root, or its parent is already in the tree — a child of a not-yet-loaded
6282
+ * parent will appear when that parent is expanded).
6283
+ * - `remove` ids are dropped together with their descendants, and pruned from
6284
+ * the expanded set.
6285
+ *
6286
+ * Applying a batch never re-fetches and never collapses; it reconciles the
6287
+ * nodes already in memory. The parents whose child set the batch touches (the
6288
+ * old and new parent of a move, the parent of a removal) have their
6289
+ * `childrenCount`/`childrenLoaded` reconciled locally from the in-memory tree
6290
+ * — send only the records that changed; upserting the affected parents too is
6291
+ * allowed but not required.
6292
+ */
6293
+ liveUpdate?: {
6294
+ version: number;
6295
+ upsert?: R[];
6296
+ remove?: string[];
6297
+ };
6270
6298
  /**
6271
6299
  * Id of the node representing the current user. When set, a "Find me" button
6272
6300
  * is shown in the controls that centers the viewport on that node.
@@ -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-l-HzgJRw.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-BX9s-4mY.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-BX9s-4mY.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-C9gJck9M.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-C9gJck9M.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
@@ -12116,6 +12116,34 @@ declare type GraphVisualizationOptions<R extends RecordType, Filters extends Fil
12116
12116
  * transparent to the hook — no special adapter mode is required.
12117
12117
  */
12118
12118
  loadNodeData?: (ids: string[]) => Promise<R[]>;
12119
+ /**
12120
+ * Apply targeted updates to the already-loaded tree **in place**, without the
12121
+ * full reset (and collapse to `defaultExpandDepth`) that a filter change
12122
+ * triggers. Use it to reflect real-time / collaborative changes while keeping
12123
+ * the user's current expansion and viewport.
12124
+ *
12125
+ * Bump `version` to apply a batch **once** (the number dedups against React
12126
+ * re-renders — reuse the same object identity freely):
12127
+ * - `upsert` records are matched by node id: an existing node has its `data`,
12128
+ * `childrenCount` and parent refreshed (re-parenting if `getParentId`
12129
+ * returns a new parent); an unknown record is inserted when it is attachable
12130
+ * (a root, or its parent is already in the tree — a child of a not-yet-loaded
12131
+ * parent will appear when that parent is expanded).
12132
+ * - `remove` ids are dropped together with their descendants, and pruned from
12133
+ * the expanded set.
12134
+ *
12135
+ * Applying a batch never re-fetches and never collapses; it reconciles the
12136
+ * nodes already in memory. The parents whose child set the batch touches (the
12137
+ * old and new parent of a move, the parent of a removal) have their
12138
+ * `childrenCount`/`childrenLoaded` reconciled locally from the in-memory tree
12139
+ * — send only the records that changed; upserting the affected parents too is
12140
+ * allowed but not required.
12141
+ */
12142
+ liveUpdate?: {
12143
+ version: number;
12144
+ upsert?: R[];
12145
+ remove?: string[];
12146
+ };
12119
12147
  /**
12120
12148
  * Id of the node representing the current user. When set, a "Find me" button
12121
12149
  * is shown in the controls that centers the viewport on that node.
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-sIXX-6d2.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-sIXX-6d2.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-BX9s-4mY.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-BX9s-4mY.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-C9gJck9M.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-C9gJck9M.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 = {