@fuzdev/fuz_ui 0.204.0 → 0.205.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 (95) hide show
  1. package/dist/ApiModule.svelte +14 -1
  2. package/dist/ApiModule.svelte.d.ts.map +1 -1
  3. package/dist/DeclarationDetail.svelte +15 -4
  4. package/dist/DeclarationDetail.svelte.d.ts.map +1 -1
  5. package/package.json +12 -36
  6. package/dist/Mdz.svelte +0 -34
  7. package/dist/Mdz.svelte.d.ts +0 -11
  8. package/dist/Mdz.svelte.d.ts.map +0 -1
  9. package/dist/MdzNodeView.svelte +0 -107
  10. package/dist/MdzNodeView.svelte.d.ts +0 -9
  11. package/dist/MdzNodeView.svelte.d.ts.map +0 -1
  12. package/dist/MdzPrecompiled.svelte +0 -30
  13. package/dist/MdzPrecompiled.svelte.d.ts +0 -11
  14. package/dist/MdzPrecompiled.svelte.d.ts.map +0 -1
  15. package/dist/MdzRoot.svelte +0 -30
  16. package/dist/MdzRoot.svelte.d.ts +0 -12
  17. package/dist/MdzRoot.svelte.d.ts.map +0 -1
  18. package/dist/MdzStream.svelte +0 -32
  19. package/dist/MdzStream.svelte.d.ts +0 -12
  20. package/dist/MdzStream.svelte.d.ts.map +0 -1
  21. package/dist/MdzStreamNodeView.svelte +0 -106
  22. package/dist/MdzStreamNodeView.svelte.d.ts +0 -9
  23. package/dist/MdzStreamNodeView.svelte.d.ts.map +0 -1
  24. package/dist/mdz.d.ts +0 -112
  25. package/dist/mdz.d.ts.map +0 -1
  26. package/dist/mdz.js +0 -1186
  27. package/dist/mdz_components.d.ts +0 -63
  28. package/dist/mdz_components.d.ts.map +0 -1
  29. package/dist/mdz_components.js +0 -32
  30. package/dist/mdz_helpers.d.ts +0 -164
  31. package/dist/mdz_helpers.d.ts.map +0 -1
  32. package/dist/mdz_helpers.js +0 -424
  33. package/dist/mdz_lexer.d.ts +0 -93
  34. package/dist/mdz_lexer.d.ts.map +0 -1
  35. package/dist/mdz_lexer.js +0 -732
  36. package/dist/mdz_opcodes.d.ts +0 -174
  37. package/dist/mdz_opcodes.d.ts.map +0 -1
  38. package/dist/mdz_opcodes.js +0 -14
  39. package/dist/mdz_opcodes_to_nodes.d.ts +0 -20
  40. package/dist/mdz_opcodes_to_nodes.d.ts.map +0 -1
  41. package/dist/mdz_opcodes_to_nodes.js +0 -332
  42. package/dist/mdz_stream_parser.d.ts +0 -80
  43. package/dist/mdz_stream_parser.d.ts.map +0 -1
  44. package/dist/mdz_stream_parser.js +0 -354
  45. package/dist/mdz_stream_parser_block.d.ts +0 -76
  46. package/dist/mdz_stream_parser_block.d.ts.map +0 -1
  47. package/dist/mdz_stream_parser_block.js +0 -458
  48. package/dist/mdz_stream_parser_inline.d.ts +0 -52
  49. package/dist/mdz_stream_parser_inline.d.ts.map +0 -1
  50. package/dist/mdz_stream_parser_inline.js +0 -378
  51. package/dist/mdz_stream_parser_link.d.ts +0 -22
  52. package/dist/mdz_stream_parser_link.d.ts.map +0 -1
  53. package/dist/mdz_stream_parser_link.js +0 -215
  54. package/dist/mdz_stream_parser_state.d.ts +0 -187
  55. package/dist/mdz_stream_parser_state.d.ts.map +0 -1
  56. package/dist/mdz_stream_parser_state.js +0 -398
  57. package/dist/mdz_stream_parser_text.d.ts +0 -14
  58. package/dist/mdz_stream_parser_text.d.ts.map +0 -1
  59. package/dist/mdz_stream_parser_text.js +0 -50
  60. package/dist/mdz_stream_parser_url.d.ts +0 -60
  61. package/dist/mdz_stream_parser_url.d.ts.map +0 -1
  62. package/dist/mdz_stream_parser_url.js +0 -307
  63. package/dist/mdz_stream_state.svelte.d.ts +0 -44
  64. package/dist/mdz_stream_state.svelte.d.ts.map +0 -1
  65. package/dist/mdz_stream_state.svelte.js +0 -357
  66. package/dist/mdz_to_svelte.d.ts +0 -41
  67. package/dist/mdz_to_svelte.d.ts.map +0 -1
  68. package/dist/mdz_to_svelte.js +0 -100
  69. package/dist/mdz_token_parser.d.ts +0 -14
  70. package/dist/mdz_token_parser.d.ts.map +0 -1
  71. package/dist/mdz_token_parser.js +0 -344
  72. package/dist/svelte_preprocess_mdz.d.ts +0 -65
  73. package/dist/svelte_preprocess_mdz.d.ts.map +0 -1
  74. package/dist/svelte_preprocess_mdz.js +0 -529
  75. package/dist/tsdoc_mdz.d.ts +0 -45
  76. package/dist/tsdoc_mdz.d.ts.map +0 -1
  77. package/dist/tsdoc_mdz.js +0 -88
  78. package/src/lib/mdz.ts +0 -1532
  79. package/src/lib/mdz_components.ts +0 -64
  80. package/src/lib/mdz_helpers.ts +0 -449
  81. package/src/lib/mdz_lexer.ts +0 -1012
  82. package/src/lib/mdz_opcodes.ts +0 -205
  83. package/src/lib/mdz_opcodes_to_nodes.ts +0 -375
  84. package/src/lib/mdz_stream_parser.ts +0 -415
  85. package/src/lib/mdz_stream_parser_block.ts +0 -532
  86. package/src/lib/mdz_stream_parser_inline.ts +0 -414
  87. package/src/lib/mdz_stream_parser_link.ts +0 -271
  88. package/src/lib/mdz_stream_parser_state.ts +0 -539
  89. package/src/lib/mdz_stream_parser_text.ts +0 -77
  90. package/src/lib/mdz_stream_parser_url.ts +0 -365
  91. package/src/lib/mdz_stream_state.svelte.ts +0 -387
  92. package/src/lib/mdz_to_svelte.ts +0 -141
  93. package/src/lib/mdz_token_parser.ts +0 -434
  94. package/src/lib/svelte_preprocess_mdz.ts +0 -742
  95. package/src/lib/tsdoc_mdz.ts +0 -97
@@ -1,97 +0,0 @@
1
- /**
2
- * Bridge between TSDoc format and mdz for rendering.
3
- *
4
- * This module converts raw TSDoc syntax (from the analysis library) to mdz format
5
- * (Fuz's documentation rendering dialect). It lives in fuz_ui, not the extracted
6
- * analysis library, to keep that library format-agnostic.
7
- *
8
- * @module
9
- */
10
-
11
- import {mdz_is_url} from './mdz_helpers.js';
12
-
13
- /** Format a reference as mdz: URLs pass through, identifiers get backticks. */
14
- const format_reference = (ref: string): string => (mdz_is_url(ref) ? ref : `\`${ref}\``);
15
-
16
- /**
17
- * Convert raw TSDoc `@see` content to mdz format for rendering.
18
- *
19
- * Handles TSDoc link syntax:
20
- * - `{@link url|text}` → `[text](url)` (markdown link, TSDoc canonical form)
21
- * - `{@link url text}` → `[text](url)` (TS-lenient space-separated form)
22
- * - `{@link https://...}` → `https://...` (bare URL, auto-linked by mdz)
23
- * - `{@link identifier}` → `` `identifier` `` (code formatting)
24
- * - Bare URLs → returned as-is
25
- * - Bare markdown links (`[text](url)` ...) → returned as-is
26
- * - Bare identifiers → wrapped in backticks
27
- * - `identifier description text` → `` `identifier` description text `` (first token is the reference)
28
- *
29
- * @param content - raw `@see` tag content in TSDoc format
30
- * @returns mdz-formatted string ready for `Mdz` component
31
- *
32
- * @example
33
- * ```ts
34
- * tsdoc_see_to_mdz('{@link https://fuz.dev|API Docs}')
35
- * // → '[API Docs](https://fuz.dev)'
36
- *
37
- * tsdoc_see_to_mdz('{@link SomeType}')
38
- * // → '`SomeType`'
39
- *
40
- * tsdoc_see_to_mdz('https://fuz.dev')
41
- * // → 'https://fuz.dev'
42
- *
43
- * tsdoc_see_to_mdz('[svelte-docinfo](https://github.com/ryanatkn/svelte-docinfo) for the analysis library')
44
- * // → '[svelte-docinfo](https://github.com/ryanatkn/svelte-docinfo) for the analysis library'
45
- *
46
- * tsdoc_see_to_mdz('tome.ts for the documentation system')
47
- * // → '`tome.ts` for the documentation system'
48
- * ```
49
- */
50
- export const tsdoc_see_to_mdz = (content: string): string => {
51
- const trimmed = content.trim();
52
- if (!trimmed) return '';
53
-
54
- // Check for {@link ...} or {@see ...} syntax
55
- const link_match = /^\{@(?:link|see)\s+([^}]+)\}$/.exec(trimmed);
56
- if (link_match) {
57
- const inner = link_match[1]!.trim();
58
-
59
- // Pipe separator takes precedence (TSDoc canonical form)
60
- const pipe_index = inner.indexOf('|');
61
- if (pipe_index !== -1) {
62
- const reference = inner.slice(0, pipe_index).trim();
63
- const display_text = inner.slice(pipe_index + 1).trim();
64
- return `[${display_text}](${reference})`;
65
- }
66
-
67
- // Space-separated form: TS accepts `{@link url text}` as equivalent to `{@link url|text}`.
68
- // Only treat space as a separator when the first token looks like a link target (URL),
69
- // so identifier-style references like `module.function` aren't split.
70
- const space_index = inner.indexOf(' ');
71
- if (space_index !== -1) {
72
- const reference = inner.slice(0, space_index);
73
- if (mdz_is_url(reference)) {
74
- const display_text = inner.slice(space_index + 1).trim();
75
- return `[${display_text}](${reference})`;
76
- }
77
- }
78
-
79
- return format_reference(inner);
80
- }
81
-
82
- // Pass through bare markdown links (`[text](url)` optionally followed by description)
83
- // so authors can write `@see [text](url) for context` directly.
84
- if (trimmed.charCodeAt(0) === 91 /* [ */ && /^\[[^\]]+\]\([^)\s]+\)/.test(trimmed)) {
85
- return trimmed;
86
- }
87
-
88
- // Split at first whitespace: first token is the reference, rest is description
89
- const space_index = trimmed.indexOf(' ');
90
- if (space_index === -1) {
91
- return format_reference(trimmed);
92
- }
93
-
94
- const reference = trimmed.slice(0, space_index);
95
- const description = trimmed.slice(space_index); // preserve leading space
96
- return format_reference(reference) + description;
97
- };