@fuzdev/fuz_ui 0.185.2 → 0.187.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.
Files changed (44) hide show
  1. package/dist/ApiModule.svelte +22 -6
  2. package/dist/ApiModule.svelte.d.ts.map +1 -1
  3. package/dist/DeclarationLink.svelte +1 -1
  4. package/dist/DocsLink.svelte +2 -2
  5. package/dist/DocsTertiaryNav.svelte +2 -2
  6. package/dist/Mdz.svelte +5 -0
  7. package/dist/Mdz.svelte.d.ts +1 -0
  8. package/dist/Mdz.svelte.d.ts.map +1 -1
  9. package/dist/MdzNodeView.svelte +19 -8
  10. package/dist/MdzNodeView.svelte.d.ts +1 -1
  11. package/dist/MdzNodeView.svelte.d.ts.map +1 -1
  12. package/dist/ModuleLink.svelte +1 -1
  13. package/dist/TypeLink.svelte +1 -1
  14. package/dist/library.svelte.d.ts +24 -27
  15. package/dist/library.svelte.d.ts.map +1 -1
  16. package/dist/library.svelte.js +16 -16
  17. package/dist/mdz.d.ts +13 -0
  18. package/dist/mdz.d.ts.map +1 -1
  19. package/dist/mdz.js +73 -280
  20. package/dist/mdz_components.d.ts +12 -0
  21. package/dist/mdz_components.d.ts.map +1 -1
  22. package/dist/mdz_components.js +8 -0
  23. package/dist/mdz_helpers.d.ts +108 -0
  24. package/dist/mdz_helpers.d.ts.map +1 -0
  25. package/dist/mdz_helpers.js +237 -0
  26. package/dist/mdz_lexer.d.ts +93 -0
  27. package/dist/mdz_lexer.d.ts.map +1 -0
  28. package/dist/mdz_lexer.js +727 -0
  29. package/dist/mdz_to_svelte.d.ts +5 -2
  30. package/dist/mdz_to_svelte.d.ts.map +1 -1
  31. package/dist/mdz_to_svelte.js +13 -2
  32. package/dist/mdz_token_parser.d.ts +14 -0
  33. package/dist/mdz_token_parser.d.ts.map +1 -0
  34. package/dist/mdz_token_parser.js +374 -0
  35. package/dist/svelte_preprocess_mdz.js +23 -7
  36. package/package.json +10 -9
  37. package/src/lib/library.svelte.ts +36 -35
  38. package/src/lib/mdz.ts +106 -302
  39. package/src/lib/mdz_components.ts +9 -0
  40. package/src/lib/mdz_helpers.ts +251 -0
  41. package/src/lib/mdz_lexer.ts +1003 -0
  42. package/src/lib/mdz_to_svelte.ts +15 -2
  43. package/src/lib/mdz_token_parser.ts +460 -0
  44. package/src/lib/svelte_preprocess_mdz.ts +23 -7
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Shared constants and pure helper functions for mdz parsers.
3
+ *
4
+ * Used by both the single-pass parser (`mdz.ts`) and the two-phase
5
+ * lexer+parser (`mdz_lexer.ts` + `mdz_token_parser.ts`).
6
+ *
7
+ * @module
8
+ */
9
+ import type { MdzNode, MdzComponentNode, MdzElementNode } from './mdz.js';
10
+ export declare const BACKTICK = 96;
11
+ export declare const ASTERISK = 42;
12
+ export declare const UNDERSCORE = 95;
13
+ export declare const TILDE = 126;
14
+ export declare const NEWLINE = 10;
15
+ export declare const HYPHEN = 45;
16
+ export declare const HASH = 35;
17
+ export declare const SPACE = 32;
18
+ export declare const TAB = 9;
19
+ export declare const LEFT_ANGLE = 60;
20
+ export declare const RIGHT_ANGLE = 62;
21
+ export declare const SLASH = 47;
22
+ export declare const LEFT_BRACKET = 91;
23
+ export declare const RIGHT_BRACKET = 93;
24
+ export declare const LEFT_PAREN = 40;
25
+ export declare const RIGHT_PAREN = 41;
26
+ export declare const COLON = 58;
27
+ export declare const PERIOD = 46;
28
+ export declare const COMMA = 44;
29
+ export declare const SEMICOLON = 59;
30
+ export declare const EXCLAMATION = 33;
31
+ export declare const QUESTION = 63;
32
+ export declare const DOLLAR = 36;
33
+ export declare const PERCENT = 37;
34
+ export declare const AMPERSAND = 38;
35
+ export declare const APOSTROPHE = 39;
36
+ export declare const PLUS = 43;
37
+ export declare const EQUALS = 61;
38
+ export declare const AT = 64;
39
+ export declare const A_UPPER = 65;
40
+ export declare const Z_UPPER = 90;
41
+ export declare const A_LOWER = 97;
42
+ export declare const Z_LOWER = 122;
43
+ export declare const ZERO = 48;
44
+ export declare const NINE = 57;
45
+ export declare const HR_HYPHEN_COUNT = 3;
46
+ export declare const MIN_CODEBLOCK_BACKTICKS = 3;
47
+ export declare const MAX_HEADING_LEVEL = 6;
48
+ export declare const HTTPS_PREFIX_LENGTH = 8;
49
+ export declare const HTTP_PREFIX_LENGTH = 7;
50
+ /**
51
+ * Check if character code is a letter (A-Z, a-z).
52
+ */
53
+ export declare const is_letter: (char_code: number) => boolean;
54
+ /**
55
+ * Check if character code is valid for tag name (letter, number, hyphen, underscore).
56
+ */
57
+ export declare const is_tag_name_char: (char_code: number) => boolean;
58
+ /**
59
+ * Check if character is part of a word for word boundary detection.
60
+ * Used to prevent intraword emphasis with `_` and `~` delimiters.
61
+ *
62
+ * Formatting delimiters (`*`, `_`, `~`) are NOT word characters - they're transparent.
63
+ * Only alphanumeric characters (A-Z, a-z, 0-9) are considered word characters.
64
+ *
65
+ * This prevents false positives with snake_case identifiers while allowing
66
+ * adjacent formatting like `**bold**_italic_`.
67
+ */
68
+ export declare const is_word_char: (char_code: number) => boolean;
69
+ /**
70
+ * Check if character code is valid in URI path per RFC 3986.
71
+ * Validates against the `pchar` production plus path/query/fragment separators.
72
+ *
73
+ * Valid characters:
74
+ * - unreserved: A-Z a-z 0-9 - . _ ~
75
+ * - sub-delims: ! $ & ' ( ) * + , ; =
76
+ * - path allowed: : @
77
+ * - separators: / ? #
78
+ * - percent-encoding: %
79
+ */
80
+ export declare const is_valid_path_char: (char_code: number) => boolean;
81
+ /**
82
+ * Trim trailing punctuation from URL/path per RFC 3986 and GFM rules.
83
+ * - Trims simple trailing: .,;:!?]
84
+ * - Balanced logic for () only (valid in path components)
85
+ * - Invalid chars like [] {} are already stopped by whitelist, but ] trimmed as fallback
86
+ *
87
+ * Optimized to avoid O(n²) string slicing - tracks end index and slices once at the end.
88
+ */
89
+ export declare const trim_trailing_punctuation: (url: string) => string;
90
+ /**
91
+ * Extract a single tag (component or element) if it's the only non-whitespace content.
92
+ * Returns the tag node if paragraph wrapping should be skipped (MDX convention),
93
+ * or null if the content should be wrapped in a paragraph.
94
+ */
95
+ /**
96
+ * Check if position in text is the start of an absolute path (starts with `/`).
97
+ * Must be preceded by whitespace or be at the start of the string.
98
+ * Rejects `//` (comments/protocol-relative) and `/ ` (bare slash).
99
+ */
100
+ export declare const is_at_absolute_path: (text: string, index: number) => boolean;
101
+ /**
102
+ * Check if position in text is the start of a relative path (`./` or `../`).
103
+ * Must be preceded by whitespace or be at the start of the string.
104
+ * Requires at least one path character after the prefix.
105
+ */
106
+ export declare const is_at_relative_path: (text: string, index: number) => boolean;
107
+ export declare const extract_single_tag: (nodes: Array<MdzNode>) => MdzComponentNode | MdzElementNode | null;
108
+ //# sourceMappingURL=mdz_helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mdz_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/mdz_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAC,MAAM,UAAU,CAAC;AAGxE,eAAO,MAAM,QAAQ,KAAK,CAAC;AAC3B,eAAO,MAAM,QAAQ,KAAK,CAAC;AAC3B,eAAO,MAAM,UAAU,KAAK,CAAC;AAC7B,eAAO,MAAM,KAAK,MAAM,CAAC;AACzB,eAAO,MAAM,OAAO,KAAK,CAAC;AAC1B,eAAO,MAAM,MAAM,KAAK,CAAC;AACzB,eAAO,MAAM,IAAI,KAAK,CAAC;AACvB,eAAO,MAAM,KAAK,KAAK,CAAC;AACxB,eAAO,MAAM,GAAG,IAAI,CAAC;AACrB,eAAO,MAAM,UAAU,KAAK,CAAC;AAC7B,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,KAAK,KAAK,CAAC;AACxB,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,eAAO,MAAM,UAAU,KAAK,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KAAG,OAwBjC,CAAC;AAEvB;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,GAAI,KAAK,MAAM,KAAG,MA4CvD,CAAC;AAEF;;;;GAIG;AACH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,OASjE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,OAsBjE,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC9B,OAAO,KAAK,CAAC,OAAO,CAAC,KACnB,gBAAgB,GAAG,cAAc,GAAG,IAiBtC,CAAC"}
@@ -0,0 +1,237 @@
1
+ /**
2
+ * Shared constants and pure helper functions for mdz parsers.
3
+ *
4
+ * Used by both the single-pass parser (`mdz.ts`) and the two-phase
5
+ * lexer+parser (`mdz_lexer.ts` + `mdz_token_parser.ts`).
6
+ *
7
+ * @module
8
+ */
9
+ // Character codes for performance
10
+ export const BACKTICK = 96; // `
11
+ export const ASTERISK = 42; // *
12
+ export const UNDERSCORE = 95; // _
13
+ export const TILDE = 126; // ~
14
+ export const NEWLINE = 10; // \n
15
+ export const HYPHEN = 45; // -
16
+ export const HASH = 35; // #
17
+ export const SPACE = 32; // (space)
18
+ export const TAB = 9; // \t
19
+ export const LEFT_ANGLE = 60; // <
20
+ export const RIGHT_ANGLE = 62; // >
21
+ export const SLASH = 47; // /
22
+ export const LEFT_BRACKET = 91; // [
23
+ export const RIGHT_BRACKET = 93; // ]
24
+ export const LEFT_PAREN = 40; // (
25
+ export const RIGHT_PAREN = 41; // )
26
+ export const COLON = 58; // :
27
+ export const PERIOD = 46; // .
28
+ export const COMMA = 44; // ,
29
+ export const SEMICOLON = 59; // ;
30
+ export const EXCLAMATION = 33; // !
31
+ export const QUESTION = 63; // ?
32
+ // RFC 3986 URI characters
33
+ export const DOLLAR = 36; // $
34
+ export const PERCENT = 37; // %
35
+ export const AMPERSAND = 38; // &
36
+ export const APOSTROPHE = 39; // '
37
+ export const PLUS = 43; // +
38
+ export const EQUALS = 61; // =
39
+ export const AT = 64; // @
40
+ // Character ranges
41
+ export const A_UPPER = 65; // A
42
+ export const Z_UPPER = 90; // Z
43
+ export const A_LOWER = 97; // a
44
+ export const Z_LOWER = 122; // z
45
+ export const ZERO = 48; // 0
46
+ export const NINE = 57; // 9
47
+ // mdz specification constants
48
+ export const HR_HYPHEN_COUNT = 3; // Horizontal rule requires exactly 3 hyphens
49
+ export const MIN_CODEBLOCK_BACKTICKS = 3; // Code blocks require minimum 3 backticks
50
+ export const MAX_HEADING_LEVEL = 6; // Headings support levels 1-6
51
+ export const HTTPS_PREFIX_LENGTH = 8; // Length of "https://"
52
+ export const HTTP_PREFIX_LENGTH = 7; // Length of "http://"
53
+ /**
54
+ * Check if character code is a letter (A-Z, a-z).
55
+ */
56
+ export const is_letter = (char_code) => (char_code >= A_UPPER && char_code <= Z_UPPER) || (char_code >= A_LOWER && char_code <= Z_LOWER);
57
+ /**
58
+ * Check if character code is valid for tag name (letter, number, hyphen, underscore).
59
+ */
60
+ export const is_tag_name_char = (char_code) => is_letter(char_code) ||
61
+ (char_code >= ZERO && char_code <= NINE) ||
62
+ char_code === HYPHEN ||
63
+ char_code === UNDERSCORE;
64
+ /**
65
+ * Check if character is part of a word for word boundary detection.
66
+ * Used to prevent intraword emphasis with `_` and `~` delimiters.
67
+ *
68
+ * Formatting delimiters (`*`, `_`, `~`) are NOT word characters - they're transparent.
69
+ * Only alphanumeric characters (A-Z, a-z, 0-9) are considered word characters.
70
+ *
71
+ * This prevents false positives with snake_case identifiers while allowing
72
+ * adjacent formatting like `**bold**_italic_`.
73
+ */
74
+ export const is_word_char = (char_code) => {
75
+ if (char_code === ASTERISK || char_code === UNDERSCORE || char_code === TILDE)
76
+ return false;
77
+ return ((char_code >= A_UPPER && char_code <= Z_UPPER) ||
78
+ (char_code >= A_LOWER && char_code <= Z_LOWER) ||
79
+ (char_code >= ZERO && char_code <= NINE));
80
+ };
81
+ /**
82
+ * Check if character code is valid in URI path per RFC 3986.
83
+ * Validates against the `pchar` production plus path/query/fragment separators.
84
+ *
85
+ * Valid characters:
86
+ * - unreserved: A-Z a-z 0-9 - . _ ~
87
+ * - sub-delims: ! $ & ' ( ) * + , ; =
88
+ * - path allowed: : @
89
+ * - separators: / ? #
90
+ * - percent-encoding: %
91
+ */
92
+ export const is_valid_path_char = (char_code) => (char_code >= A_UPPER && char_code <= Z_UPPER) ||
93
+ (char_code >= A_LOWER && char_code <= Z_LOWER) ||
94
+ (char_code >= ZERO && char_code <= NINE) ||
95
+ char_code === HYPHEN ||
96
+ char_code === PERIOD ||
97
+ char_code === UNDERSCORE ||
98
+ char_code === TILDE ||
99
+ char_code === EXCLAMATION ||
100
+ char_code === DOLLAR ||
101
+ char_code === AMPERSAND ||
102
+ char_code === APOSTROPHE ||
103
+ char_code === LEFT_PAREN ||
104
+ char_code === RIGHT_PAREN ||
105
+ char_code === ASTERISK ||
106
+ char_code === PLUS ||
107
+ char_code === COMMA ||
108
+ char_code === SEMICOLON ||
109
+ char_code === EQUALS ||
110
+ char_code === COLON ||
111
+ char_code === AT ||
112
+ char_code === SLASH ||
113
+ char_code === QUESTION ||
114
+ char_code === HASH ||
115
+ char_code === PERCENT;
116
+ /**
117
+ * Trim trailing punctuation from URL/path per RFC 3986 and GFM rules.
118
+ * - Trims simple trailing: .,;:!?]
119
+ * - Balanced logic for () only (valid in path components)
120
+ * - Invalid chars like [] {} are already stopped by whitelist, but ] trimmed as fallback
121
+ *
122
+ * Optimized to avoid O(n²) string slicing - tracks end index and slices once at the end.
123
+ */
124
+ export const trim_trailing_punctuation = (url) => {
125
+ let end = url.length;
126
+ // Trim simple trailing punctuation (] as fallback - whitelist should prevent it)
127
+ while (end > 0) {
128
+ const last_char = url.charCodeAt(end - 1);
129
+ if (last_char === PERIOD ||
130
+ last_char === COMMA ||
131
+ last_char === SEMICOLON ||
132
+ last_char === COLON ||
133
+ last_char === EXCLAMATION ||
134
+ last_char === QUESTION ||
135
+ last_char === RIGHT_BRACKET) {
136
+ end--;
137
+ }
138
+ else {
139
+ break;
140
+ }
141
+ }
142
+ // Handle balanced parentheses ONLY (parens are valid in URI path components)
143
+ // Count parentheses in the trimmed portion
144
+ let open_count = 0;
145
+ let close_count = 0;
146
+ for (let i = 0; i < end; i++) {
147
+ const char = url.charCodeAt(i);
148
+ if (char === LEFT_PAREN)
149
+ open_count++;
150
+ if (char === RIGHT_PAREN)
151
+ close_count++;
152
+ }
153
+ // Trim unmatched trailing closing parens
154
+ while (end > 0 && close_count > open_count) {
155
+ const last_char = url.charCodeAt(end - 1);
156
+ if (last_char === RIGHT_PAREN) {
157
+ end--;
158
+ close_count--;
159
+ }
160
+ else {
161
+ break;
162
+ }
163
+ }
164
+ // Return original string if no trimming, otherwise slice once
165
+ return end === url.length ? url : url.slice(0, end);
166
+ };
167
+ /**
168
+ * Extract a single tag (component or element) if it's the only non-whitespace content.
169
+ * Returns the tag node if paragraph wrapping should be skipped (MDX convention),
170
+ * or null if the content should be wrapped in a paragraph.
171
+ */
172
+ /**
173
+ * Check if position in text is the start of an absolute path (starts with `/`).
174
+ * Must be preceded by whitespace or be at the start of the string.
175
+ * Rejects `//` (comments/protocol-relative) and `/ ` (bare slash).
176
+ */
177
+ export const is_at_absolute_path = (text, index) => {
178
+ if (text.charCodeAt(index) !== SLASH)
179
+ return false;
180
+ if (index > 0) {
181
+ const prev_char = text.charCodeAt(index - 1);
182
+ if (prev_char !== SPACE && prev_char !== NEWLINE && prev_char !== TAB)
183
+ return false;
184
+ }
185
+ if (index + 1 >= text.length)
186
+ return false;
187
+ const next_char = text.charCodeAt(index + 1);
188
+ return next_char !== SLASH && next_char !== SPACE && next_char !== NEWLINE;
189
+ };
190
+ /**
191
+ * Check if position in text is the start of a relative path (`./` or `../`).
192
+ * Must be preceded by whitespace or be at the start of the string.
193
+ * Requires at least one path character after the prefix.
194
+ */
195
+ export const is_at_relative_path = (text, index) => {
196
+ if (text.charCodeAt(index) !== PERIOD)
197
+ return false;
198
+ if (index > 0) {
199
+ const prev_char = text.charCodeAt(index - 1);
200
+ if (prev_char !== SPACE && prev_char !== NEWLINE && prev_char !== TAB)
201
+ return false;
202
+ }
203
+ const remaining = text.length - index;
204
+ // Check for ../ (at least 4 chars: ../x)
205
+ if (remaining >= 4 &&
206
+ text.charCodeAt(index + 1) === PERIOD &&
207
+ text.charCodeAt(index + 2) === SLASH) {
208
+ const after = text.charCodeAt(index + 3);
209
+ return after !== SPACE && after !== NEWLINE && after !== SLASH;
210
+ }
211
+ // Check for ./ (at least 3 chars: ./x)
212
+ if (remaining >= 3 && text.charCodeAt(index + 1) === SLASH) {
213
+ const after = text.charCodeAt(index + 2);
214
+ return after !== SPACE && after !== NEWLINE && after !== SLASH;
215
+ }
216
+ return false;
217
+ };
218
+ export const extract_single_tag = (nodes) => {
219
+ let tag = null;
220
+ for (const node of nodes) {
221
+ if (node.type === 'Component' || node.type === 'Element') {
222
+ if (tag)
223
+ return null; // Multiple tags
224
+ tag = node;
225
+ }
226
+ else if (node.type === 'Text') {
227
+ // Allow only whitespace-only text nodes
228
+ if (node.content.trim() !== '')
229
+ return null;
230
+ }
231
+ else {
232
+ // Any other node type means not a single tag
233
+ return null;
234
+ }
235
+ }
236
+ return tag;
237
+ };
@@ -0,0 +1,93 @@
1
+ /**
2
+ * mdz lexer — tokenizes input into a flat `MdzToken[]` stream.
3
+ *
4
+ * Phase 1 of the two-phase lexer+parser alternative to the single-pass parser
5
+ * in `mdz.ts`. Phase 2 is in `mdz_token_parser.ts`.
6
+ *
7
+ * @module
8
+ */
9
+ export interface MdzTokenBase {
10
+ start: number;
11
+ end: number;
12
+ }
13
+ export type MdzToken = MdzTokenText | MdzTokenCode | MdzTokenCodeblock | MdzTokenBoldOpen | MdzTokenBoldClose | MdzTokenItalicOpen | MdzTokenItalicClose | MdzTokenStrikethroughOpen | MdzTokenStrikethroughClose | MdzTokenLinkTextOpen | MdzTokenLinkTextClose | MdzTokenLinkRef | MdzTokenAutolink | MdzTokenHeadingStart | MdzTokenHr | MdzTokenTagOpen | MdzTokenTagSelfClose | MdzTokenTagClose | MdzTokenHeadingEnd | MdzTokenParagraphBreak;
14
+ export interface MdzTokenText extends MdzTokenBase {
15
+ type: 'text';
16
+ content: string;
17
+ }
18
+ export interface MdzTokenCode extends MdzTokenBase {
19
+ type: 'code';
20
+ content: string;
21
+ }
22
+ export interface MdzTokenCodeblock extends MdzTokenBase {
23
+ type: 'codeblock';
24
+ lang: string | null;
25
+ content: string;
26
+ }
27
+ export interface MdzTokenBoldOpen extends MdzTokenBase {
28
+ type: 'bold_open';
29
+ }
30
+ export interface MdzTokenBoldClose extends MdzTokenBase {
31
+ type: 'bold_close';
32
+ }
33
+ export interface MdzTokenItalicOpen extends MdzTokenBase {
34
+ type: 'italic_open';
35
+ }
36
+ export interface MdzTokenItalicClose extends MdzTokenBase {
37
+ type: 'italic_close';
38
+ }
39
+ export interface MdzTokenStrikethroughOpen extends MdzTokenBase {
40
+ type: 'strikethrough_open';
41
+ }
42
+ export interface MdzTokenStrikethroughClose extends MdzTokenBase {
43
+ type: 'strikethrough_close';
44
+ }
45
+ export interface MdzTokenLinkTextOpen extends MdzTokenBase {
46
+ type: 'link_text_open';
47
+ }
48
+ export interface MdzTokenLinkTextClose extends MdzTokenBase {
49
+ type: 'link_text_close';
50
+ }
51
+ export interface MdzTokenLinkRef extends MdzTokenBase {
52
+ type: 'link_ref';
53
+ reference: string;
54
+ link_type: 'external' | 'internal';
55
+ }
56
+ export interface MdzTokenAutolink extends MdzTokenBase {
57
+ type: 'autolink';
58
+ reference: string;
59
+ link_type: 'external' | 'internal';
60
+ }
61
+ export interface MdzTokenHeadingStart extends MdzTokenBase {
62
+ type: 'heading_start';
63
+ level: 1 | 2 | 3 | 4 | 5 | 6;
64
+ }
65
+ export interface MdzTokenHr extends MdzTokenBase {
66
+ type: 'hr';
67
+ }
68
+ export interface MdzTokenTagOpen extends MdzTokenBase {
69
+ type: 'tag_open';
70
+ name: string;
71
+ is_component: boolean;
72
+ }
73
+ export interface MdzTokenTagSelfClose extends MdzTokenBase {
74
+ type: 'tag_self_close';
75
+ name: string;
76
+ is_component: boolean;
77
+ }
78
+ export interface MdzTokenTagClose extends MdzTokenBase {
79
+ type: 'tag_close';
80
+ name: string;
81
+ }
82
+ export interface MdzTokenHeadingEnd extends MdzTokenBase {
83
+ type: 'heading_end';
84
+ }
85
+ export interface MdzTokenParagraphBreak extends MdzTokenBase {
86
+ type: 'paragraph_break';
87
+ }
88
+ export declare class MdzLexer {
89
+ #private;
90
+ constructor(text: string);
91
+ tokenize(): Array<MdzToken>;
92
+ }
93
+ //# sourceMappingURL=mdz_lexer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mdz_lexer.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/mdz_lexer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAyCH,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,MAAM,QAAQ,GACjB,YAAY,GACZ,YAAY,GACZ,iBAAiB,GACjB,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,mBAAmB,GACnB,yBAAyB,GACzB,0BAA0B,GAC1B,oBAAoB,GACpB,qBAAqB,GACrB,eAAe,GACf,gBAAgB,GAChB,oBAAoB,GACpB,UAAU,GACV,eAAe,GACf,oBAAoB,GACpB,gBAAgB,GAChB,kBAAkB,GAClB,sBAAsB,CAAC;AAE1B,MAAM,WAAW,YAAa,SAAQ,YAAY;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAa,SAAQ,YAAY;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACtD,IAAI,EAAE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