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.
package/dist/publish.mjs CHANGED
@@ -104,7 +104,11 @@ var loadUtils = () => loadDep("@clean-jsdoc-theme/utils", [
104
104
  "formatRenderError",
105
105
  "normalizeBasePath",
106
106
  "withBase",
107
- "toExtractManifest"
107
+ "toExtractManifest",
108
+ "normalizeCollapsibleSidebarSections",
109
+ "unmatchedCollapsibleSections",
110
+ "topLevelSectionLabels",
111
+ "normalizeScrollbar"
108
112
  ]);
109
113
  var loadOra = async () => {
110
114
  try {
@@ -1050,7 +1054,11 @@ async function publish(data, opts, tutorials) {
1050
1054
  formatRenderError,
1051
1055
  normalizeBasePath,
1052
1056
  withBase,
1053
- toExtractManifest
1057
+ toExtractManifest,
1058
+ normalizeCollapsibleSidebarSections,
1059
+ unmatchedCollapsibleSections,
1060
+ topLevelSectionLabels,
1061
+ normalizeScrollbar
1054
1062
  }
1055
1063
  // Loaded sequentially (not Promise.all) so the spinner can step its label
1056
1064
  // through each module — the evaluation of these large ESM bundles is the
@@ -1125,6 +1133,10 @@ async function publish(data, opts, tutorials) {
1125
1133
  const sectionOrder = normalizeSectionOrder(opts.sectionOrder);
1126
1134
  const menu = normalizeMenu(opts.menu);
1127
1135
  const clubSidebarItems = opts.clubSidebarItems === true;
1136
+ const { value: collapsibleSidebarSections, warnings: collapsibleWarnings } = normalizeCollapsibleSidebarSections(opts.collapsibleSidebarSections);
1137
+ collapsibleWarnings.forEach((w) => console.warn(`clean-jsdoc-theme: ${w}`));
1138
+ const { value: scrollbar, warnings: scrollbarWarnings } = normalizeScrollbar(opts.scrollbar);
1139
+ scrollbarWarnings.forEach((w) => console.warn(`clean-jsdoc-theme: ${w}`));
1128
1140
  const playground = normalizePlayground(opts.playground);
1129
1141
  const siteOptions = {
1130
1142
  ...pkg ? { pkg } : {},
@@ -1138,12 +1150,22 @@ async function publish(data, opts, tutorials) {
1138
1150
  ...sectionOrder ? { sectionOrder } : {},
1139
1151
  ...menu ? { menu } : {},
1140
1152
  ...clubSidebarItems ? { clubSidebarItems } : {},
1153
+ ...collapsibleSidebarSections !== void 0 ? { collapsibleSidebarSections } : {},
1141
1154
  ...playground ? { playground: playground.site } : {}
1142
1155
  };
1143
1156
  const manifest = await progress.stage(
1144
1157
  "Generating pages",
1145
1158
  () => buildSpec ? stampSite(data, buildSpec.apiMessages, siteOptions) : generateSite(data, siteOptions)
1146
1159
  );
1160
+ if (Array.isArray(collapsibleSidebarSections)) {
1161
+ const present = topLevelSectionLabels(manifest.nav);
1162
+ const unmatched = unmatchedCollapsibleSections(collapsibleSidebarSections, present);
1163
+ if (unmatched.length > 0) {
1164
+ console.warn(
1165
+ `clean-jsdoc-theme: collapsibleSidebarSections \u2014 no sidebar section matches ${unmatched.map((l) => `'${l}'`).join(", ")}. Available sections: ${present.join(", ")}.`
1166
+ );
1167
+ }
1168
+ }
1147
1169
  const extractPath = process.env.CLEAN_JSDOC_THEME_EXTRACT?.trim();
1148
1170
  if (extractPath) {
1149
1171
  const target = resolvePath(extractPath);
@@ -1187,7 +1209,8 @@ async function publish(data, opts, tutorials) {
1187
1209
  ...customAssets.theme,
1188
1210
  ...footer ? { footer } : {},
1189
1211
  ...favicon ? { favicon: favicon.href } : {},
1190
- ...meta ? { meta } : {}
1212
+ ...meta ? { meta } : {},
1213
+ ...scrollbar ? { scrollbar } : {}
1191
1214
  },
1192
1215
  destination: absoluteDestination,
1193
1216
  islandCacheDir,