@hkyhy/marsun-components-core 0.1.89 → 0.1.98
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/components/Audit/AuditLogList.d.ts +27 -0
- package/dist/components/Audit/AuditLogList.js +272 -0
- package/dist/components/Audit/AuditLogList.js.map +1 -0
- package/dist/components/Audit/formatAuditCurl.d.ts +27 -0
- package/dist/components/Audit/formatAuditCurl.js +115 -0
- package/dist/components/Audit/formatAuditCurl.js.map +1 -0
- package/dist/components/Audit/formatAuditJson.d.ts +15 -0
- package/dist/components/Audit/formatAuditJson.js +135 -0
- package/dist/components/Audit/formatAuditJson.js.map +1 -0
- package/dist/components/Audit/index.d.ts +3 -0
- package/dist/components/Audit/style.module.scss.js +30 -0
- package/dist/components/Audit/style.module.scss.js.map +1 -0
- package/dist/components/Audit/types.d.ts +39 -0
- package/dist/components/Editor/RichTextEditor/RichTextEditor.d.ts +24 -0
- package/dist/components/Editor/RichTextEditor/RichTextEditor.js +93 -0
- package/dist/components/Editor/RichTextEditor/RichTextEditor.js.map +1 -0
- package/dist/components/Editor/RichTextEditor/index.d.ts +2 -0
- package/dist/components/Editor/RichTextEditor/style.module.scss.js +11 -0
- package/dist/components/Editor/RichTextEditor/style.module.scss.js.map +1 -0
- package/dist/components/Editor/VariablePicker.d.ts +19 -0
- package/dist/components/Editor/VariablePicker.js +55 -0
- package/dist/components/Editor/VariablePicker.js.map +1 -0
- package/dist/components/Editor/index.d.ts +7 -0
- package/dist/components/Editor/index.js +21 -0
- package/dist/components/Editor/index.js.map +1 -0
- package/dist/components/Editor/msgVarTokenPlugin.d.ts +13 -0
- package/dist/components/Editor/msgVarTokenPlugin.js +94 -0
- package/dist/components/Editor/msgVarTokenPlugin.js.map +1 -0
- package/dist/components/Editor/variableMention.d.ts +37 -0
- package/dist/components/Editor/variableMention.js +64 -0
- package/dist/components/Editor/variableMention.js.map +1 -0
- package/dist/components/FormInfo/RichTextField/index.d.ts +21 -0
- package/dist/components/FormInfo/RichTextField/index.js +82 -0
- package/dist/components/FormInfo/RichTextField/index.js.map +1 -0
- package/dist/components/FormInfo/RichTextField/style.module.scss.js +9 -0
- package/dist/components/FormInfo/RichTextField/style.module.scss.js.map +1 -0
- package/dist/components/FormInfo/VariableMentionInput/index.d.ts +17 -0
- package/dist/components/FormInfo/VariableMentionInput/index.js +73 -0
- package/dist/components/FormInfo/VariableMentionInput/index.js.map +1 -0
- package/dist/components/FormInfo/VariableMentionInput/style.module.scss.js +11 -0
- package/dist/components/FormInfo/VariableMentionInput/style.module.scss.js.map +1 -0
- package/dist/components/FormInfo/fields.d.ts +5 -0
- package/dist/components/FormInfo/fields.js +32 -23
- package/dist/components/FormInfo/fields.js.map +1 -1
- package/dist/components/FormInfo/index.d.ts +4 -0
- package/dist/components/StateBar/StateBar.d.ts +19 -6
- package/dist/components/StateBar/StateBar.js +87 -50
- package/dist/components/StateBar/StateBar.js.map +1 -1
- package/dist/components/StateBar/style.module.scss.js +13 -10
- package/dist/components/StateBar/style.module.scss.js.map +1 -1
- package/dist/components/Tools/Inbox/InboxBell/InboxBell.d.ts +45 -0
- package/dist/components/Tools/Inbox/InboxBell/InboxBell.js +156 -0
- package/dist/components/Tools/Inbox/InboxBell/InboxBell.js.map +1 -0
- package/dist/components/Tools/Inbox/InboxBell/index.d.ts +2 -0
- package/dist/components/Tools/Inbox/InboxBell/style.module.scss.js +30 -0
- package/dist/components/Tools/Inbox/InboxBell/style.module.scss.js.map +1 -0
- package/dist/components/Tools/Inbox/index.d.ts +2 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/List/columns.d.ts +8 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/List/columns.js +56 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/List/columns.js.map +1 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/MessageTemplateAdmin.d.ts +8 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/MessageTemplateAdmin.js +216 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/MessageTemplateAdmin.js.map +1 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/Modal/TemplateFormModal.d.ts +26 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/Modal/TemplateFormModal.js +190 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/Modal/TemplateFormModal.js.map +1 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/index.d.ts +3 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/style.module.scss.js +12 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/style.module.scss.js.map +1 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/types.d.ts +76 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/types.js +26 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/types.js.map +1 -0
- package/dist/components/Tools/MessageCenter/index.d.ts +3 -0
- package/dist/components/Tools/MessageCenter/utils/templateCode.d.ts +8 -0
- package/dist/components/Tools/MessageCenter/utils/templateCode.js +25 -0
- package/dist/components/Tools/MessageCenter/utils/templateCode.js.map +1 -0
- package/dist/components/Tools/index.d.ts +5 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/editor.d.ts +5 -0
- package/dist/editor.js +21 -0
- package/dist/editor.js.map +1 -0
- package/dist/form-info.js +33 -29
- package/dist/form-info.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +805 -773
- package/dist/index.js.map +1 -1
- package/dist/marsun-components-core.css +4 -1
- package/dist/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js +301 -0
- package/dist/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +1256 -0
- package/dist/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-core/dist/index.js +2107 -0
- package/dist/node_modules/@ckeditor/ckeditor5-core/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js +259 -0
- package/dist/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +23990 -0
- package/dist/node_modules/@ckeditor/ckeditor5-engine/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-enter/dist/index.js +249 -0
- package/dist/node_modules/@ckeditor/ckeditor5-enter/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-essentials/dist/index.js +47 -0
- package/dist/node_modules/@ckeditor/ckeditor5-essentials/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-font/dist/index.js +100 -0
- package/dist/node_modules/@ckeditor/ckeditor5-font/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-icons/dist/index.js +31 -0
- package/dist/node_modules/@ckeditor/ckeditor5-icons/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-integrations-common/dist/index.js +194 -0
- package/dist/node_modules/@ckeditor/ckeditor5-integrations-common/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-list/dist/index.js +2042 -0
- package/dist/node_modules/@ckeditor/ckeditor5-list/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-mention/dist/index.js +9 -0
- package/dist/node_modules/@ckeditor/ckeditor5-mention/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +167 -0
- package/dist/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-react/dist/index.js +471 -0
- package/dist/node_modules/@ckeditor/ckeditor5-react/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js +139 -0
- package/dist/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +755 -0
- package/dist/node_modules/@ckeditor/ckeditor5-typing/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +7838 -0
- package/dist/node_modules/@ckeditor/ckeditor5-ui/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/conversions.js +422 -0
- package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/conversions.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/index.js +33 -0
- package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/route.js +47 -0
- package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/route.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-name/index.js +156 -0
- package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-name/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-undo/dist/index.js +313 -0
- package/dist/node_modules/@ckeditor/ckeditor5-undo/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +2942 -0
- package/dist/node_modules/@ckeditor/ckeditor5-utils/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js +892 -0
- package/dist/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js.map +1 -0
- package/dist/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +1047 -0
- package/dist/node_modules/@ckeditor/ckeditor5-widget/dist/index.js.map +1 -0
- package/dist/node_modules/color-parse/node_modules/color-name/index.js +153 -0
- package/dist/node_modules/color-parse/node_modules/color-name/index.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/_internal/globalThis.js +7 -0
- package/dist/node_modules/es-toolkit/dist/_internal/globalThis.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js +7 -0
- package/dist/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/_internal/isUnsafeToWriteProperty.js +7 -0
- package/dist/node_modules/es-toolkit/dist/_internal/isUnsafeToWriteProperty.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/assignValue.js +9 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/assignValue.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/getSymbols.js +7 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/getSymbols.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/getTag.js +7 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/getTag.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.js +16 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/isIndex.js +15 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/isIndex.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/isKey.js +9 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/isKey.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/isPrototype.js +8 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/isPrototype.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/tags.js +30 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/tags.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/toKey.js +8 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/toKey.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/function/debounce.js +17 -0
- package/dist/node_modules/es-toolkit/dist/compat/function/debounce.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/function/throttle.js +13 -0
- package/dist/node_modules/es-toolkit/dist/compat/function/throttle.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/assignIn.js +17 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/assignIn.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/clone.js +102 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/clone.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +8 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeep.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js +33 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/get.js +39 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/get.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/has.js +21 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/has.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/keysIn.js +33 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/keysIn.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/mapValues.js +10 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/mapValues.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/merge.js +9 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/merge.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/mergeWith.js +53 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/mergeWith.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/property.js +10 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/property.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/set.js +9 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/set.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/updateWith.js +31 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/updateWith.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArguments.js +8 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArguments.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArray.js +7 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArray.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.js +8 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.js +9 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isElement.js +9 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isElement.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isEqualWith.js +15 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isEqualWith.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isFunction.js +7 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isFunction.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isMatch.js +9 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isMatch.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isMatchWith.js +81 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isMatchWith.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isObject.js +7 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isObject.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isObjectLike.js +7 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isObjectLike.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js +16 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isString.js +7 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isString.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isSymbol.js +7 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isSymbol.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isTypedArray.js +8 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isTypedArray.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/matches.js +9 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/matches.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js +23 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/util/eq.js +7 -0
- package/dist/node_modules/es-toolkit/dist/compat/util/eq.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/util/iteratee.js +19 -0
- package/dist/node_modules/es-toolkit/dist/compat/util/iteratee.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/util/times.js +11 -0
- package/dist/node_modules/es-toolkit/dist/compat/util/times.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/util/toFinite.js +8 -0
- package/dist/node_modules/es-toolkit/dist/compat/util/toFinite.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/util/toInteger.js +9 -0
- package/dist/node_modules/es-toolkit/dist/compat/util/toInteger.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/util/toNumber.js +8 -0
- package/dist/node_modules/es-toolkit/dist/compat/util/toNumber.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/util/toPath.js +37 -0
- package/dist/node_modules/es-toolkit/dist/compat/util/toPath.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/compat/util/toString.js +15 -0
- package/dist/node_modules/es-toolkit/dist/compat/util/toString.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/function/after.js +11 -0
- package/dist/node_modules/es-toolkit/dist/function/after.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/function/debounce.js +30 -0
- package/dist/node_modules/es-toolkit/dist/function/debounce.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/function/identity.js +7 -0
- package/dist/node_modules/es-toolkit/dist/function/identity.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/function/noop.js +6 -0
- package/dist/node_modules/es-toolkit/dist/function/noop.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/object/clone.js +27 -0
- package/dist/node_modules/es-toolkit/dist/object/clone.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/object/cloneDeep.js +8 -0
- package/dist/node_modules/es-toolkit/dist/object/cloneDeep.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/object/cloneDeepWith.js +121 -0
- package/dist/node_modules/es-toolkit/dist/object/cloneDeepWith.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/object/mapValues.js +12 -0
- package/dist/node_modules/es-toolkit/dist/object/mapValues.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isBuffer.js +8 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isBuffer.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isEqual.js +9 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isEqual.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isEqualWith.js +110 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isEqualWith.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isLength.js +7 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isLength.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isPlainObject.js +9 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isPlainObject.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isPrimitive.js +7 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isPrimitive.js.map +1 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isTypedArray.js +7 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isTypedArray.js.map +1 -0
- package/dist/styles/global.css +4 -1
- package/dist/utils/copyText.d.ts +4 -0
- package/dist/utils/copyText.js +21 -0
- package/dist/utils/copyText.js.map +1 -0
- package/package.json +9 -2
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
function a(n) {
|
|
2
|
+
if (typeof n == "string") return n.includes("…[truncated]");
|
|
3
|
+
if (n && typeof n == "object" && !Array.isArray(n)) {
|
|
4
|
+
const t = n;
|
|
5
|
+
return t._truncated === !0 ? !0 : Object.values(t).some(a);
|
|
6
|
+
}
|
|
7
|
+
return !1;
|
|
8
|
+
}
|
|
9
|
+
function f(n, t = 0) {
|
|
10
|
+
if (t > 8) return n;
|
|
11
|
+
if (typeof n == "string") {
|
|
12
|
+
const r = n.trim();
|
|
13
|
+
if (r.length < 2 || !(r.startsWith("{") && r.includes("}") || r.startsWith("[") && r.includes("]") || r.startsWith('"') && (r.includes("{") || r.includes("[")))) return n;
|
|
14
|
+
try {
|
|
15
|
+
return f(JSON.parse(r), t + 1);
|
|
16
|
+
} catch {
|
|
17
|
+
return n;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (Array.isArray(n))
|
|
21
|
+
return n.map((r) => f(r, t + 1));
|
|
22
|
+
if (n && typeof n == "object") {
|
|
23
|
+
const r = {};
|
|
24
|
+
for (const [e, s] of Object.entries(n))
|
|
25
|
+
r[e] = f(s, t + 1);
|
|
26
|
+
return r;
|
|
27
|
+
}
|
|
28
|
+
return n;
|
|
29
|
+
}
|
|
30
|
+
function p(n) {
|
|
31
|
+
let t = n.replace(/\s*…\[truncated\]\s*$/, "").trim();
|
|
32
|
+
t = t.replace(/,\s*"[^"]*$/s, ""), t = t.replace(/,\s*\{[^}]*$/s, ""), t = t.replace(/:\s*"[^"]*$/s, ": null"), t = t.replace(/,\s*$/, "");
|
|
33
|
+
let r = !1, e = !1;
|
|
34
|
+
const s = [];
|
|
35
|
+
for (let o = 0; o < t.length; o++) {
|
|
36
|
+
const c = t[o];
|
|
37
|
+
if (r) {
|
|
38
|
+
if (e) {
|
|
39
|
+
e = !1;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (c === "\\") {
|
|
43
|
+
e = !0;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
c === '"' && (r = !1);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (c === '"') {
|
|
50
|
+
r = !0;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
c === "{" || c === "[" ? s.push(c) : (c === "}" || c === "]") && s.pop();
|
|
54
|
+
}
|
|
55
|
+
for (r && (t += '"'); s.length; ) {
|
|
56
|
+
const o = s.pop();
|
|
57
|
+
t += o === "{" ? "}" : "]";
|
|
58
|
+
}
|
|
59
|
+
return t;
|
|
60
|
+
}
|
|
61
|
+
function l(n) {
|
|
62
|
+
let t = "", r = 0, e = !1, s = !1;
|
|
63
|
+
const o = () => `
|
|
64
|
+
${" ".repeat(Math.max(r, 0))}`;
|
|
65
|
+
for (let c = 0; c < n.length; c++) {
|
|
66
|
+
const i = n[c];
|
|
67
|
+
if (e) {
|
|
68
|
+
t += i, s ? s = !1 : i === "\\" ? s = !0 : i === '"' && (e = !1);
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (i === '"') {
|
|
72
|
+
e = !0, t += i;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (i === "{" || i === "[") {
|
|
76
|
+
t += i, r += 1, t += o();
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (i === "}" || i === "]") {
|
|
80
|
+
r = Math.max(0, r - 1), t += o() + i;
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
if (i === ",") {
|
|
84
|
+
t += `,${o()}`;
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
if (i === ":") {
|
|
88
|
+
t += ": ";
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
i === " " || i === `
|
|
92
|
+
` || i === " " || i === "\r" || (t += i);
|
|
93
|
+
}
|
|
94
|
+
return t;
|
|
95
|
+
}
|
|
96
|
+
function u(n) {
|
|
97
|
+
const t = /…\[truncated\]/.test(n), r = n.replace(/\s*…\[truncated\]\s*$/, "").trim(), e = t ? `
|
|
98
|
+
…[truncated]` : "";
|
|
99
|
+
try {
|
|
100
|
+
return `${JSON.stringify(JSON.parse(r), null, 2)}${e}`;
|
|
101
|
+
} catch {
|
|
102
|
+
}
|
|
103
|
+
try {
|
|
104
|
+
const s = p(r);
|
|
105
|
+
return `${JSON.stringify(JSON.parse(s), null, 2)}${e}`;
|
|
106
|
+
} catch {
|
|
107
|
+
}
|
|
108
|
+
return `${l(r)}${e}`;
|
|
109
|
+
}
|
|
110
|
+
function d(n) {
|
|
111
|
+
if (n && typeof n == "object" && !Array.isArray(n)) {
|
|
112
|
+
const r = n;
|
|
113
|
+
if (r._truncated === !0 && typeof r.preview == "string") {
|
|
114
|
+
const e = u(r.preview);
|
|
115
|
+
return e.includes("…[truncated]") ? e : `${e}
|
|
116
|
+
…[truncated]`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const t = f(n);
|
|
120
|
+
if (typeof t == "string")
|
|
121
|
+
return u(t);
|
|
122
|
+
try {
|
|
123
|
+
return JSON.stringify(t, null, 2);
|
|
124
|
+
} catch {
|
|
125
|
+
return String(t);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
export {
|
|
129
|
+
d as formatAuditJson,
|
|
130
|
+
l as indentJsonLike,
|
|
131
|
+
a as isTruncatedAuditText,
|
|
132
|
+
p as repairTruncatedJson,
|
|
133
|
+
f as unwrapAuditJson
|
|
134
|
+
};
|
|
135
|
+
//# sourceMappingURL=formatAuditJson.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatAuditJson.js","sources":["../../../src/components/Audit/formatAuditJson.ts"],"sourcesContent":["/**\n * 审计步骤里常见「body 为 JSON 字符串」或双层转义;展示前递归解包再 pretty-print。\n * 截断串(…[truncated])尽量修复括号后再格式化;**禁止**对纯字符串再 JSON.stringify(会多包一层引号/转义)。\n */\n\nexport function isTruncatedAuditText(value: unknown): boolean {\n if (typeof value === 'string') return value.includes('…[truncated]');\n if (value && typeof value === 'object' && !Array.isArray(value)) {\n const o = value as Record<string, unknown>;\n if (o._truncated === true) return true;\n return Object.values(o).some(isTruncatedAuditText);\n }\n return false;\n}\n\nexport function unwrapAuditJson(value: unknown, depth = 0): unknown {\n if (depth > 8) return value;\n if (typeof value === 'string') {\n const t = value.trim();\n if (t.length < 2) return value;\n const looksJson =\n (t.startsWith('{') && t.includes('}')) ||\n (t.startsWith('[') && t.includes(']')) ||\n (t.startsWith('\"') && (t.includes('{') || t.includes('[')));\n if (!looksJson) return value;\n try {\n return unwrapAuditJson(JSON.parse(t), depth + 1);\n } catch {\n return value;\n }\n }\n if (Array.isArray(value)) {\n return value.map((v) => unwrapAuditJson(v, depth + 1));\n }\n if (value && typeof value === 'object') {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(value as Record<string, unknown>)) {\n out[k] = unwrapAuditJson(v, depth + 1);\n }\n return out;\n }\n return value;\n}\n\n/** 尽量闭合截断 JSON 的括号/引号,便于 parse */\nexport function repairTruncatedJson(raw: string): string {\n let t = raw.replace(/\\s*…\\[truncated\\]\\s*$/, '').trim();\n // 丢掉末尾不完整的 key / 片段\n t = t.replace(/,\\s*\"[^\"]*$/s, '');\n t = t.replace(/,\\s*\\{[^}]*$/s, '');\n t = t.replace(/:\\s*\"[^\"]*$/s, ': null');\n t = t.replace(/,\\s*$/, '');\n\n let inStr = false;\n let esc = false;\n const stack: Array<'{' | '['> = [];\n for (let i = 0; i < t.length; i++) {\n const ch = t[i];\n if (inStr) {\n if (esc) {\n esc = false;\n continue;\n }\n if (ch === '\\\\') {\n esc = true;\n continue;\n }\n if (ch === '\"') inStr = false;\n continue;\n }\n if (ch === '\"') {\n inStr = true;\n continue;\n }\n if (ch === '{' || ch === '[') stack.push(ch);\n else if (ch === '}' || ch === ']') stack.pop();\n }\n if (inStr) t += '\"';\n while (stack.length) {\n const open = stack.pop();\n t += open === '{' ? '}' : ']';\n }\n return t;\n}\n\n/** 无法 parse 时的轻量缩进(不包外层引号) */\nexport function indentJsonLike(s: string): string {\n let out = '';\n let depth = 0;\n let inStr = false;\n let esc = false;\n const nl = () => `\\n${' '.repeat(Math.max(depth, 0))}`;\n for (let i = 0; i < s.length; i++) {\n const ch = s[i];\n if (inStr) {\n out += ch;\n if (esc) esc = false;\n else if (ch === '\\\\') esc = true;\n else if (ch === '\"') inStr = false;\n continue;\n }\n if (ch === '\"') {\n inStr = true;\n out += ch;\n continue;\n }\n if (ch === '{' || ch === '[') {\n out += ch;\n depth += 1;\n out += nl();\n continue;\n }\n if (ch === '}' || ch === ']') {\n depth = Math.max(0, depth - 1);\n out += nl() + ch;\n continue;\n }\n if (ch === ',') {\n out += `,${nl()}`;\n continue;\n }\n if (ch === ':') {\n out += ': ';\n continue;\n }\n if (ch === ' ' || ch === '\\n' || ch === '\\t' || ch === '\\r') continue;\n out += ch;\n }\n return out;\n}\n\nfunction prettyJsonText(raw: string): string {\n const truncated = /…\\[truncated\\]/.test(raw);\n const core = raw.replace(/\\s*…\\[truncated\\]\\s*$/, '').trim();\n const suffix = truncated ? '\\n…[truncated]' : '';\n\n try {\n return `${JSON.stringify(JSON.parse(core), null, 2)}${suffix}`;\n } catch {\n /* continue */\n }\n try {\n const repaired = repairTruncatedJson(core);\n return `${JSON.stringify(JSON.parse(repaired), null, 2)}${suffix}`;\n } catch {\n /* continue */\n }\n return `${indentJsonLike(core)}${suffix}`;\n}\n\nexport function formatAuditJson(value: unknown): string {\n // agents 超限瘦身:{ _truncated, preview }\n if (value && typeof value === 'object' && !Array.isArray(value)) {\n const o = value as Record<string, unknown>;\n if (o._truncated === true && typeof o.preview === 'string') {\n const text = prettyJsonText(o.preview);\n return text.includes('…[truncated]') ? text : `${text}\\n…[truncated]`;\n }\n }\n\n const unwrapped = unwrapAuditJson(value);\n if (typeof unwrapped === 'string') {\n return prettyJsonText(unwrapped);\n }\n try {\n return JSON.stringify(unwrapped, null, 2);\n } catch {\n return String(unwrapped);\n }\n}\n\n/**\n * 复制到 bash:修复历史粘连 header,Authorization 占位(禁止落真实 token)。\n */\nexport function sanitizeAuditCurl(raw: string): string {\n if (!raw) return raw;\n let s = raw.replace(/\\s+/g, ' ').trim();\n s = s.replace(/'Content-Type:/gi, \"' -H 'Content-Type:\");\n s = s.replace(/-H\\s+'\\s+-H\\s+'/g, \"-H '\");\n s = s.replace(/-H 'Authorization:[^']*'/gi, \"-H 'Authorization: Bearer <token>'\");\n return s;\n}\n"],"names":["isTruncatedAuditText","value","o","unwrapAuditJson","depth","t","v","out","k","repairTruncatedJson","raw","inStr","esc","stack","i","ch","open","indentJsonLike","s","nl","prettyJsonText","truncated","core","suffix","repaired","formatAuditJson","text","unwrapped"],"mappings":"AAKO,SAASA,EAAqBC,GAAyB;AAC5D,MAAI,OAAOA,KAAU,SAAU,QAAOA,EAAM,SAAS,cAAc;AACnE,MAAIA,KAAS,OAAOA,KAAU,YAAY,CAAC,MAAM,QAAQA,CAAK,GAAG;AAC/D,UAAMC,IAAID;AACV,WAAIC,EAAE,eAAe,KAAa,KAC3B,OAAO,OAAOA,CAAC,EAAE,KAAKF,CAAoB;AAAA,EACnD;AACA,SAAO;AACT;AAEO,SAASG,EAAgBF,GAAgBG,IAAQ,GAAY;AAClE,MAAIA,IAAQ,EAAG,QAAOH;AACtB,MAAI,OAAOA,KAAU,UAAU;AAC7B,UAAMI,IAAIJ,EAAM,KAAA;AAMhB,QALII,EAAE,SAAS,KAKX,EAHDA,EAAE,WAAW,GAAG,KAAKA,EAAE,SAAS,GAAG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AKX,CAAG,GACrCY,IAAOZ,EAAI,QAAQ,yBAAyB,EAAE,EAAE,KAAA,GAChDa,IAASF,IAAY;AAAA,gBAAmB;AAE9C,MAAI;AACF,WAAO,GAAG,KAAK,UAAU,KAAK,MAAMC,CAAI,GAAG,MAAM,CAAC,CAAC,GAAGC,CAAM;AAAA,EAC9D,QAAQ;AAAA,EAER;AACA,MAAI;AACF,UAAMC,IAAWf,EAAoBa,CAAI;AACzC,WAAO,GAAG,KAAK,UAAU,KAAK,MAAME,CAAQ,GAAG,MAAM,CAAC,CAAC,GAAGD,CAAM;AAAA,EAClE,QAAQ;AAAA,EAER;AACA,SAAO,GAAGN,EAAeK,CAAI,CAAC,GAAGC,CAAM;AACzC;AAEO,SAASE,EAAgBxB,GAAwB;AAEtD,MAAIA,KAAS,OAAOA,KAAU,YAAY,CAAC,MAAM,QAAQA,CAAK,GAAG;AAC/D,UAAMC,IAAID;AACV,QAAIC,EAAE,eAAe,MAAQ,OAAOA,EAAE,WAAY,UAAU;AAC1D,YAAMwB,IAAON,EAAelB,EAAE,OAAO;AACrC,aAAOwB,EAAK,SAAS,cAAc,IAAIA,IAAO,GAAGA,CAAI;AAAA;AAAA,IACvD;AAAA,EACF;AAEA,QAAMC,IAAYxB,EAAgBF,CAAK;AACvC,MAAI,OAAO0B,KAAc;AACvB,WAAOP,EAAeO,CAAS;AAEjC,MAAI;AACF,WAAO,KAAK,UAAUA,GAAW,MAAM,CAAC;AAAA,EAC1C,QAAQ;AACN,WAAO,OAAOA,CAAS;AAAA,EACzB;AACF;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const o = "_wrap_7i6ne_2", n = "_filter_7i6ne_6", t = "_detail_7i6ne_10", e = "_actionCode_7i6ne_16", _ = "_flowWrap_7i6ne_21", s = "_stepBody_7i6ne_25", c = "_stepMeta_7i6ne_34", a = "_blockLabel_7i6ne_41", l = "_jsonWrap_7i6ne_47", i = "_jsonScroll_7i6ne_52", r = "_jsonBlock_7i6ne_57", p = "_truncateHint_7i6ne_73", d = {
|
|
2
|
+
wrap: o,
|
|
3
|
+
filter: n,
|
|
4
|
+
detail: t,
|
|
5
|
+
actionCode: e,
|
|
6
|
+
flowWrap: _,
|
|
7
|
+
stepBody: s,
|
|
8
|
+
stepMeta: c,
|
|
9
|
+
blockLabel: a,
|
|
10
|
+
jsonWrap: l,
|
|
11
|
+
jsonScroll: i,
|
|
12
|
+
jsonBlock: r,
|
|
13
|
+
truncateHint: p
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
e as actionCode,
|
|
17
|
+
a as blockLabel,
|
|
18
|
+
d as default,
|
|
19
|
+
t as detail,
|
|
20
|
+
n as filter,
|
|
21
|
+
_ as flowWrap,
|
|
22
|
+
r as jsonBlock,
|
|
23
|
+
i as jsonScroll,
|
|
24
|
+
l as jsonWrap,
|
|
25
|
+
s as stepBody,
|
|
26
|
+
c as stepMeta,
|
|
27
|
+
p as truncateHint,
|
|
28
|
+
o as wrap
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=style.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type AuditStepType = 'REQUEST' | 'AUTH' | 'SQL' | 'TRANSFORM' | 'UPSTREAM' | 'RESPONSE' | 'ERROR';
|
|
2
|
+
export type AuditEventListItem = {
|
|
3
|
+
id: string;
|
|
4
|
+
tenantId: string;
|
|
5
|
+
systemAppId: string;
|
|
6
|
+
traceId: string;
|
|
7
|
+
category?: string;
|
|
8
|
+
actorName?: string | null;
|
|
9
|
+
action: string;
|
|
10
|
+
/** 中文动作名;旧数据可空,展示用 actionLabel || action */
|
|
11
|
+
actionLabel?: string | null;
|
|
12
|
+
summary?: string | null;
|
|
13
|
+
status: string;
|
|
14
|
+
httpMethod?: string | null;
|
|
15
|
+
path?: string | null;
|
|
16
|
+
durationMs?: number | null;
|
|
17
|
+
hasSteps?: boolean;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
};
|
|
20
|
+
export type AuditStep = {
|
|
21
|
+
id?: string;
|
|
22
|
+
seq: number;
|
|
23
|
+
stepType: AuditStepType | string;
|
|
24
|
+
title: string;
|
|
25
|
+
status: string;
|
|
26
|
+
sqlText?: string | null;
|
|
27
|
+
tables?: string[] | null;
|
|
28
|
+
input?: unknown;
|
|
29
|
+
output?: unknown;
|
|
30
|
+
errorMessage?: string | null;
|
|
31
|
+
errorCode?: string | null;
|
|
32
|
+
meta?: unknown;
|
|
33
|
+
durationMs?: number | null;
|
|
34
|
+
occurredAt?: string | null;
|
|
35
|
+
};
|
|
36
|
+
export type AuditEventDetail = AuditEventListItem & {
|
|
37
|
+
requestCurl?: string | null;
|
|
38
|
+
steps?: AuditStep[];
|
|
39
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VariableMentionItem } from '../variableMention';
|
|
3
|
+
export type RichTextEditorProps = {
|
|
4
|
+
value?: string;
|
|
5
|
+
onChange?: (html: string) => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
readOnly?: boolean;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
minHeight?: number;
|
|
10
|
+
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* 开启变量色块 +「插入变量」按钮(catalog 注入;禁 FE DEFAULT_VARS)。
|
|
13
|
+
* 无 `/` 触发;色块为原子 widget。
|
|
14
|
+
*/
|
|
15
|
+
enableVariableMention?: boolean;
|
|
16
|
+
variables?: VariableMentionItem[];
|
|
17
|
+
/** catalog 失败短文案(按钮 disabled 提示) */
|
|
18
|
+
catalogError?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* CKEditor 5 + Coze/Dify 风「插入变量」按钮;正文 msgVar 原子色块。
|
|
22
|
+
*/
|
|
23
|
+
export declare const RichTextEditor: React.FC<RichTextEditorProps>;
|
|
24
|
+
export default RichTextEditor;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsxs as K, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as i, useMemo as N } from "react";
|
|
3
|
+
import "../../../node_modules/@ckeditor/ckeditor5-utils/dist/index.js";
|
|
4
|
+
import "../../../node_modules/@ckeditor/ckeditor5-engine/dist/index.js";
|
|
5
|
+
import { Bold as x, Italic as R } from "../../../node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js";
|
|
6
|
+
import { Widget as T } from "../../../node_modules/@ckeditor/ckeditor5-widget/dist/index.js";
|
|
7
|
+
import { Undo as $ } from "../../../node_modules/@ckeditor/ckeditor5-undo/dist/index.js";
|
|
8
|
+
import { ClassicEditor as W } from "../../../node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js";
|
|
9
|
+
import { Essentials as k } from "../../../node_modules/@ckeditor/ckeditor5-essentials/dist/index.js";
|
|
10
|
+
import { Paragraph as v } from "../../../node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js";
|
|
11
|
+
import { List as P } from "../../../node_modules/@ckeditor/ckeditor5-list/dist/index.js";
|
|
12
|
+
import "../../../node_modules/@ckeditor/ckeditor5-mention/dist/index.js";
|
|
13
|
+
import { CKEditor as b } from "../../../node_modules/@ckeditor/ckeditor5-react/dist/index.js";
|
|
14
|
+
/* empty css */
|
|
15
|
+
import { wrapVarTokensForDisplay as q } from "../variableMention.js";
|
|
16
|
+
import { MsgVarWidget as w, insertMsgVar as B } from "../msgVarTokenPlugin.js";
|
|
17
|
+
import { VariablePicker as F } from "../VariablePicker.js";
|
|
18
|
+
import t from "./style.module.scss.js";
|
|
19
|
+
const or = ({
|
|
20
|
+
value: n = "",
|
|
21
|
+
onChange: d,
|
|
22
|
+
disabled: a = !1,
|
|
23
|
+
readOnly: l = !1,
|
|
24
|
+
placeholder: f,
|
|
25
|
+
minHeight: E = 140,
|
|
26
|
+
className: p,
|
|
27
|
+
enableVariableMention: o = !1,
|
|
28
|
+
variables: L,
|
|
29
|
+
catalogError: C
|
|
30
|
+
}) => {
|
|
31
|
+
const u = i(null), g = i(null), e = i(d);
|
|
32
|
+
e.current = d;
|
|
33
|
+
const c = i(!1), D = i(
|
|
34
|
+
o ? q(n || "") : n || ""
|
|
35
|
+
), j = N(() => ({
|
|
36
|
+
licenseKey: "GPL",
|
|
37
|
+
toolbar: ["undo", "redo", "|", "bold", "italic", "|", "bulletedList", "numberedList"],
|
|
38
|
+
placeholder: f,
|
|
39
|
+
plugins: o ? [k, v, x, R, P, $, T, w] : [k, v, x, R, P, $]
|
|
40
|
+
}), [o, f]), h = a || l;
|
|
41
|
+
return /* @__PURE__ */ K(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
ref: u,
|
|
45
|
+
className: p ? `${t.root} ${t["rich-text-editor"]} ${p}` : `${t.root} ${t["rich-text-editor"]}`,
|
|
46
|
+
style: { "--rte-min-height": `${E}px` },
|
|
47
|
+
"data-disabled": a ? "1" : "0",
|
|
48
|
+
"data-readonly": l ? "1" : "0",
|
|
49
|
+
"data-var-mention": o ? "1" : "0",
|
|
50
|
+
children: [
|
|
51
|
+
o ? /* @__PURE__ */ m("div", { className: t["var-toolbar"], children: /* @__PURE__ */ m(
|
|
52
|
+
F,
|
|
53
|
+
{
|
|
54
|
+
variables: L,
|
|
55
|
+
catalogError: C,
|
|
56
|
+
disabled: h,
|
|
57
|
+
getPopupContainer: () => u.current || document.body,
|
|
58
|
+
onPick: (r) => {
|
|
59
|
+
const s = g.current;
|
|
60
|
+
s && B(s, r);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
) }) : null,
|
|
64
|
+
/* @__PURE__ */ m("div", { className: t["editor-host"], children: /* @__PURE__ */ m(
|
|
65
|
+
b,
|
|
66
|
+
{
|
|
67
|
+
editor: W,
|
|
68
|
+
config: j,
|
|
69
|
+
disabled: h,
|
|
70
|
+
onReady: (r) => {
|
|
71
|
+
g.current = r, c.current = !0;
|
|
72
|
+
try {
|
|
73
|
+
r.setData(D.current);
|
|
74
|
+
} finally {
|
|
75
|
+
queueMicrotask(() => {
|
|
76
|
+
c.current = !1;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
onChange: (r, s) => {
|
|
81
|
+
var y;
|
|
82
|
+
c.current || (y = e.current) == null || y.call(e, s.getData());
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
) })
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
export {
|
|
91
|
+
or as RichTextEditor
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=RichTextEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichTextEditor.js","sources":["../../../../src/components/Editor/RichTextEditor/RichTextEditor.tsx"],"sourcesContent":["import React, { useMemo, useRef } from 'react';\nimport {\n Bold,\n ClassicEditor,\n Essentials,\n Italic,\n List,\n Paragraph,\n Undo,\n Widget,\n type Editor,\n} from 'ckeditor5';\nimport { CKEditor } from '@ckeditor/ckeditor5-react';\nimport 'ckeditor5/ckeditor5.css';\nimport { wrapVarTokensForDisplay, type VariableMentionItem } from '../variableMention';\nimport { MsgVarWidget, insertMsgVar } from '../msgVarTokenPlugin';\nimport { VariablePicker } from '../VariablePicker';\nimport styles from './style.module.scss';\n\nexport type RichTextEditorProps = {\n value?: string;\n onChange?: (html: string) => void;\n disabled?: boolean;\n readOnly?: boolean;\n placeholder?: string;\n minHeight?: number;\n className?: string;\n /**\n * 开启变量色块 +「插入变量」按钮(catalog 注入;禁 FE DEFAULT_VARS)。\n * 无 `/` 触发;色块为原子 widget。\n */\n enableVariableMention?: boolean;\n variables?: VariableMentionItem[];\n /** catalog 失败短文案(按钮 disabled 提示) */\n catalogError?: string;\n};\n\n/**\n * CKEditor 5 + Coze/Dify 风「插入变量」按钮;正文 msgVar 原子色块。\n */\nexport const RichTextEditor: React.FC<RichTextEditorProps> = ({\n value = '',\n onChange,\n disabled = false,\n readOnly = false,\n placeholder,\n minHeight = 140,\n className,\n enableVariableMention = false,\n variables,\n catalogError,\n}) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const editorRef = useRef<Editor | null>(null);\n const onChangeRef = useRef(onChange);\n onChangeRef.current = onChange;\n const suppressChangeRef = useRef(false);\n\n const initialHtmlRef = useRef(\n enableVariableMention ? wrapVarTokensForDisplay(value || '') : value || '',\n );\n\n const config = useMemo(() => {\n const plugins = enableVariableMention\n ? [Essentials, Paragraph, Bold, Italic, List, Undo, Widget, MsgVarWidget]\n : [Essentials, Paragraph, Bold, Italic, List, Undo];\n return {\n licenseKey: 'GPL' as const,\n toolbar: ['undo', 'redo', '|', 'bold', 'italic', '|', 'bulletedList', 'numberedList'],\n placeholder,\n plugins,\n };\n }, [enableVariableMention, placeholder]);\n\n const locked = disabled || readOnly;\n\n return (\n <div\n ref={rootRef}\n className={\n className\n ? `${styles.root} ${styles['rich-text-editor']} ${className}`\n : `${styles.root} ${styles['rich-text-editor']}`\n }\n style={{ ['--rte-min-height' as string]: `${minHeight}px` }}\n data-disabled={disabled ? '1' : '0'}\n data-readonly={readOnly ? '1' : '0'}\n data-var-mention={enableVariableMention ? '1' : '0'}\n >\n {enableVariableMention ? (\n <div className={styles['var-toolbar']}>\n <VariablePicker\n variables={variables}\n catalogError={catalogError}\n disabled={locked}\n getPopupContainer={() => rootRef.current || document.body}\n onPick={(key) => {\n const editor = editorRef.current;\n if (!editor) return;\n insertMsgVar(editor, key);\n }}\n />\n </div>\n ) : null}\n <div className={styles['editor-host']}>\n <CKEditor\n editor={ClassicEditor}\n config={config}\n disabled={locked}\n onReady={(editor) => {\n editorRef.current = editor;\n suppressChangeRef.current = true;\n try {\n editor.setData(initialHtmlRef.current);\n } finally {\n queueMicrotask(() => {\n suppressChangeRef.current = false;\n });\n }\n }}\n onChange={(_evt, editor) => {\n if (suppressChangeRef.current) return;\n onChangeRef.current?.(editor.getData());\n }}\n />\n </div>\n </div>\n );\n};\n\nexport default RichTextEditor;\n"],"names":["RichTextEditor","value","onChange","disabled","readOnly","placeholder","minHeight","className","enableVariableMention","variables","catalogError","rootRef","useRef","editorRef","onChangeRef","suppressChangeRef","initialHtmlRef","wrapVarTokensForDisplay","config","useMemo","Essentials","Paragraph","Bold","Italic","List","Undo","Widget","MsgVarWidget","locked","jsxs","styles","jsx","VariablePicker","key","editor","insertMsgVar","CKEditor","ClassicEditor","_evt","_a"],"mappings":";;;;;;;;;;;;;;;;;;AAwCO,MAAMA,KAAgD,CAAC;AAAA,EAC5D,OAAAC,IAAQ;AAAA,EACR,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW;AAAA,EACX,aAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,WAAAC;AAAA,EACA,uBAAAC,IAAwB;AAAA,EACxB,WAAAC;AAAA,EACA,cAAAC;AACF,MAAM;AACJ,QAAMC,IAAUC,EAAuB,IAAI,GACrCC,IAAYD,EAAsB,IAAI,GACtCE,IAAcF,EAAOV,CAAQ;AACnC,EAAAY,EAAY,UAAUZ;AACtB,QAAMa,IAAoBH,EAAO,EAAK,GAEhCI,IAAiBJ;AAAA,IACrBJ,IAAwBS,EAAwBhB,KAAS,EAAE,IAAIA,KAAS;AAAA,EAAA,GAGpEiB,IAASC,EAAQ,OAId;AAAA,IACL,YAAY;AAAA,IACZ,SAAS,CAAC,QAAQ,QAAQ,KAAK,QAAQ,UAAU,KAAK,gBAAgB,cAAc;AAAA,IACpF,aAAAd;AAAA,IACA,SAPcG,IACZ,CAACY,GAAYC,GAAWC,GAAMC,GAAQC,GAAMC,GAAMC,GAAQC,CAAY,IACtE,CAACP,GAAYC,GAAWC,GAAMC,GAAQC,GAAMC,CAAI;AAAA,EAKlD,IAED,CAACjB,GAAuBH,CAAW,CAAC,GAEjCuB,IAASzB,KAAYC;AAE3B,SACE,gBAAAyB;AAAA,IAAC;AAAA,IAA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AAA,UAAA;AAAA,QAAA,EACF,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const t = "_root_16i7d_1", o = {
|
|
2
|
+
root: t,
|
|
3
|
+
"rich-text-editor": "_rich-text-editor_16i7d_27",
|
|
4
|
+
"var-toolbar": "_var-toolbar_16i7d_32",
|
|
5
|
+
"editor-host": "_editor-host_16i7d_38"
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
o as default,
|
|
9
|
+
t as root
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=style.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VariableMentionItem } from './variableMention';
|
|
3
|
+
export type VariablePickerProps = {
|
|
4
|
+
variables?: VariableMentionItem[];
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
/** catalog 加载失败短文案;有值时优先于「暂无变量」 */
|
|
7
|
+
catalogError?: string;
|
|
8
|
+
onPick: (key: string) => void;
|
|
9
|
+
/** 按钮文案,默认「插入变量」 */
|
|
10
|
+
buttonText?: string;
|
|
11
|
+
size?: 'small' | 'middle' | 'large';
|
|
12
|
+
className?: string;
|
|
13
|
+
getPopupContainer?: (node: HTMLElement) => HTMLElement;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Coze/Dify 风格:点选插入变量(中文 + code)。无 `/` 触发。
|
|
17
|
+
*/
|
|
18
|
+
export declare const VariablePicker: React.FC<VariablePickerProps>;
|
|
19
|
+
export default VariablePicker;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsxs as b, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { Dropdown as f, Button as h } from "antd";
|
|
3
|
+
import { useMemo as g } from "react";
|
|
4
|
+
import { filterVariableFeed as w } from "./variableMention.js";
|
|
5
|
+
import n from "../FormInfo/VariableMentionInput/style.module.scss.js";
|
|
6
|
+
const V = ({
|
|
7
|
+
variables: o,
|
|
8
|
+
disabled: i,
|
|
9
|
+
catalogError: r,
|
|
10
|
+
onPick: m,
|
|
11
|
+
buttonText: c = "插入变量",
|
|
12
|
+
size: d = "small",
|
|
13
|
+
className: p,
|
|
14
|
+
getPopupContainer: k
|
|
15
|
+
}) => {
|
|
16
|
+
const a = g(() => w(o, ""), [o]), t = a.length === 0, s = r ? `目录失败:${r}` : t ? "暂无 catalog 变量" : void 0, u = t ? [
|
|
17
|
+
{
|
|
18
|
+
key: "__empty",
|
|
19
|
+
disabled: !0,
|
|
20
|
+
label: s || "暂无变量"
|
|
21
|
+
}
|
|
22
|
+
] : a.map((e) => ({
|
|
23
|
+
key: e.key,
|
|
24
|
+
label: /* @__PURE__ */ b("span", { className: n["var-mention-option"], children: [
|
|
25
|
+
e.label ? /* @__PURE__ */ l("span", { className: n["var-mention-label"], children: e.label }) : null,
|
|
26
|
+
/* @__PURE__ */ l("span", { className: n["var-mention-token"], children: e.key })
|
|
27
|
+
] }),
|
|
28
|
+
onClick: () => m(e.key)
|
|
29
|
+
}));
|
|
30
|
+
return /* @__PURE__ */ l(
|
|
31
|
+
f,
|
|
32
|
+
{
|
|
33
|
+
disabled: i || t,
|
|
34
|
+
trigger: ["click"],
|
|
35
|
+
getPopupContainer: k,
|
|
36
|
+
dropdownRender: (e) => /* @__PURE__ */ l("div", { onMouseDown: (y) => y.preventDefault(), children: e }),
|
|
37
|
+
menu: { items: u },
|
|
38
|
+
children: /* @__PURE__ */ l(
|
|
39
|
+
h,
|
|
40
|
+
{
|
|
41
|
+
type: "default",
|
|
42
|
+
size: d,
|
|
43
|
+
disabled: i || t,
|
|
44
|
+
title: s,
|
|
45
|
+
className: p,
|
|
46
|
+
children: c
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
V as VariablePicker
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=VariablePicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VariablePicker.js","sources":["../../../src/components/Editor/VariablePicker.tsx"],"sourcesContent":["import { Button, Dropdown } from 'antd';\nimport type { MenuProps } from 'antd';\nimport React, { useMemo } from 'react';\nimport { filterVariableFeed, type VariableMentionItem } from './variableMention';\nimport styles from '../FormInfo/VariableMentionInput/style.module.scss';\n\nexport type VariablePickerProps = {\n variables?: VariableMentionItem[];\n disabled?: boolean;\n /** catalog 加载失败短文案;有值时优先于「暂无变量」 */\n catalogError?: string;\n onPick: (key: string) => void;\n /** 按钮文案,默认「插入变量」 */\n buttonText?: string;\n size?: 'small' | 'middle' | 'large';\n className?: string;\n getPopupContainer?: (node: HTMLElement) => HTMLElement;\n};\n\n/**\n * Coze/Dify 风格:点选插入变量(中文 + code)。无 `/` 触发。\n */\nexport const VariablePicker: React.FC<VariablePickerProps> = ({\n variables,\n disabled,\n catalogError,\n onPick,\n buttonText = '插入变量',\n size = 'small',\n className,\n getPopupContainer,\n}) => {\n const list = useMemo(() => filterVariableFeed(variables, ''), [variables]);\n const empty = list.length === 0;\n const tip = catalogError ? `目录失败:${catalogError}` : empty ? '暂无 catalog 变量' : undefined;\n\n const items: MenuProps['items'] = empty\n ? [\n {\n key: '__empty',\n disabled: true,\n label: tip || '暂无变量',\n },\n ]\n : list.map((v) => ({\n key: v.key,\n label: (\n <span className={styles['var-mention-option']}>\n {v.label ? <span className={styles['var-mention-label']}>{v.label}</span> : null}\n <span className={styles['var-mention-token']}>{v.key}</span>\n </span>\n ),\n onClick: () => onPick(v.key),\n }));\n\n return (\n <Dropdown\n disabled={disabled || empty}\n trigger={['click']}\n getPopupContainer={getPopupContainer}\n dropdownRender={(menu) => <div onMouseDown={(e) => e.preventDefault()}>{menu}</div>}\n menu={{ items }}\n >\n <Button\n type=\"default\"\n size={size}\n disabled={disabled || empty}\n title={tip}\n className={className}\n >\n {buttonText}\n </Button>\n </Dropdown>\n );\n};\n\nexport default VariablePicker;\n"],"names":["VariablePicker","variables","disabled","catalogError","onPick","buttonText","size","className","getPopupContainer","list","useMemo","filterVariableFeed","empty","tip","items","v","jsxs","styles","jsx","Dropdown","menu","e","Button"],"mappings":";;;;;AAsBO,MAAMA,IAAgD,CAAC;AAAA,EAC5D,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,MAAAC,IAAO;AAAA,EACP,WAAAC;AAAA,EACA,mBAAAC;AACF,MAAM;AACJ,QAAMC,IAAOC,EAAQ,MAAMC,EAAmBV,GAAW,EAAE,GAAG,CAACA,CAAS,CAAC,GACnEW,IAAQH,EAAK,WAAW,GACxBI,IAAMV,IAAe,QAAQA,CAAY,KAAKS,IAAQ,kBAAkB,QAExEE,IAA4BF,IAC9B;AAAA,IACE;AAAA,MACE,KAAK;AAAA,MACL,UAAU;AAAA,MACV,OAAOC,KAAO;AAAA,IAAA;AAAA,EAChB,IAEFJ,EAAK,IAAI,CAACM,OAAO;AAAA,IACf,KAAKA,EAAE;AAAA,IACP,OACE,gBAAAC,EAAC,QAAA,EAAK,WAAWC,EAAO,oBAAoB,GACzC,UAAA;AAAA,MAAAF,EAAE,0BAAS,QAAA,EAAK,WAAWE,EAAO,mBAAmB,GAAI,UAAAF,EAAE,MAAA,CAAM,IAAU;AAAA,wBAC3E,QAAA,EAAK,WAAWE,EAAO,mBAAmB,GAAI,YAAE,IAAA,CAAI;AAAA,IAAA,GACvD;AAAA,IAEF,SAAS,MAAMb,EAAOW,EAAE,GAAG;AAAA,EAAA,EAC3B;AAEN,SACE,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,UAAUjB,KAAYU;AAAA,MACtB,SAAS,CAAC,OAAO;AAAA,MACjB,mBAAAJ;AAAA,MACA,gBAAgB,CAACY,MAAS,gBAAAF,EAAC,OAAA,EAAI,aAAa,CAACG,MAAMA,EAAE,eAAA,GAAmB,UAAAD,EAAA,CAAK;AAAA,MAC7E,MAAM,EAAE,OAAAN,EAAA;AAAA,MAER,UAAA,gBAAAI;AAAA,QAACI;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,MAAAhB;AAAA,UACA,UAAUJ,KAAYU;AAAA,UACtB,OAAOC;AAAA,UACP,WAAAN;AAAA,UAEC,UAAAF;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { RichTextEditor } from './RichTextEditor';
|
|
2
|
+
export type { RichTextEditorProps } from './RichTextEditor';
|
|
3
|
+
export { MSG_VAR_TOKEN_CLASS, VAR_PLACEHOLDER_RE, toVarToken, filterVariableFeed, formatVariableOptionLabel, toMentionFeedItem, normalizeMentionHtmlToVarTokens, wrapVarTokensForDisplay, upliftVarTokensToMentions, insertVarTokenAt, } from './variableMention';
|
|
4
|
+
export type { VariableMentionItem } from './variableMention';
|
|
5
|
+
export { MsgVarWidget, insertMsgVar } from './msgVarTokenPlugin';
|
|
6
|
+
export { VariablePicker } from './VariablePicker';
|
|
7
|
+
export type { VariablePickerProps } from './VariablePicker';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MSG_VAR_TOKEN_CLASS as a, VAR_PLACEHOLDER_RE as i, filterVariableFeed as n, formatVariableOptionLabel as V, insertVarTokenAt as l, normalizeMentionHtmlToVarTokens as m, toMentionFeedItem as p, toVarToken as s, upliftVarTokensToMentions as T, wrapVarTokensForDisplay as f } from "./variableMention.js";
|
|
2
|
+
import { MsgVarWidget as M, insertMsgVar as x } from "./msgVarTokenPlugin.js";
|
|
3
|
+
import { VariablePicker as E } from "./VariablePicker.js";
|
|
4
|
+
import { RichTextEditor as r } from "./RichTextEditor/RichTextEditor.js";
|
|
5
|
+
export {
|
|
6
|
+
a as MSG_VAR_TOKEN_CLASS,
|
|
7
|
+
M as MsgVarWidget,
|
|
8
|
+
r as RichTextEditor,
|
|
9
|
+
i as VAR_PLACEHOLDER_RE,
|
|
10
|
+
E as VariablePicker,
|
|
11
|
+
n as filterVariableFeed,
|
|
12
|
+
V as formatVariableOptionLabel,
|
|
13
|
+
x as insertMsgVar,
|
|
14
|
+
l as insertVarTokenAt,
|
|
15
|
+
m as normalizeMentionHtmlToVarTokens,
|
|
16
|
+
p as toMentionFeedItem,
|
|
17
|
+
s as toVarToken,
|
|
18
|
+
T as upliftVarTokensToMentions,
|
|
19
|
+
f as wrapVarTokensForDisplay
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Plugin, Widget, Editor } from 'ckeditor5';
|
|
2
|
+
/**
|
|
3
|
+
* 正文变量原子色块:isObject inline widget。
|
|
4
|
+
* 不可改内部字符;Backspace/Delete 整颗删(对齐 Coze/Dify chip)。
|
|
5
|
+
*/
|
|
6
|
+
export declare class MsgVarWidget extends Plugin {
|
|
7
|
+
#private;
|
|
8
|
+
static get pluginName(): "MsgVarWidget";
|
|
9
|
+
static get requires(): readonly [typeof Widget];
|
|
10
|
+
init(): void;
|
|
11
|
+
}
|
|
12
|
+
/** 在选区插入原子变量色块,并焦点回编辑器 */
|
|
13
|
+
export declare function insertMsgVar(editor: Editor, key: string): void;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
var m = (e) => {
|
|
2
|
+
throw TypeError(e);
|
|
3
|
+
};
|
|
4
|
+
var f = (e, n, t) => n.has(e) || m("Cannot " + t);
|
|
5
|
+
var c = (e, n, t) => n.has(e) ? m("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(e) : n.set(e, t);
|
|
6
|
+
var a = (e, n, t) => (f(e, n, "access private method"), t);
|
|
7
|
+
import { Plugin as h } from "../../node_modules/@ckeditor/ckeditor5-core/dist/index.js";
|
|
8
|
+
import "../../node_modules/@ckeditor/ckeditor5-utils/dist/index.js";
|
|
9
|
+
import "../../node_modules/@ckeditor/ckeditor5-engine/dist/index.js";
|
|
10
|
+
import { Widget as p, viewToModelPositionOutsideModelElement as v, toWidget as V } from "../../node_modules/@ckeditor/ckeditor5-widget/dist/index.js";
|
|
11
|
+
import "../../node_modules/@ckeditor/ckeditor5-list/dist/index.js";
|
|
12
|
+
import "../../node_modules/@ckeditor/ckeditor5-mention/dist/index.js";
|
|
13
|
+
import { toVarToken as k } from "./variableMention.js";
|
|
14
|
+
var s, g, d;
|
|
15
|
+
class P extends h {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
c(this, s);
|
|
19
|
+
}
|
|
20
|
+
static get pluginName() {
|
|
21
|
+
return "MsgVarWidget";
|
|
22
|
+
}
|
|
23
|
+
static get requires() {
|
|
24
|
+
return [p];
|
|
25
|
+
}
|
|
26
|
+
init() {
|
|
27
|
+
const t = this.editor;
|
|
28
|
+
a(this, s, g).call(this), a(this, s, d).call(this), t.editing.mapper.on(
|
|
29
|
+
"viewToModelPosition",
|
|
30
|
+
v(
|
|
31
|
+
t.model,
|
|
32
|
+
(r) => r.hasClass("msg-var-token")
|
|
33
|
+
)
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
s = new WeakSet(), g = function() {
|
|
38
|
+
this.editor.model.schema.register("msgVar", {
|
|
39
|
+
inheritAllFrom: "$inlineObject",
|
|
40
|
+
allowAttributes: ["key"]
|
|
41
|
+
});
|
|
42
|
+
}, d = function() {
|
|
43
|
+
const t = this.editor.conversion;
|
|
44
|
+
t.for("editingDowncast").elementToElement({
|
|
45
|
+
model: "msgVar",
|
|
46
|
+
view: (r, { writer: o }) => {
|
|
47
|
+
const i = String(r.getAttribute("key") || ""), u = l(o, i);
|
|
48
|
+
return V(u, o, { label: `变量 ${i}` });
|
|
49
|
+
}
|
|
50
|
+
}), t.for("dataDowncast").elementToElement({
|
|
51
|
+
model: "msgVar",
|
|
52
|
+
view: (r, { writer: o }) => {
|
|
53
|
+
const i = String(r.getAttribute("key") || "");
|
|
54
|
+
return l(o, i);
|
|
55
|
+
}
|
|
56
|
+
}), t.for("upcast").elementToElement({
|
|
57
|
+
view: {
|
|
58
|
+
name: "span",
|
|
59
|
+
classes: ["msg-var-token"]
|
|
60
|
+
},
|
|
61
|
+
model: (r, { writer: o }) => {
|
|
62
|
+
const i = w(r);
|
|
63
|
+
return i ? o.createElement("msgVar", { key: i }) : null;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
function l(e, n) {
|
|
68
|
+
const t = e.createContainerElement("span", {
|
|
69
|
+
class: "msg-var-token",
|
|
70
|
+
"data-var": n
|
|
71
|
+
});
|
|
72
|
+
return e.insert(e.createPositionAt(t, 0), e.createText(k(n))), t;
|
|
73
|
+
}
|
|
74
|
+
function w(e) {
|
|
75
|
+
const n = String(e.getAttribute("data-var") || "").trim();
|
|
76
|
+
if (n) return n;
|
|
77
|
+
let t = "";
|
|
78
|
+
for (const o of e.getChildren())
|
|
79
|
+
(o.is("$text") || o.is("$textProxy")) && (t += o.data);
|
|
80
|
+
const r = t.match(/^\{\{(\w+)\}\}$/);
|
|
81
|
+
return (r == null ? void 0 : r[1]) ?? "";
|
|
82
|
+
}
|
|
83
|
+
function S(e, n) {
|
|
84
|
+
const t = String(n || "").trim();
|
|
85
|
+
t && (e.model.change((r) => {
|
|
86
|
+
const o = r.createElement("msgVar", { key: t });
|
|
87
|
+
e.model.insertContent(o);
|
|
88
|
+
}), e.editing.view.focus());
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
P as MsgVarWidget,
|
|
92
|
+
S as insertMsgVar
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=msgVarTokenPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"msgVarTokenPlugin.js","sources":["../../../src/components/Editor/msgVarTokenPlugin.ts"],"sourcesContent":["import {\n Plugin,\n Widget,\n toWidget,\n viewToModelPositionOutsideModelElement,\n type Editor,\n type ViewDowncastWriter,\n type ViewElement,\n} from 'ckeditor5';\nimport { toVarToken } from './variableMention';\n\n/**\n * 正文变量原子色块:isObject inline widget。\n * 不可改内部字符;Backspace/Delete 整颗删(对齐 Coze/Dify chip)。\n */\nexport class MsgVarWidget extends Plugin {\n public static get pluginName() {\n return 'MsgVarWidget' as const;\n }\n\n public static get requires() {\n return [Widget] as const;\n }\n\n public init(): void {\n const editor = this.editor;\n this.#defineSchema();\n this.#defineConverters();\n\n editor.editing.mapper.on(\n 'viewToModelPosition',\n viewToModelPositionOutsideModelElement(editor.model, (viewElement) =>\n viewElement.hasClass('msg-var-token'),\n ),\n );\n }\n\n #defineSchema(): void {\n const schema = this.editor.model.schema;\n schema.register('msgVar', {\n inheritAllFrom: '$inlineObject',\n allowAttributes: ['key'],\n });\n }\n\n #defineConverters(): void {\n const conversion = this.editor.conversion;\n\n conversion.for('editingDowncast').elementToElement({\n model: 'msgVar',\n view: (modelItem, { writer }) => {\n const key = String(modelItem.getAttribute('key') || '');\n const widgetElement = createMsgVarView(writer, key);\n return toWidget(widgetElement, writer, { label: `变量 ${key}` });\n },\n });\n\n conversion.for('dataDowncast').elementToElement({\n model: 'msgVar',\n view: (modelItem, { writer }) => {\n const key = String(modelItem.getAttribute('key') || '');\n return createMsgVarView(writer, key);\n },\n });\n\n conversion.for('upcast').elementToElement({\n view: {\n name: 'span',\n classes: ['msg-var-token'],\n },\n model: (viewElement, { writer }) => {\n const key = resolveKeyFromView(viewElement);\n if (!key) return null;\n return writer.createElement('msgVar', { key });\n },\n });\n }\n}\n\nfunction createMsgVarView(writer: ViewDowncastWriter, key: string): ViewElement {\n const span = writer.createContainerElement('span', {\n class: 'msg-var-token',\n 'data-var': key,\n });\n writer.insert(writer.createPositionAt(span, 0), writer.createText(toVarToken(key)));\n return span;\n}\n\nfunction resolveKeyFromView(viewElement: ViewElement): string {\n const fromAttr = String(viewElement.getAttribute('data-var') || '').trim();\n if (fromAttr) return fromAttr;\n let text = '';\n for (const child of viewElement.getChildren()) {\n if (child.is('$text') || child.is('$textProxy')) {\n text += child.data;\n }\n }\n const m = text.match(/^\\{\\{(\\w+)\\}\\}$/);\n return m?.[1] ?? '';\n}\n\n/** 在选区插入原子变量色块,并焦点回编辑器 */\nexport function insertMsgVar(editor: Editor, key: string): void {\n const k = String(key || '').trim();\n if (!k) return;\n editor.model.change((writer) => {\n const el = writer.createElement('msgVar', { key: k });\n editor.model.insertContent(el);\n });\n editor.editing.view.focus();\n}\n"],"names":["MsgVarWidget","Plugin","__privateAdd","_MsgVarWidget_instances","Widget","editor","__privateMethod","defineSchema_fn","defineConverters_fn","viewToModelPositionOutsideModelElement","viewElement","conversion","modelItem","writer","key","widgetElement","createMsgVarView","toWidget","resolveKeyFromView","span","toVarToken","fromAttr","text","child","m","insertMsgVar","k","el"],"mappings":";;;;;;;;;;;;;;AAeO,MAAMA,UAAqBC,EAAO;AAAA,EAAlC;AAAA;AAAA,IAAAC,EAAA,MAAAC;AAAA;AAAA,EACL,WAAkB,aAAa;AAC7B,WAAO;AAAA,EACT;AAAA,EAEA,WAAkB,WAAW;AAC3B,WAAO,CAACC,CAAM;AAAA,EAChB;AAAA,EAEO,OAAa;AAClB,UAAMC,IAAS,KAAK;AACpB,IAAAC,EAAA,MAAKH,GAAAI,GAAL,YACAD,EAAA,MAAKH,GAAAK,GAAL,YAEAH,EAAO,QAAQ,OAAO;AAAA,MACpB;AAAA,MACAI;AAAA,QAAuCJ,EAAO;AAAA,QAAO,CAACK,MACpDA,EAAY,SAAS,eAAe;AAAA,MAAA;AAAA,IACtC;AAAA,EAEJ;AA0CF;AA9DOP,IAAA,eAsBLI,IAAA,WAAsB;AAEpB,EADe,KAAK,OAAO,MAAM,OAC1B,SAAS,UA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