@thecb/components 11.1.2 → 11.1.3
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.cjs.js +116 -376
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +116 -376
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/card/Card.stories.js +9 -0
package/dist/index.cjs.js
CHANGED
|
@@ -236,58 +236,6 @@ function __rest(s, e) {
|
|
|
236
236
|
t[p[i]] = s[p[i]];
|
|
237
237
|
}
|
|
238
238
|
return t;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/*! *****************************************************************************
|
|
242
|
-
Copyright (c) Microsoft Corporation.
|
|
243
|
-
|
|
244
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
245
|
-
purpose with or without fee is hereby granted.
|
|
246
|
-
|
|
247
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
248
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
249
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
250
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
251
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
252
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
253
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
254
|
-
***************************************************************************** */
|
|
255
|
-
/* global Reflect, Promise */
|
|
256
|
-
|
|
257
|
-
var extendStatics$1 = function(d, b) {
|
|
258
|
-
extendStatics$1 = Object.setPrototypeOf ||
|
|
259
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
260
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
261
|
-
return extendStatics$1(d, b);
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
function __extends$1(d, b) {
|
|
265
|
-
extendStatics$1(d, b);
|
|
266
|
-
function __() { this.constructor = d; }
|
|
267
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
var __assign$1 = function() {
|
|
271
|
-
__assign$1 = Object.assign || function __assign(t) {
|
|
272
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
273
|
-
s = arguments[i];
|
|
274
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
275
|
-
}
|
|
276
|
-
return t;
|
|
277
|
-
};
|
|
278
|
-
return __assign$1.apply(this, arguments);
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
function __rest$1(s, e) {
|
|
282
|
-
var t = {};
|
|
283
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
284
|
-
t[p] = s[p];
|
|
285
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
286
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
287
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
288
|
-
t[p[i]] = s[p[i]];
|
|
289
|
-
}
|
|
290
|
-
return t;
|
|
291
239
|
}
|
|
292
240
|
|
|
293
241
|
function __spreadArrays() {
|
|
@@ -298,32 +246,6 @@ function __spreadArrays() {
|
|
|
298
246
|
return r;
|
|
299
247
|
}
|
|
300
248
|
|
|
301
|
-
/*! *****************************************************************************
|
|
302
|
-
Copyright (c) Microsoft Corporation.
|
|
303
|
-
|
|
304
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
305
|
-
purpose with or without fee is hereby granted.
|
|
306
|
-
|
|
307
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
308
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
309
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
310
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
311
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
312
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
313
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
314
|
-
***************************************************************************** */
|
|
315
|
-
|
|
316
|
-
var __assign$2 = function() {
|
|
317
|
-
__assign$2 = Object.assign || function __assign(t) {
|
|
318
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
319
|
-
s = arguments[i];
|
|
320
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
321
|
-
}
|
|
322
|
-
return t;
|
|
323
|
-
};
|
|
324
|
-
return __assign$2.apply(this, arguments);
|
|
325
|
-
};
|
|
326
|
-
|
|
327
249
|
var clamp = function (min, max) { return function (v) {
|
|
328
250
|
return Math.max(Math.min(v, max), min);
|
|
329
251
|
}; };
|
|
@@ -337,8 +259,8 @@ var number = {
|
|
|
337
259
|
parse: parseFloat,
|
|
338
260
|
transform: function (v) { return v; }
|
|
339
261
|
};
|
|
340
|
-
var alpha = __assign
|
|
341
|
-
var scale = __assign
|
|
262
|
+
var alpha = __assign(__assign({}, number), { transform: clamp(0, 1) });
|
|
263
|
+
var scale = __assign(__assign({}, number), { default: 1 });
|
|
342
264
|
|
|
343
265
|
var createUnitType = function (unit) { return ({
|
|
344
266
|
test: function (v) {
|
|
@@ -352,7 +274,7 @@ var percent = createUnitType('%');
|
|
|
352
274
|
var px = createUnitType('px');
|
|
353
275
|
var vh = createUnitType('vh');
|
|
354
276
|
var vw = createUnitType('vw');
|
|
355
|
-
var progressPercentage = __assign
|
|
277
|
+
var progressPercentage = __assign(__assign({}, percent), { parse: function (v) { return percent.parse(v) / 100; }, transform: function (v) { return percent.transform(v * 100); } });
|
|
356
278
|
|
|
357
279
|
var getValueFromFunctionString = function (value) {
|
|
358
280
|
return value.substring(value.indexOf('(') + 1, value.lastIndexOf(')'));
|
|
@@ -386,7 +308,7 @@ var hslaTemplate = function (_a) {
|
|
|
386
308
|
var hue = _a.hue, saturation = _a.saturation, lightness = _a.lightness, _b = _a.alpha, alpha = _b === void 0 ? 1 : _b;
|
|
387
309
|
return "hsla(" + hue + ", " + saturation + ", " + lightness + ", " + alpha + ")";
|
|
388
310
|
};
|
|
389
|
-
var rgbUnit = __assign
|
|
311
|
+
var rgbUnit = __assign(__assign({}, number), { transform: function (v) { return Math.round(clampRgbUnit(v)); } });
|
|
390
312
|
function isColorString(color, colorType) {
|
|
391
313
|
return color.startsWith(colorType) && singleColorRegex.test(color);
|
|
392
314
|
}
|
|
@@ -416,7 +338,7 @@ var hsla = {
|
|
|
416
338
|
});
|
|
417
339
|
}
|
|
418
340
|
};
|
|
419
|
-
var hex = __assign
|
|
341
|
+
var hex = __assign(__assign({}, rgba), { test: function (v) { return typeof v === 'string' && isColorString(v, '#'); }, parse: function (v) {
|
|
420
342
|
var r = '';
|
|
421
343
|
var g = '';
|
|
422
344
|
var b = '';
|
|
@@ -952,15 +874,15 @@ See the Apache Version 2.0 License for specific language governing permissions
|
|
|
952
874
|
and limitations under the License.
|
|
953
875
|
***************************************************************************** */
|
|
954
876
|
|
|
955
|
-
var __assign$
|
|
956
|
-
__assign$
|
|
877
|
+
var __assign$1 = function() {
|
|
878
|
+
__assign$1 = Object.assign || function __assign(t) {
|
|
957
879
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
958
880
|
s = arguments[i];
|
|
959
881
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
960
882
|
}
|
|
961
883
|
return t;
|
|
962
884
|
};
|
|
963
|
-
return __assign$
|
|
885
|
+
return __assign$1.apply(this, arguments);
|
|
964
886
|
};
|
|
965
887
|
|
|
966
888
|
var mixLinearColor = function (from, to, v) {
|
|
@@ -983,7 +905,7 @@ var mixColor = (function (from, to) {
|
|
|
983
905
|
invariant(fromColorType.transform === toColorType.transform, 'Both colors must be hex/RGBA, OR both must be HSLA.');
|
|
984
906
|
var fromColor = fromColorType.parse(from);
|
|
985
907
|
var toColor = toColorType.parse(to);
|
|
986
|
-
var blended = __assign$
|
|
908
|
+
var blended = __assign$1({}, fromColor);
|
|
987
909
|
var mixFunc = fromColorType === hsla ? mix : mixLinearColor;
|
|
988
910
|
return function (v) {
|
|
989
911
|
for (var key in blended) {
|
|
@@ -1028,7 +950,7 @@ var mixArray = function (from, to) {
|
|
|
1028
950
|
};
|
|
1029
951
|
};
|
|
1030
952
|
var mixObject = function (origin, target) {
|
|
1031
|
-
var output = __assign$
|
|
953
|
+
var output = __assign$1({}, origin, target);
|
|
1032
954
|
var blendValue = {};
|
|
1033
955
|
for (var key in output) {
|
|
1034
956
|
if (origin[key] !== undefined && target[key] !== undefined) {
|
|
@@ -1240,44 +1162,6 @@ var wrap$1 = curryRange(wrap);
|
|
|
1240
1162
|
|
|
1241
1163
|
var clampProgress = clamp$1$1(0, 1);
|
|
1242
1164
|
|
|
1243
|
-
/*! *****************************************************************************
|
|
1244
|
-
Copyright (c) Microsoft Corporation.
|
|
1245
|
-
|
|
1246
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
1247
|
-
purpose with or without fee is hereby granted.
|
|
1248
|
-
|
|
1249
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1250
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1251
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1252
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1253
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1254
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1255
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
1256
|
-
***************************************************************************** */
|
|
1257
|
-
|
|
1258
|
-
var __assign$4 = function() {
|
|
1259
|
-
__assign$4 = Object.assign || function __assign(t) {
|
|
1260
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1261
|
-
s = arguments[i];
|
|
1262
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
1263
|
-
}
|
|
1264
|
-
return t;
|
|
1265
|
-
};
|
|
1266
|
-
return __assign$4.apply(this, arguments);
|
|
1267
|
-
};
|
|
1268
|
-
|
|
1269
|
-
function __rest$2(s, e) {
|
|
1270
|
-
var t = {};
|
|
1271
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1272
|
-
t[p] = s[p];
|
|
1273
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1274
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1275
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1276
|
-
t[p[i]] = s[p[i]];
|
|
1277
|
-
}
|
|
1278
|
-
return t;
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
1165
|
var createStyler = function (_a) {
|
|
1282
1166
|
var onRead = _a.onRead,
|
|
1283
1167
|
onRender = _a.onRender,
|
|
@@ -1289,7 +1173,7 @@ var createStyler = function (_a) {
|
|
|
1289
1173
|
if (_a === void 0) {
|
|
1290
1174
|
_a = {};
|
|
1291
1175
|
}
|
|
1292
|
-
var props = __rest
|
|
1176
|
+
var props = __rest(_a, []);
|
|
1293
1177
|
var state = {};
|
|
1294
1178
|
var changedValues = [];
|
|
1295
1179
|
var hasChanged = false;
|
|
@@ -1409,7 +1293,7 @@ function isTransformOriginProp(key) {
|
|
|
1409
1293
|
return transformOriginProps.has(key);
|
|
1410
1294
|
}
|
|
1411
1295
|
|
|
1412
|
-
var int = /*#__PURE__*/__assign
|
|
1296
|
+
var int = /*#__PURE__*/__assign( /*#__PURE__*/__assign({}, number), { transform: Math.round });
|
|
1413
1297
|
var valueTypes = {
|
|
1414
1298
|
color: color,
|
|
1415
1299
|
backgroundColor: color,
|
|
@@ -1641,8 +1525,8 @@ function createCssStyler(element, _a) {
|
|
|
1641
1525
|
}
|
|
1642
1526
|
var enableHardwareAcceleration = _a.enableHardwareAcceleration,
|
|
1643
1527
|
allowTransformNone = _a.allowTransformNone,
|
|
1644
|
-
props = __rest
|
|
1645
|
-
return cssStyler(__assign
|
|
1528
|
+
props = __rest(_a, ["enableHardwareAcceleration", "allowTransformNone"]);
|
|
1529
|
+
return cssStyler(__assign({ element: element, buildStyles: createStyleBuilder({
|
|
1646
1530
|
enableHardwareAcceleration: enableHardwareAcceleration,
|
|
1647
1531
|
allowTransformNone: allowTransformNone
|
|
1648
1532
|
}), preparseOutput: true }, props));
|
|
@@ -1692,7 +1576,7 @@ function buildSVGAttrs(_a, dimensions, totalPathLength, cssBuilder, attrs, isDas
|
|
|
1692
1576
|
pathSpacing = _b === void 0 ? 1 : _b,
|
|
1693
1577
|
_c = _a.pathOffset,
|
|
1694
1578
|
pathOffset = _c === void 0 ? 0 : _c,
|
|
1695
|
-
state = __rest
|
|
1579
|
+
state = __rest(_a, ["attrX", "attrY", "originX", "originY", "pathLength", "pathSpacing", "pathOffset"]);
|
|
1696
1580
|
var style = cssBuilder(state);
|
|
1697
1581
|
for (var key in style) {
|
|
1698
1582
|
if (key === 'transform') {
|
|
@@ -1821,7 +1705,7 @@ var Chainable = /*#__PURE__*/function () {
|
|
|
1821
1705
|
this.props = props;
|
|
1822
1706
|
}
|
|
1823
1707
|
Chainable.prototype.applyMiddleware = function (middleware) {
|
|
1824
|
-
return this.create(__assign
|
|
1708
|
+
return this.create(__assign(__assign({}, this.props), { middleware: this.props.middleware ? __spreadArrays([middleware], this.props.middleware) : [middleware] }));
|
|
1825
1709
|
};
|
|
1826
1710
|
Chainable.prototype.pipe = function () {
|
|
1827
1711
|
var funcs = [];
|
|
@@ -1893,7 +1777,7 @@ var createObserver = function (observerCandidate, _a, onComplete) {
|
|
|
1893
1777
|
};
|
|
1894
1778
|
|
|
1895
1779
|
var Action = /*#__PURE__*/function (_super) {
|
|
1896
|
-
__extends
|
|
1780
|
+
__extends(Action, _super);
|
|
1897
1781
|
function Action() {
|
|
1898
1782
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1899
1783
|
}
|
|
@@ -1912,13 +1796,13 @@ var Action = /*#__PURE__*/function (_super) {
|
|
|
1912
1796
|
};
|
|
1913
1797
|
var _a = this.props,
|
|
1914
1798
|
init = _a.init,
|
|
1915
|
-
observerProps = __rest
|
|
1799
|
+
observerProps = __rest(_a, ["init"]);
|
|
1916
1800
|
var observer = createObserver(observerCandidate, observerProps, function () {
|
|
1917
1801
|
isComplete = true;
|
|
1918
1802
|
subscription.stop();
|
|
1919
1803
|
});
|
|
1920
1804
|
var api = init(observer);
|
|
1921
|
-
subscription = api ? __assign
|
|
1805
|
+
subscription = api ? __assign(__assign({}, subscription), api) : subscription;
|
|
1922
1806
|
if (observerCandidate.registerParent) {
|
|
1923
1807
|
observerCandidate.registerParent(subscription);
|
|
1924
1808
|
}
|
|
@@ -1932,7 +1816,7 @@ var action = function (init) {
|
|
|
1932
1816
|
};
|
|
1933
1817
|
|
|
1934
1818
|
var BaseMulticast = /*#__PURE__*/function (_super) {
|
|
1935
|
-
__extends
|
|
1819
|
+
__extends(BaseMulticast, _super);
|
|
1936
1820
|
function BaseMulticast() {
|
|
1937
1821
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
1938
1822
|
_this.subscribers = [];
|
|
@@ -1992,7 +1876,7 @@ var isSingleValue = function (v) {
|
|
|
1992
1876
|
return typeOfV === 'string' || typeOfV === 'number';
|
|
1993
1877
|
};
|
|
1994
1878
|
var ValueReaction = /*#__PURE__*/function (_super) {
|
|
1995
|
-
__extends
|
|
1879
|
+
__extends(ValueReaction, _super);
|
|
1996
1880
|
function ValueReaction(props) {
|
|
1997
1881
|
var _this = _super.call(this, props) || this;
|
|
1998
1882
|
_this.scheduleVelocityCheck = function () {
|
|
@@ -2242,7 +2126,7 @@ var reduceArrayValue = function (i) {
|
|
|
2242
2126
|
var createArrayAction = function (action, props, vectorKeys) {
|
|
2243
2127
|
var firstVectorKey = vectorKeys[0];
|
|
2244
2128
|
var actionList = props[firstVectorKey].map(function (v, i) {
|
|
2245
|
-
var childActionProps = vectorKeys.reduce(reduceArrayValue(i), __assign
|
|
2129
|
+
var childActionProps = vectorKeys.reduce(reduceArrayValue(i), __assign({}, props));
|
|
2246
2130
|
return getActionCreator(v)(action, childActionProps);
|
|
2247
2131
|
});
|
|
2248
2132
|
return parallel$1.apply(void 0, actionList);
|
|
@@ -2256,7 +2140,7 @@ var reduceObjectValue = function (key) {
|
|
|
2256
2140
|
var createObjectAction = function (action, props, vectorKeys) {
|
|
2257
2141
|
var firstVectorKey = vectorKeys[0];
|
|
2258
2142
|
var actionMap = Object.keys(props[firstVectorKey]).reduce(function (map, key) {
|
|
2259
|
-
var childActionProps = vectorKeys.reduce(reduceObjectValue(key), __assign
|
|
2143
|
+
var childActionProps = vectorKeys.reduce(reduceObjectValue(key), __assign({}, props));
|
|
2260
2144
|
map[key] = getActionCreator(props[firstVectorKey][key])(action, childActionProps);
|
|
2261
2145
|
return map;
|
|
2262
2146
|
}, {});
|
|
@@ -2265,18 +2149,18 @@ var createObjectAction = function (action, props, vectorKeys) {
|
|
|
2265
2149
|
var createUnitAction = function (action, _a) {
|
|
2266
2150
|
var from = _a.from,
|
|
2267
2151
|
to = _a.to,
|
|
2268
|
-
props = __rest
|
|
2152
|
+
props = __rest(_a, ["from", "to"]);
|
|
2269
2153
|
var unitType = findUnitType(from) || findUnitType(to);
|
|
2270
2154
|
var transform = unitType.transform,
|
|
2271
2155
|
parse = unitType.parse;
|
|
2272
|
-
return action(__assign
|
|
2156
|
+
return action(__assign(__assign({}, props), { from: typeof from === 'string' ? parse(from) : from, to: typeof to === 'string' ? parse(to) : to })).pipe(transform);
|
|
2273
2157
|
};
|
|
2274
2158
|
var createMixerAction = function (mixer) {
|
|
2275
2159
|
return function (action, _a) {
|
|
2276
2160
|
var from = _a.from,
|
|
2277
2161
|
to = _a.to,
|
|
2278
|
-
props = __rest
|
|
2279
|
-
return action(__assign
|
|
2162
|
+
props = __rest(_a, ["from", "to"]);
|
|
2163
|
+
return action(__assign(__assign({}, props), { from: 0, to: 1 })).pipe(mixer(from, to));
|
|
2280
2164
|
};
|
|
2281
2165
|
};
|
|
2282
2166
|
var createColorAction = /*#__PURE__*/createMixerAction(mixColor);
|
|
@@ -2622,7 +2506,7 @@ var keyframes = function (_a) {
|
|
|
2622
2506
|
ease = _b === void 0 ? linear : _b,
|
|
2623
2507
|
times = _a.times,
|
|
2624
2508
|
values = _a.values,
|
|
2625
|
-
tweenProps = __rest
|
|
2509
|
+
tweenProps = __rest(_a, ["easings", "ease", "times", "values"]);
|
|
2626
2510
|
easings = Array.isArray(easings) ? easings : defaultEasings(values, easings);
|
|
2627
2511
|
times = times || defaultTimings(values);
|
|
2628
2512
|
var scrubbers = easings.map(function (easing, i) {
|
|
@@ -2632,7 +2516,7 @@ var keyframes = function (_a) {
|
|
|
2632
2516
|
ease: easing
|
|
2633
2517
|
});
|
|
2634
2518
|
});
|
|
2635
|
-
return tween(__assign
|
|
2519
|
+
return tween(__assign(__assign({}, tweenProps), { ease: ease })).applyMiddleware(function (update) {
|
|
2636
2520
|
return interpolateScrubbers(times, scrubbers, update);
|
|
2637
2521
|
});
|
|
2638
2522
|
};
|
|
@@ -2876,7 +2760,7 @@ var index$1 = function (_a) {
|
|
|
2876
2760
|
}
|
|
2877
2761
|
var x = _a.x,
|
|
2878
2762
|
y = _a.y,
|
|
2879
|
-
props = __rest
|
|
2763
|
+
props = __rest(_a, ["x", "y"]);
|
|
2880
2764
|
if (x !== undefined || y !== undefined) {
|
|
2881
2765
|
var applyXOffset_1 = applyOffset(x || 0);
|
|
2882
2766
|
var applyYOffset_1 = applyOffset(y || 0);
|
|
@@ -2950,7 +2834,7 @@ var steps$1 = function (st, min, max) {
|
|
|
2950
2834
|
};
|
|
2951
2835
|
var transformMap = function (childTransformers) {
|
|
2952
2836
|
return function (v) {
|
|
2953
|
-
var output = __assign
|
|
2837
|
+
var output = __assign({}, v);
|
|
2954
2838
|
for (var key in childTransformers) {
|
|
2955
2839
|
if (childTransformers.hasOwnProperty(key)) {
|
|
2956
2840
|
var childTransformer = childTransformers[key];
|
|
@@ -2981,52 +2865,6 @@ var transformers = /*#__PURE__*/Object.freeze({
|
|
|
2981
2865
|
transformMap: transformMap
|
|
2982
2866
|
});
|
|
2983
2867
|
|
|
2984
|
-
/*! *****************************************************************************
|
|
2985
|
-
Copyright (c) Microsoft Corporation.
|
|
2986
|
-
|
|
2987
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
2988
|
-
purpose with or without fee is hereby granted.
|
|
2989
|
-
|
|
2990
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2991
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2992
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2993
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2994
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2995
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2996
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
2997
|
-
***************************************************************************** */
|
|
2998
|
-
|
|
2999
|
-
var __assign$5 = function() {
|
|
3000
|
-
__assign$5 = Object.assign || function __assign(t) {
|
|
3001
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3002
|
-
s = arguments[i];
|
|
3003
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
3004
|
-
}
|
|
3005
|
-
return t;
|
|
3006
|
-
};
|
|
3007
|
-
return __assign$5.apply(this, arguments);
|
|
3008
|
-
};
|
|
3009
|
-
|
|
3010
|
-
function __rest$3(s, e) {
|
|
3011
|
-
var t = {};
|
|
3012
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3013
|
-
t[p] = s[p];
|
|
3014
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
3015
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
3016
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
3017
|
-
t[p[i]] = s[p[i]];
|
|
3018
|
-
}
|
|
3019
|
-
return t;
|
|
3020
|
-
}
|
|
3021
|
-
|
|
3022
|
-
function __spreadArrays$1() {
|
|
3023
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
3024
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
3025
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
3026
|
-
r[k] = a[j];
|
|
3027
|
-
return r;
|
|
3028
|
-
}
|
|
3029
|
-
|
|
3030
2868
|
var getPoseValues = function (_a) {
|
|
3031
2869
|
var transition = _a.transition,
|
|
3032
2870
|
flip = _a.flip,
|
|
@@ -3039,7 +2877,7 @@ var getPoseValues = function (_a) {
|
|
|
3039
2877
|
preTransition = _a.preTransition,
|
|
3040
2878
|
applyAtStart = _a.applyAtStart,
|
|
3041
2879
|
applyAtEnd = _a.applyAtEnd,
|
|
3042
|
-
props = __rest
|
|
2880
|
+
props = __rest(_a, ["transition", "flip", "delay", "delayChildren", "staggerChildren", "staggerDirection", "afterChildren", "beforeChildren", "preTransition", "applyAtStart", "applyAtEnd"]);
|
|
3043
2881
|
return props;
|
|
3044
2882
|
};
|
|
3045
2883
|
var selectPoses = function (_a) {
|
|
@@ -3051,7 +2889,7 @@ var selectPoses = function (_a) {
|
|
|
3051
2889
|
onChange = _a.onChange,
|
|
3052
2890
|
passive = _a.passive,
|
|
3053
2891
|
initialPose = _a.initialPose,
|
|
3054
|
-
poses = __rest
|
|
2892
|
+
poses = __rest(_a, ["label", "props", "values", "parentValues", "ancestorValues", "onChange", "passive", "initialPose"]);
|
|
3055
2893
|
return poses;
|
|
3056
2894
|
};
|
|
3057
2895
|
var selectAllValues = function (values, selectValue) {
|
|
@@ -3151,7 +2989,7 @@ var createPoseSetter = function (setterProps) {
|
|
|
3151
2989
|
var _a = nextProps.delay,
|
|
3152
2990
|
delay = _a === void 0 ? 0 : _a;
|
|
3153
2991
|
var hasChildren = children.size;
|
|
3154
|
-
var baseTransitionProps = __assign
|
|
2992
|
+
var baseTransitionProps = __assign(__assign({}, props), nextProps);
|
|
3155
2993
|
var nextPose = poses[next];
|
|
3156
2994
|
var getChildAnimations = function () {
|
|
3157
2995
|
return hasChildren && propagate ? startChildAnimations(children, next, nextPose, baseTransitionProps) : [];
|
|
@@ -3177,11 +3015,11 @@ var createPoseSetter = function (setterProps) {
|
|
|
3177
3015
|
valuePoses.splice(insertionIndex, 0, next);
|
|
3178
3016
|
return insertionIndex === 0 ? new Promise(function (complete) {
|
|
3179
3017
|
var value = values.get(key);
|
|
3180
|
-
var transitionProps = __assign
|
|
3018
|
+
var transitionProps = __assign(__assign({}, baseTransitionProps), { key: key,
|
|
3181
3019
|
value: value });
|
|
3182
3020
|
var target = resolveTarget(value, resolveProp(nextPose[key], transitionProps));
|
|
3183
3021
|
if (activeActions.has(key)) stopAction(activeActions.get(key));
|
|
3184
|
-
var resolveTransitionProps = __assign
|
|
3022
|
+
var resolveTransitionProps = __assign(__assign({ to: target }, transitionProps), getTransitionProps(value, target, transitionProps));
|
|
3185
3023
|
var transition = resolveTransition(getTransition, key, value, resolveTransitionProps, convertTransitionDefinition, getInstantTransition);
|
|
3186
3024
|
var poseDelay = delay || resolveProp(nextPose.delay, transitionProps);
|
|
3187
3025
|
if (poseDelay) {
|
|
@@ -3205,7 +3043,7 @@ var createPoseSetter = function (setterProps) {
|
|
|
3205
3043
|
});
|
|
3206
3044
|
}
|
|
3207
3045
|
}
|
|
3208
|
-
return Promise.all(__spreadArrays
|
|
3046
|
+
return Promise.all(__spreadArrays(getParentAnimations(), getChildAnimations()));
|
|
3209
3047
|
};
|
|
3210
3048
|
};
|
|
3211
3049
|
|
|
@@ -3331,7 +3169,7 @@ var createValueMap = function (props) {
|
|
|
3331
3169
|
};
|
|
3332
3170
|
|
|
3333
3171
|
var applyDefaultTransition = function (pose, key, defaultTransitions) {
|
|
3334
|
-
return __assign
|
|
3172
|
+
return __assign(__assign({}, pose), { transition: defaultTransitions.has(key) ? defaultTransitions.get(key) : defaultTransitions.get('default') });
|
|
3335
3173
|
};
|
|
3336
3174
|
var generateTransitions = function (poses, defaultTransitions) {
|
|
3337
3175
|
Object.keys(poses).forEach(function (key) {
|
|
@@ -3385,7 +3223,7 @@ var poseFactory = function (_a) {
|
|
|
3385
3223
|
var poses = generateTransitions(selectPoses(config), defaultTransitions);
|
|
3386
3224
|
var _b = config.props,
|
|
3387
3225
|
props = _b === void 0 ? {} : _b;
|
|
3388
|
-
if (getDefaultProps) props = __assign
|
|
3226
|
+
if (getDefaultProps) props = __assign(__assign({}, getDefaultProps(config)), props);
|
|
3389
3227
|
var passive = config.passive,
|
|
3390
3228
|
userSetValues = config.values,
|
|
3391
3229
|
_c = config.initialPose,
|
|
@@ -3460,10 +3298,10 @@ var poseFactory = function (_a) {
|
|
|
3460
3298
|
},
|
|
3461
3299
|
has: has,
|
|
3462
3300
|
setProps: function (newProps) {
|
|
3463
|
-
return state.props = __assign
|
|
3301
|
+
return state.props = __assign(__assign({}, state.props), newProps);
|
|
3464
3302
|
},
|
|
3465
3303
|
_addChild: function (childConfig, factory) {
|
|
3466
|
-
var child = factory(__assign
|
|
3304
|
+
var child = factory(__assign(__assign({ initialPose: initialPose }, childConfig), { ancestorValues: __spreadArrays([{ label: config.label, values: values }], ancestorValues) }));
|
|
3467
3305
|
children.add(child);
|
|
3468
3306
|
return child;
|
|
3469
3307
|
},
|
|
@@ -3502,18 +3340,18 @@ See the Apache Version 2.0 License for specific language governing permissions
|
|
|
3502
3340
|
and limitations under the License.
|
|
3503
3341
|
***************************************************************************** */
|
|
3504
3342
|
|
|
3505
|
-
var __assign$
|
|
3506
|
-
__assign$
|
|
3343
|
+
var __assign$2 = function () {
|
|
3344
|
+
__assign$2 = Object.assign || function __assign(t) {
|
|
3507
3345
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3508
3346
|
s = arguments[i];
|
|
3509
3347
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
3510
3348
|
}
|
|
3511
3349
|
return t;
|
|
3512
3350
|
};
|
|
3513
|
-
return __assign$
|
|
3351
|
+
return __assign$2.apply(this, arguments);
|
|
3514
3352
|
};
|
|
3515
3353
|
|
|
3516
|
-
function __rest$
|
|
3354
|
+
function __rest$1(s, e) {
|
|
3517
3355
|
var t = {};
|
|
3518
3356
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
3519
3357
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -3630,12 +3468,12 @@ var intelligentTransition = {
|
|
|
3630
3468
|
opacity: linearTween,
|
|
3631
3469
|
default: tween
|
|
3632
3470
|
};
|
|
3633
|
-
var dragAction = /*#__PURE__*/__assign$
|
|
3471
|
+
var dragAction = /*#__PURE__*/__assign$2( /*#__PURE__*/__assign$2({}, intelligentTransition), { x: /*#__PURE__*/createPointer(pointerX, 'left', 'right', BoundingBoxDimension.width), y: /*#__PURE__*/createPointer(pointerY, 'top', 'bottom', BoundingBoxDimension.height) });
|
|
3634
3472
|
var justAxis = function (_a) {
|
|
3635
3473
|
var from = _a.from;
|
|
3636
3474
|
return just(from);
|
|
3637
3475
|
};
|
|
3638
|
-
var intelligentDragEnd = /*#__PURE__*/__assign$
|
|
3476
|
+
var intelligentDragEnd = /*#__PURE__*/__assign$2( /*#__PURE__*/__assign$2({}, intelligentTransition), { x: justAxis, y: justAxis });
|
|
3639
3477
|
var defaultTransitions = /*#__PURE__*/new Map([['default', intelligentTransition], ['drag', dragAction], ['dragEnd', intelligentDragEnd]]);
|
|
3640
3478
|
|
|
3641
3479
|
var animationLookup = {
|
|
@@ -3705,7 +3543,7 @@ var getAction = function (v, _a, _b) {
|
|
|
3705
3543
|
var _c = _a.type,
|
|
3706
3544
|
type = _c === void 0 ? 'tween' : _c,
|
|
3707
3545
|
definedEase = _a.ease,
|
|
3708
|
-
def = __rest$
|
|
3546
|
+
def = __rest$1(_a, ["type", "ease"]);
|
|
3709
3547
|
invariant(animationLookup[type] !== undefined, "Invalid transition type '" + type + "'. Valid transition types are: tween, spring, decay, physics and keyframes.");
|
|
3710
3548
|
var ease;
|
|
3711
3549
|
if (type === 'tween') {
|
|
@@ -3730,7 +3568,7 @@ var getAction = function (v, _a, _b) {
|
|
|
3730
3568
|
velocity: velocity,
|
|
3731
3569
|
ease: ease
|
|
3732
3570
|
} : { ease: ease };
|
|
3733
|
-
return animationLookup[type](__assign$
|
|
3571
|
+
return animationLookup[type](__assign$2(__assign$2({}, baseProps), def));
|
|
3734
3572
|
};
|
|
3735
3573
|
var isAction = function (action$$1) {
|
|
3736
3574
|
return typeof action$$1.start !== 'undefined';
|
|
@@ -3815,7 +3653,7 @@ var pose = function (_a) {
|
|
|
3815
3653
|
min = def.min,
|
|
3816
3654
|
max = def.max,
|
|
3817
3655
|
round = def.round,
|
|
3818
|
-
remainingDef = __rest$
|
|
3656
|
+
remainingDef = __rest$1(def, ["delay", "min", "max", "round"]);
|
|
3819
3657
|
var action$$1 = getAction(val, remainingDef, props);
|
|
3820
3658
|
var outputPipe = [];
|
|
3821
3659
|
if (delay$$1) action$$1 = addActionDelay(delay$$1, action$$1);
|
|
@@ -3997,7 +3835,7 @@ var explicitlyFlipPose = function (state, nextPose) {
|
|
|
3997
3835
|
bottom = nextPose.bottom,
|
|
3998
3836
|
right = nextPose.right,
|
|
3999
3837
|
position = nextPose.position,
|
|
4000
|
-
remainingPose = __rest$
|
|
3838
|
+
remainingPose = __rest$1(nextPose, ["width", "height", "top", "left", "bottom", "right", "position"]);
|
|
4001
3839
|
var propsToSet = positionalProps.concat('position').reduce(function (acc, key) {
|
|
4002
3840
|
if (nextPose[key] !== undefined) {
|
|
4003
3841
|
acc[key] = resolveProp$1(nextPose[key], state.props);
|
|
@@ -4109,7 +3947,7 @@ var convertPositionalUnits = function (state, nextPose) {
|
|
|
4109
3947
|
changedPositionalKeys.push(key);
|
|
4110
3948
|
if (!applyAtEndHasBeenCopied) {
|
|
4111
3949
|
applyAtEndHasBeenCopied = true;
|
|
4112
|
-
nextPose.applyAtEnd = nextPose.applyAtEnd ? __assign$
|
|
3950
|
+
nextPose.applyAtEnd = nextPose.applyAtEnd ? __assign$2({}, nextPose.applyAtEnd) : {};
|
|
4113
3951
|
}
|
|
4114
3952
|
nextPose.applyAtEnd[key] = nextPose.applyAtEnd[key] || nextPose[key];
|
|
4115
3953
|
setValue(state, key, to);
|
|
@@ -4165,8 +4003,8 @@ var createPoseConfig = function (element, _a) {
|
|
|
4165
4003
|
focusable = _a.focusable,
|
|
4166
4004
|
pressable = _a.pressable,
|
|
4167
4005
|
dragBounds = _a.dragBounds,
|
|
4168
|
-
config = __rest$
|
|
4169
|
-
var poseConfig = __assign$
|
|
4006
|
+
config = __rest$1(_a, ["onDragStart", "onDragEnd", "onPressStart", "onPressEnd", "draggable", "hoverable", "focusable", "pressable", "dragBounds"]);
|
|
4007
|
+
var poseConfig = __assign$2(__assign$2({ flip: {} }, config), { props: __assign$2(__assign$2({}, config.props), { onDragStart: onDragStart,
|
|
4170
4008
|
onDragEnd: onDragEnd,
|
|
4171
4009
|
onPressStart: onPressStart,
|
|
4172
4010
|
onPressEnd: onPressEnd,
|
|
@@ -4180,8 +4018,8 @@ var createPoseConfig = function (element, _a) {
|
|
|
4180
4018
|
var _b = dragPoses(draggable),
|
|
4181
4019
|
drag = _b.drag,
|
|
4182
4020
|
dragEnd = _b.dragEnd;
|
|
4183
|
-
poseConfig.drag = __assign$
|
|
4184
|
-
poseConfig.dragEnd = __assign$
|
|
4021
|
+
poseConfig.drag = __assign$2(__assign$2({}, drag), poseConfig.drag);
|
|
4022
|
+
poseConfig.dragEnd = __assign$2(__assign$2({}, dragEnd), poseConfig.dragEnd);
|
|
4185
4023
|
}
|
|
4186
4024
|
return poseConfig;
|
|
4187
4025
|
};
|
|
@@ -4189,7 +4027,7 @@ var domPose = /*#__PURE__*/pose({
|
|
|
4189
4027
|
posePriority: ['drag', 'press', 'focus', 'hover'],
|
|
4190
4028
|
transformPose: function (_a, name, state) {
|
|
4191
4029
|
var flip = _a.flip,
|
|
4192
|
-
pose$$1 = __rest$
|
|
4030
|
+
pose$$1 = __rest$1(_a, ["flip"]);
|
|
4193
4031
|
if (isFlipPose(flip, name, state)) {
|
|
4194
4032
|
return flipPose(state, pose$$1);
|
|
4195
4033
|
} else if (isPositional(pose$$1)) {
|
|
@@ -4227,7 +4065,7 @@ var domPose = /*#__PURE__*/pose({
|
|
|
4227
4065
|
var props = _a.props,
|
|
4228
4066
|
activeActions = _a.activeActions;
|
|
4229
4067
|
var measure = props.dimensions.measure;
|
|
4230
|
-
var poserApi = __assign$
|
|
4068
|
+
var poserApi = __assign$2(__assign$2({}, api), { addChild: function (element, childConfig) {
|
|
4231
4069
|
return api._addChild(createPoseConfig(element, childConfig), domPose);
|
|
4232
4070
|
}, measure: measure, flip: function (op) {
|
|
4233
4071
|
if (op) {
|
|
@@ -7293,104 +7131,6 @@ var Imposter = function Imposter(_ref) {
|
|
|
7293
7131
|
}, rest), safeChildren(children, /*#__PURE__*/React__default.createElement(React.Fragment, null)));
|
|
7294
7132
|
};
|
|
7295
7133
|
|
|
7296
|
-
/*! *****************************************************************************
|
|
7297
|
-
Copyright (c) Microsoft Corporation.
|
|
7298
|
-
|
|
7299
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
7300
|
-
purpose with or without fee is hereby granted.
|
|
7301
|
-
|
|
7302
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
7303
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
7304
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
7305
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
7306
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
7307
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
7308
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
7309
|
-
***************************************************************************** */
|
|
7310
|
-
/* global Reflect, Promise */
|
|
7311
|
-
|
|
7312
|
-
var extendStatics$2 = function(d, b) {
|
|
7313
|
-
extendStatics$2 = Object.setPrototypeOf ||
|
|
7314
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
7315
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7316
|
-
return extendStatics$2(d, b);
|
|
7317
|
-
};
|
|
7318
|
-
|
|
7319
|
-
function __extends$2(d, b) {
|
|
7320
|
-
extendStatics$2(d, b);
|
|
7321
|
-
function __() { this.constructor = d; }
|
|
7322
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
7323
|
-
}
|
|
7324
|
-
|
|
7325
|
-
var __assign$7 = function() {
|
|
7326
|
-
__assign$7 = Object.assign || function __assign(t) {
|
|
7327
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
7328
|
-
s = arguments[i];
|
|
7329
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
7330
|
-
}
|
|
7331
|
-
return t;
|
|
7332
|
-
};
|
|
7333
|
-
return __assign$7.apply(this, arguments);
|
|
7334
|
-
};
|
|
7335
|
-
|
|
7336
|
-
function __rest$5(s, e) {
|
|
7337
|
-
var t = {};
|
|
7338
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
7339
|
-
t[p] = s[p];
|
|
7340
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7341
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7342
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
7343
|
-
t[p[i]] = s[p[i]];
|
|
7344
|
-
}
|
|
7345
|
-
return t;
|
|
7346
|
-
}
|
|
7347
|
-
|
|
7348
|
-
function __spreadArrays$2() {
|
|
7349
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
7350
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
7351
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
7352
|
-
r[k] = a[j];
|
|
7353
|
-
return r;
|
|
7354
|
-
}
|
|
7355
|
-
|
|
7356
|
-
/*! *****************************************************************************
|
|
7357
|
-
Copyright (c) Microsoft Corporation.
|
|
7358
|
-
|
|
7359
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
7360
|
-
purpose with or without fee is hereby granted.
|
|
7361
|
-
|
|
7362
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
7363
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
7364
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
7365
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
7366
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
7367
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
7368
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
7369
|
-
***************************************************************************** */
|
|
7370
|
-
|
|
7371
|
-
var __assign$8 = function() {
|
|
7372
|
-
__assign$8 = Object.assign || function __assign(t) {
|
|
7373
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
7374
|
-
s = arguments[i];
|
|
7375
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
7376
|
-
}
|
|
7377
|
-
return t;
|
|
7378
|
-
};
|
|
7379
|
-
return __assign$8.apply(this, arguments);
|
|
7380
|
-
};
|
|
7381
|
-
|
|
7382
|
-
function __rest$6(s, e) {
|
|
7383
|
-
var t = {};
|
|
7384
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
7385
|
-
t[p] = s[p];
|
|
7386
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7387
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7388
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
7389
|
-
t[p[i]] = s[p[i]];
|
|
7390
|
-
}
|
|
7391
|
-
return t;
|
|
7392
|
-
}
|
|
7393
|
-
|
|
7394
7134
|
var Observer$1 = /*#__PURE__*/function () {
|
|
7395
7135
|
function Observer(_a, observer) {
|
|
7396
7136
|
var _this = this;
|
|
@@ -7453,18 +7193,18 @@ var Action$1 = /*#__PURE__*/function () {
|
|
|
7453
7193
|
};
|
|
7454
7194
|
var _a = this.props,
|
|
7455
7195
|
init = _a.init,
|
|
7456
|
-
observerProps = __rest
|
|
7196
|
+
observerProps = __rest(_a, ["init"]);
|
|
7457
7197
|
var observer = createObserver$1(observerCandidate, observerProps, function () {
|
|
7458
7198
|
isComplete = true;
|
|
7459
7199
|
subscription.stop();
|
|
7460
7200
|
});
|
|
7461
7201
|
var api = init(observer);
|
|
7462
|
-
subscription = api ? __assign
|
|
7202
|
+
subscription = api ? __assign({}, subscription, api) : subscription;
|
|
7463
7203
|
if (isComplete) subscription.stop();
|
|
7464
7204
|
return subscription;
|
|
7465
7205
|
};
|
|
7466
7206
|
Action.prototype.applyMiddleware = function (middleware) {
|
|
7467
|
-
return this.create(__assign
|
|
7207
|
+
return this.create(__assign({}, this.props, { middleware: this.props.middleware ? [middleware].concat(this.props.middleware) : [middleware] }));
|
|
7468
7208
|
};
|
|
7469
7209
|
Action.prototype.pipe = function () {
|
|
7470
7210
|
var funcs = [];
|
|
@@ -7517,18 +7257,18 @@ var createAction$1 = function (action, props) {
|
|
|
7517
7257
|
var createUnitAction$1 = function (action, _a) {
|
|
7518
7258
|
var from = _a.from,
|
|
7519
7259
|
to = _a.to,
|
|
7520
|
-
props = __rest
|
|
7260
|
+
props = __rest(_a, ["from", "to"]);
|
|
7521
7261
|
var unitType = findUnitType$1(from) || findUnitType$1(to);
|
|
7522
7262
|
var transform = unitType.transform,
|
|
7523
7263
|
parse = unitType.parse;
|
|
7524
|
-
return action(__assign
|
|
7264
|
+
return action(__assign({}, props, { from: typeof from === 'string' ? parse(from) : from, to: typeof to === 'string' ? parse(to) : to })).pipe(transform);
|
|
7525
7265
|
};
|
|
7526
7266
|
var createMixerAction$1 = function (mixer) {
|
|
7527
7267
|
return function (action, _a) {
|
|
7528
7268
|
var from = _a.from,
|
|
7529
7269
|
to = _a.to,
|
|
7530
|
-
props = __rest
|
|
7531
|
-
return action(__assign
|
|
7270
|
+
props = __rest(_a, ["from", "to"]);
|
|
7271
|
+
return action(__assign({}, props, { from: 0, to: 1 })).pipe(mixer(from, to));
|
|
7532
7272
|
};
|
|
7533
7273
|
};
|
|
7534
7274
|
var createColorAction$1 = /*#__PURE__*/createMixerAction$1(mixColor);
|
|
@@ -7741,7 +7481,7 @@ var inertia = function (_a) {
|
|
|
7741
7481
|
};
|
|
7742
7482
|
var startSpring = function (props) {
|
|
7743
7483
|
isSpring = true;
|
|
7744
|
-
startAnimation(vectorSpring$1(__assign
|
|
7484
|
+
startAnimation(vectorSpring$1(__assign({}, props, { to: isLessThanMin(props.from) ? min : max, stiffness: bounceStiffness, damping: bounceDamping, restDelta: restDelta })));
|
|
7745
7485
|
};
|
|
7746
7486
|
if (isOutOfBounds(from)) {
|
|
7747
7487
|
startSpring({ from: from, velocity: velocity });
|
|
@@ -7973,7 +7713,7 @@ var keyframes$1 = function (_a) {
|
|
|
7973
7713
|
ease = _b === void 0 ? linear : _b,
|
|
7974
7714
|
times = _a.times,
|
|
7975
7715
|
values = _a.values,
|
|
7976
|
-
tweenProps = __rest
|
|
7716
|
+
tweenProps = __rest(_a, ["easings", "ease", "times", "values"]);
|
|
7977
7717
|
easings = Array.isArray(easings) ? easings : defaultEasings$1(values, easings);
|
|
7978
7718
|
times = times || defaultTimings$1(values);
|
|
7979
7719
|
var scrubbers = easings.map(function (easing, i) {
|
|
@@ -7983,7 +7723,7 @@ var keyframes$1 = function (_a) {
|
|
|
7983
7723
|
ease: easing
|
|
7984
7724
|
});
|
|
7985
7725
|
});
|
|
7986
|
-
return tween$1(__assign
|
|
7726
|
+
return tween$1(__assign({}, tweenProps, { ease: ease })).applyMiddleware(function (update) {
|
|
7987
7727
|
return interpolateScrubbers$1(times, scrubbers, update);
|
|
7988
7728
|
});
|
|
7989
7729
|
};
|
|
@@ -8185,7 +7925,7 @@ var MotionValue = /** @class */ (function () {
|
|
|
8185
7925
|
*/
|
|
8186
7926
|
MotionValue.prototype.addChild = function (config) {
|
|
8187
7927
|
if (config === void 0) { config = {}; }
|
|
8188
|
-
var child = new MotionValue(this.current, __assign
|
|
7928
|
+
var child = new MotionValue(this.current, __assign({ parent: this }, config));
|
|
8189
7929
|
if (!this.children)
|
|
8190
7930
|
this.children = new Set();
|
|
8191
7931
|
this.children.add(child);
|
|
@@ -8627,7 +8367,7 @@ var buildStyleAttr = function (values, styleProp, isStatic) {
|
|
|
8627
8367
|
? transformTemplate({}, styleProp.transform)
|
|
8628
8368
|
: transformTemplate;
|
|
8629
8369
|
}
|
|
8630
|
-
return buildStyleProperty(__assign
|
|
8370
|
+
return buildStyleProperty(__assign(__assign({}, styleProp), motionValueStyles), !isStatic);
|
|
8631
8371
|
};
|
|
8632
8372
|
var useMotionStyles = function (values, styleProp, isStatic, transformValues) {
|
|
8633
8373
|
if (styleProp === void 0) { styleProp = {}; }
|
|
@@ -8681,7 +8421,7 @@ var auto$1 = {
|
|
|
8681
8421
|
parse: function (v) { return v; },
|
|
8682
8422
|
};
|
|
8683
8423
|
var dimensionTypes = [number, px, percent, degrees, vw, vh, auto$1];
|
|
8684
|
-
var valueTypes$1 = __spreadArrays
|
|
8424
|
+
var valueTypes$1 = __spreadArrays(dimensionTypes, [color, complex]);
|
|
8685
8425
|
var testValueType$1 = function (v) { return function (type) { return type.test(v); }; };
|
|
8686
8426
|
var getDimensionValueType = function (v) {
|
|
8687
8427
|
return dimensionTypes.find(testValueType$1(v));
|
|
@@ -8734,7 +8474,7 @@ var getDefaultTransition = function (valueKey, to) {
|
|
|
8734
8474
|
transitionFactory =
|
|
8735
8475
|
defaultTransitions$1[valueKey] || defaultTransitions$1.default;
|
|
8736
8476
|
}
|
|
8737
|
-
return __assign
|
|
8477
|
+
return __assign({ to: to }, transitionFactory(to));
|
|
8738
8478
|
};
|
|
8739
8479
|
|
|
8740
8480
|
/**
|
|
@@ -8830,9 +8570,9 @@ var transitionOptionParser = {
|
|
|
8830
8570
|
return opts;
|
|
8831
8571
|
},
|
|
8832
8572
|
keyframes: function (_a) {
|
|
8833
|
-
var from = _a.from, to = _a.to, velocity = _a.velocity, opts = __rest
|
|
8573
|
+
var from = _a.from, to = _a.to, velocity = _a.velocity, opts = __rest(_a, ["from", "to", "velocity"]);
|
|
8834
8574
|
if (opts.values && opts.values[0] === null) {
|
|
8835
|
-
var values = __spreadArrays
|
|
8575
|
+
var values = __spreadArrays(opts.values);
|
|
8836
8576
|
values[0] = from;
|
|
8837
8577
|
opts.values = values;
|
|
8838
8578
|
}
|
|
@@ -8846,7 +8586,7 @@ var transitionOptionParser = {
|
|
|
8846
8586
|
},
|
|
8847
8587
|
};
|
|
8848
8588
|
var isTransitionDefined = function (_a) {
|
|
8849
|
-
var when = _a.when, delay = _a.delay, delayChildren = _a.delayChildren, staggerChildren = _a.staggerChildren, staggerDirection = _a.staggerDirection, transition = __rest
|
|
8589
|
+
var when = _a.when, delay = _a.delay, delayChildren = _a.delayChildren, staggerChildren = _a.staggerChildren, staggerDirection = _a.staggerDirection, transition = __rest(_a, ["when", "delay", "delayChildren", "staggerChildren", "staggerDirection"]);
|
|
8850
8590
|
return Object.keys(transition).length;
|
|
8851
8591
|
};
|
|
8852
8592
|
var getTransitionDefinition = function (key, to, transitionDefinition) {
|
|
@@ -8856,7 +8596,7 @@ var getTransitionDefinition = function (key, to, transitionDefinition) {
|
|
|
8856
8596
|
// and see if there's any props remaining
|
|
8857
8597
|
if (transitionDefinition === undefined ||
|
|
8858
8598
|
!isTransitionDefined(transitionDefinition)) {
|
|
8859
|
-
return __assign
|
|
8599
|
+
return __assign({ delay: delay }, getDefaultTransition(key, to));
|
|
8860
8600
|
}
|
|
8861
8601
|
var valueTransitionDefinition = transitionDefinition[key] ||
|
|
8862
8602
|
transitionDefinition.default ||
|
|
@@ -8873,12 +8613,12 @@ var getTransitionDefinition = function (key, to, transitionDefinition) {
|
|
|
8873
8613
|
};
|
|
8874
8614
|
}
|
|
8875
8615
|
else if (isKeyframesTarget(to)) {
|
|
8876
|
-
return __assign
|
|
8616
|
+
return __assign(__assign({ values: to, duration: 0.8, delay: delay, ease: "linear" }, valueTransitionDefinition), {
|
|
8877
8617
|
// This animation must be keyframes if we're animating through an array
|
|
8878
8618
|
type: "keyframes" });
|
|
8879
8619
|
}
|
|
8880
8620
|
else {
|
|
8881
|
-
return __assign
|
|
8621
|
+
return __assign({ type: "tween", to: to,
|
|
8882
8622
|
delay: delay }, valueTransitionDefinition);
|
|
8883
8623
|
}
|
|
8884
8624
|
};
|
|
@@ -8895,12 +8635,12 @@ var getAnimation = function (key, value, target, transition) {
|
|
|
8895
8635
|
// for instance 100 to #fff. This might live better in Popmotion.
|
|
8896
8636
|
warning(isOriginAnimatable === isTargetAnimatable, "You are trying to animate " + key + " from \"" + origin + "\" to " + target + ". \"" + origin + "\" is not an animatable value - to enable this animation set " + origin + " to a value animatable to " + target + " via the `style` property.");
|
|
8897
8637
|
// Parse the `transition` prop and return options for the Popmotion animation
|
|
8898
|
-
var _a = getTransitionDefinition(key, target, transition), _b = _a.type, type = _b === void 0 ? "tween" : _b, transitionDefinition = __rest
|
|
8638
|
+
var _a = getTransitionDefinition(key, target, transition), _b = _a.type, type = _b === void 0 ? "tween" : _b, transitionDefinition = __rest(_a, ["type"]);
|
|
8899
8639
|
// If this is an animatable pair of values, return an animation, otherwise use `just`
|
|
8900
8640
|
var actionFactory = isOriginAnimatable && isTargetAnimatable
|
|
8901
8641
|
? transitions[type]
|
|
8902
8642
|
: just$1;
|
|
8903
|
-
var opts = preprocessOptions(type, __assign
|
|
8643
|
+
var opts = preprocessOptions(type, __assign({ from: origin, velocity: value.getVelocity() }, transitionDefinition));
|
|
8904
8644
|
// Convert duration from Framer Motion's seconds into Popmotion's milliseconds
|
|
8905
8645
|
if (isDurationAnimation(opts)) {
|
|
8906
8646
|
if (opts.duration) {
|
|
@@ -8918,10 +8658,10 @@ var getAnimation = function (key, value, target, transition) {
|
|
|
8918
8658
|
* @internal
|
|
8919
8659
|
*/
|
|
8920
8660
|
function startAnimation(key, value, target, _a) {
|
|
8921
|
-
var _b = _a.delay, delay$1$1 = _b === void 0 ? 0 : _b, transition = __rest
|
|
8661
|
+
var _b = _a.delay, delay$1$1 = _b === void 0 ? 0 : _b, transition = __rest(_a, ["delay"]);
|
|
8922
8662
|
return value.start(function (complete) {
|
|
8923
8663
|
var activeAnimation;
|
|
8924
|
-
var _a = getAnimation(key, value, target, transition), animationFactory = _a[0], _b = _a[1], valueDelay = _b.delay, options = __rest
|
|
8664
|
+
var _a = getAnimation(key, value, target, transition), animationFactory = _a[0], _b = _a[1], valueDelay = _b.delay, options = __rest(_b, ["delay"]);
|
|
8925
8665
|
if (valueDelay !== undefined) {
|
|
8926
8666
|
delay$1$1 = valueDelay;
|
|
8927
8667
|
}
|
|
@@ -9067,7 +8807,7 @@ var ValueAnimationControls = /** @class */ (function () {
|
|
|
9067
8807
|
var _this = this;
|
|
9068
8808
|
var _b = _a === void 0 ? {} : _a, _c = _b.isActive, isActive = _c === void 0 ? new Set() : _c, priority = _b.priority;
|
|
9069
8809
|
var _d = this.resolveVariant(definition), target = _d.target, transitionEnd = _d.transitionEnd;
|
|
9070
|
-
target = this.transformValues(__assign
|
|
8810
|
+
target = this.transformValues(__assign(__assign({}, target), transitionEnd));
|
|
9071
8811
|
return Object.keys(target).forEach(function (key) {
|
|
9072
8812
|
if (isActive.has(key))
|
|
9073
8813
|
return;
|
|
@@ -9157,7 +8897,7 @@ var ValueAnimationControls = /** @class */ (function () {
|
|
|
9157
8897
|
// resolve current and velocity
|
|
9158
8898
|
variant = variant(this.props.custom, getCurrent$1(this.values), getVelocity(this.values));
|
|
9159
8899
|
}
|
|
9160
|
-
var _a = variant.transition, transition = _a === void 0 ? this.defaultTransition : _a, transitionEnd = variant.transitionEnd, target = __rest
|
|
8900
|
+
var _a = variant.transition, transition = _a === void 0 ? this.defaultTransition : _a, transitionEnd = variant.transitionEnd, target = __rest(variant, ["transition", "transitionEnd"]);
|
|
9161
8901
|
return { transition: transition, transitionEnd: transitionEnd, target: target };
|
|
9162
8902
|
};
|
|
9163
8903
|
/**
|
|
@@ -9248,7 +8988,7 @@ var ValueAnimationControls = /** @class */ (function () {
|
|
|
9248
8988
|
ValueAnimationControls.prototype.applyVariantLabels = function (variantLabelList) {
|
|
9249
8989
|
var _this = this;
|
|
9250
8990
|
var isActive = new Set();
|
|
9251
|
-
var reversedList = __spreadArrays
|
|
8991
|
+
var reversedList = __spreadArrays(variantLabelList).reverse();
|
|
9252
8992
|
reversedList.forEach(function (key) {
|
|
9253
8993
|
var _a = _this.resolveVariant(_this.variants[key]), target = _a.target, transitionEnd = _a.transitionEnd;
|
|
9254
8994
|
if (transitionEnd) {
|
|
@@ -9319,7 +9059,7 @@ var ValueAnimationControls = /** @class */ (function () {
|
|
|
9319
9059
|
if (this.isAnimating.has(key))
|
|
9320
9060
|
continue;
|
|
9321
9061
|
this.isAnimating.add(key);
|
|
9322
|
-
animations.push(startAnimation(key, value, valueTarget, __assign
|
|
9062
|
+
animations.push(startAnimation(key, value, valueTarget, __assign({ delay: delay }, transition)));
|
|
9323
9063
|
}
|
|
9324
9064
|
var allAnimations = Promise.all(animations);
|
|
9325
9065
|
return transitionEnd
|
|
@@ -9330,7 +9070,7 @@ var ValueAnimationControls = /** @class */ (function () {
|
|
|
9330
9070
|
};
|
|
9331
9071
|
ValueAnimationControls.prototype.animateVariantLabels = function (variantLabels, opts) {
|
|
9332
9072
|
var _this = this;
|
|
9333
|
-
var animations = __spreadArrays
|
|
9073
|
+
var animations = __spreadArrays(variantLabels).reverse()
|
|
9334
9074
|
.map(function (label) { return _this.animateVariant(label, opts); });
|
|
9335
9075
|
return Promise.all(animations);
|
|
9336
9076
|
};
|
|
@@ -9774,7 +9514,7 @@ function useValueAnimationControls(config, props, subscribeToParentControls) {
|
|
|
9774
9514
|
// Remove reference to onAnimationComplete from controls. All the MotionValues
|
|
9775
9515
|
// are unsubscribed from this component separately. We let animations run out
|
|
9776
9516
|
// as they might be animating other components.
|
|
9777
|
-
var onAnimationComplete = props.onAnimationComplete, unmountProps = __rest
|
|
9517
|
+
var onAnimationComplete = props.onAnimationComplete, unmountProps = __rest(props, ["onAnimationComplete"]);
|
|
9778
9518
|
controls.setProps(unmountProps);
|
|
9779
9519
|
parentControls && parentControls.removeChild(controls);
|
|
9780
9520
|
};
|
|
@@ -10259,7 +9999,7 @@ var PanSession = /** @class */ (function () {
|
|
|
10259
9999
|
return;
|
|
10260
10000
|
var point = info.point;
|
|
10261
10001
|
var timestamp = getFrameData().timestamp;
|
|
10262
|
-
_this.history.push(__assign
|
|
10002
|
+
_this.history.push(__assign(__assign({}, point), { timestamp: timestamp }));
|
|
10263
10003
|
var _a = _this.handlers, onStart = _a.onStart, onMove = _a.onMove;
|
|
10264
10004
|
if (!isPanStarted) {
|
|
10265
10005
|
onStart && onStart(_this.lastMoveEvent, info);
|
|
@@ -10276,7 +10016,7 @@ var PanSession = /** @class */ (function () {
|
|
|
10276
10016
|
var initialInfo = transformPoint(info, this.transformPagePoint);
|
|
10277
10017
|
var point = initialInfo.point;
|
|
10278
10018
|
var timestamp = getFrameData().timestamp;
|
|
10279
|
-
this.history = [__assign
|
|
10019
|
+
this.history = [__assign(__assign({}, point), { timestamp: timestamp })];
|
|
10280
10020
|
var onSessionStart = handlers.onSessionStart;
|
|
10281
10021
|
onSessionStart &&
|
|
10282
10022
|
onSessionStart(event, getPanInfo(initialInfo, this.history));
|
|
@@ -10604,7 +10344,7 @@ var Gestures = {
|
|
|
10604
10344
|
return gestureProps.some(function (key) { return props.hasOwnProperty(key); });
|
|
10605
10345
|
},
|
|
10606
10346
|
Component: makeRenderlessComponent(function (_a) {
|
|
10607
|
-
var innerRef = _a.innerRef, props = __rest
|
|
10347
|
+
var innerRef = _a.innerRef, props = __rest(_a, ["innerRef"]);
|
|
10608
10348
|
useGestures(props, innerRef);
|
|
10609
10349
|
}),
|
|
10610
10350
|
};
|
|
@@ -10844,8 +10584,8 @@ var ComponentDragControls = /** @class */ (function () {
|
|
|
10844
10584
|
};
|
|
10845
10585
|
ComponentDragControls.prototype.updateProps = function (_a) {
|
|
10846
10586
|
var _this = this;
|
|
10847
|
-
var _b = _a.drag, drag = _b === void 0 ? false : _b, _c = _a.dragDirectionLock, dragDirectionLock = _c === void 0 ? false : _c, _d = _a.dragPropagation, dragPropagation = _d === void 0 ? false : _d, _e = _a.dragConstraints, dragConstraints = _e === void 0 ? false : _e, _f = _a.dragElastic, dragElastic = _f === void 0 ? true : _f, _g = _a.dragMomentum, dragMomentum = _g === void 0 ? true : _g, remainingProps = __rest
|
|
10848
|
-
this.props = __assign
|
|
10587
|
+
var _b = _a.drag, drag = _b === void 0 ? false : _b, _c = _a.dragDirectionLock, dragDirectionLock = _c === void 0 ? false : _c, _d = _a.dragPropagation, dragPropagation = _d === void 0 ? false : _d, _e = _a.dragConstraints, dragConstraints = _e === void 0 ? false : _e, _f = _a.dragElastic, dragElastic = _f === void 0 ? true : _f, _g = _a.dragMomentum, dragMomentum = _g === void 0 ? true : _g, remainingProps = __rest(_a, ["drag", "dragDirectionLock", "dragPropagation", "dragConstraints", "dragElastic", "dragMomentum"]);
|
|
10588
|
+
this.props = __assign({ drag: drag,
|
|
10849
10589
|
dragDirectionLock: dragDirectionLock,
|
|
10850
10590
|
dragPropagation: dragPropagation,
|
|
10851
10591
|
dragConstraints: dragConstraints,
|
|
@@ -10901,7 +10641,7 @@ var ComponentDragControls = /** @class */ (function () {
|
|
|
10901
10641
|
var bounceStiffness = dragElastic ? 200 : 1000000;
|
|
10902
10642
|
var bounceDamping = dragElastic ? 40 : 10000000;
|
|
10903
10643
|
var animationControls = _dragTransitionControls || _this.controls;
|
|
10904
|
-
var inertia = __assign
|
|
10644
|
+
var inertia = __assign(__assign({ type: "inertia", velocity: dragMomentum ? velocity[axis] : 0, bounceStiffness: bounceStiffness,
|
|
10905
10645
|
bounceDamping: bounceDamping, timeConstant: 750, restDelta: 1 }, dragTransition), transition);
|
|
10906
10646
|
var externalAxisMotionValue = axis === "x" ? _dragValueX : _dragValueY;
|
|
10907
10647
|
// If we're not animating on an externally-provided `MotionValue` we can use the
|
|
@@ -10982,7 +10722,7 @@ function bothAxis(handler) {
|
|
|
10982
10722
|
return [handler("x"), handler("y")];
|
|
10983
10723
|
}
|
|
10984
10724
|
function convertPanToDrag(info, point) {
|
|
10985
|
-
return __assign
|
|
10725
|
+
return __assign(__assign({}, info), { point: {
|
|
10986
10726
|
x: point.x ? point.x.get() : 0,
|
|
10987
10727
|
y: point.y ? point.y.get() : 0,
|
|
10988
10728
|
} });
|
|
@@ -11093,7 +10833,7 @@ function useDrag(props, ref, values, controls) {
|
|
|
11093
10833
|
var groupDragControls = props.dragControls;
|
|
11094
10834
|
var transformPagePoint = React.useContext(MotionPluginContext).transformPagePoint;
|
|
11095
10835
|
var dragControls = useConstant(function () { return new ComponentDragControls({ ref: ref, values: values, controls: controls }); });
|
|
11096
|
-
dragControls.updateProps(__assign
|
|
10836
|
+
dragControls.updateProps(__assign(__assign({}, props), { transformPagePoint: transformPagePoint }));
|
|
11097
10837
|
React.useEffect(function () { return groupDragControls && groupDragControls.subscribe(dragControls); }, [dragControls]);
|
|
11098
10838
|
React.useEffect(function () { return dragControls.mount(ref.current); }, []);
|
|
11099
10839
|
}
|
|
@@ -11102,7 +10842,7 @@ var Drag = {
|
|
|
11102
10842
|
key: "drag",
|
|
11103
10843
|
shouldRender: function (props) { return !!props.drag; },
|
|
11104
10844
|
Component: makeRenderlessComponent(function (_a) {
|
|
11105
|
-
var innerRef = _a.innerRef, values = _a.values, controls = _a.controls, props = __rest
|
|
10845
|
+
var innerRef = _a.innerRef, values = _a.values, controls = _a.controls, props = __rest(_a, ["innerRef", "values", "controls"]);
|
|
11106
10846
|
return useDrag(props, innerRef, values, controls);
|
|
11107
10847
|
}),
|
|
11108
10848
|
};
|
|
@@ -11154,14 +10894,14 @@ function getVariableValue(current, element, depth) {
|
|
|
11154
10894
|
* @internal
|
|
11155
10895
|
*/
|
|
11156
10896
|
function resolveCSSVariables(values, ref, _a, transitionEnd) {
|
|
11157
|
-
var target = __rest
|
|
10897
|
+
var target = __rest(_a, []);
|
|
11158
10898
|
var element = ref.current;
|
|
11159
10899
|
if (!(element instanceof HTMLElement))
|
|
11160
10900
|
return { target: target, transitionEnd: transitionEnd };
|
|
11161
10901
|
// If `transitionEnd` isn't `undefined`, clone it. We could clone `target` and `transitionEnd`
|
|
11162
10902
|
// only if they change but I think this reads clearer and this isn't a performance-critical path.
|
|
11163
10903
|
if (transitionEnd) {
|
|
11164
|
-
transitionEnd = __assign
|
|
10904
|
+
transitionEnd = __assign({}, transitionEnd);
|
|
11165
10905
|
}
|
|
11166
10906
|
// Go through existing `MotionValue`s and ensure any existing CSS variables are resolved
|
|
11167
10907
|
values.forEach(function (value) {
|
|
@@ -11318,8 +11058,8 @@ var convertChangedValueTypes = function (target, values, element, elementStyler,
|
|
|
11318
11058
|
};
|
|
11319
11059
|
var checkAndConvertChangedValueTypes = function (values, ref, target, transitionEnd) {
|
|
11320
11060
|
if (transitionEnd === void 0) { transitionEnd = {}; }
|
|
11321
|
-
target = __assign
|
|
11322
|
-
transitionEnd = __assign
|
|
11061
|
+
target = __assign({}, target);
|
|
11062
|
+
transitionEnd = __assign({}, transitionEnd);
|
|
11323
11063
|
var element = ref.current;
|
|
11324
11064
|
var elementStyler = index(element);
|
|
11325
11065
|
var targetPositionalKeys = Object.keys(target).filter(isPositionalKey$1);
|
|
@@ -11547,7 +11287,7 @@ function calcAxisDelta(prev, next, names) {
|
|
|
11547
11287
|
return delta;
|
|
11548
11288
|
}
|
|
11549
11289
|
function calcDelta(prev, next) {
|
|
11550
|
-
var delta = __assign
|
|
11290
|
+
var delta = __assign(__assign({}, calcAxisDelta(prev, next, axisLabels.x)), calcAxisDelta(prev, next, axisLabels.y));
|
|
11551
11291
|
return delta;
|
|
11552
11292
|
}
|
|
11553
11293
|
var offset = {
|
|
@@ -11591,7 +11331,7 @@ function getTransition(_a) {
|
|
|
11591
11331
|
return layoutTransition || positionTransition;
|
|
11592
11332
|
}
|
|
11593
11333
|
var LayoutAnimation = /** @class */ (function (_super) {
|
|
11594
|
-
__extends
|
|
11334
|
+
__extends(LayoutAnimation, _super);
|
|
11595
11335
|
function LayoutAnimation() {
|
|
11596
11336
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
11597
11337
|
}
|
|
@@ -11658,11 +11398,11 @@ var LayoutAnimation = /** @class */ (function (_super) {
|
|
|
11658
11398
|
if (!delta[deltaKey])
|
|
11659
11399
|
return;
|
|
11660
11400
|
var baseTransition = typeof transitionDefinition === "boolean"
|
|
11661
|
-
? __assign
|
|
11401
|
+
? __assign({}, getDefaultLayoutTransition(isPositionOnly)) : transitionDefinition;
|
|
11662
11402
|
var value = values.get(transformKey, targetValue);
|
|
11663
11403
|
var velocity = value.getVelocity();
|
|
11664
11404
|
transition[transformKey] = baseTransition[transformKey]
|
|
11665
|
-
? __assign
|
|
11405
|
+
? __assign({}, baseTransition[transformKey]) : __assign({}, baseTransition);
|
|
11666
11406
|
if (transition[transformKey].velocity === undefined) {
|
|
11667
11407
|
transition[transformKey].velocity = velocity || 0;
|
|
11668
11408
|
}
|
|
@@ -11803,9 +11543,9 @@ var hasUpdated = function (prev, next) {
|
|
|
11803
11543
|
};
|
|
11804
11544
|
function targetWithoutTransition(_a, mergeTransitionEnd) {
|
|
11805
11545
|
if (mergeTransitionEnd === void 0) { mergeTransitionEnd = false; }
|
|
11806
|
-
var transition = _a.transition, transitionEnd = _a.transitionEnd, target = __rest
|
|
11546
|
+
var transition = _a.transition, transitionEnd = _a.transitionEnd, target = __rest(_a, ["transition", "transitionEnd"]);
|
|
11807
11547
|
return mergeTransitionEnd
|
|
11808
|
-
? __assign
|
|
11548
|
+
? __assign(__assign({}, target), transitionEnd)
|
|
11809
11549
|
: target;
|
|
11810
11550
|
}
|
|
11811
11551
|
/**
|
|
@@ -11857,9 +11597,9 @@ function useAnimateProp(targetAndTransition, controls, values, defaultTransition
|
|
|
11857
11597
|
}
|
|
11858
11598
|
}
|
|
11859
11599
|
isInitialRender.current = false;
|
|
11860
|
-
prevValues.current = __assign
|
|
11600
|
+
prevValues.current = __assign(__assign({}, prevValues.current), finalTarget);
|
|
11861
11601
|
if (Object.keys(targetToAnimate).length) {
|
|
11862
|
-
controls.start(__assign
|
|
11602
|
+
controls.start(__assign(__assign({}, targetToAnimate), { transition: targetAndTransition.transition || defaultTransition, transitionEnd: targetAndTransition.transitionEnd }));
|
|
11863
11603
|
}
|
|
11864
11604
|
}, [targetAndTransition]);
|
|
11865
11605
|
}
|
|
@@ -12033,7 +11773,7 @@ var Exit = {
|
|
|
12033
11773
|
React.useEffect(function () {
|
|
12034
11774
|
if (!isPresent) {
|
|
12035
11775
|
if (!isPlayingExitAnimation.current && exit) {
|
|
12036
|
-
controls.setProps(__assign
|
|
11776
|
+
controls.setProps(__assign(__assign({}, props), { custom: custom }));
|
|
12037
11777
|
controls.start(exit).then(onExitComplete);
|
|
12038
11778
|
}
|
|
12039
11779
|
isPlayingExitAnimation.current = true;
|
|
@@ -12104,7 +11844,7 @@ var buildHTMLProps = function (values, style, isStatic, isDrag) {
|
|
|
12104
11844
|
var buildSVGProps = function (values, style) {
|
|
12105
11845
|
var motionValueStyles = resolveCurrent(values);
|
|
12106
11846
|
var props = buildSVGAttrs(motionValueStyles, undefined, undefined, undefined, undefined, false);
|
|
12107
|
-
props.style = __assign
|
|
11847
|
+
props.style = __assign(__assign({}, style), props.style);
|
|
12108
11848
|
return props;
|
|
12109
11849
|
};
|
|
12110
11850
|
var functionalityComponents = [Layout, Drag, Gestures, Exit];
|
|
@@ -12123,7 +11863,7 @@ function createDomMotionConfig(Component) {
|
|
|
12123
11863
|
var staticVisualStyles = isSVG
|
|
12124
11864
|
? buildSVGProps(values, style)
|
|
12125
11865
|
: buildHTMLProps(values, style, isStatic, !!props.drag);
|
|
12126
|
-
return React.createElement(Component, __assign
|
|
11866
|
+
return React.createElement(Component, __assign(__assign(__assign({}, forwardedProps), { ref: ref }), staticVisualStyles));
|
|
12127
11867
|
},
|
|
12128
11868
|
/**
|
|
12129
11869
|
* loadFunctionalityComponents gets used by the `motion` component
|
|
@@ -12154,7 +11894,7 @@ function createDomMotionConfig(Component) {
|
|
|
12154
11894
|
for (var i = 0; i < numFunctionalityComponents; i++) {
|
|
12155
11895
|
var _a = functionalityComponents[i], shouldRender = _a.shouldRender, key = _a.key, Component_1 = _a.Component;
|
|
12156
11896
|
if (shouldRender(props, context)) {
|
|
12157
|
-
activeComponents.push(React.createElement(Component_1, __assign
|
|
11897
|
+
activeComponents.push(React.createElement(Component_1, __assign({ key: key }, props, { parentContext: context, values: values, controls: controls, innerRef: ref })));
|
|
12158
11898
|
}
|
|
12159
11899
|
}
|
|
12160
11900
|
return activeComponents;
|
|
@@ -12206,7 +11946,7 @@ var svgMotionComponents = svgElements.reduce(function (acc, Component) {
|
|
|
12206
11946
|
*
|
|
12207
11947
|
* @public
|
|
12208
11948
|
*/
|
|
12209
|
-
var motion = __assign
|
|
11949
|
+
var motion = __assign(__assign({
|
|
12210
11950
|
/**
|
|
12211
11951
|
* Convert a custom React component into a `motion` component.
|
|
12212
11952
|
*
|
|
@@ -12258,7 +11998,7 @@ var PresenceChild = function (_a) {
|
|
|
12258
11998
|
return function () { return numPresenceChildren.current--; };
|
|
12259
11999
|
};
|
|
12260
12000
|
}, [isPresent]);
|
|
12261
|
-
return (React.createElement(PresenceContext.Provider, { value: __assign
|
|
12001
|
+
return (React.createElement(PresenceContext.Provider, { value: __assign(__assign({}, context), { register: register }) }, children));
|
|
12262
12002
|
};
|
|
12263
12003
|
|
|
12264
12004
|
function getChildKey(child) {
|
|
@@ -12374,7 +12114,7 @@ var AnimatePresence = function (_a) {
|
|
|
12374
12114
|
return (React.createElement(React.Fragment, null, filteredChildren.map(function (child) { return (React.createElement(PresenceChild, { key: getChildKey(child), isPresent: true, initial: initial ? undefined : false }, child)); })));
|
|
12375
12115
|
}
|
|
12376
12116
|
// If this is a subsequent render, deal with entering and exiting children
|
|
12377
|
-
var childrenToRender = __spreadArrays
|
|
12117
|
+
var childrenToRender = __spreadArrays(filteredChildren);
|
|
12378
12118
|
// Diff the keys of the currently-present and target children to update our
|
|
12379
12119
|
// exiting list.
|
|
12380
12120
|
var presentKeys = presentChildren.current.map(getChildKey);
|