yxuse 3.0.40 → 3.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.es5.js CHANGED
@@ -2,6 +2,9 @@ var __defProp = Object.defineProperty;
2
2
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
3
  var __hasOwnProp = Object.prototype.hasOwnProperty;
4
4
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __typeError = (msg) => {
6
+ throw TypeError(msg);
7
+ };
5
8
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
9
  var __spreadValues = (a, b) => {
7
10
  for (var prop in b || (b = {}))
@@ -14,23 +17,10 @@ var __spreadValues = (a, b) => {
14
17
  }
15
18
  return a;
16
19
  };
17
- var __publicField = (obj, key, value) => {
18
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
19
- return value;
20
- };
21
- var __accessCheck = (obj, member, msg) => {
22
- if (!member.has(obj))
23
- throw TypeError("Cannot " + msg);
24
- };
25
- var __privateGet = (obj, member, getter) => {
26
- __accessCheck(obj, member, "read from private field");
27
- return getter ? getter.call(obj) : member.get(obj);
28
- };
29
- var __privateAdd = (obj, member, value) => {
30
- if (member.has(obj))
31
- throw TypeError("Cannot add the same private member more than once");
32
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
33
- };
20
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
21
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
22
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
23
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
34
24
  var __async = (__this, __arguments, generator) => {
35
25
  return new Promise((resolve, reject) => {
36
26
  var fulfilled = (value) => {
@@ -154,32 +144,27 @@ function _extends() {
154
144
  return _extends.apply(this, arguments);
155
145
  }
156
146
  function _objectWithoutPropertiesLoose(source, excluded) {
157
- if (source == null)
158
- return {};
147
+ if (source == null) return {};
159
148
  var target = {};
160
149
  var sourceKeys = Object.keys(source);
161
150
  var key, i;
162
151
  for (i = 0; i < sourceKeys.length; i++) {
163
152
  key = sourceKeys[i];
164
- if (excluded.indexOf(key) >= 0)
165
- continue;
153
+ if (excluded.indexOf(key) >= 0) continue;
166
154
  target[key] = source[key];
167
155
  }
168
156
  return target;
169
157
  }
170
158
  function _objectWithoutProperties(source, excluded) {
171
- if (source == null)
172
- return {};
159
+ if (source == null) return {};
173
160
  var target = _objectWithoutPropertiesLoose(source, excluded);
174
161
  var key, i;
175
162
  if (Object.getOwnPropertySymbols) {
176
163
  var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
177
164
  for (i = 0; i < sourceSymbolKeys.length; i++) {
178
165
  key = sourceSymbolKeys[i];
179
- if (excluded.indexOf(key) >= 0)
180
- continue;
181
- if (!Object.prototype.propertyIsEnumerable.call(source, key))
182
- continue;
166
+ if (excluded.indexOf(key) >= 0) continue;
167
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
183
168
  target[key] = source[key];
184
169
  }
185
170
  }
@@ -208,8 +193,7 @@ function off(el, event, fn) {
208
193
  el.removeEventListener(event, fn, !IE11OrLess && captureMode);
209
194
  }
210
195
  function matches(el, selector) {
211
- if (!selector)
212
- return;
196
+ if (!selector) return;
213
197
  selector[0] === ">" && (selector = selector.substring(1));
214
198
  if (el) {
215
199
  try {
@@ -236,8 +220,7 @@ function closest(el, selector, ctx, includeCTX) {
236
220
  if (selector != null && (selector[0] === ">" ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
237
221
  return el;
238
222
  }
239
- if (el === ctx)
240
- break;
223
+ if (el === ctx) break;
241
224
  } while (el = getParentOrHost(el));
242
225
  }
243
226
  return null;
@@ -307,8 +290,7 @@ function getWindowScrollingElement() {
307
290
  }
308
291
  }
309
292
  function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
310
- if (!el.getBoundingClientRect && el !== window)
311
- return;
293
+ if (!el.getBoundingClientRect && el !== window) return;
312
294
  var elRect, top, left, bottom, right, height, width;
313
295
  if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
314
296
  elRect = el.getBoundingClientRect();
@@ -365,15 +347,11 @@ function isScrolledPast(el, elSide, parentSide) {
365
347
  var parent = getParentAutoScrollElement(el, true), elSideVal = getRect(el)[elSide];
366
348
  while (parent) {
367
349
  var parentSideVal = getRect(parent)[parentSide], visible = void 0;
368
- if (parentSide === "top" || parentSide === "left") {
350
+ {
369
351
  visible = elSideVal >= parentSideVal;
370
- } else {
371
- visible = elSideVal <= parentSideVal;
372
352
  }
373
- if (!visible)
374
- return parent;
375
- if (parent === getWindowScrollingElement())
376
- break;
353
+ if (!visible) return parent;
354
+ if (parent === getWindowScrollingElement()) break;
377
355
  parent = getParentAutoScrollElement(parent, false);
378
356
  }
379
357
  return false;
@@ -423,28 +401,23 @@ function getRelativeScrollOffset(el) {
423
401
  }
424
402
  function indexOfObject(arr, obj) {
425
403
  for (var i in arr) {
426
- if (!arr.hasOwnProperty(i))
427
- continue;
404
+ if (!arr.hasOwnProperty(i)) continue;
428
405
  for (var key in obj) {
429
- if (obj.hasOwnProperty(key) && obj[key] === arr[i][key])
430
- return Number(i);
406
+ if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
431
407
  }
432
408
  }
433
409
  return -1;
434
410
  }
435
411
  function getParentAutoScrollElement(el, includeSelf) {
436
- if (!el || !el.getBoundingClientRect)
437
- return getWindowScrollingElement();
412
+ if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
438
413
  var elem = el;
439
414
  var gotSelf = false;
440
415
  do {
441
416
  if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
442
417
  var elemCSS = css(elem);
443
418
  if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == "auto" || elemCSS.overflowX == "scroll") || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == "auto" || elemCSS.overflowY == "scroll")) {
444
- if (!elem.getBoundingClientRect || elem === document.body)
445
- return getWindowScrollingElement();
446
- if (gotSelf || includeSelf)
447
- return elem;
419
+ if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
420
+ if (gotSelf || includeSelf) return elem;
448
421
  gotSelf = true;
449
422
  }
450
423
  }
@@ -505,12 +478,10 @@ function AnimationStateManager() {
505
478
  return {
506
479
  captureAnimationState: function captureAnimationState() {
507
480
  animationStates = [];
508
- if (!this.options.animation)
509
- return;
481
+ if (!this.options.animation) return;
510
482
  var children = [].slice.call(this.el.children);
511
483
  children.forEach(function(child) {
512
- if (css(child, "display") === "none" || child === Sortable.ghost)
513
- return;
484
+ if (css(child, "display") === "none" || child === Sortable.ghost) return;
514
485
  animationStates.push({
515
486
  target: child,
516
487
  rect: getRect(child)
@@ -538,8 +509,7 @@ function AnimationStateManager() {
538
509
  var _this = this;
539
510
  if (!this.options.animation) {
540
511
  clearTimeout(animationCallbackId);
541
- if (typeof callback === "function")
542
- callback();
512
+ if (typeof callback === "function") callback();
543
513
  return;
544
514
  }
545
515
  var animating = false, animationTime = 0;
@@ -580,12 +550,10 @@ function AnimationStateManager() {
580
550
  });
581
551
  clearTimeout(animationCallbackId);
582
552
  if (!animating) {
583
- if (typeof callback === "function")
584
- callback();
553
+ if (typeof callback === "function") callback();
585
554
  } else {
586
555
  animationCallbackId = setTimeout(function() {
587
- if (typeof callback === "function")
588
- callback();
556
+ if (typeof callback === "function") callback();
589
557
  }, animationTime);
590
558
  }
591
559
  animationStates = [];
@@ -645,8 +613,7 @@ var PluginManager = {
645
613
  };
646
614
  var eventNameGlobal = eventName + "Global";
647
615
  plugins.forEach(function(plugin) {
648
- if (!sortable[plugin.pluginName])
649
- return;
616
+ if (!sortable[plugin.pluginName]) return;
650
617
  if (sortable[plugin.pluginName][eventNameGlobal]) {
651
618
  sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({
652
619
  sortable
@@ -662,8 +629,7 @@ var PluginManager = {
662
629
  initializePlugins: function initializePlugins(sortable, el, defaults2, options) {
663
630
  plugins.forEach(function(plugin) {
664
631
  var pluginName = plugin.pluginName;
665
- if (!sortable.options[pluginName] && !plugin.initializeByDefault)
666
- return;
632
+ if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
667
633
  var initialized = new plugin(sortable, el, sortable.options);
668
634
  initialized.sortable = sortable;
669
635
  initialized.options = sortable.options;
@@ -671,8 +637,7 @@ var PluginManager = {
671
637
  _extends(defaults2, initialized.defaults);
672
638
  });
673
639
  for (var option2 in sortable.options) {
674
- if (!sortable.options.hasOwnProperty(option2))
675
- continue;
640
+ if (!sortable.options.hasOwnProperty(option2)) continue;
676
641
  var modified = this.modifyOption(sortable, option2, sortable.options[option2]);
677
642
  if (typeof modified !== "undefined") {
678
643
  sortable.options[option2] = modified;
@@ -682,8 +647,7 @@ var PluginManager = {
682
647
  getEventProperties: function getEventProperties(name, sortable) {
683
648
  var eventProperties = {};
684
649
  plugins.forEach(function(plugin) {
685
- if (typeof plugin.eventProperties !== "function")
686
- return;
650
+ if (typeof plugin.eventProperties !== "function") return;
687
651
  _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
688
652
  });
689
653
  return eventProperties;
@@ -691,8 +655,7 @@ var PluginManager = {
691
655
  modifyOption: function modifyOption(sortable, name, value) {
692
656
  var modifiedValue;
693
657
  plugins.forEach(function(plugin) {
694
- if (!sortable[plugin.pluginName])
695
- return;
658
+ if (!sortable[plugin.pluginName]) return;
696
659
  if (plugin.optionListeners && typeof plugin.optionListeners[name] === "function") {
697
660
  modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
698
661
  }
@@ -703,8 +666,7 @@ var PluginManager = {
703
666
  function dispatchEvent(_ref) {
704
667
  var sortable = _ref.sortable, rootEl2 = _ref.rootEl, name = _ref.name, targetEl = _ref.targetEl, cloneEl2 = _ref.cloneEl, toEl = _ref.toEl, fromEl = _ref.fromEl, oldIndex2 = _ref.oldIndex, newIndex2 = _ref.newIndex, oldDraggableIndex2 = _ref.oldDraggableIndex, newDraggableIndex2 = _ref.newDraggableIndex, originalEvent = _ref.originalEvent, putSortable2 = _ref.putSortable, extraEventProperties = _ref.extraEventProperties;
705
668
  sortable = sortable || rootEl2 && rootEl2[expando];
706
- if (!sortable)
707
- return;
669
+ if (!sortable) return;
708
670
  var evt, options = sortable.options, onName = "on" + name.charAt(0).toUpperCase() + name.substr(1);
709
671
  if (window.CustomEvent && !IE11OrLess && !Edge) {
710
672
  evt = new CustomEvent(name, {
@@ -787,8 +749,7 @@ function _dispatchEvent(info) {
787
749
  }
788
750
  var dragEl, parentEl, ghostEl, rootEl, nextEl, lastDownEl, cloneEl, cloneHidden, oldIndex, newIndex, oldDraggableIndex, newDraggableIndex, activeGroup, putSortable, awaitingDragStarted = false, ignoreNextClick = false, sortables = [], tapEvt, touchEvt, lastDx, lastDy, tapDistanceLeft, tapDistanceTop, moved, lastTarget, lastDirection, pastFirstInvertThresh = false, isCircumstantialInvert = false, targetMoveDistance, ghostRelativeParent, ghostRelativeParentInitialScroll = [], _silent = false, savedInputChecked = [];
789
751
  var documentExists = typeof document !== "undefined", PositionGhostAbsolutely = IOS, CSSFloatProperty = Edge || IE11OrLess ? "cssFloat" : "float", supportDraggable = documentExists && !ChromeForAndroid && !IOS && "draggable" in document.createElement("div"), supportCssPointerEvents = function() {
790
- if (!documentExists)
791
- return;
752
+ if (!documentExists) return;
792
753
  if (IE11OrLess) {
793
754
  return false;
794
755
  }
@@ -815,8 +776,7 @@ var documentExists = typeof document !== "undefined", PositionGhostAbsolutely =
815
776
  var ret;
816
777
  sortables.some(function(sortable) {
817
778
  var threshold = sortable[expando].options.emptyInsertThreshold;
818
- if (!threshold || lastChild(sortable))
819
- return;
779
+ if (!threshold || lastChild(sortable)) return;
820
780
  var rect = getRect(sortable), insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold, insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
821
781
  if (insideHorizontally && insideVertically) {
822
782
  return ret = sortable;
@@ -988,8 +948,7 @@ Sortable.prototype = /** @lends Sortable.prototype */
988
948
  return typeof this.options.direction === "function" ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
989
949
  },
990
950
  _onTapStart: function _onTapStart(evt) {
991
- if (!evt.cancelable)
992
- return;
951
+ if (!evt.cancelable) return;
993
952
  var _this = this, el = this.el, options = this.options, preventOnFilter = options.preventOnFilter, type = evt.type, touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === "touch" && evt, target = (touch || evt).target, originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target, filter = options.filter;
994
953
  _saveInputCheckedState(el);
995
954
  if (dragEl) {
@@ -1208,8 +1167,7 @@ Sortable.prototype = /** @lends Sortable.prototype */
1208
1167
  var parent = target;
1209
1168
  while (target && target.shadowRoot) {
1210
1169
  target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
1211
- if (target === parent)
1212
- break;
1170
+ if (target === parent) break;
1213
1171
  parent = target;
1214
1172
  }
1215
1173
  dragEl.parentNode[expando]._isOutsideThisEl(target);
@@ -1277,8 +1235,7 @@ Sortable.prototype = /** @lends Sortable.prototype */
1277
1235
  ghostRelativeParent = ghostRelativeParent.parentNode;
1278
1236
  }
1279
1237
  if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
1280
- if (ghostRelativeParent === document)
1281
- ghostRelativeParent = getWindowScrollingElement();
1238
+ if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
1282
1239
  rect.top += ghostRelativeParent.scrollTop;
1283
1240
  rect.left += ghostRelativeParent.scrollLeft;
1284
1241
  } else {
@@ -1330,8 +1287,7 @@ Sortable.prototype = /** @lends Sortable.prototype */
1330
1287
  }
1331
1288
  _this.cloneId = _nextTick(function() {
1332
1289
  pluginEvent2("clone", _this);
1333
- if (Sortable.eventCanceled)
1334
- return;
1290
+ if (Sortable.eventCanceled) return;
1335
1291
  if (!_this.options.removeCloneOnHide) {
1336
1292
  rootEl.insertBefore(cloneEl, dragEl);
1337
1293
  }
@@ -1367,8 +1323,7 @@ Sortable.prototype = /** @lends Sortable.prototype */
1367
1323
  // Returns true - if no further action is needed (either inserted or another condition)
1368
1324
  _onDragOver: function _onDragOver(evt) {
1369
1325
  var el = this.el, target = evt.target, dragRect, targetRect, revert, options = this.options, group = options.group, activeSortable = Sortable.active, isOwner = activeGroup === group, canSort = options.sort, fromSortable = putSortable || activeSortable, vertical, _this = this, completedFired = false;
1370
- if (_silent)
1371
- return;
1326
+ if (_silent) return;
1372
1327
  function dragOverEvent(name, extra) {
1373
1328
  pluginEvent2(name, _this, _objectSpread2({
1374
1329
  evt,
@@ -1452,8 +1407,7 @@ Sortable.prototype = /** @lends Sortable.prototype */
1452
1407
  }
1453
1408
  target = closest(target, options.draggable, el, true);
1454
1409
  dragOverEvent("dragOver");
1455
- if (Sortable.eventCanceled)
1456
- return completedFired;
1410
+ if (Sortable.eventCanceled) return completedFired;
1457
1411
  if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
1458
1412
  return completed(false);
1459
1413
  }
@@ -1462,8 +1416,7 @@ Sortable.prototype = /** @lends Sortable.prototype */
1462
1416
  vertical = this._getDirection(evt, target) === "vertical";
1463
1417
  dragRect = getRect(dragEl);
1464
1418
  dragOverEvent("dragOverValid");
1465
- if (Sortable.eventCanceled)
1466
- return completedFired;
1419
+ if (Sortable.eventCanceled) return completedFired;
1467
1420
  if (revert) {
1468
1421
  parentEl = rootEl;
1469
1422
  capture();
@@ -1832,8 +1785,7 @@ Sortable.prototype = /** @lends Sortable.prototype */
1832
1785
  _hideClone: function _hideClone() {
1833
1786
  if (!cloneHidden) {
1834
1787
  pluginEvent2("hideClone", this);
1835
- if (Sortable.eventCanceled)
1836
- return;
1788
+ if (Sortable.eventCanceled) return;
1837
1789
  css(cloneEl, "display", "none");
1838
1790
  if (this.options.removeCloneOnHide && cloneEl.parentNode) {
1839
1791
  cloneEl.parentNode.removeChild(cloneEl);
@@ -1848,8 +1800,7 @@ Sortable.prototype = /** @lends Sortable.prototype */
1848
1800
  }
1849
1801
  if (cloneHidden) {
1850
1802
  pluginEvent2("showClone", this);
1851
- if (Sortable.eventCanceled)
1852
- return;
1803
+ if (Sortable.eventCanceled) return;
1853
1804
  if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {
1854
1805
  rootEl.insertBefore(cloneEl, dragEl);
1855
1806
  } else if (nextEl) {
@@ -2002,14 +1953,12 @@ Sortable.mount = function() {
2002
1953
  for (var _len = arguments.length, plugins2 = new Array(_len), _key = 0; _key < _len; _key++) {
2003
1954
  plugins2[_key] = arguments[_key];
2004
1955
  }
2005
- if (plugins2[0].constructor === Array)
2006
- plugins2 = plugins2[0];
1956
+ if (plugins2[0].constructor === Array) plugins2 = plugins2[0];
2007
1957
  plugins2.forEach(function(plugin) {
2008
1958
  if (!plugin.prototype || !plugin.prototype.constructor) {
2009
1959
  throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
2010
1960
  }
2011
- if (plugin.utils)
2012
- Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
1961
+ if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
2013
1962
  PluginManager.mount(plugin);
2014
1963
  });
2015
1964
  };
@@ -2117,8 +2066,7 @@ function clearPointerElemChangedInterval() {
2117
2066
  clearInterval(pointerElemChangedInterval);
2118
2067
  }
2119
2068
  var autoScroll = throttle(function(evt, options, rootEl2, isFallback) {
2120
- if (!options.scroll)
2121
- return;
2069
+ if (!options.scroll) return;
2122
2070
  var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, sens = options.scrollSensitivity, speed = options.scrollSpeed, winScroller = getWindowScrollingElement();
2123
2071
  var scrollThisInstance = false, scrollCustomFn;
2124
2072
  if (scrollRootEl !== rootEl2) {
@@ -2180,8 +2128,7 @@ var autoScroll = throttle(function(evt, options, rootEl2, isFallback) {
2180
2128
  }, 30);
2181
2129
  var drop = function drop2(_ref) {
2182
2130
  var originalEvent = _ref.originalEvent, putSortable2 = _ref.putSortable, dragEl2 = _ref.dragEl, activeSortable = _ref.activeSortable, dispatchSortableEvent = _ref.dispatchSortableEvent, hideGhostForTarget = _ref.hideGhostForTarget, unhideGhostForTarget = _ref.unhideGhostForTarget;
2183
- if (!originalEvent)
2184
- return;
2131
+ if (!originalEvent) return;
2185
2132
  var toSortable = putSortable2 || activeSortable;
2186
2133
  hideGhostForTarget();
2187
2134
  var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
@@ -2265,14 +2212,10 @@ function moveElement(movedEle) {
2265
2212
  const cy = e2.clientY;
2266
2213
  let dx = cx - deltaLeft;
2267
2214
  let dy = cy - deltaTop;
2268
- if (dx < 0)
2269
- dx = 0;
2270
- if (dy < 0)
2271
- dy = 0;
2272
- if (dx > document.body.clientWidth - movedEle.clientWidth)
2273
- dx = document.body.clientWidth - movedEle.clientWidth;
2274
- if (dy > document.body.clientHeight - movedEle.clientHeight)
2275
- dy = document.body.clientHeight - movedEle.clientHeight;
2215
+ if (dx < 0) dx = 0;
2216
+ if (dy < 0) dy = 0;
2217
+ if (dx > document.body.clientWidth - movedEle.clientWidth) dx = document.body.clientWidth - movedEle.clientWidth;
2218
+ if (dy > document.body.clientHeight - movedEle.clientHeight) dy = document.body.clientHeight - movedEle.clientHeight;
2276
2219
  movedEle.style.left = dx + "px";
2277
2220
  movedEle.style.top = dy + "px";
2278
2221
  };
@@ -2400,10 +2343,8 @@ var localforage$1 = { exports: {} };
2400
2343
  if (!n[o2]) {
2401
2344
  if (!t[o2]) {
2402
2345
  var a = typeof commonjsRequire == "function" && commonjsRequire;
2403
- if (!u && a)
2404
- return a(o2, true);
2405
- if (i)
2406
- return i(o2, true);
2346
+ if (!u && a) return a(o2, true);
2347
+ if (i) return i(o2, true);
2407
2348
  var f = new Error("Cannot find module '" + o2 + "'");
2408
2349
  throw f.code = "MODULE_NOT_FOUND", f;
2409
2350
  }
@@ -2416,8 +2357,7 @@ var localforage$1 = { exports: {} };
2416
2357
  return n[o2].exports;
2417
2358
  }
2418
2359
  var i = typeof commonjsRequire == "function" && commonjsRequire;
2419
- for (var o = 0; o < r.length; o++)
2420
- s(r[o]);
2360
+ for (var o = 0; o < r.length; o++) s(r[o]);
2421
2361
  return s;
2422
2362
  }({ 1: [function(_dereq_, module2, exports2) {
2423
2363
  (function(global) {
@@ -10070,10 +10010,8 @@ class Translate {
10070
10010
  }
10071
10011
  initTranslate(_0) {
10072
10012
  return __async(this, arguments, function* ({ to, systemKey, translateApiUrl }) {
10073
- if (to === "zh")
10074
- return;
10075
- if (to === "cht")
10076
- return this.handleTraditionalChinese();
10013
+ if (to === "zh") return;
10014
+ if (to === "cht") return this.handleTraditionalChinese();
10077
10015
  if (translateApiUrl) {
10078
10016
  this.translateApiUrl = translateApiUrl;
10079
10017
  }
@@ -10144,8 +10082,7 @@ class Translate {
10144
10082
  if (mutation.addedNodes.length > 0 && mutation.removedNodes.length > 0) {
10145
10083
  return this.addedNode(mutation);
10146
10084
  }
10147
- if (mutation.removedNodes.length > 0 && mutation.removedNodes[0].id !== "nprogress")
10148
- return;
10085
+ if (mutation.removedNodes.length > 0 && mutation.removedNodes[0].id !== "nprogress") return;
10149
10086
  this.addedNode(mutation);
10150
10087
  }
10151
10088
  //节点新增
@@ -10153,10 +10090,8 @@ class Translate {
10153
10090
  var _a, _b, _c;
10154
10091
  if (mutation.addedNodes.length > 0) {
10155
10092
  const tagName = mutation.target.tagName.toLowerCase();
10156
- if (excludeTag.includes(tagName))
10157
- return;
10158
- if (excludeTag.includes((_b = (_a = mutation.addedNodes[0]) == null ? void 0 : _a.tagName) == null ? void 0 : _b.toLowerCase()))
10159
- return;
10093
+ if (excludeTag.includes(tagName)) return;
10094
+ if (excludeTag.includes((_b = (_a = mutation.addedNodes[0]) == null ? void 0 : _a.tagName) == null ? void 0 : _b.toLowerCase())) return;
10160
10095
  const className = (_c = mutation.addedNodes[0]) == null ? void 0 : _c.className;
10161
10096
  const parentNodeValue = mutation.target.nodeValue;
10162
10097
  if (className && className !== "") {
@@ -10234,13 +10169,11 @@ class Translate {
10234
10169
  }
10235
10170
  //遍历节点
10236
10171
  traversingNode(originNode) {
10237
- if (!originNode)
10238
- return;
10172
+ if (!originNode) return;
10239
10173
  const processNode = (node2) => this.replaceTextByNode(node2);
10240
10174
  const walker = document.createTreeWalker(originNode, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, {
10241
10175
  acceptNode(node2) {
10242
- if (node2.tagName && node2.tagName.toLowerCase() === "svg")
10243
- return NodeFilter.FILTER_REJECT;
10176
+ if (node2.tagName && node2.tagName.toLowerCase() === "svg") return NodeFilter.FILTER_REJECT;
10244
10177
  processNode(node2);
10245
10178
  return NodeFilter.FILTER_SKIP;
10246
10179
  }
@@ -10273,8 +10206,7 @@ class Translate {
10273
10206
  }
10274
10207
  replaceInputValue(inputNode, key, isTranslate = false) {
10275
10208
  const value = inputNode[key];
10276
- if (!zhPattern.test(value))
10277
- return;
10209
+ if (!zhPattern.test(value)) return;
10278
10210
  if (this.yxI18nThesaurus[value]) {
10279
10211
  inputNode[key] = this.yxI18nThesaurus[value];
10280
10212
  } else {
@@ -10311,8 +10243,7 @@ class Translate {
10311
10243
  }
10312
10244
  }
10313
10245
  replaceValue(key, node, isTranslate = false) {
10314
- if (node[key] === "")
10315
- return;
10246
+ if (node[key] === "") return;
10316
10247
  const nodeValue = node[key].replace(/\s/g, "");
10317
10248
  if (this.yxI18nThesaurus[nodeValue]) {
10318
10249
  node[key] = this.yxI18nThesaurus[nodeValue];
@@ -10332,11 +10263,9 @@ class Translate {
10332
10263
  //等待本次同步后,收集未翻译的字符,去后端进行翻译
10333
10264
  translateUnknownWords(unknownWords, size) {
10334
10265
  return __async(this, null, function* () {
10335
- if (unknownWords.length == 0)
10336
- return;
10266
+ if (unknownWords.length == 0) return;
10337
10267
  const unknownWordsFilter = unknownWords.filter((item) => (item + "").trim() !== "");
10338
- if (unknownWordsFilter.length === 0)
10339
- return;
10268
+ if (unknownWordsFilter.length === 0) return;
10340
10269
  const words = Array.from(new Set(unknownWordsFilter));
10341
10270
  console.log("开始远程翻译", words.length + "个");
10342
10271
  console.log("需要替换的dom有", size);
@@ -10743,8 +10672,7 @@ const __default__ = {
10743
10672
  /** 点击悬浮球事件 */
10744
10673
  handlerClickTool(e) {
10745
10674
  const flag = this.mousePoint.x === e.screenX && this.mousePoint.y === e.screenY;
10746
- if (!flag)
10747
- return;
10675
+ if (!flag) return;
10748
10676
  this.switchStatus();
10749
10677
  this.getAllPosition();
10750
10678
  this.setPanel();
@@ -10770,14 +10698,10 @@ const __default__ = {
10770
10698
  const maxY = window.innerHeight - this.panelHeight;
10771
10699
  let x = this.toolPos.left + this.toolPos.width / 2 - this.panelWidth / 2;
10772
10700
  let y = this.toolPos.top + this.toolPos.height / 2 - this.panelHeight / 2;
10773
- if (x < minX)
10774
- x = minX;
10775
- if (y < minY)
10776
- y = minY;
10777
- if (x > maxX)
10778
- x = maxX - 40;
10779
- if (y > maxY)
10780
- y = maxY - 40;
10701
+ if (x < minX) x = minX;
10702
+ if (y < minY) y = minY;
10703
+ if (x > maxX) x = maxX - 40;
10704
+ if (y > maxY) y = maxY - 40;
10781
10705
  this.setPanelPosition(x, y);
10782
10706
  },
10783
10707
  /** 设置panel的位置 */
@@ -10898,7 +10822,6 @@ const install = (config2) => __async(void 0, null, function* () {
10898
10822
  new Toolbar({ theme: data, isRenderIssue: config2.isRenderIssue, isRenderLang: config2.isRenderLang });
10899
10823
  }
10900
10824
  let themeUrl = themeId ? (_a = data.find((item) => item.id === themeId)) == null ? void 0 : _a.themeUrl : "";
10901
- console.log(themeId, themeUrl);
10902
10825
  if (!themeId || !themeUrl) {
10903
10826
  const defaultTheme = data.find((item) => item.defaultTheme === 1);
10904
10827
  const theme3 = defaultTheme || data[0];
@@ -11020,8 +10943,7 @@ const getGroupColor = (groupName) => {
11020
10943
  };
11021
10944
  const findColorByTheme = (cssVarName, color) => {
11022
10945
  const cssVar = getCurThemeCssVar();
11023
- if (!cssVar["exclude"])
11024
- return null;
10946
+ if (!cssVar["exclude"]) return null;
11025
10947
  for (let id in cssVar["exclude"]) {
11026
10948
  const keys = cssVar["exclude"][id];
11027
10949
  for (let css2 of Object.keys(keys)) {
@@ -11037,7 +10959,6 @@ const findColorByTheme = (cssVarName, color) => {
11037
10959
  };
11038
10960
  const installCssVarInSystemTheme = (cssVar, className) => {
11039
10961
  const themeCssVar = cssVar || getCurThemeCssVar();
11040
- console.log("当前缓存中的主题是", themeCssVar["color"]);
11041
10962
  const cssText = () => {
11042
10963
  let cssText2 = ":root {\n";
11043
10964
  Object.keys(themeCssVar).forEach((classifyName) => {
Binary file