@uiw/react-json-view 1.12.0 → 2.0.0-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/README.md +249 -265
- package/cjs/Container.d.ts +10 -0
- package/cjs/Container.js +67 -0
- package/cjs/arrow/TriangleArrow.js +3 -1
- package/cjs/arrow/TriangleSolidArrow.js +7 -3
- package/cjs/comps/Copied.d.ts +16 -0
- package/cjs/{copied.js → comps/Copied.js} +44 -32
- package/cjs/comps/CountInfo.d.ts +19 -0
- package/cjs/comps/CountInfo.js +72 -0
- package/cjs/comps/Ellipsis.d.ts +10 -0
- package/cjs/comps/Ellipsis.js +35 -0
- package/cjs/comps/Key.d.ts +7 -0
- package/cjs/comps/Key.js +39 -0
- package/cjs/comps/KeyValues.d.ts +22 -0
- package/cjs/comps/KeyValues.js +156 -0
- package/cjs/comps/NestedClose.d.ts +10 -0
- package/cjs/comps/NestedClose.js +38 -0
- package/cjs/comps/NestedOpen.d.ts +11 -0
- package/cjs/comps/NestedOpen.js +95 -0
- package/cjs/comps/ReRender/Symbols.d.ts +44 -0
- package/cjs/comps/ReRender/Symbols.js +144 -0
- package/cjs/comps/ReRender/Types.d.ts +36 -0
- package/cjs/comps/ReRender/Types.js +590 -0
- package/cjs/comps/Value.d.ts +11 -0
- package/cjs/comps/Value.js +78 -0
- package/cjs/index.d.ts +72 -52
- package/cjs/index.js +147 -27
- package/cjs/section/Copied.d.ts +6 -0
- package/cjs/section/Copied.js +17 -0
- package/cjs/section/CountInfo.d.ts +6 -0
- package/cjs/section/CountInfo.js +17 -0
- package/cjs/section/CountInfoExtra.d.ts +6 -0
- package/cjs/section/CountInfoExtra.js +17 -0
- package/cjs/section/Ellipsis.d.ts +6 -0
- package/cjs/section/Ellipsis.js +17 -0
- package/cjs/section/KeyName.d.ts +6 -0
- package/cjs/section/KeyName.js +17 -0
- package/cjs/store/Expands.d.ts +16 -0
- package/cjs/store/Expands.js +44 -0
- package/cjs/store/Section.d.ts +33 -0
- package/cjs/store/Section.js +86 -0
- package/cjs/store/ShowTools.d.ts +14 -0
- package/cjs/store/ShowTools.js +44 -0
- package/cjs/store/Symbols.d.ts +37 -0
- package/cjs/store/Symbols.js +112 -0
- package/cjs/store/Types.d.ts +52 -0
- package/cjs/store/Types.js +162 -0
- package/cjs/store.d.ts +29 -5
- package/cjs/store.js +96 -46
- package/cjs/symbol/Arrow.d.ts +6 -0
- package/cjs/symbol/Arrow.js +17 -0
- package/cjs/symbol/BraceLeft.d.ts +6 -0
- package/cjs/symbol/BraceLeft.js +17 -0
- package/cjs/symbol/BraceRight.d.ts +6 -0
- package/cjs/symbol/BraceRight.js +17 -0
- package/cjs/symbol/BracketsLeft.d.ts +6 -0
- package/cjs/symbol/BracketsLeft.js +17 -0
- package/cjs/symbol/BracketsRight.d.ts +6 -0
- package/cjs/symbol/BracketsRight.js +17 -0
- package/cjs/symbol/Colon.d.ts +6 -0
- package/cjs/symbol/Colon.js +17 -0
- package/cjs/symbol/Quote.d.ts +6 -0
- package/cjs/symbol/Quote.js +17 -0
- package/cjs/symbol/ValueQuote.d.ts +6 -0
- package/cjs/symbol/ValueQuote.js +17 -0
- package/cjs/theme/basic.js +3 -0
- package/cjs/theme/dark.js +3 -0
- package/cjs/theme/github.dark.js +3 -0
- package/cjs/theme/github.light.js +3 -0
- package/cjs/theme/gruvbox.js +3 -0
- package/cjs/theme/light.js +3 -0
- package/cjs/theme/monokai.js +3 -0
- package/cjs/theme/nord.js +3 -0
- package/cjs/theme/vscode.js +3 -0
- package/cjs/type.d.ts +50 -0
- package/cjs/type.js +57 -0
- package/cjs/types/Bigint.d.ts +5 -0
- package/cjs/types/Bigint.js +17 -0
- package/cjs/types/Date.d.ts +5 -0
- package/cjs/types/Date.js +17 -0
- package/cjs/types/False.d.ts +5 -0
- package/cjs/types/False.js +17 -0
- package/cjs/types/Float.d.ts +5 -0
- package/cjs/types/Float.js +17 -0
- package/cjs/types/Int.d.ts +5 -0
- package/cjs/types/Int.js +17 -0
- package/cjs/types/Map.d.ts +5 -0
- package/cjs/types/Map.js +17 -0
- package/cjs/types/Nan.d.ts +5 -0
- package/cjs/types/Nan.js +17 -0
- package/cjs/types/Null.d.ts +5 -0
- package/cjs/types/Null.js +17 -0
- package/cjs/types/Set.d.ts +5 -0
- package/cjs/types/Set.js +17 -0
- package/cjs/types/String.d.ts +5 -0
- package/cjs/types/String.js +17 -0
- package/cjs/types/True.d.ts +5 -0
- package/cjs/types/True.js +17 -0
- package/cjs/types/Undefined.d.ts +5 -0
- package/cjs/types/Undefined.js +17 -0
- package/cjs/types/Url.d.ts +5 -0
- package/cjs/types/Url.js +17 -0
- package/cjs/utils/useHighlight.d.ts +9 -0
- package/cjs/utils/useHighlight.js +62 -0
- package/cjs/utils/useRender.d.ts +6 -0
- package/cjs/utils/useRender.js +51 -0
- package/esm/Container.d.ts +10 -0
- package/esm/Container.js +53 -0
- package/esm/arrow/TriangleArrow.js +3 -1
- package/esm/arrow/TriangleSolidArrow.js +7 -3
- package/esm/comps/Copied.d.ts +16 -0
- package/esm/{copied.js → comps/Copied.js} +44 -29
- package/esm/comps/CountInfo.d.ts +19 -0
- package/esm/comps/CountInfo.js +70 -0
- package/esm/comps/Ellipsis.d.ts +10 -0
- package/esm/comps/Ellipsis.js +31 -0
- package/esm/comps/Key.d.ts +7 -0
- package/esm/comps/Key.js +35 -0
- package/esm/comps/KeyValues.d.ts +22 -0
- package/esm/comps/KeyValues.js +142 -0
- package/esm/comps/NestedClose.d.ts +10 -0
- package/esm/comps/NestedClose.js +34 -0
- package/esm/comps/NestedOpen.d.ts +11 -0
- package/esm/comps/NestedOpen.js +91 -0
- package/esm/comps/ReRender/Symbols.d.ts +44 -0
- package/esm/comps/ReRender/Symbols.js +155 -0
- package/esm/comps/ReRender/Types.d.ts +36 -0
- package/esm/comps/ReRender/Types.js +621 -0
- package/esm/comps/Value.d.ts +11 -0
- package/esm/comps/Value.js +69 -0
- package/esm/index.d.ts +72 -52
- package/esm/index.js +98 -18
- package/esm/section/Copied.d.ts +6 -0
- package/esm/section/Copied.js +10 -0
- package/esm/section/CountInfo.d.ts +6 -0
- package/esm/section/CountInfo.js +10 -0
- package/esm/section/CountInfoExtra.d.ts +6 -0
- package/esm/section/CountInfoExtra.js +10 -0
- package/esm/section/Ellipsis.d.ts +6 -0
- package/esm/section/Ellipsis.js +10 -0
- package/esm/section/KeyName.d.ts +6 -0
- package/esm/section/KeyName.js +10 -0
- package/esm/store/Expands.d.ts +16 -0
- package/esm/store/Expands.js +32 -0
- package/esm/store/Section.d.ts +33 -0
- package/esm/store/Section.js +73 -0
- package/esm/store/ShowTools.d.ts +14 -0
- package/esm/store/ShowTools.js +32 -0
- package/esm/store/Symbols.d.ts +37 -0
- package/esm/store/Symbols.js +100 -0
- package/esm/store/Types.d.ts +52 -0
- package/esm/store/Types.js +150 -0
- package/esm/store.d.ts +29 -5
- package/esm/store.js +66 -32
- package/esm/symbol/Arrow.d.ts +6 -0
- package/esm/symbol/Arrow.js +10 -0
- package/esm/symbol/BraceLeft.d.ts +6 -0
- package/esm/symbol/BraceLeft.js +10 -0
- package/esm/symbol/BraceRight.d.ts +6 -0
- package/esm/symbol/BraceRight.js +10 -0
- package/esm/symbol/BracketsLeft.d.ts +6 -0
- package/esm/symbol/BracketsLeft.js +10 -0
- package/esm/symbol/BracketsRight.d.ts +6 -0
- package/esm/symbol/BracketsRight.js +10 -0
- package/esm/symbol/Colon.d.ts +6 -0
- package/esm/symbol/Colon.js +10 -0
- package/esm/symbol/Quote.d.ts +6 -0
- package/esm/symbol/Quote.js +10 -0
- package/esm/symbol/ValueQuote.d.ts +6 -0
- package/esm/symbol/ValueQuote.js +10 -0
- package/esm/theme/basic.js +3 -0
- package/esm/theme/dark.js +3 -0
- package/esm/theme/github.dark.js +3 -0
- package/esm/theme/github.light.js +3 -0
- package/esm/theme/gruvbox.js +3 -0
- package/esm/theme/light.js +3 -0
- package/esm/theme/monokai.js +3 -0
- package/esm/theme/nord.js +3 -0
- package/esm/theme/vscode.js +3 -0
- package/esm/type.d.ts +50 -0
- package/esm/type.js +50 -0
- package/esm/types/Bigint.d.ts +5 -0
- package/esm/types/Bigint.js +10 -0
- package/esm/types/Date.d.ts +5 -0
- package/esm/types/Date.js +10 -0
- package/esm/types/False.d.ts +5 -0
- package/esm/types/False.js +10 -0
- package/esm/types/Float.d.ts +5 -0
- package/esm/types/Float.js +10 -0
- package/esm/types/Int.d.ts +5 -0
- package/esm/types/Int.js +10 -0
- package/esm/types/Map.d.ts +5 -0
- package/esm/types/Map.js +10 -0
- package/esm/types/Nan.d.ts +5 -0
- package/esm/types/Nan.js +10 -0
- package/esm/types/Null.d.ts +5 -0
- package/esm/types/Null.js +10 -0
- package/esm/types/Set.d.ts +5 -0
- package/esm/types/Set.js +10 -0
- package/esm/types/String.d.ts +5 -0
- package/esm/types/String.js +10 -0
- package/esm/types/True.d.ts +5 -0
- package/esm/types/True.js +10 -0
- package/esm/types/Undefined.d.ts +5 -0
- package/esm/types/Undefined.js +10 -0
- package/esm/types/Url.d.ts +5 -0
- package/esm/types/Url.js +10 -0
- package/esm/utils/useHighlight.d.ts +9 -0
- package/esm/{semicolon.js → utils/useHighlight.js} +1 -52
- package/esm/utils/useRender.d.ts +6 -0
- package/esm/utils/useRender.js +41 -0
- package/package.json +1 -1
- package/cjs/comps/ellipsis.d.ts +0 -7
- package/cjs/comps/ellipsis.js +0 -37
- package/cjs/comps/meta.d.ts +0 -12
- package/cjs/comps/meta.js +0 -46
- package/cjs/copied.d.ts +0 -11
- package/cjs/editor/countInfoExtra.d.ts +0 -28
- package/cjs/editor/countInfoExtra.js +0 -101
- package/cjs/editor/icon/add.d.ts +0 -4
- package/cjs/editor/icon/add.js +0 -30
- package/cjs/editor/icon/delete.d.ts +0 -4
- package/cjs/editor/icon/delete.js +0 -30
- package/cjs/editor/icon/edit.d.ts +0 -4
- package/cjs/editor/icon/edit.js +0 -30
- package/cjs/editor/index.d.ts +0 -31
- package/cjs/editor/index.js +0 -60
- package/cjs/editor/objectKey.d.ts +0 -11
- package/cjs/editor/objectKey.js +0 -169
- package/cjs/editor/value.d.ts +0 -22
- package/cjs/editor/value.js +0 -240
- package/cjs/node.d.ts +0 -15
- package/cjs/node.js +0 -343
- package/cjs/semicolon.d.ts +0 -22
- package/cjs/semicolon.js +0 -115
- package/cjs/value.d.ts +0 -93
- package/cjs/value.js +0 -356
- package/esm/comps/ellipsis.d.ts +0 -7
- package/esm/comps/ellipsis.js +0 -31
- package/esm/comps/meta.d.ts +0 -12
- package/esm/comps/meta.js +0 -39
- package/esm/copied.d.ts +0 -11
- package/esm/editor/countInfoExtra.d.ts +0 -28
- package/esm/editor/countInfoExtra.js +0 -68
- package/esm/editor/icon/add.d.ts +0 -4
- package/esm/editor/icon/add.js +0 -24
- package/esm/editor/icon/delete.d.ts +0 -4
- package/esm/editor/icon/delete.js +0 -24
- package/esm/editor/icon/edit.d.ts +0 -4
- package/esm/editor/icon/edit.js +0 -24
- package/esm/editor/index.d.ts +0 -31
- package/esm/editor/index.js +0 -47
- package/esm/editor/objectKey.d.ts +0 -11
- package/esm/editor/objectKey.js +0 -135
- package/esm/editor/value.d.ts +0 -22
- package/esm/editor/value.js +0 -192
- package/esm/node.d.ts +0 -15
- package/esm/node.js +0 -299
- package/esm/semicolon.d.ts +0 -22
- package/esm/value.d.ts +0 -93
- package/esm/value.js +0 -331
package/esm/theme/gruvbox.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export var gruvboxTheme = {
|
|
2
2
|
'--w-rjv-font-family': 'monospace',
|
|
3
3
|
'--w-rjv-color': '#3c3836',
|
|
4
|
+
'--w-rjv-key-string': '#3c3836',
|
|
4
5
|
'--w-rjv-background-color': '#fbf1c7',
|
|
5
6
|
'--w-rjv-line-color': '#ebdbb2',
|
|
6
7
|
'--w-rjv-arrow-color': 'var(--w-rjv-color)',
|
|
@@ -12,6 +13,8 @@ export var gruvboxTheme = {
|
|
|
12
13
|
'--w-rjv-curlybraces-color': '#236a7c',
|
|
13
14
|
'--w-rjv-colon-color': '#002b36',
|
|
14
15
|
'--w-rjv-brackets-color': '#236a7c',
|
|
16
|
+
'--w-rjv-quotes-color': 'var(--w-rjv-key-string)',
|
|
17
|
+
'--w-rjv-quotes-string-color': 'var(--w-rjv-type-string-color)',
|
|
15
18
|
'--w-rjv-type-string-color': '#3c3836',
|
|
16
19
|
'--w-rjv-type-int-color': '#8f3f71',
|
|
17
20
|
'--w-rjv-type-float-color': '#8f3f71',
|
package/esm/theme/light.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export var lightTheme = {
|
|
2
2
|
'--w-rjv-font-family': 'monospace',
|
|
3
3
|
'--w-rjv-color': '#002b36',
|
|
4
|
+
'--w-rjv-key-string': '#002b36',
|
|
4
5
|
'--w-rjv-background-color': '#ffffff',
|
|
5
6
|
'--w-rjv-line-color': '#ebebeb',
|
|
6
7
|
'--w-rjv-arrow-color': 'var(--w-rjv-color)',
|
|
@@ -12,6 +13,8 @@ export var lightTheme = {
|
|
|
12
13
|
'--w-rjv-curlybraces-color': '#236a7c',
|
|
13
14
|
'--w-rjv-colon-color': '#002b36',
|
|
14
15
|
'--w-rjv-brackets-color': '#236a7c',
|
|
16
|
+
'--w-rjv-quotes-color': 'var(--w-rjv-key-string)',
|
|
17
|
+
'--w-rjv-quotes-string-color': 'var(--w-rjv-type-string-color)',
|
|
15
18
|
'--w-rjv-type-string-color': '#cb4b16',
|
|
16
19
|
'--w-rjv-type-int-color': '#268bd2',
|
|
17
20
|
'--w-rjv-type-float-color': '#859900',
|
package/esm/theme/monokai.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export var monokaiTheme = {
|
|
2
2
|
'--w-rjv-font-family': 'monospace',
|
|
3
3
|
'--w-rjv-color': '#E6DB74',
|
|
4
|
+
'--w-rjv-key-string': '#E6DB74',
|
|
4
5
|
'--w-rjv-background-color': '#272822',
|
|
5
6
|
'--w-rjv-line-color': '#3e3d32',
|
|
6
7
|
'--w-rjv-arrow-color': '#f8f8f2',
|
|
@@ -12,6 +13,8 @@ export var monokaiTheme = {
|
|
|
12
13
|
'--w-rjv-curlybraces-color': '#f8f8f2',
|
|
13
14
|
'--w-rjv-colon-color': '#f8f8f2',
|
|
14
15
|
'--w-rjv-brackets-color': '#f8f8f2',
|
|
16
|
+
'--w-rjv-quotes-color': 'var(--w-rjv-key-string)',
|
|
17
|
+
'--w-rjv-quotes-string-color': 'var(--w-rjv-type-string-color)',
|
|
15
18
|
'--w-rjv-type-string-color': '#E6DB74',
|
|
16
19
|
'--w-rjv-type-int-color': '#AE81FF',
|
|
17
20
|
'--w-rjv-type-float-color': '#AE81FF',
|
package/esm/theme/nord.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export var nordTheme = {
|
|
2
2
|
'--w-rjv-font-family': 'monospace',
|
|
3
3
|
'--w-rjv-color': '#88c0d0',
|
|
4
|
+
'--w-rjv-key-string': '#88c0d0',
|
|
4
5
|
'--w-rjv-background-color': '#2e3440',
|
|
5
6
|
'--w-rjv-line-color': '#4c566a',
|
|
6
7
|
'--w-rjv-arrow-color': 'var(--w-rjv-color)',
|
|
@@ -12,6 +13,8 @@ export var nordTheme = {
|
|
|
12
13
|
'--w-rjv-curlybraces-color': '#8fbcbb',
|
|
13
14
|
'--w-rjv-colon-color': '#6d9fac',
|
|
14
15
|
'--w-rjv-brackets-color': '#8fbcbb',
|
|
16
|
+
'--w-rjv-quotes-color': 'var(--w-rjv-key-string)',
|
|
17
|
+
'--w-rjv-quotes-string-color': 'var(--w-rjv-type-string-color)',
|
|
15
18
|
'--w-rjv-type-string-color': '#a3be8c',
|
|
16
19
|
'--w-rjv-type-int-color': '#b48ead',
|
|
17
20
|
'--w-rjv-type-float-color': '#859900',
|
package/esm/theme/vscode.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export var vscodeTheme = {
|
|
2
2
|
'--w-rjv-font-family': 'monospace',
|
|
3
3
|
'--w-rjv-color': '#9cdcfe',
|
|
4
|
+
'--w-rjv-key-string': '#9cdcfe',
|
|
4
5
|
'--w-rjv-background-color': '#1e1e1e',
|
|
5
6
|
'--w-rjv-line-color': '#36334280',
|
|
6
7
|
'--w-rjv-arrow-color': '#838383',
|
|
@@ -12,6 +13,8 @@ export var vscodeTheme = {
|
|
|
12
13
|
'--w-rjv-curlybraces-color': '#d4d4d4',
|
|
13
14
|
'--w-rjv-colon-color': '#d4d4d4',
|
|
14
15
|
'--w-rjv-brackets-color': '#d4d4d4',
|
|
16
|
+
'--w-rjv-quotes-color': 'var(--w-rjv-key-string)',
|
|
17
|
+
'--w-rjv-quotes-string-color': 'var(--w-rjv-type-string-color)',
|
|
15
18
|
'--w-rjv-type-string-color': '#ce9178',
|
|
16
19
|
'--w-rjv-type-int-color': '#b5cea8',
|
|
17
20
|
'--w-rjv-type-float-color': '#b5cea8',
|
package/esm/type.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare const typeMap: {
|
|
2
|
+
string: {
|
|
3
|
+
color: string;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
number: {
|
|
7
|
+
color: string;
|
|
8
|
+
label: string;
|
|
9
|
+
};
|
|
10
|
+
float: {
|
|
11
|
+
color: string;
|
|
12
|
+
label: string;
|
|
13
|
+
};
|
|
14
|
+
bigint: {
|
|
15
|
+
color: string;
|
|
16
|
+
label: string;
|
|
17
|
+
};
|
|
18
|
+
boolean: {
|
|
19
|
+
color: string;
|
|
20
|
+
label: string;
|
|
21
|
+
};
|
|
22
|
+
date: {
|
|
23
|
+
color: string;
|
|
24
|
+
label: string;
|
|
25
|
+
};
|
|
26
|
+
url: {
|
|
27
|
+
color: string;
|
|
28
|
+
label: string;
|
|
29
|
+
};
|
|
30
|
+
null: {
|
|
31
|
+
color: string;
|
|
32
|
+
label: string;
|
|
33
|
+
};
|
|
34
|
+
NaN: {
|
|
35
|
+
color: string;
|
|
36
|
+
label: string;
|
|
37
|
+
};
|
|
38
|
+
undefined: {
|
|
39
|
+
color: string;
|
|
40
|
+
label: string;
|
|
41
|
+
};
|
|
42
|
+
Set: {
|
|
43
|
+
color: string;
|
|
44
|
+
label: string;
|
|
45
|
+
};
|
|
46
|
+
Map: {
|
|
47
|
+
color: string;
|
|
48
|
+
label: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
package/esm/type.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export var typeMap = {
|
|
2
|
+
string: {
|
|
3
|
+
color: 'var(--w-rjv-type-string-color, #cb4b16)',
|
|
4
|
+
label: 'string'
|
|
5
|
+
},
|
|
6
|
+
number: {
|
|
7
|
+
color: 'var(--w-rjv-type-int-color, #268bd2)',
|
|
8
|
+
label: 'int'
|
|
9
|
+
},
|
|
10
|
+
float: {
|
|
11
|
+
color: 'var(--w-rjv-type-float-color, #859900)',
|
|
12
|
+
label: 'float'
|
|
13
|
+
},
|
|
14
|
+
bigint: {
|
|
15
|
+
color: 'var(--w-rjv-type-bigint-color, #268bd2)',
|
|
16
|
+
label: 'bigint'
|
|
17
|
+
},
|
|
18
|
+
boolean: {
|
|
19
|
+
color: 'var(--w-rjv-type-boolean-color, #2aa198)',
|
|
20
|
+
label: 'bool'
|
|
21
|
+
},
|
|
22
|
+
date: {
|
|
23
|
+
color: 'var(--w-rjv-type-date-color, #586e75)',
|
|
24
|
+
label: 'date'
|
|
25
|
+
},
|
|
26
|
+
url: {
|
|
27
|
+
color: 'var(--w-rjv-type-url-color, #0969da)',
|
|
28
|
+
label: 'url'
|
|
29
|
+
},
|
|
30
|
+
null: {
|
|
31
|
+
color: 'var(--w-rjv-type-null-color, #d33682)',
|
|
32
|
+
label: 'null'
|
|
33
|
+
},
|
|
34
|
+
NaN: {
|
|
35
|
+
color: 'var(--w-rjv-type-nan-color, #859900)',
|
|
36
|
+
label: 'NaN'
|
|
37
|
+
},
|
|
38
|
+
undefined: {
|
|
39
|
+
color: 'var(--w-rjv-type-undefined-color, #586e75)',
|
|
40
|
+
label: 'undefined'
|
|
41
|
+
},
|
|
42
|
+
Set: {
|
|
43
|
+
color: 'var(--w-rjv-type-set-color, #268bd2)',
|
|
44
|
+
label: 'Set'
|
|
45
|
+
},
|
|
46
|
+
Map: {
|
|
47
|
+
color: 'var(--w-rjv-type-map-color, #268bd2)',
|
|
48
|
+
label: 'Map'
|
|
49
|
+
}
|
|
50
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useTypesStore } from '../store/Types';
|
|
2
|
+
import { useTypesRender } from '../utils/useRender';
|
|
3
|
+
export var Bigint = props => {
|
|
4
|
+
var {
|
|
5
|
+
Bigint: Comp = {}
|
|
6
|
+
} = useTypesStore();
|
|
7
|
+
useTypesRender(Comp, props, 'Bigint');
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
Bigint.displayName = 'JVR.Bigint';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useTypesStore } from '../store/Types';
|
|
2
|
+
import { useTypesRender } from '../utils/useRender';
|
|
3
|
+
export var Date = props => {
|
|
4
|
+
var {
|
|
5
|
+
Date: Comp = {}
|
|
6
|
+
} = useTypesStore();
|
|
7
|
+
useTypesRender(Comp, props, 'Date');
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
Date.displayName = 'JVR.Date';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useTypesStore } from '../store/Types';
|
|
2
|
+
import { useTypesRender } from '../utils/useRender';
|
|
3
|
+
export var False = props => {
|
|
4
|
+
var {
|
|
5
|
+
False: Comp = {}
|
|
6
|
+
} = useTypesStore();
|
|
7
|
+
useTypesRender(Comp, props, 'False');
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
False.displayName = 'JVR.False';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useTypesStore } from '../store/Types';
|
|
2
|
+
import { useTypesRender } from '../utils/useRender';
|
|
3
|
+
export var Float = props => {
|
|
4
|
+
var {
|
|
5
|
+
Float: Comp = {}
|
|
6
|
+
} = useTypesStore();
|
|
7
|
+
useTypesRender(Comp, props, 'Float');
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
Float.displayName = 'JVR.Float';
|
package/esm/types/Int.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useTypesStore } from '../store/Types';
|
|
2
|
+
import { useTypesRender } from '../utils/useRender';
|
|
3
|
+
export var Int = props => {
|
|
4
|
+
var {
|
|
5
|
+
Int: Comp = {}
|
|
6
|
+
} = useTypesStore();
|
|
7
|
+
useTypesRender(Comp, props, 'Int');
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
Int.displayName = 'JVR.Int';
|
package/esm/types/Map.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useTypesStore } from '../store/Types';
|
|
2
|
+
import { useTypesRender } from '../utils/useRender';
|
|
3
|
+
export var Map = props => {
|
|
4
|
+
var {
|
|
5
|
+
Map: Comp = {}
|
|
6
|
+
} = useTypesStore();
|
|
7
|
+
useTypesRender(Comp, props, 'Map');
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
Map.displayName = 'JVR.Map';
|
package/esm/types/Nan.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useTypesStore } from '../store/Types';
|
|
2
|
+
import { useTypesRender } from '../utils/useRender';
|
|
3
|
+
export var Nan = props => {
|
|
4
|
+
var {
|
|
5
|
+
Nan: Comp = {}
|
|
6
|
+
} = useTypesStore();
|
|
7
|
+
useTypesRender(Comp, props, 'Nan');
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
Nan.displayName = 'JVR.Nan';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useTypesStore } from '../store/Types';
|
|
2
|
+
import { useTypesRender } from '../utils/useRender';
|
|
3
|
+
export var Null = props => {
|
|
4
|
+
var {
|
|
5
|
+
Null: Comp = {}
|
|
6
|
+
} = useTypesStore();
|
|
7
|
+
useTypesRender(Comp, props, 'Null');
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
Null.displayName = 'JVR.Null';
|
package/esm/types/Set.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useTypesStore } from '../store/Types';
|
|
2
|
+
import { useTypesRender } from '../utils/useRender';
|
|
3
|
+
export var Set = props => {
|
|
4
|
+
var {
|
|
5
|
+
Set: Comp = {}
|
|
6
|
+
} = useTypesStore();
|
|
7
|
+
useTypesRender(Comp, props, 'Set');
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
Set.displayName = 'JVR.Set';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useTypesStore } from '../store/Types';
|
|
2
|
+
import { useTypesRender } from '../utils/useRender';
|
|
3
|
+
export var StringText = props => {
|
|
4
|
+
var {
|
|
5
|
+
Str: Comp = {}
|
|
6
|
+
} = useTypesStore();
|
|
7
|
+
useTypesRender(Comp, props, 'Str');
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
StringText.displayName = 'JVR.StringText';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useTypesStore } from '../store/Types';
|
|
2
|
+
import { useTypesRender } from '../utils/useRender';
|
|
3
|
+
export var True = props => {
|
|
4
|
+
var {
|
|
5
|
+
True: Comp = {}
|
|
6
|
+
} = useTypesStore();
|
|
7
|
+
useTypesRender(Comp, props, 'True');
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
True.displayName = 'JVR.True';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useTypesStore } from '../store/Types';
|
|
2
|
+
import { useTypesRender } from '../utils/useRender';
|
|
3
|
+
export var Undefined = props => {
|
|
4
|
+
var {
|
|
5
|
+
Undefined: Comp = {}
|
|
6
|
+
} = useTypesStore();
|
|
7
|
+
useTypesRender(Comp, props, 'Undefined');
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
Undefined.displayName = 'JVR.Undefined';
|
package/esm/types/Url.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useTypesStore } from '../store/Types';
|
|
2
|
+
import { useTypesRender } from '../utils/useRender';
|
|
3
|
+
export var Url = props => {
|
|
4
|
+
var {
|
|
5
|
+
Url: Comp = {}
|
|
6
|
+
} = useTypesStore();
|
|
7
|
+
useTypesRender(Comp, props, 'Url');
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
Url.displayName = 'JVR.Url';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare function usePrevious<T>(value: T): T | undefined;
|
|
3
|
+
interface UseHighlight {
|
|
4
|
+
value: any;
|
|
5
|
+
highlightUpdates?: boolean;
|
|
6
|
+
highlightContainer: React.MutableRefObject<HTMLSpanElement | null>;
|
|
7
|
+
}
|
|
8
|
+
export declare function useHighlight({ value, highlightUpdates, highlightContainer }: UseHighlight): void;
|
|
9
|
+
export {};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["children", "render", "color", "value", "className", "keyName", "highlightUpdates", "quotes", "style", "namespace", "parentName"];
|
|
4
1
|
import { useMemo, useRef, useEffect } from 'react';
|
|
5
|
-
import { Label } from './value';
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
2
|
export function usePrevious(value) {
|
|
8
3
|
var ref = useRef();
|
|
9
4
|
useEffect(() => {
|
|
@@ -57,50 +52,4 @@ export function useHighlight(_ref) {
|
|
|
57
52
|
});
|
|
58
53
|
}
|
|
59
54
|
}, [isHighlight, value, highlightContainer]);
|
|
60
|
-
}
|
|
61
|
-
export var Semicolon = _ref2 => {
|
|
62
|
-
var {
|
|
63
|
-
render,
|
|
64
|
-
color,
|
|
65
|
-
value,
|
|
66
|
-
className = 'w-rjv-object-key',
|
|
67
|
-
keyName,
|
|
68
|
-
highlightUpdates,
|
|
69
|
-
quotes,
|
|
70
|
-
style,
|
|
71
|
-
namespace,
|
|
72
|
-
parentName
|
|
73
|
-
} = _ref2,
|
|
74
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
75
|
-
var highlightContainer = useRef(null);
|
|
76
|
-
var content = typeof keyName === 'string' ? "" + quotes + keyName + quotes : keyName;
|
|
77
|
-
if (render) {
|
|
78
|
-
return render(_extends({
|
|
79
|
-
className
|
|
80
|
-
}, props, {
|
|
81
|
-
value,
|
|
82
|
-
namespace,
|
|
83
|
-
style: _extends({}, style, {
|
|
84
|
-
color
|
|
85
|
-
}),
|
|
86
|
-
parentName,
|
|
87
|
-
keyName,
|
|
88
|
-
quotes,
|
|
89
|
-
label: keyName,
|
|
90
|
-
children: content
|
|
91
|
-
}));
|
|
92
|
-
}
|
|
93
|
-
useHighlight({
|
|
94
|
-
value,
|
|
95
|
-
highlightUpdates,
|
|
96
|
-
highlightContainer
|
|
97
|
-
});
|
|
98
|
-
return /*#__PURE__*/_jsx(Label, _extends({
|
|
99
|
-
className: className,
|
|
100
|
-
color: color
|
|
101
|
-
}, props, {
|
|
102
|
-
ref: highlightContainer,
|
|
103
|
-
children: content
|
|
104
|
-
}));
|
|
105
|
-
};
|
|
106
|
-
Semicolon.displayName = 'JSR.Semicolon';
|
|
55
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type SymbolsElement } from '../store/Symbols';
|
|
2
|
+
import { type TagType, type TypesElement } from '../store/Types';
|
|
3
|
+
import { type SectionElement } from '../store/Section';
|
|
4
|
+
export declare function useSymbolsRender(currentProps: SymbolsElement<TagType>, props: SymbolsElement<TagType>, key: string): void;
|
|
5
|
+
export declare function useTypesRender<K extends TagType>(currentProps: TypesElement<TagType>, props: TypesElement<K>, key: string): void;
|
|
6
|
+
export declare function useSectionRender<K extends TagType>(currentProps: SectionElement<TagType>, props: SectionElement<K>, key: string): void;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import { useSymbolsDispatch } from '../store/Symbols';
|
|
4
|
+
import { useTypesDispatch } from '../store/Types';
|
|
5
|
+
import { useSectionDispatch } from '../store/Section';
|
|
6
|
+
export function useSymbolsRender(currentProps, props, key) {
|
|
7
|
+
var dispatch = useSymbolsDispatch();
|
|
8
|
+
var cls = [currentProps.className, props.className].filter(Boolean).join(' ');
|
|
9
|
+
var reset = _extends({}, currentProps, props, {
|
|
10
|
+
className: cls,
|
|
11
|
+
style: _extends({}, currentProps.style, props.style),
|
|
12
|
+
children: props.children || currentProps.children
|
|
13
|
+
});
|
|
14
|
+
useEffect(() => dispatch({
|
|
15
|
+
[key]: reset
|
|
16
|
+
}), [props]);
|
|
17
|
+
}
|
|
18
|
+
export function useTypesRender(currentProps, props, key) {
|
|
19
|
+
var dispatch = useTypesDispatch();
|
|
20
|
+
var cls = [currentProps.className, props.className].filter(Boolean).join(' ');
|
|
21
|
+
var reset = _extends({}, currentProps, props, {
|
|
22
|
+
className: cls,
|
|
23
|
+
style: _extends({}, currentProps.style, props.style),
|
|
24
|
+
children: props.children || currentProps.children
|
|
25
|
+
});
|
|
26
|
+
useEffect(() => dispatch({
|
|
27
|
+
[key]: reset
|
|
28
|
+
}), [props]);
|
|
29
|
+
}
|
|
30
|
+
export function useSectionRender(currentProps, props, key) {
|
|
31
|
+
var dispatch = useSectionDispatch();
|
|
32
|
+
var cls = [currentProps.className, props.className].filter(Boolean).join(' ');
|
|
33
|
+
var reset = _extends({}, currentProps, props, {
|
|
34
|
+
className: cls,
|
|
35
|
+
style: _extends({}, currentProps.style, props.style),
|
|
36
|
+
children: props.children || currentProps.children
|
|
37
|
+
});
|
|
38
|
+
useEffect(() => dispatch({
|
|
39
|
+
[key]: reset
|
|
40
|
+
}), [props]);
|
|
41
|
+
}
|
package/package.json
CHANGED
package/cjs/comps/ellipsis.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
export interface EllipsisProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
3
|
-
count: number;
|
|
4
|
-
level: number;
|
|
5
|
-
render?: (props: EllipsisProps) => JSX.Element;
|
|
6
|
-
}
|
|
7
|
-
export declare const Ellipsis: FC<PropsWithChildren<EllipsisProps>>;
|
package/cjs/comps/ellipsis.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.Ellipsis = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
var _excluded = ["style", "render", "count", "level"];
|
|
12
|
-
var Ellipsis = function Ellipsis(_ref) {
|
|
13
|
-
var style = _ref.style,
|
|
14
|
-
render = _ref.render,
|
|
15
|
-
count = _ref.count,
|
|
16
|
-
level = _ref.level,
|
|
17
|
-
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
18
|
-
var styl = (0, _objectSpread2["default"])({
|
|
19
|
-
cursor: 'pointer'
|
|
20
|
-
}, style);
|
|
21
|
-
var className = "w-rjv-ellipsis ".concat(props.className || '');
|
|
22
|
-
if (render) return render((0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
23
|
-
style: styl,
|
|
24
|
-
count: count,
|
|
25
|
-
level: level
|
|
26
|
-
}, props), {}, {
|
|
27
|
-
className: className
|
|
28
|
-
}));
|
|
29
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
30
|
-
className: className,
|
|
31
|
-
style: styl
|
|
32
|
-
}, props), {}, {
|
|
33
|
-
children: "..."
|
|
34
|
-
}));
|
|
35
|
-
};
|
|
36
|
-
exports.Ellipsis = Ellipsis;
|
|
37
|
-
Ellipsis.displayName = 'JVR.Ellipsis';
|
package/cjs/comps/meta.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { LabelProps } from '../value';
|
|
3
|
-
export interface MetaProps extends LabelProps {
|
|
4
|
-
isArray?: boolean;
|
|
5
|
-
start?: boolean;
|
|
6
|
-
level?: number;
|
|
7
|
-
render?: (props: Pick<MetaProps, 'start' | 'level' | 'isArray' | 'className' | 'children'>) => JSX.Element;
|
|
8
|
-
}
|
|
9
|
-
export declare function Meta(props: MetaProps): JSX.Element;
|
|
10
|
-
export declare namespace Meta {
|
|
11
|
-
var displayName: string;
|
|
12
|
-
}
|