@stacksjs/stx 0.1.16 → 0.2.3
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 +109 -5
- package/dist/analytics.d.ts +40 -0
- package/dist/animation.d.ts +91 -1
- package/dist/app.d.ts +51 -0
- package/dist/ast.d.ts +286 -0
- package/dist/async-components.d.ts +101 -0
- package/dist/auth.d.ts +1 -3
- package/dist/browser-composables.d.ts +314 -0
- package/dist/build-optimizer.d.ts +126 -0
- package/dist/build-views.d.ts +37 -0
- package/dist/bundle-analyzer/collector.d.ts +66 -0
- package/dist/bundle-analyzer/index.d.ts +60 -0
- package/dist/bundle-analyzer/report.d.ts +39 -0
- package/dist/bundle-analyzer/treemap.d.ts +19 -0
- package/dist/bundle-analyzer.js +499 -0
- package/dist/caching.d.ts +7 -0
- package/dist/cli.js +10885 -1203
- package/dist/client/directive.d.ts +10 -0
- package/dist/client/index.d.ts +7 -0
- package/dist/client/router.d.ts +36 -0
- package/dist/client/stx-router.browser.d.ts +0 -0
- package/dist/client-script.d.ts +22 -0
- package/dist/component-hmr.d.ts +120 -0
- package/dist/components.d.ts +23 -1
- package/dist/composables/index.d.ts +277 -0
- package/dist/composables/use-battery.d.ts +46 -0
- package/dist/composables/use-broadcast-channel.d.ts +58 -0
- package/dist/composables/use-clipboard.d.ts +34 -0
- package/dist/composables/use-cookie.d.ts +70 -0
- package/dist/composables/use-device-orientation.d.ts +109 -0
- package/dist/composables/use-event-source.d.ts +77 -0
- package/dist/composables/use-eye-dropper.d.ts +107 -0
- package/dist/composables/use-fetch.d.ts +84 -0
- package/dist/composables/use-fullscreen.d.ts +47 -0
- package/dist/composables/use-geolocation.d.ts +62 -0
- package/dist/composables/use-idle.d.ts +84 -0
- package/dist/composables/use-intersection-observer.d.ts +81 -0
- package/dist/composables/use-keyboard.d.ts +100 -0
- package/dist/composables/use-media-query.d.ts +56 -0
- package/dist/composables/use-mouse.d.ts +64 -0
- package/dist/composables/use-mutation-observer.d.ts +101 -0
- package/dist/composables/use-network.d.ts +40 -0
- package/dist/composables/use-notification.d.ts +89 -0
- package/dist/composables/use-permissions.d.ts +109 -0
- package/dist/composables/use-resize-observer.d.ts +60 -0
- package/dist/composables/use-share.d.ts +70 -0
- package/dist/composables/use-speech.d.ts +117 -0
- package/dist/composables/use-storage.d.ts +64 -0
- package/dist/composables/use-text-selection.d.ts +97 -0
- package/dist/composables/use-wake-lock.d.ts +85 -0
- package/dist/composables/use-websocket.d.ts +69 -0
- package/dist/composables/use-window.d.ts +84 -0
- package/dist/composables.d.ts +268 -0
- package/dist/composition-api.d.ts +190 -0
- package/dist/computed.d.ts +137 -0
- package/dist/conditionals.d.ts +14 -2
- package/dist/config.d.ts +36 -3
- package/dist/craft-bridge.d.ts +319 -0
- package/dist/craft-compiler.d.ts +229 -0
- package/dist/craft-components.d.ts +411 -0
- package/dist/craft-entry.d.ts +5 -0
- package/dist/craft-ssr.d.ts +134 -0
- package/dist/craft.js +1553 -0
- package/dist/csp.d.ts +229 -0
- package/dist/database.d.ts +407 -0
- package/dist/database.js +5 -0
- package/dist/defer.d.ts +4 -0
- package/dist/deploy/config-generators.d.ts +75 -0
- package/dist/deploy/index.d.ts +84 -0
- package/dist/deploy/netlify.d.ts +109 -0
- package/dist/dev-server/crosswind.d.ts +54 -0
- package/dist/dev-server/index.d.ts +7 -0
- package/dist/dev-server/keyboard-shortcuts.d.ts +34 -0
- package/dist/dev-server/native-window.d.ts +40 -0
- package/dist/dev-server/port-utils.d.ts +27 -0
- package/dist/dev-server/terminal-colors.d.ts +60 -0
- package/dist/dev-server/theme-selector.d.ts +32 -0
- package/dist/dev-server/types.d.ts +92 -0
- package/dist/dev-server.d.ts +21 -0
- package/dist/devtools.d.ts +142 -0
- package/dist/directive-api.d.ts +111 -0
- package/dist/dynamic-components.d.ts +14 -0
- package/dist/edge-runtime.d.ts +200 -0
- package/dist/env.d.ts +9 -0
- package/dist/error-boundaries.d.ts +71 -0
- package/dist/error-handling.d.ts +1 -101
- package/dist/errors/codes.d.ts +99 -0
- package/dist/errors/formatter.d.ts +64 -0
- package/dist/errors/index.d.ts +56 -0
- package/dist/errors/logger.d.ts +74 -0
- package/dist/errors/sanitizer.d.ts +43 -0
- package/dist/errors/types.d.ts +79 -0
- package/dist/events.d.ts +106 -0
- package/dist/expressions.d.ts +86 -11
- package/dist/formatter.d.ts +4 -0
- package/dist/forms-validation.d.ts +173 -0
- package/dist/forms.d.ts +157 -8
- package/dist/head.d.ts +225 -0
- package/dist/heatmap.d.ts +125 -0
- package/dist/hot-reload.d.ts +87 -0
- package/dist/hydration-runtime.d.ts +47 -0
- package/dist/hydration.d.ts +161 -0
- package/dist/i18n.d.ts +240 -4
- package/dist/image-optimization/build-plugin.d.ts +53 -0
- package/dist/image-optimization/component.d.ts +46 -0
- package/dist/image-optimization/directive.d.ts +30 -0
- package/dist/image-optimization/index.d.ts +86 -0
- package/dist/image-optimization/processor.d.ts +112 -0
- package/dist/includes.d.ts +94 -9
- package/dist/index.d.ts +63 -3
- package/dist/index.js +11604 -1318
- package/dist/init.d.ts +32 -2
- package/dist/interactive.d.ts +14 -0
- package/dist/internal-markdown.d.ts +22 -0
- package/dist/jsx-runtime.d.ts +110 -0
- package/dist/keep-alive.d.ts +87 -0
- package/dist/lazy-loader.d.ts +122 -0
- package/dist/loading-indicator.d.ts +40 -0
- package/dist/loops.d.ts +22 -1
- package/dist/media/client/blur-up.d.ts +65 -0
- package/dist/media/client/index.d.ts +77 -0
- package/dist/media/client/lazy-load.d.ts +73 -0
- package/dist/media/client/upload-handler.d.ts +79 -0
- package/dist/media/image/component.d.ts +46 -0
- package/dist/media/image/directive.d.ts +9 -0
- package/dist/media/image/editing.d.ts +212 -0
- package/dist/media/image/index.d.ts +118 -0
- package/dist/media/image/placeholder.d.ts +78 -0
- package/dist/media/image/processor/cache.d.ts +32 -0
- package/dist/media/image/processor/index.d.ts +12 -0
- package/dist/media/image/processor/optimizer.d.ts +13 -0
- package/dist/media/image/processor/responsive.d.ts +17 -0
- package/dist/media/image/srcset.d.ts +158 -0
- package/dist/media/index.d.ts +295 -0
- package/dist/media/manager/embed.d.ts +25 -0
- package/dist/media/protected/component.d.ts +34 -0
- package/dist/media/protected/index.d.ts +34 -0
- package/dist/media/protected/signature.d.ts +72 -0
- package/dist/media/shared/cache.d.ts +54 -0
- package/dist/media/shared/hash.d.ts +24 -0
- package/dist/media/shared/index.d.ts +2 -0
- package/dist/media/types.d.ts +1051 -0
- package/dist/media/upload/component.d.ts +23 -0
- package/dist/media/upload/index.d.ts +1 -0
- package/dist/media/video/directive.d.ts +9 -0
- package/dist/media/video/index.d.ts +47 -0
- package/dist/media/video/processor/cache.d.ts +33 -0
- package/dist/media/video/processor/index.d.ts +21 -0
- package/dist/media/video/processor/streaming.d.ts +19 -0
- package/dist/media/video/processor/thumbnail.d.ts +28 -0
- package/dist/media/video/processor/transcoder.d.ts +9 -0
- package/dist/middleware.d.ts +42 -3
- package/dist/native-build.d.ts +74 -0
- package/dist/parser/directive-parser.d.ts +79 -0
- package/dist/parser/expression-parser.d.ts +59 -0
- package/dist/parser/index.d.ts +35 -0
- package/dist/parser/tokenizer.d.ts +81 -0
- package/dist/partial-hydration.d.ts +88 -0
- package/dist/performance-utils.d.ts +146 -3
- package/dist/plugin-system.d.ts +128 -0
- package/dist/plugin.d.ts +1 -0
- package/dist/precompiler.d.ts +108 -0
- package/dist/production-build.d.ts +199 -0
- package/dist/props.d.ts +199 -0
- package/dist/pwa/audit.d.ts +42 -0
- package/dist/pwa/directives.d.ts +29 -0
- package/dist/pwa/icons.d.ts +39 -0
- package/dist/pwa/index.d.ts +59 -0
- package/dist/pwa/inject.d.ts +22 -0
- package/dist/pwa/manifest.d.ts +104 -0
- package/dist/pwa/offline.d.ts +8 -0
- package/dist/pwa/precache.d.ts +29 -0
- package/dist/pwa/service-worker.d.ts +21 -0
- package/dist/pwa/workbox-strategies.d.ts +100 -0
- package/dist/pwa/workbox.d.ts +52 -0
- package/dist/pwa.d.ts +51 -0
- package/dist/pwa.js +8124 -0
- package/dist/reactive-bindings.d.ts +24 -0
- package/dist/reactive.d.ts +100 -0
- package/dist/reactivity.d.ts +253 -0
- package/dist/route-middleware.d.ts +232 -0
- package/dist/router.d.ts +31 -0
- package/dist/routes.d.ts +0 -7
- package/dist/runtime.d.ts +140 -0
- package/dist/safe-evaluator.d.ts +117 -3
- package/dist/scaffolding.d.ts +113 -0
- package/dist/seo.d.ts +120 -7
- package/dist/server-components.d.ts +134 -0
- package/dist/signals.d.ts +501 -0
- package/dist/slots.d.ts +63 -0
- package/dist/source-maps.d.ts +117 -0
- package/dist/ssg.d.ts +157 -0
- package/dist/ssg.js +6831 -0
- package/dist/ssr.d.ts +107 -0
- package/dist/state-management.d.ts +324 -0
- package/dist/stores-client.d.ts +70 -0
- package/dist/story/addons.d.ts +123 -0
- package/dist/story/analytics.d.ts +92 -0
- package/dist/story/auto-stories.d.ts +38 -0
- package/dist/story/bookmarks.d.ts +53 -0
- package/dist/story/bun-test.d.ts +44 -0
- package/dist/story/cli.d.ts +34 -0
- package/dist/story/collect/analyzer.d.ts +33 -0
- package/dist/story/collect/index.d.ts +27 -0
- package/dist/story/collect/parser.d.ts +17 -0
- package/dist/story/collect/scanner.d.ts +13 -0
- package/dist/story/collect/tree.d.ts +17 -0
- package/dist/story/commands/build.d.ts +14 -0
- package/dist/story/commands/dev.d.ts +16 -0
- package/dist/story/commands/index.d.ts +6 -0
- package/dist/story/commands/preview.d.ts +15 -0
- package/dist/story/compiled-output.d.ts +26 -0
- package/dist/story/composition.d.ts +47 -0
- package/dist/story/config-watcher.d.ts +26 -0
- package/dist/story/config.d.ts +26 -0
- package/dist/story/context.d.ts +21 -0
- package/dist/story/controls/index.d.ts +54 -0
- package/dist/story/crosswind.d.ts +29 -0
- package/dist/story/desktop-preview.d.ts +34 -0
- package/dist/story/docs-generator.d.ts +30 -0
- package/dist/story/errors.d.ts +47 -0
- package/dist/story/figma-export.d.ts +169 -0
- package/dist/story/generator.d.ts +21 -0
- package/dist/story/hmr.d.ts +64 -0
- package/dist/story/hot-swap.d.ts +35 -0
- package/dist/story/index.d.ts +51 -0
- package/dist/story/interactions.d.ts +52 -0
- package/dist/story/keyboard-shortcuts.d.ts +34 -0
- package/dist/story/output.d.ts +85 -0
- package/dist/story/performance.d.ts +76 -0
- package/dist/story/presets.d.ts +62 -0
- package/dist/story/props-validation.d.ts +45 -0
- package/dist/story/renderer.d.ts +53 -0
- package/dist/story/search-index.d.ts +47 -0
- package/dist/story/search.d.ts +45 -0
- package/dist/story/server.d.ts +21 -0
- package/dist/story/setup.d.ts +47 -0
- package/dist/story/snapshots.d.ts +65 -0
- package/dist/story/testing.d.ts +58 -0
- package/dist/story/theme.d.ts +68 -0
- package/dist/story/types.d.ts +249 -0
- package/dist/story/ui/code-panel.d.ts +42 -0
- package/dist/story/ui/controls-panel.d.ts +25 -0
- package/dist/story/ui/index.d.ts +4 -0
- package/dist/story/ui/navigation.d.ts +55 -0
- package/dist/story/ui/preview.d.ts +46 -0
- package/dist/story/visual-testing.d.ts +45 -0
- package/dist/streaming.d.ts +82 -2
- package/dist/suspense.d.ts +83 -0
- package/dist/teleport.d.ts +9 -0
- package/dist/testing.d.ts +289 -0
- package/dist/transitions.d.ts +87 -0
- package/dist/type-checker.d.ts +109 -0
- package/dist/types/component-types.d.ts +129 -0
- package/dist/types/config-types.d.ts +336 -0
- package/dist/types/context-types.d.ts +99 -0
- package/dist/types/csp-types.d.ts +79 -0
- package/dist/types/directive-types.d.ts +259 -0
- package/dist/types/index.d.ts +98 -0
- package/dist/types/pwa-types.d.ts +218 -0
- package/dist/types.d.ts +1 -315
- package/dist/typescript-templates.d.ts +178 -0
- package/dist/utils.d.ts +52 -6
- package/dist/validator.d.ts +77 -0
- package/dist/variable-extractor.d.ts +39 -0
- package/dist/view-composers.d.ts +154 -9
- package/dist/virtual-scrolling.d.ts +103 -0
- package/dist/visual-editor.d.ts +209 -0
- package/dist/visual-testing.d.ts +109 -0
- package/dist/visual-testing.js +126 -0
- package/dist/vue-template.d.ts +16 -0
- package/dist/web-components/css-scoping.d.ts +54 -0
- package/dist/web-components/index.d.ts +20 -0
- package/dist/web-components/reactive-generator.d.ts +72 -0
- package/dist/web-components.d.ts +222 -2
- package/dist/x-element.d.ts +35 -0
- package/package.json +41 -10
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import type { ComponentConfig, DocGeneratorConfig, WebComponentConfig } from './component-types';
|
|
2
|
+
import type { CspConfig } from './csp-types';
|
|
3
|
+
import type { CustomDirective, Middleware } from './directive-types';
|
|
4
|
+
import type { HeatmapConfig } from '../heatmap';
|
|
5
|
+
import type { MediaConfig } from '../media/types';
|
|
6
|
+
import type { MiddlewareMode } from '../route-middleware';
|
|
7
|
+
import type { PwaConfig } from './pwa-types';
|
|
8
|
+
/**
|
|
9
|
+
* Internationalization (i18n) configuration
|
|
10
|
+
*/
|
|
11
|
+
export declare interface I18nConfig {
|
|
12
|
+
defaultLocale: string
|
|
13
|
+
locale: string
|
|
14
|
+
translationsDir: string
|
|
15
|
+
format: 'json' | 'yaml' | 'yml' | 'js'
|
|
16
|
+
fallbackToKey: boolean
|
|
17
|
+
cache: boolean
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Streaming configuration
|
|
21
|
+
*/
|
|
22
|
+
export declare interface StreamingConfig {
|
|
23
|
+
enabled: boolean
|
|
24
|
+
bufferSize: number
|
|
25
|
+
strategy: 'auto' | 'manual' | 'sections'
|
|
26
|
+
timeout: number
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Stream renderer for progressive loading
|
|
30
|
+
*/
|
|
31
|
+
export declare interface StreamRenderer {
|
|
32
|
+
renderShell: (data?: Record<string, unknown>) => Promise<string>
|
|
33
|
+
renderSection: (section: string, data?: Record<string, unknown>) => Promise<string>
|
|
34
|
+
getSections: () => string[]
|
|
35
|
+
getTemplate: () => string
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Hydration configuration
|
|
39
|
+
*/
|
|
40
|
+
export declare interface HydrationConfig {
|
|
41
|
+
enabled: boolean
|
|
42
|
+
mode: 'progressive' | 'islands'
|
|
43
|
+
clientEntry: string
|
|
44
|
+
autoMarkers: boolean
|
|
45
|
+
preload: 'none' | 'eager' | 'lazy'
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Island definition for partial hydration
|
|
49
|
+
*/
|
|
50
|
+
export declare interface Island {
|
|
51
|
+
id: string
|
|
52
|
+
component: string
|
|
53
|
+
props?: Record<string, unknown>
|
|
54
|
+
priority?: 'eager' | 'lazy'
|
|
55
|
+
shadowDOM?: boolean
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Accessibility configuration
|
|
59
|
+
*/
|
|
60
|
+
export declare interface A11yConfig {
|
|
61
|
+
enabled: boolean
|
|
62
|
+
addSrOnlyStyles: boolean
|
|
63
|
+
level: 'AA' | 'AAA'
|
|
64
|
+
ignoreChecks?: string[]
|
|
65
|
+
autoFix: boolean
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* SEO OpenGraph configuration
|
|
69
|
+
*/
|
|
70
|
+
export declare interface OpenGraphConfig {
|
|
71
|
+
type?: string
|
|
72
|
+
title?: string
|
|
73
|
+
description?: string
|
|
74
|
+
url?: string
|
|
75
|
+
image?: string
|
|
76
|
+
imageAlt?: string
|
|
77
|
+
imageWidth?: number
|
|
78
|
+
imageHeight?: number
|
|
79
|
+
siteName?: string
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* SEO Twitter card configuration
|
|
83
|
+
*/
|
|
84
|
+
export declare interface TwitterConfig {
|
|
85
|
+
card?: 'summary' | 'summary_large_image' | 'app' | 'player'
|
|
86
|
+
title?: string
|
|
87
|
+
description?: string
|
|
88
|
+
image?: string
|
|
89
|
+
site?: string
|
|
90
|
+
creator?: string
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* SEO configuration
|
|
94
|
+
*/
|
|
95
|
+
export declare interface SeoConfig {
|
|
96
|
+
title?: string
|
|
97
|
+
description?: string
|
|
98
|
+
keywords?: string[] | string
|
|
99
|
+
robots?: string
|
|
100
|
+
canonical?: string
|
|
101
|
+
openGraph?: OpenGraphConfig
|
|
102
|
+
twitter?: TwitterConfig
|
|
103
|
+
structuredData?: Record<string, unknown>
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* SEO features configuration
|
|
107
|
+
*/
|
|
108
|
+
export declare interface SeoFeatureConfig {
|
|
109
|
+
enabled: boolean
|
|
110
|
+
defaultConfig?: SeoConfig
|
|
111
|
+
socialPreview?: boolean
|
|
112
|
+
defaultImage?: string
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Analytics configuration for automatic script injection
|
|
116
|
+
*/
|
|
117
|
+
export declare interface AnalyticsConfig {
|
|
118
|
+
enabled: boolean
|
|
119
|
+
driver: AnalyticsDriver
|
|
120
|
+
fathom?: {
|
|
121
|
+
/** Fathom site ID */
|
|
122
|
+
siteId: string
|
|
123
|
+
/** Custom script URL (default: https://cdn.usefathom.com/script.js) */
|
|
124
|
+
scriptUrl?: string
|
|
125
|
+
/** Honor Do Not Track browser setting */
|
|
126
|
+
honorDnt?: boolean
|
|
127
|
+
/** Defer script loading (default: true) */
|
|
128
|
+
defer?: boolean
|
|
129
|
+
/** Enable SPA mode for client-side routing */
|
|
130
|
+
spa?: boolean
|
|
131
|
+
/** Canonical URL override */
|
|
132
|
+
canonical?: string
|
|
133
|
+
/** Auto-track page views (default: true) */
|
|
134
|
+
auto?: boolean
|
|
135
|
+
}
|
|
136
|
+
googleAnalytics?: {
|
|
137
|
+
/** GA4 Measurement ID (e.g., G-XXXXXXXXXX) */
|
|
138
|
+
measurementId: string
|
|
139
|
+
/** Enable debug mode */
|
|
140
|
+
debug?: boolean
|
|
141
|
+
}
|
|
142
|
+
plausible?: {
|
|
143
|
+
/** Your domain (e.g., example.com) */
|
|
144
|
+
domain: string
|
|
145
|
+
/** Custom script URL (default: https://plausible.io/js/script.js) */
|
|
146
|
+
scriptUrl?: string
|
|
147
|
+
/** Track localhost */
|
|
148
|
+
trackLocalhost?: boolean
|
|
149
|
+
/** Enable hash-based routing */
|
|
150
|
+
hashMode?: boolean
|
|
151
|
+
}
|
|
152
|
+
selfHosted?: {
|
|
153
|
+
/** Site ID for tracking */
|
|
154
|
+
siteId: string
|
|
155
|
+
/** API endpoint URL for collecting analytics */
|
|
156
|
+
apiEndpoint: string
|
|
157
|
+
/** Honor Do Not Track browser setting */
|
|
158
|
+
honorDnt?: boolean
|
|
159
|
+
/** Track hash changes as page views */
|
|
160
|
+
trackHashChanges?: boolean
|
|
161
|
+
/** Track outbound link clicks */
|
|
162
|
+
trackOutboundLinks?: boolean
|
|
163
|
+
}
|
|
164
|
+
custom?: {
|
|
165
|
+
/** Custom script URL */
|
|
166
|
+
scriptUrl: string
|
|
167
|
+
/** Script ID attribute */
|
|
168
|
+
scriptId?: string
|
|
169
|
+
/** Additional script attributes */
|
|
170
|
+
attributes?: Record<string, string>
|
|
171
|
+
/** Inline script content (instead of external URL) */
|
|
172
|
+
inlineScript?: string
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Animation configuration
|
|
177
|
+
*/
|
|
178
|
+
export declare interface AnimationConfig {
|
|
179
|
+
enabled: boolean
|
|
180
|
+
defaultDuration: number
|
|
181
|
+
defaultEase: string
|
|
182
|
+
respectMotionPreferences: boolean
|
|
183
|
+
staggerDelay: number
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Route middleware configuration
|
|
187
|
+
*/
|
|
188
|
+
export declare interface RouteMiddlewareConfig {
|
|
189
|
+
enabled: boolean
|
|
190
|
+
dir: string
|
|
191
|
+
global?: string[]
|
|
192
|
+
defaultMode: MiddlewareMode
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Loop directive configuration
|
|
196
|
+
*/
|
|
197
|
+
export declare interface LoopConfig {
|
|
198
|
+
maxWhileIterations: number
|
|
199
|
+
useAltLoopVariable: boolean
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Syntax highlighting configuration
|
|
203
|
+
*/
|
|
204
|
+
export declare interface SyntaxHighlightingConfig {
|
|
205
|
+
enabled: boolean
|
|
206
|
+
serverSide: boolean
|
|
207
|
+
defaultTheme: SyntaxHighlightTheme
|
|
208
|
+
highlightUnknownLanguages: boolean
|
|
209
|
+
additionalThemes?: SyntaxHighlightTheme[]
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Markdown configuration
|
|
213
|
+
*/
|
|
214
|
+
export declare interface MarkdownConfig {
|
|
215
|
+
enabled: boolean
|
|
216
|
+
dir?: string
|
|
217
|
+
syntaxHighlighting?: Partial<SyntaxHighlightingConfig>
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Configuration for form directives
|
|
221
|
+
*/
|
|
222
|
+
export declare interface FormConfig {
|
|
223
|
+
classes?: {
|
|
224
|
+
/** Class for text inputs, textareas, and selects */
|
|
225
|
+
input?: string
|
|
226
|
+
/** Class added to inputs with validation errors */
|
|
227
|
+
inputError?: string
|
|
228
|
+
/** Class for checkboxes and radios */
|
|
229
|
+
checkInput?: string
|
|
230
|
+
/** Class for labels */
|
|
231
|
+
label?: string
|
|
232
|
+
/** Class for error message containers */
|
|
233
|
+
errorFeedback?: string
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* stx configuration options
|
|
238
|
+
*/
|
|
239
|
+
export declare interface StxConfig {
|
|
240
|
+
templatesDir?: string
|
|
241
|
+
defaultTitle?: string
|
|
242
|
+
defaultDescription?: string
|
|
243
|
+
defaultImage?: string
|
|
244
|
+
cache?: boolean
|
|
245
|
+
cacheDir?: string
|
|
246
|
+
cacheVersion?: string
|
|
247
|
+
enabled: boolean
|
|
248
|
+
partialsDir: string
|
|
249
|
+
componentsDir: string
|
|
250
|
+
layoutsDir?: string
|
|
251
|
+
defaultLayout?: string
|
|
252
|
+
debug: boolean
|
|
253
|
+
cachePath: string
|
|
254
|
+
customDirectives?: CustomDirective[]
|
|
255
|
+
middleware?: Middleware[]
|
|
256
|
+
i18n?: Partial<I18nConfig>
|
|
257
|
+
webComponents?: Partial<WebComponentConfig>
|
|
258
|
+
docs?: Partial<DocGeneratorConfig>
|
|
259
|
+
streaming?: Partial<StreamingConfig>
|
|
260
|
+
hydration?: Partial<HydrationConfig>
|
|
261
|
+
a11y?: Partial<A11yConfig>
|
|
262
|
+
seo?: Partial<SeoFeatureConfig>
|
|
263
|
+
analytics?: Partial<AnalyticsConfig>
|
|
264
|
+
animation?: Partial<AnimationConfig>
|
|
265
|
+
skipDefaultSeoTags?: boolean
|
|
266
|
+
skipSignalsRuntime?: boolean
|
|
267
|
+
skipEventDirectives?: boolean
|
|
268
|
+
markdown?: Partial<MarkdownConfig>
|
|
269
|
+
loops?: Partial<LoopConfig>
|
|
270
|
+
forms?: Partial<FormConfig>
|
|
271
|
+
csp?: Partial<CspConfig>
|
|
272
|
+
story?: Partial<import('../story/types').StoryConfig>
|
|
273
|
+
pwa?: Partial<PwaConfig>
|
|
274
|
+
components?: Partial<ComponentConfig>
|
|
275
|
+
routeMiddleware?: Partial<RouteMiddlewareConfig>
|
|
276
|
+
heatmap?: Partial<HeatmapConfig>
|
|
277
|
+
build?: Partial<BuildConfig>
|
|
278
|
+
media?: Partial<MediaConfig>
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* SSG Build configuration for static site generation
|
|
282
|
+
*/
|
|
283
|
+
export declare interface BuildConfig {
|
|
284
|
+
pagesDir: string
|
|
285
|
+
outputDir: string
|
|
286
|
+
baseUrl: string
|
|
287
|
+
domain?: string
|
|
288
|
+
sitemap: boolean
|
|
289
|
+
rss?: boolean | import('../ssg').RSSConfig
|
|
290
|
+
minify: boolean
|
|
291
|
+
cache: boolean
|
|
292
|
+
cacheDir: string
|
|
293
|
+
concurrency: number
|
|
294
|
+
generate404: boolean
|
|
295
|
+
publicDir: string
|
|
296
|
+
trailingSlash: boolean
|
|
297
|
+
cleanOutput: boolean
|
|
298
|
+
revalidate?: number | false
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Analytics driver type
|
|
302
|
+
*/
|
|
303
|
+
export type AnalyticsDriver = 'fathom' | 'google-analytics' | 'plausible' | 'self-hosted' | 'custom'
|
|
304
|
+
/**
|
|
305
|
+
* Available syntax highlighting themes
|
|
306
|
+
*/
|
|
307
|
+
export type SyntaxHighlightTheme = | 'css-variables'
|
|
308
|
+
| 'dark-plus'
|
|
309
|
+
| 'dracula'
|
|
310
|
+
| 'dracula-soft'
|
|
311
|
+
| 'github-dark'
|
|
312
|
+
| 'github-dark-dimmed'
|
|
313
|
+
| 'github-light'
|
|
314
|
+
| 'hc_light'
|
|
315
|
+
| 'light-plus'
|
|
316
|
+
| 'material-theme'
|
|
317
|
+
| 'material-theme-darker'
|
|
318
|
+
| 'material-theme-lighter'
|
|
319
|
+
| 'material-theme-ocean'
|
|
320
|
+
| 'material-theme-palenight'
|
|
321
|
+
| 'min-dark'
|
|
322
|
+
| 'min-light'
|
|
323
|
+
| 'monokai'
|
|
324
|
+
| 'nord'
|
|
325
|
+
| 'one-dark-pro'
|
|
326
|
+
| 'poimandres'
|
|
327
|
+
| 'rose-pine'
|
|
328
|
+
| 'rose-pine-dawn'
|
|
329
|
+
| 'rose-pine-moon'
|
|
330
|
+
| 'slack-dark'
|
|
331
|
+
| 'slack-ochin'
|
|
332
|
+
| 'solarized-dark'
|
|
333
|
+
| 'solarized-light'
|
|
334
|
+
| 'vitesse-dark'
|
|
335
|
+
| 'vitesse-light'
|
|
336
|
+
export type StxOptions = Partial<StxConfig>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { StxOptions } from './config-types';
|
|
2
|
+
/**
|
|
3
|
+
* Loop context object available within @foreach loops
|
|
4
|
+
* Provides iteration metadata for template logic
|
|
5
|
+
*/
|
|
6
|
+
export declare interface LoopContext {
|
|
7
|
+
index: number
|
|
8
|
+
iteration: number
|
|
9
|
+
first: boolean
|
|
10
|
+
last: boolean
|
|
11
|
+
count: number
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Authentication context for @auth, @guest, @can directives
|
|
15
|
+
* Required shape for auth-related template directives
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const authContext: AuthContext = {
|
|
20
|
+
* check: true,
|
|
21
|
+
* user: { id: 1, name: 'John', role: 'admin' }
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare interface AuthContext {
|
|
26
|
+
check: boolean
|
|
27
|
+
user: Record<string, unknown> | null
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Permissions context for @can, @cannot directives
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const permissions: PermissionsContext = {
|
|
35
|
+
* check: (ability, type?, id?) => {
|
|
36
|
+
* // Check if user has the ability
|
|
37
|
+
* return user.abilities.includes(ability)
|
|
38
|
+
* }
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare interface PermissionsContext {
|
|
43
|
+
check: (ability: string, type?: string, id?: unknown) => boolean
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Translation context for @translate, @t directives
|
|
47
|
+
*/
|
|
48
|
+
export declare interface TranslationContext {
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Base template context with common properties
|
|
53
|
+
* Extend this interface for specific template contexts
|
|
54
|
+
*/
|
|
55
|
+
export declare interface BaseTemplateContext {
|
|
56
|
+
auth?: AuthContext
|
|
57
|
+
permissions?: PermissionsContext
|
|
58
|
+
userCan?: Record<string, boolean>
|
|
59
|
+
__translations?: TranslationContext
|
|
60
|
+
__sections?: Record<string, string>
|
|
61
|
+
__stx_options?: StxOptions
|
|
62
|
+
loop?: LoopContext
|
|
63
|
+
$loop?: LoopContext
|
|
64
|
+
slot?: string
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Template context type alias for backward compatibility
|
|
68
|
+
* Use BaseTemplateContext for new code
|
|
69
|
+
*/
|
|
70
|
+
export type TemplateContext = BaseTemplateContext
|
|
71
|
+
/**
|
|
72
|
+
* Generic template context that allows specifying custom typed properties
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* // Define your typed context
|
|
77
|
+
* interface MyContext extends TypedContext<{
|
|
78
|
+
* user: { name: string; email: string }
|
|
79
|
+
* items: string[]
|
|
80
|
+
* count: number
|
|
81
|
+
* }> {}
|
|
82
|
+
*
|
|
83
|
+
* // Use in template processing
|
|
84
|
+
* const ctx: MyContext = {
|
|
85
|
+
* user: { name: 'John', email: 'john@example.com' },
|
|
86
|
+
* items: ['a', 'b'],
|
|
87
|
+
* count: 42
|
|
88
|
+
* }
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export type TypedContext<T extends Record<string, unknown>> = BaseTemplateContext & T
|
|
92
|
+
/**
|
|
93
|
+
* Utility type to extract the value type from a context key
|
|
94
|
+
*/
|
|
95
|
+
export type ContextValue<C extends BaseTemplateContext, K extends keyof C> = C[K]
|
|
96
|
+
/**
|
|
97
|
+
* Utility type to make certain context properties required
|
|
98
|
+
*/
|
|
99
|
+
export type RequireContextKeys<C extends BaseTemplateContext, K extends keyof C> = Required<Pick<C, K>> & Omit<C, K>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Individual CSP directive configuration
|
|
3
|
+
* Maps directive names to arrays of allowed sources
|
|
4
|
+
*/
|
|
5
|
+
export declare interface CspDirectives {
|
|
6
|
+
'default-src'?: CspSourceValue[]
|
|
7
|
+
'script-src'?: CspSourceValue[]
|
|
8
|
+
'style-src'?: CspSourceValue[]
|
|
9
|
+
'img-src'?: CspSourceValue[]
|
|
10
|
+
'font-src'?: CspSourceValue[]
|
|
11
|
+
'connect-src'?: CspSourceValue[]
|
|
12
|
+
'media-src'?: CspSourceValue[]
|
|
13
|
+
'object-src'?: CspSourceValue[]
|
|
14
|
+
'frame-src'?: CspSourceValue[]
|
|
15
|
+
'worker-src'?: CspSourceValue[]
|
|
16
|
+
'child-src'?: CspSourceValue[]
|
|
17
|
+
'manifest-src'?: CspSourceValue[]
|
|
18
|
+
'form-action'?: CspSourceValue[]
|
|
19
|
+
'frame-ancestors'?: CspSourceValue[]
|
|
20
|
+
'prefetch-src'?: CspSourceValue[]
|
|
21
|
+
'navigate-to'?: CspSourceValue[]
|
|
22
|
+
'base-uri'?: CspSourceValue[]
|
|
23
|
+
'report-uri'?: string[]
|
|
24
|
+
'report-to'?: string[]
|
|
25
|
+
'upgrade-insecure-requests'?: boolean
|
|
26
|
+
'block-all-mixed-content'?: boolean
|
|
27
|
+
'sandbox'?: (
|
|
28
|
+
| 'allow-forms'
|
|
29
|
+
| 'allow-modals'
|
|
30
|
+
| 'allow-orientation-lock'
|
|
31
|
+
| 'allow-pointer-lock'
|
|
32
|
+
| 'allow-popups'
|
|
33
|
+
| 'allow-popups-to-escape-sandbox'
|
|
34
|
+
| 'allow-presentation'
|
|
35
|
+
| 'allow-same-origin'
|
|
36
|
+
| 'allow-scripts'
|
|
37
|
+
| 'allow-top-navigation'
|
|
38
|
+
| 'allow-top-navigation-by-user-activation'
|
|
39
|
+
)[]
|
|
40
|
+
'require-trusted-types-for'?: ('script')[]
|
|
41
|
+
'trusted-types'?: string[]
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* CSP configuration options
|
|
45
|
+
*/
|
|
46
|
+
export declare interface CspConfig {
|
|
47
|
+
enabled: boolean
|
|
48
|
+
reportOnly?: boolean
|
|
49
|
+
directives: CspDirectives
|
|
50
|
+
useNonce?: boolean
|
|
51
|
+
addMetaTag?: boolean
|
|
52
|
+
nonceGenerator?: () => string
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Content Security Policy Types
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* CSP directive source values
|
|
59
|
+
* These are the standard source values that can be used in CSP directives
|
|
60
|
+
*/
|
|
61
|
+
export type CspSourceValue = | '\'self\''
|
|
62
|
+
| '\'unsafe-inline\''
|
|
63
|
+
| '\'unsafe-eval\''
|
|
64
|
+
| '\'unsafe-hashes\''
|
|
65
|
+
| '\'strict-dynamic\''
|
|
66
|
+
| '\'report-sample\''
|
|
67
|
+
| '\'wasm-unsafe-eval\''
|
|
68
|
+
| '\'none\''
|
|
69
|
+
| 'data:'
|
|
70
|
+
| 'blob:'
|
|
71
|
+
| 'https:'
|
|
72
|
+
| 'http:'
|
|
73
|
+
| 'ws:'
|
|
74
|
+
| 'wss:'
|
|
75
|
+
| string
|
|
76
|
+
/**
|
|
77
|
+
* Preset CSP configurations for common use cases
|
|
78
|
+
*/
|
|
79
|
+
export type CspPreset = 'strict' | 'moderate' | 'relaxed' | 'api'
|