@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/x-element.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export function generateXElementRuntime() {
|
|
2
|
+
return `<script data-stx-scoped>
|
|
3
3
|
(function() {
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
@@ -283,6 +283,18 @@ else {
|
|
|
283
283
|
// Expose for manual initialization
|
|
284
284
|
window.XElement = XElement;
|
|
285
285
|
})();
|
|
286
|
-
</script
|
|
287
|
-
|
|
288
|
-
|
|
286
|
+
</script>`;
|
|
287
|
+
}
|
|
288
|
+
export function hasXElementDirectives(template) {
|
|
289
|
+
return /\bx-(data|model|text|show|init|html)\b/.test(template) || /\s:[a-z]/.test(template);
|
|
290
|
+
}
|
|
291
|
+
export function processXElementDirectives(template) {
|
|
292
|
+
if (!hasXElementDirectives(template))
|
|
293
|
+
return template;
|
|
294
|
+
const runtime = generateXElementRuntime(), bodyCloseIdx = template.lastIndexOf("</body>");
|
|
295
|
+
if (bodyCloseIdx !== -1)
|
|
296
|
+
return template.slice(0, bodyCloseIdx) + runtime + `
|
|
297
|
+
` + template.slice(bodyCloseIdx);
|
|
298
|
+
return template + `
|
|
299
|
+
` + runtime;
|
|
300
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"
|
|
5
|
-
"version": "0.2.94",
|
|
4
|
+
"version": "0.2.96",
|
|
6
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
7
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
8
7
|
"license": "MIT",
|
|
@@ -118,16 +117,16 @@
|
|
|
118
117
|
"dependencies": {
|
|
119
118
|
"@cwcss/crosswind": "^0.2.6",
|
|
120
119
|
"@stacksjs/clapp": "^0.2.0",
|
|
121
|
-
"@stacksjs/sanitizer": "0.2.
|
|
120
|
+
"@stacksjs/sanitizer": "0.2.96",
|
|
122
121
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
123
|
-
"bun-plugin-stx": "0.2.
|
|
122
|
+
"bun-plugin-stx": "0.2.96",
|
|
124
123
|
"bunfig": "^0.15.14",
|
|
125
|
-
"stx-router": "0.2.
|
|
126
|
-
"ts-broadcasting": "^0.0.
|
|
124
|
+
"stx-router": "0.2.96",
|
|
125
|
+
"ts-broadcasting": "^0.0.8",
|
|
127
126
|
"ts-images": "^0.1.9",
|
|
128
127
|
"ts-syntax-highlighter": "^0.2.1"
|
|
129
128
|
},
|
|
130
129
|
"optionalDependencies": {
|
|
131
|
-
"@stacksjs/desktop": "0.2.
|
|
130
|
+
"@stacksjs/desktop": "0.2.96"
|
|
132
131
|
}
|
|
133
132
|
}
|
package/dist/chunk-03c26pjz.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var z={patterns:[],exact:{}};function G(q,A){if(!z.exact[q])z.exact[q]=[];z.exact[q].push(A)}function H(q,A){let D=typeof q==="string"?new RegExp(q):q;z.patterns.push({pattern:D,callback:A})}async function I(q,A){let D=q.split("/").pop()?.split(".")[0]||"";if(z.exact[q])for(let B of z.exact[q])await Promise.resolve(B(A,q));if(z.exact[D])for(let B of z.exact[D])await Promise.resolve(B(A,q));for(let{pattern:B,callback:F}of z.patterns)if(B.test(q)||B.test(D))await Promise.resolve(F(A,q))}function J(){z.patterns=[],z.exact={}}
|
|
3
|
-
export{G as it,H as jt,I as kt,J as lt};
|
package/dist/chunk-04mvcmcr.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
function t(){return`
|
|
3
|
-
(function(){
|
|
4
|
-
var tip=null,hideTimer=null,currentEl=null;
|
|
5
|
-
|
|
6
|
-
function createTip(){
|
|
7
|
-
tip=document.createElement("div");
|
|
8
|
-
tip.id="stx-tooltip";
|
|
9
|
-
tip.style.cssText="position:absolute;background:#1f2937;color:#fff;font-size:12px;line-height:1.4;padding:6px 10px;border-radius:6px;max-width:250px;z-index:999999;pointer-events:none;opacity:0;transition:opacity .15s ease;white-space:pre-wrap;word-wrap:break-word;box-shadow:0 2px 8px rgba(0,0,0,.25)";
|
|
10
|
-
var arrow=document.createElement("div");
|
|
11
|
-
arrow.className="stx-tip-arrow";
|
|
12
|
-
arrow.style.cssText="position:absolute;width:0;height:0;border:5px solid transparent";
|
|
13
|
-
tip.appendChild(arrow);
|
|
14
|
-
var text=document.createElement("span");
|
|
15
|
-
text.className="stx-tip-text";
|
|
16
|
-
tip.appendChild(text);
|
|
17
|
-
document.body.appendChild(tip);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function position(el){
|
|
21
|
-
var pos=el.getAttribute("x-tooltip-position")||"top";
|
|
22
|
-
var r=el.getBoundingClientRect();
|
|
23
|
-
var sy=window.scrollY,sx=window.scrollX;
|
|
24
|
-
tip.style.display="block";
|
|
25
|
-
tip.style.opacity="0";
|
|
26
|
-
// Force layout so we can measure
|
|
27
|
-
var tw=tip.offsetWidth,th=tip.offsetHeight;
|
|
28
|
-
var arrow=tip.querySelector(".stx-tip-arrow");
|
|
29
|
-
var left,top;
|
|
30
|
-
|
|
31
|
-
if(pos==="top"){
|
|
32
|
-
left=r.left+r.width/2-tw/2+sx;
|
|
33
|
-
top=r.top-th-8+sy;
|
|
34
|
-
if(top-sy<0){pos="bottom";}
|
|
35
|
-
}
|
|
36
|
-
if(pos==="bottom"){
|
|
37
|
-
left=r.left+r.width/2-tw/2+sx;
|
|
38
|
-
top=r.bottom+8+sy;
|
|
39
|
-
arrow.style.cssText="position:absolute;width:0;height:0;border:5px solid transparent;border-bottom-color:#1f2937;top:-10px;left:50%;transform:translateX(-50%)";
|
|
40
|
-
}
|
|
41
|
-
if(pos==="left"){
|
|
42
|
-
left=r.left-tw-8+sx;
|
|
43
|
-
top=r.top+r.height/2-th/2+sy;
|
|
44
|
-
if(left-sx<0){pos="right";}
|
|
45
|
-
}
|
|
46
|
-
if(pos==="right"){
|
|
47
|
-
left=r.right+8+sx;
|
|
48
|
-
top=r.top+r.height/2-th/2+sy;
|
|
49
|
-
arrow.style.cssText="position:absolute;width:0;height:0;border:5px solid transparent;border-right-color:#1f2937;left:-10px;top:50%;transform:translateY(-50%)";
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Set arrow for top/left after potential flips
|
|
53
|
-
if(pos==="top"){
|
|
54
|
-
arrow.style.cssText="position:absolute;width:0;height:0;border:5px solid transparent;border-top-color:#1f2937;bottom:-10px;left:50%;transform:translateX(-50%)";
|
|
55
|
-
}
|
|
56
|
-
if(pos==="left"){
|
|
57
|
-
arrow.style.cssText="position:absolute;width:0;height:0;border:5px solid transparent;border-left-color:#1f2937;right:-10px;top:50%;transform:translateY(-50%)";
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Clamp horizontal
|
|
61
|
-
if(left<sx+4) left=sx+4;
|
|
62
|
-
if(left+tw>sx+window.innerWidth-4) left=sx+window.innerWidth-tw-4;
|
|
63
|
-
|
|
64
|
-
tip.style.left=left+"px";
|
|
65
|
-
tip.style.top=top+"px";
|
|
66
|
-
tip.style.opacity="1";
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function showTip(el){
|
|
70
|
-
if(hideTimer){clearTimeout(hideTimer);hideTimer=null;}
|
|
71
|
-
if(!tip) createTip();
|
|
72
|
-
var text=el.getAttribute("x-tooltip");
|
|
73
|
-
if(!text) return;
|
|
74
|
-
tip.querySelector(".stx-tip-text").textContent=text;
|
|
75
|
-
currentEl=el;
|
|
76
|
-
position(el);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function hideTip(){
|
|
80
|
-
if(!tip) return;
|
|
81
|
-
tip.style.opacity="0";
|
|
82
|
-
hideTimer=setTimeout(function(){
|
|
83
|
-
if(tip) tip.style.display="none";
|
|
84
|
-
currentEl=null;
|
|
85
|
-
},150);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
document.addEventListener("mouseover",function(e){
|
|
89
|
-
var el=e.target.closest("[x-tooltip]");
|
|
90
|
-
if(el) showTip(el);
|
|
91
|
-
});
|
|
92
|
-
document.addEventListener("mouseout",function(e){
|
|
93
|
-
var el=e.target.closest("[x-tooltip]");
|
|
94
|
-
if(el&&el===currentEl) hideTip();
|
|
95
|
-
});
|
|
96
|
-
document.addEventListener("focusin",function(e){
|
|
97
|
-
var el=e.target.closest("[x-tooltip]");
|
|
98
|
-
if(el) showTip(el);
|
|
99
|
-
});
|
|
100
|
-
document.addEventListener("focusout",function(e){
|
|
101
|
-
var el=e.target.closest("[x-tooltip]");
|
|
102
|
-
if(el) hideTip();
|
|
103
|
-
});
|
|
104
|
-
})();
|
|
105
|
-
`}
|
|
106
|
-
export{t as cz};
|
package/dist/chunk-05hgyyqc.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{eA as Q}from"./chunk-x64kb787.js";import O from"fs";import R from"path";async function U(j,b={}){let q=Date.now(),z={total:0,passed:0,failed:0,new:0,failures:[],duration:0},K=b.snapshotDir||R.join(j.root,".stx","story","snapshots");await O.promises.mkdir(K,{recursive:!0});let B=j.storyFiles;if(b.filter&&b.filter.length>0)B=B.filter((J)=>b.filter.some((G)=>J.fileName.toLowerCase().includes(G.toLowerCase())));for(let J of B)await W(J,K,b,z);return z.duration=Date.now()-q,z}async function W(j,b,q,z){let K=j.story;if(!K)return;for(let B of K.variants){z.total++;let J=R.join(b,`${j.id}-${B.id}.snap`),G=X(B.source||""),L=await Z(J);if(q.update||!L){let M={storyId:j.id,variantId:B.id,component:j.fileName,timestamp:Date.now(),hash:G};if(await O.promises.writeFile(J,JSON.stringify(M,null,2)),!L)z.new++;z.passed++}else try{let M=await O.promises.readFile(J,"utf-8"),N=JSON.parse(M);if(N.hash===G)z.passed++;else z.failed++,z.failures.push({storyId:j.id,variantId:B.id,component:j.fileName,message:"Snapshot mismatch",difference:Y(N.hash,G)})}catch(M){z.failed++,z.failures.push({storyId:j.id,variantId:B.id,component:j.fileName,message:`Error reading snapshot: ${M}`})}}}async function k(j,b={}){return(await U(j,{...b,update:!0})).total}function X(j){let b=0;for(let q=0;q<j.length;q++){let z=j.charCodeAt(q);b=(b<<5)-b+z,b=b&b}return b.toString(16)}function Y(j,b){if(j===b)return 0;let q=Math.abs(Number.parseInt(j,16)-Number.parseInt(b,16));return Math.min(q/1e6,1)}async function Z(j){try{return await O.promises.access(j),!0}catch{return!1}}function w(j){let b=[];if(b.push(""),b.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),b.push(" STX Story Visual Regression Tests"),b.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),b.push(""),j.failures.length>0){b.push(" \u274C Failures:"),b.push("");for(let q of j.failures){if(b.push(` \u2022 ${q.component} / ${q.variantId}`),b.push(` ${q.message}`),q.difference!==void 0)b.push(` Difference: ${(q.difference*100).toFixed(2)}%`);b.push("")}}if(b.push(" Summary:"),b.push(` Total: ${j.total}`),b.push(` Passed: ${j.passed} \u2713`),b.push(` Failed: ${j.failed} \u2717`),j.new>0)b.push(` New: ${j.new} \u26A1`);return b.push(` Time: ${j.duration}ms`),b.push(""),b.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),b.push(""),b.join(`
|
|
3
|
-
`)}async function A(j,b={}){let q=performance.now(),z=[],K=0,B=0;for(let G of j.storyFiles)try{let L=await Bun.file(G.path).text(),M=await Q(L,G.path);if(M.length>0){for(let N of M)z.push({storyId:G.id,variantId:"default",component:G.component,message:`A11y: ${N.message}`,expected:"No accessibility violations",actual:`${N.type}: ${N.message} (impact: ${N.impact})`});B++}else K++}catch(L){z.push({storyId:G.id,variantId:"default",component:G.component,message:`Failed to check a11y: ${L instanceof Error?L.message:String(L)}`,expected:"File readable for a11y check",actual:"File read error"}),B++}let J=performance.now()-q;return{total:j.storyFiles.length,passed:K,failed:B,new:0,failures:z,duration:J}}
|
|
4
|
-
export{U as be,k as ce,w as de,A as ee};
|
package/dist/chunk-095s3972.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
function F(b,j){let k=[],h=[];for(let q of j)if(q.required&&!(q.name in b))k.push({prop:q.name,message:`Required prop "${q.name}" is missing`,expected:q.type});for(let[q,A]of Object.entries(b)){let x=j.find((D)=>D.name===q);if(!x){h.push({prop:q,message:`Unknown prop "${q}" - not defined in component`});continue}let B=C(A,x.type,x.options);if(B)k.push({prop:q,message:B,expected:x.type,actual:typeof A})}return{valid:k.length===0,errors:k,warnings:h}}function C(b,j,k){if(b===null||b===void 0){if(j.includes("null")||j.includes("undefined")||j.includes("?"))return null;return`Expected ${j}, got ${b===null?"null":"undefined"}`}let h=typeof b,q=j.toLowerCase().trim();if(q.includes("|")){let A=q.split("|").map((x)=>x.trim());for(let x of A)if(C(b,x,k)===null)return null;return`Expected one of ${A.join(" | ")}, got ${h}`}if(k&&k.length>0){if(!k.includes(String(b)))return`Expected one of [${k.join(", ")}], got "${b}"`;return null}switch(q){case"string":if(h!=="string")return`Expected string, got ${h}`;break;case"number":if(h!=="number"||Number.isNaN(b))return`Expected number, got ${h}`;break;case"boolean":if(h!=="boolean")return`Expected boolean, got ${h}`;break;case"array":case"any[]":case"array<any>":if(!Array.isArray(b))return`Expected array, got ${h}`;break;case"object":case"record<string, any>":if(h!=="object"||Array.isArray(b))return`Expected object, got ${h}`;break;case"function":if(h!=="function")return`Expected function, got ${h}`;break;case"any":break;default:if(q.startsWith("array<")||q.endsWith("[]")){if(!Array.isArray(b))return`Expected array, got ${h}`}}return null}function H(b){return`
|
|
3
|
-
window.__stxValidateProps = function(props) {
|
|
4
|
-
const definitions = ${JSON.stringify(b)};
|
|
5
|
-
const errors = [];
|
|
6
|
-
const warnings = [];
|
|
7
|
-
|
|
8
|
-
// Check required props
|
|
9
|
-
for (const def of definitions) {
|
|
10
|
-
if (def.required && !(def.name in props)) {
|
|
11
|
-
errors.push({
|
|
12
|
-
prop: def.name,
|
|
13
|
-
message: 'Required prop "' + def.name + '" is missing',
|
|
14
|
-
expected: def.type
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Validate provided props
|
|
20
|
-
for (const [name, value] of Object.entries(props)) {
|
|
21
|
-
const def = definitions.find(d => d.name === name);
|
|
22
|
-
|
|
23
|
-
if (!def) {
|
|
24
|
-
warnings.push({
|
|
25
|
-
prop: name,
|
|
26
|
-
message: 'Unknown prop "' + name + '"'
|
|
27
|
-
});
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Basic type validation
|
|
32
|
-
const actualType = typeof value;
|
|
33
|
-
const expectedType = def.type.toLowerCase();
|
|
34
|
-
|
|
35
|
-
if (expectedType === 'string' && actualType !== 'string') {
|
|
36
|
-
errors.push({ prop: name, message: 'Expected string, got ' + actualType });
|
|
37
|
-
}
|
|
38
|
-
else if (expectedType === 'number' && actualType !== 'number') {
|
|
39
|
-
errors.push({ prop: name, message: 'Expected number, got ' + actualType });
|
|
40
|
-
}
|
|
41
|
-
else if (expectedType === 'boolean' && actualType !== 'boolean') {
|
|
42
|
-
errors.push({ prop: name, message: 'Expected boolean, got ' + actualType });
|
|
43
|
-
}
|
|
44
|
-
else if (expectedType === 'array' && !Array.isArray(value)) {
|
|
45
|
-
errors.push({ prop: name, message: 'Expected array, got ' + actualType });
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Check options
|
|
49
|
-
if (def.options && def.options.length > 0) {
|
|
50
|
-
if (!def.options.includes(String(value))) {
|
|
51
|
-
errors.push({
|
|
52
|
-
prop: name,
|
|
53
|
-
message: 'Expected one of [' + def.options.join(', ') + '], got "' + value + '"'
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return { valid: errors.length === 0, errors, warnings };
|
|
60
|
-
};
|
|
61
|
-
`}function J(b){let j=[];if(b.valid)j.push("\u2713 All props are valid");else{j.push("\u2717 Validation failed:");for(let k of b.errors)j.push(` \u2022 ${k.prop}: ${k.message}`)}if(b.warnings.length>0){j.push(""),j.push("Warnings:");for(let k of b.warnings)j.push(` \u26A0 ${k.prop}: ${k.message}`)}return j.join(`
|
|
62
|
-
`)}function K(b){if(b.valid&&b.warnings.length===0)return"";let j=b.errors.map((h)=>`
|
|
63
|
-
<div class="validation-error">
|
|
64
|
-
<strong>${h.prop}:</strong> ${h.message}
|
|
65
|
-
</div>
|
|
66
|
-
`).join(""),k=b.warnings.map((h)=>`
|
|
67
|
-
<div class="validation-warning">
|
|
68
|
-
<strong>${h.prop}:</strong> ${h.message}
|
|
69
|
-
</div>
|
|
70
|
-
`).join("");return`
|
|
71
|
-
<div class="stx-validation-panel ${b.valid?"warnings-only":"has-errors"}">
|
|
72
|
-
${j}
|
|
73
|
-
${k}
|
|
74
|
-
</div>
|
|
75
|
-
`}function L(){return`
|
|
76
|
-
.stx-validation-panel {
|
|
77
|
-
padding: 12px;
|
|
78
|
-
margin: 8px 0;
|
|
79
|
-
border-radius: 4px;
|
|
80
|
-
font-size: 13px;
|
|
81
|
-
}
|
|
82
|
-
.stx-validation-panel.has-errors {
|
|
83
|
-
background: #fee2e2;
|
|
84
|
-
border: 1px solid #ef4444;
|
|
85
|
-
}
|
|
86
|
-
.stx-validation-panel.warnings-only {
|
|
87
|
-
background: #fef3c7;
|
|
88
|
-
border: 1px solid #f59e0b;
|
|
89
|
-
}
|
|
90
|
-
.validation-error {
|
|
91
|
-
color: #dc2626;
|
|
92
|
-
margin-bottom: 4px;
|
|
93
|
-
}
|
|
94
|
-
.validation-warning {
|
|
95
|
-
color: #d97706;
|
|
96
|
-
margin-bottom: 4px;
|
|
97
|
-
}
|
|
98
|
-
`}
|
|
99
|
-
export{F as la,H as ma,J as na,K as oa,L as pa};
|
package/dist/chunk-0b9w2w1y.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// @bun
|
package/dist/chunk-0dz85jrp.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import M from"fs";import Q from"path";var T=1,W=".stx/story/search-index.json";function U(A){return Q.join(A,W)}async function Y(A){let J=U(A.root);try{let G=await M.promises.readFile(J,"utf-8"),z=JSON.parse(G);if(z.version!==T)return null;return z}catch{return null}}async function Z(A,J){let G=U(A.root),z=Q.dirname(G);await M.promises.mkdir(z,{recursive:!0});let B={version:T,created:Date.now(),updated:Date.now(),entries:J};await M.promises.writeFile(G,JSON.stringify(B,null,2))}function $(A,J){let G=[];for(let z of A){let B=J.get(z.fileName),j=[z.fileName.toLowerCase(),z.relativePath.toLowerCase()],H=[],K=[];if(B){if(B.description)j.push(B.description.toLowerCase());for(let C of B.props)if(H.push(C.name),j.push(C.name.toLowerCase()),C.description)j.push(C.description.toLowerCase());for(let C of B.slots)K.push(`slot:${C.name}`);for(let C of B.directives||[])K.push(`directive:${C.name}`);for(let C of B.dependencies)K.push(`uses:${C}`)}G.push({id:z.id,name:z.fileName,path:z.relativePath,searchText:j.join(" "),props:H,tags:K,mtime:Date.now()})}return G}async function w(A,J){for(let G of J.entries)try{let z=Q.join(A.root,G.path);if((await M.promises.stat(z)).mtimeMs>G.mtime)return!0}catch{return!0}return!1}function q(A,J){let z=J.toLowerCase().split(/\s+/).filter(Boolean);if(z.length===0)return A.entries;return A.entries.map((j)=>{let H=0;for(let K of z)if(j.name.toLowerCase()===K)H+=100;else if(j.name.toLowerCase().startsWith(K))H+=50;else if(j.name.toLowerCase().includes(K))H+=25;else if(j.props.some((C)=>C.toLowerCase().includes(K)))H+=15;else if(j.tags.some((C)=>C.toLowerCase().includes(K)))H+=10;else if(j.searchText.includes(K))H+=5;return{entry:j,score:H}}).filter((j)=>j.score>0).sort((j,H)=>H.score-j.score).map((j)=>j.entry)}async function O(A,J,G,z=!1){if(!z){let j=await Y(A);if(j&&!await w(A,j))return j.entries}let B=$(J,G);return Z(A,B).catch(()=>{}),B}
|
|
3
|
-
export{Y as H,Z as I,$ as J,w as K,q as L,O as M};
|
package/dist/chunk-0g4gece6.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var Z=[{open:"@if",close:"@endif",name:"if"},{open:"@unless",close:"@endunless",name:"unless"},{open:"@foreach",close:"@endforeach",name:"foreach"},{open:"@for",close:"@endfor",name:"for"},{open:"@while",close:"@endwhile",name:"while"},{open:"@forelse",close:"@endforelse",name:"forelse"},{open:"@switch",close:"@endswitch",name:"switch"},{open:"@isset",close:"@endisset",name:"isset"},{open:"@empty",close:"@endempty",name:"empty"},{open:"@auth",close:"@endauth",name:"auth"},{open:"@guest",close:"@endguest",name:"guest"},{open:"@can",close:"@endcan",name:"can"},{open:"@cannot",close:"@endcannot",name:"cannot"},{open:"@section",close:"@endsection",name:"section",altClose:"@show"},{open:"@push",close:"@endpush",name:"push"},{open:"@prepend",close:"@endprepend",name:"prepend"},{open:"@once",close:"@endonce",name:"once"},{open:"@markdown",close:"@endmarkdown",name:"markdown"},{open:"@component",close:"@endcomponent",name:"component"}],$=[{pattern:/@if\s*[^(]/,message:"@if directive missing parentheses",suggestion:"Use @if(condition)"},{pattern:/@foreach\s*[^(]/,message:"@foreach directive missing parentheses",suggestion:"Use @foreach(items as item)"},{pattern:/@foreach\([^)]*\)\s*[^@\n<]/,message:"@foreach may have content on same line",suggestion:"Put content on new line after @foreach()"},{pattern:/@include\s*[^(]/,message:"@include directive missing parentheses",suggestion:"Use @include('partial-name')"},{pattern:/@extends\s*[^(]/,message:"@extends directive missing parentheses",suggestion:"Use @extends('layout-name') or @layout('layout-name')"},{pattern:/@layout\s*[^(]/,message:"@layout directive missing parentheses",suggestion:"Use @layout('layout-name')"}],B=[{pattern:/\{\{\s*constructor\s*\}\}/,message:"Attempting to access constructor property"},{pattern:/\{\{\s*__proto__\s*\}\}/,message:"Attempting to access __proto__ property"},{pattern:/\{\{\s*eval\s*\(/,message:"Attempting to use eval in expression"}];function F(j){let z=[],b=[];return G(j,z),L(j,z,b),U(j,b),f(j,z),{valid:z.length===0,errors:z,warnings:b}}function G(j,z){let b=(j.match(/\{\{/g)||[]).length,q=(j.match(/\}\}/g)||[]).length;if(b!==q)z.push({type:"expression",message:`Unclosed expression brackets: found ${b} opening '{{' and ${q} closing '}}'`,suggestion:"Ensure every {{ has a matching }}"})}function L(j,z,b){for(let q of Z){let W=new RegExp(`${q.open}(?:\\s|\\()`,"g"),X=new RegExp(q.close,"g"),Q=(j.match(W)||[]).length,J=(j.match(X)||[]).length;if(q.altClose){let Y=new RegExp(q.altClose,"g");J+=(j.match(Y)||[]).length}if(Q>J)z.push({type:"directive",message:`Unclosed @${q.name} directive: found ${Q} opening and ${J} closing`,suggestion:`Add ${Q-J} missing ${q.close} tag(s)`});else if(J>Q)b.push({type:"directive",message:`Extra ${q.close} found: ${J-Q} more closing than opening`,suggestion:`Check for orphaned ${q.close} tags`})}}function U(j,z){for(let b of $)if(b.pattern.test(j))z.push({type:"syntax",message:b.message,suggestion:b.suggestion})}function f(j,z){for(let b of B)if(b.pattern.test(j))z.push({type:"expression",message:`Security warning: ${b.message}`,suggestion:"Remove dangerous code from template expressions"})}function H(j,z){let b=j.slice(0,z).split(`
|
|
3
|
-
`);return{line:b.length,column:b[b.length-1].length+1}}function K(j,z,b){let q=[];switch(j){case"if":case"elseif":case"unless":if(b.length===0)q.push({type:"syntax",message:`@${j} requires a condition`,suggestion:`Use @${j}(condition)`});break;case"foreach":if(b.length===0||!b[0].includes(" as "))q.push({type:"syntax",message:'@foreach requires "items as item" syntax',suggestion:"Use @foreach(items as item) or @foreach(items as key => value)"});break;case"for":if(b.length===0)q.push({type:"syntax",message:"@for requires loop parameters",suggestion:"Use @for(let i = 0; i < 10; i++)"});break;case"switch":if(b.length===0)q.push({type:"syntax",message:"@switch requires an expression",suggestion:"Use @switch(expression)"});break;case"case":if(b.length===0)q.push({type:"syntax",message:"@case requires a value",suggestion:"Use @case(value)"});break;case"include":case"extends":case"component":if(b.length===0)q.push({type:"syntax",message:`@${j} requires a path`,suggestion:`Use @${j}('path/to/template')`});break}return q}function M(j){return/@[a-z]+/i.test(j)||/\{\{/.test(j)}function V(j){let z=j.matchAll(/@([a-z]+)/gi),b=new Set;for(let q of z){let W=q[1].toLowerCase();if(!W.startsWith("end"))b.add(W)}return Array.from(b)}
|
|
4
|
-
export{F as _s,H as $s,K as at,M as bt,V as ct};
|
package/dist/chunk-0jd0pndq.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var E=[];function Q(D){E=[];for(let z of D.storyFiles)if(E.push({text:z.fileName.toLowerCase(),original:z.fileName,type:"story",storyId:z.id}),E.push({text:z.relativePath.toLowerCase(),original:z.relativePath,type:"story",storyId:z.id}),z.story)for(let A of z.story.variants)E.push({text:A.title.toLowerCase(),original:A.title,type:"story",storyId:z.id,variantId:A.id})}function R(D){for(let z of D){let A=z.name.toLowerCase().replace(/[^a-z0-9]+/g,"-");if(E.push({text:z.name.toLowerCase(),original:z.name,type:"component",storyId:A}),z.description)E.push({text:z.description.toLowerCase(),original:z.description,type:"component",storyId:A});for(let B of z.props)if(E.push({text:B.name.toLowerCase(),original:B.name,type:"prop",storyId:A,meta:{propType:B.type}}),B.description)E.push({text:B.description.toLowerCase(),original:B.description,type:"prop",storyId:A,meta:{propName:B.name}});for(let B of z.slots)E.push({text:B.name.toLowerCase(),original:B.name,type:"slot",storyId:A});if(z.tags)for(let B of z.tags)E.push({text:B.toLowerCase(),original:B,type:"component",storyId:A,meta:{tag:!0}})}}function T(D,z=20){if(!D||D.length<2)return[];let A=D.toLowerCase(),B=[],H=new Set;for(let C of E){let F=C.text.indexOf(A);if(F===-1)continue;let G=100;if(C.text===A)G+=50;if(F===0)G+=30;if(F===0||C.text[F-1]===" "||C.text[F-1]==="-")G+=20;if(C.type==="story")G+=10;if(C.type==="component")G+=5;G-=C.text.length*0.5;let K=`${C.storyId}-${C.variantId||""}-${C.type}`;if(H.has(K))continue;H.add(K),B.push({type:C.type,title:C.original,storyId:C.storyId,variantId:C.variantId,score:G,match:P(C.original,D)})}return B.sort((C,F)=>F.score-C.score),B.slice(0,z)}function P(D,z){let A=D.toLowerCase().indexOf(z.toLowerCase());if(A===-1)return D;let B=D.slice(0,A),H=D.slice(A,A+z.length),C=D.slice(A+z.length);return`${B}<mark>${H}</mark>${C}`}function U(){return[]}function V(){E=[]}function W(){return E.length}function X(){return JSON.stringify(E)}function Y(D){try{E=JSON.parse(D)}catch{E=[]}}
|
|
3
|
-
export{Q as Bb,R as Cb,T as Db,U as Eb,V as Fb,W as Gb,X as Hb,Y as Ib};
|
package/dist/chunk-0jkwrcwj.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var J=typeof window<"u"&&typeof document<"u";async function G(q,C,A){if(!J)return;try{let j=q.getAttribute("data-island-id"),f=document.querySelector(`script[data-island-props="${j}"]`),x=f?JSON.parse(f.textContent||"{}"):{},D=await A(),E=D.default||D.hydrate;if(typeof E!=="function"){console.error(`Island handler for "${C}" does not export a valid hydration function`);return}await E(q,x),q.setAttribute("data-hydrated","true")}catch(j){console.error(`Failed to hydrate island "${C}":`,j)}}function K(q){if(!J)return;let C=document.querySelectorAll("[data-island]"),A=[];if(C.forEach((j)=>{let f=j.getAttribute("data-island"),x=j.getAttribute("data-priority")||"lazy";if(!f||!q[f]||j.getAttribute("data-hydrated")==="true")return;if(x==="eager")G(j,f,q[f]);else A.push([j,f])}),A.length>0&&"IntersectionObserver"in window){let j=new IntersectionObserver((f)=>{f.forEach((x)=>{if(x.isIntersecting){let D=x.target,E=D.getAttribute("data-island");if(E&&q[E]&&D.getAttribute("data-hydrated")!=="true")G(D,E,q[E]),j.unobserve(D)}})},{rootMargin:"200px",threshold:0});A.forEach(([f])=>{j.observe(f)})}else setTimeout(()=>{A.forEach(([j,f])=>{if(j.getAttribute("data-hydrated")!=="true")G(j,f,q[f])})},1000)}function L(q){if(!J)return;Object.entries(q).forEach(([C,A])=>{try{let f=A.toString().match(/import\(['"](.+)['"]\)/);if(f&&f[1]){let x=document.createElement("link");x.rel="modulepreload",x.href=f[1],x.setAttribute("data-island-module",C),document.head.appendChild(x)}}catch(j){console.warn(`Failed to preload island handler for "${C}":`,j)}})}
|
|
3
|
-
export{K as wp,L as xp};
|
package/dist/chunk-0m9tdm7t.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var J=0;function O(){return`stx-teleport-${++J}`}function P(k){let j=k.split(",").map((q)=>q.trim()),F=j[0].replace(/['"]/g,""),w;for(let q=1;q<j.length;q++){let z=j[q].match(/disabled:\s*(.+)/);if(z)w=z[1].trim()}return{target:F,disabled:w}}function Q(k,j){return`
|
|
3
|
-
<script>
|
|
4
|
-
(function() {
|
|
5
|
-
const source = document.getElementById('${k}');
|
|
6
|
-
if (!source) return;
|
|
7
|
-
|
|
8
|
-
// Get the content template up-front so we can hold a reference for the
|
|
9
|
-
// retry path. (template.content is moved out by cloneNode below.)
|
|
10
|
-
const template = source.querySelector('template');
|
|
11
|
-
if (!template) return;
|
|
12
|
-
|
|
13
|
-
function mount(targetEl) {
|
|
14
|
-
// Clone the template content and wrap it for tracking.
|
|
15
|
-
const content = template.content.cloneNode(true);
|
|
16
|
-
const wrapper = document.createElement('div');
|
|
17
|
-
wrapper.setAttribute('data-teleport-from', '${k}');
|
|
18
|
-
wrapper.appendChild(content);
|
|
19
|
-
|
|
20
|
-
targetEl.appendChild(wrapper);
|
|
21
|
-
|
|
22
|
-
// Remove the source placeholder
|
|
23
|
-
source.remove();
|
|
24
|
-
|
|
25
|
-
wrapper.dispatchEvent(new CustomEvent('teleport:mounted', {
|
|
26
|
-
bubbles: true,
|
|
27
|
-
detail: { sourceId: '${k}', target: '${j}' }
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// The teleport script runs inline at the position it's emitted. If the
|
|
32
|
-
// target is declared later in the same render pass (e.g. by a layout
|
|
33
|
-
// shell whose onMount creates the portal root), the first lookup
|
|
34
|
-
// misses. Pre-fix (stacksjs/stx#1728) the script bailed with a warning
|
|
35
|
-
// and never tried again. Now retry once via requestAnimationFrame so
|
|
36
|
-
// targets that land in the same paint cycle still work. A second
|
|
37
|
-
// miss is still a warning \u2014 we don't loop forever.
|
|
38
|
-
const firstEl = document.querySelector('${j}');
|
|
39
|
-
if (firstEl) { mount(firstEl); return; }
|
|
40
|
-
|
|
41
|
-
requestAnimationFrame(function() {
|
|
42
|
-
const retryEl = document.querySelector('${j}');
|
|
43
|
-
if (retryEl) { mount(retryEl); return; }
|
|
44
|
-
console.warn('[stx] Teleport target not found: ${j}');
|
|
45
|
-
});
|
|
46
|
-
})();
|
|
47
|
-
</script>
|
|
48
|
-
`}function U(k,j,F){J=0;let w=/@teleport\s*\(([^)]+)\)\s*([\s\S]*?)@endteleport/g;return k.replace(w,(q,z,K)=>{let G=O(),{target:L,disabled:v}=P(z),H=K.trim();if(v)try{let B=!1;if(v==="true")B=!0;else if(v==="false")B=!1;else if(v in j)B=Boolean(j[v]);if(B)return`<div class="stx-teleport-inline" data-teleport-disabled>${H}</div>`}catch{}let N=Q(G,L);return`
|
|
49
|
-
<div id="${G}" class="stx-teleport-source" style="display: none;">
|
|
50
|
-
<template>${H}</template>
|
|
51
|
-
</div>
|
|
52
|
-
${N}
|
|
53
|
-
`})}function V(){return`
|
|
54
|
-
<script>
|
|
55
|
-
(function() {
|
|
56
|
-
// Common teleport targets
|
|
57
|
-
const targets = ['#stx-modals', '#stx-tooltips', '#stx-notifications'];
|
|
58
|
-
|
|
59
|
-
targets.forEach(selector => {
|
|
60
|
-
const id = selector.slice(1); // Remove #
|
|
61
|
-
if (!document.getElementById(id)) {
|
|
62
|
-
const el = document.createElement('div');
|
|
63
|
-
el.id = id;
|
|
64
|
-
el.setAttribute('data-teleport-container', '');
|
|
65
|
-
document.body.appendChild(el);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
})();
|
|
69
|
-
</script>
|
|
70
|
-
`}
|
|
71
|
-
export{U as Lf,V as Mf};
|
package/dist/chunk-0qakwen3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// @bun
|
package/dist/chunk-0qnz93q2.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{me as A}from"./chunk-ngxfwzq3.js";import E from"path";async function K(j){let k=j.root??process.cwd(),q;try{let z=await import(E.join(k,"stx.config.ts"));q=(z.default||z).story}catch{}let B={...q,...j.config},D=A(B);return{root:k,config:D,storyFiles:[],tree:void 0,mode:j.mode}}function L(j,k){j.storyFiles=k}function N(j,k){j.tree=k}
|
|
3
|
-
export{K as fe,L as ge,N as he};
|
package/dist/chunk-0tatqxj2.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{rz as g,sz as M}from"./chunk-adqh2m9z.js";import V from"crypto";function L(j){return String(j??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var W={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function b(j){return{...W,...j.forms?.classes}}function N(j,q,K,U){let Z=j||q;return K?`${Z} ${U}`:Z}function h(){return V.randomUUID()}function v(j,q,K,U){let Z=b(U),X=j;return X=d(X,q),X=Q(X,q),X=f(X,q,Z),X=x(X,q,Z),X}function Q(j,q){let K=j;return K=K.replace(/@csrf/g,()=>{if(!q.csrf||typeof q.csrf!=="object"){let U=h();q.csrf={token:U}}if(q.csrf.field)return q.csrf.field;if(q.csrf.token)return`<input type="hidden" name="_token" value="${L(q.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),K=K.replace(/@method\(['"]([^'"]+)['"]\)/g,(U,Z)=>{let X=Z.toUpperCase();if(Z&&!["GET","POST"].includes(X))return`<input type="hidden" name="_method" value="${L(X)}">`;return U}),K}function f(j,q,K=W){let U=j;return U=U.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(Z,X,$,Y,G,_="")=>{let w=X||$||"POST",P=Y||G||"",B=k(_),J=w.toUpperCase(),I=["GET","POST"].includes(J)?J:"POST",z=`<form method="${L(I)}" action="${L(P)}"${B?` ${B}`:""}>`;if(z+=`
|
|
3
|
-
${Q("@csrf",q)}`,!["GET","POST"].includes(J))z+=`
|
|
4
|
-
${Q(`@method('${J}')`,q)}`;return z}),U=U.replace(/@endform/g,"</form>"),U=U.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(Z,X,$,Y,G,_="")=>{let w=X||$||"",P=Y||G||"",B=k(_),J=H(w,q),I=J!==void 0&&J!==null?J:P||"",z=B.match(/type=['"]([^'"]+)['"]/i),T=z?z[1]:"text",R=O(w,q),D=B.match(/class=['"]([^'"]+)['"]/i),F=N(D?D[1]:"",K.input,R,K.inputError),y=B.replace(/class=['"][^'"]+['"]/i,"");return y=y.replace(/type=['"][^'"]+['"]/i,""),`<input type="${L(T)}" name="${L(w)}" value="${L(I)}" class="${F}"${y?` ${y}`:""}>`}),U=U.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(Z,X,$="",Y="")=>{let G=k($),_=H(X,q)||Y.trim(),w=O(X,q),P=G.match(/class=['"]([^'"]+)['"]/i),B=N(P?P[1]:"",K.input,w,K.inputError),J=G.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${L(X)}" class="${B}"${J?` ${J}`:""}>${L(_)}</textarea>`}),U=U.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(Z,X,$="",Y)=>{let G=k($),_=H(X,q),w=O(X,q),P=G.match(/class=['"]([^'"]+)['"]/i),B=N(P?P[1]:"",K.input,w,K.inputError),J=G.replace(/class=['"][^'"]+['"]/i,""),I=Y;if(_!==void 0)I=Y.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(z,T,R)=>{if((Array.isArray(_)?_.some((F)=>String(F)===R):String(_)===R)&&!T.includes("selected"))return T.replace(/(<option)/,"$1 selected");return z});return`<select name="${L(X)}" class="${B}"${J?` ${J}`:""}>${I}</select>`}),U=U.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(Z,X,$="1",Y="")=>{let G=k(Y),_=H(X,q),w=_!==void 0&&(Array.isArray(_)?_.some((I)=>String(I)===$):_===!0||String(_)===$),P=G.match(/class=['"]([^'"]+)['"]/i),B=P?P[1]:K.checkInput,J=G.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${L(X)}" value="${L($)}" class="${B}"${w?" checked":""}${J?` ${J}`:""}>`}),U=U.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Z,X,$,Y="")=>{let G=k(Y),_=H(X,q),w=_!==void 0&&_===$,P=G.match(/class=['"]([^'"]+)['"]/i),B=P?P[1]:K.checkInput,J=G.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${L(X)}" value="${L($)}" class="${B}"${w?" checked":""}${J?` ${J}`:""}>`}),U=U.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Z,X,$="")=>{let Y=k($),G=Y.match(/accept=['"]([^'"]+)['"]/i),_=G?G[1]:"",w=Y.includes("multiple"),P=O(X,q),B=Y.match(/class=['"]([^'"]+)['"]/i),J=N(B?B[1]:"",K.input,P,K.inputError),I=Y.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),z=[`<input type="file" name="${L(X)}"`,`class="${J}"`];if(_)z.push(`accept="${L(_)}"`);if(w)z.push("multiple");if(I)z.push(I);return`${z.join(" ")}>`}),U=U.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(Z,X,$="",Y)=>{let G=k($),_=G.match(/class=['"]([^'"]+)['"]/i),w=_?_[1]:K.label,P=G.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${L(X)}" class="${w}"${P?` ${P}`:""}>${Y}</label>`}),U}function x(j,q,K=W){return j.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(U,Z,X)=>{try{if(O(Z,q))return X.replace(/\{\{([^}]+)\}\}/g,($,Y)=>{try{if(Y.trim()==="$message"||Y.trim()==="message")return E(Z,q);if(Y.trim().includes("errors.first")||Y.trim().includes("$errors.first")){if(typeof q.errors?.first==="function")return q.errors.first(Z);return E(Z,q)}let G=Y.trim();if(M(G)){let _=g(G,q);return _!==void 0?String(_):G}return G}catch{return Y}});return""}catch($){return console.error("Error processing @error directive:",$),U}})}function O(j,q){if(!q.errors)return!1;if(typeof q.errors.has==="function")return q.errors.has(j);if(typeof q.errors==="object")return Object.prototype.hasOwnProperty.call(q.errors,j);return!1}function E(j,q){if(!q.errors)return"";if(typeof q.errors.get==="function")return q.errors.get(j);if(typeof q.errors==="object"&&Object.prototype.hasOwnProperty.call(q.errors,j)){let K=q.errors[j];return Array.isArray(K)?K[0]:String(K)}return""}function H(j,q){let K;if(q.old&&typeof q.old==="function")return q.old(j);if(q.old&&typeof q.old==="object")return q.old[j];if(j.endsWith("[]")){let U=j.slice(0,-2);if(K=q[U],K!==void 0)return K}return q[j]}function k(j){if(!j.trim())return"";let q=[],K=j.trim(),U=/([\w-]+)\s*:\s*(['"]?)([^,'"]*)\2(?:\s*,\s*|\s*$)/g,Z;while((Z=U.exec(K))!==null){let[,X,,$]=Z;q.push(`${X}="${$.trim()}"`)}return q.join(" ")}var C={required:(j,q,K)=>{if(j===void 0||j===null||j===""||Array.isArray(j)&&j.length===0)return`The ${K} field is required.`;return null},email:(j,q,K)=>{if(!j)return null;if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(j)))return`The ${K} field must be a valid email address.`;return null},min:(j,q,K)=>{if(!j)return null;let U=Number(q[0]);if(typeof j==="string"&&j.length<U)return`The ${K} field must be at least ${U} characters.`;if(typeof j==="number"&&j<U)return`The ${K} field must be at least ${U}.`;if(Array.isArray(j)&&j.length<U)return`The ${K} field must have at least ${U} items.`;return null},max:(j,q,K)=>{if(!j)return null;let U=Number(q[0]);if(typeof j==="string"&&j.length>U)return`The ${K} field must not exceed ${U} characters.`;if(typeof j==="number"&&j>U)return`The ${K} field must not exceed ${U}.`;if(Array.isArray(j)&&j.length>U)return`The ${K} field must not have more than ${U} items.`;return null},confirmed:(j,q,K)=>{if(q[0]!==void 0&&j!==q[0])return`The ${K} confirmation does not match.`;return null},numeric:(j,q,K)=>{if(!j)return null;if(Number.isNaN(Number(j)))return`The ${K} field must be a number.`;return null},integer:(j,q,K)=>{if(!j)return null;if(!Number.isInteger(Number(j)))return`The ${K} field must be an integer.`;return null},alpha:(j,q,K)=>{if(!j)return null;if(!/^[a-z]+$/i.test(String(j)))return`The ${K} field must only contain letters.`;return null},alphanumeric:(j,q,K)=>{if(!j)return null;if(!/^[a-z0-9]+$/i.test(String(j)))return`The ${K} field must only contain letters and numbers.`;return null},url:(j,q,K)=>{if(!j)return null;try{return new URL(String(j))?null:null}catch{return`The ${K} field must be a valid URL.`}},regex:(j,q,K)=>{if(!j)return null;try{if(!new RegExp(q[0]).test(String(j)))return`The ${K} field format is invalid.`;return null}catch{return`The ${K} field has an invalid validation pattern.`}},in:(j,q,K)=>{if(!j)return null;if(!q.includes(String(j)))return`The ${K} field must be one of: ${q.join(", ")}.`;return null},notIn:(j,q,K)=>{if(!j)return null;if(q.includes(String(j)))return`The ${K} field must not be: ${q.join(", ")}.`;return null},date:(j,q,K)=>{if(!j)return null;let U=new Date(j);if(Number.isNaN(U.getTime()))return`The ${K} field must be a valid date.`;return null},before:(j,q,K)=>{if(!j)return null;let U=new Date(j),Z=new Date(q[0]);if(U>=Z)return`The ${K} field must be before ${q[0]}.`;return null},after:(j,q,K)=>{if(!j)return null;let U=new Date(j),Z=new Date(q[0]);if(U<=Z)return`The ${K} field must be after ${q[0]}.`;return null}};function i(j,q){C[j]=q}function S(j){let[q,...K]=j.split(":"),U=K.length>0?K.join(":").split(","):[];return{name:q.trim(),params:U}}function p(j,q,K,U={}){let Z=[],X=K.split("|").map(($)=>$.trim()).filter(Boolean);for(let $ of X){let Y=S($),G=C[Y.name];if(!G){console.warn(`Unknown validation rule: ${Y.name}`);continue}if(Y.name==="confirmed"){let w=`${j}_confirmation`;Y.params=[U[w]]}let _=G(q,Y.params||[],j);if(_)Z.push(Y.message||_)}return{field:j,valid:Z.length===0,errors:Z}}function o(j,q){let K={};for(let[U,Z]of Object.entries(q)){let X=p(U,j[U],Z,j);if(!X.valid)K[U]=X.errors}return K}function d(j,q){return j.replace(/@validate\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]*)\})?\s*\)/g,(K,U,Z,X)=>{let $=Z.split("|").map((G)=>G.trim()),Y=[];for(let G of $){let _=S(G);switch(_.name){case"required":Y.push("required");break;case"email":Y.push('type="email"');break;case"url":Y.push('type="url"');break;case"numeric":case"integer":if(Y.push('type="number"'),_.name==="integer")Y.push('step="1"');break;case"min":if(_.params?.[0])Y.push(`minlength="${_.params[0]}"`);break;case"max":if(_.params?.[0])Y.push(`maxlength="${_.params[0]}"`);break;case"regex":if(_.params?.[0])Y.push(`pattern="${_.params[0]}"`);break}}return`<!-- @validate:${U}:${Z} -->${Y.length>0?`<!-- attrs:${Y.join(" ")} -->`:""}`})}var A={required:{name:"required",validate:(j)=>{if(j===null||j===void 0||j==="")return"This field is required";if(Array.isArray(j)&&j.length===0)return"This field is required";return!0},toHtml5:()=>["required"],message:"This field is required"},email:{name:"email",validate:(j)=>{if(!j)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(j))||"Please enter a valid email address"},toHtml5:()=>['type="email"'],message:"Please enter a valid email address"},url:{name:"url",validate:(j)=>{if(!j)return!0;try{return new URL(String(j)).protocol.startsWith("http")||"Please enter a valid URL"}catch{return"Please enter a valid URL"}},toHtml5:()=>['type="url"'],message:"Please enter a valid URL"},numeric:{name:"numeric",validate:(j)=>{if(!j)return!0;return!Number.isNaN(Number(j))||"Please enter a number"},toHtml5:()=>['type="number"'],message:"Please enter a number"},integer:{name:"integer",validate:(j)=>{if(!j)return!0;let q=Number(j);return Number.isInteger(q)||"Please enter a whole number"},toHtml5:()=>['type="number"','step="1"'],message:"Please enter a whole number"},alpha:{name:"alpha",validate:(j)=>{if(!j)return!0;return/^[a-z]+$/i.test(String(j))||"Please enter only letters"},toHtml5:()=>['pattern="[a-zA-Z]+"'],message:"Please enter only letters"},alphanumeric:{name:"alphanumeric",validate:(j)=>{if(!j)return!0;return/^[a-z0-9]+$/i.test(String(j))||"Please enter only letters and numbers"},toHtml5:()=>['pattern="[a-zA-Z0-9]+"'],message:"Please enter only letters and numbers"},min:{name:"min",validate:(j,q)=>{if(!j)return!0;let K=Number(q[0]);if(typeof j==="string")return j.length>=K||`Must be at least ${K} characters`;if(typeof j==="number")return j>=K||`Must be at least ${K}`;if(Array.isArray(j))return j.length>=K||`Must have at least ${K} items`;return!0},toHtml5:(j)=>[`minlength="${j[0]}"`,`min="${j[0]}"`],message:"Must be at least {{param}} characters"},max:{name:"max",validate:(j,q)=>{if(!j)return!0;let K=Number(q[0]);if(typeof j==="string")return j.length<=K||`Must be no more than ${K} characters`;if(typeof j==="number")return j<=K||`Must be no more than ${K}`;if(Array.isArray(j))return j.length<=K||`Must have no more than ${K} items`;return!0},toHtml5:(j)=>[`maxlength="${j[0]}"`,`max="${j[0]}"`],message:"Must be no more than {{param}} characters"},between:{name:"between",validate:(j,q)=>{if(!j)return!0;let[K,U]=q.map(Number);if(typeof j==="string")return j.length>=K&&j.length<=U||`Must be between ${K} and ${U} characters`;if(typeof j==="number")return j>=K&&j<=U||`Must be between ${K} and ${U}`;return!0},toHtml5:(j)=>[`minlength="${j[0]}"`,`maxlength="${j[1]}"`],message:"Must be between {{min}} and {{max}}"},confirmed:{name:"confirmed",validate:(j,q,K)=>{let U=Object.keys(K);for(let Z of U)if(Z.endsWith("_confirmation")&&K[Z]===j)return!0;return"Confirmation does not match"},message:"Confirmation does not match"},in:{name:"in",validate:(j,q)=>{if(!j)return!0;return q.includes(String(j))||`Must be one of: ${q.join(", ")}`},message:"Must be one of: {{values}}"},notIn:{name:"notIn",validate:(j,q)=>{if(!j)return!0;return!q.includes(String(j))||`Must not be: ${q.join(", ")}`},message:"Must not be: {{values}}"},regex:{name:"regex",validate:(j,q)=>{if(!j)return!0;try{return new RegExp(q[0]).test(String(j))||"Invalid format"}catch{return"Invalid format"}},toHtml5:(j)=>[`pattern="${j[0]}"`],message:"Invalid format"},date:{name:"date",validate:(j)=>{if(!j)return!0;let q=new Date(String(j));return!Number.isNaN(q.getTime())||"Please enter a valid date"},toHtml5:()=>['type="date"'],message:"Please enter a valid date"},before:{name:"before",validate:(j,q)=>{if(!j)return!0;let K=new Date(String(j)),U=new Date(q[0]);return K<U||`Must be before ${q[0]}`},toHtml5:(j)=>[`max="${j[0]}"`],message:"Must be before {{date}}"},after:{name:"after",validate:(j,q)=>{if(!j)return!0;let K=new Date(String(j)),U=new Date(q[0]);return K>U||`Must be after ${q[0]}`},toHtml5:(j)=>[`min="${j[0]}"`],message:"Must be after {{date}}"},size:{name:"size",validate:(j,q)=>{if(!j)return!0;let K=Number(q[0]);if(typeof j==="string")return j.length===K||`Must be exactly ${K} characters`;if(Array.isArray(j))return j.length===K||`Must have exactly ${K} items`;return!0},message:"Must be exactly {{size}}"},phone:{name:"phone",validate:(j)=>{if(!j)return!0;return/^\+?\(?\d{1,4}\)?[-\s./\d]*$/.test(String(j))||"Please enter a valid phone number"},toHtml5:()=>['type="tel"','pattern="\\+?\\(?\\d{1,4}\\)?[-\\s./\\d]*"'],message:"Please enter a valid phone number"}};function u(j){A[j.name]=j}function m(j,q,K={}){let U=[],Z=q.split("|").map((X)=>X.trim());for(let X of Z){let $=S(X),Y=A[$.name];if(!Y){console.warn(`Unknown validation rule: ${$.name}`);continue}let G=Y.validate(j,$.params||[],K);if(G!==!0)U.push(G)}return{valid:U.length===0,errors:U}}function r(j,q){let K={},U=!0;for(let[Z,X]of Object.entries(q)){let $=m(j[Z],X,j);if(!$.valid)U=!1,K[Z]=$.errors}return{valid:U,errors:K}}function s(j,q){let K=JSON.stringify(q);return`
|
|
5
|
-
<script>
|
|
6
|
-
(function() {
|
|
7
|
-
const form = document.getElementById('${j}');
|
|
8
|
-
if (!form) return;
|
|
9
|
-
|
|
10
|
-
const rules = ${K};
|
|
11
|
-
const validators = {
|
|
12
|
-
required: (v) => v !== null && v !== undefined && v !== '' ? true : 'This field is required',
|
|
13
|
-
email: (v) => !v || /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(v) ? true : 'Please enter a valid email',
|
|
14
|
-
url: (v) => { if (!v) return true; try { new URL(v); return true; }
|
|
15
|
-
catch { return 'Please enter a valid URL'; } },
|
|
16
|
-
numeric: (v) => !v || !isNaN(Number(v)) ? true : 'Please enter a number',
|
|
17
|
-
integer: (v) => !v || Number.isInteger(Number(v)) ? true : 'Please enter a whole number',
|
|
18
|
-
min: (v, p) => !v || (typeof v === 'string' ? v.length >= p : v >= p) ? true : 'Too short/small',
|
|
19
|
-
max: (v, p) => !v || (typeof v === 'string' ? v.length <= p : v <= p) ? true : 'Too long/large',
|
|
20
|
-
regex: (v, p) => !v || new RegExp(p).test(v) ? true : 'Invalid format',
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
form.addEventListener('submit', function(e) {
|
|
24
|
-
let valid = true;
|
|
25
|
-
const errors = {};
|
|
26
|
-
|
|
27
|
-
for (const [field, fieldRules] of Object.entries(rules)) {
|
|
28
|
-
const input = form.querySelector('[name="' + field + '"]');
|
|
29
|
-
if (!input) continue;
|
|
30
|
-
|
|
31
|
-
const value = input.value;
|
|
32
|
-
const ruleList = fieldRules.split('|');
|
|
33
|
-
|
|
34
|
-
for (const rule of ruleList) {
|
|
35
|
-
const [name, param] = rule.split(':');
|
|
36
|
-
const validator = validators[name];
|
|
37
|
-
if (validator) {
|
|
38
|
-
const result = validator(value, param);
|
|
39
|
-
if (result !== true) {
|
|
40
|
-
valid = false;
|
|
41
|
-
errors[field] = errors[field] || [];
|
|
42
|
-
errors[field].push(result);
|
|
43
|
-
input.classList.add('is-invalid');
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (!valid) {
|
|
51
|
-
e.preventDefault();
|
|
52
|
-
console.log('Validation errors:', errors);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
})();
|
|
56
|
-
</script>`.trim()}
|
|
57
|
-
export{W as Ov,v as Pv,Q as Qv,f as Rv,x as Sv,i as Tv,p as Uv,o as Vv,d as Wv,A as Xv,u as Yv,m as Zv,r as _v,s as $v};
|
package/dist/chunk-0wdar532.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var B={duration:300,easing:"ease-out",removePlaceholder:!1,loadedClass:"stx-img-loaded",loadingClass:"stx-img-loading"};function G(k,z={}){let j={...B,...z},J=k.closest(".stx-img-placeholder");if(!J){S(k,j);return}if(J.style.setProperty("--stx-img-transition-duration",`${j.duration}ms`),J.style.setProperty("--stx-img-transition-easing",j.easing),j.loadingClass)J.classList.add(j.loadingClass);if(k.complete&&k.naturalWidth>0)O(k,J,j);else k.addEventListener("load",()=>O(k,J,j),{once:!0}),k.addEventListener("error",()=>T(k,J,j),{once:!0})}function S(k,z){let j=()=>{k.style.transition=`opacity ${z.duration}ms ${z.easing}`,k.style.opacity="1",k.classList.remove(z.loadingClass),k.classList.add(z.loadedClass)};if(k.complete&&k.naturalWidth>0)j();else k.style.opacity="0",k.classList.add(z.loadingClass),k.addEventListener("load",j,{once:!0})}function O(k,z,j){if(j.loadingClass)z.classList.remove(j.loadingClass);if(j.loadedClass)z.classList.add(j.loadedClass);if(k.style.opacity="1",j.removePlaceholder)setTimeout(()=>{z.style.backgroundImage="none"},j.duration)}function T(k,z,j){if(j.loadingClass)z.classList.remove(j.loadingClass);z.classList.add("stx-img-error"),k.classList.add("stx-img-error")}function u(k,z){let j=R(k),J=z.getContext("2d");if(!J)return;z.width=j.w,z.height=j.h;let K=J.createImageData(j.w,j.h);K.data.set(j.rgba),J.putImageData(K,0,0)}function R(k){let z=k[0]|k[1]<<8|k[2]<<16,j=(z&63)/63,J=(z>>6&63)/31.5-1,K=(z>>12&63)/31.5-1,Z=(z>>18&31)/31,Q=z>>23!==0,Y=k[3]|k[4]<<8,D=(Y>>3&63)/63,I=(Y>>9&63)/63,$=Y>>15!==0,_=Math.max(3,$?Q?5:7:Q?5:5),A=Math.max(3,$?Q?5:5:Q?5:7),L=32,f=32,M=new Uint8ClampedArray(4096);for(let V=0;V<32;V++)for(let W=0;W<32;W++){let X=(V*32+W)*4,C=W/31,F=V/31,N=j+(C-0.5)*Z*0.5+(F-0.5)*Z*0.5,U=J*(1-C*0.3),P=K*(1-F*0.3),E=N-0.6666666666666666*U,H=(3*N-E+P)/2,q=H-P;M[X]=Math.max(0,Math.min(255,Math.round(H*255))),M[X+1]=Math.max(0,Math.min(255,Math.round(q*255))),M[X+2]=Math.max(0,Math.min(255,Math.round(E*255))),M[X+3]=255}return{w:32,h:32,rgba:M}}function y(k){let z=R(k),j=document.createElement("canvas");j.width=z.w,j.height=z.h;let J=j.getContext("2d");if(!J)return"";let K=J.createImageData(z.w,z.h);return K.data.set(z.rgba),J.putImageData(K,0,0),j.toDataURL("image/png")}function v(k){let z=atob(k),j=new Uint8Array(z.length);for(let J=0;J<z.length;J++)j[J]=z.charCodeAt(J);return j}function x(k,z,j=300){return new Promise((J)=>{k.style.transition=`opacity ${j}ms ease-out`,z.style.transition=`opacity ${j}ms ease-out`,z.style.opacity="0",z.offsetWidth,k.style.opacity="0",z.style.opacity="1",setTimeout(J,j)})}function w(k={}){document.querySelectorAll("[data-stx-blur-up], .stx-img-placeholder img").forEach((j)=>{G(j,k)})}function l(){return`
|
|
3
|
-
(function() {
|
|
4
|
-
'use strict';
|
|
5
|
-
|
|
6
|
-
if (typeof window === 'undefined') return;
|
|
7
|
-
|
|
8
|
-
var defaultOptions = {
|
|
9
|
-
duration: 300,
|
|
10
|
-
easing: 'ease-out',
|
|
11
|
-
loadedClass: 'stx-img-loaded'
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
function initBlurUp(img, options) {
|
|
15
|
-
options = Object.assign({}, defaultOptions, options);
|
|
16
|
-
var wrapper = img.closest('.stx-img-placeholder');
|
|
17
|
-
|
|
18
|
-
if (!wrapper) {
|
|
19
|
-
if (img.complete && img.naturalWidth > 0) {
|
|
20
|
-
img.style.opacity = '1';
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
img.style.opacity = '0';
|
|
24
|
-
img.style.transition = 'opacity ' + options.duration + 'ms ' + options.easing;
|
|
25
|
-
img.onload = function() { img.style.opacity = '1'; };
|
|
26
|
-
}
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
wrapper.style.setProperty('--stx-img-transition-duration', options.duration + 'ms');
|
|
31
|
-
wrapper.style.setProperty('--stx-img-transition-easing', options.easing);
|
|
32
|
-
|
|
33
|
-
var onLoaded = function() {
|
|
34
|
-
wrapper.classList.add(options.loadedClass);
|
|
35
|
-
img.style.opacity = '1';
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
if (img.complete && img.naturalWidth > 0) {
|
|
39
|
-
onLoaded();
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
img.addEventListener('load', onLoaded, { once: true });
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function init() {
|
|
47
|
-
var elements = document.querySelectorAll('.stx-img-placeholder img, [data-stx-blur-up]');
|
|
48
|
-
elements.forEach(function(img) { initBlurUp(img); });
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Initialize when DOM is ready
|
|
52
|
-
if (document.readyState === 'loading') {
|
|
53
|
-
document.addEventListener('DOMContentLoaded', init);
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
init();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Expose for manual use
|
|
60
|
-
window.STX = window.STX || {};
|
|
61
|
-
window.STX.initBlurUp = initBlurUp;
|
|
62
|
-
window.STX.initAllBlurUp = init;
|
|
63
|
-
})();
|
|
64
|
-
`.trim()}function c(){return`
|
|
65
|
-
.stx-img-placeholder {
|
|
66
|
-
position: relative;
|
|
67
|
-
overflow: hidden;
|
|
68
|
-
background-size: cover;
|
|
69
|
-
background-position: center;
|
|
70
|
-
background-repeat: no-repeat;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.stx-img-placeholder img {
|
|
74
|
-
display: block;
|
|
75
|
-
width: 100%;
|
|
76
|
-
height: auto;
|
|
77
|
-
opacity: 0;
|
|
78
|
-
transition: opacity var(--stx-img-transition-duration, 300ms) var(--stx-img-transition-easing, ease-out);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.stx-img-placeholder.stx-img-loaded img {
|
|
82
|
-
opacity: 1;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.stx-img-blur {
|
|
86
|
-
filter: blur(20px);
|
|
87
|
-
transform: scale(1.1);
|
|
88
|
-
transition: filter var(--stx-img-transition-duration, 300ms) var(--stx-img-transition-easing, ease-out),
|
|
89
|
-
transform var(--stx-img-transition-duration, 300ms) var(--stx-img-transition-easing, ease-out);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.stx-img-loaded .stx-img-blur,
|
|
93
|
-
.stx-img-blur.stx-img-loaded {
|
|
94
|
-
filter: blur(0);
|
|
95
|
-
transform: scale(1);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.stx-img-error {
|
|
99
|
-
opacity: 0.5;
|
|
100
|
-
}
|
|
101
|
-
`.trim()}
|
|
102
|
-
export{G as bl,u as cl,R as dl,y as el,v as fl,x as gl,w as hl,l as il,c as jl};
|
package/dist/chunk-13yz561y.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{nt as H,ot as J}from"./chunk-nanw7yhz.js";function Y(B,z){if(!/<style\s+[^>]*\bscoped\b/i.test(B))return{html:B,hasScoped:!1};let D=H(z),v=`data-v-${D}`,q=B,E=/<style\s+([^>]*\bscoped\b[^>]*)>([\s\S]*?)<\/style>/gi,F=!1;if(q=q.replace(E,(V,K,L)=>{F=!0;let M=Q(L,v),G=K.replace(/\bscoped\b/gi,"").trim(),O=G?` ${G}`:"";return`<style data-stx-scoped="${D}"${O}>${M}</style>`}),!F)return{html:B,hasScoped:!1};return q=U(q,v),{html:q,hasScoped:!0}}function Q(B,z){return J(B,"__SCOPE_PLACEHOLDER__",{preserveHost:!1}).replace(/\.(__SCOPE_PLACEHOLDER__) /g,`[${z}] `).replace(/\.(__SCOPE_PLACEHOLDER__)/g,`[${z}]`)}function U(B,z){let D=new Set(["script","style","template","html","head","body","meta","link","title","base","!doctype","!DOCTYPE"]);return B.replace(/<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*)?\/?>/g,(v,q,E)=>{if(D.has(q.toLowerCase()))return v;if(v.includes(z))return v;if(q.toLowerCase()==="style"||q.toLowerCase()==="script")return v;if(E)return v.replace(`<${q}${E}`,`<${q} ${z}${E}`);if(v.endsWith("/>"))return`<${q} ${z} />`;return`<${q} ${z}>`})}
|
|
3
|
-
export{Y as mt};
|
package/dist/chunk-174z0cd0.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Mi as E}from"./chunk-qfwzdffx.js";import{_k as D}from"./chunk-cn409b69.js";import{Pq as N}from"./chunk-ncnfa8ae.js";import{rB as x}from"./chunk-3jm3snz8.js";import C from"fs";import J from"path";var{serve:v}=globalThis.Bun;var y={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function c(O={}){let Z=J.resolve(O.outputDir||".output"),k=O.port||3000,U=D(Z);if(!U)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${U.routes.length} routes...`);let V=new Map,Y=new Map,_=new Map;for(let w of U.routes)try{let K=J.join(Z,w.compiledPath),A=JSON.parse(await Bun.file(K).text());V.set(w.pattern,A),_.set(w.pattern,N(A.html));let W=J.join(Z,w.fragmentPath);if(await Bun.file(W).exists())Y.set(w.pattern,await Bun.file(W).text())}catch(K){console.warn(`[stx] Failed to load route ${w.pattern}:`,K)}let $=new Map,F=[];for(let w of U.routes)if(w.hasParams){let K=[],A=w.pattern.replace(/:([^/]+)/g,(W,G)=>{return K.push(G),"([^/]+)"});F.push({regex:new RegExp(`^${A}$`),route:w,paramNames:K})}else $.set(w.pattern,w);let S=v({port:k,async fetch(w){let A=new URL(w.url).pathname;if(O.onRequest){let j=await O.onRequest(w);if(j)return j}if(O.apiRoutes?.[A])return O.apiRoutes[A](w);if((w.method==="GET"||w.method==="HEAD")&&A!=="/"){let j=J.resolve(Z,"public"),z;try{z=decodeURIComponent(A)}catch{z=A}if(!z.includes("\x00")){let B=J.resolve(j,`.${z}`);if(B===j||B.startsWith(`${j}${J.sep}`))try{if(C.existsSync(B)&&C.statSync(B).isFile()){let H=J.extname(B).toLowerCase(),I=y[H]||"application/octet-stream",b=A.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(A);return new Response(Bun.file(B),{headers:{"Content-Type":I,"Cache-Control":b?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let W=w.headers.get("X-STX-Router")==="true",G=null,L={};if(G=$.get(A)||null,!G)for(let{regex:j,route:z,paramNames:B}of F){let X=A.match(j);if(X){G=z,B.forEach((H,I)=>{L[H]=X[I+1]});break}}if(!G){let j=$.get("/404")||null;if(j){let z=V.get(j.pattern);if(z)return new Response(z.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}if(W){let j=Y.get(G.pattern);if(j){let z=_.get(G.pattern);return new Response(j,{headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...z?{"X-STX-Layout":z.layout,"X-STX-Layout-Group":z.group}:{},"Cache-Control":"no-cache"}})}}let Q=V.get(G.pattern);if(!Q){let j=$.get("/500")||null;if(j){let z=V.get(j.pattern);if(z)return new Response(z.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(!Q.hasServerScripts&&Object.keys(Q.placeholders).length===0)return new Response(Q.html,{headers:{"Content-Type":"text/html","Cache-Control":"public, max-age=60"}});try{let{html:j,boundaries:z}=await E(Q,{params:L,request:w});if(z&&z.length>0){let{renderStreamingPage:B,streamToResponse:X}=await import("././streaming.js");return X(B(j,z,{timeoutMs:30000}),{headers:{"Cache-Control":"no-cache"}})}return new Response(j,{headers:{"Content-Type":"text/html","Cache-Control":"no-cache"}})}catch(j){return console.error(`[stx] Hydration error for ${A}:`,j),new Response(Q.html,{headers:{"Content-Type":"text/html"}})}}});return console.log(`[stx] Production server running at http://localhost:${k}`),console.log(`[stx] Serving ${U.routes.length} routes (${V.size} pre-loaded)`),{port:k,stop:()=>S.stop()}}
|
|
3
|
-
export{c as Ki};
|