@ignix-social/editor 0.1.0
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 +190 -0
- package/NOTICE +54 -0
- package/README.md +23 -0
- package/bin/ignix-editor.mjs +8 -0
- package/package.json +53 -0
- package/patches/index.mjs +53 -0
- package/scripts/build-ffmpeg-macos.sh +35 -0
- package/scripts/build-whisper-macos.sh +21 -0
- package/scripts/vendor.mjs +41 -0
- package/skills/ignix-editor/SKILL.md +132 -0
- package/src/audio.mjs +31 -0
- package/src/binaries.json +46 -0
- package/src/binaries.mjs +83 -0
- package/src/cli.mjs +254 -0
- package/src/prepare.mjs +74 -0
- package/src/runtime/ignix-frame.js +92 -0
- package/src/transcribe.mjs +71 -0
- package/src/validate.mjs +71 -0
- package/templates/blank/index.html +41 -0
- package/vendor/hyperframes/README.md +181 -0
- package/vendor/hyperframes/UPSTREAM.json +12 -0
- package/vendor/hyperframes/bin/hyperframes-localize-fonts.mjs +12 -0
- package/vendor/hyperframes/bin/hyperframes.mjs +11 -0
- package/vendor/hyperframes/dist/add-LR3ZR2A5.js +79 -0
- package/vendor/hyperframes/dist/agentPromptGenerator-VIIPZCJ3.js +143 -0
- package/vendor/hyperframes/dist/animatedGifPrep-P2T6YM7Z.js +34 -0
- package/vendor/hyperframes/dist/asset-BE2DOV72.js +26 -0
- package/vendor/hyperframes/dist/assetCataloger-VBLPHX24.js +340 -0
- package/vendor/hyperframes/dist/auth-RCQB2ZT7.js +60 -0
- package/vendor/hyperframes/dist/autoUpdate-RJAX3DAZ.js +268 -0
- package/vendor/hyperframes/dist/backgroundChecks-H2LCUIMJ.js +61 -0
- package/vendor/hyperframes/dist/backgroundChecksWorker.js +26 -0
- package/vendor/hyperframes/dist/batchRender-FT7AP7XH.js +355 -0
- package/vendor/hyperframes/dist/beat-analyzer.global.js +338 -0
- package/vendor/hyperframes/dist/beats-Y2EOP72P.js +309 -0
- package/vendor/hyperframes/dist/benchmark-MZ7GY3JW.js +231 -0
- package/vendor/hyperframes/dist/browser-HUTAMRQE.js +237 -0
- package/vendor/hyperframes/dist/bundleWithLocalizedFonts-5QOPOB5D.js +52 -0
- package/vendor/hyperframes/dist/capture-RLZA6EMR.js +4079 -0
- package/vendor/hyperframes/dist/capture-SZZ4IYJK.js +290 -0
- package/vendor/hyperframes/dist/captureFile-LYOJOUIE.js +15 -0
- package/vendor/hyperframes/dist/captureTimeout-PA4FYWT5.js +27 -0
- package/vendor/hyperframes/dist/catalog-KYU55EWR.js +1001 -0
- package/vendor/hyperframes/dist/check-TCG4PXLR.js +1697 -0
- package/vendor/hyperframes/dist/checkBrowser-RPMO4OW5.js +1032 -0
- package/vendor/hyperframes/dist/chunk-2EAXUCCE.js +88 -0
- package/vendor/hyperframes/dist/chunk-2EGFTPWD.js +1077 -0
- package/vendor/hyperframes/dist/chunk-2PSPARWP.js +6058 -0
- package/vendor/hyperframes/dist/chunk-2YN64IN5.js +5747 -0
- package/vendor/hyperframes/dist/chunk-3GXQPCJC.js +682 -0
- package/vendor/hyperframes/dist/chunk-3ZP5DXE7.js +15 -0
- package/vendor/hyperframes/dist/chunk-4NWOGZZS.js +1990 -0
- package/vendor/hyperframes/dist/chunk-4PFZPP2N.js +587 -0
- package/vendor/hyperframes/dist/chunk-4THIAPBL.js +128 -0
- package/vendor/hyperframes/dist/chunk-4YYJOFKS.js +28 -0
- package/vendor/hyperframes/dist/chunk-54HJ63Q2.js +29 -0
- package/vendor/hyperframes/dist/chunk-5ETJX6WM.js +89 -0
- package/vendor/hyperframes/dist/chunk-5IAKAQA7.js +389 -0
- package/vendor/hyperframes/dist/chunk-5Z63TBTX.js +37 -0
- package/vendor/hyperframes/dist/chunk-6BEFEWFB.js +25 -0
- package/vendor/hyperframes/dist/chunk-6CSYCFQV.js +68 -0
- package/vendor/hyperframes/dist/chunk-6CTIGJY7.js +154 -0
- package/vendor/hyperframes/dist/chunk-7HG4BFIN.js +93 -0
- package/vendor/hyperframes/dist/chunk-7JZ4FXP2.js +118 -0
- package/vendor/hyperframes/dist/chunk-A2Z4Z4VL.js +2961 -0
- package/vendor/hyperframes/dist/chunk-AMKC3AXA.js +25 -0
- package/vendor/hyperframes/dist/chunk-AVUUN2XD.js +4847 -0
- package/vendor/hyperframes/dist/chunk-AWDFDFI3.js +46 -0
- package/vendor/hyperframes/dist/chunk-AWNBM3MZ.js +94 -0
- package/vendor/hyperframes/dist/chunk-BXCMXMJQ.js +73 -0
- package/vendor/hyperframes/dist/chunk-BZ56MTDX.js +6 -0
- package/vendor/hyperframes/dist/chunk-CFKU7HTK.js +171 -0
- package/vendor/hyperframes/dist/chunk-CWPVM2QV.js +308 -0
- package/vendor/hyperframes/dist/chunk-DPVXBVLL.js +31292 -0
- package/vendor/hyperframes/dist/chunk-DQBY7FRR.js +397 -0
- package/vendor/hyperframes/dist/chunk-E6RPWJVC.js +213 -0
- package/vendor/hyperframes/dist/chunk-EISRN4E6.js +294 -0
- package/vendor/hyperframes/dist/chunk-EOVYQ3IG.js +143 -0
- package/vendor/hyperframes/dist/chunk-F3WZGU7C.js +479 -0
- package/vendor/hyperframes/dist/chunk-FCSIGXXP.js +366 -0
- package/vendor/hyperframes/dist/chunk-FI4I7CME.js +56 -0
- package/vendor/hyperframes/dist/chunk-FLWXXDNS.js +15 -0
- package/vendor/hyperframes/dist/chunk-GK4AIFIH.js +11171 -0
- package/vendor/hyperframes/dist/chunk-GMECXFAN.js +57 -0
- package/vendor/hyperframes/dist/chunk-GULOKZLI.js +155 -0
- package/vendor/hyperframes/dist/chunk-H4YZZ2VQ.js +68 -0
- package/vendor/hyperframes/dist/chunk-H6QMKUYA.js +477 -0
- package/vendor/hyperframes/dist/chunk-HBBJFK6I.js +273 -0
- package/vendor/hyperframes/dist/chunk-HRUGC23L.js +212 -0
- package/vendor/hyperframes/dist/chunk-HVW7ABXD.js +19 -0
- package/vendor/hyperframes/dist/chunk-HW6OYASV.js +344 -0
- package/vendor/hyperframes/dist/chunk-HWKCIWQT.js +3578 -0
- package/vendor/hyperframes/dist/chunk-I465DBM6.js +1214 -0
- package/vendor/hyperframes/dist/chunk-IGLEPPTN.js +24 -0
- package/vendor/hyperframes/dist/chunk-IGNAAHS3.js +433 -0
- package/vendor/hyperframes/dist/chunk-IHFUKJOR.js +85 -0
- package/vendor/hyperframes/dist/chunk-IQ3OUQ5Z.js +213 -0
- package/vendor/hyperframes/dist/chunk-ISN5GRYI.js +20 -0
- package/vendor/hyperframes/dist/chunk-IUZFXWSV.js +446 -0
- package/vendor/hyperframes/dist/chunk-JH556Q42.js +647 -0
- package/vendor/hyperframes/dist/chunk-JTHMTOMQ.js +601 -0
- package/vendor/hyperframes/dist/chunk-K2EQN4VU.js +405 -0
- package/vendor/hyperframes/dist/chunk-K2FTXJYH.js +16044 -0
- package/vendor/hyperframes/dist/chunk-K4WIOZFP.js +32 -0
- package/vendor/hyperframes/dist/chunk-K4WKGXRC.js +18 -0
- package/vendor/hyperframes/dist/chunk-KBJUXVOJ.js +172 -0
- package/vendor/hyperframes/dist/chunk-KC5XXX3X.js +590 -0
- package/vendor/hyperframes/dist/chunk-KNU5COPB.js +29 -0
- package/vendor/hyperframes/dist/chunk-KZI44OPA.js +185 -0
- package/vendor/hyperframes/dist/chunk-L3YOGIPG.js +48 -0
- package/vendor/hyperframes/dist/chunk-LAOCA3MQ.js +189 -0
- package/vendor/hyperframes/dist/chunk-LCSMOLGX.js +312 -0
- package/vendor/hyperframes/dist/chunk-LFGJWOVA.js +61 -0
- package/vendor/hyperframes/dist/chunk-LHSR3M4M.js +498 -0
- package/vendor/hyperframes/dist/chunk-LYNI3FOL.js +123 -0
- package/vendor/hyperframes/dist/chunk-M2WBOQ2Q.js +54 -0
- package/vendor/hyperframes/dist/chunk-MRF4AMKD.js +104 -0
- package/vendor/hyperframes/dist/chunk-MWB3ZIFM.js +852 -0
- package/vendor/hyperframes/dist/chunk-NGKM64BP.js +39 -0
- package/vendor/hyperframes/dist/chunk-NXMYHJAL.js +43 -0
- package/vendor/hyperframes/dist/chunk-OAF4XJOW.js +192 -0
- package/vendor/hyperframes/dist/chunk-OFQWTKPW.js +117 -0
- package/vendor/hyperframes/dist/chunk-P6LJ4Y32.js +4662 -0
- package/vendor/hyperframes/dist/chunk-PBN6GBJE.js +108 -0
- package/vendor/hyperframes/dist/chunk-PDAMK4Q5.js +28 -0
- package/vendor/hyperframes/dist/chunk-PFCFR3KZ.js +20 -0
- package/vendor/hyperframes/dist/chunk-PJ3HDUCY.js +108 -0
- package/vendor/hyperframes/dist/chunk-PMRBLBUP.js +152 -0
- package/vendor/hyperframes/dist/chunk-PPQUYWTW.js +240 -0
- package/vendor/hyperframes/dist/chunk-Q5X2B5WT.js +29 -0
- package/vendor/hyperframes/dist/chunk-Q7IU7MOR.js +351 -0
- package/vendor/hyperframes/dist/chunk-QC4FJVLM.js +371 -0
- package/vendor/hyperframes/dist/chunk-QNYYOUU3.js +1318 -0
- package/vendor/hyperframes/dist/chunk-RDNNAKEP.js +161 -0
- package/vendor/hyperframes/dist/chunk-RMHUQGRK.js +657 -0
- package/vendor/hyperframes/dist/chunk-RQVDTPGD.js +6 -0
- package/vendor/hyperframes/dist/chunk-RVCWIIZ7.js +68 -0
- package/vendor/hyperframes/dist/chunk-S3D6GE5W.js +72 -0
- package/vendor/hyperframes/dist/chunk-S3S4TGEH.js +424 -0
- package/vendor/hyperframes/dist/chunk-S7NPLFWV.js +11395 -0
- package/vendor/hyperframes/dist/chunk-SHB5VDMH.js +51 -0
- package/vendor/hyperframes/dist/chunk-TCLGPL65.js +860 -0
- package/vendor/hyperframes/dist/chunk-THXFSPLV.js +40 -0
- package/vendor/hyperframes/dist/chunk-TJSTGSAW.js +354 -0
- package/vendor/hyperframes/dist/chunk-TQFG7HTI.js +1024 -0
- package/vendor/hyperframes/dist/chunk-TVCRUG2S.js +265 -0
- package/vendor/hyperframes/dist/chunk-TWWSYAKJ.js +24 -0
- package/vendor/hyperframes/dist/chunk-U7CZBDMV.js +27 -0
- package/vendor/hyperframes/dist/chunk-UEZXMWG3.js +139 -0
- package/vendor/hyperframes/dist/chunk-UYEZTK4U.js +61 -0
- package/vendor/hyperframes/dist/chunk-VC76R6W2.js +27 -0
- package/vendor/hyperframes/dist/chunk-VFCKXTBB.js +159 -0
- package/vendor/hyperframes/dist/chunk-VWG7OQKU.js +22 -0
- package/vendor/hyperframes/dist/chunk-VXVRPIJA.js +105 -0
- package/vendor/hyperframes/dist/chunk-WBLXWOYK.js +15 -0
- package/vendor/hyperframes/dist/chunk-WERLJGIC.js +20 -0
- package/vendor/hyperframes/dist/chunk-WMQNIQDJ.js +2057 -0
- package/vendor/hyperframes/dist/chunk-WPHMNO44.js +4528 -0
- package/vendor/hyperframes/dist/chunk-X5HWXQPU.js +113 -0
- package/vendor/hyperframes/dist/chunk-X7MTZ4T2.js +6 -0
- package/vendor/hyperframes/dist/chunk-XH4DSOS5.js +59 -0
- package/vendor/hyperframes/dist/chunk-XS4EJSKU.js +23 -0
- package/vendor/hyperframes/dist/chunk-XT5P4QMO.js +181 -0
- package/vendor/hyperframes/dist/chunk-XT7X6QCP.js +6 -0
- package/vendor/hyperframes/dist/chunk-XUHOIDKG.js +6 -0
- package/vendor/hyperframes/dist/chunk-XUXGIA7H.js +485 -0
- package/vendor/hyperframes/dist/chunk-XZABUQTX.js +113 -0
- package/vendor/hyperframes/dist/chunk-Y6W4DVPS.js +356 -0
- package/vendor/hyperframes/dist/chunk-YEIFI443.js +44 -0
- package/vendor/hyperframes/dist/chunk-YQZNILVH.js +375 -0
- package/vendor/hyperframes/dist/chunk-Z27A7NUB.js +65 -0
- package/vendor/hyperframes/dist/chunk-Z6B37SNM.js +3081 -0
- package/vendor/hyperframes/dist/chunk-ZJUKFZ2P.js +10954 -0
- package/vendor/hyperframes/dist/chunk-ZKDMAOFU.js +32 -0
- package/vendor/hyperframes/dist/chunk-ZMXUQLI2.js +17219 -0
- package/vendor/hyperframes/dist/chunk-ZTZ7NCJT.js +58 -0
- package/vendor/hyperframes/dist/chunk-ZTZA4UWZ.js +108 -0
- package/vendor/hyperframes/dist/clean-W57E5YQ3.js +293 -0
- package/vendor/hyperframes/dist/cli.js +495 -0
- package/vendor/hyperframes/dist/cloud-FFTJGZ24.js +70 -0
- package/vendor/hyperframes/dist/cloudrun-AJUTHUEA.js +763 -0
- package/vendor/hyperframes/dist/colors-HKWSZCGK.js +15 -0
- package/vendor/hyperframes/dist/commands/contrast-audit.browser.js +459 -0
- package/vendor/hyperframes/dist/commands/layout-audit.browser.js +2102 -0
- package/vendor/hyperframes/dist/commands/motion-sample.browser.js +74 -0
- package/vendor/hyperframes/dist/commands/motion-signature.browser.js +374 -0
- package/vendor/hyperframes/dist/compare-AYCTT55F.js +421 -0
- package/vendor/hyperframes/dist/compiler-QO36EXLS.js +121 -0
- package/vendor/hyperframes/dist/component-VFFR2O7T.js +176 -0
- package/vendor/hyperframes/dist/compositions-QTVN3U2A.js +228 -0
- package/vendor/hyperframes/dist/contactSheet-27SRU7A4.js +22 -0
- package/vendor/hyperframes/dist/delete-ZAKYCB7I.js +114 -0
- package/vendor/hyperframes/dist/deploy-MX76RZ36.js +101 -0
- package/vendor/hyperframes/dist/destroy-H2TZBYHH.js +42 -0
- package/vendor/hyperframes/dist/deterministicFonts-HAEMV4TM.js +50 -0
- package/vendor/hyperframes/dist/dist-EWXJGN63.js +129 -0
- package/vendor/hyperframes/dist/dist-FNNGCKFS.js +29 -0
- package/vendor/hyperframes/dist/dist-S3PJNPXQ.js +392 -0
- package/vendor/hyperframes/dist/docker/Dockerfile.render +65 -0
- package/vendor/hyperframes/dist/docs/compositions.md +67 -0
- package/vendor/hyperframes/dist/docs/data-attributes.md +27 -0
- package/vendor/hyperframes/dist/docs/examples.md +19 -0
- package/vendor/hyperframes/dist/docs/gsap.md +26 -0
- package/vendor/hyperframes/dist/docs/rendering.md +35 -0
- package/vendor/hyperframes/dist/docs/troubleshooting.md +29 -0
- package/vendor/hyperframes/dist/docs-QAPJEGLS.js +131 -0
- package/vendor/hyperframes/dist/doctor-AI7C3FON.js +67 -0
- package/vendor/hyperframes/dist/dom-IROKGVJI.js +14 -0
- package/vendor/hyperframes/dist/dotEnv-AECLXQSO.js +14 -0
- package/vendor/hyperframes/dist/events-7LALYNKZ.js +92 -0
- package/vendor/hyperframes/dist/events-FQY3HGKZ.js +88 -0
- package/vendor/hyperframes/dist/feedback-WCMDMSTK.js +472 -0
- package/vendor/hyperframes/dist/ffmpeg-QIUFEFTY.js +35 -0
- package/vendor/hyperframes/dist/figma-64WY462P.js +63 -0
- package/vendor/hyperframes/dist/fontData.generated-NXAOI4GH.js +13 -0
- package/vendor/hyperframes/dist/fontLocalizeCli.js +132 -0
- package/vendor/hyperframes/dist/get-FPOMJMZB.js +103 -0
- package/vendor/hyperframes/dist/gpuPolicy-2ZUZE5D6.js +38 -0
- package/vendor/hyperframes/dist/grade-compare-E2CKPST4.js +647 -0
- package/vendor/hyperframes/dist/gsapParser-DIYYX6JT.js +2846 -0
- package/vendor/hyperframes/dist/gsapParserAcorn-E3GEIRZB.js +28 -0
- package/vendor/hyperframes/dist/help-YRQIDDML.js +197 -0
- package/vendor/hyperframes/dist/history-PP5NDRV3.js +571 -0
- package/vendor/hyperframes/dist/hyperframe-runtime.js +1081 -0
- package/vendor/hyperframes/dist/hyperframe.manifest.json +22 -0
- package/vendor/hyperframes/dist/hyperframe.runtime.iife.js +1081 -0
- package/vendor/hyperframes/dist/hyperframes-player.global.js +474 -0
- package/vendor/hyperframes/dist/hyperframes-slideshow.global.js +149 -0
- package/vendor/hyperframes/dist/info-SEX3B7JL.js +153 -0
- package/vendor/hyperframes/dist/init-U3AKHO5B.js +1147 -0
- package/vendor/hyperframes/dist/inspect-Q3K6EDEK.js +97 -0
- package/vendor/hyperframes/dist/installer-K6O5WF44.js +37 -0
- package/vendor/hyperframes/dist/keyframes-DC64JCI3.js +2602 -0
- package/vendor/hyperframes/dist/lambda-D7UMN4DJ.js +451 -0
- package/vendor/hyperframes/dist/layout-XSPPDHOO.js +86 -0
- package/vendor/hyperframes/dist/lib-TPG2ZMAX.js +128 -0
- package/vendor/hyperframes/dist/lint-7DQZE7L3.js +164 -0
- package/vendor/hyperframes/dist/lintProject-OHBBM3DJ.js +27 -0
- package/vendor/hyperframes/dist/list-4K5MVDQX.js +162 -0
- package/vendor/hyperframes/dist/login-NTX4OWXL.js +377 -0
- package/vendor/hyperframes/dist/logout-Q654A3SI.js +100 -0
- package/vendor/hyperframes/dist/manager-67P2XFXQ.js +34 -0
- package/vendor/hyperframes/dist/manager-CT3D67CG.js +38 -0
- package/vendor/hyperframes/dist/manager-GFN75DM4.js +30 -0
- package/vendor/hyperframes/dist/media-treatment-5FYAOPNL.js +972 -0
- package/vendor/hyperframes/dist/media-use-4XXGABIL.js +113 -0
- package/vendor/hyperframes/dist/models-C4E4IWJD.js +137 -0
- package/vendor/hyperframes/dist/motionShot-S4MIGMT5.js +614 -0
- package/vendor/hyperframes/dist/normalize-O76AC4HE.js +333 -0
- package/vendor/hyperframes/dist/normalize-audio-CSFTXLXD.js +276 -0
- package/vendor/hyperframes/dist/open-2ZD6BHZG.js +115 -0
- package/vendor/hyperframes/dist/pipeline-TNGWUZQC.js +54 -0
- package/vendor/hyperframes/dist/play-CTMUXX6E.js +349 -0
- package/vendor/hyperframes/dist/policies-FSDZVS2E.js +292 -0
- package/vendor/hyperframes/dist/preflight-SMNV6RW2.js +45 -0
- package/vendor/hyperframes/dist/present-WQVHV5CR.js +350 -0
- package/vendor/hyperframes/dist/preview-JOJXTH75.js +1820 -0
- package/vendor/hyperframes/dist/producer-ECLEN5RP.js +13 -0
- package/vendor/hyperframes/dist/progress-FBIEEB7Y.js +73 -0
- package/vendor/hyperframes/dist/projectConfig-HYJMJ5BY.js +56 -0
- package/vendor/hyperframes/dist/publication-HQ5Y3KBM.js +29 -0
- package/vendor/hyperframes/dist/publish-VHDYQASC.js +430 -0
- package/vendor/hyperframes/dist/refresh-K24ETHMA.js +53 -0
- package/vendor/hyperframes/dist/remove-background-W2YX2NVH.js +253 -0
- package/vendor/hyperframes/dist/render-AO5VX3YI.js +177 -0
- package/vendor/hyperframes/dist/render-LNO62LEL.js +2367 -0
- package/vendor/hyperframes/dist/render-TTQI7TGN.js +796 -0
- package/vendor/hyperframes/dist/render-batch-YH7CTWNY.js +284 -0
- package/vendor/hyperframes/dist/renderCancellation-JPIHE47X.js +35 -0
- package/vendor/hyperframes/dist/renderSetupWorker.js +79 -0
- package/vendor/hyperframes/dist/resolver-IZ647GBZ.js +38 -0
- package/vendor/hyperframes/dist/runtimeVersion.js +18 -0
- package/vendor/hyperframes/dist/screenshotCapture-ECBTLCU6.js +179 -0
- package/vendor/hyperframes/dist/shaderTransitionWorker.js +44 -0
- package/vendor/hyperframes/dist/sherpa-KKLNW6U2.js +314 -0
- package/vendor/hyperframes/dist/sherpaWorker.js +77 -0
- package/vendor/hyperframes/dist/sites-TNVKZS73.js +52 -0
- package/vendor/hyperframes/dist/skill-ZHVLH7KX.js +15 -0
- package/vendor/hyperframes/dist/skills/hyperframes/SKILL.md +152 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/brief-contract.md +108 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/brief-format.md +72 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/capability-menu.md +47 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/frame-worker-core.md +80 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/intent-interview.md +73 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/pitch-round.md +40 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/plugin-installation.md +43 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/production-loop.md +26 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/review-loop.md +37 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/route-briefs.md +11 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/embedded-captions.md +11 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/faceless-explainer.md +12 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/general-video.md +12 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/motion-graphics.md +11 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/music-to-video.md +12 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/pr-to-video.md +28 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/product-launch-video.md +13 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/remotion-to-hyperframes.md +9 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/slideshow.md +11 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/talking-head-recut.md +11 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/script-format.md +52 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/skill-lifecycle.md +35 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/storyboard-format.md +99 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/subagent-dispatch.md +35 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/workflow-catalog.md +10 -0
- package/vendor/hyperframes/dist/skills/hyperframes/scripts/lib/frame-packets-core.mjs +194 -0
- package/vendor/hyperframes/dist/skills/hyperframes/scripts/plugin-cli.mjs +88 -0
- package/vendor/hyperframes/dist/skills/hyperframes/scripts/plugin-cli.test.mjs +117 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/SKILL.md +189 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/beats.md +19 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/cloud.md +163 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/cloudrun.md +62 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/compare-and-batch.md +105 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/doctor-browser.md +57 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/init-and-scaffold.md +74 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/lambda.md +185 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +132 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/preview-render.md +193 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/upgrade-info-misc.md +134 -0
- package/vendor/hyperframes/dist/skills/media-use/SKILL.md +100 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/CREDITS.md +35 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/chime.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/click-soft.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/click.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/error.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/glitch-1.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/glitch-2.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/glitch-3.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/impact-bass-1.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/impact-bass-2.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/key-press.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/manifest.json +97 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/notification.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/ping.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/pop.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/riser.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/sparkle.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/typing.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/whoosh-cinematic.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/whoosh-short.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/whoosh.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/bgm.md +76 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/captions/authoring.md +163 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/captions/motion.md +87 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/captions/transcript-handling.md +97 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/remove-background.md +143 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/requirements.md +29 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/sfx.md +42 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/transcribe.md +52 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/tts-to-captions.md +35 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/tts.md +260 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/audio.mjs +311 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/audio.test.mjs +159 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/gemini-pipeline.test.mjs +131 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/heygen-tts.mjs +122 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/heygen-tts.test.mjs +38 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/heygen-voice.mjs +98 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/heygen-voice.test.mjs +233 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/audio-meta.mjs +39 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/audio-meta.test.mjs +136 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/bgm-volume.mjs +4 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/bgm.mjs +257 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/bgm.test.mjs +74 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/concurrency.mjs +14 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/concurrency.test.mjs +41 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/gemini-auth.mjs +43 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/gemini-auth.py +52 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/gemini-auth.test.mjs +86 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/gemini-auth_test.py +90 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/gemini-tts.mjs +122 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/gemini-tts.test.mjs +243 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/heygen.mjs +197 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/heygen.test.mjs +185 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/media-record.mjs +114 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/media-record.test.mjs +205 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/python.mjs +77 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/python.test.mjs +136 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/sfx.mjs +165 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/sfx.test.mjs +121 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/tts.mjs +389 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/tts.spawn.test.mjs +158 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/tts.test.mjs +230 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lyria-recipe.py +136 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/wait-bgm.mjs +175 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/wait-bgm.test.mjs +108 -0
- package/vendor/hyperframes/dist/skills/media-use/luts/README.md +28 -0
- package/vendor/hyperframes/dist/skills/media-use/luts/index.json +57 -0
- package/vendor/hyperframes/dist/skills/media-use/references/audio.md +20 -0
- package/vendor/hyperframes/dist/skills/media-use/references/grading.md +160 -0
- package/vendor/hyperframes/dist/skills/media-use/references/media-treatment-recipes.md +929 -0
- package/vendor/hyperframes/dist/skills/media-use/references/media-treatments.md +202 -0
- package/vendor/hyperframes/dist/skills/media-use/references/memory.md +37 -0
- package/vendor/hyperframes/dist/skills/media-use/references/meta.md +61 -0
- package/vendor/hyperframes/dist/skills/media-use/references/operations.md +327 -0
- package/vendor/hyperframes/dist/skills/media-use/references/resolve.md +150 -0
- package/vendor/hyperframes/dist/skills/media-use/references/setup-providers.md +80 -0
- package/vendor/hyperframes/dist/skills/media-use/references/telemetry-dashboard.md +49 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/audio-duck.mjs +113 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/compatibility.test.mjs +96 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/dither.mjs +328 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/dither.test.mjs +176 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/eval.mjs +369 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/adopt.mjs +128 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/adopt.test.mjs +95 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/bgm-provider.mjs +20 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/brand-provider.mjs +59 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/bundled-sfx-provider.mjs +119 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/bundled-sfx-provider.test.mjs +139 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cache.mjs +148 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/candidates.mjs +91 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/candidates.test.mjs +155 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/codex-provider.mjs +161 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/codex-provider.test.mjs +34 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/config-lock.d.mts +3 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/config-lock.mjs +45 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/config-lock.test.mjs +79 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/coverage.test.mjs +136 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cube-build.mjs +181 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cube-build.test.mjs +80 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cube-validate.mjs +198 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cube-validate.test.mjs +125 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cutlist.mjs +184 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cutlist.test.mjs +162 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/duck.mjs +95 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/duck.test.mjs +153 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/error-diffusion.mjs +230 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/error-diffusion.test.mjs +102 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/ff-binaries.mjs +37 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/freeze.mjs +72 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/freeze.test.mjs +138 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/grade-analyzer.mjs +265 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/grade-analyzer.test.mjs +285 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/heygen-cli.mjs +191 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/heygen-cli.test.mjs +301 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/heygen-search.mjs +45 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/heygen-search.test.mjs +49 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/heygen-video-provider.mjs +138 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/heygen-video-provider.test.mjs +435 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/image-provider.mjs +44 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/index-gen.mjs +63 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/local-media-search.mjs +32 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/local-models.mjs +318 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/local-models.test.mjs +220 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/local-run.mjs +78 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/local-run.test.mjs +121 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/logo-provider.mjs +244 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/logo-provider.test.mjs +298 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/ltx-video-provider.mjs +94 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/ltx-video-provider.test.mjs +316 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/lut-preset-provider.mjs +271 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/lut-preset-provider.test.mjs +199 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/manifest.d.mts +19 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/manifest.mjs +279 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/manifest.test.mjs +397 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/match.mjs +47 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/media-fetch.mjs +85 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/media-fetch.test.mjs +197 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/media-home.mjs +20 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/media-home.test.mjs +61 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/media-search.d.mts +9 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/media-search.mjs +107 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/mflux-provider.mjs +128 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/mflux-provider.test.mjs +174 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/misses.mjs +49 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/misses.test.mjs +89 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/npx-sync.mjs +31 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/npx-sync.test.mjs +50 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/parakeet-words.mjs +27 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/parakeet-words.test.mjs +44 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/prefs-store.mjs +180 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/prefs-store.test.mjs +189 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/probe.mjs +41 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/probe.test.mjs +148 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/providers.mjs +5 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/recipe-store.mjs +367 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/recipe-store.test.mjs +367 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/registry.mjs +212 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/registry.test.mjs +262 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/search.mjs +24 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/search.test.mjs +32 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/sfx-provider.mjs +23 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/specs.mjs +132 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/specs.test.mjs +157 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/stats.mjs +117 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/stats.test.mjs +165 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/svg-sanitize.mjs +21 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/telemetry.mjs +210 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/telemetry.test.mjs +437 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/test-home.test.mjs +10 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/transcriptCutFade.mjs +21 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/transcriptCutFade.test.mjs +33 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/tts-local-provider.mjs +94 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/tts-local-provider.test.mjs +72 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/usage.mjs +57 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/usage.test.mjs +54 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/voice-provider.mjs +57 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/voice-provider.test.mjs +46 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/words.mjs +18 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/prefs.mjs +70 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/recipe.mjs +103 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/resolve-plugin.test.mjs +62 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/resolve.mjs +1369 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/transcribe.mjs +194 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/transcribe.test.mjs +112 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/transcript-cut.mjs +270 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/transcript-cut.test.mjs +117 -0
- package/vendor/hyperframes/dist/skills-MJ2J4GEM.js +808 -0
- package/vendor/hyperframes/dist/skillsUpdateCheck-TKTYQN5R.js +26 -0
- package/vendor/hyperframes/dist/slideshow-EJ4IMY6P.js +24 -0
- package/vendor/hyperframes/dist/snapshot-KIVDUUMN.js +875 -0
- package/vendor/hyperframes/dist/src-6YQBJGWR.js +202 -0
- package/vendor/hyperframes/dist/src-PVYUYV3M.js +471 -0
- package/vendor/hyperframes/dist/state-KAXGHF77.js +26 -0
- package/vendor/hyperframes/dist/staticProjectServer-7EU666GS.js +49 -0
- package/vendor/hyperframes/dist/status-YM52BQ6S.js +311 -0
- package/vendor/hyperframes/dist/studio/assets/hyperframes-player-Cp8e_Zst.js +473 -0
- package/vendor/hyperframes/dist/studio/assets/index-BX3KHhGX.js +71 -0
- package/vendor/hyperframes/dist/studio/assets/index-CASEBNy2.js +1 -0
- package/vendor/hyperframes/dist/studio/assets/index-D11atkBt.css +1 -0
- package/vendor/hyperframes/dist/studio/assets/index-DMTt9nTf.js +531 -0
- package/vendor/hyperframes/dist/studio/assets/index-oE1pOdAy.js +399 -0
- package/vendor/hyperframes/dist/studio/chunk-5VSXRGIX.js +948 -0
- package/vendor/hyperframes/dist/studio/chunk-5VSXRGIX.js.map +1 -0
- package/vendor/hyperframes/dist/studio/chunk-7UQWVN52.js +938 -0
- package/vendor/hyperframes/dist/studio/chunk-7UQWVN52.js.map +1 -0
- package/vendor/hyperframes/dist/studio/chunk-EEXSYY5F.js +190 -0
- package/vendor/hyperframes/dist/studio/chunk-EEXSYY5F.js.map +1 -0
- package/vendor/hyperframes/dist/studio/chunk-FOEID72M.js +1441 -0
- package/vendor/hyperframes/dist/studio/chunk-FOEID72M.js.map +1 -0
- package/vendor/hyperframes/dist/studio/chunk-PZ5AY32C.js +10 -0
- package/vendor/hyperframes/dist/studio/chunk-PZ5AY32C.js.map +1 -0
- package/vendor/hyperframes/dist/studio/chunk-TDWGXBUT.js +1103 -0
- package/vendor/hyperframes/dist/studio/chunk-TDWGXBUT.js.map +1 -0
- package/vendor/hyperframes/dist/studio/domEditingLayers-IEVLO54Z.js +47 -0
- package/vendor/hyperframes/dist/studio/domEditingLayers-IEVLO54Z.js.map +1 -0
- package/vendor/hyperframes/dist/studio/favicon.svg +14 -0
- package/vendor/hyperframes/dist/studio/icons/timeline/audio.svg +7 -0
- package/vendor/hyperframes/dist/studio/icons/timeline/captions.svg +5 -0
- package/vendor/hyperframes/dist/studio/icons/timeline/composition.svg +12 -0
- package/vendor/hyperframes/dist/studio/icons/timeline/image.svg +18 -0
- package/vendor/hyperframes/dist/studio/icons/timeline/music.svg +10 -0
- package/vendor/hyperframes/dist/studio/icons/timeline/text.svg +3 -0
- package/vendor/hyperframes/dist/studio/index.css +165 -0
- package/vendor/hyperframes/dist/studio/index.css.map +1 -0
- package/vendor/hyperframes/dist/studio/index.d.ts +4296 -0
- package/vendor/hyperframes/dist/studio/index.html +23 -0
- package/vendor/hyperframes/dist/studio/index.js +99693 -0
- package/vendor/hyperframes/dist/studio/index.js.map +1 -0
- package/vendor/hyperframes/dist/studio/player.d.ts +30 -0
- package/vendor/hyperframes/dist/studio/player.js +10 -0
- package/vendor/hyperframes/dist/studio/player.js.map +1 -0
- package/vendor/hyperframes/dist/studio/styles/tailwind-preset.d.ts +39 -0
- package/vendor/hyperframes/dist/studio/styles/tailwind-preset.js +50 -0
- package/vendor/hyperframes/dist/studio/styles/tailwind-preset.js.map +1 -0
- package/vendor/hyperframes/dist/studio/styles.css +1 -0
- package/vendor/hyperframes/dist/studio/ui.d.ts +296 -0
- package/vendor/hyperframes/dist/studio/ui.js +66 -0
- package/vendor/hyperframes/dist/studio/ui.js.map +1 -0
- package/vendor/hyperframes/dist/studio-api-PNQZRPX5.js +136 -0
- package/vendor/hyperframes/dist/studioSelectionClient-IUUPKUHZ.js +25 -0
- package/vendor/hyperframes/dist/studioServer-UWRBPIOJ.js +1457 -0
- package/vendor/hyperframes/dist/synthesize-K62TIZWI.js +182 -0
- package/vendor/hyperframes/dist/system-EZYZNUFD.js +44 -0
- package/vendor/hyperframes/dist/telemetry-2YC4SGQU.js +144 -0
- package/vendor/hyperframes/dist/telemetry-QMYM4WME.js +95 -0
- package/vendor/hyperframes/dist/templates/_shared/AGENTS.md +107 -0
- package/vendor/hyperframes/dist/templates/_shared/CLAUDE.md +107 -0
- package/vendor/hyperframes/dist/templates/blank/index.html +55 -0
- package/vendor/hyperframes/dist/templates/from-file/index.html +75 -0
- package/vendor/hyperframes/dist/templates/warm-grain/compositions/captions.html +154 -0
- package/vendor/hyperframes/dist/templates/warm-grain/compositions/graphics.html +162 -0
- package/vendor/hyperframes/dist/templates/warm-grain/compositions/intro.html +87 -0
- package/vendor/hyperframes/dist/templates/warm-grain/index.html +264 -0
- package/vendor/hyperframes/dist/templates/warm-grain/registry-item.json +34 -0
- package/vendor/hyperframes/dist/timeline-77Z3BBQM.js +1377 -0
- package/vendor/hyperframes/dist/tokens-OBGTYE4Z.js +92 -0
- package/vendor/hyperframes/dist/transcribe-7NVFHCGA.js +387 -0
- package/vendor/hyperframes/dist/transcribe-BNSJRR4M.js +62 -0
- package/vendor/hyperframes/dist/tts-P3LIPIL5.js +234 -0
- package/vendor/hyperframes/dist/updateCheck-UDWIJ4ZQ.js +39 -0
- package/vendor/hyperframes/dist/upgrade-CT3CPO3E.js +231 -0
- package/vendor/hyperframes/dist/urlDownloader-H6WRI2UE.js +39 -0
- package/vendor/hyperframes/dist/usage-EC3KFUIJ.js +2139 -0
- package/vendor/hyperframes/dist/validate-65QDZJWZ.js +70 -0
- package/vendor/hyperframes/dist/video-FGSGKRSV.js +261 -0
- package/vendor/hyperframes/dist/workspaceBuildCheck-TOLGAI4T.js +133 -0
- package/vendor/hyperframes/package.json +80 -0
|
@@ -0,0 +1,1318 @@
|
|
|
1
|
+
import { createRequire as __hf_createRequire } from "node:module";
|
|
2
|
+
import { fileURLToPath as __hf_fileURLToPath } from "node:url";
|
|
3
|
+
import { dirname as __hf_dirname } from "node:path";
|
|
4
|
+
var require = __hf_createRequire(import.meta.url);
|
|
5
|
+
var __filename = __hf_fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __hf_dirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
errorBox
|
|
9
|
+
} from "./chunk-IHFUKJOR.js";
|
|
10
|
+
import {
|
|
11
|
+
failCommand
|
|
12
|
+
} from "./chunk-PBN6GBJE.js";
|
|
13
|
+
import {
|
|
14
|
+
cssVariableName,
|
|
15
|
+
slugify
|
|
16
|
+
} from "./chunk-VC76R6W2.js";
|
|
17
|
+
import {
|
|
18
|
+
DOMParser
|
|
19
|
+
} from "./chunk-GK4AIFIH.js";
|
|
20
|
+
|
|
21
|
+
// ../core/dist/figma/client.js
|
|
22
|
+
var FigmaClientError = class extends Error {
|
|
23
|
+
code;
|
|
24
|
+
status;
|
|
25
|
+
/** Low-cardinality REST call label (e.g. "images", "files_nodes") for
|
|
26
|
+
* telemetry attribution — never the raw fileKey/nodeId path. */
|
|
27
|
+
endpoint;
|
|
28
|
+
constructor(code, message, status, endpoint) {
|
|
29
|
+
super(message);
|
|
30
|
+
this.name = "FigmaClientError";
|
|
31
|
+
this.code = code;
|
|
32
|
+
this.status = status;
|
|
33
|
+
this.endpoint = endpoint;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var SCOPE_HINTS = {
|
|
37
|
+
fileContent: "File content: Read-only",
|
|
38
|
+
fileMetadata: "File metadata: Read-only",
|
|
39
|
+
libraryContent: "Library content: Read-only (library_content:read)"
|
|
40
|
+
};
|
|
41
|
+
var MAX_RETRY_WAIT_MS = 6e4;
|
|
42
|
+
function retryAfterMs(res) {
|
|
43
|
+
const raw = res.headers.get("retry-after");
|
|
44
|
+
if (raw === null)
|
|
45
|
+
return null;
|
|
46
|
+
const secs = Number(raw);
|
|
47
|
+
if (Number.isFinite(secs))
|
|
48
|
+
return Math.min(MAX_RETRY_WAIT_MS, Math.max(0, secs * 1e3));
|
|
49
|
+
const date = Date.parse(raw);
|
|
50
|
+
if (Number.isNaN(date))
|
|
51
|
+
return null;
|
|
52
|
+
return Math.min(MAX_RETRY_WAIT_MS, Math.max(0, date - Date.now()));
|
|
53
|
+
}
|
|
54
|
+
async function readFigmaErrorMessage(res) {
|
|
55
|
+
let text;
|
|
56
|
+
try {
|
|
57
|
+
text = await res.text();
|
|
58
|
+
} catch {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
const body = JSON.parse(text);
|
|
63
|
+
if (isRecord(body)) {
|
|
64
|
+
if (typeof body.err === "string")
|
|
65
|
+
return body.err;
|
|
66
|
+
if (typeof body.message === "string")
|
|
67
|
+
return body.message;
|
|
68
|
+
}
|
|
69
|
+
} catch {
|
|
70
|
+
}
|
|
71
|
+
return text.trim() === "" ? null : text.trim();
|
|
72
|
+
}
|
|
73
|
+
function requireNodeId(ref) {
|
|
74
|
+
if (!ref.nodeId)
|
|
75
|
+
throw new Error(`figma ref ${ref.fileKey} has no nodeId`);
|
|
76
|
+
return ref.nodeId;
|
|
77
|
+
}
|
|
78
|
+
function isRecord(value) {
|
|
79
|
+
return typeof value === "object" && value !== null;
|
|
80
|
+
}
|
|
81
|
+
function optionalString(value) {
|
|
82
|
+
return typeof value === "string" ? value : void 0;
|
|
83
|
+
}
|
|
84
|
+
function toVariablePayload(payload) {
|
|
85
|
+
if (!isRecord(payload) || typeof payload.name !== "string")
|
|
86
|
+
return null;
|
|
87
|
+
return {
|
|
88
|
+
name: payload.name,
|
|
89
|
+
key: optionalString(payload.key),
|
|
90
|
+
resolvedType: optionalString(payload.resolvedType),
|
|
91
|
+
valuesByMode: isRecord(payload.valuesByMode) ? payload.valuesByMode : void 0,
|
|
92
|
+
variableCollectionId: optionalString(payload.variableCollectionId)
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function createFigmaClient(options) {
|
|
96
|
+
const token = options.token.trim();
|
|
97
|
+
if (token === "") {
|
|
98
|
+
throw new FigmaClientError("NO_TOKEN", [
|
|
99
|
+
"FIGMA_TOKEN is missing. One-time setup:",
|
|
100
|
+
" 1. figma.com/settings \u2192 Security \u2192 Personal access tokens \u2192 Generate new token",
|
|
101
|
+
" 2. Scopes (read-only is all this integration ever needs \u2014 it never writes to figma):",
|
|
102
|
+
" File content: Read-only \xB7 File metadata: Read-only",
|
|
103
|
+
" Library content: Read-only (needed for the `tokens` published-styles fallback)",
|
|
104
|
+
" Variables: Read-only (optional \u2014 brand variables, requires figma Enterprise;",
|
|
105
|
+
" without it `tokens` falls back to published styles)",
|
|
106
|
+
' 3. export FIGMA_TOKEN="figd_\u2026" \u2014 add it to your shell profile or the project .env',
|
|
107
|
+
" so future sessions skip this step",
|
|
108
|
+
"Then re-run this command."
|
|
109
|
+
].join("\n"));
|
|
110
|
+
}
|
|
111
|
+
const doFetch = options.fetch ?? ((url, init) => fetch(url, init));
|
|
112
|
+
const base = options.baseUrl ?? "https://api.figma.com";
|
|
113
|
+
const sleep = options.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
114
|
+
const maxRetries = options.maxRetries ?? 3;
|
|
115
|
+
function forbiddenError(body, opts) {
|
|
116
|
+
if (body && /invalid token/i.test(body))
|
|
117
|
+
return new FigmaClientError("BAD_TOKEN", "figma rejected the token (403 Invalid token) \u2014 it is invalid, expired, or revoked. Re-mint at figma.com/settings \u2192 Security, then update FIGMA_TOKEN.", 403, opts.endpoint);
|
|
118
|
+
if (opts.enterpriseGated)
|
|
119
|
+
return new FigmaClientError("REQUIRES_ENTERPRISE", "figma variables require an Enterprise plan (403) \u2014 fall back to styles", 403, opts.endpoint);
|
|
120
|
+
if (body && /scope/i.test(body))
|
|
121
|
+
return new FigmaClientError("FORBIDDEN", `figma denied access (403): ${body} \u2014 add the named scope at figma.com/settings \u2192 Security \u2192 Personal access tokens.`, 403, opts.endpoint);
|
|
122
|
+
const scopeLine = opts.scopeHint ? `This endpoint needs the "${opts.scopeHint}" scope \u2014 add it at figma.com/settings \u2192 Security \u2192 Personal access tokens.` : "The token is missing a read scope, or your account can't view this file. Check File content: Read-only + File metadata: Read-only at figma.com/settings \u2192 Security.";
|
|
123
|
+
return new FigmaClientError("FORBIDDEN", `figma denied access (403). ${scopeLine} Also confirm the file is visible to your account.`, 403, opts.endpoint);
|
|
124
|
+
}
|
|
125
|
+
async function throwForStatus(res, path, opts) {
|
|
126
|
+
if (res.ok)
|
|
127
|
+
return;
|
|
128
|
+
if (res.status === 401)
|
|
129
|
+
throw new FigmaClientError("BAD_TOKEN", "figma rejected the token (401) \u2014 it is expired or revoked. Re-mint at figma.com/settings \u2192 Security, then update FIGMA_TOKEN.", 401, opts.endpoint);
|
|
130
|
+
if (res.status === 403)
|
|
131
|
+
throw forbiddenError(await readFigmaErrorMessage(res), opts);
|
|
132
|
+
if (res.status === 429)
|
|
133
|
+
throw new FigmaClientError("RATE_LIMITED", `figma rate limit hit (429) and still limited after ${maxRetries} retries \u2014 wait a minute and re-run, or import fewer nodes per call.`, 429, opts.endpoint);
|
|
134
|
+
throw new FigmaClientError("HTTP_ERROR", `figma request failed: HTTP ${res.status} ${path}`, res.status, opts.endpoint);
|
|
135
|
+
}
|
|
136
|
+
async function get(path, opts) {
|
|
137
|
+
let res;
|
|
138
|
+
for (let attempt = 0; ; attempt += 1) {
|
|
139
|
+
res = await doFetch(`${base}${path}`, { headers: { "X-Figma-Token": token } });
|
|
140
|
+
if (res.status !== 429 || attempt >= maxRetries)
|
|
141
|
+
break;
|
|
142
|
+
const wait = retryAfterMs(res) ?? 1e3 * 2 ** attempt;
|
|
143
|
+
await sleep(wait);
|
|
144
|
+
}
|
|
145
|
+
await throwForStatus(res, path, opts);
|
|
146
|
+
return res.json();
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
async renderNode(ref, opts) {
|
|
150
|
+
const nodeId = requireNodeId(ref);
|
|
151
|
+
const [result] = await this.renderNodes(ref.fileKey, [nodeId], opts);
|
|
152
|
+
if (!result || result.url === null)
|
|
153
|
+
throw new FigmaClientError("RENDER_FAILED", `figma could not render node ${nodeId} as ${opts.format}`, void 0, "images");
|
|
154
|
+
return { url: result.url, ext: opts.format };
|
|
155
|
+
},
|
|
156
|
+
async renderNodes(fileKey, nodeIds, opts) {
|
|
157
|
+
if (nodeIds.length === 0)
|
|
158
|
+
return [];
|
|
159
|
+
const params = new URLSearchParams({ ids: nodeIds.join(","), format: opts.format });
|
|
160
|
+
if (opts.scale !== void 0)
|
|
161
|
+
params.set("scale", String(opts.scale));
|
|
162
|
+
const body = await get(`/v1/images/${fileKey}?${params}`, {
|
|
163
|
+
scopeHint: SCOPE_HINTS.fileContent,
|
|
164
|
+
endpoint: "images"
|
|
165
|
+
});
|
|
166
|
+
const images = isRecord(body) && isRecord(body.images) ? body.images : {};
|
|
167
|
+
return nodeIds.map((nodeId) => {
|
|
168
|
+
const url = images[nodeId];
|
|
169
|
+
return {
|
|
170
|
+
nodeId,
|
|
171
|
+
url: typeof url === "string" && url !== "" ? url : null,
|
|
172
|
+
ext: opts.format
|
|
173
|
+
};
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
async imageFills(fileKey) {
|
|
177
|
+
const body = await get(`/v1/files/${fileKey}/images`, {
|
|
178
|
+
scopeHint: SCOPE_HINTS.fileContent,
|
|
179
|
+
endpoint: "files_images"
|
|
180
|
+
});
|
|
181
|
+
const meta = isRecord(body) && isRecord(body.meta) ? body.meta : {};
|
|
182
|
+
const images = isRecord(meta.images) ? meta.images : {};
|
|
183
|
+
const out = /* @__PURE__ */ new Map();
|
|
184
|
+
for (const [ref, url] of Object.entries(images)) {
|
|
185
|
+
if (typeof url === "string")
|
|
186
|
+
out.set(ref, url);
|
|
187
|
+
}
|
|
188
|
+
return out;
|
|
189
|
+
},
|
|
190
|
+
async variables(fileKey) {
|
|
191
|
+
const body = await get(`/v1/files/${fileKey}/variables/local`, {
|
|
192
|
+
enterpriseGated: true,
|
|
193
|
+
endpoint: "variables_local"
|
|
194
|
+
});
|
|
195
|
+
const meta = isRecord(body) && isRecord(body.meta) ? body.meta : {};
|
|
196
|
+
const variables = isRecord(meta.variables) ? meta.variables : {};
|
|
197
|
+
const collections = isRecord(meta.variableCollections) ? meta.variableCollections : {};
|
|
198
|
+
const typed = {};
|
|
199
|
+
for (const [id, payload] of Object.entries(variables)) {
|
|
200
|
+
const v = toVariablePayload(payload);
|
|
201
|
+
if (v)
|
|
202
|
+
typed[id] = v;
|
|
203
|
+
}
|
|
204
|
+
return { variables: typed, variableCollections: collections };
|
|
205
|
+
},
|
|
206
|
+
async styles(fileKey) {
|
|
207
|
+
const body = await get(`/v1/files/${fileKey}/styles`, {
|
|
208
|
+
scopeHint: SCOPE_HINTS.libraryContent,
|
|
209
|
+
endpoint: "styles"
|
|
210
|
+
});
|
|
211
|
+
const meta = isRecord(body) && isRecord(body.meta) ? body.meta : {};
|
|
212
|
+
const styles = Array.isArray(meta.styles) ? meta.styles : [];
|
|
213
|
+
return styles.filter((s) => isRecord(s) && typeof s.key === "string" && typeof s.name === "string" && typeof s.style_type === "string");
|
|
214
|
+
},
|
|
215
|
+
async nodeTree(ref) {
|
|
216
|
+
const nodeId = requireNodeId(ref);
|
|
217
|
+
const params = new URLSearchParams({ ids: nodeId, geometry: "paths" });
|
|
218
|
+
const body = await get(`/v1/files/${ref.fileKey}/nodes?${params}`, {
|
|
219
|
+
scopeHint: SCOPE_HINTS.fileContent,
|
|
220
|
+
endpoint: "files_nodes"
|
|
221
|
+
});
|
|
222
|
+
const nodes = isRecord(body) && isRecord(body.nodes) ? body.nodes : {};
|
|
223
|
+
const entry = nodes[nodeId];
|
|
224
|
+
const doc = isRecord(entry) ? entry.document : void 0;
|
|
225
|
+
if (!isRecord(doc) || typeof doc.id !== "string" || typeof doc.name !== "string" || typeof doc.type !== "string")
|
|
226
|
+
throw new FigmaClientError("NODE_NOT_FOUND", `node ${nodeId} not found in ${ref.fileKey}`, void 0, "files_nodes");
|
|
227
|
+
return { ...doc, id: doc.id, name: doc.name, type: doc.type };
|
|
228
|
+
},
|
|
229
|
+
async fileVersion(fileKey) {
|
|
230
|
+
const body = await get(`/v1/files/${fileKey}?depth=1`, {
|
|
231
|
+
scopeHint: SCOPE_HINTS.fileMetadata,
|
|
232
|
+
endpoint: "file_meta"
|
|
233
|
+
});
|
|
234
|
+
const version = isRecord(body) && typeof body.version === "string" ? body.version : "";
|
|
235
|
+
const lastModified = isRecord(body) && typeof body.lastModified === "string" ? body.lastModified : "";
|
|
236
|
+
return { version, lastModified };
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// ../core/dist/figma/parseFigmaRef.js
|
|
242
|
+
var FILE_KEY_RE = /\/(?:design|file|proto)\/([A-Za-z0-9]+)/;
|
|
243
|
+
function normalizeNodeId(raw) {
|
|
244
|
+
return raw.replaceAll("-", ":");
|
|
245
|
+
}
|
|
246
|
+
function parseFigmaRef(input) {
|
|
247
|
+
const trimmed = input.trim();
|
|
248
|
+
if (trimmed.length === 0)
|
|
249
|
+
throw new Error("parseFigmaRef: empty input");
|
|
250
|
+
if (!trimmed.includes("/")) {
|
|
251
|
+
const colon = trimmed.indexOf(":");
|
|
252
|
+
if (colon === -1)
|
|
253
|
+
return { fileKey: trimmed };
|
|
254
|
+
const fileKey2 = trimmed.slice(0, colon);
|
|
255
|
+
const node = trimmed.slice(colon + 1);
|
|
256
|
+
if (fileKey2.length === 0)
|
|
257
|
+
throw new Error(`parseFigmaRef: invalid ref "${input}"`);
|
|
258
|
+
return node.length > 0 ? { fileKey: fileKey2, nodeId: normalizeNodeId(node) } : { fileKey: fileKey2 };
|
|
259
|
+
}
|
|
260
|
+
const keyMatch = trimmed.match(FILE_KEY_RE);
|
|
261
|
+
const fileKey = keyMatch?.[1];
|
|
262
|
+
if (fileKey === void 0)
|
|
263
|
+
throw new Error(`parseFigmaRef: no fileKey in "${input}"`);
|
|
264
|
+
const q = trimmed.indexOf("?");
|
|
265
|
+
if (q !== -1) {
|
|
266
|
+
const raw = new URLSearchParams(trimmed.slice(q + 1)).get("node-id");
|
|
267
|
+
if (raw !== null && raw.length > 0)
|
|
268
|
+
return { fileKey, nodeId: normalizeNodeId(raw) };
|
|
269
|
+
}
|
|
270
|
+
return { fileKey };
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// ../core/dist/figma/freeze.js
|
|
274
|
+
import { copyFileSync, mkdirSync, rmSync, statSync, writeFileSync } from "fs";
|
|
275
|
+
import { dirname } from "path";
|
|
276
|
+
var MAX_FREEZE_BYTES = 256 * 1024 * 1024;
|
|
277
|
+
function exceedsFreezeCap(byteLength) {
|
|
278
|
+
return byteLength > MAX_FREEZE_BYTES;
|
|
279
|
+
}
|
|
280
|
+
function freezeBytes(bytes, destPath) {
|
|
281
|
+
if (bytes.length === 0)
|
|
282
|
+
throw new Error("freeze failed: empty bytes");
|
|
283
|
+
if (exceedsFreezeCap(bytes.length))
|
|
284
|
+
throw new Error(`freeze failed: ${bytes.length} bytes exceeds ${MAX_FREEZE_BYTES} cap`);
|
|
285
|
+
mkdirSync(dirname(destPath), { recursive: true });
|
|
286
|
+
try {
|
|
287
|
+
writeFileSync(destPath, bytes, { flag: "wx" });
|
|
288
|
+
} catch (err) {
|
|
289
|
+
if (err.code !== "EEXIST")
|
|
290
|
+
throw err;
|
|
291
|
+
rmSync(destPath);
|
|
292
|
+
writeFileSync(destPath, bytes, { flag: "wx" });
|
|
293
|
+
}
|
|
294
|
+
return bytes.length;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// ../core/dist/figma/manifest.js
|
|
298
|
+
import { appendFileSync, existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
299
|
+
import { join } from "path";
|
|
300
|
+
|
|
301
|
+
// ../core/dist/figma/jsonl.js
|
|
302
|
+
import { existsSync, readFileSync } from "fs";
|
|
303
|
+
function readJsonlValues(path) {
|
|
304
|
+
if (!existsSync(path))
|
|
305
|
+
return [];
|
|
306
|
+
const out = [];
|
|
307
|
+
for (const line of readFileSync(path, "utf8").split(/\r?\n/)) {
|
|
308
|
+
const trimmed = line.trim();
|
|
309
|
+
if (trimmed.length === 0)
|
|
310
|
+
continue;
|
|
311
|
+
try {
|
|
312
|
+
out.push(JSON.parse(trimmed));
|
|
313
|
+
} catch {
|
|
314
|
+
console.warn(`skipping malformed jsonl line in ${path}: ${trimmed.slice(0, 40)}\u2026`);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return out;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// ../core/dist/figma/manifest.js
|
|
321
|
+
var MANIFEST_FILE = "manifest.jsonl";
|
|
322
|
+
var TYPE_DIRS = {
|
|
323
|
+
image: "images",
|
|
324
|
+
video: "video"
|
|
325
|
+
};
|
|
326
|
+
function mediaDir(projectDir) {
|
|
327
|
+
return join(projectDir, ".media");
|
|
328
|
+
}
|
|
329
|
+
function manifestPath(projectDir) {
|
|
330
|
+
return join(mediaDir(projectDir), MANIFEST_FILE);
|
|
331
|
+
}
|
|
332
|
+
function typeDirPath(projectDir, type) {
|
|
333
|
+
return join(mediaDir(projectDir), TYPE_DIRS[type]);
|
|
334
|
+
}
|
|
335
|
+
function isFigmaManifestRecord(value) {
|
|
336
|
+
if (typeof value !== "object" || value === null)
|
|
337
|
+
return false;
|
|
338
|
+
if (!("id" in value) || !("type" in value) || !("path" in value) || !("source" in value))
|
|
339
|
+
return false;
|
|
340
|
+
if (typeof value.id !== "string" || value.type !== "image" && value.type !== "video" || typeof value.path !== "string")
|
|
341
|
+
return false;
|
|
342
|
+
if (typeof value.source !== "string")
|
|
343
|
+
return false;
|
|
344
|
+
if (!("provenance" in value))
|
|
345
|
+
return false;
|
|
346
|
+
const provenance = value.provenance;
|
|
347
|
+
if (typeof provenance !== "object" || provenance === null)
|
|
348
|
+
return false;
|
|
349
|
+
if (!("source" in provenance) || !("fileKey" in provenance) || !("nodeId" in provenance))
|
|
350
|
+
return false;
|
|
351
|
+
return provenance.source === "figma" && typeof provenance.fileKey === "string" && typeof provenance.nodeId === "string";
|
|
352
|
+
}
|
|
353
|
+
function readManifest(projectDir) {
|
|
354
|
+
return readJsonlValues(manifestPath(projectDir)).filter(isFigmaManifestRecord);
|
|
355
|
+
}
|
|
356
|
+
function appendRecord(projectDir, record) {
|
|
357
|
+
mkdirSync2(typeDirPath(projectDir, record.type), { recursive: true });
|
|
358
|
+
appendFileSync(manifestPath(projectDir), JSON.stringify(record) + "\n");
|
|
359
|
+
}
|
|
360
|
+
function findAllByFigmaNode(projectDir, fileKey, nodeId) {
|
|
361
|
+
return readManifest(projectDir).filter((r) => r.provenance.source === "figma" && r.provenance.fileKey === fileKey && r.provenance.nodeId === nodeId);
|
|
362
|
+
}
|
|
363
|
+
function updateRecord(projectDir, record) {
|
|
364
|
+
const p = manifestPath(projectDir);
|
|
365
|
+
const lines = readFileSync2(p, "utf8").split(/\r?\n/);
|
|
366
|
+
const out = lines.map((line) => {
|
|
367
|
+
const trimmed = line.trim();
|
|
368
|
+
if (trimmed.length === 0)
|
|
369
|
+
return line;
|
|
370
|
+
try {
|
|
371
|
+
const parsed = JSON.parse(trimmed);
|
|
372
|
+
if (isFigmaManifestRecord(parsed) && parsed.id === record.id)
|
|
373
|
+
return JSON.stringify(record);
|
|
374
|
+
} catch {
|
|
375
|
+
}
|
|
376
|
+
return line;
|
|
377
|
+
});
|
|
378
|
+
writeFileSync2(p, out.join("\n"));
|
|
379
|
+
}
|
|
380
|
+
function nextId(projectDir, type) {
|
|
381
|
+
const re = new RegExp(`^${type}_(\\d+)$`);
|
|
382
|
+
let max = 0;
|
|
383
|
+
const p = manifestPath(projectDir);
|
|
384
|
+
if (!existsSync2(p))
|
|
385
|
+
return `${type}_001`;
|
|
386
|
+
for (const line of readFileSync2(p, "utf8").split(/\r?\n/)) {
|
|
387
|
+
const trimmed = line.trim();
|
|
388
|
+
if (trimmed.length === 0)
|
|
389
|
+
continue;
|
|
390
|
+
let parsed;
|
|
391
|
+
try {
|
|
392
|
+
parsed = JSON.parse(trimmed);
|
|
393
|
+
} catch {
|
|
394
|
+
continue;
|
|
395
|
+
}
|
|
396
|
+
if (typeof parsed !== "object" || parsed === null || !("id" in parsed) || typeof parsed.id !== "string")
|
|
397
|
+
continue;
|
|
398
|
+
const m = parsed.id.match(re);
|
|
399
|
+
const n = m?.[1];
|
|
400
|
+
if (n !== void 0)
|
|
401
|
+
max = Math.max(max, Number.parseInt(n, 10));
|
|
402
|
+
}
|
|
403
|
+
return `${type}_${String(max + 1).padStart(3, "0")}`;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// ../core/dist/figma/mediaIndex.js
|
|
407
|
+
import { mkdirSync as mkdirSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
408
|
+
import { dirname as dirname2, join as join2 } from "path";
|
|
409
|
+
function isRow(value) {
|
|
410
|
+
return typeof value === "object" && value !== null;
|
|
411
|
+
}
|
|
412
|
+
function indexPath(projectDir) {
|
|
413
|
+
return join2(mediaDir(projectDir), "index.md");
|
|
414
|
+
}
|
|
415
|
+
function pad(str, len2) {
|
|
416
|
+
return String(str ?? "").padEnd(len2);
|
|
417
|
+
}
|
|
418
|
+
function formatDur(r) {
|
|
419
|
+
if (r.duration == null)
|
|
420
|
+
return "\u2014";
|
|
421
|
+
return `${String(r.duration)}s`;
|
|
422
|
+
}
|
|
423
|
+
function formatDims(r) {
|
|
424
|
+
if (r.width && r.height)
|
|
425
|
+
return `${String(r.width)}\xD7${String(r.height)}`;
|
|
426
|
+
if (r.type === "icon" && r.transparent)
|
|
427
|
+
return "svg";
|
|
428
|
+
return "\u2014";
|
|
429
|
+
}
|
|
430
|
+
function len(value) {
|
|
431
|
+
return String(value ?? "").length;
|
|
432
|
+
}
|
|
433
|
+
function generateIndexContent(records) {
|
|
434
|
+
const count = records.length;
|
|
435
|
+
const header = `# .media \xB7 ${count} asset${count === 1 ? "" : "s"}
|
|
436
|
+
`;
|
|
437
|
+
if (count === 0)
|
|
438
|
+
return header;
|
|
439
|
+
const cols = { id: 4, type: 5, dur: 4, dims: 5, path: 5 };
|
|
440
|
+
for (const r of records) {
|
|
441
|
+
cols.id = Math.max(cols.id, len(r.id));
|
|
442
|
+
cols.type = Math.max(cols.type, len(r.type));
|
|
443
|
+
cols.dur = Math.max(cols.dur, formatDur(r).length);
|
|
444
|
+
cols.dims = Math.max(cols.dims, formatDims(r).length);
|
|
445
|
+
cols.path = Math.max(cols.path, len(r.path));
|
|
446
|
+
}
|
|
447
|
+
const heading = pad("id", cols.id + 2) + pad("type", cols.type + 2) + pad("dur", cols.dur + 2) + pad("dims", cols.dims + 2) + pad("path", cols.path + 2) + "description";
|
|
448
|
+
const lines = [header, heading];
|
|
449
|
+
for (const r of records) {
|
|
450
|
+
lines.push(pad(r.id, cols.id + 2) + pad(r.type, cols.type + 2) + pad(formatDur(r), cols.dur + 2) + pad(formatDims(r), cols.dims + 2) + pad(r.path, cols.path + 2) + String(r.description ?? ""));
|
|
451
|
+
}
|
|
452
|
+
return lines.join("\n") + "\n";
|
|
453
|
+
}
|
|
454
|
+
function regenerateIndex(projectDir) {
|
|
455
|
+
const rows = readJsonlValues(manifestPath(projectDir)).filter(isRow);
|
|
456
|
+
const last = new Map(rows.map((row, index) => [row.path, index]));
|
|
457
|
+
const records = rows.filter((row, index) => !row.path || last.get(row.path) === index);
|
|
458
|
+
const content = generateIndexContent(records);
|
|
459
|
+
const p = indexPath(projectDir);
|
|
460
|
+
mkdirSync3(dirname2(p), { recursive: true });
|
|
461
|
+
writeFileSync3(p, content);
|
|
462
|
+
return content;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
// ../core/dist/figma/assetSnippet.js
|
|
466
|
+
function escapeAttr(value) {
|
|
467
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
468
|
+
}
|
|
469
|
+
function buildAssetSnippet(record) {
|
|
470
|
+
const alt = escapeAttr(record.description ?? record.id);
|
|
471
|
+
const src = escapeAttr(record.path);
|
|
472
|
+
const w = record.width !== void 0 ? ` width="${record.width}"` : "";
|
|
473
|
+
const h = record.height !== void 0 ? ` height="${record.height}"` : "";
|
|
474
|
+
const html = `<img src="${src}" alt="${alt}"${w}${h} data-figma-id="${escapeAttr(record.provenance.nodeId)}" />`;
|
|
475
|
+
return { path: record.path, html };
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// ../core/dist/figma/sanitizeSvg.js
|
|
479
|
+
var SAFE_ELEMENTS = /* @__PURE__ */ new Set([
|
|
480
|
+
"svg",
|
|
481
|
+
"g",
|
|
482
|
+
"defs",
|
|
483
|
+
"symbol",
|
|
484
|
+
"use",
|
|
485
|
+
"image",
|
|
486
|
+
"a",
|
|
487
|
+
"switch",
|
|
488
|
+
"rect",
|
|
489
|
+
"circle",
|
|
490
|
+
"ellipse",
|
|
491
|
+
"line",
|
|
492
|
+
"polyline",
|
|
493
|
+
"polygon",
|
|
494
|
+
"path",
|
|
495
|
+
"text",
|
|
496
|
+
"tspan",
|
|
497
|
+
"textPath",
|
|
498
|
+
"linearGradient",
|
|
499
|
+
"radialGradient",
|
|
500
|
+
"stop",
|
|
501
|
+
"pattern",
|
|
502
|
+
"mask",
|
|
503
|
+
"clipPath",
|
|
504
|
+
"marker",
|
|
505
|
+
"filter",
|
|
506
|
+
"feBlend",
|
|
507
|
+
"feColorMatrix",
|
|
508
|
+
"feComponentTransfer",
|
|
509
|
+
"feComposite",
|
|
510
|
+
"feConvolveMatrix",
|
|
511
|
+
"feDiffuseLighting",
|
|
512
|
+
"feDisplacementMap",
|
|
513
|
+
"feDistantLight",
|
|
514
|
+
"feDropShadow",
|
|
515
|
+
"feFlood",
|
|
516
|
+
"feFuncA",
|
|
517
|
+
"feFuncB",
|
|
518
|
+
"feFuncG",
|
|
519
|
+
"feFuncR",
|
|
520
|
+
"feGaussianBlur",
|
|
521
|
+
"feImage",
|
|
522
|
+
"feMerge",
|
|
523
|
+
"feMergeNode",
|
|
524
|
+
"feMorphology",
|
|
525
|
+
"feOffset",
|
|
526
|
+
"fePointLight",
|
|
527
|
+
"feSpecularLighting",
|
|
528
|
+
"feSpotLight",
|
|
529
|
+
"feTile",
|
|
530
|
+
"feTurbulence",
|
|
531
|
+
"title",
|
|
532
|
+
"desc",
|
|
533
|
+
"metadata",
|
|
534
|
+
"style"
|
|
535
|
+
]);
|
|
536
|
+
var SAFE_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
537
|
+
"id",
|
|
538
|
+
"class",
|
|
539
|
+
"style",
|
|
540
|
+
"transform",
|
|
541
|
+
"viewBox",
|
|
542
|
+
"width",
|
|
543
|
+
"height",
|
|
544
|
+
"x",
|
|
545
|
+
"y",
|
|
546
|
+
"x1",
|
|
547
|
+
"y1",
|
|
548
|
+
"x2",
|
|
549
|
+
"y2",
|
|
550
|
+
"cx",
|
|
551
|
+
"cy",
|
|
552
|
+
"r",
|
|
553
|
+
"rx",
|
|
554
|
+
"ry",
|
|
555
|
+
"fx",
|
|
556
|
+
"fy",
|
|
557
|
+
"points",
|
|
558
|
+
"d",
|
|
559
|
+
"offset",
|
|
560
|
+
"enable-background",
|
|
561
|
+
"gradientUnits",
|
|
562
|
+
"gradientTransform",
|
|
563
|
+
"spreadMethod",
|
|
564
|
+
"patternUnits",
|
|
565
|
+
"patternContentUnits",
|
|
566
|
+
"patternTransform",
|
|
567
|
+
"maskUnits",
|
|
568
|
+
"maskContentUnits",
|
|
569
|
+
"clipPathUnits",
|
|
570
|
+
"clip-rule",
|
|
571
|
+
"filterUnits",
|
|
572
|
+
"primitiveUnits",
|
|
573
|
+
"preserveAspectRatio",
|
|
574
|
+
"space",
|
|
575
|
+
"lang",
|
|
576
|
+
"role",
|
|
577
|
+
"focusable",
|
|
578
|
+
"tabindex",
|
|
579
|
+
"version",
|
|
580
|
+
"baseProfile",
|
|
581
|
+
"fill",
|
|
582
|
+
"fill-opacity",
|
|
583
|
+
"fill-rule",
|
|
584
|
+
"stroke",
|
|
585
|
+
"stroke-width",
|
|
586
|
+
"stroke-opacity",
|
|
587
|
+
"stroke-linecap",
|
|
588
|
+
"stroke-linejoin",
|
|
589
|
+
"stroke-miterlimit",
|
|
590
|
+
"stroke-dasharray",
|
|
591
|
+
"stroke-dashoffset",
|
|
592
|
+
"opacity",
|
|
593
|
+
"color",
|
|
594
|
+
"stop-color",
|
|
595
|
+
"stop-opacity",
|
|
596
|
+
"font-family",
|
|
597
|
+
"font-size",
|
|
598
|
+
"font-weight",
|
|
599
|
+
"font-style",
|
|
600
|
+
"text-anchor",
|
|
601
|
+
"dominant-baseline",
|
|
602
|
+
"alignment-baseline",
|
|
603
|
+
"letter-spacing",
|
|
604
|
+
"word-spacing",
|
|
605
|
+
"text-decoration",
|
|
606
|
+
"clip-path",
|
|
607
|
+
"mask",
|
|
608
|
+
"filter",
|
|
609
|
+
"marker-start",
|
|
610
|
+
"marker-mid",
|
|
611
|
+
"marker-end",
|
|
612
|
+
"marker",
|
|
613
|
+
"cursor",
|
|
614
|
+
"pointer-events",
|
|
615
|
+
"visibility",
|
|
616
|
+
"display",
|
|
617
|
+
"overflow",
|
|
618
|
+
"vector-effect",
|
|
619
|
+
"paint-order",
|
|
620
|
+
"color-interpolation",
|
|
621
|
+
"color-interpolation-filters",
|
|
622
|
+
"isolation",
|
|
623
|
+
"mix-blend-mode",
|
|
624
|
+
"startOffset",
|
|
625
|
+
"method",
|
|
626
|
+
"spacing",
|
|
627
|
+
"side",
|
|
628
|
+
"textLength",
|
|
629
|
+
"lengthAdjust",
|
|
630
|
+
"in",
|
|
631
|
+
"in2",
|
|
632
|
+
"result",
|
|
633
|
+
"mode",
|
|
634
|
+
"type",
|
|
635
|
+
"values",
|
|
636
|
+
"dx",
|
|
637
|
+
"dy",
|
|
638
|
+
"stdDeviation",
|
|
639
|
+
"edgeMode",
|
|
640
|
+
"k1",
|
|
641
|
+
"k2",
|
|
642
|
+
"k3",
|
|
643
|
+
"k4",
|
|
644
|
+
"operator",
|
|
645
|
+
"radius",
|
|
646
|
+
"scale",
|
|
647
|
+
"xChannelSelector",
|
|
648
|
+
"yChannelSelector",
|
|
649
|
+
"baseFrequency",
|
|
650
|
+
"numOctaves",
|
|
651
|
+
"seed",
|
|
652
|
+
"stitchTiles",
|
|
653
|
+
"tableValues",
|
|
654
|
+
"slope",
|
|
655
|
+
"intercept",
|
|
656
|
+
"amplitude",
|
|
657
|
+
"exponent",
|
|
658
|
+
"order",
|
|
659
|
+
"divisor",
|
|
660
|
+
"bias",
|
|
661
|
+
"targetX",
|
|
662
|
+
"targetY",
|
|
663
|
+
"kernelMatrix",
|
|
664
|
+
"preserveAlpha",
|
|
665
|
+
"kernelUnitLength",
|
|
666
|
+
"surfaceScale",
|
|
667
|
+
"diffuseConstant",
|
|
668
|
+
"specularConstant",
|
|
669
|
+
"specularExponent",
|
|
670
|
+
"lighting-color",
|
|
671
|
+
"flood-color",
|
|
672
|
+
"flood-opacity",
|
|
673
|
+
"azimuth",
|
|
674
|
+
"elevation",
|
|
675
|
+
"pointsAtX",
|
|
676
|
+
"pointsAtY",
|
|
677
|
+
"pointsAtZ",
|
|
678
|
+
"limitingConeAngle"
|
|
679
|
+
]);
|
|
680
|
+
function localName(name) {
|
|
681
|
+
const i = name.lastIndexOf(":");
|
|
682
|
+
return i === -1 ? name : name.slice(i + 1);
|
|
683
|
+
}
|
|
684
|
+
function isAllowedHref(value, tagLocalName) {
|
|
685
|
+
const v = value.trim();
|
|
686
|
+
if (v.startsWith("#"))
|
|
687
|
+
return true;
|
|
688
|
+
return /^data:image\//i.test(v) && tagLocalName.toLowerCase() !== "a";
|
|
689
|
+
}
|
|
690
|
+
var SAFE_CSS_FUNCTIONS = /* @__PURE__ */ new Set([
|
|
691
|
+
"",
|
|
692
|
+
"url",
|
|
693
|
+
"rgb",
|
|
694
|
+
"rgba",
|
|
695
|
+
"hsl",
|
|
696
|
+
"hsla",
|
|
697
|
+
"hwb",
|
|
698
|
+
"lab",
|
|
699
|
+
"lch",
|
|
700
|
+
"oklab",
|
|
701
|
+
"oklch",
|
|
702
|
+
"color",
|
|
703
|
+
"color-mix",
|
|
704
|
+
"var",
|
|
705
|
+
"calc",
|
|
706
|
+
"min",
|
|
707
|
+
"max",
|
|
708
|
+
"clamp",
|
|
709
|
+
"matrix",
|
|
710
|
+
"matrix3d",
|
|
711
|
+
"translate",
|
|
712
|
+
"translatex",
|
|
713
|
+
"translatey",
|
|
714
|
+
"translatez",
|
|
715
|
+
"translate3d",
|
|
716
|
+
"scale",
|
|
717
|
+
"scalex",
|
|
718
|
+
"scaley",
|
|
719
|
+
"scalez",
|
|
720
|
+
"scale3d",
|
|
721
|
+
"rotate",
|
|
722
|
+
"rotatex",
|
|
723
|
+
"rotatey",
|
|
724
|
+
"rotatez",
|
|
725
|
+
"rotate3d",
|
|
726
|
+
"skew",
|
|
727
|
+
"skewx",
|
|
728
|
+
"skewy",
|
|
729
|
+
"perspective",
|
|
730
|
+
"cubic-bezier",
|
|
731
|
+
"steps",
|
|
732
|
+
"blur",
|
|
733
|
+
"brightness",
|
|
734
|
+
"contrast",
|
|
735
|
+
"drop-shadow",
|
|
736
|
+
"grayscale",
|
|
737
|
+
"hue-rotate",
|
|
738
|
+
"invert",
|
|
739
|
+
"opacity",
|
|
740
|
+
"saturate",
|
|
741
|
+
"sepia"
|
|
742
|
+
]);
|
|
743
|
+
function decodeCssEscape(hex, char) {
|
|
744
|
+
if (hex === void 0)
|
|
745
|
+
return char ?? "";
|
|
746
|
+
const cp = parseInt(hex, 16);
|
|
747
|
+
const invalid = cp === 0 || cp > 1114111 || cp >= 55296 && cp <= 57343;
|
|
748
|
+
return invalid ? "\uFFFD" : String.fromCodePoint(cp);
|
|
749
|
+
}
|
|
750
|
+
function canonicalCss(text) {
|
|
751
|
+
return text.replace(/\\([0-9a-f]{1,6})[ \t\n\r\f]?|\\([\s\S])/gi, (_, hex, char) => decodeCssEscape(hex, char)).toLowerCase();
|
|
752
|
+
}
|
|
753
|
+
function isCssNameChar(c) {
|
|
754
|
+
return c !== void 0 && /[-\w]/.test(c);
|
|
755
|
+
}
|
|
756
|
+
function functionNameBefore(css, paren) {
|
|
757
|
+
let start = paren;
|
|
758
|
+
while (isCssNameChar(css[start - 1]))
|
|
759
|
+
start--;
|
|
760
|
+
return css.slice(start, paren);
|
|
761
|
+
}
|
|
762
|
+
function everyFunctionIsSafe(css) {
|
|
763
|
+
for (let at = css.indexOf("("); at !== -1; at = css.indexOf("(", at + 1)) {
|
|
764
|
+
if (!SAFE_CSS_FUNCTIONS.has(functionNameBefore(css, at)))
|
|
765
|
+
return false;
|
|
766
|
+
}
|
|
767
|
+
return true;
|
|
768
|
+
}
|
|
769
|
+
function isLocalUrlValue(raw) {
|
|
770
|
+
const value = raw.trim().replace(/^['"]/, "");
|
|
771
|
+
return value.startsWith("#") && !value.includes("(");
|
|
772
|
+
}
|
|
773
|
+
function everyUrlIsLocalFragment(css) {
|
|
774
|
+
for (let at = css.indexOf("url("); at !== -1; ) {
|
|
775
|
+
const close = css.indexOf(")", at + 4);
|
|
776
|
+
if (close === -1 || !isLocalUrlValue(css.slice(at + 4, close)))
|
|
777
|
+
return false;
|
|
778
|
+
at = css.indexOf("url(", close + 1);
|
|
779
|
+
}
|
|
780
|
+
return true;
|
|
781
|
+
}
|
|
782
|
+
function isSafeCss(text) {
|
|
783
|
+
const css = canonicalCss(text);
|
|
784
|
+
return !css.includes("@import") && everyFunctionIsSafe(css) && everyUrlIsLocalFragment(css);
|
|
785
|
+
}
|
|
786
|
+
function isXmlnsAttribute(name) {
|
|
787
|
+
return name === "xmlns" || name.startsWith("xmlns:");
|
|
788
|
+
}
|
|
789
|
+
function isKnownAttribute(local) {
|
|
790
|
+
return SAFE_ATTRIBUTES.has(local) || local.startsWith("aria-") || local.startsWith("data-");
|
|
791
|
+
}
|
|
792
|
+
function isSafeAttribute(tagLocalName, name, value) {
|
|
793
|
+
if (isXmlnsAttribute(name))
|
|
794
|
+
return true;
|
|
795
|
+
const local = localName(name);
|
|
796
|
+
if (local === "href")
|
|
797
|
+
return isAllowedHref(value, tagLocalName);
|
|
798
|
+
return isKnownAttribute(local) && isSafeCss(value);
|
|
799
|
+
}
|
|
800
|
+
function sanitizeSvg(svg) {
|
|
801
|
+
const doc = new DOMParser().parseFromString(svg, "image/svg+xml");
|
|
802
|
+
const root = doc.documentElement;
|
|
803
|
+
if (!root)
|
|
804
|
+
return "";
|
|
805
|
+
for (const el of [...doc.querySelectorAll("*")]) {
|
|
806
|
+
if (!el.isConnected)
|
|
807
|
+
continue;
|
|
808
|
+
if (!SAFE_ELEMENTS.has(el.tagName)) {
|
|
809
|
+
el.remove();
|
|
810
|
+
continue;
|
|
811
|
+
}
|
|
812
|
+
if (el.tagName === "style" && !isSafeCss(el.textContent)) {
|
|
813
|
+
el.remove();
|
|
814
|
+
continue;
|
|
815
|
+
}
|
|
816
|
+
for (const attr of [...el.attributes]) {
|
|
817
|
+
if (!isSafeAttribute(el.tagName, attr.name, attr.value))
|
|
818
|
+
el.removeAttribute(attr.name);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
return root.isConnected ? root.outerHTML : "";
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
// ../core/dist/figma/bindings.js
|
|
825
|
+
import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync4, writeFileSync as writeFileSync4 } from "fs";
|
|
826
|
+
import { join as join3 } from "path";
|
|
827
|
+
var BINDINGS_FILE = "figma-bindings.jsonl";
|
|
828
|
+
function bindingsPath(projectDir) {
|
|
829
|
+
return join3(mediaDir(projectDir), BINDINGS_FILE);
|
|
830
|
+
}
|
|
831
|
+
function isRecord2(value) {
|
|
832
|
+
return typeof value === "object" && value !== null;
|
|
833
|
+
}
|
|
834
|
+
function isBindingRecord(value) {
|
|
835
|
+
return isRecord2(value) && value.kind === "binding" && typeof value.figmaId === "string" && typeof value.sourceFileKey === "string" && typeof value.compositionVariableId === "string" && typeof value.version === "string";
|
|
836
|
+
}
|
|
837
|
+
function readLines(projectDir) {
|
|
838
|
+
return readJsonlValues(bindingsPath(projectDir));
|
|
839
|
+
}
|
|
840
|
+
function readBindings(projectDir) {
|
|
841
|
+
return readLines(projectDir).filter(isBindingRecord);
|
|
842
|
+
}
|
|
843
|
+
function upsertBindings(projectDir, records) {
|
|
844
|
+
const incoming = new Set(records.map((r) => r.figmaId));
|
|
845
|
+
const survivors = readLines(projectDir).filter((line) => !(isBindingRecord(line) && incoming.has(line.figmaId)));
|
|
846
|
+
mkdirSync4(mediaDir(projectDir), { recursive: true });
|
|
847
|
+
const lines = [...survivors, ...records].map((r) => JSON.stringify(r)).join("\n");
|
|
848
|
+
writeFileSync4(bindingsPath(projectDir), lines.length > 0 ? lines + "\n" : "");
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
// ../core/dist/figma/nodeDocument.js
|
|
852
|
+
function isRecord3(value) {
|
|
853
|
+
return typeof value === "object" && value !== null;
|
|
854
|
+
}
|
|
855
|
+
function asNodeDocument(value) {
|
|
856
|
+
if (isRecord3(value) && typeof value.id === "string" && typeof value.name === "string" && typeof value.type === "string") {
|
|
857
|
+
return { ...value, id: value.id, name: value.name, type: value.type };
|
|
858
|
+
}
|
|
859
|
+
return null;
|
|
860
|
+
}
|
|
861
|
+
function childDocuments(node) {
|
|
862
|
+
if (!Array.isArray(node.children))
|
|
863
|
+
return [];
|
|
864
|
+
const out = [];
|
|
865
|
+
for (const child of node.children) {
|
|
866
|
+
const doc = asNodeDocument(child);
|
|
867
|
+
if (doc)
|
|
868
|
+
out.push(doc);
|
|
869
|
+
}
|
|
870
|
+
return out;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
// ../core/dist/figma/resolveBindings.js
|
|
874
|
+
function isRecord4(value) {
|
|
875
|
+
return typeof value === "object" && value !== null;
|
|
876
|
+
}
|
|
877
|
+
function aliasId(value) {
|
|
878
|
+
if (isRecord4(value) && value.type === "VARIABLE_ALIAS" && typeof value.id === "string")
|
|
879
|
+
return value.id;
|
|
880
|
+
return null;
|
|
881
|
+
}
|
|
882
|
+
function boundVariableSites(node, out) {
|
|
883
|
+
const bound = node.boundVariables;
|
|
884
|
+
if (!isRecord4(bound))
|
|
885
|
+
return;
|
|
886
|
+
for (const [property, value] of Object.entries(bound)) {
|
|
887
|
+
const candidates = Array.isArray(value) ? value : [value];
|
|
888
|
+
for (const item of candidates) {
|
|
889
|
+
const id = aliasId(item);
|
|
890
|
+
if (id)
|
|
891
|
+
out.push({ nodeId: node.id, property, figmaId: id });
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
function styleSites(node, out) {
|
|
896
|
+
const styles = node.styles;
|
|
897
|
+
if (!isRecord4(styles))
|
|
898
|
+
return;
|
|
899
|
+
for (const [slot, styleId] of Object.entries(styles)) {
|
|
900
|
+
if (typeof styleId === "string" && styleId.length > 0)
|
|
901
|
+
out.push({ nodeId: node.id, property: `style:${slot}`, figmaId: styleId });
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
function collectSites(node, out) {
|
|
905
|
+
boundVariableSites(node, out);
|
|
906
|
+
styleSites(node, out);
|
|
907
|
+
for (const child of childDocuments(node))
|
|
908
|
+
collectSites(child, out);
|
|
909
|
+
}
|
|
910
|
+
function findInIndex(index, figmaId) {
|
|
911
|
+
for (const b of index) {
|
|
912
|
+
if (b.figmaId === figmaId)
|
|
913
|
+
return b;
|
|
914
|
+
if (b.aliasChain?.includes(figmaId))
|
|
915
|
+
return b;
|
|
916
|
+
if (b.key !== void 0 && b.key === figmaId)
|
|
917
|
+
return b;
|
|
918
|
+
}
|
|
919
|
+
return null;
|
|
920
|
+
}
|
|
921
|
+
function resolveBindings(node, index) {
|
|
922
|
+
const sites = [];
|
|
923
|
+
collectSites(node, sites);
|
|
924
|
+
const resolved = [];
|
|
925
|
+
const unresolved = [];
|
|
926
|
+
for (const site of sites) {
|
|
927
|
+
const match = findInIndex(index, site.figmaId);
|
|
928
|
+
if (match)
|
|
929
|
+
resolved.push({ ...site, compositionVariableId: match.compositionVariableId });
|
|
930
|
+
else
|
|
931
|
+
unresolved.push(site);
|
|
932
|
+
}
|
|
933
|
+
return { resolved, unresolved };
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
// ../core/dist/figma/color.js
|
|
937
|
+
function isRecord5(value) {
|
|
938
|
+
return typeof value === "object" && value !== null;
|
|
939
|
+
}
|
|
940
|
+
function toHexByte(channel) {
|
|
941
|
+
return Math.round(channel * 255).toString(16).padStart(2, "0").toUpperCase();
|
|
942
|
+
}
|
|
943
|
+
function figmaColorToCss(value, extraOpacity = 1) {
|
|
944
|
+
if (!isRecord5(value))
|
|
945
|
+
return null;
|
|
946
|
+
const { r, g, b, a } = value;
|
|
947
|
+
if (typeof r !== "number" || typeof g !== "number" || typeof b !== "number")
|
|
948
|
+
return null;
|
|
949
|
+
const alpha = (typeof a === "number" ? a : 1) * extraOpacity;
|
|
950
|
+
if (alpha >= 1)
|
|
951
|
+
return `#${toHexByte(r)}${toHexByte(g)}${toHexByte(b)}`;
|
|
952
|
+
const c = (n) => Math.round(n * 255);
|
|
953
|
+
return `rgba(${c(r)}, ${c(g)}, ${c(b)}, ${Number(alpha.toFixed(4))})`;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
// ../core/dist/figma/nodeToHtml.js
|
|
957
|
+
var RASTERIZE_TYPES = /* @__PURE__ */ new Set([
|
|
958
|
+
"VECTOR",
|
|
959
|
+
"BOOLEAN_OPERATION",
|
|
960
|
+
"STAR",
|
|
961
|
+
"LINE",
|
|
962
|
+
"POLYGON",
|
|
963
|
+
"REGULAR_POLYGON"
|
|
964
|
+
]);
|
|
965
|
+
function isRecord6(value) {
|
|
966
|
+
return typeof value === "object" && value !== null;
|
|
967
|
+
}
|
|
968
|
+
function boxOf(node) {
|
|
969
|
+
const b = node.absoluteBoundingBox;
|
|
970
|
+
if (isRecord6(b) && typeof b.x === "number" && typeof b.y === "number" && typeof b.width === "number" && typeof b.height === "number")
|
|
971
|
+
return { x: b.x, y: b.y, width: b.width, height: b.height };
|
|
972
|
+
return null;
|
|
973
|
+
}
|
|
974
|
+
function escapeHtml(text) {
|
|
975
|
+
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
976
|
+
}
|
|
977
|
+
function round(n) {
|
|
978
|
+
return Math.round(n * 100) / 100;
|
|
979
|
+
}
|
|
980
|
+
function firstVisibleFill(node) {
|
|
981
|
+
const fills = node.fills;
|
|
982
|
+
if (!Array.isArray(fills))
|
|
983
|
+
return null;
|
|
984
|
+
for (const fill of fills) {
|
|
985
|
+
if (isRecord6(fill) && fill.visible !== false)
|
|
986
|
+
return fill;
|
|
987
|
+
}
|
|
988
|
+
return null;
|
|
989
|
+
}
|
|
990
|
+
function gradientCss(fill) {
|
|
991
|
+
const stops = fill.gradientStops;
|
|
992
|
+
if (!Array.isArray(stops))
|
|
993
|
+
return null;
|
|
994
|
+
const parts = [];
|
|
995
|
+
for (const stop of stops) {
|
|
996
|
+
if (!isRecord6(stop) || typeof stop.position !== "number")
|
|
997
|
+
return null;
|
|
998
|
+
const color = figmaColorToCss(stop.color);
|
|
999
|
+
if (color === null)
|
|
1000
|
+
return null;
|
|
1001
|
+
parts.push(`${color} ${round(stop.position * 100)}%`);
|
|
1002
|
+
}
|
|
1003
|
+
if (parts.length === 0)
|
|
1004
|
+
return null;
|
|
1005
|
+
return `linear-gradient(180deg, ${parts.join(", ")})`;
|
|
1006
|
+
}
|
|
1007
|
+
function fillCss(node) {
|
|
1008
|
+
const fill = firstVisibleFill(node);
|
|
1009
|
+
if (fill === null)
|
|
1010
|
+
return null;
|
|
1011
|
+
if (fill.type === "SOLID")
|
|
1012
|
+
return figmaColorToCss(fill.color);
|
|
1013
|
+
if (fill.type === "GRADIENT_LINEAR")
|
|
1014
|
+
return gradientCss(fill);
|
|
1015
|
+
return null;
|
|
1016
|
+
}
|
|
1017
|
+
function hasImageFill(node) {
|
|
1018
|
+
return firstVisibleFill(node)?.type === "IMAGE";
|
|
1019
|
+
}
|
|
1020
|
+
function dropShadowCss(effect) {
|
|
1021
|
+
if (!isRecord6(effect.offset))
|
|
1022
|
+
return null;
|
|
1023
|
+
const color = figmaColorToCss(effect.color);
|
|
1024
|
+
const { x, y } = effect.offset;
|
|
1025
|
+
if (color === null || typeof x !== "number" || typeof y !== "number")
|
|
1026
|
+
return null;
|
|
1027
|
+
const radius = typeof effect.radius === "number" ? effect.radius : 0;
|
|
1028
|
+
return `box-shadow: ${round(x)}px ${round(y)}px ${round(radius)}px ${color}`;
|
|
1029
|
+
}
|
|
1030
|
+
function effectCss(effect) {
|
|
1031
|
+
if (!isRecord6(effect) || effect.visible === false)
|
|
1032
|
+
return null;
|
|
1033
|
+
if (effect.type === "DROP_SHADOW")
|
|
1034
|
+
return dropShadowCss(effect);
|
|
1035
|
+
if (effect.type === "LAYER_BLUR" && typeof effect.radius === "number")
|
|
1036
|
+
return `filter: blur(${round(effect.radius)}px)`;
|
|
1037
|
+
return null;
|
|
1038
|
+
}
|
|
1039
|
+
function effectsCss(node, styles) {
|
|
1040
|
+
const effects = node.effects;
|
|
1041
|
+
if (!Array.isArray(effects))
|
|
1042
|
+
return;
|
|
1043
|
+
for (const effect of effects) {
|
|
1044
|
+
const css = effectCss(effect);
|
|
1045
|
+
if (css !== null)
|
|
1046
|
+
styles.push(css);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
function textCss(node, styles) {
|
|
1050
|
+
const s = node.style;
|
|
1051
|
+
if (!isRecord6(s))
|
|
1052
|
+
return;
|
|
1053
|
+
if (typeof s.fontFamily === "string")
|
|
1054
|
+
styles.push(`font-family: '${s.fontFamily.replace(/['"\\;]/g, "")}'`);
|
|
1055
|
+
if (typeof s.fontWeight === "number")
|
|
1056
|
+
styles.push(`font-weight: ${s.fontWeight}`);
|
|
1057
|
+
if (typeof s.fontSize === "number")
|
|
1058
|
+
styles.push(`font-size: ${round(s.fontSize)}px`);
|
|
1059
|
+
if (typeof s.lineHeightPx === "number")
|
|
1060
|
+
styles.push(`line-height: ${round(s.lineHeightPx)}px`);
|
|
1061
|
+
if (typeof s.letterSpacing === "number" && s.letterSpacing !== 0)
|
|
1062
|
+
styles.push(`letter-spacing: ${round(s.letterSpacing)}px`);
|
|
1063
|
+
if (isVerticallyTrimmed(node, s.lineHeightPx)) {
|
|
1064
|
+
styles.push("text-box-trim: trim-both", "text-box-edge: cap alphabetic");
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
function isVerticallyTrimmed(node, lineHeightPx) {
|
|
1068
|
+
if (typeof lineHeightPx !== "number")
|
|
1069
|
+
return false;
|
|
1070
|
+
const box = boxOf(node);
|
|
1071
|
+
if (box === null || box.height >= lineHeightPx - 1)
|
|
1072
|
+
return false;
|
|
1073
|
+
return typeof node.characters === "string" && !node.characters.includes("\n");
|
|
1074
|
+
}
|
|
1075
|
+
function uniqueSlug(ctx, name) {
|
|
1076
|
+
const raw = slugify(name);
|
|
1077
|
+
const base = /^[0-9]/.test(raw) ? `n${raw}` : raw;
|
|
1078
|
+
let slug = base;
|
|
1079
|
+
let n = 2;
|
|
1080
|
+
while (ctx.usedSlugs.has(slug))
|
|
1081
|
+
slug = `${base}-${n++}`;
|
|
1082
|
+
ctx.usedSlugs.add(slug);
|
|
1083
|
+
return slug;
|
|
1084
|
+
}
|
|
1085
|
+
function backgroundValue(node, ctx) {
|
|
1086
|
+
const literal = fillCss(node);
|
|
1087
|
+
if (literal === null)
|
|
1088
|
+
return null;
|
|
1089
|
+
const resolved = ctx.bindings.resolved.find((r) => r.nodeId === node.id && r.property === "fills");
|
|
1090
|
+
if (resolved)
|
|
1091
|
+
return `var(${cssVariableName(resolved.compositionVariableId)}, ${literal})`;
|
|
1092
|
+
return literal;
|
|
1093
|
+
}
|
|
1094
|
+
function unresolvedAttr(node, ctx) {
|
|
1095
|
+
const props = ctx.bindings.unresolved.filter((u) => u.nodeId === node.id).map((u) => u.property);
|
|
1096
|
+
if (props.length === 0)
|
|
1097
|
+
return "";
|
|
1098
|
+
return ` data-figma-unresolved="${escapeHtml(props.join(" "))}"`;
|
|
1099
|
+
}
|
|
1100
|
+
function geometryCss(node, parentBox, isRoot) {
|
|
1101
|
+
const box = boxOf(node);
|
|
1102
|
+
const styles = [];
|
|
1103
|
+
if (!box)
|
|
1104
|
+
return styles;
|
|
1105
|
+
if (isRoot) {
|
|
1106
|
+
styles.push("position: relative", `width: ${round(box.width)}px`, `height: ${round(box.height)}px`);
|
|
1107
|
+
} else {
|
|
1108
|
+
styles.push("position: absolute", `left: ${round(box.x - parentBox.x)}px`, `top: ${round(box.y - parentBox.y)}px`, `width: ${round(box.width)}px`, `height: ${round(box.height)}px`);
|
|
1109
|
+
}
|
|
1110
|
+
return styles;
|
|
1111
|
+
}
|
|
1112
|
+
function cornerAndClipCss(node, styles) {
|
|
1113
|
+
if (node.type === "ELLIPSE") {
|
|
1114
|
+
styles.push("border-radius: 50%");
|
|
1115
|
+
} else if (typeof node.cornerRadius === "number" && node.cornerRadius > 0) {
|
|
1116
|
+
styles.push(`border-radius: ${round(node.cornerRadius)}px`);
|
|
1117
|
+
}
|
|
1118
|
+
if (node.clipsContent === true)
|
|
1119
|
+
styles.push("overflow: hidden");
|
|
1120
|
+
}
|
|
1121
|
+
function opacityCss(node, styles) {
|
|
1122
|
+
if (typeof node.opacity === "number" && node.opacity < 1)
|
|
1123
|
+
styles.push(`opacity: ${round(node.opacity)}`);
|
|
1124
|
+
}
|
|
1125
|
+
function decorationCss(node, ctx, rasterized) {
|
|
1126
|
+
const styles = [];
|
|
1127
|
+
if (!rasterized) {
|
|
1128
|
+
const bg = backgroundValue(node, ctx);
|
|
1129
|
+
if (node.type === "TEXT") {
|
|
1130
|
+
if (bg !== null)
|
|
1131
|
+
styles.push(`color: ${bg}`);
|
|
1132
|
+
textCss(node, styles);
|
|
1133
|
+
} else if (bg !== null) {
|
|
1134
|
+
styles.push(bg.includes("gradient(") ? `background: ${bg}` : `background-color: ${bg}`);
|
|
1135
|
+
}
|
|
1136
|
+
cornerAndClipCss(node, styles);
|
|
1137
|
+
}
|
|
1138
|
+
opacityCss(node, styles);
|
|
1139
|
+
effectsCss(node, styles);
|
|
1140
|
+
return styles;
|
|
1141
|
+
}
|
|
1142
|
+
var MAX_DEPTH = 500;
|
|
1143
|
+
function renderChildren(node, ctx, depth, parentBox) {
|
|
1144
|
+
const childHtml = [];
|
|
1145
|
+
for (const child of childDocuments(node)) {
|
|
1146
|
+
const rendered = renderNodeHtml(child, ctx, false, depth + 1, parentBox);
|
|
1147
|
+
if (rendered.length > 0)
|
|
1148
|
+
childHtml.push(rendered);
|
|
1149
|
+
}
|
|
1150
|
+
return childHtml.length > 0 ? `
|
|
1151
|
+
${childHtml.join("\n")}
|
|
1152
|
+
` : "";
|
|
1153
|
+
}
|
|
1154
|
+
function renderNodeHtml(node, ctx, isRoot, depth = 0, parentBox = ctx.origin) {
|
|
1155
|
+
if (node.visible === false || depth > MAX_DEPTH)
|
|
1156
|
+
return "";
|
|
1157
|
+
const slug = uniqueSlug(ctx, node.name);
|
|
1158
|
+
const rasterized = RASTERIZE_TYPES.has(node.type) || hasImageFill(node);
|
|
1159
|
+
const style = escapeHtml([...geometryCss(node, parentBox, isRoot), ...decorationCss(node, ctx, rasterized)].join("; "));
|
|
1160
|
+
const snippetAttr = isRoot ? ' data-hf-snippet=""' : "";
|
|
1161
|
+
const idAttrs = `id="${slug}"${snippetAttr} data-figma-id="${escapeHtml(node.id)}"${unresolvedAttr(node, ctx)}`;
|
|
1162
|
+
if (rasterized) {
|
|
1163
|
+
ctx.rasterize.push({ nodeId: node.id, name: node.name, slug });
|
|
1164
|
+
return `<img ${idAttrs} data-figma-rasterize="${escapeHtml(node.id)}" alt="${escapeHtml(node.name)}" style="${style}" />`;
|
|
1165
|
+
}
|
|
1166
|
+
if (node.type === "TEXT") {
|
|
1167
|
+
const text = typeof node.characters === "string" ? escapeHtml(node.characters) : "";
|
|
1168
|
+
return `<div ${idAttrs} style="${style}">${text}</div>`;
|
|
1169
|
+
}
|
|
1170
|
+
return `<div ${idAttrs} style="${style}">${renderChildren(node, ctx, depth, boxOf(node) ?? parentBox)}</div>`;
|
|
1171
|
+
}
|
|
1172
|
+
function nodeToHtml(root, bindings, opts = {}) {
|
|
1173
|
+
const origin = boxOf(root) ?? { x: 0, y: 0, width: 0, height: 0 };
|
|
1174
|
+
const ctx = { origin, bindings, rasterize: [], usedSlugs: /* @__PURE__ */ new Set() };
|
|
1175
|
+
const rootForRender = opts.rootName !== void 0 ? { ...root, name: opts.rootName } : root;
|
|
1176
|
+
const html = renderNodeHtml(rootForRender, ctx, true);
|
|
1177
|
+
return { html, rasterize: ctx.rasterize };
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
// ../core/dist/figma/tokensToVariables.js
|
|
1181
|
+
var TYPE_MAP = {
|
|
1182
|
+
COLOR: "color",
|
|
1183
|
+
FLOAT: "number",
|
|
1184
|
+
STRING: "string",
|
|
1185
|
+
BOOLEAN: "boolean"
|
|
1186
|
+
};
|
|
1187
|
+
function isRecord7(value) {
|
|
1188
|
+
return typeof value === "object" && value !== null;
|
|
1189
|
+
}
|
|
1190
|
+
function baseModeValue(payload, collections) {
|
|
1191
|
+
const modes = payload.valuesByMode ?? {};
|
|
1192
|
+
const collection = collections[payload.variableCollectionId ?? ""];
|
|
1193
|
+
if (isRecord7(collection) && typeof collection.defaultModeId === "string") {
|
|
1194
|
+
const preferred = modes[collection.defaultModeId];
|
|
1195
|
+
if (preferred !== void 0)
|
|
1196
|
+
return preferred;
|
|
1197
|
+
}
|
|
1198
|
+
for (const value of Object.values(modes))
|
|
1199
|
+
return value;
|
|
1200
|
+
return void 0;
|
|
1201
|
+
}
|
|
1202
|
+
function collectionName(payload, collections) {
|
|
1203
|
+
const collection = collections[payload.variableCollectionId ?? ""];
|
|
1204
|
+
return isRecord7(collection) && typeof collection.name === "string" ? collection.name : null;
|
|
1205
|
+
}
|
|
1206
|
+
function resolveValue(start, vars) {
|
|
1207
|
+
const chain = [];
|
|
1208
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1209
|
+
let currentId = start;
|
|
1210
|
+
while (!seen.has(currentId)) {
|
|
1211
|
+
chain.push(currentId);
|
|
1212
|
+
seen.add(currentId);
|
|
1213
|
+
const payload = vars.variables[currentId];
|
|
1214
|
+
if (!payload)
|
|
1215
|
+
return null;
|
|
1216
|
+
const value = baseModeValue(payload, vars.variableCollections);
|
|
1217
|
+
if (isRecord7(value) && value.type === "VARIABLE_ALIAS" && typeof value.id === "string") {
|
|
1218
|
+
currentId = value.id;
|
|
1219
|
+
continue;
|
|
1220
|
+
}
|
|
1221
|
+
return { value, chain };
|
|
1222
|
+
}
|
|
1223
|
+
return null;
|
|
1224
|
+
}
|
|
1225
|
+
function toEntryValue(resolvedType, raw) {
|
|
1226
|
+
if (resolvedType === "COLOR")
|
|
1227
|
+
return figmaColorToCss(raw);
|
|
1228
|
+
if (resolvedType === "FLOAT")
|
|
1229
|
+
return typeof raw === "number" ? raw : null;
|
|
1230
|
+
if (resolvedType === "BOOLEAN")
|
|
1231
|
+
return typeof raw === "boolean" ? raw : null;
|
|
1232
|
+
if (resolvedType === "STRING")
|
|
1233
|
+
return typeof raw === "string" ? raw : null;
|
|
1234
|
+
return null;
|
|
1235
|
+
}
|
|
1236
|
+
function tokensToVariables(vars, source) {
|
|
1237
|
+
const entries = [];
|
|
1238
|
+
const bindings = [];
|
|
1239
|
+
const sidecarTokens = [];
|
|
1240
|
+
for (const [figmaId, payload] of Object.entries(vars.variables)) {
|
|
1241
|
+
const entryType = TYPE_MAP[payload.resolvedType ?? ""];
|
|
1242
|
+
const resolved = resolveValue(figmaId, vars);
|
|
1243
|
+
const value = resolved ? toEntryValue(payload.resolvedType, resolved.value) : null;
|
|
1244
|
+
const collection = collectionName(payload, vars.variableCollections);
|
|
1245
|
+
const compositionVariableId = collection ? `figma:${collection}/${payload.name}` : `figma:${payload.name}`;
|
|
1246
|
+
sidecarTokens.push({
|
|
1247
|
+
name: payload.name,
|
|
1248
|
+
type: entryType ?? payload.resolvedType ?? "unknown",
|
|
1249
|
+
figmaId,
|
|
1250
|
+
key: payload.key,
|
|
1251
|
+
value
|
|
1252
|
+
});
|
|
1253
|
+
if (!entryType || value === null || !resolved)
|
|
1254
|
+
continue;
|
|
1255
|
+
entries.push({
|
|
1256
|
+
id: compositionVariableId,
|
|
1257
|
+
type: entryType,
|
|
1258
|
+
label: payload.name,
|
|
1259
|
+
default: value
|
|
1260
|
+
});
|
|
1261
|
+
bindings.push({
|
|
1262
|
+
kind: "binding",
|
|
1263
|
+
figmaId,
|
|
1264
|
+
key: payload.key,
|
|
1265
|
+
sourceFileKey: source.fileKey,
|
|
1266
|
+
aliasChain: resolved.chain.length > 1 ? resolved.chain : void 0,
|
|
1267
|
+
compositionVariableId,
|
|
1268
|
+
version: source.version
|
|
1269
|
+
});
|
|
1270
|
+
}
|
|
1271
|
+
return { entries, bindings, sidecar: { source, tokens: sidecarTokens } };
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
// src/commands/figma/cliError.ts
|
|
1275
|
+
async function withFigmaErrors(command, fn) {
|
|
1276
|
+
try {
|
|
1277
|
+
await fn();
|
|
1278
|
+
} catch (err) {
|
|
1279
|
+
if (err instanceof Error) {
|
|
1280
|
+
try {
|
|
1281
|
+
const { trackCommandFailure } = await import("./events-7LALYNKZ.js");
|
|
1282
|
+
trackCommandFailure(
|
|
1283
|
+
command,
|
|
1284
|
+
err,
|
|
1285
|
+
err instanceof FigmaClientError ? { error_name: err.code, endpoint: err.endpoint } : {}
|
|
1286
|
+
);
|
|
1287
|
+
} catch {
|
|
1288
|
+
}
|
|
1289
|
+
const [title = "figma command failed", ...rest] = err.message.split("\n");
|
|
1290
|
+
errorBox(title, rest.length > 0 ? rest.join("\n") : void 0);
|
|
1291
|
+
failCommand(1, err);
|
|
1292
|
+
}
|
|
1293
|
+
throw err;
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
export {
|
|
1298
|
+
FigmaClientError,
|
|
1299
|
+
createFigmaClient,
|
|
1300
|
+
parseFigmaRef,
|
|
1301
|
+
MAX_FREEZE_BYTES,
|
|
1302
|
+
exceedsFreezeCap,
|
|
1303
|
+
freezeBytes,
|
|
1304
|
+
typeDirPath,
|
|
1305
|
+
appendRecord,
|
|
1306
|
+
findAllByFigmaNode,
|
|
1307
|
+
updateRecord,
|
|
1308
|
+
nextId,
|
|
1309
|
+
regenerateIndex,
|
|
1310
|
+
buildAssetSnippet,
|
|
1311
|
+
sanitizeSvg,
|
|
1312
|
+
readBindings,
|
|
1313
|
+
upsertBindings,
|
|
1314
|
+
resolveBindings,
|
|
1315
|
+
nodeToHtml,
|
|
1316
|
+
tokensToVariables,
|
|
1317
|
+
withFigmaErrors
|
|
1318
|
+
};
|