@ohos-ports/stacksjs-stx 0.2.287-beta.0
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/LICENSE.md +21 -0
- package/README.md +1042 -0
- package/dist/a11y.d.ts +256 -0
- package/dist/a11y.js +671 -0
- package/dist/analytics.d.ts +40 -0
- package/dist/analytics.js +159 -0
- package/dist/analyzer.d.ts +68 -0
- package/dist/analyzer.js +240 -0
- package/dist/animation.d.ts +123 -0
- package/dist/animation.js +688 -0
- package/dist/app-shell.d.ts +76 -0
- package/dist/app-shell.js +209 -0
- package/dist/app.d.ts +65 -0
- package/dist/app.js +79 -0
- package/dist/appearance-bootstrap.d.ts +54 -0
- package/dist/appearance-bootstrap.js +92 -0
- package/dist/asset-roots.d.ts +32 -0
- package/dist/asset-roots.js +7 -0
- package/dist/assets.d.ts +21 -0
- package/dist/assets.js +155 -0
- package/dist/ast.d.ts +265 -0
- package/dist/ast.js +630 -0
- package/dist/async-components.d.ts +123 -0
- package/dist/async-components.js +428 -0
- package/dist/auth.d.ts +13 -0
- package/dist/auth.js +12 -0
- package/dist/broadcasting.d.ts +77 -0
- package/dist/broadcasting.js +103 -0
- package/dist/browser-composables.d.ts +348 -0
- package/dist/browser-composables.js +606 -0
- package/dist/browser-core-imports.d.ts +12 -0
- package/dist/browser-core-imports.js +28 -0
- package/dist/build-assets.d.ts +32 -0
- package/dist/build-assets.js +29 -0
- package/dist/build-externalize-repeated.d.ts +34 -0
- package/dist/build-externalize-repeated.js +101 -0
- package/dist/build-externalize.d.ts +73 -0
- package/dist/build-externalize.js +80 -0
- package/dist/build-id.d.ts +57 -0
- package/dist/build-id.js +25 -0
- package/dist/build-message.d.ts +81 -0
- package/dist/build-message.js +65 -0
- package/dist/build-mode-detector.d.ts +26 -0
- package/dist/build-mode-detector.js +50 -0
- package/dist/build-optimizer.d.ts +101 -0
- package/dist/build-optimizer.js +433 -0
- package/dist/build-views.d.ts +56 -0
- package/dist/build-views.js +180 -0
- package/dist/build.d.ts +31 -0
- package/dist/build.js +34 -0
- package/dist/builtins/attrs.d.ts +49 -0
- package/dist/builtins/attrs.js +39 -0
- package/dist/builtins/drawer.d.ts +24 -0
- package/dist/builtins/drawer.js +37 -0
- package/dist/builtins/escape.d.ts +12 -0
- package/dist/builtins/escape.js +3 -0
- package/dist/builtins/icon.d.ts +45 -0
- package/dist/builtins/icon.js +100 -0
- package/dist/builtins/image-delivery.d.ts +16 -0
- package/dist/builtins/image-delivery.js +115 -0
- package/dist/builtins/image-placeholder.d.ts +78 -0
- package/dist/builtins/image-placeholder.js +137 -0
- package/dist/builtins/index.d.ts +26 -0
- package/dist/builtins/index.js +34 -0
- package/dist/builtins/modal.d.ts +26 -0
- package/dist/builtins/modal.js +38 -0
- package/dist/builtins/safe-image.d.ts +44 -0
- package/dist/builtins/safe-image.js +45 -0
- package/dist/builtins/stx-image.d.ts +29 -0
- package/dist/builtins/stx-image.js +222 -0
- package/dist/builtins/stx-link.d.ts +11 -0
- package/dist/builtins/stx-link.js +35 -0
- package/dist/builtins/stx-loading-indicator.d.ts +13 -0
- package/dist/builtins/stx-loading-indicator.js +35 -0
- package/dist/builtins/suspense.d.ts +30 -0
- package/dist/builtins/suspense.js +24 -0
- package/dist/builtins/toast.d.ts +19 -0
- package/dist/builtins/toast.js +42 -0
- package/dist/builtins/tooltip.d.ts +18 -0
- package/dist/builtins/tooltip.js +106 -0
- package/dist/builtins/transition-group.d.ts +27 -0
- package/dist/builtins/transition-group.js +22 -0
- package/dist/bun-shim.js +496 -0
- package/dist/bundle-analyzer/collector.d.ts +66 -0
- package/dist/bundle-analyzer/collector.js +233 -0
- package/dist/bundle-analyzer/index.d.ts +98 -0
- package/dist/bundle-analyzer/index.js +82 -0
- package/dist/bundle-analyzer/report.d.ts +39 -0
- package/dist/bundle-analyzer/report.js +318 -0
- package/dist/bundle-analyzer/treemap.d.ts +19 -0
- package/dist/bundle-analyzer/treemap.js +594 -0
- package/dist/bundle-analyzer.js +499 -0
- package/dist/caching.d.ts +69 -0
- package/dist/caching.js +135 -0
- package/dist/chunk-0y46fbkx.js +3 -0
- package/dist/chunk-122tyfre.js +2 -0
- package/dist/chunk-19nfvxfw.js +43 -0
- package/dist/chunk-1kah92n2.js +3 -0
- package/dist/chunk-1kms3b9d.js +2 -0
- package/dist/chunk-1q4y74mh.js +1194 -0
- package/dist/chunk-248e84r1.js +4 -0
- package/dist/chunk-24ps8kft.js +2 -0
- package/dist/chunk-2et5hxfv.js +2 -0
- package/dist/chunk-2r1rd8f0.js +2 -0
- package/dist/chunk-2tk1zkrz.js +2 -0
- package/dist/chunk-38ejahd9.js +3 -0
- package/dist/chunk-3zv4wz87.js +2 -0
- package/dist/chunk-4122k1bh.js +2 -0
- package/dist/chunk-45az9zht.js +2 -0
- package/dist/chunk-4qr85f07.js +2 -0
- package/dist/chunk-4ww3znrr.js +15 -0
- package/dist/chunk-54st8g2j.js +397 -0
- package/dist/chunk-58f0mthg.js +3 -0
- package/dist/chunk-5a19dhx5.js +2 -0
- package/dist/chunk-5kk8gsj2.js +3 -0
- package/dist/chunk-5w1e3yxs.js +499 -0
- package/dist/chunk-6gdycmxr.js +2 -0
- package/dist/chunk-6hmnaza7.js +4473 -0
- package/dist/chunk-71t0yan0.js +5 -0
- package/dist/chunk-74cv4ta1.js +3 -0
- package/dist/chunk-74v15e8z.js +2 -0
- package/dist/chunk-7b329e5v.js +3 -0
- package/dist/chunk-7q9mwh4v.js +84 -0
- package/dist/chunk-866y9d8b.js +8169 -0
- package/dist/chunk-8fwerspy.js +2 -0
- package/dist/chunk-8mjdpr94.js +147 -0
- package/dist/chunk-92mj1t26.js +60 -0
- package/dist/chunk-9b22663r.js +2 -0
- package/dist/chunk-9hjdgm4d.js +2 -0
- package/dist/chunk-9n0gvfrg.js +4 -0
- package/dist/chunk-9wr7zcad.js +18 -0
- package/dist/chunk-9y0g8kzt.js +358 -0
- package/dist/chunk-a0nfbmeh.js +3 -0
- package/dist/chunk-acn1b56m.js +1280 -0
- package/dist/chunk-awkq3xfx.js +2 -0
- package/dist/chunk-b6ej2fdf.js +1814 -0
- package/dist/chunk-b8rrnqry.js +2 -0
- package/dist/chunk-bfqfs07m.js +3022 -0
- package/dist/chunk-bs6kapy7.js +2 -0
- package/dist/chunk-btav940g.js +2 -0
- package/dist/chunk-bz820epz.js +3 -0
- package/dist/chunk-ccspd3mc.js +2 -0
- package/dist/chunk-csbgwaa5.js +2 -0
- package/dist/chunk-d8t4sjsp.js +2 -0
- package/dist/chunk-dap191q2.js +2 -0
- package/dist/chunk-de7fye10.js +4 -0
- package/dist/chunk-dgrt76d2.js +2 -0
- package/dist/chunk-dhh5q7qt.js +3 -0
- package/dist/chunk-dsffsqnt.js +2 -0
- package/dist/chunk-dtq7y5ym.js +2 -0
- package/dist/chunk-fed3xsp9.js +3 -0
- package/dist/chunk-ferav3bw.js +19 -0
- package/dist/chunk-fvhm8psm.js +3 -0
- package/dist/chunk-g4vpzv6b.js +2 -0
- package/dist/chunk-g9csmj0s.js +2 -0
- package/dist/chunk-gtcrpmz1.js +2 -0
- package/dist/chunk-h4xh8cms.js +4 -0
- package/dist/chunk-h8yqsz9m.js +2 -0
- package/dist/chunk-hcq5dw7a.js +2 -0
- package/dist/chunk-hm0xha6c.js +12 -0
- package/dist/chunk-hpybjwwf.js +8 -0
- package/dist/chunk-jegt35zh.js +2 -0
- package/dist/chunk-jr3jp3ev.js +8 -0
- package/dist/chunk-k56rjjc0.js +24 -0
- package/dist/chunk-kdh37tp8.js +194 -0
- package/dist/chunk-kxzb4et3.js +29 -0
- package/dist/chunk-mf4n3x1j.js +14 -0
- package/dist/chunk-mkd9kjgb.js +3 -0
- package/dist/chunk-mxfh1nxg.js +2 -0
- package/dist/chunk-n3ggrhb3.js +3 -0
- package/dist/chunk-nkb3scg6.js +8 -0
- package/dist/chunk-nnd4wq8j.js +231 -0
- package/dist/chunk-nsp1cw38.js +11 -0
- package/dist/chunk-nx5qkm8k.js +30 -0
- package/dist/chunk-p3242nck.js +2 -0
- package/dist/chunk-p98kfh94.js +2 -0
- package/dist/chunk-pkaabd8h.js +3 -0
- package/dist/chunk-pzm13sdc.js +3 -0
- package/dist/chunk-q4p5k2p3.js +2 -0
- package/dist/chunk-q9n5swx7.js +3 -0
- package/dist/chunk-qc1f74ek.js +3 -0
- package/dist/chunk-qpyjak7z.js +2 -0
- package/dist/chunk-qr82je1m.js +22 -0
- package/dist/chunk-qy73j6m4.js +288 -0
- package/dist/chunk-qzkhpsam.js +505 -0
- package/dist/chunk-r3ayvdz3.js +2 -0
- package/dist/chunk-r7r66978.js +2 -0
- package/dist/chunk-rbb7dvja.js +30 -0
- package/dist/chunk-refwkt87.js +71 -0
- package/dist/chunk-rj4kajww.js +2 -0
- package/dist/chunk-rp4rjjmf.js +2 -0
- package/dist/chunk-se0p17c2.js +898 -0
- package/dist/chunk-sj9pmene.js +2 -0
- package/dist/chunk-sscwkffs.js +2 -0
- package/dist/chunk-svpqxn2c.js +2 -0
- package/dist/chunk-t6nseeb9.js +351 -0
- package/dist/chunk-t8y1ggdy.js +2 -0
- package/dist/chunk-tndhnk9e.js +2 -0
- package/dist/chunk-v5e1gxwm.js +3 -0
- package/dist/chunk-vqxmxgaj.js +4 -0
- package/dist/chunk-vrrax298.js +2 -0
- package/dist/chunk-w3ycm4na.js +3 -0
- package/dist/chunk-wcm80anz.js +321 -0
- package/dist/chunk-wrzwgkbx.js +22 -0
- package/dist/chunk-x650vjcp.js +302 -0
- package/dist/chunk-xgnc1wy6.js +116 -0
- package/dist/chunk-xpp135ad.js +11 -0
- package/dist/chunk-xttsqmkm.js +216 -0
- package/dist/chunk-y11cxbxd.js +3757 -0
- package/dist/chunk-y7m2dpd3.js +341 -0
- package/dist/chunk-y98jsjqq.js +2 -0
- package/dist/chunk-ya386h70.js +2 -0
- package/dist/chunk-ydrz60kr.js +2 -0
- package/dist/chunk-ypmqf7tm.js +4 -0
- package/dist/chunk-z4jhj5e5.js +28 -0
- package/dist/chunk-zg75gjns.js +2 -0
- package/dist/chunk-zqqx1qaj.js +2 -0
- package/dist/cli-flags.d.ts +34 -0
- package/dist/cli-flags.js +20 -0
- package/dist/cli.js +174 -0
- package/dist/client/directive.d.ts +17 -0
- package/dist/client/directive.js +14 -0
- package/dist/client/index.d.ts +7 -0
- package/dist/client/index.js +2 -0
- package/dist/client-helpers.d.ts +317 -0
- package/dist/client-helpers.js +312 -0
- package/dist/client-script-bundler.d.ts +103 -0
- package/dist/client-script-bundler.js +390 -0
- package/dist/client-script.d.ts +215 -0
- package/dist/client-script.js +865 -0
- package/dist/client.d.ts +21 -0
- package/dist/client.js +73 -0
- package/dist/codemod.d.ts +33 -0
- package/dist/codemod.js +244 -0
- package/dist/color-mode-boot.d.ts +92 -0
- package/dist/color-mode-boot.js +72 -0
- package/dist/component-client-factories.d.ts +33 -0
- package/dist/component-client-factories.js +77 -0
- package/dist/component-hmr.d.ts +107 -0
- package/dist/component-hmr.js +585 -0
- package/dist/component-library.d.ts +38 -0
- package/dist/component-library.js +994 -0
- package/dist/component-processing.d.ts +198 -0
- package/dist/component-processing.js +677 -0
- package/dist/component-registry.d.ts +127 -0
- package/dist/component-registry.js +90 -0
- package/dist/component-renderer.d.ts +52 -0
- package/dist/component-renderer.js +790 -0
- package/dist/components/StxImage.stx +12 -0
- package/dist/components/StxLink.stx +18 -0
- package/dist/components.d.ts +28 -0
- package/dist/components.js +213 -0
- package/dist/composable-loader.d.ts +62 -0
- package/dist/composable-loader.js +190 -0
- package/dist/composables/index.d.ts +417 -0
- package/dist/composables/index.js +222 -0
- package/dist/composables/use-battery.d.ts +46 -0
- package/dist/composables/use-battery.js +101 -0
- package/dist/composables/use-broadcast-channel.d.ts +59 -0
- package/dist/composables/use-broadcast-channel.js +80 -0
- package/dist/composables/use-channel.d.ts +67 -0
- package/dist/composables/use-channel.js +124 -0
- package/dist/composables/use-clipboard.d.ts +30 -0
- package/dist/composables/use-clipboard.js +90 -0
- package/dist/composables/use-color-mode.d.ts +67 -0
- package/dist/composables/use-color-mode.js +152 -0
- package/dist/composables/use-cookie.d.ts +59 -0
- package/dist/composables/use-cookie.js +86 -0
- package/dist/composables/use-device-orientation.d.ts +116 -0
- package/dist/composables/use-device-orientation.js +181 -0
- package/dist/composables/use-event-listener.d.ts +35 -0
- package/dist/composables/use-event-listener.js +27 -0
- package/dist/composables/use-event-source.d.ts +90 -0
- package/dist/composables/use-event-source.js +166 -0
- package/dist/composables/use-eye-dropper.d.ts +117 -0
- package/dist/composables/use-eye-dropper.js +142 -0
- package/dist/composables/use-fetch.d.ts +59 -0
- package/dist/composables/use-fetch.js +273 -0
- package/dist/composables/use-form.d.ts +91 -0
- package/dist/composables/use-form.js +112 -0
- package/dist/composables/use-fullscreen.d.ts +47 -0
- package/dist/composables/use-fullscreen.js +110 -0
- package/dist/composables/use-geolocation.d.ts +62 -0
- package/dist/composables/use-geolocation.js +101 -0
- package/dist/composables/use-idle.d.ts +102 -0
- package/dist/composables/use-idle.js +182 -0
- package/dist/composables/use-intersection-observer.d.ts +83 -0
- package/dist/composables/use-intersection-observer.js +168 -0
- package/dist/composables/use-keyboard.d.ts +100 -0
- package/dist/composables/use-keyboard.js +224 -0
- package/dist/composables/use-media-query.d.ts +56 -0
- package/dist/composables/use-media-query.js +62 -0
- package/dist/composables/use-meta.d.ts +35 -0
- package/dist/composables/use-meta.js +48 -0
- package/dist/composables/use-mouse.d.ts +65 -0
- package/dist/composables/use-mouse.js +286 -0
- package/dist/composables/use-mutation-observer.d.ts +101 -0
- package/dist/composables/use-mutation-observer.js +129 -0
- package/dist/composables/use-network.d.ts +40 -0
- package/dist/composables/use-network.js +85 -0
- package/dist/composables/use-notification.d.ts +98 -0
- package/dist/composables/use-notification.js +94 -0
- package/dist/composables/use-permissions.d.ts +119 -0
- package/dist/composables/use-permissions.js +132 -0
- package/dist/composables/use-query.d.ts +48 -0
- package/dist/composables/use-query.js +0 -0
- package/dist/composables/use-resize-observer.d.ts +60 -0
- package/dist/composables/use-resize-observer.js +157 -0
- package/dist/composables/use-router.d.ts +80 -0
- package/dist/composables/use-router.js +105 -0
- package/dist/composables/use-scroll-lock.d.ts +13 -0
- package/dist/composables/use-scroll-lock.js +55 -0
- package/dist/composables/use-share.d.ts +74 -0
- package/dist/composables/use-share.js +104 -0
- package/dist/composables/use-speech.d.ts +117 -0
- package/dist/composables/use-speech.js +294 -0
- package/dist/composables/use-storage.d.ts +69 -0
- package/dist/composables/use-storage.js +196 -0
- package/dist/composables/use-text-selection.d.ts +121 -0
- package/dist/composables/use-text-selection.js +205 -0
- package/dist/composables/use-timer.d.ts +92 -0
- package/dist/composables/use-timer.js +193 -0
- package/dist/composables/use-utilities.d.ts +103 -0
- package/dist/composables/use-utilities.js +176 -0
- package/dist/composables/use-wake-lock.d.ts +85 -0
- package/dist/composables/use-wake-lock.js +122 -0
- package/dist/composables/use-websocket.d.ts +70 -0
- package/dist/composables/use-websocket.js +165 -0
- package/dist/composables/use-window.d.ts +84 -0
- package/dist/composables/use-window.js +163 -0
- package/dist/composables.d.ts +287 -0
- package/dist/composables.js +562 -0
- package/dist/composition-api.d.ts +197 -0
- package/dist/composition-api.js +199 -0
- package/dist/compression.d.ts +30 -0
- package/dist/compression.js +107 -0
- package/dist/computed.d.ts +138 -0
- package/dist/computed.js +382 -0
- package/dist/conditionals.d.ts +48 -0
- package/dist/conditionals.js +626 -0
- package/dist/config.d.ts +77 -0
- package/dist/config.js +828 -0
- package/dist/cookie-serialize.d.ts +40 -0
- package/dist/cookie-serialize.js +18 -0
- package/dist/craft-bridge.d.ts +525 -0
- package/dist/craft-bridge.js +511 -0
- package/dist/craft-compiler.d.ts +245 -0
- package/dist/craft-compiler.js +810 -0
- package/dist/craft-components.d.ts +739 -0
- package/dist/craft-components.js +1074 -0
- package/dist/craft-entry.d.ts +6 -0
- package/dist/craft-entry.js +9 -0
- package/dist/craft-ssr.d.ts +147 -0
- package/dist/craft-ssr.js +559 -0
- package/dist/craft.js +9 -0
- package/dist/csp.d.ts +295 -0
- package/dist/csp.js +220 -0
- package/dist/csrf.d.ts +38 -0
- package/dist/csrf.js +38 -0
- package/dist/custom-directives.d.ts +5 -0
- package/dist/custom-directives.js +136 -0
- package/dist/database.d.ts +391 -0
- package/dist/database.js +5 -0
- package/dist/defer.d.ts +28 -0
- package/dist/defer.js +156 -0
- package/dist/deploy/config-generators.d.ts +75 -0
- package/dist/deploy/config-generators.js +214 -0
- package/dist/deploy/index.d.ts +88 -0
- package/dist/deploy/index.js +203 -0
- package/dist/deploy/netlify.d.ts +109 -0
- package/dist/deploy/netlify.js +167 -0
- package/dist/desktop.d.ts +16 -0
- package/dist/desktop.js +1 -0
- package/dist/dev-server/index.d.ts +22 -0
- package/dist/dev-server/index.js +7 -0
- package/dist/dev-server/keyboard-shortcuts.d.ts +34 -0
- package/dist/dev-server/keyboard-shortcuts.js +81 -0
- package/dist/dev-server/native-window.d.ts +59 -0
- package/dist/dev-server/native-window.js +91 -0
- package/dist/dev-server/port-utils.d.ts +27 -0
- package/dist/dev-server/port-utils.js +40 -0
- package/dist/dev-server/serve-app.d.ts +15 -0
- package/dist/dev-server/serve-app.js +727 -0
- package/dist/dev-server/serve-file.d.ts +3 -0
- package/dist/dev-server/serve-file.js +443 -0
- package/dist/dev-server/serve-markdown.d.ts +3 -0
- package/dist/dev-server/serve-markdown.js +284 -0
- package/dist/dev-server/serve-multi.d.ts +5 -0
- package/dist/dev-server/serve-multi.js +596 -0
- package/dist/dev-server/terminal-colors.d.ts +56 -0
- package/dist/dev-server/terminal-colors.js +45 -0
- package/dist/dev-server/theme-selector.d.ts +32 -0
- package/dist/dev-server/theme-selector.js +111 -0
- package/dist/dev-server/ts-css.d.ts +108 -0
- package/dist/dev-server/ts-css.js +438 -0
- package/dist/dev-server/types.d.ts +99 -0
- package/dist/dev-server/types.js +43 -0
- package/dist/dev-server.d.ts +6 -0
- package/dist/dev-server.js +4 -0
- package/dist/devtools.d.ts +182 -0
- package/dist/devtools.js +593 -0
- package/dist/directive-api.d.ts +154 -0
- package/dist/directive-api.js +355 -0
- package/dist/docs.d.ts +56 -0
- package/dist/docs.js +567 -0
- package/dist/doctor.d.ts +29 -0
- package/dist/doctor.js +123 -0
- package/dist/document-shell.d.ts +218 -0
- package/dist/document-shell.js +338 -0
- package/dist/dynamic-components.d.ts +23 -0
- package/dist/dynamic-components.js +197 -0
- package/dist/edge-runtime.d.ts +193 -0
- package/dist/edge-runtime.js +525 -0
- package/dist/env.d.ts +3 -0
- package/dist/env.js +9 -0
- package/dist/error-boundaries.d.ts +78 -0
- package/dist/error-boundaries.js +281 -0
- package/dist/error-handling.d.ts +14 -0
- package/dist/error-handling.js +1 -0
- package/dist/errors/codes.d.ts +92 -0
- package/dist/errors/codes.js +97 -0
- package/dist/errors/formatter.d.ts +84 -0
- package/dist/errors/formatter.js +196 -0
- package/dist/errors/index.d.ts +12 -0
- package/dist/errors/index.js +44 -0
- package/dist/errors/logger.d.ts +135 -0
- package/dist/errors/logger.js +250 -0
- package/dist/errors/sanitizer.d.ts +73 -0
- package/dist/errors/sanitizer.js +181 -0
- package/dist/errors/types.d.ts +92 -0
- package/dist/errors/types.js +86 -0
- package/dist/events.d.ts +145 -0
- package/dist/events.js +396 -0
- package/dist/expressions.d.ts +180 -0
- package/dist/expressions.js +719 -0
- package/dist/find-body-tag.d.ts +50 -0
- package/dist/find-body-tag.js +57 -0
- package/dist/formatter.d.ts +19 -0
- package/dist/formatter.js +265 -0
- package/dist/forms-validation.d.ts +189 -0
- package/dist/forms-validation.js +421 -0
- package/dist/forms.d.ts +224 -0
- package/dist/forms.js +729 -0
- package/dist/fragment-container.d.ts +57 -0
- package/dist/fragment-container.js +123 -0
- package/dist/framework-composables.d.ts +73 -0
- package/dist/framework-composables.js +126 -0
- package/dist/head-injection.d.ts +61 -0
- package/dist/head-injection.js +28 -0
- package/dist/head.d.ts +282 -0
- package/dist/head.js +231 -0
- package/dist/heatmap.d.ts +206 -0
- package/dist/heatmap.js +566 -0
- package/dist/hot-reload.d.ts +87 -0
- package/dist/hot-reload.js +373 -0
- package/dist/html-masking.d.ts +125 -0
- package/dist/html-masking.js +196 -0
- package/dist/hydration-runtime.d.ts +44 -0
- package/dist/hydration-runtime.js +195 -0
- package/dist/hydration.d.ts +135 -0
- package/dist/hydration.js +654 -0
- package/dist/i18n.d.ts +342 -0
- package/dist/i18n.js +678 -0
- package/dist/image-optimization/auto-sibling.d.ts +42 -0
- package/dist/image-optimization/auto-sibling.js +88 -0
- package/dist/image-optimization/build-plugin.d.ts +54 -0
- package/dist/image-optimization/build-plugin.js +241 -0
- package/dist/image-optimization/component.d.ts +46 -0
- package/dist/image-optimization/component.js +244 -0
- package/dist/image-optimization/directive.d.ts +30 -0
- package/dist/image-optimization/directive.js +203 -0
- package/dist/image-optimization/index.d.ts +156 -0
- package/dist/image-optimization/index.js +54 -0
- package/dist/image-optimization/processor.d.ts +140 -0
- package/dist/image-optimization/processor.js +262 -0
- package/dist/image-optimization/serve.d.ts +54 -0
- package/dist/image-optimization/serve.js +102 -0
- package/dist/import-rebase.d.ts +16 -0
- package/dist/import-rebase.js +16 -0
- package/dist/imported-signals.d.ts +43 -0
- package/dist/imported-signals.js +35 -0
- package/dist/includes.d.ts +171 -0
- package/dist/includes.js +764 -0
- package/dist/index.d.ts +365 -0
- package/dist/index.js +202 -0
- package/dist/init.d.ts +39 -0
- package/dist/init.js +505 -0
- package/dist/inline-assets.d.ts +28 -0
- package/dist/inline-assets.js +82 -0
- package/dist/interactive.d.ts +14 -0
- package/dist/interactive.js +383 -0
- package/dist/internal-markdown.d.ts +22 -0
- package/dist/internal-markdown.js +141 -0
- package/dist/island-chunking.d.ts +48 -0
- package/dist/island-chunking.js +52 -0
- package/dist/isolated-build.d.ts +12 -0
- package/dist/isolated-build.js +18 -0
- package/dist/js-ts.d.ts +10 -0
- package/dist/js-ts.js +60 -0
- package/dist/jsx-runtime.d.ts +92 -0
- package/dist/jsx-runtime.js +289 -0
- package/dist/keep-alive.d.ts +108 -0
- package/dist/keep-alive.js +421 -0
- package/dist/layout-types.d.ts +45 -0
- package/dist/layout-types.js +56 -0
- package/dist/lazy-loader.d.ts +90 -0
- package/dist/lazy-loader.js +245 -0
- package/dist/lazy-module.d.ts +11 -0
- package/dist/lazy-module.js +18 -0
- package/dist/loading-indicator.d.ts +50 -0
- package/dist/loading-indicator.js +322 -0
- package/dist/loops.d.ts +91 -0
- package/dist/loops.js +690 -0
- package/dist/manifest.d.ts +41 -0
- package/dist/manifest.js +31 -0
- package/dist/markdown-view.d.ts +25 -0
- package/dist/markdown-view.js +39 -0
- package/dist/markdown.d.ts +10 -0
- package/dist/markdown.js +68 -0
- package/dist/media/client/blur-up.d.ts +66 -0
- package/dist/media/client/blur-up.js +217 -0
- package/dist/media/client/index.d.ts +93 -0
- package/dist/media/client/index.js +53 -0
- package/dist/media/client/lazy-load.d.ts +74 -0
- package/dist/media/client/lazy-load.js +283 -0
- package/dist/media/client/upload-handler.d.ts +80 -0
- package/dist/media/client/upload-handler.js +354 -0
- package/dist/media/image/component.d.ts +60 -0
- package/dist/media/image/component.js +574 -0
- package/dist/media/image/directive.d.ts +23 -0
- package/dist/media/image/directive.js +160 -0
- package/dist/media/image/editing.d.ts +212 -0
- package/dist/media/image/editing.js +193 -0
- package/dist/media/image/index.d.ts +142 -0
- package/dist/media/image/index.js +80 -0
- package/dist/media/image/placeholder.d.ts +89 -0
- package/dist/media/image/placeholder.js +188 -0
- package/dist/media/image/processor/cache.d.ts +53 -0
- package/dist/media/image/processor/cache.js +51 -0
- package/dist/media/image/processor/index.d.ts +11 -0
- package/dist/media/image/processor/index.js +3 -0
- package/dist/media/image/processor/optimizer.d.ts +24 -0
- package/dist/media/image/processor/optimizer.js +202 -0
- package/dist/media/image/processor/responsive.d.ts +28 -0
- package/dist/media/image/processor/responsive.js +162 -0
- package/dist/media/image/srcset.d.ts +157 -0
- package/dist/media/image/srcset.js +194 -0
- package/dist/media/index.d.ts +331 -0
- package/dist/media/index.js +198 -0
- package/dist/media/manager/embed.d.ts +25 -0
- package/dist/media/manager/embed.js +253 -0
- package/dist/media/protected/component.d.ts +33 -0
- package/dist/media/protected/component.js +235 -0
- package/dist/media/protected/index.d.ts +47 -0
- package/dist/media/protected/index.js +20 -0
- package/dist/media/protected/signature.d.ts +72 -0
- package/dist/media/protected/signature.js +205 -0
- package/dist/media/shared/cache.d.ts +76 -0
- package/dist/media/shared/cache.js +132 -0
- package/dist/media/shared/hash.d.ts +31 -0
- package/dist/media/shared/hash.js +35 -0
- package/dist/media/shared/index.d.ts +7 -0
- package/dist/media/shared/index.js +2 -0
- package/dist/media/types.d.ts +1477 -0
- package/dist/media/types.js +0 -0
- package/dist/media/upload/component.d.ts +9 -0
- package/dist/media/upload/component.js +320 -0
- package/dist/media/upload/index.d.ts +8 -0
- package/dist/media/upload/index.js +1 -0
- package/dist/media/video/directive.d.ts +23 -0
- package/dist/media/video/directive.js +142 -0
- package/dist/media/video/index.d.ts +76 -0
- package/dist/media/video/index.js +583 -0
- package/dist/media/video/processor/cache.d.ts +55 -0
- package/dist/media/video/processor/cache.js +52 -0
- package/dist/media/video/processor/index.d.ts +12 -0
- package/dist/media/video/processor/index.js +4 -0
- package/dist/media/video/processor/streaming.d.ts +26 -0
- package/dist/media/video/processor/streaming.js +197 -0
- package/dist/media/video/processor/thumbnail.d.ts +35 -0
- package/dist/media/video/processor/thumbnail.js +134 -0
- package/dist/media/video/processor/transcoder.d.ts +19 -0
- package/dist/media/video/processor/transcoder.js +283 -0
- package/dist/menubar.d.ts +65 -0
- package/dist/menubar.js +99 -0
- package/dist/method-spoofing.d.ts +20 -0
- package/dist/method-spoofing.js +17 -0
- package/dist/middleware.d.ts +112 -0
- package/dist/middleware.js +40 -0
- package/dist/misc-directives.d.ts +55 -0
- package/dist/misc-directives.js +328 -0
- package/dist/native-build.d.ts +88 -0
- package/dist/native-build.js +575 -0
- package/dist/owned-routes.d.ts +42 -0
- package/dist/owned-routes.js +26 -0
- package/dist/page-action.d.ts +73 -0
- package/dist/page-action.js +91 -0
- package/dist/page-meta.d.ts +38 -0
- package/dist/page-meta.js +16 -0
- package/dist/page-response.d.ts +120 -0
- package/dist/page-response.js +117 -0
- package/dist/parser/directive-parser.d.ts +119 -0
- package/dist/parser/directive-parser.js +249 -0
- package/dist/parser/expression-parser.d.ts +58 -0
- package/dist/parser/expression-parser.js +358 -0
- package/dist/parser/index.d.ts +13 -0
- package/dist/parser/index.js +23 -0
- package/dist/parser/tokenizer.d.ts +77 -0
- package/dist/parser/tokenizer.js +534 -0
- package/dist/partial-hydration.d.ts +123 -0
- package/dist/partial-hydration.js +427 -0
- package/dist/performance-utils.d.ts +318 -0
- package/dist/performance-utils.js +466 -0
- package/dist/placeholder.d.ts +54 -0
- package/dist/placeholder.js +35 -0
- package/dist/plugin-system.d.ts +301 -0
- package/dist/plugin-system.js +214 -0
- package/dist/plugin.d.ts +3 -0
- package/dist/plugin.js +174 -0
- package/dist/precompiler.d.ts +43 -0
- package/dist/precompiler.js +670 -0
- package/dist/process.d.ts +16 -0
- package/dist/process.js +879 -0
- package/dist/production-build.d.ts +163 -0
- package/dist/production-build.js +596 -0
- package/dist/production-builder.d.ts +42 -0
- package/dist/production-builder.js +146 -0
- package/dist/production-server.d.ts +19 -0
- package/dist/production-server.js +208 -0
- package/dist/prop-sentinels.d.ts +31 -0
- package/dist/prop-sentinels.js +7 -0
- package/dist/props.d.ts +216 -0
- package/dist/props.js +224 -0
- package/dist/public-env.d.ts +29 -0
- package/dist/public-env.js +19 -0
- package/dist/pwa/audit.d.ts +42 -0
- package/dist/pwa/audit.js +255 -0
- package/dist/pwa/directives.d.ts +38 -0
- package/dist/pwa/directives.js +332 -0
- package/dist/pwa/icons.d.ts +42 -0
- package/dist/pwa/icons.js +109 -0
- package/dist/pwa/index.d.ts +104 -0
- package/dist/pwa/index.js +47 -0
- package/dist/pwa/inject.d.ts +32 -0
- package/dist/pwa/inject.js +102 -0
- package/dist/pwa/manifest.d.ts +104 -0
- package/dist/pwa/manifest.js +186 -0
- package/dist/pwa/offline.d.ts +8 -0
- package/dist/pwa/offline.js +259 -0
- package/dist/pwa/precache.d.ts +35 -0
- package/dist/pwa/precache.js +116 -0
- package/dist/pwa/service-worker.d.ts +33 -0
- package/dist/pwa/service-worker.js +860 -0
- package/dist/pwa/workbox-strategies.d.ts +100 -0
- package/dist/pwa/workbox-strategies.js +167 -0
- package/dist/pwa/workbox.d.ts +51 -0
- package/dist/pwa/workbox.js +382 -0
- package/dist/pwa.d.ts +52 -0
- package/dist/pwa.js +236 -0
- package/dist/reactive-bindings.d.ts +47 -0
- package/dist/reactive-bindings.js +268 -0
- package/dist/reactive-tracking.d.ts +81 -0
- package/dist/reactive-tracking.js +49 -0
- package/dist/reactive.d.ts +117 -0
- package/dist/reactive.js +593 -0
- package/dist/reactivity.d.ts +206 -0
- package/dist/reactivity.js +574 -0
- package/dist/release.d.ts +1 -0
- package/dist/release.js +1 -0
- package/dist/render-memo.d.ts +40 -0
- package/dist/render-memo.js +33 -0
- package/dist/render.d.ts +54 -0
- package/dist/render.js +153 -0
- package/dist/resolve-stx-targets.d.ts +49 -0
- package/dist/resolve-stx-targets.js +38 -0
- package/dist/route-middleware.d.ts +2 -0
- package/dist/route-middleware.js +17 -0
- package/dist/route-types.d.ts +134 -0
- package/dist/route-types.js +24 -0
- package/dist/router.d.ts +9 -0
- package/dist/router.js +9 -0
- package/dist/routes.d.ts +6 -0
- package/dist/routes.js +14 -0
- package/dist/runtime-globals.d.ts +236 -0
- package/dist/runtime-globals.js +230 -0
- package/dist/runtime-injection.d.ts +113 -0
- package/dist/runtime-injection.js +156 -0
- package/dist/runtime.d.ts +140 -0
- package/dist/runtime.js +94 -0
- package/dist/safe-evaluator.d.ts +165 -0
- package/dist/safe-evaluator.js +461 -0
- package/dist/scaffolding.d.ts +113 -0
- package/dist/scaffolding.js +897 -0
- package/dist/screenshot.d.ts +22 -0
- package/dist/screenshot.js +100 -0
- package/dist/script-classifier.d.ts +41 -0
- package/dist/script-classifier.js +51 -0
- package/dist/script-emit.d.ts +50 -0
- package/dist/script-emit.js +11 -0
- package/dist/script-json.d.ts +36 -0
- package/dist/script-json.js +6 -0
- package/dist/script-validation.d.ts +26 -0
- package/dist/script-validation.js +179 -0
- package/dist/seo.d.ts +225 -0
- package/dist/seo.js +486 -0
- package/dist/serve.d.ts +44 -0
- package/dist/serve.js +233 -0
- package/dist/server-bindings.d.ts +39 -0
- package/dist/server-bindings.js +171 -0
- package/dist/server-components.d.ts +138 -0
- package/dist/server-components.js +427 -0
- package/dist/sfc-template.d.ts +17 -0
- package/dist/sfc-template.js +32 -0
- package/dist/signal-processing.d.ts +222 -0
- package/dist/signal-processing.js +1081 -0
- package/dist/signals-api.d.ts +459 -0
- package/dist/signals-api.js +172 -0
- package/dist/signals.d.ts +41 -0
- package/dist/signals.js +8233 -0
- package/dist/site-builder/build.d.ts +18 -0
- package/dist/site-builder/build.js +252 -0
- package/dist/site-builder/i18n.d.ts +104 -0
- package/dist/site-builder/i18n.js +150 -0
- package/dist/site-builder/index.d.ts +27 -0
- package/dist/site-builder/index.js +16 -0
- package/dist/site-builder/robots.d.ts +2 -0
- package/dist/site-builder/robots.js +26 -0
- package/dist/site-builder/router.d.ts +10 -0
- package/dist/site-builder/router.js +27 -0
- package/dist/site-builder/seo.d.ts +8 -0
- package/dist/site-builder/seo.js +67 -0
- package/dist/site-builder/sitemap.d.ts +10 -0
- package/dist/site-builder/sitemap.js +26 -0
- package/dist/site-builder/theme.d.ts +12 -0
- package/dist/site-builder/theme.js +38 -0
- package/dist/site-builder/types.d.ts +74 -0
- package/dist/site-builder/types.js +0 -0
- package/dist/site-url.d.ts +46 -0
- package/dist/site-url.js +70 -0
- package/dist/slots.d.ts +129 -0
- package/dist/slots.js +286 -0
- package/dist/source-maps.d.ts +98 -0
- package/dist/source-maps.js +350 -0
- package/dist/source-signature.d.ts +45 -0
- package/dist/source-signature.js +20 -0
- package/dist/spa-nav.d.ts +49 -0
- package/dist/spa-nav.js +12 -0
- package/dist/spa-shell.d.ts +21 -0
- package/dist/spa-shell.js +34 -0
- package/dist/ssg.d.ts +357 -0
- package/dist/ssg.js +94 -0
- package/dist/ssr.d.ts +116 -0
- package/dist/ssr.js +339 -0
- package/dist/state-dir.d.ts +36 -0
- package/dist/state-dir.js +22 -0
- package/dist/state-management.d.ts +299 -0
- package/dist/state-management.js +519 -0
- package/dist/store-imports.d.ts +47 -0
- package/dist/store-imports.js +16 -0
- package/dist/store-loader.d.ts +15 -0
- package/dist/store-loader.js +111 -0
- package/dist/stores-client.d.ts +70 -0
- package/dist/stores-client.js +132 -0
- package/dist/story/addons.d.ts +123 -0
- package/dist/story/addons.js +261 -0
- package/dist/story/analytics.d.ts +163 -0
- package/dist/story/analytics.js +235 -0
- package/dist/story/auto-stories.d.ts +38 -0
- package/dist/story/auto-stories.js +158 -0
- package/dist/story/bookmarks.d.ts +102 -0
- package/dist/story/bookmarks.js +277 -0
- package/dist/story/bun-test.d.ts +45 -0
- package/dist/story/bun-test.js +102 -0
- package/dist/story/cli.d.ts +132 -0
- package/dist/story/cli.js +155 -0
- package/dist/story/collect/analyzer.d.ts +33 -0
- package/dist/story/collect/analyzer.js +305 -0
- package/dist/story/collect/index.d.ts +31 -0
- package/dist/story/collect/index.js +27 -0
- package/dist/story/collect/parser.d.ts +17 -0
- package/dist/story/collect/parser.js +129 -0
- package/dist/story/collect/scanner.d.ts +17 -0
- package/dist/story/collect/scanner.js +101 -0
- package/dist/story/collect/tree.d.ts +24 -0
- package/dist/story/collect/tree.js +110 -0
- package/dist/story/commands/build.d.ts +19 -0
- package/dist/story/commands/build.js +172 -0
- package/dist/story/commands/dev.d.ts +23 -0
- package/dist/story/commands/dev.js +78 -0
- package/dist/story/commands/index.d.ts +9 -0
- package/dist/story/commands/index.js +3 -0
- package/dist/story/commands/preview.d.ts +21 -0
- package/dist/story/commands/preview.js +56 -0
- package/dist/story/compiled-output.d.ts +27 -0
- package/dist/story/compiled-output.js +151 -0
- package/dist/story/composition.d.ts +47 -0
- package/dist/story/composition.js +261 -0
- package/dist/story/config-watcher.d.ts +33 -0
- package/dist/story/config-watcher.js +67 -0
- package/dist/story/config.d.ts +29 -0
- package/dist/story/config.js +64 -0
- package/dist/story/context.d.ts +27 -0
- package/dist/story/context.js +27 -0
- package/dist/story/controls/index.d.ts +54 -0
- package/dist/story/controls/index.js +320 -0
- package/dist/story/desktop-preview.d.ts +34 -0
- package/dist/story/desktop-preview.js +105 -0
- package/dist/story/docs-generator.d.ts +30 -0
- package/dist/story/docs-generator.js +187 -0
- package/dist/story/errors.d.ts +47 -0
- package/dist/story/errors.js +239 -0
- package/dist/story/figma-export.d.ts +169 -0
- package/dist/story/figma-export.js +224 -0
- package/dist/story/generator.d.ts +21 -0
- package/dist/story/generator.js +165 -0
- package/dist/story/hmr.d.ts +62 -0
- package/dist/story/hmr.js +131 -0
- package/dist/story/hot-swap.d.ts +46 -0
- package/dist/story/hot-swap.js +207 -0
- package/dist/story/index.d.ts +99 -0
- package/dist/story/index.js +49 -0
- package/dist/story/interactions.d.ts +53 -0
- package/dist/story/interactions.js +225 -0
- package/dist/story/keyboard-shortcuts.d.ts +39 -0
- package/dist/story/keyboard-shortcuts.js +345 -0
- package/dist/story/output.d.ts +115 -0
- package/dist/story/output.js +153 -0
- package/dist/story/performance.d.ts +129 -0
- package/dist/story/performance.js +252 -0
- package/dist/story/presets.d.ts +123 -0
- package/dist/story/presets.js +289 -0
- package/dist/story/props-validation.d.ts +45 -0
- package/dist/story/props-validation.js +215 -0
- package/dist/story/renderer.d.ts +69 -0
- package/dist/story/renderer.js +209 -0
- package/dist/story/search-index.d.ts +47 -0
- package/dist/story/search-index.js +106 -0
- package/dist/story/search.d.ts +56 -0
- package/dist/story/search.js +140 -0
- package/dist/story/server.d.ts +31 -0
- package/dist/story/server.js +965 -0
- package/dist/story/setup.d.ts +56 -0
- package/dist/story/setup.js +78 -0
- package/dist/story/snapshots.d.ts +65 -0
- package/dist/story/snapshots.js +171 -0
- package/dist/story/testing.d.ts +83 -0
- package/dist/story/testing.js +164 -0
- package/dist/story/theme.d.ts +68 -0
- package/dist/story/theme.js +170 -0
- package/dist/story/ts-css.d.ts +29 -0
- package/dist/story/ts-css.js +189 -0
- package/dist/story/types.d.ts +342 -0
- package/dist/story/types.js +0 -0
- package/dist/story/ui/code-panel.d.ts +43 -0
- package/dist/story/ui/code-panel.js +175 -0
- package/dist/story/ui/controls-panel.d.ts +25 -0
- package/dist/story/ui/controls-panel.js +168 -0
- package/dist/story/ui/index.d.ts +8 -0
- package/dist/story/ui/index.js +4 -0
- package/dist/story/ui/navigation.d.ts +55 -0
- package/dist/story/ui/navigation.js +250 -0
- package/dist/story/ui/preview.d.ts +46 -0
- package/dist/story/ui/preview.js +251 -0
- package/dist/story/visual-testing.d.ts +45 -0
- package/dist/story/visual-testing.js +248 -0
- package/dist/streaming.d.ts +238 -0
- package/dist/streaming.js +537 -0
- package/dist/strict-lint.d.ts +52 -0
- package/dist/strict-lint.js +269 -0
- package/dist/strip-literals.d.ts +40 -0
- package/dist/strip-literals.js +149 -0
- package/dist/stx-virtual-ts.d.ts +358 -0
- package/dist/stx-virtual-ts.js +670 -0
- package/dist/stx.d.ts +924 -0
- package/dist/style-scoping.d.ts +42 -0
- package/dist/style-scoping.js +82 -0
- package/dist/suspense.d.ts +98 -0
- package/dist/suspense.js +398 -0
- package/dist/teleport.d.ts +31 -0
- package/dist/teleport.js +109 -0
- package/dist/template-compiler.d.ts +33 -0
- package/dist/template-compiler.js +68 -0
- package/dist/template-hydrator.d.ts +28 -0
- package/dist/template-hydrator.js +95 -0
- package/dist/template-tag-balance.d.ts +32 -0
- package/dist/template-tag-balance.js +93 -0
- package/dist/testing.d.ts +330 -0
- package/dist/testing.js +588 -0
- package/dist/theme-tokens.d.ts +88 -0
- package/dist/theme-tokens.js +71 -0
- package/dist/transitions.d.ts +99 -0
- package/dist/transitions.js +443 -0
- package/dist/ts-css-config.d.ts +71 -0
- package/dist/ts-css-config.js +44 -0
- package/dist/type-checker.d.ts +85 -0
- package/dist/type-checker.js +581 -0
- package/dist/typecheck.d.ts +70 -0
- package/dist/typecheck.js +365 -0
- package/dist/types/component-types.d.ts +248 -0
- package/dist/types/component-types.js +0 -0
- package/dist/types/config-types.d.ts +938 -0
- package/dist/types/config-types.js +0 -0
- package/dist/types/context-types.d.ts +122 -0
- package/dist/types/context-types.js +0 -0
- package/dist/types/csp-types.d.ts +83 -0
- package/dist/types/csp-types.js +0 -0
- package/dist/types/directive-types.d.ts +315 -0
- package/dist/types/directive-types.js +3 -0
- package/dist/types/index.d.ts +20 -0
- package/dist/types/index.js +1 -0
- package/dist/types/pwa-types.d.ts +338 -0
- package/dist/types/pwa-types.js +0 -0
- package/dist/types.d.ts +27 -0
- package/dist/types.js +1 -0
- package/dist/typescript-templates.d.ts +156 -0
- package/dist/typescript-templates.js +386 -0
- package/dist/unresolved-identifiers.d.ts +52 -0
- package/dist/unresolved-identifiers.js +148 -0
- package/dist/utils.d.ts +112 -0
- package/dist/utils.js +1170 -0
- package/dist/validator.d.ts +80 -0
- package/dist/validator.js +171 -0
- package/dist/variable-extractor.d.ts +142 -0
- package/dist/variable-extractor.js +1306 -0
- package/dist/view-composers.d.ts +171 -0
- package/dist/view-composers.js +29 -0
- package/dist/virtual-scrolling.d.ts +127 -0
- package/dist/virtual-scrolling.js +454 -0
- package/dist/visual-editor.d.ts +185 -0
- package/dist/visual-editor.js +735 -0
- package/dist/visual-testing.d.ts +135 -0
- package/dist/visual-testing.js +126 -0
- package/dist/vue-template.d.ts +39 -0
- package/dist/vue-template.js +476 -0
- package/dist/web-components/css-scoping.d.ts +64 -0
- package/dist/web-components/css-scoping.js +210 -0
- package/dist/web-components/index.d.ts +29 -0
- package/dist/web-components/index.js +13 -0
- package/dist/web-components/reactive-generator.d.ts +72 -0
- package/dist/web-components/reactive-generator.js +484 -0
- package/dist/web-components.d.ts +253 -0
- package/dist/web-components.js +1466 -0
- package/dist/x-element.d.ts +42 -0
- package/dist/x-element.js +301 -0
- package/package.json +107 -0
- package/stx.d.ts +924 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$h as n,Th as x,Yh as B,Zh as c,_h as u}from"./chunk-74cv4ta1.js";import{gv as v}from"./chunk-qc1f74ek.js";import{resolve as JJ,basename as WJ,extname as _J,join as LJ}from"path";import{mkdir as QJ}from"fs/promises";var ZJ={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:2000,cacheTranscoded:!0,cacheThumbnails:!0,cacheManifests:!0};class V{config;constructor(K={}){this.config={...ZJ,...K}}async get(K,J){return c(K,J,"video",this.config)}async set(K,J,X){return u(K,J,X,"video",this.config)}async clear(){return n("video",this.config)}updateConfig(K){this.config={...this.config,...K}}}var S=null;function D(K){if(!S)S=new V(K);else if(K)S.updateConfig(K);return S}async function q(K,J,X){let N=X?{directory:`${X.outputDir}/../.cache`}:{};return D(N).get(K,J)}async function b(K,J,X,N){let Z=N?{directory:`${N.outputDir}/../.cache`}:{};return D(Z).set(K,J,X)}async function $J(){return D().clear()}import{resolve as y,basename as P,extname as f,join as U}from"path";import{mkdir as g}from"fs/promises";async function m(){try{return await import("ts-videos")}catch{return null}}async function h(K,J,X,N){let Z=await m();if(!Z)return console.warn("[stx-media] ts-videos not installed, cannot generate poster"),null;try{let $=y(K);if(!await B($))return null;await g(X,{recursive:!0});let Y=await x($),z=P(K,f(K)),G=J.format||"webp",M=J.timestamp||0,E=`${z}-poster-${Y}.${G}`,W=U(X,E),Q=await Z.extractThumbnails($,{timestamps:[M],width:J.width||1280,height:J.height,format:G,quality:J.quality||85,outputDir:X,outputPattern:E.replace(`.${G}`,"")});if(Q&&Q.length>0){let _=Q[0];return{path:W,url:`${N}/${E}`,width:_.width||J.width||1280,height:_.height||720,timestamp:M,size:_.size||0}}return null}catch($){return console.warn(`[stx-media] Failed to generate poster: ${$}`),null}}async function d(K,J,X,N){let Z=await m();if(!Z)return[];try{let $=y(K);if(!await B($))return[];await g(X,{recursive:!0});let Y=await x($),z=P(K,f(K)),G=J.format||"webp",W=(await new Z.Input($).getInfo()).duration||60,Q=J.count||10,_=J.interval||W/Q,O=[];for(let w=0;w<Q&&w*_<W;w++)O.push(w*_);let L=await Z.extractThumbnails($,{timestamps:O,width:J.width||320,format:G,quality:J.quality||80,outputDir:X,outputPattern:`${z}-thumb-${Y}`});if(L&&L.length>0)return L.map((w,j)=>({path:w.path||U(X,`${z}-thumb-${Y}-${j}.${G}`),url:`${N}/${z}-thumb-${Y}-${j}.${G}`,width:w.width||J.width||320,height:w.height||180,timestamp:O[j],size:w.size||0}));return[]}catch($){return console.warn(`[stx-media] Failed to generate thumbnails: ${$}`),[]}}async function zJ(K,J,X,N){let Z=await m();if(!Z)return console.warn("[stx-media] ts-videos not installed, cannot generate sprite sheet"),null;try{let $=y(K);if(!await B($))return null;await g(X,{recursive:!0});let Y=await x($),z=P(K,f(K)),E=(await new Z.Input($).getInfo()).duration||60,W=J.columns||10,Q=J.interval||5,_=J.thumbnailWidth||160,O=J.thumbnailHeight||90,L=J.format||"jpeg",w=Math.ceil(E/Q),j=Math.ceil(w/W),F=`${z}-sprite-${Y}.${L}`,k=U(X,F),T=[];for(let I=0;I<w;I++)T.push(I*Q);let A=await Z.extractThumbnails($,{timestamps:T,width:_,height:O,format:L,quality:J.quality||70,outputDir:U(X,".temp")});if(!A||A.length===0)return null;try{let I=await import("ts-images"),H=W*_,kJ=j*O,jJ=await I.createSprite({images:A.map((YJ)=>YJ.path),columns:W,padding:0,outputPath:k,format:L,quality:J.quality||70});return{url:`${N}/${F}`,path:k,columns:W,rows:j,thumbnailWidth:_,thumbnailHeight:O,interval:Q,totalFrames:w}}catch{return console.warn("[stx-media] ts-images not installed, sprite sheet generation skipped"),null}}catch($){return console.warn(`[stx-media] Failed to generate sprite sheet: ${$}`),null}}import{resolve as r,basename as e,extname as i,join as C}from"path";import{mkdir as R,writeFile as o}from"fs/promises";async function t(){try{return await import("ts-videos")}catch{return null}}var s=[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000},{label:"360p",width:640,height:360,bitrate:600000,audioBitrate:64000}];async function p(K,J,X,N,Z){let $=await t();if(!$)return console.warn("[stx-media] ts-videos not installed, cannot generate HLS manifest"),null;try{let Y=r(K);if(!await B(Y))return null;let z=await x(Y),G=e(K,i(K)),M=C(X,`${G}-${z}-hls`);await R(M,{recursive:!0});let E=J.length>0?J:s,W=Z?.segmentDuration||6,O=(await new $.Input(Y).getInfo()).duration||0,L=[],w=0;for(let k of E){let T=C(M,k.label);await R(T,{recursive:!0});let A=`${k.label}.m3u8`,I=C(T,A);try{let H=await $.generateHLS(Y,{outputDir:T,segmentDuration:W,width:k.width,height:k.height,videoBitrate:k.bitrate,audioBitrate:k.audioBitrate,playlistName:k.label});if(H)L.push({quality:k,url:`${N}/${G}-${z}-hls/${k.label}/${A}`,path:I}),w+=H.segmentCount||Math.ceil(O/W)}catch(H){console.warn(`[stx-media] Failed to generate HLS for ${k.label}: ${H}`)}}if(L.length===0)return null;let j=C(M,"master.m3u8"),F=GJ(L,N,G,z);return await o(j,F),{manifestUrl:`${N}/${G}-${z}-hls/master.m3u8`,manifestPath:j,playlists:L,segmentCount:w,duration:O}}catch(Y){return console.warn(`[stx-media] Failed to generate HLS manifest: ${Y}`),null}}function GJ(K,J,X,N){let Z=["#EXTM3U","#EXT-X-VERSION:3"];for(let $ of K){let{quality:Y}=$,z=Y.bitrate+(Y.audioBitrate||128000),G=`${Y.width}x${Y.height||Math.round(Y.width*9/16)}`;Z.push(`#EXT-X-STREAM-INF:BANDWIDTH=${z},RESOLUTION=${G},NAME="${Y.label}"`,`${Y.label}/${Y.label}.m3u8`)}return Z.join(`
|
|
3
|
+
`)}async function l(K,J,X,N,Z){let $=await t();if(!$)return console.warn("[stx-media] ts-videos not installed, cannot generate DASH manifest"),null;try{let Y=r(K);if(!await B(Y))return null;let z=await x(Y),G=e(K,i(K)),M=C(X,`${G}-${z}-dash`);await R(M,{recursive:!0});let E=J.length>0?J:s,W=Z?.segmentDuration||4,Q=Z?.minBufferTime||2,L=(await new $.Input(Y).getInfo()).duration||0,w=[],j=[];for(let A of E){let I=C(M,A.label);await R(I,{recursive:!0});try{if(await $.generateDASH(Y,{outputDir:I,segmentDuration:W,width:A.width,height:A.height,videoBitrate:A.bitrate,audioBitrate:A.audioBitrate})){if(w.push({bandwidth:A.bitrate,width:A.width,height:A.height||Math.round(A.width*9/16),url:`${N}/${G}-${z}-dash/${A.label}/video`}),A.audioBitrate)j.push({bandwidth:A.audioBitrate,url:`${N}/${G}-${z}-dash/${A.label}/audio`})}}catch(H){console.warn(`[stx-media] Failed to generate DASH for ${A.label}: ${H}`)}}if(w.length===0)return null;let F=C(M,"manifest.mpd"),k=NJ(w,j,L,W,Q);await o(F,k);let T=[{type:"video",representations:w}];if(j.length>0)T.push({type:"audio",representations:j});return{manifestUrl:`${N}/${G}-${z}-dash/manifest.mpd`,manifestPath:F,adaptationSets:T,duration:L}}catch(Y){return console.warn(`[stx-media] Failed to generate DASH manifest: ${Y}`),null}}function NJ(K,J,X,N,Z){let $=a(X),Y=a(Z),z=`<?xml version="1.0" encoding="UTF-8"?>
|
|
4
|
+
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011"
|
|
5
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
6
|
+
xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd"
|
|
7
|
+
type="static"
|
|
8
|
+
mediaPresentationDuration="${$}"
|
|
9
|
+
minBufferTime="${Y}"
|
|
10
|
+
profiles="urn:mpeg:dash:profile:isoff-on-demand:2011">
|
|
11
|
+
<Period>
|
|
12
|
+
<AdaptationSet mimeType="video/mp4" codecs="avc1.64001f" segmentAlignment="true" startWithSAP="1">
|
|
13
|
+
`;for(let G=0;G<K.length;G++){let M=K[G];z+=` <Representation id="video${G}" bandwidth="${M.bandwidth}" width="${M.width}" height="${M.height}">
|
|
14
|
+
<BaseURL>${M.url}/</BaseURL>
|
|
15
|
+
<SegmentBase indexRange="0-999">
|
|
16
|
+
<Initialization range="0-999"/>
|
|
17
|
+
</SegmentBase>
|
|
18
|
+
</Representation>
|
|
19
|
+
`}if(z+=` </AdaptationSet>
|
|
20
|
+
`,J.length>0){z+=` <AdaptationSet mimeType="audio/mp4" codecs="mp4a.40.2" segmentAlignment="true" startWithSAP="1">
|
|
21
|
+
`;for(let G=0;G<J.length;G++){let M=J[G];z+=` <Representation id="audio${G}" bandwidth="${M.bandwidth}">
|
|
22
|
+
<BaseURL>${M.url}/</BaseURL>
|
|
23
|
+
<SegmentBase indexRange="0-999">
|
|
24
|
+
<Initialization range="0-999"/>
|
|
25
|
+
</SegmentBase>
|
|
26
|
+
</Representation>
|
|
27
|
+
`}z+=` </AdaptationSet>
|
|
28
|
+
`}return z+=` </Period>
|
|
29
|
+
</MPD>`,z}function a(K){let J=Math.floor(K/3600),X=Math.floor(K%3600/60),N=Math.floor(K%60),Z="PT";if(J>0)Z+=`${J}H`;if(X>0)Z+=`${X}M`;return Z+=`${N}S`,Z}async function KJ(){try{return await import("ts-videos")}catch{return null}}function MJ(K){switch(K){case"very-low":return 500000;case"low":return 1e6;case"medium":return 2500000;case"high":return 5000000;case"very-high":return 1e7;case"lossless":return 0;default:return 2500000}}function OJ(K){switch(K){case"youtube":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000};case"twitter":return{codec:"h264",maxWidth:1280,maxHeight:720,frameRate:30,bitrate:5000000,audioCodec:"aac",audioBitrate:128000};case"instagram-feed":return{codec:"h264",maxWidth:1080,maxHeight:1080,frameRate:30,bitrate:3500000,audioCodec:"aac",audioBitrate:128000};case"instagram-story":case"instagram-reels":return{codec:"h264",maxWidth:1080,maxHeight:1920,frameRate:30,bitrate:3500000,audioCodec:"aac",audioBitrate:128000};case"tiktok":return{codec:"h264",maxWidth:1080,maxHeight:1920,frameRate:30,bitrate:4000000,audioCodec:"aac",audioBitrate:128000};case"discord":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:60,bitrate:8000000,audioCodec:"aac",audioBitrate:192000};case"linkedin":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,bitrate:5000000,audioCodec:"aac",audioBitrate:128000};case"facebook":return{codec:"h264",maxWidth:1280,maxHeight:720,frameRate:30,bitrate:4000000,audioCodec:"aac",audioBitrate:128000};case"web-progressive":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000,twoPass:!0};case"web-streaming":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000};default:return{}}}async function XJ(K){let J=await KJ();if(!J)return null;try{let X=JJ(K),Z=await new J.Input(X).getInfo();return{duration:Z.duration||0,width:Z.width||0,height:Z.height||0,frameRate:Z.frameRate||0,bitrate:Z.bitrate||0,codec:Z.videoCodec||"",audioCodec:Z.audioCodec}}catch(X){return console.warn(`[stx-media] Failed to analyze video: ${X}`),null}}async function wJ(K,J,X,N){let Z=await KJ();if(!Z)return console.warn("[stx-media] ts-videos not installed, skipping processing"),{src:K,processed:!1};let $=await q(K,J,X);if($)return $;try{let Y=JJ(K);if(!await B(Y))return{src:K,processed:!1,errors:[`Source file not found: ${K}`]};let z=X.outputDir||"dist/videos",G=X.baseUrl||"/videos";await QJ(z,{recursive:!0});let M=await x(Y),E=WJ(K,_J(K)),W={src:K,processed:!0,hash:M};N?.({percentage:5,stage:"analyzing"}),W.metadata=await XJ(Y)||void 0;let Q={};if(J.quality)Q.bitrate=MJ(J.quality);if(J.platform)Object.assign(Q,OJ(J.platform));if(J.transcode)Object.assign(Q,J.transcode);if(Object.keys(Q).length>0||J.process){N?.({percentage:10,stage:"transcoding"});let _=`${E}-${M}.mp4`,O=LJ(z,_);try{let L=await AJ(Y,O,Q,Z,(w)=>N?.({percentage:10+w*0.5,stage:"transcoding"}));if(L)W.transcoded={path:O,url:`${G}/${_}`,duration:L.duration,size:L.size,video:{codec:Q.codec||"h264",width:L.width,height:L.height,bitrate:L.bitrate,frameRate:L.frameRate},audio:L.audioCodec?{codec:Q.audioCodec||"aac",bitrate:Q.audioBitrate||128000,sampleRate:Q.sampleRate||48000,channels:Q.channels||2}:void 0}}catch(L){W.errors=W.errors||[],W.errors.push(`Transcoding failed: ${L}`)}}if(J.generatePoster){N?.({percentage:65,stage:"generating-poster"});let _=typeof J.generatePoster==="object"?J.generatePoster:{timestamp:0},O=await h(Y,_,z,G);if(O)W.poster=O}if(X.thumbnails?.enabled){N?.({percentage:70,stage:"generating-thumbnails"});let _=await d(Y,X.thumbnails,z,G);if(_.length>0)W.thumbnails=_}if(J.streaming){N?.({percentage:80,stage:"generating-manifests"});let _=typeof J.streaming==="object"?J.streaming:X.streaming||{format:"hls"};if(_.format==="hls"||_.format===void 0){let O=await p(Y,_.qualities||X.streaming?.defaultQualities||[],z,G);if(O)W.streaming={...W.streaming,hls:O}}if(_.format==="dash"){let O=await l(Y,_.qualities||X.streaming?.defaultQualities||[],z,G);if(O)W.streaming={...W.streaming,dash:O}}}if(J.spriteSheet)N?.({percentage:90,stage:"generating-sprite-sheet"});return N?.({percentage:100,stage:"complete"}),await b(K,J,W,X),W}catch(Y){return{src:K,processed:!1,errors:[`Processing failed: ${Y}`]}}}async function AJ(K,J,X,N,Z){try{let Y=await new N.Conversion(K,J,{videoCodec:X.codec,videoBitrate:X.bitrate,width:X.maxWidth,height:X.maxHeight,frameRate:X.frameRate,audioCodec:X.audioCodec,audioBitrate:X.audioBitrate,sampleRate:X.sampleRate,channels:X.channels}).run((z)=>{Z?.(z.percentage/100)});return{duration:Y.duration||0,size:Y.size||0,width:Y.width||X.maxWidth||0,height:Y.height||X.maxHeight||0,bitrate:Y.bitrate||X.bitrate||0,frameRate:Y.frameRate||X.frameRate||30,audioCodec:Y.audioCodec}}catch($){return console.error(`[stx-media] Transcoding failed: ${$}`),null}}export{V as eg,q as fg,b as gg,$J as hg,h as ig,d as jg,zJ as kg,p as lg,l as mg,XJ as ng,wJ as og};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./chunk-qc1f74ek.js";var Y=null,S=[],F=new WeakMap;function I(z){let K=z,B=new Set,G={get value(){if(Y){let H=F.get(G);if(!H)H=new Set,F.set(G,H);H.add(Y)}return K},set value(H){if(!Object.is(K,H)){K=H,B.forEach((J)=>J(H));let L=F.get(G);if(L)L.forEach((J)=>J())}},subscribe(H){return B.add(H),()=>B.delete(H)},peek(){return K}};return G}function W(z){return z!==null&&typeof z==="object"&&"value"in z&&"subscribe"in z&&"peek"in z}function P(z){return W(z)?z.value:z}function j(z){let K={};for(let B in z)if(Object.prototype.hasOwnProperty.call(z,B))K[B]=I(z[B]);return K}function D(z){return I(z)}function U(z){let K=typeof z==="function",B=K?z:z.get,G=K?void 0:z.set,H=K?Object.is:z.equals||Object.is,L,J=!0,Q=new Set,X=new Set,_=()=>{if(J=!0,X.size>0){let N=T.value;X.forEach(($)=>$(N))}};function Z(){Q.clear();let N=Y;Y=_,S.push(_);try{return B()}finally{S.pop(),Y=N}}let T={get value(){if(Y){let N=F.get(T);if(!N)N=new Set,F.set(T,N);N.add(Y)}if(J){let N=Z();if(!H(L,N))L=N;J=!1}return L},set value(N){if(G)G(N);else console.warn("Computed property is readonly")},subscribe(N){return X.add(N),()=>X.delete(N)},peek(){if(J)L=B(),J=!1;return L},invalidate(){J=!0},get dirty(){return J},get deps(){return Q}};return T}function x(z,K,B={}){let{immediate:G=!1,deep:H=!1,flush:L="pre",once:J=!1}=B,Q,X=!0,_=!1,Z=()=>{if(W(z))return H?q(z.value):z.value;return z()},T=()=>{if(!X||_)return;let M=Z();if(Q!==void 0&&Object.is(Q,M)&&!H)return;let A=()=>{if(K(M,Q),Q=H?q(M):M,J)$()};if(L==="sync")A();else if(L==="post")queueMicrotask(A);else Promise.resolve().then(A)},N=null;if(W(z))N=z.subscribe(()=>T());else N=U(z).subscribe(()=>T());if(G)Q=void 0,T();else Q=Z();let $=()=>{if(X=!1,N)N(),N=null};return $.pause=()=>{_=!0},$.resume=()=>{_=!1},$}function E(z,K,B={}){let{immediate:G=!1,once:H=!1}=B,L=z.map((T)=>W(T)?T.value:void 0),J=!0,Q=!1,X=()=>{if(!J||Q)return;let T=z.map((N)=>W(N)?N.value:void 0);if(K(T,L),L=[...T],H)Z()},_=z.map((T)=>{if(W(T))return T.subscribe(()=>X());return()=>{}});if(G)X();let Z=()=>{J=!1,_.forEach((T)=>T())};return Z.pause=()=>{Q=!0},Z.resume=()=>{Q=!1},Z}function y(z,K={}){let{flush:B="pre"}=K,G,H=!0,L=!1,J=()=>{if(!H||L)return;if(G)G();let X=Y;Y=J,S.push(J);try{G=z()}finally{S.pop(),Y=X}};if(B==="sync")J();else if(B==="post")queueMicrotask(J);else Promise.resolve().then(J);let Q=()=>{if(H=!1,G)G()};return Q.pause=()=>{L=!0},Q.resume=()=>{L=!1},Q}function C(z,K={},B){let G=/@computed\s*\(\s*(\w+)\s*,\s*(.+?)\s*\)/gi;return z.replace(G,(H,L,J)=>{try{let X=Function(...Object.keys(K),`return ${J}`)(...Object.values(K));return K[L]=X,`<!-- computed: ${L} = ${X} -->`}catch(Q){return`<!-- computed error: ${L} - ${Q} -->`}})}function R(z,K={},B){let G=/@watch\s*\(\s*(\w+)\s*\)\s*([\s\S]*?)@endwatch/gi;return z.replace(G,(H,L,J)=>{return`
|
|
3
|
+
<script data-watch="${`watch-${Math.random().toString(36).substring(2,9)}`}">
|
|
4
|
+
(function() {
|
|
5
|
+
// Watch implementation for ${L}
|
|
6
|
+
const handler = ${J.trim()};
|
|
7
|
+
if (window.__stxState && window.__stxState['${L}']) {
|
|
8
|
+
window.__stxState['${L}'].subscribe(function(newValue) {
|
|
9
|
+
handler(newValue);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
})();
|
|
13
|
+
</script>
|
|
14
|
+
`})}function q(z){if(z===null||typeof z!=="object")return z;if(Array.isArray(z))return z.map((B)=>q(B));if(z instanceof Date)return new Date(z.getTime());if(z instanceof Map){let B=new Map;return z.forEach((G,H)=>B.set(q(H),q(G))),B}if(z instanceof Set){let B=new Set;return z.forEach((G)=>B.add(q(G))),B}let K={};for(let B in z)if(Object.prototype.hasOwnProperty.call(z,B))K[B]=q(z[B]);return K}function O(z,K=100){let B=I(z()),G=null,H=()=>{if(G)clearTimeout(G);G=setTimeout(()=>{B.value=z()},K)};return U(z).subscribe(()=>H()),{get value(){return B.value},set value(J){console.warn("Debounced computed is readonly")},subscribe:B.subscribe,peek:B.peek,invalidate(){H()},get dirty(){return!1},get deps(){return new Set}}}function h(z,K=100){let B=I(z()),G=0,H=()=>{let J=Date.now();if(J-G>=K)G=J,B.value=z()};return U(z).subscribe(()=>H()),{get value(){return B.value},set value(J){console.warn("Throttled computed is readonly")},subscribe:B.subscribe,peek:B.peek,invalidate(){H()},get dirty(){return!1},get deps(){return new Set}}}var g={ref:I,computed:U,watch:x,watchMultiple:E,watchEffect:y,isRef:W,unref:P,toRefs:j,shallowRef:D,debouncedComputed:O,throttledComputed:h,processComputedDirectives:C,processWatchDirectives:R};export{E as watchMultiple,y as watchEffect,x as watch,P as unref,j as toRefs,h as throttledComputed,E as stxWatchMultiple,y as stxWatchEffect,x as stxWatch,P as stxUnref,j as stxToRefs,h as stxThrottledComputed,D as stxShallowRef,I as stxRef,W as stxIsRef,O as stxDebouncedComputed,U as stxComputed,D as shallowRef,I as ref,R as processWatchDirectives,C as processComputedDirectives,W as isRef,g as default,O as debouncedComputed,U as computed};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Kg as T}from"./chunk-dhh5q7qt.js";import{gv as I}from"./chunk-qc1f74ek.js";import E from"fs";import X from"path";import U from"crypto";var _=new Set(["webp","avif","jpeg","png"]),F=new Set(["cover","contain","fill","inside","outside"]),A=new Set([".jpg",".jpeg",".png",".webp",".avif",".gif"]),S=4096,y=80,D="cover";async function g(k,G){let J=G.routePath??"/_stx/img",B=new URL(k.url);if(B.pathname!==J)return null;let $=q(B,G);if(!$.ok)return new Response($.error,{status:$.status,headers:{"Content-Type":"text/plain"}});let{srcFsPath:j,srcUrl:K,width:H,height:v,format:Z,quality:Y,fit:z}=$,C;try{C=E.statSync(j)}catch{return new Response(`Source image not found: ${K}`,{status:404,headers:{"Content-Type":"text/plain"}})}if(!C.isFile())return new Response("Not a file",{status:404,headers:{"Content-Type":"text/plain"}});let N=G.cacheDir??".stx/cache/img";await E.promises.mkdir(N,{recursive:!0});let V=`${j}:${C.mtimeMs}:${C.size}`,O=`${H}x${v}:${Z}:${Y}:${z}`,b=U.createHash("sha256").update(`${V}|${O}`).digest("hex").slice(0,16),Q=X.join(N,`${b}.${Z}`),W={"Content-Type":T(Z),"Cache-Control":"public, max-age=31536000, immutable",ETag:`"${b}"`,"X-Stx-Image-Cache":"HIT"};if(k.headers.get("if-none-match")===`"${b}"`)return new Response(null,{status:304,headers:W});let L=Bun.file(Q);if(await L.exists())return new Response(L,{headers:W});try{let R=Buffer.from(await Bun.file(j).arrayBuffer()),{resizeAndConvert:M}=await P(),w=await M(R,{width:H,height:v,format:Z,quality:Y,fit:z});return await Bun.write(Q,w),W["X-Stx-Image-Cache"]="MISS",new Response(new Uint8Array(w),{headers:W})}catch(R){let M=R.message;return new Response(`Image processing failed: ${M}`,{status:500,headers:{"Content-Type":"text/plain"}})}}function l(k){return async(G)=>{return await g(G,k)??new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain"}})}}function q(k,G){let J=k.searchParams.get("src");if(!J)return{ok:!1,error:"Missing required param: src",status:400};if(!J.startsWith("/"))return{ok:!1,error:"src must be an absolute URL path (start with /)",status:400};if(J.startsWith("//"))return{ok:!1,error:"src must be a local path",status:400};let B=X.extname(J).toLowerCase();if(!A.has(B))return{ok:!1,error:`Unsupported source extension: ${B}`,status:400};let $=X.resolve(G.publicDir),j=X.resolve($,J.slice(1));if(!j.startsWith(`${$}${X.sep}`)&&j!==$)return{ok:!1,error:"src is outside publicDir",status:400};let K=G.maxWidth??S,H=G.maxHeight??S,v=k.searchParams.get("w"),Z=k.searchParams.get("h"),Y=v?Number.parseInt(v,10):0,z=Z?Number.parseInt(Z,10):0;if(v&&(!Number.isFinite(Y)||Y<=0))return{ok:!1,error:"Invalid w (must be positive integer)",status:400};if(Z&&(!Number.isFinite(z)||z<=0))return{ok:!1,error:"Invalid h (must be positive integer)",status:400};if(!v&&!Z)return{ok:!1,error:"At least one of w or h is required",status:400};let C=Math.min(Y||K,K),N=Math.min(z||H,H),V=k.searchParams.get("f")||"webp";if(!_.has(V))return{ok:!1,error:`Invalid f (must be one of: ${[..._].join(", ")})`,status:400};let O=V,b=k.searchParams.get("q"),Q=b?Number.parseInt(b,10):G.defaultQuality??y;if(!Number.isFinite(Q)||Q<1||Q>100)return{ok:!1,error:"Invalid q (must be 1-100)",status:400};let x=k.searchParams.get("fit")||G.defaultFit||D;if(!F.has(x))return{ok:!1,error:`Invalid fit (must be one of: ${[...F].join(", ")})`,status:400};return{ok:!0,srcFsPath:j,srcUrl:J,width:C,height:N,format:O,quality:Q,fit:x}}async function P(){return await import("./chunk-b8rrnqry.js")}
|
|
3
|
+
export{g as Cf,l as Df};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import"./bun-shim.js";// @bun
|
|
2
|
+
var{WebView:F}=globalThis.Bun;import{existsSync as V,mkdirSync as k,readdirSync as O,statSync as E}from"fs";import $ from"path";var C=16384;function X(j){if(/^https?:\/\//.test(j)||j.startsWith("file://"))return j;return`file://${$.resolve(j)}`}function K(j,B,z,L){return new Promise((Q)=>{let J=!1,G,Y,R=()=>{if(!J){if(J=!0,clearTimeout(Y),G)clearTimeout(G);j.onNavigated=void 0,Q()}};Y=setTimeout(R,L),j.onNavigated=()=>{if(!J)G=setTimeout(R,z)};try{let Z=j.navigate(B);if(Z&&typeof Z.catch==="function")Z.catch(R)}catch{R()}})}async function U(j,B,z){let L=`!!document.querySelector(${JSON.stringify(B)})`,Q=Date.now()+z;while(Date.now()<Q){try{if(await j.evaluate(L))return}catch{}await new Promise((J)=>setTimeout(J,100))}}async function _(j){try{let B=await j.evaluate("Math.ceil(Math.max(document.documentElement.scrollHeight, document.documentElement.offsetHeight, document.body ? document.body.scrollHeight : 0, document.body ? document.body.offsetHeight : 0))");return typeof B==="number"&&Number.isFinite(B)&&B>0?Math.min(B,C):0}catch{return 0}}async function x(j,B,z={}){let L=Math.min(z.width??1440,C),Q=Math.min(z.height??2200,C),J=z.waitMs??800,G=z.timeoutMs??15000,Y=z.format??"png",R=X(j),Z=(q)=>new F({width:L,height:q,headless:!0,...z.backend?{backend:z.backend}:{}}),P=Z(Q);try{if(await K(P,R,J,G),z.waitSelector)await U(P,z.waitSelector,G);if(z.fullPage){let H=await _(P);if(H>Q){if(P.close(),P=Z(H),await K(P,R,J,G),z.waitSelector)await U(P,z.waitSelector,G)}}let q=await P.screenshot({encoding:"buffer",format:Y});k($.dirname($.resolve(B)),{recursive:!0}),await Bun.write(B,q)}finally{P.close()}if(!V(B))throw Error(`Screenshot was not produced for ${j}`);return{input:j,output:B,bytes:E(B).size}}async function W(j,B,z={}){k(B,{recursive:!0});let L;if(!/^https?:\/\//.test(j)&&V(j)&&E(j).isDirectory())L=O(j).filter((G)=>G.endsWith(".html")).map((G)=>$.join(j,G));else L=[j];let Q=z.format??"png",J=[];for(let G of L){let Y=/^https?:\/\//.test(G)?new URL(G).pathname.replace(/\W+/g,"-").replace(/^-|-$/g,"")||"index":$.basename(G).replace(/\.html?$/,"");J.push(await x(G,$.join(B,`${Y}.${Q}`),z))}return J}
|
|
3
|
+
export{x as nf,W as of};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ys as _}from"./chunk-xpp135ad.js";import"./chunk-qc1f74ek.js";function W(j,G,H=240){return j.slice(G,G+H)}var v=[{rule:"route-params",pattern:/\blocation\s*\.\s*pathname\s*\.\s*(?:match|split)\s*\(/g,primitive:"useRoute() / useRouteParams() / useRouteParam(name)",why:"parsing the URL by hand re-implements the router and does not update on SPA navigation"},{rule:"alert",pattern:/(?<![.#\w$])(?:(?:window|globalThis)\s*\.\s*)?alert\s*\(/g,primitive:"stxAlert(message)",why:"themed, focus-trapped and non-blocking \u2014 but `await` it if the code after it "+"depended on the native dialog blocking until dismissal",reject:(j)=>/\b(?:async\s+)?function\s+alert\s*\(/.test(j)||/\b(?:const|let|var)\s+alert\s*=/.test(j)},{rule:"search-params",pattern:/new\s+URLSearchParams\s*\(/g,primitive:"useSearchParams()",why:"reactive, and writes back through the router instead of history.replaceState",reject:(j,G)=>{let H=j.indexOf("(",G);if(H===-1)return!0;let Q=j.slice(H+1,j.indexOf(")",H)+1);return!/\b(?:location|search|href|url)\b/i.test(Q)}},{rule:"navigate",pattern:/\blocation\s*\.\s*(?:assign|replace)\s*\(|\blocation\s*\.\s*href\s*=/g,primitive:"navigate(path) / goBack()",why:"a full document load throws away every store and the scroll position; navigate() is an SPA transition",reject:(j,G)=>/^[^\n]*?(?:['"`]\s*)?(?:mailto:|tel:|sms:|https?:\/\/|\/\/)/.test(W(j,G,160))},{rule:"fetch",pattern:/new\s+AbortController\s*\(/g,primitive:"useFetch(url) / useAsyncData(key, fn)",why:"cancellation, loading and error state are already wired; hand-rolling them is where the races live"},{rule:"polling",pattern:/setInterval\s*\(/g,primitive:"useEventSource() / useSSE() / useWebSocket() / useChannel()",why:"polling burns requests and lags; the push primitives are delivered",reject:(j,G)=>!/\bfetch\s*\(|\$fetch\b|useFetch\b|\.get\s*\(|axios\b/.test(W(j,G))},{rule:"debounce",pattern:/\bclearTimeout\s*\(/g,primitive:"useDebounce(fn, ms) / useThrottle(fn, ms)",why:"a hand-held timer handle per call site is the usual source of stale-result bugs",requires:(j)=>/setTimeout\s*\(/.test(j)},{rule:"click-outside",pattern:/document\s*\.\s*addEventListener\s*\(\s*['"](?:click|mousedown|pointerdown)['"]/g,primitive:"useClickOutside(ref, fn)",why:"the document-level listener plus the blur race is exactly what this composable exists to remove"},{rule:"focus",pattern:/\.\s*(?:getElementById|querySelector)\s*\([^)]*\)\s*(?:\?\.)?\s*\.?focus\s*\(/g,primitive:"useFocus(ref) with x-ref",why:"a query by id breaks under nested scopes and SPA navigation; a ref does not"},{rule:"clipboard",pattern:/navigator\s*\.\s*(?:clipboard|share)\b/g,primitive:"useClipboard() / useShare()",why:"permission state, the copied flag and the unsupported-browser fallback are already handled"},{rule:"watch",pattern:/\beffect\s*\(\s*\(\s*\)\s*=>\s*\{[^}]*\bvoid\s+\w+\s*\(\s*\)/g,primitive:"watch(source, cb) / watchMultiple([...], cb)",why:"the `void a(); void b()` dance is a manual dependency list; watch takes one directly"}],U=["confirm","tooltip",...v.map((j)=>j.rule)];function N(j,G){let H=1;for(let Q=0;Q<G;Q++)if(j[Q]===`
|
|
3
|
+
`)H++;return H}function P(j,G){let H=j.lastIndexOf(`
|
|
4
|
+
`,G)+1,Q=j.indexOf(`
|
|
5
|
+
`,G);return j.slice(H,Q===-1?j.length:Q).trim().slice(0,120)}function q(j,G){let H=j.slice(0,G),Q=H.lastIndexOf("function"),X=H.lastIndexOf("=>"),M=Math.max(Q,X);if(M===-1)return!1;let z=j.slice(Math.max(0,M-120),M);return/\basync\b[^;{}]*$/.test(z)}function L(j){return/\b(?:async\s+)?function\s+confirm\s*\(/.test(j)||/\b(?:const|let|var)\s+confirm\s*=/.test(j)||/\bimport\s*\{[^}]*\bconfirm\b[^}]*\}/.test(j)}function O(j,G,H){if(L(j))return j;let Q=/(^|[^\w$.])(?:(?:window|globalThis)\s*\.\s*)?confirm\s*\(/g,X=F(j),M="",z=0,Y;while((Y=Q.exec(X))!==null){let Z=Y.index+Y[1].length,$=N(j,Z),J=P(j,Z);if(/stxConfirm\s*\($/.test(j.slice(0,Z+8)))continue;let D=q(j,Z);if(H.push({file:G,line:$,rule:"confirm",applied:D,snippet:J,reason:D?void 0:"stxConfirm() returns a Promise and native confirm() is synchronous, so this needs `await` inside an async function. Rewriting it here would make the condition always true."}),D)M+=j.slice(z,Z)+"await stxConfirm(",z=Z+(Y[0].length-Y[1].length)}return M+j.slice(z)}function w(j,G,H){let Q=/(<[a-z][\w-]*\b[^>]*?)\stitle=(["'])(.*?)\2/gis,X=C(j),M="",z=0,Y;while((Y=Q.exec(X))!==null){let[Z,$,J,D]=Y,K=N(j,Y.index),B=P(j,Y.index),V=$.match(/^<([A-Za-z][\w-]*)/)?.[1]??"";if(/^[A-Z]/.test(V)){H.push({file:G,line:K,rule:"tooltip",applied:!1,snippet:B,reason:`\`title\` on <${V}> is a component prop, not an HTML attribute \u2014 `+"adding x-tooltip here would put a tooltip on a component and may duplicate text it already renders."});continue}if(/\bx-tooltip[=\s]/.test($)||D.trim()===""){H.push({file:G,line:K,rule:"tooltip",applied:!1,snippet:B,reason:/\bx-tooltip[=\s]/.test($)?"already has x-tooltip":"empty title"});continue}H.push({file:G,line:K,rule:"tooltip",applied:!0,snippet:B}),M+=j.slice(z,Y.index)+`${$} x-tooltip=${J}${D}${J} title=${J}${D}${J}`,z=Y.index+Z.length}return M+j.slice(z)}function C(j){return j.replace(/<!--[\s\S]*?-->/g,(G)=>G.replace(/[^\n]/g," ")).replace(/\{\{--[\s\S]*?--\}\}/g,(G)=>G.replace(/[^\n]/g," "))}function E(j){let G=(H)=>H.replace(/[^\n]/g," ");return j.replace(/\/\*[\s\S]*?\*\//g,G).replace(/\/\/[^\n]*/g,G)}function F(j,G=!1){let H=C(j);return(G?E(H):_(H)).replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi,(X,M)=>/\bclient\b/i.test(M)?X:X.replace(/[^\n]/g," "))}function S(j,G,H,Q){let X=F(j),M=F(j,!0);for(let z of v){if(!H.includes(z.rule))continue;if(z.requires&&!z.requires(j))continue;z.pattern.lastIndex=0;let Y,Z=/['"]/.test(z.pattern.source)?M:X;z.pattern.lastIndex=0;while((Y=z.pattern.exec(Z))!==null){if(z.reject?.(j,Y.index))continue;Q.push({file:G,line:N(j,Y.index),rule:z.rule,applied:!1,snippet:P(j,Y.index),reason:`${z.primitive} \u2014 ${z.why}`})}}}function k(j,G={}){let H=G.rules??U,Q=G.file??"<source>",X=[];S(j,Q,H,X);let M=j;if(H.includes("confirm"))M=O(M,Q,X);if(H.includes("tooltip"))M=w(M,Q,X);X.sort((Z,$)=>Z.line-$.line);let z=new Set,Y=X.filter((Z)=>{let $=`${Z.rule}:${Z.line}`;if(z.has($))return!1;return z.add($),!0});return{code:M,findings:Y}}var I=new Set(["confirm","tooltip"]);function A(j,G){if(j.length===0)return"No hand-rolled equivalents found.";let H=j.filter((z)=>z.applied),Q=j.filter((z)=>!z.applied&&I.has(z.rule)),X=j.filter((z)=>!z.applied&&!I.has(z.rule)),M=[];if(H.length>0){M.push(G?`Rewrote ${H.length} site(s):`:`Would rewrite ${H.length} site(s) (pass --fix):`);for(let z of H)M.push(` ${z.file}:${z.line} [${z.rule}] ${z.snippet}`)}if(Q.length>0){M.push("",`Needs a human \u2014 ${Q.length} site(s):`);for(let z of Q)M.push(` ${z.file}:${z.line} [${z.rule}] ${z.snippet}
|
|
6
|
+
${z.reason}`)}if(X.length>0){M.push("",`An stx primitive already covers this \u2014 ${X.length} site(s):`);for(let z of X)M.push(` ${z.file}:${z.line} [${z.rule}] ${z.snippet}
|
|
7
|
+
use ${z.reason}`)}return M.join(`
|
|
8
|
+
`)}export{A as formatCodemodFindings,k as codemodSource};
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./chunk-qc1f74ek.js";var N=0;function P(){return`eb-${++N}-${Date.now().toString(36)}`}function W(q,z={},A){let j=/@errorBoundary(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@enderrorBoundary/gi;return q.replace(j,(D,F,J,K)=>{let L=P(),M=Q(F||"");return T(L,J.trim(),K.trim(),M)})}function Q(q){let z={},A=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\w+))/g,j;while((j=A.exec(q))!==null){let D=j[1],F=j[2]||j[3]||j[4];switch(D){case"id":z.id=F;break;case"logErrors":z.logErrors=F==="true";break}}return z}function T(q,z,A,j){let D=j.logErrors!==!1;return`
|
|
3
|
+
<div class="stx-error-boundary" data-boundary-id="${q}" data-has-error="false">
|
|
4
|
+
<div class="stx-error-boundary-content" data-boundary-content="${q}">
|
|
5
|
+
${z}
|
|
6
|
+
</div>
|
|
7
|
+
<div class="stx-error-boundary-fallback" data-boundary-fallback="${q}" style="display: none;">
|
|
8
|
+
${A}
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<script>
|
|
12
|
+
(function() {
|
|
13
|
+
const boundaryId = '${q}';
|
|
14
|
+
const logErrors = ${D};
|
|
15
|
+
const boundary = document.querySelector('[data-boundary-id="' + boundaryId + '"]');
|
|
16
|
+
const contentEl = document.querySelector('[data-boundary-content="' + boundaryId + '"]');
|
|
17
|
+
const fallbackEl = document.querySelector('[data-boundary-fallback="' + boundaryId + '"]');
|
|
18
|
+
|
|
19
|
+
if (!boundary || !contentEl || !fallbackEl) return;
|
|
20
|
+
|
|
21
|
+
// Error state
|
|
22
|
+
let hasError = false;
|
|
23
|
+
let lastError = null;
|
|
24
|
+
|
|
25
|
+
// Show error fallback
|
|
26
|
+
function showFallback(error) {
|
|
27
|
+
hasError = true;
|
|
28
|
+
lastError = error;
|
|
29
|
+
boundary.setAttribute('data-has-error', 'true');
|
|
30
|
+
contentEl.style.display = 'none';
|
|
31
|
+
fallbackEl.style.display = '';
|
|
32
|
+
|
|
33
|
+
if (logErrors) {
|
|
34
|
+
console.error('[stx:errorBoundary:' + boundaryId + ']', error);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Dispatch error event
|
|
38
|
+
boundary.dispatchEvent(new CustomEvent('stx:error', {
|
|
39
|
+
detail: { error: error, boundaryId: boundaryId },
|
|
40
|
+
bubbles: true
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Retry function (resets the boundary)
|
|
45
|
+
function retry() {
|
|
46
|
+
hasError = false;
|
|
47
|
+
lastError = null;
|
|
48
|
+
boundary.setAttribute('data-has-error', 'false');
|
|
49
|
+
contentEl.style.display = '';
|
|
50
|
+
fallbackEl.style.display = 'none';
|
|
51
|
+
|
|
52
|
+
// Dispatch retry event
|
|
53
|
+
boundary.dispatchEvent(new CustomEvent('stx:retry', {
|
|
54
|
+
detail: { boundaryId: boundaryId },
|
|
55
|
+
bubbles: true
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Expose retry function
|
|
60
|
+
window['$stxRetry_' + boundaryId.replace(/-/g, '_')] = retry;
|
|
61
|
+
|
|
62
|
+
// Make $retry available within the fallback
|
|
63
|
+
fallbackEl.querySelectorAll('[onclick*="$retry"]').forEach(function(el) {
|
|
64
|
+
const onclick = el.getAttribute('onclick');
|
|
65
|
+
if (onclick) {
|
|
66
|
+
el.setAttribute('onclick', onclick.replace(/\\$retry\\(\\)/g, "window['$stxRetry_" + boundaryId.replace(/-/g, '_') + "']()"));
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// Handle @click="$retry()" syntax
|
|
71
|
+
fallbackEl.querySelectorAll('[\\\\@click*="$retry"]').forEach(function(el) {
|
|
72
|
+
el.addEventListener('click', function(e) {
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
retry();
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// Also check for data-onclick
|
|
79
|
+
fallbackEl.querySelectorAll('[data-onclick*="$retry"]').forEach(function(el) {
|
|
80
|
+
el.addEventListener('click', function(e) {
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
retry();
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// Catch errors in content
|
|
87
|
+
contentEl.addEventListener('error', function(e) {
|
|
88
|
+
showFallback(e.error || new Error('Unknown error'));
|
|
89
|
+
}, true);
|
|
90
|
+
|
|
91
|
+
// Wrap global error handler for this boundary
|
|
92
|
+
const originalOnError = window.onerror;
|
|
93
|
+
window.onerror = function(message, source, lineno, colno, error) {
|
|
94
|
+
// Check if error originated from within this boundary
|
|
95
|
+
if (contentEl.contains(document.activeElement) || isErrorFromBoundary(error)) {
|
|
96
|
+
showFallback(error || new Error(String(message)));
|
|
97
|
+
return true; // Prevent default handling
|
|
98
|
+
}
|
|
99
|
+
if (originalOnError) {
|
|
100
|
+
return originalOnError.apply(this, arguments);
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// Helper to check if error is from this boundary (basic heuristic)
|
|
106
|
+
function isErrorFromBoundary(error) {
|
|
107
|
+
if (!error || !error.stack) return false;
|
|
108
|
+
return error.stack.includes(boundaryId);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Expose error info
|
|
112
|
+
window.STX = window.STX || {};
|
|
113
|
+
window.STX.errorBoundaries = window.STX.errorBoundaries || {};
|
|
114
|
+
window.STX.errorBoundaries[boundaryId] = {
|
|
115
|
+
hasError: function() { return hasError; },
|
|
116
|
+
getError: function() { return lastError; },
|
|
117
|
+
retry: retry,
|
|
118
|
+
showFallback: showFallback
|
|
119
|
+
};
|
|
120
|
+
})();
|
|
121
|
+
</script>
|
|
122
|
+
`}async function U(q,z,A){try{return await q()}catch(j){if(A)A(j instanceof Error?j:Error(String(j)));else console.error("[stx:errorBoundary] SSR Error:",j);return z}}function X(q,z={}){let A=z.onError?(j)=>z.onError(j,{timestamp:Date.now(),boundaryId:"ssr"}):void 0;return(j)=>U(j,q,A)}function Y(){return`
|
|
123
|
+
/* STX Error Boundary Styles */
|
|
124
|
+
.stx-error-boundary {
|
|
125
|
+
position: relative;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.stx-error-boundary[data-has-error="true"] .stx-error-boundary-content {
|
|
129
|
+
display: none;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.stx-error-boundary[data-has-error="true"] .stx-error-boundary-fallback {
|
|
133
|
+
display: block !important;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Default fallback styling (can be overridden) */
|
|
137
|
+
.stx-error-boundary-fallback {
|
|
138
|
+
padding: 1rem;
|
|
139
|
+
border: 1px solid #ef4444;
|
|
140
|
+
border-radius: 0.5rem;
|
|
141
|
+
background-color: #fef2f2;
|
|
142
|
+
color: #991b1b;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.stx-error-boundary-fallback button {
|
|
146
|
+
margin-top: 0.5rem;
|
|
147
|
+
padding: 0.5rem 1rem;
|
|
148
|
+
border: 1px solid #ef4444;
|
|
149
|
+
border-radius: 0.25rem;
|
|
150
|
+
background-color: #ef4444;
|
|
151
|
+
color: white;
|
|
152
|
+
cursor: pointer;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.stx-error-boundary-fallback button:hover {
|
|
156
|
+
background-color: #dc2626;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* Dark mode support */
|
|
160
|
+
@media (prefers-color-scheme: dark) {
|
|
161
|
+
.stx-error-boundary-fallback {
|
|
162
|
+
background-color: #450a0a;
|
|
163
|
+
color: #fecaca;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
`}function Z(){return`
|
|
167
|
+
// STX Error Boundary Runtime
|
|
168
|
+
(function() {
|
|
169
|
+
if (typeof window === 'undefined') return;
|
|
170
|
+
|
|
171
|
+
window.STX = window.STX || {};
|
|
172
|
+
window.STX.errorBoundaries = window.STX.errorBoundaries || {};
|
|
173
|
+
|
|
174
|
+
// Create an error boundary programmatically
|
|
175
|
+
window.STX.createErrorBoundary = function(element, options) {
|
|
176
|
+
options = options || {};
|
|
177
|
+
const boundaryId = 'eb-' + Date.now().toString(36) + '-' + Math.random().toString(36).slice(2);
|
|
178
|
+
|
|
179
|
+
let hasError = false;
|
|
180
|
+
let lastError = null;
|
|
181
|
+
let fallbackContent = options.fallback || '<p>Something went wrong</p>';
|
|
182
|
+
|
|
183
|
+
const contentWrapper = document.createElement('div');
|
|
184
|
+
contentWrapper.className = 'stx-error-boundary-content';
|
|
185
|
+
|
|
186
|
+
const fallbackWrapper = document.createElement('div');
|
|
187
|
+
fallbackWrapper.className = 'stx-error-boundary-fallback';
|
|
188
|
+
fallbackWrapper.style.display = 'none';
|
|
189
|
+
fallbackWrapper.innerHTML = fallbackContent;
|
|
190
|
+
|
|
191
|
+
// Move element's children to content wrapper
|
|
192
|
+
while (element.firstChild) {
|
|
193
|
+
contentWrapper.appendChild(element.firstChild);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
element.appendChild(contentWrapper);
|
|
197
|
+
element.appendChild(fallbackWrapper);
|
|
198
|
+
element.classList.add('stx-error-boundary');
|
|
199
|
+
element.setAttribute('data-boundary-id', boundaryId);
|
|
200
|
+
|
|
201
|
+
function showFallback(error) {
|
|
202
|
+
hasError = true;
|
|
203
|
+
lastError = error;
|
|
204
|
+
element.setAttribute('data-has-error', 'true');
|
|
205
|
+
contentWrapper.style.display = 'none';
|
|
206
|
+
fallbackWrapper.style.display = '';
|
|
207
|
+
if (options.onError) options.onError(error);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function retry() {
|
|
211
|
+
hasError = false;
|
|
212
|
+
lastError = null;
|
|
213
|
+
element.setAttribute('data-has-error', 'false');
|
|
214
|
+
contentWrapper.style.display = '';
|
|
215
|
+
fallbackWrapper.style.display = 'none';
|
|
216
|
+
if (options.onRetry) options.onRetry();
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
window.STX.errorBoundaries[boundaryId] = {
|
|
220
|
+
hasError: function() { return hasError; },
|
|
221
|
+
getError: function() { return lastError; },
|
|
222
|
+
retry: retry,
|
|
223
|
+
showFallback: showFallback
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
return window.STX.errorBoundaries[boundaryId];
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
console.log('[stx] Error boundary runtime initialized');
|
|
230
|
+
})();
|
|
231
|
+
`}export{U as withErrorBoundary,W as processErrorBoundaryDirectives,Z as generateErrorBoundaryRuntime,Y as generateErrorBoundaryCSS,X as createErrorBoundary};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$i as w,_i as O,aj as Z}from"./chunk-9n0gvfrg.js";import{$k as R,gl as U,il as T}from"./chunk-4ww3znrr.js";import{Ol as E,Op as k,Pl as L,Rl as M,dr as C,oo as W}from"./chunk-y11cxbxd.js";import{Wt as B}from"./chunk-v5e1gxwm.js";import $ from"path";var Y=new Map;function b(Q,z){for(let J of Q.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(J[1])z.add(J[1]);for(let J of Q.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let H of(J[1]??"").split(",")){let K=((H.includes(":")?H.split(":").pop():H)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(K))z.add(K)}for(let J of Q.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let H of(J[1]??"").split(",")){let V=H.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(V))z.add(V)}}async function l(Q){let z;if(Q)z=$.resolve(Q);else{let q=await C();z=$.resolve(q.root||process.cwd(),q.storesDir||"stores")}let J=new Bun.Glob("*.ts"),H=[];try{for await(let q of J.scan({cwd:z,absolute:!0})){let y=$.basename(q,".ts");if(["index","types"].includes(y))continue;if(q.includes(".d.ts"))continue;H.push(q)}}catch{return Z(Y,z,"",""),null}let V=()=>[...new Set([...H,...H.flatMap((q)=>R(q))])],K=O(V()),P=w(Y,z,K);if(P!==void 0)return P||null;if(H.length===0)return Z(Y,z,K,""),null;let A=[];for(let q of H){let y=await Bun.file(q).text();A.push({file:q,hasUseStore:/useStore\s*\(/.test(y)})}A.sort((q,y)=>{if(q.hasUseStore===y.hasUseStore)return 0;return q.hasUseStore?1:-1});let N=A.map((q)=>q.file),G=[],X=new Set,F=k({loader:"ts",target:"browser",define:M()});for(let q of N)try{let y=await Bun.file(q).text(),I=$.basename(q,".ts");if(b(y,X),U(y))y=await T(y,q,{projectRoot:process.cwd()});y=W(y),y=E(y),y=L(y),y=y.replace(/^export\s+(default\s+)?/gm,""),y=F.transformSync(y),G.push(`// Store: ${I}
|
|
3
|
+
${y.trim()}`)}catch(y){console.warn(`[stx] Failed to load store ${q}:`,y)}if(G.length===0)return Z(Y,z,K,""),null;let j=G.join(`
|
|
4
|
+
|
|
5
|
+
`),x=`;(function(){
|
|
6
|
+
var __stx = window.stx || {};
|
|
7
|
+
${B.filter((q)=>!X.has(q)&&new RegExp(`\\b${q}\\b`).test(j)).map((q)=>`var ${q} = __stx[${JSON.stringify(q)}];`).join(`
|
|
8
|
+
`)}
|
|
9
|
+
${j}
|
|
10
|
+
})();`;return K=O(V()),Z(Y,z,K,x),x}function a(){Y.clear()}
|
|
11
|
+
export{l as Vi,a as Wi};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import S from"fs";import C from"path";function D(K){let{token:L,baseUrl:V="https://api.netlify.com/api/v1"}=K;async function W(Q,X,Z={}){let H=`${V}${X}`,B={Authorization:`Bearer ${L}`,"User-Agent":"stx-deploy/1.0"},$;if(Z.rawBody)B["Content-Type"]=Z.contentType||"application/octet-stream",$=Z.rawBody;else if(Z.body)B["Content-Type"]="application/json",$=JSON.stringify(Z.body);let Y=await fetch(H,{method:Q,headers:B,body:$});if(!Y.ok){let O=Error(`Netlify API error: ${Y.status} ${Y.statusText}`);O.status=Y.status;try{let E=await Y.json();O.message=E.message||O.message,O.code=E.code,O.details=E}catch{}throw O}let _=await Y.text();if(!_)return{};return JSON.parse(_)}return{async getSite(Q){return W("GET",`/sites/${Q}`)},async listSites(){return W("GET","/sites")},async createSite(Q){let X={};if(Q)X.name=Q;return W("POST","/sites",{body:X})},async createDeploy(Q,X){let Z={files:X.files,draft:X.draft??!0,async:X.async??!0};if(X.title)Z.title=X.title;if(X.branch)Z.branch=X.branch;if(X.functions)Z.functions=X.functions;return W("POST",`/sites/${Q}/deploys`,{body:Z})},async uploadFile(Q,X,Z){let H=X.startsWith("/")?X.slice(1):X;await W("PUT",`/deploys/${Q}/files/${H}`,{rawBody:Z,contentType:"application/octet-stream"})},async uploadFiles(Q,X){let H=[...X],B=async()=>{while(H.length>0){let Y=H.shift();if(Y)await this.uploadFile(Q,Y.path,Y.content)}},$=Array.from({length:Math.min(5,X.length)},()=>B());await Promise.all($)},async getDeploy(Q){return W("GET",`/deploys/${Q}`)},async waitForDeploy(Q,X={}){let{timeout:Z=300000,pollInterval:H=2000,onProgress:B}=X,$=Date.now();while(!0){let Y=await this.getDeploy(Q);if(B)B(Y);if(Y.state==="ready")return Y;if(Y.state==="error"){let _=Error(`Deploy failed: ${Y.error_message||"Unknown error"}`);throw _.status=500,_.details=Y,_}if(Date.now()-$>Z){let _=Error(`Deploy timed out after ${Z}ms`);throw _.status=408,_.details=Y,_}await new Promise((_)=>setTimeout(_,H))}},async lockDeploy(Q){return W("POST",`/deploys/${Q}/lock`)},async unlockDeploy(Q){return W("POST",`/deploys/${Q}/unlock`)}}}async function h(K){let L=await crypto.subtle.digest("SHA-1",K);return Array.from(new Uint8Array(L)).map((W)=>W.toString(16).padStart(2,"0")).join("")}async function x(K,L={}){let{ignore:V=["node_modules",".git",".env*","*.map"]}=L,W=[],Q=new Bun.Glob("**/*");for await(let X of Q.scan({cwd:K,onlyFiles:!0,dot:!1})){if(V.some((_)=>{if(_.includes("*"))return new RegExp(`^${_.replace(/\*/g,".*")}$`).test(X);return X.includes(_)}))continue;let H=`${K}/${X}`,$=await Bun.file(H).arrayBuffer(),Y=await h($);W.push({path:X,content:new Uint8Array($),sha1:Y})}return W}function T(K){let L={};for(let V of K)L[`/${V.path}`]=V.sha1;return L}function v(K,L){let V=new Set(L.map((W)=>W.startsWith("/")?W.slice(1):W));return K.filter((W)=>V.has(W.path))}function z(K){if(K<1024)return`${K} B`;if(K<1048576)return`${(K/1024).toFixed(1)} KB`;if(K<1073741824)return`${(K/1048576).toFixed(1)} MB`;return`${(K/1073741824).toFixed(1)} GB`}function N(K){return K.reduce((L,V)=>L+V.content.byteLength,0)}import U from"fs";import M from"path";function u(K){let L=[];if(L.push("[build]"),L.push(` command = "${G(K.build.command)}"`),L.push(` publish = "${G(K.build.publish)}"`),K.build.functions)L.push(` functions = "${G(K.build.functions)}"`);if(K.build.edge_functions)L.push(` edge_functions = "${G(K.build.edge_functions)}"`);if(K.build.environment&&Object.keys(K.build.environment).length>0){L.push(""),L.push("[build.environment]");for(let[V,W]of Object.entries(K.build.environment))L.push(` ${V} = "${G(W)}"`)}if(K.functions){if(L.push(""),L.push("[functions]"),K.functions.directory)L.push(` directory = "${G(K.functions.directory)}"`);if(K.functions.node_bundler)L.push(` node_bundler = "${K.functions.node_bundler}"`);if(K.functions.external_node_modules&&K.functions.external_node_modules.length>0)L.push(` external_node_modules = [${K.functions.external_node_modules.map((V)=>`"${V}"`).join(", ")}]`)}if(K.edge_functions&&K.edge_functions.length>0){L.push("");for(let V of K.edge_functions)L.push("[[edge_functions]]"),L.push(` function = "${G(V.function)}"`),L.push(` path = "${G(V.path)}"`)}if(K.redirects&&K.redirects.length>0){L.push("");for(let V of K.redirects){if(L.push("[[redirects]]"),L.push(` from = "${G(V.from)}"`),L.push(` to = "${G(V.to)}"`),V.status!==void 0)L.push(` status = ${V.status}`);if(V.force!==void 0)L.push(` force = ${V.force}`);if(V.conditions&&Object.keys(V.conditions).length>0){L.push(" [redirects.conditions]");for(let[W,Q]of Object.entries(V.conditions))L.push(` ${W} = "${G(Q)}"`)}}}if(K.headers&&K.headers.length>0){L.push("");for(let V of K.headers){L.push("[[headers]]"),L.push(` for = "${G(V.for)}"`),L.push(" [headers.values]");for(let[W,Q]of Object.entries(V.values))L.push(` ${W} = "${G(Q)}"`)}}if(K.plugins&&K.plugins.length>0){L.push("");for(let V of K.plugins)if(L.push("[[plugins]]"),L.push(` package = "${G(V.package)}"`),V.inputs&&Object.keys(V.inputs).length>0){L.push(" [plugins.inputs]");for(let[W,Q]of Object.entries(V.inputs))if(typeof Q==="string")L.push(` ${W} = "${G(Q)}"`);else if(typeof Q==="boolean"||typeof Q==="number")L.push(` ${W} = ${Q}`)}}if(K.context&&Object.keys(K.context).length>0)for(let[V,W]of Object.entries(K.context)){if(L.push(""),L.push(`[context.${V}]`),W.command)L.push(` command = "${G(W.command)}"`);if(W.publish)L.push(` publish = "${G(W.publish)}"`);if(W.environment&&Object.keys(W.environment).length>0){L.push(` [context.${V}.environment]`);for(let[Q,X]of Object.entries(W.environment))L.push(` ${Q} = "${G(X)}"`)}}return L.join(`
|
|
3
|
+
`)+`
|
|
4
|
+
`}function G(K){return K.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}async function j(K){let L={framework:"stx",buildCommand:"bun run build",outputDir:"dist"},V=M.join(K,"package.json");if(await Bun.file(V).exists())try{let $=JSON.parse(await Bun.file(V).text());if($.scripts?.build)L.buildCommand="bun run build";let Y={...$.dependencies,...$.devDependencies};if(Y["@stacksjs/stx"]||Y.stx)L.framework="stx"}catch{}let W=M.join(K,"stx.config.ts"),Q=M.join(K,".config","stx.config.ts");if(await Bun.file(W).exists()||await Bun.file(Q).exists())L.framework="stx";let X=["dist","build","out","public",".output"];for(let $ of X){let Y=M.join(K,$);if(U.existsSync(Y)&&U.statSync(Y).isDirectory()){L.outputDir=$;break}}let Z=["functions","netlify/functions","api"];for(let $ of Z){let Y=M.join(K,$);if(U.existsSync(Y)&&U.statSync(Y).isDirectory()){L.functionsDir=$;break}}let H=M.join(K,"netlify","edge-functions");if(U.existsSync(H))L.edgeFunctionsDir="netlify/edge-functions";let B=M.join(K,L.outputDir||"dist");if(U.existsSync(B)){let $=U.existsSync(M.join(B,"index.html")),Y=U.readdirSync(B).filter((_)=>_.endsWith(".html"));L.isSPA=$&&Y.length===1}return L}function q(K={}){let L={build:{command:K.buildCommand||"bun run build",publish:K.outputDir||"dist"}};if(K.functionsDir)L.build.functions=K.functionsDir,L.functions={directory:K.functionsDir,node_bundler:"esbuild"};if(K.edgeFunctionsDir)L.build.edge_functions=K.edgeFunctionsDir;if(L.headers=[{for:"/*",values:{"X-Frame-Options":"DENY","X-Content-Type-Options":"nosniff","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin"}},{for:"/assets/*",values:{"Cache-Control":"public, max-age=31536000, immutable"}}],K.isSPA!==!1)L.redirects=[{from:"/*",to:"/index.html",status:200}];return L.context={production:{environment:{NODE_ENV:"production"}},"deploy-preview":{environment:{NODE_ENV:"development"}}},L}async function b(K,L){let V=await j(K),W=L||q(V),Q=u(W),X=M.join(K,"netlify.toml");return await Bun.write(X,Q),X}function P(K){return U.existsSync(M.join(K,"netlify.toml"))}async function n(K={}){let L=Date.now(),V=[],W=K.cwd||process.cwd(),Q=(A)=>{V.push(A)},X=(A)=>{if(K.onProgress)K.onProgress(A)},Z=C.resolve(W,K.directory||"dist"),H=K.token||process.env.NETLIFY_AUTH_TOKEN,B=K.siteId||process.env.NETLIFY_SITE_ID;if(!H)throw new R(`No Netlify auth token found.
|
|
5
|
+
|
|
6
|
+
To deploy to Netlify:
|
|
7
|
+
1. Create account at https://app.netlify.com
|
|
8
|
+
2. Get token at https://app.netlify.com/user/applications#personal-access-tokens
|
|
9
|
+
3. Set NETLIFY_AUTH_TOKEN environment variable
|
|
10
|
+
|
|
11
|
+
export NETLIFY_AUTH_TOKEN=your_token_here`,"NO_TOKEN");if(!B)throw new R(`No Netlify site ID found.
|
|
12
|
+
|
|
13
|
+
Either:
|
|
14
|
+
1. Set NETLIFY_SITE_ID environment variable
|
|
15
|
+
2. Pass --site-id option
|
|
16
|
+
3. Run \`stx deploy --init\` to set up
|
|
17
|
+
|
|
18
|
+
Find your site ID at: https://app.netlify.com/sites/YOUR_SITE/settings/general`,"NO_SITE_ID");if(!S.existsSync(Z))throw new R(`Build directory not found: ${Z}
|
|
19
|
+
|
|
20
|
+
Run \`stx build\` first or specify a different directory with --directory`,"NO_BUILD_DIR");if(!(S.readdirSync(Z).length>0))throw new R(`Build directory is empty: ${Z}
|
|
21
|
+
|
|
22
|
+
Run \`stx build\` to generate files`,"EMPTY_BUILD_DIR");if(K.dryRun){X({stage:"collect",message:"Collecting files..."});let A=await x(Z),F=N(A);return Q(`Would deploy ${A.length} files (${z(F)})`),Q(`From: ${Z}`),Q(`To: Site ${B}`),Q(`Mode: ${K.production?"production":"draft"}`),{success:!0,url:`https://${B}.netlify.app (dry-run)`,deployId:"dry-run",logs:V,duration:Date.now()-L,filesUploaded:A.length,totalSize:F}}let Y=D({token:H});X({stage:"collect",message:"Verifying site..."});try{let A=await Y.getSite(B);Q(`Deploying to: ${A.name} (${A.url})`)}catch(A){if(A.status===404)throw new R(`Site not found: ${B}
|
|
23
|
+
|
|
24
|
+
Check your site ID or create a new site at https://app.netlify.com`,"SITE_NOT_FOUND");throw A}X({stage:"collect",message:"Collecting files..."});let _=await x(Z),O=N(_);if(Q(`Found ${_.length} files (${z(O)})`),_.length===0)throw new R(`No files found in ${Z}`,"NO_FILES");let E=T(_);X({stage:"upload",message:"Creating deploy...",percent:0});let k=await Y.createDeploy(B,{title:K.message||"Deploy from stx CLI",draft:!K.production,files:E});Q(`Created deploy: ${k.id}`);let w=v(_,k.required||[]);if(Q(`Uploading ${w.length} files...`),w.length>0){let A=0,F=N(w);for(let I of w){await Y.uploadFile(k.id,I.path,I.content),A++;let y=Math.round(A/w.length*100);X({stage:"upload",message:`Uploading: ${I.path}`,percent:y,details:{uploaded:A,total:w.length}})}Q(`Uploaded ${z(F)}`)}else Q("All files already on CDN (no upload needed)");X({stage:"process",message:"Processing deploy..."});let J=await Y.waitForDeploy(k.id,{onProgress:(A)=>{X({stage:"process",message:`Status: ${A.state}`,details:A})}}),m=Date.now()-L;if(X({stage:"done",message:"Deploy complete!"}),Q(`Deploy complete in ${(m/1000).toFixed(1)}s`),Q(`URL: ${J.deploy_ssl_url}`),K.production)Q(`Site: ${J.ssl_url}`);if(K.open){let A=K.production?J.ssl_url:J.deploy_ssl_url;d(A)}return{success:!0,url:J.deploy_ssl_url,siteUrl:K.production?J.ssl_url:void 0,deployId:J.id,logs:V,duration:m,filesUploaded:w.length,totalSize:N(w)}}async function i(K={}){let L=K.directory||process.cwd(),V;if(P(L))V=C.join(L,"netlify.toml");else{let W=await j(L);V=await b(L,q(W))}if(K.siteId){let W=C.join(L,".env.local"),Q="";if(await Bun.file(W).exists()){if(Q=await Bun.file(W).text(),Q=Q.split(`
|
|
25
|
+
`).filter((X)=>!X.startsWith("NETLIFY_SITE_ID=")).join(`
|
|
26
|
+
`),Q&&!Q.endsWith(`
|
|
27
|
+
`))Q+=`
|
|
28
|
+
`}Q+=`NETLIFY_SITE_ID=${K.siteId}
|
|
29
|
+
`,await Bun.write(W,Q)}return{configPath:V,siteId:K.siteId}}class R extends Error{code;constructor(K,L){super(K);this.name="DeployError",this.code=L}}function d(K){let L=process.platform,V=L==="darwin"?"open":L==="win32"?"start":"xdg-open";Bun.spawn([V,K],{stdio:["ignore","ignore","ignore"]})}
|
|
30
|
+
export{D as Rf,h as Sf,x as Tf,T as Uf,v as Vf,z as Wf,N as Xf,u as Yf,j as Zf,q as _f,b as $f,P as ag,n as bg,i as cg,R as dg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Qf as a}from"./chunk-pzm13sdc.js";import"./chunk-rbb7dvja.js";import"./chunk-y11cxbxd.js";import"./chunk-92mj1t26.js";import"./chunk-8mjdpr94.js";import"./chunk-pkaabd8h.js";import"./chunk-xpp135ad.js";import"./chunk-wrzwgkbx.js";import"./chunk-5kk8gsj2.js";import"./chunk-38ejahd9.js";import"./chunk-ypmqf7tm.js";import"./chunk-de7fye10.js";import"./chunk-v5e1gxwm.js";import"./chunk-b6ej2fdf.js";import"./chunk-x650vjcp.js";import"./chunk-qc1f74ek.js";export{a as startProductionServer};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{hf as c,if as d,jf as e,kf as f,lf as g,mf as h}from"./chunk-ferav3bw.js";import{Ug as a,Xg as b}from"./chunk-qr82je1m.js";import"./chunk-z4jhj5e5.js";import"./chunk-9n0gvfrg.js";import"./chunk-y11cxbxd.js";import"./chunk-92mj1t26.js";import"./chunk-8mjdpr94.js";import"./chunk-pkaabd8h.js";import"./chunk-xpp135ad.js";import"./chunk-wrzwgkbx.js";import"./chunk-5kk8gsj2.js";import"./chunk-38ejahd9.js";import"./chunk-ypmqf7tm.js";import"./chunk-de7fye10.js";import"./chunk-v5e1gxwm.js";import"./chunk-b6ej2fdf.js";import"./chunk-x650vjcp.js";import"./chunk-qc1f74ek.js";export{d as virtualPathFor,g as typecheckStxFiles,e as sourcePathFor,h as formatTypecheckDiagnostics,f as findRuntimeTypeDeclarations,b as extractTemplateExpressions,a as extractScriptBlocks,c as buildVirtualSource};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{existsSync as U,statSync as V}from"fs";import z from"path";var W=/[*?[\]{}]/;function X(D){return W.test(D)}async function $(D,E={}){let H=E.cwd??process.cwd(),N=E.recursive!==!1,Q=E.ignorePaths??[],J=globalThis.Bun.Glob,K=new Set,F=(j)=>{if(j.includes(`${z.sep}node_modules${z.sep}`)||j.includes(`${z.sep}dist${z.sep}`))return;if(Q.some((q)=>q&&j.includes(z.normalize(q))))return;K.add(j)},R=async(j)=>{try{for await(let q of new J(j).scan({cwd:H,absolute:!0}))F(q)}catch{}};for(let j of D){if(!j)continue;if(X(j)){await R(j);continue}let q=z.resolve(H,j);if(!U(q))continue;if(V(q).isDirectory()){for await(let T of new J(N?"**/*.stx":"*.stx").scan({cwd:q,absolute:!0}))F(T);continue}F(q)}return[...K].sort()}
|
|
3
|
+
export{X as Vs,$ as Ws};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import"./bun-shim.js";// @bun
|
|
2
|
+
import{ih as t,jh as e,lh as b,uh as JJ}from"./chunk-rbb7dvja.js";import{Mm as u,Nm as l,ao as o,fm as y,gm as P,pm as x,to as g,wm as v}from"./chunk-y11cxbxd.js";import{Uu as s,Yu as OJ,ru as a}from"./chunk-b6ej2fdf.js";import{gv as R}from"./chunk-qc1f74ek.js";import r from"fs";import B from"path";var{serve:IJ}=globalThis.Bun;function q(J,K,Q={}){let X=`${encodeURIComponent(J)}=${encodeURIComponent(K)}`;if(Q.maxAge!==void 0)X+=`; Max-Age=${Q.maxAge}`;if(Q.expires)X+=`; Expires=${Q.expires.toUTCString()}`;if(Q.path)X+=`; Path=${Q.path}`;if(Q.domain)X+=`; Domain=${Q.domain}`;if(Q.secure)X+="; Secure";if(Q.httpOnly)X+="; HttpOnly";if(Q.sameSite)X+=`; SameSite=${Q.sameSite}`;return X}async function KJ(J){let K=J.headers.get("content-type")||"",Q={},X=(Z,$)=>{let G=Q[Z];if(G===void 0)Q[Z]=$;else if(Array.isArray(G))G.push($);else Q[Z]=[G,$]};if(K.includes("multipart/form-data")){let Z=await J.formData();for(let[$,G]of Z.entries())if(typeof G==="string")X($,G);return Q}if(K.includes("application/x-www-form-urlencoded")){for(let[Z,$]of new URLSearchParams(await J.text()).entries())X(Z,$);return Q}return Q}function f(J){if(!J)return!1;let K=J.toUpperCase();return K!=="GET"&&K!=="HEAD"}async function h(J,K={}){let Q=K.request,X=K.method??Q?.method;if(!Q||!f(X))return{ran:!1};if(typeof J.action!=="function")return{ran:!1};let Z={};try{Z=await KJ(Q)}catch{}let $=await J.action({request:Q,form:Z,params:K.params??{},query:J.query??{},cookies:K.cookies??{}});if($&&typeof $==="object"){let G=$,W=QJ(G.cookies),I=G.redirect;if(typeof I==="string"&&I)return{redirect:I,ran:!0,...W.length>0?{cookies:W}:{}};let{cookies:_,redirect:N,...U}=G;if(Object.assign(J,U),W.length>0)return{ran:!0,cookies:W}}return{ran:!0}}function QJ(J){if(!J||typeof J!=="object"||Array.isArray(J))return[];let K=[];for(let[Q,X]of Object.entries(J)){if(!Q)continue;if(typeof X==="string"){K.push(q(Q,X));continue}if(X&&typeof X==="object"){let Z=X;if(typeof Z.value!=="string")continue;K.push(q(Q,Z.value,Z))}}return K}function m(J,K=[],Q){let X=new Headers({Location:J,"Cache-Control":"no-store"});for(let Z of K)X.append("Set-Cookie",Z);for(let[Z,$]of Object.entries(Q??{}))if(Z.toLowerCase()!=="location")X.set(Z,$);return new Response(null,{status:303,headers:X})}async function wJ(J,K={}){return(await c(J,K)).html}async function d(J,K={}){let{html:Q,context:X,redirect:Z,cookies:$}=await c(J,K),G=u(X),W=l(X);if(Z)return{html:Q,redirect:Z,cookies:$,status:G,headers:W};let{extractStreamBoundaries:I}=await import("./chunk-9b22663r.js"),_=I(X),N=J.streamTemplates;if(N&&Object.keys(N).length>0){let{processDirectives:U}=await import("./chunk-r7r66978.js"),{defaultConfig:z}=await import("./chunk-ydrz60kr.js"),O=X.streamBoundaries||{},w={...z,autoShell:!1},D=Object.keys(N).map((V)=>({id:V,render:async()=>{let F=typeof O[V]==="function"?await O[V]():void 0;return U(N[V],{...X,$boundary:F},J.sourceFile,w,new Set)}})),E=new Set(D.map((V)=>V.id));_=[...(_||[]).filter((V)=>!E.has(V.id)),...D]}return{html:Q,boundaries:_&&_.length>0?_:void 0,cookies:$,status:G,headers:W}}async function c(J,K){let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...K};if(!J.hasServerScripts&&!P(J.html))return{html:J.html,context:Q};for(let $ of J.serverScriptContent)try{await g($,Q,J.sourceFile)}catch(G){console.warn(`[stx] Server script error in ${J.sourceFile}:`,G)}let X=await h(Q,{request:K.request,method:K.method,params:K.params??{},cookies:K.cookies??{}});if(X.redirect)return{html:J.html,context:Q,redirect:X.redirect,cookies:X.cookies};if(!P(J.html))return{html:J.html,context:Q,cookies:X.cookies};let Z=new Map;for(let[$,G]of Object.entries(J.placeholders))if(G.expression)try{let W=v(G.expression,Q);if(G.type==="raw")Z.set($,W!==void 0&&W!==null?String(W):"");else Z.set($,W!==void 0&&W!==null?x(String(W)):"")}catch{Z.set($,"")}return{html:y(J.html,Z),context:Q,cookies:X.cookies}}async function AJ(J,K={}){if(!J.hasServerScripts&&!P(J.fragment))return J.fragment;let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...K};for(let Z of J.serverScriptContent)try{await g(Z,Q,J.sourceFile)}catch($){console.warn(`[stx] Server script error in ${J.sourceFile}:`,$)}if(!P(J.fragment))return J.fragment;let X=new Map;for(let[Z,$]of Object.entries(J.placeholders))if($.expression)try{let G=v($.expression,Q);if($.type==="raw")X.set(Z,G!==void 0&&G!==null?String(G):"");else X.set(Z,G!==void 0&&G!==null?x(String(G)):"")}catch{X.set(Z,"")}return y(J.fragment,X)}OJ();import C from"zlib";import{promisify as n}from"util";var XJ=n(C.brotliCompress),ZJ=n(C.gzip),$J=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],GJ=["text/event-stream","multipart/x-mixed-replace"],UJ=1024;function WJ(J){if(!J)return!1;let K=J.toLowerCase();if(GJ.some((Q)=>K.startsWith(Q)))return!1;return $J.some((Q)=>K.startsWith(Q))}function jJ(J){let K=new Map;for(let Q of J.split(",")){let[X,...Z]=Q.trim().split(";"),$=X.trim().toLowerCase();if(!$)continue;let G=1;for(let W of Z){let I=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(W);if(!I)continue;let _=Number.parseFloat(I[1]);if(Number.isFinite(_))G=_}K.set($,G)}return K}function YJ(J){if(!J)return null;let K=jJ(J),Q=K.get("*"),X=(Z)=>K.get(Z)??Q??0;if(X("br")>0)return"br";if(X("gzip")>0)return"gzip";return null}async function i(J,K,Q={}){if(K.headers.get("content-encoding"))return K;if(K.status===204||K.status===304||!K.body)return K;if(!WJ(K.headers.get("content-type")))return K;let X=YJ(J.headers.get("accept-encoding"));if(!X)return K;let Z;try{Z=new Uint8Array(await K.arrayBuffer())}catch{return K}let $=()=>new Response(Z,{status:K.status,statusText:K.statusText,headers:p(K.headers)});if(Z.length<(Q.threshold??UJ))return $();try{let G=X==="br"?await XJ(Z,{params:{[C.constants.BROTLI_PARAM_QUALITY]:Q.quality??5,[C.constants.BROTLI_PARAM_SIZE_HINT]:Z.length}}):await ZJ(Z);if(G.length>=Z.length)return $();let W=p(K.headers);return W.set("Content-Encoding",X),W.set("Content-Length",String(G.length)),new Response(G,{status:K.status,statusText:K.statusText,headers:W})}catch{return $()}}function p(J){let K=new Headers(J),Q=K.get("Vary");if(!Q)return K.set("Vary","Accept-Encoding"),K;if(!Q.split(",").some((Z)=>Z.trim().toLowerCase()==="accept-encoding"))K.set("Vary",`${Q}, Accept-Encoding`);return K}var _J={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function mJ(J={}){let K=B.resolve(J.outputDir||".output"),Q=J.port||3000,X=JJ(K);if(!X)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${X.routes.length} routes...`);let Z=new Map,$=new Map,G=new Map,W=new Map;for(let U of X.routes)try{let z=B.join(K,U.compiledPath),O=JSON.parse(await Bun.file(z).text());Z.set(U.pattern,O),G.set(U.pattern,s(O.html)),W.set(U.pattern,o(O.html));let w=B.join(K,U.fragmentPath);if(await Bun.file(w).exists())$.set(U.pattern,await Bun.file(w).text())}catch(z){console.warn(`[stx] Failed to load route ${U.pattern}:`,z)}let I=new Map,_=[];for(let U of X.routes)if(U.hasParams){let{regex:z,params:O}=a(U.pattern);_.push({regex:z,route:U,paramNames:O})}else I.set(U.pattern,U);let N=IJ({port:Q,async fetch(U){return i(U,await(async()=>{let O=new URL(U.url).pathname;if(J.onRequest){let j=await J.onRequest(U);if(j)return j}if(J.apiRoutes?.[O])return J.apiRoutes[O](U);if((U.method==="GET"||U.method==="HEAD")&&O!=="/"){let j=B.resolve(K,"public"),Y;try{Y=decodeURIComponent(O)}catch{Y=O}if(!Y.includes("\x00")){let L=B.resolve(j,`.${Y}`);if(L===j||L.startsWith(`${j}${B.sep}`))try{if(r.existsSync(L)&&r.statSync(L).isFile()){let M=B.extname(L).toLowerCase(),S=_J[M]||"application/octet-stream",H=O.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(O);return new Response(Bun.file(L),{headers:{"Content-Type":S,"Cache-Control":H?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let w=e(U),D=null,E={};if(D=I.get(O)||null,!D)for(let{regex:j,route:Y,paramNames:L}of _){let A=O.match(j);if(A){D=Y,L.forEach((M,S)=>{E[M]=A[S+1]});break}}if(!D){let j=I.get("/404")||null;if(j){let Y=Z.get(j.pattern);if(Y)return new Response(Y.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}if(w){let j=$.get(D.pattern);if(j){let Y=G.get(D.pattern);return new Response(j,{headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...W.has(D.pattern)?{"X-STX-Runtime":W.get(D.pattern)?"true":"false"}:{},...Y?{"X-STX-Layout":Y.layout,"X-STX-Layout-Group":Y.group}:{},...b(),"Cache-Control":t}})}}let V=f(U.method),F=Z.get(D.pattern);if(!F){let j=I.get("/500")||null;if(j){let Y=Z.get(j.pattern);if(Y)return new Response(Y.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(!V&&!F.hasServerScripts&&Object.keys(F.placeholders).length===0)return new Response(F.html,{status:F.status??200,headers:{"Content-Type":"text/html",...b(),"Cache-Control":"public, max-age=60"}});try{let{html:j,boundaries:Y,redirect:L,cookies:A,status:M,headers:S}=await d(F,{params:E,request:U,method:U.method});if(L)return m(L,A,S);if(Y&&Y.length>0){let{renderStreamingPage:T,streamToResponse:k}=await import("./chunk-9b22663r.js");return k(T(j,Y,{timeoutMs:30000}),{status:M??F.status??200,headers:{"Cache-Control":"no-cache",...S}})}let H=new Headers({"Content-Type":"text/html",...b(),"Cache-Control":"no-cache"});for(let T of A??[])H.append("Set-Cookie",T);for(let[T,k]of Object.entries(S??{}))H.set(T,k);return new Response(j,{status:M??F.status??200,headers:H})}catch(j){return console.error(`[stx] Hydration error for ${O}:`,j),new Response(F.html,{headers:{"Content-Type":"text/html"}})}})())}});return console.log(`[stx] Production server running at http://localhost:${Q}`),console.log(`[stx] Serving ${X.routes.length} routes (${Z.size} pre-loaded)`),{port:Q,stop:()=>N.stop()}}
|
|
3
|
+
export{WJ as Ff,YJ as Gf,i as Hf,q as If,KJ as Jf,f as Kf,h as Lf,m as Mf,wJ as Nf,d as Of,AJ as Pf,mJ as Qf};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$l as l,Ql as c,Tl as d,Ul as e,Vl as f,Wl as g,Xl as h,Yl as i,Zl as j,_l as k,am as m}from"./chunk-y11cxbxd.js";import"./chunk-92mj1t26.js";import"./chunk-8mjdpr94.js";import"./chunk-pkaabd8h.js";import{Xs as a,Ys as b}from"./chunk-xpp135ad.js";import"./chunk-wrzwgkbx.js";import"./chunk-5kk8gsj2.js";import"./chunk-38ejahd9.js";import"./chunk-ypmqf7tm.js";import"./chunk-de7fye10.js";import"./chunk-v5e1gxwm.js";import"./chunk-b6ej2fdf.js";import"./chunk-x650vjcp.js";import"./chunk-qc1f74ek.js";export{h as transformAutoImports,b as stripCommentsAndLiterals,e as renderVendorStyleTags,m as processClientScript,g as injectBrowserCoreAutoImports,l as generateServerDataBridge,j as generateBrowserAutoImportDestructuring,i as generateAutoImportDestructuring,a as findInterpolationEnd,k as extractBridgeData,d as extractAndStripCssImports,f as STX_AUTO_IMPORTS,c as BROWSER_CORE_IMPORTS};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import N from"path";var D=[{label:"Mobile (Small)",width:320,height:568},{label:"Mobile (Medium)",width:375,height:667},{label:"Mobile (Large)",width:414,height:896},{label:"Tablet",width:768,height:1024},{label:"Laptop",width:1024},{label:"Desktop",width:1280},{label:"Desktop (Large)",width:1920}],E=[{label:"Transparent",color:"transparent",contrastColor:"#333"},{label:"White",color:"#ffffff",contrastColor:"#333"},{label:"Light Gray",color:"#f5f5f5",contrastColor:"#333"},{label:"Dark Gray",color:"#333333",contrastColor:"#fff"},{label:"Black",color:"#000000",contrastColor:"#fff"}],H={file:"title",order:"asc",groups:[]},L={enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],tree:H,theme:{title:"STX Components",defaultColorScheme:"auto",darkClass:"dark"},responsivePresets:D,backgroundPresets:E,autoApplyContrastColor:!1,port:6006};function I(q){let j={...L,...q};return{enabled:j.enabled??!0,outDir:j.outDir??".stx/dist/story",storyMatch:j.storyMatch??["**/*.story.stx"],storyIgnored:j.storyIgnored??["**/node_modules/**","**/dist/**","**/.stx/**"],tree:{...H,...j.tree},theme:{title:"STX Components",defaultColorScheme:"auto",darkClass:"dark",...j.theme},responsivePresets:j.responsivePresets??D,backgroundPresets:j.backgroundPresets??E,autoApplyContrastColor:j.autoApplyContrastColor??!1,setupFile:j.setupFile,port:j.port??6006}}async function Y(q){let j=q.root??process.cwd(),z;try{let A=await import(N.join(j,"stx.config.ts"));z=(A.default||A).story}catch{}let J={...z,...q.config},K=I(J);return{root:j,config:K,storyFiles:[],tree:void 0,mode:q.mode}}function Z(q,j){q.storyFiles=j}function _(q,j){q.tree=j}
|
|
3
|
+
export{Y as l,Z as m,_ as n};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var{defineProperty:e,getOwnPropertyNames:g,getOwnPropertyDescriptor:h}=Object,i=Object.prototype.hasOwnProperty;function j(a){return this[a]}var m=(a)=>{var b=(f??=new WeakMap).get(a),c;if(b)return b;if(b=e({},"__esModule",{value:!0}),a&&typeof a==="object"||typeof a==="function"){for(var d of g(a))if(!i.call(b,d))e(b,d,{get:j.bind(a,d),enumerable:!(c=h(a,d))||c.enumerable})}return f.set(a,b),b},f;var k=(a)=>a;function l(a,b){this[a]=k.bind(null,b)}var n=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0,configurable:!0,set:l.bind(b,c)})};var o=(a,b)=>()=>(a&&(b=a(a=0)),b);var p=import.meta.require;
|
|
3
|
+
export{m as dv,n as ev,o as fv,p as gv};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ql as C}from"./chunk-y11cxbxd.js";import{Ys as Y}from"./chunk-xpp135ad.js";import{Wt as D}from"./chunk-v5e1gxwm.js";import u from"path";var S=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function h(K){let J=(Q)=>Q.replace(/[^\n]/g," ");return K.replace(/<!--[\s\S]*?-->/g,J).replace(/\{\{--[\s\S]*?--\}\}/g,J)}function m(K){let J=[],Q=h(K);S.lastIndex=0;let $;while(($=S.exec(Q))!==null){let j=($[1]||"").trim(),F=($[0].match(/^<script(?:\s[^>]*)?>/i)?.[0]??"<script>").length,z=($[0].match(/<\/script\s*>$/i)?.[0]??"</script>").length,W=$.index+F,Z=$.index+$[0].length-z,G=K.slice(W,Z);if(/\bsrc\s*=/.test(j))continue;let q=j.match(/\btype\s*=\s*["']([^"']+)["']/i);if(q&&!/^(?:module|text\/(?:javascript|typescript))$/i.test(q[1]))continue;let X=/\bserver\b/.test(j)?"server":/\bclient\b/.test(j)?"client":"plain",U=B(K,W);J.push({kind:X,code:G,startLine:U,attrs:j})}return J}function B(K,J){let Q=1;for(let $=0;$<J&&$<K.length;$++)if(K.charCodeAt($)===10)Q++;return Q}function N(K,J){let Q=K.lastIndexOf(`
|
|
3
|
+
`,J-1)+1;return J-Q+1}function g(K){let J=K.split(""),Q=(j,F)=>{for(let z=j;z<F&&z<J.length;z++)if(J[z]!==`
|
|
4
|
+
`)J[z]=" "},$=[/<script(?:\s[^>]*)?>[\s\S]*?<\/script>/gi,/<style(?:\s[^>]*)?>[\s\S]*?<\/style>/gi,/<!--[\s\S]*?-->/g,/\{\{--[\s\S]*?--\}\}/g,/@verbatim\b[\s\S]*?@endverbatim\b/g];for(let j of $){j.lastIndex=0;let F;while((F=j.exec(K))!==null)Q(F.index,F.index+F[0].length)}return J.join("")}function p(K){let J=0,Q="";for(let $=0;$<K.length;$++){let j=K[$];if(Q){if(j==="\\"){$++;continue}if(j===Q)Q="";continue}if(j==='"'||j==="'"||j==="`"){Q=j;continue}if(j==="("||j==="["||j==="{"){J++;continue}if(j===")"||j==="]"||j==="}"){J--;continue}if(j==="|"&&J===0){if(K[$+1]==="|"){$++;continue}if(K[$-1]==="|")continue;return K.slice(0,$)}}return K}var R=new Set([":for","x-for","v-for"]),w=/(?:^|\s)((?::|x-|v-|@)[\w.:-]+)\s*=\s*(["'])([\s\S]*?)\2/g,O="__stx_interpolated",y="__StxElement",f="__StxTemplateValue",l=`type ${f}<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? (T extends () => infer V ? T & V : T) : T`;function L(K){return K.replace(/\{\{[\s\S]*?\}\}/g,O).replace(/\{!![\s\S]*?!!\}/g,O)}function Vj(K){return K.replace(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/g,(J)=>{let Q=J.split(`
|
|
5
|
+
`).length-1,$=J.length-Q;return`0${" ".repeat(Math.max(0,$-1))}${`
|
|
6
|
+
`.repeat(Q)}`})}var d=["foreach","endforeach","forelse","endforelse","for","endfor","while","endwhile","empty","if","elseif","else","endif","unless","endunless","isset","endisset","switch","case","default","endswitch","auth","endauth","guest","endguest","env","endenv","once","endonce","break","continue"],i=new RegExp(String.raw`^[ \t]*@(?:${d.join("|")})\b[ \t]*(\([^\n)]*\))?[ \t]*$`,"gm");function Yj(K){return K.replace(i,(J)=>J.replace(/[^\n]/g," "))}var I=new Set(["x-cloak","x-ref","x-transition","x-teleport","v-slot","x-hydrate",":key","x-tooltip","x-tooltip-position"]);function c(K){let J=g(K),Q=[],$=/(@?)\{\{([\s\S]*?)\}\}|(@?)\{!!([\s\S]*?)!!\}/g,j;while((j=$.exec(J))!==null){if(j[1]||j[3])continue;let z=j[2]??j[4]??"",W=j[2]!==void 0?2:3,Z=p(z);if(!Z.trim())continue;let G=j.index+W+(Z.length-Z.trimStart().length);Q.push({code:Z.trim(),line:B(J,G),column:N(J,G),offset:G,kind:"interpolation"})}w.lastIndex=0;while((j=w.exec(J))!==null){let F=j[1],z=j[3]??"",W=F.replace(/\..*$/,"").replace(/^([^:].*?):.*$/,"$1");if(I.has(W)||I.has(F))continue;if(!z.trim())continue;let Z=j.index+j[0].indexOf(j[2],j[0].indexOf(F)+F.length)+1;if(R.has(W)){let q=z.match(/\s+(?:in|of)\s+/);if(!q||q.index===void 0)continue;let X=z.slice(q.index+q[0].length),U=q.index+q[0].length+(X.length-X.trimStart().length);Q.push({code:L(X.trim()),line:B(J,Z+U),column:N(J,Z+U),offset:Z+U,kind:"directive",attribute:W});continue}let G=z.length-z.trimStart().length;Q.push({code:L(z.trim()),line:B(J,Z+G),column:N(J,Z+G),offset:Z+G,kind:"directive",attribute:W})}return Q.sort((F,z)=>F.line-z.line||F.column-z.column),Q}var o=2000;function r(K,J){let Q=0,$=Math.min(K.length,J+o);for(let j=J;j<$;j++){let F=K[j];if(F==="(")Q++;else if(F===")"){if(Q--,Q===0)return K.slice(J+1,j)}}return null}function n(K){let J=new Map,Q=(W,Z)=>{let G=W.split(/[,[\]{}()\s]+/).filter(Boolean);for(let q of G){let X=q.replace(/^\.\.\./,"").trim();if(!/^\$?[A-Z_$][\w$]*$/i.test(X))continue;let U=G.length===1?Z:void 0,H=J.get(X);if(!H)J.set(X,{name:X,iterable:U});else if(H.iterable!==U)H.iterable=void 0}},$=/^\$?[A-Z_$][\w$]*$/i,j=(W)=>{let Z=W.trim();return $.test(Z)?Z:void 0};for(let W of K.matchAll(/@for(?:each|else)\s*\(/g)){let Z=r(K,W.index+W[0].length-1);if(Z===null)continue;let G=Z.match(/^([\s\S]*?)\bas\b([\s\S]*)$/);if(!G)continue;Q(G[2].replace(/=>/g," "),j(G[1]))}for(let W of K.matchAll(/@for\s*\(\s*(?:let|const|var)\s+([\w$]+)/g))Q(W[1]);let F=g(K);w.lastIndex=0;let z;while((z=w.exec(F))!==null){let W=z[1].replace(/\..*$/,"");if(!R.has(W))continue;let Z=z[3].match(/\s+(?:in|of)\s+/);if(!Z||Z.index===void 0)continue;Q(z[3].slice(0,Z.index),j(z[3].slice(Z.index+Z[0].length)))}for(let W of K.matchAll(/@(?:php|js|ts)\b([\s\S]*?)@end(?:php|js|ts)\b/g))for(let Z of W[1].matchAll(/\b(?:const|let|var|function|class)\s+([\w$]+)/g))Q(Z[1]);return[...J.values()].sort((W,Z)=>W.name.localeCompare(Z.name))}function V(K){let J=new Set;for(let Q of K.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s+([\w$]+)/gm))J.add(Q[1]);for(let Q of K.matchAll(/^\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([\w$]+)/gm))J.add(Q[1]);for(let Q of K.matchAll(/^\s*(?:export\s+)?class\s+([\w$]+)/gm))J.add(Q[1]);for(let Q of K.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s*[[{]([^\]}]*)[\]}]/gm))for(let $ of Q[1].split(",")){let j=$.split(":").pop().split("=")[0].replace(/^\.\.\./,"").trim();if(/^[A-Z_$][\w$]*$/i.test(j))J.add(j)}return[...J].sort()}function a(){return["declare var window: any",...D.map((K)=>`declare var ${K}: any`)].join(`
|
|
7
|
+
`)}var s=["params","query","cookies","host","ip","setResponseStatus","setResponseHeader","notFound","request","url","definePageMeta","defineClientPayload","defineStore","props","$props"];function t(){return s.map((K)=>`declare var ${K}: any`).join(`
|
|
8
|
+
`)}function T(K){let J=/\bdefineClientPayload\s*\(\s*\{([\s\S]*?)\}\s*\)/g,Q,$=!1,j=new Set,F=Y(K);while((Q=J.exec(F))!==null){$=!0;for(let z of e(Q[1])){let W=z.split(":")[0].trim();if(/^[A-Za-z_$][\w$]*$/.test(W))j.add(W)}}return $?[...j]:null}function e(K){let J=[],Q=0,$="";for(let j of K){if(j===","&&Q===0){J.push($),$="";continue}if(j==="("||j==="["||j==="{")Q++;else if(j===")"||j==="]"||j==="}")Q--;$+=j}return J.push($),J.filter((j)=>j.trim().length>0)}function jj(K){let J=/^[ \t]*import\b[\s\S]*?(?:from\s*['"][^'"]*['"]|['"][^'"]*['"])[ \t]*;?[ \t]*$/gm,Q=[],$=K.replace(J,(j)=>{return Q.push(j.trim()),j.split(`
|
|
9
|
+
`).map(()=>"").join(`
|
|
10
|
+
`)});return{imports:Q.join(`
|
|
11
|
+
`),body:$}}function x(K){let J=Y(K),Q=Array(J.length),$=0;for(let W=0;W<J.length;W++){let Z=J[W];if(Z==="}"||Z===")"||Z==="]")$=Math.max(0,$-1);if(Q[W]=$,Z==="{"||Z==="("||Z==="[")$++}let j=[],F=/^[ \t]*(?:export[ \t]+)?(interface|type)[ \t]+([A-Za-z_$][\w$]*)/gm,z;while((z=F.exec(J))!==null){if(Q[z.index]!==0)continue;let W=z[1],Z=z[2],G;if(W==="interface"){let q=J.indexOf("{",z.index);if(q===-1)continue;let X=0;G=-1;for(let U=q;U<J.length;U++)if(J[U]==="{")X++;else if(J[U]==="}"&&--X===0){G=U+1;break}if(G===-1)continue}else{let q=0;G=J.length;for(let X=J.indexOf("=",z.index)+1;X<J.length;X++){let U=J[X];if(U==="{"||U==="["||U==="("||U==="<")q++;else if(U==="}"||U==="]"||U===")"||U===">")q--;else if(q<=0&&(U===";"||U===`
|
|
12
|
+
`&&!/[=|&,<([{]\s*$/.test(J.slice(Math.max(0,X-40),X)))){G=U===";"?X+1:X;break}}}j.push({name:Z,text:K.slice(z.index,G).replace(/^[ \t]*export[ \t]+/,"")}),F.lastIndex=G}return j}function Jj(K){return new Set(x(K).map((J)=>J.name))}function Bj(K,J=""){let Q=T(K),$=Jj(J),j=x(K).filter((G)=>!$.has(G.name)).map((G)=>G.text);if(!Q){let G=V(K);if(G.length===0&&j.length===0)return"";return["",`// ${Qj}`,...j,...G.map((q)=>`declare var ${q}: any`)].join(`
|
|
13
|
+
`)}if(Q.length===0)return j.length>0?["",`// ${k}`,...j].join(`
|
|
14
|
+
`):"";let{imports:F,body:z}=jj(K),W=z.replace(/^[ \t]*export[ \t]+(?=(?:const|let|var|function|async|class)\b)/gm,""),Z=["",`// ${k}`];if(F)Z.push(F);return Z.push(...j),Z.push(`async function ${A}() {`,W,` return { ${Q.join(", ")} }`,"}",`type ${_} = Awaited<ReturnType<typeof ${A}>>`,...Q.map((G)=>`declare var ${G}: ${_}[${JSON.stringify(G)}]`)),Z.join(`
|
|
15
|
+
`)}function Kj(K){let Q=Y(K).split(""),$=0;for(let j=0;j<Q.length;j++){let F=Q[j];if(F==="{"||F==="("||F==="["){$++;continue}if(F==="}"||F===")"||F==="]"){$=Math.max(0,$-1);continue}if($>0&&F!==`
|
|
16
|
+
`)Q[j]=" "}return V(Q.join(""))}function wj(K,J){if(T(K)!==null)return[];let Q=Y(J),$=new Set(D);return Kj(K).filter((j)=>{if($.has(j))return!1;if(V(J).includes(j))return!1;return new RegExp(`(?<![.#\\w$])${j}(?![\\w$])`).test(Q)})}var k="stx: types for the declared client payload (#1868)",Qj="stx: untyped bridge names \u2014 declare a defineClientPayload to check these (#1868)",A="__stxServerScope",_="__StxClientPayload";var Zj=["$env","$user","$slot","$slots","$attrs","$props","$page","$route","$loop","loop","$errors","$csrf","props","slot"];var $j=/^\s*[A-Z_$][\w$]*\s*=[^=]/i;function zj(K,J){let Q=/@(if|unless|elseif|else|endif|endunless)\b\s*(\()?/g,$=[],j;while((j=Q.exec(K))!==null){if(j.index>=J)break;let F=j[1];if(F==="endif"||F==="endunless"){$.pop();continue}let z="";if(j[2]==="("){let W=0,Z=j.index+j[0].length-1,G=Z+1;for(;Z<K.length;Z++){let q=K[Z];if(q==="(")W++;else if(q===")"){if(W--,W===0)break}}z=K.slice(G,Z).trim(),Q.lastIndex=Z+1}if(F==="if")$.push({seen:[],current:z});else if(F==="unless")$.push({seen:[],current:`!(${z})`});else if(F==="elseif"||F==="else"){let W=$[$.length-1];if(!W)continue;if(W.current)W.seen.push(W.current);W.current=F==="elseif"?z:null}}return $.flatMap((F)=>[...F.seen.map((z)=>`!(${z})`),...F.current?[F.current]:[]]).filter(Boolean)}function Wj(K){let J=K.code.trim();if(!J)return null;if(K.attribute?.startsWith("@")){if($j.test(J))return null;let $=";(($event: any): void => { ";return{text:`${$}${J} });`,prefixLength:$.length}}let Q=";void ((";return{text:`${Q}${J}));`,prefixLength:Q.length}}var Fj=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.{1,2}\/[^'"\n]*)\2/g;function Uj(K,J){if(!J)return K;return K.replace(Fj,(Q,$,j,F)=>{let z=u.resolve(J,F).replace(/\\/g,"/");return`${$}${j}${z}${j}`})}function Mj(K,J={}){let Q=m(K),$=K.split(`
|
|
17
|
+
`),j=Array.from({length:$.length},()=>""),F=new Map;for(let W of Q)Uj(W.code,J.originDir??"").split(`
|
|
18
|
+
`).forEach((G,q)=>{let X=W.startLine-1+q;if(X<j.length)j[X]=G});let z=(W,Z)=>{if(j.push(W),Z)F.set(j.length,Z)};if(J.globals!==!1){if(z(""),J.runtimeGlobals!==!1)for(let Z of a().split(`
|
|
19
|
+
`))z(Z);for(let Z of t().split(`
|
|
20
|
+
`))z(Z);for(let Z of C)z(`declare var ${Z}: any`);for(let Z of Zj)z(`declare var ${Z}: any`);z(`declare var ${O}: any`);let W=new Set(Q.flatMap((Z)=>V(Z.code)));z(`type ${y}<T> = T extends readonly (infer E)[] ? E : T extends Iterable<infer E2> ? E2 : any`);for(let Z of n(K)){if(W.has(Z.name))continue;let G=Z.iterable&&W.has(Z.iterable)?`${y}<typeof ${Z.iterable}>`:"any";z(`declare var ${Z.name}: ${G}`)}}if(J.templateExpressions!==!1){let W=c(K).map((Z)=>({expression:Z,statement:Wj(Z)})).filter((Z)=>Z.statement!==null);if(W.length>0){let Z=g(K),q=[...new Set(Q.flatMap((U)=>V(U.code)))].filter((U)=>/^[A-Z_$][\w$]*$/i.test(U)),X=0;if(q.length>0){z(l);for(let U of q)z(`type __StxT_${U} = ${f}<typeof ${U}>`);z(`;((${q.map((U)=>`${U}: __StxT_${U}`).join(", ")}) => {`),X=1}for(let{expression:U,statement:H}of W){let P=" ".repeat(X),M=U.offset===void 0?[]:zj(Z,U.offset),v=M.length>0?`${M.map((b)=>`if (${b}) `).join("")}{ `:"",E=M.length>0?" }":"";z(P+v+H.text+E,{line:U.line,column:U.column,expression:U,prefixLength:H.prefixLength+P.length+v.length})}if(X>0)z("});")}}return z("export {}"),{text:j.join(`
|
|
21
|
+
`),lineMap:F,sourceLineCount:$.length}}function Nj(K,J,Q){let $=K.lineMap.get(J);if(!$)return J<=K.sourceLineCount?{line:J,column:Q}:null;let j=Math.max(0,Q-1-($.prefixLength??0));return{line:$.line,column:$.column+j,expression:$.expression}}
|
|
22
|
+
export{m as Ug,Vj as Vg,Yj as Wg,c as Xg,V as Yg,t as Zg,Bj as _g,wj as $g,Uj as ah,Mj as bh,Nj as ch};
|