@stacksjs/stx 0.2.571 → 0.2.573
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 +51 -111
- package/dist/animation.d.ts +131 -74
- package/dist/api-client.d.ts +11 -21
- package/dist/api-handler.d.ts +4 -4
- package/dist/appearance-bootstrap.d.ts +16 -77
- package/dist/application-layers.d.ts +11 -20
- package/dist/asset-roots.d.ts +7 -27
- package/dist/assets.d.ts +7 -9
- package/dist/async-components.d.ts +56 -78
- package/dist/auth.d.ts +0 -3
- package/dist/browser-core-imports.d.ts +2 -2
- package/dist/build-externalize-repeated.d.ts +0 -25
- package/dist/build-externalize.d.ts +18 -53
- package/dist/build-id.d.ts +40 -28
- package/dist/build-message.d.ts +20 -44
- package/dist/builtins/attrs.d.ts +0 -14
- package/dist/builtins/drawer.d.ts +3 -22
- package/dist/builtins/icon.d.ts +17 -19
- package/dist/builtins/image-alpha.d.ts +8 -8
- package/dist/builtins/image-delivery.d.ts +38 -40
- package/dist/builtins/image-placeholder.d.ts +12 -50
- package/dist/builtins/image-warmup-worker.d.ts +1 -1
- package/dist/builtins/image-worker.d.ts +6 -32
- package/dist/builtins/index.d.ts +16 -6
- package/dist/builtins/modal.d.ts +13 -23
- package/dist/builtins/safe-image.d.ts +2 -42
- package/dist/builtins/stx-image.d.ts +44 -24
- package/dist/builtins/stx-link.d.ts +5 -8
- package/dist/builtins/stx-loading-indicator.d.ts +11 -10
- package/dist/builtins/suspense.d.ts +6 -27
- package/dist/builtins/toast.d.ts +15 -16
- package/dist/builtins/transition-group.d.ts +1 -25
- package/dist/caching.d.ts +24 -21
- package/dist/{chunk-f4jh9vrj.js → chunk-0s647d0b.js} +53 -53
- package/dist/{chunk-09gtbb1w.js → chunk-1bsafdnt.js} +1 -1
- package/dist/{chunk-m6mxqepz.js → chunk-1btr5tme.js} +1 -1
- package/dist/{chunk-01mxer9s.js → chunk-2g6wcnna.js} +1 -1
- package/dist/{chunk-rrj5m9xv.js → chunk-2hg2bqtj.js} +1 -1
- package/dist/{chunk-xckzvbvn.js → chunk-4f0fh2a9.js} +1 -1
- package/dist/chunk-557wtdps.js +2 -0
- package/dist/{chunk-vr36s2en.js → chunk-58vrf6kh.js} +1 -1
- package/dist/{chunk-qzbzn1yf.js → chunk-6tsnz28m.js} +1 -1
- package/dist/{chunk-cvswrbzw.js → chunk-6x8cwscv.js} +1 -1
- package/dist/{chunk-1n64749x.js → chunk-74ew8ajw.js} +1 -1
- package/dist/{chunk-jqefcghh.js → chunk-78d6yyxz.js} +2 -2
- package/dist/{chunk-83fdt4yj.js → chunk-824cnbac.js} +1 -1
- package/dist/{chunk-ntgy4e1q.js → chunk-864xm0jy.js} +1 -1
- package/dist/{chunk-nn174xjh.js → chunk-9fbkdrm8.js} +1 -1
- package/dist/{chunk-kzjrgh0b.js → chunk-a3gvw1q2.js} +1 -1
- package/dist/{chunk-pqcvh9pp.js → chunk-amtrg7pn.js} +1 -1
- package/dist/{chunk-pw9verqx.js → chunk-b5fpsp5n.js} +1 -1
- package/dist/{chunk-5afw7z6v.js → chunk-bcjr3fw7.js} +1 -1
- package/dist/{chunk-n6qp05t9.js → chunk-bkj0j5se.js} +1 -1
- package/dist/{chunk-mzqyv7s5.js → chunk-cf97xdqa.js} +1 -1
- package/dist/{chunk-cgwyd9aq.js → chunk-cr67dpx4.js} +1 -1
- package/dist/{chunk-f1apaqfk.js → chunk-dpqvacd1.js} +1 -1
- package/dist/{chunk-ghy82tsc.js → chunk-et8726at.js} +1 -1
- package/dist/{chunk-4bgfpkwx.js → chunk-ev8t5cxk.js} +1 -1
- package/dist/{chunk-4ssg5xpq.js → chunk-fynh3bkq.js} +12 -2
- package/dist/{chunk-gzgc8zk5.js → chunk-g8757f97.js} +2 -2
- package/dist/{chunk-3gft8zng.js → chunk-hm4j4d8q.js} +1 -1
- package/dist/{chunk-0bt0fbs1.js → chunk-j9qy9t3t.js} +5 -5
- package/dist/{chunk-2a1q5y6r.js → chunk-jhc47xzj.js} +1 -1
- package/dist/{chunk-79vdkvhf.js → chunk-kns5m52j.js} +1 -1
- package/dist/{chunk-2cqbyb8w.js → chunk-mjpewk4r.js} +1 -1
- package/dist/{chunk-2jjff8kv.js → chunk-nj488tj2.js} +2 -2
- package/dist/{chunk-dcpf6kas.js → chunk-q9chv68c.js} +1 -1
- package/dist/{chunk-xq2ck69k.js → chunk-qm280dp3.js} +1 -1
- package/dist/{chunk-ymawe0y5.js → chunk-sjcstv33.js} +1 -1
- package/dist/{chunk-tc5r2vmw.js → chunk-t0zdz8kd.js} +1 -1
- package/dist/{chunk-jwvzvapp.js → chunk-t3dnak1j.js} +1 -1
- package/dist/{chunk-2jsnrfc8.js → chunk-t64nnmmj.js} +1 -1
- package/dist/{chunk-m2a1fxpb.js → chunk-tvb8p7c0.js} +1 -1
- package/dist/{chunk-6f4qrd0s.js → chunk-tyhgq6rw.js} +1 -1
- package/dist/{chunk-4wfr074d.js → chunk-vn7tc8hm.js} +1 -1
- package/dist/{chunk-y4ajd836.js → chunk-xy6g8zb9.js} +1 -1
- package/dist/{chunk-zddzjd60.js → chunk-ya7xks9t.js} +1 -1
- package/dist/chunk-zpz6q2fh.js +2 -0
- package/dist/chunk-zxt94g45.js +2 -0
- package/dist/{chunk-cyg9w31a.js → chunk-zz7tw07b.js} +1 -1
- package/dist/{chunk-ta8bhz27.js → chunk-zzcxacjf.js} +1 -1
- package/dist/cli.js +7 -7
- package/dist/client/directive.d.ts +0 -7
- package/dist/client/index.d.ts +1 -0
- package/dist/client/signals-appearance-runtime.d.ts +1 -1
- package/dist/client/signals-binding-utils-runtime.d.ts +1 -1
- package/dist/client/signals-bootstrap-runtime.d.ts +2 -2
- package/dist/client/signals-class-runtime.d.ts +1 -1
- package/dist/client/signals-component-api-runtime.d.ts +1 -1
- package/dist/client/signals-component-hydration-runtime.d.ts +1 -1
- package/dist/client/signals-component-props-runtime.d.ts +1 -1
- package/dist/client/signals-conditional-chain-runtime.d.ts +1 -1
- package/dist/client/signals-conditional-component-runtime.d.ts +1 -1
- package/dist/client/signals-container-cleanup-runtime.d.ts +1 -1
- package/dist/client/signals-context-runtime.d.ts +1 -1
- package/dist/client/signals-cookie-runtime.d.ts +1 -1
- package/dist/client/signals-devtools-runtime.d.ts +1 -1
- package/dist/client/signals-dialog-runtime.d.ts +1 -1
- package/dist/client/signals-dom-ready-runtime.d.ts +1 -1
- package/dist/client/signals-drawer-runtime.d.ts +1 -1
- package/dist/client/signals-effect-runtime.d.ts +1 -1
- package/dist/client/signals-event-shorthand-runtime.d.ts +1 -1
- package/dist/client/signals-expression-compiler-runtime.d.ts +1 -1
- package/dist/client/signals-expression-runtime.d.ts +1 -1
- package/dist/client/signals-fetch-transport-runtime.d.ts +1 -1
- package/dist/client/signals-for-runtime.d.ts +1 -1
- package/dist/client/signals-globals-runtime.d.ts +1 -1
- package/dist/client/signals-handler-runtime.d.ts +1 -1
- package/dist/client/signals-head-runtime.d.ts +1 -1
- package/dist/client/signals-helpers-runtime.d.ts +1 -1
- package/dist/client/signals-host-runtime.d.ts +1 -1
- package/dist/client/signals-hydration-audit-runtime.d.ts +1 -1
- package/dist/client/signals-hydration-runtime.d.ts +1 -1
- package/dist/client/signals-if-chain-runtime.d.ts +1 -1
- package/dist/client/signals-if-runtime.d.ts +1 -1
- package/dist/client/signals-lazy-hydration-runtime.d.ts +1 -1
- package/dist/client/signals-lifecycle-runtime.d.ts +1 -1
- package/dist/client/signals-loop-component-remap-runtime.d.ts +1 -1
- package/dist/client/signals-loop-conditional-runtime.d.ts +1 -1
- package/dist/client/signals-loop-row-runtime.d.ts +1 -1
- package/dist/client/signals-manifest-hydration-runtime.d.ts +1 -1
- package/dist/client/signals-model-runtime.d.ts +1 -1
- package/dist/client/signals-mount-runtime.d.ts +1 -1
- package/dist/client/signals-navigation-runtime.d.ts +1 -1
- package/dist/client/signals-notify-runtime.d.ts +1 -1
- package/dist/client/signals-optimistic-runtime.d.ts +1 -1
- package/dist/client/signals-overlay-runtime.d.ts +1 -1
- package/dist/client/signals-pipe-runtime.d.ts +1 -1
- package/dist/client/signals-proxy-runtime.d.ts +1 -1
- package/dist/client/signals-query-runtime.d.ts +1 -1
- package/dist/client/signals-reactive-runtime.d.ts +1 -1
- package/dist/client/signals-ref-runtime.d.ts +1 -1
- package/dist/client/signals-scope-disposal-runtime.d.ts +1 -1
- package/dist/client/signals-scope-traversal-runtime.d.ts +1 -1
- package/dist/client/signals-show-runtime.d.ts +1 -1
- package/dist/client/signals-spa-load-control-runtime.d.ts +1 -1
- package/dist/client/signals-spa-load-runtime.d.ts +1 -1
- package/dist/client/signals-state-runtime.d.ts +1 -1
- package/dist/client/signals-storage-runtime.d.ts +1 -1
- package/dist/client/signals-store-registry-runtime.d.ts +1 -1
- package/dist/client/signals-style-runtime.d.ts +1 -1
- package/dist/client/signals-suspense-runtime.d.ts +1 -1
- package/dist/client/signals-timer-runtime.d.ts +1 -1
- package/dist/client/signals-toast-runtime.d.ts +1 -1
- package/dist/client/signals-tooltip-runtime.d.ts +1 -1
- package/dist/client/signals-transition-group-runtime.d.ts +1 -1
- package/dist/client/signals-websocket-runtime.d.ts +1 -1
- package/dist/client-helpers.d.ts +1 -312
- package/dist/client-module-registry.d.ts +4 -27
- package/dist/client-parameter-bindings.d.ts +1 -4
- package/dist/client-script-bundler.d.ts +55 -103
- package/dist/client-script.d.ts +69 -127
- package/dist/color-mode-boot.d.ts +21 -58
- package/dist/component-client-factories.d.ts +8 -9
- package/dist/component-contract-checks.d.ts +15 -18
- package/dist/component-contract.d.ts +6 -6
- package/dist/component-hmr.d.ts +8 -7
- package/dist/component-model.d.ts +14 -20
- package/dist/component-processing.d.ts +51 -59
- package/dist/component-registry.d.ts +28 -99
- package/dist/component-renderer.d.ts +19 -16
- package/dist/component-resolution.d.ts +8 -8
- package/dist/component-tags.d.ts +1 -1
- package/dist/composable-loader.d.ts +6 -41
- package/dist/composables/use-fetch.d.ts +45 -114
- package/dist/composables/use-form.d.ts +2 -56
- package/dist/composables/use-intersection-observer.d.ts +1 -1
- package/dist/composables.d.ts +75 -74
- package/dist/composition-api.d.ts +19 -43
- package/dist/computed.d.ts +93 -86
- package/dist/conditionals.d.ts +0 -24
- package/dist/config.d.ts +30 -24
- package/dist/config.js +3 -0
- package/dist/craft-bridge.d.ts +1 -467
- package/dist/craft-components.d.ts +234 -680
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/csp.d.ts +41 -107
- package/dist/database.d.ts +1 -1
- package/dist/defer.d.ts +0 -24
- package/dist/dev-server/terminal-colors.d.ts +32 -32
- package/dist/dev-server/ts-css.d.ts +26 -35
- package/dist/dev-server/types.d.ts +33 -29
- package/dist/directive-api.d.ts +42 -85
- package/dist/directive-arguments.d.ts +14 -39
- package/dist/document-shell.d.ts +49 -81
- package/dist/dynamic-components.d.ts +0 -9
- package/dist/engine-bindings.d.ts +1 -1
- package/dist/env.d.ts +26 -0
- package/dist/error-boundaries.d.ts +36 -43
- package/dist/error-handling.d.ts +1 -1
- package/dist/errors/codes.d.ts +43 -51
- package/dist/errors/formatter.d.ts +38 -58
- package/dist/errors/index.d.ts +61 -5
- package/dist/errors/logger.d.ts +40 -114
- package/dist/errors/sanitizer.d.ts +28 -53
- package/dist/errors/types.d.ts +31 -44
- package/dist/events.d.ts +32 -94
- package/dist/expressions.d.ts +57 -62
- package/dist/find-body-tag.d.ts +5 -34
- package/dist/first-script-tag.d.ts +0 -23
- package/dist/forms-validation.d.ts +117 -149
- package/dist/forms.d.ts +161 -120
- package/dist/framework-composables.d.ts +0 -32
- package/dist/head-injection.d.ts +30 -32
- package/dist/head-keys.d.ts +12 -15
- package/dist/head.d.ts +110 -139
- package/dist/heatmap.d.ts +76 -152
- package/dist/html-masking.d.ts +38 -62
- package/dist/hydration-runtime.d.ts +24 -20
- package/dist/hydration.d.ts +11 -10
- package/dist/i18n.d.ts +34 -95
- package/dist/image-optimization/auto-sibling.d.ts +4 -32
- package/dist/imported-signals.d.ts +0 -36
- package/dist/includes.d.ts +6 -69
- package/dist/index.d.ts +2 -1
- package/dist/init.d.ts +12 -20
- package/dist/internal-markdown.d.ts +8 -12
- package/dist/interpolation-context.d.ts +15 -15
- package/dist/island-chunking.d.ts +13 -30
- package/dist/keep-alive.d.ts +52 -72
- package/dist/layout-types.d.ts +2 -27
- package/dist/lazy-module.d.ts +0 -10
- package/dist/loading-indicator.d.ts +8 -5
- package/dist/loop-binding.d.ts +4 -7
- package/dist/loops.d.ts +25 -67
- package/dist/markdown.d.ts +1 -0
- package/dist/media/image/component.d.ts +9 -25
- package/dist/media/image/directive.d.ts +1 -15
- package/dist/media/image/placeholder.d.ts +9 -20
- package/dist/media/image/processor/cache.d.ts +18 -40
- package/dist/media/image/processor/index.d.ts +10 -1
- package/dist/media/image/processor/optimizer.d.ts +1 -12
- package/dist/media/image/processor/responsive.d.ts +6 -16
- package/dist/media/image/srcset.d.ts +49 -47
- package/dist/media/shared/cache.d.ts +31 -51
- package/dist/media/shared/hash.d.ts +0 -7
- package/dist/media/types.d.ts +754 -1235
- package/dist/media/video/directive.d.ts +1 -15
- package/dist/media/video/index.d.ts +17 -39
- package/dist/media/video/processor/cache.d.ts +19 -42
- package/dist/media/video/processor/index.d.ts +18 -1
- package/dist/media/video/processor/streaming.d.ts +10 -17
- package/dist/media/video/processor/thumbnail.d.ts +15 -21
- package/dist/media/video/processor/transcoder.d.ts +1 -11
- package/dist/meta-arguments.d.ts +14 -39
- package/dist/method-spoofing.d.ts +0 -7
- package/dist/middleware.d.ts +0 -60
- package/dist/native/bridge/protocol.d.ts +2 -1
- package/dist/native/compiler/bundle.js +11 -1
- package/dist/native/compiler/headwind-to-style.d.ts +383 -359
- package/dist/native/compiler/icons.d.ts +249 -243
- package/dist/native/compiler/svg.d.ts +35 -24
- package/dist/native/runtime/jsc-globals.d.ts +1 -1
- package/dist/native/runtime/native-host.d.ts +1 -1
- package/dist/native/runtime/native-host.js +3 -0
- package/dist/offline/app-service-worker.d.ts +50 -114
- package/dist/offline/kept-store.d.ts +23 -37
- package/dist/offline/query-cache.d.ts +55 -126
- package/dist/owned-routes.d.ts +0 -31
- package/dist/page-response.d.ts +8 -39
- package/dist/parser/directive-parser.d.ts +45 -57
- package/dist/parser/expression-parser.d.ts +35 -33
- package/dist/parser/index.d.ts +39 -4
- package/dist/parser/tokenizer.d.ts +49 -61
- package/dist/partial-hydration.d.ts +51 -82
- package/dist/performance-utils.d.ts +115 -255
- package/dist/placeholder.d.ts +9 -18
- package/dist/plugin-system.d.ts +115 -264
- package/dist/process.d.ts +4 -9
- package/dist/process.js +6 -4
- package/dist/prop-sentinels.d.ts +11 -11
- package/dist/public-env.d.ts +0 -14
- package/dist/pwa/directives.d.ts +20 -12
- package/dist/pwa/inject.d.ts +0 -10
- package/dist/pwa/precache.d.ts +16 -22
- package/dist/pwa/service-worker.d.ts +0 -12
- package/dist/pwa.js +1 -1
- package/dist/reactive-bindings.d.ts +11 -34
- package/dist/reactive-tracking.d.ts +0 -36
- package/dist/reactive.d.ts +41 -58
- package/dist/render-memo.d.ts +5 -23
- package/dist/resolve-stx-targets.d.ts +6 -44
- package/dist/route-middleware.d.ts +35 -2
- package/dist/route-rules.d.ts +10 -13
- package/dist/router.d.ts +9 -8
- package/dist/routes.d.ts +3 -1
- package/dist/runtime-config-server.d.ts +14 -17
- package/dist/runtime-config.d.ts +2 -3
- package/dist/runtime-globals.d.ts +90 -122
- package/dist/runtime-injection.d.ts +0 -8
- package/dist/scaffolding.d.ts +30 -26
- package/dist/script-emit.d.ts +0 -30
- package/dist/script-validation.d.ts +6 -12
- package/dist/seo.d.ts +75 -153
- package/dist/server-api.d.ts +9 -12
- package/dist/server-bindings.d.ts +1 -26
- package/dist/server-data.d.ts +4 -5
- package/dist/sfc-template.d.ts +8 -8
- package/dist/signal-processing.d.ts +37 -53
- package/dist/signals-api.d.ts +58 -135
- package/dist/signals.d.ts +18 -24
- package/dist/site-url.d.ts +31 -28
- package/dist/slots.d.ts +20 -86
- package/dist/source-signature.d.ts +5 -28
- package/dist/ssg.d.ts +158 -337
- package/dist/ssg.js +2 -2
- package/dist/state-dir.d.ts +4 -4
- package/dist/store-loader.d.ts +0 -10
- package/dist/story/analytics.d.ts +60 -138
- package/dist/story/bookmarks.d.ts +34 -87
- package/dist/story/cli.d.ts +69 -123
- package/dist/story/collect/scanner.d.ts +0 -4
- package/dist/story/collect/tree.d.ts +1 -8
- package/dist/story/commands/build.d.ts +6 -11
- package/dist/story/commands/dev.d.ts +8 -15
- package/dist/story/commands/preview.d.ts +7 -13
- package/dist/story/config-watcher.d.ts +13 -20
- package/dist/story/config.d.ts +8 -11
- package/dist/story/context.d.ts +8 -14
- package/dist/story/hmr.d.ts +26 -24
- package/dist/story/hot-swap.d.ts +23 -34
- package/dist/story/keyboard-shortcuts.d.ts +18 -23
- package/dist/story/output.d.ts +44 -46
- package/dist/story/performance.d.ts +45 -107
- package/dist/story/presets.d.ts +41 -107
- package/dist/story/renderer.d.ts +27 -41
- package/dist/story/search.d.ts +12 -23
- package/dist/story/server.d.ts +11 -21
- package/dist/story/setup.d.ts +15 -23
- package/dist/story/testing.d.ts +40 -65
- package/dist/story/types.d.ts +160 -262
- package/dist/streaming.d.ts +57 -119
- package/dist/strip-literals.d.ts +1 -25
- package/dist/stx-module-imports.d.ts +7 -0
- package/dist/stx-virtual-ts.d.ts +102 -253
- package/dist/style-scoping.d.ts +8 -21
- package/dist/suspense.d.ts +52 -67
- package/dist/teleport.d.ts +0 -22
- package/dist/template-syntax-escape.d.ts +8 -8
- package/dist/template-tag-balance.d.ts +6 -22
- package/dist/testing.d.ts +26 -11
- package/dist/theme-tokens.d.ts +388 -134
- package/dist/transitions.d.ts +55 -66
- package/dist/ts-css-config.d.ts +12 -70
- package/dist/types/component-types.d.ts +122 -187
- package/dist/types/config-types.d.ts +341 -956
- package/dist/types/context-types.d.ts +24 -46
- package/dist/types/csp-types.d.ts +66 -70
- package/dist/types/directive-types.d.ts +156 -223
- package/dist/types/index.d.ts +110 -6
- package/dist/types/pwa-types.d.ts +148 -273
- package/dist/types.d.ts +1 -0
- package/dist/unresolved-identifiers.d.ts +22 -24
- package/dist/url-safety.d.ts +32 -32
- package/dist/utils.d.ts +21 -36
- package/dist/validator.d.ts +26 -28
- package/dist/variable-extractor.d.ts +19 -49
- package/dist/view-composers.d.ts +81 -80
- package/dist/virtual-scrolling.d.ts +82 -101
- package/dist/visual-testing.d.ts +10 -9
- package/dist/vue-template.d.ts +0 -23
- package/dist/web-components/css-scoping.d.ts +11 -21
- package/dist/web-components.d.ts +58 -81
- package/dist/x-element.d.ts +1 -0
- package/package.json +6 -6
- package/stx.d.ts +2 -2
- package/dist/app-service-worker.d.ts +0 -165
- package/dist/chunk-49gwmcrn.js +0 -2
- package/dist/chunk-6va5pe2m.js +0 -2
- package/dist/chunk-bm2q1srp.js +0 -2
- package/dist/signals-context-runtime.d.ts +0 -2
- package/dist/signals-drawer-runtime.d.ts +0 -2
- package/dist/signals-host-runtime.d.ts +0 -9
- package/dist/signals-loop-conditional-runtime.d.ts +0 -2
- package/dist/signals-manifest-hydration-runtime.d.ts +0 -2
- package/dist/signals-notify-runtime.d.ts +0 -2
- package/dist/signals-optimistic-runtime.d.ts +0 -2
- package/dist/signals-overlay-runtime.d.ts +0 -2
- package/dist/signals-scope-disposal-runtime.d.ts +0 -2
- package/dist/signals-spa-load-control-runtime.d.ts +0 -2
- package/dist/signals-storage-runtime.d.ts +0 -2
package/dist/a11y.d.ts
CHANGED
|
@@ -1,39 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Accessibility (A11y) Module
|
|
3
|
-
*
|
|
4
|
-
* Provides directives and utilities for accessibility compliance:
|
|
5
|
-
* - `@a11y('type', 'message')` - Add accessibility hints as HTML comments
|
|
6
|
-
* - `@screenReader(...)@endScreenReader` - Screen reader only content
|
|
7
|
-
* - `@ariaDescribe('id', 'description')` - Connect elements with descriptions
|
|
8
|
-
*
|
|
9
|
-
* Also provides automated accessibility checking via `checkA11y()` and
|
|
10
|
-
* directory scanning via `scanA11yIssues()`.
|
|
11
|
-
*
|
|
12
|
-
* ## Accessibility Checks
|
|
13
|
-
*
|
|
14
|
-
* The automated checker validates:
|
|
15
|
-
* - Images have alt attributes
|
|
16
|
-
* - Interactive elements have accessible names
|
|
17
|
-
* - Form inputs have associated labels
|
|
18
|
-
* - Heading hierarchy is maintained
|
|
19
|
-
* - Document has lang attribute
|
|
20
|
-
* - A right-to-left lang is paired with dir="rtl"
|
|
21
|
-
*/
|
|
22
1
|
import type { CustomDirective, StxOptions } from './types';
|
|
23
|
-
export interface A11yViolation {
|
|
24
|
-
/** Type/category of violation */
|
|
25
|
-
type: string;
|
|
26
|
-
/** The problematic HTML element */
|
|
27
|
-
element: string;
|
|
28
|
-
/** Description of the issue */
|
|
29
|
-
message: string;
|
|
30
|
-
/** Impact level of the violation */
|
|
31
|
-
impact: 'critical' | 'serious' | 'moderate' | 'minor';
|
|
32
|
-
/** Suggested fix */
|
|
33
|
-
help: string;
|
|
34
|
-
/** URL to more information */
|
|
35
|
-
helpUrl?: string;
|
|
36
|
-
}
|
|
37
2
|
/**
|
|
38
3
|
* Has this element declared itself decorative rather than semantic?
|
|
39
4
|
*
|
|
@@ -119,33 +84,11 @@ export declare function checkA11yWithRegex(html: string, _filePath: string): A11
|
|
|
119
84
|
* ```
|
|
120
85
|
*/
|
|
121
86
|
export declare function checkA11y(html: string, filePath: string): Promise<A11yViolation[]>;
|
|
122
|
-
|
|
123
|
-
export interface A11yScanResult {
|
|
124
|
-
/** Files that had at least one violation, mapped to their violations. */
|
|
125
|
-
results: Record<string, A11yViolation[]>;
|
|
126
|
-
/**
|
|
127
|
-
* Every file the scan READ.
|
|
128
|
-
*
|
|
129
|
-
* Reported separately because "no violations" and "no files" are different
|
|
130
|
-
* answers that used to be the same one: `results` only ever contains files
|
|
131
|
-
* WITH violations, so an empty map means both "everything is clean" and
|
|
132
|
-
* "nothing was scanned", and the success banner was printed for both
|
|
133
|
-
* (stacksjs/stx#1918).
|
|
134
|
-
*/
|
|
135
|
-
scannedFiles: string[];
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Scan a directory, a file, or a glob for accessibility issues.
|
|
139
|
-
*
|
|
140
|
-
* The argument used to be joined into a scan pattern, so only a directory
|
|
141
|
-
* worked: a file path became `<file>/**` + `/*.stx` and a glob became a doubled
|
|
87
|
+
/*.stx` and a glob became a doubled
|
|
142
88
|
* pattern, both matching nothing and both reported as a clean pass. See
|
|
143
89
|
* `resolve-stx-targets.ts` for what that cost.
|
|
144
90
|
*/
|
|
145
|
-
export declare function scanA11yTargets(target: string | readonly string[], options?: {
|
|
146
|
-
recursive?: boolean;
|
|
147
|
-
ignorePaths?: string[];
|
|
148
|
-
}): Promise<A11yScanResult>;
|
|
91
|
+
export declare function scanA11yTargets(target: string | readonly string[], options?: { recursive?: boolean, ignorePaths?: string[] }): Promise<A11yScanResult>;
|
|
149
92
|
/**
|
|
150
93
|
* Back-compatible wrapper: violations only.
|
|
151
94
|
*
|
|
@@ -153,51 +96,7 @@ export declare function scanA11yTargets(target: string | readonly string[], opti
|
|
|
153
96
|
* anything — which is the distinction #1918 turned on. Prefer
|
|
154
97
|
* {@link scanA11yTargets}.
|
|
155
98
|
*/
|
|
156
|
-
export declare function scanA11yIssues(directory: string, options?: {
|
|
157
|
-
recursive?: boolean;
|
|
158
|
-
ignorePaths?: string[];
|
|
159
|
-
}): Promise<Record<string, A11yViolation[]>>;
|
|
160
|
-
/**
|
|
161
|
-
* Auto-fix result
|
|
162
|
-
*/
|
|
163
|
-
export interface A11yFixResult {
|
|
164
|
-
/** Original HTML */
|
|
165
|
-
original: string;
|
|
166
|
-
/** Fixed HTML */
|
|
167
|
-
fixed: string;
|
|
168
|
-
/** Number of fixes applied */
|
|
169
|
-
fixCount: number;
|
|
170
|
-
/** Details of each fix */
|
|
171
|
-
fixes: Array<{
|
|
172
|
-
type: string;
|
|
173
|
-
description: string;
|
|
174
|
-
before: string;
|
|
175
|
-
after: string;
|
|
176
|
-
}>;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Auto-fix configuration
|
|
180
|
-
*/
|
|
181
|
-
export interface A11yAutoFixConfig {
|
|
182
|
-
/** Fix images without alt text by adding empty alt="" */
|
|
183
|
-
fixMissingAlt?: boolean;
|
|
184
|
-
/** Fix buttons/links without accessible names by adding aria-label */
|
|
185
|
-
fixMissingLabels?: boolean;
|
|
186
|
-
/** Fix form inputs without labels by adding aria-label */
|
|
187
|
-
fixMissingFormLabels?: boolean;
|
|
188
|
-
/** Fix tables without headers by adding scope attribute */
|
|
189
|
-
fixTableHeaders?: boolean;
|
|
190
|
-
/** Add lang attribute to html element */
|
|
191
|
-
fixMissingLang?: boolean;
|
|
192
|
-
/** Add dir="rtl" when the html element's lang is a right-to-left language */
|
|
193
|
-
fixMissingDir?: boolean;
|
|
194
|
-
/** Fix positive tabindex values */
|
|
195
|
-
fixPositiveTabindex?: boolean;
|
|
196
|
-
/** Fix custom buttons without tabindex */
|
|
197
|
-
fixButtonFocusable?: boolean;
|
|
198
|
-
/** Default language for lang attribute */
|
|
199
|
-
defaultLang?: string;
|
|
200
|
-
}
|
|
99
|
+
export declare function scanA11yIssues(directory: string, options?: { recursive?: boolean, ignorePaths?: string[] }): Promise<Record<string, A11yViolation[]>>;
|
|
201
100
|
/**
|
|
202
101
|
* Auto-fix accessibility issues in HTML content.
|
|
203
102
|
*
|
|
@@ -237,11 +136,15 @@ export declare function autoFixA11yFile(filePath: string, config?: A11yAutoFixCo
|
|
|
237
136
|
* @returns Map of file paths to fix results
|
|
238
137
|
*/
|
|
239
138
|
export declare function autoFixA11yDirectory(directory: string, config?: A11yAutoFixConfig, options?: {
|
|
240
|
-
recursive?: boolean
|
|
241
|
-
ignorePaths?: string[]
|
|
242
|
-
writeBack?: boolean
|
|
243
|
-
extensions?: string[]
|
|
244
|
-
}): Promise<Record<string, A11yFixResult>>;
|
|
139
|
+
recursive?: boolean
|
|
140
|
+
ignorePaths?: string[]
|
|
141
|
+
writeBack?: boolean
|
|
142
|
+
extensions?: string[]
|
|
143
|
+
}): Promise<Record<string, A11yFixResult>>;
|
|
144
|
+
/**
|
|
145
|
+
* Register all a11y directives
|
|
146
|
+
*/
|
|
147
|
+
export declare function registerA11yDirectives(): CustomDirective[];
|
|
245
148
|
/**
|
|
246
149
|
* A11y directive for adding accessibility hints
|
|
247
150
|
*/
|
|
@@ -250,7 +153,44 @@ export declare const a11yDirective: CustomDirective;
|
|
|
250
153
|
* Screen reader directive for screen reader only content
|
|
251
154
|
*/
|
|
252
155
|
export declare const screenReaderDirective: CustomDirective;
|
|
156
|
+
export declare interface A11yViolation {
|
|
157
|
+
type: string
|
|
158
|
+
element: string
|
|
159
|
+
message: string
|
|
160
|
+
impact: 'critical' | 'serious' | 'moderate' | 'minor'
|
|
161
|
+
help: string
|
|
162
|
+
helpUrl?: string
|
|
163
|
+
}
|
|
164
|
+
/** What a scan actually read, alongside what it found. */
|
|
165
|
+
export declare interface A11yScanResult {
|
|
166
|
+
results: Record<string, A11yViolation[]>
|
|
167
|
+
scannedFiles: string[]
|
|
168
|
+
}
|
|
253
169
|
/**
|
|
254
|
-
*
|
|
170
|
+
* Auto-fix result
|
|
255
171
|
*/
|
|
256
|
-
export declare
|
|
172
|
+
export declare interface A11yFixResult {
|
|
173
|
+
original: string
|
|
174
|
+
fixed: string
|
|
175
|
+
fixCount: number
|
|
176
|
+
fixes: Array<{
|
|
177
|
+
type: string
|
|
178
|
+
description: string
|
|
179
|
+
before: string
|
|
180
|
+
after: string
|
|
181
|
+
}>
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Auto-fix configuration
|
|
185
|
+
*/
|
|
186
|
+
export declare interface A11yAutoFixConfig {
|
|
187
|
+
fixMissingAlt?: boolean
|
|
188
|
+
fixMissingLabels?: boolean
|
|
189
|
+
fixMissingFormLabels?: boolean
|
|
190
|
+
fixTableHeaders?: boolean
|
|
191
|
+
fixMissingLang?: boolean
|
|
192
|
+
fixMissingDir?: boolean
|
|
193
|
+
fixPositiveTabindex?: boolean
|
|
194
|
+
fixButtonFocusable?: boolean
|
|
195
|
+
defaultLang?: string
|
|
196
|
+
}
|
package/dist/animation.d.ts
CHANGED
|
@@ -1,42 +1,81 @@
|
|
|
1
1
|
import type { CustomDirective, StxOptions } from './types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Generates CSS for transitions based on provided parameters
|
|
4
|
+
*/
|
|
5
|
+
declare function generateTransitionCSS(type: TransitionType, options?: {
|
|
6
|
+
duration?: number
|
|
7
|
+
delay?: number
|
|
8
|
+
ease?: TransitionEase
|
|
9
|
+
direction?: TransitionDirection
|
|
10
|
+
custom?: string
|
|
11
|
+
}): string;
|
|
12
|
+
/**
|
|
13
|
+
* Generates necessary script to handle motion preferences
|
|
14
|
+
*
|
|
15
|
+
* Every script in this module now states its re-run behaviour with
|
|
16
|
+
* `data-stx-run`, rather than letting the router infer it from the first
|
|
17
|
+
* character of the body (#1828).
|
|
18
|
+
*
|
|
19
|
+
* The split is whether the script resolves its targets at RUN time.
|
|
20
|
+
*
|
|
21
|
+
* `always` for the scroll observer, the animation group, and the per-container
|
|
22
|
+
* stagger and timeline scripts. Each queries the document when it runs —
|
|
23
|
+
* `.stx-observe`, a selector list, a container id — so a page swapped in later
|
|
24
|
+
* only gets animated if the script runs again. The scroll observer and the
|
|
25
|
+
* group script also REMOVE the `stx-out` class that hides their elements, so
|
|
26
|
+
* skipping them does not merely drop an animation: the content stays hidden.
|
|
27
|
+
* These two were already being deduped under the old sniff, because their
|
|
28
|
+
* bodies open with a comment, so that is a real bug this fixes rather than
|
|
29
|
+
* preserves. The cost is one extra IntersectionObserver per navigation, which
|
|
30
|
+
* is the cheaper side of the trade.
|
|
31
|
+
*
|
|
32
|
+
* `once` for motion preferences and the runtime registry, which write to
|
|
33
|
+
* `document.documentElement` and to `window.__stxAnimation` — both survive an
|
|
34
|
+
* SPA navigation, so re-running only re-installs a matchMedia listener.
|
|
35
|
+
*/
|
|
36
|
+
declare function generateMotionPreferencesScript(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Animation Group handling for coordinated animations
|
|
39
|
+
*/
|
|
40
|
+
declare function generateAnimationGroup(groupName: string, elements: string[], options?: { staggerDelay?: number, sequence?: boolean }): string;
|
|
41
|
+
/**
|
|
42
|
+
* Process animation directives in the template
|
|
4
43
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Slide = "slide",
|
|
8
|
-
Scale = "scale",
|
|
9
|
-
Flip = "flip",
|
|
10
|
-
Rotate = "rotate",
|
|
11
|
-
Custom = "custom"
|
|
12
|
-
}
|
|
44
|
+
// eslint-disable-next-line pickier/no-unused-vars
|
|
45
|
+
export declare function processAnimationDirectives(template: string, context: Record<string, any>, filePath: string, options: StxOptions): string;
|
|
13
46
|
/**
|
|
14
|
-
*
|
|
47
|
+
* Calculate spring animation CSS
|
|
15
48
|
*/
|
|
16
|
-
|
|
17
|
-
In = "in",
|
|
18
|
-
Out = "out",
|
|
19
|
-
Both = "both"
|
|
20
|
-
}
|
|
49
|
+
declare function calculateSpringCurve(config: SpringConfig): string;
|
|
21
50
|
/**
|
|
22
|
-
*
|
|
51
|
+
* Create an animation timeline for coordinated animations
|
|
23
52
|
*/
|
|
24
|
-
export declare
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
53
|
+
export declare function createAnimationTimeline(entries: TimelineEntry[]): string;
|
|
54
|
+
/**
|
|
55
|
+
* Generate CSS for a custom animation
|
|
56
|
+
*/
|
|
57
|
+
export declare function generateAnimationCSS(name: string, keyframes: Keyframe[], options: KeyframeAnimationOptions): string;
|
|
58
|
+
/**
|
|
59
|
+
* Parse animation shorthand string
|
|
60
|
+
* Format: "duration [delay] [easing] [iterations] [direction] [fill]"
|
|
61
|
+
*/
|
|
62
|
+
export declare function parseAnimationShorthand(shorthand: string): KeyframeAnimationOptions;
|
|
63
|
+
/**
|
|
64
|
+
* Generate client-side animation runtime
|
|
65
|
+
*/
|
|
66
|
+
export declare function generateAnimationRuntime(): string;
|
|
67
|
+
/**
|
|
68
|
+
* Register animation directives
|
|
69
|
+
*/
|
|
70
|
+
export declare function registerAnimationDirectives(options: StxOptions): StxOptions;
|
|
32
71
|
/**
|
|
33
72
|
* Default transition options
|
|
34
73
|
*/
|
|
35
74
|
export declare const DEFAULT_TRANSITION_OPTIONS: {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
75
|
+
duration: number
|
|
76
|
+
delay: number
|
|
77
|
+
ease: string
|
|
78
|
+
direction: string
|
|
40
79
|
};
|
|
41
80
|
/**
|
|
42
81
|
* Transition directive for applying transitions to elements
|
|
@@ -55,38 +94,19 @@ export declare const animationGroupDirective: CustomDirective;
|
|
|
55
94
|
*/
|
|
56
95
|
export declare const motionDirective: CustomDirective;
|
|
57
96
|
/**
|
|
58
|
-
*
|
|
97
|
+
* Preset spring configurations
|
|
98
|
+
* @defaultValue
|
|
99
|
+
* ```ts
|
|
100
|
+
* {
|
|
101
|
+
* default: { stiffness: 100, damping: 10, mass: 1 },
|
|
102
|
+
* gentle: { stiffness: 120, damping: 14, mass: 1 },
|
|
103
|
+
* wobbly: { stiffness: 180, damping: 12, mass: 1 },
|
|
104
|
+
* stiff: { stiffness: 210, damping: 20, mass: 1 },
|
|
105
|
+
* slow: { stiffness: 280, damping: 60, mass: 1 },
|
|
106
|
+
* molasses: { stiffness: 280, damping: 120, mass: 1 }
|
|
107
|
+
* }
|
|
108
|
+
* ```
|
|
59
109
|
*/
|
|
60
|
-
export declare function processAnimationDirectives(template: string, context: Record<string, any>, filePath: string, options: StxOptions): string;
|
|
61
|
-
/** Keyframe definition */
|
|
62
|
-
export interface Keyframe {
|
|
63
|
-
offset?: number;
|
|
64
|
-
properties: Record<string, string | number>;
|
|
65
|
-
easing?: string;
|
|
66
|
-
}
|
|
67
|
-
/** Animation timeline entry */
|
|
68
|
-
export interface TimelineEntry {
|
|
69
|
-
selector: string;
|
|
70
|
-
keyframes: Keyframe[];
|
|
71
|
-
options: KeyframeAnimationOptions;
|
|
72
|
-
}
|
|
73
|
-
/** Keyframe animation options */
|
|
74
|
-
export interface KeyframeAnimationOptions {
|
|
75
|
-
duration: number;
|
|
76
|
-
delay?: number;
|
|
77
|
-
easing?: string;
|
|
78
|
-
iterations?: number | 'infinite';
|
|
79
|
-
direction?: 'normal' | 'reverse' | 'alternate' | 'alternate-reverse';
|
|
80
|
-
fill?: 'none' | 'forwards' | 'backwards' | 'both';
|
|
81
|
-
}
|
|
82
|
-
/** Spring animation config */
|
|
83
|
-
export interface SpringConfig {
|
|
84
|
-
stiffness: number;
|
|
85
|
-
damping: number;
|
|
86
|
-
mass: number;
|
|
87
|
-
velocity?: number;
|
|
88
|
-
}
|
|
89
|
-
/** Preset spring configurations */
|
|
90
110
|
export declare const SPRING_PRESETS: Record<string, SpringConfig>;
|
|
91
111
|
/**
|
|
92
112
|
* @keyframe directive for custom keyframe animations
|
|
@@ -100,24 +120,61 @@ export declare const staggerDirective: CustomDirective;
|
|
|
100
120
|
* @spring directive for spring physics animations
|
|
101
121
|
*/
|
|
102
122
|
export declare const springDirective: CustomDirective;
|
|
123
|
+
/** Keyframe definition */
|
|
124
|
+
export declare interface Keyframe {
|
|
125
|
+
offset?: number
|
|
126
|
+
properties: Record<string, string | number>
|
|
127
|
+
easing?: string
|
|
128
|
+
}
|
|
129
|
+
/** Animation timeline entry */
|
|
130
|
+
export declare interface TimelineEntry {
|
|
131
|
+
selector: string
|
|
132
|
+
keyframes: Keyframe[]
|
|
133
|
+
options: KeyframeAnimationOptions
|
|
134
|
+
}
|
|
135
|
+
/** Keyframe animation options */
|
|
136
|
+
export declare interface KeyframeAnimationOptions {
|
|
137
|
+
duration: number
|
|
138
|
+
delay?: number
|
|
139
|
+
easing?: string
|
|
140
|
+
iterations?: number | 'infinite'
|
|
141
|
+
direction?: 'normal' | 'reverse' | 'alternate' | 'alternate-reverse'
|
|
142
|
+
fill?: 'none' | 'forwards' | 'backwards' | 'both'
|
|
143
|
+
}
|
|
144
|
+
/** Spring animation config */
|
|
145
|
+
export declare interface SpringConfig {
|
|
146
|
+
stiffness: number
|
|
147
|
+
damping: number
|
|
148
|
+
mass: number
|
|
149
|
+
velocity?: number
|
|
150
|
+
}
|
|
103
151
|
/**
|
|
104
|
-
*
|
|
105
|
-
*/
|
|
106
|
-
export declare function createAnimationTimeline(entries: TimelineEntry[]): string;
|
|
107
|
-
/**
|
|
108
|
-
* Generate CSS for a custom animation
|
|
109
|
-
*/
|
|
110
|
-
export declare function generateAnimationCSS(name: string, keyframes: Keyframe[], options: KeyframeAnimationOptions): string;
|
|
111
|
-
/**
|
|
112
|
-
* Parse animation shorthand string
|
|
113
|
-
* Format: "duration [delay] [easing] [iterations] [direction] [fill]"
|
|
152
|
+
* Available transition types that can be used with @transition directive
|
|
114
153
|
*/
|
|
115
|
-
export declare
|
|
154
|
+
export declare enum TransitionType {
|
|
155
|
+
Fade = 'fade',
|
|
156
|
+
Slide = 'slide',
|
|
157
|
+
Scale = 'scale',
|
|
158
|
+
Flip = 'flip',
|
|
159
|
+
Rotate = 'rotate',
|
|
160
|
+
Custom = 'custom',
|
|
161
|
+
}
|
|
116
162
|
/**
|
|
117
|
-
*
|
|
163
|
+
* Available transition directions that can be used with @transition directive
|
|
118
164
|
*/
|
|
119
|
-
export declare
|
|
165
|
+
export declare enum TransitionDirection {
|
|
166
|
+
In = 'in',
|
|
167
|
+
Out = 'out',
|
|
168
|
+
Both = 'both',
|
|
169
|
+
}
|
|
120
170
|
/**
|
|
121
|
-
*
|
|
171
|
+
* Available ease functions for transitions
|
|
122
172
|
*/
|
|
123
|
-
export declare
|
|
173
|
+
export declare enum TransitionEase {
|
|
174
|
+
Linear = 'linear',
|
|
175
|
+
Ease = 'ease',
|
|
176
|
+
EaseIn = 'ease-in',
|
|
177
|
+
EaseOut = 'ease-out',
|
|
178
|
+
EaseInOut = 'ease-in-out',
|
|
179
|
+
Spring = 'spring',
|
|
180
|
+
}
|
package/dist/api-client.d.ts
CHANGED
|
@@ -1,26 +1,16 @@
|
|
|
1
|
+
/** Typed JSON fetch. Example: apiFetch('GET /api/users/:id', { params: { id: '42' } }). */
|
|
2
|
+
export declare function apiFetch<K extends ApiRouteKey>(route: K, ...args: {} extends Params<K> ? [options?: ApiFetchOptions<K>] : [options: ApiFetchOptions<K> & { params: Params<K> }]): Promise<ApiResponse<K>>;
|
|
1
3
|
/** Augmented by .stx/api-types.d.ts. This module has no server imports. */
|
|
2
|
-
export interface KnownApiRoutes {
|
|
3
|
-
}
|
|
4
|
+
export declare interface KnownApiRoutes {}
|
|
4
5
|
export type ApiMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
|
|
5
6
|
export type ApiRouteKey = [keyof KnownApiRoutes] extends [never] ? `${ApiMethod} /${string}` : keyof KnownApiRoutes & string;
|
|
6
|
-
type Params<K extends ApiRouteKey> = K extends keyof KnownApiRoutes ? KnownApiRoutes[K] extends {
|
|
7
|
-
params: infer P;
|
|
8
|
-
} ? P : never : Record<string, string>;
|
|
7
|
+
declare type Params<K extends ApiRouteKey> = K extends keyof KnownApiRoutes ? KnownApiRoutes[K] extends { params: infer P } ? P : never : Record<string, string>;
|
|
9
8
|
/** Match JSON wire types rather than pretending Date survives serialization. */
|
|
10
|
-
export type ApiJson<T> = T extends Response ? unknown : T extends Date ? string : T extends bigint | symbol | ((...args: any[]) => any) ? never : T extends object ? {
|
|
11
|
-
|
|
12
|
-
} : T;
|
|
13
|
-
export type ApiResponse<K extends ApiRouteKey> = K extends keyof KnownApiRoutes ? KnownApiRoutes[K] extends {
|
|
14
|
-
response: infer R;
|
|
15
|
-
} ? ApiJson<R> : unknown : unknown;
|
|
9
|
+
export type ApiJson<T> = T extends Response ? unknown : T extends Date ? string : T extends bigint | symbol | ((...args: any[]) => any) ? never : T extends object ? { [K in keyof T]: ApiJson<T[K]> } : T;
|
|
10
|
+
export type ApiResponse<K extends ApiRouteKey> = K extends keyof KnownApiRoutes ? KnownApiRoutes[K] extends { response: infer R } ? ApiJson<R> : unknown : unknown;
|
|
16
11
|
export type ApiFetchOptions<K extends ApiRouteKey> = Omit<RequestInit, 'method'> & {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
/** Typed JSON fetch. Example: apiFetch('GET /api/users/:id', { params: { id: '42' } }). */
|
|
23
|
-
export declare function apiFetch<K extends ApiRouteKey>(route: K, ...args: {} extends Params<K> ? [options?: ApiFetchOptions<K>] : [options: ApiFetchOptions<K> & {
|
|
24
|
-
params: Params<K>;
|
|
25
|
-
}]): Promise<ApiResponse<K>>;
|
|
26
|
-
export {};
|
|
12
|
+
params?: Params<K>
|
|
13
|
+
query?: Record<string, string | number | boolean | undefined>
|
|
14
|
+
/** Useful for server-side callers. Browser calls default to the current origin. */
|
|
15
|
+
baseURL?: string
|
|
16
|
+
}
|
package/dist/api-handler.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/** Context passed to opt-in file-based endpoints. */
|
|
2
|
-
export interface ApiHandlerContext {
|
|
3
|
-
params: Record<string, string>;
|
|
4
|
-
}
|
|
5
1
|
/** Preserve a handler's inferred return type for the generated client contract. */
|
|
6
2
|
export declare function defineApiHandler<T>(handler: (request: Request, context: ApiHandlerContext) => T): (request: Request, context: ApiHandlerContext) => T;
|
|
3
|
+
/** Context passed to opt-in file-based endpoints. */
|
|
4
|
+
export declare interface ApiHandlerContext {
|
|
5
|
+
params: Record<string, string>
|
|
6
|
+
}
|
|
@@ -1,82 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Client composables apply appearance reactively after mount, but that is too
|
|
5
|
-
* late for the first paint. This directive emits a compiler-owned synchronous
|
|
6
|
-
* script at the directive location so persisted root attributes and the dark
|
|
7
|
-
* class are present before the browser parses the application shell.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```stx
|
|
11
|
-
* @appearanceBootstrap({
|
|
12
|
-
* storageKey: 'app-appearance',
|
|
13
|
-
* appearance: {
|
|
14
|
-
* key: 'sidebarStyle',
|
|
15
|
-
* attribute: 'appearance',
|
|
16
|
-
* allowed: ['macos', 'arc'],
|
|
17
|
-
* default: 'macos',
|
|
18
|
-
* },
|
|
19
|
-
* colorMode: {
|
|
20
|
-
* key: 'colorMode',
|
|
21
|
-
* attribute: 'color-mode',
|
|
22
|
-
* default: 'system',
|
|
23
|
-
* },
|
|
24
|
-
* })
|
|
25
|
-
* ```
|
|
2
|
+
* Transform every `@appearanceBootstrap({...})` directive in a template.
|
|
26
3
|
*/
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
allowed: string[];
|
|
34
|
-
/** Value used when storage is absent, malformed, or outside the allowlist. */
|
|
35
|
-
default: string;
|
|
4
|
+
export declare function processAppearanceBootstrapDirective(template: string, context: Record<string, unknown>): string;
|
|
5
|
+
export declare interface AppearanceBootstrapValue {
|
|
6
|
+
key: string
|
|
7
|
+
attribute: string
|
|
8
|
+
allowed: string[]
|
|
9
|
+
default: string
|
|
36
10
|
}
|
|
37
|
-
export interface ColorModeBootstrapValue {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
attribute: string;
|
|
42
|
-
/** Mode used when storage is absent or malformed. */
|
|
43
|
-
default: 'light' | 'dark' | 'system';
|
|
11
|
+
export declare interface ColorModeBootstrapValue {
|
|
12
|
+
key: string
|
|
13
|
+
attribute: string
|
|
14
|
+
default: 'light' | 'dark' | 'system'
|
|
44
15
|
}
|
|
45
|
-
export interface AppearanceBootstrapOptions {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
* `'system'` string, which is what `useColorMode` writes under its own
|
|
51
|
-
* `storageKey` and the overwhelmingly common shape in existing apps.
|
|
52
|
-
*/
|
|
53
|
-
storageKey: string;
|
|
54
|
-
/**
|
|
55
|
-
* A second axis beside colour mode, such as a sidebar style.
|
|
56
|
-
*
|
|
57
|
-
* Optional: colour mode is the common case and this is the specialised one,
|
|
58
|
-
* so an app that themes only light/dark leaves it out rather than inventing
|
|
59
|
-
* a single-valued axis to satisfy the normalizer and then carrying a
|
|
60
|
-
* meaningless `data-*` attribute on every page (stacksjs/stx#2050).
|
|
61
|
-
*/
|
|
62
|
-
appearance?: AppearanceBootstrapValue;
|
|
63
|
-
colorMode: ColorModeBootstrapValue;
|
|
64
|
-
/**
|
|
65
|
-
* Leave an attribute alone when it already carries a concrete value, and
|
|
66
|
-
* resolve to that instead of to what is stored. @default false
|
|
67
|
-
*
|
|
68
|
-
* For a page whose theme is not the visitor's to choose: stamped
|
|
69
|
-
* server-side during render, it has to outrank whatever they stored from
|
|
70
|
-
* their own browsing. Without this the bootstrap resolved purely from
|
|
71
|
-
* storage and stamped unconditionally (stacksjs/stx#2050).
|
|
72
|
-
*
|
|
73
|
-
* `system` is not concrete: it is an instruction to resolve rather than an
|
|
74
|
-
* answer, so the stored preference still wins for it. For the appearance
|
|
75
|
-
* axis, concrete means a value in `allowed`.
|
|
76
|
-
*/
|
|
77
|
-
respectExisting?: boolean;
|
|
16
|
+
export declare interface AppearanceBootstrapOptions {
|
|
17
|
+
storageKey: string
|
|
18
|
+
appearance?: AppearanceBootstrapValue
|
|
19
|
+
colorMode: ColorModeBootstrapValue
|
|
20
|
+
respectExisting?: boolean
|
|
78
21
|
}
|
|
79
|
-
/**
|
|
80
|
-
* Transform every `@appearanceBootstrap({...})` directive in a template.
|
|
81
|
-
*/
|
|
82
|
-
export declare function processAppearanceBootstrapDirective(template: string, context: Record<string, unknown>): string;
|
|
@@ -1,30 +1,21 @@
|
|
|
1
1
|
import type { StxOptions } from './types';
|
|
2
|
-
export interface ApplicationLayer {
|
|
3
|
-
root: string;
|
|
4
|
-
configFile: string;
|
|
5
|
-
resources: Record<'pages' | 'components' | 'layouts' | 'partials' | 'composables', string>;
|
|
6
|
-
}
|
|
7
|
-
export interface ApplicationLayerGraph {
|
|
8
|
-
/** Highest precedence first: app, first layer and its ancestors, next layer. */
|
|
9
|
-
layers: ApplicationLayer[];
|
|
10
|
-
configDependencies: string[];
|
|
11
|
-
/** Intentional resource overrides, suitable for diagnostics. */
|
|
12
|
-
overrides?: Array<{
|
|
13
|
-
resource: string;
|
|
14
|
-
winner: string;
|
|
15
|
-
shadowed: string;
|
|
16
|
-
}>;
|
|
17
|
-
}
|
|
18
2
|
export declare function isLayerConfigSource(file: string): boolean;
|
|
19
3
|
/** Objects merge recursively; arrays replace except ordered middleware/plugins. */
|
|
20
4
|
export declare function mergeLayerConfig(base: any, override: any, key?: string): any;
|
|
21
|
-
export declare function resolveApplicationLayers(appRoot: string, defaults: StxOptions): Promise<{
|
|
22
|
-
config: StxOptions;
|
|
23
|
-
graph: ApplicationLayerGraph;
|
|
24
|
-
}>;
|
|
5
|
+
export declare function resolveApplicationLayers(appRoot: string, defaults: StxOptions): Promise<{ config: StxOptions, graph: ApplicationLayerGraph }>;
|
|
25
6
|
export declare function refreshLayerDiagnostics(graph: ApplicationLayerGraph, appRoot: string): Promise<void>;
|
|
26
7
|
export declare function layerDependencies(graph: ApplicationLayerGraph): string[];
|
|
27
8
|
export declare function layerSignature(graph: ApplicationLayerGraph): string;
|
|
28
9
|
export declare function layerConfigSignature(graph: ApplicationLayerGraph): string;
|
|
29
10
|
/** Portable build provenance; no absolute paths or config values. */
|
|
30
11
|
export declare function layerManifest(graph: ApplicationLayerGraph): unknown;
|
|
12
|
+
export declare interface ApplicationLayer {
|
|
13
|
+
root: string
|
|
14
|
+
configFile: string
|
|
15
|
+
resources: Record<'pages' | 'components' | 'layouts' | 'partials' | 'composables', string>
|
|
16
|
+
}
|
|
17
|
+
export declare interface ApplicationLayerGraph {
|
|
18
|
+
layers: ApplicationLayer[]
|
|
19
|
+
configDependencies: string[]
|
|
20
|
+
overrides?: Array<{ resource: string, winner: string, shadowed: string }>
|
|
21
|
+
}
|
package/dist/asset-roots.d.ts
CHANGED
|
@@ -1,32 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The conventional asset root, shared by the serve path and every build path.
|
|
3
|
-
*
|
|
4
|
-
* `serve()` resolves `/assets/*` from `resources/assets/*` as well as from
|
|
5
|
-
* `publicDir` — the Stacks/Laravel-style layout that `buddy make:*` produces.
|
|
6
|
-
* No build path had ever heard of it: they copy `publicDir` and nothing else.
|
|
7
|
-
*
|
|
8
|
-
* So `<script src="/assets/scripts/site-mode.js">` resolved under `stx dev` and
|
|
9
|
-
* 404'd in `dist/`, with nothing in the build reporting it. The only way to
|
|
10
|
-
* notice was to diff the build output against the served tree
|
|
11
|
-
* (stacksjs/stx#1876).
|
|
12
|
-
*
|
|
13
|
-
* It lives here rather than in one of the three builders because there are
|
|
14
|
-
* three of them — ssg.ts, site-builder/build.ts and production-builder.ts —
|
|
15
|
-
* each with its own copy mechanism, and a convention restated three times is
|
|
16
|
-
* one that will be fixed in one place and left behind in the others.
|
|
17
|
-
*
|
|
18
|
-
* @module asset-roots
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Directory whose contents are served at `/assets/*`, in addition to
|
|
22
|
-
* `publicDir`. Relative to the project root, and deliberately not a config
|
|
23
|
-
* option — it mirrors what `serve()` hardcodes.
|
|
24
|
-
*/
|
|
25
|
-
export declare const CONVENTIONAL_ASSET_ROOT = "resources/assets";
|
|
26
|
-
/** Where its contents must land so `/assets/*` resolves in built output. */
|
|
27
|
-
export declare const CONVENTIONAL_ASSET_OUTPUT = "assets";
|
|
28
1
|
/**
|
|
29
2
|
* Absolute path to the conventional asset root, or `null` when the project
|
|
30
3
|
* does not use that layout.
|
|
31
4
|
*/
|
|
32
5
|
export declare function resolveConventionalAssetRoot(root?: string): string | null;
|
|
6
|
+
/*`, in addition to
|
|
7
|
+
* `publicDir`. Relative to the project root, and deliberately not a config
|
|
8
|
+
* option — it mirrors what `serve()` hardcodes.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CONVENTIONAL_ASSET_ROOT: 'resources/assets';
|
|
11
|
+
/*` resolves in built output. */
|
|
12
|
+
export declare const CONVENTIONAL_ASSET_OUTPUT: 'assets';
|