@cozeloop/components 0.0.12-beta-1770794836582 → 0.0.12-beta-1772259372242
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/dist/es/index.css +2 -2
- package/dist/es/index.mjs +361 -33
- package/dist/es/loopIcons.mjs +0 -1
- package/dist/es/static/svg/audio-icon.svg +6 -0
- package/dist/es/static/svg/video-icon.svg +6 -0
- package/dist/lib/id-render/icon-button-container.d.ts +2 -2
- package/dist/lib/index.d.ts +3 -1
- package/dist/lib/link-button/index.d.ts +13 -0
- package/dist/lib/multi-modal-dataset-item-render/audio-render/index.d.ts +35 -0
- package/dist/lib/multi-modal-dataset-item-render/index.d.ts +2 -0
- package/dist/lib/multi-modal-dataset-item-render/video-render/index.d.ts +35 -0
- package/dist/lib/primary-page/primary-header.d.ts +1 -2
- package/dist/lib/provider/index.d.ts +19 -0
- package/package.json +3 -4
- package/dist/es/rslib-runtime.mjs +0 -40
package/dist/es/index.css
CHANGED
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
height: 42px;
|
|
33
33
|
color: var(--coz-fg-plus);
|
|
34
34
|
background: var(--coz-bg, #f0f0f7);
|
|
35
|
-
background-color: var(--coz-bg, #f0f0f7);
|
|
36
35
|
border-bottom: 1px solid var(--line-color-border-2, #eaedf1);
|
|
37
36
|
padding: 5px 20px;
|
|
38
37
|
font-size: 13px;
|
|
39
38
|
font-weight: 500;
|
|
40
39
|
line-height: 20px;
|
|
40
|
+
background-color: var(--coz-bg, #f0f0f7) !important;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
#loop-table-ZtuuXn .semi-table-row-head:before {
|
|
44
|
-
background-color: var(--coz-bg, #f0f0f7);
|
|
44
|
+
background-color: var(--coz-bg, #f0f0f7) !important;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
#loop-table-ZtuuXn .semi-table-row {
|
package/dist/es/index.mjs
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
2
|
import "./static/svg/select.svg";
|
|
3
|
-
import
|
|
3
|
+
import __rslib_svgr_url__1__ from "./static/svg/audio-icon.svg";
|
|
4
|
+
import __rslib_svgr_url__2__ from "./static/svg/video-icon.svg";
|
|
4
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { arrayMove, sortableContainer as external_react_sortable_hoc_sortableContainer, sortableElement, sortableHandle } from "react-sortable-hoc";
|
|
6
|
-
import react, { Fragment as external_react_Fragment, forwardRef, isValidElement, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
7
|
-
import { I18n as i18n_I18n } from "@cozeloop/i18n";
|
|
8
|
-
import { IconCozArrowDown, IconCozArrowLeft, IconCozArrowRight, IconCozCheckMarkCircleFill, IconCozCheckMarkFill, IconCozContent, IconCozCopy, IconCozCross, IconCozCrossCircleFill, IconCozCrossFill, IconCozEye, IconCozFilter, IconCozHandle, IconCozImage, IconCozImageArrowUp, IconCozImageBroken, IconCozInfoCircle, IconCozLongArrowTopRight, IconCozLongArrowUp, IconCozMore, IconCozPencil, IconCozPlayCircle, IconCozPlus, IconCozPlusCircle, IconCozQuestionMarkCircle, IconCozRefresh, IconCozSetting, IconCozTableSetting, IconCozTrashCan, IconCozVideo, IconCozWarningCircle } from "@coze-arch/coze-design/icons";
|
|
9
|
-
import { Banner, Button, ButtonGroup, Cascader, Checkbox, Col, Collapse, CozAvatar, CozInputNumber, CozPagination, DatePicker, Descriptions, Divider, Dropdown, Empty, EmptyState, Form, IconButton, Image, ImagePreview, Input, List, Loading, Menu, Modal, Popover, Radio, RadioGroup, Row, Select, SideSheet, Skeleton, Slider, Space, Spin, Switch, Table, Tabs, Tag, TextArea, Toast, Tooltip, Typography, Upload, withField } from "@coze-arch/coze-design";
|
|
7
|
+
import react, { Fragment as external_react_Fragment, createContext, forwardRef, isValidElement, useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
8
|
+
import { I18n as i18n_I18n, initIntl } from "@cozeloop/i18n";
|
|
9
|
+
import { IconCozArrowDown, IconCozArrowLeft, IconCozArrowRight, IconCozCheckMarkCircleFill, IconCozCheckMarkFill, IconCozContent, IconCozCopy, IconCozCross, IconCozCrossCircleFill, IconCozCrossCircleFillPalette, IconCozCrossFill, IconCozDownload, IconCozEye, IconCozFilter, IconCozHandle, IconCozImage, IconCozImageArrowUp, IconCozImageBroken, IconCozInfoCircle, IconCozLongArrowTopRight, IconCozLongArrowUp, IconCozMore, IconCozPencil, IconCozPlayCircle, IconCozPlus, IconCozPlusCircle, IconCozQuestionMarkCircle, IconCozRefresh, IconCozSetting, IconCozTableSetting, IconCozTrashCan, IconCozVideo, IconCozWarningCircle } from "@coze-arch/coze-design/icons";
|
|
10
|
+
import { AudioPlayer, Banner, Button, ButtonGroup, Cascader, Checkbox, Col, Collapse, CozAvatar, CozInputNumber, CozPagination, DatePicker, Descriptions, Divider, Dropdown, Empty, EmptyState, Form, IconButton, Image, ImagePreview, Input, List, Loading, LoadingButton, Menu, Modal, Popover, Radio, RadioGroup, Row, Select, SideSheet, Skeleton, Slider, Space, Spin, Switch, Table, Tabs, Tag, TextArea, Toast, Tooltip, Typography, Upload, VideoPlayer, withField } from "@coze-arch/coze-design";
|
|
10
11
|
import classnames from "classnames";
|
|
11
12
|
import { IconCozIllus404, IconCozIllus404Dark, IconCozIllusEmpty, IconCozIllusEmptyDark, IconCozIllusError, IconCozIllusErrorDark, IconCozIllusLock, IconCozIllusLockDark, IconCozIllusNone, IconCozIllusNoneDark } from "@coze-arch/coze-design/illustrations";
|
|
12
13
|
import { useDebounceFn, useInfiniteScroll, useLatest, useMemoizedFn, useRequest, useSize } from "ahooks";
|
|
13
|
-
import { cloneDeep, debounce, get, isEmpty as external_lodash_es_isEmpty, isInteger, isNull, isNumber, isObject, isString, isUndefined, set } from "lodash-es";
|
|
14
|
+
import { cloneDeep, debounce, get, isEmpty as external_lodash_es_isEmpty, isFunction, isInteger, isNull, isNumber, isObject, isString, isUndefined, set } from "lodash-es";
|
|
14
15
|
import copy_to_clipboard from "copy-to-clipboard";
|
|
15
|
-
import { formatTimestampToString, safeJsonParse, sleep as toolkit_sleep } from "@cozeloop/toolkit";
|
|
16
|
+
import { fileDownload, formatTimestampToString, safeJsonParse, sleep as toolkit_sleep } from "@cozeloop/toolkit";
|
|
16
17
|
import _monaco_editor_react, { DiffEditor, loader } from "@monaco-editor/react";
|
|
17
18
|
import sortablejs from "sortablejs";
|
|
18
19
|
import { nanoid } from "nanoid";
|
|
@@ -20,11 +21,10 @@ import { ContentType } from "@cozeloop/api-schema/evaluation";
|
|
|
20
21
|
import { ItemErrorType, StorageProvider } from "@cozeloop/api-schema/data";
|
|
21
22
|
import { ContentType as prompt_ContentType } from "@cozeloop/api-schema/prompt";
|
|
22
23
|
import { withTheme } from "@rjsf/core";
|
|
23
|
-
import
|
|
24
|
+
import validator_ajv8 from "@rjsf/validator-ajv8";
|
|
24
25
|
import { TranslatableString, ariaDescribedByIds, canExpand, enumOptionsIndexForValue, enumOptionsValueForIndex, errorId, examplesId, getInputProps, getSubmitButtonOptions, getTemplate, getUiOptions, optionId, rangeSpec } from "@rjsf/utils";
|
|
25
26
|
import { useMouseDownOffset as hooks_useMouseDownOffset } from "@cozeloop/hooks";
|
|
26
27
|
import dayjs from "dayjs";
|
|
27
|
-
import { useReportEvent } from "@cozeloop/config-provider";
|
|
28
28
|
import { EditorProvider, createRenderer, option as react_option } from "@coze-editor/editor/react";
|
|
29
29
|
import preset_code, { createTheme, languages, tags, themes, transformerCreator } from "@coze-editor/editor/preset-code";
|
|
30
30
|
import { typescript } from "@coze-editor/editor/language-typescript";
|
|
@@ -35,6 +35,29 @@ import { mixLanguages } from "@coze-editor/editor";
|
|
|
35
35
|
import { EditorView, keymap } from "@codemirror/view";
|
|
36
36
|
import { goLanguage } from "@codemirror/lang-go";
|
|
37
37
|
import preset_universal from "@coze-editor/editor/preset-universal";
|
|
38
|
+
import { defaultKeymap, history as commands_history, historyKeymap } from "@codemirror/commands";
|
|
39
|
+
var __webpack_require__ = {};
|
|
40
|
+
(()=>{
|
|
41
|
+
__webpack_require__.d = (exports, definition)=>{
|
|
42
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: definition[key]
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
})();
|
|
48
|
+
(()=>{
|
|
49
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
50
|
+
})();
|
|
51
|
+
(()=>{
|
|
52
|
+
__webpack_require__.r = (exports)=>{
|
|
53
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
|
|
54
|
+
value: 'Module'
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(exports, '__esModule', {
|
|
57
|
+
value: true
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
})();
|
|
38
61
|
var external_react_sortable_hoc_namespaceObject = {};
|
|
39
62
|
__webpack_require__.r(external_react_sortable_hoc_namespaceObject);
|
|
40
63
|
__webpack_require__.d(external_react_sortable_hoc_namespaceObject, {
|
|
@@ -252,15 +275,14 @@ const LoopTable = ({ className, ...props })=>/*#__PURE__*/ jsx(Table, {
|
|
|
252
275
|
...props,
|
|
253
276
|
id: index_module["loop-table"]
|
|
254
277
|
});
|
|
255
|
-
|
|
256
|
-
|
|
278
|
+
const IconButtonContainer = /*#__PURE__*/ forwardRef(({ icon, className, style, onClick, active, disabled, ...rest }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
279
|
+
ref: ref,
|
|
257
280
|
...rest,
|
|
258
281
|
onClick: onClick,
|
|
259
282
|
style: style,
|
|
260
283
|
className: classnames('inline-flex items-center justify-center shrink-0 w-5 h-5 rounded-[4px] text-sm text-[var(--coz-fg-secondary)] ', active && !disabled ? 'bg-[var(--coz-mg-plus)]' : '', disabled ? 'cursor-not-allowed' : 'cursor-pointer hover:text-[var(--coz-fg-primary)] hover:bg-[var(--coz-mg-plus)]', className),
|
|
261
284
|
children: icon
|
|
262
|
-
});
|
|
263
|
-
}
|
|
285
|
+
}));
|
|
264
286
|
const activeColor = 'rgb(var(--coze-up-brand-9))';
|
|
265
287
|
const unActiveColor = 'var(--coz-fg-dim)';
|
|
266
288
|
const IconSortArrow = ({ sortOrder, ...rest })=>{
|
|
@@ -801,7 +823,8 @@ function VersionDescriptions({ version, className }) {
|
|
|
801
823
|
className: "!text-[13px]",
|
|
802
824
|
children: /*#__PURE__*/ jsx(UserProfile, {
|
|
803
825
|
name: submitter?.name,
|
|
804
|
-
avatarUrl: submitter?.avatar_url
|
|
826
|
+
avatarUrl: submitter?.avatar_url,
|
|
827
|
+
userNameClassName: "!max-w-[130px]"
|
|
805
828
|
})
|
|
806
829
|
}),
|
|
807
830
|
isDraft ? null : /*#__PURE__*/ jsx(Descriptions.Item, {
|
|
@@ -831,7 +854,7 @@ function VersionItem({ version, active, className, onClick }) {
|
|
|
831
854
|
})
|
|
832
855
|
}),
|
|
833
856
|
/*#__PURE__*/ jsx("div", {
|
|
834
|
-
className: `grow px-2 pt-2 rounded-m ${active ? 'bg-gray-100' : ''} group-hover:bg-gray-100`,
|
|
857
|
+
className: `grow min-w-0 overflow-hidden px-2 pt-2 rounded-m ${active ? 'bg-gray-100' : ''} group-hover:bg-gray-100`,
|
|
835
858
|
children: /*#__PURE__*/ jsx(VersionDescriptions, {
|
|
836
859
|
version: version
|
|
837
860
|
})
|
|
@@ -1053,11 +1076,11 @@ const dealColumnsWithStorage = (storageKey, columns)=>{
|
|
|
1053
1076
|
checked: sort[column.key]?.checked ?? true
|
|
1054
1077
|
}));
|
|
1055
1078
|
};
|
|
1056
|
-
const PrimaryPage = ({ pageTitle,
|
|
1079
|
+
const PrimaryPage = ({ pageTitle, filterSlot, children, contentClassName, className, headerClassName, titleClassName, titleSlot, ...restProps })=>/*#__PURE__*/ jsxs("div", {
|
|
1057
1080
|
className: classnames('pt-2 pb-3 h-full max-h-full flex flex-col', className),
|
|
1058
1081
|
...restProps,
|
|
1059
1082
|
children: [
|
|
1060
|
-
|
|
1083
|
+
pageTitle || titleSlot ? /*#__PURE__*/ jsxs("div", {
|
|
1061
1084
|
className: classnames('flex items-center justify-between py-4 px-6', headerClassName),
|
|
1062
1085
|
children: [
|
|
1063
1086
|
/*#__PURE__*/ jsx("div", {
|
|
@@ -1957,6 +1980,28 @@ function OpenDetailButton({ url, className }) {
|
|
|
1957
1980
|
})
|
|
1958
1981
|
});
|
|
1959
1982
|
}
|
|
1983
|
+
function LinkButton({ tooltip, onClick, onAsyncClick, link = true, children, className }) {
|
|
1984
|
+
const [loading, setLoading] = useState(false);
|
|
1985
|
+
return /*#__PURE__*/ jsx(Tooltip, {
|
|
1986
|
+
trigger: tooltip ? 'hover' : 'custom',
|
|
1987
|
+
content: tooltip,
|
|
1988
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
1989
|
+
className: className,
|
|
1990
|
+
children: /*#__PURE__*/ jsx(Typography.Text, {
|
|
1991
|
+
link: link,
|
|
1992
|
+
onClick: ()=>{
|
|
1993
|
+
if (!isFunction(onAsyncClick)) onClick?.();
|
|
1994
|
+
if (loading) return;
|
|
1995
|
+
setLoading(true);
|
|
1996
|
+
onAsyncClick?.().finally(()=>{
|
|
1997
|
+
setLoading(false);
|
|
1998
|
+
});
|
|
1999
|
+
},
|
|
2000
|
+
children: children
|
|
2001
|
+
})
|
|
2002
|
+
})
|
|
2003
|
+
}, tooltip);
|
|
2004
|
+
}
|
|
1960
2005
|
function EditIconButton({ disabled, className, onClick, ...rest }) {
|
|
1961
2006
|
return /*#__PURE__*/ jsx(IconCozPencil, {
|
|
1962
2007
|
...rest,
|
|
@@ -4473,6 +4518,40 @@ function TitleWithSub({ title, subTitle, className }) {
|
|
|
4473
4518
|
]
|
|
4474
4519
|
});
|
|
4475
4520
|
}
|
|
4521
|
+
const CozeLoopContext = /*#__PURE__*/ createContext({});
|
|
4522
|
+
function CozeLoopProvider({ children, defaultLanguage, resources, sendEvent }) {
|
|
4523
|
+
const isInitialized = useRef(false);
|
|
4524
|
+
const [initialized, setInitialized] = useState(false);
|
|
4525
|
+
useEffect(()=>{
|
|
4526
|
+
if (resources && !isInitialized.current) initIntl({
|
|
4527
|
+
lng: defaultLanguage,
|
|
4528
|
+
resources
|
|
4529
|
+
}).then(()=>{
|
|
4530
|
+
isInitialized.current = true;
|
|
4531
|
+
setInitialized(true);
|
|
4532
|
+
}).catch((error)=>{
|
|
4533
|
+
console.error('Error initializing intl:', error);
|
|
4534
|
+
isInitialized.current = true;
|
|
4535
|
+
setInitialized(true);
|
|
4536
|
+
});
|
|
4537
|
+
}, [
|
|
4538
|
+
resources,
|
|
4539
|
+
defaultLanguage
|
|
4540
|
+
]);
|
|
4541
|
+
if (!initialized) return /*#__PURE__*/ jsx(PageLoading, {});
|
|
4542
|
+
return /*#__PURE__*/ jsx(CozeLoopContext.Provider, {
|
|
4543
|
+
value: {
|
|
4544
|
+
sendEvent
|
|
4545
|
+
},
|
|
4546
|
+
children: children
|
|
4547
|
+
});
|
|
4548
|
+
}
|
|
4549
|
+
function useReportEvent() {
|
|
4550
|
+
const context = useContext(CozeLoopContext);
|
|
4551
|
+
return context.sendEvent ?? ((name, params)=>{
|
|
4552
|
+
console.info(name, params);
|
|
4553
|
+
});
|
|
4554
|
+
}
|
|
4476
4555
|
function FooterActions({ confirmBtnProps: { text: confirmBtnText, ...confirmBtnProps } = {}, cancelBtnProps: { text: cancelBtnText, ...cancelBtnProps } = {} }) {
|
|
4477
4556
|
return /*#__PURE__*/ jsxs("div", {
|
|
4478
4557
|
className: "flex justify-end",
|
|
@@ -5113,6 +5192,15 @@ const ResizableSideSheet = (props)=>{
|
|
|
5113
5192
|
]
|
|
5114
5193
|
});
|
|
5115
5194
|
};
|
|
5195
|
+
var enum_EventNames = /*#__PURE__*/ function(EventNames) {
|
|
5196
|
+
EventNames["INIT_LOOP_FORM"] = "init_loop_form";
|
|
5197
|
+
EventNames["LOOP_FORM_FIELD_VALIDATE_ERROR"] = "loop_form_field_validate_error";
|
|
5198
|
+
EventNames["LOOP_FORM_SUBMIT_INTERFACE_ERROR"] = "loop_form_submit_interface_error";
|
|
5199
|
+
EventNames["LOOP_FORM_SUBMIT_SUCCESS"] = "loop_form_submit_success";
|
|
5200
|
+
EventNames["LOOP_FORM_FIELD_CHANGE_TIMELINE"] = "loop_form_field_change_timeline";
|
|
5201
|
+
EventNames["LOOP_FORM_CLOSE"] = "loop_form_close";
|
|
5202
|
+
return EventNames;
|
|
5203
|
+
}({});
|
|
5116
5204
|
function safeStringify(obj) {
|
|
5117
5205
|
return JSON.stringify(obj, (_, value)=>{
|
|
5118
5206
|
if (/*#__PURE__*/ isValidElement(value)) return '[ReactElement]';
|
|
@@ -5138,7 +5226,7 @@ const SentinelFormInner = ({ formID, children, onValueChange, onSubmit, getFormA
|
|
|
5138
5226
|
validateErrorCount.current = validateErrorCount.current + 1;
|
|
5139
5227
|
const validateErrorTime = Date.now();
|
|
5140
5228
|
const errorKeys = Object.keys(error) || [];
|
|
5141
|
-
sendEvent(
|
|
5229
|
+
sendEvent(enum_EventNames.LOOP_FORM_FIELD_VALIDATE_ERROR, {
|
|
5142
5230
|
form_id: formID,
|
|
5143
5231
|
session_id: sessionID,
|
|
5144
5232
|
form_item_error_count: errorKeys.length,
|
|
@@ -5152,7 +5240,7 @@ const SentinelFormInner = ({ formID, children, onValueChange, onSubmit, getFormA
|
|
|
5152
5240
|
if (isInterfaceError) {
|
|
5153
5241
|
firstValidateSuccess.current = false;
|
|
5154
5242
|
interfaceErrorCount.current = interfaceErrorCount.current + 1;
|
|
5155
|
-
sendEvent?.(
|
|
5243
|
+
sendEvent?.(enum_EventNames.LOOP_FORM_SUBMIT_INTERFACE_ERROR, {
|
|
5156
5244
|
form_id: formID,
|
|
5157
5245
|
session_id: sessionID,
|
|
5158
5246
|
form_interface_error_detail: JSON.stringify(error || {}),
|
|
@@ -5166,7 +5254,7 @@ const SentinelFormInner = ({ formID, children, onValueChange, onSubmit, getFormA
|
|
|
5166
5254
|
const formItemShow = Object.keys(values);
|
|
5167
5255
|
const formItemFilled = formItemShow.filter((key)=>values[key]);
|
|
5168
5256
|
const successTime = Date.now();
|
|
5169
|
-
sendEvent?.(
|
|
5257
|
+
sendEvent?.(enum_EventNames.LOOP_FORM_SUBMIT_SUCCESS, {
|
|
5170
5258
|
form_id: formID,
|
|
5171
5259
|
session_id: sessionID,
|
|
5172
5260
|
form_complete_consume_time: Date.now() - startTimeRef.current,
|
|
@@ -5274,7 +5362,7 @@ const SentinelFormInner = ({ formID, children, onValueChange, onSubmit, getFormA
|
|
|
5274
5362
|
};
|
|
5275
5363
|
const onFormClose = ()=>{
|
|
5276
5364
|
const closeTime = Date.now();
|
|
5277
|
-
sendEvent?.(
|
|
5365
|
+
sendEvent?.(enum_EventNames.LOOP_FORM_CLOSE, {
|
|
5278
5366
|
form_id: formIdRef.current,
|
|
5279
5367
|
session_id: sessionIdRef.current,
|
|
5280
5368
|
form_no_operation: noOperation.current,
|
|
@@ -5317,7 +5405,7 @@ const SentinelFormInner = ({ formID, children, onValueChange, onSubmit, getFormA
|
|
|
5317
5405
|
useEffect(()=>{
|
|
5318
5406
|
if (sessionID && formID) {
|
|
5319
5407
|
const initTime = Date.now();
|
|
5320
|
-
sendEvent?.(
|
|
5408
|
+
sendEvent?.(enum_EventNames.INIT_LOOP_FORM, {
|
|
5321
5409
|
form_id: formID,
|
|
5322
5410
|
session_id: sessionID,
|
|
5323
5411
|
time: initTime,
|
|
@@ -5328,7 +5416,7 @@ const SentinelFormInner = ({ formID, children, onValueChange, onSubmit, getFormA
|
|
|
5328
5416
|
if (formID && sessionID && !flushedRef.current) {
|
|
5329
5417
|
flushedRef.current = true;
|
|
5330
5418
|
try {
|
|
5331
|
-
sendEvent?.(
|
|
5419
|
+
sendEvent?.(enum_EventNames.LOOP_FORM_FIELD_CHANGE_TIMELINE, {
|
|
5332
5420
|
form_id: formID,
|
|
5333
5421
|
session_id: sessionID,
|
|
5334
5422
|
time_line: JSON.stringify(operationTimelineRef.current)
|
|
@@ -5352,7 +5440,7 @@ const SentinelFormInner = ({ formID, children, onValueChange, onSubmit, getFormA
|
|
|
5352
5440
|
if (!fid || !sid) return;
|
|
5353
5441
|
flushedRef.current = true;
|
|
5354
5442
|
try {
|
|
5355
|
-
sendEvent?.(
|
|
5443
|
+
sendEvent?.(enum_EventNames.LOOP_FORM_FIELD_CHANGE_TIMELINE, {
|
|
5356
5444
|
form_id: fid,
|
|
5357
5445
|
session_id: sid,
|
|
5358
5446
|
time_line: JSON.stringify(operationTimelineRef.current)
|
|
@@ -5839,7 +5927,7 @@ const CodeMirrorJsonEditor = /*#__PURE__*/ react.forwardRef((props, ref)=>{
|
|
|
5839
5927
|
theme: isDarkTheme ? 'coze-dark' : 'coze-light',
|
|
5840
5928
|
languageId: 'json',
|
|
5841
5929
|
editable: !readonly,
|
|
5842
|
-
transformer
|
|
5930
|
+
transformer,
|
|
5843
5931
|
minHeight,
|
|
5844
5932
|
maxHeight,
|
|
5845
5933
|
editorHeight,
|
|
@@ -6078,12 +6166,252 @@ const CollapseItem = ({ children, open: defaultOpen, title, className })=>{
|
|
|
6078
6166
|
]
|
|
6079
6167
|
});
|
|
6080
6168
|
};
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6169
|
+
const audio_icon = __rslib_svgr_url__1__;
|
|
6170
|
+
function AudioRender({ audioUrl, audioName, className, showDownload, deletion, upload, size = 'small' }) {
|
|
6171
|
+
const [modalVisible, setModalVisible] = useState(false);
|
|
6172
|
+
const iconSizeCls = 'small' === size ? 'text-[14px]' : 'text-[20px]';
|
|
6173
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
6174
|
+
className: "flex flex-col",
|
|
6175
|
+
onClick: (e)=>{
|
|
6176
|
+
e.stopPropagation();
|
|
6177
|
+
},
|
|
6178
|
+
children: [
|
|
6179
|
+
/*#__PURE__*/ jsxs("div", {
|
|
6180
|
+
className: classnames('inline-block relative group', 'small' === size ? 'w-[36px] h-[36px]' : 'w-[80px] h-[80px]', className),
|
|
6181
|
+
children: [
|
|
6182
|
+
upload?.status === 'error' ? /*#__PURE__*/ jsx("div", {
|
|
6183
|
+
className: classnames('w-full h-full flex items-center justify-center rounded-[6px] coz-mg-primary', 'border border-solid coz-stroke-hglt-red'),
|
|
6184
|
+
children: /*#__PURE__*/ jsx(IconCozImageBroken, {
|
|
6185
|
+
className: "text-[20px] coz-fg-dim"
|
|
6186
|
+
})
|
|
6187
|
+
}) : /*#__PURE__*/ jsx(Spin, {
|
|
6188
|
+
spinning: upload?.status === 'loading',
|
|
6189
|
+
wrapperClassName: "!w-full !h-full [&_.semi-spin-children]:w-full [&_.semi-spin-children]:h-full",
|
|
6190
|
+
children: /*#__PURE__*/ jsx("img", {
|
|
6191
|
+
src: audio_icon,
|
|
6192
|
+
alt: audioName,
|
|
6193
|
+
width: '100%',
|
|
6194
|
+
height: '100%',
|
|
6195
|
+
style: {
|
|
6196
|
+
objectFit: 'cover',
|
|
6197
|
+
objectPosition: 'center'
|
|
6198
|
+
}
|
|
6199
|
+
})
|
|
6200
|
+
}),
|
|
6201
|
+
/*#__PURE__*/ jsxs("div", {
|
|
6202
|
+
className: classnames('absolute inset-0 rounded-[6px] flex gap-3 items-center justify-center', 'z-[1]', 'bg-[rgba(0,0,0,0.4)]', 'invisible group-hover:visible'),
|
|
6203
|
+
children: [
|
|
6204
|
+
upload?.status === 'error' ? /*#__PURE__*/ jsx(IconCozRefresh, {
|
|
6205
|
+
className: classnames('text-white cursor-pointer', iconSizeCls),
|
|
6206
|
+
onClick: upload?.onRetry
|
|
6207
|
+
}) : null,
|
|
6208
|
+
audioUrl && ![
|
|
6209
|
+
'error',
|
|
6210
|
+
'loading'
|
|
6211
|
+
].includes(upload?.status || 'success') ? /*#__PURE__*/ jsx(IconCozPlayCircle, {
|
|
6212
|
+
className: classnames('text-white cursor-pointer', iconSizeCls),
|
|
6213
|
+
onClick: ()=>setModalVisible(true)
|
|
6214
|
+
}) : null,
|
|
6215
|
+
showDownload ? /*#__PURE__*/ jsx(IconCozDownload, {
|
|
6216
|
+
className: classnames('text-white cursor-pointer', iconSizeCls),
|
|
6217
|
+
onClick: ()=>{
|
|
6218
|
+
if (audioUrl) fileDownload(audioUrl, audioName || i18n_I18n.t('test'));
|
|
6219
|
+
}
|
|
6220
|
+
}) : null,
|
|
6221
|
+
isFunction(deletion) ? /*#__PURE__*/ jsx("div", {
|
|
6222
|
+
className: "absolute right-[-8px] top-[-8px] p-[2px] shrink-0 inline-flex justify-center items-center cursor-pointer",
|
|
6223
|
+
onClick: ()=>deletion(),
|
|
6224
|
+
children: /*#__PURE__*/ jsx(IconCozCrossCircleFillPalette, {})
|
|
6225
|
+
}) : null
|
|
6226
|
+
]
|
|
6227
|
+
})
|
|
6228
|
+
]
|
|
6229
|
+
}),
|
|
6230
|
+
/*#__PURE__*/ jsx(Modal, {
|
|
6231
|
+
visible: modalVisible,
|
|
6232
|
+
closable: false,
|
|
6233
|
+
title: /*#__PURE__*/ jsxs("div", {
|
|
6234
|
+
className: "w-full flex items-center justify-between",
|
|
6235
|
+
children: [
|
|
6236
|
+
/*#__PURE__*/ jsx(Typography.Title, {
|
|
6237
|
+
heading: 5,
|
|
6238
|
+
ellipsis: {
|
|
6239
|
+
showTooltip: true
|
|
6240
|
+
},
|
|
6241
|
+
children: audioName || i18n_I18n.t('audio')
|
|
6242
|
+
}),
|
|
6243
|
+
/*#__PURE__*/ jsxs("div", {
|
|
6244
|
+
className: "flex items-center gap-2",
|
|
6245
|
+
children: [
|
|
6246
|
+
/*#__PURE__*/ jsx(LoadingButton, {
|
|
6247
|
+
color: "primary",
|
|
6248
|
+
icon: /*#__PURE__*/ jsx(IconCozDownload, {}),
|
|
6249
|
+
onClick: async ()=>{
|
|
6250
|
+
if (audioUrl) await fileDownload(audioUrl, audioName || i18n_I18n.t('test'));
|
|
6251
|
+
},
|
|
6252
|
+
children: i18n_I18n.t('download')
|
|
6253
|
+
}),
|
|
6254
|
+
/*#__PURE__*/ jsx(IconButton, {
|
|
6255
|
+
size: "large",
|
|
6256
|
+
color: "secondary",
|
|
6257
|
+
className: "!w-[40px] !h-[40px]",
|
|
6258
|
+
icon: /*#__PURE__*/ jsx(IconCozCross, {}),
|
|
6259
|
+
onClick: ()=>setModalVisible(false)
|
|
6260
|
+
})
|
|
6261
|
+
]
|
|
6262
|
+
})
|
|
6263
|
+
]
|
|
6264
|
+
}),
|
|
6265
|
+
width: 800,
|
|
6266
|
+
onCancel: ()=>setModalVisible(false),
|
|
6267
|
+
children: /*#__PURE__*/ jsx(AudioPlayer, {
|
|
6268
|
+
autoPlay: false,
|
|
6269
|
+
audioUrl: audioUrl,
|
|
6270
|
+
theme: "light",
|
|
6271
|
+
skipDuration: 180,
|
|
6272
|
+
className: classnames('rounded-[8px]', '[&_.semi-audio-player-control>span:not(:first-child)]:hidden', '[&_.semi-audio-player-control_button]:!coz-stroke-primary', '[&_.semi-audio-player-slider-progress]:bg-[--coz-fg-hglt]')
|
|
6273
|
+
})
|
|
6274
|
+
})
|
|
6275
|
+
]
|
|
6276
|
+
});
|
|
6277
|
+
}
|
|
6278
|
+
const video_icon = __rslib_svgr_url__2__;
|
|
6279
|
+
function VideoRender({ videoName, videoUrl, showDownload, deletion, upload, size = 'small', className }) {
|
|
6280
|
+
const [modalVisible, setModalVisible] = useState(false);
|
|
6281
|
+
const [videoElementStatus, setVideoElementStatus] = useState('loading');
|
|
6282
|
+
const iconSizeCls = 'small' === size ? 'text-[14px]' : 'text-[20px]';
|
|
6283
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
6284
|
+
className: "flex flex-col",
|
|
6285
|
+
onClick: (e)=>{
|
|
6286
|
+
e.stopPropagation();
|
|
6287
|
+
},
|
|
6288
|
+
children: [
|
|
6289
|
+
/*#__PURE__*/ jsxs("div", {
|
|
6290
|
+
className: classnames('inline-block relative group', 'small' === size ? 'w-[36px] h-[36px]' : 'w-[80px] h-[80px]', className),
|
|
6291
|
+
children: [
|
|
6292
|
+
'loading' === videoElementStatus || upload?.status === 'loading' ? /*#__PURE__*/ jsx(Spin, {
|
|
6293
|
+
spinning: true,
|
|
6294
|
+
wrapperClassName: "absolute inset-0",
|
|
6295
|
+
children: /*#__PURE__*/ jsx("img", {
|
|
6296
|
+
src: video_icon,
|
|
6297
|
+
className: "w-full h-full object-cover"
|
|
6298
|
+
})
|
|
6299
|
+
}) : null,
|
|
6300
|
+
'error' === videoElementStatus || upload?.status === 'error' ? /*#__PURE__*/ jsx("div", {
|
|
6301
|
+
className: classnames('absolute inset-0 rounded-[6px] flex items-center justify-center coz-mg-primary', {
|
|
6302
|
+
'border border-solid coz-stroke-hglt-red': upload?.status === 'error'
|
|
6303
|
+
}),
|
|
6304
|
+
children: /*#__PURE__*/ jsx(IconCozImageBroken, {
|
|
6305
|
+
className: classnames('text-[30px] coz-fg-dim')
|
|
6306
|
+
})
|
|
6307
|
+
}) : null,
|
|
6308
|
+
/*#__PURE__*/ jsx("video", {
|
|
6309
|
+
src: videoUrl,
|
|
6310
|
+
width: '100%',
|
|
6311
|
+
height: '100%',
|
|
6312
|
+
className: classnames('rounded-[6px] pointer-events-none', {
|
|
6313
|
+
invisible: 'loaded' !== videoElementStatus || [
|
|
6314
|
+
'error',
|
|
6315
|
+
'loading'
|
|
6316
|
+
].includes(upload?.status || 'success')
|
|
6317
|
+
}),
|
|
6318
|
+
style: {
|
|
6319
|
+
objectFit: 'cover',
|
|
6320
|
+
objectPosition: 'center'
|
|
6321
|
+
},
|
|
6322
|
+
onLoadedData: ()=>setVideoElementStatus('loaded'),
|
|
6323
|
+
onError: ()=>setVideoElementStatus('error')
|
|
6324
|
+
}),
|
|
6325
|
+
/*#__PURE__*/ jsx("div", {
|
|
6326
|
+
className: classnames('absolute inset-0 flex items-center justify-center rounded-[6px]', 'bg-[rgba(0,0,0,0.2)]', 'group-hover:invisible', 'loaded' !== videoElementStatus || [
|
|
6327
|
+
'error',
|
|
6328
|
+
'loading'
|
|
6329
|
+
].includes(upload?.status || 'success') ? 'invisible' : 'visible'),
|
|
6330
|
+
children: /*#__PURE__*/ jsx(IconCozPlayCircle, {
|
|
6331
|
+
className: classnames('coz-fg-hglt-plus', iconSizeCls)
|
|
6332
|
+
})
|
|
6333
|
+
}),
|
|
6334
|
+
/*#__PURE__*/ jsxs("div", {
|
|
6335
|
+
className: classnames('absolute inset-0 flex gap-3 items-center rounded-[6px] justify-center', 'z-[1]', 'bg-[rgba(0,0,0,0.4)]', 'invisible group-hover:visible'),
|
|
6336
|
+
children: [
|
|
6337
|
+
upload?.status === 'error' ? /*#__PURE__*/ jsx(IconCozRefresh, {
|
|
6338
|
+
className: classnames('text-white cursor-pointer', iconSizeCls),
|
|
6339
|
+
onClick: upload?.onRetry
|
|
6340
|
+
}) : null,
|
|
6341
|
+
videoUrl && ![
|
|
6342
|
+
'error',
|
|
6343
|
+
'loading'
|
|
6344
|
+
].includes(upload?.status || 'success') ? /*#__PURE__*/ jsx(IconCozPlayCircle, {
|
|
6345
|
+
className: classnames('text-white cursor-pointer', iconSizeCls),
|
|
6346
|
+
onClick: ()=>setModalVisible(true)
|
|
6347
|
+
}) : null,
|
|
6348
|
+
showDownload ? /*#__PURE__*/ jsx(IconCozDownload, {
|
|
6349
|
+
className: classnames('text-white cursor-pointer', iconSizeCls),
|
|
6350
|
+
onClick: ()=>{
|
|
6351
|
+
if (videoUrl) fileDownload(videoUrl, videoName || i18n_I18n.t('test'));
|
|
6352
|
+
}
|
|
6353
|
+
}) : null,
|
|
6354
|
+
isFunction(deletion) ? /*#__PURE__*/ jsx("div", {
|
|
6355
|
+
className: "absolute right-[-8px] top-[-8px] p-[2px] shrink-0 inline-flex justify-center items-center cursor-pointer",
|
|
6356
|
+
onClick: ()=>deletion(),
|
|
6357
|
+
children: /*#__PURE__*/ jsx(IconCozCrossCircleFillPalette, {})
|
|
6358
|
+
}) : null
|
|
6359
|
+
]
|
|
6360
|
+
})
|
|
6361
|
+
]
|
|
6362
|
+
}),
|
|
6363
|
+
/*#__PURE__*/ jsx(Modal, {
|
|
6364
|
+
visible: modalVisible,
|
|
6365
|
+
closable: false,
|
|
6366
|
+
className: "[&_div:has(>.semi-videoPlayer)]:overflow-hidden",
|
|
6367
|
+
title: /*#__PURE__*/ jsxs("div", {
|
|
6368
|
+
className: "w-full flex items-center justify-between",
|
|
6369
|
+
children: [
|
|
6370
|
+
/*#__PURE__*/ jsx(Typography.Title, {
|
|
6371
|
+
heading: 5,
|
|
6372
|
+
ellipsis: {
|
|
6373
|
+
showTooltip: true
|
|
6374
|
+
},
|
|
6375
|
+
children: videoName || i18n_I18n.t('video')
|
|
6376
|
+
}),
|
|
6377
|
+
/*#__PURE__*/ jsxs("div", {
|
|
6378
|
+
className: "flex items-center gap-2",
|
|
6379
|
+
children: [
|
|
6380
|
+
/*#__PURE__*/ jsx(LoadingButton, {
|
|
6381
|
+
color: "primary",
|
|
6382
|
+
icon: /*#__PURE__*/ jsx(IconCozDownload, {}),
|
|
6383
|
+
onClick: async ()=>{
|
|
6384
|
+
if (videoUrl) await fileDownload(videoUrl, videoName || i18n_I18n.t('test'));
|
|
6385
|
+
},
|
|
6386
|
+
children: i18n_I18n.t('download')
|
|
6387
|
+
}),
|
|
6388
|
+
/*#__PURE__*/ jsx(IconButton, {
|
|
6389
|
+
size: "large",
|
|
6390
|
+
color: "secondary",
|
|
6391
|
+
className: "!w-[40px] !h-[40px]",
|
|
6392
|
+
icon: /*#__PURE__*/ jsx(IconCozCross, {}),
|
|
6393
|
+
onClick: ()=>setModalVisible(false)
|
|
6394
|
+
})
|
|
6395
|
+
]
|
|
6396
|
+
})
|
|
6397
|
+
]
|
|
6398
|
+
}),
|
|
6399
|
+
width: 900,
|
|
6400
|
+
height: 600,
|
|
6401
|
+
onCancel: ()=>setModalVisible(false),
|
|
6402
|
+
children: /*#__PURE__*/ jsx(VideoPlayer, {
|
|
6403
|
+
className: "rounded-[8px] overflow-hidden",
|
|
6404
|
+
src: videoUrl || '',
|
|
6405
|
+
controlsList: [
|
|
6406
|
+
'play',
|
|
6407
|
+
'time',
|
|
6408
|
+
'volume',
|
|
6409
|
+
'playbackRate',
|
|
6410
|
+
'fullscreen'
|
|
6411
|
+
]
|
|
6412
|
+
})
|
|
6413
|
+
})
|
|
6414
|
+
]
|
|
6415
|
+
});
|
|
6085
6416
|
}
|
|
6086
|
-
|
|
6087
|
-
var src_DEFAULT_PART_COUNT = 50;
|
|
6088
|
-
export { default as schemaValidators } from "@rjsf/validator-ajv8";
|
|
6089
|
-
export { BasicCard, CardPane, ChipSelect, CodeEditorWithLoading, CodeMirrorCodeEditor, CodeMirrorJsonEditor, CodeMirrorRawCodeEditor, CodeMirrorRawTextEditor, CodeMirrorTextEditor, CollapseCard, CollapseItem, ColumnSelector, Copyable, DEFAULT_FILE_SIZE, DEFAULT_PAGE_SIZE, DEFAULT_SUPPORTED_FORMATS, DEFAULT_VIDEO_SUPPORTED_FORMATS, DiffEditor, EditIconButton, EditorProvider, FooterActions, FullPage, IDRender, IconButtonContainer, ImageItemRenderer, IndexControllerView, InfiniteScrollTable, InfoTooltip, InputSlider, InputWithCount, JumpIconButton, LargeTxtRender, Layout, LazyLoadComponent, LogicEditor, LogicExpr, LoopRadioGroup, LoopTable, LoopTabs, MultiPartRender, MultipartEditor, OpenDetailButton, PAGE_SIZE_OPTIONS, PageError, PageLoading, PageNoAuth, PageNoContent, PageNotFound, PrimaryPage, PrimaryTitle, RadioButton, ResizableSideSheet, ResizeSidesheet, SchemaEditor, SemiSchemaForm, SentinelForm, StepNav, TableBatchOperate, TableColActions, TableColsConfig, TableEmpty, TableHeader, TableWithPagination, TableWithoutPagination, TextAreaPro, TextWithCopy, TitleWithSub, TooltipWhenDisabled, TooltipWithDisabled, UploadButton, UserProfile, VersionItem, VersionList, VersionSwitchPanel, VideoItemRenderer, _monaco_editor_react as CodeEditor, base_search_form_select as BaseSearchFormSelect, base_search_select as BaseSearchSelect, dealColumnsWithStorage, formateDecimalPlacesString, getColumnManageStorage, getStoragePageSize, handleCopy, setColumnsManageStorage, sleep, src_DEFAULT_FILE_COUNT as DEFAULT_FILE_COUNT, src_DEFAULT_PART_COUNT as DEFAULT_PART_COUNT, src_useReportEvent as useReportEvent, type_ImageStatus as MultipartRenderStatus, upload_uploadFile as uploadFile, useBatchOperate, useItemIndexController, useUnsaveLeaveWarning };
|
|
6417
|
+
export { AudioRender, base_search_form_select as BaseSearchFormSelect, base_search_select as BaseSearchSelect, BasicCard, CardPane, ChipSelect, _monaco_editor_react as CodeEditor, CodeEditorWithLoading, CodeMirrorCodeEditor, CodeMirrorJsonEditor, CodeMirrorRawCodeEditor, CodeMirrorRawTextEditor, CodeMirrorTextEditor, CollapseCard, CollapseItem, ColumnSelector, Copyable, CozeLoopProvider, DEFAULT_FILE_COUNT, DEFAULT_FILE_SIZE, DEFAULT_PAGE_SIZE, DEFAULT_PART_COUNT, DEFAULT_SUPPORTED_FORMATS, DEFAULT_VIDEO_SUPPORTED_FORMATS, DiffEditor, EditIconButton, EditorProvider, FooterActions, FullPage, IDRender, IconButtonContainer, ImageItemRenderer, IndexControllerView, InfiniteScrollTable, InfoTooltip, InputSlider, InputWithCount, JumpIconButton, LargeTxtRender, Layout, LazyLoadComponent, LinkButton, LogicEditor, LogicExpr, LoopRadioGroup, LoopTable, LoopTabs, MultiPartRender, MultipartEditor, type_ImageStatus as MultipartRenderStatus, OpenDetailButton, PAGE_SIZE_OPTIONS, PageError, PageLoading, PageNoAuth, PageNoContent, PageNotFound, PrimaryPage, PrimaryTitle, RadioButton, ResizableSideSheet, ResizeSidesheet, SchemaEditor, SemiSchemaForm, SentinelForm, StepNav, TableBatchOperate, TableColActions, TableColsConfig, TableEmpty, TableHeader, TableWithPagination, TableWithoutPagination, TextAreaPro, TextWithCopy, TitleWithSub, TooltipWhenDisabled, TooltipWithDisabled, UploadButton, UserProfile, VersionItem, VersionList, VersionSwitchPanel, VideoItemRenderer, VideoRender, dealColumnsWithStorage, formateDecimalPlacesString, getColumnManageStorage, getStoragePageSize, handleCopy, validator_ajv8 as schemaValidators, setColumnsManageStorage, sleep, upload_uploadFile as uploadFile, useBatchOperate, useItemIndexController, useReportEvent, useUnsaveLeaveWarning };
|
package/dist/es/loopIcons.mjs
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="36" height="36" rx="4" fill="#5768A1" fill-opacity="0.08"/>
|
|
3
|
+
<path d="M8 9.2C8 8.07989 8 7.51984 8.21799 7.09202C8.40973 6.71569 8.71569 6.40973 9.09202 6.21799C9.51984 6 10.0799 6 11.2 6H20.0079C20.497 6 20.7416 6 20.9718 6.05526C21.1759 6.10425 21.3709 6.18506 21.5499 6.29472C21.7517 6.4184 21.9247 6.59135 22.2706 6.93726L27.0627 11.7294C27.4087 12.0753 27.5816 12.2483 27.7053 12.4501C27.8149 12.629 27.8957 12.8241 27.9447 13.0282C28 13.2584 28 13.503 28 13.9921V26.8C28 27.9201 28 28.4801 27.782 28.908C27.5903 29.2843 27.2843 29.5903 26.908 29.782C26.4801 30 25.9201 30 24.8 30H11.2C10.0799 30 9.51984 30 9.09202 29.782C8.71569 29.5903 8.40973 29.2843 8.21799 28.908C8 28.4801 8 27.9201 8 26.8V9.2Z" fill="#00BF40"/>
|
|
4
|
+
<path d="M21.3334 6.77291C21.3334 6.53058 21.3334 6.40942 21.3813 6.35331C21.4228 6.30463 21.4852 6.2788 21.549 6.28382C21.6226 6.28961 21.7083 6.37528 21.8796 6.54664L27.4538 12.1208C27.6251 12.2921 27.7108 12.3778 27.7166 12.4513C27.7216 12.5152 27.6958 12.5775 27.6471 12.6191C27.591 12.667 27.4698 12.667 27.2275 12.667H24.5334C23.4132 12.667 22.8532 12.667 22.4254 12.449C22.049 12.2573 21.7431 11.9513 21.5514 11.575C21.3334 11.1472 21.3334 10.5871 21.3334 9.46703V6.77291Z" fill="white" fill-opacity="0.3"/>
|
|
5
|
+
<path d="M16.0556 25.5C15.4445 25.5 14.9213 25.2824 14.4862 24.8472C14.051 24.4121 13.8334 23.8889 13.8334 23.2778C13.8334 22.6667 14.051 22.1435 14.4862 21.7083C14.9213 21.2731 15.4445 21.0555 16.0556 21.0555C16.2686 21.0555 16.4653 21.081 16.6459 21.1319C16.8264 21.1829 17 21.2593 17.1667 21.3611V16.3333C17.1667 15.8731 17.5398 15.5 18 15.5H21.3334V17.1667H18.6945C18.4644 17.1667 18.2778 17.3532 18.2778 17.5833V23.2778C18.2778 23.8889 18.0602 24.4121 17.625 24.8472C17.1898 25.2824 16.6667 25.5 16.0556 25.5Z" fill="white"/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="36" height="36" rx="4" fill="#5768A1" fill-opacity="0.08"/>
|
|
3
|
+
<path d="M8 9.2C8 8.07989 8 7.51984 8.21799 7.09202C8.40973 6.71569 8.71569 6.40973 9.09202 6.21799C9.51984 6 10.0799 6 11.2 6H20.0079C20.497 6 20.7416 6 20.9718 6.05526C21.1759 6.10425 21.3709 6.18506 21.5499 6.29472C21.7517 6.4184 21.9247 6.59135 22.2706 6.93726L27.0627 11.7294C27.4087 12.0753 27.5816 12.2483 27.7053 12.4501C27.8149 12.629 27.8957 12.8241 27.9447 13.0282C28 13.2584 28 13.503 28 13.9921V26.8C28 27.9201 28 28.4801 27.782 28.908C27.5903 29.2843 27.2843 29.5903 26.908 29.782C26.4801 30 25.9201 30 24.8 30H11.2C10.0799 30 9.51984 30 9.09202 29.782C8.71569 29.5903 8.40973 29.2843 8.21799 28.908C8 28.4801 8 27.9201 8 26.8V9.2Z" fill="#4080FF"/>
|
|
4
|
+
<path d="M21.3334 6.77291C21.3334 6.53058 21.3334 6.40942 21.3813 6.35331C21.4228 6.30463 21.4852 6.2788 21.549 6.28382C21.6226 6.28961 21.7083 6.37528 21.8796 6.54664L27.4538 12.1208C27.6251 12.2921 27.7108 12.3778 27.7166 12.4513C27.7216 12.5152 27.6958 12.5775 27.6471 12.6191C27.591 12.667 27.4698 12.667 27.2275 12.667H24.5334C23.4132 12.667 22.8532 12.667 22.4254 12.449C22.049 12.2573 21.7431 11.9513 21.5514 11.575C21.3334 11.1472 21.3334 10.5871 21.3334 9.46703V6.77291Z" fill="white" fill-opacity="0.3"/>
|
|
5
|
+
<path d="M12.4447 16.6107C12.4447 16.1504 12.8178 15.7773 13.278 15.7773H19.1114C19.5716 15.7773 19.9447 16.1504 19.9447 16.6107V17.6003L21.2028 16.8925C21.7583 16.5801 22.4447 16.9815 22.4447 17.6189V21.4358C22.4447 22.0731 21.7583 22.4746 21.2028 22.1621L19.9447 21.4544V22.444C19.9447 22.9042 19.5716 23.2773 19.1114 23.2773H13.278C12.8178 23.2773 12.4447 22.9042 12.4447 22.444V16.6107ZM14.9447 19.1107C15.4049 19.1107 15.778 18.7375 15.778 18.2773C15.778 17.8171 15.4049 17.444 14.9447 17.444C14.4844 17.444 14.1114 17.8171 14.1114 18.2773C14.1114 18.7375 14.4844 19.1107 14.9447 19.1107Z" fill="white"/>
|
|
6
|
+
</svg>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type DOMAttributes } from 'react';
|
|
2
|
-
export declare
|
|
2
|
+
export declare const IconButtonContainer: import("react").ForwardRefExoticComponent<{
|
|
3
3
|
icon: React.ReactNode;
|
|
4
4
|
className?: string;
|
|
5
5
|
style?: React.CSSProperties;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
active?: boolean;
|
|
8
|
-
} & DOMAttributes<HTMLDivElement>
|
|
8
|
+
} & DOMAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export { useItemIndexController, type IndexControllerStore, } from './index-cont
|
|
|
36
36
|
export { IndexControllerView } from './index-controller/record-navigation';
|
|
37
37
|
export { BaseSearchSelect, BaseSearchFormSelect, type BaseSearchSelectRef, type BaseSelectProps, type LoadOptionByIds, } from './base-search-select';
|
|
38
38
|
export { OpenDetailButton } from './open-detail-button';
|
|
39
|
+
export { LinkButton } from './link-button';
|
|
39
40
|
export { EditIconButton } from './edit-icon-button';
|
|
40
41
|
export { CollapseCard } from './collapse-card';
|
|
41
42
|
export { type Expr, type ExprGroup, type LogicOperator, type LogicExprProps, type ExprRenderProps, type ExprGroupRenderProps, type LeftRenderProps, type OperatorRenderProps, type RightRenderProps, type OperatorOption, LogicExpr, } from './logic-expr';
|
|
@@ -58,6 +59,7 @@ export { InputWithCount } from './input-with-count';
|
|
|
58
59
|
export { LoopRadioGroup } from './loop-radio-group';
|
|
59
60
|
export { Layout } from './layout';
|
|
60
61
|
export { TitleWithSub } from './title-with-sub';
|
|
62
|
+
export { CozeLoopProvider, useReportEvent } from './provider';
|
|
61
63
|
export { FooterActions } from './footer-actions';
|
|
62
64
|
export { TableEmpty } from './table-empty';
|
|
63
65
|
export { CardPane } from './card-pane';
|
|
@@ -68,4 +70,4 @@ export { CodeMirrorCodeEditor, CodeMirrorTextEditor, CodeMirrorJsonEditor, CodeM
|
|
|
68
70
|
export { SchemaEditor } from './schema-editor';
|
|
69
71
|
export { CodeEditorWithLoading } from './code-editor-with-loading';
|
|
70
72
|
export { CollapseItem } from './collapse-item';
|
|
71
|
-
export
|
|
73
|
+
export { AudioRender, type AudioRenderProps, VideoRender, type VideoRenderProps, } from './multi-modal-dataset-item-render';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type AnchorHTMLAttributes, type PropsWithChildren } from 'react';
|
|
2
|
+
interface LinkButtonProps extends PropsWithChildren {
|
|
3
|
+
tooltip?: string;
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
/** 若使用该参数,则会忽略 onClick,且会在 loading 期间不再触发回调 */
|
|
6
|
+
onAsyncClick?: () => Promise<unknown>;
|
|
7
|
+
/** @default true */
|
|
8
|
+
link?: AnchorHTMLAttributes<HTMLAnchorElement> | boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/** typography link 形式的按钮 */
|
|
12
|
+
export declare function LinkButton({ tooltip, onClick, onAsyncClick, link, children, className, }: LinkButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface AudioRenderProps {
|
|
2
|
+
audioUrl?: string;
|
|
3
|
+
audioName?: string;
|
|
4
|
+
showDownload?: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* 删除按钮 复合参数
|
|
7
|
+
*
|
|
8
|
+
* - 若不展示删除按钮,则传 false | undefined
|
|
9
|
+
* - 若展示删除按钮,则直接传回调函数
|
|
10
|
+
*
|
|
11
|
+
* (不叫 delete 是为了避讳 js 关键字)
|
|
12
|
+
*/
|
|
13
|
+
deletion?: false | (() => void);
|
|
14
|
+
/**
|
|
15
|
+
* 上传态 展示配置
|
|
16
|
+
*
|
|
17
|
+
* 只有在可编辑表单中需要考虑
|
|
18
|
+
*/
|
|
19
|
+
upload?: {
|
|
20
|
+
/**
|
|
21
|
+
* loading - 展示 loading 态
|
|
22
|
+
* error - 展示 retry 按钮
|
|
23
|
+
*/
|
|
24
|
+
status: 'success' | 'error' | 'loading';
|
|
25
|
+
onRetry?: () => void;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* @enum 'small' - 整体宽高 36px;icon 宽高 14px
|
|
29
|
+
* @enum 'medium' - 整体宽高 80px;icon 宽高 20px
|
|
30
|
+
* @default 'small'
|
|
31
|
+
*/
|
|
32
|
+
size?: 'small' | 'medium';
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function AudioRender({ audioUrl, audioName, className, showDownload, deletion, upload, size, }: AudioRenderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface VideoRenderProps {
|
|
2
|
+
videoName?: string;
|
|
3
|
+
videoUrl?: string;
|
|
4
|
+
showDownload?: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* 删除按钮 复合参数
|
|
7
|
+
*
|
|
8
|
+
* - 若不展示删除按钮,则传 false | undefined
|
|
9
|
+
* - 若展示删除按钮,则直接传回调函数
|
|
10
|
+
*
|
|
11
|
+
* (不叫 delete 是为了避讳 js 关键字)
|
|
12
|
+
*/
|
|
13
|
+
deletion?: false | (() => void);
|
|
14
|
+
/**
|
|
15
|
+
* 上传态 展示配置
|
|
16
|
+
*
|
|
17
|
+
* 只有在可编辑表单中需要考虑
|
|
18
|
+
*/
|
|
19
|
+
upload?: {
|
|
20
|
+
/**
|
|
21
|
+
* loading - 展示 loading 态
|
|
22
|
+
* error - 展示 retry 按钮
|
|
23
|
+
*/
|
|
24
|
+
status: 'success' | 'error' | 'loading';
|
|
25
|
+
onRetry?: () => void;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* @enum 'small' - 整体宽高 36px;icon 宽高 14px
|
|
29
|
+
* @enum 'medium' - 整体宽高 80px;icon 宽高 20px
|
|
30
|
+
* @default 'small'
|
|
31
|
+
*/
|
|
32
|
+
size?: 'small' | 'medium';
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function VideoRender({ videoName, videoUrl, showDownload, deletion, upload, size, className, }: VideoRenderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
interface PrimaryPageHeaderProps {
|
|
3
3
|
pageTitle?: ReactNode;
|
|
4
|
-
renderCustomHeader?: ReactNode;
|
|
5
4
|
filterSlot?: ReactNode;
|
|
6
5
|
children?: ReactNode;
|
|
7
6
|
headerClassName?: string;
|
|
@@ -10,5 +9,5 @@ interface PrimaryPageHeaderProps {
|
|
|
10
9
|
className?: string;
|
|
11
10
|
titleSlot?: ReactNode;
|
|
12
11
|
}
|
|
13
|
-
export declare const PrimaryPage: ({ pageTitle,
|
|
12
|
+
export declare const PrimaryPage: ({ pageTitle, filterSlot, children, contentClassName, className, headerClassName, titleClassName, titleSlot, ...restProps }: PrimaryPageHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
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 {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cozeloop/components",
|
|
3
|
-
"version": "0.0.12-beta-
|
|
3
|
+
"version": "0.0.12-beta-1772259372242",
|
|
4
4
|
"description": "common components for cozeloop",
|
|
5
5
|
"author": "houtao.zzj@bytedance.com",
|
|
6
6
|
"exports": {
|
|
@@ -32,12 +32,11 @@
|
|
|
32
32
|
"@codemirror/lang-go": "^6.0.1",
|
|
33
33
|
"@codemirror/state": "^6.4.1",
|
|
34
34
|
"@codemirror/view": "^6.34.1",
|
|
35
|
-
"@coze-arch/coze-design": "0.0.7-alpha.
|
|
35
|
+
"@coze-arch/coze-design": "0.0.7-alpha.985c0d",
|
|
36
36
|
"@coze-editor/editor": "0.1.0-alpha.577152",
|
|
37
37
|
"@cozeloop/api-schema": "0.1.6",
|
|
38
|
-
"@cozeloop/config-provider": "0.0.12-beta-1770794836582",
|
|
39
38
|
"@cozeloop/hooks": "0.0.1",
|
|
40
|
-
"@cozeloop/i18n": "0.0.
|
|
39
|
+
"@cozeloop/i18n": "0.0.4",
|
|
41
40
|
"@cozeloop/toolkit": "0.0.5",
|
|
42
41
|
"@monaco-editor/react": "^4.5.2",
|
|
43
42
|
"@rjsf/core": "~5.24.9",
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import "./index.css";
|
|
2
|
-
var __webpack_modules__ = {};
|
|
3
|
-
var __webpack_module_cache__ = {};
|
|
4
|
-
function __webpack_require__(moduleId) {
|
|
5
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
6
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
7
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
8
|
-
exports: {}
|
|
9
|
-
};
|
|
10
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
11
|
-
return module.exports;
|
|
12
|
-
}
|
|
13
|
-
__webpack_require__.m = __webpack_modules__;
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.add = function(modules) {
|
|
16
|
-
Object.assign(__webpack_require__.m, modules);
|
|
17
|
-
};
|
|
18
|
-
})();
|
|
19
|
-
(()=>{
|
|
20
|
-
__webpack_require__.d = (exports, definition)=>{
|
|
21
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: definition[key]
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
})();
|
|
27
|
-
(()=>{
|
|
28
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
29
|
-
})();
|
|
30
|
-
(()=>{
|
|
31
|
-
__webpack_require__.r = (exports)=>{
|
|
32
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
|
|
33
|
-
value: 'Module'
|
|
34
|
-
});
|
|
35
|
-
Object.defineProperty(exports, '__esModule', {
|
|
36
|
-
value: true
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
})();
|
|
40
|
-
export { __webpack_require__ };
|