@factorialco/f0-react 1.225.1 → 1.227.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.
@@ -1348,7 +1348,7 @@ export declare type DataCollectionSourceDefinition<R extends RecordType = Record
1348
1348
  /** Available actions that can be performed on records */
1349
1349
  itemActions?: ItemActions;
1350
1350
  /** Available primary actions that can be performed on the collection */
1351
- primaryActions?: PrimaryActionsDefinition;
1351
+ primaryActions?: PrimaryActionsDefinitionFn;
1352
1352
  /** Available secondary actions that can be performed on the collection */
1353
1353
  secondaryActions?: SecondaryActionsDefinition;
1354
1354
  /** Available summaries fields. If not provided, summaries is not allowed. */
@@ -1358,7 +1358,11 @@ export declare type DataCollectionSourceDefinition<R extends RecordType = Record
1358
1358
  dataAdapter: DataCollectionDataAdapter<R, Filters, NavigationFilters>;
1359
1359
  /** Bulk actions that can be performed on the collection */
1360
1360
  bulkActions?: BulkActionsDefinition<R, Filters>;
1361
- totalItemSummary?: (totalItems: number) => string;
1361
+ /** Total items summary that can be displayed on the collection
1362
+ * If true, the total items summary will be displayed on the collection
1363
+ * If a function is provided, the total items summary will be displayed on the collection
1364
+ */
1365
+ totalItemSummary?: boolean | ((totalItems: number) => string | null);
1362
1366
  /** Item filter that can be used to filter the items before they are displayed */
1363
1367
  itemPreFilter?: (item: R) => boolean;
1364
1368
  /** Lanes configuration */
@@ -1944,7 +1948,7 @@ export declare const EntitySelect: <T>(props: EntitySelectProps<T> & {
1944
1948
  children?: React.ReactNode;
1945
1949
  }) => JSX_2.Element;
1946
1950
 
1947
- declare interface EntitySelectCommonProps<T> extends Omit<PopoverProps, "children" | "modal">, Pick<InputFieldProps<string>, "label" | "labelIcon" | "icon" | "error" | "status" | "hint" | "hideLabel" | "maxLength" | "disabled" | "placeholder" | "loading" | "required" | "readonly" | "append"> {
1951
+ declare interface EntitySelectCommonProps<T> extends Omit<PopoverProps, "children" | "modal">, Pick<InputFieldProps<string>, "label" | "labelIcon" | "icon" | "error" | "status" | "hint" | "hideLabel" | "maxLength" | "disabled" | "placeholder" | "loading" | "required" | "readonly" | "append" | "size"> {
1948
1952
  entities: EntitySelectEntity[];
1949
1953
  groups: EntitySelectNamedGroup[];
1950
1954
  selectedGroup: string;
@@ -2382,6 +2386,11 @@ export declare const getGranularityDefinition: (granularityKey: GranularityDefin
2382
2386
 
2383
2387
  export declare const getGranularitySimpleDefinition: (granularityKey: GranularityDefinitionKey) => GranularityDefinitionSimple;
2384
2388
 
2389
+ /**
2390
+ * Get the primaryActionsItems from the primaryActionsDefinition or the actions property
2391
+ */
2392
+ export declare const getPrimaryActions: (primaryActions: PrimaryActionsDefinitionFn | undefined) => PrimaryActionsDefinition[];
2393
+
2385
2394
  /**
2386
2395
  * Get the secondaryActionsItems from the secondaryActionsDefinition or the actions property
2387
2396
  */
@@ -3725,11 +3734,13 @@ declare interface PrimaryActionButton extends PrimaryAction {
3725
3734
  onClick: () => void;
3726
3735
  }
3727
3736
 
3737
+ export declare type PrimaryActionsDefinition = Pick<DropdownItemObject, "onClick" | "label" | "icon">;
3738
+
3728
3739
  /**
3729
3740
  * Defines the structure and configuration of the primary action that can be performed on a collection.
3730
3741
  * @returns An action
3731
3742
  */
3732
- export declare type PrimaryActionsDefinition = () => Pick<DropdownItemObject, "onClick" | "label" | "icon"> | undefined;
3743
+ export declare type PrimaryActionsDefinitionFn = () => PrimaryActionsDefinition | PrimaryActionsDefinition[] | undefined;
3733
3744
 
3734
3745
  export declare type primaryActionType = {
3735
3746
  action: actionType;
@@ -5115,8 +5126,8 @@ declare global {
5115
5126
 
5116
5127
  declare module "@tiptap/core" {
5117
5128
  interface Commands<ReturnType> {
5118
- liveCompanion: {
5119
- insertLiveCompanion: (data: LiveCompanionData, config?: LiveCompanionConfig) => ReturnType;
5129
+ aiBlock: {
5130
+ insertAIBlock: (data: AIBlockData, config: AIBlockConfigWithLabels) => ReturnType;
5120
5131
  };
5121
5132
  }
5122
5133
  }
@@ -5124,8 +5135,8 @@ declare module "@tiptap/core" {
5124
5135
 
5125
5136
  declare module "@tiptap/core" {
5126
5137
  interface Commands<ReturnType> {
5127
- aiBlock: {
5128
- insertAIBlock: (data: AIBlockData, config: AIBlockConfigWithLabels) => ReturnType;
5138
+ liveCompanion: {
5139
+ insertLiveCompanion: (data: LiveCompanionData, config?: LiveCompanionConfig) => ReturnType;
5129
5140
  };
5130
5141
  }
5131
5142
  }