@factorialco/f0-react 1.254.0 → 1.255.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.
package/dist/f0.d.ts CHANGED
@@ -1115,6 +1115,7 @@ declare type DataCollectionSourceDefinition<R extends RecordType = RecordType, F
1115
1115
  */
1116
1116
  /** Navigation filters */
1117
1117
  navigationFilters?: NavigationFilters;
1118
+ currentNavigationFilters?: NavigationFiltersState<NavigationFilters>;
1118
1119
  /** URL for a single item in the collection */
1119
1120
  itemUrl?: (item: R) => string | undefined;
1120
1121
  /** Click handler for a single item in the collection */
@@ -1186,19 +1187,27 @@ export declare type DataSource<R extends RecordType, Filters extends FiltersDefi
1186
1187
  setCurrentFilters: React.Dispatch<React.SetStateAction<FiltersState<Filters>>>;
1187
1188
  /** Whether presets are currently loading */
1188
1189
  presetsLoading?: boolean;
1190
+ /***** SORTINGS ***************************************************/
1189
1191
  /** Current state of applied sortings */
1190
1192
  currentSortings: SortingsState<Sortings>;
1191
1193
  /** Function to update the current sortings state */
1192
1194
  setCurrentSortings: React.Dispatch<React.SetStateAction<SortingsState<Sortings>>>;
1195
+ /*******************************************************/
1196
+ /***** SEARCH ***************************************************/
1193
1197
  currentSearch: undefined | string;
1194
1198
  debouncedCurrentSearch: undefined | string;
1195
1199
  setCurrentSearch: (search: string | undefined) => void;
1200
+ /*******************************************************/
1201
+ /***** LOADING ***************************************************/
1196
1202
  isLoading: boolean;
1197
1203
  setIsLoading: (loading: boolean) => void;
1204
+ /*******************************************************/
1205
+ /***** GROUPING ***************************************************/
1198
1206
  /** Current state of applied grouping */
1199
1207
  currentGrouping?: Grouping["mandatory"] extends true ? Exclude<GroupingState<R, Grouping>, undefined> : GroupingState<R, Grouping>;
1200
1208
  /** Function to update the current grouping state */
1201
1209
  setCurrentGrouping: React.Dispatch<React.SetStateAction<GroupingState<R, Grouping>>>;
1210
+ /*******************************************************/
1202
1211
  /** Function to provide an id for a record, necessary for append mode */
1203
1212
  idProvider?: <Item extends R>(item: Item, index?: number) => string | number | symbol;
1204
1213
  /** Item filter that can be used to filter the items before they are displayed */
@@ -1219,27 +1228,42 @@ export declare type DataSource<R extends RecordType, Filters extends FiltersDefi
1219
1228
  * @template Summaries - The available summaries for the collection
1220
1229
  */
1221
1230
  export declare type DataSourceDefinition<R extends RecordType = RecordType, Filters extends FiltersDefinition = FiltersDefinition, Sortings extends SortingsDefinition = SortingsDefinition, Grouping extends GroupingDefinition<R> = GroupingDefinition<R>> = {
1231
+ /***** FILTERS ***************************************************/
1222
1232
  /** Available filter configurations */
1223
1233
  filters?: Filters;
1234
+ /** Default filters state (this is the state that the source will back on reset)*/
1235
+ defaultFilters?: FiltersState<Filters>;
1224
1236
  /** Current state of applied filters */
1225
1237
  currentFilters?: FiltersState<Filters>;
1226
1238
  /** Predefined filter configurations that can be applied */
1227
1239
  presets?: PresetsDefinition<Filters>;
1228
1240
  /** Whether presets are currently loading */
1229
1241
  presetsLoading?: boolean;
1242
+ /*******************************************************/
1243
+ /***** SEARCH ***************************************************/
1230
1244
  /** Search configuration */
1231
1245
  search?: SearchOptions;
1246
+ /*******************************************************/
1247
+ /***** SORTINGS ***************************************************/
1232
1248
  /** Available sorting fields. If not provided, sorting is not allowed. */
1233
1249
  sortings?: Sortings;
1234
- defaultSorting?: SortingsState<Sortings>;
1250
+ /** Default sorting state (this is the state that the source will back on reset)*/
1251
+ defaultSortings?: SortingsState<Sortings>;
1252
+ /** Current state of applied sortings */
1253
+ currentSortings?: SortingsState<Sortings>;
1254
+ /*******************************************************/
1235
1255
  /** Data adapter responsible for fetching and managing data */
1236
1256
  dataAdapter: DataAdapter<R, Filters>;
1237
1257
  /** Selectable items value under the checkbox column (undefined if not selectable) */
1238
1258
  selectable?: (item: R) => string | number | undefined;
1239
1259
  /** Default selected items */
1240
1260
  defaultSelectedItems?: SelectedItemsState;
1261
+ /***** GROUPING ***************************************************/
1241
1262
  /** Grouping configuration */
1242
1263
  grouping?: Grouping;
1264
+ /** Default grouping state (this is the state that the source will back on reset)*/
1265
+ defaultGrouping?: GroupingState<R, Grouping>;
1266
+ /** Current state of applied grouping */
1243
1267
  currentGrouping?: GroupingState<R, Grouping>;
1244
1268
  };
1245
1269
 
@@ -3735,7 +3759,7 @@ export declare interface UseDataReturn<R extends RecordType> {
3735
3759
  * - actions: Available actions for the collection
3736
3760
  * - presets: Available filter presets
3737
3761
  */
3738
- export declare function useDataSource<R extends RecordType = RecordType, FiltersSchema extends FiltersDefinition = FiltersDefinition, Sortings extends SortingsDefinition = SortingsDefinition, Grouping extends GroupingDefinition<R> = GroupingDefinition<R>>({ currentFilters: initialCurrentFilters, currentGrouping: initialCurrentGrouping, filters, search, defaultSorting, dataAdapter, grouping, ...rest }: DataSourceDefinition<R, FiltersSchema, Sortings, Grouping>, deps?: ReadonlyArray<unknown>): DataSource<R, FiltersSchema, Sortings, Grouping>;
3762
+ export declare function useDataSource<R extends RecordType = RecordType, FiltersSchema extends FiltersDefinition = FiltersDefinition, Sortings extends SortingsDefinition = SortingsDefinition, Grouping extends GroupingDefinition<R> = GroupingDefinition<R>>({ defaultFilters, currentFilters: externalCurrentFilters, defaultGrouping: externalDefaultGrouping, currentGrouping: externalCurrentGrouping, filters, search, defaultSortings, currentSortings: externalCurrentSortings, dataAdapter, grouping, ...rest }: DataSourceDefinition<R, FiltersSchema, Sortings, Grouping>, deps?: ReadonlyArray<unknown>): DataSource<R, FiltersSchema, Sortings, Grouping>;
3739
3763
 
3740
3764
  export declare function useDndEvents(handler: (e: {
3741
3765
  phase: "start" | "over" | "drop" | "cancel";
@@ -3910,8 +3934,8 @@ declare module "@tiptap/core" {
3910
3934
 
3911
3935
  declare module "@tiptap/core" {
3912
3936
  interface Commands<ReturnType> {
3913
- liveCompanion: {
3914
- insertLiveCompanion: (data: LiveCompanionData, config?: LiveCompanionConfig) => ReturnType;
3937
+ transcript: {
3938
+ insertTranscript: (data: TranscriptData, config?: TranscriptConfig) => ReturnType;
3915
3939
  };
3916
3940
  }
3917
3941
  }
@@ -3919,18 +3943,13 @@ declare module "@tiptap/core" {
3919
3943
 
3920
3944
  declare module "@tiptap/core" {
3921
3945
  interface Commands<ReturnType> {
3922
- transcript: {
3923
- insertTranscript: (data: TranscriptData, config?: TranscriptConfig) => ReturnType;
3946
+ liveCompanion: {
3947
+ insertLiveCompanion: (data: LiveCompanionData, config?: LiveCompanionConfig) => ReturnType;
3924
3948
  };
3925
3949
  }
3926
3950
  }
3927
3951
 
3928
3952
 
3929
- declare namespace Calendar {
3930
- var displayName: string;
3931
- }
3932
-
3933
-
3934
3953
  declare module "@tiptap/core" {
3935
3954
  interface Commands<ReturnType> {
3936
3955
  moodTracker: {
@@ -3938,3 +3957,8 @@ declare module "@tiptap/core" {
3938
3957
  };
3939
3958
  }
3940
3959
  }
3960
+
3961
+
3962
+ declare namespace Calendar {
3963
+ var displayName: string;
3964
+ }
package/dist/f0.js CHANGED
@@ -1,5 +1,5 @@
1
- import { S as xe, a as mt, f as ne, L as K, b as ht, A as vt, i as J, c as yt, d as Te, E as bt, g as X, e as gt, h as xt, C as wt, j as Pt, k as $, l as Fe, u as St, G as Ct, m as Nt, n as we, o as At, p as Ie, q as Ot, B as _e, X as Ee, Y as le, r as kt, s as je, t as Lt, v as Dt, w as Tt, x as Ft, y as It, z as _t, D as Et, F as jt, H as Pe, I as $t, J as W, K as oe, M as Bt, N as Mt, O as Rt, P as $e, Q as E, R as I, T as zt, U as Kt, V as Wt, W as qt, Z as Gt, _ as Vt, $ as Yt, a0 as Be, a1 as Ut, a2 as Z, a3 as Me, a4 as Re, a5 as Ht, a6 as ze, a7 as Ke, a8 as We, a9 as qe, aa as Jt, ab as Ge, ac as Xt, ad as Zt, ae as Qt, af as Se, ag as ie, ah as ea, ai as ta, aj as Ve, ak as aa, al as ra, am as Ye, an as na, ao as oa, ap as ia, aq as sa, ar as la, as as ca, at as ua, au as da, av as Ue, aw as M, ax as He, ay as fa, az as pa, aA as Ce, aB as ma, aC as Je, aD as ha, aE as va, aF as ya, aG as ba, aH as ga, aI as xa, aJ as wa, aK as Pa, aL as Sa, aM as Ca, aN as Na, aO as Aa } from "./hooks-CCnHcgjZ.js";
2
- import { bp as tn, br as an, bA as rn, aP as nn, aQ as on, aR as sn, aS as ln, aT as cn, aU as un, aV as dn, aW as fn, aY as pn, aZ as mn, a_ as hn, a$ as vn, b0 as yn, b1 as bn, bw as gn, b3 as xn, b5 as wn, b6 as Pn, b7 as Sn, b8 as Cn, bb as Nn, bc as An, bd as On, bf as kn, b4 as Ln, be as Dn, ba as Tn, bx as Fn, bq as In, bk as _n, bn as En, bj as jn, bB as $n, bi as Bn, bh as Mn, aX as Rn, b2 as zn, b9 as Kn, bg as Wn, bl as qn, bs as Gn, bt as Vn, bu as Yn, bC as Un, bm as Hn, bv as Jn, bz as Xn, bo as Zn, by as Qn } from "./hooks-CCnHcgjZ.js";
1
+ import { S as xe, a as mt, f as ne, L as K, b as ht, A as vt, i as J, c as yt, d as Te, E as bt, g as X, e as gt, h as xt, C as wt, j as Pt, k as $, l as Fe, u as St, G as Ct, m as Nt, n as we, o as At, p as Ie, q as Ot, B as _e, X as Ee, Y as le, r as kt, s as je, t as Lt, v as Dt, w as Tt, x as Ft, y as It, z as _t, D as Et, F as jt, H as Pe, I as $t, J as W, K as oe, M as Bt, N as Mt, O as Rt, P as $e, Q as E, R as I, T as zt, U as Kt, V as Wt, W as qt, Z as Gt, _ as Vt, $ as Yt, a0 as Be, a1 as Ut, a2 as Z, a3 as Me, a4 as Re, a5 as Ht, a6 as ze, a7 as Ke, a8 as We, a9 as qe, aa as Jt, ab as Ge, ac as Xt, ad as Zt, ae as Qt, af as Se, ag as ie, ah as ea, ai as ta, aj as Ve, ak as aa, al as ra, am as Ye, an as na, ao as oa, ap as ia, aq as sa, ar as la, as as ca, at as ua, au as da, av as Ue, aw as M, ax as He, ay as fa, az as pa, aA as Ce, aB as ma, aC as Je, aD as ha, aE as va, aF as ya, aG as ba, aH as ga, aI as xa, aJ as wa, aK as Pa, aL as Sa, aM as Ca, aN as Na, aO as Aa } from "./hooks-Bj3h_byv.js";
2
+ import { bp as tn, br as an, bA as rn, aP as nn, aQ as on, aR as sn, aS as ln, aT as cn, aU as un, aV as dn, aW as fn, aY as pn, aZ as mn, a_ as hn, a$ as vn, b0 as yn, b1 as bn, bw as gn, b3 as xn, b5 as wn, b6 as Pn, b7 as Sn, b8 as Cn, bb as Nn, bc as An, bd as On, bf as kn, b4 as Ln, be as Dn, ba as Tn, bx as Fn, bq as In, bk as _n, bn as En, bj as jn, bB as $n, bi as Bn, bh as Mn, aX as Rn, b2 as zn, b9 as Kn, bg as Wn, bl as qn, bs as Gn, bt as Vn, bu as Yn, bC as Un, bm as Hn, bv as Jn, bz as Xn, bo as Zn, by as Qn } from "./hooks-Bj3h_byv.js";
3
3
  import { jsx as n, jsxs as C, Fragment as ae } from "react/jsx-runtime";
4
4
  import * as fe from "react";
5
5
  import k, { PureComponent as Oa, useState as D, forwardRef as V, useEffect as B, useMemo as se, useCallback as Ne, useRef as pe, useImperativeHandle as ka, Children as La, createContext as Da } from "react";