@m3e/core 1.1.11 → 1.2.0

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/dist/index.js CHANGED
@@ -409,7 +409,7 @@ function rotateArray(arr, offset) {
409
409
  return out;
410
410
  }
411
411
  function bestCircularShift(target, source) {
412
- const n = target.length;
412
+ const n = Math.min(source.length, target.length);
413
413
  let bestK = 0;
414
414
  let bestScore = Infinity;
415
415
  for (let k = 0; k < n; k++) {
@@ -3499,16 +3499,19 @@ function KeyboardClick(base, allowEnter = true) {
3499
3499
  }
3500
3500
  }
3501
3501
  __KeyboardClickMixin_keyPressed = new WeakMap(), __KeyboardClickMixin_keyDownHandler = new WeakMap(), __KeyboardClickMixin_keyUpHandler = new WeakMap(), __KeyboardClickMixin_focusOutHandler = new WeakMap(), __KeyboardClickMixin_instances = new WeakSet(), __KeyboardClickMixin_handleKeyDown = function __KeyboardClickMixin_handleKeyDown(e) {
3502
- if (e.defaultPrevented || e.target !== e.currentTarget || isDisabledMixin(this) && this.disabled || isDisabledInteractiveMixin(this) && this.disabledInteractive) {
3502
+ if (e.target !== e.currentTarget || isDisabledMixin(this) && this.disabled || isDisabledInteractiveMixin(this) && this.disabledInteractive) {
3503
+ __classPrivateFieldSet(this, __KeyboardClickMixin_keyPressed, false, "f");
3503
3504
  return;
3504
3505
  }
3505
3506
  if (e.key === " " || allowEnter && e.key === "Enter") {
3506
3507
  __classPrivateFieldSet(this, __KeyboardClickMixin_keyPressed, true, "f");
3507
3508
  }
3508
3509
  }, __KeyboardClickMixin_handleKeyUp = function __KeyboardClickMixin_handleKeyUp(e) {
3509
- if (e.defaultPrevented || e.target !== e.currentTarget || isDisabledMixin(this) && this.disabled || isDisabledInteractiveMixin(this) && this.disabledInteractive || !__classPrivateFieldGet(this, __KeyboardClickMixin_keyPressed, "f")) {
3510
+ if (e.target !== e.currentTarget || isDisabledMixin(this) && this.disabled || isDisabledInteractiveMixin(this) && this.disabledInteractive || !__classPrivateFieldGet(this, __KeyboardClickMixin_keyPressed, "f")) {
3511
+ __classPrivateFieldSet(this, __KeyboardClickMixin_keyPressed, false, "f");
3510
3512
  return;
3511
3513
  }
3514
+ __classPrivateFieldSet(this, __KeyboardClickMixin_keyPressed, false, "f");
3512
3515
  // NOTE: the dispatched click event will not be trusted since it is synthetic.
3513
3516
  this.dispatchEvent(new MouseEvent("click", {
3514
3517
  cancelable: true,