@themodcraft/addon-docs 1.1.0 → 1.1.2
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.
|
@@ -1,13 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { LicenseGate } from "@themodcraft/license-client";
|
|
4
|
-
import styles from "./DocsSidebar.module.css";
|
|
5
|
-
function defaultNormalizeHref(href) {
|
|
6
|
-
return href.split("#")[0] || "/";
|
|
7
|
-
}
|
|
8
|
-
export function DocsSidebar({ className, currentPath, footer, groups, normalizeHref = defaultNormalizeHref, title, version, ...props }) {
|
|
9
|
-
return (_jsx(LicenseGate, { required: "addon-docs", children: _jsx("aside", { className: [styles.sidebar, className].filter(Boolean).join(" "), ...props, children: _jsxs("div", { className: styles.inner, children: [title || version ? (_jsxs("div", { className: styles.brand, children: [title ? _jsx("p", { className: styles.title, children: title }) : null, version ? _jsx("p", { className: styles.version, children: version }) : null] })) : null, _jsx("nav", { className: styles.nav, children: groups.map((group, groupIndex) => (_jsxs("section", { className: styles.group, children: [_jsx("p", { className: styles.groupLabel, children: group.label }), _jsx("div", { className: styles.groupItems, children: group.items.map((item) => {
|
|
10
|
-
const active = Boolean(currentPath && !item.href.includes("#") && normalizeHref(item.href) === currentPath);
|
|
11
|
-
return (_jsxs("a", { "aria-current": active ? "page" : undefined, className: [styles.link, active ? styles.linkActive : ""].filter(Boolean).join(" "), href: item.href, children: [_jsx("span", { className: styles.label, children: item.label }), item.badge ? _jsx("span", { className: styles.badge, children: item.badge }) : null] }, item.href));
|
|
12
|
-
}) })] }, `${String(group.label)}-${groupIndex}`))) }), footer ? _jsx("div", { className: styles.footer, children: footer }) : null] }) }) }));
|
|
13
|
-
}
|
|
1
|
+
import{LicenseGate as e}from"@themodcraft/license-client";import l from"./DocsSidebar.module.css";import{jsx as r,jsxs as a}from"react/jsx-runtime";function n(e){return e.split("#")[0]||"/"}function i({className:i,currentPath:s,footer:c,groups:o,normalizeHref:d=n,title:t,version:m,...h}){return r(e,{required:"addon-docs",children:r("aside",{className:[l.sidebar,i].filter(Boolean).join(" "),...h,children:a("div",{className:l.inner,children:[t||m?a("div",{className:l.brand,children:[t?r("p",{className:l.title,children:t}):null,m?r("p",{className:l.version,children:m}):null]}):null,r("nav",{className:l.nav,children:o.map((e,n)=>a("section",{className:l.group,children:[r("p",{className:l.groupLabel,children:e.label}),r("div",{className:l.groupItems,children:e.items.map(e=>{const n=Boolean(s&&!e.href.includes("#")&&d(e.href)===s);return a("a",{"aria-current":n?"page":void 0,className:[l.link,n?l.linkActive:""].filter(Boolean).join(" "),href:e.href,children:[r("span",{className:l.label,children:e.label}),e.badge?r("span",{className:l.badge,children:e.badge}):null]},e.href)})})]},`${String(e.label)}-${n}`))}),c?r("div",{className:l.footer,children:c}):null]})})})}export{i as DocsSidebar};
|
|
@@ -1,113 +1 @@
|
|
|
1
|
-
.sidebar {
|
|
2
|
-
--tmc-docs-sidebar-background: var(--tmc-color-surface-raised, #ffffff);
|
|
3
|
-
--tmc-docs-sidebar-border: var(--tmc-color-border, #d7dde5);
|
|
4
|
-
--tmc-docs-sidebar-card-background: var(--tmc-color-surface-raised, #ffffff);
|
|
5
|
-
--tmc-docs-sidebar-heading: var(--tmc-color-text, #151821);
|
|
6
|
-
--tmc-docs-sidebar-muted: var(--tmc-color-text-muted, #5f6b7a);
|
|
7
|
-
--tmc-docs-sidebar-link: var(--tmc-color-text-muted, #4a5565);
|
|
8
|
-
--tmc-docs-sidebar-link-active-background: var(--tmc-color-text, #151821);
|
|
9
|
-
--tmc-docs-sidebar-link-active-text: var(--tmc-color-surface, #ffffff);
|
|
10
|
-
--tmc-docs-sidebar-link-hover: var(--tmc-color-hover, color-mix(in srgb, var(--tmc-color-accent, #2454d6) 10%, transparent));
|
|
11
|
-
color: var(--tmc-docs-sidebar-heading);
|
|
12
|
-
display: block;
|
|
13
|
-
width: 100%;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.inner {
|
|
17
|
-
max-height: calc(100vh - 96px);
|
|
18
|
-
overflow-y: auto;
|
|
19
|
-
padding-right: 1rem;
|
|
20
|
-
position: sticky;
|
|
21
|
-
top: 82px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.brand {
|
|
25
|
-
background: var(--tmc-docs-sidebar-card-background);
|
|
26
|
-
border: 1px solid var(--tmc-docs-sidebar-border);
|
|
27
|
-
border-radius: 8px;
|
|
28
|
-
box-shadow: 0 10px 26px rgb(20 24 33 / 0.06);
|
|
29
|
-
margin-bottom: 1.25rem;
|
|
30
|
-
padding: 0.75rem;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.title {
|
|
34
|
-
color: var(--tmc-docs-sidebar-heading);
|
|
35
|
-
font-size: 0.92rem;
|
|
36
|
-
font-weight: 750;
|
|
37
|
-
margin: 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.version {
|
|
41
|
-
color: var(--tmc-docs-sidebar-muted);
|
|
42
|
-
font-size: 0.78rem;
|
|
43
|
-
margin: 0.25rem 0 0;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.nav {
|
|
47
|
-
display: grid;
|
|
48
|
-
font-size: 0.9rem;
|
|
49
|
-
gap: 1.5rem;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.group {
|
|
53
|
-
margin: 0;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.groupLabel {
|
|
57
|
-
color: var(--tmc-docs-sidebar-muted);
|
|
58
|
-
font-size: 0.72rem;
|
|
59
|
-
font-weight: 800;
|
|
60
|
-
letter-spacing: 0.14em;
|
|
61
|
-
margin: 0 0 0.5rem;
|
|
62
|
-
padding: 0 0.5rem;
|
|
63
|
-
text-transform: uppercase;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.groupItems {
|
|
67
|
-
display: grid;
|
|
68
|
-
gap: 0.25rem;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.link {
|
|
72
|
-
align-items: center;
|
|
73
|
-
border-radius: 7px;
|
|
74
|
-
color: var(--tmc-docs-sidebar-link);
|
|
75
|
-
display: flex;
|
|
76
|
-
gap: 0.5rem;
|
|
77
|
-
justify-content: space-between;
|
|
78
|
-
min-height: 2rem;
|
|
79
|
-
padding: 0.4rem 0.5rem;
|
|
80
|
-
text-decoration: none;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.link:hover {
|
|
84
|
-
background: var(--tmc-docs-sidebar-link-hover);
|
|
85
|
-
color: var(--tmc-docs-sidebar-heading);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.linkActive {
|
|
89
|
-
background: var(--tmc-docs-sidebar-link-active-background);
|
|
90
|
-
color: var(--tmc-docs-sidebar-link-active-text);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.linkActive:hover {
|
|
94
|
-
background: var(--tmc-docs-sidebar-link-active-background);
|
|
95
|
-
color: var(--tmc-docs-sidebar-link-active-text);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.label {
|
|
99
|
-
overflow: hidden;
|
|
100
|
-
text-overflow: ellipsis;
|
|
101
|
-
white-space: nowrap;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.badge {
|
|
105
|
-
color: inherit;
|
|
106
|
-
flex: 0 0 auto;
|
|
107
|
-
font-size: 0.74rem;
|
|
108
|
-
opacity: 0.72;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.footer {
|
|
112
|
-
margin-top: 1.5rem;
|
|
113
|
-
}
|
|
1
|
+
.sidebar{--tmc-docs-sidebar-background:var(--tmc-color-surface-raised,#fff);--tmc-docs-sidebar-border:var(--tmc-color-border,#d7dde5);--tmc-docs-sidebar-card-background:var(--tmc-color-surface-raised,#fff);--tmc-docs-sidebar-heading:var(--tmc-color-text,#151821);--tmc-docs-sidebar-muted:var(--tmc-color-text-muted,#5f6b7a);--tmc-docs-sidebar-link:var(--tmc-color-text-muted,#4a5565);--tmc-docs-sidebar-link-active-background:var(--tmc-color-text,#151821);--tmc-docs-sidebar-link-active-text:var(--tmc-color-surface,#fff);--tmc-docs-sidebar-link-hover:var(--tmc-color-hover,color-mix(in srgb,var(--tmc-color-accent,#2454d6) 10%,transparent));color:var(--tmc-docs-sidebar-heading);display:block;width:100%}.inner{max-height:calc(100vh - 96px);overflow-y:auto;padding-right:1rem;position:sticky;top:82px}.brand{background:var(--tmc-docs-sidebar-card-background);border:1px solid var(--tmc-docs-sidebar-border);border-radius:8px;box-shadow:0 10px 26px rgba(20,24,33,.06);margin-bottom:1.25rem;padding:.75rem}.title{color:var(--tmc-docs-sidebar-heading);font-size:.92rem;font-weight:750;margin:0}.version{color:var(--tmc-docs-sidebar-muted);font-size:.78rem;margin:.25rem 0 0}.nav{display:grid;font-size:.9rem;gap:1.5rem}.group{margin:0}.groupLabel{color:var(--tmc-docs-sidebar-muted);font-size:.72rem;font-weight:800;letter-spacing:.14em;margin:0 0 .5rem;padding:0 .5rem;text-transform:uppercase}.groupItems{display:grid;gap:.25rem}.link{align-items:center;border-radius:7px;color:var(--tmc-docs-sidebar-link);display:flex;gap:.5rem;justify-content:space-between;min-height:2rem;padding:.4rem .5rem;text-decoration:none}.link:hover{background:var(--tmc-docs-sidebar-link-hover);color:var(--tmc-docs-sidebar-heading)}.linkActive,.linkActive:hover{background:var(--tmc-docs-sidebar-link-active-background);color:var(--tmc-docs-sidebar-link-active-text)}.label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.badge{color:inherit;flex:0 0 auto;font-size:.74rem;opacity:.72}.footer{margin-top:1.5rem}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export{DocsSidebar}from"./DocsSidebar.js";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export{DocsSidebar}from"./docs-sidebar/DocsSidebar.js";
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@themodcraft/addon-docs",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
7
|
"type": "module",
|
|
8
|
-
"files": [
|
|
9
|
-
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"sideEffects": [
|
|
12
|
+
"./dist/**/*.css"
|
|
13
|
+
],
|
|
10
14
|
"exports": {
|
|
11
15
|
".": {
|
|
12
16
|
"types": "./dist/index.d.ts",
|
|
@@ -23,7 +27,7 @@
|
|
|
23
27
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
24
28
|
},
|
|
25
29
|
"dependencies": {
|
|
26
|
-
"@themodcraft/license-client": "1.1.
|
|
30
|
+
"@themodcraft/license-client": "1.1.2"
|
|
27
31
|
},
|
|
28
32
|
"peerDependencies": {
|
|
29
33
|
"react": "^19.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|