dynamic-marquee
Advanced tools
Comparing version 2.6.3 to 2.6.4
@@ -28,3 +28,3 @@ export as namespace DynamicMarquee; | ||
touching: Touching<TMetadata> | null; | ||
}) => Item | void | ||
}) => Item | void, | ||
): void; | ||
@@ -53,3 +53,3 @@ onItemRemoved(callback: ($el: HTMLElement) => void): void; | ||
buildersIn?: LoopBuilder[], | ||
seperatorBuilder?: LoopBuilder | null | ||
seperatorBuilder?: LoopBuilder | null, | ||
): LoopReturn; |
@@ -7,63 +7,54 @@ (function (global, factory) { | ||
function _classCallCheck(instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
} | ||
function _arrayLikeToArray(r, a) { | ||
(null == a || a > r.length) && (a = r.length); | ||
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; | ||
return n; | ||
} | ||
function _defineProperties(target, props) { | ||
for (var i = 0; i < props.length; i++) { | ||
var descriptor = props[i]; | ||
descriptor.enumerable = descriptor.enumerable || false; | ||
descriptor.configurable = true; | ||
if ("value" in descriptor) descriptor.writable = true; | ||
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); | ||
} | ||
function _arrayWithoutHoles(r) { | ||
if (Array.isArray(r)) return _arrayLikeToArray(r); | ||
} | ||
function _createClass(Constructor, protoProps, staticProps) { | ||
if (protoProps) _defineProperties(Constructor.prototype, protoProps); | ||
if (staticProps) _defineProperties(Constructor, staticProps); | ||
Object.defineProperty(Constructor, "prototype", { | ||
writable: false | ||
}); | ||
return Constructor; | ||
function _classCallCheck(a, n) { | ||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); | ||
} | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
function _defineProperties(e, r) { | ||
for (var t = 0; t < r.length; t++) { | ||
var o = r[t]; | ||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); | ||
} | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
function _createClass(e, r, t) { | ||
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { | ||
writable: !1 | ||
}), e; | ||
} | ||
function _iterableToArray(iter) { | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
function _iterableToArray(r) { | ||
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (typeof input !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (typeof res !== "object") return res; | ||
function _toConsumableArray(r) { | ||
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); | ||
} | ||
function _toPrimitive(t, r) { | ||
if ("object" != typeof t || !t) return t; | ||
var e = t[Symbol.toPrimitive]; | ||
if (void 0 !== e) { | ||
var i = e.call(t, r || "default"); | ||
if ("object" != typeof i) return i; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
return ("string" === r ? String : Number)(t); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return typeof key === "symbol" ? key : String(key); | ||
function _toPropertyKey(t) { | ||
var i = _toPrimitive(t, "string"); | ||
return "symbol" == typeof i ? i : i + ""; | ||
} | ||
function _unsupportedIterableToArray(r, a) { | ||
if (r) { | ||
if ("string" == typeof r) return _arrayLikeToArray(r, a); | ||
var t = {}.toString.call(r).slice(8, -1); | ||
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; | ||
} | ||
} | ||
@@ -112,3 +103,3 @@ /** | ||
function Boundary(_a) { | ||
var onEnter = _a.onEnter, onExit = _a.onExit; | ||
var _b = _a === void 0 ? {} : _a, onEnter = _b.onEnter, onExit = _b.onExit; | ||
this._execution = null; | ||
@@ -236,5 +227,5 @@ this.inBoundary = this.inBoundary.bind(this); | ||
}) : null; | ||
(_this$_observer = this._observer) === null || _this$_observer === void 0 ? void 0 : _this$_observer.observe($el); | ||
(_this$_observer = this._observer) === null || _this$_observer === void 0 || _this$_observer.observe($el); | ||
} | ||
_createClass(SizeWatcher, [{ | ||
return _createClass(SizeWatcher, [{ | ||
key: "getWidth", | ||
@@ -263,7 +254,6 @@ value: function getWidth() { | ||
var _this$_observer2; | ||
(_this$_observer2 = this._observer) === null || _this$_observer2 === void 0 ? void 0 : _this$_observer2.disconnect(); | ||
(_this$_observer2 = this._observer) === null || _this$_observer2 === void 0 || _this$_observer2.disconnect(); | ||
this._observer = null; | ||
} | ||
}]); | ||
return SizeWatcher; | ||
}(); | ||
@@ -301,3 +291,3 @@ | ||
} | ||
_createClass(Item, [{ | ||
return _createClass(Item, [{ | ||
key: "getSize", | ||
@@ -355,3 +345,2 @@ value: function getSize() { | ||
}]); | ||
return Item; | ||
}(); | ||
@@ -367,3 +356,3 @@ | ||
} | ||
_createClass(Slider, [{ | ||
return _createClass(Slider, [{ | ||
key: "setOffset", | ||
@@ -405,3 +394,2 @@ value: function setOffset(offset, rate, force) { | ||
}]); | ||
return Slider; | ||
}(); | ||
@@ -480,2 +468,3 @@ | ||
this._windowOffset = 0; | ||
this._resyncSlider = false; | ||
this._gapSize = 0; | ||
@@ -497,3 +486,5 @@ this._items = []; | ||
this._containerSizeWatcher.onSizeChange(function () { | ||
return _this._tickOnRaf(); | ||
// when the page zoom changes the slider transform transition behaves in a weird way so this resets it | ||
_this._resyncSlider = true; | ||
_this._tickOnRaf(); | ||
}); | ||
@@ -516,3 +507,3 @@ this.windowInverseSize = null; | ||
// You can return the item to append next | ||
_createClass(Marquee, [{ | ||
return _createClass(Marquee, [{ | ||
key: "onItemRequired", | ||
@@ -738,2 +729,3 @@ value: function onItemRequired(cb) { | ||
this._windowOffset = 0; | ||
this._resyncSlider = false; | ||
} | ||
@@ -791,3 +783,4 @@ }, { | ||
_this7._visible = visible; | ||
_this7._slider.setOffset(_this7._windowOffset * -1, _this7._rate, resynced || goneVisible); | ||
_this7._slider.setOffset(_this7._windowOffset * -1, _this7._rate, resynced || goneVisible || _this7._resyncSlider); | ||
_this7._resyncSlider = false; | ||
if (!_this7._correlation || _this7._correlation.rate !== _this7._rate) { | ||
@@ -913,3 +906,2 @@ _this7._correlation = { | ||
}]); | ||
return Marquee; | ||
}(); | ||
@@ -916,0 +908,0 @@ |
{ | ||
"name": "dynamic-marquee", | ||
"version": "2.6.3", | ||
"version": "2.6.4", | ||
"description": "A small library for creating marquees.", | ||
@@ -40,3 +40,3 @@ "main": "./dist/dynamic-marquee.js", | ||
"@rollup/plugin-babel": "^6.0.3", | ||
"@rollup/plugin-commonjs": "^24.0.1", | ||
"@rollup/plugin-commonjs": "^25.0.3", | ||
"@rollup/plugin-node-resolve": "^15.0.1", | ||
@@ -47,5 +47,5 @@ "@tjenkinson/boundary": "^2.0.0", | ||
"longest-common-substring": "0.0.1", | ||
"prettier": "^2.0.2", | ||
"prettier": "^3.0.0", | ||
"rollup": "^3.18.0" | ||
} | ||
} |
@@ -107,3 +107,3 @@ # Dynamic Marquee | ||
// the item it will be touching. | ||
// This can be used to determine if a separate should be added. | ||
// This can be used to determine if a separator should be added. | ||
// See loop.js for an example. | ||
@@ -110,0 +110,0 @@ return $item; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93023
1995