@stream-mdx/core 0.2.0 → 0.3.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/README.md CHANGED
@@ -46,4 +46,8 @@ export function makeConfig(overrides?: Partial<typeof DEFAULT_BACKPRESSURE_CONFI
46
46
 
47
47
  - `@stream-mdx/react` for the React renderer
48
48
  - `@stream-mdx/worker` for hosted worker bundles
49
+ - `@stream-mdx/plugins` for worker-side plugin primitives (advanced)
50
+ - `@stream-mdx/protocol` for stable protocol/event types (e.g. TUIs)
51
+ - `@stream-mdx/tui` for NDJSON helpers + a snapshot store (terminal UIs)
49
52
  - `@stream-mdx/mermaid` for Mermaid diagram rendering (optional)
53
+ - `@stream-mdx/theme-tailwind` for an optional Tailwind-friendly theme (optional)
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Block, NodeSnapshot, InlineNode, Patch } from './types.cjs';
2
- export { ASTInlinePlugin, CoalescingMetrics, CodeHighlightOutputMode, CodeHighlightingMode, CompiledMdxModule, DiffKind, FormatAnticipationConfig, InlineHtmlDescriptor, InlinePlugin, LANGUAGE_ALIASES, LazyTokenizationPriority, MixedContentSegment, NodePath, PATCH_ROOT_ID, PatchMetrics, PerformanceMetrics, ProtectedRange, ProtectedRangeKind, RegexAnticipationPattern, RegexInlinePlugin, SetPropsBatchEntry, TokenLineV1, TokenSpan, TokenStyle, WorkerErrorPayload, WorkerIn, WorkerOut, WorkerPhase } from './types.cjs';
2
+ export { ASTInlinePlugin, CoalescingMetrics, CodeHighlightOutputMode, CodeHighlightingMode, CompiledMdxModule, DiffBlock, DiffKind, DiffLine, DiffLineKind, FormatAnticipationConfig, InlineHtmlDescriptor, InlinePlugin, LANGUAGE_ALIASES, LazyTokenizationPriority, MixedContentSegment, NodePath, PATCH_ROOT_ID, PatchMetrics, PerformanceMetrics, ProtectedRange, ProtectedRangeKind, RegexAnticipationPattern, RegexInlinePlugin, SetPropsBatchEntry, ThemedLine, ThemedToken, TokenLineV1, TokenSpan, TokenStyle, WorkerErrorPayload, WorkerIn, WorkerOut, WorkerPhase } from './types.cjs';
3
3
  export { HighlightedLine, dedentIndentedCode, extractCodeLines, extractCodeWrapperAttributes, extractHighlightedLines, getDefaultCodeWrapperAttributes, normalizeHighlightedLines, stripCodeFence } from './code-highlighting.cjs';
4
4
  export { PerformanceTimer, StringBuffer, applyUpdate, debounce, detectMDX, generateBlockId, getBlockKey, normalizeBlockquoteText, normalizeLang, parseCodeFenceInfo, removeHeadingMarkers } from './utils.cjs';
5
5
  export { MixedContentAutoCloseHtmlOptions, MixedContentAutoCloseMdxOptions, MixedContentOptions, extractMixedContentSegments, findClosingHtmlTag, isLikelyMdxComponent } from './mixed-content.cjs';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Block, NodeSnapshot, InlineNode, Patch } from './types.js';
2
- export { ASTInlinePlugin, CoalescingMetrics, CodeHighlightOutputMode, CodeHighlightingMode, CompiledMdxModule, DiffKind, FormatAnticipationConfig, InlineHtmlDescriptor, InlinePlugin, LANGUAGE_ALIASES, LazyTokenizationPriority, MixedContentSegment, NodePath, PATCH_ROOT_ID, PatchMetrics, PerformanceMetrics, ProtectedRange, ProtectedRangeKind, RegexAnticipationPattern, RegexInlinePlugin, SetPropsBatchEntry, TokenLineV1, TokenSpan, TokenStyle, WorkerErrorPayload, WorkerIn, WorkerOut, WorkerPhase } from './types.js';
2
+ export { ASTInlinePlugin, CoalescingMetrics, CodeHighlightOutputMode, CodeHighlightingMode, CompiledMdxModule, DiffBlock, DiffKind, DiffLine, DiffLineKind, FormatAnticipationConfig, InlineHtmlDescriptor, InlinePlugin, LANGUAGE_ALIASES, LazyTokenizationPriority, MixedContentSegment, NodePath, PATCH_ROOT_ID, PatchMetrics, PerformanceMetrics, ProtectedRange, ProtectedRangeKind, RegexAnticipationPattern, RegexInlinePlugin, SetPropsBatchEntry, ThemedLine, ThemedToken, TokenLineV1, TokenSpan, TokenStyle, WorkerErrorPayload, WorkerIn, WorkerOut, WorkerPhase } from './types.js';
3
3
  export { HighlightedLine, dedentIndentedCode, extractCodeLines, extractCodeWrapperAttributes, extractHighlightedLines, getDefaultCodeWrapperAttributes, normalizeHighlightedLines, stripCodeFence } from './code-highlighting.js';
4
4
  export { PerformanceTimer, StringBuffer, applyUpdate, debounce, detectMDX, generateBlockId, getBlockKey, normalizeBlockquoteText, normalizeLang, parseCodeFenceInfo, removeHeadingMarkers } from './utils.js';
5
5
  export { MixedContentAutoCloseHtmlOptions, MixedContentAutoCloseMdxOptions, MixedContentOptions, extractMixedContentSegments, findClosingHtmlTag, isLikelyMdxComponent } from './mixed-content.js';
package/dist/types.d.cts CHANGED
@@ -128,6 +128,29 @@ type TokenLineV1 = {
128
128
  spans: TokenSpan[];
129
129
  };
130
130
  type DiffKind = "add" | "remove" | "context" | "hunk" | "meta";
131
+ type DiffLineKind = "meta" | "hunk" | "add" | "del" | "context";
132
+ type ThemedToken = {
133
+ content: string;
134
+ color?: string | null;
135
+ fontStyle?: number | null;
136
+ };
137
+ type ThemedLine = ThemedToken[];
138
+ type DiffLine = {
139
+ kind: DiffLineKind;
140
+ oldNo?: number | null;
141
+ newNo?: number | null;
142
+ raw: string;
143
+ tokens?: ThemedLine | null;
144
+ };
145
+ type DiffBlock = {
146
+ kind: "diff";
147
+ filePath?: string | null;
148
+ language?: string | null;
149
+ lines: DiffLine[];
150
+ additions?: number | null;
151
+ deletions?: number | null;
152
+ unified?: string | null;
153
+ };
131
154
  type LazyTokenizationPriority = "visible" | "prefetch";
132
155
  /**
133
156
  * Worker communication protocol
@@ -147,6 +170,9 @@ type WorkerIn = {
147
170
  codeHighlighting?: CodeHighlightingMode;
148
171
  outputMode?: CodeHighlightOutputMode;
149
172
  liveCodeHighlighting?: boolean;
173
+ liveTokenization?: boolean;
174
+ emitHighlightTokens?: boolean;
175
+ emitDiffBlocks?: boolean;
150
176
  mdxComponentNames?: string[];
151
177
  lazyTokenization?: {
152
178
  enabled?: boolean;
@@ -397,4 +423,4 @@ interface CoalescingMetrics {
397
423
  insertChildCoalesced: number;
398
424
  }
399
425
 
400
- export { type ASTInlinePlugin, type Block, type CoalescingMetrics, type CodeHighlightOutputMode, type CodeHighlightingMode, type CompiledMdxModule, type DiffKind, type FormatAnticipationConfig, type InlineHtmlDescriptor, type InlineNode, type InlinePlugin, LANGUAGE_ALIASES, type LazyTokenizationPriority, type MixedContentSegment, type NodePath, type NodeSnapshot, PATCH_ROOT_ID, type Patch, type PatchMetrics, type PerformanceMetrics, type ProtectedRange, type ProtectedRangeKind, type RegexAnticipationPattern, type RegexInlinePlugin, type SetPropsBatchEntry, type TokenLineV1, type TokenSpan, type TokenStyle, type WorkerErrorPayload, type WorkerIn, type WorkerOut, type WorkerPhase };
426
+ export { type ASTInlinePlugin, type Block, type CoalescingMetrics, type CodeHighlightOutputMode, type CodeHighlightingMode, type CompiledMdxModule, type DiffBlock, type DiffKind, type DiffLine, type DiffLineKind, type FormatAnticipationConfig, type InlineHtmlDescriptor, type InlineNode, type InlinePlugin, LANGUAGE_ALIASES, type LazyTokenizationPriority, type MixedContentSegment, type NodePath, type NodeSnapshot, PATCH_ROOT_ID, type Patch, type PatchMetrics, type PerformanceMetrics, type ProtectedRange, type ProtectedRangeKind, type RegexAnticipationPattern, type RegexInlinePlugin, type SetPropsBatchEntry, type ThemedLine, type ThemedToken, type TokenLineV1, type TokenSpan, type TokenStyle, type WorkerErrorPayload, type WorkerIn, type WorkerOut, type WorkerPhase };
package/dist/types.d.ts CHANGED
@@ -128,6 +128,29 @@ type TokenLineV1 = {
128
128
  spans: TokenSpan[];
129
129
  };
130
130
  type DiffKind = "add" | "remove" | "context" | "hunk" | "meta";
131
+ type DiffLineKind = "meta" | "hunk" | "add" | "del" | "context";
132
+ type ThemedToken = {
133
+ content: string;
134
+ color?: string | null;
135
+ fontStyle?: number | null;
136
+ };
137
+ type ThemedLine = ThemedToken[];
138
+ type DiffLine = {
139
+ kind: DiffLineKind;
140
+ oldNo?: number | null;
141
+ newNo?: number | null;
142
+ raw: string;
143
+ tokens?: ThemedLine | null;
144
+ };
145
+ type DiffBlock = {
146
+ kind: "diff";
147
+ filePath?: string | null;
148
+ language?: string | null;
149
+ lines: DiffLine[];
150
+ additions?: number | null;
151
+ deletions?: number | null;
152
+ unified?: string | null;
153
+ };
131
154
  type LazyTokenizationPriority = "visible" | "prefetch";
132
155
  /**
133
156
  * Worker communication protocol
@@ -147,6 +170,9 @@ type WorkerIn = {
147
170
  codeHighlighting?: CodeHighlightingMode;
148
171
  outputMode?: CodeHighlightOutputMode;
149
172
  liveCodeHighlighting?: boolean;
173
+ liveTokenization?: boolean;
174
+ emitHighlightTokens?: boolean;
175
+ emitDiffBlocks?: boolean;
150
176
  mdxComponentNames?: string[];
151
177
  lazyTokenization?: {
152
178
  enabled?: boolean;
@@ -397,4 +423,4 @@ interface CoalescingMetrics {
397
423
  insertChildCoalesced: number;
398
424
  }
399
425
 
400
- export { type ASTInlinePlugin, type Block, type CoalescingMetrics, type CodeHighlightOutputMode, type CodeHighlightingMode, type CompiledMdxModule, type DiffKind, type FormatAnticipationConfig, type InlineHtmlDescriptor, type InlineNode, type InlinePlugin, LANGUAGE_ALIASES, type LazyTokenizationPriority, type MixedContentSegment, type NodePath, type NodeSnapshot, PATCH_ROOT_ID, type Patch, type PatchMetrics, type PerformanceMetrics, type ProtectedRange, type ProtectedRangeKind, type RegexAnticipationPattern, type RegexInlinePlugin, type SetPropsBatchEntry, type TokenLineV1, type TokenSpan, type TokenStyle, type WorkerErrorPayload, type WorkerIn, type WorkerOut, type WorkerPhase };
426
+ export { type ASTInlinePlugin, type Block, type CoalescingMetrics, type CodeHighlightOutputMode, type CodeHighlightingMode, type CompiledMdxModule, type DiffBlock, type DiffKind, type DiffLine, type DiffLineKind, type FormatAnticipationConfig, type InlineHtmlDescriptor, type InlineNode, type InlinePlugin, LANGUAGE_ALIASES, type LazyTokenizationPriority, type MixedContentSegment, type NodePath, type NodeSnapshot, PATCH_ROOT_ID, type Patch, type PatchMetrics, type PerformanceMetrics, type ProtectedRange, type ProtectedRangeKind, type RegexAnticipationPattern, type RegexInlinePlugin, type SetPropsBatchEntry, type ThemedLine, type ThemedToken, type TokenLineV1, type TokenSpan, type TokenStyle, type WorkerErrorPayload, type WorkerIn, type WorkerOut, type WorkerPhase };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-mdx/core",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Core types, snapshot utilities, and perf helpers for the Streaming Markdown V2 stack",
5
5
  "license": "MIT",
6
6
  "repository": {