@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/init.d.ts
CHANGED
package/dist/interactive.d.ts
CHANGED
package/dist/js-ts.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ export declare function processJsDirectives(template: string, context: Record<st
|
|
|
7
7
|
* Process TypeScript directives in templates
|
|
8
8
|
* Executes TypeScript code on the server and removes the code blocks from output
|
|
9
9
|
*/
|
|
10
|
-
export declare function processTsDirectives(template: string, context: Record<string, any>, filePath?: string): Promise<string>;
|
|
10
|
+
export declare function processTsDirectives(template: string, context: Record<string, any>, filePath?: string): Promise<string>;
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -79,25 +79,6 @@ export declare const jsxs: unknown;
|
|
|
79
79
|
* Development version of jsx with extra validation.
|
|
80
80
|
*/
|
|
81
81
|
export declare const jsxDEV: unknown;
|
|
82
|
-
/**
|
|
83
|
-
* STX JSX Runtime
|
|
84
|
-
*
|
|
85
|
-
* Self-made JSX runtime for stx — no React, no Preact, no external dependencies.
|
|
86
|
-
* This module provides the jsx/jsxs/Fragment functions that Bun's JSX transpiler calls,
|
|
87
|
-
* plus renderToString() for SSR and renderToDOM() for client-side rendering.
|
|
88
|
-
*
|
|
89
|
-
* Usage in tsconfig.json:
|
|
90
|
-
* ```json
|
|
91
|
-
* {
|
|
92
|
-
* "compilerOptions": {
|
|
93
|
-
* "jsx": "react-jsx",
|
|
94
|
-
* "jsxImportSource": "@stacksjs/stx"
|
|
95
|
-
* }
|
|
96
|
-
* }
|
|
97
|
-
* ```
|
|
98
|
-
*
|
|
99
|
-
* @module jsx-runtime
|
|
100
|
-
*/
|
|
101
82
|
/** Virtual DOM node representation */
|
|
102
83
|
export declare interface VNode {
|
|
103
84
|
type: string | ComponentFunction | typeof Fragment
|
|
@@ -107,4 +88,4 @@ export declare interface VNode {
|
|
|
107
88
|
ref?: string | ((el: any) => void) | null
|
|
108
89
|
}
|
|
109
90
|
/** Function component type */
|
|
110
|
-
export type ComponentFunction = (props: Record<string, any>) => VNode | string | null
|
|
91
|
+
export type ComponentFunction = (props: Record<string, any>) => VNode | string | null;
|
package/dist/keep-alive.d.ts
CHANGED
package/dist/lazy-loader.d.ts
CHANGED
|
@@ -39,47 +39,18 @@ export declare interface DirectiveProcessor {
|
|
|
39
39
|
name?: string
|
|
40
40
|
hasEndTag?: boolean
|
|
41
41
|
}
|
|
42
|
-
/**
|
|
43
|
-
* Lazy Loading for Directive Processors
|
|
44
|
-
*
|
|
45
|
-
* Provides lazy loading capabilities for directive processors to reduce
|
|
46
|
-
* initial load time and memory usage.
|
|
47
|
-
*
|
|
48
|
-
* ## Features
|
|
49
|
-
*
|
|
50
|
-
* - On-demand loading of directive processors
|
|
51
|
-
* - Module caching to prevent re-imports
|
|
52
|
-
* - Support for both sync and async loading
|
|
53
|
-
* - Automatic dependency resolution
|
|
54
|
-
*
|
|
55
|
-
* ## Usage
|
|
56
|
-
*
|
|
57
|
-
* ```typescript
|
|
58
|
-
* const loader = new LazyLoader()
|
|
59
|
-
*
|
|
60
|
-
* // Register lazy directive
|
|
61
|
-
* loader.register('markdown', () => import('./markdown'))
|
|
62
|
-
*
|
|
63
|
-
* // Load when needed
|
|
64
|
-
* const markdown = await loader.load('markdown')
|
|
65
|
-
* ```
|
|
66
|
-
*
|
|
67
|
-
* @module lazy-loader
|
|
68
|
-
*/
|
|
69
42
|
/**
|
|
70
43
|
* Module loader function
|
|
71
44
|
*/
|
|
72
|
-
export type ModuleLoader<T = unknown> = () => Promise<T> | T
|
|
45
|
+
export type ModuleLoader<T = unknown> = () => Promise<T> | T;
|
|
73
46
|
/**
|
|
74
47
|
* Module status
|
|
75
48
|
*/
|
|
76
|
-
export type ModuleStatus = 'pending' | 'loading' | 'loaded' | 'error'
|
|
49
|
+
export type ModuleStatus = 'pending' | 'loading' | 'loaded' | 'error';
|
|
77
50
|
/**
|
|
78
51
|
* Lazy loader for directive processors
|
|
79
52
|
*/
|
|
80
53
|
export declare class LazyLoader<T = unknown> {
|
|
81
|
-
private modules: Map<string, ModuleInfo<T>>;
|
|
82
|
-
private options: LazyLoaderOptions;
|
|
83
54
|
constructor(options?: LazyLoaderOptions);
|
|
84
55
|
register(name: string, loader: ModuleLoader<T>, dependencies?: string[]): void;
|
|
85
56
|
registerAll(modules: Record<string, ModuleLoader<T>>): void;
|
|
@@ -105,18 +76,15 @@ export declare class LazyLoader<T = unknown> {
|
|
|
105
76
|
loadTime?: number
|
|
106
77
|
}>
|
|
107
78
|
};
|
|
108
|
-
private loadWithTimeout(name: string, loader: ModuleLoader<T>): Promise<T>;
|
|
109
79
|
}
|
|
110
80
|
/**
|
|
111
81
|
* Lazy loader specifically for directive processors
|
|
112
82
|
*/
|
|
113
83
|
export declare class DirectiveLoaderRegistry {
|
|
114
|
-
private loader: LazyLoader<DirectiveProcessor | { default: DirectiveProcessor }>;
|
|
115
|
-
private directiveMap: Map<string, string>;
|
|
116
84
|
constructor(options?: LazyLoaderOptions);
|
|
117
85
|
registerDirective(directiveName: string, moduleName: string, loader: ModuleLoader<DirectiveProcessor | { default: DirectiveProcessor }>): void;
|
|
118
86
|
getProcessor(directiveName: string): Promise<DirectiveProcessor | null>;
|
|
119
87
|
hasDirective(directiveName: string): boolean;
|
|
120
88
|
getDirectiveNames(): string[];
|
|
121
89
|
preloadDirectives(directiveNames: string[]): Promise<void>;
|
|
122
|
-
}
|
|
90
|
+
}
|
|
@@ -33,8 +33,9 @@ export declare interface LoadingIndicatorInstance {
|
|
|
33
33
|
clear: () => void
|
|
34
34
|
state: LoadingIndicatorState
|
|
35
35
|
}
|
|
36
|
+
// Export for use in STX templates
|
|
36
37
|
export default {
|
|
37
38
|
useLoadingIndicator,
|
|
38
39
|
initLoadingIndicator,
|
|
39
40
|
generateLoadingIndicatorHtml,
|
|
40
|
-
};
|
|
41
|
+
};
|
package/dist/loops.d.ts
CHANGED
|
@@ -22,4 +22,4 @@ import type { StxOptions } from './types';
|
|
|
22
22
|
* @param filePath - Path to template file for error messages
|
|
23
23
|
* @param options - Optional stx configuration
|
|
24
24
|
*/
|
|
25
|
-
export declare function processLoops(template: string, context: Record<string, any>, filePath: string, options?: StxOptions): string;
|
|
25
|
+
export declare function processLoops(template: string, context: Record<string, any>, filePath: string, options?: StxOptions): string;
|
package/dist/markdown.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ export declare function processMarkdownDirectives(template: string, context: Rec
|
|
|
7
7
|
* Custom directive handler for markdown
|
|
8
8
|
* Can be registered as a custom directive
|
|
9
9
|
*/
|
|
10
|
-
export declare function markdownDirectiveHandler(content: string, params: string[], _context: Record<string, any>, _filePath: string): Promise<string>;
|
|
10
|
+
export declare function markdownDirectiveHandler(content: string, params: string[], _context: Record<string, any>, _filePath: string): Promise<string>;
|
|
@@ -9,6 +9,16 @@ export declare function generateMediaRuntime(): { script: string; css: string };
|
|
|
9
9
|
* Generate minified media runtime for production
|
|
10
10
|
*/
|
|
11
11
|
export declare function generateMinifiedMediaRuntime(): { script: string; css: string };
|
|
12
|
+
/**
|
|
13
|
+
* STX Media - Client-Side Runtime
|
|
14
|
+
*
|
|
15
|
+
* Client-side utilities for lazy loading, blur-up effects, and file uploads.
|
|
16
|
+
*
|
|
17
|
+
* @module media/client
|
|
18
|
+
*/
|
|
19
|
+
// =============================================================================
|
|
20
|
+
// Lazy Loading
|
|
21
|
+
// =============================================================================
|
|
12
22
|
export {
|
|
13
23
|
// Types
|
|
14
24
|
type LazyLoadOptions,
|
|
@@ -33,6 +43,9 @@ export {
|
|
|
33
43
|
// Runtime generation
|
|
34
44
|
generateLazyLoadRuntime,
|
|
35
45
|
} from './lazy-load';
|
|
46
|
+
// =============================================================================
|
|
47
|
+
// Blur-Up Effects
|
|
48
|
+
// =============================================================================
|
|
36
49
|
export {
|
|
37
50
|
// Types
|
|
38
51
|
type BlurUpOptions,
|
|
@@ -54,6 +67,9 @@ export {
|
|
|
54
67
|
generateBlurUpRuntime,
|
|
55
68
|
generateBlurUpCSS,
|
|
56
69
|
} from './blur-up';
|
|
70
|
+
// =============================================================================
|
|
71
|
+
// Upload Handler
|
|
72
|
+
// =============================================================================
|
|
57
73
|
export {
|
|
58
74
|
// Types
|
|
59
75
|
type UploadHandlerOptions,
|
|
@@ -74,4 +90,4 @@ export {
|
|
|
74
90
|
|
|
75
91
|
// Runtime generation
|
|
76
92
|
generateUploadRuntime,
|
|
77
|
-
} from './upload-handler';
|
|
93
|
+
} from './upload-handler';
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { } from './srcset';
|
|
3
|
-
import type { ImageRenderContext, ImageRenderResult, ImgProps, EnhancedImgProps, TsImagesConfig, ProcessedImageResult, ResponsiveVariantSet, } from '../types';
|
|
1
|
+
import type { ImageRenderContext, ImageRenderResult, ImgProps, EnhancedImgProps, TsImagesConfig, ProcessedImageResult, ResponsiveVariantSet } from '../types';
|
|
4
2
|
/**
|
|
5
3
|
* Render an optimized <Img> component
|
|
6
4
|
*
|
|
@@ -43,4 +41,4 @@ export declare interface ExtendedImageRenderContext extends ImageRenderContext {
|
|
|
43
41
|
tsImagesConfig?: TsImagesConfig
|
|
44
42
|
processedResult?: ProcessedImageResult
|
|
45
43
|
responsiveVariants?: ResponsiveVariantSet
|
|
46
|
-
}
|
|
44
|
+
}
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
+
// Export types separately
|
|
1
2
|
export type { ExtendedImageRenderContext } from './component';
|
|
3
|
+
/**
|
|
4
|
+
* STX Media - Image Module
|
|
5
|
+
*
|
|
6
|
+
* Complete image optimization with responsive srcset, lazy loading,
|
|
7
|
+
* blur-up placeholders, and imgix-style URL transformations.
|
|
8
|
+
*
|
|
9
|
+
* @module media/image
|
|
10
|
+
*/
|
|
11
|
+
// =============================================================================
|
|
12
|
+
// Component Exports
|
|
13
|
+
// =============================================================================
|
|
2
14
|
export {
|
|
3
15
|
// Main render function
|
|
4
16
|
renderImgComponent,
|
|
@@ -6,12 +18,18 @@ export {
|
|
|
6
18
|
parseImgComponent,
|
|
7
19
|
processImgComponents,
|
|
8
20
|
} from './component';
|
|
21
|
+
// =============================================================================
|
|
22
|
+
// Directive Exports
|
|
23
|
+
// =============================================================================
|
|
9
24
|
export {
|
|
10
25
|
// Directive factory
|
|
11
26
|
createImgDirective,
|
|
12
27
|
// Directive instance
|
|
13
28
|
imgDirective,
|
|
14
29
|
} from './directive';
|
|
30
|
+
// =============================================================================
|
|
31
|
+
// Srcset Exports
|
|
32
|
+
// =============================================================================
|
|
15
33
|
export {
|
|
16
34
|
// Constants
|
|
17
35
|
DEFAULT_WIDTHS,
|
|
@@ -50,6 +68,9 @@ export {
|
|
|
50
68
|
getFormatExtension,
|
|
51
69
|
detectFormat,
|
|
52
70
|
} from './srcset';
|
|
71
|
+
// =============================================================================
|
|
72
|
+
// Placeholder Exports
|
|
73
|
+
// =============================================================================
|
|
53
74
|
export {
|
|
54
75
|
// Constants
|
|
55
76
|
DEFAULT_PLACEHOLDER_OPTIONS,
|
|
@@ -74,6 +95,9 @@ export {
|
|
|
74
95
|
clearPlaceholderCache,
|
|
75
96
|
getPlaceholderCacheStats,
|
|
76
97
|
} from './placeholder';
|
|
98
|
+
// =============================================================================
|
|
99
|
+
// Editing API Exports
|
|
100
|
+
// =============================================================================
|
|
77
101
|
export {
|
|
78
102
|
// URL building
|
|
79
103
|
buildImageUrl as buildUrl,
|
|
@@ -115,4 +139,4 @@ export {
|
|
|
115
139
|
// Validation
|
|
116
140
|
validateParams,
|
|
117
141
|
sanitizeParams,
|
|
118
|
-
} from './editing';
|
|
142
|
+
} from './editing';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { EnhancedImgProps, ProcessedImageResult, TsImagesConfig
|
|
1
|
+
import { type CacheConfig } from '../../shared/cache';
|
|
2
|
+
import type { EnhancedImgProps, ProcessedImageResult, TsImagesConfig } from '../../types';
|
|
3
3
|
/**
|
|
4
4
|
* Get cached image processing result
|
|
5
5
|
*/
|
|
@@ -23,10 +23,9 @@ export declare interface ImageCacheConfig extends CacheConfig {
|
|
|
23
23
|
* Image processor cache class
|
|
24
24
|
*/
|
|
25
25
|
export declare class ImageProcessorCache {
|
|
26
|
-
private config: ImageCacheConfig;
|
|
27
26
|
constructor(config?: Partial<ImageCacheConfig>);
|
|
28
27
|
get(src: string, options: Partial<EnhancedImgProps>): Promise<ProcessedImageResult | null>;
|
|
29
28
|
set(src: string, options: Partial<EnhancedImgProps>, result: ProcessedImageResult): Promise<void>;
|
|
30
29
|
clear(): Promise<void>;
|
|
31
30
|
updateConfig(config: Partial<ImageCacheConfig>): void;
|
|
32
|
-
}
|
|
31
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// Re-export types for convenience
|
|
1
2
|
export type {
|
|
2
3
|
EnhancedImgProps,
|
|
3
4
|
ProcessedImageResult,
|
|
@@ -7,6 +8,13 @@ export type {
|
|
|
7
8
|
ImageTransformationConfig,
|
|
8
9
|
FormatQualitySettings,
|
|
9
10
|
} from '../../types';
|
|
11
|
+
/**
|
|
12
|
+
* STX Media - Image Processor
|
|
13
|
+
*
|
|
14
|
+
* Integration with ts-images for build-time image optimization.
|
|
15
|
+
*
|
|
16
|
+
* @module media/image/processor
|
|
17
|
+
*/
|
|
10
18
|
export { processImage, optimizeImage, applyTransformations } from './optimizer';
|
|
11
19
|
export { generateResponsiveVariants, generateSrcset } from './responsive';
|
|
12
|
-
export { getCachedImageResult, setCachedImageResult, clearImageCache, ImageProcessorCache } from './cache';
|
|
20
|
+
export { getCachedImageResult, setCachedImageResult, clearImageCache, ImageProcessorCache } from './cache';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EnhancedImgProps, ProcessedImageResult, TsImagesConfig, ImageFormat, ImageTransformationConfig
|
|
1
|
+
import type { EnhancedImgProps, ProcessedImageResult, TsImagesConfig, ImageFormat, ImageTransformationConfig } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Process a single image with ts-images
|
|
4
4
|
*/
|
|
@@ -10,4 +10,4 @@ export declare function optimizeImage(src: string, format: ImageFormat, quality:
|
|
|
10
10
|
/**
|
|
11
11
|
* Apply transformations to an image
|
|
12
12
|
*/
|
|
13
|
-
export declare function applyTransformations(src: string, transformations: ImageTransformationConfig[], tsImages?: typeof import('ts-images') | null): Promise<Buffer | null>;
|
|
13
|
+
export declare function applyTransformations(src: string, transformations: ImageTransformationConfig[], tsImages?: typeof import('ts-images') | null): Promise<Buffer | null>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EnhancedImgProps, ResponsiveVariantSet, TsImagesConfig, ProcessedImageResult
|
|
1
|
+
import type { EnhancedImgProps, ResponsiveVariantSet, TsImagesConfig, ProcessedImageResult } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Generate responsive image variants using ts-images
|
|
4
4
|
*/
|
|
@@ -13,5 +13,6 @@ export declare function generateSrcset(variants: ProcessedImageResult['variants'
|
|
|
13
13
|
export declare function generateArtDirectionSources(src: string, artDirection: NonNullable<EnhancedImgProps['artDirection']>, config: TsImagesConfig): Promise<Array<{ media: string; srcset: string; type: string }>>;
|
|
14
14
|
/**
|
|
15
15
|
* Default responsive breakpoints
|
|
16
|
+
* @defaultValue `[320, 480, 640, 768, 1024, 1280, 1536, 1920]`
|
|
16
17
|
*/
|
|
17
|
-
export declare const DEFAULT_RESPONSIVE_WIDTHS:
|
|
18
|
+
export declare const DEFAULT_RESPONSIVE_WIDTHS: number[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Breakpoint, ImageFormat, ImageParams, ImageVariant, SrcsetData, SrcsetOptions
|
|
1
|
+
import type { Breakpoint, ImageFormat, ImageParams, ImageVariant, SrcsetData, SrcsetOptions } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* Generate a width-based srcset string
|
|
4
4
|
*
|
|
@@ -111,12 +111,14 @@ export declare function getFormatExtension(format: ImageFormat): string;
|
|
|
111
111
|
export declare function detectFormat(src: string): ImageFormat | undefined;
|
|
112
112
|
/**
|
|
113
113
|
* Default breakpoint widths for responsive images
|
|
114
|
+
* @defaultValue `[320, 480, 640, 768, 1024, 1280, 1536, 1920, 2560]`
|
|
114
115
|
*/
|
|
115
|
-
export declare const DEFAULT_WIDTHS:
|
|
116
|
+
export declare const DEFAULT_WIDTHS: number[];
|
|
116
117
|
/**
|
|
117
118
|
* Default DPR values for fixed-width images
|
|
119
|
+
* @defaultValue `[1, 1.5, 2, 3]`
|
|
118
120
|
*/
|
|
119
|
-
export declare const DEFAULT_DPR_VALUES:
|
|
121
|
+
export declare const DEFAULT_DPR_VALUES: number[];
|
|
120
122
|
/**
|
|
121
123
|
* Default output formats in order of preference
|
|
122
124
|
*/
|
|
@@ -155,4 +157,4 @@ export declare const COMMON_SIZES: {
|
|
|
155
157
|
quarterDesktop: '(max-width: 480px) 100vw, (max-width: 768px) 50vw, 25vw';
|
|
156
158
|
/** Content width (centered with max-width) */
|
|
157
159
|
contentWidth: '(max-width: 768px) 100vw, (max-width: 1200px) 80vw, 960px'
|
|
158
|
-
};
|
|
160
|
+
};
|
package/dist/media/index.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { MediaConfig } from './types';
|
|
2
|
+
/*"
|
|
3
|
+
* preview
|
|
4
|
+
* />
|
|
5
|
+
* ```
|
|
6
|
+
*/
|
|
7
|
+
// =============================================================================
|
|
8
|
+
// Type Exports
|
|
9
|
+
// =============================================================================
|
|
2
10
|
export type {
|
|
3
11
|
// Placeholder types
|
|
4
12
|
PlaceholderStrategy,
|
|
@@ -96,12 +104,16 @@ export type {
|
|
|
96
104
|
SrcsetOptions,
|
|
97
105
|
SrcsetData,
|
|
98
106
|
} from './types';
|
|
107
|
+
// Export types separately
|
|
99
108
|
export type { ExtendedVideoRenderContext } from './video';
|
|
100
109
|
export type { CacheConfig, CacheEntry } from './shared';
|
|
101
110
|
/**
|
|
102
111
|
* Default media configuration
|
|
103
112
|
*/
|
|
104
113
|
export declare const defaultMediaConfig: MediaConfig;
|
|
114
|
+
// =============================================================================
|
|
115
|
+
// Image Module
|
|
116
|
+
// =============================================================================
|
|
105
117
|
export {
|
|
106
118
|
// Component
|
|
107
119
|
renderImgComponent,
|
|
@@ -182,6 +194,9 @@ export {
|
|
|
182
194
|
validateParams,
|
|
183
195
|
sanitizeParams,
|
|
184
196
|
} from './image';
|
|
197
|
+
// =============================================================================
|
|
198
|
+
// Image Processor Module (ts-images integration)
|
|
199
|
+
// =============================================================================
|
|
185
200
|
export {
|
|
186
201
|
processImage,
|
|
187
202
|
optimizeImage,
|
|
@@ -193,6 +208,9 @@ export {
|
|
|
193
208
|
clearImageCache,
|
|
194
209
|
ImageProcessorCache,
|
|
195
210
|
} from './image/processor';
|
|
211
|
+
// =============================================================================
|
|
212
|
+
// Video Module
|
|
213
|
+
// =============================================================================
|
|
196
214
|
export {
|
|
197
215
|
renderVideoComponent,
|
|
198
216
|
parseVideoDirectiveOptions,
|
|
@@ -200,6 +218,9 @@ export {
|
|
|
200
218
|
createVideoDirective,
|
|
201
219
|
videoDirective,
|
|
202
220
|
} from './video';
|
|
221
|
+
// =============================================================================
|
|
222
|
+
// Video Processor Module (ts-videos integration)
|
|
223
|
+
// =============================================================================
|
|
203
224
|
export {
|
|
204
225
|
processVideo,
|
|
205
226
|
analyzeVideo,
|
|
@@ -213,7 +234,13 @@ export {
|
|
|
213
234
|
clearVideoCache,
|
|
214
235
|
VideoProcessorCache,
|
|
215
236
|
} from './video/processor';
|
|
237
|
+
// =============================================================================
|
|
238
|
+
// Upload Module
|
|
239
|
+
// =============================================================================
|
|
216
240
|
export { renderMediaUpload } from './upload';
|
|
241
|
+
// =============================================================================
|
|
242
|
+
// Protected Media Module
|
|
243
|
+
// =============================================================================
|
|
217
244
|
export {
|
|
218
245
|
// URL signing
|
|
219
246
|
signUrl,
|
|
@@ -243,7 +270,13 @@ export {
|
|
|
243
270
|
// Runtime
|
|
244
271
|
generateSignatureRuntime,
|
|
245
272
|
} from './protected';
|
|
273
|
+
// =============================================================================
|
|
274
|
+
// Media Manager Module
|
|
275
|
+
// =============================================================================
|
|
246
276
|
export { generateMediaManagerEmbed, generateSimpleMediaPicker } from './manager/embed';
|
|
277
|
+
// =============================================================================
|
|
278
|
+
// Client Runtime Module
|
|
279
|
+
// =============================================================================
|
|
247
280
|
export {
|
|
248
281
|
// Lazy loading
|
|
249
282
|
isNativeLazySupported,
|
|
@@ -280,6 +313,9 @@ export {
|
|
|
280
313
|
generateMediaRuntime,
|
|
281
314
|
generateMinifiedMediaRuntime,
|
|
282
315
|
} from './client';
|
|
316
|
+
// =============================================================================
|
|
317
|
+
// Shared Utilities
|
|
318
|
+
// =============================================================================
|
|
283
319
|
export {
|
|
284
320
|
hashFile,
|
|
285
321
|
hashBuffer,
|
|
@@ -292,4 +328,4 @@ export {
|
|
|
292
328
|
clearCache,
|
|
293
329
|
getCacheStats,
|
|
294
330
|
pruneCache,
|
|
295
|
-
} from './shared';
|
|
331
|
+
} from './shared';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ProtectedMediaProps, } from '../types';
|
|
1
|
+
import type { ProtectedMediaProps } from '../types';
|
|
3
2
|
/**
|
|
4
3
|
* Render a protected image component
|
|
5
4
|
*
|
|
@@ -31,4 +30,4 @@ export declare function processProtectedMedia(content: string, signatureEndpoint
|
|
|
31
30
|
/**
|
|
32
31
|
* Parse @protected directive arguments
|
|
33
32
|
*/
|
|
34
|
-
export declare function parseProtectedArgs(content: string, params: Record<string, unknown>, context: Record<string, unknown>): ProtectedMediaProps;
|
|
33
|
+
export declare function parseProtectedArgs(content: string, params: Record<string, unknown>, context: Record<string, unknown>): ProtectedMediaProps;
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STX Media - Protected Media Module
|
|
3
|
+
*
|
|
4
|
+
* Content protection via signed URLs and authentication.
|
|
5
|
+
*
|
|
6
|
+
* @module media/protected
|
|
7
|
+
*/
|
|
8
|
+
// =============================================================================
|
|
9
|
+
// Signature Exports
|
|
10
|
+
// =============================================================================
|
|
1
11
|
export {
|
|
2
12
|
// URL signing
|
|
3
13
|
signUrl,
|
|
@@ -21,6 +31,9 @@ export {
|
|
|
21
31
|
// Runtime
|
|
22
32
|
generateSignatureRuntime,
|
|
23
33
|
} from './signature';
|
|
34
|
+
// =============================================================================
|
|
35
|
+
// Component Exports
|
|
36
|
+
// =============================================================================
|
|
24
37
|
export {
|
|
25
38
|
// Components
|
|
26
39
|
renderProtectedImg,
|
|
@@ -31,4 +44,4 @@ export {
|
|
|
31
44
|
|
|
32
45
|
// Directive helpers
|
|
33
46
|
parseProtectedArgs,
|
|
34
|
-
} from './component';
|
|
47
|
+
} from './component';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BatchSignatureResult, ProtectedAuthContext, SignatureConfig, SignedUrl
|
|
1
|
+
import type { BatchSignatureResult, ProtectedAuthContext, SignatureConfig, SignedUrl } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* Sign a single URL for protected access
|
|
4
4
|
*
|
|
@@ -69,4 +69,4 @@ export declare function pruneSignatureCache(): number;
|
|
|
69
69
|
/**
|
|
70
70
|
* Generate client-side signature handler runtime
|
|
71
71
|
*/
|
|
72
|
-
export declare function generateSignatureRuntime(): string;
|
|
72
|
+
export declare function generateSignatureRuntime(): string;
|