@theokit/ui 0.13.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/CHANGELOG.md +1325 -0
- package/DESIGN.md +456 -0
- package/LICENSE +201 -0
- package/NOTICE +38 -0
- package/README.md +467 -0
- package/dist/chunk-27ENTTY7.js +146 -0
- package/dist/chunk-27ENTTY7.js.map +1 -0
- package/dist/chunk-2H6TQELG.js +33 -0
- package/dist/chunk-2H6TQELG.js.map +1 -0
- package/dist/chunk-2L6MRJD4.js +120 -0
- package/dist/chunk-2L6MRJD4.js.map +1 -0
- package/dist/chunk-2Y5V2PAL.js +80 -0
- package/dist/chunk-2Y5V2PAL.js.map +1 -0
- package/dist/chunk-34NAFDVL.js +46 -0
- package/dist/chunk-34NAFDVL.js.map +1 -0
- package/dist/chunk-36KJGXEK.js +112 -0
- package/dist/chunk-36KJGXEK.js.map +1 -0
- package/dist/chunk-3BMYYNN6.js +124 -0
- package/dist/chunk-3BMYYNN6.js.map +1 -0
- package/dist/chunk-3OHV7EEI.js +34 -0
- package/dist/chunk-3OHV7EEI.js.map +1 -0
- package/dist/chunk-3QKTS6F5.js +88 -0
- package/dist/chunk-3QKTS6F5.js.map +1 -0
- package/dist/chunk-3TBXLYNM.js +42 -0
- package/dist/chunk-3TBXLYNM.js.map +1 -0
- package/dist/chunk-4AM2HSXU.js +67 -0
- package/dist/chunk-4AM2HSXU.js.map +1 -0
- package/dist/chunk-4BCGKM65.js +44 -0
- package/dist/chunk-4BCGKM65.js.map +1 -0
- package/dist/chunk-4D3JILQX.js +145 -0
- package/dist/chunk-4D3JILQX.js.map +1 -0
- package/dist/chunk-4EJU2GBG.js +48 -0
- package/dist/chunk-4EJU2GBG.js.map +1 -0
- package/dist/chunk-4WKO3G5C.js +110 -0
- package/dist/chunk-4WKO3G5C.js.map +1 -0
- package/dist/chunk-53XPKI7Q.js +97 -0
- package/dist/chunk-53XPKI7Q.js.map +1 -0
- package/dist/chunk-55TDVDPG.js +58 -0
- package/dist/chunk-55TDVDPG.js.map +1 -0
- package/dist/chunk-56BJLFW7.js +26 -0
- package/dist/chunk-56BJLFW7.js.map +1 -0
- package/dist/chunk-5HOQLE6Y.js +35 -0
- package/dist/chunk-5HOQLE6Y.js.map +1 -0
- package/dist/chunk-5TY3NYF5.js +144 -0
- package/dist/chunk-5TY3NYF5.js.map +1 -0
- package/dist/chunk-5VOSCJKQ.js +92 -0
- package/dist/chunk-5VOSCJKQ.js.map +1 -0
- package/dist/chunk-65NVO6TK.js +171 -0
- package/dist/chunk-65NVO6TK.js.map +1 -0
- package/dist/chunk-6A5TPCKP.js +64 -0
- package/dist/chunk-6A5TPCKP.js.map +1 -0
- package/dist/chunk-6CO4LEXZ.js +41 -0
- package/dist/chunk-6CO4LEXZ.js.map +1 -0
- package/dist/chunk-6FVUPNPG.js +56 -0
- package/dist/chunk-6FVUPNPG.js.map +1 -0
- package/dist/chunk-76YWTIWK.js +106 -0
- package/dist/chunk-76YWTIWK.js.map +1 -0
- package/dist/chunk-7EI7424P.js +78 -0
- package/dist/chunk-7EI7424P.js.map +1 -0
- package/dist/chunk-AHTVYOPQ.js +26 -0
- package/dist/chunk-AHTVYOPQ.js.map +1 -0
- package/dist/chunk-AJTJNHKK.js +85 -0
- package/dist/chunk-AJTJNHKK.js.map +1 -0
- package/dist/chunk-AMT3CPMC.js +155 -0
- package/dist/chunk-AMT3CPMC.js.map +1 -0
- package/dist/chunk-AX5EH73R.js +59 -0
- package/dist/chunk-AX5EH73R.js.map +1 -0
- package/dist/chunk-B3VAJSZ2.js +35 -0
- package/dist/chunk-B3VAJSZ2.js.map +1 -0
- package/dist/chunk-B4CQMQ64.js +25 -0
- package/dist/chunk-B4CQMQ64.js.map +1 -0
- package/dist/chunk-BMRZXT5T.js +115 -0
- package/dist/chunk-BMRZXT5T.js.map +1 -0
- package/dist/chunk-BYZ6OFH4.js +73 -0
- package/dist/chunk-BYZ6OFH4.js.map +1 -0
- package/dist/chunk-C55VUQ7N.js +156 -0
- package/dist/chunk-C55VUQ7N.js.map +1 -0
- package/dist/chunk-D4GEAV4C.js +91 -0
- package/dist/chunk-D4GEAV4C.js.map +1 -0
- package/dist/chunk-DC43CHAM.js +152 -0
- package/dist/chunk-DC43CHAM.js.map +1 -0
- package/dist/chunk-DKCRLN35.js +92 -0
- package/dist/chunk-DKCRLN35.js.map +1 -0
- package/dist/chunk-DN5BUDBI.js +86 -0
- package/dist/chunk-DN5BUDBI.js.map +1 -0
- package/dist/chunk-DOLKDYMS.js +88 -0
- package/dist/chunk-DOLKDYMS.js.map +1 -0
- package/dist/chunk-DW34WXCG.js +28 -0
- package/dist/chunk-DW34WXCG.js.map +1 -0
- package/dist/chunk-DZAAKHGZ.js +135 -0
- package/dist/chunk-DZAAKHGZ.js.map +1 -0
- package/dist/chunk-E4IRSSHO.js +116 -0
- package/dist/chunk-E4IRSSHO.js.map +1 -0
- package/dist/chunk-E67WQXBV.js +104 -0
- package/dist/chunk-E67WQXBV.js.map +1 -0
- package/dist/chunk-EG6IHP3H.js +128 -0
- package/dist/chunk-EG6IHP3H.js.map +1 -0
- package/dist/chunk-EO7LOXG2.js +82 -0
- package/dist/chunk-EO7LOXG2.js.map +1 -0
- package/dist/chunk-EWDN56AS.js +24 -0
- package/dist/chunk-EWDN56AS.js.map +1 -0
- package/dist/chunk-F5P5P2SC.js +141 -0
- package/dist/chunk-F5P5P2SC.js.map +1 -0
- package/dist/chunk-FAWPRZTM.js +79 -0
- package/dist/chunk-FAWPRZTM.js.map +1 -0
- package/dist/chunk-FGYJ2WPX.js +36 -0
- package/dist/chunk-FGYJ2WPX.js.map +1 -0
- package/dist/chunk-GBG3I5I5.js +46 -0
- package/dist/chunk-GBG3I5I5.js.map +1 -0
- package/dist/chunk-GDMCDW66.js +19 -0
- package/dist/chunk-GDMCDW66.js.map +1 -0
- package/dist/chunk-H6HSQCOW.js +80 -0
- package/dist/chunk-H6HSQCOW.js.map +1 -0
- package/dist/chunk-HDM4RCIF.js +111 -0
- package/dist/chunk-HDM4RCIF.js.map +1 -0
- package/dist/chunk-HNTOGGVD.js +77 -0
- package/dist/chunk-HNTOGGVD.js.map +1 -0
- package/dist/chunk-HQW2ABO4.js +28 -0
- package/dist/chunk-HQW2ABO4.js.map +1 -0
- package/dist/chunk-HRDRGZ2Y.js +76 -0
- package/dist/chunk-HRDRGZ2Y.js.map +1 -0
- package/dist/chunk-HUOVA7SF.js +83 -0
- package/dist/chunk-HUOVA7SF.js.map +1 -0
- package/dist/chunk-ITA3SNOR.js +133 -0
- package/dist/chunk-ITA3SNOR.js.map +1 -0
- package/dist/chunk-IYNUPG2G.js +61 -0
- package/dist/chunk-IYNUPG2G.js.map +1 -0
- package/dist/chunk-JJ65ZI4P.js +199 -0
- package/dist/chunk-JJ65ZI4P.js.map +1 -0
- package/dist/chunk-JRBGZ6NI.js +106 -0
- package/dist/chunk-JRBGZ6NI.js.map +1 -0
- package/dist/chunk-K45OO62F.js +108 -0
- package/dist/chunk-K45OO62F.js.map +1 -0
- package/dist/chunk-KDTKA667.js +67 -0
- package/dist/chunk-KDTKA667.js.map +1 -0
- package/dist/chunk-KI7KZBSN.js +142 -0
- package/dist/chunk-KI7KZBSN.js.map +1 -0
- package/dist/chunk-KOJ7XOPZ.js +87 -0
- package/dist/chunk-KOJ7XOPZ.js.map +1 -0
- package/dist/chunk-KQTHJ22B.js +82 -0
- package/dist/chunk-KQTHJ22B.js.map +1 -0
- package/dist/chunk-KRC43RZR.js +77 -0
- package/dist/chunk-KRC43RZR.js.map +1 -0
- package/dist/chunk-LJQOEGQ2.js +116 -0
- package/dist/chunk-LJQOEGQ2.js.map +1 -0
- package/dist/chunk-LKRNUSKZ.js +149 -0
- package/dist/chunk-LKRNUSKZ.js.map +1 -0
- package/dist/chunk-LLL7QQ52.js +76 -0
- package/dist/chunk-LLL7QQ52.js.map +1 -0
- package/dist/chunk-LQ4B5X4Y.js +56 -0
- package/dist/chunk-LQ4B5X4Y.js.map +1 -0
- package/dist/chunk-M3FSLEHQ.js +76 -0
- package/dist/chunk-M3FSLEHQ.js.map +1 -0
- package/dist/chunk-M5G3O6H6.js +57 -0
- package/dist/chunk-M5G3O6H6.js.map +1 -0
- package/dist/chunk-M6JIC5PU.js +81 -0
- package/dist/chunk-M6JIC5PU.js.map +1 -0
- package/dist/chunk-N2HJ3SLS.js +186 -0
- package/dist/chunk-N2HJ3SLS.js.map +1 -0
- package/dist/chunk-NGZWBFTP.js +45 -0
- package/dist/chunk-NGZWBFTP.js.map +1 -0
- package/dist/chunk-OAKCXT35.js +34 -0
- package/dist/chunk-OAKCXT35.js.map +1 -0
- package/dist/chunk-OSD3U3HT.js +54 -0
- package/dist/chunk-OSD3U3HT.js.map +1 -0
- package/dist/chunk-OUXESQ2R.js +42 -0
- package/dist/chunk-OUXESQ2R.js.map +1 -0
- package/dist/chunk-OY2LJHMJ.js +43 -0
- package/dist/chunk-OY2LJHMJ.js.map +1 -0
- package/dist/chunk-OYEZR4CN.js +221 -0
- package/dist/chunk-OYEZR4CN.js.map +1 -0
- package/dist/chunk-P57HUMAE.js +66 -0
- package/dist/chunk-P57HUMAE.js.map +1 -0
- package/dist/chunk-P6Y2PI6L.js +82 -0
- package/dist/chunk-P6Y2PI6L.js.map +1 -0
- package/dist/chunk-PA7TDXUQ.js +51 -0
- package/dist/chunk-PA7TDXUQ.js.map +1 -0
- package/dist/chunk-PPBGGNPV.js +112 -0
- package/dist/chunk-PPBGGNPV.js.map +1 -0
- package/dist/chunk-PRH4HKND.js +48 -0
- package/dist/chunk-PRH4HKND.js.map +1 -0
- package/dist/chunk-PSPAZJUQ.js +32 -0
- package/dist/chunk-PSPAZJUQ.js.map +1 -0
- package/dist/chunk-Q5G5CGZ2.js +170 -0
- package/dist/chunk-Q5G5CGZ2.js.map +1 -0
- package/dist/chunk-QDAF3LP7.js +89 -0
- package/dist/chunk-QDAF3LP7.js.map +1 -0
- package/dist/chunk-QGVIGNJ3.js +37 -0
- package/dist/chunk-QGVIGNJ3.js.map +1 -0
- package/dist/chunk-QNUITYSY.js +68 -0
- package/dist/chunk-QNUITYSY.js.map +1 -0
- package/dist/chunk-QSWVN3RT.js +116 -0
- package/dist/chunk-QSWVN3RT.js.map +1 -0
- package/dist/chunk-QTLQZ7OJ.js +110 -0
- package/dist/chunk-QTLQZ7OJ.js.map +1 -0
- package/dist/chunk-QYAMLIG2.js +84 -0
- package/dist/chunk-QYAMLIG2.js.map +1 -0
- package/dist/chunk-REILH4XF.js +128 -0
- package/dist/chunk-REILH4XF.js.map +1 -0
- package/dist/chunk-S6SSK6QX.js +80 -0
- package/dist/chunk-S6SSK6QX.js.map +1 -0
- package/dist/chunk-SA7ED3PN.js +68 -0
- package/dist/chunk-SA7ED3PN.js.map +1 -0
- package/dist/chunk-SIJOEM4N.js +55 -0
- package/dist/chunk-SIJOEM4N.js.map +1 -0
- package/dist/chunk-SLOKAAH2.js +70 -0
- package/dist/chunk-SLOKAAH2.js.map +1 -0
- package/dist/chunk-TR6NPSMX.js +85 -0
- package/dist/chunk-TR6NPSMX.js.map +1 -0
- package/dist/chunk-TSZ5DEAT.js +106 -0
- package/dist/chunk-TSZ5DEAT.js.map +1 -0
- package/dist/chunk-TUNVF45W.js +127 -0
- package/dist/chunk-TUNVF45W.js.map +1 -0
- package/dist/chunk-TXOBNSQ5.js +63 -0
- package/dist/chunk-TXOBNSQ5.js.map +1 -0
- package/dist/chunk-U44DRLMM.js +88 -0
- package/dist/chunk-U44DRLMM.js.map +1 -0
- package/dist/chunk-U4THNRV5.js +114 -0
- package/dist/chunk-U4THNRV5.js.map +1 -0
- package/dist/chunk-UAZOFC4W.js +72 -0
- package/dist/chunk-UAZOFC4W.js.map +1 -0
- package/dist/chunk-UGKI466V.js +12 -0
- package/dist/chunk-UGKI466V.js.map +1 -0
- package/dist/chunk-VM4RMQQN.js +11 -0
- package/dist/chunk-VM4RMQQN.js.map +1 -0
- package/dist/chunk-VQ37VLAS.js +54 -0
- package/dist/chunk-VQ37VLAS.js.map +1 -0
- package/dist/chunk-VT7VSYH5.js +73 -0
- package/dist/chunk-VT7VSYH5.js.map +1 -0
- package/dist/chunk-VTIRUCLZ.js +57 -0
- package/dist/chunk-VTIRUCLZ.js.map +1 -0
- package/dist/chunk-VVBAEYKI.js +202 -0
- package/dist/chunk-VVBAEYKI.js.map +1 -0
- package/dist/chunk-WHFIQUCC.js +120 -0
- package/dist/chunk-WHFIQUCC.js.map +1 -0
- package/dist/chunk-WPSESV5Z.js +74 -0
- package/dist/chunk-WPSESV5Z.js.map +1 -0
- package/dist/chunk-WXEXCHEN.js +51 -0
- package/dist/chunk-WXEXCHEN.js.map +1 -0
- package/dist/chunk-X2DDPD3D.js +113 -0
- package/dist/chunk-X2DDPD3D.js.map +1 -0
- package/dist/chunk-X7VIMKLD.js +127 -0
- package/dist/chunk-X7VIMKLD.js.map +1 -0
- package/dist/chunk-XJ3EG6XY.js +30 -0
- package/dist/chunk-XJ3EG6XY.js.map +1 -0
- package/dist/chunk-XOT5HWSF.js +23 -0
- package/dist/chunk-XOT5HWSF.js.map +1 -0
- package/dist/chunk-Y72IP43U.js +117 -0
- package/dist/chunk-Y72IP43U.js.map +1 -0
- package/dist/chunk-YD6FLXBV.js +61 -0
- package/dist/chunk-YD6FLXBV.js.map +1 -0
- package/dist/chunk-YEQQGYYO.js +1022 -0
- package/dist/chunk-YEQQGYYO.js.map +1 -0
- package/dist/chunk-YYW6AEIT.js +46 -0
- package/dist/chunk-YYW6AEIT.js.map +1 -0
- package/dist/chunk-ZEVGXKRU.js +104 -0
- package/dist/chunk-ZEVGXKRU.js.map +1 -0
- package/dist/chunk-ZKSMMLDP.js +74 -0
- package/dist/chunk-ZKSMMLDP.js.map +1 -0
- package/dist/chunk-ZU6IM6PK.js +101 -0
- package/dist/chunk-ZU6IM6PK.js.map +1 -0
- package/dist/chunk-ZUS5KZGO.js +714 -0
- package/dist/chunk-ZUS5KZGO.js.map +1 -0
- package/dist/chunk-ZVS2GOT2.js +58 -0
- package/dist/chunk-ZVS2GOT2.js.map +1 -0
- package/dist/chunk-ZXPDS6DH.js +3 -0
- package/dist/chunk-ZXPDS6DH.js.map +1 -0
- package/dist/chunk-ZZQQJX5Z.js +173 -0
- package/dist/chunk-ZZQQJX5Z.js.map +1 -0
- package/dist/components.css +2 -0
- package/dist/composites/account-menu/index.js +6 -0
- package/dist/composites/account-menu/index.js.map +1 -0
- package/dist/composites/agent-composer/index.js +7 -0
- package/dist/composites/agent-composer/index.js.map +1 -0
- package/dist/composites/agent-editor/index.js +10 -0
- package/dist/composites/agent-editor/index.js.map +1 -0
- package/dist/composites/agent-stream/index.js +12 -0
- package/dist/composites/agent-stream/index.js.map +1 -0
- package/dist/composites/agent-timeline/index.js +5 -0
- package/dist/composites/agent-timeline/index.js.map +1 -0
- package/dist/composites/approval-card/index.js +5 -0
- package/dist/composites/approval-card/index.js.map +1 -0
- package/dist/composites/chat-composer/index.js +6 -0
- package/dist/composites/chat-composer/index.js.map +1 -0
- package/dist/composites/chat-message/index.js +6 -0
- package/dist/composites/chat-message/index.js.map +1 -0
- package/dist/composites/code-block/index.js +5 -0
- package/dist/composites/code-block/index.js.map +1 -0
- package/dist/composites/command-palette/index.js +5 -0
- package/dist/composites/command-palette/index.js.map +1 -0
- package/dist/composites/confirm-dialog/index.js +7 -0
- package/dist/composites/confirm-dialog/index.js.map +1 -0
- package/dist/composites/cron-jobs-list/index.js +5 -0
- package/dist/composites/cron-jobs-list/index.js.map +1 -0
- package/dist/composites/data-table/index.js +10 -0
- package/dist/composites/data-table/index.js.map +1 -0
- package/dist/composites/deployment-row/index.js +5 -0
- package/dist/composites/deployment-row/index.js.map +1 -0
- package/dist/composites/domain-config/index.js +7 -0
- package/dist/composites/domain-config/index.js.map +1 -0
- package/dist/composites/env-var-editor/index.js +7 -0
- package/dist/composites/env-var-editor/index.js.map +1 -0
- package/dist/composites/mcp-server-list/index.js +5 -0
- package/dist/composites/mcp-server-list/index.js.map +1 -0
- package/dist/composites/page-shell/index.js +7 -0
- package/dist/composites/page-shell/index.js.map +1 -0
- package/dist/composites/permission-modal/index.js +6 -0
- package/dist/composites/permission-modal/index.js.map +1 -0
- package/dist/composites/preview-env-card/index.js +6 -0
- package/dist/composites/preview-env-card/index.js.map +1 -0
- package/dist/composites/preview-panel/index.js +5 -0
- package/dist/composites/preview-panel/index.js.map +1 -0
- package/dist/composites/project-card/index.js +6 -0
- package/dist/composites/project-card/index.js.map +1 -0
- package/dist/composites/rollback-ui/index.js +6 -0
- package/dist/composites/rollback-ui/index.js.map +1 -0
- package/dist/composites/rule-editor/index.js +11 -0
- package/dist/composites/rule-editor/index.js.map +1 -0
- package/dist/composites/skill-editor/index.js +11 -0
- package/dist/composites/skill-editor/index.js.map +1 -0
- package/dist/composites/skills-list/index.js +5 -0
- package/dist/composites/skills-list/index.js.map +1 -0
- package/dist/composites/stability-bundle-viewer/index.js +4 -0
- package/dist/composites/stability-bundle-viewer/index.js.map +1 -0
- package/dist/composites/task-header/index.js +5 -0
- package/dist/composites/task-header/index.js.map +1 -0
- package/dist/composites/usage-meter/index.js +5 -0
- package/dist/composites/usage-meter/index.js.map +1 -0
- package/dist/fonts/LICENSE-GEIST.txt +92 -0
- package/dist/fonts/geist-400.woff2 +0 -0
- package/dist/fonts/geist-500.woff2 +0 -0
- package/dist/fonts/geist-600.woff2 +0 -0
- package/dist/fonts/geist-mono-400.woff2 +0 -0
- package/dist/fonts/geist-mono-500.woff2 +0 -0
- package/dist/fonts/geist-mono-600.woff2 +0 -0
- package/dist/fonts-cdn.css +28 -0
- package/dist/fonts.css +75 -0
- package/dist/index.d.ts +4621 -0
- package/dist/index.js +1338 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin-D5xmXqYb.d.ts +172 -0
- package/dist/preset-v3-legacy.d.ts +35 -0
- package/dist/preset-v3-legacy.js +159 -0
- package/dist/preset-v3-legacy.js.map +1 -0
- package/dist/preset.css +27 -0
- package/dist/primitives/action-bar/index.js +4 -0
- package/dist/primitives/action-bar/index.js.map +1 -0
- package/dist/primitives/agent-error-card/index.js +5 -0
- package/dist/primitives/agent-error-card/index.js.map +1 -0
- package/dist/primitives/agent-event/index.js +4 -0
- package/dist/primitives/agent-event/index.js.map +1 -0
- package/dist/primitives/agent-handoff/index.js +4 -0
- package/dist/primitives/agent-handoff/index.js.map +1 -0
- package/dist/primitives/agent-profile/index.js +4 -0
- package/dist/primitives/agent-profile/index.js.map +1 -0
- package/dist/primitives/agent-starting-state/index.js +5 -0
- package/dist/primitives/agent-starting-state/index.js.map +1 -0
- package/dist/primitives/agent-streaming/index.js +5 -0
- package/dist/primitives/agent-streaming/index.js.map +1 -0
- package/dist/primitives/alert/index.js +4 -0
- package/dist/primitives/alert/index.js.map +1 -0
- package/dist/primitives/artifact-preview/index.js +4 -0
- package/dist/primitives/artifact-preview/index.js.map +1 -0
- package/dist/primitives/attachment-chip/index.js +4 -0
- package/dist/primitives/attachment-chip/index.js.map +1 -0
- package/dist/primitives/audit-log-entry/index.js +4 -0
- package/dist/primitives/audit-log-entry/index.js.map +1 -0
- package/dist/primitives/auto-compact-notice/index.js +5 -0
- package/dist/primitives/auto-compact-notice/index.js.map +1 -0
- package/dist/primitives/avatar/index.js +4 -0
- package/dist/primitives/avatar/index.js.map +1 -0
- package/dist/primitives/badge/index.js +4 -0
- package/dist/primitives/badge/index.js.map +1 -0
- package/dist/primitives/branch-indicator/index.js +4 -0
- package/dist/primitives/branch-indicator/index.js.map +1 -0
- package/dist/primitives/browser-controls/index.js +4 -0
- package/dist/primitives/browser-controls/index.js.map +1 -0
- package/dist/primitives/build-log-stream/index.js +5 -0
- package/dist/primitives/build-log-stream/index.js.map +1 -0
- package/dist/primitives/button/index.js +4 -0
- package/dist/primitives/button/index.js.map +1 -0
- package/dist/primitives/capability-indicator/index.js +4 -0
- package/dist/primitives/capability-indicator/index.js.map +1 -0
- package/dist/primitives/card/index.js +4 -0
- package/dist/primitives/card/index.js.map +1 -0
- package/dist/primitives/channel-card/index.js +4 -0
- package/dist/primitives/channel-card/index.js.map +1 -0
- package/dist/primitives/chat-thread/index.js +5 -0
- package/dist/primitives/chat-thread/index.js.map +1 -0
- package/dist/primitives/checkbox/index.js +4 -0
- package/dist/primitives/checkbox/index.js.map +1 -0
- package/dist/primitives/context-card/index.js +4 -0
- package/dist/primitives/context-card/index.js.map +1 -0
- package/dist/primitives/context-window-bar/index.js +4 -0
- package/dist/primitives/context-window-bar/index.js.map +1 -0
- package/dist/primitives/copy-button/index.js +4 -0
- package/dist/primitives/copy-button/index.js.map +1 -0
- package/dist/primitives/cost-meter/index.js +4 -0
- package/dist/primitives/cost-meter/index.js.map +1 -0
- package/dist/primitives/created-files-card/index.js +4 -0
- package/dist/primitives/created-files-card/index.js.map +1 -0
- package/dist/primitives/cron-job-card/index.js +4 -0
- package/dist/primitives/cron-job-card/index.js.map +1 -0
- package/dist/primitives/danger-zone/index.js +4 -0
- package/dist/primitives/danger-zone/index.js.map +1 -0
- package/dist/primitives/dialog/index.js +4 -0
- package/dist/primitives/dialog/index.js.map +1 -0
- package/dist/primitives/diff-viewer/index.js +4 -0
- package/dist/primitives/diff-viewer/index.js.map +1 -0
- package/dist/primitives/dropdown-menu/index.js +4 -0
- package/dist/primitives/dropdown-menu/index.js.map +1 -0
- package/dist/primitives/empty-state/index.js +4 -0
- package/dist/primitives/empty-state/index.js.map +1 -0
- package/dist/primitives/export-chat-dialog/index.js +4 -0
- package/dist/primitives/export-chat-dialog/index.js.map +1 -0
- package/dist/primitives/folder-context-card/index.js +4 -0
- package/dist/primitives/folder-context-card/index.js.map +1 -0
- package/dist/primitives/folder-selector/index.js +4 -0
- package/dist/primitives/folder-selector/index.js.map +1 -0
- package/dist/primitives/form-field/index.js +4 -0
- package/dist/primitives/form-field/index.js.map +1 -0
- package/dist/primitives/gateway-status-indicator/index.js +4 -0
- package/dist/primitives/gateway-status-indicator/index.js.map +1 -0
- package/dist/primitives/hook-config/index.js +4 -0
- package/dist/primitives/hook-config/index.js.map +1 -0
- package/dist/primitives/hook-event-log/index.js +4 -0
- package/dist/primitives/hook-event-log/index.js.map +1 -0
- package/dist/primitives/input/index.js +4 -0
- package/dist/primitives/input/index.js.map +1 -0
- package/dist/primitives/intent-selector/index.js +4 -0
- package/dist/primitives/intent-selector/index.js.map +1 -0
- package/dist/primitives/label/index.js +4 -0
- package/dist/primitives/label/index.js.map +1 -0
- package/dist/primitives/lane-board/index.js +4 -0
- package/dist/primitives/lane-board/index.js.map +1 -0
- package/dist/primitives/login-split/index.js +4 -0
- package/dist/primitives/login-split/index.js.map +1 -0
- package/dist/primitives/mcp-server-card/index.js +4 -0
- package/dist/primitives/mcp-server-card/index.js.map +1 -0
- package/dist/primitives/memory-editor/index.js +4 -0
- package/dist/primitives/memory-editor/index.js.map +1 -0
- package/dist/primitives/mention-menu/index.js +4 -0
- package/dist/primitives/mention-menu/index.js.map +1 -0
- package/dist/primitives/metrics-panel/index.js +4 -0
- package/dist/primitives/metrics-panel/index.js.map +1 -0
- package/dist/primitives/model-card/index.js +4 -0
- package/dist/primitives/model-card/index.js.map +1 -0
- package/dist/primitives/model-selector/index.js +4 -0
- package/dist/primitives/model-selector/index.js.map +1 -0
- package/dist/primitives/pagination/index.js +4 -0
- package/dist/primitives/pagination/index.js.map +1 -0
- package/dist/primitives/permission-matrix/index.js +4 -0
- package/dist/primitives/permission-matrix/index.js.map +1 -0
- package/dist/primitives/pin-input/index.js +4 -0
- package/dist/primitives/pin-input/index.js.map +1 -0
- package/dist/primitives/plan-badge/index.js +4 -0
- package/dist/primitives/plan-badge/index.js.map +1 -0
- package/dist/primitives/progress/index.js +4 -0
- package/dist/primitives/progress/index.js.map +1 -0
- package/dist/primitives/progress-checklist/index.js +4 -0
- package/dist/primitives/progress-checklist/index.js.map +1 -0
- package/dist/primitives/project-switcher/index.js +4 -0
- package/dist/primitives/project-switcher/index.js.map +1 -0
- package/dist/primitives/quick-action-chips/index.js +4 -0
- package/dist/primitives/quick-action-chips/index.js.map +1 -0
- package/dist/primitives/radio-group/index.js +4 -0
- package/dist/primitives/radio-group/index.js.map +1 -0
- package/dist/primitives/recent-folders-list/index.js +4 -0
- package/dist/primitives/recent-folders-list/index.js.map +1 -0
- package/dist/primitives/rule-card/index.js +4 -0
- package/dist/primitives/rule-card/index.js.map +1 -0
- package/dist/primitives/run-stats/index.js +4 -0
- package/dist/primitives/run-stats/index.js.map +1 -0
- package/dist/primitives/run-status-pill/index.js +4 -0
- package/dist/primitives/run-status-pill/index.js.map +1 -0
- package/dist/primitives/running-tasks-panel/index.js +4 -0
- package/dist/primitives/running-tasks-panel/index.js.map +1 -0
- package/dist/primitives/scroll-area/index.js +4 -0
- package/dist/primitives/scroll-area/index.js.map +1 -0
- package/dist/primitives/select/index.js +4 -0
- package/dist/primitives/select/index.js.map +1 -0
- package/dist/primitives/session-list-item/index.js +4 -0
- package/dist/primitives/session-list-item/index.js.map +1 -0
- package/dist/primitives/session-timeline/index.js +4 -0
- package/dist/primitives/session-timeline/index.js.map +1 -0
- package/dist/primitives/sheet/index.js +4 -0
- package/dist/primitives/sheet/index.js.map +1 -0
- package/dist/primitives/sidebar/index.js +4 -0
- package/dist/primitives/sidebar/index.js.map +1 -0
- package/dist/primitives/skeleton/index.js +5 -0
- package/dist/primitives/skeleton/index.js.map +1 -0
- package/dist/primitives/skill-card/index.js +4 -0
- package/dist/primitives/skill-card/index.js.map +1 -0
- package/dist/primitives/social-auth-row/index.js +4 -0
- package/dist/primitives/social-auth-row/index.js.map +1 -0
- package/dist/primitives/stat-tile/index.js +4 -0
- package/dist/primitives/stat-tile/index.js.map +1 -0
- package/dist/primitives/status-dot/index.js +4 -0
- package/dist/primitives/status-dot/index.js.map +1 -0
- package/dist/primitives/steps-rail/index.js +4 -0
- package/dist/primitives/steps-rail/index.js.map +1 -0
- package/dist/primitives/sub-agent-dispatch/index.js +4 -0
- package/dist/primitives/sub-agent-dispatch/index.js.map +1 -0
- package/dist/primitives/switch/index.js +4 -0
- package/dist/primitives/switch/index.js.map +1 -0
- package/dist/primitives/system-prompt-editor/index.js +4 -0
- package/dist/primitives/system-prompt-editor/index.js.map +1 -0
- package/dist/primitives/table/index.js +4 -0
- package/dist/primitives/table/index.js.map +1 -0
- package/dist/primitives/tabs/index.js +4 -0
- package/dist/primitives/tabs/index.js.map +1 -0
- package/dist/primitives/task-plan/index.js +4 -0
- package/dist/primitives/task-plan/index.js.map +1 -0
- package/dist/primitives/terminal-panel/index.js +5 -0
- package/dist/primitives/terminal-panel/index.js.map +1 -0
- package/dist/primitives/textarea/index.js +4 -0
- package/dist/primitives/textarea/index.js.map +1 -0
- package/dist/primitives/thinking-level-selector/index.js +4 -0
- package/dist/primitives/thinking-level-selector/index.js.map +1 -0
- package/dist/primitives/timestamp/index.js +4 -0
- package/dist/primitives/timestamp/index.js.map +1 -0
- package/dist/primitives/toast/index.js +4 -0
- package/dist/primitives/toast/index.js.map +1 -0
- package/dist/primitives/token-usage-chart/index.js +4 -0
- package/dist/primitives/token-usage-chart/index.js.map +1 -0
- package/dist/primitives/tool-call/index.js +4 -0
- package/dist/primitives/tool-call/index.js.map +1 -0
- package/dist/primitives/tool-call-card/index.js +4 -0
- package/dist/primitives/tool-call-card/index.js.map +1 -0
- package/dist/primitives/tool-result/index.js +4 -0
- package/dist/primitives/tool-result/index.js.map +1 -0
- package/dist/primitives/tools-list/index.js +4 -0
- package/dist/primitives/tools-list/index.js.map +1 -0
- package/dist/primitives/tooltip/index.js +4 -0
- package/dist/primitives/tooltip/index.js.map +1 -0
- package/dist/primitives/topnav/index.js +4 -0
- package/dist/primitives/topnav/index.js.map +1 -0
- package/dist/primitives/update-banner/index.js +4 -0
- package/dist/primitives/update-banner/index.js.map +1 -0
- package/dist/slide/index.d.ts +212 -0
- package/dist/slide/index.js +3 -0
- package/dist/slide/index.js.map +1 -0
- package/dist/slide/plugins/emoji/index.d.ts +29 -0
- package/dist/slide/plugins/emoji/index.js +157 -0
- package/dist/slide/plugins/emoji/index.js.map +1 -0
- package/dist/slide/plugins/math/index.d.ts +13 -0
- package/dist/slide/plugins/math/index.js +145 -0
- package/dist/slide/plugins/math/index.js.map +1 -0
- package/dist/slide/plugins/mermaid/index.d.ts +55 -0
- package/dist/slide/plugins/mermaid/index.js +218 -0
- package/dist/slide/plugins/mermaid/index.js.map +1 -0
- package/dist/slide/plugins/shiki/index.d.ts +18 -0
- package/dist/slide/plugins/shiki/index.js +87 -0
- package/dist/slide/plugins/shiki/index.js.map +1 -0
- package/dist/slide/themes/default.css +256 -0
- package/dist/slide/themes/layouts.css +143 -0
- package/dist/slide/themes/violet-forge.css +256 -0
- package/dist/slide-deck/index.css +52 -0
- package/dist/slide-deck/index.css.map +1 -0
- package/dist/slide-deck/index.d.ts +377 -0
- package/dist/slide-deck/index.js +1111 -0
- package/dist/slide-deck/index.js.map +1 -0
- package/dist/styles-v3-legacy.css +88 -0
- package/dist/styles.css +137 -0
- package/dist/tokens-v4.css +187 -0
- package/dist/tokens.css +230 -0
- package/dist/vite-plugin.d.ts +29 -0
- package/dist/vite-plugin.js +76 -0
- package/dist/vite-plugin.js.map +1 -0
- package/dist/whiteboard/index.d.ts +258 -0
- package/dist/whiteboard/index.js +738 -0
- package/dist/whiteboard/index.js.map +1 -0
- package/llms.txt +273 -0
- package/package.json +800 -0
- package/registry/index.json +856 -0
- package/registry/r/account-menu.json +24 -0
- package/registry/r/action-bar.json +22 -0
- package/registry/r/agent-composer.json +22 -0
- package/registry/r/agent-editor.json +27 -0
- package/registry/r/agent-error-card.json +22 -0
- package/registry/r/agent-event.json +24 -0
- package/registry/r/agent-handoff.json +22 -0
- package/registry/r/agent-profile.json +23 -0
- package/registry/r/agent-starting-state.json +22 -0
- package/registry/r/agent-stream.json +27 -0
- package/registry/r/agent-streaming.json +22 -0
- package/registry/r/agent-timeline.json +22 -0
- package/registry/r/agent-types.json +15 -0
- package/registry/r/alert.json +22 -0
- package/registry/r/approval-card.json +25 -0
- package/registry/r/artifact-preview.json +22 -0
- package/registry/r/attachment-chip.json +24 -0
- package/registry/r/audit-log-entry.json +23 -0
- package/registry/r/auto-compact-notice.json +22 -0
- package/registry/r/avatar.json +23 -0
- package/registry/r/badge.json +22 -0
- package/registry/r/browser-controls.json +22 -0
- package/registry/r/build-log-stream.json +19 -0
- package/registry/r/button.json +23 -0
- package/registry/r/capability-indicator.json +23 -0
- package/registry/r/card.json +22 -0
- package/registry/r/chat-composer.json +23 -0
- package/registry/r/chat-message.json +129 -0
- package/registry/r/chat-thread.json +20 -0
- package/registry/r/chat-types.json +15 -0
- package/registry/r/checkbox.json +24 -0
- package/registry/r/cn.json +19 -0
- package/registry/r/code-block.json +21 -0
- package/registry/r/command-palette.json +25 -0
- package/registry/r/confirm-dialog.json +25 -0
- package/registry/r/context-card.json +23 -0
- package/registry/r/context-window-bar.json +20 -0
- package/registry/r/copy-button.json +22 -0
- package/registry/r/cost-meter.json +22 -0
- package/registry/r/created-files-card.json +23 -0
- package/registry/r/cron-job-card.json +22 -0
- package/registry/r/cron-jobs-list.json +23 -0
- package/registry/r/danger-zone.json +20 -0
- package/registry/r/data-table.json +27 -0
- package/registry/r/deployment-row.json +23 -0
- package/registry/r/dialog.json +23 -0
- package/registry/r/diff-viewer.json +20 -0
- package/registry/r/domain-config.json +25 -0
- package/registry/r/dropdown-menu.json +23 -0
- package/registry/r/empty-state.json +20 -0
- package/registry/r/env-var-editor.json +25 -0
- package/registry/r/folder-context-card.json +23 -0
- package/registry/r/folder-selector.json +22 -0
- package/registry/r/form-field.json +23 -0
- package/registry/r/hook-config.json +22 -0
- package/registry/r/hook-event-log.json +22 -0
- package/registry/r/input.json +22 -0
- package/registry/r/intent-selector.json +24 -0
- package/registry/r/label.json +22 -0
- package/registry/r/lane-board.json +20 -0
- package/registry/r/live-region-context.json +16 -0
- package/registry/r/login-split.json +20 -0
- package/registry/r/mcp-server-card.json +22 -0
- package/registry/r/mcp-server-list.json +23 -0
- package/registry/r/memory-editor.json +23 -0
- package/registry/r/mention-menu.json +23 -0
- package/registry/r/metrics-panel.json +22 -0
- package/registry/r/mode-types.json +15 -0
- package/registry/r/model-card.json +23 -0
- package/registry/r/model-selector.json +23 -0
- package/registry/r/page-shell.json +25 -0
- package/registry/r/pagination.json +22 -0
- package/registry/r/permission-matrix.json +22 -0
- package/registry/r/permission-modal.json +24 -0
- package/registry/r/permission-types.json +15 -0
- package/registry/r/pin-input.json +20 -0
- package/registry/r/plan-badge.json +20 -0
- package/registry/r/preview-env-card.json +25 -0
- package/registry/r/preview-panel.json +21 -0
- package/registry/r/progress-checklist.json +23 -0
- package/registry/r/progress.json +20 -0
- package/registry/r/project-card.json +25 -0
- package/registry/r/project-switcher.json +22 -0
- package/registry/r/quick-action-chips.json +21 -0
- package/registry/r/radio-group.json +23 -0
- package/registry/r/recent-folders-list.json +22 -0
- package/registry/r/rollback-ui.json +24 -0
- package/registry/r/rule-card.json +23 -0
- package/registry/r/rule-editor.json +28 -0
- package/registry/r/rule-types.json +18 -0
- package/registry/r/run-stats.json +22 -0
- package/registry/r/running-tasks-panel.json +22 -0
- package/registry/r/safe-href.json +16 -0
- package/registry/r/scroll-area.json +22 -0
- package/registry/r/select.json +24 -0
- package/registry/r/session-list-item.json +20 -0
- package/registry/r/session-timeline.json +22 -0
- package/registry/r/sheet.json +24 -0
- package/registry/r/sidebar.json +19 -0
- package/registry/r/skeleton.json +19 -0
- package/registry/r/skill-card.json +24 -0
- package/registry/r/skill-editor.json +28 -0
- package/registry/r/skills-list.json +23 -0
- package/registry/r/slide-deck.json +130 -0
- package/registry/r/slide-plugin-emoji.json +28 -0
- package/registry/r/slide-plugin-math.json +24 -0
- package/registry/r/slide-plugin-mermaid.json +23 -0
- package/registry/r/slide-plugin-shiki.json +23 -0
- package/registry/r/slide.json +123 -0
- package/registry/r/social-auth-row.json +21 -0
- package/registry/r/stat-tile.json +22 -0
- package/registry/r/status-dot.json +20 -0
- package/registry/r/steps-rail.json +20 -0
- package/registry/r/sub-agent-dispatch.json +22 -0
- package/registry/r/switch.json +23 -0
- package/registry/r/system-prompt-editor.json +22 -0
- package/registry/r/table.json +22 -0
- package/registry/r/tabs.json +22 -0
- package/registry/r/tailwind-preset.json +19 -0
- package/registry/r/task-header.json +24 -0
- package/registry/r/task-plan.json +22 -0
- package/registry/r/task-types.json +15 -0
- package/registry/r/terminal-panel.json +22 -0
- package/registry/r/textarea.json +22 -0
- package/registry/r/theme-provider.json +59 -0
- package/registry/r/theme-script.json +18 -0
- package/registry/r/theo-ui-provider.json +20 -0
- package/registry/r/timestamp.json +20 -0
- package/registry/r/toast.json +30 -0
- package/registry/r/token-usage-chart.json +20 -0
- package/registry/r/tokens.json +21 -0
- package/registry/r/tool-call-card.json +23 -0
- package/registry/r/tool-call.json +22 -0
- package/registry/r/tool-result.json +20 -0
- package/registry/r/tools-list.json +23 -0
- package/registry/r/tooltip.json +22 -0
- package/registry/r/topnav.json +22 -0
- package/registry/r/types.json +15 -0
- package/registry/r/usage-meter.json +21 -0
- package/registry/r/whiteboard.json +101 -0
|
@@ -0,0 +1,714 @@
|
|
|
1
|
+
import { useState, useEffect, useRef, useMemo } from 'react';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// src/components/primitives/slide/slide.tsx
|
|
6
|
+
|
|
7
|
+
// src/components/primitives/slide/alerts.ts
|
|
8
|
+
var ALERT_RE = /^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\][ \t]*(?:\r?\n|$)/i;
|
|
9
|
+
function detectAlerts(tree) {
|
|
10
|
+
for (const node of tree.children) {
|
|
11
|
+
if (node.type !== "blockquote") continue;
|
|
12
|
+
transformIfAlert(node);
|
|
13
|
+
}
|
|
14
|
+
return tree;
|
|
15
|
+
}
|
|
16
|
+
function transformIfAlert(node) {
|
|
17
|
+
const firstChild = node.children[0];
|
|
18
|
+
if (!firstChild || firstChild.type !== "paragraph") return;
|
|
19
|
+
const paragraph = firstChild;
|
|
20
|
+
const firstInline = paragraph.children[0];
|
|
21
|
+
if (!firstInline || firstInline.type !== "text") return;
|
|
22
|
+
const text = firstInline;
|
|
23
|
+
const match = ALERT_RE.exec(text.value);
|
|
24
|
+
if (!match) return;
|
|
25
|
+
const matched = match[1];
|
|
26
|
+
if (!matched) return;
|
|
27
|
+
const type = matched.toLowerCase();
|
|
28
|
+
text.value = text.value.replace(ALERT_RE, "");
|
|
29
|
+
if (text.value === "" && paragraph.children.length > 1) {
|
|
30
|
+
paragraph.children.shift();
|
|
31
|
+
}
|
|
32
|
+
node.data = {
|
|
33
|
+
...node.data,
|
|
34
|
+
hName: "aside",
|
|
35
|
+
hProperties: {
|
|
36
|
+
...node.data?.hProperties ?? {},
|
|
37
|
+
className: ["theo-slide-alert"],
|
|
38
|
+
"data-theo-slide-alert-type": type
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// src/components/primitives/slide/marpit-bg.ts
|
|
44
|
+
var BG_ALT_RE = /^bg(?:\s+(\w+))?/i;
|
|
45
|
+
var VALID_MODIFIERS = /* @__PURE__ */ new Set(["cover", "fit", "left", "right"]);
|
|
46
|
+
function extractMarpitBackgrounds(tree) {
|
|
47
|
+
let background;
|
|
48
|
+
const filteredChildren = tree.children.filter((node) => {
|
|
49
|
+
if (node.type !== "paragraph") return true;
|
|
50
|
+
const p = node;
|
|
51
|
+
if (p.children.length !== 1) return true;
|
|
52
|
+
const child = p.children[0];
|
|
53
|
+
if (!child || child.type !== "image") return true;
|
|
54
|
+
const img = child;
|
|
55
|
+
const match = BG_ALT_RE.exec(img.alt ?? "");
|
|
56
|
+
if (!match) return true;
|
|
57
|
+
if (!background) {
|
|
58
|
+
const modifierRaw = match[1]?.toLowerCase();
|
|
59
|
+
const modifier = modifierRaw && VALID_MODIFIERS.has(modifierRaw) ? modifierRaw : void 0;
|
|
60
|
+
background = {
|
|
61
|
+
url: img.url,
|
|
62
|
+
modifier
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
return false;
|
|
66
|
+
});
|
|
67
|
+
return {
|
|
68
|
+
tree: { ...tree, children: filteredChildren },
|
|
69
|
+
background
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// src/components/primitives/slide/plugin.ts
|
|
74
|
+
function composePlugins(plugins) {
|
|
75
|
+
return {
|
|
76
|
+
async runMdast(tree, errors) {
|
|
77
|
+
let current = tree;
|
|
78
|
+
for (const p of plugins) {
|
|
79
|
+
if (!p.mdastTransform) continue;
|
|
80
|
+
const previous = current;
|
|
81
|
+
try {
|
|
82
|
+
const result = await p.mdastTransform(current);
|
|
83
|
+
if (!result || result.type !== "root") {
|
|
84
|
+
throw new Error("mdastTransform returned non-Root node");
|
|
85
|
+
}
|
|
86
|
+
current = result;
|
|
87
|
+
} catch (e) {
|
|
88
|
+
current = previous;
|
|
89
|
+
errors.push(makePluginError(p.name, "mdastTransform", e));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return current;
|
|
93
|
+
},
|
|
94
|
+
async runHast(tree, errors) {
|
|
95
|
+
let current = tree;
|
|
96
|
+
for (const p of plugins) {
|
|
97
|
+
if (!p.hastTransform) continue;
|
|
98
|
+
const previous = current;
|
|
99
|
+
try {
|
|
100
|
+
const result = await p.hastTransform(current);
|
|
101
|
+
if (!result || result.type !== "root") {
|
|
102
|
+
throw new Error("hastTransform returned non-Root node");
|
|
103
|
+
}
|
|
104
|
+
current = result;
|
|
105
|
+
} catch (e) {
|
|
106
|
+
current = previous;
|
|
107
|
+
errors.push(makePluginError(p.name, "hastTransform", e));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return current;
|
|
111
|
+
},
|
|
112
|
+
mergedComponents() {
|
|
113
|
+
const out = {};
|
|
114
|
+
for (const p of plugins) {
|
|
115
|
+
if (p.components) Object.assign(out, p.components);
|
|
116
|
+
}
|
|
117
|
+
return out;
|
|
118
|
+
},
|
|
119
|
+
mergedSanitizeExtensions() {
|
|
120
|
+
const tagNames = /* @__PURE__ */ new Set();
|
|
121
|
+
const attributes = {};
|
|
122
|
+
for (const p of plugins) {
|
|
123
|
+
const ext = p.sanitizeSchemaExtension;
|
|
124
|
+
if (!ext) continue;
|
|
125
|
+
if (ext.tagNames) {
|
|
126
|
+
for (const tag of ext.tagNames) tagNames.add(tag);
|
|
127
|
+
}
|
|
128
|
+
if (ext.attributes) {
|
|
129
|
+
for (const [tag, attrs] of Object.entries(ext.attributes)) {
|
|
130
|
+
if (!attributes[tag]) attributes[tag] = /* @__PURE__ */ new Set();
|
|
131
|
+
for (const a of attrs) attributes[tag].add(a);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const mergedAttrs = {};
|
|
136
|
+
for (const [tag, set] of Object.entries(attributes)) {
|
|
137
|
+
mergedAttrs[tag] = Array.from(set);
|
|
138
|
+
}
|
|
139
|
+
return {
|
|
140
|
+
tagNames: Array.from(tagNames),
|
|
141
|
+
attributes: mergedAttrs
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function makePluginError(name, hook, e) {
|
|
147
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
148
|
+
return {
|
|
149
|
+
code: "PLUGIN_ERROR",
|
|
150
|
+
path: [],
|
|
151
|
+
message: `Plugin '${name}' failed in ${hook}: ${msg}`,
|
|
152
|
+
got: name
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// src/components/primitives/slide/sanitize.ts
|
|
157
|
+
var cachedBuiltSchema;
|
|
158
|
+
var TIER_1_TAG_NAMES = ["aside"];
|
|
159
|
+
var TIER_1_ATTRIBUTES = {
|
|
160
|
+
aside: ["className", "data-theo-slide-alert-type"],
|
|
161
|
+
"*": ["className"]
|
|
162
|
+
};
|
|
163
|
+
async function getSlideSanitizeSchema(extensions) {
|
|
164
|
+
const baseline = await getBaselineSchema();
|
|
165
|
+
if (!extensions || extensions.tagNames.length === 0 && Object.keys(extensions.attributes).length === 0) {
|
|
166
|
+
return baseline;
|
|
167
|
+
}
|
|
168
|
+
return mergeSchema(baseline, extensions);
|
|
169
|
+
}
|
|
170
|
+
async function getBaselineSchema() {
|
|
171
|
+
if (cachedBuiltSchema) return cachedBuiltSchema;
|
|
172
|
+
const { defaultSchema } = await import('hast-util-sanitize');
|
|
173
|
+
cachedBuiltSchema = mergeSchema(defaultSchema, {
|
|
174
|
+
tagNames: TIER_1_TAG_NAMES,
|
|
175
|
+
attributes: TIER_1_ATTRIBUTES
|
|
176
|
+
});
|
|
177
|
+
return cachedBuiltSchema;
|
|
178
|
+
}
|
|
179
|
+
function mergeSchema(base, extensions) {
|
|
180
|
+
const baseTagNames = base.tagNames ?? [];
|
|
181
|
+
const tagSet = new Set(baseTagNames);
|
|
182
|
+
for (const t of extensions.tagNames) tagSet.add(t);
|
|
183
|
+
const baseAttrs = base.attributes ?? {};
|
|
184
|
+
const mergedAttrs = { ...baseAttrs };
|
|
185
|
+
for (const [tag, attrs] of Object.entries(extensions.attributes)) {
|
|
186
|
+
const baseline = mergedAttrs[tag] ?? [];
|
|
187
|
+
const seen = /* @__PURE__ */ new Set();
|
|
188
|
+
const combined = [];
|
|
189
|
+
for (const a of baseline) {
|
|
190
|
+
const key = typeof a === "string" ? a : JSON.stringify(a);
|
|
191
|
+
if (!seen.has(key)) {
|
|
192
|
+
seen.add(key);
|
|
193
|
+
combined.push(a);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
for (const a of attrs) {
|
|
197
|
+
if (!seen.has(a)) {
|
|
198
|
+
seen.add(a);
|
|
199
|
+
combined.push(a);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
mergedAttrs[tag] = combined;
|
|
203
|
+
}
|
|
204
|
+
return {
|
|
205
|
+
...base,
|
|
206
|
+
tagNames: Array.from(tagSet),
|
|
207
|
+
attributes: mergedAttrs
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function collectTagCounts(tree) {
|
|
211
|
+
const counts = /* @__PURE__ */ new Map();
|
|
212
|
+
const walk = (node) => {
|
|
213
|
+
if (node.type === "element") {
|
|
214
|
+
const tag = node.tagName;
|
|
215
|
+
counts.set(tag, (counts.get(tag) ?? 0) + 1);
|
|
216
|
+
}
|
|
217
|
+
const children = node.children;
|
|
218
|
+
if (Array.isArray(children)) {
|
|
219
|
+
for (const child of children) {
|
|
220
|
+
if (child && typeof child === "object" && "type" in child) {
|
|
221
|
+
walk(child);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
walk(tree);
|
|
227
|
+
return counts;
|
|
228
|
+
}
|
|
229
|
+
var slideTheme = z.enum(["default", "violet-forge"]);
|
|
230
|
+
var slideLayout = z.enum([
|
|
231
|
+
"default",
|
|
232
|
+
"title",
|
|
233
|
+
"two-column",
|
|
234
|
+
"image-right",
|
|
235
|
+
"image-left",
|
|
236
|
+
"code-output",
|
|
237
|
+
"section"
|
|
238
|
+
]);
|
|
239
|
+
var cssColor = z.string().max(64);
|
|
240
|
+
var langTag = z.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/, "Expected BCP-47 language tag").max(35);
|
|
241
|
+
var SAFE_URL_SCHEMES = ["http://", "https://"];
|
|
242
|
+
function sanitizeBgUrl(input) {
|
|
243
|
+
try {
|
|
244
|
+
const trimmed = input.trim();
|
|
245
|
+
const url = trimmed.startsWith("url(") ? trimmed.replace(/^url\(\s*['"]?/, "").replace(/['"]?\s*\)$/, "") : trimmed;
|
|
246
|
+
const lower = url.toLowerCase();
|
|
247
|
+
if (lower.startsWith("javascript:") || lower.startsWith("vbscript:")) return null;
|
|
248
|
+
if (lower.startsWith("data:")) return null;
|
|
249
|
+
if (!SAFE_URL_SCHEMES.some((s) => lower.startsWith(s))) return null;
|
|
250
|
+
new URL(url);
|
|
251
|
+
return url;
|
|
252
|
+
} catch {
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
var slideFrontmatter = z.object({
|
|
257
|
+
theme: slideTheme.optional(),
|
|
258
|
+
/** Rich-content T2: built-in layout (CSS grid). */
|
|
259
|
+
layout: slideLayout.optional(),
|
|
260
|
+
/** Rich-content T3: background URL (sanitized: http(s) only). */
|
|
261
|
+
backgroundImage: z.string().max(5e5).transform((v) => {
|
|
262
|
+
if (!v) return void 0;
|
|
263
|
+
const sanitized = sanitizeBgUrl(v);
|
|
264
|
+
return sanitized ?? void 0;
|
|
265
|
+
}).optional(),
|
|
266
|
+
/** Rich-content T3: CSS gradient string (validated by prefix). */
|
|
267
|
+
backgroundGradient: z.string().max(500).regex(
|
|
268
|
+
/^(linear|radial|conic)-gradient\(/i,
|
|
269
|
+
"Must start with linear-/radial-/conic-gradient("
|
|
270
|
+
).optional(),
|
|
271
|
+
/** Rich-content T5: header overlay text (plain, ≤ 200 chars). */
|
|
272
|
+
header: z.string().max(200).optional(),
|
|
273
|
+
/** Rich-content T5: footer overlay text (plain, ≤ 200 chars). */
|
|
274
|
+
footer: z.string().max(200).optional(),
|
|
275
|
+
/** Rich-content T5: pagination — `true` shows page number, `"skip"` hides. */
|
|
276
|
+
paginate: z.union([z.boolean(), z.literal("skip"), z.literal("hold")]).optional(),
|
|
277
|
+
lang: langTag.optional(),
|
|
278
|
+
color: cssColor.optional(),
|
|
279
|
+
backgroundColor: cssColor.optional()
|
|
280
|
+
}).strict();
|
|
281
|
+
var slideInput = z.object({
|
|
282
|
+
frontmatter: slideFrontmatter,
|
|
283
|
+
body: z.string().max(5e4)
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
// src/components/primitives/slide/frontmatter.ts
|
|
287
|
+
var MAX_RAW_FRONTMATTER = 10240;
|
|
288
|
+
var FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/;
|
|
289
|
+
var BOM = "\uFEFF";
|
|
290
|
+
function extractFrontmatter(md) {
|
|
291
|
+
const normalized = md.startsWith(BOM) ? md.slice(1) : md;
|
|
292
|
+
const match = FRONTMATTER_RE.exec(normalized);
|
|
293
|
+
if (!match) {
|
|
294
|
+
return { rawFrontmatter: null, body: normalized };
|
|
295
|
+
}
|
|
296
|
+
const raw = match[1] ?? "";
|
|
297
|
+
const body = match[2] ?? "";
|
|
298
|
+
if (raw.length > MAX_RAW_FRONTMATTER) {
|
|
299
|
+
return { rawFrontmatter: raw, body, tooLarge: true };
|
|
300
|
+
}
|
|
301
|
+
return { rawFrontmatter: raw, body };
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// src/components/primitives/slide/validate.ts
|
|
305
|
+
var MAX_BODY = 5e4;
|
|
306
|
+
function valueAtPath(input, path) {
|
|
307
|
+
let cursor = input;
|
|
308
|
+
for (const segment of path) {
|
|
309
|
+
if (cursor === null || typeof cursor !== "object") return void 0;
|
|
310
|
+
cursor = cursor[segment];
|
|
311
|
+
}
|
|
312
|
+
return cursor;
|
|
313
|
+
}
|
|
314
|
+
function formatZodIssue(issue, input, pathPrefix) {
|
|
315
|
+
const error = {
|
|
316
|
+
path: [...pathPrefix, ...issue.path],
|
|
317
|
+
message: issue.message,
|
|
318
|
+
code: "INVALID_FRONTMATTER"
|
|
319
|
+
};
|
|
320
|
+
if ("received" in issue && issue.received !== void 0) {
|
|
321
|
+
error.got = issue.received;
|
|
322
|
+
} else if (issue.path.length > 0) {
|
|
323
|
+
const value = valueAtPath(input, issue.path);
|
|
324
|
+
if (value !== void 0) error.got = value;
|
|
325
|
+
}
|
|
326
|
+
return error;
|
|
327
|
+
}
|
|
328
|
+
async function detectMultiSlide(body) {
|
|
329
|
+
const { fromMarkdown } = await import('mdast-util-from-markdown');
|
|
330
|
+
const tree = fromMarkdown(body);
|
|
331
|
+
const hrIdx = tree.children.findIndex((n) => n.type === "thematicBreak");
|
|
332
|
+
if (hrIdx === -1) {
|
|
333
|
+
return { multi: false, firstSlideBody: body };
|
|
334
|
+
}
|
|
335
|
+
const firstHr = tree.children[hrIdx];
|
|
336
|
+
const offset = firstHr?.position?.start.offset;
|
|
337
|
+
if (typeof offset !== "number") {
|
|
338
|
+
return { multi: true, firstSlideBody: body };
|
|
339
|
+
}
|
|
340
|
+
return { multi: true, firstSlideBody: body.slice(0, offset) };
|
|
341
|
+
}
|
|
342
|
+
async function validateSlide(markdown) {
|
|
343
|
+
const errors = [];
|
|
344
|
+
const extracted = extractFrontmatter(markdown);
|
|
345
|
+
if (extracted.tooLarge) {
|
|
346
|
+
errors.push({
|
|
347
|
+
code: "FRONTMATTER_TOO_LARGE",
|
|
348
|
+
path: [],
|
|
349
|
+
message: `Raw frontmatter exceeds ${10240} bytes.`,
|
|
350
|
+
got: extracted.rawFrontmatter?.length
|
|
351
|
+
});
|
|
352
|
+
return { ok: false, errors };
|
|
353
|
+
}
|
|
354
|
+
let frontmatter = {};
|
|
355
|
+
if (extracted.rawFrontmatter !== null) {
|
|
356
|
+
let parsed;
|
|
357
|
+
try {
|
|
358
|
+
const yaml = await import('yaml');
|
|
359
|
+
parsed = yaml.parse(extracted.rawFrontmatter);
|
|
360
|
+
} catch (e) {
|
|
361
|
+
errors.push({
|
|
362
|
+
code: "INVALID_FRONTMATTER",
|
|
363
|
+
path: [],
|
|
364
|
+
message: e instanceof Error ? e.message : "YAML parse failed.",
|
|
365
|
+
got: extracted.rawFrontmatter
|
|
366
|
+
});
|
|
367
|
+
return { ok: false, errors };
|
|
368
|
+
}
|
|
369
|
+
if (parsed === null || parsed === void 0) {
|
|
370
|
+
frontmatter = {};
|
|
371
|
+
} else if (typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
372
|
+
errors.push({
|
|
373
|
+
code: "INVALID_FRONTMATTER",
|
|
374
|
+
path: [],
|
|
375
|
+
message: "Frontmatter must be a YAML mapping (object).",
|
|
376
|
+
got: parsed
|
|
377
|
+
});
|
|
378
|
+
return { ok: false, errors };
|
|
379
|
+
} else {
|
|
380
|
+
const result = slideFrontmatter.safeParse(parsed);
|
|
381
|
+
if (!result.success) {
|
|
382
|
+
for (const issue of result.error.issues) {
|
|
383
|
+
errors.push(formatZodIssue(issue, parsed, []));
|
|
384
|
+
}
|
|
385
|
+
return { ok: false, errors };
|
|
386
|
+
}
|
|
387
|
+
frontmatter = result.data;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
let body = extracted.body;
|
|
391
|
+
if (body.length > MAX_BODY) {
|
|
392
|
+
errors.push({
|
|
393
|
+
code: "CONTENT_TOO_LARGE",
|
|
394
|
+
path: ["body"],
|
|
395
|
+
message: `Body exceeds ${MAX_BODY} characters.`,
|
|
396
|
+
got: body.length
|
|
397
|
+
});
|
|
398
|
+
return { ok: false, errors };
|
|
399
|
+
}
|
|
400
|
+
const multi = await detectMultiSlide(body);
|
|
401
|
+
if (multi.multi) {
|
|
402
|
+
body = multi.firstSlideBody;
|
|
403
|
+
errors.push({
|
|
404
|
+
code: "MULTIPLE_SLIDES",
|
|
405
|
+
path: ["body"],
|
|
406
|
+
message: "Input contains a top-level thematic break (---). <Slide> renders single-slide markdown only. Only the first slide was rendered."
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
return { ok: true, input: { frontmatter, body }, errors };
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// src/components/primitives/slide/parse.ts
|
|
413
|
+
async function parseBody(body) {
|
|
414
|
+
const [{ fromMarkdown }, { gfmFromMarkdown }, { gfm }] = await Promise.all([
|
|
415
|
+
import('mdast-util-from-markdown'),
|
|
416
|
+
import('mdast-util-gfm'),
|
|
417
|
+
import('micromark-extension-gfm')
|
|
418
|
+
]);
|
|
419
|
+
return fromMarkdown(body, {
|
|
420
|
+
extensions: [gfm()],
|
|
421
|
+
mdastExtensions: [gfmFromMarkdown()]
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
async function mdastToHast(tree) {
|
|
425
|
+
const { toHast } = await import('mdast-util-to-hast');
|
|
426
|
+
const hast = toHast(tree, { allowDangerousHtml: false });
|
|
427
|
+
if (!hast || hast.type !== "root") {
|
|
428
|
+
return { type: "root", children: hast ? [hast] : [] };
|
|
429
|
+
}
|
|
430
|
+
return hast;
|
|
431
|
+
}
|
|
432
|
+
async function sanitizeHast(tree, extensions) {
|
|
433
|
+
const schema = await getSlideSanitizeSchema(extensions);
|
|
434
|
+
const { sanitize } = await import('hast-util-sanitize');
|
|
435
|
+
const preCount = collectTagCounts(tree);
|
|
436
|
+
const safe = sanitize(tree, schema);
|
|
437
|
+
const safeRoot = safe.type === "root" ? safe : { type: "root", children: [safe] };
|
|
438
|
+
const postCount = collectTagCounts(safeRoot);
|
|
439
|
+
const bannedTags = [];
|
|
440
|
+
for (const [tag, before] of preCount) {
|
|
441
|
+
const after = postCount.get(tag) ?? 0;
|
|
442
|
+
if (after < before) {
|
|
443
|
+
bannedTags.push(tag);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
return { tree: safeRoot, bannedTags };
|
|
447
|
+
}
|
|
448
|
+
async function hastToReact(tree, components) {
|
|
449
|
+
const { Fragment, jsx: jsx2, jsxs: jsxs2 } = await import('react/jsx-runtime');
|
|
450
|
+
const { toJsxRuntime } = await import('hast-util-to-jsx-runtime');
|
|
451
|
+
return toJsxRuntime(tree, {
|
|
452
|
+
Fragment,
|
|
453
|
+
jsx: jsx2,
|
|
454
|
+
jsxs: jsxs2,
|
|
455
|
+
components
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
async function parseSlide(markdown, opts = {}) {
|
|
459
|
+
const errors = [];
|
|
460
|
+
let frontmatter = {};
|
|
461
|
+
let body = markdown;
|
|
462
|
+
let truncated = false;
|
|
463
|
+
const validation = await validateSlide(markdown);
|
|
464
|
+
if (validation.ok) {
|
|
465
|
+
frontmatter = validation.input.frontmatter;
|
|
466
|
+
body = validation.input.body;
|
|
467
|
+
errors.push(...validation.errors);
|
|
468
|
+
truncated = validation.errors.some((e) => e.code === "MULTIPLE_SLIDES");
|
|
469
|
+
} else {
|
|
470
|
+
errors.push(...validation.errors);
|
|
471
|
+
body = markdown;
|
|
472
|
+
}
|
|
473
|
+
const compose = composePlugins(opts.plugins ?? []);
|
|
474
|
+
const rawMdast = await parseBody(body);
|
|
475
|
+
detectAlerts(rawMdast);
|
|
476
|
+
const { tree: mdastNoBg, background: marpitBg } = extractMarpitBackgrounds(rawMdast);
|
|
477
|
+
let extractedBackground;
|
|
478
|
+
if (marpitBg) {
|
|
479
|
+
const safeUrl = sanitizeBgUrl(marpitBg.url);
|
|
480
|
+
if (safeUrl) {
|
|
481
|
+
extractedBackground = { url: safeUrl, modifier: marpitBg.modifier };
|
|
482
|
+
} else {
|
|
483
|
+
errors.push({
|
|
484
|
+
code: "MARPIT_BG_UNSAFE_URL",
|
|
485
|
+
path: [],
|
|
486
|
+
message: "Marpit  rejected: unsafe scheme or malformed URL.",
|
|
487
|
+
got: marpitBg.url.slice(0, 80)
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
const transformedMdast = await compose.runMdast(mdastNoBg, errors);
|
|
492
|
+
const rawHast = await mdastToHast(transformedMdast);
|
|
493
|
+
const transformedHast = await compose.runHast(rawHast, errors);
|
|
494
|
+
const sanitizeExtensions = compose.mergedSanitizeExtensions();
|
|
495
|
+
const { tree: safeTree, bannedTags } = await sanitizeHast(transformedHast, sanitizeExtensions);
|
|
496
|
+
for (const tag of bannedTags) {
|
|
497
|
+
errors.push({
|
|
498
|
+
code: "BANNED_TAG",
|
|
499
|
+
path: ["body"],
|
|
500
|
+
message: `Tag <${tag}> was stripped by the slide sanitizer.`,
|
|
501
|
+
got: tag
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
const mergedComponents = {
|
|
505
|
+
...opts.components ?? {},
|
|
506
|
+
...compose.mergedComponents()
|
|
507
|
+
};
|
|
508
|
+
const tree = await hastToReact(safeTree, mergedComponents);
|
|
509
|
+
return { frontmatter, tree, errors, truncated, extractedBackground };
|
|
510
|
+
}
|
|
511
|
+
function useSlideFit(ref, canvasW, canvasH, opts = {}) {
|
|
512
|
+
const { minScale = 0.1, maxScale = 4 } = opts;
|
|
513
|
+
const [scale, setScale] = useState(1);
|
|
514
|
+
useEffect(() => {
|
|
515
|
+
const el = ref.current;
|
|
516
|
+
if (!el) return;
|
|
517
|
+
if (typeof ResizeObserver === "undefined") {
|
|
518
|
+
const { width, height } = el.getBoundingClientRect();
|
|
519
|
+
if (width > 0 && height > 0) {
|
|
520
|
+
const raw = Math.min(width / canvasW, height / canvasH);
|
|
521
|
+
setScale(Math.max(minScale, Math.min(raw, maxScale)));
|
|
522
|
+
}
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
const update = () => {
|
|
526
|
+
const { width, height } = el.getBoundingClientRect();
|
|
527
|
+
if (width <= 0 || height <= 0) return;
|
|
528
|
+
const raw = Math.min(width / canvasW, height / canvasH);
|
|
529
|
+
const clamped = Math.max(minScale, Math.min(raw, maxScale));
|
|
530
|
+
if (Number.isFinite(clamped)) setScale(clamped);
|
|
531
|
+
};
|
|
532
|
+
update();
|
|
533
|
+
const ro = new ResizeObserver(update);
|
|
534
|
+
ro.observe(el);
|
|
535
|
+
return () => ro.disconnect();
|
|
536
|
+
}, [ref, canvasW, canvasH, minScale, maxScale]);
|
|
537
|
+
return scale;
|
|
538
|
+
}
|
|
539
|
+
var ASPECT_PRESETS = {
|
|
540
|
+
"16:9": { width: 1280, height: 720 },
|
|
541
|
+
"4:3": { width: 960, height: 720 }
|
|
542
|
+
};
|
|
543
|
+
function resolveCanvas(ar) {
|
|
544
|
+
if (!ar || ar === "16:9") return ASPECT_PRESETS["16:9"];
|
|
545
|
+
if (ar === "4:3") return ASPECT_PRESETS["4:3"];
|
|
546
|
+
if (ar.width <= 0 || ar.height <= 0 || !Number.isFinite(ar.width) || !Number.isFinite(ar.height)) {
|
|
547
|
+
return { ...ASPECT_PRESETS["16:9"], invalid: true };
|
|
548
|
+
}
|
|
549
|
+
return ar;
|
|
550
|
+
}
|
|
551
|
+
var Slide = ({
|
|
552
|
+
markdown,
|
|
553
|
+
theme = "default",
|
|
554
|
+
aspectRatio = "16:9",
|
|
555
|
+
minScale,
|
|
556
|
+
maxScale,
|
|
557
|
+
onValidationError,
|
|
558
|
+
components,
|
|
559
|
+
plugins,
|
|
560
|
+
className,
|
|
561
|
+
"aria-label": ariaLabel = "Slide"
|
|
562
|
+
}) => {
|
|
563
|
+
const containerRef = useRef(null);
|
|
564
|
+
const canvas = useMemo(() => resolveCanvas(aspectRatio), [aspectRatio]);
|
|
565
|
+
const scale = useSlideFit(containerRef, canvas.width, canvas.height, {
|
|
566
|
+
minScale,
|
|
567
|
+
maxScale
|
|
568
|
+
});
|
|
569
|
+
const [parsed, setParsed] = useState(null);
|
|
570
|
+
useEffect(() => {
|
|
571
|
+
if (canvas.invalid && onValidationError) {
|
|
572
|
+
onValidationError([
|
|
573
|
+
{
|
|
574
|
+
code: "INVALID_ASPECT_RATIO",
|
|
575
|
+
path: ["aspectRatio"],
|
|
576
|
+
message: "aspectRatio width/height must be positive finite numbers; falling back to 16:9.",
|
|
577
|
+
got: aspectRatio
|
|
578
|
+
}
|
|
579
|
+
]);
|
|
580
|
+
}
|
|
581
|
+
}, [canvas.invalid, onValidationError, aspectRatio]);
|
|
582
|
+
const versionRef = useRef(0);
|
|
583
|
+
useEffect(() => {
|
|
584
|
+
const myVersion = ++versionRef.current;
|
|
585
|
+
let cancelled = false;
|
|
586
|
+
parseSlide(markdown, { components, plugins }).then(
|
|
587
|
+
(result) => {
|
|
588
|
+
if (cancelled || myVersion !== versionRef.current) return;
|
|
589
|
+
setParsed(result);
|
|
590
|
+
if (result.errors.length > 0 && onValidationError) {
|
|
591
|
+
onValidationError(result.errors);
|
|
592
|
+
}
|
|
593
|
+
},
|
|
594
|
+
(err) => {
|
|
595
|
+
if (cancelled || myVersion !== versionRef.current) return;
|
|
596
|
+
if (onValidationError) {
|
|
597
|
+
onValidationError([
|
|
598
|
+
{
|
|
599
|
+
code: "INVALID_FRONTMATTER",
|
|
600
|
+
path: [],
|
|
601
|
+
message: err instanceof Error ? err.message : "parseSlide rejected."
|
|
602
|
+
}
|
|
603
|
+
]);
|
|
604
|
+
}
|
|
605
|
+
setParsed({
|
|
606
|
+
frontmatter: {},
|
|
607
|
+
tree: emptyFragment(),
|
|
608
|
+
errors: [],
|
|
609
|
+
truncated: false
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
);
|
|
613
|
+
return () => {
|
|
614
|
+
cancelled = true;
|
|
615
|
+
};
|
|
616
|
+
}, [markdown, components, plugins, onValidationError]);
|
|
617
|
+
const treeNode = parsed?.tree ?? null;
|
|
618
|
+
const slideThemeAttr = theme;
|
|
619
|
+
const fm = parsed?.frontmatter ?? {};
|
|
620
|
+
const layout = fm.layout;
|
|
621
|
+
const bgUrl = fm.backgroundImage ?? parsed?.extractedBackground?.url;
|
|
622
|
+
const bgModifier = parsed?.extractedBackground?.modifier;
|
|
623
|
+
const bgGradient = fm.backgroundGradient;
|
|
624
|
+
const headerText = fm.header;
|
|
625
|
+
const footerText = fm.footer;
|
|
626
|
+
const paginateValue = fm.paginate;
|
|
627
|
+
const showPaginate = paginateValue === true;
|
|
628
|
+
const backgroundImageStyle = bgGradient ? bgGradient : bgUrl ? `url("${bgUrl}")` : void 0;
|
|
629
|
+
return /* @__PURE__ */ jsx(
|
|
630
|
+
"div",
|
|
631
|
+
{
|
|
632
|
+
ref: containerRef,
|
|
633
|
+
className: ["theo-slide-host", className].filter(Boolean).join(" "),
|
|
634
|
+
"data-theo-slide-host": true,
|
|
635
|
+
style: {
|
|
636
|
+
position: "relative",
|
|
637
|
+
overflow: "hidden",
|
|
638
|
+
width: "100%",
|
|
639
|
+
height: "100%"
|
|
640
|
+
},
|
|
641
|
+
children: /* @__PURE__ */ jsxs(
|
|
642
|
+
"section",
|
|
643
|
+
{
|
|
644
|
+
"aria-roledescription": "slide",
|
|
645
|
+
"aria-label": ariaLabel,
|
|
646
|
+
className: "theo-slide",
|
|
647
|
+
"data-theo-slide-theme": slideThemeAttr,
|
|
648
|
+
"data-theo-slide-layout": layout ?? "default",
|
|
649
|
+
"data-theo-slide-bg-modifier": bgModifier,
|
|
650
|
+
style: {
|
|
651
|
+
position: "absolute",
|
|
652
|
+
top: "50%",
|
|
653
|
+
left: "50%",
|
|
654
|
+
width: canvas.width,
|
|
655
|
+
height: canvas.height,
|
|
656
|
+
transform: `translate(-50%, -50%) scale(${scale})`,
|
|
657
|
+
transformOrigin: "center",
|
|
658
|
+
padding: "var(--theo-slide-padding, 64px)",
|
|
659
|
+
color: "inherit",
|
|
660
|
+
// Background fills the canvas. When neither image nor gradient is set,
|
|
661
|
+
// the slide inherits the parent surface (same pattern as Whiteboard).
|
|
662
|
+
background: "transparent",
|
|
663
|
+
// Only set backgroundImage + ancillary props when one is provided —
|
|
664
|
+
// otherwise the shorthand `background: transparent` is preserved as-is
|
|
665
|
+
// (important for the inherit-from-parent guarantee).
|
|
666
|
+
...backgroundImageStyle ? {
|
|
667
|
+
backgroundImage: backgroundImageStyle,
|
|
668
|
+
backgroundSize: bgModifier === "fit" ? "contain" : "cover",
|
|
669
|
+
backgroundPosition: "center",
|
|
670
|
+
backgroundRepeat: "no-repeat"
|
|
671
|
+
} : {},
|
|
672
|
+
fontFamily: "var(--theo-slide-font-family, system-ui, -apple-system, 'Segoe UI', sans-serif)",
|
|
673
|
+
fontSize: "var(--theo-slide-font-base, 28px)",
|
|
674
|
+
lineHeight: 1.5,
|
|
675
|
+
boxSizing: "border-box",
|
|
676
|
+
overflow: "hidden"
|
|
677
|
+
},
|
|
678
|
+
children: [
|
|
679
|
+
headerText ? /* @__PURE__ */ jsx("div", { className: "theo-slide-header", "aria-hidden": "true", children: headerText }) : null,
|
|
680
|
+
treeNode,
|
|
681
|
+
footerText ? /* @__PURE__ */ jsx("div", { className: "theo-slide-footer", "aria-hidden": "true", children: footerText }) : null,
|
|
682
|
+
showPaginate ? /* @__PURE__ */ jsx("div", { className: "theo-slide-paginate", "aria-hidden": "true", children: "1" }) : null
|
|
683
|
+
]
|
|
684
|
+
}
|
|
685
|
+
)
|
|
686
|
+
}
|
|
687
|
+
);
|
|
688
|
+
};
|
|
689
|
+
function emptyFragment() {
|
|
690
|
+
return { type: "span", props: { children: null }, key: null };
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
// src/components/primitives/slide/themes/index.ts
|
|
694
|
+
var slideThemes = ["default", "violet-forge"];
|
|
695
|
+
function isSlideTheme(value) {
|
|
696
|
+
return typeof value === "string" && slideThemes.includes(value);
|
|
697
|
+
}
|
|
698
|
+
var rawSchema = z.toJSONSchema(slideFrontmatter, {
|
|
699
|
+
unrepresentable: "any"
|
|
700
|
+
});
|
|
701
|
+
if (rawSchema.properties) {
|
|
702
|
+
rawSchema.properties.backgroundImage = {
|
|
703
|
+
type: "string",
|
|
704
|
+
format: "uri",
|
|
705
|
+
maxLength: 5e5,
|
|
706
|
+
pattern: "^https?://",
|
|
707
|
+
description: "Slide background image URL. Only http(s) schemes are accepted; data: URLs are rejected at runtime (use a hosted image)."
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
var slideFrontmatterJsonSchema = rawSchema;
|
|
711
|
+
|
|
712
|
+
export { MAX_RAW_FRONTMATTER, Slide, collectTagCounts, composePlugins, extractFrontmatter, getSlideSanitizeSchema, hastToReact, isSlideTheme, mdastToHast, parseBody, parseSlide, sanitizeHast, slideFrontmatter, slideFrontmatterJsonSchema, slideInput, slideTheme, slideThemes, useSlideFit, validateSlide };
|
|
713
|
+
//# sourceMappingURL=chunk-ZUS5KZGO.js.map
|
|
714
|
+
//# sourceMappingURL=chunk-ZUS5KZGO.js.map
|