@mastra/playground-ui 22.1.1 → 22.1.2-alpha.0

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,22 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 22.1.2-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - dependencies updates: ([#15085](https://github.com/mastra-ai/mastra/pull/15085))
8
+ - Updated dependency [`@assistant-ui/react@^0.12.22` ↗︎](https://www.npmjs.com/package/@assistant-ui/react/v/0.12.22) (from `^0.12.21`, in `dependencies`)
9
+ - Updated dependency [`@assistant-ui/react-markdown@^0.12.8` ↗︎](https://www.npmjs.com/package/@assistant-ui/react-markdown/v/0.12.8) (from `^0.12.7`, in `dependencies`)
10
+ - Updated dependency [`@assistant-ui/react-syntax-highlighter@^0.12.8` ↗︎](https://www.npmjs.com/package/@assistant-ui/react-syntax-highlighter/v/0.12.8) (from `^0.12.7`, in `dependencies`)
11
+
12
+ - Added ValueLink, ValueWithTooltip, and ValueWithCopyBtn variants to DataKeysAndValues component ([#15208](https://github.com/mastra-ai/mastra/pull/15208))
13
+
14
+ - Updated dependencies [[`87df955`](https://github.com/mastra-ai/mastra/commit/87df955c028660c075873fd5d74af28233ce32eb), [`30a189b`](https://github.com/mastra-ai/mastra/commit/30a189bdd92c4f875a2a6e5d8498ee7fa547bde6), [`075e91a`](https://github.com/mastra-ai/mastra/commit/075e91a4549baf46ad7a42a6a8ac8dfa78cc09e6)]:
15
+ - @mastra/core@1.24.2-alpha.0
16
+ - @mastra/ai-sdk@1.3.4-alpha.0
17
+ - @mastra/client-js@1.13.4-alpha.0
18
+ - @mastra/react@0.2.26-alpha.0
19
+
3
20
  ## 22.1.1
4
21
 
5
22
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -46855,13 +46855,83 @@ function DataKeysAndValuesRoot({ className, children, numOfCol = 1 }) {
46855
46855
  );
46856
46856
  }
46857
46857
 
46858
+ const dataKeysAndValuesValueStyles = "text-ui-smd text-neutral3 min-w-0 py-0.5";
46859
+
46858
46860
  function DataKeysAndValuesValue({ className, children }) {
46859
- return /* @__PURE__ */ jsxRuntime.jsx("dd", { className: cn("text-ui-smd text-neutral3 truncate min-w-0 py-0.5", className), children });
46861
+ return /* @__PURE__ */ jsxRuntime.jsx("dd", { className: cn(dataKeysAndValuesValueStyles, "truncate", className), children });
46862
+ }
46863
+
46864
+ function isExternalUrl(href) {
46865
+ return /^https?:\/\//.test(href);
46866
+ }
46867
+ function DataKeysAndValuesValueLink({ className, children, href }) {
46868
+ const { Link } = useLinkComponent();
46869
+ const isExternal = isExternalUrl(href);
46870
+ const linkClassName = cn(
46871
+ "truncate flex items-center gap-2 hover:text-neutral4 transition-colors",
46872
+ "[&>svg]:w-4 [&>svg]:h-4 [&>svg]:shrink-0 [&>svg]:opacity-70 [&:hover>svg]:opacity-100"
46873
+ );
46874
+ if (isExternal) {
46875
+ return /* @__PURE__ */ jsxRuntime.jsx("dd", { className: cn(dataKeysAndValuesValueStyles, className), children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href, target: "_blank", rel: "noopener noreferrer", className: linkClassName, children: [
46876
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children }),
46877
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLinkIcon, {})
46878
+ ] }) });
46879
+ }
46880
+ return /* @__PURE__ */ jsxRuntime.jsx("dd", { className: cn(dataKeysAndValuesValueStyles, className), children: /* @__PURE__ */ jsxRuntime.jsxs(Link, { href, className: linkClassName, children: [
46881
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children }),
46882
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link2Icon, {})
46883
+ ] }) });
46884
+ }
46885
+
46886
+ function DataKeysAndValuesValueWithCopyBtn({
46887
+ className,
46888
+ children,
46889
+ copyValue,
46890
+ copyTooltip = "Copy to clipboard"
46891
+ }) {
46892
+ const { isCopied, handleCopy } = useCopyToClipboard$1({
46893
+ text: copyValue,
46894
+ copyMessage: "Copied!"
46895
+ });
46896
+ return /* @__PURE__ */ jsxRuntime.jsx("dd", { className: cn(dataKeysAndValuesValueStyles, className), children: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { open: isCopied || void 0, children: [
46897
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
46898
+ "button",
46899
+ {
46900
+ onClick: handleCopy,
46901
+ type: "button",
46902
+ className: cn(
46903
+ "flex gap-2 items-center",
46904
+ "[&>svg]:w-3 [&>svg]:h-3 [&>svg]:shrink-0 [&>svg]:opacity-70 [&:hover>svg]:opacity-100",
46905
+ { "[&>svg]:w-4 [&>svg]:h-4 [&>svg]:text-accent1": isCopied }
46906
+ ),
46907
+ "aria-label": isCopied ? "Copied!" : copyTooltip,
46908
+ children: [
46909
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children }),
46910
+ isCopied ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, {}) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CopyIcon, {})
46911
+ ]
46912
+ }
46913
+ ) }),
46914
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: isCopied ? "Copied!" : copyTooltip })
46915
+ ] }) });
46916
+ }
46917
+
46918
+ function DataKeysAndValuesValueWithTooltip({
46919
+ className,
46920
+ children,
46921
+ tooltip
46922
+ }) {
46923
+ return /* @__PURE__ */ jsxRuntime.jsx("dd", { className: cn(dataKeysAndValuesValueStyles, className), children: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
46924
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { tabIndex: 0, className: "truncate cursor-help hover:text-neutral4 inline", children }) }),
46925
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: tooltip })
46926
+ ] }) });
46860
46927
  }
46861
46928
 
46862
46929
  const DataKeysAndValues = Object.assign(DataKeysAndValuesRoot, {
46863
46930
  Key: DataKeysAndValuesKey,
46864
46931
  Value: DataKeysAndValuesValue,
46932
+ ValueLink: DataKeysAndValuesValueLink,
46933
+ ValueWithTooltip: DataKeysAndValuesValueWithTooltip,
46934
+ ValueWithCopyBtn: DataKeysAndValuesValueWithCopyBtn,
46865
46935
  Header: DataKeysAndValuesHeader
46866
46936
  });
46867
46937