@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/ssr.d.ts
CHANGED
|
@@ -19,13 +19,13 @@ export declare function render(template: string, data?: Record<string, unknown>,
|
|
|
19
19
|
export declare function createApp(config?: AppConfig): void;
|
|
20
20
|
/** Session data store */
|
|
21
21
|
export declare interface SessionData {
|
|
22
|
-
|
|
22
|
+
[key: string]: unknown
|
|
23
23
|
}
|
|
24
24
|
/** Session interface */
|
|
25
25
|
export declare interface Session {
|
|
26
26
|
id: string
|
|
27
27
|
data: SessionData
|
|
28
|
-
get(key: string): T | undefined
|
|
28
|
+
get<T = unknown>(key: string): T | undefined
|
|
29
29
|
set(key: string, value: unknown): void
|
|
30
30
|
delete(key: string): void
|
|
31
31
|
clear(): void
|
|
@@ -72,7 +72,7 @@ export declare interface CookieOptions {
|
|
|
72
72
|
}
|
|
73
73
|
/** Validation errors */
|
|
74
74
|
export declare interface ValidationErrors {
|
|
75
|
-
|
|
75
|
+
[field: string]: string[]
|
|
76
76
|
}
|
|
77
77
|
/** App configuration */
|
|
78
78
|
export declare interface AppConfig {
|
|
@@ -87,21 +87,13 @@ export declare interface AppConfig {
|
|
|
87
87
|
csrfEnabled?: boolean
|
|
88
88
|
sessionStore?: SessionStore
|
|
89
89
|
}
|
|
90
|
-
/** Route definition */
|
|
91
|
-
declare interface Route {
|
|
92
|
-
method: string
|
|
93
|
-
pattern: string
|
|
94
|
-
handler: RouteHandler
|
|
95
|
-
middleware: Middleware[]
|
|
96
|
-
}
|
|
97
90
|
/** Route handler */
|
|
98
|
-
export type RouteHandler = (ctx: RequestContext) => Response | Promise<Response
|
|
91
|
+
export type RouteHandler = (ctx: RequestContext) => Response | Promise<Response>;
|
|
99
92
|
/** Middleware function */
|
|
100
|
-
export type Middleware = (ctx: RequestContext, next: () => Promise<Response>) => Response | Promise<Response
|
|
93
|
+
export type Middleware = (ctx: RequestContext, next: () => Promise<Response>) => Response | Promise<Response>;
|
|
101
94
|
/** Default in-memory session store. Use a custom SessionStore (Redis, DB) for production. */
|
|
102
95
|
export declare class MemorySessionStore implements SessionStore {
|
|
103
|
-
private store: any;
|
|
104
96
|
get(sessionId: string): Promise<SessionData | null>;
|
|
105
97
|
set(sessionId: string, data: SessionData, ttlSeconds: number): Promise<void>;
|
|
106
98
|
delete(sessionId: string): Promise<void>;
|
|
107
|
-
}
|
|
99
|
+
}
|
|
@@ -146,7 +146,7 @@ export declare function initDevTools(): void;
|
|
|
146
146
|
* </script>
|
|
147
147
|
* ```
|
|
148
148
|
*/
|
|
149
|
-
export declare function defineStore<S extends object, G extends Record<string, (state: S) => any> = Record<string, never>, A extends Record<string, (...args: any[]) => any> = Record<string, never
|
|
149
|
+
export declare function defineStore<S extends object, G extends Record<string, (state: S) => any> = Record<string, never>, A extends Record<string, (...args: any[]) => any> = Record<string, never>,>(id: string, options: DefineStoreOptions<S, G, A>): DefinedStoreWithGettersAndActions<S, G, A>;
|
|
150
150
|
/**
|
|
151
151
|
* Get a defined store by name.
|
|
152
152
|
* Used internally by the @stores import transformation.
|
|
@@ -262,56 +262,16 @@ export declare interface DefinedStore<S, G extends Record<string, (state: S) =>
|
|
|
262
262
|
_store: Store<S>
|
|
263
263
|
$id: string
|
|
264
264
|
}
|
|
265
|
-
/**
|
|
266
|
-
* State Management Module
|
|
267
|
-
*
|
|
268
|
-
* Provides reactive state management for stx templates with support for
|
|
269
|
-
* both simple stores and complex global state management.
|
|
270
|
-
*
|
|
271
|
-
* ## Features
|
|
272
|
-
*
|
|
273
|
-
* 1. **Reactive Stores** - Simple observable stores with auto-subscriptions
|
|
274
|
-
* 2. **Computed Values** - Derived state that auto-updates
|
|
275
|
-
* 3. **Actions** - Structured state mutations
|
|
276
|
-
* 4. **Persistence** - LocalStorage/SessionStorage integration
|
|
277
|
-
* 5. **DevTools** - State inspection and time-travel debugging
|
|
278
|
-
* 6. **Server State** - Sync state between server and client
|
|
279
|
-
*
|
|
280
|
-
* ## Usage
|
|
281
|
-
*
|
|
282
|
-
* ```typescript
|
|
283
|
-
* import { createStore, computed, action } from 'stx/state-management'
|
|
284
|
-
*
|
|
285
|
-
* const counter = createStore({ count: 0 })
|
|
286
|
-
*
|
|
287
|
-
* // Subscribe to changes
|
|
288
|
-
* counter.subscribe(state => console.log(state.count))
|
|
289
|
-
*
|
|
290
|
-
* // Update state
|
|
291
|
-
* counter.set({ count: counter.get().count + 1 })
|
|
292
|
-
* ```
|
|
293
|
-
*
|
|
294
|
-
* In templates:
|
|
295
|
-
* ```html
|
|
296
|
-
* <script>
|
|
297
|
-
* import { useStore } from 'stx/state-management'
|
|
298
|
-
* const { count } = useStore('counter')
|
|
299
|
-
* </script>
|
|
300
|
-
* <p>Count: {{ count }}</p>
|
|
301
|
-
* ```
|
|
302
|
-
*
|
|
303
|
-
* @module state-management
|
|
304
|
-
*/
|
|
305
265
|
/** Subscription callback */
|
|
306
|
-
export type Subscriber<T> = (value: T, previousValue: T | undefined) => void
|
|
266
|
+
export type Subscriber<T> = (value: T, previousValue: T | undefined) => void;
|
|
307
267
|
/** Unsubscribe function */
|
|
308
|
-
export type Unsubscribe = () => void
|
|
268
|
+
export type Unsubscribe = () => void;
|
|
309
269
|
/** Store middleware */
|
|
310
270
|
export type StoreMiddleware<T> = (
|
|
311
271
|
set: (value: T) => void,
|
|
312
272
|
get: () => T,
|
|
313
273
|
store: Store<T>
|
|
314
|
-
) => (nextSet: (value: T) => void) => (value: T) => void
|
|
274
|
+
) => (nextSet: (value: T) => void) => (value: T) => void;
|
|
315
275
|
// Type helper for getters
|
|
316
276
|
declare type StoreGetters<S, G extends Record<string, (state: S) => any>> = {
|
|
317
277
|
[K in keyof G]: ReturnType<G[K]>
|
|
@@ -321,4 +281,4 @@ declare type StoreActions<A extends Record<string, (...args: any[]) => any>> = {
|
|
|
321
281
|
[K in keyof A]: A[K]
|
|
322
282
|
}
|
|
323
283
|
// Full store type combining state, getters, and actions
|
|
324
|
-
export type DefinedStoreWithGettersAndActions<S, G extends Record<string, (state: S) => any>, A extends Record<string, (...args: any[]) => any
|
|
284
|
+
export type DefinedStoreWithGettersAndActions<S, G extends Record<string, (state: S) => any>, A extends Record<string, (...args: any[]) => any>,> = DefinedStore<S, G, A> & StoreGetters<S, G> & StoreActions<A>;
|
package/dist/stores-client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Define a reactive store with state, getters, and actions.
|
|
3
3
|
*/
|
|
4
|
-
export declare function defineStore<S extends object, G extends Record<string, (state: S) => any> = Record<string, never>, A extends Record<string, (...args: any[]) => any> = Record<string, never
|
|
4
|
+
export declare function defineStore<S extends object, G extends Record<string, (state: S) => any> = Record<string, never>, A extends Record<string, (...args: any[]) => any> = Record<string, never>,>(id: string, options: StoreOptions<S, G, A>): Store<S> & { [K in keyof G]: ReturnType<G[K]> } & { [K in keyof A]: A[K] };
|
|
5
5
|
/**
|
|
6
6
|
* Register multiple stores at once.
|
|
7
7
|
*/
|
|
@@ -13,7 +13,7 @@ export declare function getStore<T = any>(name: string): T | undefined;
|
|
|
13
13
|
/**
|
|
14
14
|
* Wait for a store to be available.
|
|
15
15
|
*/
|
|
16
|
-
export declare function waitForStore<T = any>(name: string, timeout?:
|
|
16
|
+
export declare function waitForStore<T = any>(name: string, timeout?: number): Promise<T>;
|
|
17
17
|
/**
|
|
18
18
|
* STX Stores - Client Runtime
|
|
19
19
|
*
|
|
@@ -67,4 +67,4 @@ export declare interface Store<S> {
|
|
|
67
67
|
$patch: (partial: Partial<S> | ((state: S) => void)) => void
|
|
68
68
|
$id: string
|
|
69
69
|
}
|
|
70
|
-
export type Unsubscribe = () => void
|
|
70
|
+
export type Unsubscribe = () => void;
|
package/dist/story/addons.d.ts
CHANGED
|
@@ -58,30 +58,23 @@ export type AnalyticsEventType = | 'view'
|
|
|
58
58
|
| 'search'
|
|
59
59
|
| 'bookmark'
|
|
60
60
|
| 'copy_code'
|
|
61
|
-
| 'test_run'
|
|
61
|
+
| 'test_run';
|
|
62
62
|
/**
|
|
63
63
|
* Analytics tracker
|
|
64
64
|
*/
|
|
65
65
|
export declare class AnalyticsTracker {
|
|
66
|
-
private storage: AnalyticsStorage;
|
|
67
|
-
private storagePath: string;
|
|
68
|
-
private currentSession: AnalyticsSession | null;
|
|
69
|
-
private dirty: any;
|
|
70
|
-
private viewStartTimes: any;
|
|
71
66
|
constructor(rootDir: string);
|
|
72
|
-
private loadStorage(): AnalyticsStorage;
|
|
73
67
|
save(): Promise<void>;
|
|
74
68
|
startSession(): void;
|
|
75
69
|
endSession(): void;
|
|
76
70
|
track(event: Omit<AnalyticsEvent, 'timestamp'>): void;
|
|
77
71
|
trackView(componentId: string, variantId?: string): void;
|
|
78
|
-
private endViewTiming(componentId: string): void;
|
|
79
72
|
trackPropChange(componentId: string, propName: string, value: any): void;
|
|
80
73
|
trackVariantSwitch(componentId: string, variantId: string): void;
|
|
81
74
|
trackSearch(query: string, resultCount: number): void;
|
|
82
75
|
getComponentAnalytics(componentId: string, componentName: string): ComponentAnalytics;
|
|
83
|
-
getMostViewedComponents(limit?:
|
|
84
|
-
getMostChangedProps(limit?:
|
|
76
|
+
getMostViewedComponents(limit?: number): Array<{ componentId: string, viewCount: number }>;
|
|
77
|
+
getMostChangedProps(limit?: number): Array<{ propName: string, changeCount: number }>;
|
|
85
78
|
getSearchAnalytics(): {
|
|
86
79
|
totalSearches: number
|
|
87
80
|
topQueries: Array<{ query: string, count: number }>
|
|
@@ -89,4 +82,4 @@ export declare class AnalyticsTracker {
|
|
|
89
82
|
};
|
|
90
83
|
clear(): void;
|
|
91
84
|
exportAnalytics(): string;
|
|
92
|
-
}
|
|
85
|
+
}
|
|
@@ -34,11 +34,7 @@ export declare interface BookmarksStorage {
|
|
|
34
34
|
* Bookmarks manager
|
|
35
35
|
*/
|
|
36
36
|
export declare class BookmarksManager {
|
|
37
|
-
private storage: BookmarksStorage;
|
|
38
|
-
private storagePath: string;
|
|
39
|
-
private dirty: any;
|
|
40
37
|
constructor(rootDir: string);
|
|
41
|
-
private loadStorage(): BookmarksStorage;
|
|
42
38
|
save(): Promise<void>;
|
|
43
39
|
addBookmark(storyId: string, variantId: string, props: Record<string, any>, options?: { name?: string, notes?: string, color?: string }): Bookmark;
|
|
44
40
|
getAllBookmarks(): Bookmark[];
|
|
@@ -49,5 +45,5 @@ export declare class BookmarksManager {
|
|
|
49
45
|
deleteBookmark(id: string): boolean;
|
|
50
46
|
toggleBookmark(storyId: string, variantId: string, props: Record<string, any>): { added: boolean, bookmark?: Bookmark };
|
|
51
47
|
exportBookmarks(): string;
|
|
52
|
-
importBookmarks(json: string, merge?:
|
|
53
|
-
}
|
|
48
|
+
importBookmarks(json: string, merge?: boolean): number;
|
|
49
|
+
}
|
package/dist/story/bun-test.d.ts
CHANGED
package/dist/story/cli.d.ts
CHANGED
|
@@ -7,28 +7,3 @@ export declare function registerStoryCommands(cli: any): void;
|
|
|
7
7
|
* Run story CLI directly (for standalone usage)
|
|
8
8
|
*/
|
|
9
9
|
export declare function runStoryCLI(args?: string[]): Promise<void>;
|
|
10
|
-
/**
|
|
11
|
-
* CLI command definitions for integration with @stacksjs/clapp
|
|
12
|
-
*/
|
|
13
|
-
export declare const storyCommands: {
|
|
14
|
-
/**
|
|
15
|
-
* Main story command (defaults to dev)
|
|
16
|
-
*/
|
|
17
|
-
'story': { description: 'Component showcase and testing'; options: { port: { alias: 'p'; type: 'number'; description: 'Server port (default: 6006)' }; open: { alias: 'o'; type: 'boolean'; description: 'Open browser automatically' }; host: { type: 'string'; description: 'Host to bind to' } }; action: (options: { port?: number, open?: boolean, host?: string }) => any };
|
|
18
|
-
/**
|
|
19
|
-
* Story dev subcommand
|
|
20
|
-
*/
|
|
21
|
-
'story:dev': { description: 'Start story development server'; options: { port: { alias: 'p'; type: 'number'; description: 'Server port (default: 6006)' }; open: { alias: 'o'; type: 'boolean'; description: 'Open browser automatically' }; host: { type: 'string'; description: 'Host to bind to' } }; action: (options: { port?: number, open?: boolean, host?: string }) => any };
|
|
22
|
-
/**
|
|
23
|
-
* Story build subcommand
|
|
24
|
-
*/
|
|
25
|
-
'story:build': { description: 'Build static story site'; options: { outDir: { alias: 'o'; type: 'string'; description: 'Output directory' } }; action: (options: { outDir?: string }) => any };
|
|
26
|
-
/**
|
|
27
|
-
* Story preview subcommand
|
|
28
|
-
*/
|
|
29
|
-
'story:preview': { description: 'Preview built story site'; options: { port: { alias: 'p'; type: 'number'; description: 'Server port (default: 4173)' }; open: { alias: 'o'; type: 'boolean'; description: 'Open browser automatically' } }; action: (options: { port?: number, open?: boolean }) => any };
|
|
30
|
-
/**
|
|
31
|
-
* Story test subcommand
|
|
32
|
-
*/
|
|
33
|
-
'story:test': { description: 'Run visual regression tests'; options: { update: { alias: 'u'; type: 'boolean'; description: 'Update snapshots' }; filter: { alias: 'f'; type: 'string'; description: 'Filter components by name' } }; action: (options: { update?: boolean, filter?: string }) => any }
|
|
34
|
-
};
|
|
@@ -30,4 +30,4 @@ export declare function extractCssClasses(content: string): string[];
|
|
|
30
30
|
/**
|
|
31
31
|
* Extract directive usage from template
|
|
32
32
|
*/
|
|
33
|
-
export declare function extractDirectives(content: string): DirectiveUsage[];
|
|
33
|
+
export declare function extractDirectives(content: string): DirectiveUsage[];
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STX Story - Collection module
|
|
3
|
+
* Discovers and analyzes story files
|
|
4
|
+
*/
|
|
1
5
|
export {
|
|
2
6
|
analyzeComponent,
|
|
3
7
|
analyzeComponentFile,
|
|
@@ -24,4 +28,4 @@ export {
|
|
|
24
28
|
createTreePath,
|
|
25
29
|
findStoryInTree,
|
|
26
30
|
flattenTree,
|
|
27
|
-
} from './tree';
|
|
31
|
+
} from './tree';
|
|
@@ -14,4 +14,4 @@ export declare function extractScriptContent(content: string): string;
|
|
|
14
14
|
/**
|
|
15
15
|
* Extract template content from a story file (everything outside script tags)
|
|
16
16
|
*/
|
|
17
|
-
export declare function extractTemplateContent(content: string): string;
|
|
17
|
+
export declare function extractTemplateContent(content: string): string;
|
|
@@ -10,4 +10,4 @@ export declare function isNonComponentFile(relativePath: string): boolean;
|
|
|
10
10
|
/**
|
|
11
11
|
* Watch for story file changes
|
|
12
12
|
*/
|
|
13
|
-
export declare function watchStoryFiles(ctx: StoryContext, onChange: (event: 'add' | 'change' | 'unlink', file: ServerStoryFile) => void): () => void;
|
|
13
|
+
export declare function watchStoryFiles(ctx: StoryContext, onChange: (event: 'add' | 'change' | 'unlink', file: ServerStoryFile) => void): () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ResolvedStoryConfig, ServerStoryFile, ServerTree, ServerTreeLeaf
|
|
1
|
+
import type { ResolvedStoryConfig, ServerStoryFile, ServerTree, ServerTreeLeaf } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* Create tree path from a story file
|
|
4
4
|
*/
|
|
@@ -14,4 +14,4 @@ export declare function flattenTree(tree: ServerTree): number[];
|
|
|
14
14
|
/**
|
|
15
15
|
* Find a story in the tree by index
|
|
16
16
|
*/
|
|
17
|
-
export declare function findStoryInTree(tree: ServerTree, index: number): { path: string[], node: ServerTreeLeaf } | null;
|
|
17
|
+
export declare function findStoryInTree(tree: ServerTree, index: number): { path: string[], node: ServerTreeLeaf } | null;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export type { BuildOptions } from './build';
|
|
2
2
|
export type { DevOptions } from './dev';
|
|
3
3
|
export type { PreviewOptions } from './preview';
|
|
4
|
+
/**
|
|
5
|
+
* STX Story - CLI commands
|
|
6
|
+
*/
|
|
4
7
|
export { build, buildCommand } from './build';
|
|
5
8
|
export { dev, devCommand } from './dev';
|
|
6
|
-
export { preview, previewCommand } from './preview';
|
|
9
|
+
export { preview, previewCommand } from './preview';
|
package/dist/story/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BackgroundPreset, ResolvedStoryConfig, ResponsivePreset, StoryConfig, StoryTreeConfig
|
|
1
|
+
import type { BackgroundPreset, ResolvedStoryConfig, ResponsivePreset, StoryConfig, StoryTreeConfig } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Resolve story configuration with defaults
|
|
4
4
|
*/
|
|
@@ -23,4 +23,4 @@ export declare const defaultTreeConfig: Required<StoryTreeConfig>;
|
|
|
23
23
|
/**
|
|
24
24
|
* Default story configuration
|
|
25
25
|
*/
|
|
26
|
-
export declare const defaultStoryConfig: StoryConfig;
|
|
26
|
+
export declare const defaultStoryConfig: StoryConfig;
|
package/dist/story/context.d.ts
CHANGED
|
@@ -51,4 +51,4 @@ export declare function getControlStyles(): string;
|
|
|
51
51
|
* Button group control
|
|
52
52
|
*/
|
|
53
53
|
export declare function renderButtonGroupControl(title: string, value: any, onChange: string, config: ControlConfig): string;
|
|
54
|
-
declare type ControlOption = string | { value: any, label: string }
|
|
54
|
+
declare type ControlOption = string | { value: any, label: string }
|
package/dist/story/errors.d.ts
CHANGED
|
@@ -162,8 +162,8 @@ export type FigmaNodeType = | 'DOCUMENT'
|
|
|
162
162
|
| 'SLICE'
|
|
163
163
|
| 'COMPONENT'
|
|
164
164
|
| 'COMPONENT_SET'
|
|
165
|
-
| 'INSTANCE'
|
|
165
|
+
| 'INSTANCE';
|
|
166
166
|
/**
|
|
167
167
|
* Union of all Figma node types
|
|
168
168
|
*/
|
|
169
|
-
export type FigmaNode = FigmaFrameNode | FigmaTextNode | FigmaRectangleNode | FigmaNodeBase
|
|
169
|
+
export type FigmaNode = FigmaFrameNode | FigmaTextNode | FigmaRectangleNode | FigmaNodeBase;
|
|
@@ -18,4 +18,4 @@ export declare function generateStorySource(componentName: string, state: Record
|
|
|
18
18
|
/**
|
|
19
19
|
* Generate a complete story file content
|
|
20
20
|
*/
|
|
21
|
-
export declare function generateStoryFileContent(component: AnalyzedComponent): string;
|
|
21
|
+
export declare function generateStoryFileContent(component: AnalyzedComponent): string;
|
package/dist/story/hmr.d.ts
CHANGED
package/dist/story/hot-swap.d.ts
CHANGED
package/dist/story/index.d.ts
CHANGED
|
@@ -1,15 +1,35 @@
|
|
|
1
1
|
export type { CreateContextOptions } from './context';
|
|
2
2
|
export type { ServerOptions, StoryServer } from './server';
|
|
3
|
+
/**
|
|
4
|
+
* STX Story - Component showcase and testing
|
|
5
|
+
*
|
|
6
|
+
* Native component explorer for stx, providing:
|
|
7
|
+
* - Automatic component discovery
|
|
8
|
+
* - Interactive prop editing
|
|
9
|
+
* - Visual regression testing
|
|
10
|
+
* - Documentation generation
|
|
11
|
+
*/
|
|
12
|
+
// Addons
|
|
3
13
|
export * from './addons';
|
|
14
|
+
// Analytics
|
|
4
15
|
export * from './analytics';
|
|
16
|
+
// Auto-generate Stories
|
|
5
17
|
export * from './auto-stories';
|
|
18
|
+
// Bookmarks
|
|
6
19
|
export * from './bookmarks';
|
|
20
|
+
// Bun Test Integration
|
|
7
21
|
export * from './bun-test';
|
|
22
|
+
// CLI
|
|
8
23
|
export * from './cli';
|
|
24
|
+
// Collection (scanner, analyzer, tree)
|
|
9
25
|
export * from './collect';
|
|
26
|
+
// Commands
|
|
10
27
|
export * from './commands';
|
|
28
|
+
// Compiled Output
|
|
11
29
|
export * from './compiled-output';
|
|
30
|
+
// Composition (dependency graph)
|
|
12
31
|
export * from './composition';
|
|
32
|
+
// Configuration
|
|
13
33
|
export {
|
|
14
34
|
defaultBackgroundPresets,
|
|
15
35
|
defaultResponsivePresets,
|
|
@@ -17,35 +37,63 @@ export {
|
|
|
17
37
|
getDefaultStoryConfig,
|
|
18
38
|
resolveStoryConfig,
|
|
19
39
|
} from './config';
|
|
40
|
+
// Config Watcher
|
|
20
41
|
export * from './config-watcher';
|
|
42
|
+
// Context
|
|
21
43
|
export {
|
|
22
44
|
createContext,
|
|
23
45
|
updateContextStoryFiles,
|
|
24
46
|
updateContextTree,
|
|
25
47
|
} from './context';
|
|
48
|
+
// Controls
|
|
26
49
|
export * from './controls';
|
|
50
|
+
// Desktop Preview
|
|
27
51
|
export * from './desktop-preview';
|
|
52
|
+
// Docs Generator
|
|
28
53
|
export * from './docs-generator';
|
|
54
|
+
// Errors
|
|
29
55
|
export * from './errors';
|
|
56
|
+
// Figma Export
|
|
30
57
|
export * from './figma-export';
|
|
58
|
+
// Generator
|
|
31
59
|
export * from './generator';
|
|
60
|
+
// Crosswind CSS
|
|
32
61
|
export * from './crosswind';
|
|
62
|
+
// HMR
|
|
33
63
|
export * from './hmr';
|
|
64
|
+
// Hot Swap
|
|
34
65
|
export * from './hot-swap';
|
|
66
|
+
// Interactions
|
|
35
67
|
export * from './interactions';
|
|
68
|
+
// Keyboard Shortcuts
|
|
36
69
|
export * from './keyboard-shortcuts';
|
|
70
|
+
// Output (terminal styling)
|
|
37
71
|
export * from './output';
|
|
72
|
+
// Performance Profiling
|
|
38
73
|
export * from './performance';
|
|
74
|
+
// Presets
|
|
39
75
|
export * from './presets';
|
|
76
|
+
// Props Validation
|
|
40
77
|
export * from './props-validation';
|
|
78
|
+
// Renderer
|
|
41
79
|
export * from './renderer';
|
|
80
|
+
// Search
|
|
42
81
|
export * from './search';
|
|
82
|
+
// Search Index
|
|
43
83
|
export * from './search-index';
|
|
84
|
+
// Server
|
|
44
85
|
export { createStoryServer } from './server';
|
|
86
|
+
// Setup
|
|
45
87
|
export * from './setup';
|
|
88
|
+
// Snapshots
|
|
46
89
|
export * from './snapshots';
|
|
90
|
+
// Testing
|
|
47
91
|
export * from './testing';
|
|
92
|
+
// Theme
|
|
48
93
|
export * from './theme';
|
|
94
|
+
// Types
|
|
49
95
|
export * from './types';
|
|
96
|
+
// UI Components
|
|
50
97
|
export * from './ui';
|
|
51
|
-
|
|
98
|
+
// Visual Testing
|
|
99
|
+
export * from './visual-testing';
|
package/dist/story/output.d.ts
CHANGED
|
@@ -82,4 +82,4 @@ export declare const gray: (text: string) => string;
|
|
|
82
82
|
export declare const bold: (text: string) => string;
|
|
83
83
|
export declare const dim: (text: string) => string;
|
|
84
84
|
export declare const italic: (text: string) => string;
|
|
85
|
-
export declare const underline: (text: string) => string;
|
|
85
|
+
export declare const underline: (text: string) => string;
|
|
@@ -46,18 +46,14 @@ export declare interface RenderRecord {
|
|
|
46
46
|
* Performance profiler
|
|
47
47
|
*/
|
|
48
48
|
export declare class PerformanceProfiler {
|
|
49
|
-
private metrics: any;
|
|
50
|
-
private maxHistorySize: any;
|
|
51
|
-
private enabled: any;
|
|
52
49
|
setEnabled(enabled: boolean): void;
|
|
53
50
|
recordRender(componentId: string, componentName: string, duration: number, props?: Record<string, any>): void;
|
|
54
51
|
getMetrics(componentId: string): ComponentMetrics | undefined;
|
|
55
52
|
getAllMetrics(): ComponentMetrics[];
|
|
56
|
-
getSlowestComponents(limit?:
|
|
57
|
-
getMostRenderedComponents(limit?:
|
|
53
|
+
getSlowestComponents(limit?: number): ComponentMetrics[];
|
|
54
|
+
getMostRenderedComponents(limit?: number): ComponentMetrics[];
|
|
58
55
|
clear(): void;
|
|
59
56
|
clearComponent(componentId: string): void;
|
|
60
|
-
private getMemoryUsage(): number | undefined;
|
|
61
57
|
exportMetrics(): string;
|
|
62
58
|
createTimer(componentId: string, componentName: string): RenderTimer;
|
|
63
59
|
}
|
|
@@ -65,12 +61,7 @@ export declare class PerformanceProfiler {
|
|
|
65
61
|
* Render timer helper
|
|
66
62
|
*/
|
|
67
63
|
export declare class RenderTimer {
|
|
68
|
-
private startTime: number;
|
|
69
|
-
private props?: Record<string, any>;
|
|
70
|
-
private profiler: PerformanceProfiler;
|
|
71
|
-
private componentId: string;
|
|
72
|
-
private componentName: string;
|
|
73
64
|
constructor(profiler: PerformanceProfiler, componentId: string, componentName: string);
|
|
74
65
|
setProps(props: Record<string, any>): this;
|
|
75
66
|
end(): number;
|
|
76
|
-
}
|
|
67
|
+
}
|
package/dist/story/presets.d.ts
CHANGED
|
@@ -36,12 +36,7 @@ export declare interface PresetsStorage {
|
|
|
36
36
|
* Presets manager
|
|
37
37
|
*/
|
|
38
38
|
export declare class PresetsManager {
|
|
39
|
-
private storage: PresetsStorage;
|
|
40
|
-
private storagePath: string;
|
|
41
|
-
private dirty: any;
|
|
42
39
|
constructor(rootDir: string);
|
|
43
|
-
private loadStorage(): PresetsStorage;
|
|
44
|
-
private migrateStorage(data: any): PresetsStorage;
|
|
45
40
|
save(): Promise<void>;
|
|
46
41
|
createPreset(name: string, props: Record<string, any>, options?: {
|
|
47
42
|
description?: string
|
|
@@ -56,7 +51,7 @@ export declare class PresetsManager {
|
|
|
56
51
|
updatePreset(id: string, updates: Partial<Omit<PropPreset, 'id' | 'created'>>): PropPreset | undefined;
|
|
57
52
|
deletePreset(id: string): boolean;
|
|
58
53
|
searchPresets(query: string): PropPreset[];
|
|
59
|
-
getMostUsedPresets(limit?:
|
|
54
|
+
getMostUsedPresets(limit?: number): PropPreset[];
|
|
60
55
|
exportPresets(ids?: string[]): string;
|
|
61
|
-
importPresets(json: string, overwrite?:
|
|
62
|
-
}
|
|
56
|
+
importPresets(json: string, overwrite?: boolean): number;
|
|
57
|
+
}
|