@vfrey/vfrey 0.0.1 → 1.0.0-beta.1
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/LICENSE +33 -0
- package/README.md +78 -3
- package/accounts.example.json +61 -0
- package/accounts.first-run.json +41 -0
- package/bin/vfrey.mjs +36 -0
- package/integration-tools/README.md +43 -0
- package/integration-tools/image/pillow.md +32 -0
- package/integration-tools/image/playwright.md +33 -0
- package/integration-tools/image/resvg.md +36 -0
- package/integration-tools/image/satori.md +36 -0
- package/integration-tools/image/sharp.md +38 -0
- package/integration-tools/video/blender.md +34 -0
- package/integration-tools/video/ffmpeg.md +41 -0
- package/integration-tools/video/manim.md +37 -0
- package/integration-tools/video/motion-canvas.md +37 -0
- package/integration-tools/video/remotion.md +50 -0
- package/integration-tools/video/revideo.md +32 -0
- package/package.json +74 -6
- package/skills/vfrey-orchestrator/SKILL.md +15 -0
- package/skills/vfrey-orchestrator/channel-video/SKILL.md +41 -0
- package/skills/vfrey-product/SKILL.md +63 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/framey/cook-one.svg +14 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/framey/cook-two.svg +22 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/framey/index.html +70 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/remotion/cook-one.svg +14 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/remotion/cook-two.svg +22 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/remotion/index.tsx +49 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/script.json +15 -0
- package/skills/vfrey-product/examples/octopus-facts/index.html +60 -0
- package/skills/vfrey-product/examples/octopus-facts/octopus.svg +8 -0
- package/skills/vfrey-product/examples/octopus-facts/script.json +14 -0
- package/skills/vfrey-product/push/SKILL.md +15 -0
- package/skills/vfrey-product/scenes/NOTICE +5 -0
- package/skills/vfrey-product/scenes/blocks.md +57 -0
- package/skills/vfrey-product/scenes/craft.md +118 -0
- package/skills/vfrey-product/scenes/motion.md +88 -0
- package/src/analytics/dashboard.ts +109 -0
- package/src/analytics/index.ts +260 -0
- package/src/api/client.ts +361 -0
- package/src/api/cloud-files.ts +197 -0
- package/src/api/cloud-runs.ts +75 -0
- package/src/api/cloud.ts +413 -0
- package/src/api/commands.ts +330 -0
- package/src/api/config.ts +34 -0
- package/src/api/creators.ts +463 -0
- package/src/api/credentials.ts +152 -0
- package/src/api/mail.ts +333 -0
- package/src/api/topics.ts +207 -0
- package/src/api/types.ts +273 -0
- package/src/cli.ts +468 -0
- package/src/cloud/bundle.ts +70 -0
- package/src/cloud/cloudrun-executor.ts +237 -0
- package/src/cloud/executor.ts +281 -0
- package/src/cloud/gcs-sign.ts +76 -0
- package/src/cloud/job.ts +106 -0
- package/src/cloud/remote-job.ts +67 -0
- package/src/cloud/render-job.ts +191 -0
- package/src/config.ts +309 -0
- package/src/dashboard-link.ts +180 -0
- package/src/dashboard-start.ts +103 -0
- package/src/desk/channel.ts +64 -0
- package/src/desk/cli.ts +216 -0
- package/src/desk/creators-route.ts +129 -0
- package/src/desk/fonts/JetBrainsMono-OFL.txt +93 -0
- package/src/desk/fonts/google-sans-flex-latin.woff2 +0 -0
- package/src/desk/fonts/jetbrains-mono-medium.woff2 +0 -0
- package/src/desk/http.ts +460 -0
- package/src/desk/mail-route.ts +103 -0
- package/src/desk/overlay.ts +112 -0
- package/src/desk/preview.ts +422 -0
- package/src/desk/screens.ts +149 -0
- package/src/desk/secrets.ts +143 -0
- package/src/desk/series.ts +127 -0
- package/src/desk/state.ts +77 -0
- package/src/desk/studio-route.ts +119 -0
- package/src/desk/tick-runner.ts +66 -0
- package/src/desk/tick.ts +56 -0
- package/src/desk/topics-route.ts +41 -0
- package/src/desk/ui/app.css +505 -0
- package/src/desk/ui/app.js +185 -0
- package/src/desk/ui/apple-icon.png +0 -0
- package/src/desk/ui/components.js +79 -0
- package/src/desk/ui/core.js +156 -0
- package/src/desk/ui/favicon.ico +0 -0
- package/src/desk/ui/icon.svg +1 -0
- package/src/desk/ui/icons.js +49 -0
- package/src/desk/ui/index.html +41 -0
- package/src/desk/ui/metrics-math.d.ts +22 -0
- package/src/desk/ui/metrics-math.js +135 -0
- package/src/desk/ui/theme.js +5 -0
- package/src/desk/ui/views-creators.js +209 -0
- package/src/desk/ui/views-keys.js +114 -0
- package/src/desk/ui/views-mail.js +188 -0
- package/src/desk/ui/views-misc.js +123 -0
- package/src/desk/ui/views-review.js +119 -0
- package/src/desk/ui/views-runs.js +350 -0
- package/src/desk/ui/views-screens.js +163 -0
- package/src/desk/ui/views-series.js +318 -0
- package/src/desk/ui/views-topics.js +87 -0
- package/src/desk/verbs.ts +361 -0
- package/src/doctor.ts +212 -0
- package/src/drain.ts +14 -0
- package/src/engage/index.ts +217 -0
- package/src/generate/index.ts +110 -0
- package/src/generate/script.ts +152 -0
- package/src/generate/title.ts +78 -0
- package/src/help.ts +252 -0
- package/src/home.ts +45 -0
- package/src/llm/client.ts +177 -0
- package/src/log.ts +7 -0
- package/src/oauth/tokens.ts +189 -0
- package/src/oauth/vault.ts +72 -0
- package/src/pipeline/review.ts +642 -0
- package/src/pipeline/run.ts +443 -0
- package/src/pipeline/series-guard.ts +26 -0
- package/src/pipeline/source-fetch.ts +69 -0
- package/src/pipeline/stages.ts +728 -0
- package/src/pipeline/topics-source.ts +90 -0
- package/src/product/commands.ts +296 -0
- package/src/product/config-file.ts +38 -0
- package/src/product/engine-choice.ts +89 -0
- package/src/product/engines.ts +103 -0
- package/src/product/insights.ts +50 -0
- package/src/product/keys.ts +67 -0
- package/src/product/paths.ts +18 -0
- package/src/product/probes.ts +88 -0
- package/src/product/push-flow.ts +90 -0
- package/src/product/render-video.ts +21 -0
- package/src/product/short.ts +62 -0
- package/src/product/update.ts +32 -0
- package/src/project/canonical.ts +14 -0
- package/src/project/commands.ts +177 -0
- package/src/project/dashboard-status.ts +28 -0
- package/src/project/discover.ts +19 -0
- package/src/project/index-file.ts +73 -0
- package/src/project/marker.ts +92 -0
- package/src/project/migrate.ts +201 -0
- package/src/project/names.ts +27 -0
- package/src/project/notice.ts +16 -0
- package/src/project/open.ts +88 -0
- package/src/project/scaffold.ts +112 -0
- package/src/project/templates.ts +42 -0
- package/src/project/videos.ts +64 -0
- package/src/publish/facebook.ts +91 -0
- package/src/publish/index.ts +12 -0
- package/src/publish/instagram.ts +97 -0
- package/src/publish/rate.ts +62 -0
- package/src/publish/session.ts +242 -0
- package/src/publish/tiktok.ts +202 -0
- package/src/publish/youtube.ts +177 -0
- package/src/queue/desk-ops.ts +1170 -0
- package/src/queue/seal.ts +3 -0
- package/src/queue/store.ts +1006 -0
- package/src/remotion/AiLabel.tsx +26 -0
- package/src/remotion/Root.tsx +73 -0
- package/src/remotion/defaults.ts +26 -0
- package/src/remotion/films/claude/ClaudeFilm.tsx +1014 -0
- package/src/remotion/films/engine/EngineMark.tsx +17 -0
- package/src/remotion/films/rea/ReaShort.tsx +552 -0
- package/src/remotion/films/rea/drawings.tsx +907 -0
- package/src/remotion/films/rea/timing.ts +144 -0
- package/src/remotion/index.ts +4 -0
- package/src/remotion/templates/EditorialSplit.tsx +39 -0
- package/src/remotion/templates/KineticType.tsx +39 -0
- package/src/remotion/templates/SignalBoard.tsx +50 -0
- package/src/remotion/timing.ts +22 -0
- package/src/render/chrome.ts +78 -0
- package/src/render/engine-mark.ts +29 -0
- package/src/render/framey-template.ts +130 -0
- package/src/render/html-engine.ts +149 -0
- package/src/render/node-crypto-stub.ts +11 -0
- package/src/render/probe.ts +29 -0
- package/src/render/props.ts +17 -0
- package/src/render/vertical-short.ts +35 -0
- package/src/render/webpack.ts +33 -0
- package/src/render/worker.ts +65 -0
- package/src/scene/assets/fonts/TitanOne-OFL.txt +94 -0
- package/src/scene/assets/fonts/titan-one.woff2 +0 -0
- package/src/scene/assets/gsap/LICENSE.txt +8 -0
- package/src/scene/assets/gsap/gsap.min.js +11 -0
- package/src/scene/audio.ts +54 -0
- package/src/scene/blocks/LICENSE +190 -0
- package/src/scene/blocks/NOTICE +5 -0
- package/src/scene/blocks/bar-chart-race/bar-chart-race.html +585 -0
- package/src/scene/blocks/beat-freeze-cut/beat-freeze-cut.html +874 -0
- package/src/scene/blocks/camcorder-hud/camcorder-hud.html +164 -0
- package/src/scene/blocks/camera-dolly-zoom/camera-dolly-zoom.html +355 -0
- package/src/scene/blocks/code-diff/code-diff.html +817 -0
- package/src/scene/blocks/code-snippet-apple-terminal-pro/code-snippet-apple-terminal-pro.html +248 -0
- package/src/scene/blocks/code-typing/code-typing.html +764 -0
- package/src/scene/blocks/data-chart/data-chart.html +452 -0
- package/src/scene/blocks/flowchart-vertical/flowchart-vertical.html +454 -0
- package/src/scene/blocks/hw-scribble-transition/hw-scribble-transition.html +153 -0
- package/src/scene/blocks/index.json +824 -0
- package/src/scene/blocks/lt-accent-underline/lt-accent-underline.html +107 -0
- package/src/scene/blocks/lt-bold-block/lt-bold-block.html +109 -0
- package/src/scene/blocks/lt-clean-bar/lt-clean-bar.html +112 -0
- package/src/scene/blocks/lt-dark-card/lt-dark-card.html +111 -0
- package/src/scene/blocks/lt-kicker-name/lt-kicker-name.html +114 -0
- package/src/scene/blocks/lt-mask-reveal/lt-mask-reveal.html +120 -0
- package/src/scene/blocks/lt-neon-border/lt-neon-border.html +391 -0
- package/src/scene/blocks/lt-stack-bars/lt-stack-bars.html +109 -0
- package/src/scene/blocks/macos-notification/macos-notification.html +194 -0
- package/src/scene/blocks/mk-background/mk-background.html +236 -0
- package/src/scene/blocks/mk-callout-highlight/mk-callout-highlight.html +183 -0
- package/src/scene/blocks/mk-clone-wall-transition/mk-clone-wall-transition.html +226 -0
- package/src/scene/blocks/mk-line-graph/mk-line-graph.html +293 -0
- package/src/scene/blocks/mk-progress-stat/mk-progress-stat.html +186 -0
- package/src/scene/blocks/mk-specs-list/mk-specs-list.html +223 -0
- package/src/scene/blocks/news-ticker/news-ticker.html +409 -0
- package/src/scene/blocks/organic-light-leak-overlay/organic-light-leak-overlay.html +126 -0
- package/src/scene/blocks/oscilloscope-trace/oscilloscope-trace.html +519 -0
- package/src/scene/blocks/snow/snow.html +205 -0
- package/src/scene/blocks/split-flap-board/split-flap-board.html +347 -0
- package/src/scene/blocks/spotify-card/spotify-card.html +294 -0
- package/src/scene/blocks/starfield/starfield.html +188 -0
- package/src/scene/blocks/thread-message-stack/thread-message-stack.html +239 -0
- package/src/scene/blocks/week-in-merges/week-in-merges.html +470 -0
- package/src/scene/blocks/x-post/x-post.html +437 -0
- package/src/scene/blocks/yt-comment-card/yt-comment-card.html +319 -0
- package/src/scene/blocks/yt-lcd-background/yt-lcd-background.html +307 -0
- package/src/scene/blocks/yt-prism-title/yt-prism-title.html +205 -0
- package/src/scene/blocks.ts +229 -0
- package/src/scene/command.ts +272 -0
- package/src/scene/figure.ts +181 -0
- package/src/scene/glyphs.ts +107 -0
- package/src/scene/init.ts +86 -0
- package/src/scene/inspect/css-tree.d.ts +6 -0
- package/src/scene/inspect/page-scripts.ts +272 -0
- package/src/scene/inspect/report.ts +405 -0
- package/src/scene/inspect/run.ts +200 -0
- package/src/scene/inspect/source.ts +236 -0
- package/src/scene/label.ts +131 -0
- package/src/scene/net-guard.ts +74 -0
- package/src/scene/render.ts +292 -0
- package/src/scene/runtime/browser.ts +199 -0
- package/src/scene/runtime/core.ts +181 -0
- package/src/scene/runtime/react.tsx +115 -0
- package/src/scene/runtime/transitions.ts +133 -0
- package/src/scene/sanitize.ts +181 -0
- package/src/scene/scene.ts +152 -0
- package/src/scene/studio-command.ts +48 -0
- package/src/scene/studio-skin.ts +59 -0
- package/src/scene/studio.ts +337 -0
- package/src/scene/supply.ts +111 -0
- package/src/scene/timing.ts +288 -0
- package/src/scene/transitions/LICENSE +190 -0
- package/src/scene/transitions/NOTICE +5 -0
- package/src/scene/transitions/SOURCE.json +24 -0
- package/src/scene/transitions/transitions.global.js +38 -0
- package/src/scene/transitions.ts +26 -0
- package/src/service/all-projects.ts +153 -0
- package/src/service/commands.ts +256 -0
- package/src/service/due.ts +82 -0
- package/src/service/lock.ts +101 -0
- package/src/service/log-file.ts +56 -0
- package/src/service/state.ts +41 -0
- package/src/service/units.ts +90 -0
- package/src/service/worker.ts +51 -0
- package/src/skill-agents.ts +74 -0
- package/src/skill-install.ts +334 -0
- package/src/sync-write.ts +21 -0
- package/src/tick-report.ts +205 -0
- package/src/tts.ts +124 -0
- package/vendor/@vfrey/contracts/dist/account.d.ts +97 -0
- package/vendor/@vfrey/contracts/dist/account.js +27 -0
- package/vendor/@vfrey/contracts/dist/checks.d.ts +8 -0
- package/vendor/@vfrey/contracts/dist/checks.js +1 -0
- package/vendor/@vfrey/contracts/dist/credentials/crypto.d.ts +4 -0
- package/vendor/@vfrey/contracts/dist/credentials/crypto.js +38 -0
- package/vendor/@vfrey/contracts/dist/domain/advice-persona.d.ts +10 -0
- package/vendor/@vfrey/contracts/dist/domain/advice-persona.js +24 -0
- package/vendor/@vfrey/contracts/dist/domain/backoff.d.ts +13 -0
- package/vendor/@vfrey/contracts/dist/domain/backoff.js +27 -0
- package/vendor/@vfrey/contracts/dist/domain/cadence.d.ts +29 -0
- package/vendor/@vfrey/contracts/dist/domain/cadence.js +95 -0
- package/vendor/@vfrey/contracts/dist/domain/creators.d.ts +146 -0
- package/vendor/@vfrey/contracts/dist/domain/creators.js +2 -0
- package/vendor/@vfrey/contracts/dist/domain/disclosure.d.ts +127 -0
- package/vendor/@vfrey/contracts/dist/domain/disclosure.js +250 -0
- package/vendor/@vfrey/contracts/dist/domain/errors.d.ts +34 -0
- package/vendor/@vfrey/contracts/dist/domain/errors.js +68 -0
- package/vendor/@vfrey/contracts/dist/domain/redact.d.ts +1 -0
- package/vendor/@vfrey/contracts/dist/domain/redact.js +21 -0
- package/vendor/@vfrey/contracts/dist/domain/revenue.d.ts +13 -0
- package/vendor/@vfrey/contracts/dist/domain/revenue.js +16 -0
- package/vendor/@vfrey/contracts/dist/domain/safety.d.ts +20 -0
- package/vendor/@vfrey/contracts/dist/domain/safety.js +61 -0
- package/vendor/@vfrey/contracts/dist/domain/similarity.d.ts +13 -0
- package/vendor/@vfrey/contracts/dist/domain/similarity.js +100 -0
- package/vendor/@vfrey/contracts/dist/domain/templates.d.ts +18 -0
- package/vendor/@vfrey/contracts/dist/domain/templates.js +67 -0
- package/vendor/@vfrey/contracts/dist/domain/tiktok-chunks.d.ts +19 -0
- package/vendor/@vfrey/contracts/dist/domain/tiktok-chunks.js +52 -0
- package/vendor/@vfrey/contracts/dist/domain/topics.d.ts +78 -0
- package/vendor/@vfrey/contracts/dist/domain/topics.js +4 -0
- package/vendor/@vfrey/contracts/dist/domain/types.d.ts +216 -0
- package/vendor/@vfrey/contracts/dist/domain/types.js +1 -0
- package/vendor/@vfrey/contracts/dist/domain/variation.d.ts +57 -0
- package/vendor/@vfrey/contracts/dist/domain/variation.js +278 -0
- package/vendor/@vfrey/contracts/dist/events.d.ts +20 -0
- package/vendor/@vfrey/contracts/dist/events.js +1 -0
- package/vendor/@vfrey/contracts/dist/http.d.ts +11 -0
- package/vendor/@vfrey/contracts/dist/http.js +37 -0
- package/vendor/@vfrey/contracts/dist/index.d.ts +22 -0
- package/vendor/@vfrey/contracts/dist/index.js +22 -0
- package/vendor/@vfrey/contracts/dist/log.d.ts +2 -0
- package/vendor/@vfrey/contracts/dist/log.js +10 -0
- package/vendor/@vfrey/contracts/dist/mail.d.ts +55 -0
- package/vendor/@vfrey/contracts/dist/mail.js +1 -0
- package/vendor/@vfrey/contracts/package.json +18 -0
- package/vendor/@vfrey/ingest/dist/index.d.ts +41 -0
- package/vendor/@vfrey/ingest/dist/index.js +221 -0
- package/vendor/@vfrey/ingest/dist/parse.d.ts +5 -0
- package/vendor/@vfrey/ingest/dist/parse.js +165 -0
- package/vendor/@vfrey/ingest/package.json +21 -0
- package/vendor/framey/LICENSE +190 -0
- package/vendor/framey/NOTICE +15 -0
- package/vendor/framey/SOURCE.json +24 -0
- package/vendor/framey/STUDIO-SOURCE.json +9 -0
- package/vendor/framey/bin/framey-localize-fonts.mjs +12 -0
- package/vendor/framey/bin/framey.mjs +16 -0
- package/vendor/framey/dist/add-VMJD5KBS.js +75 -0
- package/vendor/framey/dist/animatedGifPrep-QPKGJ6PM.js +43 -0
- package/vendor/framey/dist/api.d.ts +211 -0
- package/vendor/framey/dist/api.js +76 -0
- package/vendor/framey/dist/appHistory-WW56FZTT.js +31 -0
- package/vendor/framey/dist/asset-WQKGOELE.js +26 -0
- package/vendor/framey/dist/audio-RSJWVWRA.js +1936 -0
- package/vendor/framey/dist/batchRender-3HPICDCT.js +366 -0
- package/vendor/framey/dist/beats-HL2BDUZI.js +273 -0
- package/vendor/framey/dist/benchmark-RWCWHI5Z.js +230 -0
- package/vendor/framey/dist/browser-ECYET3Q2.js +206 -0
- package/vendor/framey/dist/bundleWithLocalizedFonts-ALYBQEQT.js +52 -0
- package/vendor/framey/dist/captureCompositionFrame-4DA6SEH2.js +94 -0
- package/vendor/framey/dist/catalog-5JVDEUWK.js +979 -0
- package/vendor/framey/dist/catch-up-NEBCL5NO.js +106 -0
- package/vendor/framey/dist/check-F5N544ML.js +111 -0
- package/vendor/framey/dist/checkBrowser-LZ66CMJG.js +110 -0
- package/vendor/framey/dist/chunk-2K7Z2HVP.js +372 -0
- package/vendor/framey/dist/chunk-2UZQHDM7.js +323 -0
- package/vendor/framey/dist/chunk-2X4PQEYM.js +34 -0
- package/vendor/framey/dist/chunk-3422KMTD.js +168 -0
- package/vendor/framey/dist/chunk-3FYD4YEK.js +72 -0
- package/vendor/framey/dist/chunk-3GXQPCJC.js +682 -0
- package/vendor/framey/dist/chunk-3LM6YPBR.js +179 -0
- package/vendor/framey/dist/chunk-442JNXRM.js +20 -0
- package/vendor/framey/dist/chunk-4BNN5FGX.js +182 -0
- package/vendor/framey/dist/chunk-4P7NX5BM.js +11532 -0
- package/vendor/framey/dist/chunk-4UMPIPCQ.js +88 -0
- package/vendor/framey/dist/chunk-4YYJOFKS.js +28 -0
- package/vendor/framey/dist/chunk-54HJ63Q2.js +29 -0
- package/vendor/framey/dist/chunk-5ETJX6WM.js +89 -0
- package/vendor/framey/dist/chunk-5SG54JRS.js +68 -0
- package/vendor/framey/dist/chunk-634HSJ3J.js +58 -0
- package/vendor/framey/dist/chunk-66LREXGS.js +48 -0
- package/vendor/framey/dist/chunk-6BEFEWFB.js +25 -0
- package/vendor/framey/dist/chunk-6BNTGNGD.js +286 -0
- package/vendor/framey/dist/chunk-6DDPOHMK.js +140 -0
- package/vendor/framey/dist/chunk-6GV5XSOR.js +214 -0
- package/vendor/framey/dist/chunk-6JR2XUEE.js +127 -0
- package/vendor/framey/dist/chunk-73QVATIM.js +362 -0
- package/vendor/framey/dist/chunk-7FMUTGOH.js +279 -0
- package/vendor/framey/dist/chunk-7JQFJ6JJ.js +291 -0
- package/vendor/framey/dist/chunk-AHPGAESX.js +113 -0
- package/vendor/framey/dist/chunk-AHX34EFP.js +15 -0
- package/vendor/framey/dist/chunk-AJ5CSAEZ.js +487 -0
- package/vendor/framey/dist/chunk-B7RJV74O.js +5047 -0
- package/vendor/framey/dist/chunk-BL4U6U52.js +254 -0
- package/vendor/framey/dist/chunk-BSQ7XANM.js +210 -0
- package/vendor/framey/dist/chunk-BZ56MTDX.js +6 -0
- package/vendor/framey/dist/chunk-C5BO7PMT.js +282 -0
- package/vendor/framey/dist/chunk-CFUCHO4T.js +358 -0
- package/vendor/framey/dist/chunk-CZGHFATT.js +31 -0
- package/vendor/framey/dist/chunk-DLA44CMS.js +5649 -0
- package/vendor/framey/dist/chunk-DPVXBVLL.js +31292 -0
- package/vendor/framey/dist/chunk-DQBY7FRR.js +397 -0
- package/vendor/framey/dist/chunk-EAMLBAHA.js +154 -0
- package/vendor/framey/dist/chunk-EOVYQ3IG.js +143 -0
- package/vendor/framey/dist/chunk-EVMY7IPL.js +612 -0
- package/vendor/framey/dist/chunk-FG4BBFZI.js +122 -0
- package/vendor/framey/dist/chunk-FI4I7CME.js +56 -0
- package/vendor/framey/dist/chunk-FLREUEHW.js +2081 -0
- package/vendor/framey/dist/chunk-FUFP7A7S.js +1126 -0
- package/vendor/framey/dist/chunk-FV3PIKGH.js +56 -0
- package/vendor/framey/dist/chunk-FXMKHHPO.js +123 -0
- package/vendor/framey/dist/chunk-GGZAM5VH.js +1187 -0
- package/vendor/framey/dist/chunk-GKZEVJIB.js +39 -0
- package/vendor/framey/dist/chunk-GMECXFAN.js +57 -0
- package/vendor/framey/dist/chunk-GNEFDLFB.js +621 -0
- package/vendor/framey/dist/chunk-GPMLSOEG.js +19274 -0
- package/vendor/framey/dist/chunk-GPYVT5EE.js +59 -0
- package/vendor/framey/dist/chunk-H6IEMZEV.js +40 -0
- package/vendor/framey/dist/chunk-HEFQCIXR.js +170 -0
- package/vendor/framey/dist/chunk-HFQ4CWHA.js +118 -0
- package/vendor/framey/dist/chunk-HPDTCOKE.js +304 -0
- package/vendor/framey/dist/chunk-HTUHQKDB.js +548 -0
- package/vendor/framey/dist/chunk-HU2SPFNG.js +103 -0
- package/vendor/framey/dist/chunk-HVW7ABXD.js +19 -0
- package/vendor/framey/dist/chunk-IG7NDKXO.js +26 -0
- package/vendor/framey/dist/chunk-II3J3WXK.js +246 -0
- package/vendor/framey/dist/chunk-IR35BCLK.js +13 -0
- package/vendor/framey/dist/chunk-ISN5GRYI.js +20 -0
- package/vendor/framey/dist/chunk-IUONB55J.js +669 -0
- package/vendor/framey/dist/chunk-IVSUQR2B.js +161 -0
- package/vendor/framey/dist/chunk-IXU6PQSW.js +259 -0
- package/vendor/framey/dist/chunk-IZCW2NKT.js +29 -0
- package/vendor/framey/dist/chunk-JGXJU5PF.js +68 -0
- package/vendor/framey/dist/chunk-JHOCK3DG.js +27 -0
- package/vendor/framey/dist/chunk-JVBRJMOP.js +121 -0
- package/vendor/framey/dist/chunk-K4MJX7SR.js +17 -0
- package/vendor/framey/dist/chunk-K4WKGXRC.js +18 -0
- package/vendor/framey/dist/chunk-KGPLIH7B.js +127 -0
- package/vendor/framey/dist/chunk-KLIKCX6Q.js +63 -0
- package/vendor/framey/dist/chunk-KXTKKBOC.js +61 -0
- package/vendor/framey/dist/chunk-KZI44OPA.js +185 -0
- package/vendor/framey/dist/chunk-LEKZNRKI.js +45 -0
- package/vendor/framey/dist/chunk-LFGJWOVA.js +61 -0
- package/vendor/framey/dist/chunk-LLMSX6V6.js +17 -0
- package/vendor/framey/dist/chunk-LTGTN2TH.js +195 -0
- package/vendor/framey/dist/chunk-M2WBOQ2Q.js +54 -0
- package/vendor/framey/dist/chunk-MI5FTLYK.js +399 -0
- package/vendor/framey/dist/chunk-MLQP2QUF.js +1809 -0
- package/vendor/framey/dist/chunk-MMQ52NIZ.js +956 -0
- package/vendor/framey/dist/chunk-ND46XKK3.js +742 -0
- package/vendor/framey/dist/chunk-NYEXNSHM.js +504 -0
- package/vendor/framey/dist/chunk-O4YRB27L.js +57 -0
- package/vendor/framey/dist/chunk-O7BGSQ5F.js +92 -0
- package/vendor/framey/dist/chunk-OFQWTKPW.js +117 -0
- package/vendor/framey/dist/chunk-P5ZBLXJ6.js +91 -0
- package/vendor/framey/dist/chunk-P6LJ4Y32.js +4662 -0
- package/vendor/framey/dist/chunk-PKZ7RK5N.js +281 -0
- package/vendor/framey/dist/chunk-PURHAXFL.js +15 -0
- package/vendor/framey/dist/chunk-Q5X2B5WT.js +29 -0
- package/vendor/framey/dist/chunk-QAMKOG67.js +248 -0
- package/vendor/framey/dist/chunk-R6YBK4XX.js +514 -0
- package/vendor/framey/dist/chunk-RGLQURIX.js +2997 -0
- package/vendor/framey/dist/chunk-RNV3DM4S.js +3573 -0
- package/vendor/framey/dist/chunk-ROEW726S.js +4638 -0
- package/vendor/framey/dist/chunk-RQVDTPGD.js +6 -0
- package/vendor/framey/dist/chunk-RVZHGOGR.js +26 -0
- package/vendor/framey/dist/chunk-RXATE6FZ.js +385 -0
- package/vendor/framey/dist/chunk-S3S4TGEH.js +424 -0
- package/vendor/framey/dist/chunk-SDYDNHEE.js +11202 -0
- package/vendor/framey/dist/chunk-SSWBU67I.js +173 -0
- package/vendor/framey/dist/chunk-ST35C4K6.js +28 -0
- package/vendor/framey/dist/chunk-SZNTYTIV.js +990 -0
- package/vendor/framey/dist/chunk-T2EUWCJE.js +29 -0
- package/vendor/framey/dist/chunk-T6AGUTZJ.js +444 -0
- package/vendor/framey/dist/chunk-THJALHFJ.js +11131 -0
- package/vendor/framey/dist/chunk-TIQB63MX.js +18128 -0
- package/vendor/framey/dist/chunk-U242RTCT.js +134 -0
- package/vendor/framey/dist/chunk-UJZREAV6.js +3901 -0
- package/vendor/framey/dist/chunk-UMD3V7CU.js +264 -0
- package/vendor/framey/dist/chunk-UOFAE5RF.js +42 -0
- package/vendor/framey/dist/chunk-UTEIUGAZ.js +29 -0
- package/vendor/framey/dist/chunk-VAS6HQX3.js +138 -0
- package/vendor/framey/dist/chunk-VC76R6W2.js +27 -0
- package/vendor/framey/dist/chunk-VFZ7W5W7.js +226 -0
- package/vendor/framey/dist/chunk-VHNLZAE2.js +348 -0
- package/vendor/framey/dist/chunk-VMC4WSH5.js +278 -0
- package/vendor/framey/dist/chunk-VORQIH64.js +108 -0
- package/vendor/framey/dist/chunk-VTXFRIHO.js +186 -0
- package/vendor/framey/dist/chunk-W2LGJSEN.js +182 -0
- package/vendor/framey/dist/chunk-WKBM7NDG.js +32 -0
- package/vendor/framey/dist/chunk-WMQNIQDJ.js +2057 -0
- package/vendor/framey/dist/chunk-WN4XZC5F.js +504 -0
- package/vendor/framey/dist/chunk-WQ6ZXHFQ.js +133 -0
- package/vendor/framey/dist/chunk-X7HBSTCZ.js +53 -0
- package/vendor/framey/dist/chunk-X7MTZ4T2.js +6 -0
- package/vendor/framey/dist/chunk-XPTOJZJF.js +308 -0
- package/vendor/framey/dist/chunk-XT6MXC7A.js +6 -0
- package/vendor/framey/dist/chunk-XT7X6QCP.js +6 -0
- package/vendor/framey/dist/chunk-XTMDWNEC.js +2820 -0
- package/vendor/framey/dist/chunk-XUHOIDKG.js +6 -0
- package/vendor/framey/dist/chunk-XX7LTW5Y.js +138 -0
- package/vendor/framey/dist/chunk-Y3YGTZEG.js +382 -0
- package/vendor/framey/dist/chunk-Y5SBSGN7.js +346 -0
- package/vendor/framey/dist/chunk-YCMVI4MZ.js +625 -0
- package/vendor/framey/dist/chunk-YOR4CTCE.js +261 -0
- package/vendor/framey/dist/chunk-YPRBGITP.js +2748 -0
- package/vendor/framey/dist/chunk-ZKDMAOFU.js +32 -0
- package/vendor/framey/dist/chunk-ZW6DURPF.js +1318 -0
- package/vendor/framey/dist/clean-ZJOGDKDM.js +336 -0
- package/vendor/framey/dist/cli.js +439 -0
- package/vendor/framey/dist/cloudrun-HGJ3B6ZV.js +767 -0
- package/vendor/framey/dist/commands/contrast-audit.browser.js +643 -0
- package/vendor/framey/dist/commands/layout-audit.browser.js +2914 -0
- package/vendor/framey/dist/commands/motion-sample.browser.js +74 -0
- package/vendor/framey/dist/commands/motion-signature.browser.js +475 -0
- package/vendor/framey/dist/compare-W7UY3BAZ.js +463 -0
- package/vendor/framey/dist/compiler-TM3W6GYF.js +136 -0
- package/vendor/framey/dist/component-QF5VGYMU.js +176 -0
- package/vendor/framey/dist/compositions-XT3PMNDF.js +238 -0
- package/vendor/framey/dist/contactSheet-7W6GYHBQ.js +24 -0
- package/vendor/framey/dist/deploy-6FJPWKF2.js +299 -0
- package/vendor/framey/dist/destroy-HE2RIPKZ.js +57 -0
- package/vendor/framey/dist/deterministicFonts-RADD3BSX.js +50 -0
- package/vendor/framey/dist/dist-4S2FGGVY.js +422 -0
- package/vendor/framey/dist/dist-BE4B2EZE.js +32 -0
- package/vendor/framey/dist/dist-EWXJGN63.js +129 -0
- package/vendor/framey/dist/docs-VKIRFEEX.js +131 -0
- package/vendor/framey/dist/doctor-2UNJ2G7U.js +74 -0
- package/vendor/framey/dist/dom-37K6YOH4.js +14 -0
- package/vendor/framey/dist/dotEnv-7PZQTVIM.js +54 -0
- package/vendor/framey/dist/events-ACY3P2PA.js +76 -0
- package/vendor/framey/dist/events-IHB3B2MK.js +69 -0
- package/vendor/framey/dist/ffmpeg-DR5LGGSK.js +63 -0
- package/vendor/framey/dist/figma-BODVUPHB.js +63 -0
- package/vendor/framey/dist/fontData.generated-NXAOI4GH.js +13 -0
- package/vendor/framey/dist/fontLocalizeCli.js +142 -0
- package/vendor/framey/dist/gpuPolicy-XLEXORZY.js +49 -0
- package/vendor/framey/dist/grade-compare-GAXFQ74C.js +661 -0
- package/vendor/framey/dist/gsapParser-IEUSLYDJ.js +2885 -0
- package/vendor/framey/dist/gsapParserAcorn-LZJKCFQI.js +30 -0
- package/vendor/framey/dist/help-VCB5X2HS.js +184 -0
- package/vendor/framey/dist/history-ENGZEVFT.js +471 -0
- package/vendor/framey/dist/hyperframe.manifest.json +22 -0
- package/vendor/framey/dist/hyperframe.runtime.iife.js +1132 -0
- package/vendor/framey/dist/hyperframes-player.global.js +478 -0
- package/vendor/framey/dist/hyperframes-slideshow.global.js +148 -0
- package/vendor/framey/dist/info-WPCJHBMU.js +182 -0
- package/vendor/framey/dist/init-G4WGLYGD.js +1176 -0
- package/vendor/framey/dist/inspect-5IQ6CNEQ.js +106 -0
- package/vendor/framey/dist/installer-ML4HWUV7.js +40 -0
- package/vendor/framey/dist/keyframes-Q6XJO7VW.js +2755 -0
- package/vendor/framey/dist/lambda-A7JC74JF.js +468 -0
- package/vendor/framey/dist/layout-YET6XNXA.js +95 -0
- package/vendor/framey/dist/lint-I7FZN2VJ.js +162 -0
- package/vendor/framey/dist/lintProject-PDB3UN72.js +30 -0
- package/vendor/framey/dist/manager-CD6LJ7ZN.js +45 -0
- package/vendor/framey/dist/manager-WA4F2GST.js +67 -0
- package/vendor/framey/dist/media-treatment-BXYS4WVA.js +1030 -0
- package/vendor/framey/dist/media-use-LWH3MANK.js +113 -0
- package/vendor/framey/dist/models-K363FYM4.js +195 -0
- package/vendor/framey/dist/motionShot-GPAVWXLH.js +640 -0
- package/vendor/framey/dist/normalize-FASIPBUM.js +24 -0
- package/vendor/framey/dist/normalize-audio-VDWYRHN6.js +268 -0
- package/vendor/framey/dist/open-E3TB6P6J.js +128 -0
- package/vendor/framey/dist/parakeetRunner-UP34UOI2.js +58 -0
- package/vendor/framey/dist/pipeline-VXIUYEBU.js +64 -0
- package/vendor/framey/dist/play-BUTDQ4DV.js +353 -0
- package/vendor/framey/dist/policies-OLDYGFK5.js +309 -0
- package/vendor/framey/dist/preflight-2KZ2GWAZ.js +55 -0
- package/vendor/framey/dist/present-GXYSM7NX.js +353 -0
- package/vendor/framey/dist/preview-EKZ33JOJ.js +1910 -0
- package/vendor/framey/dist/producer-SKU5EV3J.js +13 -0
- package/vendor/framey/dist/progress-ZWB4Z4ET.js +76 -0
- package/vendor/framey/dist/projectConfig-3MZAYVTS.js +60 -0
- package/vendor/framey/dist/publication-DTKWNF74.js +33 -0
- package/vendor/framey/dist/remove-background-OY5L7XN2.js +265 -0
- package/vendor/framey/dist/render-CDV4GDFX.js +187 -0
- package/vendor/framey/dist/render-YE5YAMOD.js +2620 -0
- package/vendor/framey/dist/render-batch-ZAMFPCLL.js +274 -0
- package/vendor/framey/dist/renderSetupWorker.js +120 -0
- package/vendor/framey/dist/resolver-D5BIPSEW.js +42 -0
- package/vendor/framey/dist/runtimeVersion.js +18 -0
- package/vendor/framey/dist/sam-WFZXI4F7.js +23 -0
- package/vendor/framey/dist/shaderTransitionWorker.js +44 -0
- package/vendor/framey/dist/sherpa-RQWLV7I3.js +79 -0
- package/vendor/framey/dist/sherpaWorker.js +84 -0
- package/vendor/framey/dist/sites-AMOVABTK.js +54 -0
- package/vendor/framey/dist/skill-ZHVLH7KX.js +15 -0
- package/vendor/framey/dist/slideshow-SJGK4RQS.js +24 -0
- package/vendor/framey/dist/snapshot-TUXL6LBQ.js +1515 -0
- package/vendor/framey/dist/src-JHQGB2S6.js +215 -0
- package/vendor/framey/dist/src-Z5PGEMXB.js +532 -0
- package/vendor/framey/dist/state-B6H3WHCF.js +28 -0
- package/vendor/framey/dist/staticProjectServer-DFVZOUGI.js +63 -0
- package/vendor/framey/dist/studio/assets/hyperframes-player-DLaKjw0L.js +478 -0
- package/vendor/framey/dist/studio/assets/index-BX3KHhGX.js +71 -0
- package/vendor/framey/dist/studio/assets/index-CYbvOVp-.css +1 -0
- package/vendor/framey/dist/studio/assets/index-Dp3QEUGL.js +402 -0
- package/vendor/framey/dist/studio/assets/index-qrTAXbqc.js +531 -0
- package/vendor/framey/dist/studio/favicon.svg +14 -0
- package/vendor/framey/dist/studio/icons/timeline/audio.svg +7 -0
- package/vendor/framey/dist/studio/icons/timeline/captions.svg +5 -0
- package/vendor/framey/dist/studio/icons/timeline/composition.svg +12 -0
- package/vendor/framey/dist/studio/icons/timeline/image.svg +18 -0
- package/vendor/framey/dist/studio/icons/timeline/music.svg +10 -0
- package/vendor/framey/dist/studio/icons/timeline/text.svg +3 -0
- package/vendor/framey/dist/studio/index.html +23 -0
- package/vendor/framey/dist/studio-api-2NECGRMB.js +179 -0
- package/vendor/framey/dist/studioSelectionClient-IUUPKUHZ.js +25 -0
- package/vendor/framey/dist/studioServer-N2OPUMOQ.js +1569 -0
- package/vendor/framey/dist/synthesize-PKTB5ATG.js +183 -0
- package/vendor/framey/dist/system-7F3UEHQT.js +27 -0
- package/vendor/framey/dist/telemetry-DQGPEKM6.js +145 -0
- package/vendor/framey/dist/telemetry-UN55N6U6.js +77 -0
- package/vendor/framey/dist/timeline-LHUUMK63.js +1295 -0
- package/vendor/framey/dist/tokens-OLECWDFK.js +92 -0
- package/vendor/framey/dist/transcribe-O7HQKMIV.js +331 -0
- package/vendor/framey/dist/transcribe-UJESPBT5.js +76 -0
- package/vendor/framey/dist/tts-YCCQHZD4.js +234 -0
- package/vendor/framey/dist/urlDownloader-H2LXLG4U.js +48 -0
- package/vendor/framey/dist/usage-HG4WMM7A.js +2167 -0
- package/vendor/framey/dist/validate-F2XMN6EV.js +87 -0
- package/vendor/framey/dist/vendor/npm/gsap@3.15.0/GSAP-LICENSE.txt +8 -0
- package/vendor/framey/dist/vendor/npm/gsap@3.15.0/dist/CustomEase.min.js +11 -0
- package/vendor/framey/dist/vendor/npm/gsap@3.15.0/dist/MotionPathPlugin.min.js +11 -0
- package/vendor/framey/dist/vendor/npm/gsap@3.15.0/dist/gsap.min.js +11 -0
- package/vendor/framey/dist/warmCheck.js +220 -0
- package/vendor/framey/dist/warmCheckClient.js +139 -0
- package/vendor/framey/dist/workspaceBuildCheck-XYD2YTFW.js +133 -0
- package/vendor/framey-player/LICENSE +190 -0
- package/vendor/framey-player/NOTICE +16 -0
- package/vendor/framey-player/SOURCE.json +6 -0
- package/vendor/framey-player/hyperframes-player.global.js +478 -0
- package/vendor/framey.pin +1 -0
- package/bin/index.js +0 -3
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The JavaScript that runs inside the scene's page for `vfrey scene inspect`, as plain strings (the page is not built by
|
|
3
|
+
* a bundler, so none of this may use TypeScript or helpers a transpiler would add).
|
|
4
|
+
*
|
|
5
|
+
* HOOK runs before the scene's own scripts. It keeps the stack of every GSAP timeline call and of `vfrey.block` and
|
|
6
|
+
* `vfrey.transition`, which is how a tween is traced back to the line that wrote it.
|
|
7
|
+
*/
|
|
8
|
+
export const HOOK = String.raw`(function () {
|
|
9
|
+
Error.stackTraceLimit = 60;
|
|
10
|
+
var rec = (window.__vfInspect = { tweens: new Map(), standalone: [], cues: [], errors: [] });
|
|
11
|
+
window.addEventListener("error", function (e) { rec.errors.push(String(e.message || e)); });
|
|
12
|
+
function stack() { return new Error().stack || ""; }
|
|
13
|
+
function wrapTimeline(tl) {
|
|
14
|
+
["to", "from", "fromTo", "set"].forEach(function (m) {
|
|
15
|
+
var orig = tl[m];
|
|
16
|
+
if (typeof orig !== "function") return;
|
|
17
|
+
tl[m] = function __vfHook() {
|
|
18
|
+
var before = new Set(tl.getChildren(false, true, false));
|
|
19
|
+
var s = stack();
|
|
20
|
+
var out = orig.apply(this, arguments);
|
|
21
|
+
tl.getChildren(false, true, false).forEach(function (c) {
|
|
22
|
+
if (!before.has(c)) rec.tweens.set(c, { method: m, stack: s });
|
|
23
|
+
});
|
|
24
|
+
return out;
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function wrapGsap(g) {
|
|
29
|
+
if (!g || g.__vfWrapped) return;
|
|
30
|
+
g.__vfWrapped = true;
|
|
31
|
+
var timeline = g.timeline;
|
|
32
|
+
g.timeline = function () {
|
|
33
|
+
var tl = timeline.apply(this, arguments);
|
|
34
|
+
wrapTimeline(tl);
|
|
35
|
+
return tl;
|
|
36
|
+
};
|
|
37
|
+
["to", "from", "fromTo", "set"].forEach(function (m) {
|
|
38
|
+
var orig = g[m];
|
|
39
|
+
if (typeof orig !== "function") return;
|
|
40
|
+
g[m] = function __vfHook() {
|
|
41
|
+
var s = stack();
|
|
42
|
+
var t = orig.apply(this, arguments);
|
|
43
|
+
if (t && typeof t.targets === "function") rec.standalone.push({ tween: t, method: m, stack: s });
|
|
44
|
+
return t;
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
var realGsap;
|
|
49
|
+
Object.defineProperty(window, "gsap", { configurable: true, get: function () { return realGsap; }, set: function (v) { realGsap = v; try { wrapGsap(v); } catch (e) { rec.errors.push(String(e)); } } });
|
|
50
|
+
function resolve(t) { return typeof t === "string" ? document.querySelector(t) : t; }
|
|
51
|
+
function wrapVfrey(v) {
|
|
52
|
+
if (!v || v.__vfWrapped) return;
|
|
53
|
+
v.__vfWrapped = true;
|
|
54
|
+
["block", "transition"].forEach(function (kind) {
|
|
55
|
+
var orig = v[kind];
|
|
56
|
+
if (typeof orig !== "function") return;
|
|
57
|
+
v[kind] = function __vfHook(a, b, c) {
|
|
58
|
+
var s = stack();
|
|
59
|
+
var entry = { kind: kind, stack: s };
|
|
60
|
+
if (kind === "block") { entry.el = resolve(a); entry.start = b; entry.duration = c; }
|
|
61
|
+
else { entry.from = resolve(a); entry.to = resolve(b); entry.options = c && typeof c === "object" ? JSON.parse(JSON.stringify(c)) : {}; }
|
|
62
|
+
rec.cues.push(entry);
|
|
63
|
+
return orig.apply(this, arguments);
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
var realVfrey;
|
|
68
|
+
Object.defineProperty(window, "vfrey", { configurable: true, get: function () { return realVfrey; }, set: function (v) { realVfrey = v; try { wrapVfrey(v); } catch (e) { rec.errors.push(String(e)); } } });
|
|
69
|
+
})();`;
|
|
70
|
+
|
|
71
|
+
/** Embeds a block (an element with `data-composition-src`) the way the renderer does: its markup inside the host, its scoped CSS, then its scripts. */
|
|
72
|
+
export const LOAD_SUBS = String.raw`(async function (subs) {
|
|
73
|
+
var rec = window.__vfInspect;
|
|
74
|
+
for (var i = 0; i < subs.length; i++) {
|
|
75
|
+
var sub = subs[i];
|
|
76
|
+
var host = document.querySelector('[data-composition-src="' + sub.src + '"]');
|
|
77
|
+
if (!host) { rec.errors.push("no element for " + sub.src); continue; }
|
|
78
|
+
try {
|
|
79
|
+
var html = await (await fetch(sub.src)).text();
|
|
80
|
+
var doc = new DOMParser().parseFromString(html, "text/html");
|
|
81
|
+
var root = doc.querySelector("[data-composition-id]");
|
|
82
|
+
if (!root) continue;
|
|
83
|
+
root.querySelectorAll("script").forEach(function (s) { s.remove(); });
|
|
84
|
+
root.removeAttribute("id");
|
|
85
|
+
host.appendChild(document.importNode(root, true));
|
|
86
|
+
var style = document.createElement("style");
|
|
87
|
+
style.textContent = sub.css;
|
|
88
|
+
document.head.appendChild(style);
|
|
89
|
+
for (var k = 0; k < sub.scripts.length; k++) {
|
|
90
|
+
var sc = sub.scripts[k];
|
|
91
|
+
var el = document.createElement("script");
|
|
92
|
+
el.textContent = "(function(){" + "\n".repeat(sc.line - 1) + " ".repeat(Math.max(0, sc.col - 1)) + sc.text + "\n})();\n//# sourceURL=" + location.origin + "/" + sc.file;
|
|
93
|
+
document.body.appendChild(el);
|
|
94
|
+
}
|
|
95
|
+
} catch (e) { rec.errors.push(sub.src + ": " + e); }
|
|
96
|
+
}
|
|
97
|
+
})`;
|
|
98
|
+
|
|
99
|
+
const SKIP = "html,head,script,style,meta,link,title,noscript,template";
|
|
100
|
+
|
|
101
|
+
/** `window.__vfCollect(params)`: seeks every timeline, then describes the elements asked for. Returns plain JSON. */
|
|
102
|
+
export const COLLECT = String.raw`(function () {
|
|
103
|
+
var rec = window.__vfInspect;
|
|
104
|
+
var SKIP = ${JSON.stringify(SKIP)};
|
|
105
|
+
var NOT_PROPS = { duration: 1, ease: 1, delay: 1, stagger: 1, repeat: 1, yoyo: 1, repeatDelay: 1, paused: 1, overwrite: 1, immediateRender: 1, lazy: 1, startAt: 1, runBackwards: 1, id: 1, data: 1, callbackScope: 1, defaults: 1, yoyoEase: 1, inherit: 1, parent: 1, keyframes: 1, repeatRefresh: 1, reversed: 1, onComplete: 1, onStart: 1, onUpdate: 1, onRepeat: 1, onReverseComplete: 1, onInterrupt: 1, onToggle: 1, onCompleteParams: 1, onReverseCompleteParams: 1, onStartParams: 1, onUpdateParams: 1, onRepeatParams: 1 };
|
|
106
|
+
function norm(s) { return String(s).replace(/\s+/g, " ").trim().toLowerCase(); }
|
|
107
|
+
function offsetOf(el) {
|
|
108
|
+
var sum = 0;
|
|
109
|
+
for (var n = el; n && n.nodeType === 1; n = n.parentElement) { var s = parseFloat(n.getAttribute("data-start")); if (isFinite(s)) sum += s; }
|
|
110
|
+
return sum;
|
|
111
|
+
}
|
|
112
|
+
function label(n) { return n.tagName.toLowerCase() + (n.id ? "#" + n.id : ""); }
|
|
113
|
+
function timed(el, t) {
|
|
114
|
+
var chain = [];
|
|
115
|
+
for (var n = el; n && n.nodeType === 1; n = n.parentElement) chain.unshift(n);
|
|
116
|
+
var local = t;
|
|
117
|
+
for (var i = 0; i < chain.length; i++) {
|
|
118
|
+
var s = parseFloat(chain[i].getAttribute("data-start"));
|
|
119
|
+
if (!isFinite(s)) continue;
|
|
120
|
+
var d = parseFloat(chain[i].getAttribute("data-duration"));
|
|
121
|
+
if (local < s - 1e-6) return { active: false, why: "before data-start " + s + "s of " + label(chain[i]) };
|
|
122
|
+
if (isFinite(d) && local >= s + d - 1e-6) return { active: false, why: "after data-start " + s + "s + data-duration " + d + "s of " + label(chain[i]) };
|
|
123
|
+
local -= s;
|
|
124
|
+
}
|
|
125
|
+
return { active: true };
|
|
126
|
+
}
|
|
127
|
+
function pathOf(el) {
|
|
128
|
+
if (el.id && document.querySelectorAll("#" + CSS.escape(el.id)).length === 1) return "#" + CSS.escape(el.id);
|
|
129
|
+
var parts = [];
|
|
130
|
+
for (var n = el; n && n.nodeType === 1 && n !== document.documentElement; n = n.parentElement) {
|
|
131
|
+
if (n.id && document.querySelectorAll("#" + CSS.escape(n.id)).length === 1) { parts.unshift("#" + CSS.escape(n.id)); break; }
|
|
132
|
+
var part = n.tagName.toLowerCase();
|
|
133
|
+
var cls = Array.prototype.filter.call(n.classList, function (c) { return !/^vf-/.test(c); }).slice(0, 2);
|
|
134
|
+
if (cls.length) part += "." + cls.map(CSS.escape).join(".");
|
|
135
|
+
var sibs = n.parentElement ? Array.prototype.filter.call(n.parentElement.children, function (c) { return c.tagName === n.tagName; }) : [];
|
|
136
|
+
if (sibs.length > 1) part += ":nth-of-type(" + (sibs.indexOf(n) + 1) + ")";
|
|
137
|
+
parts.unshift(part);
|
|
138
|
+
if (n === document.body) break;
|
|
139
|
+
}
|
|
140
|
+
return parts.join(" > ");
|
|
141
|
+
}
|
|
142
|
+
function globalStart(tw) {
|
|
143
|
+
var s = 0;
|
|
144
|
+
for (var n = tw; n && n.parent && n.parent !== gsap.globalTimeline; n = n.parent) s += n.startTime();
|
|
145
|
+
return s;
|
|
146
|
+
}
|
|
147
|
+
function plain(v) {
|
|
148
|
+
if (typeof v === "number" || typeof v === "boolean") return v;
|
|
149
|
+
if (typeof v === "string") return v.length > 80 ? v.slice(0, 77) + "..." : v;
|
|
150
|
+
if (typeof v === "function") return "(function)";
|
|
151
|
+
if (v && v.nodeType === 1) return "<" + label(v) + ">";
|
|
152
|
+
try { var j = JSON.stringify(v); return j.length > 80 ? j.slice(0, 77) + "..." : j; } catch (e) { return "(object)"; }
|
|
153
|
+
}
|
|
154
|
+
function props(vars) {
|
|
155
|
+
var out = {};
|
|
156
|
+
Object.keys(vars || {}).forEach(function (k) { if (!NOT_PROPS[k]) out[k] = plain(vars[k]); });
|
|
157
|
+
return out;
|
|
158
|
+
}
|
|
159
|
+
function allTweens() {
|
|
160
|
+
var out = [];
|
|
161
|
+
var seen = new Set();
|
|
162
|
+
var tls = [];
|
|
163
|
+
var reg = window.__timelines || {};
|
|
164
|
+
Object.keys(reg).forEach(function (k) { if (reg[k] && tls.indexOf(reg[k]) < 0) tls.push(reg[k]); });
|
|
165
|
+
function add(tw, onTimeline) {
|
|
166
|
+
if (seen.has(tw)) return;
|
|
167
|
+
seen.add(tw);
|
|
168
|
+
var info = rec.tweens.get(tw) || null;
|
|
169
|
+
var vars = tw.vars || {};
|
|
170
|
+
var targets = [];
|
|
171
|
+
try { targets = tw.targets().filter(function (t) { return t && t.nodeType === 1; }); } catch (e) {}
|
|
172
|
+
if (!targets.length && (!onTimeline || !Object.keys(props(vars)).length)) return;
|
|
173
|
+
var hostOffset = 0;
|
|
174
|
+
var first = targets[0];
|
|
175
|
+
var tlRoot = tw; while (tlRoot.parent && tlRoot.parent !== gsap.globalTimeline) tlRoot = tlRoot.parent;
|
|
176
|
+
tls.forEach(function (tl) { if (tl === tlRoot) { var comp = tl.__vfHost; if (comp) hostOffset = offsetOf(comp); } });
|
|
177
|
+
var start = (onTimeline ? globalStart(tw) : 0) + hostOffset;
|
|
178
|
+
var ease = typeof vars.ease === "string" ? vars.ease : null;
|
|
179
|
+
out.push({
|
|
180
|
+
tween: tw, targets: targets, method: info ? info.method : null, stack: info ? info.stack : "", onTimeline: onTimeline,
|
|
181
|
+
start: Math.round(start * 1000) / 1000, duration: Math.round(tw.duration() * 1000) / 1000, ease: ease,
|
|
182
|
+
props: props(vars), from: vars.startAt ? props(vars.startAt) : null, runBackwards: Boolean(vars.runBackwards),
|
|
183
|
+
stagger: vars.stagger !== undefined ? plain(vars.stagger) : null,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
tls.forEach(function (tl) {
|
|
187
|
+
tl.getChildren(true, true, false).forEach(function (tw) { add(tw, true); });
|
|
188
|
+
});
|
|
189
|
+
rec.standalone.forEach(function (s) { add(s.tween, false); var last = out[out.length - 1]; if (last && last.tween === s.tween) { last.method = s.method; last.stack = s.stack; } });
|
|
190
|
+
return out;
|
|
191
|
+
}
|
|
192
|
+
function seek(t) {
|
|
193
|
+
var reg = window.__timelines || {};
|
|
194
|
+
Object.keys(reg).forEach(function (k) {
|
|
195
|
+
var tl = reg[k];
|
|
196
|
+
if (!tl || typeof tl.time !== "function") return;
|
|
197
|
+
var host = document.querySelector('[data-composition-id="' + k + '"]');
|
|
198
|
+
var comp = !host ? null : host.hasAttribute("data-composition-src") ? host : host.parentElement && host.parentElement.hasAttribute("data-composition-src") ? host.parentElement : null;
|
|
199
|
+
tl.__vfHost = comp;
|
|
200
|
+
var local = comp ? t - offsetOf(comp) : t;
|
|
201
|
+
tl.pause();
|
|
202
|
+
tl.time(Math.max(0, Math.min(local, tl.duration())), false);
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
function ancestors(el) { var out = []; for (var n = el; n && n.nodeType === 1; n = n.parentElement) out.push(n); return out; }
|
|
206
|
+
window.__vfCollect = function (p) {
|
|
207
|
+
seek(p.at);
|
|
208
|
+
var tweens = allTweens();
|
|
209
|
+
var all = Array.prototype.slice.call(document.body.querySelectorAll("*")).filter(function (e) { return !e.matches(SKIP); });
|
|
210
|
+
var found;
|
|
211
|
+
if (p.selector) found = Array.prototype.slice.call(document.querySelectorAll(p.selector)).filter(function (e) { return !e.matches(SKIP); });
|
|
212
|
+
else if (p.text) {
|
|
213
|
+
var needle = norm(p.text);
|
|
214
|
+
found = all.filter(function (e) {
|
|
215
|
+
if (norm(e.textContent).indexOf(needle) < 0) return false;
|
|
216
|
+
return !Array.prototype.some.call(e.children, function (c) { return norm(c.textContent).indexOf(needle) >= 0; });
|
|
217
|
+
});
|
|
218
|
+
} else found = all;
|
|
219
|
+
var cues = rec.cues;
|
|
220
|
+
var out = [];
|
|
221
|
+
var truncated = false;
|
|
222
|
+
found.forEach(function (el) {
|
|
223
|
+
var cs = getComputedStyle(el);
|
|
224
|
+
var r = el.getBoundingClientRect();
|
|
225
|
+
var st = timed(el, p.at);
|
|
226
|
+
var eff = 1;
|
|
227
|
+
ancestors(el).forEach(function (n) { eff *= parseFloat(getComputedStyle(n).opacity); });
|
|
228
|
+
var onScreen = r.right > 0 && r.bottom > 0 && r.left < 1080 && r.top < 1920;
|
|
229
|
+
var why = !st.active ? st.why : cs.display === "none" ? "display none" : cs.visibility === "hidden" ? "visibility hidden" : eff <= 0.001 ? "opacity 0" : r.width * r.height === 0 ? "no size" : !onScreen ? "outside the frame" : null;
|
|
230
|
+
if (!p.selector && !p.text && why) return;
|
|
231
|
+
if (out.length >= p.limit) { truncated = true; return; }
|
|
232
|
+
var own = el.getAttribute("data-vfsrc");
|
|
233
|
+
var via = null;
|
|
234
|
+
if (!own) { var a = el.closest("[data-vfsrc]"); if (a) via = { src: a.getAttribute("data-vfsrc"), path: pathOf(a) }; }
|
|
235
|
+
var anc = ancestors(el);
|
|
236
|
+
var rules = [];
|
|
237
|
+
p.rules.forEach(function (rule) { try { if (el.matches(rule.sel)) rules.push(rule.i); } catch (e) {} });
|
|
238
|
+
var upper = [];
|
|
239
|
+
anc.slice(1, 9).forEach(function (n) {
|
|
240
|
+
var rs = [];
|
|
241
|
+
p.rules.forEach(function (rule) { try { if (n.matches(rule.sel)) rs.push(rule.i); } catch (e) {} });
|
|
242
|
+
upper.push({ path: pathOf(n), src: n.getAttribute("data-vfsrc"), rules: rs });
|
|
243
|
+
});
|
|
244
|
+
var tw = [];
|
|
245
|
+
tweens.forEach(function (t, idx) {
|
|
246
|
+
var hit = t.targets.indexOf(el);
|
|
247
|
+
if (hit >= 0) tw.push({ i: idx, via: null });
|
|
248
|
+
else for (var k = 0; k < t.targets.length; k++) { if (t.targets[k].contains(el)) { tw.push({ i: idx, via: pathOf(t.targets[k]) }); break; } }
|
|
249
|
+
});
|
|
250
|
+
var cu = [];
|
|
251
|
+
cues.forEach(function (c, idx) {
|
|
252
|
+
if (c.kind === "block" && c.el && c.el.contains(el)) cu.push(idx);
|
|
253
|
+
if (c.kind === "transition" && ((c.from && c.from.contains(el)) || (c.to && c.to.contains(el)))) cu.push(idx);
|
|
254
|
+
});
|
|
255
|
+
out.push({
|
|
256
|
+
path: pathOf(el), tag: el.tagName.toLowerCase(), id: el.id || null, classes: Array.prototype.slice.call(el.classList),
|
|
257
|
+
src: own, via: via, visible: !why, hidden: why,
|
|
258
|
+
box: { x: Math.round(r.left * 10) / 10, y: Math.round(r.top * 10) / 10, w: Math.round(r.width * 10) / 10, h: Math.round(r.height * 10) / 10 },
|
|
259
|
+
opacityEffective: Math.round(eff * 1000) / 1000,
|
|
260
|
+
styles: { color: cs.color, backgroundColor: cs.backgroundColor, fontFamily: cs.fontFamily, fontSize: cs.fontSize, fontWeight: cs.fontWeight, opacity: cs.opacity, transform: cs.transform },
|
|
261
|
+
text: norm(el.textContent).slice(0, 60),
|
|
262
|
+
rules: rules, upper: upper, tweens: tw, cues: cu,
|
|
263
|
+
});
|
|
264
|
+
});
|
|
265
|
+
return {
|
|
266
|
+
matched: found.length, truncated: truncated, elements: out,
|
|
267
|
+
tweens: tweens.map(function (t) { return { method: t.method, stack: t.stack, onTimeline: t.onTimeline, start: t.start, duration: t.duration, ease: t.ease, props: t.props, from: t.from, runBackwards: t.runBackwards, stagger: t.stagger, targets: t.targets.length }; }),
|
|
268
|
+
cues: cues.map(function (c) { return { kind: c.kind, stack: c.stack, start: c.start === undefined ? null : c.start, duration: c.duration === undefined ? null : c.duration, options: c.options || null, host: c.el ? pathOf(c.el) : null, from: c.from ? pathOf(c.from) : null, to: c.to ? pathOf(c.to) : null }; }),
|
|
269
|
+
errors: rec.errors,
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
})();`;
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
import { inlineDecls, mapStack, specificity, type Decl, type Pos, type Rule, type Scan } from "./source.js";
|
|
2
|
+
|
|
3
|
+
/** What the page hands back (see COLLECT in page-scripts.ts). */
|
|
4
|
+
export interface RawTween {
|
|
5
|
+
method: string | null;
|
|
6
|
+
stack: string;
|
|
7
|
+
onTimeline: boolean;
|
|
8
|
+
start: number;
|
|
9
|
+
duration: number;
|
|
10
|
+
ease: string | null;
|
|
11
|
+
props: Record<string, string | number | boolean>;
|
|
12
|
+
from: Record<string, string | number | boolean> | null;
|
|
13
|
+
runBackwards: boolean;
|
|
14
|
+
stagger: string | number | boolean | null;
|
|
15
|
+
targets: number;
|
|
16
|
+
}
|
|
17
|
+
export interface RawCue {
|
|
18
|
+
kind: "block" | "transition";
|
|
19
|
+
stack: string;
|
|
20
|
+
start: number | null;
|
|
21
|
+
duration: number | null;
|
|
22
|
+
options: Record<string, unknown> | null;
|
|
23
|
+
host: string | null;
|
|
24
|
+
from: string | null;
|
|
25
|
+
to: string | null;
|
|
26
|
+
}
|
|
27
|
+
export interface RawElement {
|
|
28
|
+
path: string;
|
|
29
|
+
tag: string;
|
|
30
|
+
id: string | null;
|
|
31
|
+
classes: string[];
|
|
32
|
+
src: string | null;
|
|
33
|
+
via: { src: string; path: string } | null;
|
|
34
|
+
visible: boolean;
|
|
35
|
+
hidden: string | null;
|
|
36
|
+
box: { x: number; y: number; w: number; h: number };
|
|
37
|
+
opacityEffective: number;
|
|
38
|
+
styles: Record<string, string>;
|
|
39
|
+
text: string;
|
|
40
|
+
rules: number[];
|
|
41
|
+
upper: Array<{ path: string; src: string | null; rules: number[] }>;
|
|
42
|
+
tweens: Array<{ i: number; via: string | null }>;
|
|
43
|
+
cues: number[];
|
|
44
|
+
}
|
|
45
|
+
export interface Raw {
|
|
46
|
+
matched: number;
|
|
47
|
+
truncated: boolean;
|
|
48
|
+
elements: RawElement[];
|
|
49
|
+
tweens: RawTween[];
|
|
50
|
+
cues: RawCue[];
|
|
51
|
+
errors: string[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface SceneFile {
|
|
55
|
+
label: string;
|
|
56
|
+
source: string;
|
|
57
|
+
scan: Scan;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface Located extends Pos {
|
|
61
|
+
/** The source line, trimmed. */
|
|
62
|
+
code: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface CssDecl {
|
|
66
|
+
property: string;
|
|
67
|
+
value: string;
|
|
68
|
+
important: boolean;
|
|
69
|
+
/** Where the declaration is. */
|
|
70
|
+
at: Located;
|
|
71
|
+
/** `rule` for a stylesheet, `inline` for a style attribute. */
|
|
72
|
+
from: "rule" | "inline";
|
|
73
|
+
selector: string | null;
|
|
74
|
+
atrule: string | null;
|
|
75
|
+
/** The rule's own line, when it is a rule. */
|
|
76
|
+
rule: Pos | null;
|
|
77
|
+
/** True when this declaration wins the cascade for its property (an inline GSAP value can still override it at runtime). */
|
|
78
|
+
wins: boolean;
|
|
79
|
+
/** Set when the element does not set the property itself and gets it from this ancestor. */
|
|
80
|
+
inheritedFrom: string | null;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface TweenReport {
|
|
84
|
+
/** `to`, `from`, `fromTo` or `set`; null when GSAP made it without a call the inspector saw. */
|
|
85
|
+
method: string | null;
|
|
86
|
+
start: number;
|
|
87
|
+
end: number;
|
|
88
|
+
duration: number;
|
|
89
|
+
ease: string | null;
|
|
90
|
+
props: Record<string, string | number | boolean>;
|
|
91
|
+
from: Record<string, string | number | boolean> | null;
|
|
92
|
+
stagger: string | number | boolean | null;
|
|
93
|
+
/** Elements this tween animates; more than one means a shared tween. */
|
|
94
|
+
targets: number;
|
|
95
|
+
/** The path of the ancestor the tween targets, when it is not the element itself. */
|
|
96
|
+
via: string | null;
|
|
97
|
+
/** Where the tween call is written. */
|
|
98
|
+
site: Located | null;
|
|
99
|
+
/** The vfrey cue that ran it, with the line that called the cue. */
|
|
100
|
+
cue: { name: string; site: Located | null } | null;
|
|
101
|
+
/** `vfrey.transition` made this one (no line of the scene wrote it). */
|
|
102
|
+
madeBy: { name: string; site: Located | null } | null;
|
|
103
|
+
/** CSS families (color, background, font, opacity, transform) this tween moves. */
|
|
104
|
+
affects: string[];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface CueReport {
|
|
108
|
+
name: string;
|
|
109
|
+
detail: string;
|
|
110
|
+
site: Located | null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface ElementReport {
|
|
114
|
+
selector: string;
|
|
115
|
+
tag: string;
|
|
116
|
+
id: string | null;
|
|
117
|
+
classes: string[];
|
|
118
|
+
/** The opening tag in the scene's file; null when a script created the element. */
|
|
119
|
+
source: Located | null;
|
|
120
|
+
scriptCreated: boolean;
|
|
121
|
+
/** For a script-created element: the nearest ancestor that is in the file. */
|
|
122
|
+
nearestSource: (Located & { selector: string }) | null;
|
|
123
|
+
visible: boolean;
|
|
124
|
+
hiddenBecause: string | null;
|
|
125
|
+
box: { x: number; y: number; w: number; h: number };
|
|
126
|
+
styles: Record<string, string>;
|
|
127
|
+
css: Record<string, CssDecl[]>;
|
|
128
|
+
tweens: TweenReport[];
|
|
129
|
+
cues: CueReport[];
|
|
130
|
+
text: string;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface InspectReport {
|
|
134
|
+
scene: string;
|
|
135
|
+
engine: "html";
|
|
136
|
+
at: number;
|
|
137
|
+
frame: { width: number; height: number };
|
|
138
|
+
query: { selector: string | null; text: string | null };
|
|
139
|
+
matched: number;
|
|
140
|
+
shown: number;
|
|
141
|
+
truncated: boolean;
|
|
142
|
+
elements: ElementReport[];
|
|
143
|
+
warnings: string[];
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export const FAMILIES: Record<string, string[]> = {
|
|
147
|
+
color: ["color"],
|
|
148
|
+
background: ["background", "background-color", "background-image"],
|
|
149
|
+
font: ["font", "font-family", "font-size", "font-weight"],
|
|
150
|
+
opacity: ["opacity"],
|
|
151
|
+
transform: ["transform", "translate", "scale", "rotate"],
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const GSAP_FAMILY: Array<[RegExp, string]> = [
|
|
155
|
+
[/^(x|y|z|xPercent|yPercent|scale|scaleX|scaleY|rotation|rotate|rotationX|rotationY|skewX|skewY|transform|translate|translateX|translateY|transformOrigin)$/, "transform"],
|
|
156
|
+
[/^(opacity|autoAlpha)$/, "opacity"],
|
|
157
|
+
[/^color$/, "color"],
|
|
158
|
+
[/^(backgroundColor|background)$/, "background"],
|
|
159
|
+
[/^(fontSize|fontWeight|fontFamily)$/, "font"],
|
|
160
|
+
];
|
|
161
|
+
|
|
162
|
+
export function familiesOf(props: Record<string, unknown>): string[] {
|
|
163
|
+
const out = new Set<string>();
|
|
164
|
+
for (const key of Object.keys(props)) for (const [re, family] of GSAP_FAMILY) if (re.test(key)) out.add(family);
|
|
165
|
+
return [...out];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function lineOf(files: Map<string, SceneFile>, pos: Pos, fromCol = false): Located {
|
|
169
|
+
const text = files.get(pos.file)?.source.split("\n")[pos.line - 1] ?? "";
|
|
170
|
+
return { ...pos, code: (fromCol ? text.slice(pos.col - 1) : text).trim().slice(0, 110) };
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export function parseSrc(src: string): Pos | null {
|
|
174
|
+
const m = /^(.*):(\d+):(\d+)$/.exec(src);
|
|
175
|
+
return m ? { file: m[1]!, line: Number(m[2]), col: Number(m[3]) } : null;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface BuildInput {
|
|
179
|
+
raw: Raw;
|
|
180
|
+
files: Map<string, SceneFile>;
|
|
181
|
+
rules: Rule[];
|
|
182
|
+
origin: string;
|
|
183
|
+
scene: string;
|
|
184
|
+
at: number;
|
|
185
|
+
query: { selector: string | null; text: string | null };
|
|
186
|
+
warnings: string[];
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function markWinner(decls: CssDecl[], specs: number[]): void {
|
|
190
|
+
// important beats normal, an inline style beats a rule, then specificity, then the later declaration.
|
|
191
|
+
const key = (d: CssDecl, i: number) => [d.important ? 1 : 0, d.from === "inline" ? 1 : 0, specs[i]!, i];
|
|
192
|
+
let best = 0;
|
|
193
|
+
decls.forEach((d, i) => {
|
|
194
|
+
const a = key(d, i);
|
|
195
|
+
const b = key(decls[best]!, best);
|
|
196
|
+
for (let n = 0; n < a.length; n += 1) {
|
|
197
|
+
if (a[n] !== b[n]) {
|
|
198
|
+
if (a[n]! > b[n]!) best = i;
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
decls.forEach((d, i) => {
|
|
204
|
+
d.wins = i === best;
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** Joins what the page saw with the scene's source: positions, CSS rules, tween call sites. */
|
|
209
|
+
export function buildReport(input: BuildInput): InspectReport {
|
|
210
|
+
const { raw, files, rules, origin } = input;
|
|
211
|
+
const fileOf = (url: string): string | null => {
|
|
212
|
+
if (!url.startsWith(`${origin}/`)) return null;
|
|
213
|
+
return decodeURIComponent(url.slice(origin.length + 1).split(/[?#]/)[0]!);
|
|
214
|
+
};
|
|
215
|
+
const locate = (pos: Pos | null, fromCol = false): Located | null => (pos ? lineOf(files, pos, fromCol) : null);
|
|
216
|
+
const tweenReports = raw.tweens.map((t) => {
|
|
217
|
+
const mapped = mapStack(t.stack, fileOf);
|
|
218
|
+
return { raw: t, mapped };
|
|
219
|
+
});
|
|
220
|
+
const toCue = (c: RawCue): CueReport => {
|
|
221
|
+
const mapped = mapStack(c.stack, fileOf);
|
|
222
|
+
const site = locate(mapped.site);
|
|
223
|
+
if (c.kind === "block") return { name: "vfrey.block", detail: `${c.host ?? "?"} starts at ${c.start}s${c.duration != null ? `, lasts ${c.duration}s` : ""}`, site };
|
|
224
|
+
const o = c.options ?? {};
|
|
225
|
+
const bits = [o.type, o.at != null ? `at ${o.at}s` : null, o.duration != null ? `${o.duration}s` : null].filter(Boolean).join(", ");
|
|
226
|
+
return { name: "vfrey.transition", detail: `${c.from ?? "?"} -> ${c.to ?? "?"}${bits ? ` (${bits})` : ""}`, site };
|
|
227
|
+
};
|
|
228
|
+
const cueReports = raw.cues.map(toCue);
|
|
229
|
+
const scanFor = (pos: Pos) => files.get(pos.file)?.scan.tags.find((t) => t.line === pos.line && t.col === pos.col) ?? null;
|
|
230
|
+
|
|
231
|
+
const elements: ElementReport[] = raw.elements.map((e) => {
|
|
232
|
+
const srcPos = e.src ? parseSrc(e.src) : null;
|
|
233
|
+
const viaPos = e.via ? parseSrc(e.via.src) : null;
|
|
234
|
+
const css: Record<string, CssDecl[]> = {};
|
|
235
|
+
const declsOf = (rs: number[], pos: Pos | null): Array<{ rule: Rule | null; d: Decl }> => {
|
|
236
|
+
const out: Array<{ rule: Rule | null; d: Decl }> = [];
|
|
237
|
+
for (const i of rs) for (const d of rules[i]!.decls) out.push({ rule: rules[i]!, d });
|
|
238
|
+
const t = pos ? scanFor(pos) : null;
|
|
239
|
+
if (t?.attrs.style && pos) for (const d of inlineDecls(t.attrs.style, pos)) out.push({ rule: null, d });
|
|
240
|
+
return out;
|
|
241
|
+
};
|
|
242
|
+
const family = (decls: Array<{ rule: Rule | null; d: Decl }>, props: string[], at: Pos | null, inheritedFrom: string | null): CssDecl[] => {
|
|
243
|
+
const list: CssDecl[] = [];
|
|
244
|
+
const specs: number[] = [];
|
|
245
|
+
for (const { rule, d } of decls) {
|
|
246
|
+
if (!props.includes(d.prop)) continue;
|
|
247
|
+
const file = rule ? rule.file : at!.file;
|
|
248
|
+
list.push({
|
|
249
|
+
property: d.prop,
|
|
250
|
+
value: d.value,
|
|
251
|
+
important: d.important,
|
|
252
|
+
at: lineOf(files, { file, line: d.line, col: d.col }),
|
|
253
|
+
from: rule ? "rule" : "inline",
|
|
254
|
+
selector: rule ? rule.selectorText : null,
|
|
255
|
+
atrule: rule?.atrule ?? null,
|
|
256
|
+
rule: rule ? { file: rule.file, line: rule.line, col: rule.col } : null,
|
|
257
|
+
wins: false,
|
|
258
|
+
inheritedFrom,
|
|
259
|
+
});
|
|
260
|
+
specs.push(rule ? specificity(rule.selector) : 0);
|
|
261
|
+
}
|
|
262
|
+
markWinner(list, specs);
|
|
263
|
+
return list;
|
|
264
|
+
};
|
|
265
|
+
const own = declsOf(e.rules, srcPos);
|
|
266
|
+
for (const [name, props] of Object.entries(FAMILIES)) {
|
|
267
|
+
let list = family(own, props, srcPos, null);
|
|
268
|
+
if (list.length === 0 && (name === "color" || name === "font")) {
|
|
269
|
+
for (const up of e.upper) {
|
|
270
|
+
list = family(declsOf(up.rules, up.src ? parseSrc(up.src) : null), props, up.src ? parseSrc(up.src) : null, up.path);
|
|
271
|
+
if (list.length) break;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if (list.length) css[name] = list;
|
|
275
|
+
}
|
|
276
|
+
const tweens: TweenReport[] = e.tweens.map(({ i, via }) => {
|
|
277
|
+
const { raw: t, mapped } = tweenReports[i]!;
|
|
278
|
+
const transition = raw.cues.findIndex((c, ci) => c.kind === "transition" && e.cues.includes(ci));
|
|
279
|
+
const madeBy = !mapped.site && transition >= 0 ? { name: "vfrey.transition", site: cueReports[transition]!.site } : null;
|
|
280
|
+
return {
|
|
281
|
+
method: t.method,
|
|
282
|
+
start: t.start,
|
|
283
|
+
end: Math.round((t.start + t.duration) * 1000) / 1000,
|
|
284
|
+
duration: t.duration,
|
|
285
|
+
ease: t.ease,
|
|
286
|
+
props: t.props,
|
|
287
|
+
from: t.from,
|
|
288
|
+
stagger: t.stagger,
|
|
289
|
+
targets: t.targets,
|
|
290
|
+
via,
|
|
291
|
+
site: locate(mapped.site),
|
|
292
|
+
cue: mapped.cue ? { name: mapped.cue.name, site: locate(mapped.cue.site) } : null,
|
|
293
|
+
madeBy,
|
|
294
|
+
affects: familiesOf({ ...t.props, ...(t.from ?? {}) }),
|
|
295
|
+
};
|
|
296
|
+
});
|
|
297
|
+
for (const ci of e.cues) {
|
|
298
|
+
const cue = raw.cues[ci]!;
|
|
299
|
+
if (cue.kind !== "transition") continue;
|
|
300
|
+
const at = typeof cue.options?.at === "number" ? cue.options.at : null;
|
|
301
|
+
raw.tweens.forEach((t, ti) => {
|
|
302
|
+
if (t.targets !== 0 || !("p" in t.props) || (at !== null && Math.abs(t.start - at) > 0.002) || tweens.some((x) => x.start === t.start && x.madeBy)) return;
|
|
303
|
+
void ti;
|
|
304
|
+
tweens.push({
|
|
305
|
+
method: t.method,
|
|
306
|
+
start: t.start,
|
|
307
|
+
end: Math.round((t.start + t.duration) * 1000) / 1000,
|
|
308
|
+
duration: t.duration,
|
|
309
|
+
ease: t.ease,
|
|
310
|
+
props: t.props,
|
|
311
|
+
from: null,
|
|
312
|
+
stagger: null,
|
|
313
|
+
targets: 0,
|
|
314
|
+
via: null,
|
|
315
|
+
site: null,
|
|
316
|
+
cue: null,
|
|
317
|
+
madeBy: { name: "vfrey.transition (progress p drives the shader and the shots' opacity)", site: cueReports[ci]!.site },
|
|
318
|
+
affects: ["opacity"],
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
tweens.sort((a, b) => a.start - b.start);
|
|
323
|
+
return {
|
|
324
|
+
selector: e.path,
|
|
325
|
+
tag: e.tag,
|
|
326
|
+
id: e.id,
|
|
327
|
+
classes: e.classes,
|
|
328
|
+
source: srcPos ? locate(srcPos, true) : null,
|
|
329
|
+
scriptCreated: !srcPos,
|
|
330
|
+
nearestSource: viaPos && e.via ? { ...locate(viaPos, true)!, selector: e.via.path } : null,
|
|
331
|
+
visible: e.visible,
|
|
332
|
+
hiddenBecause: e.hidden,
|
|
333
|
+
box: e.box,
|
|
334
|
+
styles: e.styles,
|
|
335
|
+
css,
|
|
336
|
+
tweens,
|
|
337
|
+
cues: e.cues.map((i) => cueReports[i]!),
|
|
338
|
+
text: e.text,
|
|
339
|
+
};
|
|
340
|
+
});
|
|
341
|
+
return {
|
|
342
|
+
scene: input.scene,
|
|
343
|
+
engine: "html",
|
|
344
|
+
at: input.at,
|
|
345
|
+
frame: { width: 1080, height: 1920 },
|
|
346
|
+
query: input.query,
|
|
347
|
+
matched: raw.matched,
|
|
348
|
+
shown: elements.length,
|
|
349
|
+
truncated: raw.truncated,
|
|
350
|
+
elements,
|
|
351
|
+
warnings: [...input.warnings, ...raw.errors.map((e) => `page: ${e}`)],
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
const loc = (l: Located | Pos | null) => (l ? `${l.file}:${l.line}:${l.col}` : "?");
|
|
356
|
+
const secs = (n: number) => `${n}s`;
|
|
357
|
+
const pv = (props: Record<string, unknown>) => Object.entries(props).map(([k, v]) => `${k}:${v}`).join(" ");
|
|
358
|
+
|
|
359
|
+
function tweenLine(t: TweenReport, n: number): string[] {
|
|
360
|
+
const kind = t.method ?? "tween";
|
|
361
|
+
const body = kind === "fromTo" && t.from ? `{${pv(t.from)}} -> {${pv(t.props)}}` : `{${pv(t.props)}}`;
|
|
362
|
+
const ease = t.duration > 0 ? ` ease ${t.ease ?? "default"}` : "";
|
|
363
|
+
const out = [` ${n}. ${kind} ${body} start ${secs(t.start)} duration ${secs(t.duration)} ends ${secs(t.end)}${ease}${t.stagger != null ? ` stagger ${t.stagger}` : ""}${t.targets > 1 ? ` (shared by ${t.targets} elements)` : ""}${t.via ? ` (targets ancestor ${t.via})` : ""}`];
|
|
364
|
+
if (t.site) out.push(` at ${loc(t.site)} ${t.site.code}`);
|
|
365
|
+
if (t.cue) out.push(` cue ${t.cue.name} at ${loc(t.cue.site)}${t.cue.site ? ` ${t.cue.site.code}` : ""}`);
|
|
366
|
+
if (t.madeBy) out.push(` made by ${t.madeBy.name} at ${loc(t.madeBy.site)}${t.madeBy.site ? ` ${t.madeBy.site.code}` : ""}`);
|
|
367
|
+
if (!t.site && !t.madeBy) out.push(" (call site not traced)");
|
|
368
|
+
return out;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/** The report as short text for an agent. */
|
|
372
|
+
export function formatText(r: InspectReport, maxTweens = 12): string {
|
|
373
|
+
const what = r.query.selector ? `selector ${r.query.selector}` : r.query.text ? `text "${r.query.text}"` : "all visible elements";
|
|
374
|
+
const lines = [`${r.scene} at ${secs(r.at)}, frame ${r.frame.width}x${r.frame.height}: ${r.matched} match${r.matched === 1 ? "" : "es"} for ${what}${r.truncated ? ` (showing ${r.shown})` : ""}`];
|
|
375
|
+
for (const w of r.warnings) lines.push(`! ${w}`);
|
|
376
|
+
if (r.elements.length === 0) lines.push("No element matched. Fix: check the selector or text against index.html, or try another --at time.");
|
|
377
|
+
for (const e of r.elements) {
|
|
378
|
+
lines.push("");
|
|
379
|
+
lines.push(`${e.selector} <${e.tag}${e.id ? `#${e.id}` : ""}${e.classes.length ? `.${e.classes.join(".")}` : ""}>${e.text ? ` "${e.text}"` : ""}`);
|
|
380
|
+
if (e.source) lines.push(` source ${loc(e.source)} ${e.source.code}`);
|
|
381
|
+
else if (e.nearestSource) lines.push(` source created by a script; nearest markup ${e.nearestSource.selector} at ${loc(e.nearestSource)} ${e.nearestSource.code}`);
|
|
382
|
+
else lines.push(" source created by a script (no markup for it in the file)");
|
|
383
|
+
lines.push(` box x ${e.box.x} y ${e.box.y} ${e.box.w}x${e.box.h} ${e.visible ? "visible" : `not visible: ${e.hiddenBecause}`}`);
|
|
384
|
+
const s = e.styles;
|
|
385
|
+
lines.push(` style color ${s.color} | background ${s.backgroundColor} | font ${s.fontFamily} ${s.fontSize} w${s.fontWeight} | opacity ${s.opacity} | transform ${s.transform}`);
|
|
386
|
+
const families = Object.keys(e.css);
|
|
387
|
+
if (families.length) {
|
|
388
|
+
lines.push(" css (* = wins the cascade; a GSAP tween below may still override it at runtime)");
|
|
389
|
+
for (const family of families) {
|
|
390
|
+
for (const d of e.css[family]!) {
|
|
391
|
+
const where = d.from === "inline" ? "style attribute" : `${d.selector}${d.atrule ? ` in ${d.atrule}` : ""}`;
|
|
392
|
+
lines.push(` ${d.wins ? "*" : " "} ${d.property}: ${d.value}${d.important ? " !important" : ""} ${where} at ${loc(d.at)}${d.rule ? ` (rule starts ${d.rule.line}:${d.rule.col})` : ""}${d.inheritedFrom ? ` inherited from ${d.inheritedFrom}` : ""}`);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
} else lines.push(" css no rule sets color, background, font, opacity or transform on it (inherited, or set by a script)");
|
|
396
|
+
if (e.cues.length) for (const c of e.cues) lines.push(` cue ${c.name} ${c.detail} at ${loc(c.site)}${c.site ? ` ${c.site.code}` : ""}`);
|
|
397
|
+
if (e.tweens.length) {
|
|
398
|
+
lines.push(` tweens on the timeline (${e.tweens.length})`);
|
|
399
|
+
e.tweens.slice(0, maxTweens).forEach((t, i) => lines.push(...tweenLine(t, i + 1)));
|
|
400
|
+
if (e.tweens.length > maxTweens) lines.push(` ... ${e.tweens.length - maxTweens} more (use --json for all)`);
|
|
401
|
+
} else lines.push(" tweens none target it");
|
|
402
|
+
}
|
|
403
|
+
return `${lines.join("\n")}\n`;
|
|
404
|
+
}
|
|
405
|
+
|