umberto 8.0.0 → 8.0.2
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 +26 -18
- package/package.json +1 -1
- package/scripts/filter/after-post-render/gloria/append-copy-heading-buttons.js +17 -26
- package/scripts/filter/after-post-render/parseicontag.js +1 -1
- package/scripts/filter/after-render/gloria/inline-svg.js +1 -1
- package/scripts/filter/after-render/gloria/spritesheet-svg.js +1 -1
- package/scripts/filter/before-post-render/gloria/add-breadcrumbs-data-to-page.js +9 -2
- package/scripts/filter/before-post-render/gloria/prerender-xml-pug-components.js +13 -0
- package/scripts/filter/before-post-render/gloria/render-post-render-pug-components.js +14 -6
- package/scripts/helper/u-extract-and-cache-title.js +36 -0
- package/scripts/utils/pug-renderer/create-prerender-pug-template.js +18 -5
- package/scripts/utils/random-id.js +8 -0
- package/src/api-builder/classes/description-parser.js +18 -17
- package/src/hexo/filter/project-locals.js +3 -0
- package/src/tasks/build-api-docs.js +1 -1
- package/src/tasks/build-documentation.js +13 -3
- package/src/tasks/validate-links.js +211 -39
- package/themes/umberto/layout/gloria/_api-docs/_mixin/_api-tree-item.pug +10 -2
- package/themes/umberto/layout/gloria/_api-docs/_toc/_style.scss +3 -1
- package/themes/umberto/layout/gloria/_components/code-block/_style.scss +2 -2
- package/themes/umberto/layout/gloria/_components/code-block/index.pug +10 -2
- package/themes/umberto/layout/gloria/_components/code-switcher/_style.scss +0 -5
- package/themes/umberto/layout/gloria/_components/code-switcher/index.pug +3 -3
- package/themes/umberto/layout/gloria/_components/icon-message/index.pug +5 -5
- package/themes/umberto/layout/gloria/_components/index.pug +1 -0
- package/themes/umberto/layout/gloria/_components/nav-tree/index.pug +1 -1
- package/themes/umberto/layout/gloria/_components/nav-tree/nav-tree-item.pug +11 -7
- package/themes/umberto/layout/gloria/_components/nav-tree/nav-tree-level.pug +3 -3
- package/themes/umberto/layout/gloria/_components/snippet-footer/_style.scss +26 -0
- package/themes/umberto/layout/gloria/_components/snippet-footer/index.pug +10 -0
- package/themes/umberto/layout/gloria/_components/svg/index.pug +1 -1
- package/themes/umberto/layout/gloria/_modules/algolia-search/index.pug +1 -0
- package/themes/umberto/layout/gloria/_modules/header/nav-project-select-dropdown.pug +8 -8
- package/themes/umberto/layout/gloria/_modules/header-nightly-info/index.pug +1 -0
- package/themes/umberto/layout/gloria/_modules/mobile-nav/index.pug +17 -17
- package/themes/umberto/layout/gloria/_modules/toc/_style.scss +1 -1
- package/themes/umberto/layout/gloria/api.pug +0 -1
- package/themes/umberto/source/gloria/assets/_fonts/Lato/Lato-Bold.ttf +0 -0
- package/themes/umberto/source/gloria/assets/_fonts/Lato/Lato-Bold.woff2 +0 -0
- package/themes/umberto/source/gloria/assets/_fonts/Lato/Lato-BoldItalic.ttf +0 -0
- package/themes/umberto/source/gloria/assets/_fonts/Lato/Lato-BoldItalic.woff2 +0 -0
- package/themes/umberto/source/gloria/assets/_fonts/Lato/Lato-Italic.ttf +0 -0
- package/themes/umberto/source/gloria/assets/_fonts/Lato/Lato-Italic.woff2 +0 -0
- package/themes/umberto/source/gloria/assets/_fonts/Lato/Lato-Regular.ttf +0 -0
- package/themes/umberto/source/gloria/assets/_fonts/Lato/Lato-Regular.woff2 +0 -0
- package/themes/umberto/source/gloria/assets/_img/icons/sparkles.svg +1 -0
- package/themes/umberto/src/gloria/css/_fonts.scss +39 -0
- package/themes/umberto/src/gloria/css/base/_inline-code.scss +4 -3
- package/themes/umberto/src/gloria/css/base/_links.scss +2 -1
- package/themes/umberto/src/gloria/css/base/_tables.scss +0 -4
- package/themes/umberto/src/gloria/css/components/_api-collapsing-list.scss +4 -0
- package/themes/umberto/src/gloria/css/components/_index.scss +2 -1
- package/themes/umberto/src/gloria/css/doc/_snippets.scss +1 -0
- package/themes/umberto/src/gloria/css/layout/_base.scss +2 -12
- package/themes/umberto/src/gloria/css/utilities/_spacing.scss +1 -0
- package/themes/umberto/src/gloria/js/components/code-block.js +7 -4
- package/themes/umberto/src/gloria/js/modules/api-filter.js +9 -4
|
@@ -20,22 +20,22 @@ mixin mobile-nav()
|
|
|
20
20
|
|
|
21
21
|
.c-mobile-nav(data-initial-slide-id=initialSlideId)
|
|
22
22
|
+mobile-nav-slide({ slideId: 'products' })
|
|
23
|
-
if
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
if quickNavigationProjects
|
|
24
|
+
ol.b-reset-list.c-mobile-nav__items
|
|
25
|
+
each project in quickNavigationProjects
|
|
26
|
+
- isCurrentProject = projectLocals && project.slug === projectLocals.projectSlug
|
|
27
|
+
|
|
28
|
+
if isCurrentProject
|
|
29
|
+
+mobile-nav-item({
|
|
30
|
+
label: project.name,
|
|
31
|
+
active: true,
|
|
32
|
+
targetSlideId: `project-${ project.slug }`
|
|
33
|
+
})
|
|
34
|
+
else
|
|
35
|
+
+mobile-nav-item({
|
|
36
|
+
href: relative_url(page.path, `${project.slug}/latest/index.html`),
|
|
37
|
+
label: project.name
|
|
38
|
+
})
|
|
39
39
|
|
|
40
40
|
//- Current project slide
|
|
41
41
|
if projectLocals
|
|
@@ -100,7 +100,7 @@ mixin mobile-nav()
|
|
|
100
100
|
})
|
|
101
101
|
|
|
102
102
|
ul.b-reset-list.c-nav-tree.c-nav-tree--mobile.js-nav-tree
|
|
103
|
-
+navTreeLevel( group
|
|
103
|
+
+navTreeLevel({ data: group } )
|
|
104
104
|
|
|
105
105
|
+mobile-nav-slide({ slideId: 'api-categories' })
|
|
106
106
|
+mobile-nav-back-button( {
|
|
@@ -26,7 +26,6 @@ html(lang='en')
|
|
|
26
26
|
- const split = uSplitToTitleAndContent( page.content );
|
|
27
27
|
|
|
28
28
|
h1.b-h1.c-main__content-title.c-main__content-title--align-center.js-api-h1( data-ln = page.shortName === 'index' ? page[ 'default-expanded' ] || page.shortName : page.shortName )
|
|
29
|
-
+svg-icon({ icon: 'api-class', size: '2xl' })
|
|
30
29
|
!= split.title || page.title
|
|
31
30
|
|
|
32
31
|
!= split.content
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="34" height="34"><path d="M8.191 5.316a.34.34 0 0 1 .121-.156c.055-.039.121-.059.188-.059s.133.02.188.059a.33.33 0 0 1 .117.156l1.188 3.199a.3.3 0 0 0 .074.121c.035.031.074.059.117.074l3.203 1.184a.26.26 0 0 1 .121.082c.031.039.063.078.078.125s.02.102.012.148a.32.32 0 0 1-.059.141.3.3 0 0 1-.152.117l-3.203 1.184a.36.36 0 0 0-.121.078c-.031.031-.059.074-.074.117l-1.18 3.199a.34.34 0 0 1-.121.156c-.055.039-.121.059-.187.059s-.133-.02-.187-.059-.094-.094-.117-.156L7.01 11.882c-.016-.043-.039-.086-.074-.117a.46.46 0 0 0-.117-.078l-3.203-1.184c-.062-.02-.117-.062-.152-.117a.36.36 0 0 1-.062-.187.32.32 0 0 1 .063-.187c.04-.054.09-.098.152-.121L6.82 8.707a.3.3 0 0 0 .117-.074c.035-.035.063-.074.078-.117l1.184-3.203zm1.7 15.297c.023-.062.066-.117.121-.152a.36.36 0 0 1 .188-.062c.067 0 .133.023.188.063a.3.3 0 0 1 .117.152l1.188 3.203a.35.35 0 0 0 .074.121.35.35 0 0 0 .121.074l3.199 1.184a.29.29 0 0 1 .125.082c.031.035.059.078.074.125s.02.098.012.148-.027.098-.055.137a.34.34 0 0 1-.156.121l-3.203 1.184c-.043.016-.086.043-.117.078s-.062.074-.078.117l-1.18 3.199c-.023.063-.066.117-.121.152s-.117.063-.187.063-.129-.023-.184-.062-.098-.09-.121-.152l-1.184-3.203a.31.31 0 0 0-.078-.117.27.27 0 0 0-.117-.078l-3.199-1.184a.33.33 0 0 1-.156-.117c-.039-.055-.059-.121-.059-.187s.02-.133.059-.187a.34.34 0 0 1 .156-.121l3.199-1.184a.35.35 0 0 0 .121-.074c.031-.035.059-.074.074-.117l1.184-3.203zM21.484 7.23c.047-.125.129-.234.238-.312s.242-.117.375-.117.266.039.375.117.191.188.238.313l2.371 6.402a.64.64 0 0 0 .152.238.71.71 0 0 0 .234.152l6.402 2.367a.61.61 0 0 1 .246.16.68.68 0 0 1 .152.254.64.64 0 0 1 .023.297.65.65 0 0 1-.113.277c-.074.109-.184.191-.309.238l-6.406 2.367a.67.67 0 0 0-.234.152c-.066.066-.121.148-.152.238l-2.363 6.395a.68.68 0 0 1-.238.313.63.63 0 0 1-.375.117c-.137 0-.266-.039-.375-.117s-.191-.187-.238-.312l-2.371-6.402a.63.63 0 0 0-.148-.238.68.68 0 0 0-.234-.152l-6.402-2.367c-.129-.043-.238-.129-.312-.238a.64.64 0 0 1 0-.746.62.62 0 0 1 .313-.242l6.402-2.367a.67.67 0 0 0 .234-.152.58.58 0 0 0 .152-.234l2.367-6.402zm0 0" fill="currentColor" /></svg>
|
|
@@ -49,3 +49,42 @@
|
|
|
49
49
|
font-style: normal;
|
|
50
50
|
font-display: swap;
|
|
51
51
|
}
|
|
52
|
+
|
|
53
|
+
/* LATO */
|
|
54
|
+
@font-face {
|
|
55
|
+
font-family: 'Lato';
|
|
56
|
+
src:
|
|
57
|
+
url('../fonts/Lato/Lato-Regular.woff2') format('woff2'),
|
|
58
|
+
url('../fonts/Lato/Lato-Regular.ttf') format('truetype');
|
|
59
|
+
font-style: normal;
|
|
60
|
+
font-display: swap;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@font-face {
|
|
64
|
+
font-family: 'Lato';
|
|
65
|
+
src:
|
|
66
|
+
url('../fonts/Lato/Lato-Italic.woff2') format('woff2'),
|
|
67
|
+
url('../fonts/Lato/Lato-Italic.ttf') format('truetype');
|
|
68
|
+
font-style: italic;
|
|
69
|
+
font-display: swap;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@font-face {
|
|
73
|
+
font-family: 'Lato';
|
|
74
|
+
src:
|
|
75
|
+
url('../fonts/Lato/Lato-Bold.woff2') format('woff2'),
|
|
76
|
+
url('../fonts/Lato/Lato-Bold.ttf') format('truetype');
|
|
77
|
+
font-style: normal;
|
|
78
|
+
font-weight: bold;
|
|
79
|
+
font-display: swap;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@font-face {
|
|
83
|
+
font-family: 'Lato';
|
|
84
|
+
src:
|
|
85
|
+
url('../fonts/Lato/Lato-BoldItalic.woff2') format('woff2'),
|
|
86
|
+
url('../fonts/Lato/Lato-BoldItalic.ttf') format('truetype');
|
|
87
|
+
font-style: italic;
|
|
88
|
+
font-weight: bold;
|
|
89
|
+
font-display: swap;
|
|
90
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
@layer base {
|
|
2
2
|
.b-inline-code {
|
|
3
|
-
|
|
4
|
-
padding:
|
|
3
|
+
display: inline;
|
|
4
|
+
padding: var(--spacing-1) var(--spacing-1-5);
|
|
5
5
|
word-wrap: break-word;
|
|
6
|
-
font-size:
|
|
6
|
+
font-size: var(--font-size-sm);
|
|
7
|
+
line-height: var(--line-height-xs);
|
|
7
8
|
font-family: var(--font-family-monospace);
|
|
8
9
|
border-radius: var(--radius-1);
|
|
9
10
|
background: var(--color-gray-300);
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
.b-prose a,
|
|
5
5
|
.b-link {
|
|
6
6
|
color: var(--color-primary-500);
|
|
7
|
-
text-decoration: var(--text-decoration-underline)
|
|
7
|
+
text-decoration: var(--text-decoration-underline);
|
|
8
|
+
text-decoration-color: var(--color-primary-300);
|
|
8
9
|
word-break: break-word;
|
|
9
10
|
|
|
10
11
|
@include a11y-keyboard-focus-ring( true, false,
|
|
@@ -3,13 +3,8 @@
|
|
|
3
3
|
@layer layout {
|
|
4
4
|
html {
|
|
5
5
|
height: 100%;
|
|
6
|
-
overscroll-behavior: none;
|
|
6
|
+
overscroll-behavior-y: none; /* Prevent vertical bounce, allow horizontal trackpad gestures. */
|
|
7
7
|
overflow-x: hidden;
|
|
8
|
-
|
|
9
|
-
&::selection {
|
|
10
|
-
background-color: var(--color-primary-100);
|
|
11
|
-
color: var(--color-primary-500);
|
|
12
|
-
}
|
|
13
8
|
}
|
|
14
9
|
|
|
15
10
|
body {
|
|
@@ -17,11 +12,6 @@
|
|
|
17
12
|
line-height: var(--line-height-base);
|
|
18
13
|
font-family: var(--font-family-text);
|
|
19
14
|
text-wrap: pretty;
|
|
20
|
-
overscroll-behavior: none;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.ck-content::selection {
|
|
24
|
-
background-color: var(--ck-color-base-focus, #6cb5f9);
|
|
25
|
-
color: var(--ck-color-base-text, #333333);
|
|
15
|
+
overscroll-behavior-y: none; /* Prevent vertical bounce, allow horizontal trackpad gestures. */
|
|
26
16
|
}
|
|
27
17
|
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
--spacing-1-5: calc(var(--spacing-base) * 1.5); /* 0.375rem | 6px */
|
|
9
9
|
--spacing-2: calc(var(--spacing-base) * 2); /* 0.5rem | 8px */
|
|
10
10
|
--spacing-3: calc(var(--spacing-base) * 3); /* 0.75rem | 12px */
|
|
11
|
+
--spacing-3-5: calc(var(--spacing-base) * 3.5); /* 0.875rem | 14px */
|
|
11
12
|
--spacing-4: calc(var(--spacing-base) * 4); /* 1rem | 16px */
|
|
12
13
|
--spacing-5: calc(var(--spacing-base) * 5); /* 1.25rem | 20px */
|
|
13
14
|
--spacing-6: calc(var(--spacing-base) * 6); /* 1.5rem | 24px */
|
|
@@ -39,22 +39,25 @@ export class CodeBlock extends BaseComponent {
|
|
|
39
39
|
|
|
40
40
|
this.elements = {
|
|
41
41
|
root: element,
|
|
42
|
-
copyButton: element.querySelector( '.c-code-block__copy-button' )
|
|
42
|
+
copyButton: element.querySelector( '.c-code-block__copy-button' ),
|
|
43
|
+
originalCodeElement: element.querySelector( 'code' )
|
|
43
44
|
};
|
|
44
45
|
|
|
46
|
+
const { copyButton, originalCodeElement } = this.elements;
|
|
47
|
+
|
|
45
48
|
this.config = {
|
|
46
|
-
lang: findCodeLang(
|
|
49
|
+
lang: findCodeLang( originalCodeElement ) || 'plain',
|
|
47
50
|
highlightOnMount: element.getAttribute( 'data-highlight-on-mount' ) === 'true',
|
|
48
51
|
copyable: element.dataset.copyable !== 'false'
|
|
49
52
|
};
|
|
50
53
|
|
|
51
|
-
this.originalText =
|
|
54
|
+
this.originalText = originalCodeElement.innerText || originalCodeElement.textContent || '';
|
|
52
55
|
|
|
53
56
|
// Track the current highlighting operation
|
|
54
57
|
this.highlightPromise = Promise.resolve();
|
|
55
58
|
|
|
56
59
|
// Keep tooltip id
|
|
57
|
-
const tooltipId =
|
|
60
|
+
const tooltipId = copyButton?.getAttribute( 'aria-labelledby' );
|
|
58
61
|
|
|
59
62
|
if ( tooltipId ) {
|
|
60
63
|
const tooltip = document.getElementById( tooltipId );
|
|
@@ -91,14 +91,19 @@ export class ApiFilter extends BaseComponent {
|
|
|
91
91
|
*/
|
|
92
92
|
filterItems() {
|
|
93
93
|
const { filterItems, filterTocItems, activeFilters } = this.state;
|
|
94
|
+
const { filterInputs } = this.elements;
|
|
95
|
+
|
|
96
|
+
// Get all possible tags from checkboxes (all available filters)
|
|
97
|
+
const allFilterTags = Array.from( filterInputs ).map( input => input.value );
|
|
94
98
|
|
|
95
99
|
[ ...filterItems, ...filterTocItems ].forEach( item => {
|
|
96
|
-
|
|
100
|
+
// Check if the element has any tag that is on the filter list but is not active
|
|
101
|
+
const hasInactiveTag = item.tags.some( tag => allFilterTags.includes( tag ) && !activeFilters.includes( tag ) );
|
|
97
102
|
|
|
98
|
-
if (
|
|
99
|
-
item.element.classList.remove( 'is-hidden' );
|
|
100
|
-
} else {
|
|
103
|
+
if ( hasInactiveTag ) {
|
|
101
104
|
item.element.classList.add( 'is-hidden' );
|
|
105
|
+
} else {
|
|
106
|
+
item.element.classList.remove( 'is-hidden' );
|
|
102
107
|
}
|
|
103
108
|
} );
|
|
104
109
|
}
|