@dxos/react-ui-markdown 0.9.1-main.c7dcc2e112 → 0.9.1-staging.ee54ba693a
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 +4 -6
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/MarkdownStream/MarkdownStream.d.ts.map +1 -1
- package/dist/types/src/MarkdownStream/MarkdownStream.stories.d.ts +2 -2
- package/dist/types/src/MarkdownStream/MarkdownStream.stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -31
- package/src/MarkdownStream/MarkdownStream.stories.tsx +2 -2
- package/src/MarkdownStream/MarkdownStream.tsx +14 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-markdown",
|
|
3
|
-
"version": "0.9.1-
|
|
3
|
+
"version": "0.9.1-staging.ee54ba693a",
|
|
4
4
|
"description": "Markdown components.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -34,47 +34,47 @@
|
|
|
34
34
|
"@lezer/xml": "^1.0.6",
|
|
35
35
|
"@radix-ui/react-compose-refs": "1.1.1",
|
|
36
36
|
"@radix-ui/react-context": "1.1.1",
|
|
37
|
-
"effect": "3.21.
|
|
37
|
+
"effect": "3.21.4",
|
|
38
38
|
"json5": "^2.2.3",
|
|
39
39
|
"react-markdown": "^10.1.0",
|
|
40
40
|
"react-resize-detector": "^11.0.1",
|
|
41
41
|
"remark-gfm": "^4.0.1",
|
|
42
|
-
"@dxos/async": "0.9.1-
|
|
43
|
-
"@dxos/echo": "0.9.1-
|
|
44
|
-
"@dxos/effect": "0.9.1-
|
|
45
|
-
"@dxos/log": "0.9.1-
|
|
46
|
-
"@dxos/react-ui
|
|
47
|
-
"@dxos/react-ui": "0.9.1-
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/react-ui-syntax-highlighter": "0.9.1-
|
|
50
|
-
"@dxos/ui": "0.9.1-
|
|
51
|
-
"@dxos/ui-
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/util": "0.9.1-
|
|
42
|
+
"@dxos/async": "0.9.1-staging.ee54ba693a",
|
|
43
|
+
"@dxos/echo": "0.9.1-staging.ee54ba693a",
|
|
44
|
+
"@dxos/effect": "0.9.1-staging.ee54ba693a",
|
|
45
|
+
"@dxos/log": "0.9.1-staging.ee54ba693a",
|
|
46
|
+
"@dxos/react-ui": "0.9.1-staging.ee54ba693a",
|
|
47
|
+
"@dxos/react-ui-editor": "0.9.1-staging.ee54ba693a",
|
|
48
|
+
"@dxos/ui": "0.9.1-staging.ee54ba693a",
|
|
49
|
+
"@dxos/react-ui-syntax-highlighter": "0.9.1-staging.ee54ba693a",
|
|
50
|
+
"@dxos/ui-editor": "0.9.1-staging.ee54ba693a",
|
|
51
|
+
"@dxos/ui-theme": "0.9.1-staging.ee54ba693a",
|
|
52
|
+
"@dxos/invariant": "0.9.1-staging.ee54ba693a",
|
|
53
|
+
"@dxos/util": "0.9.1-staging.ee54ba693a"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@effect/vitest": "0.29.0",
|
|
57
|
-
"@types/react": "~19.2.
|
|
57
|
+
"@types/react": "~19.2.17",
|
|
58
58
|
"@types/react-dom": "~19.2.3",
|
|
59
|
-
"react": "~19.2.
|
|
60
|
-
"react-dom": "~19.2.
|
|
59
|
+
"react": "~19.2.7",
|
|
60
|
+
"react-dom": "~19.2.7",
|
|
61
61
|
"vite": "^8.0.16",
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/lit-ui": "0.9.1-
|
|
65
|
-
"@dxos/random": "0.9.1-
|
|
66
|
-
"@dxos/react-
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
62
|
+
"@dxos/keys": "0.9.1-staging.ee54ba693a",
|
|
63
|
+
"@dxos/echo": "0.9.1-staging.ee54ba693a",
|
|
64
|
+
"@dxos/lit-ui": "0.9.1-staging.ee54ba693a",
|
|
65
|
+
"@dxos/random": "0.9.1-staging.ee54ba693a",
|
|
66
|
+
"@dxos/react-client": "0.9.1-staging.ee54ba693a",
|
|
67
|
+
"@dxos/react-ui": "0.9.1-staging.ee54ba693a",
|
|
68
|
+
"@dxos/schema": "0.9.1-staging.ee54ba693a",
|
|
69
|
+
"@dxos/storybook-utils": "0.9.1-staging.ee54ba693a",
|
|
70
|
+
"@dxos/ui-theme": "0.9.1-staging.ee54ba693a"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"effect": "3.21.
|
|
74
|
-
"react": "~19.2.
|
|
75
|
-
"react-dom": "~19.2.
|
|
76
|
-
"@dxos/react-ui": "0.9.1-
|
|
77
|
-
"@dxos/ui-theme": "0.9.1-
|
|
73
|
+
"effect": "3.21.4",
|
|
74
|
+
"react": "~19.2.7",
|
|
75
|
+
"react-dom": "~19.2.7",
|
|
76
|
+
"@dxos/react-ui": "0.9.1-staging.ee54ba693a",
|
|
77
|
+
"@dxos/ui-theme": "0.9.1-staging.ee54ba693a"
|
|
78
78
|
},
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public"
|
|
@@ -66,7 +66,7 @@ const registry: XmlWidgetRegistry = {
|
|
|
66
66
|
},
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
type
|
|
69
|
+
type StoryArgs = MarkdownStreamProps & {
|
|
70
70
|
initialContent?: string;
|
|
71
71
|
streamOptions?: TextStreamOptions;
|
|
72
72
|
};
|
|
@@ -77,7 +77,7 @@ const DefaultStory = ({
|
|
|
77
77
|
streamOptions = defaultStreamOptions,
|
|
78
78
|
debug: debugProp,
|
|
79
79
|
...props
|
|
80
|
-
}:
|
|
80
|
+
}: StoryArgs) => {
|
|
81
81
|
const [controller, setController] = useState<MarkdownStreamController | null>(null);
|
|
82
82
|
const [streaming, setStreaming] = useState(false);
|
|
83
83
|
const [debug, setDebug] = useState(debugProp);
|
|
@@ -9,51 +9,50 @@ import * as Fiber from 'effect/Fiber';
|
|
|
9
9
|
import * as Queue from 'effect/Queue';
|
|
10
10
|
import * as Stream from 'effect/Stream';
|
|
11
11
|
import React, {
|
|
12
|
-
forwardRef,
|
|
13
12
|
type ReactNode,
|
|
13
|
+
type RefObject,
|
|
14
|
+
forwardRef,
|
|
14
15
|
useCallback,
|
|
15
16
|
useEffect,
|
|
16
17
|
useImperativeHandle,
|
|
17
18
|
useRef,
|
|
18
19
|
useState,
|
|
19
|
-
type RefObject,
|
|
20
20
|
} from 'react';
|
|
21
21
|
import { createPortal } from 'react-dom';
|
|
22
22
|
|
|
23
23
|
import { addEventListener } from '@dxos/async';
|
|
24
24
|
import { EffectEx } from '@dxos/effect';
|
|
25
25
|
import { ErrorBoundary, type ThemedClassName, useDynamicRef, useStateWithRef, useThemeContext } from '@dxos/react-ui';
|
|
26
|
-
import {
|
|
26
|
+
import { type UseTextEditor, useTextEditor } from '@dxos/react-ui-editor';
|
|
27
27
|
import {
|
|
28
28
|
type AutoScrollProps,
|
|
29
29
|
type XmlTagsOptions,
|
|
30
30
|
type XmlWidgetState,
|
|
31
31
|
type XmlWidgetStateManager,
|
|
32
|
+
crawlerLineEffect,
|
|
32
33
|
createBasicExtensions,
|
|
33
34
|
createThemeExtensions,
|
|
34
35
|
decorateMarkdown,
|
|
36
|
+
documentSlots,
|
|
35
37
|
extendedMarkdown,
|
|
38
|
+
fader,
|
|
39
|
+
lineSpacing,
|
|
36
40
|
navigateNextEffect,
|
|
37
41
|
navigatePreviousEffect,
|
|
38
|
-
preview,
|
|
39
42
|
scroller,
|
|
40
|
-
crawlerLineEffect,
|
|
41
|
-
fader,
|
|
42
43
|
typewriter,
|
|
43
44
|
typewriterBypass,
|
|
45
|
+
xmlBlockDecoration,
|
|
46
|
+
xmlFormatting,
|
|
44
47
|
xmlTagContextEffect,
|
|
45
48
|
xmlTagResetEffect,
|
|
46
|
-
xmlTagUpdateEffect,
|
|
47
49
|
xmlTags,
|
|
48
|
-
|
|
49
|
-
xmlFormatting,
|
|
50
|
-
xmlBlockDecoration,
|
|
51
|
-
lineSpacing,
|
|
50
|
+
xmlTagUpdateEffect,
|
|
52
51
|
} from '@dxos/ui-editor';
|
|
53
52
|
import { mx } from '@dxos/ui-theme';
|
|
54
53
|
import { isTruthy } from '@dxos/util';
|
|
55
54
|
|
|
56
|
-
import {
|
|
55
|
+
import { footer, setFooterVisibleEffect } from './footer';
|
|
57
56
|
import { type StreamerOptions, createStreamer } from './stream';
|
|
58
57
|
export interface MarkdownStreamController extends XmlWidgetStateManager {
|
|
59
58
|
get length(): number | undefined;
|
|
@@ -270,17 +269,15 @@ const useMarkdownStreamTextEditor = (
|
|
|
270
269
|
[
|
|
271
270
|
extendedMarkdown({ registry }),
|
|
272
271
|
decorateMarkdown({
|
|
273
|
-
// `echo:`/`dxn:` links/images are
|
|
274
|
-
//
|
|
275
|
-
// non-functional `LinkButton` anchor on top of the same node
|
|
276
|
-
// `[DXOS](echo://BNPMIBEDJLRIILYUYZVM6GT64VWI6WPPZ/01KQ889PZBRNHAEECV0ANFAYX7)`.
|
|
272
|
+
// `echo:`/`dxn:` links/images are handled by the `link-preview` entry in the
|
|
273
|
+
// registry via `xmlTags` `urlSchemes`. Skipping them here avoids `decorateMarkdown`
|
|
274
|
+
// adding a non-functional `LinkButton` anchor on top of the same node.
|
|
277
275
|
skip: (node) =>
|
|
278
276
|
(node.name === 'Link' || node.name === 'Image') &&
|
|
279
277
|
(node.url.startsWith('dxn:') || node.url.startsWith('echo:')),
|
|
280
278
|
}),
|
|
281
279
|
// TODO(burdon): Make optional; Removes need for '\n\n'.
|
|
282
280
|
lineSpacing(),
|
|
283
|
-
preview(),
|
|
284
281
|
// NOTE: An ancestor element must set `data-hue` so `.dx-panel` resolves to the user's
|
|
285
282
|
// hue tokens (see `packages/ui/ui-theme/src/css/components/panel.css`). Tailwind picks
|
|
286
283
|
// up these utility classes from this source file.
|