@cozeloop/components 0.0.12-beta-1773633875853 → 0.0.12-beta-1773728390343

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.mjs CHANGED
@@ -1,18 +1,20 @@
1
1
  import "./index.css";
2
2
  import "./static/svg/select.svg";
3
+ import __rslib_svgr_url__1__ from "./static/svg/audio-icon.svg";
4
+ import __rslib_svgr_url__2__ from "./static/svg/video-icon.svg";
3
5
  import { __webpack_require__ } from "./rslib-runtime.mjs";
4
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
7
  import { arrayMove, sortableContainer as external_react_sortable_hoc_sortableContainer, sortableElement, sortableHandle } from "react-sortable-hoc";
6
8
  import react, { Fragment as external_react_Fragment, forwardRef, isValidElement, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
7
9
  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";
10
+ 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";
11
+ 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
12
  import classnames from "classnames";
11
13
  import { IconCozIllus404, IconCozIllus404Dark, IconCozIllusEmpty, IconCozIllusEmptyDark, IconCozIllusError, IconCozIllusErrorDark, IconCozIllusLock, IconCozIllusLockDark, IconCozIllusNone, IconCozIllusNoneDark } from "@coze-arch/coze-design/illustrations";
12
14
  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";
15
+ import { cloneDeep, debounce, get, isEmpty as external_lodash_es_isEmpty, isFunction, isInteger, isNull, isNumber, isObject, isString, isUndefined, set } from "lodash-es";
14
16
  import copy_to_clipboard from "copy-to-clipboard";
15
- import { formatTimestampToString, safeJsonParse, sleep as toolkit_sleep } from "@cozeloop/toolkit";
17
+ import { fileDownload, formatTimestampToString, safeJsonParse, sleep as toolkit_sleep } from "@cozeloop/toolkit";
16
18
  import _monaco_editor_react, { DiffEditor, loader } from "@monaco-editor/react";
17
19
  import sortablejs from "sortablejs";
18
20
  import { nanoid } from "nanoid";
@@ -33,6 +35,7 @@ import { python } from "@coze-editor/editor/language-python";
33
35
  import { json } from "@coze-editor/editor/language-json";
34
36
  import { mixLanguages } from "@coze-editor/editor";
35
37
  import { EditorView, keymap } from "@codemirror/view";
38
+ import { markdownLanguage } from "@codemirror/lang-markdown";
36
39
  import { goLanguage } from "@codemirror/lang-go";
37
40
  import preset_universal from "@coze-editor/editor/preset-universal";
38
41
  var external_react_sortable_hoc_namespaceObject = {};
@@ -252,15 +255,14 @@ const LoopTable = ({ className, ...props })=>/*#__PURE__*/ jsx(Table, {
252
255
  ...props,
253
256
  id: index_module["loop-table"]
254
257
  });
255
- function IconButtonContainer({ icon, className, style, onClick, active, disabled, ...rest }) {
256
- return /*#__PURE__*/ jsx("div", {
258
+ const IconButtonContainer = /*#__PURE__*/ forwardRef(({ icon, className, style, onClick, active, disabled, ...rest }, ref)=>/*#__PURE__*/ jsx("div", {
259
+ ref: ref,
257
260
  ...rest,
258
261
  onClick: onClick,
259
262
  style: style,
260
263
  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
264
  children: icon
262
- });
263
- }
265
+ }));
264
266
  const activeColor = 'rgb(var(--coze-up-brand-9))';
265
267
  const unActiveColor = 'var(--coz-fg-dim)';
266
268
  const IconSortArrow = ({ sortOrder, ...rest })=>{
@@ -801,7 +803,8 @@ function VersionDescriptions({ version, className }) {
801
803
  className: "!text-[13px]",
802
804
  children: /*#__PURE__*/ jsx(UserProfile, {
803
805
  name: submitter?.name,
804
- avatarUrl: submitter?.avatar_url
806
+ avatarUrl: submitter?.avatar_url,
807
+ userNameClassName: "!max-w-[130px]"
805
808
  })
806
809
  }),
807
810
  isDraft ? null : /*#__PURE__*/ jsx(Descriptions.Item, {
@@ -831,7 +834,7 @@ function VersionItem({ version, active, className, onClick }) {
831
834
  })
832
835
  }),
833
836
  /*#__PURE__*/ jsx("div", {
834
- className: `grow px-2 pt-2 rounded-m ${active ? 'bg-gray-100' : ''} group-hover:bg-gray-100`,
837
+ className: `grow min-w-0 overflow-hidden px-2 pt-2 rounded-m ${active ? 'bg-gray-100' : ''} group-hover:bg-gray-100`,
835
838
  children: /*#__PURE__*/ jsx(VersionDescriptions, {
836
839
  version: version
837
840
  })
@@ -1957,6 +1960,28 @@ function OpenDetailButton({ url, className }) {
1957
1960
  })
1958
1961
  });
1959
1962
  }
1963
+ function LinkButton({ tooltip, onClick, onAsyncClick, link = true, children, className }) {
1964
+ const [loading, setLoading] = useState(false);
1965
+ return /*#__PURE__*/ jsx(Tooltip, {
1966
+ trigger: tooltip ? 'hover' : 'custom',
1967
+ content: tooltip,
1968
+ children: /*#__PURE__*/ jsx("span", {
1969
+ className: className,
1970
+ children: /*#__PURE__*/ jsx(Typography.Text, {
1971
+ link: link,
1972
+ onClick: ()=>{
1973
+ if (!isFunction(onAsyncClick)) onClick?.();
1974
+ if (loading) return;
1975
+ setLoading(true);
1976
+ onAsyncClick?.().finally(()=>{
1977
+ setLoading(false);
1978
+ });
1979
+ },
1980
+ children: children
1981
+ })
1982
+ })
1983
+ }, tooltip);
1984
+ }
1960
1985
  function EditIconButton({ disabled, className, onClick, ...rest }) {
1961
1986
  return /*#__PURE__*/ jsx(IconCozPencil, {
1962
1987
  ...rest,
@@ -2033,6 +2058,24 @@ const CollapseCard = ({ className, title, children, subInfo, extra, defaultVisib
2033
2058
  })
2034
2059
  });
2035
2060
  };
2061
+ const fox_icon_defaultSize = 16;
2062
+ function FoxIcon(props) {
2063
+ const { width: w = fox_icon_defaultSize, height: h = fox_icon_defaultSize } = props;
2064
+ return /*#__PURE__*/ jsx("svg", {
2065
+ width: w,
2066
+ height: h,
2067
+ viewBox: "0 0 20 20",
2068
+ fill: "none",
2069
+ xmlns: "http://www.w3.org/2000/svg",
2070
+ ...props,
2071
+ children: /*#__PURE__*/ jsx("path", {
2072
+ "fill-rule": "evenodd",
2073
+ "clip-rule": "evenodd",
2074
+ d: "M17.3473 0.00458872C17.6452 -0.0249179 17.8984 0.0924468 18.0643 0.22551C18.2039 0.337458 18.311 0.480293 18.3839 0.632946L18.4455 0.788677C18.9386 2.35659 19.2117 3.98764 19.2323 5.66342C19.2496 7.06943 19.028 8.43596 18.5994 9.74231C18.4824 10.0985 18.3598 10.4185 18.2327 10.7437C18.5945 11.6085 18.7963 11.9852 19.3862 12.291L19.4803 12.3463C19.6952 12.4866 19.8763 12.7081 19.952 12.9601C20.0925 13.4261 19.8963 13.8039 19.7275 14.0303C19.8107 14.1519 19.8714 14.2882 19.9013 14.4314L19.9194 14.5528L19.923 14.6913C19.9144 14.9626 19.8085 15.2017 19.6578 15.3858L19.579 15.4727C19.3622 15.6904 19.1371 15.8828 18.909 16.0639C18.9132 16.3533 18.8058 16.6484 18.5569 16.8752C18.1728 17.2245 17.7771 17.5072 17.369 17.7724C16.133 18.5756 14.8037 19.1596 13.4108 19.538C11.7645 19.985 10.0607 20.1177 8.36983 19.892L8.03214 19.8422C6.42044 19.5812 4.86137 19.0583 3.40307 18.2378C2.8119 17.9052 2.24025 17.5348 1.69738 17.0925L1.46652 16.8987C1.2029 16.6701 1.08674 16.3641 1.0908 16.063C0.856606 15.876 0.626184 15.676 0.402728 15.4473C0.196646 15.2361 0.0934939 14.9598 0.0813275 14.6958V14.5827C0.0924408 14.3739 0.168182 14.1872 0.274168 14.0331C0.116351 13.8246 -0.056844 13.4996 0.0179528 13.086L0.0523562 12.952C0.0944353 12.825 0.157325 12.7169 0.218941 12.6342C0.303909 12.5202 0.428066 12.3967 0.592852 12.3092C0.990539 12.0971 1.30244 11.7816 1.4982 11.3467L1.76709 10.7491C1.60741 10.3354 1.44542 9.91056 1.30536 9.45801L1.17318 8.99444C0.896754 7.92354 0.741676 6.82226 0.759437 5.68425C0.785604 4.00887 1.0531 2.37139 1.5489 0.797731C1.61307 0.593854 1.7371 0.392143 1.91919 0.240902C2.08183 0.105885 2.32977 -0.0153893 2.62537 0.00639955L2.75483 0.0245078L3.002 0.0824543C3.57183 0.227991 4.10063 0.45088 4.60809 0.725298C4.99366 0.933989 5.36143 1.15067 5.73978 1.41522L6.12999 1.69952C6.94325 2.31568 7.68001 3.03054 8.33814 3.83901C9.43758 3.62204 10.5554 3.60883 11.6644 3.8363C12.8158 2.42292 14.2552 1.24358 15.8643 0.490796L16.2011 0.344119C16.5378 0.209745 16.874 0.1087 17.2169 0.0263186L17.3473 0.00458872ZM16.1323 13.5315C15.9372 13.4809 15.744 13.4809 15.5185 13.5206C15.277 13.5631 15.0325 13.6425 14.7019 13.7442C14.3865 13.8413 14.0147 13.9508 13.5937 14.0113C12.8132 14.1237 12.0265 14.1006 11.2344 13.8791C11.1656 13.8599 11.1042 13.8279 11.0479 13.7904C10.8602 13.9683 10.6827 14.1123 10.5626 14.177C10.171 14.3881 9.78919 14.3695 9.42909 14.1653C9.30978 14.0977 9.13806 13.969 8.95741 13.8094C8.90286 13.8454 8.84427 13.8773 8.77815 13.8963C7.69507 14.2086 6.58695 14.1547 5.54694 13.8447L4.77196 13.6139C4.29494 13.4717 3.77066 13.5654 3.30167 13.8882L2.72405 14.2866C2.6605 14.3303 2.55946 14.3872 2.4778 14.4333C2.3859 14.4851 2.27261 14.5484 2.16726 14.6071C2.05907 14.6674 1.9557 14.7252 1.87302 14.7737C1.86167 14.7804 1.85078 14.7861 1.84133 14.7918C2.00333 14.929 2.17466 15.0654 2.36463 15.2056C2.53367 15.3304 2.6406 15.5222 2.65796 15.7316C2.66485 15.8154 2.6564 15.8984 2.63533 15.9779C3.09344 16.3491 3.58638 16.6696 4.11739 16.9684C5.41703 17.6996 6.81148 18.169 8.26481 18.4044C9.849 18.661 11.4607 18.5585 13.0288 18.1328C14.2805 17.7928 15.47 17.269 16.575 16.551C16.8615 16.3648 17.119 16.1811 17.3618 15.9806C17.3407 15.9016 17.3326 15.8186 17.3392 15.7352C17.3559 15.5232 17.4651 15.329 17.637 15.2038C17.8247 15.067 17.9952 14.9312 18.1576 14.7945L16.9354 13.9914L16.9055 13.9715L16.8783 13.9489C16.5728 13.697 16.3297 13.5827 16.1323 13.5315ZM2.84537 1.55103C2.45276 2.89409 2.23746 4.28462 2.21524 5.70688C2.19981 6.69527 2.33488 7.66534 2.58372 8.62956C2.72339 9.17012 2.9127 9.67016 3.12784 10.2276C3.22799 10.4869 3.30754 10.8775 3.12512 11.2824L2.82726 11.9443C2.55715 12.5446 2.14809 13.0151 1.65211 13.3622C1.65547 13.365 1.65859 13.3683 1.66207 13.3712C1.72092 13.3383 1.77678 13.308 1.82685 13.2798C1.87035 13.2552 1.9074 13.2348 1.93549 13.2182C1.95864 13.2045 1.96979 13.1973 1.97261 13.1956L2.55022 12.7981C3.30501 12.2784 4.24044 12.0733 5.1504 12.3445L5.92538 12.5753C6.67088 12.7976 7.42708 12.8452 8.15526 12.6867C8.14645 12.6272 8.14499 12.5703 8.15617 12.5165C8.33464 11.6599 11.6219 11.6127 11.8464 12.5056C11.8584 12.5533 11.8554 12.6066 11.8446 12.665C12.3521 12.7718 12.8684 12.7776 13.4054 12.7003C13.7171 12.6554 14.0054 12.573 14.3126 12.4785C14.6045 12.3886 14.9462 12.2772 15.2894 12.2168C15.6487 12.1536 16.0402 12.1394 16.4646 12.2494C16.876 12.3561 17.2778 12.5693 17.6877 12.9013L18.0544 13.1421C17.4318 12.6067 17.1505 11.9363 16.8575 11.2317L16.8122 11.105C16.7252 10.8091 16.7595 10.5133 16.8539 10.272L17.0431 9.77762C17.1029 9.61658 17.1599 9.45606 17.2151 9.28779C17.5956 8.12797 17.7908 6.92096 17.7755 5.68153C17.7582 4.26964 17.5417 2.89036 17.1527 1.55466C16.9222 1.62547 16.701 1.70754 16.4818 1.80998C15.0162 2.49561 13.6799 3.60991 12.6205 4.9735C12.4069 5.2487 12.0396 5.42202 11.6372 5.32299C10.5631 5.05697 9.46383 5.06547 8.36802 5.31937C8.24642 5.34763 8.07205 5.36767 7.87823 5.31393C7.67197 5.25662 7.50583 5.13393 7.38662 4.97984C6.66704 4.05181 5.83672 3.2614 4.90505 2.60946C4.66539 2.44189 4.42745 2.29434 4.17443 2.15042L3.9155 2.00736C3.55847 1.81427 3.20621 1.66062 2.84537 1.55103Z",
2075
+ fill: "currentColor"
2076
+ })
2077
+ });
2078
+ }
2036
2079
  const logic_expr_index_module = {
2037
2080
  "logic-not": "logic-not-i_g5Y7",
2038
2081
  logicNot: "logic-not-i_g5Y7",
@@ -4493,9 +4536,15 @@ function FooterActions({ confirmBtnProps: { text: confirmBtnText, ...confirmBtnP
4493
4536
  function TableEmpty({ className, ...props }) {
4494
4537
  return /*#__PURE__*/ jsx(EmptyState, {
4495
4538
  className: classnames('my-10', className),
4496
- icon: /*#__PURE__*/ jsx(IconCozIllusNone, {}),
4497
- darkModeIcon: /*#__PURE__*/ jsx(IconCozIllusNoneDark, {}),
4498
- description: i18n_I18n.t('no_data'),
4539
+ icon: /*#__PURE__*/ jsx(IconCozIllusNone, {
4540
+ width: "160",
4541
+ height: "160"
4542
+ }),
4543
+ darkModeIcon: /*#__PURE__*/ jsx(IconCozIllusNoneDark, {
4544
+ width: "160",
4545
+ height: "160"
4546
+ }),
4547
+ title: i18n_I18n.t('no_data'),
4499
4548
  ...props
4500
4549
  });
4501
4550
  }
@@ -5660,6 +5709,9 @@ languages.register("typescript", typescript);
5660
5709
  languages.register('go', {
5661
5710
  language: goLanguage
5662
5711
  });
5712
+ languages.register('markdown', {
5713
+ language: markdownLanguage
5714
+ });
5663
5715
  themes.register('coze-light', cozeLight);
5664
5716
  themes.register('coze-dark', cozeDark);
5665
5717
  const minHeightOption = (value)=>EditorView.theme({
@@ -5695,6 +5747,20 @@ const lineHeightOption = (value)=>EditorView.theme({
5695
5747
  lineHeight: 'number' == typeof value ? `${value}px` : 'string' == typeof value ? value : 'unset'
5696
5748
  }
5697
5749
  });
5750
+ const backgroundColorOption = (value)=>EditorView.theme({
5751
+ '&.cm-editor': {
5752
+ backgroundColor: value ? `${value} !important` : 'unset'
5753
+ },
5754
+ '.cm-gutters': {
5755
+ backgroundColor: value ? `${value} !important` : 'unset'
5756
+ },
5757
+ '.cm-activeLineGutter': {
5758
+ backgroundColor: value ? `${value} !important` : 'unset'
5759
+ },
5760
+ '.cm-line': {
5761
+ backgroundColor: value ? `${value} !important` : 'unset'
5762
+ }
5763
+ });
5698
5764
  function createStyleOptions() {
5699
5765
  return [
5700
5766
  react_option('minHeight', minHeightOption),
@@ -5702,7 +5768,8 @@ function createStyleOptions() {
5702
5768
  react_option('editorHeight', heightOption),
5703
5769
  react_option('borderRadius', borderRadiusOption),
5704
5770
  react_option('padding', paddingOption),
5705
- react_option('lineHeight', lineHeightOption)
5771
+ react_option('lineHeight', lineHeightOption),
5772
+ react_option('backgroundColor', backgroundColorOption)
5706
5773
  ];
5707
5774
  }
5708
5775
  const builtinExtensions = [
@@ -5742,6 +5809,11 @@ const text_editor_lineHeightOption = (value)=>EditorView.theme({
5742
5809
  lineHeight: 'number' == typeof value ? `${value}px` : 'string' == typeof value ? value : 'unset'
5743
5810
  }
5744
5811
  });
5812
+ const text_editor_backgroundColorOption = (value)=>EditorView.theme({
5813
+ '.cm-content, .cm-gutter, .cm-right-gutter': {
5814
+ backgroundColor: value ? `${value} !important` : 'unset'
5815
+ }
5816
+ });
5745
5817
  const extensions = [
5746
5818
  mixLanguages({}),
5747
5819
  RawEditorTheme,
@@ -5754,7 +5826,8 @@ const extensions = [
5754
5826
  const CodeMirrorTextEditor = createRenderer([
5755
5827
  ...preset_universal,
5756
5828
  react_option('minHeight', text_editor_minHeightOption),
5757
- react_option('lineHeight', text_editor_lineHeightOption)
5829
+ react_option('lineHeight', text_editor_lineHeightOption),
5830
+ react_option('backgroundColor', text_editor_backgroundColorOption)
5758
5831
  ], extensions);
5759
5832
  const json_editor_extensions = [
5760
5833
  EditorView.theme({
@@ -5793,7 +5866,7 @@ const transformer = transformerCreator((text)=>{
5793
5866
  return text;
5794
5867
  });
5795
5868
  const CodeMirrorJsonEditor = /*#__PURE__*/ react.forwardRef((props, ref)=>{
5796
- const { value, onChange, placeholder, className, isDarkTheme, readonly, minHeight = '100px', maxHeight, editorHeight, padding, borderRadius, onFocus, onBlur } = props;
5869
+ const { value, onChange, placeholder, className, isDarkTheme, readonly, minHeight = '100px', maxHeight, editorHeight, padding, borderRadius, onFocus, onBlur, backgroundColor } = props;
5797
5870
  const apiRef = useRef(null);
5798
5871
  const handleChange = useCallback((e)=>{
5799
5872
  if ('function' == typeof onChange) onChange(e.value);
@@ -5846,7 +5919,8 @@ const CodeMirrorJsonEditor = /*#__PURE__*/ react.forwardRef((props, ref)=>{
5846
5919
  borderRadius,
5847
5920
  padding,
5848
5921
  fontSize: 13,
5849
- lineHeight: 20
5922
+ lineHeight: 20,
5923
+ backgroundColor
5850
5924
  },
5851
5925
  didMount: (api)=>apiRef.current = api,
5852
5926
  extensions: json_editor_extensions,
@@ -5857,7 +5931,7 @@ const CodeMirrorJsonEditor = /*#__PURE__*/ react.forwardRef((props, ref)=>{
5857
5931
  });
5858
5932
  });
5859
5933
  const CodeMirrorRawTextEditor = /*#__PURE__*/ forwardRef((props, ref)=>{
5860
- const { value, onChange, placeholder, className, minHeight, readonly } = props;
5934
+ const { value, onChange, placeholder, className, minHeight, readonly, backgroundColor } = props;
5861
5935
  const apiRef = useRef(null);
5862
5936
  const handleChange = useCallback((e)=>{
5863
5937
  if ('function' == typeof onChange) onChange(e.value);
@@ -5884,7 +5958,8 @@ const CodeMirrorRawTextEditor = /*#__PURE__*/ forwardRef((props, ref)=>{
5884
5958
  minHeight,
5885
5959
  fontSize: 13,
5886
5960
  editable: !readonly,
5887
- lineHeight: 20
5961
+ lineHeight: 20,
5962
+ backgroundColor
5888
5963
  },
5889
5964
  didMount: (api)=>apiRef.current = api
5890
5965
  })
@@ -5928,7 +6003,7 @@ const raw_code_editor_transformer = transformerCreator((text)=>{
5928
6003
  return text;
5929
6004
  });
5930
6005
  const CodeMirrorRawCodeEditor = /*#__PURE__*/ react.forwardRef((props, ref)=>{
5931
- const { value, onChange, placeholder, className, isDarkTheme, readonly, minHeight = '100px', maxHeight, editorHeight, padding, borderRadius, onFocus, onBlur, language = 'shell' } = props;
6006
+ const { value, onChange, placeholder, className, isDarkTheme, readonly, minHeight = '100px', maxHeight, editorHeight, padding, borderRadius, onFocus, onBlur, language = 'shell', backgroundColor } = props;
5932
6007
  const apiRef = useRef(null);
5933
6008
  const handleChange = useCallback((e)=>{
5934
6009
  if ('function' == typeof onChange) onChange(e.value);
@@ -5981,7 +6056,8 @@ const CodeMirrorRawCodeEditor = /*#__PURE__*/ react.forwardRef((props, ref)=>{
5981
6056
  borderRadius,
5982
6057
  padding,
5983
6058
  fontSize: 13,
5984
- lineHeight: 20
6059
+ lineHeight: 20,
6060
+ backgroundColor
5985
6061
  },
5986
6062
  didMount: (api)=>apiRef.current = api,
5987
6063
  extensions: raw_code_editor_extensions,
@@ -5991,23 +6067,37 @@ const CodeMirrorRawCodeEditor = /*#__PURE__*/ react.forwardRef((props, ref)=>{
5991
6067
  })
5992
6068
  });
5993
6069
  });
5994
- const SchemaEditor = ({ value, onChange, placeholder, readOnly, language, className })=>/*#__PURE__*/ jsx("div", {
5995
- className: classnames('w-full h-[500px] border border-solid coz-stroke-primary rounded-[4px] overflow-hidden relative bg-white', {
5996
- 'opacity-70': readOnly
6070
+ const SchemaEditor = ({ value, onChange, placeholder, readOnly, language, className, backgroundColor })=>/*#__PURE__*/ jsx("div", {
6071
+ className: classnames('w-full h-[500px] border border-solid border-[rgba(68,83,130,0.25)] rounded-[4px] overflow-hidden relative', {
6072
+ 'opacity-70': readOnly,
6073
+ 'bg-white': !backgroundColor
5997
6074
  }, className),
6075
+ style: backgroundColor ? {
6076
+ backgroundColor
6077
+ } : void 0,
5998
6078
  children: 'json' === language ? /*#__PURE__*/ jsx(CodeMirrorJsonEditor, {
5999
6079
  className: "w-full h-full overflow-y-auto",
6000
6080
  onChange: onChange,
6001
6081
  value: value || '',
6002
6082
  placeholder: placeholder,
6003
6083
  readonly: readOnly,
6004
- borderRadius: 4
6084
+ borderRadius: 4,
6085
+ backgroundColor: backgroundColor
6086
+ }) : language ? /*#__PURE__*/ jsx(CodeMirrorRawCodeEditor, {
6087
+ className: "w-full h-full overflow-y-auto",
6088
+ language: language,
6089
+ onChange: onChange,
6090
+ value: value || '',
6091
+ placeholder: placeholder,
6092
+ readonly: readOnly,
6093
+ backgroundColor: backgroundColor
6005
6094
  }) : /*#__PURE__*/ jsx(CodeMirrorRawTextEditor, {
6006
6095
  className: "w-full h-full overflow-y-auto",
6007
6096
  onChange: onChange,
6008
6097
  value: value || '',
6009
6098
  placeholder: placeholder,
6010
- readonly: readOnly
6099
+ readonly: readOnly,
6100
+ backgroundColor: backgroundColor
6011
6101
  })
6012
6102
  });
6013
6103
  const code_editor_with_loading_index_module = {
@@ -6078,12 +6168,255 @@ const CollapseItem = ({ children, open: defaultOpen, title, className })=>{
6078
6168
  ]
6079
6169
  });
6080
6170
  };
6081
- function src_useReportEvent() {
6082
- return (name, params)=>{
6083
- console.info(name, params);
6084
- };
6171
+ const audio_icon = __rslib_svgr_url__1__;
6172
+ function AudioRender({ audioUrl, audioName, className, showDownload, deletion, upload, size = 'small' }) {
6173
+ const [modalVisible, setModalVisible] = useState(false);
6174
+ const iconSizeCls = 'small' === size ? 'text-[14px]' : 'text-[20px]';
6175
+ return /*#__PURE__*/ jsxs("div", {
6176
+ className: "flex flex-col",
6177
+ onClick: (e)=>{
6178
+ e.stopPropagation();
6179
+ },
6180
+ children: [
6181
+ /*#__PURE__*/ jsxs("div", {
6182
+ className: classnames('inline-block relative group', 'small' === size ? 'w-[36px] h-[36px]' : 'w-[80px] h-[80px]', className),
6183
+ children: [
6184
+ upload?.status === 'error' ? /*#__PURE__*/ jsx("div", {
6185
+ className: classnames('w-full h-full flex items-center justify-center rounded-[6px] coz-mg-primary', 'border border-solid coz-stroke-hglt-red'),
6186
+ children: /*#__PURE__*/ jsx(IconCozImageBroken, {
6187
+ className: "text-[20px] coz-fg-dim"
6188
+ })
6189
+ }) : /*#__PURE__*/ jsx(Spin, {
6190
+ spinning: upload?.status === 'loading',
6191
+ wrapperClassName: "!w-full !h-full [&_.semi-spin-children]:w-full [&_.semi-spin-children]:h-full",
6192
+ children: /*#__PURE__*/ jsx("img", {
6193
+ src: audio_icon,
6194
+ alt: audioName,
6195
+ width: '100%',
6196
+ height: '100%',
6197
+ style: {
6198
+ objectFit: 'cover',
6199
+ objectPosition: 'center'
6200
+ }
6201
+ })
6202
+ }),
6203
+ /*#__PURE__*/ jsxs("div", {
6204
+ 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'),
6205
+ children: [
6206
+ upload?.status === 'error' ? /*#__PURE__*/ jsx(IconCozRefresh, {
6207
+ className: classnames('text-white cursor-pointer', iconSizeCls),
6208
+ onClick: upload?.onRetry
6209
+ }) : null,
6210
+ audioUrl && ![
6211
+ 'error',
6212
+ 'loading'
6213
+ ].includes(upload?.status || 'success') ? /*#__PURE__*/ jsx(IconCozPlayCircle, {
6214
+ className: classnames('text-white cursor-pointer', iconSizeCls),
6215
+ onClick: ()=>setModalVisible(true)
6216
+ }) : null,
6217
+ showDownload ? /*#__PURE__*/ jsx(IconCozDownload, {
6218
+ className: classnames('text-white cursor-pointer', iconSizeCls),
6219
+ onClick: ()=>{
6220
+ if (audioUrl) fileDownload(audioUrl, audioName || i18n_I18n.t('test'));
6221
+ }
6222
+ }) : null,
6223
+ isFunction(deletion) ? /*#__PURE__*/ jsx("div", {
6224
+ className: "absolute right-[-8px] top-[-8px] p-[2px] shrink-0 inline-flex justify-center items-center cursor-pointer",
6225
+ onClick: ()=>deletion(),
6226
+ children: /*#__PURE__*/ jsx(IconCozCrossCircleFillPalette, {})
6227
+ }) : null
6228
+ ]
6229
+ })
6230
+ ]
6231
+ }),
6232
+ /*#__PURE__*/ jsx(Modal, {
6233
+ visible: modalVisible,
6234
+ closable: false,
6235
+ title: /*#__PURE__*/ jsxs("div", {
6236
+ className: "w-full flex items-center justify-between",
6237
+ children: [
6238
+ /*#__PURE__*/ jsx(Typography.Title, {
6239
+ heading: 5,
6240
+ ellipsis: {
6241
+ showTooltip: true
6242
+ },
6243
+ children: audioName || i18n_I18n.t('audio')
6244
+ }),
6245
+ /*#__PURE__*/ jsxs("div", {
6246
+ className: "flex items-center gap-2",
6247
+ children: [
6248
+ /*#__PURE__*/ jsx(LoadingButton, {
6249
+ color: "primary",
6250
+ icon: /*#__PURE__*/ jsx(IconCozDownload, {}),
6251
+ onClick: async ()=>{
6252
+ if (audioUrl) await fileDownload(audioUrl, audioName || i18n_I18n.t('test'));
6253
+ },
6254
+ children: i18n_I18n.t('download')
6255
+ }),
6256
+ /*#__PURE__*/ jsx(IconButton, {
6257
+ size: "large",
6258
+ color: "secondary",
6259
+ className: "!w-[40px] !h-[40px]",
6260
+ icon: /*#__PURE__*/ jsx(IconCozCross, {}),
6261
+ onClick: ()=>setModalVisible(false)
6262
+ })
6263
+ ]
6264
+ })
6265
+ ]
6266
+ }),
6267
+ width: 800,
6268
+ onCancel: ()=>setModalVisible(false),
6269
+ children: /*#__PURE__*/ jsx(AudioPlayer, {
6270
+ autoPlay: false,
6271
+ audioUrl: audioUrl,
6272
+ theme: "light",
6273
+ skipDuration: 180,
6274
+ 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]')
6275
+ })
6276
+ })
6277
+ ]
6278
+ });
6279
+ }
6280
+ const video_icon = __rslib_svgr_url__2__;
6281
+ function VideoRender({ videoName, videoUrl, showDownload, deletion, upload, size = 'small', className }) {
6282
+ const [modalVisible, setModalVisible] = useState(false);
6283
+ const [videoElementStatus, setVideoElementStatus] = useState('loading');
6284
+ const iconSizeCls = 'small' === size ? 'text-[14px]' : 'text-[20px]';
6285
+ return /*#__PURE__*/ jsxs("div", {
6286
+ className: "flex flex-col",
6287
+ onClick: (e)=>{
6288
+ e.stopPropagation();
6289
+ },
6290
+ children: [
6291
+ /*#__PURE__*/ jsxs("div", {
6292
+ className: classnames('inline-block relative group', 'small' === size ? 'w-[36px] h-[36px]' : 'w-[80px] h-[80px]', className),
6293
+ children: [
6294
+ 'loading' === videoElementStatus || upload?.status === 'loading' ? /*#__PURE__*/ jsx(Spin, {
6295
+ spinning: true,
6296
+ wrapperClassName: "absolute inset-0",
6297
+ children: /*#__PURE__*/ jsx("img", {
6298
+ src: video_icon,
6299
+ className: "w-full h-full object-cover"
6300
+ })
6301
+ }) : null,
6302
+ 'error' === videoElementStatus || upload?.status === 'error' ? /*#__PURE__*/ jsx("div", {
6303
+ className: classnames('absolute inset-0 rounded-[6px] flex items-center justify-center coz-mg-primary', {
6304
+ 'border border-solid coz-stroke-hglt-red': upload?.status === 'error'
6305
+ }),
6306
+ children: /*#__PURE__*/ jsx(IconCozImageBroken, {
6307
+ className: classnames('text-[30px] coz-fg-dim')
6308
+ })
6309
+ }) : null,
6310
+ /*#__PURE__*/ jsx("video", {
6311
+ src: videoUrl,
6312
+ width: '100%',
6313
+ height: '100%',
6314
+ className: classnames('rounded-[6px] pointer-events-none', {
6315
+ invisible: 'loaded' !== videoElementStatus || [
6316
+ 'error',
6317
+ 'loading'
6318
+ ].includes(upload?.status || 'success')
6319
+ }),
6320
+ style: {
6321
+ objectFit: 'cover',
6322
+ objectPosition: 'center'
6323
+ },
6324
+ onLoadedData: ()=>setVideoElementStatus('loaded'),
6325
+ onError: ()=>setVideoElementStatus('error')
6326
+ }),
6327
+ /*#__PURE__*/ jsx("div", {
6328
+ className: classnames('absolute inset-0 flex items-center justify-center rounded-[6px]', 'bg-[rgba(0,0,0,0.2)]', 'group-hover:invisible', 'loaded' !== videoElementStatus || [
6329
+ 'error',
6330
+ 'loading'
6331
+ ].includes(upload?.status || 'success') ? 'invisible' : 'visible'),
6332
+ children: /*#__PURE__*/ jsx(IconCozPlayCircle, {
6333
+ className: classnames('coz-fg-hglt-plus', iconSizeCls)
6334
+ })
6335
+ }),
6336
+ /*#__PURE__*/ jsxs("div", {
6337
+ 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'),
6338
+ children: [
6339
+ upload?.status === 'error' ? /*#__PURE__*/ jsx(IconCozRefresh, {
6340
+ className: classnames('text-white cursor-pointer', iconSizeCls),
6341
+ onClick: upload?.onRetry
6342
+ }) : null,
6343
+ videoUrl && ![
6344
+ 'error',
6345
+ 'loading'
6346
+ ].includes(upload?.status || 'success') ? /*#__PURE__*/ jsx(IconCozPlayCircle, {
6347
+ className: classnames('text-white cursor-pointer', iconSizeCls),
6348
+ onClick: ()=>setModalVisible(true)
6349
+ }) : null,
6350
+ showDownload ? /*#__PURE__*/ jsx(IconCozDownload, {
6351
+ className: classnames('text-white cursor-pointer', iconSizeCls),
6352
+ onClick: ()=>{
6353
+ if (videoUrl) fileDownload(videoUrl, videoName || i18n_I18n.t('test'));
6354
+ }
6355
+ }) : null,
6356
+ isFunction(deletion) ? /*#__PURE__*/ jsx("div", {
6357
+ className: "absolute right-[-8px] top-[-8px] p-[2px] shrink-0 inline-flex justify-center items-center cursor-pointer",
6358
+ onClick: ()=>deletion(),
6359
+ children: /*#__PURE__*/ jsx(IconCozCrossCircleFillPalette, {})
6360
+ }) : null
6361
+ ]
6362
+ })
6363
+ ]
6364
+ }),
6365
+ /*#__PURE__*/ jsx(Modal, {
6366
+ visible: modalVisible,
6367
+ closable: false,
6368
+ className: "[&_div:has(>.semi-videoPlayer)]:overflow-hidden",
6369
+ title: /*#__PURE__*/ jsxs("div", {
6370
+ className: "w-full flex items-center justify-between",
6371
+ children: [
6372
+ /*#__PURE__*/ jsx(Typography.Title, {
6373
+ heading: 5,
6374
+ ellipsis: {
6375
+ showTooltip: true
6376
+ },
6377
+ children: videoName || i18n_I18n.t('video')
6378
+ }),
6379
+ /*#__PURE__*/ jsxs("div", {
6380
+ className: "flex items-center gap-2",
6381
+ children: [
6382
+ /*#__PURE__*/ jsx(LoadingButton, {
6383
+ color: "primary",
6384
+ icon: /*#__PURE__*/ jsx(IconCozDownload, {}),
6385
+ onClick: async ()=>{
6386
+ if (videoUrl) await fileDownload(videoUrl, videoName || i18n_I18n.t('test'));
6387
+ },
6388
+ children: i18n_I18n.t('download')
6389
+ }),
6390
+ /*#__PURE__*/ jsx(IconButton, {
6391
+ size: "large",
6392
+ color: "secondary",
6393
+ className: "!w-[40px] !h-[40px]",
6394
+ icon: /*#__PURE__*/ jsx(IconCozCross, {}),
6395
+ onClick: ()=>setModalVisible(false)
6396
+ })
6397
+ ]
6398
+ })
6399
+ ]
6400
+ }),
6401
+ width: 900,
6402
+ height: 600,
6403
+ onCancel: ()=>setModalVisible(false),
6404
+ children: /*#__PURE__*/ jsx(VideoPlayer, {
6405
+ className: "rounded-[8px] overflow-hidden",
6406
+ src: videoUrl || '',
6407
+ controlsList: [
6408
+ 'play',
6409
+ 'time',
6410
+ 'volume',
6411
+ 'playbackRate',
6412
+ 'fullscreen'
6413
+ ]
6414
+ })
6415
+ })
6416
+ ]
6417
+ });
6085
6418
  }
6086
6419
  var src_DEFAULT_FILE_COUNT = 20;
6087
6420
  var src_DEFAULT_PART_COUNT = 50;
6088
6421
  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 };
6422
+ export { AudioRender, 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, FoxIcon, FullPage, IDRender, IconButtonContainer, ImageItemRenderer, IndexControllerView, InfiniteScrollTable, InfoTooltip, InputSlider, InputWithCount, JumpIconButton, LargeTxtRender, Layout, LazyLoadComponent, LinkButton, 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, VideoRender, _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, type_ImageStatus as MultipartRenderStatus, upload_uploadFile as uploadFile, useBatchOperate, useItemIndexController, useUnsaveLeaveWarning };
@@ -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,4 +1,4 @@
1
- export declare const CodeMirrorCodeEditor: (props: import("@coze-editor/editor/react").InferRendererProps<(import("@coze-editor/editor/react").OptionPluginSpec<"editorHeight", string | number | undefined> | import("@coze-editor/editor/react").OptionPluginSpec<"borderRadius", string | number | undefined> | import("@coze-editor/editor/react").OptionPluginSpec<"padding", string | number | undefined> | import("@coze-editor/editor/react").OptionPluginSpec<"lineHeight", string | number | undefined> | import("@coze-editor/editor/react").ExtensionPluginSpec | import("@coze-editor/editor/react").OptionPluginSpec<"fontSize", number> | import("@coze-editor/editor/react").OptionPluginSpec<"placeholder", string | HTMLElement> | import("@coze-editor/editor/react").OptionPluginSpec<"readOnly", boolean> | import("@coze-editor/editor/react").OptionPluginSpec<"editable", boolean> | import("@coze-editor/editor/react").OptionPluginSpec<"lineWrapping", boolean> | import("@coze-editor/editor/react").OptionPluginSpec<"height", string | number> | import("@coze-editor/editor/react").OptionPluginSpec<"minHeight", string | number> | import("@coze-editor/editor/react").OptionPluginSpec<"maxHeight", string | number> | import("@coze-editor/editor/react").APIPluginSpec<"getValue", [], string> | import("@coze-editor/editor/react").APIPluginSpec<"setValue", [value: string], void> | import("@coze-editor/editor/react").APIPluginSpec<"replaceText", [options: {
1
+ export declare const CodeMirrorCodeEditor: (props: import("@coze-editor/editor/react").InferRendererProps<(import("@coze-editor/editor/react").OptionPluginSpec<"editorHeight", string | number | undefined> | import("@coze-editor/editor/react").OptionPluginSpec<"borderRadius", string | number | undefined> | import("@coze-editor/editor/react").OptionPluginSpec<"padding", string | number | undefined> | import("@coze-editor/editor/react").OptionPluginSpec<"lineHeight", string | number | undefined> | import("@coze-editor/editor/react").OptionPluginSpec<"backgroundColor", string | undefined> | import("@coze-editor/editor/react").ExtensionPluginSpec | import("@coze-editor/editor/react").OptionPluginSpec<"fontSize", number> | import("@coze-editor/editor/react").OptionPluginSpec<"placeholder", string | HTMLElement> | import("@coze-editor/editor/react").OptionPluginSpec<"readOnly", boolean> | import("@coze-editor/editor/react").OptionPluginSpec<"editable", boolean> | import("@coze-editor/editor/react").OptionPluginSpec<"lineWrapping", boolean> | import("@coze-editor/editor/react").OptionPluginSpec<"height", string | number> | import("@coze-editor/editor/react").OptionPluginSpec<"minHeight", string | number> | import("@coze-editor/editor/react").OptionPluginSpec<"maxHeight", string | number> | import("@coze-editor/editor/react").APIPluginSpec<"getValue", [], string> | import("@coze-editor/editor/react").APIPluginSpec<"setValue", [value: string], void> | import("@coze-editor/editor/react").APIPluginSpec<"replaceText", [options: {
2
2
  from: number;
3
3
  to: number;
4
4
  text: string;
@@ -14,6 +14,7 @@ interface BaseJsonEditorProps {
14
14
  borderRadius?: string | number;
15
15
  onFocus?: () => void;
16
16
  onBlur?: () => void;
17
+ backgroundColor?: string;
17
18
  }
18
19
  export declare const CodeMirrorJsonEditor: React.ForwardRefExoticComponent<BaseJsonEditorProps & React.RefAttributes<unknown>>;
19
20
  export {};
@@ -15,6 +15,7 @@ interface BaseCodeEditorProps {
15
15
  language?: string;
16
16
  onFocus?: () => void;
17
17
  onBlur?: () => void;
18
+ backgroundColor?: string;
18
19
  }
19
20
  export declare const CodeMirrorRawCodeEditor: React.ForwardRefExoticComponent<BaseCodeEditorProps & React.RefAttributes<unknown>>;
20
21
  export {};
@@ -6,6 +6,7 @@ interface CodeMirrorRawTextEditorProps {
6
6
  dataTestID?: string;
7
7
  placeholder?: string | HTMLElement;
8
8
  minHeight?: string | number;
9
+ backgroundColor?: string;
9
10
  }
10
11
  export declare const CodeMirrorRawTextEditor: import("react").ForwardRefExoticComponent<CodeMirrorRawTextEditorProps & import("react").RefAttributes<HTMLDivElement>>;
11
12
  export {};
@@ -1,4 +1,4 @@
1
- export declare const CodeMirrorTextEditor: (props: import("@coze-editor/editor/react").InferRendererProps<(import("@coze-editor/editor/react").OptionPluginSpec<"lineHeight", string | number | undefined> | import("@coze-editor/editor/react").ExtensionPluginSpec | import("@coze-editor/editor/react").OptionPluginSpec<"fontSize", number> | import("@coze-editor/editor/react").OptionPluginSpec<"placeholder", string | HTMLElement> | import("@coze-editor/editor/react").OptionPluginSpec<"readOnly", boolean> | import("@coze-editor/editor/react").OptionPluginSpec<"editable", boolean> | import("@coze-editor/editor/react").OptionPluginSpec<"lineWrapping", boolean> | import("@coze-editor/editor/react").OptionPluginSpec<"height", string | number> | import("@coze-editor/editor/react").OptionPluginSpec<"minHeight", string | number> | import("@coze-editor/editor/react").OptionPluginSpec<"maxHeight", string | number> | import("@coze-editor/editor/react").APIPluginSpec<"getValue", [], string> | import("@coze-editor/editor/react").APIPluginSpec<"getCursorPosition", [], number> | import("@coze-editor/editor/react").APIPluginSpec<"focus", [], void> | import("@coze-editor/editor/react").APIPluginSpec<"blur", [], void> | import("@coze-editor/editor/react").APIPluginSpec<"updateASTDecorations", [], void> | import("@coze-editor/editor/react").APIPluginSpec<"undo", [], void> | import("@coze-editor/editor/react").APIPluginSpec<"redo", [], void> | import("@coze-editor/editor/react").EventPluginSpec<"focus", symbol> | import("@coze-editor/editor/react").EventPluginSpec<"blur", symbol> | import("@coze-editor/editor/react").DOMEventHandlerPluginSpec<"mousedown"> | import("@coze-editor/editor/react").DOMEventHandlerPluginSpec<"mouseup"> | import("@coze-editor/editor/react").APIPluginSpec<"setValue", [value: string], void> | import("@coze-editor/editor/react").APIPluginSpec<"replaceText", [options: {
1
+ export declare const CodeMirrorTextEditor: (props: import("@coze-editor/editor/react").InferRendererProps<(import("@coze-editor/editor/react").OptionPluginSpec<"lineHeight", string | number | undefined> | import("@coze-editor/editor/react").OptionPluginSpec<"backgroundColor", string | undefined> | import("@coze-editor/editor/react").ExtensionPluginSpec | import("@coze-editor/editor/react").OptionPluginSpec<"fontSize", number> | import("@coze-editor/editor/react").OptionPluginSpec<"placeholder", string | HTMLElement> | import("@coze-editor/editor/react").OptionPluginSpec<"readOnly", boolean> | import("@coze-editor/editor/react").OptionPluginSpec<"editable", boolean> | import("@coze-editor/editor/react").OptionPluginSpec<"lineWrapping", boolean> | import("@coze-editor/editor/react").OptionPluginSpec<"height", string | number> | import("@coze-editor/editor/react").OptionPluginSpec<"minHeight", string | number> | import("@coze-editor/editor/react").OptionPluginSpec<"maxHeight", string | number> | import("@coze-editor/editor/react").APIPluginSpec<"getValue", [], string> | import("@coze-editor/editor/react").APIPluginSpec<"getCursorPosition", [], number> | import("@coze-editor/editor/react").APIPluginSpec<"focus", [], void> | import("@coze-editor/editor/react").APIPluginSpec<"blur", [], void> | import("@coze-editor/editor/react").APIPluginSpec<"updateASTDecorations", [], void> | import("@coze-editor/editor/react").APIPluginSpec<"undo", [], void> | import("@coze-editor/editor/react").APIPluginSpec<"redo", [], void> | import("@coze-editor/editor/react").EventPluginSpec<"focus", symbol> | import("@coze-editor/editor/react").EventPluginSpec<"blur", symbol> | import("@coze-editor/editor/react").DOMEventHandlerPluginSpec<"mousedown"> | import("@coze-editor/editor/react").DOMEventHandlerPluginSpec<"mouseup"> | import("@coze-editor/editor/react").APIPluginSpec<"setValue", [value: string], void> | import("@coze-editor/editor/react").APIPluginSpec<"replaceText", [options: {
2
2
  from: number;
3
3
  to: number;
4
4
  text: string;
@@ -1,8 +1,8 @@
1
1
  import { type DOMAttributes } from 'react';
2
- export declare function IconButtonContainer({ icon, className, style, onClick, active, disabled, ...rest }: {
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>): import("react/jsx-runtime").JSX.Element;
8
+ } & DOMAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
@@ -36,8 +36,10 @@ 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';
42
+ export { FoxIcon } from './ops-agent/fox-icon';
41
43
  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';
42
44
  export { RadioButton, type RadioButtonProps, } from './input-components/radio-button';
43
45
  export { LogicEditor, type LogicDataType, type LogicField, type LogicFilter, type LogicSetter, } from './logic-editor';
@@ -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 declare function useReportEvent(): (name: string, params: Record<string, unknown>) => void;
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,2 @@
1
+ export { AudioRender, type AudioRenderProps } from './audio-render';
2
+ export { VideoRender, type VideoRenderProps } from './video-render';
@@ -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;
@@ -0,0 +1,2 @@
1
+ /** OpsAGent 智能助手 Fox 的图标 */
2
+ export declare function FoxIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -6,6 +6,7 @@ interface SchemaEditorProps {
6
6
  placeholder?: string;
7
7
  showLineNumbs?: boolean;
8
8
  className?: string;
9
+ backgroundColor?: string;
9
10
  }
10
- export declare const SchemaEditor: ({ value, onChange, placeholder, readOnly, language, className, }: SchemaEditorProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const SchemaEditor: ({ value, onChange, placeholder, readOnly, language, className, backgroundColor, }: SchemaEditorProps) => import("react/jsx-runtime").JSX.Element;
11
12
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cozeloop/components",
3
- "version": "0.0.12-beta-1773633875853",
3
+ "version": "0.0.12-beta-1773728390343",
4
4
  "description": "common components for cozeloop",
5
5
  "author": "houtao.zzj@bytedance.com",
6
6
  "exports": {
@@ -30,14 +30,15 @@
30
30
  "@arco-iconbox/react-cozeloop-icons": "0.0.3",
31
31
  "@codemirror/commands": "^6.3.3",
32
32
  "@codemirror/lang-go": "^6.0.1",
33
+ "@codemirror/lang-markdown": "^6.3.2",
33
34
  "@codemirror/state": "^6.4.1",
34
35
  "@codemirror/view": "^6.34.1",
35
36
  "@coze-arch/coze-design": "0.0.7-alpha.5f0418",
36
- "@coze-editor/editor": "0.1.0-alpha.577152",
37
+ "@coze-editor/editor": "0.1.0-alpha.02803c",
37
38
  "@cozeloop/api-schema": "0.1.6",
38
- "@cozeloop/config-provider": "0.0.12-beta-1773633875853",
39
+ "@cozeloop/config-provider": "0.0.12-beta-1773728390343",
39
40
  "@cozeloop/hooks": "0.0.1",
40
- "@cozeloop/i18n": "0.0.12-beta-1773633875853",
41
+ "@cozeloop/i18n": "0.0.12-beta-1773728390343",
41
42
  "@cozeloop/toolkit": "0.0.5",
42
43
  "@monaco-editor/react": "^4.5.2",
43
44
  "@rjsf/core": "~5.24.9",