@factorialco/f0-react 6.93.0 → 6.93.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.
Files changed (26) hide show
  1. package/dist/{ChatPdfThumbnail-DlJ8lMdS.js → ChatPdfThumbnail-CPl0nss6.js} +1 -1
  2. package/dist/{CoachmarkProvider-DiCvfQiv.js → CoachmarkProvider-BWN-lnib.js} +1 -1
  3. package/dist/{DocumentToolbar-DNQcONeP.js → DocumentToolbar-DXwHOIRR.js} +2 -2
  4. package/dist/{DocxViewer-CD5LOQ0C.js → DocxViewer-Bq8rtoGl.js} +2 -2
  5. package/dist/{F0AiProcessingOverlay-Ki2lYT6_.js → F0AiProcessingOverlay-CnPJe6l9.js} +3206 -3163
  6. package/dist/{F0CanvasPanel-CfmcbyHH.js → F0CanvasPanel-CRfRDRcY.js} +28170 -28049
  7. package/dist/{F0VideoPlayer-B0yLBZ02.js → F0VideoPlayer-YejLcqsl.js} +1 -1
  8. package/dist/{LocationMap-DdflrLnM.js → LocationMap-BB6ejEpS.js} +1 -1
  9. package/dist/{SheetViewer-BB5R4ynJ.js → SheetViewer-ENbTiiHW.js} +2 -2
  10. package/dist/{TextViewer-CNVtakjJ.js → TextViewer-ClU-D6hJ.js} +2 -2
  11. package/dist/ai.d.ts +94 -19
  12. package/dist/ai.js +2 -2
  13. package/dist/component-status.d.ts +14 -14
  14. package/dist/component-status.js +1 -1
  15. package/dist/{experimental-BiC_8-Mj.js → experimental-BSasmmWC.js} +12237 -12135
  16. package/dist/experimental.d.ts +25 -16
  17. package/dist/experimental.js +35 -35
  18. package/dist/f0.d.ts +94 -19
  19. package/dist/f0.js +10 -10
  20. package/dist/i18n-provider-defaults.d.ts +16 -14
  21. package/dist/i18n-provider-defaults.js +5 -0
  22. package/dist/{index-B4q9e6bP.js → index-BO9XpVCw.js} +3 -3
  23. package/dist/index-CjympfBT.js +4 -0
  24. package/dist/{pdfWorker-BXbqwWmI.js → pdfWorker-BlHUxQSr.js} +2 -2
  25. package/package.json +2 -2
  26. package/dist/index-2T_ZqKWj.js +0 -4
@@ -1,4 +1,4 @@
1
- import { u as W, t as je, v as Ge, m as $, x as Xe, y as Ze, z as qe, A as Ye, B as Je, E as Qe, G as et, H as tt, J as nt, K as rt, L as at, M as ot, N as ye, O as st, Q as Ce, l as it, R as ct, U as lt, V as ut, w as dt, r as ft } from "./F0CanvasPanel-CfmcbyHH.js";
1
+ import { u as W, t as je, v as Ge, m as $, x as Xe, y as Ze, z as qe, A as Ye, B as Je, E as Qe, G as et, H as tt, J as nt, K as rt, L as at, M as ot, N as ye, O as st, Q as Ce, l as it, R as ct, U as lt, V as ut, w as dt, r as ft } from "./F0CanvasPanel-CRfRDRcY.js";
2
2
  import { jsxs as S, jsx as c } from "react/jsx-runtime";
3
3
  import { forwardRef as re, useId as mt, useState as x, useRef as F, useEffect as N, useMemo as J, useCallback as T } from "react";
4
4
  import { d as H, f as ue } from "./tooltip-CMBdJvJA.js";
@@ -1,5 +1,5 @@
1
1
  import { jsx as p } from "react/jsx-runtime";
2
- import { m } from "./experimental-BiC_8-Mj.js";
2
+ import { m } from "./experimental-BSasmmWC.js";
3
3
  import { useRef as l, useEffect as i, useState as b } from "react";
4
4
  const k = "https://tiles.openfreemap.org/styles/positron", y = "https://tiles.openfreemap.org/styles/dark", R = 15, d = (n) => {
5
5
  const [c, s] = b(!1);
@@ -1,8 +1,8 @@
1
1
  import { jsxs as a, jsx as r, Fragment as N } from "react/jsx-runtime";
2
2
  import { useState as i, useEffect as k } from "react";
3
- import { u as v, T as S, h as V, S as R } from "./F0CanvasPanel-CfmcbyHH.js";
3
+ import { u as v, T as S, h as V, S as R } from "./F0CanvasPanel-CRfRDRcY.js";
4
4
  import { f as z, c as E } from "./sheetPreview-Djc-YyVs.js";
5
- import { u as _, D as j } from "./DocumentToolbar-DNQcONeP.js";
5
+ import { u as _, D as j } from "./DocumentToolbar-DXwHOIRR.js";
6
6
  const g = 1e3, F = 100, G = ({
7
7
  url: n,
8
8
  filename: y,
@@ -1,7 +1,7 @@
1
1
  import { jsxs as b, jsx as e } from "react/jsx-runtime";
2
2
  import { useState as _, useEffect as h } from "react";
3
- import { u as x, S as p, p as w } from "./F0CanvasPanel-CfmcbyHH.js";
4
- import { u as y, D as g } from "./DocumentToolbar-DNQcONeP.js";
3
+ import { u as x, S as p, p as w } from "./F0CanvasPanel-CRfRDRcY.js";
4
+ import { u as y, D as g } from "./DocumentToolbar-DXwHOIRR.js";
5
5
  const k = 2 * 1024 * 1024, v = [
6
6
  "[&_h1]:mb-3 [&_h1]:mt-6 [&_h1]:text-2xl [&_h1]:font-semibold",
7
7
  "[&_h2]:mb-2 [&_h2]:mt-5 [&_h2]:text-xl [&_h2]:font-semibold",
package/dist/ai.d.ts CHANGED
@@ -308,8 +308,15 @@ export declare type AiChatProviderProps = {
308
308
  welcomeScreenCards?: F0AiChatWelcomeCard[];
309
309
  disclaimer?: AiChatDisclaimer;
310
310
  /**
311
- * Enable resizable chat window
312
- * When enabled, the chat can be resized between 300px and 50% of the screen width
311
+ * Enable the panel's drag-to-resize seam.
312
+ *
313
+ * The width is bounded by the room the frame actually has, not by a flat
314
+ * number: 300–712px while there is space for both, then whatever leaves the
315
+ * main content its minimum, then an even split. Narrower still and the panel
316
+ * covers the frame rather than splitting it. See `utils/panelWidth.ts`.
317
+ *
318
+ * The width the user drags to is remembered; a narrow window only shrinks
319
+ * what is displayed, so widening it again restores their choice.
313
320
  */
314
321
  resizable?: boolean;
315
322
  /**
@@ -454,7 +461,8 @@ declare type AiChatProviderReturnValue = {
454
461
  }) => void;
455
462
  tracking?: AiChatTrackingOptions;
456
463
  /**
457
- * Current width of the chat window (for resizable mode)
464
+ * The user's preferred width, persisted against the absolute range. This is
465
+ * NOT what the layout reserves — read `effectiveChatWidth` for that.
458
466
  */
459
467
  chatWidth: number;
460
468
  setChatWidth: React.Dispatch<React.SetStateAction<number>>;
@@ -462,6 +470,29 @@ declare type AiChatProviderReturnValue = {
462
470
  * Reset the chat width to the default value (360px)
463
471
  */
464
472
  resetChatWidth: () => void;
473
+ /**
474
+ * `chatWidth` held inside what the measured frame can actually give it. The
475
+ * preference survives a narrow window; only this shrinks.
476
+ *
477
+ * OPTIONAL for the same reason as `isResizing` below: the provider always
478
+ * supplies it, but making it required reads as a breaking public-API change.
479
+ */
480
+ effectiveChatWidth?: number;
481
+ /** The range the panel may be dragged to at the frame's current width. */
482
+ chatWidthBounds?: PanelBounds;
483
+ /**
484
+ * True when the panel covers the frame rather than sitting beside it.
485
+ *
486
+ * Read this instead of re-deriving it from a media query: the rule combines
487
+ * the measured frame with the pointer type, and two consumers computing it
488
+ * separately is how a resize handle ends up on a full-screen panel.
489
+ */
490
+ panelOverlays?: boolean;
491
+ /**
492
+ * Publishes the frame's content-box width. Called by ApplicationFrame, which
493
+ * is the only thing that knows how much room is left beside the navigation.
494
+ */
495
+ setFrameWidth?: (width: number) => void;
465
496
  /**
466
497
  * True while the user is dragging the chat's resize handle. Broadcast here
467
498
  * because everything laid out against the chat's edge has to follow the drag
@@ -734,6 +765,8 @@ export declare const aiTranslations: {
734
765
  readonly thoughtsGroupTitle: "Reasoning";
735
766
  readonly resourcesGroupTitle: "Resources";
736
767
  readonly thinking: "Thinking...";
768
+ readonly thinkingElapsedSeconds: "{{seconds}}s";
769
+ readonly thinkingElapsedMinutes: "{{minutes}}m {{seconds}}s";
737
770
  readonly feedbackModal: {
738
771
  readonly positive: {
739
772
  readonly title: "What did you like about this response?";
@@ -2550,6 +2583,8 @@ export declare const defaultTranslations: {
2550
2583
  readonly thoughtsGroupTitle: "Reasoning";
2551
2584
  readonly resourcesGroupTitle: "Resources";
2552
2585
  readonly thinking: "Thinking...";
2586
+ readonly thinkingElapsedSeconds: "{{seconds}}s";
2587
+ readonly thinkingElapsedMinutes: "{{minutes}}m {{seconds}}s";
2553
2588
  readonly feedbackModal: {
2554
2589
  readonly positive: {
2555
2590
  readonly title: "What did you like about this response?";
@@ -3355,7 +3390,7 @@ export declare type ExpenseProfile = {
3355
3390
  status?: string;
3356
3391
  };
3357
3392
 
3358
- export declare const F0ActionItem: ({ title, status, inGroup }: F0ActionItemProps) => JSX_2.Element;
3393
+ export declare const F0ActionItem: ({ title, suffix, status, inGroup, }: F0ActionItemProps) => JSX_2.Element;
3359
3394
 
3360
3395
  /**
3361
3396
  * Props for the F0ActionItem component
@@ -3365,6 +3400,14 @@ export declare interface F0ActionItemProps {
3365
3400
  * The title text displayed next to the status icon
3366
3401
  */
3367
3402
  title?: string;
3403
+ /**
3404
+ * Rendered inline after the title — used for the elapsed-time counter.
3405
+ *
3406
+ * A node rather than a string so that whatever ticks inside it owns its own
3407
+ * state: passing a composed label would re-render this item, and everything
3408
+ * above it, on every tick.
3409
+ */
3410
+ suffix?: ReactNode;
3368
3411
  /**
3369
3412
  * Current status of the action item
3370
3413
  */
@@ -3399,7 +3442,9 @@ export declare const F0AiChatCreditsButton: ({ credits, employeeCredits, trigger
3399
3442
  * - legacy: title is static; a "new chat" button is shown when `hasMessages`.
3400
3443
  * Hosts can add header actions that F0 renders alongside the built-in controls.
3401
3444
  *
3402
- * Decoupled from CopilotKit and `useAiChat()` — everything via props.
3445
+ * Decoupled from CopilotKit, and prop-driven apart from one read: whether the
3446
+ * panel is currently covering the frame, which decides if expanding means
3447
+ * anything. Only the provider knows that, and it answers safely when absent.
3403
3448
  */
3404
3449
  export declare const F0AiChatHeader: ({ historyEnabled, title, currentThreadTitle, fullscreen, lockVisualizationMode, onToggleVisualizationMode, onClose, onNewChat, onOpenHistory, hasMessages, credits, employeeCredits, compact, actions, }: F0AiChatHeaderProps) => JSX_2.Element;
3405
3450
 
@@ -5161,6 +5206,22 @@ export declare type OneIconSize = (typeof oneIconSizes)[number];
5161
5206
 
5162
5207
  export declare const oneIconSizes: readonly ["xs", "sm", "md", "lg"];
5163
5208
 
5209
+ declare type PanelBounds = {
5210
+ min: number;
5211
+ /** How far a deliberate drag may go — bounded by the content's hard floor. */
5212
+ max: number;
5213
+ /**
5214
+ * Where the panel sits when the user has not said otherwise: the content
5215
+ * keeps `mainMin` and the panel takes what is left, down to `min`.
5216
+ *
5217
+ * Separate from `max` so that "served the content first" is the default
5218
+ * without also being a cage — see `resolvePanelWidth`.
5219
+ */
5220
+ autoMax: number;
5221
+ /** The frame is too narrow to split: the panel should cover it instead. */
5222
+ shouldOverlay: boolean;
5223
+ };
5224
+
5164
5225
  declare type PathsToStringProps<T> = T extends string ? [] : {
5165
5226
  [K in Extract<keyof T, string>]: [K, ...PathsToStringProps<T[K]>];
5166
5227
  }[Extract<keyof T, string>];
@@ -5300,6 +5361,14 @@ export declare type RenderableTurn = {
5300
5361
  * the last item is `executing` while the rest are `completed`.
5301
5362
  */
5302
5363
  isWriting?: boolean;
5364
+ /**
5365
+ * Epoch ms for when the turn actually started thinking, if the host knows.
5366
+ *
5367
+ * Optional anchor, not a requirement: turns arrive with no timestamps, so
5368
+ * by default the elapsed counter starts when F0 first saw the signal.
5369
+ * Supplying this makes it survive a reload mid-stream.
5370
+ */
5371
+ startedAt?: number;
5303
5372
  };
5304
5373
  /** Messages rendered after the thinking section (assistant replies). */
5305
5374
  assistantMessages: Message[];
@@ -5458,6 +5527,12 @@ export declare type ThinkingProps = {
5458
5527
  * every item renders as `completed` regardless of `inProgress`.
5459
5528
  */
5460
5529
  isWriting?: boolean;
5530
+ /**
5531
+ * When the turn started thinking, from `useThinkingClock`. Drives the
5532
+ * elapsed counter on whichever step is executing. `null` means no clock is
5533
+ * running, and nothing is rendered.
5534
+ */
5535
+ startedAt?: number | null;
5461
5536
  };
5462
5537
 
5463
5538
  export declare interface ThreadActionHandlers {
@@ -5801,11 +5876,9 @@ declare module "@tiptap/core" {
5801
5876
 
5802
5877
  declare module "@tiptap/core" {
5803
5878
  interface Commands<ReturnType> {
5804
- enhanceHighlight: {
5805
- setEnhanceHighlight: (from: number, to: number, options?: {
5806
- placeholder?: string;
5807
- }) => ReturnType;
5808
- clearEnhanceHighlight: () => ReturnType;
5879
+ fontSize: {
5880
+ setFontSize: (fontSize: string) => ReturnType;
5881
+ unsetFontSize: () => ReturnType;
5809
5882
  };
5810
5883
  }
5811
5884
  }
@@ -5813,9 +5886,11 @@ declare module "@tiptap/core" {
5813
5886
 
5814
5887
  declare module "@tiptap/core" {
5815
5888
  interface Commands<ReturnType> {
5816
- fontSize: {
5817
- setFontSize: (fontSize: string) => ReturnType;
5818
- unsetFontSize: () => ReturnType;
5889
+ enhanceHighlight: {
5890
+ setEnhanceHighlight: (from: number, to: number, options?: {
5891
+ placeholder?: string;
5892
+ }) => ReturnType;
5893
+ clearEnhanceHighlight: () => ReturnType;
5819
5894
  };
5820
5895
  }
5821
5896
  }
@@ -5843,10 +5918,8 @@ declare module "@tiptap/core" {
5843
5918
 
5844
5919
  declare module "@tiptap/core" {
5845
5920
  interface Commands<ReturnType> {
5846
- videoEmbed: {
5847
- setVideoEmbed: (options: {
5848
- src: string;
5849
- }) => ReturnType;
5921
+ transcript: {
5922
+ insertTranscript: (data: TranscriptData) => ReturnType;
5850
5923
  };
5851
5924
  }
5852
5925
  }
@@ -5854,8 +5927,10 @@ declare module "@tiptap/core" {
5854
5927
 
5855
5928
  declare module "@tiptap/core" {
5856
5929
  interface Commands<ReturnType> {
5857
- transcript: {
5858
- insertTranscript: (data: TranscriptData) => ReturnType;
5930
+ videoEmbed: {
5931
+ setVideoEmbed: (options: {
5932
+ src: string;
5933
+ }) => ReturnType;
5859
5934
  };
5860
5935
  }
5861
5936
  }
package/dist/ai.js CHANGED
@@ -1,6 +1,6 @@
1
- import { C as e, D as r, c as t, F as i, a as o, f as n, g as F, d as C, e as l, I as A, P as d, b as u, u as h } from "./F0CanvasPanel-CfmcbyHH.js";
1
+ import { C as e, D as r, c as t, F as i, a as o, f as n, g as F, d as C, e as l, I as A, P as d, b as u, u as h } from "./F0CanvasPanel-CRfRDRcY.js";
2
2
  import { defaultTranslations as c } from "./i18n-provider-defaults.js";
3
- import { A as P, C as T, t as p, s as v, v as g, y as f, l as y, i as S, q as x, z as b, B as k, p as H, r as O, j as V, e as w, g as B, k as M, F as z, T as D, w as L, h as j, a as q, n as E, m as G, o as R, b as J, f as K, x as N, c as Q, d as U, u as W } from "./F0AiProcessingOverlay-Ki2lYT6_.js";
3
+ import { A as P, C as T, t as p, s as v, v as g, y as f, l as y, i as S, q as x, z as b, B as k, p as H, r as O, j as V, e as w, g as B, k as M, F as z, T as D, w as L, h as j, a as q, n as E, m as G, o as R, b as J, f as K, x as N, c as Q, d as U, u as W } from "./F0AiProcessingOverlay-CnPJe6l9.js";
4
4
  export {
5
5
  P as AiChatTranslationsProvider,
6
6
  e as ChatSpinner,
@@ -306,11 +306,9 @@ declare module "@tiptap/core" {
306
306
 
307
307
  declare module "@tiptap/core" {
308
308
  interface Commands<ReturnType> {
309
- enhanceHighlight: {
310
- setEnhanceHighlight: (from: number, to: number, options?: {
311
- placeholder?: string;
312
- }) => ReturnType;
313
- clearEnhanceHighlight: () => ReturnType;
309
+ fontSize: {
310
+ setFontSize: (fontSize: string) => ReturnType;
311
+ unsetFontSize: () => ReturnType;
314
312
  };
315
313
  }
316
314
  }
@@ -318,9 +316,11 @@ declare module "@tiptap/core" {
318
316
 
319
317
  declare module "@tiptap/core" {
320
318
  interface Commands<ReturnType> {
321
- fontSize: {
322
- setFontSize: (fontSize: string) => ReturnType;
323
- unsetFontSize: () => ReturnType;
319
+ enhanceHighlight: {
320
+ setEnhanceHighlight: (from: number, to: number, options?: {
321
+ placeholder?: string;
322
+ }) => ReturnType;
323
+ clearEnhanceHighlight: () => ReturnType;
324
324
  };
325
325
  }
326
326
  }
@@ -348,10 +348,8 @@ declare module "@tiptap/core" {
348
348
 
349
349
  declare module "@tiptap/core" {
350
350
  interface Commands<ReturnType> {
351
- videoEmbed: {
352
- setVideoEmbed: (options: {
353
- src: string;
354
- }) => ReturnType;
351
+ transcript: {
352
+ insertTranscript: (data: TranscriptData) => ReturnType;
355
353
  };
356
354
  }
357
355
  }
@@ -359,8 +357,10 @@ declare module "@tiptap/core" {
359
357
 
360
358
  declare module "@tiptap/core" {
361
359
  interface Commands<ReturnType> {
362
- transcript: {
363
- insertTranscript: (data: TranscriptData) => ReturnType;
360
+ videoEmbed: {
361
+ setVideoEmbed: (options: {
362
+ src: string;
363
+ }) => ReturnType;
364
364
  };
365
365
  }
366
366
  }