@atlaskit/editor-common 128.0.1 → 128.1.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 +21 -0
- package/dist/cjs/messages/syncBlock.js +5 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/quick-insert/CompactQuickInsertMenuItem.js +6 -2
- package/dist/cjs/quick-insert/QuickInsertHoverPreview.js +26 -7
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/messages/syncBlock.js +5 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/quick-insert/CompactQuickInsertMenuItem.js +6 -2
- package/dist/es2019/quick-insert/QuickInsertHoverPreview.js +28 -7
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/messages/syncBlock.js +5 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/quick-insert/CompactQuickInsertMenuItem.js +6 -2
- package/dist/esm/quick-insert/QuickInsertHoverPreview.js +26 -7
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/messages/syncBlock.d.ts +5 -0
- package/dist/types/quick-insert/QuickInsertContext.d.ts +3 -0
- package/dist/types/quick-insert/QuickInsertHoverPreview.d.ts +2 -1
- package/dist/types/types/feature-flags.d.ts +10 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 128.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`a5e4fa298e7ad`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a5e4fa298e7ad) -
|
|
8
|
+
[EDITOR-8408] Add the syncedLocationDropdownRestrictedContent message for synced locations the
|
|
9
|
+
viewer cannot access.
|
|
10
|
+
- [`b31a1d76b3076`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b31a1d76b3076) -
|
|
11
|
+
Restore the optional `FeatureFlags.lcmPreventRenderTracking` field to preserve the legacy content
|
|
12
|
+
macro opt-out when the `platform_editor_enable_rerender_tracking` experiment enables tracking.
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`2f527121e0516`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2f527121e0516) -
|
|
17
|
+
Require deliberate pointer or keyboard activation before displaying registered slash-command
|
|
18
|
+
previews under `platform_editor_slash_command`. Avoid redundant menu renders when the pointer
|
|
19
|
+
moves within the active preview row.
|
|
20
|
+
- [`2f527121e0516`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2f527121e0516) -
|
|
21
|
+
Keep active slash-command previews positioned with custom popup hosts such as Whiteboards.
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 128.0.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -426,6 +426,11 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntl.defineMessage
|
|
|
426
426
|
defaultMessage: 'Request access',
|
|
427
427
|
description: 'Label shown in the synced location dropdown option when the sync block is not accessible to the user'
|
|
428
428
|
},
|
|
429
|
+
syncedLocationDropdownRestrictedContent: {
|
|
430
|
+
id: 'fabric.editor.syncedLocationDropdownRestrictedContent',
|
|
431
|
+
defaultMessage: 'Restricted content',
|
|
432
|
+
description: 'Title shown in the synced location dropdown in place of a page or work item the user does not have permission to view'
|
|
433
|
+
},
|
|
429
434
|
syncedLocationDropdownUntitledPage: {
|
|
430
435
|
id: 'fabric.editor.syncedLocationDropdownUntitledPage',
|
|
431
436
|
defaultMessage: 'Untitled',
|
|
@@ -27,7 +27,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
27
27
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
28
28
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
29
29
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
30
|
-
var packageVersion = "128.0.
|
|
30
|
+
var packageVersion = "128.0.1";
|
|
31
31
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
32
32
|
// Remove URL as it has UGC
|
|
33
33
|
// Ignored via go/ees007
|
|
@@ -93,12 +93,15 @@ var CompactQuickInsertMenuItem = exports.CompactQuickInsertMenuItem = function C
|
|
|
93
93
|
shouldWrapIcon = _ref$shouldWrapIcon === void 0 ? true : _ref$shouldWrapIcon,
|
|
94
94
|
title = _ref.title;
|
|
95
95
|
var _useQuickInsertContex = (0, _useQuickInsertContext.useQuickInsertContext)(),
|
|
96
|
-
item = _useQuickInsertContex.item
|
|
96
|
+
item = _useQuickInsertContex.item,
|
|
97
|
+
popupsMountPoint = _useQuickInsertContex.popupsMountPoint;
|
|
97
98
|
var _ref2 = item !== null && item !== void 0 ? item : {
|
|
98
99
|
id: undefined,
|
|
100
|
+
isPreviewActive: undefined,
|
|
99
101
|
isSelected: false
|
|
100
102
|
},
|
|
101
103
|
id = _ref2.id,
|
|
104
|
+
isPreviewActive = _ref2.isPreviewActive,
|
|
102
105
|
isSelected = _ref2.isSelected;
|
|
103
106
|
var resolvedDescription = description !== null && description !== void 0 ? description : item === null || item === void 0 ? void 0 : item.description;
|
|
104
107
|
var previewId = (0, _react.useId)();
|
|
@@ -112,7 +115,7 @@ var CompactQuickInsertMenuItem = exports.CompactQuickInsertMenuItem = function C
|
|
|
112
115
|
image: previewImageUrls
|
|
113
116
|
} : {};
|
|
114
117
|
}, [preview, previewImageUrls]);
|
|
115
|
-
var shouldRenderPreview = shouldShowPreview && isSelected && !isDisabled;
|
|
118
|
+
var shouldRenderPreview = shouldShowPreview && (isPreviewActive !== null && isPreviewActive !== void 0 ? isPreviewActive : isSelected) && !isDisabled;
|
|
116
119
|
var hasAccessiblePreview = Boolean(resolvedDescription || (resolvedPreview === null || resolvedPreview === void 0 ? void 0 : resolvedPreview.attribution));
|
|
117
120
|
var previewAttributionName = (_resolvedPreview$attr = resolvedPreview.attribution) === null || _resolvedPreview$attr === void 0 ? void 0 : _resolvedPreview$attr.name;
|
|
118
121
|
var previewAttributionKey = typeof previewAttributionName === 'string' ? previewAttributionName : previewAttributionName === null || previewAttributionName === void 0 ? void 0 : previewAttributionName.id;
|
|
@@ -143,6 +146,7 @@ var CompactQuickInsertMenuItem = exports.CompactQuickInsertMenuItem = function C
|
|
|
143
146
|
id: previewId,
|
|
144
147
|
description: resolvedDescription,
|
|
145
148
|
preview: resolvedPreview,
|
|
149
|
+
popupsMountPoint: popupsMountPoint,
|
|
146
150
|
referenceElement: referenceElement,
|
|
147
151
|
title: title
|
|
148
152
|
}));
|
|
@@ -13,6 +13,7 @@ var React = _react;
|
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
15
|
var _reactDom = require("react-dom");
|
|
16
|
+
var _bindEventListener = require("bind-event-listener");
|
|
16
17
|
var _reactIntl = require("react-intl");
|
|
17
18
|
var _reactPopper = require("@atlaskit/popper/react-popper");
|
|
18
19
|
var _text = require("@atlaskit/primitives/compiled/text");
|
|
@@ -63,16 +64,18 @@ var QuickInsertHoverPreview = exports.QuickInsertHoverPreview = function QuickIn
|
|
|
63
64
|
var description = _ref.description,
|
|
64
65
|
id = _ref.id,
|
|
65
66
|
preview = _ref.preview,
|
|
67
|
+
popupsMountPoint = _ref.popupsMountPoint,
|
|
66
68
|
referenceElement = _ref.referenceElement,
|
|
67
69
|
title = _ref.title;
|
|
68
70
|
var _useThemeObserver = (0, _useThemeObserver2.useThemeObserver)(),
|
|
69
71
|
colorMode = _useThemeObserver.colorMode;
|
|
70
72
|
var imageUrl = preview.image ? colorMode === 'dark' && preview.image.dark ? preview.image.dark : preview.image.light : undefined;
|
|
71
73
|
var hasAccessibleContent = Boolean(description || preview.attribution);
|
|
74
|
+
var portalTarget = popupsMountPoint !== null && popupsMountPoint !== void 0 ? popupsMountPoint : referenceElement.ownerDocument.body;
|
|
72
75
|
return /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/React.createElement(_reactPopper.Popper, {
|
|
73
76
|
placement: "right-start",
|
|
74
77
|
referenceElement: referenceElement,
|
|
75
|
-
strategy:
|
|
78
|
+
strategy: popupsMountPoint ? 'absolute' : 'fixed',
|
|
76
79
|
modifiers: PREVIEW_MODIFIERS
|
|
77
80
|
}, function (_ref2) {
|
|
78
81
|
var ref = _ref2.ref,
|
|
@@ -87,11 +90,12 @@ var QuickInsertHoverPreview = exports.QuickInsertHoverPreview = function QuickIn
|
|
|
87
90
|
id: hasAccessibleContent ? id : undefined,
|
|
88
91
|
imageUrl: imageUrl,
|
|
89
92
|
preview: preview,
|
|
93
|
+
popupsMountPoint: popupsMountPoint,
|
|
90
94
|
referenceElement: referenceElement,
|
|
91
95
|
title: title,
|
|
92
96
|
update: update
|
|
93
97
|
}));
|
|
94
|
-
}),
|
|
98
|
+
}), portalTarget);
|
|
95
99
|
};
|
|
96
100
|
var QuickInsertPreviewPanel = function QuickInsertPreviewPanel(_ref3) {
|
|
97
101
|
var _preview$attribution, _preview$attribution2;
|
|
@@ -99,6 +103,7 @@ var QuickInsertPreviewPanel = function QuickInsertPreviewPanel(_ref3) {
|
|
|
99
103
|
id = _ref3.id,
|
|
100
104
|
imageUrl = _ref3.imageUrl,
|
|
101
105
|
preview = _ref3.preview,
|
|
106
|
+
popupsMountPoint = _ref3.popupsMountPoint,
|
|
102
107
|
referenceElement = _ref3.referenceElement,
|
|
103
108
|
title = _ref3.title,
|
|
104
109
|
update = _ref3.update;
|
|
@@ -112,20 +117,34 @@ var QuickInsertPreviewPanel = function QuickInsertPreviewPanel(_ref3) {
|
|
|
112
117
|
var attributionName = (_preview$attribution2 = preview.attribution) === null || _preview$attribution2 === void 0 ? void 0 : _preview$attribution2.name;
|
|
113
118
|
var formattedAttributionName = typeof attributionName === 'string' ? attributionName : attributionName ? formatMessage(attributionName) : '';
|
|
114
119
|
(0, _react.useLayoutEffect)(function () {
|
|
115
|
-
var
|
|
120
|
+
var _ownerDocument$defaul;
|
|
116
121
|
void update();
|
|
117
|
-
var
|
|
122
|
+
var ownerDocument = referenceElement.ownerDocument;
|
|
123
|
+
var onScroll = function onScroll() {
|
|
124
|
+
return void update();
|
|
125
|
+
};
|
|
126
|
+
var unbindScrollListener = (0, _bindEventListener.bind)(ownerDocument, {
|
|
127
|
+
type: 'scroll',
|
|
128
|
+
listener: onScroll,
|
|
129
|
+
options: true
|
|
130
|
+
});
|
|
131
|
+
var ResizeObserverConstructor = (_ownerDocument$defaul = ownerDocument.defaultView) === null || _ownerDocument$defaul === void 0 ? void 0 : _ownerDocument$defaul.ResizeObserver;
|
|
118
132
|
if (!panelElement || !ResizeObserverConstructor) {
|
|
119
|
-
return;
|
|
133
|
+
return unbindScrollListener;
|
|
120
134
|
}
|
|
121
135
|
var observer = new ResizeObserverConstructor(function () {
|
|
122
136
|
return void update();
|
|
123
137
|
});
|
|
124
138
|
observer.observe(panelElement);
|
|
139
|
+
observer.observe(referenceElement);
|
|
140
|
+
if (popupsMountPoint) {
|
|
141
|
+
observer.observe(popupsMountPoint);
|
|
142
|
+
}
|
|
125
143
|
return function () {
|
|
126
|
-
|
|
144
|
+
unbindScrollListener();
|
|
145
|
+
observer.disconnect();
|
|
127
146
|
};
|
|
128
|
-
}, [panelElement, referenceElement, update]);
|
|
147
|
+
}, [panelElement, popupsMountPoint, referenceElement, update]);
|
|
129
148
|
return /*#__PURE__*/React.createElement("div", {
|
|
130
149
|
ref: setPanelElement,
|
|
131
150
|
id: id,
|
|
@@ -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 = "128.0.
|
|
27
|
+
var packageVersion = "128.0.1";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -420,6 +420,11 @@ export const syncBlockMessages = defineMessages({
|
|
|
420
420
|
defaultMessage: 'Request access',
|
|
421
421
|
description: 'Label shown in the synced location dropdown option when the sync block is not accessible to the user'
|
|
422
422
|
},
|
|
423
|
+
syncedLocationDropdownRestrictedContent: {
|
|
424
|
+
id: 'fabric.editor.syncedLocationDropdownRestrictedContent',
|
|
425
|
+
defaultMessage: 'Restricted content',
|
|
426
|
+
description: 'Title shown in the synced location dropdown in place of a page or work item the user does not have permission to view'
|
|
427
|
+
},
|
|
423
428
|
syncedLocationDropdownUntitledPage: {
|
|
424
429
|
id: 'fabric.editor.syncedLocationDropdownUntitledPage',
|
|
425
430
|
defaultMessage: 'Untitled',
|
|
@@ -13,7 +13,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
13
13
|
const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
14
14
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
15
15
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
16
|
-
const packageVersion = "128.0.
|
|
16
|
+
const packageVersion = "128.0.1";
|
|
17
17
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
18
18
|
// Remove URL as it has UGC
|
|
19
19
|
// Ignored via go/ees007
|
|
@@ -82,13 +82,16 @@ export const CompactQuickInsertMenuItem = ({
|
|
|
82
82
|
}) => {
|
|
83
83
|
var _resolvedPreview$attr, _ref, _resolvedPreview$imag, _resolvedPreview$imag2;
|
|
84
84
|
const {
|
|
85
|
-
item
|
|
85
|
+
item,
|
|
86
|
+
popupsMountPoint
|
|
86
87
|
} = useQuickInsertContext();
|
|
87
88
|
const {
|
|
88
89
|
id,
|
|
90
|
+
isPreviewActive,
|
|
89
91
|
isSelected
|
|
90
92
|
} = item !== null && item !== void 0 ? item : {
|
|
91
93
|
id: undefined,
|
|
94
|
+
isPreviewActive: undefined,
|
|
92
95
|
isSelected: false
|
|
93
96
|
};
|
|
94
97
|
const resolvedDescription = description !== null && description !== void 0 ? description : item === null || item === void 0 ? void 0 : item.description;
|
|
@@ -98,7 +101,7 @@ export const CompactQuickInsertMenuItem = ({
|
|
|
98
101
|
const resolvedPreview = useMemo(() => preview !== null && preview !== void 0 ? preview : previewImageUrls ? {
|
|
99
102
|
image: previewImageUrls
|
|
100
103
|
} : {}, [preview, previewImageUrls]);
|
|
101
|
-
const shouldRenderPreview = shouldShowPreview && isSelected && !isDisabled;
|
|
104
|
+
const shouldRenderPreview = shouldShowPreview && (isPreviewActive !== null && isPreviewActive !== void 0 ? isPreviewActive : isSelected) && !isDisabled;
|
|
102
105
|
const hasAccessiblePreview = Boolean(resolvedDescription || (resolvedPreview === null || resolvedPreview === void 0 ? void 0 : resolvedPreview.attribution));
|
|
103
106
|
const previewAttributionName = (_resolvedPreview$attr = resolvedPreview.attribution) === null || _resolvedPreview$attr === void 0 ? void 0 : _resolvedPreview$attr.name;
|
|
104
107
|
const previewAttributionKey = typeof previewAttributionName === 'string' ? previewAttributionName : previewAttributionName === null || previewAttributionName === void 0 ? void 0 : previewAttributionName.id;
|
|
@@ -129,6 +132,7 @@ export const CompactQuickInsertMenuItem = ({
|
|
|
129
132
|
id: previewId,
|
|
130
133
|
description: resolvedDescription,
|
|
131
134
|
preview: resolvedPreview,
|
|
135
|
+
popupsMountPoint: popupsMountPoint,
|
|
132
136
|
referenceElement: referenceElement,
|
|
133
137
|
title: title
|
|
134
138
|
}));
|
|
@@ -7,6 +7,7 @@ import { createPortal } from 'react-dom';
|
|
|
7
7
|
|
|
8
8
|
// Viewport calculations and multiline clamping require styles outside @atlaskit/css's schema.
|
|
9
9
|
|
|
10
|
+
import { bind } from 'bind-event-listener';
|
|
10
11
|
import { useIntl } from 'react-intl';
|
|
11
12
|
|
|
12
13
|
// Viewport clamping requires modifiers, which the top-layer adapter does not support.
|
|
@@ -56,6 +57,7 @@ export const QuickInsertHoverPreview = ({
|
|
|
56
57
|
description,
|
|
57
58
|
id,
|
|
58
59
|
preview,
|
|
60
|
+
popupsMountPoint,
|
|
59
61
|
referenceElement,
|
|
60
62
|
title
|
|
61
63
|
}) => {
|
|
@@ -64,10 +66,11 @@ export const QuickInsertHoverPreview = ({
|
|
|
64
66
|
} = useThemeObserver();
|
|
65
67
|
const imageUrl = preview.image ? colorMode === 'dark' && preview.image.dark ? preview.image.dark : preview.image.light : undefined;
|
|
66
68
|
const hasAccessibleContent = Boolean(description || preview.attribution);
|
|
69
|
+
const portalTarget = popupsMountPoint !== null && popupsMountPoint !== void 0 ? popupsMountPoint : referenceElement.ownerDocument.body;
|
|
67
70
|
return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(Popper, {
|
|
68
71
|
placement: "right-start",
|
|
69
72
|
referenceElement: referenceElement,
|
|
70
|
-
strategy:
|
|
73
|
+
strategy: popupsMountPoint ? 'absolute' : 'fixed',
|
|
71
74
|
modifiers: PREVIEW_MODIFIERS
|
|
72
75
|
}, ({
|
|
73
76
|
ref,
|
|
@@ -82,16 +85,18 @@ export const QuickInsertHoverPreview = ({
|
|
|
82
85
|
id: hasAccessibleContent ? id : undefined,
|
|
83
86
|
imageUrl: imageUrl,
|
|
84
87
|
preview: preview,
|
|
88
|
+
popupsMountPoint: popupsMountPoint,
|
|
85
89
|
referenceElement: referenceElement,
|
|
86
90
|
title: title,
|
|
87
91
|
update: update
|
|
88
|
-
}))),
|
|
92
|
+
}))), portalTarget);
|
|
89
93
|
};
|
|
90
94
|
const QuickInsertPreviewPanel = ({
|
|
91
95
|
description,
|
|
92
96
|
id,
|
|
93
97
|
imageUrl,
|
|
94
98
|
preview,
|
|
99
|
+
popupsMountPoint,
|
|
95
100
|
referenceElement,
|
|
96
101
|
title,
|
|
97
102
|
update
|
|
@@ -105,16 +110,32 @@ const QuickInsertPreviewPanel = ({
|
|
|
105
110
|
const attributionName = (_preview$attribution2 = preview.attribution) === null || _preview$attribution2 === void 0 ? void 0 : _preview$attribution2.name;
|
|
106
111
|
const formattedAttributionName = typeof attributionName === 'string' ? attributionName : attributionName ? formatMessage(attributionName) : '';
|
|
107
112
|
useLayoutEffect(() => {
|
|
108
|
-
var
|
|
113
|
+
var _ownerDocument$defaul;
|
|
109
114
|
void update();
|
|
110
|
-
const
|
|
115
|
+
const {
|
|
116
|
+
ownerDocument
|
|
117
|
+
} = referenceElement;
|
|
118
|
+
const onScroll = () => void update();
|
|
119
|
+
const unbindScrollListener = bind(ownerDocument, {
|
|
120
|
+
type: 'scroll',
|
|
121
|
+
listener: onScroll,
|
|
122
|
+
options: true
|
|
123
|
+
});
|
|
124
|
+
const ResizeObserverConstructor = (_ownerDocument$defaul = ownerDocument.defaultView) === null || _ownerDocument$defaul === void 0 ? void 0 : _ownerDocument$defaul.ResizeObserver;
|
|
111
125
|
if (!panelElement || !ResizeObserverConstructor) {
|
|
112
|
-
return;
|
|
126
|
+
return unbindScrollListener;
|
|
113
127
|
}
|
|
114
128
|
const observer = new ResizeObserverConstructor(() => void update());
|
|
115
129
|
observer.observe(panelElement);
|
|
116
|
-
|
|
117
|
-
|
|
130
|
+
observer.observe(referenceElement);
|
|
131
|
+
if (popupsMountPoint) {
|
|
132
|
+
observer.observe(popupsMountPoint);
|
|
133
|
+
}
|
|
134
|
+
return () => {
|
|
135
|
+
unbindScrollListener();
|
|
136
|
+
observer.disconnect();
|
|
137
|
+
};
|
|
138
|
+
}, [panelElement, popupsMountPoint, referenceElement, update]);
|
|
118
139
|
return /*#__PURE__*/React.createElement("div", {
|
|
119
140
|
ref: setPanelElement,
|
|
120
141
|
id: id,
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "128.0.
|
|
17
|
+
const packageVersion = "128.0.1";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -420,6 +420,11 @@ export var syncBlockMessages = defineMessages({
|
|
|
420
420
|
defaultMessage: 'Request access',
|
|
421
421
|
description: 'Label shown in the synced location dropdown option when the sync block is not accessible to the user'
|
|
422
422
|
},
|
|
423
|
+
syncedLocationDropdownRestrictedContent: {
|
|
424
|
+
id: 'fabric.editor.syncedLocationDropdownRestrictedContent',
|
|
425
|
+
defaultMessage: 'Restricted content',
|
|
426
|
+
description: 'Title shown in the synced location dropdown in place of a page or work item the user does not have permission to view'
|
|
427
|
+
},
|
|
423
428
|
syncedLocationDropdownUntitledPage: {
|
|
424
429
|
id: 'fabric.editor.syncedLocationDropdownUntitledPage',
|
|
425
430
|
defaultMessage: 'Untitled',
|
|
@@ -19,7 +19,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
19
19
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
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 = "128.0.
|
|
22
|
+
var packageVersion = "128.0.1";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -84,12 +84,15 @@ export var CompactQuickInsertMenuItem = function CompactQuickInsertMenuItem(_ref
|
|
|
84
84
|
shouldWrapIcon = _ref$shouldWrapIcon === void 0 ? true : _ref$shouldWrapIcon,
|
|
85
85
|
title = _ref.title;
|
|
86
86
|
var _useQuickInsertContex = useQuickInsertContext(),
|
|
87
|
-
item = _useQuickInsertContex.item
|
|
87
|
+
item = _useQuickInsertContex.item,
|
|
88
|
+
popupsMountPoint = _useQuickInsertContex.popupsMountPoint;
|
|
88
89
|
var _ref2 = item !== null && item !== void 0 ? item : {
|
|
89
90
|
id: undefined,
|
|
91
|
+
isPreviewActive: undefined,
|
|
90
92
|
isSelected: false
|
|
91
93
|
},
|
|
92
94
|
id = _ref2.id,
|
|
95
|
+
isPreviewActive = _ref2.isPreviewActive,
|
|
93
96
|
isSelected = _ref2.isSelected;
|
|
94
97
|
var resolvedDescription = description !== null && description !== void 0 ? description : item === null || item === void 0 ? void 0 : item.description;
|
|
95
98
|
var previewId = useId();
|
|
@@ -103,7 +106,7 @@ export var CompactQuickInsertMenuItem = function CompactQuickInsertMenuItem(_ref
|
|
|
103
106
|
image: previewImageUrls
|
|
104
107
|
} : {};
|
|
105
108
|
}, [preview, previewImageUrls]);
|
|
106
|
-
var shouldRenderPreview = shouldShowPreview && isSelected && !isDisabled;
|
|
109
|
+
var shouldRenderPreview = shouldShowPreview && (isPreviewActive !== null && isPreviewActive !== void 0 ? isPreviewActive : isSelected) && !isDisabled;
|
|
107
110
|
var hasAccessiblePreview = Boolean(resolvedDescription || (resolvedPreview === null || resolvedPreview === void 0 ? void 0 : resolvedPreview.attribution));
|
|
108
111
|
var previewAttributionName = (_resolvedPreview$attr = resolvedPreview.attribution) === null || _resolvedPreview$attr === void 0 ? void 0 : _resolvedPreview$attr.name;
|
|
109
112
|
var previewAttributionKey = typeof previewAttributionName === 'string' ? previewAttributionName : previewAttributionName === null || previewAttributionName === void 0 ? void 0 : previewAttributionName.id;
|
|
@@ -134,6 +137,7 @@ export var CompactQuickInsertMenuItem = function CompactQuickInsertMenuItem(_ref
|
|
|
134
137
|
id: previewId,
|
|
135
138
|
description: resolvedDescription,
|
|
136
139
|
preview: resolvedPreview,
|
|
140
|
+
popupsMountPoint: popupsMountPoint,
|
|
137
141
|
referenceElement: referenceElement,
|
|
138
142
|
title: title
|
|
139
143
|
}));
|
|
@@ -8,6 +8,7 @@ import { createPortal } from 'react-dom';
|
|
|
8
8
|
|
|
9
9
|
// Viewport calculations and multiline clamping require styles outside @atlaskit/css's schema.
|
|
10
10
|
|
|
11
|
+
import { bind } from 'bind-event-listener';
|
|
11
12
|
import { useIntl } from 'react-intl';
|
|
12
13
|
|
|
13
14
|
// Viewport clamping requires modifiers, which the top-layer adapter does not support.
|
|
@@ -57,16 +58,18 @@ export var QuickInsertHoverPreview = function QuickInsertHoverPreview(_ref) {
|
|
|
57
58
|
var description = _ref.description,
|
|
58
59
|
id = _ref.id,
|
|
59
60
|
preview = _ref.preview,
|
|
61
|
+
popupsMountPoint = _ref.popupsMountPoint,
|
|
60
62
|
referenceElement = _ref.referenceElement,
|
|
61
63
|
title = _ref.title;
|
|
62
64
|
var _useThemeObserver = useThemeObserver(),
|
|
63
65
|
colorMode = _useThemeObserver.colorMode;
|
|
64
66
|
var imageUrl = preview.image ? colorMode === 'dark' && preview.image.dark ? preview.image.dark : preview.image.light : undefined;
|
|
65
67
|
var hasAccessibleContent = Boolean(description || preview.attribution);
|
|
68
|
+
var portalTarget = popupsMountPoint !== null && popupsMountPoint !== void 0 ? popupsMountPoint : referenceElement.ownerDocument.body;
|
|
66
69
|
return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(Popper, {
|
|
67
70
|
placement: "right-start",
|
|
68
71
|
referenceElement: referenceElement,
|
|
69
|
-
strategy:
|
|
72
|
+
strategy: popupsMountPoint ? 'absolute' : 'fixed',
|
|
70
73
|
modifiers: PREVIEW_MODIFIERS
|
|
71
74
|
}, function (_ref2) {
|
|
72
75
|
var ref = _ref2.ref,
|
|
@@ -81,11 +84,12 @@ export var QuickInsertHoverPreview = function QuickInsertHoverPreview(_ref) {
|
|
|
81
84
|
id: hasAccessibleContent ? id : undefined,
|
|
82
85
|
imageUrl: imageUrl,
|
|
83
86
|
preview: preview,
|
|
87
|
+
popupsMountPoint: popupsMountPoint,
|
|
84
88
|
referenceElement: referenceElement,
|
|
85
89
|
title: title,
|
|
86
90
|
update: update
|
|
87
91
|
}));
|
|
88
|
-
}),
|
|
92
|
+
}), portalTarget);
|
|
89
93
|
};
|
|
90
94
|
var QuickInsertPreviewPanel = function QuickInsertPreviewPanel(_ref3) {
|
|
91
95
|
var _preview$attribution, _preview$attribution2;
|
|
@@ -93,6 +97,7 @@ var QuickInsertPreviewPanel = function QuickInsertPreviewPanel(_ref3) {
|
|
|
93
97
|
id = _ref3.id,
|
|
94
98
|
imageUrl = _ref3.imageUrl,
|
|
95
99
|
preview = _ref3.preview,
|
|
100
|
+
popupsMountPoint = _ref3.popupsMountPoint,
|
|
96
101
|
referenceElement = _ref3.referenceElement,
|
|
97
102
|
title = _ref3.title,
|
|
98
103
|
update = _ref3.update;
|
|
@@ -106,20 +111,34 @@ var QuickInsertPreviewPanel = function QuickInsertPreviewPanel(_ref3) {
|
|
|
106
111
|
var attributionName = (_preview$attribution2 = preview.attribution) === null || _preview$attribution2 === void 0 ? void 0 : _preview$attribution2.name;
|
|
107
112
|
var formattedAttributionName = typeof attributionName === 'string' ? attributionName : attributionName ? formatMessage(attributionName) : '';
|
|
108
113
|
useLayoutEffect(function () {
|
|
109
|
-
var
|
|
114
|
+
var _ownerDocument$defaul;
|
|
110
115
|
void update();
|
|
111
|
-
var
|
|
116
|
+
var ownerDocument = referenceElement.ownerDocument;
|
|
117
|
+
var onScroll = function onScroll() {
|
|
118
|
+
return void update();
|
|
119
|
+
};
|
|
120
|
+
var unbindScrollListener = bind(ownerDocument, {
|
|
121
|
+
type: 'scroll',
|
|
122
|
+
listener: onScroll,
|
|
123
|
+
options: true
|
|
124
|
+
});
|
|
125
|
+
var ResizeObserverConstructor = (_ownerDocument$defaul = ownerDocument.defaultView) === null || _ownerDocument$defaul === void 0 ? void 0 : _ownerDocument$defaul.ResizeObserver;
|
|
112
126
|
if (!panelElement || !ResizeObserverConstructor) {
|
|
113
|
-
return;
|
|
127
|
+
return unbindScrollListener;
|
|
114
128
|
}
|
|
115
129
|
var observer = new ResizeObserverConstructor(function () {
|
|
116
130
|
return void update();
|
|
117
131
|
});
|
|
118
132
|
observer.observe(panelElement);
|
|
133
|
+
observer.observe(referenceElement);
|
|
134
|
+
if (popupsMountPoint) {
|
|
135
|
+
observer.observe(popupsMountPoint);
|
|
136
|
+
}
|
|
119
137
|
return function () {
|
|
120
|
-
|
|
138
|
+
unbindScrollListener();
|
|
139
|
+
observer.disconnect();
|
|
121
140
|
};
|
|
122
|
-
}, [panelElement, referenceElement, update]);
|
|
141
|
+
}, [panelElement, popupsMountPoint, referenceElement, update]);
|
|
123
142
|
return /*#__PURE__*/React.createElement("div", {
|
|
124
143
|
ref: setPanelElement,
|
|
125
144
|
id: id,
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "128.0.
|
|
24
|
+
var packageVersion = "128.0.1";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -434,6 +434,11 @@ export declare const syncBlockMessages: {
|
|
|
434
434
|
description: string;
|
|
435
435
|
id: string;
|
|
436
436
|
};
|
|
437
|
+
syncedLocationDropdownRestrictedContent: {
|
|
438
|
+
defaultMessage: string;
|
|
439
|
+
description: string;
|
|
440
|
+
id: string;
|
|
441
|
+
};
|
|
437
442
|
syncedLocationDropdownSamePage: {
|
|
438
443
|
defaultMessage: string;
|
|
439
444
|
description: string;
|
|
@@ -9,14 +9,17 @@ export type QuickInsertSelectionHandler = (context: {
|
|
|
9
9
|
source: INPUT_METHOD.ELEMENT_BROWSER | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR;
|
|
10
10
|
}) => Transaction | false | void;
|
|
11
11
|
export type QuickInsertContextValue = {
|
|
12
|
+
activePreviewItemKey?: string;
|
|
12
13
|
editorView: EditorView;
|
|
13
14
|
isOffline: boolean;
|
|
14
15
|
item?: {
|
|
15
16
|
description?: string;
|
|
16
17
|
id: string;
|
|
18
|
+
isPreviewActive?: boolean;
|
|
17
19
|
isSelected: boolean;
|
|
18
20
|
};
|
|
19
21
|
menuOpenId?: symbol;
|
|
22
|
+
popupsMountPoint?: HTMLElement;
|
|
20
23
|
select: (selectionHandler: QuickInsertSelectionHandler) => void;
|
|
21
24
|
surface: 'typeahead' | 'toolbar' | 'element-browser';
|
|
22
25
|
surfaceContext?: SurfaceContext;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { QuickInsertPreview } from './preview';
|
|
2
2
|
/** The selected item's description and attribution are announced through its aria-describedby. */
|
|
3
|
-
export declare const QuickInsertHoverPreview: ({ description, id, preview, referenceElement, title, }: {
|
|
3
|
+
export declare const QuickInsertHoverPreview: ({ description, id, preview, popupsMountPoint, referenceElement, title, }: {
|
|
4
4
|
description?: string;
|
|
5
5
|
id: string;
|
|
6
6
|
preview: QuickInsertPreview;
|
|
7
|
+
popupsMountPoint?: HTMLElement;
|
|
7
8
|
referenceElement: HTMLElement;
|
|
8
9
|
title: string;
|
|
9
10
|
}) => React.JSX.Element;
|
|
@@ -125,6 +125,16 @@ export type FeatureFlags = {
|
|
|
125
125
|
* @default false
|
|
126
126
|
*/
|
|
127
127
|
extensionLocalIdGeneration?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* @description
|
|
130
|
+
* Used by the legacy content macro to disable render tracking due to excessive logs.
|
|
131
|
+
* Will be removed once re-rendering issue is resolved.
|
|
132
|
+
* Note: This is hardcoded into the LCM code, it does not exist in Switcheroo.
|
|
133
|
+
*
|
|
134
|
+
* @see https://product-fabric.atlassian.net/browse/ED-26650
|
|
135
|
+
* @default false
|
|
136
|
+
*/
|
|
137
|
+
lcmPreventRenderTracking?: boolean;
|
|
128
138
|
/**
|
|
129
139
|
* @description
|
|
130
140
|
* Use the linking platform link picker for link insertion and edit
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "128.0
|
|
3
|
+
"version": "128.1.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/"
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"@atlaskit/task-decision": "^21.11.0",
|
|
86
86
|
"@atlaskit/teams-app-config": "^3.1.0",
|
|
87
87
|
"@atlaskit/textfield": "^10.2.0",
|
|
88
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
88
|
+
"@atlaskit/tmp-editor-statsig": "^221.0.0",
|
|
89
89
|
"@atlaskit/tokens": "^20.1.0",
|
|
90
90
|
"@atlaskit/tooltip": "^24.4.0",
|
|
91
91
|
"@atlaskit/width-detector": "^7.2.0",
|