clean-jsdoc-theme 5.0.8 → 5.1.1

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.
@@ -83,6 +83,13 @@ interface JSDocOpts {
83
83
  * parent); a prefix with a single entry is left flat. Off by default.
84
84
  */
85
85
  clubSidebarItems?: unknown;
86
+ /**
87
+ * Which top-level sidebar sections collapse (`jsdoc.json`
88
+ * `"opts": { "collapsibleSidebarSections": true | ["Classes","Namespaces"] }`).
89
+ * `true`/absent → all; `false` → none; array → only those exact labels
90
+ * (case-sensitive). Unmatched labels warn. See utils `resolveCollapsibleSections`.
91
+ */
92
+ collapsibleSidebarSections?: unknown;
86
93
  /**
87
94
  * Custom prompt for the copy-page button's "Open in ChatGPT/Claude/Perplexity"
88
95
  * actions (`jsdoc.json` `"opts": { "aiPrompt": "…" }`). `{siteName}`, `{url}`,
@@ -106,6 +113,12 @@ interface JSDocOpts {
106
113
  * Defaults to enabled.
107
114
  */
108
115
  pageNav?: unknown;
116
+ /**
117
+ * Scrollbar presentation (`jsdoc.json` `"opts": { "scrollbar": "native" }`).
118
+ * `"styled"` (default) = overlay bar that hides at rest; `"visible"` = themed
119
+ * bar always shown; `"native"` = the browser's own scrollbar. See #281.
120
+ */
121
+ scrollbar?: unknown;
109
122
  /**
110
123
  * Code-playground config (`jsdoc.json` `"opts": { "playground": … }`). Either
111
124
  * a boolean (`true` turns it on with defaults; absent/`false` = off) or an
package/dist/publish.d.ts CHANGED
@@ -83,6 +83,13 @@ interface JSDocOpts {
83
83
  * parent); a prefix with a single entry is left flat. Off by default.
84
84
  */
85
85
  clubSidebarItems?: unknown;
86
+ /**
87
+ * Which top-level sidebar sections collapse (`jsdoc.json`
88
+ * `"opts": { "collapsibleSidebarSections": true | ["Classes","Namespaces"] }`).
89
+ * `true`/absent → all; `false` → none; array → only those exact labels
90
+ * (case-sensitive). Unmatched labels warn. See utils `resolveCollapsibleSections`.
91
+ */
92
+ collapsibleSidebarSections?: unknown;
86
93
  /**
87
94
  * Custom prompt for the copy-page button's "Open in ChatGPT/Claude/Perplexity"
88
95
  * actions (`jsdoc.json` `"opts": { "aiPrompt": "…" }`). `{siteName}`, `{url}`,
@@ -106,6 +113,12 @@ interface JSDocOpts {
106
113
  * Defaults to enabled.
107
114
  */
108
115
  pageNav?: unknown;
116
+ /**
117
+ * Scrollbar presentation (`jsdoc.json` `"opts": { "scrollbar": "native" }`).
118
+ * `"styled"` (default) = overlay bar that hides at rest; `"visible"` = themed
119
+ * bar always shown; `"native"` = the browser's own scrollbar. See #281.
120
+ */
121
+ scrollbar?: unknown;
109
122
  /**
110
123
  * Code-playground config (`jsdoc.json` `"opts": { "playground": … }`). Either
111
124
  * a boolean (`true` turns it on with defaults; absent/`false` = off) or an
package/dist/publish.js CHANGED
@@ -151,7 +151,11 @@ var loadUtils = () => loadDep("@clean-jsdoc-theme/utils", [
151
151
  "formatRenderError",
152
152
  "normalizeBasePath",
153
153
  "withBase",
154
- "toExtractManifest"
154
+ "toExtractManifest",
155
+ "normalizeCollapsibleSidebarSections",
156
+ "unmatchedCollapsibleSections",
157
+ "topLevelSectionLabels",
158
+ "normalizeScrollbar"
155
159
  ]);
156
160
  var loadOra = async () => {
157
161
  try {
@@ -1097,7 +1101,11 @@ async function publish(data, opts, tutorials) {
1097
1101
  formatRenderError,
1098
1102
  normalizeBasePath,
1099
1103
  withBase,
1100
- toExtractManifest
1104
+ toExtractManifest,
1105
+ normalizeCollapsibleSidebarSections,
1106
+ unmatchedCollapsibleSections,
1107
+ topLevelSectionLabels,
1108
+ normalizeScrollbar
1101
1109
  }
1102
1110
  // Loaded sequentially (not Promise.all) so the spinner can step its label
1103
1111
  // through each module — the evaluation of these large ESM bundles is the
@@ -1172,6 +1180,10 @@ async function publish(data, opts, tutorials) {
1172
1180
  const sectionOrder = normalizeSectionOrder(opts.sectionOrder);
1173
1181
  const menu = normalizeMenu(opts.menu);
1174
1182
  const clubSidebarItems = opts.clubSidebarItems === true;
1183
+ const { value: collapsibleSidebarSections, warnings: collapsibleWarnings } = normalizeCollapsibleSidebarSections(opts.collapsibleSidebarSections);
1184
+ collapsibleWarnings.forEach((w) => console.warn(`clean-jsdoc-theme: ${w}`));
1185
+ const { value: scrollbar, warnings: scrollbarWarnings } = normalizeScrollbar(opts.scrollbar);
1186
+ scrollbarWarnings.forEach((w) => console.warn(`clean-jsdoc-theme: ${w}`));
1175
1187
  const playground = normalizePlayground(opts.playground);
1176
1188
  const siteOptions = {
1177
1189
  ...pkg ? { pkg } : {},
@@ -1185,12 +1197,22 @@ async function publish(data, opts, tutorials) {
1185
1197
  ...sectionOrder ? { sectionOrder } : {},
1186
1198
  ...menu ? { menu } : {},
1187
1199
  ...clubSidebarItems ? { clubSidebarItems } : {},
1200
+ ...collapsibleSidebarSections !== void 0 ? { collapsibleSidebarSections } : {},
1188
1201
  ...playground ? { playground: playground.site } : {}
1189
1202
  };
1190
1203
  const manifest = await progress.stage(
1191
1204
  "Generating pages",
1192
1205
  () => buildSpec ? stampSite(data, buildSpec.apiMessages, siteOptions) : generateSite(data, siteOptions)
1193
1206
  );
1207
+ if (Array.isArray(collapsibleSidebarSections)) {
1208
+ const present = topLevelSectionLabels(manifest.nav);
1209
+ const unmatched = unmatchedCollapsibleSections(collapsibleSidebarSections, present);
1210
+ if (unmatched.length > 0) {
1211
+ console.warn(
1212
+ `clean-jsdoc-theme: collapsibleSidebarSections \u2014 no sidebar section matches ${unmatched.map((l) => `'${l}'`).join(", ")}. Available sections: ${present.join(", ")}.`
1213
+ );
1214
+ }
1215
+ }
1194
1216
  const extractPath = process.env.CLEAN_JSDOC_THEME_EXTRACT?.trim();
1195
1217
  if (extractPath) {
1196
1218
  const target = (0, import_node_path2.resolve)(extractPath);
@@ -1234,7 +1256,8 @@ async function publish(data, opts, tutorials) {
1234
1256
  ...customAssets.theme,
1235
1257
  ...footer ? { footer } : {},
1236
1258
  ...favicon ? { favicon: favicon.href } : {},
1237
- ...meta ? { meta } : {}
1259
+ ...meta ? { meta } : {},
1260
+ ...scrollbar ? { scrollbar } : {}
1238
1261
  },
1239
1262
  destination: absoluteDestination,
1240
1263
  islandCacheDir,