@cozeloop/components 0.0.2 → 0.0.3-beta-1769665914778

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.
Files changed (235) hide show
  1. package/README.md +82 -1
  2. package/dist/es/index.css +645 -0
  3. package/dist/es/index.mjs +6089 -0
  4. package/dist/es/loopIcons.mjs +3 -0
  5. package/dist/es/rslib-runtime.mjs +40 -0
  6. package/dist/es/static/svg/select.svg +1 -0
  7. package/dist/lib/base-search-select/base-search-form-select.d.ts +3 -0
  8. package/dist/lib/base-search-select/base-search-select.d.ts +12 -0
  9. package/dist/lib/base-search-select/index.d.ts +3 -0
  10. package/dist/lib/base-search-select/types.d.ts +13 -0
  11. package/dist/lib/base-search-select/utils.d.ts +8 -0
  12. package/dist/lib/basic-card/index.d.ts +7 -0
  13. package/dist/lib/card-pane/index.d.ts +5 -0
  14. package/dist/lib/chip-select/index.d.ts +2 -0
  15. package/dist/lib/code-editor/index.d.ts +3 -0
  16. package/dist/lib/code-editor-with-loading/index.d.ts +10 -0
  17. package/dist/lib/codemirror-editor/code-editor.d.ts +23 -0
  18. package/dist/lib/codemirror-editor/index.d.ts +6 -0
  19. package/dist/lib/codemirror-editor/json-editor.d.ts +19 -0
  20. package/dist/lib/codemirror-editor/raw-code-editor.d.ts +20 -0
  21. package/dist/lib/codemirror-editor/raw-text-editor.d.ts +11 -0
  22. package/dist/lib/codemirror-editor/text-editor.d.ts +23 -0
  23. package/dist/lib/codemirror-editor/themes/coze-dark.d.ts +1 -0
  24. package/dist/lib/codemirror-editor/themes/coze-light.d.ts +1 -0
  25. package/dist/lib/collapse-card/index.d.ts +14 -0
  26. package/dist/lib/collapse-item/index.d.ts +7 -0
  27. package/dist/lib/collapsible-card/index.d.ts +13 -0
  28. package/dist/{types → lib}/column-manage-storage/index.d.ts +6 -6
  29. package/dist/lib/columns-select/index.d.ts +19 -0
  30. package/dist/lib/copyable/index.d.ts +5 -0
  31. package/dist/lib/edit-icon-button/index.d.ts +8 -0
  32. package/dist/lib/footer-actions/index.d.ts +15 -0
  33. package/dist/{types → lib}/hooks/use-infinite-scroll.d.ts +12 -12
  34. package/dist/lib/hooks/use-mouse-down-offset.d.ts +9 -0
  35. package/dist/lib/hooks/use-unsave-leave-warning.d.ts +15 -0
  36. package/dist/lib/id-render/icon-button-container.d.ts +8 -0
  37. package/dist/lib/id-render/index.d.ts +7 -0
  38. package/dist/lib/index-controller/record-navigation.d.ts +6 -0
  39. package/dist/lib/index-controller/use-item-index-controller.d.ts +47 -0
  40. package/dist/lib/index.d.ts +71 -0
  41. package/dist/{types → lib}/infinite-scroll-table/index.d.ts +6 -6
  42. package/dist/lib/info-tooltip/index.d.ts +9 -0
  43. package/dist/lib/input-components/radio-button.d.ts +14 -0
  44. package/dist/lib/input-slider/index.d.ts +15 -0
  45. package/dist/lib/input-with-count/index.d.ts +2 -0
  46. package/dist/lib/jump-button/jump-icon-button.d.ts +4 -0
  47. package/dist/{types → lib}/large-txt-render/index.d.ts +2 -2
  48. package/dist/lib/layout/content.d.ts +7 -0
  49. package/dist/lib/layout/header.d.ts +7 -0
  50. package/dist/lib/layout/index.d.ts +12 -0
  51. package/dist/lib/layout/tabs.d.ts +6 -0
  52. package/dist/lib/lazy-load-component/index.d.ts +5 -0
  53. package/dist/lib/logic-editor/index.d.ts +3 -0
  54. package/dist/lib/logic-editor/logic-editor.d.ts +15 -0
  55. package/dist/lib/logic-editor/logic-left-render.d.ts +3 -0
  56. package/dist/lib/logic-editor/logic-operator-render.d.ts +3 -0
  57. package/dist/lib/logic-editor/logic-right-render.d.ts +3 -0
  58. package/dist/lib/logic-editor/logic-types.d.ts +53 -0
  59. package/dist/lib/logic-editor/utils.d.ts +2 -0
  60. package/dist/lib/logic-expr/consts.d.ts +2 -0
  61. package/dist/lib/logic-expr/expr-group-render.d.ts +2 -0
  62. package/dist/lib/logic-expr/expr-render.d.ts +2 -0
  63. package/dist/lib/logic-expr/index.d.ts +2 -0
  64. package/dist/lib/logic-expr/logic-expr.d.ts +2 -0
  65. package/dist/lib/logic-expr/logic-not.d.ts +10 -0
  66. package/dist/lib/logic-expr/logic-toggle.d.ts +12 -0
  67. package/dist/lib/logic-expr/types.d.ts +79 -0
  68. package/dist/lib/loop-icons/index.d.ts +1 -0
  69. package/dist/lib/loop-radio-group/index.d.ts +2 -0
  70. package/dist/lib/multi-part-editor/components/image-item-renderer.d.ts +14 -0
  71. package/dist/lib/multi-part-editor/components/multipart-item-renderer.d.ts +10 -0
  72. package/dist/lib/multi-part-editor/components/url-input-modal.d.ts +14 -0
  73. package/dist/lib/multi-part-editor/components/video-item-renderer.d.ts +14 -0
  74. package/dist/lib/multi-part-editor/index.d.ts +3 -0
  75. package/dist/lib/multi-part-editor/multi-part-render.d.ts +10 -0
  76. package/dist/lib/multi-part-editor/type.d.ts +81 -0
  77. package/dist/lib/multi-part-editor/upload-button.d.ts +23 -0
  78. package/dist/lib/multi-part-editor/utils.d.ts +16 -0
  79. package/dist/lib/open-detail-button/index.d.ts +6 -0
  80. package/dist/lib/page-content/index.d.ts +20 -0
  81. package/dist/lib/primary-page/index.d.ts +1 -0
  82. package/dist/lib/primary-page/primary-header.d.ts +14 -0
  83. package/dist/lib/primary-title/index.d.ts +6 -0
  84. package/dist/lib/resizable-side-sheet/index.d.ts +10 -0
  85. package/dist/{types → lib}/resize-sidesheet/index.d.ts +4 -3
  86. package/dist/lib/resize-sidesheet/use-drag.d.ts +11 -0
  87. package/dist/lib/schema-editor/index.d.ts +11 -0
  88. package/dist/lib/semi-schema-form/components/tmpls/array-field-item.d.ts +6 -0
  89. package/dist/lib/semi-schema-form/components/tmpls/array-field.d.ts +6 -0
  90. package/dist/lib/semi-schema-form/components/tmpls/base-input.d.ts +8 -0
  91. package/dist/lib/semi-schema-form/components/tmpls/description-field.d.ts +6 -0
  92. package/dist/lib/semi-schema-form/components/tmpls/error-list.d.ts +6 -0
  93. package/dist/lib/semi-schema-form/components/tmpls/field-error.d.ts +6 -0
  94. package/dist/lib/semi-schema-form/components/tmpls/field.d.ts +7 -0
  95. package/dist/lib/semi-schema-form/components/tmpls/icon-button.d.ts +11 -0
  96. package/dist/lib/semi-schema-form/components/tmpls/index.d.ts +2 -0
  97. package/dist/lib/semi-schema-form/components/tmpls/object-field.d.ts +8 -0
  98. package/dist/lib/semi-schema-form/components/tmpls/submit.d.ts +4 -0
  99. package/dist/lib/semi-schema-form/components/tmpls/title-field.d.ts +6 -0
  100. package/dist/lib/semi-schema-form/components/widgets/checkbox.d.ts +7 -0
  101. package/dist/lib/semi-schema-form/components/widgets/checkboxs.d.ts +7 -0
  102. package/dist/lib/semi-schema-form/components/widgets/index.d.ts +2 -0
  103. package/dist/lib/semi-schema-form/components/widgets/radio.d.ts +7 -0
  104. package/dist/lib/semi-schema-form/components/widgets/range.d.ts +7 -0
  105. package/dist/lib/semi-schema-form/components/widgets/select.d.ts +7 -0
  106. package/dist/lib/semi-schema-form/components/widgets/textarea.d.ts +6 -0
  107. package/dist/lib/semi-schema-form/index.d.ts +4 -0
  108. package/dist/lib/sentinel-form/enum.d.ts +8 -0
  109. package/dist/lib/sentinel-form/index.d.ts +20 -0
  110. package/dist/lib/step-nav/index.d.ts +12 -0
  111. package/dist/{types → lib}/table/index.d.ts +1 -1
  112. package/dist/lib/table/sort-icon.d.ts +8 -0
  113. package/dist/lib/table/table-with-pagination.d.ts +21 -0
  114. package/dist/lib/table/table-without-pagniation.d.ts +6 -0
  115. package/dist/lib/table-batch-operate/table-batch-operation.d.ts +9 -0
  116. package/dist/lib/table-batch-operate/use-batch-operate.d.ts +30 -0
  117. package/dist/lib/table-col-actions/index.d.ts +24 -0
  118. package/dist/lib/table-cols-config/index.d.ts +11 -0
  119. package/dist/lib/table-cols-config/type.d.ts +6 -0
  120. package/dist/lib/table-cols-config/use-hidden-col-keys.d.ts +5 -0
  121. package/dist/lib/table-cols-config/util.d.ts +3 -0
  122. package/dist/lib/table-empty/index.d.ts +2 -0
  123. package/dist/lib/table-header/index.d.ts +14 -0
  124. package/dist/{types → lib}/tabs/index.d.ts +1 -1
  125. package/dist/lib/text-area-pro/index.d.ts +6 -0
  126. package/dist/lib/text-with-copy/index.d.ts +14 -0
  127. package/dist/lib/title-with-sub/index.d.ts +7 -0
  128. package/dist/lib/tooltip-when-disabled/index.d.ts +6 -0
  129. package/dist/lib/tooltip-with-disabled/index.d.ts +5 -0
  130. package/dist/lib/upload/index.d.ts +9 -0
  131. package/dist/lib/user-profile/index.d.ts +9 -0
  132. package/dist/lib/utils/basic.d.ts +2 -0
  133. package/dist/lib/version-list/version-descriptions.d.ts +15 -0
  134. package/dist/lib/version-list/version-item.d.ts +9 -0
  135. package/dist/lib/version-list/version-list.d.ts +11 -0
  136. package/dist/lib/version-list/version-switch-panel.d.ts +5 -0
  137. package/package.json +47 -35
  138. package/dist/es/collapsible-card/index.js +0 -45
  139. package/dist/es/collapsible-card/index.module.js +0 -5
  140. package/dist/es/collapsible-card/index_module.css +0 -48
  141. package/dist/es/column-manage-storage/index.js +0 -73
  142. package/dist/es/columns-select/index.js +0 -219
  143. package/dist/es/hooks/use-infinite-scroll.js +0 -178
  144. package/dist/es/hooks/use-mouse-down-offset.js +0 -41
  145. package/dist/es/id-render/icon-button-container.js +0 -61
  146. package/dist/es/id-render/index.js +0 -78
  147. package/dist/es/index.js +0 -66
  148. package/dist/es/infinite-scroll-table/index.js +0 -98
  149. package/dist/es/input-slider/index.js +0 -123
  150. package/dist/es/input-slider/index.module.js +0 -5
  151. package/dist/es/input-slider/index_module.css +0 -21
  152. package/dist/es/large-txt-render/index.js +0 -38
  153. package/dist/es/page-content/index.js +0 -108
  154. package/dist/es/primary-page/index.js +0 -4
  155. package/dist/es/primary-page/primary-header.js +0 -38
  156. package/dist/es/resize-sidesheet/index.js +0 -100
  157. package/dist/es/resize-sidesheet/index.module.js +0 -5
  158. package/dist/es/resize-sidesheet/index_module.css +0 -9
  159. package/dist/es/resize-sidesheet/use-drag.js +0 -31
  160. package/dist/es/table/index.js +0 -56
  161. package/dist/es/table/index.module.js +0 -5
  162. package/dist/es/table/index_module.css +0 -90
  163. package/dist/es/table/sort-icon.js +0 -105
  164. package/dist/es/table/table-with-pagination.js +0 -112
  165. package/dist/es/table/table-without-pagniation.js +0 -74
  166. package/dist/es/table-col-actions/index.js +0 -103
  167. package/dist/es/table-header/index.js +0 -68
  168. package/dist/es/table-header/index.module.js +0 -5
  169. package/dist/es/table-header/index_module.css +0 -3
  170. package/dist/es/tabs/index.js +0 -42
  171. package/dist/es/tabs/index.module.js +0 -5
  172. package/dist/es/tabs/index_module.css +0 -37
  173. package/dist/es/text-with-copy/index.js +0 -71
  174. package/dist/es/tooltip-with-disabled/index.js +0 -49
  175. package/dist/es/utils/basic.js +0 -44
  176. package/dist/es/utils/rect.js +0 -37
  177. package/dist/lib/collapsible-card/index.js +0 -79
  178. package/dist/lib/collapsible-card/index.module.js +0 -25
  179. package/dist/lib/collapsible-card/index_module.css +0 -48
  180. package/dist/lib/column-manage-storage/index.js +0 -98
  181. package/dist/lib/columns-select/index.js +0 -241
  182. package/dist/lib/hooks/use-infinite-scroll.js +0 -195
  183. package/dist/lib/hooks/use-mouse-down-offset.js +0 -65
  184. package/dist/lib/id-render/icon-button-container.js +0 -89
  185. package/dist/lib/id-render/index.js +0 -112
  186. package/dist/lib/index.js +0 -110
  187. package/dist/lib/infinite-scroll-table/index.js +0 -126
  188. package/dist/lib/input-slider/index.js +0 -154
  189. package/dist/lib/input-slider/index.module.js +0 -25
  190. package/dist/lib/input-slider/index_module.css +0 -21
  191. package/dist/lib/large-txt-render/index.js +0 -62
  192. package/dist/lib/page-content/index.js +0 -136
  193. package/dist/lib/primary-page/index.js +0 -28
  194. package/dist/lib/primary-page/primary-header.js +0 -72
  195. package/dist/lib/resize-sidesheet/index.js +0 -129
  196. package/dist/lib/resize-sidesheet/index.module.js +0 -25
  197. package/dist/lib/resize-sidesheet/index_module.css +0 -9
  198. package/dist/lib/resize-sidesheet/use-drag.js +0 -55
  199. package/dist/lib/table/index.js +0 -88
  200. package/dist/lib/table/index.module.js +0 -25
  201. package/dist/lib/table/index_module.css +0 -90
  202. package/dist/lib/table/sort-icon.js +0 -137
  203. package/dist/lib/table/table-with-pagination.js +0 -146
  204. package/dist/lib/table/table-without-pagniation.js +0 -108
  205. package/dist/lib/table-col-actions/index.js +0 -123
  206. package/dist/lib/table-header/index.js +0 -96
  207. package/dist/lib/table-header/index.module.js +0 -25
  208. package/dist/lib/table-header/index_module.css +0 -3
  209. package/dist/lib/tabs/index.js +0 -74
  210. package/dist/lib/tabs/index.module.js +0 -25
  211. package/dist/lib/tabs/index_module.css +0 -37
  212. package/dist/lib/text-with-copy/index.js +0 -105
  213. package/dist/lib/tooltip-with-disabled/index.js +0 -71
  214. package/dist/lib/utils/basic.js +0 -78
  215. package/dist/lib/utils/rect.js +0 -65
  216. package/dist/types/collapsible-card/index.d.ts +0 -22
  217. package/dist/types/columns-select/index.d.ts +0 -29
  218. package/dist/types/hooks/use-mouse-down-offset.d.ts +0 -9
  219. package/dist/types/id-render/icon-button-container.d.ts +0 -12
  220. package/dist/types/id-render/index.d.ts +0 -13
  221. package/dist/types/index.d.ts +0 -19
  222. package/dist/types/input-slider/index.d.ts +0 -14
  223. package/dist/types/page-content/index.d.ts +0 -36
  224. package/dist/types/primary-page/index.d.ts +0 -1
  225. package/dist/types/primary-page/primary-header.d.ts +0 -17
  226. package/dist/types/resize-sidesheet/use-drag.d.ts +0 -10
  227. package/dist/types/table/sort-icon.d.ts +0 -13
  228. package/dist/types/table/table-with-pagination.d.ts +0 -14
  229. package/dist/types/table/table-without-pagniation.d.ts +0 -8
  230. package/dist/types/table-col-actions/index.d.ts +0 -21
  231. package/dist/types/table-header/index.d.ts +0 -20
  232. package/dist/types/text-with-copy/index.d.ts +0 -24
  233. package/dist/types/tooltip-with-disabled/index.d.ts +0 -9
  234. package/dist/types/utils/basic.d.ts +0 -1
  235. package/dist/types/utils/rect.d.ts +0 -10
@@ -0,0 +1,14 @@
1
+ export interface RadioButtonProps<T extends string | number> {
2
+ value?: T;
3
+ onChange?: (value: T) => void;
4
+ disabled?: boolean;
5
+ options: Array<{
6
+ value: T;
7
+ label: React.ReactNode;
8
+ disabled?: boolean;
9
+ tooltip?: string;
10
+ }>;
11
+ className?: string;
12
+ }
13
+ /** coze design 的 SegmentTab 和 Radio 的 advanced + pureCard 模式均有样式问题,不得不自行造轮子 */
14
+ export declare function RadioButton<T extends string | number>({ value, onChange, options, disabled, className, }: RadioButtonProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { type SliderProps } from '@coze-arch/coze-design';
2
+ interface InputSliderProps {
3
+ value?: number;
4
+ onChange?: (v: number) => void;
5
+ max?: number;
6
+ min?: number;
7
+ step?: number;
8
+ disabled?: boolean;
9
+ decimalPlaces?: number;
10
+ marks?: SliderProps['marks'];
11
+ className?: string;
12
+ }
13
+ export declare const formateDecimalPlacesString: (value: string | number, prevValue?: number, decimalPlaces?: number) => string;
14
+ export declare const InputSlider: React.FC<InputSliderProps>;
15
+ export {};
@@ -0,0 +1,2 @@
1
+ import { type InputProps } from '@coze-arch/coze-design';
2
+ export declare function InputWithCount(props: InputProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare function JumpIconButton(props: {
2
+ className?: string;
3
+ style?: React.CSSProperties;
4
+ } & React.DOMAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  export interface LargeTxtRenderProps {
2
- text: string;
2
+ text: string;
3
3
  }
4
- export declare const LargeTxtRender: (props: LargeTxtRenderProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const LargeTxtRender: (props: LargeTxtRenderProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import React, { type CSSProperties, type ReactNode } from 'react';
2
+ export declare const Content: React.ForwardRefExoticComponent<{
3
+ children?: ReactNode;
4
+ style?: CSSProperties;
5
+ className?: string;
6
+ top?: ReactNode;
7
+ } & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,7 @@
1
+ import { type ReactNode } from 'react';
2
+ interface Props {
3
+ children?: ReactNode;
4
+ className?: string;
5
+ }
6
+ export declare function Header({ children, className }: Props): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,12 @@
1
+ import { Tabs } from './tabs';
2
+ import { Header } from './header';
3
+ export declare const Layout: {
4
+ Header: typeof Header;
5
+ Content: import("react").ForwardRefExoticComponent<{
6
+ children?: import("react").ReactNode;
7
+ style?: import("react").CSSProperties;
8
+ className?: string;
9
+ top?: import("react").ReactNode;
10
+ } & import("react").RefAttributes<HTMLDivElement>>;
11
+ Tabs: typeof Tabs;
12
+ };
@@ -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,5 @@
1
+ import React from 'react';
2
+ export declare const LazyLoadComponent: ({ children, placeholder, }: {
3
+ children: React.ReactNode;
4
+ placeholder?: React.ReactNode;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export { LogicEditor } from './logic-editor';
2
+ export type { LogicDataType, LogicField, LogicFilter } from './logic-types';
3
+ export { baseOperations, type LogicSetter } from './logic-types';
@@ -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 LogicField } from './logic-types';
2
+ export declare function findFieldByPath(fields: LogicField[], fieldPaths: string | string[]): LogicField | undefined;
@@ -0,0 +1,2 @@
1
+ import { type OptionProps } from '@coze-arch/coze-design';
2
+ export declare const LOGIC_OPTIONS: OptionProps[];
@@ -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,2 @@
1
+ export { LogicExpr } from './logic-expr';
2
+ export type { Expr, ExprGroup, LogicOperator, LogicExprProps, ExprRenderProps, ExprGroupRenderProps, LeftRenderProps, OperatorRenderProps, RightRenderProps, OperatorOption, } from './types';
@@ -0,0 +1,2 @@
1
+ import type { LogicExprProps } from './types';
2
+ export declare function LogicExpr<L = string, O = string, R = string>({ defaultExpr, value, onChange: _onChange, ...restProps }: LogicExprProps<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,2 @@
1
+ import { type RadioGroupProps } from '@coze-arch/coze-design';
2
+ export declare function LoopRadioGroup({ className, ...props }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
@@ -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,3 @@
1
+ import React from 'react';
2
+ import { type MultipartEditorProps } from './type';
3
+ export declare const MultipartEditor: React.FC<MultipartEditorProps>;
@@ -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,6 @@
1
+ interface Props {
2
+ url: string;
3
+ className?: string;
4
+ }
5
+ export declare function OpenDetailButton({ url, className }: Props): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -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,14 @@
1
+ import type { ReactNode } from 'react';
2
+ interface PrimaryPageHeaderProps {
3
+ pageTitle?: ReactNode;
4
+ renderCustomHeader?: ReactNode;
5
+ filterSlot?: ReactNode;
6
+ children?: ReactNode;
7
+ headerClassName?: string;
8
+ titleClassName?: string;
9
+ contentClassName?: string;
10
+ className?: string;
11
+ titleSlot?: ReactNode;
12
+ }
13
+ export declare const PrimaryPage: ({ pageTitle, renderCustomHeader, filterSlot, children, contentClassName, className, headerClassName, titleClassName, titleSlot, ...restProps }: PrimaryPageHeaderProps) => import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -0,0 +1,6 @@
1
+ interface PrimaryTitleProps {
2
+ title: string;
3
+ className?: string;
4
+ }
5
+ export declare function PrimaryTitle({ title, className }: PrimaryTitleProps): import("react/jsx-runtime").JSX.Element;
6
+ 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 {};
@@ -1,6 +1,7 @@
1
1
  import { type SideSheetReactProps } from '@coze-arch/coze-design';
2
2
  import { type DragOptions } from './use-drag';
3
3
  export declare const ResizeSidesheet: (props: SideSheetReactProps & {
4
- dragOptions?: DragOptions;
5
- showDivider?: boolean;
6
- }) => import("react/jsx-runtime").JSX.Element;
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;