@factorialco/f0-react 4.1.0 → 4.3.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.
@@ -84664,7 +84664,8 @@ function m51(e) {
84664
84664
  value: e.value,
84665
84665
  ...e.plannedValue != null ? { secondaryValue: e.plannedValue } : {},
84666
84666
  ...e.justifiedAbsenceValue != null ? { neutralValue: e.justifiedAbsenceValue } : {},
84667
- ...e.justifiedAbsenceFullDay ? { neutralFullHeight: e.justifiedAbsenceFullDay } : {}
84667
+ ...e.justifiedAbsenceFullDay ? { neutralFullHeight: e.justifiedAbsenceFullDay } : {},
84668
+ ...e.neutralLabel != null ? { neutralLabel: e.neutralLabel } : {}
84668
84669
  };
84669
84670
  }
84670
84671
  function p51(e) {
@@ -84682,8 +84683,8 @@ function p51(e) {
84682
84683
  formatLabel: h51,
84683
84684
  formatValue: BR,
84684
84685
  formatTooltip: ({ point: s, formattedLabel: l, formattedValue: c }) => {
84685
- const u = [`${n} ${c}`];
84686
- return s.neutralFullHeight ? u.push(r) : s.neutralValue != null && s.neutralValue > 0 && u.push(`${r} ${BR(s.neutralValue)}`), `${l} - ${u.join(", ")}`;
84686
+ const u = [`${n} ${c}`], d = s.neutralLabel ?? r;
84687
+ return s.neutralFullHeight ? u.push(d) : s.neutralValue != null && s.neutralValue > 0 && u.push(`${d} ${BR(s.neutralValue)}`), `${l} - ${u.join(", ")}`;
84687
84688
  },
84688
84689
  scaleMax: i
84689
84690
  };
@@ -142678,13 +142679,13 @@ export {
142678
142679
  _5 as hm,
142679
142680
  k51 as hn,
142680
142681
  S22 as ho,
142681
- R33 as hp,
142682
- Ot3 as hq,
142683
- ft3 as hr,
142684
- D33 as hs,
142685
- yt3 as ht,
142686
- Kt3 as hu,
142687
- PM as hv,
142682
+ PM as hp,
142683
+ R33 as hq,
142684
+ Ot3 as hr,
142685
+ ft3 as hs,
142686
+ D33 as ht,
142687
+ yt3 as hu,
142688
+ Kt3 as hv,
142688
142689
  Bt3 as hw,
142689
142690
  Wt3 as hx,
142690
142691
  zt3 as hy,
package/dist/ai.d.ts CHANGED
@@ -4718,8 +4718,11 @@ declare module "@tiptap/core" {
4718
4718
 
4719
4719
  declare module "@tiptap/core" {
4720
4720
  interface Commands<ReturnType> {
4721
- moodTracker: {
4722
- insertMoodTracker: (data: MoodTrackerData) => ReturnType;
4721
+ enhanceHighlight: {
4722
+ setEnhanceHighlight: (from: number, to: number, options?: {
4723
+ placeholder?: string;
4724
+ }) => ReturnType;
4725
+ clearEnhanceHighlight: () => ReturnType;
4723
4726
  };
4724
4727
  }
4725
4728
  }
@@ -4727,11 +4730,8 @@ declare module "@tiptap/core" {
4727
4730
 
4728
4731
  declare module "@tiptap/core" {
4729
4732
  interface Commands<ReturnType> {
4730
- enhanceHighlight: {
4731
- setEnhanceHighlight: (from: number, to: number, options?: {
4732
- placeholder?: string;
4733
- }) => ReturnType;
4734
- clearEnhanceHighlight: () => ReturnType;
4733
+ moodTracker: {
4734
+ insertMoodTracker: (data: MoodTrackerData) => ReturnType;
4735
4735
  };
4736
4736
  }
4737
4737
  }
package/dist/ai.js CHANGED
@@ -1,6 +1,6 @@
1
- import { C as e, D as r, c as t, F as o, a as i, f as n, g as F, d as C, e as A, I as l, P as d, b as u, u as m } from "./F0CanvasPanel-BldFCFfR.js";
1
+ import { C as e, D as r, c as t, F as o, a as i, f as n, g as F, d as C, e as A, I as l, P as d, b as u, u as m } from "./F0CanvasPanel-DztO9JdY.js";
2
2
  import { defaultTranslations as c } from "./i18n-provider-defaults.js";
3
- import { A as P, s as v, t as f, w as g, l as p, i as T, q as y, x as S, p as x, r as H, j as V, e as b, g as k, k as w, F as M, h as O, a as D, n as j, m as q, o as z, b as B, f as E, v as L, c as R, d as G, u as J } from "./useChatHistory-CmV8QZ5c.js";
3
+ import { A as P, s as v, t as f, w as g, l as p, i as T, q as y, x as S, p as x, r as H, j as V, e as b, g as k, k as w, F as M, h as O, a as D, n as j, m as q, o as z, b as B, f as E, v as L, c as R, d as G, u as J } from "./useChatHistory-BY9c22NN.js";
4
4
  export {
5
5
  P as AiChatTranslationsProvider,
6
6
  e as ChatSpinner,
@@ -9747,8 +9747,11 @@ declare module "@tiptap/core" {
9747
9747
 
9748
9748
  declare module "@tiptap/core" {
9749
9749
  interface Commands<ReturnType> {
9750
- moodTracker: {
9751
- insertMoodTracker: (data: MoodTrackerData) => ReturnType;
9750
+ enhanceHighlight: {
9751
+ setEnhanceHighlight: (from: number, to: number, options?: {
9752
+ placeholder?: string;
9753
+ }) => ReturnType;
9754
+ clearEnhanceHighlight: () => ReturnType;
9752
9755
  };
9753
9756
  }
9754
9757
  }
@@ -9756,11 +9759,8 @@ declare module "@tiptap/core" {
9756
9759
 
9757
9760
  declare module "@tiptap/core" {
9758
9761
  interface Commands<ReturnType> {
9759
- enhanceHighlight: {
9760
- setEnhanceHighlight: (from: number, to: number, options?: {
9761
- placeholder?: string;
9762
- }) => ReturnType;
9763
- clearEnhanceHighlight: () => ReturnType;
9762
+ moodTracker: {
9763
+ insertMoodTracker: (data: MoodTrackerData) => ReturnType;
9764
9764
  };
9765
9765
  }
9766
9766
  }
@@ -1,9 +1,9 @@
1
- import { h as ga, B as pa, i as ba, j as xa, k as Dt, l as Be, m as Te, n as va, o as b, p as J, q as ye, u as oe, T as ya, r as wa, s as Na, R as Ca, t as Ia, v as ce, w as ka, x as Nt, y as ut, z as Ve, A as Le, E as Sa, G as Fa, H as U, J as Aa, K as La, L as xe, M as mn, N as Oa, O as Pa, Q as H, S as hn, U as z, V as ke, W as Ea, X as _a, Y as Da, Z as Ta, _ as za, $ as Oe, a0 as gn, a1 as Ra, a2 as we, a3 as Ue, a4 as Ba, e as pn, a5 as Ae, a6 as $a, a7 as bn, a8 as ie, a9 as X, aa as xn, ab as vn, ac as Ma, ad as yn, ae as pe, af as ae, ag as Wa, ah as ja, ai as Va, aj as Ua, ak as ve, al as Ye, am as Ha, an as Ga, ao as Ka, ap as qa, aq as Je, ar as wn, as as Ya, at as Ja, au as Za, av as He, aw as Xa, ax as Nn, ay as Qa, az as er, aA as tr, aB as nr, aC as ar, aD as rr, aE as ir, aF as lr, aG as ft, aH as Cn, aI as mt, aJ as In, aK as sr, aL as or, aM as cr, aN as dr, aO as ur, aP as Ze, aQ as Xe, aR as ht, aS as kn, aT as fr, aU as Ct, aV as mr, aW as hr, aX as gr, aY as Re, aZ as pr, a_ as br, a$ as $e, b0 as Tt, b1 as gt, b2 as xr, b3 as vr, a as yr, b as wr, b4 as Sn, b5 as Nr, g as Cr, F as Ir, b6 as kr, b7 as Fn, b8 as Sr, b9 as An, ba as Ln, bb as Fr, bc as Ar, bd as Lr, be as Or, bf as Pr, bg as Er, bh as _r, bi as Dr, bj as Tr, bk as On, bl as zr, bm as Rr, bn as Br, bo as $r, bp as ge, bq as It, br as kt, bs as St, bt as Pn, bu as Ft, bv as En, bw as _n, bx as Mr, by as Wr, bz as jr, bA as Vr, bB as Ur, bC as Hr, bD as Gr, bE as Kr, bF as zt, bG as qr, bH as Yr, bI as Rt, bJ as Bt, bK as $t, bL as Jr, bM as Zr, bN as Xr, bO as Qr, bP as Dn, bQ as ei, bR as ti } from "./F0CanvasPanel-BldFCFfR.js";
2
- import { c2 as Kc, c1 as qc, ce as Yc, b_ as Jc, b$ as Zc, bS as Xc, bT as Qc, ch as ed, bU as td, bV as nd, ci as ad, c0 as rd, ca as id, cb as ld, cf as sd, bW as od, c4 as cd, c3 as dd, bX as ud, bY as fd, cc as md, cj as hd, cd as gd, cg as pd, c9 as bd, c6 as xd, c8 as vd, c5 as yd, bZ as wd, c7 as Nd } from "./F0CanvasPanel-BldFCFfR.js";
1
+ import { h as ga, B as pa, i as ba, j as xa, k as Dt, l as Be, m as Te, n as va, o as b, p as J, q as ye, u as oe, T as ya, r as wa, s as Na, R as Ca, t as Ia, v as ce, w as ka, x as Nt, y as ut, z as Ve, A as Le, E as Sa, G as Fa, H as U, J as Aa, K as La, L as xe, M as mn, N as Oa, O as Pa, Q as H, S as hn, U as z, V as ke, W as Ea, X as _a, Y as Da, Z as Ta, _ as za, $ as Oe, a0 as gn, a1 as Ra, a2 as we, a3 as Ue, a4 as Ba, e as pn, a5 as Ae, a6 as $a, a7 as bn, a8 as ie, a9 as X, aa as xn, ab as vn, ac as Ma, ad as yn, ae as pe, af as ae, ag as Wa, ah as ja, ai as Va, aj as Ua, ak as ve, al as Ye, am as Ha, an as Ga, ao as Ka, ap as qa, aq as Je, ar as wn, as as Ya, at as Ja, au as Za, av as He, aw as Xa, ax as Nn, ay as Qa, az as er, aA as tr, aB as nr, aC as ar, aD as rr, aE as ir, aF as lr, aG as ft, aH as Cn, aI as mt, aJ as In, aK as sr, aL as or, aM as cr, aN as dr, aO as ur, aP as Ze, aQ as Xe, aR as ht, aS as kn, aT as fr, aU as Ct, aV as mr, aW as hr, aX as gr, aY as Re, aZ as pr, a_ as br, a$ as $e, b0 as Tt, b1 as gt, b2 as xr, b3 as vr, a as yr, b as wr, b4 as Sn, b5 as Nr, g as Cr, F as Ir, b6 as kr, b7 as Fn, b8 as Sr, b9 as An, ba as Ln, bb as Fr, bc as Ar, bd as Lr, be as Or, bf as Pr, bg as Er, bh as _r, bi as Dr, bj as Tr, bk as On, bl as zr, bm as Rr, bn as Br, bo as $r, bp as ge, bq as It, br as kt, bs as St, bt as Pn, bu as Ft, bv as En, bw as _n, bx as Mr, by as Wr, bz as jr, bA as Vr, bB as Ur, bC as Hr, bD as Gr, bE as Kr, bF as zt, bG as qr, bH as Yr, bI as Rt, bJ as Bt, bK as $t, bL as Jr, bM as Zr, bN as Xr, bO as Qr, bP as Dn, bQ as ei, bR as ti } from "./F0CanvasPanel-DztO9JdY.js";
2
+ import { c2 as Kc, c1 as qc, ce as Yc, b_ as Jc, b$ as Zc, bS as Xc, bT as Qc, ch as ed, bU as td, bV as nd, ci as ad, c0 as rd, ca as id, cb as ld, cf as sd, bW as od, c4 as cd, c3 as dd, bX as ud, bY as fd, cc as md, cj as hd, cd as gd, cg as pd, c9 as bd, c6 as xd, c8 as vd, c5 as yd, bZ as wd, c7 as Nd } from "./F0CanvasPanel-DztO9JdY.js";
3
3
  import { jsx as e, jsxs as o, Fragment as Z } from "react/jsx-runtime";
4
4
  import ue, { forwardRef as G, useRef as j, useTransition as ni, useState as D, useLayoutEffect as Tn, useId as pt, useContext as Pe, createContext as Qe, useEffect as W, useCallback as ne, useMemo as q, Fragment as ai, isValidElement as ri, cloneElement as zn, Children as Rn } from "react";
5
- import { C as ii, P as li, a as Bn, M as si, p as oi, b as ci, R as Mt, c as $n, u as di, d as ui, e as fi, f as mi, g as hi, h as Mn, S as gi, A as pi, B as bi, L as xi, i as vi, V as yi, j as wi, k as Ni, l as Ci, O as Ii } from "./useDataCollectionSource-CS0v7UFK.js";
6
- import { r as Id, s as kd, o as Sd, H as Fd, t as Ad, z as Ld, a8 as Od, G as Pd, q as Ed, aa as _d, a9 as Dd, Q as Td, ad as zd, F as Rd, Y as Bd, U as $d, J as Md, af as Wd, K as jd, Z as Vd, _ as Ud, v as Hd, ab as Gd, ac as Kd, N as qd, $ as Yd, a5 as Jd, a7 as Zd, w as Xd, y as Qd, D as eu, W as tu, ae as nu, X as au, T as ru, ag as iu, x as lu, E as su, m as ou, n as cu, a1 as du, a2 as uu, a6 as fu, I as mu, a3 as hu, a0 as gu, a4 as pu } from "./useDataCollectionSource-CS0v7UFK.js";
5
+ import { C as ii, P as li, a as Bn, M as si, p as oi, b as ci, R as Mt, c as $n, u as di, d as ui, e as fi, f as mi, g as hi, h as Mn, S as gi, A as pi, B as bi, L as xi, i as vi, V as yi, j as wi, k as Ni, l as Ci, O as Ii } from "./useDataCollectionSource-DvbEagsY.js";
6
+ import { r as Id, s as kd, o as Sd, H as Fd, t as Ad, z as Ld, a8 as Od, G as Pd, q as Ed, aa as _d, a9 as Dd, Q as Td, ad as zd, F as Rd, Y as Bd, U as $d, J as Md, af as Wd, K as jd, Z as Vd, _ as Ud, v as Hd, ab as Gd, ac as Kd, N as qd, $ as Yd, a5 as Jd, a7 as Zd, w as Xd, y as Qd, D as eu, W as tu, ae as nu, X as au, T as ru, ag as iu, x as lu, E as su, m as ou, n as cu, a1 as du, a2 as uu, a6 as fu, I as mu, a3 as hu, a0 as gu, a4 as pu } from "./useDataCollectionSource-DvbEagsY.js";
7
7
  const ki = ga("Search", [
8
8
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
9
9
  ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
package/dist/f0.d.ts CHANGED
@@ -10820,6 +10820,39 @@ export declare interface F0TimelineRowTaskProps extends F0TimelineRowBaseProps {
10820
10820
  otherActions?: F0TimelineRowOtherAction[];
10821
10821
  }
10822
10822
 
10823
+ declare type F0ToastProps = {
10824
+ /**
10825
+ * The title of the toast
10826
+ */
10827
+ title?: string;
10828
+ /**
10829
+ * The description of the toast
10830
+ */
10831
+ description?: string;
10832
+ /**
10833
+ * The variant of the toast
10834
+ */
10835
+ variant?: F0ToastVariant;
10836
+ /**
10837
+ * The duration of the toast in milliseconds (if not provided, the toast will stay open until the user closes it)
10838
+ */
10839
+ duration?: number;
10840
+ /**
10841
+ * Whether the toast is paused. If true, the duraction timer will not tick in anycase
10842
+ */
10843
+ forcePauseTimer?: boolean;
10844
+ /**
10845
+ * The callback to be called when the toast is closed
10846
+ */
10847
+ onClose?: () => void;
10848
+ /**
10849
+ * The actions to display in the toast ()
10850
+ */
10851
+ actions?: ToastActionButton | [ToastActionButton] | ToastActionLink | [ToastActionLink] | [ToastActionButton, ToastActionLink];
10852
+ };
10853
+
10854
+ declare type F0ToastVariant = (typeof toastVariants)[number];
10855
+
10823
10856
  /**
10824
10857
  * Loose message shape used inside f0. Mirrors the CopilotKit `Message`
10825
10858
  * shape so adapters (factorial, mock runtime) can map back and forth
@@ -11853,6 +11886,8 @@ export declare interface HourDistributionDataPoint {
11853
11886
  justifiedAbsenceValue?: number;
11854
11887
  /** Renders a full-height neutral bar for justified non-working days without a minute baseline. */
11855
11888
  justifiedAbsenceFullDay?: boolean;
11889
+ /** Per-point label for the neutral segment tooltip. Overrides the chart-level justifiedAbsenceLabel when set. */
11890
+ neutralLabel?: string;
11856
11891
  }
11857
11892
 
11858
11893
  declare type I18nContextType = TranslationsType & {
@@ -15529,6 +15564,111 @@ export declare type TimelineRowStatus = (typeof timelineRowStatuses)[number];
15529
15564
 
15530
15565
  export declare const timelineRowStatuses: readonly ["completed", "in-progress", "not-started"];
15531
15566
 
15567
+ declare type ToastActionButton = {
15568
+ type: "button";
15569
+ label: string;
15570
+ onClick: () => void;
15571
+ icon?: IconType;
15572
+ /**
15573
+ * If true, the toast will not be closed automatically when the action is clicked.
15574
+ */
15575
+ keepOpen?: boolean;
15576
+ };
15577
+
15578
+ declare type ToastActionLink = {
15579
+ type: "link";
15580
+ label: string;
15581
+ href: string;
15582
+ /**
15583
+ * If true, the toast will not be closed automatically when the action is clicked.
15584
+ */
15585
+ keepOpen?: boolean;
15586
+ };
15587
+
15588
+ export declare type ToastId = string;
15589
+
15590
+ export declare type ToastOptions = {
15591
+ /**
15592
+ * The title of the toast
15593
+ */
15594
+ title?: string;
15595
+ /**
15596
+ * The description of the toast
15597
+ */
15598
+ description?: string;
15599
+ /**
15600
+ * The variant of the toast
15601
+ */
15602
+ variant?: F0ToastVariant;
15603
+ /**
15604
+ * The actions to display in the toast
15605
+ */
15606
+ actions?: F0ToastProps["actions"];
15607
+ /**
15608
+ * Optional id for the toast. If not provided, a random id will be generated.
15609
+ */
15610
+ id?: ToastId;
15611
+ } & ({
15612
+ /**
15613
+ * The duration of the toast in milliseconds (if not provided, the toast will stay open until the user closes it)
15614
+ * @default 5000
15615
+ */
15616
+ duration?: number;
15617
+ /**
15618
+ * Whether the toast should persist until the user closes it
15619
+ */
15620
+ persistent?: undefined;
15621
+ } | {
15622
+ duration?: undefined;
15623
+ persistent: true;
15624
+ });
15625
+
15626
+ export declare const ToastProvider: ({ children, portalTargets, }: ToastProviderProps) => JSX_2.Element;
15627
+
15628
+ /**
15629
+ * A toast as held by the store: the public options resolved into the props the
15630
+ * `F0Toast` component renders, plus a stable `id` and an `onClose` callback.
15631
+ */
15632
+ export declare type ToastProviderItem = F0ToastProps & {
15633
+ id: ToastId;
15634
+ onClose: () => void;
15635
+ };
15636
+
15637
+ declare type ToastProviderProps = {
15638
+ children: React.ReactNode;
15639
+ portalTargets?: Record<"mobile" | "desktop", string>;
15640
+ };
15641
+
15642
+ /**
15643
+ * Imperative API for toast notifications. Can be called from anywhere — no hook
15644
+ * required — as long as `<F0Provider>` (which mounts `ToastProvider`) is in the
15645
+ * tree.
15646
+ *
15647
+ * @example
15648
+ * import { toasts } from "@factorialco/f0-react"
15649
+ *
15650
+ * const id = toasts.open({ title: "Saved", variant: "success" })
15651
+ * toasts.close(id)
15652
+ * toasts.closeAll()
15653
+ */
15654
+ export declare const toasts: {
15655
+ /**
15656
+ * Show a toast.
15657
+ * @param options The options for the toast
15658
+ * @returns The id of the created toast (pass it to `toasts.close` to dismiss it)
15659
+ */
15660
+ open: (options: ToastOptions) => ToastId;
15661
+ /**
15662
+ * Dismiss a toast by id.
15663
+ * @param id The id returned by `toasts.open`
15664
+ */
15665
+ close: (id: ToastId) => void;
15666
+ /** Dismiss every open toast. */
15667
+ closeAll: () => void;
15668
+ };
15669
+
15670
+ declare const toastVariants: readonly ["error", "warning", "success", "default"];
15671
+
15532
15672
  /** A button rendered in the footer at the bottom of the table of contents */
15533
15673
  declare type TOCAction = {
15534
15674
  label: string;
@@ -16338,6 +16478,16 @@ export declare const useGroups: <R extends RecordType>(groups: GroupRecord<R>[],
16338
16478
  setGroupOpen: (key: string, open: boolean) => void;
16339
16479
  };
16340
16480
 
16481
+ /**
16482
+ * Returns true when the viewport width is >= 640px (Tailwind's `sm` breakpoint).
16483
+ */
16484
+ export declare const useIsDesktop: () => boolean;
16485
+
16486
+ /**
16487
+ * Returns true when the viewport width is < 640px (below Tailwind's `sm` breakpoint).
16488
+ */
16489
+ export declare const useIsMobile: () => boolean;
16490
+
16341
16491
  /**
16342
16492
  * Resolves the previous/next neighbours of an item through the adapter's
16343
16493
  * optional id-relative `fetchItemNeighbors` capability.
@@ -16884,8 +17034,11 @@ declare module "@tiptap/core" {
16884
17034
 
16885
17035
  declare module "@tiptap/core" {
16886
17036
  interface Commands<ReturnType> {
16887
- moodTracker: {
16888
- insertMoodTracker: (data: MoodTrackerData) => ReturnType;
17037
+ enhanceHighlight: {
17038
+ setEnhanceHighlight: (from: number, to: number, options?: {
17039
+ placeholder?: string;
17040
+ }) => ReturnType;
17041
+ clearEnhanceHighlight: () => ReturnType;
16889
17042
  };
16890
17043
  }
16891
17044
  }
@@ -16893,11 +17046,8 @@ declare module "@tiptap/core" {
16893
17046
 
16894
17047
  declare module "@tiptap/core" {
16895
17048
  interface Commands<ReturnType> {
16896
- enhanceHighlight: {
16897
- setEnhanceHighlight: (from: number, to: number, options?: {
16898
- placeholder?: string;
16899
- }) => ReturnType;
16900
- clearEnhanceHighlight: () => ReturnType;
17049
+ moodTracker: {
17050
+ insertMoodTracker: (data: MoodTrackerData) => ReturnType;
16901
17051
  };
16902
17052
  }
16903
17053
  }