@atlaskit/editor-synced-block-renderer 12.0.0 → 12.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 +8 -0
- package/afm-cc/tsconfig.json +0 -3
- package/afm-products/tsconfig.json +0 -3
- package/dist/cjs/ui/SyncedBlockErrorComponent.js +1 -4
- package/dist/cjs/useSyncedBlockNodeComponent.js +3 -9
- package/dist/es2019/ui/SyncedBlockErrorComponent.js +1 -4
- package/dist/es2019/useSyncedBlockNodeComponent.js +3 -9
- package/dist/esm/ui/SyncedBlockErrorComponent.js +1 -4
- package/dist/esm/useSyncedBlockNodeComponent.js +3 -9
- package/package.json +4 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-renderer
|
|
2
2
|
|
|
3
|
+
## 12.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0b4753c0a8c07`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0b4753c0a8c07) -
|
|
8
|
+
Clean up feature gates from completed rollout
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 12.0.0
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -11,7 +11,6 @@ var _syncBlock = require("@atlaskit/editor-common/sync-block");
|
|
|
11
11
|
var _editorSyncedBlockProvider = require("@atlaskit/editor-synced-block-provider");
|
|
12
12
|
var _errorHandling = require("@atlaskit/editor-synced-block-provider/errorHandling");
|
|
13
13
|
var _utils = require("@atlaskit/editor-synced-block-provider/utils");
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
var _SyncedBlockEntityNotFoundError = require("./SyncedBlockEntityNotFoundError");
|
|
16
15
|
var _SyncedBlockGenericError = require("./SyncedBlockGenericError");
|
|
17
16
|
var _SyncedBlockLoadError = require("./SyncedBlockLoadError");
|
|
@@ -54,10 +53,8 @@ var SyncedBlockErrorComponent = exports.SyncedBlockErrorComponent = function Syn
|
|
|
54
53
|
// Emit structured attribution via the shared builder instead of an opaque
|
|
55
54
|
// `errored`-only blob. Prefer the PII-safe `originalMessage` so the classifier
|
|
56
55
|
// can bucket the real cause; fall back to `reason` then the bare `type`.
|
|
57
|
-
// Gate-off is a no-op (builder returns undefined → no new attributes).
|
|
58
|
-
var gateEnabled = (0, _platformFeatureFlags.fg)('platform_editor_blocks_patch_4');
|
|
59
56
|
var rawError = (error === null || error === void 0 ? void 0 : error.originalMessage) || (error === null || error === void 0 ? void 0 : error.reason) || (error === null || error === void 0 ? void 0 : error.type) || 'unknown';
|
|
60
|
-
fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 || fireAnalyticsEvent((0, _editorSyncedBlockProvider.fetchErrorPayload)("".concat(rawError, ": error component rendered"), resourceId, (0, _utils.getSourceProductFromResourceIdSafe)(resourceId), (0, _errorHandling.buildFetchErrorAttribution)(
|
|
57
|
+
fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 || fireAnalyticsEvent((0, _editorSyncedBlockProvider.fetchErrorPayload)("".concat(rawError, ": error component rendered"), resourceId, (0, _utils.getSourceProductFromResourceIdSafe)(resourceId), (0, _errorHandling.buildFetchErrorAttribution)(rawError, error === null || error === void 0 ? void 0 : error.statusCode)));
|
|
61
58
|
}, [error === null || error === void 0 ? void 0 : error.originalMessage, error === null || error === void 0 ? void 0 : error.reason, error === null || error === void 0 ? void 0 : error.type, error === null || error === void 0 ? void 0 : error.statusCode, resourceId, fireAnalyticsEvent]);
|
|
62
59
|
var getErrorContent = (0, _react.useMemo)(function () {
|
|
63
60
|
switch (error === null || error === void 0 ? void 0 : error.type) {
|
|
@@ -10,7 +10,6 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
10
10
|
var _errorBoundary = require("@atlaskit/editor-common/error-boundary");
|
|
11
11
|
var _syncBlock = require("@atlaskit/editor-common/sync-block");
|
|
12
12
|
var _editorSyncedBlockProvider = require("@atlaskit/editor-synced-block-provider");
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _SyncedBlockNodeComponentRenderer = require("./ui/SyncedBlockNodeComponentRenderer");
|
|
15
14
|
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); }
|
|
16
15
|
var getSyncBlockNodesFromDoc = exports.getSyncBlockNodesFromDoc = function getSyncBlockNodesFromDoc(doc) {
|
|
@@ -46,18 +45,13 @@ var useMemoizedSyncedBlockNodeComponent = exports.useMemoizedSyncedBlockNodeComp
|
|
|
46
45
|
|
|
47
46
|
// Initial fetch sync block data (will use SSR data as initial cache, or the prefetched data if available)
|
|
48
47
|
(0, _react.useEffect)(function () {
|
|
48
|
+
var _syncBlockStoreManage, _syncBlockStoreManage2, _syncBlockStoreManage3;
|
|
49
49
|
// On Jira the data provider resolves asynchronously (and is nulled on
|
|
50
50
|
// `destroy()`), so an eager fetch can throw `Data provider not set`
|
|
51
51
|
// (EDITOR-7860). Skip until ready; the effect re-runs (referenceManager
|
|
52
52
|
// identity changes) once the provider resolves, fetching exactly once.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// gate exposure is tracked (@atlaskit/platform/no-preconditioning).
|
|
56
|
-
if ((0, _platformFeatureFlags.fg)('platform_editor_blocks_patch_3')) {
|
|
57
|
-
var _syncBlockStoreManage, _syncBlockStoreManage2, _syncBlockStoreManage3;
|
|
58
|
-
if (!((_syncBlockStoreManage = (_syncBlockStoreManage2 = (_syncBlockStoreManage3 = syncBlockStoreManager.referenceManager).hasDataProvider) === null || _syncBlockStoreManage2 === void 0 ? void 0 : _syncBlockStoreManage2.call(_syncBlockStoreManage3)) !== null && _syncBlockStoreManage !== void 0 ? _syncBlockStoreManage : false)) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
53
|
+
if (!((_syncBlockStoreManage = (_syncBlockStoreManage2 = (_syncBlockStoreManage3 = syncBlockStoreManager.referenceManager).hasDataProvider) === null || _syncBlockStoreManage2 === void 0 ? void 0 : _syncBlockStoreManage2.call(_syncBlockStoreManage3)) !== null && _syncBlockStoreManage !== void 0 ? _syncBlockStoreManage : false)) {
|
|
54
|
+
return;
|
|
61
55
|
}
|
|
62
56
|
syncBlockStoreManager.referenceManager.fetchSyncBlocksData(syncBlockNodes);
|
|
63
57
|
}, [syncBlockNodes, syncBlockStoreManager.referenceManager]);
|
|
@@ -4,7 +4,6 @@ import { SyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block'
|
|
|
4
4
|
import { fetchErrorPayload, getContentIdAndProductFromResourceId, SyncBlockError } from '@atlaskit/editor-synced-block-provider';
|
|
5
5
|
import { buildFetchErrorAttribution } from '@atlaskit/editor-synced-block-provider/errorHandling';
|
|
6
6
|
import { getSourceProductFromResourceIdSafe } from '@atlaskit/editor-synced-block-provider/utils';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { SyncedBlockEntityNotFoundError } from './SyncedBlockEntityNotFoundError';
|
|
9
8
|
import { SyncedBlockGenericError } from './SyncedBlockGenericError';
|
|
10
9
|
import { SyncedBlockLoadError } from './SyncedBlockLoadError';
|
|
@@ -48,10 +47,8 @@ export const SyncedBlockErrorComponent = ({
|
|
|
48
47
|
// Emit structured attribution via the shared builder instead of an opaque
|
|
49
48
|
// `errored`-only blob. Prefer the PII-safe `originalMessage` so the classifier
|
|
50
49
|
// can bucket the real cause; fall back to `reason` then the bare `type`.
|
|
51
|
-
// Gate-off is a no-op (builder returns undefined → no new attributes).
|
|
52
|
-
const gateEnabled = fg('platform_editor_blocks_patch_4');
|
|
53
50
|
const rawError = (error === null || error === void 0 ? void 0 : error.originalMessage) || (error === null || error === void 0 ? void 0 : error.reason) || (error === null || error === void 0 ? void 0 : error.type) || 'unknown';
|
|
54
|
-
fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 ? void 0 : fireAnalyticsEvent(fetchErrorPayload(`${rawError}: error component rendered`, resourceId, getSourceProductFromResourceIdSafe(resourceId), buildFetchErrorAttribution(
|
|
51
|
+
fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 ? void 0 : fireAnalyticsEvent(fetchErrorPayload(`${rawError}: error component rendered`, resourceId, getSourceProductFromResourceIdSafe(resourceId), buildFetchErrorAttribution(rawError, error === null || error === void 0 ? void 0 : error.statusCode)));
|
|
55
52
|
}, [error === null || error === void 0 ? void 0 : error.originalMessage, error === null || error === void 0 ? void 0 : error.reason, error === null || error === void 0 ? void 0 : error.type, error === null || error === void 0 ? void 0 : error.statusCode, resourceId, fireAnalyticsEvent]);
|
|
56
53
|
const getErrorContent = useMemo(() => {
|
|
57
54
|
switch (error === null || error === void 0 ? void 0 : error.type) {
|
|
@@ -3,7 +3,6 @@ import { ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
4
4
|
import { SyncBlockActionsProvider } from '@atlaskit/editor-common/sync-block';
|
|
5
5
|
import { convertSyncBlockJSONNodeToSyncBlockNode, useMemoizedSyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { SyncedBlockNodeComponentRenderer } from './ui/SyncedBlockNodeComponentRenderer';
|
|
8
7
|
export const getSyncBlockNodesFromDoc = doc => {
|
|
9
8
|
const {
|
|
@@ -37,18 +36,13 @@ export const useMemoizedSyncedBlockNodeComponent = ({
|
|
|
37
36
|
|
|
38
37
|
// Initial fetch sync block data (will use SSR data as initial cache, or the prefetched data if available)
|
|
39
38
|
useEffect(() => {
|
|
39
|
+
var _syncBlockStoreManage, _syncBlockStoreManage2, _syncBlockStoreManage3;
|
|
40
40
|
// On Jira the data provider resolves asynchronously (and is nulled on
|
|
41
41
|
// `destroy()`), so an eager fetch can throw `Data provider not set`
|
|
42
42
|
// (EDITOR-7860). Skip until ready; the effect re-runs (referenceManager
|
|
43
43
|
// identity changes) once the provider resolves, fetching exactly once.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// gate exposure is tracked (@atlaskit/platform/no-preconditioning).
|
|
47
|
-
if (fg('platform_editor_blocks_patch_3')) {
|
|
48
|
-
var _syncBlockStoreManage, _syncBlockStoreManage2, _syncBlockStoreManage3;
|
|
49
|
-
if (!((_syncBlockStoreManage = (_syncBlockStoreManage2 = (_syncBlockStoreManage3 = syncBlockStoreManager.referenceManager).hasDataProvider) === null || _syncBlockStoreManage2 === void 0 ? void 0 : _syncBlockStoreManage2.call(_syncBlockStoreManage3)) !== null && _syncBlockStoreManage !== void 0 ? _syncBlockStoreManage : false)) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
44
|
+
if (!((_syncBlockStoreManage = (_syncBlockStoreManage2 = (_syncBlockStoreManage3 = syncBlockStoreManager.referenceManager).hasDataProvider) === null || _syncBlockStoreManage2 === void 0 ? void 0 : _syncBlockStoreManage2.call(_syncBlockStoreManage3)) !== null && _syncBlockStoreManage !== void 0 ? _syncBlockStoreManage : false)) {
|
|
45
|
+
return;
|
|
52
46
|
}
|
|
53
47
|
syncBlockStoreManager.referenceManager.fetchSyncBlocksData(syncBlockNodes);
|
|
54
48
|
}, [syncBlockNodes, syncBlockStoreManager.referenceManager]);
|
|
@@ -4,7 +4,6 @@ import { SyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block'
|
|
|
4
4
|
import { fetchErrorPayload, getContentIdAndProductFromResourceId, SyncBlockError } from '@atlaskit/editor-synced-block-provider';
|
|
5
5
|
import { buildFetchErrorAttribution } from '@atlaskit/editor-synced-block-provider/errorHandling';
|
|
6
6
|
import { getSourceProductFromResourceIdSafe } from '@atlaskit/editor-synced-block-provider/utils';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { SyncedBlockEntityNotFoundError } from './SyncedBlockEntityNotFoundError';
|
|
9
8
|
import { SyncedBlockGenericError } from './SyncedBlockGenericError';
|
|
10
9
|
import { SyncedBlockLoadError } from './SyncedBlockLoadError';
|
|
@@ -46,10 +45,8 @@ export var SyncedBlockErrorComponent = function SyncedBlockErrorComponent(_ref)
|
|
|
46
45
|
// Emit structured attribution via the shared builder instead of an opaque
|
|
47
46
|
// `errored`-only blob. Prefer the PII-safe `originalMessage` so the classifier
|
|
48
47
|
// can bucket the real cause; fall back to `reason` then the bare `type`.
|
|
49
|
-
// Gate-off is a no-op (builder returns undefined → no new attributes).
|
|
50
|
-
var gateEnabled = fg('platform_editor_blocks_patch_4');
|
|
51
48
|
var rawError = (error === null || error === void 0 ? void 0 : error.originalMessage) || (error === null || error === void 0 ? void 0 : error.reason) || (error === null || error === void 0 ? void 0 : error.type) || 'unknown';
|
|
52
|
-
fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 || fireAnalyticsEvent(fetchErrorPayload("".concat(rawError, ": error component rendered"), resourceId, getSourceProductFromResourceIdSafe(resourceId), buildFetchErrorAttribution(
|
|
49
|
+
fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 || fireAnalyticsEvent(fetchErrorPayload("".concat(rawError, ": error component rendered"), resourceId, getSourceProductFromResourceIdSafe(resourceId), buildFetchErrorAttribution(rawError, error === null || error === void 0 ? void 0 : error.statusCode)));
|
|
53
50
|
}, [error === null || error === void 0 ? void 0 : error.originalMessage, error === null || error === void 0 ? void 0 : error.reason, error === null || error === void 0 ? void 0 : error.type, error === null || error === void 0 ? void 0 : error.statusCode, resourceId, fireAnalyticsEvent]);
|
|
54
51
|
var getErrorContent = useMemo(function () {
|
|
55
52
|
switch (error === null || error === void 0 ? void 0 : error.type) {
|
|
@@ -3,7 +3,6 @@ import { ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
4
4
|
import { SyncBlockActionsProvider } from '@atlaskit/editor-common/sync-block';
|
|
5
5
|
import { convertSyncBlockJSONNodeToSyncBlockNode, useMemoizedSyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { SyncedBlockNodeComponentRenderer } from './ui/SyncedBlockNodeComponentRenderer';
|
|
8
7
|
export var getSyncBlockNodesFromDoc = function getSyncBlockNodesFromDoc(doc) {
|
|
9
8
|
var content = doc.content;
|
|
@@ -38,18 +37,13 @@ export var useMemoizedSyncedBlockNodeComponent = function useMemoizedSyncedBlock
|
|
|
38
37
|
|
|
39
38
|
// Initial fetch sync block data (will use SSR data as initial cache, or the prefetched data if available)
|
|
40
39
|
useEffect(function () {
|
|
40
|
+
var _syncBlockStoreManage, _syncBlockStoreManage2, _syncBlockStoreManage3;
|
|
41
41
|
// On Jira the data provider resolves asynchronously (and is nulled on
|
|
42
42
|
// `destroy()`), so an eager fetch can throw `Data provider not set`
|
|
43
43
|
// (EDITOR-7860). Skip until ready; the effect re-runs (referenceManager
|
|
44
44
|
// identity changes) once the provider resolves, fetching exactly once.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
// gate exposure is tracked (@atlaskit/platform/no-preconditioning).
|
|
48
|
-
if (fg('platform_editor_blocks_patch_3')) {
|
|
49
|
-
var _syncBlockStoreManage, _syncBlockStoreManage2, _syncBlockStoreManage3;
|
|
50
|
-
if (!((_syncBlockStoreManage = (_syncBlockStoreManage2 = (_syncBlockStoreManage3 = syncBlockStoreManager.referenceManager).hasDataProvider) === null || _syncBlockStoreManage2 === void 0 ? void 0 : _syncBlockStoreManage2.call(_syncBlockStoreManage3)) !== null && _syncBlockStoreManage !== void 0 ? _syncBlockStoreManage : false)) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
45
|
+
if (!((_syncBlockStoreManage = (_syncBlockStoreManage2 = (_syncBlockStoreManage3 = syncBlockStoreManager.referenceManager).hasDataProvider) === null || _syncBlockStoreManage2 === void 0 ? void 0 : _syncBlockStoreManage2.call(_syncBlockStoreManage3)) !== null && _syncBlockStoreManage !== void 0 ? _syncBlockStoreManage : false)) {
|
|
46
|
+
return;
|
|
53
47
|
}
|
|
54
48
|
syncBlockStoreManager.referenceManager.fetchSyncBlocksData(syncBlockNodes);
|
|
55
49
|
}, [syncBlockNodes, syncBlockStoreManager.referenceManager]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-synced-block-renderer",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.1",
|
|
4
4
|
"description": "SyncedBlockRenderer for @atlaskit/editor-plugin-synced-block",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,12 +38,11 @@
|
|
|
38
38
|
"@atlaskit/icon": "^37.3.0",
|
|
39
39
|
"@atlaskit/icon-lab": "^7.5.0",
|
|
40
40
|
"@atlaskit/image": "^5.0.0",
|
|
41
|
-
"@atlaskit/platform-feature-flags": "^2.1.0",
|
|
42
41
|
"@atlaskit/primitives": "^22.2.0",
|
|
43
42
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
44
43
|
"@atlaskit/renderer": "^135.0.0",
|
|
45
44
|
"@atlaskit/spinner": "^20.1.0",
|
|
46
|
-
"@atlaskit/tokens": "^16.
|
|
45
|
+
"@atlaskit/tokens": "^16.5.0",
|
|
47
46
|
"@atlaskit/tooltip": "^24.0.0",
|
|
48
47
|
"@babel/runtime": "^7.0.0",
|
|
49
48
|
"@compiled/react": "^1.0.0",
|
|
@@ -51,7 +50,7 @@
|
|
|
51
50
|
"relay-runtime": "^20.1.1"
|
|
52
51
|
},
|
|
53
52
|
"peerDependencies": {
|
|
54
|
-
"@atlaskit/editor-common": "^118.
|
|
53
|
+
"@atlaskit/editor-common": "^118.2.0",
|
|
55
54
|
"react": "^18.2.0 || ^19.2.0",
|
|
56
55
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
57
56
|
},
|
|
@@ -93,14 +92,5 @@
|
|
|
93
92
|
]
|
|
94
93
|
}
|
|
95
94
|
},
|
|
96
|
-
"platform-feature-flags": {
|
|
97
|
-
"platform_editor_blocks_patch_3": {
|
|
98
|
-
"type": "boolean",
|
|
99
|
-
"referenceOnly": true
|
|
100
|
-
},
|
|
101
|
-
"platform_editor_blocks_patch_4": {
|
|
102
|
-
"type": "boolean",
|
|
103
|
-
"referenceOnly": true
|
|
104
|
-
}
|
|
105
|
-
}
|
|
95
|
+
"platform-feature-flags": {}
|
|
106
96
|
}
|