@atlaskit/editor-synced-block-renderer 5.2.0 → 5.2.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/dist/cjs/useSyncedBlockNodeComponent.js +13 -2
- package/dist/es2019/useSyncedBlockNodeComponent.js +13 -2
- package/dist/esm/useSyncedBlockNodeComponent.js +13 -2
- package/dist/types/useSyncedBlockNodeComponent.d.ts +2 -2
- package/dist/types-ts4.5/useSyncedBlockNodeComponent.d.ts +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-renderer
|
|
2
2
|
|
|
3
|
+
## 5.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1f4c761b661e1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1f4c761b661e1) -
|
|
8
|
+
[ux] EDITOR-4174 wrap synced block and bodied sync block with sentry error boundaries
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 5.2.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.useMemoizedSyncedBlockNodeComponent = exports.getSyncBlockNodesFromDoc = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
|
+
var _errorBoundary = require("@atlaskit/editor-common/error-boundary");
|
|
9
11
|
var _editorSyncedBlockProvider = require("@atlaskit/editor-synced-block-provider");
|
|
10
12
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
13
|
var _SyncedBlockNodeComponentRenderer = require("./ui/SyncedBlockNodeComponentRenderer");
|
|
@@ -43,11 +45,20 @@ var useMemoizedSyncedBlockNodeComponent = exports.useMemoizedSyncedBlockNodeComp
|
|
|
43
45
|
syncBlockStoreManager.referenceManager.fetchSyncBlocksData(syncBlockNodes);
|
|
44
46
|
}, [syncBlockNodes, syncBlockStoreManager.referenceManager]);
|
|
45
47
|
return (0, _react.useCallback)(function (props) {
|
|
46
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
48
|
+
return (0, _platformFeatureFlags.fg)('platform_synced_block_dogfooding') ? /*#__PURE__*/_react.default.createElement(_errorBoundary.ErrorBoundary, {
|
|
49
|
+
component: _analytics.ACTION_SUBJECT.SYNCED_BLOCK,
|
|
50
|
+
dispatchAnalyticsEvent: fireAnalyticsEvent,
|
|
51
|
+
fallbackComponent: null
|
|
52
|
+
}, /*#__PURE__*/_react.default.createElement(_SyncedBlockNodeComponentRenderer.SyncedBlockNodeComponentRenderer, {
|
|
53
|
+
key: props.localId,
|
|
54
|
+
nodeProps: props,
|
|
55
|
+
syncBlockStoreManager: syncBlockStoreManager,
|
|
56
|
+
rendererOptions: syncBlockRendererOptions
|
|
57
|
+
})) : /*#__PURE__*/_react.default.createElement(_SyncedBlockNodeComponentRenderer.SyncedBlockNodeComponentRenderer, {
|
|
47
58
|
key: props.localId,
|
|
48
59
|
nodeProps: props,
|
|
49
60
|
syncBlockStoreManager: syncBlockStoreManager,
|
|
50
61
|
rendererOptions: syncBlockRendererOptions
|
|
51
62
|
});
|
|
52
|
-
}, [syncBlockStoreManager, syncBlockRendererOptions]);
|
|
63
|
+
}, [syncBlockStoreManager, syncBlockRendererOptions, fireAnalyticsEvent]);
|
|
53
64
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect } from 'react';
|
|
2
|
+
import { ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
2
4
|
import { convertSyncBlockJSONNodeToSyncBlockNode, useMemoizedSyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
3
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
6
|
import { SyncedBlockNodeComponentRenderer } from './ui/SyncedBlockNodeComponentRenderer';
|
|
@@ -33,10 +35,19 @@ export const useMemoizedSyncedBlockNodeComponent = ({
|
|
|
33
35
|
useEffect(() => {
|
|
34
36
|
syncBlockStoreManager.referenceManager.fetchSyncBlocksData(syncBlockNodes);
|
|
35
37
|
}, [syncBlockNodes, syncBlockStoreManager.referenceManager]);
|
|
36
|
-
return useCallback(props => /*#__PURE__*/React.createElement(
|
|
38
|
+
return useCallback(props => fg('platform_synced_block_dogfooding') ? /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
39
|
+
component: ACTION_SUBJECT.SYNCED_BLOCK,
|
|
40
|
+
dispatchAnalyticsEvent: fireAnalyticsEvent,
|
|
41
|
+
fallbackComponent: null
|
|
42
|
+
}, /*#__PURE__*/React.createElement(SyncedBlockNodeComponentRenderer, {
|
|
37
43
|
key: props.localId,
|
|
38
44
|
nodeProps: props,
|
|
39
45
|
syncBlockStoreManager: syncBlockStoreManager,
|
|
40
46
|
rendererOptions: syncBlockRendererOptions
|
|
41
|
-
})
|
|
47
|
+
})) : /*#__PURE__*/React.createElement(SyncedBlockNodeComponentRenderer, {
|
|
48
|
+
key: props.localId,
|
|
49
|
+
nodeProps: props,
|
|
50
|
+
syncBlockStoreManager: syncBlockStoreManager,
|
|
51
|
+
rendererOptions: syncBlockRendererOptions
|
|
52
|
+
}), [syncBlockStoreManager, syncBlockRendererOptions, fireAnalyticsEvent]);
|
|
42
53
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect } from 'react';
|
|
2
|
+
import { ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
2
4
|
import { convertSyncBlockJSONNodeToSyncBlockNode, useMemoizedSyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
3
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
6
|
import { SyncedBlockNodeComponentRenderer } from './ui/SyncedBlockNodeComponentRenderer';
|
|
@@ -35,11 +37,20 @@ export var useMemoizedSyncedBlockNodeComponent = function useMemoizedSyncedBlock
|
|
|
35
37
|
syncBlockStoreManager.referenceManager.fetchSyncBlocksData(syncBlockNodes);
|
|
36
38
|
}, [syncBlockNodes, syncBlockStoreManager.referenceManager]);
|
|
37
39
|
return useCallback(function (props) {
|
|
38
|
-
return /*#__PURE__*/React.createElement(
|
|
40
|
+
return fg('platform_synced_block_dogfooding') ? /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
41
|
+
component: ACTION_SUBJECT.SYNCED_BLOCK,
|
|
42
|
+
dispatchAnalyticsEvent: fireAnalyticsEvent,
|
|
43
|
+
fallbackComponent: null
|
|
44
|
+
}, /*#__PURE__*/React.createElement(SyncedBlockNodeComponentRenderer, {
|
|
45
|
+
key: props.localId,
|
|
46
|
+
nodeProps: props,
|
|
47
|
+
syncBlockStoreManager: syncBlockStoreManager,
|
|
48
|
+
rendererOptions: syncBlockRendererOptions
|
|
49
|
+
})) : /*#__PURE__*/React.createElement(SyncedBlockNodeComponentRenderer, {
|
|
39
50
|
key: props.localId,
|
|
40
51
|
nodeProps: props,
|
|
41
52
|
syncBlockStoreManager: syncBlockStoreManager,
|
|
42
53
|
rendererOptions: syncBlockRendererOptions
|
|
43
54
|
});
|
|
44
|
-
}, [syncBlockStoreManager, syncBlockRendererOptions]);
|
|
55
|
+
}, [syncBlockStoreManager, syncBlockRendererOptions, fireAnalyticsEvent]);
|
|
45
56
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DocNode } from '@atlaskit/adf-schema';
|
|
3
|
-
import type
|
|
3
|
+
import { type AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { type SyncBlockInstance, type SyncBlockNode } from '@atlaskit/editor-synced-block-provider';
|
|
5
5
|
import type { SyncedBlockProvider } from '@atlaskit/editor-synced-block-provider';
|
|
6
6
|
import type { SyncedBlockRendererOptions } from './types';
|
|
7
7
|
import { type SyncedBlockNodeProps } from './ui/SyncedBlockNodeComponentRenderer';
|
|
8
8
|
export type GetSyncedBlockNodeComponentProps = {
|
|
9
|
-
fireAnalyticsEvent?: (payload:
|
|
9
|
+
fireAnalyticsEvent?: (payload: AnalyticsEventPayload) => void;
|
|
10
10
|
getSSRData?: () => Record<string, SyncBlockInstance> | undefined;
|
|
11
11
|
syncBlockNodes: SyncBlockNode[];
|
|
12
12
|
syncBlockProvider: SyncedBlockProvider;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DocNode } from '@atlaskit/adf-schema';
|
|
3
|
-
import type
|
|
3
|
+
import { type AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { type SyncBlockInstance, type SyncBlockNode } from '@atlaskit/editor-synced-block-provider';
|
|
5
5
|
import type { SyncedBlockProvider } from '@atlaskit/editor-synced-block-provider';
|
|
6
6
|
import type { SyncedBlockRendererOptions } from './types';
|
|
7
7
|
import { type SyncedBlockNodeProps } from './ui/SyncedBlockNodeComponentRenderer';
|
|
8
8
|
export type GetSyncedBlockNodeComponentProps = {
|
|
9
|
-
fireAnalyticsEvent?: (payload:
|
|
9
|
+
fireAnalyticsEvent?: (payload: AnalyticsEventPayload) => void;
|
|
10
10
|
getSSRData?: () => Record<string, SyncBlockInstance> | undefined;
|
|
11
11
|
syncBlockNodes: SyncBlockNode[];
|
|
12
12
|
syncBlockProvider: SyncedBlockProvider;
|