/*! * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser * Author: Chupurnov (https://xdsoft.net/jodit/) * Version: v4.12.2 * Url: https://xdsoft.net/jodit/ * License(s): MIT */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("{}")); else if(typeof define === 'function' && define.amd) define(["{}"], factory); else { var a = typeof exports === 'object' ? factory(require("{}")) : factory(root["{}"]); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(self, function(__WEBPACK_EXTERNAL_MODULE__41324__) { return /******/ (function() { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 5266: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Config: function() { return /* binding */ Config; } /* harmony export */ }); /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045); /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81937); /*! * Jodit Editor (https://xdsoft.net/jodit/) * Released under MIT see LICENSE.txt in the project root for license information. * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net */ /** * Editor options. These can be configured upon the creation of the editor. * ```javascript * const editor = Jodit.make('#editor', { * toolbar: true, * buttons: ['bold', 'italic', 'underline'] * // other options * // ... * }); * ``` * @packageDocumentation * @module config */ let ConfigPrototype = {}; /** * Default Editor's Configuration. * * This class holds all default option values for the Jodit editor. * It uses a **private constructor** and a **lazy singleton** pattern — the single instance * is created on the first access to {@link Config.defaultOptions} (also available as `Jodit.defaultOptions`). * * ## How options are resolved * * When you create an editor with `Jodit.make('#editor', userOptions)`, the library * calls {@link ConfigProto}(userOptions, Config.defaultOptions). `ConfigProto` does * **not** deep-clone the defaults. Instead it creates a new object whose JavaScript * prototype is `Config.defaultOptions`: * * ``` * userOptions ──[[Prototype]]──► Config.defaultOptions * ``` * * Any key present in `userOptions` shadows the default; * any key **not** present falls through to `Config.defaultOptions` via the prototype chain. * Nested plain objects are recursively prototyped in the same way, so partial overrides * of nested options work automatically: * * ```js * // Only override `dialogWidth`; all other `image.*` defaults are still available * Jodit.make('#editor', { * image: { dialogWidth: 500 } * }); * ``` * * ## How plugins extend the config * * Each plugin adds its own defaults by assigning to `Config.prototype` and augmenting * the TypeScript type with `declare module`: * * ```ts * // 1. Type augmentation (compile-time) * declare module 'jodit/config' { * interface Config { * toolbarSticky: boolean; * } * } * * // 2. Runtime default * Config.prototype.toolbarSticky = true; * ``` * * Because the constructor runs `Object.assign(this, ConfigPrototype)` (where * `ConfigPrototype` is captured as `Config.prototype` after the class definition), * all prototype-level values — including those added by plugins — are materialized * as own properties on the singleton. This means `Config.defaultOptions` always * contains every registered option as an own, enumerable property. * * ## Changing global defaults * * You can modify `Jodit.defaultOptions` **before** creating editors to change * defaults globally: * * ```js * Jodit.defaultOptions.language = 'de'; * Jodit.defaultOptions.theme = 'dark'; * * // Both editors inherit the new defaults * Jodit.make('#editor1'); * Jodit.make('#editor2'); * ``` * * ## `Jodit.atom` — preventing deep merge * * By default, `ConfigProto` deep-merges nested plain objects and arrays. * Wrap a value with `Jodit.atom(value)` to make it **atomic** — it will completely * replace the default instead of being merged: * * ```js * Jodit.make('#editor', { * controls: { * fontsize: { * // Replace the entire list rather than merging with the default one * list: Jodit.atom([8, 9, 10]) * } * } * }); * ``` * * `Jodit.atom` calls {@link markAsAtomic}, which sets a non-enumerable * `isAtom` flag on the object. `ConfigProto` checks this flag and skips * recursive merging when it is present. Note: top-level arrays (depth 0) * are always treated as atomic — they replace rather than merge. * * @see {@link ConfigProto} for the full merge algorithm * @see {@link markAsAtomic} / {@link isAtom} for the atom marker implementation */ class Config { static get defaultOptions() { if (!Config.__defaultOptions) { Config.__defaultOptions = new Config(); } return Config.__defaultOptions; } constructor(){ /** * When enabled, the editor caches the results of expensive computations (e.g. toolbar rebuilds) * to improve performance. Disable for debugging or when options change frequently at runtime. */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "cache", true); /** * Timeout of all asynchronous methods */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "defaultTimeout", 100); /** * Prefix used for CSS class names and local-storage keys to avoid collisions * when multiple editor instances or applications share the same page. */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "namespace", ''); /** * Editor loads completely without plugins. Useful when debugging your own plugin. */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "safeMode", false); /** * Editor's width * * ```javascript * Jodit.make('.editor', { * width: '100%', * }) * ``` * ```javascript * Jodit.make('.editor', { * width: 600, // equivalent for '600px' * }) * ``` * ```javascript * Jodit.make('.editor', { * width: 'auto', // autosize * }) * ``` */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "width", 'auto'); /** * Editor's height * * ```javascript * Jodit.make('.editor', { * height: '100%', * }) * ``` * ```javascript * Jodit.make('.editor', { * height: 600, // equivalent for '600px' * }) * ``` * ```javascript * Jodit.make('.editor', { * height: 'auto', // default - autosize * }) * ``` */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "height", 'auto'); /** * List of plugins that will be initialized in safe mode. * * ```js * Jodit.make('#editor', { * safeMode: true, * safePluginsList: ['about'], * extraPlugins: ['yourPluginDev'] * }); * ``` */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "safePluginsList", [ 'about', 'enter', 'backspace', 'size', 'bold', 'hotkeys' ]); (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "commandToHotkeys", void 0); /** * Reserved for the paid version of the editor */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "license", ''); /** * The name of the preset that will be used to initialize the editor. * The list of available presets can be found here Jodit.defaultOptions.presets * ```javascript * Jodit.make('.editor', { * preset: 'inline' * }); * ``` */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "preset", 'custom'); /** * Dictionary of named configuration presets. Each key is a preset name and the value * is a partial options object that will be merged into the editor config when * {@link Config.preset} matches the key. * * ```javascript * // Use a built-in preset * Jodit.make('#editor', { * preset: 'inline' * }); * ``` * * ```javascript * // Define and use a custom preset * Jodit.defaultOptions.presets.myCompact = { * toolbarButtonSize: 'small', * showCharsCounter: false, * showWordsCounter: false, * showXPathInStatusbar: false * }; * * Jodit.make('#editor', { * preset: 'myCompact' * }); * ``` */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "presets", { inline: { inline: true, toolbar: false, toolbarInline: true, toolbarInlineForSelection: true, showXPathInStatusbar: false, showCharsCounter: false, showWordsCounter: false, showPlaceholder: false } }); /** * The Document object the editor operates within. Defaults to the current `document`. * Override when the editor is created inside an iframe or a different browsing context. */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "ownerDocument", jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.globalDocument); /** * Allows you to specify the window in which the editor will be created. Default - window * This is necessary if you are creating the editor inside an iframe but the code is running in the parent window */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "ownerWindow", jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.globalWindow); /** * Shadow root if Jodit was created in it * * ```html *
* ``` * * ```js * const app = document.getElementById('editor'); * app.attachShadow({ mode: 'open' }); * const root = app.shadowRoot; * * root.innerHTML = ` * *

Jodit example in Shadow DOM

*
* `; * * const editor = Jodit.make(root.getElementById('edit'), { * globalFullSize: false, * shadowRoot: root * }); * editor.value = '

start

'; * ``` */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "shadowRoot", null); /** * Base CSS `z-index` for the editor UI (toolbar, popups, dialogs). * Set to a higher value when other page elements overlap the editor. * `0` means no explicit z-index is applied. */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "zIndex", 0); /** * Change the read-only state of the editor */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "readonly", false); /** * Change the disabled state of the editor */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "disabled", false); /** * In readOnly mode, some buttons can still be useful, for example, the button to view source code or print */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "activeButtonsInReadOnly", [ 'source', 'fullsize', 'print', 'about', 'dots', 'selectall' ]); /** * When the editor is in read-only mode, some commands can still be executed: * ```javascript * const editor = Jodit.make('.editor', { * allowCommandsInReadOnly: ['selectall', 'preview', 'print'] * readonly: true * }); * editor.execCommand('selectall');// will be selected all content * editor.execCommand('delete');// but content will not be deleted * ``` */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "allowCommandsInReadOnly", [ 'selectall', 'preview', 'print' ]); /** * Size of icons in the toolbar (can be "small", "middle", "large") * * ```javascript * const editor = Jodit.make(".dark_editor", { * toolbarButtonSize: "small" * }); * ``` */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "toolbarButtonSize", 'middle'); /** * Allow navigation in the toolbar of the editor by Tab key */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "allowTabNavigation", false); /** * When enabled, the editor renders without its own container chrome (toolbar, borders, statusbar). * The editable area becomes the element itself. Typically combined with * `toolbarInline: true` so a floating toolbar appears on selection. */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "inline", false); /** * Theme (can be "dark") * * ```javascript * const editor = Jodit.make(".dark_editor", { * theme: "dark" * }); * ``` */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "theme", 'default'); /** * if set true, then the current mode is saved in a cookie, and is restored after a reload of the page */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "saveModeInStorage", false); /** * Class name that can be appended to the editable area * * @see {@link Config.iframeCSSLinks} * @see {@link Config.iframeStyle} * * ```javascript * Jodit.make('#editor', { * editorClassName: 'some_my_class' * }); * ``` * ```html * * ``` */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "editorClassName", false); /** * Class name that can be appended to the main editor container * * ```javascript * const jodit = Jodit.make('#editor', { * className: 'some_my_class' * }); * * console.log(jodit.container.classList.contains('some_my_class')); // true * ``` * ```html * * ``` */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "className", false); /** * The internal styles of the editable area. They are intended to change * not the appearance of the editor, but to change the appearance of the content. * * ```javascript * Jodit.make('#editor', { * style: { * font: '12px Arial', * color: '#0c0c0c' * } * }); * ``` */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "style", false); /** * Inline CSS styles applied to the outer editor container element. * Use this to style the editor wrapper (borders, background, etc.) without affecting content. * * ```javascript * Jodit.make('#editor', { * containerStyle: { * border: '1px solid #ccc', * background: '#f9f9f9' * } * }); * ``` */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "containerStyle", false); /** * Dictionary of variable values in css, a complete list can be found here * https://github.com/xdan/jodit/blob/main/src/styles/variables.less#L25 * * ```js * const editor = Jodit.make('#editor', { * styleValues: { * 'color-text': 'red', * colorBorder: 'black', * 'color-panel': 'blue' * } * }); * ``` */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "styleValues", {}); /** * When enabled, the editor dispatches a native `change` event on the original * `