@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.
- package/dist/ApiModule.svelte +22 -6
- package/dist/ApiModule.svelte.d.ts.map +1 -1
- package/dist/DeclarationLink.svelte +1 -1
- package/dist/DocsLink.svelte +2 -2
- package/dist/DocsTertiaryNav.svelte +2 -2
- package/dist/Mdz.svelte +5 -0
- package/dist/Mdz.svelte.d.ts +1 -0
- package/dist/Mdz.svelte.d.ts.map +1 -1
- package/dist/MdzNodeView.svelte +19 -8
- package/dist/MdzNodeView.svelte.d.ts +1 -1
- package/dist/MdzNodeView.svelte.d.ts.map +1 -1
- package/dist/ModuleLink.svelte +1 -1
- package/dist/TypeLink.svelte +1 -1
- package/dist/library.svelte.d.ts +24 -27
- package/dist/library.svelte.d.ts.map +1 -1
- package/dist/library.svelte.js +16 -16
- package/dist/mdz.d.ts +13 -0
- package/dist/mdz.d.ts.map +1 -1
- package/dist/mdz.js +73 -280
- package/dist/mdz_components.d.ts +12 -0
- package/dist/mdz_components.d.ts.map +1 -1
- package/dist/mdz_components.js +8 -0
- package/dist/mdz_helpers.d.ts +108 -0
- package/dist/mdz_helpers.d.ts.map +1 -0
- package/dist/mdz_helpers.js +237 -0
- package/dist/mdz_lexer.d.ts +93 -0
- package/dist/mdz_lexer.d.ts.map +1 -0
- package/dist/mdz_lexer.js +727 -0
- package/dist/mdz_to_svelte.d.ts +5 -2
- package/dist/mdz_to_svelte.d.ts.map +1 -1
- package/dist/mdz_to_svelte.js +13 -2
- package/dist/mdz_token_parser.d.ts +14 -0
- package/dist/mdz_token_parser.d.ts.map +1 -0
- package/dist/mdz_token_parser.js +374 -0
- package/dist/svelte_preprocess_mdz.js +23 -7
- package/package.json +10 -9
- package/src/lib/library.svelte.ts +36 -35
- package/src/lib/mdz.ts +106 -302
- package/src/lib/mdz_components.ts +9 -0
- package/src/lib/mdz_helpers.ts +251 -0
- package/src/lib/mdz_lexer.ts +1003 -0
- package/src/lib/mdz_to_svelte.ts +15 -2
- package/src/lib/mdz_token_parser.ts +460 -0
- package/src/lib/svelte_preprocess_mdz.ts +23 -7
package/dist/ApiModule.svelte
CHANGED
|
@@ -37,10 +37,15 @@
|
|
|
37
37
|
);
|
|
38
38
|
|
|
39
39
|
// find the module using the lookup helper
|
|
40
|
-
const module = $derived(library.
|
|
40
|
+
const module = $derived(library.module_by_path.get(module_path));
|
|
41
|
+
|
|
42
|
+
// check if this is a directory prefix containing child modules
|
|
43
|
+
const directory_modules = $derived(module ? null : library.lookup_directory_modules(module_path));
|
|
41
44
|
|
|
42
45
|
// fallback for 404
|
|
43
|
-
const module_name = $derived(
|
|
46
|
+
const module_name = $derived(
|
|
47
|
+
module?.path || (directory_modules ? module_path : '[missing module]'),
|
|
48
|
+
);
|
|
44
49
|
|
|
45
50
|
const search = $derived(create_module_declaration_search(module?.declarations ?? []));
|
|
46
51
|
|
|
@@ -57,7 +62,18 @@
|
|
|
57
62
|
<h1 class="mt_xl4">{module_name}</h1>
|
|
58
63
|
{/snippet}
|
|
59
64
|
|
|
60
|
-
{#if !module}
|
|
65
|
+
{#if !module && directory_modules}
|
|
66
|
+
<section>
|
|
67
|
+
<p>{directory_modules.length} module{directory_modules.length === 1 ? '' : 's'}</p>
|
|
68
|
+
<ul>
|
|
69
|
+
{#each directory_modules as child_module (child_module.path)}
|
|
70
|
+
<li>
|
|
71
|
+
<ModuleLink module_path={child_module.path} />
|
|
72
|
+
</li>
|
|
73
|
+
{/each}
|
|
74
|
+
</ul>
|
|
75
|
+
</section>
|
|
76
|
+
{:else if !module}
|
|
61
77
|
<section>
|
|
62
78
|
<p>Module not found: {module_path}</p>
|
|
63
79
|
</section>
|
|
@@ -67,7 +83,7 @@
|
|
|
67
83
|
<Mdz content={module.module_comment} />
|
|
68
84
|
</section>
|
|
69
85
|
{/if}
|
|
70
|
-
<!-- Declarations
|
|
86
|
+
<!-- Declarations section -->
|
|
71
87
|
<TomeSection>
|
|
72
88
|
<TomeSectionHeader text="Declarations" />
|
|
73
89
|
|
|
@@ -92,7 +108,7 @@
|
|
|
92
108
|
<ApiDeclarationList declarations={search.filtered} search_query={search.query} />
|
|
93
109
|
</TomeSection>
|
|
94
110
|
|
|
95
|
-
<!-- Depends on
|
|
111
|
+
<!-- Depends on section -->
|
|
96
112
|
{#if module.dependencies}
|
|
97
113
|
<TomeSection>
|
|
98
114
|
<TomeSectionHeader text="Depends on" />
|
|
@@ -106,7 +122,7 @@
|
|
|
106
122
|
</TomeSection>
|
|
107
123
|
{/if}
|
|
108
124
|
|
|
109
|
-
<!-- Imported by
|
|
125
|
+
<!-- Imported by section -->
|
|
110
126
|
{#if module.dependents}
|
|
111
127
|
<TomeSection>
|
|
112
128
|
<TomeSectionHeader text="Imported by" />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiModule.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ApiModule.svelte"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAmB,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAUrD,KAAK,gBAAgB,GAAI;IACxB;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;CACZ,CAAC;
|
|
1
|
+
{"version":3,"file":"ApiModule.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ApiModule.svelte"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAmB,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAUrD,KAAK,gBAAgB,GAAI;IACxB;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;CACZ,CAAC;AA2HH,QAAA,MAAM,SAAS,sDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
const library = library_context.get();
|
|
22
22
|
|
|
23
|
-
const declaration = $derived(library.
|
|
23
|
+
const declaration = $derived(library.declaration_by_name.get(name));
|
|
24
24
|
|
|
25
25
|
const contextmenu_entries = $derived(
|
|
26
26
|
declaration ? create_declaration_contextmenu(declaration) : undefined,
|
package/dist/DocsLink.svelte
CHANGED
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
const library = library_context.get();
|
|
23
23
|
|
|
24
24
|
// Try to find as declaration first, then module
|
|
25
|
-
const declaration = $derived(library.
|
|
26
|
-
const module = $derived(declaration ? declaration.module : library.
|
|
25
|
+
const declaration = $derived(library.declaration_by_name.get(reference));
|
|
26
|
+
const module = $derived(declaration ? declaration.module : library.module_by_path.get(reference));
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
29
|
{#if declaration}
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
|
|
34
34
|
const modules_related_to_selected = $derived(
|
|
35
35
|
selected_tome?.related_modules
|
|
36
|
-
.map((path) => library.
|
|
36
|
+
.map((path) => library.module_by_path.get(path))
|
|
37
37
|
.filter((m) => m !== undefined) ?? [],
|
|
38
38
|
);
|
|
39
39
|
|
|
40
40
|
const declarations_related_to_selected = $derived(
|
|
41
41
|
selected_tome?.related_declarations
|
|
42
|
-
.map((name) => library.
|
|
42
|
+
.map((name) => library.declaration_by_name.get(name))
|
|
43
43
|
.filter((d) => d !== undefined) ?? [],
|
|
44
44
|
);
|
|
45
45
|
|
package/dist/Mdz.svelte
CHANGED
|
@@ -3,18 +3,23 @@
|
|
|
3
3
|
|
|
4
4
|
import {mdz_parse} from './mdz.js';
|
|
5
5
|
import MdzNodeView from './MdzNodeView.svelte';
|
|
6
|
+
import {mdz_base_context} from './mdz_components.js';
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
content,
|
|
9
10
|
inline = false,
|
|
10
11
|
nowrap = false,
|
|
12
|
+
base,
|
|
11
13
|
...rest
|
|
12
14
|
}: (SvelteHTMLElements['div'] | SvelteHTMLElements['span']) & {
|
|
13
15
|
content: string;
|
|
14
16
|
inline?: boolean;
|
|
15
17
|
nowrap?: boolean;
|
|
18
|
+
base?: string;
|
|
16
19
|
} = $props();
|
|
17
20
|
|
|
21
|
+
mdz_base_context.set(() => base);
|
|
22
|
+
|
|
18
23
|
const nodes = $derived(mdz_parse(content));
|
|
19
24
|
</script>
|
|
20
25
|
|
package/dist/Mdz.svelte.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ type $$ComponentProps = (SvelteHTMLElements['div'] | SvelteHTMLElements['span'])
|
|
|
3
3
|
content: string;
|
|
4
4
|
inline?: boolean;
|
|
5
5
|
nowrap?: boolean;
|
|
6
|
+
base?: string;
|
|
6
7
|
};
|
|
7
8
|
declare const Mdz: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
9
|
type Mdz = ReturnType<typeof Mdz>;
|
package/dist/Mdz.svelte.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mdz.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Mdz.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Mdz.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Mdz.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAMvD,KAAK,gBAAgB,GAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,GAAG;IACnF,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AA6BH,QAAA,MAAM,GAAG,sDAAwC,CAAC;AAClD,KAAK,GAAG,GAAG,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC;AAClC,eAAe,GAAG,CAAC"}
|
package/dist/MdzNodeView.svelte
CHANGED
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
import Code from '@fuzdev/fuz_code/Code.svelte';
|
|
3
3
|
import {resolve} from '$app/paths';
|
|
4
4
|
|
|
5
|
-
import type
|
|
5
|
+
import {type MdzNode, resolve_relative_path} from './mdz.js';
|
|
6
6
|
import DocsLink from './DocsLink.svelte';
|
|
7
7
|
import MdzNodeView from './MdzNodeView.svelte';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
mdz_components_context,
|
|
10
|
+
mdz_elements_context,
|
|
11
|
+
mdz_base_context,
|
|
12
|
+
} from './mdz_components.js';
|
|
9
13
|
|
|
10
14
|
const {
|
|
11
15
|
node,
|
|
@@ -15,6 +19,7 @@
|
|
|
15
19
|
|
|
16
20
|
const components = mdz_components_context.get_maybe();
|
|
17
21
|
const elements = mdz_elements_context.get_maybe();
|
|
22
|
+
const get_mdz_base = mdz_base_context.get_maybe();
|
|
18
23
|
// TODO make `Code` customizable via context, maybe registered as component Codeblock?
|
|
19
24
|
</script>
|
|
20
25
|
|
|
@@ -53,12 +58,18 @@
|
|
|
53
58
|
{:else if node.type === 'Link'}
|
|
54
59
|
{@const {reference} = node}
|
|
55
60
|
{#if node.link_type === 'internal'}
|
|
56
|
-
{@const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
>{@render render_children(node.children)}</a
|
|
61
|
-
|
|
61
|
+
{@const skip_resolve = reference.startsWith('#') || reference.startsWith('?')}
|
|
62
|
+
{@const mdz_base = get_mdz_base?.()}
|
|
63
|
+
{#if reference.startsWith('.') && mdz_base}
|
|
64
|
+
{@const resolved = resolve_relative_path(reference, mdz_base)}
|
|
65
|
+
<a href={resolve(resolved as any)}>{@render render_children(node.children)}</a>
|
|
66
|
+
{:else if skip_resolve || reference.startsWith('.')}
|
|
67
|
+
<!-- Fragment, query, and relative links without base skip resolve() -->
|
|
68
|
+
<!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
|
|
69
|
+
<a href={reference}>{@render render_children(node.children)}</a>
|
|
70
|
+
{:else}
|
|
71
|
+
<a href={resolve(reference as any)}>{@render render_children(node.children)}</a>
|
|
72
|
+
{/if}
|
|
62
73
|
{:else}
|
|
63
74
|
<!-- external link -->
|
|
64
75
|
<!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MdzNodeView.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/MdzNodeView.svelte"],"names":[],"mappings":"AAMA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"MdzNodeView.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/MdzNodeView.svelte"],"names":[],"mappings":"AAMA,OAAO,EAAC,KAAK,OAAO,EAAwB,MAAM,UAAU,CAAC;AAE7D,OAAO,WAAW,MAAM,sBAAsB,CAAC;AAO9C,KAAK,gBAAgB,GAAI;IACxB,IAAI,EAAE,OAAO,CAAC;CACd,CAAC;AAoGH,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
package/dist/ModuleLink.svelte
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
const library = library_context.get();
|
|
22
22
|
|
|
23
|
-
const module = $derived(library.
|
|
23
|
+
const module = $derived(library.module_by_path.get(module_path));
|
|
24
24
|
|
|
25
25
|
const color_class = $derived(module_path.endsWith('.svelte') ? 'color_h' : '');
|
|
26
26
|
|
package/dist/TypeLink.svelte
CHANGED
package/dist/library.svelte.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare class Library {
|
|
|
22
22
|
* Default `''` preserves single-package behavior.
|
|
23
23
|
*/
|
|
24
24
|
readonly url_prefix: string;
|
|
25
|
-
package_json: {
|
|
25
|
+
readonly package_json: {
|
|
26
26
|
[x: string]: unknown;
|
|
27
27
|
name: string;
|
|
28
28
|
version: string;
|
|
@@ -86,7 +86,7 @@ export declare class Library {
|
|
|
86
86
|
main?: string | undefined;
|
|
87
87
|
exports?: string | Record<string, unknown> | null | undefined;
|
|
88
88
|
};
|
|
89
|
-
source_json: {
|
|
89
|
+
readonly source_json: {
|
|
90
90
|
[x: string]: unknown;
|
|
91
91
|
name: string;
|
|
92
92
|
version: string;
|
|
@@ -162,49 +162,46 @@ export declare class Library {
|
|
|
162
162
|
star_exports?: string[] | undefined;
|
|
163
163
|
}[] | undefined;
|
|
164
164
|
};
|
|
165
|
-
name: string;
|
|
166
|
-
repo_name: string;
|
|
167
|
-
repo_url: import("@fuzdev/fuz_util/url.js").Url;
|
|
168
|
-
owner_name: string | null;
|
|
169
|
-
homepage_url: import("@fuzdev/fuz_util/url.js").Url | null;
|
|
170
|
-
logo_url: import("@fuzdev/fuz_util/url.js").Url | null;
|
|
171
|
-
logo_alt: string;
|
|
172
|
-
npm_url: import("@fuzdev/fuz_util/url.js").Url | null;
|
|
173
|
-
changelog_url: import("@fuzdev/fuz_util/url.js").Url | null;
|
|
174
|
-
published: boolean;
|
|
165
|
+
readonly name: string;
|
|
166
|
+
readonly repo_name: string;
|
|
167
|
+
readonly repo_url: import("@fuzdev/fuz_util/url.js").Url;
|
|
168
|
+
readonly owner_name: string | null;
|
|
169
|
+
readonly homepage_url: import("@fuzdev/fuz_util/url.js").Url | null;
|
|
170
|
+
readonly logo_url: import("@fuzdev/fuz_util/url.js").Url | null;
|
|
171
|
+
readonly logo_alt: string;
|
|
172
|
+
readonly npm_url: import("@fuzdev/fuz_util/url.js").Url | null;
|
|
173
|
+
readonly changelog_url: import("@fuzdev/fuz_util/url.js").Url | null;
|
|
174
|
+
readonly published: boolean;
|
|
175
175
|
/**
|
|
176
176
|
* Organization URL (e.g., 'https://github.com/ryanatkn').
|
|
177
177
|
*/
|
|
178
|
-
org_url: string | null;
|
|
178
|
+
readonly org_url: string | null;
|
|
179
179
|
/**
|
|
180
180
|
* All modules as rich Module instances.
|
|
181
181
|
*/
|
|
182
|
-
modules: Module[];
|
|
182
|
+
readonly modules: Module[];
|
|
183
183
|
/**
|
|
184
184
|
* All modules sorted alphabetically by path.
|
|
185
185
|
*/
|
|
186
|
-
modules_sorted: Module[];
|
|
186
|
+
readonly modules_sorted: Module[];
|
|
187
187
|
/**
|
|
188
188
|
* All declarations across all modules as a flat array.
|
|
189
189
|
*/
|
|
190
|
-
declarations: Declaration[];
|
|
190
|
+
readonly declarations: Declaration[];
|
|
191
191
|
/**
|
|
192
|
-
*
|
|
193
|
-
*/
|
|
194
|
-
declaration_map: Map<string, Declaration>;
|
|
195
|
-
constructor(library_json: LibraryJson, url_prefix?: string);
|
|
196
|
-
/**
|
|
197
|
-
* Look up a declaration by name.
|
|
192
|
+
* Module lookup map by path. Provides O(1) lookup.
|
|
198
193
|
*/
|
|
199
|
-
|
|
194
|
+
readonly module_by_path: Map<string, Module>;
|
|
200
195
|
/**
|
|
201
|
-
*
|
|
196
|
+
* Declaration lookup map by name. Provides O(1) lookup.
|
|
202
197
|
*/
|
|
203
|
-
|
|
198
|
+
readonly declaration_by_name: Map<string, Declaration>;
|
|
199
|
+
constructor(library_json: LibraryJson, url_prefix?: string);
|
|
204
200
|
/**
|
|
205
|
-
* Look up
|
|
201
|
+
* Look up modules within a directory prefix.
|
|
202
|
+
* Returns modules whose paths start with `path + "/"`, or `null` if none match.
|
|
206
203
|
*/
|
|
207
|
-
|
|
204
|
+
lookup_directory_modules(path: string): Array<Module> | null;
|
|
208
205
|
/**
|
|
209
206
|
* Search declarations by query string with multi-term AND logic.
|
|
210
207
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/library.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAIlE,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,wBAAwB,GAAI,OAAO,OAAO,KAAG,MAGzD,CAAC;AAEF;;;;;;;;GAQG;AACH,qBAAa,OAAO;IACnB,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAiB;IAEnD;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAA4C;
|
|
1
|
+
{"version":3,"file":"library.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/library.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAIlE,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,wBAAwB,GAAI,OAAO,OAAO,KAAG,MAGzD,CAAC;AAEF;;;;;;;;GAQG;AACH,qBAAa,OAAO;IACnB,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAiB;IAEnD;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B,QAAQ,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAA4C;IACjE,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAA2C;IAE/D,QAAQ,CAAC,IAAI,SAAoC;IACjD,QAAQ,CAAC,SAAS,SAAyC;IAC3D,QAAQ,CAAC,QAAQ,wCAAwC;IACzD,QAAQ,CAAC,UAAU,gBAA0C;IAC7D,QAAQ,CAAC,YAAY,+CAA4C;IACjE,QAAQ,CAAC,QAAQ,+CAAwC;IACzD,QAAQ,CAAC,QAAQ,SAAwC;IACzD,QAAQ,CAAC,OAAO,+CAAuC;IACvD,QAAQ,CAAC,aAAa,+CAA6C;IACnE,QAAQ,CAAC,SAAS,UAAyC;IAE3D;;OAEG;IACH,QAAQ,CAAC,OAAO,gBAMd;IAEF;;OAEG;IACH,QAAQ,CAAC,OAAO,WAId;IAEF;;OAEG;IACH,QAAQ,CAAC,cAAc,WAErB;IAEF;;OAEG;IACH,QAAQ,CAAC,YAAY,gBAAmE;IAExF;;OAEG;IACH,QAAQ,CAAC,cAAc,sBAA2D;IAElF;;OAEG;IACH,QAAQ,CAAC,mBAAmB,2BAAgE;gBAEhF,YAAY,EAAE,WAAW,EAAE,UAAU,SAAK;IAKtD;;;OAGG;IACH,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI;IAW5D;;OAEG;IACH,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC;CAGtD;AAED,eAAO,MAAM,eAAe;;;;CAA4B,CAAC"}
|
package/dist/library.svelte.js
CHANGED
|
@@ -61,31 +61,31 @@ export class Library {
|
|
|
61
61
|
* All declarations across all modules as a flat array.
|
|
62
62
|
*/
|
|
63
63
|
declarations = $derived(this.modules.flatMap((module) => module.declarations));
|
|
64
|
+
/**
|
|
65
|
+
* Module lookup map by path. Provides O(1) lookup.
|
|
66
|
+
*/
|
|
67
|
+
module_by_path = $derived(new Map(this.modules.map((m) => [m.path, m])));
|
|
64
68
|
/**
|
|
65
69
|
* Declaration lookup map by name. Provides O(1) lookup.
|
|
66
70
|
*/
|
|
67
|
-
|
|
71
|
+
declaration_by_name = $derived(new Map(this.declarations.map((d) => [d.name, d])));
|
|
68
72
|
constructor(library_json, url_prefix = '') {
|
|
69
73
|
this.library_json = library_json;
|
|
70
74
|
this.url_prefix = parse_library_url_prefix(url_prefix);
|
|
71
75
|
}
|
|
72
76
|
/**
|
|
73
|
-
* Look up a
|
|
74
|
-
|
|
75
|
-
lookup_declaration(name) {
|
|
76
|
-
return this.declaration_map.get(name);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Check if a declaration exists.
|
|
77
|
+
* Look up modules within a directory prefix.
|
|
78
|
+
* Returns modules whose paths start with `path + "/"`, or `null` if none match.
|
|
80
79
|
*/
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
80
|
+
lookup_directory_modules(path) {
|
|
81
|
+
const prefix = path + '/';
|
|
82
|
+
let result = null;
|
|
83
|
+
for (const m of this.modules_sorted) {
|
|
84
|
+
if (m.path.startsWith(prefix)) {
|
|
85
|
+
(result ??= []).push(m);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return result;
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* Search declarations by query string with multi-term AND logic.
|
package/dist/mdz.d.ts
CHANGED
|
@@ -109,4 +109,17 @@ export declare class MdzParser {
|
|
|
109
109
|
parse(): Array<MdzNode>;
|
|
110
110
|
}
|
|
111
111
|
export declare const mdz_is_url: (s: string) => boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Resolves a relative path (`./` or `../`) against a base path.
|
|
114
|
+
* The base is treated as a directory regardless of trailing slash
|
|
115
|
+
* (`'/docs/mdz'` and `'/docs/mdz/'` behave identically).
|
|
116
|
+
* Handles embedded `.` and `..` segments within the reference
|
|
117
|
+
* (e.g., `'./a/../b'` → navigates up then down).
|
|
118
|
+
* Clamps at root — excess `..` segments stop at `/` rather than escaping.
|
|
119
|
+
*
|
|
120
|
+
* @param reference A relative path starting with `./` or `../`.
|
|
121
|
+
* @param base An absolute base path (e.g., `'/docs/mdz/'`). Empty string is treated as root.
|
|
122
|
+
* @returns An absolute resolved path (e.g., `'/docs/mdz/grammar'`).
|
|
123
|
+
*/
|
|
124
|
+
export declare const resolve_relative_path: (reference: string, base: string) => string;
|
|
112
125
|
//# sourceMappingURL=mdz.d.ts.map
|
package/dist/mdz.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdz.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/mdz.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;
|
|
1
|
+
{"version":3,"file":"mdz.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/mdz.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAuCH;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,KAAG,KAAK,CAAC,OAAO,CAAgC,CAAC;AAEvF,MAAM,MAAM,OAAO,GAChB,WAAW,GACX,WAAW,GACX,gBAAgB,GAChB,WAAW,GACX,aAAa,GACb,oBAAoB,GACpB,WAAW,GACX,gBAAgB,GAChB,SAAS,GACT,cAAc,GACd,cAAc,GACd,gBAAgB,CAAC;AAEpB,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,WAAY,SAAQ,WAAW;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,OA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