@uibot/renderer-react 0.7.0 → 0.9.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.
@@ -0,0 +1,38 @@
1
+ import { type CSSProperties, type ReactNode } from "react";
2
+ import { type PagedCollectionField, type PagedCollectionLinkClient, type PagedHyperlinkValue } from "@uibot/contracts";
3
+ import { type PagedCollectionLocale } from "./paged-locale.js";
4
+ /**
5
+ * Supplies the host's link client to hyperlink cells and editors below it. The workspace provides
6
+ * it from its `linkClient` prop; hosts rendering a grid or form on their own can wrap them in it.
7
+ */
8
+ export declare function PagedLinkClientProvider(props: {
9
+ client: PagedCollectionLinkClient | undefined;
10
+ children: ReactNode;
11
+ }): import("react").JSX.Element;
12
+ export declare const usePagedLinkClient: () => PagedCollectionLinkClient | undefined;
13
+ /** A stored hyperlink as a link. Plain clicks go to the host's `open` first. */
14
+ export declare function PagedHyperlinkView(props: {
15
+ value: unknown;
16
+ style?: CSSProperties;
17
+ }): import("react").JSX.Element | null;
18
+ /** Draft text of a hyperlink: JSON for a complete value, else whatever the user typed. */
19
+ export declare const hyperlinkDraft: (value: PagedHyperlinkValue | null) => string;
20
+ /**
21
+ * Quick picker for a hyperlink: one box that searches the host's resources (documents, tables, …)
22
+ * and takes a pasted or typed URL. Picking sets the link; Enter saves when nothing is highlighted.
23
+ */
24
+ export declare function PagedHyperlinkInput(props: {
25
+ field: PagedCollectionField;
26
+ text: string;
27
+ onChange(text: string): void;
28
+ onSave?: (() => void) | undefined;
29
+ onCancel?: (() => void) | undefined;
30
+ disabled?: boolean | undefined;
31
+ id?: string | undefined;
32
+ ariaLabel: string;
33
+ invalid?: boolean | undefined;
34
+ describedBy?: string | undefined;
35
+ locale?: PagedCollectionLocale | undefined;
36
+ inputStyle?: CSSProperties;
37
+ inputClassName?: string;
38
+ }): import("react").JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { PagedCollectionField, PagedCollectionMutation, PagedCollectionRecord } from "@uibot/contracts";
1
+ import { type PagedCollectionField, type PagedCollectionMutation, type PagedCollectionRecord } from "@uibot/contracts";
2
2
  import { type PagedCollectionLocale } from "./paged-locale.js";
3
3
  export interface CellPosition {
4
4
  row: number;
@@ -5,7 +5,7 @@ import type { CollectionUiSlots } from "../collection-ui.js";
5
5
  * Field list for the toolbar: search, show/hide with the eye, drag to reorder (Alt+Arrow keys too),
6
6
  * "…" to edit the field and an add-field row. Order and visibility write the view draft.
7
7
  */
8
- export declare function FieldConfigList({ fields, view, onChange, locale, ui, onEditField, onAddField, }: {
8
+ export declare function FieldConfigList({ fields, view, onChange, locale, ui, onEditField, onAddField, onEditAllFields, }: {
9
9
  fields: PagedCollectionField[];
10
10
  view: PagedCollectionView;
11
11
  onChange(view: PagedCollectionView): void;
@@ -13,4 +13,6 @@ export declare function FieldConfigList({ fields, view, onChange, locale, ui, on
13
13
  ui?: CollectionUiSlots | undefined;
14
14
  onEditField?: ((fieldId: string) => void) | undefined;
15
15
  onAddField?: (() => void) | undefined;
16
+ /** Opens the full schema panel for bulk edits (and the table title). */
17
+ onEditAllFields?: (() => void) | undefined;
16
18
  }): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { type ReactNode, type RefObject } from "react";
2
+ /**
3
+ * Floating editor for one field, anchored under its column header like Feishu and Airtable. With
4
+ * no header to anchor to (the field is hidden, or a non-grid view) it sits at the top right of
5
+ * `container`. Escape cancels; a click outside cancels only while nothing has changed.
6
+ */
7
+ export declare function FieldEditorPopover(props: {
8
+ container: RefObject<HTMLElement | null>;
9
+ /** Field whose column header anchors the editor; the "+" header button when absent. */
10
+ anchorFieldId?: string | undefined;
11
+ title: string;
12
+ dirty: boolean;
13
+ onCancel(): void;
14
+ children: ReactNode;
15
+ }): import("react").JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { PagedCollectionField, PagedCollectionFilterLeaf, PagedCollectionFilterNode, PagedCollectionQuery, PagedCollectionRecord, PagedCollectionView } from "@uibot/contracts";
1
+ import { type PagedCollectionField, type PagedCollectionFilterLeaf, type PagedCollectionFilterNode, type PagedCollectionQuery, type PagedCollectionRecord, type PagedCollectionView } from "@uibot/contracts";
2
2
  import type { PagedCollectionComputedError } from "@uibot/contracts";
3
3
  export interface KanbanLane {
4
4
  id: string;
@@ -1,7 +1,8 @@
1
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
- export type PagedSchemaFieldType = "singleLineText" | "longText" | "number" | "checkbox" | "date" | "singleSelect" | "multipleSelect" | "relation";
4
+ export type PagedSchemaFieldType = "singleLineText" | "longText" | "number" | "checkbox" | "date" | "singleSelect" | "multipleSelect" | "relation" | "hyperlink";
5
+ export declare const PAGED_SCHEMA_DEFAULT_TYPES: ReadonlyArray<PagedSchemaFieldType>;
5
6
  export interface PagedCollectionSchemaEditorProps {
6
7
  fields: PagedCollectionField[];
7
8
  onChange: (fields: PagedCollectionField[]) => void;
@@ -17,6 +18,13 @@ export interface PagedCollectionSchemaEditorProps {
17
18
  id: string;
18
19
  name: string;
19
20
  }>;
21
+ /**
22
+ * Edits one field on its own (the column editor): no "Add field" or delete buttons, just the
23
+ * field's settings. Pass that one field in `fields`; `contextFields` lists the table's others.
24
+ */
25
+ single?: boolean;
26
+ /** The table's other fields, for settings that refer to them (AI sources) in `single` mode. */
27
+ contextFields?: ReadonlyArray<PagedCollectionField>;
20
28
  /** Existing fields whose type cannot change and that cannot be deleted (add-only schemas). */
21
29
  lockedFieldIds?: ReadonlyArray<string>;
22
30
  /**
@@ -37,4 +45,4 @@ export interface PagedCollectionSchemaEditorProps {
37
45
  * save/CAS flow. Keyboard focus follows add/remove so repeated entry never needs the mouse.
38
46
  * Colours come from `--uibot-schema-*` variables with neutral fallbacks.
39
47
  */
40
- export declare function PagedCollectionSchemaEditor({ fields, onChange, disabled, focusFieldId, locale, ui, fieldTypes, relationTargets, lockedFieldIds, settings, }: PagedCollectionSchemaEditorProps): import("react").JSX.Element;
48
+ export declare function PagedCollectionSchemaEditor({ fields, onChange, disabled, focusFieldId, locale, ui, fieldTypes, relationTargets, lockedFieldIds, settings, single, contextFields, }: PagedCollectionSchemaEditorProps): import("react").JSX.Element;