@wangeditor-next/plugin-float-image 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/core/src/editor/helper.d.ts +8 -0
- package/dist/core/src/render/helper.d.ts +2 -1
- package/dist/core/src/utils/dom.d.ts +11 -10
- package/dist/css/style.css +1 -29
- package/dist/index.js +2 -1006
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -1002
- package/dist/index.mjs.map +1 -0
- package/dist/plugin-float-image/src/constants/icon-svg.d.ts +1 -1
- package/dist/plugin-float-image/src/index.d.ts +1 -1
- package/dist/plugin-float-image/src/module/custom-types.d.ts +3 -1
- package/dist/plugin-float-image/src/module/elem-to-html.d.ts +1 -1
- package/dist/plugin-float-image/src/module/index.d.ts +1 -1
- package/dist/plugin-float-image/src/module/local.d.ts +1 -1
- package/dist/plugin-float-image/src/module/menu/FloatBase.d.ts +4 -4
- package/dist/plugin-float-image/src/module/menu/FloatLeft.d.ts +1 -1
- package/dist/plugin-float-image/src/module/menu/FloatNone.d.ts +1 -1
- package/dist/plugin-float-image/src/module/menu/FloatRight.d.ts +1 -1
- package/dist/plugin-float-image/src/module/menu/index.d.ts +2 -2
- package/dist/plugin-float-image/src/module/parse-elem-html.d.ts +1 -1
- package/dist/plugin-float-image/src/module/plugin.d.ts +1 -1
- package/dist/plugin-float-image/src/utils/dom.d.ts +3 -2
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
@@ -1,1002 +1,2 @@
|
|
1
|
-
import { i18nAddResources, DomEditor, SlateTransforms, t } from '@wangeditor-next/editor';
|
2
|
-
|
3
|
-
import $, { css, append, prepend, addClass, removeClass, hasClass, on, off, focus, attr, removeAttr, hide, show, parents, dataset, val, text, html, children, remove, find, width, height, filter, empty } from 'dom7';
|
4
|
-
|
5
|
-
/**
|
6
|
-
* @description 多语言
|
7
|
-
* @author Yanghc
|
8
|
-
*/
|
9
|
-
i18nAddResources('en', {
|
10
|
-
float: {
|
11
|
-
none: 'Default',
|
12
|
-
left: 'Float Left',
|
13
|
-
right: 'Float Right',
|
14
|
-
},
|
15
|
-
});
|
16
|
-
i18nAddResources('zh-CN', {
|
17
|
-
float: {
|
18
|
-
none: '默认',
|
19
|
-
left: '左浮动',
|
20
|
-
right: '右浮动',
|
21
|
-
},
|
22
|
-
});
|
23
|
-
|
24
|
-
/**
|
25
|
-
* @description elem to html
|
26
|
-
* @author Yanghc
|
27
|
-
*/
|
28
|
-
// 生成 html 的函数
|
29
|
-
function imageToHtml(elem, _childrenHtml) {
|
30
|
-
var _a = elem, src = _a.src, _b = _a.alt, alt = _b === void 0 ? '' : _b, _c = _a.href, href = _c === void 0 ? '' : _c, _d = _a.style, style = _d === void 0 ? {} : _d;
|
31
|
-
var _e = style.width, width = _e === void 0 ? '' : _e, _f = style.height, height = _f === void 0 ? '' : _f, _g = style.float, float = _g === void 0 ? '' : _g;
|
32
|
-
var styleStr = '';
|
33
|
-
if (width) {
|
34
|
-
styleStr += "width: ".concat(width, ";");
|
35
|
-
}
|
36
|
-
if (height) {
|
37
|
-
styleStr += "height: ".concat(height, ";");
|
38
|
-
}
|
39
|
-
if (float) {
|
40
|
-
styleStr += "float: ".concat(float, ";");
|
41
|
-
}
|
42
|
-
return "<img src=\"".concat(src, "\" alt=\"").concat(alt, "\" data-href=\"").concat(href, "\" style=\"").concat(styleStr, "\"/>");
|
43
|
-
}
|
44
|
-
// 配置
|
45
|
-
var conf = {
|
46
|
-
type: 'image', // 节点 type ,重要!!!
|
47
|
-
elemToHtml: imageToHtml,
|
48
|
-
};
|
49
|
-
|
50
|
-
/******************************************************************************
|
51
|
-
Copyright (c) Microsoft Corporation.
|
52
|
-
|
53
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
54
|
-
purpose with or without fee is hereby granted.
|
55
|
-
|
56
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
57
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
58
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
59
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
60
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
61
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
62
|
-
PERFORMANCE OF THIS SOFTWARE.
|
63
|
-
***************************************************************************** */
|
64
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
65
|
-
|
66
|
-
var extendStatics = function(d, b) {
|
67
|
-
extendStatics = Object.setPrototypeOf ||
|
68
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
69
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
70
|
-
return extendStatics(d, b);
|
71
|
-
};
|
72
|
-
|
73
|
-
function __extends(d, b) {
|
74
|
-
if (typeof b !== "function" && b !== null)
|
75
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
76
|
-
extendStatics(d, b);
|
77
|
-
function __() { this.constructor = d; }
|
78
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
79
|
-
}
|
80
|
-
|
81
|
-
var __assign = function() {
|
82
|
-
__assign = Object.assign || function __assign(t) {
|
83
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
84
|
-
s = arguments[i];
|
85
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
86
|
-
}
|
87
|
-
return t;
|
88
|
-
};
|
89
|
-
return __assign.apply(this, arguments);
|
90
|
-
};
|
91
|
-
|
92
|
-
function __read(o, n) {
|
93
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
94
|
-
if (!m) return o;
|
95
|
-
var i = m.call(o), r, ar = [], e;
|
96
|
-
try {
|
97
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
98
|
-
}
|
99
|
-
catch (error) { e = { error: error }; }
|
100
|
-
finally {
|
101
|
-
try {
|
102
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
103
|
-
}
|
104
|
-
finally { if (e) throw e.error; }
|
105
|
-
}
|
106
|
-
return ar;
|
107
|
-
}
|
108
|
-
|
109
|
-
function __spreadArray(to, from, pack) {
|
110
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
111
|
-
if (ar || !(i in from)) {
|
112
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
113
|
-
ar[i] = from[i];
|
114
|
-
}
|
115
|
-
}
|
116
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
117
|
-
}
|
118
|
-
|
119
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
120
|
-
var e = new Error(message);
|
121
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
122
|
-
};
|
123
|
-
|
124
|
-
/**
|
125
|
-
* @description icon svg
|
126
|
-
* @author Yanghc
|
127
|
-
*/
|
128
|
-
/**
|
129
|
-
* 【注意】svg 字符串的长度 ,否则会导致代码体积过大
|
130
|
-
* 尽量选择 https://www.iconfont.cn/collections/detail?spm=a313x.7781069.0.da5a778a4&cid=20293
|
131
|
-
* 找不到再从 iconfont.com 搜索
|
132
|
-
*/
|
133
|
-
// 默认不浮动
|
134
|
-
var DEFAULT_FLOAT_SVG = '<svg viewBox="0 0 1024 1024"><path d="M76.73805432 117.83964445m12.42756741 0l845.0745837 0q12.42756741 0 12.42756741 12.4275674l0 68.35162074q0 12.42756741-12.42756741 12.42756741l-845.0745837 0q-12.42756741 0-12.42756741-12.42756741l0-68.35162074q0-12.42756741 12.42756741-12.4275674Z"></path><path d="M76.73805432 801.35585185m12.42756741 0l845.0745837 0q12.42756741 0 12.42756741 12.42756741l0 68.35162074q0 12.42756741-12.42756741 12.42756742l-845.0745837 0q-12.42756741 0-12.42756741-12.42756742l0-68.35162074q0-12.42756741 12.42756741-12.42756741Z"></path><path d="M89.16562173 304.25315556h410.10972444c6.83516208 0 12.42756741 5.59240533 12.42756741 12.42756741v410.10972445a12.42756741 12.42756741 0 0 1-12.42756741 12.4275674h-410.10972444a12.42756741 12.42756741 0 0 1-12.42756741-12.4275674v-410.10972445c0-6.83516208 5.59240533-12.42756741 12.42756741-12.42756741z"></path></svg>';
|
135
|
-
// 左浮动
|
136
|
-
var LEFT_FLOAT_SVG = '<svg viewBox="0 0 1024 1024"><path d="M77.03514075 117.83964445m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.4275674l0 68.35162074q0 12.42756741-12.4275674 12.42756741l-845.0745837 0q-12.42756741 0-12.4275674-12.42756741l0-68.35162074q0-12.42756741 12.4275674-12.4275674Z"></path><path d="M77.03514075 801.35585185m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.42756741l0 68.35162074q0 12.42756741-12.4275674 12.42756742l-845.0745837 0q-12.42756741 0-12.4275674-12.42756742l0-68.35162074q0-12.42756741 12.4275674-12.42756741Z"></path><path d="M89.46270815 304.25315556h347.9718874c6.83516208 0 12.42756741 5.59240533 12.42756742 12.42756741v410.10972445a12.42756741 12.42756741 0 0 1-12.42756742 12.4275674h-347.9718874a12.42756741 12.42756741 0 0 1-12.4275674-12.4275674v-410.10972445c0-6.83516208 5.59240533-12.42756741 12.4275674-12.42756741z"></path><path d="M512 552.8045037m12.42756741 0l410.10972444 0q12.42756741 0 12.4275674 12.42756742l0 68.35162073q0 12.42756741-12.4275674 12.42756741l-410.10972444 0q-12.42756741 0-12.42756741-12.42756741l0-68.35162073q0-12.42756741 12.42756741-12.42756742Z"></path><path d="M512 366.39099259m12.42756741 0l410.10972444 0q12.42756741 0 12.4275674 12.42756741l0 68.35162075q0 12.42756741-12.4275674 12.4275674l-410.10972444 0q-12.42756741 0-12.42756741-12.4275674l0-68.35162075q0-12.42756741 12.42756741-12.42756741Z"></path></svg>';
|
137
|
-
// 右浮动
|
138
|
-
var RIGHT_FLOAT_SVG = '<svg viewBox="0 0 1024 1024"><path d="M77.03514075 117.83964445m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.4275674l0 68.35162074q0 12.42756741-12.4275674 12.42756741l-845.0745837 0q-12.42756741 0-12.4275674-12.42756741l0-68.35162074q0-12.42756741 12.4275674-12.4275674Z"></path><path d="M77.03514075 801.35585185m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.42756741l0 68.35162074q0 12.42756741-12.4275674 12.42756742l-845.0745837 0q-12.42756741 0-12.4275674-12.42756742l0-68.35162074q0-12.42756741 12.4275674-12.42756741Z"></path><path d="M586.56540445 304.25315556h347.9718874c6.83516208 0 12.42756741 5.59240533 12.4275674 12.42756741v410.10972445a12.42756741 12.42756741 0 0 1-12.4275674 12.4275674h-347.9718874a12.42756741 12.42756741 0 0 1-12.42756742-12.4275674v-410.10972445c0-6.83516208 5.59240533-12.42756741 12.42756742-12.42756741z"></path><path d="M77.03514075 552.8045037m12.4275674 0l410.10972444 0q12.42756741 0 12.42756741 12.42756742l0 68.35162073q0 12.42756741-12.42756741 12.42756741l-410.10972444 0q-12.42756741 0-12.4275674-12.42756741l0-68.35162073q0-12.42756741 12.4275674-12.42756742Z"></path><path d="M77.03514075 366.39099259m12.4275674 0l410.10972444 0q12.42756741 0 12.42756741 12.42756741l0 68.35162075q0 12.42756741-12.42756741 12.4275674l-410.10972444 0q-12.42756741 0-12.4275674-12.4275674l0-68.35162075q0-12.42756741 12.4275674-12.42756741Z"></path></svg>';
|
139
|
-
|
140
|
-
/**
|
141
|
-
* @description image float base class
|
142
|
-
* @author Yanghc
|
143
|
-
*/
|
144
|
-
var ImageFloatBaseClass = /** @class */ (function () {
|
145
|
-
function ImageFloatBaseClass() {
|
146
|
-
this.tag = 'button';
|
147
|
-
}
|
148
|
-
ImageFloatBaseClass.prototype.getValue = function (editor) {
|
149
|
-
// 无需获取 val
|
150
|
-
return '';
|
151
|
-
};
|
152
|
-
ImageFloatBaseClass.prototype.isActive = function (editor) {
|
153
|
-
// 无需 active
|
154
|
-
return false;
|
155
|
-
};
|
156
|
-
ImageFloatBaseClass.prototype.getSelectedNode = function (editor) {
|
157
|
-
return DomEditor.getSelectedNodeByType(editor, 'image');
|
158
|
-
};
|
159
|
-
ImageFloatBaseClass.prototype.isDisabled = function (editor) {
|
160
|
-
if (editor.selection == null) {
|
161
|
-
return true;
|
162
|
-
}
|
163
|
-
var imageNode = this.getSelectedNode(editor);
|
164
|
-
return imageNode == null;
|
165
|
-
};
|
166
|
-
ImageFloatBaseClass.prototype.exec = function (editor, value) {
|
167
|
-
if (this.isDisabled(editor)) {
|
168
|
-
return;
|
169
|
-
}
|
170
|
-
var imageNode = this.getSelectedNode(editor);
|
171
|
-
if (imageNode == null) {
|
172
|
-
return;
|
173
|
-
}
|
174
|
-
// 隐藏 hoverbar
|
175
|
-
var hoverbar = DomEditor.getHoverbar(editor);
|
176
|
-
if (hoverbar) {
|
177
|
-
hoverbar.hideAndClean();
|
178
|
-
}
|
179
|
-
var _a = imageNode.style, style = _a === void 0 ? {} : _a;
|
180
|
-
var props = {
|
181
|
-
style: __assign(__assign({}, style), { float: this.value }),
|
182
|
-
};
|
183
|
-
SlateTransforms.setNodes(editor, props, {
|
184
|
-
match: function (n) { return DomEditor.checkNodeType(n, 'image'); },
|
185
|
-
});
|
186
|
-
};
|
187
|
-
return ImageFloatBaseClass;
|
188
|
-
}());
|
189
|
-
|
190
|
-
/**
|
191
|
-
* @description float image none
|
192
|
-
* @author Yanghc
|
193
|
-
*/
|
194
|
-
var FloatNone = /** @class */ (function (_super) {
|
195
|
-
__extends(FloatNone, _super);
|
196
|
-
function FloatNone() {
|
197
|
-
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
198
|
-
_this.title = t('float.none'); // 菜单标题
|
199
|
-
_this.value = 'none'; // css float 的值
|
200
|
-
_this.iconSvg = DEFAULT_FLOAT_SVG;
|
201
|
-
return _this;
|
202
|
-
}
|
203
|
-
return FloatNone;
|
204
|
-
}(ImageFloatBaseClass));
|
205
|
-
|
206
|
-
/**
|
207
|
-
* @description float image left
|
208
|
-
* @author Yanghc
|
209
|
-
*/
|
210
|
-
var FloatLeft = /** @class */ (function (_super) {
|
211
|
-
__extends(FloatLeft, _super);
|
212
|
-
function FloatLeft() {
|
213
|
-
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
214
|
-
_this.title = t('float.left'); // 菜单标题
|
215
|
-
_this.value = 'left'; // css float 的值
|
216
|
-
_this.iconSvg = LEFT_FLOAT_SVG;
|
217
|
-
return _this;
|
218
|
-
}
|
219
|
-
return FloatLeft;
|
220
|
-
}(ImageFloatBaseClass));
|
221
|
-
|
222
|
-
/**
|
223
|
-
* @description float image right
|
224
|
-
* @author Yanghc
|
225
|
-
*/
|
226
|
-
var FloatRight = /** @class */ (function (_super) {
|
227
|
-
__extends(FloatRight, _super);
|
228
|
-
function FloatRight() {
|
229
|
-
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
230
|
-
_this.title = t('float.right'); // 菜单标题
|
231
|
-
_this.value = 'right'; // css float 的值
|
232
|
-
_this.iconSvg = RIGHT_FLOAT_SVG;
|
233
|
-
return _this;
|
234
|
-
}
|
235
|
-
return FloatRight;
|
236
|
-
}(ImageFloatBaseClass));
|
237
|
-
|
238
|
-
/**
|
239
|
-
* @description menu index
|
240
|
-
* @author Yanghc
|
241
|
-
*/
|
242
|
-
var imageFloatNoneMenuConf = {
|
243
|
-
key: 'imageFloatNone',
|
244
|
-
factory: function () {
|
245
|
-
return new FloatNone();
|
246
|
-
},
|
247
|
-
};
|
248
|
-
var imageFloatLeftMenuConf = {
|
249
|
-
key: 'imageFloatLeft',
|
250
|
-
factory: function () {
|
251
|
-
return new FloatLeft();
|
252
|
-
},
|
253
|
-
};
|
254
|
-
var imageFloatRightMenuConf = {
|
255
|
-
key: 'imageFloatRight',
|
256
|
-
factory: function () {
|
257
|
-
return new FloatRight();
|
258
|
-
},
|
259
|
-
};
|
260
|
-
|
261
|
-
/**
|
262
|
-
* @description parse elem html
|
263
|
-
* @author Yanghc
|
264
|
-
*/
|
265
|
-
function parseHtml(elem, _children, _editor) {
|
266
|
-
var href = elem.getAttribute('data-href') || '';
|
267
|
-
href = decodeURIComponent(href); // 兼容 V4
|
268
|
-
return {
|
269
|
-
type: 'image',
|
270
|
-
src: elem.getAttribute('src') || '',
|
271
|
-
alt: elem.getAttribute('alt') || '',
|
272
|
-
href: href,
|
273
|
-
style: {
|
274
|
-
width: elem.getAttribute('width') || '',
|
275
|
-
height: elem.getAttribute('height') || '',
|
276
|
-
float: elem.getAttribute('float') || '',
|
277
|
-
},
|
278
|
-
children: [{ text: '' }], // void node 有一个空白 text
|
279
|
-
};
|
280
|
-
}
|
281
|
-
var parseHtmlConf = {
|
282
|
-
selector: 'img:not([data-w-e-type])', // data-w-e-type 属性,留给自定义元素,保证扩展性
|
283
|
-
parseElemHtml: parseHtml,
|
284
|
-
};
|
285
|
-
|
286
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
287
|
-
|
288
|
-
function getDefaultExportFromCjs (x) {
|
289
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
290
|
-
}
|
291
|
-
|
292
|
-
/**
|
293
|
-
* lodash (Custom Build) <https://lodash.com/>
|
294
|
-
* Build: `lodash modularize exports="npm" -o ./`
|
295
|
-
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
296
|
-
* Released under MIT license <https://lodash.com/license>
|
297
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
298
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
299
|
-
*/
|
300
|
-
|
301
|
-
var lodash_throttle;
|
302
|
-
var hasRequiredLodash_throttle;
|
303
|
-
|
304
|
-
function requireLodash_throttle () {
|
305
|
-
if (hasRequiredLodash_throttle) return lodash_throttle;
|
306
|
-
hasRequiredLodash_throttle = 1;
|
307
|
-
/** Used as the `TypeError` message for "Functions" methods. */
|
308
|
-
var FUNC_ERROR_TEXT = 'Expected a function';
|
309
|
-
|
310
|
-
/** Used as references for various `Number` constants. */
|
311
|
-
var NAN = 0 / 0;
|
312
|
-
|
313
|
-
/** `Object#toString` result references. */
|
314
|
-
var symbolTag = '[object Symbol]';
|
315
|
-
|
316
|
-
/** Used to match leading and trailing whitespace. */
|
317
|
-
var reTrim = /^\s+|\s+$/g;
|
318
|
-
|
319
|
-
/** Used to detect bad signed hexadecimal string values. */
|
320
|
-
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
321
|
-
|
322
|
-
/** Used to detect binary string values. */
|
323
|
-
var reIsBinary = /^0b[01]+$/i;
|
324
|
-
|
325
|
-
/** Used to detect octal string values. */
|
326
|
-
var reIsOctal = /^0o[0-7]+$/i;
|
327
|
-
|
328
|
-
/** Built-in method references without a dependency on `root`. */
|
329
|
-
var freeParseInt = parseInt;
|
330
|
-
|
331
|
-
/** Detect free variable `global` from Node.js. */
|
332
|
-
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
333
|
-
|
334
|
-
/** Detect free variable `self`. */
|
335
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
336
|
-
|
337
|
-
/** Used as a reference to the global object. */
|
338
|
-
var root = freeGlobal || freeSelf || Function('return this')();
|
339
|
-
|
340
|
-
/** Used for built-in method references. */
|
341
|
-
var objectProto = Object.prototype;
|
342
|
-
|
343
|
-
/**
|
344
|
-
* Used to resolve the
|
345
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
346
|
-
* of values.
|
347
|
-
*/
|
348
|
-
var objectToString = objectProto.toString;
|
349
|
-
|
350
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
351
|
-
var nativeMax = Math.max,
|
352
|
-
nativeMin = Math.min;
|
353
|
-
|
354
|
-
/**
|
355
|
-
* Gets the timestamp of the number of milliseconds that have elapsed since
|
356
|
-
* the Unix epoch (1 January 1970 00:00:00 UTC).
|
357
|
-
*
|
358
|
-
* @static
|
359
|
-
* @memberOf _
|
360
|
-
* @since 2.4.0
|
361
|
-
* @category Date
|
362
|
-
* @returns {number} Returns the timestamp.
|
363
|
-
* @example
|
364
|
-
*
|
365
|
-
* _.defer(function(stamp) {
|
366
|
-
* console.log(_.now() - stamp);
|
367
|
-
* }, _.now());
|
368
|
-
* // => Logs the number of milliseconds it took for the deferred invocation.
|
369
|
-
*/
|
370
|
-
var now = function() {
|
371
|
-
return root.Date.now();
|
372
|
-
};
|
373
|
-
|
374
|
-
/**
|
375
|
-
* Creates a debounced function that delays invoking `func` until after `wait`
|
376
|
-
* milliseconds have elapsed since the last time the debounced function was
|
377
|
-
* invoked. The debounced function comes with a `cancel` method to cancel
|
378
|
-
* delayed `func` invocations and a `flush` method to immediately invoke them.
|
379
|
-
* Provide `options` to indicate whether `func` should be invoked on the
|
380
|
-
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
|
381
|
-
* with the last arguments provided to the debounced function. Subsequent
|
382
|
-
* calls to the debounced function return the result of the last `func`
|
383
|
-
* invocation.
|
384
|
-
*
|
385
|
-
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
386
|
-
* invoked on the trailing edge of the timeout only if the debounced function
|
387
|
-
* is invoked more than once during the `wait` timeout.
|
388
|
-
*
|
389
|
-
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
390
|
-
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
391
|
-
*
|
392
|
-
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
393
|
-
* for details over the differences between `_.debounce` and `_.throttle`.
|
394
|
-
*
|
395
|
-
* @static
|
396
|
-
* @memberOf _
|
397
|
-
* @since 0.1.0
|
398
|
-
* @category Function
|
399
|
-
* @param {Function} func The function to debounce.
|
400
|
-
* @param {number} [wait=0] The number of milliseconds to delay.
|
401
|
-
* @param {Object} [options={}] The options object.
|
402
|
-
* @param {boolean} [options.leading=false]
|
403
|
-
* Specify invoking on the leading edge of the timeout.
|
404
|
-
* @param {number} [options.maxWait]
|
405
|
-
* The maximum time `func` is allowed to be delayed before it's invoked.
|
406
|
-
* @param {boolean} [options.trailing=true]
|
407
|
-
* Specify invoking on the trailing edge of the timeout.
|
408
|
-
* @returns {Function} Returns the new debounced function.
|
409
|
-
* @example
|
410
|
-
*
|
411
|
-
* // Avoid costly calculations while the window size is in flux.
|
412
|
-
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
|
413
|
-
*
|
414
|
-
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
|
415
|
-
* jQuery(element).on('click', _.debounce(sendMail, 300, {
|
416
|
-
* 'leading': true,
|
417
|
-
* 'trailing': false
|
418
|
-
* }));
|
419
|
-
*
|
420
|
-
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
|
421
|
-
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
|
422
|
-
* var source = new EventSource('/stream');
|
423
|
-
* jQuery(source).on('message', debounced);
|
424
|
-
*
|
425
|
-
* // Cancel the trailing debounced invocation.
|
426
|
-
* jQuery(window).on('popstate', debounced.cancel);
|
427
|
-
*/
|
428
|
-
function debounce(func, wait, options) {
|
429
|
-
var lastArgs,
|
430
|
-
lastThis,
|
431
|
-
maxWait,
|
432
|
-
result,
|
433
|
-
timerId,
|
434
|
-
lastCallTime,
|
435
|
-
lastInvokeTime = 0,
|
436
|
-
leading = false,
|
437
|
-
maxing = false,
|
438
|
-
trailing = true;
|
439
|
-
|
440
|
-
if (typeof func != 'function') {
|
441
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
442
|
-
}
|
443
|
-
wait = toNumber(wait) || 0;
|
444
|
-
if (isObject(options)) {
|
445
|
-
leading = !!options.leading;
|
446
|
-
maxing = 'maxWait' in options;
|
447
|
-
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
448
|
-
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
449
|
-
}
|
450
|
-
|
451
|
-
function invokeFunc(time) {
|
452
|
-
var args = lastArgs,
|
453
|
-
thisArg = lastThis;
|
454
|
-
|
455
|
-
lastArgs = lastThis = undefined;
|
456
|
-
lastInvokeTime = time;
|
457
|
-
result = func.apply(thisArg, args);
|
458
|
-
return result;
|
459
|
-
}
|
460
|
-
|
461
|
-
function leadingEdge(time) {
|
462
|
-
// Reset any `maxWait` timer.
|
463
|
-
lastInvokeTime = time;
|
464
|
-
// Start the timer for the trailing edge.
|
465
|
-
timerId = setTimeout(timerExpired, wait);
|
466
|
-
// Invoke the leading edge.
|
467
|
-
return leading ? invokeFunc(time) : result;
|
468
|
-
}
|
469
|
-
|
470
|
-
function remainingWait(time) {
|
471
|
-
var timeSinceLastCall = time - lastCallTime,
|
472
|
-
timeSinceLastInvoke = time - lastInvokeTime,
|
473
|
-
result = wait - timeSinceLastCall;
|
474
|
-
|
475
|
-
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
|
476
|
-
}
|
477
|
-
|
478
|
-
function shouldInvoke(time) {
|
479
|
-
var timeSinceLastCall = time - lastCallTime,
|
480
|
-
timeSinceLastInvoke = time - lastInvokeTime;
|
481
|
-
|
482
|
-
// Either this is the first call, activity has stopped and we're at the
|
483
|
-
// trailing edge, the system time has gone backwards and we're treating
|
484
|
-
// it as the trailing edge, or we've hit the `maxWait` limit.
|
485
|
-
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
|
486
|
-
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
|
487
|
-
}
|
488
|
-
|
489
|
-
function timerExpired() {
|
490
|
-
var time = now();
|
491
|
-
if (shouldInvoke(time)) {
|
492
|
-
return trailingEdge(time);
|
493
|
-
}
|
494
|
-
// Restart the timer.
|
495
|
-
timerId = setTimeout(timerExpired, remainingWait(time));
|
496
|
-
}
|
497
|
-
|
498
|
-
function trailingEdge(time) {
|
499
|
-
timerId = undefined;
|
500
|
-
|
501
|
-
// Only invoke if we have `lastArgs` which means `func` has been
|
502
|
-
// debounced at least once.
|
503
|
-
if (trailing && lastArgs) {
|
504
|
-
return invokeFunc(time);
|
505
|
-
}
|
506
|
-
lastArgs = lastThis = undefined;
|
507
|
-
return result;
|
508
|
-
}
|
509
|
-
|
510
|
-
function cancel() {
|
511
|
-
if (timerId !== undefined) {
|
512
|
-
clearTimeout(timerId);
|
513
|
-
}
|
514
|
-
lastInvokeTime = 0;
|
515
|
-
lastArgs = lastCallTime = lastThis = timerId = undefined;
|
516
|
-
}
|
517
|
-
|
518
|
-
function flush() {
|
519
|
-
return timerId === undefined ? result : trailingEdge(now());
|
520
|
-
}
|
521
|
-
|
522
|
-
function debounced() {
|
523
|
-
var time = now(),
|
524
|
-
isInvoking = shouldInvoke(time);
|
525
|
-
|
526
|
-
lastArgs = arguments;
|
527
|
-
lastThis = this;
|
528
|
-
lastCallTime = time;
|
529
|
-
|
530
|
-
if (isInvoking) {
|
531
|
-
if (timerId === undefined) {
|
532
|
-
return leadingEdge(lastCallTime);
|
533
|
-
}
|
534
|
-
if (maxing) {
|
535
|
-
// Handle invocations in a tight loop.
|
536
|
-
timerId = setTimeout(timerExpired, wait);
|
537
|
-
return invokeFunc(lastCallTime);
|
538
|
-
}
|
539
|
-
}
|
540
|
-
if (timerId === undefined) {
|
541
|
-
timerId = setTimeout(timerExpired, wait);
|
542
|
-
}
|
543
|
-
return result;
|
544
|
-
}
|
545
|
-
debounced.cancel = cancel;
|
546
|
-
debounced.flush = flush;
|
547
|
-
return debounced;
|
548
|
-
}
|
549
|
-
|
550
|
-
/**
|
551
|
-
* Creates a throttled function that only invokes `func` at most once per
|
552
|
-
* every `wait` milliseconds. The throttled function comes with a `cancel`
|
553
|
-
* method to cancel delayed `func` invocations and a `flush` method to
|
554
|
-
* immediately invoke them. Provide `options` to indicate whether `func`
|
555
|
-
* should be invoked on the leading and/or trailing edge of the `wait`
|
556
|
-
* timeout. The `func` is invoked with the last arguments provided to the
|
557
|
-
* throttled function. Subsequent calls to the throttled function return the
|
558
|
-
* result of the last `func` invocation.
|
559
|
-
*
|
560
|
-
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
561
|
-
* invoked on the trailing edge of the timeout only if the throttled function
|
562
|
-
* is invoked more than once during the `wait` timeout.
|
563
|
-
*
|
564
|
-
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
565
|
-
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
566
|
-
*
|
567
|
-
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
568
|
-
* for details over the differences between `_.throttle` and `_.debounce`.
|
569
|
-
*
|
570
|
-
* @static
|
571
|
-
* @memberOf _
|
572
|
-
* @since 0.1.0
|
573
|
-
* @category Function
|
574
|
-
* @param {Function} func The function to throttle.
|
575
|
-
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
|
576
|
-
* @param {Object} [options={}] The options object.
|
577
|
-
* @param {boolean} [options.leading=true]
|
578
|
-
* Specify invoking on the leading edge of the timeout.
|
579
|
-
* @param {boolean} [options.trailing=true]
|
580
|
-
* Specify invoking on the trailing edge of the timeout.
|
581
|
-
* @returns {Function} Returns the new throttled function.
|
582
|
-
* @example
|
583
|
-
*
|
584
|
-
* // Avoid excessively updating the position while scrolling.
|
585
|
-
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
|
586
|
-
*
|
587
|
-
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
|
588
|
-
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
|
589
|
-
* jQuery(element).on('click', throttled);
|
590
|
-
*
|
591
|
-
* // Cancel the trailing throttled invocation.
|
592
|
-
* jQuery(window).on('popstate', throttled.cancel);
|
593
|
-
*/
|
594
|
-
function throttle(func, wait, options) {
|
595
|
-
var leading = true,
|
596
|
-
trailing = true;
|
597
|
-
|
598
|
-
if (typeof func != 'function') {
|
599
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
600
|
-
}
|
601
|
-
if (isObject(options)) {
|
602
|
-
leading = 'leading' in options ? !!options.leading : leading;
|
603
|
-
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
604
|
-
}
|
605
|
-
return debounce(func, wait, {
|
606
|
-
'leading': leading,
|
607
|
-
'maxWait': wait,
|
608
|
-
'trailing': trailing
|
609
|
-
});
|
610
|
-
}
|
611
|
-
|
612
|
-
/**
|
613
|
-
* Checks if `value` is the
|
614
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
615
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
616
|
-
*
|
617
|
-
* @static
|
618
|
-
* @memberOf _
|
619
|
-
* @since 0.1.0
|
620
|
-
* @category Lang
|
621
|
-
* @param {*} value The value to check.
|
622
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
623
|
-
* @example
|
624
|
-
*
|
625
|
-
* _.isObject({});
|
626
|
-
* // => true
|
627
|
-
*
|
628
|
-
* _.isObject([1, 2, 3]);
|
629
|
-
* // => true
|
630
|
-
*
|
631
|
-
* _.isObject(_.noop);
|
632
|
-
* // => true
|
633
|
-
*
|
634
|
-
* _.isObject(null);
|
635
|
-
* // => false
|
636
|
-
*/
|
637
|
-
function isObject(value) {
|
638
|
-
var type = typeof value;
|
639
|
-
return !!value && (type == 'object' || type == 'function');
|
640
|
-
}
|
641
|
-
|
642
|
-
/**
|
643
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
644
|
-
* and has a `typeof` result of "object".
|
645
|
-
*
|
646
|
-
* @static
|
647
|
-
* @memberOf _
|
648
|
-
* @since 4.0.0
|
649
|
-
* @category Lang
|
650
|
-
* @param {*} value The value to check.
|
651
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
652
|
-
* @example
|
653
|
-
*
|
654
|
-
* _.isObjectLike({});
|
655
|
-
* // => true
|
656
|
-
*
|
657
|
-
* _.isObjectLike([1, 2, 3]);
|
658
|
-
* // => true
|
659
|
-
*
|
660
|
-
* _.isObjectLike(_.noop);
|
661
|
-
* // => false
|
662
|
-
*
|
663
|
-
* _.isObjectLike(null);
|
664
|
-
* // => false
|
665
|
-
*/
|
666
|
-
function isObjectLike(value) {
|
667
|
-
return !!value && typeof value == 'object';
|
668
|
-
}
|
669
|
-
|
670
|
-
/**
|
671
|
-
* Checks if `value` is classified as a `Symbol` primitive or object.
|
672
|
-
*
|
673
|
-
* @static
|
674
|
-
* @memberOf _
|
675
|
-
* @since 4.0.0
|
676
|
-
* @category Lang
|
677
|
-
* @param {*} value The value to check.
|
678
|
-
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
679
|
-
* @example
|
680
|
-
*
|
681
|
-
* _.isSymbol(Symbol.iterator);
|
682
|
-
* // => true
|
683
|
-
*
|
684
|
-
* _.isSymbol('abc');
|
685
|
-
* // => false
|
686
|
-
*/
|
687
|
-
function isSymbol(value) {
|
688
|
-
return typeof value == 'symbol' ||
|
689
|
-
(isObjectLike(value) && objectToString.call(value) == symbolTag);
|
690
|
-
}
|
691
|
-
|
692
|
-
/**
|
693
|
-
* Converts `value` to a number.
|
694
|
-
*
|
695
|
-
* @static
|
696
|
-
* @memberOf _
|
697
|
-
* @since 4.0.0
|
698
|
-
* @category Lang
|
699
|
-
* @param {*} value The value to process.
|
700
|
-
* @returns {number} Returns the number.
|
701
|
-
* @example
|
702
|
-
*
|
703
|
-
* _.toNumber(3.2);
|
704
|
-
* // => 3.2
|
705
|
-
*
|
706
|
-
* _.toNumber(Number.MIN_VALUE);
|
707
|
-
* // => 5e-324
|
708
|
-
*
|
709
|
-
* _.toNumber(Infinity);
|
710
|
-
* // => Infinity
|
711
|
-
*
|
712
|
-
* _.toNumber('3.2');
|
713
|
-
* // => 3.2
|
714
|
-
*/
|
715
|
-
function toNumber(value) {
|
716
|
-
if (typeof value == 'number') {
|
717
|
-
return value;
|
718
|
-
}
|
719
|
-
if (isSymbol(value)) {
|
720
|
-
return NAN;
|
721
|
-
}
|
722
|
-
if (isObject(value)) {
|
723
|
-
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
724
|
-
value = isObject(other) ? (other + '') : other;
|
725
|
-
}
|
726
|
-
if (typeof value != 'string') {
|
727
|
-
return value === 0 ? value : +value;
|
728
|
-
}
|
729
|
-
value = value.replace(reTrim, '');
|
730
|
-
var isBinary = reIsBinary.test(value);
|
731
|
-
return (isBinary || reIsOctal.test(value))
|
732
|
-
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
733
|
-
: (reIsBadHex.test(value) ? NAN : +value);
|
734
|
-
}
|
735
|
-
|
736
|
-
lodash_throttle = throttle;
|
737
|
-
return lodash_throttle;
|
738
|
-
}
|
739
|
-
|
740
|
-
var lodash_throttleExports = requireLodash_throttle();
|
741
|
-
var throttle = /*@__PURE__*/getDefaultExportFromCjs(lodash_throttleExports);
|
742
|
-
|
743
|
-
/**
|
744
|
-
* @description DOM 操作
|
745
|
-
* @author Yanghc
|
746
|
-
*/
|
747
|
-
if (css) {
|
748
|
-
$.fn.css = css;
|
749
|
-
}
|
750
|
-
if (append) {
|
751
|
-
$.fn.append = append;
|
752
|
-
}
|
753
|
-
if (prepend) {
|
754
|
-
$.fn.prepend = prepend;
|
755
|
-
}
|
756
|
-
if (addClass) {
|
757
|
-
$.fn.addClass = addClass;
|
758
|
-
}
|
759
|
-
if (removeClass) {
|
760
|
-
$.fn.removeClass = removeClass;
|
761
|
-
}
|
762
|
-
if (hasClass) {
|
763
|
-
$.fn.hasClass = hasClass;
|
764
|
-
}
|
765
|
-
if (on) {
|
766
|
-
$.fn.on = on;
|
767
|
-
}
|
768
|
-
if (off) {
|
769
|
-
$.fn.off = off;
|
770
|
-
}
|
771
|
-
if (focus) {
|
772
|
-
$.fn.focus = focus;
|
773
|
-
}
|
774
|
-
if (attr) {
|
775
|
-
$.fn.attr = attr;
|
776
|
-
}
|
777
|
-
if (removeAttr) {
|
778
|
-
$.fn.removeAttr = removeAttr;
|
779
|
-
}
|
780
|
-
if (hide) {
|
781
|
-
$.fn.hide = hide;
|
782
|
-
}
|
783
|
-
if (show) {
|
784
|
-
$.fn.show = show;
|
785
|
-
}
|
786
|
-
if (parents) {
|
787
|
-
$.fn.parents = parents;
|
788
|
-
}
|
789
|
-
if (dataset) {
|
790
|
-
$.fn.dataset = dataset;
|
791
|
-
}
|
792
|
-
if (val) {
|
793
|
-
$.fn.val = val;
|
794
|
-
}
|
795
|
-
if (text) {
|
796
|
-
$.fn.text = text;
|
797
|
-
}
|
798
|
-
if (html) {
|
799
|
-
$.fn.html = html;
|
800
|
-
}
|
801
|
-
if (children) {
|
802
|
-
$.fn.children = children;
|
803
|
-
}
|
804
|
-
if (remove) {
|
805
|
-
$.fn.remove = remove;
|
806
|
-
}
|
807
|
-
if (find) {
|
808
|
-
$.fn.find = find;
|
809
|
-
}
|
810
|
-
if (width) {
|
811
|
-
$.fn.width = width;
|
812
|
-
}
|
813
|
-
if (height) {
|
814
|
-
$.fn.height = height;
|
815
|
-
}
|
816
|
-
if (filter) {
|
817
|
-
$.fn.filter = filter;
|
818
|
-
}
|
819
|
-
if (empty) {
|
820
|
-
$.fn.empty = empty;
|
821
|
-
}
|
822
|
-
|
823
|
-
/**
|
824
|
-
* @description image render elem
|
825
|
-
* @author wangfupeng
|
826
|
-
*/
|
827
|
-
function genContainerId(editor, elemNode) {
|
828
|
-
var id = DomEditor.findKey(editor, elemNode).id; // node 唯一 id
|
829
|
-
return "w-e-image-container-".concat(id);
|
830
|
-
}
|
831
|
-
/**
|
832
|
-
* 未选中时,渲染 image container
|
833
|
-
*/
|
834
|
-
function renderContainer(editor, elemNode, imageVnode, imageInfo) {
|
835
|
-
var width = imageInfo.width, height = imageInfo.height, float = imageInfo.float;
|
836
|
-
var style = {};
|
837
|
-
if (width) {
|
838
|
-
style.width = width;
|
839
|
-
}
|
840
|
-
if (height) {
|
841
|
-
style.height = height;
|
842
|
-
}
|
843
|
-
if (float) {
|
844
|
-
style.float = float;
|
845
|
-
}
|
846
|
-
var containerId = genContainerId(editor, elemNode);
|
847
|
-
return (jsx("div", { id: containerId, style: style, className: "w-e-image-container" }, imageVnode));
|
848
|
-
}
|
849
|
-
/**
|
850
|
-
* 选中状态下,渲染 image container(渲染拖拽容器,修改图片尺寸)
|
851
|
-
*/
|
852
|
-
function renderResizeContainer(editor, elemNode, imageVnode, imageInfo) {
|
853
|
-
var $body = $('body');
|
854
|
-
var containerId = genContainerId(editor, elemNode);
|
855
|
-
var width = imageInfo.width, height = imageInfo.height, float = imageInfo.float;
|
856
|
-
var originalX = 0;
|
857
|
-
var originalWith = 0;
|
858
|
-
var originalHeight = 0;
|
859
|
-
var revers = false; // 是否反转。如向右拖拽 right-top 需增加宽度(非反转),但向右拖拽 left-top 则需要减少宽度(反转)
|
860
|
-
var $container = null;
|
861
|
-
function getContainerElem() {
|
862
|
-
var $containerFromDom = $("#".concat(containerId));
|
863
|
-
if ($containerFromDom.length === 0) {
|
864
|
-
throw new Error('Cannot find image container elem');
|
865
|
-
}
|
866
|
-
return $containerFromDom;
|
867
|
-
}
|
868
|
-
// mouseover callback (节流)
|
869
|
-
var onMousemove = throttle(function (e) {
|
870
|
-
e.preventDefault();
|
871
|
-
var clientX = e.clientX;
|
872
|
-
var gap = revers ? originalX - clientX : clientX - originalX; // 考虑是否反转
|
873
|
-
var newWidth = originalWith + gap;
|
874
|
-
var newHeight = originalHeight * (newWidth / originalWith); // 根据 width ,按比例计算 height
|
875
|
-
// 实时修改 img 宽高 -【注意】这里只修改 DOM ,mouseup 时再统一不修改 node
|
876
|
-
if ($container == null) {
|
877
|
-
return;
|
878
|
-
}
|
879
|
-
if (newWidth <= 15 || newHeight <= 15) {
|
880
|
-
return;
|
881
|
-
} // 最小就是 15px
|
882
|
-
$container.css('width', "".concat(newWidth, "px"));
|
883
|
-
$container.css('height', "".concat(newHeight, "px"));
|
884
|
-
}, 100);
|
885
|
-
function onMouseup(_e) {
|
886
|
-
// 取消监听 mousemove
|
887
|
-
$body.off('mousemove', onMousemove);
|
888
|
-
if ($container == null) {
|
889
|
-
return;
|
890
|
-
}
|
891
|
-
var newWidth = $container.width().toFixed(2);
|
892
|
-
var newHeight = $container.height().toFixed(2);
|
893
|
-
// 修改 node
|
894
|
-
var props = {
|
895
|
-
style: __assign(__assign({}, elemNode.style), { width: "".concat(newWidth, "px"), height: "".concat(newHeight, "px") }),
|
896
|
-
};
|
897
|
-
SlateTransforms.setNodes(editor, props, { at: DomEditor.findPath(editor, elemNode) });
|
898
|
-
// 取消监听 mouseup
|
899
|
-
$body.off('mouseup', onMouseup);
|
900
|
-
}
|
901
|
-
/**
|
902
|
-
* 初始化。监听事件,记录原始数据
|
903
|
-
*/
|
904
|
-
function init(clientX) {
|
905
|
-
$container = getContainerElem();
|
906
|
-
// 记录当前 x 坐标值
|
907
|
-
originalX = clientX;
|
908
|
-
// 记录 img 原始宽高
|
909
|
-
var $img = $container.find('img');
|
910
|
-
if ($img.length === 0) {
|
911
|
-
throw new Error('Cannot find image elem');
|
912
|
-
}
|
913
|
-
originalWith = $img.width();
|
914
|
-
originalHeight = $img.height();
|
915
|
-
// 监听 mousemove
|
916
|
-
$body.on('mousemove', onMousemove);
|
917
|
-
// 监听 mouseup
|
918
|
-
$body.on('mouseup', onMouseup);
|
919
|
-
// 隐藏 hoverbar
|
920
|
-
var hoverbar = DomEditor.getHoverbar(editor);
|
921
|
-
if (hoverbar) {
|
922
|
-
hoverbar.hideAndClean();
|
923
|
-
}
|
924
|
-
}
|
925
|
-
var style = {};
|
926
|
-
if (width) {
|
927
|
-
style.width = width;
|
928
|
-
}
|
929
|
-
if (height) {
|
930
|
-
style.height = height;
|
931
|
-
}
|
932
|
-
if (float) {
|
933
|
-
style.float = float;
|
934
|
-
}
|
935
|
-
// style.boxShadow = '0 0 0 1px #B4D5FF' // 自定义 selected 样式,因为有拖拽触手
|
936
|
-
return (jsx("div", { id: containerId, style: style, className: "w-e-image-container w-e-selected-image-container", on: {
|
937
|
-
// 统一绑定拖拽触手的 mousedown 事件
|
938
|
-
mousedown: function (e) {
|
939
|
-
var $target = $(e.target);
|
940
|
-
if (!$target.hasClass('w-e-image-dragger')) {
|
941
|
-
// target 不是 .w-e-image-dragger 拖拽触手,则忽略
|
942
|
-
return;
|
943
|
-
}
|
944
|
-
e.preventDefault();
|
945
|
-
if ($target.hasClass('left-top') || $target.hasClass('left-bottom')) {
|
946
|
-
revers = true; // 反转。向右拖拽,减少宽度
|
947
|
-
}
|
948
|
-
init(e.clientX); // 初始化
|
949
|
-
},
|
950
|
-
} },
|
951
|
-
imageVnode,
|
952
|
-
jsx("div", { className: "w-e-image-dragger left-top" }),
|
953
|
-
jsx("div", { className: "w-e-image-dragger right-top" }),
|
954
|
-
jsx("div", { className: "w-e-image-dragger left-bottom" }),
|
955
|
-
jsx("div", { className: "w-e-image-dragger right-bottom" })));
|
956
|
-
}
|
957
|
-
function renderImage(elemNode, children, editor) {
|
958
|
-
var _a = elemNode, src = _a.src, _b = _a.alt, alt = _b === void 0 ? '' : _b, _c = _a.href, href = _c === void 0 ? '' : _c, _d = _a.style, style = _d === void 0 ? {} : _d;
|
959
|
-
var _f = style.width, width = _f === void 0 ? '' : _f, _g = style.height, height = _g === void 0 ? '' : _g, float = style.float;
|
960
|
-
var selected = DomEditor.isNodeSelected(editor, elemNode); // 图片是否选中
|
961
|
-
var imageStyle = {};
|
962
|
-
if (width) {
|
963
|
-
imageStyle.width = '100%';
|
964
|
-
}
|
965
|
-
if (height) {
|
966
|
-
imageStyle.height = '100%';
|
967
|
-
}
|
968
|
-
if (float) {
|
969
|
-
imageStyle.float = float;
|
970
|
-
}
|
971
|
-
// 【注意】void node 中,renderElem 不用处理 children 。core 会统一处理。
|
972
|
-
var vnode = jsx("img", { style: imageStyle, src: src, alt: alt, "data-href": href });
|
973
|
-
var isDisabled = editor.isDisabled();
|
974
|
-
if (selected && !isDisabled) {
|
975
|
-
// 选中,未禁用 - 渲染 resize container
|
976
|
-
return renderResizeContainer(editor, elemNode, vnode, { width: width, height: height, float: float });
|
977
|
-
}
|
978
|
-
// 其他,渲染普通 image container
|
979
|
-
return renderContainer(editor, elemNode, vnode, { width: width, height: height, float: float });
|
980
|
-
}
|
981
|
-
var renderImageConf = {
|
982
|
-
type: 'image', // 和 elemNode.type 一致
|
983
|
-
renderElem: renderImage,
|
984
|
-
};
|
985
|
-
|
986
|
-
/**
|
987
|
-
* @description module entry
|
988
|
-
* @author Yanghc
|
989
|
-
*/
|
990
|
-
var module = {
|
991
|
-
renderElems: [renderImageConf],
|
992
|
-
elemsToHtml: [conf],
|
993
|
-
parseElemsHtml: [parseHtmlConf],
|
994
|
-
menus: [imageFloatLeftMenuConf, imageFloatRightMenuConf, imageFloatNoneMenuConf],
|
995
|
-
};
|
996
|
-
|
997
|
-
/**
|
998
|
-
* @description src entry
|
999
|
-
* @author Yanghc
|
1000
|
-
*/
|
1001
|
-
|
1002
|
-
export { module as default };
|
1
|
+
import{i18nAddResources as t,DomEditor as r,SlateTransforms as n,t as e}from"@wangeditor-next/editor";import i,{css as o,append as u,prepend as f,addClass as a,removeClass as c,hasClass as l,on as s,off as v,focus as p,attr as d,removeAttr as h,hide as g,show as y,parents as m,dataset as b,val as w,text as x,html as O,children as S,remove as j,find as E,width as q,height as T,filter as P,empty as I}from"dom7";import{jsx as A}from"snabbdom";t("en",{float:{none:"Default",left:"Float Left",right:"Float Right"}}),t("zh-CN",{float:{none:"默认",left:"左浮动",right:"右浮动"}});var N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function C(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var M,R,F={};function _(){if(R)return M;R=1;var t=function(t){return t&&t.Math===Math&&t};return M=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof N&&N)||t("object"==typeof M&&M)||function(){return this}()||Function("return this")()}var k,D,z,L,Z,$,B,W,H={};function U(){return D?k:(D=1,k=function(t){try{return!!t()}catch(t){return!0}})}function G(){if(L)return z;L=1;var t=U();return z=!t((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function K(){if($)return Z;$=1;var t=U();return Z=!t((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))}function X(){if(W)return B;W=1;var t=K(),r=Function.prototype.call;return B=t?r.bind(r):function(){return r.apply(r,arguments)},B}var Y,V,J,Q,tt,rt,nt,et,it,ot,ut,ft,at,ct,lt,st,vt,pt,dt,ht,gt,yt,mt,bt,wt,xt,Ot,St,jt,Et,qt,Tt,Pt,It,At,Nt,Ct,Mt,Rt,Ft,_t,kt={};function Dt(){return J?V:(J=1,V=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}})}function zt(){if(tt)return Q;tt=1;var t=K(),r=Function.prototype,n=r.call,e=t&&r.bind.bind(n,n);return Q=t?e:function(t){return function(){return n.apply(t,arguments)}},Q}function Lt(){if(nt)return rt;nt=1;var t=zt(),r=t({}.toString),n=t("".slice);return rt=function(t){return n(r(t),8,-1)}}function Zt(){if(it)return et;it=1;var t=zt(),r=U(),n=Lt(),e=Object,i=t("".split);return et=r((function(){return!e("z").propertyIsEnumerable(0)}))?function(t){return"String"===n(t)?i(t,""):e(t)}:e}function $t(){return ut?ot:(ut=1,ot=function(t){return null==t})}function Bt(){if(at)return ft;at=1;var t=$t(),r=TypeError;return ft=function(n){if(t(n))throw new r("Can't call method on "+n);return n}}function Wt(){if(lt)return ct;lt=1;var t=Zt(),r=Bt();return ct=function(n){return t(r(n))}}function Ht(){if(vt)return st;vt=1;var t="object"==typeof document&&document.all;return st=void 0===t&&void 0!==t?function(r){return"function"==typeof r||r===t}:function(t){return"function"==typeof t}}function Ut(){if(dt)return pt;dt=1;var t=Ht();return pt=function(r){return"object"==typeof r?null!==r:t(r)}}function Gt(){if(gt)return ht;gt=1;var t=_(),r=Ht();return ht=function(n,e){return arguments.length<2?(i=t[n],r(i)?i:void 0):t[n]&&t[n][e];var i},ht}function Kt(){if(Ot)return xt;Ot=1;var t,r,n=_(),e=function(){if(wt)return bt;wt=1;var t=_().navigator,r=t&&t.userAgent;return bt=r?String(r):""}(),i=n.process,o=n.Deno,u=i&&i.versions||o&&o.version,f=u&&u.v8;return f&&(r=(t=f.split("."))[0]>0&&t[0]<4?1:+(t[0]+t[1])),!r&&e&&(!(t=e.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=e.match(/Chrome\/(\d+)/))&&(r=+t[1]),xt=r}function Xt(){if(jt)return St;jt=1;var t=Kt(),r=U(),n=_().String;return St=!!Object.getOwnPropertySymbols&&!r((function(){var r=Symbol("symbol detection");return!n(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&t&&t<41}))}function Yt(){if(qt)return Et;qt=1;var t=Xt();return Et=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function Vt(){if(Pt)return Tt;Pt=1;var t=Gt(),r=Ht(),n=function(){if(mt)return yt;mt=1;var t=zt();return yt=t({}.isPrototypeOf)}(),e=Yt(),i=Object;return Tt=e?function(t){return"symbol"==typeof t}:function(e){var o=t("Symbol");return r(o)&&n(o.prototype,i(e))}}function Jt(){if(At)return It;At=1;var t=String;return It=function(r){try{return t(r)}catch(t){return"Object"}}}function Qt(){if(Ct)return Nt;Ct=1;var t=Ht(),r=Jt(),n=TypeError;return Nt=function(e){if(t(e))return e;throw new n(r(e)+" is not a function")}}function tr(){if(Rt)return Mt;Rt=1;var t=Qt(),r=$t();return Mt=function(n,e){var i=n[e];return r(i)?void 0:t(i)}}function rr(){if(_t)return Ft;_t=1;var t=X(),r=Ht(),n=Ut(),e=TypeError;return Ft=function(i,o){var u,f;if("string"===o&&r(u=i.toString)&&!n(f=t(u,i)))return f;if(r(u=i.valueOf)&&!n(f=t(u,i)))return f;if("string"!==o&&r(u=i.toString)&&!n(f=t(u,i)))return f;throw new e("Can't convert object to primitive value")},Ft}var nr,er,ir,or,ur,fr,ar,cr,lr,sr,vr,pr,dr,hr,gr,yr,mr,br,wr,xr,Or,Sr,jr,Er,qr={exports:{}};function Tr(){if(or)return ir;or=1;var t=_(),r=Object.defineProperty;return ir=function(n,e){try{r(t,n,{value:e,configurable:!0,writable:!0})}catch(r){t[n]=e}return e}}function Pr(){if(ur)return qr.exports;ur=1;var t=er?nr:(er=1,nr=!1),r=_(),n=Tr(),e="__core-js_shared__",i=qr.exports=r[e]||n(e,{});return(i.versions||(i.versions=[])).push({version:"3.38.1",mode:t?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"}),qr.exports}function Ir(){if(ar)return fr;ar=1;var t=Pr();return fr=function(r,n){return t[r]||(t[r]=n||{})}}function Ar(){if(lr)return cr;lr=1;var t=Bt(),r=Object;return cr=function(n){return r(t(n))}}function Nr(){if(vr)return sr;vr=1;var t=zt(),r=Ar(),n=t({}.hasOwnProperty);return sr=Object.hasOwn||function(t,e){return n(r(t),e)}}function Cr(){if(dr)return pr;dr=1;var t=zt(),r=0,n=Math.random(),e=t(1..toString);return pr=function(t){return"Symbol("+(void 0===t?"":t)+")_"+e(++r+n,36)}}function Mr(){if(gr)return hr;gr=1;var t=_(),r=Ir(),n=Nr(),e=Cr(),i=Xt(),o=Yt(),u=t.Symbol,f=r("wks"),a=o?u.for||u:u&&u.withoutSetter||e;return hr=function(t){return n(f,t)||(f[t]=i&&n(u,t)?u[t]:a("Symbol."+t)),f[t]}}function Rr(){if(mr)return yr;mr=1;var t=X(),r=Ut(),n=Vt(),e=tr(),i=rr(),o=Mr(),u=TypeError,f=o("toPrimitive");return yr=function(o,a){if(!r(o)||n(o))return o;var c,l=e(o,f);if(l){if(void 0===a&&(a="default"),c=t(l,o,a),!r(c)||n(c))return c;throw new u("Can't convert object to primitive value")}return void 0===a&&(a="number"),i(o,a)}}function Fr(){if(wr)return br;wr=1;var t=Rr(),r=Vt();return br=function(n){var e=t(n,"string");return r(e)?e:e+""}}function _r(){if(Or)return xr;Or=1;var t=_(),r=Ut(),n=t.document,e=r(n)&&r(n.createElement);return xr=function(t){return e?n.createElement(t):{}}}function kr(){if(jr)return Sr;jr=1;var t=G(),r=U(),n=_r();return Sr=!t&&!r((function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a}))}function Dr(){if(Er)return H;Er=1;var t=G(),r=X(),n=function(){if(Y)return kt;Y=1;var t={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,n=r&&!t.call({1:2},1);return kt.f=n?function(t){var n=r(this,t);return!!n&&n.enumerable}:t,kt}(),e=Dt(),i=Wt(),o=Fr(),u=Nr(),f=kr(),a=Object.getOwnPropertyDescriptor;return H.f=t?a:function(t,c){if(t=i(t),c=o(c),f)try{return a(t,c)}catch(t){}if(u(t,c))return e(!r(n.f,t,c),t[c])},H}var zr,Lr,Zr,$r,Br,Wr,Hr,Ur={};function Gr(){if(Lr)return zr;Lr=1;var t=G(),r=U();return zr=t&&r((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))}function Kr(){if($r)return Zr;$r=1;var t=Ut(),r=String,n=TypeError;return Zr=function(e){if(t(e))return e;throw new n(r(e)+" is not an object")}}function Xr(){if(Br)return Ur;Br=1;var t=G(),r=kr(),n=Gr(),e=Kr(),i=Fr(),o=TypeError,u=Object.defineProperty,f=Object.getOwnPropertyDescriptor,a="enumerable",c="configurable",l="writable";return Ur.f=t?n?function(t,r,n){if(e(t),r=i(r),e(n),"function"==typeof t&&"prototype"===r&&"value"in n&&l in n&&!n[l]){var o=f(t,r);o&&o[l]&&(t[r]=n.value,n={configurable:c in n?n[c]:o[c],enumerable:a in n?n[a]:o[a],writable:!1})}return u(t,r,n)}:u:function(t,n,f){if(e(t),n=i(n),e(f),r)try{return u(t,n,f)}catch(t){}if("get"in f||"set"in f)throw new o("Accessors not supported");return"value"in f&&(t[n]=f.value),t},Ur}function Yr(){if(Hr)return Wr;Hr=1;var t=G(),r=Xr(),n=Dt();return Wr=t?function(t,e,i){return r.f(t,e,n(1,i))}:function(t,r,n){return t[r]=n,t}}var Vr,Jr,Qr,tn,rn,nn,en,on,un,fn,an,cn,ln,sn,vn,pn={exports:{}};function dn(){if(Jr)return Vr;Jr=1;var t=G(),r=Nr(),n=Function.prototype,e=t&&Object.getOwnPropertyDescriptor,i=r(n,"name"),o=i&&"something"===function(){}.name,u=i&&(!t||t&&e(n,"name").configurable);return Vr={EXISTS:i,PROPER:o,CONFIGURABLE:u}}function hn(){if(tn)return Qr;tn=1;var t=zt(),r=Ht(),n=Pr(),e=t(Function.toString);return r(n.inspectSource)||(n.inspectSource=function(t){return e(t)}),Qr=n.inspectSource}function gn(){if(on)return en;on=1;var t=Ir(),r=Cr(),n=t("keys");return en=function(t){return n[t]||(n[t]=r(t))}}function yn(){return fn?un:(fn=1,un={})}function mn(){if(cn)return an;cn=1;var t,r,n,e=function(){if(nn)return rn;nn=1;var t=_(),r=Ht(),n=t.WeakMap;return rn=r(n)&&/native code/.test(String(n))}(),i=_(),o=Ut(),u=Yr(),f=Nr(),a=Pr(),c=gn(),l=yn(),s="Object already initialized",v=i.TypeError,p=i.WeakMap;if(e||a.state){var d=a.state||(a.state=new p);d.get=d.get,d.has=d.has,d.set=d.set,t=function(t,r){if(d.has(t))throw new v(s);return r.facade=t,d.set(t,r),r},r=function(t){return d.get(t)||{}},n=function(t){return d.has(t)}}else{var h=c("state");l[h]=!0,t=function(t,r){if(f(t,h))throw new v(s);return r.facade=t,u(t,h,r),r},r=function(t){return f(t,h)?t[h]:{}},n=function(t){return f(t,h)}}return an={set:t,get:r,has:n,enforce:function(e){return n(e)?r(e):t(e,{})},getterFor:function(t){return function(n){var e;if(!o(n)||(e=r(n)).type!==t)throw new v("Incompatible receiver, "+t+" required");return e}}}}function bn(){if(ln)return pn.exports;ln=1;var t=zt(),r=U(),n=Ht(),e=Nr(),i=G(),o=dn().CONFIGURABLE,u=hn(),f=mn(),a=f.enforce,c=f.get,l=String,s=Object.defineProperty,v=t("".slice),p=t("".replace),d=t([].join),h=i&&!r((function(){return 8!==s((function(){}),"length",{value:8}).length})),g=String(String).split("String"),y=pn.exports=function(t,r,n){"Symbol("===v(l(r),0,7)&&(r="["+p(l(r),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(r="get "+r),n&&n.setter&&(r="set "+r),(!e(t,"name")||o&&t.name!==r)&&(i?s(t,"name",{value:r,configurable:!0}):t.name=r),h&&n&&e(n,"arity")&&t.length!==n.arity&&s(t,"length",{value:n.arity});try{n&&e(n,"constructor")&&n.constructor?i&&s(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var u=a(t);return e(u,"source")||(u.source=d(g,"string"==typeof r?r:"")),t};return Function.prototype.toString=y((function(){return n(this)&&c(this).source||u(this)}),"toString"),pn.exports}function wn(){if(vn)return sn;vn=1;var t=Ht(),r=Xr(),n=bn(),e=Tr();return sn=function(i,o,u,f){f||(f={});var a=f.enumerable,c=void 0!==f.name?f.name:o;if(t(u)&&n(u,c,f),f.global)a?i[o]=u:e(o,u);else{try{f.unsafe?i[o]&&(a=!0):delete i[o]}catch(t){}a?i[o]=u:r.f(i,o,{value:u,enumerable:!1,configurable:!f.nonConfigurable,writable:!f.nonWritable})}return i}}var xn,On,Sn,jn,En,qn,Tn,Pn,In,An,Nn,Cn,Mn,Rn,Fn,_n,kn,Dn={};function zn(){if(jn)return Sn;jn=1;var t=function(){if(On)return xn;On=1;var t=Math.ceil,r=Math.floor;return xn=Math.trunc||function(n){var e=+n;return(e>0?r:t)(e)}}();return Sn=function(r){var n=+r;return n!=n||0===n?0:t(n)}}function Ln(){if(qn)return En;qn=1;var t=zn(),r=Math.max,n=Math.min;return En=function(e,i){var o=t(e);return o<0?r(o+i,0):n(o,i)}}function Zn(){if(Pn)return Tn;Pn=1;var t=zn(),r=Math.min;return Tn=function(n){var e=t(n);return e>0?r(e,9007199254740991):0}}function $n(){if(An)return In;An=1;var t=Zn();return In=function(r){return t(r.length)}}function Bn(){if(Rn)return Mn;Rn=1;var t=zt(),r=Nr(),n=Wt(),e=function(){if(Cn)return Nn;Cn=1;var t=Wt(),r=Ln(),n=$n(),e=function(e){return function(i,o,u){var f=t(i),a=n(f);if(0===a)return!e&&-1;var c,l=r(u,a);if(e&&o!=o){for(;a>l;)if((c=f[l++])!=c)return!0}else for(;a>l;l++)if((e||l in f)&&f[l]===o)return e||l||0;return!e&&-1}};return Nn={includes:e(!0),indexOf:e(!1)}}().indexOf,i=yn(),o=t([].push);return Mn=function(t,u){var f,a=n(t),c=0,l=[];for(f in a)!r(i,f)&&r(a,f)&&o(l,f);for(;u.length>c;)r(a,f=u[c++])&&(~e(l,f)||o(l,f));return l}}function Wn(){return _n?Fn:(_n=1,Fn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var Hn,Un,Gn,Kn,Xn,Yn,Vn,Jn,Qn,te,re,ne,ee,ie,oe,ue,fe,ae,ce,le,se,ve,pe,de,he,ge,ye,me,be={};function we(){if(Gn)return Un;Gn=1;var t=Gt(),r=zt(),n=function(){if(kn)return Dn;kn=1;var t=Bn(),r=Wn().concat("length","prototype");return Dn.f=Object.getOwnPropertyNames||function(n){return t(n,r)},Dn}(),e=(Hn||(Hn=1,be.f=Object.getOwnPropertySymbols),be),i=Kr(),o=r([].concat);return Un=t("Reflect","ownKeys")||function(t){var r=n.f(i(t)),u=e.f;return u?o(r,u(t)):r}}function xe(){if(Xn)return Kn;Xn=1;var t=Nr(),r=we(),n=Dr(),e=Xr();return Kn=function(i,o,u){for(var f=r(o),a=e.f,c=n.f,l=0;l<f.length;l++){var s=f[l];t(i,s)||u&&t(u,s)||a(i,s,c(o,s))}}}function Oe(){if(Qn)return Jn;Qn=1;var t=_(),r=Dr().f,n=Yr(),e=wn(),i=Tr(),o=xe(),u=function(){if(Vn)return Yn;Vn=1;var t=U(),r=Ht(),n=/#|\.prototype\./,e=function(n,e){var a=o[i(n)];return a===f||a!==u&&(r(e)?t(e):!!e)},i=e.normalize=function(t){return String(t).replace(n,".").toLowerCase()},o=e.data={},u=e.NATIVE="N",f=e.POLYFILL="P";return Yn=e}();return Jn=function(f,a){var c,l,s,v,p,d=f.target,h=f.global,g=f.stat;if(c=h?t:g?t[d]||i(d,{}):t[d]&&t[d].prototype)for(l in a){if(v=a[l],s=f.dontCallGetSet?(p=r(c,l))&&p.value:c[l],!u(h?l:d+(g?".":"#")+l,f.forced)&&void 0!==s){if(typeof v==typeof s)continue;o(v,s)}(f.sham||s&&s.sham)&&n(v,"sham",!0),e(c,l,v,f)}}}function Se(){if(re)return te;re=1;var t=Lt();return te=Array.isArray||function(r){return"Array"===t(r)}}function je(){if(ee)return ne;ee=1;var t=TypeError;return ne=function(r){if(r>9007199254740991)throw t("Maximum allowed index exceeded");return r}}function Ee(){if(oe)return ie;oe=1;var t=G(),r=Xr(),n=Dt();return ie=function(e,i,o){t?r.f(e,i,n(0,o)):e[i]=o}}function qe(){if(fe)return ue;fe=1;var t={};return t[Mr()("toStringTag")]="z",ue="[object z]"===String(t)}function Te(){if(ce)return ae;ce=1;var t=qe(),r=Ht(),n=Lt(),e=Mr()("toStringTag"),i=Object,o="Arguments"===n(function(){return arguments}());return ae=t?n:function(t){var u,f,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(f=function(t,r){try{return t[r]}catch(t){}}(u=i(t),e))?f:o?n(u):"Object"===(a=n(u))&&r(u.callee)?"Arguments":a}}function Pe(){if(se)return le;se=1;var t=zt(),r=U(),n=Ht(),e=Te(),i=Gt(),o=hn(),u=function(){},f=i("Reflect","construct"),a=/^\s*(?:class|function)\b/,c=t(a.exec),l=!a.test(u),s=function(t){if(!n(t))return!1;try{return f(u,[],t),!0}catch(t){return!1}},v=function(t){if(!n(t))return!1;switch(e(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return l||!!c(a,o(t))}catch(t){return!0}};return v.sham=!0,le=!f||r((function(){var t;return s(s.call)||!s(Object)||!s((function(){t=!0}))||t}))?v:s}function Ie(){if(pe)return ve;pe=1;var t=Se(),r=Pe(),n=Ut(),e=Mr()("species"),i=Array;return ve=function(o){var u;return t(o)&&(u=o.constructor,(r(u)&&(u===i||t(u.prototype))||n(u)&&null===(u=u[e]))&&(u=void 0)),void 0===u?i:u}}function Ae(){if(he)return de;he=1;var t=Ie();return de=function(r,n){return new(t(r))(0===n?0:n)}}function Ne(){if(ye)return ge;ye=1;var t=U(),r=Mr(),n=Kt(),e=r("species");return ge=function(r){return n>=51||!t((function(){var t=[];return(t.constructor={})[e]=function(){return{foo:1}},1!==t[r](Boolean).foo}))}}!function(){if(me)return F;me=1;var t=Oe(),r=U(),n=Se(),e=Ut(),i=Ar(),o=$n(),u=je(),f=Ee(),a=Ae(),c=Ne(),l=Mr(),s=Kt(),v=l("isConcatSpreadable"),p=s>=51||!r((function(){var t=[];return t[v]=!1,t.concat()[0]!==t})),d=function(t){if(!e(t))return!1;var r=t[v];return void 0!==r?!!r:n(t)};t({target:"Array",proto:!0,arity:1,forced:!p||!c("concat")},{concat:function(t){var r,n,e,c,l,s=i(this),v=a(s,0),p=0;for(r=-1,e=arguments.length;r<e;r++)if(d(l=-1===r?s:arguments[r]))for(c=o(l),u(p+c),n=0;n<c;n++,p++)n in l&&f(v,p,l[n]);else u(p+1),f(v,p++,l);return v.length=p,v}})}();var Ce={type:"image",elemToHtml:function(t,r){var n=t,e=n.src,i=n.alt,o=void 0===i?"":i,u=n.href,f=void 0===u?"":u,a=n.style,c=void 0===a?{}:a,l=c.width,s=void 0===l?"":l,v=c.height,p=void 0===v?"":v,d=c.float,h=void 0===d?"":d,g="";return s&&(g+="width: ".concat(s,";")),p&&(g+="height: ".concat(p,";")),h&&(g+="float: ".concat(h,";")),'<img src="'.concat(e,'" alt="').concat(o,'" data-href="').concat(f,'" style="').concat(g,'"/>')}},Me=function(t,r){return Me=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])},Me(t,r)};function Re(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}Me(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var Fe=function(){return Fe=Object.assign||function(t){for(var r,n=1,e=arguments.length;n<e;n++)for(var i in r=arguments[n])Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i]);return t},Fe.apply(this,arguments)};function _e(t,r){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,i,o=n.call(t),u=[];try{for(;(void 0===r||r-- >0)&&!(e=o.next()).done;)u.push(e.value)}catch(t){i={error:t}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}function ke(t,r,n){if(n||2===arguments.length)for(var e,i=0,o=r.length;i<o;i++)!e&&i in r||(e||(e=Array.prototype.slice.call(r,0,i)),e[i]=r[i]);return t.concat(e||Array.prototype.slice.call(r))}"function"==typeof SuppressedError&&SuppressedError;var De,ze,Le,Ze,$e,Be,We={};function He(){if(ze)return De;ze=1;var t=Te(),r=String;return De=function(n){if("Symbol"===t(n))throw new TypeError("Cannot convert a Symbol value to a string");return r(n)}}function Ue(){if(Ze)return Le;Ze=1;var t=Kr();return Le=function(){var r=t(this),n="";return r.hasIndices&&(n+="d"),r.global&&(n+="g"),r.ignoreCase&&(n+="i"),r.multiline&&(n+="m"),r.dotAll&&(n+="s"),r.unicode&&(n+="u"),r.unicodeSets&&(n+="v"),r.sticky&&(n+="y"),n}}var Ge,Ke,Xe,Ye,Ve,Je,Qe,ti,ri,ni,ei,ii,oi,ui,fi={};function ai(){if(Ke)return Ge;Ke=1;var t=Bn(),r=Wn();return Ge=Object.keys||function(n){return t(n,r)}}function ci(){if(Ve)return Ye;Ve=1;var t=Gt();return Ye=t("document","documentElement")}function li(){if(Qe)return Je;Qe=1;var t,r=Kr(),n=function(){if(Xe)return fi;Xe=1;var t=G(),r=Gr(),n=Xr(),e=Kr(),i=Wt(),o=ai();return fi.f=t&&!r?Object.defineProperties:function(t,r){e(t);for(var u,f=i(r),a=o(r),c=a.length,l=0;c>l;)n.f(t,u=a[l++],f[u]);return t},fi}(),e=Wn(),i=yn(),o=ci(),u=_r(),f=gn(),a="prototype",c="script",l=f("IE_PROTO"),s=function(){},v=function(t){return"<"+c+">"+t+"</"+c+">"},p=function(t){t.write(v("")),t.close();var r=t.parentWindow.Object;return t=null,r},d=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var r,n,i;d="undefined"!=typeof document?document.domain&&t?p(t):(n=u("iframe"),i="java"+c+":",n.style.display="none",o.appendChild(n),n.src=String(i),(r=n.contentWindow.document).open(),r.write(v("document.F=Object")),r.close(),r.F):p(t);for(var f=e.length;f--;)delete d[a][e[f]];return d()};return i[l]=!0,Je=Object.create||function(t,e){var i;return null!==t?(s[a]=r(t),i=new s,s[a]=null,i[l]=t):i=d(),void 0===e?i:n.f(i,e)}}function si(){if(oi)return ii;oi=1;var t,r,n=X(),e=zt(),i=He(),o=Ue(),u=function(){if(Be)return $e;Be=1;var t=U(),r=_().RegExp,n=t((function(){var t=r("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),e=n||t((function(){return!r("a","y").sticky})),i=n||t((function(){var t=r("^r","gy");return t.lastIndex=2,null!==t.exec("str")}));return $e={BROKEN_CARET:i,MISSED_STICKY:e,UNSUPPORTED_Y:n}}(),f=Ir(),a=li(),c=mn().get,l=function(){if(ri)return ti;ri=1;var t=U(),r=_().RegExp;return ti=t((function(){var t=r(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))}(),s=function(){if(ei)return ni;ei=1;var t=U(),r=_().RegExp;return ni=t((function(){var t=r("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))}(),v=f("native-string-replace",String.prototype.replace),p=RegExp.prototype.exec,d=p,h=e("".charAt),g=e("".indexOf),y=e("".replace),m=e("".slice),b=(r=/b*/g,n(p,t=/a/,"a"),n(p,r,"a"),0!==t.lastIndex||0!==r.lastIndex),w=u.BROKEN_CARET,x=void 0!==/()??/.exec("")[1];return(b||x||w||l||s)&&(d=function(t){var r,e,u,f,l,s,O,S=this,j=c(S),E=i(t),q=j.raw;if(q)return q.lastIndex=S.lastIndex,r=n(d,q,E),S.lastIndex=q.lastIndex,r;var T=j.groups,P=w&&S.sticky,I=n(o,S),A=S.source,N=0,C=E;if(P&&(I=y(I,"y",""),-1===g(I,"g")&&(I+="g"),C=m(E,S.lastIndex),S.lastIndex>0&&(!S.multiline||S.multiline&&"\n"!==h(E,S.lastIndex-1))&&(A="(?: "+A+")",C=" "+C,N++),e=new RegExp("^(?:"+A+")",I)),x&&(e=new RegExp("^"+A+"$(?!\\s)",I)),b&&(u=S.lastIndex),f=n(p,P?e:S,C),P?f?(f.input=m(f.input,N),f[0]=m(f[0],N),f.index=S.lastIndex,S.lastIndex+=f[0].length):S.lastIndex=0:b&&f&&(S.lastIndex=S.global?f.index+f[0].length:u),x&&f&&f.length>1&&n(v,f[0],e,(function(){for(l=1;l<arguments.length-2;l++)void 0===arguments[l]&&(f[l]=void 0)})),f&&T)for(f.groups=s=a(null),l=0;l<T.length;l++)s[(O=T[l])[0]]=f[O[1]];return f}),ii=d}!function(){if(ui)return We;ui=1;var t=Oe(),r=si();t({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})}();var vi,pi,di,hi,gi,yi,mi,bi=function(){function t(){this.tag="button"}return t.prototype.getValue=function(t){return""},t.prototype.isActive=function(t){return!1},t.prototype.getSelectedNode=function(t){return r.getSelectedNodeByType(t,"image")},t.prototype.isDisabled=function(t){return null==t.selection||null==this.getSelectedNode(t)},t.prototype.exec=function(t,e){if(!this.isDisabled(t)){var i=this.getSelectedNode(t);if(null!=i){var o=r.getHoverbar(t);o&&o.hideAndClean();var u=i.style,f={style:Fe(Fe({},void 0===u?{}:u),{float:this.value})};n.setNodes(t,f,{match:function(t){return r.checkNodeType(t,"image")}})}}},t}(),wi=function(t){function r(){var r=t.apply(this,ke([],_e(arguments),!1))||this;return r.title=e("float.left"),r.value="left",r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M77.03514075 117.83964445m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.4275674l0 68.35162074q0 12.42756741-12.4275674 12.42756741l-845.0745837 0q-12.42756741 0-12.4275674-12.42756741l0-68.35162074q0-12.42756741 12.4275674-12.4275674Z"></path><path d="M77.03514075 801.35585185m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.42756741l0 68.35162074q0 12.42756741-12.4275674 12.42756742l-845.0745837 0q-12.42756741 0-12.4275674-12.42756742l0-68.35162074q0-12.42756741 12.4275674-12.42756741Z"></path><path d="M89.46270815 304.25315556h347.9718874c6.83516208 0 12.42756741 5.59240533 12.42756742 12.42756741v410.10972445a12.42756741 12.42756741 0 0 1-12.42756742 12.4275674h-347.9718874a12.42756741 12.42756741 0 0 1-12.4275674-12.4275674v-410.10972445c0-6.83516208 5.59240533-12.42756741 12.4275674-12.42756741z"></path><path d="M512 552.8045037m12.42756741 0l410.10972444 0q12.42756741 0 12.4275674 12.42756742l0 68.35162073q0 12.42756741-12.4275674 12.42756741l-410.10972444 0q-12.42756741 0-12.42756741-12.42756741l0-68.35162073q0-12.42756741 12.42756741-12.42756742Z"></path><path d="M512 366.39099259m12.42756741 0l410.10972444 0q12.42756741 0 12.4275674 12.42756741l0 68.35162075q0 12.42756741-12.4275674 12.4275674l-410.10972444 0q-12.42756741 0-12.42756741-12.4275674l0-68.35162075q0-12.42756741 12.42756741-12.42756741Z"></path></svg>',r}return Re(r,t),r}(bi),xi=function(t){function r(){var r=t.apply(this,ke([],_e(arguments),!1))||this;return r.title=e("float.none"),r.value="none",r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M76.73805432 117.83964445m12.42756741 0l845.0745837 0q12.42756741 0 12.42756741 12.4275674l0 68.35162074q0 12.42756741-12.42756741 12.42756741l-845.0745837 0q-12.42756741 0-12.42756741-12.42756741l0-68.35162074q0-12.42756741 12.42756741-12.4275674Z"></path><path d="M76.73805432 801.35585185m12.42756741 0l845.0745837 0q12.42756741 0 12.42756741 12.42756741l0 68.35162074q0 12.42756741-12.42756741 12.42756742l-845.0745837 0q-12.42756741 0-12.42756741-12.42756742l0-68.35162074q0-12.42756741 12.42756741-12.42756741Z"></path><path d="M89.16562173 304.25315556h410.10972444c6.83516208 0 12.42756741 5.59240533 12.42756741 12.42756741v410.10972445a12.42756741 12.42756741 0 0 1-12.42756741 12.4275674h-410.10972444a12.42756741 12.42756741 0 0 1-12.42756741-12.4275674v-410.10972445c0-6.83516208 5.59240533-12.42756741 12.42756741-12.42756741z"></path></svg>',r}return Re(r,t),r}(bi),Oi=function(t){function r(){var r=t.apply(this,ke([],_e(arguments),!1))||this;return r.title=e("float.right"),r.value="right",r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M77.03514075 117.83964445m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.4275674l0 68.35162074q0 12.42756741-12.4275674 12.42756741l-845.0745837 0q-12.42756741 0-12.4275674-12.42756741l0-68.35162074q0-12.42756741 12.4275674-12.4275674Z"></path><path d="M77.03514075 801.35585185m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.42756741l0 68.35162074q0 12.42756741-12.4275674 12.42756742l-845.0745837 0q-12.42756741 0-12.4275674-12.42756742l0-68.35162074q0-12.42756741 12.4275674-12.42756741Z"></path><path d="M586.56540445 304.25315556h347.9718874c6.83516208 0 12.42756741 5.59240533 12.4275674 12.42756741v410.10972445a12.42756741 12.42756741 0 0 1-12.4275674 12.4275674h-347.9718874a12.42756741 12.42756741 0 0 1-12.42756742-12.4275674v-410.10972445c0-6.83516208 5.59240533-12.42756741 12.42756742-12.42756741z"></path><path d="M77.03514075 552.8045037m12.4275674 0l410.10972444 0q12.42756741 0 12.42756741 12.42756742l0 68.35162073q0 12.42756741-12.42756741 12.42756741l-410.10972444 0q-12.42756741 0-12.4275674-12.42756741l0-68.35162073q0-12.42756741 12.4275674-12.42756742Z"></path><path d="M77.03514075 366.39099259m12.4275674 0l410.10972444 0q12.42756741 0 12.42756741 12.42756741l0 68.35162075q0 12.42756741-12.42756741 12.4275674l-410.10972444 0q-12.42756741 0-12.4275674-12.4275674l0-68.35162075q0-12.42756741 12.4275674-12.42756741Z"></path></svg>',r}return Re(r,t),r}(bi),Si={key:"imageFloatNone",factory:function(){return new xi}},ji={key:"imageFloatLeft",factory:function(){return new wi}},Ei={key:"imageFloatRight",factory:function(){return new Oi}},qi={};function Ti(){if(hi)return di;hi=1;var t=function(){if(pi)return vi;pi=1;var t=Lt(),r=zt();return vi=function(n){if("Function"===t(n))return r(n)}}(),r=Qt(),n=K(),e=t(t.bind);return di=function(t,i){return r(t),void 0===i?t:n?e(t,i):function(){return t.apply(i,arguments)}},di}function Pi(){if(yi)return gi;yi=1;var t=Ti(),r=zt(),n=Zt(),e=Ar(),i=$n(),o=Ae(),u=r([].push),f=function(r){var f=1===r,a=2===r,c=3===r,l=4===r,s=6===r,v=7===r,p=5===r||s;return function(d,h,g,y){for(var m,b,w=e(d),x=n(w),O=i(x),S=t(h,g),j=0,E=y||o,q=f?E(d,O):a||v?E(d,0):void 0;O>j;j++)if((p||j in x)&&(b=S(m=x[j],j,w),r))if(f)q[j]=b;else if(b)switch(r){case 3:return!0;case 5:return m;case 6:return j;case 2:u(q,m)}else switch(r){case 4:return!1;case 7:u(q,m)}return s?-1:c||l?l:q}};return gi={forEach:f(0),map:f(1),filter:f(2),some:f(3),every:f(4),find:f(5),findIndex:f(6),filterReject:f(7)}}!function(){if(mi)return qi;mi=1;var t=Oe(),r=Pi().filter;t({target:"Array",proto:!0,forced:!Ne()("filter")},{filter:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})}();var Ii,Ai,Ni,Ci={};function Mi(){if(Ai)return Ii;Ai=1;var t=Mr(),r=li(),n=Xr().f,e=t("unscopables"),i=Array.prototype;return void 0===i[e]&&n(i,e,{configurable:!0,value:r(null)}),Ii=function(t){i[e][t]=!0}}!function(){if(Ni)return Ci;Ni=1;var t=Oe(),r=Pi().find,n=Mi(),e="find",i=!0;e in[]&&Array(1)[e]((function(){i=!1})),t({target:"Array",proto:!0,forced:i},{find:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),n(e)}();var Ri,Fi,_i,ki={};!function(){if(_i)return ki;_i=1;var t=qe(),r=wn(),n=function(){if(Fi)return Ri;Fi=1;var t=qe(),r=Te();return Ri=t?{}.toString:function(){return"[object "+r(this)+"]"}}();t||r(Object.prototype,"toString",n,{unsafe:!0})}();var Di,zi,Li,Zi,$i,Bi,Wi,Hi={};function Ui(){return zi?Di:(zi=1,Di="\t\n\v\f\r \u2028\u2029\ufeff")}!function(){if(Wi)return Hi;Wi=1;var t=Oe(),r=function(){if(Zi)return Li;Zi=1;var t=zt(),r=Bt(),n=He(),e=Ui(),i=t("".replace),o=RegExp("^["+e+"]+"),u=RegExp("(^|[^"+e+"])["+e+"]+$"),f=function(t){return function(e){var f=n(r(e));return 1&t&&(f=i(f,o,"")),2&t&&(f=i(f,u,"$1")),f}};return Li={start:f(1),end:f(2),trim:f(3)}}().trim,n=function(){if(Bi)return $i;Bi=1;var t=dn().PROPER,r=U(),n=Ui();return $i=function(e){return r((function(){return!!n[e]()||"
"!=="
"[e]()||t&&n[e].name!==e}))}}();t({target:"String",proto:!0,forced:n("trim")},{trim:function(){return r(this)}})}();var Gi,Ki,Xi={};function Yi(t,r){for(var n="",e=(t.attr("style")||"").split(";"),i=e.length,o=0;o<i;o+=1){var u=e[o];if(u){var f=u.split(":");f[0].trim()===r&&(n=f[1].trim())}}return n}Ki||(Ki=1,function(){if(Gi)return Xi;Gi=1;var t=Oe(),r=_();t({global:!0,forced:r.globalThis!==r},{globalThis:r})}()),o&&(i.fn.css=o),u&&(i.fn.append=u),f&&(i.fn.prepend=f),a&&(i.fn.addClass=a),c&&(i.fn.removeClass=c),l&&(i.fn.hasClass=l),s&&(i.fn.on=s),v&&(i.fn.off=v),p&&(i.fn.focus=p),d&&(i.fn.attr=d),h&&(i.fn.removeAttr=h),g&&(i.fn.hide=g),y&&(i.fn.show=y),m&&(i.fn.parents=m),b&&(i.fn.dataset=b),w&&(i.fn.val=w),x&&(i.fn.text=x),O&&(i.fn.html=O),S&&(i.fn.children=S),j&&(i.fn.remove=j),E&&(i.fn.find=E),q&&(i.fn.width=q),T&&(i.fn.height=T),P&&(i.fn.filter=P),I&&(i.fn.empty=I);var Vi,Ji,Qi,to,ro,no,eo,io={selector:"img:not([data-w-e-type])",parseElemHtml:function(t,r,n){var e=i(t),o=e.attr("data-href")||"";return o=decodeURIComponent(o),{type:"image",src:e.attr("src")||"",alt:e.attr("alt")||"",href:o,style:{width:Yi(e,"width"),height:Yi(e,"height"),float:Yi(e,"float")||""},width:e.attr("width")||"",height:e.attr("height")||"",children:[{text:""}]}}},oo={};function uo(){if(Ji)return Vi;Ji=1;var t=zt();return Vi=t(1..valueOf)}!function(){if(ro)return oo;ro=1;var t=Oe(),r=zt(),n=zn(),e=uo(),i=function(){if(to)return Qi;to=1;var t=zn(),r=He(),n=Bt(),e=RangeError;return Qi=function(i){var o=r(n(this)),u="",f=t(i);if(f<0||f===1/0)throw new e("Wrong number of repetitions");for(;f>0;(f>>>=1)&&(o+=o))1&f&&(u+=o);return u}}(),o=U(),u=RangeError,f=String,a=Math.floor,c=r(i),l=r("".slice),s=r(1..toFixed),v=function(t,r,n){return 0===r?n:r%2==1?v(t,r-1,n*t):v(t*t,r/2,n)},p=function(t,r,n){for(var e=-1,i=n;++e<6;)i+=r*t[e],t[e]=i%1e7,i=a(i/1e7)},d=function(t,r){for(var n=6,e=0;--n>=0;)e+=t[n],t[n]=a(e/r),e=e%r*1e7},h=function(t){for(var r=6,n="";--r>=0;)if(""!==n||0===r||0!==t[r]){var e=f(t[r]);n=""===n?e:n+c("0",7-e.length)+e}return n};t({target:"Number",proto:!0,forced:o((function(){return"0.000"!==s(8e-5,3)||"1"!==s(.9,0)||"1.25"!==s(1.255,2)||"1000000000000000128"!==s(0xde0b6b3a7640080,0)}))||!o((function(){s({})}))},{toFixed:function(t){var r,i,o,a,s=e(this),g=n(t),y=[0,0,0,0,0,0],m="",b="0";if(g<0||g>20)throw new u("Incorrect fraction digits");if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return f(s);if(s<0&&(m="-",s=-s),s>1e-21)if(i=(r=function(t){for(var r=0,n=t;n>=4096;)r+=12,n/=4096;for(;n>=2;)r+=1,n/=2;return r}(s*v(2,69,1))-69)<0?s*v(2,-r,1):s/v(2,r,1),i*=4503599627370496,(r=52-r)>0){for(p(y,0,i),o=g;o>=7;)p(y,1e7,0),o-=7;for(p(y,v(10,o,1),0),o=r-1;o>=23;)d(y,1<<23),o-=23;d(y,1<<o),p(y,1,1),d(y,2),b=h(y)}else p(y,0,i),p(y,1<<-r,0),b=h(y)+c("0",g);return b=g>0?m+((a=b.length)<=g?"0."+c("0",g-a)+b:l(b,0,a-g)+"."+l(b,a-g)):m+b}})}();var fo=function(){if(eo)return no;eo=1;var t="Expected a function",r=NaN,n="[object Symbol]",e=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,u=/^0o[0-7]+$/i,f=parseInt,a="object"==typeof N&&N&&N.Object===Object&&N,c="object"==typeof self&&self&&self.Object===Object&&self,l=a||c||Function("return this")(),s=Object.prototype.toString,v=Math.max,p=Math.min,d=function(){return l.Date.now()};function h(r,n,e){var i,o,u,f,a,c,l=0,s=!1,h=!1,m=!0;if("function"!=typeof r)throw new TypeError(t);function b(t){var n=i,e=o;return i=o=void 0,l=t,f=r.apply(e,n)}function w(t){var r=t-c;return void 0===c||r>=n||r<0||h&&t-l>=u}function x(){var t=d();if(w(t))return O(t);a=setTimeout(x,function(t){var r=n-(t-c);return h?p(r,u-(t-l)):r}(t))}function O(t){return a=void 0,m&&i?b(t):(i=o=void 0,f)}function S(){var t=d(),r=w(t);if(i=arguments,o=this,c=t,r){if(void 0===a)return function(t){return l=t,a=setTimeout(x,n),s?b(t):f}(c);if(h)return a=setTimeout(x,n),b(c)}return void 0===a&&(a=setTimeout(x,n)),f}return n=y(n)||0,g(e)&&(s=!!e.leading,u=(h="maxWait"in e)?v(y(e.maxWait)||0,n):u,m="trailing"in e?!!e.trailing:m),S.cancel=function(){void 0!==a&&clearTimeout(a),l=0,i=c=o=a=void 0},S.flush=function(){return void 0===a?f:O(d())},S}function g(t){var r=typeof t;return!!t&&("object"==r||"function"==r)}function y(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&s.call(t)==n}(t))return r;if(g(t)){var a="function"==typeof t.valueOf?t.valueOf():t;t=g(a)?a+"":a}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(e,"");var c=o.test(t);return c||u.test(t)?f(t.slice(2),c?2:8):i.test(t)?r:+t}return no=function(r,n,e){var i=!0,o=!0;if("function"!=typeof r)throw new TypeError(t);return g(e)&&(i="leading"in e?!!e.leading:i,o="trailing"in e?!!e.trailing:o),h(r,n,{leading:i,maxWait:n,trailing:o})}}(),ao=C(fo);function co(t,n){var e=r.findKey(t,n).id;return"w-e-image-container-".concat(e)}function lo(t,e,o,u){var f=i("body"),a=co(t,e),c=u.width,l=u.height,s=u.float,v=0,p=0,d=0,h=!1,g=null;var y=ao((function(t){t.preventDefault();var r=t.clientX,n=p+(h?v-r:r-v),e=d*(n/p);null!=g&&(n<=15||e<=15||(g.css("width","".concat(n,"px")),g.css("height","".concat(e,"px"))))}),100);function m(i){if(f.off("mousemove",y),null!=g){var o=g.width().toFixed(2),u=g.height().toFixed(2),a={style:Fe(Fe({},e.style),{width:"".concat(o,"px"),height:"".concat(u,"px")})};n.setNodes(t,a,{at:r.findPath(t,e)}),f.off("mouseup",m)}}function b(n){g=function(){var t=i("#".concat(a));if(0===t.length)throw new Error("Cannot find image container elem");return t}(),v=n;var e=g.find("img");if(0===e.length)throw new Error("Cannot find image elem");p=e.width(),d=e.height(),f.on("mousemove",y),f.on("mouseup",m);var o=r.getHoverbar(t);o&&o.hideAndClean()}var w={};return c&&(w.width=c),l&&(w.height=l),s&&(w.float=s),A("div",{id:a,style:w,className:"w-e-image-container w-e-selected-image-container",on:{mousedown:function(t){var r=i(t.target);r.hasClass("w-e-image-dragger")&&(t.preventDefault(),(r.hasClass("left-top")||r.hasClass("left-bottom"))&&(h=!0),b(t.clientX))}}},o,A("div",{className:"w-e-image-dragger left-top"}),A("div",{className:"w-e-image-dragger right-top"}),A("div",{className:"w-e-image-dragger left-bottom"}),A("div",{className:"w-e-image-dragger right-bottom"}))}var so={type:"image",renderElem:function(t,n,e){var i=t,o=i.src,u=i.alt,f=void 0===u?"":u,a=i.href,c=void 0===a?"":a,l=i.style,s=void 0===l?{}:l,v=s.width,p=void 0===v?"":v,d=s.height,h=void 0===d?"":d,g=s.float,y=r.isNodeSelected(e,t),m={};p&&(m.width="100%"),h&&(m.height="100%"),g&&(m.float=g);var b=A("img",{style:m,src:o,alt:f,"data-href":c}),w=e.isDisabled();return y&&!w?lo(e,t,b,{width:p,height:h,float:g}):function(t,r,n,e){var i=e.width,o=e.height,u=e.float,f={};i&&(f.width=i),o&&(f.height=o),u&&(f.float=u);var a=co(t,r);return A("div",{id:a,style:f,className:"w-e-image-container"},n)}(e,t,b,{width:p,height:h,float:g})}},vo={renderElems:[so],elemsToHtml:[Ce],parseElemsHtml:[io],menus:[ji,Ei,Si]};export{vo as default};
|
2
|
+
//# sourceMappingURL=index.mjs.map
|