@stream-mdx/react 0.4.0 → 1.0.0
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/CHANGELOG.md +385 -4
- package/README.md +141 -16
- package/dist/blocks-renderer-DAOBFBfi.d.ts +29 -0
- package/dist/blocks-renderer-DQEL1kJW.d.cts +29 -0
- package/dist/components/bottom-stick-scroll-area.cjs +268 -0
- package/dist/components/bottom-stick-scroll-area.d.cts +36 -0
- package/dist/components/bottom-stick-scroll-area.d.ts +36 -0
- package/dist/components/bottom-stick-scroll-area.mjs +249 -0
- package/dist/components/diff-renderer.cjs +86 -0
- package/dist/components/diff-renderer.d.cts +11 -0
- package/dist/components/diff-renderer.d.ts +11 -0
- package/dist/components/diff-renderer.mjs +66 -0
- package/dist/components/index.cjs +2879 -1295
- package/dist/components/index.d.cts +9 -2
- package/dist/components/index.d.ts +9 -2
- package/dist/components/index.mjs +2842 -1277
- package/dist/components/katex-math.cjs +220 -0
- package/dist/components/katex-math.d.cts +10 -0
- package/dist/components/katex-math.d.ts +10 -0
- package/dist/components/katex-math.mjs +188 -0
- package/dist/contexts/math-tracker.cjs +240 -521
- package/dist/contexts/math-tracker.mjs +235 -513
- package/dist/index-Cmne1yUK.d.cts +723 -0
- package/dist/index-D7dyyu3q.d.ts +723 -0
- package/dist/index.cjs +13180 -5640
- package/dist/index.d.cts +72 -40
- package/dist/index.d.ts +72 -40
- package/dist/index.mjs +12587 -5038
- package/dist/math/display-wrapper.cjs +7 -15
- package/dist/math/display-wrapper.d.cts +2 -2
- package/dist/math/display-wrapper.d.ts +2 -2
- package/dist/math/display-wrapper.mjs +2 -6
- package/dist/node-views-Bpc6Gkgl.d.cts +13 -0
- package/dist/node-views-DpnYdaAS.d.ts +13 -0
- package/dist/renderer/hooks.cjs +35 -20
- package/dist/renderer/hooks.d.cts +22 -1
- package/dist/renderer/hooks.d.ts +22 -1
- package/dist/renderer/hooks.mjs +27 -12
- package/dist/renderer/patch-batching.cjs +7 -8
- package/dist/renderer/patch-batching.d.cts +1 -1
- package/dist/renderer/patch-batching.d.ts +1 -1
- package/dist/renderer/patch-batching.mjs +2 -1
- package/dist/renderer/patch-coalescing.cjs +5 -8
- package/dist/renderer/patch-commit-scheduler.cjs +160 -326
- package/dist/renderer/patch-commit-scheduler.d.cts +28 -4
- package/dist/renderer/patch-commit-scheduler.d.ts +28 -4
- package/dist/renderer/patch-commit-scheduler.mjs +157 -318
- package/dist/renderer/store.cjs +3847 -1099
- package/dist/renderer/store.d.cts +111 -3
- package/dist/renderer/store.d.ts +111 -3
- package/dist/renderer/store.mjs +3847 -1085
- package/dist/renderer/virtualized-code.cjs +415 -71
- package/dist/renderer/virtualized-code.d.cts +24 -23
- package/dist/renderer/virtualized-code.d.ts +24 -23
- package/dist/renderer/virtualized-code.mjs +409 -62
- package/dist/renderer.cjs +10939 -3974
- package/dist/renderer.d.cts +100 -29
- package/dist/renderer.d.ts +100 -29
- package/dist/renderer.mjs +10711 -3697
- package/dist/server-regions-CPLHGli0.d.cts +32 -0
- package/dist/server-regions-mUhyoKi7.d.ts +32 -0
- package/dist/server.cjs +10286 -3365
- package/dist/server.d.cts +17 -247
- package/dist/server.d.ts +17 -247
- package/dist/server.mjs +10565 -3619
- package/dist/{streaming-markdown-DOc2uLiP.d.ts → streaming-markdown-yELbJxyH.d.ts} +51 -55
- package/dist/{streaming-markdown-D-JcByd9.d.cts → streaming-markdown-zVwFuaJG.d.cts} +51 -55
- package/dist/streaming-markdown.cjs +11828 -4879
- package/dist/streaming-markdown.d.cts +9 -2
- package/dist/streaming-markdown.d.ts +9 -2
- package/dist/streaming-markdown.mjs +11820 -4821
- package/dist/trusted-mdx/index.cjs +833 -0
- package/dist/trusted-mdx/index.d.cts +11 -0
- package/dist/trusted-mdx/index.d.ts +11 -0
- package/dist/trusted-mdx/index.mjs +807 -0
- package/dist/trusted-mdx/native-children-slot.cjs +45 -0
- package/dist/trusted-mdx/native-children-slot.d.cts +11 -0
- package/dist/trusted-mdx/native-children-slot.d.ts +11 -0
- package/dist/trusted-mdx/native-children-slot.mjs +24 -0
- package/dist/trusted-mdx/server.cjs +752 -0
- package/dist/trusted-mdx/server.d.cts +24 -0
- package/dist/trusted-mdx/server.d.ts +24 -0
- package/dist/trusted-mdx/server.mjs +724 -0
- package/dist/trusted-mdx-contract-ElKpkDI5.d.cts +113 -0
- package/dist/trusted-mdx-contract-ElKpkDI5.d.ts +113 -0
- package/dist/utils/inline-html.cjs +246 -147
- package/dist/utils/inline-html.d.cts +39 -6
- package/dist/utils/inline-html.d.ts +39 -6
- package/dist/utils/inline-html.mjs +237 -134
- package/package.json +52 -18
- package/shadcn/README.md +28 -0
- package/shadcn/bottom-stick-scroll-area.tsx +358 -0
- package/dist/index-D2MYusAM.d.cts +0 -248
- package/dist/index-D2MYusAM.d.ts +0 -248
- package/dist/mdx-client.cjs +0 -408
- package/dist/mdx-client.d.cts +0 -113
- package/dist/mdx-client.d.ts +0 -113
- package/dist/mdx-client.mjs +0 -369
- package/dist/mdx-coordinator.cjs +0 -563
- package/dist/mdx-coordinator.d.cts +0 -21
- package/dist/mdx-coordinator.d.ts +0 -21
- package/dist/mdx-coordinator.mjs +0 -529
- package/dist/renderer/node-views.cjs +0 -1642
- package/dist/renderer/node-views.d.cts +0 -12
- package/dist/renderer/node-views.d.ts +0 -12
- package/dist/renderer/node-views.mjs +0 -1616
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import { PatchMetrics, CoalescingMetrics, Patch } from '@stream-mdx/core';
|
|
1
|
+
import { PatchMetrics, PatchKind, CoalescingMetrics, Patch } from '@stream-mdx/core';
|
|
2
2
|
import { RendererStore } from './store.cjs';
|
|
3
|
+
import '../index-Cmne1yUK.cjs';
|
|
4
|
+
import '../components/bottom-stick-scroll-area.cjs';
|
|
5
|
+
import 'react/jsx-runtime';
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../components/diff-renderer.cjs';
|
|
8
|
+
import '@stream-mdx/protocol';
|
|
9
|
+
import '../trusted-mdx-contract-ElKpkDI5.cjs';
|
|
10
|
+
import '@stream-mdx/worker/engine';
|
|
11
|
+
import './virtualized-code.cjs';
|
|
3
12
|
|
|
4
13
|
type NowFn = () => number;
|
|
5
14
|
interface AdaptiveBudgetState {
|
|
@@ -18,9 +27,11 @@ interface AdaptiveBudgetState {
|
|
|
18
27
|
}
|
|
19
28
|
interface PatchBatchMeta {
|
|
20
29
|
tx?: number;
|
|
30
|
+
generation?: number;
|
|
21
31
|
metrics?: PatchMetrics;
|
|
22
32
|
receivedAt?: number;
|
|
23
33
|
priority?: "high" | "low";
|
|
34
|
+
kind?: PatchKind;
|
|
24
35
|
}
|
|
25
36
|
interface PatchBatchInput {
|
|
26
37
|
patches: Patch[];
|
|
@@ -37,6 +48,7 @@ interface PatchFlushBatchResult {
|
|
|
37
48
|
receivedAt: number;
|
|
38
49
|
appliedAt: number;
|
|
39
50
|
priority: "high" | "low";
|
|
51
|
+
kind: PatchKind;
|
|
40
52
|
coalescing?: CoalescingMetrics;
|
|
41
53
|
}
|
|
42
54
|
interface PatchFlushResult {
|
|
@@ -45,7 +57,11 @@ interface PatchFlushResult {
|
|
|
45
57
|
totalAppliedPatches: number;
|
|
46
58
|
totalDurationMs: number;
|
|
47
59
|
remainingQueueSize: number;
|
|
60
|
+
remainingSemanticQueueSize: number;
|
|
61
|
+
remainingEnrichmentQueueSize: number;
|
|
48
62
|
queueDepthBefore: number;
|
|
63
|
+
semanticQueueDepthBefore: number;
|
|
64
|
+
enrichmentQueueDepthBefore: number;
|
|
49
65
|
flushStartedAt: number;
|
|
50
66
|
flushCompletedAt: number;
|
|
51
67
|
coalescingDurationP95?: number | null;
|
|
@@ -65,10 +81,13 @@ interface PatchCommitSchedulerOptions {
|
|
|
65
81
|
urgentQueueThreshold?: number;
|
|
66
82
|
batch?: "rAF" | "microtask" | "timeout";
|
|
67
83
|
historyLimit?: number;
|
|
84
|
+
startupMicrotaskFlushes?: number;
|
|
85
|
+
adaptiveBudgeting?: boolean;
|
|
68
86
|
}
|
|
69
87
|
declare class PatchCommitScheduler {
|
|
70
88
|
private readonly store;
|
|
71
89
|
private readonly onFlush;
|
|
90
|
+
private readonly isGenerationCurrent?;
|
|
72
91
|
private frameBudgetMs;
|
|
73
92
|
private maxBatchesPerFlush?;
|
|
74
93
|
private readonly now;
|
|
@@ -78,8 +97,10 @@ declare class PatchCommitScheduler {
|
|
|
78
97
|
private lowPriorityFrameBudgetMs;
|
|
79
98
|
private maxLowPriorityBatchesPerFlush?;
|
|
80
99
|
private urgentQueueThreshold;
|
|
81
|
-
private
|
|
82
|
-
private
|
|
100
|
+
private adaptiveBudgeting;
|
|
101
|
+
private semanticQueue;
|
|
102
|
+
private enrichmentHighQueue;
|
|
103
|
+
private enrichmentLowQueue;
|
|
83
104
|
private scheduled;
|
|
84
105
|
private flushing;
|
|
85
106
|
private scheduledHandle;
|
|
@@ -95,9 +116,12 @@ declare class PatchCommitScheduler {
|
|
|
95
116
|
private adaptiveBudgetActive;
|
|
96
117
|
private adaptiveHighBatchCap;
|
|
97
118
|
private adaptiveLowBatchCap;
|
|
119
|
+
private startupMicrotaskFlushes;
|
|
120
|
+
private flushCount;
|
|
98
121
|
constructor(params: {
|
|
99
122
|
store: RendererStore;
|
|
100
|
-
onFlush: (result: PatchFlushResult) => void;
|
|
123
|
+
onFlush: (result: PatchFlushResult, hasNonInputSourcePatch: boolean) => void;
|
|
124
|
+
isGenerationCurrent?: (generation: number) => boolean;
|
|
101
125
|
options?: PatchCommitSchedulerOptions;
|
|
102
126
|
});
|
|
103
127
|
enqueue(input: PatchBatchInput): void;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import { PatchMetrics, CoalescingMetrics, Patch } from '@stream-mdx/core';
|
|
1
|
+
import { PatchMetrics, PatchKind, CoalescingMetrics, Patch } from '@stream-mdx/core';
|
|
2
2
|
import { RendererStore } from './store.js';
|
|
3
|
+
import '../index-D7dyyu3q.js';
|
|
4
|
+
import '../components/bottom-stick-scroll-area.js';
|
|
5
|
+
import 'react/jsx-runtime';
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../components/diff-renderer.js';
|
|
8
|
+
import '@stream-mdx/protocol';
|
|
9
|
+
import '../trusted-mdx-contract-ElKpkDI5.js';
|
|
10
|
+
import '@stream-mdx/worker/engine';
|
|
11
|
+
import './virtualized-code.js';
|
|
3
12
|
|
|
4
13
|
type NowFn = () => number;
|
|
5
14
|
interface AdaptiveBudgetState {
|
|
@@ -18,9 +27,11 @@ interface AdaptiveBudgetState {
|
|
|
18
27
|
}
|
|
19
28
|
interface PatchBatchMeta {
|
|
20
29
|
tx?: number;
|
|
30
|
+
generation?: number;
|
|
21
31
|
metrics?: PatchMetrics;
|
|
22
32
|
receivedAt?: number;
|
|
23
33
|
priority?: "high" | "low";
|
|
34
|
+
kind?: PatchKind;
|
|
24
35
|
}
|
|
25
36
|
interface PatchBatchInput {
|
|
26
37
|
patches: Patch[];
|
|
@@ -37,6 +48,7 @@ interface PatchFlushBatchResult {
|
|
|
37
48
|
receivedAt: number;
|
|
38
49
|
appliedAt: number;
|
|
39
50
|
priority: "high" | "low";
|
|
51
|
+
kind: PatchKind;
|
|
40
52
|
coalescing?: CoalescingMetrics;
|
|
41
53
|
}
|
|
42
54
|
interface PatchFlushResult {
|
|
@@ -45,7 +57,11 @@ interface PatchFlushResult {
|
|
|
45
57
|
totalAppliedPatches: number;
|
|
46
58
|
totalDurationMs: number;
|
|
47
59
|
remainingQueueSize: number;
|
|
60
|
+
remainingSemanticQueueSize: number;
|
|
61
|
+
remainingEnrichmentQueueSize: number;
|
|
48
62
|
queueDepthBefore: number;
|
|
63
|
+
semanticQueueDepthBefore: number;
|
|
64
|
+
enrichmentQueueDepthBefore: number;
|
|
49
65
|
flushStartedAt: number;
|
|
50
66
|
flushCompletedAt: number;
|
|
51
67
|
coalescingDurationP95?: number | null;
|
|
@@ -65,10 +81,13 @@ interface PatchCommitSchedulerOptions {
|
|
|
65
81
|
urgentQueueThreshold?: number;
|
|
66
82
|
batch?: "rAF" | "microtask" | "timeout";
|
|
67
83
|
historyLimit?: number;
|
|
84
|
+
startupMicrotaskFlushes?: number;
|
|
85
|
+
adaptiveBudgeting?: boolean;
|
|
68
86
|
}
|
|
69
87
|
declare class PatchCommitScheduler {
|
|
70
88
|
private readonly store;
|
|
71
89
|
private readonly onFlush;
|
|
90
|
+
private readonly isGenerationCurrent?;
|
|
72
91
|
private frameBudgetMs;
|
|
73
92
|
private maxBatchesPerFlush?;
|
|
74
93
|
private readonly now;
|
|
@@ -78,8 +97,10 @@ declare class PatchCommitScheduler {
|
|
|
78
97
|
private lowPriorityFrameBudgetMs;
|
|
79
98
|
private maxLowPriorityBatchesPerFlush?;
|
|
80
99
|
private urgentQueueThreshold;
|
|
81
|
-
private
|
|
82
|
-
private
|
|
100
|
+
private adaptiveBudgeting;
|
|
101
|
+
private semanticQueue;
|
|
102
|
+
private enrichmentHighQueue;
|
|
103
|
+
private enrichmentLowQueue;
|
|
83
104
|
private scheduled;
|
|
84
105
|
private flushing;
|
|
85
106
|
private scheduledHandle;
|
|
@@ -95,9 +116,12 @@ declare class PatchCommitScheduler {
|
|
|
95
116
|
private adaptiveBudgetActive;
|
|
96
117
|
private adaptiveHighBatchCap;
|
|
97
118
|
private adaptiveLowBatchCap;
|
|
119
|
+
private startupMicrotaskFlushes;
|
|
120
|
+
private flushCount;
|
|
98
121
|
constructor(params: {
|
|
99
122
|
store: RendererStore;
|
|
100
|
-
onFlush: (result: PatchFlushResult) => void;
|
|
123
|
+
onFlush: (result: PatchFlushResult, hasNonInputSourcePatch: boolean) => void;
|
|
124
|
+
isGenerationCurrent?: (generation: number) => boolean;
|
|
101
125
|
options?: PatchCommitSchedulerOptions;
|
|
102
126
|
});
|
|
103
127
|
enqueue(input: PatchBatchInput): void;
|