@hkyhy/marsun-components-core 0.1.82 → 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/Table/ResizableHeaderCell.js +37 -38
- package/dist/components/Table/ResizableHeaderCell.js.map +1 -1
- package/dist/components/Table/Table.js +88 -89
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Table/columnConfigUtils.d.ts +1 -1
- package/dist/components/Table/columnConfigUtils.js.map +1 -1
- package/dist/components/Table/style.module.scss.js +34 -34
- 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,755 @@
|
|
|
1
|
+
var I = Object.defineProperty;
|
|
2
|
+
var F = (i, e, t) => e in i ? I(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var h = (i, e, t) => F(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { Plugin as k, Command as S } from "../../ckeditor5-core/dist/index.js";
|
|
5
|
+
import { keyCodes as C, env as _, count as q, isInsideSurrogatePair as W, isInsideCombinedSymbol as Q, isInsideEmojiSequence as N, EventInfo as z } from "../../ckeditor5-utils/dist/index.js";
|
|
6
|
+
import { _tryFixingModelRange as A, BubblingEventInfo as T, ViewDocumentDomEventData as y, Observer as O, ModelLiveRange as M, FocusObserver as U } from "../../ckeditor5-engine/dist/index.js";
|
|
7
|
+
import { debounce as V } from "../../../es-toolkit/dist/compat/function/debounce.js";
|
|
8
|
+
/**
|
|
9
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
10
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
14
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
15
|
+
*/
|
|
16
|
+
var L = class {
|
|
17
|
+
/**
|
|
18
|
+
* Creates a new instance of the change buffer.
|
|
19
|
+
*
|
|
20
|
+
* @param limit The maximum number of atomic changes which can be contained in one batch.
|
|
21
|
+
*/
|
|
22
|
+
constructor(i, e = 20) {
|
|
23
|
+
/**
|
|
24
|
+
* The model instance.
|
|
25
|
+
*/
|
|
26
|
+
h(this, "model");
|
|
27
|
+
/**
|
|
28
|
+
* The maximum number of atomic changes which can be contained in one batch.
|
|
29
|
+
*/
|
|
30
|
+
h(this, "limit");
|
|
31
|
+
/**
|
|
32
|
+
* Whether the buffer is locked. A locked buffer cannot be reset unless it gets unlocked.
|
|
33
|
+
*/
|
|
34
|
+
h(this, "_isLocked");
|
|
35
|
+
/**
|
|
36
|
+
* The number of atomic changes in the buffer. Once it exceeds the {@link #limit},
|
|
37
|
+
* the {@link #batch batch} is set to a new one.
|
|
38
|
+
*/
|
|
39
|
+
h(this, "_size");
|
|
40
|
+
/**
|
|
41
|
+
* The current batch instance.
|
|
42
|
+
*/
|
|
43
|
+
h(this, "_batch", null);
|
|
44
|
+
/**
|
|
45
|
+
* The callback to document the change event which later needs to be removed.
|
|
46
|
+
*/
|
|
47
|
+
h(this, "_changeCallback");
|
|
48
|
+
/**
|
|
49
|
+
* The callback to document selection `change:attribute` and `change:range` events which resets the buffer.
|
|
50
|
+
*/
|
|
51
|
+
h(this, "_selectionChangeCallback");
|
|
52
|
+
this.model = i, this._size = 0, this.limit = e, this._isLocked = !1, this._changeCallback = (t, n) => {
|
|
53
|
+
n.isLocal && n.isUndoable && n !== this._batch && this._reset(!0);
|
|
54
|
+
}, this._selectionChangeCallback = () => {
|
|
55
|
+
this._reset();
|
|
56
|
+
}, this.model.document.on("change", this._changeCallback), this.model.document.selection.on("change:range", this._selectionChangeCallback), this.model.document.selection.on("change:attribute", this._selectionChangeCallback);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The current batch to which a feature should add its operations. Once the {@link #size}
|
|
60
|
+
* is reached or exceeds the {@link #limit}, the batch is set to a new instance and the size is reset.
|
|
61
|
+
*/
|
|
62
|
+
get batch() {
|
|
63
|
+
return this._batch || (this._batch = this.model.createBatch({ isTyping: !0 })), this._batch;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The number of atomic changes in the buffer. Once it exceeds the {@link #limit},
|
|
67
|
+
* the {@link #batch batch} is set to a new one.
|
|
68
|
+
*/
|
|
69
|
+
get size() {
|
|
70
|
+
return this._size;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The input number of changes into the buffer. Once the {@link #size} is
|
|
74
|
+
* reached or exceeds the {@link #limit}, the batch is set to a new instance and the size is reset.
|
|
75
|
+
*
|
|
76
|
+
* @param changeCount The number of atomic changes to input.
|
|
77
|
+
*/
|
|
78
|
+
input(i) {
|
|
79
|
+
this._size += i, this._size >= this.limit && this._reset(!0);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Whether the buffer is locked. A locked buffer cannot be reset unless it gets unlocked.
|
|
83
|
+
*/
|
|
84
|
+
get isLocked() {
|
|
85
|
+
return this._isLocked;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Locks the buffer.
|
|
89
|
+
*/
|
|
90
|
+
lock() {
|
|
91
|
+
this._isLocked = !0;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Unlocks the buffer.
|
|
95
|
+
*/
|
|
96
|
+
unlock() {
|
|
97
|
+
this._isLocked = !1;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Destroys the buffer.
|
|
101
|
+
*/
|
|
102
|
+
destroy() {
|
|
103
|
+
this.model.document.off("change", this._changeCallback), this.model.document.selection.off("change:range", this._selectionChangeCallback), this.model.document.selection.off("change:attribute", this._selectionChangeCallback);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Resets the change buffer.
|
|
107
|
+
*
|
|
108
|
+
* @param ignoreLock Whether internal lock {@link #isLocked} should be ignored.
|
|
109
|
+
*/
|
|
110
|
+
_reset(i = !1) {
|
|
111
|
+
(!this.isLocked || i) && (this._batch = null, this._size = 0);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
116
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
117
|
+
*/
|
|
118
|
+
var Y = class extends S {
|
|
119
|
+
/**
|
|
120
|
+
* Creates an instance of the command.
|
|
121
|
+
*
|
|
122
|
+
* @param undoStepSize The maximum number of atomic changes
|
|
123
|
+
* which can be contained in one batch in the command buffer.
|
|
124
|
+
*/
|
|
125
|
+
constructor(e, t) {
|
|
126
|
+
super(e);
|
|
127
|
+
/**
|
|
128
|
+
* Typing's change buffer used to group subsequent changes into batches.
|
|
129
|
+
*/
|
|
130
|
+
h(this, "_buffer");
|
|
131
|
+
this._buffer = new L(e.model, t), this._isEnabledBasedOnSelection = !1;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* The current change buffer.
|
|
135
|
+
*/
|
|
136
|
+
get buffer() {
|
|
137
|
+
return this._buffer;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* @inheritDoc
|
|
141
|
+
*/
|
|
142
|
+
destroy() {
|
|
143
|
+
super.destroy(), this._buffer.destroy();
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Executes the input command. It replaces the content within the given range with the given text.
|
|
147
|
+
* Replacing is a two step process, first the content within the range is removed and then the new text is inserted
|
|
148
|
+
* at the beginning of the range (which after the removal is a collapsed range).
|
|
149
|
+
*
|
|
150
|
+
* @fires execute
|
|
151
|
+
* @param options The command options.
|
|
152
|
+
*/
|
|
153
|
+
execute(e = {}) {
|
|
154
|
+
const t = this.editor.model, n = t.document, o = e.text || "", s = o.length;
|
|
155
|
+
let l = n.selection;
|
|
156
|
+
if (e.selection ? l = e.selection : e.range && (l = t.createSelection(e.range)), !t.canEditAt(l)) return;
|
|
157
|
+
const c = e.resultRange;
|
|
158
|
+
t.enqueueChange(this._buffer.batch, (r) => {
|
|
159
|
+
this._buffer.lock();
|
|
160
|
+
const a = Array.from(n.selection.getAttributes());
|
|
161
|
+
t.deleteContent(l), o && t.insertContent(r.createText(o, a), l), c ? r.setSelection(c) : l.is("documentSelection") || r.setSelection(l), this._buffer.unlock(), this._buffer.input(s);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
167
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
168
|
+
*/
|
|
169
|
+
const P = ["insertText", "insertReplacementText"], $ = [...P, "insertCompositionText"];
|
|
170
|
+
var H = class extends O {
|
|
171
|
+
/**
|
|
172
|
+
* @inheritDoc
|
|
173
|
+
*/
|
|
174
|
+
constructor(e) {
|
|
175
|
+
super(e);
|
|
176
|
+
/**
|
|
177
|
+
* Instance of the focus observer. Insert text observer calls
|
|
178
|
+
* {@link module:engine/view/observer/focusobserver~FocusObserver#flush} to mark the latest focus change as complete.
|
|
179
|
+
*/
|
|
180
|
+
h(this, "focusObserver");
|
|
181
|
+
this.focusObserver = e.getObserver(U);
|
|
182
|
+
const t = _.isAndroid ? $ : P, n = e.document;
|
|
183
|
+
n.on("beforeinput", (o, s) => {
|
|
184
|
+
if (!this.isEnabled) return;
|
|
185
|
+
const { data: l, targetRanges: c, inputType: r, domEvent: a, isComposing: d } = s;
|
|
186
|
+
if (!t.includes(r)) return;
|
|
187
|
+
this.focusObserver.flush();
|
|
188
|
+
const u = new z(n, "insertText");
|
|
189
|
+
n.fire(u, new y(e, a, {
|
|
190
|
+
text: l,
|
|
191
|
+
selection: e.createSelection(c),
|
|
192
|
+
isComposing: d
|
|
193
|
+
})), u.stop.called && o.stop();
|
|
194
|
+
}), _.isAndroid || n.on("compositionend", (o, { data: s, domEvent: l }) => {
|
|
195
|
+
this.isEnabled && s && n.fire("insertText", new y(e, l, {
|
|
196
|
+
text: s,
|
|
197
|
+
isComposing: !0
|
|
198
|
+
}));
|
|
199
|
+
}, { priority: "low" });
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* @inheritDoc
|
|
203
|
+
*/
|
|
204
|
+
observe() {
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* @inheritDoc
|
|
208
|
+
*/
|
|
209
|
+
stopObserving() {
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
214
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
215
|
+
*/
|
|
216
|
+
var K = class extends k {
|
|
217
|
+
constructor() {
|
|
218
|
+
super(...arguments);
|
|
219
|
+
/**
|
|
220
|
+
* The queue of `insertText` command executions that are waiting for the DOM to get updated after beforeinput event.
|
|
221
|
+
*/
|
|
222
|
+
h(this, "_typingQueue");
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* @inheritDoc
|
|
226
|
+
*/
|
|
227
|
+
static get pluginName() {
|
|
228
|
+
return "Input";
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* @inheritDoc
|
|
232
|
+
*/
|
|
233
|
+
static get isOfficialPlugin() {
|
|
234
|
+
return !0;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* @inheritDoc
|
|
238
|
+
*/
|
|
239
|
+
init() {
|
|
240
|
+
const e = this.editor, t = e.model, n = e.editing.view, o = e.editing.mapper, s = t.document.selection;
|
|
241
|
+
this._typingQueue = new j(e), n.addObserver(H);
|
|
242
|
+
const l = new Y(e, e.config.get("typing.undoStep") || 20);
|
|
243
|
+
e.commands.add("insertText", l), e.commands.add("input", l), this.listenTo(n.document, "beforeinput", () => {
|
|
244
|
+
this._typingQueue.flush("next beforeinput");
|
|
245
|
+
}, { priority: "high" }), this.listenTo(n.document, "insertText", (c, r) => {
|
|
246
|
+
const { text: a, selection: d } = r;
|
|
247
|
+
if (n.document.selection.isFake && d && n.document.selection.isSimilar(d) && r.preventDefault(), d && Array.from(d.getRanges()).some((f) => !f.isCollapsed) && r.preventDefault(), !l.isEnabled) {
|
|
248
|
+
r.preventDefault();
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
let u;
|
|
252
|
+
d && (u = Array.from(d.getRanges()).filter((f) => f.root.is("rootElement")).map((f) => o.toModelRange(f)).map((f) => A(f, t.schema) || f)), (!u || !u.length) && (u = Array.from(s.getRanges()));
|
|
253
|
+
let m = a;
|
|
254
|
+
if (_.isAndroid) {
|
|
255
|
+
const f = Array.from(u[0].getItems()).reduce((E, w) => E + (w.is("$textProxy") ? w.data : ""), "");
|
|
256
|
+
if (f && (f.length <= m.length ? m.startsWith(f) && (m = m.substring(f.length), u[0].start = u[0].start.getShiftedBy(f.length)) : f.startsWith(m) && (u[0].start = u[0].start.getShiftedBy(m.length), m = "")), m.length == 0 && u[0].isCollapsed) return;
|
|
257
|
+
}
|
|
258
|
+
const g = {
|
|
259
|
+
text: m,
|
|
260
|
+
selection: t.createSelection(u)
|
|
261
|
+
};
|
|
262
|
+
this._typingQueue.push(g, !!r.isComposing), r.domEvent.defaultPrevented && this._typingQueue.flush("beforeinput default prevented");
|
|
263
|
+
}), _.isAndroid ? this.listenTo(n.document, "keydown", (c, r) => {
|
|
264
|
+
s.isCollapsed || r.keyCode != 229 || !n.document.isComposing || x(t, l);
|
|
265
|
+
}) : this.listenTo(n.document, "compositionstart", () => {
|
|
266
|
+
s.isCollapsed || x(t, l);
|
|
267
|
+
}, { priority: "high" }), this.listenTo(n.document, "mutations", (c, { mutations: r }) => {
|
|
268
|
+
if (this._typingQueue.hasAffectedElements()) for (const { node: a } of r) {
|
|
269
|
+
const d = J(a, o), u = o.toModelElement(d);
|
|
270
|
+
if (this._typingQueue.isElementAffected(u)) {
|
|
271
|
+
this._typingQueue.flush("mutations");
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}), this.listenTo(n.document, "compositionend", () => {
|
|
276
|
+
this._typingQueue.flush("before composition end");
|
|
277
|
+
}, { priority: "high" }), this.listenTo(n.document, "compositionend", () => {
|
|
278
|
+
this._typingQueue.flush("after composition end");
|
|
279
|
+
const c = [];
|
|
280
|
+
if (this._typingQueue.hasAffectedElements()) for (const r of this._typingQueue.flushAffectedElements()) {
|
|
281
|
+
const a = o.toViewElement(r);
|
|
282
|
+
a && c.push({
|
|
283
|
+
type: "children",
|
|
284
|
+
node: a
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
(c.length || !_.isAndroid) && n.document.fire("mutations", { mutations: c });
|
|
288
|
+
}, { priority: "lowest" });
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* @inheritDoc
|
|
292
|
+
*/
|
|
293
|
+
destroy() {
|
|
294
|
+
super.destroy(), this._typingQueue.destroy();
|
|
295
|
+
}
|
|
296
|
+
}, j = class {
|
|
297
|
+
/**
|
|
298
|
+
* @inheritDoc
|
|
299
|
+
*/
|
|
300
|
+
constructor(i) {
|
|
301
|
+
/**
|
|
302
|
+
* The editor instance.
|
|
303
|
+
*/
|
|
304
|
+
h(this, "editor");
|
|
305
|
+
/**
|
|
306
|
+
* Debounced queue flush as a safety mechanism for cases of mutation observer not triggering.
|
|
307
|
+
*/
|
|
308
|
+
h(this, "flushDebounced", V(() => this.flush("timeout"), 50));
|
|
309
|
+
/**
|
|
310
|
+
* The queue of `insertText` command executions that are waiting for the DOM to get updated after beforeinput event.
|
|
311
|
+
*/
|
|
312
|
+
h(this, "_queue", []);
|
|
313
|
+
/**
|
|
314
|
+
* Whether there is any composition enqueued or plain typing only.
|
|
315
|
+
*/
|
|
316
|
+
h(this, "_isComposing", !1);
|
|
317
|
+
/**
|
|
318
|
+
* A set of model elements. The typing happened in those elements. It's used for mutations check.
|
|
319
|
+
*/
|
|
320
|
+
h(this, "_affectedElements", /* @__PURE__ */ new Set());
|
|
321
|
+
this.editor = i;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Destroys the helper object.
|
|
325
|
+
*/
|
|
326
|
+
destroy() {
|
|
327
|
+
for (this.flushDebounced.cancel(), this._affectedElements.clear(); this._queue.length; ) this.shift();
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Returns the size of the queue.
|
|
331
|
+
*/
|
|
332
|
+
get length() {
|
|
333
|
+
return this._queue.length;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Push next insertText command data to the queue.
|
|
337
|
+
*/
|
|
338
|
+
push(i, e) {
|
|
339
|
+
const t = { text: i.text };
|
|
340
|
+
if (i.selection) {
|
|
341
|
+
t.selectionRanges = [];
|
|
342
|
+
for (const n of i.selection.getRanges())
|
|
343
|
+
t.selectionRanges.push(M.fromRange(n)), this._affectedElements.add(n.start.parent);
|
|
344
|
+
}
|
|
345
|
+
this._queue.push(t), this._isComposing || (this._isComposing = e), this.flushDebounced();
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Shift the first item from the insertText command data queue.
|
|
349
|
+
*/
|
|
350
|
+
shift() {
|
|
351
|
+
const i = this._queue.shift(), e = { text: i.text };
|
|
352
|
+
if (i.selectionRanges) {
|
|
353
|
+
const t = i.selectionRanges.map((n) => G(n)).filter((n) => !!n);
|
|
354
|
+
t.length && (e.selection = this.editor.model.createSelection(t));
|
|
355
|
+
}
|
|
356
|
+
return e;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Applies all queued insertText command executions.
|
|
360
|
+
*
|
|
361
|
+
* @param reason Used only for debugging.
|
|
362
|
+
*/
|
|
363
|
+
flush(i) {
|
|
364
|
+
const e = this.editor, t = e.model, n = e.editing.view;
|
|
365
|
+
if (this.flushDebounced.cancel(), !this._queue.length) return;
|
|
366
|
+
const o = e.commands.get("insertText").buffer;
|
|
367
|
+
t.enqueueChange(o.batch, () => {
|
|
368
|
+
for (o.lock(); this._queue.length; ) {
|
|
369
|
+
const s = this.shift();
|
|
370
|
+
e.execute("insertText", s);
|
|
371
|
+
}
|
|
372
|
+
o.unlock(), this._isComposing || this._affectedElements.clear(), this._isComposing = !1;
|
|
373
|
+
}), n.scrollToTheSelection();
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Returns `true` if the given model element is related to recent typing.
|
|
377
|
+
*/
|
|
378
|
+
isElementAffected(i) {
|
|
379
|
+
return this._affectedElements.has(i);
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Returns `true` if there are any affected elements in the queue.
|
|
383
|
+
*/
|
|
384
|
+
hasAffectedElements() {
|
|
385
|
+
return this._affectedElements.size > 0;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Returns an array of typing-related elements and clears the internal list.
|
|
389
|
+
*/
|
|
390
|
+
flushAffectedElements() {
|
|
391
|
+
const i = Array.from(this._affectedElements);
|
|
392
|
+
return this._affectedElements.clear(), i;
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
function x(i, e) {
|
|
396
|
+
if (!e.isEnabled) return;
|
|
397
|
+
const t = e.buffer;
|
|
398
|
+
t.lock(), i.enqueueChange(t.batch, () => {
|
|
399
|
+
i.deleteContent(i.document.selection);
|
|
400
|
+
}), t.unlock();
|
|
401
|
+
}
|
|
402
|
+
function G(i) {
|
|
403
|
+
const e = i.toRange();
|
|
404
|
+
return i.detach(), e.root.rootName == "$graveyard" ? null : e;
|
|
405
|
+
}
|
|
406
|
+
function J(i, e) {
|
|
407
|
+
let t = i.is("$text") ? i.parent : i;
|
|
408
|
+
for (; !e.toModelElement(t); ) t = t.parent;
|
|
409
|
+
return t;
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
413
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
414
|
+
*/
|
|
415
|
+
var R = class extends S {
|
|
416
|
+
/**
|
|
417
|
+
* Creates an instance of the command.
|
|
418
|
+
*
|
|
419
|
+
* @param direction The directionality of the delete describing in what direction it
|
|
420
|
+
* should consume the content when the selection is collapsed.
|
|
421
|
+
*/
|
|
422
|
+
constructor(e, t) {
|
|
423
|
+
super(e);
|
|
424
|
+
/**
|
|
425
|
+
* The directionality of the delete describing in what direction it should
|
|
426
|
+
* consume the content when the selection is collapsed.
|
|
427
|
+
*/
|
|
428
|
+
h(this, "direction");
|
|
429
|
+
/**
|
|
430
|
+
* Delete's change buffer used to group subsequent changes into batches.
|
|
431
|
+
*/
|
|
432
|
+
h(this, "_buffer");
|
|
433
|
+
this.direction = t, this._buffer = new L(e.model, e.config.get("typing.undoStep")), this._isEnabledBasedOnSelection = !1;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* The current change buffer.
|
|
437
|
+
*/
|
|
438
|
+
get buffer() {
|
|
439
|
+
return this._buffer;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Executes the delete command. Depending on whether the selection is collapsed or not, deletes its content
|
|
443
|
+
* or a piece of content in the {@link #direction defined direction}.
|
|
444
|
+
*
|
|
445
|
+
* @fires execute
|
|
446
|
+
* @param options The command options.
|
|
447
|
+
* @param options.unit See {@link module:engine/model/utils/modifyselection~modifySelection}'s options.
|
|
448
|
+
* @param options.sequence A number describing which subsequent delete event it is without the key being released.
|
|
449
|
+
* See the {@link module:engine/view/document~ViewDocument#event:delete} event data.
|
|
450
|
+
* @param options.selection Selection to remove. If not set, current model selection will be used.
|
|
451
|
+
*/
|
|
452
|
+
execute(e = {}) {
|
|
453
|
+
const t = this.editor.model, n = t.document;
|
|
454
|
+
t.enqueueChange(this._buffer.batch, (o) => {
|
|
455
|
+
this._buffer.lock();
|
|
456
|
+
const s = o.createSelection(e.selection || n.selection);
|
|
457
|
+
if (!t.canEditAt(s)) return;
|
|
458
|
+
const l = e.sequence || 1, c = s.isCollapsed;
|
|
459
|
+
if (s.isCollapsed && t.modifySelection(s, {
|
|
460
|
+
direction: this.direction,
|
|
461
|
+
unit: e.unit,
|
|
462
|
+
treatEmojiAsSingleUnit: !0
|
|
463
|
+
}), this._shouldEntireContentBeReplacedWithParagraph(l)) {
|
|
464
|
+
this._replaceEntireContentWithParagraph(o);
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
if (this._shouldReplaceFirstBlockWithParagraph(s, l)) {
|
|
468
|
+
this.editor.execute("paragraph", { selection: s });
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
if (s.isCollapsed) return;
|
|
472
|
+
let r = 0;
|
|
473
|
+
s.getFirstRange().getMinimalFlatRanges().forEach((a) => {
|
|
474
|
+
r += q(a.getWalker({
|
|
475
|
+
singleCharacters: !0,
|
|
476
|
+
ignoreElementEnd: !0,
|
|
477
|
+
shallow: !0
|
|
478
|
+
}));
|
|
479
|
+
}), t.deleteContent(s, {
|
|
480
|
+
doNotResetEntireContent: c,
|
|
481
|
+
direction: this.direction
|
|
482
|
+
}), this._buffer.input(r), o.setSelection(s), this._buffer.unlock();
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* If the user keeps <kbd>Backspace</kbd> or <kbd>Delete</kbd> key pressed, the content of the current
|
|
487
|
+
* editable will be cleared. However, this will not yet lead to resetting the remaining block to a paragraph
|
|
488
|
+
* (which happens e.g. when the user does <kbd>Ctrl</kbd> + <kbd>A</kbd>, <kbd>Backspace</kbd>).
|
|
489
|
+
*
|
|
490
|
+
* But, if the user pressed the key in an empty editable for the first time,
|
|
491
|
+
* we want to replace the entire content with a paragraph if:
|
|
492
|
+
*
|
|
493
|
+
* * the current limit element is empty,
|
|
494
|
+
* * the paragraph is allowed in the limit element,
|
|
495
|
+
* * the limit doesn't already have a paragraph inside.
|
|
496
|
+
*
|
|
497
|
+
* See https://github.com/ckeditor/ckeditor5-typing/issues/61.
|
|
498
|
+
*
|
|
499
|
+
* @param sequence A number describing which subsequent delete event it is without the key being released.
|
|
500
|
+
*/
|
|
501
|
+
_shouldEntireContentBeReplacedWithParagraph(e) {
|
|
502
|
+
if (e > 1) return !1;
|
|
503
|
+
const t = this.editor.model, n = t.document.selection, o = t.schema.getLimitElement(n);
|
|
504
|
+
if (!(n.isCollapsed && n.containsEntireContent(o)) || !t.schema.checkChild(o, "paragraph")) return !1;
|
|
505
|
+
const s = o.getChild(0);
|
|
506
|
+
return !(s && s.is("element", "paragraph"));
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* The entire content is replaced with the paragraph. Selection is moved inside the paragraph.
|
|
510
|
+
*
|
|
511
|
+
* @param writer The model writer.
|
|
512
|
+
*/
|
|
513
|
+
_replaceEntireContentWithParagraph(e) {
|
|
514
|
+
const t = this.editor.model, n = t.document.selection, o = t.schema.getLimitElement(n), s = e.createElement("paragraph");
|
|
515
|
+
e.remove(e.createRangeIn(o)), e.insert(s, o), e.setSelection(s, 0);
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Checks if the selection is inside an empty element that is the first child of the limit element
|
|
519
|
+
* and should be replaced with a paragraph.
|
|
520
|
+
*
|
|
521
|
+
* @param selection The selection.
|
|
522
|
+
* @param sequence A number describing which subsequent delete event it is without the key being released.
|
|
523
|
+
*/
|
|
524
|
+
_shouldReplaceFirstBlockWithParagraph(e, t) {
|
|
525
|
+
const n = this.editor.model;
|
|
526
|
+
if (t > 1 || this.direction != "backward" || !e.isCollapsed) return !1;
|
|
527
|
+
const o = e.getFirstPosition(), s = n.schema.getLimitElement(o), l = s.getChild(0);
|
|
528
|
+
return !(o.parent != l || !e.containsEntireContent(l) || !n.schema.checkChild(s, "paragraph") || l.name == "paragraph");
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
/**
|
|
532
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
533
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
534
|
+
*/
|
|
535
|
+
const X = "character", D = "word", Z = "codePoint", p = "selection", b = "backward", v = "forward", B = {
|
|
536
|
+
deleteContent: {
|
|
537
|
+
unit: p,
|
|
538
|
+
direction: b
|
|
539
|
+
},
|
|
540
|
+
deleteContentBackward: {
|
|
541
|
+
unit: Z,
|
|
542
|
+
direction: b
|
|
543
|
+
},
|
|
544
|
+
deleteWordBackward: {
|
|
545
|
+
unit: D,
|
|
546
|
+
direction: b
|
|
547
|
+
},
|
|
548
|
+
deleteHardLineBackward: {
|
|
549
|
+
unit: p,
|
|
550
|
+
direction: b
|
|
551
|
+
},
|
|
552
|
+
deleteSoftLineBackward: {
|
|
553
|
+
unit: p,
|
|
554
|
+
direction: b
|
|
555
|
+
},
|
|
556
|
+
deleteContentForward: {
|
|
557
|
+
unit: X,
|
|
558
|
+
direction: v
|
|
559
|
+
},
|
|
560
|
+
deleteWordForward: {
|
|
561
|
+
unit: D,
|
|
562
|
+
direction: v
|
|
563
|
+
},
|
|
564
|
+
deleteHardLineForward: {
|
|
565
|
+
unit: p,
|
|
566
|
+
direction: v
|
|
567
|
+
},
|
|
568
|
+
deleteSoftLineForward: {
|
|
569
|
+
unit: p,
|
|
570
|
+
direction: v
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
var ee = class extends O {
|
|
574
|
+
/**
|
|
575
|
+
* @inheritDoc
|
|
576
|
+
*/
|
|
577
|
+
constructor(i) {
|
|
578
|
+
super(i);
|
|
579
|
+
const e = i.document;
|
|
580
|
+
let t = 0;
|
|
581
|
+
e.on("keydown", () => {
|
|
582
|
+
t++;
|
|
583
|
+
}), e.on("keyup", () => {
|
|
584
|
+
t = 0;
|
|
585
|
+
}), e.on("beforeinput", (n, o) => {
|
|
586
|
+
if (!this.isEnabled) return;
|
|
587
|
+
const { targetRanges: s, domEvent: l, inputType: c } = o, r = B[c];
|
|
588
|
+
if (!r) return;
|
|
589
|
+
const a = {
|
|
590
|
+
direction: r.direction,
|
|
591
|
+
unit: r.unit,
|
|
592
|
+
sequence: t
|
|
593
|
+
};
|
|
594
|
+
a.unit == p && (a.selectionToRemove = i.createSelection(s[0])), c === "deleteContentBackward" && (_.isAndroid && (a.sequence = 1), ne(s) && (a.unit = p, a.selectionToRemove = i.createSelection(s)));
|
|
595
|
+
const d = new T(e, "delete", s[0]);
|
|
596
|
+
e.fire(d, new y(i, l, a)), d.stop.called && n.stop();
|
|
597
|
+
}), _.isBlink && te(this);
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* @inheritDoc
|
|
601
|
+
*/
|
|
602
|
+
observe() {
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* @inheritDoc
|
|
606
|
+
*/
|
|
607
|
+
stopObserving() {
|
|
608
|
+
}
|
|
609
|
+
};
|
|
610
|
+
function te(i) {
|
|
611
|
+
const e = i.view, t = e.document;
|
|
612
|
+
let n = null, o = !1;
|
|
613
|
+
t.on("keydown", (c, { keyCode: r }) => {
|
|
614
|
+
n = r, o = !1;
|
|
615
|
+
}), t.on("keyup", (c, { keyCode: r, domEvent: a }) => {
|
|
616
|
+
const d = t.selection, u = i.isEnabled && r == n && s(r) && !d.isCollapsed && !o;
|
|
617
|
+
if (n = null, u) {
|
|
618
|
+
const m = d.getFirstRange(), g = new T(t, "delete", m), f = {
|
|
619
|
+
unit: p,
|
|
620
|
+
direction: l(r),
|
|
621
|
+
selectionToRemove: d
|
|
622
|
+
};
|
|
623
|
+
t.fire(g, new y(e, a, f));
|
|
624
|
+
}
|
|
625
|
+
}), t.on("beforeinput", (c, { inputType: r }) => {
|
|
626
|
+
const a = B[r];
|
|
627
|
+
s(n) && a && a.direction == l(n) && (o = !0);
|
|
628
|
+
}, { priority: "high" }), t.on("beforeinput", (c, { inputType: r, data: a }) => {
|
|
629
|
+
n == C.delete && r == "insertText" && a == "" && c.stop();
|
|
630
|
+
}, { priority: "high" });
|
|
631
|
+
function s(c) {
|
|
632
|
+
return c == C.backspace || c == C.delete;
|
|
633
|
+
}
|
|
634
|
+
function l(c) {
|
|
635
|
+
return c == C.backspace ? b : v;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
function ne(i) {
|
|
639
|
+
if (i.length != 1 || i[0].isCollapsed) return !1;
|
|
640
|
+
const e = i[0].getWalker({
|
|
641
|
+
direction: "backward",
|
|
642
|
+
singleCharacters: !0,
|
|
643
|
+
ignoreElementEnd: !0
|
|
644
|
+
});
|
|
645
|
+
let t = 0;
|
|
646
|
+
for (const { nextPosition: n, item: o } of e) {
|
|
647
|
+
if (n.parent.is("$text")) {
|
|
648
|
+
const s = n.parent.data, l = n.offset;
|
|
649
|
+
if (W(s, l) || Q(s, l) || N(s, l)) continue;
|
|
650
|
+
t++;
|
|
651
|
+
} else (o.is("containerElement") || o.is("emptyElement")) && t++;
|
|
652
|
+
if (t > 1) return !0;
|
|
653
|
+
}
|
|
654
|
+
return !1;
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
658
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
659
|
+
*/
|
|
660
|
+
var ie = class extends k {
|
|
661
|
+
constructor() {
|
|
662
|
+
super(...arguments);
|
|
663
|
+
/**
|
|
664
|
+
* Whether pressing backspace should trigger undo action
|
|
665
|
+
*/
|
|
666
|
+
h(this, "_undoOnBackspace");
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* @inheritDoc
|
|
670
|
+
*/
|
|
671
|
+
static get pluginName() {
|
|
672
|
+
return "Delete";
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* @inheritDoc
|
|
676
|
+
*/
|
|
677
|
+
static get isOfficialPlugin() {
|
|
678
|
+
return !0;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* @inheritDoc
|
|
682
|
+
*/
|
|
683
|
+
init() {
|
|
684
|
+
const e = this.editor, t = e.editing.view, n = t.document, o = e.model.document;
|
|
685
|
+
t.addObserver(ee), this._undoOnBackspace = !1;
|
|
686
|
+
const s = new R(e, "forward");
|
|
687
|
+
e.commands.add("deleteForward", s), e.commands.add("forwardDelete", s), e.commands.add("delete", new R(e, "backward")), this.listenTo(n, "delete", (l, c) => {
|
|
688
|
+
n.isComposing || c.preventDefault();
|
|
689
|
+
const { direction: r, sequence: a, selectionToRemove: d, unit: u } = c, m = r === "forward" ? "deleteForward" : "delete", g = { sequence: a };
|
|
690
|
+
if (u == "selection") {
|
|
691
|
+
const f = Array.from(d.getRanges()).map((E) => e.editing.mapper.toModelRange(E)).map((E) => A(E, e.model.schema) || E);
|
|
692
|
+
g.selection = e.model.createSelection(f);
|
|
693
|
+
} else g.unit = u;
|
|
694
|
+
e.execute(m, g), t.scrollToTheSelection();
|
|
695
|
+
}, { priority: "low" }), this.listenTo(n, "keydown", (l, c) => {
|
|
696
|
+
if (n.isComposing || c.keyCode != C.backspace || !o.selection.isCollapsed) return;
|
|
697
|
+
const r = e.model.schema.getLimitElement(o.selection), a = e.model.createPositionAt(r, 0);
|
|
698
|
+
if (a.isTouching(o.selection.getFirstPosition())) {
|
|
699
|
+
c.preventDefault();
|
|
700
|
+
const d = e.model.schema.getNearestSelectionRange(a, "forward");
|
|
701
|
+
if (!d) return;
|
|
702
|
+
const u = t.createSelection(e.editing.mapper.toViewRange(d)), m = u.getFirstRange(), g = new T(document, "delete", m), f = {
|
|
703
|
+
unit: "selection",
|
|
704
|
+
direction: "backward",
|
|
705
|
+
selectionToRemove: u
|
|
706
|
+
};
|
|
707
|
+
n.fire(g, new y(t, c.domEvent, f));
|
|
708
|
+
}
|
|
709
|
+
}), this.editor.plugins.has("UndoEditing") && (this.listenTo(n, "delete", (l, c) => {
|
|
710
|
+
this._undoOnBackspace && c.direction == "backward" && c.sequence == 1 && c.unit == "codePoint" && (this._undoOnBackspace = !1, e.execute("undo"), c.preventDefault(), l.stop());
|
|
711
|
+
}, { context: "$capture" }), this.listenTo(o, "change", () => {
|
|
712
|
+
this._undoOnBackspace = !1;
|
|
713
|
+
}));
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* If the next user action after calling this method is pressing backspace, it would undo the last change.
|
|
717
|
+
*
|
|
718
|
+
* Requires {@link module:undo/undoediting~UndoEditing} plugin. If not loaded, does nothing.
|
|
719
|
+
*/
|
|
720
|
+
requestUndoOnBackspace() {
|
|
721
|
+
this.editor.plugins.has("UndoEditing") && (this._undoOnBackspace = !0);
|
|
722
|
+
}
|
|
723
|
+
};
|
|
724
|
+
/**
|
|
725
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
726
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
727
|
+
*/
|
|
728
|
+
var ae = class extends k {
|
|
729
|
+
static get requires() {
|
|
730
|
+
return [K, ie];
|
|
731
|
+
}
|
|
732
|
+
/**
|
|
733
|
+
* @inheritDoc
|
|
734
|
+
*/
|
|
735
|
+
static get pluginName() {
|
|
736
|
+
return "Typing";
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* @inheritDoc
|
|
740
|
+
*/
|
|
741
|
+
static get isOfficialPlugin() {
|
|
742
|
+
return !0;
|
|
743
|
+
}
|
|
744
|
+
};
|
|
745
|
+
export {
|
|
746
|
+
ie as Delete,
|
|
747
|
+
R as DeleteCommand,
|
|
748
|
+
K as Input,
|
|
749
|
+
Y as InsertTextCommand,
|
|
750
|
+
H as InsertTextObserver,
|
|
751
|
+
ae as Typing,
|
|
752
|
+
L as TypingChangeBuffer,
|
|
753
|
+
ee as _DeleteObserver
|
|
754
|
+
};
|
|
755
|
+
//# sourceMappingURL=index.js.map
|