@factorialco/f0-react 6.92.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-B5AL0nrd.js → ChatPdfThumbnail-CPl0nss6.js} +1 -1
  2. package/dist/{CoachmarkProvider-BvHCC6U-.js → CoachmarkProvider-BWN-lnib.js} +18779 -18560
  3. package/dist/{DocumentToolbar-Z04LbjLe.js → DocumentToolbar-DXwHOIRR.js} +2 -2
  4. package/dist/{DocxViewer-DatEcuPj.js → DocxViewer-Bq8rtoGl.js} +2 -2
  5. package/dist/{F0AiProcessingOverlay-CIBXF0aA.js → F0AiProcessingOverlay-CnPJe6l9.js} +3029 -2971
  6. package/dist/{F0CanvasPanel-BYk37H3S.js → F0CanvasPanel-CRfRDRcY.js} +30014 -29695
  7. package/dist/{F0VideoPlayer-ivv-8jRS.js → F0VideoPlayer-YejLcqsl.js} +1 -1
  8. package/dist/{LocationMap-DJV-K2nH.js → LocationMap-BB6ejEpS.js} +1 -1
  9. package/dist/{SheetViewer-DOPXx5v-.js → SheetViewer-ENbTiiHW.js} +2 -2
  10. package/dist/{TextViewer-CLD0qUx1.js → TextViewer-ClU-D6hJ.js} +2 -2
  11. package/dist/ai.d.ts +94 -13
  12. package/dist/ai.js +2 -2
  13. package/dist/component-status.d.ts +8 -8
  14. package/dist/component-status.js +1 -1
  15. package/dist/{experimental-CjCTiapX.js → experimental-BSasmmWC.js} +14488 -14341
  16. package/dist/experimental.d.ts +19 -10
  17. package/dist/experimental.js +35 -35
  18. package/dist/f0.d.ts +106 -20
  19. package/dist/f0.js +10554 -10458
  20. package/dist/i18n-provider-defaults.d.ts +10 -8
  21. package/dist/i18n-provider-defaults.js +5 -0
  22. package/dist/{index-C2ylL84h.js → index-BO9XpVCw.js} +3 -3
  23. package/dist/index-CjympfBT.js +4 -0
  24. package/dist/{pdfWorker-vVxORhXo.js → pdfWorker-BlHUxQSr.js} +2 -2
  25. package/package.json +2 -2
  26. package/dist/index-Bl4ay97j.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-BYk37H3S.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-CjCTiapX.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-BYk37H3S.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-Z04LbjLe.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-BYk37H3S.js";
4
- import { u as y, D as g } from "./DocumentToolbar-Z04LbjLe.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?";
@@ -1135,6 +1168,9 @@ declare type CanvasCardAction = {
1135
1168
  hideLabel?: boolean;
1136
1169
  };
1137
1170
 
1171
+ /** The card's own control: open/close, or the host's custom action. */
1172
+ declare const CanvasCardAction: ({ action, isActive, }: Pick<F0CanvasCardProps, "action" | "isActive">) => JSX_2.Element | null;
1173
+
1138
1174
  declare type CanvasCardAvatar = {
1139
1175
  type: "module";
1140
1176
  module: ModuleId;
@@ -1146,6 +1182,9 @@ declare type CanvasCardAvatar = {
1146
1182
  icon: IconType;
1147
1183
  };
1148
1184
 
1185
+ /** Whichever avatar the card was given: a module, a file, or an icon. */
1186
+ declare const CanvasCardAvatar: ({ avatar }: Pick<F0CanvasCardProps, "avatar">) => JSX_2.Element | null;
1187
+
1149
1188
  /**
1150
1189
  * Discriminated union for canvas panel content.
1151
1190
  * Add new entity types to this union as they are implemented.
@@ -2544,6 +2583,8 @@ export declare const defaultTranslations: {
2544
2583
  readonly thoughtsGroupTitle: "Reasoning";
2545
2584
  readonly resourcesGroupTitle: "Resources";
2546
2585
  readonly thinking: "Thinking...";
2586
+ readonly thinkingElapsedSeconds: "{{seconds}}s";
2587
+ readonly thinkingElapsedMinutes: "{{minutes}}m {{seconds}}s";
2547
2588
  readonly feedbackModal: {
2548
2589
  readonly positive: {
2549
2590
  readonly title: "What did you like about this response?";
@@ -3349,7 +3390,7 @@ export declare type ExpenseProfile = {
3349
3390
  status?: string;
3350
3391
  };
3351
3392
 
3352
- export declare const F0ActionItem: ({ title, status, inGroup }: F0ActionItemProps) => JSX_2.Element;
3393
+ export declare const F0ActionItem: ({ title, suffix, status, inGroup, }: F0ActionItemProps) => JSX_2.Element;
3353
3394
 
3354
3395
  /**
3355
3396
  * Props for the F0ActionItem component
@@ -3359,6 +3400,14 @@ export declare interface F0ActionItemProps {
3359
3400
  * The title text displayed next to the status icon
3360
3401
  */
3361
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;
3362
3411
  /**
3363
3412
  * Current status of the action item
3364
3413
  */
@@ -3393,7 +3442,9 @@ export declare const F0AiChatCreditsButton: ({ credits, employeeCredits, trigger
3393
3442
  * - legacy: title is static; a "new chat" button is shown when `hasMessages`.
3394
3443
  * Hosts can add header actions that F0 renders alongside the built-in controls.
3395
3444
  *
3396
- * 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.
3397
3448
  */
3398
3449
  export declare const F0AiChatHeader: ({ historyEnabled, title, currentThreadTitle, fullscreen, lockVisualizationMode, onToggleVisualizationMode, onClose, onNewChat, onOpenHistory, hasMessages, credits, employeeCredits, compact, actions, }: F0AiChatHeaderProps) => JSX_2.Element;
3399
3450
 
@@ -5155,6 +5206,22 @@ export declare type OneIconSize = (typeof oneIconSizes)[number];
5155
5206
 
5156
5207
  export declare const oneIconSizes: readonly ["xs", "sm", "md", "lg"];
5157
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
+
5158
5225
  declare type PathsToStringProps<T> = T extends string ? [] : {
5159
5226
  [K in Extract<keyof T, string>]: [K, ...PathsToStringProps<T[K]>];
5160
5227
  }[Extract<keyof T, string>];
@@ -5294,6 +5361,14 @@ export declare type RenderableTurn = {
5294
5361
  * the last item is `executing` while the rest are `completed`.
5295
5362
  */
5296
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;
5297
5372
  };
5298
5373
  /** Messages rendered after the thinking section (assistant replies). */
5299
5374
  assistantMessages: Message[];
@@ -5452,6 +5527,12 @@ export declare type ThinkingProps = {
5452
5527
  * every item renders as `completed` regardless of `inProgress`.
5453
5528
  */
5454
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;
5455
5536
  };
5456
5537
 
5457
5538
  export declare interface ThreadActionHandlers {
@@ -5785,11 +5866,9 @@ declare namespace Calendar {
5785
5866
 
5786
5867
  declare module "@tiptap/core" {
5787
5868
  interface Commands<ReturnType> {
5788
- enhanceHighlight: {
5789
- setEnhanceHighlight: (from: number, to: number, options?: {
5790
- placeholder?: string;
5791
- }) => ReturnType;
5792
- clearEnhanceHighlight: () => ReturnType;
5869
+ aiBlock: {
5870
+ insertAIBlock: (data: AIBlockData, config: AIBlockConfig) => ReturnType;
5871
+ executeAIAction: (actionType: string, config: AIBlockConfig) => ReturnType;
5793
5872
  };
5794
5873
  }
5795
5874
  }
@@ -5807,9 +5886,11 @@ declare module "@tiptap/core" {
5807
5886
 
5808
5887
  declare module "@tiptap/core" {
5809
5888
  interface Commands<ReturnType> {
5810
- aiBlock: {
5811
- insertAIBlock: (data: AIBlockData, config: AIBlockConfig) => ReturnType;
5812
- executeAIAction: (actionType: string, config: AIBlockConfig) => ReturnType;
5889
+ enhanceHighlight: {
5890
+ setEnhanceHighlight: (from: number, to: number, options?: {
5891
+ placeholder?: string;
5892
+ }) => ReturnType;
5893
+ clearEnhanceHighlight: () => ReturnType;
5813
5894
  };
5814
5895
  }
5815
5896
  }
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-BYk37H3S.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-CIBXF0aA.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,
@@ -296,11 +296,9 @@ declare namespace Calendar {
296
296
 
297
297
  declare module "@tiptap/core" {
298
298
  interface Commands<ReturnType> {
299
- enhanceHighlight: {
300
- setEnhanceHighlight: (from: number, to: number, options?: {
301
- placeholder?: string;
302
- }) => ReturnType;
303
- clearEnhanceHighlight: () => ReturnType;
299
+ aiBlock: {
300
+ insertAIBlock: (data: AIBlockData, config: AIBlockConfig) => ReturnType;
301
+ executeAIAction: (actionType: string, config: AIBlockConfig) => ReturnType;
304
302
  };
305
303
  }
306
304
  }
@@ -318,9 +316,11 @@ declare module "@tiptap/core" {
318
316
 
319
317
  declare module "@tiptap/core" {
320
318
  interface Commands<ReturnType> {
321
- aiBlock: {
322
- insertAIBlock: (data: AIBlockData, config: AIBlockConfig) => ReturnType;
323
- executeAIAction: (actionType: string, config: AIBlockConfig) => ReturnType;
319
+ enhanceHighlight: {
320
+ setEnhanceHighlight: (from: number, to: number, options?: {
321
+ placeholder?: string;
322
+ }) => ReturnType;
323
+ clearEnhanceHighlight: () => ReturnType;
324
324
  };
325
325
  }
326
326
  }