@studiometa/js-toolkit 4.0.0-alpha.1 → 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/README.md +10 -0
- 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 +6 -3
- package/skills/studiometa-js-toolkit/SKILL.md +87 -0
- package/skills/studiometa-js-toolkit/references/api/configuration.md +169 -0
- package/skills/studiometa-js-toolkit/references/api/context/createContext.md +46 -0
- package/skills/studiometa-js-toolkit/references/api/context/createGroup.md +67 -0
- package/skills/studiometa-js-toolkit/references/api/context/index.md +69 -0
- package/skills/studiometa-js-toolkit/references/api/context/injectContext.md +58 -0
- package/skills/studiometa-js-toolkit/references/api/context/injectContextSync.md +44 -0
- package/skills/studiometa-js-toolkit/references/api/context/provideContext.md +61 -0
- package/skills/studiometa-js-toolkit/references/api/context/provideRootContext.md +42 -0
- package/skills/studiometa-js-toolkit/references/api/context/signal.md +85 -0
- package/skills/studiometa-js-toolkit/references/api/context/subscribeContext.md +71 -0
- package/skills/studiometa-js-toolkit/references/api/decorators/children.md +92 -0
- package/skills/studiometa-js-toolkit/references/api/decorators/component.md +75 -0
- package/skills/studiometa-js-toolkit/references/api/decorators/index.md +41 -0
- package/skills/studiometa-js-toolkit/references/api/decorators/inject.md +73 -0
- package/skills/studiometa-js-toolkit/references/api/decorators/on.md +149 -0
- package/skills/studiometa-js-toolkit/references/api/decorators/provide.md +77 -0
- package/skills/studiometa-js-toolkit/references/api/decorators/read-write.md +93 -0
- package/skills/studiometa-js-toolkit/references/api/diagnostics/DIAGNOSTICS.md +137 -0
- package/skills/studiometa-js-toolkit/references/api/diagnostics/EVENTS.md +45 -0
- package/skills/studiometa-js-toolkit/references/api/diagnostics/index.md +58 -0
- package/skills/studiometa-js-toolkit/references/api/diagnostics/reportDiagnostic.md +67 -0
- package/skills/studiometa-js-toolkit/references/api/diagnostics/warn.md +54 -0
- package/skills/studiometa-js-toolkit/references/api/dom/breakpoints.md +81 -0
- package/skills/studiometa-js-toolkit/references/api/dom/domUpdate.md +70 -0
- package/skills/studiometa-js-toolkit/references/api/dom/emitExtendable.md +68 -0
- package/skills/studiometa-js-toolkit/references/api/dom/index.md +26 -0
- package/skills/studiometa-js-toolkit/references/api/dom/swap.md +105 -0
- package/skills/studiometa-js-toolkit/references/api/dom/watchAttributeNamespace.md +96 -0
- package/skills/studiometa-js-toolkit/references/api/dom/watchAttributes.md +56 -0
- package/skills/studiometa-js-toolkit/references/api/dom/whenDOMSettled.md +41 -0
- package/skills/studiometa-js-toolkit/references/api/html/data-component.md +105 -0
- package/skills/studiometa-js-toolkit/references/api/html/data-mount.md +69 -0
- package/skills/studiometa-js-toolkit/references/api/html/data-option.md +106 -0
- package/skills/studiometa-js-toolkit/references/api/html/data-ref.md +63 -0
- package/skills/studiometa-js-toolkit/references/api/html/index.md +32 -0
- package/skills/studiometa-js-toolkit/references/api/index.md +73 -0
- package/skills/studiometa-js-toolkit/references/api/instance-events.md +75 -0
- package/skills/studiometa-js-toolkit/references/api/instance-methods.md +267 -0
- package/skills/studiometa-js-toolkit/references/api/instance-properties.md +90 -0
- package/skills/studiometa-js-toolkit/references/api/methods-hooks-events.md +149 -0
- package/skills/studiometa-js-toolkit/references/api/methods-hooks-lifecycle.md +90 -0
- package/skills/studiometa-js-toolkit/references/api/methods-hooks-options.md +96 -0
- package/skills/studiometa-js-toolkit/references/api/methods-hooks-services.md +164 -0
- package/skills/studiometa-js-toolkit/references/api/registry/defineManifest.md +57 -0
- package/skills/studiometa-js-toolkit/references/api/registry/fromMetaGlob.md +33 -0
- package/skills/studiometa-js-toolkit/references/api/registry/fromWebpackContext.md +37 -0
- package/skills/studiometa-js-toolkit/references/api/registry/getInstance.md +52 -0
- package/skills/studiometa-js-toolkit/references/api/registry/getInstances.md +48 -0
- package/skills/studiometa-js-toolkit/references/api/registry/getMountedInstances.md +39 -0
- package/skills/studiometa-js-toolkit/references/api/registry/getUnmountedInstances.md +46 -0
- package/skills/studiometa-js-toolkit/references/api/registry/index.md +49 -0
- package/skills/studiometa-js-toolkit/references/api/registry/registerComponent.md +93 -0
- package/skills/studiometa-js-toolkit/references/api/registry/registerComponents.md +37 -0
- package/skills/studiometa-js-toolkit/references/api/registry/registerManifest.md +72 -0
- package/skills/studiometa-js-toolkit/references/api/scheduler/defaultScheduler.md +104 -0
- package/skills/studiometa-js-toolkit/references/api/scheduler/index.md +27 -0
- package/skills/studiometa-js-toolkit/references/api/scheduler/nextFrame.md +31 -0
- package/skills/studiometa-js-toolkit/references/api/scheduler/viewTransition.md +53 -0
- package/skills/studiometa-js-toolkit/references/api/services/createService.md +95 -0
- package/skills/studiometa-js-toolkit/references/api/services/createServiceMixin.md +81 -0
- package/skills/studiometa-js-toolkit/references/api/services/index.md +94 -0
- package/skills/studiometa-js-toolkit/references/api/services/mixins.md +148 -0
- package/skills/studiometa-js-toolkit/references/api/services/perTarget.md +65 -0
- package/skills/studiometa-js-toolkit/references/api/services/toggle.md +80 -0
- package/skills/studiometa-js-toolkit/references/api/services/until.md +44 -0
- package/skills/studiometa-js-toolkit/references/api/services/useBreakpoint.md +42 -0
- package/skills/studiometa-js-toolkit/references/api/services/useDrag.md +119 -0
- package/skills/studiometa-js-toolkit/references/api/services/useInView.md +64 -0
- package/skills/studiometa-js-toolkit/references/api/services/useKey.md +105 -0
- package/skills/studiometa-js-toolkit/references/api/services/useMediaQuery.md +45 -0
- package/skills/studiometa-js-toolkit/references/api/services/useMutation.md +69 -0
- package/skills/studiometa-js-toolkit/references/api/services/usePointer.md +91 -0
- package/skills/studiometa-js-toolkit/references/api/services/usePrefersReducedMotion.md +42 -0
- package/skills/studiometa-js-toolkit/references/api/services/useRaf.md +91 -0
- package/skills/studiometa-js-toolkit/references/api/services/useResize.md +60 -0
- package/skills/studiometa-js-toolkit/references/api/services/useScroll.md +88 -0
- package/skills/studiometa-js-toolkit/references/api/services/useScrollProgress.md +88 -0
- package/skills/studiometa-js-toolkit/references/api/services/useWindowScroll.md +25 -0
- package/skills/studiometa-js-toolkit/references/api/services/useWindowSize.md +25 -0
- package/skills/studiometa-js-toolkit/references/api/storage/createStorage.md +126 -0
- package/skills/studiometa-js-toolkit/references/api/storage/index.md +33 -0
- package/skills/studiometa-js-toolkit/references/api/storage/presets.md +58 -0
- package/skills/studiometa-js-toolkit/references/api/storage/providers.md +109 -0
- package/skills/studiometa-js-toolkit/references/api/test/index.md +214 -0
- package/skills/studiometa-js-toolkit/references/guide/concepts/attribute-grammar.md +93 -0
- package/skills/studiometa-js-toolkit/references/guide/concepts/mutation-engine.md +71 -0
- package/skills/studiometa-js-toolkit/references/guide/concepts/philosophy.md +78 -0
- package/skills/studiometa-js-toolkit/references/guide/concepts/the-registry.md +110 -0
- package/skills/studiometa-js-toolkit/references/guide/going-further/autoloading.md +104 -0
- package/skills/studiometa-js-toolkit/references/guide/going-further/handling-diagnostics.md +104 -0
- package/skills/studiometa-js-toolkit/references/guide/going-further/mount-strategies.md +95 -0
- package/skills/studiometa-js-toolkit/references/guide/going-further/scheduling-work.md +124 -0
- package/skills/studiometa-js-toolkit/references/guide/going-further/sharing-state.md +218 -0
- package/skills/studiometa-js-toolkit/references/guide/going-further/swapping-content.md +92 -0
- package/skills/studiometa-js-toolkit/references/guide/going-further/testing-components.md +137 -0
- package/skills/studiometa-js-toolkit/references/guide/going-further/typing-components.md +190 -0
- package/skills/studiometa-js-toolkit/references/guide/going-further/using-decorators.md +168 -0
- package/skills/studiometa-js-toolkit/references/guide/going-further/using-storage.md +125 -0
- package/skills/studiometa-js-toolkit/references/guide/index.md +163 -0
- package/skills/studiometa-js-toolkit/references/guide/introduction/installation.md +144 -0
- package/skills/studiometa-js-toolkit/references/guide/introduction/lifecycle-hooks.md +174 -0
- package/skills/studiometa-js-toolkit/references/guide/introduction/managing-components.md +229 -0
- package/skills/studiometa-js-toolkit/references/guide/introduction/managing-options.md +235 -0
- package/skills/studiometa-js-toolkit/references/guide/introduction/managing-refs.md +174 -0
- package/skills/studiometa-js-toolkit/references/guide/introduction/using-services.md +218 -0
- package/skills/studiometa-js-toolkit/references/guide/introduction/working-with-events.md +251 -0
- package/skills/studiometa-js-toolkit/references/guide/migration/v3-to-v4.md +373 -0
- package/skills/studiometa-js-toolkit/references/utils/css.md +98 -0
- package/skills/studiometa-js-toolkit/references/utils/dom.md +54 -0
- package/skills/studiometa-js-toolkit/references/utils/easings.md +217 -0
- package/skills/studiometa-js-toolkit/references/utils/focus.md +84 -0
- package/skills/studiometa-js-toolkit/references/utils/history.md +69 -0
- package/skills/studiometa-js-toolkit/references/utils/index.md +53 -0
- package/skills/studiometa-js-toolkit/references/utils/is.md +84 -0
- package/skills/studiometa-js-toolkit/references/utils/load.md +59 -0
- package/skills/studiometa-js-toolkit/references/utils/math.md +129 -0
- package/skills/studiometa-js-toolkit/references/utils/motion.md +218 -0
- package/skills/studiometa-js-toolkit/references/utils/objects.md +68 -0
- package/skills/studiometa-js-toolkit/references/utils/scroll.md +128 -0
- package/skills/studiometa-js-toolkit/references/utils/strings.md +176 -0
- package/skills/studiometa-js-toolkit/references/utils/timing.md +111 -0
- package/skills/studiometa-js-toolkit/references/utils/transitions.md +122 -0
package/dist/utils/history.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/history.ts
|
|
2
2
|
/**
|
|
3
3
|
* Set one param, recursing into arrays and objects as bracketed names.
|
|
4
4
|
*
|
|
@@ -60,7 +60,6 @@ function historyPush(options, data = {}, title = "") {
|
|
|
60
60
|
function historyReplace(options, data = {}, title = "") {
|
|
61
61
|
history.replaceState(data, title, urlFor(options));
|
|
62
62
|
}
|
|
63
|
-
//#endregion
|
|
64
63
|
export { historyPush, historyReplace, objectToURLSearchParams };
|
|
65
64
|
|
|
66
65
|
//# sourceMappingURL=history.js.map
|
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"
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"homepage": "https://js-toolkit-v4.studiometa.dev",
|
|
22
22
|
"files": [
|
|
23
23
|
"dist",
|
|
24
|
+
"skills",
|
|
24
25
|
"README.md",
|
|
25
26
|
"LICENSE"
|
|
26
27
|
],
|
|
@@ -812,7 +813,8 @@
|
|
|
812
813
|
}
|
|
813
814
|
},
|
|
814
815
|
"scripts": {
|
|
815
|
-
"build": "node scripts/build.js",
|
|
816
|
+
"build": "node scripts/build.js && npm run build:skills",
|
|
817
|
+
"build:skills": "node ../../scripts/build-skills.js",
|
|
816
818
|
"check:constant-subpaths": "node scripts/check-constant-subpaths.js",
|
|
817
819
|
"check:diagnostics": "node scripts/check-diagnostics.js",
|
|
818
820
|
"check:doc-links": "node scripts/check-doc-links.js",
|
|
@@ -822,6 +824,7 @@
|
|
|
822
824
|
"demo:preview": "vite preview demo --host",
|
|
823
825
|
"docs:dev": "vitepress dev docs",
|
|
824
826
|
"docs:build": "vitepress build docs",
|
|
827
|
+
"postdocs:build": "node ../../scripts/build-skills.js --well-known docs/.vitepress/dist",
|
|
825
828
|
"docs:preview": "vitepress preview docs",
|
|
826
829
|
"test": "npm run check:diagnostics && npm run check:doc-links && npm run test:fixtures && vitest run",
|
|
827
830
|
"test:fixtures": "node scripts/build-runtime-fixtures.js",
|
|
@@ -848,7 +851,7 @@
|
|
|
848
851
|
"playwright": "^1.50.0",
|
|
849
852
|
"tailwindcss": "4.2.2",
|
|
850
853
|
"tsdown": "0.22.14",
|
|
851
|
-
"vite": "8.2.
|
|
854
|
+
"vite": "8.2.4",
|
|
852
855
|
"vitepress": "2.0.0-alpha.19",
|
|
853
856
|
"vitepress-plugin-llms": "1.12.0",
|
|
854
857
|
"vitest": "4.1.10"
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: studiometa-js-toolkit
|
|
3
|
+
description: Write components with @studiometa/js-toolkit v4 — classes that extend Base, registered with registerComponent and bound to the DOM through data-component, data-ref, data-option-* and data-mount attributes. Use when code imports @studiometa/js-toolkit, extends Base, uses $refs, $options, $emit, $query, $closest, on<Ref><Event> hooks, services (useScroll, useResize, useRaf, withScroll…), mount strategies, provide/inject, the scheduler or @studiometa/js-toolkit/utils, or when you migrate code from js-toolkit v3.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @studiometa/js-toolkit
|
|
7
|
+
|
|
8
|
+
`@studiometa/js-toolkit` binds JavaScript classes to server-rendered HTML. A component is a class that extends `Base`, a name in the registry, and a `data-component` attribute in the markup.
|
|
9
|
+
|
|
10
|
+
This skill matches the installed package version. v4 is a full breaking major: most examples on the web and in training data are v3 code that does not work in v4. Read the references in this folder before the online docs.
|
|
11
|
+
|
|
12
|
+
## References
|
|
13
|
+
|
|
14
|
+
- `references/guide/introduction/`: components, refs, options, events, lifecycle, services. Start here.
|
|
15
|
+
- `references/guide/going-further/`: autoloading, mount strategies, scheduling, shared state, swapping content, testing, TypeScript, decorators, storage, diagnostics.
|
|
16
|
+
- `references/guide/migration/v3-to-v4.md`: every v3 API that changed, with its replacement. Read it before you change existing code.
|
|
17
|
+
- `references/api/`: the exact API of `Base`, the registry, services, context, DOM helpers, scheduler, storage and diagnostics.
|
|
18
|
+
- `references/utils/`: the utilities of `@studiometa/js-toolkit/utils`, by category.
|
|
19
|
+
|
|
20
|
+
## A component
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
import { Base, registerComponent } from '@studiometa/js-toolkit';
|
|
24
|
+
|
|
25
|
+
class Counter extends Base {
|
|
26
|
+
static config = {
|
|
27
|
+
name: 'Counter',
|
|
28
|
+
refs: ['output'],
|
|
29
|
+
options: { step: { type: Number, default: 1 } },
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
count = 0;
|
|
33
|
+
|
|
34
|
+
onClick() {
|
|
35
|
+
this.count += this.$options.step;
|
|
36
|
+
this.$refs.output.textContent = String(this.count);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
registerComponent(Counter);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<button data-component="Counter" data-option-step="5">
|
|
45
|
+
Clicked
|
|
46
|
+
<span data-ref="output">0</span>
|
|
47
|
+
times
|
|
48
|
+
</button>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## v4 rules
|
|
52
|
+
|
|
53
|
+
These are the v3 habits that break in v4:
|
|
54
|
+
|
|
55
|
+
| Do not write (v3) | Write (v4) |
|
|
56
|
+
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
|
|
57
|
+
| `createApp(App)` | `registerComponents(A, B, C)`: no root component |
|
|
58
|
+
| `this.$children.Item`, `this.$parent`, `this.$root` | `this.$query('Item')`, `this.$watchChildren('Item')`, `this.$closest('Name')` (can be `null`) |
|
|
59
|
+
| `this.$update()` | nothing: `$refs` reads the DOM on each access |
|
|
60
|
+
| `data-ref="items"` for a list | `data-ref="items[]"`, same as `refs: ['items[]']`; read it as `this.$refs.items` |
|
|
61
|
+
| `this.$options.open = true` | `$options` is read-only: change the `data-option-*` attribute |
|
|
62
|
+
| `data-option-open="false"` | remove the attribute, or `data-option-no-open` when the default is `true` |
|
|
63
|
+
| `default: {}` or `default: []` | a factory: `default: () => ({})` |
|
|
64
|
+
| `this.$emit('go', 1, 'left')` | one payload object: `this.$emit('go', { index: 1, direction: 'left' })` |
|
|
65
|
+
| `onItemClick(event, index)` | one object: `onItemsClick({ event, target, index })`, `onChildEvent({ event, target, payload })` |
|
|
66
|
+
| `updated()` | `option<Name>Changed()` or `watchAttributes()` |
|
|
67
|
+
| `unmounted()` only to unsubscribe | return the cleanup from `mounted()` |
|
|
68
|
+
| `data-load`, `withMountWhenInView`, `importWhen*` | `data-mount="visible"` or a `registerManifest()` entry with `mountStrategy` |
|
|
69
|
+
| `withExtraConfig()` | a subclass with its own `static config` |
|
|
70
|
+
| `withResponsiveOptions`, `data-option-x:s:m` | every option is responsive: `data-option-x:s` cascades up |
|
|
71
|
+
| `domScheduler`, `afterWrite` | `this.$read()` / `this.$write()`, or `defaultScheduler` |
|
|
72
|
+
| `tween`, `animate` | not in core: use `transition()`, `spring()`, `smoothTo()` or `@studiometa/ui-motion` |
|
|
73
|
+
|
|
74
|
+
## Practices
|
|
75
|
+
|
|
76
|
+
- Let the registry construct instances. Never call `new MyComponent(el)`.
|
|
77
|
+
- Declare `refs` and use `on<Ref><Event>` hooks instead of `querySelector` and `addEventListener`. Use `onWindow<Event>` and `onDocument<Event>` for global events.
|
|
78
|
+
- Use a service before a custom listener or observer: the mixins `withScroll` (`scrolled`), `withResize` (`resized`), `withRaf` (`ticked`), `withPointer` (`moved`), `withDrag` (`dragged`), `withKey` (`keyed`), `withInView` (`intersected`), `withMutation` (`mutated`), `withScrollProgress` (`scrolledInView`), or the `use*()` functions.
|
|
79
|
+
- Use mount strategies (`eager`, `visible`, `in-view`, `idle`, `interaction`, `media:<query>`) to defer work, not custom observers.
|
|
80
|
+
- Share state with `provideRootContext()`, `$provide()` and `$inject()`, not with global variables.
|
|
81
|
+
- Import utilities from `@studiometa/js-toolkit/utils` (for example `import { clamp, damp } from '@studiometa/js-toolkit/utils'`). Read `references/utils/` before you write a helper.
|
|
82
|
+
- Diagnostics (`EVENTS.diagnostic`) explain wrong refs, options and payloads. Read the warning code in `references/api/diagnostics/DIAGNOSTICS.md`.
|
|
83
|
+
|
|
84
|
+
## Related skills
|
|
85
|
+
|
|
86
|
+
- `studiometa-ui`: ready-made components (Action, Dialog, Disclosure, Tabs, Carousel, Fetch, Transition, Data*…). Look for a component there before you write a custom one.
|
|
87
|
+
- `studiometa-eslint-plugin-js-toolkit`: the lint rules for js-toolkit code.
|