@atlaskit/editor-synced-block-provider 3.11.0 → 3.12.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.
- package/CHANGELOG.md +8 -0
- package/dist/cjs/clients/block-service/blockService.js +2 -2
- package/dist/cjs/providers/block-service/blockServiceAPI.js +1 -1
- package/dist/es2019/clients/block-service/blockService.js +2 -2
- package/dist/es2019/providers/block-service/blockServiceAPI.js +1 -1
- package/dist/esm/clients/block-service/blockService.js +2 -2
- package/dist/esm/providers/block-service/blockServiceAPI.js +1 -1
- package/dist/types/clients/block-service/blockService.d.ts +5 -5
- package/dist/types/providers/block-service/blockServiceAPI.d.ts +1 -1
- package/dist/types/providers/types.d.ts +5 -5
- package/dist/types-ts4.5/clients/block-service/blockService.d.ts +5 -5
- package/dist/types-ts4.5/providers/block-service/blockServiceAPI.d.ts +1 -1
- package/dist/types-ts4.5/providers/types.d.ts +5 -5
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-provider
|
|
2
2
|
|
|
3
|
+
## 3.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`3d9abca1c1cd9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3d9abca1c1cd9) -
|
|
8
|
+
The batch retrieve of the blocks must also send document ARI and also the local instance ID of the
|
|
9
|
+
reference blocks
|
|
10
|
+
|
|
3
11
|
## 3.11.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -137,11 +137,11 @@ var BlockError = exports.BlockError = /*#__PURE__*/function (_Error) {
|
|
|
137
137
|
}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
|
|
138
138
|
var getSyncedBlockContent = exports.getSyncedBlockContent = /*#__PURE__*/function () {
|
|
139
139
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref2) {
|
|
140
|
-
var blockAri, queryParams, response;
|
|
140
|
+
var blockAri, documentAri, queryParams, response;
|
|
141
141
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
142
142
|
while (1) switch (_context2.prev = _context2.next) {
|
|
143
143
|
case 0:
|
|
144
|
-
blockAri = _ref2.blockAri;
|
|
144
|
+
blockAri = _ref2.blockAri, documentAri = _ref2.documentAri;
|
|
145
145
|
// Disable sending documentAri for now. We'll add it back if we find a way to update references that follows the save & refresh principle.
|
|
146
146
|
// Slack discussion here: https://atlassian.slack.com/archives/C09DZT1TBNW/p1767836775552099?thread_ts=1767836754.024889&cid=C09DZT1TBNW
|
|
147
147
|
// const queryParams = documentAri ? `?documentAri=${encodeURIComponent(documentAri)}` : '';
|
|
@@ -346,7 +346,7 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
346
346
|
|
|
347
347
|
/**
|
|
348
348
|
* Batch fetches multiple synced blocks by their resource IDs.
|
|
349
|
-
* @param
|
|
349
|
+
* @param resourceIds - Array of resource IDs to fetch
|
|
350
350
|
* @returns Array of SyncBlockInstance results
|
|
351
351
|
*/
|
|
352
352
|
}, {
|
|
@@ -100,8 +100,8 @@ export class BlockError extends Error {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
export const getSyncedBlockContent = async ({
|
|
103
|
-
blockAri
|
|
104
|
-
|
|
103
|
+
blockAri,
|
|
104
|
+
documentAri
|
|
105
105
|
}) => {
|
|
106
106
|
// Disable sending documentAri for now. We'll add it back if we find a way to update references that follows the save & refresh principle.
|
|
107
107
|
// Slack discussion here: https://atlassian.slack.com/archives/C09DZT1TBNW/p1767836775552099?thread_ts=1767836754.024889&cid=C09DZT1TBNW
|
|
@@ -256,7 +256,7 @@ class BlockServiceADFFetchProvider {
|
|
|
256
256
|
|
|
257
257
|
/**
|
|
258
258
|
* Batch fetches multiple synced blocks by their resource IDs.
|
|
259
|
-
* @param
|
|
259
|
+
* @param resourceIds - Array of resource IDs to fetch
|
|
260
260
|
* @returns Array of SyncBlockInstance results
|
|
261
261
|
*/
|
|
262
262
|
async batchFetchData(blockNodeIdentifiers) {
|
|
@@ -130,11 +130,11 @@ export var BlockError = /*#__PURE__*/function (_Error) {
|
|
|
130
130
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
131
131
|
export var getSyncedBlockContent = /*#__PURE__*/function () {
|
|
132
132
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
133
|
-
var blockAri, queryParams, response;
|
|
133
|
+
var blockAri, documentAri, queryParams, response;
|
|
134
134
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
135
135
|
while (1) switch (_context2.prev = _context2.next) {
|
|
136
136
|
case 0:
|
|
137
|
-
blockAri = _ref2.blockAri;
|
|
137
|
+
blockAri = _ref2.blockAri, documentAri = _ref2.documentAri;
|
|
138
138
|
// Disable sending documentAri for now. We'll add it back if we find a way to update references that follows the save & refresh principle.
|
|
139
139
|
// Slack discussion here: https://atlassian.slack.com/archives/C09DZT1TBNW/p1767836775552099?thread_ts=1767836754.024889&cid=C09DZT1TBNW
|
|
140
140
|
// const queryParams = documentAri ? `?documentAri=${encodeURIComponent(documentAri)}` : '';
|
|
@@ -340,7 +340,7 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
340
340
|
|
|
341
341
|
/**
|
|
342
342
|
* Batch fetches multiple synced blocks by their resource IDs.
|
|
343
|
-
* @param
|
|
343
|
+
* @param resourceIds - Array of resource IDs to fetch
|
|
344
344
|
* @returns Array of SyncBlockInstance results
|
|
345
345
|
*/
|
|
346
346
|
}, {
|
|
@@ -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
|
|
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;
|
|
@@ -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
|
|
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;
|
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.
|
|
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.
|
|
80
|
+
"version": "3.12.0",
|
|
81
81
|
"description": "Synced Block Provider for @atlaskit/editor-plugin-synced-block",
|
|
82
82
|
"author": "Atlassian Pty Ltd",
|
|
83
83
|
"license": "Apache-2.0",
|