@atlaskit/editor-synced-block-renderer 5.8.4 → 5.8.5
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 +8 -0
- package/dist/cjs/ui/SyncedBlockErrorComponent.js +17 -0
- package/dist/cjs/ui/SyncedBlockNodeComponentRenderer.js +14 -6
- package/dist/es2019/ui/SyncedBlockErrorComponent.js +18 -1
- package/dist/es2019/ui/SyncedBlockNodeComponentRenderer.js +14 -6
- package/dist/esm/ui/SyncedBlockErrorComponent.js +18 -1
- package/dist/esm/ui/SyncedBlockNodeComponentRenderer.js +14 -6
- package/package.json +9 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-renderer
|
|
2
2
|
|
|
3
|
+
## 5.8.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`e794387202d1b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e794387202d1b) -
|
|
8
|
+
EDITOR-4824 add analytics event whenever sync block error component is first shown
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 5.8.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -6,9 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.SyncedBlockErrorComponent = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
9
10
|
var _monitoring = require("@atlaskit/editor-common/monitoring");
|
|
10
11
|
var _syncBlock = require("@atlaskit/editor-common/sync-block");
|
|
11
12
|
var _editorSyncedBlockProvider = require("@atlaskit/editor-synced-block-provider");
|
|
13
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
14
|
var _SyncedBlockGenericError = require("./SyncedBlockGenericError");
|
|
13
15
|
var _SyncedBlockLoadError = require("./SyncedBlockLoadError");
|
|
14
16
|
var _SyncedBlockNotFoundError = require("./SyncedBlockNotFoundError");
|
|
@@ -43,6 +45,21 @@ var SyncedBlockErrorComponent = exports.SyncedBlockErrorComponent = function Syn
|
|
|
43
45
|
resourceId = _ref.resourceId,
|
|
44
46
|
fireAnalyticsEvent = _ref.fireAnalyticsEvent,
|
|
45
47
|
sourceURL = _ref.sourceURL;
|
|
48
|
+
(0, _react.useEffect)(function () {
|
|
49
|
+
if (!(0, _platformFeatureFlags.fg)('platform_synced_block_patch_3')) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 || fireAnalyticsEvent({
|
|
53
|
+
action: _analytics.ACTION.ERROR,
|
|
54
|
+
actionSubject: _analytics.ACTION_SUBJECT.SYNCED_BLOCK,
|
|
55
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.SYNCED_BLOCK_FETCH,
|
|
56
|
+
attributes: {
|
|
57
|
+
error: "".concat((error === null || error === void 0 ? void 0 : error.reason) || (error === null || error === void 0 ? void 0 : error.type), ": error component rendered"),
|
|
58
|
+
resourceId: resourceId
|
|
59
|
+
},
|
|
60
|
+
eventType: _analytics.EVENT_TYPE.OPERATIONAL
|
|
61
|
+
});
|
|
62
|
+
}, [error === null || error === void 0 ? void 0 : error.reason, error === null || error === void 0 ? void 0 : error.type, resourceId, fireAnalyticsEvent]);
|
|
46
63
|
var getErrorContent = (0, _react.useMemo)(function () {
|
|
47
64
|
switch (error === null || error === void 0 ? void 0 : error.type) {
|
|
48
65
|
case _editorSyncedBlockProvider.SyncBlockError.Offline:
|
|
@@ -12,6 +12,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
13
13
|
var _syncBlock = require("@atlaskit/editor-common/sync-block");
|
|
14
14
|
var _editorSyncedBlockProvider = require("@atlaskit/editor-synced-block-provider");
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _AKRendererWrapper = require("./AKRendererWrapper");
|
|
16
17
|
var _SyncedBlockErrorComponent = require("./SyncedBlockErrorComponent");
|
|
17
18
|
var _SyncedBlockLoadingState = require("./SyncedBlockLoadingState");
|
|
@@ -19,7 +20,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
19
20
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
21
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
22
|
var SyncedBlockNodeComponentRenderer = exports.SyncedBlockNodeComponentRenderer = function SyncedBlockNodeComponentRenderer(_ref) {
|
|
22
|
-
var _syncBlockInstance$
|
|
23
|
+
var _syncBlockInstance$da4;
|
|
23
24
|
var nodeProps = _ref.nodeProps,
|
|
24
25
|
syncBlockStoreManager = _ref.syncBlockStoreManager,
|
|
25
26
|
rendererOptions = _ref.rendererOptions;
|
|
@@ -60,9 +61,16 @@ var SyncedBlockNodeComponentRenderer = exports.SyncedBlockNodeComponentRenderer
|
|
|
60
61
|
return /*#__PURE__*/_react.default.createElement(_SyncedBlockLoadingState.SyncedBlockLoadingState, null);
|
|
61
62
|
}
|
|
62
63
|
if (!resourceId || syncBlockInstance !== null && syncBlockInstance !== void 0 && syncBlockInstance.error || !(syncBlockInstance !== null && syncBlockInstance !== void 0 && syncBlockInstance.data) || syncBlockInstance.data.status === 'deleted') {
|
|
63
|
-
var _syncBlockInstance$er, _syncBlockInstance$da;
|
|
64
|
+
var _syncBlockInstance$er, _syncBlockInstance$da, _syncBlockInstance$da2, _syncBlockInstance$er2, _syncBlockInstance$da3;
|
|
65
|
+
var errorMessage = (_syncBlockInstance$er = syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : syncBlockInstance.error) !== null && _syncBlockInstance$er !== void 0 ? _syncBlockInstance$er : (syncBlockInstance === null || syncBlockInstance === void 0 || (_syncBlockInstance$da = syncBlockInstance.data) === null || _syncBlockInstance$da === void 0 ? void 0 : _syncBlockInstance$da.status) === 'deleted' ? {
|
|
66
|
+
type: _editorSyncedBlockProvider.SyncBlockError.NotFound,
|
|
67
|
+
reason: (_syncBlockInstance$da2 = syncBlockInstance.data) === null || _syncBlockInstance$da2 === void 0 ? void 0 : _syncBlockInstance$da2.deletionReason
|
|
68
|
+
} : {
|
|
69
|
+
type: _editorSyncedBlockProvider.SyncBlockError.Errored,
|
|
70
|
+
reason: !resourceId ? 'missing resource id' : "missing data for block ".concat(resourceId)
|
|
71
|
+
};
|
|
64
72
|
return /*#__PURE__*/_react.default.createElement(_SyncedBlockErrorComponent.SyncedBlockErrorComponent, {
|
|
65
|
-
error: (_syncBlockInstance$
|
|
73
|
+
error: (0, _platformFeatureFlags.fg)('platform_synced_block_patch_3') ? errorMessage : (_syncBlockInstance$er2 = syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : syncBlockInstance.error) !== null && _syncBlockInstance$er2 !== void 0 ? _syncBlockInstance$er2 : (syncBlockInstance === null || syncBlockInstance === void 0 || (_syncBlockInstance$da3 = syncBlockInstance.data) === null || _syncBlockInstance$da3 === void 0 ? void 0 : _syncBlockInstance$da3.status) === 'deleted' ? {
|
|
66
74
|
type: _editorSyncedBlockProvider.SyncBlockError.NotFound
|
|
67
75
|
} : {
|
|
68
76
|
type: _editorSyncedBlockProvider.SyncBlockError.Errored
|
|
@@ -73,14 +81,14 @@ var SyncedBlockNodeComponentRenderer = exports.SyncedBlockNodeComponentRenderer
|
|
|
73
81
|
fireAnalyticsEvent: fireAnalyticsEvent
|
|
74
82
|
});
|
|
75
83
|
}
|
|
76
|
-
if ((syncBlockInstance === null || syncBlockInstance === void 0 || (_syncBlockInstance$
|
|
77
|
-
var _syncBlockInstance$
|
|
84
|
+
if ((syncBlockInstance === null || syncBlockInstance === void 0 || (_syncBlockInstance$da4 = syncBlockInstance.data) === null || _syncBlockInstance$da4 === void 0 ? void 0 : _syncBlockInstance$da4.status) === 'unpublished') {
|
|
85
|
+
var _syncBlockInstance$da5;
|
|
78
86
|
return /*#__PURE__*/_react.default.createElement(_SyncedBlockErrorComponent.SyncedBlockErrorComponent, {
|
|
79
87
|
error: {
|
|
80
88
|
type: _editorSyncedBlockProvider.SyncBlockError.Unpublished
|
|
81
89
|
},
|
|
82
90
|
resourceId: syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : syncBlockInstance.resourceId,
|
|
83
|
-
sourceURL: (_syncBlockInstance$
|
|
91
|
+
sourceURL: (_syncBlockInstance$da5 = syncBlockInstance.data) === null || _syncBlockInstance$da5 === void 0 ? void 0 : _syncBlockInstance$da5.sourceURL,
|
|
84
92
|
fireAnalyticsEvent: fireAnalyticsEvent
|
|
85
93
|
});
|
|
86
94
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
1
|
+
import React, { useMemo, useEffect } from 'react';
|
|
2
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
3
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
3
4
|
import { SyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
|
|
4
5
|
import { fetchErrorPayload, getContentIdAndProductFromResourceId, SyncBlockError } from '@atlaskit/editor-synced-block-provider';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
7
|
import { SyncedBlockGenericError } from './SyncedBlockGenericError';
|
|
6
8
|
import { SyncedBlockLoadError } from './SyncedBlockLoadError';
|
|
7
9
|
import { SyncedBlockNotFoundError } from './SyncedBlockNotFoundError';
|
|
@@ -37,6 +39,21 @@ export const SyncedBlockErrorComponent = ({
|
|
|
37
39
|
fireAnalyticsEvent,
|
|
38
40
|
sourceURL
|
|
39
41
|
}) => {
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (!fg('platform_synced_block_patch_3')) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 ? void 0 : fireAnalyticsEvent({
|
|
47
|
+
action: ACTION.ERROR,
|
|
48
|
+
actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
|
|
49
|
+
actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_FETCH,
|
|
50
|
+
attributes: {
|
|
51
|
+
error: `${(error === null || error === void 0 ? void 0 : error.reason) || (error === null || error === void 0 ? void 0 : error.type)}: error component rendered`,
|
|
52
|
+
resourceId: resourceId
|
|
53
|
+
},
|
|
54
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
55
|
+
});
|
|
56
|
+
}, [error === null || error === void 0 ? void 0 : error.reason, error === null || error === void 0 ? void 0 : error.type, resourceId, fireAnalyticsEvent]);
|
|
40
57
|
const getErrorContent = useMemo(() => {
|
|
41
58
|
switch (error === null || error === void 0 ? void 0 : error.type) {
|
|
42
59
|
case SyncBlockError.Offline:
|
|
@@ -2,6 +2,7 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
3
3
|
import { SyncBlockSharedCssClassName, SyncBlockRendererDataAttributeName } from '@atlaskit/editor-common/sync-block';
|
|
4
4
|
import { SyncBlockError, useFetchSyncBlockData } from '@atlaskit/editor-synced-block-provider';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { AKRendererWrapper } from './AKRendererWrapper';
|
|
6
7
|
import { SyncedBlockErrorComponent } from './SyncedBlockErrorComponent';
|
|
7
8
|
import { SyncedBlockLoadingState } from './SyncedBlockLoadingState';
|
|
@@ -10,7 +11,7 @@ export const SyncedBlockNodeComponentRenderer = ({
|
|
|
10
11
|
syncBlockStoreManager,
|
|
11
12
|
rendererOptions
|
|
12
13
|
}) => {
|
|
13
|
-
var _syncBlockInstance$
|
|
14
|
+
var _syncBlockInstance$da4;
|
|
14
15
|
const {
|
|
15
16
|
resourceId,
|
|
16
17
|
localId,
|
|
@@ -53,9 +54,16 @@ export const SyncedBlockNodeComponentRenderer = ({
|
|
|
53
54
|
return /*#__PURE__*/React.createElement(SyncedBlockLoadingState, null);
|
|
54
55
|
}
|
|
55
56
|
if (!resourceId || syncBlockInstance !== null && syncBlockInstance !== void 0 && syncBlockInstance.error || !(syncBlockInstance !== null && syncBlockInstance !== void 0 && syncBlockInstance.data) || syncBlockInstance.data.status === 'deleted') {
|
|
56
|
-
var _syncBlockInstance$er, _syncBlockInstance$da;
|
|
57
|
+
var _syncBlockInstance$er, _syncBlockInstance$da, _syncBlockInstance$da2, _syncBlockInstance$er2, _syncBlockInstance$da3;
|
|
58
|
+
const errorMessage = (_syncBlockInstance$er = syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : syncBlockInstance.error) !== null && _syncBlockInstance$er !== void 0 ? _syncBlockInstance$er : (syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : (_syncBlockInstance$da = syncBlockInstance.data) === null || _syncBlockInstance$da === void 0 ? void 0 : _syncBlockInstance$da.status) === 'deleted' ? {
|
|
59
|
+
type: SyncBlockError.NotFound,
|
|
60
|
+
reason: (_syncBlockInstance$da2 = syncBlockInstance.data) === null || _syncBlockInstance$da2 === void 0 ? void 0 : _syncBlockInstance$da2.deletionReason
|
|
61
|
+
} : {
|
|
62
|
+
type: SyncBlockError.Errored,
|
|
63
|
+
reason: !resourceId ? 'missing resource id' : `missing data for block ${resourceId}`
|
|
64
|
+
};
|
|
57
65
|
return /*#__PURE__*/React.createElement(SyncedBlockErrorComponent, {
|
|
58
|
-
error: (_syncBlockInstance$
|
|
66
|
+
error: fg('platform_synced_block_patch_3') ? errorMessage : (_syncBlockInstance$er2 = syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : syncBlockInstance.error) !== null && _syncBlockInstance$er2 !== void 0 ? _syncBlockInstance$er2 : (syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : (_syncBlockInstance$da3 = syncBlockInstance.data) === null || _syncBlockInstance$da3 === void 0 ? void 0 : _syncBlockInstance$da3.status) === 'deleted' ? {
|
|
59
67
|
type: SyncBlockError.NotFound
|
|
60
68
|
} : {
|
|
61
69
|
type: SyncBlockError.Errored
|
|
@@ -66,14 +74,14 @@ export const SyncedBlockNodeComponentRenderer = ({
|
|
|
66
74
|
fireAnalyticsEvent: fireAnalyticsEvent
|
|
67
75
|
});
|
|
68
76
|
}
|
|
69
|
-
if ((syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : (_syncBlockInstance$
|
|
70
|
-
var _syncBlockInstance$
|
|
77
|
+
if ((syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : (_syncBlockInstance$da4 = syncBlockInstance.data) === null || _syncBlockInstance$da4 === void 0 ? void 0 : _syncBlockInstance$da4.status) === 'unpublished') {
|
|
78
|
+
var _syncBlockInstance$da5;
|
|
71
79
|
return /*#__PURE__*/React.createElement(SyncedBlockErrorComponent, {
|
|
72
80
|
error: {
|
|
73
81
|
type: SyncBlockError.Unpublished
|
|
74
82
|
},
|
|
75
83
|
resourceId: syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : syncBlockInstance.resourceId,
|
|
76
|
-
sourceURL: (_syncBlockInstance$
|
|
84
|
+
sourceURL: (_syncBlockInstance$da5 = syncBlockInstance.data) === null || _syncBlockInstance$da5 === void 0 ? void 0 : _syncBlockInstance$da5.sourceURL,
|
|
77
85
|
fireAnalyticsEvent: fireAnalyticsEvent
|
|
78
86
|
});
|
|
79
87
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
1
|
+
import React, { useMemo, useEffect } from 'react';
|
|
2
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
3
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
3
4
|
import { SyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
|
|
4
5
|
import { fetchErrorPayload, getContentIdAndProductFromResourceId, SyncBlockError } from '@atlaskit/editor-synced-block-provider';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
7
|
import { SyncedBlockGenericError } from './SyncedBlockGenericError';
|
|
6
8
|
import { SyncedBlockLoadError } from './SyncedBlockLoadError';
|
|
7
9
|
import { SyncedBlockNotFoundError } from './SyncedBlockNotFoundError';
|
|
@@ -35,6 +37,21 @@ export var SyncedBlockErrorComponent = function SyncedBlockErrorComponent(_ref)
|
|
|
35
37
|
resourceId = _ref.resourceId,
|
|
36
38
|
fireAnalyticsEvent = _ref.fireAnalyticsEvent,
|
|
37
39
|
sourceURL = _ref.sourceURL;
|
|
40
|
+
useEffect(function () {
|
|
41
|
+
if (!fg('platform_synced_block_patch_3')) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 || fireAnalyticsEvent({
|
|
45
|
+
action: ACTION.ERROR,
|
|
46
|
+
actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
|
|
47
|
+
actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_FETCH,
|
|
48
|
+
attributes: {
|
|
49
|
+
error: "".concat((error === null || error === void 0 ? void 0 : error.reason) || (error === null || error === void 0 ? void 0 : error.type), ": error component rendered"),
|
|
50
|
+
resourceId: resourceId
|
|
51
|
+
},
|
|
52
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
53
|
+
});
|
|
54
|
+
}, [error === null || error === void 0 ? void 0 : error.reason, error === null || error === void 0 ? void 0 : error.type, resourceId, fireAnalyticsEvent]);
|
|
38
55
|
var getErrorContent = useMemo(function () {
|
|
39
56
|
switch (error === null || error === void 0 ? void 0 : error.type) {
|
|
40
57
|
case SyncBlockError.Offline:
|
|
@@ -6,11 +6,12 @@ import React, { useMemo } from 'react';
|
|
|
6
6
|
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
7
7
|
import { SyncBlockSharedCssClassName, SyncBlockRendererDataAttributeName } from '@atlaskit/editor-common/sync-block';
|
|
8
8
|
import { SyncBlockError, useFetchSyncBlockData } from '@atlaskit/editor-synced-block-provider';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
10
|
import { AKRendererWrapper } from './AKRendererWrapper';
|
|
10
11
|
import { SyncedBlockErrorComponent } from './SyncedBlockErrorComponent';
|
|
11
12
|
import { SyncedBlockLoadingState } from './SyncedBlockLoadingState';
|
|
12
13
|
export var SyncedBlockNodeComponentRenderer = function SyncedBlockNodeComponentRenderer(_ref) {
|
|
13
|
-
var _syncBlockInstance$
|
|
14
|
+
var _syncBlockInstance$da4;
|
|
14
15
|
var nodeProps = _ref.nodeProps,
|
|
15
16
|
syncBlockStoreManager = _ref.syncBlockStoreManager,
|
|
16
17
|
rendererOptions = _ref.rendererOptions;
|
|
@@ -51,9 +52,16 @@ export var SyncedBlockNodeComponentRenderer = function SyncedBlockNodeComponentR
|
|
|
51
52
|
return /*#__PURE__*/React.createElement(SyncedBlockLoadingState, null);
|
|
52
53
|
}
|
|
53
54
|
if (!resourceId || syncBlockInstance !== null && syncBlockInstance !== void 0 && syncBlockInstance.error || !(syncBlockInstance !== null && syncBlockInstance !== void 0 && syncBlockInstance.data) || syncBlockInstance.data.status === 'deleted') {
|
|
54
|
-
var _syncBlockInstance$er, _syncBlockInstance$da;
|
|
55
|
+
var _syncBlockInstance$er, _syncBlockInstance$da, _syncBlockInstance$da2, _syncBlockInstance$er2, _syncBlockInstance$da3;
|
|
56
|
+
var errorMessage = (_syncBlockInstance$er = syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : syncBlockInstance.error) !== null && _syncBlockInstance$er !== void 0 ? _syncBlockInstance$er : (syncBlockInstance === null || syncBlockInstance === void 0 || (_syncBlockInstance$da = syncBlockInstance.data) === null || _syncBlockInstance$da === void 0 ? void 0 : _syncBlockInstance$da.status) === 'deleted' ? {
|
|
57
|
+
type: SyncBlockError.NotFound,
|
|
58
|
+
reason: (_syncBlockInstance$da2 = syncBlockInstance.data) === null || _syncBlockInstance$da2 === void 0 ? void 0 : _syncBlockInstance$da2.deletionReason
|
|
59
|
+
} : {
|
|
60
|
+
type: SyncBlockError.Errored,
|
|
61
|
+
reason: !resourceId ? 'missing resource id' : "missing data for block ".concat(resourceId)
|
|
62
|
+
};
|
|
55
63
|
return /*#__PURE__*/React.createElement(SyncedBlockErrorComponent, {
|
|
56
|
-
error: (_syncBlockInstance$
|
|
64
|
+
error: fg('platform_synced_block_patch_3') ? errorMessage : (_syncBlockInstance$er2 = syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : syncBlockInstance.error) !== null && _syncBlockInstance$er2 !== void 0 ? _syncBlockInstance$er2 : (syncBlockInstance === null || syncBlockInstance === void 0 || (_syncBlockInstance$da3 = syncBlockInstance.data) === null || _syncBlockInstance$da3 === void 0 ? void 0 : _syncBlockInstance$da3.status) === 'deleted' ? {
|
|
57
65
|
type: SyncBlockError.NotFound
|
|
58
66
|
} : {
|
|
59
67
|
type: SyncBlockError.Errored
|
|
@@ -64,14 +72,14 @@ export var SyncedBlockNodeComponentRenderer = function SyncedBlockNodeComponentR
|
|
|
64
72
|
fireAnalyticsEvent: fireAnalyticsEvent
|
|
65
73
|
});
|
|
66
74
|
}
|
|
67
|
-
if ((syncBlockInstance === null || syncBlockInstance === void 0 || (_syncBlockInstance$
|
|
68
|
-
var _syncBlockInstance$
|
|
75
|
+
if ((syncBlockInstance === null || syncBlockInstance === void 0 || (_syncBlockInstance$da4 = syncBlockInstance.data) === null || _syncBlockInstance$da4 === void 0 ? void 0 : _syncBlockInstance$da4.status) === 'unpublished') {
|
|
76
|
+
var _syncBlockInstance$da5;
|
|
69
77
|
return /*#__PURE__*/React.createElement(SyncedBlockErrorComponent, {
|
|
70
78
|
error: {
|
|
71
79
|
type: SyncBlockError.Unpublished
|
|
72
80
|
},
|
|
73
81
|
resourceId: syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : syncBlockInstance.resourceId,
|
|
74
|
-
sourceURL: (_syncBlockInstance$
|
|
82
|
+
sourceURL: (_syncBlockInstance$da5 = syncBlockInstance.data) === null || _syncBlockInstance$da5 === void 0 ? void 0 : _syncBlockInstance$da5.sourceURL,
|
|
75
83
|
fireAnalyticsEvent: fireAnalyticsEvent
|
|
76
84
|
});
|
|
77
85
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-synced-block-renderer",
|
|
3
|
-
"version": "5.8.
|
|
3
|
+
"version": "5.8.5",
|
|
4
4
|
"description": "SyncedBlockRenderer for @atlaskit/editor-plugin-synced-block",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
"@atlaskit/button": "^23.9.0",
|
|
32
32
|
"@atlaskit/css": "^0.19.0",
|
|
33
33
|
"@atlaskit/editor-plugin-synced-block": "^5.3.0",
|
|
34
|
-
"@atlaskit/editor-synced-block-provider": "^3.
|
|
34
|
+
"@atlaskit/editor-synced-block-provider": "^3.30.0",
|
|
35
35
|
"@atlaskit/heading": "^5.3.0",
|
|
36
36
|
"@atlaskit/icon": "^31.0.0",
|
|
37
37
|
"@atlaskit/icon-lab": "^5.16.0",
|
|
38
38
|
"@atlaskit/image": "^3.0.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
40
40
|
"@atlaskit/primitives": "^18.0.0",
|
|
41
|
-
"@atlaskit/renderer": "^126.
|
|
41
|
+
"@atlaskit/renderer": "^126.9.0",
|
|
42
42
|
"@atlaskit/spinner": "^19.0.0",
|
|
43
43
|
"@atlaskit/tokens": "^11.0.0",
|
|
44
44
|
"@atlaskit/tooltip": "^20.14.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"relay-runtime": "npm:atl-relay-runtime@0.0.0-main-39e79f66"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@atlaskit/editor-common": "^111.
|
|
51
|
+
"@atlaskit/editor-common": "^111.16.0",
|
|
52
52
|
"react": "^18.2.0",
|
|
53
53
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
54
54
|
},
|
|
@@ -87,5 +87,10 @@
|
|
|
87
87
|
"import-no-extraneous-disable-for-examples-and-docs"
|
|
88
88
|
]
|
|
89
89
|
}
|
|
90
|
+
},
|
|
91
|
+
"platform-feature-flags": {
|
|
92
|
+
"platform_synced_block_patch_3": {
|
|
93
|
+
"type": "boolean"
|
|
94
|
+
}
|
|
90
95
|
}
|
|
91
96
|
}
|