@atlaskit/editor-synced-block-provider 4.5.0 → 4.5.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-synced-block-provider
2
2
 
3
+ ## 4.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 4.5.0
4
10
 
5
11
  ### Minor Changes
@@ -313,13 +313,14 @@ var SyncedBlockProvider = exports.SyncedBlockProvider = /*#__PURE__*/function (_
313
313
  key: "fetchSyncBlockSourceInfo",
314
314
  value: (function () {
315
315
  var _fetchSyncBlockSourceInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(localId, sourceAri, sourceProduct) {
316
- var _this$writeProvider, _this$writeProvider3;
316
+ var _this$writeProvider;
317
317
  var hasAccess,
318
318
  ari,
319
319
  product,
320
320
  _this$writeProvider2,
321
- _sourceInfo,
322
321
  sourceInfo,
322
+ _this$writeProvider3,
323
+ _sourceInfo,
323
324
  _args4 = arguments;
324
325
  return _regenerator.default.wrap(function _callee4$(_context4) {
325
326
  while (1) switch (_context4.prev = _context4.next) {
@@ -340,14 +341,14 @@ var SyncedBlockProvider = exports.SyncedBlockProvider = /*#__PURE__*/function (_
340
341
  _context4.next = 10;
341
342
  return (0, _sourceInfo2.fetchConfluencePageInfo)(ari, hasAccess, localId);
342
343
  case 10:
343
- _sourceInfo = _context4.sent;
344
- if (_sourceInfo) {
344
+ sourceInfo = _context4.sent;
345
+ if (sourceInfo) {
345
346
  _context4.next = 13;
346
347
  break;
347
348
  }
348
349
  return _context4.abrupt("return", Promise.resolve(undefined));
349
350
  case 13:
350
- return _context4.abrupt("return", _objectSpread(_objectSpread({}, _sourceInfo), {}, {
351
+ return _context4.abrupt("return", _objectSpread(_objectSpread({}, sourceInfo), {}, {
351
352
  onSameDocument: ((_this$writeProvider2 = this.writeProvider) === null || _this$writeProvider2 === void 0 ? void 0 : _this$writeProvider2.parentAri) === ari,
352
353
  productType: product
353
354
  }));
@@ -355,14 +356,14 @@ var SyncedBlockProvider = exports.SyncedBlockProvider = /*#__PURE__*/function (_
355
356
  _context4.next = 16;
356
357
  return (0, _sourceInfo3.fetchJiraWorkItemInfo)(ari, hasAccess);
357
358
  case 16:
358
- sourceInfo = _context4.sent;
359
- if (sourceInfo) {
359
+ _sourceInfo = _context4.sent;
360
+ if (_sourceInfo) {
360
361
  _context4.next = 19;
361
362
  break;
362
363
  }
363
364
  return _context4.abrupt("return", Promise.resolve(undefined));
364
365
  case 19:
365
- return _context4.abrupt("return", _objectSpread(_objectSpread({}, sourceInfo), {}, {
366
+ return _context4.abrupt("return", _objectSpread(_objectSpread({}, _sourceInfo), {}, {
366
367
  onSameDocument: ((_this$writeProvider3 = this.writeProvider) === null || _this$writeProvider3 === void 0 ? void 0 : _this$writeProvider3.parentAri) === ari,
367
368
  productType: product
368
369
  }));
@@ -195,7 +195,7 @@ export class SyncedBlockProvider extends SyncBlockDataProviderInterface {
195
195
  * @returns The source info
196
196
  */
197
197
  async fetchSyncBlockSourceInfo(localId, sourceAri, sourceProduct, hasAccess = true) {
198
- var _this$writeProvider2, _this$writeProvider4;
198
+ var _this$writeProvider2;
199
199
  const ari = sourceAri !== null && sourceAri !== void 0 ? sourceAri : (_this$writeProvider2 = this.writeProvider) === null || _this$writeProvider2 === void 0 ? void 0 : _this$writeProvider2.parentAri;
200
200
  const product = sourceProduct !== null && sourceProduct !== void 0 ? sourceProduct : getProductFromSourceAri(ari);
201
201
  if (!ari || !product) {
@@ -216,15 +216,22 @@ export class SyncedBlockProvider extends SyncBlockDataProviderInterface {
216
216
  };
217
217
  }
218
218
  case 'jira-work-item':
219
- const sourceInfo = await fetchJiraWorkItemInfo(ari, hasAccess);
220
- if (!sourceInfo) {
221
- return Promise.resolve(undefined);
219
+ {
220
+ var _this$writeProvider4;
221
+ // Note: `subType`, archived URL handling, and `isUnpublished` are intentionally
222
+ // omitted here — Jira work items have no equivalent page subtype or archived state.
223
+ // The `localId` param is not forwarded because deep-linking to a specific block
224
+ // within a Jira issue description is working as intended without it.
225
+ const sourceInfo = await fetchJiraWorkItemInfo(ari, hasAccess);
226
+ if (!sourceInfo) {
227
+ return Promise.resolve(undefined);
228
+ }
229
+ return {
230
+ ...sourceInfo,
231
+ onSameDocument: ((_this$writeProvider4 = this.writeProvider) === null || _this$writeProvider4 === void 0 ? void 0 : _this$writeProvider4.parentAri) === ari,
232
+ productType: product
233
+ };
222
234
  }
223
- return {
224
- ...sourceInfo,
225
- onSameDocument: ((_this$writeProvider4 = this.writeProvider) === null || _this$writeProvider4 === void 0 ? void 0 : _this$writeProvider4.parentAri) === ari,
226
- productType: product
227
- };
228
235
  default:
229
236
  return Promise.reject(new Error(`${product} source product not supported`));
230
237
  }
@@ -306,13 +306,14 @@ export var SyncedBlockProvider = /*#__PURE__*/function (_SyncBlockDataProvide) {
306
306
  key: "fetchSyncBlockSourceInfo",
307
307
  value: (function () {
308
308
  var _fetchSyncBlockSourceInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(localId, sourceAri, sourceProduct) {
309
- var _this$writeProvider, _this$writeProvider3;
309
+ var _this$writeProvider;
310
310
  var hasAccess,
311
311
  ari,
312
312
  product,
313
313
  _this$writeProvider2,
314
- _sourceInfo,
315
314
  sourceInfo,
315
+ _this$writeProvider3,
316
+ _sourceInfo,
316
317
  _args4 = arguments;
317
318
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
318
319
  while (1) switch (_context4.prev = _context4.next) {
@@ -333,14 +334,14 @@ export var SyncedBlockProvider = /*#__PURE__*/function (_SyncBlockDataProvide) {
333
334
  _context4.next = 10;
334
335
  return fetchConfluencePageInfo(ari, hasAccess, localId);
335
336
  case 10:
336
- _sourceInfo = _context4.sent;
337
- if (_sourceInfo) {
337
+ sourceInfo = _context4.sent;
338
+ if (sourceInfo) {
338
339
  _context4.next = 13;
339
340
  break;
340
341
  }
341
342
  return _context4.abrupt("return", Promise.resolve(undefined));
342
343
  case 13:
343
- return _context4.abrupt("return", _objectSpread(_objectSpread({}, _sourceInfo), {}, {
344
+ return _context4.abrupt("return", _objectSpread(_objectSpread({}, sourceInfo), {}, {
344
345
  onSameDocument: ((_this$writeProvider2 = this.writeProvider) === null || _this$writeProvider2 === void 0 ? void 0 : _this$writeProvider2.parentAri) === ari,
345
346
  productType: product
346
347
  }));
@@ -348,14 +349,14 @@ export var SyncedBlockProvider = /*#__PURE__*/function (_SyncBlockDataProvide) {
348
349
  _context4.next = 16;
349
350
  return fetchJiraWorkItemInfo(ari, hasAccess);
350
351
  case 16:
351
- sourceInfo = _context4.sent;
352
- if (sourceInfo) {
352
+ _sourceInfo = _context4.sent;
353
+ if (_sourceInfo) {
353
354
  _context4.next = 19;
354
355
  break;
355
356
  }
356
357
  return _context4.abrupt("return", Promise.resolve(undefined));
357
358
  case 19:
358
- return _context4.abrupt("return", _objectSpread(_objectSpread({}, sourceInfo), {}, {
359
+ return _context4.abrupt("return", _objectSpread(_objectSpread({}, _sourceInfo), {}, {
359
360
  onSameDocument: ((_this$writeProvider3 = this.writeProvider) === null || _this$writeProvider3 === void 0 ? void 0 : _this$writeProvider3.parentAri) === ari,
360
361
  productType: product
361
362
  }));
package/package.json CHANGED
@@ -29,7 +29,7 @@
29
29
  "@atlaskit/editor-prosemirror": "^7.3.0",
30
30
  "@atlaskit/node-data-provider": "^9.0.0",
31
31
  "@atlaskit/platform-feature-flags": "^1.1.0",
32
- "@atlaskit/tmp-editor-statsig": "^59.1.0",
32
+ "@atlaskit/tmp-editor-statsig": "^60.2.0",
33
33
  "@babel/runtime": "^7.0.0",
34
34
  "@compiled/react": "^0.20.0",
35
35
  "graphql-ws": "^5.14.2",
@@ -81,7 +81,7 @@
81
81
  }
82
82
  },
83
83
  "name": "@atlaskit/editor-synced-block-provider",
84
- "version": "4.5.0",
84
+ "version": "4.5.1",
85
85
  "description": "Synced Block Provider for @atlaskit/editor-plugin-synced-block",
86
86
  "author": "Atlassian Pty Ltd",
87
87
  "license": "Apache-2.0",