@atlaskit/editor-common 137.5.0 → 137.5.2
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 +20 -0
- package/dist/cjs/expand/index.js +1 -2
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/quick-insert/CompactQuickInsertMenuItem.js +7 -3
- package/dist/cjs/quick-insert/QuickInsertHoverPreview.js +37 -18
- package/dist/cjs/table/getStickyHeaderHeight.js +1 -2
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/ai-xstate-migration-no-exposure.js +5 -4
- package/dist/cjs/utils/ai-xstate-migration.js +8 -5
- package/dist/es2019/expand/index.js +1 -2
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/quick-insert/CompactQuickInsertMenuItem.js +7 -3
- package/dist/es2019/quick-insert/QuickInsertHoverPreview.js +33 -16
- package/dist/es2019/table/getStickyHeaderHeight.js +1 -3
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/ai-xstate-migration-no-exposure.js +5 -4
- package/dist/es2019/utils/ai-xstate-migration.js +8 -5
- package/dist/esm/expand/index.js +1 -2
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/quick-insert/CompactQuickInsertMenuItem.js +7 -3
- package/dist/esm/quick-insert/QuickInsertHoverPreview.js +37 -18
- package/dist/esm/table/getStickyHeaderHeight.js +1 -3
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/ai-xstate-migration-no-exposure.js +5 -4
- package/dist/esm/utils/ai-xstate-migration.js +8 -5
- package/dist/types/quick-insert/QuickInsertHoverPreview.d.ts +2 -1
- package/dist/types/utils/ai-xstate-migration-no-exposure.d.ts +4 -3
- package/dist/types/utils/ai-xstate-migration.d.ts +7 -4
- package/package.json +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 137.5.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`721ebae8b9b14`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/721ebae8b9b14) -
|
|
8
|
+
Add platform_editor_ai_xstate_migration_other to the shared Editor AI migration checks for
|
|
9
|
+
remaining products.
|
|
10
|
+
- [`3a4337d2e4a60`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3a4337d2e4a60) -
|
|
11
|
+
Clean up feature gate `platform_editor_ai_show_diff_patch_2`; the show-diff improvements are now
|
|
12
|
+
always on.
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 137.5.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`144ab5d6b3422`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/144ab5d6b3422) -
|
|
20
|
+
Keep slash-command previews beside their results under the platform_editor_slash_command
|
|
21
|
+
experiment, including in side panels.
|
|
22
|
+
|
|
3
23
|
## 137.5.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
package/dist/cjs/expand/index.js
CHANGED
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.toggleExpandRange = exports.isExpandCollapsed = exports.getNextNodeExpandPos = exports.expandedState = exports.TOGGLE_EXPAND_RANGE_META_KEY = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
10
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
11
10
|
// Used to store the state of the new single player expand node
|
|
12
11
|
var expandedState = exports.expandedState = new WeakMap();
|
|
13
12
|
|
|
@@ -42,7 +41,7 @@ var toggleExpandRange = exports.toggleExpandRange = function toggleExpandRange(f
|
|
|
42
41
|
// preserve positions from earlier calls on the same transaction so callers can target disjoint ranges
|
|
43
42
|
// without opening unrelated expands between them.
|
|
44
43
|
var existingMeta = tr.getMeta(TOGGLE_EXPAND_RANGE_META_KEY);
|
|
45
|
-
var combinedPositions = (existingMeta === null || existingMeta === void 0 ? void 0 : existingMeta.open) === open
|
|
44
|
+
var combinedPositions = (existingMeta === null || existingMeta === void 0 ? void 0 : existingMeta.open) === open ? Array.from(new Set([].concat((0, _toConsumableArray2.default)(existingMeta.positions), positions))) : positions;
|
|
46
45
|
|
|
47
46
|
// Set meta so the expand PM plugin can add node decorations.
|
|
48
47
|
// This ensures ExpandNodeView.update() receives the decoration and visually
|
|
@@ -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 = "137.
|
|
30
|
+
var packageVersion = "137.5.1";
|
|
31
31
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
32
32
|
// Remove URL as it has UGC
|
|
33
33
|
// Ignored via go/ees007
|
|
@@ -16,6 +16,7 @@ var _inline = require("@atlaskit/primitives/compiled/inline");
|
|
|
16
16
|
var _text = require("@atlaskit/primitives/compiled/text");
|
|
17
17
|
var _pressable = require("@atlaskit/primitives/pressable");
|
|
18
18
|
var _xcss = require("@atlaskit/primitives/xcss/xcss");
|
|
19
|
+
var _RegisteredMenuSurfaceContext = require("../registered-menu/RegisteredMenuSurfaceContext");
|
|
19
20
|
var _QuickInsertHoverPreview = require("./QuickInsertHoverPreview");
|
|
20
21
|
var _quickInsertMenuItemUtils = require("./quickInsertMenuItemUtils");
|
|
21
22
|
var _QuickInsertShortcut = require("./QuickInsertShortcut");
|
|
@@ -93,7 +94,7 @@ var disabledItemStyles = (0, _xcss.xcss)({
|
|
|
93
94
|
width: '100%'
|
|
94
95
|
});
|
|
95
96
|
var CompactQuickInsertMenuItem = exports.CompactQuickInsertMenuItem = function CompactQuickInsertMenuItem(_ref) {
|
|
96
|
-
var _resolvedPreview$attr, _ref3, _resolvedPreview$imag, _resolvedPreview$imag2;
|
|
97
|
+
var _surfaceContext$get, _resolvedPreview$attr, _ref3, _resolvedPreview$imag, _resolvedPreview$imag2;
|
|
97
98
|
var ariaLabel = _ref.ariaLabel,
|
|
98
99
|
ariaControls = _ref['aria-controls'],
|
|
99
100
|
description = _ref.description,
|
|
@@ -116,7 +117,9 @@ var CompactQuickInsertMenuItem = exports.CompactQuickInsertMenuItem = function C
|
|
|
116
117
|
title = _ref.title;
|
|
117
118
|
var _useQuickInsertContex = (0, _useQuickInsertContext.useQuickInsertContext)(),
|
|
118
119
|
item = _useQuickInsertContex.item,
|
|
119
|
-
popupsMountPoint = _useQuickInsertContex.popupsMountPoint
|
|
120
|
+
popupsMountPoint = _useQuickInsertContex.popupsMountPoint,
|
|
121
|
+
surfaceContext = _useQuickInsertContex.surfaceContext;
|
|
122
|
+
var surface = surfaceContext === null || surfaceContext === void 0 || (_surfaceContext$get = surfaceContext.get(_RegisteredMenuSurfaceContext.REGISTERED_MENU_SURFACE_CONTEXT)) === null || _surfaceContext$get === void 0 ? void 0 : _surfaceContext$get.surface;
|
|
120
123
|
var _ref2 = item !== null && item !== void 0 ? item : {
|
|
121
124
|
id: undefined,
|
|
122
125
|
isPreviewActive: undefined,
|
|
@@ -192,6 +195,7 @@ var CompactQuickInsertMenuItem = exports.CompactQuickInsertMenuItem = function C
|
|
|
192
195
|
title: title,
|
|
193
196
|
titleContent: titleContent,
|
|
194
197
|
icon: previewIcon,
|
|
195
|
-
shouldClampText: shouldClampPreview
|
|
198
|
+
shouldClampText: shouldClampPreview,
|
|
199
|
+
useViewportPositioning: surface === 'typeahead'
|
|
196
200
|
}));
|
|
197
201
|
};
|
|
@@ -58,13 +58,16 @@ var QuickInsertHoverPreview = exports.QuickInsertHoverPreview = function QuickIn
|
|
|
58
58
|
_ref$shouldClampText = _ref.shouldClampText,
|
|
59
59
|
shouldClampText = _ref$shouldClampText === void 0 ? true : _ref$shouldClampText,
|
|
60
60
|
title = _ref.title,
|
|
61
|
-
titleContent = _ref.titleContent
|
|
61
|
+
titleContent = _ref.titleContent,
|
|
62
|
+
useViewportPositioning = _ref.useViewportPositioning;
|
|
62
63
|
var hasAccessibleContent = Boolean(description || preview.attribution);
|
|
63
64
|
var portalTarget = popupsMountPoint !== null && popupsMountPoint !== void 0 ? popupsMountPoint : referenceElement.ownerDocument.body;
|
|
64
65
|
return /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/_react.default.createElement(_reactPopper.Popper, {
|
|
65
66
|
placement: "right-start",
|
|
66
|
-
referenceElement: referenceElement
|
|
67
|
-
|
|
67
|
+
referenceElement: referenceElement
|
|
68
|
+
// A fixed slash preview can flip outside a scrolling panel while staying in its host portal.
|
|
69
|
+
,
|
|
70
|
+
strategy: useViewportPositioning || !popupsMountPoint ? 'fixed' : 'absolute',
|
|
68
71
|
modifiers: PREVIEW_MODIFIERS
|
|
69
72
|
}, function (_ref2) {
|
|
70
73
|
var ref = _ref2.ref,
|
|
@@ -84,7 +87,8 @@ var QuickInsertHoverPreview = exports.QuickInsertHoverPreview = function QuickIn
|
|
|
84
87
|
shouldClampText: shouldClampText,
|
|
85
88
|
title: title,
|
|
86
89
|
titleContent: titleContent,
|
|
87
|
-
update: update
|
|
90
|
+
update: update,
|
|
91
|
+
useViewportPositioning: useViewportPositioning
|
|
88
92
|
}));
|
|
89
93
|
}), portalTarget);
|
|
90
94
|
};
|
|
@@ -98,13 +102,14 @@ var QuickInsertPreviewPanel = function QuickInsertPreviewPanel(_ref3) {
|
|
|
98
102
|
shouldClampText = _ref3.shouldClampText,
|
|
99
103
|
title = _ref3.title,
|
|
100
104
|
titleContent = _ref3.titleContent,
|
|
101
|
-
update = _ref3.update
|
|
105
|
+
update = _ref3.update,
|
|
106
|
+
useViewportPositioning = _ref3.useViewportPositioning;
|
|
102
107
|
var _useState = (0, _react.useState)(null),
|
|
103
108
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
104
109
|
panelElement = _useState2[0],
|
|
105
110
|
setPanelElement = _useState2[1];
|
|
106
111
|
(0, _react.useLayoutEffect)(function () {
|
|
107
|
-
var _ownerDocument$defaul;
|
|
112
|
+
var _ownerDocument$defaul, _ownerDocument$defaul2;
|
|
108
113
|
void update();
|
|
109
114
|
var ownerDocument = referenceElement.ownerDocument;
|
|
110
115
|
var onScroll = function onScroll() {
|
|
@@ -115,23 +120,37 @@ var QuickInsertPreviewPanel = function QuickInsertPreviewPanel(_ref3) {
|
|
|
115
120
|
listener: onScroll,
|
|
116
121
|
options: true
|
|
117
122
|
});
|
|
118
|
-
var
|
|
119
|
-
|
|
120
|
-
|
|
123
|
+
var MutationObserverConstructor = (_ownerDocument$defaul = ownerDocument.defaultView) === null || _ownerDocument$defaul === void 0 ? void 0 : _ownerDocument$defaul.MutationObserver;
|
|
124
|
+
var mountPositionObserver;
|
|
125
|
+
if (useViewportPositioning && popupsMountPoint && MutationObserverConstructor) {
|
|
126
|
+
// Panning can move a host mount without firing a scroll or resize event.
|
|
127
|
+
mountPositionObserver = new MutationObserverConstructor(function () {
|
|
128
|
+
return void update();
|
|
129
|
+
});
|
|
130
|
+
mountPositionObserver.observe(popupsMountPoint, {
|
|
131
|
+
attributes: true,
|
|
132
|
+
attributeFilter: ['class', 'style']
|
|
133
|
+
});
|
|
121
134
|
}
|
|
122
|
-
var
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
135
|
+
var ResizeObserverConstructor = (_ownerDocument$defaul2 = ownerDocument.defaultView) === null || _ownerDocument$defaul2 === void 0 ? void 0 : _ownerDocument$defaul2.ResizeObserver;
|
|
136
|
+
var resizeObserver;
|
|
137
|
+
if (panelElement && ResizeObserverConstructor) {
|
|
138
|
+
resizeObserver = new ResizeObserverConstructor(function () {
|
|
139
|
+
return void update();
|
|
140
|
+
});
|
|
141
|
+
resizeObserver.observe(panelElement);
|
|
142
|
+
resizeObserver.observe(referenceElement);
|
|
143
|
+
if (popupsMountPoint) {
|
|
144
|
+
resizeObserver.observe(popupsMountPoint);
|
|
145
|
+
}
|
|
129
146
|
}
|
|
130
147
|
return function () {
|
|
148
|
+
var _resizeObserver, _mountPositionObserve;
|
|
131
149
|
unbindScrollListener();
|
|
132
|
-
|
|
150
|
+
(_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 || _resizeObserver.disconnect();
|
|
151
|
+
(_mountPositionObserve = mountPositionObserver) === null || _mountPositionObserve === void 0 || _mountPositionObserve.disconnect();
|
|
133
152
|
};
|
|
134
|
-
}, [panelElement, popupsMountPoint, referenceElement, update]);
|
|
153
|
+
}, [panelElement, popupsMountPoint, referenceElement, update, useViewportPositioning]);
|
|
135
154
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
136
155
|
ref: setPanelElement,
|
|
137
156
|
id: id,
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getStickyHeaderHeight = getStickyHeaderHeight;
|
|
7
7
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
8
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
9
8
|
/**
|
|
10
9
|
* Returns the outermost table's sticky header height for `targetPos` if its a table row and eligible to be
|
|
11
10
|
* sticky. Table headers at least half the viewport high intentionally do not become sticky.
|
|
@@ -28,7 +27,7 @@ function getStickyHeaderHeight(view, targetPos) {
|
|
|
28
27
|
var firstRowPos = outermostTable.pos + 1;
|
|
29
28
|
|
|
30
29
|
// do not add sticky header offset if the target is in the sticky header
|
|
31
|
-
if (firstRow && targetPos >= firstRowPos && targetPos < firstRowPos + firstRow.nodeSize
|
|
30
|
+
if (firstRow && targetPos >= firstRowPos && targetPos < firstRowPos + firstRow.nodeSize) {
|
|
32
31
|
return undefined;
|
|
33
32
|
}
|
|
34
33
|
var firstRowDom = view.nodeDOM(firstRowPos);
|
|
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
23
23
|
* @jsx jsx
|
|
24
24
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
25
25
|
var packageName = "@atlaskit/editor-common";
|
|
26
|
-
var packageVersion = "137.
|
|
26
|
+
var packageVersion = "137.5.1";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
// Ignored via go/ees005
|
|
@@ -8,11 +8,12 @@ var _unsafeExpValNoExposure = require("@atlaskit/platform-feature-experiments/un
|
|
|
8
8
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
9
9
|
/**
|
|
10
10
|
* Same as `isAiXstateMigrationEnabled` from `@atlaskit/editor-common/ai-xstate-migration`
|
|
11
|
-
* (Confluence `platform_editor_ai_xstate_migration
|
|
12
|
-
* `platform_editor_ai_xstate_migration_jira
|
|
11
|
+
* (Confluence `platform_editor_ai_xstate_migration`, Jira
|
|
12
|
+
* `platform_editor_ai_xstate_migration_jira`, OR remaining products
|
|
13
|
+
* `platform_editor_ai_xstate_migration_other`), but never fires exposure.
|
|
13
14
|
*
|
|
14
|
-
* Cleanup: only remove once
|
|
15
|
+
* Cleanup: only remove once ALL three experiments have shipped.
|
|
15
16
|
*/
|
|
16
17
|
var isAiXstateMigrationEnabledNoExposure = exports.isAiXstateMigrationEnabledNoExposure = function isAiXstateMigrationEnabledNoExposure() {
|
|
17
|
-
return (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_ai_xstate_migration', 'isEnabled', true) || (0, _unsafeExpValNoExposure.UNSAFE_expValNoExposure)('platform_editor_ai_xstate_migration_jira', 'isEnabled', false) === true;
|
|
18
|
+
return (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_ai_xstate_migration', 'isEnabled', true) || (0, _unsafeExpValNoExposure.UNSAFE_expValNoExposure)('platform_editor_ai_xstate_migration_jira', 'isEnabled', false) === true || (0, _unsafeExpValNoExposure.UNSAFE_expValNoExposure)('platform_editor_ai_xstate_migration_other', 'isEnabled', false) === true;
|
|
18
19
|
};
|
|
@@ -9,22 +9,25 @@ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
|
9
9
|
/**
|
|
10
10
|
* Whether the editor AI xstate migration is enabled for the current product.
|
|
11
11
|
*
|
|
12
|
-
* The migration is rolled out via
|
|
12
|
+
* The migration is rolled out via three audience-specific experiments:
|
|
13
13
|
* - `platform_editor_ai_xstate_migration` (Confluence), a legacy editor experiment
|
|
14
14
|
* read via `@atlaskit/tmp-editor-statsig`
|
|
15
15
|
* - `platform_editor_ai_xstate_migration_jira` (Jira), a platform feature experiment
|
|
16
16
|
* read via `@atlaskit/platform-feature-experiments`
|
|
17
|
+
* - `platform_editor_ai_xstate_migration_other` (remaining products), a platform
|
|
18
|
+
* feature experiment. Targeting must exclude Jira and Confluence, and the existing
|
|
19
|
+
* experiments must exclude the remaining products to preserve their control group.
|
|
17
20
|
*
|
|
18
|
-
* Use this helper instead of checking
|
|
21
|
+
* Use this helper instead of checking an experiment directly so every call site
|
|
19
22
|
* stays consistent across products. Use `isAiXstateMigrationEnabledNoExposure` from
|
|
20
23
|
* `@atlaskit/editor-common/ai-xstate-migration-no-exposure` when exposure must not fire.
|
|
21
24
|
*
|
|
22
25
|
* Cleanup: only remove this helper (and replace its call sites with `true`) once
|
|
23
|
-
*
|
|
24
|
-
*
|
|
26
|
+
* ALL three experiments have shipped. Cleaning up one experiment alone by replacing
|
|
27
|
+
* it with `true` would also force the migration on for the other products.
|
|
25
28
|
*
|
|
26
29
|
* Note: This method fires exposure for the evaluated experiment(s).
|
|
27
30
|
*/
|
|
28
31
|
var isAiXstateMigrationEnabled = exports.isAiXstateMigrationEnabled = function isAiXstateMigrationEnabled() {
|
|
29
|
-
return (0, _expValEquals.expValEquals)('platform_editor_ai_xstate_migration', 'isEnabled', true) || (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_ai_xstate_migration_jira');
|
|
32
|
+
return (0, _expValEquals.expValEquals)('platform_editor_ai_xstate_migration', 'isEnabled', true) || (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_ai_xstate_migration_jira') || (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_ai_xstate_migration_other');
|
|
30
33
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
3
2
|
// Used to store the state of the new single player expand node
|
|
4
3
|
export const expandedState = new WeakMap();
|
|
5
4
|
|
|
@@ -34,7 +33,7 @@ export const toggleExpandRange = (from, to, open = true) => ({
|
|
|
34
33
|
// preserve positions from earlier calls on the same transaction so callers can target disjoint ranges
|
|
35
34
|
// without opening unrelated expands between them.
|
|
36
35
|
const existingMeta = tr.getMeta(TOGGLE_EXPAND_RANGE_META_KEY);
|
|
37
|
-
const combinedPositions = (existingMeta === null || existingMeta === void 0 ? void 0 : existingMeta.open) === open
|
|
36
|
+
const combinedPositions = (existingMeta === null || existingMeta === void 0 ? void 0 : existingMeta.open) === open ? Array.from(new Set([...existingMeta.positions, ...positions])) : positions;
|
|
38
37
|
|
|
39
38
|
// Set meta so the expand PM plugin can add node decorations.
|
|
40
39
|
// This ensures ExpandNodeView.update() receives the decoration and visually
|
|
@@ -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 = "137.
|
|
16
|
+
const packageVersion = "137.5.1";
|
|
17
17
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
18
18
|
// Remove URL as it has UGC
|
|
19
19
|
// Ignored via go/ees007
|
|
@@ -9,6 +9,7 @@ import { Text } from '@atlaskit/primitives/compiled/text';
|
|
|
9
9
|
import { Pressable } from '@atlaskit/primitives/pressable';
|
|
10
10
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- Compiled primitives do not provide Pressable.
|
|
11
11
|
import { xcss } from '@atlaskit/primitives/xcss/xcss';
|
|
12
|
+
import { REGISTERED_MENU_SURFACE_CONTEXT } from '../registered-menu/RegisteredMenuSurfaceContext';
|
|
12
13
|
import { QuickInsertHoverPreview } from './QuickInsertHoverPreview';
|
|
13
14
|
import { useQuickInsertMenuItemSelection } from './quickInsertMenuItemUtils';
|
|
14
15
|
import { QuickInsertShortcut } from './QuickInsertShortcut';
|
|
@@ -102,11 +103,13 @@ export const CompactQuickInsertMenuItem = ({
|
|
|
102
103
|
shouldWrapIcon = true,
|
|
103
104
|
title
|
|
104
105
|
}) => {
|
|
105
|
-
var _resolvedPreview$attr, _ref, _resolvedPreview$imag, _resolvedPreview$imag2;
|
|
106
|
+
var _surfaceContext$get, _resolvedPreview$attr, _ref, _resolvedPreview$imag, _resolvedPreview$imag2;
|
|
106
107
|
const {
|
|
107
108
|
item,
|
|
108
|
-
popupsMountPoint
|
|
109
|
+
popupsMountPoint,
|
|
110
|
+
surfaceContext
|
|
109
111
|
} = useQuickInsertContext();
|
|
112
|
+
const surface = surfaceContext === null || surfaceContext === void 0 ? void 0 : (_surfaceContext$get = surfaceContext.get(REGISTERED_MENU_SURFACE_CONTEXT)) === null || _surfaceContext$get === void 0 ? void 0 : _surfaceContext$get.surface;
|
|
110
113
|
const {
|
|
111
114
|
id,
|
|
112
115
|
isPreviewActive,
|
|
@@ -178,6 +181,7 @@ export const CompactQuickInsertMenuItem = ({
|
|
|
178
181
|
title: title,
|
|
179
182
|
titleContent: titleContent,
|
|
180
183
|
icon: previewIcon,
|
|
181
|
-
shouldClampText: shouldClampPreview
|
|
184
|
+
shouldClampText: shouldClampPreview,
|
|
185
|
+
useViewportPositioning: surface === 'typeahead'
|
|
182
186
|
}));
|
|
183
187
|
};
|
|
@@ -50,14 +50,17 @@ export const QuickInsertHoverPreview = ({
|
|
|
50
50
|
referenceElement,
|
|
51
51
|
shouldClampText = true,
|
|
52
52
|
title,
|
|
53
|
-
titleContent
|
|
53
|
+
titleContent,
|
|
54
|
+
useViewportPositioning
|
|
54
55
|
}) => {
|
|
55
56
|
const hasAccessibleContent = Boolean(description || preview.attribution);
|
|
56
57
|
const portalTarget = popupsMountPoint !== null && popupsMountPoint !== void 0 ? popupsMountPoint : referenceElement.ownerDocument.body;
|
|
57
58
|
return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(Popper, {
|
|
58
59
|
placement: "right-start",
|
|
59
|
-
referenceElement: referenceElement
|
|
60
|
-
|
|
60
|
+
referenceElement: referenceElement
|
|
61
|
+
// A fixed slash preview can flip outside a scrolling panel while staying in its host portal.
|
|
62
|
+
,
|
|
63
|
+
strategy: useViewportPositioning || !popupsMountPoint ? 'fixed' : 'absolute',
|
|
61
64
|
modifiers: PREVIEW_MODIFIERS
|
|
62
65
|
}, ({
|
|
63
66
|
ref,
|
|
@@ -77,7 +80,8 @@ export const QuickInsertHoverPreview = ({
|
|
|
77
80
|
shouldClampText: shouldClampText,
|
|
78
81
|
title: title,
|
|
79
82
|
titleContent: titleContent,
|
|
80
|
-
update: update
|
|
83
|
+
update: update,
|
|
84
|
+
useViewportPositioning: useViewportPositioning
|
|
81
85
|
}))), portalTarget);
|
|
82
86
|
};
|
|
83
87
|
const QuickInsertPreviewPanel = ({
|
|
@@ -90,11 +94,12 @@ const QuickInsertPreviewPanel = ({
|
|
|
90
94
|
shouldClampText,
|
|
91
95
|
title,
|
|
92
96
|
titleContent,
|
|
93
|
-
update
|
|
97
|
+
update,
|
|
98
|
+
useViewportPositioning
|
|
94
99
|
}) => {
|
|
95
100
|
const [panelElement, setPanelElement] = useState(null);
|
|
96
101
|
useLayoutEffect(() => {
|
|
97
|
-
var _ownerDocument$defaul;
|
|
102
|
+
var _ownerDocument$defaul, _ownerDocument$defaul2;
|
|
98
103
|
void update();
|
|
99
104
|
const {
|
|
100
105
|
ownerDocument
|
|
@@ -105,21 +110,33 @@ const QuickInsertPreviewPanel = ({
|
|
|
105
110
|
listener: onScroll,
|
|
106
111
|
options: true
|
|
107
112
|
});
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
const MutationObserverConstructor = (_ownerDocument$defaul = ownerDocument.defaultView) === null || _ownerDocument$defaul === void 0 ? void 0 : _ownerDocument$defaul.MutationObserver;
|
|
114
|
+
let mountPositionObserver;
|
|
115
|
+
if (useViewportPositioning && popupsMountPoint && MutationObserverConstructor) {
|
|
116
|
+
// Panning can move a host mount without firing a scroll or resize event.
|
|
117
|
+
mountPositionObserver = new MutationObserverConstructor(() => void update());
|
|
118
|
+
mountPositionObserver.observe(popupsMountPoint, {
|
|
119
|
+
attributes: true,
|
|
120
|
+
attributeFilter: ['class', 'style']
|
|
121
|
+
});
|
|
111
122
|
}
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
123
|
+
const ResizeObserverConstructor = (_ownerDocument$defaul2 = ownerDocument.defaultView) === null || _ownerDocument$defaul2 === void 0 ? void 0 : _ownerDocument$defaul2.ResizeObserver;
|
|
124
|
+
let resizeObserver;
|
|
125
|
+
if (panelElement && ResizeObserverConstructor) {
|
|
126
|
+
resizeObserver = new ResizeObserverConstructor(() => void update());
|
|
127
|
+
resizeObserver.observe(panelElement);
|
|
128
|
+
resizeObserver.observe(referenceElement);
|
|
129
|
+
if (popupsMountPoint) {
|
|
130
|
+
resizeObserver.observe(popupsMountPoint);
|
|
131
|
+
}
|
|
117
132
|
}
|
|
118
133
|
return () => {
|
|
134
|
+
var _resizeObserver, _mountPositionObserve;
|
|
119
135
|
unbindScrollListener();
|
|
120
|
-
|
|
136
|
+
(_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 ? void 0 : _resizeObserver.disconnect();
|
|
137
|
+
(_mountPositionObserve = mountPositionObserver) === null || _mountPositionObserve === void 0 ? void 0 : _mountPositionObserve.disconnect();
|
|
121
138
|
};
|
|
122
|
-
}, [panelElement, popupsMountPoint, referenceElement, update]);
|
|
139
|
+
}, [panelElement, popupsMountPoint, referenceElement, update, useViewportPositioning]);
|
|
123
140
|
return /*#__PURE__*/React.createElement("div", {
|
|
124
141
|
ref: setPanelElement,
|
|
125
142
|
id: id,
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
3
|
-
|
|
4
2
|
/**
|
|
5
3
|
* Returns the outermost table's sticky header height for `targetPos` if its a table row and eligible to be
|
|
6
4
|
* sticky. Table headers at least half the viewport high intentionally do not become sticky.
|
|
@@ -23,7 +21,7 @@ export function getStickyHeaderHeight(view, targetPos) {
|
|
|
23
21
|
const firstRowPos = outermostTable.pos + 1;
|
|
24
22
|
|
|
25
23
|
// do not add sticky header offset if the target is in the sticky header
|
|
26
|
-
if (firstRow && targetPos >= firstRowPos && targetPos < firstRowPos + firstRow.nodeSize
|
|
24
|
+
if (firstRow && targetPos >= firstRowPos && targetPos < firstRowPos + firstRow.nodeSize) {
|
|
27
25
|
return undefined;
|
|
28
26
|
}
|
|
29
27
|
const firstRowDom = view.nodeDOM(firstRowPos);
|
|
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
13
13
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
14
14
|
import Layer from '../Layer';
|
|
15
15
|
const packageName = "@atlaskit/editor-common";
|
|
16
|
-
const packageVersion = "137.
|
|
16
|
+
const packageVersion = "137.5.1";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
// Ignored via go/ees005
|
|
@@ -3,9 +3,10 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Same as `isAiXstateMigrationEnabled` from `@atlaskit/editor-common/ai-xstate-migration`
|
|
6
|
-
* (Confluence `platform_editor_ai_xstate_migration
|
|
7
|
-
* `platform_editor_ai_xstate_migration_jira
|
|
6
|
+
* (Confluence `platform_editor_ai_xstate_migration`, Jira
|
|
7
|
+
* `platform_editor_ai_xstate_migration_jira`, OR remaining products
|
|
8
|
+
* `platform_editor_ai_xstate_migration_other`), but never fires exposure.
|
|
8
9
|
*
|
|
9
|
-
* Cleanup: only remove once
|
|
10
|
+
* Cleanup: only remove once ALL three experiments have shipped.
|
|
10
11
|
*/
|
|
11
|
-
export const isAiXstateMigrationEnabledNoExposure = () => expValEqualsNoExposure('platform_editor_ai_xstate_migration', 'isEnabled', true) || UNSAFE_expValNoExposure('platform_editor_ai_xstate_migration_jira', 'isEnabled', false) === true;
|
|
12
|
+
export const isAiXstateMigrationEnabledNoExposure = () => expValEqualsNoExposure('platform_editor_ai_xstate_migration', 'isEnabled', true) || UNSAFE_expValNoExposure('platform_editor_ai_xstate_migration_jira', 'isEnabled', false) === true || UNSAFE_expValNoExposure('platform_editor_ai_xstate_migration_other', 'isEnabled', false) === true;
|
|
@@ -4,20 +4,23 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
|
4
4
|
/**
|
|
5
5
|
* Whether the editor AI xstate migration is enabled for the current product.
|
|
6
6
|
*
|
|
7
|
-
* The migration is rolled out via
|
|
7
|
+
* The migration is rolled out via three audience-specific experiments:
|
|
8
8
|
* - `platform_editor_ai_xstate_migration` (Confluence), a legacy editor experiment
|
|
9
9
|
* read via `@atlaskit/tmp-editor-statsig`
|
|
10
10
|
* - `platform_editor_ai_xstate_migration_jira` (Jira), a platform feature experiment
|
|
11
11
|
* read via `@atlaskit/platform-feature-experiments`
|
|
12
|
+
* - `platform_editor_ai_xstate_migration_other` (remaining products), a platform
|
|
13
|
+
* feature experiment. Targeting must exclude Jira and Confluence, and the existing
|
|
14
|
+
* experiments must exclude the remaining products to preserve their control group.
|
|
12
15
|
*
|
|
13
|
-
* Use this helper instead of checking
|
|
16
|
+
* Use this helper instead of checking an experiment directly so every call site
|
|
14
17
|
* stays consistent across products. Use `isAiXstateMigrationEnabledNoExposure` from
|
|
15
18
|
* `@atlaskit/editor-common/ai-xstate-migration-no-exposure` when exposure must not fire.
|
|
16
19
|
*
|
|
17
20
|
* Cleanup: only remove this helper (and replace its call sites with `true`) once
|
|
18
|
-
*
|
|
19
|
-
*
|
|
21
|
+
* ALL three experiments have shipped. Cleaning up one experiment alone by replacing
|
|
22
|
+
* it with `true` would also force the migration on for the other products.
|
|
20
23
|
*
|
|
21
24
|
* Note: This method fires exposure for the evaluated experiment(s).
|
|
22
25
|
*/
|
|
23
|
-
export const isAiXstateMigrationEnabled = () => expValEquals('platform_editor_ai_xstate_migration', 'isEnabled', true) || isExperimentEnabled('platform_editor_ai_xstate_migration_jira');
|
|
26
|
+
export const isAiXstateMigrationEnabled = () => expValEquals('platform_editor_ai_xstate_migration', 'isEnabled', true) || isExperimentEnabled('platform_editor_ai_xstate_migration_jira') || isExperimentEnabled('platform_editor_ai_xstate_migration_other');
|
package/dist/esm/expand/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
3
|
// Used to store the state of the new single player expand node
|
|
5
4
|
export var expandedState = new WeakMap();
|
|
6
5
|
|
|
@@ -35,7 +34,7 @@ export var toggleExpandRange = function toggleExpandRange(from, to) {
|
|
|
35
34
|
// preserve positions from earlier calls on the same transaction so callers can target disjoint ranges
|
|
36
35
|
// without opening unrelated expands between them.
|
|
37
36
|
var existingMeta = tr.getMeta(TOGGLE_EXPAND_RANGE_META_KEY);
|
|
38
|
-
var combinedPositions = (existingMeta === null || existingMeta === void 0 ? void 0 : existingMeta.open) === open
|
|
37
|
+
var combinedPositions = (existingMeta === null || existingMeta === void 0 ? void 0 : existingMeta.open) === open ? Array.from(new Set([].concat(_toConsumableArray(existingMeta.positions), positions))) : positions;
|
|
39
38
|
|
|
40
39
|
// Set meta so the expand PM plugin can add node decorations.
|
|
41
40
|
// This ensures ExpandNodeView.update() receives the decoration and visually
|
|
@@ -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 = "137.
|
|
22
|
+
var packageVersion = "137.5.1";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -10,6 +10,7 @@ import { Text } from '@atlaskit/primitives/compiled/text';
|
|
|
10
10
|
import { Pressable } from '@atlaskit/primitives/pressable';
|
|
11
11
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- Compiled primitives do not provide Pressable.
|
|
12
12
|
import { xcss } from '@atlaskit/primitives/xcss/xcss';
|
|
13
|
+
import { REGISTERED_MENU_SURFACE_CONTEXT } from '../registered-menu/RegisteredMenuSurfaceContext';
|
|
13
14
|
import { QuickInsertHoverPreview } from './QuickInsertHoverPreview';
|
|
14
15
|
import { useQuickInsertMenuItemSelection } from './quickInsertMenuItemUtils';
|
|
15
16
|
import { QuickInsertShortcut } from './QuickInsertShortcut';
|
|
@@ -84,7 +85,7 @@ var disabledItemStyles = xcss({
|
|
|
84
85
|
width: '100%'
|
|
85
86
|
});
|
|
86
87
|
export var CompactQuickInsertMenuItem = function CompactQuickInsertMenuItem(_ref) {
|
|
87
|
-
var _resolvedPreview$attr, _ref3, _resolvedPreview$imag, _resolvedPreview$imag2;
|
|
88
|
+
var _surfaceContext$get, _resolvedPreview$attr, _ref3, _resolvedPreview$imag, _resolvedPreview$imag2;
|
|
88
89
|
var ariaLabel = _ref.ariaLabel,
|
|
89
90
|
ariaControls = _ref['aria-controls'],
|
|
90
91
|
description = _ref.description,
|
|
@@ -107,7 +108,9 @@ export var CompactQuickInsertMenuItem = function CompactQuickInsertMenuItem(_ref
|
|
|
107
108
|
title = _ref.title;
|
|
108
109
|
var _useQuickInsertContex = useQuickInsertContext(),
|
|
109
110
|
item = _useQuickInsertContex.item,
|
|
110
|
-
popupsMountPoint = _useQuickInsertContex.popupsMountPoint
|
|
111
|
+
popupsMountPoint = _useQuickInsertContex.popupsMountPoint,
|
|
112
|
+
surfaceContext = _useQuickInsertContex.surfaceContext;
|
|
113
|
+
var surface = surfaceContext === null || surfaceContext === void 0 || (_surfaceContext$get = surfaceContext.get(REGISTERED_MENU_SURFACE_CONTEXT)) === null || _surfaceContext$get === void 0 ? void 0 : _surfaceContext$get.surface;
|
|
111
114
|
var _ref2 = item !== null && item !== void 0 ? item : {
|
|
112
115
|
id: undefined,
|
|
113
116
|
isPreviewActive: undefined,
|
|
@@ -183,6 +186,7 @@ export var CompactQuickInsertMenuItem = function CompactQuickInsertMenuItem(_ref
|
|
|
183
186
|
title: title,
|
|
184
187
|
titleContent: titleContent,
|
|
185
188
|
icon: previewIcon,
|
|
186
|
-
shouldClampText: shouldClampPreview
|
|
189
|
+
shouldClampText: shouldClampPreview,
|
|
190
|
+
useViewportPositioning: surface === 'typeahead'
|
|
187
191
|
}));
|
|
188
192
|
};
|
|
@@ -52,13 +52,16 @@ export var QuickInsertHoverPreview = function QuickInsertHoverPreview(_ref) {
|
|
|
52
52
|
_ref$shouldClampText = _ref.shouldClampText,
|
|
53
53
|
shouldClampText = _ref$shouldClampText === void 0 ? true : _ref$shouldClampText,
|
|
54
54
|
title = _ref.title,
|
|
55
|
-
titleContent = _ref.titleContent
|
|
55
|
+
titleContent = _ref.titleContent,
|
|
56
|
+
useViewportPositioning = _ref.useViewportPositioning;
|
|
56
57
|
var hasAccessibleContent = Boolean(description || preview.attribution);
|
|
57
58
|
var portalTarget = popupsMountPoint !== null && popupsMountPoint !== void 0 ? popupsMountPoint : referenceElement.ownerDocument.body;
|
|
58
59
|
return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(Popper, {
|
|
59
60
|
placement: "right-start",
|
|
60
|
-
referenceElement: referenceElement
|
|
61
|
-
|
|
61
|
+
referenceElement: referenceElement
|
|
62
|
+
// A fixed slash preview can flip outside a scrolling panel while staying in its host portal.
|
|
63
|
+
,
|
|
64
|
+
strategy: useViewportPositioning || !popupsMountPoint ? 'fixed' : 'absolute',
|
|
62
65
|
modifiers: PREVIEW_MODIFIERS
|
|
63
66
|
}, function (_ref2) {
|
|
64
67
|
var ref = _ref2.ref,
|
|
@@ -78,7 +81,8 @@ export var QuickInsertHoverPreview = function QuickInsertHoverPreview(_ref) {
|
|
|
78
81
|
shouldClampText: shouldClampText,
|
|
79
82
|
title: title,
|
|
80
83
|
titleContent: titleContent,
|
|
81
|
-
update: update
|
|
84
|
+
update: update,
|
|
85
|
+
useViewportPositioning: useViewportPositioning
|
|
82
86
|
}));
|
|
83
87
|
}), portalTarget);
|
|
84
88
|
};
|
|
@@ -92,13 +96,14 @@ var QuickInsertPreviewPanel = function QuickInsertPreviewPanel(_ref3) {
|
|
|
92
96
|
shouldClampText = _ref3.shouldClampText,
|
|
93
97
|
title = _ref3.title,
|
|
94
98
|
titleContent = _ref3.titleContent,
|
|
95
|
-
update = _ref3.update
|
|
99
|
+
update = _ref3.update,
|
|
100
|
+
useViewportPositioning = _ref3.useViewportPositioning;
|
|
96
101
|
var _useState = useState(null),
|
|
97
102
|
_useState2 = _slicedToArray(_useState, 2),
|
|
98
103
|
panelElement = _useState2[0],
|
|
99
104
|
setPanelElement = _useState2[1];
|
|
100
105
|
useLayoutEffect(function () {
|
|
101
|
-
var _ownerDocument$defaul;
|
|
106
|
+
var _ownerDocument$defaul, _ownerDocument$defaul2;
|
|
102
107
|
void update();
|
|
103
108
|
var ownerDocument = referenceElement.ownerDocument;
|
|
104
109
|
var onScroll = function onScroll() {
|
|
@@ -109,23 +114,37 @@ var QuickInsertPreviewPanel = function QuickInsertPreviewPanel(_ref3) {
|
|
|
109
114
|
listener: onScroll,
|
|
110
115
|
options: true
|
|
111
116
|
});
|
|
112
|
-
var
|
|
113
|
-
|
|
114
|
-
|
|
117
|
+
var MutationObserverConstructor = (_ownerDocument$defaul = ownerDocument.defaultView) === null || _ownerDocument$defaul === void 0 ? void 0 : _ownerDocument$defaul.MutationObserver;
|
|
118
|
+
var mountPositionObserver;
|
|
119
|
+
if (useViewportPositioning && popupsMountPoint && MutationObserverConstructor) {
|
|
120
|
+
// Panning can move a host mount without firing a scroll or resize event.
|
|
121
|
+
mountPositionObserver = new MutationObserverConstructor(function () {
|
|
122
|
+
return void update();
|
|
123
|
+
});
|
|
124
|
+
mountPositionObserver.observe(popupsMountPoint, {
|
|
125
|
+
attributes: true,
|
|
126
|
+
attributeFilter: ['class', 'style']
|
|
127
|
+
});
|
|
115
128
|
}
|
|
116
|
-
var
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
129
|
+
var ResizeObserverConstructor = (_ownerDocument$defaul2 = ownerDocument.defaultView) === null || _ownerDocument$defaul2 === void 0 ? void 0 : _ownerDocument$defaul2.ResizeObserver;
|
|
130
|
+
var resizeObserver;
|
|
131
|
+
if (panelElement && ResizeObserverConstructor) {
|
|
132
|
+
resizeObserver = new ResizeObserverConstructor(function () {
|
|
133
|
+
return void update();
|
|
134
|
+
});
|
|
135
|
+
resizeObserver.observe(panelElement);
|
|
136
|
+
resizeObserver.observe(referenceElement);
|
|
137
|
+
if (popupsMountPoint) {
|
|
138
|
+
resizeObserver.observe(popupsMountPoint);
|
|
139
|
+
}
|
|
123
140
|
}
|
|
124
141
|
return function () {
|
|
142
|
+
var _resizeObserver, _mountPositionObserve;
|
|
125
143
|
unbindScrollListener();
|
|
126
|
-
|
|
144
|
+
(_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 || _resizeObserver.disconnect();
|
|
145
|
+
(_mountPositionObserve = mountPositionObserver) === null || _mountPositionObserve === void 0 || _mountPositionObserve.disconnect();
|
|
127
146
|
};
|
|
128
|
-
}, [panelElement, popupsMountPoint, referenceElement, update]);
|
|
147
|
+
}, [panelElement, popupsMountPoint, referenceElement, update, useViewportPositioning]);
|
|
129
148
|
return /*#__PURE__*/React.createElement("div", {
|
|
130
149
|
ref: setPanelElement,
|
|
131
150
|
id: id,
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
3
|
-
|
|
4
2
|
/**
|
|
5
3
|
* Returns the outermost table's sticky header height for `targetPos` if its a table row and eligible to be
|
|
6
4
|
* sticky. Table headers at least half the viewport high intentionally do not become sticky.
|
|
@@ -23,7 +21,7 @@ export function getStickyHeaderHeight(view, targetPos) {
|
|
|
23
21
|
var firstRowPos = outermostTable.pos + 1;
|
|
24
22
|
|
|
25
23
|
// do not add sticky header offset if the target is in the sticky header
|
|
26
|
-
if (firstRow && targetPos >= firstRowPos && targetPos < firstRowPos + firstRow.nodeSize
|
|
24
|
+
if (firstRow && targetPos >= firstRowPos && targetPos < firstRowPos + firstRow.nodeSize) {
|
|
27
25
|
return undefined;
|
|
28
26
|
}
|
|
29
27
|
var firstRowDom = view.nodeDOM(firstRowPos);
|
|
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
20
20
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
21
21
|
import Layer from '../Layer';
|
|
22
22
|
var packageName = "@atlaskit/editor-common";
|
|
23
|
-
var packageVersion = "137.
|
|
23
|
+
var packageVersion = "137.5.1";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
// Ignored via go/ees005
|
|
@@ -3,11 +3,12 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Same as `isAiXstateMigrationEnabled` from `@atlaskit/editor-common/ai-xstate-migration`
|
|
6
|
-
* (Confluence `platform_editor_ai_xstate_migration
|
|
7
|
-
* `platform_editor_ai_xstate_migration_jira
|
|
6
|
+
* (Confluence `platform_editor_ai_xstate_migration`, Jira
|
|
7
|
+
* `platform_editor_ai_xstate_migration_jira`, OR remaining products
|
|
8
|
+
* `platform_editor_ai_xstate_migration_other`), but never fires exposure.
|
|
8
9
|
*
|
|
9
|
-
* Cleanup: only remove once
|
|
10
|
+
* Cleanup: only remove once ALL three experiments have shipped.
|
|
10
11
|
*/
|
|
11
12
|
export var isAiXstateMigrationEnabledNoExposure = function isAiXstateMigrationEnabledNoExposure() {
|
|
12
|
-
return expValEqualsNoExposure('platform_editor_ai_xstate_migration', 'isEnabled', true) || UNSAFE_expValNoExposure('platform_editor_ai_xstate_migration_jira', 'isEnabled', false) === true;
|
|
13
|
+
return expValEqualsNoExposure('platform_editor_ai_xstate_migration', 'isEnabled', true) || UNSAFE_expValNoExposure('platform_editor_ai_xstate_migration_jira', 'isEnabled', false) === true || UNSAFE_expValNoExposure('platform_editor_ai_xstate_migration_other', 'isEnabled', false) === true;
|
|
13
14
|
};
|
|
@@ -4,22 +4,25 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
|
4
4
|
/**
|
|
5
5
|
* Whether the editor AI xstate migration is enabled for the current product.
|
|
6
6
|
*
|
|
7
|
-
* The migration is rolled out via
|
|
7
|
+
* The migration is rolled out via three audience-specific experiments:
|
|
8
8
|
* - `platform_editor_ai_xstate_migration` (Confluence), a legacy editor experiment
|
|
9
9
|
* read via `@atlaskit/tmp-editor-statsig`
|
|
10
10
|
* - `platform_editor_ai_xstate_migration_jira` (Jira), a platform feature experiment
|
|
11
11
|
* read via `@atlaskit/platform-feature-experiments`
|
|
12
|
+
* - `platform_editor_ai_xstate_migration_other` (remaining products), a platform
|
|
13
|
+
* feature experiment. Targeting must exclude Jira and Confluence, and the existing
|
|
14
|
+
* experiments must exclude the remaining products to preserve their control group.
|
|
12
15
|
*
|
|
13
|
-
* Use this helper instead of checking
|
|
16
|
+
* Use this helper instead of checking an experiment directly so every call site
|
|
14
17
|
* stays consistent across products. Use `isAiXstateMigrationEnabledNoExposure` from
|
|
15
18
|
* `@atlaskit/editor-common/ai-xstate-migration-no-exposure` when exposure must not fire.
|
|
16
19
|
*
|
|
17
20
|
* Cleanup: only remove this helper (and replace its call sites with `true`) once
|
|
18
|
-
*
|
|
19
|
-
*
|
|
21
|
+
* ALL three experiments have shipped. Cleaning up one experiment alone by replacing
|
|
22
|
+
* it with `true` would also force the migration on for the other products.
|
|
20
23
|
*
|
|
21
24
|
* Note: This method fires exposure for the evaluated experiment(s).
|
|
22
25
|
*/
|
|
23
26
|
export var isAiXstateMigrationEnabled = function isAiXstateMigrationEnabled() {
|
|
24
|
-
return expValEquals('platform_editor_ai_xstate_migration', 'isEnabled', true) || isExperimentEnabled('platform_editor_ai_xstate_migration_jira');
|
|
27
|
+
return expValEquals('platform_editor_ai_xstate_migration', 'isEnabled', true) || isExperimentEnabled('platform_editor_ai_xstate_migration_jira') || isExperimentEnabled('platform_editor_ai_xstate_migration_other');
|
|
25
28
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React, { type ReactNode } from 'react';
|
|
6
6
|
import type { QuickInsertPreview } from './preview';
|
|
7
7
|
/** The selected item's description and attribution are announced through its aria-describedby. */
|
|
8
|
-
export declare const QuickInsertHoverPreview: ({ description, icon, id, preview, popupsMountPoint, referenceElement, shouldClampText, title, titleContent, }: {
|
|
8
|
+
export declare const QuickInsertHoverPreview: ({ description, icon, id, preview, popupsMountPoint, referenceElement, shouldClampText, title, titleContent, useViewportPositioning, }: {
|
|
9
9
|
description?: string;
|
|
10
10
|
icon?: ReactNode;
|
|
11
11
|
id: string;
|
|
@@ -16,4 +16,5 @@ export declare const QuickInsertHoverPreview: ({ description, icon, id, preview,
|
|
|
16
16
|
title: string;
|
|
17
17
|
/** Rich content rendered in place of the title. */
|
|
18
18
|
titleContent?: ReactNode;
|
|
19
|
+
useViewportPositioning: boolean;
|
|
19
20
|
}) => React.JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Same as `isAiXstateMigrationEnabled` from `@atlaskit/editor-common/ai-xstate-migration`
|
|
3
|
-
* (Confluence `platform_editor_ai_xstate_migration
|
|
4
|
-
* `platform_editor_ai_xstate_migration_jira
|
|
3
|
+
* (Confluence `platform_editor_ai_xstate_migration`, Jira
|
|
4
|
+
* `platform_editor_ai_xstate_migration_jira`, OR remaining products
|
|
5
|
+
* `platform_editor_ai_xstate_migration_other`), but never fires exposure.
|
|
5
6
|
*
|
|
6
|
-
* Cleanup: only remove once
|
|
7
|
+
* Cleanup: only remove once ALL three experiments have shipped.
|
|
7
8
|
*/
|
|
8
9
|
export declare const isAiXstateMigrationEnabledNoExposure: () => boolean;
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Whether the editor AI xstate migration is enabled for the current product.
|
|
3
3
|
*
|
|
4
|
-
* The migration is rolled out via
|
|
4
|
+
* The migration is rolled out via three audience-specific experiments:
|
|
5
5
|
* - `platform_editor_ai_xstate_migration` (Confluence), a legacy editor experiment
|
|
6
6
|
* read via `@atlaskit/tmp-editor-statsig`
|
|
7
7
|
* - `platform_editor_ai_xstate_migration_jira` (Jira), a platform feature experiment
|
|
8
8
|
* read via `@atlaskit/platform-feature-experiments`
|
|
9
|
+
* - `platform_editor_ai_xstate_migration_other` (remaining products), a platform
|
|
10
|
+
* feature experiment. Targeting must exclude Jira and Confluence, and the existing
|
|
11
|
+
* experiments must exclude the remaining products to preserve their control group.
|
|
9
12
|
*
|
|
10
|
-
* Use this helper instead of checking
|
|
13
|
+
* Use this helper instead of checking an experiment directly so every call site
|
|
11
14
|
* stays consistent across products. Use `isAiXstateMigrationEnabledNoExposure` from
|
|
12
15
|
* `@atlaskit/editor-common/ai-xstate-migration-no-exposure` when exposure must not fire.
|
|
13
16
|
*
|
|
14
17
|
* Cleanup: only remove this helper (and replace its call sites with `true`) once
|
|
15
|
-
*
|
|
16
|
-
*
|
|
18
|
+
* ALL three experiments have shipped. Cleaning up one experiment alone by replacing
|
|
19
|
+
* it with `true` would also force the migration on for the other products.
|
|
17
20
|
*
|
|
18
21
|
* Note: This method fires exposure for the evaluated experiment(s).
|
|
19
22
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "137.5.
|
|
3
|
+
"version": "137.5.2",
|
|
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/"
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"@atlaskit/editor-ui-control-model": "^3.0.0",
|
|
53
53
|
"@atlaskit/emoji": "^73.7.0",
|
|
54
54
|
"@atlaskit/feature-gate-js-client": "^8.0.0",
|
|
55
|
-
"@atlaskit/icon": "^38.
|
|
55
|
+
"@atlaskit/icon": "^38.2.0",
|
|
56
56
|
"@atlaskit/link": "^5.1.0",
|
|
57
57
|
"@atlaskit/link-datasource": "^7.15.0",
|
|
58
58
|
"@atlaskit/link-picker": "^6.22.0",
|
|
59
|
-
"@atlaskit/linking-common": "^13.
|
|
59
|
+
"@atlaskit/linking-common": "^13.1.0",
|
|
60
60
|
"@atlaskit/logo": "^23.3.0",
|
|
61
61
|
"@atlaskit/media-card": "^82.3.0",
|
|
62
62
|
"@atlaskit/media-client": "^39.4.0",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@atlaskit/popper": "^9.4.0",
|
|
77
77
|
"@atlaskit/popup": "^10.2.0",
|
|
78
78
|
"@atlaskit/primitives": "^22.8.0",
|
|
79
|
-
"@atlaskit/profilecard": "^27.
|
|
79
|
+
"@atlaskit/profilecard": "^27.12.0",
|
|
80
80
|
"@atlaskit/prosemirror-history": "^1.3.0",
|
|
81
81
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
82
82
|
"@atlaskit/react-ufo": "^8.5.0",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"@atlassian/experiment-test-utils": "^0.2.0",
|
|
133
133
|
"@atlassian/feature-flags-test-utils": "^2.0.0",
|
|
134
134
|
"@atlassian/testing-library": "^0.12.0",
|
|
135
|
-
"@react-loosely-lazy/manifest": "^1.
|
|
135
|
+
"@react-loosely-lazy/manifest": "^1.2.1",
|
|
136
136
|
"@testing-library/dom": "^10.1.0",
|
|
137
137
|
"@testing-library/jest-dom": "^6.4.5",
|
|
138
138
|
"@testing-library/react": "^16.3.0",
|
|
@@ -161,9 +161,6 @@
|
|
|
161
161
|
"type": "boolean",
|
|
162
162
|
"referenceOnly": true
|
|
163
163
|
},
|
|
164
|
-
"platform_editor_ai_show_diff_patch_2": {
|
|
165
|
-
"type": "boolean"
|
|
166
|
-
},
|
|
167
164
|
"platform_editor_hide_configure_lozenge_non_configurable": {
|
|
168
165
|
"type": "boolean"
|
|
169
166
|
},
|