@stacksjs/stx 0.2.94 → 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 -7
- package/dist/dev-server/serve-file.js +439 -7
- package/dist/dev-server/serve-markdown.js +281 -2
- package/dist/dev-server/serve-multi.js +424 -17
- 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 +6 -7
- package/dist/chunk-03c26pjz.js +0 -3
- package/dist/chunk-04mvcmcr.js +0 -106
- package/dist/chunk-05hgyyqc.js +0 -4
- package/dist/chunk-095s3972.js +0 -99
- package/dist/chunk-0b9w2w1y.js +0 -1
- package/dist/chunk-0dz85jrp.js +0 -3
- package/dist/chunk-0g4gece6.js +0 -4
- package/dist/chunk-0jd0pndq.js +0 -3
- package/dist/chunk-0jkwrcwj.js +0 -3
- package/dist/chunk-0m9tdm7t.js +0 -71
- package/dist/chunk-0qakwen3.js +0 -1
- package/dist/chunk-0qnz93q2.js +0 -3
- package/dist/chunk-0tatqxj2.js +0 -57
- package/dist/chunk-0wdar532.js +0 -102
- package/dist/chunk-13yz561y.js +0 -3
- package/dist/chunk-174z0cd0.js +0 -3
- package/dist/chunk-1mmykse5.js +0 -81
- package/dist/chunk-1z2yq9em.js +0 -3
- package/dist/chunk-1z5nhbjt.js +0 -90
- package/dist/chunk-1zgsgk4b.js +0 -1
- package/dist/chunk-25s7bckb.js +0 -171
- package/dist/chunk-268adc7r.js +0 -2230
- package/dist/chunk-26r6zh3t.js +0 -194
- package/dist/chunk-2w3302dh.js +0 -3
- package/dist/chunk-2xen423s.js +0 -3
- package/dist/chunk-39gm08bn.js +0 -39
- package/dist/chunk-3bjtemm6.js +0 -128
- package/dist/chunk-3jm3snz8.js +0 -3
- package/dist/chunk-3ngm57nt.js +0 -12
- package/dist/chunk-3rh7va1z.js +0 -3
- package/dist/chunk-3yg9hbmb.js +0 -4
- package/dist/chunk-44hd3kab.js +0 -1
- package/dist/chunk-46mkpbkk.js +0 -12
- package/dist/chunk-48cw2nde.js +0 -2
- package/dist/chunk-48r3qe0k.js +0 -3
- package/dist/chunk-4aj7ftqb.js +0 -1
- package/dist/chunk-4bt81cg3.js +0 -61
- package/dist/chunk-4j188175.js +0 -3
- package/dist/chunk-4k7d8p8d.js +0 -188
- package/dist/chunk-4qq8ffke.js +0 -28
- package/dist/chunk-50vqeesm.js +0 -142
- package/dist/chunk-52agge4n.js +0 -38
- package/dist/chunk-55yp0q8t.js +0 -201
- package/dist/chunk-57p201gb.js +0 -83
- package/dist/chunk-5ggw1dyv.js +0 -3
- package/dist/chunk-5kt3ay7x.js +0 -10
- package/dist/chunk-5p568px4.js +0 -1166
- package/dist/chunk-5ppkfyn2.js +0 -3
- package/dist/chunk-5q87fgkk.js +0 -3
- package/dist/chunk-5qb761h2.js +0 -3
- package/dist/chunk-5xvbq2gs.js +0 -30
- package/dist/chunk-647849kf.js +0 -34
- package/dist/chunk-6b5k6w2q.js +0 -7
- package/dist/chunk-6cr3eeh4.js +0 -23
- package/dist/chunk-6djgb0hr.js +0 -3
- package/dist/chunk-6dqzky7x.js +0 -35
- package/dist/chunk-6e4c6g46.js +0 -3
- package/dist/chunk-6w03t7h6.js +0 -3
- package/dist/chunk-6wn85hn6.js +0 -4
- package/dist/chunk-6y4gqs1q.js +0 -169
- package/dist/chunk-75rndzbd.js +0 -6
- package/dist/chunk-77tga15w.js +0 -3
- package/dist/chunk-7a51hkpf.js +0 -3
- package/dist/chunk-7b0xdy5h.js +0 -386
- package/dist/chunk-7cgmq685.js +0 -33
- package/dist/chunk-7dy588as.js +0 -6
- package/dist/chunk-7rvh2wwv.js +0 -721
- package/dist/chunk-7sm05m0j.js +0 -351
- package/dist/chunk-7sqdeqsw.js +0 -1
- package/dist/chunk-7xcfy2fn.js +0 -4
- package/dist/chunk-82t27pvd.js +0 -5
- package/dist/chunk-87kx8byz.js +0 -1115
- package/dist/chunk-8fgwhhb8.js +0 -6
- package/dist/chunk-8qbax8xn.js +0 -347
- package/dist/chunk-91s2hres.js +0 -8
- package/dist/chunk-94g3cahw.js +0 -11
- package/dist/chunk-957amb71.js +0 -8
- package/dist/chunk-95w08s8v.js +0 -3
- package/dist/chunk-9agvhp1x.js +0 -93
- package/dist/chunk-9tmbrwwx.js +0 -219
- package/dist/chunk-9yz5d003.js +0 -51
- package/dist/chunk-a3hyn4we.js +0 -79
- package/dist/chunk-a69tvya5.js +0 -53
- package/dist/chunk-adjcg6wa.js +0 -498
- package/dist/chunk-adqh2m9z.js +0 -45
- package/dist/chunk-asarebzq.js +0 -292
- package/dist/chunk-aw3rp9ac.js +0 -24
- package/dist/chunk-b0cyc09a.js +0 -109
- package/dist/chunk-b3kkjcdh.js +0 -3
- package/dist/chunk-b3prs7y0.js +0 -5
- package/dist/chunk-b5zc9y0y.js +0 -90
- package/dist/chunk-baa7h4yz.js +0 -3
- package/dist/chunk-bgec9r1v.js +0 -5224
- package/dist/chunk-bjnjpsgn.js +0 -3
- package/dist/chunk-bk8ew8ze.js +0 -24
- package/dist/chunk-bn08k7yy.js +0 -3
- package/dist/chunk-bpgg59wa.js +0 -3
- package/dist/chunk-bwxda6n1.js +0 -3
- package/dist/chunk-bykjk6vj.js +0 -4
- package/dist/chunk-c53hyw5c.js +0 -477
- package/dist/chunk-c7jg8w13.js +0 -3
- package/dist/chunk-ca6qd1dx.js +0 -3
- package/dist/chunk-cdbwprfv.js +0 -6
- package/dist/chunk-ceg2c2q2.js +0 -11
- package/dist/chunk-cn409b69.js +0 -3
- package/dist/chunk-cn8az1b4.js +0 -1
- package/dist/chunk-cp3kwv17.js +0 -8
- package/dist/chunk-cpcc11vp.js +0 -5
- package/dist/chunk-cr3wbrcr.js +0 -10
- package/dist/chunk-cygfdk1n.js +0 -3
- package/dist/chunk-cyp4m0vh.js +0 -16
- package/dist/chunk-cz25azze.js +0 -4
- package/dist/chunk-d77yxcds.js +0 -3
- package/dist/chunk-dvfs1h3c.js +0 -117
- package/dist/chunk-dyjnn5k8.js +0 -262
- package/dist/chunk-dzw95th7.js +0 -3
- package/dist/chunk-e0zytzdh.js +0 -179
- package/dist/chunk-e53h9qhd.js +0 -84
- package/dist/chunk-eds0f8f1.js +0 -3
- package/dist/chunk-eh8hact1.js +0 -5
- package/dist/chunk-epj957jf.js +0 -4
- package/dist/chunk-eqeyaq6g.js +0 -77
- package/dist/chunk-fbxt2mrx.js +0 -5
- package/dist/chunk-fch9tk1k.js +0 -3
- package/dist/chunk-fe7r1mq1.js +0 -9
- package/dist/chunk-fhawx87n.js +0 -8
- package/dist/chunk-fk51yyrw.js +0 -3
- package/dist/chunk-fms20x0n.js +0 -21
- package/dist/chunk-fs0qezn5.js +0 -341
- package/dist/chunk-fzm3y0r3.js +0 -267
- package/dist/chunk-g2hekckm.js +0 -161
- package/dist/chunk-g4ps1dj8.js +0 -140
- package/dist/chunk-g8b81pzc.js +0 -3
- package/dist/chunk-ganag9dm.js +0 -3
- package/dist/chunk-gc84b1d2.js +0 -58
- package/dist/chunk-gcf5v18y.js +0 -60
- package/dist/chunk-ghrx0hn1.js +0 -4
- package/dist/chunk-gqpkp459.js +0 -3
- package/dist/chunk-h45py5w5.js +0 -2
- package/dist/chunk-h5wa62ek.js +0 -145
- package/dist/chunk-h82kjdr4.js +0 -83
- package/dist/chunk-haecq01c.js +0 -3
- package/dist/chunk-hepg894w.js +0 -3
- package/dist/chunk-hjdc99kb.js +0 -3
- package/dist/chunk-hje9v2zh.js +0 -3
- package/dist/chunk-hjv76kcw.js +0 -1
- package/dist/chunk-hke99a0v.js +0 -3
- package/dist/chunk-hpqr9e3x.js +0 -3
- package/dist/chunk-hq5cem49.js +0 -236
- package/dist/chunk-hrampcrj.js +0 -3
- package/dist/chunk-ht4j68cs.js +0 -3
- package/dist/chunk-hxx3za24.js +0 -62
- package/dist/chunk-j4s5qwd7.js +0 -4
- package/dist/chunk-jbejwejg.js +0 -8
- package/dist/chunk-jc0fc4ht.js +0 -11
- package/dist/chunk-jcs0ymw7.js +0 -3
- package/dist/chunk-jfm69keq.js +0 -231
- package/dist/chunk-jfrn43vh.js +0 -2
- package/dist/chunk-jjamhxpm.js +0 -139
- package/dist/chunk-jjvp4t5w.js +0 -27
- package/dist/chunk-jt44av4j.js +0 -3
- package/dist/chunk-jt98jhpt.js +0 -10
- package/dist/chunk-k8440jxh.js +0 -6
- package/dist/chunk-kdxa9epn.js +0 -21
- package/dist/chunk-kfd2hf6f.js +0 -3
- package/dist/chunk-kgym7ch9.js +0 -8
- package/dist/chunk-kh6rfz2v.js +0 -4
- package/dist/chunk-kkp6rs2n.js +0 -36
- package/dist/chunk-ktkmvaa8.js +0 -1
- package/dist/chunk-m59y310j.js +0 -3
- package/dist/chunk-mgmyr1b9.js +0 -6
- package/dist/chunk-mqwbpamc.js +0 -3
- package/dist/chunk-mrehzhxv.js +0 -5
- package/dist/chunk-mv03qb75.js +0 -3
- package/dist/chunk-mv4fb50w.js +0 -1
- package/dist/chunk-mwbng54r.js +0 -2
- package/dist/chunk-n46a5g1g.js +0 -3
- package/dist/chunk-n944baxp.js +0 -3
- package/dist/chunk-nanw7yhz.js +0 -14
- package/dist/chunk-nap11ntr.js +0 -21
- package/dist/chunk-ncnfa8ae.js +0 -29
- package/dist/chunk-ngxfwzq3.js +0 -3
- package/dist/chunk-nvwb4x04.js +0 -3
- package/dist/chunk-nw34xajc.js +0 -8
- package/dist/chunk-payfb24w.js +0 -207
- package/dist/chunk-pc31m5x5.js +0 -398
- package/dist/chunk-pg1fvqb9.js +0 -167
- package/dist/chunk-q60knhjf.js +0 -3
- package/dist/chunk-q6h6yvzb.js +0 -10
- package/dist/chunk-qd5461tt.js +0 -3
- package/dist/chunk-qdc3aav1.js +0 -3
- package/dist/chunk-qfwzdffx.js +0 -3
- package/dist/chunk-qgxwmagw.js +0 -134
- package/dist/chunk-qhdtssn1.js +0 -19
- package/dist/chunk-qk584whs.js +0 -3
- package/dist/chunk-qm4yppj5.js +0 -57
- package/dist/chunk-qwyd9a1d.js +0 -2
- package/dist/chunk-qxs6et76.js +0 -196
- package/dist/chunk-rb1e4cnb.js +0 -3
- package/dist/chunk-rh80q1nd.js +0 -1
- package/dist/chunk-rkffm9sy.js +0 -128
- package/dist/chunk-rv002yn0.js +0 -14
- package/dist/chunk-s6ja2bdg.js +0 -66
- package/dist/chunk-sjagg9qz.js +0 -66
- package/dist/chunk-sn07azv3.js +0 -3
- package/dist/chunk-svahbw0w.js +0 -12
- package/dist/chunk-svhtdb0s.js +0 -6
- package/dist/chunk-t37dp99j.js +0 -3
- package/dist/chunk-tj6zfxeb.js +0 -64
- package/dist/chunk-tmgz5t2g.js +0 -3
- package/dist/chunk-tr0z0e1g.js +0 -3
- package/dist/chunk-tx6br9r4.js +0 -274
- package/dist/chunk-v97390pe.js +0 -1
- package/dist/chunk-vcr5pzpx.js +0 -233
- package/dist/chunk-vdfwv0fp.js +0 -6
- package/dist/chunk-vp2395eb.js +0 -3
- package/dist/chunk-vpe6napb.js +0 -28
- package/dist/chunk-vv9wfz1c.js +0 -12
- package/dist/chunk-vw6ejgmy.js +0 -21
- package/dist/chunk-vx22he47.js +0 -1
- package/dist/chunk-w01y57f5.js +0 -1539
- package/dist/chunk-w21mwxdd.js +0 -4
- package/dist/chunk-w4n8fqp7.js +0 -216
- package/dist/chunk-w959hm8j.js +0 -358
- package/dist/chunk-wf7zrjsw.js +0 -138
- package/dist/chunk-wk07pwtd.js +0 -321
- package/dist/chunk-wvef3ngh.js +0 -127
- package/dist/chunk-wxvyj65q.js +0 -2
- package/dist/chunk-x1hjv24z.js +0 -11
- package/dist/chunk-x39sfpvm.js +0 -302
- package/dist/chunk-x4fze3q2.js +0 -314
- package/dist/chunk-x64kb787.js +0 -15
- package/dist/chunk-xcb0pbr6.js +0 -4
- package/dist/chunk-xhkjhxsp.js +0 -3
- package/dist/chunk-xhnpsngj.js +0 -5
- package/dist/chunk-xsqbk4yk.js +0 -3
- package/dist/chunk-xygc53vr.js +0 -68
- package/dist/chunk-y0qg6rrv.js +0 -3
- package/dist/chunk-y25pr13j.js +0 -19
- package/dist/chunk-y4c744dk.js +0 -3
- package/dist/chunk-y4md9hp0.js +0 -3
- package/dist/chunk-y5wazw6j.js +0 -7
- package/dist/chunk-y5xz0jc4.js +0 -141
- package/dist/chunk-y86m1wr4.js +0 -4
- package/dist/chunk-yaan98dd.js +0 -3
- package/dist/chunk-yach037f.js +0 -32
- package/dist/chunk-yexjrg9d.js +0 -7
- package/dist/chunk-ygvyc6wv.js +0 -90
- package/dist/chunk-yj560gp8.js +0 -8
- package/dist/chunk-yn38c15w.js +0 -4
- package/dist/chunk-yr1gdceh.js +0 -3
- package/dist/chunk-yw2fzq86.js +0 -3
- package/dist/chunk-ywkrxp2h.js +0 -147
- package/dist/chunk-z37xq5rx.js +0 -3
- package/dist/chunk-z4djtgt0.js +0 -71
- package/dist/chunk-z8cjr9n9.js +0 -7
- package/dist/chunk-znxp3zha.js +0 -71
- package/dist/chunk-zt2yag10.js +0 -429
package/dist/chunk-8fgwhhb8.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{vu as $}from"./chunk-tj6zfxeb.js";import{Au as Z,yu as Y}from"./chunk-7xcfy2fn.js";import{yw as X}from"./chunk-ywkrxp2h.js";function f(){return X({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async(G,B,j,y)=>{let{src:z,alt:N,options:q}=H(G,B,j);if(!z)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let J={src:z,alt:N||"",widths:q.widths||Y,formats:q.formats||Z,quality:q.quality,sizes:q.sizes,dpr:q.dpr,params:q.params,placeholder:q.placeholder,placeholderOptions:q.placeholderOptions,lazy:q.lazy!==!1,priority:q.priority||!1,loading:q.loading,decoding:q.decoding,fetchpriority:q.fetchpriority,objectFit:q.objectFit,objectPosition:q.objectPosition,class:q.class,style:q.style,id:q.id,width:q.width,height:q.height},w=j.__isDev||!1,K=await $(J,{isDev:w}),P=K.html;if(K.preloadLink)P=K.preloadLink+`
|
|
3
|
-
`+P;if(K.css)P+=`
|
|
4
|
-
<style>${K.css}</style>`;if(K.script)P+=`
|
|
5
|
-
<script>${K.script}</script>`;return P},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function H(G,B,j){if(B.src)return{src:String(B.src),alt:String(B.alt||""),options:B.options||{}};let y=G.trim();if(y.startsWith("@img(")||y.startsWith("("))y=y.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let z=M(y),N=Q(z[0],j)||"",q=Q(z[1],j)||"",J={};if(z[2]){let w=Q(z[2],j);if(typeof w==="object"&&w!==null)J=w;else if(typeof z[2]==="string")try{J=JSON.parse(z[2])}catch{}}return{src:N,alt:q,options:J}}function M(G){let B=[],j="",y=!1,z="",N=0,q=0;for(let J=0;J<G.length;J++){let w=G[J],K=J>0?G[J-1]:"";if((w==='"'||w==="'"||w==="`")&&K!=="\\"){if(!y)y=!0,z=w;else if(w===z)y=!1,z="";else j+=w;continue}if(!y){if(w==="{")N++;if(w==="}")N--;if(w==="[")q++;if(w==="]")q--;if(w===","&&N===0&&q===0){B.push(j.trim()),j="";continue}}j+=w}if(j.trim())B.push(j.trim());return B}function Q(G,B){if(typeof G!=="string")return G;let j=G.trim();if(j.startsWith('"')&&j.endsWith('"')||j.startsWith("'")&&j.endsWith("'"))return j.slice(1,-1);if(!j.startsWith("/")&&!j.startsWith(".")&&!j.startsWith("http")&&!j.startsWith("{")){let y=B[j];if(y!==void 0)return y}if(j.startsWith("{")||j.startsWith("["))try{return JSON.parse(j)}catch{}return j}var L=f();
|
|
6
|
-
export{f as tu,L as uu};
|
package/dist/chunk-8qbax8xn.js
DELETED
|
@@ -1,347 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var H=null,M=new Map,U=0;function b(){return`stx-${++U}-${Date.now().toString(36)}`}function A(q){let z={id:b(),element:q||null,mountHooks:[],destroyHooks:[],updateHooks:[],refs:new Map,watchers:[],isMounted:!1};return M.set(z.id,z),z}function $(q){H=q}function T(){return H}function X(q){if(!H)return console.warn(`[stx] ${q} must be called within a component setup.`),null;return H}function N(q){let z=X("onMount");if(z)z.mountHooks.push(q)}function K(q){let z=X("onDestroy");if(z)z.destroyHooks.push(q)}function O(q){let z=X("onUpdate");if(z)z.updateHooks.push(q)}var x=N,v=K,f=O;function W(q=null){let z={value:q,get current(){return this.value}},B=T();if(B){let E=`ref-${B.refs.size}`;B.refs.set(E,z)}return z}function g(q,z=null){let B=W(z),E=T();if(E)E.refs.set(q,B);return B}function S(q,z,B={}){let E,G,Z=!0,_=()=>{if(!Z)return;let Q=q();if(E!==Q||B.immediate){if(G)G();G=z(Q,E),E=Q}};if(B.immediate)_();else E=q();let R=setInterval(_,16),L=()=>{if(Z=!1,clearInterval(R),G)G()},P=T();if(P)P.watchers.push({stop:L}),P.destroyHooks.push(L);return L}function m(q){let z,B=!0;return{get value(){if(B)z=q(),B=!1,queueMicrotask(()=>{B=!0});return z}}}function C(q,z){let B=A(q);$(B);try{z()}finally{$(null)}return B}function d(q){if(q.isMounted)return;q.isMounted=!0;for(let z of q.mountHooks)try{let B=z();if(typeof B==="function")q.destroyHooks.push(B)}catch(B){console.error("[stx] Error in onMount hook:",B)}}function h(q){if(!q.isMounted)return;for(let z of q.updateHooks)try{let B=z();if(typeof B==="function")q.destroyHooks.push(B)}catch(B){console.error("[stx] Error in onUpdate hook:",B)}}function V(q){if(!q.isMounted)return;for(let z of q.watchers)z.stop();for(let z of q.destroyHooks)try{z()}catch(B){console.error("[stx] Error in onDestroy hook:",B)}for(let z of q.refs.values())z.value=null;q.isMounted=!1,M.delete(q.id)}function j(){return`
|
|
3
|
-
// STX Lifecycle Runtime
|
|
4
|
-
(function() {
|
|
5
|
-
if (typeof window === 'undefined') return;
|
|
6
|
-
|
|
7
|
-
const instances = new Map();
|
|
8
|
-
let currentInstance = null;
|
|
9
|
-
let idCounter = 0;
|
|
10
|
-
|
|
11
|
-
function generateId() {
|
|
12
|
-
return 'stx-' + (++idCounter) + '-' + Date.now().toString(36);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function createInstance(element) {
|
|
16
|
-
const instance = {
|
|
17
|
-
id: generateId(),
|
|
18
|
-
element: element,
|
|
19
|
-
mountHooks: [],
|
|
20
|
-
destroyHooks: [],
|
|
21
|
-
updateHooks: [],
|
|
22
|
-
refs: new Map(),
|
|
23
|
-
watchers: [],
|
|
24
|
-
isMounted: false
|
|
25
|
-
};
|
|
26
|
-
instances.set(instance.id, instance);
|
|
27
|
-
return instance;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
window.STX = window.STX || {};
|
|
31
|
-
|
|
32
|
-
// Lifecycle hooks
|
|
33
|
-
window.STX.onMount = function(hook) {
|
|
34
|
-
if (currentInstance) currentInstance.mountHooks.push(hook);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
window.STX.onDestroy = function(hook) {
|
|
38
|
-
if (currentInstance) currentInstance.destroyHooks.push(hook);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
window.STX.onUpdate = function(hook) {
|
|
42
|
-
if (currentInstance) currentInstance.updateHooks.push(hook);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// Aliases
|
|
46
|
-
window.STX.onMounted = window.STX.onMount;
|
|
47
|
-
window.STX.onUnmounted = window.STX.onDestroy;
|
|
48
|
-
window.STX.onUpdated = window.STX.onUpdate;
|
|
49
|
-
|
|
50
|
-
// Refs
|
|
51
|
-
window.STX.ref = function(initialValue) {
|
|
52
|
-
const r = { value: initialValue || null };
|
|
53
|
-
Object.defineProperty(r, 'current', {
|
|
54
|
-
get: function() { return this.value; }
|
|
55
|
-
});
|
|
56
|
-
if (currentInstance) {
|
|
57
|
-
currentInstance.refs.set('ref-' + currentInstance.refs.size, r);
|
|
58
|
-
}
|
|
59
|
-
return r;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
// Watch
|
|
63
|
-
window.STX.watch = function(source, callback, options) {
|
|
64
|
-
options = options || {};
|
|
65
|
-
let oldValue;
|
|
66
|
-
let cleanup;
|
|
67
|
-
let isActive = true;
|
|
68
|
-
|
|
69
|
-
function run() {
|
|
70
|
-
if (!isActive) return;
|
|
71
|
-
const newValue = source();
|
|
72
|
-
if (oldValue !== newValue || options.immediate) {
|
|
73
|
-
if (cleanup) cleanup();
|
|
74
|
-
cleanup = callback(newValue, oldValue);
|
|
75
|
-
oldValue = newValue;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (options.immediate) {
|
|
80
|
-
run();
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
oldValue = source();
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const intervalId = setInterval(run, 16);
|
|
87
|
-
|
|
88
|
-
function stop() {
|
|
89
|
-
isActive = false;
|
|
90
|
-
clearInterval(intervalId);
|
|
91
|
-
if (cleanup) cleanup();
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (currentInstance) {
|
|
95
|
-
currentInstance.watchers.push({ stop: stop });
|
|
96
|
-
currentInstance.destroyHooks.push(stop);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return stop;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
// Computed
|
|
103
|
-
window.STX.computed = function(getter) {
|
|
104
|
-
let cached;
|
|
105
|
-
let dirty = true;
|
|
106
|
-
return {
|
|
107
|
-
get value() {
|
|
108
|
-
if (dirty) {
|
|
109
|
-
cached = getter();
|
|
110
|
-
dirty = false;
|
|
111
|
-
queueMicrotask(function() { dirty = true; });
|
|
112
|
-
}
|
|
113
|
-
return cached;
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
// Component management
|
|
119
|
-
window.STX.setupComponent = function(element, setup) {
|
|
120
|
-
const instance = createInstance(element);
|
|
121
|
-
currentInstance = instance;
|
|
122
|
-
try {
|
|
123
|
-
setup();
|
|
124
|
-
}
|
|
125
|
-
finally {
|
|
126
|
-
currentInstance = null;
|
|
127
|
-
}
|
|
128
|
-
return instance;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
window.STX.mountComponent = function(instance) {
|
|
132
|
-
if (instance.isMounted) return;
|
|
133
|
-
instance.isMounted = true;
|
|
134
|
-
instance.mountHooks.forEach(function(hook) {
|
|
135
|
-
try {
|
|
136
|
-
const cleanup = hook();
|
|
137
|
-
if (typeof cleanup === 'function') {
|
|
138
|
-
instance.destroyHooks.push(cleanup);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
catch (e) {
|
|
142
|
-
console.error('[stx] onMount error:', e);
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
window.STX.destroyComponent = function(instance) {
|
|
148
|
-
if (!instance.isMounted) return;
|
|
149
|
-
instance.watchers.forEach(function(w) { w.stop(); });
|
|
150
|
-
instance.destroyHooks.forEach(function(hook) {
|
|
151
|
-
try { hook(); }
|
|
152
|
-
catch (e) { console.error('[stx] onDestroy error:', e); }
|
|
153
|
-
});
|
|
154
|
-
instance.refs.forEach(function(ref) { ref.value = null; });
|
|
155
|
-
instance.isMounted = false;
|
|
156
|
-
instances.delete(instance.id);
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
// ==========================================================================
|
|
160
|
-
// Vue-Style Refs System - No document.** required!
|
|
161
|
-
// ==========================================================================
|
|
162
|
-
|
|
163
|
-
// Internal: Query for ref elements without exposing document API
|
|
164
|
-
function queryRef(name, root) {
|
|
165
|
-
return (root || document).querySelector('[data-stx-ref="' + name + '"], [data-ref="' + name + '"]');
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function queryAllRefs(root) {
|
|
169
|
-
return (root || document).querySelectorAll('[data-stx-ref], [data-ref]');
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// Auto-bind refs from ref attributes (Vue-style)
|
|
173
|
-
window.STX.bindRefs = function(root, refs) {
|
|
174
|
-
if (!root) return;
|
|
175
|
-
queryAllRefs(root).forEach(function(el) {
|
|
176
|
-
var refName = el.getAttribute('data-stx-ref') || el.getAttribute('data-ref');
|
|
177
|
-
if (refs[refName]) {
|
|
178
|
-
refs[refName].value = el;
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
// Vue-style useRefs() - returns object with all refs as direct elements
|
|
184
|
-
// Usage: const { input, button, container } = STX.useRefs()
|
|
185
|
-
window.STX.useRefs = function(root) {
|
|
186
|
-
var refs = {};
|
|
187
|
-
queryAllRefs(root).forEach(function(el) {
|
|
188
|
-
var refName = el.getAttribute('data-stx-ref') || el.getAttribute('data-ref');
|
|
189
|
-
if (refName) {
|
|
190
|
-
refs[refName] = el;
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
return refs;
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
// Get a single ref by name - Vue's useTemplateRef equivalent
|
|
197
|
-
// Usage: const input = STX.useRef('input')
|
|
198
|
-
window.STX.useRef = function(name, root) {
|
|
199
|
-
return queryRef(name, root);
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
// Two-way binding helper for form elements
|
|
203
|
-
// Usage: STX.model(inputEl, state, 'username')
|
|
204
|
-
window.STX.model = function(el, state, key) {
|
|
205
|
-
if (!el || !state) return;
|
|
206
|
-
|
|
207
|
-
var isCheckbox = el.type === 'checkbox';
|
|
208
|
-
var isRadio = el.type === 'radio';
|
|
209
|
-
var isSelect = el.tagName === 'SELECT';
|
|
210
|
-
|
|
211
|
-
// Set initial value
|
|
212
|
-
if (isCheckbox) {
|
|
213
|
-
el.checked = !!state[key];
|
|
214
|
-
}
|
|
215
|
-
else if (isRadio) {
|
|
216
|
-
el.checked = el.value === state[key];
|
|
217
|
-
}
|
|
218
|
-
else {
|
|
219
|
-
el.value = state[key] || '';
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// Listen for changes
|
|
223
|
-
var eventType = isCheckbox || isRadio ? 'change' : 'input';
|
|
224
|
-
el.addEventListener(eventType, function() {
|
|
225
|
-
if (isCheckbox) {
|
|
226
|
-
state[key] = el.checked;
|
|
227
|
-
}
|
|
228
|
-
else if (isRadio) {
|
|
229
|
-
if (el.checked) state[key] = el.value;
|
|
230
|
-
}
|
|
231
|
-
else {
|
|
232
|
-
state[key] = el.value;
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
// Return cleanup function
|
|
237
|
-
return function() {
|
|
238
|
-
el.removeEventListener(eventType, arguments.callee);
|
|
239
|
-
};
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
// Batch event binding helper - cleaner than manual addEventListener
|
|
243
|
-
// Usage: STX.on({ click: [btn1, btn2], input: [textField] }, handler)
|
|
244
|
-
window.STX.on = function(el, event, handler) {
|
|
245
|
-
if (!el) return function() {};
|
|
246
|
-
el.addEventListener(event, handler);
|
|
247
|
-
return function() { el.removeEventListener(event, handler); };
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
// Bind multiple events at once
|
|
251
|
-
// Usage: STX.events(refs.btn, { click: handleClick, mouseenter: handleHover })
|
|
252
|
-
window.STX.events = function(el, eventMap) {
|
|
253
|
-
if (!el) return function() {};
|
|
254
|
-
var cleanups = [];
|
|
255
|
-
Object.keys(eventMap).forEach(function(event) {
|
|
256
|
-
el.addEventListener(event, eventMap[event]);
|
|
257
|
-
cleanups.push(function() { el.removeEventListener(event, eventMap[event]); });
|
|
258
|
-
});
|
|
259
|
-
return function() { cleanups.forEach(function(c) { c(); }); };
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
// ==========================================================================
|
|
263
|
-
// DOM Helpers - Eliminate document.* usage
|
|
264
|
-
// ==========================================================================
|
|
265
|
-
|
|
266
|
-
// Global keyboard event listener
|
|
267
|
-
// Usage: STX.onKey('Escape', () => closeModal())
|
|
268
|
-
window.STX.onKey = function(key, handler, options) {
|
|
269
|
-
var listener = function(e) {
|
|
270
|
-
if (e.key === key) {
|
|
271
|
-
handler(e);
|
|
272
|
-
}
|
|
273
|
-
};
|
|
274
|
-
document.addEventListener('keydown', listener, options);
|
|
275
|
-
return function() { document.removeEventListener('keydown', listener, options); };
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
// Create element helper
|
|
279
|
-
// Usage: STX.el('div', { class: 'foo' }, 'text content')
|
|
280
|
-
window.STX.el = function(tag, attrs, content) {
|
|
281
|
-
var el = document.createElement(tag);
|
|
282
|
-
if (attrs) {
|
|
283
|
-
Object.keys(attrs).forEach(function(key) {
|
|
284
|
-
if (key === 'class') {
|
|
285
|
-
el.className = attrs[key];
|
|
286
|
-
}
|
|
287
|
-
else if (key.startsWith('on')) {
|
|
288
|
-
el.addEventListener(key.slice(2).toLowerCase(), attrs[key]);
|
|
289
|
-
}
|
|
290
|
-
else {
|
|
291
|
-
el.setAttribute(key, attrs[key]);
|
|
292
|
-
}
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
if (content) {
|
|
296
|
-
if (typeof content === 'string') {
|
|
297
|
-
el.textContent = content;
|
|
298
|
-
}
|
|
299
|
-
else if (Array.isArray(content)) {
|
|
300
|
-
content.forEach(function(child) { el.appendChild(child); });
|
|
301
|
-
}
|
|
302
|
-
else {
|
|
303
|
-
el.appendChild(content);
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
return el;
|
|
307
|
-
};
|
|
308
|
-
|
|
309
|
-
// Get currently focused element
|
|
310
|
-
// Usage: const focused = STX.activeElement()
|
|
311
|
-
window.STX.activeElement = function() {
|
|
312
|
-
return document.activeElement;
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
// Escape HTML helper
|
|
316
|
-
// Usage: const safe = STX.escapeHtml(userInput)
|
|
317
|
-
window.STX.escapeHtml = function(text) {
|
|
318
|
-
var div = document.createElement('div');
|
|
319
|
-
div.textContent = text;
|
|
320
|
-
return div.innerHTML;
|
|
321
|
-
};
|
|
322
|
-
|
|
323
|
-
// MutationObserver for automatic lifecycle management
|
|
324
|
-
const observer = new MutationObserver(function(mutations) {
|
|
325
|
-
mutations.forEach(function(mutation) {
|
|
326
|
-
// Handle removed nodes
|
|
327
|
-
mutation.removedNodes.forEach(function(node) {
|
|
328
|
-
if (node.nodeType === 1 && node.__stx_instance__) {
|
|
329
|
-
window.STX.destroyComponent(node.__stx_instance__);
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
});
|
|
333
|
-
});
|
|
334
|
-
|
|
335
|
-
// Start observing when DOM is ready
|
|
336
|
-
if (document.readyState === 'loading') {
|
|
337
|
-
document.addEventListener('DOMContentLoaded', function() {
|
|
338
|
-
observer.observe(document.body, { childList: true, subtree: true });
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
else {
|
|
342
|
-
observer.observe(document.body, { childList: true, subtree: true });
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
console.log('[stx] Lifecycle runtime initialized');
|
|
346
|
-
})();
|
|
347
|
-
`}var J=new Map,F=[];function Y(q){return Symbol(q)}function y(q,z){(F.length>0?F[F.length-1]:J).set(q,z)}function I(q,z){for(let B=F.length-1;B>=0;B--){let E=F[B];if(E.has(q))return E.get(q)}if(J.has(q))return J.get(q);if(arguments.length>1)return z;console.warn(`[stx] Injection "${String(q)}" not found.`);return}function w(){F.push(new Map)}function D(){F.pop()}async function k(q){w();try{return await q()}finally{D()}}function p(){J.clear(),F.length=0}var l=Y("theme"),u=Y("router"),r=Y("i18n");export{A as Bz,$ as Cz,T as Dz,N as Ez,K as Fz,O as Gz,x as Hz,v as Iz,f as Jz,W as Kz,g as Lz,S as Mz,m as Nz,C as Oz,d as Pz,h as Qz,V as Rz,j as Sz,Y as Tz,y as Uz,I as Vz,w as Wz,D as Xz,k as Yz,p as Zz,l as _z,u as $z,r as aA};
|
package/dist/chunk-91s2hres.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{fe as J}from"./chunk-0qnz93q2.js";import{rB as N}from"./chunk-3jm3snz8.js";import O from"fs";import z from"path";async function Q(A={}){console.log(`
|
|
3
|
-
\uD83D\uDCD6 Previewing STX Story build...
|
|
4
|
-
`);let g=await J({mode:"build"}),B=z.resolve(g.root,g.config.outDir),K=z.join(B,"index.html");try{await O.promises.access(K)}catch{console.log(` \u274C No build found at ${g.config.outDir}`),console.log(` Run "stx story build" first.
|
|
5
|
-
`);return}let j=A.port??4173,L=Bun.serve({port:j,async fetch(k){let b=new URL(k.url).pathname;if(b==="/")b="/index.html";let G=z.join(B,b);try{let H=Bun.file(G);if(!await H.exists()){let M=`${G}.html`,I=Bun.file(M);if(await I.exists())return new Response(I);return new Response("Not found",{status:404})}return new Response(H)}catch{return new Response("Error",{status:500})}}});if(console.log(" \uD83D\uDCDA Preview server running at:"),console.log(` http://localhost:${j}
|
|
6
|
-
`),A.open)try{let{exec:k}=await import("child_process"),y=process.platform;k(`${y==="darwin"?"open":y==="win32"?"start":"xdg-open"} http://localhost:${j}`)}catch{}let E=()=>{console.log(`
|
|
7
|
-
Shutting down...`),L.stop(),process.exit(0)};process.on("SIGINT",E),process.on("SIGTERM",E),await new Promise(()=>{})}var W=Q;
|
|
8
|
-
export{Q as tb,W as ub};
|
package/dist/chunk-94g3cahw.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{By as J}from"./chunk-ht4j68cs.js";import{Ly as K}from"./chunk-fch9tk1k.js";import{rB as I}from"./chunk-3jm3snz8.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 wy,R as xy,W as yy,X as zy};
|
package/dist/chunk-957amb71.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var P=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{name:"variant",type:"string",required:!1,default:"primary"},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onclick",type:"callback",required:!1}],children:"single"}],["craft-text-input",{name:"TextInput",zigType:"craft.TextInput",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-textarea",{name:"TextArea",zigType:"craft.TextArea",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"rows",type:"number",required:!1,default:3},{name:"disabled",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-checkbox",{name:"Checkbox",zigType:"craft.Checkbox",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"label",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-select",{name:"Select",zigType:"craft.Select",props:[{name:"value",type:"string",required:!1},{name:"options",type:"array",required:!0},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-slider",{name:"Slider",zigType:"craft.Slider",props:[{name:"value",type:"number",required:!1,default:0},{name:"min",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"step",type:"number",required:!1,default:1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-toggle",{name:"Toggle",zigType:"craft.Toggle",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-modal",{name:"Modal",zigType:"craft.Modal",props:[{name:"open",type:"boolean",required:!1,default:!1},{name:"title",type:"string",required:!1},{name:"closable",type:"boolean",required:!1,default:!0},{name:"onclose",type:"callback",required:!1}],children:"multiple"}],["craft-alert",{name:"Alert",zigType:"craft.Alert",props:[{name:"variant",type:"string",required:!1,default:"info"},{name:"title",type:"string",required:!1},{name:"dismissible",type:"boolean",required:!1,default:!1}],children:"single"}],["craft-progress",{name:"ProgressBar",zigType:"craft.ProgressBar",props:[{name:"value",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"indeterminate",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-spinner",{name:"Spinner",zigType:"craft.Spinner",props:[{name:"size",type:"number",required:!1,default:24}],children:"none"}],["craft-avatar",{name:"Avatar",zigType:"craft.Avatar",props:[{name:"src",type:"string",required:!1},{name:"alt",type:"string",required:!1},{name:"size",type:"number",required:!1,default:40}],children:"none"}],["craft-badge",{name:"Badge",zigType:"craft.Badge",props:[{name:"variant",type:"string",required:!1,default:"default"}],children:"single"}],["craft-card",{name:"Card",zigType:"craft.Card",props:[{name:"padding",type:"number",required:!1,default:16}],children:"multiple"}],["craft-sidebar",{name:"Sidebar",zigType:"craft.NativeSidebar",props:[{name:"id",type:"string",required:!1},{name:"variant",type:"string",required:!1,default:"desktop"},{name:"material",type:"string",required:!1,default:"sidebar"},{name:"backgroundEffect",type:"string",required:!1,default:"shimmer"},{name:"allowsVibrancy",type:"boolean",required:!1,default:!0},{name:"materialOpacity",type:"number",required:!1,default:0.68},{name:"minWidth",type:"number",required:!1,default:240},{name:"maxWidth",type:"number",required:!1,default:340},{name:"canCollapse",type:"boolean",required:!1,default:!0},{name:"selectedItem",type:"string",required:!1},{name:"sections",type:"array",required:!1}],children:"multiple",platform:["macos"],fallback:"aside"}],["craft-sidebar-section",{name:"SidebarSection",zigType:"craft.NativeSidebarSection",props:[{name:"id",type:"string",required:!0},{name:"title",type:"string",required:!1},{name:"header",type:"string",required:!1}],children:"multiple",platform:["macos"],fallback:"section"}],["craft-sidebar-item",{name:"SidebarItem",zigType:"craft.NativeSidebarItem",props:[{name:"id",type:"string",required:!0},{name:"label",type:"string",required:!0},{name:"icon",type:"string",required:!1},{name:"badge",type:"string",required:!1},{name:"tintColor",type:"color",required:!1}],children:"none",platform:["macos"],fallback:"button"}],["craft-accordion",{name:"Accordion",zigType:"craft.Accordion",props:[{name:"title",type:"string",required:!0},{name:"open",type:"boolean",required:!1,default:!1}],children:"multiple"}],["craft-tabs",{name:"TabView",zigType:"craft.TabView",props:[{name:"activeTab",type:"number",required:!1,default:0},{name:"ontabchange",type:"callback",required:!1}],children:"multiple"}],["craft-tooltip",{name:"Tooltip",zigType:"craft.Tooltip",props:[{name:"content",type:"string",required:!0},{name:"position",type:"string",required:!1,default:"top"}],children:"single"}],["craft-date-picker",{name:"DatePicker",zigType:"craft.DatePicker",props:[{name:"value",type:"string",required:!1},{name:"min",type:"string",required:!1},{name:"max",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-time-picker",{name:"TimePicker",zigType:"craft.TimePicker",props:[{name:"value",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-color-picker",{name:"ColorPicker",zigType:"craft.ColorPicker",props:[{name:"value",type:"color",required:!1,default:"#000000"},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-data-table",{name:"DataTable",zigType:"craft.DataTable",props:[{name:"data",type:"array",required:!0},{name:"columns",type:"array",required:!0},{name:"sortable",type:"boolean",required:!1,default:!1},{name:"paginated",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-virtual-list",{name:"VirtualList",zigType:"craft.VirtualList",props:[{name:"items",type:"array",required:!0},{name:"itemHeight",type:"number",required:!1,default:48},{name:"renderItem",type:"callback",required:!0}],children:"none"}],["craft-tree-view",{name:"TreeView",zigType:"craft.TreeView",props:[{name:"data",type:"object",required:!0},{name:"expandable",type:"boolean",required:!1,default:!0}],children:"none"}]]);async function k(j,q={}){let F=performance.now(),G={target:q.target||"universal",format:q.format||"zig",optimize:q.optimize??!0,treeShake:q.treeShake??!0,hotReload:q.hotReload??!1,debug:q.debug??!1,sourceMaps:q.sourceMaps??!1,bundle:q.bundle??!0,minify:q.minify??!1,components:q.components||P},Q=typeof j==="string"?I(j):j,U=z(Q.tree,G),W=f(U),K=G.treeShake?m(U,W):U,X=new Map;if(G.target==="universal"){let $=["macos","windows","linux","ios","android"];for(let _ of $){let R=J(K,{...G,target:_});X.set(_,R)}}else{let $=J(K,G);X.set(G.target,$)}let Y=s(K,G,X),x=r(Q,K,G),M={compilationTime:performance.now()-F,totalComponents:B(Q.tree),nativeComponents:b(K),webComponents:B(Q.tree)-b(K),bundleSize:Y.length,treeShakenSize:G.treeShake?g(U,K):Y.length,warnings:[],errors:[]},L;if(G.sourceMaps)L=p(Q,K);return{code:Y,platformCode:X,dependencies:W,manifest:x,sourceMaps:L,stats:M}}function I(j){let q={type:"fragment",children:[]},F=j.match(/<body[^>]*>([\s\S]*?)<\/body>/i),G=F?F[1]:j;return A(G,q),{id:E(),hash:D(j),tree:q,scripts:i(j),styles:a(j),staticParts:new Map,dynamicParts:new Map,dependencies:[],metadata:{hasSlots:!1,hasDynamicContent:j.includes("{{"),hasEventHandlers:j.includes("onclick")||j.includes("onchange"),hasAsyncContent:!1,componentCount:0,maxDepth:0,estimatedSize:j.length}}}function A(j,q){let F=/<(@?[\w-]+)([^>]*)(?:\/>|>([\s\S]*?)<\/\1>)/g,G;while((G=F.exec(j))!==null){let[,Q,U,W]=G,K=Q.startsWith("@craft-"),X={type:K?"component":"element",tag:K?Q.slice(1):Q,props:S(U),children:[],componentName:K?Q.slice(1):void 0};if(W){let Y=W.replace(/<[^>]+>/g,"").trim();if(Y)X.children=X.children??[],X.children.push({type:"text",text:Y});A(W,X)}q.children=q.children??[],q.children.push(X)}}function S(j){let q={},F=/([\w-:@]+)(?:=["']([^"']*)["'])?/g,G;while((G=F.exec(j))!==null){let[,Q,U]=G;q[Q]=U??!0}return q}function z(j,q){return Z(j,q)}function Z(j,q){let F=j.componentName?q.components?.get(j.componentName):void 0,G="craft.View";if(F)G=F.zigType;else if(j.type==="text")G="craft.Text";else if(j.tag)G=T(j.tag);let Q={};if(j.props)for(let[X,Y]of Object.entries(j.props))Q[X]=N(Y);let U=[];if(j.children)for(let X of j.children)U.push(Z(X,q));let W=new Map;if(j.props){for(let[X,Y]of Object.entries(j.props))if(X.startsWith("on")&&typeof Y==="string")W.set(X.slice(2).toLowerCase(),Y)}let K=C(j);return{type:y(j,F),zigType:G,props:Q,children:U,events:W,styles:K,id:j.hydrationKey,key:j.props?.key}}function T(j){return{div:"craft.View",span:"craft.Text",p:"craft.Text",h1:"craft.Text",h2:"craft.Text",h3:"craft.Text",h4:"craft.Text",h5:"craft.Text",h6:"craft.Text",button:"craft.Button",input:"craft.TextInput",textarea:"craft.TextArea",select:"craft.Select",img:"craft.Image",a:"craft.Link",ul:"craft.List",ol:"craft.List",li:"craft.ListItem",form:"craft.Form",label:"craft.Label",nav:"craft.View",header:"craft.View",footer:"craft.View",main:"craft.View",section:"craft.View",article:"craft.View",aside:"craft.View"}[j.toLowerCase()]||"craft.View"}function N(j){if(typeof j==="string"){if(j.startsWith("{{")&&j.endsWith("}}"))return{type:"binding",path:j.slice(2,-2).trim()};if(j.includes("(")&&j.includes(")"))return{type:"callback",handler:j};return{type:"literal",value:j}}if(typeof j==="number"||typeof j==="boolean")return{type:"literal",value:j};return{type:"literal",value:String(j)}}function y(j,q){if(q){let G=q.name.toLowerCase();if(G.includes("button"))return"button";if(G.includes("input")||G.includes("text"))return"input";if(G.includes("image")||G.includes("avatar"))return"image";if(G.includes("list")||G.includes("table"))return"list";if(G.includes("scroll"))return"scroll";return"custom"}if(j.type==="text")return"text";let F=j.tag?.toLowerCase();if(F==="button")return"button";if(F==="input"||F==="textarea")return"input";if(F==="img")return"image";if(F==="ul"||F==="ol")return"list";return"view"}function C(j){let q=j.props?.style,F={},G={};if(q){let Q=q.split(";").filter(Boolean);for(let U of Q){let[W,K]=U.split(":").map((X)=>X.trim());if(!W||!K)continue;switch(W){case"display":F.display=K;break;case"flex-direction":F.flexDirection=K;break;case"justify-content":F.justifyContent=h(K);break;case"align-items":F.alignItems=v(K);break;case"gap":F.gap=Number.parseInt(K,10);break;case"padding":F.padding=Number.parseInt(K,10);break;case"margin":F.margin=Number.parseInt(K,10);break;case"width":F.width=K==="auto"?"auto":Number.parseInt(K,10);break;case"height":F.height=K==="auto"?"auto":Number.parseInt(K,10);break;case"background-color":case"background":G.backgroundColor=K;break;case"border-color":G.borderColor=K;break;case"border-width":G.borderWidth=Number.parseInt(K,10);break;case"border-radius":G.borderRadius=Number.parseInt(K,10);break;case"opacity":G.opacity=Number.parseFloat(K);break}}}return{layout:F,appearance:G}}function h(j){return{"flex-start":"start","flex-end":"end",center:"center","space-between":"between","space-around":"around"}[j]||"start"}function v(j){return{"flex-start":"start","flex-end":"end",center:"center",stretch:"stretch"}[j]||"start"}function f(j){let q=[],F=new Set;function G(Q,U){let W=Q.id||E();if(F.has(W))return;F.add(W);let K={id:W,type:"component",path:Q.zigType,dependencies:U?[U]:[],size:w(Q),isStatic:u(Q)};q.push(K);for(let X of Q.children)G(X,W)}return G(j),q}function w(j){let q=100;return q+=Object.keys(j.props).length*20,q+=j.events.size*50,q}function u(j){for(let q of Object.values(j.props))if(q.type!=="literal")return!1;return j.events.size===0}function m(j,q){return j}function g(j,q){let F=0;function G(Q){F+=w(Q);for(let U of Q.children)G(U)}return G(q),F}function J(j,q){switch(q.format){case"zig":return H(j,q);case"typescript":return c(j,q);case"json":return JSON.stringify(j,null,q.minify?0:2);default:return H(j,q)}}function H(j,q){let F=[];return F.push("// Auto-generated by stx compiler"),F.push("// Target: "+q.target),F.push(""),F.push('const std = @import("std");'),F.push('const craft = @import("craft");'),F.push(""),F.push("pub fn render(allocator: std.mem.Allocator) !craft.Element {"),F.push(" return try build(allocator);"),F.push("}"),F.push(""),O(j,F,0),F.join(`
|
|
3
|
-
`)}function O(j,q,F){let G=" ".repeat(F);if(F===0)q.push("fn build(allocator: std.mem.Allocator) !craft.Element {");let Q=`node_${F}`;q.push(`${G} var ${Q} = try ${j.zigType}.init(allocator);`);for(let[U,W]of Object.entries(j.props))if(W.type==="literal"){let K=typeof W.value==="string"?`"${W.value}"`:String(W.value);q.push(`${G} ${Q}.set${l(U)}(${K});`)}for(let U=0;U<j.children.length;U++){let W=j.children[U];if(W.type==="text"){let K=W.props.text?.type==="literal"?String(W.props.text.value):"";q.push(`${G} try ${Q}.addChild(try craft.Text.init(allocator, "${K}"));`)}else O(W,q,F+1),q.push(`${G} try ${Q}.addChild(node_${F+1});`)}if(F===0)q.push(` return ${Q}.element();`),q.push("}")}function c(j,q){let F=[];return F.push("// Auto-generated by stx compiler"),F.push("// Target: "+q.target),F.push(""),F.push('import { Craft } from "@stacksjs/craft";'),F.push(""),F.push("export function render(): Craft.Element {"),F.push(" return "+V(j,1)+";"),F.push("}"),F.join(`
|
|
4
|
-
`)}function V(j,q){let F=" ".repeat(q),G=[];for(let[K,X]of Object.entries(j.props))if(X.type==="literal"){let Y=typeof X.value==="string"?`"${X.value}"`:String(X.value);G.push(`${K}: ${Y}`)}let Q=G.length>0?`{ ${G.join(", ")} }`:"{}",U=j.children.map((K)=>K.type==="text"?`"${K.props.text?.type==="literal"?K.props.text.value:""}"`:V(K,q+1)),W=U.length>0?`,
|
|
5
|
-
${F} [${U.join(`,
|
|
6
|
-
${F} `)}]`:"";return`Craft.create("${j.zigType}", ${Q}${W})`}function s(j,q,F){if(q.target==="universal"){let G=[];G.push("// Universal entry point"),G.push("");for(let[Q,U]of F)G.push(`// --- ${Q.toUpperCase()} ---`),G.push(`#if ${Q.toUpperCase()}`),G.push(U),G.push("#endif"),G.push("");return G.join(`
|
|
7
|
-
`)}return F.get(q.target)||J(j,q)}function r(j,q,F){let G=[];function Q(U){G.push({name:U.zigType,hash:D(JSON.stringify(U.props)),props:Object.keys(U.props),events:Array.from(U.events.keys()),slots:[],isNative:U.zigType.startsWith("craft.")});for(let W of U.children)Q(W)}return Q(q),{version:"1.0.0",components:G,entry:j.id,assets:[],styles:j.styles}}function p(j,q){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var d=0;function E(){return`id_${++d}`}function D(j){let q=0;for(let F=0;F<j.length;F++){let G=j.charCodeAt(F);q=(q<<5)-q+G,q=q&q}return Math.abs(q).toString(36)}function l(j){return j.charAt(0).toUpperCase()+j.slice(1)}function i(j){let q=[],F=/<script[^>]*>([\s\S]*?)<\/script>/gi,G;while((G=F.exec(j))!==null)q.push(G[1]);return q}function a(j){let q=[],F=/<style[^>]*>([\s\S]*?)<\/style>/gi,G;while((G=F.exec(j))!==null)q.push(G[1]);return q}function B(j){let q=j.type==="component"?1:0;if(j.children)for(let F of j.children)q+=B(F);return q}function b(j){let q=j.zigType.startsWith("craft.")?1:0;for(let F of j.children)q+=b(F);return q}function o(j){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(q)=>{console.log(`[craft-compiler] File changed: ${q}`)}}}var t={compileToNative:k,createHotReloadServer:o,NATIVE_COMPONENTS:P},e=t;
|
|
8
|
-
export{P as Co,k as Do,o as Eo,e as Fo};
|
package/dist/chunk-95w08s8v.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
function E(j,...A){for(let z of A){if(j.serverDynamic[z]!==void 0)return String(j.serverDynamic[z]);let w=j.static[z];if(typeof w==="string")return w}return}function G(j,A){let z=new RegExp(`<(template|div|span)[^>]*\\bslot=["']${A}["'][^>]*>([\\s\\S]*?)<\\/\\1>`,"i"),w=j.match(z);if(!w)return{region:null,rest:j};return{region:w[2],rest:j.replace(w[0],"")}}var L={name:"Suspense",aliases:["suspense"],render(j,A,z){let w=G(A,"fallback"),H=w.rest,B=G(H,"error"),I=B.rest,J=w.region??E(j,"fallback")??'<div class="stx-suspense-loading">Loading\u2026</div>',K=B.region??E(j,"errorFallback","error-fallback")??'<div class="stx-suspense-error">Something went wrong.</div>';return`<div data-stx-suspense><div data-stx-suspense-fallback>${J}</div><div data-stx-suspense-error hidden>${K}</div><div data-stx-suspense-content hidden>${I}</div></div>`}};
|
|
3
|
-
export{L as az};
|
package/dist/chunk-9agvhp1x.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var Z={root:null,rootMargin:"50px 0px",threshold:0,useNative:!0,selector:"[data-stx-lazy]"};function $(){return"loading"in HTMLImageElement.prototype}function G(){return"IntersectionObserver"in window}function A(j={}){let k={...Z,...j},x=document.querySelectorAll(k.selector);if(x.length===0)return()=>{};if(k.useNative&&$())return x.forEach((q)=>{if(q.tagName==="IMG"||q.tagName==="IFRAME")M(q,k)}),()=>{};if(!G())return x.forEach((q)=>M(q,k)),()=>{};let B=new IntersectionObserver((q)=>{q.forEach((C)=>{if(C.isIntersecting){let J=C.target;M(J,k),B.unobserve(J)}})},{root:k.root,rootMargin:k.rootMargin,threshold:k.threshold});return x.forEach((q)=>B.observe(q)),()=>{B.disconnect()}}function M(j,k={}){let{onLoad:x,onLoaded:B,onError:q}=k;if(x)x(j);let C=j.tagName==="IMG",J=j.tagName==="VIDEO",K=j.tagName==="IFRAME";if(C)X(j,B,q);else if(J)Y(j,B,q);else if(K)w(j,B,q);else{let R=j.querySelector("img[data-src], img[data-srcset]"),W=j.querySelector("video[data-src]");if(R)X(R,()=>{if(B)B(j)},(Q)=>{if(q)q(j,Q)});else if(W)Y(W,()=>{if(B)B(j)},(Q)=>{if(q)q(j,Q)});j.querySelectorAll("source[data-srcset]").forEach((Q)=>{let H=Q;if(H.dataset.srcset)H.srcset=H.dataset.srcset,delete H.dataset.srcset;if(H.dataset.sizes)H.sizes=H.dataset.sizes,delete H.dataset.sizes})}}function X(j,k,x){let B=()=>{j.classList.add("stx-img-loaded"),j.style.opacity="1";let C=j.closest(".stx-img-placeholder");if(C)C.classList.add("stx-img-loaded");if(k)k(j)},q=()=>{if(j.classList.add("stx-img-error"),x)x(j,Error(`Failed to load image: ${j.src}`))};if(j.addEventListener("load",B,{once:!0}),j.addEventListener("error",q,{once:!0}),j.dataset.srcset)j.srcset=j.dataset.srcset,delete j.dataset.srcset;if(j.dataset.src)j.src=j.dataset.src,delete j.dataset.src;if(j.dataset.sizes)j.sizes=j.dataset.sizes,delete j.dataset.sizes}function Y(j,k,x){let B=()=>{if(j.classList.add("stx-video-loaded"),k)k(j)},q=()=>{if(j.classList.add("stx-video-error"),x)x(j,Error(`Failed to load video: ${j.src}`))};if(j.addEventListener("loadeddata",B,{once:!0}),j.addEventListener("error",q,{once:!0}),j.querySelectorAll("source[data-src]").forEach((J)=>{let K=J;if(K.dataset.src)K.src=K.dataset.src,delete K.dataset.src}),j.dataset.src)j.src=j.dataset.src,delete j.dataset.src;if(j.dataset.poster)j.poster=j.dataset.poster,delete j.dataset.poster;j.load()}function w(j,k,x){let B=()=>{if(j.classList.add("stx-iframe-loaded"),k)k(j)},q=()=>{if(j.classList.add("stx-iframe-error"),x)x(j,Error(`Failed to load iframe: ${j.src}`))};if(j.addEventListener("load",B,{once:!0}),j.addEventListener("error",q,{once:!0}),j.dataset.src)j.src=j.dataset.src,delete j.dataset.src}function D(j){M(j,{})}function F(j="[data-stx-lazy]"){document.querySelectorAll(j).forEach((x)=>M(x,{}))}function P(j={}){let k={...Z,...j};return new IntersectionObserver((x,B)=>{x.forEach((q)=>{if(q.isIntersecting)M(q.target,k),B.unobserve(q.target)})},{root:k.root,rootMargin:k.rootMargin,threshold:k.threshold})}function U(j,k){j.observe(k)}function _(j){j.disconnect()}function N(){return`
|
|
3
|
-
(function() {
|
|
4
|
-
'use strict';
|
|
5
|
-
|
|
6
|
-
if (typeof window === 'undefined') return;
|
|
7
|
-
|
|
8
|
-
var defaultOptions = {
|
|
9
|
-
root: null,
|
|
10
|
-
rootMargin: '50px 0px',
|
|
11
|
-
threshold: 0
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
function isNativeLazySupported() {
|
|
15
|
-
return 'loading' in HTMLImageElement.prototype;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function loadElement(el) {
|
|
19
|
-
var img = el.tagName === 'IMG' ? el : el.querySelector('img[data-src], img[data-srcset]');
|
|
20
|
-
var video = el.tagName === 'VIDEO' ? el : el.querySelector('video[data-src]');
|
|
21
|
-
|
|
22
|
-
// Load sources in picture elements
|
|
23
|
-
var sources = el.querySelectorAll('source[data-srcset]');
|
|
24
|
-
sources.forEach(function(source) {
|
|
25
|
-
if (source.dataset.srcset) {
|
|
26
|
-
source.srcset = source.dataset.srcset;
|
|
27
|
-
delete source.dataset.srcset;
|
|
28
|
-
}
|
|
29
|
-
if (source.dataset.sizes) {
|
|
30
|
-
source.sizes = source.dataset.sizes;
|
|
31
|
-
delete source.dataset.sizes;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
if (img) {
|
|
36
|
-
img.onload = function() {
|
|
37
|
-
img.style.opacity = '1';
|
|
38
|
-
img.classList.add('stx-img-loaded');
|
|
39
|
-
var wrapper = img.closest('.stx-img-placeholder');
|
|
40
|
-
if (wrapper) wrapper.classList.add('stx-img-loaded');
|
|
41
|
-
};
|
|
42
|
-
if (img.dataset.srcset) { img.srcset = img.dataset.srcset; delete img.dataset.srcset; }
|
|
43
|
-
if (img.dataset.src) { img.src = img.dataset.src; delete img.dataset.src; }
|
|
44
|
-
if (img.dataset.sizes) { img.sizes = img.dataset.sizes; delete img.dataset.sizes; }
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (video) {
|
|
48
|
-
var videoSources = video.querySelectorAll('source[data-src]');
|
|
49
|
-
videoSources.forEach(function(source) {
|
|
50
|
-
if (source.dataset.src) { source.src = source.dataset.src; delete source.dataset.src; }
|
|
51
|
-
});
|
|
52
|
-
if (video.dataset.src) { video.src = video.dataset.src; delete video.dataset.src; }
|
|
53
|
-
if (video.dataset.poster) { video.poster = video.dataset.poster; delete video.dataset.poster; }
|
|
54
|
-
video.load();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function init() {
|
|
59
|
-
var elements = document.querySelectorAll('[data-stx-lazy]');
|
|
60
|
-
if (!elements.length) return;
|
|
61
|
-
|
|
62
|
-
if (!('IntersectionObserver' in window)) {
|
|
63
|
-
elements.forEach(loadElement);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
var observer = new IntersectionObserver(function(entries) {
|
|
68
|
-
entries.forEach(function(entry) {
|
|
69
|
-
if (entry.isIntersecting) {
|
|
70
|
-
loadElement(entry.target);
|
|
71
|
-
observer.unobserve(entry.target);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}, defaultOptions);
|
|
75
|
-
|
|
76
|
-
elements.forEach(function(el) { observer.observe(el); });
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Initialize when DOM is ready
|
|
80
|
-
if (document.readyState === 'loading') {
|
|
81
|
-
document.addEventListener('DOMContentLoaded', init);
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
init();
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Expose for manual use
|
|
88
|
-
window.STX = window.STX || {};
|
|
89
|
-
window.STX.lazyLoad = loadElement;
|
|
90
|
-
window.STX.initLazyLoading = init;
|
|
91
|
-
})();
|
|
92
|
-
`.trim()}
|
|
93
|
-
export{$ as kl,G as ll,A as ml,M as nl,D as ol,F as pl,P as ql,U as rl,_ as sl,N as tl};
|