@atlaskit/editor-synced-block-provider 3.29.0 → 3.29.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 +18 -0
- package/dist/cjs/clients/block-service/ari.js +5 -3
- package/dist/cjs/index.js +33 -1
- package/dist/cjs/providers/syncBlockProvider.js +10 -10
- package/dist/cjs/providers/types.js +7 -7
- package/dist/cjs/store-manager/referenceSyncBlockStoreManager.js +102 -35
- package/dist/cjs/store-manager/sourceSyncBlockStoreManager.js +1 -1
- package/dist/cjs/utils/errorHandling.js +21 -1
- package/dist/cjs/utils/resolveSyncBlockInstance.js +3 -2
- package/dist/cjs/utils/retry.js +2 -1
- package/dist/es2019/clients/block-service/ari.js +5 -3
- package/dist/es2019/index.js +4 -4
- package/dist/es2019/providers/syncBlockProvider.js +4 -4
- package/dist/es2019/providers/types.js +1 -1
- package/dist/es2019/store-manager/referenceSyncBlockStoreManager.js +75 -16
- package/dist/es2019/store-manager/sourceSyncBlockStoreManager.js +1 -1
- package/dist/es2019/utils/errorHandling.js +21 -1
- package/dist/es2019/utils/resolveSyncBlockInstance.js +3 -2
- package/dist/es2019/utils/retry.js +4 -1
- package/dist/esm/clients/block-service/ari.js +5 -3
- package/dist/esm/index.js +4 -4
- package/dist/esm/providers/syncBlockProvider.js +10 -10
- package/dist/esm/providers/types.js +6 -6
- package/dist/esm/store-manager/referenceSyncBlockStoreManager.js +101 -35
- package/dist/esm/store-manager/sourceSyncBlockStoreManager.js +1 -1
- package/dist/esm/utils/errorHandling.js +20 -0
- package/dist/esm/utils/resolveSyncBlockInstance.js +3 -2
- package/dist/esm/utils/retry.js +2 -1
- package/dist/types/clients/block-service/ari.d.ts +4 -2
- package/dist/types/index.d.ts +6 -4
- package/dist/types/providers/syncBlockProvider.d.ts +4 -4
- package/dist/types/providers/types.d.ts +1 -1
- package/dist/types/store-manager/referenceSyncBlockStoreManager.d.ts +5 -2
- package/dist/types/store-manager/sourceSyncBlockStoreManager.d.ts +3 -3
- package/dist/types/store-manager/syncBlockStoreManager.d.ts +3 -3
- package/dist/types/utils/errorHandling.d.ts +1 -0
- package/dist/types/utils/resolveSyncBlockInstance.d.ts +3 -2
- package/dist/types-ts4.5/clients/block-service/ari.d.ts +4 -2
- package/dist/types-ts4.5/index.d.ts +6 -4
- package/dist/types-ts4.5/providers/syncBlockProvider.d.ts +4 -4
- package/dist/types-ts4.5/providers/types.d.ts +1 -1
- package/dist/types-ts4.5/store-manager/referenceSyncBlockStoreManager.d.ts +5 -2
- package/dist/types-ts4.5/store-manager/sourceSyncBlockStoreManager.d.ts +3 -3
- package/dist/types-ts4.5/store-manager/syncBlockStoreManager.d.ts +3 -3
- package/dist/types-ts4.5/utils/errorHandling.d.ts +1 -0
- package/dist/types-ts4.5/utils/resolveSyncBlockInstance.d.ts +3 -2
- package/package.json +5 -2
|
@@ -3,7 +3,7 @@ import type { Experience } from '@atlaskit/editor-common/experiences';
|
|
|
3
3
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import { type ResourceId, type SyncBlockNode, type SyncBlockPrefetchData } from '../common/types';
|
|
6
|
-
import type { SyncBlockInstance, SubscriptionCallback,
|
|
6
|
+
import type { SyncBlockInstance, SubscriptionCallback, SyncBlockDataProviderInterface, TitleSubscriptionCallback, SyncBlockSourceInfo } from '../providers/types';
|
|
7
7
|
export declare class ReferenceSyncBlockStoreManager {
|
|
8
8
|
private dataProvider?;
|
|
9
9
|
private isCacheDirty;
|
|
@@ -29,7 +29,7 @@ export declare class ReferenceSyncBlockStoreManager {
|
|
|
29
29
|
private saveExperience;
|
|
30
30
|
private pendingFetchRequests;
|
|
31
31
|
private scheduledBatchFetch;
|
|
32
|
-
constructor(dataProvider?:
|
|
32
|
+
constructor(dataProvider?: SyncBlockDataProviderInterface);
|
|
33
33
|
/**
|
|
34
34
|
* Enables or disables real-time GraphQL subscriptions for block updates.
|
|
35
35
|
* When enabled, the store manager will subscribe to real-time updates
|
|
@@ -73,6 +73,8 @@ export declare class ReferenceSyncBlockStoreManager {
|
|
|
73
73
|
generateResourceIdForReference(sourceId: ResourceId): ResourceId;
|
|
74
74
|
updateFireAnalyticsEvent(fireAnalyticsEvent?: (payload: RendererSyncBlockEventPayload) => void): void;
|
|
75
75
|
getInitialSyncBlockData(resourceId: ResourceId): SyncBlockInstance | undefined;
|
|
76
|
+
private updateCacheInSessionStorage;
|
|
77
|
+
private getSyncBlockDataFromSessionStorage;
|
|
76
78
|
/**
|
|
77
79
|
* Refreshes the subscriptions for all sync blocks.
|
|
78
80
|
* This is a fallback polling mechanism when real-time subscriptions are not enabled.
|
|
@@ -123,6 +125,7 @@ export declare class ReferenceSyncBlockStoreManager {
|
|
|
123
125
|
getFromCache(resourceId: ResourceId): SyncBlockInstance | undefined;
|
|
124
126
|
private deleteFromCache;
|
|
125
127
|
private debouncedBatchedFetchSyncBlocks;
|
|
128
|
+
private setSSRDataInSessionStorage;
|
|
126
129
|
subscribeToSyncBlock(resourceId: string, localId: string, callback: SubscriptionCallback): () => void;
|
|
127
130
|
subscribeToSourceTitle(node: PMNode, callback: TitleSubscriptionCallback): () => void;
|
|
128
131
|
subscribe(node: PMNode, callback: SubscriptionCallback): () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type SyncBlockEventPayload } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import { type ResourceId, type SyncBlockAttrs, type BlockInstanceId, type DeletionReason, type ReferenceSyncBlockData } from '../common/types';
|
|
4
|
-
import type {
|
|
4
|
+
import type { SyncBlockDataProviderInterface, SyncBlockSourceInfo } from '../providers/types';
|
|
5
5
|
export type ConfirmationCallback = (syncBlockIds: SyncBlockAttrs[], deleteReason: DeletionReason | undefined) => Promise<boolean>;
|
|
6
6
|
type OnDelete = () => void;
|
|
7
7
|
type OnCompletion = (success: boolean) => void;
|
|
@@ -17,7 +17,7 @@ export declare class SourceSyncBlockStoreManager {
|
|
|
17
17
|
private saveExperience;
|
|
18
18
|
private deleteExperience;
|
|
19
19
|
private fetchSourceInfoExperience;
|
|
20
|
-
constructor(dataProvider?:
|
|
20
|
+
constructor(dataProvider?: SyncBlockDataProviderInterface);
|
|
21
21
|
setFireAnalyticsEvent(fireAnalyticsEvent?: (payload: SyncBlockEventPayload) => void): void;
|
|
22
22
|
isSourceBlock(node: PMNode): boolean;
|
|
23
23
|
/**
|
|
@@ -47,7 +47,7 @@ export declare class SourceSyncBlockStoreManager {
|
|
|
47
47
|
* Create a bodiedSyncBlock node with empty content to backend
|
|
48
48
|
* @param attrs attributes Ids of the node
|
|
49
49
|
*/
|
|
50
|
-
createBodiedSyncBlockNode(attrs: SyncBlockAttrs, onCompletion: OnCompletion
|
|
50
|
+
createBodiedSyncBlockNode(attrs: SyncBlockAttrs, onCompletion: OnCompletion): void;
|
|
51
51
|
private setPendingDeletion;
|
|
52
52
|
private delete;
|
|
53
53
|
isRetryingDeletion(): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SyncBlockEventPayload } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { type BlockInstanceId, type ReferencesSourceInfo, type ResourceId } from '../common/types';
|
|
3
|
-
import type {
|
|
3
|
+
import type { SyncBlockDataProviderInterface } from '../providers/types';
|
|
4
4
|
import { ReferenceSyncBlockStoreManager } from './referenceSyncBlockStoreManager';
|
|
5
5
|
import { SourceSyncBlockStoreManager } from './sourceSyncBlockStoreManager';
|
|
6
6
|
export declare class SyncBlockStoreManager {
|
|
@@ -10,11 +10,11 @@ export declare class SyncBlockStoreManager {
|
|
|
10
10
|
private fireAnalyticsEvent?;
|
|
11
11
|
private fetchReferencesExperience;
|
|
12
12
|
private fetchSourceInfoExperience;
|
|
13
|
-
constructor(dataProvider?:
|
|
13
|
+
constructor(dataProvider?: SyncBlockDataProviderInterface);
|
|
14
14
|
fetchReferencesSourceInfo(resourceId: ResourceId, blockInstanceId: BlockInstanceId, isSourceSyncBlock: boolean): Promise<ReferencesSourceInfo>;
|
|
15
15
|
setFireAnalyticsEvent(fireAnalyticsEvent?: (payload: SyncBlockEventPayload) => void): void;
|
|
16
16
|
get referenceManager(): ReferenceSyncBlockStoreManager;
|
|
17
17
|
get sourceManager(): SourceSyncBlockStoreManager;
|
|
18
18
|
destroy(): void;
|
|
19
19
|
}
|
|
20
|
-
export declare const useMemoizedSyncBlockStoreManager: (dataProvider?:
|
|
20
|
+
export declare const useMemoizedSyncBlockStoreManager: (dataProvider?: SyncBlockDataProviderInterface, fireAnalyticsEvent?: (payload: SyncBlockEventPayload) => void) => SyncBlockStoreManager;
|
|
@@ -14,5 +14,6 @@ export declare const updateCacheErrorPayload: (error: string, resourceId?: strin
|
|
|
14
14
|
export declare const fetchReferencesErrorPayload: (error: string, resourceId?: string) => SyncBlockEventPayload;
|
|
15
15
|
export declare const fetchSuccessPayload: (resourceId: string, blockInstanceId?: string, sourceProduct?: string) => RendererSyncBlockEventPayload;
|
|
16
16
|
export declare const createSuccessPayload: (resourceId: string) => SyncBlockEventPayload;
|
|
17
|
+
export declare const createSuccessPayloadNew: (resourceId: string) => SyncBlockEventPayload;
|
|
17
18
|
export declare const updateSuccessPayload: (resourceId: string, hasReference?: boolean) => SyncBlockEventPayload;
|
|
18
19
|
export declare const deleteSuccessPayload: (resourceId: string) => SyncBlockEventPayload;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { SyncBlockInstance } from '../providers/types';
|
|
2
2
|
/**
|
|
3
3
|
* Merges two SyncBlockInstance objects,
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* preserving sourceURL, sourceTitle, sourceSubType, and onSameDocument from the old result
|
|
5
|
+
* when the new result does not have them.
|
|
6
|
+
* This can be extended in the future to resolve other conflicts as needed,
|
|
6
7
|
* e.g. compare timestamps or version numbers to determine which data is more recent.
|
|
7
8
|
*
|
|
8
9
|
* @param oldResult - The existing SyncBlockInstance object.
|
package/package.json
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"uuid": "^3.1.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@atlaskit/editor-common": "^111.
|
|
40
|
+
"@atlaskit/editor-common": "^111.14.0",
|
|
41
41
|
"react": "^18.2.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
"name": "@atlaskit/editor-synced-block-provider",
|
|
83
|
-
"version": "3.29.
|
|
83
|
+
"version": "3.29.2",
|
|
84
84
|
"description": "Synced Block Provider for @atlaskit/editor-plugin-synced-block",
|
|
85
85
|
"author": "Atlassian Pty Ltd",
|
|
86
86
|
"license": "Apache-2.0",
|
|
@@ -90,6 +90,9 @@
|
|
|
90
90
|
"platform-feature-flags": {
|
|
91
91
|
"platform_synced_block_patch_2": {
|
|
92
92
|
"type": "boolean"
|
|
93
|
+
},
|
|
94
|
+
"platform_synced_block_patch_3": {
|
|
95
|
+
"type": "boolean"
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
98
|
}
|