umberto 10.7.4 → 10.7.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/CHANGELOG.md +11 -16
- package/package.json +1 -1
- package/src/data-converter/converters/typedoc/typedocconverter.js +99 -31
- package/themes/umberto/layout/gloria/_api-docs/_mixin/_method.pug +5 -3
- package/themes/umberto/layout/gloria/_api-docs/_mixin/_params.pug +14 -7
- package/themes/umberto/layout/gloria/_api-docs/_mixin/_property.pug +3 -3
- package/themes/umberto/layout/gloria/_api-docs/_mixin/_type.pug +1 -5
- package/themes/umberto/layout/gloria/_api-docs/_mixin/type-parameter.pug +1 -1
- package/themes/umberto/layout/gloria/_api-docs/_partial/type-parameters.pug +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [10.7.5](https://github.com/cksource/umberto/compare/v10.7.4...v10.7.5) (August 13, 2026)
|
|
5
|
+
|
|
6
|
+
### Bug fixes
|
|
7
|
+
|
|
8
|
+
* The hierarchy of a class or an interface rendered in the API docs built from Typedoc output now contains the full inheritance chain instead of the first level only. Derived classes, derived interfaces, and implementing classes are also resolved transitively, so the "Subclasses", "Implemented by", and "Implements" lists match the behavior of the JSDoc-based pipeline.
|
|
9
|
+
|
|
10
|
+
### Other changes
|
|
11
|
+
|
|
12
|
+
* Unified the rendering of optional properties and parameters in the API documentation in the Gloria theme. Optional members are now marked with the TypeScript question mark suffix, and the separator between a member name and its type no longer contains a space before the colon, matching the TypeScript syntax (for example `options?: Object` instead of `[ options ] : Object`). Previously, optional parameters were wrapped in square brackets and optional properties had the `undefined` type appended to their type lists.
|
|
13
|
+
|
|
14
|
+
|
|
4
15
|
## [10.7.4](https://github.com/cksource/umberto/compare/v10.7.3...v10.7.4) (July 27, 2026)
|
|
5
16
|
|
|
6
17
|
### Other changes
|
|
@@ -32,22 +43,6 @@ Changelog
|
|
|
32
43
|
|
|
33
44
|
* Improved the performance of the documentation build. Pug templates of XML components used in Markdown are now compiled once and reused across pages, instead of being recompiled for every component occurrence. This shortens the page generation phase by about 20%.
|
|
34
45
|
|
|
35
|
-
|
|
36
|
-
## [10.7.0](https://github.com/cksource/umberto/compare/v10.6.1...v10.7.0) (July 2, 2026)
|
|
37
|
-
|
|
38
|
-
### Features
|
|
39
|
-
|
|
40
|
-
* Enabled MCP install menu in the Kapa widget.
|
|
41
|
-
|
|
42
|
-
### Bug fixes
|
|
43
|
-
|
|
44
|
-
* Fixed scrolling to a section in the Gloria theme when navigating to an anchor without a full page reload — for example, changing the anchor in the address bar, using the browser's back/forward buttons, or opening a link to a section on the current page. The target heading is now offset below the sticky header instead of being hidden beneath it.
|
|
45
|
-
* Moved `chokidar` from `devDependencies` to `dependencies`. It is imported at runtime by the file watcher (`src/tasks/watcher.js`), which ships with the package, so it must be installed for consumers. Previously it resolved only by chance through a hoisted copy in the consumer's tree, which fails when the consumer enables pnpm's `enableGlobalVirtualStore` and the package is linked from the global store, outside the consumer's `node_modules`.
|
|
46
|
-
|
|
47
|
-
### Other changes
|
|
48
|
-
|
|
49
|
-
* The tabbed content component now sets a `data-tab-label` attribute on each tab panel, carrying the label of its tab. This exposes the label to tools that process the rendered HTML, where it otherwise lives only inside the tab button.
|
|
50
|
-
|
|
51
46
|
---
|
|
52
47
|
|
|
53
48
|
To see all releases, visit the [release page](https://github.com/cksource/umberto/releases).
|
package/package.json
CHANGED
|
@@ -89,6 +89,9 @@ export class TypedocConverter {
|
|
|
89
89
|
this._convertChild( child );
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
// Resolve full inheritance chains while all doclets still carry their original signatures.
|
|
93
|
+
this._buildHierarchy();
|
|
94
|
+
|
|
92
95
|
// Then, when all doclets are specified, let's align types.
|
|
93
96
|
for ( const doclet of this._doclets ) {
|
|
94
97
|
// Skip source if the `file` property is not specified.
|
|
@@ -101,28 +104,6 @@ export class TypedocConverter {
|
|
|
101
104
|
continue;
|
|
102
105
|
}
|
|
103
106
|
|
|
104
|
-
// TODO: Could we get a deep list of all inheritance/derived?
|
|
105
|
-
// Map parent references of classes and interfaces...
|
|
106
|
-
if ( 'augmentsNested' in doclet ) {
|
|
107
|
-
const extendedTypes = doclet._signature.extendedTypes || [];
|
|
108
|
-
|
|
109
|
-
doclet.augmentsNested = extendedTypes.flatMap( getHierarchyCallback( this._typeConverter ) );
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// ...but also, the derived instances...
|
|
113
|
-
if ( 'descendants' in doclet ) {
|
|
114
|
-
const extendedBy = doclet._signature.extendedBy || [];
|
|
115
|
-
|
|
116
|
-
doclet.descendants = extendedBy.flatMap( getHierarchyCallback( this._typeConverter ) );
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// ...and implemented interfaces.
|
|
120
|
-
if ( 'implementsNested' in doclet ) {
|
|
121
|
-
const implementedTypes = doclet._signature.implementedTypes || [];
|
|
122
|
-
|
|
123
|
-
doclet.implementsNested = implementedTypes.flatMap( getHierarchyCallback( this._typeConverter ) );
|
|
124
|
-
}
|
|
125
|
-
|
|
126
107
|
// Unify the `_signature` tuple, so all doclets use the same algorithm.
|
|
127
108
|
if ( !Array.isArray( doclet._signature ) ) {
|
|
128
109
|
doclet._signature = [ doclet._signature, doclet._signature ];
|
|
@@ -185,6 +166,92 @@ export class TypedocConverter {
|
|
|
185
166
|
} );
|
|
186
167
|
}
|
|
187
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Fills the `augmentsNested`, `implementsNested`, and `descendants` properties of class and interface doclets
|
|
171
|
+
* with full inheritance chains. Typedoc signatures (`extendedTypes`, `implementedTypes`, `extendedBy`) describe
|
|
172
|
+
* only the first level of the hierarchy, so ancestor references are followed transitively through the converted
|
|
173
|
+
* doclets.
|
|
174
|
+
*
|
|
175
|
+
* The `augmentsNested` chain continues only through ancestors of the same kind. Ancestors of an interface mixed
|
|
176
|
+
* into a class hierarchy (an intersection in `extendedTypes`) extend the list of implemented interfaces instead
|
|
177
|
+
* of the inheritance chain rendered on a page. Descendants are calculated by inverting the resolved ancestor
|
|
178
|
+
* relations, so both directions of the hierarchy stay consistent.
|
|
179
|
+
*
|
|
180
|
+
* @protected
|
|
181
|
+
*/
|
|
182
|
+
_buildHierarchy() {
|
|
183
|
+
const docletsByLongname = new Map( this._doclets.map( doclet => [ doclet.longname, doclet ] ) );
|
|
184
|
+
const hierarchyDoclets = this._doclets.filter( doclet => doclet._signature && 'augmentsNested' in doclet );
|
|
185
|
+
const relationsCache = new Map();
|
|
186
|
+
|
|
187
|
+
const resolveRelations = doclet => {
|
|
188
|
+
if ( relationsCache.has( doclet ) ) {
|
|
189
|
+
return relationsCache.get( doclet );
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const relations = { augmentsNested: [], implementsNested: [] };
|
|
193
|
+
|
|
194
|
+
// Fill the cache upfront to break potential reference cycles.
|
|
195
|
+
relationsCache.set( doclet, relations );
|
|
196
|
+
|
|
197
|
+
const collect = ( references, relationName ) => {
|
|
198
|
+
for ( const reference of references.flatMap( flattenHierarchyReference ) ) {
|
|
199
|
+
const longname = this._typeConverter.convertReference( reference );
|
|
200
|
+
|
|
201
|
+
relations[ relationName ].push( longname );
|
|
202
|
+
|
|
203
|
+
const ancestor = docletsByLongname.get( longname );
|
|
204
|
+
|
|
205
|
+
if ( !ancestor || !ancestor._signature || !( 'augmentsNested' in ancestor ) ) {
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const ancestorRelations = resolveRelations( ancestor );
|
|
210
|
+
|
|
211
|
+
if ( relationName === 'augmentsNested' && ancestor.kind === doclet.kind ) {
|
|
212
|
+
relations.augmentsNested.push( ...ancestorRelations.augmentsNested );
|
|
213
|
+
relations.implementsNested.push( ...ancestorRelations.implementsNested );
|
|
214
|
+
} else {
|
|
215
|
+
relations.implementsNested.push( ...ancestorRelations.augmentsNested, ...ancestorRelations.implementsNested );
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
collect( doclet._signature.extendedTypes || [], 'augmentsNested' );
|
|
221
|
+
collect( doclet._signature.implementedTypes || [], 'implementsNested' );
|
|
222
|
+
|
|
223
|
+
relations.augmentsNested = [ ...new Set( relations.augmentsNested ) ].filter( name => name !== doclet.longname );
|
|
224
|
+
relations.implementsNested = [ ...new Set( relations.implementsNested ) ].filter( name => name !== doclet.longname );
|
|
225
|
+
|
|
226
|
+
return relations;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
for ( const doclet of hierarchyDoclets ) {
|
|
230
|
+
const relations = resolveRelations( doclet );
|
|
231
|
+
|
|
232
|
+
doclet.augmentsNested = relations.augmentsNested;
|
|
233
|
+
|
|
234
|
+
if ( 'implementsNested' in doclet ) {
|
|
235
|
+
doclet.implementsNested = relations.implementsNested;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
doclet.descendants = [];
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
for ( const doclet of hierarchyDoclets ) {
|
|
242
|
+
const relations = resolveRelations( doclet );
|
|
243
|
+
const ancestors = new Set( [ ...relations.augmentsNested, ...relations.implementsNested ] );
|
|
244
|
+
|
|
245
|
+
for ( const longname of ancestors ) {
|
|
246
|
+
const ancestor = docletsByLongname.get( longname );
|
|
247
|
+
|
|
248
|
+
if ( ancestor && 'descendants' in ancestor && ancestor.descendants ) {
|
|
249
|
+
ancestor.descendants.push( doclet.longname );
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
188
255
|
/**
|
|
189
256
|
* @protected
|
|
190
257
|
* @param {BaseReflection} reflection
|
|
@@ -964,17 +1031,18 @@ class TypeConverter {
|
|
|
964
1031
|
}
|
|
965
1032
|
|
|
966
1033
|
/**
|
|
967
|
-
*
|
|
968
|
-
*
|
|
1034
|
+
* Flattens an intersection found in a hierarchy relation (for example, `class Foo extends Mixin( Base )` produces
|
|
1035
|
+
* `Base & SomeInterface` in `extendedTypes`) into a list of plain references.
|
|
1036
|
+
*
|
|
1037
|
+
* @param {AvailableTypes} reference
|
|
1038
|
+
* @returns {Array.<ReferenceType>}
|
|
969
1039
|
*/
|
|
970
|
-
function
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
}
|
|
1040
|
+
function flattenHierarchyReference( reference ) {
|
|
1041
|
+
if ( reference.type === 'intersection' ) {
|
|
1042
|
+
return reference.types;
|
|
1043
|
+
}
|
|
975
1044
|
|
|
976
|
-
|
|
977
|
-
};
|
|
1045
|
+
return [ reference ];
|
|
978
1046
|
}
|
|
979
1047
|
|
|
980
1048
|
function mapIndexSignatureObject( subItem, index ) {
|
|
@@ -26,17 +26,19 @@ mixin method( met )
|
|
|
26
26
|
code.api-item-heading__code
|
|
27
27
|
a.doc.b-link( class="member-name" href="#" + id ) #{ met.name }
|
|
28
28
|
|
|
29
|
-
//- params ( param1,
|
|
29
|
+
//- params ( param1, param2? )
|
|
30
30
|
| (
|
|
31
31
|
if isNonEmptyArray( met.params )
|
|
32
32
|
each param, index in met.params
|
|
33
33
|
if param.optional
|
|
34
|
-
|
|
|
34
|
+
| #{ param.name }?
|
|
35
35
|
else
|
|
36
36
|
| #{ param.name }
|
|
37
37
|
if ( param.subParamsString )
|
|
38
38
|
//- Allow rendering HTML from the `subParamsString` as it may contain links to other pages.
|
|
39
|
-
|
|
39
|
+
//- The string is prebuilt by the shared `api-builder` with the legacy `[name]`
|
|
40
|
+
//- convention for optional members, so convert it to the `name?` syntax here.
|
|
41
|
+
| !{ param.subParamsString.replace( /\[([\w$.]+)\]/g, '$1?' ) }
|
|
40
42
|
if index < met.params.length - 1
|
|
41
43
|
|,
|
|
42
44
|
else
|
|
@@ -14,21 +14,28 @@ mixin paramsMixin ( params, level, title )
|
|
|
14
14
|
|
|
15
15
|
dt
|
|
16
16
|
code
|
|
17
|
+
//- Consecutive piped text lines are joined with a newline, which renders as
|
|
18
|
+
//- a space. To keep the TypeScript-style `name?: Type` notation, the colon
|
|
19
|
+
//- must live in the same text node as the name.
|
|
20
|
+
- const hasTypes = isNonEmptyArray( param.types );
|
|
21
|
+
|
|
17
22
|
if isComputedProperty
|
|
18
23
|
- const [ parentParam, nestedParam ] = param.name.split( '.' );
|
|
19
24
|
|
|
20
25
|
| #{ parentParam }
|
|
21
26
|
i
|
|
22
27
|
| #{ nestedParam }
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
if hasTypes
|
|
29
|
+
| :!{ ' ' }
|
|
30
|
+
+type( param.types )
|
|
25
31
|
else
|
|
26
|
-
|
|
32
|
+
- const displayName = param.optional ? `${ param.name }?` : param.name;
|
|
27
33
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
if hasTypes
|
|
35
|
+
| #{ displayName }:!{ ' ' }
|
|
36
|
+
+type( param.types )
|
|
37
|
+
else
|
|
38
|
+
| #{ displayName }
|
|
32
39
|
|
|
33
40
|
dd
|
|
34
41
|
if ( param.description )
|
|
@@ -19,11 +19,11 @@ mixin property( prop )
|
|
|
19
19
|
h3
|
|
20
20
|
div.api-item-heading
|
|
21
21
|
code.api-item-heading__code
|
|
22
|
-
a.doc.b-link( class="member-name" href="#" + prop.id ) #{ prop.name }
|
|
22
|
+
a.doc.b-link( class="member-name" href="#" + prop.id ) #{ prop.optional ? prop.name + '?' : prop.name }
|
|
23
23
|
|
|
24
24
|
if isNonEmptyArray( prop.types )
|
|
25
|
-
|
|
|
26
|
-
+type( prop.types
|
|
25
|
+
| :!{' '}
|
|
26
|
+
+type( prop.types )
|
|
27
27
|
if isNonEmptyArray( prop.badges )
|
|
28
28
|
+tagWrapper()
|
|
29
29
|
each badge in prop.badges
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
include ./_link-or-text.pug
|
|
2
2
|
|
|
3
|
-
mixin type( types
|
|
3
|
+
mixin type( types )
|
|
4
4
|
each nameOrObject, index in types
|
|
5
5
|
+renderType( nameOrObject )
|
|
6
6
|
|
|
7
7
|
if index < types.length - 1
|
|
8
8
|
| !{ ' | ' }
|
|
9
9
|
|
|
10
|
-
if ( isOptional && !types.includes( 'undefined' ) )
|
|
11
|
-
| !{ ' | ' }
|
|
12
|
-
+renderType( 'undefined' )
|
|
13
|
-
|
|
14
10
|
//- TODO: Description.
|
|
15
11
|
//-
|
|
16
12
|
//- @param {String|*} inlineObjectOrType
|
|
@@ -8,7 +8,7 @@ mixin typeParameter( type )
|
|
|
8
8
|
//- We mark most TypeScript types as `object`, as their structure is complex.
|
|
9
9
|
//- Hence, it does not really make sense to show that a type extends an unknown `object`.
|
|
10
10
|
if ( type.value && type.value[ 0 ] !== 'object' )
|
|
11
|
-
| !{'
|
|
11
|
+
| !{': '}
|
|
12
12
|
if ( type.isExtending )
|
|
13
13
|
i !{ 'extends ' }
|
|
14
14
|
+type( type.value )
|
|
@@ -18,7 +18,7 @@ if isNonEmptyArray( data.typeParameters )
|
|
|
18
18
|
//- We mark most TypeScript types as `object`, as their structure is complex.
|
|
19
19
|
//- Hence, it does not really make sense to show that a type extends an unknown `object`.
|
|
20
20
|
if ( type.value && type.value[ 0 ] !== 'object' )
|
|
21
|
-
| !{'
|
|
21
|
+
| !{': '}
|
|
22
22
|
if ( type.isExtending )
|
|
23
23
|
i !{ 'extends ' }
|
|
24
24
|
+type( type.value )
|