@uiw/react-json-view 2.0.0-alpha.25 → 2.0.0-alpha.26
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/README.md +1 -1
- package/cjs/comps/Copied.js +20 -1
- package/esm/comps/Copied.js +20 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -910,7 +910,7 @@ Here is the size benchmark (using [bundlephobia.com](https://bundlephobia.com))
|
|
|
910
910
|
| [react-domify](https://github.com/JedWatson/react-domify) | [](https://bundlephobia.com/result?p=react-domify) [](https://bundlephobia.com/result?p=react-domify) | [](https://bundlephobia.com/result?p=react-domify) | [](https://github.com/JedWatson/react-domify/commits) | [](https://www.npmjs.com/package/react-domify) | ❌ | [demo](https://jedwatson.github.io/react-domify/) |
|
|
911
911
|
| [react18-json-view](https://github.com/YYsuni/react18-json-view) | [](https://bundlephobia.com/result?p=react18-json-view) [](https://bundlephobia.com/result?p=react18-json-view) | [](https://bundlephobia.com/result?p=react18-json-view) | [](https://github.com/YYsuni/react18-json-view/commits) | [](https://www.npmjs.com/package/react18-json-view) | ❌ | [demo](https://jv.yysuni.com/) |
|
|
912
912
|
| [@textea/json-viewer](https://github.com/TexteaInc/json-viewer) | [](https://bundlephobia.com/result?p=@textea/json-viewer) [](https://bundlephobia.com/result?p=@textea/json-viewer) | [](https://bundlephobia.com/result?p=@textea/json-viewer) | [](https://github.com/TexteaInc/json-viewer/commits) | [](https://www.npmjs.com/package/@textea/json-viewer) | ✅ | [demo](https://stackblitz.com/edit/textea-json-viewer-v3-b4wgxq) |
|
|
913
|
-
| [react-editable-json-tree](https://github.com/oxyno-zeta/react-editable-json-tree) | [](https://bundlephobia.com/result?p=react-editable-json-tree) [](https://bundlephobia.com/result?p=react-editable-json-tree) | [](https://bundlephobia.com/result?p=react-editable-json-tree) | [ | [](https://bundlephobia.com/result?p=react-editable-json-tree) [](https://bundlephobia.com/result?p=react-editable-json-tree) | [](https://bundlephobia.com/result?p=react-editable-json-tree) | [](https://github.com/oxyno-zeta/react-editable-json-tree/commits) | [](https://www.npmjs.com/package/react-editable-json-tree) | ✅ | [demo](https://oxyno-zeta.github.io/react-editable-json-tree/) |
|
|
914
914
|
| [react-json-view](https://github.com/HuolalaTech/react-json-view) | [](https://bundlephobia.com/result?p=@huolala-tech/react-json-view) [](https://bundlephobia.com/result?p=@huolala-tech/react-json-view) | [](https://bundlephobia.com/result?p=@huolala-tech/react-json-view) | [](https://github.com/HuolalaTech/react-json-view/commits) | [](https://www.npmjs.com/package/@huolala-tech/react-json-view) | ❌ | [demo](https://huolalatech.github.io/react-json-view/) |
|
|
915
915
|
|
|
916
916
|
## Development
|
package/cjs/comps/Copied.js
CHANGED
|
@@ -54,7 +54,26 @@ var Copied = exports.Copied = function Copied(props) {
|
|
|
54
54
|
}
|
|
55
55
|
onCopied && onCopied(copyText, value);
|
|
56
56
|
setCopied(true);
|
|
57
|
-
navigator.clipboard
|
|
57
|
+
var _clipboard = navigator.clipboard || {
|
|
58
|
+
writeText: function writeText(text) {
|
|
59
|
+
return new Promise(function (reslove, reject) {
|
|
60
|
+
var textarea = document.createElement('textarea');
|
|
61
|
+
textarea.style.position = 'absolute';
|
|
62
|
+
textarea.style.opacity = '0';
|
|
63
|
+
textarea.style.left = '-99999999px';
|
|
64
|
+
textarea.value = text;
|
|
65
|
+
document.body.appendChild(textarea);
|
|
66
|
+
textarea.select();
|
|
67
|
+
if (!document.execCommand('copy')) {
|
|
68
|
+
reject();
|
|
69
|
+
} else {
|
|
70
|
+
reslove();
|
|
71
|
+
}
|
|
72
|
+
textarea.remove();
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
_clipboard.writeText(copyText).then(function () {
|
|
58
77
|
var timer = setTimeout(function () {
|
|
59
78
|
setCopied(false);
|
|
60
79
|
clearTimeout(timer);
|
package/esm/comps/Copied.js
CHANGED
|
@@ -44,7 +44,26 @@ export var Copied = props => {
|
|
|
44
44
|
}
|
|
45
45
|
onCopied && onCopied(copyText, value);
|
|
46
46
|
setCopied(true);
|
|
47
|
-
navigator.clipboard
|
|
47
|
+
var _clipboard = navigator.clipboard || {
|
|
48
|
+
writeText(text) {
|
|
49
|
+
return new Promise((reslove, reject) => {
|
|
50
|
+
var textarea = document.createElement('textarea');
|
|
51
|
+
textarea.style.position = 'absolute';
|
|
52
|
+
textarea.style.opacity = '0';
|
|
53
|
+
textarea.style.left = '-99999999px';
|
|
54
|
+
textarea.value = text;
|
|
55
|
+
document.body.appendChild(textarea);
|
|
56
|
+
textarea.select();
|
|
57
|
+
if (!document.execCommand('copy')) {
|
|
58
|
+
reject();
|
|
59
|
+
} else {
|
|
60
|
+
reslove();
|
|
61
|
+
}
|
|
62
|
+
textarea.remove();
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
_clipboard.writeText(copyText).then(() => {
|
|
48
67
|
var timer = setTimeout(() => {
|
|
49
68
|
setCopied(false);
|
|
50
69
|
clearTimeout(timer);
|