@stacksjs/stx 0.2.94 → 0.2.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/a11y.js +598 -2
- package/dist/analytics.js +159 -2
- package/dist/analyzer.js +240 -2
- package/dist/animation.js +688 -2
- package/dist/app-shell.js +220 -2
- package/dist/app.js +79 -2
- package/dist/assets.js +155 -2
- package/dist/ast.js +630 -2
- package/dist/async-components.js +428 -2
- package/dist/auth.js +12 -2
- package/dist/broadcasting.js +102 -2
- package/dist/browser-composables.js +565 -2
- package/dist/build-assets.js +29 -2
- package/dist/build-mode-detector.js +50 -2
- package/dist/build-optimizer.js +433 -2
- package/dist/build-views.js +180 -2
- package/dist/build.js +33 -2
- package/dist/builtins/drawer.js +37 -2
- package/dist/builtins/escape.js +3 -2
- package/dist/builtins/icon.js +83 -2
- package/dist/builtins/index.js +34 -2
- package/dist/builtins/modal.js +38 -2
- package/dist/builtins/safe-image.js +51 -2
- package/dist/builtins/stx-image.js +200 -2
- package/dist/builtins/stx-link.js +41 -2
- package/dist/builtins/stx-loading-indicator.js +35 -2
- package/dist/builtins/suspense.js +24 -2
- package/dist/builtins/toast.js +42 -2
- package/dist/builtins/tooltip.js +106 -2
- package/dist/builtins/transition-group.js +22 -2
- package/dist/bundle-analyzer/collector.js +233 -2
- package/dist/bundle-analyzer/index.js +82 -2
- package/dist/bundle-analyzer/report.js +318 -2
- package/dist/bundle-analyzer/treemap.js +594 -2
- package/dist/caching.js +131 -2
- package/dist/cli.js +11317 -10982
- package/dist/client/directive.js +14 -2
- package/dist/client/index.js +2 -2
- package/dist/client-helpers.js +312 -2
- package/dist/client-script-bundler.js +216 -6
- package/dist/client-script.js +754 -2
- package/dist/client.js +73 -4
- package/dist/component-hmr.js +585 -2
- package/dist/component-library.d.ts +6 -0
- package/dist/component-library.js +683 -0
- package/dist/component-processing.js +613 -2
- package/dist/component-registry.js +90 -2
- package/dist/component-renderer.js +660 -2
- package/dist/components.js +213 -2
- package/dist/composables/index.js +220 -2
- package/dist/composables/use-battery.js +101 -2
- package/dist/composables/use-broadcast-channel.js +80 -2
- package/dist/composables/use-channel.js +124 -2
- package/dist/composables/use-clipboard.js +79 -2
- package/dist/composables/use-color-mode.js +131 -2
- package/dist/composables/use-cookie.js +86 -2
- package/dist/composables/use-device-orientation.js +181 -2
- package/dist/composables/use-event-listener.js +27 -2
- package/dist/composables/use-event-source.js +166 -2
- package/dist/composables/use-eye-dropper.js +142 -2
- package/dist/composables/use-fetch.js +223 -2
- package/dist/composables/use-fullscreen.js +110 -2
- package/dist/composables/use-geolocation.js +101 -2
- package/dist/composables/use-idle.js +182 -2
- package/dist/composables/use-intersection-observer.js +168 -2
- package/dist/composables/use-keyboard.js +224 -2
- package/dist/composables/use-media-query.js +62 -2
- package/dist/composables/use-meta.js +48 -2
- package/dist/composables/use-mouse.js +286 -2
- package/dist/composables/use-mutation-observer.js +129 -2
- package/dist/composables/use-network.js +85 -2
- package/dist/composables/use-notification.js +94 -2
- package/dist/composables/use-permissions.js +132 -2
- package/dist/composables/use-query.js +0 -1
- package/dist/composables/use-resize-observer.js +157 -2
- package/dist/composables/use-router.js +51 -2
- package/dist/composables/use-share.js +104 -2
- package/dist/composables/use-speech.js +294 -2
- package/dist/composables/use-storage.js +130 -2
- package/dist/composables/use-text-selection.js +205 -4
- package/dist/composables/use-timer.js +183 -2
- package/dist/composables/use-utilities.js +176 -2
- package/dist/composables/use-wake-lock.js +122 -2
- package/dist/composables/use-websocket.js +165 -2
- package/dist/composables/use-window.js +163 -2
- package/dist/composables.js +552 -2
- package/dist/composition-api.js +190 -2
- package/dist/computed.js +376 -8
- package/dist/conditionals.js +599 -2
- package/dist/config.js +751 -2
- package/dist/craft-bridge.js +432 -2
- package/dist/craft-compiler.js +810 -2
- package/dist/craft-components.js +945 -2
- package/dist/craft-entry.js +5 -2
- package/dist/craft-ssr.js +559 -2
- package/dist/csp.js +220 -2
- package/dist/csrf.js +38 -2
- package/dist/custom-directives.js +136 -2
- package/dist/defer.js +156 -2
- package/dist/deploy/config-generators.js +214 -2
- package/dist/deploy/index.js +203 -2
- package/dist/deploy/netlify.js +167 -2
- package/dist/dev-server/crosswind.js +379 -2
- package/dist/dev-server/index.js +7 -2
- package/dist/dev-server/keyboard-shortcuts.js +81 -2
- package/dist/dev-server/native-window.js +91 -2
- package/dist/dev-server/port-utils.js +40 -2
- package/dist/dev-server/serve-app.js +682 -7
- package/dist/dev-server/serve-file.js +439 -7
- package/dist/dev-server/serve-markdown.js +281 -2
- package/dist/dev-server/serve-multi.js +424 -17
- package/dist/dev-server/terminal-colors.js +45 -2
- package/dist/dev-server/theme-selector.js +111 -2
- package/dist/dev-server/types.js +43 -2
- package/dist/dev-server.js +4 -2
- package/dist/devtools.js +462 -18
- package/dist/directive-api.js +355 -2
- package/dist/docs.js +567 -2
- package/dist/doctor.js +123 -2
- package/dist/document-shell.js +105 -2
- package/dist/dynamic-components.js +78 -2
- package/dist/edge-runtime.js +539 -2
- package/dist/env.js +9 -2
- package/dist/error-boundaries.js +62 -12
- package/dist/error-handling.js +1 -2
- package/dist/errors/codes.js +97 -2
- package/dist/errors/formatter.js +196 -2
- package/dist/errors/index.js +44 -2
- package/dist/errors/logger.js +250 -2
- package/dist/errors/sanitizer.js +181 -2
- package/dist/errors/types.js +86 -2
- package/dist/events.js +382 -2
- package/dist/expressions.js +650 -2
- package/dist/formatter.js +265 -2
- package/dist/forms-validation.js +510 -4
- package/dist/forms.js +709 -2
- package/dist/head.js +224 -2
- package/dist/heatmap.js +566 -2
- package/dist/hot-reload.js +367 -2
- package/dist/html-masking.js +73 -2
- package/dist/hydration-runtime.js +195 -2
- package/dist/hydration.js +654 -2
- package/dist/i18n.js +633 -2
- package/dist/image-optimization/auto-sibling.js +88 -2
- package/dist/image-optimization/build-plugin.js +241 -2
- package/dist/image-optimization/component.js +244 -2
- package/dist/image-optimization/directive.js +203 -2
- package/dist/image-optimization/index.js +54 -2
- package/dist/image-optimization/processor.js +262 -2
- package/dist/image-optimization/serve.js +102 -2
- package/dist/includes.js +733 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +134 -2
- package/dist/init.js +505 -2
- package/dist/inline-assets.js +82 -2
- package/dist/interactive.js +383 -2
- package/dist/internal-markdown.js +141 -2
- package/dist/island-chunking.js +52 -2
- package/dist/js-ts.js +57 -2
- package/dist/jsx-runtime.js +289 -2
- package/dist/keep-alive.js +421 -2
- package/dist/lazy-loader.js +245 -2
- package/dist/loading-indicator.js +322 -2
- package/dist/loops.js +643 -2
- package/dist/manifest.js +31 -2
- package/dist/markdown.js +68 -2
- package/dist/media/client/blur-up.js +217 -2
- package/dist/media/client/index.js +53 -2
- package/dist/media/client/lazy-load.js +283 -2
- package/dist/media/client/upload-handler.js +354 -2
- package/dist/media/image/component.js +574 -2
- package/dist/media/image/directive.js +160 -2
- package/dist/media/image/editing.js +193 -2
- package/dist/media/image/index.js +80 -2
- package/dist/media/image/placeholder.js +188 -2
- package/dist/media/image/processor/cache.js +51 -2
- package/dist/media/image/processor/index.js +3 -2
- package/dist/media/image/processor/optimizer.js +202 -2
- package/dist/media/image/processor/responsive.js +162 -2
- package/dist/media/image/srcset.js +194 -2
- package/dist/media/index.js +198 -2
- package/dist/media/manager/embed.js +253 -2
- package/dist/media/protected/component.js +235 -2
- package/dist/media/protected/index.js +20 -2
- package/dist/media/protected/signature.js +205 -2
- package/dist/media/shared/cache.js +132 -2
- package/dist/media/shared/hash.js +35 -2
- package/dist/media/shared/index.js +2 -2
- package/dist/media/types.js +0 -1
- package/dist/media/upload/component.js +320 -2
- package/dist/media/upload/index.js +1 -2
- package/dist/media/video/directive.js +142 -2
- package/dist/media/video/index.js +583 -2
- package/dist/media/video/processor/cache.js +52 -2
- package/dist/media/video/processor/index.js +4 -2
- package/dist/media/video/processor/streaming.js +197 -2
- package/dist/media/video/processor/thumbnail.js +134 -2
- package/dist/media/video/processor/transcoder.js +283 -2
- package/dist/method-spoofing.js +17 -2
- package/dist/middleware.js +40 -2
- package/dist/misc-directives.js +222 -2
- package/dist/native-build.js +511 -2
- package/dist/parser/directive-parser.js +239 -2
- package/dist/parser/expression-parser.js +358 -2
- package/dist/parser/index.js +23 -2
- package/dist/parser/tokenizer.js +534 -2
- package/dist/partial-hydration.js +427 -2
- package/dist/performance-utils.js +430 -2
- package/dist/placeholder.js +35 -2
- package/dist/plugin-system.js +214 -2
- package/dist/plugin.js +173 -2
- package/dist/precompiler.js +660 -81
- package/dist/process.js +711 -2
- package/dist/production-build.js +596 -2
- package/dist/production-builder.js +132 -2
- package/dist/production-server.js +188 -2
- package/dist/props.js +224 -2
- package/dist/public-env.js +19 -2
- package/dist/pwa/audit.js +255 -2
- package/dist/pwa/directives.js +332 -2
- package/dist/pwa/icons.js +109 -2
- package/dist/pwa/index.js +47 -2
- package/dist/pwa/inject.js +102 -2
- package/dist/pwa/manifest.js +186 -2
- package/dist/pwa/offline.js +259 -2
- package/dist/pwa/precache.js +116 -2
- package/dist/pwa/service-worker.js +860 -2
- package/dist/pwa/workbox-strategies.js +167 -2
- package/dist/pwa/workbox.js +382 -2
- package/dist/pwa.js +427 -427
- package/dist/reactive-bindings.js +266 -2
- package/dist/reactive.js +569 -2
- package/dist/reactivity.js +559 -2
- package/dist/release.js +1 -2
- package/dist/render.js +165 -2
- package/dist/route-middleware.js +17 -2
- package/dist/router.js +9 -2
- package/dist/routes.js +14 -2
- package/dist/runtime-injection.js +120 -2
- package/dist/runtime.js +94 -2
- package/dist/safe-evaluator.js +444 -2
- package/dist/scaffolding.js +897 -2
- package/dist/screenshot.js +87 -2
- package/dist/script-classifier.js +32 -2
- package/dist/script-validation.js +158 -2
- package/dist/seo.js +457 -2
- package/dist/serve.js +237 -2
- package/dist/server-bindings.js +108 -2
- package/dist/server-components.js +338 -11
- package/dist/signal-processing.js +946 -2
- package/dist/signals-api.js +154 -2
- package/dist/signals.js +5287 -2
- package/dist/site-builder/build.js +224 -2
- package/dist/site-builder/i18n.js +140 -2
- package/dist/site-builder/index.js +15 -2
- package/dist/site-builder/robots.js +26 -2
- package/dist/site-builder/router.js +27 -2
- package/dist/site-builder/seo.js +36 -2
- package/dist/site-builder/sitemap.js +26 -2
- package/dist/site-builder/theme.js +33 -2
- package/dist/site-builder/types.js +0 -1
- package/dist/slots.js +201 -2
- package/dist/source-maps.js +350 -2
- package/dist/spa-shell.js +34 -2
- package/dist/ssg.js +389 -389
- package/dist/ssr.js +355 -2
- package/dist/state-management.js +533 -2
- package/dist/store-imports.js +13 -2
- package/dist/store-loader.js +72 -5
- package/dist/stores-client.js +132 -2
- package/dist/story/addons.js +261 -2
- package/dist/story/analytics.js +235 -2
- package/dist/story/auto-stories.js +158 -2
- package/dist/story/bookmarks.js +277 -2
- package/dist/story/bun-test.js +102 -2
- package/dist/story/cli.js +155 -2
- package/dist/story/collect/analyzer.js +305 -2
- package/dist/story/collect/index.js +27 -2
- package/dist/story/collect/parser.js +129 -2
- package/dist/story/collect/scanner.js +101 -2
- package/dist/story/collect/tree.js +110 -2
- package/dist/story/commands/build.js +172 -2
- package/dist/story/commands/dev.js +78 -2
- package/dist/story/commands/index.js +3 -2
- package/dist/story/commands/preview.js +56 -2
- package/dist/story/compiled-output.js +151 -2
- package/dist/story/composition.js +261 -2
- package/dist/story/config-watcher.js +67 -2
- package/dist/story/config.js +64 -2
- package/dist/story/context.js +27 -2
- package/dist/story/controls/index.js +320 -2
- package/dist/story/crosswind.js +189 -2
- package/dist/story/desktop-preview.js +105 -2
- package/dist/story/docs-generator.js +186 -2
- package/dist/story/errors.js +239 -2
- package/dist/story/figma-export.js +224 -2
- package/dist/story/generator.js +165 -2
- package/dist/story/hmr.js +131 -2
- package/dist/story/hot-swap.js +207 -2
- package/dist/story/index.js +49 -2
- package/dist/story/interactions.js +225 -2
- package/dist/story/keyboard-shortcuts.js +345 -2
- package/dist/story/output.js +153 -2
- package/dist/story/performance.js +252 -2
- package/dist/story/presets.js +289 -2
- package/dist/story/props-validation.js +215 -2
- package/dist/story/renderer.js +209 -2
- package/dist/story/search-index.js +106 -2
- package/dist/story/search.js +140 -2
- package/dist/story/server.js +965 -2
- package/dist/story/setup.js +78 -2
- package/dist/story/snapshots.js +170 -2
- package/dist/story/testing.js +163 -2
- package/dist/story/theme.js +170 -2
- package/dist/story/types.js +0 -2
- package/dist/story/ui/code-panel.js +175 -2
- package/dist/story/ui/controls-panel.js +168 -2
- package/dist/story/ui/index.js +4 -2
- package/dist/story/ui/navigation.js +250 -2
- package/dist/story/ui/preview.js +251 -2
- package/dist/story/visual-testing.js +247 -2
- package/dist/streaming.js +537 -2
- package/dist/strict-lint.js +288 -2
- package/dist/style-scoping.js +50 -2
- package/dist/suspense.js +398 -2
- package/dist/teleport.js +109 -2
- package/dist/template-compiler.js +63 -2
- package/dist/template-hydrator.js +82 -2
- package/dist/template-tag-balance.js +93 -2
- package/dist/testing.js +581 -2
- package/dist/transitions.js +443 -2
- package/dist/type-checker.js +581 -2
- package/dist/types/component-types.d.ts +54 -0
- package/dist/types/component-types.js +0 -1
- package/dist/types/config-types.js +0 -1
- package/dist/types/context-types.js +0 -1
- package/dist/types/csp-types.js +0 -1
- package/dist/types/directive-types.js +3 -2
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +1 -2
- package/dist/types/pwa-types.js +0 -1
- package/dist/types.js +1 -2
- package/dist/typescript-templates.js +386 -4
- package/dist/utils.js +942 -2
- package/dist/validator.js +171 -2
- package/dist/variable-extractor.js +1094 -2
- package/dist/view-composers.js +29 -2
- package/dist/virtual-scrolling.js +454 -2
- package/dist/visual-editor.js +688 -28
- package/dist/vue-template.js +475 -2
- package/dist/web-components/css-scoping.js +177 -2
- package/dist/web-components/index.js +13 -2
- package/dist/web-components/reactive-generator.js +121 -56
- package/dist/web-components.js +1447 -2
- package/dist/x-element.js +17 -5
- package/package.json +6 -7
- package/dist/chunk-03c26pjz.js +0 -3
- package/dist/chunk-04mvcmcr.js +0 -106
- package/dist/chunk-05hgyyqc.js +0 -4
- package/dist/chunk-095s3972.js +0 -99
- package/dist/chunk-0b9w2w1y.js +0 -1
- package/dist/chunk-0dz85jrp.js +0 -3
- package/dist/chunk-0g4gece6.js +0 -4
- package/dist/chunk-0jd0pndq.js +0 -3
- package/dist/chunk-0jkwrcwj.js +0 -3
- package/dist/chunk-0m9tdm7t.js +0 -71
- package/dist/chunk-0qakwen3.js +0 -1
- package/dist/chunk-0qnz93q2.js +0 -3
- package/dist/chunk-0tatqxj2.js +0 -57
- package/dist/chunk-0wdar532.js +0 -102
- package/dist/chunk-13yz561y.js +0 -3
- package/dist/chunk-174z0cd0.js +0 -3
- package/dist/chunk-1mmykse5.js +0 -81
- package/dist/chunk-1z2yq9em.js +0 -3
- package/dist/chunk-1z5nhbjt.js +0 -90
- package/dist/chunk-1zgsgk4b.js +0 -1
- package/dist/chunk-25s7bckb.js +0 -171
- package/dist/chunk-268adc7r.js +0 -2230
- package/dist/chunk-26r6zh3t.js +0 -194
- package/dist/chunk-2w3302dh.js +0 -3
- package/dist/chunk-2xen423s.js +0 -3
- package/dist/chunk-39gm08bn.js +0 -39
- package/dist/chunk-3bjtemm6.js +0 -128
- package/dist/chunk-3jm3snz8.js +0 -3
- package/dist/chunk-3ngm57nt.js +0 -12
- package/dist/chunk-3rh7va1z.js +0 -3
- package/dist/chunk-3yg9hbmb.js +0 -4
- package/dist/chunk-44hd3kab.js +0 -1
- package/dist/chunk-46mkpbkk.js +0 -12
- package/dist/chunk-48cw2nde.js +0 -2
- package/dist/chunk-48r3qe0k.js +0 -3
- package/dist/chunk-4aj7ftqb.js +0 -1
- package/dist/chunk-4bt81cg3.js +0 -61
- package/dist/chunk-4j188175.js +0 -3
- package/dist/chunk-4k7d8p8d.js +0 -188
- package/dist/chunk-4qq8ffke.js +0 -28
- package/dist/chunk-50vqeesm.js +0 -142
- package/dist/chunk-52agge4n.js +0 -38
- package/dist/chunk-55yp0q8t.js +0 -201
- package/dist/chunk-57p201gb.js +0 -83
- package/dist/chunk-5ggw1dyv.js +0 -3
- package/dist/chunk-5kt3ay7x.js +0 -10
- package/dist/chunk-5p568px4.js +0 -1166
- package/dist/chunk-5ppkfyn2.js +0 -3
- package/dist/chunk-5q87fgkk.js +0 -3
- package/dist/chunk-5qb761h2.js +0 -3
- package/dist/chunk-5xvbq2gs.js +0 -30
- package/dist/chunk-647849kf.js +0 -34
- package/dist/chunk-6b5k6w2q.js +0 -7
- package/dist/chunk-6cr3eeh4.js +0 -23
- package/dist/chunk-6djgb0hr.js +0 -3
- package/dist/chunk-6dqzky7x.js +0 -35
- package/dist/chunk-6e4c6g46.js +0 -3
- package/dist/chunk-6w03t7h6.js +0 -3
- package/dist/chunk-6wn85hn6.js +0 -4
- package/dist/chunk-6y4gqs1q.js +0 -169
- package/dist/chunk-75rndzbd.js +0 -6
- package/dist/chunk-77tga15w.js +0 -3
- package/dist/chunk-7a51hkpf.js +0 -3
- package/dist/chunk-7b0xdy5h.js +0 -386
- package/dist/chunk-7cgmq685.js +0 -33
- package/dist/chunk-7dy588as.js +0 -6
- package/dist/chunk-7rvh2wwv.js +0 -721
- package/dist/chunk-7sm05m0j.js +0 -351
- package/dist/chunk-7sqdeqsw.js +0 -1
- package/dist/chunk-7xcfy2fn.js +0 -4
- package/dist/chunk-82t27pvd.js +0 -5
- package/dist/chunk-87kx8byz.js +0 -1115
- package/dist/chunk-8fgwhhb8.js +0 -6
- package/dist/chunk-8qbax8xn.js +0 -347
- package/dist/chunk-91s2hres.js +0 -8
- package/dist/chunk-94g3cahw.js +0 -11
- package/dist/chunk-957amb71.js +0 -8
- package/dist/chunk-95w08s8v.js +0 -3
- package/dist/chunk-9agvhp1x.js +0 -93
- package/dist/chunk-9tmbrwwx.js +0 -219
- package/dist/chunk-9yz5d003.js +0 -51
- package/dist/chunk-a3hyn4we.js +0 -79
- package/dist/chunk-a69tvya5.js +0 -53
- package/dist/chunk-adjcg6wa.js +0 -498
- package/dist/chunk-adqh2m9z.js +0 -45
- package/dist/chunk-asarebzq.js +0 -292
- package/dist/chunk-aw3rp9ac.js +0 -24
- package/dist/chunk-b0cyc09a.js +0 -109
- package/dist/chunk-b3kkjcdh.js +0 -3
- package/dist/chunk-b3prs7y0.js +0 -5
- package/dist/chunk-b5zc9y0y.js +0 -90
- package/dist/chunk-baa7h4yz.js +0 -3
- package/dist/chunk-bgec9r1v.js +0 -5224
- package/dist/chunk-bjnjpsgn.js +0 -3
- package/dist/chunk-bk8ew8ze.js +0 -24
- package/dist/chunk-bn08k7yy.js +0 -3
- package/dist/chunk-bpgg59wa.js +0 -3
- package/dist/chunk-bwxda6n1.js +0 -3
- package/dist/chunk-bykjk6vj.js +0 -4
- package/dist/chunk-c53hyw5c.js +0 -477
- package/dist/chunk-c7jg8w13.js +0 -3
- package/dist/chunk-ca6qd1dx.js +0 -3
- package/dist/chunk-cdbwprfv.js +0 -6
- package/dist/chunk-ceg2c2q2.js +0 -11
- package/dist/chunk-cn409b69.js +0 -3
- package/dist/chunk-cn8az1b4.js +0 -1
- package/dist/chunk-cp3kwv17.js +0 -8
- package/dist/chunk-cpcc11vp.js +0 -5
- package/dist/chunk-cr3wbrcr.js +0 -10
- package/dist/chunk-cygfdk1n.js +0 -3
- package/dist/chunk-cyp4m0vh.js +0 -16
- package/dist/chunk-cz25azze.js +0 -4
- package/dist/chunk-d77yxcds.js +0 -3
- package/dist/chunk-dvfs1h3c.js +0 -117
- package/dist/chunk-dyjnn5k8.js +0 -262
- package/dist/chunk-dzw95th7.js +0 -3
- package/dist/chunk-e0zytzdh.js +0 -179
- package/dist/chunk-e53h9qhd.js +0 -84
- package/dist/chunk-eds0f8f1.js +0 -3
- package/dist/chunk-eh8hact1.js +0 -5
- package/dist/chunk-epj957jf.js +0 -4
- package/dist/chunk-eqeyaq6g.js +0 -77
- package/dist/chunk-fbxt2mrx.js +0 -5
- package/dist/chunk-fch9tk1k.js +0 -3
- package/dist/chunk-fe7r1mq1.js +0 -9
- package/dist/chunk-fhawx87n.js +0 -8
- package/dist/chunk-fk51yyrw.js +0 -3
- package/dist/chunk-fms20x0n.js +0 -21
- package/dist/chunk-fs0qezn5.js +0 -341
- package/dist/chunk-fzm3y0r3.js +0 -267
- package/dist/chunk-g2hekckm.js +0 -161
- package/dist/chunk-g4ps1dj8.js +0 -140
- package/dist/chunk-g8b81pzc.js +0 -3
- package/dist/chunk-ganag9dm.js +0 -3
- package/dist/chunk-gc84b1d2.js +0 -58
- package/dist/chunk-gcf5v18y.js +0 -60
- package/dist/chunk-ghrx0hn1.js +0 -4
- package/dist/chunk-gqpkp459.js +0 -3
- package/dist/chunk-h45py5w5.js +0 -2
- package/dist/chunk-h5wa62ek.js +0 -145
- package/dist/chunk-h82kjdr4.js +0 -83
- package/dist/chunk-haecq01c.js +0 -3
- package/dist/chunk-hepg894w.js +0 -3
- package/dist/chunk-hjdc99kb.js +0 -3
- package/dist/chunk-hje9v2zh.js +0 -3
- package/dist/chunk-hjv76kcw.js +0 -1
- package/dist/chunk-hke99a0v.js +0 -3
- package/dist/chunk-hpqr9e3x.js +0 -3
- package/dist/chunk-hq5cem49.js +0 -236
- package/dist/chunk-hrampcrj.js +0 -3
- package/dist/chunk-ht4j68cs.js +0 -3
- package/dist/chunk-hxx3za24.js +0 -62
- package/dist/chunk-j4s5qwd7.js +0 -4
- package/dist/chunk-jbejwejg.js +0 -8
- package/dist/chunk-jc0fc4ht.js +0 -11
- package/dist/chunk-jcs0ymw7.js +0 -3
- package/dist/chunk-jfm69keq.js +0 -231
- package/dist/chunk-jfrn43vh.js +0 -2
- package/dist/chunk-jjamhxpm.js +0 -139
- package/dist/chunk-jjvp4t5w.js +0 -27
- package/dist/chunk-jt44av4j.js +0 -3
- package/dist/chunk-jt98jhpt.js +0 -10
- package/dist/chunk-k8440jxh.js +0 -6
- package/dist/chunk-kdxa9epn.js +0 -21
- package/dist/chunk-kfd2hf6f.js +0 -3
- package/dist/chunk-kgym7ch9.js +0 -8
- package/dist/chunk-kh6rfz2v.js +0 -4
- package/dist/chunk-kkp6rs2n.js +0 -36
- package/dist/chunk-ktkmvaa8.js +0 -1
- package/dist/chunk-m59y310j.js +0 -3
- package/dist/chunk-mgmyr1b9.js +0 -6
- package/dist/chunk-mqwbpamc.js +0 -3
- package/dist/chunk-mrehzhxv.js +0 -5
- package/dist/chunk-mv03qb75.js +0 -3
- package/dist/chunk-mv4fb50w.js +0 -1
- package/dist/chunk-mwbng54r.js +0 -2
- package/dist/chunk-n46a5g1g.js +0 -3
- package/dist/chunk-n944baxp.js +0 -3
- package/dist/chunk-nanw7yhz.js +0 -14
- package/dist/chunk-nap11ntr.js +0 -21
- package/dist/chunk-ncnfa8ae.js +0 -29
- package/dist/chunk-ngxfwzq3.js +0 -3
- package/dist/chunk-nvwb4x04.js +0 -3
- package/dist/chunk-nw34xajc.js +0 -8
- package/dist/chunk-payfb24w.js +0 -207
- package/dist/chunk-pc31m5x5.js +0 -398
- package/dist/chunk-pg1fvqb9.js +0 -167
- package/dist/chunk-q60knhjf.js +0 -3
- package/dist/chunk-q6h6yvzb.js +0 -10
- package/dist/chunk-qd5461tt.js +0 -3
- package/dist/chunk-qdc3aav1.js +0 -3
- package/dist/chunk-qfwzdffx.js +0 -3
- package/dist/chunk-qgxwmagw.js +0 -134
- package/dist/chunk-qhdtssn1.js +0 -19
- package/dist/chunk-qk584whs.js +0 -3
- package/dist/chunk-qm4yppj5.js +0 -57
- package/dist/chunk-qwyd9a1d.js +0 -2
- package/dist/chunk-qxs6et76.js +0 -196
- package/dist/chunk-rb1e4cnb.js +0 -3
- package/dist/chunk-rh80q1nd.js +0 -1
- package/dist/chunk-rkffm9sy.js +0 -128
- package/dist/chunk-rv002yn0.js +0 -14
- package/dist/chunk-s6ja2bdg.js +0 -66
- package/dist/chunk-sjagg9qz.js +0 -66
- package/dist/chunk-sn07azv3.js +0 -3
- package/dist/chunk-svahbw0w.js +0 -12
- package/dist/chunk-svhtdb0s.js +0 -6
- package/dist/chunk-t37dp99j.js +0 -3
- package/dist/chunk-tj6zfxeb.js +0 -64
- package/dist/chunk-tmgz5t2g.js +0 -3
- package/dist/chunk-tr0z0e1g.js +0 -3
- package/dist/chunk-tx6br9r4.js +0 -274
- package/dist/chunk-v97390pe.js +0 -1
- package/dist/chunk-vcr5pzpx.js +0 -233
- package/dist/chunk-vdfwv0fp.js +0 -6
- package/dist/chunk-vp2395eb.js +0 -3
- package/dist/chunk-vpe6napb.js +0 -28
- package/dist/chunk-vv9wfz1c.js +0 -12
- package/dist/chunk-vw6ejgmy.js +0 -21
- package/dist/chunk-vx22he47.js +0 -1
- package/dist/chunk-w01y57f5.js +0 -1539
- package/dist/chunk-w21mwxdd.js +0 -4
- package/dist/chunk-w4n8fqp7.js +0 -216
- package/dist/chunk-w959hm8j.js +0 -358
- package/dist/chunk-wf7zrjsw.js +0 -138
- package/dist/chunk-wk07pwtd.js +0 -321
- package/dist/chunk-wvef3ngh.js +0 -127
- package/dist/chunk-wxvyj65q.js +0 -2
- package/dist/chunk-x1hjv24z.js +0 -11
- package/dist/chunk-x39sfpvm.js +0 -302
- package/dist/chunk-x4fze3q2.js +0 -314
- package/dist/chunk-x64kb787.js +0 -15
- package/dist/chunk-xcb0pbr6.js +0 -4
- package/dist/chunk-xhkjhxsp.js +0 -3
- package/dist/chunk-xhnpsngj.js +0 -5
- package/dist/chunk-xsqbk4yk.js +0 -3
- package/dist/chunk-xygc53vr.js +0 -68
- package/dist/chunk-y0qg6rrv.js +0 -3
- package/dist/chunk-y25pr13j.js +0 -19
- package/dist/chunk-y4c744dk.js +0 -3
- package/dist/chunk-y4md9hp0.js +0 -3
- package/dist/chunk-y5wazw6j.js +0 -7
- package/dist/chunk-y5xz0jc4.js +0 -141
- package/dist/chunk-y86m1wr4.js +0 -4
- package/dist/chunk-yaan98dd.js +0 -3
- package/dist/chunk-yach037f.js +0 -32
- package/dist/chunk-yexjrg9d.js +0 -7
- package/dist/chunk-ygvyc6wv.js +0 -90
- package/dist/chunk-yj560gp8.js +0 -8
- package/dist/chunk-yn38c15w.js +0 -4
- package/dist/chunk-yr1gdceh.js +0 -3
- package/dist/chunk-yw2fzq86.js +0 -3
- package/dist/chunk-ywkrxp2h.js +0 -147
- package/dist/chunk-z37xq5rx.js +0 -3
- package/dist/chunk-z4djtgt0.js +0 -71
- package/dist/chunk-z8cjr9n9.js +0 -7
- package/dist/chunk-znxp3zha.js +0 -71
- package/dist/chunk-zt2yag10.js +0 -429
package/dist/chunk-cpcc11vp.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Tw as g}from"./chunk-qdc3aav1.js";function A(){console.log(`
|
|
3
|
-
Keyboard shortcuts:`),console.log(` ${g.cyan}o${g.reset} + Enter - Open in browser`),console.log(` ${g.cyan}c${g.reset} + Enter - Clear console`),console.log(` ${g.cyan}q${g.reset} + Enter (or ${g.cyan}Ctrl+C${g.reset}) - Quit server`),console.log(` ${g.cyan}h${g.reset} + Enter - Show this help`)}function F(q){console.log(`${g.green}Server running at ${g.cyan}${q}${g.reset}`),console.log(`Press ${g.cyan}Ctrl+C${g.reset} to stop the server`),A()}function G(q){console.log(`${g.dim}Opening ${g.cyan}${q}${g.dim} in your browser...${g.reset}`),Bun.spawn(["open",q],{stderr:"inherit"})}function L(q,x,z){if(!process.stdin.isTTY)return;process.stdin.setRawMode(!0),process.stdin.setEncoding("utf8"),process.stdin.resume(),A();let j="";process.stdin.on("data",(D)=>{if(D==="\x03"){if(z?.onQuit)z.onQuit();x(),process.exit(0)}if(j+=D,j.endsWith("\r")||j.endsWith(`
|
|
4
|
-
`)){let E=j.trim().toLowerCase();j="",J(E,q,x,z)}})}function J(q,x,z,j){switch(q){case"o":if(j?.onOpen)j.onOpen();else G(x);break;case"c":if(j?.onClear)j.onClear();else console.clear(),F(x);break;case"q":if(j?.onQuit)j.onQuit();console.log(`${g.yellow}Stopping server...${g.reset}`),z(),process.exit(0);break;case"h":if(j?.onHelp)j.onHelp();else A();break;default:break}}function M(){if(process.stdin.isTTY)process.stdin.setRawMode(!1),process.stdin.pause()}
|
|
5
|
-
export{A as to,F as uo,G as vo,L as wo,M as xo};
|
package/dist/chunk-cr3wbrcr.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ls as m,Zr as C}from"./chunk-w01y57f5.js";import{et as x}from"./chunk-nap11ntr.js";import{rB as c}from"./chunk-3jm3snz8.js";var{serve:h}=globalThis.Bun;import K from"fs";import $ from"path";function jj(W,Z=200,G={}){return new Response(W,{status:Z,headers:{"Content-Type":"text/html; charset=utf-8",...G}})}async function i(W={}){let{port:Z=3000,root:G=".",stxOptions:E={},watch:v=!0,onRequest:V,routes:N={},middleware:D=[],on404:T,onError:g}=W,F=$.resolve(G),X=new Map;async function O(A){let B=K.statSync(A),L=`${A}:${B.mtimeMs}`,z=X.get(L);if(z)return z.content;for(let J of X.keys())if(J.startsWith(`${A}:`)&&J!==L)X.delete(J);let j=await Bun.file(A).text(),Q=j,H=j.match(/<template\b(?![^>]*(?:\b(?:id|x-for|x-if|@for|@if|:for|:if)\s*=|\s#[\w-]|\bv-slot|\bslot\s*=))[^>]*>/i);if(H&&H.index!==void 0){let J=H.index+H[0].length,U=1,_=J;while(_<j.length&&U>0){let R=j.indexOf("<template",_),k=j.indexOf("</template>",_);if(k===-1)break;if(R!==-1&&R<k)U++,_=R+9;else{if(U--,U===0){Q=j.substring(J,k).trim();break}_=k+11}}}let y=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,b=[],d=[],I;while((I=y.exec(j))!==null){let J=I[1],U=I[2],_=I[0];if(J.includes("server"))d.push(U);else b.push(_)}let P=j.match(/<style\b[^>]*>[\s\S]*?<\/style>/gi)||[],p=Q.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,""),M={__filename:A,__dirname:$.dirname(A)};for(let J of d)await x(J,M,A);let Y=await m(p,M,A,E,new Set);if(P.length>0){let J=P.join(`
|
|
3
|
-
`);if(Y.match(/(<\/head>)/i))Y=Y.replace(/(<\/head>)/i,`${J}
|
|
4
|
-
$1`)}if(b.length>0){let{interpolateScriptsInTemplate:J}=await import("././expressions.js"),U=J(b.join(`
|
|
5
|
-
`),M);if(Y.match(/(<\/body>)/i))Y=Y.replace(/(<\/body>)/i,`${U}
|
|
6
|
-
$1`);else Y+=`
|
|
7
|
-
${U}`}return X.set(L,{content:Y,mtime:B.mtimeMs}),Y}async function w(A){let B=K.statSync(A),L=`${A}:${B.mtimeMs}`,z=X.get(L);if(z)return z.content;let{content:j}=await C(A,E);return X.set(L,{content:j,mtime:B.mtimeMs}),j}function u(A){let B=A.startsWith("/")?A.slice(1):A,L=[B,`${B}.stx`,`${B}.md`,`${B}.html`,$.join(B,"index.stx"),$.join(B,"index.md"),$.join(B,"index.html")];for(let z of L){let j=$.join(F,z);if(K.existsSync(j)&&K.statSync(j).isFile())return j}return null}async function f(A){let B=new URL(A.url),L=async()=>{if(N[B.pathname])return await N[B.pathname](A);if(V){let j=await V(A);if(j)return j}let z=u(B.pathname);if(!z){if(T)return await T(A);return new Response("Not Found",{status:404})}try{let j,Q="text/html";if(z.endsWith(".stx"))j=await O(z);else if(z.endsWith(".md"))j=await w(z);else if(z.endsWith(".html"))j=await Bun.file(z).text();else if(z.endsWith(".css"))j=await Bun.file(z).text(),Q="text/css";else if(z.endsWith(".js"))j=await Bun.file(z).text(),Q="text/javascript";else if(z.endsWith(".json"))j=await Bun.file(z).text(),Q="application/json";else return new Response(Bun.file(z));return new Response(j,{headers:{"Content-Type":Q}})}catch(j){if(g)return await g(j,A);let Q=j instanceof Error?j.message:String(j),y=E?.debug===!0?`<h1>Error</h1><pre>${Q}
|
|
8
|
-
${j instanceof Error?j.stack:""}</pre>`:"<h1>Internal Server Error</h1><p>An error occurred while processing your request.</p>";return new Response(y,{status:500,headers:{"Content-Type":"text/html"}})}};for(let z=D.length-1;z>=0;z--){let j=D[z],Q=L;L=async()=>await j(A,Q)}return await L()}let S=h({port:Z,fetch:f}),q=null;if(v)q=K.watch(F,{recursive:!0},(A,B)=>{if(B&&(B.endsWith(".stx")||B.endsWith(".md")||B.endsWith(".html")))X.clear()});return{server:S,url:S.url.toString(),stop(){if(q)q.close();S.stop()}}}async function zj(W,Z={}){let G=$.resolve(W);if(!await Bun.file(G).exists())throw Error(`File not found: ${G}`);let E=G.endsWith(".md"),v=G.endsWith(".stx");if(!E&&!v)throw Error(`Unsupported file type: ${G}. Only .stx and .md files are supported.`);return await i({...Z,root:$.dirname(G),routes:{"/":async()=>{let V;if(E){let{content:N}=await C(G,Z.stxOptions);V=N}else{let N=await Bun.file(G).text(),D=[],T=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,g;while((g=T.exec(N))!==null)if(g[1].includes("server"))D.push(g[2]);let F=D.join(`
|
|
9
|
-
`),X=N.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),O={};if(F.trim())await x(F,O,G);let w=new Set;V=await m(X,O,G,Z.stxOptions||{},w)}return new Response(V,{headers:{"Content-Type":"text/html"}})},...Z.routes}})}function Aj(W){return W}function Bj(W){return W}
|
|
10
|
-
export{jj as gh,i as hh,zj as ih,Aj as jh,Bj as kh};
|
package/dist/chunk-cygfdk1n.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{rB as l}from"./chunk-3jm3snz8.js";import U from"fs";import G from"path";import I from"os";import H from"crypto";import{generatePlaceholder as m,processImage as g}from"ts-images";var d=[320,640,768,1024,1280,1536,1920],h=["webp","jpeg"],b=80,u=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],P={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},N=null,W=!1;async function Y(){if(W)return N;W=!0;try{let J=await import("sharp");return N=J.default||J,N}catch{return null}}async function e(){return await Y()!==null}async function t(){return!0}async function JJ(J,K={}){let{widths:Z=d,formats:$=h,quality:q=b,fit:C="cover",placeholder:X="none",outputDir:Q=".stx/images",baseUrl:_="/images"}=K,j,x;if(typeof J==="string"){if(x=J,!await Bun.file(J).exists())throw new L(`Image not found: ${J}`,"NOT_FOUND");j=await Bun.file(J).arrayBuffer().then((V)=>Buffer.from(V))}else x="buffer-input",j=J;let w=H.createHash("sha256").update(j).digest("hex").slice(0,12),y=await O(j),{width:B,height:D}=y,A=B/D;await U.promises.mkdir(Q,{recursive:!0});let T=[],v=G.basename(x,G.extname(x)),z=Z.filter((V)=>V<=B);if(!z.includes(B)&&B<=Math.max(...Z))z.push(B);z.sort((V,R)=>V-R);for(let V of z){let R=Math.round(V/A);for(let F of $){let S=`${v}-${V}w-${w}.${F}`,k=G.join(Q,S),c=`${_}/${S}`,E=await n(j,{width:V,height:R,format:F,quality:q,fit:C});await Bun.write(k,E),T.push({path:k,url:c,width:V,height:R,format:F,size:E.length})}}let M;if(X!=="none")M=await o(j,X);return{src:x,variants:T,placeholder:M,width:B,height:D,aspectRatio:A,hash:w}}async function O(J){let K=typeof J==="string"?Buffer.from(await Bun.file(J).arrayBuffer()):J,Z=await Y();if(Z){let q=await Z(K).metadata();return{width:q.width||0,height:q.height||0,format:q.format||"unknown",hasAlpha:q.hasAlpha}}return p(K)}function p(J){if(J[0]===137&&J[1]===80&&J[2]===78&&J[3]===71){let K=J.readUInt32BE(16),Z=J.readUInt32BE(20);return{width:K,height:Z,format:"png",hasAlpha:!0}}if(J[0]===255&&J[1]===216){let K=2;while(K<J.length){if(J[K]!==255)break;let Z=J[K+1];if(Z>=192&&Z<=207&&Z!==196&&Z!==200&&Z!==204){let q=J.readUInt16BE(K+5);return{width:J.readUInt16BE(K+7),height:q,format:"jpeg",hasAlpha:!1}}let $=J.readUInt16BE(K+2);K+=2+$}}if(J.toString("utf8",0,4)==="RIFF"&&J.toString("utf8",8,12)==="WEBP"){let K=J.toString("utf8",12,16);if(K==="VP8 "){let Z=J.readUInt16LE(26)&16383,$=J.readUInt16LE(28)&16383;return{width:Z,height:$,format:"webp",hasAlpha:!1}}if(K==="VP8L"){let Z=J.readUInt32LE(21),$=(Z&16383)+1,q=(Z>>14&16383)+1;return{width:$,height:q,format:"webp",hasAlpha:!0}}}if(J.toString("utf8",0,3)==="GIF"){let K=J.readUInt16LE(6),Z=J.readUInt16LE(8);return{width:K,height:Z,format:"gif",hasAlpha:!0}}throw new L("Unable to parse image dimensions","PARSE_ERROR")}async function n(J,K){let Z=await Y();if(Z){let q=Z(J).resize(K.width,K.height,{fit:K.fit});switch(K.format){case"webp":q=q.webp({quality:K.quality});break;case"avif":q=q.avif({quality:K.quality});break;case"jpeg":q=q.jpeg({quality:K.quality});break;case"png":q=q.png({quality:K.quality});break}return q.toBuffer()}let $=G.join(I.tmpdir(),`stx-img-${H.randomBytes(8).toString("hex")}.${K.format}`);try{return await g({input:J,output:$,format:K.format,quality:K.quality,resize:{width:K.width,height:K.height,fit:K.fit}}),Buffer.from(await Bun.file($).arrayBuffer())}finally{await U.promises.unlink($).catch(()=>{})}}async function o(J,K){let Z=await Y();if(K==="blur"&&Z){let X=(await Z(J).resize(20).blur(10).toBuffer()).toString("base64"),Q=await O(J);return`data:${P[Q.format]||"image/jpeg"};base64,${X}`}if(K==="dominant-color"&&Z){let{dominant:C}=await Z(J).resize(1,1).toBuffer().then(async(X)=>{let Q=await Z(X).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${C.r}, ${C.g}, ${C.b})`}let $=await O(J),q=G.join(I.tmpdir(),`stx-ph-${H.randomBytes(8).toString("hex")}.${$.format==="unknown"?"bin":$.format}`);try{await Bun.write(q,J);let C=K==="blur"?"blur":K==="thumbhash"?"thumbhash":"dominant-color",Q=await m(q,{strategy:C,width:C==="thumbhash"?void 0:32});if(K==="dominant-color"&&Q.dominantColor)return Q.dominantColor;if(Q.dataURL)return Q.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{await U.promises.unlink(q).catch(()=>{})}}function KJ(J,K){return(K?J.filter(($)=>$.format===K):J).sort(($,q)=>$.width-q.width).map(($)=>`${$.url} ${$.width}w`).join(", ")}function ZJ(J){if(!J||Object.keys(J).length===0)return"100vw";return Object.entries(J).sort((Z,$)=>{let q=Number.parseInt(Z[0].replace(/\D/g,""))||0;return(Number.parseInt($[0].replace(/\D/g,""))||0)-q}).map(([Z,$])=>`(max-width: ${Z}) ${$}`).join(", ")+", 100vw"}function $J(J){let K=J.filter(($)=>$.format==="jpeg");if(K.length===0)return J[Math.floor(J.length/2)];let Z=K.sort(($,q)=>$.width-q.width);return Z[Math.floor(Z.length/2)]}function qJ(J){let K=new Map;for(let Z of J){let $=K.get(Z.format)||[];$.push(Z),K.set(Z.format,$)}return K}function CJ(J){let K=G.extname(J).toLowerCase();return u.includes(K)}function QJ(J){return P[J]||"application/octet-stream"}function VJ(J){return J.reduce((K,Z)=>K+Z.size,0)}function XJ(J){if(J<1024)return`${J} B`;if(J<1048576)return`${(J/1024).toFixed(1)} KB`;return`${(J/1048576).toFixed(2)} MB`}class L extends Error{code;constructor(J,K){super(J);this.name="ImageProcessingError",this.code=K}}
|
|
3
|
-
export{d as Jm,h as Km,b as Lm,e as Mm,t as Nm,JJ as Om,O as Pm,n as Qm,KJ as Rm,ZJ as Sm,$J as Tm,qJ as Um,CJ as Vm,QJ as Wm,VJ as Xm,XJ as Ym,L as Zm};
|
package/dist/chunk-cyp4m0vh.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var E={treeShake:!0,deadCodeElimination:!0,constantFolding:!0,stringPooling:!1,minifyHtml:!0,removeDevCode:!0,constants:{},preserveDirectives:[],target:"production"},L=["if","else","elseif","endif","unless","endunless","switch","case","default","endswitch","for","endfor","foreach","endforeach","forelse","endforelse","while","endwhile","break","continue","empty","extends","section","endsection","yield","parent","include","includeIf","includeWhen","includeFirst","once","endonce","push","endpush","prepend","endprepend","stack","component","endcomponent","slot","endslot","props","auth","endauth","guest","endguest","can","endcan","cannot","endcannot","role","endrole","hasRole","endhasRole","hasAnyRole","endhasAnyRole","csrf","method","error","enderror","old","input","textarea","select","checkbox","radio","file","translate","lang","choice","meta","title","seo","jsonld","canonical","robots","sitemap","ts","endts","js","endjs","css","endcss","markdown","endmarkdown","verbatim","endverbatim","env","production","debug","isset","endisset","empty","endempty"];function A(K){let j=new Map,J=/@(\w+)/g,Q,q=1,G=0;while((Q=J.exec(K))!==null){let W=Q[1],Y=K.slice(G,Q.index);q+=(Y.match(/\n/g)||[]).length,G=Q.index;let $=Q.index-K.lastIndexOf(`
|
|
3
|
-
`,Q.index-1);if(L.includes(W)){let X=j.get(W);if(X)X.count++,X.locations.push({line:q,column:$});else j.set(W,{name:W,count:1,locations:[{line:q,column:$}]})}}return Array.from(j.values())}function T(K,j=[]){let J=A(K),Q=new Set(J.map((q)=>q.name));for(let q of j)Q.add(q);for(let q of Array.from(Q))if(!q.startsWith("end"))Q.add(`end${q}`);return L.filter((q)=>!Q.has(q))}function U(K){let j=[],J={conditionals:["if","else","elseif","endif","unless","endunless","switch","case","default","endswitch","isset","endisset"],loops:["for","endfor","foreach","endforeach","forelse","endforelse","while","endwhile","break","continue","empty"],includes:["include","includeIf","includeWhen","includeFirst","once","endonce","extends","section","endsection","yield","parent","push","endpush","prepend","endprepend","stack"],components:["component","endcomponent","slot","endslot","props"],auth:["auth","endauth","guest","endguest","can","endcan","cannot","endcannot","role","endrole","hasRole","endhasRole","hasAnyRole","endhasAnyRole"],forms:["csrf","method","error","enderror","old","input","textarea","select","checkbox","radio","file"],i18n:["translate","lang","choice"],seo:["meta","title","seo","jsonld","canonical","robots","sitemap"]},Q=new Set;for(let G of K)for(let[W,Y]of Object.entries(J))if(Y.includes(G)){Q.add(W);break}for(let G of Q)j.push(`import { process${C(G)} } from './${G}'`);let q=K.filter((G)=>!G.startsWith("end")).map((G)=>` '${G}': true`).join(`,
|
|
4
|
-
`);return`// Tree-shaken directive bundle
|
|
5
|
-
// Only includes: ${K.join(", ")}
|
|
6
|
-
${j.join(`
|
|
7
|
-
`)}
|
|
8
|
-
|
|
9
|
-
export const activeDirectives = {
|
|
10
|
-
${q}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function isDirectiveActive(name: string): boolean {
|
|
14
|
-
return name in activeDirectives
|
|
15
|
-
}
|
|
16
|
-
`}function k(K,j={}){let J=[],Q=/@if\(([^)]+)\)[\s\S]*?@endif/g,q=K.matchAll(Q);for(let X of q){let Z=X[1].trim();if(_(Z,j)===!1)J.push({start:X.index,end:X.index+X[0].length,reason:`@if condition always false: ${Z}`})}let G=/@unless\(([^)]+)\)[\s\S]*?@endunless/g,W=K.matchAll(G);for(let X of W){let Z=X[1].trim();if(_(Z,j)===!0)J.push({start:X.index,end:X.index+X[0].length,reason:`@unless condition always true: ${Z}`})}let Y=/@env\(['"]development['"]\)[\s\S]*?@endenv/g;if(j.__ENV__==="production"){let X=K.matchAll(Y);for(let Z of X)J.push({start:Z.index,end:Z.index+Z[0].length,reason:"Development-only code in production build"})}let $=/@debug[\s\S]*?@enddebug/g;if(j.__ENV__==="production"){let X=K.matchAll($);for(let Z of X)J.push({start:Z.index,end:Z.index+Z[0].length,reason:"Debug code in production build"})}return J}function I(K,j={}){let J=k(K,j),Q=[];J.sort((G,W)=>W.start-G.start);let q=K;for(let G of J)q=q.slice(0,G.start)+q.slice(G.end),Q.push(G.reason);return{content:q,removed:Q}}function _(K,j){if(K==="true")return!0;if(K==="false")return!1;if(K==="null")return null;if(/^\d+$/.test(K))return Number.parseInt(K,10);if(/^\d+\.\d+$/.test(K))return Number.parseFloat(K);if(/^['"].*['"]$/.test(K))return K.slice(1,-1);if(K in j)return j[K];let J=K.match(/^(\w+)\s*(===|!==|==|!=|>=|<=|>|<)\s*(.+)$/);if(J){let[,Q,q,G]=J,W=Q in j?j[Q]:void 0,Y=_(G,j);if(W!==void 0&&Y!==void 0)switch(q){case"==":case"===":return W===Y;case"!=":case"!==":return W!==Y;case">":return W>Y;case"<":return W<Y;case">=":return W>=Y;case"<=":return W<=Y}}return}function R(K,j){let J=[],Q=K;return Q=Q.replace(/\{\{\s*(\w+)\s*\}\}/g,(q,G)=>{if(G in j)return J.push(`{{ ${G} }} -> ${j[G]}`),String(j[G]);return q}),Q=Q.replace(/\{\{\s*(\d+)\s*([+\-*])\s*(\d+)\s*\}\}/g,(q,G,W,Y)=>{let $=Number.parseInt(G,10),X=Number.parseInt(Y,10),Z;switch(W){case"+":Z=$+X;break;case"-":Z=$-X;break;case"*":Z=$*X;break;default:return q}return J.push(`{{ ${G} ${W} ${Y} }} -> ${Z}`),String(Z)}),{content:Q,folded:J}}function M(K){let j=K,J=[],Q=0;j=j.replace(/<(pre|code|script|style)([^>]*)>([\s\S]*?)<\/\1>/gi,(q)=>{let G=`__PRESERVE_${Q++}__`;return J.push({marker:G,content:q}),G}),j=j.replace(/\{\{([\s\S]*?)\}\}/g,(q)=>{let G=`__PRESERVE_${Q++}__`;return J.push({marker:G,content:q}),G}),j=j.replace(/\{\{--([\s\S]*?)--\}\}/g,""),j=j.replace(/<!--[\s\S]*?-->/g,""),j=j.replace(/>\s+</g,"><"),j=j.replace(/^\s+/gm,""),j=j.replace(/\s+$/gm,""),j=j.replace(/\s{2,}/g," ");for(let{marker:q,content:G}of J){let W=j.indexOf(q);if(W!==-1)j=j.slice(0,W)+G+j.slice(W+q.length)}return j.trim()}function N(K){let j=new Map,J=new Map,Q=/(['"])([^'"]{10,})\1/g,q;while((q=Q.exec(K))!==null){let Y=q[2];J.set(Y,(J.get(Y)||0)+1)}let G=0,W=K;for(let[Y,$]of J)if($>1){let X=`__STR_${G++}__`;j.set(X,Y);let Z=Y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),F=new RegExp(`(['"])${Z}\\1`,"g");W=W.replace(F,X)}return{content:W,pool:j,count:j.size}}function b(K,j={}){let J={...E,...j},Q=new Blob([K]).size,q=K,G=[],W=[],Y=[],$=[],X=0;if(J.target==="production")J.constants={...J.constants,__ENV__:"production"};if(J.deadCodeElimination){let H=I(q,J.constants);if(q=H.content,H.removed.length>0)G.push("Dead code elimination"),W.push(...H.removed.map((y)=>`Removed: ${y}`))}if(J.constantFolding&&Object.keys(J.constants).length>0){let H=R(q,J.constants);if(q=H.content,$=H.folded,$.length>0)G.push("Constant folding")}if(J.treeShake){if(Y=T(q,J.preserveDirectives),Y.length>0)G.push("Tree shaking")}if(J.stringPooling){let H=N(q);if(q=H.content,X=H.count,X>0)G.push("String pooling")}if(J.minifyHtml){let H=M(q);if(H.length<q.length)q=H,G.push("HTML minification")}let Z=new Blob([q]).size,F=Q>0?Math.round((1-Z/Q)*100):0;return{content:q,originalSize:Q,optimizedSize:Z,reduction:F,appliedOptimizations:G,removedDirectives:Y,foldedConstants:$,pooledStrings:X,warnings:W}}async function B(K,j={}){let J={...E,...j},Q=new Map,q=[],G=0,W=0,Y=new Set;for(let[F,H]of K){let y=b(H,J);Q.set(F,y),G+=y.originalSize,W+=y.optimizedSize,q.push(...y.warnings.map((P)=>`${F}: ${P}`));let w=A(H);for(let P of w)Y.add(P.name)}let $;if(J.treeShake)$=U(Array.from(Y));let X;if(J.stringPooling)X=new Map;let Z=G>0?Math.round((1-W/G)*100):0;return{templates:Q,directiveBundle:$,stringPool:X,totalOriginalSize:G,totalOptimizedSize:W,overallReduction:Z,warnings:q}}function C(K){return K.charAt(0).toUpperCase()+K.slice(1)}export{A as rq,T as sq,U as tq,k as uq,I as vq,_ as wq,R as xq,M as yq,N as zq,b as Aq,B as Bq};
|
package/dist/chunk-cz25azze.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var H={1001:{message:"Unclosed directive: {{directive}}",help:"Make sure to close the directive with the appropriate end tag"},1002:{message:"Unclosed expression at position {{position}}",help:"Check for missing closing braces }}"},1003:{message:"Invalid directive syntax: {{directive}}",help:"Review the directive documentation for correct syntax"},1004:{message:"Malformed expression: {{expression}}",help:"Check for syntax errors in your expression"},1005:{message:"Unexpected token: {{token}}",help:"Remove or fix the unexpected token"},1101:{message:"Undefined variable: {{variable}}",help:"Make sure the variable is defined in the template context"},1102:{message:"Type error: {{details}}",help:"Check that you are using the correct types"},1103:{message:"Evaluation error: {{details}}",help:"Review the expression for errors"},1104:{message:"Infinite loop detected in {{location}}",help:"Check your loop conditions"},1105:{message:"Circular reference detected: {{path}}",help:"Remove the circular dependency"},1201:{message:"Unsafe expression blocked: {{expression}}",help:"This expression contains potentially dangerous code"},1202:{message:"Path traversal attempt blocked: {{path}}",help:"Use only relative paths within allowed directories"},1203:{message:"Potential XSS attempt blocked",help:"Sanitize user input before rendering"},1204:{message:"Code injection attempt blocked: {{code}}",help:"Avoid executing dynamic code"},1205:{message:"Prohibited DOM API usage: {{api}}",help:"Use STX.useRefs(), STX.useRef(), STX.el() and other STX helpers instead of direct DOM manipulation"},1301:{message:"File not found: {{path}}",help:"Check that the file exists and the path is correct"},1302:{message:"Error reading file: {{path}}",help:"Check file permissions and encoding"},1303:{message:"Invalid file path: {{path}}",help:"Use a valid file path"},1304:{message:"Permission denied: {{path}}",help:"Check file permissions"},1401:{message:"Invalid configuration: {{details}}",help:"Review your stx.config.ts file"},1402:{message:"Missing required configuration: {{key}}",help:"Add the required configuration option"},1403:{message:"Deprecated configuration: {{key}}",help:"Update to the new configuration format"},1501:{message:"Component not found: {{name}}",help:"Check that the component exists in your components directory"},1502:{message:"Invalid props for component {{name}}: {{details}}",help:"Check the component prop requirements"},1503:{message:"Error rendering component {{name}}: {{details}}",help:"Check the component template for errors"},1601:{message:"Filter not found: {{filter}}",help:"Register the filter or check the filter name"},1602:{message:"Invalid arguments for filter {{filter}}: {{details}}",help:"Check the filter documentation for correct arguments"},1603:{message:"Expression evaluation timed out",help:"Simplify the expression or increase the timeout"}},z={},D="en";function K(b){D=b}function N(){return D}function O(b){z={...z,...b}}function P(){z={}}function I(b,w={}){let j=z[b]||H[b]||{message:`Unknown error (code: ${b})`},q=j.message,x=j.help;for(let[F,A]of Object.entries(w)){let B=`{{${F}}}`;if(q=q.replace(new RegExp(B,"g"),A),x)x=x.replace(new RegExp(B,"g"),A)}return{message:q,help:x}}function Q(b,w={}){let{message:j,help:q}=I(b,w);return q?`${j}
|
|
3
|
-
Help: ${q}`:j}var J={UNCLOSED_DIRECTIVE:1001,UNCLOSED_EXPRESSION:1002,INVALID_DIRECTIVE_SYNTAX:1003,MALFORMED_EXPRESSION:1004,UNEXPECTED_TOKEN:1005,UNDEFINED_VARIABLE:1101,TYPE_ERROR:1102,EVALUATION_ERROR:1103,INFINITE_LOOP:1104,CIRCULAR_REFERENCE:1105,UNSAFE_EXPRESSION:1201,PATH_TRAVERSAL:1202,XSS_ATTEMPT:1203,CODE_INJECTION:1204,DOM_API_VIOLATION:1205,FILE_NOT_FOUND:1301,FILE_READ_ERROR:1302,INVALID_FILE_PATH:1303,PERMISSION_DENIED:1304,INVALID_CONFIG:1401,MISSING_REQUIRED_CONFIG:1402,DEPRECATED_CONFIG:1403,COMPONENT_NOT_FOUND:1501,INVALID_PROPS:1502,COMPONENT_RENDER_ERROR:1503,FILTER_NOT_FOUND:1601,INVALID_FILTER_ARGS:1602,EXPRESSION_TIMEOUT:1603};function R(b){for(let[w,j]of Object.entries(J))if(j===b)return w;return}
|
|
4
|
-
export{K as Ny,N as Oy,O as Py,P as Qy,I as Ry,Q as Sy,J as Ty,R as Uy};
|
package/dist/chunk-d77yxcds.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{yj as B,zj as M}from"./chunk-5xvbq2gs.js";import{Aj as w,Bj as x}from"./chunk-z37xq5rx.js";import{Ej as O,Fj as Q}from"./chunk-bn08k7yy.js";import{Sk as E,Xk as L}from"./chunk-5ggw1dyv.js";import{rB as v}from"./chunk-3jm3snz8.js";import{resolve as F,basename as D,extname as C,join as b}from"path";import{mkdir as q}from"fs/promises";async function T(){try{return await import("ts-videos")}catch{return null}}function R(J){switch(J){case"very-low":return 500000;case"low":return 1e6;case"medium":return 2500000;case"high":return 5000000;case"very-high":return 1e7;case"lossless":return 0;default:return 2500000}}function y(J){switch(J){case"youtube":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000};case"twitter":return{codec:"h264",maxWidth:1280,maxHeight:720,frameRate:30,bitrate:5000000,audioCodec:"aac",audioBitrate:128000};case"instagram-feed":return{codec:"h264",maxWidth:1080,maxHeight:1080,frameRate:30,bitrate:3500000,audioCodec:"aac",audioBitrate:128000};case"instagram-story":case"instagram-reels":return{codec:"h264",maxWidth:1080,maxHeight:1920,frameRate:30,bitrate:3500000,audioCodec:"aac",audioBitrate:128000};case"tiktok":return{codec:"h264",maxWidth:1080,maxHeight:1920,frameRate:30,bitrate:4000000,audioCodec:"aac",audioBitrate:128000};case"discord":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:60,bitrate:8000000,audioCodec:"aac",audioBitrate:192000};case"linkedin":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,bitrate:5000000,audioCodec:"aac",audioBitrate:128000};case"facebook":return{codec:"h264",maxWidth:1280,maxHeight:720,frameRate:30,bitrate:4000000,audioCodec:"aac",audioBitrate:128000};case"web-progressive":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000,twoPass:!0};case"web-streaming":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000};default:return{}}}async function V(J){let I=await T();if(!I)return null;try{let G=F(J),X=await new I.Input(G).getInfo();return{duration:X.duration||0,width:X.width||0,height:X.height||0,frameRate:X.frameRate||0,bitrate:X.bitrate||0,codec:X.videoCodec||"",audioCodec:X.audioCodec}}catch(G){return console.warn(`[stx-media] Failed to analyze video: ${G}`),null}}async function f(J,I,G,Y){let X=await T();if(!X)return console.warn("[stx-media] ts-videos not installed, skipping processing"),{src:J,processed:!1};let k=await O(J,I,G);if(k)return k;try{let K=F(J);if(!await L(K))return{src:J,processed:!1,errors:[`Source file not found: ${J}`]};let j=G.outputDir||"dist/videos",z=G.baseUrl||"/videos";await q(j,{recursive:!0});let A=await E(K),H=D(J,C(J)),N={src:J,processed:!0,hash:A};Y?.({percentage:5,stage:"analyzing"}),N.metadata=await V(K)||void 0;let _={};if(I.quality)_.bitrate=R(I.quality);if(I.platform)Object.assign(_,y(I.platform));if(I.transcode)Object.assign(_,I.transcode);if(Object.keys(_).length>0||I.process){Y?.({percentage:10,stage:"transcoding"});let W=`${H}-${A}.mp4`,Z=b(j,W);try{let $=await S(K,Z,_,X,(U)=>Y?.({percentage:10+U*0.5,stage:"transcoding"}));if($)N.transcoded={path:Z,url:`${z}/${W}`,duration:$.duration,size:$.size,video:{codec:_.codec||"h264",width:$.width,height:$.height,bitrate:$.bitrate,frameRate:$.frameRate},audio:$.audioCodec?{codec:_.audioCodec||"aac",bitrate:_.audioBitrate||128000,sampleRate:_.sampleRate||48000,channels:_.channels||2}:void 0}}catch($){N.errors=N.errors||[],N.errors.push(`Transcoding failed: ${$}`)}}if(I.generatePoster){Y?.({percentage:65,stage:"generating-poster"});let W=typeof I.generatePoster==="object"?I.generatePoster:{timestamp:0},Z=await w(K,W,j,z);if(Z)N.poster=Z}if(G.thumbnails?.enabled){Y?.({percentage:70,stage:"generating-thumbnails"});let W=await x(K,G.thumbnails,j,z);if(W.length>0)N.thumbnails=W}if(I.streaming){Y?.({percentage:80,stage:"generating-manifests"});let W=typeof I.streaming==="object"?I.streaming:G.streaming||{format:"hls"};if(W.format==="hls"||W.format===void 0){let Z=await B(K,W.qualities||G.streaming?.defaultQualities||[],j,z);if(Z)N.streaming={...N.streaming,hls:Z}}if(W.format==="dash"){let Z=await M(K,W.qualities||G.streaming?.defaultQualities||[],j,z);if(Z)N.streaming={...N.streaming,dash:Z}}}if(I.spriteSheet)Y?.({percentage:90,stage:"generating-sprite-sheet"});return Y?.({percentage:100,stage:"complete"}),await Q(J,I,N,G),N}catch(K){return{src:J,processed:!1,errors:[`Processing failed: ${K}`]}}}async function S(J,I,G,Y,X){try{let K=await new Y.Conversion(J,I,{videoCodec:G.codec,videoBitrate:G.bitrate,width:G.maxWidth,height:G.maxHeight,frameRate:G.frameRate,audioCodec:G.audioCodec,audioBitrate:G.audioBitrate,sampleRate:G.sampleRate,channels:G.channels}).run((j)=>{X?.(j.percentage/100)});return{duration:K.duration||0,size:K.size||0,width:K.width||G.maxWidth||0,height:K.height||G.maxHeight||0,bitrate:K.bitrate||G.bitrate||0,frameRate:K.frameRate||G.frameRate||30,audioCodec:K.audioCodec}}catch(k){return console.error(`[stx-media] Transcoding failed: ${k}`),null}}
|
|
3
|
-
export{V as vj,f as wj};
|
package/dist/chunk-dvfs1h3c.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Bb as J,Hb as L}from"./chunk-0jd0pndq.js";import{Sc as Y,Uc as Z,Xc as _,_c as $}from"./chunk-yn38c15w.js";import{fd as V}from"./chunk-bpgg59wa.js";import{jd as X}from"./chunk-y0qg6rrv.js";import{fe as P,ge as Q,he as U}from"./chunk-0qnz93q2.js";import k from"fs";import v from"path";async function I(A={}){let E=Date.now();Y();let j=await P({mode:"build"});if(!j.config.enabled){_("Story feature is disabled in config.");return}let w=await V(j);Q(j,w);let K=X(j.config,w);U(j,K),Z(w.length);let G=A.outDir??j.config.outDir,z=v.resolve(j.root,G);await k.promises.mkdir(z,{recursive:!0}),console.log(` Building to ${G}...`);let M=T(j);await k.promises.writeFile(v.join(z,"index.html"),M);let R={files:w.map((q)=>({id:q.id,fileName:q.fileName,relativePath:q.relativePath,treePath:q.treePath})),tree:K};await k.promises.writeFile(v.join(z,"stories.json"),JSON.stringify(R,null,2));let W={theme:j.config.theme,responsivePresets:j.config.responsivePresets,backgroundPresets:j.config.backgroundPresets};await k.promises.writeFile(v.join(z,"config.json"),JSON.stringify(W,null,2));let N=v.join(z,"stories");await k.promises.mkdir(N,{recursive:!0});for(let q of w){let g=await k.promises.readFile(q.path,"utf-8");await k.promises.writeFile(v.join(N,`${q.id}.stx`),g)}J(j);let B=L();await k.promises.writeFile(v.join(z,"search-index.json"),B);let H=Date.now()-E;$(w.length,G,H)}function T(A){let{theme:E}=A.config,j=E.title||"STX Story";return`<!DOCTYPE html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
-
<title>${j}</title>
|
|
8
|
-
<style>
|
|
9
|
-
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
10
|
-
:root {
|
|
11
|
-
--bg: #ffffff;
|
|
12
|
-
--bg-secondary: #f5f5f5;
|
|
13
|
-
--text: #333333;
|
|
14
|
-
--text-secondary: #666666;
|
|
15
|
-
--border: #e0e0e0;
|
|
16
|
-
--primary: #3b82f6;
|
|
17
|
-
}
|
|
18
|
-
.dark {
|
|
19
|
-
--bg: #1a1a1a;
|
|
20
|
-
--bg-secondary: #2a2a2a;
|
|
21
|
-
--text: #ffffff;
|
|
22
|
-
--text-secondary: #a0a0a0;
|
|
23
|
-
--border: #404040;
|
|
24
|
-
}
|
|
25
|
-
body {
|
|
26
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
27
|
-
background: var(--bg);
|
|
28
|
-
color: var(--text);
|
|
29
|
-
display: flex;
|
|
30
|
-
height: 100vh;
|
|
31
|
-
}
|
|
32
|
-
.sidebar {
|
|
33
|
-
width: 280px;
|
|
34
|
-
background: var(--bg-secondary);
|
|
35
|
-
border-right: 1px solid var(--border);
|
|
36
|
-
overflow-y: auto;
|
|
37
|
-
padding: 1rem;
|
|
38
|
-
}
|
|
39
|
-
.sidebar h1 {
|
|
40
|
-
font-size: 1.25rem;
|
|
41
|
-
margin-bottom: 1rem;
|
|
42
|
-
padding-bottom: 0.5rem;
|
|
43
|
-
border-bottom: 1px solid var(--border);
|
|
44
|
-
}
|
|
45
|
-
.story-list { list-style: none; }
|
|
46
|
-
.story-item {
|
|
47
|
-
padding: 0.5rem 0.75rem;
|
|
48
|
-
border-radius: 4px;
|
|
49
|
-
cursor: pointer;
|
|
50
|
-
margin-bottom: 2px;
|
|
51
|
-
}
|
|
52
|
-
.story-item:hover { background: var(--border); }
|
|
53
|
-
.story-item.active { background: var(--primary); color: white; }
|
|
54
|
-
.main { flex: 1; display: flex; flex-direction: column; }
|
|
55
|
-
.toolbar {
|
|
56
|
-
padding: 0.75rem 1rem;
|
|
57
|
-
border-bottom: 1px solid var(--border);
|
|
58
|
-
display: flex;
|
|
59
|
-
gap: 0.5rem;
|
|
60
|
-
}
|
|
61
|
-
.canvas { flex: 1; padding: 2rem; overflow: auto; }
|
|
62
|
-
.empty-state {
|
|
63
|
-
display: flex;
|
|
64
|
-
align-items: center;
|
|
65
|
-
justify-content: center;
|
|
66
|
-
height: 100%;
|
|
67
|
-
color: var(--text-secondary);
|
|
68
|
-
}
|
|
69
|
-
</style>
|
|
70
|
-
</head>
|
|
71
|
-
<body>
|
|
72
|
-
<aside class="sidebar">
|
|
73
|
-
<h1>\uD83D\uDCD6 ${j}</h1>
|
|
74
|
-
<ul class="story-list" id="story-list"></ul>
|
|
75
|
-
</aside>
|
|
76
|
-
<main class="main">
|
|
77
|
-
<div class="toolbar">
|
|
78
|
-
<button onclick="toggleTheme()">\uD83C\uDF13 Theme</button>
|
|
79
|
-
</div>
|
|
80
|
-
<div class="canvas" id="canvas">
|
|
81
|
-
<div class="empty-state">Select a story</div>
|
|
82
|
-
</div>
|
|
83
|
-
</main>
|
|
84
|
-
<script>
|
|
85
|
-
fetch('stories.json')
|
|
86
|
-
.then(r => r.json())
|
|
87
|
-
.then(data => {
|
|
88
|
-
const list = document.getElementById('story-list');
|
|
89
|
-
list.innerHTML = data.files.map(f =>
|
|
90
|
-
'<li class="story-item" onclick="selectStory(\\'' + f.id + '\\')">' + f.fileName + '</li>'
|
|
91
|
-
).join('');
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
function selectStory(id) {
|
|
95
|
-
document.querySelectorAll('.story-item').forEach(el => el.classList.remove('active'));
|
|
96
|
-
event.target.classList.add('active');
|
|
97
|
-
fetch('stories/' + id + '.stx')
|
|
98
|
-
.then(r => r.text())
|
|
99
|
-
.then(content => {
|
|
100
|
-
document.getElementById('canvas').innerHTML =
|
|
101
|
-
'<pre style="padding:1rem;overflow:auto;height:100%">' + escapeHtml(content) + '</pre>';
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function escapeHtml(t) {
|
|
106
|
-
const d = document.createElement('div');
|
|
107
|
-
d.textContent = t;
|
|
108
|
-
return d.innerHTML;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function toggleTheme() {
|
|
112
|
-
document.documentElement.classList.toggle('dark');
|
|
113
|
-
}
|
|
114
|
-
</script>
|
|
115
|
-
</body>
|
|
116
|
-
</html>`}var h=I;
|
|
117
|
-
export{I as zb,h as Ab};
|
package/dist/chunk-dyjnn5k8.js
DELETED
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{yw as y}from"./chunk-ywkrxp2h.js";import{rB as a}from"./chunk-3jm3snz8.js";function v(){return y({name:"video",hasEndTag:!1,description:"Render a video with optional ts-videos processing, streaming, and poster generation",transform:async(j,B,q,K)=>{let{src:Q,options:J}=d(j,B,q);if(!Q)return console.warn("@video directive: missing src argument"),"<!-- @video: missing src -->";let G={src:Q,poster:J.poster,controls:J.controls!==!1,autoplay:J.autoplay||!1,muted:J.muted||!1,loop:J.loop||!1,preload:J.preload||"metadata",playsinline:J.playsinline!==!1,lazy:J.lazy!==!1,player:J.player||"native",type:J.type,width:J.width,height:J.height,class:J.class,style:J.style,id:J.id,crossorigin:J.crossorigin,disablePictureInPicture:J.disablePictureInPicture,disableRemotePlayback:J.disableRemotePlayback,title:J.title,quality:J.quality,platform:J.platform,process:J.process,generatePoster:J.generatePoster,streaming:J.streaming,transcode:J.transcode,spriteSheet:J.spriteSheet,waveform:J.waveform},X={isDev:q.__isDev||!1,tsVideosConfig:q.__tsVideosConfig},Z=await b(G,X),k=Z.html;if(Z.css)k+=`
|
|
3
|
-
<style>${Z.css}</style>`;if(Z.script)k+=`
|
|
4
|
-
<script>${Z.script}</script>`;return k},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function d(j,B,q){if(B.src)return{src:String(B.src),options:B.options||{}};let K=j.trim();if(K.startsWith("@video(")||K.startsWith("("))K=K.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Q=i(K),J=A(Q[0],q)||"",G={};if(Q[1]){let H=A(Q[1],q);if(typeof H==="object"&&H!==null)G=H;else if(typeof Q[1]==="string")try{G=JSON.parse(Q[1])}catch{}}return{src:J,options:G}}function i(j){let B=[],q="",K=!1,Q="",J=0,G=0;for(let H=0;H<j.length;H++){let X=j[H],Z=H>0?j[H-1]:"";if((X==='"'||X==="'"||X==="`")&&Z!=="\\"){if(!K)K=!0,Q=X;else if(X===Q)K=!1,Q="";else q+=X;continue}if(!K){if(X==="{")J++;if(X==="}")J--;if(X==="[")G++;if(X==="]")G--;if(X===","&&J===0&&G===0){B.push(q.trim()),q="";continue}}q+=X}if(q.trim())B.push(q.trim());return B}function A(j,B){if(typeof j!=="string")return j;let q=j.trim();if(q.startsWith('"')&&q.endsWith('"')||q.startsWith("'")&&q.endsWith("'"))return q.slice(1,-1);if(!q.startsWith("/")&&!q.startsWith(".")&&!q.startsWith("http")&&!q.startsWith("{")){let K=B[q];if(K!==void 0)return K}if(q.startsWith("{")||q.startsWith("["))try{return JSON.parse(q)}catch{}return q}var c=v();async function g(){try{return await import("./media/video/processor/index.js")}catch(j){if(!x)console.warn("[stx-media] Video processor not available, some features disabled:",j),x=!0;return null}}var x=!1,h=!0,u="metadata",p="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function b(j,B={}){let q=B,K=j;if(K.process&&!K.skipProcessing){if(q.tsVideosConfig?.enabled&&!q.isDev)return e(K,q)}if(q.processedResult?.processed)return l(j,q.processedResult,B);let Q;if(K.generatePoster&&K.src&&!j.poster)Q=await jj(K,q);let{src:J,sources:G=[],poster:H,posterPlaceholder:X,controls:Z=h,autoplay:k=!1,muted:N=!1,loop:F=!1,preload:f=u,playsinline:O=!0,lazy:_=!0,player:R="native",type:w,width:W,height:z,crossorigin:U,disablePictureInPicture:E=!1,disableRemotePlayback:M=!1}=j,L=Q||H,D=j.class,P=j.style,C=j.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(R==="ts-video")return t(j,B);if(w&&w!=="video")return o(J||"",w,j);let I=G.length>0?G:J?[{src:J,type:m(J)}]:[],$=[`id="${C}"`];if(Z)$.push("controls");if(k)$.push("autoplay");if(N)$.push("muted");if(F)$.push("loop");if(O)$.push("playsinline");if(E)$.push("disablepictureinpicture");if(M)$.push("disableremoteplayback");if(U)$.push(`crossorigin="${U}"`);if(_){if($.push(`data-preload="${f}"`),$.push('preload="none"'),L)$.push(`data-poster="${Y(L)}"`);$.push("data-stx-lazy")}else if($.push(`preload="${f}"`),L)$.push(`poster="${Y(L)}"`);if(W)$.push(`width="${W}"`);if(z)$.push(`height="${z}"`);if(D)$.push(`class="${Y(D)}"`);if(P)$.push(`style="${Y(P)}"`);let T=I.map((V)=>{return` <source ${_?`data-src="${Y(V.src)}"`:`src="${Y(V.src)}"`} type="${V.type}"${V.media?` media="${V.media}"`:""} />`}).join(`
|
|
5
|
-
`),n=`<video ${$.join(" ")}>
|
|
6
|
-
${T}
|
|
7
|
-
Your browser does not support the video tag.
|
|
8
|
-
</video>`,S;if(_)S=`
|
|
9
|
-
(function() {
|
|
10
|
-
var video = document.getElementById('${C}');
|
|
11
|
-
if (!video) return;
|
|
12
|
-
|
|
13
|
-
var observer = new IntersectionObserver(function(entries) {
|
|
14
|
-
entries.forEach(function(entry) {
|
|
15
|
-
if (entry.isIntersecting) {
|
|
16
|
-
// Load poster
|
|
17
|
-
if (video.dataset.poster) {
|
|
18
|
-
video.poster = video.dataset.poster;
|
|
19
|
-
delete video.dataset.poster;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Load sources
|
|
23
|
-
var sources = video.querySelectorAll('source[data-src]');
|
|
24
|
-
sources.forEach(function(source) {
|
|
25
|
-
source.src = source.dataset.src;
|
|
26
|
-
delete source.dataset.src;
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
// Set preload
|
|
30
|
-
if (video.dataset.preload) {
|
|
31
|
-
video.preload = video.dataset.preload;
|
|
32
|
-
delete video.dataset.preload;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
video.load();
|
|
36
|
-
observer.disconnect();
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}, { rootMargin: '50px' });
|
|
40
|
-
|
|
41
|
-
observer.observe(video);
|
|
42
|
-
})();
|
|
43
|
-
`.trim();return{html:n,script:S}}function o(j,B,q){let{width:K=640,height:Q=360}=q,J=q.class,G=q.style,H=q.id||`stx-embed-${Math.random().toString(36).slice(2,8)}`,X,Z=null;switch(B){case"youtube":Z=s(j),X=Z?`https://www.youtube-nocookie.com/embed/${Z}`:j;break;case"vimeo":Z=r(j),X=Z?`https://player.vimeo.com/video/${Z}`:j;break;case"dailymotion":Z=j.split("/").pop()||"",X=`https://www.dailymotion.com/embed/video/${Z}`;break;case"twitch":Z=j.split("/").pop()||"",X=`https://player.twitch.tv/?video=${Z}&parent=${typeof window<"u"?window.location.hostname:"localhost"}`;break;default:X=j}let k=[`id="${H}"`,`src="${Y(X)}"`,`width="${K}"`,`height="${Q}"`,'frameborder="0"',"allowfullscreen",'allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"'];if(J)k.push(`class="${Y(J)}"`);if(G)k.push(`style="${Y(G)}"`);if(q.lazy)k.push('loading="lazy"');return{html:`<div class="stx-video-embed" style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
|
|
44
|
-
<iframe ${k.join(" ")} style="position:absolute;top:0;left:0;width:100%;height:100%;"></iframe>
|
|
45
|
-
</div>`}}function t(j,B={}){let{src:q,sources:K=[],poster:Q,controls:J=!0,autoplay:G=!1,muted:H=!1,loop:X=!1,preload:Z="metadata",playsinline:k=!0,lazy:N=!0,width:F,height:f}=j,O=j.class,_=j.style,R=j.id||`ts-video-${Math.random().toString(36).slice(2,8)}`,w={src:K.length>0?K:q,autoplay:G,loop:X,muted:H,playsinline:k,preload:Z,poster:Q,controls:J,title:j.title},W=["position: relative",F?`width: ${typeof F==="number"?F+"px":F}`:"width: 100%",f?`height: ${typeof f==="number"?f+"px":f}`:"",_||""].filter(Boolean).join("; "),z=`
|
|
46
|
-
<div
|
|
47
|
-
id="${R}"
|
|
48
|
-
class="ts-video-player${O?" "+Y(O):""}"
|
|
49
|
-
style="${W}"
|
|
50
|
-
data-ts-video-player
|
|
51
|
-
data-config='${JSON.stringify(w)}'
|
|
52
|
-
${N?"data-lazy":""}
|
|
53
|
-
>
|
|
54
|
-
<div class="ts-video-player__container">
|
|
55
|
-
${Q?`
|
|
56
|
-
<div class="ts-video-player__placeholder" style="background-image: url('${Y(Q)}');">
|
|
57
|
-
<button class="ts-video-player__play-button" aria-label="Play video">
|
|
58
|
-
<svg viewBox="0 0 24 24" fill="currentColor" width="64" height="64">
|
|
59
|
-
<path d="M8 5v14l11-7z"/>
|
|
60
|
-
</svg>
|
|
61
|
-
</button>
|
|
62
|
-
</div>
|
|
63
|
-
`:""}
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
`.trim(),U=`
|
|
67
|
-
(function() {
|
|
68
|
-
var container = document.getElementById('${R}');
|
|
69
|
-
if (!container) return;
|
|
70
|
-
|
|
71
|
-
var config = JSON.parse(container.dataset.config || '{}');
|
|
72
|
-
var isLazy = container.hasAttribute('data-lazy');
|
|
73
|
-
|
|
74
|
-
function loadPlayer() {
|
|
75
|
-
if (typeof TSVideoPlayer !== 'undefined') {
|
|
76
|
-
initPlayer();
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Load ts-video-player from CDN
|
|
81
|
-
var script = document.createElement('script');
|
|
82
|
-
script.src = '${p}';
|
|
83
|
-
script.onload = initPlayer;
|
|
84
|
-
script.onerror = function() {
|
|
85
|
-
console.error('[stx] Failed to load ts-video-player');
|
|
86
|
-
fallbackToNative();
|
|
87
|
-
};
|
|
88
|
-
document.head.appendChild(script);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function initPlayer() {
|
|
92
|
-
var player = TSVideoPlayer.createPlayer(container, config);
|
|
93
|
-
if (config.src) {
|
|
94
|
-
player.setSrc(config.src);
|
|
95
|
-
}
|
|
96
|
-
container.__tsVideoPlayer = player;
|
|
97
|
-
|
|
98
|
-
// Remove placeholder
|
|
99
|
-
var placeholder = container.querySelector('.ts-video-player__placeholder');
|
|
100
|
-
if (placeholder) {
|
|
101
|
-
placeholder.style.display = 'none';
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function fallbackToNative() {
|
|
106
|
-
// Fallback to native video element
|
|
107
|
-
var video = document.createElement('video');
|
|
108
|
-
video.controls = config.controls !== false;
|
|
109
|
-
video.autoplay = config.autoplay;
|
|
110
|
-
video.muted = config.muted;
|
|
111
|
-
video.loop = config.loop;
|
|
112
|
-
video.playsInline = config.playsinline;
|
|
113
|
-
video.preload = config.preload || 'metadata';
|
|
114
|
-
if (config.poster) video.poster = config.poster;
|
|
115
|
-
if (config.src) video.src = typeof config.src === 'string' ? config.src : config.src[0]?.src || config.src[0];
|
|
116
|
-
video.style.width = '100%';
|
|
117
|
-
video.style.height = '100%';
|
|
118
|
-
|
|
119
|
-
var containerEl = container.querySelector('.ts-video-player__container');
|
|
120
|
-
if (containerEl) {
|
|
121
|
-
containerEl.innerHTML = '';
|
|
122
|
-
containerEl.appendChild(video);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (isLazy) {
|
|
127
|
-
var observer = new IntersectionObserver(function(entries) {
|
|
128
|
-
entries.forEach(function(entry) {
|
|
129
|
-
if (entry.isIntersecting) {
|
|
130
|
-
loadPlayer();
|
|
131
|
-
observer.disconnect();
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
}, { rootMargin: '50px' });
|
|
135
|
-
observer.observe(container);
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
if (document.readyState === 'loading') {
|
|
139
|
-
document.addEventListener('DOMContentLoaded', loadPlayer);
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
loadPlayer();
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// Handle play button click
|
|
147
|
-
var playButton = container.querySelector('.ts-video-player__play-button');
|
|
148
|
-
if (playButton) {
|
|
149
|
-
playButton.addEventListener('click', function() {
|
|
150
|
-
loadPlayer();
|
|
151
|
-
var check = setInterval(function() {
|
|
152
|
-
if (container.__tsVideoPlayer && container.__tsVideoPlayer.ready) {
|
|
153
|
-
container.__tsVideoPlayer.play();
|
|
154
|
-
clearInterval(check);
|
|
155
|
-
}
|
|
156
|
-
}, 100);
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
})();
|
|
160
|
-
`.trim(),E=`
|
|
161
|
-
.ts-video-player {
|
|
162
|
-
position: relative;
|
|
163
|
-
background: #000;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.ts-video-player__container {
|
|
167
|
-
position: relative;
|
|
168
|
-
width: 100%;
|
|
169
|
-
padding-bottom: 56.25%;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.ts-video-player__container > * {
|
|
173
|
-
position: absolute;
|
|
174
|
-
top: 0;
|
|
175
|
-
left: 0;
|
|
176
|
-
width: 100%;
|
|
177
|
-
height: 100%;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.ts-video-player__placeholder {
|
|
181
|
-
display: flex;
|
|
182
|
-
align-items: center;
|
|
183
|
-
justify-content: center;
|
|
184
|
-
background-color: #1a1a1a;
|
|
185
|
-
background-size: cover;
|
|
186
|
-
background-position: center;
|
|
187
|
-
cursor: pointer;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.ts-video-player__play-button {
|
|
191
|
-
display: flex;
|
|
192
|
-
align-items: center;
|
|
193
|
-
justify-content: center;
|
|
194
|
-
width: 80px;
|
|
195
|
-
height: 80px;
|
|
196
|
-
background: rgba(0, 0, 0, 0.7);
|
|
197
|
-
border: none;
|
|
198
|
-
border-radius: 50%;
|
|
199
|
-
color: white;
|
|
200
|
-
cursor: pointer;
|
|
201
|
-
transition: transform 0.2s, background 0.2s;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.ts-video-player__play-button:hover {
|
|
205
|
-
transform: scale(1.1);
|
|
206
|
-
background: rgba(0, 0, 0, 0.9);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
.ts-video-player__play-button svg {
|
|
210
|
-
margin-left: 4px;
|
|
211
|
-
}
|
|
212
|
-
`.trim();return{html:z,script:U,css:E}}function m(j){switch(j.split(".").pop()?.toLowerCase()){case"mp4":return"video/mp4";case"webm":return"video/webm";case"ogg":case"ogv":return"video/ogg";case"mov":return"video/quicktime";case"avi":return"video/x-msvideo";case"mkv":return"video/x-matroska";case"m3u8":return"application/x-mpegURL";default:return"video/mp4"}}function s(j){let B=[/youtube\.com\/watch\?v=([^&]+)/,/youtube\.com\/embed\/([^?]+)/,/youtu\.be\/([^?]+)/,/youtube\.com\/v\/([^?]+)/];for(let q of B){let K=j.match(q);if(K)return K[1]}return null}function r(j){let B=j.match(/vimeo\.com\/(\d+)/);return B?B[1]:null}function Y(j){return j.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'")}function Qj(j,B,q){if(B.src)return{src:String(B.src),...B};let K=j.trim();if(K.startsWith("@video(")||K.startsWith("("))K=K.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Q=K.indexOf(",");if(Q===-1)return{src:K.replace(/^['"]|['"]$/g,"")};let J=K.slice(0,Q).trim().replace(/^['"]|['"]$/g,""),G=K.slice(Q+1).trim();try{let H=JSON.parse(G);return{src:J,...H}}catch{return{src:J}}}async function e(j,B){let q=await g();if(!q)return b({...j,process:!1},B);let K=B.tsVideosConfig,Q=await q.processVideo(j.src,j,K,j.onProcessProgress);if(Q.processed)return l(j,Q,B);return b({...j,process:!1},B)}async function jj(j,B){let q=await g();if(!q||!j.src)return;let K=typeof j.generatePoster==="object"?j.generatePoster:{timestamp:0},Q=B.tsVideosConfig||{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos"};return(await q.generatePoster(j.src,K,Q.outputDir,Q.baseUrl||"/videos"))?.url}function l(j,B,q){let{controls:K=h,autoplay:Q=!1,muted:J=!1,loop:G=!1,preload:H=u,playsinline:X=!0,lazy:Z=!0,width:k,height:N,crossorigin:F,disablePictureInPicture:f=!1,disableRemotePlayback:O=!1}=j,_=j.class,R=j.style,w=j.id||`stx-video-${Math.random().toString(36).slice(2,8)}`,W=j.src,z=m(W);if(B.transcoded)W=B.transcoded.url,z="video/mp4";let U=B.streaming?.hls||B.streaming?.dash;if(U){if(B.streaming?.hls)W=B.streaming.hls.manifestUrl,z="application/x-mpegURL";else if(B.streaming?.dash)W=B.streaming.dash.manifestUrl,z="application/dash+xml"}let E=B.poster?.url||j.poster,M=[`id="${w}"`];if(K)M.push("controls");if(Q)M.push("autoplay");if(J)M.push("muted");if(G)M.push("loop");if(X)M.push("playsinline");if(f)M.push("disablepictureinpicture");if(O)M.push("disableremoteplayback");if(F)M.push(`crossorigin="${F}"`);if(Z){if(M.push(`data-preload="${H}"`),M.push('preload="none"'),E)M.push(`data-poster="${Y(E)}"`);M.push("data-stx-lazy")}else if(M.push(`preload="${H}"`),E)M.push(`poster="${Y(E)}"`);let L=k||B.metadata?.width,D=N||B.metadata?.height;if(L)M.push(`width="${L}"`);if(D)M.push(`height="${D}"`);if(_)M.push(`class="${Y(_)}"`);if(R)M.push(`style="${Y(R)}"`);let C=` <source ${Z?`data-src="${Y(W)}"`:`src="${Y(W)}"`} type="${z}" />`,I=`<video ${M.join(" ")}>
|
|
213
|
-
${C}
|
|
214
|
-
Your browser does not support the video tag.
|
|
215
|
-
</video>`;if(B.spriteSheet)I=`<div class="stx-video-wrapper" data-sprite-sheet="${Y(B.spriteSheet.url)}" data-sprite-cols="${B.spriteSheet.columns}" data-sprite-interval="${B.spriteSheet.interval}">
|
|
216
|
-
${I}
|
|
217
|
-
</div>`;let $;if(Z)$=`
|
|
218
|
-
(function() {
|
|
219
|
-
var video = document.getElementById('${w}');
|
|
220
|
-
if (!video) return;
|
|
221
|
-
|
|
222
|
-
var observer = new IntersectionObserver(function(entries) {
|
|
223
|
-
entries.forEach(function(entry) {
|
|
224
|
-
if (entry.isIntersecting) {
|
|
225
|
-
// Load poster
|
|
226
|
-
if (video.dataset.poster) {
|
|
227
|
-
video.poster = video.dataset.poster;
|
|
228
|
-
delete video.dataset.poster;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
// Load sources
|
|
232
|
-
var sources = video.querySelectorAll('source[data-src]');
|
|
233
|
-
sources.forEach(function(source) {
|
|
234
|
-
source.src = source.dataset.src;
|
|
235
|
-
delete source.dataset.src;
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
// Set preload
|
|
239
|
-
if (video.dataset.preload) {
|
|
240
|
-
video.preload = video.dataset.preload;
|
|
241
|
-
delete video.dataset.preload;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
video.load();
|
|
245
|
-
observer.disconnect();
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
}, { rootMargin: '50px' });
|
|
249
|
-
|
|
250
|
-
observer.observe(video);
|
|
251
|
-
})();
|
|
252
|
-
`.trim();let T;if(U)T=`
|
|
253
|
-
.stx-video-wrapper {
|
|
254
|
-
position: relative;
|
|
255
|
-
width: 100%;
|
|
256
|
-
}
|
|
257
|
-
.stx-video-wrapper video {
|
|
258
|
-
width: 100%;
|
|
259
|
-
height: auto;
|
|
260
|
-
}
|
|
261
|
-
`.trim();return{html:I,script:$,css:T}}
|
|
262
|
-
export{b as pu,Qj as qu,v as ru,c as su};
|
package/dist/chunk-dzw95th7.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{iz as L}from"./chunk-3rh7va1z.js";import{rB as $}from"./chunk-3jm3snz8.js";import{existsSync as j,readFileSync as u}from"fs";var I=new Map;function q(E){try{return $.resolve(`@iconify/json/json/${E}.json`)}catch{}let G=process.cwd();for(let H of[`${G}/node_modules/@iconify/json/json/${E}.json`,`${G}/pantry/@iconify/json/json/${E}.json`])if(j(H))return H;return null}function D(E){if(I.has(E))return I.get(E);let G=q(E);if(!G)return null;try{let H=JSON.parse(u(G,"utf8"));return I.set(E,H.icons),H.icons}catch{return null}}async function R(E){if(I.has(E))return I.get(E);let G=q(E);if(!G)return null;try{let H=await Bun.file(G).json();return I.set(E,H.icons),H.icons}catch{return null}}function J(E,G){if(E.serverDynamic[G]!==void 0)return String(E.serverDynamic[G]);if(E.static[G]!==void 0)return String(E.static[G]);if(E.clientReactive[G]!==void 0)return E.clientReactive[G];return}var b={name:"Icon",aliases:["icon","stx-icon"],render(E,G,H){let M=J(E,"name")??J(E,"icon");if(!M)return"<!-- Icon: missing name/icon prop -->";let K="lucide",Q=M;if(M.includes(":")){let Z=M.split(":");K=Z[0],Q=Z[1]}let U=L(J(E,"size")||"24"),V=L(J(E,"color")||"currentColor"),W=L(J(E,"class")||""),X=L(J(E,"style")||""),Y=I.get(K)??D(K);if(!Y)return`<!-- Icon: collection "${K}" not loaded -->`;let O=Y[Q];if(!O)return`<!-- Icon: "${Q}" not found in ${K} -->`;let B=O.width||24,F=O.height||24,z=`0 0 ${B} ${F}`,T=O.body;if(V!=="currentColor")T=T.replace(/currentColor/g,V);let S=W?` class="${W}"`:"",g=X?` style="${X}"`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${U}" height="${U}" viewBox="${z}" fill="none"${S}${g}>${T}</svg>`}};async function A(E="lucide"){await R(E)}
|
|
3
|
-
export{b as fz,A as gz};
|