@cozeloop/components 0.0.0-beta-1766561124625
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 +84 -0
- package/dist/es/index.css +645 -0
- package/dist/es/index.mjs +6091 -0
- package/dist/es/static/svg/select.svg +1 -0
- package/dist/lib/base-search-select/base-search-form-select.d.ts +3 -0
- package/dist/lib/base-search-select/base-search-select.d.ts +9 -0
- package/dist/lib/base-search-select/index.d.ts +3 -0
- package/dist/lib/base-search-select/types.d.ts +13 -0
- package/dist/lib/base-search-select/utils.d.ts +8 -0
- package/dist/lib/basic-card/index.d.ts +7 -0
- package/dist/lib/card-pane/index.d.ts +5 -0
- package/dist/lib/chip-select/index.d.ts +2 -0
- package/dist/lib/code-editor/index.d.ts +3 -0
- package/dist/lib/code-editor-with-loading/index.d.ts +10 -0
- package/dist/lib/codemirror-editor/code-editor.d.ts +23 -0
- package/dist/lib/codemirror-editor/index.d.ts +6 -0
- package/dist/lib/codemirror-editor/json-editor.d.ts +19 -0
- package/dist/lib/codemirror-editor/raw-code-editor.d.ts +20 -0
- package/dist/lib/codemirror-editor/raw-text-editor.d.ts +11 -0
- package/dist/lib/codemirror-editor/text-editor.d.ts +23 -0
- package/dist/lib/codemirror-editor/themes/coze-dark.d.ts +1 -0
- package/dist/lib/codemirror-editor/themes/coze-light.d.ts +1 -0
- package/dist/lib/collapse-card/index.d.ts +14 -0
- package/dist/lib/collapsible-card/index.d.ts +13 -0
- package/dist/lib/column-manage-storage/index.d.ts +11 -0
- package/dist/lib/columns-select/index.d.ts +19 -0
- package/dist/lib/copyable/index.d.ts +5 -0
- package/dist/lib/edit-icon-button/index.d.ts +8 -0
- package/dist/lib/footer-actions/index.d.ts +15 -0
- package/dist/lib/hooks/use-infinite-scroll.d.ts +23 -0
- package/dist/lib/hooks/use-mouse-down-offset.d.ts +9 -0
- package/dist/lib/hooks/use-unsave-leave-warning.d.ts +15 -0
- package/dist/lib/id-render/icon-button-container.d.ts +8 -0
- package/dist/lib/id-render/index.d.ts +7 -0
- package/dist/lib/index-controller/record-navigation.d.ts +6 -0
- package/dist/lib/index-controller/use-item-index-controller.d.ts +47 -0
- package/dist/lib/index.d.ts +70 -0
- package/dist/lib/infinite-scroll-table/index.d.ts +19 -0
- package/dist/lib/info-tooltip/index.d.ts +9 -0
- package/dist/lib/input-components/radio-button.d.ts +14 -0
- package/dist/lib/input-slider/index.d.ts +15 -0
- package/dist/lib/input-with-count/index.d.ts +2 -0
- package/dist/lib/jump-button/jump-icon-button.d.ts +4 -0
- package/dist/lib/large-txt-render/index.d.ts +4 -0
- package/dist/lib/layout/content.d.ts +7 -0
- package/dist/lib/layout/header.d.ts +7 -0
- package/dist/lib/layout/index.d.ts +12 -0
- package/dist/lib/layout/tabs.d.ts +6 -0
- package/dist/lib/lazy-load-component/index.d.ts +5 -0
- package/dist/lib/logic-editor/index.d.ts +3 -0
- package/dist/lib/logic-editor/logic-editor.d.ts +15 -0
- package/dist/lib/logic-editor/logic-left-render.d.ts +3 -0
- package/dist/lib/logic-editor/logic-operator-render.d.ts +3 -0
- package/dist/lib/logic-editor/logic-right-render.d.ts +3 -0
- package/dist/lib/logic-editor/logic-types.d.ts +53 -0
- package/dist/lib/logic-editor/utils.d.ts +2 -0
- package/dist/lib/logic-expr/consts.d.ts +2 -0
- package/dist/lib/logic-expr/expr-group-render.d.ts +2 -0
- package/dist/lib/logic-expr/expr-render.d.ts +2 -0
- package/dist/lib/logic-expr/index.d.ts +2 -0
- package/dist/lib/logic-expr/logic-expr.d.ts +2 -0
- package/dist/lib/logic-expr/logic-not.d.ts +10 -0
- package/dist/lib/logic-expr/logic-toggle.d.ts +12 -0
- package/dist/lib/logic-expr/types.d.ts +79 -0
- package/dist/lib/loop-icons/index.d.ts +1 -0
- package/dist/lib/loop-radio-group/index.d.ts +2 -0
- package/dist/lib/multi-part-editor/components/image-item-renderer.d.ts +14 -0
- package/dist/lib/multi-part-editor/components/multipart-item-renderer.d.ts +10 -0
- package/dist/lib/multi-part-editor/components/url-input-modal.d.ts +14 -0
- package/dist/lib/multi-part-editor/components/video-item-renderer.d.ts +14 -0
- package/dist/lib/multi-part-editor/index.d.ts +3 -0
- package/dist/lib/multi-part-editor/multi-part-render.d.ts +10 -0
- package/dist/lib/multi-part-editor/type.d.ts +81 -0
- package/dist/lib/multi-part-editor/upload-button.d.ts +23 -0
- package/dist/lib/multi-part-editor/utils.d.ts +16 -0
- package/dist/lib/open-detail-button/index.d.ts +6 -0
- package/dist/lib/page-content/index.d.ts +20 -0
- package/dist/lib/primary-page/index.d.ts +1 -0
- package/dist/lib/primary-page/primary-header.d.ts +13 -0
- package/dist/lib/primary-title/index.d.ts +6 -0
- package/dist/lib/provider/index.d.ts +19 -0
- package/dist/lib/resizable-side-sheet/index.d.ts +10 -0
- package/dist/lib/resize-sidesheet/index.d.ts +7 -0
- package/dist/lib/resize-sidesheet/use-drag.d.ts +11 -0
- package/dist/lib/schema-editor/index.d.ts +11 -0
- package/dist/lib/semi-schema-form/components/tmpls/array-field-item.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/tmpls/array-field.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/tmpls/base-input.d.ts +8 -0
- package/dist/lib/semi-schema-form/components/tmpls/description-field.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/tmpls/error-list.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/tmpls/field-error.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/tmpls/field.d.ts +7 -0
- package/dist/lib/semi-schema-form/components/tmpls/icon-button.d.ts +11 -0
- package/dist/lib/semi-schema-form/components/tmpls/index.d.ts +2 -0
- package/dist/lib/semi-schema-form/components/tmpls/object-field.d.ts +8 -0
- package/dist/lib/semi-schema-form/components/tmpls/submit.d.ts +4 -0
- package/dist/lib/semi-schema-form/components/tmpls/title-field.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/widgets/checkbox.d.ts +7 -0
- package/dist/lib/semi-schema-form/components/widgets/checkboxs.d.ts +7 -0
- package/dist/lib/semi-schema-form/components/widgets/index.d.ts +2 -0
- package/dist/lib/semi-schema-form/components/widgets/radio.d.ts +7 -0
- package/dist/lib/semi-schema-form/components/widgets/range.d.ts +7 -0
- package/dist/lib/semi-schema-form/components/widgets/select.d.ts +7 -0
- package/dist/lib/semi-schema-form/components/widgets/textarea.d.ts +6 -0
- package/dist/lib/semi-schema-form/index.d.ts +4 -0
- package/dist/lib/sentinel-form/enum.d.ts +8 -0
- package/dist/lib/sentinel-form/index.d.ts +20 -0
- package/dist/lib/step-nav/index.d.ts +12 -0
- package/dist/lib/table/index.d.ts +2 -0
- package/dist/lib/table/sort-icon.d.ts +8 -0
- package/dist/lib/table/table-with-pagination.d.ts +21 -0
- package/dist/lib/table/table-without-pagniation.d.ts +6 -0
- package/dist/lib/table-batch-operate/table-batch-operation.d.ts +9 -0
- package/dist/lib/table-batch-operate/use-batch-operate.d.ts +30 -0
- package/dist/lib/table-col-actions/index.d.ts +22 -0
- package/dist/lib/table-cols-config/index.d.ts +11 -0
- package/dist/lib/table-cols-config/type.d.ts +6 -0
- package/dist/lib/table-cols-config/use-hidden-col-keys.d.ts +5 -0
- package/dist/lib/table-cols-config/util.d.ts +3 -0
- package/dist/lib/table-empty/index.d.ts +2 -0
- package/dist/lib/table-header/index.d.ts +14 -0
- package/dist/lib/tabs/index.d.ts +2 -0
- package/dist/lib/text-area-pro/index.d.ts +6 -0
- package/dist/lib/text-with-copy/index.d.ts +14 -0
- package/dist/lib/title-with-sub/index.d.ts +7 -0
- package/dist/lib/tooltip-when-disabled/index.d.ts +6 -0
- package/dist/lib/tooltip-with-disabled/index.d.ts +5 -0
- package/dist/lib/upload/index.d.ts +9 -0
- package/dist/lib/user-profile/index.d.ts +9 -0
- package/dist/lib/utils/basic.d.ts +2 -0
- package/dist/lib/version-list/version-descriptions.d.ts +15 -0
- package/dist/lib/version-list/version-item.d.ts +9 -0
- package/dist/lib/version-list/version-list.d.ts +11 -0
- package/dist/lib/version-list/version-switch-panel.d.ts +5 -0
- package/package.json +64 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type TabsProps } from '@coze-arch/coze-design';
|
|
2
|
+
export declare function Tabs({ className, ...props }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare namespace Tabs {
|
|
4
|
+
var TabPane: typeof import("@coze-arch/coze-design").TabPane;
|
|
5
|
+
var TabItem;
|
|
6
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type PopoverProps } from '@coze-arch/coze-design';
|
|
2
|
+
import { type LogicFilter, type LogicField } from './logic-types';
|
|
3
|
+
/** 逻辑筛选器 */
|
|
4
|
+
export declare function LogicEditor({ fields, disabled, value, popoverProps, tooltip, clearEmptyCondition, enableCascadeMode, onChange, onConfirm, onClose, }: {
|
|
5
|
+
fields: LogicField[];
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
value?: LogicFilter | undefined;
|
|
8
|
+
popoverProps?: PopoverProps;
|
|
9
|
+
tooltip?: React.ReactNode;
|
|
10
|
+
/** 是否过滤空条件 */ clearEmptyCondition?: boolean;
|
|
11
|
+
/** 字段选择开启级联模式 */ enableCascadeMode?: boolean;
|
|
12
|
+
onChange?: (val?: LogicFilter) => void;
|
|
13
|
+
onConfirm?: (val?: LogicFilter) => void;
|
|
14
|
+
onClose?: () => void;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type LeftRenderProps } from '../logic-expr';
|
|
2
|
+
import { type RenderProps, type LogicFilterLeft } from './logic-types';
|
|
3
|
+
export default function LeftRender(props: LeftRenderProps<LogicFilterLeft, string, string | number | undefined> & RenderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type OperatorRenderProps } from '../logic-expr';
|
|
2
|
+
import { type LogicFilterLeft, type RenderProps } from './logic-types';
|
|
3
|
+
export default function OperatorRender(props: OperatorRenderProps<LogicFilterLeft, string, string | number | undefined> & RenderProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type RightRenderProps } from '../logic-expr';
|
|
2
|
+
import { type LogicFilterLeft, type RenderProps } from './logic-types';
|
|
3
|
+
export default function RightRender(props: RightRenderProps<LogicFilterLeft, string, string | number | undefined> & RenderProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type Expr, type ExprGroup } from '../logic-expr';
|
|
2
|
+
export interface LogicOperation {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
export type LogicFilterLeft = string | string[];
|
|
7
|
+
export type LogicFilter = ExprGroup<LogicFilterLeft, string, any>;
|
|
8
|
+
export interface RenderProps {
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
fields: LogicField[];
|
|
11
|
+
/** 开启级联模式,佐治会变成数组 */
|
|
12
|
+
enableCascadeMode?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** 逻辑编辑器的字段 */
|
|
15
|
+
export interface LogicField {
|
|
16
|
+
/** 字段标题 */
|
|
17
|
+
title: React.ReactNode;
|
|
18
|
+
/** 字段名称 */
|
|
19
|
+
name: string;
|
|
20
|
+
/** 字段类型 */
|
|
21
|
+
type: 'string' | 'number' | 'options' | 'custom';
|
|
22
|
+
setterProps?: Record<string, unknown>;
|
|
23
|
+
/** 自定义操作符右边的输入编辑器 */
|
|
24
|
+
setter?: LogicSetter;
|
|
25
|
+
/** 禁用操作符列表 */
|
|
26
|
+
disabledOperations?: string[];
|
|
27
|
+
/** operator 自定义属性 */
|
|
28
|
+
operatorProps?: Record<string, unknown>;
|
|
29
|
+
/** 自定义操作符列表,会覆盖原有列表 */
|
|
30
|
+
customOperations?: LogicOperation[];
|
|
31
|
+
/** 子字段 */
|
|
32
|
+
children?: LogicField[];
|
|
33
|
+
}
|
|
34
|
+
export interface DataTypeSetterProps<T = any> {
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
value: T;
|
|
37
|
+
expr: Expr | undefined;
|
|
38
|
+
field: LogicField;
|
|
39
|
+
disabled: boolean;
|
|
40
|
+
onChange: (val: T) => void;
|
|
41
|
+
}
|
|
42
|
+
export type LogicSetter = (props: DataTypeSetterProps) => JSX.Element | null;
|
|
43
|
+
export interface LogicDataType {
|
|
44
|
+
type: 'string' | 'number' | 'date' | 'options';
|
|
45
|
+
operations: LogicOperation[];
|
|
46
|
+
setter: LogicSetter;
|
|
47
|
+
}
|
|
48
|
+
export declare const baseOperations: () => LogicOperation[];
|
|
49
|
+
export declare const stringOperations: () => LogicOperation[];
|
|
50
|
+
export declare const numberOperations: () => LogicOperation[];
|
|
51
|
+
export declare const dateOperations: () => LogicOperation[];
|
|
52
|
+
export declare const selectOperations: () => LogicOperation[];
|
|
53
|
+
export declare function useDataTypeList(): LogicDataType[];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { ExprGroupRenderProps } from './types';
|
|
2
|
+
export declare function ExprGroupRender<L, O, R>({ value, readonly, singleTag, enableNot, className, exprGroupRenderContentItemsClassName, style, path, leftRender, operatorRender, rightRender, allowLogicOperators, maxNestingDepth, elementSize, logicToggleReadonly, onExprChange, onExprGroupChange, onAddItem, onAddGroup, onDeleteExpr, onDeleteExprGroup, errorMsgRender, }: ExprGroupRenderProps<L, O, R>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { ExprRenderProps } from './types';
|
|
2
|
+
export declare const ExprRender: <L, O, R>({ value, readonly, enableNot, className, style, path, leftRender, operatorRender, rightRender, elementSize, onChange, onDelete, renderTool, errorMsgRender, }: ExprRenderProps<L, O, R>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
interface LogicNotProps {
|
|
3
|
+
not?: boolean;
|
|
4
|
+
readonly?: boolean;
|
|
5
|
+
onChange?: (not: boolean) => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: CSSProperties;
|
|
8
|
+
}
|
|
9
|
+
export declare function LogicNot(props: LogicNotProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LogicOperator } from './types';
|
|
2
|
+
interface LogicToggleProps {
|
|
3
|
+
enableNot?: boolean;
|
|
4
|
+
operator?: LogicOperator;
|
|
5
|
+
not?: boolean;
|
|
6
|
+
hideLine?: boolean;
|
|
7
|
+
readonly?: boolean;
|
|
8
|
+
allowLogicOperators?: LogicOperator[];
|
|
9
|
+
onChange: (operator: LogicOperator, not: boolean) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function LogicToggle(props: LogicToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
export type LogicOperator = 'and' | 'or';
|
|
3
|
+
export interface Expr<L = string, O = string, R = string> {
|
|
4
|
+
left: L;
|
|
5
|
+
operator: O;
|
|
6
|
+
right: R;
|
|
7
|
+
not?: boolean;
|
|
8
|
+
disableDeletion?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ExprGroup<L = string, O = string, R = string> {
|
|
11
|
+
logicOperator?: LogicOperator;
|
|
12
|
+
not?: boolean;
|
|
13
|
+
disableDeletion?: boolean;
|
|
14
|
+
exprs?: Expr<L, O, R>[];
|
|
15
|
+
childExprGroups?: ExprGroup<L, O, R>[];
|
|
16
|
+
}
|
|
17
|
+
export interface OperatorOption {
|
|
18
|
+
label: ReactNode | string;
|
|
19
|
+
value: string | number;
|
|
20
|
+
}
|
|
21
|
+
interface BaseRenderProps<L, O, R> {
|
|
22
|
+
expr: Expr<L, O, R>;
|
|
23
|
+
readonly?: boolean;
|
|
24
|
+
size?: 'small' | 'large' | 'default';
|
|
25
|
+
onExprChange?: (expr: Partial<Expr<L, O, R>>) => void;
|
|
26
|
+
}
|
|
27
|
+
export interface LeftRenderProps<L, O, R> extends BaseRenderProps<L, O, R> {
|
|
28
|
+
onChange?: (val: L) => void;
|
|
29
|
+
}
|
|
30
|
+
export interface RightRenderProps<L, O, R> extends BaseRenderProps<L, O, R> {
|
|
31
|
+
onChange?: (val: R) => void;
|
|
32
|
+
}
|
|
33
|
+
export interface OperatorRenderProps<L, O, R> extends BaseRenderProps<L, O, R> {
|
|
34
|
+
onChange?: (val: O) => void;
|
|
35
|
+
}
|
|
36
|
+
interface Props<L, O, R> {
|
|
37
|
+
enableNot?: boolean;
|
|
38
|
+
readonly?: boolean;
|
|
39
|
+
leftRender?: (props: LeftRenderProps<L, O, R>) => ReactNode;
|
|
40
|
+
operatorRender?: ((props: OperatorRenderProps<L, O, R>) => ReactNode) | OperatorOption[];
|
|
41
|
+
rightRender?: (props: RightRenderProps<L, O, R>) => ReactNode;
|
|
42
|
+
errorMsgRender?: (props: RightRenderProps<L, O, R>) => ReactNode;
|
|
43
|
+
elementSize?: 'small' | 'large' | 'default';
|
|
44
|
+
className?: string;
|
|
45
|
+
style?: CSSProperties;
|
|
46
|
+
}
|
|
47
|
+
export interface LogicExprProps<L, O, R> extends Props<L, O, R> {
|
|
48
|
+
value?: ExprGroup<L, O, R>;
|
|
49
|
+
defaultExpr: Expr<L, O, R>;
|
|
50
|
+
allowLogicOperators?: LogicOperator[];
|
|
51
|
+
maxNestingDepth?: number;
|
|
52
|
+
exprGroupRenderContentItemsClassName?: string;
|
|
53
|
+
logicToggleReadonly?: boolean;
|
|
54
|
+
onChange?: (exprGroup?: ExprGroup<L, O, R>) => void;
|
|
55
|
+
onDeleteExpr?: (key: L) => void;
|
|
56
|
+
}
|
|
57
|
+
export interface ExprGroupRenderProps<L, O, R> extends Props<L, O, R> {
|
|
58
|
+
value?: ExprGroup<L, O, R>;
|
|
59
|
+
singleTag?: boolean;
|
|
60
|
+
path: string;
|
|
61
|
+
allowLogicOperators?: LogicOperator[];
|
|
62
|
+
maxNestingDepth?: number;
|
|
63
|
+
exprGroupRenderContentItemsClassName?: string;
|
|
64
|
+
logicToggleReadonly?: boolean;
|
|
65
|
+
onExprChange?: (expr: Expr<L, O, R>, path: string, index: number) => void;
|
|
66
|
+
onExprGroupChange?: (exprGroup: ExprGroup<L, O, R>, path: string) => void;
|
|
67
|
+
onAddItem?: (path: string) => void;
|
|
68
|
+
onAddGroup?: (path: string) => void;
|
|
69
|
+
onDeleteExpr?: (path: string, index: number) => void;
|
|
70
|
+
onDeleteExprGroup?: (path: string) => void;
|
|
71
|
+
}
|
|
72
|
+
export interface ExprRenderProps<L, O, R> extends Props<L, O, R> {
|
|
73
|
+
value: Expr<L, O, R>;
|
|
74
|
+
path: string;
|
|
75
|
+
onChange?: (expr: Expr<L, O, R>, path: string) => void;
|
|
76
|
+
onDelete?: (path: string) => void;
|
|
77
|
+
renderTool?: () => React.JSX.Element;
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@arco-iconbox/react-cozeloop-icons';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MultipartItem } from '../type';
|
|
3
|
+
interface ImageItemRendererProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
spaceID?: Int64;
|
|
7
|
+
item: MultipartItem;
|
|
8
|
+
readonly?: boolean;
|
|
9
|
+
onRemove: () => void;
|
|
10
|
+
onChange: (item: MultipartItem) => void;
|
|
11
|
+
uploadFile?: (params: unknown) => Promise<string>;
|
|
12
|
+
}
|
|
13
|
+
export declare const ImageItemRenderer: React.FC<ImageItemRendererProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MultipartItem } from '../type';
|
|
3
|
+
interface MultipartItemRendererProps {
|
|
4
|
+
item: MultipartItem;
|
|
5
|
+
readonly?: boolean;
|
|
6
|
+
onChange: (item: MultipartItem) => void;
|
|
7
|
+
onRemove: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const MultipartItemRenderer: React.FC<MultipartItemRendererProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type Image as ImageProps } from '@cozeloop/api-schema/evaluation';
|
|
3
|
+
import { type UploadAttachmentDetail } from '../type';
|
|
4
|
+
interface UrlInputModalProps {
|
|
5
|
+
visible: boolean;
|
|
6
|
+
onConfirm: (results: ImageProps[]) => void;
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
maxCount?: number;
|
|
9
|
+
uploadImageUrl?: (urls: string[]) => Promise<UploadAttachmentDetail[] | undefined>;
|
|
10
|
+
uploadType?: 'image' | 'video';
|
|
11
|
+
intranetUrlValidator?: (url: string) => boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const UrlInputModal: React.FC<UrlInputModalProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MultipartItem } from '../type';
|
|
3
|
+
interface VideoItemRendererProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
spaceID?: Int64;
|
|
7
|
+
item: MultipartItem;
|
|
8
|
+
readonly?: boolean;
|
|
9
|
+
onRemove: () => void;
|
|
10
|
+
onChange: (item: MultipartItem) => void;
|
|
11
|
+
uploadFile?: (params: unknown) => Promise<string>;
|
|
12
|
+
}
|
|
13
|
+
export declare const VideoItemRenderer: React.FC<VideoItemRendererProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ContentPartLoop } from './type';
|
|
2
|
+
interface MultiPartRenderProps {
|
|
3
|
+
fileParts?: ContentPartLoop[];
|
|
4
|
+
readonly?: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
onDeleteFilePart?: (part: ContentPartLoop) => void;
|
|
7
|
+
onFilePartsChange?: (part: ContentPartLoop) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function MultiPartRender({ fileParts, onDeleteFilePart, onFilePartsChange, readonly, className, }: MultiPartRenderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type ContentPart } from '@cozeloop/api-schema/prompt';
|
|
2
|
+
import { type Content, type Image, type ContentType } from '@cozeloop/api-schema/evaluation';
|
|
3
|
+
import { ItemErrorType, type MultiModalSpec } from '@cozeloop/api-schema/data';
|
|
4
|
+
export declare enum ImageStatus {
|
|
5
|
+
Loading = "loading",
|
|
6
|
+
Success = "success",
|
|
7
|
+
Error = "error"
|
|
8
|
+
}
|
|
9
|
+
export type FileItemStatus = 'success' | 'uploadFail' | 'validateFail' | 'validating' | 'uploading' | 'wait';
|
|
10
|
+
export interface ContentPartLoop extends ContentPart {
|
|
11
|
+
uid?: string;
|
|
12
|
+
status?: FileItemStatus;
|
|
13
|
+
}
|
|
14
|
+
export declare const getErrorTypeMap: () => {
|
|
15
|
+
1: string;
|
|
16
|
+
2: string;
|
|
17
|
+
3: string;
|
|
18
|
+
4: string;
|
|
19
|
+
5: string;
|
|
20
|
+
100: string;
|
|
21
|
+
6: string;
|
|
22
|
+
7: string;
|
|
23
|
+
8: string;
|
|
24
|
+
9: string;
|
|
25
|
+
10: string;
|
|
26
|
+
11: string;
|
|
27
|
+
12: string;
|
|
28
|
+
13: string;
|
|
29
|
+
103: string;
|
|
30
|
+
};
|
|
31
|
+
export type MultipartItemContentType = ContentType | 'Video';
|
|
32
|
+
export interface MultipartItem extends Omit<Content, 'content_type'> {
|
|
33
|
+
uid?: string;
|
|
34
|
+
sourceImage?: {
|
|
35
|
+
status: ImageStatus;
|
|
36
|
+
file?: File;
|
|
37
|
+
};
|
|
38
|
+
sourceVideo?: {
|
|
39
|
+
status: ImageStatus;
|
|
40
|
+
file?: File;
|
|
41
|
+
};
|
|
42
|
+
video?: Image;
|
|
43
|
+
content_type: MultipartItemContentType;
|
|
44
|
+
config?: {
|
|
45
|
+
image_resolution?: string;
|
|
46
|
+
video_fps?: number;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export interface ImageField {
|
|
50
|
+
name?: string;
|
|
51
|
+
url?: string;
|
|
52
|
+
uri?: string;
|
|
53
|
+
thumb_url?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface UploadAttachmentDetail {
|
|
56
|
+
contentType?: ContentType;
|
|
57
|
+
originImage?: ImageField;
|
|
58
|
+
image?: ImageField;
|
|
59
|
+
errorType?: ItemErrorType;
|
|
60
|
+
errMsg?: string;
|
|
61
|
+
}
|
|
62
|
+
export type MultipartEditorConfig = MultiModalSpec & {
|
|
63
|
+
imageEnabled?: boolean;
|
|
64
|
+
imageSupportedFormats?: string[];
|
|
65
|
+
videoEnabled?: boolean;
|
|
66
|
+
videoSupportedFormats?: string[];
|
|
67
|
+
maxVideoSize?: number;
|
|
68
|
+
};
|
|
69
|
+
export interface MultipartEditorProps {
|
|
70
|
+
spaceID?: Int64;
|
|
71
|
+
className?: string;
|
|
72
|
+
value?: MultipartItem[];
|
|
73
|
+
multipartConfig?: MultipartEditorConfig;
|
|
74
|
+
readonly?: boolean;
|
|
75
|
+
onChange?: (contents: MultipartItem[]) => void;
|
|
76
|
+
uploadFile?: (params: any) => Promise<string>;
|
|
77
|
+
uploadImageUrl?: (urls: string[]) => Promise<UploadAttachmentDetail[] | undefined>;
|
|
78
|
+
imageHidden?: boolean;
|
|
79
|
+
videoHidden?: boolean;
|
|
80
|
+
intranetUrlValidator?: (url: string) => boolean;
|
|
81
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Upload } from '@coze-arch/coze-design';
|
|
2
|
+
import { type ContentPartLoop } from './type';
|
|
3
|
+
interface UploadBtnProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
spaceID: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
maxImageSize?: number;
|
|
7
|
+
maxVideoSize?: number;
|
|
8
|
+
maxFileCount?: number;
|
|
9
|
+
imageEnabled?: boolean;
|
|
10
|
+
videoEnabled?: boolean;
|
|
11
|
+
imageSupportedFormats?: string[];
|
|
12
|
+
videoSupportedFormats?: string[];
|
|
13
|
+
fileLimit?: number;
|
|
14
|
+
fileParts?: ContentPartLoop[];
|
|
15
|
+
uploadFile?: (params: any) => Promise<string>;
|
|
16
|
+
onFilePartsChange?: (part: ContentPartLoop) => void;
|
|
17
|
+
}
|
|
18
|
+
export interface UploadButtonRef {
|
|
19
|
+
getUploadImage: () => Upload | null;
|
|
20
|
+
getUploadVideo: () => Upload | null;
|
|
21
|
+
}
|
|
22
|
+
export declare const UploadButton: import("react").ForwardRefExoticComponent<UploadBtnProps & import("react").RefAttributes<UploadButtonRef>>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type MultipartEditorConfig } from './type';
|
|
2
|
+
export declare const DEFAULT_FILE_SIZE: number;
|
|
3
|
+
export declare const DEFAULT_FILE_COUNT = 20;
|
|
4
|
+
export declare const DEFAULT_PART_COUNT = 50;
|
|
5
|
+
export declare const DEFAULT_SUPPORTED_FORMATS: string[];
|
|
6
|
+
export declare const DEFAULT_VIDEO_SUPPORTED_FORMATS: string[];
|
|
7
|
+
export declare const getMultipartConfig: (multipartConfig?: MultipartEditorConfig) => {
|
|
8
|
+
maxFileCount: number;
|
|
9
|
+
maxPartCount: number;
|
|
10
|
+
maxFileSize: number;
|
|
11
|
+
imageEnabled: boolean | undefined;
|
|
12
|
+
videoEnabled: boolean | undefined;
|
|
13
|
+
imageSupportedFormats: string;
|
|
14
|
+
videoSupportedFormats: string;
|
|
15
|
+
maxVideoSize: number | undefined;
|
|
16
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
import { type EmptyStateProps } from '@coze-arch/coze-design';
|
|
3
|
+
interface PageLoadingProps {
|
|
4
|
+
tip?: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
}
|
|
8
|
+
interface FullPageProps {
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
type PageContentProps = Omit<EmptyStateProps, 'image' | 'darkModeImage'>;
|
|
14
|
+
export declare function FullPage({ children, className, style }: FullPageProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function PageLoading(props: PageLoadingProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function PageNotFound({ className, ...props }: PageContentProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function PageError({ className, ...props }: PageContentProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function PageNoAuth({ className, ...props }: PageContentProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function PageNoContent({ className, ...props }: PageContentProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PrimaryPage } from './primary-header';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
interface PrimaryPageHeaderProps {
|
|
3
|
+
pageTitle?: ReactNode;
|
|
4
|
+
filterSlot?: ReactNode;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
headerClassName?: string;
|
|
7
|
+
titleClassName?: string;
|
|
8
|
+
contentClassName?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
titleSlot?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const PrimaryPage: ({ pageTitle, filterSlot, children, contentClassName, className, headerClassName, titleClassName, titleSlot, }: PrimaryPageHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
interface CozeLoopContextValue {
|
|
3
|
+
resources?: {
|
|
4
|
+
'zh-CN': {
|
|
5
|
+
translation: Record<string, string>;
|
|
6
|
+
};
|
|
7
|
+
'en-US': {
|
|
8
|
+
translation: Record<string, string>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
defaultLanguage?: string;
|
|
12
|
+
sendEvent?: (name: string, params: Record<string, unknown>, target?: HTMLElement | string | null) => void;
|
|
13
|
+
}
|
|
14
|
+
interface CozeLoopProviderProps extends CozeLoopContextValue {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export declare function CozeLoopProvider({ children, defaultLanguage, resources, sendEvent, }: CozeLoopProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function useReportEvent(): (name: string, params: Record<string, unknown>, target?: HTMLElement | string | null) => void;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type SideSheetReactProps } from '@coze-arch/coze-design';
|
|
2
|
+
interface ResizableSideSheetProps extends SideSheetReactProps {
|
|
3
|
+
minSize?: number;
|
|
4
|
+
maxSize?: number;
|
|
5
|
+
defaultSize?: number;
|
|
6
|
+
onResizeEnd?: (size: number) => void;
|
|
7
|
+
}
|
|
8
|
+
/** 仅支持 left 模式 */
|
|
9
|
+
export declare const ResizableSideSheet: (props: ResizableSideSheetProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type SideSheetReactProps } from '@coze-arch/coze-design';
|
|
2
|
+
import { type DragOptions } from './use-drag';
|
|
3
|
+
export declare const ResizeSidesheet: (props: SideSheetReactProps & {
|
|
4
|
+
dragOptions?: DragOptions;
|
|
5
|
+
showDivider?: boolean;
|
|
6
|
+
disableDrag?: boolean;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface DragOptions {
|
|
2
|
+
defaultWidth?: number;
|
|
3
|
+
maxWidth?: number;
|
|
4
|
+
minWidth?: number;
|
|
5
|
+
onDragEnd?: (width: number) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const useDrag: (options?: DragOptions) => {
|
|
8
|
+
sidePaneWidth: number;
|
|
9
|
+
containerRef: (node: HTMLElement | null) => void;
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface SchemaEditorProps {
|
|
2
|
+
value?: string;
|
|
3
|
+
readOnly?: boolean;
|
|
4
|
+
onChange?: (value?: string) => void;
|
|
5
|
+
language?: string;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
showLineNumbs?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const SchemaEditor: ({ value, onChange, placeholder, readOnly, language, className, }: SchemaEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ArrayFieldTemplateItemType, type FormContextType, type RJSFSchema, type StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
|
|
3
|
+
*
|
|
4
|
+
* @param props - The `ArrayFieldTemplateItemType` props for the component
|
|
5
|
+
*/
|
|
6
|
+
export default function ArrayFieldItemTemplate<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>(props: ArrayFieldTemplateItemType<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ArrayFieldTemplateProps, type FormContextType, type RJSFSchema, type StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
/** The `ArrayFieldTemplate` component is the template used to render all items in an array.
|
|
3
|
+
*
|
|
4
|
+
* @param props - The `ArrayFieldTemplateItemType` props for the component
|
|
5
|
+
*/
|
|
6
|
+
export default function ArrayFieldTemplate<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>(props: ArrayFieldTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type BaseInputTemplateProps, type FormContextType, type RJSFSchema, type StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
/** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
|
|
3
|
+
* It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
|
|
4
|
+
* It can be customized/overridden for other themes or individual implementations as needed.
|
|
5
|
+
*
|
|
6
|
+
* @param props - The `WidgetProps` for this template
|
|
7
|
+
*/
|
|
8
|
+
export default function BaseInputTemplate<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>(props: BaseInputTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type DescriptionFieldProps, type FormContextType, type RJSFSchema, type StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
/** The `DescriptionField` is the template to use to render the description of a field
|
|
3
|
+
*
|
|
4
|
+
* @param props - The `DescriptionFieldProps` for this component
|
|
5
|
+
*/
|
|
6
|
+
export default function DescriptionField<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>(props: DescriptionFieldProps<T, S, F>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ErrorListProps, type FormContextType, type RJSFSchema, type StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
/** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
|
|
3
|
+
*
|
|
4
|
+
* @param props - The `ErrorListProps` for this component
|
|
5
|
+
*/
|
|
6
|
+
export default function ErrorList<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>({ errors, registry }: ErrorListProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type FieldErrorProps, type FormContextType, type RJSFSchema, type StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
/** The `FieldErrorTemplate` component renders the errors local to the particular field
|
|
3
|
+
*
|
|
4
|
+
* @param props - The `FieldErrorProps` for the errors being rendered
|
|
5
|
+
*/
|
|
6
|
+
export default function FieldErrorTemplate<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>(props: FieldErrorProps<T, S, F>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type FieldTemplateProps, type FormContextType, type RJSFSchema, type StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
/** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field
|
|
3
|
+
* content, (label, description, children, errors and help) inside of a `WrapIfAdditional` component.
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `FieldTemplateProps` for this component
|
|
6
|
+
*/
|
|
7
|
+
export default function FieldTemplate<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>(props: FieldTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type FormContextType, type IconButtonProps, type RJSFSchema, type StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
import { type IconButtonProps as SemiIconBaseButtonProps } from '@coze-arch/coze-design';
|
|
3
|
+
export type BaseIconButtonProps<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object> = Omit<IconButtonProps<T, S, F>, 'type' | 'color'>;
|
|
4
|
+
type IconButtonComponent = <T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>(props: BaseIconButtonProps<T, S, F>) => JSX.Element;
|
|
5
|
+
export default function BaseIconButton<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>(props: BaseIconButtonProps<T, S, F> & SemiIconBaseButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const AddButton: IconButtonComponent;
|
|
7
|
+
export declare const CopyButton: IconButtonComponent;
|
|
8
|
+
export declare const MoveDownButton: IconButtonComponent;
|
|
9
|
+
export declare const MoveUpButton: IconButtonComponent;
|
|
10
|
+
export declare const RemoveButton: IconButtonComponent;
|
|
11
|
+
export {};
|