@stacksjs/stx 0.2.95 → 0.2.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/a11y.js +598 -2
- package/dist/analytics.js +159 -2
- package/dist/analyzer.js +240 -2
- package/dist/animation.js +688 -2
- package/dist/app-shell.js +220 -2
- package/dist/app.js +79 -2
- package/dist/assets.js +155 -2
- package/dist/ast.js +630 -2
- package/dist/async-components.js +428 -2
- package/dist/auth.js +12 -2
- package/dist/broadcasting.js +102 -2
- package/dist/browser-composables.js +565 -2
- package/dist/build-assets.js +29 -2
- package/dist/build-mode-detector.js +50 -2
- package/dist/build-optimizer.js +433 -2
- package/dist/build-views.js +180 -2
- package/dist/build.js +33 -2
- package/dist/builtins/drawer.js +37 -2
- package/dist/builtins/escape.js +3 -2
- package/dist/builtins/icon.js +83 -2
- package/dist/builtins/index.js +34 -2
- package/dist/builtins/modal.js +38 -2
- package/dist/builtins/safe-image.js +51 -2
- package/dist/builtins/stx-image.js +200 -2
- package/dist/builtins/stx-link.js +41 -2
- package/dist/builtins/stx-loading-indicator.js +35 -2
- package/dist/builtins/suspense.js +24 -2
- package/dist/builtins/toast.js +42 -2
- package/dist/builtins/tooltip.js +106 -2
- package/dist/builtins/transition-group.js +22 -2
- package/dist/bundle-analyzer/collector.js +233 -2
- package/dist/bundle-analyzer/index.js +82 -2
- package/dist/bundle-analyzer/report.js +318 -2
- package/dist/bundle-analyzer/treemap.js +594 -2
- package/dist/caching.js +131 -2
- package/dist/cli.js +11317 -10982
- package/dist/client/directive.js +14 -2
- package/dist/client/index.js +2 -2
- package/dist/client-helpers.js +312 -2
- package/dist/client-script-bundler.js +216 -6
- package/dist/client-script.js +754 -2
- package/dist/client.js +73 -4
- package/dist/component-hmr.js +585 -2
- package/dist/component-library.d.ts +6 -0
- package/dist/component-library.js +683 -0
- package/dist/component-processing.js +613 -2
- package/dist/component-registry.js +90 -2
- package/dist/component-renderer.js +660 -2
- package/dist/components.js +213 -2
- package/dist/composables/index.js +220 -2
- package/dist/composables/use-battery.js +101 -2
- package/dist/composables/use-broadcast-channel.js +80 -2
- package/dist/composables/use-channel.js +124 -2
- package/dist/composables/use-clipboard.js +79 -2
- package/dist/composables/use-color-mode.js +131 -2
- package/dist/composables/use-cookie.js +86 -2
- package/dist/composables/use-device-orientation.js +181 -2
- package/dist/composables/use-event-listener.js +27 -2
- package/dist/composables/use-event-source.js +166 -2
- package/dist/composables/use-eye-dropper.js +142 -2
- package/dist/composables/use-fetch.js +223 -2
- package/dist/composables/use-fullscreen.js +110 -2
- package/dist/composables/use-geolocation.js +101 -2
- package/dist/composables/use-idle.js +182 -2
- package/dist/composables/use-intersection-observer.js +168 -2
- package/dist/composables/use-keyboard.js +224 -2
- package/dist/composables/use-media-query.js +62 -2
- package/dist/composables/use-meta.js +48 -2
- package/dist/composables/use-mouse.js +286 -2
- package/dist/composables/use-mutation-observer.js +129 -2
- package/dist/composables/use-network.js +85 -2
- package/dist/composables/use-notification.js +94 -2
- package/dist/composables/use-permissions.js +132 -2
- package/dist/composables/use-query.js +0 -1
- package/dist/composables/use-resize-observer.js +157 -2
- package/dist/composables/use-router.js +51 -2
- package/dist/composables/use-share.js +104 -2
- package/dist/composables/use-speech.js +294 -2
- package/dist/composables/use-storage.js +130 -2
- package/dist/composables/use-text-selection.js +205 -4
- package/dist/composables/use-timer.js +183 -2
- package/dist/composables/use-utilities.js +176 -2
- package/dist/composables/use-wake-lock.js +122 -2
- package/dist/composables/use-websocket.js +165 -2
- package/dist/composables/use-window.js +163 -2
- package/dist/composables.js +552 -2
- package/dist/composition-api.js +190 -2
- package/dist/computed.js +376 -8
- package/dist/conditionals.js +599 -2
- package/dist/config.js +751 -2
- package/dist/craft-bridge.js +432 -2
- package/dist/craft-compiler.js +810 -2
- package/dist/craft-components.js +945 -2
- package/dist/craft-entry.js +5 -2
- package/dist/craft-ssr.js +559 -2
- package/dist/csp.js +220 -2
- package/dist/csrf.js +38 -2
- package/dist/custom-directives.js +136 -2
- package/dist/defer.js +156 -2
- package/dist/deploy/config-generators.js +214 -2
- package/dist/deploy/index.js +203 -2
- package/dist/deploy/netlify.js +167 -2
- package/dist/dev-server/crosswind.js +379 -2
- package/dist/dev-server/index.js +7 -2
- package/dist/dev-server/keyboard-shortcuts.js +81 -2
- package/dist/dev-server/native-window.js +91 -2
- package/dist/dev-server/port-utils.js +40 -2
- package/dist/dev-server/serve-app.js +682 -2
- package/dist/dev-server/serve-file.js +439 -2
- package/dist/dev-server/serve-markdown.js +281 -2
- package/dist/dev-server/serve-multi.js +579 -2
- package/dist/dev-server/terminal-colors.js +45 -2
- package/dist/dev-server/theme-selector.js +111 -2
- package/dist/dev-server/types.js +43 -2
- package/dist/dev-server.js +4 -2
- package/dist/devtools.js +462 -18
- package/dist/directive-api.js +355 -2
- package/dist/docs.js +567 -2
- package/dist/doctor.js +123 -2
- package/dist/document-shell.js +105 -2
- package/dist/dynamic-components.js +78 -2
- package/dist/edge-runtime.js +539 -2
- package/dist/env.js +9 -2
- package/dist/error-boundaries.js +62 -12
- package/dist/error-handling.js +1 -2
- package/dist/errors/codes.js +97 -2
- package/dist/errors/formatter.js +196 -2
- package/dist/errors/index.js +44 -2
- package/dist/errors/logger.js +250 -2
- package/dist/errors/sanitizer.js +181 -2
- package/dist/errors/types.js +86 -2
- package/dist/events.js +382 -2
- package/dist/expressions.js +650 -2
- package/dist/formatter.js +265 -2
- package/dist/forms-validation.js +510 -4
- package/dist/forms.js +709 -2
- package/dist/head.js +224 -2
- package/dist/heatmap.js +566 -2
- package/dist/hot-reload.js +367 -2
- package/dist/html-masking.js +73 -2
- package/dist/hydration-runtime.js +195 -2
- package/dist/hydration.js +654 -2
- package/dist/i18n.js +633 -2
- package/dist/image-optimization/auto-sibling.js +88 -2
- package/dist/image-optimization/build-plugin.js +241 -2
- package/dist/image-optimization/component.js +244 -2
- package/dist/image-optimization/directive.js +203 -2
- package/dist/image-optimization/index.js +54 -2
- package/dist/image-optimization/processor.js +262 -2
- package/dist/image-optimization/serve.js +102 -2
- package/dist/includes.js +733 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +134 -2
- package/dist/init.js +505 -2
- package/dist/inline-assets.js +82 -2
- package/dist/interactive.js +383 -2
- package/dist/internal-markdown.js +141 -2
- package/dist/island-chunking.js +52 -2
- package/dist/js-ts.js +57 -2
- package/dist/jsx-runtime.js +289 -2
- package/dist/keep-alive.js +421 -2
- package/dist/lazy-loader.js +245 -2
- package/dist/loading-indicator.js +322 -2
- package/dist/loops.js +643 -2
- package/dist/manifest.js +31 -2
- package/dist/markdown.js +68 -2
- package/dist/media/client/blur-up.js +217 -2
- package/dist/media/client/index.js +53 -2
- package/dist/media/client/lazy-load.js +283 -2
- package/dist/media/client/upload-handler.js +354 -2
- package/dist/media/image/component.js +574 -2
- package/dist/media/image/directive.js +160 -2
- package/dist/media/image/editing.js +193 -2
- package/dist/media/image/index.js +80 -2
- package/dist/media/image/placeholder.js +188 -2
- package/dist/media/image/processor/cache.js +51 -2
- package/dist/media/image/processor/index.js +3 -2
- package/dist/media/image/processor/optimizer.js +202 -2
- package/dist/media/image/processor/responsive.js +162 -2
- package/dist/media/image/srcset.js +194 -2
- package/dist/media/index.js +198 -2
- package/dist/media/manager/embed.js +253 -2
- package/dist/media/protected/component.js +235 -2
- package/dist/media/protected/index.js +20 -2
- package/dist/media/protected/signature.js +205 -2
- package/dist/media/shared/cache.js +132 -2
- package/dist/media/shared/hash.js +35 -2
- package/dist/media/shared/index.js +2 -2
- package/dist/media/types.js +0 -1
- package/dist/media/upload/component.js +320 -2
- package/dist/media/upload/index.js +1 -2
- package/dist/media/video/directive.js +142 -2
- package/dist/media/video/index.js +583 -2
- package/dist/media/video/processor/cache.js +52 -2
- package/dist/media/video/processor/index.js +4 -2
- package/dist/media/video/processor/streaming.js +197 -2
- package/dist/media/video/processor/thumbnail.js +134 -2
- package/dist/media/video/processor/transcoder.js +283 -2
- package/dist/method-spoofing.js +17 -2
- package/dist/middleware.js +40 -2
- package/dist/misc-directives.js +222 -2
- package/dist/native-build.js +511 -2
- package/dist/parser/directive-parser.js +239 -2
- package/dist/parser/expression-parser.js +358 -2
- package/dist/parser/index.js +23 -2
- package/dist/parser/tokenizer.js +534 -2
- package/dist/partial-hydration.js +427 -2
- package/dist/performance-utils.js +430 -2
- package/dist/placeholder.js +35 -2
- package/dist/plugin-system.js +214 -2
- package/dist/plugin.js +173 -2
- package/dist/precompiler.js +660 -81
- package/dist/process.js +711 -2
- package/dist/production-build.js +596 -2
- package/dist/production-builder.js +132 -2
- package/dist/production-server.js +188 -2
- package/dist/props.js +224 -2
- package/dist/public-env.js +19 -2
- package/dist/pwa/audit.js +255 -2
- package/dist/pwa/directives.js +332 -2
- package/dist/pwa/icons.js +109 -2
- package/dist/pwa/index.js +47 -2
- package/dist/pwa/inject.js +102 -2
- package/dist/pwa/manifest.js +186 -2
- package/dist/pwa/offline.js +259 -2
- package/dist/pwa/precache.js +116 -2
- package/dist/pwa/service-worker.js +860 -2
- package/dist/pwa/workbox-strategies.js +167 -2
- package/dist/pwa/workbox.js +382 -2
- package/dist/pwa.js +427 -427
- package/dist/reactive-bindings.js +266 -2
- package/dist/reactive.js +569 -2
- package/dist/reactivity.js +559 -2
- package/dist/release.js +1 -2
- package/dist/render.js +165 -2
- package/dist/route-middleware.js +17 -2
- package/dist/router.js +9 -2
- package/dist/routes.js +14 -2
- package/dist/runtime-injection.js +120 -2
- package/dist/runtime.js +94 -2
- package/dist/safe-evaluator.js +444 -2
- package/dist/scaffolding.js +897 -2
- package/dist/screenshot.js +87 -2
- package/dist/script-classifier.js +32 -2
- package/dist/script-validation.js +158 -2
- package/dist/seo.js +457 -2
- package/dist/serve.js +237 -2
- package/dist/server-bindings.js +108 -2
- package/dist/server-components.js +338 -11
- package/dist/signal-processing.js +946 -2
- package/dist/signals-api.js +154 -2
- package/dist/signals.js +5287 -2
- package/dist/site-builder/build.js +224 -2
- package/dist/site-builder/i18n.js +140 -2
- package/dist/site-builder/index.js +15 -2
- package/dist/site-builder/robots.js +26 -2
- package/dist/site-builder/router.js +27 -2
- package/dist/site-builder/seo.js +36 -2
- package/dist/site-builder/sitemap.js +26 -2
- package/dist/site-builder/theme.js +33 -2
- package/dist/site-builder/types.js +0 -1
- package/dist/slots.js +201 -2
- package/dist/source-maps.js +350 -2
- package/dist/spa-shell.js +34 -2
- package/dist/ssg.js +389 -389
- package/dist/ssr.js +355 -2
- package/dist/state-management.js +533 -2
- package/dist/store-imports.js +13 -2
- package/dist/store-loader.js +72 -5
- package/dist/stores-client.js +132 -2
- package/dist/story/addons.js +261 -2
- package/dist/story/analytics.js +235 -2
- package/dist/story/auto-stories.js +158 -2
- package/dist/story/bookmarks.js +277 -2
- package/dist/story/bun-test.js +102 -2
- package/dist/story/cli.js +155 -2
- package/dist/story/collect/analyzer.js +305 -2
- package/dist/story/collect/index.js +27 -2
- package/dist/story/collect/parser.js +129 -2
- package/dist/story/collect/scanner.js +101 -2
- package/dist/story/collect/tree.js +110 -2
- package/dist/story/commands/build.js +172 -2
- package/dist/story/commands/dev.js +78 -2
- package/dist/story/commands/index.js +3 -2
- package/dist/story/commands/preview.js +56 -2
- package/dist/story/compiled-output.js +151 -2
- package/dist/story/composition.js +261 -2
- package/dist/story/config-watcher.js +67 -2
- package/dist/story/config.js +64 -2
- package/dist/story/context.js +27 -2
- package/dist/story/controls/index.js +320 -2
- package/dist/story/crosswind.js +189 -2
- package/dist/story/desktop-preview.js +105 -2
- package/dist/story/docs-generator.js +186 -2
- package/dist/story/errors.js +239 -2
- package/dist/story/figma-export.js +224 -2
- package/dist/story/generator.js +165 -2
- package/dist/story/hmr.js +131 -2
- package/dist/story/hot-swap.js +207 -2
- package/dist/story/index.js +49 -2
- package/dist/story/interactions.js +225 -2
- package/dist/story/keyboard-shortcuts.js +345 -2
- package/dist/story/output.js +153 -2
- package/dist/story/performance.js +252 -2
- package/dist/story/presets.js +289 -2
- package/dist/story/props-validation.js +215 -2
- package/dist/story/renderer.js +209 -2
- package/dist/story/search-index.js +106 -2
- package/dist/story/search.js +140 -2
- package/dist/story/server.js +965 -2
- package/dist/story/setup.js +78 -2
- package/dist/story/snapshots.js +170 -2
- package/dist/story/testing.js +163 -2
- package/dist/story/theme.js +170 -2
- package/dist/story/types.js +0 -2
- package/dist/story/ui/code-panel.js +175 -2
- package/dist/story/ui/controls-panel.js +168 -2
- package/dist/story/ui/index.js +4 -2
- package/dist/story/ui/navigation.js +250 -2
- package/dist/story/ui/preview.js +251 -2
- package/dist/story/visual-testing.js +247 -2
- package/dist/streaming.js +537 -2
- package/dist/strict-lint.js +288 -2
- package/dist/style-scoping.js +50 -2
- package/dist/suspense.js +398 -2
- package/dist/teleport.js +109 -2
- package/dist/template-compiler.js +63 -2
- package/dist/template-hydrator.js +82 -2
- package/dist/template-tag-balance.js +93 -2
- package/dist/testing.js +581 -2
- package/dist/transitions.js +443 -2
- package/dist/type-checker.js +581 -2
- package/dist/types/component-types.d.ts +54 -0
- package/dist/types/component-types.js +0 -1
- package/dist/types/config-types.js +0 -1
- package/dist/types/context-types.js +0 -1
- package/dist/types/csp-types.js +0 -1
- package/dist/types/directive-types.js +3 -2
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +1 -2
- package/dist/types/pwa-types.js +0 -1
- package/dist/types.js +1 -2
- package/dist/typescript-templates.js +386 -4
- package/dist/utils.js +942 -2
- package/dist/validator.js +171 -2
- package/dist/variable-extractor.js +1094 -2
- package/dist/view-composers.js +29 -2
- package/dist/virtual-scrolling.js +454 -2
- package/dist/visual-editor.js +688 -28
- package/dist/vue-template.js +475 -2
- package/dist/web-components/css-scoping.js +177 -2
- package/dist/web-components/index.js +13 -2
- package/dist/web-components/reactive-generator.js +121 -56
- package/dist/web-components.js +1447 -2
- package/dist/x-element.js +17 -5
- package/package.json +5 -6
- package/dist/chunk-04n64bnt.js +0 -5
- package/dist/chunk-06w68hyg.js +0 -7
- package/dist/chunk-07y6m5xx.js +0 -3
- package/dist/chunk-095s3972.js +0 -99
- package/dist/chunk-09k66d8a.js +0 -3
- package/dist/chunk-0a61y94n.js +0 -24
- package/dist/chunk-0b9w2w1y.js +0 -1
- package/dist/chunk-0dx4q6yq.js +0 -3
- package/dist/chunk-0dz85jrp.js +0 -3
- package/dist/chunk-0jd0pndq.js +0 -3
- package/dist/chunk-0p0nyq50.js +0 -6
- package/dist/chunk-0p1h3p3w.js +0 -3
- package/dist/chunk-0qakwen3.js +0 -1
- package/dist/chunk-0qnz93q2.js +0 -3
- package/dist/chunk-10debkj5.js +0 -71
- package/dist/chunk-15nesxgt.js +0 -5224
- package/dist/chunk-1sr54zp8.js +0 -3
- package/dist/chunk-1v49fwr5.js +0 -3
- package/dist/chunk-1xz0w746.js +0 -1539
- package/dist/chunk-1z5nhbjt.js +0 -90
- package/dist/chunk-1zgsgk4b.js +0 -1
- package/dist/chunk-20swzkx3.js +0 -216
- package/dist/chunk-27zsyhrd.js +0 -4
- package/dist/chunk-29y0hk5z.js +0 -3
- package/dist/chunk-2cdvw21b.js +0 -274
- package/dist/chunk-2j21d3ka.js +0 -161
- package/dist/chunk-2jxbwnkz.js +0 -2
- package/dist/chunk-31dr4bys.js +0 -6
- package/dist/chunk-35faj94w.js +0 -15
- package/dist/chunk-39gm08bn.js +0 -39
- package/dist/chunk-3a4qsygv.js +0 -51
- package/dist/chunk-3te20hqw.js +0 -3
- package/dist/chunk-43t7faps.js +0 -24
- package/dist/chunk-44hd3kab.js +0 -1
- package/dist/chunk-47kpewks.js +0 -71
- package/dist/chunk-4aj7ftqb.js +0 -1
- package/dist/chunk-4d2y57k7.js +0 -3
- package/dist/chunk-4deg33rw.js +0 -57
- package/dist/chunk-4k7d8p8d.js +0 -188
- package/dist/chunk-4qcy5tx6.js +0 -53
- package/dist/chunk-4x7kae4j.js +0 -3
- package/dist/chunk-55nwdnsd.js +0 -3
- package/dist/chunk-55yp0q8t.js +0 -201
- package/dist/chunk-5f43yz6z.js +0 -12
- package/dist/chunk-5shey2e4.js +0 -3
- package/dist/chunk-6b5k6w2q.js +0 -7
- package/dist/chunk-6djzdes9.js +0 -14
- package/dist/chunk-6e4c6g46.js +0 -3
- package/dist/chunk-6eqbxcrd.js +0 -8
- package/dist/chunk-7074g241.js +0 -3
- package/dist/chunk-7b6s3g65.js +0 -179
- package/dist/chunk-7cgmq685.js +0 -33
- package/dist/chunk-7dkz6z2s.js +0 -3
- package/dist/chunk-7ed3tean.js +0 -3
- package/dist/chunk-7gd339hd.js +0 -109
- package/dist/chunk-7j5e8sdj.js +0 -3
- package/dist/chunk-7n8g0nfn.js +0 -38
- package/dist/chunk-7sqdeqsw.js +0 -1
- package/dist/chunk-80g54ncj.js +0 -3
- package/dist/chunk-8a5bxece.js +0 -4
- package/dist/chunk-8ahwt6a4.js +0 -721
- package/dist/chunk-8b3z0zd5.js +0 -8
- package/dist/chunk-8dhdpa5h.js +0 -4
- package/dist/chunk-8n9nnqr6.js +0 -3
- package/dist/chunk-8qc1bsym.js +0 -3
- package/dist/chunk-8va64c9n.js +0 -3
- package/dist/chunk-8vtm0m84.js +0 -3
- package/dist/chunk-8xj7c3mf.js +0 -8
- package/dist/chunk-988dw6q3.js +0 -9
- package/dist/chunk-9b6cec0v.js +0 -321
- package/dist/chunk-9cf97f9p.js +0 -3
- package/dist/chunk-9ecv8aqj.js +0 -14
- package/dist/chunk-9eq3ht5f.js +0 -8
- package/dist/chunk-9jtj77jx.js +0 -3
- package/dist/chunk-9t14se2t.js +0 -83
- package/dist/chunk-9wmq2272.js +0 -3
- package/dist/chunk-9zbk5zx5.js +0 -57
- package/dist/chunk-a2g2qb2y.js +0 -386
- package/dist/chunk-a3hyn4we.js +0 -79
- package/dist/chunk-a87qqft6.js +0 -194
- package/dist/chunk-ah88wzbg.js +0 -10
- package/dist/chunk-akf1r75r.js +0 -102
- package/dist/chunk-amaa1bev.js +0 -2
- package/dist/chunk-avx8aydt.js +0 -3
- package/dist/chunk-ay9qf4zj.js +0 -6
- package/dist/chunk-aywxfqev.js +0 -3
- package/dist/chunk-azkegjd8.js +0 -61
- package/dist/chunk-b77wjyn7.js +0 -84
- package/dist/chunk-baf1hfwh.js +0 -231
- package/dist/chunk-bdk6g1vj.js +0 -3
- package/dist/chunk-bhqgmyqw.js +0 -36
- package/dist/chunk-bk3j0n82.js +0 -341
- package/dist/chunk-bndmdahk.js +0 -3
- package/dist/chunk-bpgg59wa.js +0 -3
- package/dist/chunk-bs3gmfxz.js +0 -5
- package/dist/chunk-bxc7kjsk.js +0 -32
- package/dist/chunk-c7jg8w13.js +0 -3
- package/dist/chunk-ckxjqqn9.js +0 -3
- package/dist/chunk-cn8az1b4.js +0 -1
- package/dist/chunk-d0zjtdw4.js +0 -29
- package/dist/chunk-d1qh1x2g.js +0 -3
- package/dist/chunk-djddhmcc.js +0 -60
- package/dist/chunk-dqn9gyhb.js +0 -21
- package/dist/chunk-drjq2zwg.js +0 -3
- package/dist/chunk-dvfs1h3c.js +0 -117
- package/dist/chunk-e2q9c5vq.js +0 -8
- package/dist/chunk-e98v1bc6.js +0 -12
- package/dist/chunk-ejayeex8.js +0 -2
- package/dist/chunk-ejh8fyak.js +0 -3
- package/dist/chunk-ek2w6zvy.js +0 -4
- package/dist/chunk-ewa88139.js +0 -6
- package/dist/chunk-fjk3x41y.js +0 -3
- package/dist/chunk-frg705zq.js +0 -302
- package/dist/chunk-fzm3y0r3.js +0 -267
- package/dist/chunk-g1vt329s.js +0 -21
- package/dist/chunk-g4ps1dj8.js +0 -140
- package/dist/chunk-gkzq8zw4.js +0 -23
- package/dist/chunk-gz5fmp3q.js +0 -3
- package/dist/chunk-h0hjy0kn.js +0 -292
- package/dist/chunk-h5jxydqq.js +0 -147
- package/dist/chunk-h5wa62ek.js +0 -145
- package/dist/chunk-h7aq56qj.js +0 -28
- package/dist/chunk-h82kjdr4.js +0 -83
- package/dist/chunk-hbehnm18.js +0 -3
- package/dist/chunk-hbgxbgam.js +0 -58
- package/dist/chunk-hc2mf5h6.js +0 -4
- package/dist/chunk-hjm2xab3.js +0 -3
- package/dist/chunk-hjv76kcw.js +0 -1
- package/dist/chunk-hrnnh4tq.js +0 -142
- package/dist/chunk-ht43ds42.js +0 -236
- package/dist/chunk-hxx3za24.js +0 -62
- package/dist/chunk-hy8820vc.js +0 -6
- package/dist/chunk-j447q024.js +0 -28
- package/dist/chunk-j58vh0w6.js +0 -314
- package/dist/chunk-j8tn8enq.js +0 -3
- package/dist/chunk-jc0fc4ht.js +0 -11
- package/dist/chunk-jcs0ymw7.js +0 -3
- package/dist/chunk-jjamhxpm.js +0 -139
- package/dist/chunk-jjb05d21.js +0 -3
- package/dist/chunk-jjdq01dv.js +0 -128
- package/dist/chunk-jnmgm2xw.js +0 -5
- package/dist/chunk-jpndqst5.js +0 -3
- package/dist/chunk-jt0ezawy.js +0 -351
- package/dist/chunk-jz73j3qs.js +0 -169
- package/dist/chunk-k21df0pg.js +0 -10
- package/dist/chunk-k848dzsa.js +0 -429
- package/dist/chunk-kdfe4t91.js +0 -3
- package/dist/chunk-keawsbpn.js +0 -5
- package/dist/chunk-kgym7ch9.js +0 -8
- package/dist/chunk-khdn7jwe.js +0 -3
- package/dist/chunk-km25cwz6.js +0 -3
- package/dist/chunk-knm8a8yx.js +0 -398
- package/dist/chunk-krqn0ddk.js +0 -3
- package/dist/chunk-ktkmvaa8.js +0 -1
- package/dist/chunk-kx6eb6ma.js +0 -4
- package/dist/chunk-kypas8vy.js +0 -4
- package/dist/chunk-m167kjhv.js +0 -4
- package/dist/chunk-m491r0rj.js +0 -358
- package/dist/chunk-m8448qby.js +0 -11
- package/dist/chunk-mgj88zeq.js +0 -64
- package/dist/chunk-mhgk632d.js +0 -3
- package/dist/chunk-mv4fb50w.js +0 -1
- package/dist/chunk-n5kg7fpx.js +0 -7
- package/dist/chunk-n98x35xd.js +0 -8
- package/dist/chunk-n9dhs1dw.js +0 -106
- package/dist/chunk-nd9rmddh.js +0 -6
- package/dist/chunk-ngxfwzq3.js +0 -3
- package/dist/chunk-nhv099jv.js +0 -19
- package/dist/chunk-nm15ccsg.js +0 -5
- package/dist/chunk-npfmdb6y.js +0 -71
- package/dist/chunk-nvwb4x04.js +0 -3
- package/dist/chunk-nw34xajc.js +0 -8
- package/dist/chunk-p077sw22.js +0 -3
- package/dist/chunk-p1h8065h.js +0 -3
- package/dist/chunk-p3e0cqtt.js +0 -34
- package/dist/chunk-p3fpb79v.js +0 -477
- package/dist/chunk-p52yzjq6.js +0 -498
- package/dist/chunk-p73meypx.js +0 -134
- package/dist/chunk-pa9zb7ty.js +0 -4
- package/dist/chunk-payfb24w.js +0 -207
- package/dist/chunk-pcm1vd8w.js +0 -3
- package/dist/chunk-pcntd9h4.js +0 -3
- package/dist/chunk-pg1fvqb9.js +0 -167
- package/dist/chunk-psc3wfcf.js +0 -1115
- package/dist/chunk-pznnww6k.js +0 -6
- package/dist/chunk-q6zhd9yf.js +0 -3
- package/dist/chunk-qa59zejf.js +0 -246
- package/dist/chunk-qvrbjpdc.js +0 -3
- package/dist/chunk-qygvvygy.js +0 -12
- package/dist/chunk-r0jcmpv6.js +0 -68
- package/dist/chunk-r5m9xtm7.js +0 -3
- package/dist/chunk-rh80q1nd.js +0 -1
- package/dist/chunk-rkffm9sy.js +0 -128
- package/dist/chunk-rpx5fa65.js +0 -3
- package/dist/chunk-rqxf5hns.js +0 -3
- package/dist/chunk-rtr974rc.js +0 -30
- package/dist/chunk-rvptcndz.js +0 -3
- package/dist/chunk-rw26rpek.js +0 -171
- package/dist/chunk-rw7937v4.js +0 -19
- package/dist/chunk-rwrv9wbf.js +0 -3
- package/dist/chunk-rz2ec6g7.js +0 -347
- package/dist/chunk-s6ja2bdg.js +0 -66
- package/dist/chunk-scpkdrdb.js +0 -4
- package/dist/chunk-shv88d2d.js +0 -10
- package/dist/chunk-t0c9wvpr.js +0 -3
- package/dist/chunk-tffh3b1e.js +0 -35
- package/dist/chunk-tg2f1mzq.js +0 -11
- package/dist/chunk-trfswy66.js +0 -77
- package/dist/chunk-tzwtg722.js +0 -3
- package/dist/chunk-v7f8jj15.js +0 -4
- package/dist/chunk-v8j49spx.js +0 -3
- package/dist/chunk-v97390pe.js +0 -1
- package/dist/chunk-vcr5pzpx.js +0 -233
- package/dist/chunk-veeerpwa.js +0 -3
- package/dist/chunk-vg5kt6az.js +0 -4
- package/dist/chunk-vgv7jvyz.js +0 -219
- package/dist/chunk-vjbefncc.js +0 -3
- package/dist/chunk-vmxjghsm.js +0 -3
- package/dist/chunk-vw7vqd76.js +0 -3
- package/dist/chunk-vx22he47.js +0 -1
- package/dist/chunk-w3b6m427.js +0 -45
- package/dist/chunk-wazkqv7n.js +0 -3
- package/dist/chunk-wf7zrjsw.js +0 -138
- package/dist/chunk-wfg2gm11.js +0 -3
- package/dist/chunk-wg9k6h8w.js +0 -12
- package/dist/chunk-wkz2vwkr.js +0 -81
- package/dist/chunk-wvef3ngh.js +0 -127
- package/dist/chunk-wvf31nzs.js +0 -3
- package/dist/chunk-x05nxhyv.js +0 -262
- package/dist/chunk-x0770gt9.js +0 -4
- package/dist/chunk-x24s4heg.js +0 -1166
- package/dist/chunk-x3r64r0c.js +0 -6
- package/dist/chunk-x5g9w4hh.js +0 -5
- package/dist/chunk-xgkv66q5.js +0 -2230
- package/dist/chunk-xqq1vxb6.js +0 -1
- package/dist/chunk-xs03kc1h.js +0 -196
- package/dist/chunk-xv34zbp4.js +0 -3
- package/dist/chunk-xw36p73h.js +0 -90
- package/dist/chunk-xyg1r5w0.js +0 -4
- package/dist/chunk-xys2sxh6.js +0 -16
- package/dist/chunk-y0qg6rrv.js +0 -3
- package/dist/chunk-y1k17c8b.js +0 -21
- package/dist/chunk-y5xz0jc4.js +0 -141
- package/dist/chunk-y6xsqe9a.js +0 -10
- package/dist/chunk-yb1t2h8h.js +0 -11
- package/dist/chunk-ygvyc6wv.js +0 -90
- package/dist/chunk-yj4x5ehw.js +0 -21
- package/dist/chunk-yn38c15w.js +0 -4
- package/dist/chunk-ynhngsdh.js +0 -3
- package/dist/chunk-yrsb6j3z.js +0 -3
- package/dist/chunk-yywfvfph.js +0 -2
- package/dist/chunk-zcxzdrn7.js +0 -5
- package/dist/chunk-zen6ax1y.js +0 -27
- package/dist/chunk-zf2pek72.js +0 -3
- package/dist/chunk-zk3d0jjf.js +0 -7
- package/dist/chunk-zy3rp1ab.js +0 -93
package/dist/chunk-pznnww6k.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Yx as Y}from"./chunk-amaa1bev.js";import $ from"fs";import z from"path";async function v(w){let k=await $.promises.readFile(w,"utf-8"),G=z.basename(w,".stx");return B(k,G,w)}function B(w,k,G){let E=J(w),q=A(w),H=L(w),I=T(w),F=S(w),K=V(w);return{name:k,path:G,description:H,props:E,slots:q,dependencies:I,cssClasses:F,directives:K}}function J(w){let k=[],G=w.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(!G)return k;let E=G[1];try{let q=Y(E);for(let H of q){if(H.name.startsWith("_"))continue;if(H.type==="function")continue;let I=O(E,H.start),F={name:H.name,type:Z(H.value||"",void 0,I),required:!1,default:H.value?_(H.value):void 0};if(I){let K=I.match(/@type\s+\{([^}]+)\}/i);if(K){if(F.type=K[1].trim(),F.type.includes("|"))F.options=F.type.split("|").map((Q)=>Q.trim().replace(/['"]/g,"")).filter((Q)=>Q!=="")}if(I.match(/@required/i))F.required=!0;let X=I.split(`
|
|
3
|
-
`).map((Q)=>Q.trim().replace(/^\*\s*/,"")).filter((Q)=>!Q.startsWith("@")&&Q.length>0);if(X.length>0)F.description=X.join(" ").trim()}k.push(F)}}catch{return b(E)}return k}function O(w,k){let E=w.slice(0,k).match(/\/\*\*\s*([\s\S]*?)\s*\*\/\s*$/);return E?E[1]:void 0}function b(w){let k=[],G=/(?:\/\*\*\s*([\s\S]*?)\s*\*\/\s*)?(?:export\s+)?(?:const|let|var)\s+(\w+)\s*(?::\s*([^=]+))?\s*=\s*([^;\n]+)/g,E=G.exec(w);while(E!==null){let[,q,H,I,F]=E;if(H.startsWith("_"))continue;let K={name:H,type:Z(F,I,q),required:!1,default:_(F)};if(q){let W=q.match(/@type\s+\{([^}]+)\}/i);if(W){if(K.type=W[1].trim(),K.type.includes("|"))K.options=K.type.split("|").map((U)=>U.trim().replace(/['"]/g,"")).filter((U)=>U!=="")}if(q.match(/@required/i))K.required=!0;let Q=q.split(`
|
|
4
|
-
`).map((U)=>U.trim().replace(/^\*\s*/,"")).filter((U)=>!U.startsWith("@")&&U.length>0);if(Q.length>0)K.description=Q.join(" ").trim()}k.push(K),E=G.exec(w)}return k}function Z(w,k,G){if(G){let q=G.match(/@type\s+\{([^}]+)\}/i);if(q)return q[1].trim()}if(k)return k.trim();let E=w.trim();if(E==="true"||E==="false")return"boolean";if(/^['"`]/.test(E))return"string";if(/^-?\d+(?:\.\d+)?$/.test(E))return"number";if(E.startsWith("["))return"array";if(E.startsWith("{"))return"object";if(E==="null")return"null";if(E==="undefined")return"undefined";return"any"}function _(w){let k=w.trim();try{if(k==="true")return!0;if(k==="false")return!1;if(k==="null")return null;if(k==="undefined")return;if(/^-?\d+(?:\.\d+)?$/.test(k))return Number(k);if(/^['"`].*['"`]$/.test(k))return k.slice(1,-1);if(k.startsWith("[")||k.startsWith("{")){let E=k.replace(/'/g,'"');try{return JSON.parse(E)}catch{return k}}return k}catch{return k}}function A(w){let k=[],G=new Set;if(/\{\{\s*slot\s*\}\}/.test(w))k.push({name:"default"}),G.add("default");let E=/<slot\s*(?:name\s*=\s*["']([^"']+)["'])?\s*\/?>/gi,q=E.exec(w);while(q!==null){let H=q[1]||"default";if(!G.has(H))k.push({name:H}),G.add(H);q=E.exec(w)}return k}function L(w){let k=w.match(/^\s*<!--\s*([\s\S]*?)\s*-->/);if(k)return k[1].trim();let G=w.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(G){let E=G[1].match(/^\s*\/\*\*\s*([\s\S]*?)\s*\*\//);if(E){let q=E[1].split(`
|
|
5
|
-
`).map((H)=>H.trim().replace(/^\*\s*/,"")).filter((H)=>!H.startsWith("@")&&H.length>0);if(q.length>0)return q.join(" ").trim()}}return}function T(w){let k=[],G=new Set,E=/import\s+(\w+)\s+from\s+['"][^'"]+\.stx['"]/g,q=E.exec(w);while(q!==null){let F=q[1];if(!G.has(F))k.push(F),G.add(F);q=E.exec(w)}let H=/<([A-Z][a-zA-Z0-9]*)\b/g;q=H.exec(w);while(q!==null){let F=q[1];if(!G.has(F))k.push(F),G.add(F);q=H.exec(w)}let I=/@component\s*\(\s*['"]([^'"]+)['"]/g;q=I.exec(w);while(q!==null){let F=q[1];if(!G.has(F))k.push(F),G.add(F);q=I.exec(w)}return k}function S(w){let k=[],G=new Set,E=/class\s*=\s*["']([^"']+)["']/gi,q=E.exec(w);while(q!==null){let H=q[1];for(let I of H.split(/\s+/)){let F=I.trim();if(F&&!F.includes("{{")&&!G.has(F))k.push(F),G.add(F)}q=E.exec(w)}return k}function V(w){let k=new Map,G=["@if","@else","@elseif","@endif","@unless","@endunless","@foreach","@endforeach","@for","@endfor","@while","@endwhile","@switch","@case","@default","@endswitch","@component","@endcomponent","@slot","@endslot","@include","@layout","@extends","@section","@endsection","@yield","@push","@endpush","@stack","@once","@endonce","@auth","@endauth","@guest","@endguest","@can","@endcan","@cannot","@endcannot","@env","@endenv","@production","@endproduction","@js","@endjs","@ts","@endts","@css","@endcss","@json","@class","@style","@checked","@selected","@disabled","@readonly","@required"];for(let q of G){let H=new RegExp(q.replace("@","@"),"gi"),I=w.match(H);if(I&&I.length>0){let F=q.slice(1);if(!F.startsWith("end"))k.set(F,(k.get(F)||0)+I.length)}}let E=[];for(let[q,H]of k)E.push({name:q,count:H});return E.sort((q,H)=>H.count-q.count),E}
|
|
6
|
-
export{v as Md,B as Nd,J as Od,A as Pd,L as Qd,T as Rd,S as Sd,V as Td};
|
package/dist/chunk-q6zhd9yf.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var I=null,N=[],M=!1,P=new Set,X=[],Y=[];function Z(j){let F=j,A=new Set,z=new Set,G=()=>{if(I)z.add(I);return F};return G.set=(H)=>{if(!Object.is(H,F)){let K=F;if(F=H,A.forEach((J)=>J(F,K)),M)z.forEach((J)=>P.add(J));else z.forEach((J)=>J())}},G.update=(H)=>{G.set(H(F))},G.subscribe=(H)=>{return A.add(H),()=>A.delete(H)},Object.defineProperty(G,"_isSignal",{value:!0,writable:!1}),G}function _(j){let F,A=!0,z=new Set,G=()=>{if(!A)if(A=!0,M)z.forEach((K)=>P.add(K));else z.forEach((K)=>K())},H=()=>{if(I)z.add(I);if(A){let K=I;I=G,N.push(G);try{F=j()}finally{N.pop(),I=K}A=!1}return F};return Object.defineProperty(H,"_isDerived",{value:!0,writable:!1}),H}function $(j,F={}){let A,z=!1,G=()=>{if(z)return;if(A)A(),A=void 0;let H=I;I=G,N.push(G);try{A=j()}finally{N.pop(),I=H}};if(F.immediate!==!1)G();return()=>{if(z=!0,A)A()}}function C(j){if(M){j();return}M=!0;try{j()}finally{M=!1,P.forEach((F)=>F()),P.clear()}}function S(j){X.push(j)}function W(j){Y.push(j)}function q(j){return typeof j==="function"&&j._isSignal===!0}function O(j){return typeof j==="function"&&j._isDerived===!0}function w(j){if(q(j)||O(j))return j();return j}function x(j){let F=I;I=null;try{return j()}finally{I=F}}function B(j,F){let A=typeof j==="function"?j:()=>j,z=Z([]),G=_(()=>z().reduce((J,L)=>F(J,L.action),A())),H=!1;return $(()=>{if(A(),!H){H=!0;return}if(x(()=>z().length))z.set([])}),[G,(J,L)=>{let R={action:J};z.set([...z(),R]);let Q=()=>{let T=z().filter((U)=>U!==R);if(T.length!==z().length)z.set(T)};if(L&&typeof L.then==="function")Promise.resolve(L).then(Q,Q);return Q}]}
|
|
3
|
-
export{Z as dq,_ as eq,$ as fq,C as gq,S as hq,W as iq,q as jq,O as kq,w as lq,x as mq,B as nq};
|
package/dist/chunk-qa59zejf.js
DELETED
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ch as zJ,ph as $J,rh as VJ,sh as KJ,xh as YJ,zh as _J}from"./chunk-ynhngsdh.js";import{Gi as uG,Ii as UJ,Ji as LJ,Mi as pG}from"./chunk-t0c9wvpr.js";import{jm as $G,km as vG,lm as xG,mm as TG,nm as SG,om as EG}from"./chunk-xs03kc1h.js";import{Ln as mG}from"./chunk-rw26rpek.js";import{fo as wG,ho as DG}from"./chunk-x3r64r0c.js";import{jo as IG}from"./chunk-1sr54zp8.js";import{mo as tG,no as eG,oo as GJ,po as JJ}from"./chunk-9t14se2t.js";import{vo as NG}from"./chunk-nm15ccsg.js";import{rp as HJ,sp as AJ}from"./chunk-jjb05d21.js";import{up as QJ}from"./chunk-j58vh0w6.js";import{Iq as kJ,Jq as cG,Kq as RG,Lq as yG,Mq as BJ,Nq as WJ,Oq as OJ}from"./chunk-d0zjtdw4.js";import{Dr as FJ,Ks as MJ,Rr as EJ,Sr as dG,Vs as LG,Yr as oG,ps as UG,tr as BG}from"./chunk-1xz0w746.js";import{dt as qJ}from"./chunk-g1vt329s.js";import{Rt as jJ}from"./chunk-y1k17c8b.js";import{aw as ZJ}from"./chunk-pa9zb7ty.js";import{Mw as jG,Nw as MG,Rw as s}from"./chunk-shv88d2d.js";import{Sw as G}from"./chunk-0dx4q6yq.js";import{Mx as iG}from"./chunk-9ecv8aqj.js";import{ty as aG}from"./chunk-zen6ax1y.js";import{wy as nG,xy as NJ}from"./chunk-yb1t2h8h.js";import{Ey as lG,Gy as sG}from"./chunk-fjk3x41y.js";import{Jy as IJ}from"./chunk-5shey2e4.js";import{pB as m}from"./chunk-xv34zbp4.js";import qG from"path";var{serve:vJ}=globalThis.Bun;import XG from"fs";import i from"path";async function xJ(S,B={}){let I=B.port||3000,y=B.watch!==!1,v=B.hotReload!==!1&&y,j=null,_=B.hmrPort||I+1,X=i.resolve(S);if(!XG.existsSync(X))return console.error(`${G.red}Error: File not found: ${G.bright}${X}${G.reset}`),!1;if(X.endsWith(".md"))return mG(X,B);else if(!X.endsWith(".stx"))return console.error(`${G.red}Error: Unsupported file type: ${G.bright}${X}${G.reset}. Only .stx and .md files are supported.`),!1;let C=i.join(process.cwd(),".stx/output");XG.mkdirSync(C,{recursive:!0}),console.log(`${G.blue}Building ${G.bright}${S}${G.reset}...`);let b=null,f=async()=>{try{let U={name:"public-assets",setup(O){O.onResolve({filter:/^\/(images|fonts|assets|public)\//},(H)=>{return{path:H.path,external:!0}})}},K=await Bun.build({entrypoints:[X],outdir:C,plugins:[U,kG],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...B.stxOptions});if(!K.success)return console.error(`${G.red}Build failed:${G.reset}`,K.logs),!1;let k=K.outputs.find((O)=>O.path.endsWith(".html"));if(!k)return console.error(`${G.red}No HTML output found${G.reset}`),!1;return b=await Bun.file(k.path).text(),!0}catch(U){return console.error(`${G.red}Error building stx file:${G.reset}`,U),!1}};if(!await f())return!1;let l=i.dirname(X);await jG(l);let R=I;try{if(R=await IG(I),R!==I)console.log(`${G.yellow}Port ${I} is busy, using port ${R} instead${G.reset}`)}catch{return console.error(`${G.red}Could not find an available port${G.reset}`),!1}if(v){let U=B.hmrPort||R+1;j=SG({wsPort:U,verbose:!1}),_=j.start(U)}let $={},Z=null;try{let{loadStxConfig:U}=await import("././index.js"),K=await U();if(K?.apiRouter)Z=K?.apiRouter,console.log(`${G.blue}Using custom router for API handling${G.reset}`);if(K?.apiRoutes){$=K.apiRoutes;let k=Object.keys($).length;if(k>0)console.log(`${G.blue}Loaded ${G.bright}${k} API route${k>1?"s":""}${G.reset}`)}if(K?.broadcasting?.enabled)try{let{startBroadcasting:k,loadChannels:Q}=await import("././broadcasting.js"),O=K.broadcasting;await k(O);let H=O.port??6001;console.log(`${G.magenta}Broadcasting on ${G.cyan}ws://localhost:${H}/ws${G.reset}`);let E=i.join(process.cwd(),"channels.ts");if(XG.existsSync(E))try{let V=await Q(E);console.log(`${G.blue}Loaded ${G.bright}${V} broadcast channel${V!==1?"s":""}${G.blue} from channels.ts${G.reset}`)}catch(V){console.warn(`${G.yellow}Failed to load channels.ts: ${V.message}${G.reset}`)}}catch(k){console.warn(`${G.yellow}Broadcasting failed to start: ${k.message}${G.reset}`)}}catch{}if(console.log(`${G.blue}Starting server on ${G.cyan}http://localhost:${R}/${G.reset}...`),v)console.log(`${G.magenta}Hot reload enabled on ws://localhost:${_}${G.reset}`);let M=vJ({port:R,async fetch(U){let K=new URL(U.url);if(Z)try{let E=await Z.handleRequest(U);if(E.status!==404)return E}catch{}if($[K.pathname])try{return await $[K.pathname](U)}catch(E){return new Response(JSON.stringify({error:E.message}),{status:500,headers:{"Content-Type":"application/json"}})}if(K.pathname==="/")return(async()=>{let V=await s(b||"");if(v)V=$G(V,_);if(B.native)if(V.includes("<head>"))V=V.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else if(V.includes("<html"))V=V.replace(/(<html[^>]*>)/,"$1<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>");else V="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+V;if(B.titlebarHidden)if(V.includes("<head>"))V=V.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else if(V.includes("<html"))V=V.replace(/(<html[^>]*>)/,"$1<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>");else V=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${V}`;return V})().then((V)=>new Response(V,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}}));let k=i.join(C,K.pathname);if(XG.existsSync(k)&&XG.statSync(k).isFile()){let E=Bun.file(k),V=i.extname(k).toLowerCase(),Y="text/plain";if(V===".ts"||V===".tsx"){let u=new Bun.Transpiler({loader:V===".tsx"?"tsx":"ts"}),n=await E.text(),WG=u.transformSync(n);return new Response(WG,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(V){case".html":Y="text/html";break;case".css":Y="text/css";break;case".js":Y="text/javascript";break;case".json":Y="application/json";break;case".png":Y="image/png";break;case".jpg":case".jpeg":Y="image/jpeg";break;case".gif":Y="image/gif";break;case".woff":Y="font/woff";break;case".woff2":Y="font/woff2";break;case".ttf":Y="font/ttf";break;case".otf":Y="font/otf";break;case".eot":Y="application/vnd.ms-fontobject";break}return new Response(E,{headers:{"Content-Type":Y}})}let Q=i.dirname(X),O=i.join(Q,K.pathname);if(XG.existsSync(O)&&XG.statSync(O).isFile()){let E=Bun.file(O),V=i.extname(O).toLowerCase(),Y="text/plain";if(V===".ts"||V===".tsx"){let u=new Bun.Transpiler({loader:V===".tsx"?"tsx":"ts"}),n=await E.text(),WG=u.transformSync(n);return new Response(WG,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(V){case".html":Y="text/html";break;case".css":Y="text/css";break;case".js":Y="text/javascript";break;case".json":Y="application/json";break;case".png":Y="image/png";break;case".jpg":case".jpeg":Y="image/jpeg";break;case".gif":Y="image/gif";break;case".svg":Y="image/svg+xml";break;case".ico":Y="image/x-icon";break;case".woff":Y="font/woff";break;case".woff2":Y="font/woff2";break;case".ttf":Y="font/ttf";break;case".otf":Y="font/otf";break;case".eot":Y="application/vnd.ms-fontobject";break}return new Response(E,{headers:{"Content-Type":Y}})}let H=i.join(process.cwd(),"public",K.pathname);if(XG.existsSync(H)&&XG.statSync(H).isFile()){let E=Bun.file(H),V=i.extname(H).toLowerCase(),Y="application/octet-stream";if(V===".ts"||V===".tsx"){let u=new Bun.Transpiler({loader:V===".tsx"?"tsx":"ts"}),n=await E.text(),WG=u.transformSync(n);return new Response(WG,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(V){case".html":Y="text/html";break;case".css":Y="text/css";break;case".js":Y="text/javascript";break;case".json":Y="application/json";break;case".png":Y="image/png";break;case".jpg":case".jpeg":Y="image/jpeg";break;case".gif":Y="image/gif";break;case".svg":Y="image/svg+xml";break;case".ico":Y="image/x-icon";break;case".woff":Y="font/woff";break;case".woff2":Y="font/woff2";break;case".ttf":Y="font/ttf";break;case".otf":Y="font/otf";break;case".eot":Y="application/vnd.ms-fontobject";break}return new Response(E,{headers:{"Content-Type":Y}})}return new Response("Not Found",{status:404})},error(U){return new Response(`<pre>${U}
|
|
3
|
-
${U.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});console.clear(),console.log(`
|
|
4
|
-
${G.blue}stx${G.reset} ${G.green}${process.env.stx_VERSION||"v0.0.10"}${G.reset} ${G.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${G.reset}`),console.log(`
|
|
5
|
-
${G.bright}\u2192 ${G.cyan}http://localhost:${R}/${G.reset}`),console.log(`
|
|
6
|
-
${G.yellow}Routes:${G.reset}`);let F=i.relative(process.cwd(),X);if(console.log(` ${G.green}\u2514\u2500 /${G.reset} \u2192 ${G.bright}${F}${G.reset}`),console.log(`
|
|
7
|
-
Press ${G.cyan}h${G.reset} + ${G.cyan}Enter${G.reset} to show shortcuts`),NG(M.url.toString(),()=>{if(y)XG.watch(i.dirname(X),{recursive:!0}).close();M.stop()}),B.native){let U=await Bun.file(X).text(),K=DG(U);await wG(R,{title:i.basename(X,".stx"),titlebarHidden:B.titlebarHidden===!0,nativeSidebar:!!K,sidebarConfig:K})}if(y){let U=i.dirname(X);console.log(`${G.blue}Watching ${G.bright}${U}${G.reset} for changes...`);let K=XG.watch(U,{recursive:!0},async(k,Q)=>{if(!Q||TG(Q))return;if(xG(Q)){console.log(`${G.yellow}File ${G.bright}${Q}${G.yellow} changed, rebuilding...${G.reset}`),UG.clear(),LG();let O=await f();if(await MG(l),v&&j)if(O)j.reload(Q);else j.error("Build failed - check console for details")}else if(vG(Q)){if(console.log(`${G.cyan}CSS ${G.bright}${Q}${G.cyan} changed${G.reset}`),v&&j)j.updateCss(Q)}});process.on("SIGINT",()=>{if(K.close(),j)EG();M.stop(),process.exit(0)})}return!0}var{serve:TJ}=globalThis.Bun;import _G from"fs";import d from"path";function XJ(S){if(S.length===0)return"";if(S.length===1)return S[0];let B=S.map((y)=>y.split(d.sep)),I=[];for(let y=0;y<B[0].length;y++){let v=B[0][y];if(B.every((j)=>j[y]===v))I.push(v);else break}return I.join(d.sep)}async function SJ(S,B={}){let I=B.port||3000,y=B.watch!==!1;for(let $ of S){let Z=d.resolve($);if(!_G.existsSync(Z))return console.error(`${G.red}Error: File not found: ${G.bright}${Z}${G.reset}`),!1;if(!Z.endsWith(".stx")&&!Z.endsWith(".md"))return console.error(`${G.red}Error: Unsupported file type: ${G.bright}${Z}${G.reset}. Only .stx and .md files are supported.`),!1}let v=d.join(process.cwd(),".stx/output");_G.mkdirSync(v,{recursive:!0});let j=XJ(S.map(($)=>d.dirname(d.resolve($))));console.log(`${G.blue}Processing ${G.bright}${S.length}${G.reset} files...`);let _={},X=[],C=async()=>{try{for(let $ of S){let Z=d.resolve($);if(Z.endsWith(".md"))try{let{content:F,data:U}=await oG(Z,{markdown:{syntaxHighlighting:{serverSide:!0,enabled:!0,defaultTheme:dG.markdown?.syntaxHighlighting?.defaultTheme||"github-dark",highlightUnknownLanguages:!0}}}),K=B.markdown?.syntaxHighlighting||dG.markdown?.syntaxHighlighting,k=K?.defaultTheme||"github-dark",Q=["github-dark"],O=K?.additionalThemes||[],E=[...new Set([...Q,...O])].map((n)=>`<option value="${n}"${n===k?" selected":""}>${n}</option>`).join(`
|
|
8
|
-
`),V=`
|
|
9
|
-
<!DOCTYPE html>
|
|
10
|
-
<html lang="en">
|
|
11
|
-
<head>
|
|
12
|
-
<meta charset="UTF-8">
|
|
13
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
14
|
-
<title>${U.title||d.basename(Z)}</title>
|
|
15
|
-
<!-- Syntax highlighting styles -->
|
|
16
|
-
<style id="syntax-theme">
|
|
17
|
-
:root {
|
|
18
|
-
--shiki-color-text: #24292e;
|
|
19
|
-
--shiki-color-background: #ffffff;
|
|
20
|
-
--shiki-token-constant: #005cc5;
|
|
21
|
-
--shiki-token-string: #032f62;
|
|
22
|
-
--shiki-token-comment: #6a737d;
|
|
23
|
-
--shiki-token-keyword: #d73a49;
|
|
24
|
-
--shiki-token-parameter: #24292e;
|
|
25
|
-
--shiki-token-function: #6f42c1;
|
|
26
|
-
--shiki-token-string-expression: #032f62;
|
|
27
|
-
--shiki-token-punctuation: #24292e;
|
|
28
|
-
--shiki-token-link: #032f62;
|
|
29
|
-
}
|
|
30
|
-
pre {
|
|
31
|
-
background-color: var(--shiki-color-background);
|
|
32
|
-
padding: 1rem;
|
|
33
|
-
border-radius: 4px;
|
|
34
|
-
}
|
|
35
|
-
code {
|
|
36
|
-
color: var(--shiki-color-text);
|
|
37
|
-
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
38
|
-
}
|
|
39
|
-
.dark-mode {
|
|
40
|
-
--shiki-color-text: #e1e4e8;
|
|
41
|
-
--shiki-color-background: #24292e;
|
|
42
|
-
--shiki-token-constant: #79b8ff;
|
|
43
|
-
--shiki-token-string: #9ecbff;
|
|
44
|
-
--shiki-token-comment: #6a737d;
|
|
45
|
-
--shiki-token-keyword: #f97583;
|
|
46
|
-
--shiki-token-parameter: #e1e4e8;
|
|
47
|
-
--shiki-token-function: #b392f0;
|
|
48
|
-
--shiki-token-string-expression: #9ecbff;
|
|
49
|
-
--shiki-token-punctuation: #e1e4e8;
|
|
50
|
-
--shiki-token-link: #9ecbff;
|
|
51
|
-
}
|
|
52
|
-
</style>
|
|
53
|
-
<style>
|
|
54
|
-
body {
|
|
55
|
-
font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
|
|
56
|
-
line-height: 1.6;
|
|
57
|
-
color: #333;
|
|
58
|
-
max-width: 800px;
|
|
59
|
-
margin: 0 auto;
|
|
60
|
-
padding: 2rem;
|
|
61
|
-
}
|
|
62
|
-
pre, code {
|
|
63
|
-
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
64
|
-
}
|
|
65
|
-
pre {
|
|
66
|
-
border-radius: 4px;
|
|
67
|
-
padding: 0;
|
|
68
|
-
margin: 1.5rem 0;
|
|
69
|
-
overflow-x: auto;
|
|
70
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
71
|
-
}
|
|
72
|
-
pre code {
|
|
73
|
-
display: block;
|
|
74
|
-
padding: 1rem;
|
|
75
|
-
overflow-x: auto;
|
|
76
|
-
}
|
|
77
|
-
/* Apply background color to code blocks based on theme */
|
|
78
|
-
pre.syntax-highlighter {
|
|
79
|
-
background-color: var(--shiki-color-background) !important;
|
|
80
|
-
}
|
|
81
|
-
.dark-mode pre.syntax-highlighter {
|
|
82
|
-
background-color: var(--shiki-color-background) !important;
|
|
83
|
-
}
|
|
84
|
-
code {
|
|
85
|
-
padding: 0.2rem 0.4rem;
|
|
86
|
-
border-radius: 3px;
|
|
87
|
-
}
|
|
88
|
-
h1, h2, h3, h4 {
|
|
89
|
-
margin-top: 2rem;
|
|
90
|
-
margin-bottom: 1rem;
|
|
91
|
-
}
|
|
92
|
-
h1 { color: #111; border-bottom: 1px solid #eee; padding-bottom: 0.5rem; }
|
|
93
|
-
h2 { color: #333; border-bottom: 1px solid #f0f0f0; padding-bottom: 0.3rem; }
|
|
94
|
-
h3 { color: #444; }
|
|
95
|
-
img {
|
|
96
|
-
max-width: 100%;
|
|
97
|
-
border-radius: 4px;
|
|
98
|
-
margin: 1rem 0;
|
|
99
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
100
|
-
}
|
|
101
|
-
blockquote {
|
|
102
|
-
border-left: 4px solid #ddd;
|
|
103
|
-
padding-left: 1rem;
|
|
104
|
-
margin-left: 0;
|
|
105
|
-
color: #555;
|
|
106
|
-
background: #f9f9f9;
|
|
107
|
-
padding: 0.5rem 1rem;
|
|
108
|
-
margin: 1.5rem 0;
|
|
109
|
-
}
|
|
110
|
-
table {
|
|
111
|
-
border-collapse: collapse;
|
|
112
|
-
width: 100%;
|
|
113
|
-
margin: 1.5rem 0;
|
|
114
|
-
}
|
|
115
|
-
th, td {
|
|
116
|
-
border: 1px solid #ddd;
|
|
117
|
-
padding: 0.5rem;
|
|
118
|
-
}
|
|
119
|
-
th {
|
|
120
|
-
background: #f0f0f0;
|
|
121
|
-
text-align: left;
|
|
122
|
-
}
|
|
123
|
-
tr:nth-child(even) {
|
|
124
|
-
background-color: #f8f8f8;
|
|
125
|
-
}
|
|
126
|
-
a {
|
|
127
|
-
color: #0066cc;
|
|
128
|
-
text-decoration: none;
|
|
129
|
-
}
|
|
130
|
-
a:hover {
|
|
131
|
-
text-decoration: underline;
|
|
132
|
-
}
|
|
133
|
-
hr {
|
|
134
|
-
border: 0;
|
|
135
|
-
border-top: 1px solid #eee;
|
|
136
|
-
margin: 2rem 0;
|
|
137
|
-
}
|
|
138
|
-
.frontmatter {
|
|
139
|
-
background: #f8f8f8;
|
|
140
|
-
border-radius: 4px;
|
|
141
|
-
padding: 1.5rem;
|
|
142
|
-
margin-bottom: 2rem;
|
|
143
|
-
font-size: 0.9rem;
|
|
144
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
145
|
-
border-left: 4px solid #ddd;
|
|
146
|
-
}
|
|
147
|
-
.frontmatter-item {
|
|
148
|
-
margin-bottom: 0.5rem;
|
|
149
|
-
display: flex;
|
|
150
|
-
}
|
|
151
|
-
.frontmatter-label {
|
|
152
|
-
font-weight: bold;
|
|
153
|
-
min-width: 100px;
|
|
154
|
-
color: #555;
|
|
155
|
-
}
|
|
156
|
-
${tG()}
|
|
157
|
-
</style>
|
|
158
|
-
</head>
|
|
159
|
-
<body>
|
|
160
|
-
${JJ(U)}
|
|
161
|
-
${eG(E)}
|
|
162
|
-
|
|
163
|
-
${F}
|
|
164
|
-
|
|
165
|
-
<script>
|
|
166
|
-
${GJ()}
|
|
167
|
-
</script>
|
|
168
|
-
</body>
|
|
169
|
-
</html>
|
|
170
|
-
`,u=`/${d.relative(j,Z).replace(/\.md$/,"")}`;if(u.endsWith("/index"))u=u.slice(0,-6)||"/";_[u||"/"]={filePath:Z,content:V,fileType:"md"}}catch(F){console.error(`${G.red}Error processing Markdown file ${G.bright}${$}${G.reset}:`,F);continue}else{let F={name:"public-assets",setup(H){H.onResolve({filter:/^\/(images|fonts|assets|public)\//},(E)=>{return{path:E.path,external:!0}})}},U=await Bun.build({entrypoints:[Z],outdir:v,plugins:[F,kG],define:{"process.env.NODE_ENV":'"development"'},...B.stxOptions});if(!U.success){console.error(`${G.red}Build failed for ${G.bright}${$}${G.reset}:`,U.logs);continue}let K=U.outputs.find((H)=>H.path.endsWith(".html"));if(!K){console.error(`${G.red}No HTML output found for ${G.bright}${$}${G.reset}`);continue}let k=await Bun.file(K.path).text(),O=`/${d.relative(j,Z).replace(/\.stx$/,"")}`;if(O.endsWith("/index"))O=O.slice(0,-6)||"/";if(O.includes("[")){let H=[...O.matchAll(/\[([^\]]+)\]/g)].map((V)=>V[1]),E=O.replace(/\[([^\]]+)\]/g,"([^/]+)");X.push({pattern:new RegExp(`^${E}$`),paramNames:H,filePath:Z,routeTemplate:O,fileType:"stx"}),_[O]={filePath:Z,content:k,fileType:"stx"}}else _[O||"/"]={filePath:Z,content:k,fileType:"stx"}}}if(Object.keys(_).length===0)return console.error(`${G.red}No files were successfully processed${G.reset}`),!1;return!0}catch($){return console.error(`${G.red}Error processing files:${G.reset}`,$),!1}};if(!await C())return!1;let f=I;try{if(f=await IG(I),f!==I)console.log(`${G.yellow}Port ${I} is busy, using port ${f} instead${G.reset}`)}catch{return console.error(`${G.red}Could not find an available port${G.reset}`),!1}console.log(`${G.blue}Starting server on ${G.cyan}http://localhost:${f}/${G.reset}...`);let h=TJ({port:f,async fetch($){let Z=new URL($.url),M=d.join(process.cwd(),"public",Z.pathname);if(_G.existsSync(M)&&_G.statSync(M).isFile()){let K=Bun.file(M),k=d.extname(M).toLowerCase(),Q="application/octet-stream";if(k===".ts"||k===".tsx"){let O=new Bun.Transpiler({loader:k===".tsx"?"tsx":"ts"}),H=await K.text(),E=O.transformSync(H);return new Response(E,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(k){case".html":Q="text/html";break;case".css":Q="text/css";break;case".js":Q="text/javascript";break;case".json":Q="application/json";break;case".png":Q="image/png";break;case".jpg":case".jpeg":Q="image/jpeg";break;case".gif":Q="image/gif";break;case".svg":Q="image/svg+xml";break;case".ico":Q="image/x-icon";break;case".woff":Q="font/woff";break;case".woff2":Q="font/woff2";break;case".ttf":Q="font/ttf";break;case".otf":Q="font/otf";break;case".eot":Q="application/vnd.ms-fontobject";break}return new Response(K,{headers:{"Content-Type":Q}})}let F=_[Z.pathname];if(!F&&!Z.pathname.endsWith("/"))F=_[`${Z.pathname}/`];if(!F)for(let K of X){let k=Z.pathname.match(K.pattern);if(k){let Q=_[K.routeTemplate];if(Q){let O={};for(let V=0;V<K.paramNames.length;V++)O[K.paramNames[V]]=decodeURIComponent(k[V+1]);let H=Q.content,E=`<script>window.__routeParams = ${JSON.stringify(O)};</script>`;if(H.includes("</head>"))H=H.replace("</head>",`${E}
|
|
171
|
-
</head>`);else H=E+H;F={...Q,content:H}}break}}if(F)return s(F.content).then((K)=>{if(K.includes("</head>"))K=K.replace("</head>",`${QJ}
|
|
172
|
-
</head>`);return new Response(K,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})});let U=d.join(v,Z.pathname);if(_G.existsSync(U)&&_G.statSync(U).isFile()){let K=Bun.file(U),k=d.extname(U).toLowerCase(),Q="text/plain";if(k===".ts"||k===".tsx"){let O=new Bun.Transpiler({loader:k===".tsx"?"tsx":"ts"}),H=await K.text(),E=O.transformSync(H);return new Response(E,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(k){case".html":Q="text/html";break;case".css":Q="text/css";break;case".js":Q="text/javascript";break;case".json":Q="application/json";break;case".png":Q="image/png";break;case".jpg":case".jpeg":Q="image/jpeg";break;case".gif":Q="image/gif";break;case".svg":Q="image/svg+xml";break;case".ico":Q="image/x-icon";break;case".woff":Q="font/woff";break;case".woff2":Q="font/woff2";break;case".ttf":Q="font/ttf";break;case".otf":Q="font/otf";break;case".eot":Q="application/vnd.ms-fontobject";break}return new Response(K,{headers:{"Content-Type":Q}})}if(Z.pathname!=="/"&&_["/"]){let K=$.headers.get("X-STX-Router")==="true";return s(_["/"].content).then((k)=>{if(K){let Q=k.match(/<main[^>]*>([\s\S]*?)<\/main>/i);if(Q){let O=k.match(/<title[^>]*>([\s\S]*?)<\/title>/i),E=`<!DOCTYPE html><html><head><title>${O?O[1]:""}</title></head><body><main>${Q[1]}</main></body></html>`;return new Response(E,{headers:{"Content-Type":"text/html","X-STX-Partial":"true","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}return new Response(k,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})})}return new Response("Not Found",{status:404})},error($){return new Response(`<pre>${$}
|
|
173
|
-
${$.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});console.clear(),console.log(`
|
|
174
|
-
${G.blue}stx${G.reset} ${G.green}${process.env.stx_VERSION||"v0.0.10"}${G.reset} ${G.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${G.reset}`),console.log(`
|
|
175
|
-
${G.bright}\u2192 ${G.cyan}http://localhost:${f}/${G.reset}`),console.log(`
|
|
176
|
-
${G.yellow}Routes:${G.reset}`);let l=new Set(X.map(($)=>$.routeTemplate)),R=Object.entries(_).filter(([$])=>!l.has($)).sort(([$],[Z])=>$.localeCompare(Z)).map(([$,Z])=>({route:$==="/"?"/":$,filePath:d.relative(process.cwd(),Z.filePath),fileType:Z.fileType}));for(let $ of X){let Z=$.routeTemplate.replace(/\[([^\]]+)\]/g,":$1");R.push({route:Z,filePath:d.relative(process.cwd(),$.filePath),fileType:"stx"})}if(R.sort(($,Z)=>$.route.localeCompare(Z.route)),R.forEach(($,Z)=>{let F=Z===R.length-1?"\u2514\u2500 ":"\u251C\u2500 ",U=$.fileType==="md"?`${G.magenta}(markdown)${G.reset}`:"";console.log(` ${G.green}${F}${$.route}${G.reset} \u2192 ${G.bright}${$.filePath}${G.reset} ${U}`)}),console.log(`
|
|
177
|
-
Press ${G.cyan}h${G.reset} + ${G.cyan}Enter${G.reset} to show shortcuts`),NG(h.url.toString(),()=>{if(y)_G.watch(j,{recursive:!0}).close();h.stop()}),y){console.log(`${G.blue}Watching for changes...${G.reset}`);let $=_G.watch(j,{recursive:!0},async(Z,M)=>{if(!M)return;if(M.endsWith(".stx")||M.endsWith(".js")||M.endsWith(".ts")||M.endsWith(".md"))console.log(`${G.yellow}File ${G.bright}${M}${G.yellow} changed, rebuilding...${G.reset}`),UG.clear(),LG(),await C()});process.on("SIGINT",()=>{$.close(),h.stop(),process.exit(0)})}return!0}var{serve:RJ}=globalThis.Bun;import a from"fs";import D from"path";function hG(S){let B=Bun.file(S),I=D.extname(S).toLowerCase(),y={".html":"text/html",".css":"text/css",".js":"text/javascript",".json":"application/json",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".ico":"image/x-icon",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"},j=[".js",".css",".json"].includes(I)?{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}:{};return new Response(B,{headers:{"Content-Type":y[I]||"application/octet-stream",...j}})}async function yJ(S=".",B={}){let I=B.port||3000,y=B.watch!==!1,v=B.hotReload!==!1&&y,j=null,_=B.hmrPort||I+1,X=D.resolve(S),{loadStxConfig:C}=await import("././index.js"),b=await C(X),f=b.root&&b.root!=="."?D.join(X,b.root):X,h=b.pagesDir||"pages",l=D.join(f,h);if(!a.existsSync(l))return console.error(`${G.red}Error: No '${h}' directory found in ${G.bright}${f}${G.reset}`),console.log(`${G.dim}Create a ${h}/ directory with .stx files to define your routes.${G.reset}`),console.log(`${G.dim}Example: ${h}/index.stx for the homepage.${G.reset}`),!1;let R=uG(f);if(R.length===0)return console.error(`${G.red}Error: No page files found in ${G.bright}${l}${G.reset}`),!1;console.log(`${G.blue}Found ${G.bright}${R.length}${G.blue} routes${G.reset}`);let $=b?._pluginPageDirs||[],Z=[];for(let{dir:J,prefix:L}of $)if(a.existsSync(J)){let N=uG(D.dirname(J),{pagesDir:D.basename(J)});for(let A of N){let q=L==="/"?A.pattern:`${L}${A.pattern==="/"?"":A.pattern}`;Z.push({route:{...A,pattern:q},prefix:L})}if(N.length>0)console.log(`${G.blue}Plugin pages: ${G.bright}${N.length}${G.blue} routes at ${G.cyan}${L}${G.reset}`)}let M=new Map,F=null,U=null;if(B.stxOptions?.shell!==!1){if(U=await kJ(X,B.stxOptions?.shell),U){if(F=await cG(U,B.stxOptions||{}),F)console.log(`${G.blue}Using app shell: ${G.bright}${D.relative(X,U)}${G.reset} ${G.dim}(deprecated: use layouts/default.stx instead)${G.reset}`)}}$J(),await _J(X);let K=YJ();if(K.length>0)console.log(`${G.blue}Loaded ${G.bright}${K.length}${G.blue} middleware: ${G.dim}${K.join(", ")}${G.reset}`);let k={},Q=null;try{let{loadStxConfig:J}=await import("././index.js"),L=await J(X);if(L?.apiRouter)Q=L?.apiRouter,console.log(`${G.blue}Using custom router for API handling${G.reset}`);if(L?.apiRoutes){k=L.apiRoutes;let N=Object.keys(k).length;if(N>0)console.log(`${G.blue}Loaded ${G.bright}${N} API route${N>1?"s":""}${G.reset}`)}if(L?.broadcasting?.enabled)try{let{startBroadcasting:N,loadChannels:A}=await import("././broadcasting.js"),q=L.broadcasting;await N(q);let o=q.port??6001;console.log(`${G.magenta}Broadcasting on ${G.cyan}ws://localhost:${o}/ws${G.reset}`);let r=D.join(process.cwd(),"channels.ts");if(a.existsSync(r))try{let VG=await A(r);console.log(`${G.blue}Loaded ${G.bright}${VG} broadcast channel${VG!==1?"s":""}${G.blue} from channels.ts${G.reset}`)}catch(VG){console.warn(`${G.yellow}Failed to load channels.ts: ${VG.message}${G.reset}`)}}catch(N){console.warn(`${G.yellow}Broadcasting failed to start: ${N.message}${G.reset}`)}}catch{}let O=D.join(X,".stx/output");a.mkdirSync(O,{recursive:!0});let H=new Map,E=new Set,V=async(J)=>{let L=UJ(l,J);if(!L)return null;try{let N=await Bun.build({entrypoints:[L],outdir:O,plugins:[kG],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...B.stxOptions});if(!N.success)return null;let A=N.outputs.find((q)=>q.path.endsWith(".html"));if(!A)return null;return await Bun.file(A.path).text()}catch{return null}},Y=async(J,L)=>{try{let{processDirectives:N,extractVariables:A,defaultConfig:q,loadStxConfig:o,injectRouterScript:r}=await import("././index.js"),{checkCache:VG,cacheTemplate:PG,readFileCached:p,templateCache:HG}=await import("././caching.js"),AG=await o(X),W=(x)=>{if(!x)return x;if(D.isAbsolute(x))return x;return D.resolve(X,x)},w={...q,...AG,...B.stxOptions,autoShell:!0};if(B.debugDirectives)w.debug=!0;w.partialsDir=W(w.partialsDir),w.componentsDir=W(w.componentsDir),w.layoutsDir=W(w.layoutsDir),w.storesDir=W(w.storesDir||"stores"),w.cachePath=W(w.cachePath||".stx/cache");let T=!L&&!B.profile,z=w.cache!==!1;if(z&&T){let x=HG.get(J.filePath);if(x)try{if((await a.promises.stat(J.filePath)).mtime.getTime()<=x.mtime){let YG=!0;for(let c of x.dependencies){if(!a.existsSync(c)){YG=!1;break}if((await a.promises.stat(c)).mtime.getTime()>x.mtime){YG=!1;break}}if(YG){let c=x.output;if(F)c=yG(c,{preserveHead:!0});return{route:J,content:c}}}}catch{}let JG=await VG(J.filePath,w);if(JG){let QG=JG;if(F)QG=yG(QG,{preserveHead:!0});return{route:J,content:QG}}}let g=z?await p(J.filePath):await Bun.file(J.filePath).text(),{classifyAllScripts:t}=await import("././index.js"),P=t(g),e=P.server.map((x)=>x.content),KG=g;for(let x of P.server)KG=KG.replace(x.fullTag,"");let GG={__filename:J.filePath,__dirname:D.dirname(J.filePath),params:L??{}},{resetHead:wJ}=await import("././head.js");wJ();for(let x of e)try{await A(x,GG,J.filePath)}catch(JG){if(B.stxOptions?.debug)console.error("[stx] variable extraction error",J.filePath,JG?.message||JG)}let fG=new Set,ZG;if(B.profile){let x=performance.now();ZG=await N(KG,GG,J.filePath,w,fG);let JG=performance.now()-x,QG=D.relative(X,J.filePath)||J.filePath;console.log(`[stx:profile] ${QG} \u2192 ${JG.toFixed(2)}ms`)}else ZG=await N(KG,GG,J.filePath,w,fG);if(!F)ZG=await r(ZG);{let{interpolateScriptExpressions:x}=await import("././expressions.js");ZG=ZG.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/g,(JG,QG,YG)=>{if(!/function\s+__stx_setup_/.test(YG))return JG;return`<script${QG}>${x(YG,GG)}</script>`})}if(F)ZG=yG(ZG,{preserveHead:!0});if(z&&T)await PG(J.filePath,ZG,fG,w);let{extractStreamBoundaries:DJ}=await import("././streaming.js"),OG=DJ(GG),FG=GG.__streamTemplates;if(FG&&typeof FG==="object"&&Object.keys(FG).length>0){let x=GG.streamBoundaries||{},JG={...w,autoShell:!1},QG=Object.keys(FG).map((c)=>({id:c,render:async()=>{let rG=typeof x[c]==="function"?await x[c]():void 0;return N(FG[c],{...GG,$boundary:rG},J.filePath,JG,new Set)}})),YG=new Set(QG.map((c)=>c.id));OG=[...(OG||[]).filter((c)=>!YG.has(c.id)),...QG]}if(OG&&OG.length>0)E.add(J.pattern);else OG=void 0;return{route:J,content:ZG,boundaries:OG}}catch(N){return console.error(`${G.red}Error building ${G.bright}${J.pattern}${G.reset}:`,N),null}},u=8,n=async()=>{H.clear(),M.clear();for(let J=0;J<R.length;J+=u){let L=R.slice(J,J+u),N=await Promise.all(L.map((A)=>Y(A)));for(let A of N)if(A)H.set(A.route.pattern,A)}for(let J=0;J<Z.length;J+=u){let L=Z.slice(J,J+u),N=await Promise.all(L.map(({route:A})=>Y(A)));for(let A of N)if(A)M.set(A.route.pattern,A)}return H.size>0};if(console.log(`${G.blue}Building pages...${G.reset}`),!await n())return console.error(`${G.red}No pages were successfully built${G.reset}`),!1;await jG(X);let zG=I;try{if(zG=await IG(I),zG!==I)console.log(`${G.yellow}Port ${I} is busy, using port ${zG} instead${G.reset}`)}catch{return console.error(`${G.red}Could not find an available port${G.reset}`),!1}if(v){let J=B.hmrPort||zG+1;j=SG({wsPort:J,verbose:!1}),_=j.start(J)}let CG=(J,L)=>{let N=`<script>(function(){var s=typeof stx!=='undefined'?stx:{};s._rp=${JSON.stringify(L)};if(s.setRouteParams)s.setRouteParams(s._rp);})()</script>`;if(J.includes("</head>"))return J.replace("</head>",`${N}</head>`);if(J.includes("<body"))return J.replace(/<body([^>]*)>/,`<body$1>${N}`);return N+J};console.log(`${G.blue}Starting server...${G.reset}`);let bG=RJ({port:zG,async fetch(J){let L=new URL(J.url),N=b?.publicDir||"public",A=D.join(X,N,L.pathname),q=D.join(X,L.pathname),o=D.join(O,L.pathname),[r,VG,PG]=await Promise.all([a.promises.stat(A).catch(()=>null),a.promises.stat(q).catch(()=>null),a.promises.stat(o).catch(()=>null)]);if(r?.isFile())return hG(A);if(VG?.isFile())return hG(q);if(PG?.isFile())return hG(o);if(L.pathname.startsWith("/_stx/component/")){let W=decodeURIComponent(L.pathname.slice(16));if(W)try{let w=`<${W} />`,T={...buildConfig,autoShell:!1},z=await processDirectives(w,{},D.join(X,"components",`${W}.stx`),T,new Set);return new Response(z,{headers:{"Content-Type":"text/html"}})}catch(w){return new Response(`<div class="stx-async-error">${w.message}</div>`,{status:500,headers:{"Content-Type":"text/html"}})}}if(L.pathname==="/_stx/img"){let{handleImageRequest:W}=await import("./image-optimization/serve.js"),w=await W(J,{publicDir:D.join(X,N),cacheDir:D.join(X,".stx/cache/img")});if(w)return w}if(Q)try{let W=await Q.handleRequest(J);if(W.status!==404)return W}catch{}if(k[L.pathname])try{return await k[L.pathname](J)}catch(W){return new Response(JSON.stringify({error:W.message}),{status:500,headers:{"Content-Type":"application/json"}})}let p=pG(L.pathname,R);if(p){let W=H.get(p.route.pattern),w=E.has(p.route.pattern);if(p.route.isDynamic&&Object.keys(p.params).length>0||w){let T=await Y(p.route,p.params);if(T)W=T}if(W){let T=ZJ();if(T.validate){if(!await T.validate({params:p.params})){let t=await V(404);if(t){let P=t;if(P=await s(P,X),v)P=$G(P,_);return new Response(P,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}}if(T.middleware){let g=KJ(L.pathname,p.params,T,L.search),t=VJ(g,null,J),P=await zJ(T.middleware,t);if(P.redirect){let e=P.redirect.path,KG=P.redirect.options.redirectCode||302,GG=new Headers(P.responseHeaders);return GG.set("Location",e),new Response(null,{status:KG,headers:GG})}if(P.abort){let{statusCode:e,message:KG}=P.abort.error;return new Response(`<!DOCTYPE html><html><head><title>Error ${e}</title></head><body><h1>Error ${e}</h1><p>${KG}</p></body></html>`,{status:e,headers:{"Content-Type":"text/html"}})}if(Object.keys(P.state).length>0){let e=`<script>(function(){var s=typeof stx!=='undefined'?stx:{};s._ms=${JSON.stringify(P.state)};if(s.setMiddlewareState)s.setMiddlewareState(s._ms);})()</script>`;W.content=W.content.replace("</head>",`${e}</head>`)}}let z=W.content;if(F&&BJ(J)){let g=OJ(z),t=z.match(/<title[^>]*>([\s\S]*?)<\/title>/i),P=t?t[1].trim():"";if(Object.keys(p.params).length>0)z=CG(z,p.params);z=await s(z,X);let e=b?.router?.container||"main";return z=WJ(z,e),new Response(z,{headers:{"Content-Type":"text/html","X-STX-Fragment":"true","X-STX-Layout":g.layout,"X-STX-Layout-Group":g.group,...P&&{"X-STX-Title":encodeURIComponent(P)},"Cache-Control":"no-store, no-cache, must-revalidate"}})}if(F)z=RG(F,z);if(Object.keys(p.params).length>0)z=CG(z,p.params);if(z=await s(z,X),v)z=$G(z,_);if(B.native)if(z.includes("<head>"))z=z.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else z="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+z;if(B.titlebarHidden)if(z.includes("<head>"))z=z.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else z=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${z}`;if(W.boundaries&&W.boundaries.length>0){let{renderStreamingPage:g,streamToResponse:t}=await import("././streaming.js");return t(g(z,W.boundaries,{timeoutMs:30000}),{headers:{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}return new Response(z,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}if(Z.length>0){let W=Z.map((T)=>T.route),w=pG(L.pathname,W);if(w){let T=M.get(w.route.pattern);if(T){let z=T.content;if(F)z=RG(F,z);if(Object.keys(w.params).length>0)z=CG(z,w.params);if(z=await s(z,X),v)z=$G(z,_);return new Response(z,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}for(let{prefix:T}of $)if(T!=="/"&&L.pathname.startsWith(T)){let z=M.get(T)||M.get(T+"/");if(z){let g=z.content;if(F)g=RG(F,g);if(g=await s(g,X),v)g=$G(g,_);return new Response(g,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}}let HG=H.get("/");if(HG){let W=HG.content;if(W=await s(W,X),v)W=$G(W,_);if(B.native)if(W.includes("<head>"))W=W.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else W="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+W;return new Response(W,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}let AG=await V(404);if(AG){let W=AG;if(W=await s(W,X),v)W=$G(W,_);return new Response(W,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})},async error(J){let L=await V(500);if(L)return new Response(L,{status:500,headers:{"Content-Type":"text/html"}});return new Response(`<pre>${J}
|
|
178
|
-
${J.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});if(console.clear(),console.log(`
|
|
179
|
-
${G.blue}stx${G.reset} ${G.green}${process.env.stx_VERSION||"v0.0.10"}${G.reset} ${G.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${G.reset}`),console.log(`
|
|
180
|
-
${G.bright}\u2192 ${G.cyan}http://localhost:${zG}/${G.reset}`),v)console.log(`${G.dim} HMR: ws://localhost:${_}${G.reset}`);console.log(`
|
|
181
|
-
${G.yellow}Routes:${G.reset}`);let gG=[...LJ(R,X)];for(let{route:J}of Z)gG.push(`${J.pattern}`);if(gG.forEach((J,L)=>{let A=L===gG.length-1?"\u2514\u2500 ":"\u251C\u2500 ";console.log(` ${G.green}${A}${G.reset}${J}`)}),console.log(`
|
|
182
|
-
Press ${G.cyan}h${G.reset} + ${G.cyan}Enter${G.reset} to show shortcuts`),NG(bG.url.toString(),()=>{if(j)EG();bG.stop()}),B.native){let J,L=D.join(l,"index.stx");if(a.existsSync(L)){let A=await Bun.file(L).text();J=DG(A)}let N=b?.app?.window??{};await wG(zG,{title:b?.app?.head?.title||D.basename(X)||"stx App",width:N.width,height:N.height,darkMode:N.darkMode,hotReload:N.hotReload,titlebarHidden:N.titlebarHidden??B.titlebarHidden===!0,nativeSidebar:!!J,sidebarConfig:J})}if(y){console.log(`${G.blue}Watching for changes...${G.reset}`);let J=(A)=>{return A.startsWith("public/")||A.startsWith("public\\")},L=(A)=>{let q=A.toLowerCase();return q.endsWith(".stx")||q.endsWith(".html")||q.endsWith(".md")},N=a.watch(X,{recursive:!0},async(A,q)=>{if(!q||TG(q))return;if(xG(q))if(J(q)){if(console.log(`${G.cyan}${q} changed${G.reset}`),v&&j)j.reload(q)}else if(L(q)){console.log(`${G.yellow}${q} changed, rebuilding...${G.reset}`),UG.clear(),LG();try{let{invalidateFileCache:o,templateCache:r}=await import("././caching.js");o(D.resolve(X,q)),r.delete(D.resolve(X,q))}catch{}if(U&&q){if(D.resolve(X,q)===U||D.basename(U)===q){let r=await cG(U,B.stxOptions||{});if(r)F=r}}if(await n(),await MG(X),v&&j)j.reload(q)}else{console.log(`${G.yellow}${q} changed, rebuilding...${G.reset}`),UG.clear(),LG();try{let{invalidateFileCache:o,templateCache:r}=await import("././caching.js");o(D.resolve(X,q)),r.delete(D.resolve(X,q))}catch{}if(await n(),v&&j)j.reload(q)}else if(vG(q)){if(console.log(`${G.cyan}CSS ${q} changed${G.reset}`),v&&j)j.updateCss(q)}});process.on("SIGINT",()=>{if(N.close(),j)EG();bG.stop(),process.exit(0)})}return!0}var cX={};var kG={name:"bun-plugin-stx",async setup(S){let I={...await EJ(),...S.config?.stx},y=new Set,v=I.webComponents?.enabled?`./${qG.relative(qG.dirname(S.config?.outdir||"dist"),I.webComponents.outputDir||"dist/web-components")}`:"/web-components",j=[];if(I.webComponents?.enabled)try{let _=await FJ(I,y);if(j.push(..._),I.debug&&_.length>0)console.log(`Successfully built ${_.length} web components`)}catch(_){console.error("Failed to build web components:",_)}S.onLoad({filter:/\.stx$/},async({path:_})=>{try{let X=new Set;if(I.cache&&I.cachePath){let Z=await HJ(_,I);if(Z){if(I.debug)console.log(`Using cached version of ${_}`);return{contents:Z,loader:"html"}}}let C=await aG(()=>Bun.file(_).text(),"",(Z)=>{throw new sG(`Failed to read stx file: ${_}`,_,void 0,void 0,`File read error: ${Z.message}`)});if(!C)throw new sG(`stx file is empty: ${_}`,_);let{scriptContent:b,templateContent:f,allScripts:h}=iG.time("script-extraction",()=>{let Z=C,M=C.match(/<template\b(?![^>]*(?:\b(?:id|x-for|x-if|@for|@if|:for|:if)\s*=|\s#[\w-]|\bv-slot|\bslot\s*=))[^>]*>([\s\S]*?)<\/template>/i);if(M)Z=M[1].trim();let F=C.match(/<script\b[^>]*>[\s\S]*?<\/script>/gi)||[],U="",K=[];for(let Q of F){let O=Q.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i)?.[1]||"",H=Q.match(/<script\b([^>]*)>/i),E=H?H[1]:"";if(/\bserver\b/i.test(E))U=O;else K.push(Q)}let k=Z.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"");return{scriptContent:U,templateContent:k,allScripts:K}}),l={__filename:_,__dirname:qG.dirname(_),__stx:{webComponentsPath:v,builtComponents:j}};await aG(()=>qJ(b,l,_),void 0,(Z)=>{let M=new lG(`Script execution failed in ${_}: ${Z.message}`,_,void 0,void 0,b.substring(0,100));if(nG.log(M,{filePath:_,scriptContent:b}),I.debug)throw M});let $=await iG.timeAsync("directive-processing",async()=>{return await MJ(f,l,_,I,X)});if(h.length>0){let{interpolateScriptsInTemplate:Z}=await import("././expressions.js"),M=Z(h.join(`
|
|
183
|
-
`),l),F=$.search(/<\/body>/i);if(F!==-1)$=$.slice(0,F)+M+`
|
|
184
|
-
`+$.slice(F);else $+=`
|
|
185
|
-
${M}`}if($=await jJ($),X.forEach((Z)=>y.add(Z)),I.cache&&I.cachePath){if(await AJ(_,$,X,I),I.debug)console.log(`Cached template ${_} with ${X.size} dependencies`)}return{contents:$,loader:"html"}}catch(X){let C=X instanceof Error?X:new lG(`Plugin processing failed: ${String(X)}`,_);if(nG.log(C,{filePath:_,buildConfig:S.config}),NJ.logDetailedError(C,{filePath:_,plugin:"bun-plugin-stx"}),I.debug)console.error("stx Plugin Error:",C);let b=C,f=b.line||null,h=b.context||null;return{contents:I.debug||IJ()?`<!DOCTYPE html>
|
|
186
|
-
<html lang="en">
|
|
187
|
-
<head>
|
|
188
|
-
<meta charset="UTF-8">
|
|
189
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
190
|
-
<title>stx Rendering Error</title>
|
|
191
|
-
<style>
|
|
192
|
-
body { font-family: system-ui, -apple-system, sans-serif; max-width: 800px; margin: 40px auto; padding: 20px; line-height: 1.6; }
|
|
193
|
-
.error-header { color: #dc3545; border-left: 4px solid #dc3545; padding-left: 16px; margin-bottom: 24px; }
|
|
194
|
-
.error-details { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 8px; padding: 16px; margin: 16px 0; }
|
|
195
|
-
.error-code { background: #2d3748; color: #e2e8f0; padding: 16px; border-radius: 8px; overflow-x: auto; font-family: 'Monaco', 'Menlo', monospace; font-size: 14px; }
|
|
196
|
-
.help-section { background: #e3f2fd; border-left: 4px solid #2196f3; padding: 16px; margin-top: 24px; }
|
|
197
|
-
.file-path { font-family: monospace; background: #f1f3f4; padding: 2px 6px; border-radius: 4px; }
|
|
198
|
-
</style>
|
|
199
|
-
</head>
|
|
200
|
-
<body>
|
|
201
|
-
<div class="error-header">
|
|
202
|
-
<h1>stx Template Error</h1>
|
|
203
|
-
<p>An error occurred while processing your stx template.</p>
|
|
204
|
-
</div>
|
|
205
|
-
|
|
206
|
-
<div class="error-details">
|
|
207
|
-
<h3>Error Details</h3>
|
|
208
|
-
<p><strong>File:</strong> <span class="file-path">${BG(_)}</span></p>
|
|
209
|
-
<p><strong>Error:</strong> ${BG(C.message)}</p>
|
|
210
|
-
${f?`<p><strong>Line:</strong> ${BG(String(f))}</p>`:""}
|
|
211
|
-
${h?`<p><strong>Context:</strong> ${BG(String(h))}</p>`:""}
|
|
212
|
-
</div>
|
|
213
|
-
|
|
214
|
-
${C.stack?`
|
|
215
|
-
<div class="error-details">
|
|
216
|
-
<h3>Stack Trace</h3>
|
|
217
|
-
<pre class="error-code">${BG(C.stack)}</pre>
|
|
218
|
-
</div>`:""}
|
|
219
|
-
|
|
220
|
-
<div class="help-section">
|
|
221
|
-
<h3>Troubleshooting Tips</h3>
|
|
222
|
-
<ul>
|
|
223
|
-
<li>Check the syntax of your stx directives (e.g., @if, @foreach)</li>
|
|
224
|
-
<li>Verify that all variables used in the template are properly defined</li>
|
|
225
|
-
<li>Ensure script tags have valid JavaScript/TypeScript syntax</li>
|
|
226
|
-
<li>Run <code>stx debug ${BG(qG.basename(_))}</code> for detailed analysis</li>
|
|
227
|
-
<li>Enable debug mode in your stx config for more detailed error messages</li>
|
|
228
|
-
</ul>
|
|
229
|
-
</div>
|
|
230
|
-
</body>
|
|
231
|
-
</html>`:`<!DOCTYPE html>
|
|
232
|
-
<html lang="en">
|
|
233
|
-
<head>
|
|
234
|
-
<meta charset="UTF-8">
|
|
235
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
236
|
-
<title>Error</title>
|
|
237
|
-
<style>
|
|
238
|
-
body { font-family: system-ui, -apple-system, sans-serif; max-width: 600px; margin: 80px auto; padding: 20px; text-align: center; color: #333; }
|
|
239
|
-
</style>
|
|
240
|
-
</head>
|
|
241
|
-
<body>
|
|
242
|
-
<h1>Something went wrong</h1>
|
|
243
|
-
<p>An internal error occurred. Please try again later.</p>
|
|
244
|
-
</body>
|
|
245
|
-
</html>`,loader:"html"}}})}},t0=kG;
|
|
246
|
-
export{kG as pf,t0 as qf,xJ as rf,XJ as sf,SJ as tf,yJ as uf,cX as vf};
|
package/dist/chunk-qvrbjpdc.js
DELETED
package/dist/chunk-qygvvygy.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{gz as i}from"./chunk-gz5fmp3q.js";function a(e,t){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let o=e.static[t];if(typeof o==="string")return o;return}var r={sm:"max-width:24rem",md:"max-width:32rem",lg:"max-width:42rem",xl:"max-width:56rem",full:"max-width:calc(100vw - 2rem);max-height:calc(100vh - 2rem)"},x={name:"StxModal",aliases:["stx-modal"],render(e,t,o){let d=a(e,"id");if(!d)return console.warn('[stx] <StxModal> requires an "id" prop'),"<!-- StxModal: missing id prop -->";let s=i(d),n=a(e,"size")||"md",l=a(e,"closeOnBackdrop")!=="false",c=a(e,"closeOnEscape")!=="false",m=r[n]||r.md;return`<div id="stx-modal-${s}" class="stx-modal-backdrop" data-stx-modal="${s}" data-close-backdrop="${l}" data-close-escape="${c}" style="display:none;position:fixed;inset:0;z-index:99999;align-items:center;justify-content:center;background:rgba(0,0,0,0.5);backdrop-filter:blur(2px);opacity:0;transition:opacity 0.2s ease" aria-modal="true" role="dialog">
|
|
3
|
-
<div class="stx-modal-panel" style="${m};width:100%;margin:1rem;border-radius:0.75rem;box-shadow:0 20px 60px rgba(0,0,0,0.3);overflow:hidden;transform:scale(0.95) translateY(8px);transition:transform 0.2s ease,opacity 0.2s ease;opacity:0;background:var(--stx-modal-bg,#fff);color:var(--stx-modal-text,#1f2937)">
|
|
4
|
-
<div style="padding:1.5rem">${t}</div>
|
|
5
|
-
</div>
|
|
6
|
-
</div>
|
|
7
|
-
<style>
|
|
8
|
-
@media(prefers-color-scheme:dark){[data-stx-modal]{--stx-modal-bg:#1f2937;--stx-modal-text:#f3f4f6}}
|
|
9
|
-
.stx-modal-backdrop[data-stx-modal-open]{display:flex!important;opacity:1}
|
|
10
|
-
.stx-modal-backdrop[data-stx-modal-open] .stx-modal-panel{transform:scale(1) translateY(0);opacity:1}
|
|
11
|
-
</style>`}};
|
|
12
|
-
export{x as fz};
|
package/dist/chunk-r0jcmpv6.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var B=null,F=[],J=0;function K(){return`stx-${++J}`}function M(q=null){return{scopeId:K(),parent:q,provides:new Map(q?.provides),exposed:null,refs:{},props:{},attrs:{},slots:{},emit:()=>{},el:null,errorCapturedHooks:[],isMounted:!1}}function N(q){if(q)F.push(q);else if(F.length>0)F.pop();B=q||F[F.length-1]||null}function O(){return B}function Q(){B=null,F.length=0}function R(q,w){if(B)B.provides.set(q,w);else H.set(q,w)}function U(q,w){let z=B;while(z){if(z.provides.has(q))return z.provides.get(q);z=z.parent}if(H.has(q))return H.get(q);return w}var H=new Map;function W(q,w){H.set(q,w)}function X(q){let w=B,z=(D,...E)=>{if(typeof document>"u")return;if(w?.el)w.el.dispatchEvent(new CustomEvent(D,{detail:E.length===1?E[0]:E,bubbles:!0,cancelable:!0}))};if(w)w.emit=z;return z}function Y(q){if(B)B.exposed=q}function Z(q){let w=Promise.resolve();return q?w.then(q):w}function _(q){if(B)B.errorCapturedHooks.push(q)}function $(q,w,z){let D=w?.parent;while(D){for(let E of D.errorCapturedHooks)if(E(q,w,z)===!1)return;D=D.parent}}function j(){return B?.slots??{}}function A(){return B?.slots??{}}function G(){return B?.attrs??{}}function T(q){let w=q.__provides?new Map(Object.entries(q.__provides)):new Map;return{...q,__provides:w,__provide(z,D){w.set(z,D)},__inject(z,D){if(w.has(z))return w.get(z);if(q.__provides){let E=q.__provides instanceof Map?q.__provides:new Map(Object.entries(q.__provides));if(E.has(z))return E.get(z)}return D}}}function b(){return`
|
|
3
|
-
// STX Composition API Runtime
|
|
4
|
-
(function() {
|
|
5
|
-
const _provides = new Map();
|
|
6
|
-
const _scopes = window.__stx_scopes || (window.__stx_scopes = {});
|
|
7
|
-
const _exposed = window.__stx_exposed || (window.__stx_exposed = {});
|
|
8
|
-
|
|
9
|
-
// provide() stores values in the nearest scope's provide map
|
|
10
|
-
window.__stx_provide = function(key, value) {
|
|
11
|
-
_provides.set(key, value);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
// inject() walks up DOM ancestors with data-stx-scope to find provided values
|
|
15
|
-
window.__stx_inject = function(key, defaultValue, el) {
|
|
16
|
-
// Walk up the DOM tree
|
|
17
|
-
let current = el ? el.closest('[data-stx-scope]') : null;
|
|
18
|
-
while (current) {
|
|
19
|
-
const scopeId = current.getAttribute('data-stx-scope');
|
|
20
|
-
const scope = _scopes[scopeId];
|
|
21
|
-
if (scope && scope.__provided && scope.__provided.has(key)) {
|
|
22
|
-
return scope.__provided.get(key);
|
|
23
|
-
}
|
|
24
|
-
current = current.parentElement ? current.parentElement.closest('[data-stx-scope]') : null;
|
|
25
|
-
}
|
|
26
|
-
// Check global provides
|
|
27
|
-
if (_provides.has(key)) return _provides.get(key);
|
|
28
|
-
return defaultValue;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
// defineEmits() returns an emit function
|
|
32
|
-
window.__stx_defineEmits = function(scopeId) {
|
|
33
|
-
return function emit(event, ...args) {
|
|
34
|
-
const el = document.querySelector('[data-stx-scope="' + scopeId + '"]');
|
|
35
|
-
if (el) {
|
|
36
|
-
el.dispatchEvent(new CustomEvent(event, {
|
|
37
|
-
detail: args.length === 1 ? args[0] : args,
|
|
38
|
-
bubbles: true,
|
|
39
|
-
cancelable: true
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// defineExpose() registers exposed properties
|
|
46
|
-
window.__stx_defineExpose = function(scopeId, exposed) {
|
|
47
|
-
_exposed[scopeId] = exposed;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
// nextTick()
|
|
51
|
-
window.__stx_nextTick = function(fn) {
|
|
52
|
-
return Promise.resolve().then(fn);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// Template ref resolution
|
|
56
|
-
window.__stx_resolveRefs = function(scopeId) {
|
|
57
|
-
const scope = document.querySelector('[data-stx-scope="' + scopeId + '"]');
|
|
58
|
-
if (!scope) return {};
|
|
59
|
-
const refs = {};
|
|
60
|
-
// eslint-disable-next-line pickier/no-unused-vars
|
|
61
|
-
scope.querySelectorAll('[data-stx-ref]').forEach(function(el) {
|
|
62
|
-
refs[el.getAttribute('data-stx-ref')] = el;
|
|
63
|
-
});
|
|
64
|
-
return refs;
|
|
65
|
-
};
|
|
66
|
-
})();
|
|
67
|
-
`}
|
|
68
|
-
export{K as Tq,M as Uq,N as Vq,O as Wq,Q as Xq,R as Yq,U as Zq,W as _q,X as $q,Y as ar,Z as br,_ as cr,$ as dr,j as er,A as fr,G as gr,T as hr,b as ir};
|
package/dist/chunk-r5m9xtm7.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{fy as y}from"./chunk-bs3gmfxz.js";function O(j,H){let F=R(j,H);return F.ok?{expression:F.expression,endPos:F.endPos}:null}function R(j,H){let F=H;while(F<j.length&&/\s/.test(j[F]))F++;if(j[F]!=="(")return{ok:!1,reason:"missing-open-paren",pos:F};let L=y(j,"(",")",F);if(L===-1)return{ok:!1,reason:"unclosed-paren",pos:F};return{ok:!0,expression:j.slice(F+1,L),endPos:L+1}}function z(j,H,F,L){let Q=1,A=L,V=new RegExp(`@${H}\\s*\\(`,"g"),J=new RegExp(`@${F}(?![a-z])`,"g");while(A<j.length&&Q>0){V.lastIndex=A,J.lastIndex=A;let W=V.exec(j),q=J.exec(j),G=W?W.index:1/0,U=q?q.index:1/0;if(G<U)Q++,A=G+W[0].length;else if(U<1/0){if(Q--,Q===0)return U;A=U+q[0].length}else break}return-1}function I(j,H){let F=j.slice(H).match(/^@if\s*/);if(!F)return null;let L=H+F[0].length,Q=O(j,L);if(!Q)return null;let A=Q.endPos,V=z(j,"if","endif",A);if(V===-1)return null;let J=j.slice(A,V),W=[],q=0,G="if",U=Q.expression,K=0,Z=0;while(q<J.length){let X=J.indexOf("@",q);if(X===-1)break;q=X;let Y=J.substring(X);if(/^@if\s*\(/.test(Y)){Z++,q++;continue}if(/^@endif(?![a-z])/.test(Y)){Z--,q+=6;continue}if(Z===0){let _=Y.match(/^@elseif\s*/);if(_){W.push({type:G,condition:U,content:J.substring(K,q),start:A+K,end:A+q});let B=q+_[0].length,$=O(J,B);if(!$){q++;continue}G="elseif",U=$.expression,q=$.endPos,K=q;continue}else if(/^@else(?![a-z])/.test(Y)){W.push({type:G,condition:U,content:J.substring(K,q),start:A+K,end:A+q}),G="else",U=void 0,q+=5,K=q;continue}}q++}return W.push({type:G,condition:U,content:J.slice(K),start:A+K,end:A+J.length}),{fullMatch:j.slice(H,V+6),branches:W,start:H,end:V+6}}function v(j){let H=[],F=/@if\s*\(/g,L=F.exec(j);while(L!==null){if(H.some((V)=>L.index>V.start&&L.index<V.end)){L=F.exec(j);continue}let A=I(j,L.index);if(A)H.push(A),F.lastIndex=A.end;L=F.exec(j)}return H}function w(j,H,F){let L=[],Q=new RegExp(`@${H}\\s*\\(`,"g"),A=Q.exec(j);while(A!==null){if(L.some((Y)=>A.index>Y.start&&A.index<Y.end)){A=Q.exec(j);continue}let J=A.index,W=J+A[0].length-1,q=y(j,"(",")",W);if(q===-1){A=Q.exec(j);continue}let G=j.slice(W+1,q),U=q+1,K=z(j,H,F,U);if(K===-1){A=Q.exec(j);continue}let Z=j.slice(U,K),X=K+`@${F}`.length;L.push({fullMatch:j.slice(J,X),name:H,params:G,content:Z,start:J,end:X}),Q.lastIndex=X,A=Q.exec(j)}return L}function D(j,H){let F=j.slice(H).match(/^@switch\s*/);if(!F)return null;let L=H+F[0].length,Q=O(j,L);if(!Q)return null;let A=Q.endPos,V=z(j,"switch","endswitch",A);if(V===-1)return null;let J=j.slice(A,V),W=[],q=0,G=null,U=0;while(q<J.length){let K=J.slice(q),Z=K.match(/^@switch\s*\(/),X=K.match(/^@endswitch(?![a-z])/);if(Z){if(U++,G)G.content+=Z[0];q+=Z[0].length;continue}if(X){if(U--,G)G.content+=X[0];q+=X[0].length;continue}if(U>0){if(G)G.content+=J[q];q++;continue}let Y=K.match(/^@case\s*/),_=K.match(/^@default(?![a-z])/),B=K.match(/^@break(?![a-z])/);if(Y&&K.startsWith("@case")){if(G)W.push(G);let $=q+Y[0].length,k=O(J,$);if(!k){q++;continue}G={type:"case",value:k.expression,content:""},q=k.endPos}else if(_&&K.startsWith("@default")){if(G)W.push(G);G={type:"default",content:""},q+=_[0].length}else if(B&&K.startsWith("@break"))q+=B[0].length;else{if(G)G.content+=J[q];q++}}if(G)W.push(G);return{fullMatch:j.slice(H,V+10),expression:Q.expression,cases:W,start:H,end:V+10}}
|
|
3
|
-
export{O as Zx,R as _x,z as $x,I as ay,v as by,w as cy,D as dy};
|
package/dist/chunk-rh80q1nd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// @bun
|
package/dist/chunk-rkffm9sy.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import O from"fs";import Q from"path";var V="node_modules/@stacksjs/crosswind/dist/crosswind.css";async function k(b){let j=Q.join(b,V);try{return await O.promises.access(j),!0}catch{return!1}}async function X(b,j={}){let z=j.cssPath||Q.join(b.root,V);try{return await O.promises.readFile(z,"utf-8")}catch{return Y()}}function Y(){return`
|
|
3
|
-
/* Minimal utility classes (Crosswind fallback) */
|
|
4
|
-
|
|
5
|
-
/* Display */
|
|
6
|
-
.block { display: block; }
|
|
7
|
-
.inline-block { display: inline-block; }
|
|
8
|
-
.inline { display: inline; }
|
|
9
|
-
.flex { display: flex; }
|
|
10
|
-
.inline-flex { display: inline-flex; }
|
|
11
|
-
.grid { display: grid; }
|
|
12
|
-
.hidden { display: none; }
|
|
13
|
-
|
|
14
|
-
/* Flexbox */
|
|
15
|
-
.flex-row { flex-direction: row; }
|
|
16
|
-
.flex-col { flex-direction: column; }
|
|
17
|
-
.flex-wrap { flex-wrap: wrap; }
|
|
18
|
-
.items-start { align-items: flex-start; }
|
|
19
|
-
.items-center { align-items: center; }
|
|
20
|
-
.items-end { align-items: flex-end; }
|
|
21
|
-
.justify-start { justify-content: flex-start; }
|
|
22
|
-
.justify-center { justify-content: center; }
|
|
23
|
-
.justify-end { justify-content: flex-end; }
|
|
24
|
-
.justify-between { justify-content: space-between; }
|
|
25
|
-
.gap-1 { gap: 0.25rem; }
|
|
26
|
-
.gap-2 { gap: 0.5rem; }
|
|
27
|
-
.gap-3 { gap: 0.75rem; }
|
|
28
|
-
.gap-4 { gap: 1rem; }
|
|
29
|
-
|
|
30
|
-
/* Spacing */
|
|
31
|
-
.p-0 { padding: 0; }
|
|
32
|
-
.p-1 { padding: 0.25rem; }
|
|
33
|
-
.p-2 { padding: 0.5rem; }
|
|
34
|
-
.p-3 { padding: 0.75rem; }
|
|
35
|
-
.p-4 { padding: 1rem; }
|
|
36
|
-
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
|
|
37
|
-
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
|
|
38
|
-
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
|
|
39
|
-
.px-4 { padding-left: 1rem; padding-right: 1rem; }
|
|
40
|
-
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
|
|
41
|
-
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
|
|
42
|
-
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
|
|
43
|
-
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
|
|
44
|
-
.m-0 { margin: 0; }
|
|
45
|
-
.m-1 { margin: 0.25rem; }
|
|
46
|
-
.m-2 { margin: 0.5rem; }
|
|
47
|
-
.m-3 { margin: 0.75rem; }
|
|
48
|
-
.m-4 { margin: 1rem; }
|
|
49
|
-
.mx-auto { margin-left: auto; margin-right: auto; }
|
|
50
|
-
|
|
51
|
-
/* Typography */
|
|
52
|
-
.text-xs { font-size: 0.75rem; }
|
|
53
|
-
.text-sm { font-size: 0.875rem; }
|
|
54
|
-
.text-base { font-size: 1rem; }
|
|
55
|
-
.text-lg { font-size: 1.125rem; }
|
|
56
|
-
.text-xl { font-size: 1.25rem; }
|
|
57
|
-
.text-2xl { font-size: 1.5rem; }
|
|
58
|
-
.font-normal { font-weight: 400; }
|
|
59
|
-
.font-medium { font-weight: 500; }
|
|
60
|
-
.font-semibold { font-weight: 600; }
|
|
61
|
-
.font-bold { font-weight: 700; }
|
|
62
|
-
.text-left { text-align: left; }
|
|
63
|
-
.text-center { text-align: center; }
|
|
64
|
-
.text-right { text-align: right; }
|
|
65
|
-
|
|
66
|
-
/* Colors */
|
|
67
|
-
.text-white { color: #ffffff; }
|
|
68
|
-
.text-black { color: #000000; }
|
|
69
|
-
.text-gray-500 { color: #6b7280; }
|
|
70
|
-
.text-gray-700 { color: #374151; }
|
|
71
|
-
.bg-white { background-color: #ffffff; }
|
|
72
|
-
.bg-black { background-color: #000000; }
|
|
73
|
-
.bg-gray-100 { background-color: #f3f4f6; }
|
|
74
|
-
.bg-gray-200 { background-color: #e5e7eb; }
|
|
75
|
-
.bg-blue-500 { background-color: #3b82f6; }
|
|
76
|
-
.bg-green-500 { background-color: #22c55e; }
|
|
77
|
-
.bg-red-500 { background-color: #ef4444; }
|
|
78
|
-
|
|
79
|
-
/* Borders */
|
|
80
|
-
.border { border-width: 1px; }
|
|
81
|
-
.border-0 { border-width: 0; }
|
|
82
|
-
.border-2 { border-width: 2px; }
|
|
83
|
-
.border-gray-200 { border-color: #e5e7eb; }
|
|
84
|
-
.border-gray-300 { border-color: #d1d5db; }
|
|
85
|
-
.rounded { border-radius: 0.25rem; }
|
|
86
|
-
.rounded-md { border-radius: 0.375rem; }
|
|
87
|
-
.rounded-lg { border-radius: 0.5rem; }
|
|
88
|
-
.rounded-full { border-radius: 9999px; }
|
|
89
|
-
|
|
90
|
-
/* Sizing */
|
|
91
|
-
.w-full { width: 100%; }
|
|
92
|
-
.h-full { height: 100%; }
|
|
93
|
-
.w-auto { width: auto; }
|
|
94
|
-
.h-auto { height: auto; }
|
|
95
|
-
.min-w-0 { min-width: 0; }
|
|
96
|
-
.max-w-full { max-width: 100%; }
|
|
97
|
-
|
|
98
|
-
/* Position */
|
|
99
|
-
.relative { position: relative; }
|
|
100
|
-
.absolute { position: absolute; }
|
|
101
|
-
.fixed { position: fixed; }
|
|
102
|
-
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
|
|
103
|
-
|
|
104
|
-
/* Overflow */
|
|
105
|
-
.overflow-auto { overflow: auto; }
|
|
106
|
-
.overflow-hidden { overflow: hidden; }
|
|
107
|
-
.overflow-scroll { overflow: scroll; }
|
|
108
|
-
|
|
109
|
-
/* Cursor */
|
|
110
|
-
.cursor-pointer { cursor: pointer; }
|
|
111
|
-
.cursor-default { cursor: default; }
|
|
112
|
-
|
|
113
|
-
/* Opacity */
|
|
114
|
-
.opacity-0 { opacity: 0; }
|
|
115
|
-
.opacity-50 { opacity: 0.5; }
|
|
116
|
-
.opacity-100 { opacity: 1; }
|
|
117
|
-
|
|
118
|
-
/* Transitions */
|
|
119
|
-
.transition { transition-property: all; transition-duration: 150ms; }
|
|
120
|
-
.duration-150 { transition-duration: 150ms; }
|
|
121
|
-
.duration-300 { transition-duration: 300ms; }
|
|
122
|
-
`}async function M(b,j={}){return`<style id="crosswind-css">
|
|
123
|
-
${await X(b,j)}
|
|
124
|
-
</style>`}function w(b){let j=/class=["']([^"']+)["']/g,z=new Set,v=j.exec(b);while(v!==null){let G=v[1].split(/\s+/);for(let B of G)if(B.trim())z.add(B.trim());v=j.exec(b)}return Array.from(z)}function y(b,j){let z=b.split(`
|
|
125
|
-
`),v=[],G=!1,B="",K=!1;for(let q of z)if(q.includes("{")){G=!0,B=q;for(let J of j)if(q.includes(`.${J}`)||q.includes(`.${J} `)||q.includes(`.${J},`)||q.includes(`.${J}:`)){K=!0;break}}else if(q.includes("}")){if(K)v.push(B),v.push(q);G=!1,B="",K=!1}else if(G)B+=`
|
|
126
|
-
${q}`;else v.push(q);return v.join(`
|
|
127
|
-
`)}
|
|
128
|
-
export{k as qa,X as ra,M as sa,w as ta,y as ua};
|
package/dist/chunk-rpx5fa65.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Pi as E}from"./chunk-d1qh1x2g.js";import{bl as D}from"./chunk-80g54ncj.js";import{Oq as N}from"./chunk-d0zjtdw4.js";import{pB as x}from"./chunk-xv34zbp4.js";import C from"fs";import J from"path";var{serve:v}=globalThis.Bun;var y={".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 c(O={}){let Z=J.resolve(O.outputDir||".output"),k=O.port||3000,U=D(Z);if(!U)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${U.routes.length} routes...`);let V=new Map,Y=new Map,_=new Map;for(let w of U.routes)try{let K=J.join(Z,w.compiledPath),A=JSON.parse(await Bun.file(K).text());V.set(w.pattern,A),_.set(w.pattern,N(A.html));let W=J.join(Z,w.fragmentPath);if(await Bun.file(W).exists())Y.set(w.pattern,await Bun.file(W).text())}catch(K){console.warn(`[stx] Failed to load route ${w.pattern}:`,K)}let $=new Map,F=[];for(let w of U.routes)if(w.hasParams){let K=[],A=w.pattern.replace(/:([^/]+)/g,(W,G)=>{return K.push(G),"([^/]+)"});F.push({regex:new RegExp(`^${A}$`),route:w,paramNames:K})}else $.set(w.pattern,w);let S=v({port:k,async fetch(w){let A=new URL(w.url).pathname;if(O.onRequest){let j=await O.onRequest(w);if(j)return j}if(O.apiRoutes?.[A])return O.apiRoutes[A](w);if((w.method==="GET"||w.method==="HEAD")&&A!=="/"){let j=J.resolve(Z,"public"),z;try{z=decodeURIComponent(A)}catch{z=A}if(!z.includes("\x00")){let B=J.resolve(j,`.${z}`);if(B===j||B.startsWith(`${j}${J.sep}`))try{if(C.existsSync(B)&&C.statSync(B).isFile()){let H=J.extname(B).toLowerCase(),I=y[H]||"application/octet-stream",b=A.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(A);return new Response(Bun.file(B),{headers:{"Content-Type":I,"Cache-Control":b?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let W=w.headers.get("X-STX-Router")==="true",G=null,L={};if(G=$.get(A)||null,!G)for(let{regex:j,route:z,paramNames:B}of F){let X=A.match(j);if(X){G=z,B.forEach((H,I)=>{L[H]=X[I+1]});break}}if(!G){let j=$.get("/404")||null;if(j){let z=V.get(j.pattern);if(z)return new Response(z.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}if(W){let j=Y.get(G.pattern);if(j){let z=_.get(G.pattern);return new Response(j,{headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...z?{"X-STX-Layout":z.layout,"X-STX-Layout-Group":z.group}:{},"Cache-Control":"no-cache"}})}}let Q=V.get(G.pattern);if(!Q){let j=$.get("/500")||null;if(j){let z=V.get(j.pattern);if(z)return new Response(z.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(!Q.hasServerScripts&&Object.keys(Q.placeholders).length===0)return new Response(Q.html,{headers:{"Content-Type":"text/html","Cache-Control":"public, max-age=60"}});try{let{html:j,boundaries:z}=await E(Q,{params:L,request:w});if(z&&z.length>0){let{renderStreamingPage:B,streamToResponse:X}=await import("././streaming.js");return X(B(j,z,{timeoutMs:30000}),{headers:{"Cache-Control":"no-cache"}})}return new Response(j,{headers:{"Content-Type":"text/html","Cache-Control":"no-cache"}})}catch(j){return console.error(`[stx] Hydration error for ${A}:`,j),new Response(Q.html,{headers:{"Content-Type":"text/html"}})}}});return console.log(`[stx] Production server running at http://localhost:${k}`),console.log(`[stx] Serving ${U.routes.length} routes (${V.size} pre-loaded)`),{port:k,stop:()=>S.stop()}}
|
|
3
|
-
export{c as Ni};
|
package/dist/chunk-rqxf5hns.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
function C(j,A={}){let B=[];for(let[D,G]of Object.entries(A)){if(G===void 0||G===null)continue;if(Array.isArray(G))B.push(`${D}=${encodeURIComponent(G.join(","))}`);else if(typeof G==="boolean"){if(G)B.push(`${D}=true`)}else B.push(`${D}=${encodeURIComponent(String(G))}`)}if(B.length===0)return j;let F=j.includes("?")?"&":"?";return`${j}${F}${B.join("&")}`}function O(j){let A=j.indexOf("?");if(A===-1)return{src:j,params:{}};let B=j.slice(0,A),F=j.slice(A+1),D={};for(let G of F.split("&")){let[K,L]=G.split("="),J=L?decodeURIComponent(L):"";if(J==="true")D[K]=!0;else if(J==="false")D[K]=!1;else if(/^-?\d+$/.test(J))D[K]=Number.parseInt(J,10);else if(/^-?\d+\.\d+$/.test(J))D[K]=Number.parseFloat(J);else if(J.includes(","))D[K]=J.split(",");else D[K]=J}return{src:B,params:D}}function M(...j){let A={};for(let B of j)if(B)Object.assign(A,B);return A}function Q(j,A,B,F){let D={w:A};if(B)D.h=B;if(F)D.fit=F;return C(j,D)}function X(j,A,B,F="center"){return C(j,{w:A,h:B,fit:"crop",crop:F})}function Y(j,A,B="center"){return C(j,{w:A,h:A,fit:"crop",crop:B})}function Z(j,A,B){return C(j,{w:A,h:B,fit:"max"})}function _(j,A,B){return C(j,{w:A,h:B,fit:"crop"})}function $(j,A){return C(j,{blur:Math.min(2000,Math.max(0,A))})}function R(j,A){return C(j,{sharp:Math.min(100,Math.max(0,A))})}function T(j){return C(j,{sat:-100})}function E(j,A=100){return C(j,{sepia:Math.min(100,Math.max(0,A))})}function H(j){return C(j,{invert:!0})}function W(j,A){return C(j,{bri:Math.min(100,Math.max(-100,A))})}function V(j,A){return C(j,{con:Math.min(100,Math.max(-100,A))})}function f(j,A){return C(j,{sat:Math.min(100,Math.max(-100,A))})}function S(j,A){return C(j,{rot:(A%360+360)%360})}function x(j){return C(j,{flip:"h"})}function k(j){return C(j,{flip:"v"})}function P(j,A,B){let F={fm:A};if(B!==void 0)F.q=B;return C(j,F)}function w(j,A){return C(j,{q:Math.min(100,Math.max(1,A))})}function q(j,A=["format","compress"]){return C(j,{auto:A})}function v(j,A,B={}){return C(j,{mark:A,markx:B.x,marky:B.y,markalpha:B.alpha,markscale:B.scale,markalign:B.align})}var N={web:{fm:"webp",q:80,auto:["format","compress"]},highQuality:{q:95},thumb:{w:150,h:150,fit:"crop",crop:"center"},avatar:{w:200,h:200,fit:"crop",crop:"faces"},social:{w:1200,h:630,fit:"crop"},preview:{w:400,q:70},placeholder:{w:20,blur:200,q:20}};function y(j,A,B){return C(j,M(N[A],B))}function b(j,A,B){return A.map((F)=>C(j,{...B,w:F}))}function z(j,A,B=[1,2,3],F){return B.map((D)=>C(j,{...F,w:Math.round(A*D),dpr:D}))}function U(j){let A=[];if(j.w!==void 0&&(j.w<1||j.w>16383))A.push("Width must be between 1 and 16383");if(j.h!==void 0&&(j.h<1||j.h>16383))A.push("Height must be between 1 and 16383");if(j.q!==void 0&&(j.q<1||j.q>100))A.push("Quality must be between 1 and 100");if(j.blur!==void 0&&(j.blur<0||j.blur>2000))A.push("Blur must be between 0 and 2000");if(j.rot!==void 0&&(j.rot<0||j.rot>359))A.push("Rotation must be between 0 and 359");if(j.dpr!==void 0&&(j.dpr<1||j.dpr>5))A.push("DPR must be between 1 and 5");return{valid:A.length===0,errors:A}}function I(j){let A={...j};if(A.w!==void 0)A.w=Math.min(16383,Math.max(1,A.w));if(A.h!==void 0)A.h=Math.min(16383,Math.max(1,A.h));if(A.q!==void 0)A.q=Math.min(100,Math.max(1,A.q));if(A.blur!==void 0)A.blur=Math.min(2000,Math.max(0,A.blur));if(A.rot!==void 0)A.rot=(A.rot%360+360)%360;if(A.dpr!==void 0)A.dpr=Math.min(5,Math.max(1,A.dpr));return A}
|
|
3
|
-
export{C as ak,O as bk,M as ck,Q as dk,X as ek,Y as fk,Z as gk,_ as hk,$ as ik,R as jk,T as kk,E as lk,H as mk,W as nk,V as ok,f as pk,S as qk,x as rk,k as sk,P as tk,w as uk,q as vk,v as wk,N as xk,y as yk,b as zk,z as Ak,U as Bk,I as Ck};
|