nuxt-og-image 3.0.0-rc.6 → 3.0.0-rc.61
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/README.md +6 -19
- package/dist/client/200.html +265 -15
- package/dist/client/404.html +265 -15
- package/dist/client/_nuxt/-7WWnkdy.js +517 -0
- package/dist/client/_nuxt/0ooBkv16.js +1 -0
- package/dist/client/_nuxt/1Je9_Reo.js +136 -0
- package/dist/client/_nuxt/1rqFXsGc.js +666 -0
- package/dist/client/_nuxt/37ic6j3l.js +1 -0
- package/dist/client/_nuxt/3ghuYFLd.js +1 -0
- package/dist/client/_nuxt/6Kuza3Wr.js +1 -0
- package/dist/client/_nuxt/6XBPEST2.js +1 -0
- package/dist/client/_nuxt/8t4jSAMm.js +1 -0
- package/dist/client/_nuxt/9B1nZgL-.js +1 -0
- package/dist/client/_nuxt/9ZOzOPqN.js +1 -0
- package/dist/client/_nuxt/AgnqFTPX.js +13 -0
- package/dist/client/_nuxt/B1nm99XP.js +2 -0
- package/dist/client/_nuxt/B2DkETJQ.js +1 -0
- package/dist/client/_nuxt/B3g-KkBK.js +1 -0
- package/dist/client/_nuxt/B4yE-MfL.js +38 -0
- package/dist/client/_nuxt/B6E6ObS_.js +8 -0
- package/dist/client/_nuxt/B6bHXiXE.js +25 -0
- package/dist/client/_nuxt/B7rNE5kf.js +1 -0
- package/dist/client/_nuxt/B9CT-1u6.js +7 -0
- package/dist/client/_nuxt/B9S9BZZh.js +1 -0
- package/dist/client/_nuxt/BB42E8aY.js +186 -0
- package/dist/client/_nuxt/BBBqETUW.js +1 -0
- package/dist/client/_nuxt/BBDuFDsq.js +1 -0
- package/dist/client/_nuxt/BBJYjQ0k.js +1 -0
- package/dist/client/_nuxt/BEjL32p1.js +5754 -0
- package/dist/client/_nuxt/BF6G6X0H.js +1 -0
- package/dist/client/_nuxt/BH1M7C1g.js +1 -0
- package/dist/client/_nuxt/BH_RS3WO.js +1 -0
- package/dist/client/_nuxt/BICIrM8O.js +1 -0
- package/dist/client/_nuxt/BITGhEdf.js +1 -0
- package/dist/client/_nuxt/BIl_88gt.js +1 -0
- package/dist/client/_nuxt/BIxS-Weu.js +1 -0
- package/dist/client/_nuxt/BLluXI4E.js +1 -0
- package/dist/client/_nuxt/BMHPAh1U.js +2 -0
- package/dist/client/_nuxt/BN4LRXf6.js +4 -0
- package/dist/client/_nuxt/BOpLLL-w.js +1 -0
- package/dist/client/_nuxt/BPiaQZfK.js +1 -0
- package/dist/client/_nuxt/BR6CMsBL.js +1 -0
- package/dist/client/_nuxt/BSB_bK09.js +1 -0
- package/dist/client/_nuxt/BT9ZzGyQ.js +69 -0
- package/dist/client/_nuxt/BTtaZsq5.js +1 -0
- package/dist/client/_nuxt/BUpeXbsf.js +25 -0
- package/dist/client/_nuxt/BVGdgKAv.js +1 -0
- package/dist/client/_nuxt/BVLuctcA.js +1 -0
- package/dist/client/_nuxt/BVkeqZ59.js +1 -0
- package/dist/client/_nuxt/BWKJ1FCf.js +239 -0
- package/dist/client/_nuxt/BXF7Vm5l.js +1 -0
- package/dist/client/_nuxt/BXR915QZ.js +32 -0
- package/dist/client/_nuxt/BXTKWaEE.js +1 -0
- package/dist/client/_nuxt/BXfENWL6.js +1 -0
- package/dist/client/_nuxt/BYdKNJ10.js +1 -0
- package/dist/client/_nuxt/BZfs-ost.js +1 -0
- package/dist/client/_nuxt/BZz1Hhek.js +1 -0
- package/dist/client/_nuxt/B_SUYfiV.js +1 -0
- package/dist/client/_nuxt/BaNxgKSR.js +17 -0
- package/dist/client/_nuxt/BaWyeHV_.js +1 -0
- package/dist/client/_nuxt/BacI6-DX.js +40 -0
- package/dist/client/_nuxt/BaedD2tq.js +1 -0
- package/dist/client/_nuxt/BbJj1K1w.js +1 -0
- package/dist/client/_nuxt/Bbv8ARUV.js +13 -0
- package/dist/client/_nuxt/Bdt_eLrj.js +756 -0
- package/dist/client/_nuxt/BeJnKnI_.js +544 -0
- package/dist/client/_nuxt/BeX7Iu5M.js +90 -0
- package/dist/client/_nuxt/BeocmOPF.js +1 -0
- package/dist/client/_nuxt/Bg0wAK5a.js +100 -0
- package/dist/client/_nuxt/Bgpqy2XC.js +1 -0
- package/dist/client/_nuxt/Bh8mriwU.js +17 -0
- package/dist/client/_nuxt/Bi43K_FX.js +6 -0
- package/dist/client/_nuxt/BiDE021q.js +1 -0
- package/dist/client/_nuxt/BigF1UXR.js +1 -0
- package/dist/client/_nuxt/Bj0fF4lQ.js +1 -0
- package/dist/client/_nuxt/Bj5xdiaE.js +1 -0
- package/dist/client/_nuxt/BlxWTfDV.js +699 -0
- package/dist/client/_nuxt/BmCW-tYz.js +86 -0
- package/dist/client/_nuxt/Bn5gmY5k.js +1 -0
- package/dist/client/_nuxt/BnyYJeap.js +129 -0
- package/dist/client/_nuxt/Br6ll-O0.js +1 -0
- package/dist/client/_nuxt/BscxmKrE.js +8 -0
- package/dist/client/_nuxt/BsvsQ1iS.js +1 -0
- package/dist/client/_nuxt/Btshr8M_.js +70 -0
- package/dist/client/_nuxt/BvCdDh2R.js +1 -0
- package/dist/client/_nuxt/BwXNTs7T.js +1 -0
- package/dist/client/_nuxt/Bxkoe-BC.js +1 -0
- package/dist/client/_nuxt/BxwAa5i0.js +1 -0
- package/dist/client/_nuxt/ByMv4Xf1.js +1 -0
- package/dist/client/_nuxt/C15OxdQ5.js +1 -0
- package/dist/client/_nuxt/C1DVX8_8.js +831 -0
- package/dist/client/_nuxt/C1yTBzia.js +1 -0
- package/dist/client/_nuxt/C2TBxDwV.js +1 -0
- package/dist/client/_nuxt/C3qJFuQy.js +3 -0
- package/dist/client/_nuxt/C3qUB5O8.js +301 -0
- package/dist/client/_nuxt/C6Aznpr-.js +1 -0
- package/dist/client/_nuxt/C6XIsc4F.js +1 -0
- package/dist/client/_nuxt/C7oZ9nno.js +1 -0
- package/dist/client/_nuxt/C86elO-m.js +1 -0
- package/dist/client/_nuxt/C9d3aiqh.js +1 -0
- package/dist/client/_nuxt/CA9nliXM.js +1 -0
- package/dist/client/_nuxt/CApMHEaB.js +1 -0
- package/dist/client/_nuxt/CBPJd_fO.js +1 -0
- package/dist/client/_nuxt/CBWrHyXe.js +580 -0
- package/dist/client/_nuxt/CCqFro8U.js +3 -0
- package/dist/client/_nuxt/CEfge3mM.js +1 -0
- package/dist/client/_nuxt/CFF2d1j6.js +1 -0
- package/dist/client/_nuxt/CG4fK2Nq.js +21 -0
- package/dist/client/_nuxt/CGmujMTu.js +1 -0
- package/dist/client/_nuxt/CJGKC1_q.js +40 -0
- package/dist/client/_nuxt/CJIaz0BQ.js +76 -0
- package/dist/client/_nuxt/CJQrLysU.js +1 -0
- package/dist/client/_nuxt/CMDmr8et.js +2 -0
- package/dist/client/_nuxt/CO5hpdkB.js +1 -0
- package/dist/client/_nuxt/CO7HdiM_.js +1 -0
- package/dist/client/_nuxt/CQUCfALx.js +13 -0
- package/dist/client/_nuxt/CRDKj6ck.js +1 -0
- package/dist/client/_nuxt/CRlnGVMD.js +1 -0
- package/dist/client/_nuxt/CSPeAESR.js +1 -0
- package/dist/client/_nuxt/CThH5sBG.js +1 -0
- package/dist/client/_nuxt/CX_FIdg1.js +1 -0
- package/dist/client/_nuxt/CZZ6oYdA.js +1 -0
- package/dist/client/_nuxt/C_8Fx7bH.js +1 -0
- package/dist/client/_nuxt/C_ZPRiAj.js +26 -0
- package/dist/client/_nuxt/CarfVElc.js +80 -0
- package/dist/client/_nuxt/Cb-F_BZP.js +1 -0
- package/dist/client/_nuxt/CbViG2Xw.js +74 -0
- package/dist/client/_nuxt/CbYhyuC0.js +505 -0
- package/dist/client/_nuxt/Cda-MJFk.js +1 -0
- package/dist/client/_nuxt/CdedUr_-.js +1 -0
- package/dist/client/_nuxt/CfPQhs6g.js +7 -0
- package/dist/client/_nuxt/Cgl53LJQ.js +1 -0
- package/dist/client/_nuxt/CgwOUXSn.js +1 -0
- package/dist/client/_nuxt/ChH25C4w.js +1 -0
- package/dist/client/_nuxt/ChMCFiS0.js +1 -0
- package/dist/client/_nuxt/CiRxTSAc.js +1 -0
- package/dist/client/_nuxt/Cicx_DS6.js +1 -0
- package/dist/client/_nuxt/ClXEvkw9.js +68 -0
- package/dist/client/_nuxt/CowR2XfX.js +1 -0
- package/dist/client/_nuxt/Cp2HGa90.js +353 -0
- package/dist/client/_nuxt/CpAANOdC.js +1 -0
- package/dist/client/_nuxt/CqYeW6XZ.js +1 -0
- package/dist/client/_nuxt/CrgTADc5.js +1 -0
- package/dist/client/_nuxt/CrhH3_Og.js +1 -0
- package/dist/client/_nuxt/CsTmP73Z.js +1 -0
- package/dist/client/_nuxt/CsYA0RN7.js +1 -0
- package/dist/client/_nuxt/CsyjKwr8.js +1 -0
- package/dist/client/_nuxt/CsyrCbsw.js +699 -0
- package/dist/client/_nuxt/Cthz8VOO.js +771 -0
- package/dist/client/_nuxt/CuJfdYLG.js +1 -0
- package/dist/client/_nuxt/CupVZNk8.js +25 -0
- package/dist/client/_nuxt/CxrokwfH.js +1 -0
- package/dist/client/_nuxt/CzPA46E-.js +1 -0
- package/dist/client/_nuxt/D33OKbkv.js +1 -0
- package/dist/client/_nuxt/D384ylkT.js +1 -0
- package/dist/client/_nuxt/D3VXSfF0.js +1 -0
- package/dist/client/_nuxt/D4LaosRr.js +1 -0
- package/dist/client/_nuxt/D6pmzCqS.js +1 -0
- package/dist/client/_nuxt/D71BffLY.js +1 -0
- package/dist/client/_nuxt/D7WeZTai.js +1 -0
- package/dist/client/_nuxt/DAGYewaG.js +559 -0
- package/dist/client/_nuxt/DAP_O-zg.js +1 -0
- package/dist/client/_nuxt/DAVo6uMX.js +1 -0
- package/dist/client/_nuxt/DAfrLhwG.js +1 -0
- package/dist/client/_nuxt/DBeuZS66.js +1 -0
- package/dist/client/_nuxt/DBxHOdLe.js +1 -0
- package/dist/client/_nuxt/DC4hdoM9.js +87 -0
- package/dist/client/_nuxt/DC8MraHL.js +666 -0
- package/dist/client/_nuxt/DGDuLtS6.js +8 -0
- package/dist/client/_nuxt/DGEpfOTx.js +1 -0
- package/dist/client/_nuxt/DGO8GyiP.js +1 -0
- package/dist/client/_nuxt/DGxQkqYo.js +1 -0
- package/dist/client/_nuxt/DHmGyzbM.js +109 -0
- package/dist/client/_nuxt/DJZWsvj0.js +1 -0
- package/dist/client/_nuxt/DJubGRtk.js +1 -0
- package/dist/client/_nuxt/DK4oFTHQ.js +200 -0
- package/dist/client/_nuxt/DKb4lQY2.js +1 -0
- package/dist/client/_nuxt/DLP9ZvWb.js +3 -0
- package/dist/client/_nuxt/DM4HHECw.js +1 -0
- package/dist/client/_nuxt/DNR26wTC.js +1 -0
- package/dist/client/_nuxt/DOHBU7tp.js +1 -0
- package/dist/client/_nuxt/DOqtC9FP.js +1 -0
- package/dist/client/_nuxt/DOtRmeXT.js +1 -0
- package/dist/client/_nuxt/DR5YgmI2.js +1 -0
- package/dist/client/_nuxt/DS9ZWoKD.js +1 -0
- package/dist/client/_nuxt/DSrLtGYv.js +15 -0
- package/dist/client/_nuxt/DSsji4Hu.js +1 -0
- package/dist/client/_nuxt/DV9JwLIa.js +1 -0
- package/dist/client/_nuxt/DVC_qXWv.js +1 -0
- package/dist/client/_nuxt/DVLwECkk.js +1 -0
- package/dist/client/_nuxt/DVfdqzEq.js +1 -0
- package/dist/client/_nuxt/DXFkqnOI.js +816 -0
- package/dist/client/_nuxt/DXT9h7v2.js +1 -0
- package/dist/client/_nuxt/DXZpi2gR.js +1 -0
- package/dist/client/_nuxt/DY7_9Ga-.js +1 -0
- package/dist/client/_nuxt/DYI1rfmx.js +25 -0
- package/dist/client/_nuxt/DZLoTQm4.js +1 -0
- package/dist/client/_nuxt/DZqG9GXz.js +50 -0
- package/dist/client/_nuxt/DbK06e1c.js +21 -0
- package/dist/client/_nuxt/Dble9ECP.js +1 -0
- package/dist/client/_nuxt/Dch3xQiY.js +699 -0
- package/dist/client/_nuxt/Dd6f7Z5P.js +1 -0
- package/dist/client/_nuxt/DdacRhvC.js +1 -0
- package/dist/client/_nuxt/DeVv6D4_.js +1 -0
- package/dist/client/_nuxt/DfeQjIbs.js +5 -0
- package/dist/client/_nuxt/Dg0DGYq4.js +14 -0
- package/dist/client/_nuxt/DhFF74a2.js +1 -0
- package/dist/client/_nuxt/Dit6kIrv.js +11 -0
- package/dist/client/_nuxt/DjTlIhuc.js +1 -0
- package/dist/client/_nuxt/DmDrTTlz.js +1 -0
- package/dist/client/_nuxt/DnLUQrgA.js +1 -0
- package/dist/client/_nuxt/DouzTJIq.js +1 -0
- package/dist/client/_nuxt/DrnZp123.js +40 -0
- package/dist/client/_nuxt/DsfXcHUZ.js +29 -0
- package/dist/client/_nuxt/Du6_OKDb.js +159 -0
- package/dist/client/_nuxt/DvyTQcux.js +1 -0
- package/dist/client/_nuxt/Dwo2i-71.js +1 -0
- package/dist/client/_nuxt/DwuVtWc2.js +518 -0
- package/dist/client/_nuxt/DzwdaLuO.js +223 -0
- package/dist/client/_nuxt/ECt0lbkd.js +16 -0
- package/dist/client/_nuxt/Eh5U-gDp.js +52 -0
- package/dist/client/_nuxt/FJDVp-XM.js +1 -0
- package/dist/client/_nuxt/HrnDn_2Q.js +1 -0
- package/dist/client/_nuxt/I4qd5QHW.js +10 -0
- package/dist/client/_nuxt/JgH_6NEN.js +1 -0
- package/dist/client/_nuxt/KEYLhlmT.js +1 -0
- package/dist/client/_nuxt/KPqz0Sb3.js +1 -0
- package/dist/client/_nuxt/Ksn5IXup.js +1 -0
- package/dist/client/_nuxt/MS3qTAOR.js +1 -0
- package/dist/client/_nuxt/PWN5J14X.js +1 -0
- package/dist/client/_nuxt/PifQWv0n.js +1 -0
- package/dist/client/_nuxt/QZ3jNtnE.js +515 -0
- package/dist/client/_nuxt/RCJZWN-0.js +81 -0
- package/dist/client/_nuxt/RE3ujT-k.js +1 -0
- package/dist/client/_nuxt/RqY_Nz63.js +1 -0
- package/dist/client/_nuxt/Sfo2eW0G.js +274 -0
- package/dist/client/_nuxt/T9ysyp6P.js +62 -0
- package/dist/client/_nuxt/UREJT2Bw.js +1 -0
- package/dist/client/_nuxt/Urb1RsFe.js +1 -0
- package/dist/client/_nuxt/VQMr7AbF.js +1 -0
- package/dist/client/_nuxt/YxQm0tCS.js +1 -0
- package/dist/client/_nuxt/alpzPJ78.js +1 -0
- package/dist/client/_nuxt/beD-FUib.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/3674f358-df54-4f45-ae67-3d676c88ba31.json +1 -0
- package/dist/client/_nuxt/cW9vKj3g.js +1 -0
- package/dist/client/_nuxt/cw46T5ID.js +61 -0
- package/dist/client/_nuxt/dIHJ9UdL.js +1 -0
- package/dist/client/_nuxt/eJfcURhx.js +1 -0
- package/dist/client/_nuxt/entry.BCfFhbeW.css +1 -0
- package/dist/client/_nuxt/error-404.B3wjZPBT.css +1 -0
- package/dist/client/_nuxt/error-500.Dxoa4Ooo.css +1 -0
- package/dist/client/_nuxt/hXH8Gyq8.js +1 -0
- package/dist/client/_nuxt/i0IPvypD.js +1 -0
- package/dist/client/_nuxt/iSbrOpM4.js +1 -0
- package/dist/client/_nuxt/jaXbsbtS.js +1 -0
- package/dist/client/_nuxt/kuh6G-Sk.js +9 -0
- package/dist/client/_nuxt/nclm9rTJ.js +266 -0
- package/dist/client/_nuxt/qxoleWdb.js +1 -0
- package/dist/client/_nuxt/rS0jd3Ly.js +1 -0
- package/dist/client/_nuxt/rltxq8r8.js +131 -0
- package/dist/client/_nuxt/sMI-pExk.js +1 -0
- package/dist/client/_nuxt/sQpxpyUs.js +1 -0
- package/dist/client/_nuxt/vMsNTMhM.js +5 -0
- package/dist/client/_nuxt/wChcbJ1V.js +37 -0
- package/dist/client/_nuxt/xPNGhBYe.js +1 -0
- package/dist/client/_nuxt/yX2IItqj.js +1 -0
- package/dist/client/index.html +265 -15
- package/dist/module.d.mts +9 -106
- package/dist/module.d.ts +9 -106
- package/dist/module.json +6 -2
- package/dist/module.mjs +225 -136
- package/dist/runtime/assets/Inter-400.ttf.base64 +1 -0
- package/dist/runtime/assets/Inter-700.ttf.base64 +1 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/chrome-launcher.js +9 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/on-demand.d.ts +2 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/on-demand.js +35 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/playwright.d.ts +2 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/playwright.js +6 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/node.d.ts +7 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/node.js +7 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/wasm-fs.d.ts +8 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/wasm-fs.js +8 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/wasm.d.ts +8 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/wasm.js +7 -0
- package/dist/runtime/{core → nitro/og-image}/bindings/resvg/wasm-fs.d.ts +1 -1
- package/dist/runtime/{core/bindings/resvg/wasm-fs.mjs → nitro/og-image/bindings/resvg/wasm-fs.js} +1 -1
- package/dist/runtime/{core → nitro/og-image}/bindings/resvg/wasm.d.ts +1 -1
- package/dist/runtime/nitro/og-image/bindings/resvg/wasm.js +5 -0
- package/dist/runtime/{core/bindings/satori/wasm-fs.mjs → nitro/og-image/bindings/satori/wasm-fs.js} +1 -1
- package/dist/runtime/{core/bindings/satori/wasm.mjs → nitro/og-image/bindings/satori/wasm.js} +1 -2
- package/dist/runtime/nitro/og-image/cache.d.ts +7 -0
- package/dist/runtime/{core/cache/htmlPayload.mjs → nitro/og-image/cache.js} +4 -1
- package/dist/runtime/{core/renderers/chromium/index.d.ts → nitro/og-image/chromium/renderer.d.ts} +1 -1
- package/dist/runtime/{core/renderers/chromium/index.mjs → nitro/og-image/chromium/renderer.js} +1 -1
- package/dist/runtime/{core/renderers → nitro/og-image}/chromium/screenshot.d.ts +1 -2
- package/dist/runtime/{core/renderers/chromium/screenshot.mjs → nitro/og-image/chromium/screenshot.js} +1 -1
- package/dist/runtime/nitro/og-image/context.d.ts +5 -0
- package/dist/runtime/nitro/og-image/context.js +181 -0
- package/dist/runtime/nitro/og-image/instances.d.ts +2 -0
- package/dist/runtime/nitro/og-image/instances.js +10 -0
- package/dist/runtime/nitro/og-image/satori/font.d.ts +2 -0
- package/dist/runtime/nitro/og-image/satori/font.js +39 -0
- package/dist/runtime/{core/renderers → nitro/og-image}/satori/instances.d.ts +5 -5
- package/dist/runtime/{core/renderers/satori/instances.mjs → nitro/og-image/satori/instances.js} +2 -11
- package/dist/runtime/nitro/og-image/satori/plugins/classes.js +17 -0
- package/dist/runtime/{core/renderers/satori/plugins/emojis.mjs → nitro/og-image/satori/plugins/emojis.js} +2 -2
- package/dist/runtime/nitro/og-image/satori/plugins/encoding.js +17 -0
- package/dist/runtime/{core/renderers/satori/plugins/flex.mjs → nitro/og-image/satori/plugins/flex.js} +2 -2
- package/dist/runtime/nitro/og-image/satori/plugins/imageSrc.js +85 -0
- package/dist/runtime/{core/renderers/satori/plugins/unocss.mjs → nitro/og-image/satori/plugins/unocss.js} +1 -1
- package/dist/runtime/{core/renderers/satori/index.d.ts → nitro/og-image/satori/renderer.d.ts} +1 -1
- package/dist/runtime/{core/renderers/satori/index.mjs → nitro/og-image/satori/renderer.js} +30 -17
- package/dist/runtime/nitro/og-image/satori/transforms/emojis.d.ts +5 -0
- package/dist/runtime/nitro/og-image/satori/transforms/emojis.js +3597 -0
- package/dist/runtime/nitro/og-image/satori/transforms/inlineCss.d.ts +3 -0
- package/dist/runtime/nitro/og-image/satori/transforms/inlineCss.js +42 -0
- package/dist/runtime/{core/renderers → nitro/og-image}/satori/utils.d.ts +2 -2
- package/dist/runtime/{core/renderers/satori/utils.mjs → nitro/og-image/satori/utils.js} +9 -5
- package/dist/runtime/{core/renderers → nitro/og-image}/satori/vnodes.d.ts +1 -1
- package/dist/runtime/nitro/og-image/satori/vnodes.js +38 -0
- package/dist/runtime/nitro/og-image/templates/html.d.ts +2 -0
- package/dist/runtime/{core/html/devIframeTemplate.mjs → nitro/og-image/templates/html.js} +17 -9
- package/dist/runtime/nitro/plugins/nuxt-content.d.ts +1 -1
- package/dist/runtime/nitro/plugins/{nuxt-content.mjs → nuxt-content.js} +7 -4
- package/dist/runtime/nitro/plugins/prerender.js +28 -0
- package/dist/runtime/{server/routes/__og-image__ → nitro/routes}/debug.json.d.ts +1 -1
- package/dist/runtime/{server/routes/__og-image__/debug.json.mjs → nitro/routes/debug.json.js} +1 -1
- package/dist/runtime/{server/routes/__og-image__/font-[name]-[weight].[extension].mjs → nitro/routes/font.js} +22 -5
- package/dist/runtime/{server/routes/__og-image__/image.mjs → nitro/routes/image.js} +9 -10
- package/dist/runtime/nitro/tsconfig.json +3 -0
- package/dist/runtime/{cache.d.ts → nitro/util/cache.d.ts} +2 -2
- package/dist/runtime/{cache.mjs → nitro/util/cache.js} +2 -1
- package/dist/runtime/nitro/util/encoding.d.ts +3 -0
- package/dist/runtime/nitro/util/encoding.js +15 -0
- package/dist/runtime/nitro/util/kit.d.ts +6 -0
- package/dist/runtime/nitro/util/kit.js +32 -0
- package/dist/runtime/{core/utils → nitro/util}/wasm.d.ts +0 -1
- package/dist/runtime/nuxt/components/OgImage/OgImage.d.ts +5 -0
- package/dist/runtime/nuxt/components/OgImage/OgImageScreenshot.d.ts +5 -0
- package/dist/runtime/nuxt/components/Templates/Community/Frame.vue +64 -0
- package/dist/runtime/{components → nuxt/components}/Templates/Community/Nuxt.vue +6 -5
- package/dist/runtime/{components → nuxt/components}/Templates/Community/NuxtSeo.vue +5 -5
- package/dist/runtime/{components → nuxt/components}/Templates/Community/Pergel.vue +1 -2
- package/dist/runtime/{components → nuxt/components}/Templates/Community/UnJs.vue +2 -2
- package/dist/runtime/{composables → nuxt/composables}/defineOgImage.d.ts +1 -1
- package/dist/runtime/{composables/defineOgImage.mjs → nuxt/composables/defineOgImage.js} +7 -12
- package/dist/runtime/{composables → nuxt/composables}/defineOgImageComponent.d.ts +1 -1
- package/dist/runtime/{composables/defineOgImageComponent.mjs → nuxt/composables/defineOgImageComponent.js} +1 -1
- package/dist/runtime/nuxt/composables/defineOgImageScreenshot.d.ts +2 -0
- package/dist/runtime/nuxt/composables/mock.d.ts +5 -0
- package/dist/runtime/nuxt/composables/mock.js +6 -0
- package/dist/runtime/nuxt/plugins/og-image-canonical-urls.server.d.ts +1 -1
- package/dist/runtime/nuxt/plugins/{og-image-canonical-urls.server.mjs → og-image-canonical-urls.server.js} +16 -6
- package/dist/runtime/nuxt/plugins/route-rule-og-image.server.d.ts +1 -1
- package/dist/runtime/nuxt/plugins/{route-rule-og-image.server.mjs → route-rule-og-image.server.js} +3 -3
- package/dist/runtime/nuxt/utils.d.ts +3 -2
- package/dist/runtime/nuxt/{utils.mjs → utils.js} +4 -3
- package/dist/runtime/{utils.pure.d.ts → pure.d.ts} +2 -1
- package/dist/runtime/{utils.pure.mjs → pure.js} +22 -3
- package/dist/runtime/{utils.d.ts → shared.d.ts} +2 -2
- package/dist/runtime/{utils.mjs → shared.js} +3 -2
- package/dist/runtime/types.d.ts +14 -6
- package/dist/types.d.mts +2 -9
- package/dist/types.d.ts +2 -9
- package/package.json +83 -58
- package/dist/client/_nuxt/IconCSS.220290da.js +0 -1
- package/dist/client/_nuxt/IconCSS.f0b56d3e.css +0 -1
- package/dist/client/_nuxt/builds/meta/e73d18b8-bd07-4a22-971c-e8ba17519e8f.json +0 -1
- package/dist/client/_nuxt/entry.5d0abb3d.js +0 -108
- package/dist/client/_nuxt/entry.a30f63d0.css +0 -1
- package/dist/client/_nuxt/error-404.b751fa02.css +0 -1
- package/dist/client/_nuxt/error-404.e6048d23.js +0 -1
- package/dist/client/_nuxt/error-500.3bcefba1.js +0 -1
- package/dist/client/_nuxt/error-500.69009e70.css +0 -1
- package/dist/client/_nuxt/vanilla-picker-NKbIFE8h.23409a58.js +0 -8
- package/dist/runtime/components/OgImage/OgImage.d.ts +0 -5
- package/dist/runtime/components/OgImage/OgImageScreenshot.d.ts +0 -5
- package/dist/runtime/composables/defineOgImageScreenshot.d.ts +0 -2
- package/dist/runtime/core/bindings/chromium/node.mjs +0 -33
- package/dist/runtime/core/bindings/css-inline/node.d.ts +0 -2
- package/dist/runtime/core/bindings/css-inline/node.mjs +0 -2
- package/dist/runtime/core/bindings/resvg/wasm.mjs +0 -6
- package/dist/runtime/core/cache/emojis.d.ts +0 -1
- package/dist/runtime/core/cache/emojis.mjs +0 -5
- package/dist/runtime/core/cache/fonts.d.ts +0 -3
- package/dist/runtime/core/cache/fonts.mjs +0 -6
- package/dist/runtime/core/cache/htmlPayload.d.ts +0 -5
- package/dist/runtime/core/cache/prerender.d.ts +0 -2
- package/dist/runtime/core/cache/prerender.mjs +0 -5
- package/dist/runtime/core/env/assets.d.ts +0 -1
- package/dist/runtime/core/env/assets.mjs +0 -11
- package/dist/runtime/core/font/fetch.d.ts +0 -2
- package/dist/runtime/core/font/fetch.mjs +0 -36
- package/dist/runtime/core/html/applyEmojis.d.ts +0 -3
- package/dist/runtime/core/html/applyEmojis.mjs +0 -37
- package/dist/runtime/core/html/applyInlineCss.d.ts +0 -3
- package/dist/runtime/core/html/applyInlineCss.mjs +0 -32
- package/dist/runtime/core/html/devIframeTemplate.d.ts +0 -2
- package/dist/runtime/core/html/fetchIsland.d.ts +0 -3
- package/dist/runtime/core/html/fetchIsland.mjs +0 -17
- package/dist/runtime/core/options/extract.d.ts +0 -3
- package/dist/runtime/core/options/extract.mjs +0 -49
- package/dist/runtime/core/options/fetch.d.ts +0 -3
- package/dist/runtime/core/options/fetch.mjs +0 -32
- package/dist/runtime/core/renderers/satori/plugins/encoding.mjs +0 -8
- package/dist/runtime/core/renderers/satori/plugins/imageSrc.mjs +0 -75
- package/dist/runtime/core/renderers/satori/plugins/twClasses.mjs +0 -8
- package/dist/runtime/core/renderers/satori/vnodes.mjs +0 -31
- package/dist/runtime/core/utils/resolveRendererContext.d.ts +0 -3
- package/dist/runtime/core/utils/resolveRendererContext.mjs +0 -97
- package/dist/runtime/nitro/plugins/prerender.mjs +0 -36
- package/dist/runtime/nitro/utils.d.ts +0 -2
- package/dist/runtime/nitro/utils.mjs +0 -16
- package/dist/runtime/server/assets/inter-latin-ext-400-normal.woff +0 -0
- package/dist/runtime/server/assets/inter-latin-ext-700-normal.woff +0 -0
- /package/dist/runtime/{core/bindings/chromium/node.d.ts → nitro/og-image/bindings/chromium/chrome-launcher.d.ts} +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/resvg/node.d.ts +0 -0
- /package/dist/runtime/{core/bindings/resvg/node.mjs → nitro/og-image/bindings/resvg/node.js} +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/satori/node.d.ts +0 -0
- /package/dist/runtime/{core/bindings/satori/node.mjs → nitro/og-image/bindings/satori/node.js} +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/satori/wasm-fs.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/satori/wasm.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/sharp/node.d.ts +0 -0
- /package/dist/runtime/{core/bindings/sharp/node.mjs → nitro/og-image/bindings/sharp/node.js} +0 -0
- /package/dist/runtime/{core/renderers/satori/plugins/emojis.d.ts → nitro/og-image/satori/plugins/classes.d.ts} +0 -0
- /package/dist/runtime/{core/renderers/satori/plugins/encoding.d.ts → nitro/og-image/satori/plugins/emojis.d.ts} +0 -0
- /package/dist/runtime/{core/renderers/satori/plugins/flex.d.ts → nitro/og-image/satori/plugins/encoding.d.ts} +0 -0
- /package/dist/runtime/{core/renderers/satori/plugins/imageSrc.d.ts → nitro/og-image/satori/plugins/flex.d.ts} +0 -0
- /package/dist/runtime/{core/renderers/satori/plugins/twClasses.d.ts → nitro/og-image/satori/plugins/imageSrc.d.ts} +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/plugins/unocss.d.ts +0 -0
- /package/dist/runtime/{server/routes/__og-image__/font-[name]-[weight].[extension].d.ts → nitro/routes/font.d.ts} +0 -0
- /package/dist/runtime/{server/routes/__og-image__ → nitro/routes}/image.d.ts +0 -0
- /package/dist/runtime/{core/utils/wasm.mjs → nitro/util/wasm.js} +0 -0
- /package/dist/runtime/{components/OgImage/OgImage.mjs → nuxt/components/OgImage/OgImage.js} +0 -0
- /package/dist/runtime/{components/OgImage/OgImageScreenshot.mjs → nuxt/components/OgImage/OgImageScreenshot.js} +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/BrandedLogo.vue +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/SimpleBlog.vue +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/Wave.vue +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/WithEmoji.vue +0 -0
- /package/dist/runtime/{composables/defineOgImageScreenshot.mjs → nuxt/composables/defineOgImageScreenshot.js} +0 -0
- /package/dist/runtime/{types.mjs → types.js} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import playwrightCore from "playwright-core";
|
|
2
|
+
import { Launcher } from "chrome-launcher";
|
|
3
|
+
const chromePath = Launcher.getFirstInstallation();
|
|
4
|
+
export async function createBrowser() {
|
|
5
|
+
return playwrightCore.chromium.launch({
|
|
6
|
+
headless: true,
|
|
7
|
+
executablePath: chromePath
|
|
8
|
+
});
|
|
9
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { execa } from "execa";
|
|
2
|
+
import { createConsola } from "consola";
|
|
3
|
+
import playwrightCore from "playwright-core";
|
|
4
|
+
let installedChromium = false;
|
|
5
|
+
let installChromiumPromise;
|
|
6
|
+
export async function createBrowser() {
|
|
7
|
+
if (installChromiumPromise)
|
|
8
|
+
await installChromiumPromise;
|
|
9
|
+
if (!installedChromium) {
|
|
10
|
+
installChromiumPromise = new Promise((_resolve) => {
|
|
11
|
+
const logger = createConsola().withTag("Nuxt OG Image");
|
|
12
|
+
logger.info("Installing Chromium install for og:image generation...");
|
|
13
|
+
const installChromeProcess = execa("npx", ["playwright", "install", "chromium"], {
|
|
14
|
+
stdio: "inherit"
|
|
15
|
+
});
|
|
16
|
+
installChromeProcess.stderr?.pipe(process.stderr);
|
|
17
|
+
new Promise((resolve) => {
|
|
18
|
+
installChromeProcess.on("exit", (e) => {
|
|
19
|
+
if (e !== 0)
|
|
20
|
+
logger.error("Failed to install Playwright dependency for og:image generation. Trying anyway...");
|
|
21
|
+
resolve(true);
|
|
22
|
+
});
|
|
23
|
+
}).then(() => {
|
|
24
|
+
installChromeProcess.kill();
|
|
25
|
+
logger.info("Installed Chromium install for og:image generation.");
|
|
26
|
+
_resolve();
|
|
27
|
+
});
|
|
28
|
+
}).then(() => {
|
|
29
|
+
installedChromium = true;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return await playwrightCore.chromium.launch({
|
|
33
|
+
headless: true
|
|
34
|
+
});
|
|
35
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
initWasmPromise: Promise<void>;
|
|
3
|
-
Resvg: new (svg:
|
|
3
|
+
Resvg: new (svg: Uint8Array | string, options?: import("@resvg/resvg-wasm").ResvgRenderOptions) => {
|
|
4
4
|
free(): void;
|
|
5
5
|
render(): {
|
|
6
6
|
free(): void;
|
package/dist/runtime/{core/bindings/resvg/wasm-fs.mjs → nitro/og-image/bindings/resvg/wasm-fs.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Resvg as _Resvg, initWasm } from "@resvg/resvg-wasm";
|
|
2
|
-
import { readWasmFile } from "
|
|
2
|
+
import { readWasmFile } from "../../../util/wasm.js";
|
|
3
3
|
export default {
|
|
4
4
|
initWasmPromise: initWasm(readWasmFile("@resvg/resvg-wasm/index_bg.wasm")),
|
|
5
5
|
Resvg: _Resvg
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
initWasmPromise: Promise<void>;
|
|
3
|
-
Resvg: new (svg:
|
|
3
|
+
Resvg: new (svg: Uint8Array | string, options?: import("@resvg/resvg-wasm").ResvgRenderOptions) => {
|
|
4
4
|
free(): void;
|
|
5
5
|
render(): {
|
|
6
6
|
free(): void;
|
package/dist/runtime/{core/bindings/satori/wasm-fs.mjs → nitro/og-image/bindings/satori/wasm-fs.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _satori, { init } from "satori/wasm";
|
|
2
2
|
import initYoga from "yoga-wasm-web";
|
|
3
|
-
import { readWasmFile } from "
|
|
3
|
+
import { readWasmFile } from "../../../util/wasm.js";
|
|
4
4
|
const wasm = readWasmFile("yoga-wasm-web/dist/yoga.wasm").then(async (yoga) => await initYoga(yoga));
|
|
5
5
|
export default {
|
|
6
6
|
initWasmPromise: new Promise((resolve) => {
|
package/dist/runtime/{core/bindings/satori/wasm.mjs → nitro/og-image/bindings/satori/wasm.js}
RENAMED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _satori from "satori/wasm";
|
|
2
2
|
import initYoga from "yoga-wasm-web";
|
|
3
3
|
import { init } from "satori";
|
|
4
|
-
|
|
5
|
-
const wasm = importWasm(import("yoga-wasm-web/dist/yoga.wasm")).then(async (yoga) => await initYoga(yoga));
|
|
4
|
+
const wasm = import("yoga-wasm-web/dist/yoga.wasm?module").then(async (yoga) => await initYoga(yoga.default || yoga));
|
|
6
5
|
export default {
|
|
7
6
|
initWasmPromise: new Promise((resolve) => {
|
|
8
7
|
wasm.then((yoga) => {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Storage } from 'unstorage';
|
|
2
|
+
import type { OgImageOptions } from '../../types.js';
|
|
3
|
+
export declare const htmlPayloadCache: Storage<{
|
|
4
|
+
expiresAt: number;
|
|
5
|
+
value: OgImageOptions;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const prerenderOptionsCache: Storage<OgImageOptions> | undefined;
|
|
@@ -2,5 +2,8 @@ import { createStorage } from "unstorage";
|
|
|
2
2
|
import lruCacheDriver from "unstorage/drivers/lru-cache";
|
|
3
3
|
export const htmlPayloadCache = createStorage({
|
|
4
4
|
// short cache time so we don't need many entries at runtime
|
|
5
|
-
driver: lruCacheDriver({ max: import.meta.prerender ?
|
|
5
|
+
driver: lruCacheDriver({ max: import.meta.prerender ? 1e4 : 50 })
|
|
6
6
|
});
|
|
7
|
+
export const prerenderOptionsCache = import.meta.prerender ? createStorage({
|
|
8
|
+
driver: lruCacheDriver({ max: 1e4 })
|
|
9
|
+
}) : void 0;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { Buffer } from 'node:buffer';
|
|
3
2
|
import type { Browser } from 'playwright-core';
|
|
4
|
-
import type { OgImageRenderEventContext } from '../../../types';
|
|
3
|
+
import type { OgImageRenderEventContext } from '../../../types.js';
|
|
5
4
|
export declare function createScreenshot({ basePath, e, options, extension }: OgImageRenderEventContext, browser: Browser): Promise<Buffer>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { joinURL, withQuery } from "ufo";
|
|
2
|
-
import { useOgImageRuntimeConfig } from "../../../
|
|
2
|
+
import { useOgImageRuntimeConfig } from "../../../shared.js";
|
|
3
3
|
import { useNitroOrigin } from "#imports";
|
|
4
4
|
export async function createScreenshot({ basePath, e, options, extension }, browser) {
|
|
5
5
|
const { colorPreference } = useOgImageRuntimeConfig();
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { H3Error, H3Event } from 'h3';
|
|
2
|
+
import type { OgImageOptions, OgImageRenderEventContext } from '../../types.js';
|
|
3
|
+
export declare function resolvePathCacheKey(e: H3Event, path?: string): string;
|
|
4
|
+
export declare function resolveContext(e: H3Event): Promise<H3Error | OgImageRenderEventContext>;
|
|
5
|
+
export declare function extractAndNormaliseOgImageOptions(html: string): OgImageOptions | false;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { parseURL, withQuery, withoutLeadingSlash, withoutTrailingSlash } from "ufo";
|
|
2
|
+
import { createError, getQuery } from "h3";
|
|
3
|
+
import { defu } from "defu";
|
|
4
|
+
import { normalizeKey } from "unstorage";
|
|
5
|
+
import { hash } from "ohash";
|
|
6
|
+
import { useNitroApp } from "nitropack/runtime/app";
|
|
7
|
+
import { parse } from "devalue";
|
|
8
|
+
import { separateProps, useOgImageRuntimeConfig } from "../../shared.js";
|
|
9
|
+
import { createNitroRouteRuleMatcher } from "../util/kit.js";
|
|
10
|
+
import { decodeObjectHtmlEntities } from "../util/encoding.js";
|
|
11
|
+
import { htmlPayloadCache, prerenderOptionsCache } from "./cache.js";
|
|
12
|
+
import { useChromiumRenderer, useSatoriRenderer } from "./instances.js";
|
|
13
|
+
export function resolvePathCacheKey(e, path) {
|
|
14
|
+
const siteConfig = e.context.siteConfig.get();
|
|
15
|
+
const basePath = withoutTrailingSlash(withoutLeadingSlash(normalizeKey(path || e.path)));
|
|
16
|
+
return [
|
|
17
|
+
!basePath || basePath === "/" ? "index" : basePath,
|
|
18
|
+
hash([
|
|
19
|
+
basePath,
|
|
20
|
+
siteConfig.url,
|
|
21
|
+
hash(getQuery(e))
|
|
22
|
+
])
|
|
23
|
+
].join(":");
|
|
24
|
+
}
|
|
25
|
+
export async function resolveContext(e) {
|
|
26
|
+
const runtimeConfig = useOgImageRuntimeConfig();
|
|
27
|
+
const path = parseURL(e.path).pathname;
|
|
28
|
+
const extension = path.split(".").pop();
|
|
29
|
+
if (!extension) {
|
|
30
|
+
return createError({
|
|
31
|
+
statusCode: 400,
|
|
32
|
+
statusMessage: `[Nuxt OG Image] Missing OG Image type.`
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
if (!["png", "jpeg", "jpg", "svg", "html", "json"].includes(extension)) {
|
|
36
|
+
return createError({
|
|
37
|
+
statusCode: 400,
|
|
38
|
+
statusMessage: `[Nuxt OG Image] Unknown OG Image type ${extension}.`
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
let queryParams = { ...getQuery(e) };
|
|
42
|
+
queryParams.props = JSON.parse(queryParams.props || "{}");
|
|
43
|
+
queryParams = separateProps(queryParams);
|
|
44
|
+
let basePath = withoutTrailingSlash(
|
|
45
|
+
path.replace(`/__og-image__/image`, "").replace(`/og.${extension}`, "")
|
|
46
|
+
);
|
|
47
|
+
if (queryParams._query)
|
|
48
|
+
basePath = withQuery(basePath, JSON.parse(queryParams._query));
|
|
49
|
+
const isDebugJsonPayload = extension === "json" && runtimeConfig.debug;
|
|
50
|
+
const key = resolvePathCacheKey(e, basePath);
|
|
51
|
+
let options = queryParams.options;
|
|
52
|
+
if (!options) {
|
|
53
|
+
if (import.meta.prerender)
|
|
54
|
+
options = await prerenderOptionsCache?.getItem(key);
|
|
55
|
+
if (!options) {
|
|
56
|
+
const payload = await fetchPathHtmlAndExtractOptions(e, basePath, key);
|
|
57
|
+
if (payload instanceof Error)
|
|
58
|
+
return payload;
|
|
59
|
+
options = payload;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
delete queryParams.options;
|
|
63
|
+
const routeRuleMatcher = createNitroRouteRuleMatcher();
|
|
64
|
+
const routeRules = routeRuleMatcher(basePath);
|
|
65
|
+
if (typeof routeRules.ogImage === "undefined" && !options) {
|
|
66
|
+
return createError({
|
|
67
|
+
statusCode: 400,
|
|
68
|
+
statusMessage: "The route is missing the Nuxt OG Image payload or route rules."
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
const ogImageRouteRules = separateProps(routeRules.ogImage);
|
|
72
|
+
options = defu(queryParams, options, ogImageRouteRules, runtimeConfig.defaults);
|
|
73
|
+
if (!options) {
|
|
74
|
+
return createError({
|
|
75
|
+
statusCode: 404,
|
|
76
|
+
statusMessage: "[Nuxt OG Image] OG Image not found."
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
let renderer;
|
|
80
|
+
switch (options.renderer) {
|
|
81
|
+
case "satori":
|
|
82
|
+
renderer = await useSatoriRenderer();
|
|
83
|
+
break;
|
|
84
|
+
case "chromium":
|
|
85
|
+
renderer = await useChromiumRenderer();
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
if (!renderer || renderer.__unenv__) {
|
|
89
|
+
throw createError({
|
|
90
|
+
statusCode: 400,
|
|
91
|
+
statusMessage: `[Nuxt OG Image] Renderer ${options.renderer} is missing.`
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
const ctx = {
|
|
95
|
+
e,
|
|
96
|
+
key,
|
|
97
|
+
renderer,
|
|
98
|
+
isDebugJsonPayload,
|
|
99
|
+
publicStoragePath: runtimeConfig.publicStoragePath,
|
|
100
|
+
extension,
|
|
101
|
+
basePath,
|
|
102
|
+
options,
|
|
103
|
+
_nitro: useNitroApp()
|
|
104
|
+
};
|
|
105
|
+
await ctx._nitro.hooks.callHook("nuxt-og-image:context", ctx);
|
|
106
|
+
return ctx;
|
|
107
|
+
}
|
|
108
|
+
export function extractAndNormaliseOgImageOptions(html) {
|
|
109
|
+
const htmlPayload = html.match(/<script.+id="nuxt-og-image-options"[^>]*>(.+?)<\/script>/)?.[1];
|
|
110
|
+
if (!htmlPayload)
|
|
111
|
+
return false;
|
|
112
|
+
let options = false;
|
|
113
|
+
try {
|
|
114
|
+
const payload2 = parse(htmlPayload);
|
|
115
|
+
Object.entries(payload2).forEach(([key, value]) => {
|
|
116
|
+
if (!value)
|
|
117
|
+
delete payload2[key];
|
|
118
|
+
});
|
|
119
|
+
options = payload2;
|
|
120
|
+
} catch (e) {
|
|
121
|
+
if (import.meta.dev)
|
|
122
|
+
console.warn("Failed to parse #nuxt-og-image-options", e, options);
|
|
123
|
+
}
|
|
124
|
+
if (!options)
|
|
125
|
+
return false;
|
|
126
|
+
if (typeof options.props?.description === "undefined") {
|
|
127
|
+
const description = html.match(/<meta[^>]+name="description"[^>]*>/)?.[0];
|
|
128
|
+
if (description) {
|
|
129
|
+
const [, content] = description.match(/content="([^"]+)"/) || [];
|
|
130
|
+
if (content && !options.props.description)
|
|
131
|
+
options.props.description = content;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
const payload = decodeObjectHtmlEntities(options);
|
|
135
|
+
if (import.meta.dev) {
|
|
136
|
+
const socialPreview = {};
|
|
137
|
+
const socialMetaTags = html.match(/<meta[^>]+(property|name)="(twitter|og):([^"]+)"[^>]*>/g);
|
|
138
|
+
if (socialMetaTags) {
|
|
139
|
+
socialMetaTags.forEach((tag) => {
|
|
140
|
+
const [, , type, key] = tag.match(/(property|name)="(twitter|og):([^"]+)"/);
|
|
141
|
+
const value = tag.match(/content="([^"]+)"/)?.[1];
|
|
142
|
+
if (!value)
|
|
143
|
+
return;
|
|
144
|
+
if (!socialPreview[type])
|
|
145
|
+
socialPreview[type] = {};
|
|
146
|
+
socialPreview[type][key] = value;
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
payload.socialPreview = socialPreview;
|
|
150
|
+
}
|
|
151
|
+
return payload;
|
|
152
|
+
}
|
|
153
|
+
async function fetchPathHtmlAndExtractOptions(e, path, key) {
|
|
154
|
+
const cachedHtmlPayload = await htmlPayloadCache.getItem(key);
|
|
155
|
+
if (!import.meta.dev && cachedHtmlPayload && cachedHtmlPayload.expiresAt < Date.now())
|
|
156
|
+
return cachedHtmlPayload.value;
|
|
157
|
+
let html;
|
|
158
|
+
try {
|
|
159
|
+
html = await e.$fetch(path);
|
|
160
|
+
} catch (err) {
|
|
161
|
+
return createError({
|
|
162
|
+
statusCode: 500,
|
|
163
|
+
statusMessage: `[Nuxt OG Image] Failed to read the path ${path} for og-image extraction. ${err.message}.`
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
if (typeof html !== "string") {
|
|
167
|
+
return createError({
|
|
168
|
+
statusCode: 500,
|
|
169
|
+
statusMessage: `[Nuxt OG Image] Got invalid response from ${path} for og-image extraction.`
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
const payload = extractAndNormaliseOgImageOptions(html);
|
|
173
|
+
if (!import.meta.dev && payload) {
|
|
174
|
+
await htmlPayloadCache.setItem(key, {
|
|
175
|
+
// 60 minutes for prerender, 10 seconds for runtime
|
|
176
|
+
expiresAt: Date.now() + 1e3 * (import.meta.prerender ? 60 * 60 : 10),
|
|
177
|
+
value: payload
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
return payload;
|
|
181
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const satoriRendererInstance = { instance: void 0 };
|
|
2
|
+
const chromiumRendererInstance = { instance: void 0 };
|
|
3
|
+
export async function useSatoriRenderer() {
|
|
4
|
+
satoriRendererInstance.instance = satoriRendererInstance.instance || await import("#nuxt-og-image/renderers/satori").then((m) => m.default);
|
|
5
|
+
return satoriRendererInstance.instance;
|
|
6
|
+
}
|
|
7
|
+
export async function useChromiumRenderer() {
|
|
8
|
+
chromiumRendererInstance.instance = chromiumRendererInstance.instance || await import("#nuxt-og-image/renderers/chromium").then((m) => m.default);
|
|
9
|
+
return chromiumRendererInstance.instance;
|
|
10
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { prefixStorage } from "unstorage";
|
|
2
|
+
import { useNitroOrigin, useStorage } from "#imports";
|
|
3
|
+
const assets = prefixStorage(useStorage(), "/assets");
|
|
4
|
+
export async function loadFont({ e, publicStoragePath }, font) {
|
|
5
|
+
const { name, weight } = font;
|
|
6
|
+
if (font.data)
|
|
7
|
+
return font;
|
|
8
|
+
if (font.key && await assets.hasItem(font.key)) {
|
|
9
|
+
let fontData = await assets.getItem(font.key);
|
|
10
|
+
if (fontData instanceof Uint8Array) {
|
|
11
|
+
const decoder = new TextDecoder();
|
|
12
|
+
fontData = decoder.decode(fontData);
|
|
13
|
+
}
|
|
14
|
+
font.data = Buffer.from(fontData, "base64");
|
|
15
|
+
return font;
|
|
16
|
+
}
|
|
17
|
+
let data;
|
|
18
|
+
if (font.path) {
|
|
19
|
+
if (import.meta.dev || import.meta.prerender) {
|
|
20
|
+
const key = `${publicStoragePath}${font.path.replace("./", ":").replace("/", ":")}`;
|
|
21
|
+
if (await useStorage().hasItem(key))
|
|
22
|
+
data = await useStorage().getItemRaw(key);
|
|
23
|
+
} else {
|
|
24
|
+
data = await e.$fetch(font.path, {
|
|
25
|
+
baseURL: useNitroOrigin(e),
|
|
26
|
+
responseType: "arrayBuffer"
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
} else {
|
|
30
|
+
data = await e.$fetch(`/__og-image__/font/${name}/${weight}.ttf`, {
|
|
31
|
+
responseType: "arrayBuffer",
|
|
32
|
+
query: {
|
|
33
|
+
font
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
font.data = data;
|
|
38
|
+
return font;
|
|
39
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type _sharp from 'sharp';
|
|
1
2
|
import type _satori from 'satori';
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function useResvg(): Promise<new (svg: string | Uint8Array, options?: import("@resvg/resvg-wasm").ResvgRenderOptions | undefined) => {
|
|
3
|
+
import type _cssInline from '@css-inline/css-inline-wasm';
|
|
4
|
+
export declare function useResvg(): Promise<new (svg: Uint8Array | string, options?: import("@resvg/resvg-wasm").ResvgRenderOptions) => {
|
|
5
5
|
free(): void;
|
|
6
6
|
render(): {
|
|
7
7
|
free(): void;
|
|
@@ -38,5 +38,5 @@ export declare function useResvg(): Promise<new (svg: string | Uint8Array, optio
|
|
|
38
38
|
readonly width: number;
|
|
39
39
|
}>;
|
|
40
40
|
export declare function useSatori(): Promise<typeof _satori>;
|
|
41
|
-
export declare function useSharp(): Promise<
|
|
42
|
-
export declare function useCssInline(): Promise<
|
|
41
|
+
export declare function useSharp(): Promise<typeof _sharp>;
|
|
42
|
+
export declare function useCssInline(): Promise<typeof _cssInline>;
|
package/dist/runtime/{core/renderers/satori/instances.mjs → nitro/og-image/satori/instances.js}
RENAMED
|
@@ -2,16 +2,6 @@ const cssInlineInstance = { instance: void 0 };
|
|
|
2
2
|
const sharpInstance = { instance: void 0 };
|
|
3
3
|
const resvgInstance = { instance: void 0 };
|
|
4
4
|
const satoriInstance = { instance: void 0 };
|
|
5
|
-
const satoriRendererInstance = { instance: void 0 };
|
|
6
|
-
const chromiumRendererInstance = { instance: void 0 };
|
|
7
|
-
export async function useSatoriRenderer() {
|
|
8
|
-
satoriRendererInstance.instance = satoriRendererInstance.instance || await import("#nuxt-og-image/renderers/satori").then((m) => m.default);
|
|
9
|
-
return satoriRendererInstance.instance;
|
|
10
|
-
}
|
|
11
|
-
export async function useChromiumRenderer() {
|
|
12
|
-
chromiumRendererInstance.instance = chromiumRendererInstance.instance || await import("#nuxt-og-image/renderers/chromium").then((m) => m.default);
|
|
13
|
-
return chromiumRendererInstance.instance;
|
|
14
|
-
}
|
|
15
5
|
export async function useResvg() {
|
|
16
6
|
resvgInstance.instance = resvgInstance.instance || await import("#nuxt-og-image/bindings/resvg").then((m) => m.default);
|
|
17
7
|
await resvgInstance.instance.initWasmPromise;
|
|
@@ -28,5 +18,6 @@ export async function useSharp() {
|
|
|
28
18
|
}
|
|
29
19
|
export async function useCssInline() {
|
|
30
20
|
cssInlineInstance.instance = cssInlineInstance.instance || await import("#nuxt-og-image/bindings/css-inline").then((m) => m.default);
|
|
31
|
-
|
|
21
|
+
await cssInlineInstance.instance.initWasmPromise;
|
|
22
|
+
return cssInlineInstance.instance.cssInline;
|
|
32
23
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineSatoriTransformer } from "../utils.js";
|
|
2
|
+
export default defineSatoriTransformer([
|
|
3
|
+
{
|
|
4
|
+
filter: (node) => !!node.props?.class && !node.props?.tw,
|
|
5
|
+
transform(node) {
|
|
6
|
+
node.props.tw = node.props.class;
|
|
7
|
+
node.props.tw = node.props.tw.replace(/icon|inline-style/g, "");
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
filter: (node) => !!node.props?.style?.display,
|
|
12
|
+
transform(node) {
|
|
13
|
+
if (["inline-block", "inline"].includes(node.props.style.display))
|
|
14
|
+
delete node.props.style.display;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineSatoriTransformer } from "../utils.
|
|
1
|
+
import { defineSatoriTransformer } from "../utils.js";
|
|
2
2
|
function isEmojiFilter(node) {
|
|
3
3
|
return node.type === "svg" && typeof node.props?.["data-emoji"] !== "undefined";
|
|
4
4
|
}
|
|
@@ -6,7 +6,7 @@ export default defineSatoriTransformer([
|
|
|
6
6
|
// need to make sure parent div has flex for the emoji to render inline
|
|
7
7
|
{
|
|
8
8
|
filter: (node) => ["div", "p"].includes(node.type) && Array.isArray(node.props?.children) && node.props.children.some(isEmojiFilter),
|
|
9
|
-
transform:
|
|
9
|
+
transform: (node) => {
|
|
10
10
|
node.props.style = node.props.style || {};
|
|
11
11
|
node.props.style.display = "flex";
|
|
12
12
|
node.props.style.alignItems = "center";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineSatoriTransformer } from "../utils.js";
|
|
2
|
+
import { decodeHtml } from "../../../util/encoding.js";
|
|
3
|
+
export default defineSatoriTransformer([
|
|
4
|
+
// clean up
|
|
5
|
+
{
|
|
6
|
+
filter: (node) => node.props?.["data-v-inspector"],
|
|
7
|
+
transform: (node) => {
|
|
8
|
+
delete node.props["data-v-inspector"];
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
filter: (node) => typeof node.props?.children === "string",
|
|
13
|
+
transform: (node) => {
|
|
14
|
+
node.props.children = decodeHtml(node.props.children);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineSatoriTransformer } from "../utils.
|
|
1
|
+
import { defineSatoriTransformer } from "../utils.js";
|
|
2
2
|
export default defineSatoriTransformer({
|
|
3
3
|
filter: (node) => node.type === "div" && (Array.isArray(node.props?.children) && node.props?.children.length >= 1) && (!node.props.style?.display && !node.props?.class?.includes("hidden")),
|
|
4
|
-
transform:
|
|
4
|
+
transform: (node) => {
|
|
5
5
|
node.props.style = node.props.style || {};
|
|
6
6
|
node.props.style.display = "flex";
|
|
7
7
|
if (!node.props?.class?.includes("flex-"))
|