@atlaskit/editor-common 94.4.0 → 94.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/cjs/analytics/types/enums.js +3 -0
- package/dist/cjs/element-browser/components/ElementList/ElementList.js +2 -2
- package/dist/cjs/media/messages/caption.js +5 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/styles/shared/headings.js +2 -2
- package/dist/cjs/styles/shared/paragraph.js +2 -2
- package/dist/cjs/ui/DropList/index.js +15 -10
- package/dist/cjs/ui/Emoji/index.js +17 -9
- package/dist/cjs/ui-menu/Dropdown/index.js +13 -7
- package/dist/cjs/ui-menu/DropdownMenu/index.js +18 -25
- package/dist/cjs/ui-menu/ToolbarButton/index.js +2 -3
- package/dist/cjs/ui-react/index.js +10 -1
- package/dist/cjs/ui-react/with-react-editor-view-outer-listeners.js +24 -13
- package/dist/es2019/analytics/types/enums.js +3 -0
- package/dist/es2019/element-browser/components/ElementList/ElementList.js +2 -2
- package/dist/es2019/media/messages/caption.js +5 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/styles/shared/headings.js +2 -2
- package/dist/es2019/styles/shared/paragraph.js +2 -2
- package/dist/es2019/ui/DropList/index.js +7 -2
- package/dist/es2019/ui/Emoji/index.js +10 -8
- package/dist/es2019/ui-menu/Dropdown/index.js +6 -5
- package/dist/es2019/ui-menu/DropdownMenu/index.js +19 -26
- package/dist/es2019/ui-menu/ToolbarButton/index.js +2 -3
- package/dist/es2019/ui-react/index.js +1 -1
- package/dist/es2019/ui-react/with-react-editor-view-outer-listeners.js +23 -14
- package/dist/esm/analytics/types/enums.js +3 -0
- package/dist/esm/element-browser/components/ElementList/ElementList.js +2 -2
- package/dist/esm/media/messages/caption.js +5 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/styles/shared/headings.js +2 -2
- package/dist/esm/styles/shared/paragraph.js +2 -2
- package/dist/esm/ui/DropList/index.js +15 -10
- package/dist/esm/ui/Emoji/index.js +14 -8
- package/dist/esm/ui-menu/Dropdown/index.js +14 -8
- package/dist/esm/ui-menu/DropdownMenu/index.js +19 -26
- package/dist/esm/ui-menu/ToolbarButton/index.js +2 -3
- package/dist/esm/ui-react/index.js +1 -1
- package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +23 -14
- package/dist/types/analytics/types/enums.d.ts +5 -2
- package/dist/types/analytics/types/index.d.ts +1 -1
- package/dist/types/analytics/types/media-events.d.ts +6 -2
- package/dist/types/media/messages/caption.d.ts +5 -0
- package/dist/types/ui/DropList/index.d.ts +6 -2
- package/dist/types/ui/Emoji/index.d.ts +3 -3
- package/dist/types/ui/index.d.ts +1 -1
- package/dist/types/ui-react/index.d.ts +1 -1
- package/dist/types/ui-react/with-react-editor-view-outer-listeners.d.ts +1 -0
- package/dist/types-ts4.5/analytics/types/enums.d.ts +5 -2
- package/dist/types-ts4.5/analytics/types/index.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/media-events.d.ts +6 -2
- package/dist/types-ts4.5/media/messages/caption.d.ts +5 -0
- package/dist/types-ts4.5/ui/DropList/index.d.ts +6 -2
- package/dist/types-ts4.5/ui/Emoji/index.d.ts +3 -3
- package/dist/types-ts4.5/ui/index.d.ts +1 -1
- package/dist/types-ts4.5/ui-react/index.d.ts +1 -1
- package/dist/types-ts4.5/ui-react/with-react-editor-view-outer-listeners.d.ts +1 -0
- package/package.json +9 -6
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
5
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
6
5
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
7
6
|
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
@@ -9,6 +8,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
9
8
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
10
9
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
11
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
11
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
12
12
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
13
13
|
var _excluded = ["children"];
|
|
14
14
|
var _templateObject, _templateObject2;
|
|
@@ -25,11 +25,10 @@ import React, { PureComponent, useContext } from 'react';
|
|
|
25
25
|
import { css, jsx } from '@emotion/react';
|
|
26
26
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
27
27
|
import { CustomItem, MenuGroup, Section } from '@atlaskit/menu';
|
|
28
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
29
28
|
import Tooltip from '@atlaskit/tooltip';
|
|
30
29
|
import { DropdownMenuSharedCssClassName } from '../../styles';
|
|
31
30
|
import { KeyDownHandlerContext } from '../../ui-menu/ToolbarArrowKeyNavigationProvider';
|
|
32
|
-
import { withReactEditorViewOuterListeners } from '../../ui-react';
|
|
31
|
+
import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners } from '../../ui-react';
|
|
33
32
|
import DropList from '../../ui/DropList';
|
|
34
33
|
import Popup from '../../ui/Popup';
|
|
35
34
|
import { ArrowKeyNavigationProvider } from '../ArrowKeyNavigationProvider';
|
|
@@ -57,7 +56,13 @@ var buttonStyles = function buttonStyles(isActive, submenuActive) {
|
|
|
57
56
|
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t\t\t> span:hover[aria-disabled='false'] {\n\t\t\t\tcolor: ", ";\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\t\t\t", "\n\t\t\t> span[aria-disabled='true'] {\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\t\t\t:focus > span[aria-disabled='false'] {\n\t\t\t\t", ";\n\t\t\t}\n\t\t\t:focus-visible,\n\t\t\t:focus-visible > span[aria-disabled='false'] {\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t"])), "var(--ds-text, #172B4D)", "var(--ds-background-neutral-subtle-hovered, rgb(244, 245, 247))", !submenuActive && "\n\t\t\t\t\t> span:active[aria-disabled='false'] {\n\t\t\t\t\t\tbackground-color: ".concat("var(--ds-background-neutral-subtle-pressed, rgb(179, 212, 255))", ";\n\t\t\t\t\t}"), "var(--ds-text-disabled, #091E424F)", focusedMenuItemStyle); // The default focus-visible style is removed to ensure consistency across browsers
|
|
58
57
|
}
|
|
59
58
|
};
|
|
60
|
-
var
|
|
59
|
+
var DropListWithOutsideClickTargetRef = function DropListWithOutsideClickTargetRef(props) {
|
|
60
|
+
var setOutsideClickTargetRef = React.useContext(OutsideClickTargetRefContext);
|
|
61
|
+
return jsx(DropList, _extends({
|
|
62
|
+
onDroplistRef: setOutsideClickTargetRef
|
|
63
|
+
}, props));
|
|
64
|
+
};
|
|
65
|
+
var DropListWithOutsideListeners = withReactEditorViewOuterListeners(DropListWithOutsideClickTargetRef);
|
|
61
66
|
|
|
62
67
|
/**
|
|
63
68
|
* Wrapper around @atlaskit/droplist which uses Popup and Portal to render
|
|
@@ -96,25 +101,15 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
96
101
|
_defineProperty(_assertThisInitialized(_this), "handleCloseAndFocus", function (event) {
|
|
97
102
|
var _this$state$target;
|
|
98
103
|
(_this$state$target = _this.state.target) === null || _this$state$target === void 0 || (_this$state$target = _this$state$target.querySelector('button')) === null || _this$state$target === void 0 || _this$state$target.focus();
|
|
99
|
-
|
|
100
|
-
_this.handleClose(event);
|
|
101
|
-
} else {
|
|
102
|
-
_this.handleClose();
|
|
103
|
-
}
|
|
104
|
+
_this.handleClose(event);
|
|
104
105
|
});
|
|
105
106
|
_defineProperty(_assertThisInitialized(_this), "handleClose", function (event) {
|
|
106
107
|
var onOpenChange = _this.props.onOpenChange;
|
|
107
108
|
if (onOpenChange) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
});
|
|
113
|
-
} else {
|
|
114
|
-
onOpenChange({
|
|
115
|
-
isOpen: false
|
|
116
|
-
});
|
|
117
|
-
}
|
|
109
|
+
onOpenChange({
|
|
110
|
+
isOpen: false,
|
|
111
|
+
event: event
|
|
112
|
+
});
|
|
118
113
|
}
|
|
119
114
|
});
|
|
120
115
|
return _this;
|
|
@@ -184,11 +179,7 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
184
179
|
handleClickOutside: this.handleClose,
|
|
185
180
|
handleEscapeKeydown: handleEscapeKeydown || this.handleCloseAndFocus,
|
|
186
181
|
handleEnterKeydown: function handleEnterKeydown(e) {
|
|
187
|
-
if (
|
|
188
|
-
if (!allowEnterDefaultBehavior) {
|
|
189
|
-
e.preventDefault();
|
|
190
|
-
}
|
|
191
|
-
} else {
|
|
182
|
+
if (!allowEnterDefaultBehavior) {
|
|
192
183
|
e.preventDefault();
|
|
193
184
|
}
|
|
194
185
|
e.stopPropagation();
|
|
@@ -305,7 +296,9 @@ export function DropdownMenuItem(_ref) {
|
|
|
305
296
|
// From time to time we don't want to have any tabIndex on item wrapper
|
|
306
297
|
// especially when we pass any interactive element as a item.content
|
|
307
298
|
var tabIndex = item.wrapperTabIndex === null ? undefined : item.wrapperTabIndex || -1;
|
|
308
|
-
var dropListItem =
|
|
299
|
+
var dropListItem =
|
|
300
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
301
|
+
jsx("div", {
|
|
309
302
|
css: function css() {
|
|
310
303
|
return buttonStyles(item.isActive, submenuActive);
|
|
311
304
|
},
|
|
@@ -342,7 +335,7 @@ export function DropdownMenuItem(_ref) {
|
|
|
342
335
|
item: item
|
|
343
336
|
});
|
|
344
337
|
},
|
|
345
|
-
"aria-expanded":
|
|
338
|
+
"aria-expanded": item['aria-expanded']
|
|
346
339
|
}, item.content));
|
|
347
340
|
if (item.tooltipDescription) {
|
|
348
341
|
var _item$key3;
|
|
@@ -12,7 +12,6 @@ import React, { useCallback } from 'react';
|
|
|
12
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
13
|
import { css, jsx } from '@emotion/react';
|
|
14
14
|
import { FabricChannel } from '@atlaskit/analytics-listeners/types';
|
|
15
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
15
|
import Tooltip from '@atlaskit/tooltip';
|
|
17
16
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, TOOLBAR_ACTION_SUBJECT_ID } from '../../analytics';
|
|
18
17
|
import { ToolTipContent } from '../../keymaps';
|
|
@@ -110,10 +109,10 @@ var ToolbarButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
110
109
|
if (!title) {
|
|
111
110
|
return button;
|
|
112
111
|
}
|
|
113
|
-
var tooltipContent = hideTooltip ? null :
|
|
112
|
+
var tooltipContent = hideTooltip ? null : jsx(ToolTipContent, {
|
|
114
113
|
description: title,
|
|
115
114
|
keymap: keymap
|
|
116
|
-
})
|
|
115
|
+
});
|
|
117
116
|
return jsx(Tooltip, {
|
|
118
117
|
content: tooltipContent,
|
|
119
118
|
hideTooltipOnClick: true,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as ReactEditorViewContext } from './ReactEditorViewContext';
|
|
2
|
-
export { default as withReactEditorViewOuterListeners } from './with-react-editor-view-outer-listeners';
|
|
2
|
+
export { default as withReactEditorViewOuterListeners, OutsideClickTargetRefContext } from './with-react-editor-view-outer-listeners';
|
|
@@ -10,11 +10,15 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
10
10
|
var _excluded = ["handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown", "closeOnTab"];
|
|
11
11
|
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
12
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
|
-
import React, { PureComponent, useEffect, useState } from 'react';
|
|
13
|
+
import React, { PureComponent, useCallback, useEffect, useRef, useState } from 'react';
|
|
14
14
|
import ReactDOM from 'react-dom';
|
|
15
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
16
|
import ReactEditorViewContext from './ReactEditorViewContext';
|
|
17
|
+
// Use this context to pass in the reference of the element that should be considered as the outside click target
|
|
18
|
+
// The outside click target is the element that should be clicked outside of to trigger the `handleClickOutside` event
|
|
19
|
+
export var OutsideClickTargetRefContext = /*#__PURE__*/React.createContext(function () {});
|
|
16
20
|
|
|
17
|
-
// This needs exporting to be used
|
|
21
|
+
// This needs exporting to be used alongside `withReactEditorViewOuterListeners`
|
|
18
22
|
var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
|
|
19
23
|
_inherits(WithOutsideClick, _PureComponent);
|
|
20
24
|
var _super = _createSuper(WithOutsideClick);
|
|
@@ -26,19 +30,17 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
|
|
|
26
30
|
}
|
|
27
31
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
28
32
|
_defineProperty(_assertThisInitialized(_this), "handleClick", function (evt) {
|
|
29
|
-
if (!_this.props.isActiveComponent) {
|
|
33
|
+
if (!_this.props.isActiveComponent || !_this.props.handleClickOutside) {
|
|
30
34
|
return;
|
|
31
35
|
}
|
|
32
|
-
var domNode = ReactDOM.findDOMNode(_assertThisInitialized(_this));
|
|
36
|
+
var domNode = fg('platform_editor_replace_finddomnode_in_common') ? _this.props.outsideClickTargetRef.current : ReactDOM.findDOMNode(_assertThisInitialized(_this));
|
|
33
37
|
if (!domNode || evt.target instanceof Node && !domNode.contains(evt.target)) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
(_this$props$editorVie2 = _this.props.editorView) === null || _this$props$editorVie2 === void 0 || _this$props$editorVie2.focus();
|
|
41
|
-
}
|
|
38
|
+
var _this$props$editorVie;
|
|
39
|
+
_this.props.handleClickOutside(evt);
|
|
40
|
+
// When the menus are closed by clicking outside the focus is set on editor.
|
|
41
|
+
if (!((_this$props$editorVie = _this.props.editorView) !== null && _this$props$editorVie !== void 0 && _this$props$editorVie.hasFocus())) {
|
|
42
|
+
var _this$props$editorVie2;
|
|
43
|
+
(_this$props$editorVie2 = _this.props.editorView) === null || _this$props$editorVie2 === void 0 || _this$props$editorVie2.focus();
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
});
|
|
@@ -107,6 +109,10 @@ export default function withReactEditorViewOuterListeners(Component) {
|
|
|
107
109
|
_useState2 = _slicedToArray(_useState, 2),
|
|
108
110
|
isActiveComponent = _useState2[0],
|
|
109
111
|
setActiveComponent = _useState2[1];
|
|
112
|
+
var outsideClickTargetRef = useRef(null);
|
|
113
|
+
var setOutsideClickTargetRef = useCallback(function (el) {
|
|
114
|
+
outsideClickTargetRef.current = el;
|
|
115
|
+
}, [outsideClickTargetRef]);
|
|
110
116
|
useEffect(function () {
|
|
111
117
|
requestAnimationFrame(function () {
|
|
112
118
|
setActiveComponent(isActiveProp);
|
|
@@ -116,17 +122,20 @@ export default function withReactEditorViewOuterListeners(Component) {
|
|
|
116
122
|
var editorView = _ref2.editorView,
|
|
117
123
|
popupsMountPoint = _ref2.popupsMountPoint,
|
|
118
124
|
editorRef = _ref2.editorRef;
|
|
119
|
-
return /*#__PURE__*/React.createElement(
|
|
125
|
+
return /*#__PURE__*/React.createElement(OutsideClickTargetRefContext.Provider, {
|
|
126
|
+
value: setOutsideClickTargetRef
|
|
127
|
+
}, /*#__PURE__*/React.createElement(WithOutsideClick, {
|
|
120
128
|
editorView: editorView,
|
|
121
129
|
editorRef: editorRef,
|
|
122
130
|
targetRef: props.targetRef,
|
|
131
|
+
outsideClickTargetRef: outsideClickTargetRef,
|
|
123
132
|
popupsMountPoint: popupsMountPoint,
|
|
124
133
|
isActiveComponent: isActiveComponent,
|
|
125
134
|
handleClickOutside: handleClickOutside,
|
|
126
135
|
handleEnterKeydown: handleEnterKeydown,
|
|
127
136
|
handleEscapeKeydown: handleEscapeKeydown,
|
|
128
137
|
closeOnTab: closeOnTab
|
|
129
|
-
}, /*#__PURE__*/React.createElement(Component, props));
|
|
138
|
+
}, /*#__PURE__*/React.createElement(Component, props)));
|
|
130
139
|
});
|
|
131
140
|
};
|
|
132
141
|
}
|
|
@@ -37,6 +37,7 @@ export declare enum ACTION {
|
|
|
37
37
|
DISMISSED = "dismissed",
|
|
38
38
|
DISPATCHED_INVALID_TRANSACTION = "dispatchedInvalidTransaction",
|
|
39
39
|
DISPATCHED_VALID_TRANSACTION = "dispatchedValidTransaction",
|
|
40
|
+
DOUBLE_CLICKED = "doubleClicked",
|
|
40
41
|
DRAGGED = "dragged",
|
|
41
42
|
EDITED = "edited",
|
|
42
43
|
EDITOR_CRASHED = "unhandledErrorCaught",
|
|
@@ -185,7 +186,8 @@ export declare enum INPUT_METHOD {
|
|
|
185
186
|
DATASOURCE = "datasource_config",
|
|
186
187
|
TABLE_CONTEXT_MENU = "tableContextMenu",
|
|
187
188
|
MOUSE = "mouse",
|
|
188
|
-
BROWSER = "browser"
|
|
189
|
+
BROWSER = "browser",
|
|
190
|
+
DOUBLE_CLICK = "doubleClick"
|
|
189
191
|
}
|
|
190
192
|
export declare enum INSERT_MEDIA_VIA {
|
|
191
193
|
LOCAL_UPLOAD = "localUpload",
|
|
@@ -259,7 +261,8 @@ export declare enum ACTION_SUBJECT {
|
|
|
259
261
|
ELEMENT = "element",
|
|
260
262
|
CONTEXT_MENU = "contextMenu",
|
|
261
263
|
INLINE_DIALOG = "inlineDialog",
|
|
262
|
-
ENGAGEMENT_PLATFORM = "engagementPlatform"
|
|
264
|
+
ENGAGEMENT_PLATFORM = "engagementPlatform",
|
|
265
|
+
MEDIA_VIEWER = "mediaViewer"
|
|
263
266
|
}
|
|
264
267
|
export declare enum ACTION_SUBJECT_ID {
|
|
265
268
|
ACTION = "action",
|
|
@@ -12,7 +12,7 @@ export { CHANGE_ALIGNMENT_REASON, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_C
|
|
|
12
12
|
export type { TableEventPayload, OverflowStateInfo } 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';
|
|
15
|
-
export type { MediaSwitchType, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, CaptionTrackAction, MediaResizeTrackAction, MediaInputResizeTrackAction, } from './media-events';
|
|
15
|
+
export type { MediaSwitchType, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, CaptionTrackAction, MediaResizeTrackAction, MediaInputResizeTrackAction, MediaViewerEventAction, } from './media-events';
|
|
16
16
|
export type { MoveContentEventPayload } from './move-content-events';
|
|
17
17
|
export type { DispatchAnalyticsEvent } from './dispatch-analytics-event';
|
|
18
18
|
export { DELETE_DIRECTION, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, } from './list-events';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { GuidelineTypes, WidthTypes } from '../../guideline/types';
|
|
3
|
-
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID } from './enums';
|
|
3
|
+
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD } from './enums';
|
|
4
4
|
import type { EventInput } from './type-ahead';
|
|
5
5
|
import type { ChangeTypeAEP, TrackAEP, UIAEP } from './utils';
|
|
6
6
|
type MediaBorderActionType = ACTION.UPDATED | ACTION.ADDED | ACTION.DELETED;
|
|
@@ -37,6 +37,10 @@ type ChangeMediaAEP = ChangeTypeAEP<ACTION_SUBJECT.MEDIA, undefined, {
|
|
|
37
37
|
newType: MediaSwitchType;
|
|
38
38
|
previousType: MediaSwitchType;
|
|
39
39
|
}, undefined>;
|
|
40
|
+
export type MediaViewerEventAction = UIAEP<ACTION.OPENED, ACTION_SUBJECT.MEDIA_VIEWER, ACTION_SUBJECT_ID.MEDIA, {
|
|
41
|
+
nodeType: string;
|
|
42
|
+
inputMethod: INPUT_METHOD.DOUBLE_CLICK;
|
|
43
|
+
}, undefined>;
|
|
40
44
|
export type MediaAltTextActionType = ACTION.ADDED | ACTION.CLOSED | ACTION.EDITED | ACTION.CLEARED | ACTION.OPENED;
|
|
41
|
-
export type MediaEventPayload = MediaLinkAEP | MediaAltTextAction | MediaUIAction | MediaResizeTrackAction | MediaInputResizeTrackAction | MediaBorderTrackAction | CaptionTrackAction | ChangeMediaAEP;
|
|
45
|
+
export type MediaEventPayload = MediaLinkAEP | MediaAltTextAction | MediaUIAction | MediaResizeTrackAction | MediaInputResizeTrackAction | MediaBorderTrackAction | CaptionTrackAction | ChangeMediaAEP | MediaViewerEventAction;
|
|
42
46
|
export {};
|
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { ReactNode } from 'react';
|
|
6
6
|
import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
7
|
-
interface Props extends WithAnalyticsEventsProps {
|
|
7
|
+
export interface Props extends WithAnalyticsEventsProps {
|
|
8
8
|
isOpen?: boolean;
|
|
9
|
+
appearance?: string;
|
|
10
|
+
shouldFlip?: boolean;
|
|
11
|
+
isTriggerNotTabbable?: boolean;
|
|
9
12
|
trigger?: React.ReactNode;
|
|
10
13
|
position: string;
|
|
11
14
|
onOpenChange?: (event: OpenChangedEvent) => void;
|
|
@@ -14,10 +17,11 @@ interface Props extends WithAnalyticsEventsProps {
|
|
|
14
17
|
shouldFitContainer: boolean;
|
|
15
18
|
children?: ReactNode;
|
|
16
19
|
id?: string;
|
|
20
|
+
onDroplistRef?: (ref: HTMLDivElement | null) => unknown;
|
|
17
21
|
}
|
|
18
22
|
export type OpenChangedEvent = {
|
|
19
23
|
isOpen: boolean;
|
|
20
24
|
event: MouseEvent | KeyboardEvent;
|
|
21
25
|
};
|
|
22
|
-
declare const _default: import("react").ForwardRefExoticComponent<Pick<Omit<Props, keyof WithAnalyticsEventsProps> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "position" | "key" | "id" | "children" | "testId" | "analyticsContext" | "shouldFitContainer" | "onPositioned" | "isOpen" | "trigger" | "onOpenChange"> & import("react").RefAttributes<any>>;
|
|
26
|
+
declare const _default: import("react").ForwardRefExoticComponent<Pick<Omit<Props, keyof WithAnalyticsEventsProps> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "appearance" | "position" | "key" | "id" | "children" | "testId" | "analyticsContext" | "shouldFitContainer" | "onPositioned" | "isOpen" | "shouldFlip" | "isTriggerNotTabbable" | "trigger" | "onOpenChange" | "onDroplistRef"> & import("react").RefAttributes<any>>;
|
|
23
27
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { EmojiProvider, EmojiResourceConfig } from '@atlaskit/emoji/resource';
|
|
3
3
|
import type { EmojiId } from '@atlaskit/emoji/types';
|
|
4
4
|
import { type ProviderFactory } from '../../provider-factory';
|
|
@@ -10,5 +10,5 @@ export interface EmojiProps extends EmojiId {
|
|
|
10
10
|
resourceConfig?: EmojiResourceConfig;
|
|
11
11
|
emojiProvider?: EmojiProvider;
|
|
12
12
|
}
|
|
13
|
-
declare const
|
|
14
|
-
export default
|
|
13
|
+
declare const _default: React.MemoExoticComponent<(props: EmojiProps) => JSX.Element>;
|
|
14
|
+
export default _default;
|
package/dist/types/ui/index.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export { panelTextInput } from './PanelTextInput/styles';
|
|
|
39
39
|
export { default as PanelTextInput } from './PanelTextInput';
|
|
40
40
|
export { default as Announcer } from './Announcer/announcer';
|
|
41
41
|
export { EDIT_AREA_ID } from './Toolbar';
|
|
42
|
-
export { default as DropList } from './DropList';
|
|
42
|
+
export { default as DropList, type Props as DropListProps } from './DropList';
|
|
43
43
|
export type { UseStickyToolbarType } from './Toolbar';
|
|
44
44
|
export type { OpenChangedEvent } from './DropList';
|
|
45
45
|
export { sharedMultiBodiedExtensionStyles } from './MultiBodiedExtension';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as ReactEditorViewContext } from './ReactEditorViewContext';
|
|
2
|
-
export { default as withReactEditorViewOuterListeners } from './with-react-editor-view-outer-listeners';
|
|
2
|
+
export { default as withReactEditorViewOuterListeners, OutsideClickTargetRefContext, } from './with-react-editor-view-outer-listeners';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
type SimpleEventHandler<T> = (event: T) => void;
|
|
3
|
+
export declare const OutsideClickTargetRefContext: React.Context<(el: HTMLElement | null) => void>;
|
|
3
4
|
export interface WithOutsideClickProps {
|
|
4
5
|
handleClickOutside?: SimpleEventHandler<MouseEvent>;
|
|
5
6
|
handleEscapeKeydown?: SimpleEventHandler<KeyboardEvent>;
|
|
@@ -37,6 +37,7 @@ export declare enum ACTION {
|
|
|
37
37
|
DISMISSED = "dismissed",
|
|
38
38
|
DISPATCHED_INVALID_TRANSACTION = "dispatchedInvalidTransaction",
|
|
39
39
|
DISPATCHED_VALID_TRANSACTION = "dispatchedValidTransaction",
|
|
40
|
+
DOUBLE_CLICKED = "doubleClicked",
|
|
40
41
|
DRAGGED = "dragged",
|
|
41
42
|
EDITED = "edited",
|
|
42
43
|
EDITOR_CRASHED = "unhandledErrorCaught",
|
|
@@ -185,7 +186,8 @@ export declare enum INPUT_METHOD {
|
|
|
185
186
|
DATASOURCE = "datasource_config",
|
|
186
187
|
TABLE_CONTEXT_MENU = "tableContextMenu",
|
|
187
188
|
MOUSE = "mouse",
|
|
188
|
-
BROWSER = "browser"
|
|
189
|
+
BROWSER = "browser",
|
|
190
|
+
DOUBLE_CLICK = "doubleClick"
|
|
189
191
|
}
|
|
190
192
|
export declare enum INSERT_MEDIA_VIA {
|
|
191
193
|
LOCAL_UPLOAD = "localUpload",
|
|
@@ -259,7 +261,8 @@ export declare enum ACTION_SUBJECT {
|
|
|
259
261
|
ELEMENT = "element",
|
|
260
262
|
CONTEXT_MENU = "contextMenu",
|
|
261
263
|
INLINE_DIALOG = "inlineDialog",
|
|
262
|
-
ENGAGEMENT_PLATFORM = "engagementPlatform"
|
|
264
|
+
ENGAGEMENT_PLATFORM = "engagementPlatform",
|
|
265
|
+
MEDIA_VIEWER = "mediaViewer"
|
|
263
266
|
}
|
|
264
267
|
export declare enum ACTION_SUBJECT_ID {
|
|
265
268
|
ACTION = "action",
|
|
@@ -12,7 +12,7 @@ export { CHANGE_ALIGNMENT_REASON, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_C
|
|
|
12
12
|
export type { TableEventPayload, OverflowStateInfo } 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';
|
|
15
|
-
export type { MediaSwitchType, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, CaptionTrackAction, MediaResizeTrackAction, MediaInputResizeTrackAction, } from './media-events';
|
|
15
|
+
export type { MediaSwitchType, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, CaptionTrackAction, MediaResizeTrackAction, MediaInputResizeTrackAction, MediaViewerEventAction, } from './media-events';
|
|
16
16
|
export type { MoveContentEventPayload } from './move-content-events';
|
|
17
17
|
export type { DispatchAnalyticsEvent } from './dispatch-analytics-event';
|
|
18
18
|
export { DELETE_DIRECTION, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, } from './list-events';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { GuidelineTypes, WidthTypes } from '../../guideline/types';
|
|
3
|
-
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID } from './enums';
|
|
3
|
+
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD } from './enums';
|
|
4
4
|
import type { EventInput } from './type-ahead';
|
|
5
5
|
import type { ChangeTypeAEP, TrackAEP, UIAEP } from './utils';
|
|
6
6
|
type MediaBorderActionType = ACTION.UPDATED | ACTION.ADDED | ACTION.DELETED;
|
|
@@ -37,6 +37,10 @@ type ChangeMediaAEP = ChangeTypeAEP<ACTION_SUBJECT.MEDIA, undefined, {
|
|
|
37
37
|
newType: MediaSwitchType;
|
|
38
38
|
previousType: MediaSwitchType;
|
|
39
39
|
}, undefined>;
|
|
40
|
+
export type MediaViewerEventAction = UIAEP<ACTION.OPENED, ACTION_SUBJECT.MEDIA_VIEWER, ACTION_SUBJECT_ID.MEDIA, {
|
|
41
|
+
nodeType: string;
|
|
42
|
+
inputMethod: INPUT_METHOD.DOUBLE_CLICK;
|
|
43
|
+
}, undefined>;
|
|
40
44
|
export type MediaAltTextActionType = ACTION.ADDED | ACTION.CLOSED | ACTION.EDITED | ACTION.CLEARED | ACTION.OPENED;
|
|
41
|
-
export type MediaEventPayload = MediaLinkAEP | MediaAltTextAction | MediaUIAction | MediaResizeTrackAction | MediaInputResizeTrackAction | MediaBorderTrackAction | CaptionTrackAction | ChangeMediaAEP;
|
|
45
|
+
export type MediaEventPayload = MediaLinkAEP | MediaAltTextAction | MediaUIAction | MediaResizeTrackAction | MediaInputResizeTrackAction | MediaBorderTrackAction | CaptionTrackAction | ChangeMediaAEP | MediaViewerEventAction;
|
|
42
46
|
export {};
|
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { ReactNode } from 'react';
|
|
6
6
|
import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
7
|
-
interface Props extends WithAnalyticsEventsProps {
|
|
7
|
+
export interface Props extends WithAnalyticsEventsProps {
|
|
8
8
|
isOpen?: boolean;
|
|
9
|
+
appearance?: string;
|
|
10
|
+
shouldFlip?: boolean;
|
|
11
|
+
isTriggerNotTabbable?: boolean;
|
|
9
12
|
trigger?: React.ReactNode;
|
|
10
13
|
position: string;
|
|
11
14
|
onOpenChange?: (event: OpenChangedEvent) => void;
|
|
@@ -14,10 +17,11 @@ interface Props extends WithAnalyticsEventsProps {
|
|
|
14
17
|
shouldFitContainer: boolean;
|
|
15
18
|
children?: ReactNode;
|
|
16
19
|
id?: string;
|
|
20
|
+
onDroplistRef?: (ref: HTMLDivElement | null) => unknown;
|
|
17
21
|
}
|
|
18
22
|
export type OpenChangedEvent = {
|
|
19
23
|
isOpen: boolean;
|
|
20
24
|
event: MouseEvent | KeyboardEvent;
|
|
21
25
|
};
|
|
22
|
-
declare const _default: import("react").ForwardRefExoticComponent<Pick<Omit<Props, keyof WithAnalyticsEventsProps> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "position" | "key" | "id" | "children" | "testId" | "analyticsContext" | "shouldFitContainer" | "onPositioned" | "isOpen" | "trigger" | "onOpenChange"> & import("react").RefAttributes<any>>;
|
|
26
|
+
declare const _default: import("react").ForwardRefExoticComponent<Pick<Omit<Props, keyof WithAnalyticsEventsProps> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "appearance" | "position" | "key" | "id" | "children" | "testId" | "analyticsContext" | "shouldFitContainer" | "onPositioned" | "isOpen" | "shouldFlip" | "isTriggerNotTabbable" | "trigger" | "onOpenChange" | "onDroplistRef"> & import("react").RefAttributes<any>>;
|
|
23
27
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { EmojiProvider, EmojiResourceConfig } from '@atlaskit/emoji/resource';
|
|
3
3
|
import type { EmojiId } from '@atlaskit/emoji/types';
|
|
4
4
|
import { type ProviderFactory } from '../../provider-factory';
|
|
@@ -10,5 +10,5 @@ export interface EmojiProps extends EmojiId {
|
|
|
10
10
|
resourceConfig?: EmojiResourceConfig;
|
|
11
11
|
emojiProvider?: EmojiProvider;
|
|
12
12
|
}
|
|
13
|
-
declare const
|
|
14
|
-
export default
|
|
13
|
+
declare const _default: React.MemoExoticComponent<(props: EmojiProps) => JSX.Element>;
|
|
14
|
+
export default _default;
|
|
@@ -39,7 +39,7 @@ export { panelTextInput } from './PanelTextInput/styles';
|
|
|
39
39
|
export { default as PanelTextInput } from './PanelTextInput';
|
|
40
40
|
export { default as Announcer } from './Announcer/announcer';
|
|
41
41
|
export { EDIT_AREA_ID } from './Toolbar';
|
|
42
|
-
export { default as DropList } from './DropList';
|
|
42
|
+
export { default as DropList, type Props as DropListProps } from './DropList';
|
|
43
43
|
export type { UseStickyToolbarType } from './Toolbar';
|
|
44
44
|
export type { OpenChangedEvent } from './DropList';
|
|
45
45
|
export { sharedMultiBodiedExtensionStyles } from './MultiBodiedExtension';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as ReactEditorViewContext } from './ReactEditorViewContext';
|
|
2
|
-
export { default as withReactEditorViewOuterListeners } from './with-react-editor-view-outer-listeners';
|
|
2
|
+
export { default as withReactEditorViewOuterListeners, OutsideClickTargetRefContext, } from './with-react-editor-view-outer-listeners';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
type SimpleEventHandler<T> = (event: T) => void;
|
|
3
|
+
export declare const OutsideClickTargetRefContext: React.Context<(el: HTMLElement | null) => void>;
|
|
3
4
|
export interface WithOutsideClickProps {
|
|
4
5
|
handleClickOutside?: SimpleEventHandler<MouseEvent>;
|
|
5
6
|
handleEscapeKeydown?: SimpleEventHandler<KeyboardEvent>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "94.
|
|
3
|
+
"version": "94.5.1",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"@atlaskit/custom-steps": "^0.8.0",
|
|
122
122
|
"@atlaskit/dropdown-menu": "^12.21.0",
|
|
123
123
|
"@atlaskit/editor-json-transformer": "^8.20.0",
|
|
124
|
-
"@atlaskit/editor-palette": "1.6.
|
|
124
|
+
"@atlaskit/editor-palette": "1.6.3",
|
|
125
125
|
"@atlaskit/editor-prosemirror": "6.0.0",
|
|
126
126
|
"@atlaskit/editor-shared-styles": "^3.1.0",
|
|
127
127
|
"@atlaskit/editor-tables": "^2.8.0",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"@atlaskit/spinner": "^16.3.0",
|
|
151
151
|
"@atlaskit/task-decision": "^17.11.0",
|
|
152
152
|
"@atlaskit/textfield": "^6.5.0",
|
|
153
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
153
|
+
"@atlaskit/tmp-editor-statsig": "^2.10.0",
|
|
154
154
|
"@atlaskit/tokens": "^2.0.0",
|
|
155
155
|
"@atlaskit/tooltip": "^18.8.0",
|
|
156
156
|
"@atlaskit/width-detector": "^4.3.0",
|
|
@@ -246,9 +246,6 @@
|
|
|
246
246
|
"annotations_align_editor_and_renderer_styles": {
|
|
247
247
|
"type": "boolean"
|
|
248
248
|
},
|
|
249
|
-
"platform_editor_a11y_table_context_menu": {
|
|
250
|
-
"type": "boolean"
|
|
251
|
-
},
|
|
252
249
|
"editor_inline_comments_paste_insert_nodes": {
|
|
253
250
|
"type": "boolean"
|
|
254
251
|
},
|
|
@@ -276,9 +273,15 @@
|
|
|
276
273
|
"platform_editor_allow_annotation_triple_click": {
|
|
277
274
|
"type": "boolean"
|
|
278
275
|
},
|
|
276
|
+
"platform_editor_typography_ugc": {
|
|
277
|
+
"type": "boolean"
|
|
278
|
+
},
|
|
279
279
|
"platform_editor_heading_margin_fix": {
|
|
280
280
|
"type": "boolean"
|
|
281
281
|
},
|
|
282
|
+
"platform_editor_replace_finddomnode_in_common": {
|
|
283
|
+
"type": "boolean"
|
|
284
|
+
},
|
|
282
285
|
"platform_editor_element_dnd_nested_fix_patch_3": {
|
|
283
286
|
"type": "boolean"
|
|
284
287
|
}
|