@atlaskit/editor-synced-block-provider 3.28.1 → 3.29.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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # @atlaskit/editor-synced-block-provider
2
2
 
3
+ ## 3.29.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`af9d0d672e930`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/af9d0d672e930) -
8
+ Revert: Edit at source for an archived page should not redirect and show ask for edit flag
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
3
14
  ## 3.28.1
4
15
 
5
16
  ### Patch Changes
@@ -9,7 +9,6 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
11
  var _monitoring = require("@atlaskit/editor-common/monitoring");
12
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
12
  var _errorHandling = require("../../utils/errorHandling");
14
13
  var _retry = require("../../utils/retry");
15
14
  var _ari = require("./ari");
@@ -128,7 +127,7 @@ var resolveNoAccessPageInfo = /*#__PURE__*/function () {
128
127
  */
129
128
  var fetchCompleteConfluencePageInfo = /*#__PURE__*/function () {
130
129
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(pageAri, localId) {
131
- var _pageData$_links, _pageData$_links2, _pageData$_links3, _getPageIdAndTypeFrom, pageId, response, pageData, base, edituiv2, webui, title, subType, status, url;
130
+ var _pageData$_links, _pageData$_links2, _getPageIdAndTypeFrom, pageId, response, pageData, base, edituiv2, title, subType, url;
132
131
  return _regenerator.default.wrap(function _callee3$(_context3) {
133
132
  while (1) switch (_context3.prev = _context3.next) {
134
133
  case 0:
@@ -155,15 +154,11 @@ var fetchCompleteConfluencePageInfo = /*#__PURE__*/function () {
155
154
  pageData = _context3.sent;
156
155
  base = (_pageData$_links = pageData._links) === null || _pageData$_links === void 0 ? void 0 : _pageData$_links.base;
157
156
  edituiv2 = (_pageData$_links2 = pageData._links) === null || _pageData$_links2 === void 0 ? void 0 : _pageData$_links2.edituiv2;
158
- webui = (_pageData$_links3 = pageData._links) === null || _pageData$_links3 === void 0 ? void 0 : _pageData$_links3.webui;
159
157
  title = pageData.title;
160
158
  subType = pageData.subtype;
161
- status = pageData.status;
162
- if (base && edituiv2 && ((0, _platformFeatureFlags.fg)('platform_synced_block_patch_2') ? status !== 'archived' : true)) {
159
+ if (base && edituiv2) {
163
160
  url = "".concat(base).concat(edituiv2);
164
161
  url = url && localId ? "".concat(url, "#block-").concat(localId) : url;
165
- } else if (base && webui && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_2')) {
166
- url = "".concat(base).concat(webui);
167
162
  }
168
163
  return _context3.abrupt("return", {
169
164
  title: title,
@@ -171,18 +166,18 @@ var fetchCompleteConfluencePageInfo = /*#__PURE__*/function () {
171
166
  sourceAri: pageAri,
172
167
  subType: subType
173
168
  });
174
- case 20:
175
- _context3.prev = 20;
169
+ case 18:
170
+ _context3.prev = 18;
176
171
  _context3.t0 = _context3["catch"](0);
177
172
  (0, _monitoring.logException)(_context3.t0, {
178
- location: 'editor-synced-block-provider/sourceInfo/fetchCompleteConfluencePageInfo'
173
+ location: 'editor-synced-block-provider/sourceInfo/fetchUnpublishedConfluencePageInfo'
179
174
  });
180
175
  return _context3.abrupt("return", Promise.resolve(undefined));
181
- case 24:
176
+ case 22:
182
177
  case "end":
183
178
  return _context3.stop();
184
179
  }
185
- }, _callee3, null, [[0, 20]]);
180
+ }, _callee3, null, [[0, 18]]);
186
181
  }));
187
182
  return function fetchCompleteConfluencePageInfo(_x3, _x4) {
188
183
  return _ref3.apply(this, arguments);
@@ -248,37 +243,24 @@ var fetchConfluencePageInfo = exports.fetchConfluencePageInfo = /*#__PURE__*/fun
248
243
  while (1) switch (_context5.prev = _context5.next) {
249
244
  case 0:
250
245
  if (!isUnpublished) {
251
- _context5.next = 5;
252
- break;
253
- }
254
- if ((0, _platformFeatureFlags.fg)('platform_synced_block_patch_2')) {
255
- _context5.next = 5;
246
+ _context5.next = 4;
256
247
  break;
257
248
  }
258
- _context5.next = 4;
249
+ _context5.next = 3;
259
250
  return fetchCompleteConfluencePageInfo(pageAri, localId);
260
- case 4:
251
+ case 3:
261
252
  return _context5.abrupt("return", _context5.sent);
262
- case 5:
253
+ case 4:
263
254
  if (!hasAccess) {
264
- _context5.next = 22;
255
+ _context5.next = 17;
265
256
  break;
266
257
  }
267
258
  _getPageIdAndTypeFrom3 = (0, _ari.getPageIdAndTypeFromConfluencePageAri)({
268
259
  ari: pageAri
269
260
  }), pageType = _getPageIdAndTypeFrom3.type;
270
- if (!(pageType === 'page' && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_2'))) {
271
- _context5.next = 11;
272
- break;
273
- }
274
- _context5.next = 10;
275
- return fetchCompleteConfluencePageInfo(pageAri, localId);
276
- case 10:
277
- return _context5.abrupt("return", _context5.sent);
278
- case 11:
279
- _context5.next = 13;
261
+ _context5.next = 8;
280
262
  return getConfluenceSourceInfo(pageAri);
281
- case 13:
263
+ case 8:
282
264
  response = _context5.sent;
283
265
  contentData = (_response$data2 = response.data) === null || _response$data2 === void 0 || (_response$data2 = _response$data2.content) === null || _response$data2 === void 0 || (_response$data2 = _response$data2.nodes) === null || _response$data2 === void 0 ? void 0 : _response$data2[0];
284
266
  _ref7 = contentData || {}, title = _ref7.title, subType = _ref7.subType;
@@ -299,12 +281,12 @@ var fetchConfluencePageInfo = exports.fetchConfluencePageInfo = /*#__PURE__*/fun
299
281
  sourceAri: pageAri,
300
282
  subType: subType
301
283
  }));
302
- case 22:
303
- _context5.next = 24;
284
+ case 17:
285
+ _context5.next = 19;
304
286
  return resolveNoAccessPageInfo(pageAri);
305
- case 24:
287
+ case 19:
306
288
  return _context5.abrupt("return", _context5.sent);
307
- case 25:
289
+ case 20:
308
290
  case "end":
309
291
  return _context5.stop();
310
292
  }
@@ -1,7 +1,6 @@
1
1
  /* eslint-disable require-unicode-regexp */
2
2
 
3
3
  import { logException } from '@atlaskit/editor-common/monitoring';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  import { getSourceInfoErrorPayload } from '../../utils/errorHandling';
6
5
  import { fetchWithRetry } from '../../utils/retry';
7
6
  import { getPageIdAndTypeFromConfluencePageAri } from './ari';
@@ -91,7 +90,7 @@ const resolveNoAccessPageInfo = async ari => {
91
90
  */
92
91
  const fetchCompleteConfluencePageInfo = async (pageAri, localId) => {
93
92
  try {
94
- var _pageData$_links, _pageData$_links2, _pageData$_links3;
93
+ var _pageData$_links, _pageData$_links2;
95
94
  const {
96
95
  id: pageId
97
96
  } = getPageIdAndTypeFromConfluencePageAri({
@@ -107,16 +106,12 @@ const fetchCompleteConfluencePageInfo = async (pageAri, localId) => {
107
106
  const pageData = await response.json();
108
107
  const base = (_pageData$_links = pageData._links) === null || _pageData$_links === void 0 ? void 0 : _pageData$_links.base;
109
108
  const edituiv2 = (_pageData$_links2 = pageData._links) === null || _pageData$_links2 === void 0 ? void 0 : _pageData$_links2.edituiv2;
110
- const webui = (_pageData$_links3 = pageData._links) === null || _pageData$_links3 === void 0 ? void 0 : _pageData$_links3.webui;
111
109
  const title = pageData.title;
112
110
  const subType = pageData.subtype;
113
- const status = pageData.status;
114
111
  let url;
115
- if (base && edituiv2 && (fg('platform_synced_block_patch_2') ? status !== 'archived' : true)) {
112
+ if (base && edituiv2) {
116
113
  url = `${base}${edituiv2}`;
117
114
  url = url && localId ? `${url}#block-${localId}` : url;
118
- } else if (base && webui && fg('platform_synced_block_patch_2')) {
119
- url = `${base}${webui}`;
120
115
  }
121
116
  return {
122
117
  title,
@@ -126,7 +121,7 @@ const fetchCompleteConfluencePageInfo = async (pageAri, localId) => {
126
121
  };
127
122
  } catch (error) {
128
123
  logException(error, {
129
- location: 'editor-synced-block-provider/sourceInfo/fetchCompleteConfluencePageInfo'
124
+ location: 'editor-synced-block-provider/sourceInfo/fetchUnpublishedConfluencePageInfo'
130
125
  });
131
126
  return Promise.resolve(undefined);
132
127
  }
@@ -175,9 +170,7 @@ export const fetchConfluencePageInfoOld = async (pageAri, localId, fireAnalytics
175
170
  export const fetchConfluencePageInfo = async (pageAri, hasAccess, urlType, localId, isUnpublished) => {
176
171
  // For unpublished pages, use the v2 pages API as GraphQL returns empty content.nodes
177
172
  if (isUnpublished) {
178
- if (!fg('platform_synced_block_patch_2')) {
179
- return await fetchCompleteConfluencePageInfo(pageAri, localId);
180
- }
173
+ return await fetchCompleteConfluencePageInfo(pageAri, localId);
181
174
  }
182
175
  if (hasAccess) {
183
176
  var _response$data2, _response$data2$conte, _response$data2$conte2, _contentData$space2;
@@ -186,9 +179,6 @@ export const fetchConfluencePageInfo = async (pageAri, hasAccess, urlType, local
186
179
  } = getPageIdAndTypeFromConfluencePageAri({
187
180
  ari: pageAri
188
181
  });
189
- if (pageType === 'page' && fg('platform_synced_block_patch_2')) {
190
- return await fetchCompleteConfluencePageInfo(pageAri, localId);
191
- }
192
182
  const response = await getConfluenceSourceInfo(pageAri);
193
183
  const contentData = (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$conte = _response$data2.content) === null || _response$data2$conte === void 0 ? void 0 : (_response$data2$conte2 = _response$data2$conte.nodes) === null || _response$data2$conte2 === void 0 ? void 0 : _response$data2$conte2[0];
194
184
  const {
@@ -6,7 +6,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
6
6
  /* eslint-disable require-unicode-regexp */
7
7
 
8
8
  import { logException } from '@atlaskit/editor-common/monitoring';
9
- import { fg } from '@atlaskit/platform-feature-flags';
10
9
  import { getSourceInfoErrorPayload } from '../../utils/errorHandling';
11
10
  import { fetchWithRetry } from '../../utils/retry';
12
11
  import { getPageIdAndTypeFromConfluencePageAri } from './ari';
@@ -123,7 +122,7 @@ var resolveNoAccessPageInfo = /*#__PURE__*/function () {
123
122
  */
124
123
  var fetchCompleteConfluencePageInfo = /*#__PURE__*/function () {
125
124
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(pageAri, localId) {
126
- var _pageData$_links, _pageData$_links2, _pageData$_links3, _getPageIdAndTypeFrom, pageId, response, pageData, base, edituiv2, webui, title, subType, status, url;
125
+ var _pageData$_links, _pageData$_links2, _getPageIdAndTypeFrom, pageId, response, pageData, base, edituiv2, title, subType, url;
127
126
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
128
127
  while (1) switch (_context3.prev = _context3.next) {
129
128
  case 0:
@@ -150,15 +149,11 @@ var fetchCompleteConfluencePageInfo = /*#__PURE__*/function () {
150
149
  pageData = _context3.sent;
151
150
  base = (_pageData$_links = pageData._links) === null || _pageData$_links === void 0 ? void 0 : _pageData$_links.base;
152
151
  edituiv2 = (_pageData$_links2 = pageData._links) === null || _pageData$_links2 === void 0 ? void 0 : _pageData$_links2.edituiv2;
153
- webui = (_pageData$_links3 = pageData._links) === null || _pageData$_links3 === void 0 ? void 0 : _pageData$_links3.webui;
154
152
  title = pageData.title;
155
153
  subType = pageData.subtype;
156
- status = pageData.status;
157
- if (base && edituiv2 && (fg('platform_synced_block_patch_2') ? status !== 'archived' : true)) {
154
+ if (base && edituiv2) {
158
155
  url = "".concat(base).concat(edituiv2);
159
156
  url = url && localId ? "".concat(url, "#block-").concat(localId) : url;
160
- } else if (base && webui && fg('platform_synced_block_patch_2')) {
161
- url = "".concat(base).concat(webui);
162
157
  }
163
158
  return _context3.abrupt("return", {
164
159
  title: title,
@@ -166,18 +161,18 @@ var fetchCompleteConfluencePageInfo = /*#__PURE__*/function () {
166
161
  sourceAri: pageAri,
167
162
  subType: subType
168
163
  });
169
- case 20:
170
- _context3.prev = 20;
164
+ case 18:
165
+ _context3.prev = 18;
171
166
  _context3.t0 = _context3["catch"](0);
172
167
  logException(_context3.t0, {
173
- location: 'editor-synced-block-provider/sourceInfo/fetchCompleteConfluencePageInfo'
168
+ location: 'editor-synced-block-provider/sourceInfo/fetchUnpublishedConfluencePageInfo'
174
169
  });
175
170
  return _context3.abrupt("return", Promise.resolve(undefined));
176
- case 24:
171
+ case 22:
177
172
  case "end":
178
173
  return _context3.stop();
179
174
  }
180
- }, _callee3, null, [[0, 20]]);
175
+ }, _callee3, null, [[0, 18]]);
181
176
  }));
182
177
  return function fetchCompleteConfluencePageInfo(_x3, _x4) {
183
178
  return _ref3.apply(this, arguments);
@@ -243,37 +238,24 @@ export var fetchConfluencePageInfo = /*#__PURE__*/function () {
243
238
  while (1) switch (_context5.prev = _context5.next) {
244
239
  case 0:
245
240
  if (!isUnpublished) {
246
- _context5.next = 5;
247
- break;
248
- }
249
- if (fg('platform_synced_block_patch_2')) {
250
- _context5.next = 5;
241
+ _context5.next = 4;
251
242
  break;
252
243
  }
253
- _context5.next = 4;
244
+ _context5.next = 3;
254
245
  return fetchCompleteConfluencePageInfo(pageAri, localId);
255
- case 4:
246
+ case 3:
256
247
  return _context5.abrupt("return", _context5.sent);
257
- case 5:
248
+ case 4:
258
249
  if (!hasAccess) {
259
- _context5.next = 22;
250
+ _context5.next = 17;
260
251
  break;
261
252
  }
262
253
  _getPageIdAndTypeFrom3 = getPageIdAndTypeFromConfluencePageAri({
263
254
  ari: pageAri
264
255
  }), pageType = _getPageIdAndTypeFrom3.type;
265
- if (!(pageType === 'page' && fg('platform_synced_block_patch_2'))) {
266
- _context5.next = 11;
267
- break;
268
- }
269
- _context5.next = 10;
270
- return fetchCompleteConfluencePageInfo(pageAri, localId);
271
- case 10:
272
- return _context5.abrupt("return", _context5.sent);
273
- case 11:
274
- _context5.next = 13;
256
+ _context5.next = 8;
275
257
  return getConfluenceSourceInfo(pageAri);
276
- case 13:
258
+ case 8:
277
259
  response = _context5.sent;
278
260
  contentData = (_response$data2 = response.data) === null || _response$data2 === void 0 || (_response$data2 = _response$data2.content) === null || _response$data2 === void 0 || (_response$data2 = _response$data2.nodes) === null || _response$data2 === void 0 ? void 0 : _response$data2[0];
279
261
  _ref7 = contentData || {}, title = _ref7.title, subType = _ref7.subType;
@@ -294,12 +276,12 @@ export var fetchConfluencePageInfo = /*#__PURE__*/function () {
294
276
  sourceAri: pageAri,
295
277
  subType: subType
296
278
  }));
297
- case 22:
298
- _context5.next = 24;
279
+ case 17:
280
+ _context5.next = 19;
299
281
  return resolveNoAccessPageInfo(pageAri);
300
- case 24:
282
+ case 19:
301
283
  return _context5.abrupt("return", _context5.sent);
302
- case 25:
284
+ case 20:
303
285
  case "end":
304
286
  return _context5.stop();
305
287
  }
package/package.json CHANGED
@@ -37,7 +37,7 @@
37
37
  "uuid": "^3.1.0"
38
38
  },
39
39
  "peerDependencies": {
40
- "@atlaskit/editor-common": "^111.12.0",
40
+ "@atlaskit/editor-common": "^111.13.0",
41
41
  "react": "^18.2.0"
42
42
  },
43
43
  "devDependencies": {
@@ -80,7 +80,7 @@
80
80
  }
81
81
  },
82
82
  "name": "@atlaskit/editor-synced-block-provider",
83
- "version": "3.28.1",
83
+ "version": "3.29.0",
84
84
  "description": "Synced Block Provider for @atlaskit/editor-plugin-synced-block",
85
85
  "author": "Atlassian Pty Ltd",
86
86
  "license": "Apache-2.0",