@dxos/react-ui-syntax-highlighter 0.8.4-main.ae835ea → 0.8.4-main.bc674ce
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/lib/browser/index.mjs +74 -125
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +74 -125
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/Json/Json.d.ts +17 -11
- package/dist/types/src/Json/Json.d.ts.map +1 -1
- package/dist/types/src/Json/Json.stories.d.ts +10 -1
- package/dist/types/src/Json/Json.stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +21 -17
- package/src/Json/Json.stories.tsx +14 -1
- package/src/Json/Json.tsx +54 -104
- package/src/SyntaxHighlighter/SyntaxHighlighter.tsx +3 -3
|
@@ -1,42 +1,36 @@
|
|
|
1
1
|
// src/Json/Json.tsx
|
|
2
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
3
2
|
import jp from "jsonpath";
|
|
4
|
-
import React2, { useEffect, useState } from "react";
|
|
3
|
+
import React2, { forwardRef, useEffect, useState } from "react";
|
|
5
4
|
import { Input } from "@dxos/react-ui";
|
|
5
|
+
import { createReplacer, safeStringify } from "@dxos/util";
|
|
6
6
|
|
|
7
7
|
// src/SyntaxHighlighter/index.ts
|
|
8
8
|
import createElement from "react-syntax-highlighter/dist/esm/create-element";
|
|
9
9
|
|
|
10
10
|
// src/SyntaxHighlighter/SyntaxHighlighter.tsx
|
|
11
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
12
11
|
import React from "react";
|
|
13
12
|
import NativeSyntaxHighlighter from "react-syntax-highlighter/dist/esm/prism-async-light";
|
|
14
13
|
import { coldarkDark as dark, coldarkCold as light } from "react-syntax-highlighter/dist/esm/styles/prism";
|
|
15
14
|
import { useThemeContext } from "@dxos/react-ui";
|
|
16
|
-
import { mx } from "@dxos/
|
|
15
|
+
import { mx } from "@dxos/ui-theme";
|
|
17
16
|
var zeroWidthSpace = "\u200B";
|
|
18
17
|
var SyntaxHighlighter = ({ classNames, children, language = "text", fallback = zeroWidthSpace, ...props }) => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
...props
|
|
36
|
-
}, children || fallback));
|
|
37
|
-
} finally {
|
|
38
|
-
_effect.f();
|
|
39
|
-
}
|
|
18
|
+
const { themeMode } = useThemeContext();
|
|
19
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
20
|
+
className: mx("flex is-full p-1 overflow-hidden", classNames)
|
|
21
|
+
}, /* @__PURE__ */ React.createElement(NativeSyntaxHighlighter, {
|
|
22
|
+
className: "!m-0 is-full overflow-auto scrollbar-thin",
|
|
23
|
+
language: languages[language] || language,
|
|
24
|
+
style: themeMode === "dark" ? dark : light,
|
|
25
|
+
customStyle: {
|
|
26
|
+
background: "unset",
|
|
27
|
+
border: "none",
|
|
28
|
+
boxShadow: "none",
|
|
29
|
+
padding: 0,
|
|
30
|
+
margin: 0
|
|
31
|
+
},
|
|
32
|
+
...props
|
|
33
|
+
}, children || fallback));
|
|
40
34
|
};
|
|
41
35
|
var languages = {
|
|
42
36
|
js: "javascript",
|
|
@@ -44,113 +38,68 @@ var languages = {
|
|
|
44
38
|
};
|
|
45
39
|
|
|
46
40
|
// src/Json/Json.tsx
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
try {
|
|
51
|
-
if (filter) {
|
|
52
|
-
return /* @__PURE__ */ React2.createElement(JsonFilter, params);
|
|
53
|
-
}
|
|
54
|
-
const { classNames, data, replacer, testId } = params;
|
|
55
|
-
return /* @__PURE__ */ React2.createElement(SyntaxHighlighter, {
|
|
56
|
-
language: "json",
|
|
57
|
-
classNames: [
|
|
58
|
-
defaultClassNames,
|
|
59
|
-
classNames
|
|
60
|
-
],
|
|
61
|
-
"data-testid": testId
|
|
62
|
-
}, JSON.stringify(data, replacer && createReplacer(replacer), 2));
|
|
63
|
-
} finally {
|
|
64
|
-
_effect.f();
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
var JsonFilter = ({ classNames, data: initialData, replacer, testId }) => {
|
|
68
|
-
var _effect = _useSignals2();
|
|
69
|
-
try {
|
|
70
|
-
const [data, setData] = useState(initialData);
|
|
71
|
-
const [text, setText] = useState("");
|
|
72
|
-
const [error, setError] = useState(null);
|
|
73
|
-
useEffect(() => {
|
|
74
|
-
if (!initialData || !text.trim().length) {
|
|
75
|
-
setData(initialData);
|
|
76
|
-
} else {
|
|
77
|
-
try {
|
|
78
|
-
setData(jp.query(initialData, text));
|
|
79
|
-
setError(null);
|
|
80
|
-
} catch (err) {
|
|
81
|
-
setData(initialData);
|
|
82
|
-
setError(err);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}, [
|
|
86
|
-
initialData,
|
|
87
|
-
text
|
|
88
|
-
]);
|
|
89
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
90
|
-
className: "flex flex-col grow overflow-hidden"
|
|
91
|
-
}, /* @__PURE__ */ React2.createElement(Input.Root, {
|
|
92
|
-
validationValence: error ? "error" : "success"
|
|
93
|
-
}, /* @__PURE__ */ React2.createElement(Input.TextInput, {
|
|
94
|
-
classNames: [
|
|
95
|
-
"p-1 px-2 font-mono",
|
|
96
|
-
error && "border-red-500"
|
|
97
|
-
],
|
|
98
|
-
variant: "subdued",
|
|
99
|
-
value: text,
|
|
100
|
-
onChange: (event) => setText(event.target.value),
|
|
101
|
-
placeholder: "JSONPath (e.g., $.graph.nodes)"
|
|
102
|
-
})), /* @__PURE__ */ React2.createElement(SyntaxHighlighter, {
|
|
103
|
-
language: "json",
|
|
104
|
-
classNames: [
|
|
105
|
-
defaultClassNames,
|
|
106
|
-
classNames
|
|
107
|
-
],
|
|
108
|
-
"data-testid": testId
|
|
109
|
-
}, JSON.stringify(data, replacer && createReplacer(replacer), 2)));
|
|
110
|
-
} finally {
|
|
111
|
-
_effect.f();
|
|
41
|
+
var Json = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
42
|
+
if (props.filter) {
|
|
43
|
+
return /* @__PURE__ */ React2.createElement(JsonFilter, props);
|
|
112
44
|
}
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
if (parse?.includes(key) && typeof value === "string") {
|
|
45
|
+
const { classNames, data, replacer, testId } = props;
|
|
46
|
+
return /* @__PURE__ */ React2.createElement(SyntaxHighlighter, {
|
|
47
|
+
language: "json",
|
|
48
|
+
classNames: [
|
|
49
|
+
"is-full overflow-y-auto text-sm",
|
|
50
|
+
classNames
|
|
51
|
+
],
|
|
52
|
+
"data-testid": testId,
|
|
53
|
+
ref: forwardedRef
|
|
54
|
+
}, safeStringify(data, replacer && createReplacer(replacer), 2));
|
|
55
|
+
});
|
|
56
|
+
var JsonFilter = /* @__PURE__ */ forwardRef(({ classNames, data: initialData, replacer, testId }, forwardedRef) => {
|
|
57
|
+
const [data, setData] = useState(initialData);
|
|
58
|
+
const [text, setText] = useState("");
|
|
59
|
+
const [error, setError] = useState(null);
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (!initialData || !text.trim().length) {
|
|
62
|
+
setData(initialData);
|
|
63
|
+
} else {
|
|
134
64
|
try {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
65
|
+
setData(jp.query(initialData, text));
|
|
66
|
+
setError(null);
|
|
67
|
+
} catch (err) {
|
|
68
|
+
setData(initialData);
|
|
69
|
+
setError(err);
|
|
138
70
|
}
|
|
139
71
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
72
|
+
}, [
|
|
73
|
+
initialData,
|
|
74
|
+
text
|
|
75
|
+
]);
|
|
76
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
77
|
+
className: "flex flex-col bs-full overflow-hidden",
|
|
78
|
+
ref: forwardedRef
|
|
79
|
+
}, /* @__PURE__ */ React2.createElement(Input.Root, {
|
|
80
|
+
validationValence: error ? "error" : "success"
|
|
81
|
+
}, /* @__PURE__ */ React2.createElement(Input.TextInput, {
|
|
82
|
+
classNames: [
|
|
83
|
+
"p-1 pli-2 font-mono",
|
|
84
|
+
error && "border-rose-500"
|
|
85
|
+
],
|
|
86
|
+
variant: "subdued",
|
|
87
|
+
value: text,
|
|
88
|
+
placeholder: "JSONPath (e.g., $.graph.nodes)",
|
|
89
|
+
onChange: (event) => setText(event.target.value)
|
|
90
|
+
})), /* @__PURE__ */ React2.createElement(SyntaxHighlighter, {
|
|
91
|
+
language: "json",
|
|
92
|
+
classNames: [
|
|
93
|
+
"is-full overflow-y-auto text-sm",
|
|
94
|
+
classNames
|
|
95
|
+
],
|
|
96
|
+
"data-testid": testId
|
|
97
|
+
}, safeStringify(data, replacer && createReplacer(replacer), 2)));
|
|
98
|
+
});
|
|
149
99
|
export {
|
|
150
100
|
Json,
|
|
151
101
|
JsonFilter,
|
|
152
102
|
SyntaxHighlighter,
|
|
153
|
-
createElement
|
|
154
|
-
createReplacer
|
|
103
|
+
createElement
|
|
155
104
|
};
|
|
156
105
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/Json/Json.tsx", "../../../src/SyntaxHighlighter/index.ts", "../../../src/SyntaxHighlighter/SyntaxHighlighter.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\n// TODO(burdon): Use to jsonpath-plus.\nimport jp from 'jsonpath';\nimport React, { useEffect, useState } from 'react';\n\nimport { Input, type ThemedClassName } from '@dxos/react-ui';\
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jp", "React", "useEffect", "useState", "Input", "createElement", "React", "NativeSyntaxHighlighter", "coldarkDark", "dark", "coldarkCold", "light", "useThemeContext", "mx", "zeroWidthSpace", "SyntaxHighlighter", "classNames", "children", "language", "fallback", "props", "themeMode", "useThemeContext", "div", "className", "mx", "NativeSyntaxHighlighter", "languages", "style", "dark", "light", "customStyle", "background", "border", "boxShadow", "padding", "margin", "js", "ts", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\n// TODO(burdon): Use to jsonpath-plus.\nimport jp from 'jsonpath';\nimport React, { forwardRef, useEffect, useState } from 'react';\n\nimport { Input, type ThemedClassName } from '@dxos/react-ui';\nimport { type CreateReplacerProps, createReplacer, safeStringify } from '@dxos/util';\n\nimport { SyntaxHighlighter } from '../SyntaxHighlighter';\n\nexport type JsonProps = ThemedClassName<{\n data?: any;\n filter?: boolean;\n replacer?: CreateReplacerProps;\n testId?: string;\n}>;\n\nexport const Json = forwardRef<HTMLDivElement, JsonProps>((props, forwardedRef) => {\n if (props.filter) {\n return <JsonFilter {...props} />;\n }\n\n const { classNames, data, replacer, testId } = props;\n return (\n <SyntaxHighlighter\n language='json'\n classNames={['is-full overflow-y-auto text-sm', classNames]}\n data-testid={testId}\n ref={forwardedRef}\n >\n {safeStringify(data, replacer && createReplacer(replacer), 2)}\n </SyntaxHighlighter>\n );\n});\n\nexport const JsonFilter = forwardRef<HTMLDivElement, JsonProps>(\n ({ classNames, data: initialData, replacer, testId }, forwardedRef) => {\n const [data, setData] = useState(initialData);\n const [text, setText] = useState('');\n const [error, setError] = useState<Error | null>(null);\n\n useEffect(() => {\n if (!initialData || !text.trim().length) {\n setData(initialData);\n } else {\n try {\n setData(jp.query(initialData, text));\n setError(null);\n } catch (err) {\n setData(initialData);\n setError(err as Error);\n }\n }\n }, [initialData, text]); // TODO(burdon): Need structural diff.\n\n return (\n <div className='flex flex-col bs-full overflow-hidden' ref={forwardedRef}>\n <Input.Root validationValence={error ? 'error' : 'success'}>\n <Input.TextInput\n classNames={['p-1 pli-2 font-mono', error && 'border-rose-500']}\n variant='subdued'\n value={text}\n placeholder='JSONPath (e.g., $.graph.nodes)'\n onChange={(event) => setText(event.target.value)}\n />\n </Input.Root>\n <SyntaxHighlighter\n language='json'\n classNames={['is-full overflow-y-auto text-sm', classNames]}\n data-testid={testId}\n >\n {safeStringify(data, replacer && createReplacer(replacer), 2)}\n </SyntaxHighlighter>\n </div>\n );\n },\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\n// eslint-disable-next-line no-restricted-imports\nimport createElement from 'react-syntax-highlighter/dist/esm/create-element';\n\nexport { createElement };\n\nexport * from './SyntaxHighlighter';\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\nimport { type SyntaxHighlighterProps as NaturalSyntaxHighlighterProps } from 'react-syntax-highlighter';\nimport NativeSyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-async-light';\nimport { coldarkDark as dark, coldarkCold as light } from 'react-syntax-highlighter/dist/esm/styles/prism';\n\nimport { type ThemedClassName, useThemeContext } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nconst zeroWidthSpace = '\\u200b';\n\nexport type SyntaxHighlighterProps = ThemedClassName<\n NaturalSyntaxHighlighterProps & {\n fallback?: string;\n }\n>;\n\n/**\n * NOTE: Using `light-async` version directly from dist to avoid any chance of the heavy one being loaded.\n * The lightweight version will load specific language parsers asynchronously.\n *\n * https://github.com/react-syntax-highlighter/react-syntax-highlighter\n * https://react-syntax-highlighter.github.io/react-syntax-highlighter/demo/prism.html\n */\n// TODO(burdon): Replace with react-ui-editor (and reuse styles).\nexport const SyntaxHighlighter = ({\n classNames,\n children,\n language = 'text',\n fallback = zeroWidthSpace,\n ...props\n}: SyntaxHighlighterProps) => {\n const { themeMode } = useThemeContext();\n\n return (\n <div className={mx('flex is-full p-1 overflow-hidden', classNames)}>\n <NativeSyntaxHighlighter\n className='!m-0 is-full overflow-auto scrollbar-thin'\n language={languages[language as keyof typeof languages] || language}\n style={themeMode === 'dark' ? dark : light}\n customStyle={{\n background: 'unset',\n border: 'none',\n boxShadow: 'none',\n padding: 0,\n margin: 0,\n }}\n {...props}\n >\n {/* Non-empty fallback prevents collapse. */}\n {children || fallback}\n </NativeSyntaxHighlighter>\n </div>\n );\n};\n\nconst languages = {\n js: 'javascript',\n ts: 'typescript',\n};\n"],
|
|
5
|
+
"mappings": ";AAKA,OAAOA,QAAQ;AACf,OAAOC,UAASC,YAAYC,WAAWC,gBAAgB;AAEvD,SAASC,aAAmC;AAC5C,SAAmCC,gBAAgBC,qBAAqB;;;ACJxE,OAAOC,mBAAmB;;;ACD1B,OAAOC,WAAW;AAElB,OAAOC,6BAA6B;AACpC,SAASC,eAAeC,MAAMC,eAAeC,aAAa;AAE1D,SAA+BC,uBAAuB;AACtD,SAASC,UAAU;AAEnB,IAAMC,iBAAiB;AAgBhB,IAAMC,oBAAoB,CAAC,EAChCC,YACAC,UACAC,WAAW,QACXC,WAAWL,gBACX,GAAGM,MAAAA,MACoB;AACvB,QAAM,EAAEC,UAAS,IAAKC,gBAAAA;AAEtB,SACE,sBAAA,cAACC,OAAAA;IAAIC,WAAWC,GAAG,oCAAoCT,UAAAA;KACrD,sBAAA,cAACU,yBAAAA;IACCF,WAAU;IACVN,UAAUS,UAAUT,QAAAA,KAAuCA;IAC3DU,OAAOP,cAAc,SAASQ,OAAOC;IACrCC,aAAa;MACXC,YAAY;MACZC,QAAQ;MACRC,WAAW;MACXC,SAAS;MACTC,QAAQ;IACV;IACC,GAAGhB;KAGHH,YAAYE,QAAAA,CAAAA;AAIrB;AAEA,IAAMQ,YAAY;EAChBU,IAAI;EACJC,IAAI;AACN;;;AF1CO,IAAMC,OAAOC,2BAAsC,CAACC,OAAOC,iBAAAA;AAChE,MAAID,MAAME,QAAQ;AAChB,WAAO,gBAAAC,OAAA,cAACC,YAAeJ,KAAAA;EACzB;AAEA,QAAM,EAAEK,YAAYC,MAAMC,UAAUC,OAAM,IAAKR;AAC/C,SACE,gBAAAG,OAAA,cAACM,mBAAAA;IACCC,UAAS;IACTL,YAAY;MAAC;MAAmCA;;IAChDM,eAAaH;IACbI,KAAKX;KAEJY,cAAcP,MAAMC,YAAYO,eAAeP,QAAAA,GAAW,CAAA,CAAA;AAGjE,CAAA;AAEO,IAAMH,aAAaL,2BACxB,CAAC,EAAEM,YAAYC,MAAMS,aAAaR,UAAUC,OAAM,GAAIP,iBAAAA;AACpD,QAAM,CAACK,MAAMU,OAAAA,IAAWC,SAASF,WAAAA;AACjC,QAAM,CAACG,MAAMC,OAAAA,IAAWF,SAAS,EAAA;AACjC,QAAM,CAACG,OAAOC,QAAAA,IAAYJ,SAAuB,IAAA;AAEjDK,YAAU,MAAA;AACR,QAAI,CAACP,eAAe,CAACG,KAAKK,KAAI,EAAGC,QAAQ;AACvCR,cAAQD,WAAAA;IACV,OAAO;AACL,UAAI;AACFC,gBAAQS,GAAGC,MAAMX,aAAaG,IAAAA,CAAAA;AAC9BG,iBAAS,IAAA;MACX,SAASM,KAAK;AACZX,gBAAQD,WAAAA;AACRM,iBAASM,GAAAA;MACX;IACF;EACF,GAAG;IAACZ;IAAaG;GAAK;AAEtB,SACE,gBAAAf,OAAA,cAACyB,OAAAA;IAAIC,WAAU;IAAwCjB,KAAKX;KAC1D,gBAAAE,OAAA,cAAC2B,MAAMC,MAAI;IAACC,mBAAmBZ,QAAQ,UAAU;KAC/C,gBAAAjB,OAAA,cAAC2B,MAAMG,WAAS;IACd5B,YAAY;MAAC;MAAuBe,SAAS;;IAC7Cc,SAAQ;IACRC,OAAOjB;IACPkB,aAAY;IACZC,UAAU,CAACC,UAAUnB,QAAQmB,MAAMC,OAAOJ,KAAK;OAGnD,gBAAAhC,OAAA,cAACM,mBAAAA;IACCC,UAAS;IACTL,YAAY;MAAC;MAAmCA;;IAChDM,eAAaH;KAEZK,cAAcP,MAAMC,YAAYO,eAAeP,QAAAA,GAAW,CAAA,CAAA,CAAA;AAInE,CAAA;",
|
|
6
|
+
"names": ["jp", "React", "forwardRef", "useEffect", "useState", "Input", "createReplacer", "safeStringify", "createElement", "React", "NativeSyntaxHighlighter", "coldarkDark", "dark", "coldarkCold", "light", "useThemeContext", "mx", "zeroWidthSpace", "SyntaxHighlighter", "classNames", "children", "language", "fallback", "props", "themeMode", "useThemeContext", "div", "className", "mx", "NativeSyntaxHighlighter", "languages", "style", "dark", "light", "customStyle", "background", "border", "boxShadow", "padding", "margin", "js", "ts", "Json", "forwardRef", "props", "forwardedRef", "filter", "React", "JsonFilter", "classNames", "data", "replacer", "testId", "SyntaxHighlighter", "language", "data-testid", "ref", "safeStringify", "createReplacer", "initialData", "setData", "useState", "text", "setText", "error", "setError", "useEffect", "trim", "length", "jp", "query", "err", "div", "className", "Input", "Root", "validationValence", "TextInput", "variant", "value", "placeholder", "onChange", "event", "target"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/SyntaxHighlighter/SyntaxHighlighter.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/SyntaxHighlighter/SyntaxHighlighter.tsx":{"bytes":5909,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react-syntax-highlighter/dist/esm/prism-async-light","kind":"import-statement","external":true},{"path":"react-syntax-highlighter/dist/esm/styles/prism","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/SyntaxHighlighter/index.ts":{"bytes":979,"imports":[{"path":"react-syntax-highlighter/dist/esm/create-element","kind":"import-statement","external":true},{"path":"src/SyntaxHighlighter/SyntaxHighlighter.tsx","kind":"import-statement","original":"./SyntaxHighlighter"}],"format":"esm"},"src/Json/Json.tsx":{"bytes":8440,"imports":[{"path":"jsonpath","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/SyntaxHighlighter/index.ts","kind":"import-statement","original":"../SyntaxHighlighter"}],"format":"esm"},"src/Json/index.ts":{"bytes":463,"imports":[{"path":"src/Json/Json.tsx","kind":"import-statement","original":"./Json"}],"format":"esm"},"src/index.ts":{"bytes":571,"imports":[{"path":"src/Json/index.ts","kind":"import-statement","original":"./Json"},{"path":"src/SyntaxHighlighter/index.ts","kind":"import-statement","original":"./SyntaxHighlighter"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7909},"dist/lib/browser/index.mjs":{"imports":[{"path":"jsonpath","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react-syntax-highlighter/dist/esm/create-element","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-syntax-highlighter/dist/esm/prism-async-light","kind":"import-statement","external":true},{"path":"react-syntax-highlighter/dist/esm/styles/prism","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"exports":["Json","JsonFilter","SyntaxHighlighter","createElement"],"entryPoint":"src/index.ts","inputs":{"src/Json/Json.tsx":{"bytesInOutput":2070},"src/SyntaxHighlighter/index.ts":{"bytesInOutput":78},"src/SyntaxHighlighter/SyntaxHighlighter.tsx":{"bytesInOutput":1081},"src/index.ts":{"bytesInOutput":0}},"bytes":3461}}}
|
|
@@ -1,44 +1,38 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
3
|
// src/Json/Json.tsx
|
|
4
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
5
4
|
import jp from "jsonpath";
|
|
6
|
-
import React2, { useEffect, useState } from "react";
|
|
5
|
+
import React2, { forwardRef, useEffect, useState } from "react";
|
|
7
6
|
import { Input } from "@dxos/react-ui";
|
|
7
|
+
import { createReplacer, safeStringify } from "@dxos/util";
|
|
8
8
|
|
|
9
9
|
// src/SyntaxHighlighter/index.ts
|
|
10
10
|
import createElement from "react-syntax-highlighter/dist/esm/create-element";
|
|
11
11
|
|
|
12
12
|
// src/SyntaxHighlighter/SyntaxHighlighter.tsx
|
|
13
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
14
13
|
import React from "react";
|
|
15
14
|
import NativeSyntaxHighlighter from "react-syntax-highlighter/dist/esm/prism-async-light";
|
|
16
15
|
import { coldarkDark as dark, coldarkCold as light } from "react-syntax-highlighter/dist/esm/styles/prism";
|
|
17
16
|
import { useThemeContext } from "@dxos/react-ui";
|
|
18
|
-
import { mx } from "@dxos/
|
|
17
|
+
import { mx } from "@dxos/ui-theme";
|
|
19
18
|
var zeroWidthSpace = "\u200B";
|
|
20
19
|
var SyntaxHighlighter = ({ classNames, children, language = "text", fallback = zeroWidthSpace, ...props }) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
...props
|
|
38
|
-
}, children || fallback));
|
|
39
|
-
} finally {
|
|
40
|
-
_effect.f();
|
|
41
|
-
}
|
|
20
|
+
const { themeMode } = useThemeContext();
|
|
21
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
22
|
+
className: mx("flex is-full p-1 overflow-hidden", classNames)
|
|
23
|
+
}, /* @__PURE__ */ React.createElement(NativeSyntaxHighlighter, {
|
|
24
|
+
className: "!m-0 is-full overflow-auto scrollbar-thin",
|
|
25
|
+
language: languages[language] || language,
|
|
26
|
+
style: themeMode === "dark" ? dark : light,
|
|
27
|
+
customStyle: {
|
|
28
|
+
background: "unset",
|
|
29
|
+
border: "none",
|
|
30
|
+
boxShadow: "none",
|
|
31
|
+
padding: 0,
|
|
32
|
+
margin: 0
|
|
33
|
+
},
|
|
34
|
+
...props
|
|
35
|
+
}, children || fallback));
|
|
42
36
|
};
|
|
43
37
|
var languages = {
|
|
44
38
|
js: "javascript",
|
|
@@ -46,113 +40,68 @@ var languages = {
|
|
|
46
40
|
};
|
|
47
41
|
|
|
48
42
|
// src/Json/Json.tsx
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
try {
|
|
53
|
-
if (filter) {
|
|
54
|
-
return /* @__PURE__ */ React2.createElement(JsonFilter, params);
|
|
55
|
-
}
|
|
56
|
-
const { classNames, data, replacer, testId } = params;
|
|
57
|
-
return /* @__PURE__ */ React2.createElement(SyntaxHighlighter, {
|
|
58
|
-
language: "json",
|
|
59
|
-
classNames: [
|
|
60
|
-
defaultClassNames,
|
|
61
|
-
classNames
|
|
62
|
-
],
|
|
63
|
-
"data-testid": testId
|
|
64
|
-
}, JSON.stringify(data, replacer && createReplacer(replacer), 2));
|
|
65
|
-
} finally {
|
|
66
|
-
_effect.f();
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
var JsonFilter = ({ classNames, data: initialData, replacer, testId }) => {
|
|
70
|
-
var _effect = _useSignals2();
|
|
71
|
-
try {
|
|
72
|
-
const [data, setData] = useState(initialData);
|
|
73
|
-
const [text, setText] = useState("");
|
|
74
|
-
const [error, setError] = useState(null);
|
|
75
|
-
useEffect(() => {
|
|
76
|
-
if (!initialData || !text.trim().length) {
|
|
77
|
-
setData(initialData);
|
|
78
|
-
} else {
|
|
79
|
-
try {
|
|
80
|
-
setData(jp.query(initialData, text));
|
|
81
|
-
setError(null);
|
|
82
|
-
} catch (err) {
|
|
83
|
-
setData(initialData);
|
|
84
|
-
setError(err);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}, [
|
|
88
|
-
initialData,
|
|
89
|
-
text
|
|
90
|
-
]);
|
|
91
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
92
|
-
className: "flex flex-col grow overflow-hidden"
|
|
93
|
-
}, /* @__PURE__ */ React2.createElement(Input.Root, {
|
|
94
|
-
validationValence: error ? "error" : "success"
|
|
95
|
-
}, /* @__PURE__ */ React2.createElement(Input.TextInput, {
|
|
96
|
-
classNames: [
|
|
97
|
-
"p-1 px-2 font-mono",
|
|
98
|
-
error && "border-red-500"
|
|
99
|
-
],
|
|
100
|
-
variant: "subdued",
|
|
101
|
-
value: text,
|
|
102
|
-
onChange: (event) => setText(event.target.value),
|
|
103
|
-
placeholder: "JSONPath (e.g., $.graph.nodes)"
|
|
104
|
-
})), /* @__PURE__ */ React2.createElement(SyntaxHighlighter, {
|
|
105
|
-
language: "json",
|
|
106
|
-
classNames: [
|
|
107
|
-
defaultClassNames,
|
|
108
|
-
classNames
|
|
109
|
-
],
|
|
110
|
-
"data-testid": testId
|
|
111
|
-
}, JSON.stringify(data, replacer && createReplacer(replacer), 2)));
|
|
112
|
-
} finally {
|
|
113
|
-
_effect.f();
|
|
43
|
+
var Json = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
44
|
+
if (props.filter) {
|
|
45
|
+
return /* @__PURE__ */ React2.createElement(JsonFilter, props);
|
|
114
46
|
}
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
if (parse?.includes(key) && typeof value === "string") {
|
|
47
|
+
const { classNames, data, replacer, testId } = props;
|
|
48
|
+
return /* @__PURE__ */ React2.createElement(SyntaxHighlighter, {
|
|
49
|
+
language: "json",
|
|
50
|
+
classNames: [
|
|
51
|
+
"is-full overflow-y-auto text-sm",
|
|
52
|
+
classNames
|
|
53
|
+
],
|
|
54
|
+
"data-testid": testId,
|
|
55
|
+
ref: forwardedRef
|
|
56
|
+
}, safeStringify(data, replacer && createReplacer(replacer), 2));
|
|
57
|
+
});
|
|
58
|
+
var JsonFilter = /* @__PURE__ */ forwardRef(({ classNames, data: initialData, replacer, testId }, forwardedRef) => {
|
|
59
|
+
const [data, setData] = useState(initialData);
|
|
60
|
+
const [text, setText] = useState("");
|
|
61
|
+
const [error, setError] = useState(null);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (!initialData || !text.trim().length) {
|
|
64
|
+
setData(initialData);
|
|
65
|
+
} else {
|
|
136
66
|
try {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
67
|
+
setData(jp.query(initialData, text));
|
|
68
|
+
setError(null);
|
|
69
|
+
} catch (err) {
|
|
70
|
+
setData(initialData);
|
|
71
|
+
setError(err);
|
|
140
72
|
}
|
|
141
73
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
|
|
74
|
+
}, [
|
|
75
|
+
initialData,
|
|
76
|
+
text
|
|
77
|
+
]);
|
|
78
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
79
|
+
className: "flex flex-col bs-full overflow-hidden",
|
|
80
|
+
ref: forwardedRef
|
|
81
|
+
}, /* @__PURE__ */ React2.createElement(Input.Root, {
|
|
82
|
+
validationValence: error ? "error" : "success"
|
|
83
|
+
}, /* @__PURE__ */ React2.createElement(Input.TextInput, {
|
|
84
|
+
classNames: [
|
|
85
|
+
"p-1 pli-2 font-mono",
|
|
86
|
+
error && "border-rose-500"
|
|
87
|
+
],
|
|
88
|
+
variant: "subdued",
|
|
89
|
+
value: text,
|
|
90
|
+
placeholder: "JSONPath (e.g., $.graph.nodes)",
|
|
91
|
+
onChange: (event) => setText(event.target.value)
|
|
92
|
+
})), /* @__PURE__ */ React2.createElement(SyntaxHighlighter, {
|
|
93
|
+
language: "json",
|
|
94
|
+
classNames: [
|
|
95
|
+
"is-full overflow-y-auto text-sm",
|
|
96
|
+
classNames
|
|
97
|
+
],
|
|
98
|
+
"data-testid": testId
|
|
99
|
+
}, safeStringify(data, replacer && createReplacer(replacer), 2)));
|
|
100
|
+
});
|
|
151
101
|
export {
|
|
152
102
|
Json,
|
|
153
103
|
JsonFilter,
|
|
154
104
|
SyntaxHighlighter,
|
|
155
|
-
createElement
|
|
156
|
-
createReplacer
|
|
105
|
+
createElement
|
|
157
106
|
};
|
|
158
107
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/Json/Json.tsx", "../../../src/SyntaxHighlighter/index.ts", "../../../src/SyntaxHighlighter/SyntaxHighlighter.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\n// TODO(burdon): Use to jsonpath-plus.\nimport jp from 'jsonpath';\nimport React, { useEffect, useState } from 'react';\n\nimport { Input, type ThemedClassName } from '@dxos/react-ui';\
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jp", "React", "useEffect", "useState", "Input", "createElement", "React", "NativeSyntaxHighlighter", "coldarkDark", "dark", "coldarkCold", "light", "useThemeContext", "mx", "zeroWidthSpace", "SyntaxHighlighter", "classNames", "children", "language", "fallback", "props", "themeMode", "useThemeContext", "div", "className", "mx", "NativeSyntaxHighlighter", "languages", "style", "dark", "light", "customStyle", "background", "border", "boxShadow", "padding", "margin", "js", "ts", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\n// TODO(burdon): Use to jsonpath-plus.\nimport jp from 'jsonpath';\nimport React, { forwardRef, useEffect, useState } from 'react';\n\nimport { Input, type ThemedClassName } from '@dxos/react-ui';\nimport { type CreateReplacerProps, createReplacer, safeStringify } from '@dxos/util';\n\nimport { SyntaxHighlighter } from '../SyntaxHighlighter';\n\nexport type JsonProps = ThemedClassName<{\n data?: any;\n filter?: boolean;\n replacer?: CreateReplacerProps;\n testId?: string;\n}>;\n\nexport const Json = forwardRef<HTMLDivElement, JsonProps>((props, forwardedRef) => {\n if (props.filter) {\n return <JsonFilter {...props} />;\n }\n\n const { classNames, data, replacer, testId } = props;\n return (\n <SyntaxHighlighter\n language='json'\n classNames={['is-full overflow-y-auto text-sm', classNames]}\n data-testid={testId}\n ref={forwardedRef}\n >\n {safeStringify(data, replacer && createReplacer(replacer), 2)}\n </SyntaxHighlighter>\n );\n});\n\nexport const JsonFilter = forwardRef<HTMLDivElement, JsonProps>(\n ({ classNames, data: initialData, replacer, testId }, forwardedRef) => {\n const [data, setData] = useState(initialData);\n const [text, setText] = useState('');\n const [error, setError] = useState<Error | null>(null);\n\n useEffect(() => {\n if (!initialData || !text.trim().length) {\n setData(initialData);\n } else {\n try {\n setData(jp.query(initialData, text));\n setError(null);\n } catch (err) {\n setData(initialData);\n setError(err as Error);\n }\n }\n }, [initialData, text]); // TODO(burdon): Need structural diff.\n\n return (\n <div className='flex flex-col bs-full overflow-hidden' ref={forwardedRef}>\n <Input.Root validationValence={error ? 'error' : 'success'}>\n <Input.TextInput\n classNames={['p-1 pli-2 font-mono', error && 'border-rose-500']}\n variant='subdued'\n value={text}\n placeholder='JSONPath (e.g., $.graph.nodes)'\n onChange={(event) => setText(event.target.value)}\n />\n </Input.Root>\n <SyntaxHighlighter\n language='json'\n classNames={['is-full overflow-y-auto text-sm', classNames]}\n data-testid={testId}\n >\n {safeStringify(data, replacer && createReplacer(replacer), 2)}\n </SyntaxHighlighter>\n </div>\n );\n },\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\n// eslint-disable-next-line no-restricted-imports\nimport createElement from 'react-syntax-highlighter/dist/esm/create-element';\n\nexport { createElement };\n\nexport * from './SyntaxHighlighter';\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\nimport { type SyntaxHighlighterProps as NaturalSyntaxHighlighterProps } from 'react-syntax-highlighter';\nimport NativeSyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-async-light';\nimport { coldarkDark as dark, coldarkCold as light } from 'react-syntax-highlighter/dist/esm/styles/prism';\n\nimport { type ThemedClassName, useThemeContext } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nconst zeroWidthSpace = '\\u200b';\n\nexport type SyntaxHighlighterProps = ThemedClassName<\n NaturalSyntaxHighlighterProps & {\n fallback?: string;\n }\n>;\n\n/**\n * NOTE: Using `light-async` version directly from dist to avoid any chance of the heavy one being loaded.\n * The lightweight version will load specific language parsers asynchronously.\n *\n * https://github.com/react-syntax-highlighter/react-syntax-highlighter\n * https://react-syntax-highlighter.github.io/react-syntax-highlighter/demo/prism.html\n */\n// TODO(burdon): Replace with react-ui-editor (and reuse styles).\nexport const SyntaxHighlighter = ({\n classNames,\n children,\n language = 'text',\n fallback = zeroWidthSpace,\n ...props\n}: SyntaxHighlighterProps) => {\n const { themeMode } = useThemeContext();\n\n return (\n <div className={mx('flex is-full p-1 overflow-hidden', classNames)}>\n <NativeSyntaxHighlighter\n className='!m-0 is-full overflow-auto scrollbar-thin'\n language={languages[language as keyof typeof languages] || language}\n style={themeMode === 'dark' ? dark : light}\n customStyle={{\n background: 'unset',\n border: 'none',\n boxShadow: 'none',\n padding: 0,\n margin: 0,\n }}\n {...props}\n >\n {/* Non-empty fallback prevents collapse. */}\n {children || fallback}\n </NativeSyntaxHighlighter>\n </div>\n );\n};\n\nconst languages = {\n js: 'javascript',\n ts: 'typescript',\n};\n"],
|
|
5
|
+
"mappings": ";;;AAKA,OAAOA,QAAQ;AACf,OAAOC,UAASC,YAAYC,WAAWC,gBAAgB;AAEvD,SAASC,aAAmC;AAC5C,SAAmCC,gBAAgBC,qBAAqB;;;ACJxE,OAAOC,mBAAmB;;;ACD1B,OAAOC,WAAW;AAElB,OAAOC,6BAA6B;AACpC,SAASC,eAAeC,MAAMC,eAAeC,aAAa;AAE1D,SAA+BC,uBAAuB;AACtD,SAASC,UAAU;AAEnB,IAAMC,iBAAiB;AAgBhB,IAAMC,oBAAoB,CAAC,EAChCC,YACAC,UACAC,WAAW,QACXC,WAAWL,gBACX,GAAGM,MAAAA,MACoB;AACvB,QAAM,EAAEC,UAAS,IAAKC,gBAAAA;AAEtB,SACE,sBAAA,cAACC,OAAAA;IAAIC,WAAWC,GAAG,oCAAoCT,UAAAA;KACrD,sBAAA,cAACU,yBAAAA;IACCF,WAAU;IACVN,UAAUS,UAAUT,QAAAA,KAAuCA;IAC3DU,OAAOP,cAAc,SAASQ,OAAOC;IACrCC,aAAa;MACXC,YAAY;MACZC,QAAQ;MACRC,WAAW;MACXC,SAAS;MACTC,QAAQ;IACV;IACC,GAAGhB;KAGHH,YAAYE,QAAAA,CAAAA;AAIrB;AAEA,IAAMQ,YAAY;EAChBU,IAAI;EACJC,IAAI;AACN;;;AF1CO,IAAMC,OAAOC,2BAAsC,CAACC,OAAOC,iBAAAA;AAChE,MAAID,MAAME,QAAQ;AAChB,WAAO,gBAAAC,OAAA,cAACC,YAAeJ,KAAAA;EACzB;AAEA,QAAM,EAAEK,YAAYC,MAAMC,UAAUC,OAAM,IAAKR;AAC/C,SACE,gBAAAG,OAAA,cAACM,mBAAAA;IACCC,UAAS;IACTL,YAAY;MAAC;MAAmCA;;IAChDM,eAAaH;IACbI,KAAKX;KAEJY,cAAcP,MAAMC,YAAYO,eAAeP,QAAAA,GAAW,CAAA,CAAA;AAGjE,CAAA;AAEO,IAAMH,aAAaL,2BACxB,CAAC,EAAEM,YAAYC,MAAMS,aAAaR,UAAUC,OAAM,GAAIP,iBAAAA;AACpD,QAAM,CAACK,MAAMU,OAAAA,IAAWC,SAASF,WAAAA;AACjC,QAAM,CAACG,MAAMC,OAAAA,IAAWF,SAAS,EAAA;AACjC,QAAM,CAACG,OAAOC,QAAAA,IAAYJ,SAAuB,IAAA;AAEjDK,YAAU,MAAA;AACR,QAAI,CAACP,eAAe,CAACG,KAAKK,KAAI,EAAGC,QAAQ;AACvCR,cAAQD,WAAAA;IACV,OAAO;AACL,UAAI;AACFC,gBAAQS,GAAGC,MAAMX,aAAaG,IAAAA,CAAAA;AAC9BG,iBAAS,IAAA;MACX,SAASM,KAAK;AACZX,gBAAQD,WAAAA;AACRM,iBAASM,GAAAA;MACX;IACF;EACF,GAAG;IAACZ;IAAaG;GAAK;AAEtB,SACE,gBAAAf,OAAA,cAACyB,OAAAA;IAAIC,WAAU;IAAwCjB,KAAKX;KAC1D,gBAAAE,OAAA,cAAC2B,MAAMC,MAAI;IAACC,mBAAmBZ,QAAQ,UAAU;KAC/C,gBAAAjB,OAAA,cAAC2B,MAAMG,WAAS;IACd5B,YAAY;MAAC;MAAuBe,SAAS;;IAC7Cc,SAAQ;IACRC,OAAOjB;IACPkB,aAAY;IACZC,UAAU,CAACC,UAAUnB,QAAQmB,MAAMC,OAAOJ,KAAK;OAGnD,gBAAAhC,OAAA,cAACM,mBAAAA;IACCC,UAAS;IACTL,YAAY;MAAC;MAAmCA;;IAChDM,eAAaH;KAEZK,cAAcP,MAAMC,YAAYO,eAAeP,QAAAA,GAAW,CAAA,CAAA,CAAA;AAInE,CAAA;",
|
|
6
|
+
"names": ["jp", "React", "forwardRef", "useEffect", "useState", "Input", "createReplacer", "safeStringify", "createElement", "React", "NativeSyntaxHighlighter", "coldarkDark", "dark", "coldarkCold", "light", "useThemeContext", "mx", "zeroWidthSpace", "SyntaxHighlighter", "classNames", "children", "language", "fallback", "props", "themeMode", "useThemeContext", "div", "className", "mx", "NativeSyntaxHighlighter", "languages", "style", "dark", "light", "customStyle", "background", "border", "boxShadow", "padding", "margin", "js", "ts", "Json", "forwardRef", "props", "forwardedRef", "filter", "React", "JsonFilter", "classNames", "data", "replacer", "testId", "SyntaxHighlighter", "language", "data-testid", "ref", "safeStringify", "createReplacer", "initialData", "setData", "useState", "text", "setText", "error", "setError", "useEffect", "trim", "length", "jp", "query", "err", "div", "className", "Input", "Root", "validationValence", "TextInput", "variant", "value", "placeholder", "onChange", "event", "target"]
|
|
7
7
|
}
|