@atlaskit/editor-synced-block-provider 7.0.14 → 8.0.0

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 (91) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/blockService/ari/package.json +1 -8
  3. package/blockService/package.json +1 -8
  4. package/blockSubscription/package.json +1 -8
  5. package/clients/confluence/ari/package.json +1 -8
  6. package/common/types/package.json +1 -8
  7. package/errorHandling/package.json +1 -8
  8. package/fetchJiraMediaToken/package.json +1 -8
  9. package/fetchMediaToken/package.json +1 -8
  10. package/jira/ari/package.json +1 -8
  11. package/package.json +8 -16
  12. package/providers/block-service/blockServiceAPI/package.json +1 -8
  13. package/providers/types/package.json +1 -8
  14. package/rebaseTransaction/package.json +1 -8
  15. package/referenceSyncBlockStoreManager/package.json +1 -8
  16. package/requestJiraIssueAccess/package.json +1 -8
  17. package/resolveSyncBlockInstance/package.json +1 -8
  18. package/sourceInfo/package.json +1 -8
  19. package/syncBlockInMemorySessionCache/package.json +1 -8
  20. package/syncBlockProvider/package.json +1 -8
  21. package/syncBlockStoreManager/package.json +1 -8
  22. package/tokenRouting/package.json +1 -8
  23. package/types/package.json +1 -8
  24. package/useFetchSyncBlockData/package.json +1 -8
  25. package/useFetchSyncBlockTitle/package.json +1 -8
  26. package/useHandleContentChanges/package.json +1 -8
  27. package/utils/package.json +1 -8
  28. package/utils/resourceId/package.json +1 -8
  29. package/validValue/package.json +1 -8
  30. package/dist/types-ts4.5/clients/block-service/ari.d.ts +0 -34
  31. package/dist/types-ts4.5/clients/block-service/blockService.d.ts +0 -187
  32. package/dist/types-ts4.5/clients/block-service/blockSubscription.d.ts +0 -52
  33. package/dist/types-ts4.5/clients/confluence/ari.d.ts +0 -27
  34. package/dist/types-ts4.5/clients/confluence/fetchMediaToken.d.ts +0 -10
  35. package/dist/types-ts4.5/clients/confluence/sourceInfo.d.ts +0 -2
  36. package/dist/types-ts4.5/clients/confluence/utils.d.ts +0 -2
  37. package/dist/types-ts4.5/clients/jira/ari.d.ts +0 -18
  38. package/dist/types-ts4.5/clients/jira/fetchMediaToken.d.ts +0 -9
  39. package/dist/types-ts4.5/clients/jira/requestJiraIssueAccess.d.ts +0 -13
  40. package/dist/types-ts4.5/clients/jira/sourceInfo.d.ts +0 -22
  41. package/dist/types-ts4.5/clients/tokenRouting.d.ts +0 -11
  42. package/dist/types-ts4.5/common/consts.d.ts +0 -4
  43. package/dist/types-ts4.5/common/rebase-transaction.d.ts +0 -11
  44. package/dist/types-ts4.5/common/types.d.ts +0 -82
  45. package/dist/types-ts4.5/entry-points/blockService-ari.d.ts +0 -1
  46. package/dist/types-ts4.5/entry-points/blockService.d.ts +0 -2
  47. package/dist/types-ts4.5/entry-points/blockServiceAPI.d.ts +0 -1
  48. package/dist/types-ts4.5/entry-points/blockSubscription.d.ts +0 -1
  49. package/dist/types-ts4.5/entry-points/common-types.d.ts +0 -2
  50. package/dist/types-ts4.5/entry-points/confluence-ari.d.ts +0 -1
  51. package/dist/types-ts4.5/entry-points/errorHandling.d.ts +0 -1
  52. package/dist/types-ts4.5/entry-points/fetchJiraMediaToken.d.ts +0 -1
  53. package/dist/types-ts4.5/entry-points/fetchMediaToken.d.ts +0 -2
  54. package/dist/types-ts4.5/entry-points/jira-ari.d.ts +0 -1
  55. package/dist/types-ts4.5/entry-points/providers-types.d.ts +0 -1
  56. package/dist/types-ts4.5/entry-points/rebaseTransaction.d.ts +0 -1
  57. package/dist/types-ts4.5/entry-points/referenceSyncBlockStoreManager.d.ts +0 -1
  58. package/dist/types-ts4.5/entry-points/requestJiraIssueAccess.d.ts +0 -2
  59. package/dist/types-ts4.5/entry-points/resolveSyncBlockInstance.d.ts +0 -1
  60. package/dist/types-ts4.5/entry-points/resourceId.d.ts +0 -1
  61. package/dist/types-ts4.5/entry-points/sourceInfo.d.ts +0 -1
  62. package/dist/types-ts4.5/entry-points/syncBlockInMemorySessionCache.d.ts +0 -1
  63. package/dist/types-ts4.5/entry-points/syncBlockProvider.d.ts +0 -1
  64. package/dist/types-ts4.5/entry-points/syncBlockStoreManager.d.ts +0 -1
  65. package/dist/types-ts4.5/entry-points/tokenRouting.d.ts +0 -1
  66. package/dist/types-ts4.5/entry-points/useFetchSyncBlockData.d.ts +0 -2
  67. package/dist/types-ts4.5/entry-points/useFetchSyncBlockTitle.d.ts +0 -1
  68. package/dist/types-ts4.5/entry-points/useHandleContentChanges.d.ts +0 -1
  69. package/dist/types-ts4.5/entry-points/utils.d.ts +0 -1
  70. package/dist/types-ts4.5/entry-points/validValue.d.ts +0 -1
  71. package/dist/types-ts4.5/hooks/useFetchSyncBlockData.d.ts +0 -16
  72. package/dist/types-ts4.5/hooks/useFetchSyncBlockTitle.d.ts +0 -3
  73. package/dist/types-ts4.5/hooks/useHandleContentChanges.d.ts +0 -3
  74. package/dist/types-ts4.5/index.d.ts +0 -25
  75. package/dist/types-ts4.5/providers/block-service/blockServiceAPI.d.ts +0 -127
  76. package/dist/types-ts4.5/providers/syncBlockProvider.d.ts +0 -110
  77. package/dist/types-ts4.5/providers/types.d.ts +0 -185
  78. package/dist/types-ts4.5/store-manager/referenceSyncBlockStoreManager.d.ts +0 -147
  79. package/dist/types-ts4.5/store-manager/sourceSyncBlockStoreManager.d.ts +0 -128
  80. package/dist/types-ts4.5/store-manager/syncBlockBatchFetcher.d.ts +0 -33
  81. package/dist/types-ts4.5/store-manager/syncBlockInMemorySessionCache.d.ts +0 -41
  82. package/dist/types-ts4.5/store-manager/syncBlockProviderFactoryManager.d.ts +0 -26
  83. package/dist/types-ts4.5/store-manager/syncBlockStoreManager.d.ts +0 -24
  84. package/dist/types-ts4.5/store-manager/syncBlockSubscriptionManager.d.ts +0 -84
  85. package/dist/types-ts4.5/utils/errorHandling.d.ts +0 -36
  86. package/dist/types-ts4.5/utils/experienceTracking.d.ts +0 -59
  87. package/dist/types-ts4.5/utils/resolveSyncBlockInstance.d.ts +0 -13
  88. package/dist/types-ts4.5/utils/resourceId.d.ts +0 -7
  89. package/dist/types-ts4.5/utils/retry.d.ts +0 -1
  90. package/dist/types-ts4.5/utils/utils.d.ts +0 -15
  91. package/dist/types-ts4.5/utils/validValue.d.ts +0 -3
@@ -1,187 +0,0 @@
1
- import type { ReferenceSyncBlockResponse, SyncBlockProduct, SyncBlockStatus, DeletionReason } from '../../common/types';
2
- import type { BatchFetchConfig } from '../../providers/types';
3
- export type BlockContentResponse = {
4
- blockAri: string;
5
- blockInstanceId: string;
6
- content: string;
7
- contentUpdatedAt: number;
8
- createdAt: number;
9
- createdBy: string;
10
- deletionReason: DeletionReason;
11
- product: SyncBlockProduct;
12
- sourceAri: string;
13
- status: SyncBlockStatus;
14
- version: number;
15
- };
16
- export type ErrorResponse = {
17
- blockAri: string;
18
- code: string;
19
- documentAri: string;
20
- reason: string;
21
- };
22
- type ReferenceSyncedBlockResponse = {
23
- blocks?: Array<BlockContentResponse>;
24
- errors?: Array<ErrorResponse>;
25
- };
26
- export declare const isBlockContentResponse: (response: BlockContentResponse | ErrorResponse) => response is BlockContentResponse;
27
- /**
28
- * Retrieves all synced blocks referenced in a document.
29
- *
30
- * Calls the Block Service GraphQL API: `blockService_getDocumentReferenceBlocks`
31
- *
32
- * @param documentAri - The ARI of the document to fetch synced blocks for
33
- * @returns A promise containing arrays of successfully fetched blocks and any errors encountered
34
- *
35
- * @example
36
- * ```typescript
37
- * const { blocks, errors } = await getReferenceSyncedBlocks(
38
- * 'ari:cloud:confluence:xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx:page/88888888'
39
- * );
40
- * ```
41
- *
42
- * Example response:
43
- * ```json
44
- * {
45
- * "blocks": [
46
- * {
47
- * "blockAri": "ari:cloud:blocks:xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx:synced-block/xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",
48
- * "version": 1,
49
- * "sourceDocumentAri": "ari:cloud:confluence:xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx:page/88888888",
50
- * "blockInstanceId": "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",
51
- * "content": "string",
52
- * "status": "active",
53
- * "createdAt": "2025-10-08T10:30:00.000Z",
54
- * "createdBy": "557058:xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",
55
- * "contentUpdatedAt": "2025-10-08T10:30:00.000Z"
56
- * }
57
- * ],
58
- * "errors": [
59
- * {
60
- * "blockAri": "ari:cloud:blocks:xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx:synced-block/xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",
61
- * "code": "error",
62
- * "reason": "some error reason"
63
- * }
64
- * ]
65
- * }
66
- * ```
67
- */
68
- export declare const getReferenceSyncedBlocks: (documentAri: string) => Promise<ReferenceSyncedBlockResponse>;
69
- export type GetSyncedBlockContentRequest = {
70
- blockAri: string;
71
- };
72
- export type DeleteSyncedBlockRequest = {
73
- blockAri: string;
74
- deleteReason: string | undefined;
75
- };
76
- export type UpdateSyncedBlockRequest = {
77
- blockAri: string;
78
- content: string;
79
- status?: SyncBlockStatus;
80
- stepVersion?: number;
81
- };
82
- export type BatchUpdateSyncedBlockRequest = {
83
- blockAri: string;
84
- content: string;
85
- status?: SyncBlockStatus;
86
- stepVersion?: number;
87
- };
88
- export type BatchUpdateSyncedBlocksRequest = {
89
- blocks: BatchUpdateSyncedBlockRequest[];
90
- };
91
- export type BatchUpdateSyncedBlocksResponse = {
92
- error?: Array<ErrorResponse>;
93
- success?: Array<BlockContentResponse>;
94
- };
95
- export type CreateSyncedBlockRequest = {
96
- blockAri: string;
97
- blockInstanceId: string;
98
- content: string;
99
- product: SyncBlockProduct;
100
- sourceAri: string;
101
- status?: SyncBlockStatus;
102
- stepVersion?: number;
103
- };
104
- type ReferenceSyncedBlockIDs = {
105
- blockAri: string;
106
- blockInstanceId: string;
107
- };
108
- type UpdateReferenceSyncedBlockOnDocumentRequest = {
109
- blocks: ReferenceSyncedBlockIDs[];
110
- documentAri: string;
111
- noContent?: boolean;
112
- };
113
- export type BatchRetrieveSyncedBlocksRequest = {
114
- blockIdentifiers: BlockIdentifier[];
115
- config?: BatchFetchConfig;
116
- };
117
- type BlockIdentifier = {
118
- blockAri: string;
119
- blockInstanceId: string;
120
- };
121
- export type BatchRetrieveSyncedBlocksResponse = {
122
- error?: Array<ErrorResponse>;
123
- success?: Array<BlockContentResponse>;
124
- };
125
- type GetReferenceSyncedBlocksByBlockAriRequest = {
126
- blockAri: string;
127
- };
128
- type GetReferenceSyncedBlocksByBlockAriResponse = {
129
- blockAri?: string;
130
- errors: Array<ErrorResponse>;
131
- references: Array<ReferenceSyncBlockResponse>;
132
- };
133
- export declare class BlockError extends Error {
134
- readonly status: number;
135
- constructor(status: number);
136
- }
137
- /**
138
- * Thrown when Block Service returns RESOURCE_NOT_FOUND for a block.
139
- * This typically happens when an orphan block (e.g. from a copied page) is deleted.
140
- * The caller should create the block first, then delete it to ensure a proper soft-delete record.
141
- */
142
- export declare class BlockNotFoundError extends Error {
143
- constructor();
144
- }
145
- export declare class BlockTimeoutError extends Error {
146
- constructor();
147
- }
148
- export declare const getSyncedBlockContent: ({ blockAri, }: GetSyncedBlockContentRequest) => Promise<BlockContentResponse>;
149
- /**
150
- * Batch retrieves multiple synced blocks by their ARIs.
151
- *
152
- * Calls the Block Service GraphQL API: `blockService_batchRetrieveBlocks`
153
- *
154
- * @param blockIdentifiers - Array of block identifiers to retrieve
155
- * @param config - Optional batch fetch configuration (e.g. timeout)
156
- * @returns A promise containing arrays of successfully fetched blocks and any errors encountered
157
- */
158
- export declare const batchRetrieveSyncedBlocks: ({ blockIdentifiers, config, }: BatchRetrieveSyncedBlocksRequest) => Promise<BatchRetrieveSyncedBlocksResponse>;
159
- export declare const deleteSyncedBlock: ({ blockAri, deleteReason, }: DeleteSyncedBlockRequest) => Promise<void>;
160
- export declare const updateSyncedBlock: ({ blockAri, content, stepVersion, status, }: UpdateSyncedBlockRequest) => Promise<void>;
161
- export declare const createSyncedBlock: ({ blockAri, blockInstanceId, sourceAri, product, content, stepVersion, status, }: CreateSyncedBlockRequest) => Promise<BlockContentResponse>;
162
- export declare const updateReferenceSyncedBlockOnDocument: ({ documentAri, blocks, noContent, }: UpdateReferenceSyncedBlockOnDocumentRequest) => Promise<ReferenceSyncedBlockResponse | void>;
163
- export declare const getReferenceSyncedBlocksByBlockAri: ({ blockAri, }: GetReferenceSyncedBlocksByBlockAriRequest) => Promise<GetReferenceSyncedBlocksByBlockAriResponse>;
164
- /**
165
- * Batch updates multiple synced blocks.
166
- *
167
- * Calls the Block Service GraphQL API: `blockService_batchUpdateBlocks`
168
- *
169
- * @param blocks - Array of block updates to apply
170
- * @returns A promise containing arrays of successfully updated blocks and any errors encountered
171
- *
172
- * @example
173
- * ```typescript
174
- * const result = await updateSyncedBlocks({
175
- * blocks: [
176
- * {
177
- * blockAri: 'ari:cloud:blocks:site-123:synced-block/uuid-456',
178
- * content: '{"type":"doc","version":1,"content":[]}',
179
- * status: 'active',
180
- * stepVersion: 42
181
- * }
182
- * ]
183
- * });
184
- * ```
185
- */
186
- export declare const updateSyncedBlocks: ({ blocks, }: BatchUpdateSyncedBlocksRequest) => Promise<BatchUpdateSyncedBlocksResponse>;
187
- export {};
@@ -1,52 +0,0 @@
1
- import type { ADFEntity } from '@atlaskit/adf-utils/types';
2
- import type { SyncBlockProduct } from '../../common/types';
3
- /**
4
- * Returns a diagnostic summary string from the last known connection state.
5
- * This provides context that the opaque WebSocket error events cannot.
6
- */
7
- export declare const getConnectionDiagnosticsSummary: () => string;
8
- export type BlockSubscriptionPayload = {
9
- blockAri: string;
10
- blockInstanceId: string;
11
- content: string;
12
- contentUpdatedAt?: number;
13
- createdAt: number;
14
- createdBy: string;
15
- deletionReason?: string;
16
- product: string;
17
- sourceAri: string;
18
- status: string;
19
- };
20
- export type ParsedBlockSubscriptionData = {
21
- blockAri: string;
22
- blockInstanceId: string;
23
- content: ADFEntity[];
24
- contentUpdatedAt?: string;
25
- createdAt?: string;
26
- createdBy: string;
27
- product: SyncBlockProduct;
28
- resourceId: string;
29
- sourceAri: string;
30
- status: string;
31
- };
32
- type SubscriptionCallback = (data: ParsedBlockSubscriptionData) => void;
33
- type ErrorCallback = (error: Error) => void;
34
- type CompleteCallback = () => void;
35
- type Unsubscribe = () => void;
36
- /**
37
- * Extracts a meaningful error message from the error: GraphQL WebSocket Error: {"isTrusted":true}
38
- *
39
- * @param error - The error passed to the sink's error callback
40
- * @returns A descriptive error message string
41
- */
42
- export declare const extractGraphQLWSErrorMessage: (error: unknown) => string;
43
- /**
44
- * Creates a GraphQL subscription to block updates using the shared graphql-ws client.
45
- *
46
- * @param blockAri - The full block ARI to subscribe to (ari:cloud:blocks:{cloudId}:synced-block/{resourceId})
47
- * @param onData - Callback function invoked when block data is updated
48
- * @param onError - Optional callback function invoked on subscription errors
49
- * @returns Unsubscribe function to close the subscription
50
- */
51
- export declare const subscribeToBlockUpdates: (blockAri: string, onData: SubscriptionCallback, onError?: ErrorCallback, onComplete?: CompleteCallback) => Unsubscribe;
52
- export {};
@@ -1,27 +0,0 @@
1
- /**
2
- * The type of the Confluence page
3
- */
4
- export type PAGE_TYPE = 'page' | 'blogpost';
5
- /**
6
- * Generates the Confluence page ARI
7
- * @param pageId - the ID of the page
8
- * @param cloudId - the cloud ID
9
- * @param pageType - the type of the page
10
- * @returns the Confluence page ARI
11
- */
12
- export declare const getConfluencePageAri: ({ pageId, cloudId, pageType, }: {
13
- cloudId: string;
14
- pageId: string;
15
- pageType: PAGE_TYPE;
16
- }) => string;
17
- /**
18
- * Extracts the page ID and type from the Confluence page ARI
19
- * @param ari - the Confluence page ARI
20
- * @returns the page ID and type
21
- */
22
- export declare const getPageIdAndTypeFromConfluencePageAri: ({ ari, }: {
23
- ari: string;
24
- }) => {
25
- id: string;
26
- type: PAGE_TYPE;
27
- };
@@ -1,10 +0,0 @@
1
- export type ConfigData = {
2
- readonly clientId: string;
3
- readonly fileStoreUrl: string;
4
- };
5
- export type TokenData = {
6
- collectionId?: string;
7
- config: ConfigData;
8
- token: string;
9
- };
10
- export declare const fetchMediaToken: (contentId: string) => Promise<TokenData>;
@@ -1,2 +0,0 @@
1
- import type { SyncBlockSourceInfo } from '../../providers/types';
2
- export declare const fetchConfluencePageInfo: (pageAri: string, hasAccess: boolean, localId?: string) => Promise<SyncBlockSourceInfo | undefined>;
@@ -1,2 +0,0 @@
1
- import type { PAGE_TYPE } from './ari';
2
- export declare const isBlogPageType: (pageType: PAGE_TYPE) => boolean;
@@ -1,18 +0,0 @@
1
- /**
2
- * Generates the Jira work item ARI
3
- * @param workItemId - the ID of the work item
4
- * @param cloudId - the cloud ID
5
- * @returns the Jira work item ARI
6
- */
7
- export declare const getJiraWorkItemAri: ({ cloudId, workItemId, }: {
8
- cloudId: string;
9
- workItemId: string;
10
- }) => string;
11
- /**
12
- * Extracts the Jira work item ID from the Jira work item ARI
13
- * @param ari - the Jira work item ARI
14
- * @returns the Jira work item ID
15
- */
16
- export declare const getJiraWorkItemIdFromAri: ({ ari }: {
17
- ari: string;
18
- }) => string;
@@ -1,9 +0,0 @@
1
- import type { TokenData } from '../confluence/fetchMediaToken';
2
- /**
3
- * Fetches a media read token for a Jira issue, to allow media uploaded to Jira
4
- * to be rendered in cross-product synced block references (e.g. in Confluence).
5
- *
6
- * @param issueAri - the Jira issue ARI (e.g. ari:cloud:jira:{cloudId}:issue/{issueId})
7
- * @returns TokenData with token, config (clientId + fileStoreUrl), and optional collectionId
8
- */
9
- export declare const fetchJiraMediaToken: (issueAri: string) => Promise<TokenData>;
@@ -1,13 +0,0 @@
1
- /**
2
- * Note: the type definition is copied from jira/src/packages/platform/space-not-found-with-request-access/src/requestSpaceAccess.tsx
3
- * Though 'null' is a possible value, if we want notification to actually be sent, accountId and projectKey or issueId have to have actual values.
4
- */
5
- export type AccessRequestPayload = {
6
- accountId: string | null;
7
- boardId?: number | null;
8
- issueId?: number | null;
9
- issueKey?: string | null;
10
- message?: string | null;
11
- projectKey: string | null;
12
- };
13
- export declare const requestJiraSpaceAccess: (payload: AccessRequestPayload) => Promise<Response>;
@@ -1,22 +0,0 @@
1
- import type { SyncBlockSourceInfo } from '../../providers/types';
2
- /**
3
- * Fetch source-info metadata for a Jira work item used by reference sync blocks.
4
- *
5
- * Parity notes vs the Confluence equivalent (`fetchConfluencePageInfo`):
6
- *
7
- * - **Archived / draft URL variants** are intentionally omitted. Confluence pages can be
8
- * "unpublished" (draft, archived, in-trash) and need REST fallbacks plus alternate URL
9
- * shapes. Jira work items have no equivalent lifecycle — an issue either exists in AGG
10
- * or it does not — so a single `webUrl` is sufficient.
11
- *
12
- * - **`#block-{localId}` deep-link anchor** is intentionally not appended. The current
13
- * Jira issue view does not implement scroll-to-anchor for unknown fragments, so the
14
- * anchor would be dead weight on the URL. The dispatching code in
15
- * `syncBlockProvider.fetchSyncBlockSourceInfo` deliberately does not pass `localId`
16
- * here for the same reason. If/when Jira issue view supports anchor scrolling for
17
- * sync-block local IDs, accept `localId?: string` here and append `#block-{localId}`.
18
- *
19
- * - **`subType` / page-type variants** are not modeled — Jira issue type is exposed via
20
- * the separate `issueType` field returned alongside `summary` / `webUrl`.
21
- */
22
- export declare const fetchJiraWorkItemInfo: (workItemAri: string, hasAccess: boolean) => Promise<SyncBlockSourceInfo | undefined>;
@@ -1,11 +0,0 @@
1
- import type { SyncBlockProduct } from '../common/types';
2
- import type { TokenData } from './confluence/fetchMediaToken';
3
- export declare const requiresCrossProductAuth: ({ hostProduct, sourceProduct, }: {
4
- hostProduct: SyncBlockProduct;
5
- sourceProduct?: SyncBlockProduct;
6
- }) => boolean;
7
- export declare const fetchTokenForSourceProduct: ({ contentAri, contentId, sourceProduct, }: {
8
- contentAri: string;
9
- contentId: string;
10
- sourceProduct?: SyncBlockProduct;
11
- }) => Promise<TokenData>;
@@ -1,4 +0,0 @@
1
- export declare const SYNC_BLOCK_PRODUCTS: readonly [
2
- "confluence-page",
3
- "jira-work-item"
4
- ];
@@ -1,11 +0,0 @@
1
- import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
2
- /**
3
- * Rebase `currentTr` over `incomingTr` based on the provided `state`.
4
- * This function adjusts the steps in `currentTr` to account for the changes made by `incomingTr`.
5
- *
6
- * @param currentTr - The transaction to be rebased.
7
- * @param incomingTr - The transaction that has already been applied to the state.
8
- * @param state - The editor state after applying `incomingTr`.
9
- * @returns A new transaction that represents `currentTr` rebased over `incomingTr`.
10
- */
11
- export declare const rebaseTransaction: (currentTr: Transaction, incomingTr: Transaction, state: EditorState) => Transaction;
@@ -1,82 +0,0 @@
1
- import type { ADFEntity } from '@atlaskit/adf-utils/types';
2
- import type { JSONNode } from '@atlaskit/editor-json-transformer/types';
3
- import type { SyncBlockInstance, SyncBlockJiraIssueType, SyncBlockSourceInfo } from '../providers/types';
4
- import type { SYNC_BLOCK_PRODUCTS } from './consts';
5
- export type BlockInstanceId = string;
6
- export type ResourceId = string;
7
- export type SyncBlockProduct = (typeof SYNC_BLOCK_PRODUCTS)[number];
8
- export type SyncBlockStatus = 'active' | 'deleted' | 'unpublished';
9
- export type SyncBlockAttrs = {
10
- localId: BlockInstanceId;
11
- resourceId: ResourceId;
12
- };
13
- export interface SyncBlockNode extends JSONNode {
14
- attrs: SyncBlockAttrs;
15
- content?: Array<JSONNode | undefined>;
16
- type: 'syncBlock' | 'bodiedSyncBlock';
17
- }
18
- export declare enum SyncBlockError {
19
- Errored = "errored",
20
- NotFound = "not_found",
21
- Forbidden = "forbidden",
22
- InvalidRequest = "invalid_request",
23
- RateLimited = "rate_limited",
24
- Conflict = "conflict",// attempt to create block that already exists
25
- ServerError = "server_error",
26
- InvalidContent = "invalid_content",// content is not a valid JSON
27
- Offline = "offline",
28
- Unpublished = "unpublished",
29
- Aborted = "aborted",
30
- EntityNotFound = "entity_not_found"
31
- }
32
- export interface SyncBlockData {
33
- blockInstanceId: BlockInstanceId;
34
- content: Array<ADFEntity>;
35
- contentUpdatedAt?: string;
36
- createdAt?: string;
37
- createdBy?: string;
38
- deletionReason?: DeletionReason;
39
- issueType?: SyncBlockJiraIssueType;
40
- isSynced?: boolean;
41
- /**
42
- * Whether the block is on the same page as the source block
43
- */
44
- onSameDocument?: boolean;
45
- product?: SyncBlockProduct;
46
- /**
47
- * The ARI of the block. E.G ari:cloud:blocks:<cloudId>:synced-block/<product>/<pageId>/<resourceId>
48
- */
49
- resourceId: ResourceId;
50
- sourceAri?: string;
51
- sourceSubType?: string | null;
52
- sourceTitle?: string;
53
- sourceURL?: string;
54
- status?: SyncBlockStatus;
55
- updatedAt?: string;
56
- }
57
- export interface ReferenceSyncBlockResponse {
58
- blockAri: string;
59
- blockInstanceId?: BlockInstanceId;
60
- contentUpdatedAt?: string;
61
- createdAt?: string;
62
- createdBy?: string;
63
- documentAri: string;
64
- }
65
- export interface ReferenceSyncBlock extends ReferenceSyncBlockResponse {
66
- hasAccess: boolean;
67
- onSameDocument: boolean;
68
- }
69
- export type ReferenceSyncBlockData = {
70
- error?: SyncBlockError;
71
- references?: ReferenceSyncBlock[];
72
- };
73
- export type ReferencesSourceInfo = {
74
- error?: SyncBlockError;
75
- references?: Array<SyncBlockSourceInfo | undefined>;
76
- };
77
- export type DeletionReason = 'source-block-deleted' | 'source-block-unsynced' | 'source-block-unpublished';
78
- export type DeletionReasonResponse = DeletionReason | 'source-document-deleted';
79
- export type SyncBlockPrefetchData = {
80
- prefetchPromise: Promise<SyncBlockInstance[] | undefined>;
81
- resourceIds: string[];
82
- };
@@ -1 +0,0 @@
1
- export { generateBlockAri, generateBlockAriFromReference, getLocalIdFromBlockResourceId, } from '../clients/block-service/ari';
@@ -1,2 +0,0 @@
1
- export { BlockError, updateSyncedBlocks } from '../clients/block-service/blockService';
2
- export type { BlockContentResponse, BatchRetrieveSyncedBlocksResponse, ErrorResponse, } from '../clients/block-service/blockService';
@@ -1 +0,0 @@
1
- export { useMemoizedBlockServiceAPIProviders, useMemoizedBlockServiceFetchOnlyAPIProvider, fetchReferences, batchFetchData, writeDataBatch, blockAriToResourceId, convertToSyncBlockData, extractResourceIdFromBlockAri, } from '../providers/block-service/blockServiceAPI';
@@ -1 +0,0 @@
1
- export { extractGraphQLWSErrorMessage, getConnectionDiagnosticsSummary, } from '../clients/block-service/blockSubscription';
@@ -1,2 +0,0 @@
1
- export { SyncBlockError } from '../common/types';
2
- export type { ResourceId, SyncBlockData, SyncBlockNode, SyncBlockProduct, SyncBlockStatus, BlockInstanceId, SyncBlockAttrs, ReferenceSyncBlockData, ReferencesSourceInfo, DeletionReason, SyncBlockPrefetchData, } from '../common/types';
@@ -1 +0,0 @@
1
- export { getConfluencePageAri, getPageIdAndTypeFromConfluencePageAri, } from '../clients/confluence/ari';
@@ -1 +0,0 @@
1
- export { fetchErrorPayload } from '../utils/errorHandling';
@@ -1 +0,0 @@
1
- export { fetchJiraMediaToken } from '../clients/jira/fetchMediaToken';
@@ -1,2 +0,0 @@
1
- export { fetchMediaToken } from '../clients/confluence/fetchMediaToken';
2
- export type { TokenData, ConfigData } from '../clients/confluence/fetchMediaToken';
@@ -1 +0,0 @@
1
- export { getJiraWorkItemAri, getJiraWorkItemIdFromAri } from '../clients/jira/ari';
@@ -1 +0,0 @@
1
- export type { ADFFetchProvider, ADFWriteProvider, BatchFetchConfig, BlockNodeIdentifiers, BlockSubscriptionCompleteCallback, BlockSubscriptionErrorCallback, BlockUpdateCallback, SyncBlockDataProviderInterface, SyncBlockInstance, MediaEmojiProviderOptions, SyncedBlockRendererProviderOptions, SyncBlockRendererProviderCreator, SyncedBlockRendererDataProviders, Unsubscribe, UpdateReferenceSyncBlockResult, WriteSyncBlockResult, SyncBlockParentInfo, SyncBlockSourceInfo, SyncBlockJiraIssueType, } from '../providers/types';
@@ -1 +0,0 @@
1
- export { rebaseTransaction } from '../common/rebase-transaction';
@@ -1 +0,0 @@
1
- export { ReferenceSyncBlockStoreManager } from '../store-manager/referenceSyncBlockStoreManager';
@@ -1,2 +0,0 @@
1
- export { requestJiraSpaceAccess } from '../clients/jira/requestJiraIssueAccess';
2
- export type { AccessRequestPayload } from '../clients/jira/requestJiraIssueAccess';
@@ -1 +0,0 @@
1
- export { resolveSyncBlockInstance } from '../utils/resolveSyncBlockInstance';
@@ -1 +0,0 @@
1
- export { parseResourceId, createResourceIdForReference } from '../utils/resourceId';
@@ -1 +0,0 @@
1
- export { fetchConfluencePageInfo } from '../clients/confluence/sourceInfo';
@@ -1 +0,0 @@
1
- export { SyncBlockInMemorySessionCache, syncBlockInMemorySessionCache, } from '../store-manager/syncBlockInMemorySessionCache';
@@ -1 +0,0 @@
1
- export { SyncedBlockProvider, useMemoizedSyncedBlockProvider, } from '../providers/syncBlockProvider';
@@ -1 +0,0 @@
1
- export { SyncBlockStoreManager, useMemoizedSyncBlockStoreManager, } from '../store-manager/syncBlockStoreManager';
@@ -1 +0,0 @@
1
- export { fetchTokenForSourceProduct, requiresCrossProductAuth } from '../clients/tokenRouting';
@@ -1,2 +0,0 @@
1
- export { useFetchSyncBlockData } from '../hooks/useFetchSyncBlockData';
2
- export type { UseFetchSyncBlockDataResult } from '../hooks/useFetchSyncBlockData';
@@ -1 +0,0 @@
1
- export { useFetchSyncBlockTitle } from '../hooks/useFetchSyncBlockTitle';
@@ -1 +0,0 @@
1
- export { useHandleContentChanges } from '../hooks/useHandleContentChanges';
@@ -1 +0,0 @@
1
- export { createSyncBlockNode, convertSyncBlockPMNodeToSyncBlockData, convertSyncBlockJSONNodeToSyncBlockNode, convertPMNodesToSyncBlockNodes, convertPMNodeToSyncBlockNode, convertContentUpdatedAt, getContentIdAndProductFromResourceId, getSourceProductFromResourceIdSafe, } from '../utils/utils';
@@ -1 +0,0 @@
1
- export { normaliseSyncBlockProduct, normaliseSyncBlockStatus } from '../utils/validValue';
@@ -1,16 +0,0 @@
1
- import type { RendererSyncBlockEventPayload } from '@atlaskit/editor-common/analytics';
2
- import type { ProviderFactory, MediaProvider } from '@atlaskit/editor-common/provider-factory';
3
- import type { SyncBlockInstance } from '../providers/types';
4
- import type { SyncBlockStoreManager } from '../store-manager/syncBlockStoreManager';
5
- type SSRProviders = {
6
- media?: MediaProvider | null;
7
- };
8
- export interface UseFetchSyncBlockDataResult {
9
- isLoading: boolean;
10
- providerFactory: ProviderFactory | undefined;
11
- reloadData: () => Promise<void>;
12
- ssrProviders?: SSRProviders | null;
13
- syncBlockInstance: SyncBlockInstance | null;
14
- }
15
- export declare const useFetchSyncBlockData: (manager: SyncBlockStoreManager, resourceId?: string, localId?: string, fireAnalyticsEvent?: (payload: RendererSyncBlockEventPayload) => void) => UseFetchSyncBlockDataResult;
16
- export {};
@@ -1,3 +0,0 @@
1
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import type { SyncBlockStoreManager } from '../store-manager/syncBlockStoreManager';
3
- export declare const useFetchSyncBlockTitle: (manager: SyncBlockStoreManager, syncBlockNode: PMNode) => string | undefined;
@@ -1,3 +0,0 @@
1
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import type { SyncBlockStoreManager } from '../store-manager/syncBlockStoreManager';
3
- export declare const useHandleContentChanges: (manager: SyncBlockStoreManager, syncBlockNode: PMNode) => void;
@@ -1,25 +0,0 @@
1
- export { rebaseTransaction } from './common/rebase-transaction';
2
- export { SyncBlockError } from './common/types';
3
- export type { ResourceId, SyncBlockData, SyncBlockNode, SyncBlockProduct, SyncBlockStatus, BlockInstanceId, SyncBlockAttrs, ReferenceSyncBlockData, ReferencesSourceInfo, DeletionReason, SyncBlockPrefetchData, } from './common/types';
4
- export { useFetchSyncBlockData, type UseFetchSyncBlockDataResult, } from './hooks/useFetchSyncBlockData';
5
- export { useFetchSyncBlockTitle } from './hooks/useFetchSyncBlockTitle';
6
- export { useHandleContentChanges } from './hooks/useHandleContentChanges';
7
- export { generateBlockAri, generateBlockAriFromReference, getLocalIdFromBlockResourceId, } from './clients/block-service/ari';
8
- export type { BlockContentResponse, BatchRetrieveSyncedBlocksResponse, ErrorResponse, } from './clients/block-service/blockService';
9
- export { BlockError, updateSyncedBlocks } from './clients/block-service/blockService';
10
- export { extractGraphQLWSErrorMessage, getConnectionDiagnosticsSummary, } from './clients/block-service/blockSubscription';
11
- export { getConfluencePageAri, getPageIdAndTypeFromConfluencePageAri, } from './clients/confluence/ari';
12
- export { fetchMediaToken, type TokenData, type ConfigData, } from './clients/confluence/fetchMediaToken';
13
- export { getJiraWorkItemAri, getJiraWorkItemIdFromAri } from './clients/jira/ari';
14
- export { useMemoizedBlockServiceAPIProviders, useMemoizedBlockServiceFetchOnlyAPIProvider, fetchReferences, batchFetchData, writeDataBatch, blockAriToResourceId, convertToSyncBlockData, extractResourceIdFromBlockAri, } from './providers/block-service/blockServiceAPI';
15
- export { fetchConfluencePageInfo } from './clients/confluence/sourceInfo';
16
- export { SyncedBlockProvider, useMemoizedSyncedBlockProvider } from './providers/syncBlockProvider';
17
- export type { ADFFetchProvider, ADFWriteProvider, BatchFetchConfig, BlockNodeIdentifiers, BlockSubscriptionErrorCallback, BlockUpdateCallback, SyncBlockDataProviderInterface, SyncBlockInstance, MediaEmojiProviderOptions, SyncedBlockRendererProviderOptions, SyncBlockRendererProviderCreator, SyncedBlockRendererDataProviders, Unsubscribe, UpdateReferenceSyncBlockResult, WriteSyncBlockResult, SyncBlockParentInfo, SyncBlockSourceInfo, } from './providers/types';
18
- export { ReferenceSyncBlockStoreManager } from './store-manager/referenceSyncBlockStoreManager';
19
- export { SyncBlockInMemorySessionCache, syncBlockInMemorySessionCache, } from './store-manager/syncBlockInMemorySessionCache';
20
- export { SyncBlockStoreManager, useMemoizedSyncBlockStoreManager, } from './store-manager/syncBlockStoreManager';
21
- export { resolveSyncBlockInstance } from './utils/resolveSyncBlockInstance';
22
- export { parseResourceId, createResourceIdForReference } from './utils/resourceId';
23
- export { createSyncBlockNode, convertSyncBlockPMNodeToSyncBlockData, convertSyncBlockJSONNodeToSyncBlockNode, convertPMNodesToSyncBlockNodes, getContentIdAndProductFromResourceId, } from './utils/utils';
24
- export { fetchErrorPayload } from './utils/errorHandling';
25
- export { normaliseSyncBlockProduct, normaliseSyncBlockStatus } from './utils/validValue';