@stacksjs/stx 0.2.95 → 0.2.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/a11y.js +598 -2
- package/dist/analytics.js +159 -2
- package/dist/analyzer.js +240 -2
- package/dist/animation.js +688 -2
- package/dist/app-shell.js +220 -2
- package/dist/app.js +79 -2
- package/dist/assets.js +155 -2
- package/dist/ast.js +630 -2
- package/dist/async-components.js +428 -2
- package/dist/auth.js +12 -2
- package/dist/broadcasting.js +102 -2
- package/dist/browser-composables.js +565 -2
- package/dist/build-assets.js +29 -2
- package/dist/build-mode-detector.js +50 -2
- package/dist/build-optimizer.js +433 -2
- package/dist/build-views.js +180 -2
- package/dist/build.js +33 -2
- package/dist/builtins/drawer.js +37 -2
- package/dist/builtins/escape.js +3 -2
- package/dist/builtins/icon.js +83 -2
- package/dist/builtins/index.js +34 -2
- package/dist/builtins/modal.js +38 -2
- package/dist/builtins/safe-image.js +51 -2
- package/dist/builtins/stx-image.js +200 -2
- package/dist/builtins/stx-link.js +41 -2
- package/dist/builtins/stx-loading-indicator.js +35 -2
- package/dist/builtins/suspense.js +24 -2
- package/dist/builtins/toast.js +42 -2
- package/dist/builtins/tooltip.js +106 -2
- package/dist/builtins/transition-group.js +22 -2
- package/dist/bundle-analyzer/collector.js +233 -2
- package/dist/bundle-analyzer/index.js +82 -2
- package/dist/bundle-analyzer/report.js +318 -2
- package/dist/bundle-analyzer/treemap.js +594 -2
- package/dist/caching.js +131 -2
- package/dist/cli.js +11317 -10982
- package/dist/client/directive.js +14 -2
- package/dist/client/index.js +2 -2
- package/dist/client-helpers.js +312 -2
- package/dist/client-script-bundler.js +216 -6
- package/dist/client-script.js +754 -2
- package/dist/client.js +73 -4
- package/dist/component-hmr.js +585 -2
- package/dist/component-library.d.ts +6 -0
- package/dist/component-library.js +683 -0
- package/dist/component-processing.js +613 -2
- package/dist/component-registry.js +90 -2
- package/dist/component-renderer.js +660 -2
- package/dist/components.js +213 -2
- package/dist/composables/index.js +220 -2
- package/dist/composables/use-battery.js +101 -2
- package/dist/composables/use-broadcast-channel.js +80 -2
- package/dist/composables/use-channel.js +124 -2
- package/dist/composables/use-clipboard.js +79 -2
- package/dist/composables/use-color-mode.js +131 -2
- package/dist/composables/use-cookie.js +86 -2
- package/dist/composables/use-device-orientation.js +181 -2
- package/dist/composables/use-event-listener.js +27 -2
- package/dist/composables/use-event-source.js +166 -2
- package/dist/composables/use-eye-dropper.js +142 -2
- package/dist/composables/use-fetch.js +223 -2
- package/dist/composables/use-fullscreen.js +110 -2
- package/dist/composables/use-geolocation.js +101 -2
- package/dist/composables/use-idle.js +182 -2
- package/dist/composables/use-intersection-observer.js +168 -2
- package/dist/composables/use-keyboard.js +224 -2
- package/dist/composables/use-media-query.js +62 -2
- package/dist/composables/use-meta.js +48 -2
- package/dist/composables/use-mouse.js +286 -2
- package/dist/composables/use-mutation-observer.js +129 -2
- package/dist/composables/use-network.js +85 -2
- package/dist/composables/use-notification.js +94 -2
- package/dist/composables/use-permissions.js +132 -2
- package/dist/composables/use-query.js +0 -1
- package/dist/composables/use-resize-observer.js +157 -2
- package/dist/composables/use-router.js +51 -2
- package/dist/composables/use-share.js +104 -2
- package/dist/composables/use-speech.js +294 -2
- package/dist/composables/use-storage.js +130 -2
- package/dist/composables/use-text-selection.js +205 -4
- package/dist/composables/use-timer.js +183 -2
- package/dist/composables/use-utilities.js +176 -2
- package/dist/composables/use-wake-lock.js +122 -2
- package/dist/composables/use-websocket.js +165 -2
- package/dist/composables/use-window.js +163 -2
- package/dist/composables.js +552 -2
- package/dist/composition-api.js +190 -2
- package/dist/computed.js +376 -8
- package/dist/conditionals.js +599 -2
- package/dist/config.js +751 -2
- package/dist/craft-bridge.js +432 -2
- package/dist/craft-compiler.js +810 -2
- package/dist/craft-components.js +945 -2
- package/dist/craft-entry.js +5 -2
- package/dist/craft-ssr.js +559 -2
- package/dist/csp.js +220 -2
- package/dist/csrf.js +38 -2
- package/dist/custom-directives.js +136 -2
- package/dist/defer.js +156 -2
- package/dist/deploy/config-generators.js +214 -2
- package/dist/deploy/index.js +203 -2
- package/dist/deploy/netlify.js +167 -2
- package/dist/dev-server/crosswind.js +379 -2
- package/dist/dev-server/index.js +7 -2
- package/dist/dev-server/keyboard-shortcuts.js +81 -2
- package/dist/dev-server/native-window.js +91 -2
- package/dist/dev-server/port-utils.js +40 -2
- package/dist/dev-server/serve-app.js +682 -2
- package/dist/dev-server/serve-file.js +439 -2
- package/dist/dev-server/serve-markdown.js +281 -2
- package/dist/dev-server/serve-multi.js +579 -2
- package/dist/dev-server/terminal-colors.js +45 -2
- package/dist/dev-server/theme-selector.js +111 -2
- package/dist/dev-server/types.js +43 -2
- package/dist/dev-server.js +4 -2
- package/dist/devtools.js +462 -18
- package/dist/directive-api.js +355 -2
- package/dist/docs.js +567 -2
- package/dist/doctor.js +123 -2
- package/dist/document-shell.js +105 -2
- package/dist/dynamic-components.js +78 -2
- package/dist/edge-runtime.js +539 -2
- package/dist/env.js +9 -2
- package/dist/error-boundaries.js +62 -12
- package/dist/error-handling.js +1 -2
- package/dist/errors/codes.js +97 -2
- package/dist/errors/formatter.js +196 -2
- package/dist/errors/index.js +44 -2
- package/dist/errors/logger.js +250 -2
- package/dist/errors/sanitizer.js +181 -2
- package/dist/errors/types.js +86 -2
- package/dist/events.js +382 -2
- package/dist/expressions.js +650 -2
- package/dist/formatter.js +265 -2
- package/dist/forms-validation.js +510 -4
- package/dist/forms.js +709 -2
- package/dist/head.js +224 -2
- package/dist/heatmap.js +566 -2
- package/dist/hot-reload.js +367 -2
- package/dist/html-masking.js +73 -2
- package/dist/hydration-runtime.js +195 -2
- package/dist/hydration.js +654 -2
- package/dist/i18n.js +633 -2
- package/dist/image-optimization/auto-sibling.js +88 -2
- package/dist/image-optimization/build-plugin.js +241 -2
- package/dist/image-optimization/component.js +244 -2
- package/dist/image-optimization/directive.js +203 -2
- package/dist/image-optimization/index.js +54 -2
- package/dist/image-optimization/processor.js +262 -2
- package/dist/image-optimization/serve.js +102 -2
- package/dist/includes.js +733 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +134 -2
- package/dist/init.js +505 -2
- package/dist/inline-assets.js +82 -2
- package/dist/interactive.js +383 -2
- package/dist/internal-markdown.js +141 -2
- package/dist/island-chunking.js +52 -2
- package/dist/js-ts.js +57 -2
- package/dist/jsx-runtime.js +289 -2
- package/dist/keep-alive.js +421 -2
- package/dist/lazy-loader.js +245 -2
- package/dist/loading-indicator.js +322 -2
- package/dist/loops.js +643 -2
- package/dist/manifest.js +31 -2
- package/dist/markdown.js +68 -2
- package/dist/media/client/blur-up.js +217 -2
- package/dist/media/client/index.js +53 -2
- package/dist/media/client/lazy-load.js +283 -2
- package/dist/media/client/upload-handler.js +354 -2
- package/dist/media/image/component.js +574 -2
- package/dist/media/image/directive.js +160 -2
- package/dist/media/image/editing.js +193 -2
- package/dist/media/image/index.js +80 -2
- package/dist/media/image/placeholder.js +188 -2
- package/dist/media/image/processor/cache.js +51 -2
- package/dist/media/image/processor/index.js +3 -2
- package/dist/media/image/processor/optimizer.js +202 -2
- package/dist/media/image/processor/responsive.js +162 -2
- package/dist/media/image/srcset.js +194 -2
- package/dist/media/index.js +198 -2
- package/dist/media/manager/embed.js +253 -2
- package/dist/media/protected/component.js +235 -2
- package/dist/media/protected/index.js +20 -2
- package/dist/media/protected/signature.js +205 -2
- package/dist/media/shared/cache.js +132 -2
- package/dist/media/shared/hash.js +35 -2
- package/dist/media/shared/index.js +2 -2
- package/dist/media/types.js +0 -1
- package/dist/media/upload/component.js +320 -2
- package/dist/media/upload/index.js +1 -2
- package/dist/media/video/directive.js +142 -2
- package/dist/media/video/index.js +583 -2
- package/dist/media/video/processor/cache.js +52 -2
- package/dist/media/video/processor/index.js +4 -2
- package/dist/media/video/processor/streaming.js +197 -2
- package/dist/media/video/processor/thumbnail.js +134 -2
- package/dist/media/video/processor/transcoder.js +283 -2
- package/dist/method-spoofing.js +17 -2
- package/dist/middleware.js +40 -2
- package/dist/misc-directives.js +222 -2
- package/dist/native-build.js +511 -2
- package/dist/parser/directive-parser.js +239 -2
- package/dist/parser/expression-parser.js +358 -2
- package/dist/parser/index.js +23 -2
- package/dist/parser/tokenizer.js +534 -2
- package/dist/partial-hydration.js +427 -2
- package/dist/performance-utils.js +430 -2
- package/dist/placeholder.js +35 -2
- package/dist/plugin-system.js +214 -2
- package/dist/plugin.js +173 -2
- package/dist/precompiler.js +660 -81
- package/dist/process.js +711 -2
- package/dist/production-build.js +596 -2
- package/dist/production-builder.js +132 -2
- package/dist/production-server.js +188 -2
- package/dist/props.js +224 -2
- package/dist/public-env.js +19 -2
- package/dist/pwa/audit.js +255 -2
- package/dist/pwa/directives.js +332 -2
- package/dist/pwa/icons.js +109 -2
- package/dist/pwa/index.js +47 -2
- package/dist/pwa/inject.js +102 -2
- package/dist/pwa/manifest.js +186 -2
- package/dist/pwa/offline.js +259 -2
- package/dist/pwa/precache.js +116 -2
- package/dist/pwa/service-worker.js +860 -2
- package/dist/pwa/workbox-strategies.js +167 -2
- package/dist/pwa/workbox.js +382 -2
- package/dist/pwa.js +427 -427
- package/dist/reactive-bindings.js +266 -2
- package/dist/reactive.js +569 -2
- package/dist/reactivity.js +559 -2
- package/dist/release.js +1 -2
- package/dist/render.js +165 -2
- package/dist/route-middleware.js +17 -2
- package/dist/router.js +9 -2
- package/dist/routes.js +14 -2
- package/dist/runtime-injection.js +120 -2
- package/dist/runtime.js +94 -2
- package/dist/safe-evaluator.js +444 -2
- package/dist/scaffolding.js +897 -2
- package/dist/screenshot.js +87 -2
- package/dist/script-classifier.js +32 -2
- package/dist/script-validation.js +158 -2
- package/dist/seo.js +457 -2
- package/dist/serve.js +237 -2
- package/dist/server-bindings.js +108 -2
- package/dist/server-components.js +338 -11
- package/dist/signal-processing.js +946 -2
- package/dist/signals-api.js +154 -2
- package/dist/signals.js +5287 -2
- package/dist/site-builder/build.js +224 -2
- package/dist/site-builder/i18n.js +140 -2
- package/dist/site-builder/index.js +15 -2
- package/dist/site-builder/robots.js +26 -2
- package/dist/site-builder/router.js +27 -2
- package/dist/site-builder/seo.js +36 -2
- package/dist/site-builder/sitemap.js +26 -2
- package/dist/site-builder/theme.js +33 -2
- package/dist/site-builder/types.js +0 -1
- package/dist/slots.js +201 -2
- package/dist/source-maps.js +350 -2
- package/dist/spa-shell.js +34 -2
- package/dist/ssg.js +389 -389
- package/dist/ssr.js +355 -2
- package/dist/state-management.js +533 -2
- package/dist/store-imports.js +13 -2
- package/dist/store-loader.js +72 -5
- package/dist/stores-client.js +132 -2
- package/dist/story/addons.js +261 -2
- package/dist/story/analytics.js +235 -2
- package/dist/story/auto-stories.js +158 -2
- package/dist/story/bookmarks.js +277 -2
- package/dist/story/bun-test.js +102 -2
- package/dist/story/cli.js +155 -2
- package/dist/story/collect/analyzer.js +305 -2
- package/dist/story/collect/index.js +27 -2
- package/dist/story/collect/parser.js +129 -2
- package/dist/story/collect/scanner.js +101 -2
- package/dist/story/collect/tree.js +110 -2
- package/dist/story/commands/build.js +172 -2
- package/dist/story/commands/dev.js +78 -2
- package/dist/story/commands/index.js +3 -2
- package/dist/story/commands/preview.js +56 -2
- package/dist/story/compiled-output.js +151 -2
- package/dist/story/composition.js +261 -2
- package/dist/story/config-watcher.js +67 -2
- package/dist/story/config.js +64 -2
- package/dist/story/context.js +27 -2
- package/dist/story/controls/index.js +320 -2
- package/dist/story/crosswind.js +189 -2
- package/dist/story/desktop-preview.js +105 -2
- package/dist/story/docs-generator.js +186 -2
- package/dist/story/errors.js +239 -2
- package/dist/story/figma-export.js +224 -2
- package/dist/story/generator.js +165 -2
- package/dist/story/hmr.js +131 -2
- package/dist/story/hot-swap.js +207 -2
- package/dist/story/index.js +49 -2
- package/dist/story/interactions.js +225 -2
- package/dist/story/keyboard-shortcuts.js +345 -2
- package/dist/story/output.js +153 -2
- package/dist/story/performance.js +252 -2
- package/dist/story/presets.js +289 -2
- package/dist/story/props-validation.js +215 -2
- package/dist/story/renderer.js +209 -2
- package/dist/story/search-index.js +106 -2
- package/dist/story/search.js +140 -2
- package/dist/story/server.js +965 -2
- package/dist/story/setup.js +78 -2
- package/dist/story/snapshots.js +170 -2
- package/dist/story/testing.js +163 -2
- package/dist/story/theme.js +170 -2
- package/dist/story/types.js +0 -2
- package/dist/story/ui/code-panel.js +175 -2
- package/dist/story/ui/controls-panel.js +168 -2
- package/dist/story/ui/index.js +4 -2
- package/dist/story/ui/navigation.js +250 -2
- package/dist/story/ui/preview.js +251 -2
- package/dist/story/visual-testing.js +247 -2
- package/dist/streaming.js +537 -2
- package/dist/strict-lint.js +288 -2
- package/dist/style-scoping.js +50 -2
- package/dist/suspense.js +398 -2
- package/dist/teleport.js +109 -2
- package/dist/template-compiler.js +63 -2
- package/dist/template-hydrator.js +82 -2
- package/dist/template-tag-balance.js +93 -2
- package/dist/testing.js +581 -2
- package/dist/transitions.js +443 -2
- package/dist/type-checker.js +581 -2
- package/dist/types/component-types.d.ts +54 -0
- package/dist/types/component-types.js +0 -1
- package/dist/types/config-types.js +0 -1
- package/dist/types/context-types.js +0 -1
- package/dist/types/csp-types.js +0 -1
- package/dist/types/directive-types.js +3 -2
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +1 -2
- package/dist/types/pwa-types.js +0 -1
- package/dist/types.js +1 -2
- package/dist/typescript-templates.js +386 -4
- package/dist/utils.js +942 -2
- package/dist/validator.js +171 -2
- package/dist/variable-extractor.js +1094 -2
- package/dist/view-composers.js +29 -2
- package/dist/virtual-scrolling.js +454 -2
- package/dist/visual-editor.js +688 -28
- package/dist/vue-template.js +475 -2
- package/dist/web-components/css-scoping.js +177 -2
- package/dist/web-components/index.js +13 -2
- package/dist/web-components/reactive-generator.js +121 -56
- package/dist/web-components.js +1447 -2
- package/dist/x-element.js +17 -5
- package/package.json +5 -6
- package/dist/chunk-04n64bnt.js +0 -5
- package/dist/chunk-06w68hyg.js +0 -7
- package/dist/chunk-07y6m5xx.js +0 -3
- package/dist/chunk-095s3972.js +0 -99
- package/dist/chunk-09k66d8a.js +0 -3
- package/dist/chunk-0a61y94n.js +0 -24
- package/dist/chunk-0b9w2w1y.js +0 -1
- package/dist/chunk-0dx4q6yq.js +0 -3
- package/dist/chunk-0dz85jrp.js +0 -3
- package/dist/chunk-0jd0pndq.js +0 -3
- package/dist/chunk-0p0nyq50.js +0 -6
- package/dist/chunk-0p1h3p3w.js +0 -3
- package/dist/chunk-0qakwen3.js +0 -1
- package/dist/chunk-0qnz93q2.js +0 -3
- package/dist/chunk-10debkj5.js +0 -71
- package/dist/chunk-15nesxgt.js +0 -5224
- package/dist/chunk-1sr54zp8.js +0 -3
- package/dist/chunk-1v49fwr5.js +0 -3
- package/dist/chunk-1xz0w746.js +0 -1539
- package/dist/chunk-1z5nhbjt.js +0 -90
- package/dist/chunk-1zgsgk4b.js +0 -1
- package/dist/chunk-20swzkx3.js +0 -216
- package/dist/chunk-27zsyhrd.js +0 -4
- package/dist/chunk-29y0hk5z.js +0 -3
- package/dist/chunk-2cdvw21b.js +0 -274
- package/dist/chunk-2j21d3ka.js +0 -161
- package/dist/chunk-2jxbwnkz.js +0 -2
- package/dist/chunk-31dr4bys.js +0 -6
- package/dist/chunk-35faj94w.js +0 -15
- package/dist/chunk-39gm08bn.js +0 -39
- package/dist/chunk-3a4qsygv.js +0 -51
- package/dist/chunk-3te20hqw.js +0 -3
- package/dist/chunk-43t7faps.js +0 -24
- package/dist/chunk-44hd3kab.js +0 -1
- package/dist/chunk-47kpewks.js +0 -71
- package/dist/chunk-4aj7ftqb.js +0 -1
- package/dist/chunk-4d2y57k7.js +0 -3
- package/dist/chunk-4deg33rw.js +0 -57
- package/dist/chunk-4k7d8p8d.js +0 -188
- package/dist/chunk-4qcy5tx6.js +0 -53
- package/dist/chunk-4x7kae4j.js +0 -3
- package/dist/chunk-55nwdnsd.js +0 -3
- package/dist/chunk-55yp0q8t.js +0 -201
- package/dist/chunk-5f43yz6z.js +0 -12
- package/dist/chunk-5shey2e4.js +0 -3
- package/dist/chunk-6b5k6w2q.js +0 -7
- package/dist/chunk-6djzdes9.js +0 -14
- package/dist/chunk-6e4c6g46.js +0 -3
- package/dist/chunk-6eqbxcrd.js +0 -8
- package/dist/chunk-7074g241.js +0 -3
- package/dist/chunk-7b6s3g65.js +0 -179
- package/dist/chunk-7cgmq685.js +0 -33
- package/dist/chunk-7dkz6z2s.js +0 -3
- package/dist/chunk-7ed3tean.js +0 -3
- package/dist/chunk-7gd339hd.js +0 -109
- package/dist/chunk-7j5e8sdj.js +0 -3
- package/dist/chunk-7n8g0nfn.js +0 -38
- package/dist/chunk-7sqdeqsw.js +0 -1
- package/dist/chunk-80g54ncj.js +0 -3
- package/dist/chunk-8a5bxece.js +0 -4
- package/dist/chunk-8ahwt6a4.js +0 -721
- package/dist/chunk-8b3z0zd5.js +0 -8
- package/dist/chunk-8dhdpa5h.js +0 -4
- package/dist/chunk-8n9nnqr6.js +0 -3
- package/dist/chunk-8qc1bsym.js +0 -3
- package/dist/chunk-8va64c9n.js +0 -3
- package/dist/chunk-8vtm0m84.js +0 -3
- package/dist/chunk-8xj7c3mf.js +0 -8
- package/dist/chunk-988dw6q3.js +0 -9
- package/dist/chunk-9b6cec0v.js +0 -321
- package/dist/chunk-9cf97f9p.js +0 -3
- package/dist/chunk-9ecv8aqj.js +0 -14
- package/dist/chunk-9eq3ht5f.js +0 -8
- package/dist/chunk-9jtj77jx.js +0 -3
- package/dist/chunk-9t14se2t.js +0 -83
- package/dist/chunk-9wmq2272.js +0 -3
- package/dist/chunk-9zbk5zx5.js +0 -57
- package/dist/chunk-a2g2qb2y.js +0 -386
- package/dist/chunk-a3hyn4we.js +0 -79
- package/dist/chunk-a87qqft6.js +0 -194
- package/dist/chunk-ah88wzbg.js +0 -10
- package/dist/chunk-akf1r75r.js +0 -102
- package/dist/chunk-amaa1bev.js +0 -2
- package/dist/chunk-avx8aydt.js +0 -3
- package/dist/chunk-ay9qf4zj.js +0 -6
- package/dist/chunk-aywxfqev.js +0 -3
- package/dist/chunk-azkegjd8.js +0 -61
- package/dist/chunk-b77wjyn7.js +0 -84
- package/dist/chunk-baf1hfwh.js +0 -231
- package/dist/chunk-bdk6g1vj.js +0 -3
- package/dist/chunk-bhqgmyqw.js +0 -36
- package/dist/chunk-bk3j0n82.js +0 -341
- package/dist/chunk-bndmdahk.js +0 -3
- package/dist/chunk-bpgg59wa.js +0 -3
- package/dist/chunk-bs3gmfxz.js +0 -5
- package/dist/chunk-bxc7kjsk.js +0 -32
- package/dist/chunk-c7jg8w13.js +0 -3
- package/dist/chunk-ckxjqqn9.js +0 -3
- package/dist/chunk-cn8az1b4.js +0 -1
- package/dist/chunk-d0zjtdw4.js +0 -29
- package/dist/chunk-d1qh1x2g.js +0 -3
- package/dist/chunk-djddhmcc.js +0 -60
- package/dist/chunk-dqn9gyhb.js +0 -21
- package/dist/chunk-drjq2zwg.js +0 -3
- package/dist/chunk-dvfs1h3c.js +0 -117
- package/dist/chunk-e2q9c5vq.js +0 -8
- package/dist/chunk-e98v1bc6.js +0 -12
- package/dist/chunk-ejayeex8.js +0 -2
- package/dist/chunk-ejh8fyak.js +0 -3
- package/dist/chunk-ek2w6zvy.js +0 -4
- package/dist/chunk-ewa88139.js +0 -6
- package/dist/chunk-fjk3x41y.js +0 -3
- package/dist/chunk-frg705zq.js +0 -302
- package/dist/chunk-fzm3y0r3.js +0 -267
- package/dist/chunk-g1vt329s.js +0 -21
- package/dist/chunk-g4ps1dj8.js +0 -140
- package/dist/chunk-gkzq8zw4.js +0 -23
- package/dist/chunk-gz5fmp3q.js +0 -3
- package/dist/chunk-h0hjy0kn.js +0 -292
- package/dist/chunk-h5jxydqq.js +0 -147
- package/dist/chunk-h5wa62ek.js +0 -145
- package/dist/chunk-h7aq56qj.js +0 -28
- package/dist/chunk-h82kjdr4.js +0 -83
- package/dist/chunk-hbehnm18.js +0 -3
- package/dist/chunk-hbgxbgam.js +0 -58
- package/dist/chunk-hc2mf5h6.js +0 -4
- package/dist/chunk-hjm2xab3.js +0 -3
- package/dist/chunk-hjv76kcw.js +0 -1
- package/dist/chunk-hrnnh4tq.js +0 -142
- package/dist/chunk-ht43ds42.js +0 -236
- package/dist/chunk-hxx3za24.js +0 -62
- package/dist/chunk-hy8820vc.js +0 -6
- package/dist/chunk-j447q024.js +0 -28
- package/dist/chunk-j58vh0w6.js +0 -314
- package/dist/chunk-j8tn8enq.js +0 -3
- package/dist/chunk-jc0fc4ht.js +0 -11
- package/dist/chunk-jcs0ymw7.js +0 -3
- package/dist/chunk-jjamhxpm.js +0 -139
- package/dist/chunk-jjb05d21.js +0 -3
- package/dist/chunk-jjdq01dv.js +0 -128
- package/dist/chunk-jnmgm2xw.js +0 -5
- package/dist/chunk-jpndqst5.js +0 -3
- package/dist/chunk-jt0ezawy.js +0 -351
- package/dist/chunk-jz73j3qs.js +0 -169
- package/dist/chunk-k21df0pg.js +0 -10
- package/dist/chunk-k848dzsa.js +0 -429
- package/dist/chunk-kdfe4t91.js +0 -3
- package/dist/chunk-keawsbpn.js +0 -5
- package/dist/chunk-kgym7ch9.js +0 -8
- package/dist/chunk-khdn7jwe.js +0 -3
- package/dist/chunk-km25cwz6.js +0 -3
- package/dist/chunk-knm8a8yx.js +0 -398
- package/dist/chunk-krqn0ddk.js +0 -3
- package/dist/chunk-ktkmvaa8.js +0 -1
- package/dist/chunk-kx6eb6ma.js +0 -4
- package/dist/chunk-kypas8vy.js +0 -4
- package/dist/chunk-m167kjhv.js +0 -4
- package/dist/chunk-m491r0rj.js +0 -358
- package/dist/chunk-m8448qby.js +0 -11
- package/dist/chunk-mgj88zeq.js +0 -64
- package/dist/chunk-mhgk632d.js +0 -3
- package/dist/chunk-mv4fb50w.js +0 -1
- package/dist/chunk-n5kg7fpx.js +0 -7
- package/dist/chunk-n98x35xd.js +0 -8
- package/dist/chunk-n9dhs1dw.js +0 -106
- package/dist/chunk-nd9rmddh.js +0 -6
- package/dist/chunk-ngxfwzq3.js +0 -3
- package/dist/chunk-nhv099jv.js +0 -19
- package/dist/chunk-nm15ccsg.js +0 -5
- package/dist/chunk-npfmdb6y.js +0 -71
- package/dist/chunk-nvwb4x04.js +0 -3
- package/dist/chunk-nw34xajc.js +0 -8
- package/dist/chunk-p077sw22.js +0 -3
- package/dist/chunk-p1h8065h.js +0 -3
- package/dist/chunk-p3e0cqtt.js +0 -34
- package/dist/chunk-p3fpb79v.js +0 -477
- package/dist/chunk-p52yzjq6.js +0 -498
- package/dist/chunk-p73meypx.js +0 -134
- package/dist/chunk-pa9zb7ty.js +0 -4
- package/dist/chunk-payfb24w.js +0 -207
- package/dist/chunk-pcm1vd8w.js +0 -3
- package/dist/chunk-pcntd9h4.js +0 -3
- package/dist/chunk-pg1fvqb9.js +0 -167
- package/dist/chunk-psc3wfcf.js +0 -1115
- package/dist/chunk-pznnww6k.js +0 -6
- package/dist/chunk-q6zhd9yf.js +0 -3
- package/dist/chunk-qa59zejf.js +0 -246
- package/dist/chunk-qvrbjpdc.js +0 -3
- package/dist/chunk-qygvvygy.js +0 -12
- package/dist/chunk-r0jcmpv6.js +0 -68
- package/dist/chunk-r5m9xtm7.js +0 -3
- package/dist/chunk-rh80q1nd.js +0 -1
- package/dist/chunk-rkffm9sy.js +0 -128
- package/dist/chunk-rpx5fa65.js +0 -3
- package/dist/chunk-rqxf5hns.js +0 -3
- package/dist/chunk-rtr974rc.js +0 -30
- package/dist/chunk-rvptcndz.js +0 -3
- package/dist/chunk-rw26rpek.js +0 -171
- package/dist/chunk-rw7937v4.js +0 -19
- package/dist/chunk-rwrv9wbf.js +0 -3
- package/dist/chunk-rz2ec6g7.js +0 -347
- package/dist/chunk-s6ja2bdg.js +0 -66
- package/dist/chunk-scpkdrdb.js +0 -4
- package/dist/chunk-shv88d2d.js +0 -10
- package/dist/chunk-t0c9wvpr.js +0 -3
- package/dist/chunk-tffh3b1e.js +0 -35
- package/dist/chunk-tg2f1mzq.js +0 -11
- package/dist/chunk-trfswy66.js +0 -77
- package/dist/chunk-tzwtg722.js +0 -3
- package/dist/chunk-v7f8jj15.js +0 -4
- package/dist/chunk-v8j49spx.js +0 -3
- package/dist/chunk-v97390pe.js +0 -1
- package/dist/chunk-vcr5pzpx.js +0 -233
- package/dist/chunk-veeerpwa.js +0 -3
- package/dist/chunk-vg5kt6az.js +0 -4
- package/dist/chunk-vgv7jvyz.js +0 -219
- package/dist/chunk-vjbefncc.js +0 -3
- package/dist/chunk-vmxjghsm.js +0 -3
- package/dist/chunk-vw7vqd76.js +0 -3
- package/dist/chunk-vx22he47.js +0 -1
- package/dist/chunk-w3b6m427.js +0 -45
- package/dist/chunk-wazkqv7n.js +0 -3
- package/dist/chunk-wf7zrjsw.js +0 -138
- package/dist/chunk-wfg2gm11.js +0 -3
- package/dist/chunk-wg9k6h8w.js +0 -12
- package/dist/chunk-wkz2vwkr.js +0 -81
- package/dist/chunk-wvef3ngh.js +0 -127
- package/dist/chunk-wvf31nzs.js +0 -3
- package/dist/chunk-x05nxhyv.js +0 -262
- package/dist/chunk-x0770gt9.js +0 -4
- package/dist/chunk-x24s4heg.js +0 -1166
- package/dist/chunk-x3r64r0c.js +0 -6
- package/dist/chunk-x5g9w4hh.js +0 -5
- package/dist/chunk-xgkv66q5.js +0 -2230
- package/dist/chunk-xqq1vxb6.js +0 -1
- package/dist/chunk-xs03kc1h.js +0 -196
- package/dist/chunk-xv34zbp4.js +0 -3
- package/dist/chunk-xw36p73h.js +0 -90
- package/dist/chunk-xyg1r5w0.js +0 -4
- package/dist/chunk-xys2sxh6.js +0 -16
- package/dist/chunk-y0qg6rrv.js +0 -3
- package/dist/chunk-y1k17c8b.js +0 -21
- package/dist/chunk-y5xz0jc4.js +0 -141
- package/dist/chunk-y6xsqe9a.js +0 -10
- package/dist/chunk-yb1t2h8h.js +0 -11
- package/dist/chunk-ygvyc6wv.js +0 -90
- package/dist/chunk-yj4x5ehw.js +0 -21
- package/dist/chunk-yn38c15w.js +0 -4
- package/dist/chunk-ynhngsdh.js +0 -3
- package/dist/chunk-yrsb6j3z.js +0 -3
- package/dist/chunk-yywfvfph.js +0 -2
- package/dist/chunk-zcxzdrn7.js +0 -5
- package/dist/chunk-zen6ax1y.js +0 -27
- package/dist/chunk-zf2pek72.js +0 -3
- package/dist/chunk-zk3d0jjf.js +0 -7
- package/dist/chunk-zy3rp1ab.js +0 -93
package/dist/chunk-jjdq01dv.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var W=typeof window<"u"&&typeof document<"u",A={color:"#6366f1",initialColor:"",height:"3px",duration:2000,throttle:200,autoFinish:!0,zIndex:999999},D=null,G=0,_=!1,X=null,V=null,K=null;function F(b){if(!W)return null;let j=document.getElementById("stx-loading-indicator");if(j)j.remove();let z=document.createElement("div");z.id="stx-loading-indicator";let J=b.initialColor?`linear-gradient(to right, ${b.initialColor}, ${b.color})`:b.color;z.style.cssText=`
|
|
3
|
-
position: fixed;
|
|
4
|
-
top: 0;
|
|
5
|
-
left: 0;
|
|
6
|
-
right: 0;
|
|
7
|
-
height: ${b.height};
|
|
8
|
-
background: ${J};
|
|
9
|
-
z-index: ${b.zIndex};
|
|
10
|
-
transform: scaleX(0);
|
|
11
|
-
transform-origin: left;
|
|
12
|
-
transition: transform 0.1s ease-out, opacity 0.3s ease;
|
|
13
|
-
opacity: 0;
|
|
14
|
-
pointer-events: none;
|
|
15
|
-
`;let Y=document.createElement("div");if(Y.style.cssText=`
|
|
16
|
-
position: absolute;
|
|
17
|
-
top: 0;
|
|
18
|
-
left: 0;
|
|
19
|
-
right: 0;
|
|
20
|
-
bottom: 0;
|
|
21
|
-
background: linear-gradient(
|
|
22
|
-
90deg,
|
|
23
|
-
transparent 0%,
|
|
24
|
-
rgba(255,255,255,0.4) 50%,
|
|
25
|
-
transparent 100%
|
|
26
|
-
);
|
|
27
|
-
animation: stx-shimmer 1.5s infinite;
|
|
28
|
-
`,z.appendChild(Y),!document.getElementById("stx-loading-styles")){let Q=document.createElement("style");Q.id="stx-loading-styles",Q.textContent=`
|
|
29
|
-
@keyframes stx-shimmer {
|
|
30
|
-
0% { transform: translateX(-100%); }
|
|
31
|
-
100% { transform: translateX(100%); }
|
|
32
|
-
}
|
|
33
|
-
`,document.head.appendChild(Q)}return document.body.appendChild(z),z}function H(b,j){if(!W||!D)return;if(G=Math.min(Math.max(b,0),100),X)cancelAnimationFrame(X);X=requestAnimationFrame(()=>{if(!D)return;D.style.opacity=G>0?"1":"0",D.style.transform=`scaleX(${G/100})`})}function k(b){if(!W)return;if(_=!0,G=0,!D)D=F(b);if(V)clearTimeout(V);if(K)clearInterval(K);H(10,b),K=setInterval(()=>{if(!_)return;let j=90-G,z=Math.max(0.5,j*0.1);if(G<90)H(G+z,b)},b.throttle)}function B(b){if(!W)return;if(_=!1,K)clearInterval(K),K=null;H(100,b),V=setTimeout(()=>{if(D)D.style.opacity="0";setTimeout(()=>{if(G=0,D)D.style.transform="scaleX(0)"},300)},200)}function O(){if(!W)return;if(_=!1,G=0,K)clearInterval(K),K=null;if(V)clearTimeout(V),V=null;if(D)D.style.opacity="0",D.style.transform="scaleX(0)"}function R(b){let j={...A,...b};return{start:()=>k(j),set:(z)=>H(z,j),finish:()=>B(j),clear:()=>O(),get state(){return{isLoading:_,progress:G,error:!1}}}}var N=null;function T(b){if(!W)return;if(N)N(),N=null;let j={...A,...b},z=R(j);D=F(j);let J=!1,Y=(U)=>{let M=U.target.closest("a");if(!M)return;let Z=M.getAttribute("href");if(!Z)return;if(Z.startsWith("http")||Z.startsWith("#")||Z.startsWith("mailto:")||Z.startsWith("tel:")||M.target==="_blank"||M.hasAttribute("download"))return;J=!0,z.start()},Q=()=>{if(!J)z.start(),J=!0},x=()=>{if(J||j.autoFinish)z.finish(),J=!1};document.addEventListener("click",Y),window.addEventListener("popstate",Q),window.addEventListener("load",x);let y=window.fetch,$=0,q=async function(...U){let S=typeof U[0]==="string"?U[0]:U[0].url,M=S.includes("/api/")||S.startsWith("/api");if(M){if($++,$===1&&!J)z.start()}try{return await y.apply(this,U)}finally{if(M){if($--,$===0&&!J)z.finish()}}};window.fetch=q,N=()=>{if(document.removeEventListener("click",Y),window.removeEventListener("popstate",Q),window.removeEventListener("load",x),window.fetch===q)window.fetch=y}}function C(){if(N)N(),N=null}function w(b){let j={...A,...b},z=j.initialColor?`linear-gradient(to right, ${j.initialColor}, ${j.color})`:j.color;return`
|
|
34
|
-
<div id="stx-loading-indicator" style="
|
|
35
|
-
position: fixed;
|
|
36
|
-
top: 0;
|
|
37
|
-
left: 0;
|
|
38
|
-
right: 0;
|
|
39
|
-
height: ${j.height};
|
|
40
|
-
background: ${z};
|
|
41
|
-
z-index: ${j.zIndex};
|
|
42
|
-
transform: scaleX(0);
|
|
43
|
-
transform-origin: left;
|
|
44
|
-
transition: transform 0.1s ease-out, opacity 0.3s ease;
|
|
45
|
-
opacity: 0;
|
|
46
|
-
pointer-events: none;
|
|
47
|
-
">
|
|
48
|
-
<div style="
|
|
49
|
-
position: absolute;
|
|
50
|
-
top: 0;
|
|
51
|
-
left: 0;
|
|
52
|
-
right: 0;
|
|
53
|
-
bottom: 0;
|
|
54
|
-
background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
|
|
55
|
-
animation: stx-shimmer 1.5s infinite;
|
|
56
|
-
"></div>
|
|
57
|
-
</div>
|
|
58
|
-
<style>
|
|
59
|
-
@keyframes stx-shimmer {
|
|
60
|
-
0% { transform: translateX(-100%); }
|
|
61
|
-
100% { transform: translateX(100%); }
|
|
62
|
-
}
|
|
63
|
-
</style>
|
|
64
|
-
<script>
|
|
65
|
-
(function() {
|
|
66
|
-
var opts = ${JSON.stringify(j)};
|
|
67
|
-
var el = document.getElementById('stx-loading-indicator');
|
|
68
|
-
var progress = 0;
|
|
69
|
-
var loading = false;
|
|
70
|
-
var interval = null;
|
|
71
|
-
|
|
72
|
-
function update(p) {
|
|
73
|
-
progress = Math.min(Math.max(p, 0), 100);
|
|
74
|
-
if (el) {
|
|
75
|
-
el.style.opacity = progress > 0 ? '1' : '0';
|
|
76
|
-
el.style.transform = 'scaleX(' + (progress / 100) + ')';
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
window.stxLoading = {
|
|
81
|
-
start: function() {
|
|
82
|
-
loading = true;
|
|
83
|
-
progress = 0;
|
|
84
|
-
update(10);
|
|
85
|
-
if (interval) clearInterval(interval);
|
|
86
|
-
interval = setInterval(function() {
|
|
87
|
-
if (!loading) return;
|
|
88
|
-
var remaining = 90 - progress;
|
|
89
|
-
var inc = Math.max(0.5, remaining * 0.1);
|
|
90
|
-
if (progress < 90) update(progress + inc);
|
|
91
|
-
}, opts.throttle);
|
|
92
|
-
},
|
|
93
|
-
finish: function() {
|
|
94
|
-
loading = false;
|
|
95
|
-
if (interval) { clearInterval(interval); interval = null; }
|
|
96
|
-
update(100);
|
|
97
|
-
setTimeout(function() {
|
|
98
|
-
if (el) el.style.opacity = '0';
|
|
99
|
-
setTimeout(function() {
|
|
100
|
-
progress = 0;
|
|
101
|
-
if (el) el.style.transform = 'scaleX(0)';
|
|
102
|
-
}, 300);
|
|
103
|
-
}, 200);
|
|
104
|
-
},
|
|
105
|
-
set: function(v) { update(v); },
|
|
106
|
-
clear: function() {
|
|
107
|
-
loading = false;
|
|
108
|
-
progress = 0;
|
|
109
|
-
if (interval) { clearInterval(interval); interval = null; }
|
|
110
|
-
if (el) { el.style.opacity = '0'; el.style.transform = 'scaleX(0)'; }
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
// Auto-hook navigation
|
|
115
|
-
document.addEventListener('click', function(e) {
|
|
116
|
-
var link = e.target.closest && e.target.closest('a');
|
|
117
|
-
if (!link) return;
|
|
118
|
-
var href = link.getAttribute('href');
|
|
119
|
-
if (!href || href.startsWith('http') || href.startsWith('#') || href.startsWith('mailto:') || href.startsWith('tel:') || link.target === '_blank') return;
|
|
120
|
-
window.stxLoading.start();
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
window.addEventListener('popstate', function() { window.stxLoading.start(); });
|
|
124
|
-
window.addEventListener('load', function() { window.stxLoading.finish(); });
|
|
125
|
-
})();
|
|
126
|
-
</script>
|
|
127
|
-
`}var P={useLoadingIndicator:R,initLoadingIndicator:T,generateLoadingIndicatorHtml:w};
|
|
128
|
-
export{R as Wl,T as Xl,C as Yl,w as Zl,P as _l};
|
package/dist/chunk-jnmgm2xw.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{existsSync as q,readFileSync as H}from"fs";import{join as T,resolve as Y}from"path";import z from"process";function A(C,E=z.cwd()){let B=C.i18n;if(!B||!Array.isArray(B.locales)||B.locales.length===0)return null;let I=B.defaultLocale??B.locales[0],D=U(B,E);return{locales:B.locales,defaultLocale:I,labels:B.labels??Object.fromEntries(B.locales.map((G)=>[G,G.toUpperCase()])),translations:D,pickerSelector:B.pickerSelector??"#lang-picker"}}function U(C,E){let B=C.translations??{},I={},D=C.translationsDir,G=D===!1?null:Y(E,typeof D==="string"&&D?D:"translations"),J=C.format??"json";for(let M of C.locales){let N=G?K(G,M,J):{};I[M]={...N,...B[M]??{}}}return I}function K(C,E,B){let I=B==="json"?[`${E}.json`]:[`${E}.${B}`,`${E}.${B==="yaml"?"yml":"yaml"}`];for(let D of I){let G=T(C,D);if(!q(G))continue;try{let J=H(G,"utf8"),M=B==="json"?JSON.parse(J):O(J);return _(M)}catch{continue}}return{}}function _(C,E="",B={}){if(!C||typeof C!=="object")return B;for(let[I,D]of Object.entries(C)){let G=E?`${E}.${I}`:I;if(D&&typeof D==="object"&&!Array.isArray(D))_(D,G,B);else if(typeof D==="string")B[G]=D;else if(typeof D==="number"||typeof D==="boolean")B[G]=String(D)}return B}function O(C){let E={},B=[{obj:E,indent:-1}];for(let I of C.split(`
|
|
3
|
-
`)){let D=I.replace(/#.*$/,"").trimEnd();if(!D.trim())continue;let G=D.search(/\S/);if(G===-1)continue;while(B.length>1&&B[B.length-1].indent>=G)B.pop();let J=B[B.length-1].obj,M=D.match(/^(\s*)(\S[^:]*):\s*(.*)$/);if(!M)continue;let[,,N,$]=M,Q=N.trim(),X=$.trim();if(X==="")J[Q]={},B.push({obj:J[Q],indent:G});else J[Q]=V(X)}return E}function V(C){if(C.startsWith("'")&&C.endsWith("'")||C.startsWith('"')&&C.endsWith('"'))return C.slice(1,-1);return C}function F(C,E,B){let I=C.translations[E]?.[B];if(typeof I==="string")return I;let D=C.translations[C.defaultLocale]?.[B];if(typeof D==="string")return D;return B}function L(C,E,B){return C.replace(/\{t(!?):([a-zA-Z][\w.-]*)\}/g,(I,D,G)=>{let J=F(E,B,G);return D==="!"?J:R(J)})}function Z(C,E,B){if(E===B)return C;if(C==="/")return`/${E}/`;if(C==="/404.html")return`/${E}/404.html`;return`/${E}${C}`}function P(C,E){for(let B of E){if(C===`/${B}`||C===`/${B}/`)return{locale:B,path:"/"};if(C.startsWith(`/${B}/`))return{locale:B,path:C.slice(B.length+1)}}return{locale:null,path:C}}function w(C,E,B){let I=C.replace(/\/$/,""),D=[];for(let J of B.locales){let M=`${I}${Z(E,J,B.defaultLocale)}`;D.push(`<link rel="alternate" hreflang="${W(J)}" href="${W(M)}">`)}let G=`${I}${Z(E,B.defaultLocale,B.defaultLocale)}`;return D.push(`<link rel="alternate" hreflang="x-default" href="${W(G)}">`),D.join(`
|
|
4
|
-
`)}function j(C,E){return`<script data-stx-lang-picker="1">window.__stxI18n=${JSON.stringify({locales:C.locales,defaultLocale:C.defaultLocale,current:E,pickerSelector:C.pickerSelector})};(function(){function cfg(){return window.__stxI18n}function localeFromPath(p){var d=cfg();for(var i=0;i<d.locales.length;i++){var c=d.locales[i];if(p==='/'+c||p==='/'+c+'/')return c;if(p.indexOf('/'+c+'/')===0)return c}return d.defaultLocale}function localePathFor(loc,p){var d=cfg();var stripped=p;for(var i=0;i<d.locales.length;i++){var c=d.locales[i];if(p==='/'+c||p==='/'+c+'/'){stripped='/';break}if(p.indexOf('/'+c+'/')===0){stripped=p.slice(c.length+1);break}}if(loc===d.defaultLocale)return stripped;if(stripped==='/')return '/'+loc+'/';return '/'+loc+stripped}cfg().localizeHref=function(href){try{var u=new URL(href,location.origin);if(u.origin!==location.origin)return href;return localePathFor(localeFromPath(location.pathname),u.pathname)+(u.search||'')+(u.hash||'')}catch(_){return href}};function syncFromUrl(){var d=cfg();var loc=localeFromPath(location.pathname);d.current=loc;var picker=document.querySelector(d.pickerSelector);if(picker){var btns=picker.querySelectorAll('[data-lang]');for(var i=0;i<btns.length;i++){var b=btns[i];if(b.getAttribute('data-lang')===loc)b.setAttribute('aria-current','true');else b.removeAttribute('aria-current')}}if(document.documentElement.lang!==loc)document.documentElement.lang=loc}function onLangClick(e){var d=cfg();var btn=e.target&&e.target.closest&&e.target.closest('[data-lang]');if(!btn)return;var picker=document.querySelector(d.pickerSelector);if(!picker||!picker.contains(btn))return;e.preventDefault();e.stopPropagation();var loc=btn.getAttribute('data-lang');if(!loc||loc===localeFromPath(location.pathname))return;var dest=localePathFor(loc,location.pathname);var r=window.__stxRouter;if(r&&r.navigate)r.navigate(dest,true,true);else location.assign(dest)}syncFromUrl();if(window.__stxLangPickerBound){document.removeEventListener('click',window.__stxLangPickerClick,true);window.removeEventListener('stx:navigate',window.__stxLangPickerSync);window.removeEventListener('popstate',window.__stxLangPickerSync)}window.__stxLangPickerClick=onLangClick;window.__stxLangPickerSync=syncFromUrl;window.__stxLangPickerBound=1;document.addEventListener('click',onLangClick,true);window.addEventListener('stx:navigate',syncFromUrl);window.addEventListener('popstate',syncFromUrl)})();</script>`}function W(C){return C.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function R(C){return C.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
5
|
-
export{A as _g,F as $g,L as ah,Z as bh,P as ch,w as dh,j as eh};
|
package/dist/chunk-jpndqst5.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{createHash as w}from"crypto";import{readFile as D,stat as A}from"fs/promises";async function J(j){try{let q=await D(j);return w("sha256").update(q).digest("hex").slice(0,16)}catch{return""}}function K(j){return w("sha256").update(j).digest("hex").slice(0,16)}function z(j){return w("sha256").update(j).digest("hex").slice(0,16)}function L(j,q){let B=JSON.stringify(q,Object.keys(q).sort());return`${z(j)}-${z(B)}`}async function M(j){try{return(await A(j)).mtimeMs}catch{return 0}}async function N(j){try{return await A(j),!0}catch{return!1}}
|
|
3
|
-
export{J as Vk,K as Wk,z as Xk,L as Yk,M as Zk,N as _k};
|
package/dist/chunk-jt0ezawy.js
DELETED
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var L=0;function G(){return`keep-alive-${++L}-${Date.now().toString(36)}`}function Q(f,j={},q){let z=/@keepAlive(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@endkeepAlive/gi;return f.replace(z,(E,B,D)=>{let F=G(),J=M(B||"");return P(F,D.trim(),J)})}function M(f){let j={max:10},q=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,z;while((z=q.exec(f))!==null){let E=z[1],B=z[2]||z[3],D=z[4];switch(E){case"max":j.max=D?parseInt(D,10):10;break;case"include":j.include=B;break;case"exclude":j.exclude=B;break;case"id":j.id=B;break}}return j}function P(f,j,q){let{max:z,include:E,exclude:B}=q,D=q.id||f;return`
|
|
3
|
-
<div class="stx-keep-alive" data-keep-alive-id="${f}" data-custom-id="${D}">
|
|
4
|
-
<div class="stx-keep-alive-content" data-keep-alive-content="${f}">
|
|
5
|
-
${j}
|
|
6
|
-
</div>
|
|
7
|
-
<div class="stx-keep-alive-cache" data-keep-alive-cache="${f}" style="display: none;">
|
|
8
|
-
</div>
|
|
9
|
-
</div>
|
|
10
|
-
<script>
|
|
11
|
-
(function() {
|
|
12
|
-
const keepAliveId = '${f}';
|
|
13
|
-
const customId = '${D}';
|
|
14
|
-
const maxCache = ${z||10};
|
|
15
|
-
const includeFilter = ${E?JSON.stringify(E.split(",").map((F)=>F.trim())):"null"};
|
|
16
|
-
const excludeFilter = ${B?JSON.stringify(B.split(",").map((F)=>F.trim())):"null"};
|
|
17
|
-
|
|
18
|
-
const container = document.querySelector('[data-keep-alive-id="' + keepAliveId + '"]');
|
|
19
|
-
const contentEl = document.querySelector('[data-keep-alive-content="' + keepAliveId + '"]');
|
|
20
|
-
const cacheEl = document.querySelector('[data-keep-alive-cache="' + keepAliveId + '"]');
|
|
21
|
-
|
|
22
|
-
if (!container || !contentEl || !cacheEl) return;
|
|
23
|
-
|
|
24
|
-
// LRU Cache
|
|
25
|
-
const cache = new Map();
|
|
26
|
-
const cacheOrder = [];
|
|
27
|
-
|
|
28
|
-
// Check if component should be cached
|
|
29
|
-
function shouldCache(componentName) {
|
|
30
|
-
if (excludeFilter && excludeFilter.includes(componentName)) {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
if (includeFilter && !includeFilter.includes(componentName)) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Get component key from element
|
|
40
|
-
function getComponentKey(element) {
|
|
41
|
-
// Try various ways to identify the component
|
|
42
|
-
return element.getAttribute('data-component') ||
|
|
43
|
-
element.getAttribute('data-key') ||
|
|
44
|
-
element.id ||
|
|
45
|
-
element.className.split(' ')[0] ||
|
|
46
|
-
element.tagName.toLowerCase();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Save scroll positions
|
|
50
|
-
function saveScrollPositions(element) {
|
|
51
|
-
const positions = new Map();
|
|
52
|
-
// eslint-disable-next-line pickier/no-unused-vars
|
|
53
|
-
element.querySelectorAll('[data-keep-scroll]').forEach(function(el) {
|
|
54
|
-
const key = el.getAttribute('data-keep-scroll') || el.id || 'default';
|
|
55
|
-
positions.set(key, { top: el.scrollTop, left: el.scrollLeft });
|
|
56
|
-
});
|
|
57
|
-
// Also save the element's own scroll if scrollable
|
|
58
|
-
if (element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth) {
|
|
59
|
-
positions.set('__self__', { top: element.scrollTop, left: element.scrollLeft });
|
|
60
|
-
}
|
|
61
|
-
return positions;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Restore scroll positions
|
|
65
|
-
function restoreScrollPositions(element, positions) {
|
|
66
|
-
if (!positions) return;
|
|
67
|
-
|
|
68
|
-
positions.forEach(function(pos, key) {
|
|
69
|
-
if (key === '__self__') {
|
|
70
|
-
element.scrollTop = pos.top;
|
|
71
|
-
element.scrollLeft = pos.left;
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
const el = element.querySelector('[data-keep-scroll="' + key + '"]') ||
|
|
75
|
-
document.getElementById(key);
|
|
76
|
-
if (el) {
|
|
77
|
-
el.scrollTop = pos.top;
|
|
78
|
-
el.scrollLeft = pos.left;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Save component state (form values, etc.)
|
|
85
|
-
function saveComponentState(element) {
|
|
86
|
-
const state = {};
|
|
87
|
-
|
|
88
|
-
// Save form inputs
|
|
89
|
-
// eslint-disable-next-line pickier/no-unused-vars
|
|
90
|
-
element.querySelectorAll('input, textarea, select').forEach(function(input, index) {
|
|
91
|
-
const key = input.name || input.id || 'input_' + index;
|
|
92
|
-
if (input.type === 'checkbox' || input.type === 'radio') {
|
|
93
|
-
state[key] = input.checked;
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
state[key] = input.value;
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
// Save data attributes marked for keeping
|
|
101
|
-
// eslint-disable-next-line pickier/no-unused-vars
|
|
102
|
-
element.querySelectorAll('[data-keep-state]').forEach(function(el) {
|
|
103
|
-
const key = el.getAttribute('data-keep-state');
|
|
104
|
-
const value = el.getAttribute('data-state-value') || el.textContent;
|
|
105
|
-
state['__data__' + key] = value;
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
return state;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// Restore component state
|
|
112
|
-
function restoreComponentState(element, state) {
|
|
113
|
-
if (!state) return;
|
|
114
|
-
|
|
115
|
-
// Restore form inputs
|
|
116
|
-
// eslint-disable-next-line pickier/no-unused-vars
|
|
117
|
-
element.querySelectorAll('input, textarea, select').forEach(function(input, index) {
|
|
118
|
-
const key = input.name || input.id || 'input_' + index;
|
|
119
|
-
if (state[key] !== undefined) {
|
|
120
|
-
if (input.type === 'checkbox' || input.type === 'radio') {
|
|
121
|
-
input.checked = state[key];
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
input.value = state[key];
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// Cache a component
|
|
131
|
-
function cacheComponent(key, element) {
|
|
132
|
-
if (!shouldCache(key)) return;
|
|
133
|
-
|
|
134
|
-
// Remove from cache order if exists (for LRU)
|
|
135
|
-
const existingIndex = cacheOrder.indexOf(key);
|
|
136
|
-
if (existingIndex > -1) {
|
|
137
|
-
cacheOrder.splice(existingIndex, 1);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// Evict oldest if at max capacity
|
|
141
|
-
while (cacheOrder.length >= maxCache) {
|
|
142
|
-
const oldestKey = cacheOrder.shift();
|
|
143
|
-
const oldCached = cache.get(oldestKey);
|
|
144
|
-
if (oldCached && oldCached.element) {
|
|
145
|
-
oldCached.element.remove();
|
|
146
|
-
}
|
|
147
|
-
cache.delete(oldestKey);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// Clone and cache
|
|
151
|
-
const clone = element.cloneNode(true);
|
|
152
|
-
clone.style.display = 'none';
|
|
153
|
-
clone.setAttribute('data-cached-key', key);
|
|
154
|
-
|
|
155
|
-
const cached = {
|
|
156
|
-
key: key,
|
|
157
|
-
element: clone,
|
|
158
|
-
state: saveComponentState(element),
|
|
159
|
-
scrollPositions: saveScrollPositions(element),
|
|
160
|
-
cachedAt: Date.now()
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
cache.set(key, cached);
|
|
164
|
-
cacheOrder.push(key);
|
|
165
|
-
cacheEl.appendChild(clone);
|
|
166
|
-
|
|
167
|
-
// Dispatch deactivated event
|
|
168
|
-
element.dispatchEvent(new CustomEvent('stx:deactivated', {
|
|
169
|
-
detail: { key: key, keepAliveId: keepAliveId },
|
|
170
|
-
bubbles: true
|
|
171
|
-
}));
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
// Restore a component from cache
|
|
175
|
-
function restoreComponent(key) {
|
|
176
|
-
const cached = cache.get(key);
|
|
177
|
-
if (!cached) return null;
|
|
178
|
-
|
|
179
|
-
// Move to end of cache order (most recently used)
|
|
180
|
-
const index = cacheOrder.indexOf(key);
|
|
181
|
-
if (index > -1) {
|
|
182
|
-
cacheOrder.splice(index, 1);
|
|
183
|
-
cacheOrder.push(key);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// Clone the cached element
|
|
187
|
-
const restored = cached.element.cloneNode(true);
|
|
188
|
-
restored.style.display = '';
|
|
189
|
-
restored.removeAttribute('data-cached-key');
|
|
190
|
-
|
|
191
|
-
// Restore state after a tick (to let DOM settle)
|
|
192
|
-
setTimeout(function() {
|
|
193
|
-
restoreComponentState(restored, cached.state);
|
|
194
|
-
restoreScrollPositions(restored, cached.scrollPositions);
|
|
195
|
-
|
|
196
|
-
// Dispatch activated event
|
|
197
|
-
restored.dispatchEvent(new CustomEvent('stx:activated', {
|
|
198
|
-
detail: { key: key, keepAliveId: keepAliveId, cachedAt: cached.cachedAt },
|
|
199
|
-
bubbles: true
|
|
200
|
-
}));
|
|
201
|
-
}, 0);
|
|
202
|
-
|
|
203
|
-
return restored;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
// Check if component is cached
|
|
207
|
-
function isCached(key) {
|
|
208
|
-
return cache.has(key);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// Clear cache
|
|
212
|
-
function clearCache(key) {
|
|
213
|
-
if (key) {
|
|
214
|
-
const cached = cache.get(key);
|
|
215
|
-
if (cached && cached.element) {
|
|
216
|
-
cached.element.remove();
|
|
217
|
-
}
|
|
218
|
-
cache.delete(key);
|
|
219
|
-
const index = cacheOrder.indexOf(key);
|
|
220
|
-
if (index > -1) {
|
|
221
|
-
cacheOrder.splice(index, 1);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
cache.forEach(function(cached) {
|
|
226
|
-
if (cached.element) {
|
|
227
|
-
cached.element.remove();
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
cache.clear();
|
|
231
|
-
cacheOrder.length = 0;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// Expose API
|
|
236
|
-
window.STX = window.STX || {};
|
|
237
|
-
window.STX.keepAlive = window.STX.keepAlive || { instances: {} };
|
|
238
|
-
window.STX.keepAlive.instances[keepAliveId] = {
|
|
239
|
-
id: keepAliveId,
|
|
240
|
-
customId: customId,
|
|
241
|
-
cache: cacheComponent,
|
|
242
|
-
restore: restoreComponent,
|
|
243
|
-
isCached: isCached,
|
|
244
|
-
clear: clearCache,
|
|
245
|
-
getCacheKeys: function() { return Array.from(cache.keys()); },
|
|
246
|
-
getCacheSize: function() { return cache.size; }
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
// Observe for component changes
|
|
250
|
-
const observer = new MutationObserver(function(mutations) {
|
|
251
|
-
mutations.forEach(function(mutation) {
|
|
252
|
-
// Handle removed nodes (cache them)
|
|
253
|
-
mutation.removedNodes.forEach(function(node) {
|
|
254
|
-
if (node.nodeType === Node.ELEMENT_NODE && node.hasAttribute && !node.hasAttribute('data-cached-key')) {
|
|
255
|
-
const key = getComponentKey(node);
|
|
256
|
-
if (key && shouldCache(key)) {
|
|
257
|
-
// Check if this removal is intentional (not just DOM restructuring)
|
|
258
|
-
if (!contentEl.contains(node)) {
|
|
259
|
-
cacheComponent(key, node);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
// Handle added nodes (check if we should restore from cache)
|
|
266
|
-
mutation.addedNodes.forEach(function(node) {
|
|
267
|
-
if (node.nodeType === Node.ELEMENT_NODE && node.hasAttribute) {
|
|
268
|
-
const key = getComponentKey(node);
|
|
269
|
-
if (key && isCached(key)) {
|
|
270
|
-
const restored = restoreComponent(key);
|
|
271
|
-
if (restored) {
|
|
272
|
-
node.replaceWith(restored);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
});
|
|
278
|
-
});
|
|
279
|
-
|
|
280
|
-
observer.observe(contentEl, { childList: true, subtree: true });
|
|
281
|
-
|
|
282
|
-
// Cleanup on removal
|
|
283
|
-
container.addEventListener('stx:destroy', function() {
|
|
284
|
-
observer.disconnect();
|
|
285
|
-
clearCache();
|
|
286
|
-
});
|
|
287
|
-
})();
|
|
288
|
-
</script>
|
|
289
|
-
`}function T(f={}){return{id:f.id||G(),cache:new Map,max:f.max||10,include:f.include?f.include.split(",").map((q)=>q.trim()):null,exclude:f.exclude?f.exclude.split(",").map((q)=>q.trim()):null}}function W(f,j){if(j.exclude&&j.exclude.includes(f))return!1;if(j.include&&!j.include.includes(f))return!1;return!0}function X(){return`
|
|
290
|
-
/* STX Keep-Alive Styles */
|
|
291
|
-
.stx-keep-alive {
|
|
292
|
-
position: relative;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
.stx-keep-alive-cache {
|
|
296
|
-
display: none !important;
|
|
297
|
-
visibility: hidden;
|
|
298
|
-
position: absolute;
|
|
299
|
-
pointer-events: none;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
/* Activation transition */
|
|
303
|
-
.stx-keep-alive-content > * {
|
|
304
|
-
transition: opacity 0.15s ease;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
.stx-keep-alive-content > [data-activating] {
|
|
308
|
-
opacity: 0;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
.stx-keep-alive-content > [data-activated] {
|
|
312
|
-
opacity: 1;
|
|
313
|
-
}
|
|
314
|
-
`}function Y(){return`
|
|
315
|
-
// STX Keep-Alive Runtime
|
|
316
|
-
(function() {
|
|
317
|
-
if (typeof window === 'undefined') return;
|
|
318
|
-
|
|
319
|
-
window.STX = window.STX || {};
|
|
320
|
-
window.STX.keepAlive = window.STX.keepAlive || { instances: {} };
|
|
321
|
-
|
|
322
|
-
// Global keep-alive utilities
|
|
323
|
-
window.STX.keepAlive.clearAll = function() {
|
|
324
|
-
Object.values(window.STX.keepAlive.instances).forEach(function(instance) {
|
|
325
|
-
instance.clear();
|
|
326
|
-
});
|
|
327
|
-
};
|
|
328
|
-
|
|
329
|
-
window.STX.keepAlive.getTotalCached = function() {
|
|
330
|
-
return Object.values(window.STX.keepAlive.instances).reduce(function(total, instance) {
|
|
331
|
-
return total + instance.getCacheSize();
|
|
332
|
-
}, 0);
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
// Lifecycle hooks for keep-alive
|
|
336
|
-
window.STX.onActivated = function(callback) {
|
|
337
|
-
document.addEventListener('stx:activated', function(e) {
|
|
338
|
-
callback(e.detail);
|
|
339
|
-
});
|
|
340
|
-
};
|
|
341
|
-
|
|
342
|
-
window.STX.onDeactivated = function(callback) {
|
|
343
|
-
document.addEventListener('stx:deactivated', function(e) {
|
|
344
|
-
callback(e.detail);
|
|
345
|
-
});
|
|
346
|
-
};
|
|
347
|
-
|
|
348
|
-
console.log('[stx] Keep-alive runtime initialized');
|
|
349
|
-
})();
|
|
350
|
-
`}function Z(f){if(typeof document<"u")document.addEventListener("stx:activated",(j)=>{f(j.detail)})}function _(f){if(typeof document<"u")document.addEventListener("stx:deactivated",(j)=>{f(j.detail)})}
|
|
351
|
-
export{Q as Pl,T as Ql,W as Rl,X as Sl,Y as Tl,Z as Ul,_ as Vl};
|
package/dist/chunk-jz73j3qs.js
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
function C(){return`<script data-stx-hydration-runtime>
|
|
3
|
-
(function() {
|
|
4
|
-
'use strict';
|
|
5
|
-
|
|
6
|
-
var stxIslands = window.__stxIslands = window.__stxIslands || {
|
|
7
|
-
_registry: {},
|
|
8
|
-
_hydrated: new Set(),
|
|
9
|
-
|
|
10
|
-
register: function(name, loader) {
|
|
11
|
-
this._registry[name] = loader;
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
hydrateIsland: function(el) {
|
|
15
|
-
var id = el.getAttribute('data-island');
|
|
16
|
-
if (!id || this._hydrated.has(id)) return Promise.resolve();
|
|
17
|
-
this._hydrated.add(id);
|
|
18
|
-
|
|
19
|
-
var componentName = el.getAttribute('data-component');
|
|
20
|
-
var propsScript = el.querySelector('script[data-island-props="' + id + '"]');
|
|
21
|
-
var props = {};
|
|
22
|
-
if (propsScript) {
|
|
23
|
-
try { props = JSON.parse(propsScript.textContent || '{}'); }
|
|
24
|
-
catch (e) {}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
var loader = componentName ? this._registry[componentName] : null;
|
|
28
|
-
|
|
29
|
-
if (loader) {
|
|
30
|
-
return Promise.resolve(typeof loader === 'function' ? loader() : loader)
|
|
31
|
-
.then(function(mod) {
|
|
32
|
-
var comp = mod && mod.default ? mod.default : mod;
|
|
33
|
-
if (comp && comp.hydrate) {
|
|
34
|
-
return comp.hydrate(el, props);
|
|
35
|
-
}
|
|
36
|
-
else if (comp && comp.mount) {
|
|
37
|
-
return comp.mount(el, props);
|
|
38
|
-
}
|
|
39
|
-
})
|
|
40
|
-
.then(function() {
|
|
41
|
-
el.classList.add('hydrated');
|
|
42
|
-
el.dispatchEvent(new CustomEvent('stx:hydrated', { bubbles: true }));
|
|
43
|
-
})
|
|
44
|
-
.catch(function(err) {
|
|
45
|
-
console.error('[stx] Hydration failed for island:', id, err);
|
|
46
|
-
el.classList.add('hydrated');
|
|
47
|
-
el.dispatchEvent(new CustomEvent('stx:hydrated', { bubbles: true }));
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// No loader registered \u2014 just mark as hydrated (CSS-only island)
|
|
52
|
-
el.classList.add('hydrated');
|
|
53
|
-
el.dispatchEvent(new CustomEvent('stx:hydrated', { bubbles: true }));
|
|
54
|
-
return Promise.resolve();
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
_setupStrategy: function(el) {
|
|
58
|
-
var self = this;
|
|
59
|
-
var strategy = el.getAttribute('data-strategy') || 'load';
|
|
60
|
-
|
|
61
|
-
switch (strategy) {
|
|
62
|
-
case 'load':
|
|
63
|
-
self.hydrateIsland(el);
|
|
64
|
-
break;
|
|
65
|
-
|
|
66
|
-
case 'idle':
|
|
67
|
-
if ('requestIdleCallback' in window) {
|
|
68
|
-
requestIdleCallback(function() { self.hydrateIsland(el); }, { timeout: 2000 });
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
setTimeout(function() { self.hydrateIsland(el); }, 200);
|
|
72
|
-
}
|
|
73
|
-
break;
|
|
74
|
-
|
|
75
|
-
case 'visible':
|
|
76
|
-
if ('IntersectionObserver' in window) {
|
|
77
|
-
var rootMargin = el.getAttribute('data-root-margin') || '0px';
|
|
78
|
-
var threshold = parseFloat(el.getAttribute('data-threshold') || '0') || 0;
|
|
79
|
-
var obs = new IntersectionObserver(function(entries) {
|
|
80
|
-
entries.forEach(function(entry) {
|
|
81
|
-
if (entry.isIntersecting) {
|
|
82
|
-
obs.disconnect();
|
|
83
|
-
self.hydrateIsland(el);
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}, { rootMargin: rootMargin, threshold: threshold });
|
|
87
|
-
obs.observe(el);
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
self.hydrateIsland(el);
|
|
91
|
-
}
|
|
92
|
-
break;
|
|
93
|
-
|
|
94
|
-
case 'media':
|
|
95
|
-
var mediaQuery = el.getAttribute('data-media') || '(min-width: 768px)';
|
|
96
|
-
var mq = window.matchMedia(mediaQuery);
|
|
97
|
-
if (mq.matches) {
|
|
98
|
-
self.hydrateIsland(el);
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
var handler = function(e) {
|
|
102
|
-
if (e.matches) {
|
|
103
|
-
mq.removeEventListener('change', handler);
|
|
104
|
-
self.hydrateIsland(el);
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
mq.addEventListener('change', handler);
|
|
108
|
-
}
|
|
109
|
-
break;
|
|
110
|
-
|
|
111
|
-
case 'hover':
|
|
112
|
-
var events = ['mouseenter', 'focusin', 'touchstart'];
|
|
113
|
-
var hoverHandler = function() {
|
|
114
|
-
events.forEach(function(e) { el.removeEventListener(e, hoverHandler); });
|
|
115
|
-
self.hydrateIsland(el);
|
|
116
|
-
};
|
|
117
|
-
events.forEach(function(e) {
|
|
118
|
-
el.addEventListener(e, hoverHandler, { once: true, passive: true });
|
|
119
|
-
});
|
|
120
|
-
break;
|
|
121
|
-
|
|
122
|
-
case 'event':
|
|
123
|
-
var eventName = el.getAttribute('data-event') || 'stx:activate';
|
|
124
|
-
window.addEventListener(eventName, function evtHandler(e) {
|
|
125
|
-
if (!e.detail || e.detail.id === el.getAttribute('data-island') || e.detail.id === '*') {
|
|
126
|
-
window.removeEventListener(eventName, evtHandler);
|
|
127
|
-
self.hydrateIsland(el);
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
break;
|
|
131
|
-
|
|
132
|
-
case 'only':
|
|
133
|
-
var tmpl = el.querySelector('template[data-client-content]');
|
|
134
|
-
if (tmpl) {
|
|
135
|
-
el.innerHTML = tmpl.innerHTML;
|
|
136
|
-
}
|
|
137
|
-
el.classList.add('hydrated');
|
|
138
|
-
break;
|
|
139
|
-
|
|
140
|
-
default:
|
|
141
|
-
self.hydrateIsland(el);
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
initIslands: function() {
|
|
146
|
-
var self = this;
|
|
147
|
-
var islands = document.querySelectorAll('.stx-island:not(.hydrated)');
|
|
148
|
-
islands.forEach(function(el) {
|
|
149
|
-
self._setupStrategy(el);
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
// Auto-init on DOMContentLoaded
|
|
155
|
-
if (document.readyState === 'loading') {
|
|
156
|
-
document.addEventListener('DOMContentLoaded', function() { stxIslands.initIslands(); });
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
stxIslands.initIslands();
|
|
160
|
-
}
|
|
161
|
-
})();
|
|
162
|
-
</script>`}function D(q){if(q.size===0)return"";return`<script data-stx-island-manifest>
|
|
163
|
-
(function() {
|
|
164
|
-
if (!window.__stxIslands) return;
|
|
165
|
-
${Array.from(q.entries()).map(([j,y])=>` window.__stxIslands.register('${j}', function() { return import('${y}'); });`).join(`
|
|
166
|
-
`)}
|
|
167
|
-
})();
|
|
168
|
-
</script>`}function F(q){let w=q.match(/<([A-Z][a-zA-Z0-9]+)[\s/>]/);if(w)return w[1];let j=q.match(/<([a-z][a-z0-9]*-[a-z0-9-]+)[\s/>]/);if(j)return j[1];return null}function G(q,w){let j={},y=/:([a-zA-Z_][\w-]*)\s*=\s*"([^"]+)"/g,z;while((z=y.exec(q))!==null){let B=z[1],A=z[2];if(A in w)j[B]=w[A];else j[B]=A}return j}
|
|
169
|
-
export{C as pm,D as qm,F as rm,G as sm};
|