umberto 5.0.0 → 5.0.1
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,11 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [5.0.1](https://github.com/cksource/umberto/compare/v5.0.0...v5.0.1) (2025-03-13)
|
|
5
|
+
|
|
6
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
|
7
|
+
|
|
8
|
+
|
|
4
9
|
## [5.0.0](https://github.com/cksource/umberto/compare/v4.4.2...v5.0.0) (2025-03-12)
|
|
5
10
|
|
|
6
11
|
### BREAKING CHANGES
|
package/package.json
CHANGED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2017-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const IS_USER_DATE_SENT_KEY = 'is_local_user_os_date_sent';
|
|
7
|
+
const STATS_EVENT_URL_DEV = 'https://builder-api.internal.cke-cs-dev.com/events';
|
|
8
|
+
const STATS_EVENT_URL_PROD = 'https://builder-api.ckeditor.com/events';
|
|
9
|
+
|
|
10
|
+
export function sendUserDate() {
|
|
11
|
+
const isUserDateSent = localStorage.getItem( IS_USER_DATE_SENT_KEY );
|
|
12
|
+
const environment = getEnvironment();
|
|
13
|
+
const isProdOrNightly = environment === 'production' || environment === 'nightly';
|
|
14
|
+
const userDateUrl = isProdOrNightly ? STATS_EVENT_URL_PROD : STATS_EVENT_URL_DEV;
|
|
15
|
+
|
|
16
|
+
if ( isUserDateSent ) {
|
|
17
|
+
// User date info is already collected. Aborting.
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
fetch( userDateUrl, {
|
|
22
|
+
method: 'POST',
|
|
23
|
+
headers: {
|
|
24
|
+
'Content-Type': 'application/json'
|
|
25
|
+
},
|
|
26
|
+
body: JSON.stringify( {
|
|
27
|
+
environment,
|
|
28
|
+
event_type: 'cksource_docs_date',
|
|
29
|
+
event_data: {
|
|
30
|
+
date: new Date().toISOString(),
|
|
31
|
+
user_agent: window.navigator.userAgent,
|
|
32
|
+
language: window.navigator.language
|
|
33
|
+
}
|
|
34
|
+
} )
|
|
35
|
+
} ).then( () => {
|
|
36
|
+
localStorage.setItem( IS_USER_DATE_SENT_KEY, 'true' );
|
|
37
|
+
} ).catch( () => {
|
|
38
|
+
// There is no need to report if sending user date fails.
|
|
39
|
+
} );
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function getEnvironment() {
|
|
43
|
+
const hostname = window.location.hostname;
|
|
44
|
+
|
|
45
|
+
if ( hostname.startsWith( 'ckeditor5.github.io' ) ) {
|
|
46
|
+
return 'nightly';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if ( hostname.startsWith( 'ckeditor.com' ) ) {
|
|
50
|
+
return 'production';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return 'local';
|
|
54
|
+
}
|
|
@@ -28,6 +28,7 @@ import showWarningBanner from './_warningbanner';
|
|
|
28
28
|
import { enableBadgeTooltips, createTooltip } from './_tooltips';
|
|
29
29
|
import attachPermalinkListener from './_attachpermalinklistener';
|
|
30
30
|
import { createCodeSwitcherButtons } from './_codeswitcherbuttons';
|
|
31
|
+
import { sendUserDate } from './_sendUserDate';
|
|
31
32
|
|
|
32
33
|
// Changing documentation theme. To enable, type in the console: `localStorage.setItem( 'theme', 'theme-dark' )`.
|
|
33
34
|
if ( localStorage.getItem( 'theme' ) === 'theme-dark' ) {
|
|
@@ -67,4 +68,5 @@ $( document ).ready( () => {
|
|
|
67
68
|
sampleCode(); // control accordion of sample code and buttons(copy/download)
|
|
68
69
|
enableBadgeTooltips(); // attaches tippy.js tooltip for all elements with data-badge-tooltip
|
|
69
70
|
createCodeSwitcherButtons();
|
|
71
|
+
sendUserDate();
|
|
70
72
|
} );
|