@atlaskit/editor-common 111.16.6 → 111.17.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 +18 -0
- package/dist/cjs/analytics/types/enums.js +1 -0
- package/dist/cjs/extensions/module-helpers.js +3 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Popup/utils.js +2 -3
- package/dist/cjs/utils/calculate-toolbar-position.js +51 -4
- package/dist/es2019/analytics/types/enums.js +1 -0
- package/dist/es2019/extensions/module-helpers.js +3 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Popup/utils.js +2 -3
- package/dist/es2019/utils/calculate-toolbar-position.js +51 -4
- package/dist/esm/analytics/types/enums.js +1 -0
- package/dist/esm/extensions/module-helpers.js +3 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Popup/utils.js +2 -3
- package/dist/esm/utils/calculate-toolbar-position.js +51 -4
- package/dist/types/analytics/types/enums.d.ts +1 -0
- package/dist/types/extensions/types/extension-manifest.d.ts +2 -1
- package/dist/types/extensions/types/utils.d.ts +3 -1
- package/dist/types-ts4.5/analytics/types/enums.d.ts +1 -0
- package/dist/types-ts4.5/extensions/types/extension-manifest.d.ts +2 -1
- package/dist/types-ts4.5/extensions/types/utils.d.ts +3 -1
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 111.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`46a2d3f1807fb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/46a2d3f1807fb) -
|
|
8
|
+
Remove feature gate for block menu drag handle offset
|
|
9
|
+
- [`dfe1c3b4007f4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dfe1c3b4007f4) -
|
|
10
|
+
[ux] Adding the ability to provide a Lozenge to Quick Insert Menu Items.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`48b6616a3fefc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/48b6616a3fefc) -
|
|
15
|
+
Add new logic to detect scrollable containers when calculating position for selection toolbar.
|
|
16
|
+
This fixes issues when used inside modals and other surfaces.
|
|
17
|
+
- [`8d553b883996b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8d553b883996b) -
|
|
18
|
+
Add block menu transform experience tracking
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 111.16.6
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -409,6 +409,7 @@ var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTIO
|
|
|
409
409
|
ACTION_SUBJECT_ID["DELETE_BLOCK"] = "deleteBlock";
|
|
410
410
|
ACTION_SUBJECT_ID["MOVE_UP_BLOCK"] = "moveUpBlock";
|
|
411
411
|
ACTION_SUBJECT_ID["MOVE_DOWN_BLOCK"] = "moveDownBlock";
|
|
412
|
+
ACTION_SUBJECT_ID["TRANSFORM_BLOCK"] = "transformBlock";
|
|
412
413
|
ACTION_SUBJECT_ID["FORMAT_MENU"] = "formatMenu";
|
|
413
414
|
ACTION_SUBJECT_ID["CREATE_INLINE_COMMENT_FROM_HIGHLIGHT_ACTIONS_MENU"] = "createInlineCommentFromHighlightActionsMenu";
|
|
414
415
|
ACTION_SUBJECT_ID["DATE"] = "date";
|
|
@@ -38,7 +38,7 @@ function buildMenuItem(manifest, extensionModule) {
|
|
|
38
38
|
if (!node) {
|
|
39
39
|
throw new Error("Couldn't find any action for ".concat(title, " (").concat(key, ")"));
|
|
40
40
|
}
|
|
41
|
-
return _objectSpread(_objectSpread({
|
|
41
|
+
return _objectSpread(_objectSpread(_objectSpread({
|
|
42
42
|
key: key,
|
|
43
43
|
title: title,
|
|
44
44
|
extensionType: manifest.type,
|
|
@@ -51,6 +51,8 @@ function buildMenuItem(manifest, extensionModule) {
|
|
|
51
51
|
documentationUrl: manifest.documentationUrl
|
|
52
52
|
}, ((0, _platformFeatureFlags.fg)('cc_fd_wb_create_priority_in_slash_menu_enabled') || (0, _platformFeatureFlags.fg)('rovo_chat_enable_skills_ui_m1')) && {
|
|
53
53
|
priority: extensionModule.priority
|
|
54
|
+
}), extensionModule.lozenge != null && {
|
|
55
|
+
lozenge: extensionModule.lozenge
|
|
54
56
|
}), {}, {
|
|
55
57
|
icon: extensionModule.icon || manifest.icons['48'],
|
|
56
58
|
node: node
|
|
@@ -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 = "111.16.
|
|
22
|
+
var packageVersion = "111.16.6";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -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 = "111.16.
|
|
27
|
+
var packageVersion = "111.16.6";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -14,7 +14,6 @@ exports.isTextNode = isTextNode;
|
|
|
14
14
|
exports.validatePosition = validatePosition;
|
|
15
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
17
|
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; }
|
|
19
18
|
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
19
|
function isBody(elem) {
|
|
@@ -263,8 +262,8 @@ function calculatePosition(_ref5) {
|
|
|
263
262
|
|
|
264
263
|
// Calculate scrollbar dimensions to adjust positions
|
|
265
264
|
// clientWidth/Height excludes scrollbars, offsetWidth/Height includes them
|
|
266
|
-
var scrollbarWidth =
|
|
267
|
-
var scrollbarHeight =
|
|
265
|
+
var scrollbarWidth = popupOffsetParent.offsetWidth - popupOffsetParent.clientWidth;
|
|
266
|
+
var scrollbarHeight = popupOffsetParent.offsetHeight - popupOffsetParent.clientHeight;
|
|
268
267
|
var _target$getBoundingCl3 = target.getBoundingClientRect(),
|
|
269
268
|
targetTop = _target$getBoundingCl3.top,
|
|
270
269
|
targetLeft = _target$getBoundingCl3.left,
|
|
@@ -86,7 +86,54 @@ var calculateToolbarPositionAboveSelection = exports.calculateToolbarPositionAbo
|
|
|
86
86
|
};
|
|
87
87
|
};
|
|
88
88
|
var findContainingElement = function findContainingElement(editorView) {
|
|
89
|
-
|
|
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
|
|
90
137
|
var scrollParent = editorView.dom.closest('.fabric-editor-popup-scroll-parent');
|
|
91
138
|
if (scrollParent) {
|
|
92
139
|
return {
|
|
@@ -94,7 +141,6 @@ var findContainingElement = function findContainingElement(editorView) {
|
|
|
94
141
|
isFixed: false
|
|
95
142
|
};
|
|
96
143
|
} else {
|
|
97
|
-
// If no scroll parent, look for a fixed positioned parent
|
|
98
144
|
var fixedParent = editorView.dom.parentElement;
|
|
99
145
|
while (fixedParent && fixedParent !== document.body) {
|
|
100
146
|
var computedStyle = window.getComputedStyle(fixedParent);
|
|
@@ -240,9 +286,10 @@ var calculateToolbarPositionTrackHeadNew = exports.calculateToolbarPositionTrack
|
|
|
240
286
|
var _editorView$state$sel3 = editorView.state.selection,
|
|
241
287
|
head = _editorView$state$sel3.head,
|
|
242
288
|
anchor = _editorView$state$sel3.anchor;
|
|
289
|
+
var top;
|
|
290
|
+
var left;
|
|
243
291
|
var topCoords = editorView.coordsAtPos(Math.min(head, anchor));
|
|
244
292
|
var bottomCoords = editorView.coordsAtPos(Math.max(head, anchor) - Math.min(range.endOffset, 1));
|
|
245
|
-
var top;
|
|
246
293
|
// If not the same line AND we are selecting downwards, display toolbar below.
|
|
247
294
|
if (head > anchor && topCoords.top !== bottomCoords.top) {
|
|
248
295
|
// We are taking the previous pos to the maxium, so avoid end of line positions
|
|
@@ -251,7 +298,7 @@ var calculateToolbarPositionTrackHeadNew = exports.calculateToolbarPositionTrack
|
|
|
251
298
|
} else {
|
|
252
299
|
top = (topCoords.top || 0) - toolbarRect.height * 1.5;
|
|
253
300
|
}
|
|
254
|
-
|
|
301
|
+
left = (head > anchor ? bottomCoords.right : topCoords.left) - toolbarRect.width / 2;
|
|
255
302
|
|
|
256
303
|
// Place toolbar below selection if not sufficient space above
|
|
257
304
|
if (top < containerBounds.top) {
|
|
@@ -403,6 +403,7 @@ export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
|
|
|
403
403
|
ACTION_SUBJECT_ID["DELETE_BLOCK"] = "deleteBlock";
|
|
404
404
|
ACTION_SUBJECT_ID["MOVE_UP_BLOCK"] = "moveUpBlock";
|
|
405
405
|
ACTION_SUBJECT_ID["MOVE_DOWN_BLOCK"] = "moveDownBlock";
|
|
406
|
+
ACTION_SUBJECT_ID["TRANSFORM_BLOCK"] = "transformBlock";
|
|
406
407
|
ACTION_SUBJECT_ID["FORMAT_MENU"] = "formatMenu";
|
|
407
408
|
ACTION_SUBJECT_ID["CREATE_INLINE_COMMENT_FROM_HIGHLIGHT_ACTIONS_MENU"] = "createInlineCommentFromHighlightActionsMenu";
|
|
408
409
|
ACTION_SUBJECT_ID["DATE"] = "date";
|
|
@@ -28,6 +28,9 @@ export function buildMenuItem(manifest, extensionModule) {
|
|
|
28
28
|
...((fg('cc_fd_wb_create_priority_in_slash_menu_enabled') || fg('rovo_chat_enable_skills_ui_m1')) && {
|
|
29
29
|
priority: extensionModule.priority
|
|
30
30
|
}),
|
|
31
|
+
...(extensionModule.lozenge != null && {
|
|
32
|
+
lozenge: extensionModule.lozenge
|
|
33
|
+
}),
|
|
31
34
|
icon: extensionModule.icon || manifest.icons['48'],
|
|
32
35
|
node
|
|
33
36
|
};
|
|
@@ -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 = "111.16.
|
|
7
|
+
const packageVersion = "111.16.6";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -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 = "111.16.
|
|
17
|
+
const packageVersion = "111.16.6";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
1
|
export function isBody(elem) {
|
|
3
2
|
return elem === document.body;
|
|
4
3
|
}
|
|
@@ -257,8 +256,8 @@ export function calculatePosition({
|
|
|
257
256
|
|
|
258
257
|
// Calculate scrollbar dimensions to adjust positions
|
|
259
258
|
// clientWidth/Height excludes scrollbars, offsetWidth/Height includes them
|
|
260
|
-
const scrollbarWidth =
|
|
261
|
-
const scrollbarHeight =
|
|
259
|
+
const scrollbarWidth = popupOffsetParent.offsetWidth - popupOffsetParent.clientWidth;
|
|
260
|
+
const scrollbarHeight = popupOffsetParent.offsetHeight - popupOffsetParent.clientHeight;
|
|
262
261
|
const {
|
|
263
262
|
top: targetTop,
|
|
264
263
|
left: targetLeft,
|
|
@@ -80,7 +80,54 @@ export const calculateToolbarPositionAboveSelection = toolbarTitle => (editorVie
|
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
82
|
const findContainingElement = editorView => {
|
|
83
|
-
|
|
83
|
+
if (expValEquals('platform_editor_sel_toolbar_scroll_pos_fix_exp', 'isEnabled', true)) {
|
|
84
|
+
// Traverse DOM Tree upwards looking for scroll parents with "overflow: scroll"
|
|
85
|
+
// or fixed/absolute positioned containers.
|
|
86
|
+
let parent = editorView.dom;
|
|
87
|
+
|
|
88
|
+
// Ignored via go/ees005
|
|
89
|
+
// eslint-disable-next-line no-cond-assign
|
|
90
|
+
while (parent = parent.parentElement) {
|
|
91
|
+
const style = window.getComputedStyle(parent);
|
|
92
|
+
|
|
93
|
+
// Check for explicit scroll parent class
|
|
94
|
+
if (parent.classList.contains('fabric-editor-popup-scroll-parent')) {
|
|
95
|
+
return {
|
|
96
|
+
container: parent,
|
|
97
|
+
isFixed: false
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Check for overflow scroll containers
|
|
102
|
+
if (style.overflow === 'scroll' || style.overflowX === 'scroll' || style.overflowY === 'scroll' || style.overflow === 'auto' || style.overflowX === 'auto' || style.overflowY === 'auto') {
|
|
103
|
+
return {
|
|
104
|
+
container: parent,
|
|
105
|
+
isFixed: false
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Check for fixed or absolute positioned containers (modal wrappers, sidebars)
|
|
110
|
+
if (style.position === 'fixed' || style.position === 'absolute') {
|
|
111
|
+
return {
|
|
112
|
+
container: parent,
|
|
113
|
+
isFixed: style.position === 'fixed'
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Stop at body
|
|
118
|
+
if (parent === document.body) {
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Fall back to document.body if no suitable container found
|
|
124
|
+
return {
|
|
125
|
+
container: document.body,
|
|
126
|
+
isFixed: false
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Original logic
|
|
84
131
|
const scrollParent = editorView.dom.closest('.fabric-editor-popup-scroll-parent');
|
|
85
132
|
if (scrollParent) {
|
|
86
133
|
return {
|
|
@@ -88,7 +135,6 @@ const findContainingElement = editorView => {
|
|
|
88
135
|
isFixed: false
|
|
89
136
|
};
|
|
90
137
|
} else {
|
|
91
|
-
// If no scroll parent, look for a fixed positioned parent
|
|
92
138
|
let fixedParent = editorView.dom.parentElement;
|
|
93
139
|
while (fixedParent && fixedParent !== document.body) {
|
|
94
140
|
const computedStyle = window.getComputedStyle(fixedParent);
|
|
@@ -236,9 +282,10 @@ export const calculateToolbarPositionTrackHeadNew = toolbarTitle => {
|
|
|
236
282
|
head,
|
|
237
283
|
anchor
|
|
238
284
|
} = editorView.state.selection;
|
|
285
|
+
let top;
|
|
286
|
+
let left;
|
|
239
287
|
const topCoords = editorView.coordsAtPos(Math.min(head, anchor));
|
|
240
288
|
const bottomCoords = editorView.coordsAtPos(Math.max(head, anchor) - Math.min(range.endOffset, 1));
|
|
241
|
-
let top;
|
|
242
289
|
// If not the same line AND we are selecting downwards, display toolbar below.
|
|
243
290
|
if (head > anchor && topCoords.top !== bottomCoords.top) {
|
|
244
291
|
// We are taking the previous pos to the maxium, so avoid end of line positions
|
|
@@ -247,7 +294,7 @@ export const calculateToolbarPositionTrackHeadNew = toolbarTitle => {
|
|
|
247
294
|
} else {
|
|
248
295
|
top = (topCoords.top || 0) - toolbarRect.height * 1.5;
|
|
249
296
|
}
|
|
250
|
-
|
|
297
|
+
left = (head > anchor ? bottomCoords.right : topCoords.left) - toolbarRect.width / 2;
|
|
251
298
|
|
|
252
299
|
// Place toolbar below selection if not sufficient space above
|
|
253
300
|
if (top < containerBounds.top) {
|
|
@@ -403,6 +403,7 @@ export var ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
|
|
|
403
403
|
ACTION_SUBJECT_ID["DELETE_BLOCK"] = "deleteBlock";
|
|
404
404
|
ACTION_SUBJECT_ID["MOVE_UP_BLOCK"] = "moveUpBlock";
|
|
405
405
|
ACTION_SUBJECT_ID["MOVE_DOWN_BLOCK"] = "moveDownBlock";
|
|
406
|
+
ACTION_SUBJECT_ID["TRANSFORM_BLOCK"] = "transformBlock";
|
|
406
407
|
ACTION_SUBJECT_ID["FORMAT_MENU"] = "formatMenu";
|
|
407
408
|
ACTION_SUBJECT_ID["CREATE_INLINE_COMMENT_FROM_HIGHLIGHT_ACTIONS_MENU"] = "createInlineCommentFromHighlightActionsMenu";
|
|
408
409
|
ACTION_SUBJECT_ID["DATE"] = "date";
|
|
@@ -26,7 +26,7 @@ export function buildMenuItem(manifest, extensionModule) {
|
|
|
26
26
|
if (!node) {
|
|
27
27
|
throw new Error("Couldn't find any action for ".concat(title, " (").concat(key, ")"));
|
|
28
28
|
}
|
|
29
|
-
return _objectSpread(_objectSpread({
|
|
29
|
+
return _objectSpread(_objectSpread(_objectSpread({
|
|
30
30
|
key: key,
|
|
31
31
|
title: title,
|
|
32
32
|
extensionType: manifest.type,
|
|
@@ -39,6 +39,8 @@ export function buildMenuItem(manifest, extensionModule) {
|
|
|
39
39
|
documentationUrl: manifest.documentationUrl
|
|
40
40
|
}, (fg('cc_fd_wb_create_priority_in_slash_menu_enabled') || fg('rovo_chat_enable_skills_ui_m1')) && {
|
|
41
41
|
priority: extensionModule.priority
|
|
42
|
+
}), extensionModule.lozenge != null && {
|
|
43
|
+
lozenge: extensionModule.lozenge
|
|
42
44
|
}), {}, {
|
|
43
45
|
icon: extensionModule.icon || manifest.icons['48'],
|
|
44
46
|
node: node
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "111.16.
|
|
13
|
+
var packageVersion = "111.16.6";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "111.16.
|
|
24
|
+
var packageVersion = "111.16.6";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -2,7 +2,6 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
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
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; }
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
export function isBody(elem) {
|
|
7
6
|
return elem === document.body;
|
|
8
7
|
}
|
|
@@ -249,8 +248,8 @@ export function calculatePosition(_ref5) {
|
|
|
249
248
|
|
|
250
249
|
// Calculate scrollbar dimensions to adjust positions
|
|
251
250
|
// clientWidth/Height excludes scrollbars, offsetWidth/Height includes them
|
|
252
|
-
var scrollbarWidth =
|
|
253
|
-
var scrollbarHeight =
|
|
251
|
+
var scrollbarWidth = popupOffsetParent.offsetWidth - popupOffsetParent.clientWidth;
|
|
252
|
+
var scrollbarHeight = popupOffsetParent.offsetHeight - popupOffsetParent.clientHeight;
|
|
254
253
|
var _target$getBoundingCl3 = target.getBoundingClientRect(),
|
|
255
254
|
targetTop = _target$getBoundingCl3.top,
|
|
256
255
|
targetLeft = _target$getBoundingCl3.left,
|
|
@@ -80,7 +80,54 @@ export var calculateToolbarPositionAboveSelection = function calculateToolbarPos
|
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
82
|
var findContainingElement = function findContainingElement(editorView) {
|
|
83
|
-
|
|
83
|
+
if (expValEquals('platform_editor_sel_toolbar_scroll_pos_fix_exp', 'isEnabled', true)) {
|
|
84
|
+
// Traverse DOM Tree upwards looking for scroll parents with "overflow: scroll"
|
|
85
|
+
// or fixed/absolute positioned containers.
|
|
86
|
+
var parent = editorView.dom;
|
|
87
|
+
|
|
88
|
+
// Ignored via go/ees005
|
|
89
|
+
// eslint-disable-next-line no-cond-assign
|
|
90
|
+
while (parent = parent.parentElement) {
|
|
91
|
+
var style = window.getComputedStyle(parent);
|
|
92
|
+
|
|
93
|
+
// Check for explicit scroll parent class
|
|
94
|
+
if (parent.classList.contains('fabric-editor-popup-scroll-parent')) {
|
|
95
|
+
return {
|
|
96
|
+
container: parent,
|
|
97
|
+
isFixed: false
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Check for overflow scroll containers
|
|
102
|
+
if (style.overflow === 'scroll' || style.overflowX === 'scroll' || style.overflowY === 'scroll' || style.overflow === 'auto' || style.overflowX === 'auto' || style.overflowY === 'auto') {
|
|
103
|
+
return {
|
|
104
|
+
container: parent,
|
|
105
|
+
isFixed: false
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Check for fixed or absolute positioned containers (modal wrappers, sidebars)
|
|
110
|
+
if (style.position === 'fixed' || style.position === 'absolute') {
|
|
111
|
+
return {
|
|
112
|
+
container: parent,
|
|
113
|
+
isFixed: style.position === 'fixed'
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Stop at body
|
|
118
|
+
if (parent === document.body) {
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Fall back to document.body if no suitable container found
|
|
124
|
+
return {
|
|
125
|
+
container: document.body,
|
|
126
|
+
isFixed: false
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Original logic
|
|
84
131
|
var scrollParent = editorView.dom.closest('.fabric-editor-popup-scroll-parent');
|
|
85
132
|
if (scrollParent) {
|
|
86
133
|
return {
|
|
@@ -88,7 +135,6 @@ var findContainingElement = function findContainingElement(editorView) {
|
|
|
88
135
|
isFixed: false
|
|
89
136
|
};
|
|
90
137
|
} else {
|
|
91
|
-
// If no scroll parent, look for a fixed positioned parent
|
|
92
138
|
var fixedParent = editorView.dom.parentElement;
|
|
93
139
|
while (fixedParent && fixedParent !== document.body) {
|
|
94
140
|
var computedStyle = window.getComputedStyle(fixedParent);
|
|
@@ -234,9 +280,10 @@ export var calculateToolbarPositionTrackHeadNew = function calculateToolbarPosit
|
|
|
234
280
|
var _editorView$state$sel3 = editorView.state.selection,
|
|
235
281
|
head = _editorView$state$sel3.head,
|
|
236
282
|
anchor = _editorView$state$sel3.anchor;
|
|
283
|
+
var top;
|
|
284
|
+
var left;
|
|
237
285
|
var topCoords = editorView.coordsAtPos(Math.min(head, anchor));
|
|
238
286
|
var bottomCoords = editorView.coordsAtPos(Math.max(head, anchor) - Math.min(range.endOffset, 1));
|
|
239
|
-
var top;
|
|
240
287
|
// If not the same line AND we are selecting downwards, display toolbar below.
|
|
241
288
|
if (head > anchor && topCoords.top !== bottomCoords.top) {
|
|
242
289
|
// We are taking the previous pos to the maxium, so avoid end of line positions
|
|
@@ -245,7 +292,7 @@ export var calculateToolbarPositionTrackHeadNew = function calculateToolbarPosit
|
|
|
245
292
|
} else {
|
|
246
293
|
top = (topCoords.top || 0) - toolbarRect.height * 1.5;
|
|
247
294
|
}
|
|
248
|
-
|
|
295
|
+
left = (head > anchor ? bottomCoords.right : topCoords.left) - toolbarRect.width / 2;
|
|
249
296
|
|
|
250
297
|
// Place toolbar below selection if not sufficient space above
|
|
251
298
|
if (top < containerBounds.top) {
|
|
@@ -395,6 +395,7 @@ export declare enum ACTION_SUBJECT_ID {
|
|
|
395
395
|
DELETE_BLOCK = "deleteBlock",
|
|
396
396
|
MOVE_UP_BLOCK = "moveUpBlock",
|
|
397
397
|
MOVE_DOWN_BLOCK = "moveDownBlock",
|
|
398
|
+
TRANSFORM_BLOCK = "transformBlock",
|
|
398
399
|
FORMAT_MENU = "formatMenu",
|
|
399
400
|
CREATE_INLINE_COMMENT_FROM_HIGHLIGHT_ACTIONS_MENU = "createInlineCommentFromHighlightActionsMenu",
|
|
400
401
|
DATE = "date",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentType } from 'react';
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
2
|
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
3
3
|
import type { ExtensionAPI, ExtensionParams, MultiBodiedExtensionActions, UpdateExtension } from './extension-handler';
|
|
4
4
|
import type { ExtensionIconModule, MaybeESModule } from './extension-manifest-common';
|
|
@@ -33,6 +33,7 @@ export type ExtensionModule<T extends Parameters = Parameters> = {
|
|
|
33
33
|
icon?: () => ExtensionIconModule;
|
|
34
34
|
key: string;
|
|
35
35
|
keywords?: string[];
|
|
36
|
+
lozenge?: ReactNode;
|
|
36
37
|
parameters?: T;
|
|
37
38
|
priority?: number;
|
|
38
39
|
title?: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
2
3
|
import type { ExtensionKey, ExtensionModuleActionHandler, ExtensionType, Icon } from './extension-manifest';
|
|
3
4
|
export type MenuItem = {
|
|
@@ -10,10 +11,11 @@ export type MenuItem = {
|
|
|
10
11
|
icon: Icon;
|
|
11
12
|
key: string;
|
|
12
13
|
keywords: string[];
|
|
14
|
+
lozenge?: ReactNode;
|
|
13
15
|
node: ADFEntity | ExtensionModuleActionHandler;
|
|
16
|
+
priority?: number;
|
|
14
17
|
summary?: string;
|
|
15
18
|
title: string;
|
|
16
|
-
priority?: number;
|
|
17
19
|
};
|
|
18
20
|
export type MenuItemMap = {
|
|
19
21
|
[key: string]: MenuItem;
|
|
@@ -395,6 +395,7 @@ export declare enum ACTION_SUBJECT_ID {
|
|
|
395
395
|
DELETE_BLOCK = "deleteBlock",
|
|
396
396
|
MOVE_UP_BLOCK = "moveUpBlock",
|
|
397
397
|
MOVE_DOWN_BLOCK = "moveDownBlock",
|
|
398
|
+
TRANSFORM_BLOCK = "transformBlock",
|
|
398
399
|
FORMAT_MENU = "formatMenu",
|
|
399
400
|
CREATE_INLINE_COMMENT_FROM_HIGHLIGHT_ACTIONS_MENU = "createInlineCommentFromHighlightActionsMenu",
|
|
400
401
|
DATE = "date",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentType } from 'react';
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
2
|
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
3
3
|
import type { ExtensionAPI, ExtensionParams, MultiBodiedExtensionActions, UpdateExtension } from './extension-handler';
|
|
4
4
|
import type { ExtensionIconModule, MaybeESModule } from './extension-manifest-common';
|
|
@@ -33,6 +33,7 @@ export type ExtensionModule<T extends Parameters = Parameters> = {
|
|
|
33
33
|
icon?: () => ExtensionIconModule;
|
|
34
34
|
key: string;
|
|
35
35
|
keywords?: string[];
|
|
36
|
+
lozenge?: ReactNode;
|
|
36
37
|
parameters?: T;
|
|
37
38
|
priority?: number;
|
|
38
39
|
title?: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
2
3
|
import type { ExtensionKey, ExtensionModuleActionHandler, ExtensionType, Icon } from './extension-manifest';
|
|
3
4
|
export type MenuItem = {
|
|
@@ -10,10 +11,11 @@ export type MenuItem = {
|
|
|
10
11
|
icon: Icon;
|
|
11
12
|
key: string;
|
|
12
13
|
keywords: string[];
|
|
14
|
+
lozenge?: ReactNode;
|
|
13
15
|
node: ADFEntity | ExtensionModuleActionHandler;
|
|
16
|
+
priority?: number;
|
|
14
17
|
summary?: string;
|
|
15
18
|
title: string;
|
|
16
|
-
priority?: number;
|
|
17
19
|
};
|
|
18
20
|
export type MenuItemMap = {
|
|
19
21
|
[key: string]: MenuItem;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "111.
|
|
3
|
+
"version": "111.17.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/"
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@atlaskit/task-decision": "^19.2.0",
|
|
82
82
|
"@atlaskit/textfield": "^8.2.0",
|
|
83
83
|
"@atlaskit/theme": "^21.0.0",
|
|
84
|
-
"@atlaskit/tmp-editor-statsig": "^29.
|
|
84
|
+
"@atlaskit/tmp-editor-statsig": "^29.1.0",
|
|
85
85
|
"@atlaskit/tokens": "^11.0.0",
|
|
86
86
|
"@atlaskit/tooltip": "^20.14.0",
|
|
87
87
|
"@atlaskit/width-detector": "^5.0.0",
|
|
@@ -186,9 +186,6 @@
|
|
|
186
186
|
"platform_editor_link_popup_position_fix_aifc": {
|
|
187
187
|
"type": "boolean"
|
|
188
188
|
},
|
|
189
|
-
"platform_editor_popup_calc_pos_scrollbar": {
|
|
190
|
-
"type": "boolean"
|
|
191
|
-
},
|
|
192
189
|
"platform_editor_inline_node_virt_threshold_override": {
|
|
193
190
|
"type": "boolean"
|
|
194
191
|
},
|