umberto 3.0.0 → 3.2.0
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 +1591 -0
- package/README.md +6 -6
- package/package.json +4 -34
- package/src/api-builder/classes/doc-data-factory.js +107 -34
- package/src/data-converter/converters/typedoc/abstractparser.js +11 -0
- package/src/data-converter/converters/typedoc/computedpropertyparser.js +30 -0
- package/src/data-converter/converters/typedoc/moduleparser.js +2 -1
- package/src/data-converter/converters/typedoc/typedocconverter.js +89 -27
- package/src/data-converter/converters/typedoc2umberto.js +2 -0
- package/src/hexo-manager.js +10 -1
- package/themes/umberto/layout/_api-docs/_mixin/_method.pug +2 -1
- package/themes/umberto/layout/_api-docs/_mixin/_params.pug +10 -1
- package/themes/umberto/layout/_api-docs/_mixin/type-parameter.pug +1 -1
- package/themes/umberto/layout/_api-docs/_partial/api-subheader.pug +3 -0
- package/themes/umberto/layout/_api-docs/_partial/type-parameters.pug +1 -1
- package/themes/umberto/layout/_api-docs/api-base.pug +0 -2
- package/themes/umberto/layout/_mixin/nav-tree-level.pug +1 -1
- package/themes/umberto/layout/_partial/nav-tree.pug +1 -1
- package/themes/umberto/src/css/_api-subheader.scss +2 -0
- package/themes/umberto/src/css/_badge.scss +1 -0
- package/themes/umberto/src/css/_tree.scss +9 -0
- package/themes/umberto/src/js/_apitree.js +12 -20
- package/themes/umberto/src/js/_sidenavigation.js +45 -4
- package/themes/umberto/src/js/app.js +3 -3
- package/.editorconfig +0 -12
- package/.eslintrc.js +0 -41
- package/scripts-dev/postinstall.js +0 -18
- package/themes/umberto/layout/_api-docs/_partial/types.pug +0 -5
|
@@ -24,6 +24,15 @@ See: `_api-tree.scss` and `_guide-sdk-tree.scss`. */
|
|
|
24
24
|
|
|
25
25
|
list-style: none;
|
|
26
26
|
|
|
27
|
+
&.guide-tree {
|
|
28
|
+
opacity: 0; //prevents flickering when applying categories fold state
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.state-applied {
|
|
32
|
+
opacity: 1;
|
|
33
|
+
transition: opacity 0.05s
|
|
34
|
+
}
|
|
35
|
+
|
|
27
36
|
li {
|
|
28
37
|
position: relative;
|
|
29
38
|
cursor: pointer;
|
|
@@ -42,31 +42,23 @@ export function scrollApiTree() {
|
|
|
42
42
|
const treeHeight = tree.height();
|
|
43
43
|
const storageKey = 'side-nav-scroll-top';
|
|
44
44
|
const sideNavScrollTop = Number( window.localStorage.getItem( storageKey ) );
|
|
45
|
-
const treeItemClass = 'tree__item__wrapper';
|
|
46
45
|
const activeTreeItemClass = 'tree__item__wrapper--active';
|
|
47
46
|
const activeTreeItem = $( `div.side-navigation .${ activeTreeItemClass }` );
|
|
48
|
-
|
|
49
|
-
const activeTreeItemIndex = treeWrappers.index( activeTreeItem );
|
|
50
|
-
let activeTreeItemTop = 25; // 25 is for top padding of side nav.
|
|
47
|
+
let activeTreeItemTop = 0;
|
|
51
48
|
const bound = 50; // Offset from top and bottom of side nav.
|
|
52
49
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if ( activeTreeItemIndex === -1 || index === activeTreeItemIndex ) {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
activeTreeItemTop += $( this ).height();
|
|
60
|
-
} );
|
|
50
|
+
if ( activeTreeItem.length ) {
|
|
51
|
+
activeTreeItemTop = activeTreeItem[ 0 ].offsetParent ? activeTreeItem[ 0 ].offsetParent.offsetTop : 0;
|
|
61
52
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
53
|
+
if (
|
|
54
|
+
sideNavScrollTop !== null &&
|
|
55
|
+
activeTreeItemTop > sideNavScrollTop + bound &&
|
|
56
|
+
activeTreeItemTop < sideNavScrollTop + treeHeight - bound
|
|
57
|
+
) {
|
|
58
|
+
tree.scrollTop( sideNavScrollTop );
|
|
59
|
+
} else {
|
|
60
|
+
activeTreeItem[ 0 ].scrollIntoView( { block: 'center' } );
|
|
61
|
+
}
|
|
70
62
|
}
|
|
71
63
|
|
|
72
64
|
tree.scroll( throttle( () => {
|
|
@@ -5,14 +5,55 @@
|
|
|
5
5
|
|
|
6
6
|
export default function sideNavigation() {
|
|
7
7
|
const folderButtons = Array.from( document.querySelectorAll( '.tree:not(.api-tree) .tree__item--folder' ) );
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const guideTreeElement = document.getElementById( 'guidetree' );
|
|
9
|
+
const foldedClassName = 'tree__item-nested-list--hidden';
|
|
10
|
+
const activeClassName = '.tree__item__wrapper--active';
|
|
11
|
+
const localStorageKey = 'foldersState';
|
|
12
|
+
|
|
13
|
+
let foldersState = JSON.parse( window.localStorage.getItem( localStorageKey ) );
|
|
14
|
+
if ( foldersState === null ) {
|
|
15
|
+
foldersState = {};
|
|
10
16
|
}
|
|
11
17
|
|
|
12
18
|
folderButtons.forEach( btn => {
|
|
19
|
+
const element = btn.parentNode.nextElementSibling; // Get <ul> element
|
|
20
|
+
const id = element.getAttribute( 'data-id' );
|
|
21
|
+
|
|
22
|
+
applyFolderState( element, foldersState[ id ] );
|
|
23
|
+
checkForActiveChildren( element, id );
|
|
24
|
+
|
|
13
25
|
btn.addEventListener( 'click', function() {
|
|
14
|
-
|
|
15
|
-
|
|
26
|
+
element.classList.toggle( foldedClassName );
|
|
27
|
+
saveFolderState( id, isFolded( element ) );
|
|
16
28
|
} );
|
|
17
29
|
} );
|
|
30
|
+
|
|
31
|
+
if ( guideTreeElement ) {
|
|
32
|
+
guideTreeElement.classList.add( 'state-applied' );
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function applyFolderState( element, folded ) {
|
|
36
|
+
if ( folded === false ) {
|
|
37
|
+
element.classList.remove( foldedClassName );
|
|
38
|
+
}
|
|
39
|
+
if ( folded === true ) {
|
|
40
|
+
element.classList.add( foldedClassName );
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function saveFolderState( id, state ) {
|
|
45
|
+
foldersState[ id ] = state;
|
|
46
|
+
window.localStorage.setItem( localStorageKey, JSON.stringify( foldersState ) );
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function checkForActiveChildren( element, id ) {
|
|
50
|
+
if ( element.querySelectorAll( activeClassName ).length > 0 ) {
|
|
51
|
+
element.classList.remove( foldedClassName );
|
|
52
|
+
saveFolderState( id, isFolded( element ) );
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function isFolded( element ) {
|
|
57
|
+
return element.classList.contains( foldedClassName );
|
|
58
|
+
}
|
|
18
59
|
}
|
|
@@ -44,19 +44,19 @@ window.umberto = {
|
|
|
44
44
|
$( document ).ready( () => {
|
|
45
45
|
pageNavigation(); // pageNavigation - needs to be run before filtering initialization.
|
|
46
46
|
copyMobileApiNavigation(); // copy API Tree into mobile navigation
|
|
47
|
+
sideNavigation();
|
|
48
|
+
expandApiTree();
|
|
49
|
+
scrollApiTree();
|
|
47
50
|
enableFiltering();
|
|
48
51
|
setupPrism();
|
|
49
|
-
expandApiTree();
|
|
50
52
|
enableCollapsables();
|
|
51
53
|
hideTogglers();
|
|
52
54
|
enableAnchors();
|
|
53
55
|
enableDropdowns();
|
|
54
56
|
trackArticlePosition();
|
|
55
|
-
scrollApiTree();
|
|
56
57
|
setUpFuse();
|
|
57
58
|
activateDevNames();
|
|
58
59
|
attachPermalinkListener();
|
|
59
|
-
sideNavigation();
|
|
60
60
|
rwdButton();
|
|
61
61
|
imageModal(); // lightbox for { @img } elements
|
|
62
62
|
// `sampleCode()` must be called after the `setupPrism()` function.
|
package/.editorconfig
DELETED
package/.eslintrc.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2017-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
'use strict';
|
|
7
|
-
|
|
8
|
-
module.exports = {
|
|
9
|
-
extends: 'ckeditor5',
|
|
10
|
-
rules: {
|
|
11
|
-
'ckeditor5-rules/license-header': [ 'error', { headerLines: [
|
|
12
|
-
'/**',
|
|
13
|
-
' * @license Copyright (c) 2017-2023, CKSource Holding sp. z o.o. All rights reserved.',
|
|
14
|
-
' * For licensing, see LICENSE.md.',
|
|
15
|
-
' */'
|
|
16
|
-
] } ]
|
|
17
|
-
},
|
|
18
|
-
env: {
|
|
19
|
-
node: true
|
|
20
|
-
},
|
|
21
|
-
ignorePatterns: [
|
|
22
|
-
'source/**/*.js',
|
|
23
|
-
'temp/**/*.js',
|
|
24
|
-
'themes/umberto/source/**/*.js',
|
|
25
|
-
'tests/src/data-converter/converters/typedoc/fixtures'
|
|
26
|
-
],
|
|
27
|
-
overrides: [
|
|
28
|
-
{
|
|
29
|
-
files: [ 'scripts/**/*.js' ],
|
|
30
|
-
globals: {
|
|
31
|
-
hexo: true
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
files: [ 'themes/**/*.js' ],
|
|
36
|
-
env: {
|
|
37
|
-
browser: true
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2017-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
'use strict';
|
|
7
|
-
|
|
8
|
-
/* eslint-env node */
|
|
9
|
-
|
|
10
|
-
const path = require( 'path' );
|
|
11
|
-
const fs = require( 'fs' );
|
|
12
|
-
const ROOT_DIRECTORY = path.join( __dirname, '..' );
|
|
13
|
-
|
|
14
|
-
// When installing a repository as a dependency, the `.git` directory does not exist.
|
|
15
|
-
// In such a case, husky should not attach its hooks as npm treats it as a package, not a git repository.
|
|
16
|
-
if ( fs.existsSync( path.join( ROOT_DIRECTORY, '.git' ) ) ) {
|
|
17
|
-
require( 'husky' ).install();
|
|
18
|
-
}
|