@uibot/renderer-react 0.3.0 → 0.6.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.
@@ -17,6 +17,8 @@ export interface AiFillDrawerProps {
17
17
  onCommitted(receipt: PagedCollectionMutationReceipt): void;
18
18
  onClose(): void;
19
19
  onNotify?(message: string): void;
20
+ /** Opens on one AI column: its prompt, that field as the only target, empty cells of the view. */
21
+ presetFieldId?: string;
20
22
  locale?: PagedCollectionLocale;
21
23
  ui?: CollectionUiSlots;
22
24
  }
@@ -10,6 +10,16 @@ export declare function chunked<T>(items: T[], size: number): T[][];
10
10
  export declare function mergeAiReviews(reviews: AiFillReview[]): AiFillReview;
11
11
  /** Fields AI may propose values for: plain stored values, not computed, generated or linked. */
12
12
  export declare function aiFillableFields(fields: PagedCollectionField[]): PagedCollectionField[];
13
+ export declare const isEmpty: (value: unknown) => boolean;
14
+ /** Records whose cells in every target field are empty: what "only empty cells" runs over. */
15
+ export declare function recordsWithEmptyTargets(records: PagedCollectionRecord[], targetFieldIds: string[]): PagedCollectionRecord[];
16
+ /**
17
+ * Fields a run sends to the model. When every target is an AI column naming its source fields,
18
+ * only those sources and the targets go out; otherwise the whole record does.
19
+ */
20
+ export declare function aiContextFieldIds(fields: PagedCollectionField[], targetFieldIds: string[]): string[] | undefined;
21
+ /** The records with only `fieldIds` kept in their values (ids and versions unchanged). */
22
+ export declare function projectRecords(records: PagedCollectionRecord[], fieldIds: string[] | undefined): PagedCollectionRecord[];
13
23
  /** Maps a model answer to the stored shape of `field`, or undefined when it cannot be one. */
14
24
  export declare function coerceAiValue(field: PagedCollectionField, raw: unknown): unknown;
15
25
  export interface AiFillChange {
@@ -28,6 +28,8 @@ export interface PagedCollectionSchemaEditorProps {
28
28
  defaults?: boolean;
29
29
  optionColors?: boolean;
30
30
  descriptions?: boolean;
31
+ /** AI column prompt and sources. Off by default: only hosts that store `field.ai` and can run it. */
32
+ ai?: boolean;
31
33
  };
32
34
  }
33
35
  /**
@@ -1,4 +1,4 @@
1
- import type { PagedCollectionField } from "@uibot/contracts";
1
+ import { type PagedCollectionField } from "@uibot/contracts";
2
2
  import { type PagedCollectionLocale } from "../collection-grid/paged-locale.js";
3
3
  import type { CollectionUiSlots } from "../collection-ui.js";
4
4
  export interface PagedFieldSettingsProps {
@@ -20,3 +20,16 @@ export interface PagedFieldSettingsProps {
20
20
  * starts with. Renders nothing for types without settings.
21
21
  */
22
22
  export declare function PagedFieldSettings({ field, onChange, disabled, locale, ui, settings, dateFormatLocked, }: PagedFieldSettingsProps): import("react").JSX.Element | null;
23
+ export interface PagedFieldAiSettingsProps {
24
+ field: PagedCollectionField;
25
+ /** Every field of the table, for picking the sources the prompt reads. */
26
+ fields: PagedCollectionField[];
27
+ onChange: (change: (field: PagedCollectionField) => PagedCollectionField) => void;
28
+ disabled: boolean;
29
+ locale?: PagedCollectionLocale | undefined;
30
+ }
31
+ /**
32
+ * AI column settings: a prompt and the fields it reads. The values stay ordinary, editable cells;
33
+ * the column menu's "Generate with AI" runs the prompt through the host's AI fill client.
34
+ */
35
+ export declare function PagedFieldAiSettings({ field, fields, onChange, disabled, locale, }: PagedFieldAiSettingsProps): import("react").JSX.Element | null;