@redocly/theme 0.11.3 → 0.11.5
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/lib/components/Catalog/useCatalog.js +17 -1
- package/lib/components/Markdown/MarkdownWrapper.js +4 -0
- package/lib/globalStyle.js +7 -0
- package/package.json +1 -1
- package/src/components/Catalog/useCatalog.ts +17 -1
- package/src/components/Markdown/MarkdownWrapper.tsx +4 -0
- package/src/globalStyle.ts +7 -0
|
@@ -145,10 +145,26 @@ function useSearchParams(location) {
|
|
|
145
145
|
return React.useMemo(() => new URLSearchParams(location.search), [location.search]);
|
|
146
146
|
}
|
|
147
147
|
function normalizeItems(items, config) {
|
|
148
|
+
// because of RBAC some versions can be missing so we need to pick up other default version
|
|
149
|
+
const hasDeafultVersion = {};
|
|
150
|
+
for (const item of items) {
|
|
151
|
+
if (item.versionFolderId && item.isDefault) {
|
|
152
|
+
hasDeafultVersion[item.versionFolderId] = true;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
148
155
|
if (!config.separateVersions) {
|
|
149
156
|
// keep only default version
|
|
150
157
|
// idea: save other versions information (may be useful for cards)
|
|
151
|
-
items = items.filter((item) =>
|
|
158
|
+
items = items.filter((item) => {
|
|
159
|
+
if (!item.versionFolderId)
|
|
160
|
+
return true;
|
|
161
|
+
if (!hasDeafultVersion[item.versionFolderId]) {
|
|
162
|
+
// we already picked the default version so let's ignore next versions
|
|
163
|
+
hasDeafultVersion[item.versionFolderId] = true;
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
return item.isDefault;
|
|
167
|
+
});
|
|
152
168
|
}
|
|
153
169
|
return items.map((item) => {
|
|
154
170
|
var _a, _b, _c;
|
|
@@ -373,6 +373,10 @@ exports.MarkdownWrapper = styled_components_1.default.main.attrs(() => ({
|
|
|
373
373
|
list-style: var(--md-list-item-style);
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
+
ul > li:has(input[type='checkbox']) {
|
|
377
|
+
list-style: var(--md-checkbox-list-item-style);
|
|
378
|
+
}
|
|
379
|
+
|
|
376
380
|
ol > li {
|
|
377
381
|
list-style: var(--md-numbered-list-item-style);
|
|
378
382
|
}
|
package/lib/globalStyle.js
CHANGED
|
@@ -1772,6 +1772,13 @@ const markdown = (0, styled_components_1.css) `
|
|
|
1772
1772
|
--md-list-item-margin: 0.25rem; // @presenter Spacing
|
|
1773
1773
|
--md-list-item-style: inherit;
|
|
1774
1774
|
|
|
1775
|
+
|
|
1776
|
+
/**
|
|
1777
|
+
* @tokens Markdown Checkbox List
|
|
1778
|
+
*/
|
|
1779
|
+
|
|
1780
|
+
--md-checkbox-list-item-style: none;
|
|
1781
|
+
|
|
1775
1782
|
/**
|
|
1776
1783
|
* @tokens Markdown Numbered List
|
|
1777
1784
|
*/
|
package/package.json
CHANGED
|
@@ -165,10 +165,26 @@ function useSearchParams(location: Location) {
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
function normalizeItems(items: ResolvedNavItem[], config: CatalogConfig): CatalogItem[] {
|
|
168
|
+
// because of RBAC some versions can be missing so we need to pick up other default version
|
|
169
|
+
const hasDeafultVersion: Record<string, boolean> = {};
|
|
170
|
+
for (const item of items) {
|
|
171
|
+
if (item.versionFolderId && item.isDefault) {
|
|
172
|
+
hasDeafultVersion[item.versionFolderId] = true;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
168
176
|
if (!config.separateVersions) {
|
|
169
177
|
// keep only default version
|
|
170
178
|
// idea: save other versions information (may be useful for cards)
|
|
171
|
-
items = items.filter((item) =>
|
|
179
|
+
items = items.filter((item) => {
|
|
180
|
+
if (!item.versionFolderId) return true;
|
|
181
|
+
if (!hasDeafultVersion[item.versionFolderId]) {
|
|
182
|
+
// we already picked the default version so let's ignore next versions
|
|
183
|
+
hasDeafultVersion[item.versionFolderId] = true;
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
return item.isDefault;
|
|
187
|
+
});
|
|
172
188
|
}
|
|
173
189
|
|
|
174
190
|
return items.map((item) => {
|
|
@@ -352,6 +352,10 @@ export const MarkdownWrapper = styled.main.attrs(() => ({
|
|
|
352
352
|
list-style: var(--md-list-item-style);
|
|
353
353
|
}
|
|
354
354
|
|
|
355
|
+
ul > li:has(input[type='checkbox']) {
|
|
356
|
+
list-style: var(--md-checkbox-list-item-style);
|
|
357
|
+
}
|
|
358
|
+
|
|
355
359
|
ol > li {
|
|
356
360
|
list-style: var(--md-numbered-list-item-style);
|
|
357
361
|
}
|
package/src/globalStyle.ts
CHANGED
|
@@ -1792,6 +1792,13 @@ const markdown = css`
|
|
|
1792
1792
|
--md-list-item-margin: 0.25rem; // @presenter Spacing
|
|
1793
1793
|
--md-list-item-style: inherit;
|
|
1794
1794
|
|
|
1795
|
+
|
|
1796
|
+
/**
|
|
1797
|
+
* @tokens Markdown Checkbox List
|
|
1798
|
+
*/
|
|
1799
|
+
|
|
1800
|
+
--md-checkbox-list-item-style: none;
|
|
1801
|
+
|
|
1795
1802
|
/**
|
|
1796
1803
|
* @tokens Markdown Numbered List
|
|
1797
1804
|
*/
|