@atlaskit/editor-common 78.21.1 → 78.22.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 +19 -0
- package/dist/cjs/extensibility/MultiBodiedExtension/action-api.js +0 -3
- package/dist/cjs/guideline/fixedGuideline.js +16 -6
- package/dist/cjs/link/index.js +19 -0
- package/dist/cjs/link/utils.js +13 -1
- package/dist/cjs/messages/card.js +2 -2
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/extensibility/MultiBodiedExtension/action-api.js +0 -3
- package/dist/es2019/guideline/fixedGuideline.js +13 -6
- package/dist/es2019/link/index.js +2 -1
- package/dist/es2019/link/utils.js +12 -1
- package/dist/es2019/messages/card.js +2 -2
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/extensibility/MultiBodiedExtension/action-api.js +0 -3
- package/dist/esm/guideline/fixedGuideline.js +16 -6
- package/dist/esm/link/index.js +2 -1
- package/dist/esm/link/utils.js +12 -1
- package/dist/esm/messages/card.js +2 -2
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/analytics/types/events.d.ts +1 -1
- package/dist/types/guideline/fixedGuideline.d.ts +2 -2
- package/dist/types/guideline/types.d.ts +2 -0
- package/dist/types/link/index.d.ts +2 -1
- package/dist/types/link/utils.d.ts +2 -0
- package/dist/types-ts4.5/analytics/types/events.d.ts +1 -1
- package/dist/types-ts4.5/guideline/fixedGuideline.d.ts +2 -2
- package/dist/types-ts4.5/guideline/types.d.ts +2 -0
- package/dist/types-ts4.5/link/index.d.ts +2 -1
- package/dist/types-ts4.5/link/utils.d.ts +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 78.22.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#84733](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84733) [`de779b2d9543`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/de779b2d9543) - Modify link-preferences to factor in CLOUD_ENV environment varaible when fetching preferences link
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#84595](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84595) [`412b82018310`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/412b82018310) - ED-22555: Added isFullWidth to GuidelineConfig and use it as a signal
|
|
12
|
+
- [#85335](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/85335) [`0ede8cbb7ccf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0ede8cbb7ccf) - [ux] [ED-22607] - Removed check for maxFrames when adding child to multi-bodied extensions
|
|
13
|
+
|
|
14
|
+
- Allows any number of children to be added to a multi-bodied extension
|
|
15
|
+
|
|
16
|
+
## 78.21.2
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [#85158](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/85158) [`36988d12eb02`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/36988d12eb02) - The change here updated the datasource toolbar tooltip name from `Table` to `List`.
|
|
21
|
+
|
|
3
22
|
## 78.21.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -56,9 +56,6 @@ var useMultiBodiedExtensionActions = exports.useMultiBodiedExtensionActions = fu
|
|
|
56
56
|
addChild: function addChild() {
|
|
57
57
|
var state = editorView.state,
|
|
58
58
|
dispatch = editorView.dispatch;
|
|
59
|
-
if (node.content.childCount >= node.attrs.maxFrames) {
|
|
60
|
-
throw new Error("Cannot add more than ".concat(node.attrs.maxFrames, " frames"));
|
|
61
|
-
}
|
|
62
59
|
var p = state.schema.nodes.paragraph.createAndFill({});
|
|
63
60
|
if (!p) {
|
|
64
61
|
throw new Error('Could not create paragraph');
|
|
@@ -5,7 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.createGuidesFromLengths = exports.createFixedGuidelinesFromLengths = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
+
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
|
+
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; }
|
|
9
12
|
/**
|
|
10
13
|
* This creates a collection of points relative to the center line of each supplied length. For example; a length of
|
|
11
14
|
* 100 centered to 0 would result in the left position of -50 and a right position of +50.
|
|
@@ -25,6 +28,7 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
25
28
|
* @returns A collection of LengthGuide objects which can be used to draw left & right guides
|
|
26
29
|
*/
|
|
27
30
|
var createGuidesFromLengths = exports.createGuidesFromLengths = function createGuidesFromLengths(lengths) {
|
|
31
|
+
var isMaxLengthFullWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
28
32
|
return Array.from(new Set(lengths)).reduce(function (acc, length) {
|
|
29
33
|
var h = length * 0.5;
|
|
30
34
|
if (length === 0) {
|
|
@@ -38,11 +42,13 @@ var createGuidesFromLengths = exports.createGuidesFromLengths = function createG
|
|
|
38
42
|
// Filter out nonsensical values, null, undefined, NaN, empty string
|
|
39
43
|
return acc;
|
|
40
44
|
}
|
|
41
|
-
return [].concat((0, _toConsumableArray2.default)(acc), [{
|
|
45
|
+
return [].concat((0, _toConsumableArray2.default)(acc), [_objectSpread({
|
|
42
46
|
left: -h,
|
|
43
47
|
right: h,
|
|
44
48
|
length: length
|
|
45
|
-
}
|
|
49
|
+
}, isMaxLengthFullWidth && length === Math.max.apply(Math, (0, _toConsumableArray2.default)(lengths)) ? {
|
|
50
|
+
isFullWidth: true
|
|
51
|
+
} : {})]);
|
|
46
52
|
}, []);
|
|
47
53
|
};
|
|
48
54
|
|
|
@@ -54,10 +60,12 @@ var createGuidesFromLengths = exports.createGuidesFromLengths = function createG
|
|
|
54
60
|
*/
|
|
55
61
|
var createFixedGuidelinesFromLengths = exports.createFixedGuidelinesFromLengths = function createFixedGuidelinesFromLengths(lengths) {
|
|
56
62
|
var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'guide';
|
|
57
|
-
|
|
63
|
+
var isMaxLengthFullWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
64
|
+
return createGuidesFromLengths(lengths, isMaxLengthFullWidth).reduce(function (acc, _ref) {
|
|
58
65
|
var left = _ref.left,
|
|
59
66
|
right = _ref.right,
|
|
60
|
-
length = _ref.length
|
|
67
|
+
length = _ref.length,
|
|
68
|
+
isFullWidth = _ref.isFullWidth;
|
|
61
69
|
if (length === 0) {
|
|
62
70
|
return [].concat((0, _toConsumableArray2.default)(acc), [{
|
|
63
71
|
key: "".concat(key, "-").concat(length, "-centre"),
|
|
@@ -71,12 +79,14 @@ var createFixedGuidelinesFromLengths = exports.createFixedGuidelinesFromLengths
|
|
|
71
79
|
position: {
|
|
72
80
|
x: left
|
|
73
81
|
}
|
|
74
|
-
}, {
|
|
82
|
+
}, _objectSpread({
|
|
75
83
|
key: "".concat(key, "-").concat(length, "-right"),
|
|
76
84
|
position: {
|
|
77
85
|
x: right
|
|
78
86
|
}
|
|
79
|
-
}
|
|
87
|
+
}, isFullWidth ? {
|
|
88
|
+
isFullWidth: true
|
|
89
|
+
} : {})]);
|
|
80
90
|
}
|
|
81
91
|
}, []);
|
|
82
92
|
};
|
package/dist/cjs/link/index.js
CHANGED
|
@@ -77,6 +77,12 @@ Object.defineProperty(exports, "containerWithProvider", {
|
|
|
77
77
|
return _ToolbarComponents.containerWithProvider;
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
|
+
Object.defineProperty(exports, "getLinkPreferencesURLFromENV", {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
get: function get() {
|
|
83
|
+
return _utils2.getLinkPreferencesURLFromENV;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
80
86
|
Object.defineProperty(exports, "inputWrapper", {
|
|
81
87
|
enumerable: true,
|
|
82
88
|
get: function get() {
|
|
@@ -95,12 +101,24 @@ Object.defineProperty(exports, "isTextAtPos", {
|
|
|
95
101
|
return _utils2.isTextAtPos;
|
|
96
102
|
}
|
|
97
103
|
});
|
|
104
|
+
Object.defineProperty(exports, "productionLinkPreferencesUrl", {
|
|
105
|
+
enumerable: true,
|
|
106
|
+
get: function get() {
|
|
107
|
+
return _constants.productionLinkPreferencesUrl;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
98
110
|
Object.defineProperty(exports, "sha1", {
|
|
99
111
|
enumerable: true,
|
|
100
112
|
get: function get() {
|
|
101
113
|
return _utils.sha1;
|
|
102
114
|
}
|
|
103
115
|
});
|
|
116
|
+
Object.defineProperty(exports, "stagingLinkPreferencesUrl", {
|
|
117
|
+
enumerable: true,
|
|
118
|
+
get: function get() {
|
|
119
|
+
return _constants.stagingLinkPreferencesUrl;
|
|
120
|
+
}
|
|
121
|
+
});
|
|
104
122
|
Object.defineProperty(exports, "transformTimeStamp", {
|
|
105
123
|
enumerable: true,
|
|
106
124
|
get: function get() {
|
|
@@ -118,5 +136,6 @@ var _HyperlinkAddToolbar = require("./LinkPicker/HyperlinkAddToolbar");
|
|
|
118
136
|
var _HyperlinkAddToolbar2 = _interopRequireWildcard(require("./LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar"));
|
|
119
137
|
var _utils = require("./LinkPicker/HyperlinkAddToolbar/utils");
|
|
120
138
|
var _utils2 = require("./utils");
|
|
139
|
+
var _constants = require("./constants");
|
|
121
140
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
122
141
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
package/dist/cjs/link/utils.js
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.getLinkPreferencesURLFromENV = void 0;
|
|
6
7
|
exports.isLinkAtPos = isLinkAtPos;
|
|
7
8
|
exports.isTextAtPos = isTextAtPos;
|
|
9
|
+
var _constants = require("./constants");
|
|
8
10
|
function isTextAtPos(pos) {
|
|
9
11
|
return function (state) {
|
|
10
12
|
var node = state.doc.nodeAt(pos);
|
|
@@ -16,4 +18,14 @@ function isLinkAtPos(pos) {
|
|
|
16
18
|
var node = state.doc.nodeAt(pos);
|
|
17
19
|
return !!node && !!state.schema.marks.link.isInSet(node.marks);
|
|
18
20
|
};
|
|
19
|
-
}
|
|
21
|
+
}
|
|
22
|
+
var getLinkPreferencesURLFromENV = exports.getLinkPreferencesURLFromENV = function getLinkPreferencesURLFromENV() {
|
|
23
|
+
if (process.env.NODE_ENV === 'production' && process.env.CLOUD_ENV === 'staging') {
|
|
24
|
+
// only a production CLOUD_ENV staging environment has a different link preferences URL
|
|
25
|
+
return _constants.stagingLinkPreferencesUrl;
|
|
26
|
+
} else if (process.env.NODE_ENV === 'production') {
|
|
27
|
+
return _constants.productionLinkPreferencesUrl;
|
|
28
|
+
} else {
|
|
29
|
+
return _constants.stagingLinkPreferencesUrl;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -93,8 +93,8 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
93
93
|
},
|
|
94
94
|
datasourceAppearanceTitle: {
|
|
95
95
|
id: 'fabric.editor.datasourceAppearanceTitle',
|
|
96
|
-
defaultMessage: '
|
|
97
|
-
description: 'Tooltip of button to change to datasource
|
|
96
|
+
defaultMessage: 'List',
|
|
97
|
+
description: 'Tooltip of button to change to datasource appearance'
|
|
98
98
|
},
|
|
99
99
|
datasourceJiraIssue: {
|
|
100
100
|
id: 'fabric.editor.datasource.jiraIssue',
|
|
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
17
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
18
18
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
19
|
-
var packageVersion = "78.
|
|
19
|
+
var packageVersion = "78.22.0";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -22,7 +22,7 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
22
22
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
23
23
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
|
|
24
24
|
var packageName = "@atlaskit/editor-common";
|
|
25
|
-
var packageVersion = "78.
|
|
25
|
+
var packageVersion = "78.22.0";
|
|
26
26
|
var halfFocusRing = 1;
|
|
27
27
|
var dropOffset = '0, 8';
|
|
28
28
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -51,9 +51,6 @@ export const useMultiBodiedExtensionActions = ({
|
|
|
51
51
|
state,
|
|
52
52
|
dispatch
|
|
53
53
|
} = editorView;
|
|
54
|
-
if (node.content.childCount >= node.attrs.maxFrames) {
|
|
55
|
-
throw new Error(`Cannot add more than ${node.attrs.maxFrames} frames`);
|
|
56
|
-
}
|
|
57
54
|
const p = state.schema.nodes.paragraph.createAndFill({});
|
|
58
55
|
if (!p) {
|
|
59
56
|
throw new Error('Could not create paragraph');
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* @param lengths A colection of length values which will be split into a left & right guides.
|
|
17
17
|
* @returns A collection of LengthGuide objects which can be used to draw left & right guides
|
|
18
18
|
*/
|
|
19
|
-
export const createGuidesFromLengths = lengths => {
|
|
19
|
+
export const createGuidesFromLengths = (lengths, isMaxLengthFullWidth = false) => {
|
|
20
20
|
return Array.from(new Set(lengths)).reduce((acc, length) => {
|
|
21
21
|
const h = length * 0.5;
|
|
22
22
|
if (length === 0) {
|
|
@@ -33,7 +33,10 @@ export const createGuidesFromLengths = lengths => {
|
|
|
33
33
|
return [...acc, {
|
|
34
34
|
left: -h,
|
|
35
35
|
right: h,
|
|
36
|
-
length
|
|
36
|
+
length,
|
|
37
|
+
...(isMaxLengthFullWidth && length === Math.max(...lengths) ? {
|
|
38
|
+
isFullWidth: true
|
|
39
|
+
} : {})
|
|
37
40
|
}];
|
|
38
41
|
}, []);
|
|
39
42
|
};
|
|
@@ -44,11 +47,12 @@ export const createGuidesFromLengths = lengths => {
|
|
|
44
47
|
* When length is 0, generate a guideline at position: {x: 0}
|
|
45
48
|
*
|
|
46
49
|
*/
|
|
47
|
-
export const createFixedGuidelinesFromLengths = (lengths, key = 'guide') => {
|
|
48
|
-
return createGuidesFromLengths(lengths).reduce((acc, {
|
|
50
|
+
export const createFixedGuidelinesFromLengths = (lengths, key = 'guide', isMaxLengthFullWidth = false) => {
|
|
51
|
+
return createGuidesFromLengths(lengths, isMaxLengthFullWidth).reduce((acc, {
|
|
49
52
|
left,
|
|
50
53
|
right,
|
|
51
|
-
length
|
|
54
|
+
length,
|
|
55
|
+
isFullWidth
|
|
52
56
|
}) => {
|
|
53
57
|
if (length === 0) {
|
|
54
58
|
return [...acc, {
|
|
@@ -67,7 +71,10 @@ export const createFixedGuidelinesFromLengths = (lengths, key = 'guide') => {
|
|
|
67
71
|
key: `${key}-${length}-right`,
|
|
68
72
|
position: {
|
|
69
73
|
x: right
|
|
70
|
-
}
|
|
74
|
+
},
|
|
75
|
+
...(isFullWidth ? {
|
|
76
|
+
isFullWidth: true
|
|
77
|
+
} : {})
|
|
71
78
|
}];
|
|
72
79
|
}
|
|
73
80
|
}, []);
|
|
@@ -8,4 +8,5 @@ export { EditorLinkPicker } from './LinkPicker/EditorLinkPicker';
|
|
|
8
8
|
export { HyperlinkAddToolbar } from './LinkPicker/HyperlinkAddToolbar';
|
|
9
9
|
export { default as HyperlinkLinkAddToolbar, HyperlinkLinkAddToolbarWithIntl, RECENT_SEARCH_LIST_SIZE } from './LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar';
|
|
10
10
|
export { sha1 } from './LinkPicker/HyperlinkAddToolbar/utils';
|
|
11
|
-
export { isLinkAtPos, isTextAtPos } from './utils';
|
|
11
|
+
export { isLinkAtPos, isTextAtPos, getLinkPreferencesURLFromENV } from './utils';
|
|
12
|
+
export { stagingLinkPreferencesUrl, productionLinkPreferencesUrl } from './constants';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { productionLinkPreferencesUrl, stagingLinkPreferencesUrl } from './constants';
|
|
1
2
|
export function isTextAtPos(pos) {
|
|
2
3
|
return state => {
|
|
3
4
|
const node = state.doc.nodeAt(pos);
|
|
@@ -9,4 +10,14 @@ export function isLinkAtPos(pos) {
|
|
|
9
10
|
const node = state.doc.nodeAt(pos);
|
|
10
11
|
return !!node && !!state.schema.marks.link.isInSet(node.marks);
|
|
11
12
|
};
|
|
12
|
-
}
|
|
13
|
+
}
|
|
14
|
+
export const getLinkPreferencesURLFromENV = () => {
|
|
15
|
+
if (process.env.NODE_ENV === 'production' && process.env.CLOUD_ENV === 'staging') {
|
|
16
|
+
// only a production CLOUD_ENV staging environment has a different link preferences URL
|
|
17
|
+
return stagingLinkPreferencesUrl;
|
|
18
|
+
} else if (process.env.NODE_ENV === 'production') {
|
|
19
|
+
return productionLinkPreferencesUrl;
|
|
20
|
+
} else {
|
|
21
|
+
return stagingLinkPreferencesUrl;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
@@ -87,8 +87,8 @@ export const messages = defineMessages({
|
|
|
87
87
|
},
|
|
88
88
|
datasourceAppearanceTitle: {
|
|
89
89
|
id: 'fabric.editor.datasourceAppearanceTitle',
|
|
90
|
-
defaultMessage: '
|
|
91
|
-
description: 'Tooltip of button to change to datasource
|
|
90
|
+
defaultMessage: 'List',
|
|
91
|
+
description: 'Tooltip of button to change to datasource appearance'
|
|
92
92
|
},
|
|
93
93
|
datasourceJiraIssue: {
|
|
94
94
|
id: 'fabric.editor.datasource.jiraIssue',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
2
2
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
3
|
-
const packageVersion = "78.
|
|
3
|
+
const packageVersion = "78.22.0";
|
|
4
4
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
5
5
|
// Remove URL as it has UGC
|
|
6
6
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -7,7 +7,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
7
7
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
8
8
|
import Layer from '../Layer';
|
|
9
9
|
const packageName = "@atlaskit/editor-common";
|
|
10
|
-
const packageVersion = "78.
|
|
10
|
+
const packageVersion = "78.22.0";
|
|
11
11
|
const halfFocusRing = 1;
|
|
12
12
|
const dropOffset = '0, 8';
|
|
13
13
|
class DropList extends Component {
|
|
@@ -49,9 +49,6 @@ export var useMultiBodiedExtensionActions = function useMultiBodiedExtensionActi
|
|
|
49
49
|
addChild: function addChild() {
|
|
50
50
|
var state = editorView.state,
|
|
51
51
|
dispatch = editorView.dispatch;
|
|
52
|
-
if (node.content.childCount >= node.attrs.maxFrames) {
|
|
53
|
-
throw new Error("Cannot add more than ".concat(node.attrs.maxFrames, " frames"));
|
|
54
|
-
}
|
|
55
52
|
var p = state.schema.nodes.paragraph.createAndFill({});
|
|
56
53
|
if (!p) {
|
|
57
54
|
throw new Error('Could not create paragraph');
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
2
5
|
/**
|
|
3
6
|
* This creates a collection of points relative to the center line of each supplied length. For example; a length of
|
|
4
7
|
* 100 centered to 0 would result in the left position of -50 and a right position of +50.
|
|
@@ -18,6 +21,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
18
21
|
* @returns A collection of LengthGuide objects which can be used to draw left & right guides
|
|
19
22
|
*/
|
|
20
23
|
export var createGuidesFromLengths = function createGuidesFromLengths(lengths) {
|
|
24
|
+
var isMaxLengthFullWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
21
25
|
return Array.from(new Set(lengths)).reduce(function (acc, length) {
|
|
22
26
|
var h = length * 0.5;
|
|
23
27
|
if (length === 0) {
|
|
@@ -31,11 +35,13 @@ export var createGuidesFromLengths = function createGuidesFromLengths(lengths) {
|
|
|
31
35
|
// Filter out nonsensical values, null, undefined, NaN, empty string
|
|
32
36
|
return acc;
|
|
33
37
|
}
|
|
34
|
-
return [].concat(_toConsumableArray(acc), [{
|
|
38
|
+
return [].concat(_toConsumableArray(acc), [_objectSpread({
|
|
35
39
|
left: -h,
|
|
36
40
|
right: h,
|
|
37
41
|
length: length
|
|
38
|
-
}
|
|
42
|
+
}, isMaxLengthFullWidth && length === Math.max.apply(Math, _toConsumableArray(lengths)) ? {
|
|
43
|
+
isFullWidth: true
|
|
44
|
+
} : {})]);
|
|
39
45
|
}, []);
|
|
40
46
|
};
|
|
41
47
|
|
|
@@ -47,10 +53,12 @@ export var createGuidesFromLengths = function createGuidesFromLengths(lengths) {
|
|
|
47
53
|
*/
|
|
48
54
|
export var createFixedGuidelinesFromLengths = function createFixedGuidelinesFromLengths(lengths) {
|
|
49
55
|
var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'guide';
|
|
50
|
-
|
|
56
|
+
var isMaxLengthFullWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
57
|
+
return createGuidesFromLengths(lengths, isMaxLengthFullWidth).reduce(function (acc, _ref) {
|
|
51
58
|
var left = _ref.left,
|
|
52
59
|
right = _ref.right,
|
|
53
|
-
length = _ref.length
|
|
60
|
+
length = _ref.length,
|
|
61
|
+
isFullWidth = _ref.isFullWidth;
|
|
54
62
|
if (length === 0) {
|
|
55
63
|
return [].concat(_toConsumableArray(acc), [{
|
|
56
64
|
key: "".concat(key, "-").concat(length, "-centre"),
|
|
@@ -64,12 +72,14 @@ export var createFixedGuidelinesFromLengths = function createFixedGuidelinesFrom
|
|
|
64
72
|
position: {
|
|
65
73
|
x: left
|
|
66
74
|
}
|
|
67
|
-
}, {
|
|
75
|
+
}, _objectSpread({
|
|
68
76
|
key: "".concat(key, "-").concat(length, "-right"),
|
|
69
77
|
position: {
|
|
70
78
|
x: right
|
|
71
79
|
}
|
|
72
|
-
}
|
|
80
|
+
}, isFullWidth ? {
|
|
81
|
+
isFullWidth: true
|
|
82
|
+
} : {})]);
|
|
73
83
|
}
|
|
74
84
|
}, []);
|
|
75
85
|
};
|
package/dist/esm/link/index.js
CHANGED
|
@@ -8,4 +8,5 @@ export { EditorLinkPicker } from './LinkPicker/EditorLinkPicker';
|
|
|
8
8
|
export { HyperlinkAddToolbar } from './LinkPicker/HyperlinkAddToolbar';
|
|
9
9
|
export { default as HyperlinkLinkAddToolbar, HyperlinkLinkAddToolbarWithIntl, RECENT_SEARCH_LIST_SIZE } from './LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar';
|
|
10
10
|
export { sha1 } from './LinkPicker/HyperlinkAddToolbar/utils';
|
|
11
|
-
export { isLinkAtPos, isTextAtPos } from './utils';
|
|
11
|
+
export { isLinkAtPos, isTextAtPos, getLinkPreferencesURLFromENV } from './utils';
|
|
12
|
+
export { stagingLinkPreferencesUrl, productionLinkPreferencesUrl } from './constants';
|
package/dist/esm/link/utils.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { productionLinkPreferencesUrl, stagingLinkPreferencesUrl } from './constants';
|
|
1
2
|
export function isTextAtPos(pos) {
|
|
2
3
|
return function (state) {
|
|
3
4
|
var node = state.doc.nodeAt(pos);
|
|
@@ -9,4 +10,14 @@ export function isLinkAtPos(pos) {
|
|
|
9
10
|
var node = state.doc.nodeAt(pos);
|
|
10
11
|
return !!node && !!state.schema.marks.link.isInSet(node.marks);
|
|
11
12
|
};
|
|
12
|
-
}
|
|
13
|
+
}
|
|
14
|
+
export var getLinkPreferencesURLFromENV = function getLinkPreferencesURLFromENV() {
|
|
15
|
+
if (process.env.NODE_ENV === 'production' && process.env.CLOUD_ENV === 'staging') {
|
|
16
|
+
// only a production CLOUD_ENV staging environment has a different link preferences URL
|
|
17
|
+
return stagingLinkPreferencesUrl;
|
|
18
|
+
} else if (process.env.NODE_ENV === 'production') {
|
|
19
|
+
return productionLinkPreferencesUrl;
|
|
20
|
+
} else {
|
|
21
|
+
return stagingLinkPreferencesUrl;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
@@ -87,8 +87,8 @@ export var messages = defineMessages({
|
|
|
87
87
|
},
|
|
88
88
|
datasourceAppearanceTitle: {
|
|
89
89
|
id: 'fabric.editor.datasourceAppearanceTitle',
|
|
90
|
-
defaultMessage: '
|
|
91
|
-
description: 'Tooltip of button to change to datasource
|
|
90
|
+
defaultMessage: 'List',
|
|
91
|
+
description: 'Tooltip of button to change to datasource appearance'
|
|
92
92
|
},
|
|
93
93
|
datasourceJiraIssue: {
|
|
94
94
|
id: 'fabric.editor.datasource.jiraIssue',
|
|
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
6
6
|
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; }
|
|
7
7
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
8
8
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
9
|
-
var packageVersion = "78.
|
|
9
|
+
var packageVersion = "78.22.0";
|
|
10
10
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
11
11
|
// Remove URL as it has UGC
|
|
12
12
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -17,7 +17,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
17
17
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
18
18
|
import Layer from '../Layer';
|
|
19
19
|
var packageName = "@atlaskit/editor-common";
|
|
20
|
-
var packageVersion = "78.
|
|
20
|
+
var packageVersion = "78.22.0";
|
|
21
21
|
var halfFocusRing = 1;
|
|
22
22
|
var dropOffset = '0, 8';
|
|
23
23
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -50,7 +50,7 @@ type MBEEventPayload = TrackAEP<ACTION.ADD_CHILD | ACTION.CHANGE_ACTIVE | ACTION
|
|
|
50
50
|
extensionType: string;
|
|
51
51
|
extensionKey: string;
|
|
52
52
|
localId: string;
|
|
53
|
-
maxFramesCount
|
|
53
|
+
maxFramesCount?: number;
|
|
54
54
|
currentFramesCount: number;
|
|
55
55
|
}, undefined>;
|
|
56
56
|
export type AnalyticsEventPayloadWithChannel = {
|
|
@@ -17,14 +17,14 @@ import type { LengthGuide } from './types';
|
|
|
17
17
|
* @param lengths A colection of length values which will be split into a left & right guides.
|
|
18
18
|
* @returns A collection of LengthGuide objects which can be used to draw left & right guides
|
|
19
19
|
*/
|
|
20
|
-
export declare const createGuidesFromLengths: (lengths: number[]) => LengthGuide[];
|
|
20
|
+
export declare const createGuidesFromLengths: (lengths: number[], isMaxLengthFullWidth?: boolean) => LengthGuide[];
|
|
21
21
|
/**
|
|
22
22
|
* This creates a Guideline configuration generating a collection of guideline pairs from each supplied length value.
|
|
23
23
|
* Each length value generates a guideline config for both the left and right side of the length.
|
|
24
24
|
* When length is 0, generate a guideline at position: {x: 0}
|
|
25
25
|
*
|
|
26
26
|
*/
|
|
27
|
-
export declare const createFixedGuidelinesFromLengths: (lengths: number[], key?: string) => {
|
|
27
|
+
export declare const createFixedGuidelinesFromLengths: (lengths: number[], key?: string, isMaxLengthFullWidth?: boolean) => {
|
|
28
28
|
key: string;
|
|
29
29
|
position: {
|
|
30
30
|
x: number;
|
|
@@ -6,6 +6,7 @@ export type LengthGuide = {
|
|
|
6
6
|
left: number;
|
|
7
7
|
right: number;
|
|
8
8
|
length: number;
|
|
9
|
+
isFullWidth?: boolean;
|
|
9
10
|
};
|
|
10
11
|
export type Range = {
|
|
11
12
|
start: number;
|
|
@@ -32,6 +33,7 @@ export type GuidelineStyles = {
|
|
|
32
33
|
export type GuidelineConfig = {
|
|
33
34
|
key: string;
|
|
34
35
|
position: Position;
|
|
36
|
+
isFullWidth?: boolean;
|
|
35
37
|
} & GuidelineStyles;
|
|
36
38
|
export type GuidelineContainerRect = {
|
|
37
39
|
top: number;
|
|
@@ -13,4 +13,5 @@ export { default as HyperlinkLinkAddToolbar, HyperlinkLinkAddToolbarWithIntl, RE
|
|
|
13
13
|
export type { Props as HyperlinkLinkAddToolbarProps } from './LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar';
|
|
14
14
|
export type { HyperlinkAddToolbarProps } from './LinkPicker/HyperlinkAddToolbar';
|
|
15
15
|
export { sha1 } from './LinkPicker/HyperlinkAddToolbar/utils';
|
|
16
|
-
export { isLinkAtPos, isTextAtPos } from './utils';
|
|
16
|
+
export { isLinkAtPos, isTextAtPos, getLinkPreferencesURLFromENV, } from './utils';
|
|
17
|
+
export { stagingLinkPreferencesUrl, productionLinkPreferencesUrl, } from './constants';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { Predicate } from '../types';
|
|
2
|
+
import { productionLinkPreferencesUrl, stagingLinkPreferencesUrl } from './constants';
|
|
2
3
|
export declare function isTextAtPos(pos: number): Predicate;
|
|
3
4
|
export declare function isLinkAtPos(pos: number): Predicate;
|
|
5
|
+
export declare const getLinkPreferencesURLFromENV: () => typeof productionLinkPreferencesUrl | typeof stagingLinkPreferencesUrl;
|
|
@@ -50,7 +50,7 @@ type MBEEventPayload = TrackAEP<ACTION.ADD_CHILD | ACTION.CHANGE_ACTIVE | ACTION
|
|
|
50
50
|
extensionType: string;
|
|
51
51
|
extensionKey: string;
|
|
52
52
|
localId: string;
|
|
53
|
-
maxFramesCount
|
|
53
|
+
maxFramesCount?: number;
|
|
54
54
|
currentFramesCount: number;
|
|
55
55
|
}, undefined>;
|
|
56
56
|
export type AnalyticsEventPayloadWithChannel = {
|
|
@@ -17,14 +17,14 @@ import type { LengthGuide } from './types';
|
|
|
17
17
|
* @param lengths A colection of length values which will be split into a left & right guides.
|
|
18
18
|
* @returns A collection of LengthGuide objects which can be used to draw left & right guides
|
|
19
19
|
*/
|
|
20
|
-
export declare const createGuidesFromLengths: (lengths: number[]) => LengthGuide[];
|
|
20
|
+
export declare const createGuidesFromLengths: (lengths: number[], isMaxLengthFullWidth?: boolean) => LengthGuide[];
|
|
21
21
|
/**
|
|
22
22
|
* This creates a Guideline configuration generating a collection of guideline pairs from each supplied length value.
|
|
23
23
|
* Each length value generates a guideline config for both the left and right side of the length.
|
|
24
24
|
* When length is 0, generate a guideline at position: {x: 0}
|
|
25
25
|
*
|
|
26
26
|
*/
|
|
27
|
-
export declare const createFixedGuidelinesFromLengths: (lengths: number[], key?: string) => {
|
|
27
|
+
export declare const createFixedGuidelinesFromLengths: (lengths: number[], key?: string, isMaxLengthFullWidth?: boolean) => {
|
|
28
28
|
key: string;
|
|
29
29
|
position: {
|
|
30
30
|
x: number;
|
|
@@ -6,6 +6,7 @@ export type LengthGuide = {
|
|
|
6
6
|
left: number;
|
|
7
7
|
right: number;
|
|
8
8
|
length: number;
|
|
9
|
+
isFullWidth?: boolean;
|
|
9
10
|
};
|
|
10
11
|
export type Range = {
|
|
11
12
|
start: number;
|
|
@@ -32,6 +33,7 @@ export type GuidelineStyles = {
|
|
|
32
33
|
export type GuidelineConfig = {
|
|
33
34
|
key: string;
|
|
34
35
|
position: Position;
|
|
36
|
+
isFullWidth?: boolean;
|
|
35
37
|
} & GuidelineStyles;
|
|
36
38
|
export type GuidelineContainerRect = {
|
|
37
39
|
top: number;
|
|
@@ -13,4 +13,5 @@ export { default as HyperlinkLinkAddToolbar, HyperlinkLinkAddToolbarWithIntl, RE
|
|
|
13
13
|
export type { Props as HyperlinkLinkAddToolbarProps } from './LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar';
|
|
14
14
|
export type { HyperlinkAddToolbarProps } from './LinkPicker/HyperlinkAddToolbar';
|
|
15
15
|
export { sha1 } from './LinkPicker/HyperlinkAddToolbar/utils';
|
|
16
|
-
export { isLinkAtPos, isTextAtPos } from './utils';
|
|
16
|
+
export { isLinkAtPos, isTextAtPos, getLinkPreferencesURLFromENV, } from './utils';
|
|
17
|
+
export { stagingLinkPreferencesUrl, productionLinkPreferencesUrl, } from './constants';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { Predicate } from '../types';
|
|
2
|
+
import { productionLinkPreferencesUrl, stagingLinkPreferencesUrl } from './constants';
|
|
2
3
|
export declare function isTextAtPos(pos: number): Predicate;
|
|
3
4
|
export declare function isLinkAtPos(pos: number): Predicate;
|
|
5
|
+
export declare const getLinkPreferencesURLFromENV: () => typeof productionLinkPreferencesUrl | typeof stagingLinkPreferencesUrl;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "78.
|
|
3
|
+
"version": "78.22.0",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"@atlaskit/analytics-namespaced-context": "^6.9.0",
|
|
101
101
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
102
102
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
103
|
-
"@atlaskit/button": "^17.
|
|
103
|
+
"@atlaskit/button": "^17.8.0",
|
|
104
104
|
"@atlaskit/code": "^15.1.0",
|
|
105
105
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
106
106
|
"@atlaskit/custom-steps": "^0.0.16",
|