@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
@@ -32,24 +32,24 @@ export class Library {
32
32
  */
33
33
  readonly url_prefix: string;
34
34
 
35
- package_json = $derived(this.library_json.package_json);
36
- source_json = $derived(this.library_json.source_json);
37
-
38
- name = $derived(this.library_json.name);
39
- repo_name = $derived(this.library_json.repo_name);
40
- repo_url = $derived(this.library_json.repo_url);
41
- owner_name = $derived(this.library_json.owner_name);
42
- homepage_url = $derived(this.library_json.homepage_url);
43
- logo_url = $derived(this.library_json.logo_url);
44
- logo_alt = $derived(this.library_json.logo_alt);
45
- npm_url = $derived(this.library_json.npm_url);
46
- changelog_url = $derived(this.library_json.changelog_url);
47
- published = $derived(this.library_json.published);
35
+ readonly package_json = $derived(this.library_json.package_json);
36
+ readonly source_json = $derived(this.library_json.source_json);
37
+
38
+ readonly name = $derived(this.library_json.name);
39
+ readonly repo_name = $derived(this.library_json.repo_name);
40
+ readonly repo_url = $derived(this.library_json.repo_url);
41
+ readonly owner_name = $derived(this.library_json.owner_name);
42
+ readonly homepage_url = $derived(this.library_json.homepage_url);
43
+ readonly logo_url = $derived(this.library_json.logo_url);
44
+ readonly logo_alt = $derived(this.library_json.logo_alt);
45
+ readonly npm_url = $derived(this.library_json.npm_url);
46
+ readonly changelog_url = $derived(this.library_json.changelog_url);
47
+ readonly published = $derived(this.library_json.published);
48
48
 
49
49
  /**
50
50
  * Organization URL (e.g., 'https://github.com/ryanatkn').
51
51
  */
52
- org_url = $derived(
52
+ readonly org_url = $derived(
53
53
  this.repo_url && this.repo_name
54
54
  ? this.repo_url.endsWith('/' + this.repo_name)
55
55
  ? this.repo_url.slice(0, -this.repo_name.length - 1)
@@ -60,7 +60,7 @@ export class Library {
60
60
  /**
61
61
  * All modules as rich Module instances.
62
62
  */
63
- modules = $derived(
63
+ readonly modules = $derived(
64
64
  this.source_json.modules
65
65
  ? this.source_json.modules.map((module_json) => new Module(this, module_json))
66
66
  : [],
@@ -69,17 +69,24 @@ export class Library {
69
69
  /**
70
70
  * All modules sorted alphabetically by path.
71
71
  */
72
- modules_sorted = $derived([...this.modules].sort((a, b) => a.path.localeCompare(b.path)));
72
+ readonly modules_sorted = $derived(
73
+ [...this.modules].sort((a, b) => a.path.localeCompare(b.path)),
74
+ );
73
75
 
74
76
  /**
75
77
  * All declarations across all modules as a flat array.
76
78
  */
77
- declarations = $derived(this.modules.flatMap((module) => module.declarations));
79
+ readonly declarations = $derived(this.modules.flatMap((module) => module.declarations));
80
+
81
+ /**
82
+ * Module lookup map by path. Provides O(1) lookup.
83
+ */
84
+ readonly module_by_path = $derived(new Map(this.modules.map((m) => [m.path, m])));
78
85
 
79
86
  /**
80
87
  * Declaration lookup map by name. Provides O(1) lookup.
81
88
  */
82
- declaration_map = $derived(new Map(this.declarations.map((d) => [d.name, d])));
89
+ readonly declaration_by_name = $derived(new Map(this.declarations.map((d) => [d.name, d])));
83
90
 
84
91
  constructor(library_json: LibraryJson, url_prefix = '') {
85
92
  this.library_json = library_json;
@@ -87,24 +94,18 @@ export class Library {
87
94
  }
88
95
 
89
96
  /**
90
- * Look up a declaration by name.
91
- */
92
- lookup_declaration(name: string): Declaration | undefined {
93
- return this.declaration_map.get(name);
94
- }
95
-
96
- /**
97
- * Check if a declaration exists.
97
+ * Look up modules within a directory prefix.
98
+ * Returns modules whose paths start with `path + "/"`, or `null` if none match.
98
99
  */
99
- has_declaration(name: string): boolean {
100
- return this.declaration_map.has(name);
101
- }
102
-
103
- /**
104
- * Look up a module by its canonical path.
105
- */
106
- lookup_module(path: string): Module | undefined {
107
- return this.modules.find((m) => m.path === path);
100
+ lookup_directory_modules(path: string): Array<Module> | null {
101
+ const prefix = path + '/';
102
+ let result: Array<Module> | null = null;
103
+ for (const m of this.modules_sorted) {
104
+ if (m.path.startsWith(prefix)) {
105
+ (result ??= []).push(m);
106
+ }
107
+ }
108
+ return result;
108
109
  }
109
110
 
110
111
  /**