@stacksjs/stx 0.2.5 → 0.2.6
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/a11y.d.ts +2 -6
- package/dist/analytics.d.ts +1 -1
- package/dist/analyzer.d.ts +1 -1
- package/dist/animation.d.ts +10 -86
- package/dist/app.d.ts +2 -4
- package/dist/assets.d.ts +1 -1
- package/dist/ast.d.ts +3 -24
- package/dist/async-components.d.ts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/browser-composables.d.ts +6 -4
- package/dist/build-optimizer.d.ts +4 -29
- package/dist/build-views.d.ts +20 -1
- package/dist/bundle-analyzer/collector.d.ts +1 -1
- package/dist/bundle-analyzer/index.d.ts +40 -4
- package/dist/bundle-analyzer/report.d.ts +1 -1
- package/dist/bundle-analyzer/treemap.d.ts +1 -1
- package/dist/caching.d.ts +1 -1
- package/dist/cli.js +1323 -511
- package/dist/client/directive.d.ts +1 -1
- package/dist/client/index.d.ts +6 -1
- package/dist/client/router.d.ts +3 -11
- package/dist/client/stx-router.browser.d.ts +1 -0
- package/dist/client-script.d.ts +2 -1
- package/dist/client.d.ts +2 -2
- package/dist/component-hmr.d.ts +4 -18
- package/dist/components.d.ts +1 -1
- package/dist/composables/index.d.ts +114 -1
- package/dist/composables/use-battery.d.ts +1 -1
- package/dist/composables/use-broadcast-channel.d.ts +2 -2
- package/dist/composables/use-clipboard.d.ts +1 -1
- package/dist/composables/use-color-mode.d.ts +52 -0
- package/dist/composables/use-cookie.d.ts +1 -1
- package/dist/composables/use-device-orientation.d.ts +1 -1
- package/dist/composables/use-event-listener.d.ts +35 -0
- package/dist/composables/use-event-source.d.ts +1 -1
- package/dist/composables/use-eye-dropper.d.ts +3 -2
- package/dist/composables/use-fetch.d.ts +1 -1
- package/dist/composables/use-fullscreen.d.ts +1 -1
- package/dist/composables/use-geolocation.d.ts +1 -1
- package/dist/composables/use-idle.d.ts +2 -2
- package/dist/composables/use-intersection-observer.d.ts +1 -1
- package/dist/composables/use-keyboard.d.ts +1 -2
- package/dist/composables/use-media-query.d.ts +1 -1
- package/dist/composables/use-meta.d.ts +35 -0
- package/dist/composables/use-mouse.d.ts +1 -1
- package/dist/composables/use-mutation-observer.d.ts +1 -1
- package/dist/composables/use-network.d.ts +1 -1
- package/dist/composables/use-notification.d.ts +10 -1
- package/dist/composables/use-permissions.d.ts +17 -7
- package/dist/composables/use-query.d.ts +43 -0
- package/dist/composables/use-resize-observer.d.ts +1 -1
- package/dist/composables/use-router.d.ts +59 -0
- package/dist/composables/use-share.d.ts +1 -1
- package/dist/composables/use-speech.d.ts +1 -1
- package/dist/composables/use-storage.d.ts +1 -1
- package/dist/composables/use-text-selection.d.ts +1 -1
- package/dist/composables/use-timer.d.ts +92 -0
- package/dist/composables/use-utilities.d.ts +103 -0
- package/dist/composables/use-wake-lock.d.ts +1 -1
- package/dist/composables/use-websocket.d.ts +3 -3
- package/dist/composables/use-window.d.ts +1 -1
- package/dist/composables.d.ts +10 -7
- package/dist/composition-api.d.ts +1 -14
- package/dist/computed.d.ts +10 -4
- package/dist/conditionals.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/craft-bridge.d.ts +1 -1
- package/dist/craft-compiler.d.ts +6 -3
- package/dist/craft-components.d.ts +1 -8
- package/dist/craft-entry.d.ts +1 -1
- package/dist/craft-ssr.d.ts +1 -1
- package/dist/csp.d.ts +2 -2
- package/dist/csrf.d.ts +1 -1
- package/dist/custom-directives.d.ts +1 -1
- package/dist/database.d.ts +8 -26
- package/dist/defer.d.ts +1 -1
- package/dist/deploy/config-generators.d.ts +1 -1
- package/dist/deploy/index.d.ts +6 -3
- package/dist/deploy/netlify.d.ts +1 -1
- package/dist/dev-server/crosswind.d.ts +11 -1
- package/dist/dev-server/index.d.ts +16 -1
- package/dist/dev-server/keyboard-shortcuts.d.ts +1 -1
- package/dist/dev-server/native-window.d.ts +1 -1
- package/dist/dev-server/port-utils.d.ts +2 -2
- package/dist/dev-server/terminal-colors.d.ts +1 -5
- package/dist/dev-server/theme-selector.d.ts +1 -1
- package/dist/dev-server/types.d.ts +3 -8
- package/dist/dev-server.d.ts +1 -4
- package/dist/devtools.d.ts +4 -1
- package/dist/directive-api.d.ts +3 -3
- package/dist/docs.d.ts +2 -2
- package/dist/dynamic-components.d.ts +1 -1
- package/dist/edge-runtime.d.ts +3 -3
- package/dist/env.d.ts +1 -1
- package/dist/error-boundaries.d.ts +1 -1
- package/dist/error-handling.d.ts +14 -1
- package/dist/errors/codes.d.ts +2 -17
- package/dist/errors/formatter.d.ts +1 -1
- package/dist/errors/index.d.ts +13 -1
- package/dist/errors/logger.d.ts +2 -15
- package/dist/errors/sanitizer.d.ts +1 -1
- package/dist/errors/types.d.ts +1 -1
- package/dist/events.d.ts +1 -1
- package/dist/expressions.d.ts +64 -90
- package/dist/formatter.d.ts +1 -1
- package/dist/forms-validation.d.ts +23 -24
- package/dist/forms.d.ts +5 -22
- package/dist/head.d.ts +5 -1
- package/dist/heatmap.d.ts +4 -7
- package/dist/hot-reload.d.ts +3 -8
- package/dist/hydration-runtime.d.ts +1 -1
- package/dist/hydration.d.ts +5 -32
- package/dist/i18n.d.ts +1 -9
- package/dist/image-optimization/build-plugin.d.ts +2 -2
- package/dist/image-optimization/component.d.ts +2 -2
- package/dist/image-optimization/directive.d.ts +2 -2
- package/dist/image-optimization/index.d.ts +55 -1
- package/dist/image-optimization/processor.d.ts +9 -4
- package/dist/includes.d.ts +1 -1
- package/dist/index.d.ts +29 -1
- package/dist/index.js +1387 -542
- package/dist/init.d.ts +1 -1
- package/dist/interactive.d.ts +1 -1
- package/dist/internal-markdown.d.ts +1 -1
- package/dist/js-ts.d.ts +1 -1
- package/dist/jsx-runtime.d.ts +1 -20
- package/dist/keep-alive.d.ts +1 -1
- package/dist/lazy-loader.d.ts +3 -35
- package/dist/loading-indicator.d.ts +2 -1
- package/dist/loops.d.ts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/media/client/blur-up.d.ts +1 -1
- package/dist/media/client/index.d.ts +17 -1
- package/dist/media/client/lazy-load.d.ts +1 -1
- package/dist/media/client/upload-handler.d.ts +1 -1
- package/dist/media/image/component.d.ts +2 -4
- package/dist/media/image/directive.d.ts +1 -1
- package/dist/media/image/editing.d.ts +1 -1
- package/dist/media/image/index.d.ts +25 -1
- package/dist/media/image/placeholder.d.ts +1 -1
- package/dist/media/image/processor/cache.d.ts +3 -4
- package/dist/media/image/processor/index.d.ts +9 -1
- package/dist/media/image/processor/optimizer.d.ts +2 -2
- package/dist/media/image/processor/responsive.d.ts +3 -2
- package/dist/media/image/srcset.d.ts +6 -4
- package/dist/media/index.d.ts +37 -1
- package/dist/media/manager/embed.d.ts +1 -1
- package/dist/media/protected/component.d.ts +2 -3
- package/dist/media/protected/index.d.ts +14 -1
- package/dist/media/protected/signature.d.ts +2 -2
- package/dist/media/shared/cache.d.ts +1 -1
- package/dist/media/shared/hash.d.ts +1 -1
- package/dist/media/shared/index.d.ts +6 -1
- package/dist/media/types.d.ts +16 -72
- package/dist/media/upload/component.d.ts +2 -16
- package/dist/media/upload/index.d.ts +8 -1
- package/dist/media/video/directive.d.ts +1 -1
- package/dist/media/video/index.d.ts +11 -2
- package/dist/media/video/processor/cache.d.ts +3 -4
- package/dist/media/video/processor/index.d.ts +9 -1
- package/dist/media/video/processor/streaming.d.ts +2 -2
- package/dist/media/video/processor/thumbnail.d.ts +2 -2
- package/dist/media/video/processor/transcoder.d.ts +2 -2
- package/dist/method-spoofing.d.ts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/native-build.d.ts +3 -6
- package/dist/parser/directive-parser.d.ts +1 -1
- package/dist/parser/expression-parser.d.ts +2 -1
- package/dist/parser/index.d.ts +14 -1
- package/dist/parser/tokenizer.d.ts +2 -18
- package/dist/partial-hydration.d.ts +5 -6
- package/dist/performance-utils.d.ts +5 -18
- package/dist/plugin-system.d.ts +2 -8
- package/dist/plugin.d.ts +1 -1
- package/dist/precompiler.d.ts +2 -67
- package/dist/process.d.ts +12 -2
- package/dist/production-build.d.ts +1 -37
- package/dist/props.d.ts +3 -30
- package/dist/pwa/audit.d.ts +1 -1
- package/dist/pwa/directives.d.ts +1 -1
- package/dist/pwa/icons.d.ts +7 -4
- package/dist/pwa/index.d.ts +46 -1
- package/dist/pwa/inject.d.ts +1 -1
- package/dist/pwa/manifest.d.ts +1 -1
- package/dist/pwa/offline.d.ts +1 -1
- package/dist/pwa/precache.d.ts +1 -1
- package/dist/pwa/service-worker.d.ts +1 -1
- package/dist/pwa/workbox-strategies.d.ts +1 -1
- package/dist/pwa/workbox.d.ts +1 -10
- package/dist/pwa.d.ts +1 -1
- package/dist/pwa.js +1242 -430
- package/dist/reactive-bindings.d.ts +1 -1
- package/dist/reactive.d.ts +1 -1
- package/dist/reactivity.d.ts +6 -50
- package/dist/release.d.ts +1 -1
- package/dist/route-middleware.d.ts +3 -3
- package/dist/router.d.ts +1 -1
- package/dist/routes.d.ts +2 -2
- package/dist/runtime.d.ts +4 -4
- package/dist/safe-evaluator.d.ts +1 -4
- package/dist/scaffolding.d.ts +1 -1
- package/dist/seo.d.ts +1 -5
- package/dist/serve.d.ts +1 -1
- package/dist/server-components.d.ts +1 -1
- package/dist/signals.d.ts +8 -168
- package/dist/slots.d.ts +2 -2
- package/dist/source-maps.d.ts +3 -22
- package/dist/spa-shell.d.ts +20 -0
- package/dist/ssg.d.ts +4 -6
- package/dist/ssg.js +1242 -430
- package/dist/ssr.d.ts +6 -14
- package/dist/state-management.d.ts +5 -45
- package/dist/stores-client.d.ts +3 -3
- package/dist/story/addons.d.ts +1 -1
- package/dist/story/analytics.d.ts +4 -11
- package/dist/story/auto-stories.d.ts +1 -1
- package/dist/story/bookmarks.d.ts +2 -6
- package/dist/story/bun-test.d.ts +1 -1
- package/dist/story/cli.d.ts +0 -25
- package/dist/story/collect/analyzer.d.ts +1 -1
- package/dist/story/collect/index.d.ts +5 -1
- package/dist/story/collect/parser.d.ts +1 -1
- package/dist/story/collect/scanner.d.ts +1 -1
- package/dist/story/collect/tree.d.ts +2 -2
- package/dist/story/commands/build.d.ts +1 -1
- package/dist/story/commands/dev.d.ts +1 -1
- package/dist/story/commands/index.d.ts +4 -1
- package/dist/story/commands/preview.d.ts +1 -1
- package/dist/story/compiled-output.d.ts +1 -1
- package/dist/story/composition.d.ts +1 -1
- package/dist/story/config-watcher.d.ts +1 -1
- package/dist/story/config.d.ts +2 -2
- package/dist/story/context.d.ts +1 -1
- package/dist/story/controls/index.d.ts +1 -1
- package/dist/story/crosswind.d.ts +1 -1
- package/dist/story/desktop-preview.d.ts +1 -1
- package/dist/story/docs-generator.d.ts +1 -1
- package/dist/story/errors.d.ts +1 -1
- package/dist/story/figma-export.d.ts +2 -2
- package/dist/story/generator.d.ts +1 -1
- package/dist/story/hmr.d.ts +1 -1
- package/dist/story/hot-swap.d.ts +1 -1
- package/dist/story/index.d.ts +49 -1
- package/dist/story/interactions.d.ts +1 -1
- package/dist/story/keyboard-shortcuts.d.ts +1 -1
- package/dist/story/output.d.ts +1 -1
- package/dist/story/performance.d.ts +3 -12
- package/dist/story/presets.d.ts +3 -8
- package/dist/story/props-validation.d.ts +11 -1
- package/dist/story/renderer.d.ts +1 -1
- package/dist/story/search-index.d.ts +2 -2
- package/dist/story/search.d.ts +2 -2
- package/dist/story/server.d.ts +1 -1
- package/dist/story/setup.d.ts +1 -1
- package/dist/story/snapshots.d.ts +1 -1
- package/dist/story/testing.d.ts +1 -1
- package/dist/story/theme.d.ts +1 -1
- package/dist/story/types.d.ts +3 -12
- package/dist/story/ui/code-panel.d.ts +1 -1
- package/dist/story/ui/controls-panel.d.ts +1 -1
- package/dist/story/ui/index.d.ts +5 -1
- package/dist/story/ui/navigation.d.ts +1 -1
- package/dist/story/ui/preview.d.ts +1 -1
- package/dist/story/visual-testing.d.ts +1 -1
- package/dist/streaming.d.ts +0 -59
- package/dist/suspense.d.ts +1 -1
- package/dist/teleport.d.ts +1 -1
- package/dist/testing.d.ts +62 -80
- package/dist/transitions.d.ts +1 -1
- package/dist/type-checker.d.ts +2 -26
- package/dist/types/component-types.d.ts +3 -3
- package/dist/types/config-types.d.ts +15 -30
- package/dist/types/context-types.d.ts +6 -5
- package/dist/types/csp-types.d.ts +2 -2
- package/dist/types/directive-types.d.ts +5 -5
- package/dist/types/index.d.ts +21 -1
- package/dist/types/pwa-types.d.ts +1 -6
- package/dist/types.d.ts +28 -1
- package/dist/typescript-templates.d.ts +1 -34
- package/dist/utils.d.ts +2 -1
- package/dist/validator.d.ts +1 -1
- package/dist/variable-extractor.d.ts +1 -1
- package/dist/view-composers.d.ts +1 -1
- package/dist/virtual-scrolling.d.ts +4 -1
- package/dist/visual-editor.d.ts +2 -30
- package/dist/visual-testing.d.ts +4 -1
- package/dist/vue-template.d.ts +1 -1
- package/dist/web-components/css-scoping.d.ts +1 -1
- package/dist/web-components/index.d.ts +10 -1
- package/dist/web-components/reactive-generator.d.ts +1 -1
- package/dist/web-components.d.ts +1 -1
- package/dist/x-element.d.ts +13 -6
- package/package.json +4 -4
package/dist/client/index.d.ts
CHANGED
|
@@ -3,5 +3,10 @@
|
|
|
3
3
|
* This can be injected into pages or served as a static file
|
|
4
4
|
*/
|
|
5
5
|
export declare function getRouterScript(): string;
|
|
6
|
+
/**
|
|
7
|
+
* STX Client-Side Modules
|
|
8
|
+
*
|
|
9
|
+
* Browser-side functionality for STX applications.
|
|
10
|
+
*/
|
|
6
11
|
export * from './router';
|
|
7
|
-
export * from './directive';
|
|
12
|
+
export * from './directive';
|
package/dist/client/router.d.ts
CHANGED
|
@@ -18,19 +18,11 @@ export declare interface RouterOptions {
|
|
|
18
18
|
onError?: (error: Error, url: string) => void
|
|
19
19
|
}
|
|
20
20
|
declare class STXRouter {
|
|
21
|
-
private options: Required<RouterOptions>;
|
|
22
|
-
private cache: Map<string, CacheEntry>;
|
|
23
|
-
private isNavigating: any;
|
|
24
|
-
private currentUrl: string;
|
|
25
21
|
constructor(options?: RouterOptions);
|
|
26
22
|
init(): void;
|
|
27
|
-
navigate(url: string, pushState?:
|
|
23
|
+
navigate(url: string, pushState?: boolean): Promise<void>;
|
|
28
24
|
prefetch(url: string): Promise<void>;
|
|
29
25
|
clearCache(): void;
|
|
30
|
-
private handleClick(event: MouseEvent): void;
|
|
31
|
-
private handlePopState(event: PopStateEvent): void;
|
|
32
|
-
private fetchPage(url: string): Promise<{ html: string; title: string } | null>;
|
|
33
|
-
private swapContent(content: { html: string; title: string }): Promise<void>;
|
|
34
|
-
private cacheCurrentPage(): void;
|
|
35
26
|
}
|
|
36
|
-
|
|
27
|
+
// Export for manual use
|
|
28
|
+
export { STXRouter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/dist/client-script.d.ts
CHANGED
package/dist/client.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ export declare function preloadIslandHandlers(handlers: IslandHandlers): void;
|
|
|
13
13
|
/**
|
|
14
14
|
* Island handler registry
|
|
15
15
|
*/
|
|
16
|
-
declare type IslandHandlers = Record<string, () => Promise<any
|
|
16
|
+
declare type IslandHandlers = Record<string, () => Promise<any>>;
|
|
17
17
|
/**
|
|
18
18
|
* Island hydration function
|
|
19
19
|
*/
|
|
20
|
-
declare type IslandHydrationFn = (element: any, props: any) => void | Promise<void
|
|
20
|
+
declare type IslandHydrationFn = (element: any, props: any) => void | Promise<void>;
|
package/dist/component-hmr.d.ts
CHANGED
|
@@ -73,10 +73,6 @@ export declare interface ComponentHMRConfig {
|
|
|
73
73
|
* Global registry of component instances for HMR
|
|
74
74
|
*/
|
|
75
75
|
declare class ComponentRegistry {
|
|
76
|
-
private instances: Map<string, ComponentInstance>;
|
|
77
|
-
private componentsByFile: Map<string, Set<string>>;
|
|
78
|
-
private stateSnapshots: Map<string, ComponentState>;
|
|
79
|
-
private config: Required<ComponentHMRConfig>;
|
|
80
76
|
constructor(config?: ComponentHMRConfig);
|
|
81
77
|
register(instance: ComponentInstance): void;
|
|
82
78
|
unregister(instanceId: string): void;
|
|
@@ -84,8 +80,6 @@ declare class ComponentRegistry {
|
|
|
84
80
|
getInstance(id: string): ComponentInstance | undefined;
|
|
85
81
|
captureState(instanceId: string): void;
|
|
86
82
|
restoreState(instanceId: string): boolean;
|
|
87
|
-
private defaultSerializeState(instance: ComponentInstance): ComponentState;
|
|
88
|
-
private defaultDeserializeState(state: ComponentState, instance: ComponentInstance): void;
|
|
89
83
|
getAllInstances(): ComponentInstance[];
|
|
90
84
|
clear(): void;
|
|
91
85
|
}
|
|
@@ -93,28 +87,20 @@ declare class ComponentRegistry {
|
|
|
93
87
|
* HMR Handler - processes component updates
|
|
94
88
|
*/
|
|
95
89
|
export declare class ComponentHMRHandler {
|
|
96
|
-
private registry: ComponentRegistry;
|
|
97
|
-
private config: Required<ComponentHMRConfig>;
|
|
98
|
-
private pendingUpdates: Map<string, HMRUpdate>;
|
|
99
|
-
private updateQueue: Promise<void>;
|
|
100
90
|
constructor(config?: ComponentHMRConfig);
|
|
101
91
|
register(instance: ComponentInstance): void;
|
|
102
92
|
unregister(instanceId: string): void;
|
|
103
93
|
handleUpdate(update: HMRUpdate): Promise<void>;
|
|
104
|
-
private processUpdate(update: HMRUpdate): Promise<void>;
|
|
105
|
-
private updateInstance(instance: ComponentInstance, update: HMRUpdate): Promise<void>;
|
|
106
|
-
private updateComponent(instance: ComponentInstance, update: HMRUpdate): Promise<void>;
|
|
107
|
-
private updateStyles(instance: ComponentInstance, update: HMRUpdate): Promise<void>;
|
|
108
|
-
private parseComponentCode(code: string): { html: string; script: string; style: string };
|
|
109
|
-
private executeScript(script: string, instance: ComponentInstance): Promise<void>;
|
|
110
|
-
private reinitializeInteractivity(instance: ComponentInstance): void;
|
|
111
94
|
getRegistry(): ComponentRegistry;
|
|
112
95
|
refresh(componentName: string): Promise<void>;
|
|
113
96
|
}
|
|
97
|
+
// =============================================================================
|
|
98
|
+
// Exports
|
|
99
|
+
// =============================================================================
|
|
114
100
|
export default {
|
|
115
101
|
ComponentHMRHandler,
|
|
116
102
|
getHMRHandler,
|
|
117
103
|
resetHMRHandler,
|
|
118
104
|
generateHMRClientScript,
|
|
119
105
|
wrapComponentForHMR,
|
|
120
|
-
};
|
|
106
|
+
};
|
package/dist/components.d.ts
CHANGED
|
@@ -25,4 +25,4 @@ export declare function applyPropDefaults(props: Record<string, any>, schema: Co
|
|
|
25
25
|
* Register component directives
|
|
26
26
|
*/
|
|
27
27
|
export declare function registerComponentDirectives(): CustomDirective[];
|
|
28
|
-
export declare const componentDirective: CustomDirective;
|
|
28
|
+
export declare const componentDirective: CustomDirective;
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STX Composables
|
|
3
|
+
*
|
|
4
|
+
* Nuxt-style reactive utilities for browser APIs.
|
|
5
|
+
* These composables provide a streamlined, reactive interface to common browser features.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import {
|
|
10
|
+
* useStorage,
|
|
11
|
+
* useCookie,
|
|
12
|
+
* useClipboard,
|
|
13
|
+
* useMediaQuery,
|
|
14
|
+
* useNetwork,
|
|
15
|
+
* useWindowSize,
|
|
16
|
+
* } from '@stacksjs/stx/composables'
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
// Storage
|
|
1
20
|
export {
|
|
2
21
|
useStorage,
|
|
3
22
|
useLocalStorage,
|
|
@@ -9,6 +28,7 @@ export {
|
|
|
9
28
|
type UseStorageOptions,
|
|
10
29
|
type StorageRef,
|
|
11
30
|
} from './use-storage';
|
|
31
|
+
// Cookies
|
|
12
32
|
export {
|
|
13
33
|
useCookie,
|
|
14
34
|
useCookies,
|
|
@@ -20,11 +40,13 @@ export {
|
|
|
20
40
|
type CookieOptions,
|
|
21
41
|
type CookieRef,
|
|
22
42
|
} from './use-cookie';
|
|
43
|
+
// Clipboard
|
|
23
44
|
export {
|
|
24
45
|
useClipboard,
|
|
25
46
|
copyToClipboard,
|
|
26
47
|
type ClipboardRef,
|
|
27
48
|
} from './use-clipboard';
|
|
49
|
+
// Media Queries
|
|
28
50
|
export {
|
|
29
51
|
useMediaQuery,
|
|
30
52
|
usePreferredDark,
|
|
@@ -38,12 +60,14 @@ export {
|
|
|
38
60
|
breakpoints,
|
|
39
61
|
type MediaQueryRef,
|
|
40
62
|
} from './use-media-query';
|
|
63
|
+
// Network
|
|
41
64
|
export {
|
|
42
65
|
useNetwork,
|
|
43
66
|
useOnline,
|
|
44
67
|
type NetworkState,
|
|
45
68
|
type NetworkRef,
|
|
46
69
|
} from './use-network';
|
|
70
|
+
// Window
|
|
47
71
|
export {
|
|
48
72
|
useWindowSize,
|
|
49
73
|
useScroll,
|
|
@@ -56,6 +80,7 @@ export {
|
|
|
56
80
|
type ScrollRef,
|
|
57
81
|
type VisibilityRef,
|
|
58
82
|
} from './use-window';
|
|
83
|
+
// Geolocation
|
|
59
84
|
export {
|
|
60
85
|
useGeolocation,
|
|
61
86
|
useGeolocationWatch,
|
|
@@ -66,6 +91,7 @@ export {
|
|
|
66
91
|
type GeolocationOptions,
|
|
67
92
|
type GeolocationRef,
|
|
68
93
|
} from './use-geolocation';
|
|
94
|
+
// Mouse & Pointer
|
|
69
95
|
export {
|
|
70
96
|
useMouse,
|
|
71
97
|
useMouseInElement,
|
|
@@ -76,6 +102,7 @@ export {
|
|
|
76
102
|
type ElementMouseState,
|
|
77
103
|
type ElementMouseRef,
|
|
78
104
|
} from './use-mouse';
|
|
105
|
+
// Keyboard
|
|
79
106
|
export {
|
|
80
107
|
useKeyboard,
|
|
81
108
|
useHotkey,
|
|
@@ -87,6 +114,7 @@ export {
|
|
|
87
114
|
type KeyboardRef,
|
|
88
115
|
type HotkeyOptions,
|
|
89
116
|
} from './use-keyboard';
|
|
117
|
+
// Intersection Observer
|
|
90
118
|
export {
|
|
91
119
|
useIntersectionObserver,
|
|
92
120
|
useElementVisibility,
|
|
@@ -97,6 +125,7 @@ export {
|
|
|
97
125
|
type IntersectionState,
|
|
98
126
|
type IntersectionObserverRef,
|
|
99
127
|
} from './use-intersection-observer';
|
|
128
|
+
// Fetch & Async Data
|
|
100
129
|
export {
|
|
101
130
|
useFetch,
|
|
102
131
|
useAsyncData,
|
|
@@ -107,6 +136,7 @@ export {
|
|
|
107
136
|
type FetchState,
|
|
108
137
|
type FetchRef,
|
|
109
138
|
} from './use-fetch';
|
|
139
|
+
// Fullscreen
|
|
110
140
|
export {
|
|
111
141
|
useFullscreen,
|
|
112
142
|
toggleFullscreen,
|
|
@@ -115,6 +145,7 @@ export {
|
|
|
115
145
|
type FullscreenOptions,
|
|
116
146
|
type FullscreenRef,
|
|
117
147
|
} from './use-fullscreen';
|
|
148
|
+
// Notifications
|
|
118
149
|
export {
|
|
119
150
|
useNotification,
|
|
120
151
|
notify,
|
|
@@ -126,6 +157,7 @@ export {
|
|
|
126
157
|
type NotificationOptions,
|
|
127
158
|
type NotificationRef,
|
|
128
159
|
} from './use-notification';
|
|
160
|
+
// Share
|
|
129
161
|
export {
|
|
130
162
|
useShare,
|
|
131
163
|
share,
|
|
@@ -139,6 +171,7 @@ export {
|
|
|
139
171
|
type ShareResult,
|
|
140
172
|
type ShareRef,
|
|
141
173
|
} from './use-share';
|
|
174
|
+
// Permissions
|
|
142
175
|
export {
|
|
143
176
|
usePermission,
|
|
144
177
|
usePermissions,
|
|
@@ -155,6 +188,7 @@ export {
|
|
|
155
188
|
type PermissionRef,
|
|
156
189
|
type MultiPermissionRef,
|
|
157
190
|
} from './use-permissions';
|
|
191
|
+
// Resize Observer
|
|
158
192
|
export {
|
|
159
193
|
useResizeObserver,
|
|
160
194
|
useResizeObserverMultiple,
|
|
@@ -165,6 +199,7 @@ export {
|
|
|
165
199
|
type ResizeObserverOptions,
|
|
166
200
|
type ResizeObserverRef,
|
|
167
201
|
} from './use-resize-observer';
|
|
202
|
+
// Battery
|
|
168
203
|
export {
|
|
169
204
|
useBattery,
|
|
170
205
|
getBatteryLevel,
|
|
@@ -173,6 +208,7 @@ export {
|
|
|
173
208
|
type BatteryState,
|
|
174
209
|
type BatteryRef,
|
|
175
210
|
} from './use-battery';
|
|
211
|
+
// Speech Recognition & Synthesis
|
|
176
212
|
export {
|
|
177
213
|
useSpeechRecognition,
|
|
178
214
|
useSpeechSynthesis,
|
|
@@ -189,6 +225,7 @@ export {
|
|
|
189
225
|
type SpeechSynthesisState,
|
|
190
226
|
type SpeechSynthesisRef,
|
|
191
227
|
} from './use-speech';
|
|
228
|
+
// Broadcast Channel
|
|
192
229
|
export {
|
|
193
230
|
useBroadcastChannel,
|
|
194
231
|
broadcast,
|
|
@@ -197,6 +234,7 @@ export {
|
|
|
197
234
|
type BroadcastChannelOptions,
|
|
198
235
|
type BroadcastChannelRef,
|
|
199
236
|
} from './use-broadcast-channel';
|
|
237
|
+
// WebSocket
|
|
200
238
|
export {
|
|
201
239
|
useWebSocket,
|
|
202
240
|
isWebSocketSupported,
|
|
@@ -205,6 +243,7 @@ export {
|
|
|
205
243
|
type WebSocketOptions,
|
|
206
244
|
type WebSocketRef,
|
|
207
245
|
} from './use-websocket';
|
|
246
|
+
// Device Orientation & Motion
|
|
208
247
|
export {
|
|
209
248
|
useDeviceOrientation,
|
|
210
249
|
useDeviceMotion,
|
|
@@ -218,6 +257,7 @@ export {
|
|
|
218
257
|
type DeviceOrientationRef,
|
|
219
258
|
type DeviceMotionRef,
|
|
220
259
|
} from './use-device-orientation';
|
|
260
|
+
// Mutation Observer
|
|
221
261
|
export {
|
|
222
262
|
useMutationObserver,
|
|
223
263
|
useAttributeObserver,
|
|
@@ -228,6 +268,7 @@ export {
|
|
|
228
268
|
type MutationObserverOptions,
|
|
229
269
|
type MutationObserverRef,
|
|
230
270
|
} from './use-mutation-observer';
|
|
271
|
+
// Event Source (SSE)
|
|
231
272
|
export {
|
|
232
273
|
useEventSource,
|
|
233
274
|
useSSE,
|
|
@@ -237,6 +278,7 @@ export {
|
|
|
237
278
|
type EventSourceOptions,
|
|
238
279
|
type EventSourceRef,
|
|
239
280
|
} from './use-event-source';
|
|
281
|
+
// Idle Detection
|
|
240
282
|
export {
|
|
241
283
|
useIdle,
|
|
242
284
|
useIdleState,
|
|
@@ -246,6 +288,7 @@ export {
|
|
|
246
288
|
type IdleOptions,
|
|
247
289
|
type IdleRef,
|
|
248
290
|
} from './use-idle';
|
|
291
|
+
// Text Selection
|
|
249
292
|
export {
|
|
250
293
|
useTextSelection,
|
|
251
294
|
useElementTextSelection,
|
|
@@ -255,6 +298,7 @@ export {
|
|
|
255
298
|
type TextSelectionOptions,
|
|
256
299
|
type TextSelectionRef,
|
|
257
300
|
} from './use-text-selection';
|
|
301
|
+
// Wake Lock
|
|
258
302
|
export {
|
|
259
303
|
useWakeLock,
|
|
260
304
|
useAutoWakeLock,
|
|
@@ -263,6 +307,7 @@ export {
|
|
|
263
307
|
type WakeLockState,
|
|
264
308
|
type WakeLockRef,
|
|
265
309
|
} from './use-wake-lock';
|
|
310
|
+
// Eye Dropper (Color Picker)
|
|
266
311
|
export {
|
|
267
312
|
useEyeDropper,
|
|
268
313
|
useColorHistory,
|
|
@@ -274,4 +319,72 @@ export {
|
|
|
274
319
|
type EyeDropperResult,
|
|
275
320
|
type EyeDropperOptions,
|
|
276
321
|
type EyeDropperRef,
|
|
277
|
-
} from './use-eye-dropper';
|
|
322
|
+
} from './use-eye-dropper';
|
|
323
|
+
// Router / Navigation
|
|
324
|
+
export {
|
|
325
|
+
navigate,
|
|
326
|
+
goBack,
|
|
327
|
+
goForward,
|
|
328
|
+
useRoute,
|
|
329
|
+
useSearchParams,
|
|
330
|
+
type RouteInfo,
|
|
331
|
+
type SearchParamsRef,
|
|
332
|
+
} from './use-router';
|
|
333
|
+
// Data Fetching (Query / Mutation)
|
|
334
|
+
export {
|
|
335
|
+
type UseQueryOptions,
|
|
336
|
+
type UseQueryResult,
|
|
337
|
+
type UseMutationOptions,
|
|
338
|
+
type UseMutationResult,
|
|
339
|
+
} from './use-query';
|
|
340
|
+
// Event Listener
|
|
341
|
+
export {
|
|
342
|
+
useEventListener,
|
|
343
|
+
type UseEventListenerOptions,
|
|
344
|
+
type EventListenerRef,
|
|
345
|
+
} from './use-event-listener';
|
|
346
|
+
// Meta Tags
|
|
347
|
+
export {
|
|
348
|
+
useMeta,
|
|
349
|
+
type UseMetaOptions,
|
|
350
|
+
type MetaRef,
|
|
351
|
+
} from './use-meta';
|
|
352
|
+
// Timers
|
|
353
|
+
export {
|
|
354
|
+
useDebounce,
|
|
355
|
+
useDebouncedValue,
|
|
356
|
+
useThrottle,
|
|
357
|
+
useInterval,
|
|
358
|
+
useTimeout,
|
|
359
|
+
type DebouncedFn,
|
|
360
|
+
type ThrottledFn,
|
|
361
|
+
type DebouncedValueRef,
|
|
362
|
+
type IntervalOptions,
|
|
363
|
+
type IntervalRef,
|
|
364
|
+
type TimeoutRef,
|
|
365
|
+
} from './use-timer';
|
|
366
|
+
// Utilities
|
|
367
|
+
export {
|
|
368
|
+
useToggle,
|
|
369
|
+
useCounter,
|
|
370
|
+
useClickOutside,
|
|
371
|
+
useFocus,
|
|
372
|
+
useAsync,
|
|
373
|
+
type ToggleRef,
|
|
374
|
+
type CounterOptions,
|
|
375
|
+
type CounterRef,
|
|
376
|
+
type ClickOutsideRef,
|
|
377
|
+
type FocusRef,
|
|
378
|
+
type AsyncState,
|
|
379
|
+
type AsyncRef,
|
|
380
|
+
type AsyncOptions,
|
|
381
|
+
} from './use-utilities';
|
|
382
|
+
// Color Mode
|
|
383
|
+
export {
|
|
384
|
+
useColorMode,
|
|
385
|
+
useDark,
|
|
386
|
+
type ColorMode,
|
|
387
|
+
type ColorModeOptions,
|
|
388
|
+
type ColorModeRef,
|
|
389
|
+
type DarkRef,
|
|
390
|
+
} from './use-color-mode';
|
|
@@ -54,5 +54,5 @@ export declare interface BroadcastChannelRef<T = unknown> {
|
|
|
54
54
|
close: () => void
|
|
55
55
|
isSupported: () => boolean
|
|
56
56
|
}
|
|
57
|
-
declare type BroadcastEventType = 'message' | 'error'
|
|
58
|
-
declare type BroadcastEventCallback = (data: MessageEvent) => void
|
|
57
|
+
declare type BroadcastEventType = 'message' | 'error';
|
|
58
|
+
declare type BroadcastEventCallback = (data: MessageEvent) => void;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Full-featured color-mode manager.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* const { mode, isDark, toggle, set } = useColorMode()
|
|
7
|
+
* toggle() // switch light↔dark
|
|
8
|
+
* set('auto') // follow system preference
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare function useColorMode(options?: ColorModeOptions): ColorModeRef;
|
|
12
|
+
/**
|
|
13
|
+
* Convenience wrapper — just isDark, toggle, set.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const { isDark, toggle } = useDark()
|
|
18
|
+
* toggle()
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function useDark(options?: ColorModeOptions): DarkRef;
|
|
22
|
+
export declare interface ColorModeOptions {
|
|
23
|
+
storageKey?: string
|
|
24
|
+
initialMode?: ColorMode
|
|
25
|
+
darkClass?: string
|
|
26
|
+
attribute?: string
|
|
27
|
+
disableTransitions?: boolean
|
|
28
|
+
}
|
|
29
|
+
export declare interface ColorModeRef {
|
|
30
|
+
readonly mode: 'light' | 'dark'
|
|
31
|
+
readonly preference: ColorMode
|
|
32
|
+
readonly isDark: boolean
|
|
33
|
+
set: (mode: ColorMode) => void
|
|
34
|
+
toggle: () => void
|
|
35
|
+
subscribe: (fn: (mode: 'light' | 'dark', preference: ColorMode) => void) => () => void
|
|
36
|
+
}
|
|
37
|
+
export declare interface DarkRef {
|
|
38
|
+
readonly isDark: boolean
|
|
39
|
+
toggle: () => void
|
|
40
|
+
set: (dark: boolean) => void
|
|
41
|
+
subscribe: (fn: (isDark: boolean) => void) => () => void
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* useColorMode / useDark — Theme management composables
|
|
45
|
+
*
|
|
46
|
+
* Detect system preference, persist user choice, toggle dark/light mode,
|
|
47
|
+
* and sync across tabs — all with auto-cleanup.
|
|
48
|
+
*/
|
|
49
|
+
// =============================================================================
|
|
50
|
+
// Types
|
|
51
|
+
// =============================================================================
|
|
52
|
+
export type ColorMode = 'light' | 'dark' | 'auto';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attach an event listener with auto-cleanup.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* // Listen on window (default)
|
|
7
|
+
* useEventListener('resize', () => console.log('resized'))
|
|
8
|
+
*
|
|
9
|
+
* // Listen on document
|
|
10
|
+
* useEventListener('click', handler, { target: document })
|
|
11
|
+
*
|
|
12
|
+
* // Listen on a specific element by selector
|
|
13
|
+
* useEventListener('click', handler, { target: '#my-button' })
|
|
14
|
+
*
|
|
15
|
+
* // Manual removal
|
|
16
|
+
* const { remove } = useEventListener('scroll', handler)
|
|
17
|
+
* remove()
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function useEventListener(event: string, handler: EventListenerOrEventListenerObject, options?: UseEventListenerOptions): EventListenerRef;
|
|
21
|
+
/**
|
|
22
|
+
* useEventListener - Event listener composable with auto-cleanup
|
|
23
|
+
*
|
|
24
|
+
* Attaches event listeners and automatically removes them on component destroy.
|
|
25
|
+
* Replaces raw `window.addEventListener` / `document.addEventListener` usage.
|
|
26
|
+
*/
|
|
27
|
+
export declare interface UseEventListenerOptions {
|
|
28
|
+
target?: EventTarget | string
|
|
29
|
+
capture?: boolean
|
|
30
|
+
passive?: boolean
|
|
31
|
+
once?: boolean
|
|
32
|
+
}
|
|
33
|
+
export declare interface EventListenerRef {
|
|
34
|
+
remove: () => void
|
|
35
|
+
}
|
|
@@ -74,4 +74,4 @@ export declare interface EventSourceRef<T = unknown> {
|
|
|
74
74
|
*
|
|
75
75
|
* Reactive utilities for Server-Sent Events.
|
|
76
76
|
*/
|
|
77
|
-
export type EventSourceStatus = 'connecting' | 'open' | 'closed' | 'error'
|
|
77
|
+
export type EventSourceStatus = 'connecting' | 'open' | 'closed' | 'error';
|
|
@@ -95,13 +95,14 @@ export declare interface EyeDropperRef {
|
|
|
95
95
|
open: () => Promise<string | null>
|
|
96
96
|
isSupported: () => boolean
|
|
97
97
|
}
|
|
98
|
+
// Extend Window for EyeDropper
|
|
98
99
|
declare interface EyeDropperConstructor {
|
|
99
100
|
new (): {
|
|
100
101
|
open: (options?: { signal?: AbortSignal }) => Promise<EyeDropperResult>
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
|
-
declare
|
|
104
|
+
declare global {
|
|
104
105
|
interface Window {
|
|
105
106
|
EyeDropper?: EyeDropperConstructor
|
|
106
107
|
}
|
|
107
|
-
}
|
|
108
|
+
}
|
|
@@ -32,7 +32,7 @@ export declare function useIdle(options?: IdleOptions): IdleRef;
|
|
|
32
32
|
* })
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
export declare function useIdleState(timeout?:
|
|
35
|
+
export declare function useIdleState(timeout?: number): void;
|
|
36
36
|
/**
|
|
37
37
|
* Track user's last active timestamp
|
|
38
38
|
*
|
|
@@ -81,4 +81,4 @@ export declare interface IdleRef {
|
|
|
81
81
|
subscribe: (fn: (state: IdleState) => void) => () => void
|
|
82
82
|
reset: () => void
|
|
83
83
|
isIdle: () => boolean
|
|
84
|
-
}
|
|
84
|
+
}
|
|
@@ -78,4 +78,4 @@ export declare interface IntersectionObserverRef {
|
|
|
78
78
|
stop: () => void
|
|
79
79
|
start: () => void
|
|
80
80
|
}
|
|
81
|
-
declare type IntersectionCallback = (entry: IntersectionObserverEntry, observer: IntersectionObserver) => void
|
|
81
|
+
declare type IntersectionCallback = (entry: IntersectionObserverEntry, observer: IntersectionObserver) => void;
|
|
@@ -35,7 +35,6 @@ export declare const shortcuts: {
|
|
|
35
35
|
refresh: 'ctrl+r';
|
|
36
36
|
escape: 'escape';
|
|
37
37
|
enter: 'enter';
|
|
38
|
-
// Mac alternatives
|
|
39
38
|
saveMac: 'meta+s';
|
|
40
39
|
undoMac: 'meta+z';
|
|
41
40
|
redoMac: 'meta+shift+z';
|
|
@@ -97,4 +96,4 @@ export declare interface HotkeyOptions {
|
|
|
97
96
|
keyup?: boolean
|
|
98
97
|
ignoreInputs?: boolean
|
|
99
98
|
}
|
|
100
|
-
declare type HotkeyCallback = (event: KeyboardEvent) => void
|
|
99
|
+
declare type HotkeyCallback = (event: KeyboardEvent) => void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reactive meta tag management.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* const meta = useMeta({
|
|
7
|
+
* title: 'My Page',
|
|
8
|
+
* description: 'A page description',
|
|
9
|
+
* og: { image: 'https://example.com/og.png' }
|
|
10
|
+
* })
|
|
11
|
+
*
|
|
12
|
+
* // Dynamic updates
|
|
13
|
+
* meta.setTitle('New Title')
|
|
14
|
+
* meta.setMeta('description', 'Updated description')
|
|
15
|
+
* meta.setOgMeta('image', 'https://example.com/new.png')
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function useMeta(options?: UseMetaOptions): MetaRef;
|
|
19
|
+
/**
|
|
20
|
+
* useMeta - Reactive meta tag management composable
|
|
21
|
+
*
|
|
22
|
+
* Provides clean APIs for managing `<meta>` tags without raw `document.querySelector`.
|
|
23
|
+
*/
|
|
24
|
+
export declare interface UseMetaOptions {
|
|
25
|
+
title?: string
|
|
26
|
+
description?: string
|
|
27
|
+
meta?: Record<string, string>
|
|
28
|
+
og?: Record<string, string>
|
|
29
|
+
}
|
|
30
|
+
export declare interface MetaRef {
|
|
31
|
+
setMeta: (name: string, content: string) => void
|
|
32
|
+
setOgMeta: (property: string, content: string) => void
|
|
33
|
+
removeMeta: (name: string) => void
|
|
34
|
+
setTitle: (title: string) => void
|
|
35
|
+
}
|