@atlaskit/editor-common 114.8.1 → 114.10.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 +34 -0
- package/dist/cjs/extensibility/Extension/Extension/index.js +12 -7
- package/dist/cjs/extensibility/Extension/Lozenge/ExtensionLabel.js +24 -18
- package/dist/cjs/extensibility/Extension.js +1 -1
- package/dist/cjs/extensions/UnknownMacroPlaceholder.js +37 -15
- package/dist/cjs/messages/insert-block.js +15 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Popup/index.js +45 -9
- package/dist/es2019/extensibility/Extension/Extension/index.js +10 -7
- package/dist/es2019/extensibility/Extension/Lozenge/ExtensionLabel.js +8 -4
- package/dist/es2019/extensibility/Extension.js +1 -1
- package/dist/es2019/extensions/UnknownMacroPlaceholder.js +18 -7
- package/dist/es2019/messages/insert-block.js +15 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Popup/index.js +41 -6
- package/dist/esm/extensibility/Extension/Extension/index.js +12 -7
- package/dist/esm/extensibility/Extension/Lozenge/ExtensionLabel.js +10 -4
- package/dist/esm/extensibility/Extension.js +1 -1
- package/dist/esm/extensions/UnknownMacroPlaceholder.js +36 -14
- package/dist/esm/messages/insert-block.js +15 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Popup/index.js +45 -9
- package/dist/types/block-menu/rank.d.ts +11 -58
- package/dist/types/extensibility/Extension/Lozenge/ExtensionLabel.d.ts +1 -1
- package/dist/types/messages/insert-block.d.ts +103 -88
- package/dist/types/provider-factory/quick-insert-provider.d.ts +1 -1
- package/dist/types/ui/Popup/index.d.ts +6 -0
- package/dist/types-ts4.5/block-menu/rank.d.ts +11 -58
- package/dist/types-ts4.5/extensibility/Extension/Lozenge/ExtensionLabel.d.ts +1 -1
- package/dist/types-ts4.5/messages/insert-block.d.ts +103 -88
- package/dist/types-ts4.5/provider-factory/quick-insert-provider.d.ts +1 -1
- package/dist/types-ts4.5/ui/Popup/index.d.ts +6 -0
- package/package.json +4 -4
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { bind } from 'bind-event-listener';
|
|
3
4
|
import createFocusTrap from 'focus-trap';
|
|
4
5
|
import rafSchedule from 'raf-schd';
|
|
5
6
|
import { createPortal, flushSync } from 'react-dom';
|
|
@@ -220,8 +221,41 @@ export default class Popup extends React.Component {
|
|
|
220
221
|
return this.initFocusTrap();
|
|
221
222
|
}
|
|
222
223
|
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Idempotent scroll element setup — tears down any previous listener/observer
|
|
227
|
+
* then attaches to the current scroll parent.
|
|
228
|
+
*/
|
|
229
|
+
initScrollElement() {
|
|
230
|
+
var _this$unbindScroll;
|
|
231
|
+
const {
|
|
232
|
+
stick,
|
|
233
|
+
target,
|
|
234
|
+
scrollableElement
|
|
235
|
+
} = this.props;
|
|
236
|
+
(_this$unbindScroll = this.unbindScroll) === null || _this$unbindScroll === void 0 ? void 0 : _this$unbindScroll.call(this);
|
|
237
|
+
if (this.scrollElement && this.resizeObserver) {
|
|
238
|
+
this.resizeObserver.unobserve(this.scrollElement);
|
|
239
|
+
}
|
|
240
|
+
this.scrollElement = scrollableElement;
|
|
241
|
+
if (stick && !this.scrollElement && target) {
|
|
242
|
+
this.scrollElement = findOverflowScrollParent(target);
|
|
243
|
+
}
|
|
244
|
+
if (this.scrollElement) {
|
|
245
|
+
if (this.resizeObserver) {
|
|
246
|
+
this.resizeObserver.observe(this.scrollElement);
|
|
247
|
+
}
|
|
248
|
+
this.unbindScroll = bind(this.scrollElement, {
|
|
249
|
+
type: 'scroll',
|
|
250
|
+
listener: this.onResize
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
223
254
|
componentDidUpdate(prevProps) {
|
|
224
255
|
this.handleChangedFocusTrapProp(prevProps);
|
|
256
|
+
if (expValEquals('platform_editor_fix_scrolling_popup_position', 'isEnabled', true) && prevProps.scrollableElement !== this.props.scrollableElement) {
|
|
257
|
+
this.initScrollElement();
|
|
258
|
+
}
|
|
225
259
|
if (this.props !== prevProps) {
|
|
226
260
|
this.scheduledUpdatePosition(prevProps);
|
|
227
261
|
}
|
|
@@ -230,6 +264,10 @@ export default class Popup extends React.Component {
|
|
|
230
264
|
// Ignored via go/ees005
|
|
231
265
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
232
266
|
window.addEventListener('resize', this.onResize);
|
|
267
|
+
if (expValEquals('platform_editor_fix_scrolling_popup_position', 'isEnabled', true)) {
|
|
268
|
+
this.initScrollElement();
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
233
271
|
const {
|
|
234
272
|
stick
|
|
235
273
|
} = this.props;
|
|
@@ -237,11 +275,7 @@ export default class Popup extends React.Component {
|
|
|
237
275
|
// Ignored via go/ees005
|
|
238
276
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
239
277
|
const target = this.props.target;
|
|
240
|
-
|
|
241
|
-
// Resolve the effective scroll parent: prefer the explicitly provided scrollableElement
|
|
242
|
-
// prop over the auto-detected ancestor. Allows product consumers to provide the correct
|
|
243
|
-
// scroll container (e.g. a modal body) when auto-detection can't find it.
|
|
244
|
-
const scrollParentElement = expValEquals('platform_editor_fix_scrolling_popup_position', 'isEnabled', true) ? this.props.scrollableElement || findOverflowScrollParent(target) : findOverflowScrollParent(target);
|
|
278
|
+
const scrollParentElement = findOverflowScrollParent(target);
|
|
245
279
|
if (scrollParentElement && this.resizeObserver) {
|
|
246
280
|
this.resizeObserver.observe(scrollParentElement);
|
|
247
281
|
}
|
|
@@ -257,10 +291,11 @@ export default class Popup extends React.Component {
|
|
|
257
291
|
}
|
|
258
292
|
}
|
|
259
293
|
componentWillUnmount() {
|
|
260
|
-
var _this$resizeObserver3;
|
|
294
|
+
var _this$unbindScroll2, _this$resizeObserver3;
|
|
261
295
|
// Ignored via go/ees005
|
|
262
296
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
263
297
|
window.removeEventListener('resize', this.onResize);
|
|
298
|
+
(_this$unbindScroll2 = this.unbindScroll) === null || _this$unbindScroll2 === void 0 ? void 0 : _this$unbindScroll2.call(this);
|
|
264
299
|
if (this.scrollElement) {
|
|
265
300
|
// Ignored via go/ees005
|
|
266
301
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -229,15 +229,20 @@ var Extension = function Extension(props) {
|
|
|
229
229
|
}),
|
|
230
230
|
lineLength = _useSharedPluginState.lineLength,
|
|
231
231
|
width = _useSharedPluginState.width;
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
return jsx(ExtensionWithPluginState
|
|
235
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
236
|
-
, _extends({
|
|
237
|
-
widthState: {
|
|
232
|
+
var memoizedWidthState = React.useMemo(function () {
|
|
233
|
+
return {
|
|
238
234
|
width: width !== null && width !== void 0 ? width : 0,
|
|
239
235
|
lineLength: lineLength
|
|
240
|
-
}
|
|
236
|
+
};
|
|
237
|
+
}, [width, lineLength]);
|
|
238
|
+
var widthState = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedWidthState : {
|
|
239
|
+
width: width !== null && width !== void 0 ? width : 0,
|
|
240
|
+
lineLength: lineLength
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
// Ignored via go/ees005
|
|
244
|
+
return jsx(ExtensionWithPluginState, _extends({
|
|
245
|
+
widthState: widthState
|
|
241
246
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
242
247
|
}, props));
|
|
243
248
|
};
|
|
@@ -4,6 +4,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
4
4
|
* @jsxRuntime classic
|
|
5
5
|
* @jsx jsx
|
|
6
6
|
*/
|
|
7
|
+
import { useMemo } from 'react';
|
|
7
8
|
|
|
8
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
|
|
9
10
|
import { css, jsx } from '@emotion/react';
|
|
@@ -153,6 +154,14 @@ export var ExtensionLabel = function ExtensionLabel(_ref) {
|
|
|
153
154
|
'hide-icon': expValEquals('cc_editor_ttvc_release_bundle_one', 'extensionHoverRefactor', true) ? false : isBodiedMacro && !isNodeHovered,
|
|
154
155
|
'extension-icon': expValEquals('cc_editor_ttvc_release_bundle_one', 'extensionHoverRefactor', true)
|
|
155
156
|
});
|
|
157
|
+
var memoizedTooltipValues = useMemo(function () {
|
|
158
|
+
return {
|
|
159
|
+
macroName: text
|
|
160
|
+
};
|
|
161
|
+
}, [text]);
|
|
162
|
+
var tooltipValues = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedTooltipValues : {
|
|
163
|
+
macroName: text
|
|
164
|
+
};
|
|
156
165
|
return (
|
|
157
166
|
// eslint-disable-next-line @atlassian/a11y/no-static-element-interactions, @atlassian/a11y/click-events-have-key-events, @atlassian/a11y/interactive-element-not-keyboard-focusable
|
|
158
167
|
jsx("div", {
|
|
@@ -183,10 +192,7 @@ export var ExtensionLabel = function ExtensionLabel(_ref) {
|
|
|
183
192
|
// Ignored via go/ees005
|
|
184
193
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
185
194
|
, _extends({}, i18n.configure, {
|
|
186
|
-
|
|
187
|
-
values: {
|
|
188
|
-
macroName: text
|
|
189
|
-
}
|
|
195
|
+
values: tooltipValues
|
|
190
196
|
})),
|
|
191
197
|
position: "top"
|
|
192
198
|
}, function (tooltipProps) {
|
|
@@ -77,7 +77,7 @@ export var Extension = /*#__PURE__*/function (_Component) {
|
|
|
77
77
|
key: "render",
|
|
78
78
|
value: function render() {
|
|
79
79
|
return /*#__PURE__*/React.createElement(WithProviders
|
|
80
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props --
|
|
80
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- there seems to be an existing bug where the Extension component can't be resized if this is memoised because it doesn't rerender so this can't be memoised without a larger refactor
|
|
81
81
|
, {
|
|
82
82
|
providers: ['extensionProvider'],
|
|
83
83
|
providerFactory: this.providerFactory,
|
|
@@ -3,7 +3,9 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
import "./UnknownMacroPlaceholder.compiled.css";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
+
import { useMemo } from 'react';
|
|
6
7
|
import { useIntl } from 'react-intl';
|
|
8
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
9
|
import { messages } from './messages';
|
|
8
10
|
// Unknown macro placeholder styling aligned with Legacy Content Macro (LCM) for consistent look
|
|
9
11
|
var neutralBorder = "var(--ds-background-neutral, #0515240F)";
|
|
@@ -15,28 +17,48 @@ var unknownMacroHeaderStyles = null;
|
|
|
15
17
|
// Match LCM content area: white surface, text color inherits
|
|
16
18
|
var unknownMacroBodyStyles = null;
|
|
17
19
|
var unknownMacroPreStyles = null;
|
|
20
|
+
var formatParam = function formatParam(key, param) {
|
|
21
|
+
var _param$value;
|
|
22
|
+
var value = String((_param$value = param === null || param === void 0 ? void 0 : param.value) !== null && _param$value !== void 0 ? _param$value : '').trim();
|
|
23
|
+
return "".concat(key, " = ").concat(value);
|
|
24
|
+
};
|
|
25
|
+
var EMPTY_MACRO_PARAMS = {};
|
|
18
26
|
export function UnknownMacroPlaceholder(_ref) {
|
|
19
|
-
var _extensionNode$parame, _extensionNode$parame2, _extensionNode$parame3, _extensionNode$parame4;
|
|
27
|
+
var _extensionNode$parame, _extensionNode$parame2, _extensionNode$parame3, _extensionNode$parame4, _extensionNode$parame5, _extensionNode$parame6;
|
|
20
28
|
var extensionNode = _ref.extensionNode;
|
|
21
29
|
var intl = useIntl();
|
|
22
30
|
var macroTitle = ((_extensionNode$parame = extensionNode.parameters) === null || _extensionNode$parame === void 0 || (_extensionNode$parame = _extensionNode$parame.macroMetadata) === null || _extensionNode$parame === void 0 ? void 0 : _extensionNode$parame.title) || extensionNode.extensionKey;
|
|
23
31
|
var bodyContent = (_extensionNode$parame2 = extensionNode.parameters) === null || _extensionNode$parame2 === void 0 || (_extensionNode$parame2 = _extensionNode$parame2.macroParams) === null || _extensionNode$parame2 === void 0 || (_extensionNode$parame2 = _extensionNode$parame2.__bodyContent) === null || _extensionNode$parame2 === void 0 ? void 0 : _extensionNode$parame2.value;
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
var
|
|
32
|
+
var macroParamsOld = (_extensionNode$parame3 = (_extensionNode$parame4 = extensionNode.parameters) === null || _extensionNode$parame4 === void 0 ? void 0 : _extensionNode$parame4.macroParams) !== null && _extensionNode$parame3 !== void 0 ? _extensionNode$parame3 : {};
|
|
33
|
+
var macroParams = (_extensionNode$parame5 = (_extensionNode$parame6 = extensionNode.parameters) === null || _extensionNode$parame6 === void 0 ? void 0 : _extensionNode$parame6.macroParams) !== null && _extensionNode$parame5 !== void 0 ? _extensionNode$parame5 : EMPTY_MACRO_PARAMS;
|
|
34
|
+
var formatParamInline = function formatParamInline(key, param) {
|
|
35
|
+
var _param$value2;
|
|
36
|
+
var value = String((_param$value2 = param === null || param === void 0 ? void 0 : param.value) !== null && _param$value2 !== void 0 ? _param$value2 : '').trim();
|
|
28
37
|
return "".concat(key, " = ").concat(value);
|
|
29
38
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
var memoizedVisibleParams = useMemo(function () {
|
|
40
|
+
return Object.entries(macroParams).filter(function (_ref2) {
|
|
41
|
+
var _ref3 = _slicedToArray(_ref2, 1),
|
|
42
|
+
key = _ref3[0];
|
|
43
|
+
return !key.startsWith('_');
|
|
44
|
+
}).map(function (_ref4) {
|
|
45
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
|
46
|
+
key = _ref5[0],
|
|
47
|
+
param = _ref5[1];
|
|
48
|
+
return formatParam(key, param);
|
|
49
|
+
}).join(' | ');
|
|
50
|
+
}, [macroParams]);
|
|
51
|
+
var visibleParams = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedVisibleParams :
|
|
52
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-computations-in-render -- intentional fallback for experiment off path
|
|
53
|
+
Object.entries(macroParamsOld).filter(function (_ref6) {
|
|
54
|
+
var _ref7 = _slicedToArray(_ref6, 1),
|
|
55
|
+
key = _ref7[0];
|
|
34
56
|
return !key.startsWith('_');
|
|
35
|
-
}).map(function (
|
|
36
|
-
var
|
|
37
|
-
key =
|
|
38
|
-
param =
|
|
39
|
-
return
|
|
57
|
+
}).map(function (_ref8) {
|
|
58
|
+
var _ref9 = _slicedToArray(_ref8, 2),
|
|
59
|
+
key = _ref9[0],
|
|
60
|
+
param = _ref9[1];
|
|
61
|
+
return formatParamInline(key, param);
|
|
40
62
|
}).join(' | ');
|
|
41
63
|
var headerText = visibleParams ? "".concat(intl.formatMessage(messages.unknownMacroHeader, {
|
|
42
64
|
macroTitle: macroTitle
|
|
@@ -50,6 +50,21 @@ export var toolbarInsertBlockMessages = defineMessages({
|
|
|
50
50
|
defaultMessage: 'Image',
|
|
51
51
|
description: 'Shown as a menu item label in the editor insert menu, used to insert an image into the document.'
|
|
52
52
|
},
|
|
53
|
+
aiImageGeneration: {
|
|
54
|
+
id: 'fabric.editor.aiImageGeneration',
|
|
55
|
+
defaultMessage: 'Generate image',
|
|
56
|
+
description: 'Shown as a menu item label in the editor insert menu, used to open a popup for generating an image with AI.'
|
|
57
|
+
},
|
|
58
|
+
aiImageGenerationDescription: {
|
|
59
|
+
id: 'fabric.editor.aiImageGeneration.description',
|
|
60
|
+
defaultMessage: 'Generate an image with AI',
|
|
61
|
+
description: 'Displayed as a description text for the AI image generation option in the editor insert menu.'
|
|
62
|
+
},
|
|
63
|
+
aiImageGenerationPopupAriaLabel: {
|
|
64
|
+
id: 'fabric.editor.aiImageGeneration.popupAriaLabel',
|
|
65
|
+
defaultMessage: 'Generate image with AI',
|
|
66
|
+
description: 'Accessible label announced by screen readers when the AI image generation popup opens.'
|
|
67
|
+
},
|
|
53
68
|
mention: {
|
|
54
69
|
id: 'fabric.editor.mention',
|
|
55
70
|
defaultMessage: 'Mention',
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "114.
|
|
13
|
+
var packageVersion = "114.9.0";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "114.
|
|
24
|
+
var packageVersion = "114.9.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -9,6 +9,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
9
9
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
import React from 'react';
|
|
12
|
+
import { bind } from 'bind-event-listener';
|
|
12
13
|
import createFocusTrap from 'focus-trap';
|
|
13
14
|
import rafSchedule from 'raf-schd';
|
|
14
15
|
import { createPortal, flushSync } from 'react-dom';
|
|
@@ -245,10 +246,44 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
245
246
|
return this.initFocusTrap();
|
|
246
247
|
}
|
|
247
248
|
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Idempotent scroll element setup — tears down any previous listener/observer
|
|
252
|
+
* then attaches to the current scroll parent.
|
|
253
|
+
*/
|
|
254
|
+
}, {
|
|
255
|
+
key: "initScrollElement",
|
|
256
|
+
value: function initScrollElement() {
|
|
257
|
+
var _this$unbindScroll;
|
|
258
|
+
var _this$props = this.props,
|
|
259
|
+
stick = _this$props.stick,
|
|
260
|
+
target = _this$props.target,
|
|
261
|
+
scrollableElement = _this$props.scrollableElement;
|
|
262
|
+
(_this$unbindScroll = this.unbindScroll) === null || _this$unbindScroll === void 0 || _this$unbindScroll.call(this);
|
|
263
|
+
if (this.scrollElement && this.resizeObserver) {
|
|
264
|
+
this.resizeObserver.unobserve(this.scrollElement);
|
|
265
|
+
}
|
|
266
|
+
this.scrollElement = scrollableElement;
|
|
267
|
+
if (stick && !this.scrollElement && target) {
|
|
268
|
+
this.scrollElement = findOverflowScrollParent(target);
|
|
269
|
+
}
|
|
270
|
+
if (this.scrollElement) {
|
|
271
|
+
if (this.resizeObserver) {
|
|
272
|
+
this.resizeObserver.observe(this.scrollElement);
|
|
273
|
+
}
|
|
274
|
+
this.unbindScroll = bind(this.scrollElement, {
|
|
275
|
+
type: 'scroll',
|
|
276
|
+
listener: this.onResize
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}
|
|
248
280
|
}, {
|
|
249
281
|
key: "componentDidUpdate",
|
|
250
282
|
value: function componentDidUpdate(prevProps) {
|
|
251
283
|
this.handleChangedFocusTrapProp(prevProps);
|
|
284
|
+
if (expValEquals('platform_editor_fix_scrolling_popup_position', 'isEnabled', true) && prevProps.scrollableElement !== this.props.scrollableElement) {
|
|
285
|
+
this.initScrollElement();
|
|
286
|
+
}
|
|
252
287
|
if (this.props !== prevProps) {
|
|
253
288
|
this.scheduledUpdatePosition(prevProps);
|
|
254
289
|
}
|
|
@@ -259,16 +294,16 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
259
294
|
// Ignored via go/ees005
|
|
260
295
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
261
296
|
window.addEventListener('resize', this.onResize);
|
|
297
|
+
if (expValEquals('platform_editor_fix_scrolling_popup_position', 'isEnabled', true)) {
|
|
298
|
+
this.initScrollElement();
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
262
301
|
var stick = this.props.stick;
|
|
263
302
|
|
|
264
303
|
// Ignored via go/ees005
|
|
265
304
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
266
305
|
var target = this.props.target;
|
|
267
|
-
|
|
268
|
-
// Resolve the effective scroll parent: prefer the explicitly provided scrollableElement
|
|
269
|
-
// prop over the auto-detected ancestor. Allows product consumers to provide the correct
|
|
270
|
-
// scroll container (e.g. a modal body) when auto-detection can't find it.
|
|
271
|
-
var scrollParentElement = expValEquals('platform_editor_fix_scrolling_popup_position', 'isEnabled', true) ? this.props.scrollableElement || findOverflowScrollParent(target) : findOverflowScrollParent(target);
|
|
306
|
+
var scrollParentElement = findOverflowScrollParent(target);
|
|
272
307
|
if (scrollParentElement && this.resizeObserver) {
|
|
273
308
|
this.resizeObserver.observe(scrollParentElement);
|
|
274
309
|
}
|
|
@@ -286,10 +321,11 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
286
321
|
}, {
|
|
287
322
|
key: "componentWillUnmount",
|
|
288
323
|
value: function componentWillUnmount() {
|
|
289
|
-
var _this$resizeObserver3;
|
|
324
|
+
var _this$unbindScroll2, _this$resizeObserver3;
|
|
290
325
|
// Ignored via go/ees005
|
|
291
326
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
292
327
|
window.removeEventListener('resize', this.onResize);
|
|
328
|
+
(_this$unbindScroll2 = this.unbindScroll) === null || _this$unbindScroll2 === void 0 || _this$unbindScroll2.call(this);
|
|
293
329
|
if (this.scrollElement) {
|
|
294
330
|
// Ignored via go/ees005
|
|
295
331
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -348,9 +384,9 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
348
384
|
}, {
|
|
349
385
|
key: "render",
|
|
350
386
|
value: function render() {
|
|
351
|
-
var _this$
|
|
352
|
-
target = _this$
|
|
353
|
-
mountTo = _this$
|
|
387
|
+
var _this$props2 = this.props,
|
|
388
|
+
target = _this$props2.target,
|
|
389
|
+
mountTo = _this$props2.mountTo;
|
|
354
390
|
var validPosition = this.state.validPosition;
|
|
355
391
|
if (!target || !validPosition) {
|
|
356
392
|
return null;
|
|
@@ -1,60 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
[AI_MENU_SECTION.key]: number;
|
|
4
|
-
[TRANSFORM_MENU_SECTION.key]: number;
|
|
5
|
-
[BLOCK_ACTIONS_MENU_SECTION.key]: number;
|
|
6
|
-
[BLOCK_ACTIONS_COPY_MENU_SECTION.key]: number;
|
|
7
|
-
[POSITION_MENU_SECTION.key]: number;
|
|
8
|
-
[DELETE_MENU_SECTION.key]: number;
|
|
9
|
-
};
|
|
10
|
-
export declare const AI_MENU_SECTION_RANK: {
|
|
11
|
-
[AI_ASK_ROVO_MENU_ITEM.key]: number;
|
|
12
|
-
};
|
|
1
|
+
export declare const MAIN_BLOCK_MENU_SECTION_RANK: {};
|
|
2
|
+
export declare const AI_MENU_SECTION_RANK: {};
|
|
13
3
|
export declare const TRANSFORM_MENU_SECTION_RANK: Record<string, number>;
|
|
14
|
-
export declare const TRANSFORM_SUGGESTED_MENU_SECTION_RANK: {
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
export declare const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
[TRANSFORM_STRUCTURE_MENU_SECTION.key]: number;
|
|
21
|
-
[TRANSFORM_HEADINGS_MENU_SECTION.key]: number;
|
|
22
|
-
[TRANSFORM_CLEAR_MENU_SECTION.key]: number;
|
|
23
|
-
};
|
|
24
|
-
export declare const TRANSFORM_CREATE_MENU_SECTION_RANK: {
|
|
25
|
-
[TRANSFORM_DEFAULT_EXTENSION_SLOT_MENU_ITEM.key]: number;
|
|
26
|
-
};
|
|
27
|
-
export declare const TRANSFORM_HEADINGS_MENU_SECTION_RANK: {
|
|
28
|
-
[TRANSFORM_HEADINGS_H1_MENU_ITEM.key]: number;
|
|
29
|
-
[TRANSFORM_HEADINGS_H2_MENU_ITEM.key]: number;
|
|
30
|
-
[TRANSFORM_HEADINGS_H3_MENU_ITEM.key]: number;
|
|
31
|
-
[TRANSFORM_HEADINGS_H4_MENU_ITEM.key]: number;
|
|
32
|
-
[TRANSFORM_HEADINGS_H5_MENU_ITEM.key]: number;
|
|
33
|
-
[TRANSFORM_HEADINGS_H6_MENU_ITEM.key]: number;
|
|
34
|
-
};
|
|
35
|
-
export declare const TRANSFORM_STRUCTURE_MENU_SECTION_RANK: {
|
|
36
|
-
[TRANSFORM_STRUCTURE_BULLETED_LIST_MENU_ITEM.key]: number;
|
|
37
|
-
[TRANSFORM_STRUCTURE_TASK_LIST_MENU_ITEM.key]: number;
|
|
38
|
-
[TRANSFORM_STRUCTURE_NUMBERED_LIST_MENU_ITEM.key]: number;
|
|
39
|
-
[TRANSFORM_STRUCTURE_CODE_BLOCK_MENU_ITEM.key]: number;
|
|
40
|
-
[TRANSFORM_STRUCTURE_PANEL_MENU_ITEM.key]: number;
|
|
41
|
-
[TRANSFORM_STRUCTURE_EXPAND_MENU_ITEM.key]: number;
|
|
42
|
-
[TRANSFORM_STRUCTURE_LAYOUT_MENU_ITEM.key]: number;
|
|
43
|
-
[TRANSFORM_STRUCTURE_QUOTE_MENU_ITEM.key]: number;
|
|
44
|
-
[TRANSFORM_STRUCTURE_DECISION_MENU_ITEM.key]: number;
|
|
45
|
-
[TRANSFORM_STRUCTURE_PARAGRAPH_MENU_ITEM.key]: number;
|
|
46
|
-
};
|
|
47
|
-
export declare const TRANSFORM_CLEAR_MENU_SECTION_RANK: {
|
|
48
|
-
[TRANSFORM_CLEAR_MENU_ITEM.key]: number;
|
|
49
|
-
};
|
|
4
|
+
export declare const TRANSFORM_SUGGESTED_MENU_SECTION_RANK: {};
|
|
5
|
+
export declare const TRANSFORM_MENU_ITEM_RANK: {};
|
|
6
|
+
export declare const TRANSFORM_CREATE_MENU_SECTION_RANK: {};
|
|
7
|
+
export declare const TRANSFORM_HEADINGS_MENU_SECTION_RANK: {};
|
|
8
|
+
export declare const TRANSFORM_STRUCTURE_MENU_SECTION_RANK: {};
|
|
9
|
+
export declare const TRANSFORM_CLEAR_MENU_SECTION_RANK: {};
|
|
50
10
|
export declare const BLOCK_ACTIONS_MENU_SECTION_RANK: Record<string, number>;
|
|
51
|
-
export declare const BLOCK_ACTIONS_COPY_MENU_SECTION_RANK: {
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
export declare const POSITION_MENU_SECTION_RANK: {
|
|
55
|
-
[POSITION_MOVE_UP_MENU_ITEM.key]: number;
|
|
56
|
-
[POSITION_MOVE_DOWN_MENU_ITEM.key]: number;
|
|
57
|
-
};
|
|
58
|
-
export declare const DELETE_MENU_SECTION_RANK: {
|
|
59
|
-
[DELETE_MENU_ITEM.key]: number;
|
|
60
|
-
};
|
|
11
|
+
export declare const BLOCK_ACTIONS_COPY_MENU_SECTION_RANK: {};
|
|
12
|
+
export declare const POSITION_MENU_SECTION_RANK: {};
|
|
13
|
+
export declare const DELETE_MENU_SECTION_RANK: {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
-
import type
|
|
5
|
+
import { type CSSProperties } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import type { ExtensionsPluginInjectionAPI } from '../../types';
|
|
8
8
|
export declare const getShouldShowBodiedMacroLabel: (isBodiedMacro: boolean | undefined, isNodeHovered: boolean | undefined, showLivePagesBodiedMacrosRendererView: boolean | undefined, showBodiedExtensionRendererView: boolean | undefined, showUpdatedLivePages1PBodiedExtensionUI: boolean | undefined) => boolean | undefined;
|