@hkyhy/marsun-components-core 0.1.89 → 0.1.99
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/README.md +5 -4
- 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/Disposition/AlertDispositionPanel/LevelLegend.d.ts +13 -0
- package/dist/components/Disposition/AlertDispositionPanel/LevelLegend.js +36 -0
- package/dist/components/Disposition/AlertDispositionPanel/LevelLegend.js.map +1 -0
- package/dist/components/Disposition/AlertDispositionPanel/index.d.ts +21 -0
- package/dist/components/Disposition/AlertDispositionPanel/index.js +80 -0
- package/dist/components/Disposition/AlertDispositionPanel/index.js.map +1 -0
- package/dist/components/Disposition/AlertDispositionPanel/levelLegend.module.scss.js +10 -0
- package/dist/components/Disposition/AlertDispositionPanel/levelLegend.module.scss.js.map +1 -0
- package/dist/components/Disposition/AlertDispositionPanel/style.module.scss.js +11 -0
- package/dist/components/Disposition/AlertDispositionPanel/types.d.ts +51 -0
- package/dist/components/Disposition/AlertDispositionPanel/types.js +26 -0
- package/dist/components/Disposition/AlertDispositionPanel/types.js.map +1 -0
- package/dist/components/Disposition/DispositionBar/index.js.map +1 -0
- package/dist/components/Disposition/DispositionBar/style.module.scss.js.map +1 -0
- package/dist/components/Disposition/index.d.ts +4 -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 +5 -2
- 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 +7 -2
- package/dist/index.js +799 -759
- 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 -1
- package/dist/components/DispositionBar/index.js.map +0 -1
- /package/dist/components/{DispositionBar → Disposition/AlertDispositionPanel}/style.module.scss.js.map +0 -0
- /package/dist/components/{DispositionBar → Disposition/DispositionBar}/index.d.ts +0 -0
- /package/dist/components/{DispositionBar → Disposition/DispositionBar}/index.js +0 -0
- /package/dist/components/{DispositionBar → Disposition/DispositionBar}/style.module.scss.js +0 -0
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
import h, { memo as C, forwardRef as p, useRef as y, useEffect as v, useMemo as g } from "react";
|
|
2
|
+
import { getInstalledCKBaseFeatures as f, assignElementToEditorConfig as S, assignInitialDataToEditorConfig as T, compareInstalledCKBaseVersion as L, createDefer as V, uid as W, isCKEditorFreeLicense as x, appendExtraPluginsToEditorConfig as k, mapObjectKeys as D, once as A, createIntegrationUsageDataPlugin as z, kebabToCamelCase as K } from "../../ckeditor5-integrations-common/dist/index.js";
|
|
3
|
+
var O = Object.defineProperty, P = (i, e, t) => e in i ? O(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, d = (i, e, t) => P(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
const b = class w {
|
|
5
|
+
constructor(e, t) {
|
|
6
|
+
d(this, "_lifecycle"), d(this, "_element"), d(this, "_releaseLock", null), d(this, "_value", null), d(this, "_afterMountCallbacks", []), d(this, "_state", {
|
|
7
|
+
destroyedBeforeInitialization: !1,
|
|
8
|
+
mountingInProgress: null
|
|
9
|
+
}), d(this, "release", A(() => {
|
|
10
|
+
const { _releaseLock: n, _state: r, _element: a, _lifecycle: o } = this;
|
|
11
|
+
r.mountingInProgress ? r.mountingInProgress.then(() => o.unmount({
|
|
12
|
+
element: a,
|
|
13
|
+
// Mount result might be overridden by watchdog during restart so use instance variable.
|
|
14
|
+
mountResult: this.value
|
|
15
|
+
})).catch((s) => {
|
|
16
|
+
console.error("CKEditor unmounting error:", s);
|
|
17
|
+
}).then(n.resolve).then(() => {
|
|
18
|
+
this._value = null;
|
|
19
|
+
}) : (r.destroyedBeforeInitialization = !0, n.resolve());
|
|
20
|
+
})), this._element = e, this._lifecycle = t, this._lock();
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Getter for {@link #_value}.
|
|
24
|
+
*/
|
|
25
|
+
get value() {
|
|
26
|
+
return this._value;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Resets the semaphore to its initial state.
|
|
30
|
+
*/
|
|
31
|
+
discard() {
|
|
32
|
+
this._value = null, this._releaseLock = null, this._afterMountCallbacks = [], this._state = {
|
|
33
|
+
destroyedBeforeInitialization: !1,
|
|
34
|
+
mountingInProgress: null
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Occasionally, the Watchdog restarts the editor instance, resulting in a new instance being assigned to the semaphore.
|
|
39
|
+
* In terms of race conditions, it's generally safer to simply override the semaphore value rather than recreating it
|
|
40
|
+
* with a different one.
|
|
41
|
+
*/
|
|
42
|
+
unsafeSetValue(e) {
|
|
43
|
+
this._value = e, this._afterMountCallbacks.forEach((t) => {
|
|
44
|
+
this._lifecycle.isValueValid && !this._lifecycle.isValueValid(e) || t(e);
|
|
45
|
+
}), this._afterMountCallbacks = [];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* This registers a callback that will be triggered after the editor has been successfully mounted.
|
|
49
|
+
*
|
|
50
|
+
* * If the editor is already mounted, the callback will be executed immediately.
|
|
51
|
+
* * If the editor is in the process of mounting, the callback will be executed upon successful mounting.
|
|
52
|
+
* * If the editor is never mounted, the passed callback will not be executed.
|
|
53
|
+
* * If an exception is thrown within the callback, it will be re-thrown in the semaphore.
|
|
54
|
+
* * If the value is not valid (determined by isValueValid), the callback will not be executed.
|
|
55
|
+
*/
|
|
56
|
+
runAfterMount(e) {
|
|
57
|
+
const { _value: t, _afterMountCallbacks: n } = this;
|
|
58
|
+
if (t) {
|
|
59
|
+
if (this._lifecycle.isValueValid && !this._lifecycle.isValueValid(t))
|
|
60
|
+
return;
|
|
61
|
+
e(t);
|
|
62
|
+
} else
|
|
63
|
+
n.push(e);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* This method is used to inform other components that the {@link #_element} will be used by the editor,
|
|
67
|
+
* which is initialized by the {@link #_lifecycle} methods.
|
|
68
|
+
*
|
|
69
|
+
* * If an editor is already present on the provided element, the initialization of the current one
|
|
70
|
+
* will be postponed until the previous one is destroyed.
|
|
71
|
+
*
|
|
72
|
+
* * If the element is empty and does not have an editor attached to it, the currently locked editor will
|
|
73
|
+
* be mounted immediately.
|
|
74
|
+
*
|
|
75
|
+
* After the successful initialization of the editor and the assignment of the {@link #_value} member,
|
|
76
|
+
* the `onReady` lifecycle method is called.
|
|
77
|
+
*
|
|
78
|
+
* *Important note:*
|
|
79
|
+
*
|
|
80
|
+
* It’s really important to keep this method *sync*. If we make this method *async*, it won’t work well because
|
|
81
|
+
* it will cause problems when we’re trying to set up the {@link LifeCycleEditorElementSemaphore#_semaphores} map entries.
|
|
82
|
+
*/
|
|
83
|
+
_lock() {
|
|
84
|
+
const { _semaphores: e } = w, { _state: t, _element: n, _lifecycle: r } = this, a = e.get(n) || Promise.resolve(null), o = V();
|
|
85
|
+
this._releaseLock = o;
|
|
86
|
+
const s = a.then(() => t.destroyedBeforeInitialization ? Promise.resolve(void 0) : (t.mountingInProgress = r.mount().then((l) => (l && this.unsafeSetValue(l), l)), t.mountingInProgress)).then(async (l) => {
|
|
87
|
+
l && r.afterMount && await r.afterMount({
|
|
88
|
+
element: n,
|
|
89
|
+
mountResult: l
|
|
90
|
+
});
|
|
91
|
+
}).then(() => o.promise).catch((l) => {
|
|
92
|
+
console.error("CKEditor mounting error:", l);
|
|
93
|
+
}).then(() => {
|
|
94
|
+
e.get(n) === s && e.delete(n);
|
|
95
|
+
});
|
|
96
|
+
e.set(n, s);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
d(b, "_semaphores", /* @__PURE__ */ new Map());
|
|
100
|
+
let B = b;
|
|
101
|
+
const N = "$__CKEditorReactContextMetadata";
|
|
102
|
+
function U(i, e) {
|
|
103
|
+
return {
|
|
104
|
+
...e,
|
|
105
|
+
[N]: i
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
const F = h.createContext(null), H = (i) => !!i && typeof i == "object" && "status" in i && ["initializing", "initialized", "error"].includes(i.status), R = (i) => (e) => H(e) && e.status === i, E = R("initializing"), $ = (i) => R("initialized")(i) && i.watchdog.state === "ready", q = z(
|
|
109
|
+
"react",
|
|
110
|
+
{
|
|
111
|
+
version: "11.2.0",
|
|
112
|
+
frameworkVersion: h.version
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
function G(i) {
|
|
116
|
+
return x(i.licenseKey) ? i : k(i, [
|
|
117
|
+
/**
|
|
118
|
+
* This part of the code is not executed in open-source implementations using a GPL key.
|
|
119
|
+
* It only runs when a specific license key is provided. If you are uncertain whether
|
|
120
|
+
* this applies to your installation, please contact our support team.
|
|
121
|
+
*/
|
|
122
|
+
q
|
|
123
|
+
]);
|
|
124
|
+
}
|
|
125
|
+
class Y {
|
|
126
|
+
/**
|
|
127
|
+
* @param contextWatchdog The context watchdog instance that will be wrapped into editor watchdog API.
|
|
128
|
+
*/
|
|
129
|
+
constructor(e) {
|
|
130
|
+
d(this, "_contextWatchdog"), d(this, "_id"), d(this, "_creator"), this._contextWatchdog = e, this._id = W();
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* @param creator A watchdog's editor creator function.
|
|
134
|
+
*/
|
|
135
|
+
setCreator(e) {
|
|
136
|
+
this._creator = e;
|
|
137
|
+
}
|
|
138
|
+
create(e, t) {
|
|
139
|
+
let n = {
|
|
140
|
+
creator: this._creator,
|
|
141
|
+
id: this._id,
|
|
142
|
+
type: "editor"
|
|
143
|
+
};
|
|
144
|
+
return t ? n = {
|
|
145
|
+
...n,
|
|
146
|
+
sourceElementOrData: e,
|
|
147
|
+
config: t
|
|
148
|
+
} : n = {
|
|
149
|
+
...n,
|
|
150
|
+
config: e
|
|
151
|
+
}, this._contextWatchdog.add(n);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Creates a listener that is attached to context watchdog's item and run when the context watchdog fires.
|
|
155
|
+
* Currently works only for the `error` event.
|
|
156
|
+
*/
|
|
157
|
+
on(e, t) {
|
|
158
|
+
this._contextWatchdog.on("itemError", (n, { itemId: r, error: a }) => {
|
|
159
|
+
r === this._id && t(null, { error: a, causesRestart: void 0 });
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
destroy() {
|
|
163
|
+
return this._contextWatchdog.state === "ready" ? this._contextWatchdog.remove(this._id) : Promise.resolve();
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* An editor instance.
|
|
167
|
+
*/
|
|
168
|
+
get editor() {
|
|
169
|
+
return this._contextWatchdog.getItem(this._id);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function J(i) {
|
|
173
|
+
return typeof i == "string" ? i : (i ?? []).join(" ");
|
|
174
|
+
}
|
|
175
|
+
function Q(i) {
|
|
176
|
+
return D(i, (e) => e.startsWith("--") ? e : K(e));
|
|
177
|
+
}
|
|
178
|
+
function M(i) {
|
|
179
|
+
if (typeof HTMLElement < "u" && i instanceof HTMLElement)
|
|
180
|
+
throw new Error(
|
|
181
|
+
"An HTMLElement cannot be used as an editor element definition. Please pass a string, a React component, or an object definition."
|
|
182
|
+
);
|
|
183
|
+
return typeof i != "object" || i === null ? {
|
|
184
|
+
name: i
|
|
185
|
+
} : i;
|
|
186
|
+
}
|
|
187
|
+
const _ = C(p(({ definition: i }, e) => {
|
|
188
|
+
const { name: t, classes: n, styles: r, attributes: a } = M(i ?? {
|
|
189
|
+
name: "div"
|
|
190
|
+
});
|
|
191
|
+
return /* @__PURE__ */ h.createElement(
|
|
192
|
+
t,
|
|
193
|
+
{
|
|
194
|
+
ref: e,
|
|
195
|
+
...a,
|
|
196
|
+
style: Q(r ?? {}),
|
|
197
|
+
className: J(n)
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
}));
|
|
201
|
+
_.displayName = "EditorElement";
|
|
202
|
+
const m = "Lock from React integration (@ckeditor/ckeditor5-react)";
|
|
203
|
+
class X extends h.Component {
|
|
204
|
+
constructor(e) {
|
|
205
|
+
super(e), d(this, "domContainer", h.createRef()), d(this, "editorSemaphore", null), ee();
|
|
206
|
+
}
|
|
207
|
+
get _semaphoreValue() {
|
|
208
|
+
const { editorSemaphore: e } = this;
|
|
209
|
+
return e ? e.value : null;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* An watchdog instance.
|
|
213
|
+
*/
|
|
214
|
+
get watchdog() {
|
|
215
|
+
const { _semaphoreValue: e } = this;
|
|
216
|
+
return e ? e.watchdog : null;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* An editor instance.
|
|
220
|
+
*/
|
|
221
|
+
get editor() {
|
|
222
|
+
const { _semaphoreValue: e } = this;
|
|
223
|
+
return e ? e.instance : null;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* The CKEditor component should not be updated by React itself.
|
|
227
|
+
* However, if the component identifier changes, the whole structure should be created once again.
|
|
228
|
+
*/
|
|
229
|
+
shouldComponentUpdate(e) {
|
|
230
|
+
const { props: t, editorSemaphore: n } = this;
|
|
231
|
+
return e.id !== t.id || e.disableWatchdog !== t.disableWatchdog ? !0 : (n && (n.runAfterMount(({ instance: r }) => {
|
|
232
|
+
j(t, e, r) && r.data.set(e.data);
|
|
233
|
+
}), "disabled" in e && n.runAfterMount(({ instance: r }) => {
|
|
234
|
+
e.disabled ? r.enableReadOnlyMode(m) : r.disableReadOnlyMode(m);
|
|
235
|
+
})), !1);
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Initialize the editor when the component is mounted.
|
|
239
|
+
*/
|
|
240
|
+
componentDidMount() {
|
|
241
|
+
E(this.context) || this._initLifeCycleSemaphore();
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Re-render the entire component once again. The old editor will be destroyed and the new one will be created.
|
|
245
|
+
*/
|
|
246
|
+
componentDidUpdate() {
|
|
247
|
+
E(this.context) || this._initLifeCycleSemaphore();
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Destroy the editor before unmounting the component.
|
|
251
|
+
*/
|
|
252
|
+
componentWillUnmount() {
|
|
253
|
+
this._unlockLifeCycleSemaphore();
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Async destroy attached editor and unlock element semaphore.
|
|
257
|
+
*/
|
|
258
|
+
_unlockLifeCycleSemaphore() {
|
|
259
|
+
this.editorSemaphore && (this.editorSemaphore.release(), this.editorSemaphore = null);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Unlocks previous editor semaphore and creates new one..
|
|
263
|
+
*/
|
|
264
|
+
_initLifeCycleSemaphore() {
|
|
265
|
+
this._unlockLifeCycleSemaphore(), this.editorSemaphore = new B(this.domContainer.current, {
|
|
266
|
+
isValueValid: (e) => e && !!e.instance,
|
|
267
|
+
mount: async () => {
|
|
268
|
+
var e, t;
|
|
269
|
+
try {
|
|
270
|
+
return await this._initializeEditor();
|
|
271
|
+
} catch (n) {
|
|
272
|
+
throw (t = (e = this.props).onError) == null || t.call(e, n, { phase: "initialization", willEditorRestart: !1 }), n;
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
afterMount: ({ mountResult: e }) => {
|
|
276
|
+
const { onReady: t } = this.props;
|
|
277
|
+
t && this.domContainer.current !== null && t(e.instance);
|
|
278
|
+
},
|
|
279
|
+
unmount: async ({ element: e, mountResult: t }) => {
|
|
280
|
+
const { onAfterDestroy: n } = this.props;
|
|
281
|
+
try {
|
|
282
|
+
await this._destroyEditor(t), e.innerHTML = "";
|
|
283
|
+
} finally {
|
|
284
|
+
n && n(t.instance);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Render a <div> element which will be replaced by CKEditor.
|
|
291
|
+
*/
|
|
292
|
+
render() {
|
|
293
|
+
const { editor: e, config: t = {} } = this.props, n = Z(e, t);
|
|
294
|
+
return /* @__PURE__ */ h.createElement(
|
|
295
|
+
_,
|
|
296
|
+
{
|
|
297
|
+
ref: this.domContainer,
|
|
298
|
+
definition: n
|
|
299
|
+
}
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Initializes the editor by creating a proper watchdog and initializing it with the editor's configuration.
|
|
304
|
+
*/
|
|
305
|
+
async _initializeEditor() {
|
|
306
|
+
const e = f(), {
|
|
307
|
+
editor: t,
|
|
308
|
+
disableWatchdog: n,
|
|
309
|
+
watchdogConfig: r
|
|
310
|
+
} = this.props, a = this._getMergedConfig(!0);
|
|
311
|
+
if (n)
|
|
312
|
+
return {
|
|
313
|
+
instance: await this._createEditor(a),
|
|
314
|
+
watchdog: null
|
|
315
|
+
};
|
|
316
|
+
const o = $(this.context) ? new Y(this.context.watchdog) : new t.EditorWatchdog(t, r);
|
|
317
|
+
return o.on("error", (s, { error: l, causesRestart: c }) => {
|
|
318
|
+
var u;
|
|
319
|
+
((u = this.props.onError) != null ? u : console.error)(l, { phase: "runtime", willEditorRestart: c });
|
|
320
|
+
}), e.elementConfigAttachment ? (o.setCreator(async (s) => this._watchdogCreateEditor(o, s)), await o.create(a)) : (o.setCreator(async (s, l) => this._watchdogCreateEditor(o, l)), await o.create(this.domContainer.current, a)), {
|
|
321
|
+
watchdog: o,
|
|
322
|
+
instance: o.editor
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Creates editor in watchdog context.
|
|
327
|
+
*
|
|
328
|
+
* @param watchdog Watchdog adapter.
|
|
329
|
+
* @param config Editor configuration.
|
|
330
|
+
* @returns Editor instance.
|
|
331
|
+
*/
|
|
332
|
+
async _watchdogCreateEditor(e, t) {
|
|
333
|
+
const { editorSemaphore: n } = this, { onAfterDestroy: r, onReady: a } = this.props, o = !!(n != null && n.value);
|
|
334
|
+
o && r && r(n.value.instance);
|
|
335
|
+
const s = await this._createEditor(t);
|
|
336
|
+
return o && n && (n.unsafeSetValue({
|
|
337
|
+
instance: s,
|
|
338
|
+
watchdog: e
|
|
339
|
+
}), setTimeout(() => {
|
|
340
|
+
a == null || a(e.editor);
|
|
341
|
+
})), s;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Creates an editor from the element and configuration.
|
|
345
|
+
*
|
|
346
|
+
* @param config CKEditor 5 editor configuration.
|
|
347
|
+
* @returns Editor instance.
|
|
348
|
+
*/
|
|
349
|
+
async _createEditor(e) {
|
|
350
|
+
const { editor: t } = this.props, n = f(), r = this._getMergedConfig(!1, e), a = await /* istanbul ignore next -- @preserve */
|
|
351
|
+
(n.elementConfigAttachment ? t.create(r) : t.create(this.domContainer.current, r));
|
|
352
|
+
this.props.disabled && a.enableReadOnlyMode(m);
|
|
353
|
+
const o = a.model.document, s = a.editing.view.document;
|
|
354
|
+
return o.on("change:data", (l) => {
|
|
355
|
+
var c, u;
|
|
356
|
+
(u = (c = this.props).onChange) == null || u.call(c, l, a);
|
|
357
|
+
}), s.on("focus", (l) => {
|
|
358
|
+
var c, u;
|
|
359
|
+
(u = (c = this.props).onFocus) == null || u.call(c, l, a);
|
|
360
|
+
}), s.on("blur", (l) => {
|
|
361
|
+
var c, u;
|
|
362
|
+
(u = (c = this.props).onBlur) == null || u.call(c, l, a);
|
|
363
|
+
}), a;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* It gets an extended configuration containing the entries required for the integration configuration.
|
|
367
|
+
*
|
|
368
|
+
* @param resetData Assigns `data` prop value to the configuration if true.
|
|
369
|
+
* @param config The configuration of the editor.
|
|
370
|
+
* @returns Shallow copy of config.
|
|
371
|
+
*/
|
|
372
|
+
_getMergedConfig(e, t) {
|
|
373
|
+
const { contextItemMetadata: n, editor: r } = this.props, a = f();
|
|
374
|
+
let o = { ...t ?? this.props.config };
|
|
375
|
+
return n && (o = U(n, o)), o = G(o), a.elementConfigAttachment && (o = S(r, this.domContainer.current, o)), e && (o = T(o, this.props.data || "")), o;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Destroys the editor by destroying the watchdog.
|
|
379
|
+
*/
|
|
380
|
+
async _destroyEditor(e) {
|
|
381
|
+
const { watchdog: t, instance: n } = e;
|
|
382
|
+
return new Promise((r, a) => {
|
|
383
|
+
setTimeout(async () => {
|
|
384
|
+
try {
|
|
385
|
+
if (t)
|
|
386
|
+
return await t.destroy(), r();
|
|
387
|
+
if (n)
|
|
388
|
+
return await n.destroy(), r();
|
|
389
|
+
r();
|
|
390
|
+
} catch (o) {
|
|
391
|
+
console.error(o), a(o);
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
d(X, "contextType", F);
|
|
398
|
+
function Z(i, e) {
|
|
399
|
+
var t, n, r, a, o;
|
|
400
|
+
return !i.editorName || i.editorName === "ClassicEditor" ? "div" : (o = (a = (n = (t = e.roots) == null ? void 0 : t.main) == null ? void 0 : n.element) != null ? a : (r = e.root) == null ? void 0 : r.element) != null ? o : "div";
|
|
401
|
+
}
|
|
402
|
+
function j(i, e, t) {
|
|
403
|
+
return !(i.data === e.data || t.data.get() === e.data);
|
|
404
|
+
}
|
|
405
|
+
function ee() {
|
|
406
|
+
switch (L("42.0.0")) {
|
|
407
|
+
case null:
|
|
408
|
+
console.warn('Cannot find the "CKEDITOR_VERSION" in the "window" scope.');
|
|
409
|
+
break;
|
|
410
|
+
case -1:
|
|
411
|
+
console.warn("The <CKEditor> component requires using CKEditor 5 in version 42+ or nightly build.");
|
|
412
|
+
break;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
function I(...i) {
|
|
416
|
+
return (e) => {
|
|
417
|
+
i.forEach((t) => {
|
|
418
|
+
typeof t == "function" ? t(e) : t != null && (t.current = e);
|
|
419
|
+
});
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
const te = p(({ editor: i }, e) => {
|
|
423
|
+
const t = y(null);
|
|
424
|
+
return v(() => {
|
|
425
|
+
const n = t.current;
|
|
426
|
+
if (!i || !n)
|
|
427
|
+
return;
|
|
428
|
+
const r = i.ui.view.toolbar.element;
|
|
429
|
+
return n.appendChild(r), () => {
|
|
430
|
+
n.contains(r) && n.removeChild(r);
|
|
431
|
+
};
|
|
432
|
+
}, [i]), /* @__PURE__ */ h.createElement("div", { ref: I(t, e) });
|
|
433
|
+
});
|
|
434
|
+
te.displayName = "EditorToolbarWrapper";
|
|
435
|
+
const ne = "$rootEditableOptions", ie = C(p(({ id: i, editor: e, rootName: t }, n) => {
|
|
436
|
+
var r;
|
|
437
|
+
const a = y(null), o = g(() => e == null ? void 0 : e.model.document.getRoot(t), [e, t]), s = g(() => o ? { ...o.getAttribute(ne) } : null, [o]);
|
|
438
|
+
if (v(() => {
|
|
439
|
+
if (!e || !o || !s)
|
|
440
|
+
return;
|
|
441
|
+
e.ui.getEditableElement(t) && e.detachEditable(o);
|
|
442
|
+
const c = e.ui.view.createEditable(t, a.current, s.label);
|
|
443
|
+
return c.isInlineRoot = !e.model.schema.checkChild(o, "$block"), e.ui.addEditable(c, s.placeholder), e.editing.view.forceRender(), () => {
|
|
444
|
+
e && e.state !== "destroyed" && e.model.document.getRoot(t) === o && e.detachEditable(o);
|
|
445
|
+
};
|
|
446
|
+
}, [e, o, s]), !s)
|
|
447
|
+
return null;
|
|
448
|
+
let l = M((r = s == null ? void 0 : s.element) != null ? r : {
|
|
449
|
+
name: "div"
|
|
450
|
+
});
|
|
451
|
+
return l = {
|
|
452
|
+
...l,
|
|
453
|
+
attributes: {
|
|
454
|
+
...l.attributes,
|
|
455
|
+
id: i
|
|
456
|
+
}
|
|
457
|
+
}, /* @__PURE__ */ h.createElement(
|
|
458
|
+
_,
|
|
459
|
+
{
|
|
460
|
+
key: e == null ? void 0 : e.id,
|
|
461
|
+
ref: I(n, a),
|
|
462
|
+
definition: l
|
|
463
|
+
}
|
|
464
|
+
);
|
|
465
|
+
}));
|
|
466
|
+
ie.displayName = "EditorEditable";
|
|
467
|
+
export {
|
|
468
|
+
X as CKEditor,
|
|
469
|
+
F as ContextWatchdogContext
|
|
470
|
+
};
|
|
471
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/@ckeditor/ckeditor5-react/dist/index.js"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\nimport React, { useRef, useEffect, useCallback, useState, useContext, memo, forwardRef, useMemo } from \"react\";\nimport { createDefer, once, uid, createIntegrationUsageDataPlugin, isCKEditorFreeLicense, appendExtraPluginsToEditorConfig, mapObjectKeys, kebabToCamelCase, getInstalledCKBaseFeatures, assignElementToEditorConfig, assignInitialDataToEditorConfig, compareInstalledCKBaseVersion, shallowCompareArrays, overwriteObject, overwriteArray, assignInitialDataToMultirootEditorConfig, assignAttributesPropToMultiRootEditorConfig, uniq, isSSR, loadCKEditorCloud } from \"@ckeditor/ckeditor5-integrations-common\";\nimport { loadCKEditorCloud as loadCKEditorCloud2 } from \"@ckeditor/ckeditor5-integrations-common\";\nconst _LifeCycleElementSemaphore = class _LifeCycleElementSemaphore {\n constructor(element, lifecycle) {\n /**\n * This should define async methods for initializing and destroying the editor.\n * Essentially, it's an async version of basic React lifecycle methods like `componentDidMount`, `componentWillUnmount`.\n *\n * \t* Result of {@link LifeCycleAsyncOperators#mount} method is passed to {@link LifeCycleAsyncOperators#unmount} as an argument.\n */\n __publicField(this, \"_lifecycle\");\n /**\n * This is the element instance that the editor uses for mounting. This element should contain the `ckeditorInstance` member\n * once the editor has been successfully mounted to it. The semaphore ensures that a new instance of the editor, which will\n * be assigned to this element by the {@link #_lifecycle:mount} method, will always be initialized after the successful\n * destruction of the underlying `ckeditorInstance` that was previously mounted on this element.\n */\n __publicField(this, \"_element\");\n /**\n * This is the lock mechanism utilized by the {@link #lock} and {@link #release} methods.\n *\n * \t* If the editor is not yet mounted and is awaiting mounting (for instance, when another editor is\n * \t occupying the element), then it is null.\n *\n * \t* When the editor is mounted on the element, this variable holds an unresolved promise that will be\n * \t resolved after the editor is destroyed.\n *\n * \t* Once the editor is destroyed (and it was previously mounted), the promise is resolved.\n */\n __publicField(this, \"_releaseLock\", null);\n /**\n * This is the result of the {@link #_lifecycle:mount} function. This value should be reset to `null`\n * once the semaphore is released. It is utilized to store certain data that must be removed following\n * the destruction of the editor. This data may include the editor's instance, the assigned watchdog,\n * or handles for additional window listeners.\n */\n __publicField(this, \"_value\", null);\n /**\n * This is a list of callbacks that are triggered if the semaphore {@link #_lifecycle:mount} method executes successfully.\n * It is utilized in scenarios where we need to assign certain properties to an editor that is currently in the process of mounting.\n * An instance of such usage could be two-way binding. We aim to prevent the loss of all `setData` calls if the editor has not\n * yet been mounted, therefore these calls will be executed immediately following the completion of the mounting process.\n */\n __publicField(this, \"_afterMountCallbacks\", []);\n /**\n * This represents the actual mounting state of the semaphore. It is primarily used by the {@link #release} method to\n * determine whether the initialization of the editor should be skipped or, if the editor is already initialized, the editor\n * should be destroyed.\n *\n * \t* If `destroyedBeforeInitialization` is true, then the {@link #release} method was invoked before the editor began to mount.\n * \t This often occurs in strict mode when we assign a promise to the {@link LifeCycleEditorElementSemaphore#_semaphores} map\n * \t and the assigned `mount` callback has not yet been called. In this scenario, it is safe to skip the initialization of the editor\n * \t and simply release the semaphore.\n *\n *\t* If `mountingInProgress` is a Promise, then the {@link #release} method was invoked after the initialization of the editor and\n \t the editor must be destroyed before the semaphore is released.\n */\n __publicField(this, \"_state\", {\n destroyedBeforeInitialization: false,\n mountingInProgress: null\n });\n /**\n * Inverse of {@link #_lock} method that tries to destroy attached editor.\n *\n * \t* If editor is being already attached to element (or is in attaching process) then after fully initialization of editor\n * \t destroy is performed and semaphore is released. The {@link #_lifecycle} unmount method is called.\n *\n * \t* If editor is being destroyed before initialization then it does nothing but sets `destroyedBeforeInitialization` flag that\n * \t will be later checked by {@link #_lock} method in initialization. The {@link #_lifecycle} unmount method is not called.\n *\n * *Important note:*\n *\n * It’s really important to keep this method *sync*. If we make this method *async*, it won’t work well because\n * it will cause problems when we’re trying to set up the {@link LifeCycleEditorElementSemaphore#_semaphores} map entries.\n */\n __publicField(this, \"release\", once(() => {\n const { _releaseLock, _state, _element, _lifecycle } = this;\n if (_state.mountingInProgress) {\n _state.mountingInProgress.then(() => _lifecycle.unmount({\n element: _element,\n // Mount result might be overridden by watchdog during restart so use instance variable.\n mountResult: this.value\n })).catch((error) => {\n console.error(\"CKEditor unmounting error:\", error);\n }).then(_releaseLock.resolve).then(() => {\n this._value = null;\n });\n } else {\n _state.destroyedBeforeInitialization = true;\n _releaseLock.resolve();\n }\n }));\n this._element = element;\n this._lifecycle = lifecycle;\n this._lock();\n }\n /**\n * Getter for {@link #_value}.\n */\n get value() {\n return this._value;\n }\n /**\n * Resets the semaphore to its initial state.\n */\n discard() {\n this._value = null;\n this._releaseLock = null;\n this._afterMountCallbacks = [];\n this._state = {\n destroyedBeforeInitialization: false,\n mountingInProgress: null\n };\n }\n /**\n * Occasionally, the Watchdog restarts the editor instance, resulting in a new instance being assigned to the semaphore.\n * In terms of race conditions, it's generally safer to simply override the semaphore value rather than recreating it\n * with a different one.\n */\n unsafeSetValue(value) {\n this._value = value;\n this._afterMountCallbacks.forEach((callback) => {\n if (this._lifecycle.isValueValid && !this._lifecycle.isValueValid(value)) {\n return;\n }\n callback(value);\n });\n this._afterMountCallbacks = [];\n }\n /**\n * This registers a callback that will be triggered after the editor has been successfully mounted.\n *\n * \t* If the editor is already mounted, the callback will be executed immediately.\n *\t* If the editor is in the process of mounting, the callback will be executed upon successful mounting.\n * \t* If the editor is never mounted, the passed callback will not be executed.\n * \t* If an exception is thrown within the callback, it will be re-thrown in the semaphore.\n * \t* If the value is not valid (determined by isValueValid), the callback will not be executed.\n */\n runAfterMount(callback) {\n const { _value, _afterMountCallbacks } = this;\n if (_value) {\n if (this._lifecycle.isValueValid && !this._lifecycle.isValueValid(_value)) {\n return;\n }\n callback(_value);\n } else {\n _afterMountCallbacks.push(callback);\n }\n }\n /**\n * This method is used to inform other components that the {@link #_element} will be used by the editor,\n * which is initialized by the {@link #_lifecycle} methods.\n *\n * \t* If an editor is already present on the provided element, the initialization of the current one\n * \t will be postponed until the previous one is destroyed.\n *\n * \t* If the element is empty and does not have an editor attached to it, the currently locked editor will\n * \t be mounted immediately.\n *\n * After the successful initialization of the editor and the assignment of the {@link #_value} member,\n * the `onReady` lifecycle method is called.\n *\n * *Important note:*\n *\n * It’s really important to keep this method *sync*. If we make this method *async*, it won’t work well because\n * it will cause problems when we’re trying to set up the {@link LifeCycleEditorElementSemaphore#_semaphores} map entries.\n */\n _lock() {\n const { _semaphores } = _LifeCycleElementSemaphore;\n const { _state, _element, _lifecycle } = this;\n const prevElementSemaphore = _semaphores.get(_element) || Promise.resolve(null);\n const releaseLock = createDefer();\n this._releaseLock = releaseLock;\n const newElementSemaphore = prevElementSemaphore.then(() => {\n if (_state.destroyedBeforeInitialization) {\n return Promise.resolve(void 0);\n }\n _state.mountingInProgress = _lifecycle.mount().then((mountResult) => {\n if (mountResult) {\n this.unsafeSetValue(mountResult);\n }\n return mountResult;\n });\n return _state.mountingInProgress;\n }).then(async (mountResult) => {\n if (mountResult && _lifecycle.afterMount) {\n await _lifecycle.afterMount({\n element: _element,\n mountResult\n });\n }\n }).then(() => releaseLock.promise).catch((error) => {\n console.error(\"CKEditor mounting error:\", error);\n }).then(() => {\n if (_semaphores.get(_element) === newElementSemaphore) {\n _semaphores.delete(_element);\n }\n });\n _semaphores.set(_element, newElementSemaphore);\n }\n};\n/**\n * This is a map of elements associated with promises. It informs the semaphore that the underlying HTML element, used as a key,\n * is currently in use by another editor. Each element is assigned a promise, which allows for the easy chaining of new\n * editor instances on an element that is already in use by another instance. The process works as follows:\n *\n * \t1. If an element is being used by an editor, then the initialization of a new editor\n * \t instance is chained using the `.then()` method of the Promise.\n *\n * \t2. If the editor associated with the underlying element is destroyed, then `Promise.resolve()` is called\n * \t and the previously assigned `.then()` editor callback is executed.\n *\n * @see {@link #lock} for more detailed information on the implementation.\n */\n__publicField(_LifeCycleElementSemaphore, \"_semaphores\", /* @__PURE__ */ new Map());\nlet LifeCycleElementSemaphore = _LifeCycleElementSemaphore;\nconst ReactContextMetadataKey = \"$__CKEditorReactContextMetadata\";\nfunction withCKEditorReactContextMetadata(metadata, config) {\n return {\n ...config,\n [ReactContextMetadataKey]: metadata\n };\n}\nfunction tryExtractCKEditorReactContextMetadata(object) {\n return object.get(ReactContextMetadataKey);\n}\nconst useIsMountedRef = () => {\n const mountedRef = useRef(false);\n useEffect(() => {\n mountedRef.current = true;\n return () => {\n mountedRef.current = false;\n };\n }, []);\n return mountedRef;\n};\nconst useRefSafeCallback = (fn) => {\n const callbackRef = useRef();\n callbackRef.current = fn;\n return useCallback(\n (...args) => callbackRef.current(...args),\n []\n );\n};\nconst useInitializedCKEditorsMap = ({\n currentContextWatchdog,\n onChangeInitializedEditors\n}) => {\n const onChangeInitializedEditorsSafe = useRefSafeCallback(onChangeInitializedEditors || (() => {\n }));\n useEffect(() => {\n var _a;\n if (currentContextWatchdog.status !== \"initialized\") {\n return;\n }\n const { watchdog } = currentContextWatchdog;\n const editors = (_a = watchdog == null ? void 0 : watchdog.context) == null ? void 0 : _a.editors;\n if (!editors) {\n return;\n }\n const getInitializedContextEditors = () => [...editors].reduce(\n (map, editor) => {\n var _a2;\n if (editor.state !== \"ready\") {\n return map;\n }\n const metadata = tryExtractCKEditorReactContextMetadata(editor.config);\n const nameOrId = (_a2 = metadata == null ? void 0 : metadata.name) != null ? _a2 : editor.id;\n map[nameOrId] = {\n instance: editor,\n metadata\n };\n return map;\n },\n /* @__PURE__ */ Object.create({})\n // Prevent the prototype pollution.\n );\n const onEditorStatusChange = () => {\n onChangeInitializedEditorsSafe(\n getInitializedContextEditors(),\n watchdog\n );\n };\n const trackEditorLifecycle = (editor) => {\n editor.once(\"ready\", onEditorStatusChange, { priority: \"lowest\" });\n editor.once(\"destroy\", onEditorStatusChange, { priority: \"lowest\" });\n };\n const onAddEditorToCollection = (_, editor) => {\n trackEditorLifecycle(editor);\n };\n editors.forEach(trackEditorLifecycle);\n editors.on(\"add\", onAddEditorToCollection);\n if (Array.from(editors).some((editor) => editor.state === \"ready\")) {\n onEditorStatusChange();\n }\n return () => {\n editors.off(\"add\", onAddEditorToCollection);\n };\n }, [currentContextWatchdog]);\n};\nconst ContextWatchdogContext = React.createContext(null);\nconst useCKEditorWatchdogContext = () => useContext(ContextWatchdogContext);\nconst CKEditorContext = (props) => {\n const {\n id,\n context,\n watchdogConfig,\n children,\n config,\n onReady,\n contextWatchdog: ContextWatchdogConstructor,\n isLayoutReady = true,\n onChangeInitializedEditors,\n onError = (error, details) => console.error(error, details)\n } = props;\n const isMountedRef = useIsMountedRef();\n const prevWatchdogInitializationIDRef = useRef(null);\n const [currentContextWatchdog, setCurrentContextWatchdog] = useState({\n status: \"initializing\"\n });\n useEffect(() => {\n if (isLayoutReady) {\n initializeContextWatchdog();\n } else {\n setCurrentContextWatchdog({\n status: \"initializing\"\n });\n }\n }, [id, isLayoutReady]);\n useEffect(() => () => {\n if (currentContextWatchdog.status === \"initialized\") {\n currentContextWatchdog.watchdog.destroy();\n }\n }, [currentContextWatchdog]);\n useInitializedCKEditorsMap({\n currentContextWatchdog,\n onChangeInitializedEditors\n });\n function regenerateInitializationID() {\n prevWatchdogInitializationIDRef.current = uid();\n return prevWatchdogInitializationIDRef.current;\n }\n function canUpdateState(initializationID) {\n return prevWatchdogInitializationIDRef.current === initializationID && isMountedRef.current;\n }\n function initializeContextWatchdog() {\n const watchdogInitializationID = regenerateInitializationID();\n const contextWatchdog = new ContextWatchdogConstructor(context, watchdogConfig);\n contextWatchdog.on(\"error\", (_, errorEvent) => {\n if (canUpdateState(watchdogInitializationID)) {\n onError(errorEvent.error, {\n phase: \"runtime\",\n willContextRestart: errorEvent.causesRestart\n });\n }\n });\n contextWatchdog.on(\"stateChange\", () => {\n if (onReady && contextWatchdog.state === \"ready\" && canUpdateState(watchdogInitializationID)) {\n onReady(\n contextWatchdog.context,\n contextWatchdog\n );\n }\n });\n contextWatchdog.create(config).then(() => {\n if (canUpdateState(watchdogInitializationID)) {\n setCurrentContextWatchdog({\n status: \"initialized\",\n watchdog: contextWatchdog\n });\n } else {\n contextWatchdog.destroy();\n }\n }).catch((error) => {\n if (canUpdateState(watchdogInitializationID)) {\n onError(error, {\n phase: \"initialization\",\n willContextRestart: false\n });\n setCurrentContextWatchdog({\n status: \"error\",\n error\n });\n }\n });\n return contextWatchdog;\n }\n return /* @__PURE__ */ React.createElement(ContextWatchdogContext.Provider, { value: currentContextWatchdog }, children);\n};\nconst isContextWatchdogValue = (obj) => !!obj && typeof obj === \"object\" && \"status\" in obj && [\"initializing\", \"initialized\", \"error\"].includes(obj.status);\nconst isContextWatchdogValueWithStatus = (status) => (obj) => isContextWatchdogValue(obj) && obj.status === status;\nconst isContextWatchdogInitializing = isContextWatchdogValueWithStatus(\"initializing\");\nconst isContextWatchdogReadyToUse = (obj) => isContextWatchdogValueWithStatus(\"initialized\")(obj) && obj.watchdog.state === \"ready\";\nconst ReactIntegrationUsageDataPlugin = createIntegrationUsageDataPlugin(\n \"react\",\n {\n version: \"11.2.0\",\n frameworkVersion: React.version\n }\n);\nfunction appendAllIntegrationPluginsToConfig(editorConfig) {\n if (isCKEditorFreeLicense(editorConfig.licenseKey)) {\n return editorConfig;\n }\n return appendExtraPluginsToEditorConfig(editorConfig, [\n /**\n * This part of the code is not executed in open-source implementations using a GPL key.\n * It only runs when a specific license key is provided. If you are uncertain whether\n * this applies to your installation, please contact our support team.\n */\n ReactIntegrationUsageDataPlugin\n ]);\n}\nclass EditorWatchdogAdapter {\n /**\n * @param contextWatchdog The context watchdog instance that will be wrapped into editor watchdog API.\n */\n constructor(contextWatchdog) {\n /**\n * The context watchdog instance that will be wrapped into editor watchdog API.\n */\n __publicField(this, \"_contextWatchdog\");\n /**\n * A unique id for the adapter to distinguish editor items when using the context watchdog API.\n */\n __publicField(this, \"_id\");\n /**\n * A watchdog's editor creator function.\n */\n __publicField(this, \"_creator\");\n this._contextWatchdog = contextWatchdog;\n this._id = uid();\n }\n /**\n * @param creator A watchdog's editor creator function.\n */\n setCreator(creator) {\n this._creator = creator;\n }\n create(sourceElementOrDataOrConfig, config) {\n let watchdogItemConfiguration = {\n creator: this._creator,\n id: this._id,\n type: \"editor\"\n };\n if (config) {\n watchdogItemConfiguration = {\n ...watchdogItemConfiguration,\n sourceElementOrData: sourceElementOrDataOrConfig,\n config\n };\n } else {\n watchdogItemConfiguration = {\n ...watchdogItemConfiguration,\n config: sourceElementOrDataOrConfig\n };\n }\n return this._contextWatchdog.add(watchdogItemConfiguration);\n }\n /**\n * Creates a listener that is attached to context watchdog's item and run when the context watchdog fires.\n * Currently works only for the `error` event.\n */\n on(_, callback) {\n this._contextWatchdog.on(\"itemError\", (_2, { itemId, error }) => {\n if (itemId === this._id) {\n callback(null, { error, causesRestart: void 0 });\n }\n });\n }\n destroy() {\n if (this._contextWatchdog.state === \"ready\") {\n return this._contextWatchdog.remove(this._id);\n }\n return Promise.resolve();\n }\n /**\n * An editor instance.\n */\n get editor() {\n return this._contextWatchdog.getItem(this._id);\n }\n}\nfunction normalizeClassList(classes) {\n if (typeof classes === \"string\") {\n return classes;\n }\n return (classes != null ? classes : []).join(\" \");\n}\nfunction normalizeStylesMap(styles) {\n return mapObjectKeys(styles, (key) => {\n if (key.startsWith(\"--\")) {\n return key;\n }\n return kebabToCamelCase(key);\n });\n}\nfunction normalizeEditorElementDefinition(definition) {\n if (typeof HTMLElement !== \"undefined\" && definition instanceof HTMLElement) {\n throw new Error(\n \"An HTMLElement cannot be used as an editor element definition. Please pass a string, a React component, or an object definition.\"\n );\n }\n if (typeof definition !== \"object\" || definition === null) {\n return {\n name: definition\n };\n }\n return definition;\n}\nconst EditorElement = memo(forwardRef(({ definition }, ref) => {\n const { name: Tag, classes, styles, attributes } = normalizeEditorElementDefinition(definition != null ? definition : {\n name: \"div\"\n });\n return /* @__PURE__ */ React.createElement(\n Tag,\n {\n ref,\n ...attributes,\n style: normalizeStylesMap(styles != null ? styles : {}),\n className: normalizeClassList(classes)\n }\n );\n}));\nEditorElement.displayName = \"EditorElement\";\nconst REACT_INTEGRATION_READ_ONLY_LOCK_ID$1 = \"Lock from React integration (@ckeditor/ckeditor5-react)\";\nclass CKEditor extends React.Component {\n constructor(props) {\n super(props);\n /**\n * After mounting the editor, the variable will contain a reference to the created editor.\n * @see: https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editor-Editor.html\n */\n __publicField(this, \"domContainer\", React.createRef());\n /**\n * Unlocks element in editor semaphore after destroy editor instance.\n */\n __publicField(this, \"editorSemaphore\", null);\n assertMinimumSupportedVersion();\n }\n get _semaphoreValue() {\n const { editorSemaphore } = this;\n return editorSemaphore ? editorSemaphore.value : null;\n }\n /**\n * An watchdog instance.\n */\n get watchdog() {\n const { _semaphoreValue } = this;\n return _semaphoreValue ? _semaphoreValue.watchdog : null;\n }\n /**\n * An editor instance.\n */\n get editor() {\n const { _semaphoreValue } = this;\n return _semaphoreValue ? _semaphoreValue.instance : null;\n }\n /**\n * The CKEditor component should not be updated by React itself.\n * However, if the component identifier changes, the whole structure should be created once again.\n */\n shouldComponentUpdate(nextProps) {\n const { props, editorSemaphore } = this;\n if (nextProps.id !== props.id) {\n return true;\n }\n if (nextProps.disableWatchdog !== props.disableWatchdog) {\n return true;\n }\n if (editorSemaphore) {\n editorSemaphore.runAfterMount(({ instance }) => {\n if (shouldUpdateEditorData(props, nextProps, instance)) {\n instance.data.set(nextProps.data);\n }\n });\n if (\"disabled\" in nextProps) {\n editorSemaphore.runAfterMount(({ instance }) => {\n if (nextProps.disabled) {\n instance.enableReadOnlyMode(REACT_INTEGRATION_READ_ONLY_LOCK_ID$1);\n } else {\n instance.disableReadOnlyMode(REACT_INTEGRATION_READ_ONLY_LOCK_ID$1);\n }\n });\n }\n }\n return false;\n }\n /**\n * Initialize the editor when the component is mounted.\n */\n componentDidMount() {\n if (!isContextWatchdogInitializing(this.context)) {\n this._initLifeCycleSemaphore();\n }\n }\n /**\n * Re-render the entire component once again. The old editor will be destroyed and the new one will be created.\n */\n componentDidUpdate() {\n if (!isContextWatchdogInitializing(this.context)) {\n this._initLifeCycleSemaphore();\n }\n }\n /**\n * Destroy the editor before unmounting the component.\n */\n componentWillUnmount() {\n this._unlockLifeCycleSemaphore();\n }\n /**\n * Async destroy attached editor and unlock element semaphore.\n */\n _unlockLifeCycleSemaphore() {\n if (this.editorSemaphore) {\n this.editorSemaphore.release();\n this.editorSemaphore = null;\n }\n }\n /**\n * Unlocks previous editor semaphore and creates new one..\n */\n _initLifeCycleSemaphore() {\n this._unlockLifeCycleSemaphore();\n this.editorSemaphore = new LifeCycleElementSemaphore(this.domContainer.current, {\n isValueValid: (value) => value && !!value.instance,\n mount: async () => {\n var _a, _b;\n try {\n return await this._initializeEditor();\n } catch (error) {\n (_b = (_a = this.props).onError) == null ? void 0 : _b.call(_a, error, { phase: \"initialization\", willEditorRestart: false });\n throw error;\n }\n },\n afterMount: ({ mountResult }) => {\n const { onReady } = this.props;\n if (onReady && this.domContainer.current !== null) {\n onReady(mountResult.instance);\n }\n },\n unmount: async ({ element, mountResult }) => {\n const { onAfterDestroy } = this.props;\n try {\n await this._destroyEditor(mountResult);\n element.innerHTML = \"\";\n } finally {\n if (onAfterDestroy) {\n onAfterDestroy(mountResult.instance);\n }\n }\n }\n });\n }\n /**\n * Render a <div> element which will be replaced by CKEditor.\n */\n render() {\n const { editor: Editor, config = {} } = this.props;\n const definition = getEditorElementDefinition(Editor, config);\n return /* @__PURE__ */ React.createElement(\n EditorElement,\n {\n ref: this.domContainer,\n definition\n }\n );\n }\n /**\n * Initializes the editor by creating a proper watchdog and initializing it with the editor's configuration.\n */\n async _initializeEditor() {\n const supports = getInstalledCKBaseFeatures();\n const {\n editor: Editor,\n disableWatchdog,\n watchdogConfig\n } = this.props;\n const mergedConfig = this._getMergedConfig(true);\n if (disableWatchdog) {\n const instance = await this._createEditor(mergedConfig);\n return {\n instance,\n watchdog: null\n };\n }\n const watchdog = (() => {\n if (isContextWatchdogReadyToUse(this.context)) {\n return new EditorWatchdogAdapter(this.context.watchdog);\n }\n return new Editor.EditorWatchdog(Editor, watchdogConfig);\n })();\n watchdog.on(\"error\", (_, { error, causesRestart }) => {\n var _a;\n const onError = (_a = this.props.onError) != null ? _a : console.error;\n onError(error, { phase: \"runtime\", willEditorRestart: causesRestart });\n });\n if (supports.elementConfigAttachment) {\n watchdog.setCreator(async (config) => this._watchdogCreateEditor(watchdog, config));\n await watchdog.create(mergedConfig);\n } else {\n watchdog.setCreator(async (_, config) => this._watchdogCreateEditor(watchdog, config));\n await watchdog.create(this.domContainer.current, mergedConfig);\n }\n return {\n watchdog,\n instance: watchdog.editor\n };\n }\n /**\n * Creates editor in watchdog context.\n *\n * @param watchdog Watchdog adapter.\n * @param config Editor configuration.\n * @returns Editor instance.\n */\n async _watchdogCreateEditor(watchdog, config) {\n const { editorSemaphore } = this;\n const { onAfterDestroy, onReady } = this.props;\n const nonFirstCreate = !!(editorSemaphore == null ? void 0 : editorSemaphore.value);\n if (nonFirstCreate && onAfterDestroy) {\n onAfterDestroy(editorSemaphore.value.instance);\n }\n const instance = await this._createEditor(config);\n if (nonFirstCreate && editorSemaphore) {\n editorSemaphore.unsafeSetValue({\n instance,\n watchdog\n });\n setTimeout(() => {\n onReady == null ? void 0 : onReady(watchdog.editor);\n });\n }\n return instance;\n }\n /**\n * Creates an editor from the element and configuration.\n *\n * @param config CKEditor 5 editor configuration.\n * @returns Editor instance.\n */\n async _createEditor(config) {\n const { editor: Editor } = this.props;\n const supports = getInstalledCKBaseFeatures();\n const mergedConfig = this._getMergedConfig(false, config);\n const editor = await /* istanbul ignore next -- @preserve */\n (supports.elementConfigAttachment ? Editor.create(mergedConfig) : Editor.create(this.domContainer.current, mergedConfig));\n if (this.props.disabled) {\n editor.enableReadOnlyMode(REACT_INTEGRATION_READ_ONLY_LOCK_ID$1);\n }\n const modelDocument = editor.model.document;\n const viewDocument = editor.editing.view.document;\n modelDocument.on(\"change:data\", (event) => {\n var _a, _b;\n (_b = (_a = this.props).onChange) == null ? void 0 : _b.call(_a, event, editor);\n });\n viewDocument.on(\"focus\", (event) => {\n var _a, _b;\n (_b = (_a = this.props).onFocus) == null ? void 0 : _b.call(_a, event, editor);\n });\n viewDocument.on(\"blur\", (event) => {\n var _a, _b;\n (_b = (_a = this.props).onBlur) == null ? void 0 : _b.call(_a, event, editor);\n });\n return editor;\n }\n /**\n * It gets an extended configuration containing the entries required for the integration configuration.\n *\n * @param resetData Assigns `data` prop value to the configuration if true.\n * @param config The configuration of the editor.\n * @returns Shallow copy of config.\n */\n _getMergedConfig(resetData, config) {\n const { contextItemMetadata, editor: Editor } = this.props;\n const supports = getInstalledCKBaseFeatures();\n let mappedConfig = { ...config != null ? config : this.props.config };\n if (contextItemMetadata) {\n mappedConfig = withCKEditorReactContextMetadata(contextItemMetadata, mappedConfig);\n }\n mappedConfig = appendAllIntegrationPluginsToConfig(mappedConfig);\n if (supports.elementConfigAttachment) {\n mappedConfig = assignElementToEditorConfig(Editor, this.domContainer.current, mappedConfig);\n }\n if (resetData) {\n mappedConfig = assignInitialDataToEditorConfig(mappedConfig, this.props.data || \"\");\n }\n return mappedConfig;\n }\n /**\n * Destroys the editor by destroying the watchdog.\n */\n async _destroyEditor(initializeResult) {\n const { watchdog, instance } = initializeResult;\n return new Promise((resolve, reject) => {\n setTimeout(async () => {\n try {\n if (watchdog) {\n await watchdog.destroy();\n return resolve();\n }\n if (instance) {\n await instance.destroy();\n return resolve();\n }\n resolve();\n } catch (e) {\n console.error(e);\n reject(e);\n }\n });\n });\n }\n}\n__publicField(CKEditor, \"contextType\", ContextWatchdogContext);\nfunction getEditorElementDefinition(editor, config) {\n var _a, _b, _c, _d, _e;\n if (!editor.editorName || editor.editorName === \"ClassicEditor\") {\n return \"div\";\n }\n return (_e = (_d = (_b = (_a = config.roots) == null ? void 0 : _a.main) == null ? void 0 : _b.element) != null ? _d : (_c = config.root) == null ? void 0 : _c.element) != null ? _e : \"div\";\n}\nfunction shouldUpdateEditorData(prevProps, nextProps, editor) {\n if (prevProps.data === nextProps.data) {\n return false;\n }\n if (editor.data.get() === nextProps.data) {\n return false;\n }\n return true;\n}\nfunction assertMinimumSupportedVersion() {\n switch (compareInstalledCKBaseVersion(\"42.0.0\")) {\n case null:\n console.warn('Cannot find the \"CKEDITOR_VERSION\" in the \"window\" scope.');\n break;\n case -1:\n console.warn(\"The <CKEditor> component requires using CKEditor 5 in version 42+ or nightly build.\");\n break;\n }\n}\nconst useLifeCycleSemaphoreSyncRef = () => {\n const semaphoreRef = useRef(null);\n const [revision, setRevision] = useState(() => Date.now());\n const pendingWaiters = useRef([]);\n const refresh = () => {\n setRevision(Date.now());\n };\n const release = (rerender = true) => {\n var _a;\n (_a = semaphoreRef.current) == null ? void 0 : _a.release();\n semaphoreRef.current = null;\n const waiters = pendingWaiters.current.splice(0);\n waiters.forEach(({ reject }) => {\n reject(new Error(\"CKEditor: editor was destroyed before initialization completed.\"));\n });\n if (rerender) {\n setRevision(Date.now());\n }\n };\n const unsafeSetValue = (value) => {\n var _a;\n (_a = semaphoreRef.current) == null ? void 0 : _a.unsafeSetValue(value);\n const waiters = pendingWaiters.current.splice(0);\n waiters.forEach(({ resolve }) => resolve(value));\n refresh();\n };\n const runAfterMount = (callback) => {\n var _a;\n (_a = semaphoreRef.current) == null ? void 0 : _a.runAfterMount(callback);\n };\n const replace = (newSemaphore) => {\n var _a;\n (_a = semaphoreRef.current) == null ? void 0 : _a.release();\n semaphoreRef.current = newSemaphore();\n semaphoreRef.current.runAfterMount((value) => {\n const waiters = pendingWaiters.current.splice(0);\n waiters.forEach(({ resolve }) => resolve(value));\n });\n refresh();\n runAfterMount(refresh);\n };\n const waitFor = () => {\n var _a;\n const currentValue = (_a = semaphoreRef.current) == null ? void 0 : _a.value;\n if (currentValue) {\n return Promise.resolve(currentValue);\n }\n return new Promise((resolve, reject) => {\n pendingWaiters.current.push({ resolve, reject });\n });\n };\n const createAttributeRef = (key) => ({\n get current() {\n if (!semaphoreRef.current || !semaphoreRef.current.value) {\n return null;\n }\n return semaphoreRef.current.value[key];\n }\n });\n return {\n get current() {\n return semaphoreRef.current;\n },\n revision,\n createAttributeRef,\n unsafeSetValue,\n release,\n replace,\n runAfterMount,\n waitFor\n };\n};\nconst useInstantEffect = (fn, deps) => {\n const [prevDeps, setDeps] = useState(null);\n if (!shallowCompareArrays(prevDeps, deps)) {\n fn();\n setDeps([...deps]);\n }\n};\nconst useInstantEditorEffect = (semaphore, fn, deps) => {\n useInstantEffect(() => {\n if (semaphore) {\n semaphore.runAfterMount(fn);\n }\n }, [semaphore, ...deps]);\n};\nfunction mergeRefs(...refs) {\n return (value) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref != null) {\n ref.current = value;\n }\n });\n };\n}\nconst EditorToolbarWrapper = forwardRef(({ editor }, ref) => {\n const toolbarRef = useRef(null);\n useEffect(() => {\n const toolbarContainer = toolbarRef.current;\n if (!editor || !toolbarContainer) {\n return void 0;\n }\n const element = editor.ui.view.toolbar.element;\n toolbarContainer.appendChild(element);\n return () => {\n if (toolbarContainer.contains(element)) {\n toolbarContainer.removeChild(element);\n }\n };\n }, [editor]);\n return /* @__PURE__ */ React.createElement(\"div\", { ref: mergeRefs(toolbarRef, ref) });\n});\nEditorToolbarWrapper.displayName = \"EditorToolbarWrapper\";\nconst ROOT_EDITABLE_OPTIONS_ATTRIBUTE = \"$rootEditableOptions\";\nconst EditorEditable = memo(forwardRef(({ id, editor, rootName }, ref) => {\n var _a;\n const innerRef = useRef(null);\n const root = useMemo(() => editor == null ? void 0 : editor.model.document.getRoot(rootName), [editor, rootName]);\n const rootEditableOptions = useMemo(() => {\n if (!root) {\n return null;\n }\n const options = root.getAttribute(ROOT_EDITABLE_OPTIONS_ATTRIBUTE);\n return { ...options };\n }, [root]);\n useEffect(() => {\n if (!editor || !root || !rootEditableOptions) {\n return;\n }\n if (editor.ui.getEditableElement(rootName)) {\n editor.detachEditable(root);\n }\n const editable = editor.ui.view.createEditable(rootName, innerRef.current, rootEditableOptions.label);\n editable.isInlineRoot = !editor.model.schema.checkChild(root, \"$block\");\n editor.ui.addEditable(editable, rootEditableOptions.placeholder);\n editor.editing.view.forceRender();\n return () => {\n if (editor && editor.state !== \"destroyed\") {\n const currentRoot = editor.model.document.getRoot(rootName);\n if (currentRoot === root) {\n editor.detachEditable(root);\n }\n }\n };\n }, [editor, root, rootEditableOptions]);\n if (!rootEditableOptions) {\n return null;\n }\n let normalizedDefinition = normalizeEditorElementDefinition((_a = rootEditableOptions == null ? void 0 : rootEditableOptions.element) != null ? _a : {\n name: \"div\"\n });\n normalizedDefinition = {\n ...normalizedDefinition,\n attributes: {\n ...normalizedDefinition.attributes,\n id\n }\n };\n return /* @__PURE__ */ React.createElement(\n EditorElement,\n {\n key: editor == null ? void 0 : editor.id,\n ref: mergeRefs(ref, innerRef),\n definition: normalizedDefinition\n }\n );\n}));\nEditorEditable.displayName = \"EditorEditable\";\nconst REACT_INTEGRATION_READ_ONLY_LOCK_ID = \"Lock from React integration (@ckeditor/ckeditor5-react)\";\nconst useMultiRootEditor = (props) => {\n const semaphoreElementRef = useRef(props.semaphoreElement || null);\n const semaphore = useLifeCycleSemaphoreSyncRef();\n const editorRefs = {\n watchdog: semaphore.createAttributeRef(\"watchdog\"),\n instance: semaphore.createAttributeRef(\"instance\")\n };\n const context = useContext(ContextWatchdogContext);\n const [roots, setRoots] = useState(() => Object.keys(props.data));\n const [data, setData] = useState({ ...props.data });\n const [attributes, setAttributes] = useState({ ...props.rootsAttributes });\n const shouldUpdateEditor = useRef(true);\n const forceAssignFakeEditableElements = () => {\n const editor = editorRefs.instance.current;\n if (!editor) {\n return;\n }\n const initializeEditableWithFakeElement = (editable) => {\n if (editable.name && !editor.editing.view.getDomRoot(editable.name)) {\n editor.editing.view.attachDomRoot(document.createElement(\"div\"), editable.name);\n }\n };\n Object.values(editor.ui.view.editables).forEach(initializeEditableWithFakeElement);\n };\n useEffect(() => {\n const semaphoreElement = semaphoreElementRef.current;\n if (context && !isContextWatchdogReadyToUse(context)) {\n return;\n }\n if (!semaphoreElement || props.isLayoutReady === false) {\n return;\n }\n semaphore.replace(() => new LifeCycleElementSemaphore(semaphoreElement, {\n mount: _initializeEditor,\n afterMount: ({ mountResult }) => {\n const { onReady } = props;\n if (onReady && semaphoreElementRef.current !== null) {\n onReady(mountResult.instance);\n }\n },\n unmount: async ({ element, mountResult }) => {\n const { onAfterDestroy } = props;\n try {\n await _destroyEditor(mountResult);\n element.innerHTML = \"\";\n } finally {\n if (onAfterDestroy) {\n onAfterDestroy(mountResult.instance);\n }\n }\n }\n }));\n return () => {\n forceAssignFakeEditableElements();\n semaphore.release(false);\n };\n }, [props.id, props.isLayoutReady, context == null ? void 0 : context.status]);\n const _getConfig = useRefSafeCallback(() => {\n let mappedConfig = assignAttributesPropToMultiRootEditorConfig(attributes, props.config || {});\n mappedConfig = appendAllIntegrationPluginsToConfig(mappedConfig);\n return mappedConfig;\n });\n const onChangeData = useRefSafeCallback((editor, event) => {\n const modelDocument = editor.model.document;\n if (!props.disableTwoWayDataBinding) {\n const newData = {};\n const newAttributes = {};\n modelDocument.differ.getChanges().forEach((change) => {\n let root;\n if (change.type == \"insert\" || change.type == \"remove\") {\n root = change.position.root;\n } else {\n root = change.range.root;\n }\n if (!root.isAttached()) {\n return;\n }\n const { rootName } = root;\n newData[rootName] = editor.getData({ rootName });\n });\n modelDocument.differ.getChangedRoots().forEach((changedRoot) => {\n if (changedRoot.state) {\n if (newData[changedRoot.name] !== void 0) {\n delete newData[changedRoot.name];\n }\n return;\n }\n const rootName = changedRoot.name;\n newAttributes[rootName] = editor.getRootAttributes(rootName);\n });\n if (Object.keys(newData).length) {\n setData((previousData) => ({ ...previousData, ...newData }));\n }\n if (Object.keys(newAttributes).length) {\n setAttributes((previousAttributes) => ({ ...previousAttributes, ...newAttributes }));\n }\n }\n if (props.onChange) {\n props.onChange(event, editor);\n }\n });\n const onAddRoot = useRefSafeCallback((editor, _evt, root) => {\n const rootName = root.rootName;\n if (!props.disableTwoWayDataBinding) {\n setData(\n (previousData) => ({ ...previousData, [rootName]: editor.getData({ rootName }) })\n );\n setAttributes(\n (previousAttributes) => ({ ...previousAttributes, [rootName]: editor.getRootAttributes(rootName) })\n );\n }\n setRoots((prevRoots) => uniq([...prevRoots, root.rootName]));\n });\n const onDetachRoot = useRefSafeCallback((_editor, _evt, root) => {\n const rootName = root.rootName;\n if (!props.disableTwoWayDataBinding) {\n setData((previousData) => {\n const { [rootName]: _, ...newData } = previousData;\n return { ...newData };\n });\n setAttributes((previousAttributes) => {\n const { [rootName]: _, ...newAttributes } = previousAttributes;\n return { ...newAttributes };\n });\n }\n setRoots((prevRoots) => prevRoots.filter((root2) => root2 !== rootName));\n });\n const _createEditor = useRefSafeCallback(async (initialData, config) => {\n const Editor = props.editor;\n overwriteObject({ ...props.rootsAttributes }, attributes);\n overwriteObject({ ...props.data }, data);\n overwriteArray(Object.keys(props.data), roots);\n const { initialData: mergedInitialData, ...mergedConfig } = assignInitialDataToMultirootEditorConfig(initialData, config);\n const supports = getInstalledCKBaseFeatures();\n const editor = await /* istanbul ignore next -- @preserve */\n (supports.elementConfigAttachment ? Editor.create({ ...mergedConfig, initialData: mergedInitialData }) : Editor.create(mergedInitialData, mergedConfig));\n const editorData = editor.getFullData();\n overwriteObject({ ...editorData }, data);\n overwriteObject({ ...editor.getRootsAttributes() }, attributes);\n overwriteArray(Object.keys(editorData), roots);\n if (props.disabled) {\n editor.enableReadOnlyMode(REACT_INTEGRATION_READ_ONLY_LOCK_ID);\n }\n const modelDocument = editor.model.document;\n const viewDocument = editor.editing.view.document;\n modelDocument.on(\"change:data\", (evt) => onChangeData(editor, evt));\n editor.on(\"addRoot\", (evt, root) => onAddRoot(editor, evt, root));\n editor.on(\"detachRoot\", (evt, root) => onDetachRoot(editor, evt, root));\n viewDocument.on(\"focus\", (event) => {\n if (props.onFocus) {\n props.onFocus(event, editor);\n }\n });\n viewDocument.on(\"blur\", (event) => {\n if (props.onBlur) {\n props.onBlur(event, editor);\n }\n });\n return editor;\n });\n const _destroyEditor = (initializeResult) => {\n const { watchdog, instance } = initializeResult;\n return new Promise((resolve, reject) => {\n setTimeout(async () => {\n try {\n if (watchdog) {\n await watchdog.destroy();\n return resolve();\n }\n if (instance) {\n await instance.destroy();\n return resolve();\n }\n resolve();\n } catch (e) {\n console.error(e);\n reject(e);\n }\n });\n });\n };\n const _initializeEditor = async () => {\n const supports = getInstalledCKBaseFeatures();\n if (props.disableWatchdog) {\n const instance = await _createEditor(props.data, _getConfig());\n return {\n instance,\n watchdog: null\n };\n }\n const watchdog = (() => {\n if (isContextWatchdogReadyToUse(context)) {\n return new EditorWatchdogAdapter(context.watchdog);\n }\n return new props.editor.EditorWatchdog(props.editor, props.watchdogConfig);\n })();\n const totalRestartsRef = {\n current: 0\n };\n const watchdogEditorCreator = async (config) => {\n const { onAfterDestroy } = props;\n if (totalRestartsRef.current > 0 && onAfterDestroy && editorRefs.instance.current) {\n onAfterDestroy(editorRefs.instance.current);\n }\n const instance = await _createEditor(data, config);\n if (totalRestartsRef.current > 0) {\n semaphore.unsafeSetValue({\n instance,\n watchdog\n });\n setTimeout(() => {\n if (props.onReady) {\n props.onReady(watchdog.editor);\n }\n });\n }\n totalRestartsRef.current++;\n return instance;\n };\n watchdog.on(\"error\", (_, { error, causesRestart }) => {\n const onError = props.onError || console.error;\n onError(error, { phase: \"runtime\", willEditorRestart: causesRestart });\n });\n try {\n if (supports.elementConfigAttachment) {\n watchdog.setCreator(watchdogEditorCreator);\n await watchdog.create(_getConfig());\n } else {\n watchdog.setCreator(async (_, config) => watchdogEditorCreator(config));\n await watchdog.create(data, _getConfig());\n }\n } catch (error) {\n const onError = props.onError || console.error;\n onError(error, { phase: \"initialization\", willEditorRestart: false });\n throw error;\n }\n return {\n watchdog,\n instance: watchdog.editor\n };\n };\n const _getStateDiff = (previousState, newState) => {\n const previousStateKeys = Object.keys(previousState);\n const newStateKeys = Object.keys(newState);\n return {\n addedKeys: newStateKeys.filter((key) => !previousStateKeys.includes(key)),\n removedKeys: previousStateKeys.filter((key) => !newStateKeys.includes(key))\n };\n };\n const _externalSetData = useCallback(\n (newData) => {\n semaphore.runAfterMount(() => {\n shouldUpdateEditor.current = true;\n setData(newData);\n });\n },\n [setData]\n );\n const _externalSetAttributes = useCallback(\n (newAttributes) => {\n semaphore.runAfterMount(() => {\n shouldUpdateEditor.current = true;\n setAttributes(newAttributes);\n });\n },\n [setAttributes]\n );\n useInstantEditorEffect(semaphore.current, ({ instance }) => {\n if (props.disabled) {\n instance.enableReadOnlyMode(REACT_INTEGRATION_READ_ONLY_LOCK_ID);\n } else {\n instance.disableReadOnlyMode(REACT_INTEGRATION_READ_ONLY_LOCK_ID);\n }\n }, [props.disabled]);\n useInstantEditorEffect(semaphore.current, ({ instance }) => {\n if (shouldUpdateEditor.current) {\n shouldUpdateEditor.current = false;\n const dataKeys = Object.keys(data);\n const attributesKeys = Object.keys(attributes);\n if (!dataKeys.every((key) => attributesKeys.includes(key))) {\n console.error(\"`data` and `attributes` objects must have the same keys (roots).\");\n throw new Error(\"`data` and `attributes` objects must have the same keys (roots).\");\n }\n const editorData = instance.getFullData();\n const editorAttributes = instance.getRootsAttributes();\n const {\n addedKeys: newRoots,\n removedKeys: removedRoots\n } = _getStateDiff(\n editorData,\n data || /* istanbul ignore next -- @preserve: It should never happen, data should be always filled. */\n {}\n );\n const modifiedRoots = dataKeys.filter(\n (rootName) => editorData[rootName] !== void 0 && JSON.stringify(editorData[rootName]) !== JSON.stringify(data[rootName])\n );\n const rootsWithChangedAttributes = attributesKeys.filter((rootName) => JSON.stringify(editorAttributes[rootName]) !== JSON.stringify(attributes[rootName]));\n const _handleNewRoots = (roots2) => {\n const supports = getInstalledCKBaseFeatures();\n for (const rootName of roots2) {\n const rootAttributes = (attributes == null ? void 0 : attributes[rootName]) || {};\n const rootData = data[rootName] || \"\";\n for (const key of Object.keys(rootAttributes)) {\n instance.registerRootAttribute(key);\n }\n let options = {\n isUndoable: true\n };\n if (supports.rootsConfigEntry) {\n options = {\n ...options,\n initialData: rootData,\n modelAttributes: rootAttributes\n };\n } else {\n options = {\n ...options,\n data: rootData,\n attributes: rootAttributes\n };\n }\n instance.addRoot(rootName, options);\n }\n };\n const _handleRemovedRoots = (roots2) => {\n roots2.forEach((rootName) => {\n instance.detachRoot(rootName, true);\n });\n };\n const _updateEditorData = (roots2) => {\n const dataToUpdate = roots2.reduce(\n (result, rootName) => ({ ...result, [rootName]: data[rootName] }),\n /* @__PURE__ */ Object.create(null)\n );\n instance.data.set(dataToUpdate, { suppressErrorInCollaboration: true });\n };\n const _updateEditorAttributes = (writer, roots2) => {\n for (const rootName of roots2) {\n for (const key of Object.keys(attributes[rootName])) {\n instance.registerRootAttribute(key);\n }\n const root = instance.model.document.getRoot(rootName);\n for (const key of Object.keys(instance.getRootAttributes(rootName))) {\n writer.removeAttribute(key, root);\n }\n writer.setAttributes(attributes[rootName], root);\n }\n };\n setTimeout(() => {\n instance.model.change((writer) => {\n _handleNewRoots(newRoots);\n _handleRemovedRoots(removedRoots);\n if (modifiedRoots.length) {\n _updateEditorData(modifiedRoots);\n }\n if (rootsWithChangedAttributes.length) {\n _updateEditorAttributes(writer, rootsWithChangedAttributes);\n }\n });\n });\n }\n }, [data, attributes]);\n const toolbarElement = /* @__PURE__ */ React.createElement(\n EditorToolbarWrapper,\n {\n ref: semaphoreElementRef,\n editor: editorRefs.instance.current\n }\n );\n const editableElements = roots.map(\n (rootName) => /* @__PURE__ */ React.createElement(\n EditorEditable,\n {\n key: rootName,\n id: rootName,\n rootName,\n editor: editorRefs.instance.current\n }\n )\n );\n const removeRoot = async (rootName) => {\n const { instance } = await semaphore.waitFor();\n instance.model.change(() => {\n instance.detachRoot(rootName, true);\n });\n };\n const addRoot = async ({\n name,\n data: data2,\n attributes: attributes2 = {},\n editableOptions,\n ...rootOptions\n }) => {\n const { instance } = await semaphore.waitFor();\n const supports = getInstalledCKBaseFeatures();\n instance.model.change(() => {\n const mappedAttributes = {\n ...attributes2,\n ...!supports.rootsConfigEntry && editableOptions && {\n [ROOT_EDITABLE_OPTIONS_ATTRIBUTE]: editableOptions\n }\n };\n for (const key of Object.keys(mappedAttributes)) {\n instance.registerRootAttribute(key);\n }\n let options = {\n isUndoable: true,\n ...rootOptions\n };\n if (supports.rootsConfigEntry) {\n options = {\n ...options,\n ...editableOptions,\n initialData: data2 || \"\",\n modelAttributes: mappedAttributes\n };\n } else {\n options = {\n ...options,\n data: data2 || \"\",\n attributes: mappedAttributes\n };\n }\n instance.addRoot(name, options);\n });\n };\n return {\n editor: editorRefs.instance.current,\n editableElements,\n toolbarElement,\n data,\n setData: _externalSetData,\n attributes,\n setAttributes: _externalSetAttributes,\n removeRoot,\n addRoot\n };\n};\nconst useIsUnmountedRef = () => {\n const mountedRef = useRef(false);\n useEffect(() => {\n mountedRef.current = false;\n return () => {\n mountedRef.current = true;\n };\n }, []);\n return mountedRef;\n};\nconst useAsyncCallback = (callback) => {\n const [asyncState, setAsyncState] = useState({\n status: \"idle\"\n });\n const unmountedRef = useIsUnmountedRef();\n const prevExecutionUIDRef = useRef(null);\n const asyncExecutor = useRefSafeCallback(async (...args) => {\n if (unmountedRef.current || isSSR()) {\n return null;\n }\n const currentExecutionUUID = uid();\n prevExecutionUIDRef.current = currentExecutionUUID;\n try {\n if (asyncState.status !== \"loading\") {\n setAsyncState({\n status: \"loading\"\n });\n }\n const result = await callback(...args);\n if (!unmountedRef.current && prevExecutionUIDRef.current === currentExecutionUUID) {\n setAsyncState({\n status: \"success\",\n data: result\n });\n }\n return result;\n } catch (error) {\n console.error(error);\n if (!unmountedRef.current && prevExecutionUIDRef.current === currentExecutionUUID) {\n setAsyncState({\n status: \"error\",\n error\n });\n }\n }\n return null;\n });\n return [asyncExecutor, asyncState];\n};\nconst useAsyncValue = (callback, deps) => {\n const [asyncCallback, asyncState] = useAsyncCallback(callback);\n useInstantEffect(asyncCallback, deps);\n if (asyncState.status === \"idle\") {\n return {\n status: \"loading\"\n };\n }\n return asyncState;\n};\nfunction useCKEditorCloud(config) {\n const serializedConfigKey = JSON.stringify(config);\n const result = useAsyncValue(\n async () => loadCKEditorCloud(config),\n [serializedConfigKey]\n );\n if (result.status === \"success\") {\n return {\n ...result.data,\n status: \"success\"\n };\n }\n return result;\n}\nconst withCKEditorCloud = (config) => (WrappedComponent) => {\n const ComponentWithCKEditorCloud = (props) => {\n var _a, _b;\n const ckeditorCloudResult = useCKEditorCloud(config.cloud);\n switch (ckeditorCloudResult.status) {\n // An error occurred while fetching the cloud information.\n case \"error\":\n if (!config.renderError) {\n return \"Unable to load CKEditor Cloud data!\";\n }\n return config.renderError(ckeditorCloudResult.error);\n // The cloud information has been fetched successfully.\n case \"success\":\n return /* @__PURE__ */ React.createElement(WrappedComponent, { ...props, cloud: ckeditorCloudResult });\n // The cloud information is being fetched.\n default:\n return (_b = (_a = config.renderLoader) == null ? void 0 : _a.call(config)) != null ? _b : null;\n }\n };\n ComponentWithCKEditorCloud.displayName = \"ComponentWithCKEditorCloud\";\n return ComponentWithCKEditorCloud;\n};\nexport {\n CKEditor,\n CKEditorContext,\n ContextWatchdogContext,\n loadCKEditorCloud2 as loadCKEditorCloud,\n useCKEditorCloud,\n useCKEditorWatchdogContext,\n useMultiRootEditor,\n withCKEditorCloud\n};\n//# sourceMappingURL=index.js.map\n"],"names":["__defProp","__defNormalProp","obj","key","value","__publicField","_LifeCycleElementSemaphore","element","lifecycle","once","_releaseLock","_state","_element","_lifecycle","error","callback","_value","_afterMountCallbacks","_semaphores","prevElementSemaphore","releaseLock","createDefer","newElementSemaphore","mountResult","LifeCycleElementSemaphore","ReactContextMetadataKey","withCKEditorReactContextMetadata","metadata","config","ContextWatchdogContext","React","isContextWatchdogValue","isContextWatchdogValueWithStatus","status","isContextWatchdogInitializing","isContextWatchdogReadyToUse","ReactIntegrationUsageDataPlugin","createIntegrationUsageDataPlugin","appendAllIntegrationPluginsToConfig","editorConfig","isCKEditorFreeLicense","appendExtraPluginsToEditorConfig","EditorWatchdogAdapter","contextWatchdog","uid","creator","sourceElementOrDataOrConfig","watchdogItemConfiguration","_","_2","itemId","normalizeClassList","classes","normalizeStylesMap","styles","mapObjectKeys","kebabToCamelCase","normalizeEditorElementDefinition","definition","EditorElement","memo","forwardRef","ref","Tag","attributes","REACT_INTEGRATION_READ_ONLY_LOCK_ID$1","CKEditor","props","assertMinimumSupportedVersion","editorSemaphore","_semaphoreValue","nextProps","instance","shouldUpdateEditorData","_a","_b","onReady","onAfterDestroy","Editor","getEditorElementDefinition","supports","getInstalledCKBaseFeatures","disableWatchdog","watchdogConfig","mergedConfig","watchdog","causesRestart","nonFirstCreate","editor","modelDocument","viewDocument","event","resetData","contextItemMetadata","mappedConfig","assignElementToEditorConfig","assignInitialDataToEditorConfig","initializeResult","resolve","reject","e","_c","_d","_e","prevProps","compareInstalledCKBaseVersion","mergeRefs","refs","EditorToolbarWrapper","toolbarRef","useRef","useEffect","toolbarContainer","ROOT_EDITABLE_OPTIONS_ATTRIBUTE","EditorEditable","id","rootName","innerRef","root","useMemo","rootEditableOptions","editable","normalizedDefinition"],"mappings":";;AAAA,IAAIA,IAAY,OAAO,gBACnBC,IAAkB,CAACC,GAAKC,GAAKC,MAAUD,KAAOD,IAAMF,EAAUE,GAAKC,GAAK,EAAE,YAAY,IAAM,cAAc,IAAM,UAAU,IAAM,OAAAC,EAAK,CAAE,IAAIF,EAAIC,CAAG,IAAIC,GACtJC,IAAgB,CAACH,GAAKC,GAAKC,MAAUH,EAAgBC,GAAK,OAAOC,KAAQ,WAAWA,IAAM,KAAKA,GAAKC,CAAK;AAI7G,MAAME,IAA6B,MAAMA,EAA2B;AAAA,EAClE,YAAYC,GAASC,GAAW;AAO9B,IAAAH,EAAc,MAAM,YAAY,GAOhCA,EAAc,MAAM,UAAU,GAY9BA,EAAc,MAAM,gBAAgB,IAAI,GAOxCA,EAAc,MAAM,UAAU,IAAI,GAOlCA,EAAc,MAAM,wBAAwB,E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