@dxos/react-ui-syntax-highlighter 0.8.4-main.422d1c7879 → 0.8.4-main.43cb759274

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-syntax-highlighter",
3
- "version": "0.8.4-main.422d1c7879",
3
+ "version": "0.8.4-main.43cb759274",
4
4
  "description": "A syntax highlighter wrapper.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -8,7 +8,7 @@
8
8
  "type": "git",
9
9
  "url": "https://github.com/dxos/dxos"
10
10
  },
11
- "license": "MIT",
11
+ "license": "FSL-1.1-Apache-2.0",
12
12
  "author": "DXOS.org",
13
13
  "sideEffects": false,
14
14
  "type": "module",
@@ -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.422d1c7879",
33
- "@dxos/util": "0.8.4-main.422d1c7879"
32
+ "@dxos/ui-types": "0.8.4-main.43cb759274",
33
+ "@dxos/util": "0.8.4-main.43cb759274"
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": "^7.1.11",
42
- "@dxos/random": "0.8.4-main.422d1c7879",
43
- "@dxos/react-ui": "0.8.4-main.422d1c7879",
44
- "@dxos/storybook-utils": "0.8.4-main.422d1c7879",
45
- "@dxos/ui-theme": "0.8.4-main.422d1c7879",
46
- "@dxos/util": "0.8.4-main.422d1c7879"
41
+ "vite": "^8.0.14",
42
+ "@dxos/random": "0.8.4-main.43cb759274",
43
+ "@dxos/util": "0.8.4-main.43cb759274",
44
+ "@dxos/storybook-utils": "0.8.4-main.43cb759274",
45
+ "@dxos/react-ui": "0.8.4-main.43cb759274"
47
46
  },
48
47
  "peerDependencies": {
49
48
  "react": "~19.2.3",
50
49
  "react-dom": "~19.2.3",
51
- "@dxos/ui-theme": "0.8.4-main.422d1c7879",
52
- "@dxos/react-ui": "0.8.4-main.422d1c7879"
50
+ "@dxos/react-ui": "0.8.4-main.43cb759274"
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-theme';
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';
@@ -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-theme';
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-theme';
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
  >
@@ -95,10 +99,7 @@ export const SyntaxHighlighter = composable<HTMLDivElement, SyntaxHighlighterPro
95
99
  </NativeSyntaxHighlighter>
96
100
 
97
101
  {copyButton && (
98
- <div
99
- role='none'
100
- className='pointer-events-none absolute top-1 right-1 z-10 opacity-0 group-hover:opacity-100 focus-within:opacity-100'
101
- >
102
+ <div className='pointer-events-none absolute top-1 right-1 z-10 opacity-0 group-hover:opacity-100 focus-within:opacity-100'>
102
103
  <Clipboard.Provider>
103
104
  <Clipboard.IconButton
104
105
  value={source}