@cozeloop/components 0.0.12-beta-1015.7823330163956 → 0.0.12-beta-1778488172610
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 +38 -0
- package/dist/es/index.mjs +459 -18
- package/dist/lib/accessible-option-label/index.d.ts +14 -0
- package/dist/lib/banner/index.d.ts +8 -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 +4 -0
- package/dist/lib/input-number-bigint/__tests__/input-number-bigint.test.d.ts +1 -0
- package/dist/lib/input-number-bigint/index.d.ts +3 -0
- package/dist/lib/rich-text-editor/editor.d.ts +2 -0
- package/dist/lib/rich-text-editor/index.d.ts +2 -0
- package/dist/lib/rich-text-editor/mention-extension.d.ts +16 -0
- package/dist/lib/rich-text-editor/mention-node-view.d.ts +4 -0
- package/dist/lib/rich-text-editor/types.d.ts +45 -0
- package/dist/lib/sentinel-form/index.d.ts +1 -1
- package/dist/lib/table-header/index.d.ts +1 -1
- package/package.json +21 -31
- 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/code-editor/index.js +0 -9
- package/dist/lib/code-editor/index.js.map +0 -1
- package/dist/lib/code-editor-with-loading/index.js +0 -31
- package/dist/lib/code-editor-with-loading/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 -79
- 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
package/dist/es/index.css
CHANGED
|
@@ -643,3 +643,41 @@
|
|
|
643
643
|
overflow: auto;
|
|
644
644
|
}
|
|
645
645
|
|
|
646
|
+
.editor-uWaaem {
|
|
647
|
+
flex-direction: column;
|
|
648
|
+
display: flex;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
.editor-uWaaem.disabled-OrSmN6 {
|
|
652
|
+
opacity: .5;
|
|
653
|
+
pointer-events: none;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
.editor-content-T5fMRg {
|
|
657
|
+
overflow-y: auto;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
.editor-content-T5fMRg .tiptap {
|
|
661
|
+
min-height: 96px;
|
|
662
|
+
color: var(--semi-color-text-0);
|
|
663
|
+
font-size: 14px;
|
|
664
|
+
line-height: 22px;
|
|
665
|
+
outline: none !important;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
.editor-content-T5fMRg .tiptap p {
|
|
669
|
+
margin: 0;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
.editor-content-T5fMRg .tiptap p.is-editor-empty:before {
|
|
673
|
+
float: left;
|
|
674
|
+
height: 0;
|
|
675
|
+
color: var(--color-text-3);
|
|
676
|
+
pointer-events: none;
|
|
677
|
+
content: attr(data-placeholder);
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
.editor-content-T5fMRg .mention-node-wrapper {
|
|
681
|
+
display: inline;
|
|
682
|
+
}
|
|
683
|
+
|
package/dist/es/index.mjs
CHANGED
|
@@ -22,7 +22,7 @@ import { ContentType } from "@cozeloop/api-schema/evaluation";
|
|
|
22
22
|
import { ItemErrorType, StorageProvider } from "@cozeloop/api-schema/data";
|
|
23
23
|
import { ContentType as prompt_ContentType } from "@cozeloop/api-schema/prompt";
|
|
24
24
|
import { withTheme } from "@rjsf/core";
|
|
25
|
-
import {
|
|
25
|
+
import { mergeAttributes } from "@tiptap/core";
|
|
26
26
|
import { TranslatableString, ariaDescribedByIds, canExpand, enumOptionsIndexForValue, enumOptionsValueForIndex, errorId, examplesId, getInputProps, getSubmitButtonOptions, getTemplate, getUiOptions, optionId, rangeSpec } from "@rjsf/utils";
|
|
27
27
|
import { useMouseDownOffset as hooks_useMouseDownOffset } from "@cozeloop/hooks";
|
|
28
28
|
import dayjs from "dayjs";
|
|
@@ -32,12 +32,22 @@ import preset_code, { createTheme, languages, tags, themes, transformerCreator }
|
|
|
32
32
|
import { typescript } from "@coze-editor/editor/language-typescript";
|
|
33
33
|
import { shell } from "@coze-editor/editor/language-shell";
|
|
34
34
|
import { python } from "@coze-editor/editor/language-python";
|
|
35
|
-
import { json } from "@coze-editor/editor/language-json";
|
|
35
|
+
import { json as language_json_json } from "@coze-editor/editor/language-json";
|
|
36
36
|
import { mixLanguages } from "@coze-editor/editor";
|
|
37
37
|
import { EditorView, keymap } from "@codemirror/view";
|
|
38
38
|
import { markdownLanguage } from "@codemirror/lang-markdown";
|
|
39
39
|
import { goLanguage } from "@codemirror/lang-go";
|
|
40
40
|
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";
|
|
41
51
|
var external_react_sortable_hoc_namespaceObject = {};
|
|
42
52
|
__webpack_require__.r(external_react_sortable_hoc_namespaceObject);
|
|
43
53
|
__webpack_require__.d(external_react_sortable_hoc_namespaceObject, {
|
|
@@ -518,6 +528,7 @@ function TableColActions({ actions, maxCount = 2, disabled, spaceProps = {}, wra
|
|
|
518
528
|
position: "bottomLeft",
|
|
519
529
|
visible: visible,
|
|
520
530
|
trigger: "custom",
|
|
531
|
+
keepDOM: true,
|
|
521
532
|
className: table_col_actions_index_module.tableColActionsDropdown,
|
|
522
533
|
onClickOutSide: ()=>setVisible(false),
|
|
523
534
|
render: /*#__PURE__*/ jsx(Menu.SubMenu, {
|
|
@@ -687,6 +698,94 @@ const InputSlider = ({ value, onChange, max = 1, min = 0, step = 1, disabled, de
|
|
|
687
698
|
]
|
|
688
699
|
});
|
|
689
700
|
};
|
|
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
|
+
};
|
|
690
789
|
const handleCopy = async (value, hideToast)=>{
|
|
691
790
|
try {
|
|
692
791
|
copy_to_clipboard(value);
|
|
@@ -1468,7 +1567,7 @@ function TableHeader({ columnSelectorConfigProps, tableColsConfigProps, filterFo
|
|
|
1468
1567
|
style: style,
|
|
1469
1568
|
children: [
|
|
1470
1569
|
/*#__PURE__*/ jsxs("div", {
|
|
1471
|
-
className: classnames('flex flex-row', table_header_index_module["table-header-form"]),
|
|
1570
|
+
className: classnames('flex flex-row gap-2', table_header_index_module["table-header-form"]),
|
|
1472
1571
|
children: [
|
|
1473
1572
|
tableColsConfigProps ? /*#__PURE__*/ jsx(TableColsConfig, {
|
|
1474
1573
|
className: classnames('mr-2', tableColsConfigProps.className),
|
|
@@ -2069,8 +2168,8 @@ function FoxIcon(props) {
|
|
|
2069
2168
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2070
2169
|
...props,
|
|
2071
2170
|
children: /*#__PURE__*/ jsx("path", {
|
|
2072
|
-
|
|
2073
|
-
|
|
2171
|
+
fillRule: "evenodd",
|
|
2172
|
+
clipRule: "evenodd",
|
|
2074
2173
|
d: "M17.3473 0.00458872C17.6452 -0.0249179 17.8984 0.0924468 18.0643 0.22551C18.2039 0.337458 18.311 0.480293 18.3839 0.632946L18.4455 0.788677C18.9386 2.35659 19.2117 3.98764 19.2323 5.66342C19.2496 7.06943 19.028 8.43596 18.5994 9.74231C18.4824 10.0985 18.3598 10.4185 18.2327 10.7437C18.5945 11.6085 18.7963 11.9852 19.3862 12.291L19.4803 12.3463C19.6952 12.4866 19.8763 12.7081 19.952 12.9601C20.0925 13.4261 19.8963 13.8039 19.7275 14.0303C19.8107 14.1519 19.8714 14.2882 19.9013 14.4314L19.9194 14.5528L19.923 14.6913C19.9144 14.9626 19.8085 15.2017 19.6578 15.3858L19.579 15.4727C19.3622 15.6904 19.1371 15.8828 18.909 16.0639C18.9132 16.3533 18.8058 16.6484 18.5569 16.8752C18.1728 17.2245 17.7771 17.5072 17.369 17.7724C16.133 18.5756 14.8037 19.1596 13.4108 19.538C11.7645 19.985 10.0607 20.1177 8.36983 19.892L8.03214 19.8422C6.42044 19.5812 4.86137 19.0583 3.40307 18.2378C2.8119 17.9052 2.24025 17.5348 1.69738 17.0925L1.46652 16.8987C1.2029 16.6701 1.08674 16.3641 1.0908 16.063C0.856606 15.876 0.626184 15.676 0.402728 15.4473C0.196646 15.2361 0.0934939 14.9598 0.0813275 14.6958V14.5827C0.0924408 14.3739 0.168182 14.1872 0.274168 14.0331C0.116351 13.8246 -0.056844 13.4996 0.0179528 13.086L0.0523562 12.952C0.0944353 12.825 0.157325 12.7169 0.218941 12.6342C0.303909 12.5202 0.428066 12.3967 0.592852 12.3092C0.990539 12.0971 1.30244 11.7816 1.4982 11.3467L1.76709 10.7491C1.60741 10.3354 1.44542 9.91056 1.30536 9.45801L1.17318 8.99444C0.896754 7.92354 0.741676 6.82226 0.759437 5.68425C0.785604 4.00887 1.0531 2.37139 1.5489 0.797731C1.61307 0.593854 1.7371 0.392143 1.91919 0.240902C2.08183 0.105885 2.32977 -0.0153893 2.62537 0.00639955L2.75483 0.0245078L3.002 0.0824543C3.57183 0.227991 4.10063 0.45088 4.60809 0.725298C4.99366 0.933989 5.36143 1.15067 5.73978 1.41522L6.12999 1.69952C6.94325 2.31568 7.68001 3.03054 8.33814 3.83901C9.43758 3.62204 10.5554 3.60883 11.6644 3.8363C12.8158 2.42292 14.2552 1.24358 15.8643 0.490796L16.2011 0.344119C16.5378 0.209745 16.874 0.1087 17.2169 0.0263186L17.3473 0.00458872ZM16.1323 13.5315C15.9372 13.4809 15.744 13.4809 15.5185 13.5206C15.277 13.5631 15.0325 13.6425 14.7019 13.7442C14.3865 13.8413 14.0147 13.9508 13.5937 14.0113C12.8132 14.1237 12.0265 14.1006 11.2344 13.8791C11.1656 13.8599 11.1042 13.8279 11.0479 13.7904C10.8602 13.9683 10.6827 14.1123 10.5626 14.177C10.171 14.3881 9.78919 14.3695 9.42909 14.1653C9.30978 14.0977 9.13806 13.969 8.95741 13.8094C8.90286 13.8454 8.84427 13.8773 8.77815 13.8963C7.69507 14.2086 6.58695 14.1547 5.54694 13.8447L4.77196 13.6139C4.29494 13.4717 3.77066 13.5654 3.30167 13.8882L2.72405 14.2866C2.6605 14.3303 2.55946 14.3872 2.4778 14.4333C2.3859 14.4851 2.27261 14.5484 2.16726 14.6071C2.05907 14.6674 1.9557 14.7252 1.87302 14.7737C1.86167 14.7804 1.85078 14.7861 1.84133 14.7918C2.00333 14.929 2.17466 15.0654 2.36463 15.2056C2.53367 15.3304 2.6406 15.5222 2.65796 15.7316C2.66485 15.8154 2.6564 15.8984 2.63533 15.9779C3.09344 16.3491 3.58638 16.6696 4.11739 16.9684C5.41703 17.6996 6.81148 18.169 8.26481 18.4044C9.849 18.661 11.4607 18.5585 13.0288 18.1328C14.2805 17.7928 15.47 17.269 16.575 16.551C16.8615 16.3648 17.119 16.1811 17.3618 15.9806C17.3407 15.9016 17.3326 15.8186 17.3392 15.7352C17.3559 15.5232 17.4651 15.329 17.637 15.2038C17.8247 15.067 17.9952 14.9312 18.1576 14.7945L16.9354 13.9914L16.9055 13.9715L16.8783 13.9489C16.5728 13.697 16.3297 13.5827 16.1323 13.5315ZM2.84537 1.55103C2.45276 2.89409 2.23746 4.28462 2.21524 5.70688C2.19981 6.69527 2.33488 7.66534 2.58372 8.62956C2.72339 9.17012 2.9127 9.67016 3.12784 10.2276C3.22799 10.4869 3.30754 10.8775 3.12512 11.2824L2.82726 11.9443C2.55715 12.5446 2.14809 13.0151 1.65211 13.3622C1.65547 13.365 1.65859 13.3683 1.66207 13.3712C1.72092 13.3383 1.77678 13.308 1.82685 13.2798C1.87035 13.2552 1.9074 13.2348 1.93549 13.2182C1.95864 13.2045 1.96979 13.1973 1.97261 13.1956L2.55022 12.7981C3.30501 12.2784 4.24044 12.0733 5.1504 12.3445L5.92538 12.5753C6.67088 12.7976 7.42708 12.8452 8.15526 12.6867C8.14645 12.6272 8.14499 12.5703 8.15617 12.5165C8.33464 11.6599 11.6219 11.6127 11.8464 12.5056C11.8584 12.5533 11.8554 12.6066 11.8446 12.665C12.3521 12.7718 12.8684 12.7776 13.4054 12.7003C13.7171 12.6554 14.0054 12.573 14.3126 12.4785C14.6045 12.3886 14.9462 12.2772 15.2894 12.2168C15.6487 12.1536 16.0402 12.1394 16.4646 12.2494C16.876 12.3561 17.2778 12.5693 17.6877 12.9013L18.0544 13.1421C17.4318 12.6067 17.1505 11.9363 16.8575 11.2317L16.8122 11.105C16.7252 10.8091 16.7595 10.5133 16.8539 10.272L17.0431 9.77762C17.1029 9.61658 17.1599 9.45606 17.2151 9.28779C17.5956 8.12797 17.7908 6.92096 17.7755 5.68153C17.7582 4.26964 17.5417 2.89036 17.1527 1.55466C16.9222 1.62547 16.701 1.70754 16.4818 1.80998C15.0162 2.49561 13.6799 3.60991 12.6205 4.9735C12.4069 5.2487 12.0396 5.42202 11.6372 5.32299C10.5631 5.05697 9.46383 5.06547 8.36802 5.31937C8.24642 5.34763 8.07205 5.36767 7.87823 5.31393C7.67197 5.25662 7.50583 5.13393 7.38662 4.97984C6.66704 4.05181 5.83672 3.2614 4.90505 2.60946C4.66539 2.44189 4.42745 2.29434 4.17443 2.15042L3.9155 2.00736C3.55847 1.81427 3.20621 1.66062 2.84537 1.55103Z",
|
|
2075
2174
|
fill: "currentColor"
|
|
2076
2175
|
})
|
|
@@ -2678,7 +2777,7 @@ function LogicExpr({ defaultExpr, value, onChange: _onChange, ...restProps }) {
|
|
|
2678
2777
|
}
|
|
2679
2778
|
function RadioButton({ value, onChange, options, disabled, className }) {
|
|
2680
2779
|
return /*#__PURE__*/ jsx("div", {
|
|
2681
|
-
className: classnames('w-full flex items-
|
|
2780
|
+
className: classnames('w-full flex items-stretch gap-[8px]', className),
|
|
2682
2781
|
children: options.map((option)=>{
|
|
2683
2782
|
const selected = value === option.value;
|
|
2684
2783
|
const optionDisabled = option.disabled || disabled;
|
|
@@ -2852,10 +2951,10 @@ function useDataTypeList() {
|
|
|
2852
2951
|
}
|
|
2853
2952
|
function RightRender(props) {
|
|
2854
2953
|
const { expr, onExprChange, fields, disabled = false } = props;
|
|
2954
|
+
const dataTypeList = useDataTypeList();
|
|
2855
2955
|
const field = findFieldByPath(fields, expr.left);
|
|
2856
2956
|
if (!field) return null;
|
|
2857
2957
|
if ('is-empty' === expr.operator || 'is-not-empty' === expr.operator) return null;
|
|
2858
|
-
const dataTypeList = useDataTypeList();
|
|
2859
2958
|
const Setter = field?.setter || dataTypeList.find((dataType)=>dataType.type === field.type)?.setter;
|
|
2860
2959
|
if (!Setter) return null;
|
|
2861
2960
|
return /*#__PURE__*/ jsx("div", {
|
|
@@ -4799,7 +4898,7 @@ function ObjectFieldTemplate(props) {
|
|
|
4799
4898
|
});
|
|
4800
4899
|
return /*#__PURE__*/ jsxs("fieldset", {
|
|
4801
4900
|
id: idSchema.$id,
|
|
4802
|
-
className:
|
|
4901
|
+
className: "p-3 semi-card-bordered rounded-[4px]",
|
|
4803
4902
|
children: [
|
|
4804
4903
|
/*#__PURE__*/ jsx(Row, {
|
|
4805
4904
|
gutter: rowGutter,
|
|
@@ -5699,9 +5798,9 @@ const cozeDark = [
|
|
|
5699
5798
|
];
|
|
5700
5799
|
languages.register('json', {
|
|
5701
5800
|
language: mixLanguages({
|
|
5702
|
-
outerLanguage:
|
|
5801
|
+
outerLanguage: language_json_json.language
|
|
5703
5802
|
}),
|
|
5704
|
-
languageService:
|
|
5803
|
+
languageService: language_json_json.languageService
|
|
5705
5804
|
});
|
|
5706
5805
|
languages.register('shell', shell);
|
|
5707
5806
|
languages.register('python', python);
|
|
@@ -5893,7 +5992,7 @@ const CodeMirrorJsonEditor = /*#__PURE__*/ react.forwardRef((props, ref)=>{
|
|
|
5893
5992
|
const formatJson = async ()=>{
|
|
5894
5993
|
const view = apiRef.current?.$view;
|
|
5895
5994
|
if (!view) return;
|
|
5896
|
-
view.dispatch(await
|
|
5995
|
+
view.dispatch(await language_json_json.languageService.format(view.state, {
|
|
5897
5996
|
tabSize: 2
|
|
5898
5997
|
}));
|
|
5899
5998
|
};
|
|
@@ -6030,7 +6129,7 @@ const CodeMirrorRawCodeEditor = /*#__PURE__*/ react.forwardRef((props, ref)=>{
|
|
|
6030
6129
|
const formatJson = async ()=>{
|
|
6031
6130
|
const view = apiRef.current?.$view;
|
|
6032
6131
|
if (!view) return;
|
|
6033
|
-
view.dispatch(await
|
|
6132
|
+
view.dispatch(await language_json_json.languageService.format(view.state, {
|
|
6034
6133
|
tabSize: 2
|
|
6035
6134
|
}));
|
|
6036
6135
|
};
|
|
@@ -6131,7 +6230,7 @@ const CodeEditorWithLoading = ({ value, onChange, disabled, className })=>{
|
|
|
6131
6230
|
children: [
|
|
6132
6231
|
LoadingNode,
|
|
6133
6232
|
/*#__PURE__*/ jsx(_monaco_editor_react, {
|
|
6134
|
-
language:
|
|
6233
|
+
language: "json",
|
|
6135
6234
|
value: value,
|
|
6136
6235
|
options: {
|
|
6137
6236
|
readOnly: disabled,
|
|
@@ -6192,8 +6291,8 @@ function AudioRender({ audioUrl, audioName, className, showDownload, deletion, u
|
|
|
6192
6291
|
children: /*#__PURE__*/ jsx("img", {
|
|
6193
6292
|
src: audio_icon,
|
|
6194
6293
|
alt: audioName,
|
|
6195
|
-
width:
|
|
6196
|
-
height:
|
|
6294
|
+
width: "100%",
|
|
6295
|
+
height: "100%",
|
|
6197
6296
|
style: {
|
|
6198
6297
|
objectFit: 'cover',
|
|
6199
6298
|
objectPosition: 'center'
|
|
@@ -6309,8 +6408,8 @@ function VideoRender({ videoName, videoUrl, showDownload, deletion, upload, size
|
|
|
6309
6408
|
}) : null,
|
|
6310
6409
|
/*#__PURE__*/ jsx("video", {
|
|
6311
6410
|
src: videoUrl,
|
|
6312
|
-
width:
|
|
6313
|
-
height:
|
|
6411
|
+
width: "100%",
|
|
6412
|
+
height: "100%",
|
|
6314
6413
|
className: classnames('rounded-[6px] pointer-events-none', {
|
|
6315
6414
|
invisible: 'loaded' !== videoElementStatus || [
|
|
6316
6415
|
'error',
|
|
@@ -6416,7 +6515,349 @@ function VideoRender({ videoName, videoUrl, showDownload, deletion, upload, size
|
|
|
6416
6515
|
]
|
|
6417
6516
|
});
|
|
6418
6517
|
}
|
|
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
|
+
}
|
|
6419
6860
|
var src_DEFAULT_FILE_COUNT = 20;
|
|
6420
6861
|
var src_DEFAULT_PART_COUNT = 50;
|
|
6421
6862
|
export { default as schemaValidators } from "@rjsf/validator-ajv8";
|
|
6422
|
-
export { AudioRender, BasicCard, CardPane, ChipSelect, CodeEditorWithLoading, CodeMirrorCodeEditor, CodeMirrorJsonEditor, CodeMirrorRawCodeEditor, CodeMirrorRawTextEditor, CodeMirrorTextEditor, CollapseCard, CollapseItem, ColumnSelector, Copyable, DEFAULT_FILE_SIZE, DEFAULT_PAGE_SIZE, DEFAULT_SUPPORTED_FORMATS, DEFAULT_VIDEO_SUPPORTED_FORMATS, DiffEditor, EditIconButton, EditorProvider, FooterActions, FoxIcon, FullPage, IDRender, IconButtonContainer, ImageItemRenderer, IndexControllerView, InfiniteScrollTable, InfoTooltip, InputSlider, InputWithCount, JumpIconButton, LargeTxtRender, Layout, LazyLoadComponent, LinkButton, LogicEditor, LogicExpr, LoopRadioGroup, LoopTable, LoopTabs, MultiPartRender, MultipartEditor, OpenDetailButton, PAGE_SIZE_OPTIONS, PageError, PageLoading, PageNoAuth, PageNoContent, PageNotFound, PrimaryPage, PrimaryTitle, RadioButton, ResizableSideSheet, ResizeSidesheet, SchemaEditor, SemiSchemaForm, SentinelForm, StepNav, TableBatchOperate, TableColActions, TableColsConfig, TableEmpty, TableHeader, TableWithPagination, TableWithoutPagination, TextAreaPro, TextWithCopy, TitleWithSub, TooltipWhenDisabled, TooltipWithDisabled, UploadButton, UserProfile, VersionItem, VersionList, VersionSwitchPanel, VideoItemRenderer, VideoRender, _monaco_editor_react as CodeEditor, base_search_form_select as BaseSearchFormSelect, base_search_select as BaseSearchSelect, dealColumnsWithStorage, formateDecimalPlacesString, getColumnManageStorage, getStoragePageSize, handleCopy, setColumnsManageStorage, sleep, src_DEFAULT_FILE_COUNT as DEFAULT_FILE_COUNT, src_DEFAULT_PART_COUNT as DEFAULT_PART_COUNT, type_ImageStatus as MultipartRenderStatus, upload_uploadFile as uploadFile, useBatchOperate, useItemIndexController, useUnsaveLeaveWarning };
|
|
6863
|
+
export { AccessibleOptionLabel, AudioRender, BasicCard, CardPane, ChipSelect, CodeEditorWithLoading, CodeMirrorCodeEditor, CodeMirrorJsonEditor, CodeMirrorRawCodeEditor, CodeMirrorRawTextEditor, CodeMirrorTextEditor, CollapseCard, CollapseItem, ColumnSelector, Copyable, DEFAULT_FILE_SIZE, DEFAULT_PAGE_SIZE, DEFAULT_SUPPORTED_FORMATS, DEFAULT_VIDEO_SUPPORTED_FORMATS, DiffEditor, EditIconButton, EditorProvider, FooterActions, FoxIcon, FullPage, IDRender, IconButtonContainer, ImageItemRenderer, IndexControllerView, InfiniteScrollTable, InfoTooltip, InputNumberBigInt, InputSlider, InputWithCount, JumpIconButton, LargeTxtRender, Layout, LazyLoadComponent, LinkButton, LogicEditor, LogicExpr, LoopRadioGroup, LoopTable, LoopTabs, MultiPartRender, MultipartEditor, OpenDetailButton, PAGE_SIZE_OPTIONS, PageError, PageLoading, PageNoAuth, PageNoContent, PageNotFound, PrimaryPage, PrimaryTitle, RadioButton, ResizableSideSheet, ResizeSidesheet, SchemaEditor, SemiSchemaForm, SentinelForm, StepNav, TableBatchOperate, TableColActions, TableColsConfig, TableEmpty, TableHeader, TableWithPagination, TableWithoutPagination, TextAreaPro, TextWithCopy, TitleWithSub, TooltipWhenDisabled, TooltipWithDisabled, UploadButton, UserProfile, VersionItem, VersionList, VersionSwitchPanel, VideoItemRenderer, VideoRender, _monaco_editor_react as CodeEditor, banner_Banner as Banner, base_search_form_select as BaseSearchFormSelect, base_search_select as BaseSearchSelect, dealColumnsWithStorage, editor_RichTextEditor as RichTextEditor, 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,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI-E2E 友好的选项标签
|
|
3
|
+
*
|
|
4
|
+
* 除了预设 role + tabIndex,其余表现完全与普通 div 相同
|
|
5
|
+
*
|
|
6
|
+
* 背景:
|
|
7
|
+
* AI-E2E 主要依赖 a11y tree,部分工具对于 a11y tree 的裁剪策略较为激进,导致错误裁剪 Select 组件的 option label。
|
|
8
|
+
* 需要设置 option + tabIndex 避免裁剪。
|
|
9
|
+
* 完整上下文见 https://bytedance.larkoffice.com/wiki/HpypwSo6limuhMkWCZFcNpR2nod
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export declare const AccessibleOptionLabel: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
13
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
14
|
+
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface BannerProps {
|
|
3
|
+
content: ReactNode;
|
|
4
|
+
buttonText?: string;
|
|
5
|
+
onButtonClick?: () => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function Banner(props: BannerProps): import("react/jsx-runtime").JSX.Element;
|