@fuf-stack/pixels 0.33.2 → 0.34.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/dist/Json/index.cjs +2 -2
- package/dist/Json/index.js +1 -1
- package/dist/{chunk-LBJ3YG36.cjs → chunk-7UNMWC2W.cjs} +16 -6
- package/dist/{chunk-LBJ3YG36.cjs.map → chunk-7UNMWC2W.cjs.map} +1 -1
- package/dist/{chunk-OPDWDH3W.js → chunk-J7QVKEAW.js} +16 -6
- package/dist/chunk-J7QVKEAW.js.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-OPDWDH3W.js.map +0 -1
package/dist/Json/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk7UNMWC2Wcjs = require('../chunk-7UNMWC2W.cjs');
|
|
5
5
|
require('../chunk-4X43AGXE.cjs');
|
|
6
6
|
require('../chunk-D4TLDLEX.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.Json =
|
|
10
|
+
exports.Json = _chunk7UNMWC2Wcjs.Json_default; exports.default = _chunk7UNMWC2Wcjs.Json_default2;
|
|
11
11
|
//# sourceMappingURL=index.cjs.map
|
package/dist/Json/index.js
CHANGED
|
@@ -2701,6 +2701,20 @@ var NullRenderer_default = NullRenderer;
|
|
|
2701
2701
|
|
|
2702
2702
|
// src/Json/Json.tsx
|
|
2703
2703
|
|
|
2704
|
+
var handleCopy = (rawValue, onCopy) => {
|
|
2705
|
+
let isObject = false;
|
|
2706
|
+
try {
|
|
2707
|
+
if (rawValue !== NullRenderer_default && typeof rawValue === "object") {
|
|
2708
|
+
isObject = true;
|
|
2709
|
+
}
|
|
2710
|
+
} catch (_err) {
|
|
2711
|
+
}
|
|
2712
|
+
const copyValue = isObject ? JSON.stringify(rawValue) : rawValue;
|
|
2713
|
+
setTimeout(() => navigator.clipboard.writeText(copyValue), 1);
|
|
2714
|
+
if (onCopy) {
|
|
2715
|
+
onCopy(copyValue);
|
|
2716
|
+
}
|
|
2717
|
+
};
|
|
2704
2718
|
var Json = ({
|
|
2705
2719
|
className = void 0,
|
|
2706
2720
|
collapsed = false,
|
|
@@ -2715,10 +2729,6 @@ var Json = ({
|
|
|
2715
2729
|
() => resolvedTheme === "dark" || document.body.classList.contains("dark"),
|
|
2716
2730
|
[resolvedTheme]
|
|
2717
2731
|
);
|
|
2718
|
-
const handleCopy = (event) => {
|
|
2719
|
-
const copiedValue = event.currentTarget.textContent || "";
|
|
2720
|
-
onCopy == null ? void 0 : onCopy(copiedValue);
|
|
2721
|
-
};
|
|
2722
2732
|
let content = null;
|
|
2723
2733
|
let error = null;
|
|
2724
2734
|
try {
|
|
@@ -2738,7 +2748,7 @@ var Json = ({
|
|
|
2738
2748
|
backgroundColor: "unset"
|
|
2739
2749
|
}),
|
|
2740
2750
|
value: parsedValue,
|
|
2741
|
-
|
|
2751
|
+
onCopied: (_, rawValue) => handleCopy(rawValue, onCopy),
|
|
2742
2752
|
children: [
|
|
2743
2753
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CopiedRenderer_default, {}),
|
|
2744
2754
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, NullRenderer_default, {})
|
|
@@ -2770,4 +2780,4 @@ var Json_default2 = Json_default;
|
|
|
2770
2780
|
|
|
2771
2781
|
|
|
2772
2782
|
exports.Json_default = Json_default; exports.Json_default2 = Json_default2;
|
|
2773
|
-
//# sourceMappingURL=chunk-
|
|
2783
|
+
//# sourceMappingURL=chunk-7UNMWC2W.cjs.map
|