@atlaskit/editor-synced-block-renderer 3.4.4 → 4.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 +19 -0
- package/dist/cjs/getSyncedBlockNodeComponent.js +3 -2
- package/dist/cjs/ui/SyncedBlockNodeComponentRenderer.js +4 -2
- package/dist/es2019/getSyncedBlockNodeComponent.js +3 -2
- package/dist/es2019/ui/SyncedBlockNodeComponentRenderer.js +4 -2
- package/dist/esm/getSyncedBlockNodeComponent.js +3 -2
- 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 +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-renderer
|
|
2
2
|
|
|
3
|
+
## 4.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0cc1855e9071d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0cc1855e9071d) -
|
|
8
|
+
EDITOR-1921 add analytics for sync block provider failures
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 4.0.0
|
|
12
|
+
|
|
13
|
+
### Major Changes
|
|
14
|
+
|
|
15
|
+
- [`b11a28ae7a18e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b11a28ae7a18e) -
|
|
16
|
+
anging relay-runtime dependency to root:\*
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 3.4.4
|
|
4
23
|
|
|
5
24
|
### Patch 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);
|
|
@@ -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);
|
|
@@ -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);
|
|
@@ -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": "
|
|
3
|
+
"version": "4.0.1",
|
|
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.11.0",
|
|
36
36
|
"@atlaskit/heading": "^5.2.0",
|
|
37
37
|
"@atlaskit/icon": "^29.0.0",
|
|
38
38
|
"@atlaskit/image": "^3.0.0",
|
|
39
|
-
"@atlaskit/primitives": "^16.
|
|
39
|
+
"@atlaskit/primitives": "^16.4.0",
|
|
40
40
|
"@atlaskit/renderer": "^124.16.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
|
-
"relay-runtime": "npm:atl-relay-
|
|
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.36.0",
|
|
49
49
|
"react": "^18.2.0",
|
|
50
50
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
51
51
|
},
|