@stacksjs/stx 0.2.155 → 0.2.157
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.d.ts +0 -14
- package/dist/render.js +17 -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/cli.d.ts
CHANGED
|
@@ -1,3 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STX Story - CLI Integration
|
|
3
|
+
* Provides CLI commands for the story feature
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* CLI command definitions for integration with @stacksjs/clapp
|
|
7
|
+
*/
|
|
8
|
+
export declare const storyCommands: {
|
|
9
|
+
/**
|
|
10
|
+
* Main story command (defaults to dev)
|
|
11
|
+
*/
|
|
12
|
+
story: {
|
|
13
|
+
description: string;
|
|
14
|
+
options: {
|
|
15
|
+
port: {
|
|
16
|
+
alias: string;
|
|
17
|
+
type: 'number';
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
open: {
|
|
21
|
+
alias: string;
|
|
22
|
+
type: 'boolean';
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
host: {
|
|
26
|
+
type: 'string';
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
action: (options: {
|
|
31
|
+
port?: number;
|
|
32
|
+
open?: boolean;
|
|
33
|
+
host?: string;
|
|
34
|
+
}) => Promise<void>;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Story dev subcommand
|
|
38
|
+
*/
|
|
39
|
+
'story:dev': {
|
|
40
|
+
description: string;
|
|
41
|
+
options: {
|
|
42
|
+
port: {
|
|
43
|
+
alias: string;
|
|
44
|
+
type: 'number';
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
open: {
|
|
48
|
+
alias: string;
|
|
49
|
+
type: 'boolean';
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
host: {
|
|
53
|
+
type: 'string';
|
|
54
|
+
description: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
action: (options: {
|
|
58
|
+
port?: number;
|
|
59
|
+
open?: boolean;
|
|
60
|
+
host?: string;
|
|
61
|
+
}) => Promise<void>;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Story build subcommand
|
|
65
|
+
*/
|
|
66
|
+
'story:build': {
|
|
67
|
+
description: string;
|
|
68
|
+
options: {
|
|
69
|
+
outDir: {
|
|
70
|
+
alias: string;
|
|
71
|
+
type: 'string';
|
|
72
|
+
description: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
action: (options: {
|
|
76
|
+
outDir?: string;
|
|
77
|
+
}) => Promise<void>;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Story preview subcommand
|
|
81
|
+
*/
|
|
82
|
+
'story:preview': {
|
|
83
|
+
description: string;
|
|
84
|
+
options: {
|
|
85
|
+
port: {
|
|
86
|
+
alias: string;
|
|
87
|
+
type: 'number';
|
|
88
|
+
description: string;
|
|
89
|
+
};
|
|
90
|
+
open: {
|
|
91
|
+
alias: string;
|
|
92
|
+
type: 'boolean';
|
|
93
|
+
description: string;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
action: (options: {
|
|
97
|
+
port?: number;
|
|
98
|
+
open?: boolean;
|
|
99
|
+
}) => Promise<void>;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Story test subcommand
|
|
103
|
+
*/
|
|
104
|
+
'story:test': {
|
|
105
|
+
description: string;
|
|
106
|
+
options: {
|
|
107
|
+
update: {
|
|
108
|
+
alias: string;
|
|
109
|
+
type: 'boolean';
|
|
110
|
+
description: string;
|
|
111
|
+
};
|
|
112
|
+
filter: {
|
|
113
|
+
alias: string;
|
|
114
|
+
type: 'string';
|
|
115
|
+
description: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
action: (options: {
|
|
119
|
+
update?: boolean;
|
|
120
|
+
filter?: string;
|
|
121
|
+
}) => Promise<void>;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
1
124
|
/**
|
|
2
125
|
* Register story commands with a CLI instance
|
|
3
126
|
* This is a helper for manual CLI integration
|
|
@@ -7,72 +130,3 @@ export declare function registerStoryCommands(cli: any): void;
|
|
|
7
130
|
* Run story CLI directly (for standalone usage)
|
|
8
131
|
*/
|
|
9
132
|
export declare function runStoryCLI(args?: string[]): Promise<void>;
|
|
10
|
-
/**
|
|
11
|
-
* CLI command definitions for integration with @stacksjs/clapp
|
|
12
|
-
* @defaultValue
|
|
13
|
-
* ```ts
|
|
14
|
-
* {
|
|
15
|
-
* 'story': {
|
|
16
|
-
* description: 'Component showcase and testing',
|
|
17
|
-
* options: {
|
|
18
|
-
* port: { alias: 'p', description: 'Server port (default: 6006)' },
|
|
19
|
-
* open: { alias: 'o', description: 'Open browser automatically' },
|
|
20
|
-
* host: { description: 'Host to bind to' }
|
|
21
|
-
* },
|
|
22
|
-
* action: (options: { port?: number, open?: boolean, host?: string }): Promise<void> => Promise<unknown>
|
|
23
|
-
* },
|
|
24
|
-
* 'story:dev': {
|
|
25
|
-
* description: 'Start story development server',
|
|
26
|
-
* options: {
|
|
27
|
-
* port: { alias: 'p', description: 'Server port (default: 6006)' },
|
|
28
|
-
* open: { alias: 'o', description: 'Open browser automatically' },
|
|
29
|
-
* host: { description: 'Host to bind to' }
|
|
30
|
-
* },
|
|
31
|
-
* action: (options: { port?: number, open?: boolean, host?: string }): Promise<void> => Promise<unknown>
|
|
32
|
-
* },
|
|
33
|
-
* 'story:build': {
|
|
34
|
-
* description: 'Build static story site',
|
|
35
|
-
* options: { outDir: { alias: 'o', description: 'Output directory' } },
|
|
36
|
-
* action: (options: { outDir?: string }): Promise<void> => Promise<unknown>
|
|
37
|
-
* },
|
|
38
|
-
* 'story:preview': {
|
|
39
|
-
* description: 'Preview built story site',
|
|
40
|
-
* options: {
|
|
41
|
-
* port: { alias: 'p', description: 'Server port (default: 4173)' },
|
|
42
|
-
* open: { alias: 'o', description: 'Open browser automatically' }
|
|
43
|
-
* },
|
|
44
|
-
* action: (options: { port?: number, open?: boolean }): Promise<void> => Promise<unknown>
|
|
45
|
-
* },
|
|
46
|
-
* 'story:test': {
|
|
47
|
-
* description: 'Run visual regression tests',
|
|
48
|
-
* options: {
|
|
49
|
-
* update: { alias: 'u', description: 'Update snapshots' },
|
|
50
|
-
* filter: { alias: 'f', description: 'Filter components by name' }
|
|
51
|
-
* },
|
|
52
|
-
* action: (options: { update?: boolean, filter?: string }): Promise<void> => Promise<unknown>
|
|
53
|
-
* }
|
|
54
|
-
* }
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
export declare const storyCommands: {
|
|
58
|
-
/**
|
|
59
|
-
* Main story command (defaults to dev)
|
|
60
|
-
*/
|
|
61
|
-
'story': { /** @defaultValue 'Component showcase and testing' */ description: string; options: { port: { /** @defaultValue 'p' */ alias: string; type: 'number'; /** @defaultValue 'Server port (default: 6006)' */ description: string }; open: { /** @defaultValue 'o' */ alias: string; type: 'boolean'; /** @defaultValue 'Open browser automatically' */ description: string }; host: { type: 'string'; /** @defaultValue 'Host to bind to' */ description: string } }; action: (options: { port?: number, open?: boolean, host?: string }): Promise<void> => Promise<unknown> };
|
|
62
|
-
/**
|
|
63
|
-
* Story dev subcommand
|
|
64
|
-
*/
|
|
65
|
-
'story:dev': { /** @defaultValue 'Start story development server' */ description: string; options: { port: { /** @defaultValue 'p' */ alias: string; type: 'number'; /** @defaultValue 'Server port (default: 6006)' */ description: string }; open: { /** @defaultValue 'o' */ alias: string; type: 'boolean'; /** @defaultValue 'Open browser automatically' */ description: string }; host: { type: 'string'; /** @defaultValue 'Host to bind to' */ description: string } }; action: (options: { port?: number, open?: boolean, host?: string }): Promise<void> => Promise<unknown> };
|
|
66
|
-
/**
|
|
67
|
-
* Story build subcommand
|
|
68
|
-
*/
|
|
69
|
-
'story:build': { /** @defaultValue 'Build static story site' */ description: string; options: { outDir: { /** @defaultValue 'o' */ alias: string; type: 'string'; /** @defaultValue 'Output directory' */ description: string } }; action: (options: { outDir?: string }): Promise<void> => Promise<unknown> };
|
|
70
|
-
/**
|
|
71
|
-
* Story preview subcommand
|
|
72
|
-
*/
|
|
73
|
-
'story:preview': { /** @defaultValue 'Preview built story site' */ description: string; options: { port: { /** @defaultValue 'p' */ alias: string; type: 'number'; /** @defaultValue 'Server port (default: 4173)' */ description: string }; open: { /** @defaultValue 'o' */ alias: string; type: 'boolean'; /** @defaultValue 'Open browser automatically' */ description: string } }; action: (options: { port?: number, open?: boolean }): Promise<void> => Promise<unknown> };
|
|
74
|
-
/**
|
|
75
|
-
* Story test subcommand
|
|
76
|
-
*/
|
|
77
|
-
'story:test': { /** @defaultValue 'Run visual regression tests' */ description: string; options: { update: { /** @defaultValue 'u' */ alias: string; type: 'boolean'; /** @defaultValue 'Update snapshots' */ description: string }; filter: { /** @defaultValue 'f' */ alias: string; type: 'string'; /** @defaultValue 'Filter components by name' */ description: string } }; action: (options: { update?: boolean, filter?: string }): Promise<void> => Promise<unknown> }
|
|
78
|
-
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STX Story - Tree builder
|
|
3
|
+
* Builds the navigation tree from story files
|
|
4
|
+
*/
|
|
1
5
|
import type { ResolvedStoryConfig, ServerStoryFile, ServerTree, ServerTreeLeaf } from '../types';
|
|
2
6
|
/**
|
|
3
7
|
* Create tree path from a story file
|
|
@@ -14,4 +18,7 @@ export declare function flattenTree(tree: ServerTree): number[];
|
|
|
14
18
|
/**
|
|
15
19
|
* Find a story in the tree by index
|
|
16
20
|
*/
|
|
17
|
-
export declare function findStoryInTree(tree: ServerTree, index: number): {
|
|
21
|
+
export declare function findStoryInTree(tree: ServerTree, index: number): {
|
|
22
|
+
path: string[];
|
|
23
|
+
node: ServerTreeLeaf;
|
|
24
|
+
} | null;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STX Story - Build command
|
|
3
|
+
* Build static story site for deployment
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Options for the build command
|
|
7
|
+
*/
|
|
8
|
+
export interface BuildOptions {
|
|
9
|
+
/** Output directory (overrides config) */
|
|
10
|
+
outDir?: string;
|
|
11
|
+
}
|
|
1
12
|
/**
|
|
2
13
|
* Build static story site
|
|
3
14
|
*/
|
|
@@ -6,9 +17,3 @@ export declare function buildCommand(options?: BuildOptions): Promise<void>;
|
|
|
6
17
|
* Run build command (alias)
|
|
7
18
|
*/
|
|
8
19
|
export declare const build: typeof buildCommand;
|
|
9
|
-
/**
|
|
10
|
-
* Options for the build command
|
|
11
|
-
*/
|
|
12
|
-
export declare interface BuildOptions {
|
|
13
|
-
outDir?: string
|
|
14
|
-
}
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STX Story - Dev command
|
|
3
|
+
* Start the story development server
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Options for the dev command
|
|
7
|
+
*/
|
|
8
|
+
export interface DevOptions {
|
|
9
|
+
/** Server port (default: 6006) */
|
|
10
|
+
port?: number;
|
|
11
|
+
/** Open browser automatically */
|
|
12
|
+
open?: boolean;
|
|
13
|
+
/** Host to bind to */
|
|
14
|
+
host?: string | boolean;
|
|
15
|
+
}
|
|
1
16
|
/**
|
|
2
17
|
* Start the story development server
|
|
3
18
|
*/
|
|
@@ -6,11 +21,3 @@ export declare function devCommand(options?: DevOptions): Promise<void>;
|
|
|
6
21
|
* Run dev command (alias for devCommand)
|
|
7
22
|
*/
|
|
8
23
|
export declare const dev: typeof devCommand;
|
|
9
|
-
/**
|
|
10
|
-
* Options for the dev command
|
|
11
|
-
*/
|
|
12
|
-
export declare interface DevOptions {
|
|
13
|
-
port?: number
|
|
14
|
-
open?: boolean
|
|
15
|
-
host?: string | boolean
|
|
16
|
-
}
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STX Story - Preview command
|
|
3
|
+
* Preview the built story site locally
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Options for the preview command
|
|
7
|
+
*/
|
|
8
|
+
export interface PreviewOptions {
|
|
9
|
+
/** Server port (default: 4173) */
|
|
10
|
+
port?: number;
|
|
11
|
+
/** Open browser automatically */
|
|
12
|
+
open?: boolean;
|
|
13
|
+
}
|
|
1
14
|
/**
|
|
2
15
|
* Preview the built story site
|
|
3
16
|
*/
|
|
@@ -6,10 +19,3 @@ export declare function previewCommand(options?: PreviewOptions): Promise<void>;
|
|
|
6
19
|
* Run preview command (alias)
|
|
7
20
|
*/
|
|
8
21
|
export declare const preview: typeof previewCommand;
|
|
9
|
-
/**
|
|
10
|
-
* Options for the preview command
|
|
11
|
-
*/
|
|
12
|
-
export declare interface PreviewOptions {
|
|
13
|
-
port?: number
|
|
14
|
-
open?: boolean
|
|
15
|
-
}
|
|
@@ -1,4 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STX Story - Config file watcher
|
|
3
|
+
* Watches stx.config.ts for changes and triggers restart
|
|
4
|
+
*/
|
|
1
5
|
import type { StoryContext } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Config watcher options
|
|
8
|
+
*/
|
|
9
|
+
export interface ConfigWatcherOptions {
|
|
10
|
+
/** Callback when config changes */
|
|
11
|
+
onChange: () => void | Promise<void>;
|
|
12
|
+
/** Debounce delay in ms */
|
|
13
|
+
debounceMs?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Config watcher instance
|
|
17
|
+
*/
|
|
18
|
+
export interface ConfigWatcher {
|
|
19
|
+
/** Stop watching */
|
|
20
|
+
stop: () => void;
|
|
21
|
+
}
|
|
2
22
|
/**
|
|
3
23
|
* Watch the config file for changes
|
|
4
24
|
*/
|
|
@@ -11,16 +31,3 @@ export declare function findConfigFile(root: string): string | null;
|
|
|
11
31
|
* Get the last modified time of the config file
|
|
12
32
|
*/
|
|
13
33
|
export declare function getConfigModifiedTime(root: string): Promise<number | null>;
|
|
14
|
-
/**
|
|
15
|
-
* Config watcher options
|
|
16
|
-
*/
|
|
17
|
-
export declare interface ConfigWatcherOptions {
|
|
18
|
-
onChange: () => void | Promise<void>
|
|
19
|
-
debounceMs?: number
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Config watcher instance
|
|
23
|
-
*/
|
|
24
|
-
export declare interface ConfigWatcher {
|
|
25
|
-
stop: () => void
|
|
26
|
-
}
|
package/dist/story/config.d.ts
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import type { BackgroundPreset, ResolvedStoryConfig, ResponsivePreset, StoryConfig, StoryTreeConfig } from './types';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
2
|
+
* STX Story - Configuration handling
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Get the default story configuration
|
|
8
|
-
* Useful for extending defaults in user config
|
|
9
|
-
*/
|
|
10
|
-
export declare function getDefaultStoryConfig(): StoryConfig;
|
|
4
|
+
import type { BackgroundPreset, ResolvedStoryConfig, ResponsivePreset, StoryConfig, StoryTreeConfig } from './types';
|
|
11
5
|
/**
|
|
12
6
|
* Default responsive presets
|
|
13
7
|
*/
|
|
@@ -24,3 +18,12 @@ export declare const defaultTreeConfig: Required<StoryTreeConfig>;
|
|
|
24
18
|
* Default story configuration
|
|
25
19
|
*/
|
|
26
20
|
export declare const defaultStoryConfig: StoryConfig;
|
|
21
|
+
/**
|
|
22
|
+
* Resolve story configuration with defaults
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveStoryConfig(config?: StoryConfig): ResolvedStoryConfig;
|
|
25
|
+
/**
|
|
26
|
+
* Get the default story configuration
|
|
27
|
+
* Useful for extending defaults in user config
|
|
28
|
+
*/
|
|
29
|
+
export declare function getDefaultStoryConfig(): StoryConfig;
|
package/dist/story/context.d.ts
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STX Story - Context management
|
|
3
|
+
*/
|
|
1
4
|
import type { ServerStoryFile, ServerTree, StoryConfig, StoryContext } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Options for creating a story context
|
|
7
|
+
*/
|
|
8
|
+
export interface CreateContextOptions {
|
|
9
|
+
/** Mode: 'dev' or 'build' */
|
|
10
|
+
mode: 'dev' | 'build';
|
|
11
|
+
/** Root directory (defaults to cwd) */
|
|
12
|
+
root?: string;
|
|
13
|
+
/** Story configuration override */
|
|
14
|
+
config?: StoryConfig;
|
|
15
|
+
}
|
|
2
16
|
/**
|
|
3
17
|
* Create a story context
|
|
4
18
|
*/
|
|
@@ -11,11 +25,3 @@ export declare function updateContextStoryFiles(ctx: StoryContext, storyFiles: S
|
|
|
11
25
|
* Update context with built tree
|
|
12
26
|
*/
|
|
13
27
|
export declare function updateContextTree(ctx: StoryContext, tree: ServerTree): void;
|
|
14
|
-
/**
|
|
15
|
-
* Options for creating a story context
|
|
16
|
-
*/
|
|
17
|
-
export declare interface CreateContextOptions {
|
|
18
|
-
mode: 'dev' | 'build'
|
|
19
|
-
root?: string
|
|
20
|
-
config?: StoryConfig
|
|
21
|
-
}
|
package/dist/story/hmr.d.ts
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STX Story - Hot Module Reload
|
|
3
|
+
* WebSocket-based HMR for story updates
|
|
4
|
+
*/
|
|
1
5
|
import type { ServerWebSocket } from 'bun';
|
|
6
|
+
/**
|
|
7
|
+
* HMR message types
|
|
8
|
+
*/
|
|
9
|
+
export type HmrMessageType = 'connected' | 'story-update' | 'story-add' | 'story-remove' | 'config-change' | 'full-reload' | 'error';
|
|
10
|
+
/**
|
|
11
|
+
* HMR message structure
|
|
12
|
+
*/
|
|
13
|
+
export interface HmrMessage {
|
|
14
|
+
type: HmrMessageType;
|
|
15
|
+
data?: any;
|
|
16
|
+
timestamp?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Create WebSocket upgrade handler for HMR
|
|
20
|
+
*/
|
|
21
|
+
export interface HmrWebSocketHandler {
|
|
22
|
+
open: (ws: ServerWebSocket<unknown>) => void;
|
|
23
|
+
close: (ws: ServerWebSocket<unknown>) => void;
|
|
24
|
+
message: (ws: ServerWebSocket<unknown>, message: string | ArrayBuffer) => void;
|
|
25
|
+
}
|
|
2
26
|
export declare function createHmrHandler(): HmrWebSocketHandler;
|
|
3
27
|
/**
|
|
4
28
|
* Broadcast a message to all connected clients
|
|
@@ -36,29 +60,3 @@ export declare function getClientCount(): number;
|
|
|
36
60
|
* Get HMR client script to inject into the page
|
|
37
61
|
*/
|
|
38
62
|
export declare function getHmrClientScript(wsUrl: string): string;
|
|
39
|
-
/**
|
|
40
|
-
* HMR message structure
|
|
41
|
-
*/
|
|
42
|
-
export declare interface HmrMessage {
|
|
43
|
-
type: HmrMessageType
|
|
44
|
-
data?: any
|
|
45
|
-
timestamp?: number
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Create WebSocket upgrade handler for HMR
|
|
49
|
-
*/
|
|
50
|
-
export declare interface HmrWebSocketHandler {
|
|
51
|
-
open: (ws: ServerWebSocket<unknown>) => void
|
|
52
|
-
close: (ws: ServerWebSocket<unknown>) => void
|
|
53
|
-
message: (ws: ServerWebSocket<unknown>, message: string | ArrayBuffer) => void
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* HMR message types
|
|
57
|
-
*/
|
|
58
|
-
export type HmrMessageType = | 'connected'
|
|
59
|
-
| 'story-update'
|
|
60
|
-
| 'story-add'
|
|
61
|
-
| 'story-remove'
|
|
62
|
-
| 'config-change'
|
|
63
|
-
| 'full-reload'
|
|
64
|
-
| 'error';
|
package/dist/story/hot-swap.d.ts
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generate hot swap client script
|
|
3
|
-
* Injects into the story UI for seamless variant switching
|
|
4
|
-
*/
|
|
5
|
-
export declare function getHotSwapScript(): string;
|
|
6
|
-
/**
|
|
7
|
-
* Generate variant selector UI
|
|
8
|
-
*/
|
|
9
|
-
export declare function getVariantSelectorHtml(variants: Array<{ id: string, title: string }>, currentVariantId: string): string;
|
|
10
|
-
/**
|
|
11
|
-
* Generate variant selector styles
|
|
12
|
-
*/
|
|
13
|
-
export declare function getVariantSelectorStyles(): string;
|
|
14
1
|
/**
|
|
15
2
|
* STX Story - Hot Swap
|
|
16
3
|
* Switch story variants without full page reload
|
|
@@ -18,18 +5,42 @@ export declare function getVariantSelectorStyles(): string;
|
|
|
18
5
|
/**
|
|
19
6
|
* Hot swap state
|
|
20
7
|
*/
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
export interface HotSwapState {
|
|
9
|
+
/** Current story ID */
|
|
10
|
+
storyId: string | null;
|
|
11
|
+
/** Current variant ID */
|
|
12
|
+
variantId: string | null;
|
|
13
|
+
/** Current props */
|
|
14
|
+
props: Record<string, any>;
|
|
15
|
+
/** Iframe element reference */
|
|
16
|
+
iframe: HTMLIFrameElement | null;
|
|
26
17
|
}
|
|
27
18
|
/**
|
|
28
19
|
* Hot swap options
|
|
29
20
|
*/
|
|
30
|
-
export
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
export interface HotSwapOptions {
|
|
22
|
+
/** Animation duration in ms */
|
|
23
|
+
animationDuration?: number;
|
|
24
|
+
/** Preserve scroll position */
|
|
25
|
+
preserveScroll?: boolean;
|
|
26
|
+
/** Callback before swap */
|
|
27
|
+
onBeforeSwap?: (state: HotSwapState) => void;
|
|
28
|
+
/** Callback after swap */
|
|
29
|
+
onAfterSwap?: (state: HotSwapState) => void;
|
|
35
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Generate hot swap client script
|
|
33
|
+
* Injects into the story UI for seamless variant switching
|
|
34
|
+
*/
|
|
35
|
+
export declare function getHotSwapScript(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Generate variant selector UI
|
|
38
|
+
*/
|
|
39
|
+
export declare function getVariantSelectorHtml(variants: Array<{
|
|
40
|
+
id: string;
|
|
41
|
+
title: string;
|
|
42
|
+
}>, currentVariantId: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Generate variant selector styles
|
|
45
|
+
*/
|
|
46
|
+
export declare function getVariantSelectorStyles(): string;
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STX Story - Keyboard Shortcuts
|
|
3
|
+
* Keyboard shortcuts panel and handler
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Keyboard shortcut definition
|
|
7
|
+
*/
|
|
8
|
+
export interface KeyboardShortcut {
|
|
9
|
+
/** Shortcut key(s) */
|
|
10
|
+
key: string;
|
|
11
|
+
/** Modifier keys */
|
|
12
|
+
modifiers?: ('ctrl' | 'alt' | 'shift' | 'meta')[];
|
|
13
|
+
/** Description */
|
|
14
|
+
description: string;
|
|
15
|
+
/** Category */
|
|
16
|
+
category: string;
|
|
17
|
+
/** Action to perform */
|
|
18
|
+
action: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Default keyboard shortcuts
|
|
22
|
+
*/
|
|
23
|
+
export declare const defaultShortcuts: KeyboardShortcut[];
|
|
1
24
|
/**
|
|
2
25
|
* Format shortcut key for display
|
|
3
26
|
*/
|
|
@@ -14,21 +37,3 @@ export declare function getShortcutsStyles(): string;
|
|
|
14
37
|
* Generate keyboard shortcuts handler script
|
|
15
38
|
*/
|
|
16
39
|
export declare function getShortcutsScript(): string;
|
|
17
|
-
/**
|
|
18
|
-
* Default keyboard shortcuts
|
|
19
|
-
*/
|
|
20
|
-
export declare const defaultShortcuts: KeyboardShortcut[];
|
|
21
|
-
/**
|
|
22
|
-
* STX Story - Keyboard Shortcuts
|
|
23
|
-
* Keyboard shortcuts panel and handler
|
|
24
|
-
*/
|
|
25
|
-
/**
|
|
26
|
-
* Keyboard shortcut definition
|
|
27
|
-
*/
|
|
28
|
-
export declare interface KeyboardShortcut {
|
|
29
|
-
key: string
|
|
30
|
-
modifiers?: ('ctrl' | 'alt' | 'shift' | 'meta')[]
|
|
31
|
-
description: string
|
|
32
|
-
category: string
|
|
33
|
-
action: string
|
|
34
|
-
}
|