@studiometa/js-toolkit 3.9.0-beta.1 → 3.9.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/dist/Base/Base.d.ts +5 -1
- package/dist/Base/Base.js +12 -13
- package/dist/Base/Base.js.map +2 -2
- package/dist/Base/managers/AbstractManager.d.ts +1 -1
- package/dist/Base/managers/AbstractManager.js.map +1 -1
- package/dist/Base/managers/ChildrenManager.d.ts +1 -1
- package/dist/Base/managers/ChildrenManager.js +1 -1
- package/dist/Base/managers/ChildrenManager.js.map +2 -2
- package/dist/Base/managers/EventsManager.d.ts +1 -1
- package/dist/Base/managers/EventsManager.js +3 -2
- package/dist/Base/managers/EventsManager.js.map +2 -2
- package/dist/Base/managers/OptionsManager.d.ts +1 -1
- package/dist/Base/managers/OptionsManager.js +2 -9
- package/dist/Base/managers/OptionsManager.js.map +2 -2
- package/dist/Base/managers/RefsManager.js +6 -9
- package/dist/Base/managers/RefsManager.js.map +2 -2
- package/dist/Base/managers/ResponsiveOptionsManager.d.ts +1 -2
- package/dist/Base/managers/ResponsiveOptionsManager.js +3 -3
- package/dist/Base/managers/ResponsiveOptionsManager.js.map +2 -2
- package/dist/Base/managers/ServicesManager.d.ts +6 -2
- package/dist/Base/managers/ServicesManager.js +7 -2
- package/dist/Base/managers/ServicesManager.js.map +2 -2
- package/dist/Base/types.d.ts +7 -3
- package/dist/Base/utils.d.ts +1 -1
- package/dist/Base/utils.js +3 -1
- package/dist/Base/utils.js.map +2 -2
- package/dist/autoload/define-manifest.js.map +1 -1
- package/dist/autoload/loader.d.ts +1 -1
- package/dist/autoload/loader.js.map +2 -2
- package/dist/autoload/types.d.ts +1 -1
- package/dist/decorators/withBreakpointManager.d.ts +1 -1
- package/dist/decorators/withBreakpointManager.js +2 -2
- package/dist/decorators/withBreakpointManager.js.map +2 -2
- package/dist/decorators/withBreakpointObserver.d.ts +1 -1
- package/dist/decorators/withBreakpointObserver.js +3 -2
- package/dist/decorators/withBreakpointObserver.js.map +2 -2
- package/dist/decorators/withDrag.d.ts +2 -2
- package/dist/decorators/withDrag.js +3 -1
- package/dist/decorators/withDrag.js.map +2 -2
- package/dist/decorators/withExtraConfig.d.ts +1 -1
- package/dist/decorators/withExtraConfig.js.map +1 -1
- package/dist/decorators/withFreezedOptions.d.ts +1 -1
- package/dist/decorators/withFreezedOptions.js.map +1 -1
- package/dist/decorators/withGroup.d.ts +1 -1
- package/dist/decorators/withGroup.js.map +1 -1
- package/dist/decorators/withIntersectionObserver.d.ts +1 -1
- package/dist/decorators/withIntersectionObserver.js +1 -1
- package/dist/decorators/withIntersectionObserver.js.map +1 -1
- package/dist/decorators/withMountOnMediaQuery.d.ts +2 -2
- package/dist/decorators/withMountOnMediaQuery.js.map +1 -1
- package/dist/decorators/withMountWhenInView.d.ts +2 -2
- package/dist/decorators/withMountWhenInView.js.map +1 -1
- package/dist/decorators/withMountWhenPrefersMotion.d.ts +1 -1
- package/dist/decorators/withMountWhenPrefersMotion.js.map +2 -2
- package/dist/decorators/withMutation.d.ts +2 -2
- package/dist/decorators/withMutation.js +3 -1
- package/dist/decorators/withMutation.js.map +2 -2
- package/dist/decorators/withName.d.ts +1 -1
- package/dist/decorators/withName.js.map +1 -1
- package/dist/decorators/withRelativePointer.d.ts +2 -2
- package/dist/decorators/withRelativePointer.js +1 -1
- package/dist/decorators/withRelativePointer.js.map +2 -2
- package/dist/decorators/withResponsiveOptions.d.ts +2 -2
- package/dist/decorators/withResponsiveOptions.js +1 -1
- package/dist/decorators/withResponsiveOptions.js.map +2 -2
- package/dist/decorators/withScrolledInView/utils.js +2 -1
- package/dist/decorators/withScrolledInView/utils.js.map +2 -2
- package/dist/decorators/withScrolledInView/withScrolledInView.d.ts +5 -3
- package/dist/decorators/withScrolledInView/withScrolledInView.js +8 -10
- package/dist/decorators/withScrolledInView/withScrolledInView.js.map +2 -2
- package/dist/helpers/createApp.d.ts +2 -2
- package/dist/helpers/createApp.js +1 -1
- package/dist/helpers/createApp.js.map +2 -2
- package/dist/helpers/defineFeatures.d.ts +1 -1
- package/dist/helpers/defineFeatures.js +1 -1
- package/dist/helpers/defineFeatures.js.map +2 -2
- package/dist/helpers/getClosestParent.d.ts +1 -1
- package/dist/helpers/getClosestParent.js +1 -1
- package/dist/helpers/getClosestParent.js.map +2 -2
- package/dist/helpers/getDirectChildren.d.ts +1 -1
- package/dist/helpers/getDirectChildren.js +1 -1
- package/dist/helpers/getDirectChildren.js.map +1 -1
- package/dist/helpers/getInstanceFromElement.d.ts +1 -1
- package/dist/helpers/getInstanceFromElement.js.map +1 -1
- package/dist/helpers/importOnInteraction.d.ts +1 -1
- package/dist/helpers/importOnInteraction.js +2 -1
- package/dist/helpers/importOnInteraction.js.map +2 -2
- package/dist/helpers/importOnMediaQuery.d.ts +1 -1
- package/dist/helpers/importOnMediaQuery.js +1 -1
- package/dist/helpers/importOnMediaQuery.js.map +1 -1
- package/dist/helpers/importWhenIdle.d.ts +1 -1
- package/dist/helpers/importWhenIdle.js +1 -1
- package/dist/helpers/importWhenIdle.js.map +1 -1
- package/dist/helpers/importWhenPrefersMotion.d.ts +1 -1
- package/dist/helpers/importWhenPrefersMotion.js.map +1 -1
- package/dist/helpers/importWhenVisible.d.ts +1 -1
- package/dist/helpers/importWhenVisible.js +1 -1
- package/dist/helpers/importWhenVisible.js.map +2 -2
- package/dist/helpers/logTree.js +1 -1
- package/dist/helpers/logTree.js.map +1 -1
- package/dist/helpers/queryComponent.d.ts +1 -1
- package/dist/helpers/queryComponent.js.map +1 -1
- package/dist/helpers/registerComponent.js +1 -1
- package/dist/helpers/registerComponent.js.map +1 -1
- package/dist/helpers/registerComponents.js +1 -1
- package/dist/helpers/registerComponents.js.map +1 -1
- package/dist/helpers/utils.js +1 -1
- package/dist/helpers/utils.js.map +2 -2
- package/dist/services/DragService.d.ts +1 -2
- package/dist/services/DragService.js +2 -2
- package/dist/services/DragService.js.map +2 -2
- package/dist/subpaths/AbstractService.d.ts +1 -1
- package/dist/subpaths/AbstractService.js +1 -1
- package/dist/subpaths/AbstractService.js.map +1 -1
- package/dist/subpaths/AutoloadHandle.d.ts +1 -1
- package/dist/subpaths/AutoloadOptions.d.ts +1 -1
- package/dist/subpaths/AutoloadRuntime.d.ts +1 -1
- package/dist/subpaths/Base.d.ts +1 -1
- package/dist/subpaths/Base.js +1 -1
- package/dist/subpaths/Base.js.map +1 -1
- package/dist/subpaths/BaseAsyncConstructor.d.ts +1 -1
- package/dist/subpaths/BaseChildren.d.ts +1 -1
- package/dist/subpaths/BaseConfig.d.ts +1 -1
- package/dist/subpaths/BaseConfigComponents.d.ts +1 -1
- package/dist/subpaths/BaseConstructor.d.ts +1 -1
- package/dist/subpaths/BaseEl.d.ts +1 -1
- package/dist/subpaths/BaseOptions.d.ts +1 -1
- package/dist/subpaths/BaseProps.d.ts +1 -1
- package/dist/subpaths/BaseRefs.d.ts +1 -1
- package/dist/subpaths/ComponentLoadStrategy.d.ts +1 -1
- package/dist/subpaths/ComponentLoader.d.ts +1 -1
- package/dist/subpaths/ComponentLoader.js +1 -1
- package/dist/subpaths/ComponentLoader.js.map +1 -1
- package/dist/subpaths/ComponentLoaderOptions.d.ts +1 -1
- package/dist/subpaths/ComponentLoaderStartOptions.d.ts +1 -1
- package/dist/subpaths/ComponentManifest.d.ts +1 -1
- package/dist/subpaths/ComponentManifestEntry.d.ts +1 -1
- package/dist/subpaths/ComponentOverride.d.ts +1 -1
- package/dist/subpaths/CreateAppOptions.d.ts +1 -1
- package/dist/subpaths/DEFAULT_DIAGNOSTIC_PREFIX.d.ts +1 -1
- package/dist/subpaths/DEFAULT_DIAGNOSTIC_PREFIX.js +1 -1
- package/dist/subpaths/DEFAULT_DIAGNOSTIC_PREFIX.js.map +1 -1
- package/dist/subpaths/DefineManifestOptions.d.ts +1 -1
- package/dist/subpaths/DragDecoratorOptions.d.ts +1 -1
- package/dist/subpaths/DragService.d.ts +1 -1
- package/dist/subpaths/DragService.js +1 -1
- package/dist/subpaths/DragService.js.map +1 -1
- package/dist/subpaths/DragServiceInterface.d.ts +1 -1
- package/dist/subpaths/DragServiceOptions.d.ts +1 -1
- package/dist/subpaths/DragServiceProps.d.ts +1 -1
- package/dist/subpaths/IDLE_TIMEOUT.d.ts +1 -1
- package/dist/subpaths/IDLE_TIMEOUT.js +1 -1
- package/dist/subpaths/IDLE_TIMEOUT.js.map +1 -1
- package/dist/subpaths/KeyService.d.ts +1 -1
- package/dist/subpaths/KeyService.js +1 -1
- package/dist/subpaths/KeyService.js.map +1 -1
- package/dist/subpaths/KeyServiceInterface.d.ts +1 -1
- package/dist/subpaths/KeyServiceProps.d.ts +1 -1
- package/dist/subpaths/LoadService.d.ts +1 -1
- package/dist/subpaths/LoadService.js +1 -1
- package/dist/subpaths/LoadService.js.map +1 -1
- package/dist/subpaths/LoadServiceInterface.d.ts +1 -1
- package/dist/subpaths/LoadServiceProps.d.ts +1 -1
- package/dist/subpaths/LoaderDependencies.d.ts +1 -1
- package/dist/subpaths/Managers.d.ts +1 -1
- package/dist/subpaths/ModuleRecord.d.ts +1 -1
- package/dist/subpaths/MutationDecoratorOptions.d.ts +1 -1
- package/dist/subpaths/MutationService.d.ts +1 -1
- package/dist/subpaths/MutationService.js +1 -1
- package/dist/subpaths/MutationService.js.map +1 -1
- package/dist/subpaths/MutationServiceInterface.d.ts +1 -1
- package/dist/subpaths/MutationServiceOptions.d.ts +1 -1
- package/dist/subpaths/MutationServiceProps.d.ts +1 -1
- package/dist/subpaths/NormalizedOffset.d.ts +1 -1
- package/dist/subpaths/OffsetValue.d.ts +1 -1
- package/dist/subpaths/PointerService.d.ts +1 -1
- package/dist/subpaths/PointerService.js +1 -1
- package/dist/subpaths/PointerService.js.map +1 -1
- package/dist/subpaths/PointerServiceInterface.d.ts +1 -1
- package/dist/subpaths/PointerServiceProps.d.ts +1 -1
- package/dist/subpaths/QueryOptions.d.ts +1 -1
- package/dist/subpaths/RafService.d.ts +1 -1
- package/dist/subpaths/RafService.js +1 -1
- package/dist/subpaths/RafService.js.map +1 -1
- package/dist/subpaths/RafServiceInterface.d.ts +1 -1
- package/dist/subpaths/RafServiceProps.d.ts +1 -1
- package/dist/subpaths/RegisterManifestOptions.d.ts +1 -1
- package/dist/subpaths/RelativePointerDecoratorOptions.d.ts +1 -1
- package/dist/subpaths/RelativePointerInterface.d.ts +1 -1
- package/dist/subpaths/ResizeService.d.ts +1 -1
- package/dist/subpaths/ResizeService.js +1 -1
- package/dist/subpaths/ResizeService.js.map +1 -1
- package/dist/subpaths/ResizeServiceInterface.d.ts +1 -1
- package/dist/subpaths/ResizeServiceProps.d.ts +1 -1
- package/dist/subpaths/ScrollInViewProps.d.ts +1 -1
- package/dist/subpaths/ScrollService.d.ts +1 -1
- package/dist/subpaths/ScrollService.js +1 -1
- package/dist/subpaths/ScrollService.js.map +1 -1
- package/dist/subpaths/ScrollServiceInterface.d.ts +1 -1
- package/dist/subpaths/ScrollServiceProps.d.ts +1 -1
- package/dist/subpaths/ServiceConfig.d.ts +1 -1
- package/dist/subpaths/ServiceInterface.d.ts +1 -1
- package/dist/subpaths/VISIBLE_ROOT_MARGIN.d.ts +1 -1
- package/dist/subpaths/VISIBLE_ROOT_MARGIN.js +1 -1
- package/dist/subpaths/VISIBLE_ROOT_MARGIN.js.map +1 -1
- package/dist/subpaths/WebpackContextLike.d.ts +1 -1
- package/dist/subpaths/WithBreakpointObserverInterface.d.ts +1 -1
- package/dist/subpaths/WithBreakpointObserverProps.d.ts +1 -1
- package/dist/subpaths/WithDragInterface.d.ts +1 -1
- package/dist/subpaths/WithFreezedOptionsInterface.d.ts +1 -1
- package/dist/subpaths/WithGroupInterface.d.ts +1 -1
- package/dist/subpaths/WithGroupOptions.d.ts +1 -1
- package/dist/subpaths/WithGroupProps.d.ts +1 -1
- package/dist/subpaths/WithIntersectionObserverInterface.d.ts +1 -1
- package/dist/subpaths/WithIntersectionObserverProps.d.ts +1 -1
- package/dist/subpaths/WithMountWhenInViewInterface.d.ts +1 -1
- package/dist/subpaths/WithMountWhenInViewProps.d.ts +1 -1
- package/dist/subpaths/WithMutationInterface.d.ts +1 -1
- package/dist/subpaths/WithScrolledInViewInterface.d.ts +1 -1
- package/dist/subpaths/WithScrolledInViewOptions.d.ts +1 -1
- package/dist/subpaths/WithScrolledInViewProps.d.ts +1 -1
- package/dist/subpaths/autoload.d.ts +1 -1
- package/dist/subpaths/autoload.js +1 -1
- package/dist/subpaths/autoload.js.map +1 -1
- package/dist/subpaths/closestComponent.d.ts +1 -1
- package/dist/subpaths/closestComponent.js +1 -1
- package/dist/subpaths/closestComponent.js.map +1 -1
- package/dist/subpaths/composeManifests.d.ts +1 -1
- package/dist/subpaths/composeManifests.js +1 -1
- package/dist/subpaths/composeManifests.js.map +1 -1
- package/dist/subpaths/createApp.d.ts +1 -1
- package/dist/subpaths/createApp.js +1 -1
- package/dist/subpaths/createApp.js.map +1 -1
- package/dist/subpaths/defineFeatures.d.ts +1 -1
- package/dist/subpaths/defineFeatures.js +1 -1
- package/dist/subpaths/defineFeatures.js.map +1 -1
- package/dist/subpaths/defineManifest.d.ts +1 -1
- package/dist/subpaths/defineManifest.js +1 -1
- package/dist/subpaths/defineManifest.js.map +1 -1
- package/dist/subpaths/fromMetaGlob.d.ts +1 -1
- package/dist/subpaths/fromMetaGlob.js +1 -1
- package/dist/subpaths/fromMetaGlob.js.map +1 -1
- package/dist/subpaths/fromWebpackContext.d.ts +1 -1
- package/dist/subpaths/fromWebpackContext.js +1 -1
- package/dist/subpaths/fromWebpackContext.js.map +1 -1
- package/dist/subpaths/getClosestParent.d.ts +1 -1
- package/dist/subpaths/getClosestParent.js +1 -1
- package/dist/subpaths/getClosestParent.js.map +1 -1
- package/dist/subpaths/getDirectChildren.d.ts +1 -1
- package/dist/subpaths/getDirectChildren.js +1 -1
- package/dist/subpaths/getDirectChildren.js.map +1 -1
- package/dist/subpaths/getInstanceFromElement.d.ts +1 -1
- package/dist/subpaths/getInstanceFromElement.js +1 -1
- package/dist/subpaths/getInstanceFromElement.js.map +1 -1
- package/dist/subpaths/getInstances.d.ts +1 -1
- package/dist/subpaths/getInstances.js +1 -1
- package/dist/subpaths/getInstances.js.map +1 -1
- package/dist/subpaths/getScopedGroups.d.ts +1 -1
- package/dist/subpaths/getScopedGroups.js +1 -1
- package/dist/subpaths/getScopedGroups.js.map +1 -1
- package/dist/subpaths/importOnInteraction.d.ts +1 -1
- package/dist/subpaths/importOnInteraction.js +1 -1
- package/dist/subpaths/importOnInteraction.js.map +1 -1
- package/dist/subpaths/importOnMediaQuery.d.ts +1 -1
- package/dist/subpaths/importOnMediaQuery.js +1 -1
- package/dist/subpaths/importOnMediaQuery.js.map +1 -1
- package/dist/subpaths/importWhenIdle.d.ts +1 -1
- package/dist/subpaths/importWhenIdle.js +1 -1
- package/dist/subpaths/importWhenIdle.js.map +1 -1
- package/dist/subpaths/importWhenPrefersMotion.d.ts +1 -1
- package/dist/subpaths/importWhenPrefersMotion.js +1 -1
- package/dist/subpaths/importWhenPrefersMotion.js.map +1 -1
- package/dist/subpaths/importWhenVisible.d.ts +1 -1
- package/dist/subpaths/importWhenVisible.js +1 -1
- package/dist/subpaths/importWhenVisible.js.map +1 -1
- package/dist/subpaths/isDirectChild.d.ts +1 -1
- package/dist/subpaths/isDirectChild.js +1 -1
- package/dist/subpaths/isDirectChild.js.map +1 -1
- package/dist/subpaths/logTree.d.ts +1 -1
- package/dist/subpaths/logTree.js +1 -1
- package/dist/subpaths/logTree.js.map +1 -1
- package/dist/subpaths/queryComponent.d.ts +1 -1
- package/dist/subpaths/queryComponent.js +1 -1
- package/dist/subpaths/queryComponent.js.map +1 -1
- package/dist/subpaths/queryComponentAll.d.ts +1 -1
- package/dist/subpaths/queryComponentAll.js +1 -1
- package/dist/subpaths/queryComponentAll.js.map +1 -1
- package/dist/subpaths/readEagerTokens.d.ts +1 -1
- package/dist/subpaths/readEagerTokens.js +1 -1
- package/dist/subpaths/readEagerTokens.js.map +1 -1
- package/dist/subpaths/registerComponent.d.ts +1 -1
- package/dist/subpaths/registerComponent.js +1 -1
- package/dist/subpaths/registerComponent.js.map +1 -1
- package/dist/subpaths/registerComponents.d.ts +1 -1
- package/dist/subpaths/registerComponents.js +1 -1
- package/dist/subpaths/registerComponents.js.map +1 -1
- package/dist/subpaths/registerManifest.d.ts +1 -1
- package/dist/subpaths/registerManifest.js +1 -1
- package/dist/subpaths/registerManifest.js.map +1 -1
- package/dist/subpaths/registerManifests.d.ts +1 -1
- package/dist/subpaths/registerManifests.js +1 -1
- package/dist/subpaths/registerManifests.js.map +1 -1
- package/dist/subpaths/useDrag.d.ts +1 -1
- package/dist/subpaths/useDrag.js +1 -1
- package/dist/subpaths/useDrag.js.map +1 -1
- package/dist/subpaths/useKey.d.ts +1 -1
- package/dist/subpaths/useKey.js +1 -1
- package/dist/subpaths/useKey.js.map +1 -1
- package/dist/subpaths/useLoad.d.ts +1 -1
- package/dist/subpaths/useLoad.js +1 -1
- package/dist/subpaths/useLoad.js.map +1 -1
- package/dist/subpaths/useMutation.d.ts +1 -1
- package/dist/subpaths/useMutation.js +1 -1
- package/dist/subpaths/useMutation.js.map +1 -1
- package/dist/subpaths/usePointer.d.ts +1 -1
- package/dist/subpaths/usePointer.js +1 -1
- package/dist/subpaths/usePointer.js.map +1 -1
- package/dist/subpaths/useRaf.d.ts +1 -1
- package/dist/subpaths/useRaf.js +1 -1
- package/dist/subpaths/useRaf.js.map +1 -1
- package/dist/subpaths/useResize.d.ts +1 -1
- package/dist/subpaths/useResize.js +1 -1
- package/dist/subpaths/useResize.js.map +1 -1
- package/dist/subpaths/useScroll.d.ts +1 -1
- package/dist/subpaths/useScroll.js +1 -1
- package/dist/subpaths/useScroll.js.map +1 -1
- package/dist/subpaths/utils/Animate.1.d.ts +1 -1
- package/dist/subpaths/utils/AnimateOptions.d.ts +1 -1
- package/dist/subpaths/utils/CSSCustomPropertyName.d.ts +1 -1
- package/dist/subpaths/utils/EasingFunction.d.ts +1 -1
- package/dist/subpaths/utils/Keyframe.d.ts +1 -1
- package/dist/subpaths/utils/NormalizedKeyframe.d.ts +1 -1
- package/dist/subpaths/utils/StorageInstance.d.ts +1 -1
- package/dist/subpaths/utils/StorageOptions.d.ts +1 -1
- package/dist/subpaths/utils/StorageProvider.d.ts +1 -1
- package/dist/subpaths/utils/StorageSerializer.d.ts +1 -1
- package/dist/subpaths/utils/TransformProps.d.ts +1 -1
- package/dist/subpaths/utils/UrlProviderOptions.d.ts +1 -1
- package/dist/subpaths/utils/addClass.d.ts +1 -1
- package/dist/subpaths/utils/addClass.js +3 -3
- package/dist/subpaths/utils/addClass.js.map +3 -3
- package/dist/subpaths/utils/addStyle.d.ts +1 -1
- package/dist/subpaths/utils/addStyle.js +3 -3
- package/dist/subpaths/utils/addStyle.js.map +3 -3
- package/dist/subpaths/utils/animate.d.ts +1 -1
- package/dist/subpaths/utils/animate.js +1 -1
- package/dist/subpaths/utils/animate.js.map +1 -1
- package/dist/subpaths/utils/boundingRectToCircle.d.ts +1 -1
- package/dist/subpaths/utils/boundingRectToCircle.js +1 -1
- package/dist/subpaths/utils/boundingRectToCircle.js.map +1 -1
- package/dist/subpaths/utils/camelCase.d.ts +1 -1
- package/dist/subpaths/utils/camelCase.js +1 -1
- package/dist/subpaths/utils/camelCase.js.map +1 -1
- package/dist/subpaths/utils/clamp.d.ts +1 -1
- package/dist/subpaths/utils/clamp.js +1 -1
- package/dist/subpaths/utils/clamp.js.map +1 -1
- package/dist/subpaths/utils/clamp01.d.ts +1 -1
- package/dist/subpaths/utils/clamp01.js +1 -1
- package/dist/subpaths/utils/clamp01.js.map +1 -1
- package/dist/subpaths/utils/collideCircleCircle.d.ts +1 -1
- package/dist/subpaths/utils/collideCircleCircle.js +1 -1
- package/dist/subpaths/utils/collideCircleCircle.js.map +1 -1
- package/dist/subpaths/utils/collideCircleRect.d.ts +1 -1
- package/dist/subpaths/utils/collideCircleRect.js +1 -1
- package/dist/subpaths/utils/collideCircleRect.js.map +1 -1
- package/dist/subpaths/utils/collidePointCircle.d.ts +1 -1
- package/dist/subpaths/utils/collidePointCircle.js +1 -1
- package/dist/subpaths/utils/collidePointCircle.js.map +1 -1
- package/dist/subpaths/utils/collidePointRect.d.ts +1 -1
- package/dist/subpaths/utils/collidePointRect.js +1 -1
- package/dist/subpaths/utils/collidePointRect.js.map +1 -1
- package/dist/subpaths/utils/collideRectRect.d.ts +1 -1
- package/dist/subpaths/utils/collideRectRect.js +1 -1
- package/dist/subpaths/utils/collideRectRect.js.map +1 -1
- package/dist/subpaths/utils/createEaseInOut.d.ts +1 -1
- package/dist/subpaths/utils/createEaseInOut.js +1 -1
- package/dist/subpaths/utils/createEaseInOut.js.map +1 -1
- package/dist/subpaths/utils/createEaseOut.d.ts +1 -1
- package/dist/subpaths/utils/createEaseOut.js +1 -1
- package/dist/subpaths/utils/createEaseOut.js.map +1 -1
- package/dist/subpaths/utils/createElement.d.ts +1 -1
- package/dist/subpaths/utils/createElement.js +1 -1
- package/dist/subpaths/utils/createElement.js.map +1 -1
- package/dist/subpaths/utils/createLocalStorage.d.ts +1 -1
- package/dist/subpaths/utils/createLocalStorage.js +1 -1
- package/dist/subpaths/utils/createLocalStorage.js.map +1 -1
- package/dist/subpaths/utils/createLocalStorageProvider.d.ts +1 -1
- package/dist/subpaths/utils/createLocalStorageProvider.js +1 -1
- package/dist/subpaths/utils/createLocalStorageProvider.js.map +1 -1
- package/dist/subpaths/utils/createMemoryStorageProvider.d.ts +1 -1
- package/dist/subpaths/utils/createMemoryStorageProvider.js +1 -1
- package/dist/subpaths/utils/createMemoryStorageProvider.js.map +1 -1
- package/dist/subpaths/utils/createNoopProvider.d.ts +1 -1
- package/dist/subpaths/utils/createNoopProvider.js +1 -1
- package/dist/subpaths/utils/createNoopProvider.js.map +1 -1
- package/dist/subpaths/utils/createRange.d.ts +1 -1
- package/dist/subpaths/utils/createRange.js +1 -1
- package/dist/subpaths/utils/createRange.js.map +1 -1
- package/dist/subpaths/utils/createSessionStorage.d.ts +1 -1
- package/dist/subpaths/utils/createSessionStorage.js +1 -1
- package/dist/subpaths/utils/createSessionStorage.js.map +1 -1
- package/dist/subpaths/utils/createSessionStorageProvider.d.ts +1 -1
- package/dist/subpaths/utils/createSessionStorageProvider.js +1 -1
- package/dist/subpaths/utils/createSessionStorageProvider.js.map +1 -1
- package/dist/subpaths/utils/createStorage.d.ts +1 -1
- package/dist/subpaths/utils/createStorage.js +1 -1
- package/dist/subpaths/utils/createStorage.js.map +1 -1
- package/dist/subpaths/utils/createUrlSearchParamsInHashProvider.d.ts +1 -1
- package/dist/subpaths/utils/createUrlSearchParamsInHashProvider.js +1 -1
- package/dist/subpaths/utils/createUrlSearchParamsInHashProvider.js.map +1 -1
- package/dist/subpaths/utils/createUrlSearchParamsInHashStorage.d.ts +1 -1
- package/dist/subpaths/utils/createUrlSearchParamsInHashStorage.js +1 -1
- package/dist/subpaths/utils/createUrlSearchParamsInHashStorage.js.map +1 -1
- package/dist/subpaths/utils/createUrlSearchParamsProvider.d.ts +1 -1
- package/dist/subpaths/utils/createUrlSearchParamsProvider.js +1 -1
- package/dist/subpaths/utils/createUrlSearchParamsProvider.js.map +1 -1
- package/dist/subpaths/utils/createUrlSearchParamsStorage.d.ts +1 -1
- package/dist/subpaths/utils/createUrlSearchParamsStorage.js +1 -1
- package/dist/subpaths/utils/createUrlSearchParamsStorage.js.map +1 -1
- package/dist/subpaths/utils/damp.d.ts +1 -1
- package/dist/subpaths/utils/damp.js +1 -1
- package/dist/subpaths/utils/damp.js.map +1 -1
- package/dist/subpaths/utils/dashCase.d.ts +1 -1
- package/dist/subpaths/utils/dashCase.js +1 -1
- package/dist/subpaths/utils/dashCase.js.map +1 -1
- package/dist/subpaths/utils/easeInCirc.d.ts +1 -1
- package/dist/subpaths/utils/easeInCirc.js +1 -1
- package/dist/subpaths/utils/easeInCirc.js.map +1 -1
- package/dist/subpaths/utils/easeInCubic.d.ts +1 -1
- package/dist/subpaths/utils/easeInCubic.js +1 -1
- package/dist/subpaths/utils/easeInCubic.js.map +1 -1
- package/dist/subpaths/utils/easeInExpo.d.ts +1 -1
- package/dist/subpaths/utils/easeInExpo.js +1 -1
- package/dist/subpaths/utils/easeInExpo.js.map +1 -1
- package/dist/subpaths/utils/easeInOutCirc.d.ts +1 -1
- package/dist/subpaths/utils/easeInOutCirc.js +1 -1
- package/dist/subpaths/utils/easeInOutCirc.js.map +1 -1
- package/dist/subpaths/utils/easeInOutCubic.d.ts +1 -1
- package/dist/subpaths/utils/easeInOutCubic.js +1 -1
- package/dist/subpaths/utils/easeInOutCubic.js.map +1 -1
- package/dist/subpaths/utils/easeInOutExpo.d.ts +1 -1
- package/dist/subpaths/utils/easeInOutExpo.js +1 -1
- package/dist/subpaths/utils/easeInOutExpo.js.map +1 -1
- package/dist/subpaths/utils/easeInOutQuad.d.ts +1 -1
- package/dist/subpaths/utils/easeInOutQuad.js +1 -1
- package/dist/subpaths/utils/easeInOutQuad.js.map +1 -1
- package/dist/subpaths/utils/easeInOutQuart.d.ts +1 -1
- package/dist/subpaths/utils/easeInOutQuart.js +1 -1
- package/dist/subpaths/utils/easeInOutQuart.js.map +1 -1
- package/dist/subpaths/utils/easeInOutQuint.d.ts +1 -1
- package/dist/subpaths/utils/easeInOutQuint.js +1 -1
- package/dist/subpaths/utils/easeInOutQuint.js.map +1 -1
- package/dist/subpaths/utils/easeInOutSine.d.ts +1 -1
- package/dist/subpaths/utils/easeInOutSine.js +1 -1
- package/dist/subpaths/utils/easeInOutSine.js.map +1 -1
- package/dist/subpaths/utils/easeInQuad.d.ts +1 -1
- package/dist/subpaths/utils/easeInQuad.js +1 -1
- package/dist/subpaths/utils/easeInQuad.js.map +1 -1
- package/dist/subpaths/utils/easeInQuart.d.ts +1 -1
- package/dist/subpaths/utils/easeInQuart.js +1 -1
- package/dist/subpaths/utils/easeInQuart.js.map +1 -1
- package/dist/subpaths/utils/easeInQuint.d.ts +1 -1
- package/dist/subpaths/utils/easeInQuint.js +1 -1
- package/dist/subpaths/utils/easeInQuint.js.map +1 -1
- package/dist/subpaths/utils/easeInSine.d.ts +1 -1
- package/dist/subpaths/utils/easeInSine.js +1 -1
- package/dist/subpaths/utils/easeInSine.js.map +1 -1
- package/dist/subpaths/utils/easeLinear.d.ts +1 -1
- package/dist/subpaths/utils/easeLinear.js +3 -3
- package/dist/subpaths/utils/easeLinear.js.map +3 -3
- package/dist/subpaths/utils/easeOutCirc.d.ts +1 -1
- package/dist/subpaths/utils/easeOutCirc.js +1 -1
- package/dist/subpaths/utils/easeOutCirc.js.map +1 -1
- package/dist/subpaths/utils/easeOutCubic.d.ts +1 -1
- package/dist/subpaths/utils/easeOutCubic.js +1 -1
- package/dist/subpaths/utils/easeOutCubic.js.map +1 -1
- package/dist/subpaths/utils/easeOutExpo.d.ts +1 -1
- package/dist/subpaths/utils/easeOutExpo.js +1 -1
- package/dist/subpaths/utils/easeOutExpo.js.map +1 -1
- package/dist/subpaths/utils/easeOutQuad.d.ts +1 -1
- package/dist/subpaths/utils/easeOutQuad.js +1 -1
- package/dist/subpaths/utils/easeOutQuad.js.map +1 -1
- package/dist/subpaths/utils/easeOutQuart.d.ts +1 -1
- package/dist/subpaths/utils/easeOutQuart.js +1 -1
- package/dist/subpaths/utils/easeOutQuart.js.map +1 -1
- package/dist/subpaths/utils/easeOutQuint.d.ts +1 -1
- package/dist/subpaths/utils/easeOutQuint.js +1 -1
- package/dist/subpaths/utils/easeOutQuint.js.map +1 -1
- package/dist/subpaths/utils/easeOutSine.d.ts +1 -1
- package/dist/subpaths/utils/easeOutSine.js +1 -1
- package/dist/subpaths/utils/easeOutSine.js.map +1 -1
- package/dist/subpaths/utils/endsWith.d.ts +1 -1
- package/dist/subpaths/utils/endsWith.js +1 -1
- package/dist/subpaths/utils/endsWith.js.map +1 -1
- package/dist/subpaths/utils/fold.d.ts +1 -1
- package/dist/subpaths/utils/fold.js +1 -1
- package/dist/subpaths/utils/fold.js.map +1 -1
- package/dist/subpaths/utils/getAncestorWhere.d.ts +1 -1
- package/dist/subpaths/utils/getAncestorWhere.js +1 -1
- package/dist/subpaths/utils/getAncestorWhere.js.map +1 -1
- package/dist/subpaths/utils/getAncestorWhereUntil.d.ts +1 -1
- package/dist/subpaths/utils/getAncestorWhereUntil.js +1 -1
- package/dist/subpaths/utils/getAncestorWhereUntil.js.map +1 -1
- package/dist/subpaths/utils/getOffsetSizes.d.ts +1 -1
- package/dist/subpaths/utils/getOffsetSizes.js +1 -1
- package/dist/subpaths/utils/getOffsetSizes.js.map +1 -1
- package/dist/subpaths/utils/inertiaFinalValue.d.ts +1 -1
- package/dist/subpaths/utils/inertiaFinalValue.js +1 -1
- package/dist/subpaths/utils/inertiaFinalValue.js.map +1 -1
- package/dist/subpaths/utils/lerp.d.ts +1 -1
- package/dist/subpaths/utils/lerp.js +1 -1
- package/dist/subpaths/utils/lerp.js.map +1 -1
- package/dist/subpaths/utils/localStorageProvider.d.ts +1 -1
- package/dist/subpaths/utils/localStorageProvider.js +1 -1
- package/dist/subpaths/utils/localStorageProvider.js.map +1 -1
- package/dist/subpaths/utils/lowerCase.d.ts +1 -1
- package/dist/subpaths/utils/lowerCase.js +1 -1
- package/dist/subpaths/utils/lowerCase.js.map +1 -1
- package/dist/subpaths/utils/map.d.ts +1 -1
- package/dist/subpaths/utils/map.js +1 -1
- package/dist/subpaths/utils/map.js.map +1 -1
- package/dist/subpaths/utils/matrix.d.ts +1 -1
- package/dist/subpaths/utils/matrix.js +1 -1
- package/dist/subpaths/utils/matrix.js.map +1 -1
- package/dist/subpaths/utils/mean.d.ts +1 -1
- package/dist/subpaths/utils/mean.js +1 -1
- package/dist/subpaths/utils/mean.js.map +1 -1
- package/dist/subpaths/utils/memoryStorageProvider.d.ts +1 -1
- package/dist/subpaths/utils/memoryStorageProvider.js +1 -1
- package/dist/subpaths/utils/memoryStorageProvider.js.map +1 -1
- package/dist/subpaths/utils/pascalCase.d.ts +1 -1
- package/dist/subpaths/utils/pascalCase.js +1 -1
- package/dist/subpaths/utils/pascalCase.js.map +1 -1
- package/dist/subpaths/utils/removeClass.d.ts +1 -1
- package/dist/subpaths/utils/removeClass.js +3 -3
- package/dist/subpaths/utils/removeClass.js.map +3 -3
- package/dist/subpaths/utils/removeStyle.d.ts +1 -1
- package/dist/subpaths/utils/removeStyle.js +3 -3
- package/dist/subpaths/utils/removeStyle.js.map +3 -3
- package/dist/subpaths/utils/round.d.ts +1 -1
- package/dist/subpaths/utils/round.js +1 -1
- package/dist/subpaths/utils/round.js.map +1 -1
- package/dist/subpaths/utils/sessionStorageProvider.d.ts +1 -1
- package/dist/subpaths/utils/sessionStorageProvider.js +1 -1
- package/dist/subpaths/utils/sessionStorageProvider.js.map +1 -1
- package/dist/subpaths/utils/smoothTo.d.ts +1 -1
- package/dist/subpaths/utils/smoothTo.js +1 -1
- package/dist/subpaths/utils/smoothTo.js.map +1 -1
- package/dist/subpaths/utils/snakeCase.d.ts +1 -1
- package/dist/subpaths/utils/snakeCase.js +1 -1
- package/dist/subpaths/utils/snakeCase.js.map +1 -1
- package/dist/subpaths/utils/spring.d.ts +1 -1
- package/dist/subpaths/utils/spring.js +1 -1
- package/dist/subpaths/utils/spring.js.map +1 -1
- package/dist/subpaths/utils/startsWith.d.ts +1 -1
- package/dist/subpaths/utils/startsWith.js +1 -1
- package/dist/subpaths/utils/startsWith.js.map +1 -1
- package/dist/subpaths/utils/toggleClass.d.ts +1 -1
- package/dist/subpaths/utils/toggleClass.js +3 -3
- package/dist/subpaths/utils/toggleClass.js.map +3 -3
- package/dist/subpaths/utils/transform.d.ts +1 -1
- package/dist/subpaths/utils/transform.js +1 -1
- package/dist/subpaths/utils/transform.js.map +1 -1
- package/dist/subpaths/utils/transition.d.ts +1 -1
- package/dist/subpaths/utils/transition.js +1 -1
- package/dist/subpaths/utils/transition.js.map +1 -1
- package/dist/subpaths/utils/upperCase.d.ts +1 -1
- package/dist/subpaths/utils/upperCase.js +1 -1
- package/dist/subpaths/utils/upperCase.js.map +1 -1
- package/dist/subpaths/utils/urlSearchParamsInHashProvider.d.ts +1 -1
- package/dist/subpaths/utils/urlSearchParamsInHashProvider.js +1 -1
- package/dist/subpaths/utils/urlSearchParamsInHashProvider.js.map +1 -1
- package/dist/subpaths/utils/urlSearchParamsProvider.d.ts +1 -1
- package/dist/subpaths/utils/urlSearchParamsProvider.js +1 -1
- package/dist/subpaths/utils/urlSearchParamsProvider.js.map +1 -1
- package/dist/subpaths/utils/withLeadingCharacters.d.ts +1 -1
- package/dist/subpaths/utils/withLeadingCharacters.js +1 -1
- package/dist/subpaths/utils/withLeadingCharacters.js.map +1 -1
- package/dist/subpaths/utils/withLeadingSlash.d.ts +1 -1
- package/dist/subpaths/utils/withLeadingSlash.js +1 -1
- package/dist/subpaths/utils/withLeadingSlash.js.map +1 -1
- package/dist/subpaths/utils/withTrailingCharacters.d.ts +1 -1
- package/dist/subpaths/utils/withTrailingCharacters.js +1 -1
- package/dist/subpaths/utils/withTrailingCharacters.js.map +1 -1
- package/dist/subpaths/utils/withTrailingSlash.d.ts +1 -1
- package/dist/subpaths/utils/withTrailingSlash.js +1 -1
- package/dist/subpaths/utils/withTrailingSlash.js.map +1 -1
- package/dist/subpaths/utils/withoutLeadingCharacters.d.ts +1 -1
- package/dist/subpaths/utils/withoutLeadingCharacters.js +1 -1
- package/dist/subpaths/utils/withoutLeadingCharacters.js.map +1 -1
- package/dist/subpaths/utils/withoutLeadingCharactersRecursive.d.ts +1 -1
- package/dist/subpaths/utils/withoutLeadingCharactersRecursive.js +1 -1
- package/dist/subpaths/utils/withoutLeadingCharactersRecursive.js.map +1 -1
- package/dist/subpaths/utils/withoutLeadingSlash.d.ts +1 -1
- package/dist/subpaths/utils/withoutLeadingSlash.js +1 -1
- package/dist/subpaths/utils/withoutLeadingSlash.js.map +1 -1
- package/dist/subpaths/utils/withoutTrailingCharacters.d.ts +1 -1
- package/dist/subpaths/utils/withoutTrailingCharacters.js +1 -1
- package/dist/subpaths/utils/withoutTrailingCharacters.js.map +1 -1
- package/dist/subpaths/utils/withoutTrailingCharactersRecursive.d.ts +1 -1
- package/dist/subpaths/utils/withoutTrailingCharactersRecursive.js +1 -1
- package/dist/subpaths/utils/withoutTrailingCharactersRecursive.js.map +1 -1
- package/dist/subpaths/utils/withoutTrailingSlash.d.ts +1 -1
- package/dist/subpaths/utils/withoutTrailingSlash.js +1 -1
- package/dist/subpaths/utils/withoutTrailingSlash.js.map +1 -1
- package/dist/subpaths/utils/wrap.d.ts +1 -1
- package/dist/subpaths/utils/wrap.js +1 -1
- package/dist/subpaths/utils/wrap.js.map +1 -1
- package/dist/subpaths/withBreakpointManager.d.ts +1 -1
- package/dist/subpaths/withBreakpointManager.js +1 -1
- package/dist/subpaths/withBreakpointManager.js.map +1 -1
- package/dist/subpaths/withBreakpointObserver.d.ts +1 -1
- package/dist/subpaths/withBreakpointObserver.js +1 -1
- package/dist/subpaths/withBreakpointObserver.js.map +1 -1
- package/dist/subpaths/withDrag.d.ts +1 -1
- package/dist/subpaths/withDrag.js +1 -1
- package/dist/subpaths/withDrag.js.map +1 -1
- package/dist/subpaths/withExtraConfig.d.ts +1 -1
- package/dist/subpaths/withExtraConfig.js +1 -1
- package/dist/subpaths/withExtraConfig.js.map +1 -1
- package/dist/subpaths/withFreezedOptions.d.ts +1 -1
- package/dist/subpaths/withFreezedOptions.js +1 -1
- package/dist/subpaths/withFreezedOptions.js.map +1 -1
- package/dist/subpaths/withGroup.d.ts +1 -1
- package/dist/subpaths/withGroup.js +1 -1
- package/dist/subpaths/withGroup.js.map +1 -1
- package/dist/subpaths/withIntersectionObserver.d.ts +1 -1
- package/dist/subpaths/withIntersectionObserver.js +1 -1
- package/dist/subpaths/withIntersectionObserver.js.map +1 -1
- package/dist/subpaths/withMountOnMediaQuery.d.ts +1 -1
- package/dist/subpaths/withMountOnMediaQuery.js +1 -1
- package/dist/subpaths/withMountOnMediaQuery.js.map +1 -1
- package/dist/subpaths/withMountOnMediaQueryInterface.d.ts +1 -1
- package/dist/subpaths/withMountOnMediaQueryProps.d.ts +1 -1
- package/dist/subpaths/withMountWhenInView.d.ts +1 -1
- package/dist/subpaths/withMountWhenInView.js +1 -1
- package/dist/subpaths/withMountWhenInView.js.map +1 -1
- package/dist/subpaths/withMountWhenPrefersMotion.d.ts +1 -1
- package/dist/subpaths/withMountWhenPrefersMotion.js +1 -1
- package/dist/subpaths/withMountWhenPrefersMotion.js.map +1 -1
- package/dist/subpaths/withMutation.d.ts +1 -1
- package/dist/subpaths/withMutation.js +1 -1
- package/dist/subpaths/withMutation.js.map +1 -1
- package/dist/subpaths/withName.d.ts +1 -1
- package/dist/subpaths/withName.js +1 -1
- package/dist/subpaths/withName.js.map +1 -1
- package/dist/subpaths/withRelativePointer.d.ts +1 -1
- package/dist/subpaths/withRelativePointer.js +1 -1
- package/dist/subpaths/withRelativePointer.js.map +1 -1
- package/dist/subpaths/withResponsiveOptions.d.ts +1 -1
- package/dist/subpaths/withResponsiveOptions.js +1 -1
- package/dist/subpaths/withResponsiveOptions.js.map +1 -1
- package/dist/subpaths/withScrolledInView.d.ts +1 -1
- package/dist/subpaths/withScrolledInView.js +1 -1
- package/dist/subpaths/withScrolledInView.js.map +1 -1
- package/dist/utils/css/animate.d.ts +2 -2
- package/dist/utils/css/animate.js +5 -3
- package/dist/utils/css/animate.js.map +2 -2
- package/dist/utils/history.js +1 -1
- package/dist/utils/history.js.map +2 -2
- package/dist/utils/scrollTo.d.ts +1 -1
- package/dist/utils/scrollTo.js +2 -2
- package/dist/utils/scrollTo.js.map +2 -2
- package/dist/utils/tween.js +7 -2
- package/dist/utils/tween.js.map +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { Base, BaseProps } from '../Base/Base.js';
|
|
1
2
|
import type { BaseDecorator, BaseInterface } from '../Base/types.js';
|
|
2
|
-
import type { Base, BaseProps } from '../Base/index.js';
|
|
3
3
|
export interface WithIntersectionObserverProps extends BaseProps {
|
|
4
4
|
$options: {
|
|
5
5
|
intersectionObserver: IntersectionObserverInit;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRange } from "../utils/
|
|
1
|
+
import { createRange } from "../utils/math/createRange.js";
|
|
2
2
|
function withIntersectionObserver(BaseClass, defaultOptions = { threshold: createRange(0, 1, 0.01) }) {
|
|
3
3
|
class WithIntersectionObserver extends BaseClass {
|
|
4
4
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../packages/js-toolkit/decorators/withIntersectionObserver.ts"],
|
|
4
|
-
"sourcesContent": ["import type {
|
|
4
|
+
"sourcesContent": ["import type { Base, BaseConfig, BaseProps } from '../Base/Base.js';\nimport type { BaseDecorator, BaseInterface } from '../Base/types.js';\nimport { createRange } from '../utils/math/createRange.js';\n\nexport interface WithIntersectionObserverProps extends BaseProps {\n $options: {\n intersectionObserver: IntersectionObserverInit;\n };\n $observer: IntersectionObserver;\n intersected(entries: IntersectionObserverEntry[]): void;\n}\n\nexport interface WithIntersectionObserverInterface extends BaseInterface {\n $observer: IntersectionObserver;\n}\n\n/**\n * IntersectionObserver decoration.\n * @link https://js-toolkit.studiometa.dev/api/decorators/withIntersectionObserver.html\n */\nexport function withIntersectionObserver<S extends Base>(\n BaseClass: typeof Base,\n // eslint-disable-next-line unicorn/no-object-as-default-parameter\n defaultOptions: IntersectionObserverInit = { threshold: createRange(0, 1, 0.01) },\n): BaseDecorator<WithIntersectionObserverInterface, S, WithIntersectionObserverProps> {\n /**\n * Class.\n */\n class WithIntersectionObserver<T extends BaseProps = BaseProps> extends BaseClass<\n T & WithIntersectionObserverProps\n > {\n /**\n * Config\n */\n static config: BaseConfig = {\n ...BaseClass.config,\n options: {\n intersectionObserver: Object,\n },\n emits: ['intersected'],\n };\n\n /**\n * Intersection observer instance.\n */\n $observer: IntersectionObserver;\n\n /**\n * Create an observer when the class in instantiated.\n */\n constructor(element: HTMLElement) {\n super(element);\n\n this.$observer = new IntersectionObserver(\n (entries) => {\n this.__callMethod('intersected', entries);\n },\n {\n ...defaultOptions,\n ...(this.$options.intersectionObserver as IntersectionObserverInit),\n },\n );\n\n this.$on('mounted', () => {\n this.$observer.observe(this.$el);\n });\n\n this.$on('destroyed', () => {\n this.$observer.unobserve(this.$el);\n });\n }\n }\n\n // @ts-ignore\n return WithIntersectionObserver;\n}\n"],
|
|
5
5
|
"mappings": "AAEA,SAAS,mBAAmB;AAkBrB,SAAS,yBACd,WAEA,iBAA2C,EAAE,WAAW,YAAY,GAAG,GAAG,IAAI,EAAE,GACI;AAAA,EAIpF,MAAM,iCAAkE,UAEtE;AAAA;AAAA;AAAA;AAAA,IAIA,OAAO,SAAqB;AAAA,MAC1B,GAAG,UAAU;AAAA,MACb,SAAS;AAAA,QACP,sBAAsB;AAAA,MACxB;AAAA,MACA,OAAO,CAAC,aAAa;AAAA,IACvB;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAY,SAAsB;AAChC,YAAM,OAAO;AAEb,WAAK,YAAY,IAAI;AAAA,QACnB,CAAC,YAAY;AACX,eAAK,aAAa,eAAe,OAAO;AAAA,QAC1C;AAAA,QACA;AAAA,UACE,GAAG;AAAA,UACH,GAAI,KAAK,SAAS;AAAA,QACpB;AAAA,MACF;AAEA,WAAK,IAAI,WAAW,MAAM;AACxB,aAAK,UAAU,QAAQ,KAAK,GAAG;AAAA,MACjC,CAAC;AAED,WAAK,IAAI,aAAa,MAAM;AAC1B,aAAK,UAAU,UAAU,KAAK,GAAG;AAAA,MACnC,CAAC;AAAA,IACH;AAAA,EACF;AAGA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import type { Base, BaseProps } from '../Base/Base.js';
|
|
2
|
+
import { BaseDecorator, BaseInterface } from '../Base/types.js';
|
|
3
3
|
export interface withMountOnMediaQueryProps extends BaseProps {
|
|
4
4
|
$options: {
|
|
5
5
|
media: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../packages/js-toolkit/decorators/withMountOnMediaQuery.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
4
|
+
"sourcesContent": ["import type { Base, BaseConfig, BaseProps } from '../Base/Base.js';\nimport { BaseDecorator, BaseInterface } from '../Base/types.js';\nimport { isDev } from '../utils/is.js';\n\nexport interface withMountOnMediaQueryProps extends BaseProps {\n $options: {\n media: string;\n };\n}\n\nexport interface withMountOnMediaQueryInterface extends BaseInterface {\n /**\n * @private\n */\n __matches: boolean;\n}\n\n/**\n * IntersectionObserver decoration.\n * @link https://js-toolkit.studiometa.dev/api/decorators/withMountOnMediaQuery.html\n */\nexport function withMountOnMediaQuery<S extends Base = Base>(\n BaseClass: typeof Base,\n media,\n): BaseDecorator<withMountOnMediaQueryInterface, S, withMountOnMediaQueryProps> {\n /**\n * Class.\n */\n class WithMountOnMediaQuery<T extends BaseProps = BaseProps> extends BaseClass<\n T & withMountOnMediaQueryProps\n > {\n /**\n * Config.\n */\n static config: BaseConfig = {\n ...BaseClass.config,\n options: {\n media: String,\n },\n };\n\n /**\n * Is the media query matches?\n *\n * @private\n */\n __matches = false;\n\n /**\n * Listen for media query changes when the class in instantiated.\n *\n * @param {HTMLElement} element The component's root element.\n */\n constructor(element: HTMLElement) {\n super(element);\n\n if (isDev && !this.$options.media && !media) {\n this.$warn(\n 'Missing either \"$options.media\" or \"media\" argument in withMountOnMediaQuery decorator.',\n );\n return;\n }\n\n const mediaQueryList = window.matchMedia(this.$options.media || media);\n\n // Set initial value\n this.__matches = mediaQueryList.matches;\n\n const changeHandler = (event: MediaQueryListEvent) => {\n this.__matches = event.matches;\n\n if (event.matches && !this.$isMounted) {\n this.$mount();\n } else if (this.$isMounted) {\n setTimeout(() => this.$destroy());\n }\n };\n\n // Start listening for changes\n mediaQueryList.addEventListener('change', changeHandler);\n\n this.$on('terminated', () => {\n mediaQueryList.removeEventListener('change', changeHandler);\n });\n }\n\n /**\n * Override the mounting of the component.\n */\n async $mount() {\n if (this.__matches) {\n return super.$mount();\n }\n\n return this;\n }\n }\n\n // @ts-ignore\n return WithMountOnMediaQuery;\n}\n"],
|
|
5
5
|
"mappings": "AAEA,SAAS,aAAa;AAmBf,SAAS,sBACd,WACA,OAC8E;AAAA,EAI9E,MAAM,8BAA+D,UAEnE;AAAA;AAAA;AAAA;AAAA,IAIA,OAAO,SAAqB;AAAA,MAC1B,GAAG,UAAU;AAAA,MACb,SAAS;AAAA,QACP,OAAO;AAAA,MACT;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOZ,YAAY,SAAsB;AAChC,YAAM,OAAO;AAEb,UAAI,SAAS,CAAC,KAAK,SAAS,SAAS,CAAC,OAAO;AAC3C,aAAK;AAAA,UACH;AAAA,QACF;AACA;AAAA,MACF;AAEA,YAAM,iBAAiB,OAAO,WAAW,KAAK,SAAS,SAAS,KAAK;AAGrE,WAAK,YAAY,eAAe;AAEhC,YAAM,gBAAgB,CAAC,UAA+B;AACpD,aAAK,YAAY,MAAM;AAEvB,YAAI,MAAM,WAAW,CAAC,KAAK,YAAY;AACrC,eAAK,OAAO;AAAA,QACd,WAAW,KAAK,YAAY;AAC1B,qBAAW,MAAM,KAAK,SAAS,CAAC;AAAA,QAClC;AAAA,MACF;AAGA,qBAAe,iBAAiB,UAAU,aAAa;AAEvD,WAAK,IAAI,cAAc,MAAM;AAC3B,uBAAe,oBAAoB,UAAU,aAAa;AAAA,MAC5D,CAAC;AAAA,IACH;AAAA;AAAA;AAAA;AAAA,IAKA,MAAM,SAAS;AACb,UAAI,KAAK,WAAW;AAClB,eAAO,MAAM,OAAO;AAAA,MACtB;AAEA,aAAO;AAAA,IACT;AAAA,EACF;AAGA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import type { Base, BaseProps } from '../Base/Base.js';
|
|
2
|
+
import { BaseDecorator, BaseInterface } from '../Base/types.js';
|
|
3
3
|
export interface WithMountWhenInViewProps extends BaseProps {
|
|
4
4
|
$options: {
|
|
5
5
|
intersectionObserver: IntersectionObserverInit;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../packages/js-toolkit/decorators/withMountWhenInView.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
4
|
+
"sourcesContent": ["import type { Base, BaseConfig, BaseProps } from '../Base/Base.js';\nimport { BaseDecorator, BaseInterface } from '../Base/types.js';\n\nexport interface WithMountWhenInViewProps extends BaseProps {\n $options: {\n intersectionObserver: IntersectionObserverInit;\n };\n}\n\nexport interface WithMountWhenInViewInterface extends BaseInterface {\n /**\n * @private\n */\n __isVisible: boolean;\n /**\n * @private\n */\n __observer: IntersectionObserver;\n}\n\n/**\n * IntersectionObserver decoration.\n * @link https://js-toolkit.studiometa.dev/api/decorators/withMountWhenInView.html\n */\nexport function withMountWhenInView<S extends Base = Base>(\n BaseClass: typeof Base,\n // eslint-disable-next-line unicorn/no-object-as-default-parameter\n defaultOptions: IntersectionObserverInit = { threshold: [0, 1] },\n): BaseDecorator<WithMountWhenInViewInterface, S, WithMountWhenInViewProps> {\n /**\n * Class.\n */\n class WithMountWhenInView<T extends BaseProps = BaseProps> extends BaseClass<\n T & WithMountWhenInViewProps\n > {\n /**\n * Config.\n */\n static config: BaseConfig = {\n ...BaseClass.config,\n options: {\n intersectionObserver: Object,\n },\n };\n\n /**\n * Is the component visible?\n *\n * @private\n */\n __isVisible = false;\n\n /**\n * The component's observer.\n *\n * @private\n */\n __observer: IntersectionObserver;\n\n /**\n * Create an observer when the class in instantiated.\n *\n * @param {HTMLElement} element The component's root element.\n */\n constructor(element: HTMLElement) {\n super(element);\n\n this.__observer = new IntersectionObserver(\n (entries) => {\n const isVisible = entries.reduce((acc, entry) => acc || entry.isIntersecting, false);\n if (this.__isVisible !== isVisible) {\n this.__isVisible = isVisible;\n\n if (isVisible) {\n this.$mount();\n } else {\n setTimeout(() => this.$destroy());\n }\n }\n },\n {\n ...defaultOptions,\n ...(this.$options as typeof this.$options & WithMountWhenInViewProps['$options'])\n .intersectionObserver,\n },\n );\n\n this.__observer.observe(this.$el);\n\n this.$on('terminated', () => {\n this.__observer.disconnect();\n });\n }\n\n /**\n * Override the mounting of the component.\n */\n async $mount() {\n if (this.__isVisible) {\n return super.$mount();\n }\n\n return this;\n }\n }\n\n // @ts-ignore\n return WithMountWhenInView;\n}\n"],
|
|
5
5
|
"mappings": "AAwBO,SAAS,oBACd,WAEA,iBAA2C,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,GACW;AAAA,EAI1E,MAAM,4BAA6D,UAEjE;AAAA;AAAA;AAAA;AAAA,IAIA,OAAO,SAAqB;AAAA,MAC1B,GAAG,UAAU;AAAA,MACb,SAAS;AAAA,QACP,sBAAsB;AAAA,MACxB;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,YAAY,SAAsB;AAChC,YAAM,OAAO;AAEb,WAAK,aAAa,IAAI;AAAA,QACpB,CAAC,YAAY;AACX,gBAAM,YAAY,QAAQ,OAAO,CAAC,KAAK,UAAU,OAAO,MAAM,gBAAgB,KAAK;AACnF,cAAI,KAAK,gBAAgB,WAAW;AAClC,iBAAK,cAAc;AAEnB,gBAAI,WAAW;AACb,mBAAK,OAAO;AAAA,YACd,OAAO;AACL,yBAAW,MAAM,KAAK,SAAS,CAAC;AAAA,YAClC;AAAA,UACF;AAAA,QACF;AAAA,QACA;AAAA,UACE,GAAG;AAAA,UACH,GAAI,KAAK,SACN;AAAA,QACL;AAAA,MACF;AAEA,WAAK,WAAW,QAAQ,KAAK,GAAG;AAEhC,WAAK,IAAI,cAAc,MAAM;AAC3B,aAAK,WAAW,WAAW;AAAA,MAC7B,CAAC;AAAA,IACH;AAAA;AAAA;AAAA;AAAA,IAKA,MAAM,SAAS;AACb,UAAI,KAAK,aAAa;AACpB,eAAO,MAAM,OAAO;AAAA,MACtB;AAEA,aAAO;AAAA,IACT;AAAA,EACF;AAGA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../packages/js-toolkit/decorators/withMountWhenPrefersMotion.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { Base } from '../Base/Base.js';\nimport { withMountOnMediaQuery } from './withMountOnMediaQuery.js';\nimport { BaseDecorator, BaseInterface } from '../Base/types.js';\n\n/**\n * @link https://js-toolkit.studiometa.dev/api/decorators/withMountWhenPrefersMotion.html\n */\nexport function withMountWhenPrefersMotion<S extends Base = Base>(\n BaseClass: typeof Base,\n): BaseDecorator<BaseInterface, S> {\n return withMountOnMediaQuery(BaseClass, 'not (prefers-reduced-motion)');\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,6BAA6B;AAM/B,SAAS,2BACd,WACiC;AACjC,SAAO,sBAAsB,WAAW,8BAA8B;AACxE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { Base } from '../Base/Base.js';
|
|
1
2
|
import type { BaseDecorator, BaseInterface } from '../Base/types.js';
|
|
2
|
-
import type
|
|
3
|
-
import type { MutationServiceOptions, MutationServiceProps } from '../services/index.js';
|
|
3
|
+
import { type MutationServiceOptions, type MutationServiceProps } from '../services/MutationService.js';
|
|
4
4
|
export type MutationDecoratorOptions = MutationServiceOptions & {
|
|
5
5
|
target?: (this: Base, instance: Base) => Node;
|
|
6
6
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../packages/js-toolkit/decorators/withMutation.ts"],
|
|
4
|
-
"sourcesContent": ["import type {
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { Base, BaseConfig, BaseProps } from '../Base/Base.js';\nimport type { BaseDecorator, BaseInterface } from '../Base/types.js';\nimport {\n type MutationServiceOptions,\n type MutationServiceProps,\n useMutation,\n} from '../services/MutationService.js';\n\nexport type MutationDecoratorOptions = MutationServiceOptions & {\n target?: (this: Base, instance: Base) => Node;\n};\n\nexport interface WithMutationInterface extends BaseInterface {\n mutated?(props: MutationServiceProps): void;\n}\n\n/**\n * Add a mutation observer to a component.\n * @link https://js-toolkit.studiometa.dev/api/decorators/withMutation.html\n */\nexport function withMutation<S extends Base>(\n BaseClass: typeof Base,\n { target = (instance) => instance.$el, ...options }: MutationDecoratorOptions = {},\n): BaseDecorator<BaseInterface, S> {\n /**\n * Class.\n */\n class WithMutation<T extends BaseProps = BaseProps> extends BaseClass<T & WithMutationInterface> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n ...BaseClass.config,\n emits: ['mutated'],\n };\n\n /**\n * Class constructor.\n */\n constructor(element: HTMLElement) {\n super(element);\n this.$on('mounted', () => {\n this.$services.register(\n 'mutated',\n useMutation.bind(undefined, target.call(this, this), options),\n );\n this.$services.enable('mutated');\n });\n\n this.$on('destroyed', () => {\n this.$services.disable('mutated');\n this.$services.unregister('mutated');\n });\n }\n }\n\n // @ts-ignore\n return WithMutation;\n}\n"],
|
|
5
|
+
"mappings": "AAEA;AAAA,EAGE;AAAA,OACK;AAcA,SAAS,aACd,WACA,EAAE,SAAS,CAAC,aAAa,SAAS,KAAK,GAAG,QAAQ,IAA8B,CAAC,GAChD;AAAA,EAIjC,MAAM,qBAAsD,UAAqC;AAAA;AAAA;AAAA;AAAA,IAI/F,OAAO,SAAqB;AAAA,MAC1B,GAAG,UAAU;AAAA,MACb,OAAO,CAAC,SAAS;AAAA,IACnB;AAAA;AAAA;AAAA;AAAA,IAKA,YAAY,SAAsB;AAChC,YAAM,OAAO;AACb,WAAK,IAAI,WAAW,MAAM;AACxB,aAAK,UAAU;AAAA,UACb;AAAA,UACA,YAAY,KAAK,QAAW,OAAO,KAAK,MAAM,IAAI,GAAG,OAAO;AAAA,QAC9D;AACA,aAAK,UAAU,OAAO,SAAS;AAAA,MACjC,CAAC;AAED,WAAK,IAAI,aAAa,MAAM;AAC1B,aAAK,UAAU,QAAQ,SAAS;AAChC,aAAK,UAAU,WAAW,SAAS;AAAA,MACrC,CAAC;AAAA,IACH;AAAA,EACF;AAGA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../packages/js-toolkit/decorators/withName.ts"],
|
|
4
|
-
"sourcesContent": ["import type {
|
|
4
|
+
"sourcesContent": ["import type { Base, BaseConfig, BaseProps } from '../Base/Base.js';\nimport type { BaseDecorator, BaseInterface } from '../Base/types.js';\n\n/**\n * Override the name of the given component.\n */\nexport function withName<S extends Base = Base>(\n BaseClass: typeof Base,\n name: string,\n): BaseDecorator<BaseInterface, S, BaseProps> {\n // @ts-ignore\n return class extends BaseClass {\n static config: BaseConfig = {\n ...BaseClass.config,\n name,\n };\n };\n}\n"],
|
|
5
5
|
"mappings": "AAMO,SAAS,SACd,WACA,MAC4C;AAE5C,SAAO,cAAc,UAAU;AAAA,IAC7B,OAAO,SAAqB;AAAA,MAC1B,GAAG,UAAU;AAAA,MACb;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { Base } from '../Base/Base.js';
|
|
1
2
|
import type { BaseDecorator, BaseInterface } from '../Base/types.js';
|
|
2
|
-
import type
|
|
3
|
-
import type { PointerServiceProps } from '../services/index.js';
|
|
3
|
+
import { type PointerServiceProps } from '../services/PointerService.js';
|
|
4
4
|
export type RelativePointerDecoratorOptions = {
|
|
5
5
|
target?: (this: Base, instance: Base) => HTMLElement;
|
|
6
6
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../packages/js-toolkit/decorators/withRelativePointer.ts"],
|
|
4
|
-
"sourcesContent": ["import type {
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { Base, BaseConfig, BaseProps } from '../Base/Base.js';\nimport type { BaseDecorator, BaseInterface } from '../Base/types.js';\nimport { type PointerServiceProps, usePointer } from '../services/PointerService.js';\n\nexport type RelativePointerDecoratorOptions = {\n target?: (this: Base, instance: Base) => HTMLElement;\n};\n\nexport interface RelativePointerInterface extends BaseInterface {\n movedrelative?(props: PointerServiceProps): void;\n}\n\n/**\n * Add dragging capabilities to a component.\n * @link https://js-toolkit.studiometa.dev/api/decorators/withRelativePointer.html\n */\nexport function withRelativePointer<S extends Base>(\n BaseClass: typeof Base,\n { target = (instance) => instance.$el }: RelativePointerDecoratorOptions = {},\n): BaseDecorator<RelativePointerInterface, S> {\n /**\n * Class.\n */\n class WithRelativePointer<T extends BaseProps = BaseProps> extends BaseClass<T> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n ...BaseClass.config,\n emits: ['movedrelative'],\n };\n\n /**\n * Class constructor.\n */\n constructor(element: HTMLElement) {\n super(element);\n\n this.$on('mounted', () => {\n this.$services.register(\n 'movedrelative',\n usePointer.bind(undefined, target.call(this, this)),\n );\n this.$services.enable('movedrelative');\n });\n\n this.$on('destroyed', () => {\n this.$services.disable('movedrelative');\n this.$services.unregister('movedrelative');\n });\n }\n }\n\n // @ts-ignore\n return WithRelativePointer;\n}\n"],
|
|
5
|
+
"mappings": "AAEA,SAAmC,kBAAkB;AAc9C,SAAS,oBACd,WACA,EAAE,SAAS,CAAC,aAAa,SAAS,IAAI,IAAqC,CAAC,GAChC;AAAA,EAI5C,MAAM,4BAA6D,UAAa;AAAA;AAAA;AAAA;AAAA,IAI9E,OAAO,SAAqB;AAAA,MAC1B,GAAG,UAAU;AAAA,MACb,OAAO,CAAC,eAAe;AAAA,IACzB;AAAA;AAAA;AAAA;AAAA,IAKA,YAAY,SAAsB;AAChC,YAAM,OAAO;AAEb,WAAK,IAAI,WAAW,MAAM;AACxB,aAAK,UAAU;AAAA,UACb;AAAA,UACA,WAAW,KAAK,QAAW,OAAO,KAAK,MAAM,IAAI,CAAC;AAAA,QACpD;AACA,aAAK,UAAU,OAAO,eAAe;AAAA,MACvC,CAAC;AAED,WAAK,IAAI,aAAa,MAAM;AAC1B,aAAK,UAAU,QAAQ,eAAe;AACtC,aAAK,UAAU,WAAW,eAAe;AAAA,MAC3C,CAAC;AAAA,IACH;AAAA,EACF;AAGA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { Base } from '../Base/Base.js';
|
|
2
|
+
import type { BaseDecorator, BaseInterface } from '../Base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Extends the configuration of an existing class.
|
|
5
5
|
* @link https://js-toolkit.studiometa.dev/api/decorators/withResponsiveOptions.html
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ResponsiveOptionsManager
|
|
3
3
|
} from "../Base/managers/ResponsiveOptionsManager.js";
|
|
4
|
-
import { isDefined, isObject } from "../utils/
|
|
4
|
+
import { isDefined, isObject } from "../utils/is.js";
|
|
5
5
|
function withResponsiveOptions(BaseClass, { responsiveOptions = [] } = {}) {
|
|
6
6
|
class WithResponsiveOptions extends BaseClass {
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../packages/js-toolkit/decorators/withResponsiveOptions.ts"],
|
|
4
|
-
"sourcesContent": ["import type {
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { Base, BaseProps, Managers } from '../Base/Base.js';\nimport {\n ResponsiveOptionObject,\n ResponsiveOptionsManager,\n} from '../Base/managers/ResponsiveOptionsManager.js';\nimport type { BaseDecorator, BaseInterface } from '../Base/types.js';\nimport { isDefined, isObject } from '../utils/is.js';\nimport type { OptionObject, OptionType } from '../Base/managers/OptionsManager.js';\n\n/**\n * Extends the configuration of an existing class.\n * @link https://js-toolkit.studiometa.dev/api/decorators/withResponsiveOptions.html\n */\nexport function withResponsiveOptions<S extends Base>(\n BaseClass: typeof Base,\n { responsiveOptions = [] } = {},\n): BaseDecorator<BaseInterface, S> {\n /**\n * Class.\n */\n class WithResponsiveOptions<T extends BaseProps = BaseProps> extends BaseClass<T> {\n /**\n * Configure responsive options.\n */\n get __config() {\n const config = super.__config;\n const options = config.options;\n\n for (const option of responsiveOptions) {\n if (isDefined(options[option])) {\n const oldOption = options[option];\n options[option] = {\n type: isObject(oldOption)\n ? (oldOption as OptionObject).type\n : (oldOption as OptionType),\n responsive: true,\n } as ResponsiveOptionObject;\n }\n }\n\n return config;\n }\n\n /**\n * Get managers.\n */\n get __managers(): Managers & { OptionsManager: typeof ResponsiveOptionsManager } {\n return {\n ...super.__managers,\n OptionsManager: ResponsiveOptionsManager,\n };\n }\n }\n\n // @ts-ignore\n return WithResponsiveOptions;\n}\n"],
|
|
5
|
+
"mappings": "AACA;AAAA,EAEE;AAAA,OACK;AAEP,SAAS,WAAW,gBAAgB;AAO7B,SAAS,sBACd,WACA,EAAE,oBAAoB,CAAC,EAAE,IAAI,CAAC,GACG;AAAA,EAIjC,MAAM,8BAA+D,UAAa;AAAA;AAAA;AAAA;AAAA,IAIhF,IAAI,WAAW;AACb,YAAM,SAAS,MAAM;AACrB,YAAM,UAAU,OAAO;AAEvB,iBAAW,UAAU,mBAAmB;AACtC,YAAI,UAAU,QAAQ,MAAM,CAAC,GAAG;AAC9B,gBAAM,YAAY,QAAQ,MAAM;AAChC,kBAAQ,MAAM,IAAI;AAAA,YAChB,MAAM,SAAS,SAAS,IACnB,UAA2B,OAC3B;AAAA,YACL,YAAY;AAAA,UACd;AAAA,QACF;AAAA,MACF;AAEA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAKA,IAAI,aAA6E;AAC/E,aAAO;AAAA,QACL,GAAG,MAAM;AAAA,QACT,gBAAgB;AAAA,MAClB;AAAA,IACF;AAAA,EACF;AAGA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../packages/js-toolkit/decorators/withScrolledInView/utils.ts"],
|
|
4
|
-
"sourcesContent": ["import { isNumber, isString
|
|
5
|
-
"mappings": "AAAA,SAAS,UAAU,
|
|
4
|
+
"sourcesContent": ["import { isNumber, isString } from '../../utils/is.js';\nimport { endsWith } from '../../utils/string/endsWith.js';\nimport type { NormalizedOffset } from './types.js';\n\nconst units = {\n px: 'px',\n vh: 'vh',\n vw: 'vw',\n vmin: 'vmin',\n vmax: 'vmax',\n percent: '%',\n};\n\nconst namedOffsets = {\n start: 0,\n center: 0.5,\n end: 1,\n};\n\n/**\n * Normalize offset input.\n */\nexport function normalizeOffset(offsets: string): NormalizedOffset {\n return offsets\n .split('/')\n .map((offset) => offset.trim().split(' ').slice(0, 2)) as NormalizedOffset;\n}\n\n/**\n * Parse the given offset.\n */\nexport function parseNamedOffset(offset: string | number): string | number {\n if (isNumber(offset)) {\n return offset;\n }\n\n if (isNumber(namedOffsets[offset])) {\n return namedOffsets[offset];\n }\n\n if (isNumber(Number(offset))) {\n return Number(offset);\n }\n\n if (isString(offset) && endsWith(offset, units.percent)) {\n return Number.parseFloat(offset) / 100;\n }\n\n return offset;\n}\n\n/**\n * Get an edge value given a start, size and offset value.\n */\nexport function getEdgeWithOffset(start: number, size: number, offset: string | number): number {\n if (isNumber(offset)) {\n return start + size * offset;\n }\n\n const parsedNamedOffset = parseNamedOffset(offset);\n if (isNumber(parsedNamedOffset)) {\n return start + size * parsedNamedOffset;\n }\n\n if (isString(parsedNamedOffset)) {\n const parsedOffset = Number.parseFloat(parsedNamedOffset);\n\n if (endsWith(parsedNamedOffset, units.px)) {\n return start + parsedOffset;\n }\n\n if (endsWith(parsedNamedOffset, units.vh)) {\n return start + (parsedOffset * window.innerHeight) / 100;\n }\n\n if (endsWith(parsedNamedOffset, units.vw)) {\n return start + (parsedOffset * window.innerWidth) / 100;\n }\n\n if (endsWith(parsedNamedOffset, units.vmin)) {\n return start + (parsedOffset * Math.min(window.innerWidth, window.innerHeight)) / 100;\n }\n\n if (endsWith(parsedNamedOffset, units.vmax)) {\n return start + (parsedOffset * Math.max(window.innerWidth, window.innerHeight)) / 100;\n }\n }\n\n return start;\n}\n\ntype HorizontalOnlyRect = {\n x: number;\n width: number;\n};\n\ntype VerticalOnlyRect = {\n y: number;\n height: number;\n};\n\ntype HorizontalRect = HorizontalOnlyRect & Partial<VerticalOnlyRect>;\ntype VerticalRect = Partial<HorizontalOnlyRect> & VerticalOnlyRect;\n\n/**\n * Get starting and ending edges for a given axis, a target sizings, a container sizings and their offset.\n */\nexport function getEdges<T extends 'x' | 'y'>(\n axis: T,\n targetSizes: T extends 'x' ? HorizontalRect : VerticalRect,\n containerSizes: T extends 'x' ? HorizontalRect : VerticalRect,\n offset: NormalizedOffset,\n): [number, number] {\n const sizeKey = axis === 'x' ? 'width' : 'height';\n const targetStart = getEdgeWithOffset(targetSizes[axis], targetSizes[sizeKey], offset[0][0]);\n const containerStart = getEdgeWithOffset(0, containerSizes[sizeKey], offset[0][1]);\n const targetEnd = getEdgeWithOffset(targetSizes[axis], targetSizes[sizeKey], offset[1][0]);\n const containerEnd = getEdgeWithOffset(0, containerSizes[sizeKey], offset[1][1]);\n const start = targetStart - containerStart;\n const end = targetEnd - containerEnd;\n\n return [start, end];\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,UAAU,gBAAgB;AACnC,SAAS,gBAAgB;AAGzB,MAAM,QAAQ;AAAA,EACZ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AACX;AAEA,MAAM,eAAe;AAAA,EACnB,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,KAAK;AACP;AAKO,SAAS,gBAAgB,SAAmC;AACjE,SAAO,QACJ,MAAM,GAAG,EACT,IAAI,CAAC,WAAW,OAAO,KAAK,EAAE,MAAM,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC;AACzD;AAKO,SAAS,iBAAiB,QAA0C;AACzE,MAAI,SAAS,MAAM,GAAG;AACpB,WAAO;AAAA,EACT;AAEA,MAAI,SAAS,aAAa,MAAM,CAAC,GAAG;AAClC,WAAO,aAAa,MAAM;AAAA,EAC5B;AAEA,MAAI,SAAS,OAAO,MAAM,CAAC,GAAG;AAC5B,WAAO,OAAO,MAAM;AAAA,EACtB;AAEA,MAAI,SAAS,MAAM,KAAK,SAAS,QAAQ,MAAM,OAAO,GAAG;AACvD,WAAO,OAAO,WAAW,MAAM,IAAI;AAAA,EACrC;AAEA,SAAO;AACT;AAKO,SAAS,kBAAkB,OAAe,MAAc,QAAiC;AAC9F,MAAI,SAAS,MAAM,GAAG;AACpB,WAAO,QAAQ,OAAO;AAAA,EACxB;AAEA,QAAM,oBAAoB,iBAAiB,MAAM;AACjD,MAAI,SAAS,iBAAiB,GAAG;AAC/B,WAAO,QAAQ,OAAO;AAAA,EACxB;AAEA,MAAI,SAAS,iBAAiB,GAAG;AAC/B,UAAM,eAAe,OAAO,WAAW,iBAAiB;AAExD,QAAI,SAAS,mBAAmB,MAAM,EAAE,GAAG;AACzC,aAAO,QAAQ;AAAA,IACjB;AAEA,QAAI,SAAS,mBAAmB,MAAM,EAAE,GAAG;AACzC,aAAO,QAAS,eAAe,OAAO,cAAe;AAAA,IACvD;AAEA,QAAI,SAAS,mBAAmB,MAAM,EAAE,GAAG;AACzC,aAAO,QAAS,eAAe,OAAO,aAAc;AAAA,IACtD;AAEA,QAAI,SAAS,mBAAmB,MAAM,IAAI,GAAG;AAC3C,aAAO,QAAS,eAAe,KAAK,IAAI,OAAO,YAAY,OAAO,WAAW,IAAK;AAAA,IACpF;AAEA,QAAI,SAAS,mBAAmB,MAAM,IAAI,GAAG;AAC3C,aAAO,QAAS,eAAe,KAAK,IAAI,OAAO,YAAY,OAAO,WAAW,IAAK;AAAA,IACpF;AAAA,EACF;AAEA,SAAO;AACT;AAkBO,SAAS,SACd,MACA,aACA,gBACA,QACkB;AAClB,QAAM,UAAU,SAAS,MAAM,UAAU;AACzC,QAAM,cAAc,kBAAkB,YAAY,IAAI,GAAG,YAAY,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC;AAC3F,QAAM,iBAAiB,kBAAkB,GAAG,eAAe,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC;AACjF,QAAM,YAAY,kBAAkB,YAAY,IAAI,GAAG,YAAY,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC;AACzF,QAAM,eAAe,kBAAkB,GAAG,eAAe,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC;AAC/E,QAAM,QAAQ,cAAc;AAC5B,QAAM,MAAM,YAAY;AAExB,SAAO,CAAC,OAAO,GAAG;AACpB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type { RafServiceProps
|
|
1
|
+
import type { Base, BaseProps } from '../../Base/Base.js';
|
|
2
|
+
import type { BaseDecorator, BaseInterface } from '../../Base/types.js';
|
|
3
|
+
import type { RafServiceProps } from '../../services/RafService.js';
|
|
4
|
+
import type { ResizeServiceProps } from '../../services/ResizeService.js';
|
|
5
|
+
import { type ScrollServiceProps } from '../../services/ScrollService.js';
|
|
4
6
|
export interface WithScrolledInViewProps extends BaseProps {
|
|
5
7
|
$options: {
|
|
6
8
|
dampFactor: number;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { useScroll } from "../../services/
|
|
1
|
+
import { useScroll } from "../../services/ScrollService.js";
|
|
2
|
+
import { getOffsetSizes } from "../../utils/css/getOffsetSizes.js";
|
|
3
|
+
import { isFunction } from "../../utils/is.js";
|
|
4
|
+
import { clamp } from "../../utils/math/clamp.js";
|
|
5
|
+
import { clamp01 } from "../../utils/math/clamp01.js";
|
|
6
|
+
import { damp } from "../../utils/math/damp.js";
|
|
7
|
+
import { domScheduler as scheduler } from "../../utils/scheduler.js";
|
|
8
|
+
import { getEdges, normalizeOffset } from "./utils.js";
|
|
2
9
|
import { withMountWhenInView } from "../withMountWhenInView.js";
|
|
3
|
-
import {
|
|
4
|
-
damp,
|
|
5
|
-
clamp,
|
|
6
|
-
clamp01,
|
|
7
|
-
getOffsetSizes,
|
|
8
|
-
isFunction,
|
|
9
|
-
domScheduler as scheduler
|
|
10
|
-
} from "../../utils/index.js";
|
|
11
|
-
import { normalizeOffset, getEdges } from "./utils.js";
|
|
12
10
|
function updateProgress(props, axis, progressKey, currentKey) {
|
|
13
11
|
props[progressKey][axis] = props.start[axis] === props.end[axis] ? 0 : clamp01(
|
|
14
12
|
(props[currentKey][axis] - props.start[axis]) / (props.end[axis] - props.start[axis])
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../packages/js-toolkit/decorators/withScrolledInView/withScrolledInView.ts"],
|
|
4
|
-
"sourcesContent": ["import type {
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { Base, BaseConfig, BaseProps } from '../../Base/Base.js';\nimport type { BaseDecorator, BaseInterface } from '../../Base/types.js';\nimport type { RafServiceProps } from '../../services/RafService.js';\nimport type { ResizeServiceProps } from '../../services/ResizeService.js';\nimport { type ScrollServiceProps, useScroll } from '../../services/ScrollService.js';\nimport { getOffsetSizes } from '../../utils/css/getOffsetSizes.js';\nimport { isFunction } from '../../utils/is.js';\nimport { clamp } from '../../utils/math/clamp.js';\nimport { clamp01 } from '../../utils/math/clamp01.js';\nimport { damp } from '../../utils/math/damp.js';\nimport { domScheduler as scheduler } from '../../utils/scheduler.js';\nimport { getEdges, normalizeOffset } from './utils.js';\nimport { withMountWhenInView } from '../withMountWhenInView.js';\n\nexport interface WithScrolledInViewProps extends BaseProps {\n $options: {\n dampFactor: number;\n dampPrecision: number;\n offset: string;\n };\n}\n\nexport type ScrollInViewProps = {\n start: {\n x: number;\n y: number;\n };\n end: {\n x: number;\n y: number;\n };\n current: {\n x: number;\n y: number;\n };\n dampedCurrent: {\n x: number;\n y: number;\n };\n progress: {\n x: number;\n y: number;\n };\n dampedProgress: {\n x: number;\n y: number;\n };\n};\n\nexport type WithScrolledInViewOptions = IntersectionObserverInit & {\n useOffsetSizes?: boolean;\n};\n\nfunction updateProgress(\n props: ScrollInViewProps,\n axis: 'x' | 'y',\n progressKey: 'progress' | 'dampedProgress',\n currentKey: 'current' | 'dampedCurrent',\n) {\n props[progressKey][axis] =\n props.start[axis] === props.end[axis]\n ? 0\n : clamp01(\n (props[currentKey][axis] - props.start[axis]) / (props.end[axis] - props.start[axis]),\n );\n}\n\n/**\n * Update props on tick.\n */\nfunction updateProps(\n props: ScrollInViewProps,\n dampFactor: number,\n dampPrecision: number,\n axis: 'x' | 'y' = 'x',\n): void {\n props.current[axis] = clamp(useScroll().props()[axis], props.start[axis], props.end[axis]);\n props.dampedCurrent[axis] = damp(\n props.current[axis],\n props.dampedCurrent[axis],\n dampFactor,\n dampPrecision,\n );\n updateProgress(props, axis, 'progress', 'current');\n updateProgress(props, axis, 'dampedProgress', 'dampedCurrent');\n}\n\nexport interface WithScrolledInViewInterface extends BaseInterface {\n /**\n * @type {ScrollInViewProps}\n */\n readonly props: ScrollInViewProps;\n dampFactor?: number;\n dampPrecision?: number;\n mounted(): void;\n resized(props: ResizeServiceProps): void;\n scrolled(props: ScrollServiceProps): void;\n ticked(props: RafServiceProps): void;\n destroyed(): void;\n}\n\n/**\n * Add scrolled in view capabilities to a component.\n * @link https://js-toolkit.studiometa.dev/api/decorators/withScrolledInView.html\n */\nexport function withScrolledInView<S extends Base = Base>(\n BaseClass: typeof Base,\n options: WithScrolledInViewOptions = {},\n): BaseDecorator<WithScrolledInViewInterface, S, WithScrolledInViewProps> {\n /**\n * Class.\n */\n class WithScrolledInView<T extends BaseProps = BaseProps> extends withMountWhenInView(\n BaseClass,\n options,\n )<T & WithScrolledInViewProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n ...BaseClass.config,\n emits: ['scrolledInView'],\n options: {\n dampFactor: {\n type: Number,\n default: 0.1,\n },\n dampPrecision: {\n type: Number,\n default: 0.001,\n },\n offset: {\n type: String,\n default: 'start end / end start',\n },\n },\n };\n\n __props: ScrollInViewProps = {\n start: {\n x: 0,\n y: 0,\n },\n end: {\n x: 0,\n y: 0,\n },\n current: {\n x: 0,\n y: 0,\n },\n dampedCurrent: {\n x: 0,\n y: 0,\n },\n progress: {\n x: 0,\n y: 0,\n },\n dampedProgress: {\n x: 0,\n y: 0,\n },\n };\n\n shouldEvaluateProps = true;\n\n get props() {\n if (this.shouldEvaluateProps) {\n this.shouldEvaluateProps = false;\n const targetSizes = options.useOffsetSizes\n ? getOffsetSizes(this.$el)\n : this.$el.getBoundingClientRect();\n\n targetSizes.y += window.scrollY;\n targetSizes.x += window.scrollX;\n\n const containerSizes = {\n x: 0,\n y: 0,\n height: window.innerHeight,\n width: window.innerWidth,\n };\n\n const offset = normalizeOffset(this.$options.offset);\n\n // Y axis\n const [yStart, yEnd] = getEdges('y', targetSizes, containerSizes, offset);\n const yCurrent = clamp(window.scrollY, yStart, yEnd);\n const yProgress = yStart === yEnd ? 0 : clamp01((yCurrent - yStart) / (yEnd - yStart));\n // X axis\n const [xStart, xEnd] = getEdges('x', targetSizes, containerSizes, offset);\n const xCurrent = clamp(window.scrollX, xStart, xEnd);\n const xProgress = xStart === xEnd ? 0 : clamp01((xCurrent - xStart) / (xEnd - xStart));\n\n this.__props.start.x = xStart;\n this.__props.start.y = yStart;\n this.__props.end.x = xEnd;\n this.__props.end.y = yEnd;\n this.__props.current.x = xCurrent;\n this.__props.current.y = yCurrent;\n this.__props.dampedCurrent.x = xCurrent;\n this.__props.dampedCurrent.y = yCurrent;\n this.__props.progress.x = xProgress;\n this.__props.progress.y = yProgress;\n this.__props.dampedProgress.x = xProgress;\n this.__props.dampedProgress.y = yProgress;\n }\n\n return this.__props;\n }\n\n /**\n * Bind listeners.\n */\n constructor(element: HTMLElement) {\n super(element);\n\n const render = () => {\n scheduler.read(() => {\n // @ts-ignore\n const renderFn = this.__callMethod('scrolledInView', this.props);\n if (isFunction(renderFn)) {\n scheduler.write(() => {\n renderFn(this.__props);\n });\n }\n });\n };\n\n const delegate = {\n handleEvent(event: CustomEvent) {\n delegate[event.type](event.detail[0]);\n },\n resized: () => {\n this.shouldEvaluateProps = true;\n render();\n },\n scrolled: (props: ScrollServiceProps) => {\n if (props.changed.y || props.changed.x) {\n this.$services.enable('ticked');\n }\n },\n mounted: () => render(),\n ticked: () => {\n const { dampFactor, dampPrecision } = this.$options;\n updateProps(this.__props, dampFactor, dampPrecision, 'x');\n updateProps(this.__props, dampFactor, dampPrecision, 'y');\n\n if (\n this.__props.dampedCurrent.x === this.__props.current.x &&\n this.__props.dampedCurrent.y === this.__props.current.y\n ) {\n this.$services.disable('ticked');\n }\n\n render();\n },\n };\n\n this.$on('before-mounted', () => {\n this.$on('mounted', delegate);\n this.$on('resized', delegate);\n this.$on('scrolled', delegate);\n this.$on('ticked', delegate);\n });\n\n this.$on('destroyed', () => {\n this.$off('mounted', delegate);\n this.$off('resized', delegate);\n this.$off('scrolled', delegate);\n this.$off('ticked', delegate);\n\n // Clamp damped values to their final value and trigger one last render on destroy\n this.__props.dampedCurrent.x = this.__props.current.x;\n this.__props.dampedCurrent.y = this.__props.current.y;\n this.__props.dampedProgress.x = this.__props.progress.x;\n this.__props.dampedProgress.y = this.__props.progress.y;\n render();\n });\n }\n }\n\n // @ts-ignore\n return WithScrolledInView;\n}\n"],
|
|
5
|
+
"mappings": "AAIA,SAAkC,iBAAiB;AACnD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAC3B,SAAS,aAAa;AACtB,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,gBAAgB,iBAAiB;AAC1C,SAAS,UAAU,uBAAuB;AAC1C,SAAS,2BAA2B;AAyCpC,SAAS,eACP,OACA,MACA,aACA,YACA;AACA,QAAM,WAAW,EAAE,IAAI,IACrB,MAAM,MAAM,IAAI,MAAM,MAAM,IAAI,IAAI,IAChC,IACA;AAAA,KACG,MAAM,UAAU,EAAE,IAAI,IAAI,MAAM,MAAM,IAAI,MAAM,MAAM,IAAI,IAAI,IAAI,MAAM,MAAM,IAAI;AAAA,EACrF;AACR;AAKA,SAAS,YACP,OACA,YACA,eACA,OAAkB,KACZ;AACN,QAAM,QAAQ,IAAI,IAAI,MAAM,UAAU,EAAE,MAAM,EAAE,IAAI,GAAG,MAAM,MAAM,IAAI,GAAG,MAAM,IAAI,IAAI,CAAC;AACzF,QAAM,cAAc,IAAI,IAAI;AAAA,IAC1B,MAAM,QAAQ,IAAI;AAAA,IAClB,MAAM,cAAc,IAAI;AAAA,IACxB;AAAA,IACA;AAAA,EACF;AACA,iBAAe,OAAO,MAAM,YAAY,SAAS;AACjD,iBAAe,OAAO,MAAM,kBAAkB,eAAe;AAC/D;AAoBO,SAAS,mBACd,WACA,UAAqC,CAAC,GACkC;AAAA,EAIxE,MAAM,2BAA4D;AAAA,IAChE;AAAA,IACA;AAAA,EACF,EAA+B;AAAA;AAAA;AAAA;AAAA,IAI7B,OAAO,SAAqB;AAAA,MAC1B,GAAG,UAAU;AAAA,MACb,OAAO,CAAC,gBAAgB;AAAA,MACxB,SAAS;AAAA,QACP,YAAY;AAAA,UACV,MAAM;AAAA,UACN,SAAS;AAAA,QACX;AAAA,QACA,eAAe;AAAA,UACb,MAAM;AAAA,UACN,SAAS;AAAA,QACX;AAAA,QACA,QAAQ;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACX;AAAA,MACF;AAAA,IACF;AAAA,IAEA,UAA6B;AAAA,MAC3B,OAAO;AAAA,QACL,GAAG;AAAA,QACH,GAAG;AAAA,MACL;AAAA,MACA,KAAK;AAAA,QACH,GAAG;AAAA,QACH,GAAG;AAAA,MACL;AAAA,MACA,SAAS;AAAA,QACP,GAAG;AAAA,QACH,GAAG;AAAA,MACL;AAAA,MACA,eAAe;AAAA,QACb,GAAG;AAAA,QACH,GAAG;AAAA,MACL;AAAA,MACA,UAAU;AAAA,QACR,GAAG;AAAA,QACH,GAAG;AAAA,MACL;AAAA,MACA,gBAAgB;AAAA,QACd,GAAG;AAAA,QACH,GAAG;AAAA,MACL;AAAA,IACF;AAAA,IAEA,sBAAsB;AAAA,IAEtB,IAAI,QAAQ;AACV,UAAI,KAAK,qBAAqB;AAC5B,aAAK,sBAAsB;AAC3B,cAAM,cAAc,QAAQ,iBACxB,eAAe,KAAK,GAAG,IACvB,KAAK,IAAI,sBAAsB;AAEnC,oBAAY,KAAK,OAAO;AACxB,oBAAY,KAAK,OAAO;AAExB,cAAM,iBAAiB;AAAA,UACrB,GAAG;AAAA,UACH,GAAG;AAAA,UACH,QAAQ,OAAO;AAAA,UACf,OAAO,OAAO;AAAA,QAChB;AAEA,cAAM,SAAS,gBAAgB,KAAK,SAAS,MAAM;AAGnD,cAAM,CAAC,QAAQ,IAAI,IAAI,SAAS,KAAK,aAAa,gBAAgB,MAAM;AACxE,cAAM,WAAW,MAAM,OAAO,SAAS,QAAQ,IAAI;AACnD,cAAM,YAAY,WAAW,OAAO,IAAI,SAAS,WAAW,WAAW,OAAO,OAAO;AAErF,cAAM,CAAC,QAAQ,IAAI,IAAI,SAAS,KAAK,aAAa,gBAAgB,MAAM;AACxE,cAAM,WAAW,MAAM,OAAO,SAAS,QAAQ,IAAI;AACnD,cAAM,YAAY,WAAW,OAAO,IAAI,SAAS,WAAW,WAAW,OAAO,OAAO;AAErF,aAAK,QAAQ,MAAM,IAAI;AACvB,aAAK,QAAQ,MAAM,IAAI;AACvB,aAAK,QAAQ,IAAI,IAAI;AACrB,aAAK,QAAQ,IAAI,IAAI;AACrB,aAAK,QAAQ,QAAQ,IAAI;AACzB,aAAK,QAAQ,QAAQ,IAAI;AACzB,aAAK,QAAQ,cAAc,IAAI;AAC/B,aAAK,QAAQ,cAAc,IAAI;AAC/B,aAAK,QAAQ,SAAS,IAAI;AAC1B,aAAK,QAAQ,SAAS,IAAI;AAC1B,aAAK,QAAQ,eAAe,IAAI;AAChC,aAAK,QAAQ,eAAe,IAAI;AAAA,MAClC;AAEA,aAAO,KAAK;AAAA,IACd;AAAA;AAAA;AAAA;AAAA,IAKA,YAAY,SAAsB;AAChC,YAAM,OAAO;AAEb,YAAM,SAAS,MAAM;AACnB,kBAAU,KAAK,MAAM;AAEnB,gBAAM,WAAW,KAAK,aAAa,kBAAkB,KAAK,KAAK;AAC/D,cAAI,WAAW,QAAQ,GAAG;AACxB,sBAAU,MAAM,MAAM;AACpB,uBAAS,KAAK,OAAO;AAAA,YACvB,CAAC;AAAA,UACH;AAAA,QACF,CAAC;AAAA,MACH;AAEA,YAAM,WAAW;AAAA,QACf,YAAY,OAAoB;AAC9B,mBAAS,MAAM,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC;AAAA,QACtC;AAAA,QACA,SAAS,MAAM;AACb,eAAK,sBAAsB;AAC3B,iBAAO;AAAA,QACT;AAAA,QACA,UAAU,CAAC,UAA8B;AACvC,cAAI,MAAM,QAAQ,KAAK,MAAM,QAAQ,GAAG;AACtC,iBAAK,UAAU,OAAO,QAAQ;AAAA,UAChC;AAAA,QACF;AAAA,QACA,SAAS,MAAM,OAAO;AAAA,QACtB,QAAQ,MAAM;AACZ,gBAAM,EAAE,YAAY,cAAc,IAAI,KAAK;AAC3C,sBAAY,KAAK,SAAS,YAAY,eAAe,GAAG;AACxD,sBAAY,KAAK,SAAS,YAAY,eAAe,GAAG;AAExD,cACE,KAAK,QAAQ,cAAc,MAAM,KAAK,QAAQ,QAAQ,KACtD,KAAK,QAAQ,cAAc,MAAM,KAAK,QAAQ,QAAQ,GACtD;AACA,iBAAK,UAAU,QAAQ,QAAQ;AAAA,UACjC;AAEA,iBAAO;AAAA,QACT;AAAA,MACF;AAEA,WAAK,IAAI,kBAAkB,MAAM;AAC/B,aAAK,IAAI,WAAW,QAAQ;AAC5B,aAAK,IAAI,WAAW,QAAQ;AAC5B,aAAK,IAAI,YAAY,QAAQ;AAC7B,aAAK,IAAI,UAAU,QAAQ;AAAA,MAC7B,CAAC;AAED,WAAK,IAAI,aAAa,MAAM;AAC1B,aAAK,KAAK,WAAW,QAAQ;AAC7B,aAAK,KAAK,WAAW,QAAQ;AAC7B,aAAK,KAAK,YAAY,QAAQ;AAC9B,aAAK,KAAK,UAAU,QAAQ;AAG5B,aAAK,QAAQ,cAAc,IAAI,KAAK,QAAQ,QAAQ;AACpD,aAAK,QAAQ,cAAc,IAAI,KAAK,QAAQ,QAAQ;AACpD,aAAK,QAAQ,eAAe,IAAI,KAAK,QAAQ,SAAS;AACtD,aAAK,QAAQ,eAAe,IAAI,KAAK,QAAQ,SAAS;AACtD,eAAO;AAAA,MACT,CAAC;AAAA,IACH;AAAA,EACF;AAGA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Base, BaseConstructor, BaseProps } from '../Base/
|
|
2
|
-
import type
|
|
1
|
+
import type { Base, BaseConstructor, BaseProps } from '../Base/Base.js';
|
|
2
|
+
import { type Features } from '../Base/features.js';
|
|
3
3
|
export type CreateAppOptions = Partial<Features> & {
|
|
4
4
|
root?: HTMLElement;
|
|
5
5
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { features } from "../Base/features.js";
|
|
2
|
+
import { isDev } from "../utils/is.js";
|
|
2
3
|
import { defineFeatures } from "./defineFeatures.js";
|
|
3
|
-
import { isDev } from "../utils/index.js";
|
|
4
4
|
import { logTree } from "./logTree.js";
|
|
5
5
|
function createApp(App, options = {}) {
|
|
6
6
|
let app;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../packages/js-toolkit/helpers/createApp.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Base, BaseConstructor, BaseProps } from '../Base/
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { Base, BaseConstructor, BaseProps } from '../Base/Base.js';\nimport { features, type Features } from '../Base/features.js';\nimport { isDev } from '../utils/is.js';\nimport { defineFeatures } from './defineFeatures.js';\nimport { logTree } from './logTree.js';\n\nexport type CreateAppOptions = Partial<Features> & {\n root?: HTMLElement;\n};\n\n/**\n * Instantiate and mount the given component on the given root element when the page has been loaded\n * and return a function to use the app instance when it is ready.\n * @link https://js-toolkit.studiometa.dev/api/helpers/createApp.html\n */\nexport function createApp<S extends BaseConstructor<Base>, T extends BaseProps = BaseProps>(\n App: S,\n options: HTMLElement | CreateAppOptions = {},\n): () => Promise<S & Base<T>> {\n let app: S & Base<T>;\n const { root = document.body, ...featureOptions } =\n options instanceof HTMLElement ? { root: options } : options;\n\n defineFeatures(featureOptions);\n\n async function init() {\n app = new App(root) as S & Base<T>;\n await app.$mount();\n if (isDev) {\n globalThis.$logTree = () => logTree(app);\n }\n return app;\n }\n\n let p: Promise<S & Base<T>>;\n\n if (features.get('blocking')) {\n p = init();\n } else {\n p = new Promise<S & Base<T>>((resolve) => {\n if (document.readyState === 'complete') {\n resolve(init());\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n resolve(init());\n }\n });\n }\n });\n }\n\n return () => p;\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,gBAA+B;AACxC,SAAS,aAAa;AACtB,SAAS,sBAAsB;AAC/B,SAAS,eAAe;AAWjB,SAAS,UACd,KACA,UAA0C,CAAC,GACf;AAC5B,MAAI;AACJ,QAAM,EAAE,OAAO,SAAS,MAAM,GAAG,eAAe,IAC9C,mBAAmB,cAAc,EAAE,MAAM,QAAQ,IAAI;AAEvD,iBAAe,cAAc;AAE7B,iBAAe,OAAO;AACpB,UAAM,IAAI,IAAI,IAAI;AAClB,UAAM,IAAI,OAAO;AACjB,QAAI,OAAO;AACT,iBAAW,WAAW,MAAM,QAAQ,GAAG;AAAA,IACzC;AACA,WAAO;AAAA,EACT;AAEA,MAAI;AAEJ,MAAI,SAAS,IAAI,UAAU,GAAG;AAC5B,QAAI,KAAK;AAAA,EACX,OAAO;AACL,QAAI,IAAI,QAAqB,CAAC,YAAY;AACxC,UAAI,SAAS,eAAe,YAAY;AACtC,gBAAQ,KAAK,CAAC;AAAA,MAChB,OAAO;AACL,iBAAS,iBAAiB,oBAAoB,MAAM;AAClD,cAAI,SAAS,eAAe,YAAY;AACtC,oBAAQ,KAAK,CAAC;AAAA,UAChB;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO,MAAM;AACf;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { features } from "../Base/features.js";
|
|
2
|
-
import { isBoolean, isObject, isString } from "../utils/
|
|
2
|
+
import { isBoolean, isObject, isString } from "../utils/is.js";
|
|
3
3
|
function defineFeatures(options) {
|
|
4
4
|
const { breakpoints, blocking, prefix, attributes } = options;
|
|
5
5
|
if (isObject(breakpoints)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../packages/js-toolkit/helpers/defineFeatures.ts"],
|
|
4
|
-
"sourcesContent": ["import
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { features, type Features } from '../Base/features.js';\nimport { isBoolean, isObject, isString } from '../utils/is.js';\n\n/**\n * Configure global features outside of `createApp`.\n * Useful when using `registerComponent` instead of `createApp`.\n * @link https://js-toolkit.studiometa.dev/api/helpers/defineFeatures.html\n */\nexport function defineFeatures(options: Partial<Features>): void {\n const { breakpoints, blocking, prefix, attributes } = options;\n\n if (isObject(breakpoints)) {\n features.set('breakpoints', breakpoints);\n }\n\n if (isBoolean(blocking)) {\n features.set('blocking', blocking);\n }\n\n if (isString(prefix)) {\n features.set('prefix', prefix);\n }\n\n if (isObject(attributes)) {\n features.set('attributes', attributes);\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,gBAA+B;AACxC,SAAS,WAAW,UAAU,gBAAgB;AAOvC,SAAS,eAAe,SAAkC;AAC/D,QAAM,EAAE,aAAa,UAAU,QAAQ,WAAW,IAAI;AAEtD,MAAI,SAAS,WAAW,GAAG;AACzB,aAAS,IAAI,eAAe,WAAW;AAAA,EACzC;AAEA,MAAI,UAAU,QAAQ,GAAG;AACvB,aAAS,IAAI,YAAY,QAAQ;AAAA,EACnC;AAEA,MAAI,SAAS,MAAM,GAAG;AACpB,aAAS,IAAI,UAAU,MAAM;AAAA,EAC/B;AAEA,MAAI,SAAS,UAAU,GAAG;AACxB,aAAS,IAAI,cAAc,UAAU;AAAA,EACvC;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { getAncestorWhere } from "../utils/dom/ancestors.js";
|
|
1
2
|
import { getInstanceFromElement } from "./getInstanceFromElement.js";
|
|
2
|
-
import { getAncestorWhere } from "../utils/index.js";
|
|
3
3
|
function getClosestParent(childInstance, ParentConstructor) {
|
|
4
4
|
const parentEl = getAncestorWhere(
|
|
5
5
|
childInstance.$el,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../packages/js-toolkit/helpers/getClosestParent.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Base, BaseConstructor } from '../Base/
|
|
5
|
-
"mappings": "AACA,SAAS,
|
|
4
|
+
"sourcesContent": ["import type { Base, BaseConstructor } from '../Base/Base.js';\nimport { getAncestorWhere } from '../utils/dom/ancestors.js';\nimport { getInstanceFromElement } from './getInstanceFromElement.js';\n\n/**\n * Get the closest parent of a component.\n * @link https://js-toolkit.studiometa.dev/api/helpers/getClosestParent.html\n */\nexport function getClosestParent<T extends BaseConstructor>(\n childInstance: Base,\n ParentConstructor: T,\n) {\n const parentEl = getAncestorWhere(\n childInstance.$el,\n (element) => element && getInstanceFromElement(element, ParentConstructor) !== null,\n );\n\n return parentEl ? getInstanceFromElement(parentEl, ParentConstructor) : null;\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,wBAAwB;AACjC,SAAS,8BAA8B;AAMhC,SAAS,iBACd,eACA,mBACA;AACA,QAAM,WAAW;AAAA,IACf,cAAc;AAAA,IACd,CAAC,YAAY,WAAW,uBAAuB,SAAS,iBAAiB,MAAM;AAAA,EACjF;AAEA,SAAO,WAAW,uBAAuB,UAAU,iBAAiB,IAAI;AAC1E;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../packages/js-toolkit/helpers/getDirectChildren.ts"],
|
|
4
|
-
"sourcesContent": ["import { Base, BaseProps } from '../Base/
|
|
4
|
+
"sourcesContent": ["import { Base, BaseProps } from '../Base/Base.js';\nimport { isArray } from '../utils/is.js';\n\n/**\n * Get direct children from a parent when working with nested components.\n *\n * @template {Base} T\n * @param {Base} parentInstance\n * @param {string} parentName\n * @param {string} childrenName\n * @return {T[]}\n * @link https://js-toolkit.studiometa.dev/api/helpers/getDirectChildren.html\n */\nexport function getDirectChildren<T extends Base = Base>(\n parentInstance: Base,\n parentName: string,\n childrenName: string,\n): T[] {\n const allChildren = parentInstance.__children.props;\n const children = allChildren[childrenName] as Base<BaseProps>[];\n const nestedParents = allChildren[parentName] as Base<BaseProps>[];\n\n if (!isArray(children)) {\n return [];\n }\n\n if (!isArray(nestedParents) || nestedParents.length <= 0) {\n return children as T[];\n }\n\n const directChildren = [];\n\n for (const child of children) {\n for (const nestedParent of nestedParents) {\n const nestedChildren = nestedParent.__children.props[childrenName] as Base<BaseProps>[];\n\n if (isArray(nestedChildren) && nestedChildren.includes(child)) {\n continue;\n }\n\n directChildren.push(child);\n }\n }\n\n return directChildren;\n}\n\n/**\n * Test if a component instance is a direct child from the given component.\n *\n * @param {Base} parentInstance\n * @param {string} parentName\n * @param {string} childrenName\n * @param {Base} childInstance\n * @return {boolean}\n * @link https://js-toolkit.studiometa.dev/api/helpers/isDirectChild.html\n */\nexport function isDirectChild(parentInstance, parentName, childrenName, childInstance) {\n return getDirectChildren(parentInstance, parentName, childrenName).includes(childInstance);\n}\n"],
|
|
5
5
|
"mappings": "AACA,SAAS,eAAe;AAYjB,SAAS,kBACd,gBACA,YACA,cACK;AACL,QAAM,cAAc,eAAe,WAAW;AAC9C,QAAM,WAAW,YAAY,YAAY;AACzC,QAAM,gBAAgB,YAAY,UAAU;AAE5C,MAAI,CAAC,QAAQ,QAAQ,GAAG;AACtB,WAAO,CAAC;AAAA,EACV;AAEA,MAAI,CAAC,QAAQ,aAAa,KAAK,cAAc,UAAU,GAAG;AACxD,WAAO;AAAA,EACT;AAEA,QAAM,iBAAiB,CAAC;AAExB,aAAW,SAAS,UAAU;AAC5B,eAAW,gBAAgB,eAAe;AACxC,YAAM,iBAAiB,aAAa,WAAW,MAAM,YAAY;AAEjE,UAAI,QAAQ,cAAc,KAAK,eAAe,SAAS,KAAK,GAAG;AAC7D;AAAA,MACF;AAEA,qBAAe,KAAK,KAAK;AAAA,IAC3B;AAAA,EACF;AAEA,SAAO;AACT;AAYO,SAAS,cAAc,gBAAgB,YAAY,cAAc,eAAe;AACrF,SAAO,kBAAkB,gBAAgB,YAAY,YAAY,EAAE,SAAS,aAAa;AAC3F;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../packages/js-toolkit/helpers/getInstanceFromElement.ts"],
|
|
4
|
-
"sourcesContent": ["import type { BaseConstructor, BaseEl } from '../Base/
|
|
4
|
+
"sourcesContent": ["import type { BaseConstructor, BaseEl } from '../Base/Base.js';\n\n/**\n * Get a component instance from a DOM element.\n * @link https://js-toolkit.studiometa.dev/api/helpers/getInstanceFromElement.html\n */\nexport function getInstanceFromElement<T extends BaseConstructor>(\n element: BaseEl,\n Constructor: T,\n): InstanceType<T> | null {\n if (!element || !element.__base__ || !element.__base__.has(Constructor.config.name)) {\n return null;\n }\n\n return element.__base__.get(Constructor.config.name) as InstanceType<T>;\n}\n"],
|
|
5
5
|
"mappings": "AAMO,SAAS,uBACd,SACA,aACwB;AACxB,MAAI,CAAC,WAAW,CAAC,QAAQ,YAAY,CAAC,QAAQ,SAAS,IAAI,YAAY,OAAO,IAAI,GAAG;AACnF,WAAO;AAAA,EACT;AAEA,SAAO,QAAQ,SAAS,IAAI,YAAY,OAAO,IAAI;AACrD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { getComponentResolver } from "../utils/getComponentResolver.js";
|
|
2
|
+
import { isString } from "../utils/is.js";
|
|
1
3
|
import { getTargetElements } from "./utils.js";
|
|
2
|
-
import { isString, getComponentResolver } from "../utils/index.js";
|
|
3
4
|
function importOnInteraction(fn, nameOrSelectorOrElement, events, parent) {
|
|
4
5
|
const normalizedEvents = isString(events) ? [events] : events;
|
|
5
6
|
const resolver = getComponentResolver(fn);
|