@seed-ship/mcp-ui-solid 2.2.4 → 2.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.
@@ -540,6 +540,439 @@ export const ArtifactRegistry: ComponentRegistryEntry = {
540
540
  },
541
541
  }
542
542
 
543
+ /**
544
+ * Code Block Registry Entry
545
+ */
546
+ export const CodeRegistry: ComponentRegistryEntry = {
547
+ type: 'code',
548
+ name: 'CodeBlock',
549
+ description:
550
+ 'Render syntax-highlighted code blocks with line numbers, copy button, and word wrap toggle. Supports all languages via highlight.js auto-detection. Best for displaying source code, configuration files, CLI output, or API responses.',
551
+ schema: {
552
+ type: 'object',
553
+ properties: {
554
+ code: { type: 'string', description: 'The code content to display' },
555
+ language: { type: 'string', description: 'Programming language for syntax highlighting (auto-detected if omitted)' },
556
+ filename: { type: 'string', description: 'Filename shown in header bar' },
557
+ showLineNumbers: { type: 'boolean', description: 'Show line numbers (default: true)' },
558
+ startLine: { type: 'number', description: 'Starting line number (default: 1)' },
559
+ maxHeight: { type: 'string', description: 'CSS max-height for scrollable code blocks' },
560
+ theme: { type: 'string', enum: ['light', 'dark'], description: 'Color theme (follows system preference by default)' },
561
+ },
562
+ required: ['code'],
563
+ },
564
+ examples: [
565
+ {
566
+ query: 'Show me how to connect to the API',
567
+ component: {
568
+ id: 'example-code-1',
569
+ type: 'code',
570
+ position: { colStart: 1, colSpan: 8 },
571
+ params: {
572
+ code: 'const client = new MCPClient({ url: "https://api.example.com" });\nawait client.connect();\nconst result = await client.query("SELECT * FROM documents");',
573
+ language: 'typescript',
574
+ filename: 'example.ts',
575
+ },
576
+ },
577
+ },
578
+ ],
579
+ limits: DEFAULT_RESOURCE_LIMITS,
580
+ }
581
+
582
+ /**
583
+ * Map Registry Entry
584
+ */
585
+ export const MapRegistry: ComponentRegistryEntry = {
586
+ type: 'map',
587
+ name: 'InteractiveMap',
588
+ description:
589
+ 'Render interactive maps with markers using Leaflet. Supports marker clustering, custom tile layers, and auto-fitting bounds. Best for displaying geographic data with up to 1000 markers.',
590
+ schema: {
591
+ type: 'object',
592
+ properties: {
593
+ center: { type: 'array', items: { type: 'number' }, minItems: 2, maxItems: 2, description: 'Map center [lat, lng]' },
594
+ zoom: { type: 'number', description: 'Zoom level (1-18, default: 13)' },
595
+ markers: {
596
+ type: 'array',
597
+ items: {
598
+ type: 'object',
599
+ properties: {
600
+ position: { type: 'array', items: { type: 'number' }, minItems: 2, maxItems: 2 },
601
+ title: { type: 'string' },
602
+ popup: { type: 'string' },
603
+ },
604
+ required: ['position'],
605
+ },
606
+ },
607
+ height: { type: 'string', description: 'CSS height (default: 400px)' },
608
+ fitBounds: { type: 'boolean', description: 'Auto-fit to show all markers' },
609
+ clustering: { type: 'boolean', description: 'Enable marker clustering for large datasets' },
610
+ },
611
+ required: [],
612
+ },
613
+ examples: [
614
+ {
615
+ query: 'Show office locations on a map',
616
+ component: {
617
+ id: 'example-map-1',
618
+ type: 'map',
619
+ position: { colStart: 1, colSpan: 12 },
620
+ params: {
621
+ center: [48.8566, 2.3522],
622
+ zoom: 5,
623
+ markers: [
624
+ { position: [48.8566, 2.3522], tooltip: 'Paris', popup: 'HQ — 120 employees' },
625
+ { position: [51.5074, -0.1278], tooltip: 'London', popup: 'UK Office — 45 employees' },
626
+ ],
627
+ fitBounds: true,
628
+ },
629
+ },
630
+ },
631
+ ],
632
+ limits: DEFAULT_RESOURCE_LIMITS,
633
+ }
634
+
635
+ /**
636
+ * Form Registry Entry
637
+ */
638
+ export const FormRegistry: ComponentRegistryEntry = {
639
+ type: 'form',
640
+ name: 'Form',
641
+ description:
642
+ 'Render interactive forms with text inputs, selects, checkboxes, date pickers, and conditional fields. Supports persistence, validation, and submit actions that trigger MCP tool calls.',
643
+ schema: {
644
+ type: 'object',
645
+ properties: {
646
+ title: { type: 'string', description: 'Form title' },
647
+ fields: {
648
+ type: 'array',
649
+ items: {
650
+ type: 'object',
651
+ properties: {
652
+ name: { type: 'string' },
653
+ label: { type: 'string' },
654
+ type: { type: 'string', enum: ['text', 'number', 'email', 'password', 'textarea', 'select', 'checkbox', 'radio', 'date'] },
655
+ required: { type: 'boolean' },
656
+ placeholder: { type: 'string' },
657
+ options: { type: 'array', items: { type: 'object', properties: { label: { type: 'string' }, value: { type: 'string' } } } },
658
+ },
659
+ required: ['name', 'label', 'type'],
660
+ },
661
+ },
662
+ submitLabel: { type: 'string', description: 'Submit button text (default: "Submit")' },
663
+ layout: { type: 'string', enum: ['vertical', 'horizontal', 'inline'] },
664
+ },
665
+ required: ['fields'],
666
+ },
667
+ examples: [
668
+ {
669
+ query: 'Create a document upload form',
670
+ component: {
671
+ id: 'example-form-1',
672
+ type: 'form',
673
+ position: { colStart: 1, colSpan: 6 },
674
+ params: {
675
+ title: 'Upload Document',
676
+ fields: [
677
+ { name: 'title', label: 'Document Title', type: 'text', required: true },
678
+ { name: 'category', label: 'Category', type: 'select', options: [{ label: 'Report', value: 'report' }, { label: 'Invoice', value: 'invoice' }] },
679
+ { name: 'notes', label: 'Notes', type: 'textarea' },
680
+ ],
681
+ submitLabel: 'Upload',
682
+ },
683
+ },
684
+ },
685
+ ],
686
+ limits: DEFAULT_RESOURCE_LIMITS,
687
+ }
688
+
689
+ /**
690
+ * Modal Registry Entry
691
+ */
692
+ export const ModalRegistry: ComponentRegistryEntry = {
693
+ type: 'modal',
694
+ name: 'Modal',
695
+ description:
696
+ 'Render a dialog overlay with Portal rendering. Supports sizes from small to fullscreen, close on Escape/backdrop, and nested content. Best for confirmations, detail views, and focused interactions.',
697
+ schema: {
698
+ type: 'object',
699
+ properties: {
700
+ title: { type: 'string', description: 'Modal header title' },
701
+ size: { type: 'string', enum: ['sm', 'md', 'lg', 'xl', 'full'], description: 'Modal width (default: md)' },
702
+ showClose: { type: 'boolean', description: 'Show close button (default: true)' },
703
+ closeOnEscape: { type: 'boolean', description: 'Close on Escape key (default: true)' },
704
+ closeOnBackdrop: { type: 'boolean', description: 'Close on backdrop click (default: true)' },
705
+ maxHeight: { type: 'string', description: 'CSS max-height for scrollable content' },
706
+ },
707
+ required: [],
708
+ },
709
+ examples: [
710
+ {
711
+ query: 'Show document details in a dialog',
712
+ component: {
713
+ id: 'example-modal-1',
714
+ type: 'modal',
715
+ position: { colStart: 1, colSpan: 12 },
716
+ params: {
717
+ title: 'Document Details',
718
+ size: 'lg',
719
+ },
720
+ },
721
+ },
722
+ ],
723
+ limits: DEFAULT_RESOURCE_LIMITS,
724
+ }
725
+
726
+ /**
727
+ * Action Group Registry Entry
728
+ */
729
+ export const ActionGroupRegistry: ComponentRegistryEntry = {
730
+ type: 'action-group',
731
+ name: 'ActionGroup',
732
+ description:
733
+ 'Render a group of action buttons in horizontal, vertical, or grid layout. Each action triggers an MCP tool call. Best for presenting multiple related actions like CRUD operations or workflow steps.',
734
+ schema: {
735
+ type: 'object',
736
+ properties: {
737
+ actions: {
738
+ type: 'array',
739
+ items: {
740
+ type: 'object',
741
+ properties: {
742
+ label: { type: 'string' },
743
+ toolName: { type: 'string' },
744
+ params: { type: 'object' },
745
+ variant: { type: 'string', enum: ['primary', 'secondary', 'danger', 'ghost'] },
746
+ icon: { type: 'string' },
747
+ },
748
+ required: ['label', 'toolName'],
749
+ },
750
+ },
751
+ layout: { type: 'string', enum: ['horizontal', 'vertical', 'grid'], description: 'Button layout' },
752
+ label: { type: 'string', description: 'Group label' },
753
+ },
754
+ required: ['actions'],
755
+ },
756
+ examples: [
757
+ {
758
+ query: 'Show actions for this document',
759
+ component: {
760
+ id: 'example-action-group-1',
761
+ type: 'action-group',
762
+ position: { colStart: 1, colSpan: 6 },
763
+ params: {
764
+ label: 'Document Actions',
765
+ actions: [
766
+ { label: 'Download', type: 'button', action: 'tool-call', toolName: 'document_download', params: { id: '123' }, variant: 'primary' },
767
+ { label: 'Share', type: 'button', action: 'tool-call', toolName: 'document_share', params: { id: '123' }, variant: 'secondary' },
768
+ { label: 'Delete', type: 'button', action: 'tool-call', toolName: 'document_delete', params: { id: '123' }, variant: 'danger' },
769
+ ],
770
+ layout: 'horizontal',
771
+ },
772
+ },
773
+ },
774
+ ],
775
+ limits: DEFAULT_RESOURCE_LIMITS,
776
+ }
777
+
778
+ /**
779
+ * Image Gallery Registry Entry
780
+ */
781
+ export const ImageGalleryRegistry: ComponentRegistryEntry = {
782
+ type: 'image-gallery',
783
+ name: 'ImageGallery',
784
+ description:
785
+ 'Render a grid of images with lightbox overlay for fullscreen viewing. Supports captions, configurable columns, aspect ratios, and keyboard navigation in lightbox mode.',
786
+ schema: {
787
+ type: 'object',
788
+ properties: {
789
+ title: { type: 'string', description: 'Gallery title' },
790
+ images: {
791
+ type: 'array',
792
+ items: {
793
+ type: 'object',
794
+ properties: {
795
+ url: { type: 'string', description: 'Image URL' },
796
+ alt: { type: 'string', description: 'Alt text' },
797
+ caption: { type: 'string', description: 'Caption text' },
798
+ thumbnail: { type: 'string', description: 'Thumbnail URL (optional, falls back to url)' },
799
+ },
800
+ required: ['url'],
801
+ },
802
+ },
803
+ columns: { type: 'number', enum: [2, 3, 4, 5], description: 'Grid columns (default: 3)' },
804
+ aspectRatio: { type: 'string', enum: ['1:1', '16:9', '4:3', 'auto'] },
805
+ lightbox: { type: 'boolean', description: 'Enable lightbox overlay (default: true)' },
806
+ },
807
+ required: ['images'],
808
+ },
809
+ examples: [
810
+ {
811
+ query: 'Show document thumbnails',
812
+ component: {
813
+ id: 'example-gallery-1',
814
+ type: 'image-gallery',
815
+ position: { colStart: 1, colSpan: 12 },
816
+ params: {
817
+ title: 'Recent Documents',
818
+ images: [
819
+ { url: '/thumbnails/doc1.png', alt: 'Q4 Report', caption: 'Q4 Report — 24 pages' },
820
+ { url: '/thumbnails/doc2.png', alt: 'Invoice #4521', caption: 'Invoice #4521' },
821
+ ],
822
+ columns: 4,
823
+ },
824
+ },
825
+ },
826
+ ],
827
+ limits: DEFAULT_RESOURCE_LIMITS,
828
+ }
829
+
830
+ /**
831
+ * Video Registry Entry
832
+ */
833
+ export const VideoRegistry: ComponentRegistryEntry = {
834
+ type: 'video',
835
+ name: 'Video',
836
+ description:
837
+ 'Embed video from YouTube, Vimeo, or direct URLs. Auto-detects provider from URL and renders appropriate embed. Supports aspect ratios, autoplay, and start time.',
838
+ schema: {
839
+ type: 'object',
840
+ properties: {
841
+ url: { type: 'string', description: 'Video URL (YouTube, Vimeo, or direct)' },
842
+ title: { type: 'string', description: 'Video title' },
843
+ caption: { type: 'string', description: 'Caption below video' },
844
+ aspectRatio: { type: 'string', enum: ['16:9', '4:3', '1:1', '21:9'], description: 'Aspect ratio (default: 16:9)' },
845
+ autoplay: { type: 'boolean', description: 'Auto-play video' },
846
+ startTime: { type: 'number', description: 'Start time in seconds' },
847
+ },
848
+ required: ['url'],
849
+ },
850
+ examples: [
851
+ {
852
+ query: 'Show the product demo video',
853
+ component: {
854
+ id: 'example-video-1',
855
+ type: 'video',
856
+ position: { colStart: 1, colSpan: 8 },
857
+ params: {
858
+ url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
859
+ title: 'Product Demo',
860
+ aspectRatio: '16:9',
861
+ },
862
+ },
863
+ },
864
+ ],
865
+ limits: DEFAULT_RESOURCE_LIMITS,
866
+ }
867
+
868
+ /**
869
+ * Iframe Registry Entry
870
+ */
871
+ export const IframeRegistry: ComponentRegistryEntry = {
872
+ type: 'iframe',
873
+ name: 'Iframe',
874
+ description:
875
+ 'Embed external content via sandboxed iframe. Domain whitelist enforced for security. Supports Mermaid diagrams, Excalidraw, GitHub Gists, Figma, and 60+ whitelisted domains.',
876
+ schema: {
877
+ type: 'object',
878
+ properties: {
879
+ url: { type: 'string', description: 'URL to embed (must be on whitelist)' },
880
+ title: { type: 'string', description: 'Iframe title for accessibility' },
881
+ height: { type: 'string', description: 'CSS height (default: 400px)' },
882
+ sandbox: { type: 'string', description: 'Sandbox attribute (default: restrictive)' },
883
+ },
884
+ required: ['url'],
885
+ },
886
+ examples: [
887
+ {
888
+ query: 'Show the architecture diagram',
889
+ component: {
890
+ id: 'example-iframe-1',
891
+ type: 'iframe',
892
+ position: { colStart: 1, colSpan: 12 },
893
+ params: {
894
+ url: 'https://mermaid.ink/svg/graph+TD;A-->B;B-->C',
895
+ title: 'Architecture Diagram',
896
+ height: '500px',
897
+ },
898
+ },
899
+ },
900
+ ],
901
+ limits: DEFAULT_RESOURCE_LIMITS,
902
+ }
903
+
904
+ /**
905
+ * Image Registry Entry
906
+ */
907
+ export const ImageRegistry: ComponentRegistryEntry = {
908
+ type: 'image',
909
+ name: 'Image',
910
+ description:
911
+ 'Render a single image with optional alt text, caption, and link. Best for logos, screenshots, diagrams, or any standalone visual content.',
912
+ schema: {
913
+ type: 'object',
914
+ properties: {
915
+ url: { type: 'string', description: 'Image URL' },
916
+ alt: { type: 'string', description: 'Alt text for accessibility' },
917
+ title: { type: 'string', description: 'Image title / heading' },
918
+ width: { type: 'string', description: 'CSS width' },
919
+ height: { type: 'string', description: 'CSS height' },
920
+ },
921
+ required: ['url'],
922
+ },
923
+ examples: [
924
+ {
925
+ query: 'Show the company logo',
926
+ component: {
927
+ id: 'example-image-1',
928
+ type: 'image',
929
+ position: { colStart: 1, colSpan: 4 },
930
+ params: {
931
+ url: '/images/logo.png',
932
+ alt: 'Company Logo',
933
+ } as any,
934
+ },
935
+ },
936
+ ],
937
+ limits: DEFAULT_RESOURCE_LIMITS,
938
+ }
939
+
940
+ /**
941
+ * Link Registry Entry
942
+ */
943
+ export const LinkRegistry: ComponentRegistryEntry = {
944
+ type: 'link',
945
+ name: 'Link',
946
+ description:
947
+ 'Render a styled link card with title, description, and URL. Best for navigation, references, and external resource links.',
948
+ schema: {
949
+ type: 'object',
950
+ properties: {
951
+ url: { type: 'string', description: 'Link destination URL' },
952
+ label: { type: 'string', description: 'Link display text' },
953
+ description: { type: 'string', description: 'Link description' },
954
+ icon: { type: 'string', description: 'Icon identifier' },
955
+ },
956
+ required: ['url', 'label'],
957
+ },
958
+ examples: [
959
+ {
960
+ query: 'Link to the API documentation',
961
+ component: {
962
+ id: 'example-link-1',
963
+ type: 'link',
964
+ position: { colStart: 1, colSpan: 4 },
965
+ params: {
966
+ url: 'https://docs.example.com/api',
967
+ label: 'API Documentation',
968
+ description: 'Full reference for the REST API',
969
+ } as any,
970
+ },
971
+ },
972
+ ],
973
+ limits: DEFAULT_RESOURCE_LIMITS,
974
+ }
975
+
543
976
  /**
544
977
  * Component Registry - All components indexed by type
545
978
  */
@@ -554,6 +987,17 @@ export const ComponentRegistry: Map<ComponentType, ComponentRegistryEntry> = new
554
987
  ['footer', FooterRegistry],
555
988
  ['carousel', CarouselRegistry],
556
989
  ['artifact', ArtifactRegistry],
990
+ // v2.2.5: Complete registry
991
+ ['code', CodeRegistry],
992
+ ['map', MapRegistry],
993
+ ['form', FormRegistry],
994
+ ['modal', ModalRegistry],
995
+ ['action-group', ActionGroupRegistry],
996
+ ['image-gallery', ImageGalleryRegistry],
997
+ ['video', VideoRegistry],
998
+ ['iframe', IframeRegistry],
999
+ ['image', ImageRegistry],
1000
+ ['link', LinkRegistry],
557
1001
  ])
558
1002
 
559
1003
  /**