@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-xqq1vxb6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// @bun
|
package/dist/chunk-xs03kc1h.js
DELETED
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
class G{clients=new Set;server=null;options;constructor(j={}){this.options={wsPort:j.wsPort??3001,showOverlay:j.showOverlay??!0,reconnectInterval:j.reconnectInterval??1000,maxReconnectAttempts:j.maxReconnectAttempts??10,verbose:j.verbose??!1}}start(j){let k=j??this.options.wsPort,B=20;for(let z=0;z<B;z++)try{if(this.server=Bun.serve({port:k,fetch(u,C){if(C.upgrade(u,{data:{}}))return;return new Response("stx Hot Reload Server",{headers:{"Content-Type":"text/plain"}})},websocket:{open:(u)=>{if(this.clients.add(u),this.options.verbose)console.log(`[HMR] Client connected (${this.clients.size} total)`);u.send(JSON.stringify({type:"connected",timestamp:Date.now()}))},close:(u)=>{if(this.clients.delete(u),this.options.verbose)console.log(`[HMR] Client disconnected (${this.clients.size} total)`)},message:(u,C)=>{let F=typeof C==="string"?C:C.toString();if(F==="ping")return;try{let D=JSON.parse(F);if(D.type==="console"&&Array.isArray(D.args)){let J=D.args.join(" "),K={log:"\x1B[36m",warn:"\x1B[33m",error:"\x1B[31m",info:"\x1B[34m"}[D.level]??"\x1B[36m";console.log(`${K}[browser]${D.level!=="log"?` ${D.level}`:""}\x1B[0m ${J}`)}}catch{}}}}),this.options.verbose)console.log(`[HMR] WebSocket server started on port ${k}`);return k}catch(u){if(u?.code==="EADDRINUSE"){k++;continue}throw u}throw Error(`Could not find an available port after ${B} attempts starting from ${j??this.options.wsPort}`)}stop(){for(let j of this.clients)try{j.close()}catch{}if(this.clients.clear(),this.server)this.server.stop(),this.server=null;if(this.options.verbose)console.log("[HMR] Server stopped")}broadcast(j){let k=JSON.stringify(j),B=0;for(let z of this.clients)try{if(z.readyState===1)z.send(k),B++}catch{this.clients.delete(z)}if(this.options.verbose&&B>0)console.log(`[HMR] Broadcast ${j.type} to ${B} client(s)`)}reload(j){if(this.options.verbose)console.log(`[HMR] Sending reload to ${this.clients.size} client(s) for: ${j||"all"}`);this.broadcast({type:"reload",path:j,timestamp:Date.now()})}updateCss(j,k){this.broadcast({type:"css-update",path:j,content:k,timestamp:Date.now()})}error(j){this.broadcast({type:"error",content:j,timestamp:Date.now()})}get clientCount(){return this.clients.size}get port(){return this.options.wsPort}}function L(j,k={}){let{showOverlay:B=!0,reconnectInterval:z=1000,maxReconnectAttempts:u=10}=k;return`
|
|
3
|
-
<script>
|
|
4
|
-
(function() {
|
|
5
|
-
// stx Hot Reload Client
|
|
6
|
-
var wsUrl = 'ws://' + window.location.hostname + ':${j}';
|
|
7
|
-
var reconnectAttempts = 0;
|
|
8
|
-
var maxAttempts = ${u};
|
|
9
|
-
var reconnectInterval = ${z};
|
|
10
|
-
var socket = null;
|
|
11
|
-
var overlay = null;
|
|
12
|
-
var wasConnected = false; // Track if we ever connected successfully
|
|
13
|
-
|
|
14
|
-
${B?`
|
|
15
|
-
// Create connection status overlay
|
|
16
|
-
function createOverlay() {
|
|
17
|
-
overlay = document.createElement('div');
|
|
18
|
-
overlay.id = 'stx-hmr-overlay';
|
|
19
|
-
overlay.style.cssText = 'position:fixed;top:0;left:0;right:0;padding:8px 16px;background:#f59e0b;color:#000;font-family:system-ui,sans-serif;font-size:14px;text-align:center;z-index:999999;display:none;';
|
|
20
|
-
document.body.appendChild(overlay);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function showOverlay(message, isError) {
|
|
24
|
-
// Only show overlay if we were previously connected (don't show during initial connection)
|
|
25
|
-
if (!wasConnected && !isError) return;
|
|
26
|
-
if (!overlay) createOverlay();
|
|
27
|
-
overlay.textContent = message;
|
|
28
|
-
overlay.style.background = isError ? '#ef4444' : '#f59e0b';
|
|
29
|
-
overlay.style.color = isError ? '#fff' : '#000';
|
|
30
|
-
overlay.style.display = 'block';
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function hideOverlay() {
|
|
34
|
-
if (overlay) overlay.style.display = 'none';
|
|
35
|
-
}
|
|
36
|
-
`:`
|
|
37
|
-
function showOverlay() {}
|
|
38
|
-
function hideOverlay() {}
|
|
39
|
-
`}
|
|
40
|
-
|
|
41
|
-
function connect() {
|
|
42
|
-
try {
|
|
43
|
-
socket = new WebSocket(wsUrl);
|
|
44
|
-
}
|
|
45
|
-
catch (e) {
|
|
46
|
-
// Silent fail for initial connection attempts
|
|
47
|
-
if (wasConnected) {
|
|
48
|
-
scheduleReconnect();
|
|
49
|
-
}
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
socket.onopen = function() {
|
|
54
|
-
// connected silently
|
|
55
|
-
wasConnected = true;
|
|
56
|
-
reconnectAttempts = 0;
|
|
57
|
-
hideOverlay();
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
socket.onmessage = function(event) {
|
|
61
|
-
try {
|
|
62
|
-
var msg = JSON.parse(event.data);
|
|
63
|
-
|
|
64
|
-
switch (msg.type) {
|
|
65
|
-
case 'reload':
|
|
66
|
-
console.log('[stx] Reloading...', msg.path || '');
|
|
67
|
-
// Use SPA router for progressive update instead of full page reload.
|
|
68
|
-
// Falls back to hard reload only when the router isn't available.
|
|
69
|
-
if (typeof window.navigate === 'function') {
|
|
70
|
-
window.navigate(window.location.pathname + window.location.search, false, true);
|
|
71
|
-
} else {
|
|
72
|
-
window.location.reload();
|
|
73
|
-
}
|
|
74
|
-
break;
|
|
75
|
-
|
|
76
|
-
case 'css-update':
|
|
77
|
-
console.log('[stx] CSS update:', msg.path);
|
|
78
|
-
updateCss(msg.path, msg.content);
|
|
79
|
-
break;
|
|
80
|
-
|
|
81
|
-
case 'error':
|
|
82
|
-
console.error('[stx] Error:', msg.content);
|
|
83
|
-
showOverlay('Build Error: ' + msg.content, true);
|
|
84
|
-
break;
|
|
85
|
-
|
|
86
|
-
case 'connected':
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
catch (e) {
|
|
91
|
-
console.error('[stx] Invalid message:', e);
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
socket.onclose = function() {
|
|
96
|
-
socket = null;
|
|
97
|
-
// Only log and show overlay if we were previously connected
|
|
98
|
-
if (wasConnected) {
|
|
99
|
-
console.log('[stx] Connection closed, reconnecting...');
|
|
100
|
-
scheduleReconnect();
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
// Silently retry initial connection
|
|
104
|
-
setTimeout(connect, reconnectInterval);
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
socket.onerror = function() {
|
|
109
|
-
// Errors are handled in onclose
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function scheduleReconnect() {
|
|
114
|
-
if (reconnectAttempts < maxAttempts) {
|
|
115
|
-
reconnectAttempts++;
|
|
116
|
-
showOverlay('Reconnecting... (' + reconnectAttempts + '/' + maxAttempts + ')');
|
|
117
|
-
setTimeout(connect, reconnectInterval);
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
showOverlay('Connection lost. Refresh to reconnect.', true);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// CSS hot update without full reload
|
|
125
|
-
function updateCss(path, content) {
|
|
126
|
-
// Try to find and update existing stylesheet
|
|
127
|
-
var links = document.querySelectorAll('link[rel="stylesheet"]');
|
|
128
|
-
for (var i = 0; i < links.length; i++) {
|
|
129
|
-
var href = links[i].getAttribute('href');
|
|
130
|
-
if (href && href.indexOf(path) !== -1) {
|
|
131
|
-
// Add cache-busting query param
|
|
132
|
-
var newHref = href.split('?')[0] + '?t=' + Date.now();
|
|
133
|
-
links[i].setAttribute('href', newHref);
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// If content provided, inject as style tag
|
|
139
|
-
if (content) {
|
|
140
|
-
var style = document.createElement('style');
|
|
141
|
-
style.setAttribute('data-stx-hmr', path);
|
|
142
|
-
style.textContent = content;
|
|
143
|
-
|
|
144
|
-
// Remove old injected style
|
|
145
|
-
var old = document.querySelector('style[data-stx-hmr="' + path + '"]');
|
|
146
|
-
if (old) old.remove();
|
|
147
|
-
|
|
148
|
-
document.head.appendChild(style);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// Start connection when DOM is ready
|
|
153
|
-
if (document.readyState === 'loading') {
|
|
154
|
-
document.addEventListener('DOMContentLoaded', connect);
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
connect();
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// Forward browser console to the dev server terminal
|
|
161
|
-
var _origLog = console.log;
|
|
162
|
-
var _origError = console.error;
|
|
163
|
-
var _origWarn = console.warn;
|
|
164
|
-
var _origInfo = console.info;
|
|
165
|
-
|
|
166
|
-
function _fwd(level, args) {
|
|
167
|
-
if (socket && socket.readyState === 1) {
|
|
168
|
-
try {
|
|
169
|
-
socket.send(JSON.stringify({
|
|
170
|
-
type: 'console',
|
|
171
|
-
level: level,
|
|
172
|
-
args: Array.prototype.slice.call(args).map(function(a) {
|
|
173
|
-
if (a === null) return 'null';
|
|
174
|
-
if (a === undefined) return 'undefined';
|
|
175
|
-
if (typeof a === 'object') { try { return JSON.stringify(a); } catch(e) { return String(a); } }
|
|
176
|
-
return String(a);
|
|
177
|
-
})
|
|
178
|
-
}));
|
|
179
|
-
} catch(e) {}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
console.log = function() { _origLog.apply(console, arguments); _fwd('log', arguments); };
|
|
184
|
-
console.error = function() { _origError.apply(console, arguments); _fwd('error', arguments); };
|
|
185
|
-
console.warn = function() { _origWarn.apply(console, arguments); _fwd('warn', arguments); };
|
|
186
|
-
console.info = function() { _origInfo.apply(console, arguments); _fwd('info', arguments); };
|
|
187
|
-
|
|
188
|
-
// Expose for debugging
|
|
189
|
-
window.__stxHmr = {
|
|
190
|
-
reconnect: connect,
|
|
191
|
-
status: function() { return socket ? socket.readyState : -1; }
|
|
192
|
-
};
|
|
193
|
-
})();
|
|
194
|
-
</script>
|
|
195
|
-
`}function Q(j,k,B={}){let z=L(k,B),u=j.lastIndexOf("</body>");if(u!==-1)return j.slice(0,u)+z+j.slice(u);if(j.includes("</html>"))return j.replace("</html>",`${z}</html>`);return j+z}function T(j){let k=j.toLowerCase();return k.endsWith(".css")||k.endsWith(".scss")||k.endsWith(".sass")||k.endsWith(".less")}function U(j){let k=j.toLowerCase();return[".stx",".html",".htm",".md",".js",".ts",".jsx",".tsx",".json"].some((z)=>k.endsWith(z))}function V(j){return[/^\./,/node_modules/,/\.stx\/output/,/\.stx\/cache/,/~$/,/\.swp$/,/\.swo$/].some((B)=>B.test(j))}var E=null;function W(j){if(!E)E=new G(j);return E}function X(){if(E)E.stop(),E=null}
|
|
196
|
-
export{G as hm,L as im,Q as jm,T as km,U as lm,V as mm,W as nm,X as om};
|
package/dist/chunk-xv34zbp4.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var{defineProperty:e,getOwnPropertyNames:g,getOwnPropertyDescriptor:h}=Object,i=Object.prototype.hasOwnProperty;function j(a){return this[a]}var m=(a)=>{var b=(f??=new WeakMap).get(a),c;if(b)return b;if(b=e({},"__esModule",{value:!0}),a&&typeof a==="object"||typeof a==="function"){for(var d of g(a))if(!i.call(b,d))e(b,d,{get:j.bind(a,d),enumerable:!(c=h(a,d))||c.enumerable})}return f.set(a,b),b},f;var k=(a)=>a;function l(a,b){this[a]=k.bind(null,b)}var n=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0,configurable:!0,set:l.bind(b,c)})};var o=(a,b)=>()=>(a&&(b=a(a=0)),b);var p=import.meta.require;
|
|
3
|
-
export{m as mB,n as nB,o as oB,p as pB};
|
package/dist/chunk-xw36p73h.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Go as b,Io as v}from"./chunk-xgkv66q5.js";import{Zo as V}from"./chunk-x24s4heg.js";import{pB as z}from"./chunk-xv34zbp4.js";import{existsSync as y,mkdirSync as _,copyFileSync as O,chmodSync as A}from"fs";import{join as H,basename as P}from"path";import{spawn as R,execSync as d}from"child_process";import{tmpdir as S,homedir as B,platform as N}from"os";async function D(K){let Q=Date.now();try{if(!await Bun.file(K.input).exists())return{success:!1,target:K.target||I(),format:K.format||"app",error:`Input file not found: ${K.input}`};let J=K.target||I(),$=K.format||f(J),U=K.output||H(process.cwd(),"dist","native");if(!y(U))_(U,{recursive:!0});let q=await Bun.file(K.input).text();if(q=V(q,{debug:K.verbose}),q=v(q),!q.includes("craft-component-styles")){if(q.includes("</head>"))q=q.replace("</head>",`${b}
|
|
3
|
-
</head>`)}let X=K.name||P(K.input,".stx"),Y=K.version||"1.0.0",Z=K.craftPath||await m();if(!Z)return{success:!1,target:J,format:$,error:"Craft binary not found. Please install Craft or specify craftPath."};if(K.verbose)console.log(`\uD83D\uDCE6 Building native app for ${J}...`),console.log(` Input: ${K.input}`),console.log(` Output: ${U}`),console.log(` Craft: ${Z}`);let G;switch(J){case"macos":G=await h(q,X,Y,U,$,K,Z);break;case"windows":G=await u(q,X,Y,U,$,K,Z);break;case"linux":G=await l(q,X,Y,U,$,K,Z);break;case"ios":G=await s(q,X,Y,U,K,Z);break;case"android":G=await g(q,X,Y,U,K,Z);break;default:G={success:!1,target:J,format:$,error:`Unsupported target: ${J}`}}return G.duration=Date.now()-Q,G}catch(J){return{success:!1,target:K.target||I(),format:K.format||"app",error:J.message,duration:Date.now()-Q}}}async function h(K,Q,J,$,U,q,X){let Y=q.bundleId||`com.stx.${Q.toLowerCase().replace(/[^a-z0-9]/g,"")}`,Z=H($,`${Q}.app`),G=H(Z,"Contents"),L=H(G,"MacOS"),W=H(G,"Resources");_(L,{recursive:!0}),_(W,{recursive:!0});let x=H(W,"index.html");await Bun.write(x,K);let E="";if(q.sidebar?.enabled&&q.sidebar?.config)E=H(W,"sidebar-config.json"),await Bun.write(E,JSON.stringify(q.sidebar.config));let T=q.sidebar?.enabled?`--native-sidebar --sidebar-width ${q.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",M=`#!/bin/bash
|
|
4
|
-
DIR="$( cd "$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
|
|
5
|
-
RESOURCES="$DIR/../Resources"
|
|
6
|
-
"${X}" --html "$(cat "$RESOURCES/index.html")" \\
|
|
7
|
-
--title "${q.window?.title||Q}" \\
|
|
8
|
-
--width ${q.window?.width||1200} \\
|
|
9
|
-
--height ${q.window?.height||800} \\
|
|
10
|
-
${q.systemTray?"--system-tray":""} \\
|
|
11
|
-
${q.devTools?"--dev-tools":""} \\
|
|
12
|
-
${q.window?.frameless?"--frameless":""} \\
|
|
13
|
-
${q.window?.alwaysOnTop?"--always-on-top":""} \\
|
|
14
|
-
${T}
|
|
15
|
-
`,w=H(L,Q);await Bun.write(w,M),A(w,493);let C=H(L,"craft");try{O(X,C),A(C,493)}catch{let F=`#!/bin/bash
|
|
16
|
-
exec "${X}" "$@"`;await Bun.write(C,F),A(C,493)}let j=`<?xml version="1.0" encoding="UTF-8"?>
|
|
17
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
18
|
-
<plist version="1.0">
|
|
19
|
-
<dict>
|
|
20
|
-
<key>CFBundleExecutable</key>
|
|
21
|
-
<string>${Q}</string>
|
|
22
|
-
<key>CFBundleIdentifier</key>
|
|
23
|
-
<string>${Y}</string>
|
|
24
|
-
<key>CFBundleName</key>
|
|
25
|
-
<string>${Q}</string>
|
|
26
|
-
<key>CFBundleDisplayName</key>
|
|
27
|
-
<string>${Q}</string>
|
|
28
|
-
<key>CFBundleShortVersionString</key>
|
|
29
|
-
<string>${J}</string>
|
|
30
|
-
<key>CFBundleVersion</key>
|
|
31
|
-
<string>${J}</string>
|
|
32
|
-
<key>CFBundlePackageType</key>
|
|
33
|
-
<string>APPL</string>
|
|
34
|
-
<key>CFBundleSignature</key>
|
|
35
|
-
<string>????</string>
|
|
36
|
-
<key>LSMinimumSystemVersion</key>
|
|
37
|
-
<string>10.15</string>
|
|
38
|
-
<key>NSHighResolutionCapable</key>
|
|
39
|
-
<true/>
|
|
40
|
-
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
|
41
|
-
<true/>
|
|
42
|
-
<key>LSUIElement</key>
|
|
43
|
-
<${q.systemTray?"true":"false"}/>
|
|
44
|
-
</dict>
|
|
45
|
-
</plist>`;if(await Bun.write(H(G,"Info.plist"),j),q.icon&&await Bun.file(q.icon).exists())O(q.icon,H(W,"AppIcon.icns"));if(U==="dmg"){let F=H($,`${Q}-${J}.dmg`),k=await c(Z,F,Q);if(!k.success)return{success:!1,target:"macos",format:"dmg",error:k.error};return{success:!0,target:"macos",format:"dmg",outputPath:F}}return{success:!0,target:"macos",format:"app",outputPath:Z}}async function u(K,Q,J,$,U,q,X){let Y=H($,Q);_(Y,{recursive:!0});let Z=H(Y,"index.html");await Bun.write(Z,K);let G=`@echo off
|
|
46
|
-
set DIR=%~dp0
|
|
47
|
-
"${X}" --html-file "%DIR%index.html" ^
|
|
48
|
-
--title "${q.window?.title||Q}" ^
|
|
49
|
-
--width ${q.window?.width||1200} ^
|
|
50
|
-
--height ${q.window?.height||800} ^
|
|
51
|
-
${q.systemTray?"--system-tray":""} ^
|
|
52
|
-
${q.devTools?"--dev-tools":""}
|
|
53
|
-
`;if(await Bun.write(H(Y,`${Q}.bat`),G),U==="zip"){let L=H($,`${Q}-${J}-windows.zip`),W=await n(Y,L);if(!W.success)return{success:!1,target:"windows",format:"zip",error:W.error};return{success:!0,target:"windows",format:"zip",outputPath:L}}return{success:!0,target:"windows",format:"app",outputPath:Y}}async function l(K,Q,J,$,U,q,X){let Y=H($,Q);_(Y,{recursive:!0});let Z=H(Y,"index.html");await Bun.write(Z,K);let G=`#!/bin/bash
|
|
54
|
-
DIR="$( cd "$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
|
|
55
|
-
"${X}" --html-file "$DIR/index.html" \\
|
|
56
|
-
--title "${q.window?.title||Q}" \\
|
|
57
|
-
--width ${q.window?.width||1200} \\
|
|
58
|
-
--height ${q.window?.height||800} \\
|
|
59
|
-
${q.systemTray?"--system-tray":""} \\
|
|
60
|
-
${q.devTools?"--dev-tools":""}
|
|
61
|
-
`,L=H(Y,Q.toLowerCase());await Bun.write(L,G),A(L,493);let W=`[Desktop Entry]
|
|
62
|
-
Type=Application
|
|
63
|
-
Name=${Q}
|
|
64
|
-
Exec=${L}
|
|
65
|
-
Terminal=false
|
|
66
|
-
Categories=Utility;
|
|
67
|
-
`;if(await Bun.write(H(Y,`${Q.toLowerCase()}.desktop`),W),U==="deb"){let x=H($,`${Q.toLowerCase()}_${J}_amd64.deb`),E=await t(Y,x,Q,J,q);if(!E.success)return{success:!1,target:"linux",format:"deb",error:E.error};return{success:!0,target:"linux",format:"deb",outputPath:x}}if(U==="appimage"){let x=H($,`${Q}-${J}-x86_64.AppImage`),E=await r(Y,x,Q,q);if(!E.success)return{success:!1,target:"linux",format:"appimage",error:E.error};return{success:!0,target:"linux",format:"appimage",outputPath:x}}return{success:!0,target:"linux",format:"app",outputPath:Y}}async function s(K,Q,J,$,U,q){return{success:!1,target:"ios",format:"ipa",error:`iOS build requires Xcode and additional setup. Use 'stx init:ios ${Q}' to create an iOS project.`}}async function g(K,Q,J,$,U,q){return{success:!1,target:"android",format:"apk",error:`Android build requires Android SDK and additional setup. Use 'stx init:android ${Q}' to create an Android project.`}}async function m(){let K=[H(process.cwd(),"../../craft/packages/zig/zig-out/bin/craft-minimal"),H(process.cwd(),"../craft/packages/zig/zig-out/bin/craft-minimal"),H(B(),"Code/craft/packages/zig/zig-out/bin/craft-minimal"),"/usr/local/bin/craft","/usr/bin/craft",H(B(),".local/bin/craft"),H(process.env.LOCALAPPDATA||"","craft","craft.exe"),H(process.env.PROGRAMFILES||"","craft","craft.exe")];for(let Q of K)if(await Bun.file(Q).exists())return Q;try{let J=d("which craft 2>/dev/null || where craft 2>nul",{encoding:"utf-8"}).trim().split(`
|
|
68
|
-
`)[0];if(J&&await Bun.file(J).exists())return J}catch{}return null}function I(){switch(N()){case"darwin":return"macos";case"win32":return"windows";default:return"linux"}}function f(K){switch(K){case"macos":return"app";case"windows":return"zip";case"linux":return"appimage";case"ios":return"ipa";case"android":return"apk";default:return"app"}}async function c(K,Q,J){return new Promise(($)=>{let U=R("hdiutil",["create","-volname",J,"-srcfolder",K,"-ov","-format","UDZO",Q]);U.on("close",(q)=>{if(q===0)$({success:!0});else $({success:!1,error:`hdiutil exited with code ${q}`})}),U.on("error",(q)=>{$({success:!1,error:q.message})})})}async function n(K,Q){return new Promise((J)=>{let $=R("zip",["-r",Q,"."],{cwd:K});$.on("close",(U)=>{if(U===0)J({success:!0});else J({success:!1,error:`zip exited with code ${U}`})}),$.on("error",(U)=>{J({success:!1,error:U.message})})})}async function t(K,Q,J,$,U){return new Promise((q)=>{try{let X=H(S(),`stx-deb-${Date.now()}`),Y=H(X,"DEBIAN"),Z=H(X,"usr","bin"),G=H(X,"usr","share","applications"),L=H(X,"usr","share",J.toLowerCase());_(Y,{recursive:!0}),_(Z,{recursive:!0}),_(G,{recursive:!0}),_(L,{recursive:!0});let W=z("fs").readdirSync(K);for(let M of W)O(H(K,M),H(L,M));let x=`#!/bin/bash
|
|
69
|
-
exec /usr/share/${J.toLowerCase()}/${J.toLowerCase()} "$@"`;z("fs").writeFileSync(H(Z,J.toLowerCase()),x),A(H(Z,J.toLowerCase()),493);let E=`Package: ${J.toLowerCase()}
|
|
70
|
-
Version: ${$}
|
|
71
|
-
Section: utils
|
|
72
|
-
Priority: optional
|
|
73
|
-
Architecture: amd64
|
|
74
|
-
Depends: libgtk-3-0, libwebkit2gtk-4.0-37
|
|
75
|
-
Maintainer: ${U.author||"Unknown"}
|
|
76
|
-
Description: ${U.description||J}
|
|
77
|
-
`;z("fs").writeFileSync(H(Y,"control"),E);let T=R("dpkg-deb",["--build",X,Q]);T.on("close",(M)=>{if(z("fs").rmSync(X,{recursive:!0,force:!0}),M===0)q({success:!0});else q({success:!1,error:`dpkg-deb exited with code ${M}`})}),T.on("error",(M)=>{z("fs").rmSync(X,{recursive:!0,force:!0}),q({success:!1,error:M.message})})}catch(X){q({success:!1,error:X.message})}})}async function r(K,Q,J,$){return new Promise((U)=>{try{let q=H(S(),`stx-appimage-${Date.now()}`),X=H(q,`${J}.AppDir`),Y=H(X,"usr"),Z=H(Y,"bin"),G=H(Y,"share");_(Z,{recursive:!0}),_(G,{recursive:!0});let L=H(G,J.toLowerCase());_(L,{recursive:!0});let W=z("fs").readdirSync(K);for(let w of W)O(H(K,w),H(L,w));let x=`#!/bin/bash
|
|
78
|
-
SELF=$(readlink -f "$0")
|
|
79
|
-
HERE=\${SELF%/*}
|
|
80
|
-
export PATH="\${HERE}/usr/bin:\${PATH}"
|
|
81
|
-
exec "\${HERE}/usr/share/${J.toLowerCase()}/${J.toLowerCase()}" "$@"
|
|
82
|
-
`;z("fs").writeFileSync(H(X,"AppRun"),x),A(H(X,"AppRun"),493);let E=`[Desktop Entry]
|
|
83
|
-
Type=Application
|
|
84
|
-
Name=${J}
|
|
85
|
-
Exec=${J.toLowerCase()}
|
|
86
|
-
Terminal=false
|
|
87
|
-
Categories=Utility;
|
|
88
|
-
Icon=${J.toLowerCase()}
|
|
89
|
-
`;z("fs").writeFileSync(H(X,`${J.toLowerCase()}.desktop`),E);let T=Buffer.from([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,2,0,0,0,144,119,83,222,0,0,0,12,73,68,65,84,8,215,99,248,255,255,63,0,5,254,2,254,220,204,89,231,0,0,0,0,73,69,78,68,174,66,96,130]);if(z("fs").writeFileSync(H(X,`${J.toLowerCase()}.png`),T),$.icon&&y($.icon))O($.icon,H(X,`${J.toLowerCase()}.png`));let M=R("appimagetool",[X,Q],{env:{...process.env,ARCH:"x86_64"}});M.on("close",(w)=>{if(z("fs").rmSync(q,{recursive:!0,force:!0}),w===0)A(Q,493),U({success:!0});else U({success:!1,error:`appimagetool exited with code ${w}. Install from https://appimage.github.io/appimagetool/`})}),M.on("error",(w)=>{z("fs").rmSync(q,{recursive:!0,force:!0}),U({success:!1,error:`appimagetool not found: ${w.message}`})})}catch(q){U({success:!1,error:q.message})}})}function o(){return[I()]}function e(K){switch(K){case"macos":return["app","dmg","pkg"];case"windows":return["app","zip","msi"];case"linux":return["app","deb","rpm","appimage"];case"ios":return["ipa"];case"android":return["apk"];default:return["app"]}}var i={buildNative:D,getAvailableTargets:o,getAvailableFormats:e,detectPlatform:I},$q=i;
|
|
90
|
-
export{D as xo,o as yo,e as zo,$q as Ao};
|
package/dist/chunk-xyg1r5w0.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{py as U}from"./chunk-zen6ax1y.js";import{Ry as b}from"./chunk-27zsyhrd.js";import{uz as M}from"./chunk-w3b6m427.js";import{pB as y}from"./chunk-xv34zbp4.js";import T from"path";var E;async function v(){if(E!==void 0)return E;try{E=(await import("@stacksjs/ts-i18n")).loadLocale??null}catch{E=null}return E}var k={defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},R={},N={},w={};function Rq(q){if(q)delete R[q];else for(let J of Object.keys(R))delete R[J]}function Yq(){let q=Object.entries(R).map(([J,H])=>({locale:J,loadedAt:new Date(H.loadedAt),keyCount:h(H.translations)}));return{size:Object.keys(R).length,locales:Object.keys(R),entries:q}}function h(q,J=0){for(let H of Object.values(q))if(J++,H&&typeof H==="object"&&!Array.isArray(H))J=h(H,J);return J}function g(q,J=0){if(J<=0)return!1;return Date.now()-q.loadedAt>J}function zq(q){if(R[q])return"loaded";return w[q]||"idle"}function Dq(q){return w[q]==="loading"}function Nq(q){return!!R[q]}async function d(q,J){let{locales:H,parallel:G=!0,priority:Q={},onLocaleLoaded:W,onComplete:X,onError:Z}=q,Y=G?H:[...H].sort((z,$)=>(Q[$]||0)-(Q[z]||0));if(G){let z=Y.map(async($)=>{try{await V($,J),W?.($)}catch(_){Z?.($,_ instanceof Error?_:Error(String(_)))}});await Promise.all(z)}else for(let z of Y)try{await V(z,J),W?.(z)}catch($){Z?.(z,$ instanceof Error?$:Error(String($)))}X?.()}function Aq(q,J){queueMicrotask(()=>{d(q,J).catch((H)=>{if(J.debug)console.error("Background preload error:",H)})})}async function V(q,J){if({...k,...J.i18n}.cache&&R[q]){let Q=R[q],W=J.i18n?.cacheMaxAge??0;if(!g(Q,W))return Q.translations}if(N[q]?.state==="loading")return N[q].promise;w[q]="loading";let G=O(q,J).then((Q)=>{return w[q]="loaded",delete N[q],Q}).catch((Q)=>{throw w[q]="error",N[q]={promise:G,state:"error",error:Q instanceof Error?Q:Error(String(Q))},Q});return N[q]={promise:G,state:"loading"},G}function u(q){return R[q]?.translations}async function wq(q,J){let H=u(q);if(H)return H;return V(q,J)}async function Fq(q,J){if(R[q])return R[q].translations;if(N[q]){if(J)return Promise.race([N[q].promise,new Promise((H,G)=>setTimeout(()=>G(Error(`Timeout waiting for locale: ${q}`)),J))]);return N[q].promise}throw Error(`Locale "${q}" is not loading. Call loadTranslationLazy first.`)}function Eq(){return Object.entries(w).filter(([q,J])=>J==="loading").map(([q])=>q)}function Pq(q){if(q)delete N[q],delete w[q];else{for(let J of Object.keys(N))delete N[J];for(let J of Object.keys(w))delete w[J]}}async function O(q,J){let H={...k,...J.i18n},G=T.isAbsolute(H.translationsDir)?H.translationsDir:T.resolve(J.root||process.cwd(),H.translationsDir);try{let Q=await v(),W=Q?await Q(q,{translationsDir:G,defaultLocale:H.defaultLocale,sources:n(H.format)}):await m(q,H,G);if(W===void 0){if(q!==H.defaultLocale)return O(H.defaultLocale,J);return{}}let X=W;if(H.cache)R[q]={translations:X,loadedAt:Date.now(),locale:q};return X}catch(Q){if(J.debug)console.error(`Error loading translation file for locale "${q}":`,Q);if(q!==H.defaultLocale)return O(H.defaultLocale,J);return{}}}async function m(q,J,H){let G=T.join(H,`${q}${p(J.format)}`);try{let Q=await import(G);return Q.default||Q}catch(Q){try{let W=await Bun.file(G).text();if(J.format==="yaml"||J.format==="yml")return c(W);if(J.format==="json")return JSON.parse(W);throw Q}catch{return}}}function p(q){switch(q){case"yaml":return".yaml";case"yml":return".yml";case"js":return".js";case"ts":return".ts";case"json":default:return".json"}}function c(q){let J={},H=q.split(`
|
|
3
|
-
`),G=[{obj:J,indent:-1}];for(let Q of H){let W=Q.replace(/#.*$/,"").trimEnd();if(!W.trim())continue;let X=W.search(/\S/);if(X===-1)continue;while(G.length>1&&G[G.length-1].indent>=X)G.pop();let Z=G[G.length-1].obj,Y=W.match(/^(\s*)(\S[^:]*):\s*(.*)$/);if(Y){let[,,z,$]=Y,_=z.trim(),B=$.trim();if(B==="")Z[_]={},G.push({obj:Z[_],indent:X});else Z[_]=i(B)}}return J}function i(q){if(q.startsWith("'")&&q.endsWith("'")||q.startsWith('"')&&q.endsWith('"'))return q.slice(1,-1);let J=q.toLowerCase();if(J==="true"||J==="yes")return!0;if(J==="false"||J==="no")return!1;if(J==="null"||J==="~")return null;let H=Number(q);if(!Number.isNaN(H)&&q!=="")return H;return q}function n(q){switch(q){case"yaml":case"yml":return["yaml"];case"js":case"ts":return["ts"];case"json":default:return["json"]}}async function s(q,J){return V(q,J)}function r(q,J){for(let H of q){let G=H.trim(),Q=G.match(/^\{(\d+)\}\s*(.*)$/);if(Q){let X=Number.parseInt(Q[1],10);if(J===X)return Q[2];continue}let W=G.match(/^\[(\d+),(\d+|\*)\]\s*(.*)$/);if(W){let X=Number.parseInt(W[1],10),Z=W[2]==="*"?Number.POSITIVE_INFINITY:Number.parseInt(W[2],10);if(J>=X&&J<=Z)return W[3];continue}}if(q.length===2)return J===1?q[0].trim():q[1].trim();if(J<q.length)return q[J].trim();return q[q.length-1].trim()}function l(q,J={}){return f(q,J)}function f(q,J){let H="",G=0;while(G<q.length)if(q[G]==="{"){let Q=t(q,G);if(Q===-1){H+=q[G],G++;continue}let W=q.slice(G+1,Q);H+=o(W,J),G=Q+1}else if(q[G]==="'"&&G+1<q.length)if(q[G+1]==="'")H+="'",G+=2;else if(q[G+1]==="{"||q[G+1]==="}")H+=q[G+1],G+=2;else H+=q[G],G++;else H+=q[G],G++;return H}function t(q,J){let H=0;for(let G=J;G<q.length;G++)if(q[G]==="{")H++;else if(q[G]==="}"){if(H--,H===0)return G}return-1}function o(q,J){let H=e(q);if(H.length===0)return`{${q}}`;let G=H[0].trim(),Q=J[G];if(H.length===1)return Q!==void 0?String(Q):`{${G}}`;switch(H[1].trim().toLowerCase()){case"plural":return a(Q,H.slice(2).join(","),J);case"select":return Gq(Q,H.slice(2).join(","));case"selectordinal":return Hq(Q,H.slice(2).join(","));case"number":return Qq(Q,H[2]?.trim());case"date":return Wq(Q,H[2]?.trim());case"time":return Xq(Q,H[2]?.trim());default:return Q!==void 0?String(Q):`{${q}}`}}function e(q){let J=[],H="",G=0;for(let Q=0;Q<q.length;Q++){let W=q[Q];if(W==="{")G++,H+=W;else if(W==="}")G--,H+=W;else if(W===","&&G===0)J.push(H),H="";else H+=W}if(H)J.push(H);return J}function a(q,J,H){let G=Number(q)||0,Q=S(J),W=`=${G}`;if(Q[W])return K(Q[W],G,H);let X=qq(G);if(Q[X])return K(Q[X],G,H);if(Q.other)return K(Q.other,G,H);return String(G)}function K(q,J,H){let G=q.replace(/#/g,String(J));return f(G,H)}function qq(q){let J=Math.abs(q),H=Math.floor(J),G=String(q).includes(".")?String(q).split(".")[1].length:0;if(H===1&&G===0)return"one";return"other"}function Gq(q,J){let H=String(q||""),G=S(J);if(G[H])return G[H];return G.other||String(q)}function Hq(q,J){let H=Number(q)||0,G=S(J),Q=Jq(H);if(G[Q])return G[Q].replace(/#/g,String(H));if(G.other)return G.other.replace(/#/g,String(H));return String(H)}function Jq(q){let J=Math.abs(q),H=J%10,G=J%100;if(H===1&&G!==11)return"one";if(H===2&&G!==12)return"two";if(H===3&&G!==13)return"few";return"other"}function S(q){let J={},H=/(\w+|=\d+)\s*\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g,G=H.exec(q);while(G!==null)J[G[1]]=G[2],G=H.exec(q);return J}function Qq(q,J){let H=Number(q);if(Number.isNaN(H))return String(q);switch(J){case"integer":return Math.floor(H).toLocaleString();case"percent":return`${(H*100).toFixed(0)}%`;case"currency":return H.toLocaleString(void 0,{style:"currency",currency:"USD"});default:return H.toLocaleString()}}function Wq(q,J){let H=q instanceof Date?q:new Date(String(q));if(Number.isNaN(H.getTime()))return String(q);let G={};switch(J){case"short":G.dateStyle="short";break;case"medium":G.dateStyle="medium";break;case"long":G.dateStyle="long";break;case"full":G.dateStyle="full";break;default:G.dateStyle="medium"}return H.toLocaleDateString(void 0,G)}function Xq(q,J){let H=q instanceof Date?q:new Date(String(q));if(Number.isNaN(H.getTime()))return String(q);let G={};switch(J){case"short":G.timeStyle="short";break;case"medium":G.timeStyle="medium";break;case"long":G.timeStyle="long";break;case"full":G.timeStyle="full";break;default:G.timeStyle="short"}return H.toLocaleTimeString(void 0,G)}function Zq(q){return/\{[^}]+,\s*(?:plural|select|selectordinal|number|date|time)\s*,/.test(q)}function I(q,J,H=!0,G={}){let Q=q.split("."),W=J;for(let Z of Q){if(W===void 0||W===null)break;W=W[Z]}if(W===void 0||W===null)return H?q:"";let X=String(W);if(Zq(X))return l(X,G);if(X.includes("|")&&"count"in G){let Z=Number(G.count),Y=X.split("|");X=r(Y,Z)}for(let[Z,Y]of Object.entries(G)){let z=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");X=X.replace(new RegExp(`:${z}`,"g"),String(Y))}return X}async function Vq(q,J,H,G){let Q=q,W=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)([\s\S]*?)@endtranslate/g,X={...k,...G.i18n},Z=await s(X.locale,G);J.__translations=Z,J.__locale=X.locale,J.__i18nConfig=X,Q=await C(Q,W,async($,_,B,x,A)=>{try{let D={};if(B)try{let F=[()=>JSON.parse(B),()=>{let j=`{"data":${B}}`,L=JSON.parse(j);return typeof L.data==="object"?L.data:{}},()=>{return M(B,J)}];for(let j of F)try{if(D=j(),Object.keys(D).length>0)break}catch{}}catch(F){if(G.debug)console.error("Error parsing parameters for @translate directive:",F)}return I(_,Z,X.fallbackToKey,D)||x.trim()}catch(D){if(G.debug)console.error("Error processing @translate directive:",D);return U("Translate",`Error in @translate('${_}'): ${D instanceof Error?D.message:String(D)}`,b.EVALUATION_ERROR)}});let Y=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]+\})\s*)?\)/g;if(G.debug){console.warn(`Processing translations in template. Sections: ${Q.includes("<h2>Translation with Parameters</h2>")?"Parameters section found":"Parameters section missing"}`);let $=[...Q.matchAll(Y)];console.warn(`Found ${$.length} @translate matches`),$.forEach((_,B)=>console.warn(`Match ${B}: ${_[0]}, Key: ${_[1]}, Params: ${_[2]||"none"}`))}return Q=await C(Q,/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)/g,async($,_,B,x)=>{try{let A={};if(B)try{let D=[()=>JSON.parse(B),()=>{let P=`{"data":${B}}`,F=JSON.parse(P);return typeof F.data==="object"?F.data:{}},()=>{return M(B,J)}];for(let P of D)try{if(A=P(),Object.keys(A).length>0)break}catch{}}catch(D){if(G.debug)console.error("Error parsing parameters for @translate directive:",D)}return I(_,Z,X.fallbackToKey,A)}catch(A){if(G.debug)console.error("Error processing @translate directive:",A);return U("Translate",`Error in @translate('${_}'): ${A instanceof Error?A.message:String(A)}`,b.EVALUATION_ERROR)}}),Q}async function C(q,J,H){let G=[];return q.replace(J,(W,...X)=>{let Z=H(W,...X).then((Y)=>({match:W,replacement:Y}));return G.push(Z),W}),(await Promise.all(G)).reduce((W,{match:X,replacement:Z})=>W.replace(X,Z),q)}function jq(q,J=!0){return(H,G={})=>{return I(H,q,J,G)}}
|
|
4
|
-
export{k as qv,Rq as rv,Yq as sv,zq as tv,Dq as uv,Nq as vv,d as wv,Aq as xv,V as yv,u as zv,wq as Av,Fq as Bv,Eq as Cv,Pq as Dv,s as Ev,l as Fv,Zq as Gv,I as Hv,Vq as Iv,jq as Jv};
|
package/dist/chunk-xys2sxh6.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var E={treeShake:!0,deadCodeElimination:!0,constantFolding:!0,stringPooling:!1,minifyHtml:!0,removeDevCode:!0,constants:{},preserveDirectives:[],target:"production"},L=["if","else","elseif","endif","unless","endunless","switch","case","default","endswitch","for","endfor","foreach","endforeach","forelse","endforelse","while","endwhile","break","continue","empty","extends","section","endsection","yield","parent","include","includeIf","includeWhen","includeFirst","once","endonce","push","endpush","prepend","endprepend","stack","component","endcomponent","slot","endslot","props","auth","endauth","guest","endguest","can","endcan","cannot","endcannot","role","endrole","hasRole","endhasRole","hasAnyRole","endhasAnyRole","csrf","method","error","enderror","old","input","textarea","select","checkbox","radio","file","translate","lang","choice","meta","title","seo","jsonld","canonical","robots","sitemap","ts","endts","js","endjs","css","endcss","markdown","endmarkdown","verbatim","endverbatim","env","production","debug","isset","endisset","empty","endempty"];function A(K){let j=new Map,J=/@(\w+)/g,Q,q=1,G=0;while((Q=J.exec(K))!==null){let W=Q[1],Y=K.slice(G,Q.index);q+=(Y.match(/\n/g)||[]).length,G=Q.index;let $=Q.index-K.lastIndexOf(`
|
|
3
|
-
`,Q.index-1);if(L.includes(W)){let X=j.get(W);if(X)X.count++,X.locations.push({line:q,column:$});else j.set(W,{name:W,count:1,locations:[{line:q,column:$}]})}}return Array.from(j.values())}function T(K,j=[]){let J=A(K),Q=new Set(J.map((q)=>q.name));for(let q of j)Q.add(q);for(let q of Array.from(Q))if(!q.startsWith("end"))Q.add(`end${q}`);return L.filter((q)=>!Q.has(q))}function U(K){let j=[],J={conditionals:["if","else","elseif","endif","unless","endunless","switch","case","default","endswitch","isset","endisset"],loops:["for","endfor","foreach","endforeach","forelse","endforelse","while","endwhile","break","continue","empty"],includes:["include","includeIf","includeWhen","includeFirst","once","endonce","extends","section","endsection","yield","parent","push","endpush","prepend","endprepend","stack"],components:["component","endcomponent","slot","endslot","props"],auth:["auth","endauth","guest","endguest","can","endcan","cannot","endcannot","role","endrole","hasRole","endhasRole","hasAnyRole","endhasAnyRole"],forms:["csrf","method","error","enderror","old","input","textarea","select","checkbox","radio","file"],i18n:["translate","lang","choice"],seo:["meta","title","seo","jsonld","canonical","robots","sitemap"]},Q=new Set;for(let G of K)for(let[W,Y]of Object.entries(J))if(Y.includes(G)){Q.add(W);break}for(let G of Q)j.push(`import { process${C(G)} } from './${G}'`);let q=K.filter((G)=>!G.startsWith("end")).map((G)=>` '${G}': true`).join(`,
|
|
4
|
-
`);return`// Tree-shaken directive bundle
|
|
5
|
-
// Only includes: ${K.join(", ")}
|
|
6
|
-
${j.join(`
|
|
7
|
-
`)}
|
|
8
|
-
|
|
9
|
-
export const activeDirectives = {
|
|
10
|
-
${q}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function isDirectiveActive(name: string): boolean {
|
|
14
|
-
return name in activeDirectives
|
|
15
|
-
}
|
|
16
|
-
`}function k(K,j={}){let J=[],Q=/@if\(([^)]+)\)[\s\S]*?@endif/g,q=K.matchAll(Q);for(let X of q){let Z=X[1].trim();if(_(Z,j)===!1)J.push({start:X.index,end:X.index+X[0].length,reason:`@if condition always false: ${Z}`})}let G=/@unless\(([^)]+)\)[\s\S]*?@endunless/g,W=K.matchAll(G);for(let X of W){let Z=X[1].trim();if(_(Z,j)===!0)J.push({start:X.index,end:X.index+X[0].length,reason:`@unless condition always true: ${Z}`})}let Y=/@env\(['"]development['"]\)[\s\S]*?@endenv/g;if(j.__ENV__==="production"){let X=K.matchAll(Y);for(let Z of X)J.push({start:Z.index,end:Z.index+Z[0].length,reason:"Development-only code in production build"})}let $=/@debug[\s\S]*?@enddebug/g;if(j.__ENV__==="production"){let X=K.matchAll($);for(let Z of X)J.push({start:Z.index,end:Z.index+Z[0].length,reason:"Debug code in production build"})}return J}function I(K,j={}){let J=k(K,j),Q=[];J.sort((G,W)=>W.start-G.start);let q=K;for(let G of J)q=q.slice(0,G.start)+q.slice(G.end),Q.push(G.reason);return{content:q,removed:Q}}function _(K,j){if(K==="true")return!0;if(K==="false")return!1;if(K==="null")return null;if(/^\d+$/.test(K))return Number.parseInt(K,10);if(/^\d+\.\d+$/.test(K))return Number.parseFloat(K);if(/^['"].*['"]$/.test(K))return K.slice(1,-1);if(K in j)return j[K];let J=K.match(/^(\w+)\s*(===|!==|==|!=|>=|<=|>|<)\s*(.+)$/);if(J){let[,Q,q,G]=J,W=Q in j?j[Q]:void 0,Y=_(G,j);if(W!==void 0&&Y!==void 0)switch(q){case"==":case"===":return W===Y;case"!=":case"!==":return W!==Y;case">":return W>Y;case"<":return W<Y;case">=":return W>=Y;case"<=":return W<=Y}}return}function R(K,j){let J=[],Q=K;return Q=Q.replace(/\{\{\s*(\w+)\s*\}\}/g,(q,G)=>{if(G in j)return J.push(`{{ ${G} }} -> ${j[G]}`),String(j[G]);return q}),Q=Q.replace(/\{\{\s*(\d+)\s*([+\-*])\s*(\d+)\s*\}\}/g,(q,G,W,Y)=>{let $=Number.parseInt(G,10),X=Number.parseInt(Y,10),Z;switch(W){case"+":Z=$+X;break;case"-":Z=$-X;break;case"*":Z=$*X;break;default:return q}return J.push(`{{ ${G} ${W} ${Y} }} -> ${Z}`),String(Z)}),{content:Q,folded:J}}function M(K){let j=K,J=[],Q=0;j=j.replace(/<(pre|code|script|style)([^>]*)>([\s\S]*?)<\/\1>/gi,(q)=>{let G=`__PRESERVE_${Q++}__`;return J.push({marker:G,content:q}),G}),j=j.replace(/\{\{([\s\S]*?)\}\}/g,(q)=>{let G=`__PRESERVE_${Q++}__`;return J.push({marker:G,content:q}),G}),j=j.replace(/\{\{--([\s\S]*?)--\}\}/g,""),j=j.replace(/<!--[\s\S]*?-->/g,""),j=j.replace(/>\s+</g,"><"),j=j.replace(/^\s+/gm,""),j=j.replace(/\s+$/gm,""),j=j.replace(/\s{2,}/g," ");for(let{marker:q,content:G}of J){let W=j.indexOf(q);if(W!==-1)j=j.slice(0,W)+G+j.slice(W+q.length)}return j.trim()}function N(K){let j=new Map,J=new Map,Q=/(['"])([^'"]{10,})\1/g,q;while((q=Q.exec(K))!==null){let Y=q[2];J.set(Y,(J.get(Y)||0)+1)}let G=0,W=K;for(let[Y,$]of J)if($>1){let X=`__STR_${G++}__`;j.set(X,Y);let Z=Y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),F=new RegExp(`(['"])${Z}\\1`,"g");W=W.replace(F,X)}return{content:W,pool:j,count:j.size}}function b(K,j={}){let J={...E,...j},Q=new Blob([K]).size,q=K,G=[],W=[],Y=[],$=[],X=0;if(J.target==="production")J.constants={...J.constants,__ENV__:"production"};if(J.deadCodeElimination){let H=I(q,J.constants);if(q=H.content,H.removed.length>0)G.push("Dead code elimination"),W.push(...H.removed.map((y)=>`Removed: ${y}`))}if(J.constantFolding&&Object.keys(J.constants).length>0){let H=R(q,J.constants);if(q=H.content,$=H.folded,$.length>0)G.push("Constant folding")}if(J.treeShake){if(Y=T(q,J.preserveDirectives),Y.length>0)G.push("Tree shaking")}if(J.stringPooling){let H=N(q);if(q=H.content,X=H.count,X>0)G.push("String pooling")}if(J.minifyHtml){let H=M(q);if(H.length<q.length)q=H,G.push("HTML minification")}let Z=new Blob([q]).size,F=Q>0?Math.round((1-Z/Q)*100):0;return{content:q,originalSize:Q,optimizedSize:Z,reduction:F,appliedOptimizations:G,removedDirectives:Y,foldedConstants:$,pooledStrings:X,warnings:W}}async function B(K,j={}){let J={...E,...j},Q=new Map,q=[],G=0,W=0,Y=new Set;for(let[F,H]of K){let y=b(H,J);Q.set(F,y),G+=y.originalSize,W+=y.optimizedSize,q.push(...y.warnings.map((P)=>`${F}: ${P}`));let w=A(H);for(let P of w)Y.add(P.name)}let $;if(J.treeShake)$=U(Array.from(Y));let X;if(J.stringPooling)X=new Map;let Z=G>0?Math.round((1-W/G)*100):0;return{templates:Q,directiveBundle:$,stringPool:X,totalOriginalSize:G,totalOptimizedSize:W,overallReduction:Z,warnings:q}}function C(K){return K.charAt(0).toUpperCase()+K.slice(1)}export{A as qq,T as rq,U as sq,k as tq,I as uq,_ as vq,R as wq,M as xq,N as yq,b as zq,B as Aq};
|
package/dist/chunk-y0qg6rrv.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
function K(B,E){let C=E.treeFile||{title:E.fileName,path:E.relativePath};if(B.tree.file==="title")return C.title.split("/");if(B.tree.file==="path")return[...E.relativePath.split("/").slice(0,-1),C.title];if(typeof B.tree.file==="function")return B.tree.file(C);return[C.title]}function Q(B,E){for(let z of E)z.treePath=K(B,z);let C=(B.tree.groups||[]).map((z)=>({groupConfig:{id:z.id||z.title,title:z.title,include:z.include},treeObject:{}})),q={treeObject:{}};C.push(q);for(let z=0;z<E.length;z++){let H=E[z],J=L(H,C,q);M(H.treePath,z,J.treeObject)}let A=B.tree.order==="asc"?(z,H)=>z.localeCompare(H):B.tree.order,D=[];for(let z of C)if(z===q)D.push(...I(z.treeObject,A));else if(z.groupConfig&&Object.keys(z.treeObject).length>0)D.push({group:!0,id:z.groupConfig.id,title:z.groupConfig.title,children:I(z.treeObject,A)});return D}function L(B,E,C){let q=B.treeFile||{title:B.fileName,path:B.relativePath};for(let A of E)if(A.groupConfig?.include&&A.groupConfig.include(q))return A;return C}function M(B,E,C){let q=C;for(let A=0;A<B.length;A++){let D=B[A];if(A===B.length-1)if(q[D]!==void 0){let H=1;while(q[`${D}-${H}`]!==void 0)H++;q[`${D}-${H}`]=E}else q[D]=E;else{if(q[D]===void 0)q[D]={};else if(typeof q[D]==="number"){let H=q[D];q[D]={"":H}}q=q[D]}}}function I(B,E){let C=[];for(let[q,A]of Object.entries(B))if(typeof A==="number")C.push({title:q,index:A});else C.push({title:q,children:I(A,E)});return C.sort((q,A)=>E(q.title,A.title)),C}function R(B){let E=[];function C(q){for(let A of q)if("index"in A)E.push(A.index);else if("children"in A)C(A.children)}return C(B),E}function S(B,E){function C(q,A){for(let D of q)if("index"in D&&D.index===E)return{path:[...A,D.title],node:D};else if("children"in D){let z=C(D.children,[...A,D.title]);if(z)return z}return null}return C(B,[])}
|
|
3
|
-
export{K as id,Q as jd,R as kd,S as ld};
|
package/dist/chunk-y1k17c8b.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{pB as W}from"./chunk-xv34zbp4.js";function Y(k){if(k.includes("window.StacksBrowser")||k.includes("StacksBrowser ="))return k;let H=/<script\b(?![^>]*\bserver\b)[^>]*>([\s\S]*?)<\/script>/gi,q="",F;while((F=H.exec(k))!==null)q+=F[1]+`
|
|
3
|
-
`;let G=/\{\{([\s\S]*?)\}\}/g;while((F=G.exec(k))!==null)q+=F[1]+`
|
|
4
|
-
`;if(!q.trim())return k;let A=["browserQuery","BrowserQueryBuilder","configureBrowser","createBrowserModel"].some((N)=>{return new RegExp(`\\b${N}\\b`).test(q)}),z=new Set(["Promise","Object","Array","Map","Set","Date","Error","JSON","Math","Number","String","RegExp","Symbol","WeakMap","WeakSet","Proxy","Reflect","Intl","URL","URLSearchParams","FormData","Headers","Request","Response","AbortController","EventTarget","Element","Document","Node","Window","Console","Storage","Navigator","Blob","File","FileReader","HTMLElement","SVGElement","Event","CustomEvent","DOMParser","XMLSerializer","WebSocket","Worker","SharedWorker","IntersectionObserver","MutationObserver","ResizeObserver","PerformanceObserver","Notification","Bun","Buffer","Process"]),K=/\b([A-Z][a-zA-Z0-9]*)\s*\.\s*(all|find|first|get|where|orderBy|orderByDesc|limit|select|pluck|create|update|delete)\s*\(/g,T,V=!1;while((T=K.exec(q))!==null)if(!z.has(T[1])){V=!0;break}if(!A&&!V)return k;let L=`<script type="module">
|
|
5
|
-
// STX: Auto-load @stacksjs/browser (auto-initializes API and loads models)
|
|
6
|
-
import '@stacksjs/browser'
|
|
7
|
-
</script>`;if(k.includes("</head>")){let N=k.indexOf("</head>"),Q=k.slice(0,N).indexOf("<script");if(Q!==-1)return k.slice(0,Q)+L+`
|
|
8
|
-
`+k.slice(Q);return k.replace("</head>",`${L}
|
|
9
|
-
</head>`)}if(k.includes("<body"))return k.replace(/<body([^>]*)>/,`<body$1>
|
|
10
|
-
${L}`);return L+`
|
|
11
|
-
`+k}async function Z(k,H){if(k.includes("window.stx.state")||k.includes("STX Signals Runtime"))return k;if(H.buildMode==="compile"){let z=k.indexOf("<script");if(z!==-1)return k.slice(0,z)+`<script src="/__stx/runtime.__STX_HASH__.js"></script>
|
|
12
|
-
`+k.slice(z);if(k.includes("</head>")){let K=k.indexOf("</head>");return k.slice(0,K)+`<script src="/__stx/runtime.__STX_HASH__.js"></script>
|
|
13
|
-
`+k.slice(K)}return`<script src="/__stx/runtime.__STX_HASH__.js"></script>
|
|
14
|
-
`+k}let{getCachedSignalsRuntime:q}=await import("././caching.js"),G=`<script data-stx-scoped>${await q(H.debug)}</script>`,J=k.indexOf("<script");if(J!==-1)return k.slice(0,J)+G+`
|
|
15
|
-
`+k.slice(J);if(k.includes("</head>")){let A=k.indexOf("</head>");return k.slice(0,A)+G+`
|
|
16
|
-
`+k.slice(A)}if(k.includes("<body")){let A=k.indexOf("<body"),z=k.indexOf(">",A);return k.slice(0,z+1)+`
|
|
17
|
-
`+G+k.slice(z+1)}return G+`
|
|
18
|
-
`+k}async function _(k,H){if(!k.includes("</body>"))return k;if(k.includes("__stxRouter)return")||k.includes("__stxRouter=true"))return k;let q=H?.router,F="";if(q){let z={};if(q.container)z.container=q.container;if(q.interceptAllLinks!==void 0)z.interceptAllLinks=q.interceptAllLinks;if(q.progress!==void 0)z.progress=q.progress;if(q.viewTransitions!==void 0)z.viewTransitions=q.viewTransitions;if(q.viewTransitionDuration!==void 0)z.viewTransitionDuration=q.viewTransitionDuration;if(q.viewTransitionEasing!==void 0)z.viewTransitionEasing=q.viewTransitionEasing;if(q.scrollToTop!==void 0)z.scrollToTop=q.scrollToTop;if(q.prefetch!==void 0)z.prefetch=q.prefetch;if(q.cache!==void 0)z.cache=q.cache;if(q.progressColor!==void 0)z.progressColor=q.progressColor;if(q.progressHeight!==void 0)z.progressHeight=q.progressHeight;if(Object.keys(z).length>0)F=`<script>window.__stxRouterConfig=${JSON.stringify(z)};</script>
|
|
19
|
-
`}let{getCachedRouterScript:G}=await import("././caching.js"),J=H?.buildMode==="compile"?'<script src="/__stx/router.__STX_HASH__.js"></script>':`<script>${await G()}</script>`,A=k.lastIndexOf("</body>");return k.slice(0,A)+F+J+`
|
|
20
|
-
</body>`+k.slice(A+7)}
|
|
21
|
-
export{Y as Pt,Z as Qt,_ as Rt};
|
package/dist/chunk-y5xz0jc4.js
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
function K(w){let z=new Map;for(let b of w)z.set(b.name,{name:b.name,path:b.path,dependencies:b.dependencies,dependents:[],depth:0});for(let b of w)for(let q of b.dependencies){let F=z.get(q);if(F)F.dependents.push(b.name)}let k=new Set;function A(b,q){let F=z.get(b);if(!F||k.has(b))return;F.depth=Math.max(F.depth,q),k.add(b);for(let E of F.dependencies)A(E,q+1);k.delete(b)}let B=[],j=[];for(let[b,q]of z){if(q.dependents.length===0)B.push(b),A(b,0);if(q.dependencies.length===0)j.push(b)}return{nodes:z,roots:B,leaves:j}}function O(w,z){let k=new Set,A=new Set;function B(j){if(A.has(j))return;A.add(j);let b=w.nodes.get(j);if(!b)return;for(let q of b.dependencies)k.add(q),B(q)}return B(z),Array.from(k)}function P(w,z){let k=new Set,A=new Set;function B(j){if(A.has(j))return;A.add(j);let b=w.nodes.get(j);if(!b)return;for(let q of b.dependents)k.add(q),B(q)}return B(z),Array.from(k)}function Q(w){let z=[],k=new Set,A=[];function B(j){if(A.includes(j)){let q=A.indexOf(j);z.push([...A.slice(q),j]);return}if(k.has(j))return;k.add(j),A.push(j);let b=w.nodes.get(j);if(b)for(let q of b.dependencies)B(q);A.pop()}for(let j of w.nodes.keys())B(j);return z}function R(w,z){let k=Array.from(w.nodes.values()),A=Math.max(...k.map((b)=>b.depth),0),B=[];for(let b=0;b<=A;b++)B.push(k.filter((q)=>q.depth===b));let j=B.map((b,q)=>{let F=b.map((E)=>{let J=E.name===z,I=["dep-node"];if(J)I.push("selected");if(w.roots.includes(E.name))I.push("root");if(w.leaves.includes(E.name))I.push("leaf");return`
|
|
3
|
-
<div
|
|
4
|
-
class="${I.join(" ")}"
|
|
5
|
-
onclick="window.__stxStory.selectComponent('${E.name}')"
|
|
6
|
-
title="${E.path}"
|
|
7
|
-
>
|
|
8
|
-
<span class="dep-node-name">${E.name}</span>
|
|
9
|
-
<span class="dep-node-count">
|
|
10
|
-
${E.dependencies.length>0?`\u2193${E.dependencies.length}`:""}
|
|
11
|
-
${E.dependents.length>0?`\u2191${E.dependents.length}`:""}
|
|
12
|
-
</span>
|
|
13
|
-
</div>
|
|
14
|
-
`}).join("");return`
|
|
15
|
-
<div class="dep-level" data-depth="${q}">
|
|
16
|
-
<div class="dep-level-label">Level ${q}</div>
|
|
17
|
-
<div class="dep-level-nodes">${F}</div>
|
|
18
|
-
</div>
|
|
19
|
-
`}).join("");return`
|
|
20
|
-
<div class="stx-dependency-graph">
|
|
21
|
-
<div class="dep-graph-header">
|
|
22
|
-
<span>Component Dependencies</span>
|
|
23
|
-
<span class="dep-graph-stats">
|
|
24
|
-
${w.nodes.size} components,
|
|
25
|
-
${w.roots.length} roots,
|
|
26
|
-
${w.leaves.length} leaves
|
|
27
|
-
</span>
|
|
28
|
-
</div>
|
|
29
|
-
<div class="dep-graph-body">
|
|
30
|
-
${j}
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
`}function U(){return`
|
|
34
|
-
.stx-dependency-graph {
|
|
35
|
-
padding: 16px;
|
|
36
|
-
}
|
|
37
|
-
.dep-graph-header {
|
|
38
|
-
display: flex;
|
|
39
|
-
justify-content: space-between;
|
|
40
|
-
align-items: center;
|
|
41
|
-
margin-bottom: 16px;
|
|
42
|
-
font-weight: 600;
|
|
43
|
-
}
|
|
44
|
-
.dep-graph-stats {
|
|
45
|
-
font-size: 12px;
|
|
46
|
-
color: var(--text-secondary);
|
|
47
|
-
font-weight: normal;
|
|
48
|
-
}
|
|
49
|
-
.dep-graph-body {
|
|
50
|
-
display: flex;
|
|
51
|
-
flex-direction: column;
|
|
52
|
-
gap: 16px;
|
|
53
|
-
}
|
|
54
|
-
.dep-level {
|
|
55
|
-
display: flex;
|
|
56
|
-
align-items: flex-start;
|
|
57
|
-
gap: 12px;
|
|
58
|
-
}
|
|
59
|
-
.dep-level-label {
|
|
60
|
-
width: 60px;
|
|
61
|
-
font-size: 11px;
|
|
62
|
-
color: var(--text-secondary);
|
|
63
|
-
text-transform: uppercase;
|
|
64
|
-
padding-top: 8px;
|
|
65
|
-
}
|
|
66
|
-
.dep-level-nodes {
|
|
67
|
-
display: flex;
|
|
68
|
-
flex-wrap: wrap;
|
|
69
|
-
gap: 8px;
|
|
70
|
-
flex: 1;
|
|
71
|
-
}
|
|
72
|
-
.dep-node {
|
|
73
|
-
padding: 8px 12px;
|
|
74
|
-
background: var(--bg-secondary);
|
|
75
|
-
border: 1px solid var(--border);
|
|
76
|
-
border-radius: 4px;
|
|
77
|
-
cursor: pointer;
|
|
78
|
-
display: flex;
|
|
79
|
-
align-items: center;
|
|
80
|
-
gap: 8px;
|
|
81
|
-
}
|
|
82
|
-
.dep-node:hover {
|
|
83
|
-
border-color: var(--primary);
|
|
84
|
-
}
|
|
85
|
-
.dep-node.selected {
|
|
86
|
-
background: var(--primary);
|
|
87
|
-
color: white;
|
|
88
|
-
border-color: var(--primary);
|
|
89
|
-
}
|
|
90
|
-
.dep-node.root {
|
|
91
|
-
border-left: 3px solid #22c55e;
|
|
92
|
-
}
|
|
93
|
-
.dep-node.leaf {
|
|
94
|
-
border-left: 3px solid #f59e0b;
|
|
95
|
-
}
|
|
96
|
-
.dep-node-name {
|
|
97
|
-
font-size: 13px;
|
|
98
|
-
}
|
|
99
|
-
.dep-node-count {
|
|
100
|
-
font-size: 11px;
|
|
101
|
-
color: var(--text-secondary);
|
|
102
|
-
}
|
|
103
|
-
.dep-node.selected .dep-node-count {
|
|
104
|
-
color: rgba(255,255,255,0.7);
|
|
105
|
-
}
|
|
106
|
-
`}function V(w,z){let k=w.nodes.get(z);if(!k)return'<div class="dep-detail-empty">Component not found</div>';let A=k.dependencies.length>0?k.dependencies.map((j)=>`
|
|
107
|
-
<div class="dep-link" onclick="window.__stxStory.selectComponent('${j}')">
|
|
108
|
-
\u2193 ${j}
|
|
109
|
-
</div>
|
|
110
|
-
`).join(""):'<div class="dep-none">No dependencies</div>',B=k.dependents.length>0?k.dependents.map((j)=>`
|
|
111
|
-
<div class="dep-link" onclick="window.__stxStory.selectComponent('${j}')">
|
|
112
|
-
\u2191 ${j}
|
|
113
|
-
</div>
|
|
114
|
-
`).join(""):'<div class="dep-none">No dependents</div>';return`
|
|
115
|
-
<div class="stx-component-detail">
|
|
116
|
-
<div class="dep-detail-header">
|
|
117
|
-
<span class="dep-detail-name">${z}</span>
|
|
118
|
-
<span class="dep-detail-path">${k.path}</span>
|
|
119
|
-
</div>
|
|
120
|
-
|
|
121
|
-
<div class="dep-detail-section">
|
|
122
|
-
<div class="dep-detail-title">Dependencies (${k.dependencies.length})</div>
|
|
123
|
-
${A}
|
|
124
|
-
</div>
|
|
125
|
-
|
|
126
|
-
<div class="dep-detail-section">
|
|
127
|
-
<div class="dep-detail-title">Used by (${k.dependents.length})</div>
|
|
128
|
-
${B}
|
|
129
|
-
</div>
|
|
130
|
-
|
|
131
|
-
<div class="dep-detail-actions">
|
|
132
|
-
<button onclick="window.__stxStory.openStory('${z}')">
|
|
133
|
-
Open Story
|
|
134
|
-
</button>
|
|
135
|
-
<button onclick="window.__stxStory.openSource('${k.path}')">
|
|
136
|
-
View Source
|
|
137
|
-
</button>
|
|
138
|
-
</div>
|
|
139
|
-
</div>
|
|
140
|
-
`}
|
|
141
|
-
export{K as Ya,O as Za,P as _a,Q as $a,R as ab,U as bb,V as cb};
|
package/dist/chunk-y6xsqe9a.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ks as m,Yr as C}from"./chunk-1xz0w746.js";import{dt as x}from"./chunk-g1vt329s.js";import{pB as c}from"./chunk-xv34zbp4.js";var{serve:h}=globalThis.Bun;import K from"fs";import $ from"path";function jj(W,Z=200,G={}){return new Response(W,{status:Z,headers:{"Content-Type":"text/html; charset=utf-8",...G}})}async function i(W={}){let{port:Z=3000,root:G=".",stxOptions:E={},watch:v=!0,onRequest:V,routes:N={},middleware:D=[],on404:T,onError:g}=W,F=$.resolve(G),X=new Map;async function O(A){let B=K.statSync(A),L=`${A}:${B.mtimeMs}`,z=X.get(L);if(z)return z.content;for(let J of X.keys())if(J.startsWith(`${A}:`)&&J!==L)X.delete(J);let j=await Bun.file(A).text(),Q=j,H=j.match(/<template\b(?![^>]*(?:\b(?:id|x-for|x-if|@for|@if|:for|:if)\s*=|\s#[\w-]|\bv-slot|\bslot\s*=))[^>]*>/i);if(H&&H.index!==void 0){let J=H.index+H[0].length,U=1,_=J;while(_<j.length&&U>0){let R=j.indexOf("<template",_),k=j.indexOf("</template>",_);if(k===-1)break;if(R!==-1&&R<k)U++,_=R+9;else{if(U--,U===0){Q=j.substring(J,k).trim();break}_=k+11}}}let y=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,b=[],d=[],I;while((I=y.exec(j))!==null){let J=I[1],U=I[2],_=I[0];if(J.includes("server"))d.push(U);else b.push(_)}let P=j.match(/<style\b[^>]*>[\s\S]*?<\/style>/gi)||[],p=Q.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,""),M={__filename:A,__dirname:$.dirname(A)};for(let J of d)await x(J,M,A);let Y=await m(p,M,A,E,new Set);if(P.length>0){let J=P.join(`
|
|
3
|
-
`);if(Y.match(/(<\/head>)/i))Y=Y.replace(/(<\/head>)/i,`${J}
|
|
4
|
-
$1`)}if(b.length>0){let{interpolateScriptsInTemplate:J}=await import("././expressions.js"),U=J(b.join(`
|
|
5
|
-
`),M);if(Y.match(/(<\/body>)/i))Y=Y.replace(/(<\/body>)/i,`${U}
|
|
6
|
-
$1`);else Y+=`
|
|
7
|
-
${U}`}return X.set(L,{content:Y,mtime:B.mtimeMs}),Y}async function w(A){let B=K.statSync(A),L=`${A}:${B.mtimeMs}`,z=X.get(L);if(z)return z.content;let{content:j}=await C(A,E);return X.set(L,{content:j,mtime:B.mtimeMs}),j}function u(A){let B=A.startsWith("/")?A.slice(1):A,L=[B,`${B}.stx`,`${B}.md`,`${B}.html`,$.join(B,"index.stx"),$.join(B,"index.md"),$.join(B,"index.html")];for(let z of L){let j=$.join(F,z);if(K.existsSync(j)&&K.statSync(j).isFile())return j}return null}async function f(A){let B=new URL(A.url),L=async()=>{if(N[B.pathname])return await N[B.pathname](A);if(V){let j=await V(A);if(j)return j}let z=u(B.pathname);if(!z){if(T)return await T(A);return new Response("Not Found",{status:404})}try{let j,Q="text/html";if(z.endsWith(".stx"))j=await O(z);else if(z.endsWith(".md"))j=await w(z);else if(z.endsWith(".html"))j=await Bun.file(z).text();else if(z.endsWith(".css"))j=await Bun.file(z).text(),Q="text/css";else if(z.endsWith(".js"))j=await Bun.file(z).text(),Q="text/javascript";else if(z.endsWith(".json"))j=await Bun.file(z).text(),Q="application/json";else return new Response(Bun.file(z));return new Response(j,{headers:{"Content-Type":Q}})}catch(j){if(g)return await g(j,A);let Q=j instanceof Error?j.message:String(j),y=E?.debug===!0?`<h1>Error</h1><pre>${Q}
|
|
8
|
-
${j instanceof Error?j.stack:""}</pre>`:"<h1>Internal Server Error</h1><p>An error occurred while processing your request.</p>";return new Response(y,{status:500,headers:{"Content-Type":"text/html"}})}};for(let z=D.length-1;z>=0;z--){let j=D[z],Q=L;L=async()=>await j(A,Q)}return await L()}let S=h({port:Z,fetch:f}),q=null;if(v)q=K.watch(F,{recursive:!0},(A,B)=>{if(B&&(B.endsWith(".stx")||B.endsWith(".md")||B.endsWith(".html")))X.clear()});return{server:S,url:S.url.toString(),stop(){if(q)q.close();S.stop()}}}async function zj(W,Z={}){let G=$.resolve(W);if(!await Bun.file(G).exists())throw Error(`File not found: ${G}`);let E=G.endsWith(".md"),v=G.endsWith(".stx");if(!E&&!v)throw Error(`Unsupported file type: ${G}. Only .stx and .md files are supported.`);return await i({...Z,root:$.dirname(G),routes:{"/":async()=>{let V;if(E){let{content:N}=await C(G,Z.stxOptions);V=N}else{let N=await Bun.file(G).text(),D=[],T=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,g;while((g=T.exec(N))!==null)if(g[1].includes("server"))D.push(g[2]);let F=D.join(`
|
|
9
|
-
`),X=N.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),O={};if(F.trim())await x(F,O,G);let w=new Set;V=await m(X,O,G,Z.stxOptions||{},w)}return new Response(V,{headers:{"Content-Type":"text/html"}})},...Z.routes}})}function Aj(W){return W}function Bj(W){return W}
|
|
10
|
-
export{jj as jh,i as kh,zj as lh,Aj as mh,Bj as nh};
|
package/dist/chunk-yb1t2h8h.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{zy as J}from"./chunk-fjk3x41y.js";import{Jy as K}from"./chunk-5shey2e4.js";import{pB as I}from"./chunk-xv34zbp4.js";var V={isEnabled(){return J().enableAutoRecovery},fixCommonSyntaxErrors(j){let k=J();if(!k.enableAutoRecovery)return{fixed:j,fixes:[]};let q=j,z=[],A=(q.match(/\{\{/g)||[]).length,H=(q.match(/\}\}/g)||[]).length;if(A>H){let G=A-H;q+="}}".repeat(G),z.push(`Added ${G} missing closing braces '}}'`)}let F=["if","foreach","for","switch","section"];for(let G of F){let M=(q.match(new RegExp(`@${G}\\b`,"g"))||[]).length,N=(q.match(new RegExp(`@end${G}\\b`,"g"))||[]).length;if(M>N){let O=M-N;for(let Q=0;Q<O;Q++)q+=`
|
|
3
|
-
@end${G}`;z.push(`Added ${O} missing @end${G}`)}}if(z.length>0&&k.logRecoveryWarnings)console.warn("[stx] Auto-recovery applied fixes:"),z.forEach((G)=>console.warn(` - ${G}`)),console.warn(" Consider fixing these issues in your template.");return{fixed:q,fixes:z}},createFallbackContent(j,k){if(K())return`<!-- ${j} failed: ${k.message} -->`;return"<!-- stx rendering error -->"}};class R{errors=[];maxErrors;enableFileLogging;logFilePath;logFormat;maxFileSize;maxLogFiles;minLevel;writeQueue=Promise.resolve();constructor(j={}){this.maxErrors=j.maxErrors??1000,this.enableFileLogging=j.enableFileLogging??!1,this.logFilePath=j.logFilePath??".stx/errors.log",this.logFormat=j.logFormat??"json",this.maxFileSize=j.maxFileSize??10485760,this.maxLogFiles=j.maxLogFiles??5,this.minLevel=j.minLevel??"all"}configure(j){if(j.maxErrors!==void 0)this.maxErrors=j.maxErrors;if(j.enableFileLogging!==void 0)this.enableFileLogging=j.enableFileLogging;if(j.logFilePath!==void 0)this.logFilePath=j.logFilePath;if(j.logFormat!==void 0)this.logFormat=j.logFormat;if(j.maxFileSize!==void 0)this.maxFileSize=j.maxFileSize;if(j.maxLogFiles!==void 0)this.maxLogFiles=j.maxLogFiles;if(j.minLevel!==void 0)this.minLevel=j.minLevel}log(j,k,q="error"){let z={timestamp:new Date,error:j,context:k,level:q};if(this.errors.push(z),this.errors.length>this.maxErrors)this.errors=this.errors.slice(-this.maxErrors);if(this.enableFileLogging&&this.shouldLog(q))this.writeToFile(z)}shouldLog(j){if(this.minLevel==="all")return!0;if(this.minLevel==="warning")return j==="error"||j==="warning";if(this.minLevel==="error")return j==="error";return!0}formatEntry(j){if(this.logFormat==="json")return JSON.stringify({timestamp:j.timestamp.toISOString(),level:j.level||"error",type:j.error.constructor.name,message:j.error.message,stack:j.error.stack,context:j.context});let k=[`[${j.timestamp.toISOString()}] [${(j.level||"error").toUpperCase()}] ${j.error.constructor.name}: ${j.error.message}`];if(j.error.stack)k.push(` Stack: ${j.error.stack.split(`
|
|
4
|
-
`).slice(1).join(`
|
|
5
|
-
`)}`);if(j.context)k.push(` Context: ${JSON.stringify(j.context)}`);return k.join(`
|
|
6
|
-
`)}writeToFile(j){this.writeQueue=this.writeQueue.then(async()=>{try{let k=await import("fs"),z=(await import("path")).dirname(this.logFilePath);if(!k.existsSync(z))k.mkdirSync(z,{recursive:!0});await this.rotateIfNeeded(k);let A=`${this.formatEntry(j)}
|
|
7
|
-
`;k.appendFileSync(this.logFilePath,A,"utf-8")}catch(k){if(process.env.STX_DEBUG==="true")console.error("Failed to write to error log:",k)}})}async rotateIfNeeded(j){try{if(!j.existsSync(this.logFilePath))return;if(j.statSync(this.logFilePath).size<this.maxFileSize)return;for(let q=this.maxLogFiles-1;q>=1;q--){let z=`${this.logFilePath}.${q}`,A=`${this.logFilePath}.${q+1}`;if(j.existsSync(z))if(q>=this.maxLogFiles-1)j.unlinkSync(z);else j.renameSync(z,A)}if(this.maxLogFiles<=1)j.writeFileSync(this.logFilePath,"");else j.renameSync(this.logFilePath,`${this.logFilePath}.1`)}catch(k){if(process.env.STX_DEBUG==="true")console.error("Failed to rotate error logs:",k)}}getRecentErrors(j=10){return this.errors.slice(-j)}getErrorsByType(j){return this.errors.filter((k)=>k.error.constructor.name===j)}getErrorsByLevel(j){return this.errors.filter((k)=>k.level===j)}clear(){this.errors.length=0}async clearLogFile(){try{let j=await import("fs");if(j.existsSync(this.logFilePath))j.writeFileSync(this.logFilePath,"","utf-8")}catch(j){if(process.env.STX_DEBUG==="true")console.error("Failed to clear error log:",j)}}getStats(){let j={},k={error:0,warning:0,info:0};for(let q of this.errors){let z=q.error.constructor.name;j[z]=(j[z]||0)+1;let A=q.level||"error";k[A]=(k[A]||0)+1}return{total:this.errors.length,byType:j,byLevel:k}}async exportToFile(j,k="json"){let q=await import("fs"),A=(await import("path")).dirname(j);if(!q.existsSync(A))q.mkdirSync(A,{recursive:!0});if(k==="json"){let H=this.errors.map((F)=>({timestamp:F.timestamp.toISOString(),level:F.level||"error",type:F.error.constructor.name,message:F.error.message,stack:F.error.stack,context:F.context}));q.writeFileSync(j,JSON.stringify(H,null,2),"utf-8")}else{let H=this.errors.map((F)=>this.formatEntry(F));q.writeFileSync(j,H.join(`
|
|
8
|
-
|
|
9
|
-
`),"utf-8")}}async flush(){await this.writeQueue}}var W=new R,X={isDevelopment(){return K()},logDetailedError(j,k){if(!this.isDevelopment())return;if(console.error("=== stx Detailed Error ==="),console.error("Error:",j.message),console.error("Stack:",j.stack),k)console.error("Context:",k);console.error("========================")},createErrorReport(j,k){let q=["=== stx Error Report ===",`Time: ${new Date().toISOString()}`,`Error: ${j.message}`,`Type: ${j.constructor.name}`,`Stack: ${j.stack}`];if(k)q.push(`Context: ${JSON.stringify(k,null,2)}`);return q.push("========================"),q.join(`
|
|
10
|
-
`)}};
|
|
11
|
-
export{V as uy,R as vy,W as wy,X as xy};
|