@atlaskit/editor-common 75.3.1 → 75.5.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 +20 -0
- package/dist/cjs/analytics/index.js +6 -0
- package/dist/cjs/analytics/types/index.js +6 -0
- package/dist/cjs/analytics/types/table-events.js +16 -3
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/preset/builder.js +48 -48
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +6 -6
- package/dist/cjs/ui-menu/Dropdown/index.js +3 -2
- package/dist/cjs/ui-menu/DropdownMenu/index.js +2 -2
- package/dist/cjs/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +8 -8
- package/dist/cjs/ui-menu/ToolbarButton/index.js +1 -1
- package/dist/cjs/ui-react/with-react-editor-view-outer-listeners.js +4 -5
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/analytics/types/index.js +1 -1
- package/dist/es2019/analytics/types/table-events.js +17 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/preset/builder.js +48 -48
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +6 -6
- package/dist/es2019/ui-menu/Dropdown/index.js +3 -2
- package/dist/es2019/ui-menu/DropdownMenu/index.js +3 -2
- package/dist/es2019/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +8 -8
- package/dist/es2019/ui-menu/ToolbarButton/index.js +1 -1
- package/dist/es2019/ui-react/with-react-editor-view-outer-listeners.js +4 -5
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/analytics/types/index.js +1 -1
- package/dist/esm/analytics/types/table-events.js +17 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/preset/builder.js +48 -48
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +6 -6
- package/dist/esm/ui-menu/Dropdown/index.js +3 -2
- package/dist/esm/ui-menu/DropdownMenu/index.js +3 -2
- package/dist/esm/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +8 -8
- package/dist/esm/ui-menu/ToolbarButton/index.js +1 -1
- package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +4 -5
- package/dist/types/analytics/index.d.ts +1 -1
- package/dist/types/analytics/types/index.d.ts +1 -1
- package/dist/types/analytics/types/inline-comment-events.d.ts +2 -2
- package/dist/types/analytics/types/table-events.d.ts +26 -2
- package/dist/types/types/floating-toolbar.d.ts +4 -3
- package/dist/types/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.d.ts +1 -1
- package/dist/types/ui-menu/Dropdown/index.d.ts +3 -2
- package/dist/types/ui-menu/DropdownMenu/index.d.ts +1 -2
- package/dist/types/ui-menu/ToolbarButton/index.d.ts +3 -3
- package/dist/types-ts4.5/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/index.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/inline-comment-events.d.ts +2 -2
- package/dist/types-ts4.5/analytics/types/table-events.d.ts +26 -2
- package/dist/types-ts4.5/types/floating-toolbar.d.ts +4 -3
- package/dist/types-ts4.5/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.d.ts +1 -1
- package/dist/types-ts4.5/ui-menu/Dropdown/index.d.ts +3 -2
- package/dist/types-ts4.5/ui-menu/DropdownMenu/index.d.ts +1 -2
- package/dist/types-ts4.5/ui-menu/ToolbarButton/index.d.ts +3 -3
- package/package.json +1 -1
|
@@ -56,10 +56,11 @@ export class Dropdown extends PureComponent {
|
|
|
56
56
|
fitWidth,
|
|
57
57
|
zIndex,
|
|
58
58
|
arrowKeyNavigationProviderOptions,
|
|
59
|
-
dropdownListId
|
|
59
|
+
dropdownListId,
|
|
60
|
+
alignDropdownWithParentElement
|
|
60
61
|
} = this.props;
|
|
61
62
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
62
|
-
target: target,
|
|
63
|
+
target: alignDropdownWithParentElement ? target === null || target === void 0 ? void 0 : target.closest("[data-testid='editor-floating-toolbar'") : target,
|
|
63
64
|
mountTo: mountTo,
|
|
64
65
|
boundariesElement: boundariesElement,
|
|
65
66
|
scrollableElement: scrollableElement,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
+
|
|
4
5
|
import React, { PureComponent, useContext } from 'react';
|
|
5
6
|
import { css, jsx } from '@emotion/react';
|
|
6
7
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
@@ -325,8 +326,8 @@ export const DropdownMenuWithKeyboardNavigation = /*#__PURE__*/React.memo(({
|
|
|
325
326
|
...props
|
|
326
327
|
}) => {
|
|
327
328
|
const keyDownHandlerContext = useContext(KeyDownHandlerContext);
|
|
328
|
-
//This context is to handle the tab, Arrow Right/Left key events for dropdown.
|
|
329
|
-
//Default context has the void callbacks for above key events
|
|
329
|
+
// This context is to handle the tab, Arrow Right/Left key events for dropdown.
|
|
330
|
+
// Default context has the void callbacks for above key events
|
|
330
331
|
return jsx(DropdownMenuWrapper, _extends({
|
|
331
332
|
arrowKeyNavigationProviderOptions: {
|
|
332
333
|
...props.arrowKeyNavigationProviderOptions,
|
|
@@ -109,15 +109,15 @@ export const ToolbarArrowKeyNavigationProvider = ({
|
|
|
109
109
|
*/
|
|
110
110
|
const handleKeyDown = event => {
|
|
111
111
|
var _document$querySelect, _document$querySelect2, _wrapperRef$current;
|
|
112
|
-
//To trap the focus inside the horizontal toolbar for left and right arrow keys
|
|
112
|
+
// To trap the focus inside the horizontal toolbar for left and right arrow keys
|
|
113
113
|
const targetElement = event.target;
|
|
114
114
|
|
|
115
|
-
//To filter out the events outside the child component
|
|
115
|
+
// To filter out the events outside the child component
|
|
116
116
|
if (!targetElement.closest(`${childComponentSelector}`)) {
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
//The key events are from child components such as dropdown menus / popups are ignored
|
|
120
|
+
// The key events are from child components such as dropdown menus / popups are ignored
|
|
121
121
|
if ((_document$querySelect = document.querySelector('[data-role="droplistContent"], [data-test-id="color-picker-menu"], [data-emoji-picker-container="true"]')) !== null && _document$querySelect !== void 0 && _document$querySelect.contains(targetElement) || (_document$querySelect2 = document.querySelector('[data-test-id="color-picker-menu"]')) !== null && _document$querySelect2 !== void 0 && _document$querySelect2.contains(targetElement) || event.key === 'ArrowUp' || event.key === 'ArrowDown' || disableArrowKeyNavigation) {
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
@@ -131,15 +131,15 @@ export const ToolbarArrowKeyNavigationProvider = ({
|
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
//This is kind of hack to reset the current focused toolbar item
|
|
135
|
-
//to handle some use cases such as Tab in/out of main toolbar
|
|
134
|
+
// This is kind of hack to reset the current focused toolbar item
|
|
135
|
+
// to handle some use cases such as Tab in/out of main toolbar
|
|
136
136
|
if (!((_wrapperRef$current = wrapperRef.current) !== null && _wrapperRef$current !== void 0 && _wrapperRef$current.contains(targetElement))) {
|
|
137
137
|
selectedItemIndex.current = -1;
|
|
138
138
|
} else {
|
|
139
139
|
selectedItemIndex.current = filteredFocusableElements.indexOf(targetElement) > -1 ? filteredFocusableElements.indexOf(targetElement) : selectedItemIndex.current;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
//do not scroll to focused element for sticky toolbar when navigating with arrows to avoid unnesessary scroll jump
|
|
142
|
+
// do not scroll to focused element for sticky toolbar when navigating with arrows to avoid unnesessary scroll jump
|
|
143
143
|
const allowScrollToElement = !(editorAppearance === 'comment' && !!useStickyToolbar);
|
|
144
144
|
switch (event.key) {
|
|
145
145
|
case 'ArrowRight':
|
|
@@ -162,7 +162,7 @@ export const ToolbarArrowKeyNavigationProvider = ({
|
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
164
|
const globalKeyDownHandler = event => {
|
|
165
|
-
//To focus the first element in the toolbar
|
|
165
|
+
// To focus the first element in the toolbar
|
|
166
166
|
if (isShortcutToFocusToolbar(event)) {
|
|
167
167
|
var _filteredFocusableEle4, _filteredFocusableEle5;
|
|
168
168
|
const filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
@@ -205,7 +205,7 @@ function getFocusableElements(rootNode) {
|
|
|
205
205
|
return Array.from(focusableModalElements);
|
|
206
206
|
}
|
|
207
207
|
function getFilteredFocusableElements(rootNode) {
|
|
208
|
-
//The focusable elements from child components such as dropdown menus / popups are ignored
|
|
208
|
+
// The focusable elements from child components such as dropdown menus / popups are ignored
|
|
209
209
|
return getFocusableElements(rootNode).filter(elm => {
|
|
210
210
|
const style = window.getComputedStyle(elm);
|
|
211
211
|
// ignore invisible element to avoid losing focus
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// This file is copied to `packages/editor/editor-plugin-ai/src/ui/components/AtlassianIntelligenceToolbarButton/ToolbarButton/index.tsx`
|
|
2
2
|
// If you make any change here, copy it to above file as well
|
|
3
|
-
//
|
|
3
|
+
// and notify about the change in #team-fc-editor-ai-dev channel.
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
@@ -17,7 +17,7 @@ class WithOutsideClick extends PureComponent {
|
|
|
17
17
|
if (this.props.handleClickOutside) {
|
|
18
18
|
var _this$props$editorVie;
|
|
19
19
|
this.props.handleClickOutside(evt);
|
|
20
|
-
//When the menus are closed by clicking outside the focus is set on editor.
|
|
20
|
+
// When the menus are closed by clicking outside the focus is set on editor.
|
|
21
21
|
if (!((_this$props$editorVie = this.props.editorView) !== null && _this$props$editorVie !== void 0 && _this$props$editorVie.hasFocus())) {
|
|
22
22
|
var _this$props$editorVie2;
|
|
23
23
|
(_this$props$editorVie2 = this.props.editorView) === null || _this$props$editorVie2 === void 0 ? void 0 : _this$props$editorVie2.focus();
|
|
@@ -33,12 +33,12 @@ class WithOutsideClick extends PureComponent {
|
|
|
33
33
|
evt.preventDefault();
|
|
34
34
|
evt.stopPropagation();
|
|
35
35
|
this.props.handleEscapeKeydown(evt);
|
|
36
|
-
//on 'Esc', Focus is handled in 'handleEscapeKeydown'.
|
|
36
|
+
// on 'Esc', Focus is handled in 'handleEscapeKeydown'.
|
|
37
37
|
return false;
|
|
38
38
|
} else if (evt.code === 'Enter' && this.props.handleEnterKeydown) {
|
|
39
39
|
this.props.handleEnterKeydown(evt);
|
|
40
40
|
} else if (evt.code === 'Tab' && this.props.handleEscapeKeydown && this.props.closeOnTab) {
|
|
41
|
-
//The menus should be closed when the tab is pressed as it takes the focus out of the menu
|
|
41
|
+
// The menus should be closed when the tab is pressed as it takes the focus out of the menu
|
|
42
42
|
this.props.handleEscapeKeydown(evt);
|
|
43
43
|
}
|
|
44
44
|
});
|
|
@@ -49,8 +49,7 @@ class WithOutsideClick extends PureComponent {
|
|
|
49
49
|
}
|
|
50
50
|
if (this.props.handleEscapeKeydown) {
|
|
51
51
|
var _this$props$editorRef;
|
|
52
|
-
//
|
|
53
|
-
//Attached event to the menu so that 'ESC' events from the opened menu also will be handled.
|
|
52
|
+
// Attached event to the menu so that 'ESC' events from the opened menu also will be handled.
|
|
54
53
|
(((_this$props$editorRef = this.props.editorRef) === null || _this$props$editorRef === void 0 ? void 0 : _this$props$editorRef.current) || this.props.targetRef || document).addEventListener('keydown', this.handleKeydown, false);
|
|
55
54
|
}
|
|
56
55
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT } from './types';
|
|
1
|
+
export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT } from './types';
|
|
2
2
|
export { fireAnalyticsEvent } from './fire-analytics-event';
|
|
3
3
|
export { getAnalyticsEventsFromTransaction } from './utils';
|
|
4
4
|
export { buildEditLinkPayload, buildVisitedLinkPayload, buildOpenedSettingsPayload, unlinkPayload } from './linking-utils';
|
|
@@ -3,7 +3,7 @@ export { INDENT_DIRECTION, INDENT_TYPE } from './format-events';
|
|
|
3
3
|
export { PUNC, SYMBOL } from './substitute-events';
|
|
4
4
|
export { BROWSER_FREEZE_INTERACTION_TYPE, FULL_WIDTH_MODE, MODE, PLATFORMS } from './general-events';
|
|
5
5
|
export { LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, USER_CONTEXT } from './insert-events';
|
|
6
|
-
export { TABLE_ACTION, TABLE_BREAKOUT } from './table-events';
|
|
6
|
+
export { TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER } from './table-events';
|
|
7
7
|
export { PasteContents, PasteSources, PasteTypes } from './paste-events';
|
|
8
8
|
export { DELETE_DIRECTION, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS } from './list-events';
|
|
9
9
|
export { GAP_CURSOR_POSITION, TARGET_SELECTION_SOURCE } from './extension-events';
|
|
@@ -23,6 +23,8 @@ export var TABLE_ACTION = /*#__PURE__*/function (TABLE_ACTION) {
|
|
|
23
23
|
TABLE_ACTION["FIXED"] = "fixed";
|
|
24
24
|
TABLE_ACTION["RESIZED"] = "resized";
|
|
25
25
|
TABLE_ACTION["RESIZE_PERF_SAMPLING"] = "resizePerfSampling";
|
|
26
|
+
TABLE_ACTION["OVERFLOW_CHANGED"] = "overflowChanged";
|
|
27
|
+
TABLE_ACTION["INITIAL_OVERFLOW_CAPTURED"] = "initialOverflowCaptured";
|
|
26
28
|
return TABLE_ACTION;
|
|
27
29
|
}({});
|
|
28
30
|
export var TABLE_BREAKOUT = /*#__PURE__*/function (TABLE_BREAKOUT) {
|
|
@@ -33,7 +35,22 @@ export var TABLE_BREAKOUT = /*#__PURE__*/function (TABLE_BREAKOUT) {
|
|
|
33
35
|
}({});
|
|
34
36
|
//#endregion
|
|
35
37
|
|
|
38
|
+
export var TABLE_OVERFLOW_CHANGE_TRIGGER = /*#__PURE__*/function (TABLE_OVERFLOW_CHANGE_TRIGGER) {
|
|
39
|
+
TABLE_OVERFLOW_CHANGE_TRIGGER["EXTERNAL"] = "external";
|
|
40
|
+
TABLE_OVERFLOW_CHANGE_TRIGGER["ADDED_COLUMN"] = "addedColumn";
|
|
41
|
+
TABLE_OVERFLOW_CHANGE_TRIGGER["DELETED_COLUMN"] = "deletedColumn";
|
|
42
|
+
TABLE_OVERFLOW_CHANGE_TRIGGER["RESIZED_COLUMN"] = "resizedColumn";
|
|
43
|
+
TABLE_OVERFLOW_CHANGE_TRIGGER["ENABLED_NUMBERED_COLUMN"] = "enabledNumberedColumn";
|
|
44
|
+
TABLE_OVERFLOW_CHANGE_TRIGGER["DISABLED_NUMBERED_COLUMN"] = "disabledNumberedColumn";
|
|
45
|
+
TABLE_OVERFLOW_CHANGE_TRIGGER["DISTRIBUTED_COLUMNS"] = "distributedColumnsWidths";
|
|
46
|
+
TABLE_OVERFLOW_CHANGE_TRIGGER["RESIZED"] = "resizedTable";
|
|
47
|
+
return TABLE_OVERFLOW_CHANGE_TRIGGER;
|
|
48
|
+
}({});
|
|
49
|
+
|
|
36
50
|
//#region Type Helpers
|
|
51
|
+
|
|
37
52
|
//#endregion
|
|
53
|
+
|
|
38
54
|
//#region Analytic Event Payloads
|
|
55
|
+
|
|
39
56
|
//#endregion
|
|
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
8
8
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
9
|
-
var packageVersion = "75.
|
|
9
|
+
var packageVersion = "75.5.0";
|
|
10
10
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
11
11
|
// Remove URL as it has UGC
|
|
12
12
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -27,21 +27,21 @@ export var EditorPresetBuilder = /*#__PURE__*/function () {
|
|
|
27
27
|
nextOrTuple].concat(_toConsumableArray(this.data)));
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
//hasPlugin<Plugin extends NextEditorPlugin<any, any>>(
|
|
31
|
-
//
|
|
32
|
-
//): this is TryCastEditorPresetBuilderByCheckingPlugins<this, Plugin> {
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
30
|
+
// hasPlugin<Plugin extends NextEditorPlugin<any, any>>(
|
|
31
|
+
// pluginToAdd: Plugin,
|
|
32
|
+
// ): this is TryCastEditorPresetBuilderByCheckingPlugins<this, Plugin> {
|
|
33
|
+
// const hasPluginQueryExists = this.data.find((pluginEntry) => {
|
|
34
|
+
// const pluginFunction: NextEditorPlugin<any, any> = !Array.isArray(
|
|
35
|
+
// pluginEntry,
|
|
36
|
+
// )
|
|
37
|
+
// ? pluginEntry
|
|
38
|
+
// : pluginEntry[0];
|
|
39
39
|
|
|
40
|
-
//
|
|
41
|
-
//
|
|
40
|
+
// return pluginFunction === pluginToAdd;
|
|
41
|
+
// });
|
|
42
42
|
|
|
43
|
-
//
|
|
44
|
-
//}
|
|
43
|
+
// return Boolean(hasPluginQueryExists);
|
|
44
|
+
// }
|
|
45
45
|
}, {
|
|
46
46
|
key: "maybeAdd",
|
|
47
47
|
value: function maybeAdd(pluginToAdd, add) {
|
|
@@ -138,41 +138,41 @@ export var EditorPresetBuilder = /*#__PURE__*/function () {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
// TODO: ED-17023 - Bring back type safety to the EditorPresetBuilder.add preset
|
|
141
|
-
//import type {
|
|
142
|
-
//
|
|
143
|
-
//} from '../types/next-editor-plugin';
|
|
144
|
-
//type TryCastEditorPresetBuilderByCheckingDependencies<MaybeEditorPresetBuilder, Plugin> =
|
|
145
|
-
//
|
|
146
|
-
//
|
|
147
|
-
//
|
|
148
|
-
//
|
|
149
|
-
//
|
|
150
|
-
//
|
|
151
|
-
//
|
|
152
|
-
//
|
|
153
|
-
//
|
|
154
|
-
//
|
|
155
|
-
//maybeAdd<
|
|
156
|
-
//
|
|
157
|
-
//
|
|
158
|
-
//
|
|
159
|
-
//
|
|
160
|
-
//
|
|
161
|
-
//
|
|
162
|
-
//
|
|
163
|
-
|
|
164
|
-
//
|
|
165
|
-
//
|
|
166
|
-
//
|
|
167
|
-
//
|
|
168
|
-
//
|
|
169
|
-
//): MaybeEditorPresetBuilder | this {
|
|
170
|
-
//
|
|
171
|
-
//
|
|
172
|
-
//
|
|
173
|
-
//
|
|
174
|
-
//
|
|
175
|
-
//}
|
|
141
|
+
// import type {
|
|
142
|
+
// ExtractPluginDependencies,
|
|
143
|
+
// } from '../types/next-editor-plugin';
|
|
144
|
+
// type TryCastEditorPresetBuilderByCheckingDependencies<MaybeEditorPresetBuilder, Plugin> =
|
|
145
|
+
// MaybeEditorPresetBuilder extends EditorPresetBuilder<any, infer StackPlugins>
|
|
146
|
+
// ? Plugin extends NextEditorPlugin<any, any>
|
|
147
|
+
// ? ExtractPluginDependencies<Plugin>[number] extends StackPlugins[number]
|
|
148
|
+
// ? MaybeEditorPresetBuilder
|
|
149
|
+
// : never
|
|
150
|
+
// : never
|
|
151
|
+
// : never;
|
|
152
|
+
// Because how our plugins are added in the preset, we can't use the type safe system
|
|
153
|
+
// in the EditorPresetBuilder.
|
|
154
|
+
// TODO: ED-17023 - Bring back type safety to the EditorPresetBuilder.add preset
|
|
155
|
+
// maybeAdd<
|
|
156
|
+
// MaybePlugin extends NextEditorPlugin<any, any>,
|
|
157
|
+
// MaybePluginNames extends string[],
|
|
158
|
+
// MaybeStackPlugins extends AllEditorPresetPluginTypes[],
|
|
159
|
+
// MaybeEditorPresetBuilder extends EditorPresetBuilder<
|
|
160
|
+
// MaybePluginNames,
|
|
161
|
+
// MaybeStackPlugins
|
|
162
|
+
// >,
|
|
163
|
+
// >(
|
|
164
|
+
// pluginToAdd: MaybePlugin,
|
|
165
|
+
// add: (
|
|
166
|
+
// pluginToAdd: MaybePlugin,
|
|
167
|
+
// maybeEditorPresetBuilder: TryCastEditorPresetBuilderByCheckingDependencies<this, MaybePlugin>,
|
|
168
|
+
// ) => MaybeEditorPresetBuilder,
|
|
169
|
+
// ): MaybeEditorPresetBuilder | this {
|
|
170
|
+
// return add(
|
|
171
|
+
// pluginToAdd,
|
|
172
|
+
// // @ts-ignore
|
|
173
|
+
// this as any,
|
|
174
|
+
// );
|
|
175
|
+
// }
|
|
176
176
|
}]);
|
|
177
177
|
return EditorPresetBuilder;
|
|
178
178
|
}();
|
|
@@ -19,7 +19,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
19
19
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
20
20
|
import Layer from '../Layer';
|
|
21
21
|
var packageName = "@atlaskit/editor-common";
|
|
22
|
-
var packageVersion = "75.
|
|
22
|
+
var packageVersion = "75.5.0";
|
|
23
23
|
var halfFocusRing = 1;
|
|
24
24
|
var dropOffset = '0, 8';
|
|
25
25
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -68,14 +68,14 @@ export var MenuArrowKeyNavigationProvider = function MenuArrowKeyNavigationProvi
|
|
|
68
68
|
var _wrapperRef$current;
|
|
69
69
|
var targetElement = event.target;
|
|
70
70
|
|
|
71
|
-
//Tab key on menu items can be handled in the parent components of dropdown menus with KeydownHandlerContext
|
|
71
|
+
// Tab key on menu items can be handled in the parent components of dropdown menus with KeydownHandlerContext
|
|
72
72
|
if (event.key === 'Tab' && closeOnTab) {
|
|
73
73
|
handleClose(event);
|
|
74
74
|
keyDownHandlerContext === null || keyDownHandlerContext === void 0 ? void 0 : keyDownHandlerContext.handleTab();
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
//To trap the focus inside the toolbar using left and right arrow keys
|
|
78
|
+
// To trap the focus inside the toolbar using left and right arrow keys
|
|
79
79
|
var focusableElements = getFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
80
80
|
if (!focusableElements || (focusableElements === null || focusableElements === void 0 ? void 0 : focusableElements.length) === 0) {
|
|
81
81
|
return;
|
|
@@ -101,10 +101,10 @@ export var MenuArrowKeyNavigationProvider = function MenuArrowKeyNavigationProvi
|
|
|
101
101
|
break;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
//ArrowLeft/Right on the menu should close the menus
|
|
105
|
-
//then logic to retain the focus can be handled in the parent components with KeydownHandlerContext
|
|
104
|
+
// ArrowLeft/Right on the menu should close the menus
|
|
105
|
+
// then logic to retain the focus can be handled in the parent components with KeydownHandlerContext
|
|
106
106
|
case 'ArrowLeft':
|
|
107
|
-
//Filter out the events from outside the menu
|
|
107
|
+
// Filter out the events from outside the menu
|
|
108
108
|
if (!targetElement.closest('.custom-key-handler-wrapper')) {
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
@@ -114,7 +114,7 @@ export var MenuArrowKeyNavigationProvider = function MenuArrowKeyNavigationProvi
|
|
|
114
114
|
}
|
|
115
115
|
break;
|
|
116
116
|
case 'ArrowRight':
|
|
117
|
-
//Filter out the events from outside the menu
|
|
117
|
+
// Filter out the events from outside the menu
|
|
118
118
|
if (!targetElement.closest('.custom-key-handler-wrapper')) {
|
|
119
119
|
return;
|
|
120
120
|
}
|
|
@@ -70,9 +70,10 @@ export var Dropdown = /*#__PURE__*/function (_PureComponent) {
|
|
|
70
70
|
fitWidth = _this$props.fitWidth,
|
|
71
71
|
zIndex = _this$props.zIndex,
|
|
72
72
|
arrowKeyNavigationProviderOptions = _this$props.arrowKeyNavigationProviderOptions,
|
|
73
|
-
dropdownListId = _this$props.dropdownListId
|
|
73
|
+
dropdownListId = _this$props.dropdownListId,
|
|
74
|
+
alignDropdownWithParentElement = _this$props.alignDropdownWithParentElement;
|
|
74
75
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
75
|
-
target: target,
|
|
76
|
+
target: alignDropdownWithParentElement ? target === null || target === void 0 ? void 0 : target.closest("[data-testid='editor-floating-toolbar'") : target,
|
|
76
77
|
mountTo: mountTo,
|
|
77
78
|
boundariesElement: boundariesElement,
|
|
78
79
|
scrollableElement: scrollableElement,
|
|
@@ -17,6 +17,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
17
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
18
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
19
19
|
/** @jsx jsx */
|
|
20
|
+
|
|
20
21
|
import React, { PureComponent, useContext } from 'react';
|
|
21
22
|
import { css, jsx } from '@emotion/react';
|
|
22
23
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
@@ -323,8 +324,8 @@ function DropdownMenuItem(_ref) {
|
|
|
323
324
|
export var DropdownMenuWithKeyboardNavigation = /*#__PURE__*/React.memo(function (_ref2) {
|
|
324
325
|
var props = _extends({}, (_objectDestructuringEmpty(_ref2), _ref2));
|
|
325
326
|
var keyDownHandlerContext = useContext(KeyDownHandlerContext);
|
|
326
|
-
//This context is to handle the tab, Arrow Right/Left key events for dropdown.
|
|
327
|
-
//Default context has the void callbacks for above key events
|
|
327
|
+
// This context is to handle the tab, Arrow Right/Left key events for dropdown.
|
|
328
|
+
// Default context has the void callbacks for above key events
|
|
328
329
|
return jsx(DropdownMenuWrapper, _extends({
|
|
329
330
|
arrowKeyNavigationProviderOptions: _objectSpread(_objectSpread({}, props.arrowKeyNavigationProviderOptions), {}, {
|
|
330
331
|
keyDownHandlerContext: keyDownHandlerContext
|
|
@@ -105,15 +105,15 @@ export var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigatio
|
|
|
105
105
|
*/
|
|
106
106
|
var handleKeyDown = function handleKeyDown(event) {
|
|
107
107
|
var _document$querySelect, _document$querySelect2, _wrapperRef$current;
|
|
108
|
-
//To trap the focus inside the horizontal toolbar for left and right arrow keys
|
|
108
|
+
// To trap the focus inside the horizontal toolbar for left and right arrow keys
|
|
109
109
|
var targetElement = event.target;
|
|
110
110
|
|
|
111
|
-
//To filter out the events outside the child component
|
|
111
|
+
// To filter out the events outside the child component
|
|
112
112
|
if (!targetElement.closest("".concat(childComponentSelector))) {
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
//The key events are from child components such as dropdown menus / popups are ignored
|
|
116
|
+
// The key events are from child components such as dropdown menus / popups are ignored
|
|
117
117
|
if ((_document$querySelect = document.querySelector('[data-role="droplistContent"], [data-test-id="color-picker-menu"], [data-emoji-picker-container="true"]')) !== null && _document$querySelect !== void 0 && _document$querySelect.contains(targetElement) || (_document$querySelect2 = document.querySelector('[data-test-id="color-picker-menu"]')) !== null && _document$querySelect2 !== void 0 && _document$querySelect2.contains(targetElement) || event.key === 'ArrowUp' || event.key === 'ArrowDown' || disableArrowKeyNavigation) {
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
@@ -127,15 +127,15 @@ export var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigatio
|
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
//This is kind of hack to reset the current focused toolbar item
|
|
131
|
-
//to handle some use cases such as Tab in/out of main toolbar
|
|
130
|
+
// This is kind of hack to reset the current focused toolbar item
|
|
131
|
+
// to handle some use cases such as Tab in/out of main toolbar
|
|
132
132
|
if (!((_wrapperRef$current = wrapperRef.current) !== null && _wrapperRef$current !== void 0 && _wrapperRef$current.contains(targetElement))) {
|
|
133
133
|
selectedItemIndex.current = -1;
|
|
134
134
|
} else {
|
|
135
135
|
selectedItemIndex.current = filteredFocusableElements.indexOf(targetElement) > -1 ? filteredFocusableElements.indexOf(targetElement) : selectedItemIndex.current;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
//do not scroll to focused element for sticky toolbar when navigating with arrows to avoid unnesessary scroll jump
|
|
138
|
+
// do not scroll to focused element for sticky toolbar when navigating with arrows to avoid unnesessary scroll jump
|
|
139
139
|
var allowScrollToElement = !(editorAppearance === 'comment' && !!useStickyToolbar);
|
|
140
140
|
switch (event.key) {
|
|
141
141
|
case 'ArrowRight':
|
|
@@ -158,7 +158,7 @@ export var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigatio
|
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
160
|
var globalKeyDownHandler = function globalKeyDownHandler(event) {
|
|
161
|
-
//To focus the first element in the toolbar
|
|
161
|
+
// To focus the first element in the toolbar
|
|
162
162
|
if (isShortcutToFocusToolbar(event)) {
|
|
163
163
|
var _filteredFocusableEle4, _filteredFocusableEle5;
|
|
164
164
|
var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
@@ -201,7 +201,7 @@ function getFocusableElements(rootNode) {
|
|
|
201
201
|
return Array.from(focusableModalElements);
|
|
202
202
|
}
|
|
203
203
|
function getFilteredFocusableElements(rootNode) {
|
|
204
|
-
//The focusable elements from child components such as dropdown menus / popups are ignored
|
|
204
|
+
// The focusable elements from child components such as dropdown menus / popups are ignored
|
|
205
205
|
return getFocusableElements(rootNode).filter(function (elm) {
|
|
206
206
|
var style = window.getComputedStyle(elm);
|
|
207
207
|
// ignore invisible element to avoid losing focus
|
|
@@ -5,7 +5,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
// This file is copied to `packages/editor/editor-plugin-ai/src/ui/components/AtlassianIntelligenceToolbarButton/ToolbarButton/index.tsx`
|
|
7
7
|
// If you make any change here, copy it to above file as well
|
|
8
|
-
//
|
|
8
|
+
// and notify about the change in #team-fc-editor-ai-dev channel.
|
|
9
9
|
/** @jsx jsx */
|
|
10
10
|
import React, { useCallback } from 'react';
|
|
11
11
|
import { css, jsx } from '@emotion/react';
|
|
@@ -33,7 +33,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
|
|
|
33
33
|
if (_this.props.handleClickOutside) {
|
|
34
34
|
var _this$props$editorVie;
|
|
35
35
|
_this.props.handleClickOutside(evt);
|
|
36
|
-
//When the menus are closed by clicking outside the focus is set on editor.
|
|
36
|
+
// When the menus are closed by clicking outside the focus is set on editor.
|
|
37
37
|
if (!((_this$props$editorVie = _this.props.editorView) !== null && _this$props$editorVie !== void 0 && _this$props$editorVie.hasFocus())) {
|
|
38
38
|
var _this$props$editorVie2;
|
|
39
39
|
(_this$props$editorVie2 = _this.props.editorView) === null || _this$props$editorVie2 === void 0 ? void 0 : _this$props$editorVie2.focus();
|
|
@@ -49,12 +49,12 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
|
|
|
49
49
|
evt.preventDefault();
|
|
50
50
|
evt.stopPropagation();
|
|
51
51
|
_this.props.handleEscapeKeydown(evt);
|
|
52
|
-
//on 'Esc', Focus is handled in 'handleEscapeKeydown'.
|
|
52
|
+
// on 'Esc', Focus is handled in 'handleEscapeKeydown'.
|
|
53
53
|
return false;
|
|
54
54
|
} else if (evt.code === 'Enter' && _this.props.handleEnterKeydown) {
|
|
55
55
|
_this.props.handleEnterKeydown(evt);
|
|
56
56
|
} else if (evt.code === 'Tab' && _this.props.handleEscapeKeydown && _this.props.closeOnTab) {
|
|
57
|
-
//The menus should be closed when the tab is pressed as it takes the focus out of the menu
|
|
57
|
+
// The menus should be closed when the tab is pressed as it takes the focus out of the menu
|
|
58
58
|
_this.props.handleEscapeKeydown(evt);
|
|
59
59
|
}
|
|
60
60
|
});
|
|
@@ -68,8 +68,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
|
|
|
68
68
|
}
|
|
69
69
|
if (this.props.handleEscapeKeydown) {
|
|
70
70
|
var _this$props$editorRef;
|
|
71
|
-
//
|
|
72
|
-
//Attached event to the menu so that 'ESC' events from the opened menu also will be handled.
|
|
71
|
+
// Attached event to the menu so that 'ESC' events from the opened menu also will be handled.
|
|
73
72
|
(((_this$props$editorRef = this.props.editorRef) === null || _this$props$editorRef === void 0 ? void 0 : _this$props$editorRef.current) || this.props.targetRef || document).addEventListener('keydown', this.handleKeydown, false);
|
|
74
73
|
}
|
|
75
74
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, } from './types';
|
|
1
|
+
export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, } from './types';
|
|
2
2
|
export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadCallback, AnalyticsEventPayloadWithChannel, AnnotationAEP, AnnotationAEPAttributes, AnnotationActionType, AnnotationDraftAEPAttributes, AnnotationResolvedAEPAttributes, CaptionTrackAction, ColorPickerAEP, CommonListAnalyticsAttributes, RestartListsAttributesForListOutdented, CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, DismissedCreateLinkInlineDialogAEP, DispatchAnalyticsEvent, EditLinkToolbarAEP, EnteredTextLinkSearchInputAEP, ErrorEventAttributes, ErrorEventPayload, ExperimentalEventPayload, ExtensionEventPayload, ExtensionType, FeatureExposureAEP, FormatEventPayload, GeneralEventPayload, HighlightedSearchResultsAEP, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, InsertSmartLinkAEP, ListEventPayload, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, MediaResizeTrackAction, MediaInputResizeTrackAction, NodeCount, NodeEventPayload, OperationalAEP, PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, PluginMethodReport, PluginPerformanceReportData, PluginsReport, QuickSearchPerfAEP, RecentActivitiesPerfAEP, SelectAllAEP, SelectCellAEP, SelectNodeAEP, SelectRangeAEP, SelectedSearchResultsAEP, SelectionEventPayload, SelectionJson, ShownPostQuerySearchResultsAEP, ShownPreQuerySearchResultsAEP, SimplifiedNode, SmartLinkNodeContext, SubstituteEventPayload, TableEventPayload, TextColorSelectedAEP, TextColorSelectedAttr, TextColorShowPaletteToggleAEP, TextColorShowPaletteToggleAttr, ToolbarEventPayload, TransactionEventPayload, TypeAheadPayload, UfoSessionCompletePayloadAEP, UnlinkToolbarAEP, ViewedCreateLinkInlineDialogAEP, FireAnalyticsCallback, FireAnalyticsEvent, FireAnalyticsEventPayload, InitialiseFragmentMarksAEP, ConnectedNodesAEP, DisconnectedSourceAEP, DisconnectedTargetAEP, GotConnectionsAEP, UpdatedFragmentMarkNameAEP, UpdatedSourceAEP, UpdatedTargetAEP, } from './types';
|
|
3
3
|
export type { EditorAnalyticsAPI } from './api';
|
|
4
4
|
export { fireAnalyticsEvent } from './fire-analytics-event';
|
|
@@ -8,7 +8,7 @@ export { PUNC, SYMBOL } from './substitute-events';
|
|
|
8
8
|
export { BROWSER_FREEZE_INTERACTION_TYPE, FULL_WIDTH_MODE, MODE, PLATFORMS, } from './general-events';
|
|
9
9
|
export { LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, USER_CONTEXT, } from './insert-events';
|
|
10
10
|
export type { InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, } from './insert-events';
|
|
11
|
-
export { TABLE_ACTION, TABLE_BREAKOUT } from './table-events';
|
|
11
|
+
export { TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, } from './table-events';
|
|
12
12
|
export type { TableEventPayload } from './table-events';
|
|
13
13
|
export { PasteContents, PasteSources, PasteTypes } from './paste-events';
|
|
14
14
|
export type { PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, } from './paste-events';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD } from './enums';
|
|
2
|
-
import { TrackAEP } from './utils';
|
|
1
|
+
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD } from './enums';
|
|
2
|
+
import type { TrackAEP } from './utils';
|
|
3
3
|
export type AnnotationActionType = ACTION.INSERTED | ACTION.CLOSED | ACTION.EDITED | ACTION.DELETED | ACTION.OPENED | ACTION.RESOLVED | ACTION.VIEWED;
|
|
4
4
|
export type AnnotationAEP = TrackAEP<AnnotationActionType, ACTION_SUBJECT.ANNOTATION, ACTION_SUBJECT_ID.INLINE_COMMENT, AnnotationAEPAttributes, undefined>;
|
|
5
5
|
export type AnnotationAEPAttributes = undefined | {} | AnnotationDraftAEPAttributes | AnnotationResolvedAEPAttributes;
|
|
@@ -24,13 +24,25 @@ export declare enum TABLE_ACTION {
|
|
|
24
24
|
DISTRIBUTED_COLUMNS_WIDTHS = "distributedColumnsWidths",
|
|
25
25
|
FIXED = "fixed",
|
|
26
26
|
RESIZED = "resized",
|
|
27
|
-
RESIZE_PERF_SAMPLING = "resizePerfSampling"
|
|
27
|
+
RESIZE_PERF_SAMPLING = "resizePerfSampling",
|
|
28
|
+
OVERFLOW_CHANGED = "overflowChanged",
|
|
29
|
+
INITIAL_OVERFLOW_CAPTURED = "initialOverflowCaptured"
|
|
28
30
|
}
|
|
29
31
|
export declare enum TABLE_BREAKOUT {
|
|
30
32
|
WIDE = "wide",
|
|
31
33
|
FULL_WIDTH = "fullWidth",
|
|
32
34
|
NORMAL = "normal"
|
|
33
35
|
}
|
|
36
|
+
export declare enum TABLE_OVERFLOW_CHANGE_TRIGGER {
|
|
37
|
+
EXTERNAL = "external",
|
|
38
|
+
ADDED_COLUMN = "addedColumn",
|
|
39
|
+
DELETED_COLUMN = "deletedColumn",
|
|
40
|
+
RESIZED_COLUMN = "resizedColumn",
|
|
41
|
+
ENABLED_NUMBERED_COLUMN = "enabledNumberedColumn",
|
|
42
|
+
DISABLED_NUMBERED_COLUMN = "disabledNumberedColumn",
|
|
43
|
+
DISTRIBUTED_COLUMNS = "distributedColumnsWidths",
|
|
44
|
+
RESIZED = "resizedTable"
|
|
45
|
+
}
|
|
34
46
|
interface SortColumn {
|
|
35
47
|
sortOrder: SortOrder;
|
|
36
48
|
mode: 'editor';
|
|
@@ -64,6 +76,13 @@ type ResizePreviewInfo = {
|
|
|
64
76
|
docSize: number;
|
|
65
77
|
nodeSize: number;
|
|
66
78
|
};
|
|
79
|
+
type OverflowStateInfo = {
|
|
80
|
+
editorWidth: number;
|
|
81
|
+
isOverflowing: boolean;
|
|
82
|
+
tableResizingEnabled: boolean;
|
|
83
|
+
width: number;
|
|
84
|
+
parentWidth: number;
|
|
85
|
+
};
|
|
67
86
|
type TableDeleteAEP = TableAEP<TABLE_ACTION.DELETED, {
|
|
68
87
|
inputMethod: INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB;
|
|
69
88
|
} & TotalRowAndColCount, undefined>;
|
|
@@ -112,7 +131,12 @@ type TableCollapsedAEP = TableAEP<TABLE_ACTION.COLLAPSED, TotalRowAndColCount, u
|
|
|
112
131
|
type TableFixedAEP = TableAEP<TABLE_ACTION.FIXED, {
|
|
113
132
|
reason: string;
|
|
114
133
|
}, undefined>;
|
|
134
|
+
type TableOverflowChangedAEP = TableAEP<TABLE_ACTION.OVERFLOW_CHANGED, {
|
|
135
|
+
wasOverflowing: boolean;
|
|
136
|
+
trigger: TABLE_OVERFLOW_CHANGE_TRIGGER;
|
|
137
|
+
} & OverflowStateInfo, undefined>;
|
|
138
|
+
type TableInitialOverflowCapturedAEP = TableAEP<TABLE_ACTION.INITIAL_OVERFLOW_CAPTURED, OverflowStateInfo, undefined>;
|
|
115
139
|
type TableResizedAEP = TableAEP<TABLE_ACTION.RESIZED, ResizedInfo, undefined>;
|
|
116
140
|
type TableResizePerfSamplingAEP = OperationalAEP<TABLE_ACTION.RESIZE_PERF_SAMPLING, ACTION_SUBJECT.TABLE, undefined, ResizePreviewInfo, undefined>;
|
|
117
|
-
export type TableEventPayload = TableDeleteAEP | TableClearAEP | TableMergeSplitAEP | TableColorAEP | TableToggleHeaderAEP | TableChangeBreakoutAEP | TableCopyAndCutAEP | TableAddRowOrColumnAEP | TableSortColumnAEP | TableDeleteRowOrColumnAEP | TableReplaceAEP | TableAttemptedResizeAEP | TableDistributeColumnsWidthsAEP | TableCollapsedAEP | TableFixedAEP | TableResizedAEP | TableResizePerfSamplingAEP;
|
|
141
|
+
export type TableEventPayload = TableDeleteAEP | TableClearAEP | TableMergeSplitAEP | TableColorAEP | TableToggleHeaderAEP | TableChangeBreakoutAEP | TableCopyAndCutAEP | TableAddRowOrColumnAEP | TableSortColumnAEP | TableDeleteRowOrColumnAEP | TableReplaceAEP | TableAttemptedResizeAEP | TableDistributeColumnsWidthsAEP | TableCollapsedAEP | TableFixedAEP | TableOverflowChangedAEP | TableInitialOverflowCapturedAEP | TableResizedAEP | TableResizePerfSamplingAEP;
|
|
118
142
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import { IntlShape } from 'react-intl-next';
|
|
3
|
-
import { Node, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { IntlShape } from 'react-intl-next';
|
|
3
|
+
import type { Node, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import type { EmojiId } from '@atlaskit/emoji/types';
|
|
7
7
|
import type { DispatchAnalyticsEvent } from '../analytics/types/dispatch-analytics-event';
|
|
8
8
|
import type { ProviderFactory } from '../provider-factory';
|
|
@@ -191,6 +191,7 @@ export type FloatingToolbarDropdown<T extends {}> = {
|
|
|
191
191
|
tooltip?: string;
|
|
192
192
|
dropdownWidth?: number;
|
|
193
193
|
showSelected?: boolean;
|
|
194
|
+
alignDropdownWithToolbar?: boolean;
|
|
194
195
|
};
|
|
195
196
|
type FloatingToolbarExtensionsPlaceholder = {
|
|
196
197
|
type: 'extensions-placeholder';
|
package/dist/types/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { MenuArrowKeyNavigationProviderProps } from '../types';
|
|
2
|
+
import type { MenuArrowKeyNavigationProviderProps } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* This component is a wrapper of vertical menus which listens to keydown events of children
|
|
5
5
|
* and handles up/down arrow key navigation
|