@studiometa/js-toolkit 2.6.5 → 2.8.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/Base/features.cjs +27 -0
- package/Base/features.cjs.map +7 -0
- package/Base/features.d.ts +2 -0
- package/Base/features.js +5 -0
- package/Base/features.js.map +7 -0
- package/Base/index.cjs +12 -15
- package/Base/index.cjs.map +2 -2
- package/Base/index.d.ts +11 -15
- package/Base/index.js +10 -6
- package/Base/index.js.map +2 -2
- package/Base/managers/AsyncChildrenManager.cjs +61 -0
- package/Base/managers/AsyncChildrenManager.cjs.map +7 -0
- package/Base/managers/AsyncChildrenManager.d.ts +18 -0
- package/Base/managers/AsyncChildrenManager.js +39 -0
- package/Base/managers/AsyncChildrenManager.js.map +7 -0
- package/Base/managers/ChildrenManager.cjs +32 -29
- package/Base/managers/ChildrenManager.cjs.map +2 -2
- package/Base/managers/ChildrenManager.d.ts +21 -1
- package/Base/managers/ChildrenManager.js +32 -29
- package/Base/managers/ChildrenManager.js.map +2 -2
- package/Base/managers/EventsManager.cjs.map +2 -2
- package/Base/managers/EventsManager.js.map +2 -2
- package/Base/managers/OptionsManager.d.ts +9 -9
- package/Base/managers/RefsManager.cjs +13 -8
- package/Base/managers/RefsManager.cjs.map +2 -2
- package/Base/managers/RefsManager.js +14 -9
- package/Base/managers/RefsManager.js.map +2 -2
- package/Base/managers/ResponsiveOptionsManager.d.ts +1 -1
- package/Base/managers/ServicesManager.d.ts +2 -2
- package/Base/managers/index.cjs +41 -0
- package/Base/managers/index.cjs.map +7 -0
- package/Base/managers/index.d.ts +8 -0
- package/Base/managers/index.js +19 -0
- package/Base/managers/index.js.map +7 -0
- package/Base/types.cjs.map +1 -1
- package/Base/types.d.ts +1 -1
- package/Base/utils.cjs +15 -1
- package/Base/utils.cjs.map +2 -2
- package/Base/utils.d.ts +1 -0
- package/Base/utils.js +15 -1
- package/Base/utils.js.map +2 -2
- package/decorators/index.cjs +1 -1
- package/decorators/index.cjs.map +2 -2
- package/decorators/index.d.ts +1 -1
- package/decorators/index.js +1 -1
- package/decorators/index.js.map +1 -1
- package/decorators/withBreakpointManager.cjs.map +2 -2
- package/decorators/withBreakpointManager.js.map +2 -2
- package/decorators/withBreakpointObserver.cjs.map +2 -2
- package/decorators/withBreakpointObserver.js.map +2 -2
- package/decorators/withDrag.cjs.map +2 -2
- package/decorators/withDrag.d.ts +1 -1
- package/decorators/withDrag.js.map +2 -2
- package/decorators/withMountWhenInView.cjs.map +2 -2
- package/decorators/withMountWhenInView.js.map +2 -2
- package/decorators/withResponsiveOptions.cjs.map +2 -2
- package/decorators/withResponsiveOptions.js.map +2 -2
- package/decorators/withScrolledInView/index.cjs +22 -0
- package/decorators/withScrolledInView/index.cjs.map +7 -0
- package/decorators/withScrolledInView/index.d.ts +2 -0
- package/decorators/withScrolledInView/index.js +3 -0
- package/decorators/withScrolledInView/index.js.map +7 -0
- package/decorators/withScrolledInView/types.cjs +19 -0
- package/decorators/withScrolledInView/types.cjs.map +7 -0
- package/decorators/withScrolledInView/types.d.ts +2 -0
- package/decorators/withScrolledInView/types.js +1 -0
- package/decorators/withScrolledInView/types.js.map +7 -0
- package/decorators/withScrolledInView/utils.cjs +99 -0
- package/decorators/withScrolledInView/utils.cjs.map +7 -0
- package/decorators/withScrolledInView/utils.d.ts +17 -0
- package/decorators/withScrolledInView/utils.js +77 -0
- package/decorators/withScrolledInView/utils.js.map +7 -0
- package/decorators/{withScrolledInView.cjs → withScrolledInView/withScrolledInView.cjs} +25 -10
- package/decorators/withScrolledInView/withScrolledInView.cjs.map +7 -0
- package/decorators/{withScrolledInView.d.ts → withScrolledInView/withScrolledInView.d.ts} +6 -5
- package/decorators/{withScrolledInView.js → withScrolledInView/withScrolledInView.js} +31 -9
- package/decorators/withScrolledInView/withScrolledInView.js.map +7 -0
- package/decorators/withVue2.cjs.map +2 -2
- package/decorators/withVue2.js.map +2 -2
- package/helpers/createApp.cjs +23 -19
- package/helpers/createApp.cjs.map +2 -2
- package/helpers/createApp.d.ts +6 -1
- package/helpers/createApp.js +23 -19
- package/helpers/createApp.js.map +2 -2
- package/helpers/getClosestParent.cjs +3 -11
- package/helpers/getClosestParent.cjs.map +2 -2
- package/helpers/getClosestParent.js +3 -11
- package/helpers/getClosestParent.js.map +2 -2
- package/helpers/getInstanceFromElement.cjs.map +2 -2
- package/helpers/getInstanceFromElement.js.map +2 -2
- package/helpers/importOnInteraction.cjs.map +2 -2
- package/helpers/importOnInteraction.js.map +2 -2
- package/helpers/importWhenIdle.cjs.map +2 -2
- package/helpers/importWhenIdle.d.ts +1 -1
- package/helpers/importWhenIdle.js.map +2 -2
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/services/drag.cjs +1 -1
- package/services/drag.cjs.map +3 -3
- package/services/drag.d.ts +21 -24
- package/services/drag.js.map +3 -3
- package/services/index.d.ts +7 -7
- package/services/key.cjs +1 -1
- package/services/key.cjs.map +3 -3
- package/services/key.d.ts +8 -9
- package/services/key.js.map +3 -3
- package/services/load.cjs +1 -1
- package/services/load.cjs.map +3 -3
- package/services/load.d.ts +6 -5
- package/services/load.js.map +3 -3
- package/services/pointer.cjs +1 -1
- package/services/pointer.cjs.map +3 -3
- package/services/pointer.d.ts +10 -10
- package/services/pointer.js.map +3 -3
- package/services/raf.cjs +4 -4
- package/services/raf.cjs.map +3 -3
- package/services/raf.d.ts +6 -7
- package/services/raf.js +3 -3
- package/services/raf.js.map +3 -3
- package/services/resize.cjs +1 -1
- package/services/resize.cjs.map +3 -3
- package/services/resize.d.ts +8 -9
- package/services/resize.js.map +3 -3
- package/services/scroll.cjs +1 -1
- package/services/scroll.cjs.map +3 -3
- package/services/scroll.d.ts +16 -17
- package/services/scroll.js.map +3 -3
- package/services/service.cjs +2 -2
- package/services/service.cjs.map +3 -3
- package/services/service.d.ts +12 -14
- package/services/service.js +1 -1
- package/services/service.js.map +3 -3
- package/utils/Queue.cjs +60 -0
- package/utils/Queue.cjs.map +7 -0
- package/utils/Queue.d.ts +44 -0
- package/utils/Queue.js +38 -0
- package/utils/Queue.js.map +7 -0
- package/utils/collide/boundingRectToCircle.cjs +3 -2
- package/utils/collide/boundingRectToCircle.cjs.map +3 -3
- package/utils/collide/boundingRectToCircle.d.ts +8 -13
- package/utils/collide/boundingRectToCircle.js +2 -1
- package/utils/collide/boundingRectToCircle.js.map +3 -3
- package/utils/collide/collideCircleCircle.cjs +1 -1
- package/utils/collide/collideCircleCircle.cjs.map +1 -1
- package/utils/collide/collideCircleCircle.d.ts +1 -15
- package/utils/collide/collideCircleCircle.js.map +1 -1
- package/utils/collide/collideCircleRect.cjs +1 -1
- package/utils/collide/collideCircleRect.cjs.map +1 -1
- package/utils/collide/collideCircleRect.d.ts +1 -33
- package/utils/collide/collideCircleRect.js.map +1 -1
- package/utils/collide/collidePointCircle.cjs +1 -1
- package/utils/collide/collidePointCircle.cjs.map +1 -1
- package/utils/collide/collidePointCircle.d.ts +1 -25
- package/utils/collide/collidePointCircle.js.map +1 -1
- package/utils/collide/collidePointRect.cjs +1 -1
- package/utils/collide/collidePointRect.cjs.map +1 -1
- package/utils/collide/collidePointRect.d.ts +1 -29
- package/utils/collide/collidePointRect.js.map +1 -1
- package/utils/collide/collideRectRect.cjs +1 -1
- package/utils/collide/collideRectRect.cjs.map +1 -1
- package/utils/collide/collideRectRect.d.ts +1 -19
- package/utils/collide/collideRectRect.js.map +1 -1
- package/utils/collide/index.cjs +1 -1
- package/utils/collide/index.cjs.map +1 -1
- package/utils/collide/index.d.ts +9 -6
- package/utils/collide/index.js.map +1 -1
- package/utils/css/animate.cjs +32 -16
- package/utils/css/animate.cjs.map +4 -4
- package/utils/css/animate.d.ts +12 -11
- package/utils/css/animate.js +31 -15
- package/utils/css/animate.js.map +4 -4
- package/utils/css/classes.cjs +1 -1
- package/utils/css/classes.cjs.map +3 -3
- package/utils/css/classes.d.ts +3 -16
- package/utils/css/classes.js.map +3 -3
- package/utils/css/getOffsetSizes.cjs +2 -2
- package/utils/css/getOffsetSizes.cjs.map +3 -3
- package/utils/css/getOffsetSizes.d.ts +0 -2
- package/utils/css/getOffsetSizes.js +1 -1
- package/utils/css/getOffsetSizes.js.map +3 -3
- package/utils/css/matrix.cjs +1 -1
- package/utils/css/matrix.cjs.map +3 -3
- package/utils/css/matrix.d.ts +10 -8
- package/utils/css/matrix.js.map +3 -3
- package/utils/css/styles.cjs +1 -1
- package/utils/css/styles.cjs.map +3 -3
- package/utils/css/styles.d.ts +2 -10
- package/utils/css/styles.js.map +3 -3
- package/utils/css/transform.cjs +1 -1
- package/utils/css/transform.cjs.map +3 -3
- package/utils/css/transform.d.ts +5 -27
- package/utils/css/transform.js.map +3 -3
- package/utils/css/transition.cjs +2 -2
- package/utils/css/transition.cjs.map +3 -3
- package/utils/css/transition.d.ts +11 -15
- package/utils/css/transition.js +1 -1
- package/utils/css/transition.js.map +3 -3
- package/utils/debounce.cjs +1 -1
- package/utils/debounce.cjs.map +3 -3
- package/utils/debounce.d.ts +3 -3
- package/utils/debounce.js.map +3 -3
- package/utils/dom/ancestors.cjs +37 -0
- package/utils/dom/ancestors.cjs.map +7 -0
- package/utils/dom/ancestors.d.ts +8 -0
- package/utils/dom/ancestors.js +15 -0
- package/utils/dom/ancestors.js.map +7 -0
- package/utils/dom/index.cjs +21 -0
- package/utils/dom/index.cjs.map +7 -0
- package/utils/dom/index.d.ts +1 -0
- package/utils/dom/index.js +2 -0
- package/utils/dom/index.js.map +7 -0
- package/utils/focusTrap.cjs +4 -2
- package/utils/focusTrap.cjs.map +3 -3
- package/utils/focusTrap.d.ts +3 -4
- package/utils/focusTrap.js +3 -1
- package/utils/focusTrap.js.map +3 -3
- package/utils/has.cjs +1 -1
- package/utils/has.cjs.map +3 -3
- package/utils/has.d.ts +1 -3
- package/utils/has.js.map +3 -3
- package/utils/history.cjs +1 -1
- package/utils/history.cjs.map +3 -3
- package/utils/history.d.ts +10 -10
- package/utils/history.js.map +3 -3
- package/utils/index.cjs +3 -0
- package/utils/index.cjs.map +2 -2
- package/utils/index.d.ts +2 -0
- package/utils/index.js +3 -0
- package/utils/index.js.map +2 -2
- package/utils/is.cjs +2 -2
- package/utils/is.cjs.map +3 -3
- package/utils/is.d.ts +26 -8
- package/utils/is.js +1 -1
- package/utils/is.js.map +3 -3
- package/utils/keyCodes.cjs +1 -1
- package/utils/keyCodes.cjs.map +2 -2
- package/utils/keyCodes.d.ts +10 -10
- package/utils/keyCodes.js.map +2 -2
- package/utils/math/clamp.cjs +1 -1
- package/utils/math/clamp.cjs.map +3 -3
- package/utils/math/clamp.js.map +3 -3
- package/utils/math/clamp01.cjs +1 -1
- package/utils/math/clamp01.cjs.map +3 -3
- package/utils/math/clamp01.js.map +3 -3
- package/utils/math/createEases.cjs +1 -1
- package/utils/math/createEases.cjs.map +3 -3
- package/utils/math/createEases.d.ts +3 -6
- package/utils/math/createEases.js.map +3 -3
- package/utils/math/damp.cjs +1 -1
- package/utils/math/damp.cjs.map +3 -3
- package/utils/math/damp.js.map +3 -3
- package/utils/math/ease.cjs +1 -1
- package/utils/math/ease.cjs.map +3 -3
- package/utils/math/ease.d.ts +21 -21
- package/utils/math/ease.js.map +3 -3
- package/utils/math/index.cjs +1 -1
- package/utils/math/index.cjs.map +1 -1
- package/utils/math/index.d.ts +10 -10
- package/utils/math/index.js.map +1 -1
- package/utils/math/inertiaFinalValue.cjs +1 -1
- package/utils/math/inertiaFinalValue.cjs.map +3 -3
- package/utils/math/inertiaFinalValue.js.map +3 -3
- package/utils/math/lerp.cjs +1 -1
- package/utils/math/lerp.cjs.map +3 -3
- package/utils/math/lerp.js.map +3 -3
- package/utils/math/map.cjs +1 -1
- package/utils/math/map.cjs.map +3 -3
- package/utils/math/map.js.map +3 -3
- package/utils/math/round.cjs +1 -1
- package/utils/math/round.cjs.map +3 -3
- package/utils/math/round.js.map +3 -3
- package/utils/memoize.cjs +6 -2
- package/utils/memoize.cjs.map +3 -3
- package/utils/memoize.d.ts +18 -28
- package/utils/memoize.js +5 -1
- package/utils/memoize.js.map +3 -3
- package/utils/nextFrame.cjs +1 -1
- package/utils/nextFrame.cjs.map +3 -3
- package/utils/nextFrame.d.ts +3 -6
- package/utils/nextFrame.js.map +3 -3
- package/utils/nextMicrotask.cjs +1 -1
- package/utils/nextMicrotask.cjs.map +3 -3
- package/utils/nextMicrotask.d.ts +1 -5
- package/utils/nextMicrotask.js.map +3 -3
- package/utils/nextTick.cjs +5 -5
- package/utils/nextTick.cjs.map +3 -3
- package/utils/nextTick.d.ts +1 -5
- package/utils/nextTick.js +4 -4
- package/utils/nextTick.js.map +3 -3
- package/utils/noop.cjs +1 -1
- package/utils/noop.cjs.map +3 -3
- package/utils/noop.d.ts +2 -5
- package/utils/noop.js.map +3 -3
- package/utils/object/autoBind.cjs +1 -1
- package/utils/object/autoBind.cjs.map +3 -3
- package/utils/object/autoBind.d.ts +5 -4
- package/utils/object/autoBind.js.map +3 -3
- package/utils/object/getAllProperties.cjs +3 -3
- package/utils/object/getAllProperties.cjs.map +3 -3
- package/utils/object/getAllProperties.d.ts +1 -1
- package/utils/object/getAllProperties.js +2 -2
- package/utils/object/getAllProperties.js.map +3 -3
- package/utils/object/index.cjs +1 -1
- package/utils/object/index.cjs.map +1 -1
- package/utils/object/index.d.ts +2 -2
- package/utils/object/index.js.map +1 -1
- package/utils/scheduler.cjs +2 -2
- package/utils/scheduler.cjs.map +3 -3
- package/utils/scheduler.d.ts +4 -13
- package/utils/scheduler.js +1 -1
- package/utils/scheduler.js.map +3 -3
- package/utils/scrollTo.cjs +1 -1
- package/utils/scrollTo.cjs.map +3 -3
- package/utils/scrollTo.d.ts +0 -3
- package/utils/scrollTo.js.map +3 -3
- package/utils/string/index.cjs +1 -1
- package/utils/string/index.cjs.map +1 -1
- package/utils/string/index.d.ts +10 -10
- package/utils/string/index.js.map +1 -1
- package/utils/string/withLeadingCharacters.cjs +1 -1
- package/utils/string/withLeadingCharacters.cjs.map +3 -3
- package/utils/string/withLeadingCharacters.js.map +3 -3
- package/utils/string/withLeadingSlash.cjs +1 -1
- package/utils/string/withLeadingSlash.cjs.map +3 -3
- package/utils/string/withLeadingSlash.js.map +3 -3
- package/utils/string/withTrailingCharacters.cjs +1 -1
- package/utils/string/withTrailingCharacters.cjs.map +3 -3
- package/utils/string/withTrailingCharacters.js.map +3 -3
- package/utils/string/withTrailingSlash.cjs +1 -1
- package/utils/string/withTrailingSlash.cjs.map +3 -3
- package/utils/string/withTrailingSlash.js.map +3 -3
- package/utils/string/withoutLeadingCharacters.cjs +1 -1
- package/utils/string/withoutLeadingCharacters.cjs.map +3 -3
- package/utils/string/withoutLeadingCharacters.js.map +3 -3
- package/utils/string/withoutLeadingCharactersRecursive.cjs +1 -1
- package/utils/string/withoutLeadingCharactersRecursive.cjs.map +3 -3
- package/utils/string/withoutLeadingCharactersRecursive.js.map +3 -3
- package/utils/string/withoutLeadingSlash.cjs +1 -1
- package/utils/string/withoutLeadingSlash.cjs.map +3 -3
- package/utils/string/withoutLeadingSlash.js.map +3 -3
- package/utils/string/withoutTrailingCharacters.cjs +1 -1
- package/utils/string/withoutTrailingCharacters.cjs.map +3 -3
- package/utils/string/withoutTrailingCharacters.js.map +3 -3
- package/utils/string/withoutTrailingCharactersRecursive.cjs +1 -1
- package/utils/string/withoutTrailingCharactersRecursive.cjs.map +3 -3
- package/utils/string/withoutTrailingCharactersRecursive.js.map +3 -3
- package/utils/string/withoutTrailingSlash.cjs +1 -1
- package/utils/string/withoutTrailingSlash.cjs.map +3 -3
- package/utils/string/withoutTrailingSlash.js.map +3 -3
- package/utils/throttle.cjs +2 -2
- package/utils/throttle.cjs.map +3 -3
- package/utils/throttle.d.ts +1 -1
- package/utils/throttle.js +1 -1
- package/utils/throttle.js.map +3 -3
- package/utils/tween.cjs +4 -3
- package/utils/tween.cjs.map +3 -3
- package/utils/tween.d.ts +17 -24
- package/utils/tween.js +3 -2
- package/utils/tween.js.map +3 -3
- package/decorators/withScrolledInView.cjs.map +0 -7
- package/decorators/withScrolledInView.js.map +0 -7
package/utils/is.cjs
CHANGED
|
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
|
-
// packages/js-toolkit/utils/is.
|
|
19
|
+
// packages/js-toolkit/utils/is.ts
|
|
20
20
|
var is_exports = {};
|
|
21
21
|
__export(is_exports, {
|
|
22
22
|
isArray: () => isArray,
|
|
@@ -34,7 +34,7 @@ var isFunction = (value) => typeof value === "function";
|
|
|
34
34
|
var isDefined = (value) => typeof value !== "undefined";
|
|
35
35
|
var isString = (value) => typeof value === "string";
|
|
36
36
|
var isObject = (value) => typeof value === "object" && !!value && value.toString() === "[object Object]";
|
|
37
|
-
var isNumber = (value) => typeof value === "number";
|
|
37
|
+
var isNumber = (value) => typeof value === "number" && !Number.isNaN(value);
|
|
38
38
|
var isBoolean = (value) => typeof value === "boolean";
|
|
39
39
|
var isArray = Array.isArray;
|
|
40
40
|
if (module.exports.default) module.exports = module.exports.default;
|
package/utils/is.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../packages/js-toolkit/utils/is.
|
|
4
|
-
"sourcesContent": ["// eslint-disable-next-line no-undef\nexport const isDev = typeof __DEV__ !== 'undefined' && __DEV__;\n\n/**\n * Test if the given value is a function.\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACO,IAAM,QAAQ,OAAO,YAAY,eAAe;
|
|
3
|
+
"sources": ["../../packages/js-toolkit/utils/is.ts"],
|
|
4
|
+
"sourcesContent": ["// eslint-disable-next-line no-undef\nexport const isDev = typeof __DEV__ !== 'undefined' && __DEV__;\n\n/**\n * Test if the given value is a function.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport const isFunction = (value: unknown): value is Function => typeof value === 'function';\n\n/**\n * Test if a value is defined or not.\n */\nexport const isDefined = (value: unknown): boolean => typeof value !== 'undefined';\n\n/**\n * Test if value is a string.\n */\nexport const isString = (value: unknown): value is string => typeof value === 'string';\n\n/**\n * Test if the given value is an object.\n */\nexport const isObject = (value: unknown): boolean =>\n typeof value === 'object' && !!value && value.toString() === '[object Object]';\n\n/**\n * Test if a given value is a number.\n */\nexport const isNumber = (value: unknown): value is number =>\n typeof value === 'number' && !Number.isNaN(value);\n\n/**\n * Test if a given value is a boolean.\n */\nexport const isBoolean = (value: unknown): value is boolean => typeof value === 'boolean';\n\n// eslint-disable-next-line prefer-destructuring\nexport const isArray = Array.isArray;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACO,IAAM,QAAQ,OAAO,YAAY,eAAe;AAMhD,IAAM,aAAa,CAAC,UAAsC,OAAO,UAAU;AAK3E,IAAM,YAAY,CAAC,UAA4B,OAAO,UAAU;AAKhE,IAAM,WAAW,CAAC,UAAoC,OAAO,UAAU;AAKvE,IAAM,WAAW,CAAC,UACvB,OAAO,UAAU,YAAY,CAAC,CAAC,SAAS,MAAM,SAAS,MAAM;AAKxD,IAAM,WAAW,CAAC,UACvB,OAAO,UAAU,YAAY,CAAC,OAAO,MAAM,KAAK;AAK3C,IAAM,YAAY,CAAC,UAAqC,OAAO,UAAU;AAGzE,IAAM,UAAU,MAAM;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/utils/is.d.ts
CHANGED
|
@@ -1,8 +1,26 @@
|
|
|
1
|
-
export const isDev: boolean;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export declare const isDev: boolean;
|
|
2
|
+
/**
|
|
3
|
+
* Test if the given value is a function.
|
|
4
|
+
*/
|
|
5
|
+
export declare const isFunction: (value: unknown) => value is Function;
|
|
6
|
+
/**
|
|
7
|
+
* Test if a value is defined or not.
|
|
8
|
+
*/
|
|
9
|
+
export declare const isDefined: (value: unknown) => boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Test if value is a string.
|
|
12
|
+
*/
|
|
13
|
+
export declare const isString: (value: unknown) => value is string;
|
|
14
|
+
/**
|
|
15
|
+
* Test if the given value is an object.
|
|
16
|
+
*/
|
|
17
|
+
export declare const isObject: (value: unknown) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Test if a given value is a number.
|
|
20
|
+
*/
|
|
21
|
+
export declare const isNumber: (value: unknown) => value is number;
|
|
22
|
+
/**
|
|
23
|
+
* Test if a given value is a boolean.
|
|
24
|
+
*/
|
|
25
|
+
export declare const isBoolean: (value: unknown) => value is boolean;
|
|
26
|
+
export declare const isArray: (arg: any) => arg is any[];
|
package/utils/is.js
CHANGED
|
@@ -3,7 +3,7 @@ const isFunction = (value) => typeof value === "function";
|
|
|
3
3
|
const isDefined = (value) => typeof value !== "undefined";
|
|
4
4
|
const isString = (value) => typeof value === "string";
|
|
5
5
|
const isObject = (value) => typeof value === "object" && !!value && value.toString() === "[object Object]";
|
|
6
|
-
const isNumber = (value) => typeof value === "number";
|
|
6
|
+
const isNumber = (value) => typeof value === "number" && !Number.isNaN(value);
|
|
7
7
|
const isBoolean = (value) => typeof value === "boolean";
|
|
8
8
|
const isArray = Array.isArray;
|
|
9
9
|
export {
|
package/utils/is.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../packages/js-toolkit/utils/is.
|
|
4
|
-
"sourcesContent": ["// eslint-disable-next-line no-undef\nexport const isDev = typeof __DEV__ !== 'undefined' && __DEV__;\n\n/**\n * Test if the given value is a function.\n
|
|
5
|
-
"mappings": "AACO,MAAM,QAAQ,OAAO,YAAY,eAAe;
|
|
3
|
+
"sources": ["../../packages/js-toolkit/utils/is.ts"],
|
|
4
|
+
"sourcesContent": ["// eslint-disable-next-line no-undef\nexport const isDev = typeof __DEV__ !== 'undefined' && __DEV__;\n\n/**\n * Test if the given value is a function.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport const isFunction = (value: unknown): value is Function => typeof value === 'function';\n\n/**\n * Test if a value is defined or not.\n */\nexport const isDefined = (value: unknown): boolean => typeof value !== 'undefined';\n\n/**\n * Test if value is a string.\n */\nexport const isString = (value: unknown): value is string => typeof value === 'string';\n\n/**\n * Test if the given value is an object.\n */\nexport const isObject = (value: unknown): boolean =>\n typeof value === 'object' && !!value && value.toString() === '[object Object]';\n\n/**\n * Test if a given value is a number.\n */\nexport const isNumber = (value: unknown): value is number =>\n typeof value === 'number' && !Number.isNaN(value);\n\n/**\n * Test if a given value is a boolean.\n */\nexport const isBoolean = (value: unknown): value is boolean => typeof value === 'boolean';\n\n// eslint-disable-next-line prefer-destructuring\nexport const isArray = Array.isArray;\n"],
|
|
5
|
+
"mappings": "AACO,MAAM,QAAQ,OAAO,YAAY,eAAe;AAMhD,MAAM,aAAa,CAAC,UAAsC,OAAO,UAAU;AAK3E,MAAM,YAAY,CAAC,UAA4B,OAAO,UAAU;AAKhE,MAAM,WAAW,CAAC,UAAoC,OAAO,UAAU;AAKvE,MAAM,WAAW,CAAC,UACvB,OAAO,UAAU,YAAY,CAAC,CAAC,SAAS,MAAM,SAAS,MAAM;AAKxD,MAAM,WAAW,CAAC,UACvB,OAAO,UAAU,YAAY,CAAC,OAAO,MAAM,KAAK;AAK3C,MAAM,YAAY,CAAC,UAAqC,OAAO,UAAU;AAGzE,MAAM,UAAU,MAAM;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/utils/keyCodes.cjs
CHANGED
|
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
|
-
// packages/js-toolkit/utils/keyCodes.
|
|
19
|
+
// packages/js-toolkit/utils/keyCodes.ts
|
|
20
20
|
var keyCodes_exports = {};
|
|
21
21
|
__export(keyCodes_exports, {
|
|
22
22
|
default: () => keyCodes_default
|
package/utils/keyCodes.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../packages/js-toolkit/utils/keyCodes.
|
|
4
|
-
"sourcesContent": ["export default {\n ENTER: 13,\n SPACE: 32,\n TAB: 9,\n ESC: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n};\n"],
|
|
3
|
+
"sources": ["../../packages/js-toolkit/utils/keyCodes.ts"],
|
|
4
|
+
"sourcesContent": ["export default {\n ENTER: 13,\n SPACE: 32,\n TAB: 9,\n ESC: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n} as const;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAO,mBAAQ;AAAA,EACb,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AAAA,EACL,KAAK;AAAA,EACL,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,MAAM;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/utils/keyCodes.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
1
|
+
declare const _default: {
|
|
2
|
+
readonly ENTER: 13;
|
|
3
|
+
readonly SPACE: 32;
|
|
4
|
+
readonly TAB: 9;
|
|
5
|
+
readonly ESC: 27;
|
|
6
|
+
readonly LEFT: 37;
|
|
7
|
+
readonly UP: 38;
|
|
8
|
+
readonly RIGHT: 39;
|
|
9
|
+
readonly DOWN: 40;
|
|
10
|
+
};
|
|
11
11
|
export default _default;
|
package/utils/keyCodes.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../packages/js-toolkit/utils/keyCodes.
|
|
4
|
-
"sourcesContent": ["export default {\n ENTER: 13,\n SPACE: 32,\n TAB: 9,\n ESC: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n};\n"],
|
|
3
|
+
"sources": ["../../packages/js-toolkit/utils/keyCodes.ts"],
|
|
4
|
+
"sourcesContent": ["export default {\n ENTER: 13,\n SPACE: 32,\n TAB: 9,\n ESC: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n} as const;\n"],
|
|
5
5
|
"mappings": "AAAA,IAAO,mBAAQ;AAAA,EACb,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AAAA,EACL,KAAK;AAAA,EACL,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,MAAM;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/utils/math/clamp.cjs
CHANGED
|
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
|
-
// packages/js-toolkit/utils/math/clamp.
|
|
19
|
+
// packages/js-toolkit/utils/math/clamp.ts
|
|
20
20
|
var clamp_exports = {};
|
|
21
21
|
__export(clamp_exports, {
|
|
22
22
|
default: () => clamp
|
package/utils/math/clamp.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/js-toolkit/utils/math/clamp.
|
|
4
|
-
"sourcesContent": ["/**\n * Clamp a value in a given range.\n * @param {number} value\n * @param {number} min\n * @param {number} max\n * @returns {number}\n */\nexport default function clamp(value, min, max) {\n /* eslint-disable no-nested-ternary */\n return min < max\n ? value < min\n ? min\n : value > max\n ? max\n : value\n : value < max\n ? max\n : value > min\n ? min\n : value;\n /* eslint-enable no-nested-ternary */\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOe,SAAR,MAAuB,
|
|
3
|
+
"sources": ["../../../packages/js-toolkit/utils/math/clamp.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Clamp a value in a given range.\n * @param {number} value\n * @param {number} min\n * @param {number} max\n * @returns {number}\n */\nexport default function clamp(value: number, min: number, max: number) {\n /* eslint-disable no-nested-ternary */\n return min < max\n ? value < min\n ? min\n : value > max\n ? max\n : value\n : value < max\n ? max\n : value > min\n ? min\n : value;\n /* eslint-enable no-nested-ternary */\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOe,SAAR,MAAuB,OAAe,KAAa,KAAa;AAErE,SAAO,MAAM,MACT,QAAQ,MACN,MACA,QAAQ,MACR,MACA,QACF,QAAQ,MACR,MACA,QAAQ,MACR,MACA;AAEN;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/utils/math/clamp.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/js-toolkit/utils/math/clamp.
|
|
4
|
-
"sourcesContent": ["/**\n * Clamp a value in a given range.\n * @param {number} value\n * @param {number} min\n * @param {number} max\n * @returns {number}\n */\nexport default function clamp(value, min, max) {\n /* eslint-disable no-nested-ternary */\n return min < max\n ? value < min\n ? min\n : value > max\n ? max\n : value\n : value < max\n ? max\n : value > min\n ? min\n : value;\n /* eslint-enable no-nested-ternary */\n}\n"],
|
|
5
|
-
"mappings": "AAOe,SAAR,MAAuB,
|
|
3
|
+
"sources": ["../../../packages/js-toolkit/utils/math/clamp.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Clamp a value in a given range.\n * @param {number} value\n * @param {number} min\n * @param {number} max\n * @returns {number}\n */\nexport default function clamp(value: number, min: number, max: number) {\n /* eslint-disable no-nested-ternary */\n return min < max\n ? value < min\n ? min\n : value > max\n ? max\n : value\n : value < max\n ? max\n : value > min\n ? min\n : value;\n /* eslint-enable no-nested-ternary */\n}\n"],
|
|
5
|
+
"mappings": "AAOe,SAAR,MAAuB,OAAe,KAAa,KAAa;AAErE,SAAO,MAAM,MACT,QAAQ,MACN,MACA,QAAQ,MACR,MACA,QACF,QAAQ,MACR,MACA,QAAQ,MACR,MACA;AAEN;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/utils/math/clamp01.cjs
CHANGED
|
@@ -22,7 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
));
|
|
23
23
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
24
|
|
|
25
|
-
// packages/js-toolkit/utils/math/clamp01.
|
|
25
|
+
// packages/js-toolkit/utils/math/clamp01.ts
|
|
26
26
|
var clamp01_exports = {};
|
|
27
27
|
__export(clamp01_exports, {
|
|
28
28
|
default: () => clamp01
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/js-toolkit/utils/math/clamp01.
|
|
4
|
-
"sourcesContent": ["import clamp from './clamp.js';\n\n/**\n * Clamp a value in the 0\u20131 range.\n * @param {number} value\n * @returns {number}\n */\nexport default function clamp01(value) {\n return clamp(value, 0, 1);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAOH,SAAR,QAAyB,
|
|
3
|
+
"sources": ["../../../packages/js-toolkit/utils/math/clamp01.ts"],
|
|
4
|
+
"sourcesContent": ["import clamp from './clamp.js';\n\n/**\n * Clamp a value in the 0\u20131 range.\n * @param {number} value\n * @returns {number}\n */\nexport default function clamp01(value: number) {\n return clamp(value, 0, 1);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAOH,SAAR,QAAyB,OAAe;AAC7C,aAAO,aAAAA,SAAM,OAAO,GAAG,CAAC;AAC1B;",
|
|
6
6
|
"names": ["clamp"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/js-toolkit/utils/math/clamp01.
|
|
4
|
-
"sourcesContent": ["import clamp from './clamp.js';\n\n/**\n * Clamp a value in the 0\u20131 range.\n * @param {number} value\n * @returns {number}\n */\nexport default function clamp01(value) {\n return clamp(value, 0, 1);\n}\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAOH,SAAR,QAAyB,
|
|
3
|
+
"sources": ["../../../packages/js-toolkit/utils/math/clamp01.ts"],
|
|
4
|
+
"sourcesContent": ["import clamp from './clamp.js';\n\n/**\n * Clamp a value in the 0\u20131 range.\n * @param {number} value\n * @returns {number}\n */\nexport default function clamp01(value: number) {\n return clamp(value, 0, 1);\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,WAAW;AAOH,SAAR,QAAyB,OAAe;AAC7C,SAAO,MAAM,OAAO,GAAG,CAAC;AAC1B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
|
-
// packages/js-toolkit/utils/math/createEases.
|
|
19
|
+
// packages/js-toolkit/utils/math/createEases.ts
|
|
20
20
|
var createEases_exports = {};
|
|
21
21
|
__export(createEases_exports, {
|
|
22
22
|
createEaseInOut: () => createEaseInOut,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/js-toolkit/utils/math/createEases.
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
3
|
+
"sources": ["../../../packages/js-toolkit/utils/math/createEases.ts"],
|
|
4
|
+
"sourcesContent": ["export type EasingFunction = (progress: number) => number;\n\n/**\n * Create an out easing function.\n *\n * @param {EasingFunction} easeIn The ease in function.\n * @returns {EasingFunction} The out function.\n */\nexport function createEaseOut(easeIn: EasingFunction): EasingFunction {\n return (progress) => 1 - easeIn(1 - progress);\n}\n\n/**\n * Create an in-out easing function.\n *\n * @param {EasingFunction} easeIn The ease in function.\n * @returns {EasingFunction} The in-out function.\n */\nexport function createEaseInOut(easeIn: EasingFunction): EasingFunction {\n /* eslint-disable no-nested-ternary */\n // eslint-disable-next-line no-confusing-arrow\n return (progress) =>\n progress === 0\n ? 0\n : progress === 1\n ? 1\n : progress < 0.5\n ? easeIn(progress * 2) / 2\n : 1 - easeIn((1 - progress) * 2) / 2;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQO,SAAS,cAAc,QAAwC;AACpE,SAAO,CAAC,aAAa,IAAI,OAAO,IAAI,QAAQ;AAC9C;AAQO,SAAS,gBAAgB,QAAwC;AAGtE,SAAO,CAAC,aACN,aAAa,IACT,IACA,aAAa,IACb,IACA,WAAW,MACX,OAAO,WAAW,CAAC,IAAI,IACvB,IAAI,QAAQ,IAAI,YAAY,CAAC,IAAI;AACzC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
* @typedef {(progress: number) => number} EasingFunction
|
|
3
|
-
*/
|
|
1
|
+
export type EasingFunction = (progress: number) => number;
|
|
4
2
|
/**
|
|
5
3
|
* Create an out easing function.
|
|
6
4
|
*
|
|
7
5
|
* @param {EasingFunction} easeIn The ease in function.
|
|
8
6
|
* @returns {EasingFunction} The out function.
|
|
9
7
|
*/
|
|
10
|
-
export function createEaseOut(easeIn: EasingFunction): EasingFunction;
|
|
8
|
+
export declare function createEaseOut(easeIn: EasingFunction): EasingFunction;
|
|
11
9
|
/**
|
|
12
10
|
* Create an in-out easing function.
|
|
13
11
|
*
|
|
14
12
|
* @param {EasingFunction} easeIn The ease in function.
|
|
15
13
|
* @returns {EasingFunction} The in-out function.
|
|
16
14
|
*/
|
|
17
|
-
export function createEaseInOut(easeIn: EasingFunction): EasingFunction;
|
|
18
|
-
export type EasingFunction = (progress: number) => number;
|
|
15
|
+
export declare function createEaseInOut(easeIn: EasingFunction): EasingFunction;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/js-toolkit/utils/math/createEases.
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
3
|
+
"sources": ["../../../packages/js-toolkit/utils/math/createEases.ts"],
|
|
4
|
+
"sourcesContent": ["export type EasingFunction = (progress: number) => number;\n\n/**\n * Create an out easing function.\n *\n * @param {EasingFunction} easeIn The ease in function.\n * @returns {EasingFunction} The out function.\n */\nexport function createEaseOut(easeIn: EasingFunction): EasingFunction {\n return (progress) => 1 - easeIn(1 - progress);\n}\n\n/**\n * Create an in-out easing function.\n *\n * @param {EasingFunction} easeIn The ease in function.\n * @returns {EasingFunction} The in-out function.\n */\nexport function createEaseInOut(easeIn: EasingFunction): EasingFunction {\n /* eslint-disable no-nested-ternary */\n // eslint-disable-next-line no-confusing-arrow\n return (progress) =>\n progress === 0\n ? 0\n : progress === 1\n ? 1\n : progress < 0.5\n ? easeIn(progress * 2) / 2\n : 1 - easeIn((1 - progress) * 2) / 2;\n}\n"],
|
|
5
|
+
"mappings": "AAQO,SAAS,cAAc,QAAwC;AACpE,SAAO,CAAC,aAAa,IAAI,OAAO,IAAI,QAAQ;AAC9C;AAQO,SAAS,gBAAgB,QAAwC;AAGtE,SAAO,CAAC,aACN,aAAa,IACT,IACA,aAAa,IACb,IACA,WAAW,MACX,OAAO,WAAW,CAAC,IAAI,IACvB,IAAI,QAAQ,IAAI,YAAY,CAAC,IAAI;AACzC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/utils/math/damp.cjs
CHANGED
|
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
|
-
// packages/js-toolkit/utils/math/damp.
|
|
19
|
+
// packages/js-toolkit/utils/math/damp.ts
|
|
20
20
|
var damp_exports = {};
|
|
21
21
|
__export(damp_exports, {
|
|
22
22
|
default: () => damp
|
package/utils/math/damp.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/js-toolkit/utils/math/damp.
|
|
4
|
-
"sourcesContent": ["/**\n * Get the next damped value for a given factor.\n *\n * @param {number} targetValue The final value.\n * @param {number} currentValue The current value.\n * @param {number} [factor=0.5] The factor used to reach the target value.\n * @param {number} [precision=0.01] The precision used to calculate the latest value.\n * @returns {number} The next value.\n */\nexport default function damp(targetValue
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASe,SAAR,
|
|
3
|
+
"sources": ["../../../packages/js-toolkit/utils/math/damp.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Get the next damped value for a given factor.\n *\n * @param {number} targetValue The final value.\n * @param {number} currentValue The current value.\n * @param {number} [factor=0.5] The factor used to reach the target value.\n * @param {number} [precision=0.01] The precision used to calculate the latest value.\n * @returns {number} The next value.\n */\nexport default function damp(\n targetValue: number,\n currentValue: number,\n factor = 0.5,\n precision = 0.01,\n) {\n return Math.abs(targetValue - currentValue) < precision\n ? targetValue\n : currentValue + (targetValue - currentValue) * factor;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASe,SAAR,KACL,aACA,cACA,SAAS,KACT,YAAY,MACZ;AACA,SAAO,KAAK,IAAI,cAAc,YAAY,IAAI,YAC1C,cACA,gBAAgB,cAAc,gBAAgB;AACpD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/utils/math/damp.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/js-toolkit/utils/math/damp.
|
|
4
|
-
"sourcesContent": ["/**\n * Get the next damped value for a given factor.\n *\n * @param {number} targetValue The final value.\n * @param {number} currentValue The current value.\n * @param {number} [factor=0.5] The factor used to reach the target value.\n * @param {number} [precision=0.01] The precision used to calculate the latest value.\n * @returns {number} The next value.\n */\nexport default function damp(targetValue
|
|
5
|
-
"mappings": "AASe,SAAR,
|
|
3
|
+
"sources": ["../../../packages/js-toolkit/utils/math/damp.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Get the next damped value for a given factor.\n *\n * @param {number} targetValue The final value.\n * @param {number} currentValue The current value.\n * @param {number} [factor=0.5] The factor used to reach the target value.\n * @param {number} [precision=0.01] The precision used to calculate the latest value.\n * @returns {number} The next value.\n */\nexport default function damp(\n targetValue: number,\n currentValue: number,\n factor = 0.5,\n precision = 0.01,\n) {\n return Math.abs(targetValue - currentValue) < precision\n ? targetValue\n : currentValue + (targetValue - currentValue) * factor;\n}\n"],
|
|
5
|
+
"mappings": "AASe,SAAR,KACL,aACA,cACA,SAAS,KACT,YAAY,MACZ;AACA,SAAO,KAAK,IAAI,cAAc,YAAY,IAAI,YAC1C,cACA,gBAAgB,cAAc,gBAAgB;AACpD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/utils/math/ease.cjs
CHANGED
|
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
|
-
// packages/js-toolkit/utils/math/ease.
|
|
19
|
+
// packages/js-toolkit/utils/math/ease.ts
|
|
20
20
|
var ease_exports = {};
|
|
21
21
|
__export(ease_exports, {
|
|
22
22
|
easeInCirc: () => easeInCirc,
|
package/utils/math/ease.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/js-toolkit/utils/math/ease.
|
|
4
|
-
"sourcesContent": ["import { createEaseOut, createEaseInOut } from './createEases.js';\n\n/**\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInQuad(progress) {\n return progress ** 2;\n}\n\nexport const easeOutQuad = createEaseOut(easeInQuad);\nexport const easeInOutQuad = createEaseInOut(easeInQuad);\n\n/**\n * Ease in cubic.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInCubic(progress) {\n return progress ** 3;\n}\n\nexport const easeOutCubic = createEaseOut(easeInCubic);\nexport const easeInOutCubic = createEaseInOut(easeInCubic);\n\n/**\n * Ease in quart.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInQuart(progress) {\n return progress ** 4;\n}\n\nexport const easeOutQuart = createEaseOut(easeInQuart);\nexport const easeInOutQuart = createEaseInOut(easeInQuart);\n\n/**\n * Ease in quint.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInQuint(progress) {\n return progress ** 5;\n}\n\nexport const easeOutQuint = createEaseOut(easeInQuint);\nexport const easeInOutQuint = createEaseInOut(easeInQuint);\n\n/**\n * Ease in sine.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInSine(progress) {\n return progress === 1 ? 1 : -Math.cos((progress * Math.PI) / 2) + 1;\n}\n\nexport const easeOutSine = createEaseOut(easeInSine);\nexport const easeInOutSine = createEaseInOut(easeInSine);\n\n/**\n * Ease in circ.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInCirc(progress) {\n return -(Math.sqrt(1 - progress * progress) - 1);\n}\n\nexport const easeOutCirc = createEaseOut(easeInCirc);\nexport const easeInOutCirc = createEaseInOut(easeInCirc);\n\n/**\n * Ease in exponential.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInExpo(progress) {\n return 2 ** (10 * (progress - 1));\n}\n\nexport const easeOutExpo = createEaseOut(easeInExpo);\nexport const easeInOutExpo = createEaseInOut(easeInExpo);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA+C;AAMxC,SAAS,WAAW,
|
|
3
|
+
"sources": ["../../../packages/js-toolkit/utils/math/ease.ts"],
|
|
4
|
+
"sourcesContent": ["import { createEaseOut, createEaseInOut } from './createEases.js';\n\n/**\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInQuad(progress: number) {\n return progress ** 2;\n}\n\nexport const easeOutQuad = createEaseOut(easeInQuad);\nexport const easeInOutQuad = createEaseInOut(easeInQuad);\n\n/**\n * Ease in cubic.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInCubic(progress: number) {\n return progress ** 3;\n}\n\nexport const easeOutCubic = createEaseOut(easeInCubic);\nexport const easeInOutCubic = createEaseInOut(easeInCubic);\n\n/**\n * Ease in quart.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInQuart(progress: number) {\n return progress ** 4;\n}\n\nexport const easeOutQuart = createEaseOut(easeInQuart);\nexport const easeInOutQuart = createEaseInOut(easeInQuart);\n\n/**\n * Ease in quint.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInQuint(progress: number) {\n return progress ** 5;\n}\n\nexport const easeOutQuint = createEaseOut(easeInQuint);\nexport const easeInOutQuint = createEaseInOut(easeInQuint);\n\n/**\n * Ease in sine.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInSine(progress: number) {\n return progress === 1 ? 1 : -Math.cos((progress * Math.PI) / 2) + 1;\n}\n\nexport const easeOutSine = createEaseOut(easeInSine);\nexport const easeInOutSine = createEaseInOut(easeInSine);\n\n/**\n * Ease in circ.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInCirc(progress: number) {\n return -(Math.sqrt(1 - progress * progress) - 1);\n}\n\nexport const easeOutCirc = createEaseOut(easeInCirc);\nexport const easeInOutCirc = createEaseInOut(easeInCirc);\n\n/**\n * Ease in exponential.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInExpo(progress: number) {\n return 2 ** (10 * (progress - 1));\n}\n\nexport const easeOutExpo = createEaseOut(easeInExpo);\nexport const easeInOutExpo = createEaseInOut(easeInExpo);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA+C;AAMxC,SAAS,WAAW,UAAkB;AAC3C,SAAO,YAAY;AACrB;AAEO,IAAM,kBAAc,kCAAc,UAAU;AAC5C,IAAM,oBAAgB,oCAAgB,UAAU;AAQhD,SAAS,YAAY,UAAkB;AAC5C,SAAO,YAAY;AACrB;AAEO,IAAM,mBAAe,kCAAc,WAAW;AAC9C,IAAM,qBAAiB,oCAAgB,WAAW;AAQlD,SAAS,YAAY,UAAkB;AAC5C,SAAO,YAAY;AACrB;AAEO,IAAM,mBAAe,kCAAc,WAAW;AAC9C,IAAM,qBAAiB,oCAAgB,WAAW;AAQlD,SAAS,YAAY,UAAkB;AAC5C,SAAO,YAAY;AACrB;AAEO,IAAM,mBAAe,kCAAc,WAAW;AAC9C,IAAM,qBAAiB,oCAAgB,WAAW;AAQlD,SAAS,WAAW,UAAkB;AAC3C,SAAO,aAAa,IAAI,IAAI,CAAC,KAAK,IAAK,WAAW,KAAK,KAAM,CAAC,IAAI;AACpE;AAEO,IAAM,kBAAc,kCAAc,UAAU;AAC5C,IAAM,oBAAgB,oCAAgB,UAAU;AAQhD,SAAS,WAAW,UAAkB;AAC3C,SAAO,EAAE,KAAK,KAAK,IAAI,WAAW,QAAQ,IAAI;AAChD;AAEO,IAAM,kBAAc,kCAAc,UAAU;AAC5C,IAAM,oBAAgB,oCAAgB,UAAU;AAQhD,SAAS,WAAW,UAAkB;AAC3C,SAAO,MAAM,MAAM,WAAW;AAChC;AAEO,IAAM,kBAAc,kCAAc,UAAU;AAC5C,IAAM,oBAAgB,oCAAgB,UAAU;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/utils/math/ease.d.ts
CHANGED
|
@@ -2,60 +2,60 @@
|
|
|
2
2
|
* @param {number} progress Progress value betwen 0 and 1.
|
|
3
3
|
* @returns {number} Eased value between 0 and 1.
|
|
4
4
|
*/
|
|
5
|
-
export function easeInQuad(progress: number): number;
|
|
5
|
+
export declare function easeInQuad(progress: number): number;
|
|
6
|
+
export declare const easeOutQuad: import("./createEases.js").EasingFunction;
|
|
7
|
+
export declare const easeInOutQuad: import("./createEases.js").EasingFunction;
|
|
6
8
|
/**
|
|
7
9
|
* Ease in cubic.
|
|
8
10
|
*
|
|
9
11
|
* @param {number} progress Progress value betwen 0 and 1.
|
|
10
12
|
* @returns {number} Eased value between 0 and 1.
|
|
11
13
|
*/
|
|
12
|
-
export function easeInCubic(progress: number): number;
|
|
14
|
+
export declare function easeInCubic(progress: number): number;
|
|
15
|
+
export declare const easeOutCubic: import("./createEases.js").EasingFunction;
|
|
16
|
+
export declare const easeInOutCubic: import("./createEases.js").EasingFunction;
|
|
13
17
|
/**
|
|
14
18
|
* Ease in quart.
|
|
15
19
|
*
|
|
16
20
|
* @param {number} progress Progress value betwen 0 and 1.
|
|
17
21
|
* @returns {number} Eased value between 0 and 1.
|
|
18
22
|
*/
|
|
19
|
-
export function easeInQuart(progress: number): number;
|
|
23
|
+
export declare function easeInQuart(progress: number): number;
|
|
24
|
+
export declare const easeOutQuart: import("./createEases.js").EasingFunction;
|
|
25
|
+
export declare const easeInOutQuart: import("./createEases.js").EasingFunction;
|
|
20
26
|
/**
|
|
21
27
|
* Ease in quint.
|
|
22
28
|
*
|
|
23
29
|
* @param {number} progress Progress value betwen 0 and 1.
|
|
24
30
|
* @returns {number} Eased value between 0 and 1.
|
|
25
31
|
*/
|
|
26
|
-
export function easeInQuint(progress: number): number;
|
|
32
|
+
export declare function easeInQuint(progress: number): number;
|
|
33
|
+
export declare const easeOutQuint: import("./createEases.js").EasingFunction;
|
|
34
|
+
export declare const easeInOutQuint: import("./createEases.js").EasingFunction;
|
|
27
35
|
/**
|
|
28
36
|
* Ease in sine.
|
|
29
37
|
*
|
|
30
38
|
* @param {number} progress Progress value betwen 0 and 1.
|
|
31
39
|
* @returns {number} Eased value between 0 and 1.
|
|
32
40
|
*/
|
|
33
|
-
export function easeInSine(progress: number): number;
|
|
41
|
+
export declare function easeInSine(progress: number): number;
|
|
42
|
+
export declare const easeOutSine: import("./createEases.js").EasingFunction;
|
|
43
|
+
export declare const easeInOutSine: import("./createEases.js").EasingFunction;
|
|
34
44
|
/**
|
|
35
45
|
* Ease in circ.
|
|
36
46
|
*
|
|
37
47
|
* @param {number} progress Progress value betwen 0 and 1.
|
|
38
48
|
* @returns {number} Eased value between 0 and 1.
|
|
39
49
|
*/
|
|
40
|
-
export function easeInCirc(progress: number): number;
|
|
50
|
+
export declare function easeInCirc(progress: number): number;
|
|
51
|
+
export declare const easeOutCirc: import("./createEases.js").EasingFunction;
|
|
52
|
+
export declare const easeInOutCirc: import("./createEases.js").EasingFunction;
|
|
41
53
|
/**
|
|
42
54
|
* Ease in exponential.
|
|
43
55
|
*
|
|
44
56
|
* @param {number} progress Progress value betwen 0 and 1.
|
|
45
57
|
* @returns {number} Eased value between 0 and 1.
|
|
46
58
|
*/
|
|
47
|
-
export function easeInExpo(progress: number): number;
|
|
48
|
-
export const
|
|
49
|
-
export const
|
|
50
|
-
export const easeOutCubic: import("./createEases.js").EasingFunction;
|
|
51
|
-
export const easeInOutCubic: import("./createEases.js").EasingFunction;
|
|
52
|
-
export const easeOutQuart: import("./createEases.js").EasingFunction;
|
|
53
|
-
export const easeInOutQuart: import("./createEases.js").EasingFunction;
|
|
54
|
-
export const easeOutQuint: import("./createEases.js").EasingFunction;
|
|
55
|
-
export const easeInOutQuint: import("./createEases.js").EasingFunction;
|
|
56
|
-
export const easeOutSine: import("./createEases.js").EasingFunction;
|
|
57
|
-
export const easeInOutSine: import("./createEases.js").EasingFunction;
|
|
58
|
-
export const easeOutCirc: import("./createEases.js").EasingFunction;
|
|
59
|
-
export const easeInOutCirc: import("./createEases.js").EasingFunction;
|
|
60
|
-
export const easeOutExpo: import("./createEases.js").EasingFunction;
|
|
61
|
-
export const easeInOutExpo: import("./createEases.js").EasingFunction;
|
|
59
|
+
export declare function easeInExpo(progress: number): number;
|
|
60
|
+
export declare const easeOutExpo: import("./createEases.js").EasingFunction;
|
|
61
|
+
export declare const easeInOutExpo: import("./createEases.js").EasingFunction;
|
package/utils/math/ease.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/js-toolkit/utils/math/ease.
|
|
4
|
-
"sourcesContent": ["import { createEaseOut, createEaseInOut } from './createEases.js';\n\n/**\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInQuad(progress) {\n return progress ** 2;\n}\n\nexport const easeOutQuad = createEaseOut(easeInQuad);\nexport const easeInOutQuad = createEaseInOut(easeInQuad);\n\n/**\n * Ease in cubic.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInCubic(progress) {\n return progress ** 3;\n}\n\nexport const easeOutCubic = createEaseOut(easeInCubic);\nexport const easeInOutCubic = createEaseInOut(easeInCubic);\n\n/**\n * Ease in quart.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInQuart(progress) {\n return progress ** 4;\n}\n\nexport const easeOutQuart = createEaseOut(easeInQuart);\nexport const easeInOutQuart = createEaseInOut(easeInQuart);\n\n/**\n * Ease in quint.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInQuint(progress) {\n return progress ** 5;\n}\n\nexport const easeOutQuint = createEaseOut(easeInQuint);\nexport const easeInOutQuint = createEaseInOut(easeInQuint);\n\n/**\n * Ease in sine.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInSine(progress) {\n return progress === 1 ? 1 : -Math.cos((progress * Math.PI) / 2) + 1;\n}\n\nexport const easeOutSine = createEaseOut(easeInSine);\nexport const easeInOutSine = createEaseInOut(easeInSine);\n\n/**\n * Ease in circ.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInCirc(progress) {\n return -(Math.sqrt(1 - progress * progress) - 1);\n}\n\nexport const easeOutCirc = createEaseOut(easeInCirc);\nexport const easeInOutCirc = createEaseInOut(easeInCirc);\n\n/**\n * Ease in exponential.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInExpo(progress) {\n return 2 ** (10 * (progress - 1));\n}\n\nexport const easeOutExpo = createEaseOut(easeInExpo);\nexport const easeInOutExpo = createEaseInOut(easeInExpo);\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,eAAe,uBAAuB;AAMxC,SAAS,WAAW,
|
|
3
|
+
"sources": ["../../../packages/js-toolkit/utils/math/ease.ts"],
|
|
4
|
+
"sourcesContent": ["import { createEaseOut, createEaseInOut } from './createEases.js';\n\n/**\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInQuad(progress: number) {\n return progress ** 2;\n}\n\nexport const easeOutQuad = createEaseOut(easeInQuad);\nexport const easeInOutQuad = createEaseInOut(easeInQuad);\n\n/**\n * Ease in cubic.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInCubic(progress: number) {\n return progress ** 3;\n}\n\nexport const easeOutCubic = createEaseOut(easeInCubic);\nexport const easeInOutCubic = createEaseInOut(easeInCubic);\n\n/**\n * Ease in quart.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInQuart(progress: number) {\n return progress ** 4;\n}\n\nexport const easeOutQuart = createEaseOut(easeInQuart);\nexport const easeInOutQuart = createEaseInOut(easeInQuart);\n\n/**\n * Ease in quint.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInQuint(progress: number) {\n return progress ** 5;\n}\n\nexport const easeOutQuint = createEaseOut(easeInQuint);\nexport const easeInOutQuint = createEaseInOut(easeInQuint);\n\n/**\n * Ease in sine.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInSine(progress: number) {\n return progress === 1 ? 1 : -Math.cos((progress * Math.PI) / 2) + 1;\n}\n\nexport const easeOutSine = createEaseOut(easeInSine);\nexport const easeInOutSine = createEaseInOut(easeInSine);\n\n/**\n * Ease in circ.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInCirc(progress: number) {\n return -(Math.sqrt(1 - progress * progress) - 1);\n}\n\nexport const easeOutCirc = createEaseOut(easeInCirc);\nexport const easeInOutCirc = createEaseInOut(easeInCirc);\n\n/**\n * Ease in exponential.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInExpo(progress: number) {\n return 2 ** (10 * (progress - 1));\n}\n\nexport const easeOutExpo = createEaseOut(easeInExpo);\nexport const easeInOutExpo = createEaseInOut(easeInExpo);\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,eAAe,uBAAuB;AAMxC,SAAS,WAAW,UAAkB;AAC3C,SAAO,YAAY;AACrB;AAEO,MAAM,cAAc,cAAc,UAAU;AAC5C,MAAM,gBAAgB,gBAAgB,UAAU;AAQhD,SAAS,YAAY,UAAkB;AAC5C,SAAO,YAAY;AACrB;AAEO,MAAM,eAAe,cAAc,WAAW;AAC9C,MAAM,iBAAiB,gBAAgB,WAAW;AAQlD,SAAS,YAAY,UAAkB;AAC5C,SAAO,YAAY;AACrB;AAEO,MAAM,eAAe,cAAc,WAAW;AAC9C,MAAM,iBAAiB,gBAAgB,WAAW;AAQlD,SAAS,YAAY,UAAkB;AAC5C,SAAO,YAAY;AACrB;AAEO,MAAM,eAAe,cAAc,WAAW;AAC9C,MAAM,iBAAiB,gBAAgB,WAAW;AAQlD,SAAS,WAAW,UAAkB;AAC3C,SAAO,aAAa,IAAI,IAAI,CAAC,KAAK,IAAK,WAAW,KAAK,KAAM,CAAC,IAAI;AACpE;AAEO,MAAM,cAAc,cAAc,UAAU;AAC5C,MAAM,gBAAgB,gBAAgB,UAAU;AAQhD,SAAS,WAAW,UAAkB;AAC3C,SAAO,EAAE,KAAK,KAAK,IAAI,WAAW,QAAQ,IAAI;AAChD;AAEO,MAAM,cAAc,cAAc,UAAU;AAC5C,MAAM,gBAAgB,gBAAgB,UAAU;AAQhD,SAAS,WAAW,UAAkB;AAC3C,SAAO,MAAM,MAAM,WAAW;AAChC;AAEO,MAAM,cAAc,cAAc,UAAU;AAC5C,MAAM,gBAAgB,gBAAgB,UAAU;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/utils/math/index.cjs
CHANGED
|
@@ -23,7 +23,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
23
|
));
|
|
24
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
25
|
|
|
26
|
-
// packages/js-toolkit/utils/math/index.
|
|
26
|
+
// packages/js-toolkit/utils/math/index.ts
|
|
27
27
|
var math_exports = {};
|
|
28
28
|
__export(math_exports, {
|
|
29
29
|
clamp: () => import_clamp.default,
|
package/utils/math/index.cjs.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/js-toolkit/utils/math/index.
|
|
3
|
+
"sources": ["../../../packages/js-toolkit/utils/math/index.ts"],
|
|
4
4
|
"sourcesContent": ["export { default as clamp } from './clamp.js';\nexport { default as clamp01 } from './clamp01.js';\nexport { default as damp } from './damp.js';\nexport { default as inertiaFinalValue } from './inertiaFinalValue.js';\nexport { default as lerp } from './lerp.js';\nexport { default as map } from './map.js';\nexport { default as round } from './round.js';\nexport * from './ease.js';\nexport * as ease from './ease.js';\nexport * from './createEases.js';\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAiC;AACjC,qBAAmC;AACnC,kBAAgC;AAChC,+BAA6C;AAC7C,kBAAgC;AAChC,iBAA+B;AAC/B,mBAAiC;AACjC,yBAAc,uBAPd;AAQA,WAAsB;AACtB,yBAAc,8BATd;",
|
|
6
6
|
"names": []
|
package/utils/math/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { default as clamp } from
|
|
2
|
-
export { default as clamp01 } from
|
|
3
|
-
export { default as damp } from
|
|
4
|
-
export { default as inertiaFinalValue } from
|
|
5
|
-
export { default as lerp } from
|
|
6
|
-
export { default as map } from
|
|
7
|
-
export { default as round } from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export *
|
|
1
|
+
export { default as clamp } from './clamp.js';
|
|
2
|
+
export { default as clamp01 } from './clamp01.js';
|
|
3
|
+
export { default as damp } from './damp.js';
|
|
4
|
+
export { default as inertiaFinalValue } from './inertiaFinalValue.js';
|
|
5
|
+
export { default as lerp } from './lerp.js';
|
|
6
|
+
export { default as map } from './map.js';
|
|
7
|
+
export { default as round } from './round.js';
|
|
8
|
+
export * from './ease.js';
|
|
9
|
+
export * as ease from './ease.js';
|
|
10
|
+
export * from './createEases.js';
|
package/utils/math/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/js-toolkit/utils/math/index.
|
|
3
|
+
"sources": ["../../../packages/js-toolkit/utils/math/index.ts"],
|
|
4
4
|
"sourcesContent": ["export { default as clamp } from './clamp.js';\nexport { default as clamp01 } from './clamp01.js';\nexport { default as damp } from './damp.js';\nexport { default as inertiaFinalValue } from './inertiaFinalValue.js';\nexport { default as lerp } from './lerp.js';\nexport { default as map } from './map.js';\nexport { default as round } from './round.js';\nexport * from './ease.js';\nexport * as ease from './ease.js';\nexport * from './createEases.js';\n"],
|
|
5
5
|
"mappings": "AAAA,SAAoB,WAAXA,gBAAwB;AACjC,SAAoB,WAAXA,gBAA0B;AACnC,SAAoB,WAAXA,gBAAuB;AAChC,SAAoB,WAAXA,gBAAoC;AAC7C,SAAoB,WAAXA,gBAAuB;AAChC,SAAoB,WAAXA,gBAAsB;AAC/B,SAAoB,WAAXA,gBAAwB;AACjC,cAAc;AACd,YAAY,UAAU;AACtB,cAAc;",
|
|
6
6
|
"names": ["default"]
|
|
@@ -22,7 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
));
|
|
23
23
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
24
|
|
|
25
|
-
// packages/js-toolkit/utils/math/inertiaFinalValue.
|
|
25
|
+
// packages/js-toolkit/utils/math/inertiaFinalValue.ts
|
|
26
26
|
var inertiaFinalValue_exports = {};
|
|
27
27
|
__export(inertiaFinalValue_exports, {
|
|
28
28
|
default: () => inertiaFinalValue
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/js-toolkit/utils/math/inertiaFinalValue.
|
|
4
|
-
"sourcesContent": ["import clamp from './clamp.js';\n\n/**\n * Get the final damped value for a given factor.\n *\n * @param {number} initialValue The final value.\n * @param {number} initialDelta The current value.\n * @param {number} [dampFactor=0.85] The speed to reach the target value.\n * @returns {number} The next value.\n */\nexport default function inertiaFinalValue(initialValue
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAUH,SAAR,
|
|
3
|
+
"sources": ["../../../packages/js-toolkit/utils/math/inertiaFinalValue.ts"],
|
|
4
|
+
"sourcesContent": ["import clamp from './clamp.js';\n\n/**\n * Get the final damped value for a given factor.\n *\n * @param {number} initialValue The final value.\n * @param {number} initialDelta The current value.\n * @param {number} [dampFactor=0.85] The speed to reach the target value.\n * @returns {number} The next value.\n */\nexport default function inertiaFinalValue(\n initialValue: number,\n initialDelta: number,\n dampFactor = 0.85,\n) {\n // eslint-disable-next-line no-param-reassign\n dampFactor = clamp(dampFactor, 0.00001, 0.99999);\n let delta = initialDelta;\n let finalValue = initialValue;\n\n while (Math.abs(delta) > 0.1) {\n finalValue += delta;\n delta *= dampFactor;\n }\n\n return finalValue;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAUH,SAAR,kBACL,cACA,cACA,aAAa,MACb;AAEA,mBAAa,aAAAA,SAAM,YAAY,MAAS,OAAO;AAC/C,MAAI,QAAQ;AACZ,MAAI,aAAa;AAEjB,SAAO,KAAK,IAAI,KAAK,IAAI,KAAK;AAC5B,kBAAc;AACd,aAAS;AAAA,EACX;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": ["clamp"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/js-toolkit/utils/math/inertiaFinalValue.
|
|
4
|
-
"sourcesContent": ["import clamp from './clamp.js';\n\n/**\n * Get the final damped value for a given factor.\n *\n * @param {number} initialValue The final value.\n * @param {number} initialDelta The current value.\n * @param {number} [dampFactor=0.85] The speed to reach the target value.\n * @returns {number} The next value.\n */\nexport default function inertiaFinalValue(initialValue
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAUH,SAAR,
|
|
3
|
+
"sources": ["../../../packages/js-toolkit/utils/math/inertiaFinalValue.ts"],
|
|
4
|
+
"sourcesContent": ["import clamp from './clamp.js';\n\n/**\n * Get the final damped value for a given factor.\n *\n * @param {number} initialValue The final value.\n * @param {number} initialDelta The current value.\n * @param {number} [dampFactor=0.85] The speed to reach the target value.\n * @returns {number} The next value.\n */\nexport default function inertiaFinalValue(\n initialValue: number,\n initialDelta: number,\n dampFactor = 0.85,\n) {\n // eslint-disable-next-line no-param-reassign\n dampFactor = clamp(dampFactor, 0.00001, 0.99999);\n let delta = initialDelta;\n let finalValue = initialValue;\n\n while (Math.abs(delta) > 0.1) {\n finalValue += delta;\n delta *= dampFactor;\n }\n\n return finalValue;\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,WAAW;AAUH,SAAR,kBACL,cACA,cACA,aAAa,MACb;AAEA,eAAa,MAAM,YAAY,MAAS,OAAO;AAC/C,MAAI,QAAQ;AACZ,MAAI,aAAa;AAEjB,SAAO,KAAK,IAAI,KAAK,IAAI,KAAK;AAC5B,kBAAc;AACd,aAAS;AAAA,EACX;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/utils/math/lerp.cjs
CHANGED
|
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
|
-
// packages/js-toolkit/utils/math/lerp.
|
|
19
|
+
// packages/js-toolkit/utils/math/lerp.ts
|
|
20
20
|
var lerp_exports = {};
|
|
21
21
|
__export(lerp_exports, {
|
|
22
22
|
default: () => lerp
|