@studiometa/js-toolkit 4.0.0-alpha.2 → 4.0.0-alpha.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/Base.d.ts +0 -2
- package/dist/Base.js +1 -2
- package/dist/Base.js.map +1 -1
- package/dist/attribute-namespaces.d.ts +0 -2
- package/dist/attribute-namespaces.js +1 -2
- package/dist/attributes.d.ts +0 -2
- package/dist/attributes.js +1 -2
- package/dist/children-watchers.d.ts +0 -2
- package/dist/children-watchers.js +1 -2
- package/dist/component-brand.d.ts +0 -2
- package/dist/component-brand.js +1 -2
- package/dist/component-declarations.d.ts +0 -2
- package/dist/component-declarations.js +1 -2
- package/dist/context-subscription.d.ts +0 -2
- package/dist/context-subscription.js +1 -2
- package/dist/context.d.ts +0 -2
- package/dist/context.js +1 -2
- package/dist/decorators.d.ts +0 -2
- package/dist/decorators.js +1 -2
- package/dist/diagnostic-contract.d.ts +0 -2
- package/dist/diagnostic-contract.js +1 -2
- package/dist/diagnostics.d.ts +0 -2
- package/dist/diagnostics.js +1 -2
- package/dist/document-order.d.ts +0 -2
- package/dist/document-order.js +1 -2
- package/dist/dom-mutations.d.ts +0 -2
- package/dist/dom-mutations.js +1 -2
- package/dist/events.d.ts +0 -2
- package/dist/events.js +1 -2
- package/dist/group.d.ts +0 -2
- package/dist/group.js +1 -2
- package/dist/instances.d.ts +0 -2
- package/dist/instances.js +1 -2
- package/dist/manifest.d.ts +0 -2
- package/dist/manifest.js +1 -2
- package/dist/mount-strategies.d.ts +0 -2
- package/dist/mount-strategies.js +1 -2
- package/dist/negotiated-events.d.ts +0 -2
- package/dist/negotiated-events.js +1 -2
- package/dist/protocol-symbols.d.ts +0 -2
- package/dist/protocol-symbols.js +1 -2
- package/dist/registry.d.ts +0 -2
- package/dist/registry.js +1 -2
- package/dist/responsive-options.d.ts +0 -2
- package/dist/responsive-options.js +1 -2
- package/dist/scheduler.d.ts +0 -2
- package/dist/scheduler.js +1 -2
- package/dist/scheduler.js.map +1 -1
- package/dist/services/breakpoint.d.ts +0 -2
- package/dist/services/breakpoint.js +1 -2
- package/dist/services/drag.d.ts +0 -2
- package/dist/services/drag.js +1 -2
- package/dist/services/in-view.d.ts +0 -2
- package/dist/services/in-view.js +1 -2
- package/dist/services/key.d.ts +0 -2
- package/dist/services/key.js +1 -2
- package/dist/services/media.d.ts +0 -2
- package/dist/services/media.js +1 -2
- package/dist/services/mixin.d.ts +0 -2
- package/dist/services/mixin.js +1 -2
- package/dist/services/mutation.d.ts +0 -2
- package/dist/services/mutation.js +1 -2
- package/dist/services/pointer.d.ts +0 -2
- package/dist/services/pointer.js +1 -2
- package/dist/services/raf.d.ts +0 -2
- package/dist/services/raf.js +1 -2
- package/dist/services/resize.d.ts +0 -2
- package/dist/services/resize.js +1 -2
- package/dist/services/scroll-progress-offset.d.ts +0 -2
- package/dist/services/scroll-progress-offset.js +1 -2
- package/dist/services/scroll-progress.d.ts +0 -2
- package/dist/services/scroll-progress.js +1 -2
- package/dist/services/scroll.d.ts +0 -2
- package/dist/services/scroll.js +1 -2
- package/dist/services/service.d.ts +0 -2
- package/dist/services/service.js +1 -2
- package/dist/services/toggle.d.ts +0 -2
- package/dist/services/toggle.js +1 -2
- package/dist/services/until.d.ts +0 -2
- package/dist/services/until.js +1 -2
- package/dist/shared-runtime.d.ts +0 -2
- package/dist/shared-runtime.js +1 -2
- package/dist/storage/createStorage.d.ts +0 -2
- package/dist/storage/createStorage.js +1 -2
- package/dist/storage/index.d.ts +0 -2
- package/dist/storage/index.js +1 -2
- package/dist/storage/providers.d.ts +0 -2
- package/dist/storage/providers.js +1 -2
- package/dist/storage/serializers.d.ts +0 -2
- package/dist/storage/serializers.js +1 -2
- package/dist/storage/sync.d.ts +0 -2
- package/dist/storage/sync.js +1 -2
- package/dist/storage/types.d.ts +0 -2
- package/dist/subpaths/BREAKPOINTS.js +1 -2
- package/dist/subpaths/Base.js +1 -2
- package/dist/subpaths/DIAGNOSTICS.js +1 -2
- package/dist/subpaths/DRAG_MODES.js +1 -2
- package/dist/subpaths/EVENTS.js +1 -2
- package/dist/subpaths/MOUNT_ATTRIBUTE.js +1 -2
- package/dist/subpaths/SWAP_MODES.js +1 -2
- package/dist/subpaths/children.js +1 -2
- package/dist/subpaths/component.js +1 -2
- package/dist/subpaths/createContext.js +1 -2
- package/dist/subpaths/createFallbackProvider.js +1 -2
- package/dist/subpaths/createGroup.js +1 -2
- package/dist/subpaths/createLocalStorage.js +1 -2
- package/dist/subpaths/createMemoryStorageProvider.js +1 -2
- package/dist/subpaths/createService.js +1 -2
- package/dist/subpaths/createServiceMixin.js +1 -2
- package/dist/subpaths/createSessionStorage.js +1 -2
- package/dist/subpaths/createStorage.js +1 -2
- package/dist/subpaths/createUrlSearchParamsInHashProvider.js +1 -2
- package/dist/subpaths/createUrlSearchParamsInHashStorage.js +1 -2
- package/dist/subpaths/createUrlSearchParamsProvider.js +1 -2
- package/dist/subpaths/createUrlSearchParamsStorage.js +1 -2
- package/dist/subpaths/defaultScheduler.js +1 -2
- package/dist/subpaths/defineManifest.js +1 -2
- package/dist/subpaths/domUpdate.js +1 -2
- package/dist/subpaths/emitExtendable.js +1 -2
- package/dist/subpaths/fromMetaGlob.js +1 -2
- package/dist/subpaths/fromWebpackContext.js +1 -2
- package/dist/subpaths/getBreakpoints.js +1 -2
- package/dist/subpaths/getInstance.js +1 -2
- package/dist/subpaths/getInstances.js +1 -2
- package/dist/subpaths/getMountedInstances.js +1 -2
- package/dist/subpaths/getUnmountedInstances.js +1 -2
- package/dist/subpaths/inject.js +1 -2
- package/dist/subpaths/injectContext.js +1 -2
- package/dist/subpaths/injectContextSync.js +1 -2
- package/dist/subpaths/jsonSerializer.js +1 -2
- package/dist/subpaths/localStorageProvider.js +1 -2
- package/dist/subpaths/memoryStorageProvider.js +1 -2
- package/dist/subpaths/namespaceQualifier.js +1 -2
- package/dist/subpaths/nextFrame.js +1 -2
- package/dist/subpaths/on.js +1 -2
- package/dist/subpaths/perTarget.js +1 -2
- package/dist/subpaths/provide.js +1 -2
- package/dist/subpaths/provideContext.js +1 -2
- package/dist/subpaths/provideRootContext.js +1 -2
- package/dist/subpaths/read.js +1 -2
- package/dist/subpaths/registerComponent.js +1 -2
- package/dist/subpaths/registerComponents.js +1 -2
- package/dist/subpaths/registerManifest.js +1 -2
- package/dist/subpaths/reportDiagnostic.js +1 -2
- package/dist/subpaths/sessionStorageProvider.js +1 -2
- package/dist/subpaths/setBreakpoints.js +1 -2
- package/dist/subpaths/signal.js +1 -2
- package/dist/subpaths/subscribeContext.js +1 -2
- package/dist/subpaths/swap.js +1 -2
- package/dist/subpaths/toggle.js +1 -2
- package/dist/subpaths/until.js +1 -2
- package/dist/subpaths/urlSearchParamsInHashProvider.js +1 -2
- package/dist/subpaths/urlSearchParamsProvider.js +1 -2
- package/dist/subpaths/useBreakpoint.js +1 -2
- package/dist/subpaths/useDrag.js +1 -2
- package/dist/subpaths/useInView.js +1 -2
- package/dist/subpaths/useKey.js +1 -2
- package/dist/subpaths/useMediaQuery.js +1 -2
- package/dist/subpaths/useMutation.js +1 -2
- package/dist/subpaths/usePointer.js +1 -2
- package/dist/subpaths/usePrefersReducedMotion.js +1 -2
- package/dist/subpaths/useRaf.js +1 -2
- package/dist/subpaths/useResize.js +1 -2
- package/dist/subpaths/useScroll.js +1 -2
- package/dist/subpaths/useScrollProgress.js +1 -2
- package/dist/subpaths/useWindowScroll.js +1 -2
- package/dist/subpaths/useWindowSize.js +1 -2
- package/dist/subpaths/utils/DEFAULT_DAMP_FACTOR.js +1 -2
- package/dist/subpaths/utils/INERTIA_FRAME.js +1 -2
- package/dist/subpaths/utils/MAX_SPRING_RATIO.js +1 -2
- package/dist/subpaths/utils/SCROLL_ALIGNMENTS.js +1 -2
- package/dist/subpaths/utils/SCROLL_AXES.js +1 -2
- package/dist/subpaths/utils/TRANSFORM_PROPS.js +1 -2
- package/dist/subpaths/utils/TRANSITION_OPTIONS.js +1 -2
- package/dist/subpaths/utils/camelCase.js +1 -2
- package/dist/subpaths/utils/capitalize.js +1 -2
- package/dist/subpaths/utils/clamp.js +1 -2
- package/dist/subpaths/utils/clamp01.js +1 -2
- package/dist/subpaths/utils/clampDampFactor.js +1 -2
- package/dist/subpaths/utils/createEaseInOut.js +1 -2
- package/dist/subpaths/utils/createEaseOut.js +1 -2
- package/dist/subpaths/utils/createElement.js +1 -2
- package/dist/subpaths/utils/createRange.js +1 -2
- package/dist/subpaths/utils/damp.js +1 -2
- package/dist/subpaths/utils/debounce.js +1 -2
- package/dist/subpaths/utils/decayOver.js +1 -2
- package/dist/subpaths/utils/deepmerge.js +1 -2
- package/dist/subpaths/utils/easeInCirc.js +1 -2
- package/dist/subpaths/utils/easeInCubic.js +1 -2
- package/dist/subpaths/utils/easeInExpo.js +1 -2
- package/dist/subpaths/utils/easeInOutCirc.js +1 -2
- package/dist/subpaths/utils/easeInOutCubic.js +1 -2
- package/dist/subpaths/utils/easeInOutExpo.js +1 -2
- package/dist/subpaths/utils/easeInOutQuad.js +1 -2
- package/dist/subpaths/utils/easeInOutQuart.js +1 -2
- package/dist/subpaths/utils/easeInOutQuint.js +1 -2
- package/dist/subpaths/utils/easeInOutSine.js +1 -2
- package/dist/subpaths/utils/easeInQuad.js +1 -2
- package/dist/subpaths/utils/easeInQuart.js +1 -2
- package/dist/subpaths/utils/easeInQuint.js +1 -2
- package/dist/subpaths/utils/easeInSine.js +1 -2
- package/dist/subpaths/utils/easeLinear.js +1 -2
- package/dist/subpaths/utils/easeOutCirc.js +1 -2
- package/dist/subpaths/utils/easeOutCubic.js +1 -2
- package/dist/subpaths/utils/easeOutExpo.js +1 -2
- package/dist/subpaths/utils/easeOutQuad.js +1 -2
- package/dist/subpaths/utils/easeOutQuart.js +1 -2
- package/dist/subpaths/utils/easeOutQuint.js +1 -2
- package/dist/subpaths/utils/easeOutSine.js +1 -2
- package/dist/subpaths/utils/enterTransition.js +1 -2
- package/dist/subpaths/utils/fold.js +1 -2
- package/dist/subpaths/utils/getOffsetSizes.js +1 -2
- package/dist/subpaths/utils/historyPush.js +1 -2
- package/dist/subpaths/utils/historyReplace.js +1 -2
- package/dist/subpaths/utils/inertiaDecay.js +1 -2
- package/dist/subpaths/utils/inertiaFinalValue.js +1 -2
- package/dist/subpaths/utils/inertiaStep.js +1 -2
- package/dist/subpaths/utils/inertiaTimeConstant.js +1 -2
- package/dist/subpaths/utils/isBoolean.js +1 -2
- package/dist/subpaths/utils/isDefined.js +1 -2
- package/dist/subpaths/utils/isFunction.js +1 -2
- package/dist/subpaths/utils/isNull.js +1 -2
- package/dist/subpaths/utils/isNumber.js +1 -2
- package/dist/subpaths/utils/isObject.js +1 -2
- package/dist/subpaths/utils/isString.js +1 -2
- package/dist/subpaths/utils/kebabCase.js +1 -2
- package/dist/subpaths/utils/leaveTransition.js +1 -2
- package/dist/subpaths/utils/lerp.js +1 -2
- package/dist/subpaths/utils/loadImage.js +1 -2
- package/dist/subpaths/utils/loadLink.js +1 -2
- package/dist/subpaths/utils/loadScript.js +1 -2
- package/dist/subpaths/utils/lockScroll.js +1 -2
- package/dist/subpaths/utils/lowerCase.js +1 -2
- package/dist/subpaths/utils/map.js +1 -2
- package/dist/subpaths/utils/matrix.js +1 -2
- package/dist/subpaths/utils/mean.js +1 -2
- package/dist/subpaths/utils/memo.js +1 -2
- package/dist/subpaths/utils/noop.js +1 -2
- package/dist/subpaths/utils/noopValue.js +1 -2
- package/dist/subpaths/utils/objectToURLSearchParams.js +1 -2
- package/dist/subpaths/utils/pascalCase.js +1 -2
- package/dist/subpaths/utils/random.js +1 -2
- package/dist/subpaths/utils/randomInt.js +1 -2
- package/dist/subpaths/utils/randomItem.js +1 -2
- package/dist/subpaths/utils/round.js +1 -2
- package/dist/subpaths/utils/saveActiveElement.js +1 -2
- package/dist/subpaths/utils/scrollPosition.js +1 -2
- package/dist/subpaths/utils/scrollTo.js +1 -2
- package/dist/subpaths/utils/selectorFor.js +1 -2
- package/dist/subpaths/utils/setClassesOrStyles.js +1 -2
- package/dist/subpaths/utils/smoothTo.js +1 -2
- package/dist/subpaths/utils/snakeCase.js +1 -2
- package/dist/subpaths/utils/spring.js +1 -2
- package/dist/subpaths/utils/throttle.js +1 -2
- package/dist/subpaths/utils/transform.js +1 -2
- package/dist/subpaths/utils/transition.js +1 -2
- package/dist/subpaths/utils/trapFocus.js +1 -2
- package/dist/subpaths/utils/untrapFocus.js +1 -2
- package/dist/subpaths/utils/upperCase.js +1 -2
- package/dist/subpaths/utils/wait.js +1 -2
- package/dist/subpaths/utils/withLeadingCharacters.js +1 -2
- package/dist/subpaths/utils/withLeadingSlash.js +1 -2
- package/dist/subpaths/utils/withTrailingCharacters.js +1 -2
- package/dist/subpaths/utils/withTrailingSlash.js +1 -2
- package/dist/subpaths/utils/withoutLeadingCharacters.js +1 -2
- package/dist/subpaths/utils/withoutLeadingCharactersRecursive.js +1 -2
- package/dist/subpaths/utils/withoutLeadingSlash.js +1 -2
- package/dist/subpaths/utils/withoutTrailingCharacters.js +1 -2
- package/dist/subpaths/utils/withoutTrailingCharactersRecursive.js +1 -2
- package/dist/subpaths/utils/withoutTrailingSlash.js +1 -2
- package/dist/subpaths/utils/wrap.js +1 -2
- package/dist/subpaths/viewTransition.js +1 -2
- package/dist/subpaths/warn.js +1 -2
- package/dist/subpaths/watchAttributeNamespace.js +1 -2
- package/dist/subpaths/watchAttributes.js +1 -2
- package/dist/subpaths/whenDOMSettled.js +1 -2
- package/dist/subpaths/withDrag.js +1 -2
- package/dist/subpaths/withInView.js +1 -2
- package/dist/subpaths/withKey.js +1 -2
- package/dist/subpaths/withMutation.js +1 -2
- package/dist/subpaths/withPointer.js +1 -2
- package/dist/subpaths/withRaf.js +1 -2
- package/dist/subpaths/withResize.js +1 -2
- package/dist/subpaths/withScroll.js +1 -2
- package/dist/subpaths/withScrollProgress.js +1 -2
- package/dist/subpaths/write.js +1 -2
- package/dist/swap.d.ts +0 -2
- package/dist/swap.js +1 -2
- package/dist/test/index.d.ts +0 -2
- package/dist/test/index.js +1 -2
- package/dist/utils/deepmerge.d.ts +0 -2
- package/dist/utils/deepmerge.js +1 -2
- package/dist/utils/dom.d.ts +0 -2
- package/dist/utils/dom.js +1 -2
- package/dist/utils/easings.d.ts +0 -2
- package/dist/utils/easings.js +1 -2
- package/dist/utils/focus.d.ts +0 -2
- package/dist/utils/focus.js +1 -2
- package/dist/utils/history.d.ts +0 -2
- package/dist/utils/history.js +1 -2
- package/dist/utils/is.d.ts +0 -2
- package/dist/utils/is.js +1 -2
- package/dist/utils/load.d.ts +0 -2
- package/dist/utils/load.js +1 -2
- package/dist/utils/maths.d.ts +0 -2
- package/dist/utils/maths.js +1 -2
- package/dist/utils/memo.d.ts +0 -2
- package/dist/utils/memo.js +1 -2
- package/dist/utils/noop.d.ts +0 -2
- package/dist/utils/noop.js +1 -2
- package/dist/utils/random.d.ts +0 -2
- package/dist/utils/random.js +1 -2
- package/dist/utils/scroll-lock.d.ts +0 -2
- package/dist/utils/scroll-lock.js +1 -2
- package/dist/utils/scrollTo.d.ts +0 -2
- package/dist/utils/scrollTo.js +1 -2
- package/dist/utils/selectors.d.ts +0 -2
- package/dist/utils/selectors.js +1 -2
- package/dist/utils/smoothTo.d.ts +0 -2
- package/dist/utils/smoothTo.js +1 -2
- package/dist/utils/strings.d.ts +0 -2
- package/dist/utils/strings.js +1 -2
- package/dist/utils/timing.d.ts +0 -2
- package/dist/utils/timing.js +1 -2
- package/dist/utils/transform.d.ts +0 -2
- package/dist/utils/transform.js +1 -2
- package/dist/utils/transition.d.ts +0 -2
- package/dist/utils/transition.js +1 -2
- package/dist/viewTransition.d.ts +0 -2
- package/dist/viewTransition.js +1 -2
- package/package.json +2 -2
package/dist/utils/is.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/is.d.ts
|
|
2
1
|
/** Type guards for the values a component reads from the DOM or its options. */
|
|
3
2
|
/**
|
|
4
3
|
* Whether a value is `null`.
|
|
@@ -39,5 +38,4 @@ declare function isFunction(value: unknown): value is (...args: unknown[]) => un
|
|
|
39
38
|
* @link https://js-toolkit-v4.studiometa.dev/utils/is.html#isobject
|
|
40
39
|
*/
|
|
41
40
|
declare function isObject(value: unknown): value is Record<string, unknown>;
|
|
42
|
-
//#endregion
|
|
43
41
|
export { isBoolean, isDefined, isFunction, isNull, isNumber, isObject, isString };
|
package/dist/utils/is.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/is.ts
|
|
2
2
|
/** Type guards for the values a component reads from the DOM or its options. */
|
|
3
3
|
/**
|
|
4
4
|
* Whether a value is `null`.
|
|
@@ -53,7 +53,6 @@ function isFunction(value) {
|
|
|
53
53
|
function isObject(value) {
|
|
54
54
|
return Object.prototype.toString.call(value) === "[object Object]";
|
|
55
55
|
}
|
|
56
|
-
//#endregion
|
|
57
56
|
export { isBoolean, isDefined, isFunction, isNull, isNumber, isObject, isString };
|
|
58
57
|
|
|
59
58
|
//# sourceMappingURL=is.js.map
|
package/dist/utils/load.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/load.d.ts
|
|
2
1
|
/** Loading a resource, as a promise that settles when the browser is done with it. */
|
|
3
2
|
/**
|
|
4
3
|
* Load an image, resolved once its bitmap is decoded.
|
|
@@ -42,5 +41,4 @@ declare function loadScript(src: string, attributes?: Record<string, string>): P
|
|
|
42
41
|
declare function loadLink(href: string, attributes: {
|
|
43
42
|
rel: string;
|
|
44
43
|
} & Record<string, string>): Promise<HTMLLinkElement>;
|
|
45
|
-
//#endregion
|
|
46
44
|
export { loadImage, loadLink, loadScript };
|
package/dist/utils/load.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getSharedRuntimeSlot } from "../shared-runtime.js";
|
|
2
|
-
|
|
2
|
+
// src/utils/load.ts
|
|
3
3
|
/** Loading a resource, as a promise that settles when the browser is done with it. */
|
|
4
4
|
/**
|
|
5
5
|
* The pending loads for the elements that go in `<head>`, keyed by the URL the
|
|
@@ -138,7 +138,6 @@ function loadLink(href, attributes) {
|
|
|
138
138
|
state.links.set(key, promise);
|
|
139
139
|
return promise;
|
|
140
140
|
}
|
|
141
|
-
//#endregion
|
|
142
141
|
export { loadImage, loadLink, loadScript };
|
|
143
142
|
|
|
144
143
|
//# sourceMappingURL=load.js.map
|
package/dist/utils/maths.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/maths.d.ts
|
|
2
1
|
/** Time-based functions take elapsed milliseconds. */
|
|
3
2
|
/**
|
|
4
3
|
* The default inertia factor.
|
|
@@ -118,5 +117,4 @@ interface SpringOptions {
|
|
|
118
117
|
* @link https://js-toolkit-v4.studiometa.dev/utils/motion.html#spring
|
|
119
118
|
*/
|
|
120
119
|
declare function spring(targetValue: number, currentValue: number, currentVelocity: number, elapsed: number, options?: SpringOptions): [value: number, velocity: number];
|
|
121
|
-
//#endregion
|
|
122
120
|
export { DEFAULT_DAMP_FACTOR, INERTIA_FRAME, MAX_SPRING_RATIO, SpringOptions, clamp, clamp01, clampDampFactor, createRange, damp, decayOver, fold, inertiaDecay, inertiaFinalValue, inertiaStep, inertiaTimeConstant, lerp, map, mean, round, spring, wrap };
|
package/dist/utils/maths.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/maths.ts
|
|
2
2
|
/** Time-based functions take elapsed milliseconds. */
|
|
3
3
|
/**
|
|
4
4
|
* The default inertia factor.
|
|
@@ -171,7 +171,6 @@ function spring(targetValue, currentValue, currentVelocity, elapsed, options = {
|
|
|
171
171
|
if (Math.abs(targetValue - value) < precision && Math.abs(velocity) < precision) return [targetValue, 0];
|
|
172
172
|
return [value, velocity];
|
|
173
173
|
}
|
|
174
|
-
//#endregion
|
|
175
174
|
export { DEFAULT_DAMP_FACTOR, INERTIA_FRAME, MAX_SPRING_RATIO, clamp, clamp01, clampDampFactor, createRange, damp, decayOver, fold, inertiaDecay, inertiaFinalValue, inertiaStep, inertiaTimeConstant, lerp, map, mean, round, spring, wrap };
|
|
176
175
|
|
|
177
176
|
//# sourceMappingURL=maths.js.map
|
package/dist/utils/memo.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/memo.d.ts
|
|
2
1
|
/** A memoised function with explicit cache invalidation. */
|
|
3
2
|
interface Memo<Args extends unknown[], Value> {
|
|
4
3
|
(...args: Args): Value;
|
|
@@ -12,5 +11,4 @@ interface Memo<Args extends unknown[], Value> {
|
|
|
12
11
|
* @link https://js-toolkit-v4.studiometa.dev/utils/timing.html#memo
|
|
13
12
|
*/
|
|
14
13
|
declare function memo<Args extends [] | [key: unknown], Value>(fn: (...args: Args) => Value): Memo<Args, Value>;
|
|
15
|
-
//#endregion
|
|
16
14
|
export { Memo, memo };
|
package/dist/utils/memo.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/memo.ts
|
|
2
2
|
/** Whether a value can be a `WeakMap` key. */
|
|
3
3
|
function isWeakKey(value) {
|
|
4
4
|
return typeof value === "object" && value !== null || typeof value === "function";
|
|
@@ -29,7 +29,6 @@ function memo(fn) {
|
|
|
29
29
|
};
|
|
30
30
|
return cached;
|
|
31
31
|
}
|
|
32
|
-
//#endregion
|
|
33
32
|
export { memo };
|
|
34
33
|
|
|
35
34
|
//# sourceMappingURL=memo.js.map
|
package/dist/utils/noop.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/noop.d.ts
|
|
2
1
|
/** Placeholders for an optional callback, so a caller never branches on one. */
|
|
3
2
|
/**
|
|
4
3
|
* Do nothing, whatever it is called with.
|
|
@@ -10,5 +9,4 @@ declare function noop(): void;
|
|
|
10
9
|
* @link https://js-toolkit-v4.studiometa.dev/utils/timing.html#noopvalue
|
|
11
10
|
*/
|
|
12
11
|
declare function noopValue<T>(value: T): T;
|
|
13
|
-
//#endregion
|
|
14
12
|
export { noop, noopValue };
|
package/dist/utils/noop.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/noop.ts
|
|
2
2
|
/** Placeholders for an optional callback, so a caller never branches on one. */
|
|
3
3
|
/**
|
|
4
4
|
* Do nothing, whatever it is called with.
|
|
@@ -12,7 +12,6 @@ function noop() {}
|
|
|
12
12
|
function noopValue(value) {
|
|
13
13
|
return value;
|
|
14
14
|
}
|
|
15
|
-
//#endregion
|
|
16
15
|
export { noop, noopValue };
|
|
17
16
|
|
|
18
17
|
//# sourceMappingURL=noop.js.map
|
package/dist/utils/random.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/random.d.ts
|
|
2
1
|
/** Random values, in the ranges a component describes. */
|
|
3
2
|
/**
|
|
4
3
|
* A random number between the two bounds, the second defaulting to `0`.
|
|
@@ -20,5 +19,4 @@ declare function randomInt(a: number, b?: number): number;
|
|
|
20
19
|
*/
|
|
21
20
|
declare function randomItem<T>(items: readonly T[]): T | undefined;
|
|
22
21
|
declare function randomItem(items: string): string | undefined;
|
|
23
|
-
//#endregion
|
|
24
22
|
export { random, randomInt, randomItem };
|
package/dist/utils/random.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/random.ts
|
|
2
2
|
/** Random values, in the ranges a component describes. */
|
|
3
3
|
/**
|
|
4
4
|
* A random number between the two bounds, the second defaulting to `0`.
|
|
@@ -22,7 +22,6 @@ function randomInt(a, b = 0) {
|
|
|
22
22
|
function randomItem(items) {
|
|
23
23
|
return items.length > 0 ? items[randomInt(0, items.length - 1)] : void 0;
|
|
24
24
|
}
|
|
25
|
-
//#endregion
|
|
26
25
|
export { random, randomInt, randomItem };
|
|
27
26
|
|
|
28
27
|
//# sourceMappingURL=random.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/scroll-lock.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Stop an element scrolling until every holder releases it.
|
|
4
3
|
*
|
|
@@ -23,5 +22,4 @@
|
|
|
23
22
|
* @link https://js-toolkit-v4.studiometa.dev/utils/scroll.html#lockscroll
|
|
24
23
|
*/
|
|
25
24
|
declare function lockScroll(target?: HTMLElement): () => void;
|
|
26
|
-
//#endregion
|
|
27
25
|
export { lockScroll };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getSharedRuntimeSlot } from "../shared-runtime.js";
|
|
2
|
-
|
|
2
|
+
// src/utils/scroll-lock.ts
|
|
3
3
|
/**
|
|
4
4
|
* One counter per locked element, shared across evaluated copies of the
|
|
5
5
|
* package: there is one scroll per document, so two copies must count the same
|
|
@@ -52,7 +52,6 @@ function lockScroll(target = document.documentElement) {
|
|
|
52
52
|
target.style.overflow = current.restore;
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
//#endregion
|
|
56
55
|
export { lockScroll };
|
|
57
56
|
|
|
58
57
|
//# sourceMappingURL=scroll-lock.js.map
|
package/dist/utils/scrollTo.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/scrollTo.d.ts
|
|
2
1
|
/** Where a scroller stands on both axes, in pixels from the start. */
|
|
3
2
|
interface ScrollPosition {
|
|
4
3
|
left: number;
|
|
@@ -83,5 +82,4 @@ declare function scrollPosition(target: ScrollToTarget, options?: ScrollPosition
|
|
|
83
82
|
* @link https://js-toolkit-v4.studiometa.dev/utils/scroll.html#scrollto
|
|
84
83
|
*/
|
|
85
84
|
declare function scrollTo(target: ScrollToTarget, options?: ScrollToOptions): ScrollPosition;
|
|
86
|
-
//#endregion
|
|
87
85
|
export { SCROLL_ALIGNMENTS, SCROLL_AXES, ScrollAlign, ScrollAxis, ScrollPosition, ScrollPositionOptions, ScrollToOptions, ScrollToTarget, scrollPosition, scrollTo };
|
package/dist/utils/scrollTo.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { clamp } from "./maths.js";
|
|
2
2
|
import { usePrefersReducedMotion } from "../services/media.js";
|
|
3
3
|
import { isNumber, isString } from "./is.js";
|
|
4
|
-
|
|
4
|
+
// src/utils/scrollTo.ts
|
|
5
5
|
/**
|
|
6
6
|
* The axes a scroll is allowed to move.
|
|
7
7
|
* @link https://js-toolkit-v4.studiometa.dev/utils/scroll.html#scroll-axes
|
|
@@ -157,7 +157,6 @@ function scrollTo(target, options = {}) {
|
|
|
157
157
|
});
|
|
158
158
|
return destination;
|
|
159
159
|
}
|
|
160
|
-
//#endregion
|
|
161
160
|
export { SCROLL_ALIGNMENTS, SCROLL_AXES, scrollPosition, scrollTo };
|
|
162
161
|
|
|
163
162
|
//# sourceMappingURL=scrollTo.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/selectors.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* The registry selector for a component name.
|
|
4
3
|
*
|
|
@@ -15,5 +14,4 @@
|
|
|
15
14
|
* @link https://js-toolkit-v4.studiometa.dev/utils/dom.html#selectorfor
|
|
16
15
|
*/
|
|
17
16
|
declare function selectorFor(name: string): string;
|
|
18
|
-
//#endregion
|
|
19
17
|
export { selectorFor };
|
package/dist/utils/selectors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { COMPONENT_ATTRIBUTE } from "../attributes.js";
|
|
2
2
|
import { responsiveAttributeNames } from "../responsive-options.js";
|
|
3
|
-
|
|
3
|
+
// src/utils/selectors.ts
|
|
4
4
|
/**
|
|
5
5
|
* The registry selector for a component name.
|
|
6
6
|
*
|
|
@@ -19,7 +19,6 @@ import { responsiveAttributeNames } from "../responsive-options.js";
|
|
|
19
19
|
function selectorFor(name) {
|
|
20
20
|
return [COMPONENT_ATTRIBUTE, ...responsiveAttributeNames(COMPONENT_ATTRIBUTE)].map((attribute) => `[${CSS.escape(attribute)}~="${name}"]`).join(",");
|
|
21
21
|
}
|
|
22
|
-
//#endregion
|
|
23
22
|
export { selectorFor };
|
|
24
23
|
|
|
25
24
|
//# sourceMappingURL=selectors.js.map
|
package/dist/utils/smoothTo.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SpringOptions } from "./maths.js";
|
|
2
|
-
//#region src/utils/smoothTo.d.ts
|
|
3
2
|
interface SmoothToOptions extends Omit<SpringOptions, 'damping'> {
|
|
4
3
|
/**
|
|
5
4
|
* Damping factor, or spring friction in spring mode. Defaults to `0.6`.
|
|
@@ -73,5 +72,4 @@ declare function smoothTo(start?: number, options?: SmoothToOptions): SmoothTo;
|
|
|
73
72
|
* consumer's own — a scale, an opacity or a progress as readily as a coordinate.
|
|
74
73
|
*/
|
|
75
74
|
declare function smoothTo<K extends string>(start: Record<K, number>, options?: SmoothToOptions): SmoothToRecord<K>;
|
|
76
|
-
//#endregion
|
|
77
75
|
export { SmoothTo, SmoothToOptions, SmoothToRecord, smoothTo };
|
package/dist/utils/smoothTo.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { damp, spring } from "./maths.js";
|
|
2
2
|
import { toggle } from "../services/toggle.js";
|
|
3
3
|
import { useRaf } from "../services/raf.js";
|
|
4
|
-
|
|
4
|
+
// src/utils/smoothTo.ts
|
|
5
5
|
/** The key a single value is held under, and the one its `damping` hook is asked about. */
|
|
6
6
|
const SCALAR_KEY = "value";
|
|
7
7
|
function smoothTo(start = 0, options = {}) {
|
|
@@ -87,7 +87,6 @@ function smoothTo(start = 0, options = {}) {
|
|
|
87
87
|
});
|
|
88
88
|
return api;
|
|
89
89
|
}
|
|
90
|
-
//#endregion
|
|
91
90
|
export { smoothTo };
|
|
92
91
|
|
|
93
92
|
//# sourceMappingURL=smoothTo.js.map
|
package/dist/utils/strings.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Memo } from "./memo.js";
|
|
2
|
-
//#region src/utils/strings.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* String shapes the framework converts between: an option or handler name in
|
|
5
4
|
* source, and the `data-` attribute or event type it corresponds to.
|
|
@@ -97,5 +96,4 @@ declare function withTrailingSlash(string: string): string;
|
|
|
97
96
|
* @link https://js-toolkit-v4.studiometa.dev/utils/strings.html#withouttrailingslash
|
|
98
97
|
*/
|
|
99
98
|
declare function withoutTrailingSlash(string: string): string;
|
|
100
|
-
//#endregion
|
|
101
99
|
export { camelCase, capitalize, kebabCase, lowerCase, pascalCase, snakeCase, upperCase, withLeadingCharacters, withLeadingSlash, withTrailingCharacters, withTrailingSlash, withoutLeadingCharacters, withoutLeadingCharactersRecursive, withoutLeadingSlash, withoutTrailingCharacters, withoutTrailingCharactersRecursive, withoutTrailingSlash };
|
package/dist/utils/strings.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { memo } from "./memo.js";
|
|
2
|
-
|
|
2
|
+
// src/utils/strings.ts
|
|
3
3
|
/**
|
|
4
4
|
* String shapes the framework converts between: an option or handler name in
|
|
5
5
|
* source, and the `data-` attribute or event type it corresponds to.
|
|
@@ -163,7 +163,6 @@ function withTrailingSlash(string) {
|
|
|
163
163
|
function withoutTrailingSlash(string) {
|
|
164
164
|
return withoutTrailingCharacters(string, "/");
|
|
165
165
|
}
|
|
166
|
-
//#endregion
|
|
167
166
|
export { camelCase, capitalize, kebabCase, lowerCase, pascalCase, snakeCase, upperCase, withLeadingCharacters, withLeadingSlash, withTrailingCharacters, withTrailingSlash, withoutLeadingCharacters, withoutLeadingCharactersRecursive, withoutLeadingSlash, withoutTrailingCharacters, withoutTrailingCharactersRecursive, withoutTrailingSlash };
|
|
168
167
|
|
|
169
168
|
//# sourceMappingURL=strings.js.map
|
package/dist/utils/timing.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/timing.d.ts
|
|
2
1
|
/** Rate limiting and delays, for the callbacks a component hands to the DOM. */
|
|
3
2
|
/**
|
|
4
3
|
* Delay a function until it stops being called for the given milliseconds.
|
|
@@ -17,5 +16,4 @@ declare function throttle<Args extends unknown[]>(fn: (...args: Args) => void, d
|
|
|
17
16
|
* @link https://js-toolkit-v4.studiometa.dev/utils/timing.html#wait
|
|
18
17
|
*/
|
|
19
18
|
declare function wait(delay?: number): Promise<void>;
|
|
20
|
-
//#endregion
|
|
21
19
|
export { debounce, throttle, wait };
|
package/dist/utils/timing.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/timing.ts
|
|
2
2
|
/** Rate limiting and delays, for the callbacks a component hands to the DOM. */
|
|
3
3
|
/**
|
|
4
4
|
* Delay a function until it stops being called for the given milliseconds.
|
|
@@ -35,7 +35,6 @@ function wait(delay = 0) {
|
|
|
35
35
|
setTimeout(resolve, delay);
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
//#endregion
|
|
39
38
|
export { debounce, throttle, wait };
|
|
40
39
|
|
|
41
40
|
//# sourceMappingURL=timing.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/transform.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* CSS transform strings. Both helpers are pure: they format a value and the
|
|
4
3
|
* caller hands the write to the scheduler.
|
|
@@ -63,5 +62,4 @@ interface MatrixProps {
|
|
|
63
62
|
* @link https://js-toolkit-v4.studiometa.dev/utils/css.html#matrix
|
|
64
63
|
*/
|
|
65
64
|
declare function matrix(props?: MatrixProps): string;
|
|
66
|
-
//#endregion
|
|
67
65
|
export { MatrixProps, TRANSFORM_PROPS, TransformProps, matrix, transform };
|
package/dist/utils/transform.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/transform.ts
|
|
2
2
|
/**
|
|
3
3
|
* The properties {@link transform} formats, for callers splitting a style patch.
|
|
4
4
|
* @link https://js-toolkit-v4.studiometa.dev/utils/css.html#transform-props
|
|
@@ -68,7 +68,6 @@ function matrix(props = {}) {
|
|
|
68
68
|
const { scaleX = 1, skewY = 0, skewX = 0, scaleY = 1, translateX = 0, translateY = 0 } = props;
|
|
69
69
|
return `matrix(${scaleX}, ${skewY}, ${skewX}, ${scaleY}, ${translateX}, ${translateY})`;
|
|
70
70
|
}
|
|
71
|
-
//#endregion
|
|
72
71
|
export { TRANSFORM_PROPS, matrix, transform };
|
|
73
72
|
|
|
74
73
|
//# sourceMappingURL=transform.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { OptionDefinition } from "../Base.js";
|
|
2
|
-
//#region src/utils/transition.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* CSS transition helpers for class names or inline styles. Apply `from`, then
|
|
5
4
|
* `active` and `to`, and resolve after `transitionend` or on the next frame when no transition runs.
|
|
@@ -57,5 +56,4 @@ declare function enterTransition(el: HTMLElement, options: TransitionOptions): P
|
|
|
57
56
|
* @link https://js-toolkit-v4.studiometa.dev/utils/transitions.html#leavetransition
|
|
58
57
|
*/
|
|
59
58
|
declare function leaveTransition(el: HTMLElement, options: TransitionOptions): Promise<void>;
|
|
60
|
-
//#endregion
|
|
61
59
|
export { ClassesOrStyles, TRANSITION_OPTIONS, TransitionOptions, TransitionStyles, enterTransition, leaveTransition, setClassesOrStyles, transition };
|
package/dist/utils/transition.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { nextFrame } from "../scheduler.js";
|
|
2
|
-
|
|
2
|
+
// src/utils/transition.ts
|
|
3
3
|
const runs = /* @__PURE__ */ new WeakMap();
|
|
4
4
|
function toClassList(value) {
|
|
5
5
|
return (Array.isArray(value) ? value : value.split(" ")).filter(Boolean);
|
|
@@ -128,7 +128,6 @@ async function leaveTransition(el, options) {
|
|
|
128
128
|
to: leaveTo
|
|
129
129
|
}, leaveKeep ? "keep" : "remove");
|
|
130
130
|
}
|
|
131
|
-
//#endregion
|
|
132
131
|
export { TRANSITION_OPTIONS, enterTransition, leaveTransition, setClassesOrStyles, transition };
|
|
133
132
|
|
|
134
133
|
//# sourceMappingURL=transition.js.map
|
package/dist/viewTransition.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/viewTransition.d.ts
|
|
2
1
|
type ViewTransitionUpdate = () => void | Promise<void>;
|
|
3
2
|
/**
|
|
4
3
|
* Run a DOM update inside a batched, native view transition.
|
|
@@ -13,5 +12,4 @@ type ViewTransitionUpdate = () => void | Promise<void>;
|
|
|
13
12
|
* @link https://js-toolkit-v4.studiometa.dev/api/scheduler/viewTransition.html
|
|
14
13
|
*/
|
|
15
14
|
declare function viewTransition(update: ViewTransitionUpdate): Promise<void>;
|
|
16
|
-
//#endregion
|
|
17
15
|
export { ViewTransitionUpdate, viewTransition };
|
package/dist/viewTransition.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defaultScheduler } from "./scheduler.js";
|
|
2
|
-
|
|
2
|
+
// src/viewTransition.ts
|
|
3
3
|
let vtQueue = [];
|
|
4
4
|
let vtIsScheduled = false;
|
|
5
5
|
let vtTail = Promise.resolve();
|
|
@@ -46,7 +46,6 @@ async function runViewTransitionBatch(batch) {
|
|
|
46
46
|
for (const { reject } of batch) reject(error);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
//#endregion
|
|
50
49
|
export { viewTransition };
|
|
51
50
|
|
|
52
51
|
//# sourceMappingURL=viewTransition.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studiometa/js-toolkit",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"./dist/responsive-options.js"
|
|
@@ -851,7 +851,7 @@
|
|
|
851
851
|
"playwright": "^1.50.0",
|
|
852
852
|
"tailwindcss": "4.2.2",
|
|
853
853
|
"tsdown": "0.22.14",
|
|
854
|
-
"vite": "8.2.
|
|
854
|
+
"vite": "8.2.4",
|
|
855
855
|
"vitepress": "2.0.0-alpha.19",
|
|
856
856
|
"vitepress-plugin-llms": "1.12.0",
|
|
857
857
|
"vitest": "4.1.10"
|