@dxos/react-ui-syntax-highlighter 0.8.4-main.9be5663bfe → 0.8.4-main.abd8ff62ef
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 +133 -84
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +133 -84
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/JsonHighlighter/JsonHighlighter.d.ts +23 -0
- package/dist/types/src/JsonHighlighter/JsonHighlighter.d.ts.map +1 -0
- package/dist/types/src/JsonHighlighter/JsonHighlighter.stories.d.ts +14 -0
- package/dist/types/src/JsonHighlighter/JsonHighlighter.stories.d.ts.map +1 -0
- package/dist/types/src/JsonHighlighter/index.d.ts +2 -0
- package/dist/types/src/JsonHighlighter/index.d.ts.map +1 -0
- package/dist/types/src/Syntax/Syntax.d.ts +49 -0
- package/dist/types/src/Syntax/Syntax.d.ts.map +1 -0
- package/dist/types/src/Syntax/Syntax.stories.d.ts +23 -0
- package/dist/types/src/Syntax/Syntax.stories.d.ts.map +1 -0
- package/dist/types/src/Syntax/index.d.ts +2 -0
- package/dist/types/src/Syntax/index.d.ts.map +1 -0
- package/dist/types/src/SyntaxHighlighter/SyntaxHighlighter.d.ts +9 -2
- package/dist/types/src/SyntaxHighlighter/SyntaxHighlighter.d.ts.map +1 -1
- package/dist/types/src/SyntaxHighlighter/SyntaxHighlighter.stories.d.ts +1 -1
- package/dist/types/src/SyntaxHighlighter/SyntaxHighlighter.stories.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -14
- package/src/JsonHighlighter/JsonHighlighter.stories.tsx +65 -0
- package/src/JsonHighlighter/JsonHighlighter.tsx +47 -0
- package/src/JsonHighlighter/index.ts +5 -0
- package/src/{Json/Json.stories.tsx → Syntax/Syntax.stories.tsx} +37 -44
- package/src/Syntax/Syntax.tsx +229 -0
- package/src/Syntax/index.ts +5 -0
- package/src/SyntaxHighlighter/SyntaxHighlighter.stories.tsx +2 -2
- package/src/SyntaxHighlighter/SyntaxHighlighter.tsx +77 -25
- package/src/index.ts +2 -1
- package/dist/types/src/Json/Json.d.ts +0 -37
- package/dist/types/src/Json/Json.d.ts.map +0 -1
- package/dist/types/src/Json/Json.stories.d.ts +0 -21
- package/dist/types/src/Json/Json.stories.d.ts.map +0 -1
- package/dist/types/src/Json/index.d.ts +0 -2
- package/dist/types/src/Json/index.d.ts.map +0 -1
- package/src/Json/Json.tsx +0 -190
- package/src/Json/index.ts +0 -5
|
@@ -1,40 +1,43 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
|
-
// src/
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { Input } from "@dxos/react-ui";
|
|
7
|
-
import { composable as composable2, composableProps as composableProps2 } from "@dxos/ui-theme";
|
|
3
|
+
// src/JsonHighlighter/JsonHighlighter.tsx
|
|
4
|
+
import React2 from "react";
|
|
5
|
+
import { composable as composable2 } from "@dxos/ui-theme";
|
|
8
6
|
import { createReplacer, safeStringify } from "@dxos/util";
|
|
9
7
|
|
|
10
8
|
// src/SyntaxHighlighter/index.ts
|
|
11
9
|
import createElement from "react-syntax-highlighter/dist/esm/create-element";
|
|
12
10
|
|
|
13
11
|
// src/SyntaxHighlighter/SyntaxHighlighter.tsx
|
|
14
|
-
import React from "react";
|
|
12
|
+
import React, { Children } from "react";
|
|
15
13
|
import NativeSyntaxHighlighter from "react-syntax-highlighter/dist/esm/prism-async-light";
|
|
16
14
|
import { coldarkDark as dark, coldarkCold as light } from "react-syntax-highlighter/dist/esm/styles/prism";
|
|
17
|
-
import {
|
|
15
|
+
import { Clipboard, useThemeContext } from "@dxos/react-ui";
|
|
18
16
|
import { composable, composableProps } from "@dxos/ui-theme";
|
|
19
17
|
var zeroWidthSpace = "\u200B";
|
|
20
18
|
var languages = {
|
|
21
19
|
js: "javascript",
|
|
22
20
|
ts: "typescript"
|
|
23
21
|
};
|
|
24
|
-
var SyntaxHighlighter = composable(({ children, language = "text", fallback = zeroWidthSpace,
|
|
22
|
+
var SyntaxHighlighter = composable(({ classNames, className, children, role, style, themeStyle, language = "text", fallback = zeroWidthSpace, copyButton, ...nativeProps }, forwardedRef) => {
|
|
25
23
|
const { themeMode } = useThemeContext();
|
|
26
|
-
|
|
24
|
+
const source = Children.toArray(children).join("") || fallback;
|
|
25
|
+
const hasCustomTheme = themeStyle && typeof themeStyle === "object" && Object.keys(themeStyle).length > 0;
|
|
26
|
+
const prismTheme = hasCustomTheme ? themeStyle : themeMode === "dark" ? dark : light;
|
|
27
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
27
28
|
...composableProps({
|
|
28
29
|
classNames,
|
|
29
|
-
className
|
|
30
|
+
className,
|
|
31
|
+
role,
|
|
32
|
+
style
|
|
33
|
+
}, {
|
|
34
|
+
role: "none",
|
|
35
|
+
classNames: copyButton && "relative group"
|
|
30
36
|
}),
|
|
31
|
-
thin: true,
|
|
32
37
|
ref: forwardedRef
|
|
33
|
-
}, /* @__PURE__ */ React.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React.createElement("div", {
|
|
34
|
-
role: "none"
|
|
35
38
|
}, /* @__PURE__ */ React.createElement(NativeSyntaxHighlighter, {
|
|
36
39
|
language: languages[language] || language,
|
|
37
|
-
style:
|
|
40
|
+
style: prismTheme,
|
|
38
41
|
customStyle: {
|
|
39
42
|
background: "unset",
|
|
40
43
|
border: "none",
|
|
@@ -43,83 +46,109 @@ var SyntaxHighlighter = composable(({ children, language = "text", fallback = ze
|
|
|
43
46
|
margin: 0
|
|
44
47
|
},
|
|
45
48
|
...nativeProps
|
|
46
|
-
},
|
|
49
|
+
}, source), copyButton && /* @__PURE__ */ React.createElement("div", {
|
|
50
|
+
role: "none",
|
|
51
|
+
className: "pointer-events-none absolute top-1 right-1 z-10 opacity-0 group-hover:opacity-100 focus-within:opacity-100"
|
|
52
|
+
}, /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement(Clipboard.IconButton, {
|
|
53
|
+
value: source,
|
|
54
|
+
variant: "ghost",
|
|
55
|
+
size: 4,
|
|
56
|
+
classNames: "pointer-events-auto aspect-square rounded-sm"
|
|
57
|
+
}))));
|
|
47
58
|
});
|
|
48
59
|
SyntaxHighlighter.displayName = "SyntaxHighlighter";
|
|
49
60
|
|
|
50
|
-
// src/
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (!context) {
|
|
55
|
-
throw new Error(`\`${consumerName}\` must be used within \`Json.Root\`.`);
|
|
61
|
+
// src/JsonHighlighter/JsonHighlighter.tsx
|
|
62
|
+
var resolveReplacer = (replacer) => {
|
|
63
|
+
if (!replacer) {
|
|
64
|
+
return void 0;
|
|
56
65
|
}
|
|
57
|
-
return
|
|
66
|
+
return typeof replacer === "function" ? replacer : createReplacer(replacer);
|
|
58
67
|
};
|
|
59
|
-
var
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
68
|
+
var JsonHighlighter = composable2(({ data, replacer, indent = 2, testId, ...props }, forwardedRef) => {
|
|
69
|
+
return /* @__PURE__ */ React2.createElement(SyntaxHighlighter, {
|
|
70
|
+
...props,
|
|
71
|
+
language: "json",
|
|
72
|
+
"data-testid": testId,
|
|
73
|
+
ref: forwardedRef
|
|
74
|
+
}, safeStringify(data, resolveReplacer(replacer), indent));
|
|
75
|
+
});
|
|
76
|
+
JsonHighlighter.displayName = "JsonHighlighter";
|
|
77
|
+
|
|
78
|
+
// src/Syntax/Syntax.tsx
|
|
79
|
+
import { createContextScope } from "@radix-ui/react-context";
|
|
80
|
+
import { JSONPath } from "jsonpath-plus";
|
|
81
|
+
import React3, { forwardRef, useMemo, useState } from "react";
|
|
82
|
+
import { Input, ScrollArea } from "@dxos/react-ui";
|
|
83
|
+
import { composable as composable3, composableProps as composableProps2 } from "@dxos/ui-theme";
|
|
84
|
+
var SYNTAX_NAME = "Syntax";
|
|
85
|
+
var [createSyntaxContext, createSyntaxScope] = createContextScope(SYNTAX_NAME);
|
|
86
|
+
var [SyntaxProvider, useSyntaxContext] = createSyntaxContext(SYNTAX_NAME);
|
|
87
|
+
var SYNTAX_ROOT_NAME = "Syntax.Root";
|
|
88
|
+
var SyntaxRoot = (props) => {
|
|
89
|
+
const { __scopeSyntax, children, language, source, replacer } = props;
|
|
90
|
+
const isJson = "data" in props;
|
|
91
|
+
const data = props.data;
|
|
64
92
|
const [filterText, setFilterText] = useState("");
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
93
|
+
const { filteredData, filterError } = useMemo(() => {
|
|
94
|
+
if (!isJson || !filterText.trim().length) {
|
|
95
|
+
return {
|
|
96
|
+
filteredData: data,
|
|
97
|
+
filterError: null
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
try {
|
|
101
|
+
return {
|
|
102
|
+
filteredData: JSONPath({
|
|
74
103
|
path: filterText,
|
|
75
104
|
json: data
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
105
|
+
}),
|
|
106
|
+
filterError: null
|
|
107
|
+
};
|
|
108
|
+
} catch (err) {
|
|
109
|
+
return {
|
|
110
|
+
filteredData: data,
|
|
111
|
+
filterError: err
|
|
112
|
+
};
|
|
82
113
|
}
|
|
83
114
|
}, [
|
|
115
|
+
isJson,
|
|
84
116
|
data,
|
|
85
117
|
filterText
|
|
86
118
|
]);
|
|
87
|
-
|
|
119
|
+
return /* @__PURE__ */ React3.createElement(SyntaxProvider, {
|
|
120
|
+
scope: __scopeSyntax,
|
|
121
|
+
mode: isJson ? "json" : "text",
|
|
122
|
+
source,
|
|
123
|
+
language,
|
|
88
124
|
data,
|
|
89
125
|
filteredData,
|
|
90
126
|
filterText,
|
|
91
127
|
setFilterText,
|
|
92
128
|
filterError,
|
|
93
129
|
replacer
|
|
94
|
-
}), [
|
|
95
|
-
data,
|
|
96
|
-
filteredData,
|
|
97
|
-
filterText,
|
|
98
|
-
setFilterText,
|
|
99
|
-
filterError,
|
|
100
|
-
replacer
|
|
101
|
-
]);
|
|
102
|
-
return /* @__PURE__ */ React2.createElement(JsonContext.Provider, {
|
|
103
|
-
value: context
|
|
104
130
|
}, children);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
var
|
|
108
|
-
var
|
|
109
|
-
return /* @__PURE__ */
|
|
131
|
+
};
|
|
132
|
+
SyntaxRoot.displayName = SYNTAX_ROOT_NAME;
|
|
133
|
+
var SYNTAX_CONTENT_NAME = "Syntax.Content";
|
|
134
|
+
var SyntaxContent = composable3(({ children, ...props }, forwardedRef) => {
|
|
135
|
+
return /* @__PURE__ */ React3.createElement("div", {
|
|
110
136
|
...composableProps2(props, {
|
|
111
137
|
classNames: "flex flex-col h-full min-h-0 overflow-hidden"
|
|
112
138
|
}),
|
|
113
139
|
ref: forwardedRef
|
|
114
140
|
}, children);
|
|
115
141
|
});
|
|
116
|
-
|
|
117
|
-
var
|
|
118
|
-
var
|
|
119
|
-
const { filterText, setFilterText, filterError } =
|
|
120
|
-
|
|
142
|
+
SyntaxContent.displayName = SYNTAX_CONTENT_NAME;
|
|
143
|
+
var SYNTAX_FILTER_NAME = "Syntax.Filter";
|
|
144
|
+
var SyntaxFilter = /* @__PURE__ */ forwardRef(({ __scopeSyntax, classNames, placeholder = "JSONPath (e.g., $.graph.nodes)" }, forwardedRef) => {
|
|
145
|
+
const { mode, filterText, setFilterText, filterError } = useSyntaxContext(SYNTAX_FILTER_NAME, __scopeSyntax);
|
|
146
|
+
if (mode !== "json") {
|
|
147
|
+
throw new Error(`\`${SYNTAX_FILTER_NAME}\` requires \`Syntax.Root\` to be in JSON mode (pass \`data\`).`);
|
|
148
|
+
}
|
|
149
|
+
return /* @__PURE__ */ React3.createElement(Input.Root, {
|
|
121
150
|
validationValence: filterError ? "error" : "success"
|
|
122
|
-
}, /* @__PURE__ */
|
|
151
|
+
}, /* @__PURE__ */ React3.createElement(Input.TextInput, {
|
|
123
152
|
classNames: [
|
|
124
153
|
"p-1 px-2 font-mono",
|
|
125
154
|
filterError && "border-rose-500",
|
|
@@ -132,31 +161,51 @@ var JsonFilter = /* @__PURE__ */ forwardRef(({ classNames, placeholder = "JSONPa
|
|
|
132
161
|
ref: forwardedRef
|
|
133
162
|
}));
|
|
134
163
|
});
|
|
135
|
-
|
|
136
|
-
var
|
|
137
|
-
var
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
164
|
+
SyntaxFilter.displayName = SYNTAX_FILTER_NAME;
|
|
165
|
+
var SYNTAX_VIEWPORT_NAME = "Syntax.Viewport";
|
|
166
|
+
var SyntaxViewport = composable3(({ children, ...props }, forwardedRef) => {
|
|
167
|
+
return /* @__PURE__ */ React3.createElement(ScrollArea.Root, {
|
|
168
|
+
...composableProps2(props),
|
|
169
|
+
thin: true,
|
|
170
|
+
ref: forwardedRef
|
|
171
|
+
}, /* @__PURE__ */ React3.createElement(ScrollArea.Viewport, null, children));
|
|
172
|
+
});
|
|
173
|
+
SyntaxViewport.displayName = SYNTAX_VIEWPORT_NAME;
|
|
174
|
+
var SYNTAX_CODE_NAME = "Syntax.Code";
|
|
175
|
+
var SyntaxCode = composable3(({ __scopeSyntax, testId, ...props }, forwardedRef) => {
|
|
176
|
+
const context = useSyntaxContext(SYNTAX_CODE_NAME, __scopeSyntax);
|
|
177
|
+
const merged = composableProps2(props, {
|
|
178
|
+
classNames: "py-1 px-2 text-sm"
|
|
179
|
+
});
|
|
180
|
+
if (context.mode === "json") {
|
|
181
|
+
return /* @__PURE__ */ React3.createElement(JsonHighlighter, {
|
|
182
|
+
...merged,
|
|
183
|
+
data: context.filteredData,
|
|
184
|
+
replacer: context.replacer,
|
|
185
|
+
testId,
|
|
186
|
+
ref: forwardedRef
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
return /* @__PURE__ */ React3.createElement(SyntaxHighlighter, {
|
|
190
|
+
...merged,
|
|
191
|
+
language: context.language,
|
|
146
192
|
"data-testid": testId,
|
|
147
193
|
ref: forwardedRef
|
|
148
|
-
},
|
|
194
|
+
}, context.source ?? "");
|
|
149
195
|
});
|
|
150
|
-
|
|
151
|
-
var
|
|
152
|
-
Root:
|
|
153
|
-
Content:
|
|
154
|
-
Filter:
|
|
155
|
-
|
|
196
|
+
SyntaxCode.displayName = SYNTAX_CODE_NAME;
|
|
197
|
+
var Syntax = {
|
|
198
|
+
Root: SyntaxRoot,
|
|
199
|
+
Content: SyntaxContent,
|
|
200
|
+
Filter: SyntaxFilter,
|
|
201
|
+
Viewport: SyntaxViewport,
|
|
202
|
+
Code: SyntaxCode
|
|
156
203
|
};
|
|
157
204
|
export {
|
|
158
|
-
|
|
205
|
+
JsonHighlighter,
|
|
206
|
+
Syntax,
|
|
159
207
|
SyntaxHighlighter,
|
|
160
|
-
createElement
|
|
208
|
+
createElement,
|
|
209
|
+
createSyntaxScope
|
|
161
210
|
};
|
|
162
211
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { JSONPath } from 'jsonpath-plus';\nimport React, {\n createContext,\n type PropsWithChildren,\n forwardRef,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { Input } from '@dxos/react-ui';\nimport { composable, composableProps } from '@dxos/ui-theme';\nimport { type ComposableProps } from '@dxos/ui-types';\nimport { type CreateReplacerProps, createReplacer, safeStringify } from '@dxos/util';\n\nimport { SyntaxHighlighter } from '../SyntaxHighlighter';\n\n//\n// Context\n//\n\ntype JsonContextType = {\n data: any;\n filteredData: any;\n filterText: string;\n setFilterText: (text: string) => void;\n filterError: Error | null;\n replacer?: CreateReplacerProps;\n};\n\nconst JsonContext = createContext<JsonContextType | null>(null);\n\n/** Require Json context (throws if used outside Json.Root). */\nconst useJsonContext = (consumerName: string): JsonContextType => {\n const context = useContext(JsonContext);\n if (!context) {\n throw new Error(`\\`${consumerName}\\` must be used within \\`Json.Root\\`.`);\n }\n return context;\n};\n\n/** Optional Json context (returns null outside Json.Root). */\nconst useOptionalJsonContext = (): JsonContextType | null => {\n return useContext(JsonContext);\n};\n\n//\n// Root\n//\n\nconst JSON_ROOT_NAME = 'Json.Root';\n\ntype JsonRootProps = PropsWithChildren<{\n data?: any;\n replacer?: CreateReplacerProps;\n}>;\n\n/** Headless context provider for Json composite. */\nconst JsonRoot = forwardRef<HTMLDivElement, JsonRootProps>(({ children, data, replacer }, _forwardedRef) => {\n const [filterText, setFilterText] = useState('');\n const [filteredData, setFilteredData] = useState(data);\n const [filterError, setFilterError] = useState<Error | null>(null);\n\n useEffect(() => {\n if (!filterText.trim().length) {\n setFilteredData(data);\n setFilterError(null);\n } else {\n try {\n setFilteredData(JSONPath({ path: filterText, json: data }));\n setFilterError(null);\n } catch (err) {\n setFilteredData(data);\n setFilterError(err as Error);\n }\n }\n }, [data, filterText]);\n\n const context = useMemo(\n () => ({ data, filteredData, filterText, setFilterText, filterError, replacer }),\n [data, filteredData, filterText, setFilterText, filterError, replacer],\n );\n\n return <JsonContext.Provider value={context}>{children}</JsonContext.Provider>;\n});\n\nJsonRoot.displayName = JSON_ROOT_NAME;\n\n//\n// Content\n//\n\nconst JSON_CONTENT_NAME = 'Json.Content';\n\ntype JsonContentProps = ComposableProps;\n\n/** Layout container for Json composite parts. */\nconst JsonContent = composable<HTMLDivElement, JsonContentProps>(({ children, ...props }, forwardedRef) => {\n return (\n <div {...composableProps(props, { classNames: 'flex flex-col h-full min-h-0 overflow-hidden' })} ref={forwardedRef}>\n {children}\n </div>\n );\n});\n\nJsonContent.displayName = JSON_CONTENT_NAME;\n\n//\n// Filter\n//\n\nconst JSON_FILTER_NAME = 'Json.Filter';\n\ntype JsonFilterProps = ComposableProps<{\n placeholder?: string;\n}>;\n\n/** JSONPath filter input. Must be used within Json.Root. */\nconst JsonFilter = forwardRef<HTMLInputElement, JsonFilterProps>(\n ({ classNames, placeholder = 'JSONPath (e.g., $.graph.nodes)' }, forwardedRef) => {\n const { filterText, setFilterText, filterError } = useJsonContext(JSON_FILTER_NAME);\n\n return (\n <Input.Root validationValence={filterError ? 'error' : 'success'}>\n <Input.TextInput\n classNames={['p-1 px-2 font-mono', filterError && 'border-rose-500', classNames]}\n variant='subdued'\n value={filterText}\n placeholder={placeholder}\n onChange={(event) => setFilterText(event.target.value)}\n ref={forwardedRef}\n />\n </Input.Root>\n );\n },\n);\n\nJsonFilter.displayName = JSON_FILTER_NAME;\n\n//\n// Data\n//\n\nconst JSON_DATA_NAME = 'Json.Data';\n\ntype JsonDataProps = ComposableProps<{\n data?: any;\n replacer?: CreateReplacerProps;\n testId?: string;\n}>;\n\n/** Syntax-highlighted JSON display. Works standalone or within Json.Root. */\nconst JsonData = composable<HTMLDivElement, JsonDataProps>(\n ({ data: dataProp, replacer: replacerProp, testId, ...props }, forwardedRef) => {\n const context = useOptionalJsonContext();\n const data = dataProp ?? context?.filteredData;\n const replacer = replacerProp ?? context?.replacer;\n\n return (\n <SyntaxHighlighter\n {...composableProps(props, { classNames: 'flex-1 min-h-0 w-full py-1 px-2 overflow-y-auto text-sm' })}\n language='json'\n data-testid={testId}\n ref={forwardedRef}\n >\n {safeStringify(data, replacer && createReplacer(replacer), 2)}\n </SyntaxHighlighter>\n );\n },\n);\n\nJsonData.displayName = JSON_DATA_NAME;\n\n//\n// Json\n//\n\nexport const Json = {\n Root: JsonRoot,\n Content: JsonContent,\n Filter: JsonFilter,\n Data: JsonData,\n};\n\nexport type { JsonRootProps, JsonContentProps, JsonFilterProps, JsonDataProps };\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, { CSSProperties } 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 { ScrollArea, useThemeContext } from '@dxos/react-ui';\nimport { composable, composableProps } from '@dxos/ui-theme';\n\nconst zeroWidthSpace = '\\u200b';\n\nconst languages = {\n js: 'javascript',\n ts: 'typescript',\n};\n\nexport type SyntaxHighlighterProps = NaturalSyntaxHighlighterProps & {\n fallback?: string;\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 */\nexport const SyntaxHighlighter = composable<HTMLDivElement, SyntaxHighlighterProps>(\n (\n { children, language = 'text', fallback = zeroWidthSpace, classNames, className, style, ...nativeProps },\n forwardedRef,\n ) => {\n const { themeMode } = useThemeContext();\n\n return (\n <ScrollArea.Root {...composableProps({ classNames, className })} thin ref={forwardedRef}>\n <ScrollArea.Viewport>\n {/* NOTE: The div prevents NativeSyntaxHighlighter from managing scrolling. */}\n <div role='none'>\n <NativeSyntaxHighlighter\n language={languages[language as keyof typeof languages] || language}\n style={(style as { [key: string]: CSSProperties }) ?? (themeMode === 'dark' ? dark : light)}\n customStyle={{\n background: 'unset',\n border: 'none',\n boxShadow: 'none',\n padding: 0,\n margin: 0,\n }}\n {...nativeProps}\n >\n {/* Non-empty fallback prevents collapse. */}\n {children || fallback}\n </NativeSyntaxHighlighter>\n </div>\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n );\n },\n);\n\nSyntaxHighlighter.displayName = 'SyntaxHighlighter';\n"],
|
|
5
|
-
"mappings": ";;;AAIA,
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../../src/JsonHighlighter/JsonHighlighter.tsx", "../../../src/SyntaxHighlighter/index.ts", "../../../src/SyntaxHighlighter/SyntaxHighlighter.tsx", "../../../src/Syntax/Syntax.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { composable } from '@dxos/ui-theme';\nimport { type CreateReplacerProps, createReplacer, safeStringify } from '@dxos/util';\n\nimport { SyntaxHighlighter, type SyntaxHighlighterProps } from '../SyntaxHighlighter';\n\nexport type JsonReplacer = CreateReplacerProps | ((key: string, value: any) => any);\n\nexport type JsonHighlighterProps = Omit<SyntaxHighlighterProps, 'children' | 'language'> & {\n data?: any;\n replacer?: JsonReplacer;\n /** Indentation passed to `JSON.stringify`. Default: `2` (pretty-printed). Pass `0` for single-line output. */\n indent?: number;\n testId?: string;\n};\n\nconst resolveReplacer = (replacer?: JsonReplacer) => {\n if (!replacer) {\n return undefined;\n }\n return typeof replacer === 'function' ? replacer : createReplacer(replacer);\n};\n\n/**\n * Inline, non-scrolling JSON renderer.\n *\n * Thin wrapper around `SyntaxHighlighter` that stringifies `data` with an optional replacer.\n * `replacer` accepts either `CreateReplacerProps` (declarative truncation) or a raw\n * `JSON.stringify`-compatible function (for bespoke serialization).\n * For filtering and scroll behaviour, compose with the `Syntax.*` namespace.\n */\nexport const JsonHighlighter = composable<HTMLDivElement, JsonHighlighterProps>(\n ({ data, replacer, indent = 2, testId, ...props }, forwardedRef) => {\n return (\n <SyntaxHighlighter {...props} language='json' data-testid={testId} ref={forwardedRef}>\n {safeStringify(data, resolveReplacer(replacer), indent)}\n </SyntaxHighlighter>\n );\n },\n);\n\nJsonHighlighter.displayName = 'JsonHighlighter';\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, { Children } 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 { Clipboard, useThemeContext } from '@dxos/react-ui';\nimport { composable, composableProps } from '@dxos/ui-theme';\n\nconst zeroWidthSpace = '\\u200b';\n\nconst languages = {\n js: 'javascript',\n ts: 'typescript',\n};\n\nexport type SyntaxHighlighterProps = Pick<\n NaturalSyntaxHighlighterProps,\n | 'language'\n | 'renderer'\n | 'showLineNumbers'\n | 'showInlineLineNumbers'\n | 'startingLineNumber'\n | 'wrapLines'\n | 'wrapLongLines'\n | 'PreTag'\n> & {\n themeStyle?: NaturalSyntaxHighlighterProps['style'];\n fallback?: string;\n copyButton?: boolean;\n};\n\n/**\n * Inline, non-scrolling wrapper around `react-syntax-highlighter`.\n *\n * Use directly for small snippets (e.g. inside markdown code blocks).\n * For scrollable panels, compose with `Syntax.Viewport`.\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 */\nexport const SyntaxHighlighter = composable<HTMLDivElement, SyntaxHighlighterProps>(\n (\n {\n classNames,\n className,\n children,\n role,\n style,\n themeStyle,\n language = 'text',\n fallback = zeroWidthSpace,\n copyButton,\n ...nativeProps\n },\n forwardedRef,\n ) => {\n const { themeMode } = useThemeContext();\n const source = Children.toArray(children).join('') || fallback;\n\n const hasCustomTheme = themeStyle && typeof themeStyle === 'object' && Object.keys(themeStyle).length > 0;\n const prismTheme = hasCustomTheme ? themeStyle : themeMode === 'dark' ? dark : light;\n\n return (\n <div\n {...composableProps(\n { classNames, className, role, style },\n {\n role: 'none',\n classNames: copyButton && 'relative group',\n },\n )}\n ref={forwardedRef}\n >\n <NativeSyntaxHighlighter\n language={languages[language as keyof typeof languages] || language}\n style={prismTheme}\n customStyle={{\n background: 'unset',\n border: 'none',\n boxShadow: 'none',\n padding: 0,\n margin: 0,\n }}\n {...nativeProps}\n >\n {/* Non-empty fallback prevents collapse. */}\n {source}\n </NativeSyntaxHighlighter>\n\n {copyButton && (\n <div\n role='none'\n className='pointer-events-none absolute top-1 right-1 z-10 opacity-0 group-hover:opacity-100 focus-within:opacity-100'\n >\n <Clipboard.Provider>\n <Clipboard.IconButton\n value={source}\n variant='ghost'\n size={4}\n classNames='pointer-events-auto aspect-square rounded-sm'\n />\n </Clipboard.Provider>\n </div>\n )}\n </div>\n );\n },\n);\n\nSyntaxHighlighter.displayName = 'SyntaxHighlighter';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport { JSONPath } from 'jsonpath-plus';\nimport React, { type FC, type PropsWithChildren, forwardRef, useMemo, useState } from 'react';\n\nimport { Input, ScrollArea } from '@dxos/react-ui';\nimport { composable, composableProps } from '@dxos/ui-theme';\nimport { type ComposableProps } from '@dxos/ui-types';\n\nimport { JsonHighlighter, type JsonReplacer } from '../JsonHighlighter';\nimport { SyntaxHighlighter } from '../SyntaxHighlighter';\n\n//\n// Context\n//\n\nconst SYNTAX_NAME = 'Syntax';\n\ntype SyntaxContextValue = {\n mode: 'text' | 'json';\n // Text mode.\n source?: string;\n language?: string;\n // JSON mode.\n data?: any;\n filteredData?: any;\n filterText: string;\n setFilterText: (text: string) => void;\n filterError: Error | null;\n replacer?: JsonReplacer;\n};\n\ntype ScopedProps<P> = P & { __scopeSyntax?: Scope };\n\nconst [createSyntaxContext, createSyntaxScope] = createContextScope(SYNTAX_NAME);\nconst [SyntaxProvider, useSyntaxContext] = createSyntaxContext<SyntaxContextValue>(SYNTAX_NAME);\n\n//\n// Root\n//\n\nconst SYNTAX_ROOT_NAME = 'Syntax.Root';\n\ntype SyntaxRootProps = PropsWithChildren<{\n // Text mode.\n language?: string;\n source?: string;\n // JSON mode (presence of the `data` prop selects JSON mode; `undefined` is still JSON).\n data?: any;\n /**\n * `JSON.stringify` replacer applied to `data`. Use the function form to follow domain\n * references (e.g. ECHO refs) by returning a transformed value at the root call. Keeps\n * this package free of any domain-specific knowledge.\n */\n replacer?: JsonReplacer;\n}>;\n\n/**\n * Headless context provider. Selects JSON mode when the `data` prop is passed at all — even\n * `data={undefined}` — so loading states render an empty JSON view rather than flipping to\n * text mode (which would trip `Syntax.Filter`'s JSON-only guard). Mode is chosen by prop\n * presence, not value.\n */\nconst SyntaxRoot: FC<ScopedProps<SyntaxRootProps>> = (props) => {\n const { __scopeSyntax, children, language, source, replacer } = props;\n const isJson = 'data' in props;\n const data = props.data;\n const [filterText, setFilterText] = useState('');\n\n const { filteredData, filterError } = useMemo<{ filteredData: any; filterError: Error | null }>(() => {\n if (!isJson || !filterText.trim().length) {\n return { filteredData: data, filterError: null };\n }\n try {\n return { filteredData: JSONPath({ path: filterText, json: data }), filterError: null };\n } catch (err) {\n return { filteredData: data, filterError: err as Error };\n }\n }, [isJson, data, filterText]);\n\n return (\n <SyntaxProvider\n scope={__scopeSyntax}\n mode={isJson ? 'json' : 'text'}\n source={source}\n language={language}\n data={data}\n filteredData={filteredData}\n filterText={filterText}\n setFilterText={setFilterText}\n filterError={filterError}\n replacer={replacer}\n >\n {children}\n </SyntaxProvider>\n );\n};\n\nSyntaxRoot.displayName = SYNTAX_ROOT_NAME;\n\n//\n// Content\n//\n\nconst SYNTAX_CONTENT_NAME = 'Syntax.Content';\n\ntype SyntaxContentProps = ComposableProps;\n\n/** Flex-column layout container for composite parts. */\nconst SyntaxContent = composable<HTMLDivElement, SyntaxContentProps>(({ children, ...props }, forwardedRef) => {\n return (\n <div {...composableProps(props, { classNames: 'flex flex-col h-full min-h-0 overflow-hidden' })} ref={forwardedRef}>\n {children}\n </div>\n );\n});\n\nSyntaxContent.displayName = SYNTAX_CONTENT_NAME;\n\n//\n// Filter\n//\n\nconst SYNTAX_FILTER_NAME = 'Syntax.Filter';\n\ntype SyntaxFilterProps = ComposableProps<{\n placeholder?: string;\n}>;\n\n/** JSONPath filter input. Only meaningful when `Syntax.Root` is in JSON mode. */\nconst SyntaxFilter = forwardRef<HTMLInputElement, ScopedProps<SyntaxFilterProps>>(\n ({ __scopeSyntax, classNames, placeholder = 'JSONPath (e.g., $.graph.nodes)' }, forwardedRef) => {\n const { mode, filterText, setFilterText, filterError } = useSyntaxContext(SYNTAX_FILTER_NAME, __scopeSyntax);\n if (mode !== 'json') {\n throw new Error(`\\`${SYNTAX_FILTER_NAME}\\` requires \\`Syntax.Root\\` to be in JSON mode (pass \\`data\\`).`);\n }\n\n return (\n <Input.Root validationValence={filterError ? 'error' : 'success'}>\n <Input.TextInput\n classNames={['p-1 px-2 font-mono', filterError && 'border-rose-500', classNames]}\n variant='subdued'\n value={filterText}\n placeholder={placeholder}\n onChange={(event) => setFilterText(event.target.value)}\n ref={forwardedRef}\n />\n </Input.Root>\n );\n },\n);\n\nSyntaxFilter.displayName = SYNTAX_FILTER_NAME;\n\n//\n// Viewport\n//\n\nconst SYNTAX_VIEWPORT_NAME = 'Syntax.Viewport';\n\ntype SyntaxViewportProps = ComposableProps;\n\n/** Optional scroll wrapper. Compose around `Syntax.Code` to make it scrollable. */\nconst SyntaxViewport = composable<HTMLDivElement, SyntaxViewportProps>(({ children, ...props }, forwardedRef) => {\n return (\n <ScrollArea.Root {...composableProps(props)} thin ref={forwardedRef}>\n <ScrollArea.Viewport>{children}</ScrollArea.Viewport>\n </ScrollArea.Root>\n );\n});\n\nSyntaxViewport.displayName = SYNTAX_VIEWPORT_NAME;\n\n//\n// Code\n//\n\nconst SYNTAX_CODE_NAME = 'Syntax.Code';\n\ntype SyntaxCodeProps = ComposableProps<{\n testId?: string;\n}>;\n\n/** Highlighted code leaf. Reads source/data from `Syntax.Root` context. */\nconst SyntaxCode = composable<HTMLDivElement, ScopedProps<SyntaxCodeProps>>(\n ({ __scopeSyntax, testId, ...props }, forwardedRef) => {\n const context = useSyntaxContext(SYNTAX_CODE_NAME, __scopeSyntax);\n const merged = composableProps(props, { classNames: 'py-1 px-2 text-sm' });\n\n if (context.mode === 'json') {\n return (\n <JsonHighlighter\n {...merged}\n data={context.filteredData}\n replacer={context.replacer}\n testId={testId}\n ref={forwardedRef}\n />\n );\n }\n\n return (\n <SyntaxHighlighter {...merged} language={context.language} data-testid={testId} ref={forwardedRef}>\n {context.source ?? ''}\n </SyntaxHighlighter>\n );\n },\n);\n\nSyntaxCode.displayName = SYNTAX_CODE_NAME;\n\n//\n// Syntax\n//\n\nexport const Syntax = {\n Root: SyntaxRoot,\n Content: SyntaxContent,\n Filter: SyntaxFilter,\n Viewport: SyntaxViewport,\n Code: SyntaxCode,\n};\n\nexport { createSyntaxScope };\n\nexport type { SyntaxRootProps, SyntaxContentProps, SyntaxFilterProps, SyntaxViewportProps, SyntaxCodeProps };\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["React", "composable", "createReplacer", "safeStringify", "createElement", "React", "Children", "NativeSyntaxHighlighter", "coldarkDark", "dark", "coldarkCold", "light", "Clipboard", "useThemeContext", "composable", "composableProps", "zeroWidthSpace", "languages", "js", "ts", "SyntaxHighlighter", "classNames", "className", "children", "role", "style", "themeStyle", "language", "fallback", "copyButton", "nativeProps", "forwardedRef", "themeMode", "source", "toArray", "join", "hasCustomTheme", "Object", "keys", "length", "prismTheme", "div", "ref", "customStyle", "background", "border", "boxShadow", "padding", "margin", "Provider", "IconButton", "value", "variant", "size", "displayName", "resolveReplacer", "replacer", "undefined", "createReplacer", "JsonHighlighter", "composable", "data", "indent", "testId", "props", "forwardedRef", "React", "SyntaxHighlighter", "language", "data-testid", "ref", "safeStringify", "displayName", "createContextScope", "JSONPath", "React", "forwardRef", "useMemo", "useState", "Input", "ScrollArea", "composable", "composableProps", "SYNTAX_NAME", "createSyntaxContext", "createSyntaxScope", "createContextScope", "SyntaxProvider", "useSyntaxContext", "SYNTAX_ROOT_NAME", "SyntaxRoot", "props", "__scopeSyntax", "children", "language", "source", "replacer", "isJson", "data", "filterText", "setFilterText", "useState", "filteredData", "filterError", "useMemo", "trim", "length", "JSONPath", "path", "json", "err", "React", "scope", "mode", "displayName", "SYNTAX_CONTENT_NAME", "SyntaxContent", "composable", "forwardedRef", "div", "composableProps", "classNames", "ref", "SYNTAX_FILTER_NAME", "SyntaxFilter", "forwardRef", "placeholder", "Error", "Input", "Root", "validationValence", "TextInput", "variant", "value", "onChange", "event", "target", "SYNTAX_VIEWPORT_NAME", "SyntaxViewport", "ScrollArea", "thin", "Viewport", "SYNTAX_CODE_NAME", "SyntaxCode", "testId", "context", "merged", "JsonHighlighter", "SyntaxHighlighter", "data-testid", "Syntax", "Content", "Filter", "Code"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/SyntaxHighlighter/SyntaxHighlighter.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/SyntaxHighlighter/SyntaxHighlighter.tsx":{"bytes":10001,"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":871,"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/JsonHighlighter/JsonHighlighter.tsx":{"bytes":4584,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","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/JsonHighlighter/index.ts":{"bytes":395,"imports":[{"path":"src/JsonHighlighter/JsonHighlighter.tsx","kind":"import-statement","original":"./JsonHighlighter"}],"format":"esm"},"src/Syntax/Syntax.tsx":{"bytes":19872,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"jsonpath-plus","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/JsonHighlighter/index.ts","kind":"import-statement","original":"../JsonHighlighter"},{"path":"src/SyntaxHighlighter/index.ts","kind":"import-statement","original":"../SyntaxHighlighter"}],"format":"esm"},"src/Syntax/index.ts":{"bytes":370,"imports":[{"path":"src/Syntax/Syntax.tsx","kind":"import-statement","original":"./Syntax"}],"format":"esm"},"src/index.ts":{"bytes":590,"imports":[{"path":"src/JsonHighlighter/index.ts","kind":"import-statement","original":"./JsonHighlighter"},{"path":"src/Syntax/index.ts","kind":"import-statement","original":"./Syntax"},{"path":"src/SyntaxHighlighter/index.ts","kind":"import-statement","original":"./SyntaxHighlighter"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18616},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","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},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"jsonpath-plus","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"exports":["JsonHighlighter","Syntax","SyntaxHighlighter","createElement","createSyntaxScope"],"entryPoint":"src/index.ts","inputs":{"src/JsonHighlighter/JsonHighlighter.tsx":{"bytesInOutput":681},"src/SyntaxHighlighter/index.ts":{"bytesInOutput":78},"src/SyntaxHighlighter/SyntaxHighlighter.tsx":{"bytesInOutput":2013},"src/index.ts":{"bytesInOutput":0},"src/Syntax/Syntax.tsx":{"bytesInOutput":4138}},"bytes":7333}}}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type CreateReplacerProps } from '@dxos/util';
|
|
3
|
+
import { type SyntaxHighlighterProps } from '../SyntaxHighlighter';
|
|
4
|
+
export type JsonReplacer = CreateReplacerProps | ((key: string, value: any) => any);
|
|
5
|
+
export type JsonHighlighterProps = Omit<SyntaxHighlighterProps, 'children' | 'language'> & {
|
|
6
|
+
data?: any;
|
|
7
|
+
replacer?: JsonReplacer;
|
|
8
|
+
/** Indentation passed to `JSON.stringify`. Default: `2` (pretty-printed). Pass `0` for single-line output. */
|
|
9
|
+
indent?: number;
|
|
10
|
+
testId?: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Inline, non-scrolling JSON renderer.
|
|
14
|
+
*
|
|
15
|
+
* Thin wrapper around `SyntaxHighlighter` that stringifies `data` with an optional replacer.
|
|
16
|
+
* `replacer` accepts either `CreateReplacerProps` (declarative truncation) or a raw
|
|
17
|
+
* `JSON.stringify`-compatible function (for bespoke serialization).
|
|
18
|
+
* For filtering and scroll behaviour, compose with the `Syntax.*` namespace.
|
|
19
|
+
*/
|
|
20
|
+
export declare const JsonHighlighter: React.ForwardRefExoticComponent<Omit<JsonHighlighterProps, "className"> & {
|
|
21
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
22
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
//# sourceMappingURL=JsonHighlighter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JsonHighlighter.d.ts","sourceRoot":"","sources":["../../../../src/JsonHighlighter/JsonHighlighter.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,KAAK,mBAAmB,EAAiC,MAAM,YAAY,CAAC;AAErF,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEtF,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC,CAAC;AAEpF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,sBAAsB,EAAE,UAAU,GAAG,UAAU,CAAC,GAAG;IACzF,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,8GAA8G;IAC9G,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AASF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;;2HAQ3B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { JsonHighlighter } from './JsonHighlighter';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import("react").ForwardRefExoticComponent<Omit<import("./JsonHighlighter").JsonHighlighterProps, "className"> & {
|
|
6
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
7
|
+
} & Pick<import("react").HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
decorators: import("@storybook/react").Decorator[];
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof JsonHighlighter>;
|
|
12
|
+
export declare const Default: Story;
|
|
13
|
+
export declare const Cycle: Story;
|
|
14
|
+
//# sourceMappingURL=JsonHighlighter.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JsonHighlighter.stories.d.ts","sourceRoot":"","sources":["../../../../src/JsonHighlighter/JsonHighlighter.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAKjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAmCpD,QAAA,MAAM,IAAI;;;;;;CAI8B,CAAC;eAE1B,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9C,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAInB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/JsonHighlighter/index.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type Scope } from '@radix-ui/react-context';
|
|
2
|
+
import React, { type FC, type PropsWithChildren } from 'react';
|
|
3
|
+
import { type ComposableProps } from '@dxos/ui-types';
|
|
4
|
+
import { type JsonReplacer } from '../JsonHighlighter';
|
|
5
|
+
type ScopedProps<P> = P & {
|
|
6
|
+
__scopeSyntax?: Scope;
|
|
7
|
+
};
|
|
8
|
+
declare const createSyntaxScope: import("@radix-ui/react-context").CreateScope;
|
|
9
|
+
type SyntaxRootProps = PropsWithChildren<{
|
|
10
|
+
language?: string;
|
|
11
|
+
source?: string;
|
|
12
|
+
data?: any;
|
|
13
|
+
/**
|
|
14
|
+
* `JSON.stringify` replacer applied to `data`. Use the function form to follow domain
|
|
15
|
+
* references (e.g. ECHO refs) by returning a transformed value at the root call. Keeps
|
|
16
|
+
* this package free of any domain-specific knowledge.
|
|
17
|
+
*/
|
|
18
|
+
replacer?: JsonReplacer;
|
|
19
|
+
}>;
|
|
20
|
+
type SyntaxContentProps = ComposableProps;
|
|
21
|
+
type SyntaxFilterProps = ComposableProps<{
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
}>;
|
|
24
|
+
type SyntaxViewportProps = ComposableProps;
|
|
25
|
+
type SyntaxCodeProps = ComposableProps<{
|
|
26
|
+
testId?: string;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const Syntax: {
|
|
29
|
+
Root: FC<ScopedProps<SyntaxRootProps>>;
|
|
30
|
+
Content: React.ForwardRefExoticComponent<Omit<SyntaxContentProps, "className"> & {
|
|
31
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
32
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
Filter: React.ForwardRefExoticComponent<Omit<{
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
}, "className"> & {
|
|
36
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
37
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & {
|
|
38
|
+
__scopeSyntax?: Scope;
|
|
39
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
40
|
+
Viewport: React.ForwardRefExoticComponent<Omit<SyntaxViewportProps, "className"> & {
|
|
41
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
42
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
|
|
43
|
+
Code: React.ForwardRefExoticComponent<Omit<ScopedProps<SyntaxCodeProps>, "className"> & {
|
|
44
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
45
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
|
|
46
|
+
};
|
|
47
|
+
export { createSyntaxScope };
|
|
48
|
+
export type { SyntaxRootProps, SyntaxContentProps, SyntaxFilterProps, SyntaxViewportProps, SyntaxCodeProps };
|
|
49
|
+
//# sourceMappingURL=Syntax.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Syntax.d.ts","sourceRoot":"","sources":["../../../../src/Syntax/Syntax.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAsB,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEzE,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAiC,MAAM,OAAO,CAAC;AAI9F,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAuBxE,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,aAAa,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAEpD,QAAA,MAA4B,iBAAiB,+CAAmC,CAAC;AASjF,KAAK,eAAe,GAAG,iBAAiB,CAAC;IAEvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX;;;;OAIG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB,CAAC,CAAC;AAmDH,KAAK,kBAAkB,GAAG,eAAe,CAAC;AAmB1C,KAAK,iBAAiB,GAAG,eAAe,CAAC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC,CAAC;AAiCH,KAAK,mBAAmB,GAAG,eAAe,CAAC;AAmB3C,KAAK,eAAe,GAAG,eAAe,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAkCH,eAAO,MAAM,MAAM;IACjB,IAAI;IACJ,OAAO;;;IACP,MAAM;sBA5FQ,MAAM;;;;wBA9FsB,KAAK;;IA2L/C,QAAQ;;;IACR,IAAI;;;CACL,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: React.FC<{
|
|
6
|
+
language?: string;
|
|
7
|
+
source?: string;
|
|
8
|
+
data?: any;
|
|
9
|
+
replacer?: import("..").JsonReplacer;
|
|
10
|
+
} & {
|
|
11
|
+
children?: React.ReactNode | undefined;
|
|
12
|
+
} & {
|
|
13
|
+
__scopeSyntax?: import("@radix-ui/react-context").Scope;
|
|
14
|
+
}>;
|
|
15
|
+
decorators: import("@storybook/react").Decorator[];
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
/** JSON composite with filter and scrolling viewport. */
|
|
20
|
+
export declare const Json: Story;
|
|
21
|
+
/** Text composite (TypeScript source) with scrolling viewport and no filter. */
|
|
22
|
+
export declare const Text: Story;
|
|
23
|
+
//# sourceMappingURL=Syntax.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Syntax.stories.d.ts","sourceRoot":"","sources":["../../../../src/Syntax/Syntax.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AA8C1B,QAAA,MAAM,IAAI;;;;;;;;;;;;;CAIM,CAAC;eAEF,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,yDAAyD;AACzD,eAAO,MAAM,IAAI,EAAE,KAelB,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,IAAI,EAAE,KAkBlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Syntax/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type SyntaxHighlighterProps as NaturalSyntaxHighlighterProps } from 'react-syntax-highlighter';
|
|
3
|
-
export type SyntaxHighlighterProps = NaturalSyntaxHighlighterProps & {
|
|
3
|
+
export type SyntaxHighlighterProps = Pick<NaturalSyntaxHighlighterProps, 'language' | 'renderer' | 'showLineNumbers' | 'showInlineLineNumbers' | 'startingLineNumber' | 'wrapLines' | 'wrapLongLines' | 'PreTag'> & {
|
|
4
|
+
themeStyle?: NaturalSyntaxHighlighterProps['style'];
|
|
4
5
|
fallback?: string;
|
|
6
|
+
copyButton?: boolean;
|
|
5
7
|
};
|
|
6
8
|
/**
|
|
9
|
+
* Inline, non-scrolling wrapper around `react-syntax-highlighter`.
|
|
10
|
+
*
|
|
11
|
+
* Use directly for small snippets (e.g. inside markdown code blocks).
|
|
12
|
+
* For scrollable panels, compose with `Syntax.Viewport`.
|
|
13
|
+
*
|
|
7
14
|
* NOTE: Using `light-async` version directly from dist to avoid any chance of the heavy one being loaded.
|
|
8
15
|
* The lightweight version will load specific language parsers asynchronously.
|
|
9
16
|
*
|
|
@@ -12,5 +19,5 @@ export type SyntaxHighlighterProps = NaturalSyntaxHighlighterProps & {
|
|
|
12
19
|
*/
|
|
13
20
|
export declare const SyntaxHighlighter: React.ForwardRefExoticComponent<Omit<SyntaxHighlighterProps, "className"> & {
|
|
14
21
|
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
15
|
-
} & Pick<React.HTMLAttributes<Element>, "
|
|
22
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
23
|
//# sourceMappingURL=SyntaxHighlighter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SyntaxHighlighter.d.ts","sourceRoot":"","sources":["../../../../src/SyntaxHighlighter/SyntaxHighlighter.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"SyntaxHighlighter.d.ts","sourceRoot":"","sources":["../../../../src/SyntaxHighlighter/SyntaxHighlighter.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,KAAK,sBAAsB,IAAI,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAcxG,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,6BAA6B,EAC3B,UAAU,GACV,UAAU,GACV,iBAAiB,GACjB,uBAAuB,GACvB,oBAAoB,GACpB,WAAW,GACX,eAAe,GACf,QAAQ,CACX,GAAG;IACF,UAAU,CAAC,EAAE,6BAA6B,CAAC,OAAO,CAAC,CAAC;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB;;2HAmE7B,CAAC"}
|