@atlaskit/editor-common 122.2.1 → 122.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/codemods/117.0.0-upgrade-react-peer-dependencies.ts +3 -16
- package/dist/cjs/copy-button/index.js +2 -5
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/vanilla-tooltip/index.js +38 -10
- package/dist/es2019/copy-button/index.js +2 -5
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/vanilla-tooltip/index.js +32 -7
- package/dist/esm/copy-button/index.js +2 -5
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/vanilla-tooltip/index.js +38 -10
- package/dist/types/vanilla-tooltip/index.d.ts +42 -7
- package/package.json +7 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 122.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0165bd2a039d1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0165bd2a039d1) -
|
|
8
|
+
Clean up feature gate `platform_editor_blocks_patch_9`
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 122.3.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`e909670f087d4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e909670f087d4) -
|
|
16
|
+
Update i18n NPM package versions for editor,editor-extensions,activity-platform,media,elements
|
|
17
|
+
(Group 3)
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [`0265ca1688db1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0265ca1688db1) -
|
|
22
|
+
[EDITOR-8971] `VanillaTooltip` takes an optional container to append its tooltip to, instead of
|
|
23
|
+
appending it inside the trigger. Opt-in per caller, and used by the diff contributor tag; every
|
|
24
|
+
other tooltip is unchanged.
|
|
25
|
+
|
|
26
|
+
Diff contributor tag fixes, all behind `confluence_ncs_step_diffing_version_history`:
|
|
27
|
+
- The tag's full label no longer renders off screen. Its tooltip is hoisted out of the tag, so
|
|
28
|
+
Popper and the browser measure a top-layer popover from the same origin — inside the trigger
|
|
29
|
+
they disagreed whenever an ancestor was transformed, such as a wide image.
|
|
30
|
+
- Stepping to a change reveals only that change's tag, not every tag the active range touches.
|
|
31
|
+
- A contributor no longer gets two tags inside one navigation stop. Two of their changes that
|
|
32
|
+
merely touched each kept a tag, and the trailing one could be hovered but never stepped to; it
|
|
33
|
+
now folds into the leading tag and stays a hover target. Tags for different contributors sharing
|
|
34
|
+
a stop are still kept apart.
|
|
35
|
+
- A tag on deleted content no longer disappears when the document changes. Any change remaps the
|
|
36
|
+
decoration, which rebuilds its widget and fired the teardown — but the deleted-content widget's
|
|
37
|
+
DOM is reused as-is and runs no mount callback, so the tag was faded out of a change that was
|
|
38
|
+
still the active one. The tag is now kept whenever its host is still in a live editor.
|
|
39
|
+
|
|
40
|
+
- Updated dependencies
|
|
41
|
+
|
|
3
42
|
## 122.2.1
|
|
4
43
|
|
|
5
44
|
### Patch Changes
|
|
@@ -6,22 +6,9 @@ const NEW_PEER_DEP_RANGE = '^18.2.0 || ^19.2.0'; // Ensure backwards compatible
|
|
|
6
6
|
const NEW_DEV_DEP_RANGE = '^19.2.0'; // Ensure everyone is using React 19 types from now on
|
|
7
7
|
const VALID_ORIGINAL_RANGES = [NEW_PEER_DEP_RANGE, NEW_DEV_DEP_RANGE, 'root:*', '^18.2.0'];
|
|
8
8
|
|
|
9
|
-
const EXCLUDED_PACKAGE_JSON_PATHS = [
|
|
10
|
-
|
|
11
|
-
'packages/editor/editor-
|
|
12
|
-
'packages/editor/editor-plugin-media-tests/package.json',
|
|
13
|
-
'packages/editor/editor-plugin-ai/package.json',
|
|
14
|
-
'packages/editor/editor-common-tests/package.json',
|
|
15
|
-
'packages/editor/editor-core/package.json',
|
|
16
|
-
'packages/editor/editor-plugin-ai-tests/package.json',
|
|
17
|
-
'packages/editor/editor-plugin-extension-tests/package.json',
|
|
18
|
-
'packages/editor/editor-plugin-synced-block-tests/package.json',
|
|
19
|
-
'packages/editor/generative-ai-modal/package.json',
|
|
20
|
-
'packages/editor/editor-plugin-show-diff-tests/package.json',
|
|
21
|
-
'packages/editor/editor-plugin-table-tests/package.json',
|
|
22
|
-
'packages/editor/editor-plugin-quick-insert-tests/package.json',
|
|
23
|
-
'packages/editor/editor-referentiality/package.json',
|
|
24
|
-
'packages/editor/editor-synced-block-renderer-tests/package.json',
|
|
9
|
+
const EXCLUDED_PACKAGE_JSON_PATHS: string[] = [
|
|
10
|
+
// Example - this will exclude editor-core from upgrade
|
|
11
|
+
// 'packages/editor/editor-core/package.json',
|
|
25
12
|
];
|
|
26
13
|
|
|
27
14
|
type DependencyName = 'react' | 'react-dom' | '@types/react' | '@types/react-dom';
|
|
@@ -9,7 +9,6 @@ exports.toDOM = void 0;
|
|
|
9
9
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
10
10
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
11
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
12
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
13
12
|
var _clipboard = require("../clipboard");
|
|
14
13
|
var _browser = require("../utils/browser");
|
|
15
14
|
function getSelectedNodeOrNodeParentByNodeType(_ref) {
|
|
@@ -57,10 +56,8 @@ var copyDomNodeWithResult = exports.copyDomNodeWithResult = function copyDomNode
|
|
|
57
56
|
var isSyncedBlock = nodeType.name === 'syncBlock' || nodeType.name === 'bodiedSyncBlock';
|
|
58
57
|
if (browser.safari && isSyncedBlock) {
|
|
59
58
|
// clipboard-polyfill/native-first clipboard.write only reaches DOM fallback after rejection; Safari can
|
|
60
|
-
// resolve native writes without retaining synced-block HTML, so
|
|
61
|
-
|
|
62
|
-
return (0, _clipboard.copyHTMLToClipboardSynchronously)(div);
|
|
63
|
-
}
|
|
59
|
+
// resolve native writes without retaining synced-block HTML, so we force copy-event/execCommand while click activation is live.
|
|
60
|
+
return (0, _clipboard.copyHTMLToClipboardSynchronously)(div);
|
|
64
61
|
}
|
|
65
62
|
|
|
66
63
|
// Safari's ClipboardItem API may not preserve HTML for extension nodes or mediaSingle nodes.
|
|
@@ -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 = "122.
|
|
30
|
+
var packageVersion = "122.3.0";
|
|
31
31
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
32
32
|
// Remove URL as it has UGC
|
|
33
33
|
// 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 = "122.
|
|
27
|
+
var packageVersion = "122.3.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -80,9 +80,9 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
|
|
|
80
80
|
* only element the browser honours `popovertarget` on. Anything else works, since this
|
|
81
81
|
* class calls `showPopover()`/`hidePopover()` itself, but then make sure it:
|
|
82
82
|
*
|
|
83
|
-
* - **Renders its children**, as the tooltip is appended to the trigger
|
|
84
|
-
* and `<br>` accept the append without error
|
|
85
|
-
* silently at zero size.
|
|
83
|
+
* - **Renders its children**, as the tooltip is appended to the trigger — unless
|
|
84
|
+
* `hoistContainer` is given. `<img>`, `<input>` and `<br>` accept the append without error
|
|
85
|
+
* but never render it, leaving the tooltip silently at zero size.
|
|
86
86
|
* - **Is reachable**, if keyboard and screen reader users need the tooltip — usually
|
|
87
87
|
* `tabindex="0"` plus a role and accessible name, since `focus`/`blur` are bound to the
|
|
88
88
|
* trigger and `aria-describedby` is set on it.
|
|
@@ -116,6 +116,22 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
|
|
|
116
116
|
*/
|
|
117
117
|
onShow = arguments.length > 6 ? arguments[6] : undefined;
|
|
118
118
|
var placement = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 'top';
|
|
119
|
+
var
|
|
120
|
+
/**
|
|
121
|
+
* Where to append the tooltip, instead of inside the trigger.
|
|
122
|
+
*
|
|
123
|
+
* Pass a container when anything between the trigger and the viewport is transformed. The
|
|
124
|
+
* browser resolves a top-layer popover's position against the viewport, while Popper — which
|
|
125
|
+
* reads `offsetParent`, and gets `null` for anything in the top layer — falls back to the
|
|
126
|
+
* nearest ancestor with a `transform`. Inside a wide image that ancestor is `.rich-media-item`,
|
|
127
|
+
* whose `translateX(-50%)` threw the tooltip off screen (EDITOR-8971). Appended to a container
|
|
128
|
+
* with no transform above it, the two measure from the same origin.
|
|
129
|
+
*
|
|
130
|
+
* Opt-in per caller: the tooltip leaves the trigger's subtree, so anything styling it through
|
|
131
|
+
* an ancestor stops matching — including `VANILLA_TOOLTIP_DEFAULT_CLASS`, whose rule is scoped
|
|
132
|
+
* under `.ProseMirror`. Pass `styles` for the look instead.
|
|
133
|
+
*/
|
|
134
|
+
hoistContainer = arguments.length > 8 ? arguments[8] : undefined;
|
|
119
135
|
(0, _classCallCheck2.default)(this, VanillaTooltip);
|
|
120
136
|
(0, _defineProperty2.default)(this, "listeners", []);
|
|
121
137
|
(0, _defineProperty2.default)(this, "shouldHidePopover", false);
|
|
@@ -124,6 +140,7 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
|
|
|
124
140
|
this.timeout = timeout;
|
|
125
141
|
this.onShow = onShow;
|
|
126
142
|
this.placement = placement;
|
|
143
|
+
this.hoistContainer = hoistContainer;
|
|
127
144
|
// Created in the trigger's own document rather than the global one, so nothing depends on
|
|
128
145
|
// the parent realm when the editor renders inside an iframe. Gated alongside the Escape
|
|
129
146
|
// listener's window so the whole iframe fix moves as a single unit.
|
|
@@ -143,7 +160,7 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
|
|
|
143
160
|
Object.assign(tooltip.style, styles);
|
|
144
161
|
}
|
|
145
162
|
this.tooltip = tooltip;
|
|
146
|
-
this.trigger.appendChild(tooltip);
|
|
163
|
+
(hoistContainer !== null && hoistContainer !== void 0 ? hoistContainer : this.trigger).appendChild(tooltip);
|
|
147
164
|
this.trigger.setAttribute('popovertarget', tooltip.id);
|
|
148
165
|
this.trigger.setAttribute('aria-describedby', tooltip.id);
|
|
149
166
|
var showEvents = ['mouseenter', 'focus'];
|
|
@@ -192,12 +209,22 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
|
|
|
192
209
|
}
|
|
193
210
|
|
|
194
211
|
/**
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
* A `hint` popover is light-dismissed by the browser whenever another `hint` or `auto` popover
|
|
198
|
-
* opens, so the caller can never be sure this one is still showing.
|
|
212
|
+
* The tooltip element, for callers that own its accessibility semantics — a hoisted tooltip is no
|
|
213
|
+
* longer reachable from the trigger.
|
|
199
214
|
*/
|
|
200
215
|
return (0, _createClass2.default)(VanillaTooltip, [{
|
|
216
|
+
key: "element",
|
|
217
|
+
get: function get() {
|
|
218
|
+
return this.tooltip;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Closes the popover, tolerating it already being closed.
|
|
223
|
+
*
|
|
224
|
+
* A `hint` popover is light-dismissed by the browser whenever another `hint` or `auto` popover
|
|
225
|
+
* opens, so the caller can never be sure this one is still showing.
|
|
226
|
+
*/
|
|
227
|
+
}, {
|
|
201
228
|
key: "closePopover",
|
|
202
229
|
value: function closePopover() {
|
|
203
230
|
try {
|
|
@@ -257,8 +284,9 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
|
|
|
257
284
|
});
|
|
258
285
|
|
|
259
286
|
// Undoes what the constructor added to the trigger, matching the React `@atlaskit/tooltip`
|
|
260
|
-
// callers are moving off, whose unmount took its DOM with it.
|
|
261
|
-
|
|
287
|
+
// callers are moving off, whose unmount took its DOM with it. A hoisted tooltip is removed
|
|
288
|
+
// either way: it sits outside the trigger, so nothing else takes it away with it.
|
|
289
|
+
if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_use_vanilla_components') || this.hoistContainer) {
|
|
262
290
|
// A popover removed while still showing is never light-dismissed, so the top layer
|
|
263
291
|
// keeps treating it as open.
|
|
264
292
|
this.closePopover();
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
5
4
|
import { copyHTMLToClipboard, copyHTMLToClipboardPolyfill, copyHTMLToClipboardSynchronously } from '../clipboard';
|
|
6
5
|
import { getBrowserInfo } from '../utils/browser';
|
|
7
6
|
export function getSelectedNodeOrNodeParentByNodeType({
|
|
@@ -50,10 +49,8 @@ const copyDomNodeWithResult = (domNode, nodeType, selection) => {
|
|
|
50
49
|
const isSyncedBlock = nodeType.name === 'syncBlock' || nodeType.name === 'bodiedSyncBlock';
|
|
51
50
|
if (browser.safari && isSyncedBlock) {
|
|
52
51
|
// clipboard-polyfill/native-first clipboard.write only reaches DOM fallback after rejection; Safari can
|
|
53
|
-
// resolve native writes without retaining synced-block HTML, so
|
|
54
|
-
|
|
55
|
-
return copyHTMLToClipboardSynchronously(div);
|
|
56
|
-
}
|
|
52
|
+
// resolve native writes without retaining synced-block HTML, so we force copy-event/execCommand while click activation is live.
|
|
53
|
+
return copyHTMLToClipboardSynchronously(div);
|
|
57
54
|
}
|
|
58
55
|
|
|
59
56
|
// Safari's ClipboardItem API may not preserve HTML for extension nodes or mediaSingle nodes.
|
|
@@ -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 = "122.
|
|
16
|
+
const packageVersion = "122.3.0";
|
|
17
17
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
18
18
|
// Remove URL as it has UGC
|
|
19
19
|
// Ignored via go/ees007
|
|
@@ -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 = "122.
|
|
17
|
+
const packageVersion = "122.3.0";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -67,9 +67,9 @@ export class VanillaTooltip {
|
|
|
67
67
|
* only element the browser honours `popovertarget` on. Anything else works, since this
|
|
68
68
|
* class calls `showPopover()`/`hidePopover()` itself, but then make sure it:
|
|
69
69
|
*
|
|
70
|
-
* - **Renders its children**, as the tooltip is appended to the trigger
|
|
71
|
-
* and `<br>` accept the append without error
|
|
72
|
-
* silently at zero size.
|
|
70
|
+
* - **Renders its children**, as the tooltip is appended to the trigger — unless
|
|
71
|
+
* `hoistContainer` is given. `<img>`, `<input>` and `<br>` accept the append without error
|
|
72
|
+
* but never render it, leaving the tooltip silently at zero size.
|
|
73
73
|
* - **Is reachable**, if keyboard and screen reader users need the tooltip — usually
|
|
74
74
|
* `tabindex="0"` plus a role and accessible name, since `focus`/`blur` are bound to the
|
|
75
75
|
* trigger and `aria-describedby` is set on it.
|
|
@@ -104,7 +104,22 @@ export class VanillaTooltip {
|
|
|
104
104
|
* Defaults to `'top'`, matching the default `position` of "@atlaskit/tooltip". Use
|
|
105
105
|
* `'bottom'` to match its `position="mouse"`, which places the tooltip below the cursor.
|
|
106
106
|
*/
|
|
107
|
-
placement = 'top'
|
|
107
|
+
placement = 'top',
|
|
108
|
+
/**
|
|
109
|
+
* Where to append the tooltip, instead of inside the trigger.
|
|
110
|
+
*
|
|
111
|
+
* Pass a container when anything between the trigger and the viewport is transformed. The
|
|
112
|
+
* browser resolves a top-layer popover's position against the viewport, while Popper — which
|
|
113
|
+
* reads `offsetParent`, and gets `null` for anything in the top layer — falls back to the
|
|
114
|
+
* nearest ancestor with a `transform`. Inside a wide image that ancestor is `.rich-media-item`,
|
|
115
|
+
* whose `translateX(-50%)` threw the tooltip off screen (EDITOR-8971). Appended to a container
|
|
116
|
+
* with no transform above it, the two measure from the same origin.
|
|
117
|
+
*
|
|
118
|
+
* Opt-in per caller: the tooltip leaves the trigger's subtree, so anything styling it through
|
|
119
|
+
* an ancestor stops matching — including `VANILLA_TOOLTIP_DEFAULT_CLASS`, whose rule is scoped
|
|
120
|
+
* under `.ProseMirror`. Pass `styles` for the look instead.
|
|
121
|
+
*/
|
|
122
|
+
hoistContainer) {
|
|
108
123
|
_defineProperty(this, "listeners", []);
|
|
109
124
|
_defineProperty(this, "shouldHidePopover", false);
|
|
110
125
|
_defineProperty(this, "isDisplayed", false);
|
|
@@ -112,6 +127,7 @@ export class VanillaTooltip {
|
|
|
112
127
|
this.timeout = timeout;
|
|
113
128
|
this.onShow = onShow;
|
|
114
129
|
this.placement = placement;
|
|
130
|
+
this.hoistContainer = hoistContainer;
|
|
115
131
|
// Created in the trigger's own document rather than the global one, so nothing depends on
|
|
116
132
|
// the parent realm when the editor renders inside an iframe. Gated alongside the Escape
|
|
117
133
|
// listener's window so the whole iframe fix moves as a single unit.
|
|
@@ -131,7 +147,7 @@ export class VanillaTooltip {
|
|
|
131
147
|
Object.assign(tooltip.style, styles);
|
|
132
148
|
}
|
|
133
149
|
this.tooltip = tooltip;
|
|
134
|
-
this.trigger.appendChild(tooltip);
|
|
150
|
+
(hoistContainer !== null && hoistContainer !== void 0 ? hoistContainer : this.trigger).appendChild(tooltip);
|
|
135
151
|
this.trigger.setAttribute('popovertarget', tooltip.id);
|
|
136
152
|
this.trigger.setAttribute('aria-describedby', tooltip.id);
|
|
137
153
|
const showEvents = ['mouseenter', 'focus'];
|
|
@@ -175,6 +191,14 @@ export class VanillaTooltip {
|
|
|
175
191
|
}
|
|
176
192
|
}
|
|
177
193
|
|
|
194
|
+
/**
|
|
195
|
+
* The tooltip element, for callers that own its accessibility semantics — a hoisted tooltip is no
|
|
196
|
+
* longer reachable from the trigger.
|
|
197
|
+
*/
|
|
198
|
+
get element() {
|
|
199
|
+
return this.tooltip;
|
|
200
|
+
}
|
|
201
|
+
|
|
178
202
|
/**
|
|
179
203
|
* Closes the popover, tolerating it already being closed.
|
|
180
204
|
*
|
|
@@ -233,8 +257,9 @@ export class VanillaTooltip {
|
|
|
233
257
|
});
|
|
234
258
|
|
|
235
259
|
// Undoes what the constructor added to the trigger, matching the React `@atlaskit/tooltip`
|
|
236
|
-
// callers are moving off, whose unmount took its DOM with it.
|
|
237
|
-
|
|
260
|
+
// callers are moving off, whose unmount took its DOM with it. A hoisted tooltip is removed
|
|
261
|
+
// either way: it sits outside the trigger, so nothing else takes it away with it.
|
|
262
|
+
if (isExperimentEnabled('platform_editor_use_vanilla_components') || this.hoistContainer) {
|
|
238
263
|
// A popover removed while still showing is never light-dismissed, so the top layer
|
|
239
264
|
// keeps treating it as open.
|
|
240
265
|
this.closePopover();
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
5
4
|
import { copyHTMLToClipboard, copyHTMLToClipboardPolyfill, copyHTMLToClipboardSynchronously } from '../clipboard';
|
|
6
5
|
import { getBrowserInfo } from '../utils/browser';
|
|
7
6
|
export function getSelectedNodeOrNodeParentByNodeType(_ref) {
|
|
@@ -49,10 +48,8 @@ var copyDomNodeWithResult = function copyDomNodeWithResult(domNode, nodeType, se
|
|
|
49
48
|
var isSyncedBlock = nodeType.name === 'syncBlock' || nodeType.name === 'bodiedSyncBlock';
|
|
50
49
|
if (browser.safari && isSyncedBlock) {
|
|
51
50
|
// clipboard-polyfill/native-first clipboard.write only reaches DOM fallback after rejection; Safari can
|
|
52
|
-
// resolve native writes without retaining synced-block HTML, so
|
|
53
|
-
|
|
54
|
-
return copyHTMLToClipboardSynchronously(div);
|
|
55
|
-
}
|
|
51
|
+
// resolve native writes without retaining synced-block HTML, so we force copy-event/execCommand while click activation is live.
|
|
52
|
+
return copyHTMLToClipboardSynchronously(div);
|
|
56
53
|
}
|
|
57
54
|
|
|
58
55
|
// Safari's ClipboardItem API may not preserve HTML for extension nodes or mediaSingle nodes.
|
|
@@ -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 = "122.
|
|
22
|
+
var packageVersion = "122.3.0";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -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 = "122.
|
|
24
|
+
var packageVersion = "122.3.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -73,9 +73,9 @@ export var VanillaTooltip = /*#__PURE__*/function () {
|
|
|
73
73
|
* only element the browser honours `popovertarget` on. Anything else works, since this
|
|
74
74
|
* class calls `showPopover()`/`hidePopover()` itself, but then make sure it:
|
|
75
75
|
*
|
|
76
|
-
* - **Renders its children**, as the tooltip is appended to the trigger
|
|
77
|
-
* and `<br>` accept the append without error
|
|
78
|
-
* silently at zero size.
|
|
76
|
+
* - **Renders its children**, as the tooltip is appended to the trigger — unless
|
|
77
|
+
* `hoistContainer` is given. `<img>`, `<input>` and `<br>` accept the append without error
|
|
78
|
+
* but never render it, leaving the tooltip silently at zero size.
|
|
79
79
|
* - **Is reachable**, if keyboard and screen reader users need the tooltip — usually
|
|
80
80
|
* `tabindex="0"` plus a role and accessible name, since `focus`/`blur` are bound to the
|
|
81
81
|
* trigger and `aria-describedby` is set on it.
|
|
@@ -109,6 +109,22 @@ export var VanillaTooltip = /*#__PURE__*/function () {
|
|
|
109
109
|
*/
|
|
110
110
|
onShow = arguments.length > 6 ? arguments[6] : undefined;
|
|
111
111
|
var placement = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 'top';
|
|
112
|
+
var
|
|
113
|
+
/**
|
|
114
|
+
* Where to append the tooltip, instead of inside the trigger.
|
|
115
|
+
*
|
|
116
|
+
* Pass a container when anything between the trigger and the viewport is transformed. The
|
|
117
|
+
* browser resolves a top-layer popover's position against the viewport, while Popper — which
|
|
118
|
+
* reads `offsetParent`, and gets `null` for anything in the top layer — falls back to the
|
|
119
|
+
* nearest ancestor with a `transform`. Inside a wide image that ancestor is `.rich-media-item`,
|
|
120
|
+
* whose `translateX(-50%)` threw the tooltip off screen (EDITOR-8971). Appended to a container
|
|
121
|
+
* with no transform above it, the two measure from the same origin.
|
|
122
|
+
*
|
|
123
|
+
* Opt-in per caller: the tooltip leaves the trigger's subtree, so anything styling it through
|
|
124
|
+
* an ancestor stops matching — including `VANILLA_TOOLTIP_DEFAULT_CLASS`, whose rule is scoped
|
|
125
|
+
* under `.ProseMirror`. Pass `styles` for the look instead.
|
|
126
|
+
*/
|
|
127
|
+
hoistContainer = arguments.length > 8 ? arguments[8] : undefined;
|
|
112
128
|
_classCallCheck(this, VanillaTooltip);
|
|
113
129
|
_defineProperty(this, "listeners", []);
|
|
114
130
|
_defineProperty(this, "shouldHidePopover", false);
|
|
@@ -117,6 +133,7 @@ export var VanillaTooltip = /*#__PURE__*/function () {
|
|
|
117
133
|
this.timeout = timeout;
|
|
118
134
|
this.onShow = onShow;
|
|
119
135
|
this.placement = placement;
|
|
136
|
+
this.hoistContainer = hoistContainer;
|
|
120
137
|
// Created in the trigger's own document rather than the global one, so nothing depends on
|
|
121
138
|
// the parent realm when the editor renders inside an iframe. Gated alongside the Escape
|
|
122
139
|
// listener's window so the whole iframe fix moves as a single unit.
|
|
@@ -136,7 +153,7 @@ export var VanillaTooltip = /*#__PURE__*/function () {
|
|
|
136
153
|
Object.assign(tooltip.style, styles);
|
|
137
154
|
}
|
|
138
155
|
this.tooltip = tooltip;
|
|
139
|
-
this.trigger.appendChild(tooltip);
|
|
156
|
+
(hoistContainer !== null && hoistContainer !== void 0 ? hoistContainer : this.trigger).appendChild(tooltip);
|
|
140
157
|
this.trigger.setAttribute('popovertarget', tooltip.id);
|
|
141
158
|
this.trigger.setAttribute('aria-describedby', tooltip.id);
|
|
142
159
|
var showEvents = ['mouseenter', 'focus'];
|
|
@@ -185,12 +202,22 @@ export var VanillaTooltip = /*#__PURE__*/function () {
|
|
|
185
202
|
}
|
|
186
203
|
|
|
187
204
|
/**
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
* A `hint` popover is light-dismissed by the browser whenever another `hint` or `auto` popover
|
|
191
|
-
* opens, so the caller can never be sure this one is still showing.
|
|
205
|
+
* The tooltip element, for callers that own its accessibility semantics — a hoisted tooltip is no
|
|
206
|
+
* longer reachable from the trigger.
|
|
192
207
|
*/
|
|
193
208
|
return _createClass(VanillaTooltip, [{
|
|
209
|
+
key: "element",
|
|
210
|
+
get: function get() {
|
|
211
|
+
return this.tooltip;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Closes the popover, tolerating it already being closed.
|
|
216
|
+
*
|
|
217
|
+
* A `hint` popover is light-dismissed by the browser whenever another `hint` or `auto` popover
|
|
218
|
+
* opens, so the caller can never be sure this one is still showing.
|
|
219
|
+
*/
|
|
220
|
+
}, {
|
|
194
221
|
key: "closePopover",
|
|
195
222
|
value: function closePopover() {
|
|
196
223
|
try {
|
|
@@ -250,8 +277,9 @@ export var VanillaTooltip = /*#__PURE__*/function () {
|
|
|
250
277
|
});
|
|
251
278
|
|
|
252
279
|
// Undoes what the constructor added to the trigger, matching the React `@atlaskit/tooltip`
|
|
253
|
-
// callers are moving off, whose unmount took its DOM with it.
|
|
254
|
-
|
|
280
|
+
// callers are moving off, whose unmount took its DOM with it. A hoisted tooltip is removed
|
|
281
|
+
// either way: it sits outside the trigger, so nothing else takes it away with it.
|
|
282
|
+
if (isExperimentEnabled('platform_editor_use_vanilla_components') || this.hoistContainer) {
|
|
255
283
|
// A popover removed while still showing is never light-dismissed, so the top layer
|
|
256
284
|
// keeps treating it as open.
|
|
257
285
|
this.closePopover();
|
|
@@ -18,9 +18,9 @@ export declare class VanillaTooltip {
|
|
|
18
18
|
* only element the browser honours `popovertarget` on. Anything else works, since this
|
|
19
19
|
* class calls `showPopover()`/`hidePopover()` itself, but then make sure it:
|
|
20
20
|
*
|
|
21
|
-
* - **Renders its children**, as the tooltip is appended to the trigger
|
|
22
|
-
* and `<br>` accept the append without error
|
|
23
|
-
* silently at zero size.
|
|
21
|
+
* - **Renders its children**, as the tooltip is appended to the trigger — unless
|
|
22
|
+
* `hoistContainer` is given. `<img>`, `<input>` and `<br>` accept the append without error
|
|
23
|
+
* but never render it, leaving the tooltip silently at zero size.
|
|
24
24
|
* - **Is reachable**, if keyboard and screen reader users need the tooltip — usually
|
|
25
25
|
* `tabindex="0"` plus a role and accessible name, since `focus`/`blur` are bound to the
|
|
26
26
|
* trigger and `aria-describedby` is set on it.
|
|
@@ -40,6 +40,21 @@ export declare class VanillaTooltip {
|
|
|
40
40
|
* `'bottom'` to match its `position="mouse"`, which places the tooltip below the cursor.
|
|
41
41
|
*/
|
|
42
42
|
private placement;
|
|
43
|
+
/**
|
|
44
|
+
* Where to append the tooltip, instead of inside the trigger.
|
|
45
|
+
*
|
|
46
|
+
* Pass a container when anything between the trigger and the viewport is transformed. The
|
|
47
|
+
* browser resolves a top-layer popover's position against the viewport, while Popper — which
|
|
48
|
+
* reads `offsetParent`, and gets `null` for anything in the top layer — falls back to the
|
|
49
|
+
* nearest ancestor with a `transform`. Inside a wide image that ancestor is `.rich-media-item`,
|
|
50
|
+
* whose `translateX(-50%)` threw the tooltip off screen (EDITOR-8971). Appended to a container
|
|
51
|
+
* with no transform above it, the two measure from the same origin.
|
|
52
|
+
*
|
|
53
|
+
* Opt-in per caller: the tooltip leaves the trigger's subtree, so anything styling it through
|
|
54
|
+
* an ancestor stops matching — including `VANILLA_TOOLTIP_DEFAULT_CLASS`, whose rule is scoped
|
|
55
|
+
* under `.ProseMirror`. Pass `styles` for the look instead.
|
|
56
|
+
*/
|
|
57
|
+
private hoistContainer?;
|
|
43
58
|
private popperInstance;
|
|
44
59
|
private listeners;
|
|
45
60
|
private currentTimeoutId;
|
|
@@ -58,9 +73,9 @@ export declare class VanillaTooltip {
|
|
|
58
73
|
* only element the browser honours `popovertarget` on. Anything else works, since this
|
|
59
74
|
* class calls `showPopover()`/`hidePopover()` itself, but then make sure it:
|
|
60
75
|
*
|
|
61
|
-
* - **Renders its children**, as the tooltip is appended to the trigger
|
|
62
|
-
* and `<br>` accept the append without error
|
|
63
|
-
* silently at zero size.
|
|
76
|
+
* - **Renders its children**, as the tooltip is appended to the trigger — unless
|
|
77
|
+
* `hoistContainer` is given. `<img>`, `<input>` and `<br>` accept the append without error
|
|
78
|
+
* but never render it, leaving the tooltip silently at zero size.
|
|
64
79
|
* - **Is reachable**, if keyboard and screen reader users need the tooltip — usually
|
|
65
80
|
* `tabindex="0"` plus a role and accessible name, since `focus`/`blur` are bound to the
|
|
66
81
|
* trigger and `aria-describedby` is set on it.
|
|
@@ -95,7 +110,27 @@ export declare class VanillaTooltip {
|
|
|
95
110
|
* Defaults to `'top'`, matching the default `position` of "@atlaskit/tooltip". Use
|
|
96
111
|
* `'bottom'` to match its `position="mouse"`, which places the tooltip below the cursor.
|
|
97
112
|
*/
|
|
98
|
-
placement?: Placement
|
|
113
|
+
placement?: Placement,
|
|
114
|
+
/**
|
|
115
|
+
* Where to append the tooltip, instead of inside the trigger.
|
|
116
|
+
*
|
|
117
|
+
* Pass a container when anything between the trigger and the viewport is transformed. The
|
|
118
|
+
* browser resolves a top-layer popover's position against the viewport, while Popper — which
|
|
119
|
+
* reads `offsetParent`, and gets `null` for anything in the top layer — falls back to the
|
|
120
|
+
* nearest ancestor with a `transform`. Inside a wide image that ancestor is `.rich-media-item`,
|
|
121
|
+
* whose `translateX(-50%)` threw the tooltip off screen (EDITOR-8971). Appended to a container
|
|
122
|
+
* with no transform above it, the two measure from the same origin.
|
|
123
|
+
*
|
|
124
|
+
* Opt-in per caller: the tooltip leaves the trigger's subtree, so anything styling it through
|
|
125
|
+
* an ancestor stops matching — including `VANILLA_TOOLTIP_DEFAULT_CLASS`, whose rule is scoped
|
|
126
|
+
* under `.ProseMirror`. Pass `styles` for the look instead.
|
|
127
|
+
*/
|
|
128
|
+
hoistContainer?: HTMLElement | undefined);
|
|
129
|
+
/**
|
|
130
|
+
* The tooltip element, for callers that own its accessibility semantics — a hoisted tooltip is no
|
|
131
|
+
* longer reachable from the trigger.
|
|
132
|
+
*/
|
|
133
|
+
get element(): HTMLSpanElement;
|
|
99
134
|
/**
|
|
100
135
|
* Closes the popover, tolerating it already being closed.
|
|
101
136
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "122.
|
|
3
|
+
"version": "122.3.1",
|
|
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/"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/activity-provider": "^3.1.0",
|
|
32
32
|
"@atlaskit/adf-schema": "^57.4.0",
|
|
33
33
|
"@atlaskit/adf-utils": "^20.9.0",
|
|
34
|
-
"@atlaskit/afm-i18n-platform-editor-editor-common": "2.
|
|
34
|
+
"@atlaskit/afm-i18n-platform-editor-editor-common": "2.249.0",
|
|
35
35
|
"@atlaskit/analytics-listeners": "^11.3.0",
|
|
36
36
|
"@atlaskit/analytics-namespaced-context": "^8.2.0",
|
|
37
37
|
"@atlaskit/analytics-next": "^12.5.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@atlaskit/editor-toolbar": "^2.6.0",
|
|
51
51
|
"@atlaskit/editor-toolbar-model": "^1.2.0",
|
|
52
52
|
"@atlaskit/editor-ui-control-model": "^2.9.0",
|
|
53
|
-
"@atlaskit/emoji": "^72.
|
|
53
|
+
"@atlaskit/emoji": "^72.4.0",
|
|
54
54
|
"@atlaskit/feature-gate-js-client": "^6.0.0",
|
|
55
55
|
"@atlaskit/icon": "^37.6.0",
|
|
56
56
|
"@atlaskit/link": "^5.1.0",
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"@atlaskit/media-common": "^14.6.0",
|
|
63
63
|
"@atlaskit/media-file-preview": "^1.3.0",
|
|
64
64
|
"@atlaskit/media-picker": "^72.4.0",
|
|
65
|
-
"@atlaskit/media-ui": "^30.
|
|
65
|
+
"@atlaskit/media-ui": "^30.16.0",
|
|
66
66
|
"@atlaskit/media-viewer": "^54.8.0",
|
|
67
|
-
"@atlaskit/mention": "^29.
|
|
67
|
+
"@atlaskit/mention": "^29.1.0",
|
|
68
68
|
"@atlaskit/menu": "^10.2.0",
|
|
69
69
|
"@atlaskit/object": "^2.3.0",
|
|
70
70
|
"@atlaskit/onboarding": "^15.4.0",
|
|
@@ -81,10 +81,10 @@
|
|
|
81
81
|
"@atlaskit/smart-card": "^45.22.0",
|
|
82
82
|
"@atlaskit/smart-user-picker": "^11.8.0",
|
|
83
83
|
"@atlaskit/spinner": "^20.4.0",
|
|
84
|
-
"@atlaskit/task-decision": "^21.
|
|
84
|
+
"@atlaskit/task-decision": "^21.10.0",
|
|
85
85
|
"@atlaskit/teams-app-config": "^3.1.0",
|
|
86
86
|
"@atlaskit/textfield": "^10.2.0",
|
|
87
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
87
|
+
"@atlaskit/tmp-editor-statsig": "^191.0.0",
|
|
88
88
|
"@atlaskit/tokens": "^16.12.0",
|
|
89
89
|
"@atlaskit/tooltip": "^24.3.0",
|
|
90
90
|
"@atlaskit/width-detector": "^7.2.0",
|
|
@@ -152,10 +152,6 @@
|
|
|
152
152
|
"type": "boolean",
|
|
153
153
|
"referenceOnly": true
|
|
154
154
|
},
|
|
155
|
-
"platform_editor_blocks_patch_9": {
|
|
156
|
-
"type": "boolean",
|
|
157
|
-
"referenceOnly": true
|
|
158
|
-
},
|
|
159
155
|
"platform_editor_nested_mbe_frames": {
|
|
160
156
|
"type": "boolean"
|
|
161
157
|
},
|