@atlaskit/editor-synced-block-renderer 5.8.2 → 5.8.4
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/useSyncedBlockNodeComponent.js +1 -12
- package/dist/es2019/useSyncedBlockNodeComponent.js +1 -12
- package/dist/esm/useSyncedBlockNodeComponent.js +1 -12
- package/dist/types/useSyncedBlockNodeComponent.d.ts +2 -3
- package/dist/types-ts4.5/useSyncedBlockNodeComponent.d.ts +2 -3
- package/package.json +3 -3
- package/tsconfig.json +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-renderer
|
|
2
2
|
|
|
3
|
+
## 5.8.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0f351c68adbac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0f351c68adbac) -
|
|
8
|
+
Improve robustness
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 5.8.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`53c9f85806f98`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/53c9f85806f98) -
|
|
16
|
+
EDITOR-5275 Store synced blocks data in session storage for look up during page transitions
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 5.8.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -27,21 +27,10 @@ var useMemoizedSyncedBlockNodeComponent = exports.useMemoizedSyncedBlockNodeComp
|
|
|
27
27
|
syncBlockProvider = _ref.syncBlockProvider,
|
|
28
28
|
syncBlockRendererOptions = _ref.syncBlockRendererOptions,
|
|
29
29
|
fireAnalyticsEvent = _ref.fireAnalyticsEvent,
|
|
30
|
-
getSSRData = _ref.getSSRData,
|
|
31
30
|
getPrefetchedData = _ref.getPrefetchedData;
|
|
32
31
|
var syncBlockStoreManager = (0, _editorSyncedBlockProvider.useMemoizedSyncBlockStoreManager)(syncBlockProvider, fireAnalyticsEvent);
|
|
33
32
|
|
|
34
|
-
//
|
|
35
|
-
(0, _react.useEffect)(function () {
|
|
36
|
-
if (getSSRData) {
|
|
37
|
-
var ssrData = getSSRData();
|
|
38
|
-
if (ssrData && syncBlockProvider.setSSRData) {
|
|
39
|
-
syncBlockProvider.setSSRData(ssrData);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}, [getSSRData, syncBlockProvider]);
|
|
43
|
-
|
|
44
|
-
// Process prefetched data next, if available
|
|
33
|
+
// Process prefetched data early, if available
|
|
45
34
|
(0, _react.useEffect)(function () {
|
|
46
35
|
var prefetchedData;
|
|
47
36
|
if (getPrefetchedData) {
|
|
@@ -17,22 +17,11 @@ export const useMemoizedSyncedBlockNodeComponent = ({
|
|
|
17
17
|
syncBlockProvider,
|
|
18
18
|
syncBlockRendererOptions,
|
|
19
19
|
fireAnalyticsEvent,
|
|
20
|
-
getSSRData,
|
|
21
20
|
getPrefetchedData
|
|
22
21
|
}) => {
|
|
23
22
|
const syncBlockStoreManager = useMemoizedSyncBlockStoreManager(syncBlockProvider, fireAnalyticsEvent);
|
|
24
23
|
|
|
25
|
-
//
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
if (getSSRData) {
|
|
28
|
-
const ssrData = getSSRData();
|
|
29
|
-
if (ssrData && syncBlockProvider.setSSRData) {
|
|
30
|
-
syncBlockProvider.setSSRData(ssrData);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}, [getSSRData, syncBlockProvider]);
|
|
34
|
-
|
|
35
|
-
// Process prefetched data next, if available
|
|
24
|
+
// Process prefetched data early, if available
|
|
36
25
|
useEffect(() => {
|
|
37
26
|
let prefetchedData;
|
|
38
27
|
if (getPrefetchedData) {
|
|
@@ -19,21 +19,10 @@ export var useMemoizedSyncedBlockNodeComponent = function useMemoizedSyncedBlock
|
|
|
19
19
|
syncBlockProvider = _ref.syncBlockProvider,
|
|
20
20
|
syncBlockRendererOptions = _ref.syncBlockRendererOptions,
|
|
21
21
|
fireAnalyticsEvent = _ref.fireAnalyticsEvent,
|
|
22
|
-
getSSRData = _ref.getSSRData,
|
|
23
22
|
getPrefetchedData = _ref.getPrefetchedData;
|
|
24
23
|
var syncBlockStoreManager = useMemoizedSyncBlockStoreManager(syncBlockProvider, fireAnalyticsEvent);
|
|
25
24
|
|
|
26
|
-
//
|
|
27
|
-
useEffect(function () {
|
|
28
|
-
if (getSSRData) {
|
|
29
|
-
var ssrData = getSSRData();
|
|
30
|
-
if (ssrData && syncBlockProvider.setSSRData) {
|
|
31
|
-
syncBlockProvider.setSSRData(ssrData);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}, [getSSRData, syncBlockProvider]);
|
|
35
|
-
|
|
36
|
-
// Process prefetched data next, if available
|
|
25
|
+
// Process prefetched data early, if available
|
|
37
26
|
useEffect(function () {
|
|
38
27
|
var prefetchedData;
|
|
39
28
|
if (getPrefetchedData) {
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DocNode } from '@atlaskit/adf-schema';
|
|
3
3
|
import { type AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { type
|
|
4
|
+
import { type SyncBlockNode, type SyncedBlockProvider, type SyncBlockPrefetchData } from '@atlaskit/editor-synced-block-provider';
|
|
5
5
|
import type { SyncedBlockRendererOptions } from './types';
|
|
6
6
|
import { type SyncedBlockNodeProps } from './ui/SyncedBlockNodeComponentRenderer';
|
|
7
7
|
export type GetSyncedBlockNodeComponentProps = {
|
|
8
8
|
fireAnalyticsEvent?: (payload: AnalyticsEventPayload) => void;
|
|
9
9
|
getPrefetchedData?: () => SyncBlockPrefetchData | undefined;
|
|
10
|
-
getSSRData?: () => Record<string, SyncBlockInstance> | undefined;
|
|
11
10
|
syncBlockNodes: SyncBlockNode[];
|
|
12
11
|
syncBlockProvider: SyncedBlockProvider;
|
|
13
12
|
syncBlockRendererOptions: SyncedBlockRendererOptions | undefined;
|
|
14
13
|
};
|
|
15
14
|
export declare const getSyncBlockNodesFromDoc: (doc: DocNode) => SyncBlockNode[];
|
|
16
|
-
export declare const useMemoizedSyncedBlockNodeComponent: ({ syncBlockNodes, syncBlockProvider, syncBlockRendererOptions, fireAnalyticsEvent,
|
|
15
|
+
export declare const useMemoizedSyncedBlockNodeComponent: ({ syncBlockNodes, syncBlockProvider, syncBlockRendererOptions, fireAnalyticsEvent, getPrefetchedData, }: GetSyncedBlockNodeComponentProps) => ((props: SyncedBlockNodeProps) => React.JSX.Element);
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DocNode } from '@atlaskit/adf-schema';
|
|
3
3
|
import { type AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { type
|
|
4
|
+
import { type SyncBlockNode, type SyncedBlockProvider, type SyncBlockPrefetchData } from '@atlaskit/editor-synced-block-provider';
|
|
5
5
|
import type { SyncedBlockRendererOptions } from './types';
|
|
6
6
|
import { type SyncedBlockNodeProps } from './ui/SyncedBlockNodeComponentRenderer';
|
|
7
7
|
export type GetSyncedBlockNodeComponentProps = {
|
|
8
8
|
fireAnalyticsEvent?: (payload: AnalyticsEventPayload) => void;
|
|
9
9
|
getPrefetchedData?: () => SyncBlockPrefetchData | undefined;
|
|
10
|
-
getSSRData?: () => Record<string, SyncBlockInstance> | undefined;
|
|
11
10
|
syncBlockNodes: SyncBlockNode[];
|
|
12
11
|
syncBlockProvider: SyncedBlockProvider;
|
|
13
12
|
syncBlockRendererOptions: SyncedBlockRendererOptions | undefined;
|
|
14
13
|
};
|
|
15
14
|
export declare const getSyncBlockNodesFromDoc: (doc: DocNode) => SyncBlockNode[];
|
|
16
|
-
export declare const useMemoizedSyncedBlockNodeComponent: ({ syncBlockNodes, syncBlockProvider, syncBlockRendererOptions, fireAnalyticsEvent,
|
|
15
|
+
export declare const useMemoizedSyncedBlockNodeComponent: ({ syncBlockNodes, syncBlockProvider, syncBlockRendererOptions, fireAnalyticsEvent, getPrefetchedData, }: GetSyncedBlockNodeComponentProps) => ((props: SyncedBlockNodeProps) => React.JSX.Element);
|
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.4",
|
|
4
4
|
"description": "SyncedBlockRenderer for @atlaskit/editor-plugin-synced-block",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
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.29.0",
|
|
35
35
|
"@atlaskit/heading": "^5.3.0",
|
|
36
36
|
"@atlaskit/icon": "^31.0.0",
|
|
37
37
|
"@atlaskit/icon-lab": "^5.16.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.14.0",
|
|
52
52
|
"react": "^18.2.0",
|
|
53
53
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
54
54
|
},
|