@tinymce/tinymce-vue 6.3.0 → 6.3.1-feature.20250919051105480.shabd14c0f
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.
|
@@ -29,6 +29,44 @@ var Editor = (function (vue) {
|
|
|
29
29
|
return __assign.apply(this, arguments);
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
33
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
34
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
35
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
36
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
37
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
38
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function __generator(thisArg, body) {
|
|
43
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
44
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
45
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
46
|
+
function step(op) {
|
|
47
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
48
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
49
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
50
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
51
|
+
switch (op[0]) {
|
|
52
|
+
case 0: case 1: t = op; break;
|
|
53
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
54
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
55
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
56
|
+
default:
|
|
57
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
58
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
59
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
60
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
61
|
+
if (t[2]) _.ops.pop();
|
|
62
|
+
_.trys.pop(); continue;
|
|
63
|
+
}
|
|
64
|
+
op = body.call(thisArg, _);
|
|
65
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
66
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
32
70
|
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
33
71
|
var e = new Error(message);
|
|
34
72
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
@@ -340,16 +378,24 @@ var Editor = (function (vue) {
|
|
|
340
378
|
}
|
|
341
379
|
}
|
|
342
380
|
});
|
|
343
|
-
vue.watch(tagName, function (_) {
|
|
381
|
+
vue.watch(tagName, function (_) { return __awaiter(void 0, void 0, void 0, function () {
|
|
344
382
|
var _a;
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
383
|
+
return __generator(this, function (_b) {
|
|
384
|
+
switch (_b.label) {
|
|
385
|
+
case 0:
|
|
386
|
+
if (!vueEditor) return [3 /*break*/, 2];
|
|
387
|
+
if (!modelBind) {
|
|
388
|
+
cache = vueEditor.getContent();
|
|
389
|
+
}
|
|
390
|
+
(_a = getTinymce()) === null || _a === void 0 ? void 0 : _a.remove(vueEditor);
|
|
391
|
+
return [4 /*yield*/, vue.nextTick(function () { return initWrapper(); })];
|
|
392
|
+
case 1:
|
|
393
|
+
_b.sent();
|
|
394
|
+
_b.label = 2;
|
|
395
|
+
case 2: return [2 /*return*/];
|
|
348
396
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
}
|
|
352
|
-
});
|
|
397
|
+
});
|
|
398
|
+
}); });
|
|
353
399
|
vue.onMounted(function () {
|
|
354
400
|
if (getTinymce() !== null) {
|
|
355
401
|
initWrapper();
|
|
@@ -384,15 +430,23 @@ var Editor = (function (vue) {
|
|
|
384
430
|
}
|
|
385
431
|
});
|
|
386
432
|
}
|
|
387
|
-
var rerender = function (init) {
|
|
433
|
+
var rerender = function (init) { return __awaiter(void 0, void 0, void 0, function () {
|
|
388
434
|
var _a;
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
435
|
+
return __generator(this, function (_b) {
|
|
436
|
+
switch (_b.label) {
|
|
437
|
+
case 0:
|
|
438
|
+
if (!vueEditor) return [3 /*break*/, 2];
|
|
439
|
+
cache = vueEditor.getContent();
|
|
440
|
+
(_a = getTinymce()) === null || _a === void 0 ? void 0 : _a.remove(vueEditor);
|
|
441
|
+
conf = __assign(__assign(__assign({}, conf), init), defaultInitValues);
|
|
442
|
+
return [4 /*yield*/, vue.nextTick(function () { return initWrapper(); })];
|
|
443
|
+
case 1:
|
|
444
|
+
_b.sent();
|
|
445
|
+
_b.label = 2;
|
|
446
|
+
case 2: return [2 /*return*/];
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
}); };
|
|
396
450
|
ctx.expose({
|
|
397
451
|
rerender: rerender,
|
|
398
452
|
getEditor: function () { return vueEditor; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var Editor=function(
|
|
1
|
+
var Editor=function(m){"use strict";var g=function(){return(g=Object.assign||function(n){for(var e,t=1,o=arguments.length;t<o;t++)for(var r in e=arguments[t])Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}).apply(this,arguments)};function h(n,a,u,l){return new(u=u||Promise)(function(t,e){function o(n){try{i(l.next(n))}catch(n){e(n)}}function r(n){try{i(l.throw(n))}catch(n){e(n)}}function i(n){var e;n.done?t(n.value):((e=n.value)instanceof u?e:new u(function(n){n(e)})).then(o,r)}i((l=l.apply(n,a||[])).next())})}function b(o,r){var i,a,u,l={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c={next:n(0),throw:n(1),return:n(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function n(t){return function(n){var e=[t,n];if(i)throw new TypeError("Generator is already executing.");for(;l=c&&e[c=0]?0:l;)try{if(i=1,a&&(u=2&e[0]?a.return:e[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,e[1])).done)return u;switch(a=0,(e=u?[2&e[0],u.value]:e)[0]){case 0:case 1:u=e;break;case 4:return l.label++,{value:e[1],done:!1};case 5:l.label++,a=e[1],e=[0];continue;case 7:e=l.ops.pop(),l.trys.pop();continue;default:if(!(u=0<(u=l.trys).length&&u[u.length-1])&&(6===e[0]||2===e[0])){l=0;continue}if(3===e[0]&&(!u||e[1]>u[0]&&e[1]<u[3]))l.label=e[1];else if(6===e[0]&&l.label<u[1])l.label=u[1],u=e;else{if(!(u&&l.label<u[2])){u[2]&&l.ops.pop(),l.trys.pop();continue}l.label=u[2],l.ops.push(e)}}e=r.call(o,l)}catch(n){e=[6,n],a=0}finally{i=u=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}function n(n){return-1!==t.map(function(n){return n.toLowerCase()}).indexOf(n.toLowerCase())}function C(n){var e;return"function"==typeof(null==(e=n.options)?void 0:e.set)&&n.options.isRegistered("disabled")}function e(){return{listeners:[],scriptId:x("tiny-script"),scriptLoaded:!1}}function S(){var n="undefined"!=typeof window?window:global;return n&&n.tinymce?n.tinymce:null}function w(n,e){var t;"function"==typeof(null==(t=n.mode)?void 0:t.set)?n.mode.set(e):n.setMode(e)}var a,t=["onActivate","onAddUndo","onBeforeAddUndo","onBeforeExecCommand","onBeforeGetContent","onBeforeRenderUI","onBeforeSetContent","onBeforePaste","onBlur","onChange","onClearUndos","onClick","onContextMenu","onCommentChange","onCompositionEnd","onCompositionStart","onCompositionUpdate","onCopy","onCut","onDblclick","onDeactivate","onDirty","onDrag","onDragDrop","onDragEnd","onDragGesture","onDragOver","onDrop","onExecCommand","onFocus","onFocusIn","onFocusOut","onGetContent","onHide","onInit","onInput","onKeyDown","onKeyPress","onKeyUp","onLoadContent","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onNodeChange","onObjectResizeStart","onObjectResized","onObjectSelected","onPaste","onPostProcess","onPostRender","onPreProcess","onProgressState","onRedo","onRemove","onReset","onSaveContent","onSelectionChange","onSetAttrib","onSetContent","onShow","onSubmit","onUndo","onVisualAid"],D=function(t,o,r){Object.keys(o).filter(n).forEach(function(n){var e=o[n];"function"==typeof e&&("onInit"===n?e(t,r):r.on(n.substring(2),function(n){return e(n,r)}))})},E=function(t,n,o,e){var r=t.modelEvents||null,r=Array.isArray(r)?r.join(" "):r;m.watch(e,function(n,e){o&&"string"==typeof n&&n!==e&&n!==o.getContent({format:t.outputFormat})&&o.setContent(n)}),o.on(r||"change input undo redo",function(){n.emit("update:modelValue",o.getContent({format:t.outputFormat}))})},o=0,x=function(n){var e=Date.now();return n+"_"+Math.floor(1e9*Math.random())+ ++o+String(e)},A=function(n){return void 0===n||""===n?[]:Array.isArray(n)?n:n.split(" ")},M=(a=e(),{load:function(n,e,t){function o(){i.removeEventListener("load",o),r()}var r,i;a.scriptLoaded?t():(a.listeners.push(t),n.getElementById(a.scriptId)||(t=a.scriptId,e=e,r=function(){a.listeners.forEach(function(n){return n()}),a.scriptLoaded=!0},(i=(n=n).createElement("script")).referrerPolicy="origin",i.type="application/javascript",i.id=t,i.src=e,i.addEventListener("load",o),n.head&&n.head.appendChild(i)))},reinitialize:function(){a=e()}}),r={apiKey:String,licenseKey:String,cloudChannel:String,id:String,init:Object,initialValue:String,inline:Boolean,modelEvents:[String,Array],plugins:[String,Array],tagName:String,toolbar:[String,Array],modelValue:String,disabled:Boolean,readonly:Boolean,tinymceScriptSrc:String,outputFormat:{type:String,validator:function(n){return"html"===n||"text"===n}}},O={selector:void 0,target:void 0};return m.defineComponent({props:r,setup:function(u,l){function o(){n=p;var n,e,a=f?function(){return null!=c&&c.value?c.value:""}:function(){return n?v:y},t=g(g({},r),{disabled:u.disabled,readonly:u.readonly,target:i.value,plugins:(t=r.plugins,e=u.plugins,A(t).concat(A(e))),toolbar:u.toolbar||r.toolbar,inline:d,license_key:u.licenseKey,setup:function(i){C(s=i)||!0!==u.disabled||w(s,"readonly"),i.on("init",function(n){return n=n,e=u,t=l,r=c,(o=i).setContent(a()),t.attrs["onUpdate:modelValue"]&&E(e,t,o,r),void D(n,t.attrs,o);var e,t,o,r}),"function"==typeof r.setup&&r.setup(i)}});null!==(e=i.value)&&"textarea"===e.tagName.toLowerCase()&&(i.value.style.visibility=""),S().init(t),p=!1}var r=u.init?g(g({},u.init),O):g({},O),n=m.toRefs(u),e=n.disabled,t=n.readonly,c=n.modelValue,n=n.tagName,i=m.ref(null),s=null,a=u.id||x("tiny-vue"),d=u.init&&u.init.inline||u.inline,f=!!l.attrs["onUpdate:modelValue"],p=!0,v=u.initialValue||"",y="";m.watch(t,function(n){null!==s&&w(s,n?"readonly":"design")}),m.watch(e,function(n){null!==s&&(C(s)?s.options.set("disabled",n):w(s,n?"readonly":"design"))}),m.watch(n,function(n){return h(void 0,void 0,void 0,function(){var e;return b(this,function(n){switch(n.label){case 0:return s?(f||(y=s.getContent()),null!=(e=S())&&e.remove(s),[4,m.nextTick(o)]):[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})}),m.onMounted(function(){var n,e;null!==S()?o():i.value&&i.value.ownerDocument&&(n=u.cloudChannel||"8",e=u.apiKey||"no-api-key",e=null==u.tinymceScriptSrc?"https://cdn.tiny.cloud/1/".concat(e,"/tinymce/").concat(n,"/tinymce.min.js"):u.tinymceScriptSrc,M.load(i.value.ownerDocument,e,o))}),m.onBeforeUnmount(function(){null!==S()&&S().remove(s)}),d||(m.onActivated(function(){p||o()}),m.onDeactivated(function(){var n;s&&(f||(y=s.getContent()),null!=(n=S()))&&n.remove(s)}));return l.expose({rerender:function(t){return h(void 0,void 0,void 0,function(){var e;return b(this,function(n){switch(n.label){case 0:return s?(y=s.getContent(),null!=(e=S())&&e.remove(s),r=g(g(g({},r),t),O),[4,m.nextTick(o)]):[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},getEditor:function(){return s}}),function(){return d?(n=m.h,e=i,t=u.tagName,n(t||"div",{id:a,ref:e})):(0,m.h)("textarea",{id:a,visibility:"hidden",ref:i});var n,e,t}}})}(Vue);
|
|
@@ -17,6 +17,42 @@ var __assign = (this && this.__assign) || function () {
|
|
|
17
17
|
};
|
|
18
18
|
return __assign.apply(this, arguments);
|
|
19
19
|
};
|
|
20
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
21
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
22
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
23
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
24
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
25
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
26
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
30
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
31
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
32
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
33
|
+
function step(op) {
|
|
34
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
35
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
36
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
37
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
38
|
+
switch (op[0]) {
|
|
39
|
+
case 0: case 1: t = op; break;
|
|
40
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
41
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
42
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
43
|
+
default:
|
|
44
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
45
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
46
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
47
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
48
|
+
if (t[2]) _.ops.pop();
|
|
49
|
+
_.trys.pop(); continue;
|
|
50
|
+
}
|
|
51
|
+
op = body.call(thisArg, _);
|
|
52
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
53
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
54
|
+
}
|
|
55
|
+
};
|
|
20
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
57
|
exports.Editor = void 0;
|
|
22
58
|
var ScriptLoader_1 = require("../ScriptLoader");
|
|
@@ -97,16 +133,24 @@ exports.Editor = (0, vue_1.defineComponent)({
|
|
|
97
133
|
}
|
|
98
134
|
}
|
|
99
135
|
});
|
|
100
|
-
(0, vue_1.watch)(tagName, function (_) {
|
|
136
|
+
(0, vue_1.watch)(tagName, function (_) { return __awaiter(void 0, void 0, void 0, function () {
|
|
101
137
|
var _a;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
138
|
+
return __generator(this, function (_b) {
|
|
139
|
+
switch (_b.label) {
|
|
140
|
+
case 0:
|
|
141
|
+
if (!vueEditor) return [3 /*break*/, 2];
|
|
142
|
+
if (!modelBind) {
|
|
143
|
+
cache = vueEditor.getContent();
|
|
144
|
+
}
|
|
145
|
+
(_a = (0, TinyMCE_1.getTinymce)()) === null || _a === void 0 ? void 0 : _a.remove(vueEditor);
|
|
146
|
+
return [4 /*yield*/, (0, vue_1.nextTick)(function () { return initWrapper(); })];
|
|
147
|
+
case 1:
|
|
148
|
+
_b.sent();
|
|
149
|
+
_b.label = 2;
|
|
150
|
+
case 2: return [2 /*return*/];
|
|
105
151
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
});
|
|
152
|
+
});
|
|
153
|
+
}); });
|
|
110
154
|
(0, vue_1.onMounted)(function () {
|
|
111
155
|
if ((0, TinyMCE_1.getTinymce)() !== null) {
|
|
112
156
|
initWrapper();
|
|
@@ -141,15 +185,23 @@ exports.Editor = (0, vue_1.defineComponent)({
|
|
|
141
185
|
}
|
|
142
186
|
});
|
|
143
187
|
}
|
|
144
|
-
var rerender = function (init) {
|
|
188
|
+
var rerender = function (init) { return __awaiter(void 0, void 0, void 0, function () {
|
|
145
189
|
var _a;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
190
|
+
return __generator(this, function (_b) {
|
|
191
|
+
switch (_b.label) {
|
|
192
|
+
case 0:
|
|
193
|
+
if (!vueEditor) return [3 /*break*/, 2];
|
|
194
|
+
cache = vueEditor.getContent();
|
|
195
|
+
(_a = (0, TinyMCE_1.getTinymce)()) === null || _a === void 0 ? void 0 : _a.remove(vueEditor);
|
|
196
|
+
conf = __assign(__assign(__assign({}, conf), init), defaultInitValues);
|
|
197
|
+
return [4 /*yield*/, (0, vue_1.nextTick)(function () { return initWrapper(); })];
|
|
198
|
+
case 1:
|
|
199
|
+
_b.sent();
|
|
200
|
+
_b.label = 2;
|
|
201
|
+
case 2: return [2 /*return*/];
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}); };
|
|
153
205
|
ctx.expose({
|
|
154
206
|
rerender: rerender,
|
|
155
207
|
getEditor: function () { return vueEditor; }
|
|
@@ -16,6 +16,42 @@ var __assign = (this && this.__assign) || function () {
|
|
|
16
16
|
};
|
|
17
17
|
return __assign.apply(this, arguments);
|
|
18
18
|
};
|
|
19
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
20
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
21
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
22
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
23
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
24
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
25
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
29
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
30
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
31
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
32
|
+
function step(op) {
|
|
33
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
34
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
35
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
36
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
37
|
+
switch (op[0]) {
|
|
38
|
+
case 0: case 1: t = op; break;
|
|
39
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
40
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
41
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
42
|
+
default:
|
|
43
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
44
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
45
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
46
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
47
|
+
if (t[2]) _.ops.pop();
|
|
48
|
+
_.trys.pop(); continue;
|
|
49
|
+
}
|
|
50
|
+
op = body.call(thisArg, _);
|
|
51
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
52
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
53
|
+
}
|
|
54
|
+
};
|
|
19
55
|
import { ScriptLoader } from '../ScriptLoader';
|
|
20
56
|
import { getTinymce } from '../TinyMCE';
|
|
21
57
|
import { isTextarea, mergePlugins, uuid, isNullOrUndefined, initEditor, isDisabledOptionSupported } from '../Utils';
|
|
@@ -94,16 +130,24 @@ export var Editor = defineComponent({
|
|
|
94
130
|
}
|
|
95
131
|
}
|
|
96
132
|
});
|
|
97
|
-
watch(tagName, function (_) {
|
|
133
|
+
watch(tagName, function (_) { return __awaiter(void 0, void 0, void 0, function () {
|
|
98
134
|
var _a;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
135
|
+
return __generator(this, function (_b) {
|
|
136
|
+
switch (_b.label) {
|
|
137
|
+
case 0:
|
|
138
|
+
if (!vueEditor) return [3 /*break*/, 2];
|
|
139
|
+
if (!modelBind) {
|
|
140
|
+
cache = vueEditor.getContent();
|
|
141
|
+
}
|
|
142
|
+
(_a = getTinymce()) === null || _a === void 0 ? void 0 : _a.remove(vueEditor);
|
|
143
|
+
return [4 /*yield*/, nextTick(function () { return initWrapper(); })];
|
|
144
|
+
case 1:
|
|
145
|
+
_b.sent();
|
|
146
|
+
_b.label = 2;
|
|
147
|
+
case 2: return [2 /*return*/];
|
|
102
148
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
});
|
|
149
|
+
});
|
|
150
|
+
}); });
|
|
107
151
|
onMounted(function () {
|
|
108
152
|
if (getTinymce() !== null) {
|
|
109
153
|
initWrapper();
|
|
@@ -138,15 +182,23 @@ export var Editor = defineComponent({
|
|
|
138
182
|
}
|
|
139
183
|
});
|
|
140
184
|
}
|
|
141
|
-
var rerender = function (init) {
|
|
185
|
+
var rerender = function (init) { return __awaiter(void 0, void 0, void 0, function () {
|
|
142
186
|
var _a;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
187
|
+
return __generator(this, function (_b) {
|
|
188
|
+
switch (_b.label) {
|
|
189
|
+
case 0:
|
|
190
|
+
if (!vueEditor) return [3 /*break*/, 2];
|
|
191
|
+
cache = vueEditor.getContent();
|
|
192
|
+
(_a = getTinymce()) === null || _a === void 0 ? void 0 : _a.remove(vueEditor);
|
|
193
|
+
conf = __assign(__assign(__assign({}, conf), init), defaultInitValues);
|
|
194
|
+
return [4 /*yield*/, nextTick(function () { return initWrapper(); })];
|
|
195
|
+
case 1:
|
|
196
|
+
_b.sent();
|
|
197
|
+
_b.label = 2;
|
|
198
|
+
case 2: return [2 /*return*/];
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}); };
|
|
150
202
|
ctx.expose({
|
|
151
203
|
rerender: rerender,
|
|
152
204
|
getEditor: function () { return vueEditor; }
|