@ciderpress/ui 1.0.0-rc.15 → 1.0.0-rc.17
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/dist/node.mjs +16 -0
- package/dist/theme/components/openapi/openapi.css +21 -3
- package/dist/theme/components/openapi/overview.tsx +3 -3
- package/dist/theme/components/openapi/parameters-table.tsx +16 -14
- package/dist/theme/components/openapi/request-body.tsx +1 -1
- package/dist/theme/components/openapi/response-list.tsx +1 -1
- package/dist/theme/components/openapi/security-badges.tsx +1 -1
- package/package.json +7 -7
- package/src/theme/components/openapi/openapi.css +21 -3
- package/src/theme/components/openapi/overview.tsx +3 -3
- package/src/theme/components/openapi/parameters-table.tsx +16 -14
- package/src/theme/components/openapi/request-body.tsx +1 -1
- package/src/theme/components/openapi/response-list.tsx +1 -1
- package/src/theme/components/openapi/security-badges.tsx +1 -1
package/dist/node.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import node_path from "node:path";
|
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
import { resolveOptionalIcon, serializeIcon } from "@ciderpress/config";
|
|
8
8
|
import { BRAND_COLORS, BUILT_IN_THEMES, DEFAULT_THEME_NAME, defineTheme, isBuiltInTheme, resolveDefaultVariant, resolveThemeAlias, resolveThemeVariants, themeToCss } from "@ciderpress/theme";
|
|
9
|
+
import { pluginClientRedirects } from "@rspress/plugin-client-redirects";
|
|
9
10
|
import { pluginSitemap } from "@rspress/plugin-sitemap";
|
|
10
11
|
import { P, match as match_match } from "massaman/match";
|
|
11
12
|
import { visit as external_unist_util_visit_visit } from "unist-util-visit";
|
|
@@ -18621,6 +18622,7 @@ function createRspressConfig(options) {
|
|
|
18621
18622
|
themeDir: node_path.resolve(import.meta.dirname, 'theme'),
|
|
18622
18623
|
plugins: [
|
|
18623
18624
|
ciderpressPlugin(),
|
|
18625
|
+
...resolveRedirectPlugins(config),
|
|
18624
18626
|
...resolveSitemapPlugins({
|
|
18625
18627
|
config,
|
|
18626
18628
|
base: resolvedBase
|
|
@@ -18735,6 +18737,20 @@ function createRspressConfig(options) {
|
|
|
18735
18737
|
}
|
|
18736
18738
|
};
|
|
18737
18739
|
}
|
|
18740
|
+
function resolveRedirectPlugins(config) {
|
|
18741
|
+
const { redirects } = config;
|
|
18742
|
+
if (void 0 === redirects || 0 === redirects.length) return [];
|
|
18743
|
+
return [
|
|
18744
|
+
pluginClientRedirects({
|
|
18745
|
+
redirects: redirects.map((rule)=>({
|
|
18746
|
+
from: match_match(rule.from).with(P.string, (from)=>from).otherwise((from)=>[
|
|
18747
|
+
...from
|
|
18748
|
+
]),
|
|
18749
|
+
to: rule.to
|
|
18750
|
+
}))
|
|
18751
|
+
})
|
|
18752
|
+
];
|
|
18753
|
+
}
|
|
18738
18754
|
function resolveSitemapPlugins(params) {
|
|
18739
18755
|
const { config } = params;
|
|
18740
18756
|
const { seo } = config;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/* ── Two-column operation layout ───────────────────────────── */
|
|
9
9
|
.cp-oas-operation {
|
|
10
10
|
display: grid;
|
|
11
|
-
grid-template-columns:
|
|
11
|
+
grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
|
|
12
12
|
gap: 2rem;
|
|
13
13
|
padding: 1rem 0;
|
|
14
14
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
min-width: 0;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
@media (max-width:
|
|
27
|
+
@media (max-width: 1280px) {
|
|
28
28
|
.cp-oas-operation {
|
|
29
29
|
grid-template-columns: 1fr;
|
|
30
30
|
}
|
|
@@ -119,6 +119,11 @@
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
/* ── Sidebar method badge + path ───────────────────────────── */
|
|
122
|
+
.rp-sidebar-item__left:has(.cp-oas-sidebar-badge) {
|
|
123
|
+
/* Preserve the active row while tightening Rspress's depth-2 inline indent. */
|
|
124
|
+
margin-left: -12px;
|
|
125
|
+
}
|
|
126
|
+
|
|
122
127
|
.cp-oas-sidebar-badge {
|
|
123
128
|
display: inline-block;
|
|
124
129
|
padding: 1px 6px;
|
|
@@ -194,10 +199,22 @@
|
|
|
194
199
|
margin: 1rem 0 0.5rem;
|
|
195
200
|
}
|
|
196
201
|
|
|
197
|
-
.cp-oas-parameters__table {
|
|
202
|
+
.rp-doc .cp-oas-parameters__table {
|
|
198
203
|
width: 100%;
|
|
204
|
+
table-layout: fixed;
|
|
199
205
|
border-collapse: collapse;
|
|
200
206
|
font-size: 0.875rem;
|
|
207
|
+
margin: 0;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.cp-oas-parameters__table-scroll {
|
|
211
|
+
overflow-x: auto;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@media (max-width: 640px) {
|
|
215
|
+
.rp-doc .cp-oas-parameters__table {
|
|
216
|
+
min-width: 36rem;
|
|
217
|
+
}
|
|
201
218
|
}
|
|
202
219
|
|
|
203
220
|
.cp-oas-parameters__table th {
|
|
@@ -214,6 +231,7 @@
|
|
|
214
231
|
color: var(--cp-c-text-1);
|
|
215
232
|
border-bottom: 1px solid var(--cp-c-divider);
|
|
216
233
|
vertical-align: top;
|
|
234
|
+
overflow-wrap: anywhere;
|
|
217
235
|
}
|
|
218
236
|
|
|
219
237
|
.cp-oas-parameters__name {
|
|
@@ -113,7 +113,7 @@ function ServerList({
|
|
|
113
113
|
P.when((s): s is readonly Record<string, unknown>[] => s.length > 0),
|
|
114
114
|
(s) => (
|
|
115
115
|
<div className="cp-oas-servers">
|
|
116
|
-
<
|
|
116
|
+
<h2 className="cp-oas-overview__section-title">Servers</h2>
|
|
117
117
|
{s.map((server) => {
|
|
118
118
|
const url = String(server['url'] ?? '')
|
|
119
119
|
const description = server['description'] as string | undefined
|
|
@@ -153,7 +153,7 @@ function AuthSchemes({
|
|
|
153
153
|
P.when((e): e is [string, Record<string, unknown>][] => e.length > 0),
|
|
154
154
|
(e) => (
|
|
155
155
|
<div className="cp-oas-auth-schemes">
|
|
156
|
-
<
|
|
156
|
+
<h2 className="cp-oas-overview__section-title">Authentication</h2>
|
|
157
157
|
{e.map(([name, scheme]) => (
|
|
158
158
|
<div key={name} className="cp-oas-auth-scheme">
|
|
159
159
|
<LockIcon />
|
|
@@ -180,7 +180,7 @@ function TagGroups({ tags }: { readonly tags: readonly TagInfo[] }): React.React
|
|
|
180
180
|
P.when((t): t is readonly TagInfo[] => t.length > 0),
|
|
181
181
|
(t) => (
|
|
182
182
|
<div className="cp-oas-tags">
|
|
183
|
-
<
|
|
183
|
+
<h2 className="cp-oas-overview__section-title">Operations</h2>
|
|
184
184
|
{t.map((tag) => {
|
|
185
185
|
const descEl = match(tag.description)
|
|
186
186
|
.with(
|
|
@@ -29,7 +29,7 @@ export function ParametersTable({ parameters }: ParametersTableProps): React.Rea
|
|
|
29
29
|
P.when((g): g is readonly ParameterGroup[] => g.length > 0),
|
|
30
30
|
(g) => (
|
|
31
31
|
<div className="cp-oas-parameters">
|
|
32
|
-
<
|
|
32
|
+
<h2 className="cp-oas-parameters__title">Parameters</h2>
|
|
33
33
|
{g.map(renderGroup)}
|
|
34
34
|
</div>
|
|
35
35
|
)
|
|
@@ -131,19 +131,21 @@ function renderRow(param: Record<string, unknown>): React.ReactElement {
|
|
|
131
131
|
function renderGroup(group: ParameterGroup): React.ReactElement {
|
|
132
132
|
return (
|
|
133
133
|
<div key={group.label}>
|
|
134
|
-
<
|
|
135
|
-
<
|
|
136
|
-
<
|
|
137
|
-
<
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
134
|
+
<h3 className="cp-oas-parameters__group-label">{group.label}</h3>
|
|
135
|
+
<div className="cp-oas-parameters__table-scroll">
|
|
136
|
+
<table className="cp-oas-parameters__table">
|
|
137
|
+
<thead>
|
|
138
|
+
<tr>
|
|
139
|
+
<th>Name</th>
|
|
140
|
+
<th>Type</th>
|
|
141
|
+
<th>Required</th>
|
|
142
|
+
<th>Description</th>
|
|
143
|
+
<th>Default</th>
|
|
144
|
+
</tr>
|
|
145
|
+
</thead>
|
|
146
|
+
<tbody>{group.items.map(renderRow)}</tbody>
|
|
147
|
+
</table>
|
|
148
|
+
</div>
|
|
147
149
|
</div>
|
|
148
150
|
)
|
|
149
151
|
}
|
|
@@ -54,7 +54,7 @@ export function RequestBody({ requestBody }: RequestBodyProps): React.ReactEleme
|
|
|
54
54
|
|
|
55
55
|
return (
|
|
56
56
|
<div className="cp-oas-request-body">
|
|
57
|
-
<
|
|
57
|
+
<h2 className="cp-oas-request-body__title">Request Body</h2>
|
|
58
58
|
{descEl}
|
|
59
59
|
{bodyEl}
|
|
60
60
|
{exampleEl}
|
|
@@ -26,7 +26,7 @@ export function ResponseList({ responses }: ResponseListProps): React.ReactEleme
|
|
|
26
26
|
|
|
27
27
|
return (
|
|
28
28
|
<div className="cp-oas-responses">
|
|
29
|
-
<
|
|
29
|
+
<h2 className="cp-oas-responses__title">Responses</h2>
|
|
30
30
|
{entries.map(renderResponseItem)}
|
|
31
31
|
</div>
|
|
32
32
|
)
|
|
@@ -26,7 +26,7 @@ export function SecurityBadges({ securities }: SecurityBadgesProps): React.React
|
|
|
26
26
|
P.when((s): s is readonly Record<string, unknown>[] => s.length > 0),
|
|
27
27
|
(s) => (
|
|
28
28
|
<div className="cp-oas-security">
|
|
29
|
-
<
|
|
29
|
+
<h2 className="cp-oas-security__title">Authentication</h2>
|
|
30
30
|
<div className="cp-oas-security__list">
|
|
31
31
|
{s.map((requirement, idx) => (
|
|
32
32
|
<span key={String(idx)} className="cp-oas-security__badge">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ciderpress/ui",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.17",
|
|
4
4
|
"description": "Rspress plugin, theme components, and styles for ciderpress",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ciderpress",
|
|
@@ -45,8 +45,6 @@
|
|
|
45
45
|
"provenance": true
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@ciderpress/config": "1.0.0-rc.12",
|
|
49
|
-
"@ciderpress/theme": "1.0.0-rc.7",
|
|
50
48
|
"@iconify-json/catppuccin": "^1.2.17",
|
|
51
49
|
"@iconify-json/devicon": "^1.2.62",
|
|
52
50
|
"@iconify-json/logos": "^1.2.13",
|
|
@@ -59,15 +57,17 @@
|
|
|
59
57
|
"@iconify-json/vscode-icons": "^1.2.76",
|
|
60
58
|
"@iconify/react": "^6.0.2",
|
|
61
59
|
"@mermaid-js/layout-elk": "^0.2.3",
|
|
60
|
+
"@rspress/plugin-client-redirects": "^2.0.21",
|
|
62
61
|
"@rspress/plugin-sitemap": "^2.0.21",
|
|
63
62
|
"clsx": "^2.1.1",
|
|
64
|
-
"katex": "^0.18.
|
|
63
|
+
"katex": "^0.18.9",
|
|
65
64
|
"massaman": "^0.5.1",
|
|
66
65
|
"mermaid": "^11.17.2",
|
|
67
|
-
"openapi-sampler": "^1.7.4",
|
|
68
66
|
"react-aria-components": "^1.20.0",
|
|
69
67
|
"ts-morph": "^28.0.0",
|
|
70
|
-
"unist-util-visit": "^5.1.0"
|
|
68
|
+
"unist-util-visit": "^5.1.0",
|
|
69
|
+
"@ciderpress/config": "1.0.0-rc.13",
|
|
70
|
+
"@ciderpress/theme": "1.0.0-rc.8"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@ladle/react": "^5.1.1",
|
|
@@ -76,7 +76,6 @@
|
|
|
76
76
|
"@types/react": "^19.2.18",
|
|
77
77
|
"@types/react-dom": "^19.2.5",
|
|
78
78
|
"esbuild": "^0.28.2",
|
|
79
|
-
"geist": "^1.7.2",
|
|
80
79
|
"happy-dom": "^20.12.0",
|
|
81
80
|
"react": "^19.2.8",
|
|
82
81
|
"react-dom": "^19.2.8",
|
|
@@ -85,6 +84,7 @@
|
|
|
85
84
|
"rspress-plugin-katex": "^1.0.1",
|
|
86
85
|
"rspress-plugin-supersub": "^1.0.0",
|
|
87
86
|
"typescript": "^7.0.2",
|
|
87
|
+
"vite": "^8.2.2",
|
|
88
88
|
"vitest": "^4.1.11"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/* ── Two-column operation layout ───────────────────────────── */
|
|
9
9
|
.cp-oas-operation {
|
|
10
10
|
display: grid;
|
|
11
|
-
grid-template-columns:
|
|
11
|
+
grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
|
|
12
12
|
gap: 2rem;
|
|
13
13
|
padding: 1rem 0;
|
|
14
14
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
min-width: 0;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
@media (max-width:
|
|
27
|
+
@media (max-width: 1280px) {
|
|
28
28
|
.cp-oas-operation {
|
|
29
29
|
grid-template-columns: 1fr;
|
|
30
30
|
}
|
|
@@ -119,6 +119,11 @@
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
/* ── Sidebar method badge + path ───────────────────────────── */
|
|
122
|
+
.rp-sidebar-item__left:has(.cp-oas-sidebar-badge) {
|
|
123
|
+
/* Preserve the active row while tightening Rspress's depth-2 inline indent. */
|
|
124
|
+
margin-left: -12px;
|
|
125
|
+
}
|
|
126
|
+
|
|
122
127
|
.cp-oas-sidebar-badge {
|
|
123
128
|
display: inline-block;
|
|
124
129
|
padding: 1px 6px;
|
|
@@ -194,10 +199,22 @@
|
|
|
194
199
|
margin: 1rem 0 0.5rem;
|
|
195
200
|
}
|
|
196
201
|
|
|
197
|
-
.cp-oas-parameters__table {
|
|
202
|
+
.rp-doc .cp-oas-parameters__table {
|
|
198
203
|
width: 100%;
|
|
204
|
+
table-layout: fixed;
|
|
199
205
|
border-collapse: collapse;
|
|
200
206
|
font-size: 0.875rem;
|
|
207
|
+
margin: 0;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.cp-oas-parameters__table-scroll {
|
|
211
|
+
overflow-x: auto;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@media (max-width: 640px) {
|
|
215
|
+
.rp-doc .cp-oas-parameters__table {
|
|
216
|
+
min-width: 36rem;
|
|
217
|
+
}
|
|
201
218
|
}
|
|
202
219
|
|
|
203
220
|
.cp-oas-parameters__table th {
|
|
@@ -214,6 +231,7 @@
|
|
|
214
231
|
color: var(--cp-c-text-1);
|
|
215
232
|
border-bottom: 1px solid var(--cp-c-divider);
|
|
216
233
|
vertical-align: top;
|
|
234
|
+
overflow-wrap: anywhere;
|
|
217
235
|
}
|
|
218
236
|
|
|
219
237
|
.cp-oas-parameters__name {
|
|
@@ -113,7 +113,7 @@ function ServerList({
|
|
|
113
113
|
P.when((s): s is readonly Record<string, unknown>[] => s.length > 0),
|
|
114
114
|
(s) => (
|
|
115
115
|
<div className="cp-oas-servers">
|
|
116
|
-
<
|
|
116
|
+
<h2 className="cp-oas-overview__section-title">Servers</h2>
|
|
117
117
|
{s.map((server) => {
|
|
118
118
|
const url = String(server['url'] ?? '')
|
|
119
119
|
const description = server['description'] as string | undefined
|
|
@@ -153,7 +153,7 @@ function AuthSchemes({
|
|
|
153
153
|
P.when((e): e is [string, Record<string, unknown>][] => e.length > 0),
|
|
154
154
|
(e) => (
|
|
155
155
|
<div className="cp-oas-auth-schemes">
|
|
156
|
-
<
|
|
156
|
+
<h2 className="cp-oas-overview__section-title">Authentication</h2>
|
|
157
157
|
{e.map(([name, scheme]) => (
|
|
158
158
|
<div key={name} className="cp-oas-auth-scheme">
|
|
159
159
|
<LockIcon />
|
|
@@ -180,7 +180,7 @@ function TagGroups({ tags }: { readonly tags: readonly TagInfo[] }): React.React
|
|
|
180
180
|
P.when((t): t is readonly TagInfo[] => t.length > 0),
|
|
181
181
|
(t) => (
|
|
182
182
|
<div className="cp-oas-tags">
|
|
183
|
-
<
|
|
183
|
+
<h2 className="cp-oas-overview__section-title">Operations</h2>
|
|
184
184
|
{t.map((tag) => {
|
|
185
185
|
const descEl = match(tag.description)
|
|
186
186
|
.with(
|
|
@@ -29,7 +29,7 @@ export function ParametersTable({ parameters }: ParametersTableProps): React.Rea
|
|
|
29
29
|
P.when((g): g is readonly ParameterGroup[] => g.length > 0),
|
|
30
30
|
(g) => (
|
|
31
31
|
<div className="cp-oas-parameters">
|
|
32
|
-
<
|
|
32
|
+
<h2 className="cp-oas-parameters__title">Parameters</h2>
|
|
33
33
|
{g.map(renderGroup)}
|
|
34
34
|
</div>
|
|
35
35
|
)
|
|
@@ -131,19 +131,21 @@ function renderRow(param: Record<string, unknown>): React.ReactElement {
|
|
|
131
131
|
function renderGroup(group: ParameterGroup): React.ReactElement {
|
|
132
132
|
return (
|
|
133
133
|
<div key={group.label}>
|
|
134
|
-
<
|
|
135
|
-
<
|
|
136
|
-
<
|
|
137
|
-
<
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
134
|
+
<h3 className="cp-oas-parameters__group-label">{group.label}</h3>
|
|
135
|
+
<div className="cp-oas-parameters__table-scroll">
|
|
136
|
+
<table className="cp-oas-parameters__table">
|
|
137
|
+
<thead>
|
|
138
|
+
<tr>
|
|
139
|
+
<th>Name</th>
|
|
140
|
+
<th>Type</th>
|
|
141
|
+
<th>Required</th>
|
|
142
|
+
<th>Description</th>
|
|
143
|
+
<th>Default</th>
|
|
144
|
+
</tr>
|
|
145
|
+
</thead>
|
|
146
|
+
<tbody>{group.items.map(renderRow)}</tbody>
|
|
147
|
+
</table>
|
|
148
|
+
</div>
|
|
147
149
|
</div>
|
|
148
150
|
)
|
|
149
151
|
}
|
|
@@ -54,7 +54,7 @@ export function RequestBody({ requestBody }: RequestBodyProps): React.ReactEleme
|
|
|
54
54
|
|
|
55
55
|
return (
|
|
56
56
|
<div className="cp-oas-request-body">
|
|
57
|
-
<
|
|
57
|
+
<h2 className="cp-oas-request-body__title">Request Body</h2>
|
|
58
58
|
{descEl}
|
|
59
59
|
{bodyEl}
|
|
60
60
|
{exampleEl}
|
|
@@ -26,7 +26,7 @@ export function ResponseList({ responses }: ResponseListProps): React.ReactEleme
|
|
|
26
26
|
|
|
27
27
|
return (
|
|
28
28
|
<div className="cp-oas-responses">
|
|
29
|
-
<
|
|
29
|
+
<h2 className="cp-oas-responses__title">Responses</h2>
|
|
30
30
|
{entries.map(renderResponseItem)}
|
|
31
31
|
</div>
|
|
32
32
|
)
|
|
@@ -26,7 +26,7 @@ export function SecurityBadges({ securities }: SecurityBadgesProps): React.React
|
|
|
26
26
|
P.when((s): s is readonly Record<string, unknown>[] => s.length > 0),
|
|
27
27
|
(s) => (
|
|
28
28
|
<div className="cp-oas-security">
|
|
29
|
-
<
|
|
29
|
+
<h2 className="cp-oas-security__title">Authentication</h2>
|
|
30
30
|
<div className="cp-oas-security__list">
|
|
31
31
|
{s.map((requirement, idx) => (
|
|
32
32
|
<span key={String(idx)} className="cp-oas-security__badge">
|