@fuf-stack/pixels 0.29.2 → 0.30.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/dist/Accordion/index.cjs +3 -3
- package/dist/Accordion/index.js +2 -2
- package/dist/Avatar/index.cjs +1 -1
- package/dist/Avatar/index.js +1 -1
- package/dist/AvatarGroup/index.cjs +3 -3
- package/dist/AvatarGroup/index.js +2 -2
- package/dist/Badge/index.cjs +1 -1
- package/dist/Badge/index.js +1 -1
- package/dist/Breadcrumb/index.cjs +3 -3
- package/dist/Breadcrumb/index.js +2 -2
- package/dist/Button/index.cjs +1 -1
- package/dist/Button/index.js +1 -1
- package/dist/Card/index.cjs +3 -3
- package/dist/Card/index.js +2 -2
- package/dist/Json/index.cjs +3 -3
- package/dist/Json/index.d.cts +3 -2
- package/dist/Json/index.d.ts +3 -2
- package/dist/Json/index.js +2 -2
- package/dist/Json-DZue23GO.d.cts +24 -0
- package/dist/Json-DZue23GO.d.ts +24 -0
- package/dist/Label/index.cjs +1 -1
- package/dist/Label/index.js +1 -1
- package/dist/Menu/index.cjs +3 -3
- package/dist/Menu/index.js +2 -2
- package/dist/Modal/index.cjs +3 -3
- package/dist/Modal/index.d.cts +3 -2
- package/dist/Modal/index.d.ts +3 -2
- package/dist/Modal/index.js +2 -2
- package/dist/{Modal-DZHeIvQc.d.cts → Modal-CSOPzGYj.d.cts} +6 -1
- package/dist/{Modal-DZHeIvQc.d.ts → Modal-CSOPzGYj.d.ts} +6 -1
- package/dist/Popover/index.cjs +4 -4
- package/dist/Popover/index.js +3 -3
- package/dist/ScrollShadow/index.cjs +4 -4
- package/dist/ScrollShadow/index.js +2 -2
- package/dist/Table/index.cjs +112 -0
- package/dist/Table/index.cjs.map +1 -0
- package/dist/Table/index.d.cts +244 -0
- package/dist/Table/index.d.ts +244 -0
- package/dist/Table/index.js +112 -0
- package/dist/Table/index.js.map +1 -0
- package/dist/Tabs/index.cjs +1 -1
- package/dist/Tabs/index.js +1 -1
- package/dist/Tooltip/index.cjs +1 -1
- package/dist/Tooltip/index.js +1 -1
- package/dist/{chunk-Y3SLMQYA.cjs → chunk-2WDAJ6ER.cjs} +11 -7
- package/dist/chunk-2WDAJ6ER.cjs.map +1 -0
- package/dist/{chunk-EIOL2HNA.js → chunk-33DBA7U2.js} +8 -5
- package/dist/{chunk-EIOL2HNA.js.map → chunk-33DBA7U2.js.map} +1 -1
- package/dist/{chunk-VU64Z744.js → chunk-3QI2ODV2.js} +10 -6
- package/dist/{chunk-VU64Z744.js.map → chunk-3QI2ODV2.js.map} +1 -1
- package/dist/{chunk-L2RCVUXK.js → chunk-7LABJBKF.js} +2 -2
- package/dist/{chunk-L2RCVUXK.js.map → chunk-7LABJBKF.js.map} +1 -1
- package/dist/{chunk-OP6ST4KB.cjs → chunk-7XJHVFT3.cjs} +16 -14
- package/dist/chunk-7XJHVFT3.cjs.map +1 -0
- package/dist/{chunk-JPALSO5E.cjs → chunk-AVYWDZ7X.cjs} +8 -4
- package/dist/chunk-AVYWDZ7X.cjs.map +1 -0
- package/dist/{chunk-BAPBIOOG.js → chunk-BUWMLU3E.js} +2 -2
- package/dist/{chunk-BAPBIOOG.js.map → chunk-BUWMLU3E.js.map} +1 -1
- package/dist/{chunk-D5HC5WLB.cjs → chunk-BXPBP3PC.cjs} +2 -2
- package/dist/{chunk-D5HC5WLB.cjs.map → chunk-BXPBP3PC.cjs.map} +1 -1
- package/dist/{chunk-F2SRHLNC.js → chunk-CQW46JPO.js} +5 -1
- package/dist/chunk-CQW46JPO.js.map +1 -0
- package/dist/{chunk-APEDJG3R.js → chunk-CZJKT7IC.js} +7 -3
- package/dist/{chunk-APEDJG3R.js.map → chunk-CZJKT7IC.js.map} +1 -1
- package/dist/chunk-D4TLDLEX.cjs +63 -0
- package/dist/chunk-D4TLDLEX.cjs.map +1 -0
- package/dist/{chunk-5WRI5ZAA.js → chunk-J7N2552D.js} +33 -1
- package/dist/{chunk-C2BIHVLT.js → chunk-LCSYN3DI.js} +180 -96
- package/dist/chunk-LCSYN3DI.js.map +1 -0
- package/dist/{chunk-RMLPCTDU.js → chunk-LPCCBJ2T.js} +8 -5
- package/dist/{chunk-RMLPCTDU.js.map → chunk-LPCCBJ2T.js.map} +1 -1
- package/dist/{chunk-5HEZFVFG.cjs → chunk-LY45VQ2E.cjs} +3 -3
- package/dist/chunk-LY45VQ2E.cjs.map +1 -0
- package/dist/{chunk-RJAVAHBK.cjs → chunk-NVNT4PMS.cjs} +9 -6
- package/dist/chunk-NVNT4PMS.cjs.map +1 -0
- package/dist/{chunk-XFUHF75Z.cjs → chunk-OLKLIWBE.cjs} +213 -129
- package/dist/chunk-OLKLIWBE.cjs.map +1 -0
- package/dist/{chunk-VAJODF7Z.cjs → chunk-VG5A2YZE.cjs} +5 -1
- package/dist/chunk-VG5A2YZE.cjs.map +1 -0
- package/dist/{chunk-337S7HUF.js → chunk-XVCKJE3P.js} +14 -12
- package/dist/{chunk-337S7HUF.js.map → chunk-XVCKJE3P.js.map} +1 -1
- package/dist/{chunk-VHEIRVBB.cjs → chunk-ZXGEK67F.cjs} +9 -6
- package/dist/chunk-ZXGEK67F.cjs.map +1 -0
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/index.cjs +16 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +17 -17
- package/package.json +27 -21
- package/dist/Json-BbMeuEvE.d.cts +0 -18
- package/dist/Json-BbMeuEvE.d.ts +0 -18
- package/dist/chunk-5HEZFVFG.cjs.map +0 -1
- package/dist/chunk-C2BIHVLT.js.map +0 -1
- package/dist/chunk-DZUJEN5N.cjs +0 -31
- package/dist/chunk-DZUJEN5N.cjs.map +0 -1
- package/dist/chunk-F2SRHLNC.js.map +0 -1
- package/dist/chunk-JPALSO5E.cjs.map +0 -1
- package/dist/chunk-OP6ST4KB.cjs.map +0 -1
- package/dist/chunk-RJAVAHBK.cjs.map +0 -1
- package/dist/chunk-VAJODF7Z.cjs.map +0 -1
- package/dist/chunk-VHEIRVBB.cjs.map +0 -1
- package/dist/chunk-XFUHF75Z.cjs.map +0 -1
- package/dist/chunk-Y3SLMQYA.cjs.map +0 -1
- /package/dist/{chunk-5WRI5ZAA.js.map → chunk-J7N2552D.js.map} +0 -0
|
@@ -1,9 +1,38 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __objRest = (source, exclude) => {
|
|
25
|
+
var target = {};
|
|
26
|
+
for (var prop in source)
|
|
27
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
if (source != null && __getOwnPropSymbols)
|
|
30
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
+
target[prop] = source[prop];
|
|
33
|
+
}
|
|
34
|
+
return target;
|
|
35
|
+
};
|
|
7
36
|
var __commonJS = (cb, mod) => function __require() {
|
|
8
37
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
38
|
};
|
|
@@ -25,7 +54,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
54
|
));
|
|
26
55
|
|
|
27
56
|
export {
|
|
57
|
+
__spreadValues,
|
|
58
|
+
__spreadProps,
|
|
59
|
+
__objRest,
|
|
28
60
|
__commonJS,
|
|
29
61
|
__toESM
|
|
30
62
|
};
|
|
31
|
-
//# sourceMappingURL=chunk-
|
|
63
|
+
//# sourceMappingURL=chunk-J7N2552D.js.map
|
|
@@ -3,8 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-ODLZQXBE.js";
|
|
4
4
|
import {
|
|
5
5
|
__commonJS,
|
|
6
|
+
__spreadProps,
|
|
7
|
+
__spreadValues,
|
|
6
8
|
__toESM
|
|
7
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-J7N2552D.js";
|
|
8
10
|
|
|
9
11
|
// ../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/extends.js
|
|
10
12
|
var require_extends = __commonJS({
|
|
@@ -52,9 +54,7 @@ var require_objectDestructuringEmpty = __commonJS({
|
|
|
52
54
|
});
|
|
53
55
|
|
|
54
56
|
// src/Json/Json.tsx
|
|
55
|
-
import { useState as useState3 } from "react";
|
|
56
|
-
import { FaChevronDown, FaChevronUp, FaTimesCircle } from "react-icons/fa";
|
|
57
|
-
import { HiOutlineClipboard, HiOutlineClipboardCheck } from "react-icons/hi";
|
|
57
|
+
import { useMemo as useMemo2, useState as useState3 } from "react";
|
|
58
58
|
|
|
59
59
|
// ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.30_@babel+runtime@7.26.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@uiw/react-json-view/esm/index.js
|
|
60
60
|
var import_extends21 = __toESM(require_extends());
|
|
@@ -2562,120 +2562,204 @@ var vscodeTheme = {
|
|
|
2562
2562
|
|
|
2563
2563
|
// src/Json/Json.tsx
|
|
2564
2564
|
import { useTheme } from "next-themes";
|
|
2565
|
-
import { cn } from "@fuf-stack/pixel-utils";
|
|
2566
|
-
|
|
2565
|
+
import { cn as cn2 } from "@fuf-stack/pixel-utils";
|
|
2566
|
+
|
|
2567
|
+
// src/Json/jsonParser.ts
|
|
2568
|
+
var JsonParseError = class extends Error {
|
|
2569
|
+
constructor(message) {
|
|
2570
|
+
super(message);
|
|
2571
|
+
this.name = "JsonParseError";
|
|
2572
|
+
}
|
|
2573
|
+
};
|
|
2567
2574
|
var getValue = (value) => {
|
|
2568
2575
|
if (typeof value === "string") {
|
|
2569
|
-
|
|
2576
|
+
try {
|
|
2577
|
+
return JSON.parse(value);
|
|
2578
|
+
} catch (error) {
|
|
2579
|
+
throw new JsonParseError(
|
|
2580
|
+
`Invalid JSON string: ${error.message}`
|
|
2581
|
+
);
|
|
2582
|
+
}
|
|
2583
|
+
}
|
|
2584
|
+
if (value === null || value === void 0) {
|
|
2585
|
+
throw new JsonParseError("Value cannot be null or undefined");
|
|
2570
2586
|
}
|
|
2571
2587
|
if (typeof value === "object") {
|
|
2572
2588
|
return value;
|
|
2573
2589
|
}
|
|
2574
|
-
throw new
|
|
2590
|
+
throw new JsonParseError(`${typeof value} cannot be visualized`);
|
|
2591
|
+
};
|
|
2592
|
+
|
|
2593
|
+
// src/Json/subcomponents/CopiedRenderer.tsx
|
|
2594
|
+
import { HiOutlineClipboard, HiOutlineClipboardCheck } from "react-icons/hi";
|
|
2595
|
+
import { cn } from "@fuf-stack/pixel-utils";
|
|
2596
|
+
import { jsx } from "react/jsx-runtime";
|
|
2597
|
+
var CopiedRenderer = () => {
|
|
2598
|
+
return /* @__PURE__ */ jsx(
|
|
2599
|
+
esm_default.Copied,
|
|
2600
|
+
{
|
|
2601
|
+
render: (props) => {
|
|
2602
|
+
const { style, onClick, className } = props;
|
|
2603
|
+
const isCopied = props["data-copied"];
|
|
2604
|
+
const elmClasses = cn(
|
|
2605
|
+
className,
|
|
2606
|
+
"absolute -right-4 -top-[2px] h-4 w-4 !fill-transparent pl-1",
|
|
2607
|
+
{ "text-success": isCopied }
|
|
2608
|
+
);
|
|
2609
|
+
const handleKeyDown = (e) => {
|
|
2610
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
2611
|
+
onClick == null ? void 0 : onClick(e);
|
|
2612
|
+
}
|
|
2613
|
+
};
|
|
2614
|
+
return /* @__PURE__ */ jsx(
|
|
2615
|
+
"span",
|
|
2616
|
+
{
|
|
2617
|
+
className: "relative !ml-0 !h-[1em] !w-0",
|
|
2618
|
+
style,
|
|
2619
|
+
"data-testid": "copy-button",
|
|
2620
|
+
role: "button",
|
|
2621
|
+
tabIndex: 0,
|
|
2622
|
+
onKeyDown: handleKeyDown,
|
|
2623
|
+
onClick: (e) => onClick == null ? void 0 : onClick(e),
|
|
2624
|
+
"aria-label": isCopied ? "Copied to clipboard" : "Copy to clipboard",
|
|
2625
|
+
children: isCopied ? /* @__PURE__ */ jsx(HiOutlineClipboardCheck, { className: elmClasses }) : /* @__PURE__ */ jsx(HiOutlineClipboard, { className: elmClasses })
|
|
2626
|
+
}
|
|
2627
|
+
);
|
|
2628
|
+
}
|
|
2629
|
+
}
|
|
2630
|
+
);
|
|
2575
2631
|
};
|
|
2576
|
-
var
|
|
2632
|
+
var CopiedRenderer_default = CopiedRenderer;
|
|
2633
|
+
|
|
2634
|
+
// src/Json/subcomponents/ErrorRenderer.tsx
|
|
2635
|
+
import { FaChevronDown, FaChevronUp, FaTimesCircle } from "react-icons/fa";
|
|
2636
|
+
import { Fragment as Fragment3, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
2637
|
+
var ErrorRenderer = ({
|
|
2638
|
+
error,
|
|
2639
|
+
data,
|
|
2640
|
+
showDetails,
|
|
2641
|
+
onToggleDetails
|
|
2642
|
+
}) => {
|
|
2643
|
+
return /* @__PURE__ */ jsxs(
|
|
2644
|
+
"div",
|
|
2645
|
+
{
|
|
2646
|
+
className: "mb-4 flex flex-col items-center rounded-lg border border-danger bg-danger-50 p-4 text-sm text-danger",
|
|
2647
|
+
role: "alert",
|
|
2648
|
+
"aria-live": "polite",
|
|
2649
|
+
children: [
|
|
2650
|
+
/* @__PURE__ */ jsxs("div", { className: "flex w-full justify-between gap-6", children: [
|
|
2651
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
2652
|
+
/* @__PURE__ */ jsx2(FaTimesCircle, { className: "mr-2", "aria-hidden": "true" }),
|
|
2653
|
+
/* @__PURE__ */ jsx2("span", { className: "font-medium", children: "Failed to parse JSON data" })
|
|
2654
|
+
] }),
|
|
2655
|
+
/* @__PURE__ */ jsx2(
|
|
2656
|
+
Button_default,
|
|
2657
|
+
{
|
|
2658
|
+
color: "danger",
|
|
2659
|
+
size: "sm",
|
|
2660
|
+
variant: "light",
|
|
2661
|
+
onClick: onToggleDetails,
|
|
2662
|
+
"aria-expanded": showDetails,
|
|
2663
|
+
"aria-controls": "error-details",
|
|
2664
|
+
children: showDetails ? /* @__PURE__ */ jsxs(Fragment3, { children: [
|
|
2665
|
+
/* @__PURE__ */ jsx2(FaChevronUp, { "aria-hidden": "true" }),
|
|
2666
|
+
" Hide Details"
|
|
2667
|
+
] }) : /* @__PURE__ */ jsxs(Fragment3, { children: [
|
|
2668
|
+
/* @__PURE__ */ jsx2(FaChevronDown, { "aria-hidden": "true" }),
|
|
2669
|
+
" Show Details"
|
|
2670
|
+
] })
|
|
2671
|
+
}
|
|
2672
|
+
)
|
|
2673
|
+
] }),
|
|
2674
|
+
showDetails && /* @__PURE__ */ jsxs("div", { id: "error-details", className: "mt-4 w-full text-left", children: [
|
|
2675
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2676
|
+
/* @__PURE__ */ jsx2("strong", { children: "Error:" }),
|
|
2677
|
+
/* @__PURE__ */ jsx2("pre", { children: error instanceof Error ? `${error.name}: ${error.message}` : "Unknown error" })
|
|
2678
|
+
] }),
|
|
2679
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
|
|
2680
|
+
/* @__PURE__ */ jsx2("strong", { children: "Data:" }),
|
|
2681
|
+
/* @__PURE__ */ jsx2("pre", { children: typeof data !== "string" ? JSON.stringify(data, null, 2) : data })
|
|
2682
|
+
] })
|
|
2683
|
+
] })
|
|
2684
|
+
]
|
|
2685
|
+
}
|
|
2686
|
+
);
|
|
2687
|
+
};
|
|
2688
|
+
var ErrorRenderer_default = ErrorRenderer;
|
|
2689
|
+
|
|
2690
|
+
// src/Json/subcomponents/NullRenderer.tsx
|
|
2691
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
2692
|
+
var NullRenderer = () => {
|
|
2693
|
+
return /* @__PURE__ */ jsx3(
|
|
2694
|
+
esm_default.Null,
|
|
2695
|
+
{
|
|
2696
|
+
render: () => /* @__PURE__ */ jsx3("span", { className: "rounded bg-warning-100 px-1 text-xs text-warning-700", children: "null" })
|
|
2697
|
+
}
|
|
2698
|
+
);
|
|
2699
|
+
};
|
|
2700
|
+
var NullRenderer_default = NullRenderer;
|
|
2701
|
+
|
|
2702
|
+
// src/Json/Json.tsx
|
|
2703
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
2704
|
+
var Json = ({
|
|
2705
|
+
className = void 0,
|
|
2706
|
+
collapsed = false,
|
|
2707
|
+
value,
|
|
2708
|
+
maxHeight = void 0,
|
|
2709
|
+
onCopy = void 0,
|
|
2710
|
+
errorRenderer = void 0
|
|
2711
|
+
}) => {
|
|
2577
2712
|
const [showDetails, setShowDetails] = useState3(false);
|
|
2578
2713
|
const { resolvedTheme } = useTheme();
|
|
2579
|
-
const isDarkMode =
|
|
2714
|
+
const isDarkMode = useMemo2(
|
|
2715
|
+
() => resolvedTheme === "dark" || document.body.classList.contains("dark"),
|
|
2716
|
+
[resolvedTheme]
|
|
2717
|
+
);
|
|
2718
|
+
const handleCopy = (event) => {
|
|
2719
|
+
const copiedValue = event.currentTarget.textContent || "";
|
|
2720
|
+
onCopy == null ? void 0 : onCopy(copiedValue);
|
|
2721
|
+
};
|
|
2580
2722
|
let content = null;
|
|
2581
2723
|
let error = null;
|
|
2582
2724
|
try {
|
|
2583
|
-
|
|
2584
|
-
|
|
2725
|
+
const parsedValue = getValue(value);
|
|
2726
|
+
content = /* @__PURE__ */ jsx4(
|
|
2727
|
+
"div",
|
|
2585
2728
|
{
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
...isDarkMode ? vscodeTheme : lightTheme,
|
|
2591
|
-
backgroundColor: "unset"
|
|
2592
|
-
},
|
|
2593
|
-
value: getValue(value),
|
|
2594
|
-
children: /* @__PURE__ */ jsx(
|
|
2595
|
-
esm_default.Copied,
|
|
2729
|
+
style: { maxHeight, overflowY: maxHeight ? "auto" : void 0 },
|
|
2730
|
+
className: "relative",
|
|
2731
|
+
children: /* @__PURE__ */ jsxs2(
|
|
2732
|
+
esm_default,
|
|
2596
2733
|
{
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
})
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
)
|
|
2608
|
-
|
|
2609
|
-
"span",
|
|
2610
|
-
{
|
|
2611
|
-
className: "relative !ml-0 !h-[1em] !w-0",
|
|
2612
|
-
style,
|
|
2613
|
-
"data-testid": "copy-button",
|
|
2614
|
-
children: copied ? /* @__PURE__ */ jsx(
|
|
2615
|
-
HiOutlineClipboardCheck,
|
|
2616
|
-
{
|
|
2617
|
-
...elmProps,
|
|
2618
|
-
className: elmClasses
|
|
2619
|
-
}
|
|
2620
|
-
) : (
|
|
2621
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
2622
|
-
/* @__PURE__ */ jsx(HiOutlineClipboard, { ...elmProps, className: elmClasses })
|
|
2623
|
-
)
|
|
2624
|
-
}
|
|
2625
|
-
);
|
|
2626
|
-
}
|
|
2734
|
+
className: "pr-5",
|
|
2735
|
+
collapsed,
|
|
2736
|
+
displayDataTypes: false,
|
|
2737
|
+
style: __spreadProps(__spreadValues({}, isDarkMode ? vscodeTheme : lightTheme), {
|
|
2738
|
+
backgroundColor: "unset"
|
|
2739
|
+
}),
|
|
2740
|
+
value: parsedValue,
|
|
2741
|
+
onCopy: handleCopy,
|
|
2742
|
+
children: [
|
|
2743
|
+
/* @__PURE__ */ jsx4(CopiedRenderer_default, {}),
|
|
2744
|
+
/* @__PURE__ */ jsx4(NullRenderer_default, {})
|
|
2745
|
+
]
|
|
2627
2746
|
}
|
|
2628
2747
|
)
|
|
2629
2748
|
}
|
|
2630
2749
|
);
|
|
2631
2750
|
} catch (err) {
|
|
2632
|
-
|
|
2633
|
-
|
|
2751
|
+
const defaultError = /* @__PURE__ */ jsx4(
|
|
2752
|
+
ErrorRenderer_default,
|
|
2634
2753
|
{
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
2640
|
-
/* @__PURE__ */ jsx(FaTimesCircle, { className: "mr-2" }),
|
|
2641
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium", children: "Failed to parse JSON data" })
|
|
2642
|
-
] }),
|
|
2643
|
-
/* @__PURE__ */ jsx(
|
|
2644
|
-
Button_default,
|
|
2645
|
-
{
|
|
2646
|
-
color: "danger",
|
|
2647
|
-
size: "sm",
|
|
2648
|
-
variant: "light",
|
|
2649
|
-
onClick: () => setShowDetails(!showDetails),
|
|
2650
|
-
children: showDetails ? /* @__PURE__ */ jsxs(Fragment3, { children: [
|
|
2651
|
-
/* @__PURE__ */ jsx(FaChevronUp, {}),
|
|
2652
|
-
" Hide Details"
|
|
2653
|
-
] }) : /* @__PURE__ */ jsxs(Fragment3, { children: [
|
|
2654
|
-
/* @__PURE__ */ jsx(FaChevronDown, {}),
|
|
2655
|
-
" Show Details"
|
|
2656
|
-
] })
|
|
2657
|
-
}
|
|
2658
|
-
)
|
|
2659
|
-
] }),
|
|
2660
|
-
showDetails && /* @__PURE__ */ jsxs("div", { className: "mt-4 w-full text-left", children: [
|
|
2661
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2662
|
-
/* @__PURE__ */ jsx("strong", { children: "Error:" }),
|
|
2663
|
-
/* @__PURE__ */ jsxs("pre", { children: [
|
|
2664
|
-
err?.name,
|
|
2665
|
-
": ",
|
|
2666
|
-
err?.message
|
|
2667
|
-
] })
|
|
2668
|
-
] }),
|
|
2669
|
-
/* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
|
|
2670
|
-
/* @__PURE__ */ jsx("strong", { children: "Data:" }),
|
|
2671
|
-
/* @__PURE__ */ jsx("pre", { children: typeof value !== "string" ? JSON.stringify(value, null, 2) : value })
|
|
2672
|
-
] })
|
|
2673
|
-
] })
|
|
2674
|
-
]
|
|
2754
|
+
error: err,
|
|
2755
|
+
data: value,
|
|
2756
|
+
showDetails,
|
|
2757
|
+
onToggleDetails: () => setShowDetails(!showDetails)
|
|
2675
2758
|
}
|
|
2676
2759
|
);
|
|
2760
|
+
error = errorRenderer ? errorRenderer(err, value) : defaultError;
|
|
2677
2761
|
}
|
|
2678
|
-
return /* @__PURE__ */
|
|
2762
|
+
return /* @__PURE__ */ jsx4("div", { "aria-label": "JSON viewer", className: cn2(className), role: "region", children: error || content });
|
|
2679
2763
|
};
|
|
2680
2764
|
var Json_default = Json;
|
|
2681
2765
|
|
|
@@ -2686,4 +2770,4 @@ export {
|
|
|
2686
2770
|
Json_default,
|
|
2687
2771
|
Json_default2
|
|
2688
2772
|
};
|
|
2689
|
-
//# sourceMappingURL=chunk-
|
|
2773
|
+
//# sourceMappingURL=chunk-LCSYN3DI.js.map
|