umberto 10.1.4 → 10.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 CHANGED
@@ -1,6 +1,23 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## [10.2.0](https://github.com/cksource/umberto/compare/v10.1.4...v10.2.0) (April 2, 2026)
5
+
6
+ ### Features
7
+
8
+ * Added support for configuring Kapa AI source groups via the `sourceGroupIds` option. The option can be set globally in `kapa.default` or per project to filter the widget's knowledge base to specific source groups.
9
+
10
+ ### Bug fixes
11
+
12
+ * Fixed a console error thrown when hovering over a CKEditor bookmark element. The `links-prefetch` module now silently ignores anchor elements with no `href` instead of calling `new URL( '' )` and logging a spurious error.
13
+
14
+ ### Other changes
15
+
16
+ * Removed the legacy warning banner.
17
+ * Added cyan LTS banner at the top of the page on LTS branch.
18
+ * Updated the colour of nightly banner to yellow.
19
+
20
+
4
21
  ## [10.1.4](https://github.com/cksource/umberto/compare/v10.1.3...v10.1.4) (March 20, 2026)
5
22
 
6
23
  ### Other changes
@@ -28,18 +45,6 @@ Changelog
28
45
 
29
46
  * Fixed a deprecation warning displayed during documentation builds by migrating Sass compilation to the modern Dart Sass JavaScript API. The `legacy-js-api` warning is no longer emitted.
30
47
 
31
-
32
- ## [10.1.0](https://github.com/cksource/umberto/compare/v10.0.0...v10.1.0) (March 4, 2026)
33
-
34
- ### Features
35
-
36
- * Add support for experimental features in the callout component and in the badges normalization script.
37
-
38
- ### Bug fixes
39
-
40
- * Fixed the deprecation warning regarding the `Sass if() syntax` thrown during building docs.
41
- * Disabled inserting a space between the anchor link and heading when converting a document from Markdown to HTML.
42
-
43
48
  ---
44
49
 
45
50
  To see all releases, visit the [release page](https://github.com/cksource/umberto/releases).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umberto",
3
- "version": "10.1.4",
3
+ "version": "10.2.0",
4
4
  "description": "CKSource Documentation builder",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -193,8 +193,8 @@ export const projectLocals = ( ctx, {
193
193
  // `sitemap` entry is not consistent across building methods of Umberto.
194
194
  // It's often defined in the API, but it's not always available in the hexo locals.
195
195
  // In order to make it available, it's safer to use `docSearch.indexName` which is always defined.
196
- locals.isLegacy = locals.path.includes( '/legacy/' );
197
196
  locals.isNightly = docSearch.indexName?.includes( 'nightly' ) || false;
197
+ locals.isLts = /\/ckeditor5\/(lts-v\d+)(?:\/|$)/.test( `/${ locals.path }` );
198
198
 
199
199
  locals.mainOg = og || {};
200
200
  } );
@@ -510,8 +510,8 @@ async function buildApis( projectConfigs, options = {} ) {
510
510
  feedbackWidget: options.feedbackWidget,
511
511
  pathJoin: upath.join,
512
512
  mainOg: options.og || {},
513
- isLegacy: false,
514
- isNightly: options.docSearch?.indexName?.includes( 'nightly' ) || false
513
+ isNightly: options.docSearch?.indexName?.includes( 'nightly' ) || false,
514
+ isLts: /\/ckeditor5\/(lts-v\d+)(?:\/|$)/.test( `/${ BASE_PATH }` )
515
515
  },
516
516
  projectConfig: config,
517
517
  canonicalUrlBeginning: getCanonicalBeginning( { config, options, hexoManager } )
@@ -20,7 +20,7 @@ html(lang='en')
20
20
 
21
21
  body.l-layout.l-layout--muted.js-layout
22
22
  +header-nightly-info
23
- +header-legacy-warning
23
+ +header-lts-info
24
24
  +header-promobar
25
25
  +header({ className: 'l-layout__header', withChooseProject: false })
26
26
 
@@ -27,6 +27,29 @@
27
27
  color: var(--color-common-white);
28
28
  }
29
29
 
30
+ &--lts {
31
+ --a11y-focus-ring-color: color-mix(in srgb, var(--color-cyan-500) 40%, transparent);
32
+ --a11y-focus-border-color: var(--color-common-white);
33
+
34
+ background-color: var(--color-cyan-500);
35
+ color: var(--color-common-white);
36
+ }
37
+
38
+ &--warning,
39
+ &--lts {
40
+ font-size: var(--font-size-sm);
41
+
42
+ .c-icon-message {
43
+ line-height: 1;
44
+ }
45
+
46
+ .c-icon-message__content {
47
+ flex: none;
48
+ display: inline-flex;
49
+ align-items: center;
50
+ }
51
+ }
52
+
30
53
  &--info-gradient {
31
54
  background: linear-gradient(240deg, var(--color-info-800), var(--color-info-500));
32
55
  color: var(--color-common-white);
@@ -37,6 +60,42 @@
37
60
  }
38
61
  }
39
62
 
63
+ .b-prose a,
64
+ .b-link {
65
+ color: inherit;
66
+ text-decoration-color: currentColor;
67
+
68
+ &:hover,
69
+ &:focus,
70
+ &:active {
71
+ color: inherit;
72
+ text-decoration-color: currentColor;
73
+ }
74
+ }
75
+
76
+ &__label {
77
+ flex-shrink: 0;
78
+ padding: 0.15rem 0.55rem;
79
+ border: 1px solid currentColor;
80
+ border-radius: 999px;
81
+ background-color: color-mix(in srgb, currentColor 12%, transparent);
82
+ font-size: var(--font-size-xs);
83
+ font-weight: var(--font-weight-bold);
84
+ letter-spacing: 0.08em;
85
+ text-transform: uppercase;
86
+ }
87
+
88
+ &__label-text {
89
+ font-weight: inherit;
90
+ }
91
+
92
+ &__message {
93
+ display: flex;
94
+ flex-wrap: wrap;
95
+ align-items: center;
96
+ font-weight: var(--font-weight-medium);
97
+ }
98
+
40
99
  @include mobile {
41
100
  gap: var(--spacing-2);
42
101
  justify-content: flex-start;
@@ -0,0 +1,69 @@
1
+ mixin header-lts-info()
2
+ +preload-svg-spritesheet-icon({ icon: 'exclamation-circle' })
3
+ if isLts
4
+ -
5
+ const latestUrl = `${ page.canonicalUrlBeginning }${ page.path }`
6
+ .replace('ckeditor5.github.io/', 'ckeditor.com/')
7
+ .replace(/\/ckeditor5\/lts-v\d+(?=\/|$)/, '/ckeditor5/latest')
8
+ .replace(projectLocals.projectVersion, 'latest')
9
+ .replace(/\/+$/, '');
10
+
11
+ +header-bar({ variant: 'lts', ariaLabel: 'LTS documentation' })
12
+ span.c-icon-message.u-font-weight--bold
13
+ span.c-icon-message__icon
14
+ +svg-icon({ icon: 'exclamation-circle', size: 'lg', ariaHidden: true })
15
+ span.c-icon-message__content LTS
16
+
17
+ span.c-header-bar__message
18
+ span You're in the Long Term Support Edition documentation.
19
+ |  
20
+ a.b-link.u-text-decoration--underline(href=latestUrl) Go to the latest version of the standard edition.
21
+
22
+ script.
23
+ (function() {
24
+ document.addEventListener( 'DOMContentLoaded', () => {
25
+ if ( !/\/ckeditor5\/lts-v\d+(?:\/|$)/.test( window.location.pathname ) ) {
26
+ return;
27
+ }
28
+
29
+ if ( document.querySelector( '.c-header-bar--lts' ) ) {
30
+ return;
31
+ }
32
+
33
+ document.querySelector( '.c-header-bar[aria-label="Legacy documentation warning"]' )?.remove();
34
+
35
+ const insertionPoint = document.querySelector( '.js-header-bar, .js-header' );
36
+
37
+ if ( !insertionPoint?.parentNode ) {
38
+ return;
39
+ }
40
+
41
+ const latestUrl = new URL( window.location.href );
42
+
43
+ latestUrl.pathname = latestUrl.pathname.replace( /\/ckeditor5\/lts-v\d+(?=\/|$)/, '/ckeditor5/latest' );
44
+ latestUrl.hash = '';
45
+
46
+ const banner = document.createElement( 'div' );
47
+
48
+ banner.innerHTML = `
49
+ <div class="c-header-bar c-header-bar--lts js-header-bar" role="region" aria-label="LTS documentation">
50
+ <span class="c-icon-message u-font-weight--bold">
51
+ <span class="c-icon-message__icon">
52
+ <svg-icon icon="exclamation-circle" size="lg" aria-hidden="true"></svg-icon>
53
+ </span>
54
+ <span class="c-icon-message__content">LTS</span>
55
+ </span>
56
+ <span class="c-header-bar__message">
57
+ <span>You're in the Long Term Support Edition documentation.&nbsp;</span>
58
+ <a class="b-link u-text-decoration--underline" href="${ latestUrl.toString() }">Go to the latest version of the standard edition.</a>
59
+ </span>
60
+ </div>
61
+ `.trim();
62
+
63
+ insertionPoint.parentNode.insertBefore( banner.firstElementChild, insertionPoint );
64
+
65
+ if ( window.umberto?.Header?.the ) {
66
+ window.umberto.Header.the.dispatchHeaderResizeEvent();
67
+ }
68
+ }, { once: true } );
69
+ })();
@@ -1,4 +1,5 @@
1
1
  mixin header-nightly-info()
2
+ +preload-svg-spritesheet-icon({ icon: 'exclamation-circle' })
2
3
  if isNightly
3
4
  -
4
5
  const stableUrl = `${ page.canonicalUrlBeginning }${ page.path }`
@@ -7,15 +8,13 @@ mixin header-nightly-info()
7
8
  .replace(projectLocals.projectVersion, 'latest')
8
9
  .replace(/\/+$/, '');
9
10
 
10
- +header-bar({ variant: 'info', ariaLabel: 'Nightly build documentation' })
11
- +icon-message({
12
- icon: 'info-circle',
13
- iconSize: 'lg',
14
- className: 'font-weight--bold'
15
- })
16
- | NIGHTLY
11
+ +header-bar({ variant: 'warning', ariaLabel: 'Nightly build documentation' })
12
+ span.c-icon-message.u-font-weight--bold
13
+ span.c-icon-message__icon
14
+ +svg-icon({ icon: 'exclamation-circle', size: 'lg', ariaHidden: true })
15
+ span.c-icon-message__content NIGHTLY
17
16
 
18
- span
17
+ span.c-header-bar__message
19
18
  span You're viewing the nightly build documentation.
20
19
  | &nbsp;
21
- a.b-link.u-color--white.u-text-decoration--underline(href=stableUrl) Go to the stable version.
20
+ a.b-link.u-text-decoration--underline(href=stableUrl) Go to the stable version.
@@ -6,8 +6,8 @@ include ./sidebar/index
6
6
  include ./sidebar-api/index
7
7
  include ./mobile-nav/index
8
8
  include ./header-bar/index
9
- include ./header-legacy-warning/index
10
9
  include ./header-nightly-info/index
10
+ include ./header-lts-info/index
11
11
  include ./header-promobar/index
12
12
  include ./breadcrumbs/index
13
13
  include ./algolia-search/index
@@ -121,9 +121,28 @@ mixin load-kapa-script( kapa )
121
121
  return projectConfig.exampleQuestions.join( ',' );
122
122
  }
123
123
 
124
+ function getSourceGroupIds() {
125
+ const defaultSourceGroupIds = ( kapa.default.sourceGroupIds || [] ).join( ',' );
126
+
127
+ if ( !projectConfig ) {
128
+ return defaultSourceGroupIds;
129
+ }
130
+
131
+ if ( !projectConfig.sourceGroupIds ) {
132
+ return defaultSourceGroupIds;
133
+ }
134
+
135
+ if ( !projectConfig.sourceGroupIds.length ) {
136
+ return defaultSourceGroupIds;
137
+ }
138
+
139
+ return projectConfig.sourceGroupIds.join( ',' );
140
+ }
141
+
124
142
  attributes[ 'data-modal-title' ] = getModalTitle( projectConfig );
125
143
  attributes[ 'data-modal-ask-ai-input-placeholder' ] = getQuestionPlaceholder();
126
144
  attributes[ 'data-modal-example-questions' ] = getExampleQuestions();
145
+ attributes[ 'data-source-group-ids-include' ] = getSourceGroupIds();
127
146
 
128
147
  script&attributes(attributes)
129
148
 
@@ -8,7 +8,7 @@ html(lang='en')
8
8
  include _head/index
9
9
  body.l-layout.js-layout
10
10
  +header-nightly-info
11
- +header-legacy-warning
11
+ +header-lts-info
12
12
  +header-promobar
13
13
  +header({ className: 'l-layout__header' })
14
14
 
@@ -7,7 +7,7 @@ html(lang='en')
7
7
  include _head/index
8
8
  body.l-layout.js-layout
9
9
  +header-nightly-info
10
- +header-legacy-warning
10
+ +header-lts-info
11
11
  +header-promobar
12
12
  +header({ className: 'l-layout__header' })
13
13
 
@@ -8,6 +8,7 @@ html(lang='en')
8
8
 
9
9
  body.l-layout.l-layout--muted.js-layout
10
10
  +header-nightly-info
11
+ +header-lts-info
11
12
  +header-promobar
12
13
  +header({
13
14
  className: 'l-layout__header',
@@ -124,6 +124,10 @@ export class LinksPrefetch {
124
124
  * @returns Whether the URL should be preloaded
125
125
  */
126
126
  function isPreloadable( url ) {
127
+ if ( !url ) {
128
+ return false;
129
+ }
130
+
127
131
  try {
128
132
  const urlObj = new URL( url );
129
133
  const currentDomain = window.location.hostname;
@@ -1,11 +0,0 @@
1
- mixin header-legacy-warning()
2
- if isLegacy && (!sitemap || !isNightly)
3
- +header-bar({ variant: 'warning', ariaLabel: 'Legacy documentation warning' })
4
- +icon-message({
5
- icon: 'exclamation-circle',
6
- iconSize: 'lg',
7
- className: 'u-font-weight--bold'
8
- })
9
- | WARNING
10
-
11
- span You're reading the legacy documentation.