@xyd-js/plugin-xspec 0.0.0-build-83b15db-20251213220910

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) LiveSession Sp.z.o.o
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ import 'react';
2
+ import './types-CqkxD8ad.js';
3
+ export { default as XSpecSection, default } from './XSpecSection.js';
@@ -0,0 +1,53 @@
1
+ // src/components/XSpecSection.tsx
2
+ import React2 from "react";
3
+
4
+ // src/components/XSpecHeader.tsx
5
+ import React from "react";
6
+ function XSpecHeader({
7
+ id,
8
+ secid,
9
+ title,
10
+ level = "h1",
11
+ dataSource
12
+ }) {
13
+ const HeadingTag = level;
14
+ return /* @__PURE__ */ React.createElement(HeadingTag, { "data-source": dataSource }, /* @__PURE__ */ React.createElement("span", { className: "spec-secid", title: "link to this section" }, /* @__PURE__ */ React.createElement("a", { href: `#${id}` }, secid)), title);
15
+ }
16
+
17
+ // src/components/XSpecSection.tsx
18
+ function XSpecSection({
19
+ id,
20
+ secid,
21
+ title,
22
+ headingLevel = "h1",
23
+ dataSource,
24
+ children,
25
+ className,
26
+ indexSpec = false
27
+ }) {
28
+ return /* @__PURE__ */ React2.createElement(
29
+ "section",
30
+ {
31
+ id,
32
+ ...{ secid },
33
+ className: `${className || ""} ${indexSpec ? "spec-index" : ""}`
34
+ },
35
+ /* @__PURE__ */ React2.createElement(
36
+ XSpecHeader,
37
+ {
38
+ id,
39
+ secid,
40
+ title,
41
+ level: headingLevel,
42
+ dataSource
43
+ }
44
+ ),
45
+ children
46
+ );
47
+ }
48
+ var XSpecSection_default = XSpecSection;
49
+ export {
50
+ XSpecSection,
51
+ XSpecSection_default as default
52
+ };
53
+ //# sourceMappingURL=Section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/XSpecSection.tsx","../src/components/XSpecHeader.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SpecSectionProps } from \"../types\";\nimport { XSpecHeader } from \"./XSpecHeader\";\n\nexport function XSpecSection({\n id,\n secid,\n title,\n headingLevel = \"h1\",\n dataSource,\n children,\n className,\n indexSpec = false,\n}: SpecSectionProps) {\n return (\n <section\n id={id}\n {...({ secid } as any)}\n className={`${className || ''} ${indexSpec ? \"spec-index\" : ''}`}\n >\n <XSpecHeader\n id={id}\n secid={secid}\n title={title}\n level={headingLevel}\n dataSource={dataSource}\n />\n {children}\n </section>\n );\n}\n\nexport default XSpecSection\n\n\n","import React from \"react\";\n\nimport type { SpecHeaderProps } from \"../types\";\n\nexport function XSpecHeader({\n id,\n secid,\n title,\n level = \"h1\",\n dataSource,\n}: SpecHeaderProps) {\n const HeadingTag = level;\n\n return (\n <HeadingTag data-source={dataSource}>\n <span className=\"spec-secid\" title=\"link to this section\">\n <a href={`#${id}`}>{secid}</a>\n </span>\n {title}\n </HeadingTag>\n );\n}\n"],"mappings":";AAAA,OAAOA,YAAW;;;ACAlB,OAAO,WAAW;AAIX,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AACF,GAAoB;AAClB,QAAM,aAAa;AAEnB,SACE,oCAAC,cAAW,eAAa,cACvB,oCAAC,UAAK,WAAU,cAAa,OAAM,0BACjC,oCAAC,OAAE,MAAM,IAAI,EAAE,MAAK,KAAM,CAC5B,GACC,KACH;AAEJ;;;ADhBO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AACd,GAAqB;AACnB,SACE,gBAAAC,OAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACC,GAAI,EAAE,MAAM;AAAA,MACb,WAAW,GAAG,aAAa,EAAE,IAAI,YAAY,eAAe,EAAE;AAAA;AAAA,IAE9D,gBAAAA,OAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA,OAAO;AAAA,QACP;AAAA;AAAA,IACF;AAAA,IACC;AAAA,EACH;AAEJ;AAEA,IAAO,uBAAQ;","names":["React","React"]}
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import { S as SpecBoxProps, a as SpecHeaderProps, N as NavItem, P as ProductionItem } from './types-CqkxD8ad.js';
3
+ import XSpecSection from './XSpecSection.js';
4
+
5
+ declare function XSpecBox({ type, id, children, source }: SpecBoxProps): React.JSX.Element;
6
+
7
+ declare function XSpecHeader({ id, secid, title, level, dataSource, }: SpecHeaderProps): React.JSX.Element;
8
+
9
+ interface NavItemProps {
10
+ item: NavItem;
11
+ }
12
+ declare function XSpecNavItem({ item }: NavItemProps): React.JSX.Element;
13
+
14
+ interface SidebarItemProps {
15
+ item: NavItem;
16
+ }
17
+ declare function XSpecSidebarItem({ item }: SidebarItemProps): React.JSX.Element;
18
+
19
+ interface SidebarProps {
20
+ items: NavItem[];
21
+ }
22
+ declare function XSpecSidebar({ items }: SidebarProps): React.JSX.Element;
23
+
24
+ interface ProductionRuleProps {
25
+ production: ProductionItem;
26
+ }
27
+ declare function XSpecProductionRule({ production }: ProductionRuleProps): React.JSX.Element;
28
+
29
+ interface TableOfContentsProps {
30
+ items: NavItem[];
31
+ }
32
+ declare function XSpecTableOfContents({ items }: TableOfContentsProps): React.JSX.Element;
33
+
34
+ interface XSpecProps {
35
+ children: React.ReactNode;
36
+ }
37
+ declare function XSpec({ children }: XSpecProps): React.JSX.Element;
38
+ declare namespace XSpec {
39
+ var Box: typeof XSpecBox;
40
+ var Header: typeof XSpecHeader;
41
+ var Section: typeof XSpecSection;
42
+ var NavItem: typeof XSpecNavItem;
43
+ var SidebarItem: typeof XSpecSidebarItem;
44
+ var Sidebar: typeof XSpecSidebar;
45
+ var ProductionRule: typeof XSpecProductionRule;
46
+ var TableOfContents: typeof XSpecTableOfContents;
47
+ }
48
+
49
+ export { XSpec as default };
package/dist/XSpec.js ADDED
@@ -0,0 +1,131 @@
1
+ // src/components/XSpec.tsx
2
+ import React9 from "react";
3
+
4
+ // src/components/XSpecBox.tsx
5
+ import React from "react";
6
+ function XSpecBox({ type, id, children, source }) {
7
+ const classNames = {
8
+ note: "spec-note",
9
+ todo: "spec-todo",
10
+ example: "spec-example",
11
+ "counter-example": "spec-counter-example"
12
+ };
13
+ const labels = {
14
+ note: "Note",
15
+ todo: "Todo",
16
+ example: "Example",
17
+ "counter-example": "Counter Example"
18
+ };
19
+ return /* @__PURE__ */ React.createElement("div", { id, className: classNames[type], "data-source": source }, /* @__PURE__ */ React.createElement("a", { href: `#${id}` }, labels[type]), children);
20
+ }
21
+
22
+ // src/components/XSpecHeader.tsx
23
+ import React2 from "react";
24
+ function XSpecHeader({
25
+ id,
26
+ secid,
27
+ title,
28
+ level = "h1",
29
+ dataSource
30
+ }) {
31
+ const HeadingTag = level;
32
+ return /* @__PURE__ */ React2.createElement(HeadingTag, { "data-source": dataSource }, /* @__PURE__ */ React2.createElement("span", { className: "spec-secid", title: "link to this section" }, /* @__PURE__ */ React2.createElement("a", { href: `#${id}` }, secid)), title);
33
+ }
34
+
35
+ // src/components/XSpecSection.tsx
36
+ import React3 from "react";
37
+ function XSpecSection({
38
+ id,
39
+ secid,
40
+ title,
41
+ headingLevel = "h1",
42
+ dataSource,
43
+ children,
44
+ className,
45
+ indexSpec = false
46
+ }) {
47
+ return /* @__PURE__ */ React3.createElement(
48
+ "section",
49
+ {
50
+ id,
51
+ ...{ secid },
52
+ className: `${className || ""} ${indexSpec ? "spec-index" : ""}`
53
+ },
54
+ /* @__PURE__ */ React3.createElement(
55
+ XSpecHeader,
56
+ {
57
+ id,
58
+ secid,
59
+ title,
60
+ level: headingLevel,
61
+ dataSource
62
+ }
63
+ ),
64
+ children
65
+ );
66
+ }
67
+
68
+ // src/components/XSpecNavItem.tsx
69
+ import React4 from "react";
70
+ function XSpecNavItem({ item }) {
71
+ const hasChildren = item.children && item.children.length > 0;
72
+ return /* @__PURE__ */ React4.createElement("li", null, /* @__PURE__ */ React4.createElement("a", { href: item.href }, /* @__PURE__ */ React4.createElement("span", { className: "spec-secid" }, item.secid), item.label), hasChildren && /* @__PURE__ */ React4.createElement("ol", null, item.children.map((child) => /* @__PURE__ */ React4.createElement(XSpecNavItem, { key: child.id, item: child }))));
73
+ }
74
+
75
+ // src/components/XSpecSidebarItem.tsx
76
+ import React5 from "react";
77
+ function XSpecSidebarItem({ item }) {
78
+ const hasChildren = item.children && item.children.length > 0;
79
+ return /* @__PURE__ */ React5.createElement("li", { id: `_sidebar_${item.secid}`, className: "" }, /* @__PURE__ */ React5.createElement("a", { href: item.href }, /* @__PURE__ */ React5.createElement("span", { className: "spec-secid" }, item.secid), item.label), hasChildren && /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
80
+ "input",
81
+ {
82
+ ...{ hidden: "" },
83
+ className: "toggle",
84
+ type: "checkbox",
85
+ id: `_toggle_${item.secid}`
86
+ }
87
+ ), /* @__PURE__ */ React5.createElement("label", { htmlFor: `_toggle_${item.secid}` }), /* @__PURE__ */ React5.createElement("ol", null, item.children.map((child) => /* @__PURE__ */ React5.createElement(XSpecSidebarItem, { key: child.id, item: child })))));
88
+ }
89
+
90
+ // src/components/XSpecSidebar.tsx
91
+ import React6 from "react";
92
+ function XSpecSidebar({ items }) {
93
+ return /* @__PURE__ */ React6.createElement("div", { className: "spec-sidebar", "aria-hidden": "true" }, /* @__PURE__ */ React6.createElement("div", { className: "spec-toc" }, /* @__PURE__ */ React6.createElement("div", { className: "title" }, /* @__PURE__ */ React6.createElement("a", { href: "#" }, "Spec Markdown")), /* @__PURE__ */ React6.createElement("ol", null, items.map((item) => /* @__PURE__ */ React6.createElement(XSpecSidebarItem, { key: item.id, item })), /* @__PURE__ */ React6.createElement("li", { id: "_sidebar_index" }, /* @__PURE__ */ React6.createElement("a", { href: "#index" }, /* @__PURE__ */ React6.createElement("span", { className: "spec-secid" }, "\xA7"), "Index")))));
94
+ }
95
+
96
+ // src/components/XSpecProductionRule.tsx
97
+ import React7 from "react";
98
+ function XSpecProductionRule({ production }) {
99
+ if (production.useGrid && production.gridItems) {
100
+ const columns = production.columns || 5;
101
+ const rows = [];
102
+ for (let i = 0; i < production.gridItems.length; i += columns) {
103
+ rows.push(production.gridItems.slice(i, i + columns));
104
+ }
105
+ return /* @__PURE__ */ React7.createElement("div", { className: "spec-production", id: production.name }, /* @__PURE__ */ React7.createElement("span", { className: "spec-nt" }, /* @__PURE__ */ React7.createElement("a", { href: `#${production.name}`, "data-name": production.name }, production.name)), /* @__PURE__ */ React7.createElement("div", { className: "spec-oneof" }, /* @__PURE__ */ React7.createElement("div", { className: "spec-oneof-grid" }, /* @__PURE__ */ React7.createElement("table", null, /* @__PURE__ */ React7.createElement("tbody", null, rows.map((row, rowIndex) => /* @__PURE__ */ React7.createElement("tr", { key: rowIndex }, row.map((item, cellIndex) => /* @__PURE__ */ React7.createElement("td", { key: cellIndex, className: "spec-rhs" }, /* @__PURE__ */ React7.createElement("span", { className: "spec-t" }, item))))))))));
106
+ }
107
+ return /* @__PURE__ */ React7.createElement("div", { className: "spec-production", id: production.name }, /* @__PURE__ */ React7.createElement("span", { className: "spec-nt" }, /* @__PURE__ */ React7.createElement("a", { href: `#${production.name}`, "data-name": production.name }, production.name)), production.alternatives && production.alternatives.map((alt, altIndex) => /* @__PURE__ */ React7.createElement("div", { key: altIndex, className: "spec-rhs" }, alt.map((token, tokenIndex) => /* @__PURE__ */ React7.createElement("span", { key: tokenIndex, className: "spec-nt" }, /* @__PURE__ */ React7.createElement("span", { "data-name": token }, token))))));
108
+ }
109
+
110
+ // src/components/XSpecTableOfContents.tsx
111
+ import React8 from "react";
112
+ function XSpecTableOfContents({ items }) {
113
+ return /* @__PURE__ */ React8.createElement("nav", { className: "spec-toc" }, /* @__PURE__ */ React8.createElement("div", { className: "title" }, "Contents"), /* @__PURE__ */ React8.createElement("ol", null, items.map((item) => /* @__PURE__ */ React8.createElement(XSpecNavItem, { key: item.id, item }))));
114
+ }
115
+
116
+ // src/components/XSpec.tsx
117
+ function XSpec({ children }) {
118
+ return /* @__PURE__ */ React9.createElement("div", { className: "xspec" }, children);
119
+ }
120
+ XSpec.Box = XSpecBox;
121
+ XSpec.Header = XSpecHeader;
122
+ XSpec.Section = XSpecSection;
123
+ XSpec.NavItem = XSpecNavItem;
124
+ XSpec.SidebarItem = XSpecSidebarItem;
125
+ XSpec.Sidebar = XSpecSidebar;
126
+ XSpec.ProductionRule = XSpecProductionRule;
127
+ XSpec.TableOfContents = XSpecTableOfContents;
128
+ export {
129
+ XSpec as default
130
+ };
131
+ //# sourceMappingURL=XSpec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/XSpec.tsx","../src/components/XSpecBox.tsx","../src/components/XSpecHeader.tsx","../src/components/XSpecSection.tsx","../src/components/XSpecNavItem.tsx","../src/components/XSpecSidebarItem.tsx","../src/components/XSpecSidebar.tsx","../src/components/XSpecProductionRule.tsx","../src/components/XSpecTableOfContents.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { XSpecBox } from \"./XSpecBox\";\nimport { XSpecHeader } from \"./XSpecHeader\";\nimport { XSpecSection } from \"./XSpecSection\";\nimport { XSpecNavItem } from \"./XSpecNavItem\";\nimport { XSpecSidebarItem } from \"./XSpecSidebarItem\";\nimport { XSpecSidebar } from \"./XSpecSidebar\";\nimport { XSpecProductionRule } from \"./XSpecProductionRule\";\nimport { XSpecTableOfContents } from \"./XSpecTableOfContents\";\n\ninterface XSpecProps {\n children: React.ReactNode;\n}\n\n// Styles are now scoped via `.xspec` prefix in CSS\nexport default function XSpec({ children }: XSpecProps) {\n return <div className=\"xspec\">{children}</div>;\n}\n\nXSpec.Box = XSpecBox;\nXSpec.Header = XSpecHeader;\nXSpec.Section = XSpecSection;\nXSpec.NavItem = XSpecNavItem;\nXSpec.SidebarItem = XSpecSidebarItem;\nXSpec.Sidebar = XSpecSidebar;\nXSpec.ProductionRule = XSpecProductionRule;\nXSpec.TableOfContents = XSpecTableOfContents;\n","import React from \"react\";\n\nimport type { SpecBoxProps } from \"../types\";\n\nexport function XSpecBox({ type, id, children, source }: SpecBoxProps) {\n const classNames = {\n note: \"spec-note\",\n todo: \"spec-todo\",\n example: \"spec-example\",\n \"counter-example\": \"spec-counter-example\",\n };\n\n const labels = {\n note: \"Note\",\n todo: \"Todo\",\n example: \"Example\",\n \"counter-example\": \"Counter Example\",\n };\n\n return (\n <div id={id} className={classNames[type]} data-source={source}>\n <a href={`#${id}`}>{labels[type]}</a>\n {children}\n </div>\n );\n}\n","import React from \"react\";\n\nimport type { SpecHeaderProps } from \"../types\";\n\nexport function XSpecHeader({\n id,\n secid,\n title,\n level = \"h1\",\n dataSource,\n}: SpecHeaderProps) {\n const HeadingTag = level;\n\n return (\n <HeadingTag data-source={dataSource}>\n <span className=\"spec-secid\" title=\"link to this section\">\n <a href={`#${id}`}>{secid}</a>\n </span>\n {title}\n </HeadingTag>\n );\n}\n","import React from \"react\";\n\nimport type { SpecSectionProps } from \"../types\";\nimport { XSpecHeader } from \"./XSpecHeader\";\n\nexport function XSpecSection({\n id,\n secid,\n title,\n headingLevel = \"h1\",\n dataSource,\n children,\n className,\n indexSpec = false,\n}: SpecSectionProps) {\n return (\n <section\n id={id}\n {...({ secid } as any)}\n className={`${className || ''} ${indexSpec ? \"spec-index\" : ''}`}\n >\n <XSpecHeader\n id={id}\n secid={secid}\n title={title}\n level={headingLevel}\n dataSource={dataSource}\n />\n {children}\n </section>\n );\n}\n\nexport default XSpecSection\n\n\n","import React from \"react\";\n\nimport type { NavItem as NavItemType } from \"../types\";\n\ninterface NavItemProps {\n item: NavItemType;\n}\n\nexport function XSpecNavItem({ item }: NavItemProps) {\n const hasChildren = item.children && item.children.length > 0;\n\n return (\n <li>\n <a href={item.href}>\n <span className=\"spec-secid\">{item.secid}</span>\n {item.label}\n </a>\n {hasChildren && (\n <ol>\n {item.children!.map((child) => (\n <XSpecNavItem key={child.id} item={child} />\n ))}\n </ol>\n )}\n </li>\n );\n}\n","import React from \"react\";\n\nimport type { NavItem as NavItemType } from \"../types\";\n\ninterface SidebarItemProps {\n item: NavItemType;\n}\n\nexport function XSpecSidebarItem({ item }: SidebarItemProps) {\n const hasChildren = item.children && item.children.length > 0;\n\n return (\n <li id={`_sidebar_${item.secid}`} className=\"\">\n <a href={item.href}>\n <span className=\"spec-secid\">{item.secid}</span>\n {item.label}\n </a>\n {hasChildren && (\n <>\n <input\n {...({ hidden: \"\" } as any)}\n className=\"toggle\"\n type=\"checkbox\"\n id={`_toggle_${item.secid}`}\n />\n <label htmlFor={`_toggle_${item.secid}`} />\n <ol>\n {item.children!.map((child) => (\n <XSpecSidebarItem key={child.id} item={child} />\n ))}\n </ol>\n </>\n )}\n </li>\n );\n}\n","import React from \"react\";\n\nimport { XSpecSidebarItem } from \"./XSpecSidebarItem\";\nimport type { NavItem } from \"../types\";\n\ninterface SidebarProps {\n items: NavItem[];\n}\n\nexport function XSpecSidebar({ items }: SidebarProps) {\n return (\n <div className=\"spec-sidebar\" aria-hidden=\"true\">\n <div className=\"spec-toc\">\n <div className=\"title\">\n <a href=\"#\">Spec Markdown</a>\n </div>\n <ol>\n {items.map((item) => (\n <XSpecSidebarItem key={item.id} item={item} />\n ))}\n <li id=\"_sidebar_index\">\n <a href=\"#index\">\n <span className=\"spec-secid\">§</span>Index\n </a>\n </li>\n </ol>\n </div>\n </div>\n );\n}\n","import React from \"react\";\n\nimport type { ProductionItem } from \"../types\";\n\ninterface ProductionRuleProps {\n production: ProductionItem;\n}\n\nexport function XSpecProductionRule({ production }: ProductionRuleProps) {\n if (production.useGrid && production.gridItems) {\n const columns = production.columns || 5;\n const rows: string[][] = [];\n\n for (let i = 0; i < production.gridItems.length; i += columns) {\n rows.push(production.gridItems.slice(i, i + columns));\n }\n\n return (\n <div className=\"spec-production\" id={production.name}>\n <span className=\"spec-nt\">\n <a href={`#${production.name}`} data-name={production.name}>\n {production.name}\n </a>\n </span>\n <div className=\"spec-oneof\">\n <div className=\"spec-oneof-grid\">\n <table>\n <tbody>\n {rows.map((row, rowIndex) => (\n <tr key={rowIndex}>\n {row.map((item, cellIndex) => (\n <td key={cellIndex} className=\"spec-rhs\">\n <span className=\"spec-t\">{item}</span>\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"spec-production\" id={production.name}>\n <span className=\"spec-nt\">\n <a href={`#${production.name}`} data-name={production.name}>\n {production.name}\n </a>\n </span>\n {production.alternatives && production.alternatives.map((alt, altIndex) => (\n <div key={altIndex} className=\"spec-rhs\">\n {alt.map((token, tokenIndex) => (\n <span key={tokenIndex} className=\"spec-nt\">\n <span data-name={token}>{token}</span>\n </span>\n ))}\n </div>\n ))}\n </div>\n );\n}\n","import React from \"react\";\n\nimport { XSpecNavItem } from \"./XSpecNavItem\";\nimport type { NavItem as NavItemType } from \"../types\";\n\ninterface TableOfContentsProps {\n items: NavItemType[];\n}\n\nexport function XSpecTableOfContents({ items }: TableOfContentsProps) {\n return (\n <nav className=\"spec-toc\">\n <div className=\"title\">Contents</div>\n <ol>\n {items.map((item) => (\n <XSpecNavItem key={item.id} item={item} />\n ))}\n </ol>\n </nav>\n );\n}\n"],"mappings":";AAAA,OAAOA,YAAW;;;ACAlB,OAAO,WAAW;AAIX,SAAS,SAAS,EAAE,MAAM,IAAI,UAAU,OAAO,GAAiB;AACrE,QAAM,aAAa;AAAA,IACjB,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,mBAAmB;AAAA,EACrB;AAEA,QAAM,SAAS;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,mBAAmB;AAAA,EACrB;AAEA,SACE,oCAAC,SAAI,IAAQ,WAAW,WAAW,IAAI,GAAG,eAAa,UACrD,oCAAC,OAAE,MAAM,IAAI,EAAE,MAAK,OAAO,IAAI,CAAE,GAChC,QACH;AAEJ;;;ACzBA,OAAOC,YAAW;AAIX,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AACF,GAAoB;AAClB,QAAM,aAAa;AAEnB,SACE,gBAAAA,OAAA,cAAC,cAAW,eAAa,cACvB,gBAAAA,OAAA,cAAC,UAAK,WAAU,cAAa,OAAM,0BACjC,gBAAAA,OAAA,cAAC,OAAE,MAAM,IAAI,EAAE,MAAK,KAAM,CAC5B,GACC,KACH;AAEJ;;;ACrBA,OAAOC,YAAW;AAKX,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AACd,GAAqB;AACnB,SACE,gBAAAC,OAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACC,GAAI,EAAE,MAAM;AAAA,MACb,WA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,MAAM,iBAAiB;AACvB,MAAM,kBAAkB;","names":["React","React","React","React","React","React","React","React","React","React","React","React"]}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+
3
+ declare function XSpecPre({ ...props }: any): React.JSX.Element | null;
4
+
5
+ export { XSpecPre as default };
@@ -0,0 +1,36 @@
1
+ // src/components/XSpecPre.tsx
2
+ import React from "react";
3
+ import { Pre } from "codehike/code";
4
+ function XSpecPre({ ...props }) {
5
+ let highlighted = null;
6
+ if (props.highlighted) {
7
+ if (typeof props.highlighted === "string") {
8
+ try {
9
+ highlighted = JSON.parse(props.highlighted);
10
+ } catch (e) {
11
+ }
12
+ } else {
13
+ highlighted = props.highlighted;
14
+ }
15
+ }
16
+ const preProps = {
17
+ code: highlighted
18
+ };
19
+ if (typeof props?.attributes === "string") {
20
+ try {
21
+ const attrs = JSON.parse(props?.attributes);
22
+ if (attrs.class) {
23
+ preProps.className = attrs.class;
24
+ }
25
+ } catch (e) {
26
+ }
27
+ }
28
+ if (highlighted) {
29
+ return /* @__PURE__ */ React.createElement(Pre, { ...preProps });
30
+ }
31
+ return null;
32
+ }
33
+ export {
34
+ XSpecPre as default
35
+ };
36
+ //# sourceMappingURL=XSpecPre.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/XSpecPre.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Pre, type HighlightedCode } from \"codehike/code\";\n\nexport default function XSpecPre({ ...props }: any) {\n let highlighted: HighlightedCode | null = null;\n\n if (props.highlighted) {\n if (typeof props.highlighted === \"string\") {\n try {\n highlighted = JSON.parse(props.highlighted) as any as HighlightedCode;\n } catch (e) {}\n } else {\n highlighted = props.highlighted;\n }\n }\n\n const preProps = {\n code: highlighted,\n } as any;\n\n if (typeof props?.attributes === \"string\") {\n try {\n const attrs = JSON.parse(props?.attributes) as any;\n\n if (attrs.class) {\n preProps.className = attrs.class;\n }\n } catch (e) {}\n }\n\n if (highlighted) {\n return <Pre {...preProps} />;\n }\n\n return null;\n}\n"],"mappings":";AAAA,OAAO,WAAW;AAElB,SAAS,WAAiC;AAE3B,SAAR,SAA0B,EAAE,GAAG,MAAM,GAAQ;AAClD,MAAI,cAAsC;AAE1C,MAAI,MAAM,aAAa;AACrB,QAAI,OAAO,MAAM,gBAAgB,UAAU;AACzC,UAAI;AACF,sBAAc,KAAK,MAAM,MAAM,WAAW;AAAA,MAC5C,SAAS,GAAG;AAAA,MAAC;AAAA,IACf,OAAO;AACL,oBAAc,MAAM;AAAA,IACtB;AAAA,EACF;AAEA,QAAM,WAAW;AAAA,IACf,MAAM;AAAA,EACR;AAEA,MAAI,OAAO,OAAO,eAAe,UAAU;AACzC,QAAI;AACF,YAAM,QAAQ,KAAK,MAAM,OAAO,UAAU;AAE1C,UAAI,MAAM,OAAO;AACf,iBAAS,YAAY,MAAM;AAAA,MAC7B;AAAA,IACF,SAAS,GAAG;AAAA,IAAC;AAAA,EACf;AAEA,MAAI,aAAa;AACf,WAAO,oCAAC,OAAK,GAAG,UAAU;AAAA,EAC5B;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { b as SpecSectionProps } from './types-CqkxD8ad.js';
3
+
4
+ declare function XSpecSection({ id, secid, title, headingLevel, dataSource, children, className, indexSpec, }: SpecSectionProps): React.JSX.Element;
5
+
6
+ export { XSpecSection, XSpecSection as default };
@@ -0,0 +1,53 @@
1
+ // src/components/XSpecSection.tsx
2
+ import React2 from "react";
3
+
4
+ // src/components/XSpecHeader.tsx
5
+ import React from "react";
6
+ function XSpecHeader({
7
+ id,
8
+ secid,
9
+ title,
10
+ level = "h1",
11
+ dataSource
12
+ }) {
13
+ const HeadingTag = level;
14
+ return /* @__PURE__ */ React.createElement(HeadingTag, { "data-source": dataSource }, /* @__PURE__ */ React.createElement("span", { className: "spec-secid", title: "link to this section" }, /* @__PURE__ */ React.createElement("a", { href: `#${id}` }, secid)), title);
15
+ }
16
+
17
+ // src/components/XSpecSection.tsx
18
+ function XSpecSection({
19
+ id,
20
+ secid,
21
+ title,
22
+ headingLevel = "h1",
23
+ dataSource,
24
+ children,
25
+ className,
26
+ indexSpec = false
27
+ }) {
28
+ return /* @__PURE__ */ React2.createElement(
29
+ "section",
30
+ {
31
+ id,
32
+ ...{ secid },
33
+ className: `${className || ""} ${indexSpec ? "spec-index" : ""}`
34
+ },
35
+ /* @__PURE__ */ React2.createElement(
36
+ XSpecHeader,
37
+ {
38
+ id,
39
+ secid,
40
+ title,
41
+ level: headingLevel,
42
+ dataSource
43
+ }
44
+ ),
45
+ children
46
+ );
47
+ }
48
+ var XSpecSection_default = XSpecSection;
49
+ export {
50
+ XSpecSection,
51
+ XSpecSection_default as default
52
+ };
53
+ //# sourceMappingURL=XSpecSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/XSpecSection.tsx","../src/components/XSpecHeader.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SpecSectionProps } from \"../types\";\nimport { XSpecHeader } from \"./XSpecHeader\";\n\nexport function XSpecSection({\n id,\n secid,\n title,\n headingLevel = \"h1\",\n dataSource,\n children,\n className,\n indexSpec = false,\n}: SpecSectionProps) {\n return (\n <section\n id={id}\n {...({ secid } as any)}\n className={`${className || ''} ${indexSpec ? \"spec-index\" : ''}`}\n >\n <XSpecHeader\n id={id}\n secid={secid}\n title={title}\n level={headingLevel}\n dataSource={dataSource}\n />\n {children}\n </section>\n );\n}\n\nexport default XSpecSection\n\n\n","import React from \"react\";\n\nimport type { SpecHeaderProps } from \"../types\";\n\nexport function XSpecHeader({\n id,\n secid,\n title,\n level = \"h1\",\n dataSource,\n}: SpecHeaderProps) {\n const HeadingTag = level;\n\n return (\n <HeadingTag data-source={dataSource}>\n <span className=\"spec-secid\" title=\"link to this section\">\n <a href={`#${id}`}>{secid}</a>\n </span>\n {title}\n </HeadingTag>\n );\n}\n"],"mappings":";AAAA,OAAOA,YAAW;;;ACAlB,OAAO,WAAW;AAIX,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AACF,GAAoB;AAClB,QAAM,aAAa;AAEnB,SACE,oCAAC,cAAW,eAAa,cACvB,oCAAC,UAAK,WAAU,cAAa,OAAM,0BACjC,oCAAC,OAAE,MAAM,IAAI,EAAE,MAAK,KAAM,CAC5B,GACC,KACH;AAEJ;;;ADhBO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AACd,GAAqB;AACnB,SACE,gBAAAC,OAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACC,GAAI,EAAE,MAAM;AAAA,MACb,WAAW,GAAG,aAAa,EAAE,IAAI,YAAY,eAAe,EAAE;AAAA;AAAA,IAE9D,gBAAAA,OAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA,OAAO;AAAA,QACP;AAAA;AAAA,IACF;AAAA,IACC;AAAA,EACH;AAEJ;AAEA,IAAO,uBAAQ;","names":["React","React"]}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+
3
+ declare function XSpecWrapper({ children }: {
4
+ children: any;
5
+ }): React.JSX.Element;
6
+
7
+ export { XSpecWrapper as default };
@@ -0,0 +1,139 @@
1
+ // src/components/XSpecWrapper.tsx
2
+ import React10 from "react";
3
+
4
+ // src/components/XSpec.tsx
5
+ import React9 from "react";
6
+
7
+ // src/components/XSpecBox.tsx
8
+ import React from "react";
9
+ function XSpecBox({ type, id, children, source }) {
10
+ const classNames = {
11
+ note: "spec-note",
12
+ todo: "spec-todo",
13
+ example: "spec-example",
14
+ "counter-example": "spec-counter-example"
15
+ };
16
+ const labels = {
17
+ note: "Note",
18
+ todo: "Todo",
19
+ example: "Example",
20
+ "counter-example": "Counter Example"
21
+ };
22
+ return /* @__PURE__ */ React.createElement("div", { id, className: classNames[type], "data-source": source }, /* @__PURE__ */ React.createElement("a", { href: `#${id}` }, labels[type]), children);
23
+ }
24
+
25
+ // src/components/XSpecHeader.tsx
26
+ import React2 from "react";
27
+ function XSpecHeader({
28
+ id,
29
+ secid,
30
+ title,
31
+ level = "h1",
32
+ dataSource
33
+ }) {
34
+ const HeadingTag = level;
35
+ return /* @__PURE__ */ React2.createElement(HeadingTag, { "data-source": dataSource }, /* @__PURE__ */ React2.createElement("span", { className: "spec-secid", title: "link to this section" }, /* @__PURE__ */ React2.createElement("a", { href: `#${id}` }, secid)), title);
36
+ }
37
+
38
+ // src/components/XSpecSection.tsx
39
+ import React3 from "react";
40
+ function XSpecSection({
41
+ id,
42
+ secid,
43
+ title,
44
+ headingLevel = "h1",
45
+ dataSource,
46
+ children,
47
+ className,
48
+ indexSpec = false
49
+ }) {
50
+ return /* @__PURE__ */ React3.createElement(
51
+ "section",
52
+ {
53
+ id,
54
+ ...{ secid },
55
+ className: `${className || ""} ${indexSpec ? "spec-index" : ""}`
56
+ },
57
+ /* @__PURE__ */ React3.createElement(
58
+ XSpecHeader,
59
+ {
60
+ id,
61
+ secid,
62
+ title,
63
+ level: headingLevel,
64
+ dataSource
65
+ }
66
+ ),
67
+ children
68
+ );
69
+ }
70
+
71
+ // src/components/XSpecNavItem.tsx
72
+ import React4 from "react";
73
+ function XSpecNavItem({ item }) {
74
+ const hasChildren = item.children && item.children.length > 0;
75
+ return /* @__PURE__ */ React4.createElement("li", null, /* @__PURE__ */ React4.createElement("a", { href: item.href }, /* @__PURE__ */ React4.createElement("span", { className: "spec-secid" }, item.secid), item.label), hasChildren && /* @__PURE__ */ React4.createElement("ol", null, item.children.map((child) => /* @__PURE__ */ React4.createElement(XSpecNavItem, { key: child.id, item: child }))));
76
+ }
77
+
78
+ // src/components/XSpecSidebarItem.tsx
79
+ import React5 from "react";
80
+ function XSpecSidebarItem({ item }) {
81
+ const hasChildren = item.children && item.children.length > 0;
82
+ return /* @__PURE__ */ React5.createElement("li", { id: `_sidebar_${item.secid}`, className: "" }, /* @__PURE__ */ React5.createElement("a", { href: item.href }, /* @__PURE__ */ React5.createElement("span", { className: "spec-secid" }, item.secid), item.label), hasChildren && /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
83
+ "input",
84
+ {
85
+ ...{ hidden: "" },
86
+ className: "toggle",
87
+ type: "checkbox",
88
+ id: `_toggle_${item.secid}`
89
+ }
90
+ ), /* @__PURE__ */ React5.createElement("label", { htmlFor: `_toggle_${item.secid}` }), /* @__PURE__ */ React5.createElement("ol", null, item.children.map((child) => /* @__PURE__ */ React5.createElement(XSpecSidebarItem, { key: child.id, item: child })))));
91
+ }
92
+
93
+ // src/components/XSpecSidebar.tsx
94
+ import React6 from "react";
95
+ function XSpecSidebar({ items }) {
96
+ return /* @__PURE__ */ React6.createElement("div", { className: "spec-sidebar", "aria-hidden": "true" }, /* @__PURE__ */ React6.createElement("div", { className: "spec-toc" }, /* @__PURE__ */ React6.createElement("div", { className: "title" }, /* @__PURE__ */ React6.createElement("a", { href: "#" }, "Spec Markdown")), /* @__PURE__ */ React6.createElement("ol", null, items.map((item) => /* @__PURE__ */ React6.createElement(XSpecSidebarItem, { key: item.id, item })), /* @__PURE__ */ React6.createElement("li", { id: "_sidebar_index" }, /* @__PURE__ */ React6.createElement("a", { href: "#index" }, /* @__PURE__ */ React6.createElement("span", { className: "spec-secid" }, "\xA7"), "Index")))));
97
+ }
98
+
99
+ // src/components/XSpecProductionRule.tsx
100
+ import React7 from "react";
101
+ function XSpecProductionRule({ production }) {
102
+ if (production.useGrid && production.gridItems) {
103
+ const columns = production.columns || 5;
104
+ const rows = [];
105
+ for (let i = 0; i < production.gridItems.length; i += columns) {
106
+ rows.push(production.gridItems.slice(i, i + columns));
107
+ }
108
+ return /* @__PURE__ */ React7.createElement("div", { className: "spec-production", id: production.name }, /* @__PURE__ */ React7.createElement("span", { className: "spec-nt" }, /* @__PURE__ */ React7.createElement("a", { href: `#${production.name}`, "data-name": production.name }, production.name)), /* @__PURE__ */ React7.createElement("div", { className: "spec-oneof" }, /* @__PURE__ */ React7.createElement("div", { className: "spec-oneof-grid" }, /* @__PURE__ */ React7.createElement("table", null, /* @__PURE__ */ React7.createElement("tbody", null, rows.map((row, rowIndex) => /* @__PURE__ */ React7.createElement("tr", { key: rowIndex }, row.map((item, cellIndex) => /* @__PURE__ */ React7.createElement("td", { key: cellIndex, className: "spec-rhs" }, /* @__PURE__ */ React7.createElement("span", { className: "spec-t" }, item))))))))));
109
+ }
110
+ return /* @__PURE__ */ React7.createElement("div", { className: "spec-production", id: production.name }, /* @__PURE__ */ React7.createElement("span", { className: "spec-nt" }, /* @__PURE__ */ React7.createElement("a", { href: `#${production.name}`, "data-name": production.name }, production.name)), production.alternatives && production.alternatives.map((alt, altIndex) => /* @__PURE__ */ React7.createElement("div", { key: altIndex, className: "spec-rhs" }, alt.map((token, tokenIndex) => /* @__PURE__ */ React7.createElement("span", { key: tokenIndex, className: "spec-nt" }, /* @__PURE__ */ React7.createElement("span", { "data-name": token }, token))))));
111
+ }
112
+
113
+ // src/components/XSpecTableOfContents.tsx
114
+ import React8 from "react";
115
+ function XSpecTableOfContents({ items }) {
116
+ return /* @__PURE__ */ React8.createElement("nav", { className: "spec-toc" }, /* @__PURE__ */ React8.createElement("div", { className: "title" }, "Contents"), /* @__PURE__ */ React8.createElement("ol", null, items.map((item) => /* @__PURE__ */ React8.createElement(XSpecNavItem, { key: item.id, item }))));
117
+ }
118
+
119
+ // src/components/XSpec.tsx
120
+ function XSpec({ children }) {
121
+ return /* @__PURE__ */ React9.createElement("div", { className: "xspec" }, children);
122
+ }
123
+ XSpec.Box = XSpecBox;
124
+ XSpec.Header = XSpecHeader;
125
+ XSpec.Section = XSpecSection;
126
+ XSpec.NavItem = XSpecNavItem;
127
+ XSpec.SidebarItem = XSpecSidebarItem;
128
+ XSpec.Sidebar = XSpecSidebar;
129
+ XSpec.ProductionRule = XSpecProductionRule;
130
+ XSpec.TableOfContents = XSpecTableOfContents;
131
+
132
+ // src/components/XSpecWrapper.tsx
133
+ function XSpecWrapper({ children }) {
134
+ return /* @__PURE__ */ React10.createElement(XSpec, null, /* @__PURE__ */ React10.createElement("article", null, children));
135
+ }
136
+ export {
137
+ XSpecWrapper as default
138
+ };
139
+ //# sourceMappingURL=XSpecWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/XSpecWrapper.tsx","../src/components/XSpec.tsx","../src/components/XSpecBox.tsx","../src/components/XSpecHeader.tsx","../src/components/XSpecSection.tsx","../src/components/XSpecNavItem.tsx","../src/components/XSpecSidebarItem.tsx","../src/components/XSpecSidebar.tsx","../src/components/XSpecProductionRule.tsx","../src/components/XSpecTableOfContents.tsx"],"sourcesContent":["import React from \"react\";\n\nimport XSpec from \"./XSpec\";\n\nexport default function XSpecWrapper({children}) {\n return (\n <XSpec>\n <article>{children}</article>\n </XSpec>\n );\n}\n","import React from \"react\";\n\nimport { XSpecBox } from \"./XSpecBox\";\nimport { XSpecHeader } from \"./XSpecHeader\";\nimport { XSpecSection } from \"./XSpecSection\";\nimport { XSpecNavItem } from \"./XSpecNavItem\";\nimport { XSpecSidebarItem } from \"./XSpecSidebarItem\";\nimport { XSpecSidebar } from \"./XSpecSidebar\";\nimport { XSpecProductionRule } from \"./XSpecProductionRule\";\nimport { XSpecTableOfContents } from \"./XSpecTableOfContents\";\n\ninterface XSpecProps {\n children: React.ReactNode;\n}\n\n// Styles are now scoped via `.xspec` prefix in CSS\nexport default function XSpec({ children }: XSpecProps) {\n return <div className=\"xspec\">{children}</div>;\n}\n\nXSpec.Box = XSpecBox;\nXSpec.Header = XSpecHeader;\nXSpec.Section = XSpecSection;\nXSpec.NavItem = XSpecNavItem;\nXSpec.SidebarItem = XSpecSidebarItem;\nXSpec.Sidebar = XSpecSidebar;\nXSpec.ProductionRule = XSpecProductionRule;\nXSpec.TableOfContents = XSpecTableOfContents;\n","import React from \"react\";\n\nimport type { SpecBoxProps } from \"../types\";\n\nexport function XSpecBox({ type, id, children, source }: SpecBoxProps) {\n const classNames = {\n note: \"spec-note\",\n todo: \"spec-todo\",\n example: \"spec-example\",\n \"counter-example\": \"spec-counter-example\",\n };\n\n const labels = {\n note: \"Note\",\n todo: \"Todo\",\n example: \"Example\",\n \"counter-example\": \"Counter Example\",\n };\n\n return (\n <div id={id} className={classNames[type]} data-source={source}>\n <a href={`#${id}`}>{labels[type]}</a>\n {children}\n </div>\n );\n}\n","import React from \"react\";\n\nimport type { SpecHeaderProps } from \"../types\";\n\nexport function XSpecHeader({\n id,\n secid,\n title,\n level = \"h1\",\n dataSource,\n}: SpecHeaderProps) {\n const HeadingTag = level;\n\n return (\n <HeadingTag data-source={dataSource}>\n <span className=\"spec-secid\" title=\"link to this section\">\n <a href={`#${id}`}>{secid}</a>\n </span>\n {title}\n </HeadingTag>\n );\n}\n","import React from \"react\";\n\nimport type { SpecSectionProps } from \"../types\";\nimport { XSpecHeader } from \"./XSpecHeader\";\n\nexport function XSpecSection({\n id,\n secid,\n title,\n headingLevel = \"h1\",\n dataSource,\n children,\n className,\n indexSpec = false,\n}: SpecSectionProps) {\n return (\n <section\n id={id}\n {...({ secid } as any)}\n className={`${className || ''} ${indexSpec ? \"spec-index\" : ''}`}\n >\n <XSpecHeader\n id={id}\n secid={secid}\n title={title}\n level={headingLevel}\n dataSource={dataSource}\n />\n {children}\n </section>\n );\n}\n\nexport default XSpecSection\n\n\n","import React from \"react\";\n\nimport type { NavItem as NavItemType } from \"../types\";\n\ninterface NavItemProps {\n item: NavItemType;\n}\n\nexport function XSpecNavItem({ item }: NavItemProps) {\n const hasChildren = item.children && item.children.length > 0;\n\n return (\n <li>\n <a href={item.href}>\n <span className=\"spec-secid\">{item.secid}</span>\n {item.label}\n </a>\n {hasChildren && (\n <ol>\n {item.children!.map((child) => (\n <XSpecNavItem key={child.id} item={child} />\n ))}\n </ol>\n )}\n </li>\n );\n}\n","import React from \"react\";\n\nimport type { NavItem as NavItemType } from \"../types\";\n\ninterface SidebarItemProps {\n item: NavItemType;\n}\n\nexport function XSpecSidebarItem({ item }: SidebarItemProps) {\n const hasChildren = item.children && item.children.length > 0;\n\n return (\n <li id={`_sidebar_${item.secid}`} className=\"\">\n <a href={item.href}>\n <span className=\"spec-secid\">{item.secid}</span>\n {item.label}\n </a>\n {hasChildren && (\n <>\n <input\n {...({ hidden: \"\" } as any)}\n className=\"toggle\"\n type=\"checkbox\"\n id={`_toggle_${item.secid}`}\n />\n <label htmlFor={`_toggle_${item.secid}`} />\n <ol>\n {item.children!.map((child) => (\n <XSpecSidebarItem key={child.id} item={child} />\n ))}\n </ol>\n </>\n )}\n </li>\n );\n}\n","import React from \"react\";\n\nimport { XSpecSidebarItem } from \"./XSpecSidebarItem\";\nimport type { NavItem } from \"../types\";\n\ninterface SidebarProps {\n items: NavItem[];\n}\n\nexport function XSpecSidebar({ items }: SidebarProps) {\n return (\n <div className=\"spec-sidebar\" aria-hidden=\"true\">\n <div className=\"spec-toc\">\n <div className=\"title\">\n <a href=\"#\">Spec Markdown</a>\n </div>\n <ol>\n {items.map((item) => (\n <XSpecSidebarItem key={item.id} item={item} />\n ))}\n <li id=\"_sidebar_index\">\n <a href=\"#index\">\n <span className=\"spec-secid\">§</span>Index\n </a>\n </li>\n </ol>\n </div>\n </div>\n );\n}\n","import React from \"react\";\n\nimport type { ProductionItem } from \"../types\";\n\ninterface ProductionRuleProps {\n production: ProductionItem;\n}\n\nexport function XSpecProductionRule({ production }: ProductionRuleProps) {\n if (production.useGrid && production.gridItems) {\n const columns = production.columns || 5;\n const rows: string[][] = [];\n\n for (let i = 0; i < production.gridItems.length; i += columns) {\n rows.push(production.gridItems.slice(i, i + columns));\n }\n\n return (\n <div className=\"spec-production\" id={production.name}>\n <span className=\"spec-nt\">\n <a href={`#${production.name}`} data-name={production.name}>\n {production.name}\n </a>\n </span>\n <div className=\"spec-oneof\">\n <div className=\"spec-oneof-grid\">\n <table>\n <tbody>\n {rows.map((row, rowIndex) => (\n <tr key={rowIndex}>\n {row.map((item, cellIndex) => (\n <td key={cellIndex} className=\"spec-rhs\">\n <span className=\"spec-t\">{item}</span>\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"spec-production\" id={production.name}>\n <span className=\"spec-nt\">\n <a href={`#${production.name}`} data-name={production.name}>\n {production.name}\n </a>\n </span>\n {production.alternatives && production.alternatives.map((alt, altIndex) => (\n <div key={altIndex} className=\"spec-rhs\">\n {alt.map((token, tokenIndex) => (\n <span key={tokenIndex} className=\"spec-nt\">\n <span data-name={token}>{token}</span>\n </span>\n ))}\n </div>\n ))}\n </div>\n );\n}\n","import React from \"react\";\n\nimport { XSpecNavItem } from \"./XSpecNavItem\";\nimport type { NavItem as NavItemType } from \"../types\";\n\ninterface TableOfContentsProps {\n items: NavItemType[];\n}\n\nexport function XSpecTableOfContents({ items }: TableOfContentsProps) {\n return (\n <nav className=\"spec-toc\">\n <div className=\"title\">Contents</div>\n <ol>\n {items.map((item) => (\n <XSpecNavItem key={item.id} item={item} />\n ))}\n </ol>\n </nav>\n );\n}\n"],"mappings":";AAAA,OAAOA,aAAW;;;ACAlB,OAAOC,YAAW;;;ACAlB,OAAO,WAAW;AAIX,SAAS,SAAS,EAAE,MAAM,IAAI,UAAU,OAAO,GAAiB;AACrE,QAAM,aAAa;AAAA,IACjB,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,mBAAmB;AAAA,EACrB;AAEA,QAAM,SAAS;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,mBAAmB;AAAA,EACrB;AAEA,SACE,oCAAC,SAAI,IAAQ,WAAW,WAAW,IAAI,GAAG,eAAa,UACrD,oCAAC,OAAE,MAAM,IAAI,EAAE,MAAK,OAAO,IAAI,CAAE,GAChC,QACH;AAEJ;;;ACzBA,OAAOC,YAAW;AAIX,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA,QA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AASX,SAAS,qBAAqB,EAAE,MAAM,GAAyB;AACpE,SACE,gBAAAC,OAAA,cAAC,SAAI,WAAU,cACb,gBAAAA,OAAA,cAAC,SAAI,WAAU,WAAQ,UAAQ,GAC/B,gBAAAA,OAAA,cAAC,YACE,MAAM,IAAI,CAAC,SACV,gBAAAA,OAAA,cAAC,gBAAa,KAAK,KAAK,IAAI,MAAY,CACzC,CACH,CACF;AAEJ;;;ARJe,SAAR,MAAuB,EAAE,SAAS,GAAe;AACtD,SAAO,gBAAAC,OAAA,cAAC,SAAI,WAAU,WAAS,QAAS;AAC1C;AAEA,MAAM,MAAM;AACZ,MAAM,SAAS;AACf,MAAM,UAAU;AAChB,MAAM,UAAU;AAChB,MAAM,cAAc;AACpB,MAAM,UAAU;AAChB,MAAM,iBAAiB;AACvB,MAAM,kBAAkB;;;ADvBT,SAAR,aAA8B,EAAC,SAAQ,GAAG;AAC/C,SACE,gBAAAC,QAAA,cAAC,aACC,gBAAAA,QAAA,cAAC,iBAAS,QAAS,CACrB;AAEJ;","names":["React","React","React","React","React","React","React","React","React","React","React","React","React","React"]}