@atlaskit/editor-synced-block-provider 3.11.0 → 3.12.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/clients/block-service/blockService.js +2 -2
  3. package/dist/cjs/providers/block-service/blockServiceAPI.js +1 -1
  4. package/dist/cjs/store-manager/referenceSyncBlockStoreManager.js +92 -136
  5. package/dist/cjs/store-manager/sourceSyncBlockStoreManager.js +95 -124
  6. package/dist/cjs/utils/errorHandling.js +79 -19
  7. package/dist/cjs/utils/experienceTracking.js +119 -0
  8. package/dist/es2019/clients/block-service/blockService.js +2 -2
  9. package/dist/es2019/providers/block-service/blockServiceAPI.js +1 -1
  10. package/dist/es2019/store-manager/referenceSyncBlockStoreManager.js +85 -126
  11. package/dist/es2019/store-manager/sourceSyncBlockStoreManager.js +80 -89
  12. package/dist/es2019/utils/errorHandling.js +61 -10
  13. package/dist/es2019/utils/experienceTracking.js +113 -0
  14. package/dist/esm/clients/block-service/blockService.js +2 -2
  15. package/dist/esm/providers/block-service/blockServiceAPI.js +1 -1
  16. package/dist/esm/store-manager/referenceSyncBlockStoreManager.js +93 -137
  17. package/dist/esm/store-manager/sourceSyncBlockStoreManager.js +96 -125
  18. package/dist/esm/utils/errorHandling.js +77 -18
  19. package/dist/esm/utils/experienceTracking.js +113 -0
  20. package/dist/types/clients/block-service/blockService.d.ts +5 -5
  21. package/dist/types/providers/block-service/blockServiceAPI.d.ts +1 -1
  22. package/dist/types/providers/types.d.ts +5 -5
  23. package/dist/types/store-manager/referenceSyncBlockStoreManager.d.ts +0 -1
  24. package/dist/types/store-manager/sourceSyncBlockStoreManager.d.ts +1 -5
  25. package/dist/types/utils/errorHandling.d.ts +14 -9
  26. package/dist/types/utils/experienceTracking.d.ts +51 -0
  27. package/dist/types-ts4.5/clients/block-service/blockService.d.ts +5 -5
  28. package/dist/types-ts4.5/providers/block-service/blockServiceAPI.d.ts +1 -1
  29. package/dist/types-ts4.5/providers/types.d.ts +5 -5
  30. package/dist/types-ts4.5/store-manager/referenceSyncBlockStoreManager.d.ts +0 -1
  31. package/dist/types-ts4.5/store-manager/sourceSyncBlockStoreManager.d.ts +1 -5
  32. package/dist/types-ts4.5/utils/errorHandling.d.ts +14 -9
  33. package/dist/types-ts4.5/utils/experienceTracking.d.ts +51 -0
  34. package/package.json +2 -2
@@ -92,14 +92,14 @@ type UpdateReferenceSyncedBlockOnDocumentRequest = {
92
92
  documentAri: string;
93
93
  noContent?: boolean;
94
94
  };
95
- type BlockIdentifier = {
96
- blockAri: string;
97
- blockInstanceId: string;
98
- };
99
95
  export type BatchRetrieveSyncedBlocksRequest = {
100
96
  blockIdentifiers: BlockIdentifier[];
101
97
  documentAri: string;
102
98
  };
99
+ type BlockIdentifier = {
100
+ blockAri: string;
101
+ blockInstanceId: string;
102
+ };
103
103
  export type BatchRetrieveSyncedBlocksResponse = {
104
104
  error?: Array<ErrorResponse>;
105
105
  success?: Array<BlockContentResponse>;
@@ -116,7 +116,7 @@ export declare class BlockError extends Error {
116
116
  readonly status: number;
117
117
  constructor(status: number);
118
118
  }
119
- export declare const getSyncedBlockContent: ({ blockAri, }: GetSyncedBlockContentRequest) => Promise<BlockContentResponse>;
119
+ export declare const getSyncedBlockContent: ({ blockAri, documentAri, }: GetSyncedBlockContentRequest) => Promise<BlockContentResponse>;
120
120
  /**
121
121
  * Batch retrieves multiple synced blocks by their ARIs.
122
122
  *
@@ -40,7 +40,7 @@ declare class BlockServiceADFFetchProvider implements ADFFetchProvider {
40
40
  private extractResourceIdFromBlockAri;
41
41
  /**
42
42
  * Batch fetches multiple synced blocks by their resource IDs.
43
- * @param blockNodeIdentifiers - Array of block node identifiers, containing block instance (local) ID + resource IDs to fetch
43
+ * @param resourceIds - Array of resource IDs to fetch
44
44
  * @returns Array of SyncBlockInstance results
45
45
  */
46
46
  batchFetchData(blockNodeIdentifiers: BlockNodeIdentifiers[]): Promise<SyncBlockInstance[]>;
@@ -5,6 +5,10 @@ import type { MentionProvider } from '@atlaskit/mention/types';
5
5
  import { NodeDataProvider } from '@atlaskit/node-data-provider';
6
6
  import type { TaskDecisionProvider } from '@atlaskit/task-decision/types';
7
7
  import type { SyncBlockData, ResourceId, SyncBlockError, SyncBlockNode, SyncBlockProduct, BlockInstanceId, SyncBlockAttrs, ReferenceSyncBlockData } from '../common/types';
8
+ export type BlockNodeIdentifiers = {
9
+ blockInstanceId: string;
10
+ resourceId: string;
11
+ };
8
12
  /**
9
13
  * The instance of a sync block, containing its data and metadata.
10
14
  * Mainly used for representing the state of a sync block after fetching from a data provider.
@@ -52,10 +56,6 @@ export type UpdateReferenceSyncBlockResult = {
52
56
  error?: string;
53
57
  success: boolean;
54
58
  };
55
- export type BlockNodeIdentifiers = {
56
- blockInstanceId: string;
57
- resourceId: string;
58
- };
59
59
  export interface ADFFetchProvider {
60
60
  batchFetchData: (blockNodeIdentifiers: BlockNodeIdentifiers[]) => Promise<SyncBlockInstance[]>;
61
61
  fetchData: (resourceId: ResourceId) => Promise<SyncBlockInstance>;
@@ -88,8 +88,8 @@ export type SyncedBlockRendererDataProviders = {
88
88
  export type SyncBlockRendererProviderCreator = {
89
89
  createEmojiProvider: ((options: MediaEmojiProviderOptions) => Promise<EmojiProvider> | undefined) | undefined;
90
90
  createMediaProvider: ((options: MediaEmojiProviderOptions) => Promise<MediaProvider> | undefined) | undefined;
91
- createSmartLinkProvider: (() => Promise<CardProvider>) | undefined;
92
91
  createSSRMediaProvider?: ((options: MediaEmojiProviderOptions) => MediaProvider | undefined) | undefined;
92
+ createSmartLinkProvider: (() => Promise<CardProvider>) | undefined;
93
93
  };
94
94
  export type SyncedBlockRendererProviderOptions = {
95
95
  parentDataProviders?: SyncedBlockRendererDataProviders;
@@ -22,7 +22,6 @@ export declare class ReferenceSyncBlockStoreManager {
22
22
  private saveExperience;
23
23
  constructor(dataProvider?: SyncBlockDataProvider);
24
24
  setFireAnalyticsEvent(fireAnalyticsEvent?: (payload: RendererSyncBlockEventPayload) => void): void;
25
- setExperiences(fetchExperience: Experience, fetchSourceInfoExperience: Experience, saveExperience: Experience): void;
26
25
  generateResourceIdForReference(sourceId: ResourceId): ResourceId;
27
26
  updateFireAnalyticsEvent(fireAnalyticsEvent?: (payload: RendererSyncBlockEventPayload) => void): void;
28
27
  getInitialSyncBlockData(resourceId: ResourceId): SyncBlockInstance | undefined;
@@ -1,5 +1,4 @@
1
1
  import { type SyncBlockEventPayload } from '@atlaskit/editor-common/analytics';
2
- import type { Experience } from '@atlaskit/editor-common/experiences';
3
2
  import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
3
  import { type ResourceId, type SyncBlockAttrs, type BlockInstanceId } from '../common/types';
5
4
  import type { SyncBlockDataProvider, SyncBlockSourceInfo } from '../providers/types';
@@ -16,14 +15,11 @@ export declare class SourceSyncBlockStoreManager {
16
15
  private deletionRetryInfo?;
17
16
  private pendingResourceId?;
18
17
  private creationCallback?;
19
- createExperience: Experience | undefined;
18
+ private createExperience;
20
19
  private saveExperience;
21
20
  private deleteExperience;
22
21
  constructor(dataProvider?: SyncBlockDataProvider);
23
22
  setFireAnalyticsEvent(fireAnalyticsEvent?: (payload: SyncBlockEventPayload) => void): void;
24
- setCreateExperience(createExperience: Experience): void;
25
- setSaveExperience(saveExperience: Experience): void;
26
- setDeleteExperience(deleteExperience: Experience): void;
27
23
  isSourceBlock(node: PMNode): boolean;
28
24
  /**
29
25
  * Add/update a sync block node to/from the local cache
@@ -1,13 +1,18 @@
1
1
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, type RendererSyncBlockEventPayload, type OperationalAEP, type SyncBlockEventPayload } from '@atlaskit/editor-common/analytics';
2
2
  export declare const stringifyError: (error: unknown) => string | undefined;
3
- export declare const getErrorPayload: <T extends ACTION_SUBJECT_ID>(actionSubjectId: T, error: string) => OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, T, {
3
+ export declare const getErrorPayload: <T extends ACTION_SUBJECT_ID>(actionSubjectId: T, error: string, resourceId?: string) => OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, T, {
4
4
  error: string;
5
+ resourceId?: string;
5
6
  }>;
6
- export declare const fetchErrorPayload: (error: string) => RendererSyncBlockEventPayload;
7
- export declare const getSourceInfoErrorPayload: (error: string) => RendererSyncBlockEventPayload;
8
- export declare const updateErrorPayload: (error: string) => SyncBlockEventPayload;
9
- export declare const updateReferenceErrorPayload: (error: string) => RendererSyncBlockEventPayload;
10
- export declare const createErrorPayload: (error: string) => SyncBlockEventPayload;
11
- export declare const deleteErrorPayload: (error: string) => SyncBlockEventPayload;
12
- export declare const updateCacheErrorPayload: (error: string) => SyncBlockEventPayload;
13
- export declare const fetchReferencesErrorPayload: (error: string) => SyncBlockEventPayload;
7
+ export declare const fetchErrorPayload: (error: string, resourceId?: string) => RendererSyncBlockEventPayload;
8
+ export declare const getSourceInfoErrorPayload: (error: string, resourceId?: string) => RendererSyncBlockEventPayload;
9
+ export declare const updateErrorPayload: (error: string, resourceId?: string) => SyncBlockEventPayload;
10
+ export declare const updateReferenceErrorPayload: (error: string, resourceId?: string) => RendererSyncBlockEventPayload;
11
+ export declare const createErrorPayload: (error: string, resourceId?: string) => SyncBlockEventPayload;
12
+ export declare const deleteErrorPayload: (error: string, resourceId?: string) => SyncBlockEventPayload;
13
+ export declare const updateCacheErrorPayload: (error: string, resourceId?: string) => SyncBlockEventPayload;
14
+ export declare const fetchReferencesErrorPayload: (error: string, resourceId?: string) => SyncBlockEventPayload;
15
+ export declare const fetchSuccessPayload: (resourceId: string, blockInstanceId?: string, sourceProduct?: string) => RendererSyncBlockEventPayload;
16
+ export declare const createSuccessPayload: (resourceId: string) => SyncBlockEventPayload;
17
+ export declare const updateSuccessPayload: (resourceId: string, hasReference?: boolean) => SyncBlockEventPayload;
18
+ export declare const deleteSuccessPayload: (resourceId: string) => SyncBlockEventPayload;
@@ -0,0 +1,51 @@
1
+ import { type DispatchAnalyticsEvent, type SyncBlockEventPayload, type RendererSyncBlockEventPayload } from '@atlaskit/editor-common/analytics';
2
+ import { Experience } from '@atlaskit/editor-common/experiences';
3
+ export declare const createExperienceDispatcher: (fireAnalyticsEvent?: ((payload: SyncBlockEventPayload) => void) | ((payload: RendererSyncBlockEventPayload) => void)) => DispatchAnalyticsEvent;
4
+ /**
5
+ * This experience tracks when a source sync block is saved to the BE.
6
+ *
7
+ * Start: When the flush source sync block function is called.
8
+ * Success: When the sync block save is successful within the timeout duration of start.
9
+ * Failure: When the timeout duration passes without the sync block being successfully saved
10
+ */
11
+ export declare const getSaveSourceExperience: (fireAnalyticsEvent?: (payload: SyncBlockEventPayload) => void) => Experience;
12
+ /**
13
+ * This experience tracks when a reference sync block is saved to the BE.
14
+ *
15
+ * Start: When the flush sync block function is called.
16
+ * Success: When the sync block save is successful within the timeout duration of start.
17
+ * Failure: When the timeout duration passes without the sync block being successfully saved
18
+ */
19
+ export declare const getSaveReferenceExperience: (fireAnalyticsEvent?: (payload: RendererSyncBlockEventPayload) => void) => Experience;
20
+ /**
21
+ * This experience tracks when a reference sync block data is fetched from the BE.
22
+ *
23
+ * Start: When the fetchNodesData function is called.
24
+ * Success: When the fetching the data is successful within the timeout duration of start.
25
+ * Failure: When the timeout duration passes without the data being successfully fetched, or the fetch fails
26
+ */
27
+ export declare const getFetchExperience: (fireAnalyticsEvent?: (payload: RendererSyncBlockEventPayload) => void) => Experience;
28
+ /**
29
+ * This experience tracks when a reference sync block source info data (title, url) is fetched from the BE.
30
+ *
31
+ * Start: When the fetchSourceInfo function is called.
32
+ * Success: When the fetching the data is successful within the timeout duration of start.
33
+ * Failure: When the timeout duration passes without the data being successfully fetched, or the fetch fails
34
+ */
35
+ export declare const getFetchSourceInfoExperience: (fireAnalyticsEvent?: (payload: RendererSyncBlockEventPayload) => void) => Experience;
36
+ /**
37
+ * This experience tracks when a source sync block is deleted from the BE.
38
+ *
39
+ * Start: When the fetchSourceInfo function is called.
40
+ * Success: When the fetching the data is successful within the timeout duration of start.
41
+ * Failure: When the timeout duration passes without the data being successfully fetched, or the fetch fails
42
+ */
43
+ export declare const getDeleteSourceExperience: (fireAnalyticsEvent?: (payload: SyncBlockEventPayload) => void) => Experience;
44
+ /**
45
+ * This experience tracks when a source sync block is created and registered to the BE.
46
+ *
47
+ * Start: When the fetchSourceInfo function is called.
48
+ * Success: When the fetching the data is successful within the timeout duration of start.
49
+ * Failure: When the timeout duration passes without the data being successfully fetched, or the fetch fails
50
+ */
51
+ export declare const getCreateSourceExperience: (fireAnalyticsEvent?: (payload: SyncBlockEventPayload) => void) => Experience;
@@ -92,14 +92,14 @@ type UpdateReferenceSyncedBlockOnDocumentRequest = {
92
92
  documentAri: string;
93
93
  noContent?: boolean;
94
94
  };
95
- type BlockIdentifier = {
96
- blockAri: string;
97
- blockInstanceId: string;
98
- };
99
95
  export type BatchRetrieveSyncedBlocksRequest = {
100
96
  blockIdentifiers: BlockIdentifier[];
101
97
  documentAri: string;
102
98
  };
99
+ type BlockIdentifier = {
100
+ blockAri: string;
101
+ blockInstanceId: string;
102
+ };
103
103
  export type BatchRetrieveSyncedBlocksResponse = {
104
104
  error?: Array<ErrorResponse>;
105
105
  success?: Array<BlockContentResponse>;
@@ -116,7 +116,7 @@ export declare class BlockError extends Error {
116
116
  readonly status: number;
117
117
  constructor(status: number);
118
118
  }
119
- export declare const getSyncedBlockContent: ({ blockAri, }: GetSyncedBlockContentRequest) => Promise<BlockContentResponse>;
119
+ export declare const getSyncedBlockContent: ({ blockAri, documentAri, }: GetSyncedBlockContentRequest) => Promise<BlockContentResponse>;
120
120
  /**
121
121
  * Batch retrieves multiple synced blocks by their ARIs.
122
122
  *
@@ -40,7 +40,7 @@ declare class BlockServiceADFFetchProvider implements ADFFetchProvider {
40
40
  private extractResourceIdFromBlockAri;
41
41
  /**
42
42
  * Batch fetches multiple synced blocks by their resource IDs.
43
- * @param blockNodeIdentifiers - Array of block node identifiers, containing block instance (local) ID + resource IDs to fetch
43
+ * @param resourceIds - Array of resource IDs to fetch
44
44
  * @returns Array of SyncBlockInstance results
45
45
  */
46
46
  batchFetchData(blockNodeIdentifiers: BlockNodeIdentifiers[]): Promise<SyncBlockInstance[]>;
@@ -5,6 +5,10 @@ import type { MentionProvider } from '@atlaskit/mention/types';
5
5
  import { NodeDataProvider } from '@atlaskit/node-data-provider';
6
6
  import type { TaskDecisionProvider } from '@atlaskit/task-decision/types';
7
7
  import type { SyncBlockData, ResourceId, SyncBlockError, SyncBlockNode, SyncBlockProduct, BlockInstanceId, SyncBlockAttrs, ReferenceSyncBlockData } from '../common/types';
8
+ export type BlockNodeIdentifiers = {
9
+ blockInstanceId: string;
10
+ resourceId: string;
11
+ };
8
12
  /**
9
13
  * The instance of a sync block, containing its data and metadata.
10
14
  * Mainly used for representing the state of a sync block after fetching from a data provider.
@@ -52,10 +56,6 @@ export type UpdateReferenceSyncBlockResult = {
52
56
  error?: string;
53
57
  success: boolean;
54
58
  };
55
- export type BlockNodeIdentifiers = {
56
- blockInstanceId: string;
57
- resourceId: string;
58
- };
59
59
  export interface ADFFetchProvider {
60
60
  batchFetchData: (blockNodeIdentifiers: BlockNodeIdentifiers[]) => Promise<SyncBlockInstance[]>;
61
61
  fetchData: (resourceId: ResourceId) => Promise<SyncBlockInstance>;
@@ -88,8 +88,8 @@ export type SyncedBlockRendererDataProviders = {
88
88
  export type SyncBlockRendererProviderCreator = {
89
89
  createEmojiProvider: ((options: MediaEmojiProviderOptions) => Promise<EmojiProvider> | undefined) | undefined;
90
90
  createMediaProvider: ((options: MediaEmojiProviderOptions) => Promise<MediaProvider> | undefined) | undefined;
91
- createSmartLinkProvider: (() => Promise<CardProvider>) | undefined;
92
91
  createSSRMediaProvider?: ((options: MediaEmojiProviderOptions) => MediaProvider | undefined) | undefined;
92
+ createSmartLinkProvider: (() => Promise<CardProvider>) | undefined;
93
93
  };
94
94
  export type SyncedBlockRendererProviderOptions = {
95
95
  parentDataProviders?: SyncedBlockRendererDataProviders;
@@ -22,7 +22,6 @@ export declare class ReferenceSyncBlockStoreManager {
22
22
  private saveExperience;
23
23
  constructor(dataProvider?: SyncBlockDataProvider);
24
24
  setFireAnalyticsEvent(fireAnalyticsEvent?: (payload: RendererSyncBlockEventPayload) => void): void;
25
- setExperiences(fetchExperience: Experience, fetchSourceInfoExperience: Experience, saveExperience: Experience): void;
26
25
  generateResourceIdForReference(sourceId: ResourceId): ResourceId;
27
26
  updateFireAnalyticsEvent(fireAnalyticsEvent?: (payload: RendererSyncBlockEventPayload) => void): void;
28
27
  getInitialSyncBlockData(resourceId: ResourceId): SyncBlockInstance | undefined;
@@ -1,5 +1,4 @@
1
1
  import { type SyncBlockEventPayload } from '@atlaskit/editor-common/analytics';
2
- import type { Experience } from '@atlaskit/editor-common/experiences';
3
2
  import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
3
  import { type ResourceId, type SyncBlockAttrs, type BlockInstanceId } from '../common/types';
5
4
  import type { SyncBlockDataProvider, SyncBlockSourceInfo } from '../providers/types';
@@ -16,14 +15,11 @@ export declare class SourceSyncBlockStoreManager {
16
15
  private deletionRetryInfo?;
17
16
  private pendingResourceId?;
18
17
  private creationCallback?;
19
- createExperience: Experience | undefined;
18
+ private createExperience;
20
19
  private saveExperience;
21
20
  private deleteExperience;
22
21
  constructor(dataProvider?: SyncBlockDataProvider);
23
22
  setFireAnalyticsEvent(fireAnalyticsEvent?: (payload: SyncBlockEventPayload) => void): void;
24
- setCreateExperience(createExperience: Experience): void;
25
- setSaveExperience(saveExperience: Experience): void;
26
- setDeleteExperience(deleteExperience: Experience): void;
27
23
  isSourceBlock(node: PMNode): boolean;
28
24
  /**
29
25
  * Add/update a sync block node to/from the local cache
@@ -1,13 +1,18 @@
1
1
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, type RendererSyncBlockEventPayload, type OperationalAEP, type SyncBlockEventPayload } from '@atlaskit/editor-common/analytics';
2
2
  export declare const stringifyError: (error: unknown) => string | undefined;
3
- export declare const getErrorPayload: <T extends ACTION_SUBJECT_ID>(actionSubjectId: T, error: string) => OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, T, {
3
+ export declare const getErrorPayload: <T extends ACTION_SUBJECT_ID>(actionSubjectId: T, error: string, resourceId?: string) => OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, T, {
4
4
  error: string;
5
+ resourceId?: string;
5
6
  }>;
6
- export declare const fetchErrorPayload: (error: string) => RendererSyncBlockEventPayload;
7
- export declare const getSourceInfoErrorPayload: (error: string) => RendererSyncBlockEventPayload;
8
- export declare const updateErrorPayload: (error: string) => SyncBlockEventPayload;
9
- export declare const updateReferenceErrorPayload: (error: string) => RendererSyncBlockEventPayload;
10
- export declare const createErrorPayload: (error: string) => SyncBlockEventPayload;
11
- export declare const deleteErrorPayload: (error: string) => SyncBlockEventPayload;
12
- export declare const updateCacheErrorPayload: (error: string) => SyncBlockEventPayload;
13
- export declare const fetchReferencesErrorPayload: (error: string) => SyncBlockEventPayload;
7
+ export declare const fetchErrorPayload: (error: string, resourceId?: string) => RendererSyncBlockEventPayload;
8
+ export declare const getSourceInfoErrorPayload: (error: string, resourceId?: string) => RendererSyncBlockEventPayload;
9
+ export declare const updateErrorPayload: (error: string, resourceId?: string) => SyncBlockEventPayload;
10
+ export declare const updateReferenceErrorPayload: (error: string, resourceId?: string) => RendererSyncBlockEventPayload;
11
+ export declare const createErrorPayload: (error: string, resourceId?: string) => SyncBlockEventPayload;
12
+ export declare const deleteErrorPayload: (error: string, resourceId?: string) => SyncBlockEventPayload;
13
+ export declare const updateCacheErrorPayload: (error: string, resourceId?: string) => SyncBlockEventPayload;
14
+ export declare const fetchReferencesErrorPayload: (error: string, resourceId?: string) => SyncBlockEventPayload;
15
+ export declare const fetchSuccessPayload: (resourceId: string, blockInstanceId?: string, sourceProduct?: string) => RendererSyncBlockEventPayload;
16
+ export declare const createSuccessPayload: (resourceId: string) => SyncBlockEventPayload;
17
+ export declare const updateSuccessPayload: (resourceId: string, hasReference?: boolean) => SyncBlockEventPayload;
18
+ export declare const deleteSuccessPayload: (resourceId: string) => SyncBlockEventPayload;
@@ -0,0 +1,51 @@
1
+ import { type DispatchAnalyticsEvent, type SyncBlockEventPayload, type RendererSyncBlockEventPayload } from '@atlaskit/editor-common/analytics';
2
+ import { Experience } from '@atlaskit/editor-common/experiences';
3
+ export declare const createExperienceDispatcher: (fireAnalyticsEvent?: ((payload: SyncBlockEventPayload) => void) | ((payload: RendererSyncBlockEventPayload) => void)) => DispatchAnalyticsEvent;
4
+ /**
5
+ * This experience tracks when a source sync block is saved to the BE.
6
+ *
7
+ * Start: When the flush source sync block function is called.
8
+ * Success: When the sync block save is successful within the timeout duration of start.
9
+ * Failure: When the timeout duration passes without the sync block being successfully saved
10
+ */
11
+ export declare const getSaveSourceExperience: (fireAnalyticsEvent?: (payload: SyncBlockEventPayload) => void) => Experience;
12
+ /**
13
+ * This experience tracks when a reference sync block is saved to the BE.
14
+ *
15
+ * Start: When the flush sync block function is called.
16
+ * Success: When the sync block save is successful within the timeout duration of start.
17
+ * Failure: When the timeout duration passes without the sync block being successfully saved
18
+ */
19
+ export declare const getSaveReferenceExperience: (fireAnalyticsEvent?: (payload: RendererSyncBlockEventPayload) => void) => Experience;
20
+ /**
21
+ * This experience tracks when a reference sync block data is fetched from the BE.
22
+ *
23
+ * Start: When the fetchNodesData function is called.
24
+ * Success: When the fetching the data is successful within the timeout duration of start.
25
+ * Failure: When the timeout duration passes without the data being successfully fetched, or the fetch fails
26
+ */
27
+ export declare const getFetchExperience: (fireAnalyticsEvent?: (payload: RendererSyncBlockEventPayload) => void) => Experience;
28
+ /**
29
+ * This experience tracks when a reference sync block source info data (title, url) is fetched from the BE.
30
+ *
31
+ * Start: When the fetchSourceInfo function is called.
32
+ * Success: When the fetching the data is successful within the timeout duration of start.
33
+ * Failure: When the timeout duration passes without the data being successfully fetched, or the fetch fails
34
+ */
35
+ export declare const getFetchSourceInfoExperience: (fireAnalyticsEvent?: (payload: RendererSyncBlockEventPayload) => void) => Experience;
36
+ /**
37
+ * This experience tracks when a source sync block is deleted from the BE.
38
+ *
39
+ * Start: When the fetchSourceInfo function is called.
40
+ * Success: When the fetching the data is successful within the timeout duration of start.
41
+ * Failure: When the timeout duration passes without the data being successfully fetched, or the fetch fails
42
+ */
43
+ export declare const getDeleteSourceExperience: (fireAnalyticsEvent?: (payload: SyncBlockEventPayload) => void) => Experience;
44
+ /**
45
+ * This experience tracks when a source sync block is created and registered to the BE.
46
+ *
47
+ * Start: When the fetchSourceInfo function is called.
48
+ * Success: When the fetching the data is successful within the timeout duration of start.
49
+ * Failure: When the timeout duration passes without the data being successfully fetched, or the fetch fails
50
+ */
51
+ export declare const getCreateSourceExperience: (fireAnalyticsEvent?: (payload: SyncBlockEventPayload) => void) => Experience;
package/package.json CHANGED
@@ -24,7 +24,7 @@
24
24
  ],
25
25
  "atlaskit:src": "src/index.ts",
26
26
  "dependencies": {
27
- "@atlaskit/adf-utils": "^19.26.0",
27
+ "@atlaskit/adf-utils": "^19.27.0",
28
28
  "@atlaskit/editor-json-transformer": "^8.31.0",
29
29
  "@atlaskit/editor-prosemirror": "^7.2.0",
30
30
  "@atlaskit/node-data-provider": "^8.0.0",
@@ -77,7 +77,7 @@
77
77
  }
78
78
  },
79
79
  "name": "@atlaskit/editor-synced-block-provider",
80
- "version": "3.11.0",
80
+ "version": "3.12.1",
81
81
  "description": "Synced Block Provider for @atlaskit/editor-plugin-synced-block",
82
82
  "author": "Atlassian Pty Ltd",
83
83
  "license": "Apache-2.0",