@factorialco/f0-react 2.59.0 → 2.61.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.
package/dist/ai.d.ts CHANGED
@@ -4719,9 +4719,8 @@ declare module "@tiptap/core" {
4719
4719
 
4720
4720
  declare module "@tiptap/core" {
4721
4721
  interface Commands<ReturnType> {
4722
- enhanceHighlight: {
4723
- setEnhanceHighlight: (from: number, to: number) => ReturnType;
4724
- clearEnhanceHighlight: () => ReturnType;
4722
+ moodTracker: {
4723
+ insertMoodTracker: (data: MoodTrackerData) => ReturnType;
4725
4724
  };
4726
4725
  }
4727
4726
  }
@@ -4729,8 +4728,9 @@ declare module "@tiptap/core" {
4729
4728
 
4730
4729
  declare module "@tiptap/core" {
4731
4730
  interface Commands<ReturnType> {
4732
- moodTracker: {
4733
- insertMoodTracker: (data: MoodTrackerData) => ReturnType;
4731
+ enhanceHighlight: {
4732
+ setEnhanceHighlight: (from: number, to: number) => ReturnType;
4733
+ clearEnhanceHighlight: () => ReturnType;
4734
4734
  };
4735
4735
  }
4736
4736
  }
package/dist/ai.js CHANGED
@@ -1,6 +1,6 @@
1
- import { D as e, F as r, a as t, e as o, f as i, c as n, d as F, I as C, P as A, b as l, u as d } from "./F0CanvasPanel-44Gm4epD.js";
1
+ import { D as e, F as r, a as t, e as o, f as i, c as n, d as F, I as C, P as A, b as l, u as d } from "./F0CanvasPanel-mGgQF8IR.js";
2
2
  import { defaultTranslations as m } from "./i18n-provider-defaults.js";
3
- import { A as c, C as I, h as P, t as v, v as f, x as p, n as T, j as g, r as y, y as S, q as x, s as H, k as V, e as b, g as k, l as w, F as M, i as O, a as D, p as j, m as q, o as z, b as B, f as E, w as L, c as R, d as G, u as J } from "./useChatHistory-HVhWAfGi.js";
3
+ import { A as c, C as I, h as P, t as v, v as f, x as p, n as T, j as g, r as y, y as S, q as x, s as H, k as V, e as b, g as k, l as w, F as M, i as O, a as D, p as j, m as q, o as z, b as B, f as E, w as L, c as R, d as G, u as J } from "./useChatHistory-B3Rzija0.js";
4
4
  export {
5
5
  c as AiChatTranslationsProvider,
6
6
  I as ChatSpinner,
@@ -1124,7 +1124,73 @@ declare type BreadcrumbBaseItemType = NavigationItem & {
1124
1124
  label: string;
1125
1125
  };
1126
1126
 
1127
- export declare type BreadcrumbItemType = BreadcrumbLoadingItemType | BreadcrumbNavItemType | BreadcrumbSelectItemType;
1127
+ /**
1128
+ * A breadcrumb "jump-to" select bound to a OneDataCollection: the options are
1129
+ * fetched from the declared `source`, seeded with the filters/sortings the
1130
+ * list persisted under `collectionId` — so on the detail page (even via a
1131
+ * direct link, with the list never mounted) the select only shows the items
1132
+ * the user was looking at on the list.
1133
+ *
1134
+ * F0 owns the seeding, pagination handling (a `pages` adapter is transparently
1135
+ * consumed as infinite scroll), current selection, navigation, and
1136
+ * loop-safety: `source` is captured when the crumb mounts, so inline-recreated
1137
+ * item objects never retrigger fetches. Give the item a new `id` to swap
1138
+ * sources.
1139
+ */
1140
+ export declare type BreadcrumbCollectionSelectItemType = BreadcrumbBaseItemType & {
1141
+ type: "collection-select";
1142
+ /**
1143
+ * The `id` of the OneDataCollection whose persisted state seeds the source
1144
+ * (WITHOUT the `datacollection-` prefix). Empty/missing storage → the
1145
+ * source is used unfiltered.
1146
+ */
1147
+ collectionId: string;
1148
+ /** The declared data source — no mounted collection needed. */
1149
+ source: DataSourceDefinition<RecordType, FiltersDefinition, SortingsDefinition, GroupingDefinition<RecordType>>;
1150
+ mapOptions: (item: RecordType) => F0SelectItemProps<string, RecordType>;
1151
+ /** Current item id (the record the detail page is showing). */
1152
+ value?: string;
1153
+ /**
1154
+ * Fallback option so a direct link shows the current item as selected
1155
+ * before/without it appearing in the fetched options. The item `label` is
1156
+ * used as the trigger label until an option is selected.
1157
+ */
1158
+ defaultItem?: F0SelectItemObject<string, RecordType>;
1159
+ searchbox?: boolean;
1160
+ /** Which persisted state to seed. @default { filters: true, sortings: true } */
1161
+ seed?: {
1162
+ filters?: boolean;
1163
+ sortings?: boolean;
1164
+ };
1165
+ /**
1166
+ * Render the source's filter definitions as an editable filter picker
1167
+ * inside the dropdown, pre-applied with the seeded persisted filters —
1168
+ * letting users refine the jump-to list in place. When false the seeded
1169
+ * filters are still applied, just not editable.
1170
+ * @default false
1171
+ */
1172
+ showFilters?: boolean;
1173
+ /**
1174
+ * Called when the user edits the in-dropdown filters (`showFilters`).
1175
+ * Feed the value to `useDataCollectionItemNavigation`'s `currentFilters`
1176
+ * so the detail-page prev/next arrows and counter follow the same refined
1177
+ * context the dropdown is showing.
1178
+ */
1179
+ onFiltersChange?: (filters: FiltersState<FiltersDefinition>) => void;
1180
+ } & ({
1181
+ /**
1182
+ * Href to navigate to when an option is picked, routed through the
1183
+ * app's LinkProvider. Return undefined to skip navigation.
1184
+ */
1185
+ getItemHref: (value: string, item?: RecordType) => string | undefined;
1186
+ onSelect?: (value: string, item?: RecordType) => void;
1187
+ } | {
1188
+ getItemHref?: never;
1189
+ /** Imperative escape hatch (e.g. router.push) when hrefs don't fit. */
1190
+ onSelect: (value: string, item?: RecordType) => void;
1191
+ });
1192
+
1193
+ export declare type BreadcrumbItemType = BreadcrumbLoadingItemType | BreadcrumbNavItemType | BreadcrumbSelectItemType | BreadcrumbCollectionSelectItemType;
1128
1194
 
1129
1195
  export declare type BreadcrumbLoadingItemType = Pick<BreadcrumbBaseItemType, "id"> & {
1130
1196
  loading: true;
@@ -4596,6 +4662,12 @@ declare type F0SelectBaseProps<T extends string, R = unknown> = {
4596
4662
  onSearchChange?: (value: string) => void;
4597
4663
  searchValue?: string;
4598
4664
  onOpenChange?: (open: boolean) => void;
4665
+ /**
4666
+ * Called when the user changes the in-dropdown filters (requires a `source`
4667
+ * with filter definitions). Lets consumers keep an external context — e.g.
4668
+ * detail-page navigation — in sync with what the dropdown is showing.
4669
+ */
4670
+ onFiltersChange?: (filters: FiltersState<FiltersDefinition>) => void;
4599
4671
  searchEmptyMessage?: string;
4600
4672
  className?: string;
4601
4673
  actions?: Action[];
@@ -8487,6 +8559,13 @@ declare type UseDataCollectionDataReturn<R extends RecordType> = UseDataReturn<R
8487
8559
  * `currentSortings`: the definition values apply on mount and the hydrated
8488
8560
  * state lands right after, mirroring what the user last saw on the list.
8489
8561
  *
8562
+ * When the adapter implements the optional id-relative `fetchItemNeighbors`
8563
+ * capability, gaps the loaded window can't answer (deep direct link to an
8564
+ * item beyond the first page, or a neighbor past the window edge) are
8565
+ * resolved backend-side under the same filters/sortings/search — prev/next
8566
+ * and the counter then behave as if the whole filtered set were loaded.
8567
+ * Without the capability, behavior is window-only as before.
8568
+ *
8490
8569
  * @example
8491
8570
  * ```tsx
8492
8571
  * const { navigation } = useDataCollectionItemNavigation({
@@ -8543,6 +8622,14 @@ export declare interface UseDataCollectionItemNavigationProps<R extends RecordTy
8543
8622
  * @default true
8544
8623
  */
8545
8624
  restorePersistedState?: boolean;
8625
+ /**
8626
+ * Controlled filters for the navigation context — wins over the persisted
8627
+ * list filters. Feed it the filters the user refined elsewhere (e.g. a
8628
+ * collection-bound breadcrumb select's `onFiltersChange`) so prev/next and
8629
+ * the counter follow that same context. Changing it refetches and
8630
+ * re-resolves neighbors; `undefined` keeps the persisted/definition state.
8631
+ */
8632
+ currentFilters?: FiltersState<Filters>;
8546
8633
  /**
8547
8634
  * Forwarded to `useDataCollectionSource` for `dataAdapter` memoization,
8548
8635
  * same convention as `useDataCollectionSource(source, deps)`.
@@ -9185,9 +9272,8 @@ declare module "@tiptap/core" {
9185
9272
 
9186
9273
  declare module "@tiptap/core" {
9187
9274
  interface Commands<ReturnType> {
9188
- enhanceHighlight: {
9189
- setEnhanceHighlight: (from: number, to: number) => ReturnType;
9190
- clearEnhanceHighlight: () => ReturnType;
9275
+ moodTracker: {
9276
+ insertMoodTracker: (data: MoodTrackerData) => ReturnType;
9191
9277
  };
9192
9278
  }
9193
9279
  }
@@ -9195,8 +9281,9 @@ declare module "@tiptap/core" {
9195
9281
 
9196
9282
  declare module "@tiptap/core" {
9197
9283
  interface Commands<ReturnType> {
9198
- moodTracker: {
9199
- insertMoodTracker: (data: MoodTrackerData) => ReturnType;
9284
+ enhanceHighlight: {
9285
+ setEnhanceHighlight: (from: number, to: number) => ReturnType;
9286
+ clearEnhanceHighlight: () => ReturnType;
9200
9287
  };
9201
9288
  }
9202
9289
  }