@atlaskit/editor-common 112.4.3 → 112.5.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 +35 -0
- package/dist/cjs/ai-messages/ai.js +1 -1
- package/dist/cjs/analytics/types/enums.js +1 -0
- package/dist/cjs/messages/index.js +7 -0
- package/dist/cjs/messages/smart-link-changeboard.js +29 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/react-node-view/index.js +6 -2
- package/dist/cjs/ugc-tokens/editor-ugc-token-names.js +1 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/OverflowShadow/index.js +8 -6
- package/dist/cjs/ui/Popup/utils.js +11 -4
- package/dist/cjs/utils/calculate-toolbar-position.js +2 -194
- package/dist/es2019/ai-messages/ai.js +1 -1
- package/dist/es2019/analytics/types/enums.js +1 -0
- package/dist/es2019/messages/index.js +1 -0
- package/dist/es2019/messages/smart-link-changeboard.js +23 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/react-node-view/index.js +6 -2
- package/dist/es2019/ugc-tokens/editor-ugc-token-names.js +1 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/OverflowShadow/index.js +8 -6
- package/dist/es2019/ui/Popup/utils.js +11 -4
- package/dist/es2019/utils/calculate-toolbar-position.js +1 -196
- package/dist/esm/ai-messages/ai.js +1 -1
- package/dist/esm/analytics/types/enums.js +1 -0
- package/dist/esm/messages/index.js +1 -0
- package/dist/esm/messages/smart-link-changeboard.js +23 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/react-node-view/index.js +6 -2
- package/dist/esm/ugc-tokens/editor-ugc-token-names.js +1 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/OverflowShadow/index.js +8 -6
- package/dist/esm/ui/Popup/utils.js +11 -4
- package/dist/esm/utils/calculate-toolbar-position.js +1 -193
- package/dist/types/analytics/types/enums.d.ts +1 -0
- package/dist/types/analytics/types/format-events.d.ts +5 -1
- package/dist/types/messages/index.d.ts +1 -0
- package/dist/types/messages/smart-link-changeboard.d.ts +22 -0
- package/dist/types/ugc-tokens/editor-ugc-token-names.d.ts +1 -0
- package/dist/types/utils/calculate-toolbar-position.d.ts +0 -7
- package/dist/types-ts4.5/analytics/types/enums.d.ts +1 -0
- package/dist/types-ts4.5/analytics/types/format-events.d.ts +5 -1
- package/dist/types-ts4.5/messages/index.d.ts +1 -0
- package/dist/types-ts4.5/messages/smart-link-changeboard.d.ts +22 -0
- package/dist/types-ts4.5/ugc-tokens/editor-ugc-token-names.d.ts +1 -0
- package/dist/types-ts4.5/utils/calculate-toolbar-position.d.ts +0 -7
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 112.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`8b0c77d86d97f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8b0c77d86d97f) - -
|
|
8
|
+
Created SmartLinkDraggableChangeboardPopover component
|
|
9
|
+
- Define i18n message text in editor-common
|
|
10
|
+
- Added skeleton code to SmartLinkDraggableInner component to easily incorportate new
|
|
11
|
+
changeboarding
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`38a861ed1d4b7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38a861ed1d4b7) -
|
|
16
|
+
[NO-ISSUE] Update text and icon in nested menu for ai section in blockmenu
|
|
17
|
+
- [`d59ae43080757`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d59ae43080757) -
|
|
18
|
+
Fixed all ESlint no-casting-violations in editor common
|
|
19
|
+
- [`8b781b3b3f9ca`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8b781b3b3f9ca) -
|
|
20
|
+
Add setSmallText and setSmallTextWithAnalytics commands, modify setNormalText to remove fontSize
|
|
21
|
+
mark, add FORMAT_SMALL_TEXT analytics enum.
|
|
22
|
+
|
|
23
|
+
Add support to the renderer to render 'small text'.
|
|
24
|
+
|
|
25
|
+
Add 'fontSize' to stage0 default schema.
|
|
26
|
+
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
|
|
29
|
+
## 112.4.4
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- [`b6830be30e686`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b6830be30e686) -
|
|
34
|
+
Cleaned up selection toolbar positioning code behind platform_editor_sel_toolbar_fix and
|
|
35
|
+
platform_editor_sel_toolbar_scroll_pos_fix_exp experiments
|
|
36
|
+
- Updated dependencies
|
|
37
|
+
|
|
3
38
|
## 112.4.3
|
|
4
39
|
|
|
5
40
|
### Patch Changes
|
|
@@ -255,7 +255,7 @@ var aiMessages = exports.aiMessages = (0, _reactIntlNext.defineMessages)({
|
|
|
255
255
|
// Block menu messages
|
|
256
256
|
blockMenuNestedMenuTitle: {
|
|
257
257
|
id: 'fabric.editor.ai.config.item.blockMenuNestedMenu.title',
|
|
258
|
-
defaultMessage: '
|
|
258
|
+
defaultMessage: 'View more actions',
|
|
259
259
|
description: 'Title for the nested menu in the block menu'
|
|
260
260
|
}
|
|
261
261
|
});
|
|
@@ -448,6 +448,7 @@ var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTIO
|
|
|
448
448
|
ACTION_SUBJECT_ID["FORMAT_CODE"] = "code";
|
|
449
449
|
ACTION_SUBJECT_ID["FORMAT_COLOR"] = "color";
|
|
450
450
|
ACTION_SUBJECT_ID["FORMAT_HEADING"] = "heading";
|
|
451
|
+
ACTION_SUBJECT_ID["FORMAT_SMALL_TEXT"] = "smallText";
|
|
451
452
|
ACTION_SUBJECT_ID["FORMAT_INDENT"] = "indentation";
|
|
452
453
|
ACTION_SUBJECT_ID["FORMAT_ITALIC"] = "italic";
|
|
453
454
|
ACTION_SUBJECT_ID["FORMAT_LIST_BULLET"] = "bulletedList";
|
|
@@ -226,6 +226,12 @@ Object.defineProperty(exports, "selectionToolbarMessages", {
|
|
|
226
226
|
return _selectionToolbar.selectionToolbarMessages;
|
|
227
227
|
}
|
|
228
228
|
});
|
|
229
|
+
Object.defineProperty(exports, "smartLinkChangeboardMessages", {
|
|
230
|
+
enumerable: true,
|
|
231
|
+
get: function get() {
|
|
232
|
+
return _smartLinkChangeboard.smartLinkChangeboardMessages;
|
|
233
|
+
}
|
|
234
|
+
});
|
|
229
235
|
Object.defineProperty(exports, "statusMessages", {
|
|
230
236
|
enumerable: true,
|
|
231
237
|
get: function get() {
|
|
@@ -312,6 +318,7 @@ var _date = require("./date");
|
|
|
312
318
|
var _layout = require("./layout");
|
|
313
319
|
var _indentation = require("./indentation");
|
|
314
320
|
var _avatarGroup = require("./avatar-group");
|
|
321
|
+
var _smartLinkChangeboard = require("./smart-link-changeboard");
|
|
315
322
|
var _findReplace = require("./find-replace");
|
|
316
323
|
var _elementInsertSidePanel = require("./element-insert-side-panel");
|
|
317
324
|
var _textColor = require("./text-color");
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.smartLinkChangeboardMessages = void 0;
|
|
7
|
+
var _reactIntlNext = require("react-intl-next");
|
|
8
|
+
var smartLinkChangeboardMessages = exports.smartLinkChangeboardMessages = (0, _reactIntlNext.defineMessages)({
|
|
9
|
+
headline: {
|
|
10
|
+
id: 'platform.editor.smartlink.changeboard.headline',
|
|
11
|
+
defaultMessage: 'Drag and drop links',
|
|
12
|
+
description: 'Headline for the smart link drag and drop changeboarding popup'
|
|
13
|
+
},
|
|
14
|
+
gifAlt: {
|
|
15
|
+
id: 'platform.editor.smartlink.changeboard.gif.alt',
|
|
16
|
+
defaultMessage: 'Drag smart link into sidebar demonstration',
|
|
17
|
+
description: 'Alt text for the changeboarding GIF'
|
|
18
|
+
},
|
|
19
|
+
description: {
|
|
20
|
+
id: 'platform.editor.smartlink.changeboard.description',
|
|
21
|
+
defaultMessage: 'Keep your important links organized and easy to find by dragging Smart Links into the content tree.',
|
|
22
|
+
description: 'Description text for the changeboarding popup'
|
|
23
|
+
},
|
|
24
|
+
dismiss: {
|
|
25
|
+
id: 'platform.editor.smartlink.changeboard.dismiss',
|
|
26
|
+
defaultMessage: 'Done',
|
|
27
|
+
description: 'Label for the dismiss button in the changeboarding popup'
|
|
28
|
+
}
|
|
29
|
+
});
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
20
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
21
21
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
22
|
-
var packageVersion = "112.4.
|
|
22
|
+
var packageVersion = "112.4.4";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -280,9 +280,13 @@ var ReactNodeView = exports.default = /*#__PURE__*/function () {
|
|
|
280
280
|
}, {
|
|
281
281
|
key: "dom",
|
|
282
282
|
get: function get() {
|
|
283
|
+
// Only return reference if domRef is defined
|
|
284
|
+
if (this.domRef === undefined) {
|
|
285
|
+
//raise an error
|
|
286
|
+
throw new Error('domRef is not defined or may have been destroyed');
|
|
287
|
+
}
|
|
288
|
+
|
|
283
289
|
// Spreading props to pass through dynamic component props
|
|
284
|
-
// Ignored via go/ees005
|
|
285
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
286
290
|
return this.domRef;
|
|
287
291
|
}
|
|
288
292
|
}, {
|
|
@@ -46,6 +46,7 @@ var editorUGCTokensRefreshed = exports.editorUGCTokensRefreshed = {
|
|
|
46
46
|
'editor.font.heading.h5': 'normal 600 0.857143em/1.33333 "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
|
|
47
47
|
'editor.font.heading.h6': 'normal 600 0.785714em/1.45455 "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
|
|
48
48
|
'editor.font.body': 'normal 400 1em/1.714 "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
|
|
49
|
+
'editor.font.body.small': 'normal 400 0.875em/1.714 "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
|
|
49
50
|
'editor.font.weight.heading.h1.bold': '700',
|
|
50
51
|
'editor.font.weight.heading.h2.bold': '700',
|
|
51
52
|
'editor.font.weight.heading.h3.bold': '700',
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "112.4.
|
|
27
|
+
var packageVersion = "112.4.4";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -80,10 +80,10 @@ function overflowShadow(Component, options) {
|
|
|
80
80
|
}
|
|
81
81
|
var width = 0;
|
|
82
82
|
for (var i = 0; i < _this.scrollable.length; i++) {
|
|
83
|
-
// Ignored via go/ees005
|
|
84
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
85
83
|
var scrollableElement = _this.scrollable[i];
|
|
86
|
-
|
|
84
|
+
if (isElementNode(scrollableElement)) {
|
|
85
|
+
width += scrollableElement.scrollWidth;
|
|
86
|
+
}
|
|
87
87
|
}
|
|
88
88
|
return width;
|
|
89
89
|
});
|
|
@@ -92,9 +92,6 @@ function overflowShadow(Component, options) {
|
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
94
|
_this.container = container;
|
|
95
|
-
|
|
96
|
-
// Ignored via go/ees005
|
|
97
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
98
95
|
_this.overflowContainer = container.querySelector(options.overflowSelector);
|
|
99
96
|
if (!_this.overflowContainer) {
|
|
100
97
|
_this.overflowContainer = container;
|
|
@@ -181,4 +178,9 @@ function overflowShadow(Component, options) {
|
|
|
181
178
|
}
|
|
182
179
|
}]);
|
|
183
180
|
}(_react.default.Component);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Helper function to check if the passed node is of Element class
|
|
184
|
+
function isElementNode(node) {
|
|
185
|
+
return node.nodeType === 1;
|
|
184
186
|
}
|
|
@@ -235,7 +235,7 @@ function calculatePosition(_ref5) {
|
|
|
235
235
|
boundariesElement = _ref5.boundariesElement,
|
|
236
236
|
minPopupMargin = _ref5.minPopupMargin;
|
|
237
237
|
var position = {};
|
|
238
|
-
if (!target || !popup || !popup.offsetParent) {
|
|
238
|
+
if (!target || !popup || !popup.offsetParent || !isHTMLElementNode(popup.offsetParent)) {
|
|
239
239
|
return position;
|
|
240
240
|
}
|
|
241
241
|
if (isTextNode(target)) {
|
|
@@ -243,9 +243,6 @@ function calculatePosition(_ref5) {
|
|
|
243
243
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
244
244
|
target = target.parentElement;
|
|
245
245
|
}
|
|
246
|
-
|
|
247
|
-
// Ignored via go/ees005
|
|
248
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
249
246
|
var popupOffsetParent = popup.offsetParent;
|
|
250
247
|
var offsetParentStyle = popupOffsetParent.style;
|
|
251
248
|
var borderBottomWidth = 0;
|
|
@@ -354,4 +351,14 @@ function findOverflowScrollParent(popup) {
|
|
|
354
351
|
}
|
|
355
352
|
}
|
|
356
353
|
return false;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// Helper function to check if the passed node is of Element class
|
|
357
|
+
function isElementNode(node) {
|
|
358
|
+
return node.nodeType === 1;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// Helper function to check if the passed node is of HTMLElement class
|
|
362
|
+
function isHTMLElementNode(node) {
|
|
363
|
+
return isElementNode(node) && node.namespaceURI === 'http://www.w3.org/1999/xhtml';
|
|
357
364
|
}
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.calculateToolbarPositionTrackHead = exports.calculateToolbarPositionOnCellSelection = exports.calculateToolbarPositionAboveSelection = void 0;
|
|
7
7
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
8
8
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
9
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
10
9
|
var MAXIMUM_BROWSER_SCROLLBAR_WIDTH = 20;
|
|
11
10
|
|
|
12
11
|
/*
|
|
@@ -85,82 +84,7 @@ var calculateToolbarPositionAboveSelection = exports.calculateToolbarPositionAbo
|
|
|
85
84
|
};
|
|
86
85
|
};
|
|
87
86
|
};
|
|
88
|
-
var
|
|
89
|
-
if ((0, _expValEquals.expValEquals)('platform_editor_sel_toolbar_scroll_pos_fix_exp', 'isEnabled', true)) {
|
|
90
|
-
// Traverse DOM Tree upwards looking for scroll parents with "overflow: scroll"
|
|
91
|
-
// or fixed/absolute positioned containers.
|
|
92
|
-
var parent = editorView.dom;
|
|
93
|
-
|
|
94
|
-
// Ignored via go/ees005
|
|
95
|
-
// eslint-disable-next-line no-cond-assign
|
|
96
|
-
while (parent = parent.parentElement) {
|
|
97
|
-
var style = window.getComputedStyle(parent);
|
|
98
|
-
|
|
99
|
-
// Check for explicit scroll parent class
|
|
100
|
-
if (parent.classList.contains('fabric-editor-popup-scroll-parent')) {
|
|
101
|
-
return {
|
|
102
|
-
container: parent,
|
|
103
|
-
isFixed: false
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Check for overflow scroll containers
|
|
108
|
-
if (style.overflow === 'scroll' || style.overflowX === 'scroll' || style.overflowY === 'scroll' || style.overflow === 'auto' || style.overflowX === 'auto' || style.overflowY === 'auto') {
|
|
109
|
-
return {
|
|
110
|
-
container: parent,
|
|
111
|
-
isFixed: false
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// Check for fixed or absolute positioned containers (modal wrappers, sidebars)
|
|
116
|
-
if (style.position === 'fixed' || style.position === 'absolute') {
|
|
117
|
-
return {
|
|
118
|
-
container: parent,
|
|
119
|
-
isFixed: style.position === 'fixed'
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Stop at body
|
|
124
|
-
if (parent === document.body) {
|
|
125
|
-
break;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// Fall back to document.body if no suitable container found
|
|
130
|
-
return {
|
|
131
|
-
container: document.body,
|
|
132
|
-
isFixed: false
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// Original logic
|
|
137
|
-
var scrollParent = editorView.dom.closest('.fabric-editor-popup-scroll-parent');
|
|
138
|
-
if (scrollParent) {
|
|
139
|
-
return {
|
|
140
|
-
container: scrollParent,
|
|
141
|
-
isFixed: false
|
|
142
|
-
};
|
|
143
|
-
} else {
|
|
144
|
-
var fixedParent = editorView.dom.parentElement;
|
|
145
|
-
while (fixedParent && fixedParent !== document.body) {
|
|
146
|
-
var computedStyle = window.getComputedStyle(fixedParent);
|
|
147
|
-
if (computedStyle.position === 'fixed') {
|
|
148
|
-
return {
|
|
149
|
-
container: fixedParent,
|
|
150
|
-
isFixed: true
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
fixedParent = fixedParent.parentElement;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// Fall back to document.body if no fixed parent found
|
|
158
|
-
return {
|
|
159
|
-
container: document.body,
|
|
160
|
-
isFixed: false
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
var calculateToolbarPositionTrackHeadOld = exports.calculateToolbarPositionTrackHeadOld = function calculateToolbarPositionTrackHeadOld(toolbarTitle) {
|
|
87
|
+
var calculateToolbarPositionTrackHead = exports.calculateToolbarPositionTrackHead = function calculateToolbarPositionTrackHead(toolbarTitle) {
|
|
164
88
|
return function (editorView, nextPos) {
|
|
165
89
|
var toolbar = document.querySelector("div[aria-label=\"".concat(toolbarTitle, "\"]"));
|
|
166
90
|
if (!toolbar) {
|
|
@@ -230,122 +154,6 @@ var calculateToolbarPositionTrackHeadOld = exports.calculateToolbarPositionTrack
|
|
|
230
154
|
};
|
|
231
155
|
};
|
|
232
156
|
|
|
233
|
-
/**
|
|
234
|
-
* Same logic as calculateToolbarPositionTrackHeadOld, but with the following changes:
|
|
235
|
-
* - Uses a cached container to avoid repeated DOM traversal and getComputedStyle calls
|
|
236
|
-
* - Works when editor is nested within a fixed positioned parent, such as within a modal or sidebar
|
|
237
|
-
*/
|
|
238
|
-
var calculateToolbarPositionTrackHeadNew = exports.calculateToolbarPositionTrackHeadNew = function calculateToolbarPositionTrackHeadNew(toolbarTitle) {
|
|
239
|
-
// Cache the container to avoid repeated DOM traversal and getComputedStyle calls
|
|
240
|
-
var cachedContainer = null;
|
|
241
|
-
var isFixedContainer = false;
|
|
242
|
-
var cachedEditorDom = null;
|
|
243
|
-
return function (editorView, nextPos) {
|
|
244
|
-
var toolbar = document.querySelector("div[aria-label=\"".concat(toolbarTitle, "\"]"));
|
|
245
|
-
if (!toolbar) {
|
|
246
|
-
return nextPos;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
// Find and cache the container (only recalculates if editor DOM changed)
|
|
250
|
-
if (cachedEditorDom !== editorView.dom) {
|
|
251
|
-
cachedEditorDom = editorView.dom;
|
|
252
|
-
var _findContainingElemen = findContainingElement(editorView),
|
|
253
|
-
_container = _findContainingElemen.container,
|
|
254
|
-
isFixed = _findContainingElemen.isFixed;
|
|
255
|
-
cachedContainer = _container;
|
|
256
|
-
isFixedContainer = isFixed;
|
|
257
|
-
}
|
|
258
|
-
if (!cachedContainer) {
|
|
259
|
-
return nextPos;
|
|
260
|
-
}
|
|
261
|
-
var container = cachedContainer;
|
|
262
|
-
var containerBounds = container.getBoundingClientRect();
|
|
263
|
-
var selection = window && window.getSelection();
|
|
264
|
-
var moreRovoOptionsButton = document.querySelector('button[aria-label="More Rovo options"], [aria-label="More Rovo options"]');
|
|
265
|
-
var isMoreRovoOptionsButtonVisible = !!moreRovoOptionsButton && moreRovoOptionsButton instanceof HTMLElement && !!moreRovoOptionsButton.offsetParent;
|
|
266
|
-
var range = null;
|
|
267
|
-
if (isMoreRovoOptionsButtonVisible) {
|
|
268
|
-
if (selection && selection.getRangeAt && selection.rangeCount > 0) {
|
|
269
|
-
var maybeRange = selection.getRangeAt(0);
|
|
270
|
-
if (maybeRange instanceof Range) {
|
|
271
|
-
range = maybeRange;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
} else {
|
|
275
|
-
if (selection && !selection.isCollapsed && selection.getRangeAt && selection.rangeCount > 0) {
|
|
276
|
-
var _maybeRange2 = selection.getRangeAt(0);
|
|
277
|
-
if (_maybeRange2 instanceof Range) {
|
|
278
|
-
range = _maybeRange2;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
if (!range) {
|
|
283
|
-
return nextPos;
|
|
284
|
-
}
|
|
285
|
-
var toolbarRect = toolbar.getBoundingClientRect();
|
|
286
|
-
var _editorView$state$sel3 = editorView.state.selection,
|
|
287
|
-
head = _editorView$state$sel3.head,
|
|
288
|
-
anchor = _editorView$state$sel3.anchor;
|
|
289
|
-
var top;
|
|
290
|
-
var left;
|
|
291
|
-
var topCoords = editorView.coordsAtPos(Math.min(head, anchor));
|
|
292
|
-
var bottomCoords = editorView.coordsAtPos(Math.max(head, anchor) - Math.min(range.endOffset, 1));
|
|
293
|
-
// If not the same line AND we are selecting downwards, display toolbar below.
|
|
294
|
-
if (head > anchor && topCoords.top !== bottomCoords.top) {
|
|
295
|
-
// We are taking the previous pos to the maxium, so avoid end of line positions
|
|
296
|
-
// returning the next line's rect.
|
|
297
|
-
top = (bottomCoords.top || 0) + toolbarRect.height / 1.15;
|
|
298
|
-
} else {
|
|
299
|
-
top = (topCoords.top || 0) - toolbarRect.height * 1.5;
|
|
300
|
-
}
|
|
301
|
-
left = (head > anchor ? bottomCoords.right : topCoords.left) - toolbarRect.width / 2;
|
|
302
|
-
|
|
303
|
-
// Place toolbar below selection if not sufficient space above
|
|
304
|
-
if (top < containerBounds.top) {
|
|
305
|
-
var _getCoordsBelowSelect3 = getCoordsBelowSelection(bottomCoords, toolbarRect);
|
|
306
|
-
top = _getCoordsBelowSelect3.top;
|
|
307
|
-
left = _getCoordsBelowSelect3.left;
|
|
308
|
-
}
|
|
309
|
-
var leftCoord = Math.max(0, left - containerBounds.left);
|
|
310
|
-
if (leftCoord + toolbarRect.width > containerBounds.width) {
|
|
311
|
-
var _scrollbarWidth2 = MAXIMUM_BROWSER_SCROLLBAR_WIDTH;
|
|
312
|
-
leftCoord = Math.max(0, containerBounds.width - (toolbarRect.width + _scrollbarWidth2));
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
// Apply scroll offset only for non-fixed containers
|
|
316
|
-
// Fixed positioned elements don't scroll with the page
|
|
317
|
-
var scrollOffset = isFixedContainer ? 0 : container.scrollTop;
|
|
318
|
-
return {
|
|
319
|
-
top: top - containerBounds.top + scrollOffset,
|
|
320
|
-
left: leftCoord
|
|
321
|
-
};
|
|
322
|
-
};
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
/*
|
|
326
|
-
Calculates the position of the floating toolbar relative to the selection.
|
|
327
|
-
This implementation works in multiple scenarios:
|
|
328
|
-
- Standard scrollable containers with .fabric-editor-popup-scroll-parent
|
|
329
|
-
- Fixed positioned parent containers
|
|
330
|
-
- Falls back to document.body
|
|
331
|
-
|
|
332
|
-
The function automatically detects the container type and applies the appropriate
|
|
333
|
-
positioning logic and scroll offset handling.
|
|
334
|
-
|
|
335
|
-
Things to consider:
|
|
336
|
-
- stick as close to the head X release coordinates as possible
|
|
337
|
-
- coordinates of head X and getBoundingClientRect() are absolute in client viewport
|
|
338
|
-
- popup may appear in '.fabric-editor-popup-scroll-parent', fixed parent, or body
|
|
339
|
-
- we use the toolbarRect to center align toolbar
|
|
340
|
-
- use container bounds to clamp values
|
|
341
|
-
- for fixed positioning, no scroll offsets are applied
|
|
342
|
-
- for scrollable containers, scroll offsets are included
|
|
343
|
-
*/
|
|
344
|
-
var calculateToolbarPositionTrackHead = exports.calculateToolbarPositionTrackHead = function calculateToolbarPositionTrackHead(toolbarTitle) {
|
|
345
|
-
var isSelToolbarFixEnabled = (0, _expValEquals.expValEquals)('platform_editor_sel_toolbar_fix', 'isEnabled', true);
|
|
346
|
-
return isSelToolbarFixEnabled ? calculateToolbarPositionTrackHeadNew(toolbarTitle) : calculateToolbarPositionTrackHeadOld(toolbarTitle);
|
|
347
|
-
};
|
|
348
|
-
|
|
349
157
|
/**
|
|
350
158
|
* Returns the coordintes at the bottom the selection.
|
|
351
159
|
*/
|
|
@@ -249,7 +249,7 @@ export const aiMessages = defineMessages({
|
|
|
249
249
|
// Block menu messages
|
|
250
250
|
blockMenuNestedMenuTitle: {
|
|
251
251
|
id: 'fabric.editor.ai.config.item.blockMenuNestedMenu.title',
|
|
252
|
-
defaultMessage: '
|
|
252
|
+
defaultMessage: 'View more actions',
|
|
253
253
|
description: 'Title for the nested menu in the block menu'
|
|
254
254
|
}
|
|
255
255
|
});
|
|
@@ -442,6 +442,7 @@ export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
|
|
|
442
442
|
ACTION_SUBJECT_ID["FORMAT_CODE"] = "code";
|
|
443
443
|
ACTION_SUBJECT_ID["FORMAT_COLOR"] = "color";
|
|
444
444
|
ACTION_SUBJECT_ID["FORMAT_HEADING"] = "heading";
|
|
445
|
+
ACTION_SUBJECT_ID["FORMAT_SMALL_TEXT"] = "smallText";
|
|
445
446
|
ACTION_SUBJECT_ID["FORMAT_INDENT"] = "indentation";
|
|
446
447
|
ACTION_SUBJECT_ID["FORMAT_ITALIC"] = "italic";
|
|
447
448
|
ACTION_SUBJECT_ID["FORMAT_LIST_BULLET"] = "bulletedList";
|
|
@@ -27,6 +27,7 @@ export { messages as dateMessages } from './date';
|
|
|
27
27
|
export { toolbarMessages as layoutMessages } from './layout';
|
|
28
28
|
export { messages as indentationMessages } from './indentation';
|
|
29
29
|
export { avatarGroupMessages } from './avatar-group';
|
|
30
|
+
export { smartLinkChangeboardMessages } from './smart-link-changeboard';
|
|
30
31
|
export { findReplaceMessages } from './find-replace';
|
|
31
32
|
export { elementInsertSidePanel } from './element-insert-side-panel';
|
|
32
33
|
export { textColorMessages } from './text-color';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export const smartLinkChangeboardMessages = defineMessages({
|
|
3
|
+
headline: {
|
|
4
|
+
id: 'platform.editor.smartlink.changeboard.headline',
|
|
5
|
+
defaultMessage: 'Drag and drop links',
|
|
6
|
+
description: 'Headline for the smart link drag and drop changeboarding popup'
|
|
7
|
+
},
|
|
8
|
+
gifAlt: {
|
|
9
|
+
id: 'platform.editor.smartlink.changeboard.gif.alt',
|
|
10
|
+
defaultMessage: 'Drag smart link into sidebar demonstration',
|
|
11
|
+
description: 'Alt text for the changeboarding GIF'
|
|
12
|
+
},
|
|
13
|
+
description: {
|
|
14
|
+
id: 'platform.editor.smartlink.changeboard.description',
|
|
15
|
+
defaultMessage: 'Keep your important links organized and easy to find by dragging Smart Links into the content tree.',
|
|
16
|
+
description: 'Description text for the changeboarding popup'
|
|
17
|
+
},
|
|
18
|
+
dismiss: {
|
|
19
|
+
id: 'platform.editor.smartlink.changeboard.dismiss',
|
|
20
|
+
defaultMessage: 'Done',
|
|
21
|
+
description: 'Label for the dismiss button in the changeboarding popup'
|
|
22
|
+
}
|
|
23
|
+
});
|
|
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
|
|
|
4
4
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
5
5
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
6
6
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
7
|
-
const packageVersion = "112.4.
|
|
7
|
+
const packageVersion = "112.4.4";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -227,9 +227,13 @@ export default class ReactNodeView {
|
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
229
|
get dom() {
|
|
230
|
+
// Only return reference if domRef is defined
|
|
231
|
+
if (this.domRef === undefined) {
|
|
232
|
+
//raise an error
|
|
233
|
+
throw new Error('domRef is not defined or may have been destroyed');
|
|
234
|
+
}
|
|
235
|
+
|
|
230
236
|
// Spreading props to pass through dynamic component props
|
|
231
|
-
// Ignored via go/ees005
|
|
232
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
233
237
|
return this.domRef;
|
|
234
238
|
}
|
|
235
239
|
destroy() {
|
|
@@ -40,6 +40,7 @@ export const editorUGCTokensRefreshed = {
|
|
|
40
40
|
'editor.font.heading.h5': 'normal 600 0.857143em/1.33333 "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
|
|
41
41
|
'editor.font.heading.h6': 'normal 600 0.785714em/1.45455 "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
|
|
42
42
|
'editor.font.body': 'normal 400 1em/1.714 "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
|
|
43
|
+
'editor.font.body.small': 'normal 400 0.875em/1.714 "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
|
|
43
44
|
'editor.font.weight.heading.h1.bold': '700',
|
|
44
45
|
'editor.font.weight.heading.h2.bold': '700',
|
|
45
46
|
'editor.font.weight.heading.h3.bold': '700',
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "112.4.
|
|
17
|
+
const packageVersion = "112.4.4";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -60,10 +60,10 @@ export default function overflowShadow(Component, options) {
|
|
|
60
60
|
}
|
|
61
61
|
let width = 0;
|
|
62
62
|
for (let i = 0; i < this.scrollable.length; i++) {
|
|
63
|
-
// Ignored via go/ees005
|
|
64
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
65
63
|
const scrollableElement = this.scrollable[i];
|
|
66
|
-
|
|
64
|
+
if (isElementNode(scrollableElement)) {
|
|
65
|
+
width += scrollableElement.scrollWidth;
|
|
66
|
+
}
|
|
67
67
|
}
|
|
68
68
|
return width;
|
|
69
69
|
});
|
|
@@ -72,9 +72,6 @@ export default function overflowShadow(Component, options) {
|
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
74
|
this.container = container;
|
|
75
|
-
|
|
76
|
-
// Ignored via go/ees005
|
|
77
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
78
75
|
this.overflowContainer = container.querySelector(options.overflowSelector);
|
|
79
76
|
if (!this.overflowContainer) {
|
|
80
77
|
this.overflowContainer = container;
|
|
@@ -152,4 +149,9 @@ export default function overflowShadow(Component, options) {
|
|
|
152
149
|
}, this.props));
|
|
153
150
|
}
|
|
154
151
|
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Helper function to check if the passed node is of Element class
|
|
155
|
+
function isElementNode(node) {
|
|
156
|
+
return node.nodeType === 1;
|
|
155
157
|
}
|
|
@@ -229,7 +229,7 @@ export function calculatePosition({
|
|
|
229
229
|
minPopupMargin
|
|
230
230
|
}) {
|
|
231
231
|
let position = {};
|
|
232
|
-
if (!target || !popup || !popup.offsetParent) {
|
|
232
|
+
if (!target || !popup || !popup.offsetParent || !isHTMLElementNode(popup.offsetParent)) {
|
|
233
233
|
return position;
|
|
234
234
|
}
|
|
235
235
|
if (isTextNode(target)) {
|
|
@@ -237,9 +237,6 @@ export function calculatePosition({
|
|
|
237
237
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
238
238
|
target = target.parentElement;
|
|
239
239
|
}
|
|
240
|
-
|
|
241
|
-
// Ignored via go/ees005
|
|
242
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
243
240
|
const popupOffsetParent = popup.offsetParent;
|
|
244
241
|
const offsetParentStyle = popupOffsetParent.style;
|
|
245
242
|
let borderBottomWidth = 0;
|
|
@@ -354,4 +351,14 @@ export function findOverflowScrollParent(popup) {
|
|
|
354
351
|
}
|
|
355
352
|
}
|
|
356
353
|
return false;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// Helper function to check if the passed node is of Element class
|
|
357
|
+
function isElementNode(node) {
|
|
358
|
+
return node.nodeType === 1;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// Helper function to check if the passed node is of HTMLElement class
|
|
362
|
+
function isHTMLElementNode(node) {
|
|
363
|
+
return isElementNode(node) && node.namespaceURI === 'http://www.w3.org/1999/xhtml';
|
|
357
364
|
}
|