@atlaskit/editor-common 111.17.1 → 111.18.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 +11 -0
- package/dist/cjs/analytics/types/enums.js +1 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/sync-block/ssr_error.js +127 -0
- package/dist/cjs/sync-block/types.js +1 -0
- package/dist/cjs/sync-block.js +14 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/analytics/types/enums.js +1 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/sync-block/ssr_error.js +117 -0
- package/dist/es2019/sync-block/types.js +0 -0
- package/dist/es2019/sync-block.js +2 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/analytics/types/enums.js +1 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/sync-block/ssr_error.js +120 -0
- package/dist/esm/sync-block/types.js +0 -0
- package/dist/esm/sync-block.js +2 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/analytics/index.d.ts +1 -1
- package/dist/types/analytics/types/enums.d.ts +1 -0
- package/dist/types/analytics/types/sync-block-events.d.ts +10 -1
- package/dist/types/sync-block/ssr_error.d.ts +50 -0
- package/dist/types/sync-block/types.d.ts +4 -0
- package/dist/types/sync-block.d.ts +2 -0
- package/dist/types-ts4.5/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/enums.d.ts +1 -0
- package/dist/types-ts4.5/analytics/types/sync-block-events.d.ts +10 -1
- package/dist/types-ts4.5/sync-block/ssr_error.d.ts +50 -0
- package/dist/types-ts4.5/sync-block/types.d.ts +4 -0
- package/dist/types-ts4.5/sync-block.d.ts +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 111.18.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`1a363f7706a2f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1a363f7706a2f) -
|
|
8
|
+
EDITOR-4193 add anaytics for ssr errors
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 111.17.1
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -565,6 +565,7 @@ var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTIO
|
|
|
565
565
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_FETCH"] = "syncedBlockFetch";
|
|
566
566
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_FETCH_REFERENCES"] = "syncedBlockFetchReferences";
|
|
567
567
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_CLICK_SYNCED_LOCATION"] = "syncedBlockClickSyncedLocation";
|
|
568
|
+
ACTION_SUBJECT_ID["SYNCED_BLOCK_SSR_ERROR"] = "syncedBlockSSRError";
|
|
568
569
|
ACTION_SUBJECT_ID["TABLE_STICKY_HEADER"] = "tableStickyHeader";
|
|
569
570
|
return ACTION_SUBJECT_ID;
|
|
570
571
|
}({});
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
20
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
21
21
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
22
|
-
var packageVersion = "111.17.
|
|
22
|
+
var packageVersion = "111.17.1";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.handleSSRErrorsAnalytics = exports.SyncedBlocksSSRErrorCodeMap = void 0;
|
|
8
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
|
+
var _analytics = require("../analytics");
|
|
10
|
+
var _coreUtils = require("../core-utils");
|
|
11
|
+
/**
|
|
12
|
+
* Error codes for synced blocks preloading
|
|
13
|
+
* Used for tracking and monitoring errors during SSR preload phase
|
|
14
|
+
*/
|
|
15
|
+
var SyncedBlocksSSRErrorCodeMap = exports.SyncedBlocksSSRErrorCodeMap = {
|
|
16
|
+
/**
|
|
17
|
+
* Occurs when the fetch operation returns fewer results than requested.
|
|
18
|
+
* This indicates incomplete data retrieval or potential data loss.
|
|
19
|
+
* Included in error: list of missing block identifiers
|
|
20
|
+
*/
|
|
21
|
+
FETCH_INCOMPLETE: 'SYNCED_BLOCKS_FETCH_INCOMPLETE',
|
|
22
|
+
/**
|
|
23
|
+
* Occurs when the batch fetch operation throws an error during execution.
|
|
24
|
+
* This indicates a network error, timeout, or API failure.
|
|
25
|
+
* Included in error: resource IDs that failed to fetch
|
|
26
|
+
*/
|
|
27
|
+
BATCH_FETCH_FAILED: 'SYNCED_BLOCKS_BATCH_FETCH_FAILED',
|
|
28
|
+
/**
|
|
29
|
+
* Occurs when the fetch operation times out without returning results.
|
|
30
|
+
* This is specific to the bulk fetch operation with a configurable timeout.
|
|
31
|
+
*/
|
|
32
|
+
FETCH_TIMEOUT: 'SYNCED_BLOCKS_FETCH_TIMEOUT'
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* This is the metadata structure for SSR errors stored in the window object.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
var isSyncedBlocksSSRErrorObj = function isSyncedBlocksSSRErrorObj(maybeSSRErrorObj) {
|
|
40
|
+
if (!maybeSSRErrorObj || (0, _typeof2.default)(maybeSSRErrorObj) !== 'object') {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
var errorWrapper = maybeSSRErrorObj;
|
|
44
|
+
|
|
45
|
+
// Check for meta object with valid code
|
|
46
|
+
var hasValidMeta = errorWrapper.meta && (0, _typeof2.default)(errorWrapper.meta) === 'object' && Object.values(SyncedBlocksSSRErrorCodeMap).includes(errorWrapper.meta.code);
|
|
47
|
+
return Boolean(hasValidMeta);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Get the first SSR error for synced blocks from the window.__SSR_ERROR__ array.
|
|
52
|
+
*
|
|
53
|
+
* Expected structure of error objects stored in confluence window.__SSR_ERROR__ for synced blocks SSR errors:
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* {
|
|
57
|
+
* error: {
|
|
58
|
+
* message: "Synced blocks fetch operation timed out",
|
|
59
|
+
* stack: "Error: Synced blocks fetch operation timed out\n at /tmp/script.js:xxx:xxx"
|
|
60
|
+
* },
|
|
61
|
+
* meta: {
|
|
62
|
+
* code: "SYNCED_BLOCKS_FETCH_TIMEOUT",
|
|
63
|
+
* contentId: "XXXXXX",
|
|
64
|
+
* cloudId: "XXXX-XXXX-XXXX-XXXX-XXXX",
|
|
65
|
+
* isBlog: false,
|
|
66
|
+
* identifiers: [
|
|
67
|
+
* {
|
|
68
|
+
* resourceId: "confluence-page/XXXXXX/XXXX-XXXX-XXXX-XXXX-XXXX",
|
|
69
|
+
* blockInstanceId: "XXXX-XXXX-XXXX-XXXX-XXXX"
|
|
70
|
+
* }
|
|
71
|
+
* ]
|
|
72
|
+
* }
|
|
73
|
+
* }
|
|
74
|
+
*
|
|
75
|
+
* @returns The first SSR error metadata, or undefined if no error found
|
|
76
|
+
*/
|
|
77
|
+
var getSyncedBlocksSSRError = function getSyncedBlocksSSRError() {
|
|
78
|
+
if ((0, _coreUtils.isSSR)()) {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
var ssrErrors = window.__SSR_ERROR__;
|
|
82
|
+
if (Array.isArray(ssrErrors)) {
|
|
83
|
+
var syncedBlockErrors = ssrErrors.filter(isSyncedBlocksSSRErrorObj).map(function (errorWrapper) {
|
|
84
|
+
return errorWrapper.meta;
|
|
85
|
+
});
|
|
86
|
+
return syncedBlockErrors.length > 0 ? syncedBlockErrors[0] : undefined;
|
|
87
|
+
}
|
|
88
|
+
return undefined;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Fire analytics event for the first unprocessed SSR error that occurred during page rendering.
|
|
93
|
+
* This function only runs ONCE per browser session to avoid duplicate analytics events.
|
|
94
|
+
*
|
|
95
|
+
* @param fireAnalyticsEvent - Function to fire analytics events
|
|
96
|
+
*/
|
|
97
|
+
var handleSSRErrorsAnalytics = exports.handleSSRErrorsAnalytics = function () {
|
|
98
|
+
var called = false;
|
|
99
|
+
// I want this fireAnalyticsEvent only takes in SyncedBlockSSRErrorAEP
|
|
100
|
+
return function (fireAnalyticsEvent) {
|
|
101
|
+
if (called) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
called = true;
|
|
105
|
+
if (!fireAnalyticsEvent) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
var error = getSyncedBlocksSSRError();
|
|
109
|
+
if (error) {
|
|
110
|
+
var _error$identifiers, _error$missingIdentif;
|
|
111
|
+
fireAnalyticsEvent({
|
|
112
|
+
action: _analytics.ACTION.ERROR,
|
|
113
|
+
actionSubject: _analytics.ACTION_SUBJECT.SYNCED_BLOCK,
|
|
114
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.SYNCED_BLOCK_SSR_ERROR,
|
|
115
|
+
eventType: _analytics.EVENT_TYPE.OPERATIONAL,
|
|
116
|
+
attributes: {
|
|
117
|
+
code: error.code,
|
|
118
|
+
isBlog: error.isBlog,
|
|
119
|
+
syncedBlocksCount: ((_error$identifiers = error.identifiers) === null || _error$identifiers === void 0 ? void 0 : _error$identifiers.length) || 0,
|
|
120
|
+
missingSyncedBlocksCount: ((_error$missingIdentif = error.missingIdentifiers) === null || _error$missingIdentif === void 0 ? void 0 : _error$missingIdentif.length) || 0,
|
|
121
|
+
errorMessage: error.errorMessage,
|
|
122
|
+
errorName: error.errorName
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
}();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/dist/cjs/sync-block.js
CHANGED
|
@@ -39,6 +39,18 @@ Object.defineProperty(exports, "SyncBlockStateCssClassName", {
|
|
|
39
39
|
return _syncBlock.SyncBlockStateCssClassName;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
+
Object.defineProperty(exports, "SyncedBlocksSSRErrorCodeMap", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function get() {
|
|
45
|
+
return _ssr_error.SyncedBlocksSSRErrorCodeMap;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "handleSSRErrorsAnalytics", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _ssr_error.handleSSRErrorsAnalytics;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
42
54
|
Object.defineProperty(exports, "useSyncBlockActions", {
|
|
43
55
|
enumerable: true,
|
|
44
56
|
get: function get() {
|
|
@@ -46,4 +58,5 @@ Object.defineProperty(exports, "useSyncBlockActions", {
|
|
|
46
58
|
}
|
|
47
59
|
});
|
|
48
60
|
var _syncBlock = require("./styles/shared/sync-block");
|
|
49
|
-
var _SyncBlockActionsContext = require("./sync-block/SyncBlockActionsContext");
|
|
61
|
+
var _SyncBlockActionsContext = require("./sync-block/SyncBlockActionsContext");
|
|
62
|
+
var _ssr_error = require("./sync-block/ssr_error");
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "111.17.
|
|
27
|
+
var packageVersion = "111.17.1";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -559,6 +559,7 @@ export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
|
|
|
559
559
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_FETCH"] = "syncedBlockFetch";
|
|
560
560
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_FETCH_REFERENCES"] = "syncedBlockFetchReferences";
|
|
561
561
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_CLICK_SYNCED_LOCATION"] = "syncedBlockClickSyncedLocation";
|
|
562
|
+
ACTION_SUBJECT_ID["SYNCED_BLOCK_SSR_ERROR"] = "syncedBlockSSRError";
|
|
562
563
|
ACTION_SUBJECT_ID["TABLE_STICKY_HEADER"] = "tableStickyHeader";
|
|
563
564
|
return ACTION_SUBJECT_ID;
|
|
564
565
|
}({});
|
|
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
|
|
|
4
4
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
5
5
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
6
6
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
7
|
-
const packageVersion = "111.17.
|
|
7
|
+
const packageVersion = "111.17.1";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../analytics';
|
|
2
|
+
import { isSSR } from '../core-utils';
|
|
3
|
+
/**
|
|
4
|
+
* Error codes for synced blocks preloading
|
|
5
|
+
* Used for tracking and monitoring errors during SSR preload phase
|
|
6
|
+
*/
|
|
7
|
+
export const SyncedBlocksSSRErrorCodeMap = {
|
|
8
|
+
/**
|
|
9
|
+
* Occurs when the fetch operation returns fewer results than requested.
|
|
10
|
+
* This indicates incomplete data retrieval or potential data loss.
|
|
11
|
+
* Included in error: list of missing block identifiers
|
|
12
|
+
*/
|
|
13
|
+
FETCH_INCOMPLETE: 'SYNCED_BLOCKS_FETCH_INCOMPLETE',
|
|
14
|
+
/**
|
|
15
|
+
* Occurs when the batch fetch operation throws an error during execution.
|
|
16
|
+
* This indicates a network error, timeout, or API failure.
|
|
17
|
+
* Included in error: resource IDs that failed to fetch
|
|
18
|
+
*/
|
|
19
|
+
BATCH_FETCH_FAILED: 'SYNCED_BLOCKS_BATCH_FETCH_FAILED',
|
|
20
|
+
/**
|
|
21
|
+
* Occurs when the fetch operation times out without returning results.
|
|
22
|
+
* This is specific to the bulk fetch operation with a configurable timeout.
|
|
23
|
+
*/
|
|
24
|
+
FETCH_TIMEOUT: 'SYNCED_BLOCKS_FETCH_TIMEOUT'
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* This is the metadata structure for SSR errors stored in the window object.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
const isSyncedBlocksSSRErrorObj = maybeSSRErrorObj => {
|
|
32
|
+
if (!maybeSSRErrorObj || typeof maybeSSRErrorObj !== 'object') {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
const errorWrapper = maybeSSRErrorObj;
|
|
36
|
+
|
|
37
|
+
// Check for meta object with valid code
|
|
38
|
+
const hasValidMeta = errorWrapper.meta && typeof errorWrapper.meta === 'object' && Object.values(SyncedBlocksSSRErrorCodeMap).includes(errorWrapper.meta.code);
|
|
39
|
+
return Boolean(hasValidMeta);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Get the first SSR error for synced blocks from the window.__SSR_ERROR__ array.
|
|
44
|
+
*
|
|
45
|
+
* Expected structure of error objects stored in confluence window.__SSR_ERROR__ for synced blocks SSR errors:
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* {
|
|
49
|
+
* error: {
|
|
50
|
+
* message: "Synced blocks fetch operation timed out",
|
|
51
|
+
* stack: "Error: Synced blocks fetch operation timed out\n at /tmp/script.js:xxx:xxx"
|
|
52
|
+
* },
|
|
53
|
+
* meta: {
|
|
54
|
+
* code: "SYNCED_BLOCKS_FETCH_TIMEOUT",
|
|
55
|
+
* contentId: "XXXXXX",
|
|
56
|
+
* cloudId: "XXXX-XXXX-XXXX-XXXX-XXXX",
|
|
57
|
+
* isBlog: false,
|
|
58
|
+
* identifiers: [
|
|
59
|
+
* {
|
|
60
|
+
* resourceId: "confluence-page/XXXXXX/XXXX-XXXX-XXXX-XXXX-XXXX",
|
|
61
|
+
* blockInstanceId: "XXXX-XXXX-XXXX-XXXX-XXXX"
|
|
62
|
+
* }
|
|
63
|
+
* ]
|
|
64
|
+
* }
|
|
65
|
+
* }
|
|
66
|
+
*
|
|
67
|
+
* @returns The first SSR error metadata, or undefined if no error found
|
|
68
|
+
*/
|
|
69
|
+
const getSyncedBlocksSSRError = () => {
|
|
70
|
+
if (isSSR()) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
const ssrErrors = window.__SSR_ERROR__;
|
|
74
|
+
if (Array.isArray(ssrErrors)) {
|
|
75
|
+
const syncedBlockErrors = ssrErrors.filter(isSyncedBlocksSSRErrorObj).map(errorWrapper => errorWrapper.meta);
|
|
76
|
+
return syncedBlockErrors.length > 0 ? syncedBlockErrors[0] : undefined;
|
|
77
|
+
}
|
|
78
|
+
return undefined;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Fire analytics event for the first unprocessed SSR error that occurred during page rendering.
|
|
83
|
+
* This function only runs ONCE per browser session to avoid duplicate analytics events.
|
|
84
|
+
*
|
|
85
|
+
* @param fireAnalyticsEvent - Function to fire analytics events
|
|
86
|
+
*/
|
|
87
|
+
export const handleSSRErrorsAnalytics = (() => {
|
|
88
|
+
let called = false;
|
|
89
|
+
// I want this fireAnalyticsEvent only takes in SyncedBlockSSRErrorAEP
|
|
90
|
+
return fireAnalyticsEvent => {
|
|
91
|
+
if (called) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
called = true;
|
|
95
|
+
if (!fireAnalyticsEvent) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const error = getSyncedBlocksSSRError();
|
|
99
|
+
if (error) {
|
|
100
|
+
var _error$identifiers, _error$missingIdentif;
|
|
101
|
+
fireAnalyticsEvent({
|
|
102
|
+
action: ACTION.ERROR,
|
|
103
|
+
actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
|
|
104
|
+
actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_SSR_ERROR,
|
|
105
|
+
eventType: EVENT_TYPE.OPERATIONAL,
|
|
106
|
+
attributes: {
|
|
107
|
+
code: error.code,
|
|
108
|
+
isBlog: error.isBlog,
|
|
109
|
+
syncedBlocksCount: ((_error$identifiers = error.identifiers) === null || _error$identifiers === void 0 ? void 0 : _error$identifiers.length) || 0,
|
|
110
|
+
missingSyncedBlocksCount: ((_error$missingIdentif = error.missingIdentifiers) === null || _error$missingIdentif === void 0 ? void 0 : _error$missingIdentif.length) || 0,
|
|
111
|
+
errorMessage: error.errorMessage,
|
|
112
|
+
errorName: error.errorName
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
})();
|
|
File without changes
|
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
3
3
|
|
|
4
4
|
export { BodiedSyncBlockSharedCssClassName, SyncBlockSharedCssClassName, SyncBlockLabelSharedCssClassName, SyncBlockStateCssClassName, SyncBlockRendererDataAttributeName } from './styles/shared/sync-block';
|
|
5
|
-
export { SyncBlockActionsProvider, useSyncBlockActions } from './sync-block/SyncBlockActionsContext';
|
|
5
|
+
export { SyncBlockActionsProvider, useSyncBlockActions } from './sync-block/SyncBlockActionsContext';
|
|
6
|
+
export { handleSSRErrorsAnalytics, SyncedBlocksSSRErrorCodeMap } from './sync-block/ssr_error';
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "111.17.
|
|
17
|
+
const packageVersion = "111.17.1";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -559,6 +559,7 @@ export var ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
|
|
|
559
559
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_FETCH"] = "syncedBlockFetch";
|
|
560
560
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_FETCH_REFERENCES"] = "syncedBlockFetchReferences";
|
|
561
561
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_CLICK_SYNCED_LOCATION"] = "syncedBlockClickSyncedLocation";
|
|
562
|
+
ACTION_SUBJECT_ID["SYNCED_BLOCK_SSR_ERROR"] = "syncedBlockSSRError";
|
|
562
563
|
ACTION_SUBJECT_ID["TABLE_STICKY_HEADER"] = "tableStickyHeader";
|
|
563
564
|
return ACTION_SUBJECT_ID;
|
|
564
565
|
}({});
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "111.17.
|
|
13
|
+
var packageVersion = "111.17.1";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../analytics';
|
|
3
|
+
import { isSSR } from '../core-utils';
|
|
4
|
+
/**
|
|
5
|
+
* Error codes for synced blocks preloading
|
|
6
|
+
* Used for tracking and monitoring errors during SSR preload phase
|
|
7
|
+
*/
|
|
8
|
+
export var SyncedBlocksSSRErrorCodeMap = {
|
|
9
|
+
/**
|
|
10
|
+
* Occurs when the fetch operation returns fewer results than requested.
|
|
11
|
+
* This indicates incomplete data retrieval or potential data loss.
|
|
12
|
+
* Included in error: list of missing block identifiers
|
|
13
|
+
*/
|
|
14
|
+
FETCH_INCOMPLETE: 'SYNCED_BLOCKS_FETCH_INCOMPLETE',
|
|
15
|
+
/**
|
|
16
|
+
* Occurs when the batch fetch operation throws an error during execution.
|
|
17
|
+
* This indicates a network error, timeout, or API failure.
|
|
18
|
+
* Included in error: resource IDs that failed to fetch
|
|
19
|
+
*/
|
|
20
|
+
BATCH_FETCH_FAILED: 'SYNCED_BLOCKS_BATCH_FETCH_FAILED',
|
|
21
|
+
/**
|
|
22
|
+
* Occurs when the fetch operation times out without returning results.
|
|
23
|
+
* This is specific to the bulk fetch operation with a configurable timeout.
|
|
24
|
+
*/
|
|
25
|
+
FETCH_TIMEOUT: 'SYNCED_BLOCKS_FETCH_TIMEOUT'
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* This is the metadata structure for SSR errors stored in the window object.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
var isSyncedBlocksSSRErrorObj = function isSyncedBlocksSSRErrorObj(maybeSSRErrorObj) {
|
|
33
|
+
if (!maybeSSRErrorObj || _typeof(maybeSSRErrorObj) !== 'object') {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
var errorWrapper = maybeSSRErrorObj;
|
|
37
|
+
|
|
38
|
+
// Check for meta object with valid code
|
|
39
|
+
var hasValidMeta = errorWrapper.meta && _typeof(errorWrapper.meta) === 'object' && Object.values(SyncedBlocksSSRErrorCodeMap).includes(errorWrapper.meta.code);
|
|
40
|
+
return Boolean(hasValidMeta);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Get the first SSR error for synced blocks from the window.__SSR_ERROR__ array.
|
|
45
|
+
*
|
|
46
|
+
* Expected structure of error objects stored in confluence window.__SSR_ERROR__ for synced blocks SSR errors:
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* {
|
|
50
|
+
* error: {
|
|
51
|
+
* message: "Synced blocks fetch operation timed out",
|
|
52
|
+
* stack: "Error: Synced blocks fetch operation timed out\n at /tmp/script.js:xxx:xxx"
|
|
53
|
+
* },
|
|
54
|
+
* meta: {
|
|
55
|
+
* code: "SYNCED_BLOCKS_FETCH_TIMEOUT",
|
|
56
|
+
* contentId: "XXXXXX",
|
|
57
|
+
* cloudId: "XXXX-XXXX-XXXX-XXXX-XXXX",
|
|
58
|
+
* isBlog: false,
|
|
59
|
+
* identifiers: [
|
|
60
|
+
* {
|
|
61
|
+
* resourceId: "confluence-page/XXXXXX/XXXX-XXXX-XXXX-XXXX-XXXX",
|
|
62
|
+
* blockInstanceId: "XXXX-XXXX-XXXX-XXXX-XXXX"
|
|
63
|
+
* }
|
|
64
|
+
* ]
|
|
65
|
+
* }
|
|
66
|
+
* }
|
|
67
|
+
*
|
|
68
|
+
* @returns The first SSR error metadata, or undefined if no error found
|
|
69
|
+
*/
|
|
70
|
+
var getSyncedBlocksSSRError = function getSyncedBlocksSSRError() {
|
|
71
|
+
if (isSSR()) {
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
var ssrErrors = window.__SSR_ERROR__;
|
|
75
|
+
if (Array.isArray(ssrErrors)) {
|
|
76
|
+
var syncedBlockErrors = ssrErrors.filter(isSyncedBlocksSSRErrorObj).map(function (errorWrapper) {
|
|
77
|
+
return errorWrapper.meta;
|
|
78
|
+
});
|
|
79
|
+
return syncedBlockErrors.length > 0 ? syncedBlockErrors[0] : undefined;
|
|
80
|
+
}
|
|
81
|
+
return undefined;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Fire analytics event for the first unprocessed SSR error that occurred during page rendering.
|
|
86
|
+
* This function only runs ONCE per browser session to avoid duplicate analytics events.
|
|
87
|
+
*
|
|
88
|
+
* @param fireAnalyticsEvent - Function to fire analytics events
|
|
89
|
+
*/
|
|
90
|
+
export var handleSSRErrorsAnalytics = function () {
|
|
91
|
+
var called = false;
|
|
92
|
+
// I want this fireAnalyticsEvent only takes in SyncedBlockSSRErrorAEP
|
|
93
|
+
return function (fireAnalyticsEvent) {
|
|
94
|
+
if (called) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
called = true;
|
|
98
|
+
if (!fireAnalyticsEvent) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
var error = getSyncedBlocksSSRError();
|
|
102
|
+
if (error) {
|
|
103
|
+
var _error$identifiers, _error$missingIdentif;
|
|
104
|
+
fireAnalyticsEvent({
|
|
105
|
+
action: ACTION.ERROR,
|
|
106
|
+
actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
|
|
107
|
+
actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_SSR_ERROR,
|
|
108
|
+
eventType: EVENT_TYPE.OPERATIONAL,
|
|
109
|
+
attributes: {
|
|
110
|
+
code: error.code,
|
|
111
|
+
isBlog: error.isBlog,
|
|
112
|
+
syncedBlocksCount: ((_error$identifiers = error.identifiers) === null || _error$identifiers === void 0 ? void 0 : _error$identifiers.length) || 0,
|
|
113
|
+
missingSyncedBlocksCount: ((_error$missingIdentif = error.missingIdentifiers) === null || _error$missingIdentif === void 0 ? void 0 : _error$missingIdentif.length) || 0,
|
|
114
|
+
errorMessage: error.errorMessage,
|
|
115
|
+
errorName: error.errorName
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}();
|
|
File without changes
|
package/dist/esm/sync-block.js
CHANGED
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
3
3
|
|
|
4
4
|
export { BodiedSyncBlockSharedCssClassName, SyncBlockSharedCssClassName, SyncBlockLabelSharedCssClassName, SyncBlockStateCssClassName, SyncBlockRendererDataAttributeName } from './styles/shared/sync-block';
|
|
5
|
-
export { SyncBlockActionsProvider, useSyncBlockActions } from './sync-block/SyncBlockActionsContext';
|
|
5
|
+
export { SyncBlockActionsProvider, useSyncBlockActions } from './sync-block/SyncBlockActionsContext';
|
|
6
|
+
export { handleSSRErrorsAnalytics, SyncedBlocksSSRErrorCodeMap } from './sync-block/ssr_error';
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "111.17.
|
|
24
|
+
var packageVersion = "111.17.1";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -53,4 +53,4 @@ export { type TelepointerClickPayload } from './types/telepointer-events';
|
|
|
53
53
|
export { type NcsSessionStepEventAEP, type NcsSessionStepMetrics, } from './types/ncs-session-step-events';
|
|
54
54
|
export type { BlockMenuEventPayload } from './types/block-menu-events';
|
|
55
55
|
export type { BreakoutEventPayload, BreakoutSupportedNodes } from './types/breakout-events';
|
|
56
|
-
export type { RendererSyncBlockEventPayload, SyncBlockEventPayload, } from './types/sync-block-events';
|
|
56
|
+
export type { RendererSyncBlockEventPayload, SyncBlockEventPayload, SyncedBlockSSRErrorAEP, } from './types/sync-block-events';
|
|
@@ -551,6 +551,7 @@ export declare enum ACTION_SUBJECT_ID {
|
|
|
551
551
|
SYNCED_BLOCK_FETCH = "syncedBlockFetch",
|
|
552
552
|
SYNCED_BLOCK_FETCH_REFERENCES = "syncedBlockFetchReferences",
|
|
553
553
|
SYNCED_BLOCK_CLICK_SYNCED_LOCATION = "syncedBlockClickSyncedLocation",
|
|
554
|
+
SYNCED_BLOCK_SSR_ERROR = "syncedBlockSSRError",
|
|
554
555
|
TABLE_STICKY_HEADER = "tableStickyHeader"
|
|
555
556
|
}
|
|
556
557
|
export declare enum FLOATING_CONTROLS_TITLE {
|
|
@@ -38,6 +38,15 @@ export type SyncedBlockEditSourceAEP = OperationalAEP<ACTION.SYNCED_BLOCK_EDIT_S
|
|
|
38
38
|
export type SyncedBlockCopyAEP = OperationalAEP<ACTION.COPIED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_COPY, SyncedBlockCopySuccessAttributes>;
|
|
39
39
|
export type SyncedBlockCopyErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_COPY, SyncedBlockCopyErrorAttributes>;
|
|
40
40
|
export type SyncedLocationClickAEP = OperationalAEP<ACTION.CLICKED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_CLICK_SYNCED_LOCATION, SyncedBlockSuccessAttributes>;
|
|
41
|
-
|
|
41
|
+
type SyncedBlockSSRErrorAttributes = {
|
|
42
|
+
code: string;
|
|
43
|
+
errorMessage?: string;
|
|
44
|
+
errorName?: string;
|
|
45
|
+
isBlog?: boolean;
|
|
46
|
+
missingSyncedBlocksCount?: number;
|
|
47
|
+
syncedBlocksCount?: number;
|
|
48
|
+
};
|
|
49
|
+
export type SyncedBlockSSRErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_SSR_ERROR, SyncedBlockSSRErrorAttributes>;
|
|
50
|
+
export type SyncBlockEventPayload = SyncedBlockSourceURLErrorAEP | SyncedBlockUpdateCacheErrorAEP | SyncedBlockUpdateErrorAEP | SyncedBlockUpdateSuccessAEP | SyncedBlockCreateErrorAEP | SyncedBlockCreateSuccessAEP | SyncedBlockDeleteErrorAEP | SyncedBlockDeleteSuccessAEP | SyncedBlockGetSourceInfoErrorAEP | SyncedBlockFetchErrorAEP | SyncedBlockFetchSuccessAEP | ReferenceSyncedBlockUpdateErrorAEP | SyncedBlockFetchReferencesErrorAEP | ExperienceEventPayload | ReferenceSyncedBlockCreateSuccessAEP | ReferenceSyncedBlockDeleteSuccessAEP | SyncedBlockEditSourceAEP | SyncedBlockCopyAEP | SyncedBlockCopyErrorAEP | SyncedLocationClickAEP | SyncedBlockSSRErrorAEP | InsertSourceSyncedBlockPayload;
|
|
42
51
|
export type RendererSyncBlockEventPayload = SyncedBlockGetSourceInfoErrorAEP | SyncedBlockFetchErrorAEP | SyncedBlockFetchSuccessAEP | ReferenceSyncedBlockUpdateErrorAEP | ExperienceEventPayload;
|
|
43
52
|
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { SyncedBlockSSRErrorAEP } from '../analytics/types/sync-block-events';
|
|
2
|
+
type BlockNodeIdentifiers = {
|
|
3
|
+
blockInstanceId: string;
|
|
4
|
+
resourceId: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Error codes for synced blocks preloading
|
|
8
|
+
* Used for tracking and monitoring errors during SSR preload phase
|
|
9
|
+
*/
|
|
10
|
+
export declare const SyncedBlocksSSRErrorCodeMap: {
|
|
11
|
+
/**
|
|
12
|
+
* Occurs when the fetch operation returns fewer results than requested.
|
|
13
|
+
* This indicates incomplete data retrieval or potential data loss.
|
|
14
|
+
* Included in error: list of missing block identifiers
|
|
15
|
+
*/
|
|
16
|
+
readonly FETCH_INCOMPLETE: "SYNCED_BLOCKS_FETCH_INCOMPLETE";
|
|
17
|
+
/**
|
|
18
|
+
* Occurs when the batch fetch operation throws an error during execution.
|
|
19
|
+
* This indicates a network error, timeout, or API failure.
|
|
20
|
+
* Included in error: resource IDs that failed to fetch
|
|
21
|
+
*/
|
|
22
|
+
readonly BATCH_FETCH_FAILED: "SYNCED_BLOCKS_BATCH_FETCH_FAILED";
|
|
23
|
+
/**
|
|
24
|
+
* Occurs when the fetch operation times out without returning results.
|
|
25
|
+
* This is specific to the bulk fetch operation with a configurable timeout.
|
|
26
|
+
*/
|
|
27
|
+
readonly FETCH_TIMEOUT: "SYNCED_BLOCKS_FETCH_TIMEOUT";
|
|
28
|
+
};
|
|
29
|
+
export type SyncedBlocksSSRErrorCode = (typeof SyncedBlocksSSRErrorCodeMap)[keyof typeof SyncedBlocksSSRErrorCodeMap];
|
|
30
|
+
/**
|
|
31
|
+
* This is the metadata structure for SSR errors stored in the window object.
|
|
32
|
+
*/
|
|
33
|
+
export type SyncedBlocksSSRErrorMetadata = {
|
|
34
|
+
cloudId?: string;
|
|
35
|
+
code: SyncedBlocksSSRErrorCode;
|
|
36
|
+
contentId?: string;
|
|
37
|
+
errorMessage?: string;
|
|
38
|
+
errorName?: string;
|
|
39
|
+
identifiers?: BlockNodeIdentifiers[];
|
|
40
|
+
isBlog?: boolean;
|
|
41
|
+
missingIdentifiers?: BlockNodeIdentifiers[];
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Fire analytics event for the first unprocessed SSR error that occurred during page rendering.
|
|
45
|
+
* This function only runs ONCE per browser session to avoid duplicate analytics events.
|
|
46
|
+
*
|
|
47
|
+
* @param fireAnalyticsEvent - Function to fire analytics events
|
|
48
|
+
*/
|
|
49
|
+
export declare const handleSSRErrorsAnalytics: (fireAnalyticsEvent?: (event: SyncedBlockSSRErrorAEP) => void) => void;
|
|
50
|
+
export {};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { BodiedSyncBlockSharedCssClassName, SyncBlockSharedCssClassName, SyncBlockLabelSharedCssClassName, SyncBlockStateCssClassName, SyncBlockRendererDataAttributeName, } from './styles/shared/sync-block';
|
|
2
2
|
export { SyncBlockActionsProvider, useSyncBlockActions, } from './sync-block/SyncBlockActionsContext';
|
|
3
|
+
export type { SyncedBlocksSSRErrorMetadata, SyncedBlocksSSRErrorCode, } from './sync-block/ssr_error';
|
|
4
|
+
export { handleSSRErrorsAnalytics, SyncedBlocksSSRErrorCodeMap } from './sync-block/ssr_error';
|
|
@@ -53,4 +53,4 @@ export { type TelepointerClickPayload } from './types/telepointer-events';
|
|
|
53
53
|
export { type NcsSessionStepEventAEP, type NcsSessionStepMetrics, } from './types/ncs-session-step-events';
|
|
54
54
|
export type { BlockMenuEventPayload } from './types/block-menu-events';
|
|
55
55
|
export type { BreakoutEventPayload, BreakoutSupportedNodes } from './types/breakout-events';
|
|
56
|
-
export type { RendererSyncBlockEventPayload, SyncBlockEventPayload, } from './types/sync-block-events';
|
|
56
|
+
export type { RendererSyncBlockEventPayload, SyncBlockEventPayload, SyncedBlockSSRErrorAEP, } from './types/sync-block-events';
|
|
@@ -551,6 +551,7 @@ export declare enum ACTION_SUBJECT_ID {
|
|
|
551
551
|
SYNCED_BLOCK_FETCH = "syncedBlockFetch",
|
|
552
552
|
SYNCED_BLOCK_FETCH_REFERENCES = "syncedBlockFetchReferences",
|
|
553
553
|
SYNCED_BLOCK_CLICK_SYNCED_LOCATION = "syncedBlockClickSyncedLocation",
|
|
554
|
+
SYNCED_BLOCK_SSR_ERROR = "syncedBlockSSRError",
|
|
554
555
|
TABLE_STICKY_HEADER = "tableStickyHeader"
|
|
555
556
|
}
|
|
556
557
|
export declare enum FLOATING_CONTROLS_TITLE {
|
|
@@ -38,6 +38,15 @@ export type SyncedBlockEditSourceAEP = OperationalAEP<ACTION.SYNCED_BLOCK_EDIT_S
|
|
|
38
38
|
export type SyncedBlockCopyAEP = OperationalAEP<ACTION.COPIED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_COPY, SyncedBlockCopySuccessAttributes>;
|
|
39
39
|
export type SyncedBlockCopyErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_COPY, SyncedBlockCopyErrorAttributes>;
|
|
40
40
|
export type SyncedLocationClickAEP = OperationalAEP<ACTION.CLICKED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_CLICK_SYNCED_LOCATION, SyncedBlockSuccessAttributes>;
|
|
41
|
-
|
|
41
|
+
type SyncedBlockSSRErrorAttributes = {
|
|
42
|
+
code: string;
|
|
43
|
+
errorMessage?: string;
|
|
44
|
+
errorName?: string;
|
|
45
|
+
isBlog?: boolean;
|
|
46
|
+
missingSyncedBlocksCount?: number;
|
|
47
|
+
syncedBlocksCount?: number;
|
|
48
|
+
};
|
|
49
|
+
export type SyncedBlockSSRErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_SSR_ERROR, SyncedBlockSSRErrorAttributes>;
|
|
50
|
+
export type SyncBlockEventPayload = SyncedBlockSourceURLErrorAEP | SyncedBlockUpdateCacheErrorAEP | SyncedBlockUpdateErrorAEP | SyncedBlockUpdateSuccessAEP | SyncedBlockCreateErrorAEP | SyncedBlockCreateSuccessAEP | SyncedBlockDeleteErrorAEP | SyncedBlockDeleteSuccessAEP | SyncedBlockGetSourceInfoErrorAEP | SyncedBlockFetchErrorAEP | SyncedBlockFetchSuccessAEP | ReferenceSyncedBlockUpdateErrorAEP | SyncedBlockFetchReferencesErrorAEP | ExperienceEventPayload | ReferenceSyncedBlockCreateSuccessAEP | ReferenceSyncedBlockDeleteSuccessAEP | SyncedBlockEditSourceAEP | SyncedBlockCopyAEP | SyncedBlockCopyErrorAEP | SyncedLocationClickAEP | SyncedBlockSSRErrorAEP | InsertSourceSyncedBlockPayload;
|
|
42
51
|
export type RendererSyncBlockEventPayload = SyncedBlockGetSourceInfoErrorAEP | SyncedBlockFetchErrorAEP | SyncedBlockFetchSuccessAEP | ReferenceSyncedBlockUpdateErrorAEP | ExperienceEventPayload;
|
|
43
52
|
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { SyncedBlockSSRErrorAEP } from '../analytics/types/sync-block-events';
|
|
2
|
+
type BlockNodeIdentifiers = {
|
|
3
|
+
blockInstanceId: string;
|
|
4
|
+
resourceId: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Error codes for synced blocks preloading
|
|
8
|
+
* Used for tracking and monitoring errors during SSR preload phase
|
|
9
|
+
*/
|
|
10
|
+
export declare const SyncedBlocksSSRErrorCodeMap: {
|
|
11
|
+
/**
|
|
12
|
+
* Occurs when the fetch operation returns fewer results than requested.
|
|
13
|
+
* This indicates incomplete data retrieval or potential data loss.
|
|
14
|
+
* Included in error: list of missing block identifiers
|
|
15
|
+
*/
|
|
16
|
+
readonly FETCH_INCOMPLETE: "SYNCED_BLOCKS_FETCH_INCOMPLETE";
|
|
17
|
+
/**
|
|
18
|
+
* Occurs when the batch fetch operation throws an error during execution.
|
|
19
|
+
* This indicates a network error, timeout, or API failure.
|
|
20
|
+
* Included in error: resource IDs that failed to fetch
|
|
21
|
+
*/
|
|
22
|
+
readonly BATCH_FETCH_FAILED: "SYNCED_BLOCKS_BATCH_FETCH_FAILED";
|
|
23
|
+
/**
|
|
24
|
+
* Occurs when the fetch operation times out without returning results.
|
|
25
|
+
* This is specific to the bulk fetch operation with a configurable timeout.
|
|
26
|
+
*/
|
|
27
|
+
readonly FETCH_TIMEOUT: "SYNCED_BLOCKS_FETCH_TIMEOUT";
|
|
28
|
+
};
|
|
29
|
+
export type SyncedBlocksSSRErrorCode = (typeof SyncedBlocksSSRErrorCodeMap)[keyof typeof SyncedBlocksSSRErrorCodeMap];
|
|
30
|
+
/**
|
|
31
|
+
* This is the metadata structure for SSR errors stored in the window object.
|
|
32
|
+
*/
|
|
33
|
+
export type SyncedBlocksSSRErrorMetadata = {
|
|
34
|
+
cloudId?: string;
|
|
35
|
+
code: SyncedBlocksSSRErrorCode;
|
|
36
|
+
contentId?: string;
|
|
37
|
+
errorMessage?: string;
|
|
38
|
+
errorName?: string;
|
|
39
|
+
identifiers?: BlockNodeIdentifiers[];
|
|
40
|
+
isBlog?: boolean;
|
|
41
|
+
missingIdentifiers?: BlockNodeIdentifiers[];
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Fire analytics event for the first unprocessed SSR error that occurred during page rendering.
|
|
45
|
+
* This function only runs ONCE per browser session to avoid duplicate analytics events.
|
|
46
|
+
*
|
|
47
|
+
* @param fireAnalyticsEvent - Function to fire analytics events
|
|
48
|
+
*/
|
|
49
|
+
export declare const handleSSRErrorsAnalytics: (fireAnalyticsEvent?: (event: SyncedBlockSSRErrorAEP) => void) => void;
|
|
50
|
+
export {};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { BodiedSyncBlockSharedCssClassName, SyncBlockSharedCssClassName, SyncBlockLabelSharedCssClassName, SyncBlockStateCssClassName, SyncBlockRendererDataAttributeName, } from './styles/shared/sync-block';
|
|
2
2
|
export { SyncBlockActionsProvider, useSyncBlockActions, } from './sync-block/SyncBlockActionsContext';
|
|
3
|
+
export type { SyncedBlocksSSRErrorMetadata, SyncedBlocksSSRErrorCode, } from './sync-block/ssr_error';
|
|
4
|
+
export { handleSSRErrorsAnalytics, SyncedBlocksSSRErrorCodeMap } from './sync-block/ssr_error';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "111.
|
|
3
|
+
"version": "111.18.0",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@atlaskit/media-picker": "^70.1.0",
|
|
64
64
|
"@atlaskit/media-ui": "^28.7.0",
|
|
65
65
|
"@atlaskit/media-viewer": "^52.8.0",
|
|
66
|
-
"@atlaskit/mention": "^24.
|
|
66
|
+
"@atlaskit/mention": "^24.5.0",
|
|
67
67
|
"@atlaskit/menu": "^8.4.0",
|
|
68
68
|
"@atlaskit/onboarding": "^14.5.0",
|
|
69
69
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|