umberto 10.1.3 → 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,45 +1,49 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
- ## [10.1.3](https://github.com/cksource/umberto/compare/v10.1.2...v10.1.3) (March 10, 2026)
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.
5
9
 
6
10
  ### Bug fixes
7
11
 
8
- * Fix regression introduced in `v10.1.2` affecting slugs generated for headings. Slugs generated now should be the same as in `v10.1.1` and previous versions of Umberto.
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.
9
13
 
14
+ ### Other changes
10
15
 
11
- ## [10.1.2](https://github.com/cksource/umberto/compare/v10.1.1...v10.1.2) (March 9, 2026)
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.
12
19
 
13
- ### Bug fixes
14
20
 
15
- * Removed unmaintained `hexo-renderer-markdown-it-plus` and `@ckeditor/jsdoc-plugins` dependencies by replacing them with maintained and local implementations, resolving the reported `markdown-it`-related vulnerabilities in Umberto's dependency tree.
21
+ ## [10.1.4](https://github.com/cksource/umberto/compare/v10.1.3...v10.1.4) (March 20, 2026)
16
22
 
23
+ ### Other changes
17
24
 
18
- ## [10.1.1](https://github.com/cksource/umberto/compare/v10.1.0...v10.1.1) (March 4, 2026)
25
+ * Filter search results from Algolia to match the current docs version: `latest` or `lts-v47`. Filtering remains backward-compatible: hits without the docs version are still allowed.
19
26
 
20
- ### Bug fixes
21
27
 
22
- * 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.
28
+ ## [10.1.3](https://github.com/cksource/umberto/compare/v10.1.2...v10.1.3) (March 10, 2026)
23
29
 
30
+ ### Bug fixes
24
31
 
25
- ## [10.1.0](https://github.com/cksource/umberto/compare/v10.0.0...v10.1.0) (March 4, 2026)
32
+ * Fix regression introduced in `v10.1.2` affecting slugs generated for headings. Slugs generated now should be the same as in `v10.1.1` and previous versions of Umberto.
26
33
 
27
- ### Features
28
34
 
29
- * Add support for experimental features in the callout component and in the badges normalization script.
35
+ ## [10.1.2](https://github.com/cksource/umberto/compare/v10.1.1...v10.1.2) (March 9, 2026)
30
36
 
31
37
  ### Bug fixes
32
38
 
33
- * Fixed the deprecation warning regarding the `Sass if() syntax` thrown during building docs.
34
- * Disabled inserting a space between the anchor link and heading when converting a document from Markdown to HTML.
39
+ * Removed unmaintained `hexo-renderer-markdown-it-plus` and `@ckeditor/jsdoc-plugins` dependencies by replacing them with maintained and local implementations, resolving the reported `markdown-it`-related vulnerabilities in Umberto's dependency tree.
35
40
 
36
41
 
37
- ## [10.0.0](https://github.com/cksource/umberto/compare/v9.4.0...v10.0.0) (February 16, 2026)
42
+ ## [10.1.1](https://github.com/cksource/umberto/compare/v10.1.0...v10.1.1) (March 4, 2026)
38
43
 
39
- ### BREAKING CHANGES
44
+ ### Bug fixes
40
45
 
41
- * Migrate the package to [ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules).
42
- * Remove the `validateW3C` option.
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.
43
47
 
44
48
  ---
45
49
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umberto",
3
- "version": "10.1.3",
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',
@@ -9,6 +9,7 @@ import { injectScript } from '../helpers/inject-script.js';
9
9
  import { compose } from '../helpers/compose.js';
10
10
 
11
11
  const DOCSEARCH_JS_URL = 'https://cdn.jsdelivr.net/npm/@docsearch/js@3.9.0/dist/umd/index.min.js';
12
+ const LTS_DOC_VERSION_REGEXP = /\/ckeditor5\/(lts-v\d+)(?:\/|$)/;
12
13
 
13
14
  /**
14
15
  * Component responsible for binding the algolia search component to the header.
@@ -60,6 +61,8 @@ export class AlgoliaSearch extends BaseComponent {
60
61
  const { boost, filters } = this;
61
62
  const { slug, tags } = filters;
62
63
 
64
+ const docVersion = window.location.pathname.match( LTS_DOC_VERSION_REGEXP )?.[ 1 ] || 'latest';
65
+
63
66
  window.docsearch( {
64
67
  container: this.elements.wrapper,
65
68
  ...this.config,
@@ -73,7 +76,7 @@ export class AlgoliaSearch extends BaseComponent {
73
76
  client.search = async ( options, ...rest ) => {
74
77
  const { results: [ firstResult ] } = await originalSearch( options, ...rest );
75
78
  const mappedResults = compose(
76
- filterByTags( { slug, tags } ),
79
+ filterResults( { slug, tags, docVersion } ),
77
80
  boostByTags( boost.tags )
78
81
  )( firstResult.hits );
79
82
 
@@ -136,14 +139,15 @@ export class AlgoliaSearch extends BaseComponent {
136
139
  }
137
140
 
138
141
  /**
139
- * Crates filters for Algolia that allow to filter out results from different projects.
140
- * Algolia shares the same index for all projects, so we need to filter results
142
+ * Creates filters for Algolia that allow to filter out results from different projects and types of the documentation (latest vs. LTS).
143
+ * Algolia shares the same index for all projects, so we need to filter results.
141
144
  */
142
- function filterByTags( { slug, tags } ) {
145
+ function filterResults( { slug, tags, docVersion } ) {
143
146
  return hits => hits.filter(
144
147
  hit =>
145
148
  ( !slug || hit.tags.includes( slug ) ) &&
146
- ( !tags || hit.tags.some( tag => tags.includes( tag ) ) )
149
+ ( !tags || hit.tags.some( tag => tags.includes( tag ) ) ) &&
150
+ ( !hit.docVersion || hit.docVersion === docVersion )
147
151
  );
148
152
  }
149
153
 
@@ -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.