@stacksjs/browser 0.66.0 → 0.68.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.
@@ -1,47 +0,0 @@
1
- /**
2
- * Throttle a function.
3
- *
4
- * @param {Function} fn - The function to throttle.
5
- * @param {number} [wait] - The time to wait between function calls.
6
- * @returns {Function} - A new function that throttles the calls to the original function.
7
- *
8
- * @example
9
- * ```ts
10
- * // logs window dimensions at most every 250ms
11
- * window.addEventListener(
12
- * "resize",
13
- * throttle(function (evt) {
14
- * console.log(window.innerWidth)
15
- * console.log(window.innerHeight)
16
- * }, 250)
17
- * )
18
- * ```
19
- */
20
- // eslint-disable-next-line ts/no-unsafe-function-type
21
- export function throttle(fn: Function, wait = 300) {
22
- let inThrottle: boolean
23
- let lastFn: ReturnType<typeof setTimeout>
24
- let lastTime: number
25
-
26
- return function (this: unknown, ...args: any[]): void {
27
- if (!inThrottle) {
28
- fn.apply(this, args)
29
-
30
- lastTime = Date.now()
31
- inThrottle = true
32
- }
33
- else {
34
- clearTimeout(lastFn)
35
-
36
- lastFn = setTimeout(
37
- () => {
38
- if (Date.now() - lastTime >= wait) {
39
- fn.apply(this, args) // Use 'this' directly
40
- lastTime = Date.now()
41
- }
42
- },
43
- Math.max(wait - (Date.now() - lastTime), 0),
44
- )
45
- }
46
- }
47
- }
@@ -1,258 +0,0 @@
1
- export {
2
- asyncComputed,
3
- autoResetRef,
4
- breakpointsAntDesign,
5
- breakpointsBootstrapV5,
6
- breakpointsMasterCss,
7
- breakpointsQuasar,
8
- breakpointsSematic,
9
- breakpointsTailwind,
10
- breakpointsVuetify,
11
- cloneFnJSON,
12
- computedAsync,
13
- computedEager,
14
- computedInject,
15
- computedWithControl,
16
- controlledComputed,
17
- controlledRef,
18
- createEventHook,
19
- createFetch,
20
- createGlobalState,
21
- createInjectionState,
22
- createReactiveFn,
23
- createReusableTemplate,
24
- createSharedComposable,
25
- createTemplatePromise,
26
- createUnrefFn,
27
- customStorageEventName,
28
- debouncedRef,
29
- debouncedWatch,
30
- defaultDocument,
31
- defaultLocation,
32
- defaultNavigator,
33
- defaultWindow,
34
- eagerComputed,
35
- executeTransition,
36
- extendRef,
37
- formatTimeAgo,
38
- getSSRHandler,
39
- ignorableWatch,
40
- injectLocal,
41
- isDefined,
42
- makeDestructurable,
43
- mapGamepadToXbox360Controller,
44
- onClickOutside,
45
- onKeyDown,
46
- onKeyPressed,
47
- onKeyStroke,
48
- onKeyUp,
49
- onLongPress,
50
- onStartTyping,
51
- pausableWatch,
52
- provideLocal,
53
- reactify,
54
- reactifyObject,
55
- reactiveComputed,
56
- reactiveOmit,
57
- reactivePick,
58
- refAutoReset,
59
- refDebounced,
60
- refDefault,
61
- refThrottled,
62
- refWithControl,
63
- resolveRef,
64
- resolveUnref,
65
- setSSRHandler,
66
- syncRef,
67
- syncRefs,
68
- templateRef,
69
- throttledRef,
70
- throttledWatch,
71
- toReactive,
72
- tryOnBeforeMount,
73
- tryOnBeforeUnmount,
74
- tryOnMounted,
75
- tryOnScopeDispose,
76
- tryOnUnmounted,
77
- unrefElement,
78
- until,
79
- useActiveElement,
80
- useAnimate,
81
- useArrayDifference,
82
- useArrayEvery,
83
- useArrayFilter,
84
- useArrayFind,
85
- useArrayFindIndex,
86
- useArrayIncludes,
87
- useArrayMap,
88
- useArrayReduce,
89
- useArraySome,
90
- useArrayUnique,
91
- useAsyncQueue,
92
- useAsyncState,
93
- useBase64,
94
- useBattery,
95
- useBluetooth,
96
- useBreakpoints,
97
- useBroadcastChannel,
98
- useBrowserLocation,
99
- useCached,
100
- useClipboard,
101
- useClipboardItems,
102
- useCloned,
103
- useColorMode,
104
- useConfirmDialog,
105
- useCounter,
106
- useCssVar,
107
- useCurrentElement,
108
- useCycleList,
109
- useDark,
110
- useDateFormat,
111
- useDebounce,
112
- useDebouncedRefHistory,
113
- useDebounceFn,
114
- useDeviceMotion,
115
- useDeviceOrientation,
116
- useDevicePixelRatio,
117
- useDevicesList,
118
- useDisplayMedia,
119
- useDocumentVisibility,
120
- useDraggable,
121
- useDropZone,
122
- useElementBounding,
123
- useElementByPoint,
124
- useElementHover,
125
- useElementSize,
126
- useElementVisibility,
127
- useEventBus,
128
- useEventListener,
129
- useEventSource,
130
- useEyeDropper,
131
- useFavicon,
132
- useFetch,
133
- useFileDialog,
134
- useFileSystemAccess,
135
- useFocus,
136
- useFocusWithin,
137
- useFps,
138
- useFullscreen,
139
- useGamepad,
140
- useGeolocation,
141
- useIdle,
142
- useImage,
143
- useInfiniteScroll,
144
- useIntersectionObserver,
145
- useInterval,
146
- useIntervalFn,
147
- useKeyModifier,
148
- useLastChanged,
149
- useLocalStorage,
150
- useMagicKeys,
151
- useManualRefHistory,
152
- useMediaControls,
153
- useMediaQuery,
154
- useMemoize,
155
- useMemory,
156
- useMounted,
157
- useMouse,
158
- useMouseInElement,
159
- useMousePressed,
160
- useMutationObserver,
161
- useNavigatorLanguage,
162
- useNetwork,
163
- useNow,
164
- useObjectUrl,
165
- useOffsetPagination,
166
- useOnline,
167
- usePageLeave,
168
- useParallax,
169
- useParentElement,
170
- usePerformanceObserver,
171
- usePermission,
172
- usePointer,
173
- usePointerLock,
174
- usePointerSwipe,
175
- usePreferredColorScheme,
176
- usePreferredContrast,
177
- usePreferredDark,
178
- usePreferredLanguages,
179
- usePreferredReducedMotion,
180
- usePrevious,
181
- useRafFn,
182
- useRefHistory,
183
- useResizeObserver,
184
- useScreenOrientation,
185
- useScreenSafeArea,
186
- useScriptTag,
187
- useScroll,
188
- useScrollLock,
189
- useSessionStorage,
190
- useShare,
191
- useSorted,
192
- useSpeechRecognition,
193
- useSpeechSynthesis,
194
- useStepper,
195
- useStorage,
196
- useStorageAsync,
197
- useStyleTag,
198
- useSupported,
199
- useSwipe,
200
- useTemplateRefsList,
201
- useTextareaAutosize,
202
- useTextDirection,
203
- useTextSelection,
204
- useThrottle,
205
- useThrottledRefHistory,
206
- useThrottleFn,
207
- useTimeAgo,
208
- useTimeout,
209
- useTimeoutFn,
210
- useTimeoutPoll,
211
- useTimestamp,
212
- useTitle,
213
- useToggle,
214
- useToNumber,
215
- useToString,
216
- useTransition,
217
- useUrlSearchParams,
218
- useUserMedia,
219
- useVibrate,
220
- useVirtualList,
221
- useVModel,
222
- useVModels,
223
- useWakeLock,
224
- useWebNotification,
225
- useWebSocket,
226
- useWebWorker,
227
- useWebWorkerFn,
228
- useWindowFocus,
229
- useWindowScroll,
230
- useWindowSize,
231
- watchArray,
232
- watchAtMost,
233
- watchDebounced,
234
- watchDeep,
235
- watchIgnorable,
236
- watchImmediate,
237
- watchOnce,
238
- watchPausable,
239
- watchThrottled,
240
- watchTriggerable,
241
- watchWithFilter,
242
- whenever,
243
- } from '@vueuse/core'
244
-
245
- export type {
246
- // Head,
247
- HeadObject,
248
- HeadObjectPlain,
249
- } from '@vueuse/head'
250
-
251
- export {
252
- createHead,
253
- Head,
254
- HeadVuePlugin,
255
- renderHeadToString,
256
- } from '@vueuse/head'
257
-
258
- export { default as readableSize } from 'pretty-bytes'