@llmnative/react 0.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/LICENSE +201 -0
- package/README.md +375 -0
- package/bin/cli.js +99 -0
- package/dist/index.css +1 -0
- package/dist/index.js +838 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +12161 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/src/App.d.ts +64 -0
- package/dist/types/src/Config.d.ts +65 -0
- package/dist/types/src/Global.d.ts +12 -0
- package/dist/types/src/Head.d.ts +193 -0
- package/dist/types/src/Theme.d.ts +335 -0
- package/dist/types/src/auth.d.ts +27 -0
- package/dist/types/src/components/Component.d.ts +55 -0
- package/dist/types/src/components/FormEnhancer.d.ts +26 -0
- package/dist/types/src/components/Template.d.ts +18 -0
- package/dist/types/src/components/blocks/Brand.d.ts +14 -0
- package/dist/types/src/components/blocks/Breadcrumbs.d.ts +8 -0
- package/dist/types/src/components/blocks/Carousel.d.ts +19 -0
- package/dist/types/src/components/blocks/Dropdown.d.ts +64 -0
- package/dist/types/src/components/blocks/Menu.d.ts +24 -0
- package/dist/types/src/components/blocks/Notifications.d.ts +15 -0
- package/dist/types/src/components/blocks/Search.d.ts +7 -0
- package/dist/types/src/components/index.d.ts +52 -0
- package/dist/types/src/components/types.d.ts +11 -0
- package/dist/types/src/components/ui/Alert.d.ts +13 -0
- package/dist/types/src/components/ui/Badge.d.ts +27 -0
- package/dist/types/src/components/ui/Buttons.d.ts +57 -0
- package/dist/types/src/components/ui/Card.d.ts +15 -0
- package/dist/types/src/components/ui/Code.d.ts +25 -0
- package/dist/types/src/components/ui/Gallery.d.ts +55 -0
- package/dist/types/src/components/ui/GridSystem.d.ts +21 -0
- package/dist/types/src/components/ui/Icon.d.ts +13 -0
- package/dist/types/src/components/ui/Image.d.ts +19 -0
- package/dist/types/src/components/ui/ImageAvatar.d.ts +16 -0
- package/dist/types/src/components/ui/LayoutBuilder.d.ts +19 -0
- package/dist/types/src/components/ui/Loader.d.ts +11 -0
- package/dist/types/src/components/ui/Modal.d.ts +39 -0
- package/dist/types/src/components/ui/Pagination.d.ts +18 -0
- package/dist/types/src/components/ui/Percentage.d.ts +19 -0
- package/dist/types/src/components/ui/Repeat.d.ts +18 -0
- package/dist/types/src/components/ui/Tab.d.ts +20 -0
- package/dist/types/src/components/ui/TabDynamic.d.ts +20 -0
- package/dist/types/src/components/ui/Table.d.ts +43 -0
- package/dist/types/src/components/ui/fields/AssistantAI.d.ts +23 -0
- package/dist/types/src/components/ui/fields/Command.d.ts +15 -0
- package/dist/types/src/components/ui/fields/Crop.d.ts +27 -0
- package/dist/types/src/components/ui/fields/ImageUrl.d.ts +7 -0
- package/dist/types/src/components/ui/fields/Input.d.ts +62 -0
- package/dist/types/src/components/ui/fields/Prompt.d.ts +31 -0
- package/dist/types/src/components/ui/fields/Select.d.ts +38 -0
- package/dist/types/src/components/ui/fields/Upload.d.ts +25 -0
- package/dist/types/src/components/ui/fields/UploadCSV.d.ts +26 -0
- package/dist/types/src/components/ui/useRecordSelection.d.ts +20 -0
- package/dist/types/src/components/ui/useStableRecordKey.d.ts +5 -0
- package/dist/types/src/components/widgets/Form.d.ts +129 -0
- package/dist/types/src/components/widgets/Grid.d.ts +6 -0
- package/dist/types/src/components/widgets/ImageEditor.d.ts +14 -0
- package/dist/types/src/components/widgets/MarkdownReader.d.ts +14 -0
- package/dist/types/src/components/widgets/Prompt.d.ts +31 -0
- package/dist/types/src/components/widgets/TabDynamic.d.ts +20 -0
- package/dist/types/src/components/widgets/grid-core/GridArray.d.ts +5 -0
- package/dist/types/src/components/widgets/grid-core/GridCore.d.ts +5 -0
- package/dist/types/src/components/widgets/grid-core/GridDB.d.ts +5 -0
- package/dist/types/src/components/widgets/grid-core/GridGalleryView.d.ts +5 -0
- package/dist/types/src/components/widgets/grid-core/GridTableView.d.ts +5 -0
- package/dist/types/src/components/widgets/grid-core/index.d.ts +7 -0
- package/dist/types/src/components/widgets/grid-core/resolveGridPathFromUrl.d.ts +1 -0
- package/dist/types/src/components/widgets/grid-core/types.d.ts +227 -0
- package/dist/types/src/components/widgets/grid-core/useGridActions.d.ts +49 -0
- package/dist/types/src/components/widgets/grid-core/useGridColumns.d.ts +10 -0
- package/dist/types/src/components/widgets/grid-core/useGridDBRecords.d.ts +10 -0
- package/dist/types/src/components/widgets/grid-core/useGridPreparedRecords.d.ts +10 -0
- package/dist/types/src/components/widgets/grid-core/useGridSelection.d.ts +13 -0
- package/dist/types/src/components/widgets/grid-core/utils.d.ts +14 -0
- package/dist/types/src/conf/Prompt.d.ts +84 -0
- package/dist/types/src/constant.d.ts +96 -0
- package/dist/types/src/index.d.ts +56 -0
- package/dist/types/src/libs/cache.d.ts +9 -0
- package/dist/types/src/libs/cn.d.ts +2 -0
- package/dist/types/src/libs/converter.d.ts +28 -0
- package/dist/types/src/libs/database.d.ts +3 -0
- package/dist/types/src/libs/email.d.ts +16 -0
- package/dist/types/src/libs/fetch.d.ts +9 -0
- package/dist/types/src/libs/imageBuilder.d.ts +112 -0
- package/dist/types/src/libs/index.d.ts +14 -0
- package/dist/types/src/libs/locale.d.ts +24 -0
- package/dist/types/src/libs/log.d.ts +2 -0
- package/dist/types/src/libs/order.d.ts +14 -0
- package/dist/types/src/libs/path.d.ts +26 -0
- package/dist/types/src/libs/sanitizer.d.ts +38 -0
- package/dist/types/src/libs/seo.d.ts +8 -0
- package/dist/types/src/libs/storage.d.ts +2 -0
- package/dist/types/src/libs/utils.d.ts +57 -0
- package/dist/types/src/motion.d.ts +38 -0
- package/dist/types/src/pages/Blog.d.ts +3 -0
- package/dist/types/src/pages/BlogPost.d.ts +16 -0
- package/dist/types/src/pages/Helper.d.ts +8 -0
- package/dist/types/src/pages/NotFound.d.ts +3 -0
- package/dist/types/src/pages/Users.d.ts +3 -0
- package/dist/types/src/pages/index.d.ts +3 -0
- package/dist/types/src/providers/ProviderConfiguration.d.ts +12 -0
- package/dist/types/src/providers/ai/index.d.ts +134 -0
- package/dist/types/src/providers/auth/AuthProvider.d.ts +22 -0
- package/dist/types/src/providers/auth/AuthProviderContext.d.ts +12 -0
- package/dist/types/src/providers/auth/dropbox/DropboxAuthProvider.d.ts +16 -0
- package/dist/types/src/providers/auth/google/GoogleAuth.d.ts +44 -0
- package/dist/types/src/providers/auth/google/GoogleAuthProvider.d.ts +12 -0
- package/dist/types/src/providers/auth/google/apis/auth.d.ts +4 -0
- package/dist/types/src/providers/auth/google/auth.d.ts +3 -0
- package/dist/types/src/providers/data/DataProvider.d.ts +58 -0
- package/dist/types/src/providers/data/DataProviderContext.d.ts +12 -0
- package/dist/types/src/providers/data/firebase.d.ts +21 -0
- package/dist/types/src/providers/data/mock.d.ts +20 -0
- package/dist/types/src/providers/data/supabase.d.ts +19 -0
- package/dist/types/src/providers/email/EmailProvider.d.ts +10 -0
- package/dist/types/src/providers/email/EmailProviderContext.d.ts +12 -0
- package/dist/types/src/providers/email/google/GmailEmailProvider.d.ts +7 -0
- package/dist/types/src/providers/email/google/apis/email.d.ts +7 -0
- package/dist/types/src/providers/email/google/email.d.ts +13 -0
- package/dist/types/src/providers/firebase-init.d.ts +10 -0
- package/dist/types/src/providers/icon/IconProvider.d.ts +10 -0
- package/dist/types/src/providers/icon/IconProviderContext.d.ts +48 -0
- package/dist/types/src/providers/icon/LucideIconProvider.d.ts +5 -0
- package/dist/types/src/providers/icon/PhosphorIconProvider.d.ts +10 -0
- package/dist/types/src/providers/icon/index.d.ts +6 -0
- package/dist/types/src/providers/manifest.d.ts +42 -0
- package/dist/types/src/providers/scrape/index.d.ts +10 -0
- package/dist/types/src/providers/seo/google/keyword.d.ts +14 -0
- package/dist/types/src/providers/seo/google/trend.d.ts +25 -0
- package/dist/types/src/providers/storage/StorageProvider.d.ts +7 -0
- package/dist/types/src/providers/storage/StorageProviderContext.d.ts +12 -0
- package/dist/types/src/providers/storage/dropbox.d.ts +48 -0
- package/dist/types/src/providers/storage/firebase.d.ts +13 -0
- package/dist/types/src/providers/storage/supabase.d.ts +19 -0
- package/dist/types/src/types/Block.d.ts +4 -0
- package/dist/types/src/types/FormFields.d.ts +33 -0
- package/dist/types/src/types/Layout.d.ts +9 -0
- package/dist/types/src/types/Section.d.ts +4 -0
- package/dist/types/themes/cyber.d.ts +7 -0
- package/dist/types/themes/default.d.ts +7 -0
- package/dist/types/themes/flat.d.ts +7 -0
- package/package.json +126 -0
- package/scripts/cli/create-section.js +65 -0
- package/scripts/cli/setup-devtools.js +85 -0
- package/scripts/cli/setup-project.js +484 -0
- package/themes/cyber.ts +405 -0
- package/themes/default.ts +405 -0
- package/themes/flat.ts +405 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MotionUIProps } from '../types';
|
|
3
|
+
export type ModalSaveHandler = (e: React.MouseEvent<HTMLButtonElement>) => Promise<boolean>;
|
|
4
|
+
export type ModalDeleteHandler = (e: React.MouseEvent<HTMLButtonElement>) => Promise<boolean>;
|
|
5
|
+
interface ModalProps extends MotionUIProps {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
title?: React.ReactNode;
|
|
8
|
+
header?: React.ReactNode;
|
|
9
|
+
footer?: React.ReactNode | false;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
onSave?: ModalSaveHandler;
|
|
12
|
+
onDelete?: ModalDeleteHandler;
|
|
13
|
+
size?: "sm" | "md" | "lg" | "xl" | "fullscreen";
|
|
14
|
+
position?: "center" | "top" | "left" | "right" | "bottom";
|
|
15
|
+
buttonFullscreen?: boolean;
|
|
16
|
+
buttonCancel?: boolean;
|
|
17
|
+
headerClass?: string;
|
|
18
|
+
titleClass?: string;
|
|
19
|
+
subTitleClass?: string;
|
|
20
|
+
bodyClass?: string;
|
|
21
|
+
footerClass?: string;
|
|
22
|
+
closeOnBackdrop?: boolean;
|
|
23
|
+
}
|
|
24
|
+
interface ModalYesNoProps {
|
|
25
|
+
title?: React.ReactNode;
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
onYes?: (e: React.MouseEvent<HTMLButtonElement>) => Promise<boolean>;
|
|
28
|
+
onNo?: (e: React.MouseEvent<HTMLButtonElement>) => Promise<boolean>;
|
|
29
|
+
onClose?: () => void;
|
|
30
|
+
}
|
|
31
|
+
interface ModalOkProps {
|
|
32
|
+
children: React.ReactNode;
|
|
33
|
+
title?: React.ReactNode;
|
|
34
|
+
onClose?: () => void;
|
|
35
|
+
}
|
|
36
|
+
declare const Modal: (props: ModalProps) => React.JSX.Element;
|
|
37
|
+
export declare const ModalYesNo: ({ children, title, onYes, onNo, onClose }: ModalYesNoProps) => React.JSX.Element;
|
|
38
|
+
export declare const ModalOk: ({ children, title, onClose }: ModalOkProps) => React.JSX.Element;
|
|
39
|
+
export default Modal;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UIProps } from "../index";
|
|
3
|
+
export type PaginationParams = {
|
|
4
|
+
page?: number;
|
|
5
|
+
limit?: number;
|
|
6
|
+
navLimit?: number;
|
|
7
|
+
scrollToTopOnChange?: boolean;
|
|
8
|
+
scrollBehavior?: ScrollBehavior;
|
|
9
|
+
align?: "start" | "center" | "end";
|
|
10
|
+
sticky?: boolean;
|
|
11
|
+
};
|
|
12
|
+
interface PaginationProps<T> extends UIProps, PaginationParams {
|
|
13
|
+
recordSet: T[];
|
|
14
|
+
children: (pageRecords: T[], pageOffset: number) => React.ReactNode;
|
|
15
|
+
appendTo?: HTMLElement | null;
|
|
16
|
+
}
|
|
17
|
+
declare const Pagination: <T>({ recordSet, children, limit, page, navLimit, appendTo, pre, post, className, wrapClass, scrollToTopOnChange, scrollBehavior, align, sticky }: PaginationProps<T>) => React.JSX.Element;
|
|
18
|
+
export default Pagination;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { UIProps } from '../..';
|
|
3
|
+
type ColorType = "info" | "success" | "warning" | "danger" | "primary" | "secondary" | "light" | "dark";
|
|
4
|
+
type ShapeType = "bar" | "circle";
|
|
5
|
+
interface PercentageProps extends UIProps {
|
|
6
|
+
val?: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
min?: number;
|
|
9
|
+
shape?: ShapeType;
|
|
10
|
+
type?: ColorType;
|
|
11
|
+
background?: ColorType;
|
|
12
|
+
thickness?: number;
|
|
13
|
+
showText?: boolean;
|
|
14
|
+
size?: number;
|
|
15
|
+
fontSize?: number;
|
|
16
|
+
label?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const Percentage: ({ val, max, min, shape, type, background, thickness, showText, size, fontSize, label, pre, post, wrapClass, className }: PercentageProps) => React.JSX.Element;
|
|
19
|
+
export default Percentage;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FieldOnChange } from '../widgets/Form';
|
|
3
|
+
interface RepeatProps {
|
|
4
|
+
name: string;
|
|
5
|
+
children: React.ReactNode | ((record: any) => React.ReactNode);
|
|
6
|
+
value?: any[];
|
|
7
|
+
onChange?: FieldOnChange;
|
|
8
|
+
onAdd?: (value: any[]) => void;
|
|
9
|
+
onRemove?: (index: number) => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
layout?: 'vertical' | 'horizontal' | 'inline';
|
|
12
|
+
min?: number;
|
|
13
|
+
max?: number;
|
|
14
|
+
label?: string;
|
|
15
|
+
readOnly?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare const Repeat: ({ name, children, onChange, onAdd, onRemove, className, layout, min, max, label, readOnly, }: RepeatProps) => React.JSX.Element;
|
|
18
|
+
export default Repeat;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MotionUIProps } from '../types';
|
|
3
|
+
export type TabPosition = "default" | "top" | "left" | "right" | "bottom";
|
|
4
|
+
interface TabItemProps {
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
interface TabLayoutProps {
|
|
9
|
+
menu: React.ReactNode;
|
|
10
|
+
content: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
interface TabProps extends MotionUIProps {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
defaultTab?: number;
|
|
15
|
+
tabPosition?: TabPosition;
|
|
16
|
+
}
|
|
17
|
+
export declare const TabLayouts: Record<TabPosition, (props: TabLayoutProps) => JSX.Element>;
|
|
18
|
+
export declare const TabItem: React.FC<TabItemProps>;
|
|
19
|
+
declare const Tab: React.FC<TabProps>;
|
|
20
|
+
export default Tab;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TabPosition } from './Tab';
|
|
3
|
+
import { FieldOnChange } from '../widgets/Form';
|
|
4
|
+
interface TabDynamicProps {
|
|
5
|
+
children: React.ReactNode | ((record: any) => React.ReactNode);
|
|
6
|
+
name: string;
|
|
7
|
+
onChange?: FieldOnChange;
|
|
8
|
+
onAdd?: (value: any[]) => void;
|
|
9
|
+
onRemove?: (index: number) => void;
|
|
10
|
+
value?: any[];
|
|
11
|
+
label?: string;
|
|
12
|
+
min?: number;
|
|
13
|
+
max?: number;
|
|
14
|
+
activeIndex?: number;
|
|
15
|
+
title?: string;
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
tabPosition?: TabPosition;
|
|
18
|
+
}
|
|
19
|
+
declare const TabDynamic: ({ children, name, onChange, onAdd, onRemove, label, min, max, activeIndex, title, readOnly, tabPosition }: TabDynamicProps) => React.JSX.Element;
|
|
20
|
+
export default TabDynamic;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RecordArray, RecordProps } from "../../providers/data/DataProvider";
|
|
3
|
+
import { UIProps } from '../';
|
|
4
|
+
import { PaginationParams } from './Pagination';
|
|
5
|
+
import { type OrderConfig } from '../../libs/order';
|
|
6
|
+
import { RecordSelectionState } from './useRecordSelection';
|
|
7
|
+
export type TableHeaderProp = {
|
|
8
|
+
key: string;
|
|
9
|
+
label: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
sort?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type TableReorderMeta = {
|
|
14
|
+
fromIndex: number;
|
|
15
|
+
toIndex: number;
|
|
16
|
+
record: RecordProps;
|
|
17
|
+
};
|
|
18
|
+
export type TableSelectionState = RecordSelectionState<RecordProps>;
|
|
19
|
+
export type TableSelectionMode = 'single' | 'multiple';
|
|
20
|
+
export type TableSelectionChangeHandler = (selection: TableSelectionState) => void;
|
|
21
|
+
export type TableReorderHandler = (reorderedRecords: RecordArray, meta: TableReorderMeta) => void;
|
|
22
|
+
interface TableProps extends UIProps {
|
|
23
|
+
header?: TableHeaderProp[];
|
|
24
|
+
body?: RecordArray;
|
|
25
|
+
Footer?: string | React.ReactNode;
|
|
26
|
+
onClick?: (record: RecordProps) => void;
|
|
27
|
+
onReorder?: TableReorderHandler;
|
|
28
|
+
onSelectionChange?: TableSelectionChangeHandler;
|
|
29
|
+
selectionMode?: TableSelectionMode;
|
|
30
|
+
sortable?: boolean | OrderConfig;
|
|
31
|
+
pagination?: PaginationParams;
|
|
32
|
+
activeKey?: string | null;
|
|
33
|
+
selectedKeys?: string[];
|
|
34
|
+
selectedRowKeys?: string[];
|
|
35
|
+
headerClass?: string;
|
|
36
|
+
bodyClass?: string;
|
|
37
|
+
footerClass?: string;
|
|
38
|
+
heightClass?: string;
|
|
39
|
+
scrollClass?: string;
|
|
40
|
+
selectedClass?: string;
|
|
41
|
+
}
|
|
42
|
+
declare function Table({ header, body, Footer, onClick, onReorder, onSelectionChange, selectionMode, sortable, pagination, activeKey, selectedKeys, selectedRowKeys, pre, post, wrapClass, className, headerClass, bodyClass, footerClass, heightClass, scrollClass, selectedClass }: TableProps): React.JSX.Element;
|
|
43
|
+
export default Table;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UIProps } from '../../index';
|
|
3
|
+
interface AssistantAIProps extends UIProps {
|
|
4
|
+
name: string;
|
|
5
|
+
promptTopic: {
|
|
6
|
+
prompt: string;
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
configVariables: {
|
|
10
|
+
lang: string;
|
|
11
|
+
voice: string;
|
|
12
|
+
style: string;
|
|
13
|
+
limit: string;
|
|
14
|
+
};
|
|
15
|
+
initialValue?: string;
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
onChange: (e: any) => void;
|
|
18
|
+
viewMode?: 'list' | 'carousel';
|
|
19
|
+
autoStart?: boolean;
|
|
20
|
+
onReset?: () => void;
|
|
21
|
+
}
|
|
22
|
+
declare const AssistantAI: ({ name, promptTopic, configVariables, initialValue, children, onChange, viewMode, autoStart, onReset, pre, post, wrapClass, className }: AssistantAIProps) => React.JSX.Element;
|
|
23
|
+
export default AssistantAI;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const Command: React.FC<{
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}> & {
|
|
5
|
+
Trigger: React.FC<TriggerProps>;
|
|
6
|
+
};
|
|
7
|
+
type TriggerProps = {
|
|
8
|
+
char: string;
|
|
9
|
+
onSelect: (value: string) => React.ReactNode;
|
|
10
|
+
children: (props: {
|
|
11
|
+
filter: string;
|
|
12
|
+
select: (value: string) => void;
|
|
13
|
+
}) => React.ReactNode;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FileProps } from "./Upload";
|
|
3
|
+
interface CropProps {
|
|
4
|
+
fileName: string;
|
|
5
|
+
type: string;
|
|
6
|
+
scale: string;
|
|
7
|
+
top: number;
|
|
8
|
+
left: number;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
base64?: string;
|
|
12
|
+
}
|
|
13
|
+
interface ImageProps extends FileProps {
|
|
14
|
+
variants: Record<string, CropProps>;
|
|
15
|
+
}
|
|
16
|
+
export declare const CropImage: React.ForwardRefExoticComponent<{
|
|
17
|
+
img: ImageProps;
|
|
18
|
+
title?: string;
|
|
19
|
+
} & React.RefAttributes<unknown>>;
|
|
20
|
+
interface FileNameEditorProps {
|
|
21
|
+
value: string;
|
|
22
|
+
onChange: (newName: string) => void;
|
|
23
|
+
scale?: string;
|
|
24
|
+
label?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const FileNameEditor: ({ value, onChange, label, scale, }: FileNameEditorProps) => React.JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FormFieldProps } from "../../widgets/Form";
|
|
3
|
+
import { PromptMode } from "./Prompt";
|
|
4
|
+
export interface ImageUrlProps extends FormFieldProps {
|
|
5
|
+
mode?: PromptMode;
|
|
6
|
+
}
|
|
7
|
+
export declare const ImageUrl: ({ name, label, required, onChange, defaultValue, pre, post, wrapClass, className, mode, }: ImageUrlProps) => React.JSX.Element;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UIProps } from '../../..';
|
|
3
|
+
import { FormFieldProps, InputType } from '../../widgets/Form';
|
|
4
|
+
interface BaseInputProps extends FormFieldProps {
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
type?: InputType;
|
|
7
|
+
updatable?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
feedback?: string;
|
|
10
|
+
min?: number;
|
|
11
|
+
max?: number;
|
|
12
|
+
step?: number;
|
|
13
|
+
}
|
|
14
|
+
interface LabelProps {
|
|
15
|
+
label: string;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
htmlFor?: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
export type InputProps = Omit<BaseInputProps, 'type'>;
|
|
21
|
+
export interface CheckboxProps extends FormFieldProps {
|
|
22
|
+
title?: string;
|
|
23
|
+
valueChecked?: string | number;
|
|
24
|
+
}
|
|
25
|
+
export interface TextAreaProps extends FormFieldProps {
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
updatable?: boolean;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
rows?: number;
|
|
30
|
+
feedback?: string;
|
|
31
|
+
useRef?: any;
|
|
32
|
+
}
|
|
33
|
+
export interface ListGroupProps extends UIProps {
|
|
34
|
+
children: React.ReactNode[];
|
|
35
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement>, index: number) => void;
|
|
36
|
+
label?: string;
|
|
37
|
+
draggable?: boolean;
|
|
38
|
+
onDrop?: (text: string) => string;
|
|
39
|
+
actives?: number[];
|
|
40
|
+
disables?: number[];
|
|
41
|
+
loaders?: number[];
|
|
42
|
+
itemClass?: string;
|
|
43
|
+
}
|
|
44
|
+
export declare const Input: ({ name, onChange, defaultValue, placeholder, label, type, required, updatable, disabled, pre, post, feedback, min, max, step, wrapClass, className }: BaseInputProps) => React.JSX.Element;
|
|
45
|
+
export declare const String: (props: InputProps) => React.JSX.Element;
|
|
46
|
+
export declare const Number: (props: InputProps) => React.JSX.Element;
|
|
47
|
+
export declare const Email: (props: InputProps) => React.JSX.Element;
|
|
48
|
+
export declare const Password: (props: InputProps) => React.JSX.Element;
|
|
49
|
+
export declare const Color: (props: InputProps) => React.JSX.Element;
|
|
50
|
+
export declare const Date: (props: InputProps) => React.JSX.Element;
|
|
51
|
+
export declare const Time: (props: InputProps) => React.JSX.Element;
|
|
52
|
+
export declare const DateTime: (props: InputProps) => React.JSX.Element;
|
|
53
|
+
export declare const Week: (props: InputProps) => React.JSX.Element;
|
|
54
|
+
export declare const Month: (props: InputProps) => React.JSX.Element;
|
|
55
|
+
export declare const Range: (props: InputProps) => React.JSX.Element;
|
|
56
|
+
export declare const Url: (props: InputProps) => React.JSX.Element;
|
|
57
|
+
export declare const Checkbox: ({ name, onChange, defaultValue, label, title, required, valueChecked, pre, post, wrapClass, className }: CheckboxProps) => React.JSX.Element;
|
|
58
|
+
export declare const Switch: (props: CheckboxProps) => React.JSX.Element;
|
|
59
|
+
export declare const Label: ({ label, required, htmlFor, className }: LabelProps) => React.JSX.Element;
|
|
60
|
+
export declare const TextArea: ({ name, onChange, defaultValue, placeholder, label, required, updatable, disabled, rows, useRef, pre, post, feedback, className, wrapClass }: TextAreaProps) => React.JSX.Element;
|
|
61
|
+
export declare const ListGroup: ({ children, onClick, label, actives, draggable, onDrop, disables, loaders, pre, post, wrapClass, className, itemClass }: ListGroupProps) => React.JSX.Element;
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AIFetchConfig } from '../../../providers/ai';
|
|
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 {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type OrderConfig } from "../../../libs/order";
|
|
3
|
+
import { DBConfig, RecordProps } from "../../../providers/data/DataProvider";
|
|
4
|
+
import { FormFieldProps } from '../../widgets/Form';
|
|
5
|
+
interface Option extends RecordProps {
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}
|
|
9
|
+
type OptionOrderConfig = OrderConfig & {
|
|
10
|
+
field: 'label' | 'value';
|
|
11
|
+
};
|
|
12
|
+
interface BaseProps extends FormFieldProps {
|
|
13
|
+
updatable?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
title?: string;
|
|
16
|
+
feedback?: string;
|
|
17
|
+
options?: Option[] | string[] | number[];
|
|
18
|
+
db?: DBConfig;
|
|
19
|
+
order?: OptionOrderConfig;
|
|
20
|
+
}
|
|
21
|
+
export interface SelectProps extends BaseProps {
|
|
22
|
+
optionEmpty?: Option;
|
|
23
|
+
value?: string | number;
|
|
24
|
+
}
|
|
25
|
+
export interface AutocompleteProps extends BaseProps {
|
|
26
|
+
min?: number;
|
|
27
|
+
max?: number;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
creatable?: boolean;
|
|
30
|
+
onCreate?: (value: string) => Promise<void> | void;
|
|
31
|
+
}
|
|
32
|
+
export interface ChecklistProps extends BaseProps {
|
|
33
|
+
checkClass?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare const Select: ({ name, onChange, defaultValue, required, updatable, disabled, optionEmpty, label, title, pre, post, feedback, options, db, order, wrapClass, className, }: SelectProps) => React.JSX.Element;
|
|
36
|
+
export declare const Autocomplete: ({ name, defaultValue, min, max, onChange, required, updatable, disabled, label, title, placeholder, pre, post, feedback, options, db, order, wrapClass, className, creatable, onCreate, }: AutocompleteProps) => React.JSX.Element;
|
|
37
|
+
export declare const Checklist: ({ name, defaultValue, onChange, required, updatable, disabled, label, title, pre, post, feedback, options, db, order, wrapClass, className, checkClass, }: ChecklistProps) => React.JSX.Element;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FormFieldProps } from "../../widgets/Form";
|
|
3
|
+
export interface FileProps {
|
|
4
|
+
key: string;
|
|
5
|
+
fileName: string;
|
|
6
|
+
size: number;
|
|
7
|
+
type: string;
|
|
8
|
+
progress: number;
|
|
9
|
+
url: string;
|
|
10
|
+
base64?: string;
|
|
11
|
+
variants: Record<string, any>;
|
|
12
|
+
}
|
|
13
|
+
export interface UploadDocumentProps extends FormFieldProps {
|
|
14
|
+
editable?: boolean;
|
|
15
|
+
multiple?: boolean;
|
|
16
|
+
accept?: string;
|
|
17
|
+
max?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface UploadImageProps extends UploadDocumentProps {
|
|
20
|
+
previewHeight?: number;
|
|
21
|
+
previewWidth?: number;
|
|
22
|
+
}
|
|
23
|
+
export declare const getFileUrl: (file: FileProps, suffix?: string) => string;
|
|
24
|
+
export declare const UploadDocument: ({ name, onChange, label, required, editable, multiple, max, accept, pre, post, wrapClass, className, }: UploadDocumentProps) => React.JSX.Element;
|
|
25
|
+
export declare const UploadImage: ({ name, onChange, label, editable, multiple, accept, required, max, previewHeight, previewWidth, pre, post, wrapClass, className, }: UploadImageProps) => React.JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UIProps } from '../../..';
|
|
3
|
+
export type UploadCSVCell = string | null | undefined;
|
|
4
|
+
export interface UploadCSVRow {
|
|
5
|
+
[key: string]: UploadCSVCell;
|
|
6
|
+
}
|
|
7
|
+
export interface UploadCSVData {
|
|
8
|
+
data: UploadCSVRow[];
|
|
9
|
+
fields: string[];
|
|
10
|
+
file: File;
|
|
11
|
+
}
|
|
12
|
+
export type UploadCSVParseField = [key: string, value: UploadCSVCell];
|
|
13
|
+
export type UploadCSVDataLoadedHandler = (results: UploadCSVData) => void;
|
|
14
|
+
export type UploadCSVParseFieldHandler = (field: UploadCSVParseField) => UploadCSVParseField | undefined;
|
|
15
|
+
interface UploadCSVProps extends UIProps {
|
|
16
|
+
name: string;
|
|
17
|
+
onDataLoaded: UploadCSVDataLoadedHandler;
|
|
18
|
+
onParseField?: UploadCSVParseFieldHandler;
|
|
19
|
+
label?: string;
|
|
20
|
+
icon?: string;
|
|
21
|
+
delimiter?: string;
|
|
22
|
+
normalizeKeys?: boolean;
|
|
23
|
+
removeEmptyFields?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const UploadCSV: React.FC<UploadCSVProps>;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type RecordSelectionState<TRecord> = {
|
|
2
|
+
keys: string[];
|
|
3
|
+
records: TRecord[];
|
|
4
|
+
clear: () => void;
|
|
5
|
+
hasSelection: boolean;
|
|
6
|
+
};
|
|
7
|
+
type UseRecordSelectionArgs<TRecord> = {
|
|
8
|
+
records: TRecord[];
|
|
9
|
+
selectedKeys?: string[];
|
|
10
|
+
legacySelectedKeys?: string[];
|
|
11
|
+
onSelectionChange?: (selection: RecordSelectionState<TRecord>) => void;
|
|
12
|
+
getRecordKey: (record: TRecord, index: number) => string;
|
|
13
|
+
};
|
|
14
|
+
export declare function useRecordSelection<TRecord>({ records, selectedKeys, legacySelectedKeys, onSelectionChange, getRecordKey, }: UseRecordSelectionArgs<TRecord>): {
|
|
15
|
+
activeSelectedKeys: string[];
|
|
16
|
+
selectionState: RecordSelectionState<TRecord>;
|
|
17
|
+
showSelection: boolean;
|
|
18
|
+
updateSelection: (nextKeys: string[]) => void;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RecordProps } from "../../providers/data/DataProvider";
|
|
3
|
+
import { FormTree, ModelProps } from "../Component";
|
|
4
|
+
import { UIProps } from '../';
|
|
5
|
+
export type ChangeHandler = React.ChangeEvent<any> | {
|
|
6
|
+
target: {
|
|
7
|
+
name: string;
|
|
8
|
+
value?: any;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
type FormHandleChange = (event: ChangeHandler) => void;
|
|
12
|
+
export type FieldOnChange = (params: {
|
|
13
|
+
event: ChangeHandler;
|
|
14
|
+
name: string;
|
|
15
|
+
value: any;
|
|
16
|
+
record: RecordProps;
|
|
17
|
+
onChange: FormHandleChange;
|
|
18
|
+
}) => void;
|
|
19
|
+
export type InputType = "text" | "number" | "email" | "password" | "color" | "date" | "time" | "datetime-local" | "week" | "month" | "range" | "checkbox" | "radio" | "url";
|
|
20
|
+
interface FormContextProps {
|
|
21
|
+
name: string;
|
|
22
|
+
onChange?: FieldOnChange;
|
|
23
|
+
wrapClass?: string;
|
|
24
|
+
inputType?: InputType;
|
|
25
|
+
defaultValue?: any;
|
|
26
|
+
}
|
|
27
|
+
interface FormContextResult {
|
|
28
|
+
value: any;
|
|
29
|
+
handleChange: FormHandleChange;
|
|
30
|
+
formWrapClass?: string;
|
|
31
|
+
record: RecordProps;
|
|
32
|
+
}
|
|
33
|
+
export interface FormFieldProps extends UIProps {
|
|
34
|
+
name: string;
|
|
35
|
+
label?: string;
|
|
36
|
+
value?: any;
|
|
37
|
+
required?: boolean;
|
|
38
|
+
onChange?: FieldOnChange;
|
|
39
|
+
defaultValue?: any;
|
|
40
|
+
}
|
|
41
|
+
interface SetFormFieldsNameProps {
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
parentName: string;
|
|
44
|
+
parentKey?: string;
|
|
45
|
+
wrapClass?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare const useFormContext: ({ name, onChange, wrapClass, inputType, defaultValue }: FormContextProps) => FormContextResult;
|
|
48
|
+
type UseHandleDropProps = {
|
|
49
|
+
name: string;
|
|
50
|
+
value: string;
|
|
51
|
+
handleChange?: FormHandleChange;
|
|
52
|
+
};
|
|
53
|
+
export declare const useHandleDrop: ({ name, value, handleChange }: UseHandleDropProps) => (e: React.DragEvent<HTMLTextAreaElement | HTMLInputElement>) => void;
|
|
54
|
+
export declare const setFormFieldsName: ({ children, parentName, parentKey, wrapClass }: SetFormFieldsNameProps) => React.ReactNode;
|
|
55
|
+
export type SavePathProps = {
|
|
56
|
+
record: RecordProps;
|
|
57
|
+
storagePath?: string;
|
|
58
|
+
};
|
|
59
|
+
export type FormSaveArgs = {
|
|
60
|
+
record?: RecordProps;
|
|
61
|
+
prevRecord?: RecordProps;
|
|
62
|
+
storagePath?: string;
|
|
63
|
+
action: 'create' | 'update';
|
|
64
|
+
};
|
|
65
|
+
export type FormDeleteArgs = {
|
|
66
|
+
record?: RecordProps;
|
|
67
|
+
};
|
|
68
|
+
export type FormFinallyArgs = {
|
|
69
|
+
record?: RecordProps;
|
|
70
|
+
action: 'create' | 'update' | 'delete';
|
|
71
|
+
};
|
|
72
|
+
export type FormSaveHandler = (args: FormSaveArgs) => Promise<string | undefined>;
|
|
73
|
+
export type FormDeleteHandler = (args: FormDeleteArgs) => Promise<string | undefined>;
|
|
74
|
+
export type FormFinallyHandler = (args: FormFinallyArgs) => Promise<boolean>;
|
|
75
|
+
interface BaseFormProps {
|
|
76
|
+
aspect?: "card" | "empty";
|
|
77
|
+
header?: React.ReactNode;
|
|
78
|
+
footer?: React.ReactNode;
|
|
79
|
+
dataStoragePath?: string;
|
|
80
|
+
handlers?: FormHandlers;
|
|
81
|
+
setPrimaryKey?: (record: RecordProps) => string;
|
|
82
|
+
savePath?: (props: SavePathProps) => string | undefined;
|
|
83
|
+
onLoad?: (record: RecordProps) => void;
|
|
84
|
+
onChange?: (record: RecordProps) => void;
|
|
85
|
+
onSave?: FormSaveHandler;
|
|
86
|
+
onDelete?: FormDeleteHandler;
|
|
87
|
+
onFinally?: FormFinallyHandler;
|
|
88
|
+
log?: boolean;
|
|
89
|
+
showNotice?: boolean;
|
|
90
|
+
showBack?: boolean;
|
|
91
|
+
wrapClass?: string;
|
|
92
|
+
headerClass?: string;
|
|
93
|
+
className?: string;
|
|
94
|
+
footerClass?: string;
|
|
95
|
+
}
|
|
96
|
+
interface FormDefaultProps extends BaseFormProps {
|
|
97
|
+
children: React.ReactNode | ((fields: FormTree) => React.ReactNode) | ((args: {
|
|
98
|
+
record?: RecordProps;
|
|
99
|
+
}) => React.ReactNode);
|
|
100
|
+
defaultValues?: RecordProps;
|
|
101
|
+
}
|
|
102
|
+
interface FormDatabaseProps extends FormDefaultProps {
|
|
103
|
+
dataStoragePath: string;
|
|
104
|
+
}
|
|
105
|
+
interface FormModelProps extends BaseFormProps {
|
|
106
|
+
model: ModelProps;
|
|
107
|
+
children?: ((fields: FormTree) => React.ReactNode);
|
|
108
|
+
}
|
|
109
|
+
interface FormProps extends BaseFormProps {
|
|
110
|
+
children?: React.ReactNode | ((fields: FormTree) => React.ReactNode) | ((args: {
|
|
111
|
+
record?: RecordProps;
|
|
112
|
+
}) => React.ReactNode);
|
|
113
|
+
defaultValues?: RecordProps;
|
|
114
|
+
}
|
|
115
|
+
export interface FormRef {
|
|
116
|
+
handleSave: (e: React.MouseEvent<HTMLButtonElement>) => Promise<boolean>;
|
|
117
|
+
handleDelete: (e: React.MouseEvent<HTMLButtonElement>) => Promise<boolean>;
|
|
118
|
+
getHeader: () => React.ReactNode;
|
|
119
|
+
getRecord: () => {
|
|
120
|
+
record: RecordProps;
|
|
121
|
+
isNewRecord: boolean;
|
|
122
|
+
};
|
|
123
|
+
getFooter: () => React.ReactNode;
|
|
124
|
+
}
|
|
125
|
+
type FormHandlers = Partial<FormRef>;
|
|
126
|
+
export declare const FormDatabase: React.ForwardRefExoticComponent<FormDatabaseProps & React.RefAttributes<FormRef>>;
|
|
127
|
+
export declare function FormModel({ model, children, ...formProps }: FormModelProps): React.JSX.Element | null;
|
|
128
|
+
declare const _default: React.ForwardRefExoticComponent<FormProps & React.RefAttributes<FormRef>>;
|
|
129
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type RecordProps } from "../../providers/data/DataProvider";
|
|
3
|
+
import { type GridProps } from "./grid-core/types";
|
|
4
|
+
declare function Grid<TRecord extends RecordProps = RecordProps>(props: GridProps<TRecord>): React.JSX.Element;
|
|
5
|
+
export default Grid;
|
|
6
|
+
export type * from "./grid-core/types";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import 'tui-image-editor/dist/tui-image-editor.css';
|
|
3
|
+
type ImageEditorProps = {
|
|
4
|
+
imageUrl: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
modal?: boolean;
|
|
9
|
+
onImageLoad?: () => void;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
onSave?: (dataUrl: string) => void;
|
|
12
|
+
};
|
|
13
|
+
declare const ImageEditor: ({ imageUrl, title, width, height, modal, onImageLoad, onClose, onSave }: ImageEditorProps) => React.JSX.Element;
|
|
14
|
+
export default ImageEditor;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Components } from 'react-markdown';
|
|
3
|
+
import { type PageMetadataState } from '../../Head';
|
|
4
|
+
type MarkdownComponents = Components;
|
|
5
|
+
export interface MarkdownReaderProps {
|
|
6
|
+
content: string;
|
|
7
|
+
components?: MarkdownComponents;
|
|
8
|
+
className?: string;
|
|
9
|
+
wrapClass?: string;
|
|
10
|
+
head?: PageMetadataState;
|
|
11
|
+
onNavigateInternal?: (href: string, event: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
12
|
+
}
|
|
13
|
+
export default function MarkdownReader({ content, components, className, wrapClass, head, onNavigateInternal, }: MarkdownReaderProps): React.JSX.Element;
|
|
14
|
+
export {};
|