@dxos/react-ui-syntax-highlighter 0.8.4-main.d05539e30a → 0.8.4-main.d9fc60f731
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 +9 -4
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +9 -4
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/SyntaxHighlighter/SyntaxHighlighter.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -11
- package/src/JsonHighlighter/JsonHighlighter.tsx +1 -1
- package/src/Syntax/Syntax.tsx +2 -2
- package/src/SyntaxHighlighter/SyntaxHighlighter.tsx +5 -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.d9fc60f731",
|
|
4
4
|
"description": "A syntax highlighter wrapper.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"@radix-ui/react-context": "1.1.1",
|
|
30
30
|
"jsonpath-plus": "^10.3.0",
|
|
31
31
|
"react-syntax-highlighter": "^15.6.1",
|
|
32
|
-
"@dxos/ui-types": "0.8.4-main.
|
|
33
|
-
"@dxos/util": "0.8.4-main.
|
|
32
|
+
"@dxos/ui-types": "0.8.4-main.d9fc60f731",
|
|
33
|
+
"@dxos/util": "0.8.4-main.d9fc60f731"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/react": "~19.2.7",
|
|
@@ -38,18 +38,16 @@
|
|
|
38
38
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
39
39
|
"react": "~19.2.3",
|
|
40
40
|
"react-dom": "~19.2.3",
|
|
41
|
-
"vite": "^8.0.
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/react-ui": "0.8.4-main.d05539e30a"
|
|
41
|
+
"vite": "^8.0.14",
|
|
42
|
+
"@dxos/react-ui": "0.8.4-main.d9fc60f731",
|
|
43
|
+
"@dxos/random": "0.8.4-main.d9fc60f731",
|
|
44
|
+
"@dxos/util": "0.8.4-main.d9fc60f731",
|
|
45
|
+
"@dxos/storybook-utils": "0.8.4-main.d9fc60f731"
|
|
47
46
|
},
|
|
48
47
|
"peerDependencies": {
|
|
49
48
|
"react": "~19.2.3",
|
|
50
49
|
"react-dom": "~19.2.3",
|
|
51
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
52
|
-
"@dxos/ui-theme": "0.8.4-main.d05539e30a"
|
|
50
|
+
"@dxos/react-ui": "0.8.4-main.d9fc60f731"
|
|
53
51
|
},
|
|
54
52
|
"publishConfig": {
|
|
55
53
|
"access": "public"
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { composable } from '@dxos/ui
|
|
7
|
+
import { composable } from '@dxos/react-ui';
|
|
8
8
|
import { type CreateReplacerProps, createReplacer, safeStringify } from '@dxos/util';
|
|
9
9
|
|
|
10
10
|
import { SyntaxHighlighter, type SyntaxHighlighterProps } from '../SyntaxHighlighter';
|
package/src/Syntax/Syntax.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import { JSONPath } from 'jsonpath-plus';
|
|
|
7
7
|
import React, { type FC, type PropsWithChildren, forwardRef, useMemo, useState } from 'react';
|
|
8
8
|
|
|
9
9
|
import { Input, ScrollArea } from '@dxos/react-ui';
|
|
10
|
-
import { composable, composableProps } from '@dxos/ui
|
|
10
|
+
import { composable, composableProps } from '@dxos/react-ui';
|
|
11
11
|
import { type ComposableProps } from '@dxos/ui-types';
|
|
12
12
|
|
|
13
13
|
import { JsonHighlighter, type JsonReplacer } from '../JsonHighlighter';
|
|
@@ -166,7 +166,7 @@ type SyntaxViewportProps = ComposableProps;
|
|
|
166
166
|
/** Optional scroll wrapper. Compose around `Syntax.Code` to make it scrollable. */
|
|
167
167
|
const SyntaxViewport = composable<HTMLDivElement, SyntaxViewportProps>(({ children, ...props }, forwardedRef) => {
|
|
168
168
|
return (
|
|
169
|
-
<ScrollArea.Root {...composableProps(props)} thin ref={forwardedRef}>
|
|
169
|
+
<ScrollArea.Root {...composableProps(props)} orientation='all' thin ref={forwardedRef}>
|
|
170
170
|
<ScrollArea.Viewport>{children}</ScrollArea.Viewport>
|
|
171
171
|
</ScrollArea.Root>
|
|
172
172
|
);
|
|
@@ -8,7 +8,7 @@ import NativeSyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-asy
|
|
|
8
8
|
import { coldarkDark as dark, coldarkCold as light } from 'react-syntax-highlighter/dist/esm/styles/prism';
|
|
9
9
|
|
|
10
10
|
import { Clipboard, useThemeContext } from '@dxos/react-ui';
|
|
11
|
-
import { composable, composableProps } from '@dxos/ui
|
|
11
|
+
import { composable, composableProps } from '@dxos/react-ui';
|
|
12
12
|
|
|
13
13
|
const zeroWidthSpace = '\u200b';
|
|
14
14
|
|
|
@@ -87,6 +87,10 @@ export const SyntaxHighlighter = composable<HTMLDivElement, SyntaxHighlighterPro
|
|
|
87
87
|
boxShadow: 'none',
|
|
88
88
|
padding: 0,
|
|
89
89
|
margin: 0,
|
|
90
|
+
// Non-scrolling wrapper: defer all scrolling to an enclosing `Syntax.Viewport`.
|
|
91
|
+
// The prism theme sets `overflow: auto` on the <pre>, which otherwise creates a
|
|
92
|
+
// nested native horizontal scrollbar alongside the viewport's custom one.
|
|
93
|
+
overflow: 'visible',
|
|
90
94
|
}}
|
|
91
95
|
{...nativeProps}
|
|
92
96
|
>
|