@staticbolt/docs 0.0.1-beta.3 → 0.0.1-beta.5

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 (117) hide show
  1. package/README.md +16 -19
  2. package/lib/index.d.mts +62 -35
  3. package/lib/mermaid/abnfDiagram-PAR5IXJI-Ibbj5eGO.js +1 -0
  4. package/lib/mermaid/architecture-7GRP2DOG-M7G3SWCO-BJAoKIRD.js +1 -0
  5. package/lib/mermaid/architectureDiagram-2PNWDENW-CI3fLWIN.js +36 -0
  6. package/lib/mermaid/blockDiagram-PUWGUBOA-DAfWpjz7.js +129 -0
  7. package/lib/mermaid/c4Diagram-3NLNHZP5-at-f4FDi.js +38 -0
  8. package/lib/mermaid/chunk-2NMSUPJH-DuxvnX1p.js +1 -0
  9. package/lib/mermaid/chunk-32MCUW2P-D8U-Oy6M.js +206 -0
  10. package/lib/mermaid/chunk-3NPNU5GP-8WYybYAh.js +1 -0
  11. package/lib/mermaid/chunk-3SMGFRGC-C0WC5bhP.js +1 -0
  12. package/lib/mermaid/chunk-4CAJECRU-C_QnaDal.js +15 -0
  13. package/lib/mermaid/chunk-4OADUZ5Q-DHE3k_pb.js +10 -0
  14. package/lib/mermaid/chunk-5IMINLNL-Cl3N81sR.js +1 -0
  15. package/lib/mermaid/chunk-5IQCK5RY-Df5Ppxew.js +3 -0
  16. package/lib/mermaid/chunk-5MVFYWFU-DgXg5u6h.js +1 -0
  17. package/lib/mermaid/chunk-AQ6EADP3-CZhslHi-.js +1 -0
  18. package/lib/mermaid/chunk-AZZRMDJM-y-xJBuMz.js +15 -0
  19. package/lib/mermaid/chunk-CLS4B6BI-BRLlisnG.js +168 -0
  20. package/lib/mermaid/chunk-DZP67EKU-9RpG5Rdc.js +70 -0
  21. package/lib/mermaid/chunk-EICP7K5X-8YS1Gtlr.js +1 -0
  22. package/lib/mermaid/chunk-GDY2UAB4-QtXfmDIW.js +1 -0
  23. package/lib/mermaid/chunk-H7VHZCWX-CwFRFlEn.js +1 -0
  24. package/lib/mermaid/chunk-IJBDOHL6-CgcssvZb.js +1 -0
  25. package/lib/mermaid/chunk-JFFVMJIA-Cx1_ZSMR.js +1 -0
  26. package/lib/mermaid/chunk-JQRUD6KW-Dbva2Z17.js +1 -0
  27. package/lib/mermaid/chunk-JZGDI5JK-BspJQ1vQ.js +1 -0
  28. package/lib/mermaid/chunk-KD6SPIPN-4bKl37hM.js +2 -0
  29. package/lib/mermaid/chunk-NF366YI6-D1lnbapv.js +231 -0
  30. package/lib/mermaid/chunk-NUDPKBEF-CL0e9XiQ.js +34 -0
  31. package/lib/mermaid/chunk-OJINMHTS-rKnCIFV0.js +1 -0
  32. package/lib/mermaid/chunk-Q6NGPIAH-CM9NYxWM.js +2 -0
  33. package/lib/mermaid/chunk-QJSWEUOL-kvKBktmc.js +133 -0
  34. package/lib/mermaid/chunk-R7JDMUKV-CSyCOfYj.js +1 -0
  35. package/lib/mermaid/chunk-RCXAM2GK-BeKcutEV.js +1 -0
  36. package/lib/mermaid/chunk-RT4MAWR3-Cv_8LyN5.js +1 -0
  37. package/lib/mermaid/chunk-SFMINX4W-BW2NSwFJ.js +1 -0
  38. package/lib/mermaid/chunk-SLDQ463B-D15xTdNW.js +88 -0
  39. package/lib/mermaid/chunk-STOV2HOB-GnExfzIX.js +1 -0
  40. package/lib/mermaid/chunk-T5OCTHI4-DdZvN-9i.js +1 -0
  41. package/lib/mermaid/chunk-TCEHX7R3-BXjgPiQF.js +1 -0
  42. package/lib/mermaid/chunk-VQC2EELJ-sGo2yn97.js +1 -0
  43. package/lib/mermaid/chunk-VRZKL3EH-BzaZ6KlD.js +1 -0
  44. package/lib/mermaid/chunk-VTHDQ7BV-BqUEu5Ml.js +1 -0
  45. package/lib/mermaid/chunk-VY2OSTJR-BYk2nUI_.js +2 -0
  46. package/lib/mermaid/chunk-WUBWJARI-Z8MI6quX.js +1 -0
  47. package/lib/mermaid/chunk-YBMQ5JGJ-DlZ1nCKo.js +2 -0
  48. package/lib/mermaid/chunk-YDMLL4PJ-BHgx6nXf.js +1 -0
  49. package/lib/mermaid/chunk-Z6V44ARX-CWGOZvke.js +62 -0
  50. package/lib/mermaid/chunk-ZJJ7VQJP-CZ7qJzqZ.js +340 -0
  51. package/lib/mermaid/chunk-ZNLK7HRR-B-wIfXTw.js +1 -0
  52. package/lib/mermaid/chunk-ZQN7UHIL-CNp35E78.js +1 -0
  53. package/lib/mermaid/chunk-ZS6VBONO-D-IFTJgn.js +175 -0
  54. package/lib/mermaid/chunk-ZUNWM646-DRKPDcQl.js +1 -0
  55. package/lib/mermaid/classDiagram-FGAMPOII-D1sf64vv.js +1 -0
  56. package/lib/mermaid/classDiagram-v2-AI5RJEK4-D1sf64vv.js +1 -0
  57. package/lib/mermaid/cose-bilkent-Q72C2OJ3-iX90typn.js +1 -0
  58. package/lib/mermaid/cynefin-OW5HDTMX-6OCTWOGG-6jDAiaRu.js +1 -0
  59. package/lib/mermaid/cynefinDiagram-2OOWUY4M-5ACKe62t.js +62 -0
  60. package/lib/mermaid/dagre-MPVFI544-BUrJjGwd.js +4 -0
  61. package/lib/mermaid/diagram-AE4NWXFW-B3Lkw8MS.js +24 -0
  62. package/lib/mermaid/diagram-BUJID5UG-p2ajLLgr.js +41 -0
  63. package/lib/mermaid/diagram-C44CZ5NI-CO0U1GX-.js +24 -0
  64. package/lib/mermaid/diagram-EYOLEXXS-DDoUndBV.js +30 -0
  65. package/lib/mermaid/diagram-P7B6PWOJ-C_dSNQyG.js +3 -0
  66. package/lib/mermaid/ebnfDiagram-FTPZ3PV6-DIwB5te0.js +1 -0
  67. package/lib/mermaid/erDiagram-H3ERR26V-CN4pCzIq.js +99 -0
  68. package/lib/mermaid/eventmodeling-NTZA5JFV-WKSWQHFS-Ruta89_N.js +1 -0
  69. package/lib/mermaid/flowDiagram-YHGXBVSY-CrSHzFwR.js +1 -0
  70. package/lib/mermaid/ganttDiagram-RWFTB7ED-C-rfEOn5.js +292 -0
  71. package/lib/mermaid/gitGraph-4MIJSDKK-JH2HKYUO-B76vihW5.js +1 -0
  72. package/lib/mermaid/gitGraphDiagram-MAR6GKOP-peAd7EYO.js +106 -0
  73. package/lib/mermaid/index.js +15 -0
  74. package/lib/mermaid/info-A6RAGUB7-3TX3OFWW-DykwOJ0Z.js +1 -0
  75. package/lib/mermaid/infoDiagram-LV547AFH-C46dOKDG.js +2 -0
  76. package/lib/mermaid/ishikawaDiagram-PUJQGNDS-DUmHXvO9.js +70 -0
  77. package/lib/mermaid/journeyDiagram-EW5QJT4W-CNAhUHsQ.js +139 -0
  78. package/lib/mermaid/kanban-definition-JSQERAZB-uOEoksHt.js +89 -0
  79. package/lib/mermaid/katex-CZ4GXH2S-CaEE-8Xf.js +257 -0
  80. package/lib/mermaid/mindmap-definition-VBJCLQLM-DZceCWFq.js +96 -0
  81. package/lib/mermaid/packet-AYTQ26CC-MKII6P3Y-XqJQX7OO.js +1 -0
  82. package/lib/mermaid/pegDiagram-7WILOQTJ-DMKA8PUf.js +1 -0
  83. package/lib/mermaid/pie-WAS4IAKB-6B4OPMJ5-DpoRuAye.js +1 -0
  84. package/lib/mermaid/pieDiagram-EFA7CBSB-BzO4xw8C.js +39 -0
  85. package/lib/mermaid/quadrantDiagram-WARVYA7P-DMQd2xKZ.js +7 -0
  86. package/lib/mermaid/radar-RG4KPBEZ-UPTR3XUL-BcwE6tO1.js +1 -0
  87. package/lib/mermaid/railroad-74A4TZTK-MEFUPFMS-B2Kwx3Uk.js +1 -0
  88. package/lib/mermaid/railroad-abnf-HS5TGJTU-R5YG2S5D-uBY3fYzG.js +1 -0
  89. package/lib/mermaid/railroad-ebnf-LZEXJU2U-G5QEX2L6-AhpzdU_3.js +1 -0
  90. package/lib/mermaid/railroad-peg-WCYAUIDC-H5I2ZRY2-CrsmP7-8.js +1 -0
  91. package/lib/mermaid/railroadDiagram-5NIQVNLQ-BGyZ628g.js +1 -0
  92. package/lib/mermaid/requirementDiagram-SXREGOKZ-CtCO7u9U.js +84 -0
  93. package/lib/mermaid/sankeyDiagram-VV74M2VP-CPXqmSKK.js +40 -0
  94. package/lib/mermaid/sequenceDiagram-52ZFIFDL-B1rSqWZp.js +162 -0
  95. package/lib/mermaid/sizeCapture-FGA5AGYP-BEqQzsxs.js +1 -0
  96. package/lib/mermaid/stateDiagram-3QAKPIVI-3KzWPUq3.js +1 -0
  97. package/lib/mermaid/stateDiagram-v2-HN2P4RDZ-dXASbYMy.js +1 -0
  98. package/lib/mermaid/swimlanes-QLVP42QD-CLpR90IY.js +1 -0
  99. package/lib/mermaid/swimlanesDiagram-JKPDBFCN-C2sgVGQE.js +8 -0
  100. package/lib/mermaid/timeline-definition-GS45XAXW-DLn0_RV5.js +120 -0
  101. package/lib/mermaid/treeView-Q6P3EWNA-ZRJGANNQ-u1bD1sZ1.js +1 -0
  102. package/lib/mermaid/treemap-WGGIJYW6-K64VN5AS-DrIaTBlj.js +1 -0
  103. package/lib/mermaid/vennDiagram-QIQU2ZRJ-FxbUp7-Z.js +34 -0
  104. package/lib/mermaid/wardley-WFR3VGLG-D67OWCCH-Br9hyuFK.js +1 -0
  105. package/lib/mermaid/wardleyDiagram-U6YNM66N-l-Kvr0Az.js +78 -0
  106. package/lib/mermaid/xychartDiagram-XJAZEDNM-O9bztWNh.js +7 -0
  107. package/lib/plugins.mjs +213 -162
  108. package/package.json +3 -10
  109. package/sources/parts/document/document.part.html +7 -7
  110. package/sources/parts/header/header.part.html +2 -2
  111. package/sources/parts/header/header.style.css +4 -2
  112. package/sources/parts/mermaid/mermaid.part.html +1 -1
  113. package/sources/parts/pagefind/pagefind.part.html +5 -3
  114. package/sources/parts/sidebar/sidebar.part.html +1 -1
  115. package/sources/parts/sidebar/sidebar.style.css +10 -0
  116. package/sources/parts/table-of-content/table-of-content-desktop.part.html +2 -2
  117. package/sources/scripts/mermaid.ts +3 -1
package/README.md CHANGED
@@ -33,7 +33,7 @@ export default defineConfig({
33
33
  }),
34
34
 
35
35
  plugins.htmlLayoutPlugin({ tags: ["layout", "part", "icon"] }),
36
- theme.HtmlCodeBlockPlugin({ rehypeExpressiveCodeOptions }),
36
+ theme.htmlCodeBlockPlugin({ rehypeExpressiveCodeOptions }),
37
37
  theme.katexFontsPlugin(),
38
38
  theme.pagefindPlugin(),
39
39
  theme.llmsPlugin({ siteUrl: "https://example.com" }),
@@ -90,12 +90,8 @@ Copy this as `sources/layouts/document.layout.html` and edit the names:
90
90
  </head>
91
91
 
92
92
  <body>
93
- <part
94
- maxHeading="{{ $data.maxHeading ?? 3 }}"
95
- minHeading="{{ $data.minHeading ?? 2 }}"
96
- src="@staticbolt/docs/parts/document/document.part.html"
97
- title="My Project"
98
- >
93
+ <part inherit src="@staticbolt/docs/parts/document/document.part.html" title="My Project">
94
+ <slot name="sidebar" slot="sidebar"></slot>
99
95
  <part slot="icons" src="@parts/social-icons/social-icons.part.html"></part>
100
96
  <slot />
101
97
  </part>
@@ -107,17 +103,17 @@ Copy this as `sources/layouts/document.layout.html` and edit the names:
107
103
 
108
104
  To change the page structure, copy `node_modules/@staticbolt/docs/sources/parts/document/document.part.html` into the project and point the layout at the copy; it references the other parts by package path, so it works as is.
109
105
 
110
- | Part | Role |
111
- | --------------------- | -------------------------------------------------------------------------------------------- |
112
- | `document` | The whole page. `title`, `minHeading`, `maxHeading`, `mermaid`, slot `icons`, default slot. |
113
- | `header` | Takes `title`. Slot `icons` for the social links. |
114
- | `sidebar` | Filled by `contentPlugin`. Slot `icons` for the social links. |
115
- | `table-of-content` | `-desktop` takes `minHeading` and `maxHeading`, `-mobile` none. |
116
- | `pagination-links` | Previous/next links read from the sidebar. |
117
- | `callouts` | Build-time script turning collapsible callouts into accordions. |
118
- | `mermaid` | Renders ` ```mermaid ` fences. Removes itself from pages without. Needs `mermaid` installed. |
119
- | `color-scheme-switch` | Already inside header and sidebar. |
120
- | `badge` | Used by the sidebar for `data.badgeText` / `data.badgeVariant`. |
106
+ | Part | Role |
107
+ | --------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
108
+ | `document` | The whole page. `title`, `minHeading`, `maxHeading`, `mermaid`, slots `sidebar` and `icons`, default slot. |
109
+ | `header` | Takes `title`. Slot `icons` for the social links. |
110
+ | `sidebar` | Default slot for the tree, filled by `contentPlugin` through the layout's `sidebar` slot. Slot `icons` for the social links. |
111
+ | `table-of-content` | `-desktop` takes `minHeading` and `maxHeading`, `-mobile` none. |
112
+ | `pagination-links` | Previous/next links read from the sidebar. |
113
+ | `callouts` | Build-time script turning collapsible callouts into accordions. |
114
+ | `mermaid` | Renders ` ```mermaid ` fences. Removes itself from pages without. |
115
+ | `color-scheme-switch` | Already inside header and sidebar. |
116
+ | `badge` | Used by the sidebar for `data.badgeText` / `data.badgeVariant`. |
121
117
 
122
118
  ## Styles
123
119
 
@@ -145,4 +141,5 @@ Any `--sb-*` variable from `global.css` can be overridden the same way.
145
141
  ## Overriding a part
146
142
 
147
143
  Copy it from `node_modules/@staticbolt/docs/sources/parts/` into the project and point the layout at the copy.
148
- For the sidebar parts pass the copy through `contentPlugin`'s `sidebarLayout`, `directoryLayout`, or `linkLayout`.
144
+ For the folder and link parts pass the copy through `contentPlugin`'s `directoryLayout` or `linkLayout`.
145
+ A layout of your own has to forward the `sidebar` slot down to the sidebar part, as the one above does.
package/lib/index.d.mts CHANGED
@@ -5,7 +5,6 @@ import { Root } from "hast";
5
5
  import { LanguageRegistration } from "shiki";
6
6
  import { Plugin as Plugin$1 } from "unified";
7
7
  import { Root as Root$1 } from "mdast";
8
- import { Node } from "unist";
9
8
  //#region plugins/code-block-plugin.d.ts
10
9
  interface HtmlCodeBlockPlugin {
11
10
  /**
@@ -21,7 +20,7 @@ interface HtmlCodeBlockPlugin {
21
20
  * replaces the tag with a syntax highlighted code block. Use the `lang` attribute to set the language, and the other attributes
22
21
  * for the rest of the expressive-code metadata.
23
22
  */
24
- declare function HtmlCodeBlockPlugin(options?: HtmlCodeBlockPlugin): Plugin;
23
+ declare function htmlCodeBlockPlugin(options?: HtmlCodeBlockPlugin): Plugin;
25
24
  //#endregion
26
25
  //#region plugins/collapsible-plugin.d.ts
27
26
  interface CollapsiblePluginOptions {
@@ -161,38 +160,32 @@ interface ContentPluginOptions {
161
160
  * @default true
162
161
  */
163
162
  collapsed?: boolean;
164
- /** Defines the layout name/path to be used for markdown files. */
163
+ /**
164
+ * Words written as listed in the titles derived from file and directory names, on top of the built-in set (`API`, `CLI`, `CSS`,
165
+ * `HTML`, `JSON`, `SVG`, `URL`, ...). Whole words only, matched case-insensitively: `cli.md` shows as "CLI", and with `"i18n"`
166
+ * listed `i18n.md` stays "i18n".
167
+ *
168
+ * @example
169
+ * ({ acronyms: ["SDK", "OAuth", "i18n", "ESLint"] });
170
+ */
171
+ acronyms?: string[];
172
+ /**
173
+ * Defines the layout name/path to be used for markdown files.\
174
+ * The sidebar tree goes into the layout's `sidebar` slot, so every layout listed here has to carry a `<slot name="sidebar">`,
175
+ * or forward one to the part that does.
176
+ */
165
177
  layouts: {
166
178
  default: string;
167
179
  [key: string]: string;
168
180
  };
169
- /** The layout into which the generated sidebar HTML will be injected. */
170
- sidebarLayout?: {
171
- /**
172
- * Path to the layout file.
173
- *
174
- * @default the theme's `sidebar.part.html`
175
- */
176
- path?: string;
177
- /**
178
- * The custom-element tag name used for this layout.
179
- *
180
- * If omitted, the tag name will be auto extracted from the layout path
181
- */
182
- tag?: string;
183
- /**
184
- * The attribute on the layout tag that holds the source path.
185
- *
186
- * @default "src"
187
- */
188
- sourceAttribute?: string;
189
- /**
190
- * The slot name into which the sidebar is inserted.
191
- *
192
- * @default "sidebar"
193
- */
194
- slotName?: string;
195
- };
181
+ /**
182
+ * Key/value pairs added to every page's front matter, so they reach the layout tag as attributes.\
183
+ * A page's own front matter wins. The keys the plugin consumes itself, `layout`, `publish` and `sidebar.*`, are ignored.
184
+ *
185
+ * @example
186
+ * ({ data: { version: "2.0", "data-repo": "https://..." } });
187
+ */
188
+ data?: Record<string, unknown>;
196
189
  /** The layout used to render a collapsible directory node. */
197
190
  directoryLayout?: {
198
191
  /**
@@ -241,7 +234,8 @@ interface ContentPluginOptions {
241
234
  declare function contentPlugin(options: ContentPluginOptions): Plugin;
242
235
  //#endregion
243
236
  //#region plugins/content-plugin/helpers.d.ts
244
- declare function normalizeTitle(string: string): string;
237
+ /** Turns a file or directory name into a title: separators to spaces, every word capitalized, listed words as listed. */
238
+ declare function normalizeTitle(string: string, acronyms?: readonly string[]): string;
245
239
  //#endregion
246
240
  //#region plugins/ec-cache.d.ts
247
241
  declare function sha1(input: string): string;
@@ -293,6 +287,25 @@ interface LlmsPluginOptions {
293
287
  title?: string;
294
288
  /** One-line summary quoted under the heading. */
295
289
  summary?: string;
290
+ /**
291
+ * Glob patterns for the pages to list.
292
+ *
293
+ * @default ["pages/**\/*.md"]
294
+ */
295
+ include?: string[];
296
+ /**
297
+ * Glob patterns to leave out.
298
+ *
299
+ * @default [ ]
300
+ */
301
+ exclude?: string[];
302
+ /**
303
+ * Path of the pair of files, relative to the output directory and without the extension: `"llms"` writes `llms.txt` and
304
+ * `llms-full.txt`. Give each plugin a path of its own when a site runs more than one.
305
+ *
306
+ * @default "llms"
307
+ */
308
+ output?: string;
296
309
  }
297
310
  /**
298
311
  * Writes `llms.txt` and `llms-full.txt`, plus a copy of every page's markdown beside its HTML.
@@ -372,15 +385,29 @@ declare const remarkObsidianTags: Plugin$1<[], Root$1>;
372
385
  //#region plugins/pagefind-plugin.d.ts
373
386
  interface PagefindPluginOptions {
374
387
  /**
375
- * Glob, relative to the output directory, selecting the pages to index.
388
+ * Directory to index, relative to the output directory. Result URLs are relative to it, so the bundle has to sit inside it for
389
+ * Pagefind to resolve them: `root: "core"` indexes `core/` and writes `core/pagefind/`.
390
+ *
391
+ * @default "."
392
+ */
393
+ root?: string;
394
+ /**
395
+ * Glob, relative to `root`, selecting the pages to index.
376
396
  *
377
397
  * @default "**\/*.html"
378
398
  */
379
399
  glob?: string;
400
+ /**
401
+ * Directory the index is written to, relative to the output directory. The `pagefind` part's `bundle` attribute has to point at
402
+ * it.
403
+ *
404
+ * @default `${root}/pagefind`
405
+ */
406
+ output?: string;
380
407
  }
381
- declare function pagefindPlugin({ glob }?: PagefindPluginOptions): Plugin;
408
+ declare function pagefindPlugin(options?: PagefindPluginOptions): Plugin;
382
409
  //#endregion
383
410
  //#region plugins/wrap-table.d.ts
384
- declare function wrapTables(): (tree: Node) => void;
411
+ declare function wrapTables(): (tree: Root) => void;
385
412
  //#endregion
386
- export { CollapsiblePluginOptions, HtmlCodeBlockPlugin, PersistentCache, RemarkObsidianCommentsOptions, cachedRehypeExpressiveCode, contentPlugin, ecCachePlugin, ecCacheSalt, htmlWithTypeScriptScripts, katexFontsPlugin, llmsPlugin, normalizeTitle, pagefindPlugin, pluginCollapsible, rehypeMermaidFence, remarkObsidianComments, remarkObsidianTags, sha1, wrapTables };
413
+ export { CollapsiblePluginOptions, HtmlCodeBlockPlugin, PersistentCache, RemarkObsidianCommentsOptions, cachedRehypeExpressiveCode, contentPlugin, ecCachePlugin, ecCacheSalt, htmlCodeBlockPlugin, htmlWithTypeScriptScripts, katexFontsPlugin, llmsPlugin, normalizeTitle, pagefindPlugin, pluginCollapsible, rehypeMermaidFence, remarkObsidianComments, remarkObsidianTags, sha1, wrapTables };
@@ -0,0 +1 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{q as t}from"./chunk-H7VHZCWX-CwFRFlEn.js";import"./chunk-QJSWEUOL-kvKBktmc.js";import"./chunk-IJBDOHL6-CgcssvZb.js";import{n,r,t as i}from"./chunk-SLDQ463B-D15xTdNW.js";import{t as a}from"./chunk-JQRUD6KW-Dbva2Z17.js";import"./chunk-ZS6VBONO-D-IFTJgn.js";import{n as o}from"./chunk-5IQCK5RY-Df5Ppxew.js";import"./chunk-JZGDI5JK-BspJQ1vQ.js";import"./chunk-OJINMHTS-rKnCIFV0.js";import"./chunk-VQC2EELJ-sGo2yn97.js";import"./chunk-KD6SPIPN-4bKl37hM.js";import"./chunk-Q6NGPIAH-CM9NYxWM.js";import{n as s}from"./chunk-RT4MAWR3-Cv_8LyN5.js";import"./chunk-YBMQ5JGJ-DlZ1nCKo.js";import"./chunk-GDY2UAB4-QtXfmDIW.js";import"./chunk-3SMGFRGC-C0WC5bhP.js";import"./chunk-3NPNU5GP-8WYybYAh.js";import"./chunk-TCEHX7R3-BXjgPiQF.js";import"./chunk-5MVFYWFU-DgXg5u6h.js";import"./chunk-SFMINX4W-BW2NSwFJ.js";import"./chunk-JFFVMJIA-Cx1_ZSMR.js";import"./chunk-ZUNWM646-DRKPDcQl.js";var c=s().RailroadAbnf.parser.LangiumParser,l=e(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=e(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=e(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=e(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=e(e=>{switch(e.$type){case`AbnfStringLiteral`:return{type:`terminal`,value:e.value};case`AbnfNumVal`:return{type:`terminal`,value:e.value};case`AbnfRuleName`:return{type:`nonterminal`,name:e.name};case`AbnfGroup`:return l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=e(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=e(e=>{a(e,r),e.title&&r.setTitle(e.title),e.rules.map(e=>r.addRule(m(e)))},`populateDb`),g={parser:{parse:e(e=>{r.clear(),t.debug(`[ABNF Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new o(n);let i=n.value;t.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),t.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:r}},db:r,renderer:n,styles:i};export{g as diagram};
@@ -0,0 +1 @@
1
+ import"./chunk-ZS6VBONO-D-IFTJgn.js";import{t as e}from"./chunk-JFFVMJIA-Cx1_ZSMR.js";export{e as createArchitectureServices};