@factorialco/f0-react 6.93.1 → 6.95.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.
@@ -1,5 +1,5 @@
1
1
  import { jsx as p } from "react/jsx-runtime";
2
- import { m } from "./experimental-BSasmmWC.js";
2
+ import { m } from "./experimental-Cvo85WVw.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);
@@ -2,7 +2,7 @@ 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
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-DXwHOIRR.js";
5
+ import { u as _, D as j } from "./DocumentToolbar-FgoXK03w.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
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";
4
+ import { u as y, D as g } from "./DocumentToolbar-FgoXK03w.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
@@ -686,6 +686,8 @@ declare interface AiChatState {
686
686
  tracking?: AiChatTrackingOptions;
687
687
  }
688
688
 
689
+ export declare type AiChatTextAreaUsageLimits = Pick<F0AiChatUsageLimitsButtonProps, "usage" | "error" | "onOpenChange">;
690
+
689
691
  export declare type AiChatTrackingOptions = {
690
692
  onVisibility?: () => void;
691
693
  onClose?: () => void;
@@ -713,6 +715,32 @@ export declare interface AiChatTranslationsProviderProps {
713
715
  translations: AiChatTranslations;
714
716
  }
715
717
 
718
+ /**
719
+ * Host-resolved numbers for `F0AiChatUsageLimitsButton`. Percentages only: the
720
+ * product avoids credit counts in the chat.
721
+ */
722
+ export declare type AiChatUsageLimits = {
723
+ /** The viewer's own allowance, 0–100. */
724
+ usedPercentage: number;
725
+ /** Already localized, e.g. "Resets in 3h 6m". */
726
+ description?: string;
727
+ unlimited?: boolean;
728
+ /** Extra rows below a divider, typically for admins. */
729
+ sections?: AiChatUsageLimitsSection[];
730
+ /** Renders the "Your company" row. */
731
+ onSeeCompany?: () => void;
732
+ };
733
+
734
+ export declare type AiChatUsageLimitsSection = {
735
+ id: string;
736
+ /** Already localized. */
737
+ label: string;
738
+ /** Already localized, e.g. "Renews Sep 4". */
739
+ description?: string;
740
+ usedPercentage: number;
741
+ unlimited?: boolean;
742
+ };
743
+
716
744
  export declare type AiInsightCardContent = {
717
745
  content: "text";
718
746
  } | {
@@ -816,6 +844,13 @@ export declare const aiTranslations: {
816
844
  readonly upgradePlan: "Upgrade";
817
845
  readonly needMoreCredits: "Need more credits?";
818
846
  };
847
+ readonly usageLimits: {
848
+ readonly title: "Personal allowance";
849
+ readonly used: "{{percentage}}% used";
850
+ readonly yourCompany: "Your company";
851
+ readonly unlimited: "Unlimited";
852
+ readonly error: "Could not load usage";
853
+ };
819
854
  readonly reportCard: {
820
855
  readonly tableLabel: "Table";
821
856
  readonly openButton: "Open";
@@ -2634,6 +2669,13 @@ export declare const defaultTranslations: {
2634
2669
  readonly upgradePlan: "Upgrade";
2635
2670
  readonly needMoreCredits: "Need more credits?";
2636
2671
  };
2672
+ readonly usageLimits: {
2673
+ readonly title: "Personal allowance";
2674
+ readonly used: "{{percentage}}% used";
2675
+ readonly yourCompany: "Your company";
2676
+ readonly unlimited: "Unlimited";
2677
+ readonly error: "Could not load usage";
2678
+ };
2637
2679
  readonly reportCard: {
2638
2680
  readonly tableLabel: "Table";
2639
2681
  readonly openButton: "Open";
@@ -3577,7 +3619,7 @@ export declare const F0AiChatProvider: ({ enabled, side, panelContentSide, initi
3577
3619
  * coupling to `useAiChat()` or CopilotKit — wrappers like F0AiChat
3578
3620
  * provide the wiring.
3579
3621
  */
3580
- export declare const F0AiChatTextArea: ({ onSubmit, onStop, inProgress, onBeforeSubmit, placeholders, creditWarning, clarifyingUI, pendingContext, onPendingContextChange, pendingQuote, onPendingQuoteChange, fileAttachments, toolbarStart, onTranscribe, searchPersons, onProcessFilesRef, disclaimer, footer, isWelcomeScreen, fullscreen, welcomeScreenSuggestions, onSuggestionClick, welcomeScreenSuggestionsPlacement, welcomeScreenSuggestionsCollapsedByDefault, welcomeScreenCards, padding, ref, }: F0AiChatTextAreaProps) => JSX_2.Element;
3622
+ export declare const F0AiChatTextArea: ({ onSubmit, onStop, inProgress, onBeforeSubmit, placeholders, creditWarning, clarifyingUI, pendingContext, onPendingContextChange, pendingQuote, onPendingQuoteChange, fileAttachments, toolbarStart, onTranscribe, searchPersons, onProcessFilesRef, disclaimer, usageLimits, footer, isWelcomeScreen, fullscreen, welcomeScreenSuggestions, onSuggestionClick, welcomeScreenSuggestionsPlacement, welcomeScreenSuggestionsCollapsedByDefault, welcomeScreenCards, padding, ref, }: F0AiChatTextAreaProps) => JSX_2.Element;
3581
3623
 
3582
3624
  export declare type F0AiChatTextAreaProps = {
3583
3625
  ref: RefObject<HTMLDivElement>;
@@ -3641,6 +3683,8 @@ export declare type F0AiChatTextAreaProps = {
3641
3683
  * the welcome screen of the fullscreen layout to give the footer room.
3642
3684
  */
3643
3685
  disclaimer?: AiChatDisclaimer;
3686
+ /** Usage ring at the right end of the disclaimer row; the text then aligns left. */
3687
+ usageLimits?: AiChatTextAreaUsageLimits;
3644
3688
  /**
3645
3689
  * Optional footer (e.g. powered-by, legal copy) rendered below the
3646
3690
  * textarea on the welcome screen.
@@ -3782,6 +3826,25 @@ export declare type F0AiChatTextAreaSubmitPayload = {
3782
3826
  quote: PendingQuote | null;
3783
3827
  };
3784
3828
 
3829
+ /**
3830
+ * Headless usage-limits popover with its ring trigger. `F0AiChatTextArea`
3831
+ * renders it from its `usageLimits` prop.
3832
+ */
3833
+ export declare const F0AiChatUsageLimitsButton: ({ usage, error, onOpenChange, trigger, side, }: F0AiChatUsageLimitsButtonProps) => JSX_2.Element;
3834
+
3835
+ export declare interface F0AiChatUsageLimitsButtonProps {
3836
+ /** `null` while loading: empty ring, skeleton in the popover. */
3837
+ usage: AiChatUsageLimits | null;
3838
+ /** Shows an error line instead of the rows. */
3839
+ error?: boolean;
3840
+ /** Hosts refetch on open. */
3841
+ onOpenChange?: (open: boolean) => void;
3842
+ /** Custom popover trigger (asChild). Defaults to the usage ring button. */
3843
+ trigger?: ReactNode;
3844
+ /** `"top"` suits the composer row; use `"bottom"` from a header. */
3845
+ side?: UsageLimitsPopoverSide;
3846
+ }
3847
+
3785
3848
  /**
3786
3849
  * A card shown below the composer on the fullscreen welcome screen, rendered
3787
3850
  * as an `F0CardHorizontal`. Each card owns its behavior via `onClick`, so
@@ -5616,6 +5679,10 @@ export declare type UploadedFile = {
5616
5679
  mimetype: string;
5617
5680
  };
5618
5681
 
5682
+ export declare type UsageLimitsPopoverSide = (typeof usageLimitsPopoverSides)[number];
5683
+
5684
+ export declare const usageLimitsPopoverSides: readonly ["top", "bottom"];
5685
+
5619
5686
  /**
5620
5687
  * Read the AiChat context. Returns an inert fallback when no provider
5621
5688
  * is mounted — that case is intentional in `ApplicationFrame`, which
@@ -5876,9 +5943,11 @@ declare module "@tiptap/core" {
5876
5943
 
5877
5944
  declare module "@tiptap/core" {
5878
5945
  interface Commands<ReturnType> {
5879
- fontSize: {
5880
- setFontSize: (fontSize: string) => ReturnType;
5881
- unsetFontSize: () => ReturnType;
5946
+ enhanceHighlight: {
5947
+ setEnhanceHighlight: (from: number, to: number, options?: {
5948
+ placeholder?: string;
5949
+ }) => ReturnType;
5950
+ clearEnhanceHighlight: () => ReturnType;
5882
5951
  };
5883
5952
  }
5884
5953
  }
@@ -5886,11 +5955,9 @@ declare module "@tiptap/core" {
5886
5955
 
5887
5956
  declare module "@tiptap/core" {
5888
5957
  interface Commands<ReturnType> {
5889
- enhanceHighlight: {
5890
- setEnhanceHighlight: (from: number, to: number, options?: {
5891
- placeholder?: string;
5892
- }) => ReturnType;
5893
- clearEnhanceHighlight: () => ReturnType;
5958
+ fontSize: {
5959
+ setFontSize: (fontSize: string) => ReturnType;
5960
+ unsetFontSize: () => ReturnType;
5894
5961
  };
5895
5962
  }
5896
5963
  }
@@ -5918,8 +5985,10 @@ declare module "@tiptap/core" {
5918
5985
 
5919
5986
  declare module "@tiptap/core" {
5920
5987
  interface Commands<ReturnType> {
5921
- transcript: {
5922
- insertTranscript: (data: TranscriptData) => ReturnType;
5988
+ videoEmbed: {
5989
+ setVideoEmbed: (options: {
5990
+ src: string;
5991
+ }) => ReturnType;
5923
5992
  };
5924
5993
  }
5925
5994
  }
@@ -5927,10 +5996,8 @@ declare module "@tiptap/core" {
5927
5996
 
5928
5997
  declare module "@tiptap/core" {
5929
5998
  interface Commands<ReturnType> {
5930
- videoEmbed: {
5931
- setVideoEmbed: (options: {
5932
- src: string;
5933
- }) => ReturnType;
5999
+ transcript: {
6000
+ insertTranscript: (data: TranscriptData) => ReturnType;
5934
6001
  };
5935
6002
  }
5936
6003
  }
package/dist/ai.js CHANGED
@@ -1,50 +1,52 @@
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";
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 m } 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-CnPJe6l9.js";
3
+ import { A as g, C as p, t as v, s as I, v as T, y as f, z as y, l as S, i as x, q as b, D as k, E as B, p as H, r as L, j as O, e as V, g as w, k as D, F as M, T as z, w as E, h as j, a as q, n as G, m as R, o as U, B as J, b as K, f as N, x as Q, c as W, d as X, u as Y } from "./F0AiProcessingOverlay-D6Y6MLaK.js";
4
4
  export {
5
- P as AiChatTranslationsProvider,
5
+ g as AiChatTranslationsProvider,
6
6
  e as ChatSpinner,
7
- T as CollapsibleGroup,
7
+ p as CollapsibleGroup,
8
8
  r as DropOverlay,
9
9
  t as F0ActionItem,
10
10
  i as F0AiChat,
11
- p as F0AiChatCreditsButton,
12
- v as F0AiChatHeader,
13
- g as F0AiChatHistory,
11
+ v as F0AiChatCreditsButton,
12
+ I as F0AiChatHeader,
13
+ T as F0AiChatHistory,
14
14
  o as F0AiChatProvider,
15
15
  f as F0AiChatTextArea,
16
- y as F0AiInsightCard,
17
- S as F0AiMask,
18
- x as F0AiMessageSources,
19
- b as F0AiMessagesContainer,
16
+ y as F0AiChatUsageLimitsButton,
17
+ S as F0AiInsightCard,
18
+ x as F0AiMask,
19
+ b as F0AiMessageSources,
20
+ k as F0AiMessagesContainer,
20
21
  n as F0AiPong,
21
- k as F0AiProcessingOverlay,
22
+ B as F0AiProcessingOverlay,
22
23
  H as F0AiProposalCard,
23
- O as F0AiTableCard,
24
- V as F0AuraVoiceAnimation,
25
- w as F0CanvasCard,
24
+ L as F0AiTableCard,
25
+ O as F0AuraVoiceAnimation,
26
+ V as F0CanvasCard,
26
27
  F as F0CanvasPanel,
27
- B as F0ClarifyingPanel,
28
- M as F0HILActionConfirmation,
28
+ w as F0ClarifyingPanel,
29
+ D as F0HILActionConfirmation,
29
30
  C as F0OneIcon,
30
31
  l as F0OneSwitch,
31
- z as FormCardValueFormatterProvider,
32
+ M as FormCardValueFormatterProvider,
32
33
  A as I18nProvider,
33
34
  d as PongBall,
34
- D as ThreadItem,
35
- L as ThreadListSkeleton,
35
+ z as ThreadItem,
36
+ E as ThreadListSkeleton,
36
37
  j as actionItemStatuses,
37
38
  q as aiTranslations,
38
- E as contentTypes,
39
+ G as contentTypes,
39
40
  c as defaultTranslations,
40
- G as markdownRenderers,
41
- R as oneIconSizes,
41
+ R as markdownRenderers,
42
+ U as oneIconSizes,
43
+ J as usageLimitsPopoverSides,
42
44
  u as useAiChat,
43
- J as useAiChatTranslations,
44
- K as useCanvasEntity,
45
- N as useChatHistory,
46
- Q as useFormCardValueFormatter,
47
- h as useI18n,
48
- U as useSetFormCardValueFormatter,
49
- W as useToolCallId
45
+ K as useAiChatTranslations,
46
+ N as useCanvasEntity,
47
+ Q as useChatHistory,
48
+ W as useFormCardValueFormatter,
49
+ m as useI18n,
50
+ X as useSetFormCardValueFormatter,
51
+ Y as useToolCallId
50
52
  };
@@ -306,9 +306,11 @@ declare module "@tiptap/core" {
306
306
 
307
307
  declare module "@tiptap/core" {
308
308
  interface Commands<ReturnType> {
309
- fontSize: {
310
- setFontSize: (fontSize: string) => ReturnType;
311
- unsetFontSize: () => ReturnType;
309
+ enhanceHighlight: {
310
+ setEnhanceHighlight: (from: number, to: number, options?: {
311
+ placeholder?: string;
312
+ }) => ReturnType;
313
+ clearEnhanceHighlight: () => ReturnType;
312
314
  };
313
315
  }
314
316
  }
@@ -316,11 +318,9 @@ declare module "@tiptap/core" {
316
318
 
317
319
  declare module "@tiptap/core" {
318
320
  interface Commands<ReturnType> {
319
- enhanceHighlight: {
320
- setEnhanceHighlight: (from: number, to: number, options?: {
321
- placeholder?: string;
322
- }) => ReturnType;
323
- clearEnhanceHighlight: () => ReturnType;
321
+ fontSize: {
322
+ setFontSize: (fontSize: string) => ReturnType;
323
+ unsetFontSize: () => ReturnType;
324
324
  };
325
325
  }
326
326
  }
@@ -348,8 +348,10 @@ declare module "@tiptap/core" {
348
348
 
349
349
  declare module "@tiptap/core" {
350
350
  interface Commands<ReturnType> {
351
- transcript: {
352
- insertTranscript: (data: TranscriptData) => ReturnType;
351
+ videoEmbed: {
352
+ setVideoEmbed: (options: {
353
+ src: string;
354
+ }) => ReturnType;
353
355
  };
354
356
  }
355
357
  }
@@ -357,10 +359,8 @@ declare module "@tiptap/core" {
357
359
 
358
360
  declare module "@tiptap/core" {
359
361
  interface Commands<ReturnType> {
360
- videoEmbed: {
361
- setVideoEmbed: (options: {
362
- src: string;
363
- }) => ReturnType;
362
+ transcript: {
363
+ insertTranscript: (data: TranscriptData) => ReturnType;
364
364
  };
365
365
  }
366
366
  }