@llmnative/react 1.0.0 → 1.2.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/README.md +11 -1
- package/dist/index.css +3 -1
- package/dist/index.js +20 -23
- package/dist/index.mjs +18045 -16868
- package/dist/types/src/App.d.ts +4 -1
- package/dist/types/src/I18n.d.ts +4 -0
- package/dist/types/src/components/ErrorBoundary.d.ts +1 -1
- package/dist/types/src/components/blocks/Brand.d.ts +5 -0
- package/dist/types/src/components/blocks/Carousel.d.ts +2 -0
- package/dist/types/src/components/blocks/Dropdown.d.ts +39 -2
- package/dist/types/src/components/blocks/ListCard.d.ts +7 -0
- package/dist/types/src/components/blocks/Menu.d.ts +2 -0
- package/dist/types/src/components/blocks/Notifications.d.ts +4 -1
- package/dist/types/src/components/blocks/ProviderSwitcher.d.ts +3 -1
- package/dist/types/src/components/blocks/Search.d.ts +1 -0
- package/dist/types/src/components/blocks/ThemeSwitcher.d.ts +6 -2
- package/dist/types/src/components/blocks/Toolbar.d.ts +4 -0
- package/dist/types/src/components/index.d.ts +2 -2
- package/dist/types/src/components/ui/Alert.d.ts +5 -1
- package/dist/types/src/components/ui/Badge.d.ts +6 -0
- package/dist/types/src/components/ui/Buttons.d.ts +5 -2
- package/dist/types/src/components/ui/Card.d.ts +3 -0
- package/dist/types/src/components/ui/Code.d.ts +4 -0
- package/dist/types/src/components/ui/Gallery.d.ts +9 -2
- package/dist/types/src/components/ui/GridSystem.d.ts +4 -1
- package/dist/types/src/components/ui/Icon.d.ts +3 -0
- package/dist/types/src/components/ui/Image.d.ts +6 -0
- package/dist/types/src/components/ui/ImageAvatar.d.ts +3 -0
- package/dist/types/src/components/ui/Loader.d.ts +3 -1
- package/dist/types/src/components/ui/Modal.d.ts +22 -0
- package/dist/types/src/components/ui/Pagination.d.ts +2 -0
- package/dist/types/src/components/ui/Percentage.d.ts +9 -0
- package/dist/types/src/components/ui/Repeat.d.ts +0 -1
- package/dist/types/src/components/ui/Tab.d.ts +1 -1
- package/dist/types/src/components/ui/Table.d.ts +3 -0
- package/dist/types/src/components/ui/fields/CodeEditor.d.ts +9 -1
- package/dist/types/src/components/ui/fields/ContextMenu.d.ts +74 -1
- package/dist/types/src/components/ui/fields/RichText.d.ts +4 -1
- package/dist/types/src/components/ui/fields/Select.d.ts +2 -2
- package/dist/types/src/components/ui/fields/Upload.d.ts +17 -4
- package/dist/types/src/components/widgets/Form.d.ts +14 -3
- package/dist/types/src/components/widgets/Prompt.d.ts +35 -15
- package/dist/types/src/components/widgets/grid-core/GridCore.d.ts +1 -1
- package/dist/types/src/components/widgets/grid-core/GridGalleryView.d.ts +1 -1
- package/dist/types/src/components/widgets/grid-core/types.d.ts +79 -3
- package/dist/types/src/components/widgets/grid-core/useGridActions.d.ts +1 -1
- package/dist/types/src/index.d.ts +15 -5
- package/dist/types/src/libs/editorHeight.d.ts +11 -1
- package/dist/types/src/libs/fetch.d.ts +2 -0
- package/dist/types/src/providers/ProviderDescriptor.d.ts +18 -0
- package/dist/types/src/providers/ai/AIProvider.d.ts +54 -1
- package/dist/types/src/providers/ai/index.d.ts +13 -2
- package/dist/types/src/providers/ai/openaiCompatible.d.ts +25 -1
- package/dist/types/src/providers/ai/shared.d.ts +13 -4
- package/dist/types/src/providers/auth/AuthProvider.d.ts +8 -0
- package/dist/types/src/providers/auth/firebase/FirebaseAuthProvider.d.ts +23 -0
- package/dist/types/src/providers/auth/google/auth.d.ts +1 -1
- package/dist/types/src/providers/data/DataProvider.d.ts +8 -0
- package/dist/types/src/providers/data/firestore.d.ts +19 -1
- package/dist/types/src/providers/email/definitions.d.ts +3 -0
- package/dist/types/src/providers/firebase-init.d.ts +11 -5
- package/dist/types/src/providers/publish/PublishProvider.d.ts +29 -0
- package/dist/types/src/providers/publish/definitions.d.ts +3 -0
- package/dist/types/src/providers/storage/firebase.d.ts +7 -1
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +62 -53
- package/package.json +58 -54
- package/scripts/cli/setup-devtools.js +8 -7
- package/scripts/cli/setup-project.js +23 -19
- package/themes/cyber.ts +8 -7
- package/themes/default.ts +22 -7
- package/themes/flat.ts +8 -7
- package/dist/style.css +0 -1
- package/dist/types/src/providers/email/google/apis/email.d.ts +0 -7
|
@@ -26,7 +26,9 @@ export interface TableProps extends UIProps {
|
|
|
26
26
|
onRowClick?: (record: RecordProps) => void;
|
|
27
27
|
onReorder?: TableReorderHandler;
|
|
28
28
|
onSelectionChange?: TableSelectionChangeHandler;
|
|
29
|
+
/** Selection mode: `"single"` or `"multiple"`. */
|
|
29
30
|
selection?: TableSelectionMode;
|
|
31
|
+
/** Enable sorting, optionally with a default sort config. */
|
|
30
32
|
sortable?: boolean | OrderConfig;
|
|
31
33
|
pagination?: PaginationParams;
|
|
32
34
|
activeKey?: string | null;
|
|
@@ -38,6 +40,7 @@ export interface TableProps extends UIProps {
|
|
|
38
40
|
heightClassName?: string;
|
|
39
41
|
scrollClassName?: string;
|
|
40
42
|
selectedClassName?: string;
|
|
43
|
+
/** Custom cell renderer. Receives the record, column key, and absolute row index. */
|
|
41
44
|
renderCell?: (record: RecordProps, key: string, absoluteIndex: number) => React.ReactNode;
|
|
42
45
|
}
|
|
43
46
|
declare function Table({ columns, records, footer, onRowClick, onReorder, onSelectionChange, selection, sortable, pagination, activeKey, selectedKeys, groupBy, before, after, wrapperClassName, className, headerClassName, bodyClassName, footerClassName, heightClassName, scrollClassName, selectedClassName, renderCell }: TableProps): React.JSX.Element;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormFieldProps } from '../../widgets/Form';
|
|
3
|
+
import { type EditorHeight } from '../../../libs/editorHeight';
|
|
3
4
|
import type { FieldValue } from '../../../providers/data/DataProvider';
|
|
5
|
+
import { type EditorCommand } from './ContextMenu';
|
|
4
6
|
export type CodeEditorLanguage = 'liquid' | 'html' | 'json' | 'js' | 'ts' | 'css';
|
|
5
7
|
export interface CodeSyntaxErrorDetails {
|
|
6
8
|
language: CodeEditorLanguage;
|
|
@@ -28,7 +30,11 @@ export declare const getCodeValidationResult: (code: string, language: CodeEdito
|
|
|
28
30
|
export interface CodeEditorProps extends FormFieldProps {
|
|
29
31
|
language?: CodeEditorLanguage;
|
|
30
32
|
placeholder?: string;
|
|
31
|
-
|
|
33
|
+
/** A pixel value, or `'fill'` to stretch to the parent container's height (with the
|
|
34
|
+
* editor's own internal scroll) instead of a fixed size — see `EditorHeight`. The
|
|
35
|
+
* parent must actually provide a real height (e.g. a flex column with `flex-1 min-h-0`)
|
|
36
|
+
* for `'fill'` to have any effect. */
|
|
37
|
+
minHeight?: EditorHeight;
|
|
32
38
|
maxHeight?: number;
|
|
33
39
|
label?: string;
|
|
34
40
|
required?: boolean;
|
|
@@ -38,6 +44,8 @@ export interface CodeEditorProps extends FormFieldProps {
|
|
|
38
44
|
validateSyntax?: boolean;
|
|
39
45
|
validator?: (value: FieldValue) => string | undefined | Promise<string | undefined>;
|
|
40
46
|
extensions?: unknown[];
|
|
47
|
+
commands?: EditorCommand[];
|
|
48
|
+
commandsTrigger?: string;
|
|
41
49
|
}
|
|
42
50
|
export declare const CodeEditor: React.FC<CodeEditorProps>;
|
|
43
51
|
export default CodeEditor;
|
|
@@ -4,16 +4,64 @@ export interface ContextMenuItem {
|
|
|
4
4
|
label: string;
|
|
5
5
|
value: string;
|
|
6
6
|
icon?: string;
|
|
7
|
+
/** Secondary muted text under the label — e.g. a variable's description/type. */
|
|
8
|
+
description?: string;
|
|
7
9
|
}
|
|
8
10
|
export interface EditorContext {
|
|
11
|
+
value: string;
|
|
9
12
|
textBeforeCaret: string;
|
|
10
13
|
textAfterCaret: string;
|
|
14
|
+
trigger: string;
|
|
15
|
+
query: string;
|
|
16
|
+
triggerRange: {
|
|
17
|
+
start: number;
|
|
18
|
+
end: number;
|
|
19
|
+
};
|
|
11
20
|
insert: (text: string) => void;
|
|
12
21
|
replace: (start: number, end: number, text: string) => void;
|
|
13
22
|
}
|
|
23
|
+
export interface TextCommandContext {
|
|
24
|
+
value: string;
|
|
25
|
+
textBeforeCaret: string;
|
|
26
|
+
textAfterCaret: string;
|
|
27
|
+
trigger: string;
|
|
28
|
+
query: string;
|
|
29
|
+
}
|
|
30
|
+
export interface EditorCommand {
|
|
31
|
+
name: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
icon?: string;
|
|
34
|
+
/** Groups commands under a `ContextMenu.Heading` in menu order — commands sharing the
|
|
35
|
+
* same `group` string render contiguously under one heading (see CodeEditor.tsx's
|
|
36
|
+
* `commandMenuItems`/render logic, which does the grouping/heading-insertion). Commands
|
|
37
|
+
* without a `group` render ungrouped, in their original order. */
|
|
38
|
+
group?: string;
|
|
39
|
+
/** Optional auto-closed suffix to consume when replacing the active trigger. Useful when
|
|
40
|
+
* a command changes syntactic family, for example from `{{ ... }}` to `{% ... %}`. */
|
|
41
|
+
consumeSuffix?: string;
|
|
42
|
+
handler?: (context: TextCommandContext) => string | Promise<string>;
|
|
43
|
+
}
|
|
44
|
+
export interface ContextMenuControlledState {
|
|
45
|
+
open: boolean;
|
|
46
|
+
anchorPosition: {
|
|
47
|
+
top: number;
|
|
48
|
+
left: number;
|
|
49
|
+
} | null;
|
|
50
|
+
query: string;
|
|
51
|
+
editorContext: EditorContext;
|
|
52
|
+
onClose: () => void;
|
|
53
|
+
}
|
|
54
|
+
export interface ContextMenuHandle {
|
|
55
|
+
moveNext: () => void;
|
|
56
|
+
movePrev: () => void;
|
|
57
|
+
selectActive: () => void;
|
|
58
|
+
close: () => void;
|
|
59
|
+
}
|
|
60
|
+
export declare const CONTEXT_MENU_SEARCH_THRESHOLD = 10;
|
|
14
61
|
interface ContextMenuProps extends UIProps {
|
|
15
62
|
trigger: string;
|
|
16
63
|
searchable?: boolean;
|
|
64
|
+
controlled?: ContextMenuControlledState;
|
|
17
65
|
onSelect?: (item: ContextMenuItem, context: EditorContext) => void;
|
|
18
66
|
children: React.ReactNode;
|
|
19
67
|
}
|
|
@@ -21,6 +69,8 @@ interface ContextMenuItemProps extends UIProps {
|
|
|
21
69
|
label: string;
|
|
22
70
|
value: string;
|
|
23
71
|
icon?: string;
|
|
72
|
+
/** Secondary muted text under the label — e.g. a variable's description/type. */
|
|
73
|
+
description?: string;
|
|
24
74
|
}
|
|
25
75
|
interface ContextMenuHeadingProps {
|
|
26
76
|
children: React.ReactNode;
|
|
@@ -29,10 +79,33 @@ interface ContextMenuHeadingProps {
|
|
|
29
79
|
interface ContextMenuSeparatorProps {
|
|
30
80
|
className?: string;
|
|
31
81
|
}
|
|
32
|
-
type ContextMenuComponent = React.
|
|
82
|
+
type ContextMenuComponent = React.ForwardRefExoticComponent<ContextMenuProps & React.RefAttributes<ContextMenuHandle>> & {
|
|
33
83
|
Item: React.FC<ContextMenuItemProps>;
|
|
34
84
|
Heading: React.FC<ContextMenuHeadingProps>;
|
|
35
85
|
Separator: React.FC<ContextMenuSeparatorProps>;
|
|
36
86
|
};
|
|
87
|
+
type QueryMatch = {
|
|
88
|
+
query: string;
|
|
89
|
+
start: number;
|
|
90
|
+
end: number;
|
|
91
|
+
};
|
|
92
|
+
type CommandTriggerMatchOptions = {
|
|
93
|
+
queryPattern?: RegExp;
|
|
94
|
+
requireWhitespacePrefix?: boolean;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Whether `textAfterCaret` (from `TextCommandContext`/`EditorContext`) already starts with
|
|
98
|
+
* `closer`, optionally preceded by whitespace — typically because the editor's own
|
|
99
|
+
* bracket/quote auto-closing inserted it when the user typed the opening one. A command
|
|
100
|
+
* `handler` that would otherwise insert a closer of its own (e.g. `"{{ x }}"`) should check
|
|
101
|
+
* this first and omit its own closer when true, to avoid a duplicate
|
|
102
|
+
* (`"{{ x }}}}"` instead of the intended `"{{ x }}"`).
|
|
103
|
+
*/
|
|
104
|
+
export declare const hasAutoClosedSuffix: (textAfterCaret: string, closer: string) => boolean;
|
|
105
|
+
/** Returns the number of characters occupied by an auto-closed suffix, including whitespace
|
|
106
|
+
* before it, or zero when the requested suffix is not present. */
|
|
107
|
+
export declare const getAutoClosedSuffixLength: (textAfterCaret: string, closer: string) => number;
|
|
108
|
+
export declare const matchCommandTrigger: (value: string, caret: number, trigger: string, options?: CommandTriggerMatchOptions) => QueryMatch | null;
|
|
109
|
+
export declare const buildTextCommandContext: (context: EditorContext) => TextCommandContext;
|
|
37
110
|
declare const ContextMenu: ContextMenuComponent;
|
|
38
111
|
export { ContextMenu };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormFieldProps } from '../../widgets/Form';
|
|
3
3
|
import type { FieldValue } from '../../../providers/data/DataProvider';
|
|
4
|
+
import { type EditorCommand } from './ContextMenu';
|
|
4
5
|
export type ToolbarCommand = 'bold' | 'italic' | 'underline' | 'strike' | 'headings' | 'heading1' | 'heading2' | 'heading3' | 'bulletList' | 'orderedList' | 'blockquote' | 'code' | 'codeBlock' | 'link' | 'table' | 'imageUpload' | 'documentUpload' | 'sourceCode' | 'undo' | 'redo' | 'clearFormat' | '|';
|
|
5
6
|
export interface StatusBarConfig {
|
|
6
7
|
/** Show the DOM ancestor tag breadcrumb at the cursor (e.g. p › strong). Default: true. */
|
|
@@ -81,6 +82,8 @@ export interface RichTextProps extends FormFieldProps {
|
|
|
81
82
|
documentUpload?: RichTextDocumentUploadConfig;
|
|
82
83
|
labelClassName?: string;
|
|
83
84
|
validator?: (value: FieldValue) => string | undefined;
|
|
85
|
+
commands?: EditorCommand[];
|
|
86
|
+
commandsTrigger?: string;
|
|
84
87
|
}
|
|
85
|
-
export declare const RichText: ({ name, onChange, defaultValue, label, required, placeholder, disabled, feedback, toolbar, toolbarCommands, outputFormat, statusBar, minHeight, maxHeight, imageUpload, documentUpload, labelClassName, inheritWrapperClassName, wrapperClassName, className, before, after, validator, }: RichTextProps) => React.JSX.Element;
|
|
88
|
+
export declare const RichText: ({ name, onChange, defaultValue, label, required, placeholder, disabled, feedback, toolbar, toolbarCommands, outputFormat, statusBar, minHeight, maxHeight, imageUpload, documentUpload, labelClassName, inheritWrapperClassName, wrapperClassName, className, before, after, validator, commands, commandsTrigger, }: RichTextProps) => React.JSX.Element;
|
|
86
89
|
export default RichText;
|
|
@@ -36,6 +36,6 @@ export interface ChecklistProps extends BaseProps {
|
|
|
36
36
|
itemClassName?: string;
|
|
37
37
|
}
|
|
38
38
|
export declare const Select: ({ name, onChange, defaultValue, required, readOnlyAfterSet, disabled, placeholderOption, label, title, before, after, feedback, options, optionsSource, order, inheritWrapperClassName, wrapperClassName, className, validator, }: SelectProps) => React.JSX.Element;
|
|
39
|
-
export declare const Autocomplete: ({ name, defaultValue, minItems, maxItems, onChange, required, readOnlyAfterSet, disabled, label, title, placeholder, before, after, feedback, options, optionsSource, order, inheritWrapperClassName, wrapperClassName, className, creatable, onCreate, }: AutocompleteProps) => React.JSX.Element;
|
|
40
|
-
export declare const Checklist: ({ name, defaultValue, onChange, required, readOnlyAfterSet, disabled, label, title, before, after, feedback, options, optionsSource, order, inheritWrapperClassName, wrapperClassName, className, itemClassName, }: ChecklistProps) => React.JSX.Element;
|
|
39
|
+
export declare const Autocomplete: ({ name, defaultValue, minItems, maxItems, onChange, required, readOnlyAfterSet, disabled, label, title, placeholder, before, after, feedback, options, optionsSource, order, inheritWrapperClassName, wrapperClassName, className, validator, creatable, onCreate, }: AutocompleteProps) => React.JSX.Element;
|
|
40
|
+
export declare const Checklist: ({ name, defaultValue, onChange, required, readOnlyAfterSet, disabled, label, title, before, after, feedback, options, optionsSource, order, inheritWrapperClassName, wrapperClassName, className, validator, itemClassName, }: ChecklistProps) => React.JSX.Element;
|
|
41
41
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FormFieldProps } from "../../widgets/Form";
|
|
3
|
+
import type { StorageProviderAdapter } from "../../../providers/storage/StorageProvider";
|
|
3
4
|
export interface FileProps {
|
|
4
5
|
key: string;
|
|
5
6
|
fileName: string;
|
|
@@ -28,11 +29,19 @@ export interface UseFileUploadCoreOptions {
|
|
|
28
29
|
srcsetWidths?: number[];
|
|
29
30
|
/** Initial file list (e.g. from a form record on load). */
|
|
30
31
|
initialFiles?: FileProps[];
|
|
32
|
+
/** Named storage provider slot to upload through — omit for the default. */
|
|
33
|
+
storageKey?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Direct adapter instance — takes priority over `storageKey` when set. For callers that
|
|
36
|
+
* already computed the right adapter themselves (e.g. a per-record bucket resolved from
|
|
37
|
+
* that record's own fields, not from a registry key) rather than one registered globally.
|
|
38
|
+
*/
|
|
39
|
+
storageProvider?: StorageProviderAdapter | null;
|
|
31
40
|
}
|
|
32
|
-
export declare const useFileUploadCore: ({ onFilesChange, onFileReady, uploadPath, srcsetWidths, initialFiles, }: UseFileUploadCoreOptions) => {
|
|
41
|
+
export declare const useFileUploadCore: ({ onFilesChange, onFileReady, uploadPath, srcsetWidths, initialFiles, storageKey, storageProvider, }: UseFileUploadCoreOptions) => {
|
|
33
42
|
files: FileProps[];
|
|
34
43
|
setFiles: React.Dispatch<React.SetStateAction<FileProps[]>>;
|
|
35
|
-
fileInputRef: React.
|
|
44
|
+
fileInputRef: React.RefObject<HTMLInputElement | null>;
|
|
36
45
|
updateFile: (key: string, updates: Partial<FileProps>) => void;
|
|
37
46
|
handleFiles: (selectedFiles: File[]) => void;
|
|
38
47
|
handleUpload: () => void | undefined;
|
|
@@ -46,6 +55,10 @@ export interface UploadDocumentProps extends FormFieldProps {
|
|
|
46
55
|
max?: number;
|
|
47
56
|
/** StorageProvider path — when set, files are auto-uploaded on selection. */
|
|
48
57
|
uploadPath?: string;
|
|
58
|
+
/** Named storage provider slot to upload through — omit for the default. */
|
|
59
|
+
storageKey?: string;
|
|
60
|
+
/** Direct adapter instance — takes priority over `storageKey` when set. */
|
|
61
|
+
storageProvider?: StorageProviderAdapter | null;
|
|
49
62
|
}
|
|
50
63
|
export interface UploadImageProps extends UploadDocumentProps {
|
|
51
64
|
previewHeight?: number;
|
|
@@ -56,5 +69,5 @@ export interface UploadImageProps extends UploadDocumentProps {
|
|
|
56
69
|
srcsetWidths?: number[];
|
|
57
70
|
}
|
|
58
71
|
export declare const getFileUrl: (file: FileProps, suffix?: string) => string;
|
|
59
|
-
export declare const UploadDocument: ({ name, onChange, label, required, editable, multiple, max, accept, uploadPath, before, after, wrapperClassName, className, }: UploadDocumentProps) => React.JSX.Element;
|
|
60
|
-
export declare const UploadImage: ({ name, onChange, label, feedback, editable, multiple, accept, required, max, previewHeight, previewWidth, uploadPath, srcsetWidths, before, after, wrapperClassName, className, }: UploadImageProps) => React.JSX.Element;
|
|
72
|
+
export declare const UploadDocument: ({ name, onChange, label, required, editable, multiple, max, accept, uploadPath, storageKey, storageProvider, before, after, wrapperClassName, className, }: UploadDocumentProps) => React.JSX.Element;
|
|
73
|
+
export declare const UploadImage: ({ name, onChange, label, feedback, editable, multiple, accept, required, max, previewHeight, previewWidth, uploadPath, srcsetWidths, storageKey, storageProvider, before, after, wrapperClassName, className, }: UploadImageProps) => React.JSX.Element;
|
|
@@ -118,11 +118,14 @@ interface BaseFormProps {
|
|
|
118
118
|
log?: boolean;
|
|
119
119
|
/** Show the inline save/delete notice banner. Defaults to `true`. */
|
|
120
120
|
showNotice?: boolean;
|
|
121
|
-
/**
|
|
122
|
-
|
|
121
|
+
/**
|
|
122
|
+
* Stable bucket that isolates this form's local draft. Omit to disable draft persistence.
|
|
123
|
+
* The Form appends its own path/route identity, so one bucket safely serves many forms.
|
|
124
|
+
*/
|
|
125
|
+
draftBucket?: string;
|
|
123
126
|
/** When provided, the save/delete notice is rendered sticky at the top of this container
|
|
124
127
|
* instead of inline in the form footer. Ideal for full-page forms outside a modal. */
|
|
125
|
-
noticeAnchorRef?: React.RefObject<HTMLElement>;
|
|
128
|
+
noticeAnchorRef?: React.RefObject<HTMLElement | null>;
|
|
126
129
|
/** Render a Back navigation button in the footer. */
|
|
127
130
|
showBack?: boolean;
|
|
128
131
|
/** CSS classes on the outermost wrapper element. */
|
|
@@ -133,6 +136,14 @@ interface BaseFormProps {
|
|
|
133
136
|
className?: string;
|
|
134
137
|
/** CSS classes on the footer container. */
|
|
135
138
|
footerClassName?: string;
|
|
139
|
+
/**
|
|
140
|
+
* CSS classes on the native `<form>` element itself — distinct from `wrapperClassName`
|
|
141
|
+
* (the outer `Wrapper` div) and `className` ("card" appearance's body). Needed whenever
|
|
142
|
+
* a layout must cascade real height/flex context through the form (e.g. a full-height
|
|
143
|
+
* field like `CodeEditor`'s `minHeight="fill"`) instead of reaching in via an arbitrary
|
|
144
|
+
* `[&>form]:` child selector on `wrapperClassName`.
|
|
145
|
+
*/
|
|
146
|
+
formClassName?: string;
|
|
136
147
|
}
|
|
137
148
|
interface FormDefaultProps extends BaseFormProps {
|
|
138
149
|
children: React.ReactNode | ((fields: FormTree) => React.ReactNode) | ((args: {
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PromptVariables } from '../../conf/Prompt';
|
|
3
3
|
import { type AIProviderAdapter, type AIRequestOptions, type AIAttachment } from '../../providers/ai/AIProvider';
|
|
4
|
+
import { RecordProps } from '../../providers/data/DataProvider';
|
|
5
|
+
import { type EditorCommand } from '../ui/fields/ContextMenu';
|
|
4
6
|
import { FormFieldProps } from './Form';
|
|
5
7
|
export declare enum PromptMode {
|
|
6
8
|
EDIT = "edit",
|
|
7
9
|
RUN = "run"
|
|
8
10
|
}
|
|
9
|
-
export type PromptCommand = {
|
|
10
|
-
name: string;
|
|
11
|
-
description?: string;
|
|
12
|
-
icon?: string;
|
|
13
|
-
handler?: (currentValue: string) => string | Promise<string>;
|
|
14
|
-
};
|
|
15
11
|
export type PromptAction = {
|
|
16
12
|
key: string;
|
|
17
13
|
icon: string;
|
|
@@ -33,6 +29,9 @@ export type PromptRunStats = {
|
|
|
33
29
|
type PromptOptions = AIRequestOptions & {
|
|
34
30
|
value: string;
|
|
35
31
|
};
|
|
32
|
+
type PromptConfig = Partial<PromptOptions> & {
|
|
33
|
+
enabled?: boolean;
|
|
34
|
+
};
|
|
36
35
|
type OnRunPrompt = (prompt: string, options: AIRequestOptions, data?: PromptVariables) => Promise<string>;
|
|
37
36
|
type PromptDefaultValue = {
|
|
38
37
|
value?: string;
|
|
@@ -51,26 +50,47 @@ type RenderAIUnavailable = (props: {
|
|
|
51
50
|
reason?: string;
|
|
52
51
|
configured: boolean;
|
|
53
52
|
}) => React.ReactNode;
|
|
54
|
-
|
|
53
|
+
interface PromptFieldBase {
|
|
54
|
+
name: string;
|
|
55
|
+
label?: string;
|
|
56
|
+
required?: boolean;
|
|
57
|
+
onChange?: FormFieldProps["onChange"];
|
|
58
|
+
before?: React.ReactNode;
|
|
59
|
+
after?: React.ReactNode;
|
|
60
|
+
wrapperClassName?: string;
|
|
61
|
+
className?: string;
|
|
55
62
|
minHeight?: number;
|
|
56
63
|
maxHeight?: number;
|
|
64
|
+
}
|
|
65
|
+
interface PromptWithAI extends PromptFieldBase {
|
|
57
66
|
defaultValue?: PromptDefaultValue;
|
|
58
67
|
renderAIUnavailable?: RenderAIUnavailable;
|
|
68
|
+
}
|
|
69
|
+
interface PromptEditorProps extends PromptWithAI {
|
|
70
|
+
value?: RecordProps & {
|
|
71
|
+
prompt?: PromptConfig;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
interface PromptRunProps extends PromptWithAI {
|
|
75
|
+
value?: RecordProps & {
|
|
76
|
+
prompt?: PromptConfig;
|
|
77
|
+
};
|
|
59
78
|
variables?: PromptVariables;
|
|
60
|
-
};
|
|
61
|
-
type PromptEditProps = PromptSharedProps & {
|
|
62
|
-
mode?: PromptMode.EDIT;
|
|
63
|
-
};
|
|
64
|
-
type PromptRunProps = PromptSharedProps & {
|
|
65
|
-
mode: PromptMode.RUN;
|
|
66
79
|
onRunPrompt?: OnRunPrompt;
|
|
67
80
|
renderFallback?: RenderPlainFallback;
|
|
68
|
-
commands?:
|
|
81
|
+
commands?: EditorCommand[];
|
|
82
|
+
commandsTrigger?: string;
|
|
69
83
|
attachments?: boolean;
|
|
70
84
|
actions?: PromptAction[];
|
|
71
85
|
statusItems?: PromptStatusItem[];
|
|
86
|
+
}
|
|
87
|
+
type PromptEditBranch = PromptEditorProps & {
|
|
88
|
+
mode?: PromptMode.EDIT;
|
|
89
|
+
};
|
|
90
|
+
type PromptRunBranch = PromptRunProps & {
|
|
91
|
+
mode: PromptMode.RUN;
|
|
72
92
|
};
|
|
73
|
-
export type PromptProps =
|
|
93
|
+
export type PromptProps = PromptEditBranch | PromptRunBranch;
|
|
74
94
|
export declare const Prompt: ({ mode, ...props }: PromptProps) => React.JSX.Element;
|
|
75
95
|
export declare const runPrompt: (options: PromptOptions, data?: PromptVariables, onRunPrompt?: OnRunPrompt, provider?: AIProviderAdapter, attachments?: AIAttachment[], messages?: {
|
|
76
96
|
noProvider?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type RecordProps } from "../../../providers/data/DataProvider";
|
|
3
3
|
import { type GridCoreProps } from "./types";
|
|
4
|
-
declare function GridCore<TRecord extends RecordProps>({ records, recordId, sourcePath, columns, actions, form, editDeepLink, header, footer, view, sticky, wrapperClassName, loading, title, before, after, sortable, pagination, selection, onRowClick, reorderable, onReorder, groupBy, onSave, onDelete, onComplete, audit, onLoad, }: GridCoreProps<TRecord>): React.JSX.Element;
|
|
4
|
+
declare function GridCore<TRecord extends RecordProps>({ records, recordId, sourcePath, columns, actions, form, editDeepLink, header, footer, view, views, sticky, wrapperClassName, loading, title, before, after, sortable, pagination, selection, onRowClick, reorderable, onReorder, groupBy, onSave, onDelete, onComplete, audit, onLoad, }: GridCoreProps<TRecord>): React.JSX.Element;
|
|
5
5
|
export default GridCore;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type RecordProps } from "../../../providers/data/DataProvider";
|
|
3
3
|
import { type GridGalleryViewProps } from "./types";
|
|
4
|
-
declare function GridGalleryView<TRecord extends RecordProps>({ records, recordId, sortable, pagination, selection, selectedKeys, onSelectionChange, onRowClick, groupBy, wrapperClassName, before, after, }: GridGalleryViewProps<TRecord>): React.JSX.Element;
|
|
4
|
+
declare function GridGalleryView<TRecord extends RecordProps>({ records, recordId, sortable, pagination, selection, selectedKeys, onSelectionChange, onRowClick, groupBy, wrapperClassName, before, after, columns, overlays, }: GridGalleryViewProps<TRecord>): React.JSX.Element;
|
|
5
5
|
export default GridGalleryView;
|
|
@@ -1,11 +1,70 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type OrderConfig } from "../../../libs/order";
|
|
3
3
|
import { type PaginationParams } from "../../ui/Pagination";
|
|
4
|
+
import { type GalleryOverlay } from "../../ui/Gallery";
|
|
4
5
|
import { type DatabaseOptions, type RecordProps } from "../../../providers/data/DataProvider";
|
|
5
6
|
export type GridLayout = "table" | "gallery";
|
|
6
7
|
export type GridSticky = "top" | "bottom";
|
|
7
8
|
export type GridSelectionMode = false | "single" | "multiple";
|
|
8
9
|
export type GridRecordKey<TRecord> = keyof TRecord | ((record: TRecord) => string);
|
|
10
|
+
/**
|
|
11
|
+
* Declarative field shown as an overlay on a gallery card — distinct from `GridColumn`
|
|
12
|
+
* (which drives table columns): a card doesn't need the same fields as a table row,
|
|
13
|
+
* and has its own visibility picker (`views.gallery.fieldPicker`) separate from the
|
|
14
|
+
* table's `views.table.columnPicker`.
|
|
15
|
+
*/
|
|
16
|
+
export type GridGalleryField<TRecord> = {
|
|
17
|
+
/** Record field to read. Accepts dot-notation strings for nested fields. */
|
|
18
|
+
key: keyof TRecord | string;
|
|
19
|
+
/** Label shown in the field picker (not on the card itself — the card shows the value only). */
|
|
20
|
+
label: string;
|
|
21
|
+
/** Where on the card this field's value is overlaid. Defaults to `"bottomLeft"`. */
|
|
22
|
+
position?: "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "middleLeft" | "middleRight";
|
|
23
|
+
/** Whether this field is shown by default when `fieldPicker` is enabled. Defaults to `true`. */
|
|
24
|
+
defaultVisible?: boolean;
|
|
25
|
+
/** Custom render — defaults to the raw field value as text. */
|
|
26
|
+
render?: (value: unknown, record: TRecord) => React.ReactNode;
|
|
27
|
+
};
|
|
28
|
+
/** Table-specific view options, grouped under `views.table`. */
|
|
29
|
+
export type GridTableViewConfig = {
|
|
30
|
+
/** Show a built-in "Columns" dropdown letting the user show/hide table columns. Default `false`. */
|
|
31
|
+
columnPicker?: boolean;
|
|
32
|
+
};
|
|
33
|
+
/** Gallery-specific view options, grouped under `views.gallery`. */
|
|
34
|
+
export type GridGalleryViewConfig<TRecord> = {
|
|
35
|
+
/** Cards per row — one of `1|2|3|4|6` (the only values the underlying `Gallery` component supports). */
|
|
36
|
+
columns?: 1 | 2 | 3 | 4 | 6;
|
|
37
|
+
/**
|
|
38
|
+
* Declarative fields overlaid on each card (see `GridGalleryField`). Generates the
|
|
39
|
+
* overlays automatically and, combined with `fieldPicker`, a "Fields" dropdown
|
|
40
|
+
* analogous to the table's "Columns" picker — but a separate one, since a card
|
|
41
|
+
* typically shows fewer/different fields than a table row.
|
|
42
|
+
*/
|
|
43
|
+
fields?: GridGalleryField<TRecord>[];
|
|
44
|
+
/** Show the built-in "Fields" dropdown for `fields` above. Default `false`. */
|
|
45
|
+
fieldPicker?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Escape hatch: fully custom overlay renderers (forwarded to `<Gallery overlays>`),
|
|
48
|
+
* for anything `fields` can't express (e.g. an action button, not just a label).
|
|
49
|
+
* ADDITIVE to the overlays generated from `fields` — a caller commonly needs both at
|
|
50
|
+
* once (e.g. a Delete button plus checkable label fields); positions shared by both
|
|
51
|
+
* simply stack, with the custom overlay rendered first.
|
|
52
|
+
*/
|
|
53
|
+
overlays?: GalleryOverlay[];
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Groups every Table/Gallery-view-switching concern under one input, instead of a flat
|
|
57
|
+
* spray of booleans on `<Grid>` — `toggle` decides whether the switch exists at all,
|
|
58
|
+
* `table`/`gallery` hold the options specific to each view (column picker vs. field
|
|
59
|
+
* picker are deliberately two different controls, since a gallery card and a table row
|
|
60
|
+
* don't need to show the same fields).
|
|
61
|
+
*/
|
|
62
|
+
export type GridViewsConfig<TRecord> = {
|
|
63
|
+
/** Show the built-in Table/Gallery switch in the header, letting the user change the active view at runtime. Default `false` — `view` behaves as a fixed initial mode when omitted, same as before this existed. */
|
|
64
|
+
toggle?: boolean;
|
|
65
|
+
table?: GridTableViewConfig;
|
|
66
|
+
gallery?: GridGalleryViewConfig<TRecord>;
|
|
67
|
+
};
|
|
9
68
|
export type GridFormat = "text" | "email" | "date" | "datetime" | "badge" | "image" | "boolean" | "json";
|
|
10
69
|
export type GridCellContext<TRecord> = {
|
|
11
70
|
record: TRecord;
|
|
@@ -30,6 +89,8 @@ export type GridColumn<TRecord> = {
|
|
|
30
89
|
className?: string;
|
|
31
90
|
/** Built-in format name or custom render function. */
|
|
32
91
|
render?: GridFormat | ((ctx: GridCellContext<TRecord>) => React.ReactNode);
|
|
92
|
+
/** Whether this column is shown by default when `views.table.columnPicker` is enabled. Defaults to `true`. */
|
|
93
|
+
defaultVisible?: boolean;
|
|
33
94
|
};
|
|
34
95
|
export type GridSelectionState<TRecord> = {
|
|
35
96
|
keys: string[];
|
|
@@ -150,9 +211,11 @@ export type GridAfterActionArgs<TRecord> = {
|
|
|
150
211
|
};
|
|
151
212
|
export type GridAfterActionHandler<TRecord> = (args: GridAfterActionArgs<TRecord>) => Promise<boolean>;
|
|
152
213
|
/** Visual / layout props for `<Grid>`. */
|
|
153
|
-
export type GridPresentation = {
|
|
154
|
-
/** Display mode: `"table"` (default) or `"gallery"` card layout. */
|
|
214
|
+
export type GridPresentation<TRecord> = {
|
|
215
|
+
/** Display mode: `"table"` (default) or `"gallery"` card layout. Acts as the initial/default view — see `views.toggle` to let the user switch at runtime. */
|
|
155
216
|
view?: GridLayout;
|
|
217
|
+
/** Table/Gallery switch + per-view options (column picker, gallery field picker, cards-per-row, …) — see `GridViewsConfig`. Omit entirely to keep the pre-existing fixed-`view` behavior. */
|
|
218
|
+
views?: GridViewsConfig<TRecord>;
|
|
156
219
|
/** Stick the header (`"top"`) or footer (`"bottom"`) while scrolling. */
|
|
157
220
|
sticky?: GridSticky;
|
|
158
221
|
/** CSS classes on the outermost wrapper element. */
|
|
@@ -198,7 +261,7 @@ export type GridPersistence<TRecord> = {
|
|
|
198
261
|
* Full prop surface shared by all `<Grid>` variants.
|
|
199
262
|
* Combines presentation, behaviour, and persistence with a few top-level hooks.
|
|
200
263
|
*/
|
|
201
|
-
export type GridBaseProps<TRecord> = GridPresentation & GridBehavior<TRecord> & GridPersistence<TRecord> & {
|
|
264
|
+
export type GridBaseProps<TRecord> = GridPresentation<TRecord> & GridBehavior<TRecord> & GridPersistence<TRecord> & {
|
|
202
265
|
/** Transform the record array after loading (filter, sort, enrich). */
|
|
203
266
|
onLoad?: (records: TRecord[]) => TRecord[] | Promise<TRecord[]>;
|
|
204
267
|
/** Column definitions. Omit to auto-generate from record keys. */
|
|
@@ -222,6 +285,15 @@ export type GridCoreProps<TRecord extends RecordProps> = GridBaseProps<TRecord>
|
|
|
222
285
|
export type GridArrayProps<TRecord extends RecordProps> = GridBaseProps<TRecord> & {
|
|
223
286
|
records: TRecord[];
|
|
224
287
|
recordId: GridRecordKey<TRecord>;
|
|
288
|
+
/**
|
|
289
|
+
* Base path the `records` were sourced from (e.g. `/components`) — enables the built-in
|
|
290
|
+
* "delete" action's `db.remove(\`${sourcePath}/${recordKey}\`)` when the caller fetched
|
|
291
|
+
* its own records (e.g. via `db.subscribe()`) instead of letting Grid fetch them itself
|
|
292
|
+
* (`GridDBProps.path` does the equivalent there). Already threaded through to `GridCore`
|
|
293
|
+
* — this was just missing from the public prop surface for the `records` variant.
|
|
294
|
+
* Omit if delete is handled entirely via a custom `actions.delete`/`onDelete`.
|
|
295
|
+
*/
|
|
296
|
+
sourcePath?: string;
|
|
225
297
|
};
|
|
226
298
|
export type GridDBQuery = Pick<DatabaseOptions, "where" | "order" | "fieldMap">;
|
|
227
299
|
export type GridDBPath = string;
|
|
@@ -273,5 +345,9 @@ export type GridGalleryViewProps<TRecord extends RecordProps> = {
|
|
|
273
345
|
wrapperClassName?: string;
|
|
274
346
|
before?: React.ReactNode;
|
|
275
347
|
after?: React.ReactNode;
|
|
348
|
+
/** Cards per row — forwarded to `<Gallery columns>`. */
|
|
349
|
+
columns?: 1 | 2 | 3 | 4 | 6;
|
|
350
|
+
/** Overlay badges/render-props for each card — forwarded to `<Gallery overlays>`. */
|
|
351
|
+
overlays?: GalleryOverlay[];
|
|
276
352
|
};
|
|
277
353
|
export {};
|
|
@@ -31,7 +31,7 @@ declare function useGridActions<TRecord extends RecordProps>({ actions, form, ed
|
|
|
31
31
|
normalizedActions: Record<string, GridAction<TRecord>>;
|
|
32
32
|
activeAction: GridActiveAction<TRecord> | null;
|
|
33
33
|
activeActionConfig: GridAction<TRecord> | undefined;
|
|
34
|
-
activeActionBody: string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
34
|
+
activeActionBody: string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
35
35
|
activeKey: string | null;
|
|
36
36
|
runAction: (actionKey: string, record?: TRecord) => Promise<void>;
|
|
37
37
|
runModalAction: (actionKey: string) => Promise<void>;
|
|
@@ -2,7 +2,7 @@ import './globals.css';
|
|
|
2
2
|
export { default as App, AppProvider } from './App';
|
|
3
3
|
export { useMenu } from './App';
|
|
4
4
|
export type { AppProps, AppProviderProps, AppProvidersConfig, MenuConfig } from './App';
|
|
5
|
-
export type { AIConfig } from './Config';
|
|
5
|
+
export type { AIConfig, FirebaseConfig } from './Config';
|
|
6
6
|
export type { ServicesConfig, SupabaseProviderConfig, GoogleProviderConfig, MockProviderConfig, DataDriverName, StorageDriverName, AuthDriverName, EmailDriverName, AIDriverName, } from './providers/manifest';
|
|
7
7
|
export type { ProxyConfig } from './Config';
|
|
8
8
|
export { Head, HeadProvider, DEFAULT_DOCUMENT_HEAD, DEFAULT_HEAD_APP_NAME, DEFAULT_LANGUAGE_HEAD, useAssetsHead, useDocumentHead, useHead, useHeadLinks, useLanguageHead, usePaginationHead, usePwaHead, useSchemaOrgHead, useSocialHead, } from './Head';
|
|
@@ -18,10 +18,10 @@ export type { DataProviderAdapter, FieldValue, RecordProps, RecordArray, Databas
|
|
|
18
18
|
export type { OrderConfig, OrderDirection } from './libs/order';
|
|
19
19
|
export { Order } from './libs/order';
|
|
20
20
|
export { PromptUtils } from './libs/promptUtils';
|
|
21
|
-
export type {
|
|
21
|
+
export type { PromptAction, PromptStatusItem, PromptRunStats } from './components/widgets/Prompt';
|
|
22
22
|
export type { TableHeaderProp, TableReorderHandler, TableReorderMeta, TableSelectionChangeHandler, TableSelectionState } from './components/ui/Table';
|
|
23
23
|
export type { GalleryRecord, GallerySelectionChangeHandler, GallerySelectionState } from './components/ui/Gallery';
|
|
24
|
-
export type { GridAction, GridActions, GridAfterActionArgs, GridAfterActionHandler, GridArrayProps, GridColumn, GridCoreProps, GridDBPath, GridDBQuery, GridDBProps, GridFooterContext, GridFormContext, GridGalleryViewProps, GridHeaderContext, GridLayout, GridMutationDeleteArgs, GridMutationDeleteHandler, GridMutationSaveArgs, GridMutationSaveHandler, GridReorderHandler, GridReorderMeta, GridRecordKey, GridProps, GridSelectionChangeHandler, GridSelectionMode, GridSelectionState, GridSticky, GridTableViewProps, GridCellContext, } from './components/widgets/Grid';
|
|
24
|
+
export type { GridAction, GridActions, GridAfterActionArgs, GridAfterActionHandler, GridArrayProps, GridColumn, GridCoreProps, GridDBPath, GridDBQuery, GridDBProps, GridFooterContext, GridFormContext, GridGalleryField, GridGalleryViewProps, GridGalleryViewConfig, GridHeaderContext, GridLayout, GridMutationDeleteArgs, GridMutationDeleteHandler, GridMutationSaveArgs, GridMutationSaveHandler, GridReorderHandler, GridReorderMeta, GridRecordKey, GridProps, GridSelectionChangeHandler, GridSelectionMode, GridSelectionState, GridSticky, GridTableViewProps, GridTableViewConfig, GridViewsConfig, GridCellContext, } from './components/widgets/Grid';
|
|
25
25
|
export type { ProviderConfigurable, ProviderConfigurationState } from './providers/ProviderConfiguration';
|
|
26
26
|
export { getProviderConfigurationState } from './providers/ProviderConfiguration';
|
|
27
27
|
export type { ProviderAdapterMap, ProviderService, SetProviderFn, ProviderRegistrySnapshot } from './providers/ProviderRegistryContext';
|
|
@@ -41,23 +41,32 @@ export type { MotionEffect, MotionReference, MotionRegistry, MotionStyle, Motion
|
|
|
41
41
|
export { createMotionTransition, resolveMotionEffect, useEnterMotion, useMotionEffect, useMotionState, usePressMotion } from './motion';
|
|
42
42
|
export { FirebaseDataProvider } from './providers/data/firebase';
|
|
43
43
|
export { FirestoreDataProvider } from './providers/data/firestore';
|
|
44
|
+
export type { FirestoreDataProviderConfig } from './providers/data/firestore';
|
|
44
45
|
export { SupabaseDataProvider } from './providers/data/supabase';
|
|
45
46
|
export { MockDataProvider } from './providers/data/mock';
|
|
46
47
|
export { useDataProvider, DataProvider } from './providers/data/DataProviderContext';
|
|
47
48
|
export type { StorageProviderAdapter, UploadOptions, StorageOptions, DeleteOptions, MoveOptions, ListOptions, StorageFileInfo, UploadHandle } from './providers/storage/StorageProvider';
|
|
48
49
|
export { FirebaseStorageProvider } from './providers/storage/firebase';
|
|
50
|
+
export type { FirebaseStorageProviderConfig } from './providers/storage/firebase';
|
|
49
51
|
export { SupabaseStorageProvider } from './providers/storage/supabase';
|
|
50
52
|
export { useStorageProvider, StorageProvider } from './providers/storage/StorageProviderContext';
|
|
51
53
|
export type { AuthProviderAdapter, AuthIntent, AuthSignInOptions, UserProfile } from './providers/auth/AuthProvider';
|
|
52
54
|
export { useAuthProvider, AuthProvider } from './providers/auth/AuthProviderContext';
|
|
53
55
|
export { GoogleAuthProvider } from './providers/auth/google/GoogleAuthProvider';
|
|
56
|
+
export type { FirebaseAuthProviderOptions, FirebaseSignInOptions } from './providers/auth/firebase/FirebaseAuthProvider';
|
|
54
57
|
export { FirebaseAuthProvider } from './providers/auth/firebase/FirebaseAuthProvider';
|
|
58
|
+
export { callFirebaseFunction } from './providers/firebase-init';
|
|
55
59
|
export { SupabaseAuthProvider } from './providers/auth/supabase/SupabaseAuthProvider';
|
|
56
60
|
export { DropboxAuthProvider } from './providers/auth/dropbox/DropboxAuthProvider';
|
|
57
61
|
export type { CredentialsAdapter } from './providers/credentials/CredentialsProvider';
|
|
58
62
|
export { useCredentialsProvider } from './providers/credentials/CredentialsProviderContext';
|
|
59
63
|
export { GoogleServiceAccountProvider } from './providers/credentials/google/GoogleServiceAccountProvider';
|
|
60
64
|
export type { EmailProviderAdapter, EmailSendParams } from './providers/email/EmailProvider';
|
|
65
|
+
export type { EmailProviderId } from './providers/email/definitions';
|
|
66
|
+
export { EMAIL_PROVIDER_DEFINITIONS } from './providers/email/definitions';
|
|
67
|
+
export type { BuildManifest, BuildArtifacts, DeployOptions, DeployResult, Deployment, PublishProviderAdapter } from './providers/publish/PublishProvider';
|
|
68
|
+
export type { PublishProviderId } from './providers/publish/definitions';
|
|
69
|
+
export { PUBLISH_PROVIDER_DEFINITIONS } from './providers/publish/definitions';
|
|
61
70
|
export type { IconProviderAdapter, IconComponentProps } from './providers/icon/IconProvider';
|
|
62
71
|
export { LucideIconProvider } from './providers/icon/LucideIconProvider';
|
|
63
72
|
export { PhosphorIconProvider } from './providers/icon/PhosphorIconProvider';
|
|
@@ -66,8 +75,9 @@ export { IconProvider, useIconProvider, useIconController } from './providers/ic
|
|
|
66
75
|
export type { AppIconProviderConfig, IconController } from './providers/icon/IconProviderContext';
|
|
67
76
|
export { useEmailProvider, EmailProvider } from './providers/email/EmailProviderContext';
|
|
68
77
|
export { GmailEmailProvider } from './providers/email/google/GmailEmailProvider';
|
|
69
|
-
export type { AIRequestOptions, AIAttachment, AIProviderAdapter, AIKeyValidationResult, AIModelDescriptor, AIProviderCapabilities, AIModelCatalog } from './providers/ai';
|
|
70
|
-
export { createAIProviderRegistry, getAIModelCatalog, formatAIModelRef, parseAIModelRef } from './providers/ai';
|
|
78
|
+
export type { AIRequestOptions, AIAttachment, AIProviderAdapter, AIKeyValidationResult, AIModelDescriptor, AIProviderCapabilities, AIModelCatalog, AIProviderDefinition, AICompleteRequest, AICompleteResult, AIConversationTurn, AIToolDefinition, AIToolCall, AIToolResult, } from './providers/ai';
|
|
79
|
+
export { createAIProviderRegistry, getAIModelCatalog, formatAIModelRef, parseAIModelRef, AI_PROVIDER_DEFINITIONS, AI_PROVIDER_DESCRIPTORS, OPENAI_COMPATIBLE_PROVIDER_DESCRIPTOR, toProviderDescriptor } from './providers/ai';
|
|
80
|
+
export type { ProviderDescriptor, ProviderCredentialField } from './providers/ProviderDescriptor';
|
|
71
81
|
export { useAIProvider, useAIProviderRegistry, AIProvider } from './providers/ai/AIProviderContext';
|
|
72
82
|
export { proxyFetch, useProxy, configureProxy, isProxyEnabled } from './providers/proxy';
|
|
73
83
|
export { googleGetAccessToken } from './providers/auth/google/GoogleAuth';
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `'fill'` means "stretch to the height of whatever parent container you're placed in,
|
|
3
|
+
* instead of a fixed pixel height" — the parent must actually provide a real height (e.g.
|
|
4
|
+
* a flex column with `flex-1 min-h-0`) for this to have any effect; on an auto-height
|
|
5
|
+
* parent it resolves to the same as not being there.
|
|
6
|
+
*/
|
|
7
|
+
export type EditorHeight = number | 'fill';
|
|
1
8
|
export interface EditorHeightOptions {
|
|
2
|
-
minHeight?:
|
|
9
|
+
minHeight?: EditorHeight;
|
|
3
10
|
maxHeight?: number;
|
|
4
11
|
paddingOffset?: number;
|
|
5
12
|
}
|
|
6
13
|
export interface EditorHeightResult {
|
|
14
|
+
/** True when `minHeight === 'fill'` — the editor stretches to its parent's height with
|
|
15
|
+
* its own internal scroll, instead of using a fixed pixel min-height. */
|
|
16
|
+
fill: boolean;
|
|
7
17
|
adjustedMinHeight: number;
|
|
8
18
|
wrapperStyle: React.CSSProperties;
|
|
9
19
|
resolvedMinHeight: number;
|
|
@@ -2,6 +2,8 @@ interface FetchOptions {
|
|
|
2
2
|
method?: "GET" | "POST" | "PUT" | "DELETE" | "HEAD" | "PATCH";
|
|
3
3
|
headers?: Record<string, string>;
|
|
4
4
|
body?: Record<string, unknown> | string;
|
|
5
|
+
/** Lets a caller cancel an in-flight request (e.g. a "stop" button on a long AI call). */
|
|
6
|
+
signal?: AbortSignal;
|
|
5
7
|
}
|
|
6
8
|
export declare function fetchRest(url: string, options?: FetchOptions | null, fetchFn?: typeof fetch): Promise<any>;
|
|
7
9
|
export declare function fetchJson(url: string, options?: FetchOptions | null, fetchFn?: typeof fetch): Promise<any>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type ProviderCredentialField = {
|
|
2
|
+
key: string;
|
|
3
|
+
label: string;
|
|
4
|
+
type: 'text' | 'password' | 'textarea';
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
};
|
|
7
|
+
export type ProviderDescriptor = {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
description: string;
|
|
11
|
+
credentialFields: ProviderCredentialField[];
|
|
12
|
+
/** Where to go find/generate this credential (the provider's own dashboard/API keys page). */
|
|
13
|
+
credentialsUrl?: string;
|
|
14
|
+
/** Short guidance on where in that dashboard to look, when the URL alone isn't obvious. */
|
|
15
|
+
credentialsHint?: string;
|
|
16
|
+
/** Numbered walkthrough for setups too involved for a one-line hint (e.g. multi-console flows). Rendered instead of credentialsHint when present. */
|
|
17
|
+
credentialsSteps?: string[];
|
|
18
|
+
};
|