@factorialco/f0-react 1.413.0 → 1.414.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.
@@ -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
  /**
@@ -357,6 +351,12 @@ export declare const aiTranslations: {
357
351
  dataDownload: {
358
352
  download: string;
359
353
  };
354
+ pong: {
355
+ ai: string;
356
+ you: string;
357
+ youWin: string;
358
+ youLose: string;
359
+ };
360
360
  unsavedChanges: string;
361
361
  saveChanges: string;
362
362
  discardChanges: string;
@@ -367,19 +367,54 @@ export declare function Blockquote({ children, ...props }: React.HTMLAttributes<
367
367
 
368
368
  /**
369
369
  * Discriminated union for canvas panel content.
370
- * Expand this union to support new content types in the canvas.
370
+ * Add new entity types to this union as they are implemented.
371
371
  */
372
- export declare type CanvasContent = {
373
- type: "dashboard";
372
+ export declare type CanvasContent = DashboardCanvasContent;
373
+
374
+ /**
375
+ * Base shape shared by all canvas content types.
376
+ * Every entity adds its own fields on top of this.
377
+ */
378
+ export declare type CanvasContentBase = {
379
+ type: string;
374
380
  title: string;
375
- config: ChatDashboardConfig;
376
- apiConfig: {
377
- baseUrl: string;
378
- headers: Record<string, string>;
379
- };
380
381
  toolCallId?: string;
381
382
  };
382
383
 
384
+ /**
385
+ * Contract for a canvas entity type.
386
+ *
387
+ * Each entity (dashboard, survey, goal, job-posting…) implements this
388
+ * interface and registers itself via `registerCanvasEntity()`.
389
+ *
390
+ * To add a new entity type:
391
+ * 1. Create a folder in `canvas/entities/<your-entity>/`
392
+ * 2. Define a type extending `CanvasContentBase` in `types.ts`
393
+ * 3. Implement `CanvasEntityDefinition` in `index.ts`
394
+ * 4. Import the entity module in `canvas/index.ts`
395
+ */
396
+ export declare type CanvasEntityDefinition<T extends CanvasContentBase = CanvasContentBase> = {
397
+ /** Must match the `type` discriminant on the content object */
398
+ type: T["type"];
399
+ /** Renders the main body of the canvas panel */
400
+ renderContent: (props: {
401
+ content: T;
402
+ refreshKey: number;
403
+ }) => ReactNode;
404
+ /** Renders header actions (placed before the close button) */
405
+ renderHeaderActions: (props: {
406
+ content: T;
407
+ }) => ReactNode;
408
+ /**
409
+ * Optional wrapper providing entity-scoped context around
410
+ * both header actions and body (e.g. shared edit-mode state).
411
+ */
412
+ wrapper?: (props: {
413
+ content: T;
414
+ children: ReactNode;
415
+ }) => ReactNode;
416
+ };
417
+
383
418
  export declare interface ChartComputation {
384
419
  datasetId: string;
385
420
  xAxis: string;
@@ -548,6 +583,29 @@ export declare interface CollectionComputation {
548
583
  */
549
584
  export declare type CSSRgbString = `rgb(${number}, ${number}, ${number})` | `rgb(${number},${number},${number})`;
550
585
 
586
+ /**
587
+ * Dashboard canvas content — renders an analytics dashboard.
588
+ */
589
+ export declare type DashboardCanvasContent = CanvasContentBase & {
590
+ type: "dashboard";
591
+ config: ChatDashboardConfig;
592
+ apiConfig: {
593
+ baseUrl: string;
594
+ headers: Record<string, string>;
595
+ };
596
+ };
597
+
598
+ /**
599
+ * Dashboard-specific card that wraps CanvasCard with config-store
600
+ * subscription logic. Re-renders when the user edits and saves
601
+ * the dashboard layout.
602
+ */
603
+ declare function DashboardCard({ config: originalConfig, onView, toolCallId, }: F0ChatReportCardProps): JSX_2.Element;
604
+
605
+ declare namespace DashboardCard {
606
+ var displayName: string;
607
+ }
608
+
551
609
  export declare interface DashboardFetchSpec {
552
610
  fetch: Array<{
553
611
  toolId: string;
@@ -971,6 +1029,12 @@ export declare const defaultTranslations: {
971
1029
  readonly dataDownload: {
972
1030
  readonly download: "Download {{format}}";
973
1031
  };
1032
+ readonly pong: {
1033
+ readonly ai: "AI";
1034
+ readonly you: "YOU";
1035
+ readonly youWin: "You win!";
1036
+ readonly youLose: "You lose!";
1037
+ };
974
1038
  readonly growth: {
975
1039
  readonly demoCard: {
976
1040
  readonly title: "See {{moduleName}} in action";
@@ -1395,29 +1459,19 @@ declare const F0AuraVoiceAnimationVariants: (props?: ({
1395
1459
  })) | undefined) => string;
1396
1460
 
1397
1461
  /**
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.
1462
+ * @deprecated Use `DashboardCard` from `canvas/entities/dashboard` directly.
1463
+ * This re-export exists for backwards compatibility.
1406
1464
  */
1407
- export declare function F0ChatReportCard({ config: originalConfig, onView, toolCallId, }: F0ChatReportCardProps): JSX_2.Element;
1408
-
1409
- export declare namespace F0ChatReportCard {
1410
- var displayName: string;
1411
- }
1465
+ export declare const F0ChatReportCard: typeof DashboardCard;
1412
1466
 
1413
- export declare interface F0ChatReportCardProps {
1467
+ export declare type F0ChatReportCardProps = {
1414
1468
  /** The original dashboard config from the agent */
1415
1469
  config: ChatDashboardConfig;
1416
1470
  /** Callback when the user clicks the card to view the report */
1417
1471
  onView: (config: ChatDashboardConfig) => void;
1418
1472
  /** Tool call ID used to look up saved (edited) dashboard configs */
1419
1473
  toolCallId?: string;
1420
- }
1474
+ };
1421
1475
 
1422
1476
  /**
1423
1477
  * Component that renders an optional markdown preview followed by
@@ -1661,6 +1715,12 @@ declare interface GaugeComputation {
1661
1715
  name?: string;
1662
1716
  }
1663
1717
 
1718
+ /**
1719
+ * Look up a registered entity definition by content type.
1720
+ * Returns `undefined` if the type hasn't been registered.
1721
+ */
1722
+ export declare function getCanvasEntity(type: string): CanvasEntityDefinition<any> | undefined;
1723
+
1664
1724
  export declare function H1({ children, ...props }: React.HTMLAttributes<HTMLHeadingElement>): JSX_2.Element;
1665
1725
 
1666
1726
  export declare function H2({ children, ...props }: React.HTMLAttributes<HTMLHeadingElement>): JSX_2.Element;
@@ -1806,6 +1866,12 @@ declare interface RadarComputation {
1806
1866
  sortOrder?: "asc" | "desc";
1807
1867
  }
1808
1868
 
1869
+ /**
1870
+ * Register a canvas entity definition.
1871
+ * Called as a side-effect when each entity module is imported.
1872
+ */
1873
+ export declare function registerCanvasEntity<T extends CanvasContentBase>(definition: CanvasEntityDefinition<T>): void;
1874
+
1809
1875
  export declare function Strong({ children, ...props }: React.HTMLAttributes<HTMLSpanElement>): JSX_2.Element;
1810
1876
 
1811
1877
  export declare function Table({ children, ...props }: React.HTMLAttributes<HTMLTableElement>): JSX_2.Element;
@@ -1960,8 +2026,10 @@ declare module "@tiptap/core" {
1960
2026
 
1961
2027
  declare module "@tiptap/core" {
1962
2028
  interface Commands<ReturnType> {
1963
- transcript: {
1964
- insertTranscript: (data: TranscriptData) => ReturnType;
2029
+ videoEmbed: {
2030
+ setVideoEmbed: (options: {
2031
+ src: string;
2032
+ }) => ReturnType;
1965
2033
  };
1966
2034
  }
1967
2035
  }
@@ -1969,10 +2037,8 @@ declare module "@tiptap/core" {
1969
2037
 
1970
2038
  declare module "@tiptap/core" {
1971
2039
  interface Commands<ReturnType> {
1972
- videoEmbed: {
1973
- setVideoEmbed: (options: {
1974
- src: string;
1975
- }) => ReturnType;
2040
+ transcript: {
2041
+ insertTranscript: (data: TranscriptData) => ReturnType;
1976
2042
  };
1977
2043
  }
1978
2044
  }
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-CBy7rZCW.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-BvAjbJKj.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
  };
@@ -2621,6 +2621,12 @@ declare const defaultTranslations: {
2621
2621
  readonly dataDownload: {
2622
2622
  readonly download: "Download {{format}}";
2623
2623
  };
2624
+ readonly pong: {
2625
+ readonly ai: "AI";
2626
+ readonly you: "YOU";
2627
+ readonly youWin: "You win!";
2628
+ readonly youLose: "You lose!";
2629
+ };
2624
2630
  readonly growth: {
2625
2631
  readonly demoCard: {
2626
2632
  readonly title: "See {{moduleName}} in action";
@@ -7165,8 +7171,10 @@ declare module "@tiptap/core" {
7165
7171
 
7166
7172
  declare module "@tiptap/core" {
7167
7173
  interface Commands<ReturnType> {
7168
- transcript: {
7169
- insertTranscript: (data: TranscriptData) => ReturnType;
7174
+ videoEmbed: {
7175
+ setVideoEmbed: (options: {
7176
+ src: string;
7177
+ }) => ReturnType;
7170
7178
  };
7171
7179
  }
7172
7180
  }
@@ -7174,10 +7182,8 @@ declare module "@tiptap/core" {
7174
7182
 
7175
7183
  declare module "@tiptap/core" {
7176
7184
  interface Commands<ReturnType> {
7177
- videoEmbed: {
7178
- setVideoEmbed: (options: {
7179
- src: string;
7180
- }) => ReturnType;
7185
+ transcript: {
7186
+ insertTranscript: (data: TranscriptData) => ReturnType;
7181
7187
  };
7182
7188
  }
7183
7189
  }