@atlaskit/editor-synced-block-provider 3.8.0 → 3.8.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,13 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-provider
|
|
2
2
|
|
|
3
|
+
## 3.8.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`7b1f7ff1a2235`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7b1f7ff1a2235) -
|
|
8
|
+
[ux] [EDITOR-4536] Update synced location dropdown UI
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 3.8.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.resolveSyncBlockInstance = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
10
|
var _types = require("../common/types");
|
|
10
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
12
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -20,7 +21,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
20
21
|
* @returns A merged SyncBlockInstance object.
|
|
21
22
|
*/
|
|
22
23
|
var resolveSyncBlockInstance = exports.resolveSyncBlockInstance = function resolveSyncBlockInstance(oldResult, newResult) {
|
|
23
|
-
var _newResult$data, _oldResult$data, _newResult$data2, _oldResult$data2;
|
|
24
|
+
var _newResult$data, _oldResult$data, _newResult$data2, _oldResult$data2, _newResult$data3, _oldResult$data3, _newResult$data4, _oldResult$data4;
|
|
24
25
|
// if the old result has no data, we simply return the new result
|
|
25
26
|
if (!oldResult.data) {
|
|
26
27
|
return newResult;
|
|
@@ -38,6 +39,9 @@ var resolveSyncBlockInstance = exports.resolveSyncBlockInstance = function resol
|
|
|
38
39
|
data: _objectSpread(_objectSpread({}, newResult.data), {}, {
|
|
39
40
|
sourceURL: ((_newResult$data = newResult.data) === null || _newResult$data === void 0 ? void 0 : _newResult$data.sourceURL) || ((_oldResult$data = oldResult.data) === null || _oldResult$data === void 0 ? void 0 : _oldResult$data.sourceURL) || undefined,
|
|
40
41
|
sourceTitle: ((_newResult$data2 = newResult.data) === null || _newResult$data2 === void 0 ? void 0 : _newResult$data2.sourceTitle) || ((_oldResult$data2 = oldResult.data) === null || _oldResult$data2 === void 0 ? void 0 : _oldResult$data2.sourceTitle) || undefined
|
|
42
|
+
}, (0, _platformFeatureFlags.fg)('platform_synced_block_dogfooding') && {
|
|
43
|
+
sourceSubType: ((_newResult$data3 = newResult.data) === null || _newResult$data3 === void 0 ? void 0 : _newResult$data3.sourceSubType) || ((_oldResult$data3 = oldResult.data) === null || _oldResult$data3 === void 0 ? void 0 : _oldResult$data3.sourceSubType) || undefined,
|
|
44
|
+
onSamePage: ((_newResult$data4 = newResult.data) === null || _newResult$data4 === void 0 ? void 0 : _newResult$data4.onSamePage) || ((_oldResult$data4 = oldResult.data) === null || _oldResult$data4 === void 0 ? void 0 : _oldResult$data4.onSamePage) || undefined
|
|
41
45
|
})
|
|
42
46
|
});
|
|
43
47
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import { SyncBlockError } from '../common/types';
|
|
2
3
|
/**
|
|
3
4
|
* Merges two SyncBlockInstance objects,
|
|
@@ -10,7 +11,7 @@ import { SyncBlockError } from '../common/types';
|
|
|
10
11
|
* @returns A merged SyncBlockInstance object.
|
|
11
12
|
*/
|
|
12
13
|
export const resolveSyncBlockInstance = (oldResult, newResult) => {
|
|
13
|
-
var _newResult$data, _oldResult$data, _newResult$data2, _oldResult$data2;
|
|
14
|
+
var _newResult$data, _oldResult$data, _newResult$data2, _oldResult$data2, _newResult$data3, _oldResult$data3, _newResult$data4, _oldResult$data4;
|
|
14
15
|
// if the old result has no data, we simply return the new result
|
|
15
16
|
if (!oldResult.data) {
|
|
16
17
|
return newResult;
|
|
@@ -29,7 +30,11 @@ export const resolveSyncBlockInstance = (oldResult, newResult) => {
|
|
|
29
30
|
data: {
|
|
30
31
|
...newResult.data,
|
|
31
32
|
sourceURL: ((_newResult$data = newResult.data) === null || _newResult$data === void 0 ? void 0 : _newResult$data.sourceURL) || ((_oldResult$data = oldResult.data) === null || _oldResult$data === void 0 ? void 0 : _oldResult$data.sourceURL) || undefined,
|
|
32
|
-
sourceTitle: ((_newResult$data2 = newResult.data) === null || _newResult$data2 === void 0 ? void 0 : _newResult$data2.sourceTitle) || ((_oldResult$data2 = oldResult.data) === null || _oldResult$data2 === void 0 ? void 0 : _oldResult$data2.sourceTitle) || undefined
|
|
33
|
+
sourceTitle: ((_newResult$data2 = newResult.data) === null || _newResult$data2 === void 0 ? void 0 : _newResult$data2.sourceTitle) || ((_oldResult$data2 = oldResult.data) === null || _oldResult$data2 === void 0 ? void 0 : _oldResult$data2.sourceTitle) || undefined,
|
|
34
|
+
...(fg('platform_synced_block_dogfooding') && {
|
|
35
|
+
sourceSubType: ((_newResult$data3 = newResult.data) === null || _newResult$data3 === void 0 ? void 0 : _newResult$data3.sourceSubType) || ((_oldResult$data3 = oldResult.data) === null || _oldResult$data3 === void 0 ? void 0 : _oldResult$data3.sourceSubType) || undefined,
|
|
36
|
+
onSamePage: ((_newResult$data4 = newResult.data) === null || _newResult$data4 === void 0 ? void 0 : _newResult$data4.onSamePage) || ((_oldResult$data4 = oldResult.data) === null || _oldResult$data4 === void 0 ? void 0 : _oldResult$data4.onSamePage) || undefined
|
|
37
|
+
})
|
|
33
38
|
}
|
|
34
39
|
};
|
|
35
40
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { SyncBlockError } from '../common/types';
|
|
5
6
|
/**
|
|
6
7
|
* Merges two SyncBlockInstance objects,
|
|
@@ -13,7 +14,7 @@ import { SyncBlockError } from '../common/types';
|
|
|
13
14
|
* @returns A merged SyncBlockInstance object.
|
|
14
15
|
*/
|
|
15
16
|
export var resolveSyncBlockInstance = function resolveSyncBlockInstance(oldResult, newResult) {
|
|
16
|
-
var _newResult$data, _oldResult$data, _newResult$data2, _oldResult$data2;
|
|
17
|
+
var _newResult$data, _oldResult$data, _newResult$data2, _oldResult$data2, _newResult$data3, _oldResult$data3, _newResult$data4, _oldResult$data4;
|
|
17
18
|
// if the old result has no data, we simply return the new result
|
|
18
19
|
if (!oldResult.data) {
|
|
19
20
|
return newResult;
|
|
@@ -31,6 +32,9 @@ export var resolveSyncBlockInstance = function resolveSyncBlockInstance(oldResul
|
|
|
31
32
|
data: _objectSpread(_objectSpread({}, newResult.data), {}, {
|
|
32
33
|
sourceURL: ((_newResult$data = newResult.data) === null || _newResult$data === void 0 ? void 0 : _newResult$data.sourceURL) || ((_oldResult$data = oldResult.data) === null || _oldResult$data === void 0 ? void 0 : _oldResult$data.sourceURL) || undefined,
|
|
33
34
|
sourceTitle: ((_newResult$data2 = newResult.data) === null || _newResult$data2 === void 0 ? void 0 : _newResult$data2.sourceTitle) || ((_oldResult$data2 = oldResult.data) === null || _oldResult$data2 === void 0 ? void 0 : _oldResult$data2.sourceTitle) || undefined
|
|
35
|
+
}, fg('platform_synced_block_dogfooding') && {
|
|
36
|
+
sourceSubType: ((_newResult$data3 = newResult.data) === null || _newResult$data3 === void 0 ? void 0 : _newResult$data3.sourceSubType) || ((_oldResult$data3 = oldResult.data) === null || _oldResult$data3 === void 0 ? void 0 : _oldResult$data3.sourceSubType) || undefined,
|
|
37
|
+
onSamePage: ((_newResult$data4 = newResult.data) === null || _newResult$data4 === void 0 ? void 0 : _newResult$data4.onSamePage) || ((_oldResult$data4 = oldResult.data) === null || _oldResult$data4 === void 0 ? void 0 : _oldResult$data4.onSamePage) || undefined
|
|
34
38
|
})
|
|
35
39
|
});
|
|
36
40
|
};
|
package/package.json
CHANGED