@mdsvex/render 0.0.0 → 1.0.0-next.1

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/index.js ADDED
@@ -0,0 +1,33 @@
1
+ import { CursorHTMLRenderer as o, K_FRONTMATTER as r, K_HTML as t, K_IMPORT_STATEMENT as T, K_LINE_BREAK as p, K_ROOT as s, K_TEXT as n, NONE as E, _children as d, _emit as i, _node as m, _out_offsets as R, _resolve_mappings as a, escape as f } from "./html_cursor.js";
2
+ import { ComponentRenderer as c } from "./component.js";
3
+ import { CI_CODE as I, CI_STRUCTURE as M, CI_SVELTE as O, CI_TEXT as l, MapSink as N } from "./mappings.js";
4
+ import { build_line_starts as v, mapped_source_lines as x, mappings_to_v3 as L, offset_to_position as S, records_to_v3 as A, trace_to_decoded as g, trace_to_v3 as H } from "./sourcemap.js";
5
+ export {
6
+ I as CI_CODE,
7
+ M as CI_STRUCTURE,
8
+ O as CI_SVELTE,
9
+ l as CI_TEXT,
10
+ c as ComponentRenderer,
11
+ o as CursorHTMLRenderer,
12
+ r as K_FRONTMATTER,
13
+ t as K_HTML,
14
+ T as K_IMPORT_STATEMENT,
15
+ p as K_LINE_BREAK,
16
+ s as K_ROOT,
17
+ n as K_TEXT,
18
+ N as MapSink,
19
+ E as NONE,
20
+ d as _children,
21
+ i as _emit,
22
+ m as _node,
23
+ R as _out_offsets,
24
+ a as _resolve_mappings,
25
+ v as build_line_starts,
26
+ f as escape,
27
+ x as mapped_source_lines,
28
+ L as mappings_to_v3,
29
+ S as offset_to_position,
30
+ A as records_to_v3,
31
+ g as trace_to_decoded,
32
+ H as trace_to_v3
33
+ };
@@ -0,0 +1,166 @@
1
+ const O = {
2
+ verification: !0,
3
+ semantic: !0,
4
+ navigation: !0
5
+ }, S = {
6
+ semantic: !0,
7
+ navigation: !0
8
+ }, T = {
9
+ verification: !0,
10
+ completion: !0,
11
+ semantic: !0,
12
+ navigation: !0,
13
+ structure: !0,
14
+ format: !0
15
+ }, m = {
16
+ structure: !0
17
+ };
18
+ function _(e, t) {
19
+ return {
20
+ verification: !0,
21
+ semantic: !0,
22
+ navigation: !0,
23
+ nodeIndex: e,
24
+ role: t
25
+ };
26
+ }
27
+ function h(e, t) {
28
+ return { semantic: !0, navigation: !0, nodeIndex: e, role: t };
29
+ }
30
+ function g(e, t) {
31
+ return {
32
+ verification: !0,
33
+ completion: !0,
34
+ semantic: !0,
35
+ navigation: !0,
36
+ structure: !0,
37
+ format: !0,
38
+ nodeIndex: e,
39
+ role: t
40
+ };
41
+ }
42
+ function l(e, t) {
43
+ return { structure: !0, nodeIndex: e, role: t };
44
+ }
45
+ const v = _, R = h, p = g, N = l, C = 0, A = 1, x = 2, P = 3, L = 0, w = 1, U = 2, M = 3;
46
+ function X(e, t) {
47
+ return e << 2 | t;
48
+ }
49
+ const i = 6, f = [
50
+ "node",
51
+ "content",
52
+ "open_syntax",
53
+ "close_syntax"
54
+ ];
55
+ function E(e, t) {
56
+ const n = f[e & 3];
57
+ switch (e >> 2) {
58
+ case 0:
59
+ return _(t, n);
60
+ case 1:
61
+ return h(t, n);
62
+ case 2:
63
+ return g(t, n);
64
+ default:
65
+ return l(t, n);
66
+ }
67
+ }
68
+ class y {
69
+ constructor(t, n, s, a, r, d) {
70
+ this._source = t, this._generated = n, this._length = s, this._generated_length = a, this._key = r, this._arrays = d;
71
+ }
72
+ get sourceOffsets() {
73
+ const t = this._arrays;
74
+ return t === null ? [this._source] : t.sourceOffsets;
75
+ }
76
+ get generatedOffsets() {
77
+ const t = this._arrays;
78
+ return t === null ? [this._generated] : t.generatedOffsets;
79
+ }
80
+ get lengths() {
81
+ const t = this._arrays;
82
+ return t === null ? [this._length] : t.lengths;
83
+ }
84
+ get generatedLengths() {
85
+ const t = this._arrays;
86
+ if (t !== null) return t.generatedLengths;
87
+ const n = this._generated_length;
88
+ return n === this._length ? void 0 : [n];
89
+ }
90
+ get data() {
91
+ return c(this._key);
92
+ }
93
+ /** keys in the order a plain literal had them */
94
+ toJSON() {
95
+ const t = this._arrays;
96
+ if (t !== null) return t;
97
+ const n = {
98
+ sourceOffsets: [this._source],
99
+ generatedOffsets: [this._generated],
100
+ lengths: [this._length],
101
+ data: c(this._key)
102
+ };
103
+ return this._generated_length !== this._length && (n.generatedLengths = [this._generated_length]), n;
104
+ }
105
+ }
106
+ function c(e) {
107
+ const t = e & 15;
108
+ return E(t, (e - t) / 16 - 1);
109
+ }
110
+ const o = 1 << 20;
111
+ function k(e, t) {
112
+ const n = t / i, s = new Array(
113
+ n < o ? n : o
114
+ );
115
+ let a = 0;
116
+ for (let r = 0; r < t; r += i)
117
+ s[a++] = new y(
118
+ e[r + 2],
119
+ e[r],
120
+ e[r + 3],
121
+ e[r + 1],
122
+ ((e[r + 4] | 0) + 1) * 16 + e[r + 5],
123
+ null
124
+ );
125
+ return s;
126
+ }
127
+ const I = 1 << 20, u = i * 256;
128
+ class D {
129
+ constructor() {
130
+ this.rec = new Uint32Array(u), this.n = 0, this.syntax = !0;
131
+ }
132
+ grow() {
133
+ const t = new Uint32Array(this.rec.length * 2);
134
+ return t.set(this.rec.subarray(0, this.n)), this.rec = t, t;
135
+ }
136
+ begin(t) {
137
+ this.n = 0, this.syntax = t;
138
+ }
139
+ release() {
140
+ this.n = 0, this.rec.length > I && (this.rec = new Uint32Array(u));
141
+ }
142
+ }
143
+ export {
144
+ S as CI_CODE,
145
+ m as CI_STRUCTURE,
146
+ T as CI_SVELTE,
147
+ O as CI_TEXT,
148
+ D as MapSink,
149
+ A as P_CODE,
150
+ P as P_STRUCTURE,
151
+ x as P_SVELTE,
152
+ C as P_TEXT,
153
+ i as RECORD_SIZE,
154
+ M as R_CLOSE_SYNTAX,
155
+ w as R_CONTENT,
156
+ L as R_NODE,
157
+ U as R_OPEN_SYNTAX,
158
+ y as RecordMapping,
159
+ R as data_code,
160
+ N as data_structure,
161
+ p as data_svelte,
162
+ v as data_text,
163
+ X as record_code,
164
+ E as record_data,
165
+ k as record_mappings
166
+ };