@dxos/react-ui-syntax-highlighter 0.8.4-main.dedc0f3 → 0.8.4-main.ead640a
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 +2 -2
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +2 -2
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/Json/Json.stories.d.ts +0 -1
- package/dist/types/src/Json/Json.stories.d.ts.map +1 -1
- package/dist/types/src/SyntaxHighlighter/SyntaxHighlighter.d.ts.map +1 -1
- package/dist/types/src/SyntaxHighlighter/SyntaxHighlighter.stories.d.ts +0 -1
- package/dist/types/src/SyntaxHighlighter/SyntaxHighlighter.stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -15
- package/src/Json/Json.stories.tsx +2 -4
- package/src/Json/Json.tsx +1 -1
- package/src/SyntaxHighlighter/SyntaxHighlighter.stories.tsx +1 -3
- package/src/SyntaxHighlighter/SyntaxHighlighter.tsx +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-syntax-highlighter",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.ead640a",
|
|
4
4
|
"description": "A syntax highlighter wrapper.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -31,23 +31,23 @@
|
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/jsonpath": "^0.2.4",
|
|
34
|
-
"@types/react": "~
|
|
35
|
-
"@types/react-dom": "~
|
|
34
|
+
"@types/react": "~19.2.2",
|
|
35
|
+
"@types/react-dom": "~19.2.1",
|
|
36
36
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
37
|
-
"react": "~
|
|
38
|
-
"react-dom": "~
|
|
39
|
-
"vite": "7.1.
|
|
40
|
-
"@dxos/random": "0.8.4-main.
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
37
|
+
"react": "~19.2.0",
|
|
38
|
+
"react-dom": "~19.2.0",
|
|
39
|
+
"vite": "7.1.9",
|
|
40
|
+
"@dxos/random": "0.8.4-main.ead640a",
|
|
41
|
+
"@dxos/storybook-utils": "0.8.4-main.ead640a",
|
|
42
|
+
"@dxos/util": "0.8.4-main.ead640a",
|
|
43
|
+
"@dxos/react-ui": "0.8.4-main.ead640a",
|
|
44
|
+
"@dxos/react-ui-theme": "0.8.4-main.ead640a"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"react": "
|
|
48
|
-
"react-dom": "
|
|
49
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
50
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
47
|
+
"react": "^19.0.0",
|
|
48
|
+
"react-dom": "^19.0.0",
|
|
49
|
+
"@dxos/react-ui": "0.8.4-main.ead640a",
|
|
50
|
+
"@dxos/react-ui-theme": "0.8.4-main.ead640a"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
|
|
9
7
|
import { faker } from '@dxos/random';
|
|
10
|
-
import {
|
|
8
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
11
9
|
|
|
12
10
|
import { Json } from './Json';
|
|
13
11
|
|
|
@@ -57,7 +55,7 @@ const createData = ({ depth = 2, children = 3 } = {}): any => {
|
|
|
57
55
|
const meta = {
|
|
58
56
|
title: 'ui/react-ui-syntax-highlighter/Json',
|
|
59
57
|
component: Json,
|
|
60
|
-
decorators: [withTheme, withLayout({
|
|
58
|
+
decorators: [withTheme, withLayout({ container: 'column' })],
|
|
61
59
|
} satisfies Meta<typeof Json>;
|
|
62
60
|
|
|
63
61
|
export default meta;
|
package/src/Json/Json.tsx
CHANGED
|
@@ -10,7 +10,7 @@ import { Input, type ThemedClassName } from '@dxos/react-ui';
|
|
|
10
10
|
|
|
11
11
|
import { SyntaxHighlighter } from '../SyntaxHighlighter';
|
|
12
12
|
|
|
13
|
-
const defaultClassNames = '!m-0 grow overflow-y-auto';
|
|
13
|
+
const defaultClassNames = '!m-0 grow overflow-y-auto text-sm';
|
|
14
14
|
|
|
15
15
|
export type JsonProps = ThemedClassName<{
|
|
16
16
|
data?: any;
|
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
|
|
9
|
-
import { withTheme } from '@dxos/
|
|
7
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
10
8
|
import { trim } from '@dxos/util';
|
|
11
9
|
|
|
12
10
|
import { SyntaxHighlighter } from './SyntaxHighlighter';
|
|
@@ -25,6 +25,7 @@ export type SyntaxHighlighterProps = ThemedClassName<
|
|
|
25
25
|
* https://github.com/react-syntax-highlighter/react-syntax-highlighter
|
|
26
26
|
* https://react-syntax-highlighter.github.io/react-syntax-highlighter/demo/prism.html
|
|
27
27
|
*/
|
|
28
|
+
// TODO(burdon): Replace with react-ui-editor (and reuse styles).
|
|
28
29
|
export const SyntaxHighlighter = ({
|
|
29
30
|
classNames,
|
|
30
31
|
children,
|
|
@@ -35,7 +36,7 @@ export const SyntaxHighlighter = ({
|
|
|
35
36
|
const { themeMode } = useThemeContext();
|
|
36
37
|
|
|
37
38
|
return (
|
|
38
|
-
<div className={mx('is-full p-1 overflow-hidden
|
|
39
|
+
<div className={mx('flex is-full p-1 overflow-hidden text-baseText', classNames)}>
|
|
39
40
|
<NativeSyntaxHighlighter
|
|
40
41
|
className='is-full overflow-auto scrollbar-thin'
|
|
41
42
|
language={languages[language as keyof typeof languages] || language}
|