@studiometa/js-toolkit 3.8.1 → 3.9.0-beta.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/autoload/autoload.d.ts +37 -0
- package/autoload/autoload.js +29 -0
- package/autoload/autoload.js.map +7 -0
- package/autoload/define-manifest.d.ts +60 -0
- package/autoload/define-manifest.js +51 -0
- package/autoload/define-manifest.js.map +7 -0
- package/autoload/index.d.ts +6 -0
- package/autoload/index.js +34 -0
- package/autoload/index.js.map +7 -0
- package/autoload/loader.d.ts +108 -0
- package/autoload/loader.js +381 -0
- package/autoload/loader.js.map +7 -0
- package/autoload/modules.d.ts +31 -0
- package/autoload/modules.js +21 -0
- package/autoload/modules.js.map +7 -0
- package/autoload/runtime.d.ts +93 -0
- package/autoload/runtime.js +100 -0
- package/autoload/runtime.js.map +7 -0
- package/autoload/types.d.ts +49 -0
- package/autoload/types.js +1 -0
- package/autoload/types.js.map +7 -0
- package/index.d.ts +2 -1
- package/index.js +27 -1
- package/index.js.map +2 -2
- package/package.json +1162 -1
- package/subpaths/AbstractService.d.ts +1 -0
- package/subpaths/AbstractService.js +6 -0
- package/subpaths/AbstractService.js.map +7 -0
- package/subpaths/AutoloadHandle.d.ts +1 -0
- package/subpaths/AutoloadHandle.js +1 -0
- package/subpaths/AutoloadHandle.js.map +7 -0
- package/subpaths/AutoloadOptions.d.ts +1 -0
- package/subpaths/AutoloadOptions.js +1 -0
- package/subpaths/AutoloadOptions.js.map +7 -0
- package/subpaths/AutoloadRuntime.d.ts +1 -0
- package/subpaths/AutoloadRuntime.js +1 -0
- package/subpaths/AutoloadRuntime.js.map +7 -0
- package/subpaths/Base.d.ts +1 -0
- package/subpaths/Base.js +6 -0
- package/subpaths/Base.js.map +7 -0
- package/subpaths/BaseAsyncConstructor.d.ts +1 -0
- package/subpaths/BaseAsyncConstructor.js +1 -0
- package/subpaths/BaseAsyncConstructor.js.map +7 -0
- package/subpaths/BaseChildren.d.ts +1 -0
- package/subpaths/BaseChildren.js +1 -0
- package/subpaths/BaseChildren.js.map +7 -0
- package/subpaths/BaseConfig.d.ts +1 -0
- package/subpaths/BaseConfig.js +1 -0
- package/subpaths/BaseConfig.js.map +7 -0
- package/subpaths/BaseConfigComponents.d.ts +1 -0
- package/subpaths/BaseConfigComponents.js +1 -0
- package/subpaths/BaseConfigComponents.js.map +7 -0
- package/subpaths/BaseConstructor.d.ts +1 -0
- package/subpaths/BaseConstructor.js +1 -0
- package/subpaths/BaseConstructor.js.map +7 -0
- package/subpaths/BaseDecorator.d.ts +1 -0
- package/subpaths/BaseDecorator.js +1 -0
- package/subpaths/BaseDecorator.js.map +7 -0
- package/subpaths/BaseEl.d.ts +1 -0
- package/subpaths/BaseEl.js +1 -0
- package/subpaths/BaseEl.js.map +7 -0
- package/subpaths/BaseEventHookParams.d.ts +1 -0
- package/subpaths/BaseEventHookParams.js +1 -0
- package/subpaths/BaseEventHookParams.js.map +7 -0
- package/subpaths/BaseInterface.d.ts +1 -0
- package/subpaths/BaseInterface.js +1 -0
- package/subpaths/BaseInterface.js.map +7 -0
- package/subpaths/BaseOptions.d.ts +1 -0
- package/subpaths/BaseOptions.js +1 -0
- package/subpaths/BaseOptions.js.map +7 -0
- package/subpaths/BaseProps.d.ts +1 -0
- package/subpaths/BaseProps.js +1 -0
- package/subpaths/BaseProps.js.map +7 -0
- package/subpaths/BaseRefs.d.ts +1 -0
- package/subpaths/BaseRefs.js +1 -0
- package/subpaths/BaseRefs.js.map +7 -0
- package/subpaths/ComponentLoadStrategy.d.ts +1 -0
- package/subpaths/ComponentLoadStrategy.js +1 -0
- package/subpaths/ComponentLoadStrategy.js.map +7 -0
- package/subpaths/ComponentLoader.d.ts +1 -0
- package/subpaths/ComponentLoader.js +6 -0
- package/subpaths/ComponentLoader.js.map +7 -0
- package/subpaths/ComponentLoaderOptions.d.ts +1 -0
- package/subpaths/ComponentLoaderOptions.js +1 -0
- package/subpaths/ComponentLoaderOptions.js.map +7 -0
- package/subpaths/ComponentLoaderStartOptions.d.ts +1 -0
- package/subpaths/ComponentLoaderStartOptions.js +1 -0
- package/subpaths/ComponentLoaderStartOptions.js.map +7 -0
- package/subpaths/ComponentManifest.d.ts +1 -0
- package/subpaths/ComponentManifest.js +1 -0
- package/subpaths/ComponentManifest.js.map +7 -0
- package/subpaths/ComponentManifestEntry.d.ts +1 -0
- package/subpaths/ComponentManifestEntry.js +1 -0
- package/subpaths/ComponentManifestEntry.js.map +7 -0
- package/subpaths/ComponentOverride.d.ts +1 -0
- package/subpaths/ComponentOverride.js +1 -0
- package/subpaths/ComponentOverride.js.map +7 -0
- package/subpaths/CreateAppOptions.d.ts +1 -0
- package/subpaths/CreateAppOptions.js +1 -0
- package/subpaths/CreateAppOptions.js.map +7 -0
- package/subpaths/DEFAULT_DIAGNOSTIC_PREFIX.d.ts +1 -0
- package/subpaths/DEFAULT_DIAGNOSTIC_PREFIX.js +6 -0
- package/subpaths/DEFAULT_DIAGNOSTIC_PREFIX.js.map +7 -0
- package/subpaths/DefineManifestOptions.d.ts +1 -0
- package/subpaths/DefineManifestOptions.js +1 -0
- package/subpaths/DefineManifestOptions.js.map +7 -0
- package/subpaths/DragDecoratorOptions.d.ts +1 -0
- package/subpaths/DragDecoratorOptions.js +1 -0
- package/subpaths/DragDecoratorOptions.js.map +7 -0
- package/subpaths/DragService.d.ts +1 -0
- package/subpaths/DragService.js +6 -0
- package/subpaths/DragService.js.map +7 -0
- package/subpaths/DragServiceInterface.d.ts +1 -0
- package/subpaths/DragServiceInterface.js +1 -0
- package/subpaths/DragServiceInterface.js.map +7 -0
- package/subpaths/DragServiceOptions.d.ts +1 -0
- package/subpaths/DragServiceOptions.js +1 -0
- package/subpaths/DragServiceOptions.js.map +7 -0
- package/subpaths/DragServiceProps.d.ts +1 -0
- package/subpaths/DragServiceProps.js +1 -0
- package/subpaths/DragServiceProps.js.map +7 -0
- package/subpaths/IDLE_TIMEOUT.d.ts +1 -0
- package/subpaths/IDLE_TIMEOUT.js +6 -0
- package/subpaths/IDLE_TIMEOUT.js.map +7 -0
- package/subpaths/KeyService.d.ts +1 -0
- package/subpaths/KeyService.js +6 -0
- package/subpaths/KeyService.js.map +7 -0
- package/subpaths/KeyServiceInterface.d.ts +1 -0
- package/subpaths/KeyServiceInterface.js +1 -0
- package/subpaths/KeyServiceInterface.js.map +7 -0
- package/subpaths/KeyServiceProps.d.ts +1 -0
- package/subpaths/KeyServiceProps.js +1 -0
- package/subpaths/KeyServiceProps.js.map +7 -0
- package/subpaths/LoadService.d.ts +1 -0
- package/subpaths/LoadService.js +6 -0
- package/subpaths/LoadService.js.map +7 -0
- package/subpaths/LoadServiceInterface.d.ts +1 -0
- package/subpaths/LoadServiceInterface.js +1 -0
- package/subpaths/LoadServiceInterface.js.map +7 -0
- package/subpaths/LoadServiceProps.d.ts +1 -0
- package/subpaths/LoadServiceProps.js +1 -0
- package/subpaths/LoadServiceProps.js.map +7 -0
- package/subpaths/LoaderDependencies.d.ts +1 -0
- package/subpaths/LoaderDependencies.js +1 -0
- package/subpaths/LoaderDependencies.js.map +7 -0
- package/subpaths/Managers.d.ts +1 -0
- package/subpaths/Managers.js +1 -0
- package/subpaths/Managers.js.map +7 -0
- package/subpaths/ModuleRecord.d.ts +1 -0
- package/subpaths/ModuleRecord.js +1 -0
- package/subpaths/ModuleRecord.js.map +7 -0
- package/subpaths/MutationDecoratorOptions.d.ts +1 -0
- package/subpaths/MutationDecoratorOptions.js +1 -0
- package/subpaths/MutationDecoratorOptions.js.map +7 -0
- package/subpaths/MutationService.d.ts +1 -0
- package/subpaths/MutationService.js +6 -0
- package/subpaths/MutationService.js.map +7 -0
- package/subpaths/MutationServiceInterface.d.ts +1 -0
- package/subpaths/MutationServiceInterface.js +1 -0
- package/subpaths/MutationServiceInterface.js.map +7 -0
- package/subpaths/MutationServiceOptions.d.ts +1 -0
- package/subpaths/MutationServiceOptions.js +1 -0
- package/subpaths/MutationServiceOptions.js.map +7 -0
- package/subpaths/MutationServiceProps.d.ts +1 -0
- package/subpaths/MutationServiceProps.js +1 -0
- package/subpaths/MutationServiceProps.js.map +7 -0
- package/subpaths/NormalizedOffset.d.ts +1 -0
- package/subpaths/NormalizedOffset.js +1 -0
- package/subpaths/NormalizedOffset.js.map +7 -0
- package/subpaths/OffsetValue.d.ts +1 -0
- package/subpaths/OffsetValue.js +1 -0
- package/subpaths/OffsetValue.js.map +7 -0
- package/subpaths/PointerService.d.ts +1 -0
- package/subpaths/PointerService.js +6 -0
- package/subpaths/PointerService.js.map +7 -0
- package/subpaths/PointerServiceInterface.d.ts +1 -0
- package/subpaths/PointerServiceInterface.js +1 -0
- package/subpaths/PointerServiceInterface.js.map +7 -0
- package/subpaths/PointerServiceProps.d.ts +1 -0
- package/subpaths/PointerServiceProps.js +1 -0
- package/subpaths/PointerServiceProps.js.map +7 -0
- package/subpaths/QueryOptions.d.ts +1 -0
- package/subpaths/QueryOptions.js +1 -0
- package/subpaths/QueryOptions.js.map +7 -0
- package/subpaths/RafService.d.ts +1 -0
- package/subpaths/RafService.js +6 -0
- package/subpaths/RafService.js.map +7 -0
- package/subpaths/RafServiceInterface.d.ts +1 -0
- package/subpaths/RafServiceInterface.js +1 -0
- package/subpaths/RafServiceInterface.js.map +7 -0
- package/subpaths/RafServiceProps.d.ts +1 -0
- package/subpaths/RafServiceProps.js +1 -0
- package/subpaths/RafServiceProps.js.map +7 -0
- package/subpaths/RegisterManifestOptions.d.ts +1 -0
- package/subpaths/RegisterManifestOptions.js +1 -0
- package/subpaths/RegisterManifestOptions.js.map +7 -0
- package/subpaths/RelativePointerDecoratorOptions.d.ts +1 -0
- package/subpaths/RelativePointerDecoratorOptions.js +1 -0
- package/subpaths/RelativePointerDecoratorOptions.js.map +7 -0
- package/subpaths/RelativePointerInterface.d.ts +1 -0
- package/subpaths/RelativePointerInterface.js +1 -0
- package/subpaths/RelativePointerInterface.js.map +7 -0
- package/subpaths/ResizeService.d.ts +1 -0
- package/subpaths/ResizeService.js +6 -0
- package/subpaths/ResizeService.js.map +7 -0
- package/subpaths/ResizeServiceInterface.d.ts +1 -0
- package/subpaths/ResizeServiceInterface.js +1 -0
- package/subpaths/ResizeServiceInterface.js.map +7 -0
- package/subpaths/ResizeServiceProps.d.ts +1 -0
- package/subpaths/ResizeServiceProps.js +1 -0
- package/subpaths/ResizeServiceProps.js.map +7 -0
- package/subpaths/ScrollInViewProps.d.ts +1 -0
- package/subpaths/ScrollInViewProps.js +1 -0
- package/subpaths/ScrollInViewProps.js.map +7 -0
- package/subpaths/ScrollService.d.ts +1 -0
- package/subpaths/ScrollService.js +6 -0
- package/subpaths/ScrollService.js.map +7 -0
- package/subpaths/ScrollServiceInterface.d.ts +1 -0
- package/subpaths/ScrollServiceInterface.js +1 -0
- package/subpaths/ScrollServiceInterface.js.map +7 -0
- package/subpaths/ScrollServiceProps.d.ts +1 -0
- package/subpaths/ScrollServiceProps.js +1 -0
- package/subpaths/ScrollServiceProps.js.map +7 -0
- package/subpaths/ServiceConfig.d.ts +1 -0
- package/subpaths/ServiceConfig.js +1 -0
- package/subpaths/ServiceConfig.js.map +7 -0
- package/subpaths/ServiceInterface.d.ts +1 -0
- package/subpaths/ServiceInterface.js +1 -0
- package/subpaths/ServiceInterface.js.map +7 -0
- package/subpaths/VISIBLE_ROOT_MARGIN.d.ts +1 -0
- package/subpaths/VISIBLE_ROOT_MARGIN.js +6 -0
- package/subpaths/VISIBLE_ROOT_MARGIN.js.map +7 -0
- package/subpaths/WebpackContextLike.d.ts +1 -0
- package/subpaths/WebpackContextLike.js +1 -0
- package/subpaths/WebpackContextLike.js.map +7 -0
- package/subpaths/WithBreakpointObserverInterface.d.ts +1 -0
- package/subpaths/WithBreakpointObserverInterface.js +1 -0
- package/subpaths/WithBreakpointObserverInterface.js.map +7 -0
- package/subpaths/WithBreakpointObserverProps.d.ts +1 -0
- package/subpaths/WithBreakpointObserverProps.js +1 -0
- package/subpaths/WithBreakpointObserverProps.js.map +7 -0
- package/subpaths/WithDragInterface.d.ts +1 -0
- package/subpaths/WithDragInterface.js +1 -0
- package/subpaths/WithDragInterface.js.map +7 -0
- package/subpaths/WithFreezedOptionsInterface.d.ts +1 -0
- package/subpaths/WithFreezedOptionsInterface.js +1 -0
- package/subpaths/WithFreezedOptionsInterface.js.map +7 -0
- package/subpaths/WithGroupInterface.d.ts +1 -0
- package/subpaths/WithGroupInterface.js +1 -0
- package/subpaths/WithGroupInterface.js.map +7 -0
- package/subpaths/WithGroupOptions.d.ts +1 -0
- package/subpaths/WithGroupOptions.js +1 -0
- package/subpaths/WithGroupOptions.js.map +7 -0
- package/subpaths/WithGroupProps.d.ts +1 -0
- package/subpaths/WithGroupProps.js +1 -0
- package/subpaths/WithGroupProps.js.map +7 -0
- package/subpaths/WithIntersectionObserverInterface.d.ts +1 -0
- package/subpaths/WithIntersectionObserverInterface.js +1 -0
- package/subpaths/WithIntersectionObserverInterface.js.map +7 -0
- package/subpaths/WithIntersectionObserverProps.d.ts +1 -0
- package/subpaths/WithIntersectionObserverProps.js +1 -0
- package/subpaths/WithIntersectionObserverProps.js.map +7 -0
- package/subpaths/WithMountWhenInViewInterface.d.ts +1 -0
- package/subpaths/WithMountWhenInViewInterface.js +1 -0
- package/subpaths/WithMountWhenInViewInterface.js.map +7 -0
- package/subpaths/WithMountWhenInViewProps.d.ts +1 -0
- package/subpaths/WithMountWhenInViewProps.js +1 -0
- package/subpaths/WithMountWhenInViewProps.js.map +7 -0
- package/subpaths/WithMutationInterface.d.ts +1 -0
- package/subpaths/WithMutationInterface.js +1 -0
- package/subpaths/WithMutationInterface.js.map +7 -0
- package/subpaths/WithScrolledInViewInterface.d.ts +1 -0
- package/subpaths/WithScrolledInViewInterface.js +1 -0
- package/subpaths/WithScrolledInViewInterface.js.map +7 -0
- package/subpaths/WithScrolledInViewOptions.d.ts +1 -0
- package/subpaths/WithScrolledInViewOptions.js +1 -0
- package/subpaths/WithScrolledInViewOptions.js.map +7 -0
- package/subpaths/WithScrolledInViewProps.d.ts +1 -0
- package/subpaths/WithScrolledInViewProps.js +1 -0
- package/subpaths/WithScrolledInViewProps.js.map +7 -0
- package/subpaths/autoload.d.ts +1 -0
- package/subpaths/autoload.js +6 -0
- package/subpaths/autoload.js.map +7 -0
- package/subpaths/closestComponent.d.ts +1 -0
- package/subpaths/closestComponent.js +6 -0
- package/subpaths/closestComponent.js.map +7 -0
- package/subpaths/composeManifests.d.ts +1 -0
- package/subpaths/composeManifests.js +6 -0
- package/subpaths/composeManifests.js.map +7 -0
- package/subpaths/createApp.d.ts +1 -0
- package/subpaths/createApp.js +6 -0
- package/subpaths/createApp.js.map +7 -0
- package/subpaths/defineFeatures.d.ts +1 -0
- package/subpaths/defineFeatures.js +6 -0
- package/subpaths/defineFeatures.js.map +7 -0
- package/subpaths/defineManifest.d.ts +1 -0
- package/subpaths/defineManifest.js +6 -0
- package/subpaths/defineManifest.js.map +7 -0
- package/subpaths/fromMetaGlob.d.ts +1 -0
- package/subpaths/fromMetaGlob.js +6 -0
- package/subpaths/fromMetaGlob.js.map +7 -0
- package/subpaths/fromWebpackContext.d.ts +1 -0
- package/subpaths/fromWebpackContext.js +6 -0
- package/subpaths/fromWebpackContext.js.map +7 -0
- package/subpaths/getClosestParent.d.ts +1 -0
- package/subpaths/getClosestParent.js +6 -0
- package/subpaths/getClosestParent.js.map +7 -0
- package/subpaths/getDirectChildren.d.ts +1 -0
- package/subpaths/getDirectChildren.js +6 -0
- package/subpaths/getDirectChildren.js.map +7 -0
- package/subpaths/getInstanceFromElement.d.ts +1 -0
- package/subpaths/getInstanceFromElement.js +6 -0
- package/subpaths/getInstanceFromElement.js.map +7 -0
- package/subpaths/getInstances.d.ts +1 -0
- package/subpaths/getInstances.js +6 -0
- package/subpaths/getInstances.js.map +7 -0
- package/subpaths/getScopedGroups.d.ts +1 -0
- package/subpaths/getScopedGroups.js +6 -0
- package/subpaths/getScopedGroups.js.map +7 -0
- package/subpaths/importOnInteraction.d.ts +1 -0
- package/subpaths/importOnInteraction.js +6 -0
- package/subpaths/importOnInteraction.js.map +7 -0
- package/subpaths/importOnMediaQuery.d.ts +1 -0
- package/subpaths/importOnMediaQuery.js +6 -0
- package/subpaths/importOnMediaQuery.js.map +7 -0
- package/subpaths/importWhenIdle.d.ts +1 -0
- package/subpaths/importWhenIdle.js +6 -0
- package/subpaths/importWhenIdle.js.map +7 -0
- package/subpaths/importWhenPrefersMotion.d.ts +1 -0
- package/subpaths/importWhenPrefersMotion.js +6 -0
- package/subpaths/importWhenPrefersMotion.js.map +7 -0
- package/subpaths/importWhenVisible.d.ts +1 -0
- package/subpaths/importWhenVisible.js +6 -0
- package/subpaths/importWhenVisible.js.map +7 -0
- package/subpaths/isDirectChild.d.ts +1 -0
- package/subpaths/isDirectChild.js +6 -0
- package/subpaths/isDirectChild.js.map +7 -0
- package/subpaths/logTree.d.ts +1 -0
- package/subpaths/logTree.js +6 -0
- package/subpaths/logTree.js.map +7 -0
- package/subpaths/queryComponent.d.ts +1 -0
- package/subpaths/queryComponent.js +6 -0
- package/subpaths/queryComponent.js.map +7 -0
- package/subpaths/queryComponentAll.d.ts +1 -0
- package/subpaths/queryComponentAll.js +6 -0
- package/subpaths/queryComponentAll.js.map +7 -0
- package/subpaths/readEagerTokens.d.ts +1 -0
- package/subpaths/readEagerTokens.js +6 -0
- package/subpaths/readEagerTokens.js.map +7 -0
- package/subpaths/registerComponent.d.ts +1 -0
- package/subpaths/registerComponent.js +6 -0
- package/subpaths/registerComponent.js.map +7 -0
- package/subpaths/registerComponents.d.ts +1 -0
- package/subpaths/registerComponents.js +6 -0
- package/subpaths/registerComponents.js.map +7 -0
- package/subpaths/registerManifest.d.ts +1 -0
- package/subpaths/registerManifest.js +6 -0
- package/subpaths/registerManifest.js.map +7 -0
- package/subpaths/registerManifests.d.ts +1 -0
- package/subpaths/registerManifests.js +6 -0
- package/subpaths/registerManifests.js.map +7 -0
- package/subpaths/useDrag.d.ts +1 -0
- package/subpaths/useDrag.js +6 -0
- package/subpaths/useDrag.js.map +7 -0
- package/subpaths/useKey.d.ts +1 -0
- package/subpaths/useKey.js +6 -0
- package/subpaths/useKey.js.map +7 -0
- package/subpaths/useLoad.d.ts +1 -0
- package/subpaths/useLoad.js +6 -0
- package/subpaths/useLoad.js.map +7 -0
- package/subpaths/useMutation.d.ts +1 -0
- package/subpaths/useMutation.js +6 -0
- package/subpaths/useMutation.js.map +7 -0
- package/subpaths/usePointer.d.ts +1 -0
- package/subpaths/usePointer.js +6 -0
- package/subpaths/usePointer.js.map +7 -0
- package/subpaths/useRaf.d.ts +1 -0
- package/subpaths/useRaf.js +6 -0
- package/subpaths/useRaf.js.map +7 -0
- package/subpaths/useResize.d.ts +1 -0
- package/subpaths/useResize.js +6 -0
- package/subpaths/useResize.js.map +7 -0
- package/subpaths/useScroll.d.ts +1 -0
- package/subpaths/useScroll.js +6 -0
- package/subpaths/useScroll.js.map +7 -0
- package/subpaths/utils/Animate.1.d.ts +1 -0
- package/subpaths/utils/Animate.1.js +1 -0
- package/subpaths/utils/Animate.1.js.map +7 -0
- package/subpaths/utils/AnimateOptions.d.ts +1 -0
- package/subpaths/utils/AnimateOptions.js +1 -0
- package/subpaths/utils/AnimateOptions.js.map +7 -0
- package/subpaths/utils/CSSCustomPropertyName.d.ts +1 -0
- package/subpaths/utils/CSSCustomPropertyName.js +1 -0
- package/subpaths/utils/CSSCustomPropertyName.js.map +7 -0
- package/subpaths/utils/EasingFunction.d.ts +1 -0
- package/subpaths/utils/EasingFunction.js +1 -0
- package/subpaths/utils/EasingFunction.js.map +7 -0
- package/subpaths/utils/Keyframe.d.ts +1 -0
- package/subpaths/utils/Keyframe.js +1 -0
- package/subpaths/utils/Keyframe.js.map +7 -0
- package/subpaths/utils/LoadElementsOptions.d.ts +1 -0
- package/subpaths/utils/LoadElementsOptions.js +1 -0
- package/subpaths/utils/LoadElementsOptions.js.map +7 -0
- package/subpaths/utils/LoadElementsReturnType.d.ts +1 -0
- package/subpaths/utils/LoadElementsReturnType.js +1 -0
- package/subpaths/utils/LoadElementsReturnType.js.map +7 -0
- package/subpaths/utils/LoadableElements.d.ts +1 -0
- package/subpaths/utils/LoadableElements.js +1 -0
- package/subpaths/utils/LoadableElements.js.map +7 -0
- package/subpaths/utils/LoadableElementsNames.d.ts +1 -0
- package/subpaths/utils/LoadableElementsNames.js +1 -0
- package/subpaths/utils/LoadableElementsNames.js.map +7 -0
- package/subpaths/utils/NormalizedKeyframe.d.ts +1 -0
- package/subpaths/utils/NormalizedKeyframe.js +1 -0
- package/subpaths/utils/NormalizedKeyframe.js.map +7 -0
- package/subpaths/utils/Queue.d.ts +1 -0
- package/subpaths/utils/Queue.js +6 -0
- package/subpaths/utils/Queue.js.map +7 -0
- package/subpaths/utils/SmartQueue.d.ts +1 -0
- package/subpaths/utils/SmartQueue.js +6 -0
- package/subpaths/utils/SmartQueue.js.map +7 -0
- package/subpaths/utils/StorageInstance.d.ts +1 -0
- package/subpaths/utils/StorageInstance.js +1 -0
- package/subpaths/utils/StorageInstance.js.map +7 -0
- package/subpaths/utils/StorageOptions.d.ts +1 -0
- package/subpaths/utils/StorageOptions.js +1 -0
- package/subpaths/utils/StorageOptions.js.map +7 -0
- package/subpaths/utils/StorageProvider.d.ts +1 -0
- package/subpaths/utils/StorageProvider.js +1 -0
- package/subpaths/utils/StorageProvider.js.map +7 -0
- package/subpaths/utils/StorageSerializer.d.ts +1 -0
- package/subpaths/utils/StorageSerializer.js +1 -0
- package/subpaths/utils/StorageSerializer.js.map +7 -0
- package/subpaths/utils/TransformProps.d.ts +1 -0
- package/subpaths/utils/TransformProps.js +1 -0
- package/subpaths/utils/TransformProps.js.map +7 -0
- package/subpaths/utils/UrlProviderOptions.d.ts +1 -0
- package/subpaths/utils/UrlProviderOptions.js +1 -0
- package/subpaths/utils/UrlProviderOptions.js.map +7 -0
- package/subpaths/utils/addClass.d.ts +1 -0
- package/subpaths/utils/addClass.js +6 -0
- package/subpaths/utils/addClass.js.map +7 -0
- package/subpaths/utils/addStyle.d.ts +1 -0
- package/subpaths/utils/addStyle.js +6 -0
- package/subpaths/utils/addStyle.js.map +7 -0
- package/subpaths/utils/animate.d.ts +1 -0
- package/subpaths/utils/animate.js +6 -0
- package/subpaths/utils/animate.js.map +7 -0
- package/subpaths/utils/boundingRectToCircle.d.ts +1 -0
- package/subpaths/utils/boundingRectToCircle.js +6 -0
- package/subpaths/utils/boundingRectToCircle.js.map +7 -0
- package/subpaths/utils/cache.d.ts +1 -0
- package/subpaths/utils/cache.js +6 -0
- package/subpaths/utils/cache.js.map +7 -0
- package/subpaths/utils/camelCase.d.ts +1 -0
- package/subpaths/utils/camelCase.js +6 -0
- package/subpaths/utils/camelCase.js.map +7 -0
- package/subpaths/utils/clamp.d.ts +1 -0
- package/subpaths/utils/clamp.js +6 -0
- package/subpaths/utils/clamp.js.map +7 -0
- package/subpaths/utils/clamp01.d.ts +1 -0
- package/subpaths/utils/clamp01.js +6 -0
- package/subpaths/utils/clamp01.js.map +7 -0
- package/subpaths/utils/collideCircleCircle.d.ts +1 -0
- package/subpaths/utils/collideCircleCircle.js +6 -0
- package/subpaths/utils/collideCircleCircle.js.map +7 -0
- package/subpaths/utils/collideCircleRect.d.ts +1 -0
- package/subpaths/utils/collideCircleRect.js +6 -0
- package/subpaths/utils/collideCircleRect.js.map +7 -0
- package/subpaths/utils/collidePointCircle.d.ts +1 -0
- package/subpaths/utils/collidePointCircle.js +6 -0
- package/subpaths/utils/collidePointCircle.js.map +7 -0
- package/subpaths/utils/collidePointRect.d.ts +1 -0
- package/subpaths/utils/collidePointRect.js +6 -0
- package/subpaths/utils/collidePointRect.js.map +7 -0
- package/subpaths/utils/collideRectRect.d.ts +1 -0
- package/subpaths/utils/collideRectRect.js +6 -0
- package/subpaths/utils/collideRectRect.js.map +7 -0
- package/subpaths/utils/createEaseInOut.d.ts +1 -0
- package/subpaths/utils/createEaseInOut.js +6 -0
- package/subpaths/utils/createEaseInOut.js.map +7 -0
- package/subpaths/utils/createEaseOut.d.ts +1 -0
- package/subpaths/utils/createEaseOut.js +6 -0
- package/subpaths/utils/createEaseOut.js.map +7 -0
- package/subpaths/utils/createElement.d.ts +1 -0
- package/subpaths/utils/createElement.js +6 -0
- package/subpaths/utils/createElement.js.map +7 -0
- package/subpaths/utils/createLocalStorage.d.ts +1 -0
- package/subpaths/utils/createLocalStorage.js +6 -0
- package/subpaths/utils/createLocalStorage.js.map +7 -0
- package/subpaths/utils/createLocalStorageProvider.d.ts +1 -0
- package/subpaths/utils/createLocalStorageProvider.js +6 -0
- package/subpaths/utils/createLocalStorageProvider.js.map +7 -0
- package/subpaths/utils/createMemoryStorageProvider.d.ts +1 -0
- package/subpaths/utils/createMemoryStorageProvider.js +6 -0
- package/subpaths/utils/createMemoryStorageProvider.js.map +7 -0
- package/subpaths/utils/createNoopProvider.d.ts +1 -0
- package/subpaths/utils/createNoopProvider.js +6 -0
- package/subpaths/utils/createNoopProvider.js.map +7 -0
- package/subpaths/utils/createRange.d.ts +1 -0
- package/subpaths/utils/createRange.js +6 -0
- package/subpaths/utils/createRange.js.map +7 -0
- package/subpaths/utils/createSessionStorage.d.ts +1 -0
- package/subpaths/utils/createSessionStorage.js +6 -0
- package/subpaths/utils/createSessionStorage.js.map +7 -0
- package/subpaths/utils/createSessionStorageProvider.d.ts +1 -0
- package/subpaths/utils/createSessionStorageProvider.js +6 -0
- package/subpaths/utils/createSessionStorageProvider.js.map +7 -0
- package/subpaths/utils/createStorage.d.ts +1 -0
- package/subpaths/utils/createStorage.js +6 -0
- package/subpaths/utils/createStorage.js.map +7 -0
- package/subpaths/utils/createUrlSearchParamsInHashProvider.d.ts +1 -0
- package/subpaths/utils/createUrlSearchParamsInHashProvider.js +6 -0
- package/subpaths/utils/createUrlSearchParamsInHashProvider.js.map +7 -0
- package/subpaths/utils/createUrlSearchParamsInHashStorage.d.ts +1 -0
- package/subpaths/utils/createUrlSearchParamsInHashStorage.js +6 -0
- package/subpaths/utils/createUrlSearchParamsInHashStorage.js.map +7 -0
- package/subpaths/utils/createUrlSearchParamsProvider.d.ts +1 -0
- package/subpaths/utils/createUrlSearchParamsProvider.js +6 -0
- package/subpaths/utils/createUrlSearchParamsProvider.js.map +7 -0
- package/subpaths/utils/createUrlSearchParamsStorage.d.ts +1 -0
- package/subpaths/utils/createUrlSearchParamsStorage.js +6 -0
- package/subpaths/utils/createUrlSearchParamsStorage.js.map +7 -0
- package/subpaths/utils/damp.d.ts +1 -0
- package/subpaths/utils/damp.js +6 -0
- package/subpaths/utils/damp.js.map +7 -0
- package/subpaths/utils/dashCase.d.ts +1 -0
- package/subpaths/utils/dashCase.js +6 -0
- package/subpaths/utils/dashCase.js.map +7 -0
- package/subpaths/utils/debounce.d.ts +1 -0
- package/subpaths/utils/debounce.js +6 -0
- package/subpaths/utils/debounce.js.map +7 -0
- package/subpaths/utils/domScheduler.d.ts +1 -0
- package/subpaths/utils/domScheduler.js +6 -0
- package/subpaths/utils/domScheduler.js.map +7 -0
- package/subpaths/utils/ease.d.ts +1 -0
- package/subpaths/utils/ease.js +6 -0
- package/subpaths/utils/ease.js.map +7 -0
- package/subpaths/utils/easeInCirc.d.ts +1 -0
- package/subpaths/utils/easeInCirc.js +6 -0
- package/subpaths/utils/easeInCirc.js.map +7 -0
- package/subpaths/utils/easeInCubic.d.ts +1 -0
- package/subpaths/utils/easeInCubic.js +6 -0
- package/subpaths/utils/easeInCubic.js.map +7 -0
- package/subpaths/utils/easeInExpo.d.ts +1 -0
- package/subpaths/utils/easeInExpo.js +6 -0
- package/subpaths/utils/easeInExpo.js.map +7 -0
- package/subpaths/utils/easeInOutCirc.d.ts +1 -0
- package/subpaths/utils/easeInOutCirc.js +6 -0
- package/subpaths/utils/easeInOutCirc.js.map +7 -0
- package/subpaths/utils/easeInOutCubic.d.ts +1 -0
- package/subpaths/utils/easeInOutCubic.js +6 -0
- package/subpaths/utils/easeInOutCubic.js.map +7 -0
- package/subpaths/utils/easeInOutExpo.d.ts +1 -0
- package/subpaths/utils/easeInOutExpo.js +6 -0
- package/subpaths/utils/easeInOutExpo.js.map +7 -0
- package/subpaths/utils/easeInOutQuad.d.ts +1 -0
- package/subpaths/utils/easeInOutQuad.js +6 -0
- package/subpaths/utils/easeInOutQuad.js.map +7 -0
- package/subpaths/utils/easeInOutQuart.d.ts +1 -0
- package/subpaths/utils/easeInOutQuart.js +6 -0
- package/subpaths/utils/easeInOutQuart.js.map +7 -0
- package/subpaths/utils/easeInOutQuint.d.ts +1 -0
- package/subpaths/utils/easeInOutQuint.js +6 -0
- package/subpaths/utils/easeInOutQuint.js.map +7 -0
- package/subpaths/utils/easeInOutSine.d.ts +1 -0
- package/subpaths/utils/easeInOutSine.js +6 -0
- package/subpaths/utils/easeInOutSine.js.map +7 -0
- package/subpaths/utils/easeInQuad.d.ts +1 -0
- package/subpaths/utils/easeInQuad.js +6 -0
- package/subpaths/utils/easeInQuad.js.map +7 -0
- package/subpaths/utils/easeInQuart.d.ts +1 -0
- package/subpaths/utils/easeInQuart.js +6 -0
- package/subpaths/utils/easeInQuart.js.map +7 -0
- package/subpaths/utils/easeInQuint.d.ts +1 -0
- package/subpaths/utils/easeInQuint.js +6 -0
- package/subpaths/utils/easeInQuint.js.map +7 -0
- package/subpaths/utils/easeInSine.d.ts +1 -0
- package/subpaths/utils/easeInSine.js +6 -0
- package/subpaths/utils/easeInSine.js.map +7 -0
- package/subpaths/utils/easeLinear.d.ts +1 -0
- package/subpaths/utils/easeLinear.js +6 -0
- package/subpaths/utils/easeLinear.js.map +7 -0
- package/subpaths/utils/easeOutCirc.d.ts +1 -0
- package/subpaths/utils/easeOutCirc.js +6 -0
- package/subpaths/utils/easeOutCirc.js.map +7 -0
- package/subpaths/utils/easeOutCubic.d.ts +1 -0
- package/subpaths/utils/easeOutCubic.js +6 -0
- package/subpaths/utils/easeOutCubic.js.map +7 -0
- package/subpaths/utils/easeOutExpo.d.ts +1 -0
- package/subpaths/utils/easeOutExpo.js +6 -0
- package/subpaths/utils/easeOutExpo.js.map +7 -0
- package/subpaths/utils/easeOutQuad.d.ts +1 -0
- package/subpaths/utils/easeOutQuad.js +6 -0
- package/subpaths/utils/easeOutQuad.js.map +7 -0
- package/subpaths/utils/easeOutQuart.d.ts +1 -0
- package/subpaths/utils/easeOutQuart.js +6 -0
- package/subpaths/utils/easeOutQuart.js.map +7 -0
- package/subpaths/utils/easeOutQuint.d.ts +1 -0
- package/subpaths/utils/easeOutQuint.js +6 -0
- package/subpaths/utils/easeOutQuint.js.map +7 -0
- package/subpaths/utils/easeOutSine.d.ts +1 -0
- package/subpaths/utils/easeOutSine.js +6 -0
- package/subpaths/utils/easeOutSine.js.map +7 -0
- package/subpaths/utils/endsWith.d.ts +1 -0
- package/subpaths/utils/endsWith.js +6 -0
- package/subpaths/utils/endsWith.js.map +7 -0
- package/subpaths/utils/fold.d.ts +1 -0
- package/subpaths/utils/fold.js +6 -0
- package/subpaths/utils/fold.js.map +7 -0
- package/subpaths/utils/getAncestorWhere.d.ts +1 -0
- package/subpaths/utils/getAncestorWhere.js +6 -0
- package/subpaths/utils/getAncestorWhere.js.map +7 -0
- package/subpaths/utils/getAncestorWhereUntil.d.ts +1 -0
- package/subpaths/utils/getAncestorWhereUntil.js +6 -0
- package/subpaths/utils/getAncestorWhereUntil.js.map +7 -0
- package/subpaths/utils/getComponentResolver.d.ts +1 -0
- package/subpaths/utils/getComponentResolver.js +6 -0
- package/subpaths/utils/getComponentResolver.js.map +7 -0
- package/subpaths/utils/getOffsetSizes.d.ts +1 -0
- package/subpaths/utils/getOffsetSizes.js +6 -0
- package/subpaths/utils/getOffsetSizes.js.map +7 -0
- package/subpaths/utils/hasWindow.d.ts +1 -0
- package/subpaths/utils/hasWindow.js +6 -0
- package/subpaths/utils/hasWindow.js.map +7 -0
- package/subpaths/utils/historyPush.d.ts +1 -0
- package/subpaths/utils/historyPush.js +6 -0
- package/subpaths/utils/historyPush.js.map +7 -0
- package/subpaths/utils/historyReplace.d.ts +1 -0
- package/subpaths/utils/historyReplace.js +6 -0
- package/subpaths/utils/historyReplace.js.map +7 -0
- package/subpaths/utils/inertiaFinalValue.d.ts +1 -0
- package/subpaths/utils/inertiaFinalValue.js +6 -0
- package/subpaths/utils/inertiaFinalValue.js.map +7 -0
- package/subpaths/utils/isArray.d.ts +1 -0
- package/subpaths/utils/isArray.js +6 -0
- package/subpaths/utils/isArray.js.map +7 -0
- package/subpaths/utils/isBoolean.d.ts +1 -0
- package/subpaths/utils/isBoolean.js +6 -0
- package/subpaths/utils/isBoolean.js.map +7 -0
- package/subpaths/utils/isDefined.d.ts +1 -0
- package/subpaths/utils/isDefined.js +6 -0
- package/subpaths/utils/isDefined.js.map +7 -0
- package/subpaths/utils/isDev.d.ts +1 -0
- package/subpaths/utils/isDev.js +6 -0
- package/subpaths/utils/isDev.js.map +7 -0
- package/subpaths/utils/isEmpty.d.ts +1 -0
- package/subpaths/utils/isEmpty.js +6 -0
- package/subpaths/utils/isEmpty.js.map +7 -0
- package/subpaths/utils/isEmptyString.d.ts +1 -0
- package/subpaths/utils/isEmptyString.js +6 -0
- package/subpaths/utils/isEmptyString.js.map +7 -0
- package/subpaths/utils/isFunction.d.ts +1 -0
- package/subpaths/utils/isFunction.js +6 -0
- package/subpaths/utils/isFunction.js.map +7 -0
- package/subpaths/utils/isNull.d.ts +1 -0
- package/subpaths/utils/isNull.js +6 -0
- package/subpaths/utils/isNull.js.map +7 -0
- package/subpaths/utils/isNumber.d.ts +1 -0
- package/subpaths/utils/isNumber.js +6 -0
- package/subpaths/utils/isNumber.js.map +7 -0
- package/subpaths/utils/isObject.d.ts +1 -0
- package/subpaths/utils/isObject.js +6 -0
- package/subpaths/utils/isObject.js.map +7 -0
- package/subpaths/utils/isString.d.ts +1 -0
- package/subpaths/utils/isString.js +6 -0
- package/subpaths/utils/isString.js.map +7 -0
- package/subpaths/utils/keyCodes.d.ts +1 -0
- package/subpaths/utils/keyCodes.js +6 -0
- package/subpaths/utils/keyCodes.js.map +7 -0
- package/subpaths/utils/lerp.d.ts +1 -0
- package/subpaths/utils/lerp.js +6 -0
- package/subpaths/utils/lerp.js.map +7 -0
- package/subpaths/utils/loadElement.d.ts +1 -0
- package/subpaths/utils/loadElement.js +6 -0
- package/subpaths/utils/loadElement.js.map +7 -0
- package/subpaths/utils/loadIframe.d.ts +1 -0
- package/subpaths/utils/loadIframe.js +6 -0
- package/subpaths/utils/loadIframe.js.map +7 -0
- package/subpaths/utils/loadImage.d.ts +1 -0
- package/subpaths/utils/loadImage.js +6 -0
- package/subpaths/utils/loadImage.js.map +7 -0
- package/subpaths/utils/loadLink.d.ts +1 -0
- package/subpaths/utils/loadLink.js +6 -0
- package/subpaths/utils/loadLink.js.map +7 -0
- package/subpaths/utils/loadScript.d.ts +1 -0
- package/subpaths/utils/loadScript.js +6 -0
- package/subpaths/utils/loadScript.js.map +7 -0
- package/subpaths/utils/localStorageProvider.d.ts +1 -0
- package/subpaths/utils/localStorageProvider.js +6 -0
- package/subpaths/utils/localStorageProvider.js.map +7 -0
- package/subpaths/utils/lowerCase.d.ts +1 -0
- package/subpaths/utils/lowerCase.js +6 -0
- package/subpaths/utils/lowerCase.js.map +7 -0
- package/subpaths/utils/map.d.ts +1 -0
- package/subpaths/utils/map.js +6 -0
- package/subpaths/utils/map.js.map +7 -0
- package/subpaths/utils/matrix.d.ts +1 -0
- package/subpaths/utils/matrix.js +6 -0
- package/subpaths/utils/matrix.js.map +7 -0
- package/subpaths/utils/mean.d.ts +1 -0
- package/subpaths/utils/mean.js +6 -0
- package/subpaths/utils/mean.js.map +7 -0
- package/subpaths/utils/memo.d.ts +1 -0
- package/subpaths/utils/memo.js +6 -0
- package/subpaths/utils/memo.js.map +7 -0
- package/subpaths/utils/memoize.d.ts +1 -0
- package/subpaths/utils/memoize.js +6 -0
- package/subpaths/utils/memoize.js.map +7 -0
- package/subpaths/utils/memoryStorageProvider.d.ts +1 -0
- package/subpaths/utils/memoryStorageProvider.js +6 -0
- package/subpaths/utils/memoryStorageProvider.js.map +7 -0
- package/subpaths/utils/nextFrame.d.ts +1 -0
- package/subpaths/utils/nextFrame.js +6 -0
- package/subpaths/utils/nextFrame.js.map +7 -0
- package/subpaths/utils/nextMicrotask.d.ts +1 -0
- package/subpaths/utils/nextMicrotask.js +6 -0
- package/subpaths/utils/nextMicrotask.js.map +7 -0
- package/subpaths/utils/nextTick.d.ts +1 -0
- package/subpaths/utils/nextTick.js +6 -0
- package/subpaths/utils/nextTick.js.map +7 -0
- package/subpaths/utils/noop.d.ts +1 -0
- package/subpaths/utils/noop.js +6 -0
- package/subpaths/utils/noop.js.map +7 -0
- package/subpaths/utils/noopValue.d.ts +1 -0
- package/subpaths/utils/noopValue.js +6 -0
- package/subpaths/utils/noopValue.js.map +7 -0
- package/subpaths/utils/objectToURLSearchParams.d.ts +1 -0
- package/subpaths/utils/objectToURLSearchParams.js +6 -0
- package/subpaths/utils/objectToURLSearchParams.js.map +7 -0
- package/subpaths/utils/pascalCase.d.ts +1 -0
- package/subpaths/utils/pascalCase.js +6 -0
- package/subpaths/utils/pascalCase.js.map +7 -0
- package/subpaths/utils/random.d.ts +1 -0
- package/subpaths/utils/random.js +6 -0
- package/subpaths/utils/random.js.map +7 -0
- package/subpaths/utils/randomInt.d.ts +1 -0
- package/subpaths/utils/randomInt.js +6 -0
- package/subpaths/utils/randomInt.js.map +7 -0
- package/subpaths/utils/randomItem.d.ts +1 -0
- package/subpaths/utils/randomItem.js +6 -0
- package/subpaths/utils/randomItem.js.map +7 -0
- package/subpaths/utils/removeClass.d.ts +1 -0
- package/subpaths/utils/removeClass.js +6 -0
- package/subpaths/utils/removeClass.js.map +7 -0
- package/subpaths/utils/removeStyle.d.ts +1 -0
- package/subpaths/utils/removeStyle.js +6 -0
- package/subpaths/utils/removeStyle.js.map +7 -0
- package/subpaths/utils/round.d.ts +1 -0
- package/subpaths/utils/round.js +6 -0
- package/subpaths/utils/round.js.map +7 -0
- package/subpaths/utils/saveActiveElement.d.ts +1 -0
- package/subpaths/utils/saveActiveElement.js +6 -0
- package/subpaths/utils/saveActiveElement.js.map +7 -0
- package/subpaths/utils/scrollTo.d.ts +1 -0
- package/subpaths/utils/scrollTo.js +6 -0
- package/subpaths/utils/scrollTo.js.map +7 -0
- package/subpaths/utils/sessionStorageProvider.d.ts +1 -0
- package/subpaths/utils/sessionStorageProvider.js +6 -0
- package/subpaths/utils/sessionStorageProvider.js.map +7 -0
- package/subpaths/utils/smoothTo.d.ts +1 -0
- package/subpaths/utils/smoothTo.js +6 -0
- package/subpaths/utils/smoothTo.js.map +7 -0
- package/subpaths/utils/snakeCase.d.ts +1 -0
- package/subpaths/utils/snakeCase.js +6 -0
- package/subpaths/utils/snakeCase.js.map +7 -0
- package/subpaths/utils/spring.d.ts +1 -0
- package/subpaths/utils/spring.js +6 -0
- package/subpaths/utils/spring.js.map +7 -0
- package/subpaths/utils/startsWith.d.ts +1 -0
- package/subpaths/utils/startsWith.js +6 -0
- package/subpaths/utils/startsWith.js.map +7 -0
- package/subpaths/utils/throttle.d.ts +1 -0
- package/subpaths/utils/throttle.js +6 -0
- package/subpaths/utils/throttle.js.map +7 -0
- package/subpaths/utils/toggleClass.d.ts +1 -0
- package/subpaths/utils/toggleClass.js +6 -0
- package/subpaths/utils/toggleClass.js.map +7 -0
- package/subpaths/utils/transform.d.ts +1 -0
- package/subpaths/utils/transform.js +6 -0
- package/subpaths/utils/transform.js.map +7 -0
- package/subpaths/utils/transition.d.ts +1 -0
- package/subpaths/utils/transition.js +6 -0
- package/subpaths/utils/transition.js.map +7 -0
- package/subpaths/utils/trapFocus.d.ts +1 -0
- package/subpaths/utils/trapFocus.js +6 -0
- package/subpaths/utils/trapFocus.js.map +7 -0
- package/subpaths/utils/tween.d.ts +1 -0
- package/subpaths/utils/tween.js +6 -0
- package/subpaths/utils/tween.js.map +7 -0
- package/subpaths/utils/untrapFocus.d.ts +1 -0
- package/subpaths/utils/untrapFocus.js +6 -0
- package/subpaths/utils/untrapFocus.js.map +7 -0
- package/subpaths/utils/upperCase.d.ts +1 -0
- package/subpaths/utils/upperCase.js +6 -0
- package/subpaths/utils/upperCase.js.map +7 -0
- package/subpaths/utils/urlSearchParamsInHashProvider.d.ts +1 -0
- package/subpaths/utils/urlSearchParamsInHashProvider.js +6 -0
- package/subpaths/utils/urlSearchParamsInHashProvider.js.map +7 -0
- package/subpaths/utils/urlSearchParamsProvider.d.ts +1 -0
- package/subpaths/utils/urlSearchParamsProvider.js +6 -0
- package/subpaths/utils/urlSearchParamsProvider.js.map +7 -0
- package/subpaths/utils/useScheduler.d.ts +1 -0
- package/subpaths/utils/useScheduler.js +6 -0
- package/subpaths/utils/useScheduler.js.map +7 -0
- package/subpaths/utils/wait.d.ts +1 -0
- package/subpaths/utils/wait.js +6 -0
- package/subpaths/utils/wait.js.map +7 -0
- package/subpaths/utils/withLeadingCharacters.d.ts +1 -0
- package/subpaths/utils/withLeadingCharacters.js +6 -0
- package/subpaths/utils/withLeadingCharacters.js.map +7 -0
- package/subpaths/utils/withLeadingSlash.d.ts +1 -0
- package/subpaths/utils/withLeadingSlash.js +6 -0
- package/subpaths/utils/withLeadingSlash.js.map +7 -0
- package/subpaths/utils/withTrailingCharacters.d.ts +1 -0
- package/subpaths/utils/withTrailingCharacters.js +6 -0
- package/subpaths/utils/withTrailingCharacters.js.map +7 -0
- package/subpaths/utils/withTrailingSlash.d.ts +1 -0
- package/subpaths/utils/withTrailingSlash.js +6 -0
- package/subpaths/utils/withTrailingSlash.js.map +7 -0
- package/subpaths/utils/withoutLeadingCharacters.d.ts +1 -0
- package/subpaths/utils/withoutLeadingCharacters.js +6 -0
- package/subpaths/utils/withoutLeadingCharacters.js.map +7 -0
- package/subpaths/utils/withoutLeadingCharactersRecursive.d.ts +1 -0
- package/subpaths/utils/withoutLeadingCharactersRecursive.js +6 -0
- package/subpaths/utils/withoutLeadingCharactersRecursive.js.map +7 -0
- package/subpaths/utils/withoutLeadingSlash.d.ts +1 -0
- package/subpaths/utils/withoutLeadingSlash.js +6 -0
- package/subpaths/utils/withoutLeadingSlash.js.map +7 -0
- package/subpaths/utils/withoutTrailingCharacters.d.ts +1 -0
- package/subpaths/utils/withoutTrailingCharacters.js +6 -0
- package/subpaths/utils/withoutTrailingCharacters.js.map +7 -0
- package/subpaths/utils/withoutTrailingCharactersRecursive.d.ts +1 -0
- package/subpaths/utils/withoutTrailingCharactersRecursive.js +6 -0
- package/subpaths/utils/withoutTrailingCharactersRecursive.js.map +7 -0
- package/subpaths/utils/withoutTrailingSlash.d.ts +1 -0
- package/subpaths/utils/withoutTrailingSlash.js +6 -0
- package/subpaths/utils/withoutTrailingSlash.js.map +7 -0
- package/subpaths/utils/wrap.d.ts +1 -0
- package/subpaths/utils/wrap.js +6 -0
- package/subpaths/utils/wrap.js.map +7 -0
- package/subpaths/version.d.ts +1 -0
- package/subpaths/version.js +6 -0
- package/subpaths/version.js.map +7 -0
- package/subpaths/withBreakpointManager.d.ts +1 -0
- package/subpaths/withBreakpointManager.js +6 -0
- package/subpaths/withBreakpointManager.js.map +7 -0
- package/subpaths/withBreakpointObserver.d.ts +1 -0
- package/subpaths/withBreakpointObserver.js +6 -0
- package/subpaths/withBreakpointObserver.js.map +7 -0
- package/subpaths/withDrag.d.ts +1 -0
- package/subpaths/withDrag.js +6 -0
- package/subpaths/withDrag.js.map +7 -0
- package/subpaths/withExtraConfig.d.ts +1 -0
- package/subpaths/withExtraConfig.js +6 -0
- package/subpaths/withExtraConfig.js.map +7 -0
- package/subpaths/withFreezedOptions.d.ts +1 -0
- package/subpaths/withFreezedOptions.js +6 -0
- package/subpaths/withFreezedOptions.js.map +7 -0
- package/subpaths/withGroup.d.ts +1 -0
- package/subpaths/withGroup.js +6 -0
- package/subpaths/withGroup.js.map +7 -0
- package/subpaths/withIntersectionObserver.d.ts +1 -0
- package/subpaths/withIntersectionObserver.js +6 -0
- package/subpaths/withIntersectionObserver.js.map +7 -0
- package/subpaths/withMountOnMediaQuery.d.ts +1 -0
- package/subpaths/withMountOnMediaQuery.js +6 -0
- package/subpaths/withMountOnMediaQuery.js.map +7 -0
- package/subpaths/withMountOnMediaQueryInterface.d.ts +1 -0
- package/subpaths/withMountOnMediaQueryInterface.js +1 -0
- package/subpaths/withMountOnMediaQueryInterface.js.map +7 -0
- package/subpaths/withMountOnMediaQueryProps.d.ts +1 -0
- package/subpaths/withMountOnMediaQueryProps.js +1 -0
- package/subpaths/withMountOnMediaQueryProps.js.map +7 -0
- package/subpaths/withMountWhenInView.d.ts +1 -0
- package/subpaths/withMountWhenInView.js +6 -0
- package/subpaths/withMountWhenInView.js.map +7 -0
- package/subpaths/withMountWhenPrefersMotion.d.ts +1 -0
- package/subpaths/withMountWhenPrefersMotion.js +6 -0
- package/subpaths/withMountWhenPrefersMotion.js.map +7 -0
- package/subpaths/withMutation.d.ts +1 -0
- package/subpaths/withMutation.js +6 -0
- package/subpaths/withMutation.js.map +7 -0
- package/subpaths/withName.d.ts +1 -0
- package/subpaths/withName.js +6 -0
- package/subpaths/withName.js.map +7 -0
- package/subpaths/withRelativePointer.d.ts +1 -0
- package/subpaths/withRelativePointer.js +6 -0
- package/subpaths/withRelativePointer.js.map +7 -0
- package/subpaths/withResponsiveOptions.d.ts +1 -0
- package/subpaths/withResponsiveOptions.js +6 -0
- package/subpaths/withResponsiveOptions.js.map +7 -0
- package/subpaths/withScrolledInView.d.ts +1 -0
- package/subpaths/withScrolledInView.js +6 -0
- package/subpaths/withScrolledInView.js.map +7 -0
- package/utils/math/ease.d.ts +14 -14
- package/utils/storage/providers.d.ts +5 -5
- package/version.d.ts +1 -0
- package/version.js +5 -0
- package/version.js.map +7 -0
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
import { registerComponent } from "../helpers/registerComponent.js";
|
|
2
|
+
const COMPONENT_SELECTOR = "[data-component]";
|
|
3
|
+
const LOAD_STRATEGIES = [
|
|
4
|
+
"eager",
|
|
5
|
+
"visible",
|
|
6
|
+
"idle",
|
|
7
|
+
"interaction"
|
|
8
|
+
];
|
|
9
|
+
const DEFAULT_DIAGNOSTIC_PREFIX = "[@studiometa/js-toolkit/autoload]";
|
|
10
|
+
const VISIBLE_ROOT_MARGIN = "200px 0px";
|
|
11
|
+
const IDLE_TIMEOUT = 2e3;
|
|
12
|
+
function isLoadStrategy(value) {
|
|
13
|
+
return LOAD_STRATEGIES.includes(value);
|
|
14
|
+
}
|
|
15
|
+
function isBaseConstructor(value) {
|
|
16
|
+
if (typeof value !== "function") {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
const Constructor = value;
|
|
20
|
+
return Constructor.$isBase === true && typeof Constructor.$register === "function";
|
|
21
|
+
}
|
|
22
|
+
function createDependencies(overrides = {}) {
|
|
23
|
+
const scope = globalThis;
|
|
24
|
+
return {
|
|
25
|
+
document,
|
|
26
|
+
MutationObserver: globalThis.MutationObserver,
|
|
27
|
+
IntersectionObserver: globalThis.IntersectionObserver,
|
|
28
|
+
requestIdleCallback: scope.requestIdleCallback?.bind(scope),
|
|
29
|
+
cancelIdleCallback: scope.cancelIdleCallback?.bind(scope),
|
|
30
|
+
setTimeout: globalThis.setTimeout.bind(globalThis),
|
|
31
|
+
clearTimeout: globalThis.clearTimeout.bind(globalThis),
|
|
32
|
+
registerComponent,
|
|
33
|
+
console,
|
|
34
|
+
CustomEvent,
|
|
35
|
+
diagnosticPrefix: DEFAULT_DIAGNOSTIC_PREFIX,
|
|
36
|
+
...overrides
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
class ComponentLoader {
|
|
40
|
+
/** @private */
|
|
41
|
+
__manifest;
|
|
42
|
+
/** @private */
|
|
43
|
+
__dependencies;
|
|
44
|
+
/** @private */
|
|
45
|
+
__root;
|
|
46
|
+
/** @private */
|
|
47
|
+
__records = /* @__PURE__ */ new Map();
|
|
48
|
+
/** @private */
|
|
49
|
+
__eagerComponents = /* @__PURE__ */ new Set();
|
|
50
|
+
/** @private */
|
|
51
|
+
__elementSchedules = /* @__PURE__ */ new WeakMap();
|
|
52
|
+
/** @private */
|
|
53
|
+
__elementCleanups = /* @__PURE__ */ new WeakMap();
|
|
54
|
+
/** @private */
|
|
55
|
+
__mutationObserver;
|
|
56
|
+
/** @private */
|
|
57
|
+
__started = false;
|
|
58
|
+
constructor({ manifest, root, dependencies }) {
|
|
59
|
+
this.__manifest = manifest;
|
|
60
|
+
this.__dependencies = createDependencies(dependencies);
|
|
61
|
+
this.__root = root ?? this.__dependencies.document;
|
|
62
|
+
}
|
|
63
|
+
start({ eagerComponents = [] } = {}) {
|
|
64
|
+
if (this.__started) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
this.__started = true;
|
|
68
|
+
const MutationObserverConstructor = this.__dependencies.MutationObserver;
|
|
69
|
+
if (MutationObserverConstructor) {
|
|
70
|
+
this.__mutationObserver = new MutationObserverConstructor((records) => {
|
|
71
|
+
for (const record of records) {
|
|
72
|
+
for (const node of record.addedNodes) {
|
|
73
|
+
if (node instanceof Element) {
|
|
74
|
+
this.__scan(node);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
for (const node of record.removedNodes) {
|
|
78
|
+
if (node instanceof Element) {
|
|
79
|
+
this.__cleanSubtree(node);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
this.__mutationObserver.observe(this.__root, {
|
|
85
|
+
childList: true,
|
|
86
|
+
subtree: true
|
|
87
|
+
});
|
|
88
|
+
} else {
|
|
89
|
+
this.__warn("MutationObserver is unavailable; added components will not be discovered.");
|
|
90
|
+
}
|
|
91
|
+
for (const token of new Set(eagerComponents)) {
|
|
92
|
+
if (!this.__getEntry(token)) {
|
|
93
|
+
this.__warn("An unknown eager component was ignored.");
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
this.__eagerComponents.add(token);
|
|
97
|
+
this.__schedule(token, "eager");
|
|
98
|
+
}
|
|
99
|
+
this.__scan(this.__root);
|
|
100
|
+
}
|
|
101
|
+
stop() {
|
|
102
|
+
this.__mutationObserver?.disconnect();
|
|
103
|
+
for (const record of this.__records.values()) {
|
|
104
|
+
this.__clean(record);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/** @private */
|
|
108
|
+
__scan(root) {
|
|
109
|
+
if (root instanceof Element && root.matches(COMPONENT_SELECTOR)) {
|
|
110
|
+
this.__discover(root);
|
|
111
|
+
}
|
|
112
|
+
for (const element of root.querySelectorAll(COMPONENT_SELECTOR)) {
|
|
113
|
+
this.__discover(element);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/** @private */
|
|
117
|
+
__discover(element) {
|
|
118
|
+
const rawTokens = element.getAttribute("data-component") ?? "";
|
|
119
|
+
const tokens = new Set(rawTokens.split(/\s+/).filter(Boolean));
|
|
120
|
+
for (const token of tokens) {
|
|
121
|
+
const entry = this.__getEntry(token);
|
|
122
|
+
if (!entry) {
|
|
123
|
+
this.__warn("An unknown component token was ignored.");
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
const strategy = this.__getStrategy(element, entry);
|
|
127
|
+
const scheduleKey = `${token}:${strategy}`;
|
|
128
|
+
const elementSchedules = this.__elementSchedules.get(element) ?? /* @__PURE__ */ new Set();
|
|
129
|
+
if (elementSchedules.has(scheduleKey)) {
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
elementSchedules.add(scheduleKey);
|
|
133
|
+
this.__elementSchedules.set(element, elementSchedules);
|
|
134
|
+
this.__schedule(token, strategy, element);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/** @private */
|
|
138
|
+
__getEntry(token) {
|
|
139
|
+
if (!Object.prototype.hasOwnProperty.call(this.__manifest, token)) {
|
|
140
|
+
return void 0;
|
|
141
|
+
}
|
|
142
|
+
return this.__manifest[token];
|
|
143
|
+
}
|
|
144
|
+
/** @private */
|
|
145
|
+
__getStrategy(element, entry) {
|
|
146
|
+
if (this.__eagerComponents.has(entry.token)) {
|
|
147
|
+
return "eager";
|
|
148
|
+
}
|
|
149
|
+
const attribute = element.getAttribute("data-load");
|
|
150
|
+
if (attribute !== null) {
|
|
151
|
+
if (isLoadStrategy(attribute)) {
|
|
152
|
+
return attribute;
|
|
153
|
+
}
|
|
154
|
+
this.__warn(`Component "${entry.token}" has an invalid data-load value; using its default.`);
|
|
155
|
+
}
|
|
156
|
+
if (isLoadStrategy(entry.strategy)) {
|
|
157
|
+
return entry.strategy;
|
|
158
|
+
}
|
|
159
|
+
this.__warn(`Component "${entry.token}" has an invalid manifest strategy; loading eagerly.`);
|
|
160
|
+
return "eager";
|
|
161
|
+
}
|
|
162
|
+
/** @private */
|
|
163
|
+
__getRecord(token) {
|
|
164
|
+
let record = this.__records.get(token);
|
|
165
|
+
if (!record) {
|
|
166
|
+
record = {
|
|
167
|
+
state: "scheduled",
|
|
168
|
+
cleanups: /* @__PURE__ */ new Set(),
|
|
169
|
+
scheduledStrategies: /* @__PURE__ */ new Set()
|
|
170
|
+
};
|
|
171
|
+
this.__records.set(token, record);
|
|
172
|
+
}
|
|
173
|
+
return record;
|
|
174
|
+
}
|
|
175
|
+
/** @private */
|
|
176
|
+
__schedule(token, strategy, element) {
|
|
177
|
+
const record = this.__getRecord(token);
|
|
178
|
+
if (record.state !== "scheduled") {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (strategy === "eager") {
|
|
182
|
+
this.__begin(token, record);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (strategy === "visible") {
|
|
186
|
+
if (!element) {
|
|
187
|
+
this.__begin(token, record);
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
const IntersectionObserverConstructor = this.__dependencies.IntersectionObserver;
|
|
191
|
+
if (!IntersectionObserverConstructor) {
|
|
192
|
+
this.__warn(`IntersectionObserver is unavailable; loading component "${token}" eagerly.`);
|
|
193
|
+
this.__begin(token, record);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const observer = new IntersectionObserverConstructor(
|
|
197
|
+
(entries) => {
|
|
198
|
+
if (entries.some((entry) => entry.isIntersecting)) {
|
|
199
|
+
this.__begin(token, record);
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
{ rootMargin: VISIBLE_ROOT_MARGIN }
|
|
203
|
+
);
|
|
204
|
+
observer.observe(element);
|
|
205
|
+
this.__addCleanup(record, () => observer.disconnect(), element);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
if (strategy === "idle") {
|
|
209
|
+
if (record.scheduledStrategies.has(strategy)) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
record.scheduledStrategies.add(strategy);
|
|
213
|
+
const requestIdleCallback = this.__dependencies.requestIdleCallback;
|
|
214
|
+
if (requestIdleCallback) {
|
|
215
|
+
const handle2 = requestIdleCallback(() => this.__begin(token, record), {
|
|
216
|
+
timeout: IDLE_TIMEOUT
|
|
217
|
+
});
|
|
218
|
+
this.__addCleanup(record, () => this.__dependencies.cancelIdleCallback?.(handle2));
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
this.__warn(`requestIdleCallback is unavailable; using a timeout for component "${token}".`);
|
|
222
|
+
const handle = this.__dependencies.setTimeout(
|
|
223
|
+
() => this.__begin(token, record),
|
|
224
|
+
IDLE_TIMEOUT
|
|
225
|
+
);
|
|
226
|
+
this.__addCleanup(record, () => this.__dependencies.clearTimeout(handle));
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
if (!element) {
|
|
230
|
+
this.__begin(token, record);
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
const listener = () => this.__begin(token, record);
|
|
234
|
+
for (const eventName of ["pointerover", "pointerdown", "focusin"]) {
|
|
235
|
+
element.addEventListener(eventName, listener, { once: true });
|
|
236
|
+
this.__addCleanup(record, () => element.removeEventListener(eventName, listener), element);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
/** @private */
|
|
240
|
+
__begin(token, record) {
|
|
241
|
+
if (record.state !== "scheduled") {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
const entry = this.__getEntry(token);
|
|
245
|
+
if (!entry) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
record.state = "loading";
|
|
249
|
+
this.__clean(record);
|
|
250
|
+
record.promise = Promise.resolve().then(() => entry.load()).then((Constructor) => {
|
|
251
|
+
if (!isBaseConstructor(Constructor)) {
|
|
252
|
+
throw new TypeError("The manifest loader did not resolve to a Base constructor.");
|
|
253
|
+
}
|
|
254
|
+
return Constructor;
|
|
255
|
+
}).catch((error) => {
|
|
256
|
+
record.state = "failed";
|
|
257
|
+
this.__reportError(token, "import", error);
|
|
258
|
+
return void 0;
|
|
259
|
+
}).then(async (Constructor) => {
|
|
260
|
+
if (!Constructor) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
try {
|
|
264
|
+
await this.__dependencies.registerComponent(Constructor, token);
|
|
265
|
+
record.Constructor = Constructor;
|
|
266
|
+
record.state = "registered";
|
|
267
|
+
await this.__registerConfiguredChildren(token, Constructor, /* @__PURE__ */ new Set([token]));
|
|
268
|
+
} catch (error) {
|
|
269
|
+
record.state = "failed";
|
|
270
|
+
this.__reportError(token, "registration", error);
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
/** @private */
|
|
275
|
+
async __registerConfiguredChildren(parentToken, ParentConstructor, visited) {
|
|
276
|
+
const configuredChildren = ParentConstructor.config.components ?? {};
|
|
277
|
+
for (const token of this.__getEntry(parentToken)?.children ?? []) {
|
|
278
|
+
if (visited.has(token)) {
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
const Constructor = configuredChildren[token];
|
|
282
|
+
if (!isBaseConstructor(Constructor)) {
|
|
283
|
+
continue;
|
|
284
|
+
}
|
|
285
|
+
visited.add(token);
|
|
286
|
+
const record = this.__getRecord(token);
|
|
287
|
+
if (record.state === "loading") {
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
290
|
+
if (record.state !== "registered") {
|
|
291
|
+
record.state = "loading";
|
|
292
|
+
this.__clean(record);
|
|
293
|
+
record.promise = this.__registerConfiguredChild(token, Constructor, record, visited);
|
|
294
|
+
await record.promise;
|
|
295
|
+
} else {
|
|
296
|
+
await this.__registerConfiguredChildren(token, record.Constructor ?? Constructor, visited);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
/** @private */
|
|
301
|
+
async __registerConfiguredChild(token, Constructor, record, visited) {
|
|
302
|
+
try {
|
|
303
|
+
await this.__dependencies.registerComponent(Constructor, token);
|
|
304
|
+
record.Constructor = Constructor;
|
|
305
|
+
record.state = "registered";
|
|
306
|
+
await this.__registerConfiguredChildren(token, Constructor, visited);
|
|
307
|
+
} catch (error) {
|
|
308
|
+
record.state = "failed";
|
|
309
|
+
this.__reportError(token, "registration", error);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
/** @private */
|
|
313
|
+
__addCleanup(record, cleanup, element) {
|
|
314
|
+
let active = true;
|
|
315
|
+
const run = () => {
|
|
316
|
+
if (!active) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
active = false;
|
|
320
|
+
cleanup();
|
|
321
|
+
record.cleanups.delete(run);
|
|
322
|
+
if (element) {
|
|
323
|
+
const elementCleanups = this.__elementCleanups.get(element);
|
|
324
|
+
elementCleanups?.delete(run);
|
|
325
|
+
if (elementCleanups?.size === 0) {
|
|
326
|
+
this.__elementCleanups.delete(element);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
record.cleanups.add(run);
|
|
331
|
+
if (element) {
|
|
332
|
+
const elementCleanups = this.__elementCleanups.get(element) ?? /* @__PURE__ */ new Set();
|
|
333
|
+
elementCleanups.add(run);
|
|
334
|
+
this.__elementCleanups.set(element, elementCleanups);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/** @private */
|
|
338
|
+
__cleanSubtree(root) {
|
|
339
|
+
for (const element of [root, ...root.querySelectorAll("*")]) {
|
|
340
|
+
if (element.isConnected) {
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
for (const cleanup of [...this.__elementCleanups.get(element) ?? []]) {
|
|
344
|
+
cleanup();
|
|
345
|
+
}
|
|
346
|
+
this.__elementSchedules.delete(element);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
/** @private */
|
|
350
|
+
__clean(record) {
|
|
351
|
+
for (const cleanup of record.cleanups) {
|
|
352
|
+
cleanup();
|
|
353
|
+
}
|
|
354
|
+
record.cleanups.clear();
|
|
355
|
+
}
|
|
356
|
+
/** @private */
|
|
357
|
+
__warn(message) {
|
|
358
|
+
this.__dependencies.console.warn(`${this.__dependencies.diagnosticPrefix} ${message}`);
|
|
359
|
+
}
|
|
360
|
+
/** @private */
|
|
361
|
+
__reportError(token, stage, error) {
|
|
362
|
+
this.__dependencies.console.error(
|
|
363
|
+
`${this.__dependencies.diagnosticPrefix} Failed during ${stage} for component "${token}".`,
|
|
364
|
+
error
|
|
365
|
+
);
|
|
366
|
+
const event = new this.__dependencies.CustomEvent("js-toolkit:error", {
|
|
367
|
+
bubbles: true,
|
|
368
|
+
detail: { token, stage, error }
|
|
369
|
+
});
|
|
370
|
+
(this.__dependencies.document.documentElement ?? this.__dependencies.document).dispatchEvent(
|
|
371
|
+
event
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
export {
|
|
376
|
+
ComponentLoader,
|
|
377
|
+
DEFAULT_DIAGNOSTIC_PREFIX,
|
|
378
|
+
IDLE_TIMEOUT,
|
|
379
|
+
VISIBLE_ROOT_MARGIN
|
|
380
|
+
};
|
|
381
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../packages/js-toolkit/autoload/loader.ts"],
|
|
4
|
+
"sourcesContent": ["import { registerComponent } from '../helpers/registerComponent.js';\nimport type { BaseConstructor } from '../Base/index.js';\nimport type { ComponentLoadStrategy, ComponentManifest, ComponentManifestEntry } from './types.js';\n\nconst COMPONENT_SELECTOR = '[data-component]';\nconst LOAD_STRATEGIES: readonly ComponentLoadStrategy[] = [\n 'eager',\n 'visible',\n 'idle',\n 'interaction',\n];\n\n/** The diagnostic prefix used when the host does not inject its own. */\nexport const DEFAULT_DIAGNOSTIC_PREFIX = '[@studiometa/js-toolkit/autoload]';\n\n/** Start loading visible components shortly before they enter the viewport. */\nexport const VISIBLE_ROOT_MARGIN = '200px 0px';\n/** Ensure idle components eventually load even when the main thread remains busy. */\nexport const IDLE_TIMEOUT = 2_000;\n\ninterface IdleDeadlineLike {\n readonly didTimeout: boolean;\n timeRemaining: () => number;\n}\n\ntype IdleHandle = number;\ntype RequestIdleCallbackLike = (\n callback: (deadline: IdleDeadlineLike) => void,\n options?: { timeout: number },\n) => IdleHandle;\ntype CancelIdleCallbackLike = (handle: IdleHandle) => void;\ntype RegisterComponent = (\n Constructor: BaseConstructor,\n token: string,\n) => Promise<unknown> | unknown;\n\ntype ComponentState = 'scheduled' | 'loading' | 'registered' | 'failed';\n\ninterface ComponentRecord {\n state: ComponentState;\n promise?: Promise<void>;\n Constructor?: BaseConstructor;\n cleanups: Set<() => void>;\n scheduledStrategies: Set<ComponentLoadStrategy>;\n}\n\nexport interface LoaderDependencies {\n document: Document;\n MutationObserver?: typeof MutationObserver;\n IntersectionObserver?: typeof IntersectionObserver;\n requestIdleCallback?: RequestIdleCallbackLike;\n cancelIdleCallback?: CancelIdleCallbackLike;\n setTimeout: typeof globalThis.setTimeout;\n clearTimeout: typeof globalThis.clearTimeout;\n registerComponent: RegisterComponent;\n console: Pick<Console, 'warn' | 'error'>;\n CustomEvent: typeof CustomEvent;\n /** The prefix prepended to every diagnostic message emitted by the loader. */\n diagnosticPrefix: string;\n}\n\nexport interface ComponentLoaderOptions {\n manifest: ComponentManifest;\n /** The DOM scope to scan and observe. Defaults to the injected `document`. */\n root?: Document | Element;\n dependencies?: Partial<LoaderDependencies>;\n}\n\nexport interface ComponentLoaderStartOptions {\n eagerComponents?: Iterable<string>;\n}\n\nfunction isLoadStrategy(value: string): value is ComponentLoadStrategy {\n return LOAD_STRATEGIES.includes(value as ComponentLoadStrategy);\n}\n\nfunction isBaseConstructor(value: unknown): value is BaseConstructor {\n if (typeof value !== 'function') {\n return false;\n }\n\n const Constructor = value as unknown as Record<string, unknown>;\n return Constructor.$isBase === true && typeof Constructor.$register === 'function';\n}\n\nfunction createDependencies(overrides: Partial<LoaderDependencies> = {}): LoaderDependencies {\n const scope = globalThis as typeof globalThis & {\n requestIdleCallback?: RequestIdleCallbackLike;\n cancelIdleCallback?: CancelIdleCallbackLike;\n };\n\n return {\n document,\n MutationObserver: globalThis.MutationObserver,\n IntersectionObserver: globalThis.IntersectionObserver,\n requestIdleCallback: scope.requestIdleCallback?.bind(scope),\n cancelIdleCallback: scope.cancelIdleCallback?.bind(scope),\n setTimeout: globalThis.setTimeout.bind(globalThis),\n clearTimeout: globalThis.clearTimeout.bind(globalThis),\n registerComponent,\n console,\n CustomEvent,\n diagnosticPrefix: DEFAULT_DIAGNOSTIC_PREFIX,\n ...overrides,\n };\n}\n\n/**\n * Discover declarative components and schedule each constructor exactly once.\n *\n * The loader is generic: it knows nothing hard-coded about any component package and works purely\n * from the manifest it is given. Importing this module has no side effects \u2014 discovery only starts\n * when {@link ComponentLoader.start} is called.\n */\nexport class ComponentLoader {\n /** @private */\n __manifest: ComponentManifest;\n /** @private */\n __dependencies: LoaderDependencies;\n /** @private */\n __root: Document | Element;\n /** @private */\n __records = new Map<string, ComponentRecord>();\n /** @private */\n __eagerComponents = new Set<string>();\n /** @private */\n __elementSchedules = new WeakMap<Element, Set<string>>();\n /** @private */\n __elementCleanups = new WeakMap<Element, Set<() => void>>();\n /** @private */\n __mutationObserver?: MutationObserver;\n /** @private */\n __started = false;\n\n constructor({ manifest, root, dependencies }: ComponentLoaderOptions) {\n this.__manifest = manifest;\n this.__dependencies = createDependencies(dependencies);\n this.__root = root ?? this.__dependencies.document;\n }\n\n start({ eagerComponents = [] }: ComponentLoaderStartOptions = {}): void {\n if (this.__started) {\n return;\n }\n this.__started = true;\n\n const MutationObserverConstructor = this.__dependencies.MutationObserver;\n if (MutationObserverConstructor) {\n this.__mutationObserver = new MutationObserverConstructor((records) => {\n for (const record of records) {\n for (const node of record.addedNodes) {\n if (node instanceof Element) {\n this.__scan(node);\n }\n }\n for (const node of record.removedNodes) {\n if (node instanceof Element) {\n this.__cleanSubtree(node);\n }\n }\n }\n });\n this.__mutationObserver.observe(this.__root, {\n childList: true,\n subtree: true,\n });\n } else {\n this.__warn('MutationObserver is unavailable; added components will not be discovered.');\n }\n\n for (const token of new Set(eagerComponents)) {\n if (!this.__getEntry(token)) {\n this.__warn('An unknown eager component was ignored.');\n continue;\n }\n this.__eagerComponents.add(token);\n this.__schedule(token, 'eager');\n }\n\n this.__scan(this.__root);\n }\n\n stop(): void {\n this.__mutationObserver?.disconnect();\n for (const record of this.__records.values()) {\n this.__clean(record);\n }\n }\n\n /** @private */\n __scan(root: Document | Element): void {\n if (root instanceof Element && root.matches(COMPONENT_SELECTOR)) {\n this.__discover(root);\n }\n\n for (const element of root.querySelectorAll(COMPONENT_SELECTOR)) {\n this.__discover(element);\n }\n }\n\n /** @private */\n __discover(element: Element): void {\n const rawTokens = element.getAttribute('data-component') ?? '';\n const tokens = new Set(rawTokens.split(/\\s+/).filter(Boolean));\n\n for (const token of tokens) {\n const entry = this.__getEntry(token);\n if (!entry) {\n this.__warn('An unknown component token was ignored.');\n continue;\n }\n\n const strategy = this.__getStrategy(element, entry);\n const scheduleKey = `${token}:${strategy}`;\n const elementSchedules = this.__elementSchedules.get(element) ?? new Set<string>();\n if (elementSchedules.has(scheduleKey)) {\n continue;\n }\n elementSchedules.add(scheduleKey);\n this.__elementSchedules.set(element, elementSchedules);\n this.__schedule(token, strategy, element);\n }\n }\n\n /** @private */\n __getEntry(token: string): ComponentManifestEntry | undefined {\n if (!Object.prototype.hasOwnProperty.call(this.__manifest, token)) {\n return undefined;\n }\n return this.__manifest[token];\n }\n\n /** @private */\n __getStrategy(element: Element, entry: ComponentManifestEntry): ComponentLoadStrategy {\n if (this.__eagerComponents.has(entry.token)) {\n return 'eager';\n }\n\n const attribute = element.getAttribute('data-load');\n if (attribute !== null) {\n if (isLoadStrategy(attribute)) {\n return attribute;\n }\n this.__warn(`Component \"${entry.token}\" has an invalid data-load value; using its default.`);\n }\n\n if (isLoadStrategy(entry.strategy)) {\n return entry.strategy;\n }\n\n this.__warn(`Component \"${entry.token}\" has an invalid manifest strategy; loading eagerly.`);\n return 'eager';\n }\n\n /** @private */\n __getRecord(token: string): ComponentRecord {\n let record = this.__records.get(token);\n if (!record) {\n record = {\n state: 'scheduled',\n cleanups: new Set(),\n scheduledStrategies: new Set(),\n };\n this.__records.set(token, record);\n }\n return record;\n }\n\n /** @private */\n __schedule(token: string, strategy: ComponentLoadStrategy, element?: Element): void {\n const record = this.__getRecord(token);\n if (record.state !== 'scheduled') {\n return;\n }\n\n if (strategy === 'eager') {\n this.__begin(token, record);\n return;\n }\n\n if (strategy === 'visible') {\n if (!element) {\n this.__begin(token, record);\n return;\n }\n const IntersectionObserverConstructor = this.__dependencies.IntersectionObserver;\n if (!IntersectionObserverConstructor) {\n this.__warn(`IntersectionObserver is unavailable; loading component \"${token}\" eagerly.`);\n this.__begin(token, record);\n return;\n }\n const observer = new IntersectionObserverConstructor(\n (entries) => {\n if (entries.some((entry) => entry.isIntersecting)) {\n this.__begin(token, record);\n }\n },\n { rootMargin: VISIBLE_ROOT_MARGIN },\n );\n observer.observe(element);\n this.__addCleanup(record, () => observer.disconnect(), element);\n return;\n }\n\n if (strategy === 'idle') {\n if (record.scheduledStrategies.has(strategy)) {\n return;\n }\n record.scheduledStrategies.add(strategy);\n const requestIdleCallback = this.__dependencies.requestIdleCallback;\n if (requestIdleCallback) {\n const handle = requestIdleCallback(() => this.__begin(token, record), {\n timeout: IDLE_TIMEOUT,\n });\n this.__addCleanup(record, () => this.__dependencies.cancelIdleCallback?.(handle));\n return;\n }\n this.__warn(`requestIdleCallback is unavailable; using a timeout for component \"${token}\".`);\n const handle = this.__dependencies.setTimeout(\n () => this.__begin(token, record),\n IDLE_TIMEOUT,\n );\n this.__addCleanup(record, () => this.__dependencies.clearTimeout(handle));\n return;\n }\n\n if (!element) {\n this.__begin(token, record);\n return;\n }\n\n const listener = () => this.__begin(token, record);\n for (const eventName of ['pointerover', 'pointerdown', 'focusin']) {\n element.addEventListener(eventName, listener, { once: true });\n this.__addCleanup(record, () => element.removeEventListener(eventName, listener), element);\n }\n }\n\n /** @private */\n __begin(token: string, record: ComponentRecord): void {\n if (record.state !== 'scheduled') {\n return;\n }\n\n const entry = this.__getEntry(token);\n if (!entry) {\n return;\n }\n\n record.state = 'loading';\n this.__clean(record);\n record.promise = Promise.resolve()\n .then(() => entry.load())\n .then((Constructor) => {\n if (!isBaseConstructor(Constructor)) {\n throw new TypeError('The manifest loader did not resolve to a Base constructor.');\n }\n return Constructor;\n })\n .catch((error: unknown) => {\n record.state = 'failed';\n this.__reportError(token, 'import', error);\n return undefined;\n })\n .then(async (Constructor) => {\n if (!Constructor) {\n return;\n }\n try {\n await this.__dependencies.registerComponent(Constructor, token);\n record.Constructor = Constructor;\n record.state = 'registered';\n await this.__registerConfiguredChildren(token, Constructor, new Set([token]));\n } catch (error: unknown) {\n record.state = 'failed';\n this.__reportError(token, 'registration', error);\n }\n });\n }\n\n /** @private */\n async __registerConfiguredChildren(\n parentToken: string,\n ParentConstructor: BaseConstructor,\n visited: Set<string>,\n ): Promise<void> {\n const configuredChildren = ParentConstructor.config.components ?? {};\n\n for (const token of this.__getEntry(parentToken)?.children ?? []) {\n if (visited.has(token)) {\n continue;\n }\n\n const Constructor = configuredChildren[token];\n if (!isBaseConstructor(Constructor)) {\n continue;\n }\n\n visited.add(token);\n const record = this.__getRecord(token);\n if (record.state === 'loading') {\n continue;\n }\n\n if (record.state !== 'registered') {\n record.state = 'loading';\n this.__clean(record);\n record.promise = this.__registerConfiguredChild(token, Constructor, record, visited);\n await record.promise;\n } else {\n await this.__registerConfiguredChildren(token, record.Constructor ?? Constructor, visited);\n }\n }\n }\n\n /** @private */\n async __registerConfiguredChild(\n token: string,\n Constructor: BaseConstructor,\n record: ComponentRecord,\n visited: Set<string>,\n ): Promise<void> {\n try {\n await this.__dependencies.registerComponent(Constructor, token);\n record.Constructor = Constructor;\n record.state = 'registered';\n await this.__registerConfiguredChildren(token, Constructor, visited);\n } catch (error: unknown) {\n record.state = 'failed';\n this.__reportError(token, 'registration', error);\n }\n }\n\n /** @private */\n __addCleanup(record: ComponentRecord, cleanup: () => void, element?: Element): void {\n let active = true;\n const run = () => {\n if (!active) {\n return;\n }\n active = false;\n cleanup();\n record.cleanups.delete(run);\n if (element) {\n const elementCleanups = this.__elementCleanups.get(element);\n elementCleanups?.delete(run);\n if (elementCleanups?.size === 0) {\n this.__elementCleanups.delete(element);\n }\n }\n };\n\n record.cleanups.add(run);\n if (element) {\n const elementCleanups = this.__elementCleanups.get(element) ?? new Set();\n elementCleanups.add(run);\n this.__elementCleanups.set(element, elementCleanups);\n }\n }\n\n /** @private */\n __cleanSubtree(root: Element): void {\n for (const element of [root, ...root.querySelectorAll('*')]) {\n if (element.isConnected) {\n continue;\n }\n for (const cleanup of [...(this.__elementCleanups.get(element) ?? [])]) {\n cleanup();\n }\n this.__elementSchedules.delete(element);\n }\n }\n\n /** @private */\n __clean(record: ComponentRecord): void {\n for (const cleanup of record.cleanups) {\n cleanup();\n }\n record.cleanups.clear();\n }\n\n /** @private */\n __warn(message: string): void {\n this.__dependencies.console.warn(`${this.__dependencies.diagnosticPrefix} ${message}`);\n }\n\n /** @private */\n __reportError(token: string, stage: 'import' | 'registration', error: unknown): void {\n this.__dependencies.console.error(\n `${this.__dependencies.diagnosticPrefix} Failed during ${stage} for component \"${token}\".`,\n error,\n );\n const event = new this.__dependencies.CustomEvent('js-toolkit:error', {\n bubbles: true,\n detail: { token, stage, error },\n });\n (this.__dependencies.document.documentElement ?? this.__dependencies.document).dispatchEvent(\n event,\n );\n }\n}\n"],
|
|
5
|
+
"m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,GAAG,KAAK,eAAe,gBAAgB,kBAAkB,KAAK,mBAAmB,KAAK;AAAA,MACtF;AAAA,IACF;AACA,UAAM,QAAQ,IAAI,KAAK,eAAe,YAAY,oBAAoB;AAAA,MACpE,SAAS;AAAA,MACT,QAAQ,EAAE,OAAO,OAAO,MAAM;AAAA,IAChC,CAAC;AACD,KAAC,KAAK,eAAe,SAAS,mBAAmB,KAAK,eAAe,UAAU;AAAA,MAC7E;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["handle"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ModuleRecord } from './define-manifest.js';
|
|
2
|
+
/**
|
|
3
|
+
* The structural shape of a webpack context function returned by
|
|
4
|
+
* `import.meta.webpackContext(dir, options)`: it is callable to resolve a module by id and exposes
|
|
5
|
+
* a `keys()` method listing every matched id. Typed structurally to avoid a webpack dependency.
|
|
6
|
+
*/
|
|
7
|
+
export interface WebpackContextLike {
|
|
8
|
+
/** List every module id the context matched. */
|
|
9
|
+
keys(): string[];
|
|
10
|
+
/** Resolve a module by its id. */
|
|
11
|
+
(id: string): unknown;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Normalize the record returned by Vite's `import.meta.glob('./x/*.ts')` into a {@link ModuleRecord}.
|
|
15
|
+
*
|
|
16
|
+
* The lazy form of `import.meta.glob` already returns `Record<string, () => Promise<Module>>`, so
|
|
17
|
+
* this is an identity pass with a guard: it throws when any value is not a function, which means the
|
|
18
|
+
* caller passed an eager glob (`import.meta.glob('...', { eager: true })`) — an unsupported shape,
|
|
19
|
+
* because eager globs resolve the modules synchronously and defeat on-demand loading.
|
|
20
|
+
*/
|
|
21
|
+
export declare function fromMetaGlob(glob: Record<string, unknown>): ModuleRecord;
|
|
22
|
+
/**
|
|
23
|
+
* Normalize a webpack context — the value returned by
|
|
24
|
+
* `import.meta.webpackContext(dir, { recursive, regExp, mode })` — into a {@link ModuleRecord}.
|
|
25
|
+
*
|
|
26
|
+
* A webpack context is a callable with a `keys()` method rather than a record of importers, so this
|
|
27
|
+
* wraps each key in `() => Promise.resolve(context(key))`. `Promise.resolve` tolerates both a
|
|
28
|
+
* synchronous module (`mode: 'sync'`) and a promise (`mode: 'lazy'`) uniformly. Use `mode: 'lazy'`
|
|
29
|
+
* for real code-splitting and on-demand loading; the other modes bundle every match eagerly.
|
|
30
|
+
*/
|
|
31
|
+
export declare function fromWebpackContext(context: WebpackContextLike): ModuleRecord;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DEFAULT_DIAGNOSTIC_PREFIX } from "./loader.js";
|
|
2
|
+
function fromMetaGlob(glob) {
|
|
3
|
+
for (const [key, value] of Object.entries(glob)) {
|
|
4
|
+
if (typeof value !== "function") {
|
|
5
|
+
throw new TypeError(
|
|
6
|
+
`${DEFAULT_DIAGNOSTIC_PREFIX} fromMetaGlob() expects a lazy glob but "${key}" is not an importer function; drop the { eager: true } option.`
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return glob;
|
|
11
|
+
}
|
|
12
|
+
function fromWebpackContext(context) {
|
|
13
|
+
return Object.fromEntries(
|
|
14
|
+
context.keys().map((key) => [key, () => Promise.resolve(context(key))])
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
fromMetaGlob,
|
|
19
|
+
fromWebpackContext
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=modules.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../packages/js-toolkit/autoload/modules.ts"],
|
|
4
|
+
"sourcesContent": ["import { DEFAULT_DIAGNOSTIC_PREFIX } from './loader.js';\nimport type { ModuleRecord } from './define-manifest.js';\n\n/**\n * The structural shape of a webpack context function returned by\n * `import.meta.webpackContext(dir, options)`: it is callable to resolve a module by id and exposes\n * a `keys()` method listing every matched id. Typed structurally to avoid a webpack dependency.\n */\nexport interface WebpackContextLike {\n /** List every module id the context matched. */\n keys(): string[];\n /** Resolve a module by its id. */\n (id: string): unknown;\n}\n\n/**\n * Normalize the record returned by Vite's `import.meta.glob('./x/*.ts')` into a {@link ModuleRecord}.\n *\n * The lazy form of `import.meta.glob` already returns `Record<string, () => Promise<Module>>`, so\n * this is an identity pass with a guard: it throws when any value is not a function, which means the\n * caller passed an eager glob (`import.meta.glob('...', { eager: true })`) \u2014 an unsupported shape,\n * because eager globs resolve the modules synchronously and defeat on-demand loading.\n */\nexport function fromMetaGlob(glob: Record<string, unknown>): ModuleRecord {\n for (const [key, value] of Object.entries(glob)) {\n if (typeof value !== 'function') {\n throw new TypeError(\n `${DEFAULT_DIAGNOSTIC_PREFIX} fromMetaGlob() expects a lazy glob but \"${key}\" is not an importer function; drop the { eager: true } option.`,\n );\n }\n }\n return glob as ModuleRecord;\n}\n\n/**\n * Normalize a webpack context \u2014 the value returned by\n * `import.meta.webpackContext(dir, { recursive, regExp, mode })` \u2014 into a {@link ModuleRecord}.\n *\n * A webpack context is a callable with a `keys()` method rather than a record of importers, so this\n * wraps each key in `() => Promise.resolve(context(key))`. `Promise.resolve` tolerates both a\n * synchronous module (`mode: 'sync'`) and a promise (`mode: 'lazy'`) uniformly. Use `mode: 'lazy'`\n * for real code-splitting and on-demand loading; the other modes bundle every match eagerly.\n */\nexport function fromWebpackContext(context: WebpackContextLike): ModuleRecord {\n return Object.fromEntries(\n context\n .keys()\n .map((key) => [key, () => Promise.resolve(context(key) as Record<string, unknown>)]),\n ) as ModuleRecord;\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iCAAiC;AAuBnC,SAAS,aAAa,MAA6C;AACxE,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,IAAI,GAAG;AAC/C,QAAI,OAAO,UAAU,YAAY;AAC/B,YAAM,IAAI;AAAA,QACR,GAAG,yBAAyB,4CAA4C,GAAG;AAAA,MAC7E;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAWO,SAAS,mBAAmB,SAA2C;AAC5E,SAAO,OAAO;AAAA,IACZ,QACG,KAAK,EACL,IAAI,CAAC,QAAQ,CAAC,KAAK,MAAM,QAAQ,QAAQ,QAAQ,GAAG,CAA4B,CAAC,CAAC;AAAA,EACvF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type AutoloadHandle } from './autoload.js';
|
|
2
|
+
import type { LoaderDependencies } from './loader.js';
|
|
3
|
+
import type { ComponentManifest } from './types.js';
|
|
4
|
+
/** The identity every copy of this package advertises on the shared global runtime. */
|
|
5
|
+
declare const PACKAGE_NAME = "@studiometa/js-toolkit";
|
|
6
|
+
/** Options accepted by {@link registerManifest}; every seam is optional and testability-oriented. */
|
|
7
|
+
export interface RegisterManifestOptions {
|
|
8
|
+
/** The document to scan and to read the eager `<meta>` from. Defaults to the global `document`. */
|
|
9
|
+
document?: Document;
|
|
10
|
+
/** The object the shared runtime is stored on. Defaults to `globalThis`. */
|
|
11
|
+
globalObject?: object;
|
|
12
|
+
/** The identity used by the duplicate/conflict guard. Defaults to this package's version. */
|
|
13
|
+
version?: string;
|
|
14
|
+
/** The DOM scope handed to the loader. Defaults to the resolved document. */
|
|
15
|
+
root?: Document | Element;
|
|
16
|
+
/** Loader dependency-injection seams, forwarded to {@link autoload}. */
|
|
17
|
+
dependencies?: Partial<LoaderDependencies>;
|
|
18
|
+
/** The logger used by the duplicate/conflict guard. Defaults to the global `console`. */
|
|
19
|
+
console?: Pick<Console, 'warn'>;
|
|
20
|
+
/** Schedules the single coalesced start. Defaults to `queueMicrotask`. */
|
|
21
|
+
scheduleMicrotask?: (callback: () => void) => void;
|
|
22
|
+
}
|
|
23
|
+
/** The shared, cross-copy runtime object stored on `globalThis` under {@link RUNTIME_KEY}. */
|
|
24
|
+
export interface AutoloadRuntime {
|
|
25
|
+
/** The owning package name, used by the conflict guard. */
|
|
26
|
+
readonly packageName: typeof PACKAGE_NAME;
|
|
27
|
+
/** The version that first claimed this runtime; conflicting versions are ignored. */
|
|
28
|
+
readonly version: string;
|
|
29
|
+
/** Every manifest registered so far, in registration order. */
|
|
30
|
+
manifests: ComponentManifest[];
|
|
31
|
+
/** The active autoload handle, present once a start has flushed. */
|
|
32
|
+
handle?: AutoloadHandle;
|
|
33
|
+
/** True while a (re)start is scheduled through a microtask but has not flushed yet. */
|
|
34
|
+
pending: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* The resolved options for the next flush. The freshest registration wins so a late import can
|
|
37
|
+
* refresh the document/root before the coalesced start runs.
|
|
38
|
+
*
|
|
39
|
+
* @private
|
|
40
|
+
*/
|
|
41
|
+
__pendingOptions?: ResolvedOptions;
|
|
42
|
+
}
|
|
43
|
+
interface ResolvedOptions {
|
|
44
|
+
documentObject: Document;
|
|
45
|
+
globalObject: object;
|
|
46
|
+
version: string;
|
|
47
|
+
root: Document | Element;
|
|
48
|
+
dependencies?: Partial<LoaderDependencies>;
|
|
49
|
+
logger: Pick<Console, 'warn'>;
|
|
50
|
+
scheduleMicrotask: (callback: () => void) => void;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Read the eager tokens declared by `<meta name="js-toolkit:eager" content="A, B, C">`.
|
|
54
|
+
*
|
|
55
|
+
* The `content` values of every matching meta (in document order) are concatenated, split on
|
|
56
|
+
* commas, trimmed, stripped of empties and deduplicated. When no such meta exists the list is
|
|
57
|
+
* empty.
|
|
58
|
+
*/
|
|
59
|
+
export declare function readEagerTokens(documentObject: Document): string[];
|
|
60
|
+
/**
|
|
61
|
+
* Register a component manifest with the shared runtime and ensure the autoloader starts.
|
|
62
|
+
*
|
|
63
|
+
* This is the shared engine behind side-effect entries that activate a manifest. It is safe to call
|
|
64
|
+
* from several entries and several bundle copies at once:
|
|
65
|
+
*
|
|
66
|
+
* - The first registration schedules a single start through a microtask. Because every ES module
|
|
67
|
+
* import in a graph evaluates before microtasks flush, importing several manifest-activating
|
|
68
|
+
* entries at the top of a module registers every manifest synchronously and results in exactly
|
|
69
|
+
* ONE {@link autoload} call over the COMPOSED set — never two loaders both scanning the DOM.
|
|
70
|
+
* - A manifest registered after the start already fired is not dropped: it triggers a fresh start
|
|
71
|
+
* over the accumulated manifests. The previous loader is stopped first, so a single loader stays
|
|
72
|
+
* active, and js-toolkit's idempotent `$register` prevents any double-mount.
|
|
73
|
+
* - A conflicting activation — a different {@link RegisterManifestOptions.version} claiming an
|
|
74
|
+
* already-owned runtime — warns and no-ops.
|
|
75
|
+
*
|
|
76
|
+
* Returns the shared runtime, or `undefined` when a conflicting version already owns it.
|
|
77
|
+
*/
|
|
78
|
+
export declare function registerManifest(manifest: ComponentManifest, options?: RegisterManifestOptions): AutoloadRuntime | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Register several manifests with the shared runtime in order, then let the single coalesced start
|
|
81
|
+
* flush over the composed set.
|
|
82
|
+
*
|
|
83
|
+
* This is the convenience wrapper an app uses to layer its own components on top of the packaged
|
|
84
|
+
* ones: `registerManifests(baseManifest, custom)`. Because {@link registerManifest} pushes each
|
|
85
|
+
* manifest onto the shared runtime in call order and the loader composes them later-wins, the LAST
|
|
86
|
+
* manifest wins on token collisions — so a custom manifest passed last can override any component
|
|
87
|
+
* that shares a token.
|
|
88
|
+
*
|
|
89
|
+
* Returns the shared runtime from the final registration, or `undefined` when a conflicting version
|
|
90
|
+
* already owns the runtime (or when no manifest was passed).
|
|
91
|
+
*/
|
|
92
|
+
export declare function registerManifests(...manifests: ComponentManifest[]): AutoloadRuntime | undefined;
|
|
93
|
+
export {};
|