@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/a11y.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ export declare function autoFixA11y(html: string, config?: A11yAutoFixConfig): A
|
|
|
73
73
|
* @param writeBack - Whether to write the fixed content back to the file
|
|
74
74
|
* @returns Fix result
|
|
75
75
|
*/
|
|
76
|
-
export declare function autoFixA11yFile(filePath: string, config?: A11yAutoFixConfig, writeBack?:
|
|
76
|
+
export declare function autoFixA11yFile(filePath: string, config?: A11yAutoFixConfig, writeBack?: boolean): Promise<A11yFixResult>;
|
|
77
77
|
/**
|
|
78
78
|
* Auto-fix accessibility issues in a directory of files.
|
|
79
79
|
*
|
|
@@ -96,10 +96,6 @@ export declare function autoFixA11yDirectory(directory: string, config?: A11yAut
|
|
|
96
96
|
* Register all a11y directives
|
|
97
97
|
*/
|
|
98
98
|
export declare function registerA11yDirectives(): CustomDirective[];
|
|
99
|
-
/**
|
|
100
|
-
* A11y directive for adding accessibility hints
|
|
101
|
-
*/
|
|
102
|
-
export declare const a11yDirective: CustomDirective;
|
|
103
99
|
/**
|
|
104
100
|
* Screen reader directive for screen reader only content
|
|
105
101
|
*/
|
|
@@ -141,4 +137,4 @@ export declare interface A11yAutoFixConfig {
|
|
|
141
137
|
fixPositiveTabindex?: boolean
|
|
142
138
|
fixButtonFocusable?: boolean
|
|
143
139
|
defaultLang?: string
|
|
144
|
-
}
|
|
140
|
+
}
|
package/dist/analytics.d.ts
CHANGED
|
@@ -37,4 +37,4 @@ export declare function injectAnalytics(html: string, options: StxOptions): stri
|
|
|
37
37
|
/**
|
|
38
38
|
* Custom @analytics directive for explicit placement
|
|
39
39
|
*/
|
|
40
|
-
export declare const analyticsDirective: CustomDirective;
|
|
40
|
+
export declare const analyticsDirective: CustomDirective;
|
package/dist/analyzer.d.ts
CHANGED
package/dist/animation.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import type { CustomDirective, StxOptions } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Process animation directives in the template
|
|
4
|
-
*/
|
|
5
|
-
export declare function processAnimationDirectives(template: string, context: Record<string, any>, filePath: string, options: StxOptions): string;
|
|
6
2
|
/**
|
|
7
3
|
* Create an animation timeline for coordinated animations
|
|
8
4
|
*/
|
|
@@ -33,59 +29,6 @@ export declare const DEFAULT_TRANSITION_OPTIONS: {
|
|
|
33
29
|
ease: string
|
|
34
30
|
direction: string
|
|
35
31
|
};
|
|
36
|
-
/**
|
|
37
|
-
* Transition directive for applying transitions to elements
|
|
38
|
-
*/
|
|
39
|
-
export declare const transitionDirective: CustomDirective;
|
|
40
|
-
/**
|
|
41
|
-
* Scroll animation directive for triggering animations on scroll
|
|
42
|
-
*/
|
|
43
|
-
export declare const scrollAnimateDirective: CustomDirective;
|
|
44
|
-
/**
|
|
45
|
-
* Animation group directive for coordinating multiple animations
|
|
46
|
-
*/
|
|
47
|
-
export declare const animationGroupDirective: CustomDirective;
|
|
48
|
-
/**
|
|
49
|
-
* Motion preferences directive for controlling animation preferences
|
|
50
|
-
*/
|
|
51
|
-
export declare const motionDirective: CustomDirective;
|
|
52
|
-
/** Preset spring configurations */
|
|
53
|
-
export declare const SPRING_PRESETS: {
|
|
54
|
-
default: {
|
|
55
|
-
stiffness: 100;
|
|
56
|
-
damping: 10;
|
|
57
|
-
mass: 1
|
|
58
|
-
};
|
|
59
|
-
gentle: {
|
|
60
|
-
stiffness: 120;
|
|
61
|
-
damping: 14;
|
|
62
|
-
mass: 1
|
|
63
|
-
};
|
|
64
|
-
wobbly: {
|
|
65
|
-
stiffness: 180;
|
|
66
|
-
damping: 12;
|
|
67
|
-
mass: 1
|
|
68
|
-
};
|
|
69
|
-
stiff: {
|
|
70
|
-
stiffness: 210;
|
|
71
|
-
damping: 20;
|
|
72
|
-
mass: 1
|
|
73
|
-
};
|
|
74
|
-
slow: {
|
|
75
|
-
stiffness: 280;
|
|
76
|
-
damping: 60;
|
|
77
|
-
mass: 1
|
|
78
|
-
};
|
|
79
|
-
molasses: {
|
|
80
|
-
stiffness: 280;
|
|
81
|
-
damping: 120;
|
|
82
|
-
mass: 1
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
* @keyframe directive for custom keyframe animations
|
|
87
|
-
*/
|
|
88
|
-
export declare const keyframeDirective: CustomDirective;
|
|
89
32
|
/**
|
|
90
33
|
* @stagger directive for staggered child animations
|
|
91
34
|
*/
|
|
@@ -94,34 +37,15 @@ export declare const staggerDirective: CustomDirective;
|
|
|
94
37
|
* @spring directive for spring physics animations
|
|
95
38
|
*/
|
|
96
39
|
export declare const springDirective: CustomDirective;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
keyframes: Keyframe[]
|
|
107
|
-
options: KeyframeAnimationOptions
|
|
108
|
-
}
|
|
109
|
-
/** Keyframe animation options */
|
|
110
|
-
export declare interface KeyframeAnimationOptions {
|
|
111
|
-
duration: number
|
|
112
|
-
delay?: number
|
|
113
|
-
easing?: string
|
|
114
|
-
iterations?: number | 'infinite'
|
|
115
|
-
direction?: 'normal' | 'reverse' | 'alternate' | 'alternate-reverse'
|
|
116
|
-
fill?: 'none' | 'forwards' | 'backwards' | 'both'
|
|
117
|
-
}
|
|
118
|
-
/** Spring animation config */
|
|
119
|
-
export declare interface SpringConfig {
|
|
120
|
-
stiffness: number
|
|
121
|
-
damping: number
|
|
122
|
-
mass: number
|
|
123
|
-
velocity?: number
|
|
124
|
-
}
|
|
40
|
+
declare type = : TransitionType,
|
|
41
|
+
options: {
|
|
42
|
+
duration?: number
|
|
43
|
+
delay?: number
|
|
44
|
+
ease?: TransitionEase
|
|
45
|
+
direction?: TransitionDirection
|
|
46
|
+
custom?: string
|
|
47
|
+
} = {},
|
|
48
|
+
): string {;
|
|
125
49
|
/**
|
|
126
50
|
* Available transition types that can be used with @transition directive
|
|
127
51
|
*/
|
|
@@ -151,4 +75,4 @@ export declare enum TransitionEase {
|
|
|
151
75
|
EaseOut = 'ease-out',
|
|
152
76
|
EaseInOut = 'ease-in-out',
|
|
153
77
|
Spring = 'spring',
|
|
154
|
-
}
|
|
78
|
+
}
|
package/dist/app.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare interface StxAppPlugin {
|
|
|
24
24
|
/** The stx application instance */
|
|
25
25
|
export declare interface StxApp {
|
|
26
26
|
use(plugin: StxPluginInput, ...options: any[]): StxApp
|
|
27
|
-
provide(key: string | symbol, value: T): StxApp
|
|
27
|
+
provide<T>(key: string | symbol, value: T): StxApp
|
|
28
28
|
component(name: string, definition?: any): StxApp | any
|
|
29
29
|
directive(name: string, definition?: CustomDirective | Record<string, any>): StxApp | any
|
|
30
30
|
mount(rootContainer?: string | Element): StxApp
|
|
@@ -41,11 +41,9 @@ export declare interface StxAppConfig {
|
|
|
41
41
|
globalProperties: Record<string, any>
|
|
42
42
|
performance: boolean
|
|
43
43
|
compilerOptions: {
|
|
44
|
-
/** Custom element tag pattern */
|
|
45
44
|
isCustomElement?: (tag: string) => boolean
|
|
46
|
-
/** Whitespace handling */
|
|
47
45
|
whitespace?: 'condense' | 'preserve'
|
|
48
46
|
}
|
|
49
47
|
}
|
|
50
48
|
/** Plugin can be an object with install() or a plain function */
|
|
51
|
-
export type StxPluginInput = StxAppPlugin | ((app: StxApp, ...options: any[]) => void)
|
|
49
|
+
export type StxPluginInput = StxAppPlugin | ((app: StxApp, ...options: any[]) => void);
|
package/dist/assets.d.ts
CHANGED
package/dist/ast.d.ts
CHANGED
|
@@ -242,7 +242,7 @@ export type ASTNode = | DocumentNode
|
|
|
242
242
|
| AttributeNode
|
|
243
243
|
| CommentNode
|
|
244
244
|
| ScriptNode
|
|
245
|
-
| StyleNode
|
|
245
|
+
| StyleNode;
|
|
246
246
|
/**
|
|
247
247
|
* Token types for lexer (reserved for future tokenizer implementation)
|
|
248
248
|
*/
|
|
@@ -256,31 +256,10 @@ declare type _TokenType = | 'TEXT'
|
|
|
256
256
|
| 'TAG_OPEN'
|
|
257
257
|
| 'TAG_CLOSE'
|
|
258
258
|
| 'TAG_SELF_CLOSE'
|
|
259
|
-
| 'EOF'
|
|
259
|
+
| 'EOF';
|
|
260
260
|
/**
|
|
261
261
|
* Simple template parser
|
|
262
262
|
*/
|
|
263
263
|
export declare class TemplateParser {
|
|
264
|
-
private source: string;
|
|
265
|
-
private pos: number;
|
|
266
|
-
private line: number;
|
|
267
|
-
private column: number;
|
|
268
|
-
private filePath?: string;
|
|
269
264
|
parse(template: string, filePath?: string): DocumentNode;
|
|
270
|
-
|
|
271
|
-
private parseNext(): ASTNode | null;
|
|
272
|
-
private parseText(): TextNode | null;
|
|
273
|
-
private parseExpression(escaped: boolean): ExpressionNode;
|
|
274
|
-
private parseDirective(): DirectiveNode;
|
|
275
|
-
private parseParenthesized(): string;
|
|
276
|
-
private parseStxComment(): CommentNode;
|
|
277
|
-
private parseHtmlComment(): CommentNode;
|
|
278
|
-
private parseTag(): ElementNode | ComponentNode;
|
|
279
|
-
private parseAttributes(): AttributeNode[];
|
|
280
|
-
private parseAttribute(): AttributeNode | null;
|
|
281
|
-
private parseScript(): ScriptNode;
|
|
282
|
-
private parseStyle(): StyleNode;
|
|
283
|
-
private advance(count?: number): void;
|
|
284
|
-
private skipWhitespace(): void;
|
|
285
|
-
private getPosition(): Position;
|
|
286
|
-
}
|
|
265
|
+
}
|
package/dist/auth.d.ts
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* @param {Record<string, any>} context - The context object containing variables
|
|
8
8
|
* @returns The evaluated result
|
|
9
9
|
*/
|
|
10
|
-
export declare function evaluateAuthExpression(expression: string, context: Record<string, any>): any;
|
|
10
|
+
export declare function evaluateAuthExpression(expression: string, context: Record<string, any>): any;
|
|
@@ -30,7 +30,6 @@ export declare function useSessionStorage<T>(key: string, defaultValue: T): { va
|
|
|
30
30
|
export declare function useEventListener<K extends keyof WindowEventMap>(event: K, handler: (e: WindowEventMap[K]) => void, options?: AddEventListenerOptions): () => void;
|
|
31
31
|
export declare function useEventListener<K extends keyof DocumentEventMap>(target: Document, event: K, handler: (e: DocumentEventMap[K]) => void, options?: AddEventListenerOptions): () => void;
|
|
32
32
|
export declare function useEventListener<K extends keyof HTMLElementEventMap>(target: MaybeRef<HTMLElement | null>, event: K, handler: (e: HTMLElementEventMap[K]) => void, options?: AddEventListenerOptions): () => void;
|
|
33
|
-
export declare function useEventListener(...args: any[]): () => void;
|
|
34
33
|
/**
|
|
35
34
|
* Detect clicks outside an element.
|
|
36
35
|
*
|
|
@@ -192,7 +191,7 @@ export declare function useTimeout(callback: () => void, delay: number): {
|
|
|
192
191
|
* setOpen(false) // false
|
|
193
192
|
* ```
|
|
194
193
|
*/
|
|
195
|
-
export declare function useToggle(initial?:
|
|
194
|
+
export declare function useToggle(initial?: boolean): [{ value: boolean }, () => void, (value: boolean) => void];
|
|
196
195
|
/**
|
|
197
196
|
* Counter with controls.
|
|
198
197
|
*
|
|
@@ -204,7 +203,7 @@ export declare function useToggle(initial?: any): [{ value: boolean }, () => voi
|
|
|
204
203
|
* dec() // 5
|
|
205
204
|
* ```
|
|
206
205
|
*/
|
|
207
|
-
export declare function useCounter(initial?:
|
|
206
|
+
export declare function useCounter(initial?: number, options?: { min?: number; max?: number }): {
|
|
208
207
|
count: { value: number }
|
|
209
208
|
inc: (delta?: number) => void
|
|
210
209
|
dec: (delta?: number) => void
|
|
@@ -296,6 +295,9 @@ export declare function useAsync<T>(fn: () => Promise<T>, options?: { immediate?
|
|
|
296
295
|
error: { readonly value: Error | null }
|
|
297
296
|
execute: () => Promise<T | null>
|
|
298
297
|
};
|
|
298
|
+
// =============================================================================
|
|
299
|
+
// Async Composables
|
|
300
|
+
// =============================================================================
|
|
299
301
|
declare interface UseFetchOptions<T> {
|
|
300
302
|
immediate?: boolean
|
|
301
303
|
initialData?: T
|
|
@@ -311,4 +313,4 @@ declare interface UseFetchReturn<T> {
|
|
|
311
313
|
// =============================================================================
|
|
312
314
|
// Types
|
|
313
315
|
// =============================================================================
|
|
314
|
-
declare type MaybeRef<T> = T | { value: T }
|
|
316
|
+
declare type MaybeRef<T> = T | { value: T }
|
|
@@ -46,34 +46,6 @@ export declare function optimizeTemplate(template: string, options?: Optimizatio
|
|
|
46
46
|
* Create optimized build for multiple templates.
|
|
47
47
|
*/
|
|
48
48
|
export declare function createOptimizedBuild(templates: Map<string, string>, options?: OptimizationOptions): Promise<BuildResult>;
|
|
49
|
-
/**
|
|
50
|
-
* Build-Time Optimization Module
|
|
51
|
-
*
|
|
52
|
-
* Provides tree-shaking, dead code elimination, and compile-time optimizations
|
|
53
|
-
* for stx templates to reduce bundle size and improve runtime performance.
|
|
54
|
-
*
|
|
55
|
-
* ## Features
|
|
56
|
-
*
|
|
57
|
-
* 1. **Tree-Shaking** - Remove unused directive handlers from compiled output
|
|
58
|
-
* 2. **Dead Code Elimination** - Remove unreachable template branches
|
|
59
|
-
* 3. **Constant Folding** - Pre-evaluate static expressions
|
|
60
|
-
* 4. **String Pooling** - Deduplicate repeated string literals
|
|
61
|
-
* 5. **HTML Minification** - Remove whitespace and comments from static HTML
|
|
62
|
-
*
|
|
63
|
-
* ## Usage
|
|
64
|
-
*
|
|
65
|
-
* ```typescript
|
|
66
|
-
* import { optimizeTemplate, createOptimizedBuild } from 'stx/build-optimizer'
|
|
67
|
-
*
|
|
68
|
-
* // Optimize a single template
|
|
69
|
-
* const optimized = optimizeTemplate(template, { treeShake: true })
|
|
70
|
-
*
|
|
71
|
-
* // Create optimized build for multiple templates
|
|
72
|
-
* const build = await createOptimizedBuild(templates, options)
|
|
73
|
-
* ```
|
|
74
|
-
*
|
|
75
|
-
* @module build-optimizer
|
|
76
|
-
*/
|
|
77
49
|
/** Optimization options */
|
|
78
50
|
export declare interface OptimizationOptions {
|
|
79
51
|
treeShake?: boolean
|
|
@@ -120,7 +92,10 @@ declare interface DeadBranch {
|
|
|
120
92
|
end: number
|
|
121
93
|
reason: string
|
|
122
94
|
}
|
|
95
|
+
// =============================================================================
|
|
96
|
+
// Export Analysis Functions
|
|
97
|
+
// =============================================================================
|
|
123
98
|
export {
|
|
124
99
|
analyzeDirectiveUsage as analyzeUsage,
|
|
125
100
|
findDeadBranches as findDeadCode,
|
|
126
|
-
};
|
|
101
|
+
};
|
package/dist/build-views.d.ts
CHANGED
|
@@ -11,6 +11,24 @@ export declare function buildViews(options: ViewBuildOptions): Promise<BuildResu
|
|
|
11
11
|
* Watch views directory and rebuild on changes
|
|
12
12
|
*/
|
|
13
13
|
export declare function watchViews(options: ViewBuildOptions, callback?: (result: BuildResult) => void): { close: () => void };
|
|
14
|
+
/**
|
|
15
|
+
* Render a .stx email template to an email-ready HTML string
|
|
16
|
+
*
|
|
17
|
+
* Optimized for email rendering:
|
|
18
|
+
* - Disables SEO tag injection
|
|
19
|
+
* - Inlines utility classes as style attributes (via Crosswind)
|
|
20
|
+
* - Strips <style> and <script> blocks
|
|
21
|
+
* - Returns clean HTML + plain text suitable for email
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const { html, text } = await renderEmail('resources/emails/welcome.stx', {
|
|
26
|
+
* userName: 'John',
|
|
27
|
+
* unsubscribeUrl: 'https://example.com/unsubscribe?token=abc',
|
|
28
|
+
* })
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare function renderEmail(templatePath: string, props?: Record<string, unknown>, options?: Partial<StxOptions>): Promise<{ html: string, text: string }>;
|
|
14
32
|
export declare interface ViewBuildOptions {
|
|
15
33
|
viewsDir: string
|
|
16
34
|
outputDir: string
|
|
@@ -34,4 +52,5 @@ export declare interface BuildResult {
|
|
|
34
52
|
errors: Array<{ file: string; error: string }>
|
|
35
53
|
duration: number
|
|
36
54
|
}
|
|
37
|
-
export
|
|
55
|
+
// Default export for convenience
|
|
56
|
+
export default buildViews;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { collectBundleStats, formatBytes, parseSize } from './collector';
|
|
2
|
-
import { generateReport, analyzeBundle } from './report';
|
|
3
|
-
import { generateTreemap, openInBrowser } from './treemap';
|
|
1
|
+
import { collectBundleStats, formatBytes, parseSize, type CollectorOptions } from './collector';
|
|
2
|
+
import { generateReport, analyzeBundle, type ReportOptions } from './report';
|
|
3
|
+
import { generateTreemap, openInBrowser, type TreemapOptions } from './treemap';
|
|
4
4
|
/**
|
|
5
5
|
* Analyze a bundle directory and generate a report
|
|
6
6
|
*/
|
|
@@ -32,6 +32,36 @@ export declare interface AnalyzeOptions {
|
|
|
32
32
|
topModules?: number
|
|
33
33
|
parseImports?: boolean
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* STX Bundle Analyzer
|
|
37
|
+
*
|
|
38
|
+
* Analyze and visualize bundle composition for optimization.
|
|
39
|
+
*
|
|
40
|
+
* @module bundle-analyzer
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```bash
|
|
44
|
+
* # Generate HTML treemap
|
|
45
|
+
* stx analyze dist/
|
|
46
|
+
*
|
|
47
|
+
* # JSON output for CI
|
|
48
|
+
* stx analyze dist/ --json
|
|
49
|
+
*
|
|
50
|
+
* # Check size threshold
|
|
51
|
+
* stx analyze dist/ --threshold 500KB
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* import { collectBundleStats, generateReport, generateTreemap } from 'stx/bundle-analyzer'
|
|
57
|
+
*
|
|
58
|
+
* const stats = await collectBundleStats('dist/')
|
|
59
|
+
* console.log(generateReport(stats, { format: 'text' }))
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
// ============================================================================
|
|
63
|
+
// Collector Exports
|
|
64
|
+
// ============================================================================
|
|
35
65
|
export {
|
|
36
66
|
collectBundleStats,
|
|
37
67
|
formatBytes,
|
|
@@ -44,6 +74,9 @@ export {
|
|
|
44
74
|
type BundleStats,
|
|
45
75
|
type CollectorOptions,
|
|
46
76
|
} from './collector';
|
|
77
|
+
// ============================================================================
|
|
78
|
+
// Report Exports
|
|
79
|
+
// ============================================================================
|
|
47
80
|
export {
|
|
48
81
|
generateReport,
|
|
49
82
|
analyzeBundle,
|
|
@@ -53,8 +86,11 @@ export {
|
|
|
53
86
|
type AnalysisIssue,
|
|
54
87
|
type Recommendation,
|
|
55
88
|
} from './report';
|
|
89
|
+
// ============================================================================
|
|
90
|
+
// Treemap Exports
|
|
91
|
+
// ============================================================================
|
|
56
92
|
export {
|
|
57
93
|
generateTreemap,
|
|
58
94
|
openInBrowser,
|
|
59
95
|
type TreemapOptions,
|
|
60
|
-
} from './treemap';
|
|
96
|
+
} from './treemap';
|
package/dist/caching.d.ts
CHANGED