@atlaskit/editor-synced-block-provider 3.12.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.
@@ -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;
@@ -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
@@ -77,7 +77,7 @@
77
77
  }
78
78
  },
79
79
  "name": "@atlaskit/editor-synced-block-provider",
80
- "version": "3.12.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",