@nexpress/theme-docs 0.3.7 → 0.3.9
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/index.d.ts +6 -2
- package/dist/index.js +385 -88
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import {
|
|
3
|
-
defineTheme
|
|
4
|
-
} from "@nexpress/theme";
|
|
2
|
+
import { defineTheme } from "@nexpress/theme";
|
|
5
3
|
|
|
6
4
|
// src/copy-button-bridge.ts
|
|
7
5
|
import { CopyButton } from "./components/copy-button.js";
|
|
@@ -289,17 +287,13 @@ var docsApiTableBlock = {
|
|
|
289
287
|
type: "array",
|
|
290
288
|
defaultValue: ["Name", "Type", "Description"],
|
|
291
289
|
itemDefault: { value: "Column" },
|
|
292
|
-
itemSchema: [
|
|
293
|
-
{ name: "value", label: "Header", type: "text", defaultValue: "Column" }
|
|
294
|
-
]
|
|
290
|
+
itemSchema: [{ name: "value", label: "Header", type: "text", defaultValue: "Column" }]
|
|
295
291
|
},
|
|
296
292
|
{
|
|
297
293
|
name: "rows",
|
|
298
294
|
label: "Rows",
|
|
299
295
|
type: "array",
|
|
300
|
-
defaultValue: [
|
|
301
|
-
{ cells: ["slug", "string", "Unique URL fragment."], required: true }
|
|
302
|
-
],
|
|
296
|
+
defaultValue: [{ cells: ["slug", "string", "Unique URL fragment."], required: true }],
|
|
303
297
|
itemDefault: { cells: [], required: false },
|
|
304
298
|
itemSchema: [
|
|
305
299
|
{
|
|
@@ -308,9 +302,7 @@ var docsApiTableBlock = {
|
|
|
308
302
|
type: "array",
|
|
309
303
|
defaultValue: [],
|
|
310
304
|
itemDefault: { value: "" },
|
|
311
|
-
itemSchema: [
|
|
312
|
-
{ name: "value", label: "Cell", type: "text", defaultValue: "" }
|
|
313
|
-
]
|
|
305
|
+
itemSchema: [{ name: "value", label: "Cell", type: "text", defaultValue: "" }]
|
|
314
306
|
},
|
|
315
307
|
{
|
|
316
308
|
name: "required",
|
|
@@ -1070,6 +1062,140 @@ var docsCss = `
|
|
|
1070
1062
|
font-family: var(--np-font-mono, "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace);
|
|
1071
1063
|
}
|
|
1072
1064
|
|
|
1065
|
+
.np-docs-api,
|
|
1066
|
+
.np-docs-changelog-page {
|
|
1067
|
+
max-width: 980px;
|
|
1068
|
+
margin: 0 auto;
|
|
1069
|
+
padding: 3rem 1rem 5rem;
|
|
1070
|
+
}
|
|
1071
|
+
.np-docs-api-hero,
|
|
1072
|
+
.np-docs-changelog-hero {
|
|
1073
|
+
padding: 3rem 0 2rem;
|
|
1074
|
+
}
|
|
1075
|
+
.np-docs-api-eyebrow,
|
|
1076
|
+
.np-docs-changelog-hero p {
|
|
1077
|
+
margin: 0 0 0.8rem;
|
|
1078
|
+
font-family: var(--np-font-mono);
|
|
1079
|
+
color: var(--np-color-primary);
|
|
1080
|
+
font-size: 0.78rem;
|
|
1081
|
+
letter-spacing: 0.08em;
|
|
1082
|
+
text-transform: uppercase;
|
|
1083
|
+
}
|
|
1084
|
+
.np-docs-api-hero h1,
|
|
1085
|
+
.np-docs-changelog-hero h1 {
|
|
1086
|
+
margin: 0;
|
|
1087
|
+
font-size: clamp(2.4rem, 5vw, 4.4rem);
|
|
1088
|
+
line-height: 1;
|
|
1089
|
+
letter-spacing: -0.04em;
|
|
1090
|
+
}
|
|
1091
|
+
.np-docs-api-hero p,
|
|
1092
|
+
.np-docs-changelog-hero span {
|
|
1093
|
+
display: block;
|
|
1094
|
+
max-width: 44rem;
|
|
1095
|
+
margin-top: 1rem;
|
|
1096
|
+
color: var(--np-color-muted-foreground);
|
|
1097
|
+
font-size: 1.05rem;
|
|
1098
|
+
}
|
|
1099
|
+
.np-docs-api-signature {
|
|
1100
|
+
overflow: hidden;
|
|
1101
|
+
border: 1px solid var(--np-color-border);
|
|
1102
|
+
border-radius: 14px;
|
|
1103
|
+
background: #0b1220;
|
|
1104
|
+
color: #e6edf6;
|
|
1105
|
+
}
|
|
1106
|
+
.np-docs-api-signature-head {
|
|
1107
|
+
display: flex;
|
|
1108
|
+
justify-content: space-between;
|
|
1109
|
+
gap: 1rem;
|
|
1110
|
+
padding: 0.8rem 1rem;
|
|
1111
|
+
color: #93c5fd;
|
|
1112
|
+
border-bottom: 1px solid rgba(255,255,255,0.12);
|
|
1113
|
+
font-family: var(--np-font-mono);
|
|
1114
|
+
font-size: 0.78rem;
|
|
1115
|
+
}
|
|
1116
|
+
.np-docs-api-signature pre {
|
|
1117
|
+
margin: 0;
|
|
1118
|
+
padding: 1.2rem;
|
|
1119
|
+
overflow-x: auto;
|
|
1120
|
+
font-size: 0.85rem;
|
|
1121
|
+
line-height: 1.65;
|
|
1122
|
+
}
|
|
1123
|
+
.np-docs-api-section { padding-top: 2.5rem; }
|
|
1124
|
+
.np-docs-api-section h2 {
|
|
1125
|
+
margin: 0 0 1rem;
|
|
1126
|
+
font-size: 1.35rem;
|
|
1127
|
+
}
|
|
1128
|
+
.np-docs-api-table {
|
|
1129
|
+
border: 1px solid var(--np-color-border);
|
|
1130
|
+
border-radius: 14px;
|
|
1131
|
+
overflow: hidden;
|
|
1132
|
+
background: var(--np-color-card);
|
|
1133
|
+
}
|
|
1134
|
+
.np-docs-api-row {
|
|
1135
|
+
display: grid;
|
|
1136
|
+
grid-template-columns: 10rem 7rem minmax(0, 1fr);
|
|
1137
|
+
gap: 1rem;
|
|
1138
|
+
padding: 1rem;
|
|
1139
|
+
border-bottom: 1px solid var(--np-color-border);
|
|
1140
|
+
}
|
|
1141
|
+
.np-docs-api-row:last-child { border-bottom: 0; }
|
|
1142
|
+
.np-docs-api-row span {
|
|
1143
|
+
color: var(--np-color-primary);
|
|
1144
|
+
font-family: var(--np-font-mono);
|
|
1145
|
+
font-size: 0.76rem;
|
|
1146
|
+
}
|
|
1147
|
+
.np-docs-api-row p { margin: 0; color: var(--np-color-muted-foreground); }
|
|
1148
|
+
.np-docs-changelog-timeline {
|
|
1149
|
+
list-style: none;
|
|
1150
|
+
margin: 2rem 0 0;
|
|
1151
|
+
padding: 0;
|
|
1152
|
+
border-top: 1px solid var(--np-color-border);
|
|
1153
|
+
}
|
|
1154
|
+
.np-docs-changelog-release {
|
|
1155
|
+
display: grid;
|
|
1156
|
+
grid-template-columns: 13rem minmax(0, 1fr);
|
|
1157
|
+
gap: 2rem;
|
|
1158
|
+
padding: 1.6rem 0;
|
|
1159
|
+
border-bottom: 1px solid var(--np-color-border);
|
|
1160
|
+
}
|
|
1161
|
+
.np-docs-changelog-release aside {
|
|
1162
|
+
display: grid;
|
|
1163
|
+
gap: 0.3rem;
|
|
1164
|
+
align-content: start;
|
|
1165
|
+
}
|
|
1166
|
+
.np-docs-changelog-release aside strong {
|
|
1167
|
+
font-size: 1.25rem;
|
|
1168
|
+
letter-spacing: -0.02em;
|
|
1169
|
+
}
|
|
1170
|
+
.np-docs-changelog-release aside span,
|
|
1171
|
+
.np-docs-changelog-release aside i {
|
|
1172
|
+
color: var(--np-color-muted-foreground);
|
|
1173
|
+
font-style: normal;
|
|
1174
|
+
font-size: 0.82rem;
|
|
1175
|
+
}
|
|
1176
|
+
.np-docs-changelog-release p {
|
|
1177
|
+
display: grid;
|
|
1178
|
+
grid-template-columns: 6.5rem minmax(0, 1fr);
|
|
1179
|
+
gap: 1rem;
|
|
1180
|
+
margin: 0 0 0.85rem;
|
|
1181
|
+
}
|
|
1182
|
+
.np-docs-changelog-release p span {
|
|
1183
|
+
justify-self: start;
|
|
1184
|
+
padding: 0.12rem 0.45rem;
|
|
1185
|
+
border-radius: 999px;
|
|
1186
|
+
border: 1px solid var(--np-color-border);
|
|
1187
|
+
font-family: var(--np-font-mono);
|
|
1188
|
+
font-size: 0.7rem;
|
|
1189
|
+
color: var(--np-color-primary);
|
|
1190
|
+
}
|
|
1191
|
+
@media (max-width: 760px) {
|
|
1192
|
+
.np-docs-api-row,
|
|
1193
|
+
.np-docs-changelog-release,
|
|
1194
|
+
.np-docs-changelog-release p {
|
|
1195
|
+
grid-template-columns: 1fr;
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1073
1199
|
/* ============================================================
|
|
1074
1200
|
* Header \u2014 sticky bar with brand + version pill, \u2318K search in
|
|
1075
1201
|
* the center, primary nav + GitHub link on the right. Grid
|
|
@@ -2177,9 +2303,121 @@ var docsCss = `
|
|
|
2177
2303
|
}
|
|
2178
2304
|
`;
|
|
2179
2305
|
|
|
2306
|
+
// src/templates/page-api-reference.tsx
|
|
2307
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2308
|
+
function PageApiReferenceTemplate(_props) {
|
|
2309
|
+
const params = [
|
|
2310
|
+
["manifest", "required", "Plugin metadata: id, name, version, and supported NexPress range."],
|
|
2311
|
+
["hooks", "optional", "Lifecycle hooks such as content:beforeSave and content:afterSave."],
|
|
2312
|
+
["actions", "optional", "Custom action handlers mounted under the plugin action endpoint."],
|
|
2313
|
+
["routes", "optional", "API-style route handlers registered by the plugin host."],
|
|
2314
|
+
["pageRoutes", "optional", "Public-site React routes rendered through the site shell."],
|
|
2315
|
+
["scheduled", "optional", "pg-boss scheduled tasks reconciled at boot."],
|
|
2316
|
+
["blocks", "optional", "Page-builder block definitions registered into the shared registry."]
|
|
2317
|
+
];
|
|
2318
|
+
return /* @__PURE__ */ jsxs10("article", { className: "np-docs-api", children: [
|
|
2319
|
+
/* @__PURE__ */ jsxs10("header", { className: "np-docs-api-hero", children: [
|
|
2320
|
+
/* @__PURE__ */ jsx11("p", { className: "np-docs-api-eyebrow", children: "API reference" }),
|
|
2321
|
+
/* @__PURE__ */ jsx11("h1", { children: /* @__PURE__ */ jsx11("code", { children: "definePlugin" }) }),
|
|
2322
|
+
/* @__PURE__ */ jsx11("p", { children: "Declares a NexPress plugin. v1 plugins are npm package + rebuild: they run in-process, can register hooks, actions, API routes, public page routes, scheduled tasks, and page-builder blocks." })
|
|
2323
|
+
] }),
|
|
2324
|
+
/* @__PURE__ */ jsxs10("section", { className: "np-docs-api-signature", "aria-label": "Signature", children: [
|
|
2325
|
+
/* @__PURE__ */ jsxs10("div", { className: "np-docs-api-signature-head", children: [
|
|
2326
|
+
/* @__PURE__ */ jsx11("span", { children: "Signature" }),
|
|
2327
|
+
/* @__PURE__ */ jsx11("code", { children: "@nexpress/plugin-sdk" })
|
|
2328
|
+
] }),
|
|
2329
|
+
/* @__PURE__ */ jsx11("pre", { children: `import { definePlugin } from "@nexpress/plugin-sdk";
|
|
2330
|
+
|
|
2331
|
+
export default definePlugin({
|
|
2332
|
+
manifest: {
|
|
2333
|
+
id: "reading-time",
|
|
2334
|
+
name: "Reading time",
|
|
2335
|
+
version: "0.1.0",
|
|
2336
|
+
nexpress: { minVersion: "0.1.0" },
|
|
2337
|
+
},
|
|
2338
|
+
hooks: {
|
|
2339
|
+
"content:beforeSave": async (ctx) => ctx.data,
|
|
2340
|
+
},
|
|
2341
|
+
pageRoutes: [],
|
|
2342
|
+
blocks: [],
|
|
2343
|
+
});` })
|
|
2344
|
+
] }),
|
|
2345
|
+
/* @__PURE__ */ jsxs10("section", { className: "np-docs-api-section", children: [
|
|
2346
|
+
/* @__PURE__ */ jsx11("h2", { children: "Parameters" }),
|
|
2347
|
+
/* @__PURE__ */ jsx11("div", { className: "np-docs-api-table", children: params.map(([name, state, desc]) => /* @__PURE__ */ jsxs10("div", { className: "np-docs-api-row", children: [
|
|
2348
|
+
/* @__PURE__ */ jsx11("code", { children: name }),
|
|
2349
|
+
/* @__PURE__ */ jsx11("span", { children: state }),
|
|
2350
|
+
/* @__PURE__ */ jsx11("p", { children: desc })
|
|
2351
|
+
] }, name)) })
|
|
2352
|
+
] }),
|
|
2353
|
+
/* @__PURE__ */ jsxs10("section", { className: "np-docs-api-section", children: [
|
|
2354
|
+
/* @__PURE__ */ jsx11("h2", { children: "Returns" }),
|
|
2355
|
+
/* @__PURE__ */ jsx11("p", { children: "A plugin definition object consumed by the NexPress bootstrap. The host validates the manifest and registers every declared surface in a predictable order. Capability and route checks happen at the framework boundary." })
|
|
2356
|
+
] })
|
|
2357
|
+
] });
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
// src/templates/page-changelog.tsx
|
|
2361
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2362
|
+
var RELEASES = [
|
|
2363
|
+
{
|
|
2364
|
+
version: "0.3.6",
|
|
2365
|
+
date: "May 2026",
|
|
2366
|
+
tag: "latest",
|
|
2367
|
+
changes: [
|
|
2368
|
+
["Improved", "Theme seed content now owns first-boot pages and posts per active theme."],
|
|
2369
|
+
["Added", "Built-in theme docs, magazine, and portfolio front-page render coverage."],
|
|
2370
|
+
["Fixed", "Theme-contributed fields are gated by active theme in the admin editor."]
|
|
2371
|
+
]
|
|
2372
|
+
},
|
|
2373
|
+
{
|
|
2374
|
+
version: "0.3.0",
|
|
2375
|
+
date: "May 2026",
|
|
2376
|
+
tag: "theme v0.2",
|
|
2377
|
+
changes: [
|
|
2378
|
+
["Added", "Theme routes, archives, nav locations, settings schema, and patterns."],
|
|
2379
|
+
["Added", "Docs and portfolio kinds on the universal posts collection."],
|
|
2380
|
+
["Breaking", "Legacy nx prefix moved to np across framework-owned identifiers."]
|
|
2381
|
+
]
|
|
2382
|
+
},
|
|
2383
|
+
{
|
|
2384
|
+
version: "0.2.0",
|
|
2385
|
+
date: "April 2026",
|
|
2386
|
+
tag: "pre-1.0",
|
|
2387
|
+
changes: [
|
|
2388
|
+
["Added", "Plugin page routes and page-builder block contributions."],
|
|
2389
|
+
["Improved", "pg-boss worker lifecycle and admin jobs surface."],
|
|
2390
|
+
["Fixed", "CSRF and rate limiting now live in the app proxy boundary."]
|
|
2391
|
+
]
|
|
2392
|
+
}
|
|
2393
|
+
];
|
|
2394
|
+
function PageChangelogTemplate(_props) {
|
|
2395
|
+
return /* @__PURE__ */ jsxs11("article", { className: "np-docs-changelog-page", children: [
|
|
2396
|
+
/* @__PURE__ */ jsxs11("header", { className: "np-docs-changelog-hero", children: [
|
|
2397
|
+
/* @__PURE__ */ jsx12("p", { children: "Changelog" }),
|
|
2398
|
+
/* @__PURE__ */ jsx12("h1", { children: "Every shipped change, in reverse." }),
|
|
2399
|
+
/* @__PURE__ */ jsx12("span", { children: "Pre-1.0 packages use minor releases for breaking changes." })
|
|
2400
|
+
] }),
|
|
2401
|
+
/* @__PURE__ */ jsx12("ol", { className: "np-docs-changelog-timeline", children: RELEASES.map((release) => /* @__PURE__ */ jsxs11("li", { className: "np-docs-changelog-release", children: [
|
|
2402
|
+
/* @__PURE__ */ jsxs11("aside", { children: [
|
|
2403
|
+
/* @__PURE__ */ jsxs11("strong", { children: [
|
|
2404
|
+
"v",
|
|
2405
|
+
release.version
|
|
2406
|
+
] }),
|
|
2407
|
+
/* @__PURE__ */ jsx12("span", { children: release.date }),
|
|
2408
|
+
/* @__PURE__ */ jsx12("i", { children: release.tag })
|
|
2409
|
+
] }),
|
|
2410
|
+
/* @__PURE__ */ jsx12("div", { children: release.changes.map(([kind, text]) => /* @__PURE__ */ jsxs11("p", { children: [
|
|
2411
|
+
/* @__PURE__ */ jsx12("span", { "data-kind": kind.toLowerCase(), children: kind }),
|
|
2412
|
+
text
|
|
2413
|
+
] }, `${release.version}-${text}`)) })
|
|
2414
|
+
] }, release.version)) })
|
|
2415
|
+
] });
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2180
2418
|
// src/templates/page-front.tsx
|
|
2181
2419
|
import { findDocuments as findDocuments4 } from "@nexpress/core";
|
|
2182
|
-
import { jsx as
|
|
2420
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2183
2421
|
async function PageFrontTemplate(_props) {
|
|
2184
2422
|
const settings = await resolveDocsSettings();
|
|
2185
2423
|
const result = await findDocuments4("posts", {
|
|
@@ -2194,22 +2432,22 @@ async function PageFrontTemplate(_props) {
|
|
|
2194
2432
|
(c) => c.slug === "author-quickstart"
|
|
2195
2433
|
);
|
|
2196
2434
|
const quickstartTarget = quickstartChild ?? tree[0]?.children[0] ?? tree[0] ?? null;
|
|
2197
|
-
return /* @__PURE__ */
|
|
2198
|
-
/* @__PURE__ */
|
|
2199
|
-
/* @__PURE__ */
|
|
2200
|
-
/* @__PURE__ */
|
|
2435
|
+
return /* @__PURE__ */ jsxs12("article", { className: "np-docs-front", children: [
|
|
2436
|
+
/* @__PURE__ */ jsxs12("header", { className: "np-docs-front-hero", children: [
|
|
2437
|
+
/* @__PURE__ */ jsxs12("span", { className: "np-docs-front-eyebrow", children: [
|
|
2438
|
+
/* @__PURE__ */ jsx13("span", { className: "np-docs-front-eyebrow-dot", "aria-hidden": "true" }),
|
|
2201
2439
|
settings.version,
|
|
2202
|
-
/* @__PURE__ */
|
|
2440
|
+
/* @__PURE__ */ jsx13("span", { "aria-hidden": "true", children: " \xB7 Stable" })
|
|
2203
2441
|
] }),
|
|
2204
|
-
/* @__PURE__ */
|
|
2205
|
-
/* @__PURE__ */
|
|
2206
|
-
quickstartTarget ? /* @__PURE__ */
|
|
2207
|
-
/* @__PURE__ */
|
|
2442
|
+
/* @__PURE__ */ jsx13("h1", { children: "Documentation" }),
|
|
2443
|
+
/* @__PURE__ */ jsx13("p", { className: "np-docs-front-lede", children: "Everything you need to install, configure, extend, and ship a NexPress site \u2014 from a first install to the API reference. Browse by section, or jump straight into the plugin author quickstart." }),
|
|
2444
|
+
quickstartTarget ? /* @__PURE__ */ jsxs12("div", { className: "np-docs-front-cta", children: [
|
|
2445
|
+
/* @__PURE__ */ jsxs12("a", { className: "np-docs-front-cta-primary", href: `/docs/${quickstartTarget.slug}`, children: [
|
|
2208
2446
|
"Open ",
|
|
2209
2447
|
quickstartTarget.title,
|
|
2210
2448
|
" \u2192"
|
|
2211
2449
|
] }),
|
|
2212
|
-
settings.githubRepo ? /* @__PURE__ */
|
|
2450
|
+
settings.githubRepo ? /* @__PURE__ */ jsx13(
|
|
2213
2451
|
"a",
|
|
2214
2452
|
{
|
|
2215
2453
|
className: "np-docs-front-cta-secondary",
|
|
@@ -2221,24 +2459,24 @@ async function PageFrontTemplate(_props) {
|
|
|
2221
2459
|
) : null
|
|
2222
2460
|
] }) : null
|
|
2223
2461
|
] }),
|
|
2224
|
-
tree.length > 0 ? /* @__PURE__ */
|
|
2462
|
+
tree.length > 0 ? /* @__PURE__ */ jsx13("section", { className: "np-docs-front-groups", "aria-label": "Documentation sections", children: tree.map((group) => /* @__PURE__ */ jsxs12(
|
|
2225
2463
|
"a",
|
|
2226
2464
|
{
|
|
2227
2465
|
className: "np-docs-front-group",
|
|
2228
2466
|
href: `/docs/${group.slug}`,
|
|
2229
2467
|
children: [
|
|
2230
|
-
/* @__PURE__ */
|
|
2468
|
+
/* @__PURE__ */ jsxs12("h2", { className: "np-docs-front-group-title", children: [
|
|
2231
2469
|
group.title,
|
|
2232
|
-
/* @__PURE__ */
|
|
2470
|
+
/* @__PURE__ */ jsxs12("span", { className: "np-docs-front-group-count", children: [
|
|
2233
2471
|
group.children.length.toString(),
|
|
2234
2472
|
" page",
|
|
2235
2473
|
group.children.length === 1 ? "" : "s"
|
|
2236
2474
|
] })
|
|
2237
2475
|
] }),
|
|
2238
|
-
group.lede ? /* @__PURE__ */
|
|
2239
|
-
group.children.length > 0 ? /* @__PURE__ */
|
|
2476
|
+
group.lede ? /* @__PURE__ */ jsx13("p", { className: "np-docs-front-group-lede", children: group.lede }) : null,
|
|
2477
|
+
group.children.length > 0 ? /* @__PURE__ */ jsx13("ul", { className: "np-docs-front-group-children", children: group.children.slice(0, 4).map((child) => /* @__PURE__ */ jsxs12("li", { children: [
|
|
2240
2478
|
child.title,
|
|
2241
|
-
child.badge ? /* @__PURE__ */
|
|
2479
|
+
child.badge ? /* @__PURE__ */ jsx13(
|
|
2242
2480
|
"span",
|
|
2243
2481
|
{
|
|
2244
2482
|
className: `np-docs-sidebar-badge ${child.badge.toLowerCase()}`,
|
|
@@ -2250,16 +2488,16 @@ async function PageFrontTemplate(_props) {
|
|
|
2250
2488
|
},
|
|
2251
2489
|
group.id
|
|
2252
2490
|
)) }) : null,
|
|
2253
|
-
recent.length > 0 ? /* @__PURE__ */
|
|
2491
|
+
recent.length > 0 ? /* @__PURE__ */ jsxs12(
|
|
2254
2492
|
"section",
|
|
2255
2493
|
{
|
|
2256
2494
|
className: "np-docs-front-recent",
|
|
2257
2495
|
"aria-label": "Recently updated docs",
|
|
2258
2496
|
children: [
|
|
2259
|
-
/* @__PURE__ */
|
|
2260
|
-
/* @__PURE__ */
|
|
2261
|
-
/* @__PURE__ */
|
|
2262
|
-
node.updatedAt ? /* @__PURE__ */
|
|
2497
|
+
/* @__PURE__ */ jsx13("h2", { className: "np-docs-front-recent-eyebrow", children: "Recently updated" }),
|
|
2498
|
+
/* @__PURE__ */ jsx13("ul", { className: "np-docs-front-recent-list", children: recent.map((node) => /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsxs12("a", { href: `/docs/${node.slug}`, children: [
|
|
2499
|
+
/* @__PURE__ */ jsx13("span", { className: "np-docs-front-recent-title", children: node.title }),
|
|
2500
|
+
node.updatedAt ? /* @__PURE__ */ jsx13(
|
|
2263
2501
|
"time",
|
|
2264
2502
|
{
|
|
2265
2503
|
className: "np-docs-front-recent-time",
|
|
@@ -2339,15 +2577,30 @@ function formatRelative(iso) {
|
|
|
2339
2577
|
// src/index.ts
|
|
2340
2578
|
var SEED_NAV = {
|
|
2341
2579
|
header: [
|
|
2342
|
-
{ id: "nav-docs-docs", label: "Docs", type: "link", url: "/
|
|
2580
|
+
{ id: "nav-docs-docs", label: "Docs", type: "link", url: "/" },
|
|
2343
2581
|
{ id: "nav-docs-reference", label: "Reference", type: "link", url: "/docs/reference" },
|
|
2344
2582
|
{ id: "nav-docs-blog", label: "Blog", type: "link", url: "/blog" }
|
|
2345
2583
|
],
|
|
2346
2584
|
footer: [
|
|
2347
|
-
{ id: "nav-docs-footer-docs", label: "Documentation", type: "link", url: "/
|
|
2348
|
-
{
|
|
2349
|
-
|
|
2350
|
-
|
|
2585
|
+
{ id: "nav-docs-footer-docs", label: "Documentation", type: "link", url: "/" },
|
|
2586
|
+
{
|
|
2587
|
+
id: "nav-docs-footer-reference",
|
|
2588
|
+
label: "Reference",
|
|
2589
|
+
type: "link",
|
|
2590
|
+
url: "/docs/reference"
|
|
2591
|
+
},
|
|
2592
|
+
{
|
|
2593
|
+
id: "nav-docs-footer-changelog",
|
|
2594
|
+
label: "Changelog",
|
|
2595
|
+
type: "link",
|
|
2596
|
+
url: "/changelog"
|
|
2597
|
+
},
|
|
2598
|
+
{
|
|
2599
|
+
id: "nav-docs-footer-github",
|
|
2600
|
+
label: "GitHub",
|
|
2601
|
+
type: "link",
|
|
2602
|
+
url: "https://github.com"
|
|
2603
|
+
}
|
|
2351
2604
|
]
|
|
2352
2605
|
};
|
|
2353
2606
|
function paragraph(text) {
|
|
@@ -2357,15 +2610,17 @@ function paragraph(text) {
|
|
|
2357
2610
|
direction: null,
|
|
2358
2611
|
format: "",
|
|
2359
2612
|
indent: 0,
|
|
2360
|
-
children: [
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2613
|
+
children: [
|
|
2614
|
+
{
|
|
2615
|
+
type: "text",
|
|
2616
|
+
version: 1,
|
|
2617
|
+
detail: 0,
|
|
2618
|
+
format: 0,
|
|
2619
|
+
mode: "normal",
|
|
2620
|
+
style: "",
|
|
2621
|
+
text
|
|
2622
|
+
}
|
|
2623
|
+
]
|
|
2369
2624
|
};
|
|
2370
2625
|
}
|
|
2371
2626
|
function heading(tag, text) {
|
|
@@ -2376,15 +2631,17 @@ function heading(tag, text) {
|
|
|
2376
2631
|
direction: null,
|
|
2377
2632
|
format: "",
|
|
2378
2633
|
indent: 0,
|
|
2379
|
-
children: [
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2634
|
+
children: [
|
|
2635
|
+
{
|
|
2636
|
+
type: "text",
|
|
2637
|
+
version: 1,
|
|
2638
|
+
detail: 0,
|
|
2639
|
+
format: 0,
|
|
2640
|
+
mode: "normal",
|
|
2641
|
+
style: "",
|
|
2642
|
+
text
|
|
2643
|
+
}
|
|
2644
|
+
]
|
|
2388
2645
|
};
|
|
2389
2646
|
}
|
|
2390
2647
|
function codeBlock(text, language) {
|
|
@@ -2395,15 +2652,17 @@ function codeBlock(text, language) {
|
|
|
2395
2652
|
direction: null,
|
|
2396
2653
|
format: "",
|
|
2397
2654
|
indent: 0,
|
|
2398
|
-
children: [
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2655
|
+
children: [
|
|
2656
|
+
{
|
|
2657
|
+
type: "text",
|
|
2658
|
+
version: 1,
|
|
2659
|
+
detail: 0,
|
|
2660
|
+
format: 0,
|
|
2661
|
+
mode: "normal",
|
|
2662
|
+
style: "",
|
|
2663
|
+
text
|
|
2664
|
+
}
|
|
2665
|
+
]
|
|
2407
2666
|
};
|
|
2408
2667
|
}
|
|
2409
2668
|
function listItem(text) {
|
|
@@ -2414,15 +2673,17 @@ function listItem(text) {
|
|
|
2414
2673
|
direction: null,
|
|
2415
2674
|
format: "",
|
|
2416
2675
|
indent: 0,
|
|
2417
|
-
children: [
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2676
|
+
children: [
|
|
2677
|
+
{
|
|
2678
|
+
type: "text",
|
|
2679
|
+
version: 1,
|
|
2680
|
+
detail: 0,
|
|
2681
|
+
format: 0,
|
|
2682
|
+
mode: "normal",
|
|
2683
|
+
style: "",
|
|
2684
|
+
text
|
|
2685
|
+
}
|
|
2686
|
+
]
|
|
2426
2687
|
};
|
|
2427
2688
|
}
|
|
2428
2689
|
function bulletList(items) {
|
|
@@ -2456,7 +2717,9 @@ function stubDoc(opts) {
|
|
|
2456
2717
|
title: opts.title,
|
|
2457
2718
|
excerpt: opts.lede ?? `${opts.title} reference page.`,
|
|
2458
2719
|
content: lexicalDoc([
|
|
2459
|
-
paragraph(
|
|
2720
|
+
paragraph(
|
|
2721
|
+
`Placeholder body for ${opts.title}. Operators replace this once they're set up \u2014 every doc-kind post renders through the three-column docs template.`
|
|
2722
|
+
)
|
|
2460
2723
|
]),
|
|
2461
2724
|
publishedAt: DOCS_NOW,
|
|
2462
2725
|
kind: "doc",
|
|
@@ -2521,7 +2784,7 @@ var QUICKSTART_BODY = lexicalDoc([
|
|
|
2521
2784
|
"typescript"
|
|
2522
2785
|
),
|
|
2523
2786
|
paragraph(
|
|
2524
|
-
"Hot reload
|
|
2787
|
+
"Hot reload picks up new plugin files without a restart. Config changes do require one \u2014 that's a Next.js constraint, not ours."
|
|
2525
2788
|
),
|
|
2526
2789
|
heading("h2", "Lifecycle hooks at a glance"),
|
|
2527
2790
|
paragraph(
|
|
@@ -2547,9 +2810,7 @@ var QUICKSTART_BODY = lexicalDoc([
|
|
|
2547
2810
|
"Hooks block the response: onDocumentPublished runs inside the publish request. Long-running work \u2014 sending emails, regenerating sitemaps \u2014 belongs in onSchedule or a queued job. Otherwise the editor will wait on it."
|
|
2548
2811
|
),
|
|
2549
2812
|
heading("h2", "Next steps"),
|
|
2550
|
-
paragraph(
|
|
2551
|
-
"You have a plugin that runs. Two natural directions from here:"
|
|
2552
|
-
),
|
|
2813
|
+
paragraph("You have a plugin that runs. Two natural directions from here:"),
|
|
2553
2814
|
bulletList([
|
|
2554
2815
|
"Add a route. Declare a routes entry in the manifest to expose a public URL \u2014 for webhooks, OAuth callbacks, or a custom admin screen.",
|
|
2555
2816
|
"Add collections. Plugins can declare their own collections, which the admin surfaces alongside the operator's. See the Plugin manifest reference."
|
|
@@ -2562,6 +2823,20 @@ var SEED_PAGES = [
|
|
|
2562
2823
|
seoDescription: "Install NexPress, learn the core concepts, write plugins, and look up the API.",
|
|
2563
2824
|
blocks: [],
|
|
2564
2825
|
template: "front"
|
|
2826
|
+
},
|
|
2827
|
+
{
|
|
2828
|
+
title: "definePlugin",
|
|
2829
|
+
slug: "docs/reference/define-plugin",
|
|
2830
|
+
seoDescription: "API reference for definePlugin from @nexpress/plugin-sdk.",
|
|
2831
|
+
blocks: [],
|
|
2832
|
+
template: "apiReference"
|
|
2833
|
+
},
|
|
2834
|
+
{
|
|
2835
|
+
title: "Changelog",
|
|
2836
|
+
slug: "changelog",
|
|
2837
|
+
seoDescription: "Reverse-chronological changelog for NexPress pre-1.0 releases.",
|
|
2838
|
+
blocks: [],
|
|
2839
|
+
template: "changelog"
|
|
2565
2840
|
}
|
|
2566
2841
|
];
|
|
2567
2842
|
var SEED_DOCS = [
|
|
@@ -2577,7 +2852,12 @@ var SEED_DOCS = [
|
|
|
2577
2852
|
lede: "What NexPress is, what it isn't, and who it's for.",
|
|
2578
2853
|
stableSince: "Stable since 0.1"
|
|
2579
2854
|
}),
|
|
2580
|
-
stubDoc({
|
|
2855
|
+
stubDoc({
|
|
2856
|
+
title: "Install",
|
|
2857
|
+
parentSlug: "get-started",
|
|
2858
|
+
order: 1,
|
|
2859
|
+
stableSince: "Stable since 0.1"
|
|
2860
|
+
}),
|
|
2581
2861
|
stubDoc({ title: "Project structure", parentSlug: "get-started", order: 2 }),
|
|
2582
2862
|
stubDoc({ title: "Configuration", parentSlug: "get-started", order: 3 }),
|
|
2583
2863
|
stubDoc({ title: "Deployment", parentSlug: "get-started", order: 4 }),
|
|
@@ -2586,7 +2866,12 @@ var SEED_DOCS = [
|
|
|
2586
2866
|
order: 1,
|
|
2587
2867
|
lede: "The model behind collections, themes, plugins, and blocks."
|
|
2588
2868
|
}),
|
|
2589
|
-
stubDoc({
|
|
2869
|
+
stubDoc({
|
|
2870
|
+
title: "Collections",
|
|
2871
|
+
parentSlug: "core-concepts",
|
|
2872
|
+
order: 0,
|
|
2873
|
+
stableSince: "Stable since 0.1"
|
|
2874
|
+
}),
|
|
2590
2875
|
stubDoc({ title: "Pages & routing", parentSlug: "core-concepts", order: 1 }),
|
|
2591
2876
|
stubDoc({ title: "Themes", parentSlug: "core-concepts", order: 2 }),
|
|
2592
2877
|
stubDoc({ title: "Blocks", parentSlug: "core-concepts", order: 3 }),
|
|
@@ -2597,10 +2882,10 @@ var SEED_DOCS = [
|
|
|
2597
2882
|
order: 2,
|
|
2598
2883
|
lede: "Extend NexPress with hooks, routes, blocks, and scheduled jobs."
|
|
2599
2884
|
}),
|
|
2600
|
-
stubDoc({ title: "
|
|
2885
|
+
stubDoc({ title: "Overview", parentSlug: "plugins", order: 0 }),
|
|
2601
2886
|
{
|
|
2602
|
-
title: "
|
|
2603
|
-
excerpt: 'From "I want to add behavior
|
|
2887
|
+
title: "Plugin author quickstart",
|
|
2888
|
+
excerpt: 'From "I want to add behavior" to a running plugin in ten minutes.',
|
|
2604
2889
|
content: QUICKSTART_BODY,
|
|
2605
2890
|
publishedAt: DOCS_NOW,
|
|
2606
2891
|
kind: "doc",
|
|
@@ -2608,12 +2893,12 @@ var SEED_DOCS = [
|
|
|
2608
2893
|
order: 1,
|
|
2609
2894
|
data: {
|
|
2610
2895
|
badge: "NEW",
|
|
2611
|
-
lede: 'From "I want to add behavior
|
|
2896
|
+
lede: 'From "I want to add behavior" to a running plugin in ten minutes.',
|
|
2612
2897
|
stableSince: "Stable since 0.1"
|
|
2613
2898
|
}
|
|
2614
2899
|
},
|
|
2615
|
-
stubDoc({ title: "Manifest
|
|
2616
|
-
stubDoc({ title: "Lifecycle
|
|
2900
|
+
stubDoc({ title: "Manifest", parentSlug: "plugins", order: 2 }),
|
|
2901
|
+
stubDoc({ title: "Lifecycle", parentSlug: "plugins", order: 3 }),
|
|
2617
2902
|
stubDoc({ title: "Publishing", parentSlug: "plugins", order: 4 }),
|
|
2618
2903
|
stubDoc({
|
|
2619
2904
|
title: "Reference",
|
|
@@ -2748,6 +3033,16 @@ var docsTheme = defineTheme({
|
|
|
2748
3033
|
label: "Front page",
|
|
2749
3034
|
description: 'Docs landing \u2014 hero + 2x2 group cards walking the kind="doc" tree + recently-updated row. The seeded home page (slug "/") ships with this template.',
|
|
2750
3035
|
component: PageFrontTemplate
|
|
3036
|
+
},
|
|
3037
|
+
apiReference: {
|
|
3038
|
+
label: "API reference",
|
|
3039
|
+
description: "Docs reference page with signature, parameter table, and return contract.",
|
|
3040
|
+
component: PageApiReferenceTemplate
|
|
3041
|
+
},
|
|
3042
|
+
changelog: {
|
|
3043
|
+
label: "Changelog",
|
|
3044
|
+
description: "Reverse-chronological release timeline with typed change labels.",
|
|
3045
|
+
component: PageChangelogTemplate
|
|
2751
3046
|
}
|
|
2752
3047
|
},
|
|
2753
3048
|
// Universal-content-model #748 — docs are posts with
|
|
@@ -2829,6 +3124,8 @@ export {
|
|
|
2829
3124
|
DocsSearch,
|
|
2830
3125
|
DocsShell,
|
|
2831
3126
|
DocsSidebar,
|
|
3127
|
+
PageApiReferenceTemplate,
|
|
3128
|
+
PageChangelogTemplate,
|
|
2832
3129
|
docsBlocks,
|
|
2833
3130
|
docsCss,
|
|
2834
3131
|
docsSettingsSchema,
|