@atlaskit/editor-synced-block-provider 2.10.4 → 2.10.6
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 +14 -0
- package/dist/cjs/clients/confluence/sourceInfo.js +3 -3
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/providers/block-service/blockServiceAPI.js +0 -14
- package/dist/cjs/providers/confluence/confluenceContentAPI.js +0 -15
- package/dist/cjs/providers/syncBlockProvider.js +30 -40
- package/dist/cjs/store-manager/referenceSyncBlockStoreManager.js +54 -31
- package/dist/es2019/clients/confluence/sourceInfo.js +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/providers/block-service/blockServiceAPI.js +0 -12
- package/dist/es2019/providers/confluence/confluenceContentAPI.js +1 -14
- package/dist/es2019/providers/syncBlockProvider.js +30 -44
- package/dist/es2019/store-manager/referenceSyncBlockStoreManager.js +51 -30
- package/dist/esm/clients/confluence/sourceInfo.js +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/providers/block-service/blockServiceAPI.js +0 -14
- package/dist/esm/providers/confluence/confluenceContentAPI.js +1 -16
- package/dist/esm/providers/syncBlockProvider.js +31 -41
- package/dist/esm/store-manager/referenceSyncBlockStoreManager.js +54 -31
- package/dist/types/clients/confluence/sourceInfo.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/providers/block-service/blockServiceAPI.d.ts +2 -3
- package/dist/types/providers/confluence/confluenceContentAPI.d.ts +2 -3
- package/dist/types/providers/syncBlockProvider.d.ts +11 -9
- package/dist/types/providers/types.d.ts +8 -9
- package/dist/types/store-manager/referenceSyncBlockStoreManager.d.ts +2 -1
- package/dist/types-ts4.5/clients/confluence/sourceInfo.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +2 -2
- package/dist/types-ts4.5/providers/block-service/blockServiceAPI.d.ts +2 -3
- package/dist/types-ts4.5/providers/confluence/confluenceContentAPI.d.ts +2 -3
- package/dist/types-ts4.5/providers/syncBlockProvider.d.ts +11 -9
- package/dist/types-ts4.5/providers/types.d.ts +8 -9
- package/dist/types-ts4.5/store-manager/referenceSyncBlockStoreManager.d.ts +2 -1
- package/package.json +5 -5
|
@@ -3,7 +3,7 @@ import type { EmojiProvider } from '@atlaskit/emoji';
|
|
|
3
3
|
import type { MentionProvider } from '@atlaskit/mention/types';
|
|
4
4
|
import { NodeDataProvider } from '@atlaskit/node-data-provider';
|
|
5
5
|
import type { TaskDecisionProvider } from '@atlaskit/task-decision/types';
|
|
6
|
-
import type { SyncBlockData, ResourceId, SyncBlockError, SyncBlockNode, SyncBlockProduct } from '../common/types';
|
|
6
|
+
import type { SyncBlockData, ResourceId, SyncBlockError, SyncBlockNode, SyncBlockProduct, BlockInstanceId } from '../common/types';
|
|
7
7
|
/**
|
|
8
8
|
* The instance of a sync block, containing its data and metadata.
|
|
9
9
|
* Mainly used for representing the state of a sync block after fetching from a data provider.
|
|
@@ -12,11 +12,11 @@ import type { SyncBlockData, ResourceId, SyncBlockError, SyncBlockNode, SyncBloc
|
|
|
12
12
|
export type SyncBlockInstance = {
|
|
13
13
|
data?: SyncBlockData;
|
|
14
14
|
error?: SyncBlockError;
|
|
15
|
-
resourceId:
|
|
15
|
+
resourceId: ResourceId;
|
|
16
16
|
};
|
|
17
17
|
export type DeleteSyncBlockResult = {
|
|
18
18
|
error?: string;
|
|
19
|
-
resourceId:
|
|
19
|
+
resourceId: ResourceId;
|
|
20
20
|
success: boolean;
|
|
21
21
|
};
|
|
22
22
|
export type SyncBlockSourceInfo = {
|
|
@@ -29,7 +29,7 @@ export type SyncBlockParentInfo = {
|
|
|
29
29
|
};
|
|
30
30
|
export type WriteSyncBlockResult = {
|
|
31
31
|
error?: string;
|
|
32
|
-
resourceId?:
|
|
32
|
+
resourceId?: ResourceId;
|
|
33
33
|
};
|
|
34
34
|
export type SourceInfoFetchData = {
|
|
35
35
|
pageARI: string;
|
|
@@ -37,10 +37,9 @@ export type SourceInfoFetchData = {
|
|
|
37
37
|
};
|
|
38
38
|
export interface ADFFetchProvider {
|
|
39
39
|
fetchData: (resourceId: ResourceId) => Promise<SyncBlockInstance>;
|
|
40
|
-
retrieveSourceInfoFetchData: (resourceId: ResourceId, pageAri: string) => SourceInfoFetchData;
|
|
41
40
|
}
|
|
42
41
|
export interface ADFWriteProvider {
|
|
43
|
-
deleteData: (resourceId:
|
|
42
|
+
deleteData: (resourceId: ResourceId) => Promise<DeleteSyncBlockResult>;
|
|
44
43
|
generateResourceId: (sourceId: string, localId: string) => ResourceId;
|
|
45
44
|
writeData: (data: SyncBlockData) => Promise<WriteSyncBlockResult>;
|
|
46
45
|
}
|
|
@@ -65,16 +64,16 @@ export declare abstract class SyncBlockDataProvider extends NodeDataProvider<Syn
|
|
|
65
64
|
abstract writeNodesData(nodes: SyncBlockNode[], data: SyncBlockData[]): Promise<Array<WriteSyncBlockResult>>;
|
|
66
65
|
abstract deleteNodesData(resourceIds: string[]): Promise<Array<DeleteSyncBlockResult>>;
|
|
67
66
|
abstract getSourceId(): ResourceId;
|
|
68
|
-
abstract
|
|
67
|
+
abstract fetchSyncBlockSourceInfo(localId: BlockInstanceId, sourceAri: string, sourceProduct: SyncBlockProduct): Promise<SyncBlockSourceInfo | undefined>;
|
|
69
68
|
abstract getSyncedBlockRendererProviderOptions(): SyncedBlockRendererProviderOptions;
|
|
70
|
-
abstract retrieveSyncBlockParentInfo(
|
|
69
|
+
abstract retrieveSyncBlockParentInfo(sourceAri: string, sourceProduct: SyncBlockProduct): SyncBlockParentInfo | undefined;
|
|
71
70
|
/**
|
|
72
71
|
* Generates a resource ID from a source ID and local ID.
|
|
73
72
|
* @param sourceId - The source document ID (e.g., page ARI)
|
|
74
73
|
* @param localId - The local block ID (usually a UUID)
|
|
75
74
|
* @returns The generated resource ID
|
|
76
75
|
*/
|
|
77
|
-
abstract generateResourceId(sourceId: ResourceId, localId:
|
|
76
|
+
abstract generateResourceId(sourceId: ResourceId, localId: BlockInstanceId): ResourceId;
|
|
78
77
|
}
|
|
79
78
|
export type SubscriptionCallback = (data: SyncBlockInstance) => void;
|
|
80
79
|
export type TitleSubscriptionCallback = (title: string) => void;
|
|
@@ -16,13 +16,14 @@ export declare class ReferenceSyncBlockStoreManager {
|
|
|
16
16
|
* @returns {Promise<void>}
|
|
17
17
|
*/
|
|
18
18
|
refreshSubscriptions(): Promise<void>;
|
|
19
|
-
private
|
|
19
|
+
private fetchSyncBlockSourceInfo;
|
|
20
20
|
/**
|
|
21
21
|
* Fetch sync block data for a given array of sync block nodes.
|
|
22
22
|
* @param syncBlockNodes - The array of sync block nodes to fetch data for
|
|
23
23
|
* @returns The fetched sync block data results
|
|
24
24
|
*/
|
|
25
25
|
fetchSyncBlocksData(syncBlockNodes: SyncBlockNode[]): Promise<SyncBlockInstance[]>;
|
|
26
|
+
private updateCacheWithSourceInfo;
|
|
26
27
|
private updateCache;
|
|
27
28
|
private updateSourceTitleSubscriptions;
|
|
28
29
|
private getFromCache;
|
package/package.json
CHANGED
|
@@ -26,18 +26,18 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@atlaskit/adf-schema": "^51.4.0",
|
|
28
28
|
"@atlaskit/adf-utils": "^19.26.0",
|
|
29
|
-
"@atlaskit/css": "^0.
|
|
29
|
+
"@atlaskit/css": "^0.17.0",
|
|
30
30
|
"@atlaskit/editor-json-transformer": "^8.31.0",
|
|
31
31
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
32
32
|
"@atlaskit/node-data-provider": "^7.5.0",
|
|
33
|
-
"@atlaskit/primitives": "^16.
|
|
34
|
-
"@atlaskit/tokens": "^8.
|
|
33
|
+
"@atlaskit/primitives": "^16.3.0",
|
|
34
|
+
"@atlaskit/tokens": "^8.3.0",
|
|
35
35
|
"@babel/runtime": "^7.0.0",
|
|
36
36
|
"@compiled/react": "^0.18.6",
|
|
37
37
|
"uuid": "^3.1.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@atlaskit/editor-common": "^110.
|
|
40
|
+
"@atlaskit/editor-common": "^110.34.0",
|
|
41
41
|
"react": "^18.2.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
85
|
"name": "@atlaskit/editor-synced-block-provider",
|
|
86
|
-
"version": "2.10.
|
|
86
|
+
"version": "2.10.6",
|
|
87
87
|
"description": "Synced Block Provider for @atlaskit/editor-plugin-synced-block",
|
|
88
88
|
"author": "Atlassian Pty Ltd",
|
|
89
89
|
"license": "Apache-2.0",
|