@cozeloop/components 0.0.12-beta-1378.344125032425 → 0.0.12-beta-1782717209548
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 +11 -0
- package/dist/es/index.mjs +54 -1
- package/dist/lib/code-editor/index.d.ts +3 -0
- package/dist/lib/code-editor-with-loading/index.d.ts +10 -0
- package/dist/lib/codemirror-editor/code-editor.d.ts +23 -2
- package/dist/lib/codemirror-editor/text-editor.d.ts +23 -2
- package/dist/lib/index.d.ts +2 -0
- package/package.json +12 -30
- package/dist/lib/base-search-select/base-search-form-select.js +0 -6
- package/dist/lib/base-search-select/base-search-form-select.js.map +0 -1
- package/dist/lib/base-search-select/base-search-select.js +0 -130
- package/dist/lib/base-search-select/base-search-select.js.map +0 -1
- package/dist/lib/base-search-select/index.js +0 -3
- package/dist/lib/base-search-select/index.js.map +0 -1
- package/dist/lib/base-search-select/types.js +0 -2
- package/dist/lib/base-search-select/types.js.map +0 -1
- package/dist/lib/base-search-select/utils.js +0 -48
- package/dist/lib/base-search-select/utils.js.map +0 -1
- package/dist/lib/basic-card/index.js +0 -4
- package/dist/lib/basic-card/index.js.map +0 -1
- package/dist/lib/card-pane/index.js +0 -9
- package/dist/lib/card-pane/index.js.map +0 -1
- package/dist/lib/chip-select/index.js +0 -6
- package/dist/lib/chip-select/index.js.map +0 -1
- package/dist/lib/codemirror-editor/code-editor.js +0 -135
- package/dist/lib/codemirror-editor/code-editor.js.map +0 -1
- package/dist/lib/codemirror-editor/index.js +0 -7
- package/dist/lib/codemirror-editor/index.js.map +0 -1
- package/dist/lib/codemirror-editor/json-editor.js +0 -104
- package/dist/lib/codemirror-editor/json-editor.js.map +0 -1
- package/dist/lib/codemirror-editor/raw-code-editor.js +0 -104
- package/dist/lib/codemirror-editor/raw-code-editor.js.map +0 -1
- package/dist/lib/codemirror-editor/raw-text-editor.js +0 -33
- package/dist/lib/codemirror-editor/raw-text-editor.js.map +0 -1
- package/dist/lib/codemirror-editor/text-editor.js +0 -50
- package/dist/lib/codemirror-editor/text-editor.js.map +0 -1
- package/dist/lib/codemirror-editor/themes/coze-dark.js +0 -113
- package/dist/lib/codemirror-editor/themes/coze-dark.js.map +0 -1
- package/dist/lib/codemirror-editor/themes/coze-light.js +0 -119
- package/dist/lib/codemirror-editor/themes/coze-light.js.map +0 -1
- package/dist/lib/collapse-card/index.js +0 -31
- package/dist/lib/collapse-card/index.js.map +0 -1
- package/dist/lib/collapse-item/index.js +0 -9
- package/dist/lib/collapse-item/index.js.map +0 -1
- package/dist/lib/collapsible-card/index.js +0 -13
- package/dist/lib/collapsible-card/index.js.map +0 -1
- package/dist/lib/column-manage-storage/index.js +0 -48
- package/dist/lib/column-manage-storage/index.js.map +0 -1
- package/dist/lib/columns-select/index.js +0 -78
- package/dist/lib/columns-select/index.js.map +0 -1
- package/dist/lib/copyable/index.js +0 -12
- package/dist/lib/copyable/index.js.map +0 -1
- package/dist/lib/edit-icon-button/index.js +0 -13
- package/dist/lib/edit-icon-button/index.js.map +0 -1
- package/dist/lib/footer-actions/index.js +0 -8
- package/dist/lib/footer-actions/index.js.map +0 -1
- package/dist/lib/hooks/use-infinite-scroll.js +0 -133
- package/dist/lib/hooks/use-infinite-scroll.js.map +0 -1
- package/dist/lib/hooks/use-mouse-down-offset.js +0 -39
- package/dist/lib/hooks/use-mouse-down-offset.js.map +0 -1
- package/dist/lib/hooks/use-unsave-leave-warning.js +0 -26
- package/dist/lib/hooks/use-unsave-leave-warning.js.map +0 -1
- package/dist/lib/id-render/icon-button-container.js +0 -7
- package/dist/lib/id-render/icon-button-container.js.map +0 -1
- package/dist/lib/id-render/index.js +0 -22
- package/dist/lib/id-render/index.js.map +0 -1
- package/dist/lib/index-controller/record-navigation.js +0 -10
- package/dist/lib/index-controller/record-navigation.js.map +0 -1
- package/dist/lib/index-controller/use-item-index-controller.js +0 -123
- package/dist/lib/index-controller/use-item-index-controller.js.map +0 -1
- package/dist/lib/index.js +0 -77
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/infinite-scroll-table/index.js +0 -35
- package/dist/lib/infinite-scroll-table/index.js.map +0 -1
- package/dist/lib/info-tooltip/index.js +0 -9
- package/dist/lib/info-tooltip/index.js.map +0 -1
- package/dist/lib/input-components/radio-button.js +0 -21
- package/dist/lib/input-components/radio-button.js.map +0 -1
- package/dist/lib/input-slider/index.js +0 -81
- package/dist/lib/input-slider/index.js.map +0 -1
- package/dist/lib/input-with-count/index.js +0 -7
- package/dist/lib/input-with-count/index.js.map +0 -1
- package/dist/lib/jump-button/jump-icon-button.js +0 -7
- package/dist/lib/jump-button/jump-icon-button.js.map +0 -1
- package/dist/lib/large-txt-render/index.js +0 -27
- package/dist/lib/large-txt-render/index.js.map +0 -1
- package/dist/lib/layout/content.js +0 -5
- package/dist/lib/layout/content.js.map +0 -1
- package/dist/lib/layout/header.js +0 -6
- package/dist/lib/layout/header.js.map +0 -1
- package/dist/lib/layout/index.js +0 -9
- package/dist/lib/layout/index.js.map +0 -1
- package/dist/lib/layout/tabs.js +0 -10
- package/dist/lib/layout/tabs.js.map +0 -1
- package/dist/lib/lazy-load-component/index.js +0 -42
- package/dist/lib/lazy-load-component/index.js.map +0 -1
- package/dist/lib/link-button/index.js +0 -23
- package/dist/lib/link-button/index.js.map +0 -1
- package/dist/lib/logic-editor/index.js +0 -3
- package/dist/lib/logic-editor/index.js.map +0 -1
- package/dist/lib/logic-editor/logic-editor.js +0 -70
- package/dist/lib/logic-editor/logic-editor.js.map +0 -1
- package/dist/lib/logic-editor/logic-left-render.js +0 -62
- package/dist/lib/logic-editor/logic-left-render.js.map +0 -1
- package/dist/lib/logic-editor/logic-operator-render.js +0 -31
- package/dist/lib/logic-editor/logic-operator-render.js.map +0 -1
- package/dist/lib/logic-editor/logic-right-render.js +0 -26
- package/dist/lib/logic-editor/logic-right-render.js.map +0 -1
- package/dist/lib/logic-editor/logic-types.js +0 -144
- package/dist/lib/logic-editor/logic-types.js.map +0 -1
- package/dist/lib/logic-editor/utils.js +0 -18
- package/dist/lib/logic-editor/utils.js.map +0 -1
- package/dist/lib/logic-expr/consts.js +0 -5
- package/dist/lib/logic-expr/consts.js.map +0 -1
- package/dist/lib/logic-expr/expr-group-render.js +0 -60
- package/dist/lib/logic-expr/expr-group-render.js.map +0 -1
- package/dist/lib/logic-expr/expr-render.js +0 -84
- package/dist/lib/logic-expr/expr-render.js.map +0 -1
- package/dist/lib/logic-expr/index.js +0 -2
- package/dist/lib/logic-expr/index.js.map +0 -1
- package/dist/lib/logic-expr/logic-expr.js +0 -187
- package/dist/lib/logic-expr/logic-expr.js.map +0 -1
- package/dist/lib/logic-expr/logic-not.js +0 -20
- package/dist/lib/logic-expr/logic-not.js.map +0 -1
- package/dist/lib/logic-expr/logic-toggle.js +0 -32
- package/dist/lib/logic-expr/logic-toggle.js.map +0 -1
- package/dist/lib/logic-expr/types.js +0 -2
- package/dist/lib/logic-expr/types.js.map +0 -1
- package/dist/lib/loop-icons/index.js +0 -3
- package/dist/lib/loop-icons/index.js.map +0 -1
- package/dist/lib/loop-radio-group/index.js +0 -7
- package/dist/lib/loop-radio-group/index.js.map +0 -1
- package/dist/lib/multi-modal-dataset-item-render/audio-render/index.js +0 -34
- package/dist/lib/multi-modal-dataset-item-render/audio-render/index.js.map +0 -1
- package/dist/lib/multi-modal-dataset-item-render/index.js +0 -3
- package/dist/lib/multi-modal-dataset-item-render/index.js.map +0 -1
- package/dist/lib/multi-modal-dataset-item-render/video-render/index.js +0 -47
- package/dist/lib/multi-modal-dataset-item-render/video-render/index.js.map +0 -1
- package/dist/lib/multi-part-editor/components/image-item-renderer.js +0 -58
- package/dist/lib/multi-part-editor/components/image-item-renderer.js.map +0 -1
- package/dist/lib/multi-part-editor/components/multipart-item-renderer.js +0 -26
- package/dist/lib/multi-part-editor/components/multipart-item-renderer.js.map +0 -1
- package/dist/lib/multi-part-editor/components/url-input-modal.js +0 -151
- package/dist/lib/multi-part-editor/components/url-input-modal.js.map +0 -1
- package/dist/lib/multi-part-editor/components/video-item-renderer.js +0 -58
- package/dist/lib/multi-part-editor/components/video-item-renderer.js.map +0 -1
- package/dist/lib/multi-part-editor/index.js +0 -301
- package/dist/lib/multi-part-editor/index.js.map +0 -1
- package/dist/lib/multi-part-editor/multi-part-render.js +0 -40
- package/dist/lib/multi-part-editor/multi-part-render.js.map +0 -1
- package/dist/lib/multi-part-editor/type.js +0 -27
- package/dist/lib/multi-part-editor/type.js.map +0 -1
- package/dist/lib/multi-part-editor/upload-button.js +0 -104
- package/dist/lib/multi-part-editor/upload-button.js.map +0 -1
- package/dist/lib/multi-part-editor/utils.js +0 -43
- package/dist/lib/multi-part-editor/utils.js.map +0 -1
- package/dist/lib/open-detail-button/index.js +0 -12
- package/dist/lib/open-detail-button/index.js.map +0 -1
- package/dist/lib/ops-agent/fox-icon.js +0 -8
- package/dist/lib/ops-agent/fox-icon.js.map +0 -1
- package/dist/lib/page-content/index.js +0 -24
- package/dist/lib/page-content/index.js.map +0 -1
- package/dist/lib/primary-page/index.js +0 -2
- package/dist/lib/primary-page/index.js.map +0 -1
- package/dist/lib/primary-page/primary-header.js +0 -4
- package/dist/lib/primary-page/primary-header.js.map +0 -1
- package/dist/lib/primary-title/index.js +0 -8
- package/dist/lib/primary-title/index.js.map +0 -1
- package/dist/lib/resizable-side-sheet/index.js +0 -32
- package/dist/lib/resizable-side-sheet/index.js.map +0 -1
- package/dist/lib/resize-sidesheet/index.js +0 -15
- package/dist/lib/resize-sidesheet/index.js.map +0 -1
- package/dist/lib/resize-sidesheet/use-drag.js +0 -30
- package/dist/lib/resize-sidesheet/use-drag.js.map +0 -1
- package/dist/lib/schema-editor/index.js +0 -5
- package/dist/lib/schema-editor/index.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/array-field-item.js +0 -19
- package/dist/lib/semi-schema-form/components/tmpls/array-field-item.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/array-field.js +0 -39
- package/dist/lib/semi-schema-form/components/tmpls/array-field.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/base-input.js +0 -32
- package/dist/lib/semi-schema-form/components/tmpls/base-input.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/description-field.js +0 -13
- package/dist/lib/semi-schema-form/components/tmpls/description-field.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/error-list.js +0 -14
- package/dist/lib/semi-schema-form/components/tmpls/error-list.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/field-error.js +0 -16
- package/dist/lib/semi-schema-form/components/tmpls/field-error.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/field.js +0 -21
- package/dist/lib/semi-schema-form/components/tmpls/field.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/icon-button.js +0 -29
- package/dist/lib/semi-schema-form/components/tmpls/icon-button.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/index.js +0 -31
- package/dist/lib/semi-schema-form/components/tmpls/index.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/object-field.js +0 -81
- package/dist/lib/semi-schema-form/components/tmpls/object-field.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/submit.js +0 -13
- package/dist/lib/semi-schema-form/components/tmpls/submit.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/title-field.js +0 -12
- package/dist/lib/semi-schema-form/components/tmpls/title-field.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/checkbox.js +0 -26
- package/dist/lib/semi-schema-form/components/widgets/checkbox.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/checkboxs.js +0 -27
- package/dist/lib/semi-schema-form/components/widgets/checkboxs.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/index.js +0 -15
- package/dist/lib/semi-schema-form/components/widgets/index.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/radio.js +0 -27
- package/dist/lib/semi-schema-form/components/widgets/radio.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/range.js +0 -26
- package/dist/lib/semi-schema-form/components/widgets/range.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/select.js +0 -44
- package/dist/lib/semi-schema-form/components/widgets/select.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/textarea.js +0 -18
- package/dist/lib/semi-schema-form/components/widgets/textarea.js.map +0 -1
- package/dist/lib/semi-schema-form/index.js +0 -9
- package/dist/lib/semi-schema-form/index.js.map +0 -1
- package/dist/lib/sentinel-form/enum.js +0 -15
- package/dist/lib/sentinel-form/enum.js.map +0 -1
- package/dist/lib/sentinel-form/index.js +0 -323
- package/dist/lib/sentinel-form/index.js.map +0 -1
- package/dist/lib/step-nav/index.js +0 -13
- package/dist/lib/step-nav/index.js.map +0 -1
- package/dist/lib/table/index.js +0 -7
- package/dist/lib/table/index.js.map +0 -1
- package/dist/lib/table/sort-icon.js +0 -31
- package/dist/lib/table/sort-icon.js.map +0 -1
- package/dist/lib/table/table-with-pagination.js +0 -74
- package/dist/lib/table/table-with-pagination.js.map +0 -1
- package/dist/lib/table/table-without-pagniation.js +0 -37
- package/dist/lib/table/table-without-pagniation.js.map +0 -1
- package/dist/lib/table-batch-operate/table-batch-operation.js +0 -17
- package/dist/lib/table-batch-operate/table-batch-operation.js.map +0 -1
- package/dist/lib/table-batch-operate/use-batch-operate.js +0 -71
- package/dist/lib/table-batch-operate/use-batch-operate.js.map +0 -1
- package/dist/lib/table-col-actions/index.js +0 -39
- package/dist/lib/table-col-actions/index.js.map +0 -1
- package/dist/lib/table-cols-config/index.js +0 -60
- package/dist/lib/table-cols-config/index.js.map +0 -1
- package/dist/lib/table-cols-config/type.js +0 -2
- package/dist/lib/table-cols-config/type.js.map +0 -1
- package/dist/lib/table-cols-config/use-hidden-col-keys.js +0 -32
- package/dist/lib/table-cols-config/use-hidden-col-keys.js.map +0 -1
- package/dist/lib/table-cols-config/util.js +0 -39
- package/dist/lib/table-cols-config/util.js.map +0 -1
- package/dist/lib/table-empty/index.js +0 -9
- package/dist/lib/table-empty/index.js.map +0 -1
- package/dist/lib/table-header/index.js +0 -12
- package/dist/lib/table-header/index.js.map +0 -1
- package/dist/lib/tabs/index.js +0 -9
- package/dist/lib/tabs/index.js.map +0 -1
- package/dist/lib/text-area-pro/index.js +0 -10
- package/dist/lib/text-area-pro/index.js.map +0 -1
- package/dist/lib/text-with-copy/index.js +0 -25
- package/dist/lib/text-with-copy/index.js.map +0 -1
- package/dist/lib/title-with-sub/index.js +0 -6
- package/dist/lib/title-with-sub/index.js.map +0 -1
- package/dist/lib/tooltip-when-disabled/index.js +0 -9
- package/dist/lib/tooltip-when-disabled/index.js.map +0 -1
- package/dist/lib/tooltip-with-disabled/index.js +0 -9
- package/dist/lib/tooltip-with-disabled/index.js.map +0 -1
- package/dist/lib/tsconfig.build.tsbuildinfo +0 -1
- package/dist/lib/upload/index.js +0 -25
- package/dist/lib/upload/index.js.map +0 -1
- package/dist/lib/user-profile/index.js +0 -21
- package/dist/lib/user-profile/index.js.map +0 -1
- package/dist/lib/utils/basic.js +0 -30
- package/dist/lib/utils/basic.js.map +0 -1
- package/dist/lib/version-list/version-descriptions.js +0 -15
- package/dist/lib/version-list/version-descriptions.js.map +0 -1
- package/dist/lib/version-list/version-item.js +0 -6
- package/dist/lib/version-list/version-item.js.map +0 -1
- package/dist/lib/version-list/version-list.js +0 -12
- package/dist/lib/version-list/version-list.js.map +0 -1
- package/dist/lib/version-list/version-switch-panel.js +0 -11
- package/dist/lib/version-list/version-switch-panel.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/multi-part-editor/type.tsx"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAOtC,OAAO,EAAE,aAAa,EAAuB,MAAM,2BAA2B,CAAC;AAE/E,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACn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AgB,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC;IAC7D,CAAC,aAAa,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,CAAC,CACvC,4CAA4C,CAC7C;CACF,CAAC,CAAC"}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
/* eslint-disable @coze-arch/max-line-per-function */
|
|
3
|
-
import { I18n } from '@cozeloop/i18n';
|
|
4
|
-
import { forwardRef, useCallback, useImperativeHandle, useRef } from 'react';
|
|
5
|
-
import { ContentType } from '@cozeloop/api-schema/prompt';
|
|
6
|
-
import { IconCozImage, IconCozImageArrowUp, IconCozVideo, } from '@coze-arch/coze-design/icons';
|
|
7
|
-
import { IconButton, Menu, Toast, Upload, } from '@coze-arch/coze-design';
|
|
8
|
-
export const UploadButton = forwardRef(({ spaceID, disabled, maxImageSize, maxVideoSize, maxFileCount, uploadFile, imageEnabled, videoEnabled, imageSupportedFormats, videoSupportedFormats, fileLimit, fileParts = [], onFilePartsChange, }, ref) => {
|
|
9
|
-
const uploadImgRef = useRef(null);
|
|
10
|
-
const uploadVideoRef = useRef(null);
|
|
11
|
-
const createUploadHandler = (fileType) => ({ fileInstance, file, onProgress, onSuccess, onError }) => {
|
|
12
|
-
const currentFileType = fileType;
|
|
13
|
-
const { uid } = file;
|
|
14
|
-
const reader = new FileReader();
|
|
15
|
-
reader.readAsDataURL(fileInstance);
|
|
16
|
-
reader.onload = async () => {
|
|
17
|
-
const base64Url = reader.result;
|
|
18
|
-
const partInfo = currentFileType === 'image'
|
|
19
|
-
? { image_url: { url: file.url, thumb_url: base64Url } }
|
|
20
|
-
: { video_url: { url: file.url, thumb_url: base64Url } };
|
|
21
|
-
const part = {
|
|
22
|
-
type: currentFileType === 'image'
|
|
23
|
-
? ContentType.ImageURL
|
|
24
|
-
: ContentType.VideoURL,
|
|
25
|
-
...partInfo,
|
|
26
|
-
status: 'uploading',
|
|
27
|
-
uid,
|
|
28
|
-
};
|
|
29
|
-
try {
|
|
30
|
-
onFilePartsChange?.(part);
|
|
31
|
-
const res = await uploadFile?.({
|
|
32
|
-
spaceID,
|
|
33
|
-
file: fileInstance,
|
|
34
|
-
fileType: 'image', // 不管是视频还是图片,都走imageX上传,所以fileType必须都是image
|
|
35
|
-
onProgress,
|
|
36
|
-
onSuccess,
|
|
37
|
-
onError,
|
|
38
|
-
});
|
|
39
|
-
const fileInfo = currentFileType === 'image'
|
|
40
|
-
? {
|
|
41
|
-
image_url: {
|
|
42
|
-
url: file.url,
|
|
43
|
-
uri: res,
|
|
44
|
-
thumb_url: base64Url,
|
|
45
|
-
},
|
|
46
|
-
}
|
|
47
|
-
: {
|
|
48
|
-
video_url: {
|
|
49
|
-
url: file.url,
|
|
50
|
-
uri: res,
|
|
51
|
-
thumb_url: base64Url,
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
const newPart = {
|
|
55
|
-
...part,
|
|
56
|
-
...fileInfo,
|
|
57
|
-
status: 'success',
|
|
58
|
-
};
|
|
59
|
-
onFilePartsChange?.(newPart);
|
|
60
|
-
}
|
|
61
|
-
catch (error) {
|
|
62
|
-
console.info('error', error);
|
|
63
|
-
Toast.error(I18n.t('image_upload_error'));
|
|
64
|
-
onFilePartsChange?.({
|
|
65
|
-
...part,
|
|
66
|
-
status: 'uploadFail',
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
const renderImageUpload = useCallback((children) => (_jsx(Upload, { ref: uploadImgRef, action: "", customRequest: createUploadHandler('image'), accept: imageSupportedFormats?.join(',') || 'image/*', showUploadList: false, maxSize: maxImageSize ? maxImageSize * 1024 * 1024 : 0, limit: fileLimit, onSizeError: () => Toast.error(`${I18n.t('image_size_exceed_max', { maxImageSize })}`), onExceed: () => Toast.warning(`${I18n.t('max_upload_images_limit', { maxFileCount })}`), multiple: true, fileList: fileParts.map(it => ({
|
|
72
|
-
uid: it.uid || '',
|
|
73
|
-
url: it.image_url?.url,
|
|
74
|
-
status: it.status || 'success',
|
|
75
|
-
name: it.uid || '',
|
|
76
|
-
size: '0',
|
|
77
|
-
})), children: children })), [fileParts, maxImageSize, fileLimit, imageSupportedFormats]);
|
|
78
|
-
const renderVideoUpload = useCallback((children) => (_jsx(Upload, { ref: uploadVideoRef, action: "", customRequest: createUploadHandler('video'), accept: videoSupportedFormats?.join(',') || 'video/*', showUploadList: false, maxSize: maxVideoSize ? maxVideoSize * 1024 : 0, limit: fileLimit, onSizeError: () => Toast.error(`${I18n.t('video_size_exceed_max', { maxVideoSize })}`), onExceed: () => Toast.warning(`${I18n.t('max_upload_videos_limit', { maxFileCount })}`), multiple: true, fileList: fileParts.map(it => ({
|
|
79
|
-
uid: it.uid || '',
|
|
80
|
-
url: it.video_url?.url,
|
|
81
|
-
status: it.status || 'success',
|
|
82
|
-
name: it.uid || '',
|
|
83
|
-
size: '0',
|
|
84
|
-
})), children: children })), [fileParts, maxVideoSize, fileLimit, videoSupportedFormats]);
|
|
85
|
-
useImperativeHandle(ref, () => ({
|
|
86
|
-
getUploadImage: () => uploadImgRef.current,
|
|
87
|
-
getUploadVideo: () => uploadVideoRef.current,
|
|
88
|
-
}));
|
|
89
|
-
if (!imageEnabled && !videoEnabled) {
|
|
90
|
-
return null;
|
|
91
|
-
}
|
|
92
|
-
if (imageEnabled && !videoEnabled) {
|
|
93
|
-
return renderImageUpload(_jsx(IconButton, { icon: _jsx(IconCozImage, {}), color: "primary", disabled: disabled, "data-btm": "d41383", "data-btm-title": I18n.t('image_upload') }));
|
|
94
|
-
}
|
|
95
|
-
if (!imageEnabled && videoEnabled) {
|
|
96
|
-
return renderVideoUpload(_jsx(IconButton, { icon: _jsx(IconCozVideo, {}), color: "primary", disabled: disabled, "data-btm": "d27622", "data-btm-title": I18n.t('video_upload') }));
|
|
97
|
-
}
|
|
98
|
-
return (_jsxs(_Fragment, { children: [_jsx(Menu, { render: _jsxs(Menu.SubMenu, { mode: "menu", children: [_jsx(Menu.Item, { onClick: () => {
|
|
99
|
-
uploadImgRef.current?.openFileDialog();
|
|
100
|
-
}, "data-btm": "d41383", "data-btm-title": I18n.t('image_upload'), children: I18n.t('image_upload') }), _jsx(Menu.Item, { onClick: () => {
|
|
101
|
-
uploadVideoRef.current?.openFileDialog();
|
|
102
|
-
}, "data-btm": "d27622", "data-btm-title": I18n.t('video_upload'), children: I18n.t('video_upload') })] }), children: _jsx(IconButton, { icon: _jsx(IconCozImageArrowUp, {}), color: "primary", disabled: disabled }) }), renderImageUpload(null), renderVideoUpload(null)] }));
|
|
103
|
-
});
|
|
104
|
-
//# sourceMappingURL=upload-button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload-button.js","sourceRoot":"","sources":["../../../src/multi-part-editor/upload-button.tsx"],"names":[],"mappings":";AAAA,qDAAqD;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,YAAY,GACb,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,UAAU,EACV,IAAI,EACJ,KAAK,EACL,MAAM,GAEP,MAAM,wBAAwB,CAAC;AAyBhC,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CACpC,CACE,EACE,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,qBAAqB,EACrB,SAAS,EACT,SAAS,GAAG,EAAE,EACd,iBAAiB,GACF,EACjB,GAAG,EACH,EAAE;IACF,MAAM,YAAY,GAAG,MAAM,CAAS,IAAI,CAAC,CAAC;IAC1C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C,GACtC,CACH,CAAC;IACJ,CAAC;IAED,OAAO,CACL,8BACE,KAAC,IAAI,IACH,MAAM,EACJ,MAAC,IAAI,CAAC,OAAO,IAAC,IAAI,EAAC,MAAM,aACvB,KAAC,IAAI,CAAC,IAAI,IACR,OAAO,EAAE,GAAG,EAAE;gCACZ,YAAY,CAAC,OAAO,EAAE,cAAc,EAAE,CAAC;4BACzC,CAAC,cACQ,QAAQ,oBACD,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,YAErC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,GACb,EACZ,KAAC,IAAI,CAAC,IAAI,IACR,OAAO,EAAE,GAAG,EAAE;gCACZ,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,CAAC;4BAC3C,CAAC,cACQ,QAAQ,oBACD,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,YAErC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,GACb,IACC,YAGjB,KAAC,UAAU,IACT,IAAI,EAAE,KAAC,mBAAmB,KAAG,EAC7B,KAAK,EAAC,SAAS,EACf,QAAQ,EAAE,QAAQ,GAClB,GACG,EACN,iBAAiB,CAAC,IAAI,CAAC,EACvB,iBAAiB,CAAC,IAAI,CAAC,IACvB,CACJ,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export const DEFAULT_FILE_SIZE = 20 * 1024 * 1024;
|
|
2
|
-
export const DEFAULT_FILE_COUNT = 20;
|
|
3
|
-
export const DEFAULT_PART_COUNT = 50;
|
|
4
|
-
export const DEFAULT_SUPPORTED_FORMATS = [
|
|
5
|
-
'.jpg',
|
|
6
|
-
'.jpeg',
|
|
7
|
-
'.png',
|
|
8
|
-
'.gif',
|
|
9
|
-
'.bmp',
|
|
10
|
-
'.webp',
|
|
11
|
-
];
|
|
12
|
-
export const DEFAULT_VIDEO_SUPPORTED_FORMATS = [
|
|
13
|
-
'.mp4',
|
|
14
|
-
'.avi',
|
|
15
|
-
'.mov',
|
|
16
|
-
'.wmv',
|
|
17
|
-
'.flv',
|
|
18
|
-
'.mkv',
|
|
19
|
-
];
|
|
20
|
-
export const getMultipartConfig = (multipartConfig) => {
|
|
21
|
-
const { max_file_count, max_part_count, max_file_size, imageEnabled, videoEnabled, imageSupportedFormats, videoSupportedFormats, maxVideoSize, } = multipartConfig || {};
|
|
22
|
-
const maxFileCount = max_file_count
|
|
23
|
-
? Number(max_file_count)
|
|
24
|
-
: DEFAULT_FILE_COUNT;
|
|
25
|
-
const maxPartCount = max_part_count
|
|
26
|
-
? Number(max_part_count)
|
|
27
|
-
: DEFAULT_PART_COUNT;
|
|
28
|
-
const trueMaxFileCount = maxFileCount > maxPartCount ? maxPartCount : maxFileCount;
|
|
29
|
-
const maxFileSize = max_file_size ? Number(max_file_size) : DEFAULT_FILE_SIZE;
|
|
30
|
-
const currentImageSupportedFormats = (imageSupportedFormats?.map(format => format.startsWith('.') ? format : `.${format}`) || DEFAULT_SUPPORTED_FORMATS).join(',');
|
|
31
|
-
const currentVideoSupportedFormats = (videoSupportedFormats?.map(format => format.startsWith('.') ? format : `.${format}`) || DEFAULT_VIDEO_SUPPORTED_FORMATS).join(',');
|
|
32
|
-
return {
|
|
33
|
-
maxFileCount: trueMaxFileCount,
|
|
34
|
-
maxPartCount,
|
|
35
|
-
maxFileSize,
|
|
36
|
-
imageEnabled,
|
|
37
|
-
videoEnabled,
|
|
38
|
-
imageSupportedFormats: currentImageSupportedFormats,
|
|
39
|
-
videoSupportedFormats: currentVideoSupportedFormats,
|
|
40
|
-
maxVideoSize,
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/multi-part-editor/utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAClD,M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AqB,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAClC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAC/C,IAAI,+BAA+B,CACrC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,OAAO;QACL,YAAY,EAAE,gBAAgB;QAC9B,YAAY;QACZ,WAAW;QACX,YAAY;QACZ,YAAY;QACZ,qBAAqB,EAAE,4BAA4B;QACnD,qBAAqB,EAAE,4BAA4B;QACnD,YAAY;KACb,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { I18n } from '@cozeloop/i18n';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import { IconCozLongArrowTopRight } from '@coze-arch/coze-design/icons';
|
|
5
|
-
import { Tooltip, Button } from '@coze-arch/coze-design';
|
|
6
|
-
export function OpenDetailButton({ url, className }) {
|
|
7
|
-
return (_jsx(Tooltip, { theme: "dark", content: I18n.t('view_detail'), children: _jsx(Button, { onClick: e => {
|
|
8
|
-
e.stopPropagation();
|
|
9
|
-
window.open(url);
|
|
10
|
-
}, className: classNames('flex-shrink-0 !h-6 !w-6 !min-w-[24px] !p-[5px]', className), size: "small", color: "secondary", icon: _jsx(IconCozLongArrowTopRight, { className: "h-[14px] w-[14px] coz-fg-secondary" }) }) }));
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/open-detail-button/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAOzD,MAAM,UAAU,gBAAgB,CAAC,EAAE,GAAG,EAAE,SAAS,EAAS;IACxD,OAAO,CACL,KAAC,OAAO,IAAC,KAAK,EAAC,MAAM,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,YAClD,KAAC,MAAM,IACL,OAAO,EAAE,CAAC,CAAC,EAAE;gBACX,CAAC,CAAC,eAAe,EAAE,CAAC;gBACpB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACnB,CAAC,EACD,SAAS,EAAE,UAAU,CACnB,gDAAgD,EAChD,SAAS,CACV,EACD,IAAI,EAAC,OAAO,EACZ,KAAK,EAAC,WAAW,EACjB,IAAI,EACF,KAAC,wBAAwB,IAAC,SAAS,EAAC,oCAAoC,GAAG,GAErE,GACF,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
const defaultSize = 16;
|
|
3
|
-
/** OpsAGent 智能助手 Fox 的图标 */
|
|
4
|
-
export function FoxIcon(props) {
|
|
5
|
-
const { width: w = defaultSize, height: h = defaultSize } = props;
|
|
6
|
-
return (_jsx("svg", { width: w, height: h, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: _jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", 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", fill: "currentColor" }) }));
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=fox-icon.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fox-icon.js","sourceRoot":"","sources":["../../../src/ops-agent/fox-icon.tsx"],"names":[],"mappings":";AAAA,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,4BAA4B;AAC5B,MAAM,UAAU,OAAO,CAAC,KAAoC;IAC1D,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,WAAW,EAAE,MAAM,EAAE,CAAC,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;IAClE,OAAO,CACL,cACE,KAAK,EAAE,CAAC,EACR,MAAM,EAAE,CAAC,EACT,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,KAC9B,KAAK,YAET,4BACY,SAAS,eACT,SAAS,EACnB,CAAC,EAAC,2+JAA2+J,EAC7+J,IAAI,EAAC,cAAc,GACnB,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { I18n } from '@cozeloop/i18n';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import { IconCozIllus404Dark, IconCozIllus404, IconCozIllusErrorDark, IconCozIllusError, IconCozIllusLock, IconCozIllusLockDark, IconCozIllusEmpty, IconCozIllusEmptyDark, } from '@coze-arch/coze-design/illustrations';
|
|
5
|
-
import { Empty, Spin } from '@coze-arch/coze-design';
|
|
6
|
-
export function FullPage({ children, className, style }) {
|
|
7
|
-
return (_jsx("div", { className: classNames('w-full h-full flex items-center justify-center bg-semi-bg-1 z-10', className), style: style, children: children }));
|
|
8
|
-
}
|
|
9
|
-
export function PageLoading(props) {
|
|
10
|
-
return (_jsx(FullPage, { className: props.className, style: props.style, children: _jsx(Spin, { wrapperClassName: "w-full h-full", spinning: true, tip: props.tip }) }));
|
|
11
|
-
}
|
|
12
|
-
export function PageNotFound({ className, ...props }) {
|
|
13
|
-
return (_jsx(FullPage, { className: className, children: _jsx(Empty, { image: _jsx(IconCozIllus404, { className: "text-[160px]" }), darkModeImage: _jsx(IconCozIllus404Dark, { className: "text-[160px]" }), description: I18n.t('page_not_found'), ...props }) }));
|
|
14
|
-
}
|
|
15
|
-
export function PageError({ className, ...props }) {
|
|
16
|
-
return (_jsx(FullPage, { className: className, children: _jsx(Empty, { image: _jsx(IconCozIllusError, { className: "text-[160px]" }), darkModeImage: _jsx(IconCozIllusErrorDark, { className: "text-[160px]" }), description: I18n.t('page_load_failed'), ...props }) }));
|
|
17
|
-
}
|
|
18
|
-
export function PageNoAuth({ className, ...props }) {
|
|
19
|
-
return (_jsx(FullPage, { className: className, children: _jsx(Empty, { image: _jsx(IconCozIllusLock, { className: "text-[160px]" }), darkModeImage: _jsx(IconCozIllusLockDark, { className: "text-[160px]" }), description: I18n.t('no_permission'), ...props }) }));
|
|
20
|
-
}
|
|
21
|
-
export function PageNoContent({ className, ...props }) {
|
|
22
|
-
return (_jsx(FullPage, { className: className, children: _jsx(Empty, { image: _jsx(IconCozIllusEmpty, { className: "text-[160px]" }), darkModeImage: _jsx(IconCozIllusEmptyDark, { className: "text-[160px]" }), ...props }) }));
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/page-content/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAGtC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAwB,MAAM,wBAAwB,CAAC;AAe3E,MAAM,UAAU,QAAQ,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAiB;IACpE,OAAO,CACL,cACE,SAAS,EAAE,UAAU,CACnB,kEAAkE,EAClE,SAAS,CACV,EACD,KAAK,EAAE,KAAK,YAEX,QAAQ,GACL,CACP,CAAC;AACJ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AC,oBAAoB,IAAC,SAAS,EAAC,cAAc,GAAG,EAChE,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,KAChC,KAAK,GACF,GACA,CACZ,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAoB;IACrE,OAAO,CACL,KAAC,QAAQ,IAAC,SAAS,EAAE,SAAS,YAC5B,KAAC,KAAK,IACJ,KAAK,EAAE,KAAC,iBAAiB,IAAC,SAAS,EAAC,cAAc,GAAG,EACrD,aAAa,EAAE,KAAC,qBAAqB,IAAC,SAAS,EAAC,cAAc,GAAG,KAC7D,KAAK,GACT,GACO,CACZ,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/primary-page/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
export const PrimaryPage = ({ pageTitle, renderCustomHeader, filterSlot, children, contentClassName, className, headerClassName, titleClassName, titleSlot, ...restProps }) => (_jsxs("div", { className: classNames('pt-2 pb-3 h-full max-h-full flex flex-col', className), ...restProps, children: [renderCustomHeader ? (renderCustomHeader) : pageTitle || titleSlot ? (_jsxs("div", { className: classNames('flex items-center justify-between py-4 px-6', headerClassName), children: [_jsx("div", { className: classNames('text-[20px] font-medium leading-6 coz-fg-plus', titleClassName), children: pageTitle }), _jsx("div", { children: titleSlot })] })) : null, filterSlot ? (_jsx("div", { className: "box-border coz-fg-secondary pt-1 pb-3 px-6", children: filterSlot })) : null, _jsx("div", { className: classNames('flex-1 h-full max-h-full overflow-hidden px-6', contentClassName), children: children })] }));
|
|
4
|
-
//# sourceMappingURL=primary-header.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"primary-header.js","sourceRoot":"","sources":["../../../src/primary-page/primary-header.tsx"],"names":[],"mappings":";AAEA,OAAO,UAAU,MAAM,YAAY,CAAC;AAcpC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,SAAS,EACT,kBAAkB,EAClB,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,cAAc,EACd,SAAS,EACT,GAAG,SAAS,EACW,EAAE,EAAE,CAAC,CAC5B,eACE,SAAS,EAAE,UAAU,CACnB,2CAA2C,EAC3C,SAAS,CACV,KACG,SAAS,aAEZ,kBAAkB,CAAC,CAAC,CAAC,CACpB,kBAAkB,CACnB,CAAC,CAAC,CAAC,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,CAC3B,eACE,SAAS,EAAE,UAAU,CACnB,6CAA6C,EAC7C,eAAe,CAChB,aAED,cACE,SAAS,EAAE,UAAU,CACnB,+CAA+C,EAC/C,cAAc,CACf,YAEA,SAAS,GACN,EACN,wBAAM,SAAS,GAAO,IAClB,CACP,CAAC,CAAC,CAAC,IAAI,EACP,UAAU,CAAC,CAAC,CAAC,CACZ,cAAK,SAAS,EAAC,4CAA4C,YACxD,UAAU,GACP,CACP,CAAC,CAAC,CAAC,IAAI,EACR,cACE,SAAS,EAAE,UAAU,CACnB,+CAA+C,EAC/C,gBAAgB,CACjB,YAEA,QAAQ,GACL,IACF,CACP,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { Typography } from '@coze-arch/coze-design';
|
|
4
|
-
import styles from './index.module.less';
|
|
5
|
-
export function PrimaryTitle({ title, className }) {
|
|
6
|
-
return (_jsx(Typography.Text, { className: classNames(styles['primary-title'], className), children: title }));
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/primary-title/index.tsx"],"names":[],"mappings":";AACA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAOzC,MAAM,UAAU,YAAY,CAAC,EAAE,KAAK,EAAE,SAAS,EAAqB;IAClE,OAAO,CACL,KAAC,UAAU,CAAC,IAAI,IAAC,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,SAAS,CAAC,YACvE,KAAK,GACU,CACnB,CAAC;AACJ,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import { useMouseDownOffset } from '@cozeloop/hooks';
|
|
5
|
-
import { SideSheet } from '@coze-arch/coze-design';
|
|
6
|
-
const SIZE_MAP = {
|
|
7
|
-
small: 448,
|
|
8
|
-
medium: 684,
|
|
9
|
-
large: 920,
|
|
10
|
-
};
|
|
11
|
-
/** 仅支持 left 模式 */
|
|
12
|
-
export const ResizableSideSheet = (props) => {
|
|
13
|
-
const { minSize = Number.MIN_VALUE, defaultSize, maxSize = Number.MAX_VALUE, size = 'small', onResizeEnd, className, children, ...restProps } = props;
|
|
14
|
-
const [sidePaneWidth, setSidePaneWidth] = useState(defaultSize ?? SIZE_MAP[size]);
|
|
15
|
-
const prevWidthRef = useRef(sidePaneWidth);
|
|
16
|
-
const { ref, isActive } = useMouseDownOffset(({ offsetX }) => {
|
|
17
|
-
const newWidth = prevWidthRef.current - offsetX;
|
|
18
|
-
setSidePaneWidth([maxSize, newWidth, minSize].sort((a, b) => a - b)[1]);
|
|
19
|
-
});
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
prevWidthRef.current = sidePaneWidth;
|
|
22
|
-
document.body.style.cursor = isActive ? 'col-resize' : '';
|
|
23
|
-
document.body.style.userSelect = isActive ? 'none' : 'auto';
|
|
24
|
-
if (!isActive) {
|
|
25
|
-
onResizeEnd?.(sidePaneWidth);
|
|
26
|
-
}
|
|
27
|
-
}, [isActive]);
|
|
28
|
-
return (_jsxs(SideSheet, { className: classNames('relative', className), size: size, width: sidePaneWidth, ...restProps, children: [_jsx("div", { ref: ref, className: classNames('absolute h-full w-1 bg-white top-0 left-0 hover:cursor-col-resize hover:bg-blue-400 transition', {
|
|
29
|
-
'bg-blue-400 cursor-col-resize': isActive,
|
|
30
|
-
}) }), children] }));
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resizable-side-sheet/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAA4B,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAS7E,MAAM,QAAQ,GAAG;IACf,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;CACX,CAAC;AACF,kBAAkB;AAClB,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAA8B,EAAE,EAAE;IACnE,MAAM,EACJ,OAAO,GAAG,MAAM,CAAC,SAAS,EAC1B,WAAW,EACX,OAAO,GAAG,MAAM,CAAC,SAAS,EAC1B,IAAI,GAAG,OAAO,EACd,WAAW,EACX,SAAS,EACT,QAAQ,EACR,GAAG,SAAS,EACb,GAAG,KAAK,CAAC;IAEV,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAChD,WAAW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 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import cn from 'classnames';
|
|
3
|
-
import { IconCozCrossFill } from '@coze-arch/coze-design/icons';
|
|
4
|
-
import { Divider, SideSheet, } from '@coze-arch/coze-design';
|
|
5
|
-
import { Button } from '@coze-arch/coze-design';
|
|
6
|
-
import { useDrag } from './use-drag';
|
|
7
|
-
import styles from './index.module.less';
|
|
8
|
-
export const ResizeSidesheet = (props) => {
|
|
9
|
-
const { children, dragOptions, title, onCancel, className, showDivider, disableDrag, ...rest } = props;
|
|
10
|
-
const { containerRef, isActive, sidePaneWidth } = useDrag(dragOptions);
|
|
11
|
-
return (_jsxs(SideSheet, { title: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "flex-1", children: title }), showDivider ? (_jsx(Divider, { layout: "vertical", className: "h-[12px]" })) : null, _jsx(Button, { type: "primary", color: "secondary", icon: _jsx(IconCozCrossFill, { className: "w-[16px] h-[16px]" }), onClick: onCancel })] }), width: disableDrag ? undefined : sidePaneWidth, className: cn(styles.sheet, className), ...rest, onCancel: onCancel, closable: false, children: [disableDrag ? null : (_jsx("div", { ref: containerRef, className: cn('absolute h-full w-[2px] z-[20000] bg-transparent top-0 left-0 hover:cursor-col-resize hover:bg-[rgb(var(--coze-up-brand-9))] transition ', {
|
|
12
|
-
'bg-[rgb(var(--coze-up-brand-9))] cursor-col-resize': isActive,
|
|
13
|
-
}) })), props.children] }));
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resize-sidesheet/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAEL,OAAO,EACP,SAAS,GACV,MAAM,wBAAwB,CAAC;AACh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AQ,IACL,CACb,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { useMouseDownOffset } from '../hooks/use-mouse-down-offset';
|
|
3
|
-
const DEFAULT_WIDTH = 500;
|
|
4
|
-
const MAX_WIDTH = 800;
|
|
5
|
-
const MIN_WIDTH = 300;
|
|
6
|
-
export const useDrag = (options = {}) => {
|
|
7
|
-
const { defaultWidth = DEFAULT_WIDTH, maxWidth = MAX_WIDTH, minWidth = MIN_WIDTH, } = options;
|
|
8
|
-
const [sidePaneWidth, setSidePaneWidth] = useState(defaultWidth);
|
|
9
|
-
const prevWidthRef = useRef(sidePaneWidth);
|
|
10
|
-
const isActiveRef = useRef(false);
|
|
11
|
-
const { ref, isActive } = useMouseDownOffset(({ offsetX }) => {
|
|
12
|
-
const newWidth = prevWidthRef.current - offsetX;
|
|
13
|
-
setSidePaneWidth([maxWidth, newWidth, minWidth].sort((a, b) => a - b)[1]);
|
|
14
|
-
});
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
prevWidthRef.current = sidePaneWidth;
|
|
17
|
-
document.body.style.cursor = isActive ? 'col-resize' : '';
|
|
18
|
-
document.body.style.userSelect = isActive ? 'none' : 'auto';
|
|
19
|
-
if (isActiveRef.current && !isActive) {
|
|
20
|
-
options?.onDragEnd?.(sidePaneWidth);
|
|
21
|
-
}
|
|
22
|
-
isActiveRef.current = isActive;
|
|
23
|
-
}, [isActive]);
|
|
24
|
-
return {
|
|
25
|
-
sidePaneWidth,
|
|
26
|
-
containerRef: ref,
|
|
27
|
-
isActive,
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=use-drag.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-drag.js","sourceRoot":"","sources":["../../../src/resize-sidesheet/use-drag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE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M,CAAC;QAC5D,IAAI,WAAW,CAAC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrC,OAAO,EAAE,SAAS,EAAE,CAAC,aAAa,CAAC,CAAC;QACtC,CAAC;QACD,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAC;IACjC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACf,OAAO;QACL,aAAa;QACb,YAAY,EAAE,GAAG;QACjB,QAAQ;KACT,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { CodeMirrorJsonEditor, CodeMirrorRawCodeEditor, CodeMirrorRawTextEditor, } from '../codemirror-editor';
|
|
4
|
-
export const SchemaEditor = ({ value, onChange, placeholder, readOnly, language, className, backgroundColor, }) => (_jsx("div", { className: classNames('w-full h-[500px] border border-solid border-[rgba(68,83,130,0.25)] rounded-[4px] overflow-hidden relative', { 'opacity-70': readOnly, 'bg-white': !backgroundColor }, className), style: backgroundColor ? { backgroundColor } : undefined, children: language === 'json' ? (_jsx(CodeMirrorJsonEditor, { className: "w-full h-full overflow-y-auto", onChange: onChange, value: value || '', placeholder: placeholder, readonly: readOnly, borderRadius: 4, backgroundColor: backgroundColor })) : language ? (_jsx(CodeMirrorRawCodeEditor, { className: "w-full h-full overflow-y-auto", language: language, onChange: onChange, value: value || '', placeholder: placeholder, readonly: readOnly, backgroundColor: backgroundColor })) : (_jsx(CodeMirrorRawTextEditor, { className: "w-full h-full overflow-y-auto", onChange: onChange, value: value || '', placeholder: placeholder, readonly: readOnly, backgroundColor: backgroundColor })) }));
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema-editor/index.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;A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-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ButtonGroup, Col, Row } from '@coze-arch/coze-design';
|
|
3
|
-
const BTN_GRP_STYLE = {
|
|
4
|
-
width: '100%',
|
|
5
|
-
};
|
|
6
|
-
const BTN_STYLE = {
|
|
7
|
-
width: 'calc(100% / 4)',
|
|
8
|
-
};
|
|
9
|
-
/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
|
|
10
|
-
*
|
|
11
|
-
* @param props - The `ArrayFieldTemplateItemType` props for the component
|
|
12
|
-
*/
|
|
13
|
-
export default function ArrayFieldItemTemplate(props) {
|
|
14
|
-
const { children, disabled, hasCopy, hasMoveDown, hasMoveUp, hasRemove, hasToolbar, index, onCopyIndexClick, onDropIndexClick, onReorderClick, readonly, registry, uiSchema, } = props;
|
|
15
|
-
const { CopyButton, MoveDownButton, MoveUpButton, RemoveButton } = registry.templates.ButtonTemplates;
|
|
16
|
-
const { rowGutter = 24, toolbarAlign = 'top' } = registry.formContext;
|
|
17
|
-
return (_jsxs(Row, { align: toolbarAlign, gutter: rowGutter, children: [_jsx(Col, { span: 18, children: children }), hasToolbar ? (_jsx(Col, { span: 6, children: _jsxs(ButtonGroup, { style: BTN_GRP_STYLE, children: [hasMoveUp || hasMoveDown ? (_jsx(MoveUpButton, { disabled: disabled || readonly || !hasMoveUp, onClick: onReorderClick(index, index - 1), style: BTN_STYLE, uiSchema: uiSchema, registry: registry })) : null, hasMoveUp || hasMoveDown ? (_jsx(MoveDownButton, { disabled: disabled || readonly || !hasMoveDown, onClick: onReorderClick(index, index + 1), style: BTN_STYLE, uiSchema: uiSchema, registry: registry })) : null, hasCopy ? (_jsx(CopyButton, { disabled: disabled || readonly, onClick: onCopyIndexClick(index), style: BTN_STYLE, uiSchema: uiSchema, registry: registry })) : null, hasRemove ? (_jsx(RemoveButton, { disabled: disabled || readonly, onClick: onDropIndexClick(index), style: BTN_STYLE, uiSchema: uiSchema, registry: registry })) : null] }) })) : null] }, `array-item-${index}`));
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=array-field-item.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"array-field-item.js","sourceRoot":"","sources":["../../../../../src/semi-schema-form/components/tmpls/array-field-item.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAE/D,MAAM,aAAa,GAAG;IACpB,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,gBAAgB;CACxB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAI5C,KAA0C;IAC1C,MAAM,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,KAAK,EACL,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,QAAQ,GACT,GAAG,KAAK,CAAC;IACV,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,GAC9D,QAAQ,CAAC,SAAS,CAAC,eAAe,CAAC;IACrC,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,YAAY,GAAG,KAAK,EAAE,GAAG,QAAQ,CAAC,WAAW,CAAC;IAEtE,OAAO,CACL,MAAC,GAAG,IAAC,KAAK,EAAE,YAAY,EAA8B,MAAM,EAAE,SAAS,aACrE,KAAC,GAAG,IAAC,IAAI,EAAE,EAAE,YAAG,QAAQ,GAAO,EAE9B,UAAU,CAAC,CAAC,CAAC,CACZ,KAAC,GAAG,IAAC,IAAI,EAAE,CAAC,YACV,MAAC,WAAW,IAAC,KAAK,EAAE,aAAa,aAC9B,SAAS,IAAI,WAAW,CAAC,CAAC,CAAC,CAC1B,KAAC,YAAY,IACX,QAAQ,EAAE,QAAQ,IAAI,QAAQ,IAAI,CA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{ Col, Row } from '@coze-arch/coze-design';
|
|
5
|
-
// const DESCRIPTION_COL_STYLE = {
|
|
6
|
-
// paddingBottom: '8px',
|
|
7
|
-
// };
|
|
8
|
-
/** The `ArrayFieldTemplate` component is the template used to render all items in an array.
|
|
9
|
-
*
|
|
10
|
-
* @param props - The `ArrayFieldTemplateItemType` props for the component
|
|
11
|
-
*/
|
|
12
|
-
export default function ArrayFieldTemplate(props) {
|
|
13
|
-
const { canAdd, className, disabled, formContext, idSchema, items, onAddClick, readonly, registry,
|
|
14
|
-
// required,
|
|
15
|
-
// schema,
|
|
16
|
-
// title,
|
|
17
|
-
uiSchema, } = props;
|
|
18
|
-
const uiOptions = getUiOptions(uiSchema);
|
|
19
|
-
// const ArrayFieldDescriptionTemplate = getTemplate<
|
|
20
|
-
// 'ArrayFieldDescriptionTemplate',
|
|
21
|
-
// T,
|
|
22
|
-
// S,
|
|
23
|
-
// F
|
|
24
|
-
// >('ArrayFieldDescriptionTemplate', registry, uiOptions);
|
|
25
|
-
const ArrayFieldItemTemplate = getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
|
|
26
|
-
// const ArrayFieldTitleTemplate = getTemplate<
|
|
27
|
-
// 'ArrayFieldTitleTemplate',
|
|
28
|
-
// T,
|
|
29
|
-
// S,
|
|
30
|
-
// F
|
|
31
|
-
// >('ArrayFieldTitleTemplate', registry, uiOptions);
|
|
32
|
-
// Button templates are not overridden in the uiSchema
|
|
33
|
-
const { ButtonTemplates: { AddButton }, } = registry.templates;
|
|
34
|
-
const { rowGutter = 24 } = formContext;
|
|
35
|
-
return (_jsx("div", { className: cn('p-3 semi-card-bordered rounded-[4px]', className), id: idSchema.$id, children: _jsxs(Row, { gutter: rowGutter, children: [_jsx(Col, { className: "row array-item-list", span: 24, children: items
|
|
36
|
-
? items.map(({ key, ...itemProps }) => (_jsx(ArrayFieldItemTemplate, { ...itemProps }, key)))
|
|
37
|
-
: null }), canAdd ? (_jsx(Col, { span: 24, children: _jsx(Row, { gutter: rowGutter, justify: "end", children: _jsx(Col, { span: 6, children: _jsx(AddButton, { className: "array-item-add", disabled: disabled || readonly, onClick: onAddClick, uiSchema: uiSchema, registry: registry }) }) }) })) : null] }) }));
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=array-field.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"array-field.js","sourceRoot":"","sources":["../../../../../src/semi-schema-form/components/tmpls/array-field.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EACL,WAAW,EACX,YAAY,GAOb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAElD,kCAAkC;AAClC,0BAA0B;AAC1B,KAAK;AAEL;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAIxC,KAAuC;IACvC,MAAM,EACJ,MAAM,EACN,SAAS,EACT,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,KAAK,EACL,UAAU,EACV,QAAQ,EACR,QAAQ;IACR,YAAY;IACZ,UAAU;IACV,SAAS;IACT,QAAQ,GACT,GAAG,KAAK,CAAC;IACV,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,qDAAqD;IACrD,qCAAqC;IACrC,OAAO;IACP,OAAO;IACP,MAAM;IACN,2DAA2D;IAC3D,MAAM,sBAAsB,GAAG,WAAW,CACxC,wBAAwB,EACxB,QAAQ,EACR,SAAS,CACV,CAAC;IACF,+CAA+C;IAC/C,+BAA+B;IAC/B,OAAO;IACP,OAAO;IACP,MAAM;IACN,qDAAqD;IACrD,sDAAsD;IACtD,MAAM,EACJ,eAAe,EAAE,EAAE,SAAS,EAAE,GAC/B,GAAG,QAAQ,CAAC,SAAS,CAAC;IACvB,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,WAAgC,CAAC;IAE5D,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CAAC,sCAAsC,EAAE,SAAS,CAAC,EAChE,EAAE,EAAE,QAAQ,CAAC,GAAG,YAEhB,MAAC,GAAG,IAAC,MAAM,EAAE,SAAS,aAwBpB,KAAC,GAAG,IAAC,SAAS,EAAC,qBAAqB,EAAC,IAAI,EAAE,EAAE,YAC1C,KAAK;wBACJ,CAAC,CAAC,KAAK,CAAC,GAAG,CACP,CAAC,EACC,GAAG,EACH,GAAG,SAAS,EACwB,EAAE,EAAE,CAAC,CACzC,KAAC,sBAAsB,OAAe,SAAS,IAAlB,GAAG,CAAmB,CACpD,CACF;wBACH,CAAC,CAAC,IAAI,GACJ,EAEL,MAAM,CAAC,CAAC,CAAC,CACR,KAAC,GAAG,IAAC,IAAI,EAAE,EAAE,YACX,KAAC,GAAG,IAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAC,KAAK,YACnC,KAAC,GAAG,IAAC,IAAI,EAAE,CAAC,YACV,KAAC,SAAS,IACR,SAAS,EAAC,gBAAgB,EAC1B,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,GACE,GACF,GACF,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,GACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ariaDescribedByIds, examplesId, getInputProps, } from '@rjsf/utils';
|
|
3
|
-
import { Input, CozInputNumber, } from '@coze-arch/coze-design';
|
|
4
|
-
const INPUT_STYLE = {
|
|
5
|
-
width: '100%',
|
|
6
|
-
};
|
|
7
|
-
/** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
|
|
8
|
-
* It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
|
|
9
|
-
* It can be customized/overridden for other themes or individual implementations as needed.
|
|
10
|
-
*
|
|
11
|
-
* @param props - The `WidgetProps` for this template
|
|
12
|
-
*/
|
|
13
|
-
export default function BaseInputTemplate(props) {
|
|
14
|
-
const { disabled, formContext, id, onBlur, onChange, onChangeOverride, onFocus, options, placeholder, readonly, schema, value, type, } = props;
|
|
15
|
-
const { step, type: fieldType, ...inputProps } = getInputProps(schema, type, options, false);
|
|
16
|
-
const { readonlyAsDisabled = true } = formContext;
|
|
17
|
-
const handleNumberChange = nextValue => onChange(nextValue);
|
|
18
|
-
const handleTextChange = (nextValue, e) => {
|
|
19
|
-
onChangeOverride
|
|
20
|
-
? onChangeOverride(e)
|
|
21
|
-
: onChange(nextValue === '' ? options.emptyValue : nextValue);
|
|
22
|
-
};
|
|
23
|
-
const handleBlur = ({ target }) => onBlur(id, target && target.value);
|
|
24
|
-
const handleFocus = ({ target }) => onFocus(id, target && target.value);
|
|
25
|
-
const input = fieldType === 'number' || fieldType === 'integer' ? (_jsx(CozInputNumber, { disabled: disabled || (readonlyAsDisabled && readonly), id: id, name: id, onBlur: !readonly ? handleBlur : undefined, onChange: !readonly ? handleNumberChange : undefined, onFocus: !readonly ? handleFocus : undefined, placeholder: placeholder, style: INPUT_STYLE, list: schema.examples ? examplesId(id) : undefined, ...inputProps, step: step, value: value, "aria-describedby": ariaDescribedByIds(id, !!schema.examples) })) : (_jsx(Input, { disabled: disabled || (readonlyAsDisabled && readonly), id: id, name: id, onBlur: !readonly ? handleBlur : undefined, onChange: !readonly ? handleTextChange : undefined, onFocus: !readonly ? handleFocus : undefined, placeholder: placeholder, style: INPUT_STYLE, list: schema.examples ? examplesId(id) : undefined, ...inputProps, value: value, "aria-describedby": ariaDescribedByIds(id, !!schema.examples) }));
|
|
26
|
-
return (_jsxs(_Fragment, { children: [input, Array.isArray(schema.examples) && (_jsx("datalist", { id: examplesId(id), children: schema.examples
|
|
27
|
-
.concat(schema.default && !schema.examples.includes(schema.default)
|
|
28
|
-
? [schema.default]
|
|
29
|
-
: [])
|
|
30
|
-
.map(example => (_jsx("option", { value: example }, example))) }))] }));
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=base-input.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-input.js","sourceRoot":"","sources":["../../../../../src/semi-schema-form/components/tmpls/base-input.tsx"],"names":[],"mappings":";AAGA,OAAO,EACL,kBAAkB,EAElB,UAAU,EACV,aAAa,GAKd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,EACL,cAAc,GAGf,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,GAAG;IAClB,KAAK,EAAE,MAAM;CACd,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAIvC,KAAsC;IACtC,MAAM,EACJ,QAAQ,EACR,WAAW,EACX,EAAE,EACF,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,WAAW,EACX,QAAQ,EACR,MAAM,EACN,KAAK,EACL,IAAI,GACL,GAAG,KAAK,CAAC;IACV,MAAM,EACJ,IAAI,EACJ,IAAI,EAAE,SAAS,EACf,GAAG,UAAU,EACd,GAAG,aAAa,CAAU,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAEzD,MAAM,EAAE,kBAAkB,GAAG,IAAI,EAAE,GAAG,WAAgC,CAAC;IAEvE,MAAM,kBAAkB,GAAiC,SAAS,CAAC,EAAE,CACnE,QAAQ,CAAC,SAAS,CAAC,CAAC;IAEtB,MAAM,gBAAgB,GAA2B,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE;QAChE,gBAAgB;YACd,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;YACrB,CAAC,CAAC,QAAQ,CAAC,SAAS,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAClE,CAAC,CAAC;IAEF,MAAM,UAAU,G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1C,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,EAClD,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAC5C,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,KACjD,UAAU,EACd,KAAK,EAAE,KAAK,sBACM,kBAAkB,CAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAC9D,CACH,CAAC;IAEJ,OAAO,CACL,8BACG,KAAK,EACL,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CACjC,mBAAU,EAAE,EAAE,UAAU,CAAI,EAAE,CAAC,YAC3B,MAAM,CAAC,QAAqB;qBAC3B,MAAM,CACL,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC;oBACzD,CAAC,CAAE,CAAC,MAAM,CAAC,OAAO,CAAc;oBAChC,CAAC,CAAC,EAAE,CACP;qBACA,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CACd,iBAAsB,KAAK,EAAE,OAAO,IAAvB,OAAO,CAAoB,CACzC,CAAC,GACK,CACZ,IACA,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/** The `DescriptionField` is the template to use to render the description of a field
|
|
3
|
-
*
|
|
4
|
-
* @param props - The `DescriptionFieldProps` for this component
|
|
5
|
-
*/
|
|
6
|
-
export default function DescriptionField(props) {
|
|
7
|
-
const { id, description } = props;
|
|
8
|
-
if (!description) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
return _jsx("span", { id: id, children: description });
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=description-field.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"description-field.js","sourceRoot":"","sources":["../../../../../src/semi-schema-form/components/tmpls/description-field.tsx"],"names":[],"mappings":";AAOA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAItC,KAAqC;IACrC,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAElC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,eAAM,EAAE,EAAE,EAAE,YAAG,WAAW,GAAQ,CAAC;AAC5C,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { TranslatableString, } from '@rjsf/utils';
|
|
3
|
-
import { IconCozWarningCircle } from '@coze-arch/coze-design/icons';
|
|
4
|
-
import { Banner, List, Space } from '@coze-arch/coze-design';
|
|
5
|
-
/** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
|
|
6
|
-
*
|
|
7
|
-
* @param props - The `ErrorListProps` for this component
|
|
8
|
-
*/
|
|
9
|
-
export default function ErrorList({ errors, registry }) {
|
|
10
|
-
const { translateString } = registry;
|
|
11
|
-
const renderErrors = () => (_jsx(List, { className: "list-group", size: "small", children: errors.map((error, index) => (_jsx(List.Item, { children: _jsxs(Space, { children: [_jsx(IconCozWarningCircle, {}), error.stack] }) }, index))) }));
|
|
12
|
-
return (_jsx(Banner, { type: "danger", className: "panel panel-danger errors", title: translateString(TranslatableString.ErrorsLabel), description: renderErrors() }));
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=error-list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-list.js","sourceRoot":"","sources":["../../../../../src/semi-schema-form/components/tmpls/error-list.tsx"],"names":[],"mappings":";AAEA,OAAO,EAKL,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE7D;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAI/B,EAAE,MAAM,EAAE,QAAQ,EAA2B;IAC7C,MAAM,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC;IACrC,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,CACzB,KAAC,IAAI,IAAC,SAAS,EAAC,YAAY,EAAC,IAAI,EAAC,OAAO,YACtC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5B,KAAC,IAAI,CAAC,IAAI,cACR,MAAC,KAAK,eACJ,KAAC,oBAAoB,KAAG,EACvB,KAAK,CAAC,KAAK,IACN,IAJM,KAAK,CAKT,CACb,CAAC,GACG,CACR,CAAC;IAEF,OAAO,CACL,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,2BAA2B,EACrC,KAAK,EAAE,eAAe,CAAC,kBAAkB,CAAC,WAAW,CAAC,EACtD,WAAW,EAAE,YAAY,EAAE,GAC3B,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { errorId, } from '@rjsf/utils';
|
|
3
|
-
import { Form } from '@coze-arch/coze-design';
|
|
4
|
-
/** The `FieldErrorTemplate` component renders the errors local to the particular field
|
|
5
|
-
*
|
|
6
|
-
* @param props - The `FieldErrorProps` for the errors being rendered
|
|
7
|
-
*/
|
|
8
|
-
export default function FieldErrorTemplate(props) {
|
|
9
|
-
const { errors = [], idSchema } = props;
|
|
10
|
-
if (errors.length === 0) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
const id = errorId(idSchema);
|
|
14
|
-
return (_jsx("div", { id: id, children: errors.map(error => (_jsx(Form.ErrorMessage, { error: error }, `field-${id}-error-${error}`))) }));
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=field-error.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-error.js","sourceRoot":"","sources":["../../../../../src/semi-schema-form/components/tmpls/field-error.tsx"],"names":[],"mappings":";AACA,OAAO,EAKL,OAAO,GACR,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAIxC,KAA+B;IAC/B,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACxC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,EAAE,GAAG,OAAO,CAAI,QAAQ,CAAC,CAAC;IAEhC,OAAO,CACL,cAAK,EAAE,EAAE,EAAE,YACR,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CACnB,KAAC,IAAI,CAAC,YAAY,IAAoC,KAAK,EAAE,KAAK,IAA1C,SAAS,EAAE,UAAU,KAAK,EAAE,CAAkB,CACvE,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Form, Typography } from '@coze-arch/coze-design';
|
|
3
|
-
/** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field
|
|
4
|
-
* content, (label, description, children, errors and help) inside of a `WrapIfAdditional` component.
|
|
5
|
-
*
|
|
6
|
-
* @param props - The `FieldTemplateProps` for this component
|
|
7
|
-
*/
|
|
8
|
-
export default function FieldTemplate(props) {
|
|
9
|
-
const { children, description, rawErrors, hidden, label, rawDescription, required, } = props;
|
|
10
|
-
if (hidden) {
|
|
11
|
-
return _jsx("div", { className: "field-hidden", children: children });
|
|
12
|
-
}
|
|
13
|
-
// check to see if there is rawDescription(string) before using description(ReactNode)
|
|
14
|
-
// to prevent showing a blank description area
|
|
15
|
-
const descriptionNode = rawDescription ? description : undefined;
|
|
16
|
-
return (_jsxs(Form.Slot, { label: { text: label, required }, className: "mb-4", error: {
|
|
17
|
-
error: rawErrors,
|
|
18
|
-
validateStatus: rawErrors?.length ? 'error' : undefined,
|
|
19
|
-
}, children: [children, _jsx(Typography.Paragraph, { className: "text-xs w-full text-gray-500", children: descriptionNode })] }));
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=field.js.map
|