@cozeloop/components 0.0.12-beta-1778491251764 → 0.0.12-beta-1378.344125032425
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 +0 -49
- package/dist/es/index.mjs +17 -510
- package/dist/lib/base-search-select/base-search-form-select.js +6 -0
- package/dist/lib/base-search-select/base-search-form-select.js.map +1 -0
- package/dist/lib/base-search-select/base-search-select.js +130 -0
- package/dist/lib/base-search-select/base-search-select.js.map +1 -0
- package/dist/lib/base-search-select/index.js +3 -0
- package/dist/lib/base-search-select/index.js.map +1 -0
- package/dist/lib/base-search-select/types.js +2 -0
- package/dist/lib/base-search-select/types.js.map +1 -0
- package/dist/lib/base-search-select/utils.js +48 -0
- package/dist/lib/base-search-select/utils.js.map +1 -0
- package/dist/lib/basic-card/index.js +4 -0
- package/dist/lib/basic-card/index.js.map +1 -0
- package/dist/lib/card-pane/index.js +9 -0
- package/dist/lib/card-pane/index.js.map +1 -0
- package/dist/lib/chip-select/index.js +6 -0
- package/dist/lib/chip-select/index.js.map +1 -0
- package/dist/lib/codemirror-editor/code-editor.d.ts +2 -23
- package/dist/lib/codemirror-editor/code-editor.js +135 -0
- package/dist/lib/codemirror-editor/code-editor.js.map +1 -0
- package/dist/lib/codemirror-editor/index.js +7 -0
- package/dist/lib/codemirror-editor/index.js.map +1 -0
- package/dist/lib/codemirror-editor/json-editor.js +104 -0
- package/dist/lib/codemirror-editor/json-editor.js.map +1 -0
- package/dist/lib/codemirror-editor/raw-code-editor.js +104 -0
- package/dist/lib/codemirror-editor/raw-code-editor.js.map +1 -0
- package/dist/lib/codemirror-editor/raw-text-editor.js +33 -0
- package/dist/lib/codemirror-editor/raw-text-editor.js.map +1 -0
- package/dist/lib/codemirror-editor/text-editor.d.ts +2 -23
- package/dist/lib/codemirror-editor/text-editor.js +50 -0
- package/dist/lib/codemirror-editor/text-editor.js.map +1 -0
- package/dist/lib/codemirror-editor/themes/coze-dark.js +113 -0
- package/dist/lib/codemirror-editor/themes/coze-dark.js.map +1 -0
- package/dist/lib/codemirror-editor/themes/coze-light.js +119 -0
- package/dist/lib/codemirror-editor/themes/coze-light.js.map +1 -0
- package/dist/lib/collapse-card/index.js +31 -0
- package/dist/lib/collapse-card/index.js.map +1 -0
- package/dist/lib/collapse-item/index.js +9 -0
- package/dist/lib/collapse-item/index.js.map +1 -0
- package/dist/lib/collapsible-card/index.js +13 -0
- package/dist/lib/collapsible-card/index.js.map +1 -0
- package/dist/lib/column-manage-storage/index.js +48 -0
- package/dist/lib/column-manage-storage/index.js.map +1 -0
- package/dist/lib/columns-select/index.js +78 -0
- package/dist/lib/columns-select/index.js.map +1 -0
- package/dist/lib/copyable/index.js +12 -0
- package/dist/lib/copyable/index.js.map +1 -0
- package/dist/lib/edit-icon-button/index.js +13 -0
- package/dist/lib/edit-icon-button/index.js.map +1 -0
- package/dist/lib/footer-actions/index.js +8 -0
- package/dist/lib/footer-actions/index.js.map +1 -0
- package/dist/lib/hooks/use-infinite-scroll.js +133 -0
- package/dist/lib/hooks/use-infinite-scroll.js.map +1 -0
- package/dist/lib/hooks/use-mouse-down-offset.js +39 -0
- package/dist/lib/hooks/use-mouse-down-offset.js.map +1 -0
- package/dist/lib/hooks/use-unsave-leave-warning.js +26 -0
- package/dist/lib/hooks/use-unsave-leave-warning.js.map +1 -0
- package/dist/lib/id-render/icon-button-container.js +7 -0
- package/dist/lib/id-render/icon-button-container.js.map +1 -0
- package/dist/lib/id-render/index.js +22 -0
- package/dist/lib/id-render/index.js.map +1 -0
- package/dist/lib/index-controller/record-navigation.js +10 -0
- package/dist/lib/index-controller/record-navigation.js.map +1 -0
- package/dist/lib/index-controller/use-item-index-controller.js +123 -0
- package/dist/lib/index-controller/use-item-index-controller.js.map +1 -0
- package/dist/lib/index.d.ts +0 -6
- package/dist/lib/index.js +77 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/infinite-scroll-table/index.js +35 -0
- package/dist/lib/infinite-scroll-table/index.js.map +1 -0
- package/dist/lib/info-tooltip/index.js +9 -0
- package/dist/lib/info-tooltip/index.js.map +1 -0
- package/dist/lib/input-components/radio-button.js +21 -0
- package/dist/lib/input-components/radio-button.js.map +1 -0
- package/dist/lib/input-slider/index.js +81 -0
- package/dist/lib/input-slider/index.js.map +1 -0
- package/dist/lib/input-with-count/index.js +7 -0
- package/dist/lib/input-with-count/index.js.map +1 -0
- package/dist/lib/jump-button/jump-icon-button.js +7 -0
- package/dist/lib/jump-button/jump-icon-button.js.map +1 -0
- package/dist/lib/large-txt-render/index.js +27 -0
- package/dist/lib/large-txt-render/index.js.map +1 -0
- package/dist/lib/layout/content.js +5 -0
- package/dist/lib/layout/content.js.map +1 -0
- package/dist/lib/layout/header.js +6 -0
- package/dist/lib/layout/header.js.map +1 -0
- package/dist/lib/layout/index.js +9 -0
- package/dist/lib/layout/index.js.map +1 -0
- package/dist/lib/layout/tabs.js +10 -0
- package/dist/lib/layout/tabs.js.map +1 -0
- package/dist/lib/lazy-load-component/index.js +42 -0
- package/dist/lib/lazy-load-component/index.js.map +1 -0
- package/dist/lib/link-button/index.js +23 -0
- package/dist/lib/link-button/index.js.map +1 -0
- package/dist/lib/logic-editor/index.js +3 -0
- package/dist/lib/logic-editor/index.js.map +1 -0
- package/dist/lib/logic-editor/logic-editor.js +70 -0
- package/dist/lib/logic-editor/logic-editor.js.map +1 -0
- package/dist/lib/logic-editor/logic-left-render.js +62 -0
- package/dist/lib/logic-editor/logic-left-render.js.map +1 -0
- package/dist/lib/logic-editor/logic-operator-render.js +31 -0
- package/dist/lib/logic-editor/logic-operator-render.js.map +1 -0
- package/dist/lib/logic-editor/logic-right-render.js +26 -0
- package/dist/lib/logic-editor/logic-right-render.js.map +1 -0
- package/dist/lib/logic-editor/logic-types.js +144 -0
- package/dist/lib/logic-editor/logic-types.js.map +1 -0
- package/dist/lib/logic-editor/utils.js +18 -0
- package/dist/lib/logic-editor/utils.js.map +1 -0
- package/dist/lib/logic-expr/consts.js +5 -0
- package/dist/lib/logic-expr/consts.js.map +1 -0
- package/dist/lib/logic-expr/expr-group-render.js +60 -0
- package/dist/lib/logic-expr/expr-group-render.js.map +1 -0
- package/dist/lib/logic-expr/expr-render.js +84 -0
- package/dist/lib/logic-expr/expr-render.js.map +1 -0
- package/dist/lib/logic-expr/index.js +2 -0
- package/dist/lib/logic-expr/index.js.map +1 -0
- package/dist/lib/logic-expr/logic-expr.js +187 -0
- package/dist/lib/logic-expr/logic-expr.js.map +1 -0
- package/dist/lib/logic-expr/logic-not.js +20 -0
- package/dist/lib/logic-expr/logic-not.js.map +1 -0
- package/dist/lib/logic-expr/logic-toggle.js +32 -0
- package/dist/lib/logic-expr/logic-toggle.js.map +1 -0
- package/dist/lib/logic-expr/types.js +2 -0
- package/dist/lib/logic-expr/types.js.map +1 -0
- package/dist/lib/loop-icons/index.js +3 -0
- package/dist/lib/loop-icons/index.js.map +1 -0
- package/dist/lib/loop-radio-group/index.js +7 -0
- package/dist/lib/loop-radio-group/index.js.map +1 -0
- package/dist/lib/multi-modal-dataset-item-render/audio-render/index.js +34 -0
- package/dist/lib/multi-modal-dataset-item-render/audio-render/index.js.map +1 -0
- package/dist/lib/multi-modal-dataset-item-render/index.js +3 -0
- package/dist/lib/multi-modal-dataset-item-render/index.js.map +1 -0
- package/dist/lib/multi-modal-dataset-item-render/video-render/index.js +47 -0
- package/dist/lib/multi-modal-dataset-item-render/video-render/index.js.map +1 -0
- package/dist/lib/multi-part-editor/components/image-item-renderer.js +58 -0
- package/dist/lib/multi-part-editor/components/image-item-renderer.js.map +1 -0
- package/dist/lib/multi-part-editor/components/multipart-item-renderer.js +26 -0
- package/dist/lib/multi-part-editor/components/multipart-item-renderer.js.map +1 -0
- package/dist/lib/multi-part-editor/components/url-input-modal.js +151 -0
- package/dist/lib/multi-part-editor/components/url-input-modal.js.map +1 -0
- package/dist/lib/multi-part-editor/components/video-item-renderer.js +58 -0
- package/dist/lib/multi-part-editor/components/video-item-renderer.js.map +1 -0
- package/dist/lib/multi-part-editor/index.js +301 -0
- package/dist/lib/multi-part-editor/index.js.map +1 -0
- package/dist/lib/multi-part-editor/multi-part-render.js +40 -0
- package/dist/lib/multi-part-editor/multi-part-render.js.map +1 -0
- package/dist/lib/multi-part-editor/type.js +27 -0
- package/dist/lib/multi-part-editor/type.js.map +1 -0
- package/dist/lib/multi-part-editor/upload-button.js +104 -0
- package/dist/lib/multi-part-editor/upload-button.js.map +1 -0
- package/dist/lib/multi-part-editor/utils.js +43 -0
- package/dist/lib/multi-part-editor/utils.js.map +1 -0
- package/dist/lib/open-detail-button/index.js +12 -0
- package/dist/lib/open-detail-button/index.js.map +1 -0
- package/dist/lib/ops-agent/fox-icon.js +8 -0
- package/dist/lib/ops-agent/fox-icon.js.map +1 -0
- package/dist/lib/page-content/index.js +24 -0
- package/dist/lib/page-content/index.js.map +1 -0
- package/dist/lib/primary-page/index.js +2 -0
- package/dist/lib/primary-page/index.js.map +1 -0
- package/dist/lib/primary-page/primary-header.js +4 -0
- package/dist/lib/primary-page/primary-header.js.map +1 -0
- package/dist/lib/primary-title/index.js +8 -0
- package/dist/lib/primary-title/index.js.map +1 -0
- package/dist/lib/resizable-side-sheet/index.js +32 -0
- package/dist/lib/resizable-side-sheet/index.js.map +1 -0
- package/dist/lib/resize-sidesheet/index.js +15 -0
- package/dist/lib/resize-sidesheet/index.js.map +1 -0
- package/dist/lib/resize-sidesheet/use-drag.js +30 -0
- package/dist/lib/resize-sidesheet/use-drag.js.map +1 -0
- package/dist/lib/schema-editor/index.js +5 -0
- package/dist/lib/schema-editor/index.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/array-field-item.js +19 -0
- package/dist/lib/semi-schema-form/components/tmpls/array-field-item.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/array-field.js +39 -0
- package/dist/lib/semi-schema-form/components/tmpls/array-field.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/base-input.js +32 -0
- package/dist/lib/semi-schema-form/components/tmpls/base-input.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/description-field.js +13 -0
- package/dist/lib/semi-schema-form/components/tmpls/description-field.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/error-list.js +14 -0
- package/dist/lib/semi-schema-form/components/tmpls/error-list.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/field-error.js +16 -0
- package/dist/lib/semi-schema-form/components/tmpls/field-error.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/field.js +21 -0
- package/dist/lib/semi-schema-form/components/tmpls/field.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/icon-button.js +29 -0
- package/dist/lib/semi-schema-form/components/tmpls/icon-button.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/index.js +31 -0
- package/dist/lib/semi-schema-form/components/tmpls/index.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/object-field.js +81 -0
- package/dist/lib/semi-schema-form/components/tmpls/object-field.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/submit.js +13 -0
- package/dist/lib/semi-schema-form/components/tmpls/submit.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/title-field.js +12 -0
- package/dist/lib/semi-schema-form/components/tmpls/title-field.js.map +1 -0
- package/dist/lib/semi-schema-form/components/widgets/checkbox.js +26 -0
- package/dist/lib/semi-schema-form/components/widgets/checkbox.js.map +1 -0
- package/dist/lib/semi-schema-form/components/widgets/checkboxs.js +27 -0
- package/dist/lib/semi-schema-form/components/widgets/checkboxs.js.map +1 -0
- package/dist/lib/semi-schema-form/components/widgets/index.js +15 -0
- package/dist/lib/semi-schema-form/components/widgets/index.js.map +1 -0
- package/dist/lib/semi-schema-form/components/widgets/radio.js +27 -0
- package/dist/lib/semi-schema-form/components/widgets/radio.js.map +1 -0
- package/dist/lib/semi-schema-form/components/widgets/range.js +26 -0
- package/dist/lib/semi-schema-form/components/widgets/range.js.map +1 -0
- package/dist/lib/semi-schema-form/components/widgets/select.js +44 -0
- package/dist/lib/semi-schema-form/components/widgets/select.js.map +1 -0
- package/dist/lib/semi-schema-form/components/widgets/textarea.js +18 -0
- package/dist/lib/semi-schema-form/components/widgets/textarea.js.map +1 -0
- package/dist/lib/semi-schema-form/index.js +9 -0
- package/dist/lib/semi-schema-form/index.js.map +1 -0
- package/dist/lib/sentinel-form/enum.js +15 -0
- package/dist/lib/sentinel-form/enum.js.map +1 -0
- package/dist/lib/sentinel-form/index.d.ts +1 -1
- package/dist/lib/sentinel-form/index.js +323 -0
- package/dist/lib/sentinel-form/index.js.map +1 -0
- package/dist/lib/step-nav/index.js +13 -0
- package/dist/lib/step-nav/index.js.map +1 -0
- package/dist/lib/table/index.js +7 -0
- package/dist/lib/table/index.js.map +1 -0
- package/dist/lib/table/sort-icon.js +31 -0
- package/dist/lib/table/sort-icon.js.map +1 -0
- package/dist/lib/table/table-with-pagination.js +74 -0
- package/dist/lib/table/table-with-pagination.js.map +1 -0
- package/dist/lib/table/table-without-pagniation.js +37 -0
- package/dist/lib/table/table-without-pagniation.js.map +1 -0
- package/dist/lib/table-batch-operate/table-batch-operation.js +17 -0
- package/dist/lib/table-batch-operate/table-batch-operation.js.map +1 -0
- package/dist/lib/table-batch-operate/use-batch-operate.js +71 -0
- package/dist/lib/table-batch-operate/use-batch-operate.js.map +1 -0
- package/dist/lib/table-col-actions/index.js +39 -0
- package/dist/lib/table-col-actions/index.js.map +1 -0
- package/dist/lib/table-cols-config/index.js +60 -0
- package/dist/lib/table-cols-config/index.js.map +1 -0
- package/dist/lib/table-cols-config/type.js +2 -0
- package/dist/lib/table-cols-config/type.js.map +1 -0
- package/dist/lib/table-cols-config/use-hidden-col-keys.js +32 -0
- package/dist/lib/table-cols-config/use-hidden-col-keys.js.map +1 -0
- package/dist/lib/table-cols-config/util.js +39 -0
- package/dist/lib/table-cols-config/util.js.map +1 -0
- package/dist/lib/table-empty/index.js +9 -0
- package/dist/lib/table-empty/index.js.map +1 -0
- package/dist/lib/table-header/index.d.ts +1 -1
- package/dist/lib/table-header/index.js +12 -0
- package/dist/lib/table-header/index.js.map +1 -0
- package/dist/lib/tabs/index.js +9 -0
- package/dist/lib/tabs/index.js.map +1 -0
- package/dist/lib/text-area-pro/index.js +10 -0
- package/dist/lib/text-area-pro/index.js.map +1 -0
- package/dist/lib/text-with-copy/index.js +25 -0
- package/dist/lib/text-with-copy/index.js.map +1 -0
- package/dist/lib/title-with-sub/index.js +6 -0
- package/dist/lib/title-with-sub/index.js.map +1 -0
- package/dist/lib/tooltip-when-disabled/index.js +9 -0
- package/dist/lib/tooltip-when-disabled/index.js.map +1 -0
- package/dist/lib/tooltip-with-disabled/index.js +9 -0
- package/dist/lib/tooltip-with-disabled/index.js.map +1 -0
- package/dist/lib/tsconfig.build.tsbuildinfo +1 -0
- package/dist/lib/upload/index.js +25 -0
- package/dist/lib/upload/index.js.map +1 -0
- package/dist/lib/user-profile/index.js +21 -0
- package/dist/lib/user-profile/index.js.map +1 -0
- package/dist/lib/utils/basic.js +30 -0
- package/dist/lib/utils/basic.js.map +1 -0
- package/dist/lib/version-list/version-descriptions.js +15 -0
- package/dist/lib/version-list/version-descriptions.js.map +1 -0
- package/dist/lib/version-list/version-item.js +6 -0
- package/dist/lib/version-list/version-item.js.map +1 -0
- package/dist/lib/version-list/version-list.js +12 -0
- package/dist/lib/version-list/version-list.js.map +1 -0
- package/dist/lib/version-list/version-switch-panel.js +11 -0
- package/dist/lib/version-list/version-switch-panel.js.map +1 -0
- package/package.json +31 -23
- package/dist/lib/accessible-option-label/index.d.ts +0 -14
- package/dist/lib/banner/index.d.ts +0 -8
- package/dist/lib/code-editor/index.d.ts +0 -3
- package/dist/lib/code-editor-with-loading/index.d.ts +0 -10
- package/dist/lib/input-number-bigint/__tests__/input-number-bigint.test.d.ts +0 -1
- package/dist/lib/input-number-bigint/index.d.ts +0 -3
- package/dist/lib/rich-text-editor/editor.d.ts +0 -2
- package/dist/lib/rich-text-editor/index.d.ts +0 -2
- package/dist/lib/rich-text-editor/mention-extension.d.ts +0 -16
- package/dist/lib/rich-text-editor/mention-node-view.d.ts +0 -4
- package/dist/lib/rich-text-editor/types.d.ts +0 -45
package/dist/es/index.mjs
CHANGED
|
@@ -15,14 +15,13 @@ import { useDebounceFn, useInfiniteScroll, useLatest, useMemoizedFn, useRequest,
|
|
|
15
15
|
import { cloneDeep, debounce, get, isEmpty as external_lodash_es_isEmpty, isFunction, isInteger, isNull, isNumber, isObject, isString, isUndefined, set } from "lodash-es";
|
|
16
16
|
import copy_to_clipboard from "copy-to-clipboard";
|
|
17
17
|
import { fileDownload, formatTimestampToString, safeJsonParse, sleep as toolkit_sleep } from "@cozeloop/toolkit";
|
|
18
|
-
import _monaco_editor_react, { DiffEditor, loader } from "@monaco-editor/react";
|
|
19
18
|
import sortablejs from "sortablejs";
|
|
20
19
|
import { nanoid } from "nanoid";
|
|
21
20
|
import { ContentType } from "@cozeloop/api-schema/evaluation";
|
|
22
21
|
import { ItemErrorType, StorageProvider } from "@cozeloop/api-schema/data";
|
|
23
22
|
import { ContentType as prompt_ContentType } from "@cozeloop/api-schema/prompt";
|
|
24
23
|
import { withTheme } from "@rjsf/core";
|
|
25
|
-
import {
|
|
24
|
+
import { defaultKeymap, history as commands_history, historyKeymap } from "@codemirror/commands";
|
|
26
25
|
import { TranslatableString, ariaDescribedByIds, canExpand, enumOptionsIndexForValue, enumOptionsValueForIndex, errorId, examplesId, getInputProps, getSubmitButtonOptions, getTemplate, getUiOptions, optionId, rangeSpec } from "@rjsf/utils";
|
|
27
26
|
import { useMouseDownOffset as hooks_useMouseDownOffset } from "@cozeloop/hooks";
|
|
28
27
|
import dayjs from "dayjs";
|
|
@@ -32,22 +31,12 @@ import preset_code, { createTheme, languages, tags, themes, transformerCreator }
|
|
|
32
31
|
import { typescript } from "@coze-editor/editor/language-typescript";
|
|
33
32
|
import { shell } from "@coze-editor/editor/language-shell";
|
|
34
33
|
import { python } from "@coze-editor/editor/language-python";
|
|
35
|
-
import { json
|
|
34
|
+
import { json } from "@coze-editor/editor/language-json";
|
|
36
35
|
import { mixLanguages } from "@coze-editor/editor";
|
|
37
36
|
import { EditorView, keymap } from "@codemirror/view";
|
|
38
37
|
import { markdownLanguage } from "@codemirror/lang-markdown";
|
|
39
38
|
import { goLanguage } from "@codemirror/lang-go";
|
|
40
39
|
import preset_universal from "@coze-editor/editor/preset-universal";
|
|
41
|
-
import { defaultKeymap, history as commands_history, historyKeymap } from "@codemirror/commands";
|
|
42
|
-
import { EditorContent, NodeViewWrapper, ReactNodeViewRenderer, useEditor } from "@tiptap/react";
|
|
43
|
-
import extension_text from "@tiptap/extension-text";
|
|
44
|
-
import extension_placeholder from "@tiptap/extension-placeholder";
|
|
45
|
-
import extension_paragraph from "@tiptap/extension-paragraph";
|
|
46
|
-
import extension_history from "@tiptap/extension-history";
|
|
47
|
-
import extension_hard_break from "@tiptap/extension-hard-break";
|
|
48
|
-
import extension_document from "@tiptap/extension-document";
|
|
49
|
-
import { NodeSelection, Plugin, PluginKey } from "@tiptap/pm/state";
|
|
50
|
-
import extension_mention from "@tiptap/extension-mention";
|
|
51
40
|
var external_react_sortable_hoc_namespaceObject = {};
|
|
52
41
|
__webpack_require__.r(external_react_sortable_hoc_namespaceObject);
|
|
53
42
|
__webpack_require__.d(external_react_sortable_hoc_namespaceObject, {
|
|
@@ -528,7 +517,6 @@ function TableColActions({ actions, maxCount = 2, disabled, spaceProps = {}, wra
|
|
|
528
517
|
position: "bottomLeft",
|
|
529
518
|
visible: visible,
|
|
530
519
|
trigger: "custom",
|
|
531
|
-
keepDOM: true,
|
|
532
520
|
className: table_col_actions_index_module.tableColActionsDropdown,
|
|
533
521
|
onClickOutSide: ()=>setVisible(false),
|
|
534
522
|
render: /*#__PURE__*/ jsx(Menu.SubMenu, {
|
|
@@ -698,94 +686,6 @@ const InputSlider = ({ value, onChange, max = 1, min = 0, step = 1, disabled, de
|
|
|
698
686
|
]
|
|
699
687
|
});
|
|
700
688
|
};
|
|
701
|
-
const isSafeInteger = (str)=>{
|
|
702
|
-
if (!/^-?\d+$/.test(str)) return false;
|
|
703
|
-
const num = Number(str);
|
|
704
|
-
return Number.isSafeInteger(num);
|
|
705
|
-
};
|
|
706
|
-
const toSafeValue = (str)=>{
|
|
707
|
-
if (isSafeInteger(str)) return Number(str);
|
|
708
|
-
return str;
|
|
709
|
-
};
|
|
710
|
-
const normalizeToString = (val)=>{
|
|
711
|
-
if (void 0 === val || '' === val) return '';
|
|
712
|
-
return String(val);
|
|
713
|
-
};
|
|
714
|
-
const clampStr = (valStr, minStr, maxStr)=>{
|
|
715
|
-
if (!valStr || '-' === valStr) return valStr;
|
|
716
|
-
if (!/^-?\d+$/.test(valStr)) return valStr;
|
|
717
|
-
let val = BigInt(valStr);
|
|
718
|
-
if (minStr && /^-?\d+$/.test(minStr) && val < BigInt(minStr)) val = BigInt(minStr);
|
|
719
|
-
if (maxStr && /^-?\d+$/.test(maxStr) && val > BigInt(maxStr)) val = BigInt(maxStr);
|
|
720
|
-
return val.toString();
|
|
721
|
-
};
|
|
722
|
-
const filterIntegerChars = (str)=>{
|
|
723
|
-
const cleaned = str.replace(/[^\d-]/g, '');
|
|
724
|
-
if (!cleaned) return '';
|
|
725
|
-
const isNegative = '-' === cleaned[0];
|
|
726
|
-
const digits = cleaned.replace(/-/g, '');
|
|
727
|
-
return isNegative ? `-${digits}` : digits;
|
|
728
|
-
};
|
|
729
|
-
const InputNumberBigInt = ({ value, defaultValue, max, min, onChange, onBlur, className, style, disabled, placeholder, size, ...rest })=>{
|
|
730
|
-
const [innerValue, setInnerValue] = useState(()=>normalizeToString(value ?? defaultValue));
|
|
731
|
-
const prevValueRef = useRef(value);
|
|
732
|
-
useEffect(()=>{
|
|
733
|
-
if (value !== prevValueRef.current) {
|
|
734
|
-
prevValueRef.current = value;
|
|
735
|
-
setInnerValue(normalizeToString(value));
|
|
736
|
-
}
|
|
737
|
-
}, [
|
|
738
|
-
value
|
|
739
|
-
]);
|
|
740
|
-
const minStr = void 0 !== min ? String(min) : void 0;
|
|
741
|
-
const maxStr = void 0 !== max ? String(max) : void 0;
|
|
742
|
-
const commitValue = useCallback((str)=>{
|
|
743
|
-
if (!str || '-' === str) {
|
|
744
|
-
setInnerValue('');
|
|
745
|
-
onChange?.('');
|
|
746
|
-
return;
|
|
747
|
-
}
|
|
748
|
-
if (/^-?\d+$/.test(str)) {
|
|
749
|
-
const clamped = clampStr(str, minStr, maxStr);
|
|
750
|
-
setInnerValue(clamped);
|
|
751
|
-
onChange?.(toSafeValue(clamped));
|
|
752
|
-
}
|
|
753
|
-
}, [
|
|
754
|
-
onChange,
|
|
755
|
-
minStr,
|
|
756
|
-
maxStr
|
|
757
|
-
]);
|
|
758
|
-
const handleChange = useCallback((inputVal)=>{
|
|
759
|
-
const filtered = filterIntegerChars(inputVal);
|
|
760
|
-
if ('' === filtered || '-' === filtered) return void setInnerValue(filtered);
|
|
761
|
-
if (/^-?\d+$/.test(filtered)) {
|
|
762
|
-
setInnerValue(filtered);
|
|
763
|
-
onChange?.(toSafeValue(filtered));
|
|
764
|
-
}
|
|
765
|
-
}, [
|
|
766
|
-
onChange
|
|
767
|
-
]);
|
|
768
|
-
const handleBlur = useCallback((e)=>{
|
|
769
|
-
commitValue(innerValue);
|
|
770
|
-
onBlur?.(e);
|
|
771
|
-
}, [
|
|
772
|
-
commitValue,
|
|
773
|
-
innerValue,
|
|
774
|
-
onBlur
|
|
775
|
-
]);
|
|
776
|
-
return /*#__PURE__*/ jsx(Input, {
|
|
777
|
-
...rest,
|
|
778
|
-
value: innerValue,
|
|
779
|
-
className: className,
|
|
780
|
-
style: style,
|
|
781
|
-
disabled: disabled,
|
|
782
|
-
placeholder: placeholder,
|
|
783
|
-
size: size,
|
|
784
|
-
onChange: handleChange,
|
|
785
|
-
onBlur: handleBlur,
|
|
786
|
-
type: "number"
|
|
787
|
-
});
|
|
788
|
-
};
|
|
789
689
|
const handleCopy = async (value, hideToast)=>{
|
|
790
690
|
try {
|
|
791
691
|
copy_to_clipboard(value);
|
|
@@ -1567,7 +1467,7 @@ function TableHeader({ columnSelectorConfigProps, tableColsConfigProps, filterFo
|
|
|
1567
1467
|
style: style,
|
|
1568
1468
|
children: [
|
|
1569
1469
|
/*#__PURE__*/ jsxs("div", {
|
|
1570
|
-
className: classnames('flex flex-row
|
|
1470
|
+
className: classnames('flex flex-row', table_header_index_module["table-header-form"]),
|
|
1571
1471
|
children: [
|
|
1572
1472
|
tableColsConfigProps ? /*#__PURE__*/ jsx(TableColsConfig, {
|
|
1573
1473
|
className: classnames('mr-2', tableColsConfigProps.className),
|
|
@@ -2168,8 +2068,8 @@ function FoxIcon(props) {
|
|
|
2168
2068
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2169
2069
|
...props,
|
|
2170
2070
|
children: /*#__PURE__*/ jsx("path", {
|
|
2171
|
-
|
|
2172
|
-
|
|
2071
|
+
"fill-rule": "evenodd",
|
|
2072
|
+
"clip-rule": "evenodd",
|
|
2173
2073
|
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",
|
|
2174
2074
|
fill: "currentColor"
|
|
2175
2075
|
})
|
|
@@ -2777,7 +2677,7 @@ function LogicExpr({ defaultExpr, value, onChange: _onChange, ...restProps }) {
|
|
|
2777
2677
|
}
|
|
2778
2678
|
function RadioButton({ value, onChange, options, disabled, className }) {
|
|
2779
2679
|
return /*#__PURE__*/ jsx("div", {
|
|
2780
|
-
className: classnames('w-full flex items-
|
|
2680
|
+
className: classnames('w-full flex items-center gap-[8px]', className),
|
|
2781
2681
|
children: options.map((option)=>{
|
|
2782
2682
|
const selected = value === option.value;
|
|
2783
2683
|
const optionDisabled = option.disabled || disabled;
|
|
@@ -2951,10 +2851,10 @@ function useDataTypeList() {
|
|
|
2951
2851
|
}
|
|
2952
2852
|
function RightRender(props) {
|
|
2953
2853
|
const { expr, onExprChange, fields, disabled = false } = props;
|
|
2954
|
-
const dataTypeList = useDataTypeList();
|
|
2955
2854
|
const field = findFieldByPath(fields, expr.left);
|
|
2956
2855
|
if (!field) return null;
|
|
2957
2856
|
if ('is-empty' === expr.operator || 'is-not-empty' === expr.operator) return null;
|
|
2857
|
+
const dataTypeList = useDataTypeList();
|
|
2958
2858
|
const Setter = field?.setter || dataTypeList.find((dataType)=>dataType.type === field.type)?.setter;
|
|
2959
2859
|
if (!Setter) return null;
|
|
2960
2860
|
return /*#__PURE__*/ jsx("div", {
|
|
@@ -3206,11 +3106,6 @@ function LogicEditor({ fields = [], disabled = false, value, popoverProps = {},
|
|
|
3206
3106
|
})
|
|
3207
3107
|
});
|
|
3208
3108
|
}
|
|
3209
|
-
loader.config({
|
|
3210
|
-
paths: {
|
|
3211
|
-
vs: "https://unpkg.com/monaco-editor@0.43.0/min/vs"
|
|
3212
|
-
}
|
|
3213
|
-
});
|
|
3214
3109
|
const BasicCard = ({ title, children, className })=>/*#__PURE__*/ jsxs("div", {
|
|
3215
3110
|
className: classnames('border border-solid coz-stroke-plus rounded-[6px] overflow-hidden', className),
|
|
3216
3111
|
children: [
|
|
@@ -4898,7 +4793,7 @@ function ObjectFieldTemplate(props) {
|
|
|
4898
4793
|
});
|
|
4899
4794
|
return /*#__PURE__*/ jsxs("fieldset", {
|
|
4900
4795
|
id: idSchema.$id,
|
|
4901
|
-
className:
|
|
4796
|
+
className: 'p-3 semi-card-bordered rounded-[4px]',
|
|
4902
4797
|
children: [
|
|
4903
4798
|
/*#__PURE__*/ jsx(Row, {
|
|
4904
4799
|
gutter: rowGutter,
|
|
@@ -5798,9 +5693,9 @@ const cozeDark = [
|
|
|
5798
5693
|
];
|
|
5799
5694
|
languages.register('json', {
|
|
5800
5695
|
language: mixLanguages({
|
|
5801
|
-
outerLanguage:
|
|
5696
|
+
outerLanguage: json.language
|
|
5802
5697
|
}),
|
|
5803
|
-
languageService:
|
|
5698
|
+
languageService: json.languageService
|
|
5804
5699
|
});
|
|
5805
5700
|
languages.register('shell', shell);
|
|
5806
5701
|
languages.register('python', python);
|
|
@@ -5992,7 +5887,7 @@ const CodeMirrorJsonEditor = /*#__PURE__*/ react.forwardRef((props, ref)=>{
|
|
|
5992
5887
|
const formatJson = async ()=>{
|
|
5993
5888
|
const view = apiRef.current?.$view;
|
|
5994
5889
|
if (!view) return;
|
|
5995
|
-
view.dispatch(await
|
|
5890
|
+
view.dispatch(await json.languageService.format(view.state, {
|
|
5996
5891
|
tabSize: 2
|
|
5997
5892
|
}));
|
|
5998
5893
|
};
|
|
@@ -6129,7 +6024,7 @@ const CodeMirrorRawCodeEditor = /*#__PURE__*/ react.forwardRef((props, ref)=>{
|
|
|
6129
6024
|
const formatJson = async ()=>{
|
|
6130
6025
|
const view = apiRef.current?.$view;
|
|
6131
6026
|
if (!view) return;
|
|
6132
|
-
view.dispatch(await
|
|
6027
|
+
view.dispatch(await json.languageService.format(view.state, {
|
|
6133
6028
|
tabSize: 2
|
|
6134
6029
|
}));
|
|
6135
6030
|
};
|
|
@@ -6199,52 +6094,6 @@ const SchemaEditor = ({ value, onChange, placeholder, readOnly, language, classN
|
|
|
6199
6094
|
backgroundColor: backgroundColor
|
|
6200
6095
|
})
|
|
6201
6096
|
});
|
|
6202
|
-
const code_editor_with_loading_index_module = {
|
|
6203
|
-
"code-container": "code-container-A_QOb1",
|
|
6204
|
-
codeContainer: "code-container-A_QOb1"
|
|
6205
|
-
};
|
|
6206
|
-
const codeOptionsConfig = {
|
|
6207
|
-
lineNumbersMinChars: 3,
|
|
6208
|
-
automaticLayout: true,
|
|
6209
|
-
scrollBeyondLastLine: false,
|
|
6210
|
-
renderLineHighlight: 'none',
|
|
6211
|
-
tabSize: 2,
|
|
6212
|
-
insertSpaces: true,
|
|
6213
|
-
minimap: {
|
|
6214
|
-
enabled: false
|
|
6215
|
-
}
|
|
6216
|
-
};
|
|
6217
|
-
const CodeEditorWithLoading = ({ value, onChange, disabled, className })=>{
|
|
6218
|
-
const [loading, setLoading] = useState(true);
|
|
6219
|
-
const LoadingNode = loading && /*#__PURE__*/ jsx("div", {
|
|
6220
|
-
className: "absolute bg-[white] z-20 top-0 bottom-0 left-0 right-0 flex items-center justify-center",
|
|
6221
|
-
children: /*#__PURE__*/ jsx(Loading, {
|
|
6222
|
-
loading: true
|
|
6223
|
-
})
|
|
6224
|
-
});
|
|
6225
|
-
const onEditorMount = ()=>{
|
|
6226
|
-
setLoading(false);
|
|
6227
|
-
};
|
|
6228
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
6229
|
-
className: classnames(code_editor_with_loading_index_module["code-container"], className),
|
|
6230
|
-
children: [
|
|
6231
|
-
LoadingNode,
|
|
6232
|
-
/*#__PURE__*/ jsx(_monaco_editor_react, {
|
|
6233
|
-
language: "json",
|
|
6234
|
-
value: value,
|
|
6235
|
-
options: {
|
|
6236
|
-
readOnly: disabled,
|
|
6237
|
-
...codeOptionsConfig
|
|
6238
|
-
},
|
|
6239
|
-
onMount: onEditorMount,
|
|
6240
|
-
theme: "vs-dark",
|
|
6241
|
-
onChange: (newValue)=>{
|
|
6242
|
-
onChange?.(newValue || '');
|
|
6243
|
-
}
|
|
6244
|
-
})
|
|
6245
|
-
]
|
|
6246
|
-
});
|
|
6247
|
-
};
|
|
6248
6097
|
const CollapseItem = ({ children, open: defaultOpen, title, className })=>{
|
|
6249
6098
|
const [open, setOpen] = useState(defaultOpen);
|
|
6250
6099
|
return /*#__PURE__*/ jsxs("div", {
|
|
@@ -6291,8 +6140,8 @@ function AudioRender({ audioUrl, audioName, className, showDownload, deletion, u
|
|
|
6291
6140
|
children: /*#__PURE__*/ jsx("img", {
|
|
6292
6141
|
src: audio_icon,
|
|
6293
6142
|
alt: audioName,
|
|
6294
|
-
width:
|
|
6295
|
-
height:
|
|
6143
|
+
width: '100%',
|
|
6144
|
+
height: '100%',
|
|
6296
6145
|
style: {
|
|
6297
6146
|
objectFit: 'cover',
|
|
6298
6147
|
objectPosition: 'center'
|
|
@@ -6408,8 +6257,8 @@ function VideoRender({ videoName, videoUrl, showDownload, deletion, upload, size
|
|
|
6408
6257
|
}) : null,
|
|
6409
6258
|
/*#__PURE__*/ jsx("video", {
|
|
6410
6259
|
src: videoUrl,
|
|
6411
|
-
width:
|
|
6412
|
-
height:
|
|
6260
|
+
width: '100%',
|
|
6261
|
+
height: '100%',
|
|
6413
6262
|
className: classnames('rounded-[6px] pointer-events-none', {
|
|
6414
6263
|
invisible: 'loaded' !== videoElementStatus || [
|
|
6415
6264
|
'error',
|
|
@@ -6515,349 +6364,7 @@ function VideoRender({ videoName, videoUrl, showDownload, deletion, upload, size
|
|
|
6515
6364
|
]
|
|
6516
6365
|
});
|
|
6517
6366
|
}
|
|
6518
|
-
function MentionNodeView(renderer, props) {
|
|
6519
|
-
const { node } = props;
|
|
6520
|
-
const extra = 'string' == typeof node.attrs.data ? safeJsonParse(node.attrs.data, {}) : {};
|
|
6521
|
-
const item = {
|
|
6522
|
-
id: node.attrs.id,
|
|
6523
|
-
label: node.attrs.label,
|
|
6524
|
-
...extra
|
|
6525
|
-
};
|
|
6526
|
-
const Component = renderer;
|
|
6527
|
-
return /*#__PURE__*/ jsx(NodeViewWrapper, {
|
|
6528
|
-
as: "span",
|
|
6529
|
-
className: "inline",
|
|
6530
|
-
children: /*#__PURE__*/ jsx(Component, {
|
|
6531
|
-
item: item
|
|
6532
|
-
})
|
|
6533
|
-
});
|
|
6534
|
-
}
|
|
6535
|
-
const MENTION_PLUGIN_KEY = new PluginKey('mention');
|
|
6536
|
-
const MENTION_KEYDOWN_KEY = new PluginKey('mentionKeydown');
|
|
6537
|
-
function getBackspaceRange(state, pos) {
|
|
6538
|
-
const $pos = state.doc.resolve(pos);
|
|
6539
|
-
if ($pos.nodeBefore?.type.name === 'mention') return {
|
|
6540
|
-
from: pos - $pos.nodeBefore.nodeSize,
|
|
6541
|
-
to: pos
|
|
6542
|
-
};
|
|
6543
|
-
if ($pos.nodeBefore?.isText && $pos.nodeAfter?.type.name === 'mention') return {
|
|
6544
|
-
from: pos - 1,
|
|
6545
|
-
to: pos
|
|
6546
|
-
};
|
|
6547
|
-
return null;
|
|
6548
|
-
}
|
|
6549
|
-
function getDeleteRange(state, pos) {
|
|
6550
|
-
const $pos = state.doc.resolve(pos);
|
|
6551
|
-
if ($pos.nodeAfter?.type.name === 'mention') return {
|
|
6552
|
-
from: pos,
|
|
6553
|
-
to: pos + $pos.nodeAfter.nodeSize
|
|
6554
|
-
};
|
|
6555
|
-
if ($pos.nodeAfter?.isText && $pos.nodeBefore?.type.name === 'mention') return {
|
|
6556
|
-
from: pos,
|
|
6557
|
-
to: pos + 1
|
|
6558
|
-
};
|
|
6559
|
-
return null;
|
|
6560
|
-
}
|
|
6561
|
-
function createMentionExtension(options) {
|
|
6562
|
-
return extension_mention.configure({
|
|
6563
|
-
HTMLAttributes: {
|
|
6564
|
-
class: 'mention-node'
|
|
6565
|
-
},
|
|
6566
|
-
suggestion: {
|
|
6567
|
-
char: '@',
|
|
6568
|
-
pluginKey: MENTION_PLUGIN_KEY,
|
|
6569
|
-
items: ()=>[],
|
|
6570
|
-
render: ()=>({
|
|
6571
|
-
onStart: (props)=>{
|
|
6572
|
-
const rect = props.clientRect?.();
|
|
6573
|
-
if (rect && options.onMentionTrigger) options.onMentionTrigger({
|
|
6574
|
-
query: props.query,
|
|
6575
|
-
position: {
|
|
6576
|
-
x: rect.left,
|
|
6577
|
-
y: rect.bottom
|
|
6578
|
-
},
|
|
6579
|
-
command: props.command
|
|
6580
|
-
});
|
|
6581
|
-
},
|
|
6582
|
-
onUpdate: (props)=>{
|
|
6583
|
-
const rect = props.clientRect?.();
|
|
6584
|
-
if (rect && options.onMentionTrigger) options.onMentionTrigger({
|
|
6585
|
-
query: props.query,
|
|
6586
|
-
position: {
|
|
6587
|
-
x: rect.left,
|
|
6588
|
-
y: rect.bottom
|
|
6589
|
-
},
|
|
6590
|
-
command: props.command
|
|
6591
|
-
});
|
|
6592
|
-
},
|
|
6593
|
-
onKeyDown: ()=>false,
|
|
6594
|
-
onExit: ()=>{
|
|
6595
|
-
options.onMentionDismiss?.();
|
|
6596
|
-
}
|
|
6597
|
-
})
|
|
6598
|
-
}
|
|
6599
|
-
}).extend({
|
|
6600
|
-
atom: true,
|
|
6601
|
-
selectable: false,
|
|
6602
|
-
renderHTML ({ node, HTMLAttributes: htmlAttributes }) {
|
|
6603
|
-
return [
|
|
6604
|
-
'span',
|
|
6605
|
-
mergeAttributes({
|
|
6606
|
-
'data-type': 'mention'
|
|
6607
|
-
}, htmlAttributes),
|
|
6608
|
-
`@${node.attrs.label ?? ''}`
|
|
6609
|
-
];
|
|
6610
|
-
},
|
|
6611
|
-
addAttributes () {
|
|
6612
|
-
return {
|
|
6613
|
-
id: {
|
|
6614
|
-
default: null,
|
|
6615
|
-
parseHTML: (element)=>element.getAttribute('data-id'),
|
|
6616
|
-
renderHTML: (attributes)=>attributes.id ? {
|
|
6617
|
-
'data-id': attributes.id
|
|
6618
|
-
} : {}
|
|
6619
|
-
},
|
|
6620
|
-
label: {
|
|
6621
|
-
default: null,
|
|
6622
|
-
parseHTML: (element)=>element.getAttribute('data-label'),
|
|
6623
|
-
renderHTML: (attributes)=>attributes.label ? {
|
|
6624
|
-
'data-label': attributes.label
|
|
6625
|
-
} : {}
|
|
6626
|
-
},
|
|
6627
|
-
data: {
|
|
6628
|
-
default: null,
|
|
6629
|
-
parseHTML: (element)=>element.getAttribute('data-data'),
|
|
6630
|
-
renderHTML: (attributes)=>attributes.data ? {
|
|
6631
|
-
'data-data': attributes.data
|
|
6632
|
-
} : {}
|
|
6633
|
-
}
|
|
6634
|
-
};
|
|
6635
|
-
},
|
|
6636
|
-
addNodeView () {
|
|
6637
|
-
return ReactNodeViewRenderer(MentionNodeView.bind(null, options.mentionRenderer), {
|
|
6638
|
-
as: 'span',
|
|
6639
|
-
className: 'mention-node-wrapper'
|
|
6640
|
-
});
|
|
6641
|
-
},
|
|
6642
|
-
addProseMirrorPlugins () {
|
|
6643
|
-
const getParentPlugins = this.parent;
|
|
6644
|
-
const parentPlugins = getParentPlugins?.() ?? [];
|
|
6645
|
-
return [
|
|
6646
|
-
...parentPlugins,
|
|
6647
|
-
new Plugin({
|
|
6648
|
-
key: MENTION_KEYDOWN_KEY,
|
|
6649
|
-
props: {
|
|
6650
|
-
handleKeyDown: (view, event)=>{
|
|
6651
|
-
const { state } = view;
|
|
6652
|
-
const { selection } = state;
|
|
6653
|
-
if (!selection.empty || selection instanceof NodeSelection) return false;
|
|
6654
|
-
const { pos } = selection.$from;
|
|
6655
|
-
if ('Backspace' === event.key) {
|
|
6656
|
-
const range = getBackspaceRange(state, pos);
|
|
6657
|
-
if (range) {
|
|
6658
|
-
view.dispatch(state.tr.delete(range.from, range.to));
|
|
6659
|
-
return true;
|
|
6660
|
-
}
|
|
6661
|
-
}
|
|
6662
|
-
if ('Delete' === event.key) {
|
|
6663
|
-
const range = getDeleteRange(state, pos);
|
|
6664
|
-
if (range) {
|
|
6665
|
-
view.dispatch(state.tr.delete(range.from, range.to));
|
|
6666
|
-
return true;
|
|
6667
|
-
}
|
|
6668
|
-
}
|
|
6669
|
-
return false;
|
|
6670
|
-
}
|
|
6671
|
-
}
|
|
6672
|
-
})
|
|
6673
|
-
];
|
|
6674
|
-
}
|
|
6675
|
-
});
|
|
6676
|
-
}
|
|
6677
|
-
function extractMentions(editor) {
|
|
6678
|
-
const mentions = [];
|
|
6679
|
-
const json = editor.getJSON();
|
|
6680
|
-
function traverse(node) {
|
|
6681
|
-
if ('mention' === node.type && node.attrs) {
|
|
6682
|
-
const attrs = node.attrs;
|
|
6683
|
-
const extra = 'string' == typeof attrs.data ? safeJsonParse(attrs.data, {}) : {};
|
|
6684
|
-
mentions.push({
|
|
6685
|
-
id: attrs.id,
|
|
6686
|
-
label: attrs.label,
|
|
6687
|
-
...extra
|
|
6688
|
-
});
|
|
6689
|
-
}
|
|
6690
|
-
if (Array.isArray(node.content)) node.content.forEach(traverse);
|
|
6691
|
-
}
|
|
6692
|
-
if (json.content) json.content.forEach((node)=>traverse(node));
|
|
6693
|
-
return mentions;
|
|
6694
|
-
}
|
|
6695
|
-
const rich_text_editor_index_module = {
|
|
6696
|
-
editor: "editor-uWaaem",
|
|
6697
|
-
disabled: "disabled-OrSmN6",
|
|
6698
|
-
"editor-content": "editor-content-T5fMRg",
|
|
6699
|
-
editorContent: "editor-content-T5fMRg"
|
|
6700
|
-
};
|
|
6701
|
-
function isExceedMaxLength(docLength, inputLength, maxLen) {
|
|
6702
|
-
if (null == maxLen) return false;
|
|
6703
|
-
return docLength + inputLength > maxLen;
|
|
6704
|
-
}
|
|
6705
|
-
function useEditorActions(editor) {
|
|
6706
|
-
const insertMention = useCallback((item)=>{
|
|
6707
|
-
if (!editor) return;
|
|
6708
|
-
const { id, label, ...rest } = item;
|
|
6709
|
-
const data = Object.keys(rest).length > 0 ? JSON.stringify(rest) : null;
|
|
6710
|
-
editor.chain().focus().insertContent({
|
|
6711
|
-
type: 'mention',
|
|
6712
|
-
attrs: {
|
|
6713
|
-
id,
|
|
6714
|
-
label,
|
|
6715
|
-
data
|
|
6716
|
-
}
|
|
6717
|
-
}).insertContent(' ').run();
|
|
6718
|
-
}, [
|
|
6719
|
-
editor
|
|
6720
|
-
]);
|
|
6721
|
-
const getText = useCallback(()=>{
|
|
6722
|
-
if (!editor) return '';
|
|
6723
|
-
return editor.getText().replace(/\n$/, '');
|
|
6724
|
-
}, [
|
|
6725
|
-
editor
|
|
6726
|
-
]);
|
|
6727
|
-
const getMentions = useCallback(()=>{
|
|
6728
|
-
if (!editor) return [];
|
|
6729
|
-
return extractMentions(editor);
|
|
6730
|
-
}, [
|
|
6731
|
-
editor
|
|
6732
|
-
]);
|
|
6733
|
-
const focus = useCallback(()=>{
|
|
6734
|
-
editor?.commands.focus();
|
|
6735
|
-
}, [
|
|
6736
|
-
editor
|
|
6737
|
-
]);
|
|
6738
|
-
const setValue = useCallback((text)=>{
|
|
6739
|
-
if (!editor) return;
|
|
6740
|
-
editor.commands.setContent(text ? `<p>${text}</p>` : '');
|
|
6741
|
-
}, [
|
|
6742
|
-
editor
|
|
6743
|
-
]);
|
|
6744
|
-
return {
|
|
6745
|
-
insertMention,
|
|
6746
|
-
getText,
|
|
6747
|
-
getMentions,
|
|
6748
|
-
focus,
|
|
6749
|
-
setValue
|
|
6750
|
-
};
|
|
6751
|
-
}
|
|
6752
|
-
const editor_RichTextEditor = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
6753
|
-
const { value, placeholder, disabled, maxLength, maxHeight, onTextChange, onMentionsChange, onMentionTrigger, onMentionDismiss, onKeyDown, mentionRenderer, className, contentClassName, contentStyle } = props;
|
|
6754
|
-
const onTextChangeRef = useLatest(onTextChange);
|
|
6755
|
-
const onMentionsChangeRef = useLatest(onMentionsChange);
|
|
6756
|
-
const onKeyDownRef = useLatest(onKeyDown);
|
|
6757
|
-
const onMentionTriggerRef = useLatest(onMentionTrigger);
|
|
6758
|
-
const onMentionDismissRef = useLatest(onMentionDismiss);
|
|
6759
|
-
const maxLengthRef = useLatest(maxLength);
|
|
6760
|
-
const mentionExtension = useMemo(()=>mentionRenderer ? createMentionExtension({
|
|
6761
|
-
mentionRenderer,
|
|
6762
|
-
onMentionTrigger: (...args)=>onMentionTriggerRef.current?.(...args),
|
|
6763
|
-
onMentionDismiss: ()=>onMentionDismissRef.current?.()
|
|
6764
|
-
}) : null, [
|
|
6765
|
-
mentionRenderer
|
|
6766
|
-
]);
|
|
6767
|
-
const editor = useEditor({
|
|
6768
|
-
extensions: [
|
|
6769
|
-
extension_document,
|
|
6770
|
-
extension_paragraph,
|
|
6771
|
-
extension_text,
|
|
6772
|
-
extension_hard_break,
|
|
6773
|
-
extension_history,
|
|
6774
|
-
extension_placeholder.configure({
|
|
6775
|
-
placeholder
|
|
6776
|
-
}),
|
|
6777
|
-
...mentionExtension ? [
|
|
6778
|
-
mentionExtension
|
|
6779
|
-
] : []
|
|
6780
|
-
],
|
|
6781
|
-
content: value ? `<p>${value}</p>` : '',
|
|
6782
|
-
editable: !disabled,
|
|
6783
|
-
editorProps: {
|
|
6784
|
-
handleKeyDown: (_view, event)=>{
|
|
6785
|
-
if (onKeyDownRef.current?.(event) === true) return true;
|
|
6786
|
-
return false;
|
|
6787
|
-
},
|
|
6788
|
-
handleTextInput: (view, _from, _to)=>{
|
|
6789
|
-
const currentLength = view.state.doc.textContent.length;
|
|
6790
|
-
return isExceedMaxLength(currentLength, 1, maxLengthRef.current);
|
|
6791
|
-
},
|
|
6792
|
-
handlePaste: (view, _event, slice)=>{
|
|
6793
|
-
const currentLength = view.state.doc.textContent.length;
|
|
6794
|
-
const pasteLength = slice.content.textBetween(0, slice.content.size).length;
|
|
6795
|
-
return isExceedMaxLength(currentLength, pasteLength, maxLengthRef.current);
|
|
6796
|
-
}
|
|
6797
|
-
},
|
|
6798
|
-
onUpdate: ({ editor: e })=>{
|
|
6799
|
-
const text = e.getText().replace(/\n$/, '');
|
|
6800
|
-
onTextChangeRef.current?.(text);
|
|
6801
|
-
const mentions = extractMentions(e);
|
|
6802
|
-
onMentionsChangeRef.current?.(mentions);
|
|
6803
|
-
}
|
|
6804
|
-
});
|
|
6805
|
-
useEffect(()=>{
|
|
6806
|
-
if (editor) editor.setEditable(!disabled);
|
|
6807
|
-
}, [
|
|
6808
|
-
editor,
|
|
6809
|
-
disabled
|
|
6810
|
-
]);
|
|
6811
|
-
const { insertMention, getText, getMentions, focus, setValue } = useEditorActions(editor);
|
|
6812
|
-
useImperativeHandle(ref, ()=>({
|
|
6813
|
-
insertMention,
|
|
6814
|
-
getText,
|
|
6815
|
-
getMentions,
|
|
6816
|
-
focus,
|
|
6817
|
-
setValue
|
|
6818
|
-
}));
|
|
6819
|
-
return /*#__PURE__*/ jsx("div", {
|
|
6820
|
-
className: classnames(rich_text_editor_index_module.editor, className, {
|
|
6821
|
-
[rich_text_editor_index_module.disabled]: disabled
|
|
6822
|
-
}),
|
|
6823
|
-
style: maxHeight ? {
|
|
6824
|
-
maxHeight
|
|
6825
|
-
} : void 0,
|
|
6826
|
-
children: /*#__PURE__*/ jsx("div", {
|
|
6827
|
-
className: classnames(rich_text_editor_index_module["editor-content"], contentClassName),
|
|
6828
|
-
style: contentStyle,
|
|
6829
|
-
children: /*#__PURE__*/ jsx(EditorContent, {
|
|
6830
|
-
editor: editor
|
|
6831
|
-
})
|
|
6832
|
-
})
|
|
6833
|
-
});
|
|
6834
|
-
});
|
|
6835
|
-
const AccessibleOptionLabel = /*#__PURE__*/ forwardRef(({ children, ...restProps }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
6836
|
-
role: "option",
|
|
6837
|
-
tabIndex: -1,
|
|
6838
|
-
...restProps,
|
|
6839
|
-
ref: ref,
|
|
6840
|
-
children: children
|
|
6841
|
-
}));
|
|
6842
|
-
function banner_Banner(props) {
|
|
6843
|
-
const { content, buttonText, onButtonClick, className } = props;
|
|
6844
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
6845
|
-
className: `flex items-center justify-between w-full bg-[var(--coz-mg-hglt-secondary)] p-3 coz-fg-primary text-[14px] ${className || ''}`,
|
|
6846
|
-
children: [
|
|
6847
|
-
/*#__PURE__*/ jsx(Typography.Text, {
|
|
6848
|
-
children: content
|
|
6849
|
-
}),
|
|
6850
|
-
buttonText ? /*#__PURE__*/ jsx(Button, {
|
|
6851
|
-
color: "primary",
|
|
6852
|
-
size: "mini",
|
|
6853
|
-
className: "!text-brand !font-medium",
|
|
6854
|
-
onClick: onButtonClick,
|
|
6855
|
-
children: buttonText
|
|
6856
|
-
}) : null
|
|
6857
|
-
]
|
|
6858
|
-
});
|
|
6859
|
-
}
|
|
6860
6367
|
var src_DEFAULT_FILE_COUNT = 20;
|
|
6861
6368
|
var src_DEFAULT_PART_COUNT = 50;
|
|
6862
6369
|
export { default as schemaValidators } from "@rjsf/validator-ajv8";
|
|
6863
|
-
export {
|
|
6370
|
+
export { AudioRender, BasicCard, CardPane, ChipSelect, CodeMirrorCodeEditor, CodeMirrorJsonEditor, CodeMirrorRawCodeEditor, CodeMirrorRawTextEditor, CodeMirrorTextEditor, CollapseCard, CollapseItem, ColumnSelector, Copyable, DEFAULT_FILE_SIZE, DEFAULT_PAGE_SIZE, DEFAULT_SUPPORTED_FORMATS, DEFAULT_VIDEO_SUPPORTED_FORMATS, 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, 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
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { withField } from '@coze-arch/coze-design';
|
|
3
|
+
import BaseSearchSelect from './base-search-select';
|
|
4
|
+
const BaseSearchFormSelect = withField((props) => _jsx(BaseSearchSelect, { ...props }));
|
|
5
|
+
export default BaseSearchFormSelect;
|
|
6
|
+
//# sourceMappingURL=base-search-form-select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-search-form-select.js","sourceRoot":"","sources":["../../../src/base-search-select/base-search-form-select.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AAEpD,MAAM,oBAAoB,GAA8B,SAAS,CAC/D,CAAC,KAAsB,EAAE,EAAE,CAAC,KAAC,gBAAgB,OAAK,KAAK,GAAI,CAC5D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|