@seed-ship/mcp-ui-solid 4.0.1 → 4.0.2

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.
@@ -437,6 +437,16 @@ const ScratchpadPanel = (props) => {
437
437
  return _el$;
438
438
  })();
439
439
  };
440
+ function parseContent(content) {
441
+ if (typeof content === "string") {
442
+ try {
443
+ return JSON.parse(content);
444
+ } catch {
445
+ return content;
446
+ }
447
+ }
448
+ return content;
449
+ }
440
450
  const SectionRenderer = (props) => {
441
451
  return (() => {
442
452
  var _el$99 = web.getNextElement(_tmpl$24), _el$100 = _el$99.firstChild, _el$103 = _el$100.nextSibling, [_el$104, _co$21] = web.getNextMarker(_el$103.nextSibling);
@@ -450,7 +460,7 @@ const SectionRenderer = (props) => {
450
460
  get children() {
451
461
  return web.createComponent(DataSection, {
452
462
  get content() {
453
- return props.section.content;
463
+ return parseContent(props.section.content);
454
464
  }
455
465
  });
456
466
  }
@@ -461,7 +471,7 @@ const SectionRenderer = (props) => {
461
471
  get children() {
462
472
  return web.createComponent(InteractiveFilterSection, {
463
473
  get content() {
464
- return props.section.content;
474
+ return parseContent(props.section.content);
465
475
  },
466
476
  get filters() {
467
477
  return props.filters;
@@ -487,7 +497,7 @@ const SectionRenderer = (props) => {
487
497
  get children() {
488
498
  return web.createComponent(ActionSection, {
489
499
  get content() {
490
- return props.section.content;
500
+ return parseContent(props.section.content);
491
501
  },
492
502
  get onAction() {
493
503
  return props.onAction;
@@ -501,7 +511,7 @@ const SectionRenderer = (props) => {
501
511
  get children() {
502
512
  return web.createComponent(EnrichedStepsSection, {
503
513
  get content() {
504
- return props.section.content;
514
+ return parseContent(props.section.content);
505
515
  },
506
516
  get onAction() {
507
517
  return props.onAction;
@@ -518,7 +528,7 @@ const SectionRenderer = (props) => {
518
528
  get children() {
519
529
  return web.createComponent(EmbeddedFormSection, {
520
530
  get content() {
521
- return props.section.content;
531
+ return parseContent(props.section.content);
522
532
  },
523
533
  get sectionId() {
524
534
  return props.section.id;
@@ -538,7 +548,7 @@ const SectionRenderer = (props) => {
538
548
  get children() {
539
549
  return web.createComponent(UnderstandingSection, {
540
550
  get content() {
541
- return props.section.content;
551
+ return parseContent(props.section.content);
542
552
  }
543
553
  });
544
554
  }
@@ -549,7 +559,7 @@ const SectionRenderer = (props) => {
549
559
  get children() {
550
560
  return web.createComponent(FeedbackSection, {
551
561
  get content() {
552
- return props.section.content;
562
+ return parseContent(props.section.content);
553
563
  },
554
564
  get onAction() {
555
565
  return props.onAction;
@@ -563,7 +573,7 @@ const SectionRenderer = (props) => {
563
573
  get children() {
564
574
  return web.createComponent(PromptSection, {
565
575
  get content() {
566
- return props.section.content;
576
+ return parseContent(props.section.content);
567
577
  },
568
578
  get onAction() {
569
579
  return props.onAction;
@@ -577,7 +587,7 @@ const SectionRenderer = (props) => {
577
587
  get children() {
578
588
  return web.createComponent(StepperProgressSection, {
579
589
  get content() {
580
- return props.section.content;
590
+ return parseContent(props.section.content);
581
591
  }
582
592
  });
583
593
  }
@@ -588,7 +598,7 @@ const SectionRenderer = (props) => {
588
598
  get children() {
589
599
  return web.createComponent(ErrorSectionRenderer, {
590
600
  get content() {
591
- return props.section.content;
601
+ return parseContent(props.section.content);
592
602
  },
593
603
  get onAction() {
594
604
  return props.onAction;
@@ -602,7 +612,7 @@ const SectionRenderer = (props) => {
602
612
  get children() {
603
613
  return web.createComponent(SourceCardSection, {
604
614
  get content() {
605
- return props.section.content;
615
+ return parseContent(props.section.content);
606
616
  }
607
617
  });
608
618
  }
@@ -613,7 +623,7 @@ const SectionRenderer = (props) => {
613
623
  get children() {
614
624
  return web.createComponent(DiffSection, {
615
625
  get content() {
616
- return props.section.content;
626
+ return parseContent(props.section.content);
617
627
  }
618
628
  });
619
629
  }
@@ -622,7 +632,7 @@ const SectionRenderer = (props) => {
622
632
  return props.section.type === "verified_text";
623
633
  },
624
634
  get children() {
625
- return web.createComponent(VerifiedText.VerifiedText, web.mergeProps(() => props.section.content, {
635
+ return web.createComponent(VerifiedText.VerifiedText, web.mergeProps(() => parseContent(props.section.content), {
626
636
  onHallucinationClick: (h) => {
627
637
  var _a;
628
638
  return (_a = props.onAction) == null ? void 0 : _a.call(props, "hallucination_click", h);
@@ -636,7 +646,7 @@ const SectionRenderer = (props) => {
636
646
  get children() {
637
647
  return web.createComponent(DataPreviewSection.DataPreviewSection, {
638
648
  get content() {
639
- return props.section.content;
649
+ return parseContent(props.section.content);
640
650
  }
641
651
  });
642
652
  }
@@ -646,7 +656,7 @@ const SectionRenderer = (props) => {
646
656
  },
647
657
  get children() {
648
658
  return (() => {
649
- const c = props.section.content;
659
+ const c = parseContent(props.section.content);
650
660
  return web.createComponent(MapRenderer.MapRenderer, {
651
661
  get params() {
652
662
  return {
@@ -668,24 +678,26 @@ const SectionRenderer = (props) => {
668
678
  return props.section.type === "chart";
669
679
  },
670
680
  get children() {
671
- return web.createComponent(ChartJSRenderer.ChartJSRenderer, {
672
- get component() {
673
- var _a;
674
- return {
675
- id: props.section.id,
676
- type: "chart",
677
- position: {
678
- colStart: 1,
679
- colSpan: 12
680
- },
681
- params: {
682
- ...props.section.content,
683
- renderer: "native",
684
- height: ((_a = props.section.content) == null ? void 0 : _a.height) || "250px"
685
- }
686
- };
687
- }
688
- });
681
+ return (() => {
682
+ const c = parseContent(props.section.content);
683
+ return web.createComponent(ChartJSRenderer.ChartJSRenderer, {
684
+ get component() {
685
+ return {
686
+ id: props.section.id,
687
+ type: "chart",
688
+ position: {
689
+ colStart: 1,
690
+ colSpan: 12
691
+ },
692
+ params: {
693
+ ...c,
694
+ renderer: "native",
695
+ height: (c == null ? void 0 : c.height) || "250px"
696
+ }
697
+ };
698
+ }
699
+ });
700
+ })();
689
701
  }
690
702
  }), web.createComponent(solidJs.Match, {
691
703
  when: true,