mates-devtools 0.1.0-beta.1
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/mates-devtools.es.js +3464 -0
- package/dist/mates-devtools.umd.js +650 -0
- package/dist/types/Mates-DevTools/src/MatesDevTools.d.ts +5 -0
- package/dist/types/Mates-DevTools/src/MatesDevTools.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/MatesDevToolsComponent.d.ts +24 -0
- package/dist/types/Mates-DevTools/src/MatesDevToolsComponent.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/AtomsViewer.d.ts +2 -0
- package/dist/types/Mates-DevTools/src/components/AtomsViewer.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/ComponentInspector.d.ts +27 -0
- package/dist/types/Mates-DevTools/src/components/ComponentInspector.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/ComponentList.d.ts +11 -0
- package/dist/types/Mates-DevTools/src/components/ComponentList.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/ComponentTree.d.ts +9 -0
- package/dist/types/Mates-DevTools/src/components/ComponentTree.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/Header.d.ts +10 -0
- package/dist/types/Mates-DevTools/src/components/Header.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/Highlight.d.ts +6 -0
- package/dist/types/Mates-DevTools/src/components/Highlight.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/HooksViewer.d.ts +7 -0
- package/dist/types/Mates-DevTools/src/components/HooksViewer.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/LogsViewer.d.ts +6 -0
- package/dist/types/Mates-DevTools/src/components/LogsViewer.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/PerfViewer.d.ts +7 -0
- package/dist/types/Mates-DevTools/src/components/PerfViewer.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/PropsViewer.d.ts +2 -0
- package/dist/types/Mates-DevTools/src/components/PropsViewer.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/ScopesViewer.d.ts +2 -0
- package/dist/types/Mates-DevTools/src/components/ScopesViewer.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/TimerLogger.d.ts +5 -0
- package/dist/types/Mates-DevTools/src/components/TimerLogger.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/UseStateViewer.d.ts +12 -0
- package/dist/types/Mates-DevTools/src/components/UseStateViewer.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/ValueTree.d.ts +19 -0
- package/dist/types/Mates-DevTools/src/components/ValueTree.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/index.d.ts +23 -0
- package/dist/types/Mates-DevTools/src/index.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/interceptTimers.d.ts +11 -0
- package/dist/types/Mates-DevTools/src/interceptTimers.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/logStore.d.ts +38 -0
- package/dist/types/Mates-DevTools/src/logStore.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/perfStore.d.ts +36 -0
- package/dist/types/Mates-DevTools/src/perfStore.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/registry.d.ts +68 -0
- package/dist/types/Mates-DevTools/src/registry.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/styles.d.ts +833 -0
- package/dist/types/Mates-DevTools/src/styles.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/types.d.ts +19 -0
- package/dist/types/Mates-DevTools/src/types.d.ts.map +1 -0
- package/dist/types/lib/Directives/$.d.ts +371 -0
- package/dist/types/lib/Directives/$.d.ts.map +1 -0
- package/dist/types/lib/Directives/animatedConditional.d.ts +67 -0
- package/dist/types/lib/Directives/animatedConditional.d.ts.map +1 -0
- package/dist/types/lib/Directives/animationClasses.d.ts +50 -0
- package/dist/types/lib/Directives/animationClasses.d.ts.map +1 -0
- package/dist/types/lib/Directives/attrDirective.d.ts +69 -0
- package/dist/types/lib/Directives/attrDirective.d.ts.map +1 -0
- package/dist/types/lib/Directives/classesDirective.d.ts +79 -0
- package/dist/types/lib/Directives/classesDirective.d.ts.map +1 -0
- package/dist/types/lib/Directives/eleHook.d.ts +84 -0
- package/dist/types/lib/Directives/eleHook.d.ts.map +1 -0
- package/dist/types/lib/Directives/eventBinding.d.ts +29 -0
- package/dist/types/lib/Directives/eventBinding.d.ts.map +1 -0
- package/dist/types/lib/Directives/htmlHook.d.ts +101 -0
- package/dist/types/lib/Directives/htmlHook.d.ts.map +1 -0
- package/dist/types/lib/Directives/index.d.ts +18 -0
- package/dist/types/lib/Directives/index.d.ts.map +1 -0
- package/dist/types/lib/Directives/intersectDirective.d.ts +67 -0
- package/dist/types/lib/Directives/intersectDirective.d.ts.map +1 -0
- package/dist/types/lib/Directives/lazyLoadDirective.d.ts +66 -0
- package/dist/types/lib/Directives/lazyLoadDirective.d.ts.map +1 -0
- package/dist/types/lib/Directives/lifecycleDirectives.d.ts +56 -0
- package/dist/types/lib/Directives/lifecycleDirectives.d.ts.map +1 -0
- package/dist/types/lib/Directives/masonryGrid.d.ts +114 -0
- package/dist/types/lib/Directives/masonryGrid.d.ts.map +1 -0
- package/dist/types/lib/Directives/memoTemplate.d.ts +94 -0
- package/dist/types/lib/Directives/memoTemplate.d.ts.map +1 -0
- package/dist/types/lib/Directives/onDirective.d.ts +71 -0
- package/dist/types/lib/Directives/onDirective.d.ts.map +1 -0
- package/dist/types/lib/Directives/onParentDirective.d.ts +34 -0
- package/dist/types/lib/Directives/onParentDirective.d.ts.map +1 -0
- package/dist/types/lib/Directives/renderSwitch.d.ts +55 -0
- package/dist/types/lib/Directives/renderSwitch.d.ts.map +1 -0
- package/dist/types/lib/Directives/resolveAttrValue.d.ts +35 -0
- package/dist/types/lib/Directives/resolveAttrValue.d.ts.map +1 -0
- package/dist/types/lib/Directives/styleDirective.d.ts +81 -0
- package/dist/types/lib/Directives/styleDirective.d.ts.map +1 -0
- package/dist/types/lib/Directives/timerDirective.d.ts +52 -0
- package/dist/types/lib/Directives/timerDirective.d.ts.map +1 -0
- package/dist/types/lib/Directives/virtualHelpers.d.ts +10 -0
- package/dist/types/lib/Directives/virtualHelpers.d.ts.map +1 -0
- package/dist/types/lib/Fetch/ErrorTypes.d.ts +74 -0
- package/dist/types/lib/Fetch/ErrorTypes.d.ts.map +1 -0
- package/dist/types/lib/Fetch/Fetch.d.ts +168 -0
- package/dist/types/lib/Fetch/Fetch.d.ts.map +1 -0
- package/dist/types/lib/Fetch/index.d.ts +3 -0
- package/dist/types/lib/Fetch/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/Extended Atoms/cacheAtom.d.ts +156 -0
- package/dist/types/lib/Mutables/Extended Atoms/cacheAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/Extended Atoms/index.d.ts +4 -0
- package/dist/types/lib/Mutables/Extended Atoms/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/Extended Atoms/paginationAtom.d.ts +32 -0
- package/dist/types/lib/Mutables/Extended Atoms/paginationAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/Extended Atoms/themeAtom.d.ts +59 -0
- package/dist/types/lib/Mutables/Extended Atoms/themeAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/atom.d.ts +148 -0
- package/dist/types/lib/Mutables/atom/atom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/createTimedAtom.d.ts +43 -0
- package/dist/types/lib/Mutables/atom/createTimedAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/debouncedAtom.d.ts +37 -0
- package/dist/types/lib/Mutables/atom/debouncedAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/index.d.ts +10 -0
- package/dist/types/lib/Mutables/atom/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/mapAtom.d.ts +105 -0
- package/dist/types/lib/Mutables/atom/mapAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/setAtom.d.ts +107 -0
- package/dist/types/lib/Mutables/atom/setAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/storageAtom.d.ts +44 -0
- package/dist/types/lib/Mutables/atom/storageAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/throttledAtom.d.ts +37 -0
- package/dist/types/lib/Mutables/atom/throttledAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/titleAtom.d.ts +20 -0
- package/dist/types/lib/Mutables/atom/titleAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/effect/effect.d.ts +31 -0
- package/dist/types/lib/Mutables/effect/effect.d.ts.map +1 -0
- package/dist/types/lib/Mutables/effect/index.d.ts +2 -0
- package/dist/types/lib/Mutables/effect/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/events/events.d.ts +123 -0
- package/dist/types/lib/Mutables/events/events.d.ts.map +1 -0
- package/dist/types/lib/Mutables/events/index.d.ts +2 -0
- package/dist/types/lib/Mutables/events/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/events/xTabEvent.d.ts +61 -0
- package/dist/types/lib/Mutables/events/xTabEvent.d.ts.map +1 -0
- package/dist/types/lib/Mutables/form/formAtom.d.ts +56 -0
- package/dist/types/lib/Mutables/form/formAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/form/index.d.ts +5 -0
- package/dist/types/lib/Mutables/form/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/form/transformers.d.ts +4 -0
- package/dist/types/lib/Mutables/form/transformers.d.ts.map +1 -0
- package/dist/types/lib/Mutables/form/validateAll.d.ts +40 -0
- package/dist/types/lib/Mutables/form/validateAll.d.ts.map +1 -0
- package/dist/types/lib/Mutables/form/validators.d.ts +61 -0
- package/dist/types/lib/Mutables/form/validators.d.ts.map +1 -0
- package/dist/types/lib/Mutables/index.d.ts +13 -0
- package/dist/types/lib/Mutables/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/memo/index.d.ts +2 -0
- package/dist/types/lib/Mutables/memo/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/memo/memo.d.ts +47 -0
- package/dist/types/lib/Mutables/memo/memo.d.ts.map +1 -0
- package/dist/types/lib/Mutables/reactiveRunner/index.d.ts +4 -0
- package/dist/types/lib/Mutables/reactiveRunner/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/reactiveRunner/reactiveRunner.d.ts +56 -0
- package/dist/types/lib/Mutables/reactiveRunner/reactiveRunner.d.ts.map +1 -0
- package/dist/types/lib/Mutables/reactiveRunner/trackAndSubscribe.d.ts +6 -0
- package/dist/types/lib/Mutables/reactiveRunner/trackAndSubscribe.d.ts.map +1 -0
- package/dist/types/lib/Mutables/reactiveRunner/validateReactiveFunction.d.ts +6 -0
- package/dist/types/lib/Mutables/reactiveRunner/validateReactiveFunction.d.ts.map +1 -0
- package/dist/types/lib/Mutables/ref/index.d.ts +2 -0
- package/dist/types/lib/Mutables/ref/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/ref/ref.d.ts +74 -0
- package/dist/types/lib/Mutables/ref/ref.d.ts.map +1 -0
- package/dist/types/lib/Mutables/scope/index.d.ts +2 -0
- package/dist/types/lib/Mutables/scope/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/scope/scope.d.ts +60 -0
- package/dist/types/lib/Mutables/scope/scope.d.ts.map +1 -0
- package/dist/types/lib/Mutables/store/index.d.ts +2 -0
- package/dist/types/lib/Mutables/store/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/store/store.d.ts +73 -0
- package/dist/types/lib/Mutables/store/store.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useState/index.d.ts +2 -0
- package/dist/types/lib/Mutables/useState/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useState/useState.d.ts +54 -0
- package/dist/types/lib/Mutables/useState/useState.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/hostContext.d.ts +13 -0
- package/dist/types/lib/Mutables/useStore/hostContext.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/index.d.ts +9 -0
- package/dist/types/lib/Mutables/useStore/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/lifecycle.d.ts +94 -0
- package/dist/types/lib/Mutables/useStore/lifecycle.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/onError.d.ts +21 -0
- package/dist/types/lib/Mutables/useStore/onError.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/onReferenceChange.d.ts +2 -0
- package/dist/types/lib/Mutables/useStore/onReferenceChange.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/safetyCheck.d.ts +2 -0
- package/dist/types/lib/Mutables/useStore/safetyCheck.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/setter.d.ts +52 -0
- package/dist/types/lib/Mutables/useStore/setter.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/subscription.d.ts +50 -0
- package/dist/types/lib/Mutables/useStore/subscription.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/useContext.d.ts +3 -0
- package/dist/types/lib/Mutables/useStore/useContext.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/useStore.d.ts +7 -0
- package/dist/types/lib/Mutables/useStore/useStore.d.ts.map +1 -0
- package/dist/types/lib/Router/Router.d.ts +54 -0
- package/dist/types/lib/Router/Router.d.ts.map +1 -0
- package/dist/types/lib/Router/animatedRouter.d.ts +48 -0
- package/dist/types/lib/Router/animatedRouter.d.ts.map +1 -0
- package/dist/types/lib/Router/buildPath.d.ts +20 -0
- package/dist/types/lib/Router/buildPath.d.ts.map +1 -0
- package/dist/types/lib/Router/hashAtom.d.ts +12 -0
- package/dist/types/lib/Router/hashAtom.d.ts.map +1 -0
- package/dist/types/lib/Router/index.d.ts +11 -0
- package/dist/types/lib/Router/index.d.ts.map +1 -0
- package/dist/types/lib/Router/isPathMatching.d.ts +12 -0
- package/dist/types/lib/Router/isPathMatching.d.ts.map +1 -0
- package/dist/types/lib/Router/location.d.ts +74 -0
- package/dist/types/lib/Router/location.d.ts.map +1 -0
- package/dist/types/lib/Router/navigateTo.d.ts +31 -0
- package/dist/types/lib/Router/navigateTo.d.ts.map +1 -0
- package/dist/types/lib/Router/navigationLock.d.ts +50 -0
- package/dist/types/lib/Router/navigationLock.d.ts.map +1 -0
- package/dist/types/lib/Router/pathAtom.d.ts +42 -0
- package/dist/types/lib/Router/pathAtom.d.ts.map +1 -0
- package/dist/types/lib/Router/pathResolver.d.ts +9 -0
- package/dist/types/lib/Router/pathResolver.d.ts.map +1 -0
- package/dist/types/lib/Router/qsAtom.d.ts +12 -0
- package/dist/types/lib/Router/qsAtom.d.ts.map +1 -0
- package/dist/types/lib/Template/index.d.ts +6 -0
- package/dist/types/lib/Template/index.d.ts.map +1 -0
- package/dist/types/lib/Template/scheduler.d.ts +59 -0
- package/dist/types/lib/Template/scheduler.d.ts.map +1 -0
- package/dist/types/lib/Template/x-x.d.ts +60 -0
- package/dist/types/lib/Template/x-x.d.ts.map +1 -0
- package/dist/types/lib/Template/x-x.types.d.ts +91 -0
- package/dist/types/lib/Template/x-x.types.d.ts.map +1 -0
- package/dist/types/lib/Template/x-x.utils.d.ts +15 -0
- package/dist/types/lib/Template/x-x.utils.d.ts.map +1 -0
- package/dist/types/lib/Template/x.d.ts +5 -0
- package/dist/types/lib/Template/x.d.ts.map +1 -0
- package/dist/types/lib/Template/xProvider.d.ts +2 -0
- package/dist/types/lib/Template/xProvider.d.ts.map +1 -0
- package/dist/types/lib/Timers/createManagedTimer.d.ts +12 -0
- package/dist/types/lib/Timers/createManagedTimer.d.ts.map +1 -0
- package/dist/types/lib/Timers/index.d.ts +4 -0
- package/dist/types/lib/Timers/index.d.ts.map +1 -0
- package/dist/types/lib/Timers/interval.d.ts +2 -0
- package/dist/types/lib/Timers/interval.d.ts.map +1 -0
- package/dist/types/lib/Timers/timeout.d.ts +2 -0
- package/dist/types/lib/Timers/timeout.d.ts.map +1 -0
- package/dist/types/lib/TrackState/componentStatus.d.ts +105 -0
- package/dist/types/lib/TrackState/componentStatus.d.ts.map +1 -0
- package/dist/types/lib/TrackState/readTracking.d.ts +20 -0
- package/dist/types/lib/TrackState/readTracking.d.ts.map +1 -0
- package/dist/types/lib/Utils/Context.d.ts +6 -0
- package/dist/types/lib/Utils/Context.d.ts.map +1 -0
- package/dist/types/lib/Utils/Date/calendar.d.ts +30 -0
- package/dist/types/lib/Utils/Date/calendar.d.ts.map +1 -0
- package/dist/types/lib/Utils/Date/core.d.ts +29 -0
- package/dist/types/lib/Utils/Date/core.d.ts.map +1 -0
- package/dist/types/lib/Utils/Date/date.d.ts +60 -0
- package/dist/types/lib/Utils/Date/date.d.ts.map +1 -0
- package/dist/types/lib/Utils/Date/index.d.ts +3 -0
- package/dist/types/lib/Utils/Date/index.d.ts.map +1 -0
- package/dist/types/lib/Utils/deepClone.d.ts +7 -0
- package/dist/types/lib/Utils/deepClone.d.ts.map +1 -0
- package/dist/types/lib/Utils/deepFreeze.d.ts +2 -0
- package/dist/types/lib/Utils/deepFreeze.d.ts.map +1 -0
- package/dist/types/lib/Utils/getAllProps.d.ts +2 -0
- package/dist/types/lib/Utils/getAllProps.d.ts.map +1 -0
- package/dist/types/lib/Utils/helpers.d.ts +13 -0
- package/dist/types/lib/Utils/helpers.d.ts.map +1 -0
- package/dist/types/lib/Utils/index.d.ts +13 -0
- package/dist/types/lib/Utils/index.d.ts.map +1 -0
- package/dist/types/lib/Utils/is.d.ts +12 -0
- package/dist/types/lib/Utils/is.d.ts.map +1 -0
- package/dist/types/lib/Utils/isDefinedAsGetter.d.ts +2 -0
- package/dist/types/lib/Utils/isDefinedAsGetter.d.ts.map +1 -0
- package/dist/types/lib/Utils/logger.d.ts +22 -0
- package/dist/types/lib/Utils/logger.d.ts.map +1 -0
- package/dist/types/lib/Utils/notificationManager.d.ts +67 -0
- package/dist/types/lib/Utils/notificationManager.d.ts.map +1 -0
- package/dist/types/lib/Utils/registerCleanup.d.ts +7 -0
- package/dist/types/lib/Utils/registerCleanup.d.ts.map +1 -0
- package/dist/types/lib/Utils/svgIcon.d.ts +95 -0
- package/dist/types/lib/Utils/svgIcon.d.ts.map +1 -0
- package/dist/types/lib/Utils/uuid.d.ts +7 -0
- package/dist/types/lib/Utils/uuid.d.ts.map +1 -0
- package/dist/types/lib/ZeroPromise/index.d.ts +2 -0
- package/dist/types/lib/ZeroPromise/index.d.ts.map +1 -0
- package/dist/types/lib/ZeroPromise/zero.d.ts +23 -0
- package/dist/types/lib/ZeroPromise/zero.d.ts.map +1 -0
- package/dist/types/lib/actions/action.d.ts +14 -0
- package/dist/types/lib/actions/action.d.ts.map +1 -0
- package/dist/types/lib/actions/animatePresets.d.ts +38 -0
- package/dist/types/lib/actions/animatePresets.d.ts.map +1 -0
- package/dist/types/lib/actions/animateSwap.d.ts +79 -0
- package/dist/types/lib/actions/animateSwap.d.ts.map +1 -0
- package/dist/types/lib/actions/animateTypes.d.ts +103 -0
- package/dist/types/lib/actions/animateTypes.d.ts.map +1 -0
- package/dist/types/lib/actions/asyncAction.d.ts +4 -0
- package/dist/types/lib/actions/asyncAction.d.ts.map +1 -0
- package/dist/types/lib/actions/asyncActionCache.d.ts +16 -0
- package/dist/types/lib/actions/asyncActionCache.d.ts.map +1 -0
- package/dist/types/lib/actions/asyncActionPolling.d.ts +14 -0
- package/dist/types/lib/actions/asyncActionPolling.d.ts.map +1 -0
- package/dist/types/lib/actions/asyncActionTypes.d.ts +74 -0
- package/dist/types/lib/actions/asyncActionTypes.d.ts.map +1 -0
- package/dist/types/lib/actions/createTimingFunction.d.ts +23 -0
- package/dist/types/lib/actions/createTimingFunction.d.ts.map +1 -0
- package/dist/types/lib/actions/debounce.d.ts +10 -0
- package/dist/types/lib/actions/debounce.d.ts.map +1 -0
- package/dist/types/lib/actions/index.d.ts +12 -0
- package/dist/types/lib/actions/index.d.ts.map +1 -0
- package/dist/types/lib/actions/paginatedAsyncAction.d.ts +121 -0
- package/dist/types/lib/actions/paginatedAsyncAction.d.ts.map +1 -0
- package/dist/types/lib/actions/taskAction.d.ts +105 -0
- package/dist/types/lib/actions/taskAction.d.ts.map +1 -0
- package/dist/types/lib/actions/throttle.d.ts +9 -0
- package/dist/types/lib/actions/throttle.d.ts.map +1 -0
- package/dist/types/lib/css-in-js/cl.d.ts +37 -0
- package/dist/types/lib/css-in-js/cl.d.ts.map +1 -0
- package/dist/types/lib/css-in-js/index.d.ts +7 -0
- package/dist/types/lib/css-in-js/index.d.ts.map +1 -0
- package/dist/types/lib/css-in-js/sanitize.d.ts +31 -0
- package/dist/types/lib/css-in-js/sanitize.d.ts.map +1 -0
- package/dist/types/lib/css-in-js/serialize.d.ts +98 -0
- package/dist/types/lib/css-in-js/serialize.d.ts.map +1 -0
- package/dist/types/lib/css-in-js/stylesheet.d.ts +188 -0
- package/dist/types/lib/css-in-js/stylesheet.d.ts.map +1 -0
- package/dist/types/lib/css-in-js/theme.d.ts +110 -0
- package/dist/types/lib/css-in-js/theme.d.ts.map +1 -0
- package/dist/types/lib/devtools/devtoolsHooks.d.ts +101 -0
- package/dist/types/lib/devtools/devtoolsHooks.d.ts.map +1 -0
- package/dist/types/lib/devtools/index.d.ts +2 -0
- package/dist/types/lib/devtools/index.d.ts.map +1 -0
- package/dist/types/lib/index.d.ts +46 -0
- package/dist/types/lib/index.d.ts.map +1 -0
- package/dist/types/lib/on/hooks.d.ts +319 -0
- package/dist/types/lib/on/hooks.d.ts.map +1 -0
- package/dist/types/lib/on/index.d.ts +3 -0
- package/dist/types/lib/on/index.d.ts.map +1 -0
- package/dist/types/lib/on/on.d.ts +16 -0
- package/dist/types/lib/on/on.d.ts.map +1 -0
- package/dist/types/lib/portals/dialog.d.ts +56 -0
- package/dist/types/lib/portals/dialog.d.ts.map +1 -0
- package/dist/types/lib/portals/index.d.ts +9 -0
- package/dist/types/lib/portals/index.d.ts.map +1 -0
- package/dist/types/lib/portals/popup.d.ts +37 -0
- package/dist/types/lib/portals/popup.d.ts.map +1 -0
- package/dist/types/lib/portals/portal.d.ts +57 -0
- package/dist/types/lib/portals/portal.d.ts.map +1 -0
- package/dist/types/lib/portals/tip.d.ts +38 -0
- package/dist/types/lib/portals/tip.d.ts.map +1 -0
- package/dist/types/lib/socket/index.d.ts +2 -0
- package/dist/types/lib/socket/index.d.ts.map +1 -0
- package/dist/types/lib/socket/ws.d.ts +83 -0
- package/dist/types/lib/socket/ws.d.ts.map +1 -0
- package/dist/types/lib/ssr/index.d.ts +3 -0
- package/dist/types/lib/ssr/index.d.ts.map +1 -0
- package/dist/types/lib/ssr/ssr-bridge.d.ts +89 -0
- package/dist/types/lib/ssr/ssr-bridge.d.ts.map +1 -0
- package/dist/types/lib/ssr/ssrFlag.d.ts +38 -0
- package/dist/types/lib/ssr/ssrFlag.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/ScrollerController.d.ts +54 -0
- package/dist/types/lib/virtualizer/ScrollerController.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/Virtualizer.d.ts +214 -0
- package/dist/types/lib/virtualizer/Virtualizer.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/events.d.ts +27 -0
- package/dist/types/lib/virtualizer/events.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/layouts/flow.d.ts +123 -0
- package/dist/types/lib/virtualizer/layouts/flow.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/layouts/grid.d.ts +25 -0
- package/dist/types/lib/virtualizer/layouts/grid.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/layouts/masonry.d.ts +37 -0
- package/dist/types/lib/virtualizer/layouts/masonry.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/layouts/shared/BaseLayout.d.ts +204 -0
- package/dist/types/lib/virtualizer/layouts/shared/BaseLayout.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/layouts/shared/GridBaseLayout.d.ts +41 -0
- package/dist/types/lib/virtualizer/layouts/shared/GridBaseLayout.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/layouts/shared/Layout.d.ts +138 -0
- package/dist/types/lib/virtualizer/layouts/shared/Layout.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/layouts/shared/SizeCache.d.ts +19 -0
- package/dist/types/lib/virtualizer/layouts/shared/SizeCache.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/layouts/shared/SizeGapPaddingBaseLayout.d.ts +57 -0
- package/dist/types/lib/virtualizer/layouts/shared/SizeGapPaddingBaseLayout.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/mates-adapter.d.ts +201 -0
- package/dist/types/lib/virtualizer/mates-adapter.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/virtualize.d.ts +52 -0
- package/dist/types/lib/virtualizer/virtualize.d.ts.map +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A single entry in the `classes()` array or values in a class map.
|
|
3
|
+
*
|
|
4
|
+
* Accepts strings and the falsy values that fall out of JS conditional
|
|
5
|
+
* expressions — no pre-filtering needed at the call site.
|
|
6
|
+
*
|
|
7
|
+
* Also accepts tuples for conditional application:
|
|
8
|
+
* [true, "btn"] — apply "btn" if true
|
|
9
|
+
* [false, "btn"] — don't apply "btn" if false
|
|
10
|
+
* [condition, "a", "b"] — apply "a" if condition, else "b"
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* html`<div ${classes([
|
|
14
|
+
* "btn",
|
|
15
|
+
* isActive && "btn-active",
|
|
16
|
+
* [isLarge, "btn-lg", "btn-sm"],
|
|
17
|
+
* ])}></div>`
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* `0` is included so that numeric short-circuit expressions (`count && "cls"`)
|
|
21
|
+
* compile without a cast when `count` is zero.
|
|
22
|
+
*/
|
|
23
|
+
export type ClassEntry = string | false | null | undefined | 0 | [boolean, string] | [boolean, string, string];
|
|
24
|
+
export type ClassesInput = string | ClassEntry[] | Record<string, any>;
|
|
25
|
+
/**
|
|
26
|
+
* Apply a dynamic list of class names to an element.
|
|
27
|
+
*
|
|
28
|
+
* Used as an **element directive**:
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* html`<div ${classes(["btn", "btn-primary"])}></div>`
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* Falsy values (`false`, `null`, `undefined`) are silently ignored, so
|
|
35
|
+
* inline JS conditions work without any manual filtering:
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* html`<div ${classes([
|
|
39
|
+
* "card",
|
|
40
|
+
* isActive && "card-active",
|
|
41
|
+
* isError && "card-error",
|
|
42
|
+
* isLarge ? "card-lg" : "card-sm",
|
|
43
|
+
* ])}></div>`
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* Also supports conditional and ternary tuples for cleaner syntax:
|
|
47
|
+
*
|
|
48
|
+
* ```ts
|
|
49
|
+
* html`<div ${classes([
|
|
50
|
+
* "card",
|
|
51
|
+
* [isActive, "card-active"], // conditional tuple
|
|
52
|
+
* [isLarge, "card-lg", "card-sm"], // ternary tuple
|
|
53
|
+
* ])}></div>`
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* Or an object map for class name mapping:
|
|
57
|
+
*
|
|
58
|
+
* ```ts
|
|
59
|
+
* html`<div ${classes({
|
|
60
|
+
* [cl.hero]: isHero,
|
|
61
|
+
* [cl.button]: isButton,
|
|
62
|
+
* })}></div>`
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* Stale classes are removed automatically on every re-render. All managed
|
|
66
|
+
* classes are cleaned up when the element disconnects from the DOM.
|
|
67
|
+
*
|
|
68
|
+
* @param names - Array of class entries or object map of classes.
|
|
69
|
+
* - Array elements can be:
|
|
70
|
+
* - Strings (applied as-is)
|
|
71
|
+
* - Falsy values (silently ignored)
|
|
72
|
+
* - `[condition, "class"]` (apply class if condition is truthy)
|
|
73
|
+
* - `[condition, "classA", "classB"]` (apply classA if true, else classB)
|
|
74
|
+
* - Object keys are applied if their values are truthy.
|
|
75
|
+
*/
|
|
76
|
+
export declare function classes(names: ClassesInput): import("lit-html/directive.js").DirectiveResult<import("lit-html/directive.js").DirectiveClass>;
|
|
77
|
+
/** No-op — kept for backwards compatibility. */
|
|
78
|
+
export declare function removeClasses(_el: Element): void;
|
|
79
|
+
//# sourceMappingURL=classesDirective.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classesDirective.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/classesDirective.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,UAAU,GAClB,MAAM,GACN,KAAK,GACL,IAAI,GACJ,SAAS,GACT,CAAC,GACD,CAAC,OAAO,EAAE,MAAM,CAAC,GACjB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE9B,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,UAAU,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAyFvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,mGAE1C;AAED,gDAAgD;AAChD,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAG"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { DirectiveResult } from "lit-html/directive.js";
|
|
2
|
+
import { type DollarChain } from "./$";
|
|
3
|
+
/**
|
|
4
|
+
* Lifecycle object returned from the `eleHook` mount callback.
|
|
5
|
+
*
|
|
6
|
+
* - `onUpdate` — called on every re-render after the initial mount,
|
|
7
|
+
* receiving the latest args passed at the call site.
|
|
8
|
+
* - `onCleanup` — called when the element is disconnected from the DOM.
|
|
9
|
+
*
|
|
10
|
+
* @template A - Tuple of user-supplied argument types.
|
|
11
|
+
*/
|
|
12
|
+
export type EleHookLifecycle<A extends any[] = []> = {
|
|
13
|
+
/** Called on every re-render after the initial mount with the latest args. */
|
|
14
|
+
onUpdate?: (...args: A) => void;
|
|
15
|
+
/** Called when the element is disconnected from the DOM. */
|
|
16
|
+
onCleanup?: () => void;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The mount callback signature for `eleHook()`.
|
|
20
|
+
*
|
|
21
|
+
* The first argument `$` (DollarChain) is always injected automatically —
|
|
22
|
+
* it is a fluent handle bound to the host element. Any additional arguments
|
|
23
|
+
* are the user-supplied values passed at the template call site.
|
|
24
|
+
*
|
|
25
|
+
* Return an `EleHookLifecycle` object to handle updates and cleanup,
|
|
26
|
+
* or return nothing if the mount body is all you need.
|
|
27
|
+
*
|
|
28
|
+
* @template A - Tuple of user-supplied argument types.
|
|
29
|
+
*/
|
|
30
|
+
export type EleHookMountFn<A extends any[] = []> = ($: DollarChain, ...args: A) => EleHookLifecycle<A> | undefined | void;
|
|
31
|
+
/**
|
|
32
|
+
* `eleHook()` — create a reusable element-part directive that gives you
|
|
33
|
+
* full `$` (DollarChain) access to the host element.
|
|
34
|
+
*
|
|
35
|
+
* Returns a **function** that accepts user-supplied arguments and produces
|
|
36
|
+
* a lit-html directive result. Define the hook once, use it anywhere.
|
|
37
|
+
*
|
|
38
|
+
* The first argument to the mount callback (`$`) is always injected — it is
|
|
39
|
+
* a `DollarChain` bound to the host element. Any extra parameters you define
|
|
40
|
+
* become the arguments the returned function accepts at the call site, and
|
|
41
|
+
* they flow through to `onUpdate` on every re-render.
|
|
42
|
+
*
|
|
43
|
+
* While the mount callback or lifecycle methods are executing,
|
|
44
|
+
* `componentRunningStatus.isHookRunning` is set to `true`.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* // ── No args ──────────────────────────────────────────────────────
|
|
49
|
+
* const ripple = eleHook(($) => {
|
|
50
|
+
* $.on("click", (e) => { /* ripple animation */ });
|
|
51
|
+
* $.classes("has-ripple");
|
|
52
|
+
* return { onCleanup() { $.removeClass("has-ripple"); } };
|
|
53
|
+
* });
|
|
54
|
+
* html`<button ${ripple()}>Click me</button>`
|
|
55
|
+
*
|
|
56
|
+
* // ── With args ────────────────────────────────────────────────────
|
|
57
|
+
* const highlight = eleHook(($, color: string, pulse: boolean) => {
|
|
58
|
+
* $.style({ backgroundColor: color });
|
|
59
|
+
* if (pulse) $.classes("pulse");
|
|
60
|
+
* return {
|
|
61
|
+
* onUpdate(nextColor, nextPulse) {
|
|
62
|
+
* $.style({ backgroundColor: nextColor });
|
|
63
|
+
* nextPulse ? $.addClass("pulse") : $.removeClass("pulse");
|
|
64
|
+
* },
|
|
65
|
+
* };
|
|
66
|
+
* });
|
|
67
|
+
* html`<div ${highlight(color.val, isPulsing.val)}>Highlighted</div>`
|
|
68
|
+
*
|
|
69
|
+
* // ── Replacing attr() directive ───────────────────────────────────
|
|
70
|
+
* const myAttr = eleHook(($, attrs: AttrMap) => {
|
|
71
|
+
* $.attr(attrs);
|
|
72
|
+
* return { onUpdate(next) { $.attr(next); } };
|
|
73
|
+
* });
|
|
74
|
+
* html`<div ${myAttr({ disabled: true, role: "button" })}></div>`
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @template A - Tuple of user-supplied argument types.
|
|
78
|
+
* @param mountFn - Called once on first mount. Receives `$` (DollarChain)
|
|
79
|
+
* followed by the user-supplied args.
|
|
80
|
+
* @returns A function that accepts the user args and produces a directive result.
|
|
81
|
+
*/
|
|
82
|
+
export declare function eleHook<A extends any[] = []>(mountFn: EleHookMountFn<A>): (...args: A) => DirectiveResult;
|
|
83
|
+
export type { DirectiveResult };
|
|
84
|
+
//# sourceMappingURL=eleHook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eleHook.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/eleHook.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EAGhB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAK,KAAK,WAAW,EAAE,MAAM,KAAK,CAAC;AAI1C;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,GAAG,EAAE,GAAG,EAAE,IAAI;IACnD,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAChC,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,GAAG,EAAE,GAAG,EAAE,IAAI,CACjD,CAAC,EAAE,WAAW,EACd,GAAG,IAAI,EAAE,CAAC,KACP,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;AAoB5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,GAAG,EAAE,GAAG,EAAE,EAC1C,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,GACzB,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,eAAe,CAmEjC;AAED,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** A mutable ref container so we can swap handler identity without rebinding. */
|
|
2
|
+
export interface HandlerRef<T extends Function = Function> {
|
|
3
|
+
current: T | undefined;
|
|
4
|
+
}
|
|
5
|
+
/** Tracks a single bound event — its cleanup fn and handler ref for swapping. */
|
|
6
|
+
export interface BoundEntry {
|
|
7
|
+
handler: Function;
|
|
8
|
+
cleanup: () => void;
|
|
9
|
+
handlerRef?: HandlerRef;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Bind a single event listener on any EventTarget (element, window, document).
|
|
13
|
+
* Uses a stable wrapper + handlerRef so the handler can be swapped on re-render
|
|
14
|
+
* without touching the DOM listener.
|
|
15
|
+
*/
|
|
16
|
+
export declare function bindEvent(target: EventTarget, eventName: string, handler: Function): BoundEntry;
|
|
17
|
+
export declare function unbindEntry(entry: BoundEntry): void;
|
|
18
|
+
export declare function unbindAll(entries: Map<string, BoundEntry>): void;
|
|
19
|
+
/**
|
|
20
|
+
* Sync a map of event handlers onto a target element.
|
|
21
|
+
*
|
|
22
|
+
* - First-time keys: bound via `bindEvent`
|
|
23
|
+
* - Existing keys with changed handler: handler ref is swapped, no rebind
|
|
24
|
+
* - Keys removed from the map: unbound and deleted from entries
|
|
25
|
+
*
|
|
26
|
+
* Returns the updated entries map (same reference, mutated in place).
|
|
27
|
+
*/
|
|
28
|
+
export declare function syncEvents(target: EventTarget, events: Record<string, Function | undefined>, entries: Map<string, BoundEntry>): void;
|
|
29
|
+
//# sourceMappingURL=eventBinding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventBinding.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/eventBinding.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ;IACvD,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;CACxB;AAED,iFAAiF;AACjF,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,QAAQ,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAID;;;;GAIG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,QAAQ,GAChB,UAAU,CAcZ;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAEnD;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,IAAI,CAKhE;AAID;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC,EAC5C,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAC/B,IAAI,CA2BN"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { TemplateResult } from "lit-html";
|
|
2
|
+
import type { DirectiveResult } from "lit-html/directive.js";
|
|
3
|
+
/**
|
|
4
|
+
* Lifecycle object returned from the `htmlHook` mount callback.
|
|
5
|
+
*
|
|
6
|
+
* - `onUpdate` — called on every re-render after the initial mount,
|
|
7
|
+
* receiving the latest args passed at the call site.
|
|
8
|
+
* - `onCleanup` — called when the element is disconnected from the DOM.
|
|
9
|
+
*
|
|
10
|
+
* @template A - Tuple of user-supplied argument types.
|
|
11
|
+
*/
|
|
12
|
+
export type HtmlHookLifecycle<A extends any[] = []> = {
|
|
13
|
+
/** Called on every re-render after the initial mount with the latest args. */
|
|
14
|
+
onUpdate?: (...args: A) => void;
|
|
15
|
+
/** Called when the element is disconnected from the DOM. */
|
|
16
|
+
onCleanup?: () => void;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The render function passed to the `htmlHook` mount callback.
|
|
20
|
+
* Call this to push a lit-html template into the child part slot.
|
|
21
|
+
* Can be called synchronously during mount, or asynchronously later
|
|
22
|
+
* (from timers, fetch callbacks, observers, etc.).
|
|
23
|
+
*/
|
|
24
|
+
export type HtmlHookRenderFn = (template: TemplateResult) => void;
|
|
25
|
+
/**
|
|
26
|
+
* The mount callback signature for `htmlHook()`.
|
|
27
|
+
*
|
|
28
|
+
* The first argument `render` is always injected automatically — it pushes
|
|
29
|
+
* templates into the child slot. Any additional arguments are the
|
|
30
|
+
* user-supplied values passed at the template call site.
|
|
31
|
+
*
|
|
32
|
+
* Return an `HtmlHookLifecycle` object to handle updates and cleanup,
|
|
33
|
+
* or return nothing if the mount body is all you need.
|
|
34
|
+
*
|
|
35
|
+
* @template A - Tuple of user-supplied argument types.
|
|
36
|
+
*/
|
|
37
|
+
export type HtmlHookMountFn<A extends any[] = []> = (render: HtmlHookRenderFn, ...args: A) => HtmlHookLifecycle<A> | void;
|
|
38
|
+
/**
|
|
39
|
+
* `htmlHook()` — create a reusable child-part directive that lets you
|
|
40
|
+
* render HTML templates into a slot.
|
|
41
|
+
*
|
|
42
|
+
* Returns a **function** that accepts user-supplied arguments and produces
|
|
43
|
+
* a lit-html directive result. Define the hook once, use it anywhere.
|
|
44
|
+
*
|
|
45
|
+
* The first argument to the mount callback (`render`) is always injected —
|
|
46
|
+
* it pushes a `TemplateResult` into the child slot. Any extra parameters
|
|
47
|
+
* you define become the arguments the returned function accepts at the
|
|
48
|
+
* call site, and they flow through to `onUpdate` on every re-render.
|
|
49
|
+
*
|
|
50
|
+
* The `render` function can be called:
|
|
51
|
+
* - **Synchronously** during mount (content appears immediately)
|
|
52
|
+
* - **Asynchronously** from timers, fetch callbacks, observers, etc.
|
|
53
|
+
*
|
|
54
|
+
* While the mount callback or lifecycle methods are executing,
|
|
55
|
+
* `componentRunningStatus.isHookRunning` is set to `true`.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* // ── No args ──────────────────────────────────────────────────────
|
|
60
|
+
* const greeting = htmlHook((render) => {
|
|
61
|
+
* render(html`<h1>Hello, World!</h1>`);
|
|
62
|
+
* });
|
|
63
|
+
* html`<div>${greeting()}</div>`
|
|
64
|
+
*
|
|
65
|
+
* // ── With args ────────────────────────────────────────────────────
|
|
66
|
+
* const userCard = htmlHook((render, name: string, role: string) => {
|
|
67
|
+
* render(html`<div class="card">${name} — ${role}</div>`);
|
|
68
|
+
* return {
|
|
69
|
+
* onUpdate(nextName, nextRole) {
|
|
70
|
+
* render(html`<div class="card">${nextName} — ${nextRole}</div>`);
|
|
71
|
+
* },
|
|
72
|
+
* };
|
|
73
|
+
* });
|
|
74
|
+
* html`<section>${userCard(user.name, user.role)}</section>`
|
|
75
|
+
*
|
|
76
|
+
* // ── Async usage ──────────────────────────────────────────────────
|
|
77
|
+
* const asyncData = htmlHook((render, url: string) => {
|
|
78
|
+
* render(html`<p>Loading...</p>`);
|
|
79
|
+
* fetch(url)
|
|
80
|
+
* .then(r => r.json())
|
|
81
|
+
* .then(data => render(html`<pre>${JSON.stringify(data)}</pre>`));
|
|
82
|
+
* return {
|
|
83
|
+
* onUpdate(nextUrl) {
|
|
84
|
+
* render(html`<p>Loading...</p>`);
|
|
85
|
+
* fetch(nextUrl)
|
|
86
|
+
* .then(r => r.json())
|
|
87
|
+
* .then(data => render(html`<pre>${JSON.stringify(data)}</pre>`));
|
|
88
|
+
* },
|
|
89
|
+
* onCleanup() { /* cancel in-flight requests */ },
|
|
90
|
+
* };
|
|
91
|
+
* });
|
|
92
|
+
* html`<div>${asyncData(currentUrl.val)}</div>`
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* @template A - Tuple of user-supplied argument types.
|
|
96
|
+
* @param mountFn - Called once on first mount. Receives `render()` followed
|
|
97
|
+
* by the user-supplied args.
|
|
98
|
+
* @returns A function that accepts the user args and produces a directive result.
|
|
99
|
+
*/
|
|
100
|
+
export declare function htmlHook<A extends any[] = []>(mountFn: HtmlHookMountFn<A>): (...args: A) => DirectiveResult;
|
|
101
|
+
//# sourceMappingURL=htmlHook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"htmlHook.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/htmlHook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAM/B;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,GAAG,EAAE,GAAG,EAAE,IAAI;IACpD,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAChC,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;AAElE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,GAAG,EAAE,GAAG,EAAE,IAAI,CAClD,MAAM,EAAE,gBAAgB,EACxB,GAAG,IAAI,EAAE,CAAC,KACP,iBAAiB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;AAoBjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,GAAG,EAAE,GAAG,EAAE,EAC3C,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,GAC1B,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,eAAe,CA8FjC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { $, type DollarChain } from "./$";
|
|
2
|
+
export { type AnimatedIfConfig, type AnimatedXConfig, animatedIf, animatedX, } from "./animatedConditional";
|
|
3
|
+
export { type AttrMap, type AttrValue, attr, removeAttr, } from "./attrDirective";
|
|
4
|
+
export { type ClassEntry, type ClassesInput, classes, removeClasses, } from "./classesDirective";
|
|
5
|
+
export { type EleHookLifecycle, type EleHookMountFn, eleHook } from "./eleHook";
|
|
6
|
+
export { type HtmlHookLifecycle, type HtmlHookMountFn, type HtmlHookRenderFn, htmlHook, } from "./htmlHook";
|
|
7
|
+
export { type IntersectCallback, type IntersectOptions, onHidden, onIntersect, onVisible, } from "./intersectDirective";
|
|
8
|
+
export { type LazyLoadCallback, type LazyLoadOptions, lazyLoad, onScrolledIntoView, type ScrolledIntoViewCallback, type ScrolledIntoViewOptions, } from "./lazyLoadDirective";
|
|
9
|
+
export { type ConnectCallback, type DisconnectCallback, onConnect, onDisconnect, onUpdate, type UpdateCallback, } from "./lifecycleDirectives";
|
|
10
|
+
export { type MasonryGridOptions, type MasonryItemTemplate, type MasonryKeyFn, masonryGrid, } from "./masonryGrid";
|
|
11
|
+
export { type MemoKeys, type MemoTemplateFn, memoTemplate, } from "./memoTemplate";
|
|
12
|
+
export { type MatesCustomEventMap, type OnEventMap, on, removeOn, } from "./onDirective";
|
|
13
|
+
export { type OnParentMap, onParent } from "./onParentDirective";
|
|
14
|
+
export { renderSwitch, type SwitchCase, type SwitchEntry, } from "./renderSwitch";
|
|
15
|
+
export { removeStyle, type StyleMap, type StyleValue, style, } from "./styleDirective";
|
|
16
|
+
export { type TimerContent, timer } from "./timerDirective";
|
|
17
|
+
export { type VirtualGridOptions, type VirtualListOptions, type VirtualMasonryOptions, virtualGrid, virtualList, virtualMasonry, } from "./virtualHelpers";
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,KAAK,WAAW,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,UAAU,EACV,SAAS,GACV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,IAAI,EACJ,UAAU,GACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,OAAO,EACP,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,QAAQ,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,QAAQ,EACR,WAAW,EACX,SAAS,GACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,QAAQ,EACR,kBAAkB,EAClB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,KAAK,cAAc,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,EAAE,EACF,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,WAAW,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EACL,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,WAAW,EACX,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,GACN,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,WAAW,EACX,WAAW,EACX,cAAc,GACf,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export type IntersectCallback = () => void;
|
|
2
|
+
export interface IntersectOptions {
|
|
3
|
+
/** Called every time the element enters the viewport. */
|
|
4
|
+
onVisible?: IntersectCallback;
|
|
5
|
+
/** Called every time the element leaves the viewport. */
|
|
6
|
+
onHidden?: IntersectCallback;
|
|
7
|
+
/**
|
|
8
|
+
* Margin around the viewport in CSS syntax (e.g. `"200px"` or `"10%"`).
|
|
9
|
+
* Positive values trigger callbacks before the element fully crosses the
|
|
10
|
+
* viewport edge. Default: `"0px"`.
|
|
11
|
+
*/
|
|
12
|
+
rootMargin?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Intersection ratio threshold (0–1) at which callbacks fire.
|
|
15
|
+
* Default: `0`.
|
|
16
|
+
*/
|
|
17
|
+
threshold?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Attach an `IntersectionObserver` to an element and respond to both
|
|
21
|
+
* enter and exit viewport transitions.
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* html`<div ${onIntersect({
|
|
25
|
+
* onVisible() { player.play(); },
|
|
26
|
+
* onHidden() { player.pause(); },
|
|
27
|
+
* })}></div>`
|
|
28
|
+
*
|
|
29
|
+
* // With options
|
|
30
|
+
* html`<div ${onIntersect({
|
|
31
|
+
* onVisible() { prefetch(); },
|
|
32
|
+
* rootMargin: "200px",
|
|
33
|
+
* })}></div>`
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function onIntersect(options: IntersectOptions): import("lit-html/directive.js").DirectiveResult<import("lit-html/directive.js").DirectiveClass>;
|
|
37
|
+
/**
|
|
38
|
+
* Fire `callback` every time the element enters the viewport.
|
|
39
|
+
*
|
|
40
|
+
* ```ts
|
|
41
|
+
* // Infinite scroll sentinel
|
|
42
|
+
* html`<div ${onVisible(() => loadNextPage())}></div>`
|
|
43
|
+
*
|
|
44
|
+
* // Prefetch before fully visible
|
|
45
|
+
* html`<div ${onVisible(() => prefetch(), { rootMargin: "300px" })}></div>`
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @param callback - Called on every enter transition.
|
|
49
|
+
* @param options - Optional `rootMargin` / `threshold` tuning.
|
|
50
|
+
*/
|
|
51
|
+
export declare function onVisible(callback: IntersectCallback, options?: Pick<IntersectOptions, "rootMargin" | "threshold">): import("lit-html/directive.js").DirectiveResult<import("lit-html/directive.js").DirectiveClass>;
|
|
52
|
+
/**
|
|
53
|
+
* Fire `callback` every time the element leaves the viewport.
|
|
54
|
+
*
|
|
55
|
+
* ```ts
|
|
56
|
+
* // Pause when out of view
|
|
57
|
+
* html`<video ${onHidden(() => video.pause())}></video>`
|
|
58
|
+
*
|
|
59
|
+
* // Track when an ad leaves the screen
|
|
60
|
+
* html`<div ${onHidden(() => trackExit())}></div>`
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @param callback - Called on every exit transition.
|
|
64
|
+
* @param options - Optional `rootMargin` / `threshold` tuning.
|
|
65
|
+
*/
|
|
66
|
+
export declare function onHidden(callback: IntersectCallback, options?: Pick<IntersectOptions, "rootMargin" | "threshold">): import("lit-html/directive.js").DirectiveResult<import("lit-html/directive.js").DirectiveClass>;
|
|
67
|
+
//# sourceMappingURL=intersectDirective.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intersectDirective.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/intersectDirective.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,yDAAyD;IACzD,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,yDAAyD;IACzD,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA6CD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,gBAAgB,mGAEpD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,YAAY,GAAG,WAAW,CAAC,mGAG7D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,YAAY,GAAG,WAAW,CAAC,mGAG7D"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export type ScrolledIntoViewCallback = () => void;
|
|
2
|
+
export interface ScrolledIntoViewOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Margin around the viewport in CSS syntax (e.g. `"200px"` or `"10%"`).
|
|
5
|
+
* Positive values trigger the callback before the element is fully visible.
|
|
6
|
+
* Default: `"0px"`
|
|
7
|
+
*/
|
|
8
|
+
rootMargin?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Intersection ratio threshold (0–1) at which the callback fires.
|
|
11
|
+
* Default: `0`
|
|
12
|
+
*/
|
|
13
|
+
threshold?: number;
|
|
14
|
+
}
|
|
15
|
+
/** @deprecated Use `ScrolledIntoViewCallback` instead. */
|
|
16
|
+
export type LazyLoadCallback = ScrolledIntoViewCallback;
|
|
17
|
+
/** @deprecated Use `ScrolledIntoViewOptions` instead. */
|
|
18
|
+
export type LazyLoadOptions = ScrolledIntoViewOptions;
|
|
19
|
+
/**
|
|
20
|
+
* Fires `callback` each time the element transitions from hidden to visible
|
|
21
|
+
* in the viewport (a genuine invisible → visible crossing).
|
|
22
|
+
*
|
|
23
|
+
* - Does **not** fire on mount if the element is already in view.
|
|
24
|
+
* - Fires **again** every time the element re-enters the viewport after
|
|
25
|
+
* having left it — useful for infinite scroll, repeat animations, etc.
|
|
26
|
+
* - The `IntersectionObserver` is torn down automatically when the element
|
|
27
|
+
* disconnects from the DOM — no manual cleanup needed.
|
|
28
|
+
* - `options` are fixed at creation time and cannot change between renders;
|
|
29
|
+
* only the `callback` reference is updated on re-renders.
|
|
30
|
+
*
|
|
31
|
+
* @param callback - Called whenever the element scrolls into view.
|
|
32
|
+
* @param options - Optional `IntersectionObserver` tuning.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* // Infinite scroll — load next page when sentinel enters the viewport
|
|
37
|
+
* html`<div ${onScrolledIntoView(() => loadNextPage())}></div>`
|
|
38
|
+
*
|
|
39
|
+
* // Animate on enter
|
|
40
|
+
* html`<section ${onScrolledIntoView(() => el.classList.add("fade-in"))}></section>`
|
|
41
|
+
*
|
|
42
|
+
* // Lazy-load a heavy image
|
|
43
|
+
* html`<img ${onScrolledIntoView(() => { img.src = img.dataset.src!; })}
|
|
44
|
+
* data-src="/heavy.jpg" />`
|
|
45
|
+
*
|
|
46
|
+
* // Prefetch 300px before the element becomes visible
|
|
47
|
+
* html`<div ${onScrolledIntoView(() => prefetch(), { rootMargin: "300px" })}></div>`
|
|
48
|
+
*
|
|
49
|
+
* // Fire only when at least 50% of the element is visible
|
|
50
|
+
* html`<div ${onScrolledIntoView(() => trackImpression(), { threshold: 0.5 })}></div>`
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare function onScrolledIntoView(callback: ScrolledIntoViewCallback, options?: ScrolledIntoViewOptions): import("lit-html/directive.js").DirectiveResult<import("lit-html/directive.js").DirectiveClass>;
|
|
54
|
+
/**
|
|
55
|
+
* @deprecated Use `onScrolledIntoView()` instead.
|
|
56
|
+
*
|
|
57
|
+
* ```ts
|
|
58
|
+
* // Before
|
|
59
|
+
* html`<div ${lazyLoad(() => loadMore())}></div>`
|
|
60
|
+
*
|
|
61
|
+
* // After
|
|
62
|
+
* html`<div ${onScrolledIntoView(() => loadMore())}></div>`
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare function lazyLoad(callback: LazyLoadCallback, options?: LazyLoadOptions): import("lit-html/directive.js").DirectiveResult<import("lit-html/directive.js").DirectiveClass>;
|
|
66
|
+
//# sourceMappingURL=lazyLoadDirective.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazyLoadDirective.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/lazyLoadDirective.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,wBAAwB,GAAG,MAAM,IAAI,CAAC;AAElD,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,0DAA0D;AAC1D,MAAM,MAAM,gBAAgB,GAAG,wBAAwB,CAAC;AAExD,yDAAyD;AACzD,MAAM,MAAM,eAAe,GAAG,uBAAuB,CAAC;AAgEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,wBAAwB,EAClC,OAAO,CAAC,EAAE,uBAAuB,mGAGlC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,CAAC,EAAE,eAAe,mGAG1B"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export type ConnectCallback = (el: HTMLElement) => void;
|
|
2
|
+
export type DisconnectCallback = (el: HTMLElement) => void;
|
|
3
|
+
export type UpdateCallback = (el: HTMLElement) => void;
|
|
4
|
+
/**
|
|
5
|
+
* Fires the callback once when the element is first connected to the DOM.
|
|
6
|
+
* If the element is removed and re-added, the callback fires again.
|
|
7
|
+
*
|
|
8
|
+
* Useful for fetching data, focusing elements, or starting animations
|
|
9
|
+
* when a conditionally-rendered element appears.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* html`
|
|
14
|
+
* <div ${onConnect((el) => fetchData())}>
|
|
15
|
+
* ${content()}
|
|
16
|
+
* </div>
|
|
17
|
+
* `;
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function onConnect(callback: ConnectCallback): import("lit-html/directive.js").DirectiveResult<import("lit-html/directive.js").DirectiveClass>;
|
|
21
|
+
/**
|
|
22
|
+
* Fires the callback when the element is removed from the DOM.
|
|
23
|
+
* Always uses the latest callback passed — no stale closure issues.
|
|
24
|
+
*
|
|
25
|
+
* Useful for teardown logic on conditionally-rendered elements,
|
|
26
|
+
* cancelling in-flight requests, or saving state before removal.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* html`
|
|
31
|
+
* <div ${onDisconnect((el) => cancelRequest())}>
|
|
32
|
+
* ${content()}
|
|
33
|
+
* </div>
|
|
34
|
+
* `;
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function onDisconnect(callback: DisconnectCallback): import("lit-html/directive.js").DirectiveResult<import("lit-html/directive.js").DirectiveClass>;
|
|
38
|
+
/**
|
|
39
|
+
* Fires the callback on every re-render after the initial mount.
|
|
40
|
+
* Skips the first render (use `onConnect` for that).
|
|
41
|
+
* Resets after disconnection, so the first render after reconnect is
|
|
42
|
+
* also skipped.
|
|
43
|
+
*
|
|
44
|
+
* Useful for reacting to prop/state changes on a mounted element.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* html`
|
|
49
|
+
* <div ${onUpdate((el) => syncScroll(el))}>
|
|
50
|
+
* ${items()}
|
|
51
|
+
* </div>
|
|
52
|
+
* `;
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function onUpdate(callback: UpdateCallback): import("lit-html/directive.js").DirectiveResult<import("lit-html/directive.js").DirectiveClass>;
|
|
56
|
+
//# sourceMappingURL=lifecycleDirectives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycleDirectives.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/lifecycleDirectives.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,eAAe,GAAG,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC;AACxD,MAAM,MAAM,kBAAkB,GAAG,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC;AAC3D,MAAM,MAAM,cAAc,GAAG,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC;AA+CvD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,eAAe,mGAElD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,kBAAkB,mGAExD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,cAAc,mGAEhD"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { TemplateResult } from "lit-html";
|
|
2
|
+
/**
|
|
3
|
+
* Options for `masonryGrid`.
|
|
4
|
+
*/
|
|
5
|
+
export interface MasonryGridOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Number of columns.
|
|
8
|
+
* @default 3
|
|
9
|
+
*/
|
|
10
|
+
columns?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Gap between items in pixels.
|
|
13
|
+
* @default 12
|
|
14
|
+
*/
|
|
15
|
+
gap?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Optional CSS class applied to the outer container.
|
|
18
|
+
*/
|
|
19
|
+
containerClass?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional inline styles merged onto the outer container.
|
|
22
|
+
*/
|
|
23
|
+
containerStyle?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Render function for each item in the masonry grid.
|
|
27
|
+
* Receives the item and its index in the source array.
|
|
28
|
+
*/
|
|
29
|
+
export type MasonryItemTemplate<T> = (item: T, index: number) => TemplateResult;
|
|
30
|
+
/**
|
|
31
|
+
* Key function for stable item identity (same as lit-html's KeyFn).
|
|
32
|
+
*/
|
|
33
|
+
export type MasonryKeyFn<T> = (item: T, index: number) => unknown;
|
|
34
|
+
/**
|
|
35
|
+
* `masonryGrid` — pure CSS masonry layout using `column-count`.
|
|
36
|
+
*
|
|
37
|
+
* No virtualisation, no JavaScript layout computation — just CSS columns.
|
|
38
|
+
* Every item is rendered in the DOM and the browser handles column
|
|
39
|
+
* distribution and reflow automatically.
|
|
40
|
+
*
|
|
41
|
+
* Best for small-to-medium lists (< 500 items) where you want a true
|
|
42
|
+
* masonry look without the complexity of virtualisation. For large lists,
|
|
43
|
+
* use `virtualMasonry` or `repeatVirtual` with `layout: { type: "masonry" }`
|
|
44
|
+
* instead.
|
|
45
|
+
*
|
|
46
|
+
* ---
|
|
47
|
+
*
|
|
48
|
+
* ## Syntax
|
|
49
|
+
*
|
|
50
|
+
* Same overloaded signatures as `repeat`:
|
|
51
|
+
*
|
|
52
|
+
* ```ts
|
|
53
|
+
* // Without key function
|
|
54
|
+
* html`<div>
|
|
55
|
+
* ${masonryGrid(
|
|
56
|
+
* photos,
|
|
57
|
+
* (photo) => html`<img src=${photo.url} style="width:100%;border-radius:8px;" />`,
|
|
58
|
+
* { columns: 4, gap: 16 },
|
|
59
|
+
* )}
|
|
60
|
+
* </div>`
|
|
61
|
+
*
|
|
62
|
+
* // With key function (recommended)
|
|
63
|
+
* html`<div>
|
|
64
|
+
* ${masonryGrid(
|
|
65
|
+
* photos,
|
|
66
|
+
* (photo) => photo.id,
|
|
67
|
+
* (photo) => html`
|
|
68
|
+
* <div style="border-radius:8px;overflow:hidden;">
|
|
69
|
+
* <img src=${photo.url} style="width:100%;display:block;" />
|
|
70
|
+
* <p style="padding:8px;margin:0;">${photo.title}</p>
|
|
71
|
+
* </div>
|
|
72
|
+
* `,
|
|
73
|
+
* { columns: 3, gap: 12 },
|
|
74
|
+
* )}
|
|
75
|
+
* </div>`
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* ---
|
|
79
|
+
*
|
|
80
|
+
* ## Options
|
|
81
|
+
*
|
|
82
|
+
* | Option | Type | Default | Description |
|
|
83
|
+
* |------------------|----------|---------|---------------------------------------|
|
|
84
|
+
* | `columns` | `number` | `3` | Number of CSS columns. |
|
|
85
|
+
* | `gap` | `number` | `12` | Gap (px) between columns and rows. |
|
|
86
|
+
* | `containerClass` | `string` | `""` | CSS class on the outer container. |
|
|
87
|
+
* | `containerStyle` | `string` | `""` | Extra inline styles on the container. |
|
|
88
|
+
*
|
|
89
|
+
* ---
|
|
90
|
+
*
|
|
91
|
+
* ## How it works
|
|
92
|
+
*
|
|
93
|
+
* Uses CSS `column-count` + `break-inside: avoid` on each item wrapper.
|
|
94
|
+
* This is the simplest masonry implementation — zero JS layout, zero
|
|
95
|
+
* absolute positioning, pure CSS column flow. Items fill columns
|
|
96
|
+
* top-to-bottom, left-to-right (browser's native column distribution).
|
|
97
|
+
*
|
|
98
|
+
* ### Caveats
|
|
99
|
+
*
|
|
100
|
+
* - **Column order is top-to-bottom, not left-to-right.** Item 1 goes
|
|
101
|
+
* to column 1 top, item 2 below it, etc. — not item 1 col 1, item 2
|
|
102
|
+
* col 2, item 3 col 3. This is how CSS columns work. If you need
|
|
103
|
+
* left-to-right order, use `virtualMasonry` which uses JS layout.
|
|
104
|
+
*
|
|
105
|
+
* - **No virtualisation.** All items are in the DOM. For lists > 500 items,
|
|
106
|
+
* use `virtualMasonry` or `repeatVirtual({ layout: { type: "masonry" } })`.
|
|
107
|
+
*
|
|
108
|
+
* - **Responsive columns** require re-rendering with a different `columns`
|
|
109
|
+
* value — CSS `column-count` doesn't support `auto` based on width.
|
|
110
|
+
* Use `onWindowResize` to update the column count reactively.
|
|
111
|
+
*/
|
|
112
|
+
export declare function masonryGrid<T>(items: readonly T[], template: MasonryItemTemplate<T>, options?: MasonryGridOptions): unknown;
|
|
113
|
+
export declare function masonryGrid<T>(items: readonly T[], keyFn: MasonryKeyFn<T>, template: MasonryItemTemplate<T>, options?: MasonryGridOptions): unknown;
|
|
114
|
+
//# sourceMappingURL=masonryGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"masonryGrid.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/masonryGrid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAO/C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,cAAc,CAAC;AAEhF;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;AA2IlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAChC,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC;AACX,wBAAgB,WAAW,CAAC,CAAC,EAC3B,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,EACtB,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAChC,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC"}
|