@stacksjs/stx 0.2.154 → 0.2.156
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 +87 -46
- package/dist/animation.d.ts +96 -42
- package/dist/appearance-bootstrap.d.ts +49 -15
- package/dist/asset-roots.d.ts +32 -0
- package/dist/asset-roots.js +7 -0
- package/dist/assets.d.ts +9 -7
- package/dist/async-components.d.ts +78 -56
- package/dist/auth.d.ts +3 -0
- package/dist/build-externalize.d.ts +40 -0
- package/dist/build-externalize.js +63 -0
- package/dist/build-id.d.ts +22 -22
- package/dist/build-message.d.ts +73 -2
- package/dist/build-message.js +47 -8
- package/dist/builtins/attrs.d.ts +14 -0
- package/dist/builtins/drawer.d.ts +22 -0
- package/dist/builtins/icon.d.ts +16 -2
- package/dist/builtins/index.d.ts +5 -15
- package/dist/builtins/modal.d.ts +24 -0
- package/dist/builtins/safe-image.d.ts +42 -0
- package/dist/builtins/stx-image.d.ts +27 -0
- package/dist/builtins/stx-link.d.ts +9 -0
- package/dist/builtins/stx-loading-indicator.d.ts +11 -0
- package/dist/builtins/suspense.d.ts +28 -0
- package/dist/builtins/toast.d.ts +17 -0
- package/dist/builtins/transition-group.d.ts +25 -0
- package/dist/caching.d.ts +12 -15
- package/dist/cli.js +1798 -908
- package/dist/client/directive.d.ts +7 -0
- package/dist/client/index.d.ts +0 -1
- package/dist/client-script-bundler.d.ts +63 -5
- package/dist/client-script-bundler.js +30 -2
- package/dist/client-script.d.ts +102 -47
- package/dist/client-script.js +15 -3
- package/dist/codemod.d.ts +56 -0
- package/dist/codemod.js +192 -0
- package/dist/color-mode-boot.d.ts +83 -65
- package/dist/component-client-factories.d.ts +1 -6
- package/dist/component-processing.d.ts +58 -49
- package/dist/component-processing.js +1 -1
- package/dist/component-registry.d.ts +94 -31
- package/dist/component-renderer.d.ts +18 -0
- package/dist/composable-loader.d.ts +24 -0
- package/dist/composable-loader.js +12 -9
- package/dist/composables/index.d.ts +7 -0
- package/dist/composables/index.js +1 -0
- package/dist/composables/use-fetch.js +30 -2
- package/dist/composables/use-form.d.ts +91 -0
- package/dist/composables/use-form.js +112 -0
- package/dist/composables.d.ts +64 -60
- package/dist/computed.d.ts +86 -92
- package/dist/conditionals.d.ts +24 -8
- package/dist/conditionals.js +16 -0
- package/dist/config.d.ts +34 -21
- package/dist/config.js +35 -14
- package/dist/craft.js +1476 -768
- package/dist/crosswind-config.d.ts +58 -0
- package/dist/crosswind-config.js +40 -0
- package/dist/csp.d.ts +107 -41
- package/dist/defer.d.ts +24 -0
- package/dist/dev-server/crosswind.d.ts +35 -26
- package/dist/dev-server/crosswind.js +2 -18
- package/dist/dev-server/serve-app.js +4 -3
- package/dist/dev-server/terminal-colors.d.ts +32 -32
- package/dist/directive-api.d.ts +86 -43
- package/dist/document-shell.d.ts +54 -41
- package/dist/dynamic-components.d.ts +9 -0
- package/dist/error-boundaries.d.ts +47 -41
- package/dist/error-handling.d.ts +1 -1
- package/dist/errors/codes.d.ts +51 -43
- package/dist/errors/formatter.d.ts +58 -38
- package/dist/errors/index.d.ts +5 -61
- package/dist/errors/logger.d.ts +114 -40
- package/dist/errors/sanitizer.d.ts +53 -23
- package/dist/errors/types.d.ts +44 -31
- package/dist/events.d.ts +86 -25
- package/dist/expressions.d.ts +50 -42
- package/dist/forms-validation.d.ts +138 -123
- package/dist/forms-validation.js +1 -90
- package/dist/forms.d.ts +120 -66
- package/dist/forms.js +31 -11
- package/dist/fragment-container.d.ts +57 -0
- package/dist/fragment-container.js +109 -0
- package/dist/framework-composables.d.ts +32 -0
- package/dist/head.d.ts +156 -114
- package/dist/heatmap.d.ts +152 -72
- package/dist/html-masking.d.ts +40 -34
- package/dist/hydration-runtime.d.ts +20 -24
- package/dist/i18n.d.ts +93 -32
- package/dist/image-optimization/auto-sibling.d.ts +32 -4
- package/dist/includes.d.ts +69 -7
- package/dist/index.d.ts +66 -0
- package/dist/index.js +23 -0
- package/dist/internal-markdown.d.ts +12 -8
- package/dist/island-chunking.d.ts +30 -13
- package/dist/keep-alive.d.ts +72 -52
- package/dist/layout-types.d.ts +45 -0
- package/dist/layout-types.js +56 -0
- package/dist/lazy-module.d.ts +10 -0
- package/dist/loops.d.ts +66 -0
- package/dist/loops.js +47 -6
- package/dist/markdown.d.ts +0 -1
- package/dist/media/image/component.d.ts +25 -9
- package/dist/media/image/directive.d.ts +15 -1
- package/dist/media/image/placeholder.d.ts +20 -9
- package/dist/media/image/processor/cache.d.ts +40 -18
- package/dist/media/image/processor/index.d.ts +1 -10
- package/dist/media/image/processor/optimizer.d.ts +12 -1
- package/dist/media/image/processor/responsive.d.ts +16 -6
- package/dist/media/image/srcset.d.ts +47 -50
- package/dist/media/shared/cache.d.ts +51 -31
- package/dist/media/shared/hash.d.ts +7 -0
- package/dist/media/types.d.ts +1235 -754
- package/dist/media/video/directive.d.ts +15 -1
- package/dist/media/video/index.d.ts +39 -17
- package/dist/media/video/processor/cache.d.ts +42 -19
- package/dist/media/video/processor/index.d.ts +1 -18
- package/dist/media/video/processor/streaming.d.ts +17 -10
- package/dist/media/video/processor/thumbnail.d.ts +21 -15
- package/dist/media/video/processor/transcoder.d.ts +11 -1
- package/dist/method-spoofing.d.ts +7 -0
- package/dist/middleware.d.ts +60 -0
- package/dist/owned-routes.d.ts +42 -0
- package/dist/owned-routes.js +26 -0
- package/dist/page-meta.d.ts +38 -0
- package/dist/page-meta.js +16 -0
- package/dist/parser/directive-parser.d.ts +57 -45
- package/dist/parser/expression-parser.d.ts +33 -35
- package/dist/parser/index.d.ts +4 -39
- package/dist/parser/tokenizer.d.ts +61 -49
- package/dist/partial-hydration.d.ts +82 -50
- package/dist/performance-utils.d.ts +217 -124
- package/dist/placeholder.d.ts +18 -9
- package/dist/plugin-system.d.ts +264 -115
- package/dist/process.d.ts +11 -6
- package/dist/process.js +21 -4
- package/dist/production-builder.js +7 -0
- package/dist/prop-sentinels.d.ts +11 -11
- package/dist/public-env.d.ts +14 -0
- package/dist/pwa/directives.d.ts +12 -3
- package/dist/pwa/inject.d.ts +10 -0
- package/dist/pwa/precache.d.ts +22 -16
- package/dist/pwa/service-worker.d.ts +12 -0
- package/dist/pwa.js +1318 -610
- package/dist/reactive-bindings.d.ts +34 -11
- package/dist/reactive.d.ts +58 -30
- package/dist/reactive.js +56 -31
- package/dist/render.js +1 -0
- package/dist/route-middleware.d.ts +2 -35
- package/dist/route-types.d.ts +134 -0
- package/dist/route-types.js +24 -0
- package/dist/router.d.ts +5 -7
- package/dist/routes.d.ts +1 -3
- package/dist/runtime-globals.d.ts +147 -24
- package/dist/runtime-globals.js +16 -1
- package/dist/runtime-injection.d.ts +8 -0
- package/dist/runtime-injection.js +33 -24
- package/dist/script-emit.d.ts +30 -0
- package/dist/script-json.d.ts +36 -0
- package/dist/script-json.js +6 -0
- package/dist/script-validation.d.ts +21 -4
- package/dist/seo.d.ts +118 -47
- package/dist/server-bindings.d.ts +21 -0
- package/dist/sfc-template.d.ts +8 -8
- package/dist/signal-processing.d.ts +35 -15
- package/dist/signals-api.d.ts +117 -58
- package/dist/signals-api.js +7 -4
- package/dist/signals.d.ts +24 -17
- package/dist/signals.js +765 -60
- package/dist/site-builder/build.js +8 -0
- package/dist/site-url.d.ts +46 -0
- package/dist/site-url.js +70 -0
- package/dist/slots.d.ts +86 -20
- package/dist/source-signature.d.ts +45 -0
- package/dist/source-signature.js +20 -0
- package/dist/ssg.d.ts +285 -142
- package/dist/ssg.js +1268 -556
- package/dist/state-dir.d.ts +4 -4
- package/dist/state-management.d.ts +0 -12
- package/dist/state-management.js +8 -25
- package/dist/store-imports.d.ts +23 -0
- package/dist/store-imports.js +3 -0
- package/dist/store-loader.d.ts +10 -0
- package/dist/store-loader.js +10 -9
- package/dist/story/analytics.d.ts +138 -60
- package/dist/story/bookmarks.d.ts +87 -34
- package/dist/story/cli.d.ts +123 -69
- package/dist/story/collect/scanner.d.ts +4 -0
- package/dist/story/collect/tree.d.ts +8 -1
- package/dist/story/commands/build.d.ts +11 -6
- package/dist/story/commands/dev.d.ts +15 -8
- package/dist/story/commands/preview.d.ts +13 -7
- package/dist/story/config-watcher.d.ts +20 -13
- package/dist/story/config.d.ts +11 -8
- package/dist/story/context.d.ts +14 -8
- package/dist/story/hmr.d.ts +24 -26
- package/dist/story/hot-swap.d.ts +34 -23
- package/dist/story/keyboard-shortcuts.d.ts +23 -18
- package/dist/story/output.d.ts +46 -44
- package/dist/story/performance.d.ts +107 -45
- package/dist/story/presets.d.ts +107 -41
- package/dist/story/renderer.d.ts +41 -27
- package/dist/story/search.d.ts +23 -12
- package/dist/story/server.d.ts +21 -11
- package/dist/story/setup.d.ts +23 -15
- package/dist/story/testing.d.ts +65 -40
- package/dist/story/types.d.ts +262 -160
- package/dist/streaming.d.ts +119 -57
- package/dist/stx-virtual-ts.d.ts +165 -0
- package/dist/stx-virtual-ts.js +372 -0
- package/dist/stx.d.ts +78 -1
- package/dist/style-scoping.d.ts +17 -4
- package/dist/suspense.d.ts +67 -52
- package/dist/teleport.d.ts +22 -0
- package/dist/template-tag-balance.d.ts +22 -6
- package/dist/transitions.d.ts +66 -55
- package/dist/typecheck.d.ts +77 -0
- package/dist/typecheck.js +156 -0
- package/dist/types/component-types.d.ts +187 -122
- package/dist/types/config-types.d.ts +758 -297
- package/dist/types/context-types.d.ts +46 -24
- package/dist/types/csp-types.d.ts +70 -66
- package/dist/types/directive-types.d.ts +211 -155
- package/dist/types/index.d.ts +6 -109
- package/dist/types/pwa-types.d.ts +273 -148
- package/dist/types.d.ts +0 -1
- package/dist/typescript-templates.d.ts +11 -0
- package/dist/unresolved-identifiers.d.ts +24 -22
- package/dist/unresolved-identifiers.js +2 -0
- package/dist/utils.d.ts +24 -21
- package/dist/validator.d.ts +28 -26
- package/dist/variable-extractor.d.ts +48 -13
- package/dist/variable-extractor.js +27 -4
- package/dist/view-composers.d.ts +80 -81
- package/dist/virtual-scrolling.d.ts +101 -81
- package/dist/vue-template.d.ts +23 -0
- package/dist/web-components/css-scoping.d.ts +21 -11
- package/dist/web-components.d.ts +81 -58
- package/dist/x-element.d.ts +0 -1
- package/package.json +5 -5
- package/stx.d.ts +78 -1
package/dist/story/output.d.ts
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STX Story - Pretty terminal output
|
|
3
|
+
* ANSI color codes for terminal styling without external dependencies
|
|
4
|
+
*/
|
|
5
|
+
declare const colors: {
|
|
6
|
+
black: string;
|
|
7
|
+
red: string;
|
|
8
|
+
green: string;
|
|
9
|
+
yellow: string;
|
|
10
|
+
blue: string;
|
|
11
|
+
magenta: string;
|
|
12
|
+
cyan: string;
|
|
13
|
+
white: string;
|
|
14
|
+
gray: string;
|
|
15
|
+
brightRed: string;
|
|
16
|
+
brightGreen: string;
|
|
17
|
+
brightYellow: string;
|
|
18
|
+
brightBlue: string;
|
|
19
|
+
brightMagenta: string;
|
|
20
|
+
brightCyan: string;
|
|
21
|
+
brightWhite: string;
|
|
22
|
+
};
|
|
23
|
+
declare const styles: {
|
|
24
|
+
bold: string;
|
|
25
|
+
dim: string;
|
|
26
|
+
italic: string;
|
|
27
|
+
underline: string;
|
|
28
|
+
inverse: string;
|
|
29
|
+
strikethrough: string;
|
|
30
|
+
};
|
|
1
31
|
/**
|
|
2
32
|
* Apply color to text
|
|
3
33
|
*/
|
|
@@ -6,6 +36,18 @@ export declare function color(text: string, colorName: keyof typeof colors): str
|
|
|
6
36
|
* Apply style to text
|
|
7
37
|
*/
|
|
8
38
|
export declare function style(text: string, styleName: keyof typeof styles): string;
|
|
39
|
+
export declare const red: (text: string) => string;
|
|
40
|
+
export declare const green: (text: string) => string;
|
|
41
|
+
export declare const yellow: (text: string) => string;
|
|
42
|
+
export declare const blue: (text: string) => string;
|
|
43
|
+
export declare const magenta: (text: string) => string;
|
|
44
|
+
export declare const cyan: (text: string) => string;
|
|
45
|
+
export declare const white: (text: string) => string;
|
|
46
|
+
export declare const gray: (text: string) => string;
|
|
47
|
+
export declare const bold: (text: string) => string;
|
|
48
|
+
export declare const dim: (text: string) => string;
|
|
49
|
+
export declare const italic: (text: string) => string;
|
|
50
|
+
export declare const underline: (text: string) => string;
|
|
9
51
|
/**
|
|
10
52
|
* Print the STX Story banner
|
|
11
53
|
*/
|
|
@@ -58,9 +100,9 @@ export declare function clearConsole(): void;
|
|
|
58
100
|
* Create a spinner
|
|
59
101
|
*/
|
|
60
102
|
export declare function createSpinner(text: string): {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
103
|
+
start: () => void;
|
|
104
|
+
stop: (success?: boolean) => void;
|
|
105
|
+
update: (newText: string) => void;
|
|
64
106
|
};
|
|
65
107
|
/**
|
|
66
108
|
* Format duration in human-readable format
|
|
@@ -70,44 +112,4 @@ export declare function formatDuration(ms: number): string;
|
|
|
70
112
|
* Format file size in human-readable format
|
|
71
113
|
*/
|
|
72
114
|
export declare function formatSize(bytes: number): string;
|
|
73
|
-
|
|
74
|
-
declare const colors: {
|
|
75
|
-
black: string;
|
|
76
|
-
red: string;
|
|
77
|
-
green: string;
|
|
78
|
-
yellow: string;
|
|
79
|
-
blue: string;
|
|
80
|
-
magenta: string;
|
|
81
|
-
cyan: string;
|
|
82
|
-
white: string;
|
|
83
|
-
gray: string;
|
|
84
|
-
brightRed: string;
|
|
85
|
-
brightGreen: string;
|
|
86
|
-
brightYellow: string;
|
|
87
|
-
brightBlue: string;
|
|
88
|
-
brightMagenta: string;
|
|
89
|
-
brightCyan: string;
|
|
90
|
-
brightWhite: string
|
|
91
|
-
};
|
|
92
|
-
// Styles
|
|
93
|
-
declare const styles: {
|
|
94
|
-
bold: string;
|
|
95
|
-
dim: string;
|
|
96
|
-
italic: string;
|
|
97
|
-
underline: string;
|
|
98
|
-
inverse: string;
|
|
99
|
-
strikethrough: string
|
|
100
|
-
};
|
|
101
|
-
// Convenience functions
|
|
102
|
-
export declare const red: (text: string) => string;
|
|
103
|
-
export declare const green: (text: string) => string;
|
|
104
|
-
export declare const yellow: (text: string) => string;
|
|
105
|
-
export declare const blue: (text: string) => string;
|
|
106
|
-
export declare const magenta: (text: string) => string;
|
|
107
|
-
export declare const cyan: (text: string) => string;
|
|
108
|
-
export declare const white: (text: string) => string;
|
|
109
|
-
export declare const gray: (text: string) => string;
|
|
110
|
-
export declare const bold: (text: string) => string;
|
|
111
|
-
export declare const dim: (text: string) => string;
|
|
112
|
-
export declare const italic: (text: string) => string;
|
|
113
|
-
export declare const underline: (text: string) => string;
|
|
115
|
+
export {};
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generate performance panel HTML
|
|
3
|
-
*/
|
|
4
|
-
export declare function getPerformancePanelHtml(metrics: ComponentMetrics[]): string;
|
|
5
|
-
/**
|
|
6
|
-
* Generate performance panel styles
|
|
7
|
-
*/
|
|
8
|
-
export declare function getPerformancePanelStyles(): string;
|
|
9
|
-
/**
|
|
10
|
-
* Generate performance client script
|
|
11
|
-
*/
|
|
12
|
-
export declare function getPerformanceScript(): string;
|
|
13
|
-
/**
|
|
14
|
-
* Global profiler instance
|
|
15
|
-
*/
|
|
16
|
-
export declare const profiler: PerformanceProfiler;
|
|
17
1
|
/**
|
|
18
2
|
* STX Story - Component Performance Profiling
|
|
19
3
|
* Track render times, re-render counts, and memory usage
|
|
@@ -21,47 +5,125 @@ export declare const profiler: PerformanceProfiler;
|
|
|
21
5
|
/**
|
|
22
6
|
* Performance metrics for a component
|
|
23
7
|
*/
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
8
|
+
export interface ComponentMetrics {
|
|
9
|
+
/** Component ID */
|
|
10
|
+
componentId: string;
|
|
11
|
+
/** Component name */
|
|
12
|
+
componentName: string;
|
|
13
|
+
/** Render count */
|
|
14
|
+
renderCount: number;
|
|
15
|
+
/** Total render time in ms */
|
|
16
|
+
totalRenderTime: number;
|
|
17
|
+
/** Average render time in ms */
|
|
18
|
+
avgRenderTime: number;
|
|
19
|
+
/** Min render time in ms */
|
|
20
|
+
minRenderTime: number;
|
|
21
|
+
/** Max render time in ms */
|
|
22
|
+
maxRenderTime: number;
|
|
23
|
+
/** Last render time in ms */
|
|
24
|
+
lastRenderTime: number;
|
|
25
|
+
/** Memory usage in bytes (if available) */
|
|
26
|
+
memoryUsage?: number;
|
|
27
|
+
/** Render history */
|
|
28
|
+
history: RenderRecord[];
|
|
35
29
|
}
|
|
36
30
|
/**
|
|
37
31
|
* Single render record
|
|
38
32
|
*/
|
|
39
|
-
export
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
export interface RenderRecord {
|
|
34
|
+
/** Timestamp */
|
|
35
|
+
timestamp: number;
|
|
36
|
+
/** Render duration in ms */
|
|
37
|
+
duration: number;
|
|
38
|
+
/** Props that triggered render */
|
|
39
|
+
props?: Record<string, any>;
|
|
40
|
+
/** Memory snapshot */
|
|
41
|
+
memory?: number;
|
|
44
42
|
}
|
|
45
43
|
/**
|
|
46
44
|
* Performance profiler
|
|
47
45
|
*/
|
|
48
46
|
export declare class PerformanceProfiler {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
private metrics;
|
|
48
|
+
private maxHistorySize;
|
|
49
|
+
private enabled;
|
|
50
|
+
/**
|
|
51
|
+
* Enable/disable profiling
|
|
52
|
+
*/
|
|
53
|
+
setEnabled(enabled: boolean): void;
|
|
54
|
+
/**
|
|
55
|
+
* Record a render
|
|
56
|
+
*/
|
|
57
|
+
recordRender(componentId: string, componentName: string, duration: number, props?: Record<string, any>): void;
|
|
58
|
+
/**
|
|
59
|
+
* Get metrics for a component
|
|
60
|
+
*/
|
|
61
|
+
getMetrics(componentId: string): ComponentMetrics | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Get all metrics
|
|
64
|
+
*/
|
|
65
|
+
getAllMetrics(): ComponentMetrics[];
|
|
66
|
+
/**
|
|
67
|
+
* Get slowest components
|
|
68
|
+
*/
|
|
69
|
+
getSlowestComponents(limit?: number): ComponentMetrics[];
|
|
70
|
+
/**
|
|
71
|
+
* Get most rendered components
|
|
72
|
+
*/
|
|
73
|
+
getMostRenderedComponents(limit?: number): ComponentMetrics[];
|
|
74
|
+
/**
|
|
75
|
+
* Clear all metrics
|
|
76
|
+
*/
|
|
77
|
+
clear(): void;
|
|
78
|
+
/**
|
|
79
|
+
* Clear metrics for a component
|
|
80
|
+
*/
|
|
81
|
+
clearComponent(componentId: string): void;
|
|
82
|
+
/**
|
|
83
|
+
* Get memory usage (if available)
|
|
84
|
+
*/
|
|
85
|
+
private getMemoryUsage;
|
|
86
|
+
/**
|
|
87
|
+
* Export metrics as JSON
|
|
88
|
+
*/
|
|
89
|
+
exportMetrics(): string;
|
|
90
|
+
/**
|
|
91
|
+
* Create a render timer
|
|
92
|
+
*/
|
|
93
|
+
createTimer(componentId: string, componentName: string): RenderTimer;
|
|
59
94
|
}
|
|
60
95
|
/**
|
|
61
96
|
* Render timer helper
|
|
62
97
|
*/
|
|
63
98
|
export declare class RenderTimer {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
99
|
+
private profiler;
|
|
100
|
+
private componentId;
|
|
101
|
+
private componentName;
|
|
102
|
+
private startTime;
|
|
103
|
+
private props?;
|
|
104
|
+
constructor(profiler: PerformanceProfiler, componentId: string, componentName: string);
|
|
105
|
+
/**
|
|
106
|
+
* Set props for this render
|
|
107
|
+
*/
|
|
108
|
+
setProps(props: Record<string, any>): this;
|
|
109
|
+
/**
|
|
110
|
+
* End timing and record
|
|
111
|
+
*/
|
|
112
|
+
end(): number;
|
|
67
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Global profiler instance
|
|
116
|
+
*/
|
|
117
|
+
export declare const profiler: PerformanceProfiler;
|
|
118
|
+
/**
|
|
119
|
+
* Generate performance panel HTML
|
|
120
|
+
*/
|
|
121
|
+
export declare function getPerformancePanelHtml(metrics: ComponentMetrics[]): string;
|
|
122
|
+
/**
|
|
123
|
+
* Generate performance panel styles
|
|
124
|
+
*/
|
|
125
|
+
export declare function getPerformancePanelStyles(): string;
|
|
126
|
+
/**
|
|
127
|
+
* Generate performance client script
|
|
128
|
+
*/
|
|
129
|
+
export declare function getPerformanceScript(): string;
|
package/dist/story/presets.d.ts
CHANGED
|
@@ -1,57 +1,123 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
export declare function getPresetsPanelHtml(presets: PropPreset[]): string;
|
|
5
|
-
/**
|
|
6
|
-
* Generate presets panel styles
|
|
2
|
+
* STX Story - Prop Presets
|
|
3
|
+
* Save and load prop configurations for quick testing
|
|
7
4
|
*/
|
|
8
|
-
export declare function getPresetsPanelStyles(): string;
|
|
9
|
-
/**
|
|
10
|
-
* Generate presets client script
|
|
11
|
-
*/
|
|
12
|
-
export declare function getPresetsScript(): string;
|
|
13
5
|
/**
|
|
14
6
|
* Prop preset
|
|
15
7
|
*/
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
export interface PropPreset {
|
|
9
|
+
/** Preset ID */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Preset name */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Description */
|
|
14
|
+
description?: string;
|
|
15
|
+
/** Props values */
|
|
16
|
+
props: Record<string, any>;
|
|
17
|
+
/** Component this preset is for */
|
|
18
|
+
componentId?: string;
|
|
19
|
+
/** Created timestamp */
|
|
20
|
+
created: number;
|
|
21
|
+
/** Last used timestamp */
|
|
22
|
+
lastUsed?: number;
|
|
23
|
+
/** Usage count */
|
|
24
|
+
usageCount: number;
|
|
25
|
+
/** Tags for organization */
|
|
26
|
+
tags?: string[];
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
28
29
|
* Presets storage
|
|
29
30
|
*/
|
|
30
|
-
export
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
export interface PresetsStorage {
|
|
32
|
+
/** Version for migrations */
|
|
33
|
+
version: number;
|
|
34
|
+
/** All presets */
|
|
35
|
+
presets: PropPreset[];
|
|
36
|
+
/** Recently used preset IDs */
|
|
37
|
+
recentIds: string[];
|
|
34
38
|
}
|
|
35
39
|
/**
|
|
36
40
|
* Presets manager
|
|
37
41
|
*/
|
|
38
42
|
export declare class PresetsManager {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
private storage;
|
|
44
|
+
private storagePath;
|
|
45
|
+
private dirty;
|
|
46
|
+
constructor(rootDir: string);
|
|
47
|
+
/**
|
|
48
|
+
* Load storage from disk
|
|
49
|
+
*/
|
|
50
|
+
private loadStorage;
|
|
51
|
+
/**
|
|
52
|
+
* Migrate storage to current version
|
|
53
|
+
*/
|
|
54
|
+
private migrateStorage;
|
|
55
|
+
/**
|
|
56
|
+
* Save storage to disk
|
|
57
|
+
*/
|
|
58
|
+
save(): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Create a new preset
|
|
61
|
+
*/
|
|
62
|
+
createPreset(name: string, props: Record<string, any>, options?: {
|
|
63
|
+
description?: string;
|
|
64
|
+
componentId?: string;
|
|
65
|
+
tags?: string[];
|
|
45
66
|
}): PropPreset;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Get a preset by ID
|
|
69
|
+
*/
|
|
70
|
+
getPreset(id: string): PropPreset | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Get all presets
|
|
73
|
+
*/
|
|
74
|
+
getAllPresets(): PropPreset[];
|
|
75
|
+
/**
|
|
76
|
+
* Get presets for a specific component
|
|
77
|
+
*/
|
|
78
|
+
getPresetsForComponent(componentId: string): PropPreset[];
|
|
79
|
+
/**
|
|
80
|
+
* Get recent presets
|
|
81
|
+
*/
|
|
82
|
+
getRecentPresets(): PropPreset[];
|
|
83
|
+
/**
|
|
84
|
+
* Use a preset (updates usage stats)
|
|
85
|
+
*/
|
|
86
|
+
usePreset(id: string): PropPreset | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Update a preset
|
|
89
|
+
*/
|
|
90
|
+
updatePreset(id: string, updates: Partial<Omit<PropPreset, 'id' | 'created'>>): PropPreset | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Delete a preset
|
|
93
|
+
*/
|
|
94
|
+
deletePreset(id: string): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Search presets
|
|
97
|
+
*/
|
|
98
|
+
searchPresets(query: string): PropPreset[];
|
|
99
|
+
/**
|
|
100
|
+
* Get most used presets
|
|
101
|
+
*/
|
|
102
|
+
getMostUsedPresets(limit?: number): PropPreset[];
|
|
103
|
+
/**
|
|
104
|
+
* Export presets to JSON
|
|
105
|
+
*/
|
|
106
|
+
exportPresets(ids?: string[]): string;
|
|
107
|
+
/**
|
|
108
|
+
* Import presets from JSON
|
|
109
|
+
*/
|
|
110
|
+
importPresets(json: string, overwrite?: boolean): number;
|
|
57
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Generate presets panel HTML
|
|
114
|
+
*/
|
|
115
|
+
export declare function getPresetsPanelHtml(presets: PropPreset[]): string;
|
|
116
|
+
/**
|
|
117
|
+
* Generate presets panel styles
|
|
118
|
+
*/
|
|
119
|
+
export declare function getPresetsPanelStyles(): string;
|
|
120
|
+
/**
|
|
121
|
+
* Generate presets client script
|
|
122
|
+
*/
|
|
123
|
+
export declare function getPresetsScript(): string;
|
package/dist/story/renderer.d.ts
CHANGED
|
@@ -1,8 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STX Story - Component Renderer
|
|
3
|
+
* Real component rendering using the STX process module
|
|
4
|
+
*/
|
|
1
5
|
import type { ServerStoryFile, StoryContext } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Story render options
|
|
8
|
+
*/
|
|
9
|
+
export interface StoryRenderOptions {
|
|
10
|
+
/** Props to pass to the component */
|
|
11
|
+
props?: Record<string, any>;
|
|
12
|
+
/** Slots content */
|
|
13
|
+
slots?: Record<string, string>;
|
|
14
|
+
/** Include global styles */
|
|
15
|
+
includeStyles?: boolean;
|
|
16
|
+
/** Include Crosswind CSS */
|
|
17
|
+
includeCrosswind?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Story render result
|
|
21
|
+
*/
|
|
22
|
+
export interface StoryRenderResult {
|
|
23
|
+
/** Rendered HTML */
|
|
24
|
+
html: string;
|
|
25
|
+
/** CSS extracted from component */
|
|
26
|
+
css: string;
|
|
27
|
+
/** JavaScript extracted from component */
|
|
28
|
+
js: string;
|
|
29
|
+
/** Errors during rendering */
|
|
30
|
+
errors: string[];
|
|
31
|
+
/** Render duration in ms */
|
|
32
|
+
duration: number;
|
|
33
|
+
}
|
|
2
34
|
/**
|
|
3
35
|
* Render a story component with props
|
|
4
36
|
*/
|
|
5
|
-
// eslint-disable-next-line pickier/no-unused-vars
|
|
6
37
|
export declare function renderStoryComponent(ctx: StoryContext, componentPath: string, options?: StoryRenderOptions): Promise<StoryRenderResult>;
|
|
7
38
|
/**
|
|
8
39
|
* Render a story variant
|
|
@@ -11,7 +42,6 @@ export declare function renderStoryVariant(ctx: StoryContext, story: ServerStory
|
|
|
11
42
|
/**
|
|
12
43
|
* Render an inline template string
|
|
13
44
|
*/
|
|
14
|
-
// eslint-disable-next-line pickier/no-unused-vars
|
|
15
45
|
export declare function renderInlineTemplate(ctx: StoryContext, template: string, props?: Record<string, any>): Promise<StoryRenderResult>;
|
|
16
46
|
/**
|
|
17
47
|
* Clear the story component cache
|
|
@@ -20,7 +50,10 @@ export declare function clearStoryCache(): void;
|
|
|
20
50
|
/**
|
|
21
51
|
* Get cache statistics
|
|
22
52
|
*/
|
|
23
|
-
export declare function getCacheStats(): {
|
|
53
|
+
export declare function getCacheStats(): {
|
|
54
|
+
size: number;
|
|
55
|
+
entries: string[];
|
|
56
|
+
};
|
|
24
57
|
/**
|
|
25
58
|
* Preload components into cache
|
|
26
59
|
*/
|
|
@@ -29,27 +62,8 @@ export declare function preloadComponents(paths: string[]): Promise<number>;
|
|
|
29
62
|
* Generate preview HTML document
|
|
30
63
|
*/
|
|
31
64
|
export declare function generatePreviewDocument(result: StoryRenderResult, options?: {
|
|
32
|
-
title?: string
|
|
33
|
-
theme?: 'light' | 'dark'
|
|
34
|
-
background?: string
|
|
35
|
-
crosswindCss?: string
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Story render options
|
|
39
|
-
*/
|
|
40
|
-
export declare interface StoryRenderOptions {
|
|
41
|
-
props?: Record<string, any>
|
|
42
|
-
slots?: Record<string, string>
|
|
43
|
-
includeStyles?: boolean
|
|
44
|
-
includeCrosswind?: boolean
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Story render result
|
|
48
|
-
*/
|
|
49
|
-
export declare interface StoryRenderResult {
|
|
50
|
-
html: string
|
|
51
|
-
css: string
|
|
52
|
-
js: string
|
|
53
|
-
errors: string[]
|
|
54
|
-
duration: number
|
|
55
|
-
}
|
|
65
|
+
title?: string;
|
|
66
|
+
theme?: 'light' | 'dark';
|
|
67
|
+
background?: string;
|
|
68
|
+
crosswindCss?: string;
|
|
69
|
+
}): string;
|
package/dist/story/search.d.ts
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STX Story - Search functionality
|
|
3
|
+
* Full-text search across stories and components
|
|
4
|
+
*/
|
|
1
5
|
import type { AnalyzedComponent, StoryContext } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Search result item
|
|
8
|
+
*/
|
|
9
|
+
export interface SearchResult {
|
|
10
|
+
/** Result type */
|
|
11
|
+
type: 'story' | 'component' | 'prop' | 'slot';
|
|
12
|
+
/** Display title */
|
|
13
|
+
title: string;
|
|
14
|
+
/** Description or context */
|
|
15
|
+
description?: string;
|
|
16
|
+
/** Story file ID */
|
|
17
|
+
storyId: string;
|
|
18
|
+
/** Variant ID (if applicable) */
|
|
19
|
+
variantId?: string;
|
|
20
|
+
/** Match score (higher is better) */
|
|
21
|
+
score: number;
|
|
22
|
+
/** Matched text */
|
|
23
|
+
match: string;
|
|
24
|
+
}
|
|
2
25
|
/**
|
|
3
26
|
* Build search index from story files
|
|
4
27
|
*/
|
|
@@ -31,15 +54,3 @@ export declare function exportSearchIndex(): string;
|
|
|
31
54
|
* Import search index from JSON
|
|
32
55
|
*/
|
|
33
56
|
export declare function importSearchIndex(json: string): void;
|
|
34
|
-
/**
|
|
35
|
-
* Search result item
|
|
36
|
-
*/
|
|
37
|
-
export declare interface SearchResult {
|
|
38
|
-
type: 'story' | 'component' | 'prop' | 'slot'
|
|
39
|
-
title: string
|
|
40
|
-
description?: string
|
|
41
|
-
storyId: string
|
|
42
|
-
variantId?: string
|
|
43
|
-
score: number
|
|
44
|
-
match: string
|
|
45
|
-
}
|
package/dist/story/server.d.ts
CHANGED
|
@@ -1,21 +1,31 @@
|
|
|
1
|
-
import type { StoryContext } from './types';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
2
|
+
* STX Story - Development server
|
|
3
|
+
* Serves the story UI and handles API requests with WebSocket HMR
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
import type { StoryContext } from './types';
|
|
6
6
|
/**
|
|
7
7
|
* Server options
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
export interface ServerOptions {
|
|
10
|
+
/** Port to listen on */
|
|
11
|
+
port: number;
|
|
12
|
+
/** Open browser automatically */
|
|
13
|
+
open?: boolean;
|
|
14
|
+
/** Host to bind to */
|
|
15
|
+
host?: string | boolean;
|
|
13
16
|
}
|
|
14
17
|
/**
|
|
15
18
|
* Story server instance
|
|
16
19
|
*/
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
export interface StoryServer {
|
|
21
|
+
/** Bun server instance */
|
|
22
|
+
server: ReturnType<typeof Bun.serve>;
|
|
23
|
+
/** Server URL */
|
|
24
|
+
url: string;
|
|
25
|
+
/** Close the server */
|
|
26
|
+
close: () => Promise<void>;
|
|
21
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Create and start the story server
|
|
30
|
+
*/
|
|
31
|
+
export declare function createStoryServer(ctx: StoryContext, options: ServerOptions): Promise<StoryServer>;
|
package/dist/story/setup.d.ts
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STX Story - Setup file support
|
|
3
|
+
* Handles global story setup configuration
|
|
4
|
+
*/
|
|
1
5
|
import type { StoryContext } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Setup function signature
|
|
8
|
+
*/
|
|
9
|
+
export type SetupFunction = (ctx: SetupContext) => void | Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Context passed to setup function
|
|
12
|
+
*/
|
|
13
|
+
export interface SetupContext {
|
|
14
|
+
/** Story context */
|
|
15
|
+
storyContext: StoryContext;
|
|
16
|
+
/** Register a global component */
|
|
17
|
+
registerComponent: (name: string, component: any) => void;
|
|
18
|
+
/** Add global CSS */
|
|
19
|
+
addCSS: (css: string) => void;
|
|
20
|
+
/** Add global script */
|
|
21
|
+
addScript: (script: string) => void;
|
|
22
|
+
/** Set global state */
|
|
23
|
+
setState: (key: string, value: any) => void;
|
|
24
|
+
}
|
|
2
25
|
/**
|
|
3
26
|
* Load and execute the setup file
|
|
4
27
|
*/
|
|
@@ -31,18 +54,3 @@ export declare function resetSetup(): void;
|
|
|
31
54
|
* Generate HTML for global setup (CSS + scripts)
|
|
32
55
|
*/
|
|
33
56
|
export declare function getSetupHTML(): string;
|
|
34
|
-
/**
|
|
35
|
-
* Context passed to setup function
|
|
36
|
-
*/
|
|
37
|
-
export declare interface SetupContext {
|
|
38
|
-
storyContext: StoryContext
|
|
39
|
-
registerComponent: (name: string, component: any) => void
|
|
40
|
-
addCSS: (css: string) => void
|
|
41
|
-
addScript: (script: string) => void
|
|
42
|
-
setState: (key: string, value: any) => void
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Setup function signature
|
|
46
|
-
*/
|
|
47
|
-
// eslint-disable-next-line pickier/no-unused-vars
|
|
48
|
-
export type SetupFunction = (ctx: SetupContext) => void | Promise<void>;
|