UNPKG

jodit-pro

Version:

PRO Version of Jodit Editor

180 lines (158 loc) 8.16 kB
/*! * jodit-pro - PRO Version of Jodit Editor * Author: Chupurnov Valerii <chupurnov@gmail.com> * Version: v4.9.27 * Url: https://xdsoft.net/jodit/pro/ * License(s): SEE LICENSE IN LICENSE.md */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else { var a = factory(); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(self, function() { return (self["webpackChunkjodit_pro"] = self["webpackChunkjodit_pro"] || []).push([[782],{ /***/ 27222: /***/ (function(module) { module.exports = "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"> <path d=\"M17,24a4,4,0,0,0,4-4V4a4,4,0,0,0-4-4H7A4,4,0,0,0,3,4V20a4,4,0,0,0,4,4ZM5,20V4A2,2,0,0,1,7,2H17a2,2,0,0,1,2,2V20a2,2,0,0,1-2,2H7A2,2,0,0,1,5,20Z\"/> <path d=\"M8,19h8a1,1,0,0,0,0-2H8a1,1,0,0,0,0,2Z\"/> <path d=\"M11,5h2a1,1,0,0,0,0-2H11a1,1,0,0,0,0,2Z\"/> </svg>" /***/ }), /***/ 29606: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ dataBindCurrentKey: function() { return /* binding */ dataBindCurrentKey; }, /* harmony export */ dataBindStoredKey: function() { return /* binding */ dataBindStoredKey; } /* harmony export */ }); /* harmony import */ var _icon_svg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27222); /* harmony import */ var _icon_svg__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_icon_svg__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var jodit_esm_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6441); /* harmony import */ var jodit_esm_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29807); /* harmony import */ var jodit_esm_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(86583); /*! * Jodit Editor PRO (https://xdsoft.net/jodit/) * See LICENSE.md in the project root for license information. * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/ */ jodit_esm_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.mobileView = { mode: 'default' }; const dataBindStoredKey = 'buttonmobileSView'; const dataBindCurrentKey = 'buttonmobileCView'; jodit_esm_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.mobileView = { tooltip: 'Mobile View', icon: (_icon_svg__WEBPACK_IMPORTED_MODULE_0___default()), command: 'mobileView', isActive: (editor)=>(0,jodit_esm_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(editor, dataBindCurrentKey) && (0,jodit_esm_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(editor, dataBindCurrentKey) !== 'default', isChildActive: (editor, button)=>{ let value = button.control?.args?.[0]; if ((0,jodit_esm_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(value)) { value = Number(value); } const currentValue = (0,jodit_esm_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(editor, dataBindCurrentKey) || 'default'; return currentValue === value; }, exec: (editor)=>{ if ((0,jodit_esm_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(editor, dataBindStoredKey)) { editor.execCommand('mobileView', false, (0,jodit_esm_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(editor, dataBindStoredKey)); return; } return false; }, childExec: (editor, node, { button })=>{ const value = button.control?.args?.[0]; editor.execCommand('mobileView', false, (0,jodit_esm_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(value) ? Number(value) : value); }, list: { default: 'Default', 375: 'iPhone SE', 414: 'iPhone XR', 390: 'iPhone 12 Pro', 393: 'Pixel 5', 820: 'iPad Air' } }; /***/ }), /***/ 74398: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82749); /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29606); /* harmony import */ var jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65478); /* harmony import */ var jodit_esm_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(43555); /* harmony import */ var jodit_esm_core_plugin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50911); /* harmony import */ var jodit_pro_jodit_pro__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2692); /*! * Jodit Editor PRO (https://xdsoft.net/jodit/) * See LICENSE.md in the project root for license information. * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/ */ class MobileView extends jodit_esm_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugin { className() { return 'MobileView'; } afterInit(jodit) { jodit.registerCommand('mobileView', { exec: (_, _2, size)=>{ if (this.__currentMode === size) { size = 'default'; } this.__currentMode = size; (0,jodit_esm_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.dataBind)(jodit, _config__WEBPACK_IMPORTED_MODULE_2__.dataBindCurrentKey, size); if (this.__currentMode !== 'default') { (0,jodit_esm_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.dataBind)(jodit, _config__WEBPACK_IMPORTED_MODULE_2__.dataBindStoredKey, size); } if (size === 'default') { (0,jodit_esm_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.css)(this.jodit.currentPlace.slots.center, { width: null, margin: null }); } else { (0,jodit_esm_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.css)(this.j.currentPlace.slots.center, { width: size, margin: '0 auto' }); } } }); jodit.events.on('beforeSetMode', ()=>{}); } __beforeSetMode() { if (this.__currentMode !== 'default') { this.j.execCommand('mobileView', false, 'default'); } } beforeDestruct(jodit) {} constructor(...args){ super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "buttons", [ { name: 'mobileView', group: 'state' } ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__currentMode", 'default'); } } (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(MobileView, "requires", [ 'license' ]); (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([ (0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':beforeSetMode.mobileView') ], MobileView.prototype, "__beforeSetMode", null); MobileView = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([ jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__.component ], MobileView); jodit_pro_jodit_pro__WEBPACK_IMPORTED_MODULE_6__.JoditPro.plugins.add('mobileView', MobileView); /***/ }) }, /******/ function(__webpack_require__) { // webpackRuntimeModules /******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); } /******/ var __webpack_exports__ = (__webpack_exec__(74398)); /******/ return __webpack_exports__; /******/ } ]); });