embla-carousel
Advanced tools
Comparing version 0.3.2 to 0.3.3
@@ -12,5 +12,3 @@ import { ChunkSize } from './chunkSize'; | ||
}; | ||
export declare function InfiniteShifter(params: Params): InfiniteShifter & { | ||
shiftAccordingTo: (parentLocation: Vector1D) => void; | ||
}; | ||
export declare function InfiniteShifter(params: Params): Readonly<InfiniteShifter>; | ||
export {}; |
152
lib/index.js
@@ -104,4 +104,2 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -112,3 +110,2 @@ value: true | ||
function Vector1D(value) { | ||
var self = {}; | ||
var state = { | ||
@@ -184,3 +181,3 @@ value: value | ||
return _extends(self, { | ||
var self = { | ||
add: add, | ||
@@ -198,3 +195,4 @@ addNumber: addNumber, | ||
subtractNumber: subtractNumber | ||
}); | ||
}; | ||
return Object.freeze(self); | ||
} | ||
@@ -240,4 +238,2 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -250,3 +246,2 @@ value: true | ||
function Direction(value) { | ||
var self = {}; | ||
var direction = vector1d_1.Vector1D(normalize(value)); | ||
@@ -268,6 +263,7 @@ | ||
return _extends(self, { | ||
var self = { | ||
get: direction.get, | ||
set: set | ||
}); | ||
}; | ||
return Object.freeze(self); | ||
} | ||
@@ -284,4 +280,2 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -292,3 +286,2 @@ value: true | ||
function EventStore() { | ||
var self = {}; | ||
var event = { | ||
@@ -314,6 +307,7 @@ listeners: [] | ||
return _extends(self, { | ||
var self = { | ||
add: add, | ||
removeAll: removeAll | ||
}); | ||
}; | ||
return Object.freeze(self); | ||
} | ||
@@ -355,3 +349,2 @@ | ||
var userOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var self = {}; | ||
var slider = {}; | ||
@@ -521,3 +514,3 @@ var elements = {}; | ||
return _extends(self, { | ||
var self = { | ||
destroy: destroy, | ||
@@ -533,3 +526,4 @@ getContainer: getContainer, | ||
resize: reActivate | ||
}); | ||
}; | ||
return Object.freeze(self); | ||
} | ||
@@ -739,4 +733,2 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -747,3 +739,2 @@ value: true | ||
function AlignSize(params) { | ||
var self = {}; | ||
var root = params.root, | ||
@@ -773,5 +764,6 @@ align = params.align; | ||
return _extends(self, { | ||
var self = { | ||
measure: measure | ||
}); | ||
}; | ||
return Object.freeze(self); | ||
} | ||
@@ -788,4 +780,2 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -796,3 +786,2 @@ value: true | ||
function Animation(callback) { | ||
var self = {}; | ||
var run = requestAnimationFrame.bind(window); | ||
@@ -823,7 +812,8 @@ var kill = cancelAnimationFrame.bind(window); | ||
return _extends(self, { | ||
var self = { | ||
proceed: ifAnimation(true, start), | ||
start: ifAnimation(false, start), | ||
stop: ifAnimation(true, stop) | ||
}); | ||
}; | ||
return Object.freeze(self); | ||
} | ||
@@ -840,4 +830,2 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -848,3 +836,2 @@ value: true | ||
function ChunkSize(root) { | ||
var self = {}; | ||
var size = { | ||
@@ -858,6 +845,7 @@ root: root | ||
return _extends(self, { | ||
getRoot: measure(size.root), | ||
var self = { | ||
getRoot: 100, | ||
measure: measure | ||
}); | ||
}; | ||
return Object.freeze(self); | ||
} | ||
@@ -874,4 +862,2 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -882,3 +868,2 @@ value: true | ||
function Counter(params) { | ||
var self = {}; | ||
var start = params.start, | ||
@@ -924,3 +909,3 @@ limit = params.limit, | ||
return _extends(self, { | ||
var self = { | ||
add: add, | ||
@@ -932,3 +917,4 @@ clone: clone, | ||
set: set | ||
}); | ||
}; | ||
return Object.freeze(self); | ||
} | ||
@@ -1109,4 +1095,2 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -1121,3 +1105,2 @@ value: true | ||
function InfiniteShifter(params) { | ||
var self = {}; | ||
var items = params.items, | ||
@@ -1220,5 +1203,6 @@ chunkSize = params.chunkSize, | ||
return _extends(self, { | ||
var self = { | ||
shiftAccordingTo: shiftAccordingTo | ||
}); | ||
}; | ||
return Object.freeze(self); | ||
} | ||
@@ -1235,4 +1219,2 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -1243,3 +1225,2 @@ value: true | ||
function Limit(params) { | ||
var self = {}; | ||
var low = params.low, | ||
@@ -1284,3 +1265,3 @@ high = params.high; | ||
return _extends(self, { | ||
var self = { | ||
constrain: constrain, | ||
@@ -1295,3 +1276,4 @@ high: high, | ||
} | ||
}); | ||
}; | ||
return Object.freeze(self); | ||
} | ||
@@ -1308,4 +1290,2 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -1322,3 +1302,2 @@ value: true | ||
function Mover(params) { | ||
var self = {}; | ||
var location = params.location, | ||
@@ -1379,3 +1358,3 @@ speed = params.speed, | ||
return _extends(self, { | ||
var self = { | ||
direction: direction, | ||
@@ -1390,3 +1369,4 @@ location: location, | ||
useSpeed: setSpeed | ||
}); | ||
}; | ||
return Object.freeze(self); | ||
} | ||
@@ -1403,4 +1383,2 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -1415,3 +1393,2 @@ value: true | ||
function Pointer(size) { | ||
var self = {}; | ||
var coords = { | ||
@@ -1434,3 +1411,3 @@ x: 'clientX', | ||
function readPoint(evt, axis) { | ||
function read(evt, axis) { | ||
var isMouse = pointer.isMouse; | ||
@@ -1444,3 +1421,3 @@ var c = coords[axis]; | ||
pointer.isMouse = !!evt.type.match(/mouse/); | ||
var point = readPoint(evt, 'x'); | ||
var point = read(evt, 'x'); | ||
startDrag.set(point); | ||
@@ -1453,3 +1430,3 @@ lastDrag.set(point); | ||
function move(evt) { | ||
var point = readPoint(evt, 'x'); | ||
var point = read(evt, 'x'); | ||
var time2 = new Date().getTime(); | ||
@@ -1482,3 +1459,3 @@ var time1 = pointer.trackTime; | ||
return _extends(self, { | ||
var self = { | ||
direction: direction, | ||
@@ -1490,5 +1467,6 @@ down: down, | ||
move: move, | ||
read: readPoint, | ||
read: read, | ||
up: up | ||
}); | ||
}; | ||
return Object.freeze(self); | ||
} | ||
@@ -1505,4 +1483,2 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -1515,3 +1491,2 @@ value: true | ||
function TargetFinder(params) { | ||
var self = {}; | ||
var location = params.location, | ||
@@ -1589,6 +1564,7 @@ diffDistances = params.diffDistances, | ||
return _extends(self, { | ||
var self = { | ||
byDistance: byDistance, | ||
byIndex: byIndex | ||
}); | ||
}; | ||
return Object.freeze(self); | ||
} | ||
@@ -1605,4 +1581,2 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -1613,3 +1587,2 @@ value: true | ||
function Translate(node) { | ||
var self = {}; | ||
var state = { | ||
@@ -1646,3 +1619,3 @@ translateType: 'x' | ||
return _extends(self, { | ||
var self = { | ||
to: to, | ||
@@ -1655,3 +1628,4 @@ use3d: function use3d() { | ||
} | ||
}); | ||
}; | ||
return Object.freeze(self); | ||
} | ||
@@ -1668,4 +1642,2 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -1678,3 +1650,2 @@ value: true | ||
function Traveller(params) { | ||
var self = {}; | ||
var index = params.index, | ||
@@ -1730,3 +1701,3 @@ findTarget = params.findTarget, | ||
return _extends(self, { | ||
var self = { | ||
toDistance: toDistance, | ||
@@ -1736,3 +1707,4 @@ toIndex: toIndex, | ||
toPrevious: toPrevious | ||
}); | ||
}; | ||
return Object.freeze(self); | ||
} | ||
@@ -1749,4 +1721,2 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -1757,3 +1727,2 @@ value: true | ||
function VectorBounds(params) { | ||
var self = {}; | ||
var limit = params.limit, | ||
@@ -1789,5 +1758,6 @@ location = params.location, | ||
return _extends(self, { | ||
var self = { | ||
constrain: constrain | ||
}); | ||
}; | ||
return Object.freeze(self); | ||
} | ||
@@ -1804,4 +1774,2 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -1812,3 +1780,2 @@ value: true | ||
function VectorLooper(params) { | ||
var self = {}; | ||
var limit = params.limit, | ||
@@ -1838,5 +1805,6 @@ location = params.location, | ||
return _extends(self, { | ||
var self = { | ||
loop: loop | ||
}); | ||
}; | ||
return Object.freeze(self); | ||
} | ||
@@ -1853,4 +1821,2 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -1861,3 +1827,2 @@ value: true | ||
function EventDispatcher() { | ||
var self = {}; | ||
var subscribers = { | ||
@@ -1893,7 +1858,8 @@ destroy: [], | ||
return _extends(self, { | ||
var self = { | ||
dispatch: dispatch, | ||
off: off, | ||
on: on | ||
}); | ||
}; | ||
return Object.freeze(self); | ||
} | ||
@@ -1900,0 +1866,0 @@ |
{ | ||
"name": "embla-carousel", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"author": "David Cetinkaya", | ||
@@ -5,0 +5,0 @@ "private": false, |
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
61070
1808