@factorialco/f0-react 1.413.0 → 1.413.1

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.
@@ -109665,23 +109665,23 @@ export {
109665
109665
  kH as d$,
109666
109666
  bc as d0,
109667
109667
  GI as d1,
109668
- gr1 as d2,
109669
- Jn1 as d3,
109670
- Lk as d4,
109671
- wB as d5,
109672
- AB as d6,
109673
- Ad as d7,
109674
- Td as d8,
109675
- Dd as d9,
109676
- gI as dA,
109677
- II as dB,
109678
- XI as dC,
109679
- ka as dD,
109680
- tB as dE,
109681
- rB as dF,
109682
- hr1 as dG,
109683
- cB as dH,
109684
- CB as dI,
109668
+ Jn1 as d2,
109669
+ Lk as d3,
109670
+ wB as d4,
109671
+ AB as d5,
109672
+ Ad as d6,
109673
+ Td as d7,
109674
+ Dd as d8,
109675
+ Ow as d9,
109676
+ II as dA,
109677
+ XI as dB,
109678
+ ka as dC,
109679
+ tB as dD,
109680
+ rB as dE,
109681
+ hr1 as dF,
109682
+ cB as dG,
109683
+ CB as dH,
109684
+ gr1 as dI,
109685
109685
  br1 as dJ,
109686
109686
  wr1 as dK,
109687
109687
  yr1 as dL,
@@ -109700,87 +109700,86 @@ export {
109700
109700
  d0 as dY,
109701
109701
  or as dZ,
109702
109702
  qs2 as d_,
109703
- Ow as da,
109704
- qu2 as db,
109705
- zr1 as dc,
109706
- UI as dd,
109707
- QI as de,
109708
- bj as df,
109709
- Cr1 as dg,
109710
- Zr1 as dh,
109711
- p8 as di,
109712
- Qn1 as dj,
109713
- cx as dk,
109714
- Ar1 as dl,
109715
- qn as dm,
109716
- Xe1 as dn,
109717
- D3 as dp,
109718
- n01 as dq,
109719
- Qr1 as dr,
109720
- Jr1 as ds,
109721
- lF as dt,
109722
- n4 as du,
109723
- gc as dv,
109724
- sr1 as dw,
109725
- lr1 as dx,
109726
- WI as dy,
109727
- mI as dz,
109703
+ qu2 as da,
109704
+ zr1 as db,
109705
+ UI as dc,
109706
+ QI as dd,
109707
+ bj as de,
109708
+ Cr1 as df,
109709
+ Zr1 as dg,
109710
+ p8 as dh,
109711
+ Qn1 as di,
109712
+ cx as dj,
109713
+ Ar1 as dk,
109714
+ qn as dl,
109715
+ Xe1 as dm,
109716
+ D3 as dn,
109717
+ n01 as dp,
109718
+ Qr1 as dq,
109719
+ Jr1 as dr,
109720
+ lF as ds,
109721
+ n4 as dt,
109722
+ gc as du,
109723
+ sr1 as dv,
109724
+ lr1 as dw,
109725
+ WI as dx,
109726
+ mI as dy,
109727
+ gI as dz,
109728
109728
  JL as e,
109729
109729
  sd as e0,
109730
109730
  HH as e1,
109731
109731
  zk as e2,
109732
109732
  wc as e3,
109733
- q42 as e4,
109734
- j2 as e5,
109735
- Y1 as e6,
109736
- i9 as e7,
109737
- Fr as e8,
109738
- r8 as e9,
109739
- gs2 as eA,
109740
- pl as eB,
109741
- tx as eC,
109742
- nx as eD,
109743
- rx as eE,
109744
- PH as eF,
109745
- b91 as eG,
109746
- V6 as eH,
109747
- E6 as eI,
109748
- or1 as eJ,
109749
- Yb as eK,
109750
- R01 as eL,
109751
- jC2 as eM,
109752
- Xr1 as eN,
109753
- k01 as eO,
109754
- ll2 as eP,
109755
- ef2 as eQ,
109756
- Tn1 as eR,
109757
- sn1 as eS,
109758
- Nr1 as ea,
109759
- Dr1 as eb,
109760
- Tr1 as ec,
109761
- tl2 as ed,
109762
- F4 as ee,
109763
- pi as ef,
109764
- y3 as eg,
109765
- a7 as eh,
109766
- dl2 as ei,
109767
- Fu2 as ej,
109768
- Jv as ek,
109769
- c8 as el,
109770
- cd2 as em,
109771
- dd2 as en,
109772
- kF as eo,
109773
- er as ep,
109774
- Qn as eq,
109775
- oD as er,
109776
- Ml as es,
109777
- c3 as et,
109778
- t7 as eu,
109779
- ah as ev,
109780
- SN as ew,
109781
- er1 as ex,
109782
- q6 as ey,
109783
- nl2 as ez,
109733
+ er as e4,
109734
+ Qn as e5,
109735
+ oD as e6,
109736
+ Ml as e7,
109737
+ c3 as e8,
109738
+ t7 as e9,
109739
+ j2 as eA,
109740
+ Y1 as eB,
109741
+ i9 as eC,
109742
+ Fr as eD,
109743
+ r8 as eE,
109744
+ Nr1 as eF,
109745
+ Dr1 as eG,
109746
+ Tr1 as eH,
109747
+ F4 as eI,
109748
+ pi as eJ,
109749
+ y3 as eK,
109750
+ a7 as eL,
109751
+ dl2 as eM,
109752
+ Fu2 as eN,
109753
+ Jv as eO,
109754
+ cd2 as eP,
109755
+ dd2 as eQ,
109756
+ kF as eR,
109757
+ ah as ea,
109758
+ SN as eb,
109759
+ er1 as ec,
109760
+ q6 as ed,
109761
+ nl2 as ee,
109762
+ tl2 as ef,
109763
+ gs2 as eg,
109764
+ pl as eh,
109765
+ tx as ei,
109766
+ nx as ej,
109767
+ rx as ek,
109768
+ PH as el,
109769
+ c8 as em,
109770
+ b91 as en,
109771
+ V6 as eo,
109772
+ E6 as ep,
109773
+ or1 as eq,
109774
+ Yb as er,
109775
+ R01 as es,
109776
+ jC2 as et,
109777
+ Xr1 as eu,
109778
+ k01 as ev,
109779
+ ll2 as ew,
109780
+ ef2 as ex,
109781
+ Tn1 as ey,
109782
+ sn1 as ez,
109784
109783
  ZN as f,
109785
109784
  y6 as g,
109786
109785
  E3 as h,
package/dist/ai.d.ts CHANGED
@@ -203,8 +203,6 @@ declare type AiChatProviderReturnValue = {
203
203
  } & Pick<AiChatState, "greeting" | "agent" | "disclaimer" | "resizable" | "entityResolvers" | "toolHints"> & {
204
204
  /** The current canvas content, or null when canvas is closed */
205
205
  canvasContent: CanvasContent | null;
206
- /** The dashboard config from the current canvas content, or null */
207
- canvasDashboard: ChatDashboardConfig | null;
208
206
  /** Open the canvas panel with the given content */
209
207
  openCanvas: (content: CanvasContent) => void;
210
208
  /** Close the canvas panel and restore the previous visualization mode */
@@ -213,10 +211,6 @@ declare type AiChatProviderReturnValue = {
213
211
  activeToolHint: AiChatToolHint | null;
214
212
  /** Set the active tool hint (pass null to clear) */
215
213
  setActiveToolHint: React.Dispatch<React.SetStateAction<AiChatToolHint | null>>;
216
- /** Get a saved dashboard config by toolCallId (returns updated config after user edits) */
217
- getSavedDashboardConfig: (toolCallId: string) => ChatDashboardConfig | undefined;
218
- /** Save an updated dashboard config keyed by toolCallId */
219
- updateDashboardConfig: (toolCallId: string, config: ChatDashboardConfig) => void;
220
214
  };
221
215
 
222
216
  /**
@@ -367,19 +361,54 @@ export declare function Blockquote({ children, ...props }: React.HTMLAttributes<
367
361
 
368
362
  /**
369
363
  * Discriminated union for canvas panel content.
370
- * Expand this union to support new content types in the canvas.
364
+ * Add new entity types to this union as they are implemented.
371
365
  */
372
- export declare type CanvasContent = {
373
- type: "dashboard";
366
+ export declare type CanvasContent = DashboardCanvasContent;
367
+
368
+ /**
369
+ * Base shape shared by all canvas content types.
370
+ * Every entity adds its own fields on top of this.
371
+ */
372
+ export declare type CanvasContentBase = {
373
+ type: string;
374
374
  title: string;
375
- config: ChatDashboardConfig;
376
- apiConfig: {
377
- baseUrl: string;
378
- headers: Record<string, string>;
379
- };
380
375
  toolCallId?: string;
381
376
  };
382
377
 
378
+ /**
379
+ * Contract for a canvas entity type.
380
+ *
381
+ * Each entity (dashboard, survey, goal, job-posting…) implements this
382
+ * interface and registers itself via `registerCanvasEntity()`.
383
+ *
384
+ * To add a new entity type:
385
+ * 1. Create a folder in `canvas/entities/<your-entity>/`
386
+ * 2. Define a type extending `CanvasContentBase` in `types.ts`
387
+ * 3. Implement `CanvasEntityDefinition` in `index.ts`
388
+ * 4. Import the entity module in `canvas/index.ts`
389
+ */
390
+ export declare type CanvasEntityDefinition<T extends CanvasContentBase = CanvasContentBase> = {
391
+ /** Must match the `type` discriminant on the content object */
392
+ type: T["type"];
393
+ /** Renders the main body of the canvas panel */
394
+ renderContent: (props: {
395
+ content: T;
396
+ refreshKey: number;
397
+ }) => ReactNode;
398
+ /** Renders header actions (placed before the close button) */
399
+ renderHeaderActions: (props: {
400
+ content: T;
401
+ }) => ReactNode;
402
+ /**
403
+ * Optional wrapper providing entity-scoped context around
404
+ * both header actions and body (e.g. shared edit-mode state).
405
+ */
406
+ wrapper?: (props: {
407
+ content: T;
408
+ children: ReactNode;
409
+ }) => ReactNode;
410
+ };
411
+
383
412
  export declare interface ChartComputation {
384
413
  datasetId: string;
385
414
  xAxis: string;
@@ -548,6 +577,29 @@ export declare interface CollectionComputation {
548
577
  */
549
578
  export declare type CSSRgbString = `rgb(${number}, ${number}, ${number})` | `rgb(${number},${number},${number})`;
550
579
 
580
+ /**
581
+ * Dashboard canvas content — renders an analytics dashboard.
582
+ */
583
+ export declare type DashboardCanvasContent = CanvasContentBase & {
584
+ type: "dashboard";
585
+ config: ChatDashboardConfig;
586
+ apiConfig: {
587
+ baseUrl: string;
588
+ headers: Record<string, string>;
589
+ };
590
+ };
591
+
592
+ /**
593
+ * Dashboard-specific card that wraps CanvasCard with config-store
594
+ * subscription logic. Re-renders when the user edits and saves
595
+ * the dashboard layout.
596
+ */
597
+ declare function DashboardCard({ config: originalConfig, onView, toolCallId, }: F0ChatReportCardProps): JSX_2.Element;
598
+
599
+ declare namespace DashboardCard {
600
+ var displayName: string;
601
+ }
602
+
551
603
  export declare interface DashboardFetchSpec {
552
604
  fetch: Array<{
553
605
  toolId: string;
@@ -1395,29 +1447,19 @@ declare const F0AuraVoiceAnimationVariants: (props?: ({
1395
1447
  })) | undefined) => string;
1396
1448
 
1397
1449
  /**
1398
- * Compact card shown inline in the AI chat to represent a generated
1399
- * dashboard report. Uses F0Card with an icon avatar, the dashboard
1400
- * title/description, and an item summary in metadata. Clicking the
1401
- * card triggers `onView` to open the canvas panel.
1402
- *
1403
- * Subscribes to the external `savedDashboardConfigStore` via
1404
- * `useSyncExternalStore` so it re-renders when the user edits the
1405
- * dashboard layout and saves — independently of React context.
1450
+ * @deprecated Use `DashboardCard` from `canvas/entities/dashboard` directly.
1451
+ * This re-export exists for backwards compatibility.
1406
1452
  */
1407
- export declare function F0ChatReportCard({ config: originalConfig, onView, toolCallId, }: F0ChatReportCardProps): JSX_2.Element;
1453
+ export declare const F0ChatReportCard: typeof DashboardCard;
1408
1454
 
1409
- export declare namespace F0ChatReportCard {
1410
- var displayName: string;
1411
- }
1412
-
1413
- export declare interface F0ChatReportCardProps {
1455
+ export declare type F0ChatReportCardProps = {
1414
1456
  /** The original dashboard config from the agent */
1415
1457
  config: ChatDashboardConfig;
1416
1458
  /** Callback when the user clicks the card to view the report */
1417
1459
  onView: (config: ChatDashboardConfig) => void;
1418
1460
  /** Tool call ID used to look up saved (edited) dashboard configs */
1419
1461
  toolCallId?: string;
1420
- }
1462
+ };
1421
1463
 
1422
1464
  /**
1423
1465
  * Component that renders an optional markdown preview followed by
@@ -1661,6 +1703,12 @@ declare interface GaugeComputation {
1661
1703
  name?: string;
1662
1704
  }
1663
1705
 
1706
+ /**
1707
+ * Look up a registered entity definition by content type.
1708
+ * Returns `undefined` if the type hasn't been registered.
1709
+ */
1710
+ export declare function getCanvasEntity(type: string): CanvasEntityDefinition<any> | undefined;
1711
+
1664
1712
  export declare function H1({ children, ...props }: React.HTMLAttributes<HTMLHeadingElement>): JSX_2.Element;
1665
1713
 
1666
1714
  export declare function H2({ children, ...props }: React.HTMLAttributes<HTMLHeadingElement>): JSX_2.Element;
@@ -1806,6 +1854,12 @@ declare interface RadarComputation {
1806
1854
  sortOrder?: "asc" | "desc";
1807
1855
  }
1808
1856
 
1857
+ /**
1858
+ * Register a canvas entity definition.
1859
+ * Called as a side-effect when each entity module is imported.
1860
+ */
1861
+ export declare function registerCanvasEntity<T extends CanvasContentBase>(definition: CanvasEntityDefinition<T>): void;
1862
+
1809
1863
  export declare function Strong({ children, ...props }: React.HTMLAttributes<HTMLSpanElement>): JSX_2.Element;
1810
1864
 
1811
1865
  export declare function Table({ children, ...props }: React.HTMLAttributes<HTMLTableElement>): JSX_2.Element;
package/dist/ai.js CHANGED
@@ -1,56 +1,58 @@
1
- import { I as e, u as t } from "./F0Input-JjjfHKNJ.js";
1
+ import { I as e, u as t } from "./F0Input-C9w04Jpr.js";
2
2
  import { defaultTranslations as i } from "./i18n-provider-defaults.js";
3
- import { A as r, B as l, C as A, p as F, E as c, g as u, F as h, a as C, z as d, h as m, b as T, i as f, j as p, v as I, w as S, x as g, y as k, c as x, q as H, r as M, s as P, H as b, I as w, L as O, O as v, t as R, P as D, S as E, T as L, m as q, n as y, o as z, U as B, k as U, l as j, u as V, d as G, f as J, e as K } from "./F0AiChat-C58IuYYg.js";
4
- import { A as Q, F as W, c as X, d as Y, b as Z, a as _, o as $, u as aa } from "./F0HILActionConfirmation-CasXGy89.js";
3
+ import { A as r, B as l, C as A, p as F, E as c, h as u, F as C, a as h, D as d, i as m, b as T, j as f, w as p, x as g, y as I, z as S, c as k, q as x, s as v, t as H, H as M, I as P, L as b, O as w, v as E, P as O, S as y, T as D, m as R, n as L, o as q, U as z, k as B, l as U, g as j, r as V, u as G, d as J, f as K, e as N } from "./F0AiChat-CMz8oLke.js";
4
+ import { A as W, F as X, c as Y, d as Z, e as _, b as $, a as aa, o as sa, u as ea } from "./F0HILActionConfirmation-MJSEogqB.js";
5
5
  export {
6
6
  r as A,
7
- Q as AiChatTranslationsProvider,
7
+ W as AiChatTranslationsProvider,
8
8
  l as Blockquote,
9
9
  A as ChatSpinner,
10
10
  F as Em,
11
11
  c as EntityRef,
12
12
  u as F0ActionItem,
13
- h as F0AiChat,
14
- C as F0AiChatProvider,
13
+ C as F0AiChat,
14
+ h as F0AiChatProvider,
15
15
  d as F0AiChatTextArea,
16
16
  m as F0AiCollapsibleMessage,
17
17
  T as F0AiFullscreenChat,
18
- W as F0AiMask,
19
- X as F0AuraVoiceAnimation,
20
- f as F0ChatReportCard,
21
- p as F0DataDownload,
22
- Y as F0HILActionConfirmation,
23
- I as F0MessageSources,
24
- S as F0OneIcon,
25
- g as F0OneSwitch,
26
- k as F0Thinking,
27
- x as FullscreenChatContext,
28
- H as H1,
29
- M as H2,
30
- P as H3,
31
- b as Hr,
18
+ X as F0AiMask,
19
+ Y as F0AuraVoiceAnimation,
20
+ Z as F0ChatReportCard,
21
+ f as F0DataDownload,
22
+ _ as F0HILActionConfirmation,
23
+ p as F0MessageSources,
24
+ g as F0OneIcon,
25
+ I as F0OneSwitch,
26
+ S as F0Thinking,
27
+ k as FullscreenChatContext,
28
+ x as H1,
29
+ v as H2,
30
+ H as H3,
31
+ M as Hr,
32
32
  e as I18nProvider,
33
- w as Image,
34
- O as Li,
35
- v as Ol,
36
- R as P,
37
- D as Pre,
38
- E as Strong,
39
- L as Table,
40
- q as TableSimple,
41
- y as Td,
42
- z as Th,
43
- B as Ul,
44
- Z as actionItemStatuses,
45
- _ as aiTranslations,
33
+ P as Image,
34
+ b as Li,
35
+ w as Ol,
36
+ E as P,
37
+ O as Pre,
38
+ y as Strong,
39
+ D as Table,
40
+ R as TableSimple,
41
+ L as Td,
42
+ q as Th,
43
+ z as Ul,
44
+ $ as actionItemStatuses,
45
+ aa as aiTranslations,
46
46
  i as defaultTranslations,
47
- U as f0MarkdownRenderers,
48
- j as f0MarkdownRenderersSimple,
49
- $ as oneIconSizes,
50
- V as useAiChat,
51
- aa as useAiChatTranslations,
52
- G as useDefaultCopilotActions,
47
+ B as f0MarkdownRenderers,
48
+ U as f0MarkdownRenderersSimple,
49
+ j as getCanvasEntity,
50
+ sa as oneIconSizes,
51
+ V as registerCanvasEntity,
52
+ G as useAiChat,
53
+ ea as useAiChatTranslations,
54
+ J as useDefaultCopilotActions,
53
55
  t as useI18n,
54
- J as useMessageSourcesAction,
55
- K as useOrchestratorThinkingAction
56
+ K as useMessageSourcesAction,
57
+ N as useOrchestratorThinkingAction
56
58
  };