umberto 4.4.0 → 4.4.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/package.json +1 -1
  3. package/src/data-converter/converters/typedoc/typedocconverter.js +1 -1
  4. package/themes/umberto/layout/page.pug +0 -1
  5. package/themes/umberto/src/css/_api-info-box.scss +14 -10
  6. package/themes/umberto/src/css/_api-props-filter.scss +26 -71
  7. package/themes/umberto/src/css/_api-subheader.scss +7 -4
  8. package/themes/umberto/src/css/_api-tree.scss +21 -16
  9. package/themes/umberto/src/css/_badge.scss +16 -12
  10. package/themes/umberto/src/css/_code-switcher.scss +15 -8
  11. package/themes/umberto/src/css/_collapsinglist.scss +34 -29
  12. package/themes/umberto/src/css/_content.scss +50 -43
  13. package/themes/umberto/src/css/_docsearch.scss +9 -6
  14. package/themes/umberto/src/css/_dropdown.scss +8 -5
  15. package/themes/umberto/src/css/_feedback-widget.scss +6 -3
  16. package/themes/umberto/src/css/_font-external.scss +8 -0
  17. package/themes/umberto/src/css/_footer.scss +21 -16
  18. package/themes/umberto/src/css/_formatted.scss +48 -40
  19. package/themes/umberto/src/css/_guide-content.scss +5 -2
  20. package/themes/umberto/src/css/_guide-sdk-tree.scss +3 -3
  21. package/themes/umberto/src/css/_main.scss +20 -15
  22. package/themes/umberto/src/css/_navigation.scss +11 -7
  23. package/themes/umberto/src/css/_notice.scss +35 -30
  24. package/themes/umberto/src/css/_prism.scss +5 -3
  25. package/themes/umberto/src/css/_rwd-breadcrumbs.scss +3 -1
  26. package/themes/umberto/src/css/_rwd-menu.scss +20 -15
  27. package/themes/umberto/src/css/_secondary-navigation.scss +44 -38
  28. package/themes/umberto/src/css/_toggler.scss +6 -4
  29. package/themes/umberto/src/css/_top.scss +49 -43
  30. package/themes/umberto/src/css/_tree.scss +24 -21
  31. package/themes/umberto/src/css/_warning-banner.scss +6 -3
  32. package/themes/umberto/src/css/helpers/_color.scss +4 -1
  33. package/themes/umberto/src/css/helpers/_font.scss +15 -12
  34. package/themes/umberto/src/css/helpers/_globals.scss +10 -9
  35. package/themes/umberto/src/css/helpers/_spacing.scss +3 -1
  36. package/themes/umberto/src/css/pages/_sdk.scss +12 -8
  37. package/themes/umberto/src/css/styles.scss +48 -47
  38. package/themes/umberto/src/js/_codeswitcherbuttons.js +21 -10
@@ -1,6 +1,9 @@
1
1
  // Copyright (c) 2017-2024, CKSource Holding sp. z o.o. All rights reserved.
2
2
  // For licensing, see LICENSE.md or http://ckeditor.com/license
3
3
 
4
+ @use 'spacing';
5
+ @use 'color';
6
+
4
7
  $u-top-main: 55px;
5
8
  $u-top-sub: 45px;
6
9
  $u-top-height: $u-top-main + $u-top-sub;
@@ -30,7 +33,7 @@ $u-top-icon-width: 30px;
30
33
  }
31
34
 
32
35
  @mixin u-box {
33
- background: u-color( 'background-bright' );
36
+ background: color.u-color( 'background-bright' );
34
37
  }
35
38
 
36
39
  @mixin u-responsive-mobile() {
@@ -93,14 +96,12 @@ $u-top-icon-width: 30px;
93
96
  z-index: 20;
94
97
  bottom: 0px;
95
98
  margin-bottom: 0;
96
- padding: u-spacing( 0 ) u-spacing( 2 );
97
- border-top: 1px solid u-color( 'background-hue' );
98
- // background: u-color( 'background-hue', 40% );
99
- background: u-color( 'background-bright' );
99
+ padding: spacing.u-spacing( 0 ) spacing.u-spacing( 2 );
100
+ border-top: 1px solid color.u-color( 'background-hue' );
101
+ background: color.u-color( 'background-bright' );
100
102
  height: 50px;
101
103
  border-top: 1px solid #eee;
102
104
  border-left: 0;
103
- // box-shadow: 2px 2px 0 #fafafa;
104
105
  }
105
106
 
106
107
  @mixin u-micro-header {
@@ -108,18 +109,18 @@ $u-top-icon-width: 30px;
108
109
  font-size: .85em;
109
110
  text-transform: uppercase;
110
111
  font-weight: 600;
111
- color: u-color( 'text', 20% );
112
+ color: color.u-color( 'text', 20% );
112
113
  }
113
114
 
114
115
  @mixin levels( $depth, $spacing ) {
115
116
  @if ( $depth < 8 ) {
116
117
  li {
117
118
  &::before {
118
- left: calc( #{ $depth * u-spacing( $spacing ) } - 8px );
119
+ left: calc( #{ $depth * spacing.u-spacing( $spacing ) } - 8px );
119
120
  }
120
121
 
121
122
  .tree__item__text {
122
- margin-left: ( $depth + 1.5 ) * u-spacing( $spacing );
123
+ margin-left: ( $depth + 1.5 ) * spacing.u-spacing( $spacing );
123
124
  }
124
125
 
125
126
  @include levels( $depth + 1, $spacing );
@@ -1,6 +1,8 @@
1
1
  // Copyright (c) 2017-2024, CKSource Holding sp. z o.o. All rights reserved.
2
2
  // For licensing, see LICENSE.md or http://ckeditor.com/license
3
3
 
4
+ @use 'sass:map';
5
+
4
6
  $u-def-spacing: 1em;
5
7
  $u-def-spacings: (
6
8
  -4: .1,
@@ -15,5 +17,5 @@ $u-def-spacings: (
15
17
  );
16
18
 
17
19
  @function u-spacing( $spacing ) {
18
- @return $u-def-spacing * map-get( $u-def-spacings, $spacing );
20
+ @return $u-def-spacing * map.get( $u-def-spacings, $spacing );
19
21
  }
@@ -6,6 +6,10 @@
6
6
  * `.main__content--sdk` is added when `page.isSdk` = true.
7
7
  */
8
8
 
9
+ @use '../helpers/color';
10
+ @use '../helpers/font';
11
+ @use '../helpers/spacing';
12
+
9
13
  .main__content--sdk {
10
14
  h1 {
11
15
  // "Documentation" link in the title.
@@ -24,11 +28,11 @@
24
28
  // Toggler
25
29
  a.sdk-sample-source-code__button {
26
30
  width: 100%;
27
- background: u-color( 'background-hue-light' );
31
+ background: color.u-color( 'background-hue-light' );
28
32
  display: block;
29
33
  padding: 10px 20px;
30
34
  position: relative;
31
- border-left: 3px solid u-color( 'hint-info' );
35
+ border-left: 3px solid color.u-color( 'hint-info' );
32
36
  transition: 200ms ease background;
33
37
  text-decoration: none;
34
38
 
@@ -36,7 +40,7 @@
36
40
  content: '';
37
41
  border-width: 3px 3px 0 0;
38
42
  border-style: solid;
39
- border-color: u-color( 'hint-info' );
43
+ border-color: color.u-color( 'hint-info' );
40
44
  width: 12px;
41
45
  height: 12px;
42
46
  transform: rotate(135deg);
@@ -47,7 +51,7 @@
47
51
 
48
52
  &:hover,
49
53
  &.active {
50
- background: u-color( 'background-hue' );
54
+ background: color.u-color( 'background-hue' );
51
55
  }
52
56
 
53
57
  // rotate arrow if active
@@ -63,7 +67,7 @@
63
67
  display: none;
64
68
  padding: 0;
65
69
  position: relative;
66
- @include u-font-mono;
70
+ @include font.u-font-mono;
67
71
 
68
72
  &.active {
69
73
  display: block;
@@ -77,14 +81,14 @@
77
81
 
78
82
  // copy and download buttons
79
83
  a {
80
- background: u-color( 'background-hue-light' );
81
- padding: u-spacing( 0 );
84
+ background: color.u-color( 'background-hue-light' );
85
+ padding: spacing.u-spacing( 0 );
82
86
  display: inline-block;
83
87
  text-decoration: none;
84
88
 
85
89
  &:hover {
86
90
  opacity: 1;
87
- background: u-color( 'background-hue' )
91
+ background: color.u-color( 'background-hue' )
88
92
  }
89
93
  }
90
94
  }
@@ -3,23 +3,24 @@
3
3
 
4
4
  // Division using / is deprecated, math.div() has to be used instead.
5
5
  // See: https://sass-lang.com/documentation/breaking-changes/slash-div
6
- @use 'sass:math';
7
6
 
8
7
  @use '~tippy.js/dist/tippy.css';
9
8
  @use '~tippy.js/themes/light-border.css';
10
9
  @use '~tippy.js/animations/scale.css';
11
-
12
- @import 'helpers/globals';
13
- @import 'helpers/font';
14
- @import 'helpers/reset';
15
- @import 'helpers/color';
16
- @import 'helpers/spacing';
10
+ @use 'font-external';
11
+ @use 'helpers/color';
12
+ @use 'helpers/font';
13
+ @use 'helpers/globals';
14
+ @use 'helpers/reset';
15
+ @use 'helpers/spacing';
16
+ @use 'sass:math';
17
+ @use 'sass:meta';
17
18
 
18
19
  @mixin u-std-font {
19
20
  font-weight: 400;
20
- line-height: $u-line-height-base;
21
- font-family: $u-font-face;
22
- font-size: $u-font-size-base;
21
+ line-height: font.$u-line-height-base;
22
+ font-family: font.$u-font-face;
23
+ font-size: font.$u-font-size-base;
23
24
  }
24
25
 
25
26
  body, html {
@@ -32,11 +33,11 @@ body, html {
32
33
  }
33
34
 
34
35
  body {
35
- padding: $u-top-height 0 0;
36
- color: u-color( text, 10% );
36
+ padding: globals.$u-top-height 0 0;
37
+ color: color.u-color( text, 10% );
37
38
 
38
- @include u-responsive-tablet {
39
- padding: $u-top-main 0 0;
39
+ @include globals.u-responsive-tablet {
40
+ padding: globals.$u-top-main 0 0;
40
41
  }
41
42
  }
42
43
 
@@ -45,7 +46,7 @@ button, input {
45
46
  }
46
47
 
47
48
  a {
48
- color: u-color( 'link' );
49
+ color: color.u-color( 'link' );
49
50
  text-decoration: none;
50
51
 
51
52
  &:hover {
@@ -57,60 +58,60 @@ a {
57
58
  display: none;
58
59
  }
59
60
 
60
- @import 'tree';
61
- @import 'top';
62
- @import 'main';
63
- @import 'formatted';
64
- @import 'collapsinglist';
65
- @import 'footer';
66
- @import 'toggler';
67
- @import 'badge';
68
- @import 'dropdown';
69
- @import 'secondary-navigation';
70
- @import 'docsearch';
71
- @import 'loading-spinner';
61
+ @include meta.load-css('tree');
62
+ @include meta.load-css('top');
63
+ @include meta.load-css('main');
64
+ @include meta.load-css('formatted');
65
+ @include meta.load-css('collapsinglist');
66
+ @include meta.load-css('footer');
67
+ @include meta.load-css('toggler');
68
+ @include meta.load-css('badge');
69
+ @include meta.load-css('dropdown');
70
+ @include meta.load-css('secondary-navigation');
71
+ @include meta.load-css('docsearch');
72
+ @include meta.load-css('loading-spinner');
72
73
  // PAGES
73
74
 
74
75
  // GUIDES
75
- @import 'notice';
76
- @import 'guide-sdk-tree';
77
- @import 'guide-content';
76
+ @include meta.load-css('notice');
77
+ @include meta.load-css('guide-sdk-tree');
78
+ @include meta.load-css('guide-content');
78
79
 
79
80
  // API
80
- @import 'api-content';
81
- @import 'api-info-box';
82
- @import 'api-props-filter';
83
- @import 'api-tree';
84
- @import 'api-subheader';
85
- @import 'api-see-source';
81
+ @include meta.load-css('api-content');
82
+ @include meta.load-css('api-info-box');
83
+ @include meta.load-css('api-props-filter');
84
+ @include meta.load-css('api-tree');
85
+ @include meta.load-css('api-subheader');
86
+ @include meta.load-css('api-see-source');
86
87
 
87
88
  // RWD
88
- @import 'rwd-menu';
89
- @import 'rwd-breadcrumbs';
89
+ @include meta.load-css('rwd-menu');
90
+ @include meta.load-css('rwd-breadcrumbs');
90
91
 
91
92
  // SDK
92
- @import 'pages/sdk';
93
+ @include meta.load-css('pages/sdk');
93
94
 
94
95
  // External Styles
95
- @import 'prism';
96
+ @include meta.load-css('prism');
96
97
 
97
98
  // Dark mode
98
- @import 'theme-dark';
99
+ @include meta.load-css('theme-dark');
99
100
 
100
101
  // Dedicated print styles
101
- @import 'print';
102
+ @include meta.load-css('print');
102
103
 
103
104
  // Components
104
- @import 'feedback-widget';
105
+ @include meta.load-css('feedback-widget');
105
106
 
106
107
  // Lightbox plugin for {@img ... } element
107
- @import 'components/lightbox';
108
+ @include meta.load-css('components/lightbox');
108
109
 
109
110
  // Toolbar icons inside guides.
110
- @import "editor-icon";
111
+ @include meta.load-css("editor-icon");
111
112
 
112
113
  // The warning banner feature (displayed in the header).
113
- @import "warning-banner";
114
+ @include meta.load-css("warning-banner");
114
115
 
115
116
  // The code switcher component
116
- @import "code-switcher";
117
+ @include meta.load-css("code-switcher");
@@ -3,7 +3,7 @@
3
3
  * For licensing, see LICENSE.md.
4
4
  */
5
5
 
6
- /* globals umberto */
6
+ import $ from 'jquery';
7
7
 
8
8
  const type = {
9
9
  selfHosted: 'selfhosted',
@@ -17,19 +17,29 @@ const codeSwitcherToolbarClass = 'code-switcher__toolbar';
17
17
 
18
18
  function switchSnippetContent( originalSnippetContent, newType ) {
19
19
  let newSnippetContent;
20
+ const gplComment = ' // Or \'GPL\'.';
21
+ const licenseKey = 'licenseKey: \'<YOUR_LICENSE_KEY>\',';
20
22
 
21
23
  if ( newType === type.cloud ) {
22
24
  newSnippetContent = originalSnippetContent
23
25
  .replace( /import {/g, 'const {' )
24
26
  .replace( /} from/g, '} =' )
25
27
  .replace( /'ckeditor5';/g, 'CKEDITOR;' )
26
- .replace( /'ckeditor5-premium-features'/g, 'CKEDITOR_PREMIUM_FEATURES' );
28
+ .replace( /'ckeditor5-premium-features'/g, 'CKEDITOR_PREMIUM_FEATURES' )
29
+ .replace( `${ licenseKey }${ gplComment }`, licenseKey );
27
30
  } else if ( newType === type.selfHosted ) {
28
31
  newSnippetContent = originalSnippetContent
29
32
  .replace( /const {/g, 'import {' )
30
33
  .replace( /} =/g, '} from' )
31
34
  .replace( /CKEDITOR;/g, '\'ckeditor5\';' )
32
- .replace( /CKEDITOR_PREMIUM_FEATURES/g, '\'ckeditor5-premium-features\'' );
35
+ .replace( /CKEDITOR_PREMIUM_FEATURES/g, '\'ckeditor5-premium-features\'' )
36
+ .replace( licenseKey, ( match, _, wholeString ) => {
37
+ if ( wholeString.includes( gplComment ) ) {
38
+ return match;
39
+ } else {
40
+ return `${ match }${ gplComment }`;
41
+ }
42
+ } );
33
43
  }
34
44
 
35
45
  return newSnippetContent;
@@ -88,20 +98,13 @@ export function createCodeSwitcherButtons() {
88
98
 
89
99
  const activeType = switcher.classList[ switcher.classList.length - 1 ];
90
100
 
91
- const infoCircle = document.createElement( 'img' );
92
-
93
- infoCircle.setAttribute( 'src', `/assets/${ umberto.version }/img/info-circle.svg` );
94
- infoCircle.classList.add( 'code-switcher__info' );
95
-
96
101
  const selfHostedButton = createButton( 'Self-hosted (npm)', activeType === type.selfHosted );
97
102
 
98
103
  selfHostedButton.setAttribute( 'title', 'Self-hosted shows imports for installations using npm or ZIP setups.' );
99
- selfHostedButton.append( infoCircle.cloneNode( true ) );
100
104
 
101
105
  const cloudButton = createButton( 'Cloud (CDN)', activeType === type.cloud );
102
106
 
103
107
  cloudButton.setAttribute( 'title', 'Cloud shows imports for installations using CDN setups.' );
104
- cloudButton.append( infoCircle.cloneNode( true ) );
105
108
 
106
109
  const switcherToolbar = switcher.querySelector( `.${ codeSwitcherToolbarClass }` );
107
110
 
@@ -132,4 +135,12 @@ export function createCodeSwitcherButtons() {
132
135
  saveSnippetType( type.cloud );
133
136
  } );
134
137
  } );
138
+
139
+ /* eslint-disable max-len */
140
+ const infoCircle = $( `
141
+ <svg class="code-switcher__info" width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
142
+ <path d="M6 0.75C3.10078 0.75 0.75 3.10078 0.75 6C0.75 8.89922 3.10078 11.25 6 11.25C8.89922 11.25 11.25 8.89922 11.25 6C11.25 3.10078 8.89922 0.75 6 0.75ZM6 10.3594C3.59297 10.3594 1.64063 8.40703 1.64063 6C1.64063 3.59297 3.59297 1.64063 6 1.64063C8.40703 1.64063 10.3594 3.59297 10.3594 6C10.3594 8.40703 8.40703 10.3594 6 10.3594Z" fill="white"/>
143
+ <path d="M5.43732 3.9375C5.43732 4.08668 5.49658 4.22976 5.60207 4.33525C5.70756 4.44074 5.85063 4.5 5.99982 4.5C6.149 4.5 6.29207 4.44074 6.39756 4.33525C6.50305 4.22976 6.56232 4.08668 6.56232 3.9375C6.56232 3.78832 6.50305 3.64524 6.39756 3.53975C6.29207 3.43426 6.149 3.375 5.99982 3.375C5.85063 3.375 5.70756 3.43426 5.60207 3.53975C5.49658 3.64524 5.43732 3.78832 5.43732 3.9375ZM6.28107 5.25H5.71857C5.667 5.25 5.62482 5.29219 5.62482 5.34375V8.53125C5.62482 8.58281 5.667 8.625 5.71857 8.625H6.28107C6.33263 8.625 6.37482 8.58281 6.37482 8.53125V5.34375C6.37482 5.29219 6.33263 5.25 6.28107 5.25Z" fill="white"/>
144
+ </svg>` );
145
+ infoCircle.appendTo( `.${ buttonClass }` );
135
146
  }