@mdsvex/render 1.0.0-next.1 → 1.0.0-next.2

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.
@@ -0,0 +1,9 @@
1
+ export { CursorHTMLRenderer } from './html_cursor.js';
2
+ export type { CursorBlockEntry, TemplateWrapper, CodeHighlighter, HighlightedBlock, HighlightedCode, HighlightWarningCode, PreMeta, SmartPunctuation, SmartPunctuationOptions, SmartQuotes, } from './html_cursor.js';
3
+ export { _emit, _node, _children, _resolve_mappings, _out_offsets, MapSink, escape, NONE, K_ROOT, K_TEXT, K_HTML, K_LINE_BREAK, K_FRONTMATTER, K_IMPORT_STATEMENT, } from './html_cursor.js';
4
+ export { ComponentRenderer } from './component.js';
5
+ export type { ComponentBlock } from './component.js';
6
+ export { CI_TEXT, CI_CODE, CI_SVELTE, CI_STRUCTURE } from './mappings.js';
7
+ export type { Mapping, CodeInformation, MappingRole, MappingData, } from './mappings.js';
8
+ export { build_line_starts, offset_to_position, mappings_to_v3, records_to_v3, trace_to_v3, trace_to_decoded, mapped_source_lines, } from './sourcemap.js';
9
+ export type { SourceMapV3, MapTrace, DecodedSegment, DecodedSourceMapV3, } from './sourcemap.js';
@@ -0,0 +1,117 @@
1
+ /**
2
+ * volar-compatible source mapping types.
3
+ *
4
+ * structurally compatible with @volar/source-map Mapping and
5
+ * @volar/language-core CodeInformation, no runtime dependency.
6
+ */
7
+ export interface Mapping<Data = unknown> {
8
+ sourceOffsets: number[];
9
+ generatedOffsets: number[];
10
+ lengths: number[];
11
+ generatedLengths?: number[];
12
+ data: Data;
13
+ }
14
+ export interface CodeInformation {
15
+ verification?: boolean | {
16
+ shouldReport?(source: string | undefined, code: string | number | undefined): boolean;
17
+ };
18
+ completion?: boolean | {
19
+ isAdditional?: boolean;
20
+ onlyImport?: boolean;
21
+ };
22
+ semantic?: boolean | {
23
+ shouldHighlight?(): boolean;
24
+ };
25
+ navigation?: boolean | {
26
+ shouldRename?(): boolean;
27
+ resolveRenameNewName?(newName: string): string;
28
+ resolveRenameEditText?(newText: string): string;
29
+ };
30
+ structure?: boolean;
31
+ format?: boolean;
32
+ }
33
+ /** text content: verification, semantic, navigation. */
34
+ export declare const CI_TEXT: CodeInformation;
35
+ /** code content (code spans, fences): semantic + navigation only. */
36
+ export declare const CI_CODE: CodeInformation;
37
+ /** svelte expressions: full capabilities. */
38
+ export declare const CI_SVELTE: CodeInformation;
39
+ /** generated structural elements: structure only. */
40
+ export declare const CI_STRUCTURE: CodeInformation;
41
+ export type MappingRole = 'node' | 'content' | 'open_syntax' | 'close_syntax';
42
+ export interface MappingData extends CodeInformation {
43
+ /** node buffer index: stable, monotonic in document order. */
44
+ nodeIndex: number;
45
+ /** what this mapping represents within the node. */
46
+ role: MappingRole;
47
+ }
48
+ declare function text_data(node_index: number, role: MappingRole): MappingData;
49
+ declare function code_data(node_index: number, role: MappingRole): MappingData;
50
+ declare function svelte_data(node_index: number, role: MappingRole): MappingData;
51
+ declare function structure_data(node_index: number, role: MappingRole): MappingData;
52
+ export declare const data_text: typeof text_data;
53
+ export declare const data_code: typeof code_data;
54
+ export declare const data_svelte: typeof svelte_data;
55
+ export declare const data_structure: typeof structure_data;
56
+ declare const enum Preset {
57
+ TEXT = 0,
58
+ CODE = 1,
59
+ SVELTE = 2,
60
+ STRUCTURE = 3
61
+ }
62
+ /** data preset, packed into a record code with the role */
63
+ export declare const P_TEXT = Preset.TEXT;
64
+ export declare const P_CODE = Preset.CODE;
65
+ export declare const P_SVELTE = Preset.SVELTE;
66
+ export declare const P_STRUCTURE = Preset.STRUCTURE;
67
+ export declare const R_NODE = 0;
68
+ export declare const R_CONTENT = 1;
69
+ export declare const R_OPEN_SYNTAX = 2;
70
+ export declare const R_CLOSE_SYNTAX = 3;
71
+ export declare function record_code(preset: number, role: number): number;
72
+ /**
73
+ * words per record, out index, out chunk count, source offset, source length,
74
+ * node index stored as uint32 and read back signed, and code
75
+ */
76
+ export declare const RECORD_SIZE = 6;
77
+ /** built exactly as the presets build it */
78
+ export declare function record_data(code: number, node_index: number): MappingData;
79
+ /**
80
+ * builds its arrays and data on each read, so a resolved document keeps one
81
+ * object per piece rather than four arrays and a data object
82
+ */
83
+ export declare class RecordMapping implements Mapping<MappingData> {
84
+ _source: number;
85
+ _generated: number;
86
+ _length: number;
87
+ _generated_length: number;
88
+ /** 16 * node index + 16 + record code */
89
+ _key: number;
90
+ /** the arrays of a mapping that is not one plain piece, held as given */
91
+ _arrays: Mapping<MappingData> | null;
92
+ constructor(source: number, generated: number, length: number, generated_length: number, key: number, arrays: Mapping<MappingData> | null);
93
+ get sourceOffsets(): number[];
94
+ get generatedOffsets(): number[];
95
+ get lengths(): number[];
96
+ get generatedLengths(): number[] | undefined;
97
+ get data(): MappingData;
98
+ /** keys in the order a plain literal had them */
99
+ toJSON(): Mapping<MappingData>;
100
+ }
101
+ export declare function record_mappings(rec: Uint32Array, n: number): Mapping<MappingData>[];
102
+ /**
103
+ * pending mappings as flat records until generated offsets are known, a typed
104
+ * buffer rather than objects since a walk pushes several per node
105
+ * @internal
106
+ */
107
+ export declare class MapSink {
108
+ rec: Uint32Array;
109
+ /** words used, a multiple of RECORD_SIZE */
110
+ n: number;
111
+ /** false drops syntax records, which a v3 map skips */
112
+ syntax: boolean;
113
+ grow(): Uint32Array;
114
+ begin(syntax: boolean): void;
115
+ release(): void;
116
+ }
117
+ export {};
@@ -0,0 +1,52 @@
1
+ /**
2
+ * a scope maps element names to imported components and chains to a parent,
3
+ * closest first, so a template or nested scope can chain in front of the root
4
+ */
5
+ /** one replacement, imported as name as local from specifier */
6
+ export interface ComponentImport {
7
+ /** the element name, also the export name */
8
+ readonly name: string;
9
+ readonly specifier: string;
10
+ /** generated local binding, internal and never api */
11
+ readonly local: string;
12
+ }
13
+ /** an element component_mode all keeps because a component can not take its directive */
14
+ export interface ReplaceWarning {
15
+ readonly tag: string;
16
+ /** the first directive it carries, such as bind:value */
17
+ readonly directive: string;
18
+ /** offset of the element in the source */
19
+ readonly start: number;
20
+ }
21
+ export interface ComponentSource {
22
+ /** emitted verbatim as an import specifier */
23
+ specifier: string;
24
+ /** the export names of the module */
25
+ names: string[];
26
+ }
27
+ export declare class ComponentScope {
28
+ readonly parent: ComponentScope | null;
29
+ /** names added here and in every parent */
30
+ readonly size: number;
31
+ private readonly own;
32
+ private readonly locals;
33
+ /**
34
+ * sources are lowest precedence first so a later one replaces a name,
35
+ * suffix keeps the locals of different scopes apart
36
+ */
37
+ constructor(sources: readonly ComponentSource[], suffix: string, parent?: ComponentScope | null);
38
+ /** the replacement for an element name, closest scope first */
39
+ get(name: string): ComponentImport | undefined;
40
+ private local_for;
41
+ }
42
+ /** a default import, a template the document is wrapped in */
43
+ export interface DefaultImport {
44
+ readonly specifier: string;
45
+ readonly local: string;
46
+ }
47
+ /**
48
+ * one statement per module and one named import per replacement in first use
49
+ * order, never a namespace import so unused components shake out, a default
50
+ * import comes first and shares the statement of its module
51
+ */
52
+ export declare function component_imports(used: readonly ComponentImport[], main?: DefaultImport): string;
@@ -0,0 +1,108 @@
1
+ /**
2
+ * sourcemap utilities: line-starts, offset to position, vlq, v3 conversion.
3
+ */
4
+ import type { Mapping, MappingData, MapSink } from './mappings.js';
5
+ /** build an array of byte offsets where each line begins. line 0 starts at 0. */
6
+ export declare function build_line_starts(source: string): Uint32Array;
7
+ /** convert a byte offset to [line, column] using a precomputed line_starts table. */
8
+ export declare function offset_to_position(line_starts: Uint32Array, offset: number): [line: number, col: number];
9
+ export interface SourceMapV3 {
10
+ version: 3;
11
+ file?: string;
12
+ sources: string[];
13
+ sourcesContent: (string | null)[];
14
+ names: string[];
15
+ mappings: string;
16
+ }
17
+ /**
18
+ * trace records as Rec records encode, dropping what the encoding skips
19
+ * @internal
20
+ */
21
+ export declare function trace_of_records(rec: Uint32Array, n: number): Uint32Array;
22
+ /**
23
+ * convert Mapping<MappingData>[] to a v3 sourcemap.
24
+ *
25
+ * emits content spans (for cursor placement) and node span start anchors
26
+ * (for block identification). skips open_syntax and close_syntax to avoid
27
+ * overlapping ranges that cause nondeterministic cursor jumps in devtools.
28
+ */
29
+ export declare function mappings_to_v3(mappings: Mapping<MappingData>[], source: string, generated: string, file?: string): SourceMapV3;
30
+ /** @internal equals mappings_to_v3 over the Mapping objects the records resolve to */
31
+ export declare function records_to_v3(sink: MapSink, offsets: Uint32Array | null, source: string, generated: string, file?: string): SourceMapV3;
32
+ /**
33
+ * records counted in out chunks as records of generated offsets, offsets holds
34
+ * the offset of each chunk then the end
35
+ * @internal
36
+ */
37
+ export declare function records_by_offset(rec: Uint32Array, n: number, offsets: Uint32Array): Uint32Array;
38
+ export declare function map_basename(file?: string): string;
39
+ /** @internal trace_to_v3 over the trace records of a sink */
40
+ export declare function trace_records_to_v3(sink: MapSink, source: string, generated: string, file?: string): SourceMapV3;
41
+ /**
42
+ * a render copied out of the shared buffers to build its map later, records
43
+ * of generated offsets from start to split, buf may hold other traces
44
+ */
45
+ export interface MapTrace {
46
+ buf: Uint32Array;
47
+ start: number;
48
+ split: number;
49
+ end: number;
50
+ }
51
+ export declare function reserve_trace(rec_words: number, offset_words: number, out: MapTrace): MapTrace;
52
+ /**
53
+ * the slab with at least words free from trace_free_at, for records written
54
+ * in place
55
+ */
56
+ export declare function trace_room(words: number): Uint32Array;
57
+ export declare function trace_free_at(): number;
58
+ /** out as the trace of words start to end written in place into buf */
59
+ export declare function trace_take(buf: Uint32Array, start: number, end: number, out: MapTrace): void;
60
+ /** @internal */
61
+ export declare function trace_to_v3(trace: MapTrace, source: string, generated: string, file?: string): SourceMapV3;
62
+ export type DecodedSegment = [
63
+ gen_col: number,
64
+ source: number,
65
+ src_line: number,
66
+ src_col: number
67
+ ];
68
+ export interface DecodedSourceMapV3 {
69
+ version: 3;
70
+ file?: string;
71
+ sources: string[];
72
+ sourcesContent: (string | null)[];
73
+ names: string[];
74
+ mappings: DecodedSegment[][];
75
+ }
76
+ /**
77
+ * only the listed generated lines hold segments, each equal to that line of
78
+ * the decoded trace_to_v3 map, so lookups on them match the full map
79
+ * @internal
80
+ */
81
+ export declare function trace_to_decoded(trace: MapTrace, source: string, generated: string, lines: ArrayLike<number>, file?: string): DecodedSourceMapV3;
82
+ /**
83
+ * source lines of v3 mappings, unordered with repeats, null when a segment is
84
+ * one decoders read differently or names another source
85
+ * @internal
86
+ */
87
+ export declare function mapped_source_lines(mappings: string | readonly (readonly number[])[][]): number[] | null;
88
+ /** the chained mappings as ascii bytes */
89
+ export interface ChainedMappings {
90
+ /** the mappings run from start for length bytes */
91
+ bytes: Uint8Array;
92
+ start: number;
93
+ length: number;
94
+ /** names in first use order, null for none */
95
+ names: string[] | null;
96
+ /** whether any segment reached the source, then it is the only source */
97
+ sourced: boolean;
98
+ }
99
+ /**
100
+ * chains a compile map from the html onto the map of the html in trace, the
101
+ * mappings and names equal @ampproject/remapping of [compile, trace_to_v3],
102
+ * null when the compile mappings are ones it leaves to remapping, the next
103
+ * call reuses the bytes, source_normalized means source holds no \r, the
104
+ * mappings go into dest from dest_start unless they outgrow it, keeping the
105
+ * bytes before dest_start, mappings_bytes is the utf8 of compile_mappings
106
+ * @internal
107
+ */
108
+ export declare function chain_trace(compile_mappings: string, compile_names: readonly string[], trace: MapTrace, source: string, generated: string, source_normalized?: boolean, dest?: Uint8Array | null, dest_start?: number, mappings_bytes?: Uint8Array | null, mappings_length?: number): ChainedMappings | null;
@@ -0,0 +1,87 @@
1
+ /**
2
+ * what a streaming view needs from plugins, what they wrote, live, for the
3
+ * components that read it, and the nodes their deferred work changed
4
+ *
5
+ * const stream = new PluginStream({ plugins });
6
+ * stream.renderers.push(renderer);
7
+ * stream.on_change(() => renderer.update(stream.buffer, ''));
8
+ * for await (const batch of batches) stream.apply(batch);
9
+ * await stream.end();
10
+ *
11
+ * a component reads the data from the context under PLUGIN_DATA, which a
12
+ * compiled document sets too, so it reads the same in a stream and a compile
13
+ */
14
+ import { PluginDispatcher } from '@mdsvex/parse';
15
+ import type { DataChange, DirectiveTable, HeadingIds, ParsePlugin, PluginDocument } from '@mdsvex/parse';
16
+ import type { NodeBuffer } from '@mdsvex/parse/utils';
17
+ import { WireTreeBuilder } from '@mdsvex/parse/wire-tree-builder';
18
+ /** the context key of what plugins wrote, the same in every copy of this module */
19
+ export declare const PLUGIN_DATA: unique symbol;
20
+ /** what plugins wrote, by plugin name, undefined while none wrote anything */
21
+ export type PluginDataValue = Readonly<Record<string, Readonly<Record<string, unknown>>>>;
22
+ /** the value under PLUGIN_DATA, current is read again as it changes */
23
+ export interface PluginDataContext {
24
+ readonly current: PluginDataValue | undefined;
25
+ }
26
+ /**
27
+ * what plugins wrote, followed through on_data, current is a new object after
28
+ * each change, read in a component or an effect it runs again when that comes
29
+ */
30
+ export declare class LiveData implements PluginDataContext {
31
+ #private;
32
+ get current(): PluginDataValue | undefined;
33
+ /** the value of a key after a change, undefined once it holds nothing */
34
+ change({ plugin, key, value }: DataChange): void;
35
+ /** follows a dispatcher, returns what stops it */
36
+ follow(dispatcher: PluginDispatcher): () => void;
37
+ /** nothing written, for the next document */
38
+ reset(): void;
39
+ }
40
+ /** a renderer that caches blocks, a patched node renders its block again */
41
+ export interface PatchedBlocks {
42
+ invalidate(buf: NodeBuffer, nodes: readonly number[]): void;
43
+ }
44
+ export interface PluginStreamOptions {
45
+ plugins?: ParsePlugin[];
46
+ directive_handlers?: DirectiveTable[];
47
+ /** makes the id of each heading as it arrives, make_heading_ids in mdsvex */
48
+ headings?: HeadingIds;
49
+ /** what the handlers learn about the document, see set_document */
50
+ document?: PluginDocument;
51
+ }
52
+ /**
53
+ * a document arriving over the wire with its plugins, the builder, the
54
+ * dispatcher, the data as it changes, and the nodes deferred tasks patch
55
+ */
56
+ export declare class PluginStream {
57
+ readonly builder: WireTreeBuilder;
58
+ /** null for a stream with no plugin */
59
+ readonly dispatcher: PluginDispatcher | null;
60
+ /** what plugins wrote, for the components that read it */
61
+ readonly data: LiveData;
62
+ /** renderers whose cached blocks a patch drops */
63
+ readonly renderers: PatchedBlocks[];
64
+ private listeners;
65
+ private stops;
66
+ private ended;
67
+ constructor(options?: PluginStreamOptions);
68
+ /** the buffer the builder fills */
69
+ get buffer(): NodeBuffer;
70
+ /** a batch of the wire, then the deferred work that is ready */
71
+ apply(batch: unknown[][]): void;
72
+ /**
73
+ * the stream ended, after finish of the parser, runs the sequential passes,
74
+ * waits for the deferred tasks still running, then runs the document hooks,
75
+ * a promise when any of that waits, every block renders again after it
76
+ */
77
+ end(): Promise<void> | undefined;
78
+ /** applies the deferred tasks that are ready, true when one patched a node */
79
+ patch(): boolean;
80
+ /** listener runs after each batch and each patch, so a view renders again */
81
+ on_change(listener: () => void): () => void;
82
+ /** stops following the dispatcher, a task still running applies nowhere */
83
+ stop(): void;
84
+ /** the whole tree may have changed, every block renders again */
85
+ private everything;
86
+ private changed;
87
+ }
package/dist/stream.js ADDED
@@ -0,0 +1,123 @@
1
+ var g = (i) => {
2
+ throw TypeError(i);
3
+ };
4
+ var b = (i, e, t) => e.has(i) || g("Cannot " + t);
5
+ var d = (i, e, t) => (b(i, e, "read from private field"), t ? t.call(i) : e.get(i)), u = (i, e, t) => e.has(i) ? g("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), l = (i, e, t, s) => (b(i, e, "write to private field"), s ? s.call(i, t) : e.set(i, t), t);
6
+ import { PluginDispatcher as v, WireTextSource as _ } from "@mdsvex/parse";
7
+ import { WireTreeBuilder as m } from "@mdsvex/parse/wire-tree-builder";
8
+ import { createSubscriber as w } from "svelte/reactivity";
9
+ const y = 4294967295, P = Symbol.for(
10
+ "mdsvex.plugin_data"
11
+ );
12
+ var r, o, f;
13
+ class x {
14
+ constructor() {
15
+ u(this, r);
16
+ u(this, o, null);
17
+ u(this, f, w((e) => (l(this, o, e), () => {
18
+ l(this, o, null);
19
+ })));
20
+ }
21
+ get current() {
22
+ return d(this, f).call(this), d(this, r);
23
+ }
24
+ /** the value of a key after a change, undefined once it holds nothing */
25
+ change({ plugin: e, key: t, value: s }) {
26
+ var p;
27
+ const n = d(this, r), c = { ...n == null ? void 0 : n[e] };
28
+ s === void 0 ? delete c[t] : c[t] = s;
29
+ const a = { ...n };
30
+ Object.keys(c).length === 0 ? delete a[e] : a[e] = c, l(this, r, Object.keys(a).length === 0 ? void 0 : a), (p = d(this, o)) == null || p.call(this);
31
+ }
32
+ /** follows a dispatcher, returns what stops it */
33
+ follow(e) {
34
+ return e.on_data((t) => this.change(t));
35
+ }
36
+ /** nothing written, for the next document */
37
+ reset() {
38
+ var e;
39
+ d(this, r) !== void 0 && (l(this, r, void 0), (e = d(this, o)) == null || e.call(this));
40
+ }
41
+ }
42
+ r = new WeakMap(), o = new WeakMap(), f = new WeakMap();
43
+ class T {
44
+ constructor(e = {}) {
45
+ this.data = new x(), this.renderers = [], this.listeners = [], this.stops = [], this.ended = !1;
46
+ const { plugins: t, directive_handlers: s } = e, h = t !== void 0 && t.length > 0 || s !== void 0 && s.length > 0 ? new v(
47
+ t,
48
+ new _([]),
49
+ s
50
+ ) : null;
51
+ this.dispatcher = h, this.builder = new m(128, h ?? void 0), e.headings !== void 0 && this.builder.set_headings(e.headings), h !== null && (h.set_document(e.document), this.stops.push(
52
+ this.data.follow(h),
53
+ // a task that settled applies at once, and its node renders again
54
+ h.on_settled(() => {
55
+ this.patch() && this.changed();
56
+ })
57
+ ));
58
+ }
59
+ /** the buffer the builder fills */
60
+ get buffer() {
61
+ return this.builder.get_buffer();
62
+ }
63
+ /** a batch of the wire, then the deferred work that is ready */
64
+ apply(e) {
65
+ this.builder.apply(e), this.patch(), this.changed();
66
+ }
67
+ /**
68
+ * the stream ended, after finish of the parser, runs the sequential passes,
69
+ * waits for the deferred tasks still running, then runs the document hooks,
70
+ * a promise when any of that waits, every block renders again after it
71
+ */
72
+ end() {
73
+ if (this.ended) return;
74
+ this.ended = !0, this.builder.end();
75
+ const e = this.dispatcher;
76
+ if (e === null) return;
77
+ const t = this.buffer;
78
+ e.run_sequential(t);
79
+ const s = e.finish(t);
80
+ if (this.everything(), s !== void 0)
81
+ return s.then(() => this.everything());
82
+ }
83
+ /** applies the deferred tasks that are ready, true when one patched a node */
84
+ patch() {
85
+ const e = this.dispatcher;
86
+ if (e === null) return !1;
87
+ const t = e.apply_ready();
88
+ if (t === null) return !1;
89
+ const s = this.buffer;
90
+ for (const n of this.renderers) n.invalidate(s, t);
91
+ return !0;
92
+ }
93
+ /** listener runs after each batch and each patch, so a view renders again */
94
+ on_change(e) {
95
+ return this.listeners.push(e), () => {
96
+ const t = this.listeners.indexOf(e);
97
+ t !== -1 && this.listeners.splice(t, 1);
98
+ };
99
+ }
100
+ /** stops following the dispatcher, a task still running applies nowhere */
101
+ stop() {
102
+ for (const e of this.stops) e();
103
+ this.stops.length = 0, this.listeners.length = 0;
104
+ }
105
+ /** the whole tree may have changed, every block renders again */
106
+ everything() {
107
+ const e = this.buffer, t = [];
108
+ let s = e.first_child_at(0);
109
+ for (; s !== y && e.parent_at(s) === 0; )
110
+ t.push(s), s = e.next_at(s);
111
+ if (t.length !== 0)
112
+ for (const n of this.renderers) n.invalidate(e, t);
113
+ this.changed();
114
+ }
115
+ changed() {
116
+ for (const e of this.listeners.slice()) e();
117
+ }
118
+ }
119
+ export {
120
+ x as LiveData,
121
+ P as PLUGIN_DATA,
122
+ T as PluginStream
123
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdsvex/render",
3
- "version": "1.0.0-next.1",
3
+ "version": "1.0.0-next.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/pngwn/MDsveX.git",
@@ -8,26 +8,34 @@
8
8
  },
9
9
  "description": "Renderers for the PFM parser wire format",
10
10
  "type": "module",
11
+ "files": [
12
+ "dist",
13
+ "src"
14
+ ],
11
15
  "exports": {
12
16
  ".": {
13
- "import": "./dist/index.js",
14
- "types": "./src/index.ts"
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.js"
15
19
  },
16
20
  "./html-cursor": {
17
- "import": "./dist/html_cursor.js",
18
- "types": "./src/html_cursor.ts"
21
+ "types": "./dist/html_cursor.d.ts",
22
+ "import": "./dist/html_cursor.js"
19
23
  },
20
24
  "./component": {
21
- "import": "./dist/component.js",
22
- "types": "./src/component.ts"
25
+ "types": "./dist/component.d.ts",
26
+ "import": "./dist/component.js"
23
27
  },
24
28
  "./mappings": {
25
- "import": "./dist/mappings.js",
26
- "types": "./src/mappings.ts"
29
+ "types": "./dist/mappings.d.ts",
30
+ "import": "./dist/mappings.js"
27
31
  },
28
32
  "./sourcemap": {
29
- "import": "./dist/sourcemap.js",
30
- "types": "./src/sourcemap.ts"
33
+ "types": "./dist/sourcemap.d.ts",
34
+ "import": "./dist/sourcemap.js"
35
+ },
36
+ "./stream": {
37
+ "types": "./dist/stream.d.ts",
38
+ "import": "./dist/stream.js"
31
39
  },
32
40
  "./Node.svelte": {
33
41
  "types": "./src/Node.svelte",
@@ -36,7 +44,7 @@
36
44
  }
37
45
  },
38
46
  "peerDependencies": {
39
- "svelte": "^5.0.0"
47
+ "svelte": "^5.7.0"
40
48
  },
41
49
  "peerDependenciesMeta": {
42
50
  "svelte": {
@@ -44,13 +52,13 @@
44
52
  }
45
53
  },
46
54
  "dependencies": {
47
- "@mdsvex/parse": "1.0.0-next.1"
55
+ "@mdsvex/parse": "1.0.0-next.2"
48
56
  },
49
57
  "author": "pngwn <hello@pngwn.io>",
50
58
  "license": "MIT",
51
59
  "scripts": {
52
60
  "test": "vitest --disableConsoleIntercept",
53
61
  "test:run": "vitest run --silent",
54
- "build": "vite build --config vite.config.build.ts"
62
+ "build": "vite build --config vite.config.build.ts && tsc --rootDir src --declaration --emitDeclarationOnly --outDir dist"
55
63
  }
56
64
  }