@mastra/playground-ui 20.0.2 → 21.0.0-alpha.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 21.0.0-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Added component tests for StudioConfigForm apiPrefix handling to validate the fix for issue #14634. ([#14893](https://github.com/mastra-ai/mastra/pull/14893))
8
+
9
+ - Fixed SearchFieldBlock search icon sizing and vertical alignment to properly scale across all input sizes (sm, md, default, lg) ([#14927](https://github.com/mastra-ai/mastra/pull/14927))
10
+
11
+ - Updated dependencies [[`13f4327`](https://github.com/mastra-ai/mastra/commit/13f4327f052faebe199cefbe906d33bf90238767)]:
12
+ - @mastra/core@1.21.0-alpha.1
13
+ - @mastra/client-js@1.12.0-alpha.1
14
+ - @mastra/ai-sdk@1.3.0
15
+ - @mastra/react@0.2.21-alpha.1
16
+
17
+ ## 21.0.0-alpha.0
18
+
19
+ ### Patch Changes
20
+
21
+ - Fixed broken colors in DataDetailsPanelCodeSection when using Light theme by adding theme-aware CodeMirror styling and container classes ([#14923](https://github.com/mastra-ai/mastra/pull/14923))
22
+
23
+ - Reverted HorizontalBars layout to original inline style with label overlaid inside the bar and total displayed to the right ([#14919](https://github.com/mastra-ai/mastra/pull/14919))
24
+
25
+ - Updated dependencies [[`9a43b47`](https://github.com/mastra-ai/mastra/commit/9a43b476465e86c9aca381c2831066b5c33c999a), [`edf8f9d`](https://github.com/mastra-ai/mastra/commit/edf8f9d9cd671ffbc8533ac154da6c3386799b33)]:
26
+ - @mastra/core@1.21.0-alpha.0
27
+ - @mastra/client-js@1.12.0-alpha.0
28
+ - @mastra/react@0.2.21-alpha.0
29
+
3
30
  ## 20.0.2
4
31
 
5
32
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -5569,7 +5569,7 @@ function CopyButton({
5569
5569
  ] });
5570
5570
  }
5571
5571
 
5572
- function buildDarkTheme() {
5572
+ function buildDarkTheme$1() {
5573
5573
  const baseTheme = codemirrorThemeDracula.draculaInit({
5574
5574
  settings: {
5575
5575
  fontFamily: "var(--geist-mono)",
@@ -5656,7 +5656,7 @@ function buildDarkTheme() {
5656
5656
  });
5657
5657
  return [baseTheme, customLineNumberTheme];
5658
5658
  }
5659
- function buildLightTheme() {
5659
+ function buildLightTheme$1() {
5660
5660
  const editorTheme = view.EditorView.theme({
5661
5661
  "&": {
5662
5662
  backgroundColor: "transparent",
@@ -5759,7 +5759,7 @@ function buildLightTheme() {
5759
5759
  }
5760
5760
  const useCodemirrorTheme$2 = () => {
5761
5761
  const isDark = useIsDarkMode();
5762
- return React.useMemo(() => isDark ? buildDarkTheme() : buildLightTheme(), [isDark]);
5762
+ return React.useMemo(() => isDark ? buildDarkTheme$1() : buildLightTheme$1(), [isDark]);
5763
5763
  };
5764
5764
  const CodeEditor = React.forwardRef(
5765
5765
  ({
@@ -34303,14 +34303,25 @@ function SearchFieldBlock({
34303
34303
  placeholder,
34304
34304
  onChange,
34305
34305
  size,
34306
- className: "pl-10"
34306
+ className: cn(
34307
+ size === "sm" && "pl-8",
34308
+ size === "md" && "pl-9",
34309
+ (!size || size === "default") && "pl-10",
34310
+ size === "lg" && "pl-11"
34311
+ )
34307
34312
  }
34308
34313
  ),
34309
34314
  /* @__PURE__ */ jsxRuntime.jsx(
34310
34315
  lucideReact.SearchIcon,
34311
34316
  {
34312
34317
  "aria-hidden": "true",
34313
- className: "text-neutral4 opacity-50 group-has-focus:opacity-100 absolute top-2 left-3 w-5 h-5"
34318
+ className: cn(
34319
+ "text-neutral4 opacity-50 group-has-focus:opacity-100 absolute left-3 top-1/2 -translate-y-1/2",
34320
+ size === "sm" && "w-3.5 h-3.5",
34321
+ size === "md" && "w-4 h-4",
34322
+ (!size || size === "default") && "w-[1.125rem] h-[1.125rem]",
34323
+ size === "lg" && "w-5 h-5"
34324
+ )
34314
34325
  }
34315
34326
  ),
34316
34327
  onReset && value && /* @__PURE__ */ jsxRuntime.jsx(
@@ -42673,62 +42684,65 @@ function HorizontalBars({
42673
42684
  });
42674
42685
  const isStacked = segments.length > 1;
42675
42686
  return /* @__PURE__ */ jsxRuntime.jsxs(ScrollArea, { className: cn("w-full h-full", className), children: [
42676
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 mb-4 mt-2", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 flex items-center gap-4", children: segments.map((seg) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
42677
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-2 rounded-full", style: { backgroundColor: seg.color } }),
42678
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-ui-sm text-neutral3", children: seg.label })
42679
- ] }, seg.label)) }) }),
42687
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 mb-4 mt-2", children: [
42688
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 flex items-center gap-4", children: segments.map((seg) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
42689
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-2 rounded-full", style: { backgroundColor: seg.color } }),
42690
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-ui-sm text-neutral3", children: seg.label })
42691
+ ] }, seg.label)) }),
42692
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-ui-sm text-neutral2 pr-2", children: "Total" })
42693
+ ] }),
42680
42694
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-3.5", children: sorted.map((d) => {
42681
42695
  const total = d.values.reduce((s, v) => s + v, 0);
42682
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-1", children: [
42683
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
42684
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-ui-sm text-neutral4 truncate", children: d.name }),
42685
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-ui-sm text-neutral4 tabular-nums shrink-0", children: fmt(total) })
42686
- ] }),
42687
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative h-5 w-full", children: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
42688
- /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
42689
- "div",
42690
- {
42691
- className: "absolute inset-y-0 left-0 cursor-default",
42692
- style: { width: `${maxVal > 0 ? total / maxVal * 100 : 0}%` },
42693
- children: segments.map((seg, si) => {
42694
- const val = d.values[si] ?? 0;
42695
- const pct = total > 0 ? val / total * 100 : 0;
42696
- const left = d.values.slice(0, si).reduce((s, v) => s + (total > 0 ? v / total * 100 : 0), 0);
42697
- const isLastWithValue = d.values.slice(si + 1).every((v) => !v);
42698
- if (isStacked) {
42696
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-14 h-6 ", children: [
42697
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative h-full flex-1 min-w-0", children: [
42698
+ /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
42699
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
42700
+ "div",
42701
+ {
42702
+ className: "absolute inset-y-0 left-0 cursor-default",
42703
+ style: { width: `${maxVal > 0 ? total / maxVal * 100 : 0}%` },
42704
+ children: segments.map((seg, si) => {
42705
+ const val = d.values[si] ?? 0;
42706
+ const pct = total > 0 ? val / total * 100 : 0;
42707
+ const left = d.values.slice(0, si).reduce((s, v) => s + (total > 0 ? v / total * 100 : 0), 0);
42708
+ const isLastWithValue = d.values.slice(si + 1).every((v) => !v);
42709
+ if (isStacked) {
42710
+ return /* @__PURE__ */ jsxRuntime.jsx(
42711
+ "div",
42712
+ {
42713
+ className: cn(
42714
+ "absolute inset-y-0",
42715
+ si === 0 && "rounded-l",
42716
+ isLastWithValue && "rounded-r"
42717
+ ),
42718
+ style: {
42719
+ left: `${left}%`,
42720
+ width: `${pct}%`,
42721
+ backgroundColor: seg.color
42722
+ }
42723
+ },
42724
+ seg.label
42725
+ );
42726
+ }
42699
42727
  return /* @__PURE__ */ jsxRuntime.jsx(
42700
42728
  "div",
42701
42729
  {
42702
- className: cn(
42703
- "absolute inset-y-0",
42704
- si === 0 && "rounded-l",
42705
- isLastWithValue && "rounded-r"
42706
- ),
42707
- style: {
42708
- left: `${left}%`,
42709
- width: `${pct}%`,
42710
- backgroundColor: seg.color
42711
- }
42730
+ className: "absolute inset-y-0 left-0 rounded",
42731
+ style: { width: `${pct}%`, backgroundColor: seg.color }
42712
42732
  },
42713
42733
  seg.label
42714
42734
  );
42715
- }
42716
- return /* @__PURE__ */ jsxRuntime.jsx(
42717
- "div",
42718
- {
42719
- className: "absolute inset-y-0 left-0 rounded",
42720
- style: { width: `${pct}%`, backgroundColor: seg.color }
42721
- },
42722
- seg.label
42723
- );
42724
- })
42725
- }
42726
- ) }),
42727
- /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: "top", className: "font-mono", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-1", children: segments.map((seg, si) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
42728
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: seg.label }),
42729
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto pl-3", children: fmt(d.values[si] ?? 0) })
42730
- ] }, seg.label)) }) })
42731
- ] }) })
42735
+ })
42736
+ }
42737
+ ) }),
42738
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: "top", className: "font-mono", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-1", children: segments.map((seg, si) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
42739
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: seg.label }),
42740
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto pl-3", children: fmt(d.values[si] ?? 0) })
42741
+ ] }, seg.label)) }) })
42742
+ ] }),
42743
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute inset-y-0 left-2.5 flex items-center text-ui-sm text-neutral4 truncate z-10 pointer-events-none", children: d.name })
42744
+ ] }),
42745
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-ui-md text-neutral4 tabular-nums shrink-0 pr-3", children: fmt(total) })
42732
42746
  ] }, d.name);
42733
42747
  }) })
42734
42748
  ] });
@@ -51443,21 +51457,66 @@ function DataDetailsPanelCloseButton({
51443
51457
  );
51444
51458
  }
51445
51459
 
51460
+ function buildDarkTheme() {
51461
+ return codemirrorThemeDracula.draculaInit({
51462
+ settings: {
51463
+ fontFamily: "var(--geist-mono)",
51464
+ fontSize: "0.75rem",
51465
+ lineHighlight: "transparent",
51466
+ gutterBackground: "transparent",
51467
+ gutterForeground: "#939393",
51468
+ background: "transparent"
51469
+ },
51470
+ styles: [{ tag: [highlight$1.tags.className, highlight$1.tags.propertyName] }]
51471
+ });
51472
+ }
51473
+ function buildLightTheme() {
51474
+ const editorTheme = view.EditorView.theme({
51475
+ "&": {
51476
+ backgroundColor: "transparent",
51477
+ color: "var(--neutral6)",
51478
+ fontSize: "0.75rem"
51479
+ },
51480
+ "&.cm-editor .cm-scroller": {
51481
+ fontFamily: "var(--geist-mono)"
51482
+ },
51483
+ ".cm-gutters": {
51484
+ backgroundColor: "transparent",
51485
+ color: "var(--neutral2)",
51486
+ borderRight: "none"
51487
+ },
51488
+ ".cm-content": {
51489
+ color: "var(--neutral6)",
51490
+ caretColor: "var(--neutral6)"
51491
+ },
51492
+ ".cm-activeLine": {
51493
+ backgroundColor: "transparent"
51494
+ },
51495
+ ".cm-activeLineGutter": {
51496
+ backgroundColor: "transparent"
51497
+ },
51498
+ ".cm-cursor, .cm-dropCursor": {
51499
+ borderLeftColor: "var(--neutral6)"
51500
+ }
51501
+ });
51502
+ const highlightStyle = language.HighlightStyle.define([
51503
+ { tag: [highlight$1.tags.comment, highlight$1.tags.bracket], color: "var(--neutral2)" },
51504
+ { tag: [highlight$1.tags.string, highlight$1.tags.meta, highlight$1.tags.regexp], color: "var(--accent1)" },
51505
+ { tag: [highlight$1.tags.atom, highlight$1.tags.bool, highlight$1.tags.special(highlight$1.tags.variableName)], color: "var(--accent6)" },
51506
+ { tag: [highlight$1.tags.keyword, highlight$1.tags.operator, highlight$1.tags.tagName], color: "var(--accent2)" },
51507
+ { tag: [highlight$1.tags.function(highlight$1.tags.propertyName), highlight$1.tags.propertyName], color: "var(--accent5)" },
51508
+ {
51509
+ tag: [highlight$1.tags.definition(highlight$1.tags.variableName), highlight$1.tags.function(highlight$1.tags.variableName), highlight$1.tags.className, highlight$1.tags.attributeName],
51510
+ color: "var(--accent3)"
51511
+ },
51512
+ { tag: [highlight$1.tags.variableName, highlight$1.tags.number], color: "var(--accent5)" },
51513
+ { tag: [highlight$1.tags.name, highlight$1.tags.quote], color: "var(--accent1)" }
51514
+ ]);
51515
+ return [editorTheme, language.syntaxHighlighting(highlightStyle)];
51516
+ }
51446
51517
  const useCodemirrorTheme = () => {
51447
- return React.useMemo(
51448
- () => codemirrorThemeDracula.draculaInit({
51449
- settings: {
51450
- fontFamily: "var(--geist-mono)",
51451
- fontSize: "0.75rem",
51452
- lineHighlight: "transparent",
51453
- gutterBackground: "transparent",
51454
- gutterForeground: "#939393",
51455
- background: "transparent"
51456
- },
51457
- styles: [{ tag: [highlight$1.tags.className, highlight$1.tags.propertyName] }]
51458
- }),
51459
- []
51460
- );
51518
+ const isDark = useIsDarkMode();
51519
+ return React.useMemo(() => isDark ? buildDarkTheme() : buildLightTheme(), [isDark]);
51461
51520
  };
51462
51521
  function DataDetailsPanelCodeSection({
51463
51522
  codeStr = "",
@@ -51507,10 +51566,10 @@ function DataDetailsPanelCodeSection({
51507
51566
  )
51508
51567
  ] })
51509
51568
  ] }),
51510
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-black/20 p-3 overflow-hidden rounded-lg border border-white/10 text-neutral4 text-ui-sm break-all max-h-[30vh] overflow-y-auto", children: usePlainTextView ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-neutral4 font-mono break-all", children: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "text-wrap", children: finalCodeStr }) }) : /* @__PURE__ */ jsxRuntime.jsx(
51569
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "dark:bg-black/20 bg-surface3 p-3 overflow-hidden rounded-lg border dark:border-white/10 border-border1 text-neutral4 text-ui-sm break-all max-h-[30vh] overflow-y-auto", children: usePlainTextView ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-neutral4 font-mono break-all", children: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "text-wrap", children: finalCodeStr }) }) : /* @__PURE__ */ jsxRuntime.jsx(
51511
51570
  CodeMirror,
51512
51571
  {
51513
- extensions: [langJson.json(), CodeMirror.EditorView.lineWrapping],
51572
+ extensions: [langJson.json(), view.EditorView.lineWrapping],
51514
51573
  theme,
51515
51574
  value: codeStr,
51516
51575
  editable: false