@usetheo/ui 0.13.1 → 0.14.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/README.md +4 -466
- package/dist/components/composites/command-palette/command-palette.d.ts +1 -1
- package/dist/components/primitives/badge/badge.d.ts +1 -1
- package/dist/components/primitives/button/button.d.ts +1 -1
- package/dist/components/primitives/danger-zone/danger-zone.d.ts +1 -1
- package/dist/components/primitives/dialog/dialog.d.ts +3 -3
- package/dist/components/primitives/dropdown-menu/dropdown-menu.d.ts +1 -1
- package/dist/components/primitives/sheet/sheet.d.ts +3 -3
- package/dist/components/primitives/toast/toast.d.ts +1 -1
- package/dist/index.d.ts +0 -89
- package/dist/index.js +4657 -1545
- package/dist/lib/cn.d.ts +1 -1
- package/dist/{preset-v3-legacy.js → tailwind-preset.js} +1 -16
- package/package.json +28 -788
- package/CHANGELOG.md +0 -1797
- package/DESIGN.md +0 -456
- package/NOTICE +0 -38
- package/dist/chunk-23YEYNDS.js +0 -89
- package/dist/chunk-23YEYNDS.js.map +0 -1
- package/dist/chunk-25KBUQEQ.js +0 -95
- package/dist/chunk-25KBUQEQ.js.map +0 -1
- package/dist/chunk-2A3E5Y72.js +0 -165
- package/dist/chunk-2A3E5Y72.js.map +0 -1
- package/dist/chunk-2EUKYGH5.js +0 -98
- package/dist/chunk-2EUKYGH5.js.map +0 -1
- package/dist/chunk-2NZYMQKT.js +0 -56
- package/dist/chunk-2NZYMQKT.js.map +0 -1
- package/dist/chunk-2OVFVPSZ.js +0 -26
- package/dist/chunk-2OVFVPSZ.js.map +0 -1
- package/dist/chunk-2UP7SECE.js +0 -78
- package/dist/chunk-2UP7SECE.js.map +0 -1
- package/dist/chunk-33ETHPT7.js +0 -112
- package/dist/chunk-33ETHPT7.js.map +0 -1
- package/dist/chunk-33IIDFSM.js +0 -43
- package/dist/chunk-33IIDFSM.js.map +0 -1
- package/dist/chunk-345HYADQ.js +0 -88
- package/dist/chunk-345HYADQ.js.map +0 -1
- package/dist/chunk-3ZXZGZOX.js +0 -57
- package/dist/chunk-3ZXZGZOX.js.map +0 -1
- package/dist/chunk-45FWKR23.js +0 -62
- package/dist/chunk-45FWKR23.js.map +0 -1
- package/dist/chunk-4DTLUBRW.js +0 -122
- package/dist/chunk-4DTLUBRW.js.map +0 -1
- package/dist/chunk-4EH6F54D.js +0 -69
- package/dist/chunk-4EH6F54D.js.map +0 -1
- package/dist/chunk-4EKF4EIE.js +0 -140
- package/dist/chunk-4EKF4EIE.js.map +0 -1
- package/dist/chunk-4SMYNLTA.js +0 -83
- package/dist/chunk-4SMYNLTA.js.map +0 -1
- package/dist/chunk-4UBFLXS3.js +0 -35
- package/dist/chunk-4UBFLXS3.js.map +0 -1
- package/dist/chunk-52J7SDYH.js +0 -48
- package/dist/chunk-52J7SDYH.js.map +0 -1
- package/dist/chunk-5XCTTXC3.js +0 -180
- package/dist/chunk-5XCTTXC3.js.map +0 -1
- package/dist/chunk-624AATQZ.js +0 -77
- package/dist/chunk-624AATQZ.js.map +0 -1
- package/dist/chunk-6IODJQWC.js +0 -47
- package/dist/chunk-6IODJQWC.js.map +0 -1
- package/dist/chunk-75IDWFYX.js +0 -134
- package/dist/chunk-75IDWFYX.js.map +0 -1
- package/dist/chunk-7BGCWJQR.js +0 -113
- package/dist/chunk-7BGCWJQR.js.map +0 -1
- package/dist/chunk-7BQXMG2A.js +0 -93
- package/dist/chunk-7BQXMG2A.js.map +0 -1
- package/dist/chunk-7RFWVNQA.js +0 -47
- package/dist/chunk-7RFWVNQA.js.map +0 -1
- package/dist/chunk-7T4NK6W6.js +0 -192
- package/dist/chunk-7T4NK6W6.js.map +0 -1
- package/dist/chunk-A3OU6ICP.js +0 -91
- package/dist/chunk-A3OU6ICP.js.map +0 -1
- package/dist/chunk-ABBXLAJW.js +0 -74
- package/dist/chunk-ABBXLAJW.js.map +0 -1
- package/dist/chunk-AENNHS3S.js +0 -83
- package/dist/chunk-AENNHS3S.js.map +0 -1
- package/dist/chunk-AXNJFBYX.js +0 -136
- package/dist/chunk-AXNJFBYX.js.map +0 -1
- package/dist/chunk-AXUAQM45.js +0 -154
- package/dist/chunk-AXUAQM45.js.map +0 -1
- package/dist/chunk-B2FL7KBJ.js +0 -65
- package/dist/chunk-B2FL7KBJ.js.map +0 -1
- package/dist/chunk-BE232OKN.js +0 -42
- package/dist/chunk-BE232OKN.js.map +0 -1
- package/dist/chunk-BP4RQSX7.js +0 -200
- package/dist/chunk-BP4RQSX7.js.map +0 -1
- package/dist/chunk-BPJ3RN3U.js +0 -112
- package/dist/chunk-BPJ3RN3U.js.map +0 -1
- package/dist/chunk-BSF4Y4UT.js +0 -77
- package/dist/chunk-BSF4Y4UT.js.map +0 -1
- package/dist/chunk-BWIDDAR7.js +0 -86
- package/dist/chunk-BWIDDAR7.js.map +0 -1
- package/dist/chunk-BYUWQ6OP.js +0 -45
- package/dist/chunk-BYUWQ6OP.js.map +0 -1
- package/dist/chunk-C5ULP2P5.js +0 -140
- package/dist/chunk-C5ULP2P5.js.map +0 -1
- package/dist/chunk-CCG7PXLX.js +0 -24
- package/dist/chunk-CCG7PXLX.js.map +0 -1
- package/dist/chunk-CED2LKHI.js +0 -117
- package/dist/chunk-CED2LKHI.js.map +0 -1
- package/dist/chunk-CGWIOIEO.js +0 -27
- package/dist/chunk-CGWIOIEO.js.map +0 -1
- package/dist/chunk-CSEGVTKO.js +0 -110
- package/dist/chunk-CSEGVTKO.js.map +0 -1
- package/dist/chunk-CVFSNA4K.js +0 -716
- package/dist/chunk-CVFSNA4K.js.map +0 -1
- package/dist/chunk-E26M7ATD.js +0 -61
- package/dist/chunk-E26M7ATD.js.map +0 -1
- package/dist/chunk-E63IRXZZ.js +0 -78
- package/dist/chunk-E63IRXZZ.js.map +0 -1
- package/dist/chunk-ESJUISWY.js +0 -45
- package/dist/chunk-ESJUISWY.js.map +0 -1
- package/dist/chunk-ET7A3TQZ.js +0 -158
- package/dist/chunk-ET7A3TQZ.js.map +0 -1
- package/dist/chunk-ETTL6XGU.js +0 -139
- package/dist/chunk-ETTL6XGU.js.map +0 -1
- package/dist/chunk-EWDN56AS.js +0 -24
- package/dist/chunk-EWDN56AS.js.map +0 -1
- package/dist/chunk-FJZKA2LV.js +0 -165
- package/dist/chunk-FJZKA2LV.js.map +0 -1
- package/dist/chunk-G2WCT6PJ.js +0 -69
- package/dist/chunk-G2WCT6PJ.js.map +0 -1
- package/dist/chunk-GC52HWIL.js +0 -41
- package/dist/chunk-GC52HWIL.js.map +0 -1
- package/dist/chunk-GCKFA7X7.js +0 -83
- package/dist/chunk-GCKFA7X7.js.map +0 -1
- package/dist/chunk-GDMCDW66.js +0 -19
- package/dist/chunk-GDMCDW66.js.map +0 -1
- package/dist/chunk-GIXHBTHH.js +0 -59
- package/dist/chunk-GIXHBTHH.js.map +0 -1
- package/dist/chunk-GLEOUWPN.js +0 -108
- package/dist/chunk-GLEOUWPN.js.map +0 -1
- package/dist/chunk-GLRUM43F.js +0 -121
- package/dist/chunk-GLRUM43F.js.map +0 -1
- package/dist/chunk-H3L7WZDZ.js +0 -74
- package/dist/chunk-H3L7WZDZ.js.map +0 -1
- package/dist/chunk-H55WXDME.js +0 -45
- package/dist/chunk-H55WXDME.js.map +0 -1
- package/dist/chunk-H5QPJNVD.js +0 -98
- package/dist/chunk-H5QPJNVD.js.map +0 -1
- package/dist/chunk-HB45JHMM.js +0 -43
- package/dist/chunk-HB45JHMM.js.map +0 -1
- package/dist/chunk-HETHTYEZ.js +0 -80
- package/dist/chunk-HETHTYEZ.js.map +0 -1
- package/dist/chunk-HHSKNB32.js +0 -55
- package/dist/chunk-HHSKNB32.js.map +0 -1
- package/dist/chunk-HILOUYES.js +0 -151
- package/dist/chunk-HILOUYES.js.map +0 -1
- package/dist/chunk-HTJVHFNW.js +0 -178
- package/dist/chunk-HTJVHFNW.js.map +0 -1
- package/dist/chunk-HZ7Z22VW.js +0 -130
- package/dist/chunk-HZ7Z22VW.js.map +0 -1
- package/dist/chunk-JFKBFQA5.js +0 -129
- package/dist/chunk-JFKBFQA5.js.map +0 -1
- package/dist/chunk-JIZKW3WC.js +0 -74
- package/dist/chunk-JIZKW3WC.js.map +0 -1
- package/dist/chunk-JQTCCKZA.js +0 -154
- package/dist/chunk-JQTCCKZA.js.map +0 -1
- package/dist/chunk-JR4H3FJ2.js +0 -74
- package/dist/chunk-JR4H3FJ2.js.map +0 -1
- package/dist/chunk-JRW53TVG.js +0 -53
- package/dist/chunk-JRW53TVG.js.map +0 -1
- package/dist/chunk-JXOCE27Z.js +0 -82
- package/dist/chunk-JXOCE27Z.js.map +0 -1
- package/dist/chunk-JYW5YNF7.js +0 -188
- package/dist/chunk-JYW5YNF7.js.map +0 -1
- package/dist/chunk-K72DJOXR.js +0 -81
- package/dist/chunk-K72DJOXR.js.map +0 -1
- package/dist/chunk-KDE3NYTI.js +0 -144
- package/dist/chunk-KDE3NYTI.js.map +0 -1
- package/dist/chunk-KFUFTZLS.js +0 -111
- package/dist/chunk-KFUFTZLS.js.map +0 -1
- package/dist/chunk-KHBXI6AV.js +0 -149
- package/dist/chunk-KHBXI6AV.js.map +0 -1
- package/dist/chunk-M74ZYBOK.js +0 -93
- package/dist/chunk-M74ZYBOK.js.map +0 -1
- package/dist/chunk-ML7WLNIK.js +0 -11
- package/dist/chunk-ML7WLNIK.js.map +0 -1
- package/dist/chunk-MXB2GVEQ.js +0 -57
- package/dist/chunk-MXB2GVEQ.js.map +0 -1
- package/dist/chunk-NEMXW2LB.js +0 -102
- package/dist/chunk-NEMXW2LB.js.map +0 -1
- package/dist/chunk-OJPPSJMF.js +0 -65
- package/dist/chunk-OJPPSJMF.js.map +0 -1
- package/dist/chunk-OMR6ZGME.js +0 -63
- package/dist/chunk-OMR6ZGME.js.map +0 -1
- package/dist/chunk-ORVYP73T.js +0 -223
- package/dist/chunk-ORVYP73T.js.map +0 -1
- package/dist/chunk-OZFUUO2Q.js +0 -50
- package/dist/chunk-OZFUUO2Q.js.map +0 -1
- package/dist/chunk-P44UAK45.js +0 -115
- package/dist/chunk-P44UAK45.js.map +0 -1
- package/dist/chunk-PJUP4BJD.js +0 -116
- package/dist/chunk-PJUP4BJD.js.map +0 -1
- package/dist/chunk-PJWYIOY4.js +0 -3
- package/dist/chunk-PJWYIOY4.js.map +0 -1
- package/dist/chunk-PVCW4O37.js +0 -147
- package/dist/chunk-PVCW4O37.js.map +0 -1
- package/dist/chunk-PXT47DRZ.js +0 -59
- package/dist/chunk-PXT47DRZ.js.map +0 -1
- package/dist/chunk-PZGUZHI7.js +0 -142
- package/dist/chunk-PZGUZHI7.js.map +0 -1
- package/dist/chunk-Q2BAL2PF.js +0 -965
- package/dist/chunk-Q2BAL2PF.js.map +0 -1
- package/dist/chunk-QBUTRD2M.js +0 -58
- package/dist/chunk-QBUTRD2M.js.map +0 -1
- package/dist/chunk-QCQTTOMD.js +0 -236
- package/dist/chunk-QCQTTOMD.js.map +0 -1
- package/dist/chunk-QNYOIVQ4.js +0 -36
- package/dist/chunk-QNYOIVQ4.js.map +0 -1
- package/dist/chunk-QPURZJJM.js +0 -88
- package/dist/chunk-QPURZJJM.js.map +0 -1
- package/dist/chunk-QRXIYPWP.js +0 -121
- package/dist/chunk-QRXIYPWP.js.map +0 -1
- package/dist/chunk-QV4BQRNH.js +0 -29
- package/dist/chunk-QV4BQRNH.js.map +0 -1
- package/dist/chunk-REFY5MLN.js +0 -212
- package/dist/chunk-REFY5MLN.js.map +0 -1
- package/dist/chunk-RJ6RAMKH.js +0 -89
- package/dist/chunk-RJ6RAMKH.js.map +0 -1
- package/dist/chunk-RJBCTMVW.js +0 -59
- package/dist/chunk-RJBCTMVW.js.map +0 -1
- package/dist/chunk-RLWULF5B.js +0 -113
- package/dist/chunk-RLWULF5B.js.map +0 -1
- package/dist/chunk-RPZMFGYI.js +0 -31
- package/dist/chunk-RPZMFGYI.js.map +0 -1
- package/dist/chunk-RQT5DWGG.js +0 -34
- package/dist/chunk-RQT5DWGG.js.map +0 -1
- package/dist/chunk-SBKVVVYY.js +0 -89
- package/dist/chunk-SBKVVVYY.js.map +0 -1
- package/dist/chunk-SOJW47EZ.js +0 -70
- package/dist/chunk-SOJW47EZ.js.map +0 -1
- package/dist/chunk-SQ66DCXY.js +0 -35
- package/dist/chunk-SQ66DCXY.js.map +0 -1
- package/dist/chunk-SXKGWHAM.js +0 -179
- package/dist/chunk-SXKGWHAM.js.map +0 -1
- package/dist/chunk-T2OKGV6M.js +0 -13
- package/dist/chunk-T2OKGV6M.js.map +0 -1
- package/dist/chunk-TJLULCZW.js +0 -108
- package/dist/chunk-TJLULCZW.js.map +0 -1
- package/dist/chunk-TY6NTWN5.js +0 -29
- package/dist/chunk-TY6NTWN5.js.map +0 -1
- package/dist/chunk-U3AEEFVB.js +0 -152
- package/dist/chunk-U3AEEFVB.js.map +0 -1
- package/dist/chunk-UGKI466V.js +0 -12
- package/dist/chunk-UGKI466V.js.map +0 -1
- package/dist/chunk-V3HFDVZ3.js +0 -102
- package/dist/chunk-V3HFDVZ3.js.map +0 -1
- package/dist/chunk-V6H2RUVP.js +0 -77
- package/dist/chunk-V6H2RUVP.js.map +0 -1
- package/dist/chunk-VB53UMAL.js +0 -106
- package/dist/chunk-VB53UMAL.js.map +0 -1
- package/dist/chunk-VBEMLZGX.js +0 -86
- package/dist/chunk-VBEMLZGX.js.map +0 -1
- package/dist/chunk-VBQFE5RV.js +0 -92
- package/dist/chunk-VBQFE5RV.js.map +0 -1
- package/dist/chunk-VHK2OUCW.js +0 -38
- package/dist/chunk-VHK2OUCW.js.map +0 -1
- package/dist/chunk-VHTAVROO.js +0 -53
- package/dist/chunk-VHTAVROO.js.map +0 -1
- package/dist/chunk-VM4RMQQN.js +0 -11
- package/dist/chunk-VM4RMQQN.js.map +0 -1
- package/dist/chunk-VZX4HLBM.js +0 -84
- package/dist/chunk-VZX4HLBM.js.map +0 -1
- package/dist/chunk-W47V2F3Q.js +0 -115
- package/dist/chunk-W47V2F3Q.js.map +0 -1
- package/dist/chunk-W7I3ZX66.js +0 -76
- package/dist/chunk-W7I3ZX66.js.map +0 -1
- package/dist/chunk-WD42UBGR.js +0 -64
- package/dist/chunk-WD42UBGR.js.map +0 -1
- package/dist/chunk-XC7SYZYR.js +0 -86
- package/dist/chunk-XC7SYZYR.js.map +0 -1
- package/dist/chunk-XJA4B3F5.js +0 -68
- package/dist/chunk-XJA4B3F5.js.map +0 -1
- package/dist/chunk-XSENM65D.js +0 -128
- package/dist/chunk-XSENM65D.js.map +0 -1
- package/dist/chunk-YD2QEVHO.js +0 -68
- package/dist/chunk-YD2QEVHO.js.map +0 -1
- package/dist/chunk-YDKRUSB5.js +0 -35
- package/dist/chunk-YDKRUSB5.js.map +0 -1
- package/dist/chunk-YES6SPDT.js +0 -55
- package/dist/chunk-YES6SPDT.js.map +0 -1
- package/dist/chunk-YNDHYMPI.js +0 -46
- package/dist/chunk-YNDHYMPI.js.map +0 -1
- package/dist/chunk-YO3WEMOH.js +0 -130
- package/dist/chunk-YO3WEMOH.js.map +0 -1
- package/dist/chunk-YUFFAWNB.js +0 -90
- package/dist/chunk-YUFFAWNB.js.map +0 -1
- package/dist/chunk-YVXMWUWD.js +0 -118
- package/dist/chunk-YVXMWUWD.js.map +0 -1
- package/dist/chunk-Z6HZMGO2.js +0 -106
- package/dist/chunk-Z6HZMGO2.js.map +0 -1
- package/dist/chunk-ZAMPCRFJ.js +0 -121
- package/dist/chunk-ZAMPCRFJ.js.map +0 -1
- package/dist/chunk-ZEFOXF2I.js +0 -87
- package/dist/chunk-ZEFOXF2I.js.map +0 -1
- package/dist/chunk-ZJXOHLQE.js +0 -66
- package/dist/chunk-ZJXOHLQE.js.map +0 -1
- package/dist/chunk-ZPURFK4C.js +0 -203
- package/dist/chunk-ZPURFK4C.js.map +0 -1
- package/dist/chunk-ZXPDS6DH.js +0 -3
- package/dist/chunk-ZXPDS6DH.js.map +0 -1
- package/dist/chunk-ZZZIOTLC.js +0 -89
- package/dist/chunk-ZZZIOTLC.js.map +0 -1
- package/dist/components/composites/agent-composer/agent-composer.d.ts +0 -41
- package/dist/components/composites/agent-composer/index.d.ts +0 -1
- package/dist/components/composites/agent-editor/agent-editor.d.ts +0 -31
- package/dist/components/composites/agent-editor/index.d.ts +0 -1
- package/dist/components/composites/agent-stream/agent-stream.d.ts +0 -72
- package/dist/components/composites/agent-stream/index.d.ts +0 -2
- package/dist/components/composites/agent-stream/to-agent-stream-items.d.ts +0 -32
- package/dist/components/composites/agent-timeline/agent-timeline.d.ts +0 -22
- package/dist/components/composites/agent-timeline/index.d.ts +0 -1
- package/dist/components/composites/agent-tool-renderer/agent-tool-renderer.d.ts +0 -60
- package/dist/components/composites/agent-tool-renderer/index.d.ts +0 -1
- package/dist/components/composites/agent-tool-renderer/tool-call-part.d.ts +0 -5
- package/dist/components/composites/approval-card/approval-card.d.ts +0 -35
- package/dist/components/composites/approval-card/index.d.ts +0 -1
- package/dist/components/composites/chat-composer/chat-composer.d.ts +0 -68
- package/dist/components/composites/chat-composer/index.d.ts +0 -1
- package/dist/components/composites/chat-message/chat-message-actions.d.ts +0 -22
- package/dist/components/composites/chat-message/chat-message-branch.d.ts +0 -17
- package/dist/components/composites/chat-message/chat-message-response.d.ts +0 -15
- package/dist/components/composites/chat-message/chat-message-toolbar.d.ts +0 -7
- package/dist/components/composites/chat-message/chat-message.d.ts +0 -94
- package/dist/components/composites/chat-message/index.d.ts +0 -23
- package/dist/components/composites/chat-message/parts/data-part.d.ts +0 -9
- package/dist/components/composites/chat-message/parts/file-part.d.ts +0 -5
- package/dist/components/composites/chat-message/parts/reasoning-part.d.ts +0 -7
- package/dist/components/composites/chat-message/parts/source-part.d.ts +0 -9
- package/dist/components/composites/chat-message/parts/text-part.d.ts +0 -11
- package/dist/components/composites/choice-prompt/choice-prompt.d.ts +0 -65
- package/dist/components/composites/choice-prompt/index.d.ts +0 -2
- package/dist/components/composites/confirm-prompt/confirm-prompt.d.ts +0 -31
- package/dist/components/composites/confirm-prompt/index.d.ts +0 -1
- package/dist/components/composites/cron-jobs-list/cron-jobs-list.d.ts +0 -15
- package/dist/components/composites/cron-jobs-list/index.d.ts +0 -1
- package/dist/components/composites/mcp-server-list/index.d.ts +0 -1
- package/dist/components/composites/mcp-server-list/mcp-server-list.d.ts +0 -15
- package/dist/components/composites/multi-select-prompt/index.d.ts +0 -1
- package/dist/components/composites/multi-select-prompt/multi-select-prompt.d.ts +0 -61
- package/dist/components/composites/permission-modal/index.d.ts +0 -1
- package/dist/components/composites/permission-modal/permission-modal.d.ts +0 -48
- package/dist/components/composites/preview-panel/index.d.ts +0 -1
- package/dist/components/composites/preview-panel/preview-panel.d.ts +0 -24
- package/dist/components/composites/rule-editor/index.d.ts +0 -1
- package/dist/components/composites/rule-editor/rule-editor.d.ts +0 -18
- package/dist/components/composites/skill-editor/index.d.ts +0 -1
- package/dist/components/composites/skill-editor/skill-editor.d.ts +0 -19
- package/dist/components/composites/skills-list/index.d.ts +0 -1
- package/dist/components/composites/skills-list/skills-list.d.ts +0 -15
- package/dist/components/composites/slide-deck/context.d.ts +0 -23
- package/dist/components/composites/slide-deck/controls.d.ts +0 -8
- package/dist/components/composites/slide-deck/fragments.d.ts +0 -20
- package/dist/components/composites/slide-deck/index.d.ts +0 -21
- package/dist/components/composites/slide-deck/notes.d.ts +0 -14
- package/dist/components/composites/slide-deck/presenter-view.d.ts +0 -15
- package/dist/components/composites/slide-deck/print-styles.d.ts +0 -21
- package/dist/components/composites/slide-deck/progress-bar.d.ts +0 -8
- package/dist/components/composites/slide-deck/schema.d.ts +0 -31
- package/dist/components/composites/slide-deck/slide-deck.d.ts +0 -78
- package/dist/components/composites/slide-deck/slide-number.d.ts +0 -11
- package/dist/components/composites/slide-deck/split-deck.d.ts +0 -2
- package/dist/components/composites/slide-deck/thumbnails.d.ts +0 -19
- package/dist/components/composites/slide-deck/use-deck-hash-routing.d.ts +0 -23
- package/dist/components/composites/slide-deck/use-deck-keyboard.d.ts +0 -25
- package/dist/components/composites/slide-deck/use-deck-state.d.ts +0 -57
- package/dist/components/composites/slide-deck/use-deck-swipe.d.ts +0 -20
- package/dist/components/composites/slide-deck/use-fullscreen.d.ts +0 -18
- package/dist/components/composites/stability-bundle-viewer/index.d.ts +0 -1
- package/dist/components/composites/stability-bundle-viewer/stability-bundle-viewer.d.ts +0 -28
- package/dist/components/composites/text-prompt/index.d.ts +0 -1
- package/dist/components/composites/text-prompt/text-prompt.d.ts +0 -48
- package/dist/components/composites/usage-meter/index.d.ts +0 -1
- package/dist/components/composites/usage-meter/usage-meter.d.ts +0 -56
- package/dist/components/primitives/agent-error-card/agent-error-card.d.ts +0 -47
- package/dist/components/primitives/agent-error-card/index.d.ts +0 -1
- package/dist/components/primitives/agent-event/agent-event.d.ts +0 -25
- package/dist/components/primitives/agent-event/index.d.ts +0 -1
- package/dist/components/primitives/agent-handoff/agent-handoff.d.ts +0 -24
- package/dist/components/primitives/agent-handoff/index.d.ts +0 -1
- package/dist/components/primitives/agent-profile/agent-profile.d.ts +0 -28
- package/dist/components/primitives/agent-profile/index.d.ts +0 -1
- package/dist/components/primitives/agent-starting-state/agent-starting-state.d.ts +0 -15
- package/dist/components/primitives/agent-starting-state/index.d.ts +0 -1
- package/dist/components/primitives/agent-streaming/agent-streaming.d.ts +0 -16
- package/dist/components/primitives/agent-streaming/index.d.ts +0 -1
- package/dist/components/primitives/artifact-preview/artifact-preview.d.ts +0 -25
- package/dist/components/primitives/artifact-preview/index.d.ts +0 -1
- package/dist/components/primitives/attachment-chip/attachment-chip.d.ts +0 -14
- package/dist/components/primitives/attachment-chip/index.d.ts +0 -1
- package/dist/components/primitives/audit-log-entry/audit-log-entry.d.ts +0 -29
- package/dist/components/primitives/audit-log-entry/index.d.ts +0 -1
- package/dist/components/primitives/auto-compact-notice/auto-compact-notice.d.ts +0 -24
- package/dist/components/primitives/auto-compact-notice/index.d.ts +0 -1
- package/dist/components/primitives/branch-indicator/branch-indicator.d.ts +0 -13
- package/dist/components/primitives/branch-indicator/index.d.ts +0 -1
- package/dist/components/primitives/browser-controls/browser-controls.d.ts +0 -19
- package/dist/components/primitives/browser-controls/index.d.ts +0 -1
- package/dist/components/primitives/build-log-stream/build-log-stream.d.ts +0 -51
- package/dist/components/primitives/build-log-stream/index.d.ts +0 -1
- package/dist/components/primitives/capability-indicator/capability-indicator.d.ts +0 -57
- package/dist/components/primitives/capability-indicator/index.d.ts +0 -1
- package/dist/components/primitives/channel-card/channel-card.d.ts +0 -28
- package/dist/components/primitives/channel-card/index.d.ts +0 -1
- package/dist/components/primitives/chat-thread/chat-thread.d.ts +0 -12
- package/dist/components/primitives/chat-thread/index.d.ts +0 -1
- package/dist/components/primitives/context-card/context-card.d.ts +0 -18
- package/dist/components/primitives/context-card/index.d.ts +0 -1
- package/dist/components/primitives/context-window-bar/context-window-bar.d.ts +0 -27
- package/dist/components/primitives/context-window-bar/index.d.ts +0 -1
- package/dist/components/primitives/cost-meter/cost-meter.d.ts +0 -23
- package/dist/components/primitives/cost-meter/index.d.ts +0 -1
- package/dist/components/primitives/created-files-card/created-files-card.d.ts +0 -30
- package/dist/components/primitives/created-files-card/index.d.ts +0 -1
- package/dist/components/primitives/cron-job-card/cron-job-card.d.ts +0 -30
- package/dist/components/primitives/cron-job-card/index.d.ts +0 -1
- package/dist/components/primitives/diff-viewer/diff-viewer.d.ts +0 -45
- package/dist/components/primitives/diff-viewer/index.d.ts +0 -1
- package/dist/components/primitives/export-chat-dialog/export-chat-dialog.d.ts +0 -18
- package/dist/components/primitives/export-chat-dialog/index.d.ts +0 -1
- package/dist/components/primitives/folder-context-card/folder-context-card.d.ts +0 -40
- package/dist/components/primitives/folder-context-card/index.d.ts +0 -1
- package/dist/components/primitives/folder-selector/folder-selector.d.ts +0 -18
- package/dist/components/primitives/folder-selector/index.d.ts +0 -1
- package/dist/components/primitives/gateway-status-indicator/gateway-status-indicator.d.ts +0 -19
- package/dist/components/primitives/gateway-status-indicator/index.d.ts +0 -1
- package/dist/components/primitives/hook-config/hook-config.d.ts +0 -27
- package/dist/components/primitives/hook-config/index.d.ts +0 -1
- package/dist/components/primitives/hook-event-log/hook-event-log.d.ts +0 -27
- package/dist/components/primitives/hook-event-log/index.d.ts +0 -1
- package/dist/components/primitives/intent-selector/index.d.ts +0 -1
- package/dist/components/primitives/intent-selector/intent-selector.d.ts +0 -22
- package/dist/components/primitives/lane-board/index.d.ts +0 -1
- package/dist/components/primitives/lane-board/lane-board.d.ts +0 -26
- package/dist/components/primitives/mcp-server-card/index.d.ts +0 -1
- package/dist/components/primitives/mcp-server-card/mcp-server-card.d.ts +0 -32
- package/dist/components/primitives/memory-editor/index.d.ts +0 -1
- package/dist/components/primitives/memory-editor/memory-editor.d.ts +0 -29
- package/dist/components/primitives/mention-menu/index.d.ts +0 -1
- package/dist/components/primitives/mention-menu/mention-menu.d.ts +0 -44
- package/dist/components/primitives/model-card/index.d.ts +0 -1
- package/dist/components/primitives/model-card/model-card.d.ts +0 -72
- package/dist/components/primitives/model-selector/index.d.ts +0 -1
- package/dist/components/primitives/model-selector/model-selector.d.ts +0 -21
- package/dist/components/primitives/permission-matrix/index.d.ts +0 -1
- package/dist/components/primitives/permission-matrix/permission-matrix.d.ts +0 -43
- package/dist/components/primitives/progress-checklist/index.d.ts +0 -1
- package/dist/components/primitives/progress-checklist/progress-checklist.d.ts +0 -18
- package/dist/components/primitives/project-switcher/index.d.ts +0 -1
- package/dist/components/primitives/project-switcher/project-switcher.d.ts +0 -32
- package/dist/components/primitives/quick-action-chips/index.d.ts +0 -1
- package/dist/components/primitives/quick-action-chips/quick-action-chips.d.ts +0 -22
- package/dist/components/primitives/recent-folders-list/index.d.ts +0 -1
- package/dist/components/primitives/recent-folders-list/recent-folders-list.d.ts +0 -21
- package/dist/components/primitives/rule-card/index.d.ts +0 -1
- package/dist/components/primitives/rule-card/rule-card.d.ts +0 -15
- package/dist/components/primitives/run-stats/index.d.ts +0 -1
- package/dist/components/primitives/run-stats/run-stats.d.ts +0 -16
- package/dist/components/primitives/run-status-pill/index.d.ts +0 -1
- package/dist/components/primitives/run-status-pill/run-status-pill.d.ts +0 -13
- package/dist/components/primitives/running-tasks-panel/index.d.ts +0 -1
- package/dist/components/primitives/running-tasks-panel/running-tasks-panel.d.ts +0 -20
- package/dist/components/primitives/session-list-item/index.d.ts +0 -1
- package/dist/components/primitives/session-list-item/session-list-item.d.ts +0 -35
- package/dist/components/primitives/session-timeline/index.d.ts +0 -1
- package/dist/components/primitives/session-timeline/session-timeline.d.ts +0 -32
- package/dist/components/primitives/skill-card/index.d.ts +0 -1
- package/dist/components/primitives/skill-card/skill-card.d.ts +0 -28
- package/dist/components/primitives/slide/alerts.d.ts +0 -31
- package/dist/components/primitives/slide/frontmatter.d.ts +0 -23
- package/dist/components/primitives/slide/index.d.ts +0 -16
- package/dist/components/primitives/slide/json-schema.d.ts +0 -9
- package/dist/components/primitives/slide/marpit-bg.d.ts +0 -36
- package/dist/components/primitives/slide/parse.d.ts +0 -59
- package/dist/components/primitives/slide/plugin.d.ts +0 -79
- package/dist/components/primitives/slide/plugins/emoji/index.d.ts +0 -8
- package/dist/components/primitives/slide/plugins/emoji/map.d.ts +0 -15
- package/dist/components/primitives/slide/plugins/math/index.d.ts +0 -6
- package/dist/components/primitives/slide/plugins/mermaid/index.d.ts +0 -48
- package/dist/components/primitives/slide/plugins/shiki/index.d.ts +0 -11
- package/dist/components/primitives/slide/sanitize.d.ts +0 -33
- package/dist/components/primitives/slide/schema.d.ts +0 -109
- package/dist/components/primitives/slide/slide.d.ts +0 -53
- package/dist/components/primitives/slide/themes/index.d.ts +0 -9
- package/dist/components/primitives/slide/use-slide-fit.d.ts +0 -21
- package/dist/components/primitives/slide/validate.d.ts +0 -33
- package/dist/components/primitives/steps-rail/index.d.ts +0 -1
- package/dist/components/primitives/steps-rail/steps-rail.d.ts +0 -24
- package/dist/components/primitives/sub-agent-dispatch/index.d.ts +0 -1
- package/dist/components/primitives/sub-agent-dispatch/sub-agent-dispatch.d.ts +0 -30
- package/dist/components/primitives/system-prompt-editor/index.d.ts +0 -1
- package/dist/components/primitives/system-prompt-editor/system-prompt-editor.d.ts +0 -25
- package/dist/components/primitives/task-plan/index.d.ts +0 -1
- package/dist/components/primitives/task-plan/task-plan.d.ts +0 -36
- package/dist/components/primitives/terminal-panel/index.d.ts +0 -1
- package/dist/components/primitives/terminal-panel/terminal-panel.d.ts +0 -32
- package/dist/components/primitives/thinking-level-selector/index.d.ts +0 -1
- package/dist/components/primitives/thinking-level-selector/thinking-level-selector.d.ts +0 -24
- package/dist/components/primitives/token-usage-chart/index.d.ts +0 -2
- package/dist/components/primitives/token-usage-chart/token-usage-chart.d.ts +0 -44
- package/dist/components/primitives/token-usage-chart/usage-metrics.d.ts +0 -23
- package/dist/components/primitives/tool-call/index.d.ts +0 -1
- package/dist/components/primitives/tool-call/tool-call.d.ts +0 -30
- package/dist/components/primitives/tool-call-card/index.d.ts +0 -1
- package/dist/components/primitives/tool-call-card/tool-call-card.d.ts +0 -30
- package/dist/components/primitives/tool-result/index.d.ts +0 -1
- package/dist/components/primitives/tool-result/tool-result.d.ts +0 -19
- package/dist/components/primitives/tools-list/index.d.ts +0 -1
- package/dist/components/primitives/tools-list/tools-list.d.ts +0 -32
- package/dist/components/primitives/whiteboard/index.d.ts +0 -2
- package/dist/components/primitives/whiteboard/render/freedraw.d.ts +0 -2
- package/dist/components/primitives/whiteboard/render/line.d.ts +0 -4
- package/dist/components/primitives/whiteboard/render/rough-paths.d.ts +0 -16
- package/dist/components/primitives/whiteboard/render/scene.d.ts +0 -3
- package/dist/components/primitives/whiteboard/render/shape.d.ts +0 -5
- package/dist/components/primitives/whiteboard/render/style.d.ts +0 -24
- package/dist/components/primitives/whiteboard/render/text.d.ts +0 -2
- package/dist/components/primitives/whiteboard/schema.d.ts +0 -596
- package/dist/components/primitives/whiteboard/seed.d.ts +0 -22
- package/dist/components/primitives/whiteboard/validate.d.ts +0 -26
- package/dist/components/primitives/whiteboard/viewport/use-pointer-pan.d.ts +0 -11
- package/dist/components/primitives/whiteboard/viewport/use-viewport.d.ts +0 -33
- package/dist/components/primitives/whiteboard/whiteboard.d.ts +0 -21
- package/dist/components.css +0 -2
- package/dist/composites/account-menu/index.js +0 -6
- package/dist/composites/account-menu/index.js.map +0 -1
- package/dist/composites/agent-composer/index.js +0 -8
- package/dist/composites/agent-composer/index.js.map +0 -1
- package/dist/composites/agent-editor/index.js +0 -11
- package/dist/composites/agent-editor/index.js.map +0 -1
- package/dist/composites/agent-stream/index.js +0 -24
- package/dist/composites/agent-stream/index.js.map +0 -1
- package/dist/composites/agent-timeline/index.js +0 -5
- package/dist/composites/agent-timeline/index.js.map +0 -1
- package/dist/composites/agent-tool-renderer/index.js +0 -17
- package/dist/composites/agent-tool-renderer/index.js.map +0 -1
- package/dist/composites/approval-card/index.js +0 -5
- package/dist/composites/approval-card/index.js.map +0 -1
- package/dist/composites/chat-composer/index.js +0 -6
- package/dist/composites/chat-composer/index.js.map +0 -1
- package/dist/composites/chat-message/index.js +0 -20
- package/dist/composites/chat-message/index.js.map +0 -1
- package/dist/composites/choice-prompt/index.js +0 -11
- package/dist/composites/choice-prompt/index.js.map +0 -1
- package/dist/composites/code-block/index.js +0 -5
- package/dist/composites/code-block/index.js.map +0 -1
- package/dist/composites/command-palette/index.js +0 -6
- package/dist/composites/command-palette/index.js.map +0 -1
- package/dist/composites/confirm-dialog/index.js +0 -8
- package/dist/composites/confirm-dialog/index.js.map +0 -1
- package/dist/composites/confirm-prompt/index.js +0 -7
- package/dist/composites/confirm-prompt/index.js.map +0 -1
- package/dist/composites/cron-jobs-list/index.js +0 -5
- package/dist/composites/cron-jobs-list/index.js.map +0 -1
- package/dist/composites/data-table/index.js +0 -11
- package/dist/composites/data-table/index.js.map +0 -1
- package/dist/composites/deployment-row/index.js +0 -5
- package/dist/composites/deployment-row/index.js.map +0 -1
- package/dist/composites/domain-config/index.js +0 -8
- package/dist/composites/domain-config/index.js.map +0 -1
- package/dist/composites/env-var-editor/index.js +0 -9
- package/dist/composites/env-var-editor/index.js.map +0 -1
- package/dist/composites/mcp-server-list/index.js +0 -6
- package/dist/composites/mcp-server-list/index.js.map +0 -1
- package/dist/composites/metric-card/index.js +0 -5
- package/dist/composites/metric-card/index.js.map +0 -1
- package/dist/composites/multi-select-prompt/index.js +0 -11
- package/dist/composites/multi-select-prompt/index.js.map +0 -1
- package/dist/composites/page-shell/index.js +0 -8
- package/dist/composites/page-shell/index.js.map +0 -1
- package/dist/composites/permission-modal/index.js +0 -7
- package/dist/composites/permission-modal/index.js.map +0 -1
- package/dist/composites/preview-env-card/index.js +0 -6
- package/dist/composites/preview-env-card/index.js.map +0 -1
- package/dist/composites/preview-panel/index.js +0 -5
- package/dist/composites/preview-panel/index.js.map +0 -1
- package/dist/composites/project-card/index.js +0 -6
- package/dist/composites/project-card/index.js.map +0 -1
- package/dist/composites/rollback-ui/index.js +0 -7
- package/dist/composites/rollback-ui/index.js.map +0 -1
- package/dist/composites/rule-editor/index.js +0 -12
- package/dist/composites/rule-editor/index.js.map +0 -1
- package/dist/composites/skill-editor/index.js +0 -12
- package/dist/composites/skill-editor/index.js.map +0 -1
- package/dist/composites/skills-list/index.js +0 -6
- package/dist/composites/skills-list/index.js.map +0 -1
- package/dist/composites/stability-bundle-viewer/index.js +0 -5
- package/dist/composites/stability-bundle-viewer/index.js.map +0 -1
- package/dist/composites/status-indicator/index.js +0 -4
- package/dist/composites/status-indicator/index.js.map +0 -1
- package/dist/composites/task-header/index.js +0 -5
- package/dist/composites/task-header/index.js.map +0 -1
- package/dist/composites/text-prompt/index.js +0 -10
- package/dist/composites/text-prompt/index.js.map +0 -1
- package/dist/composites/usage-meter/index.js +0 -5
- package/dist/composites/usage-meter/index.js.map +0 -1
- package/dist/fonts/LICENSE-GEIST.txt +0 -92
- 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 +0 -28
- package/dist/fonts.css +0 -75
- package/dist/index.js.map +0 -1
- package/dist/lib/markdown/code-block.d.ts +0 -14
- package/dist/lib/markdown/inline-code.d.ts +0 -10
- package/dist/lib/markdown/math.d.ts +0 -12
- package/dist/lib/markdown/mermaid.d.ts +0 -6
- package/dist/lib/markdown/parser.d.ts +0 -47
- package/dist/lib/markdown/streaming-preprocess.d.ts +0 -39
- package/dist/lib/prompt.d.ts +0 -40
- package/dist/lib/sdk-tools-adapters/index.d.ts +0 -1
- package/dist/lib/sdk-tools-adapters/index.js +0 -3
- package/dist/lib/sdk-tools-adapters/index.js.map +0 -1
- package/dist/lib/sdk-tools-adapters/sdk-tools-adapters.d.ts +0 -60
- package/dist/preset-v3-legacy.d.ts +0 -32
- package/dist/preset-v3-legacy.js.map +0 -1
- package/dist/preset.css +0 -27
- package/dist/primitives/action-bar/index.js +0 -4
- package/dist/primitives/action-bar/index.js.map +0 -1
- package/dist/primitives/agent-error-card/index.js +0 -5
- package/dist/primitives/agent-error-card/index.js.map +0 -1
- package/dist/primitives/agent-event/index.js +0 -5
- package/dist/primitives/agent-event/index.js.map +0 -1
- package/dist/primitives/agent-handoff/index.js +0 -4
- package/dist/primitives/agent-handoff/index.js.map +0 -1
- package/dist/primitives/agent-profile/index.js +0 -4
- package/dist/primitives/agent-profile/index.js.map +0 -1
- package/dist/primitives/agent-starting-state/index.js +0 -5
- package/dist/primitives/agent-starting-state/index.js.map +0 -1
- package/dist/primitives/agent-streaming/index.js +0 -5
- package/dist/primitives/agent-streaming/index.js.map +0 -1
- package/dist/primitives/alert/index.js +0 -4
- package/dist/primitives/alert/index.js.map +0 -1
- package/dist/primitives/artifact-preview/index.js +0 -4
- package/dist/primitives/artifact-preview/index.js.map +0 -1
- package/dist/primitives/attachment-chip/index.js +0 -4
- package/dist/primitives/attachment-chip/index.js.map +0 -1
- package/dist/primitives/audit-log-entry/index.js +0 -4
- package/dist/primitives/audit-log-entry/index.js.map +0 -1
- package/dist/primitives/auto-compact-notice/index.js +0 -5
- package/dist/primitives/auto-compact-notice/index.js.map +0 -1
- package/dist/primitives/avatar/index.js +0 -4
- package/dist/primitives/avatar/index.js.map +0 -1
- package/dist/primitives/badge/index.js +0 -4
- package/dist/primitives/badge/index.js.map +0 -1
- package/dist/primitives/branch-indicator/index.js +0 -4
- package/dist/primitives/branch-indicator/index.js.map +0 -1
- package/dist/primitives/browser-controls/index.js +0 -4
- package/dist/primitives/browser-controls/index.js.map +0 -1
- package/dist/primitives/build-log-stream/index.js +0 -7
- package/dist/primitives/build-log-stream/index.js.map +0 -1
- package/dist/primitives/button/index.js +0 -4
- package/dist/primitives/button/index.js.map +0 -1
- package/dist/primitives/capability-indicator/index.js +0 -4
- package/dist/primitives/capability-indicator/index.js.map +0 -1
- package/dist/primitives/card/index.js +0 -5
- package/dist/primitives/card/index.js.map +0 -1
- package/dist/primitives/channel-card/index.js +0 -4
- package/dist/primitives/channel-card/index.js.map +0 -1
- package/dist/primitives/chat-thread/index.js +0 -5
- package/dist/primitives/chat-thread/index.js.map +0 -1
- package/dist/primitives/checkbox/index.js +0 -4
- package/dist/primitives/checkbox/index.js.map +0 -1
- package/dist/primitives/context-card/index.js +0 -4
- package/dist/primitives/context-card/index.js.map +0 -1
- package/dist/primitives/context-window-bar/index.js +0 -4
- package/dist/primitives/context-window-bar/index.js.map +0 -1
- package/dist/primitives/copy-button/index.js +0 -5
- package/dist/primitives/copy-button/index.js.map +0 -1
- package/dist/primitives/cost-meter/index.js +0 -4
- package/dist/primitives/cost-meter/index.js.map +0 -1
- package/dist/primitives/created-files-card/index.js +0 -4
- package/dist/primitives/created-files-card/index.js.map +0 -1
- package/dist/primitives/cron-job-card/index.js +0 -4
- package/dist/primitives/cron-job-card/index.js.map +0 -1
- package/dist/primitives/danger-zone/index.js +0 -4
- package/dist/primitives/danger-zone/index.js.map +0 -1
- package/dist/primitives/dialog/index.js +0 -4
- package/dist/primitives/dialog/index.js.map +0 -1
- package/dist/primitives/diff-viewer/index.js +0 -4
- package/dist/primitives/diff-viewer/index.js.map +0 -1
- package/dist/primitives/dropdown-menu/index.js +0 -4
- package/dist/primitives/dropdown-menu/index.js.map +0 -1
- package/dist/primitives/empty-state/index.js +0 -4
- package/dist/primitives/empty-state/index.js.map +0 -1
- package/dist/primitives/export-chat-dialog/index.js +0 -5
- package/dist/primitives/export-chat-dialog/index.js.map +0 -1
- package/dist/primitives/folder-context-card/index.js +0 -4
- package/dist/primitives/folder-context-card/index.js.map +0 -1
- package/dist/primitives/folder-selector/index.js +0 -4
- package/dist/primitives/folder-selector/index.js.map +0 -1
- package/dist/primitives/form-field/index.js +0 -5
- package/dist/primitives/form-field/index.js.map +0 -1
- package/dist/primitives/gateway-status-indicator/index.js +0 -4
- package/dist/primitives/gateway-status-indicator/index.js.map +0 -1
- package/dist/primitives/hook-config/index.js +0 -5
- package/dist/primitives/hook-config/index.js.map +0 -1
- package/dist/primitives/hook-event-log/index.js +0 -4
- package/dist/primitives/hook-event-log/index.js.map +0 -1
- package/dist/primitives/input/index.js +0 -4
- package/dist/primitives/input/index.js.map +0 -1
- package/dist/primitives/intent-selector/index.js +0 -4
- package/dist/primitives/intent-selector/index.js.map +0 -1
- package/dist/primitives/label/index.js +0 -4
- package/dist/primitives/label/index.js.map +0 -1
- package/dist/primitives/lane-board/index.js +0 -4
- package/dist/primitives/lane-board/index.js.map +0 -1
- package/dist/primitives/login-split/index.js +0 -4
- package/dist/primitives/login-split/index.js.map +0 -1
- package/dist/primitives/mcp-server-card/index.js +0 -4
- package/dist/primitives/mcp-server-card/index.js.map +0 -1
- package/dist/primitives/memory-editor/index.js +0 -4
- package/dist/primitives/memory-editor/index.js.map +0 -1
- package/dist/primitives/mention-menu/index.js +0 -5
- package/dist/primitives/mention-menu/index.js.map +0 -1
- package/dist/primitives/metrics-panel/index.js +0 -4
- package/dist/primitives/metrics-panel/index.js.map +0 -1
- package/dist/primitives/model-card/index.js +0 -4
- package/dist/primitives/model-card/index.js.map +0 -1
- package/dist/primitives/model-selector/index.js +0 -4
- package/dist/primitives/model-selector/index.js.map +0 -1
- package/dist/primitives/pagination/index.js +0 -4
- package/dist/primitives/pagination/index.js.map +0 -1
- package/dist/primitives/permission-matrix/index.js +0 -5
- package/dist/primitives/permission-matrix/index.js.map +0 -1
- package/dist/primitives/pin-input/index.js +0 -5
- package/dist/primitives/pin-input/index.js.map +0 -1
- package/dist/primitives/plan-badge/index.js +0 -4
- package/dist/primitives/plan-badge/index.js.map +0 -1
- package/dist/primitives/progress/index.js +0 -4
- package/dist/primitives/progress/index.js.map +0 -1
- package/dist/primitives/progress-checklist/index.js +0 -4
- package/dist/primitives/progress-checklist/index.js.map +0 -1
- package/dist/primitives/project-switcher/index.js +0 -4
- package/dist/primitives/project-switcher/index.js.map +0 -1
- package/dist/primitives/quick-action-chips/index.js +0 -4
- package/dist/primitives/quick-action-chips/index.js.map +0 -1
- package/dist/primitives/radio-group/index.js +0 -4
- package/dist/primitives/radio-group/index.js.map +0 -1
- package/dist/primitives/recent-folders-list/index.js +0 -4
- package/dist/primitives/recent-folders-list/index.js.map +0 -1
- package/dist/primitives/rule-card/index.js +0 -4
- package/dist/primitives/rule-card/index.js.map +0 -1
- package/dist/primitives/run-stats/index.js +0 -4
- package/dist/primitives/run-stats/index.js.map +0 -1
- package/dist/primitives/run-status-pill/index.js +0 -4
- package/dist/primitives/run-status-pill/index.js.map +0 -1
- package/dist/primitives/running-tasks-panel/index.js +0 -4
- package/dist/primitives/running-tasks-panel/index.js.map +0 -1
- package/dist/primitives/scroll-area/index.js +0 -5
- package/dist/primitives/scroll-area/index.js.map +0 -1
- package/dist/primitives/select/index.js +0 -4
- package/dist/primitives/select/index.js.map +0 -1
- package/dist/primitives/session-list-item/index.js +0 -4
- package/dist/primitives/session-list-item/index.js.map +0 -1
- package/dist/primitives/session-timeline/index.js +0 -4
- package/dist/primitives/session-timeline/index.js.map +0 -1
- package/dist/primitives/sheet/index.js +0 -4
- package/dist/primitives/sheet/index.js.map +0 -1
- package/dist/primitives/sidebar/index.js +0 -4
- package/dist/primitives/sidebar/index.js.map +0 -1
- package/dist/primitives/skeleton/index.js +0 -5
- package/dist/primitives/skeleton/index.js.map +0 -1
- package/dist/primitives/skill-card/index.js +0 -4
- package/dist/primitives/skill-card/index.js.map +0 -1
- package/dist/primitives/social-auth-row/index.js +0 -4
- package/dist/primitives/social-auth-row/index.js.map +0 -1
- package/dist/primitives/stat-tile/index.js +0 -4
- package/dist/primitives/stat-tile/index.js.map +0 -1
- package/dist/primitives/status-dot/index.js +0 -6
- package/dist/primitives/status-dot/index.js.map +0 -1
- package/dist/primitives/steps-rail/index.js +0 -4
- package/dist/primitives/steps-rail/index.js.map +0 -1
- package/dist/primitives/sub-agent-dispatch/index.js +0 -4
- package/dist/primitives/sub-agent-dispatch/index.js.map +0 -1
- package/dist/primitives/switch/index.js +0 -4
- package/dist/primitives/switch/index.js.map +0 -1
- package/dist/primitives/system-prompt-editor/index.js +0 -5
- package/dist/primitives/system-prompt-editor/index.js.map +0 -1
- package/dist/primitives/table/index.js +0 -5
- package/dist/primitives/table/index.js.map +0 -1
- package/dist/primitives/tabs/index.js +0 -4
- package/dist/primitives/tabs/index.js.map +0 -1
- package/dist/primitives/task-plan/index.js +0 -4
- package/dist/primitives/task-plan/index.js.map +0 -1
- package/dist/primitives/terminal-panel/index.js +0 -5
- package/dist/primitives/terminal-panel/index.js.map +0 -1
- package/dist/primitives/textarea/index.js +0 -4
- package/dist/primitives/textarea/index.js.map +0 -1
- package/dist/primitives/thinking-level-selector/index.js +0 -5
- package/dist/primitives/thinking-level-selector/index.js.map +0 -1
- package/dist/primitives/timestamp/index.js +0 -6
- package/dist/primitives/timestamp/index.js.map +0 -1
- package/dist/primitives/toast/index.js +0 -5
- package/dist/primitives/toast/index.js.map +0 -1
- package/dist/primitives/token-usage-chart/index.js +0 -4
- package/dist/primitives/token-usage-chart/index.js.map +0 -1
- package/dist/primitives/tool-call/index.js +0 -5
- package/dist/primitives/tool-call/index.js.map +0 -1
- package/dist/primitives/tool-call-card/index.js +0 -5
- package/dist/primitives/tool-call-card/index.js.map +0 -1
- package/dist/primitives/tool-result/index.js +0 -4
- package/dist/primitives/tool-result/index.js.map +0 -1
- package/dist/primitives/tools-list/index.js +0 -4
- package/dist/primitives/tools-list/index.js.map +0 -1
- package/dist/primitives/tooltip/index.js +0 -4
- package/dist/primitives/tooltip/index.js.map +0 -1
- package/dist/primitives/topnav/index.js +0 -4
- package/dist/primitives/topnav/index.js.map +0 -1
- package/dist/primitives/update-banner/index.js +0 -4
- package/dist/primitives/update-banner/index.js.map +0 -1
- package/dist/screens/theo-code-shell.d.ts +0 -9
- package/dist/screens/theo-code-shell.data.d.ts +0 -147
- package/dist/slide/index.js +0 -4
- package/dist/slide/index.js.map +0 -1
- package/dist/slide/plugins/emoji/index.js +0 -157
- package/dist/slide/plugins/emoji/index.js.map +0 -1
- package/dist/slide/plugins/math/index.js +0 -145
- package/dist/slide/plugins/math/index.js.map +0 -1
- package/dist/slide/plugins/mermaid/index.js +0 -218
- package/dist/slide/plugins/mermaid/index.js.map +0 -1
- package/dist/slide/plugins/shiki/index.js +0 -87
- package/dist/slide/plugins/shiki/index.js.map +0 -1
- package/dist/slide/themes/default.css +0 -256
- package/dist/slide/themes/layouts.css +0 -143
- package/dist/slide/themes/violet-forge.css +0 -256
- package/dist/slide-deck/index.css +0 -52
- package/dist/slide-deck/index.css.map +0 -1
- package/dist/slide-deck/index.js +0 -1122
- package/dist/slide-deck/index.js.map +0 -1
- package/dist/styles-v3-legacy.css +0 -88
- package/dist/styles.css +0 -137
- package/dist/themes/anthropic-style.d.ts +0 -11
- package/dist/themes/aurora-terminal.d.ts +0 -9
- package/dist/themes/classic-paper.d.ts +0 -17
- package/dist/themes/color-value-pattern.d.ts +0 -22
- package/dist/themes/color.d.ts +0 -62
- package/dist/themes/define.d.ts +0 -65
- package/dist/themes/density.d.ts +0 -17
- package/dist/themes/dracula.d.ts +0 -14
- package/dist/themes/github-dark.d.ts +0 -11
- package/dist/themes/index.d.ts +0 -26
- package/dist/themes/linear-glass.d.ts +0 -11
- package/dist/themes/one-dark.d.ts +0 -11
- package/dist/themes/openai-style.d.ts +0 -10
- package/dist/themes/schema.d.ts +0 -112
- package/dist/themes/theme-provider.d.ts +0 -82
- package/dist/themes/theme-script.d.ts +0 -48
- package/dist/themes/theme-switcher.d.ts +0 -17
- package/dist/themes/types.d.ts +0 -88
- package/dist/themes/vercel-mono.d.ts +0 -11
- package/dist/themes/violet-forge.d.ts +0 -12
- package/dist/theo-ui-provider.d.ts +0 -50
- package/dist/tokens-v4.css +0 -223
- package/dist/tokens.css +0 -315
- package/dist/types/agent.d.ts +0 -19
- package/dist/types/chat.d.ts +0 -173
- package/dist/types/mode.d.ts +0 -16
- package/dist/types/permission.d.ts +0 -8
- package/dist/types/rule.d.ts +0 -28
- package/dist/vite-plugin.d.ts +0 -25
- package/dist/vite-plugin.js +0 -76
- package/dist/vite-plugin.js.map +0 -1
- package/dist/whiteboard/index.js +0 -741
- package/dist/whiteboard/index.js.map +0 -1
- package/llms.txt +0 -273
- package/registry/index.json +0 -910
- package/registry/r/account-menu.json +0 -24
- package/registry/r/action-bar.json +0 -22
- package/registry/r/agent-composer.json +0 -22
- package/registry/r/agent-editor.json +0 -27
- package/registry/r/agent-error-card.json +0 -22
- package/registry/r/agent-event.json +0 -24
- package/registry/r/agent-handoff.json +0 -22
- package/registry/r/agent-profile.json +0 -23
- package/registry/r/agent-starting-state.json +0 -22
- package/registry/r/agent-stream.json +0 -27
- package/registry/r/agent-streaming.json +0 -22
- package/registry/r/agent-timeline.json +0 -22
- package/registry/r/agent-tool-renderer.json +0 -40
- package/registry/r/agent-types.json +0 -15
- package/registry/r/alert.json +0 -22
- package/registry/r/approval-card.json +0 -25
- package/registry/r/artifact-preview.json +0 -22
- package/registry/r/attachment-chip.json +0 -24
- package/registry/r/audit-log-entry.json +0 -23
- package/registry/r/auto-compact-notice.json +0 -22
- package/registry/r/avatar.json +0 -23
- package/registry/r/badge.json +0 -22
- package/registry/r/browser-controls.json +0 -22
- package/registry/r/build-log-stream.json +0 -20
- package/registry/r/button.json +0 -23
- package/registry/r/capability-indicator.json +0 -23
- package/registry/r/card.json +0 -22
- package/registry/r/chat-composer.json +0 -23
- package/registry/r/chat-message.json +0 -124
- package/registry/r/chat-thread.json +0 -20
- package/registry/r/chat-types.json +0 -15
- package/registry/r/checkbox.json +0 -24
- package/registry/r/choice-prompt.json +0 -25
- package/registry/r/cn.json +0 -19
- package/registry/r/code-block.json +0 -21
- package/registry/r/command-palette.json +0 -25
- package/registry/r/confirm-dialog.json +0 -25
- package/registry/r/confirm-prompt.json +0 -21
- package/registry/r/context-card.json +0 -23
- package/registry/r/context-window-bar.json +0 -20
- package/registry/r/copy-button.json +0 -22
- package/registry/r/cost-meter.json +0 -22
- package/registry/r/created-files-card.json +0 -23
- package/registry/r/cron-job-card.json +0 -22
- package/registry/r/cron-jobs-list.json +0 -23
- package/registry/r/danger-zone.json +0 -20
- package/registry/r/data-table.json +0 -27
- package/registry/r/deployment-row.json +0 -23
- package/registry/r/dialog.json +0 -23
- package/registry/r/diff-viewer.json +0 -20
- package/registry/r/domain-config.json +0 -25
- package/registry/r/dropdown-menu.json +0 -23
- package/registry/r/empty-state.json +0 -20
- package/registry/r/env-var-editor.json +0 -26
- package/registry/r/env.json +0 -15
- package/registry/r/folder-context-card.json +0 -23
- package/registry/r/folder-selector.json +0 -22
- package/registry/r/form-field.json +0 -23
- package/registry/r/hook-config.json +0 -22
- package/registry/r/hook-event-log.json +0 -22
- package/registry/r/input.json +0 -22
- package/registry/r/intent-selector.json +0 -24
- package/registry/r/label.json +0 -22
- package/registry/r/lane-board.json +0 -20
- package/registry/r/live-region-context.json +0 -16
- package/registry/r/login-split.json +0 -20
- package/registry/r/mcp-server-card.json +0 -22
- package/registry/r/mcp-server-list.json +0 -23
- package/registry/r/memory-editor.json +0 -23
- package/registry/r/mention-menu.json +0 -23
- package/registry/r/metric-card.json +0 -23
- package/registry/r/metrics-panel.json +0 -22
- package/registry/r/mode-types.json +0 -15
- package/registry/r/model-card.json +0 -23
- package/registry/r/model-selector.json +0 -23
- package/registry/r/multi-select-prompt.json +0 -25
- package/registry/r/page-shell.json +0 -25
- package/registry/r/pagination.json +0 -22
- package/registry/r/permission-matrix.json +0 -22
- package/registry/r/permission-modal.json +0 -24
- package/registry/r/permission-types.json +0 -15
- package/registry/r/pin-input.json +0 -20
- package/registry/r/plan-badge.json +0 -20
- package/registry/r/preview-env-card.json +0 -25
- package/registry/r/preview-panel.json +0 -21
- package/registry/r/progress-checklist.json +0 -23
- package/registry/r/progress.json +0 -20
- package/registry/r/project-card.json +0 -25
- package/registry/r/project-switcher.json +0 -22
- package/registry/r/prompt.json +0 -15
- package/registry/r/quick-action-chips.json +0 -21
- package/registry/r/radio-group.json +0 -23
- package/registry/r/recent-folders-list.json +0 -22
- package/registry/r/rollback-ui.json +0 -24
- package/registry/r/rule-card.json +0 -23
- package/registry/r/rule-editor.json +0 -28
- package/registry/r/rule-types.json +0 -18
- package/registry/r/run-stats.json +0 -22
- package/registry/r/running-tasks-panel.json +0 -22
- package/registry/r/safe-href.json +0 -16
- package/registry/r/scroll-area.json +0 -22
- package/registry/r/select.json +0 -24
- package/registry/r/session-list-item.json +0 -20
- package/registry/r/session-timeline.json +0 -22
- package/registry/r/sheet.json +0 -24
- package/registry/r/sidebar.json +0 -19
- package/registry/r/skeleton.json +0 -19
- package/registry/r/skill-card.json +0 -24
- package/registry/r/skill-editor.json +0 -28
- package/registry/r/skills-list.json +0 -23
- package/registry/r/slide-deck.json +0 -130
- package/registry/r/slide-plugin-emoji.json +0 -28
- package/registry/r/slide-plugin-math.json +0 -24
- package/registry/r/slide-plugin-mermaid.json +0 -23
- package/registry/r/slide-plugin-shiki.json +0 -23
- package/registry/r/slide.json +0 -123
- package/registry/r/social-auth-row.json +0 -21
- package/registry/r/stat-tile.json +0 -22
- package/registry/r/status-dot.json +0 -21
- package/registry/r/status-indicator.json +0 -20
- package/registry/r/steps-rail.json +0 -20
- package/registry/r/sub-agent-dispatch.json +0 -22
- package/registry/r/switch.json +0 -23
- package/registry/r/system-prompt-editor.json +0 -22
- package/registry/r/table.json +0 -22
- package/registry/r/tabs.json +0 -22
- package/registry/r/tailwind-preset.json +0 -19
- package/registry/r/task-header.json +0 -24
- package/registry/r/task-plan.json +0 -22
- package/registry/r/task-types.json +0 -15
- package/registry/r/terminal-panel.json +0 -22
- package/registry/r/text-prompt.json +0 -24
- package/registry/r/textarea.json +0 -22
- package/registry/r/theme-provider.json +0 -60
- package/registry/r/theme-script.json +0 -18
- package/registry/r/theo-ui-provider.json +0 -20
- package/registry/r/timestamp.json +0 -21
- package/registry/r/toast.json +0 -30
- package/registry/r/token-usage-chart.json +0 -20
- package/registry/r/tokens.json +0 -21
- package/registry/r/tool-call-card.json +0 -23
- package/registry/r/tool-call.json +0 -22
- package/registry/r/tool-result.json +0 -20
- package/registry/r/tools-list.json +0 -23
- package/registry/r/tooltip.json +0 -22
- package/registry/r/topnav.json +0 -22
- package/registry/r/types.json +0 -15
- package/registry/r/usage-meter.json +0 -21
- package/registry/r/whiteboard.json +0 -101
package/dist/whiteboard/index.js
DELETED
|
@@ -1,741 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useMemo, useEffect, useRef, useState, useCallback } from 'react';
|
|
3
|
-
import rough from 'roughjs';
|
|
4
|
-
import { getStroke } from 'perfect-freehand';
|
|
5
|
-
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
6
|
-
import { z } from 'zod';
|
|
7
|
-
|
|
8
|
-
// src/components/primitives/whiteboard/whiteboard.tsx
|
|
9
|
-
|
|
10
|
-
// src/components/primitives/whiteboard/seed.ts
|
|
11
|
-
var FNV_OFFSET_BASIS_32 = 2166136261;
|
|
12
|
-
var FNV_PRIME_32 = 16777619;
|
|
13
|
-
function fnv1a32(input) {
|
|
14
|
-
let hash = FNV_OFFSET_BASIS_32;
|
|
15
|
-
for (let i = 0; i < input.length; i++) {
|
|
16
|
-
hash ^= input.charCodeAt(i);
|
|
17
|
-
hash = Math.imul(hash, FNV_PRIME_32);
|
|
18
|
-
}
|
|
19
|
-
return hash | 0;
|
|
20
|
-
}
|
|
21
|
-
function deriveSeed(el) {
|
|
22
|
-
if (typeof el.seed === "number" && Number.isFinite(el.seed)) {
|
|
23
|
-
return el.seed | 0;
|
|
24
|
-
}
|
|
25
|
-
const key = `${el.type}|${el.x}|${el.y}|${el.w ?? ""}|${el.h ?? ""}|${el.label ?? ""}`;
|
|
26
|
-
return fnv1a32(key);
|
|
27
|
-
}
|
|
28
|
-
var DEFAULT_STROKE_OPTIONS = {
|
|
29
|
-
size: 8,
|
|
30
|
-
thinning: 0.5,
|
|
31
|
-
smoothing: 0.5,
|
|
32
|
-
streamline: 0.5
|
|
33
|
-
};
|
|
34
|
-
function fmt(n) {
|
|
35
|
-
return typeof n === "number" && Number.isFinite(n) ? n.toFixed(2) : "0";
|
|
36
|
-
}
|
|
37
|
-
function svgPathFromStroke(points) {
|
|
38
|
-
if (points.length === 0) return "";
|
|
39
|
-
const first = points[0] ?? [];
|
|
40
|
-
let d = `M ${fmt(first[0])} ${fmt(first[1])}`;
|
|
41
|
-
for (let i = 1; i < points.length; i++) {
|
|
42
|
-
const p = points[i] ?? [];
|
|
43
|
-
d += ` L ${fmt(p[0])} ${fmt(p[1])}`;
|
|
44
|
-
}
|
|
45
|
-
d += " Z";
|
|
46
|
-
return d;
|
|
47
|
-
}
|
|
48
|
-
function renderFreedraw(el) {
|
|
49
|
-
const size = (el.strokeWidth ?? 1.5) * 5;
|
|
50
|
-
const inputPoints = el.points.map(([x, y, pressure]) => {
|
|
51
|
-
const tx = el.x + x;
|
|
52
|
-
const ty = el.y + y;
|
|
53
|
-
return pressure === void 0 ? [tx, ty] : [tx, ty, pressure];
|
|
54
|
-
});
|
|
55
|
-
const stroke = getStroke(inputPoints, {
|
|
56
|
-
...DEFAULT_STROKE_OPTIONS,
|
|
57
|
-
size
|
|
58
|
-
});
|
|
59
|
-
const d = svgPathFromStroke(stroke);
|
|
60
|
-
return /* @__PURE__ */ jsx("g", { opacity: el.opacity ?? 1, children: /* @__PURE__ */ jsx("path", { d, fill: el.stroke ?? "currentColor", stroke: "none" }) });
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// src/components/primitives/whiteboard/render/rough-paths.ts
|
|
64
|
-
function toRoughPaths(generator, drawable) {
|
|
65
|
-
const paths = generator.toPaths(drawable);
|
|
66
|
-
return paths.map((p) => ({
|
|
67
|
-
d: p.d,
|
|
68
|
-
stroke: p.stroke,
|
|
69
|
-
strokeWidth: p.strokeWidth,
|
|
70
|
-
fill: p.fill
|
|
71
|
-
}));
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// src/components/primitives/whiteboard/render/style.ts
|
|
75
|
-
var DEFAULT_STROKE = "currentColor";
|
|
76
|
-
function buildOptions(src, seed) {
|
|
77
|
-
const o = {
|
|
78
|
-
seed,
|
|
79
|
-
stroke: src.stroke ?? DEFAULT_STROKE,
|
|
80
|
-
strokeWidth: src.strokeWidth ?? 1.5,
|
|
81
|
-
roughness: src.roughness ?? 1.2
|
|
82
|
-
};
|
|
83
|
-
if (src.strokeStyle === "dashed") o.strokeLineDash = [10, 6];
|
|
84
|
-
else if (src.strokeStyle === "dotted") o.strokeLineDash = [2, 4];
|
|
85
|
-
if (src.fill) o.fill = src.fill;
|
|
86
|
-
if (src.fillStyle) o.fillStyle = src.fillStyle;
|
|
87
|
-
return o;
|
|
88
|
-
}
|
|
89
|
-
function strokeDashArray(strokeStyle2, strokeWidth) {
|
|
90
|
-
if (strokeStyle2 === "dashed") {
|
|
91
|
-
const dash = Math.max(8, strokeWidth * 6);
|
|
92
|
-
const gap = Math.max(5, strokeWidth * 4);
|
|
93
|
-
return `${dash} ${gap}`;
|
|
94
|
-
}
|
|
95
|
-
if (strokeStyle2 === "dotted") {
|
|
96
|
-
return `${strokeWidth} ${strokeWidth * 2.5}`;
|
|
97
|
-
}
|
|
98
|
-
return void 0;
|
|
99
|
-
}
|
|
100
|
-
var HEAD_BASE_PX = 12;
|
|
101
|
-
var HEAD_ANGLE_RAD = Math.PI / 7;
|
|
102
|
-
function arrowHeadGeometry(fromX, fromY, toX, toY, strokeWidth) {
|
|
103
|
-
const dx = toX - fromX;
|
|
104
|
-
const dy = toY - fromY;
|
|
105
|
-
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
106
|
-
if (dist === 0) return null;
|
|
107
|
-
const angle = Math.atan2(dy, dx);
|
|
108
|
-
const headLen = Math.min(HEAD_BASE_PX + strokeWidth * 2, dist * 0.4);
|
|
109
|
-
const leftX = toX - headLen * Math.cos(angle - HEAD_ANGLE_RAD);
|
|
110
|
-
const leftY = toY - headLen * Math.sin(angle - HEAD_ANGLE_RAD);
|
|
111
|
-
const rightX = toX - headLen * Math.cos(angle + HEAD_ANGLE_RAD);
|
|
112
|
-
const rightY = toY - headLen * Math.sin(angle + HEAD_ANGLE_RAD);
|
|
113
|
-
return { apexX: toX, apexY: toY, leftX, leftY, rightX, rightY };
|
|
114
|
-
}
|
|
115
|
-
function lineBody(gen, el, seed) {
|
|
116
|
-
const opts = buildOptions(el, seed);
|
|
117
|
-
const drawable = gen.line(el.x, el.y, el.to[0], el.to[1], opts);
|
|
118
|
-
const dash = strokeDashArray(el.strokeStyle, el.strokeWidth ?? 1.5);
|
|
119
|
-
return toRoughPaths(gen, drawable).map((p, i) => /* @__PURE__ */ jsx(
|
|
120
|
-
"path",
|
|
121
|
-
{
|
|
122
|
-
d: p.d,
|
|
123
|
-
stroke: p.stroke,
|
|
124
|
-
strokeWidth: p.strokeWidth,
|
|
125
|
-
fill: "none",
|
|
126
|
-
strokeLinecap: "round",
|
|
127
|
-
strokeLinejoin: "round",
|
|
128
|
-
strokeDasharray: dash
|
|
129
|
-
},
|
|
130
|
-
`body-${i}`
|
|
131
|
-
));
|
|
132
|
-
}
|
|
133
|
-
function arrowHead(gen, fromX, fromY, toX, toY, seed, el, side) {
|
|
134
|
-
const geom = arrowHeadGeometry(fromX, fromY, toX, toY, el.strokeWidth ?? 1.5);
|
|
135
|
-
if (!geom) return [];
|
|
136
|
-
const opts = buildOptions(el, seed);
|
|
137
|
-
const leftDrawable = gen.line(geom.apexX, geom.apexY, geom.leftX, geom.leftY, opts);
|
|
138
|
-
const rightDrawable = gen.line(geom.apexX, geom.apexY, geom.rightX, geom.rightY, opts);
|
|
139
|
-
const leftPaths = toRoughPaths(gen, leftDrawable);
|
|
140
|
-
const rightPaths = toRoughPaths(gen, rightDrawable);
|
|
141
|
-
const nodes = [];
|
|
142
|
-
for (const [i, p] of leftPaths.entries()) {
|
|
143
|
-
nodes.push(
|
|
144
|
-
/* @__PURE__ */ jsx(
|
|
145
|
-
"path",
|
|
146
|
-
{
|
|
147
|
-
d: p.d,
|
|
148
|
-
stroke: p.stroke,
|
|
149
|
-
strokeWidth: p.strokeWidth,
|
|
150
|
-
fill: "none",
|
|
151
|
-
strokeLinecap: "round",
|
|
152
|
-
strokeLinejoin: "round",
|
|
153
|
-
"data-line-part": "arrowhead"
|
|
154
|
-
},
|
|
155
|
-
`${side}-l-${i}`
|
|
156
|
-
)
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
for (const [i, p] of rightPaths.entries()) {
|
|
160
|
-
nodes.push(
|
|
161
|
-
/* @__PURE__ */ jsx(
|
|
162
|
-
"path",
|
|
163
|
-
{
|
|
164
|
-
d: p.d,
|
|
165
|
-
stroke: p.stroke,
|
|
166
|
-
strokeWidth: p.strokeWidth,
|
|
167
|
-
fill: "none",
|
|
168
|
-
strokeLinecap: "round",
|
|
169
|
-
strokeLinejoin: "round",
|
|
170
|
-
"data-line-part": "arrowhead"
|
|
171
|
-
},
|
|
172
|
-
`${side}-r-${i}`
|
|
173
|
-
)
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
return nodes;
|
|
177
|
-
}
|
|
178
|
-
function renderLine(gen, el) {
|
|
179
|
-
return /* @__PURE__ */ jsx("g", { opacity: el.opacity ?? 1, children: lineBody(gen, el, el.seed ?? 0) });
|
|
180
|
-
}
|
|
181
|
-
function renderArrow(gen, el) {
|
|
182
|
-
const seed = el.seed ?? 0;
|
|
183
|
-
const nodes = [...lineBody(gen, el, seed)];
|
|
184
|
-
if (el.headEnd !== false) {
|
|
185
|
-
nodes.push(...arrowHead(gen, el.x, el.y, el.to[0], el.to[1], seed + 1, el, "end"));
|
|
186
|
-
}
|
|
187
|
-
if (el.headStart) {
|
|
188
|
-
nodes.push(...arrowHead(gen, el.to[0], el.to[1], el.x, el.y, seed + 2, el, "start"));
|
|
189
|
-
}
|
|
190
|
-
let label = null;
|
|
191
|
-
if (el.label) {
|
|
192
|
-
const midX = (el.x + el.to[0]) / 2;
|
|
193
|
-
const midY = (el.y + el.to[1]) / 2;
|
|
194
|
-
const dx = el.to[0] - el.x;
|
|
195
|
-
const dy = el.to[1] - el.y;
|
|
196
|
-
const dist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
197
|
-
const nx = -dy / dist;
|
|
198
|
-
const ny = dx / dist;
|
|
199
|
-
const offset = 12;
|
|
200
|
-
label = /* @__PURE__ */ jsx(
|
|
201
|
-
"text",
|
|
202
|
-
{
|
|
203
|
-
x: midX + nx * offset,
|
|
204
|
-
y: midY + ny * offset,
|
|
205
|
-
textAnchor: "middle",
|
|
206
|
-
dominantBaseline: "central",
|
|
207
|
-
fontSize: 14,
|
|
208
|
-
fontFamily: "ui-sans-serif, system-ui, sans-serif",
|
|
209
|
-
fill: el.stroke ?? "currentColor",
|
|
210
|
-
style: { pointerEvents: "none" },
|
|
211
|
-
children: el.label
|
|
212
|
-
}
|
|
213
|
-
);
|
|
214
|
-
}
|
|
215
|
-
return /* @__PURE__ */ jsxs("g", { opacity: el.opacity ?? 1, children: [
|
|
216
|
-
nodes,
|
|
217
|
-
label
|
|
218
|
-
] });
|
|
219
|
-
}
|
|
220
|
-
function Label({ cx, cy, label, stroke }) {
|
|
221
|
-
return /* @__PURE__ */ jsx(
|
|
222
|
-
"text",
|
|
223
|
-
{
|
|
224
|
-
"data-slot": "label",
|
|
225
|
-
x: cx,
|
|
226
|
-
y: cy,
|
|
227
|
-
textAnchor: "middle",
|
|
228
|
-
dominantBaseline: "central",
|
|
229
|
-
fontSize: 16,
|
|
230
|
-
fontFamily: "ui-sans-serif, system-ui, sans-serif",
|
|
231
|
-
fill: stroke ?? "currentColor",
|
|
232
|
-
style: { pointerEvents: "none" },
|
|
233
|
-
children: label
|
|
234
|
-
}
|
|
235
|
-
);
|
|
236
|
-
}
|
|
237
|
-
function pathsToReactNodes(paths, keyPrefix, outlineStroke, dashArray) {
|
|
238
|
-
return paths.map((p, i) => {
|
|
239
|
-
const isOutline = p.stroke === outlineStroke;
|
|
240
|
-
return /* @__PURE__ */ jsx(
|
|
241
|
-
"path",
|
|
242
|
-
{
|
|
243
|
-
d: p.d,
|
|
244
|
-
stroke: p.stroke,
|
|
245
|
-
strokeWidth: p.strokeWidth,
|
|
246
|
-
fill: p.fill ?? "none",
|
|
247
|
-
strokeLinecap: "round",
|
|
248
|
-
strokeLinejoin: "round",
|
|
249
|
-
strokeDasharray: isOutline ? dashArray : void 0
|
|
250
|
-
},
|
|
251
|
-
`${keyPrefix}-${i}`
|
|
252
|
-
);
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
function renderRect(gen, el) {
|
|
256
|
-
const opts = buildOptions(el, el.seed ?? 0);
|
|
257
|
-
const drawable = gen.rectangle(el.x, el.y, el.w, el.h, opts);
|
|
258
|
-
const paths = toRoughPaths(gen, drawable);
|
|
259
|
-
const dash = strokeDashArray(el.strokeStyle, el.strokeWidth ?? 1.5);
|
|
260
|
-
return /* @__PURE__ */ jsxs("g", { opacity: el.opacity ?? 1, children: [
|
|
261
|
-
pathsToReactNodes(paths, "rect", opts.stroke, dash),
|
|
262
|
-
el.label ? /* @__PURE__ */ jsx(Label, { cx: el.x + el.w / 2, cy: el.y + el.h / 2, label: el.label, stroke: el.stroke }) : null
|
|
263
|
-
] });
|
|
264
|
-
}
|
|
265
|
-
function renderEllipse(gen, el) {
|
|
266
|
-
const opts = buildOptions(el, el.seed ?? 0);
|
|
267
|
-
const drawable = gen.ellipse(el.x + el.w / 2, el.y + el.h / 2, el.w, el.h, opts);
|
|
268
|
-
const paths = toRoughPaths(gen, drawable);
|
|
269
|
-
const dash = strokeDashArray(el.strokeStyle, el.strokeWidth ?? 1.5);
|
|
270
|
-
return /* @__PURE__ */ jsxs("g", { opacity: el.opacity ?? 1, children: [
|
|
271
|
-
pathsToReactNodes(paths, "ellipse", opts.stroke, dash),
|
|
272
|
-
el.label ? /* @__PURE__ */ jsx(Label, { cx: el.x + el.w / 2, cy: el.y + el.h / 2, label: el.label, stroke: el.stroke }) : null
|
|
273
|
-
] });
|
|
274
|
-
}
|
|
275
|
-
function renderDiamond(gen, el) {
|
|
276
|
-
const opts = buildOptions(el, el.seed ?? 0);
|
|
277
|
-
const cx = el.x + el.w / 2;
|
|
278
|
-
const cy = el.y + el.h / 2;
|
|
279
|
-
const points = [
|
|
280
|
-
[cx, el.y],
|
|
281
|
-
// top
|
|
282
|
-
[el.x + el.w, cy],
|
|
283
|
-
// right
|
|
284
|
-
[cx, el.y + el.h],
|
|
285
|
-
// bottom
|
|
286
|
-
[el.x, cy]
|
|
287
|
-
// left
|
|
288
|
-
];
|
|
289
|
-
const drawable = gen.polygon(points, opts);
|
|
290
|
-
const paths = toRoughPaths(gen, drawable);
|
|
291
|
-
const dash = strokeDashArray(el.strokeStyle, el.strokeWidth ?? 1.5);
|
|
292
|
-
return /* @__PURE__ */ jsxs("g", { opacity: el.opacity ?? 1, children: [
|
|
293
|
-
pathsToReactNodes(paths, "diamond", opts.stroke, dash),
|
|
294
|
-
el.label ? /* @__PURE__ */ jsx(Label, { cx, cy, label: el.label, stroke: el.stroke }) : null
|
|
295
|
-
] });
|
|
296
|
-
}
|
|
297
|
-
var FONT_STACKS = {
|
|
298
|
-
sans: "ui-sans-serif, system-ui, sans-serif",
|
|
299
|
-
serif: "ui-serif, Georgia, serif",
|
|
300
|
-
mono: "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
301
|
-
hand: '"Virgil", "Caveat", "Comic Sans MS", cursive'
|
|
302
|
-
};
|
|
303
|
-
function textAnchor(align2) {
|
|
304
|
-
if (align2 === "center") return "middle";
|
|
305
|
-
if (align2 === "right") return "end";
|
|
306
|
-
return "start";
|
|
307
|
-
}
|
|
308
|
-
function renderText(el) {
|
|
309
|
-
const fontSize = el.fontSize ?? 18;
|
|
310
|
-
const fontFamily2 = FONT_STACKS[el.fontFamily ?? "hand"];
|
|
311
|
-
const anchor = textAnchor(el.align);
|
|
312
|
-
const lines = el.text.split("\n");
|
|
313
|
-
return /* @__PURE__ */ jsx("g", { opacity: el.opacity ?? 1, children: /* @__PURE__ */ jsx(
|
|
314
|
-
"text",
|
|
315
|
-
{
|
|
316
|
-
x: el.x,
|
|
317
|
-
y: el.y,
|
|
318
|
-
textAnchor: anchor,
|
|
319
|
-
dominantBaseline: "hanging",
|
|
320
|
-
fontSize,
|
|
321
|
-
fontFamily: fontFamily2,
|
|
322
|
-
fill: el.stroke ?? "currentColor",
|
|
323
|
-
children: lines.map((line, i) => (
|
|
324
|
-
// biome-ignore lint/suspicious/noArrayIndexKey: text is split deterministically on '\n' so the line index is the most stable key.
|
|
325
|
-
/* @__PURE__ */ jsx("tspan", { x: el.x, dy: i === 0 ? 0 : fontSize * 1.2, children: line }, i)
|
|
326
|
-
))
|
|
327
|
-
}
|
|
328
|
-
) });
|
|
329
|
-
}
|
|
330
|
-
function elementWithSeed(el) {
|
|
331
|
-
if (typeof el.seed === "number") return el;
|
|
332
|
-
return { ...el, seed: deriveSeed(el) };
|
|
333
|
-
}
|
|
334
|
-
function renderElement(el, gen) {
|
|
335
|
-
switch (el.type) {
|
|
336
|
-
case "rect":
|
|
337
|
-
return renderRect(gen, elementWithSeed(el));
|
|
338
|
-
case "ellipse":
|
|
339
|
-
return renderEllipse(gen, elementWithSeed(el));
|
|
340
|
-
case "diamond":
|
|
341
|
-
return renderDiamond(gen, elementWithSeed(el));
|
|
342
|
-
case "line":
|
|
343
|
-
return renderLine(gen, elementWithSeed(el));
|
|
344
|
-
case "arrow":
|
|
345
|
-
return renderArrow(gen, elementWithSeed(el));
|
|
346
|
-
case "text":
|
|
347
|
-
return renderText(elementWithSeed(el));
|
|
348
|
-
case "freedraw":
|
|
349
|
-
return renderFreedraw(elementWithSeed(el));
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
function renderScene(scene, gen) {
|
|
353
|
-
return /* @__PURE__ */ jsx(Fragment, { children: scene.elements.map((el, i) => /* @__PURE__ */ jsx(
|
|
354
|
-
"g",
|
|
355
|
-
{
|
|
356
|
-
"data-element-id": el.id ?? String(i),
|
|
357
|
-
"data-element-type": el.type,
|
|
358
|
-
children: renderElement(el, gen)
|
|
359
|
-
},
|
|
360
|
-
el.id ?? `__idx-${i}`
|
|
361
|
-
)) });
|
|
362
|
-
}
|
|
363
|
-
var finiteNumber = z.number().finite();
|
|
364
|
-
var finitePositive = finiteNumber.positive();
|
|
365
|
-
var strokeStyle = z.enum(["solid", "dashed", "dotted"]);
|
|
366
|
-
var fillStyle = z.enum(["hachure", "solid", "cross-hatch", "zigzag"]);
|
|
367
|
-
var align = z.enum(["left", "center", "right"]);
|
|
368
|
-
var fontFamily = z.enum(["sans", "serif", "mono", "hand"]);
|
|
369
|
-
var roundness = z.enum(["sharp", "round"]);
|
|
370
|
-
var baseElement = z.object({
|
|
371
|
-
id: z.string().max(120).optional(),
|
|
372
|
-
x: finiteNumber,
|
|
373
|
-
y: finiteNumber,
|
|
374
|
-
stroke: z.string().max(64).optional(),
|
|
375
|
-
strokeWidth: finitePositive.max(50).optional(),
|
|
376
|
-
strokeStyle: strokeStyle.optional(),
|
|
377
|
-
fill: z.string().max(64).optional(),
|
|
378
|
-
fillStyle: fillStyle.optional(),
|
|
379
|
-
opacity: finiteNumber.min(0).max(1).optional(),
|
|
380
|
-
roughness: finiteNumber.min(0).max(3).optional(),
|
|
381
|
-
seed: z.number().int().finite().optional()
|
|
382
|
-
});
|
|
383
|
-
var dim = finitePositive.max(2e4);
|
|
384
|
-
var labelText = z.string().max(500);
|
|
385
|
-
var rectElement = baseElement.extend({
|
|
386
|
-
type: z.literal("rect"),
|
|
387
|
-
w: dim,
|
|
388
|
-
h: dim,
|
|
389
|
-
label: labelText.optional(),
|
|
390
|
-
roundness: roundness.optional()
|
|
391
|
-
});
|
|
392
|
-
var ellipseElement = baseElement.extend({
|
|
393
|
-
type: z.literal("ellipse"),
|
|
394
|
-
w: dim,
|
|
395
|
-
h: dim,
|
|
396
|
-
label: labelText.optional()
|
|
397
|
-
});
|
|
398
|
-
var diamondElement = baseElement.extend({
|
|
399
|
-
type: z.literal("diamond"),
|
|
400
|
-
w: dim,
|
|
401
|
-
h: dim,
|
|
402
|
-
label: labelText.optional()
|
|
403
|
-
});
|
|
404
|
-
var point2 = z.tuple([finiteNumber, finiteNumber]);
|
|
405
|
-
var lineElement = baseElement.extend({
|
|
406
|
-
type: z.literal("line"),
|
|
407
|
-
to: point2
|
|
408
|
-
});
|
|
409
|
-
var arrowElement = baseElement.extend({
|
|
410
|
-
type: z.literal("arrow"),
|
|
411
|
-
to: point2,
|
|
412
|
-
label: labelText.optional(),
|
|
413
|
-
headStart: z.boolean().optional(),
|
|
414
|
-
headEnd: z.boolean().default(true)
|
|
415
|
-
});
|
|
416
|
-
var textElement = baseElement.extend({
|
|
417
|
-
type: z.literal("text"),
|
|
418
|
-
text: z.string().max(5e3),
|
|
419
|
-
fontSize: finitePositive.max(500).optional(),
|
|
420
|
-
align: align.optional(),
|
|
421
|
-
fontFamily: fontFamily.optional()
|
|
422
|
-
});
|
|
423
|
-
var freedrawPoint = z.tuple([finiteNumber, finiteNumber, finiteNumber.optional()]);
|
|
424
|
-
var freedrawElement = baseElement.extend({
|
|
425
|
-
type: z.literal("freedraw"),
|
|
426
|
-
points: z.array(freedrawPoint).min(2).max(5e3)
|
|
427
|
-
});
|
|
428
|
-
var whiteboardElement = z.discriminatedUnion("type", [
|
|
429
|
-
rectElement,
|
|
430
|
-
ellipseElement,
|
|
431
|
-
diamondElement,
|
|
432
|
-
lineElement,
|
|
433
|
-
arrowElement,
|
|
434
|
-
textElement,
|
|
435
|
-
freedrawElement
|
|
436
|
-
]);
|
|
437
|
-
var whiteboardScene = z.object({
|
|
438
|
-
version: z.literal(1),
|
|
439
|
-
width: dim,
|
|
440
|
-
// EC-4: clamped 1..20000
|
|
441
|
-
height: dim,
|
|
442
|
-
// EC-4: clamped 1..20000
|
|
443
|
-
background: z.string().max(64).optional(),
|
|
444
|
-
elements: z.array(whiteboardElement).max(5e3)
|
|
445
|
-
});
|
|
446
|
-
|
|
447
|
-
// src/components/primitives/whiteboard/validate.ts
|
|
448
|
-
function valueAtPath(input, path) {
|
|
449
|
-
let cursor = input;
|
|
450
|
-
for (const segment of path) {
|
|
451
|
-
if (cursor === null || typeof cursor !== "object") return void 0;
|
|
452
|
-
cursor = cursor[segment];
|
|
453
|
-
}
|
|
454
|
-
return cursor;
|
|
455
|
-
}
|
|
456
|
-
function formatIssue(issue, input) {
|
|
457
|
-
const error = {
|
|
458
|
-
path: issue.path.join("."),
|
|
459
|
-
message: issue.message,
|
|
460
|
-
code: issue.code
|
|
461
|
-
};
|
|
462
|
-
if ("received" in issue && issue.received !== void 0) {
|
|
463
|
-
error.got = issue.received;
|
|
464
|
-
} else if (issue.path.length > 0) {
|
|
465
|
-
const value = valueAtPath(input, issue.path);
|
|
466
|
-
if (value !== void 0) error.got = value;
|
|
467
|
-
}
|
|
468
|
-
return error;
|
|
469
|
-
}
|
|
470
|
-
function validateScene(input) {
|
|
471
|
-
const result = whiteboardScene.safeParse(input);
|
|
472
|
-
if (result.success) {
|
|
473
|
-
return { ok: true, scene: result.data };
|
|
474
|
-
}
|
|
475
|
-
const errors = result.error.issues.map(
|
|
476
|
-
(issue) => formatIssue(issue, input)
|
|
477
|
-
);
|
|
478
|
-
return { ok: false, errors };
|
|
479
|
-
}
|
|
480
|
-
function usePointerPan(ref, viewport, size) {
|
|
481
|
-
const dragRef = useRef(null);
|
|
482
|
-
const spaceHeldRef = useRef(false);
|
|
483
|
-
useEffect(() => {
|
|
484
|
-
const el = ref.current;
|
|
485
|
-
if (!el) return;
|
|
486
|
-
const handler = (e) => {
|
|
487
|
-
e.preventDefault();
|
|
488
|
-
const rect = el.getBoundingClientRect();
|
|
489
|
-
const localX = e.clientX - rect.left;
|
|
490
|
-
const localY = e.clientY - rect.top;
|
|
491
|
-
const scaleX = size.width / rect.width;
|
|
492
|
-
const scaleY = size.height / rect.height;
|
|
493
|
-
viewport.zoomAt(localX * scaleX, localY * scaleY, -e.deltaY * 1e-3, size);
|
|
494
|
-
};
|
|
495
|
-
el.addEventListener("wheel", handler, { passive: false });
|
|
496
|
-
return () => el.removeEventListener("wheel", handler);
|
|
497
|
-
}, [ref, viewport, size]);
|
|
498
|
-
useEffect(() => {
|
|
499
|
-
const down = (e) => {
|
|
500
|
-
if (e.code === "Space") spaceHeldRef.current = true;
|
|
501
|
-
};
|
|
502
|
-
const up = (e) => {
|
|
503
|
-
if (e.code === "Space") spaceHeldRef.current = false;
|
|
504
|
-
};
|
|
505
|
-
window.addEventListener("keydown", down);
|
|
506
|
-
window.addEventListener("keyup", up);
|
|
507
|
-
return () => {
|
|
508
|
-
window.removeEventListener("keydown", down);
|
|
509
|
-
window.removeEventListener("keyup", up);
|
|
510
|
-
};
|
|
511
|
-
}, []);
|
|
512
|
-
const onPointerDown = useCallback((e) => {
|
|
513
|
-
if (e.target instanceof Element && !e.currentTarget.contains(e.target)) return;
|
|
514
|
-
const isMouseButton = e.button === 0 || e.button === 1;
|
|
515
|
-
if (!isMouseButton && e.pointerType === "mouse") return;
|
|
516
|
-
if (e.pointerType === "mouse" && e.button !== 1 && !spaceHeldRef.current && e.button !== 0) {
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
dragRef.current = { pointerId: e.pointerId, lastX: e.clientX, lastY: e.clientY };
|
|
520
|
-
e.currentTarget.setPointerCapture(e.pointerId);
|
|
521
|
-
}, []);
|
|
522
|
-
const onPointerMove = useCallback(
|
|
523
|
-
(e) => {
|
|
524
|
-
const drag = dragRef.current;
|
|
525
|
-
if (!drag || drag.pointerId !== e.pointerId) return;
|
|
526
|
-
const dx = e.clientX - drag.lastX;
|
|
527
|
-
const dy = e.clientY - drag.lastY;
|
|
528
|
-
drag.lastX = e.clientX;
|
|
529
|
-
drag.lastY = e.clientY;
|
|
530
|
-
const el = ref.current;
|
|
531
|
-
if (!el) return;
|
|
532
|
-
const rect = el.getBoundingClientRect();
|
|
533
|
-
const scaleX = size.width / rect.width;
|
|
534
|
-
const scaleY = size.height / rect.height;
|
|
535
|
-
viewport.pan(dx * scaleX, dy * scaleY);
|
|
536
|
-
},
|
|
537
|
-
[ref, viewport, size]
|
|
538
|
-
);
|
|
539
|
-
const releaseDrag = useCallback((e) => {
|
|
540
|
-
const drag = dragRef.current;
|
|
541
|
-
if (!drag || drag.pointerId !== e.pointerId) return;
|
|
542
|
-
try {
|
|
543
|
-
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
544
|
-
} catch {
|
|
545
|
-
}
|
|
546
|
-
dragRef.current = null;
|
|
547
|
-
}, []);
|
|
548
|
-
return {
|
|
549
|
-
onPointerDown,
|
|
550
|
-
onPointerMove,
|
|
551
|
-
onPointerUp: releaseDrag,
|
|
552
|
-
onPointerCancel: releaseDrag
|
|
553
|
-
};
|
|
554
|
-
}
|
|
555
|
-
var MIN_ZOOM = 0.1;
|
|
556
|
-
var MAX_ZOOM = 8;
|
|
557
|
-
function clampZoom(z2) {
|
|
558
|
-
if (!Number.isFinite(z2)) return 1;
|
|
559
|
-
return Math.min(MAX_ZOOM, Math.max(MIN_ZOOM, z2));
|
|
560
|
-
}
|
|
561
|
-
function useViewport(opts) {
|
|
562
|
-
const initial = useMemo(() => {
|
|
563
|
-
const zoom = clampZoom(opts.initialZoom ?? 1);
|
|
564
|
-
if (opts.initialCenter) {
|
|
565
|
-
const [cx, cy] = opts.initialCenter;
|
|
566
|
-
return {
|
|
567
|
-
x: cx - opts.width / (2 * zoom),
|
|
568
|
-
y: cy - opts.height / (2 * zoom),
|
|
569
|
-
zoom
|
|
570
|
-
};
|
|
571
|
-
}
|
|
572
|
-
return { x: 0, y: 0, zoom };
|
|
573
|
-
}, [opts.initialCenter, opts.initialZoom, opts.width, opts.height]);
|
|
574
|
-
const [state, setState] = useState(initial);
|
|
575
|
-
const pan = useCallback((dx, dy) => {
|
|
576
|
-
setState((prev) => ({ ...prev, x: prev.x - dx / prev.zoom, y: prev.y - dy / prev.zoom }));
|
|
577
|
-
}, []);
|
|
578
|
-
const setZoom = useCallback((zoom) => {
|
|
579
|
-
setState((prev) => ({ ...prev, zoom: clampZoom(zoom) }));
|
|
580
|
-
}, []);
|
|
581
|
-
const zoomAt = useCallback(
|
|
582
|
-
(screenX, screenY, delta, _size) => {
|
|
583
|
-
setState((prev) => {
|
|
584
|
-
const oldZoom = prev.zoom;
|
|
585
|
-
const newZoom = clampZoom(prev.zoom * Math.exp(delta));
|
|
586
|
-
if (newZoom === oldZoom) return prev;
|
|
587
|
-
const worldX = prev.x + screenX / oldZoom;
|
|
588
|
-
const worldY = prev.y + screenY / oldZoom;
|
|
589
|
-
return {
|
|
590
|
-
x: worldX - screenX / newZoom,
|
|
591
|
-
y: worldY - screenY / newZoom,
|
|
592
|
-
zoom: newZoom
|
|
593
|
-
};
|
|
594
|
-
});
|
|
595
|
-
},
|
|
596
|
-
[]
|
|
597
|
-
);
|
|
598
|
-
const reset = useCallback(() => setState(initial), [initial]);
|
|
599
|
-
const fitTo = useCallback((bounds, size) => {
|
|
600
|
-
const bboxWidth = Math.max(1, bounds.maxX - bounds.minX);
|
|
601
|
-
const bboxHeight = Math.max(1, bounds.maxY - bounds.minY);
|
|
602
|
-
const zoomX = size.width / bboxWidth;
|
|
603
|
-
const zoomY = size.height / bboxHeight;
|
|
604
|
-
const zoom = clampZoom(Math.min(zoomX, zoomY));
|
|
605
|
-
const cx = (bounds.minX + bounds.maxX) / 2;
|
|
606
|
-
const cy = (bounds.minY + bounds.maxY) / 2;
|
|
607
|
-
setState({
|
|
608
|
-
x: cx - size.width / (2 * zoom),
|
|
609
|
-
y: cy - size.height / (2 * zoom),
|
|
610
|
-
zoom
|
|
611
|
-
});
|
|
612
|
-
}, []);
|
|
613
|
-
const viewBox = useCallback(
|
|
614
|
-
(size) => `${state.x} ${state.y} ${size.width / state.zoom} ${size.height / state.zoom}`,
|
|
615
|
-
[state]
|
|
616
|
-
);
|
|
617
|
-
return { state, pan, setZoom, zoomAt, reset, fitTo, viewBox };
|
|
618
|
-
}
|
|
619
|
-
function computeBounds(scene) {
|
|
620
|
-
if (scene.elements.length === 0) return null;
|
|
621
|
-
let minX = Number.POSITIVE_INFINITY;
|
|
622
|
-
let minY = Number.POSITIVE_INFINITY;
|
|
623
|
-
let maxX = Number.NEGATIVE_INFINITY;
|
|
624
|
-
let maxY = Number.NEGATIVE_INFINITY;
|
|
625
|
-
for (const el of scene.elements) {
|
|
626
|
-
const x1 = el.x;
|
|
627
|
-
const y1 = el.y;
|
|
628
|
-
let x2 = el.x;
|
|
629
|
-
let y2 = el.y;
|
|
630
|
-
if (el.type === "rect" || el.type === "ellipse" || el.type === "diamond") {
|
|
631
|
-
x2 = el.x + el.w;
|
|
632
|
-
y2 = el.y + el.h;
|
|
633
|
-
} else if (el.type === "line" || el.type === "arrow") {
|
|
634
|
-
x2 = el.to[0];
|
|
635
|
-
y2 = el.to[1];
|
|
636
|
-
} else if (el.type === "freedraw") {
|
|
637
|
-
for (const [px, py] of el.points) {
|
|
638
|
-
const tx = el.x + px;
|
|
639
|
-
const ty = el.y + py;
|
|
640
|
-
if (tx < minX) minX = tx;
|
|
641
|
-
if (ty < minY) minY = ty;
|
|
642
|
-
if (tx > maxX) maxX = tx;
|
|
643
|
-
if (ty > maxY) maxY = ty;
|
|
644
|
-
}
|
|
645
|
-
continue;
|
|
646
|
-
}
|
|
647
|
-
if (x1 < minX) minX = x1;
|
|
648
|
-
if (y1 < minY) minY = y1;
|
|
649
|
-
if (x2 < minX) minX = x2;
|
|
650
|
-
if (y2 < minY) minY = y2;
|
|
651
|
-
if (x1 > maxX) maxX = x1;
|
|
652
|
-
if (y1 > maxY) maxY = y1;
|
|
653
|
-
if (x2 > maxX) maxX = x2;
|
|
654
|
-
if (y2 > maxY) maxY = y2;
|
|
655
|
-
}
|
|
656
|
-
if (!Number.isFinite(minX)) return null;
|
|
657
|
-
return { minX, minY, maxX, maxY };
|
|
658
|
-
}
|
|
659
|
-
function Whiteboard({
|
|
660
|
-
data,
|
|
661
|
-
className,
|
|
662
|
-
initialZoom,
|
|
663
|
-
initialCenter,
|
|
664
|
-
fitOnLoad,
|
|
665
|
-
onValidationError,
|
|
666
|
-
"aria-label": ariaLabel
|
|
667
|
-
}) {
|
|
668
|
-
const validation = useMemo(() => validateScene(data), [data]);
|
|
669
|
-
const scene = validation.ok ? validation.scene : null;
|
|
670
|
-
useEffect(() => {
|
|
671
|
-
if (!validation.ok && onValidationError) {
|
|
672
|
-
onValidationError(validation.errors);
|
|
673
|
-
}
|
|
674
|
-
}, [validation, onValidationError]);
|
|
675
|
-
const generator = useMemo(() => {
|
|
676
|
-
if (typeof globalThis === "undefined") return null;
|
|
677
|
-
try {
|
|
678
|
-
return rough.generator();
|
|
679
|
-
} catch {
|
|
680
|
-
return null;
|
|
681
|
-
}
|
|
682
|
-
}, []);
|
|
683
|
-
const sceneWidth = scene?.width ?? 400;
|
|
684
|
-
const sceneHeight = scene?.height ?? 300;
|
|
685
|
-
const sceneBackground = scene?.background;
|
|
686
|
-
const viewport = useViewport({
|
|
687
|
-
width: sceneWidth,
|
|
688
|
-
height: sceneHeight,
|
|
689
|
-
initialZoom,
|
|
690
|
-
initialCenter
|
|
691
|
-
});
|
|
692
|
-
const svgRef = useRef(null);
|
|
693
|
-
const fitTo = viewport.fitTo;
|
|
694
|
-
useEffect(() => {
|
|
695
|
-
if (!fitOnLoad || !scene) return;
|
|
696
|
-
const bounds = computeBounds(scene);
|
|
697
|
-
if (!bounds) return;
|
|
698
|
-
fitTo(bounds, { width: sceneWidth, height: sceneHeight });
|
|
699
|
-
}, [fitOnLoad, scene, sceneWidth, sceneHeight, fitTo]);
|
|
700
|
-
const handlers = usePointerPan(svgRef, viewport, {
|
|
701
|
-
width: sceneWidth,
|
|
702
|
-
height: sceneHeight
|
|
703
|
-
});
|
|
704
|
-
const label = ariaLabel ?? "Whiteboard diagram";
|
|
705
|
-
return /* @__PURE__ */ jsxs(
|
|
706
|
-
"svg",
|
|
707
|
-
{
|
|
708
|
-
"data-slot": "whiteboard",
|
|
709
|
-
ref: svgRef,
|
|
710
|
-
viewBox: viewport.viewBox({ width: sceneWidth, height: sceneHeight }),
|
|
711
|
-
width: sceneWidth,
|
|
712
|
-
height: sceneHeight,
|
|
713
|
-
className,
|
|
714
|
-
role: "img",
|
|
715
|
-
"aria-label": label,
|
|
716
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
717
|
-
"data-whiteboard-state": scene ? "ok" : "invalid",
|
|
718
|
-
style: { touchAction: "none", userSelect: "none" },
|
|
719
|
-
...handlers,
|
|
720
|
-
children: [
|
|
721
|
-
/* @__PURE__ */ jsx("title", { children: label }),
|
|
722
|
-
sceneBackground ? /* @__PURE__ */ jsx(
|
|
723
|
-
"rect",
|
|
724
|
-
{
|
|
725
|
-
x: 0,
|
|
726
|
-
y: 0,
|
|
727
|
-
width: sceneWidth,
|
|
728
|
-
height: sceneHeight,
|
|
729
|
-
fill: sceneBackground,
|
|
730
|
-
"data-layer": "background"
|
|
731
|
-
}
|
|
732
|
-
) : null,
|
|
733
|
-
scene && generator ? renderScene(scene, generator) : null
|
|
734
|
-
]
|
|
735
|
-
}
|
|
736
|
-
);
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
export { Whiteboard, validateScene };
|
|
740
|
-
//# sourceMappingURL=index.js.map
|
|
741
|
-
//# sourceMappingURL=index.js.map
|