sparkdesign 0.0.1 → 0.2.6
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 +279 -5
- package/cli/dist/commands/add.js +84 -0
- package/cli/dist/commands/diff.js +54 -0
- package/cli/dist/commands/init.js +96 -0
- package/cli/dist/commands/list.js +25 -0
- package/cli/dist/index.js +37 -0
- package/cli/dist/utils/config.js +53 -0
- package/cli/dist/utils/registry.js +34 -0
- package/cli/dist/utils/tokens.js +90 -0
- package/cli/dist/utils/transform.js +19 -0
- package/cli/registry/basic/alert-dialog.tsx +180 -0
- package/cli/registry/basic/avatar.tsx +120 -0
- package/cli/registry/basic/button.tsx +100 -0
- package/cli/registry/basic/collapse.tsx +94 -0
- package/cli/registry/basic/collapsible-card.tsx +230 -0
- package/cli/registry/basic/collapsible.tsx +21 -0
- package/cli/registry/basic/dropdown-menu.tsx +254 -0
- package/cli/registry/basic/icon-button.tsx +66 -0
- package/cli/registry/basic/icons-inline.tsx +206 -0
- package/cli/registry/basic/kbd.tsx +50 -0
- package/cli/registry/basic/option-list.tsx +125 -0
- package/cli/registry/basic/pagination.tsx +132 -0
- package/cli/registry/basic/progress.tsx +42 -0
- package/cli/registry/basic/radio-group.tsx +69 -0
- package/cli/registry/basic/resizable.tsx +67 -0
- package/cli/registry/basic/scrollbar.tsx +114 -0
- package/cli/registry/basic/select.tsx +177 -0
- package/cli/registry/basic/skeleton.tsx +33 -0
- package/cli/registry/basic/slider.tsx +55 -0
- package/cli/registry/basic/sonner.tsx +104 -0
- package/cli/registry/basic/spinner.tsx +17 -0
- package/cli/registry/basic/switch.tsx +49 -0
- package/cli/registry/basic/table.tsx +117 -0
- package/cli/registry/basic/tabs.tsx +85 -0
- package/cli/registry/basic/tag.tsx +161 -0
- package/cli/registry/basic/theme-from-document.ts +10 -0
- package/cli/registry/basic/toggle.tsx +223 -0
- package/cli/registry/basic/tooltip.tsx +80 -0
- package/cli/registry/basic/typography.tsx +201 -0
- package/cli/registry/chat/browser-use-part.tsx +166 -0
- package/cli/registry/chat/chat-input/chat-input-folder-selector.tsx +185 -0
- package/cli/registry/chat/chat-input/chat-input-model-switcher.tsx +131 -0
- package/cli/registry/chat/chat-input/chat-input-textarea.tsx +67 -0
- package/cli/registry/chat/chat-input/compound.tsx +334 -0
- package/cli/registry/chat/chat-input/context.tsx +189 -0
- package/cli/registry/chat/chat-input/folder-permission-dialog.tsx +61 -0
- package/cli/registry/chat/chat-input/index.tsx +123 -0
- package/cli/registry/chat/chat-input/types.ts +77 -0
- package/cli/registry/chat/chat-input/useAutoResizeTextarea.ts +20 -0
- package/cli/registry/chat/code-block-part.tsx +151 -0
- package/cli/registry/chat/file-attachment.tsx +44 -0
- package/cli/registry/chat/file-card.tsx +68 -0
- package/cli/registry/chat/file-review-part.tsx +259 -0
- package/cli/registry/chat/folder-button.tsx +169 -0
- package/cli/registry/chat/generated-images-grid.tsx +56 -0
- package/cli/registry/chat/generation-status-bar.tsx +72 -0
- package/cli/registry/chat/image-attachment.tsx +166 -0
- package/cli/registry/chat/image-generating.tsx +281 -0
- package/cli/registry/chat/markdown.tsx +146 -0
- package/cli/registry/chat/mermaid-part.tsx +90 -0
- package/cli/registry/chat/permission-card.tsx +178 -0
- package/cli/registry/chat/plan-part.tsx +168 -0
- package/cli/registry/chat/question-part.tsx +70 -0
- package/cli/registry/chat/queue-indicator.tsx +234 -0
- package/cli/registry/chat/reasoning-step.tsx +358 -0
- package/cli/registry/chat/related-prompts.tsx +91 -0
- package/cli/registry/chat/request.tsx +38 -0
- package/cli/registry/chat/response.tsx +271 -0
- package/cli/registry/chat/send-button.tsx +94 -0
- package/cli/registry/chat/sidebar-menu.tsx +177 -0
- package/cli/registry/chat/streaming-markdown-block.tsx +111 -0
- package/cli/registry/chat/suggestion-part.tsx +165 -0
- package/cli/registry/chat/task-part.tsx +109 -0
- package/cli/registry/chat/terminal-code-block-part.tsx +69 -0
- package/cli/registry/chat/thinking-indicator.tsx +91 -0
- package/cli/registry/chat/tool-invocation-card.tsx +132 -0
- package/cli/registry/chat/user-question/UserQuestionCard.tsx +198 -0
- package/cli/registry/chat/user-question/UserQuestionFooter.tsx +66 -0
- package/cli/registry/chat/user-question/UserQuestionHeader.tsx +64 -0
- package/cli/registry/chat/user-question/index.tsx +340 -0
- package/cli/registry/chat/user-question/types.ts +61 -0
- package/cli/registry/chat/user-question/useUserQuestionKeyboard.ts +127 -0
- package/cli/registry/chat/user-question/useUserQuestionState.ts +165 -0
- package/cli/registry/chat/user-question-answer.tsx +62 -0
- package/cli/registry/lib/file-icon-maps.ts +150 -0
- package/cli/registry/lib/use-mermaid-render.ts +76 -0
- package/cli/registry/lib/utils.ts +6 -0
- package/cli/registry/meta.json +1 -0
- package/cli/registry/tokens/scale.css +299 -0
- package/cli/registry/tokens/theme.css +633 -0
- package/dist/_basePickBy-DnQN8w3y.js +151 -0
- package/dist/_basePickBy-a-kPMlkg.cjs +1 -0
- package/dist/_baseUniq-B-N2NQ50.js +614 -0
- package/dist/_baseUniq-Cc_zbSif.cjs +1 -0
- package/dist/arc-BQBhijZ6.js +83 -0
- package/dist/arc-mWQt0Yph.cjs +1 -0
- package/dist/architectureDiagram-VXUJARFQ-BMZEucno.cjs +36 -0
- package/dist/architectureDiagram-VXUJARFQ-DTdjD3Bp.js +4661 -0
- package/dist/blockDiagram-VD42YOAC-CzHn0yob.js +2256 -0
- package/dist/blockDiagram-VD42YOAC-DDxdHAlz.cjs +122 -0
- package/dist/c4Diagram-YG6GDRKO-4Gz0I4gj.cjs +10 -0
- package/dist/c4Diagram-YG6GDRKO-BIy--yVN.js +1580 -0
- package/dist/channel-BQn0o8bs.js +5 -0
- package/dist/channel-DaN7XniJ.cjs +1 -0
- package/dist/chunk-4BX2VUAB-BlQFTQqz.cjs +1 -0
- package/dist/chunk-4BX2VUAB-Czitj3Kc.js +8 -0
- package/dist/chunk-55IACEB6-DXacNZbO.js +8 -0
- package/dist/chunk-55IACEB6-DnDxpye9.cjs +1 -0
- package/dist/chunk-B4BG7PRW-CBdN0q_V.js +1375 -0
- package/dist/chunk-B4BG7PRW-DbGvUkGO.cjs +165 -0
- package/dist/chunk-DI55MBZ5-D1YJMs6x.cjs +220 -0
- package/dist/chunk-DI55MBZ5-NCQTvayw.js +1370 -0
- package/dist/chunk-FMBD7UC4-CsGMbrtr.js +19 -0
- package/dist/chunk-FMBD7UC4-Di7cUUh5.cjs +15 -0
- package/dist/chunk-QN33PNHL-0j5LC8Lm.cjs +1 -0
- package/dist/chunk-QN33PNHL-3GERZBRm.js +19 -0
- package/dist/chunk-QZHKN3VN-AVEY9ImQ.js +15 -0
- package/dist/chunk-QZHKN3VN-s8Z0a8mc.cjs +1 -0
- package/dist/chunk-TZMSLE5B-CAf87HPt.cjs +1 -0
- package/dist/chunk-TZMSLE5B-sbiflal0.js +64 -0
- package/dist/classDiagram-2ON5EDUG-Ct9JLIN2.cjs +1 -0
- package/dist/classDiagram-2ON5EDUG-Dzfrft3a.js +16 -0
- package/dist/classDiagram-v2-WZHVMYZB-Ct9JLIN2.cjs +1 -0
- package/dist/classDiagram-v2-WZHVMYZB-Dzfrft3a.js +16 -0
- package/dist/clone-Cde_NQ8V.js +8 -0
- package/dist/clone-DCNjWuM2.cjs +1 -0
- package/dist/cose-bilkent-S5V4N54A-0uLijMro.cjs +1 -0
- package/dist/cose-bilkent-S5V4N54A-Bb08N431.js +2608 -0
- package/dist/cytoscape.esm-CNUX3VTg.cjs +321 -0
- package/dist/cytoscape.esm-Cvf3sx9F.js +18704 -0
- package/dist/dagre-6UL2VRFP-CY_Wz5Zd.js +444 -0
- package/dist/dagre-6UL2VRFP-Dxe7_qZc.cjs +4 -0
- package/dist/defaultLocale-BgPVtth8.js +171 -0
- package/dist/defaultLocale-C4wbwF1n.cjs +1 -0
- package/dist/diagram-PSM6KHXK-D2bdb7MT.js +531 -0
- package/dist/diagram-PSM6KHXK-YF69SUjY.cjs +24 -0
- package/dist/diagram-QEK2KX5R-BpUSoh0-.js +217 -0
- package/dist/diagram-QEK2KX5R-DZPGteon.cjs +43 -0
- package/dist/diagram-S2PKOQOG-ht-zdvFG.cjs +24 -0
- package/dist/diagram-S2PKOQOG-zFeLJ50Z.js +142 -0
- package/dist/erDiagram-Q2GNP2WA-B38iJ6ts.js +841 -0
- package/dist/erDiagram-Q2GNP2WA-RgS80DDU.cjs +60 -0
- package/dist/flowDiagram-NV44I4VS-BHilOs2p.cjs +162 -0
- package/dist/flowDiagram-NV44I4VS-BrBJcoce.js +1620 -0
- package/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/ganttDiagram-JELNMOA3-pZiJeFio.cjs +267 -0
- package/dist/ganttDiagram-JELNMOA3-tw6FhkWJ.js +2670 -0
- package/dist/gitGraphDiagram-V2S2FVAM-BWn5uIK5.js +699 -0
- package/dist/gitGraphDiagram-V2S2FVAM-DKKeG-9R.cjs +65 -0
- package/dist/graph-DIbblrZP.cjs +1 -0
- package/dist/graph-DPcK91G3.js +247 -0
- package/dist/infoDiagram-HS3SLOUP-B8gwwhct.cjs +2 -0
- package/dist/infoDiagram-HS3SLOUP-D47PNcP_.js +24 -0
- package/dist/init-CHZsXQcr.cjs +1 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/journeyDiagram-XKPGCS4Q-BG3cfhyU.js +834 -0
- package/dist/journeyDiagram-XKPGCS4Q-D8DVLJof.cjs +139 -0
- package/dist/kanban-definition-3W4ZIXB7-4OCnEouP.cjs +89 -0
- package/dist/kanban-definition-3W4ZIXB7-CWi_ssF9.js +719 -0
- package/dist/katex.css +1 -0
- package/dist/layout-Byuh8f-J.cjs +1 -0
- package/dist/layout-CdLdvj1j.js +1335 -0
- package/dist/linear-C2Q_PI9B.js +259 -0
- package/dist/linear-C69aPBW1.cjs +1 -0
- package/dist/mermaid.core-DBwAx_jp.cjs +249 -0
- package/dist/mermaid.core-gFR0XUlD.js +15300 -0
- package/dist/mindmap-definition-VGOIOE7T-8P7obVV4.cjs +68 -0
- package/dist/mindmap-definition-VGOIOE7T-DnOa7WJ9.js +784 -0
- package/dist/ordinal-B6-f3MAq.js +61 -0
- package/dist/ordinal-CagbB1m8.cjs +1 -0
- package/dist/pieDiagram-ADFJNKIX-5NAlvhMo.js +161 -0
- package/dist/pieDiagram-ADFJNKIX-CQBG4yR9.cjs +30 -0
- package/dist/qoder-design.css +2 -0
- package/dist/quadrantDiagram-AYHSOK5B-Oe4y7RZ0.cjs +7 -0
- package/dist/quadrantDiagram-AYHSOK5B-rh2DPEP1.js +1022 -0
- package/dist/registry/basic/alert-dialog.d.ts +40 -0
- package/dist/registry/basic/avatar.d.ts +30 -0
- package/dist/registry/basic/button.d.ts +16 -0
- package/dist/registry/basic/collapse.d.ts +22 -0
- package/dist/registry/basic/collapsible-card.d.ts +34 -0
- package/dist/registry/basic/collapsible.d.ts +15 -0
- package/dist/registry/basic/dropdown-menu.d.ts +52 -0
- package/dist/registry/basic/icon-button.d.ts +12 -0
- package/dist/registry/basic/icons-inline.d.ts +51 -0
- package/dist/registry/basic/kbd.d.ts +23 -0
- package/dist/registry/basic/option-list.d.ts +16 -0
- package/dist/registry/basic/pagination.d.ts +33 -0
- package/dist/registry/basic/progress.d.ts +18 -0
- package/dist/registry/basic/radio-group.d.ts +25 -0
- package/dist/registry/basic/resizable.d.ts +318 -0
- package/dist/registry/basic/scrollbar.d.ts +12 -0
- package/dist/registry/basic/select.d.ts +35 -0
- package/dist/registry/basic/skeleton.d.ts +10 -0
- package/dist/registry/basic/slider.d.ts +16 -0
- package/dist/registry/basic/sonner.d.ts +23 -0
- package/dist/registry/basic/spinner.d.ts +5 -0
- package/dist/registry/basic/switch.d.ts +20 -0
- package/dist/registry/basic/table.d.ts +18 -0
- package/dist/registry/basic/tabs.d.ts +29 -0
- package/dist/registry/basic/tag.d.ts +23 -0
- package/dist/registry/basic/theme-from-document.d.ts +10 -0
- package/dist/registry/basic/toggle.d.ts +29 -0
- package/dist/registry/basic/tooltip.d.ts +34 -0
- package/dist/registry/basic/typography.d.ts +76 -0
- package/dist/registry/chat/browser-use-part.d.ts +28 -0
- package/dist/registry/chat/chat-input/chat-input-folder-selector.d.ts +22 -0
- package/dist/registry/chat/chat-input/chat-input-model-switcher.d.ts +12 -0
- package/dist/registry/chat/chat-input/chat-input-textarea.d.ts +9 -0
- package/dist/registry/chat/chat-input/compound.d.ts +97 -0
- package/dist/registry/chat/chat-input/context.d.ts +64 -0
- package/dist/registry/chat/chat-input/folder-permission-dialog.d.ts +11 -0
- package/dist/registry/chat/chat-input/index.d.ts +34 -0
- package/dist/registry/chat/chat-input/types.d.ts +79 -0
- package/dist/registry/chat/chat-input/useAutoResizeTextarea.d.ts +7 -0
- package/dist/registry/chat/code-block-part.d.ts +23 -0
- package/dist/registry/chat/file-attachment.d.ts +19 -0
- package/dist/registry/chat/file-card.d.ts +10 -0
- package/dist/registry/chat/file-review-part.d.ts +30 -0
- package/dist/registry/chat/folder-button.d.ts +20 -0
- package/dist/registry/chat/generated-images-grid.d.ts +15 -0
- package/dist/registry/chat/generation-status-bar.d.ts +19 -0
- package/dist/registry/chat/image-attachment.d.ts +19 -0
- package/dist/registry/chat/image-generating.d.ts +15 -0
- package/dist/registry/chat/markdown.d.ts +8 -0
- package/dist/registry/chat/mermaid-part.d.ts +17 -0
- package/dist/registry/chat/permission-card.d.ts +24 -0
- package/dist/registry/chat/plan-part.d.ts +30 -0
- package/dist/registry/chat/question-part.d.ts +24 -0
- package/dist/registry/chat/queue-indicator.d.ts +27 -0
- package/dist/registry/chat/reasoning-step.d.ts +35 -0
- package/dist/registry/chat/related-prompts.d.ts +23 -0
- package/dist/registry/chat/request.d.ts +6 -0
- package/dist/registry/chat/response.d.ts +28 -0
- package/dist/registry/chat/send-button.d.ts +17 -0
- package/dist/registry/chat/sidebar-menu.d.ts +23 -0
- package/dist/registry/chat/streaming-markdown-block.d.ts +8 -0
- package/dist/registry/chat/suggestion-part.d.ts +28 -0
- package/dist/registry/chat/task-part.d.ts +28 -0
- package/dist/registry/chat/terminal-code-block-part.d.ts +18 -0
- package/dist/registry/chat/thinking-indicator.d.ts +14 -0
- package/dist/registry/chat/tool-invocation-card.d.ts +20 -0
- package/dist/registry/chat/user-question/UserQuestionCard.d.ts +30 -0
- package/dist/registry/chat/user-question/UserQuestionFooter.d.ts +18 -0
- package/dist/registry/chat/user-question/UserQuestionHeader.d.ts +20 -0
- package/dist/registry/chat/user-question/index.d.ts +7 -0
- package/dist/registry/chat/user-question/types.d.ts +52 -0
- package/dist/registry/chat/user-question/useUserQuestionKeyboard.d.ts +18 -0
- package/dist/registry/chat/user-question/useUserQuestionState.d.ts +26 -0
- package/dist/registry/chat/user-question-answer.d.ts +13 -0
- package/dist/registry/lib/file-icon-maps.d.ts +20 -0
- package/dist/registry/lib/use-mermaid-render.d.ts +5 -0
- package/dist/registry/lib/utils.d.ts +11 -0
- package/dist/requirementDiagram-UZGBJVZJ-DcWaCuXr.js +850 -0
- package/dist/requirementDiagram-UZGBJVZJ-gfdlrFiq.cjs +64 -0
- package/dist/sankeyDiagram-TZEHDZUN-CQIKFwD0.js +810 -0
- package/dist/sankeyDiagram-TZEHDZUN-DvPtzQvC.cjs +10 -0
- package/dist/scale.css +307 -0
- package/dist/sequenceDiagram-WL72ISMW-BNrsMagL.cjs +145 -0
- package/dist/sequenceDiagram-WL72ISMW-iCX3ckKx.js +2511 -0
- package/dist/spark-design.cjs.js +265 -0
- package/dist/spark-design.es.js +13207 -0
- package/dist/src/components/chat/BrowserUsePart/index.d.ts +7 -0
- package/dist/src/components/chat/ChatInput/index.d.ts +29 -0
- package/dist/src/components/chat/CodeBlockPart/index.d.ts +7 -0
- package/dist/src/components/chat/CollapsibleCard/index.d.ts +7 -0
- package/dist/src/components/chat/FileAttachment/index.d.ts +3 -0
- package/dist/src/components/chat/FileCard/index.d.ts +3 -0
- package/dist/src/components/chat/FileReviewPart/index.d.ts +7 -0
- package/dist/src/components/chat/FolderButton/index.d.ts +5 -0
- package/dist/src/components/chat/GeneratedImagesGrid/index.d.ts +7 -0
- package/dist/src/components/chat/GenerationStatusBar/index.d.ts +7 -0
- package/dist/src/components/chat/ImageAttachment/index.d.ts +3 -0
- package/dist/src/components/chat/ImageGenerating/index.d.ts +6 -0
- package/dist/src/components/chat/Markdown/demo-content.d.ts +1 -0
- package/dist/src/components/chat/Markdown/index.d.ts +7 -0
- package/dist/src/components/chat/MermaidPart/index.d.ts +6 -0
- package/dist/src/components/chat/PermissionCard/index.d.ts +4 -0
- package/dist/src/components/chat/PlanPart/index.d.ts +6 -0
- package/dist/src/components/chat/QuestionPart/index.d.ts +6 -0
- package/dist/src/components/chat/QueueIndicator/index.d.ts +4 -0
- package/dist/src/components/chat/ReasoningStep/index.d.ts +7 -0
- package/dist/src/components/chat/RelatedPrompts/index.d.ts +6 -0
- package/dist/src/components/chat/Request/index.d.ts +7 -0
- package/dist/src/components/chat/Response/StreamingMarkdownBlock.d.ts +6 -0
- package/dist/src/components/chat/Response/index.d.ts +6 -0
- package/dist/src/components/chat/SendButton/index.d.ts +5 -0
- package/dist/src/components/chat/SidebarMenu/index.d.ts +4 -0
- package/dist/src/components/chat/SuggestionPart/index.d.ts +6 -0
- package/dist/src/components/chat/TaskPart/index.d.ts +7 -0
- package/dist/src/components/chat/TerminalCodeBlockPart/index.d.ts +6 -0
- package/dist/src/components/chat/ThinkingIndicator/index.d.ts +6 -0
- package/dist/src/components/chat/ToolInvocationCard/index.d.ts +4 -0
- package/dist/src/components/chat/UserQuestion/index.d.ts +5 -0
- package/dist/src/components/chat/UserQuestionAnswer/index.d.ts +3 -0
- package/dist/src/components/foundation/AlertDialog/index.d.ts +20 -0
- package/dist/src/components/foundation/Avatar/index.d.ts +7 -0
- package/dist/src/components/foundation/Button/index.d.ts +7 -0
- package/dist/src/components/foundation/Collapse/index.d.ts +15 -0
- package/dist/src/components/foundation/Collapsible/index.d.ts +7 -0
- package/dist/src/components/foundation/CollapsibleSection/index.d.ts +43 -0
- package/dist/src/components/foundation/DropdownMenu/index.d.ts +19 -0
- package/dist/src/components/foundation/EllipsisText/index.d.ts +53 -0
- package/dist/src/components/foundation/IconButton/index.d.ts +7 -0
- package/dist/src/components/foundation/Kbd/index.d.ts +7 -0
- package/dist/src/components/foundation/OptionList/index.d.ts +7 -0
- package/dist/src/components/foundation/Pagination/index.d.ts +7 -0
- package/dist/src/components/foundation/Progress/index.d.ts +7 -0
- package/dist/src/components/foundation/RadioGroup/index.d.ts +7 -0
- package/dist/src/components/foundation/Resizable/index.d.ts +7 -0
- package/dist/src/components/foundation/Scrollbar/index.d.ts +7 -0
- package/dist/src/components/foundation/Select/index.d.ts +17 -0
- package/dist/src/components/foundation/Skeleton/index.d.ts +7 -0
- package/dist/src/components/foundation/Slider/index.d.ts +7 -0
- package/dist/src/components/foundation/Spinner/index.d.ts +7 -0
- package/dist/src/components/foundation/Switch/index.d.ts +38 -0
- package/dist/src/components/foundation/Table/index.d.ts +7 -0
- package/dist/src/components/foundation/Tabs/index.d.ts +7 -0
- package/dist/src/components/foundation/Tag/index.d.ts +10 -0
- package/dist/src/components/foundation/Toast/index.d.ts +12 -0
- package/dist/src/components/foundation/Toggle/index.d.ts +7 -0
- package/dist/src/components/foundation/Tooltip/index.d.ts +21 -0
- package/dist/src/components/foundation/Typography/index.d.ts +7 -0
- package/dist/src/components/index.d.ts +136 -0
- package/dist/src/icons/context.d.ts +26 -0
- package/dist/src/icons/types.d.ts +18 -0
- package/dist/src/lib/ThemeStyleContext.d.ts +21 -0
- package/dist/src/lib/file-icon.d.ts +16 -0
- package/dist/src/lib/i18n.d.ts +12 -0
- package/dist/src/lib/index.d.ts +10 -0
- package/dist/src/lib/motion.d.ts +22 -0
- package/dist/src/lib/utils.d.ts +11 -0
- package/dist/stateDiagram-FKZM4ZOC-DBvJ_eeL.cjs +1 -0
- package/dist/stateDiagram-FKZM4ZOC-ZVsJlaHJ.js +263 -0
- package/dist/stateDiagram-v2-4FDKWEC3-CB_nTHcE.js +16 -0
- package/dist/stateDiagram-v2-4FDKWEC3-Xkx17v6T.cjs +1 -0
- package/dist/theme.css +804 -0
- package/dist/timeline-definition-IT6M3QCI-BmGkYQiz.cjs +61 -0
- package/dist/timeline-definition-IT6M3QCI-Ck8zTt6w.js +795 -0
- package/dist/treemap-GDKQZRPO-B9sfERx8.js +17922 -0
- package/dist/treemap-GDKQZRPO-BVfJRs0Z.cjs +160 -0
- package/dist/xychartDiagram-PRI3JC2R-By_S8NzN.js +1340 -0
- package/dist/xychartDiagram-PRI3JC2R-CNfDrGxM.cjs +7 -0
- package/package.json +111 -9
- package/index.js +0 -5
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [INPUT]: (SwitchProps) - toggle 用 registry;segment 主库保留(含 FunctionSwitch)
|
|
3
|
+
* [OUTPUT]: (JSX.Element) - 布尔开关或分段切换
|
|
4
|
+
* [POS]: components/foundation/Switch
|
|
5
|
+
*
|
|
6
|
+
* variant=toggle:从 registry 再导出并包一层 data-style/data-theme。
|
|
7
|
+
* variant=segment:主库实现,默认图标用 registry icons-inline。
|
|
8
|
+
*/
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import type { SwitchProps as RegistrySwitchProps } from '../../../../registry/basic/switch';
|
|
11
|
+
export type FunctionSwitchValue = 'code' | 'preview';
|
|
12
|
+
export type FunctionSwitchSize = 'sm' | 'md';
|
|
13
|
+
export interface SegmentOption {
|
|
14
|
+
value: string;
|
|
15
|
+
icon?: React.ReactNode;
|
|
16
|
+
label: string;
|
|
17
|
+
}
|
|
18
|
+
export interface SwitchProps extends Omit<RegistrySwitchProps, 'size'> {
|
|
19
|
+
variant?: 'toggle' | 'segment';
|
|
20
|
+
size?: 'md' | 'lg';
|
|
21
|
+
options?: SegmentOption[];
|
|
22
|
+
value?: string;
|
|
23
|
+
defaultValue?: string;
|
|
24
|
+
onValueChange?: (value: string) => void;
|
|
25
|
+
segmentSize?: FunctionSwitchSize;
|
|
26
|
+
}
|
|
27
|
+
declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
/** @deprecated 使用 <Switch variant="segment" /> 替代 */
|
|
29
|
+
export interface FunctionSwitchProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
30
|
+
size?: FunctionSwitchSize;
|
|
31
|
+
value?: FunctionSwitchValue;
|
|
32
|
+
defaultValue?: FunctionSwitchValue;
|
|
33
|
+
onValueChange?: (value: FunctionSwitchValue) => void;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** @deprecated 使用 <Switch variant="segment" value={...} onValueChange={...} /> 替代 */
|
|
37
|
+
declare function FunctionSwitch({ size, value, defaultValue, onValueChange, disabled, className, ...rest }: FunctionSwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export { Switch, FunctionSwitch };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [INPUT]: (TableProps, TableHeaderProps 等)
|
|
3
|
+
* [OUTPUT]: (JSX.Element) - 表格,基于 Registry 单一来源
|
|
4
|
+
* [POS]: components/foundation/Table - 从 registry 再导出
|
|
5
|
+
*/
|
|
6
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, } from '../../../../registry/basic/table';
|
|
7
|
+
export type { TableProps, TableHeaderProps, TableBodyProps, TableFooterProps, TableRowProps, TableHeadProps, TableCellProps, TableCaptionProps, } from '../../../../registry/basic/table';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [INPUT]: (TabsProps, TabsListProps, TabsTriggerProps, TabsContentProps)
|
|
3
|
+
* [OUTPUT]: (JSX.Element) - 标签页,基于 Registry 单一来源
|
|
4
|
+
* [POS]: components/foundation/Tabs - 从 registry 再导出
|
|
5
|
+
*/
|
|
6
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants, tabsTriggerVariants, } from '../../../../registry/basic/tabs';
|
|
7
|
+
export type { TabsProps, TabsListProps, TabsTriggerProps, TabsContentProps, } from '../../../../registry/basic/tabs';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [INPUT]: (TagProps)
|
|
3
|
+
* [OUTPUT]: (JSX.Element) - 标签,基于 Registry 单一来源
|
|
4
|
+
* [POS]: components/foundation/Tag - 从 registry 再导出
|
|
5
|
+
*
|
|
6
|
+
* [PROTOCOL]:
|
|
7
|
+
* 1. 实现来自根目录 registry/basic/tag.tsx,主库仅 re-export
|
|
8
|
+
*/
|
|
9
|
+
export { Tag, tagVariants } from '../../../../registry/basic/tag';
|
|
10
|
+
export type { TagProps } from '../../../../registry/basic/tag';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ToasterProps as RegistryToasterProps } from '../../../../registry/basic/sonner';
|
|
2
|
+
export { toast } from 'sonner';
|
|
3
|
+
export type ToasterProps = RegistryToasterProps & {
|
|
4
|
+
/** 显式传入 data-style,优先于 useThemeStyle */
|
|
5
|
+
dataStyle?: string;
|
|
6
|
+
/** 显式传入 data-theme,优先于 useThemeStyle */
|
|
7
|
+
dataTheme?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function Toaster({ theme, toastOptions, dataStyle: dataStyleProp, dataTheme: dataThemeProp, ...props }: ToasterProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare namespace Toaster {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [INPUT]: (ToggleProps, ToggleGroupProps, ToggleGroupItemProps)
|
|
3
|
+
* [OUTPUT]: (JSX.Element) - Toggle / ToggleGroup,基于 Registry 单一来源
|
|
4
|
+
* [POS]: components/foundation/Toggle - 从 registry 再导出
|
|
5
|
+
*/
|
|
6
|
+
export { Toggle, ToggleGroup, ToggleGroupItem, toggleVariants, } from '../../../../registry/basic/toggle';
|
|
7
|
+
export type { ToggleProps, ToggleGroupProps, ToggleGroupItemProps, } from '../../../../registry/basic/toggle';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [INPUT]: (TooltipProps,兼容 placement 与 side)
|
|
3
|
+
* [OUTPUT]: (JSX.Element) - 工具提示,基于 Registry 单一来源
|
|
4
|
+
* [POS]: components/foundation/Tooltip - 从 registry 再导出并兼容 placement
|
|
5
|
+
*
|
|
6
|
+
* [PROTOCOL]:
|
|
7
|
+
* 1. 实现来自根目录 registry/basic/tooltip.tsx;主库注入 useThemeStyle 使 Portal 随 ThemeStyleProvider
|
|
8
|
+
*/
|
|
9
|
+
import { TooltipProvider, TooltipRoot, TooltipTrigger, TooltipContent } from '../../../../registry/basic/tooltip';
|
|
10
|
+
import type { TooltipProps as RegistryTooltipProps } from '../../../../registry/basic/tooltip';
|
|
11
|
+
export { TooltipProvider, TooltipRoot, TooltipTrigger, TooltipContent };
|
|
12
|
+
/** 对外 API:支持 placement(兼容旧用法)与 side(与 registry 一致) */
|
|
13
|
+
export interface TooltipProps extends Omit<RegistryTooltipProps, 'side'> {
|
|
14
|
+
/** 弹出方向,与 side 二选一;推荐使用 side */
|
|
15
|
+
placement?: 'top' | 'right' | 'bottom' | 'left';
|
|
16
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
17
|
+
}
|
|
18
|
+
export declare function Tooltip({ placement, side, ...props }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare namespace Tooltip {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [INPUT]: (Typography*Props)
|
|
3
|
+
* [OUTPUT]: (JSX.Element) - 排版组件,基于 Registry 单一来源
|
|
4
|
+
* [POS]: components/foundation/Typography - 从 registry 再导出
|
|
5
|
+
*/
|
|
6
|
+
export { TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyP, TypographyBlockquote, TypographyTable, TypographyList, TypographyInlineCode, TypographyLead, TypographyLarge, TypographySmall, TypographyMuted, } from '../../../../registry/basic/typography';
|
|
7
|
+
export type { TypographyH1Props, TypographyH2Props, TypographyH3Props, TypographyH4Props, TypographyPProps, TypographyBlockquoteProps, TypographyTableProps, TypographyListProps, TypographyInlineCodeProps, TypographyLeadProps, TypographyLargeProps, TypographySmallProps, TypographyMutedProps, } from '../../../../registry/basic/typography';
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [INPUT]: (N/A) - 此为导出入口文件,不接收输入
|
|
3
|
+
* [OUTPUT]: (Component & Type Exports) - 统一导出所有组件及其类型定义
|
|
4
|
+
* [POS]: components/index.ts - 组件库统一导出入口
|
|
5
|
+
*
|
|
6
|
+
* [PROTOCOL]:
|
|
7
|
+
* 1. 文件逻辑变更时必须同步更新此 Header
|
|
8
|
+
* 2. 更新后必须上浮检查 L2、L1 文档
|
|
9
|
+
* 3. 导出完整性检查:新增组件是否同步添加到导出列表
|
|
10
|
+
* 4. 类型导出检查:每个组件是否同时导出 Props 类型
|
|
11
|
+
*
|
|
12
|
+
* 注意:样式通过 Vite 构建配置自动处理,无需在此引入
|
|
13
|
+
*/
|
|
14
|
+
export { Button } from './foundation/Button';
|
|
15
|
+
export type { ButtonProps } from './foundation/Button';
|
|
16
|
+
export { IconButton } from './foundation/IconButton';
|
|
17
|
+
export type { IconButtonProps } from './foundation/IconButton';
|
|
18
|
+
export { Tooltip } from './foundation/Tooltip';
|
|
19
|
+
export type { TooltipProps } from './foundation/Tooltip';
|
|
20
|
+
export { EllipsisText } from './foundation/EllipsisText';
|
|
21
|
+
export type { EllipsisTextProps } from './foundation/EllipsisText';
|
|
22
|
+
export { OptionList } from './foundation/OptionList';
|
|
23
|
+
export type { OptionListProps, OptionItem } from './foundation/OptionList';
|
|
24
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, } from './foundation/DropdownMenu';
|
|
25
|
+
export type { DropdownMenuItemProps, DropdownMenuSubTriggerProps, DropdownMenuLabelProps, } from './foundation/DropdownMenu';
|
|
26
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, } from './foundation/AlertDialog';
|
|
27
|
+
export type { AlertDialogContentProps, AlertDialogActionProps, AlertDialogHeaderProps, AlertDialogFooterProps, AlertDialogMediaProps, } from './foundation/AlertDialog';
|
|
28
|
+
export { Kbd, KbdGroup } from './foundation/Kbd';
|
|
29
|
+
export type { KbdProps, KbdGroupProps } from './foundation/Kbd';
|
|
30
|
+
export { Switch, FunctionSwitch } from './foundation/Switch';
|
|
31
|
+
export type { SwitchProps, FunctionSwitchProps, FunctionSwitchSize, FunctionSwitchValue, SegmentOption } from './foundation/Switch';
|
|
32
|
+
export { Toggle, ToggleGroup, ToggleGroupItem } from './foundation/Toggle';
|
|
33
|
+
export type { ToggleProps, ToggleGroupProps, ToggleGroupItemProps } from './foundation/Toggle';
|
|
34
|
+
export { RadioGroup, RadioGroupItem } from './foundation/RadioGroup';
|
|
35
|
+
export type { RadioGroupProps, RadioGroupItemProps } from './foundation/RadioGroup';
|
|
36
|
+
export { CollapsibleSection } from './foundation/CollapsibleSection';
|
|
37
|
+
export type { CollapsibleSectionProps } from './foundation/CollapsibleSection';
|
|
38
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent } from './foundation/Collapsible';
|
|
39
|
+
export { ResizablePanelGroup, ResizablePanel, ResizableHandle, } from './foundation/Resizable';
|
|
40
|
+
export type { ResizablePanelGroupProps, ResizablePanelProps, ResizableHandleProps, } from './foundation/Resizable';
|
|
41
|
+
export { Scrollbar } from './foundation/Scrollbar';
|
|
42
|
+
export type { ScrollbarProps } from './foundation/Scrollbar';
|
|
43
|
+
export { Skeleton } from './foundation/Skeleton';
|
|
44
|
+
export type { SkeletonProps } from './foundation/Skeleton';
|
|
45
|
+
export { Spinner } from './foundation/Spinner';
|
|
46
|
+
export type { SpinnerProps } from './foundation/Spinner';
|
|
47
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, } from './foundation/Table';
|
|
48
|
+
export type { TableProps, TableHeaderProps, TableBodyProps, TableFooterProps, TableRowProps, TableHeadProps, TableCellProps, TableCaptionProps, } from './foundation/Table';
|
|
49
|
+
export { Avatar, AvatarImage, AvatarFallback, AvatarBadge, AvatarGroup, AvatarGroupCount, } from './foundation/Avatar';
|
|
50
|
+
export type { AvatarProps, AvatarImageProps, AvatarFallbackProps, AvatarBadgeProps, AvatarGroupProps, AvatarGroupCountProps, } from './foundation/Avatar';
|
|
51
|
+
export { Toaster, toast } from './foundation/Toast';
|
|
52
|
+
export type { ToasterProps } from './foundation/Toast';
|
|
53
|
+
export { Select, SelectTrigger, SelectValue, SelectContent, SelectLabel, SelectSeparator, SelectGroup, SelectItem, SelectScrollUpButton, SelectScrollDownButton, } from './foundation/Select';
|
|
54
|
+
export type { SelectProps, SelectTriggerProps, SelectValueProps, SelectContentProps, SelectLabelProps, SelectSeparatorProps, SelectGroupProps, SelectItemProps, } from './foundation/Select';
|
|
55
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent, } from './foundation/Tabs';
|
|
56
|
+
export type { TabsProps, TabsListProps, TabsTriggerProps, TabsContentProps, } from './foundation/Tabs';
|
|
57
|
+
export { Collapse, CollapseItem, CollapseTrigger, CollapseContent, } from './foundation/Collapse';
|
|
58
|
+
export type { CollapseProps, CollapseItemProps, CollapseTriggerProps, CollapseContentProps, } from './foundation/Collapse';
|
|
59
|
+
export { TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyP, TypographyBlockquote, TypographyTable, TypographyList, TypographyInlineCode, TypographyLead, TypographyLarge, TypographySmall, TypographyMuted, } from './foundation/Typography';
|
|
60
|
+
export type { TypographyH1Props, TypographyH2Props, TypographyH3Props, TypographyH4Props, TypographyPProps, TypographyBlockquoteProps, TypographyTableProps, TypographyListProps, TypographyInlineCodeProps, TypographyLeadProps, TypographyLargeProps, TypographySmallProps, TypographyMutedProps, } from './foundation/Typography';
|
|
61
|
+
export { Slider } from './foundation/Slider';
|
|
62
|
+
export type { SliderProps } from './foundation/Slider';
|
|
63
|
+
export { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PaginationEllipsis, } from './foundation/Pagination';
|
|
64
|
+
export type { PaginationLinkProps, PaginationPreviousProps, PaginationNextProps, } from './foundation/Pagination';
|
|
65
|
+
export { Tag, tagVariants } from './foundation/Tag';
|
|
66
|
+
export type { TagProps } from './foundation/Tag';
|
|
67
|
+
export { CollapsibleCard } from './chat/CollapsibleCard';
|
|
68
|
+
export type { CollapsibleCardProps } from './chat/CollapsibleCard';
|
|
69
|
+
export { FolderButton } from './chat/FolderButton';
|
|
70
|
+
export type { FolderButtonProps } from './chat/FolderButton';
|
|
71
|
+
export { ChatInput, ChatInputRoot, ChatInputAbove, ChatInputBox, ChatInputAttachments, ChatInputInput, ChatInputActions, ChatInputActionsLeft, ChatInputActionsRight, ChatInputExpandButton, ChatInputFolderButton, ChatInputMoreButton, ChatInputSendButton, ChatInputFooterLeft, } from './chat/ChatInput';
|
|
72
|
+
export type { ChatInputProps, FolderPermissionConfig, GenerationStatusConfig, FooterLeftModelSwitchConfig, FooterLeftModelSwitchItem, ChatInputRootProps, ChatInputAboveProps, ChatInputBoxProps, ChatInputAttachmentsProps, ChatInputInputProps, ChatInputActionsProps, ChatInputActionsLeftProps, ChatInputActionsRightProps, ChatInputExpandButtonProps, } from './chat/ChatInput';
|
|
73
|
+
export { RelatedPrompts } from './chat/RelatedPrompts';
|
|
74
|
+
export type { RelatedPromptsProps, RelatedPromptItem } from './chat/RelatedPrompts';
|
|
75
|
+
export { SuggestionPart } from './chat/SuggestionPart';
|
|
76
|
+
export type { SuggestionPartProps } from './chat/SuggestionPart';
|
|
77
|
+
export { SendButton } from './chat/SendButton';
|
|
78
|
+
export type { SendButtonProps } from './chat/SendButton';
|
|
79
|
+
export { Response } from './chat/Response';
|
|
80
|
+
export type { ResponseProps, ResponsePhase, ResponseRound, ResponseStep, ResponseStepToolType } from './chat/Response';
|
|
81
|
+
export { Request } from './chat/Request';
|
|
82
|
+
export type { RequestProps } from './chat/Request';
|
|
83
|
+
export { FileCard } from './chat/FileCard';
|
|
84
|
+
export type { FileCardProps } from './chat/FileCard';
|
|
85
|
+
export { FileAttachment } from './chat/FileAttachment';
|
|
86
|
+
export type { FileAttachmentProps } from './chat/FileAttachment';
|
|
87
|
+
export { ImageAttachment } from './chat/ImageAttachment';
|
|
88
|
+
export type { ImageAttachmentProps } from './chat/ImageAttachment';
|
|
89
|
+
export { ReasoningStep } from './chat/ReasoningStep';
|
|
90
|
+
export type { ReasoningStepProps, ReasoningStepDetail } from './chat/ReasoningStep';
|
|
91
|
+
export { ToolInvocationCard } from './chat/ToolInvocationCard';
|
|
92
|
+
export type { ToolInvocationCardProps, ToolInvocationStatus } from './chat/ToolInvocationCard';
|
|
93
|
+
export { PermissionCard } from './chat/PermissionCard';
|
|
94
|
+
export type { PermissionCardProps, PermissionCardAction } from './chat/PermissionCard';
|
|
95
|
+
export { MarkdownBody } from './chat/Markdown';
|
|
96
|
+
export type { MarkdownBodyProps } from './chat/Markdown';
|
|
97
|
+
export { GenerationStatusBar } from './chat/GenerationStatusBar';
|
|
98
|
+
export type { GenerationStatusBarProps } from './chat/GenerationStatusBar';
|
|
99
|
+
export { ThinkingIndicator } from './chat/ThinkingIndicator';
|
|
100
|
+
export type { ThinkingIndicatorProps } from './chat/ThinkingIndicator';
|
|
101
|
+
export { ImageGenerating } from './chat/ImageGenerating';
|
|
102
|
+
export type { ImageGeneratingProps } from './chat/ImageGenerating';
|
|
103
|
+
export { SidebarMenu } from './chat/SidebarMenu';
|
|
104
|
+
export type { SidebarMenuProps, SidebarMenuItem, SidebarMenuItemAction } from './chat/SidebarMenu';
|
|
105
|
+
export { GeneratedImagesGrid } from './chat/GeneratedImagesGrid';
|
|
106
|
+
export type { GeneratedImagesGridProps } from './chat/GeneratedImagesGrid';
|
|
107
|
+
export { UserQuestion } from './chat/UserQuestion';
|
|
108
|
+
export type { UserQuestionProps, UserQuestionHandle, UserQuestionItem, UserQuestionOption, UserQuestionLabels, } from './chat/UserQuestion';
|
|
109
|
+
export { UserQuestionAnswer } from './chat/UserQuestionAnswer';
|
|
110
|
+
export type { UserQuestionAnswerProps, UserQuestionAnswerLabels, } from './chat/UserQuestionAnswer';
|
|
111
|
+
export { QueueIndicator } from './chat/QueueIndicator';
|
|
112
|
+
export type { QueueIndicatorProps, QueueIndicatorItem, QueueIndicatorLabels, } from './chat/QueueIndicator';
|
|
113
|
+
export { FileReviewPart } from './chat/FileReviewPart';
|
|
114
|
+
export type { FileReviewPartProps, FileReviewFile } from './chat/FileReviewPart';
|
|
115
|
+
export { TaskPart } from './chat/TaskPart';
|
|
116
|
+
export type { TaskPartProps, TaskPartTask, TaskStatus } from './chat/TaskPart';
|
|
117
|
+
export { PlanPart } from './chat/PlanPart';
|
|
118
|
+
export type { PlanPartProps } from './chat/PlanPart';
|
|
119
|
+
export { MermaidPart } from './chat/MermaidPart';
|
|
120
|
+
export type { MermaidPartProps } from './chat/MermaidPart';
|
|
121
|
+
export { CodeBlockPart } from './chat/CodeBlockPart';
|
|
122
|
+
export type { CodeBlockPartProps, CodeBlockDiffType } from './chat/CodeBlockPart';
|
|
123
|
+
export { TerminalCodeBlockPart } from './chat/TerminalCodeBlockPart';
|
|
124
|
+
export type { TerminalCodeBlockPartProps } from './chat/TerminalCodeBlockPart';
|
|
125
|
+
export { BrowserUsePart } from './chat/BrowserUsePart';
|
|
126
|
+
export type { BrowserUsePartProps, BrowserUseStatus } from './chat/BrowserUsePart';
|
|
127
|
+
export { QuestionPart } from './chat/QuestionPart';
|
|
128
|
+
export type { QuestionPartProps } from './chat/QuestionPart';
|
|
129
|
+
export { Progress } from './foundation/Progress';
|
|
130
|
+
export type { ProgressProps } from './foundation/Progress';
|
|
131
|
+
export { IconsProvider, useIcons, useIcon } from '../icons/context';
|
|
132
|
+
export type { IconKey, IconComponent, IconProps } from '../icons/types';
|
|
133
|
+
export type { IconsContextValue } from '../icons/context';
|
|
134
|
+
export { ThemeStyleProvider, useThemeStyle, type ThemeStyleValue, } from '../lib/ThemeStyleContext';
|
|
135
|
+
export { MOTION_DURATION, MOTION_EASE, MOTION_SPRING } from '../lib/motion';
|
|
136
|
+
export { FILE_TYPE_MAP, SETI_CHAR_MAP, SETI_COLOR_MAP, TYPE_TO_TOKEN_CLASS, getSetiIconType, getSetiIcon, getSetiIconColor, getFileIconColorClass, } from '../lib';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [INPUT]: (IconsProviderProps) - 图标映射与可选 getFileIcon
|
|
3
|
+
* [OUTPUT]: (JSX.Element) - Provider 包裹子节点;useIcon 无配置时返回 undefined,便于 ?? 走内置 fallback
|
|
4
|
+
* [POS]: icons/context - 图标注入层,组件通过 useIcons() 取图标,用户可替换为 Lucide/Remix 等
|
|
5
|
+
*
|
|
6
|
+
* [PROTOCOL]:
|
|
7
|
+
* 1. 新增 IconKey 时同步 types.ts
|
|
8
|
+
* 2. 不依赖 @ali/qoder-icon,主库零图标依赖
|
|
9
|
+
* 3. useIcon 无图标时返回 undefined,主库直接渲染处需 ?? 内置 SVG(如 CollapsibleSection、Toast)
|
|
10
|
+
*/
|
|
11
|
+
import { type ReactNode } from 'react';
|
|
12
|
+
import type { IconKey, IconComponent } from './types';
|
|
13
|
+
export interface IconsContextValue {
|
|
14
|
+
/** 语义化图标映射,未提供时组件内使用占位 */
|
|
15
|
+
icons: Partial<Record<IconKey, IconComponent>>;
|
|
16
|
+
/** 可选:按文件名返回文件类型图标,未提供时 file-icon 使用通用占位 */
|
|
17
|
+
getFileIcon?: (filename: string, className?: string) => ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export interface IconsProviderProps {
|
|
20
|
+
value: IconsContextValue;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export declare function IconsProvider({ value, children }: IconsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function useIcons(): IconsContextValue;
|
|
25
|
+
/** 渲染语义化图标:有则用传入的 Icon,无则返回 undefined,便于调用方用 ?? 走内置 SVG fallback */
|
|
26
|
+
export declare function useIcon(key: IconKey, className?: string): ReactNode;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [INPUT]: N/A - 类型定义
|
|
3
|
+
* [OUTPUT]: IconKey, IconComponent 等类型
|
|
4
|
+
* [POS]: icons/types - 图标抽象层类型,供 IconsContext 与组件使用
|
|
5
|
+
*
|
|
6
|
+
* [PROTOCOL]:
|
|
7
|
+
* 1. 新增组件使用图标时在此补充语义化 key
|
|
8
|
+
* 2. 与 IconsContext 的默认实现(若有)保持同步
|
|
9
|
+
*/
|
|
10
|
+
import type { ComponentType } from 'react';
|
|
11
|
+
/** 图标组件通用 props(支持 className 与无障碍) */
|
|
12
|
+
export interface IconProps {
|
|
13
|
+
className?: string;
|
|
14
|
+
'aria-hidden'?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** 语义化图标 key:库内组件通过 useIcons() 按 key 取图标,用户可用任意图标库实现 */
|
|
17
|
+
export type IconKey = 'send' | 'stop' | 'mic' | 'addLarge' | 'folder' | 'folderOpen' | 'history' | 'folderFill' | 'close' | 'closeLarge' | 'arrowRight' | 'arrowLeft' | 'codeSlash' | 'eye' | 'warning' | 'arrowDown' | 'arrowUp' | 'checkboxCircle' | 'closeCircle' | 'time' | 'chat' | 'chat3' | 'chat4' | 'sparkling' | 'questionAnswer' | 'infinity' | 'more' | 'arrowDownS' | 'arrowUpS' | 'check' | 'checkLine' | 'loader' | 'arrowRightCircleFill' | 'requestChanges' | 'catalog' | 'circle' | 'indeterminateCircle' | 'fileList2' | 'download' | 'questionnaire' | 'terminalBox' | 'externalLink' | 'global' | 'forbid2';
|
|
18
|
+
export type IconComponent = ComponentType<IconProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [INPUT]: (N/A) - Context 由上层 Provider 注入
|
|
3
|
+
* [OUTPUT]: (React Context) - 供 Portal 浮层继承 data-style / data-theme
|
|
4
|
+
* [POS]: lib/ThemeStyleContext
|
|
5
|
+
*
|
|
6
|
+
* [PROTOCOL]:
|
|
7
|
+
* 1. 用于 DropdownMenu、Tooltip 等挂到 body 的浮层,使其与当前页面的 data-style/data-theme 一致
|
|
8
|
+
* 2. 应用层在根节点用 ThemeStyleProvider 包裹并传入 style/theme,浮层内组件通过 useThemeStyle 读取并包一层 div
|
|
9
|
+
*/
|
|
10
|
+
import { type ReactNode } from 'react';
|
|
11
|
+
export interface ThemeStyleValue {
|
|
12
|
+
/** 布局风格:neutral | compact | soft | sharp | dense,对应 scale.css */
|
|
13
|
+
style?: string;
|
|
14
|
+
/** 颜色主题:light | dark | custom,对应 theme.css */
|
|
15
|
+
theme?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function ThemeStyleProvider({ children, value, }: {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
value: ThemeStyleValue;
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function useThemeStyle(): ThemeStyleValue;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [INPUT]: (filename: string, className?: string) - 文件名、图标样式类
|
|
3
|
+
* [OUTPUT]: (ReactNode) - 对应文件类型的图标(默认通用占位;可通过 IconsProvider.getFileIcon 注入自定义)
|
|
4
|
+
* [POS]: lib/file-icon - 文件图标工具,用于 FileCard 等
|
|
5
|
+
*
|
|
6
|
+
* [PROTOCOL]:
|
|
7
|
+
* 1. 文件逻辑变更时必须同步更新此 Header
|
|
8
|
+
* 2. 使用方通过 IconsProvider 的 getFileIcon 注入时可实现按扩展名映射(如 Lucide/Remix)
|
|
9
|
+
* 3. 主库不依赖任何闭源图标包
|
|
10
|
+
*/
|
|
11
|
+
import type { ReactNode } from 'react';
|
|
12
|
+
/**
|
|
13
|
+
* 根据文件名返回文件图标。
|
|
14
|
+
* 主库仅提供通用占位图标;用户通过 IconsProvider 传入 getFileIcon 时可实现按扩展名映射(如 Lucide、Remix)。
|
|
15
|
+
*/
|
|
16
|
+
export declare function getFileIconByFilename(filename: string, className?: string): ReactNode;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [INPUT]: () - 无输入
|
|
3
|
+
* [OUTPUT]: (void) - 初始化 i18next 实例,供 react-i18next 使用
|
|
4
|
+
* [POS]: lib/i18n.ts - 在应用入口最早导入,确保 useTranslation 可用
|
|
5
|
+
*
|
|
6
|
+
* [PROTOCOL]:
|
|
7
|
+
* 1. 文件逻辑变更时必须同步更新此 Header
|
|
8
|
+
* 2. 新增语言或翻译时在此扩展 resources
|
|
9
|
+
* 3. 当前仅英文:lng/fallbackLng 为 en;业务侧可通过 props 传入 t() 做多语言
|
|
10
|
+
*/
|
|
11
|
+
import i18n from 'i18next';
|
|
12
|
+
export default i18n;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [INPUT]: (N/A) - Lib 工具函数导出入口
|
|
3
|
+
* [OUTPUT]: (Utility Exports) - 统一导出所有工具函数
|
|
4
|
+
* [POS]: lib/index.ts
|
|
5
|
+
*/
|
|
6
|
+
export { getFileIconByFilename } from './file-icon';
|
|
7
|
+
export { FILE_TYPE_MAP, SETI_CHAR_MAP, SETI_COLOR_MAP, TYPE_TO_TOKEN_CLASS, getSetiIconType, getSetiIcon, getSetiIconColor, getFileIconColorClass, } from '../../registry/lib/file-icon-maps';
|
|
8
|
+
export { default as i18n } from './i18n';
|
|
9
|
+
export { ThemeStyleProvider, useThemeStyle, type ThemeStyleValue, } from './ThemeStyleContext';
|
|
10
|
+
export { MOTION_DURATION, MOTION_EASE, MOTION_SPRING } from './motion';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared motion baseline for foundation components shown in showcase.
|
|
3
|
+
* Keep values centralized to make interaction rhythm consistent.
|
|
4
|
+
*/
|
|
5
|
+
export declare const MOTION_DURATION: {
|
|
6
|
+
readonly fast: 0.15;
|
|
7
|
+
readonly base: 0.2;
|
|
8
|
+
readonly slow: 0.3;
|
|
9
|
+
};
|
|
10
|
+
export declare const MOTION_EASE: {
|
|
11
|
+
readonly standard: readonly [0.16, 1, 0.3, 1];
|
|
12
|
+
readonly emphasized: readonly [0.2, 0.8, 0.2, 1];
|
|
13
|
+
readonly out: readonly [0, 0, 0.2, 1];
|
|
14
|
+
};
|
|
15
|
+
export declare const MOTION_SPRING: {
|
|
16
|
+
readonly snappy: {
|
|
17
|
+
readonly type: "spring";
|
|
18
|
+
readonly stiffness: 520;
|
|
19
|
+
readonly damping: 34;
|
|
20
|
+
readonly mass: 0.7;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [INPUT]: (ClassValue[])
|
|
3
|
+
* [OUTPUT]: (string) - 合并后的 class 名
|
|
4
|
+
* [POS]: lib/utils.ts - 供主库与 registry 引用(@/lib/utils)
|
|
5
|
+
*
|
|
6
|
+
* [PROTOCOL]:
|
|
7
|
+
* 1. 与 registry/lib/utils 保持一致,供从 registry 引入的组件解析
|
|
8
|
+
* 2. 使用 clsx + tailwind-merge 合并类名
|
|
9
|
+
*/
|
|
10
|
+
import { type ClassValue } from 'clsx';
|
|
11
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./chunk-DI55MBZ5-D1YJMs6x.cjs"),t=require("./mermaid.core-DBwAx_jp.cjs"),T=require("./graph-DIbblrZP.cjs"),H=require("./layout-Byuh8f-J.cjs");var z=t.__name(e=>e.append("circle").attr("class","start-state").attr("r",t.getConfig2().state.sizeUnit).attr("cx",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit).attr("cy",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit),"drawStartState"),L=t.__name(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t.getConfig2().state.textHeight).attr("class","divider").attr("x2",t.getConfig2().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),A=t.__name((e,n)=>{const d=e.append("text").attr("x",2*t.getConfig2().state.padding).attr("y",t.getConfig2().state.textHeight+2*t.getConfig2().state.padding).attr("font-size",t.getConfig2().state.fontSize).attr("class","state-title").text(n.id),g=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t.getConfig2().state.padding).attr("y",t.getConfig2().state.padding).attr("width",g.width+2*t.getConfig2().state.padding).attr("height",g.height+2*t.getConfig2().state.padding).attr("rx",t.getConfig2().state.radius),d},"drawSimpleState"),P=t.__name((e,n)=>{const d=t.__name(function(c,m,y){const b=c.append("tspan").attr("x",2*t.getConfig2().state.padding).text(m);y||b.attr("dy",t.getConfig2().state.textHeight)},"addTspan"),o=e.append("text").attr("x",2*t.getConfig2().state.padding).attr("y",t.getConfig2().state.textHeight+1.3*t.getConfig2().state.padding).attr("font-size",t.getConfig2().state.fontSize).attr("class","state-title").text(n.descriptions[0]).node().getBBox(),l=o.height,p=e.append("text").attr("x",t.getConfig2().state.padding).attr("y",l+t.getConfig2().state.padding*.4+t.getConfig2().state.dividerMargin+t.getConfig2().state.textHeight).attr("class","state-description");let i=!0,r=!0;n.descriptions.forEach(function(c){i||(d(p,c,r),r=!1),i=!1});const C=e.append("line").attr("x1",t.getConfig2().state.padding).attr("y1",t.getConfig2().state.padding+l+t.getConfig2().state.dividerMargin/2).attr("y2",t.getConfig2().state.padding+l+t.getConfig2().state.dividerMargin/2).attr("class","descr-divider"),h=p.node().getBBox(),s=Math.max(h.width,o.width);return C.attr("x2",s+3*t.getConfig2().state.padding),e.insert("rect",":first-child").attr("x",t.getConfig2().state.padding).attr("y",t.getConfig2().state.padding).attr("width",s+2*t.getConfig2().state.padding).attr("height",h.height+l+2*t.getConfig2().state.padding).attr("rx",t.getConfig2().state.radius),e},"drawDescrState"),R=t.__name((e,n,d)=>{const g=t.getConfig2().state.padding,o=2*t.getConfig2().state.padding,l=e.node().getBBox(),p=l.width,i=l.x,r=e.append("text").attr("x",0).attr("y",t.getConfig2().state.titleShift).attr("font-size",t.getConfig2().state.fontSize).attr("class","state-title").text(n.id),h=r.node().getBBox().width+o;let s=Math.max(h,p);s===p&&(s=s+o);let c;const m=e.node().getBBox();n.doc,c=i-g,h>p&&(c=(p-s)/2+g),Math.abs(i-m.x)<g&&h>p&&(c=i-(h-p)/2);const y=1-t.getConfig2().state.textHeight;return e.insert("rect",":first-child").attr("x",c).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",s).attr("height",m.height+t.getConfig2().state.textHeight+t.getConfig2().state.titleShift+1).attr("rx","0"),r.attr("x",c+g),h<=p&&r.attr("x",i+(s-o)/2-h/2+g),e.insert("rect",":first-child").attr("x",c).attr("y",t.getConfig2().state.titleShift-t.getConfig2().state.textHeight-t.getConfig2().state.padding).attr("width",s).attr("height",t.getConfig2().state.textHeight*3).attr("rx",t.getConfig2().state.radius),e.insert("rect",":first-child").attr("x",c).attr("y",t.getConfig2().state.titleShift-t.getConfig2().state.textHeight-t.getConfig2().state.padding).attr("width",s).attr("height",m.height+3+2*t.getConfig2().state.textHeight).attr("rx",t.getConfig2().state.radius),e},"addTitleAndBox"),W=t.__name(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t.getConfig2().state.sizeUnit+t.getConfig2().state.miniPadding).attr("cx",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+t.getConfig2().state.miniPadding).attr("cy",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+t.getConfig2().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t.getConfig2().state.sizeUnit).attr("cx",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+2).attr("cy",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+2)),"drawEndState"),G=t.__name((e,n)=>{let d=t.getConfig2().state.forkWidth,g=t.getConfig2().state.forkHeight;if(n.parentId){let o=d;d=g,g=o}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",g).attr("x",t.getConfig2().state.padding).attr("y",t.getConfig2().state.padding)},"drawForkJoinState"),D=t.__name((e,n,d,g)=>{let o=0;const l=g.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"<br/>");p=p.replace(/\n/g,"<br/>");const i=p.split(t.common_default.lineBreakRegex);let r=1.25*t.getConfig2().state.noteMargin;for(const C of i){const h=C.trim();if(h.length>0){const s=l.append("tspan");if(s.text(h),r===0){const c=s.node().getBBox();r+=c.height}o+=r,s.attr("x",n+t.getConfig2().state.noteMargin),s.attr("y",d+o+1.25*t.getConfig2().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:o}},"_drawLongText"),U=t.__name((e,n)=>{n.attr("class","state-note");const d=n.append("rect").attr("x",0).attr("y",t.getConfig2().state.padding),g=n.append("g"),{textWidth:o,textHeight:l}=D(e,0,0,g);return d.attr("height",l+2*t.getConfig2().state.noteMargin),d.attr("width",o+t.getConfig2().state.noteMargin*2),d},"drawNote"),k=t.__name(function(e,n){const d=n.id,g={id:d,label:n.id,width:0,height:0},o=e.append("g").attr("id",d).attr("class","stateGroup");n.type==="start"&&z(o),n.type==="end"&&W(o),(n.type==="fork"||n.type==="join")&&G(o,n),n.type==="note"&&U(n.note.text,o),n.type==="divider"&&L(o),n.type==="default"&&n.descriptions.length===0&&A(o,n),n.type==="default"&&n.descriptions.length>0&&P(o,n);const l=o.node().getBBox();return g.width=l.width+2*t.getConfig2().state.padding,g.height=l.height+2*t.getConfig2().state.padding,g},"drawState"),N=0,F=t.__name(function(e,n,d){const g=t.__name(function(r){switch(r){case S.StateDB.relationType.AGGREGATION:return"aggregation";case S.StateDB.relationType.EXTENSION:return"extension";case S.StateDB.relationType.COMPOSITION:return"composition";case S.StateDB.relationType.DEPENDENCY:return"dependency"}},"getRelationType");n.points=n.points.filter(r=>!Number.isNaN(r.y));const o=n.points,l=t.line().x(function(r){return r.x}).y(function(r){return r.y}).curve(t.curveBasis),p=e.append("path").attr("d",l(o)).attr("id","edge"+N).attr("class","transition");let i="";if(t.getConfig2().state.arrowMarkerAbsolute&&(i=t.getUrl(!0)),p.attr("marker-end","url("+i+"#"+g(S.StateDB.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const r=e.append("g").attr("class","stateLabel"),{x:C,y:h}=t.utils_default.calcLabelPosition(n.points),s=t.common_default.getRows(d.title);let c=0;const m=[];let y=0,b=0;for(let x=0;x<=s.length;x++){const f=r.append("text").attr("text-anchor","middle").text(s[x]).attr("x",C).attr("y",h+c),u=f.node().getBBox();y=Math.max(y,u.width),b=Math.min(b,u.x),t.log.info(u.x,C,h+c),c===0&&(c=f.node().getBBox().height,t.log.info("Title height",c,h)),m.push(f)}let _=c*s.length;if(s.length>1){const x=(s.length-1)*c*.5;m.forEach((f,u)=>f.attr("y",h+u*c-x)),_=c*s.length}const a=r.node().getBBox();r.insert("rect",":first-child").attr("class","box").attr("x",C-y/2-t.getConfig2().state.padding/2).attr("y",h-_/2-t.getConfig2().state.padding/2-3.5).attr("width",y+t.getConfig2().state.padding).attr("height",_+t.getConfig2().state.padding),t.log.info(a)}N++},"drawEdge"),w,E={},O=t.__name(function(){},"setConf"),q=t.__name(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),J=t.__name(function(e,n,d,g){w=t.getConfig2().state;const o=t.getConfig2().securityLevel;let l;o==="sandbox"&&(l=t.select("#i"+n));const p=o==="sandbox"?t.select(l.nodes()[0].contentDocument.body):t.select("body"),i=o==="sandbox"?l.nodes()[0].contentDocument:document;t.log.debug("Rendering diagram "+e);const r=p.select(`[id='${n}']`);q(r);const C=g.db.getRootDoc();M(C,r,void 0,!1,p,i,g);const h=w.padding,s=r.node().getBBox(),c=s.width+h*2,m=s.height+h*2,y=c*1.75;t.configureSvgSize(r,m,y,w.useMaxWidth),r.attr("viewBox",`${s.x-w.padding} ${s.y-w.padding} `+c+" "+m)},"draw"),X=t.__name(e=>e?e.length*w.fontSizeFactor:1,"getLabelWidth"),M=t.__name((e,n,d,g,o,l,p)=>{const i=new T.Graph({compound:!0,multigraph:!0});let r,C=!0;for(r=0;r<e.length;r++)if(e[r].stmt==="relation"){C=!1;break}d?i.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:C?1:w.edgeLengthFactor,nodeSep:C?1:50,isMultiGraph:!0}):i.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:C?1:w.edgeLengthFactor,nodeSep:C?1:50,ranker:"tight-tree",isMultiGraph:!0}),i.setDefaultEdgeLabel(function(){return{}});const h=p.db.getStates(),s=p.db.getRelations(),c=Object.keys(h);for(const a of c){const x=h[a];d&&(x.parentId=d);let f;if(x.doc){let u=n.append("g").attr("id",x.id).attr("class","stateGroup");f=M(x.doc,u,x.id,!g,o,l,p);{u=R(u,x,g);let B=u.node().getBBox();f.width=B.width,f.height=B.height+w.padding/2,E[x.id]={y:w.compositTitleSize}}}else f=k(n,x,i);if(x.note){const u={descriptions:[],id:x.id+"-note",note:x.note,type:"note"},B=k(n,u,i);x.note.position==="left of"?(i.setNode(f.id+"-note",B),i.setNode(f.id,f)):(i.setNode(f.id,f),i.setNode(f.id+"-note",B)),i.setParent(f.id,f.id+"-group"),i.setParent(f.id+"-note",f.id+"-group")}else i.setNode(f.id,f)}t.log.debug("Count=",i.nodeCount(),i);let m=0;s.forEach(function(a){m++,t.log.debug("Setting edge",a),i.setEdge(a.id1,a.id2,{relation:a,width:X(a.title),height:w.labelHeight*t.common_default.getRows(a.title).length,labelpos:"c"},"id"+m)}),H.layout(i),t.log.debug("Graph after layout",i.nodes());const y=n.node();i.nodes().forEach(function(a){a!==void 0&&i.node(a)!==void 0?(t.log.warn("Node "+a+": "+JSON.stringify(i.node(a))),o.select("#"+y.id+" #"+a).attr("transform","translate("+(i.node(a).x-i.node(a).width/2)+","+(i.node(a).y+(E[a]?E[a].y:0)-i.node(a).height/2)+" )"),o.select("#"+y.id+" #"+a).attr("data-x-shift",i.node(a).x-i.node(a).width/2),l.querySelectorAll("#"+y.id+" #"+a+" .divider").forEach(f=>{const u=f.parentElement;let B=0,v=0;u&&(u.parentElement&&(B=u.parentElement.getBBox().width),v=parseInt(u.getAttribute("data-x-shift"),10),Number.isNaN(v)&&(v=0)),f.setAttribute("x1",0-v+8),f.setAttribute("x2",B-v-8)})):t.log.debug("No Node "+a+": "+JSON.stringify(i.node(a)))});let b=y.getBBox();i.edges().forEach(function(a){a!==void 0&&i.edge(a)!==void 0&&(t.log.debug("Edge "+a.v+" -> "+a.w+": "+JSON.stringify(i.edge(a))),F(n,i.edge(a),i.edge(a).relation))}),b=y.getBBox();const _={id:d||"root",label:d||"root",width:0,height:0};return _.width=b.width+2*w.padding,_.height=b.height+2*w.padding,t.log.debug("Doc rendered",_,i),_},"renderDoc"),I={setConf:O,draw:J},Y={parser:S.stateDiagram_default,get db(){return new S.StateDB(1)},renderer:I,styles:S.styles_default,init:t.__name(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};exports.diagram=Y;
|