@stacksjs/stx 0.2.154 → 0.2.156
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/a11y.d.ts +87 -46
- package/dist/animation.d.ts +96 -42
- package/dist/appearance-bootstrap.d.ts +49 -15
- package/dist/asset-roots.d.ts +32 -0
- package/dist/asset-roots.js +7 -0
- package/dist/assets.d.ts +9 -7
- package/dist/async-components.d.ts +78 -56
- package/dist/auth.d.ts +3 -0
- package/dist/build-externalize.d.ts +40 -0
- package/dist/build-externalize.js +63 -0
- package/dist/build-id.d.ts +22 -22
- package/dist/build-message.d.ts +73 -2
- package/dist/build-message.js +47 -8
- package/dist/builtins/attrs.d.ts +14 -0
- package/dist/builtins/drawer.d.ts +22 -0
- package/dist/builtins/icon.d.ts +16 -2
- package/dist/builtins/index.d.ts +5 -15
- package/dist/builtins/modal.d.ts +24 -0
- package/dist/builtins/safe-image.d.ts +42 -0
- package/dist/builtins/stx-image.d.ts +27 -0
- package/dist/builtins/stx-link.d.ts +9 -0
- package/dist/builtins/stx-loading-indicator.d.ts +11 -0
- package/dist/builtins/suspense.d.ts +28 -0
- package/dist/builtins/toast.d.ts +17 -0
- package/dist/builtins/transition-group.d.ts +25 -0
- package/dist/caching.d.ts +12 -15
- package/dist/cli.js +1798 -908
- package/dist/client/directive.d.ts +7 -0
- package/dist/client/index.d.ts +0 -1
- package/dist/client-script-bundler.d.ts +63 -5
- package/dist/client-script-bundler.js +30 -2
- package/dist/client-script.d.ts +102 -47
- package/dist/client-script.js +15 -3
- package/dist/codemod.d.ts +56 -0
- package/dist/codemod.js +192 -0
- package/dist/color-mode-boot.d.ts +83 -65
- package/dist/component-client-factories.d.ts +1 -6
- package/dist/component-processing.d.ts +58 -49
- package/dist/component-processing.js +1 -1
- package/dist/component-registry.d.ts +94 -31
- package/dist/component-renderer.d.ts +18 -0
- package/dist/composable-loader.d.ts +24 -0
- package/dist/composable-loader.js +12 -9
- package/dist/composables/index.d.ts +7 -0
- package/dist/composables/index.js +1 -0
- package/dist/composables/use-fetch.js +30 -2
- package/dist/composables/use-form.d.ts +91 -0
- package/dist/composables/use-form.js +112 -0
- package/dist/composables.d.ts +64 -60
- package/dist/computed.d.ts +86 -92
- package/dist/conditionals.d.ts +24 -8
- package/dist/conditionals.js +16 -0
- package/dist/config.d.ts +34 -21
- package/dist/config.js +35 -14
- package/dist/craft.js +1476 -768
- package/dist/crosswind-config.d.ts +58 -0
- package/dist/crosswind-config.js +40 -0
- package/dist/csp.d.ts +107 -41
- package/dist/defer.d.ts +24 -0
- package/dist/dev-server/crosswind.d.ts +35 -26
- package/dist/dev-server/crosswind.js +2 -18
- package/dist/dev-server/serve-app.js +4 -3
- package/dist/dev-server/terminal-colors.d.ts +32 -32
- package/dist/directive-api.d.ts +86 -43
- package/dist/document-shell.d.ts +54 -41
- package/dist/dynamic-components.d.ts +9 -0
- package/dist/error-boundaries.d.ts +47 -41
- package/dist/error-handling.d.ts +1 -1
- package/dist/errors/codes.d.ts +51 -43
- package/dist/errors/formatter.d.ts +58 -38
- package/dist/errors/index.d.ts +5 -61
- package/dist/errors/logger.d.ts +114 -40
- package/dist/errors/sanitizer.d.ts +53 -23
- package/dist/errors/types.d.ts +44 -31
- package/dist/events.d.ts +86 -25
- package/dist/expressions.d.ts +50 -42
- package/dist/forms-validation.d.ts +138 -123
- package/dist/forms-validation.js +1 -90
- package/dist/forms.d.ts +120 -66
- package/dist/forms.js +31 -11
- package/dist/fragment-container.d.ts +57 -0
- package/dist/fragment-container.js +109 -0
- package/dist/framework-composables.d.ts +32 -0
- package/dist/head.d.ts +156 -114
- package/dist/heatmap.d.ts +152 -72
- package/dist/html-masking.d.ts +40 -34
- package/dist/hydration-runtime.d.ts +20 -24
- package/dist/i18n.d.ts +93 -32
- package/dist/image-optimization/auto-sibling.d.ts +32 -4
- package/dist/includes.d.ts +69 -7
- package/dist/index.d.ts +66 -0
- package/dist/index.js +23 -0
- package/dist/internal-markdown.d.ts +12 -8
- package/dist/island-chunking.d.ts +30 -13
- package/dist/keep-alive.d.ts +72 -52
- package/dist/layout-types.d.ts +45 -0
- package/dist/layout-types.js +56 -0
- package/dist/lazy-module.d.ts +10 -0
- package/dist/loops.d.ts +66 -0
- package/dist/loops.js +47 -6
- package/dist/markdown.d.ts +0 -1
- package/dist/media/image/component.d.ts +25 -9
- package/dist/media/image/directive.d.ts +15 -1
- package/dist/media/image/placeholder.d.ts +20 -9
- package/dist/media/image/processor/cache.d.ts +40 -18
- package/dist/media/image/processor/index.d.ts +1 -10
- package/dist/media/image/processor/optimizer.d.ts +12 -1
- package/dist/media/image/processor/responsive.d.ts +16 -6
- package/dist/media/image/srcset.d.ts +47 -50
- package/dist/media/shared/cache.d.ts +51 -31
- package/dist/media/shared/hash.d.ts +7 -0
- package/dist/media/types.d.ts +1235 -754
- package/dist/media/video/directive.d.ts +15 -1
- package/dist/media/video/index.d.ts +39 -17
- package/dist/media/video/processor/cache.d.ts +42 -19
- package/dist/media/video/processor/index.d.ts +1 -18
- package/dist/media/video/processor/streaming.d.ts +17 -10
- package/dist/media/video/processor/thumbnail.d.ts +21 -15
- package/dist/media/video/processor/transcoder.d.ts +11 -1
- package/dist/method-spoofing.d.ts +7 -0
- package/dist/middleware.d.ts +60 -0
- package/dist/owned-routes.d.ts +42 -0
- package/dist/owned-routes.js +26 -0
- package/dist/page-meta.d.ts +38 -0
- package/dist/page-meta.js +16 -0
- package/dist/parser/directive-parser.d.ts +57 -45
- package/dist/parser/expression-parser.d.ts +33 -35
- package/dist/parser/index.d.ts +4 -39
- package/dist/parser/tokenizer.d.ts +61 -49
- package/dist/partial-hydration.d.ts +82 -50
- package/dist/performance-utils.d.ts +217 -124
- package/dist/placeholder.d.ts +18 -9
- package/dist/plugin-system.d.ts +264 -115
- package/dist/process.d.ts +11 -6
- package/dist/process.js +21 -4
- package/dist/production-builder.js +7 -0
- package/dist/prop-sentinels.d.ts +11 -11
- package/dist/public-env.d.ts +14 -0
- package/dist/pwa/directives.d.ts +12 -3
- package/dist/pwa/inject.d.ts +10 -0
- package/dist/pwa/precache.d.ts +22 -16
- package/dist/pwa/service-worker.d.ts +12 -0
- package/dist/pwa.js +1318 -610
- package/dist/reactive-bindings.d.ts +34 -11
- package/dist/reactive.d.ts +58 -30
- package/dist/reactive.js +56 -31
- package/dist/render.js +1 -0
- package/dist/route-middleware.d.ts +2 -35
- package/dist/route-types.d.ts +134 -0
- package/dist/route-types.js +24 -0
- package/dist/router.d.ts +5 -7
- package/dist/routes.d.ts +1 -3
- package/dist/runtime-globals.d.ts +147 -24
- package/dist/runtime-globals.js +16 -1
- package/dist/runtime-injection.d.ts +8 -0
- package/dist/runtime-injection.js +33 -24
- package/dist/script-emit.d.ts +30 -0
- package/dist/script-json.d.ts +36 -0
- package/dist/script-json.js +6 -0
- package/dist/script-validation.d.ts +21 -4
- package/dist/seo.d.ts +118 -47
- package/dist/server-bindings.d.ts +21 -0
- package/dist/sfc-template.d.ts +8 -8
- package/dist/signal-processing.d.ts +35 -15
- package/dist/signals-api.d.ts +117 -58
- package/dist/signals-api.js +7 -4
- package/dist/signals.d.ts +24 -17
- package/dist/signals.js +765 -60
- package/dist/site-builder/build.js +8 -0
- package/dist/site-url.d.ts +46 -0
- package/dist/site-url.js +70 -0
- package/dist/slots.d.ts +86 -20
- package/dist/source-signature.d.ts +45 -0
- package/dist/source-signature.js +20 -0
- package/dist/ssg.d.ts +285 -142
- package/dist/ssg.js +1268 -556
- package/dist/state-dir.d.ts +4 -4
- package/dist/state-management.d.ts +0 -12
- package/dist/state-management.js +8 -25
- package/dist/store-imports.d.ts +23 -0
- package/dist/store-imports.js +3 -0
- package/dist/store-loader.d.ts +10 -0
- package/dist/store-loader.js +10 -9
- package/dist/story/analytics.d.ts +138 -60
- package/dist/story/bookmarks.d.ts +87 -34
- package/dist/story/cli.d.ts +123 -69
- package/dist/story/collect/scanner.d.ts +4 -0
- package/dist/story/collect/tree.d.ts +8 -1
- package/dist/story/commands/build.d.ts +11 -6
- package/dist/story/commands/dev.d.ts +15 -8
- package/dist/story/commands/preview.d.ts +13 -7
- package/dist/story/config-watcher.d.ts +20 -13
- package/dist/story/config.d.ts +11 -8
- package/dist/story/context.d.ts +14 -8
- package/dist/story/hmr.d.ts +24 -26
- package/dist/story/hot-swap.d.ts +34 -23
- package/dist/story/keyboard-shortcuts.d.ts +23 -18
- package/dist/story/output.d.ts +46 -44
- package/dist/story/performance.d.ts +107 -45
- package/dist/story/presets.d.ts +107 -41
- package/dist/story/renderer.d.ts +41 -27
- package/dist/story/search.d.ts +23 -12
- package/dist/story/server.d.ts +21 -11
- package/dist/story/setup.d.ts +23 -15
- package/dist/story/testing.d.ts +65 -40
- package/dist/story/types.d.ts +262 -160
- package/dist/streaming.d.ts +119 -57
- package/dist/stx-virtual-ts.d.ts +165 -0
- package/dist/stx-virtual-ts.js +372 -0
- package/dist/stx.d.ts +78 -1
- package/dist/style-scoping.d.ts +17 -4
- package/dist/suspense.d.ts +67 -52
- package/dist/teleport.d.ts +22 -0
- package/dist/template-tag-balance.d.ts +22 -6
- package/dist/transitions.d.ts +66 -55
- package/dist/typecheck.d.ts +77 -0
- package/dist/typecheck.js +156 -0
- package/dist/types/component-types.d.ts +187 -122
- package/dist/types/config-types.d.ts +758 -297
- package/dist/types/context-types.d.ts +46 -24
- package/dist/types/csp-types.d.ts +70 -66
- package/dist/types/directive-types.d.ts +211 -155
- package/dist/types/index.d.ts +6 -109
- package/dist/types/pwa-types.d.ts +273 -148
- package/dist/types.d.ts +0 -1
- package/dist/typescript-templates.d.ts +11 -0
- package/dist/unresolved-identifiers.d.ts +24 -22
- package/dist/unresolved-identifiers.js +2 -0
- package/dist/utils.d.ts +24 -21
- package/dist/validator.d.ts +28 -26
- package/dist/variable-extractor.d.ts +48 -13
- package/dist/variable-extractor.js +27 -4
- package/dist/view-composers.d.ts +80 -81
- package/dist/virtual-scrolling.d.ts +101 -81
- package/dist/vue-template.d.ts +23 -0
- package/dist/web-components/css-scoping.d.ts +21 -11
- package/dist/web-components.d.ts +81 -58
- package/dist/x-element.d.ts +0 -1
- package/package.json +5 -5
- package/stx.d.ts +78 -1
|
@@ -1,14 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context Types - Typed interfaces for template context objects
|
|
3
|
+
*/
|
|
1
4
|
import type { StxOptions } from './config-types';
|
|
2
5
|
/**
|
|
3
6
|
* Loop context object available within @foreach loops
|
|
4
7
|
* Provides iteration metadata for template logic
|
|
5
8
|
*/
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export interface LoopContext {
|
|
10
|
+
/** Current zero-based index */
|
|
11
|
+
index: number;
|
|
12
|
+
/** Current one-based iteration count */
|
|
13
|
+
iteration: number;
|
|
14
|
+
/** Whether this is the first iteration */
|
|
15
|
+
first: boolean;
|
|
16
|
+
/** Whether this is the last iteration */
|
|
17
|
+
last: boolean;
|
|
18
|
+
/** Total number of items in the array */
|
|
19
|
+
count: number;
|
|
12
20
|
}
|
|
13
21
|
/**
|
|
14
22
|
* Authentication context for @auth, @guest, @can directives
|
|
@@ -22,9 +30,11 @@ export declare interface LoopContext {
|
|
|
22
30
|
* }
|
|
23
31
|
* ```
|
|
24
32
|
*/
|
|
25
|
-
export
|
|
26
|
-
|
|
27
|
-
|
|
33
|
+
export interface AuthContext {
|
|
34
|
+
/** Whether the user is authenticated */
|
|
35
|
+
check: boolean;
|
|
36
|
+
/** User object (null if not authenticated) */
|
|
37
|
+
user: Record<string, unknown> | null;
|
|
28
38
|
}
|
|
29
39
|
/**
|
|
30
40
|
* Permissions context for @can, @cannot directives
|
|
@@ -39,30 +49,42 @@ export declare interface AuthContext {
|
|
|
39
49
|
* }
|
|
40
50
|
* ```
|
|
41
51
|
*/
|
|
42
|
-
export
|
|
43
|
-
|
|
52
|
+
export interface PermissionsContext {
|
|
53
|
+
/** Function to check if user has a specific permission */
|
|
54
|
+
check: (ability: string, type?: string, id?: unknown) => boolean;
|
|
44
55
|
}
|
|
45
56
|
/**
|
|
46
57
|
* Translation context for @translate, @t directives
|
|
47
58
|
*/
|
|
48
|
-
export
|
|
49
|
-
|
|
59
|
+
export interface TranslationContext {
|
|
60
|
+
/** Translation lookup object keyed by locale */
|
|
61
|
+
[locale: string]: Record<string, string>;
|
|
50
62
|
}
|
|
51
63
|
/**
|
|
52
64
|
* Base template context with common properties
|
|
53
65
|
* Extend this interface for specific template contexts
|
|
54
66
|
*/
|
|
55
|
-
export
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
export interface BaseTemplateContext {
|
|
68
|
+
/** Authentication context (optional) */
|
|
69
|
+
auth?: AuthContext;
|
|
70
|
+
/** Permissions context (optional) */
|
|
71
|
+
permissions?: PermissionsContext;
|
|
72
|
+
/** User permissions map for simple boolean checks */
|
|
73
|
+
userCan?: Record<string, boolean>;
|
|
74
|
+
/** Translations for i18n */
|
|
75
|
+
__translations?: TranslationContext;
|
|
76
|
+
/** Internal sections storage (set by layout processing) */
|
|
77
|
+
__sections?: Record<string, string>;
|
|
78
|
+
/** Internal stx options reference */
|
|
79
|
+
__stx_options?: StxOptions;
|
|
80
|
+
/** Loop context (available within @foreach) */
|
|
81
|
+
loop?: LoopContext;
|
|
82
|
+
/** Alias for loop context to avoid conflicts with user variables */
|
|
83
|
+
$loop?: LoopContext;
|
|
84
|
+
/** Slot content for components */
|
|
85
|
+
slot?: string;
|
|
86
|
+
/** Allow additional properties */
|
|
87
|
+
[key: string]: unknown;
|
|
66
88
|
}
|
|
67
89
|
/**
|
|
68
90
|
* Template context type alias for backward compatibility
|
|
@@ -1,78 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content Security Policy Types
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* CSP directive source values
|
|
6
|
+
* These are the standard source values that can be used in CSP directives
|
|
7
|
+
*/
|
|
8
|
+
export type CspSourceValue = '\'self\'' | '\'unsafe-inline\'' | '\'unsafe-eval\'' | '\'unsafe-hashes\'' | '\'strict-dynamic\'' | '\'report-sample\'' | '\'wasm-unsafe-eval\'' | '\'none\'' | 'data:' | 'blob:' | 'https:' | 'http:' | 'ws:' | 'wss:' | string;
|
|
1
9
|
/**
|
|
2
10
|
* Individual CSP directive configuration
|
|
3
11
|
* Maps directive names to arrays of allowed sources
|
|
4
12
|
*/
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
13
|
+
export interface CspDirectives {
|
|
14
|
+
/** Default policy for all resource types */
|
|
15
|
+
'default-src'?: CspSourceValue[];
|
|
16
|
+
/** Valid sources for JavaScript */
|
|
17
|
+
'script-src'?: CspSourceValue[];
|
|
18
|
+
/** Valid sources for stylesheets */
|
|
19
|
+
'style-src'?: CspSourceValue[];
|
|
20
|
+
/** Valid sources for images */
|
|
21
|
+
'img-src'?: CspSourceValue[];
|
|
22
|
+
/** Valid sources for fonts */
|
|
23
|
+
'font-src'?: CspSourceValue[];
|
|
24
|
+
/** Valid sources for XHR, fetch, WebSockets */
|
|
25
|
+
'connect-src'?: CspSourceValue[];
|
|
26
|
+
/** Valid sources for media elements (audio, video) */
|
|
27
|
+
'media-src'?: CspSourceValue[];
|
|
28
|
+
/** Valid sources for object, embed, applet */
|
|
29
|
+
'object-src'?: CspSourceValue[];
|
|
30
|
+
/** Valid sources for iframes */
|
|
31
|
+
'frame-src'?: CspSourceValue[];
|
|
32
|
+
/** Valid sources for workers */
|
|
33
|
+
'worker-src'?: CspSourceValue[];
|
|
34
|
+
/** Valid sources for child contexts */
|
|
35
|
+
'child-src'?: CspSourceValue[];
|
|
36
|
+
/** Valid sources for manifests */
|
|
37
|
+
'manifest-src'?: CspSourceValue[];
|
|
38
|
+
/** Restricts URLs for form submissions */
|
|
39
|
+
'form-action'?: CspSourceValue[];
|
|
40
|
+
/** Restricts URLs which can embed this page */
|
|
41
|
+
'frame-ancestors'?: CspSourceValue[];
|
|
42
|
+
/** Restricts URLs for link prefetch/prerender */
|
|
43
|
+
'prefetch-src'?: CspSourceValue[];
|
|
44
|
+
/** Restricts URLs for navigate-to */
|
|
45
|
+
'navigate-to'?: CspSourceValue[];
|
|
46
|
+
/** Base URI for relative URLs */
|
|
47
|
+
'base-uri'?: CspSourceValue[];
|
|
48
|
+
/** URL to report CSP violations to */
|
|
49
|
+
'report-uri'?: string[];
|
|
50
|
+
/** Reporting endpoint name for CSP violations */
|
|
51
|
+
'report-to'?: string[];
|
|
52
|
+
/** Enable upgrade-insecure-requests */
|
|
53
|
+
'upgrade-insecure-requests'?: boolean;
|
|
54
|
+
/** Enable block-all-mixed-content */
|
|
55
|
+
'block-all-mixed-content'?: boolean;
|
|
56
|
+
/** Sandbox restrictions */
|
|
57
|
+
'sandbox'?: ('allow-forms' | 'allow-modals' | 'allow-orientation-lock' | 'allow-pointer-lock' | 'allow-popups' | 'allow-popups-to-escape-sandbox' | 'allow-presentation' | 'allow-same-origin' | 'allow-scripts' | 'allow-top-navigation' | 'allow-top-navigation-by-user-activation')[];
|
|
58
|
+
/** Require trusted types */
|
|
59
|
+
'require-trusted-types-for'?: ('script')[];
|
|
60
|
+
/** Trusted types policies */
|
|
61
|
+
'trusted-types'?: string[];
|
|
42
62
|
}
|
|
43
63
|
/**
|
|
44
64
|
* CSP configuration options
|
|
45
65
|
*/
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
66
|
+
export interface CspConfig {
|
|
67
|
+
/** Enable CSP generation */
|
|
68
|
+
enabled: boolean;
|
|
69
|
+
/** Use report-only mode (Content-Security-Policy-Report-Only header) */
|
|
70
|
+
reportOnly?: boolean;
|
|
71
|
+
/** CSP directives */
|
|
72
|
+
directives: CspDirectives;
|
|
73
|
+
/** Generate nonce for inline scripts/styles */
|
|
74
|
+
useNonce?: boolean;
|
|
75
|
+
/** Add CSP as meta tag in HTML head */
|
|
76
|
+
addMetaTag?: boolean;
|
|
77
|
+
/** Custom nonce generator function */
|
|
78
|
+
nonceGenerator?: () => string;
|
|
53
79
|
}
|
|
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 // Allow custom URLs and nonces like 'nonce-xxx' or 'sha256-xxx';
|
|
76
80
|
/**
|
|
77
81
|
* Preset CSP configurations for common use cases
|
|
78
82
|
*/
|