@atlaskit/editor-synced-block-renderer 4.0.0 → 4.0.2
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 +16 -0
- package/dist/cjs/getSyncedBlockNodeComponent.js +3 -2
- package/dist/cjs/ui/SyncedBlockErrorComponent.js +2 -0
- package/dist/cjs/ui/SyncedBlockNodeComponentRenderer.js +4 -2
- package/dist/es2019/getSyncedBlockNodeComponent.js +3 -2
- package/dist/es2019/ui/SyncedBlockErrorComponent.js +2 -0
- package/dist/es2019/ui/SyncedBlockNodeComponentRenderer.js +4 -2
- package/dist/esm/getSyncedBlockNodeComponent.js +3 -2
- package/dist/esm/ui/SyncedBlockErrorComponent.js +2 -0
- package/dist/esm/ui/SyncedBlockNodeComponentRenderer.js +4 -2
- package/dist/types/getSyncedBlockNodeComponent.d.ts +3 -1
- package/dist/types-ts4.5/getSyncedBlockNodeComponent.d.ts +3 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-renderer
|
|
2
2
|
|
|
3
|
+
## 4.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`707c3960baedb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/707c3960baedb) -
|
|
8
|
+
EDITOR-1923 retry api requests on rate limited for sync block provider
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 4.0.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`0cc1855e9071d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0cc1855e9071d) -
|
|
16
|
+
EDITOR-1921 add analytics for sync block provider failures
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 4.0.0
|
|
4
20
|
|
|
5
21
|
### Major Changes
|
|
@@ -18,11 +18,12 @@ var getSyncBlockNodesFromContent = function getSyncBlockNodesFromContent(content
|
|
|
18
18
|
var getSyncedBlockNodeComponent = exports.getSyncedBlockNodeComponent = function getSyncedBlockNodeComponent(_ref) {
|
|
19
19
|
var doc = _ref.doc,
|
|
20
20
|
syncBlockProvider = _ref.syncBlockProvider,
|
|
21
|
-
syncBlockRendererOptions = _ref.syncBlockRendererOptions
|
|
21
|
+
syncBlockRendererOptions = _ref.syncBlockRendererOptions,
|
|
22
|
+
fireAnalyticsEvent = _ref.fireAnalyticsEvent;
|
|
22
23
|
var content = doc.content;
|
|
23
24
|
var isEmpty = !content || !Array.isArray(content) || content.length === 0;
|
|
24
25
|
var syncBlockNodes = isEmpty ? [] : getSyncBlockNodesFromContent(content);
|
|
25
|
-
var syncBlockStoreManager = new _editorSyncedBlockProvider.SyncBlockStoreManager(syncBlockProvider);
|
|
26
|
+
var syncBlockStoreManager = new _editorSyncedBlockProvider.SyncBlockStoreManager(syncBlockProvider, fireAnalyticsEvent);
|
|
26
27
|
|
|
27
28
|
// Pre-fetch sync block data
|
|
28
29
|
syncBlockStoreManager.referenceManager.fetchSyncBlocksData(syncBlockNodes);
|
|
@@ -30,6 +30,8 @@ var SyncedBlockErrorComponent = exports.SyncedBlockErrorComponent = function Syn
|
|
|
30
30
|
});
|
|
31
31
|
case _editorSyncedBlockProvider.SyncBlockError.NotFound:
|
|
32
32
|
case _editorSyncedBlockProvider.SyncBlockError.Errored:
|
|
33
|
+
case _editorSyncedBlockProvider.SyncBlockError.RateLimited:
|
|
34
|
+
case _editorSyncedBlockProvider.SyncBlockError.ServerError:
|
|
33
35
|
return /*#__PURE__*/_react.default.createElement(_SyncedBlockLoadError.SyncedBlockLoadError, {
|
|
34
36
|
onRetry: onRetry,
|
|
35
37
|
isLoading: isLoading
|
|
@@ -15,8 +15,10 @@ var SyncedBlockNodeComponentRenderer = exports.SyncedBlockNodeComponentRenderer
|
|
|
15
15
|
syncBlockStoreManager = _ref.syncBlockStoreManager,
|
|
16
16
|
rendererOptions = _ref.rendererOptions;
|
|
17
17
|
var resourceId = nodeProps.resourceId,
|
|
18
|
-
localId = nodeProps.localId
|
|
19
|
-
|
|
18
|
+
localId = nodeProps.localId,
|
|
19
|
+
fireAnalyticsEvent = nodeProps.fireAnalyticsEvent;
|
|
20
|
+
syncBlockStoreManager.referenceManager.updateFireAnalyticsEvent(fireAnalyticsEvent);
|
|
21
|
+
var _useFetchSyncBlockDat = (0, _editorSyncedBlockProvider.useFetchSyncBlockData)(syncBlockStoreManager, resourceId, localId, fireAnalyticsEvent),
|
|
20
22
|
syncBlockInstance = _useFetchSyncBlockDat.syncBlockInstance,
|
|
21
23
|
isLoading = _useFetchSyncBlockDat.isLoading,
|
|
22
24
|
reloadData = _useFetchSyncBlockDat.reloadData,
|
|
@@ -8,14 +8,15 @@ const getSyncBlockNodesFromContent = content => {
|
|
|
8
8
|
export const getSyncedBlockNodeComponent = ({
|
|
9
9
|
doc,
|
|
10
10
|
syncBlockProvider,
|
|
11
|
-
syncBlockRendererOptions
|
|
11
|
+
syncBlockRendererOptions,
|
|
12
|
+
fireAnalyticsEvent
|
|
12
13
|
}) => {
|
|
13
14
|
const {
|
|
14
15
|
content
|
|
15
16
|
} = doc;
|
|
16
17
|
const isEmpty = !content || !Array.isArray(content) || content.length === 0;
|
|
17
18
|
const syncBlockNodes = isEmpty ? [] : getSyncBlockNodesFromContent(content);
|
|
18
|
-
const syncBlockStoreManager = new SyncBlockStoreManager(syncBlockProvider);
|
|
19
|
+
const syncBlockStoreManager = new SyncBlockStoreManager(syncBlockProvider, fireAnalyticsEvent);
|
|
19
20
|
|
|
20
21
|
// Pre-fetch sync block data
|
|
21
22
|
syncBlockStoreManager.referenceManager.fetchSyncBlocksData(syncBlockNodes);
|
|
@@ -23,6 +23,8 @@ export const SyncedBlockErrorComponent = ({
|
|
|
23
23
|
});
|
|
24
24
|
case SyncBlockError.NotFound:
|
|
25
25
|
case SyncBlockError.Errored:
|
|
26
|
+
case SyncBlockError.RateLimited:
|
|
27
|
+
case SyncBlockError.ServerError:
|
|
26
28
|
return /*#__PURE__*/React.createElement(SyncedBlockLoadError, {
|
|
27
29
|
onRetry: onRetry,
|
|
28
30
|
isLoading: isLoading
|
|
@@ -10,14 +10,16 @@ export const SyncedBlockNodeComponentRenderer = ({
|
|
|
10
10
|
}) => {
|
|
11
11
|
const {
|
|
12
12
|
resourceId,
|
|
13
|
-
localId
|
|
13
|
+
localId,
|
|
14
|
+
fireAnalyticsEvent
|
|
14
15
|
} = nodeProps;
|
|
16
|
+
syncBlockStoreManager.referenceManager.updateFireAnalyticsEvent(fireAnalyticsEvent);
|
|
15
17
|
const {
|
|
16
18
|
syncBlockInstance,
|
|
17
19
|
isLoading,
|
|
18
20
|
reloadData,
|
|
19
21
|
providerFactory
|
|
20
|
-
} = useFetchSyncBlockData(syncBlockStoreManager, resourceId, localId);
|
|
22
|
+
} = useFetchSyncBlockData(syncBlockStoreManager, resourceId, localId, fireAnalyticsEvent);
|
|
21
23
|
if (isLoading && !syncBlockInstance) {
|
|
22
24
|
return /*#__PURE__*/React.createElement(SyncedBlockLoadingState, null);
|
|
23
25
|
}
|
|
@@ -12,11 +12,12 @@ var getSyncBlockNodesFromContent = function getSyncBlockNodesFromContent(content
|
|
|
12
12
|
export var getSyncedBlockNodeComponent = function getSyncedBlockNodeComponent(_ref) {
|
|
13
13
|
var doc = _ref.doc,
|
|
14
14
|
syncBlockProvider = _ref.syncBlockProvider,
|
|
15
|
-
syncBlockRendererOptions = _ref.syncBlockRendererOptions
|
|
15
|
+
syncBlockRendererOptions = _ref.syncBlockRendererOptions,
|
|
16
|
+
fireAnalyticsEvent = _ref.fireAnalyticsEvent;
|
|
16
17
|
var content = doc.content;
|
|
17
18
|
var isEmpty = !content || !Array.isArray(content) || content.length === 0;
|
|
18
19
|
var syncBlockNodes = isEmpty ? [] : getSyncBlockNodesFromContent(content);
|
|
19
|
-
var syncBlockStoreManager = new SyncBlockStoreManager(syncBlockProvider);
|
|
20
|
+
var syncBlockStoreManager = new SyncBlockStoreManager(syncBlockProvider, fireAnalyticsEvent);
|
|
20
21
|
|
|
21
22
|
// Pre-fetch sync block data
|
|
22
23
|
syncBlockStoreManager.referenceManager.fetchSyncBlocksData(syncBlockNodes);
|
|
@@ -22,6 +22,8 @@ export var SyncedBlockErrorComponent = function SyncedBlockErrorComponent(_ref)
|
|
|
22
22
|
});
|
|
23
23
|
case SyncBlockError.NotFound:
|
|
24
24
|
case SyncBlockError.Errored:
|
|
25
|
+
case SyncBlockError.RateLimited:
|
|
26
|
+
case SyncBlockError.ServerError:
|
|
25
27
|
return /*#__PURE__*/React.createElement(SyncedBlockLoadError, {
|
|
26
28
|
onRetry: onRetry,
|
|
27
29
|
isLoading: isLoading
|
|
@@ -8,8 +8,10 @@ export var SyncedBlockNodeComponentRenderer = function SyncedBlockNodeComponentR
|
|
|
8
8
|
syncBlockStoreManager = _ref.syncBlockStoreManager,
|
|
9
9
|
rendererOptions = _ref.rendererOptions;
|
|
10
10
|
var resourceId = nodeProps.resourceId,
|
|
11
|
-
localId = nodeProps.localId
|
|
12
|
-
|
|
11
|
+
localId = nodeProps.localId,
|
|
12
|
+
fireAnalyticsEvent = nodeProps.fireAnalyticsEvent;
|
|
13
|
+
syncBlockStoreManager.referenceManager.updateFireAnalyticsEvent(fireAnalyticsEvent);
|
|
14
|
+
var _useFetchSyncBlockDat = useFetchSyncBlockData(syncBlockStoreManager, resourceId, localId, fireAnalyticsEvent),
|
|
13
15
|
syncBlockInstance = _useFetchSyncBlockDat.syncBlockInstance,
|
|
14
16
|
isLoading = _useFetchSyncBlockDat.isLoading,
|
|
15
17
|
reloadData = _useFetchSyncBlockDat.reloadData,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { DocNode } from '@atlaskit/adf-schema';
|
|
3
|
+
import type { SyncBlockEventPayload } from '@atlaskit/editor-common/analytics';
|
|
3
4
|
import type { SyncedBlockProvider } from '@atlaskit/editor-synced-block-provider';
|
|
4
5
|
import type { SyncedBlockRendererOptions } from './types';
|
|
5
6
|
import { type SyncedBlockNodeProps } from './ui/SyncedBlockNodeComponentRenderer';
|
|
6
7
|
type GetSyncedBlockNodeComponentProps = {
|
|
7
8
|
doc: DocNode;
|
|
9
|
+
fireAnalyticsEvent?: (payload: SyncBlockEventPayload) => void;
|
|
8
10
|
syncBlockProvider: SyncedBlockProvider;
|
|
9
11
|
syncBlockRendererOptions: SyncedBlockRendererOptions | undefined;
|
|
10
12
|
};
|
|
11
|
-
export declare const getSyncedBlockNodeComponent: ({ doc, syncBlockProvider, syncBlockRendererOptions, }: GetSyncedBlockNodeComponentProps) => ((props: SyncedBlockNodeProps) => React.JSX.Element);
|
|
13
|
+
export declare const getSyncedBlockNodeComponent: ({ doc, syncBlockProvider, syncBlockRendererOptions, fireAnalyticsEvent, }: GetSyncedBlockNodeComponentProps) => ((props: SyncedBlockNodeProps) => React.JSX.Element);
|
|
12
14
|
export {};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { DocNode } from '@atlaskit/adf-schema';
|
|
3
|
+
import type { SyncBlockEventPayload } from '@atlaskit/editor-common/analytics';
|
|
3
4
|
import type { SyncedBlockProvider } from '@atlaskit/editor-synced-block-provider';
|
|
4
5
|
import type { SyncedBlockRendererOptions } from './types';
|
|
5
6
|
import { type SyncedBlockNodeProps } from './ui/SyncedBlockNodeComponentRenderer';
|
|
6
7
|
type GetSyncedBlockNodeComponentProps = {
|
|
7
8
|
doc: DocNode;
|
|
9
|
+
fireAnalyticsEvent?: (payload: SyncBlockEventPayload) => void;
|
|
8
10
|
syncBlockProvider: SyncedBlockProvider;
|
|
9
11
|
syncBlockRendererOptions: SyncedBlockRendererOptions | undefined;
|
|
10
12
|
};
|
|
11
|
-
export declare const getSyncedBlockNodeComponent: ({ doc, syncBlockProvider, syncBlockRendererOptions, }: GetSyncedBlockNodeComponentProps) => ((props: SyncedBlockNodeProps) => React.JSX.Element);
|
|
13
|
+
export declare const getSyncedBlockNodeComponent: ({ doc, syncBlockProvider, syncBlockRendererOptions, fireAnalyticsEvent, }: GetSyncedBlockNodeComponentProps) => ((props: SyncedBlockNodeProps) => React.JSX.Element);
|
|
12
14
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-synced-block-renderer",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "SyncedBlockRenderer for @atlaskit/editor-plugin-synced-block",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,20 +32,20 @@
|
|
|
32
32
|
"@atlaskit/css": "^0.17.0",
|
|
33
33
|
"@atlaskit/editor-plugin-synced-block": "^4.3.0",
|
|
34
34
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
35
|
-
"@atlaskit/editor-synced-block-provider": "^2.
|
|
35
|
+
"@atlaskit/editor-synced-block-provider": "^2.12.0",
|
|
36
36
|
"@atlaskit/heading": "^5.2.0",
|
|
37
37
|
"@atlaskit/icon": "^29.0.0",
|
|
38
38
|
"@atlaskit/image": "^3.0.0",
|
|
39
39
|
"@atlaskit/primitives": "^16.4.0",
|
|
40
|
-
"@atlaskit/renderer": "^124.
|
|
40
|
+
"@atlaskit/renderer": "^124.17.0",
|
|
41
41
|
"@atlaskit/spinner": "^19.0.0",
|
|
42
|
-
"@atlaskit/tokens": "^8.
|
|
42
|
+
"@atlaskit/tokens": "^8.4.0",
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
44
44
|
"react-relay": "npm:atl-react-relay@0.0.0-main-39e79f66",
|
|
45
45
|
"relay-runtime": "npm:atl-relay-runtime@0.0.0-main-39e79f66"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@atlaskit/editor-common": "^110.
|
|
48
|
+
"@atlaskit/editor-common": "^110.39.0",
|
|
49
49
|
"react": "^18.2.0",
|
|
50
50
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
51
51
|
},
|