loopwind 0.16.0 → 0.18.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/dist/default-templates/AGENTS.md +18 -2
- package/dist/lib/renderer.d.ts +6 -1
- package/dist/lib/renderer.d.ts.map +1 -1
- package/dist/lib/renderer.js +9 -9
- package/dist/lib/renderer.js.map +1 -1
- package/dist/lib/video-renderer.d.ts +3 -0
- package/dist/lib/video-renderer.d.ts.map +1 -1
- package/dist/lib/video-renderer.js +7 -7
- package/dist/lib/video-renderer.js.map +1 -1
- package/dist/sdk/index.d.ts +5 -3
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +30 -9
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/template.d.ts +136 -0
- package/dist/sdk/template.d.ts.map +1 -1
- package/dist/sdk/template.js +198 -0
- package/dist/sdk/template.js.map +1 -1
- package/examples/code-editor-templates.ts +173 -0
- package/examples/nextjs-template-import.ts +58 -0
- package/examples/visual-builder-templates.ts +336 -0
- package/package.json +1 -1
- package/test-font-files.mjs +72 -0
- package/test-sdk-config.mjs +397 -0
- package/test-sdk-user-templates.mjs +469 -0
- package/website/.astro/integrations/_inox-tools_astro-when/types.d.ts +1 -0
- package/website/.astro/types.d.ts +1 -0
- package/website/DEPLOYMENT.md +142 -0
- package/website/OG_IMAGES.md +141 -0
- package/website/README.md +39 -19
- package/website/deploy.sh +19 -0
- package/website/dist/.gitkeep +1 -0
- package/website/dist/_astro/agents.Yx-L_igG.css +1 -0
- package/website/dist/_routes.json +30 -0
- package/website/dist/_worker.js/_@astrojs-ssr-adapter.mjs +1033 -0
- package/website/dist/_worker.js/_astro-internal_middleware.mjs +40 -0
- package/website/dist/_worker.js/chunks/abap_BTmsHiP5.mjs +1 -0
- package/website/dist/_worker.js/chunks/actionscript-3_DmBelb1E.mjs +1 -0
- package/website/dist/_worker.js/chunks/ada_8-E0ahCN.mjs +1 -0
- package/website/dist/_worker.js/chunks/andromeeda_XI-CXx50.mjs +1 -0
- package/website/dist/_worker.js/chunks/angular-html_DKGh3gGH.mjs +1 -0
- package/website/dist/_worker.js/chunks/angular-ts_-qZGsJoA.mjs +1 -0
- package/website/dist/_worker.js/chunks/apache_ijTUt0Ee.mjs +1 -0
- package/website/dist/_worker.js/chunks/apex_agu1c6Sh.mjs +1 -0
- package/website/dist/_worker.js/chunks/apl_Bj2f7Art.mjs +1 -0
- package/website/dist/_worker.js/chunks/applescript_B_vXrOh3.mjs +1 -0
- package/website/dist/_worker.js/chunks/ara_DCEQ2rnh.mjs +1 -0
- package/website/dist/_worker.js/chunks/asciidoc_CGN_EkYS.mjs +1 -0
- package/website/dist/_worker.js/chunks/asm_BBWZgnDp.mjs +1 -0
- package/website/dist/_worker.js/chunks/astro/assets-service_j52rQLzU.mjs +721 -0
- package/website/dist/_worker.js/chunks/astro/server_Y5_QHO8v.mjs +2401 -0
- package/website/dist/_worker.js/chunks/astro-designed-error-pages_BNTLO-TA.mjs +542 -0
- package/website/dist/_worker.js/chunks/astro_Dr_hht3h.mjs +1 -0
- package/website/dist/_worker.js/chunks/aurora-x_9GHG8nSq.mjs +1 -0
- package/website/dist/_worker.js/chunks/awk_DHRvhXot.mjs +1 -0
- package/website/dist/_worker.js/chunks/ayu-dark_CcvqmEHE.mjs +1 -0
- package/website/dist/_worker.js/chunks/ballerina_C7SdeSZb.mjs +1 -0
- package/website/dist/_worker.js/chunks/bat_Dv4A3u45.mjs +1 -0
- package/website/dist/_worker.js/chunks/beancount_BfPf9Luv.mjs +1 -0
- package/website/dist/_worker.js/chunks/berry_B8rfM3lL.mjs +1 -0
- package/website/dist/_worker.js/chunks/bibtex_TcjYgtJM.mjs +1 -0
- package/website/dist/_worker.js/chunks/bicep_CrlFWCdN.mjs +1 -0
- package/website/dist/_worker.js/chunks/blade_lanKVYID.mjs +1 -0
- package/website/dist/_worker.js/chunks/bsl_BhppzXMB.mjs +1 -0
- package/website/dist/_worker.js/chunks/c_6FBALJTK.mjs +1 -0
- package/website/dist/_worker.js/chunks/cadence_2txU9LVE.mjs +1 -0
- package/website/dist/_worker.js/chunks/cairo_BkrFAIlP.mjs +1 -0
- package/website/dist/_worker.js/chunks/catppuccin-frappe_CkEqIYhU.mjs +1 -0
- package/website/dist/_worker.js/chunks/catppuccin-latte_DG4Gx_-v.mjs +1 -0
- package/website/dist/_worker.js/chunks/catppuccin-macchiato_Cwi3vCXf.mjs +1 -0
- package/website/dist/_worker.js/chunks/catppuccin-mocha_L9_OPlFX.mjs +1 -0
- package/website/dist/_worker.js/chunks/clarity_BEAe4Ulu.mjs +1 -0
- package/website/dist/_worker.js/chunks/clojure_VnUX6p2g.mjs +1 -0
- package/website/dist/_worker.js/chunks/cmake_0-SGkZEj.mjs +1 -0
- package/website/dist/_worker.js/chunks/cobol_92M_KGaE.mjs +1 -0
- package/website/dist/_worker.js/chunks/codeowners_CzMwskBv.mjs +1 -0
- package/website/dist/_worker.js/chunks/codeql_DWJZNHv1.mjs +1 -0
- package/website/dist/_worker.js/chunks/coffee_CQjKU2fh.mjs +1 -0
- package/website/dist/_worker.js/chunks/common-lisp_BBLWDpS5.mjs +1 -0
- package/website/dist/_worker.js/chunks/coq_hedRFV3D.mjs +1 -0
- package/website/dist/_worker.js/chunks/cpp_DlS1i6Zs.mjs +1 -0
- package/website/dist/_worker.js/chunks/crystal_D6n65fKV.mjs +1 -0
- package/website/dist/_worker.js/chunks/csharp_C6FCVFzc.mjs +1 -0
- package/website/dist/_worker.js/chunks/css_C5uJEgmJ.mjs +1 -0
- package/website/dist/_worker.js/chunks/csv_CtMYuuJl.mjs +1 -0
- package/website/dist/_worker.js/chunks/cue_BsPexqx6.mjs +1 -0
- package/website/dist/_worker.js/chunks/cypher_apzf6OBi.mjs +1 -0
- package/website/dist/_worker.js/chunks/d_DcvIRcgm.mjs +1 -0
- package/website/dist/_worker.js/chunks/dark-plus_C01ONtzj.mjs +1 -0
- package/website/dist/_worker.js/chunks/dart_WkzM5WrV.mjs +1 -0
- package/website/dist/_worker.js/chunks/dax_DjXAO5V4.mjs +1 -0
- package/website/dist/_worker.js/chunks/desktop_C92LCxdc.mjs +1 -0
- package/website/dist/_worker.js/chunks/diff_CVwM_9XJ.mjs +1 -0
- package/website/dist/_worker.js/chunks/docker_DPzgJf6Z.mjs +1 -0
- package/website/dist/_worker.js/chunks/dotenv_D_vgANvA.mjs +1 -0
- package/website/dist/_worker.js/chunks/dracula-soft_CLnUBwFm.mjs +1 -0
- package/website/dist/_worker.js/chunks/dracula_lBVpb6Lb.mjs +1 -0
- package/website/dist/_worker.js/chunks/dream-maker_DTLbzd_J.mjs +1 -0
- package/website/dist/_worker.js/chunks/edge_i54JYm3_.mjs +1 -0
- package/website/dist/_worker.js/chunks/elixir_BJCIjTu4.mjs +1 -0
- package/website/dist/_worker.js/chunks/elm_BbXD39-_.mjs +1 -0
- package/website/dist/_worker.js/chunks/emacs-lisp_pxa5cXaN.mjs +1 -0
- package/website/dist/_worker.js/chunks/erb_Ccjijeee.mjs +1 -0
- package/website/dist/_worker.js/chunks/erlang_B2VM_hi7.mjs +1 -0
- package/website/dist/_worker.js/chunks/everforest-dark_BxvIPBim.mjs +1 -0
- package/website/dist/_worker.js/chunks/everforest-light_B7VoyaJM.mjs +1 -0
- package/website/dist/_worker.js/chunks/fennel_D-uo7X6c.mjs +1 -0
- package/website/dist/_worker.js/chunks/fish_BjePoK3m.mjs +1 -0
- package/website/dist/_worker.js/chunks/fluent_C8fgkzLX.mjs +1 -0
- package/website/dist/_worker.js/chunks/fortran-fixed-form_D1pu5zrc.mjs +1 -0
- package/website/dist/_worker.js/chunks/fortran-free-form_CSGOhJD6.mjs +1 -0
- package/website/dist/_worker.js/chunks/fsharp_B0xy-A4Y.mjs +1 -0
- package/website/dist/_worker.js/chunks/gdresource_CWppjlHq.mjs +1 -0
- package/website/dist/_worker.js/chunks/gdscript_eQCHchcS.mjs +1 -0
- package/website/dist/_worker.js/chunks/gdshader_C4kxepX7.mjs +1 -0
- package/website/dist/_worker.js/chunks/genie_ACtQLcDW.mjs +1 -0
- package/website/dist/_worker.js/chunks/gherkin_BFp2uKUd.mjs +1 -0
- package/website/dist/_worker.js/chunks/git-commit_CLg9ZwMV.mjs +1 -0
- package/website/dist/_worker.js/chunks/git-rebase_DG8A80Nt.mjs +1 -0
- package/website/dist/_worker.js/chunks/github-dark-default_BI0EP2Kv.mjs +1 -0
- package/website/dist/_worker.js/chunks/github-dark-dimmed_a_NIC0Xb.mjs +1 -0
- package/website/dist/_worker.js/chunks/github-dark-high-contrast_jZGqT7hk.mjs +1 -0
- package/website/dist/_worker.js/chunks/github-dark_CHCDNd2O.mjs +1 -0
- package/website/dist/_worker.js/chunks/github-light-default_DRbOW5RG.mjs +1 -0
- package/website/dist/_worker.js/chunks/github-light-high-contrast_tn_kWutM.mjs +1 -0
- package/website/dist/_worker.js/chunks/github-light_D9brYzot.mjs +1 -0
- package/website/dist/_worker.js/chunks/gleam_Dmhu1oxW.mjs +1 -0
- package/website/dist/_worker.js/chunks/glimmer-js_BfZbXy8A.mjs +1 -0
- package/website/dist/_worker.js/chunks/glimmer-ts_B9QVICrD.mjs +1 -0
- package/website/dist/_worker.js/chunks/glsl_DD2PPwOs.mjs +1 -0
- package/website/dist/_worker.js/chunks/gnuplot_D2OYChUX.mjs +1 -0
- package/website/dist/_worker.js/chunks/go_DYGFTe3h.mjs +1 -0
- package/website/dist/_worker.js/chunks/graphql_B7XsT3nH.mjs +1 -0
- package/website/dist/_worker.js/chunks/groovy_BO12Uwkl.mjs +1 -0
- package/website/dist/_worker.js/chunks/hack_CB2_ztCP.mjs +1 -0
- package/website/dist/_worker.js/chunks/haml_CyfDcDD3.mjs +1 -0
- package/website/dist/_worker.js/chunks/handlebars_CfpxpWm2.mjs +1 -0
- package/website/dist/_worker.js/chunks/haskell_jUeC5uN5.mjs +1 -0
- package/website/dist/_worker.js/chunks/haxe_B6GxP1WB.mjs +1 -0
- package/website/dist/_worker.js/chunks/hcl_DwoHV2oh.mjs +1 -0
- package/website/dist/_worker.js/chunks/hjson_DV7cJRk4.mjs +1 -0
- package/website/dist/_worker.js/chunks/hlsl_BlFCscPI.mjs +1 -0
- package/website/dist/_worker.js/chunks/houston_COBFG1Mx.mjs +1 -0
- package/website/dist/_worker.js/chunks/html-derivative_C9pJ337h.mjs +1 -0
- package/website/dist/_worker.js/chunks/html_D1OkrZS5.mjs +1 -0
- package/website/dist/_worker.js/chunks/http_DIGXRqvJ.mjs +1 -0
- package/website/dist/_worker.js/chunks/hxml_DEwh9i-c.mjs +1 -0
- package/website/dist/_worker.js/chunks/hy_DDoIgW1K.mjs +1 -0
- package/website/dist/_worker.js/chunks/imba_B00zbHo4.mjs +1 -0
- package/website/dist/_worker.js/chunks/index_C1UTDwYg.mjs +1861 -0
- package/website/dist/_worker.js/chunks/ini_D7XQA_p8.mjs +1 -0
- package/website/dist/_worker.js/chunks/java_B9wdFd8K.mjs +1 -0
- package/website/dist/_worker.js/chunks/javascript_CLsPGOON.mjs +1 -0
- package/website/dist/_worker.js/chunks/jinja_jarBCAN1.mjs +1 -0
- package/website/dist/_worker.js/chunks/jison_oGg3J708.mjs +1 -0
- package/website/dist/_worker.js/chunks/json5_DlZ1Kyaa.mjs +1 -0
- package/website/dist/_worker.js/chunks/json_DaYk_FMp.mjs +1 -0
- package/website/dist/_worker.js/chunks/jsonc_DlwgfSDs.mjs +1 -0
- package/website/dist/_worker.js/chunks/jsonl_BbCCVaZF.mjs +1 -0
- package/website/dist/_worker.js/chunks/jsonnet_Dt-G75xe.mjs +1 -0
- package/website/dist/_worker.js/chunks/jssm_BtKFTj2A.mjs +1 -0
- package/website/dist/_worker.js/chunks/jsx_DDx_xAZ8.mjs +1 -0
- package/website/dist/_worker.js/chunks/julia_CK0lv68l.mjs +1 -0
- package/website/dist/_worker.js/chunks/kanagawa-dragon_BldAK3Oo.mjs +1 -0
- package/website/dist/_worker.js/chunks/kanagawa-lotus_DVM8FX9_.mjs +1 -0
- package/website/dist/_worker.js/chunks/kanagawa-wave_Dpih0AKP.mjs +1 -0
- package/website/dist/_worker.js/chunks/kotlin_kWneB9V_.mjs +1 -0
- package/website/dist/_worker.js/chunks/kusto_BKVATd95.mjs +1 -0
- package/website/dist/_worker.js/chunks/laserwave_BqatxsVl.mjs +1 -0
- package/website/dist/_worker.js/chunks/latex_LVDcGBbc.mjs +1 -0
- package/website/dist/_worker.js/chunks/lean_W7qo-5M2.mjs +1 -0
- package/website/dist/_worker.js/chunks/less_DFNwJnBH.mjs +1 -0
- package/website/dist/_worker.js/chunks/light-plus_Dp0AoWsO.mjs +1 -0
- package/website/dist/_worker.js/chunks/liquid_D24qs0pc.mjs +1 -0
- package/website/dist/_worker.js/chunks/log_IPWMXriF.mjs +1 -0
- package/website/dist/_worker.js/chunks/logo_C6KaatrQ.mjs +1 -0
- package/website/dist/_worker.js/chunks/lua_CwnEf-T7.mjs +1 -0
- package/website/dist/_worker.js/chunks/luau_Br3-CXjS.mjs +1 -0
- package/website/dist/_worker.js/chunks/make_UBNG-kOo.mjs +1 -0
- package/website/dist/_worker.js/chunks/markdown_C7mhJFCm.mjs +1 -0
- package/website/dist/_worker.js/chunks/marko_4tchUvI7.mjs +1 -0
- package/website/dist/_worker.js/chunks/material-theme-darker_SKtaNEPn.mjs +1 -0
- package/website/dist/_worker.js/chunks/material-theme-lighter_zOX_DZCH.mjs +1 -0
- package/website/dist/_worker.js/chunks/material-theme-ocean_BN9WbhdC.mjs +1 -0
- package/website/dist/_worker.js/chunks/material-theme-palenight_DT_covjH.mjs +1 -0
- package/website/dist/_worker.js/chunks/material-theme_6RpeM3kc.mjs +1 -0
- package/website/dist/_worker.js/chunks/matlab_DCOXsPKR.mjs +1 -0
- package/website/dist/_worker.js/chunks/mdc_B9gb2UFP.mjs +1 -0
- package/website/dist/_worker.js/chunks/mdx_DGU7Nu9u.mjs +1 -0
- package/website/dist/_worker.js/chunks/mermaid_B69URzsZ.mjs +1 -0
- package/website/dist/_worker.js/chunks/min-dark_BgxifOMI.mjs +1 -0
- package/website/dist/_worker.js/chunks/min-light_BrPjXxUp.mjs +1 -0
- package/website/dist/_worker.js/chunks/mipsasm_9U-4_t7k.mjs +1 -0
- package/website/dist/_worker.js/chunks/mojo_B0wt7ug3.mjs +1 -0
- package/website/dist/_worker.js/chunks/monokai_B6Pxpoyi.mjs +1 -0
- package/website/dist/_worker.js/chunks/move_1eid4CyR.mjs +1 -0
- package/website/dist/_worker.js/chunks/narrat_Ds6-p5JZ.mjs +1 -0
- package/website/dist/_worker.js/chunks/nextflow_v2N1Qlqa.mjs +1 -0
- package/website/dist/_worker.js/chunks/nginx_Bp9Ab2NH.mjs +1 -0
- package/website/dist/_worker.js/chunks/night-owl_CdwOw_sc.mjs +1 -0
- package/website/dist/_worker.js/chunks/nim_BXGDUe53.mjs +1 -0
- package/website/dist/_worker.js/chunks/nix_CUig1nJH.mjs +1 -0
- package/website/dist/_worker.js/chunks/noop-middleware_DlWGj5t5.mjs +10 -0
- package/website/dist/_worker.js/chunks/nord_SPoG1iae.mjs +1 -0
- package/website/dist/_worker.js/chunks/nushell_DJw1Lca8.mjs +1 -0
- package/website/dist/_worker.js/chunks/objective-c_Bktzl_CO.mjs +1 -0
- package/website/dist/_worker.js/chunks/objective-cpp_CP4DWdDp.mjs +1 -0
- package/website/dist/_worker.js/chunks/ocaml_CeEAs7bZ.mjs +1 -0
- package/website/dist/_worker.js/chunks/one-dark-pro_-hIwCNMi.mjs +1 -0
- package/website/dist/_worker.js/chunks/one-light_DSmYvJ05.mjs +1 -0
- package/website/dist/_worker.js/chunks/pascal_C-S_Ms_o.mjs +1 -0
- package/website/dist/_worker.js/chunks/perl_CKamvo15.mjs +1 -0
- package/website/dist/_worker.js/chunks/php_BlmcX_F3.mjs +1 -0
- package/website/dist/_worker.js/chunks/plastic_Ryt8tVoA.mjs +1 -0
- package/website/dist/_worker.js/chunks/plsql_Cb3v7cBj.mjs +1 -0
- package/website/dist/_worker.js/chunks/po_DZbdNRlo.mjs +1 -0
- package/website/dist/_worker.js/chunks/poimandres_bYmE3_5d.mjs +1 -0
- package/website/dist/_worker.js/chunks/polar_pJkMGwoW.mjs +1 -0
- package/website/dist/_worker.js/chunks/postcss_BAXSOKgk.mjs +1 -0
- package/website/dist/_worker.js/chunks/powerquery_oITMGN4x.mjs +1 -0
- package/website/dist/_worker.js/chunks/powershell_6306-xIF.mjs +1 -0
- package/website/dist/_worker.js/chunks/prisma_DSDxnZGz.mjs +1 -0
- package/website/dist/_worker.js/chunks/prolog_CxG7tjZR.mjs +1 -0
- package/website/dist/_worker.js/chunks/proto_CS9ByXm1.mjs +1 -0
- package/website/dist/_worker.js/chunks/pug_BMtLJo6U.mjs +1 -0
- package/website/dist/_worker.js/chunks/puppet_BfeeSzee.mjs +1 -0
- package/website/dist/_worker.js/chunks/purescript_BFfueNaH.mjs +1 -0
- package/website/dist/_worker.js/chunks/python_Cc4Faapv.mjs +1 -0
- package/website/dist/_worker.js/chunks/qml_C1CTJTK8.mjs +1 -0
- package/website/dist/_worker.js/chunks/qmldir_nG1KaqKR.mjs +1 -0
- package/website/dist/_worker.js/chunks/qss_Cncxk263.mjs +1 -0
- package/website/dist/_worker.js/chunks/r_ChR54Ihi.mjs +1 -0
- package/website/dist/_worker.js/chunks/racket_BDrhptDs.mjs +1 -0
- package/website/dist/_worker.js/chunks/raku_07OUHa0P.mjs +1 -0
- package/website/dist/_worker.js/chunks/razor_DIP3INLa.mjs +1 -0
- package/website/dist/_worker.js/chunks/red_DOPXfj-6.mjs +1 -0
- package/website/dist/_worker.js/chunks/reg_B64SwEDj.mjs +1 -0
- package/website/dist/_worker.js/chunks/regexp_ButFGoB5.mjs +1 -0
- package/website/dist/_worker.js/chunks/rel_BWJAWqZD.mjs +1 -0
- package/website/dist/_worker.js/chunks/riscv_79gXlbsF.mjs +1 -0
- package/website/dist/_worker.js/chunks/rose-pine-dawn_DHIjVGd3.mjs +1 -0
- package/website/dist/_worker.js/chunks/rose-pine-moon_t86aEbs0.mjs +1 -0
- package/website/dist/_worker.js/chunks/rose-pine_BHgrcDCs.mjs +1 -0
- package/website/dist/_worker.js/chunks/rst_D3F4Fcpj.mjs +1 -0
- package/website/dist/_worker.js/chunks/ruby_Cs7vM9iv.mjs +1 -0
- package/website/dist/_worker.js/chunks/rust_DpyRVatH.mjs +1 -0
- package/website/dist/_worker.js/chunks/sas_DW45xZXN.mjs +1 -0
- package/website/dist/_worker.js/chunks/sass_C6SiMwN_.mjs +1 -0
- package/website/dist/_worker.js/chunks/scala_DlZOjNZk.mjs +1 -0
- package/website/dist/_worker.js/chunks/scheme_D2ezSJXu.mjs +1 -0
- package/website/dist/_worker.js/chunks/scss_DG5Spjqu.mjs +1 -0
- package/website/dist/_worker.js/chunks/sdbl_ZCYaj4VN.mjs +1 -0
- package/website/dist/_worker.js/chunks/shaderlab_CAcRkg1_.mjs +1 -0
- package/website/dist/_worker.js/chunks/shellscript_BWwhkDVh.mjs +1 -0
- package/website/dist/_worker.js/chunks/shellsession_BfEA3juK.mjs +1 -0
- package/website/dist/_worker.js/chunks/slack-dark_CL3lSpCc.mjs +1 -0
- package/website/dist/_worker.js/chunks/slack-ochin_DdZKOQVh.mjs +1 -0
- package/website/dist/_worker.js/chunks/smalltalk_DgilzSui.mjs +1 -0
- package/website/dist/_worker.js/chunks/snazzy-light_eJU08Pz_.mjs +1 -0
- package/website/dist/_worker.js/chunks/solarized-dark_Dg_YQywx.mjs +1 -0
- package/website/dist/_worker.js/chunks/solarized-light_BnIsrA6p.mjs +1 -0
- package/website/dist/_worker.js/chunks/solidity_DkseH8pQ.mjs +1 -0
- package/website/dist/_worker.js/chunks/soy_DU7bOYoG.mjs +1 -0
- package/website/dist/_worker.js/chunks/sparql_BuI1DBDH.mjs +1 -0
- package/website/dist/_worker.js/chunks/splunk_B8Ha9Pkg.mjs +1 -0
- package/website/dist/_worker.js/chunks/sql_BniHwea5.mjs +1 -0
- package/website/dist/_worker.js/chunks/ssh-config_CkE1GuVe.mjs +1 -0
- package/website/dist/_worker.js/chunks/stata_Dtqpbd_l.mjs +1 -0
- package/website/dist/_worker.js/chunks/stylus_CXTtglzO.mjs +1 -0
- package/website/dist/_worker.js/chunks/svelte_BjWYcUCN.mjs +1 -0
- package/website/dist/_worker.js/chunks/swift_BzHql_rM.mjs +1 -0
- package/website/dist/_worker.js/chunks/synthwave-84_DLRNhxNA.mjs +1 -0
- package/website/dist/_worker.js/chunks/system-verilog_ChyInPph.mjs +1 -0
- package/website/dist/_worker.js/chunks/systemd_Bi9Qa2qD.mjs +1 -0
- package/website/dist/_worker.js/chunks/talonscript_B3sH_Y-V.mjs +1 -0
- package/website/dist/_worker.js/chunks/tasl_BJ5yipRs.mjs +1 -0
- package/website/dist/_worker.js/chunks/tcl_CoJQjNoP.mjs +1 -0
- package/website/dist/_worker.js/chunks/templ_CrU7Ffil.mjs +1 -0
- package/website/dist/_worker.js/chunks/terraform_DT9JSFpC.mjs +1 -0
- package/website/dist/_worker.js/chunks/tex_5PKu2yA0.mjs +1 -0
- package/website/dist/_worker.js/chunks/tokyo-night_Buo8OK7-.mjs +1 -0
- package/website/dist/_worker.js/chunks/toml_CPuXX3oc.mjs +1 -0
- package/website/dist/_worker.js/chunks/ts-tags_D0M_1VSH.mjs +1 -0
- package/website/dist/_worker.js/chunks/tsv_CuivVNot.mjs +1 -0
- package/website/dist/_worker.js/chunks/tsx_MkuGr8MY.mjs +1 -0
- package/website/dist/_worker.js/chunks/turtle_BqgEPK7f.mjs +1 -0
- package/website/dist/_worker.js/chunks/twig_r1G9rpYJ.mjs +1 -0
- package/website/dist/_worker.js/chunks/typescript_Au5buqzM.mjs +1 -0
- package/website/dist/_worker.js/chunks/typespec_47rhBK_z.mjs +1 -0
- package/website/dist/_worker.js/chunks/typst_BAtuQLh-.mjs +1 -0
- package/website/dist/_worker.js/chunks/v_BIvWImHg.mjs +1 -0
- package/website/dist/_worker.js/chunks/vala_DYEacj30.mjs +1 -0
- package/website/dist/_worker.js/chunks/vb_CikQuqGJ.mjs +1 -0
- package/website/dist/_worker.js/chunks/verilog_BQRENwI-.mjs +1 -0
- package/website/dist/_worker.js/chunks/vesper_DA0kvTmj.mjs +1 -0
- package/website/dist/_worker.js/chunks/vhdl_DHscJIyg.mjs +1 -0
- package/website/dist/_worker.js/chunks/viml_F2pvMwvG.mjs +1 -0
- package/website/dist/_worker.js/chunks/vitesse-black_D9tjNzd0.mjs +1 -0
- package/website/dist/_worker.js/chunks/vitesse-dark_Bnm5d0hd.mjs +1 -0
- package/website/dist/_worker.js/chunks/vitesse-light_CHwbyjNR.mjs +1 -0
- package/website/dist/_worker.js/chunks/vue-html_DyYtbbMK.mjs +1 -0
- package/website/dist/_worker.js/chunks/vue_DofN6juy.mjs +1 -0
- package/website/dist/_worker.js/chunks/vyper_CiR0m-OV.mjs +1 -0
- package/website/dist/_worker.js/chunks/wasm_CwIGgRGf.mjs +1 -0
- package/website/dist/_worker.js/chunks/wasm_jKWhg0J0.mjs +1 -0
- package/website/dist/_worker.js/chunks/wenyan_DKvVZKXW.mjs +1 -0
- package/website/dist/_worker.js/chunks/wgsl_BOWZY7yw.mjs +1 -0
- package/website/dist/_worker.js/chunks/wikitext_CXDhhHPy.mjs +1 -0
- package/website/dist/_worker.js/chunks/wolfram_ChkmGnW0.mjs +1 -0
- package/website/dist/_worker.js/chunks/xml_DXH3hHIu.mjs +1 -0
- package/website/dist/_worker.js/chunks/xsl_DuP2mFjg.mjs +1 -0
- package/website/dist/_worker.js/chunks/yaml_IGiEkTge.mjs +1 -0
- package/website/dist/_worker.js/chunks/zenscript_59iXGyNw.mjs +1 -0
- package/website/dist/_worker.js/chunks/zig_DKzb0zdT.mjs +1 -0
- package/website/dist/_worker.js/index.js +53 -0
- package/website/dist/_worker.js/manifest_BAAoOzaU.mjs +98 -0
- package/website/dist/_worker.js/pages/_image.astro.mjs +24 -0
- package/website/dist/_worker.js/pages/agents.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/animation.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/api/raw-markdown/_---path_.astro.mjs +44 -0
- package/website/dist/_worker.js/pages/config.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/fonts.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/getting-started.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/helpers.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/images.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/index.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/llm.txt.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/preview.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/sdk.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/sitemap.xml.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/styling.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/templates.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/video.astro.mjs +1 -0
- package/website/dist/_worker.js/renderers.mjs +57 -0
- package/website/dist/agents/index.html +3 -2
- package/website/dist/animation/index.html +402 -128
- package/website/dist/config/index.html +184 -0
- package/website/dist/fonts/index.html +56 -52
- package/website/dist/getting-started/index.html +107 -0
- package/website/dist/helpers/index.html +8 -8
- package/website/dist/images/index.html +50 -23
- package/website/dist/index.html +114 -148
- package/website/dist/llm.txt +751 -1055
- package/website/dist/preview/index.html +111 -0
- package/website/dist/robots.txt +35 -0
- package/website/dist/sdk/index.html +390 -52
- package/website/dist/sitemap.xml +76 -0
- package/website/dist/styling/index.html +10 -7
- package/website/dist/templates/index.html +11 -59
- package/website/dist/video/index.html +106 -537
- package/website/package.json +1 -0
- package/website/public/.assetsignore +3 -0
- package/website/templates/og-image.tsx +61 -0
- package/website/wrangler.toml +12 -0
- package/website/dist/_astro/agents.I1-fN38o.css +0 -1
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration tests for SDK StyleConfig
|
|
3
|
+
* Run with: node test-sdk-config.mjs
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { defineTemplate, renderImage, renderVideo } from './dist/sdk/index.js';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import fs from 'fs/promises';
|
|
9
|
+
import path from 'path';
|
|
10
|
+
import { fileURLToPath } from 'url';
|
|
11
|
+
|
|
12
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const { createElement: h } = React;
|
|
14
|
+
|
|
15
|
+
// Test utilities
|
|
16
|
+
let testsPassed = 0;
|
|
17
|
+
let testsFailed = 0;
|
|
18
|
+
|
|
19
|
+
function assert(condition, message) {
|
|
20
|
+
if (!condition) {
|
|
21
|
+
console.error(`❌ FAIL: ${message}`);
|
|
22
|
+
testsFailed++;
|
|
23
|
+
throw new Error(message);
|
|
24
|
+
} else {
|
|
25
|
+
console.log(`✅ PASS: ${message}`);
|
|
26
|
+
testsPassed++;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function test(name, fn) {
|
|
31
|
+
console.log(`\n📝 Test: ${name}`);
|
|
32
|
+
try {
|
|
33
|
+
await fn();
|
|
34
|
+
} catch (error) {
|
|
35
|
+
console.error(`Error in test "${name}":`, error.message);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Helper to check if SVG contains specific color
|
|
40
|
+
function svgContainsColor(svg, color) {
|
|
41
|
+
// Normalize color format (remove # if present)
|
|
42
|
+
const normalizedColor = color.replace('#', '');
|
|
43
|
+
return svg.includes(normalizedColor) || svg.includes(color);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Test 1: Config in defineTemplate (image)
|
|
47
|
+
await test('Config in defineTemplate - Image', async () => {
|
|
48
|
+
const config = {
|
|
49
|
+
colors: {
|
|
50
|
+
primary: '#ff0000',
|
|
51
|
+
background: '#00ff00',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const template = defineTemplate({
|
|
56
|
+
name: 'test-config-template',
|
|
57
|
+
size: { width: 400, height: 400 },
|
|
58
|
+
config,
|
|
59
|
+
render: ({ tw, title }) =>
|
|
60
|
+
h('div', { style: tw('flex items-center justify-center w-full h-full bg-background') },
|
|
61
|
+
h('h1', { style: tw('text-4xl font-bold text-primary') }, title)
|
|
62
|
+
),
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
assert(template.config, 'Template should have config');
|
|
66
|
+
assert(template.config.colors.primary === '#ff0000', 'Config colors should match');
|
|
67
|
+
|
|
68
|
+
const svg = await renderImage(template, { title: 'Test' }, { format: 'svg' });
|
|
69
|
+
const svgString = svg.toString();
|
|
70
|
+
|
|
71
|
+
assert(svgContainsColor(svgString, '#ff0000'), 'SVG should contain primary color');
|
|
72
|
+
assert(svgContainsColor(svgString, '#00ff00'), 'SVG should contain background color');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// Test 2: Config in renderImage options
|
|
76
|
+
await test('Config in renderImage options', async () => {
|
|
77
|
+
const template = defineTemplate({
|
|
78
|
+
name: 'test-render-config',
|
|
79
|
+
size: { width: 400, height: 400 },
|
|
80
|
+
render: ({ tw, title }) =>
|
|
81
|
+
h('div', { style: tw('flex items-center justify-center w-full h-full bg-secondary') },
|
|
82
|
+
h('h1', { style: tw('text-4xl font-bold text-accent') }, title)
|
|
83
|
+
),
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const svg = await renderImage(
|
|
87
|
+
template,
|
|
88
|
+
{ title: 'Test' },
|
|
89
|
+
{
|
|
90
|
+
format: 'svg',
|
|
91
|
+
config: {
|
|
92
|
+
colors: {
|
|
93
|
+
accent: '#0000ff',
|
|
94
|
+
secondary: '#ffff00',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
const svgString = svg.toString();
|
|
101
|
+
assert(svgContainsColor(svgString, '#0000ff'), 'SVG should contain accent color from options');
|
|
102
|
+
assert(svgContainsColor(svgString, '#ffff00'), 'SVG should contain secondary color from options');
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// Test 3: Config override (options override template)
|
|
106
|
+
await test('Config override - Options override template', async () => {
|
|
107
|
+
const template = defineTemplate({
|
|
108
|
+
name: 'test-override',
|
|
109
|
+
size: { width: 400, height: 400 },
|
|
110
|
+
config: {
|
|
111
|
+
colors: {
|
|
112
|
+
brand: '#111111',
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
render: ({ tw }) =>
|
|
116
|
+
h('div', { style: tw('flex items-center justify-center w-full h-full bg-brand') },
|
|
117
|
+
h('h1', { style: tw('text-4xl font-bold') }, 'Override Test')
|
|
118
|
+
),
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
const svg = await renderImage(
|
|
122
|
+
template,
|
|
123
|
+
{},
|
|
124
|
+
{
|
|
125
|
+
format: 'svg',
|
|
126
|
+
config: {
|
|
127
|
+
colors: {
|
|
128
|
+
brand: '#222222',
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
const svgString = svg.toString();
|
|
135
|
+
assert(svgContainsColor(svgString, '#222222'), 'SVG should contain overridden brand color');
|
|
136
|
+
assert(!svgContainsColor(svgString, '#111111'), 'SVG should NOT contain original template brand color');
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
// Test 4: PNG format with config
|
|
140
|
+
await test('PNG format with config', async () => {
|
|
141
|
+
const template = defineTemplate({
|
|
142
|
+
name: 'test-png',
|
|
143
|
+
size: { width: 200, height: 200 },
|
|
144
|
+
render: ({ tw }) =>
|
|
145
|
+
h('div', { style: tw('flex items-center justify-center w-full h-full bg-primary') },
|
|
146
|
+
h('h1', { style: tw('text-2xl font-bold text-white') }, 'PNG')
|
|
147
|
+
),
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
const png = await renderImage(
|
|
151
|
+
template,
|
|
152
|
+
{},
|
|
153
|
+
{
|
|
154
|
+
format: 'png',
|
|
155
|
+
config: {
|
|
156
|
+
colors: {
|
|
157
|
+
primary: '#ff00ff',
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
assert(Buffer.isBuffer(png), 'PNG should be a Buffer');
|
|
164
|
+
assert(png.length > 0, 'PNG buffer should not be empty');
|
|
165
|
+
// PNG signature check
|
|
166
|
+
assert(png[0] === 0x89 && png[1] === 0x50 && png[2] === 0x4e && png[3] === 0x47, 'Should be valid PNG');
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
// Test 5: Video with config
|
|
170
|
+
await test('Video with config', async () => {
|
|
171
|
+
const template = defineTemplate({
|
|
172
|
+
name: 'test-video',
|
|
173
|
+
type: 'video',
|
|
174
|
+
size: { width: 400, height: 400 },
|
|
175
|
+
video: { fps: 30, duration: 0.5 },
|
|
176
|
+
config: {
|
|
177
|
+
colors: {
|
|
178
|
+
primary: '#ff6600',
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
render: ({ tw, progress }) => {
|
|
182
|
+
const opacity = progress;
|
|
183
|
+
return h('div', { style: tw('flex items-center justify-center w-full h-full bg-white') },
|
|
184
|
+
h('h1', { style: { ...tw('text-4xl font-bold text-primary'), opacity } }, 'Video')
|
|
185
|
+
);
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
const mp4 = await renderVideo(template, {});
|
|
190
|
+
|
|
191
|
+
assert(Buffer.isBuffer(mp4), 'MP4 should be a Buffer');
|
|
192
|
+
assert(mp4.length > 0, 'MP4 buffer should not be empty');
|
|
193
|
+
// MP4 signature check (ftyp)
|
|
194
|
+
const signature = mp4.toString('ascii', 4, 8);
|
|
195
|
+
assert(signature === 'ftyp', 'Should be valid MP4');
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
// Test 6: Video with config override
|
|
199
|
+
await test('Video with config override', async () => {
|
|
200
|
+
const template = defineTemplate({
|
|
201
|
+
name: 'test-video-override',
|
|
202
|
+
type: 'video',
|
|
203
|
+
size: { width: 400, height: 400 },
|
|
204
|
+
video: { fps: 30, duration: 0.5 },
|
|
205
|
+
config: {
|
|
206
|
+
colors: {
|
|
207
|
+
brand: '#333333',
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
render: ({ tw, progress }) =>
|
|
211
|
+
h('div', { style: tw('flex items-center justify-center w-full h-full bg-brand') },
|
|
212
|
+
h('h1', { style: { ...tw('text-4xl font-bold'), opacity: progress } }, 'Video')
|
|
213
|
+
),
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
const mp4 = await renderVideo(template, {}, {
|
|
217
|
+
config: {
|
|
218
|
+
colors: {
|
|
219
|
+
brand: '#444444',
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
assert(Buffer.isBuffer(mp4), 'MP4 should be a Buffer');
|
|
225
|
+
assert(mp4.length > 0, 'MP4 buffer should not be empty');
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
// Test 7: Multiple custom colors
|
|
229
|
+
await test('Multiple custom colors', async () => {
|
|
230
|
+
const config = {
|
|
231
|
+
colors: {
|
|
232
|
+
brand: '#8b5cf6',
|
|
233
|
+
'brand-light': '#a78bfa',
|
|
234
|
+
'brand-dark': '#7c3aed',
|
|
235
|
+
accent: '#f59e0b',
|
|
236
|
+
success: '#10b981',
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
const template = defineTemplate({
|
|
241
|
+
name: 'test-multi-colors',
|
|
242
|
+
size: { width: 600, height: 400 },
|
|
243
|
+
config,
|
|
244
|
+
render: ({ tw }) =>
|
|
245
|
+
h('div', { style: tw('flex flex-col items-center justify-center w-full h-full bg-brand-light p-8') },
|
|
246
|
+
h('h1', { style: tw('text-4xl font-bold text-brand') }, 'Brand'),
|
|
247
|
+
h('p', { style: tw('text-2xl text-brand-dark') }, 'Brand Dark'),
|
|
248
|
+
h('p', { style: tw('text-xl text-accent') }, 'Accent'),
|
|
249
|
+
h('p', { style: tw('text-lg text-success') }, 'Success')
|
|
250
|
+
),
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
const svg = await renderImage(template, {}, { format: 'svg' });
|
|
254
|
+
const svgString = svg.toString();
|
|
255
|
+
|
|
256
|
+
assert(svgContainsColor(svgString, '#8b5cf6'), 'SVG should contain brand color');
|
|
257
|
+
assert(svgContainsColor(svgString, '#a78bfa'), 'SVG should contain brand-light color');
|
|
258
|
+
assert(svgContainsColor(svgString, '#7c3aed'), 'SVG should contain brand-dark color');
|
|
259
|
+
assert(svgContainsColor(svgString, '#f59e0b'), 'SVG should contain accent color');
|
|
260
|
+
assert(svgContainsColor(svgString, '#10b981'), 'SVG should contain success color');
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
// Test 8: Fonts in config
|
|
264
|
+
await test('Fonts in config', async () => {
|
|
265
|
+
const config = {
|
|
266
|
+
colors: {
|
|
267
|
+
text: '#000000',
|
|
268
|
+
},
|
|
269
|
+
fonts: {
|
|
270
|
+
sans: ['Inter', 'system-ui', 'sans-serif'],
|
|
271
|
+
mono: ['JetBrains Mono', 'monospace'],
|
|
272
|
+
},
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
const template = defineTemplate({
|
|
276
|
+
name: 'test-fonts',
|
|
277
|
+
size: { width: 400, height: 400 },
|
|
278
|
+
config,
|
|
279
|
+
render: ({ tw }) =>
|
|
280
|
+
h('div', { style: tw('flex flex-col items-center justify-center w-full h-full bg-white') },
|
|
281
|
+
h('h1', { style: tw('font-sans text-4xl text-text') }, 'Sans Font'),
|
|
282
|
+
h('p', { style: tw('font-mono text-xl text-text') }, 'Mono Font')
|
|
283
|
+
),
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
const svg = await renderImage(template, {}, { format: 'svg' });
|
|
287
|
+
const svgString = svg.toString();
|
|
288
|
+
|
|
289
|
+
assert(svg.length > 0, 'SVG should be generated with fonts');
|
|
290
|
+
// Fonts are embedded in the SVG rendering, no need to check for specific strings
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
// Test 9: Empty config (should work with defaults)
|
|
294
|
+
await test('Empty config - should work with defaults', async () => {
|
|
295
|
+
const template = defineTemplate({
|
|
296
|
+
name: 'test-no-config',
|
|
297
|
+
size: { width: 400, height: 400 },
|
|
298
|
+
render: ({ tw }) =>
|
|
299
|
+
h('div', { style: tw('flex items-center justify-center w-full h-full bg-white') },
|
|
300
|
+
h('h1', { style: tw('text-4xl font-bold text-black') }, 'No Config')
|
|
301
|
+
),
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
const svg = await renderImage(template, {}, { format: 'svg' });
|
|
305
|
+
assert(svg.length > 0, 'SVG should be generated without config');
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
// Test 10: Partial config merge
|
|
309
|
+
await test('Partial config merge', async () => {
|
|
310
|
+
const template = defineTemplate({
|
|
311
|
+
name: 'test-partial-merge',
|
|
312
|
+
size: { width: 400, height: 400 },
|
|
313
|
+
config: {
|
|
314
|
+
colors: {
|
|
315
|
+
primary: '#111111',
|
|
316
|
+
secondary: '#222222',
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
render: ({ tw }) =>
|
|
320
|
+
h('div', { style: tw('flex items-center justify-center w-full h-full bg-secondary') },
|
|
321
|
+
h('h1', { style: tw('text-4xl font-bold text-primary') }, 'Merge')
|
|
322
|
+
),
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
const svg = await renderImage(
|
|
326
|
+
template,
|
|
327
|
+
{},
|
|
328
|
+
{
|
|
329
|
+
format: 'svg',
|
|
330
|
+
config: {
|
|
331
|
+
colors: {
|
|
332
|
+
primary: '#999999', // Override only primary
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
}
|
|
336
|
+
);
|
|
337
|
+
|
|
338
|
+
const svgString = svg.toString();
|
|
339
|
+
assert(svgContainsColor(svgString, '#999999'), 'SVG should contain overridden primary color');
|
|
340
|
+
assert(svgContainsColor(svgString, '#222222'), 'SVG should retain original secondary color');
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
// Test 11: Font files from URLs
|
|
344
|
+
await test('Font files from URLs', async () => {
|
|
345
|
+
const config = {
|
|
346
|
+
colors: {
|
|
347
|
+
text: '#000000',
|
|
348
|
+
},
|
|
349
|
+
fonts: {
|
|
350
|
+
sans: {
|
|
351
|
+
family: ['Inter', 'sans-serif'],
|
|
352
|
+
files: [
|
|
353
|
+
{
|
|
354
|
+
path: 'https://unpkg.com/@fontsource/inter@5.0.18/files/inter-latin-400-normal.woff',
|
|
355
|
+
weight: 400,
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
path: 'https://unpkg.com/@fontsource/inter@5.0.18/files/inter-latin-700-normal.woff',
|
|
359
|
+
weight: 700,
|
|
360
|
+
},
|
|
361
|
+
],
|
|
362
|
+
},
|
|
363
|
+
},
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
const template = defineTemplate({
|
|
367
|
+
name: 'test-font-files',
|
|
368
|
+
size: { width: 600, height: 400 },
|
|
369
|
+
config,
|
|
370
|
+
render: ({ tw }) =>
|
|
371
|
+
h('div', { style: tw('flex flex-col items-center justify-center w-full h-full bg-white p-8') },
|
|
372
|
+
h('h1', { style: tw('font-sans text-6xl font-bold text-text') }, 'Bold Text'),
|
|
373
|
+
h('p', { style: tw('font-sans text-3xl font-normal text-text') }, 'Normal Text')
|
|
374
|
+
),
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
const svg = await renderImage(template, {}, { format: 'svg' });
|
|
378
|
+
assert(svg.length > 0, 'SVG should be generated with font files from URLs');
|
|
379
|
+
|
|
380
|
+
const png = await renderImage(template, {}, { format: 'png' });
|
|
381
|
+
assert(Buffer.isBuffer(png), 'PNG should be a Buffer');
|
|
382
|
+
assert(png.length > 0, 'PNG buffer should not be empty');
|
|
383
|
+
assert(png[0] === 0x89 && png[1] === 0x50 && png[2] === 0x4e && png[3] === 0x47, 'Should be valid PNG with custom fonts');
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
// Summary
|
|
387
|
+
console.log('\n' + '='.repeat(50));
|
|
388
|
+
console.log(`✅ Tests passed: ${testsPassed}`);
|
|
389
|
+
console.log(`❌ Tests failed: ${testsFailed}`);
|
|
390
|
+
console.log('='.repeat(50));
|
|
391
|
+
|
|
392
|
+
if (testsFailed > 0) {
|
|
393
|
+
process.exit(1);
|
|
394
|
+
} else {
|
|
395
|
+
console.log('\n🎉 All tests passed!');
|
|
396
|
+
process.exit(0);
|
|
397
|
+
}
|