@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.
@@ -435,6 +435,16 @@ const ScratchpadPanel = (props) => {
435
435
  return _el$;
436
436
  })();
437
437
  };
438
+ function parseContent(content) {
439
+ if (typeof content === "string") {
440
+ try {
441
+ return JSON.parse(content);
442
+ } catch {
443
+ return content;
444
+ }
445
+ }
446
+ return content;
447
+ }
438
448
  const SectionRenderer = (props) => {
439
449
  return (() => {
440
450
  var _el$99 = getNextElement(_tmpl$24), _el$100 = _el$99.firstChild, _el$103 = _el$100.nextSibling, [_el$104, _co$21] = getNextMarker(_el$103.nextSibling);
@@ -448,7 +458,7 @@ const SectionRenderer = (props) => {
448
458
  get children() {
449
459
  return createComponent(DataSection, {
450
460
  get content() {
451
- return props.section.content;
461
+ return parseContent(props.section.content);
452
462
  }
453
463
  });
454
464
  }
@@ -459,7 +469,7 @@ const SectionRenderer = (props) => {
459
469
  get children() {
460
470
  return createComponent(InteractiveFilterSection, {
461
471
  get content() {
462
- return props.section.content;
472
+ return parseContent(props.section.content);
463
473
  },
464
474
  get filters() {
465
475
  return props.filters;
@@ -485,7 +495,7 @@ const SectionRenderer = (props) => {
485
495
  get children() {
486
496
  return createComponent(ActionSection, {
487
497
  get content() {
488
- return props.section.content;
498
+ return parseContent(props.section.content);
489
499
  },
490
500
  get onAction() {
491
501
  return props.onAction;
@@ -499,7 +509,7 @@ const SectionRenderer = (props) => {
499
509
  get children() {
500
510
  return createComponent(EnrichedStepsSection, {
501
511
  get content() {
502
- return props.section.content;
512
+ return parseContent(props.section.content);
503
513
  },
504
514
  get onAction() {
505
515
  return props.onAction;
@@ -516,7 +526,7 @@ const SectionRenderer = (props) => {
516
526
  get children() {
517
527
  return createComponent(EmbeddedFormSection, {
518
528
  get content() {
519
- return props.section.content;
529
+ return parseContent(props.section.content);
520
530
  },
521
531
  get sectionId() {
522
532
  return props.section.id;
@@ -536,7 +546,7 @@ const SectionRenderer = (props) => {
536
546
  get children() {
537
547
  return createComponent(UnderstandingSection, {
538
548
  get content() {
539
- return props.section.content;
549
+ return parseContent(props.section.content);
540
550
  }
541
551
  });
542
552
  }
@@ -547,7 +557,7 @@ const SectionRenderer = (props) => {
547
557
  get children() {
548
558
  return createComponent(FeedbackSection, {
549
559
  get content() {
550
- return props.section.content;
560
+ return parseContent(props.section.content);
551
561
  },
552
562
  get onAction() {
553
563
  return props.onAction;
@@ -561,7 +571,7 @@ const SectionRenderer = (props) => {
561
571
  get children() {
562
572
  return createComponent(PromptSection, {
563
573
  get content() {
564
- return props.section.content;
574
+ return parseContent(props.section.content);
565
575
  },
566
576
  get onAction() {
567
577
  return props.onAction;
@@ -575,7 +585,7 @@ const SectionRenderer = (props) => {
575
585
  get children() {
576
586
  return createComponent(StepperProgressSection, {
577
587
  get content() {
578
- return props.section.content;
588
+ return parseContent(props.section.content);
579
589
  }
580
590
  });
581
591
  }
@@ -586,7 +596,7 @@ const SectionRenderer = (props) => {
586
596
  get children() {
587
597
  return createComponent(ErrorSectionRenderer, {
588
598
  get content() {
589
- return props.section.content;
599
+ return parseContent(props.section.content);
590
600
  },
591
601
  get onAction() {
592
602
  return props.onAction;
@@ -600,7 +610,7 @@ const SectionRenderer = (props) => {
600
610
  get children() {
601
611
  return createComponent(SourceCardSection, {
602
612
  get content() {
603
- return props.section.content;
613
+ return parseContent(props.section.content);
604
614
  }
605
615
  });
606
616
  }
@@ -611,7 +621,7 @@ const SectionRenderer = (props) => {
611
621
  get children() {
612
622
  return createComponent(DiffSection, {
613
623
  get content() {
614
- return props.section.content;
624
+ return parseContent(props.section.content);
615
625
  }
616
626
  });
617
627
  }
@@ -620,7 +630,7 @@ const SectionRenderer = (props) => {
620
630
  return props.section.type === "verified_text";
621
631
  },
622
632
  get children() {
623
- return createComponent(VerifiedText, mergeProps(() => props.section.content, {
633
+ return createComponent(VerifiedText, mergeProps(() => parseContent(props.section.content), {
624
634
  onHallucinationClick: (h) => {
625
635
  var _a;
626
636
  return (_a = props.onAction) == null ? void 0 : _a.call(props, "hallucination_click", h);
@@ -634,7 +644,7 @@ const SectionRenderer = (props) => {
634
644
  get children() {
635
645
  return createComponent(DataPreviewSection, {
636
646
  get content() {
637
- return props.section.content;
647
+ return parseContent(props.section.content);
638
648
  }
639
649
  });
640
650
  }
@@ -644,7 +654,7 @@ const SectionRenderer = (props) => {
644
654
  },
645
655
  get children() {
646
656
  return (() => {
647
- const c = props.section.content;
657
+ const c = parseContent(props.section.content);
648
658
  return createComponent(MapRenderer, {
649
659
  get params() {
650
660
  return {
@@ -666,24 +676,26 @@ const SectionRenderer = (props) => {
666
676
  return props.section.type === "chart";
667
677
  },
668
678
  get children() {
669
- return createComponent(ChartJSRenderer, {
670
- get component() {
671
- var _a;
672
- return {
673
- id: props.section.id,
674
- type: "chart",
675
- position: {
676
- colStart: 1,
677
- colSpan: 12
678
- },
679
- params: {
680
- ...props.section.content,
681
- renderer: "native",
682
- height: ((_a = props.section.content) == null ? void 0 : _a.height) || "250px"
683
- }
684
- };
685
- }
686
- });
679
+ return (() => {
680
+ const c = parseContent(props.section.content);
681
+ return createComponent(ChartJSRenderer, {
682
+ get component() {
683
+ return {
684
+ id: props.section.id,
685
+ type: "chart",
686
+ position: {
687
+ colStart: 1,
688
+ colSpan: 12
689
+ },
690
+ params: {
691
+ ...c,
692
+ renderer: "native",
693
+ height: (c == null ? void 0 : c.height) || "250px"
694
+ }
695
+ };
696
+ }
697
+ });
698
+ })();
687
699
  }
688
700
  }), createComponent(Match, {
689
701
  when: true,