@llmnative/react 0.1.1 → 1.1.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 +397 -364
- package/bin/cli.js +117 -98
- package/dist/index.css +1 -1
- package/dist/index.js +21 -823
- package/dist/index.mjs +14984 -9345
- package/dist/style.css +1 -0
- package/dist/types/src/App.d.ts +75 -14
- package/dist/types/src/Config.d.ts +28 -5
- package/dist/types/src/Global.d.ts +2 -2
- package/dist/types/src/I18n.d.ts +186 -0
- package/dist/types/src/Theme.d.ts +153 -81
- package/dist/types/src/auth.d.ts +13 -1
- package/dist/types/src/components/Component.d.ts +13 -27
- package/dist/types/src/components/ErrorBoundary.d.ts +30 -0
- package/dist/types/src/components/blocks/Brand.d.ts +9 -4
- package/dist/types/src/components/blocks/Breadcrumbs.d.ts +50 -4
- package/dist/types/src/components/blocks/Carousel.d.ts +7 -5
- package/dist/types/src/components/blocks/Dropdown.d.ts +38 -20
- package/dist/types/src/components/blocks/ListCard.d.ts +38 -0
- package/dist/types/src/components/blocks/Menu.d.ts +15 -16
- package/dist/types/src/components/blocks/Notifications.d.ts +11 -3
- package/dist/types/src/components/blocks/ProviderSwitcher.d.ts +65 -0
- package/dist/types/src/components/blocks/Search.d.ts +3 -2
- package/dist/types/src/components/blocks/SideNav.d.ts +45 -0
- package/dist/types/src/components/blocks/ThemeSwitcher.d.ts +28 -0
- package/dist/types/src/components/blocks/Toolbar.d.ts +23 -0
- package/dist/types/src/components/index.d.ts +28 -7
- package/dist/types/src/components/types.d.ts +10 -3
- package/dist/types/src/components/ui/Alert.d.ts +20 -4
- package/dist/types/src/components/ui/Badge.d.ts +12 -5
- package/dist/types/src/components/ui/Buttons.d.ts +16 -12
- package/dist/types/src/components/ui/Card.d.ts +11 -7
- package/dist/types/src/components/ui/Code.d.ts +5 -1
- package/dist/types/src/components/ui/Gallery.d.ts +16 -16
- package/dist/types/src/components/ui/GridSystem.d.ts +5 -2
- package/dist/types/src/components/ui/Icon.d.ts +6 -1
- package/dist/types/src/components/ui/Image.d.ts +7 -1
- package/dist/types/src/components/ui/ImageAvatar.d.ts +4 -1
- package/dist/types/src/components/ui/Loader.d.ts +3 -1
- package/dist/types/src/components/ui/LocaleSwitcher.d.ts +14 -0
- package/dist/types/src/components/ui/Modal.d.ts +46 -15
- package/dist/types/src/components/ui/Pagination.d.ts +16 -3
- package/dist/types/src/components/ui/Percentage.d.ts +14 -5
- package/dist/types/src/components/ui/Repeat.d.ts +14 -6
- package/dist/types/src/components/ui/Tab.d.ts +29 -2
- package/dist/types/src/components/ui/TabDynamic.d.ts +4 -3
- package/dist/types/src/components/ui/Table.d.ts +18 -14
- package/dist/types/src/components/ui/fields/CodeEditor.d.ts +46 -0
- package/dist/types/src/components/ui/fields/ContextMenu.d.ts +87 -0
- package/dist/types/src/components/ui/fields/Crop.d.ts +4 -2
- package/dist/types/src/components/ui/fields/ImageField.d.ts +31 -0
- package/dist/types/src/components/ui/fields/Input.d.ts +43 -14
- package/dist/types/src/components/ui/fields/Prompt.d.ts +2 -31
- package/dist/types/src/components/ui/fields/RichText.d.ts +89 -0
- package/dist/types/src/components/ui/fields/Select.d.ts +13 -10
- package/dist/types/src/components/ui/fields/Upload.d.ts +50 -2
- package/dist/types/src/components/ui/fields/UploadCSV.d.ts +2 -0
- package/dist/types/src/components/ui/useRecordSelection.d.ts +1 -2
- package/dist/types/src/components/widgets/Form.d.ts +80 -43
- package/dist/types/src/components/widgets/ImageEditor.d.ts +4 -5
- package/dist/types/src/components/widgets/MarkdownReader.d.ts +4 -4
- package/dist/types/src/components/widgets/Prompt.d.ts +90 -22
- package/dist/types/src/components/widgets/TabDynamic.d.ts +4 -3
- package/dist/types/src/components/widgets/form-controller.d.ts +42 -0
- package/dist/types/src/components/widgets/grid-core/GridCore.d.ts +1 -1
- package/dist/types/src/components/widgets/grid-core/GridDB.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/GridTableView.d.ts +1 -1
- package/dist/types/src/components/widgets/grid-core/types.d.ts +77 -27
- package/dist/types/src/components/widgets/grid-core/useGridActions.d.ts +4 -8
- package/dist/types/src/components/widgets/grid-core/useGridColumns.d.ts +2 -2
- package/dist/types/src/components/widgets/grid-core/useGridDBRecords.d.ts +1 -2
- package/dist/types/src/components/widgets/grid-core/useGridPreparedRecords.d.ts +2 -2
- package/dist/types/src/components/widgets/grid-core/useGridSelection.d.ts +4 -5
- package/dist/types/src/components/widgets/grid-core/utils.d.ts +11 -3
- package/dist/types/src/conf/Prompt.d.ts +1 -1
- package/dist/types/src/conf/i18n/ar.d.ts +2 -0
- package/dist/types/src/conf/i18n/de.d.ts +2 -0
- package/dist/types/src/conf/i18n/en.d.ts +2 -0
- package/dist/types/src/conf/i18n/index.d.ts +6 -0
- package/dist/types/src/conf/i18n/it.d.ts +2 -0
- package/dist/types/src/conf/i18n/ru.d.ts +2 -0
- package/dist/types/src/conf/i18n/zh.d.ts +2 -0
- package/dist/types/src/constant.d.ts +1 -1
- package/dist/types/src/index.d.ts +48 -13
- package/dist/types/src/libs/converter.d.ts +4 -4
- package/dist/types/src/libs/editorHeight.d.ts +12 -0
- package/dist/types/src/libs/fetch.d.ts +4 -4
- package/dist/types/src/libs/imageBuilder.d.ts +63 -14
- package/dist/types/src/libs/imageVariants.d.ts +35 -0
- package/dist/types/src/libs/index.d.ts +1 -4
- package/dist/types/src/libs/promptUtils.d.ts +24 -0
- package/dist/types/src/libs/sanitizer.d.ts +2 -2
- package/dist/types/src/libs/utils.d.ts +9 -10
- package/dist/types/src/pages/index.d.ts +0 -2
- package/dist/types/src/providers/ProviderConfiguration.d.ts +6 -0
- package/dist/types/src/providers/ProviderDescriptor.d.ts +18 -0
- package/dist/types/src/providers/ProviderRegistryContext.d.ts +51 -0
- package/dist/types/src/providers/ProviderSession.d.ts +68 -0
- package/dist/types/src/providers/ai/AIProvider.d.ts +57 -0
- package/dist/types/src/providers/ai/AIProviderContext.d.ts +13 -0
- package/dist/types/src/providers/ai/anthropic.d.ts +2 -0
- package/dist/types/src/providers/ai/deepseek.d.ts +1 -0
- package/dist/types/src/providers/ai/gemini.d.ts +2 -0
- package/dist/types/src/providers/ai/glm.d.ts +1 -0
- package/dist/types/src/providers/ai/index.d.ts +20 -134
- package/dist/types/src/providers/ai/mistral.d.ts +1 -0
- package/dist/types/src/providers/ai/openai.d.ts +1 -0
- package/dist/types/src/providers/ai/openaiCompatible.d.ts +19 -0
- package/dist/types/src/providers/ai/opencode.d.ts +2 -0
- package/dist/types/src/providers/ai/openrouter.d.ts +1 -0
- package/dist/types/src/providers/ai/shared.d.ts +55 -0
- package/dist/types/src/providers/api/ApiProvider.d.ts +43 -0
- package/dist/types/src/providers/api/direct.d.ts +14 -0
- package/dist/types/src/providers/api/firebase.d.ts +14 -0
- package/dist/types/src/providers/api/mock.d.ts +7 -0
- package/dist/types/src/providers/api/supabase.d.ts +14 -0
- package/dist/types/src/providers/auth/AuthProvider.d.ts +10 -2
- package/dist/types/src/providers/auth/firebase/FirebaseAuthProvider.d.ts +49 -0
- package/dist/types/src/providers/auth/google/GoogleAuth.d.ts +2 -2
- package/dist/types/src/providers/auth/supabase/SupabaseAuthProvider.d.ts +48 -0
- package/dist/types/src/providers/credentials/CredentialsProvider.d.ts +3 -0
- package/dist/types/src/providers/credentials/CredentialsProviderContext.d.ts +12 -0
- package/dist/types/src/providers/credentials/google/GoogleServiceAccountProvider.d.ts +8 -0
- package/dist/types/src/providers/data/DataProvider.d.ts +27 -1
- package/dist/types/src/providers/data/firebase.d.ts +5 -4
- package/dist/types/src/providers/data/firestore.d.ts +45 -0
- package/dist/types/src/providers/data/mock.d.ts +8 -1
- package/dist/types/src/providers/data/supabase.d.ts +36 -10
- package/dist/types/src/providers/email/definitions.d.ts +3 -0
- package/dist/types/src/providers/firebase-init.d.ts +24 -7
- package/dist/types/src/providers/icon/PhosphorIconProvider.d.ts +1 -1
- package/dist/types/src/providers/manifest.d.ts +20 -14
- package/dist/types/src/providers/proxy/index.d.ts +7 -0
- package/dist/types/src/providers/proxy/vite.d.ts +3 -0
- 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/scrape/index.d.ts +2 -1
- package/dist/types/src/providers/seo/google/keyword.d.ts +6 -1
- package/dist/types/src/providers/storage/StorageProvider.d.ts +155 -4
- package/dist/types/src/providers/storage/dropbox.d.ts +3 -3
- package/dist/types/src/providers/storage/firebase.d.ts +44 -7
- package/dist/types/src/providers/storage/supabase.d.ts +47 -7
- package/dist/types/src/providers/supabase-init.d.ts +35 -0
- package/dist/types/src/types/FormFields.d.ts +4 -2
- package/dist/types/src/types/FormSchema.d.ts +29 -0
- package/dist/types/themes/tokyo-night-light.d.ts +3 -0
- package/dist/types/themes/tokyo-night.d.ts +3 -0
- package/dist/types/themes/vscode-dark-plus.d.ts +3 -0
- package/dist/types/themes/vscode-light-plus.d.ts +3 -0
- package/dist/vite.js +1 -0
- package/dist/vite.mjs +54 -0
- package/package.json +46 -8
- package/scripts/cli/proxy-templates/cloudflare.ts +34 -0
- package/scripts/cli/proxy-templates/express.ts +77 -0
- package/scripts/cli/proxy-templates/nextjs-app.ts +42 -0
- package/scripts/cli/proxy-templates/nextjs-pages.ts +41 -0
- package/scripts/cli/proxy-templates/scaffold.json +33 -0
- package/scripts/cli/setup-devtools.js +155 -85
- package/scripts/cli/setup-project.js +618 -484
- package/themes/cyber.ts +469 -405
- package/themes/default.ts +469 -405
- package/themes/flat.ts +469 -405
- package/themes/tokyo-night-light.ts +38 -0
- package/themes/tokyo-night.ts +38 -0
- package/themes/vscode-dark-plus.ts +29 -0
- package/themes/vscode-light-plus.ts +29 -0
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/types/src/components/FormEnhancer.d.ts +0 -26
- package/dist/types/src/components/Template.d.ts +0 -18
- package/dist/types/src/components/ui/fields/AssistantAI.d.ts +0 -23
- package/dist/types/src/components/ui/fields/Command.d.ts +0 -15
- package/dist/types/src/components/ui/fields/ImageUrl.d.ts +0 -7
- package/dist/types/src/libs/cache.d.ts +0 -9
- package/dist/types/src/libs/database.d.ts +0 -3
- package/dist/types/src/libs/log.d.ts +0 -2
- package/dist/types/src/libs/seo.d.ts +0 -8
- package/dist/types/src/libs/storage.d.ts +0 -2
- package/dist/types/src/pages/Blog.d.ts +0 -3
- package/dist/types/src/pages/BlogPost.d.ts +0 -16
- package/dist/types/src/pages/Helper.d.ts +0 -8
- package/dist/types/src/providers/auth/google/apis/auth.d.ts +0 -4
- package/dist/types/src/types/Block.d.ts +0 -4
- package/dist/types/src/types/Section.d.ts +0 -4
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormFieldProps } from '../../widgets/Form';
|
|
3
|
+
import type { FieldValue } from '../../../providers/data/DataProvider';
|
|
4
|
+
import { type EditorCommand } from './ContextMenu';
|
|
5
|
+
export type CodeEditorLanguage = 'liquid' | 'html' | 'json' | 'js' | 'ts' | 'css';
|
|
6
|
+
export interface CodeSyntaxErrorDetails {
|
|
7
|
+
language: CodeEditorLanguage;
|
|
8
|
+
from: number;
|
|
9
|
+
to: number;
|
|
10
|
+
line: number;
|
|
11
|
+
column: number;
|
|
12
|
+
nodeName?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class CodeSyntaxError extends Error {
|
|
15
|
+
readonly language: CodeEditorLanguage;
|
|
16
|
+
readonly from: number;
|
|
17
|
+
readonly to: number;
|
|
18
|
+
readonly line: number;
|
|
19
|
+
readonly column: number;
|
|
20
|
+
readonly nodeName?: string;
|
|
21
|
+
constructor(message: string, details: CodeSyntaxErrorDetails);
|
|
22
|
+
}
|
|
23
|
+
export interface CodeValidationResult {
|
|
24
|
+
valid: boolean;
|
|
25
|
+
error?: CodeSyntaxError;
|
|
26
|
+
}
|
|
27
|
+
export declare const validateCodeSyntax: (code: string, language: CodeEditorLanguage) => Promise<void>;
|
|
28
|
+
export declare const getCodeValidationResult: (code: string, language: CodeEditorLanguage) => Promise<CodeValidationResult>;
|
|
29
|
+
export interface CodeEditorProps extends FormFieldProps {
|
|
30
|
+
language?: CodeEditorLanguage;
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
minHeight?: number;
|
|
33
|
+
maxHeight?: number;
|
|
34
|
+
label?: string;
|
|
35
|
+
required?: boolean;
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
feedback?: string;
|
|
38
|
+
labelClassName?: string;
|
|
39
|
+
validateSyntax?: boolean;
|
|
40
|
+
validator?: (value: FieldValue) => string | undefined | Promise<string | undefined>;
|
|
41
|
+
extensions?: unknown[];
|
|
42
|
+
commands?: EditorCommand[];
|
|
43
|
+
commandsTrigger?: string;
|
|
44
|
+
}
|
|
45
|
+
export declare const CodeEditor: React.FC<CodeEditorProps>;
|
|
46
|
+
export default CodeEditor;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { UIProps } from '../../types';
|
|
3
|
+
export interface ContextMenuItem {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface EditorContext {
|
|
9
|
+
value: string;
|
|
10
|
+
textBeforeCaret: string;
|
|
11
|
+
textAfterCaret: string;
|
|
12
|
+
trigger: string;
|
|
13
|
+
query: string;
|
|
14
|
+
triggerRange: {
|
|
15
|
+
start: number;
|
|
16
|
+
end: number;
|
|
17
|
+
};
|
|
18
|
+
insert: (text: string) => void;
|
|
19
|
+
replace: (start: number, end: number, text: string) => void;
|
|
20
|
+
}
|
|
21
|
+
export interface TextCommandContext {
|
|
22
|
+
value: string;
|
|
23
|
+
textBeforeCaret: string;
|
|
24
|
+
textAfterCaret: string;
|
|
25
|
+
trigger: string;
|
|
26
|
+
query: string;
|
|
27
|
+
}
|
|
28
|
+
export interface EditorCommand {
|
|
29
|
+
name: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
icon?: string;
|
|
32
|
+
handler?: (context: TextCommandContext) => string | Promise<string>;
|
|
33
|
+
}
|
|
34
|
+
export interface ContextMenuControlledState {
|
|
35
|
+
open: boolean;
|
|
36
|
+
anchorPosition: {
|
|
37
|
+
top: number;
|
|
38
|
+
left: number;
|
|
39
|
+
} | null;
|
|
40
|
+
query: string;
|
|
41
|
+
editorContext: EditorContext;
|
|
42
|
+
onClose: () => void;
|
|
43
|
+
}
|
|
44
|
+
export interface ContextMenuHandle {
|
|
45
|
+
moveNext: () => void;
|
|
46
|
+
movePrev: () => void;
|
|
47
|
+
selectActive: () => void;
|
|
48
|
+
close: () => void;
|
|
49
|
+
}
|
|
50
|
+
export declare const CONTEXT_MENU_SEARCH_THRESHOLD = 10;
|
|
51
|
+
interface ContextMenuProps extends UIProps {
|
|
52
|
+
trigger: string;
|
|
53
|
+
searchable?: boolean;
|
|
54
|
+
controlled?: ContextMenuControlledState;
|
|
55
|
+
onSelect?: (item: ContextMenuItem, context: EditorContext) => void;
|
|
56
|
+
children: React.ReactNode;
|
|
57
|
+
}
|
|
58
|
+
interface ContextMenuItemProps extends UIProps {
|
|
59
|
+
label: string;
|
|
60
|
+
value: string;
|
|
61
|
+
icon?: string;
|
|
62
|
+
}
|
|
63
|
+
interface ContextMenuHeadingProps {
|
|
64
|
+
children: React.ReactNode;
|
|
65
|
+
className?: string;
|
|
66
|
+
}
|
|
67
|
+
interface ContextMenuSeparatorProps {
|
|
68
|
+
className?: string;
|
|
69
|
+
}
|
|
70
|
+
type ContextMenuComponent = React.ForwardRefExoticComponent<ContextMenuProps & React.RefAttributes<ContextMenuHandle>> & {
|
|
71
|
+
Item: React.FC<ContextMenuItemProps>;
|
|
72
|
+
Heading: React.FC<ContextMenuHeadingProps>;
|
|
73
|
+
Separator: React.FC<ContextMenuSeparatorProps>;
|
|
74
|
+
};
|
|
75
|
+
type QueryMatch = {
|
|
76
|
+
query: string;
|
|
77
|
+
start: number;
|
|
78
|
+
end: number;
|
|
79
|
+
};
|
|
80
|
+
type CommandTriggerMatchOptions = {
|
|
81
|
+
queryPattern?: RegExp;
|
|
82
|
+
requireWhitespacePrefix?: boolean;
|
|
83
|
+
};
|
|
84
|
+
export declare const matchCommandTrigger: (value: string, caret: number, trigger: string, options?: CommandTriggerMatchOptions) => QueryMatch | null;
|
|
85
|
+
export declare const buildTextCommandContext: (context: EditorContext) => TextCommandContext;
|
|
86
|
+
declare const ContextMenu: ContextMenuComponent;
|
|
87
|
+
export { ContextMenu };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FileProps } from "./Upload";
|
|
3
|
-
interface CropProps {
|
|
3
|
+
export interface CropProps {
|
|
4
4
|
fileName: string;
|
|
5
5
|
type: string;
|
|
6
6
|
scale: string;
|
|
@@ -16,6 +16,8 @@ interface ImageProps extends FileProps {
|
|
|
16
16
|
export declare const CropImage: React.ForwardRefExoticComponent<{
|
|
17
17
|
img: ImageProps;
|
|
18
18
|
title?: string;
|
|
19
|
+
/** Custom aspect ratios. Defaults to { "1:1": 1, "3:4": 0.75, "4:3": 1.33 }. */
|
|
20
|
+
scales?: Record<string, number>;
|
|
19
21
|
} & React.RefAttributes<unknown>>;
|
|
20
22
|
interface FileNameEditorProps {
|
|
21
23
|
value: string;
|
|
@@ -23,5 +25,5 @@ interface FileNameEditorProps {
|
|
|
23
25
|
scale?: string;
|
|
24
26
|
label?: string;
|
|
25
27
|
}
|
|
26
|
-
export declare const FileNameEditor: ({ value, onChange, label, scale
|
|
28
|
+
export declare const FileNameEditor: ({ value, onChange, label, scale }: FileNameEditorProps) => React.JSX.Element;
|
|
27
29
|
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormFieldProps } from '../../widgets/Form';
|
|
3
|
+
export interface ImageFieldValue {
|
|
4
|
+
src: string;
|
|
5
|
+
alt: string;
|
|
6
|
+
srcset?: string;
|
|
7
|
+
sizes?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ImageFieldProps extends FormFieldProps {
|
|
10
|
+
/**
|
|
11
|
+
* Pixel widths to generate as responsive srcset variants.
|
|
12
|
+
* Each width produces a canvas-resized copy.
|
|
13
|
+
* Default: [] (no variants).
|
|
14
|
+
* Example: [400, 800]
|
|
15
|
+
*/
|
|
16
|
+
srcsetWidths?: number[];
|
|
17
|
+
/**
|
|
18
|
+
* Storage path prefix for uploading resized variants.
|
|
19
|
+
* Requires a StorageProvider ancestor.
|
|
20
|
+
* If omitted, variants are kept as local blob URLs.
|
|
21
|
+
* Example: "/content/posts/images"
|
|
22
|
+
*/
|
|
23
|
+
uploadPath?: string;
|
|
24
|
+
label?: string;
|
|
25
|
+
required?: boolean;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
feedback?: string;
|
|
28
|
+
id?: string;
|
|
29
|
+
labelClassName?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const ImageField: ({ name, onChange, defaultValue, label, required, disabled, feedback, srcsetWidths, uploadPath, id, labelClassName, inheritWrapperClassName, wrapperClassName, className, before, after, }: ImageFieldProps) => React.JSX.Element;
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { UIProps } from '../../..';
|
|
3
3
|
import { FormFieldProps, InputType } from '../../widgets/Form';
|
|
4
|
+
import type { FieldValue } from '../../../providers/data/DataProvider';
|
|
4
5
|
interface BaseInputProps extends FormFieldProps {
|
|
5
6
|
placeholder?: string;
|
|
6
7
|
type?: InputType;
|
|
7
|
-
|
|
8
|
+
/** When `true`, the field becomes read-only (disabled) once a value has been set. */
|
|
9
|
+
readOnlyAfterSet?: boolean;
|
|
8
10
|
disabled?: boolean;
|
|
9
11
|
feedback?: string;
|
|
10
12
|
min?: number;
|
|
11
13
|
max?: number;
|
|
12
14
|
step?: number;
|
|
15
|
+
id?: string;
|
|
16
|
+
labelClassName?: string;
|
|
17
|
+
validator?: (value: FieldValue) => string | undefined | Promise<string | undefined>;
|
|
18
|
+
/** Content rendered as an absolute overlay inside the input (right side). No addon border/bg. */
|
|
19
|
+
afterInset?: React.ReactNode;
|
|
13
20
|
}
|
|
14
21
|
interface LabelProps {
|
|
15
22
|
label: string;
|
|
@@ -20,15 +27,27 @@ interface LabelProps {
|
|
|
20
27
|
export type InputProps = Omit<BaseInputProps, 'type'>;
|
|
21
28
|
export interface CheckboxProps extends FormFieldProps {
|
|
22
29
|
title?: string;
|
|
30
|
+
ariaLabel?: string;
|
|
23
31
|
valueChecked?: string | number;
|
|
24
32
|
}
|
|
33
|
+
export interface HiddenProps extends FormFieldProps {
|
|
34
|
+
id?: string;
|
|
35
|
+
}
|
|
25
36
|
export interface TextAreaProps extends FormFieldProps {
|
|
26
37
|
placeholder?: string;
|
|
27
|
-
|
|
38
|
+
/** When `true`, the textarea becomes read-only (disabled) once a value has been set. */
|
|
39
|
+
readOnlyAfterSet?: boolean;
|
|
28
40
|
disabled?: boolean;
|
|
29
|
-
|
|
41
|
+
minHeight?: number;
|
|
42
|
+
maxHeight?: number;
|
|
30
43
|
feedback?: string;
|
|
31
|
-
|
|
44
|
+
textareaRef?: React.RefObject<HTMLTextAreaElement | null> | ((el: HTMLTextAreaElement | null) => void) | undefined;
|
|
45
|
+
id?: string;
|
|
46
|
+
labelClassName?: string;
|
|
47
|
+
validator?: (value: FieldValue) => string | undefined | Promise<string | undefined>;
|
|
48
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLTextAreaElement>;
|
|
49
|
+
onClick?: React.MouseEventHandler<HTMLTextAreaElement>;
|
|
50
|
+
onBlur?: React.FocusEventHandler<HTMLTextAreaElement>;
|
|
32
51
|
}
|
|
33
52
|
export interface ListGroupProps extends UIProps {
|
|
34
53
|
children: React.ReactNode[];
|
|
@@ -36,17 +55,26 @@ export interface ListGroupProps extends UIProps {
|
|
|
36
55
|
label?: string;
|
|
37
56
|
draggable?: boolean;
|
|
38
57
|
onDrop?: (text: string) => string;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
58
|
+
activeIndices?: number[];
|
|
59
|
+
disabledIndices?: number[];
|
|
60
|
+
loadingIndices?: number[];
|
|
61
|
+
itemClassName?: string;
|
|
43
62
|
}
|
|
44
|
-
export declare const
|
|
63
|
+
export declare const fieldLabelClass = "mb-1 block text-sm font-medium leading-5 text-foreground";
|
|
64
|
+
export declare const fieldFeedbackClass = "mt-1 text-xs text-muted-foreground";
|
|
65
|
+
export declare const fieldControlBaseClass = "flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";
|
|
66
|
+
export declare const fieldTextAreaBaseClass = "flex min-h-[5rem] w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";
|
|
67
|
+
export declare const fieldGroupClass = "flex w-full items-stretch";
|
|
68
|
+
export declare const fieldAddonClass = "inline-flex shrink-0 items-center border border-input bg-muted px-3 py-1 text-sm text-muted-foreground";
|
|
69
|
+
export declare const FieldError: ({ message }: {
|
|
70
|
+
message: string;
|
|
71
|
+
}) => React.JSX.Element;
|
|
72
|
+
export declare const Input: ({ name, onChange, defaultValue, placeholder, label, type, required, readOnlyAfterSet, disabled, before, after, afterInset, feedback, min, max, step, id, labelClassName, inheritWrapperClassName, wrapperClassName, className, validator, labelMode, }: BaseInputProps) => React.JSX.Element;
|
|
45
73
|
export declare const String: (props: InputProps) => React.JSX.Element;
|
|
46
74
|
export declare const Number: (props: InputProps) => React.JSX.Element;
|
|
47
75
|
export declare const Email: (props: InputProps) => React.JSX.Element;
|
|
48
76
|
export declare const Password: (props: InputProps) => React.JSX.Element;
|
|
49
|
-
export declare const Color: (props: InputProps) => React.JSX.Element;
|
|
77
|
+
export declare const Color: ({ className, ...props }: InputProps) => React.JSX.Element;
|
|
50
78
|
export declare const Date: (props: InputProps) => React.JSX.Element;
|
|
51
79
|
export declare const Time: (props: InputProps) => React.JSX.Element;
|
|
52
80
|
export declare const DateTime: (props: InputProps) => React.JSX.Element;
|
|
@@ -54,9 +82,10 @@ export declare const Week: (props: InputProps) => React.JSX.Element;
|
|
|
54
82
|
export declare const Month: (props: InputProps) => React.JSX.Element;
|
|
55
83
|
export declare const Range: (props: InputProps) => React.JSX.Element;
|
|
56
84
|
export declare const Url: (props: InputProps) => React.JSX.Element;
|
|
57
|
-
export declare const
|
|
58
|
-
export declare const
|
|
85
|
+
export declare const Hidden: ({ name, onChange, defaultValue, value, id, inheritWrapperClassName, wrapperClassName, }: HiddenProps) => React.JSX.Element;
|
|
86
|
+
export declare const Checkbox: ({ name, onChange, defaultValue, label, title, ariaLabel, required, valueChecked, before, after, inheritWrapperClassName, wrapperClassName, className }: CheckboxProps) => React.JSX.Element;
|
|
87
|
+
export declare const Switch: ({ name, onChange, defaultValue, label, title, ariaLabel, required, valueChecked, before, after, inheritWrapperClassName, wrapperClassName, className }: CheckboxProps) => React.JSX.Element;
|
|
59
88
|
export declare const Label: ({ label, required, htmlFor, className }: LabelProps) => React.JSX.Element;
|
|
60
|
-
export declare const TextArea: ({ name, onChange, defaultValue, placeholder, label, required,
|
|
61
|
-
export declare const ListGroup: ({ children, onClick, label,
|
|
89
|
+
export declare const TextArea: ({ name, onChange, defaultValue, placeholder, label, required, readOnlyAfterSet, disabled, minHeight, maxHeight, textareaRef, before, after, feedback, id, labelClassName, inheritWrapperClassName, className, wrapperClassName, validator, onKeyDown, onClick, onBlur, labelMode, }: TextAreaProps) => React.JSX.Element;
|
|
90
|
+
export declare const ListGroup: ({ children, onClick, label, activeIndices, draggable, onDrop, disabledIndices, loadingIndices, before, after, wrapperClassName, className, itemClassName }: ListGroupProps) => React.JSX.Element;
|
|
62
91
|
export {};
|
|
@@ -1,31 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { PromptVariables } from '../../../conf/Prompt';
|
|
4
|
-
import { FormFieldProps } from '../../widgets/Form';
|
|
5
|
-
export declare enum PromptMode {
|
|
6
|
-
EDITOR = "editor",
|
|
7
|
-
LIVE = "live"
|
|
8
|
-
}
|
|
9
|
-
type PromptOptions = AIFetchConfig & {
|
|
10
|
-
value: string;
|
|
11
|
-
};
|
|
12
|
-
type OnRunPrompt = (prompt: string, config: AIFetchConfig, data?: PromptVariables) => Promise<string>;
|
|
13
|
-
export interface PromptProps extends FormFieldProps {
|
|
14
|
-
mode?: PromptMode;
|
|
15
|
-
onRunPrompt?: OnRunPrompt;
|
|
16
|
-
renderPromptDisabled?: (props: Omit<FormFieldProps, "defaultValue">) => React.ReactNode;
|
|
17
|
-
rows?: number;
|
|
18
|
-
defaultValue?: {
|
|
19
|
-
value?: string;
|
|
20
|
-
enabled?: boolean;
|
|
21
|
-
role?: string;
|
|
22
|
-
language?: string;
|
|
23
|
-
voice?: string;
|
|
24
|
-
style?: string;
|
|
25
|
-
model?: string;
|
|
26
|
-
temperature?: number;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
export declare const Prompt: ({ mode, onRunPrompt, renderPromptDisabled, ...props }: PromptProps) => React.JSX.Element;
|
|
30
|
-
export declare const runPrompt: (options: PromptOptions, data?: PromptVariables, onRunPrompt?: OnRunPrompt) => Promise<string>;
|
|
31
|
-
export {};
|
|
1
|
+
export { default, Prompt, PromptMode, runPrompt } from '../../widgets/Prompt';
|
|
2
|
+
export type { PromptProps } from '../../widgets/Prompt';
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormFieldProps } from '../../widgets/Form';
|
|
3
|
+
import type { FieldValue } from '../../../providers/data/DataProvider';
|
|
4
|
+
import { type EditorCommand } from './ContextMenu';
|
|
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' | '|';
|
|
6
|
+
export interface StatusBarConfig {
|
|
7
|
+
/** Show the DOM ancestor tag breadcrumb at the cursor (e.g. p › strong). Default: true. */
|
|
8
|
+
tagBreadcrumb?: boolean;
|
|
9
|
+
/** Show the word count. Default: true. */
|
|
10
|
+
wordCount?: boolean;
|
|
11
|
+
/** Show the character count. Default: false. */
|
|
12
|
+
charCount?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface RichTextImageUploadConfig {
|
|
15
|
+
/**
|
|
16
|
+
* Storage path prefix for uploaded images.
|
|
17
|
+
* Requires a StorageProvider ancestor.
|
|
18
|
+
* Example: "/content/posts/hero"
|
|
19
|
+
*/
|
|
20
|
+
path?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Pixel widths to generate as responsive srcset variants.
|
|
23
|
+
* Each width produces a canvas-resized copy stored as <name>_<width>w.<ext>.
|
|
24
|
+
* Pass [] to disable srcset generation entirely.
|
|
25
|
+
* Default: [400, 800]
|
|
26
|
+
*/
|
|
27
|
+
srcsetWidths?: number[];
|
|
28
|
+
/**
|
|
29
|
+
* Accepted MIME types for the image file picker.
|
|
30
|
+
* Default: "image/*"
|
|
31
|
+
*/
|
|
32
|
+
accept?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Maximum file size in bytes.
|
|
35
|
+
* Default: 10_485_760 (10 MB)
|
|
36
|
+
*/
|
|
37
|
+
maxBytes?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface RichTextDocumentUploadConfig {
|
|
40
|
+
/**
|
|
41
|
+
* Storage path prefix for uploaded documents.
|
|
42
|
+
* Requires a StorageProvider ancestor.
|
|
43
|
+
* Example: "/content/posts/attachments"
|
|
44
|
+
*/
|
|
45
|
+
path?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Accepted MIME types / file extensions for the document file picker.
|
|
48
|
+
* Default: ".pdf,.doc,.docx,.txt,.csv"
|
|
49
|
+
*/
|
|
50
|
+
accept?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Maximum file size in bytes.
|
|
53
|
+
* Default: 20_971_520 (20 MB)
|
|
54
|
+
*/
|
|
55
|
+
maxBytes?: number;
|
|
56
|
+
}
|
|
57
|
+
export interface RichTextProps extends FormFieldProps {
|
|
58
|
+
placeholder?: string;
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
feedback?: string;
|
|
61
|
+
/** Position of the formatting toolbar. false hides it entirely. Default: 'fixed'. */
|
|
62
|
+
toolbar?: 'fixed' | 'floating' | false;
|
|
63
|
+
/** Ordered list of toolbar commands to show. Defaults to all commands. */
|
|
64
|
+
toolbarCommands?: ToolbarCommand[];
|
|
65
|
+
/** Format used to read/write the field value. Default: 'html'. */
|
|
66
|
+
outputFormat?: 'html' | 'json' | 'text';
|
|
67
|
+
/** Show the status bar below the editor. Pass true for defaults or a config object. Default: false. */
|
|
68
|
+
statusBar?: boolean | StatusBarConfig;
|
|
69
|
+
/** Minimum editor height in px. Default: 120. */
|
|
70
|
+
minHeight?: number;
|
|
71
|
+
/** Maximum editor height in px; content scrolls beyond this. */
|
|
72
|
+
maxHeight?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Image upload behaviour for the imageUpload toolbar command.
|
|
75
|
+
* Pass an object to enable uploads; omit to keep images as base64 data URIs.
|
|
76
|
+
*/
|
|
77
|
+
imageUpload?: RichTextImageUploadConfig;
|
|
78
|
+
/**
|
|
79
|
+
* Document upload behaviour for the documentUpload toolbar command.
|
|
80
|
+
* Pass an object to enable cloud storage uploads; omit to use data URI fallback.
|
|
81
|
+
*/
|
|
82
|
+
documentUpload?: RichTextDocumentUploadConfig;
|
|
83
|
+
labelClassName?: string;
|
|
84
|
+
validator?: (value: FieldValue) => string | undefined;
|
|
85
|
+
commands?: EditorCommand[];
|
|
86
|
+
commandsTrigger?: string;
|
|
87
|
+
}
|
|
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;
|
|
89
|
+
export default RichText;
|
|
@@ -1,38 +1,41 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type OrderConfig } from "../../../libs/order";
|
|
3
|
-
import { DBConfig, RecordProps } from "../../../providers/data/DataProvider";
|
|
3
|
+
import { DBConfig, FieldValue, RecordProps } from "../../../providers/data/DataProvider";
|
|
4
4
|
import { FormFieldProps } from '../../widgets/Form';
|
|
5
5
|
interface Option extends RecordProps {
|
|
6
6
|
label: string;
|
|
7
7
|
value: string;
|
|
8
|
+
group?: string;
|
|
8
9
|
}
|
|
9
10
|
type OptionOrderConfig = OrderConfig & {
|
|
10
11
|
field: 'label' | 'value';
|
|
11
12
|
};
|
|
12
13
|
interface BaseProps extends FormFieldProps {
|
|
13
|
-
|
|
14
|
+
/** When `true`, the select becomes read-only (disabled) once a value has been set. */
|
|
15
|
+
readOnlyAfterSet?: boolean;
|
|
14
16
|
disabled?: boolean;
|
|
15
17
|
title?: string;
|
|
16
18
|
feedback?: string;
|
|
17
19
|
options?: Option[] | string[] | number[];
|
|
18
|
-
|
|
20
|
+
optionsSource?: DBConfig;
|
|
19
21
|
order?: OptionOrderConfig;
|
|
22
|
+
validator?: (value: FieldValue) => string | undefined;
|
|
20
23
|
}
|
|
21
24
|
export interface SelectProps extends BaseProps {
|
|
22
|
-
|
|
25
|
+
placeholderOption?: Option;
|
|
23
26
|
value?: string | number;
|
|
24
27
|
}
|
|
25
28
|
export interface AutocompleteProps extends BaseProps {
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
minItems?: number;
|
|
30
|
+
maxItems?: number;
|
|
28
31
|
placeholder?: string;
|
|
29
32
|
creatable?: boolean;
|
|
30
33
|
onCreate?: (value: string) => Promise<void> | void;
|
|
31
34
|
}
|
|
32
35
|
export interface ChecklistProps extends BaseProps {
|
|
33
|
-
|
|
36
|
+
itemClassName?: string;
|
|
34
37
|
}
|
|
35
|
-
export declare const Select: ({ name, onChange, defaultValue, required,
|
|
36
|
-
export declare const Autocomplete: ({ name, defaultValue,
|
|
37
|
-
export declare const Checklist: ({ name, defaultValue, onChange, required,
|
|
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, 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;
|
|
38
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;
|
|
@@ -9,17 +10,64 @@ export interface FileProps {
|
|
|
9
10
|
url: string;
|
|
10
11
|
base64?: string;
|
|
11
12
|
variants: Record<string, any>;
|
|
13
|
+
srcset?: string;
|
|
14
|
+
sizes?: string;
|
|
12
15
|
}
|
|
16
|
+
export interface UseFileUploadCoreOptions {
|
|
17
|
+
/** Called on every files state update. Use for Form sync. */
|
|
18
|
+
onFilesChange?: (files: FileProps[]) => void;
|
|
19
|
+
/** Called once when a file reaches progress 100. Use to trigger insert dialogs. */
|
|
20
|
+
onFileReady?: (file: FileProps) => void;
|
|
21
|
+
/** StorageProvider path. When set with a storage provider, files are auto-uploaded. */
|
|
22
|
+
uploadPath?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Pixel widths for responsive image variants. When set with uploadPath, generates
|
|
25
|
+
* canvas-resized variants at each width and populates file.srcset / file.sizes.
|
|
26
|
+
* Each variant is stored as <name>_<width>w.<ext>. Default: undefined (no variants).
|
|
27
|
+
* Example: [400, 800] produces _400w and _800w files.
|
|
28
|
+
*/
|
|
29
|
+
srcsetWidths?: number[];
|
|
30
|
+
/** Initial file list (e.g. from a form record on load). */
|
|
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;
|
|
40
|
+
}
|
|
41
|
+
export declare const useFileUploadCore: ({ onFilesChange, onFileReady, uploadPath, srcsetWidths, initialFiles, storageKey, storageProvider, }: UseFileUploadCoreOptions) => {
|
|
42
|
+
files: FileProps[];
|
|
43
|
+
setFiles: React.Dispatch<React.SetStateAction<FileProps[]>>;
|
|
44
|
+
fileInputRef: React.MutableRefObject<HTMLInputElement | null>;
|
|
45
|
+
updateFile: (key: string, updates: Partial<FileProps>) => void;
|
|
46
|
+
handleFiles: (selectedFiles: File[]) => void;
|
|
47
|
+
handleUpload: () => void | undefined;
|
|
48
|
+
handleUploadChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
49
|
+
handleRemove: (key: string) => void;
|
|
50
|
+
};
|
|
13
51
|
export interface UploadDocumentProps extends FormFieldProps {
|
|
14
52
|
editable?: boolean;
|
|
15
53
|
multiple?: boolean;
|
|
16
54
|
accept?: string;
|
|
17
55
|
max?: number;
|
|
56
|
+
/** StorageProvider path — when set, files are auto-uploaded on selection. */
|
|
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;
|
|
18
62
|
}
|
|
19
63
|
export interface UploadImageProps extends UploadDocumentProps {
|
|
20
64
|
previewHeight?: number;
|
|
21
65
|
previewWidth?: number;
|
|
66
|
+
/** Text shown inside the empty-state drop zone, below the upload icon. */
|
|
67
|
+
feedback?: string;
|
|
68
|
+
/** Pixel widths for responsive variants. Set with uploadPath to generate <name>_400w.jpg etc. and populate srcset/sizes in the Form record. */
|
|
69
|
+
srcsetWidths?: number[];
|
|
22
70
|
}
|
|
23
71
|
export declare const getFileUrl: (file: FileProps, suffix?: string) => string;
|
|
24
|
-
export declare const UploadDocument: ({ name, onChange, label, required, editable, multiple, max, accept,
|
|
25
|
-
export declare const UploadImage: ({ name, onChange, label, editable, multiple, accept, required, max, previewHeight, previewWidth,
|
|
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;
|
|
@@ -15,12 +15,14 @@ export type UploadCSVParseFieldHandler = (field: UploadCSVParseField) => UploadC
|
|
|
15
15
|
interface UploadCSVProps extends UIProps {
|
|
16
16
|
name: string;
|
|
17
17
|
onDataLoaded: UploadCSVDataLoadedHandler;
|
|
18
|
+
onClear?: () => void;
|
|
18
19
|
onParseField?: UploadCSVParseFieldHandler;
|
|
19
20
|
label?: string;
|
|
20
21
|
icon?: string;
|
|
21
22
|
delimiter?: string;
|
|
22
23
|
normalizeKeys?: boolean;
|
|
23
24
|
removeEmptyFields?: boolean;
|
|
25
|
+
required?: boolean;
|
|
24
26
|
}
|
|
25
27
|
export declare const UploadCSV: React.FC<UploadCSVProps>;
|
|
26
28
|
export {};
|
|
@@ -7,11 +7,10 @@ export type RecordSelectionState<TRecord> = {
|
|
|
7
7
|
type UseRecordSelectionArgs<TRecord> = {
|
|
8
8
|
records: TRecord[];
|
|
9
9
|
selectedKeys?: string[];
|
|
10
|
-
legacySelectedKeys?: string[];
|
|
11
10
|
onSelectionChange?: (selection: RecordSelectionState<TRecord>) => void;
|
|
12
11
|
getRecordKey: (record: TRecord, index: number) => string;
|
|
13
12
|
};
|
|
14
|
-
export declare function useRecordSelection<TRecord>({ records, selectedKeys,
|
|
13
|
+
export declare function useRecordSelection<TRecord>({ records, selectedKeys, onSelectionChange, getRecordKey, }: UseRecordSelectionArgs<TRecord>): {
|
|
15
14
|
activeSelectedKeys: string[];
|
|
16
15
|
selectionState: RecordSelectionState<TRecord>;
|
|
17
16
|
showSelection: boolean;
|