@atlaskit/editor-common 76.24.3 → 76.24.4
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 +6 -0
- package/dist/cjs/card/LinkToolbarButtonGroup.js +5 -6
- package/dist/cjs/element-browser/ViewMore.js +3 -4
- package/dist/cjs/element-browser/components/CategoryList.js +4 -5
- package/dist/cjs/element-browser/components/ElementBrowserLoader.js +2 -3
- package/dist/cjs/element-browser/components/ElementList/ElementList.js +20 -21
- package/dist/cjs/element-browser/components/ElementList/EmptyState.js +8 -9
- package/dist/cjs/element-browser/components/ElementList/NotFoundIllustration.js +15 -16
- package/dist/cjs/element-browser/components/ElementSearch.js +6 -7
- package/dist/cjs/element-browser/components/StatelessElementBrowser.js +21 -22
- package/dist/cjs/element-browser/hooks/use-container-width.js +2 -3
- package/dist/cjs/keymaps/index.js +1 -2
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +21 -22
- package/dist/cjs/link/LinkSearch/LinkSearchList.js +5 -6
- package/dist/cjs/link/LinkSearch/LinkSearchListItem.js +9 -11
- package/dist/cjs/media-inline/inline-image-wrapper.js +1 -3
- package/dist/cjs/media-inline/media-inline-image-card.js +0 -2
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +5 -8
- package/dist/cjs/ui/Caption/index.js +2 -3
- package/dist/cjs/ui/DropList/index.js +6 -6
- package/dist/cjs/ui/Expand/index.js +3 -5
- package/dist/cjs/ui/FloatingToolbar/Separator.js +1 -2
- package/dist/cjs/ui/FloatingToolbar/SmallerEditIcon.js +2 -3
- package/dist/cjs/ui/MediaSingle/index.js +2 -5
- package/dist/cjs/ui/MediaSingle/styled.js +2 -3
- package/dist/cjs/ui/Messages/index.js +7 -8
- package/dist/cjs/ui/PanelTextInput/index.js +2 -3
- package/dist/cjs/ui/UnsupportedBlock/index.js +4 -5
- package/dist/cjs/ui/UnsupportedInline/index.js +4 -5
- package/dist/cjs/ui/WidthProvider/index.js +4 -4
- package/dist/cjs/ui-color/ColorPalette/Color/index.js +5 -6
- package/dist/cjs/ui-color/ColorPalette/index.js +3 -6
- package/dist/cjs/ui-menu/ColorPickerButton/index.js +9 -10
- package/dist/cjs/ui-menu/DropdownContainer/index.js +3 -3
- package/dist/cjs/ui-menu/DropdownMenu/index.js +18 -19
- package/dist/cjs/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +2 -3
- package/dist/cjs/ui-menu/ToolbarButton/index.js +3 -4
- package/dist/cjs/ui-react/with-react-editor-view-outer-listeners.js +11 -1
- package/dist/es2019/card/LinkToolbarButtonGroup.js +6 -7
- package/dist/es2019/element-browser/ViewMore.js +4 -5
- package/dist/es2019/element-browser/components/CategoryList.js +4 -6
- package/dist/es2019/element-browser/components/ElementBrowserLoader.js +3 -4
- package/dist/es2019/element-browser/components/ElementList/ElementList.js +21 -22
- package/dist/es2019/element-browser/components/ElementList/EmptyState.js +9 -10
- package/dist/es2019/element-browser/components/ElementList/NotFoundIllustration.js +16 -17
- package/dist/es2019/element-browser/components/ElementSearch.js +7 -8
- package/dist/es2019/element-browser/components/StatelessElementBrowser.js +22 -23
- package/dist/es2019/element-browser/hooks/use-container-width.js +3 -4
- package/dist/es2019/keymaps/index.js +2 -3
- package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +22 -24
- package/dist/es2019/link/LinkSearch/LinkSearchList.js +6 -7
- package/dist/es2019/link/LinkSearch/LinkSearchListItem.js +9 -10
- package/dist/es2019/media-inline/inline-image-wrapper.js +2 -4
- package/dist/es2019/media-inline/media-inline-image-card.js +0 -2
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +5 -7
- package/dist/es2019/ui/Caption/index.js +3 -4
- package/dist/es2019/ui/DropList/index.js +6 -8
- package/dist/es2019/ui/Expand/index.js +3 -5
- package/dist/es2019/ui/FloatingToolbar/Separator.js +2 -3
- package/dist/es2019/ui/FloatingToolbar/SmallerEditIcon.js +3 -4
- package/dist/es2019/ui/MediaSingle/index.js +2 -4
- package/dist/es2019/ui/MediaSingle/styled.js +3 -5
- package/dist/es2019/ui/Messages/index.js +8 -10
- package/dist/es2019/ui/PanelTextInput/index.js +1 -4
- package/dist/es2019/ui/UnsupportedBlock/index.js +5 -6
- package/dist/es2019/ui/UnsupportedInline/index.js +5 -6
- package/dist/es2019/ui/WidthProvider/index.js +4 -5
- package/dist/es2019/ui-color/ColorPalette/Color/index.js +4 -6
- package/dist/es2019/ui-color/ColorPalette/index.js +2 -4
- package/dist/es2019/ui-menu/ColorPickerButton/index.js +10 -11
- package/dist/es2019/ui-menu/DropdownContainer/index.js +2 -3
- package/dist/es2019/ui-menu/DropdownMenu/index.js +19 -21
- package/dist/es2019/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +3 -4
- package/dist/es2019/ui-menu/ToolbarButton/index.js +5 -5
- package/dist/es2019/ui-react/with-react-editor-view-outer-listeners.js +8 -2
- package/dist/esm/card/LinkToolbarButtonGroup.js +6 -7
- package/dist/esm/element-browser/ViewMore.js +4 -5
- package/dist/esm/element-browser/components/CategoryList.js +5 -7
- package/dist/esm/element-browser/components/ElementBrowserLoader.js +3 -4
- package/dist/esm/element-browser/components/ElementList/ElementList.js +21 -22
- package/dist/esm/element-browser/components/ElementList/EmptyState.js +9 -10
- package/dist/esm/element-browser/components/ElementList/NotFoundIllustration.js +16 -17
- package/dist/esm/element-browser/components/ElementSearch.js +7 -8
- package/dist/esm/element-browser/components/StatelessElementBrowser.js +22 -23
- package/dist/esm/element-browser/hooks/use-container-width.js +3 -4
- package/dist/esm/keymaps/index.js +2 -3
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +22 -24
- package/dist/esm/link/LinkSearch/LinkSearchList.js +6 -7
- package/dist/esm/link/LinkSearch/LinkSearchListItem.js +9 -10
- package/dist/esm/media-inline/inline-image-wrapper.js +2 -4
- package/dist/esm/media-inline/media-inline-image-card.js +0 -2
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/react-node-view/getInlineNodeViewProducer.js +5 -7
- package/dist/esm/ui/Caption/index.js +3 -4
- package/dist/esm/ui/DropList/index.js +6 -8
- package/dist/esm/ui/Expand/index.js +3 -5
- package/dist/esm/ui/FloatingToolbar/Separator.js +2 -3
- package/dist/esm/ui/FloatingToolbar/SmallerEditIcon.js +3 -4
- package/dist/esm/ui/MediaSingle/index.js +2 -4
- package/dist/esm/ui/MediaSingle/styled.js +3 -5
- package/dist/esm/ui/Messages/index.js +8 -10
- package/dist/esm/ui/PanelTextInput/index.js +1 -4
- package/dist/esm/ui/UnsupportedBlock/index.js +5 -6
- package/dist/esm/ui/UnsupportedInline/index.js +5 -6
- package/dist/esm/ui/WidthProvider/index.js +4 -5
- package/dist/esm/ui-color/ColorPalette/Color/index.js +4 -6
- package/dist/esm/ui-color/ColorPalette/index.js +3 -5
- package/dist/esm/ui-menu/ColorPickerButton/index.js +10 -11
- package/dist/esm/ui-menu/DropdownContainer/index.js +2 -3
- package/dist/esm/ui-menu/DropdownMenu/index.js +19 -21
- package/dist/esm/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +3 -4
- package/dist/esm/ui-menu/ToolbarButton/index.js +5 -5
- package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +12 -2
- package/package.json +1 -1
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
|
-
|
|
4
|
-
import { css, jsx } from '@emotion/react';
|
|
3
|
+
import { css } from '@emotion/react';
|
|
5
4
|
import EditIcon from '@atlaskit/icon/glyph/edit';
|
|
6
5
|
var editIconStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 20px;\n"])));
|
|
7
6
|
|
|
8
7
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
9
8
|
export var SmallerEditIcon = function SmallerEditIcon() {
|
|
10
|
-
return
|
|
9
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
11
10
|
css: editIconStyles
|
|
12
|
-
},
|
|
11
|
+
}, /*#__PURE__*/React.createElement(EditIcon, {
|
|
13
12
|
label: "edit"
|
|
14
13
|
}));
|
|
15
14
|
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
/** @jsx jsx */
|
|
3
2
|
import React from 'react';
|
|
4
|
-
import { jsx } from '@emotion/react';
|
|
5
3
|
import classnames from 'classnames';
|
|
6
4
|
import { akEditorMediaResizeHandlerPaddingWide, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
7
5
|
import { MEDIA_SINGLE_GUTTER_SIZE } from '../../media-single/constants';
|
|
@@ -77,7 +75,7 @@ export default function MediaSingle(_ref) {
|
|
|
77
75
|
var _children = _slicedToArray(children, 2),
|
|
78
76
|
media = _children[0],
|
|
79
77
|
caption = _children[1];
|
|
80
|
-
return
|
|
78
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
81
79
|
ref: handleMediaSingleRef,
|
|
82
80
|
css: MediaSingleDimensionHelper({
|
|
83
81
|
width: width,
|
|
@@ -95,7 +93,7 @@ export default function MediaSingle(_ref) {
|
|
|
95
93
|
'is-loading': isLoading,
|
|
96
94
|
'rich-media-wrapped': layout === 'wrap-left' || layout === 'wrap-right'
|
|
97
95
|
})
|
|
98
|
-
},
|
|
96
|
+
}, /*#__PURE__*/React.createElement(MediaWrapper, {
|
|
99
97
|
hasFallbackContainer: hasFallbackContainer,
|
|
100
98
|
height: mediaWrapperHeight,
|
|
101
99
|
paddingBottom: paddingBottom
|
|
@@ -2,10 +2,8 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
var _excluded = ["children"];
|
|
4
4
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
5
|
-
/** @jsx jsx */
|
|
6
|
-
|
|
7
5
|
import React from 'react';
|
|
8
|
-
import { css
|
|
6
|
+
import { css } from '@emotion/react';
|
|
9
7
|
import { akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
10
8
|
import { nonWrappedLayouts } from '../../utils';
|
|
11
9
|
import { calcBreakoutWidth, calcWideWidth } from '../../utils/breakout';
|
|
@@ -132,7 +130,7 @@ export var mediaWrapperStyle = function mediaWrapperStyle(props) {
|
|
|
132
130
|
export var MediaWrapper = function MediaWrapper(_ref3) {
|
|
133
131
|
var children = _ref3.children,
|
|
134
132
|
rest = _objectWithoutProperties(_ref3, _excluded);
|
|
135
|
-
return
|
|
133
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
136
134
|
css: mediaWrapperStyle(rest)
|
|
137
135
|
}, children);
|
|
138
136
|
};
|
|
@@ -147,7 +145,7 @@ MediaWrapper.displayName = 'WrapperMediaSingle';
|
|
|
147
145
|
|
|
148
146
|
export var MediaBorderGapFiller = function MediaBorderGapFiller(_ref4) {
|
|
149
147
|
var borderColor = _ref4.borderColor;
|
|
150
|
-
return
|
|
148
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
151
149
|
style: {
|
|
152
150
|
position: 'absolute',
|
|
153
151
|
inset: '0px',
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { css, jsx } from '@emotion/react';
|
|
3
|
+
import { css } from '@emotion/react';
|
|
6
4
|
import SuccessIcon from '@atlaskit/icon/glyph/editor/success';
|
|
7
5
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
8
6
|
import { G400, N200, R400 } from '@atlaskit/theme/colors';
|
|
@@ -15,19 +13,19 @@ var messageStyle = function messageStyle(props) {
|
|
|
15
13
|
var iconWrapperStyle = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n margin-right: ", ";\n"])), "var(--ds-space-050, 4px)");
|
|
16
14
|
export var HelperMessage = function HelperMessage(_ref) {
|
|
17
15
|
var children = _ref.children;
|
|
18
|
-
return
|
|
16
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
19
17
|
css: messageStyle
|
|
20
18
|
}, children);
|
|
21
19
|
};
|
|
22
20
|
export var ErrorMessage = function ErrorMessage(_ref2) {
|
|
23
21
|
var children = _ref2.children;
|
|
24
|
-
return
|
|
22
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
25
23
|
css: function css(theme) {
|
|
26
24
|
return [messageStyle(theme), errorColor];
|
|
27
25
|
}
|
|
28
|
-
},
|
|
26
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
29
27
|
css: iconWrapperStyle
|
|
30
|
-
},
|
|
28
|
+
}, /*#__PURE__*/React.createElement(ErrorIcon, {
|
|
31
29
|
size: "small",
|
|
32
30
|
label: "error",
|
|
33
31
|
"aria-label": "error"
|
|
@@ -35,13 +33,13 @@ export var ErrorMessage = function ErrorMessage(_ref2) {
|
|
|
35
33
|
};
|
|
36
34
|
export var ValidMessage = function ValidMessage(_ref3) {
|
|
37
35
|
var children = _ref3.children;
|
|
38
|
-
return
|
|
36
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
39
37
|
css: function css(theme) {
|
|
40
38
|
return [messageStyle(theme), validColor];
|
|
41
39
|
}
|
|
42
|
-
},
|
|
40
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
43
41
|
css: iconWrapperStyle
|
|
44
|
-
},
|
|
42
|
+
}, /*#__PURE__*/React.createElement(SuccessIcon, {
|
|
45
43
|
size: "small",
|
|
46
44
|
label: "success"
|
|
47
45
|
})), children);
|
|
@@ -8,10 +8,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
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); }; }
|
|
10
10
|
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; } }
|
|
11
|
-
/** @jsx jsx */
|
|
12
|
-
|
|
13
11
|
import { PureComponent } from 'react';
|
|
14
|
-
import { jsx } from '@emotion/react';
|
|
15
12
|
import { browser } from '../../utils';
|
|
16
13
|
import { panelTextInput, panelTextInputWithCustomWidth } from './styles';
|
|
17
14
|
var KeyZCode = 90;
|
|
@@ -118,7 +115,7 @@ var PanelTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
118
115
|
role = _this$props2.role,
|
|
119
116
|
inputId = _this$props2.inputId;
|
|
120
117
|
var value = this.state.value;
|
|
121
|
-
return
|
|
118
|
+
return /*#__PURE__*/React.createElement("input", {
|
|
122
119
|
css: [panelTextInput, width !== undefined && panelTextInputWithCustomWidth(width)],
|
|
123
120
|
role: role,
|
|
124
121
|
"aria-autocomplete": ariaAutoComplete ? 'list' : undefined,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
|
-
/** @jsx jsx */
|
|
4
3
|
import React, { useCallback, useRef } from 'react';
|
|
5
|
-
import { css
|
|
4
|
+
import { css } from '@emotion/react';
|
|
6
5
|
import { injectIntl } from 'react-intl-next';
|
|
7
6
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
8
7
|
import QuestionsIcon from '@atlaskit/icon/glyph/question-circle';
|
|
@@ -28,18 +27,18 @@ var UnsupportedBlockNode = function UnsupportedBlockNode(_ref) {
|
|
|
28
27
|
var tooltipOnShowHandler = useCallback(function () {
|
|
29
28
|
return dispatchAnalyticsEvent && trackUnsupportedContentTooltipDisplayedFor(dispatchAnalyticsEvent, ACTION_SUBJECT_ID.ON_UNSUPPORTED_BLOCK, originalNodeType);
|
|
30
29
|
}, [dispatchAnalyticsEvent, originalNodeType]);
|
|
31
|
-
return
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
32
31
|
css: blockNodeStyle,
|
|
33
32
|
className: "unsupported"
|
|
34
|
-
}, message,
|
|
33
|
+
}, message, /*#__PURE__*/React.createElement(Tooltip, {
|
|
35
34
|
content: tooltipContent,
|
|
36
35
|
hideTooltipOnClick: false,
|
|
37
36
|
position: "bottom",
|
|
38
37
|
onShow: tooltipOnShowHandler,
|
|
39
38
|
strategy: "absolute"
|
|
40
|
-
},
|
|
39
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
41
40
|
style: style
|
|
42
|
-
},
|
|
41
|
+
}, /*#__PURE__*/React.createElement(QuestionsIcon, {
|
|
43
42
|
label: "?",
|
|
44
43
|
size: "small"
|
|
45
44
|
}))));
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
|
-
/** @jsx jsx */
|
|
4
3
|
import React, { useCallback, useRef } from 'react';
|
|
5
|
-
import { css
|
|
4
|
+
import { css } from '@emotion/react';
|
|
6
5
|
import { injectIntl } from 'react-intl-next';
|
|
7
6
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
8
7
|
import QuestionsIcon from '@atlaskit/icon/glyph/question-circle';
|
|
@@ -28,17 +27,17 @@ var UnsupportedInlineNode = function UnsupportedInlineNode(_ref) {
|
|
|
28
27
|
var tooltipOnShowHandler = useCallback(function () {
|
|
29
28
|
return dispatchAnalyticsEvent && trackUnsupportedContentTooltipDisplayedFor(dispatchAnalyticsEvent, ACTION_SUBJECT_ID.ON_UNSUPPORTED_INLINE, originalNodeType);
|
|
30
29
|
}, [dispatchAnalyticsEvent, originalNodeType]);
|
|
31
|
-
return
|
|
30
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
32
31
|
css: inlineNodeStyle
|
|
33
|
-
}, message,
|
|
32
|
+
}, message, /*#__PURE__*/React.createElement(Tooltip, {
|
|
34
33
|
content: tooltipContent,
|
|
35
34
|
hideTooltipOnClick: false,
|
|
36
35
|
position: "bottom",
|
|
37
36
|
onShow: tooltipOnShowHandler,
|
|
38
37
|
strategy: "absolute"
|
|
39
|
-
},
|
|
38
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
40
39
|
style: style
|
|
41
|
-
},
|
|
40
|
+
}, /*#__PURE__*/React.createElement(QuestionsIcon, {
|
|
42
41
|
label: "?",
|
|
43
42
|
size: "small"
|
|
44
43
|
}))));
|
|
@@ -9,9 +9,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
9
9
|
var _templateObject;
|
|
10
10
|
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); }; }
|
|
11
11
|
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; } }
|
|
12
|
-
/** @jsx jsx */
|
|
13
12
|
import React from 'react';
|
|
14
|
-
import { css
|
|
13
|
+
import { css } from '@emotion/react';
|
|
15
14
|
import rafSchedule from 'raf-schd';
|
|
16
15
|
import { WidthObserver } from '@atlaskit/width-detector';
|
|
17
16
|
var SCROLLBAR_WIDTH = 30;
|
|
@@ -63,13 +62,13 @@ export var WidthProvider = /*#__PURE__*/function (_React$Component) {
|
|
|
63
62
|
_createClass(WidthProvider, [{
|
|
64
63
|
key: "render",
|
|
65
64
|
value: function render() {
|
|
66
|
-
return
|
|
65
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
67
66
|
css: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n "]))),
|
|
68
67
|
className: this.props.className
|
|
69
|
-
},
|
|
68
|
+
}, /*#__PURE__*/React.createElement(WidthObserver, {
|
|
70
69
|
setWidth: this.setWidth,
|
|
71
70
|
offscreen: true
|
|
72
|
-
}),
|
|
71
|
+
}), /*#__PURE__*/React.createElement(Provider, {
|
|
73
72
|
value: createWidthContext(this.state.width)
|
|
74
73
|
}, this.props.children));
|
|
75
74
|
}
|
|
@@ -7,9 +7,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
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); }; }
|
|
9
9
|
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; } }
|
|
10
|
-
/** @jsx jsx */
|
|
11
10
|
import React, { PureComponent } from 'react';
|
|
12
|
-
import { jsx } from '@emotion/react';
|
|
13
11
|
import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
|
|
14
12
|
import { N0 } from '@atlaskit/theme/colors';
|
|
15
13
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -51,11 +49,11 @@ var Color = /*#__PURE__*/function (_PureComponent) {
|
|
|
51
49
|
checkMarkColor = _this$props2$checkMar === void 0 ? N0 : _this$props2$checkMar,
|
|
52
50
|
hexToPaletteColor = _this$props2.hexToPaletteColor;
|
|
53
51
|
var colorStyle = hexToPaletteColor ? hexToPaletteColor(value) : value;
|
|
54
|
-
return
|
|
52
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
55
53
|
content: label
|
|
56
|
-
},
|
|
54
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
57
55
|
css: buttonWrapperStyle
|
|
58
|
-
},
|
|
56
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
59
57
|
css: buttonStyle,
|
|
60
58
|
"aria-label": label,
|
|
61
59
|
role: "radio",
|
|
@@ -69,7 +67,7 @@ var Color = /*#__PURE__*/function (_PureComponent) {
|
|
|
69
67
|
border: "1px solid ".concat(borderColor)
|
|
70
68
|
},
|
|
71
69
|
autoFocus: autoFocus
|
|
72
|
-
}, isSelected &&
|
|
70
|
+
}, isSelected && /*#__PURE__*/React.createElement(EditorDoneIcon, {
|
|
73
71
|
primaryColor: checkMarkColor,
|
|
74
72
|
label: ""
|
|
75
73
|
}))));
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
2
|
import chromatism from 'chromatism';
|
|
5
3
|
import { injectIntl } from 'react-intl-next';
|
|
6
4
|
import { N0, N500 } from '@atlaskit/theme/colors';
|
|
@@ -52,8 +50,8 @@ var ColorPalette = function ColorPalette(props) {
|
|
|
52
50
|
var colorsPerRow = React.useMemo(function () {
|
|
53
51
|
return getColorsPerRowFromPalette(palette, cols);
|
|
54
52
|
}, [palette, cols]);
|
|
55
|
-
return
|
|
56
|
-
return
|
|
53
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, colorsPerRow.map(function (row) {
|
|
54
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
57
55
|
css: colorPaletteWrapper,
|
|
58
56
|
className: className,
|
|
59
57
|
key: "row-first-color-".concat(row[0].value),
|
|
@@ -71,7 +69,7 @@ var ColorPalette = function ColorPalette(props) {
|
|
|
71
69
|
message = getColorMessage(paletteColorTooltipMessages.light, value.toUpperCase());
|
|
72
70
|
}
|
|
73
71
|
}
|
|
74
|
-
return
|
|
72
|
+
return /*#__PURE__*/React.createElement(Color, {
|
|
75
73
|
key: value,
|
|
76
74
|
value: value,
|
|
77
75
|
borderColor: border,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
4
|
-
/** @jsx jsx */
|
|
5
4
|
import React from 'react';
|
|
6
|
-
import { css
|
|
5
|
+
import { css } from '@emotion/react';
|
|
7
6
|
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
8
7
|
import Button from '@atlaskit/button';
|
|
9
8
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
@@ -117,7 +116,7 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
117
116
|
var _getSelectedRowAndCol = getSelectedRowAndColumnFromPalette(props.colorPalette, selectedColor, props.cols),
|
|
118
117
|
selectedRowIndex = _getSelectedRowAndCol.selectedRowIndex,
|
|
119
118
|
selectedColumnIndex = _getSelectedRowAndCol.selectedColumnIndex;
|
|
120
|
-
return
|
|
119
|
+
return /*#__PURE__*/React.createElement(Popup, {
|
|
121
120
|
target: buttonRef.current,
|
|
122
121
|
fitHeight: 350,
|
|
123
122
|
fitWidth: 350,
|
|
@@ -131,10 +130,10 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
131
130
|
zIndex: props.setDisableParentScroll ? 600 : undefined,
|
|
132
131
|
ariaLabel: "Color picker popup",
|
|
133
132
|
onPositionCalculated: onPositionCalculated
|
|
134
|
-
},
|
|
133
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
135
134
|
css: colorPickerWrapper,
|
|
136
135
|
"data-test-id": "color-picker-menu"
|
|
137
|
-
},
|
|
136
|
+
}, /*#__PURE__*/React.createElement(ArrowKeyNavigationProvider, {
|
|
138
137
|
type: ArrowKeyNavigationType.COLOR,
|
|
139
138
|
selectedRowIndex: selectedRowIndex,
|
|
140
139
|
selectedColumnIndex: selectedColumnIndex,
|
|
@@ -144,7 +143,7 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
144
143
|
},
|
|
145
144
|
isOpenedByKeyboard: isOpenedByKeyboard,
|
|
146
145
|
isPopupPositioned: isPopupPositioned
|
|
147
|
-
},
|
|
146
|
+
}, /*#__PURE__*/React.createElement(ColorPaletteWithListeners, {
|
|
148
147
|
cols: props.cols,
|
|
149
148
|
selectedColor: selectedColor,
|
|
150
149
|
onClick: onColorSelected,
|
|
@@ -167,12 +166,12 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
167
166
|
dark: "var(--ds-background-neutral-subtle-hovered, ".concat(N30A, ")")
|
|
168
167
|
})(theme));
|
|
169
168
|
};
|
|
170
|
-
return
|
|
169
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
171
170
|
css: colorPickerButtonWrapper
|
|
172
|
-
},
|
|
171
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
173
172
|
content: title,
|
|
174
173
|
position: "top"
|
|
175
|
-
},
|
|
174
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
176
175
|
ref: buttonRef,
|
|
177
176
|
"aria-label": title,
|
|
178
177
|
spacing: "compact",
|
|
@@ -185,9 +184,9 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
185
184
|
}
|
|
186
185
|
},
|
|
187
186
|
css: buttonStyle,
|
|
188
|
-
iconAfter:
|
|
187
|
+
iconAfter: /*#__PURE__*/React.createElement("span", {
|
|
189
188
|
css: colorPickerExpandContainer
|
|
190
|
-
},
|
|
189
|
+
}, /*#__PURE__*/React.createElement(ExpandIcon, {
|
|
191
190
|
label: ""
|
|
192
191
|
}))
|
|
193
192
|
})), renderPopup());
|
|
@@ -2,9 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
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; }
|
|
5
|
-
/** @jsx jsx */
|
|
6
5
|
import React, { useContext } from 'react';
|
|
7
|
-
import { jsx } from '@emotion/react';
|
|
8
6
|
import { ArrowKeyNavigationType } from '../ArrowKeyNavigationProvider/types';
|
|
9
7
|
import DropdownComponent from '../Dropdown';
|
|
10
8
|
import { KeyDownHandlerContext } from '../ToolbarArrowKeyNavigationProvider';
|
|
@@ -18,9 +16,10 @@ export var DropdownContainer = /*#__PURE__*/React.memo(function DropdownContaine
|
|
|
18
16
|
});
|
|
19
17
|
}
|
|
20
18
|
return (
|
|
19
|
+
/*#__PURE__*/
|
|
21
20
|
//This context is to handle the tab, Arrow Right/Left key events for dropdown.
|
|
22
21
|
//Default context has the void callbacks for above key events
|
|
23
|
-
|
|
22
|
+
React.createElement(DropdownComponent, _extends({}, props, {
|
|
24
23
|
arrowKeyNavigationProviderOptions: newArrowKeyNavigationProviderOptions
|
|
25
24
|
}))
|
|
26
25
|
);
|
|
@@ -16,10 +16,8 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
16
16
|
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; }
|
|
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
|
-
/** @jsx jsx */
|
|
20
|
-
|
|
21
19
|
import React, { PureComponent, useContext } from 'react';
|
|
22
|
-
import { css
|
|
20
|
+
import { css } from '@emotion/react';
|
|
23
21
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
24
22
|
import { CustomItem, MenuGroup, Section } from '@atlaskit/menu';
|
|
25
23
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
@@ -151,7 +149,7 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
151
149
|
}
|
|
152
150
|
}
|
|
153
151
|
});
|
|
154
|
-
return
|
|
152
|
+
return /*#__PURE__*/React.createElement(Popup, {
|
|
155
153
|
target: isOpen ? target : undefined,
|
|
156
154
|
mountTo: mountTo,
|
|
157
155
|
boundariesElement: boundariesElement,
|
|
@@ -161,10 +159,10 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
161
159
|
fitWidth: fitWidth,
|
|
162
160
|
zIndex: zIndex || akEditorFloatingPanelZIndex,
|
|
163
161
|
offset: offset
|
|
164
|
-
},
|
|
162
|
+
}, /*#__PURE__*/React.createElement(ArrowKeyNavigationProvider, _extends({}, navigationProviderProps, {
|
|
165
163
|
handleClose: this.handleCloseAndFocus,
|
|
166
164
|
closeOnTab: true
|
|
167
|
-
}),
|
|
165
|
+
}), /*#__PURE__*/React.createElement(DropListWithOutsideListeners, {
|
|
168
166
|
isOpen: true,
|
|
169
167
|
appearance: "tall",
|
|
170
168
|
position: popupPlacement.join(' '),
|
|
@@ -178,23 +176,23 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
178
176
|
e.stopPropagation();
|
|
179
177
|
},
|
|
180
178
|
targetRef: this.state.target
|
|
181
|
-
},
|
|
179
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
182
180
|
style: {
|
|
183
181
|
height: 0,
|
|
184
182
|
minWidth: fitWidth || 0
|
|
185
183
|
}
|
|
186
|
-
}),
|
|
184
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
187
185
|
ref: this.popupRef
|
|
188
|
-
}, getBooleanFF('platform.editor.menu.group-items') &&
|
|
186
|
+
}, getBooleanFF('platform.editor.menu.group-items') && /*#__PURE__*/React.createElement(MenuGroup, {
|
|
189
187
|
role: shouldUseDefaultRole ? 'group' : 'menu'
|
|
190
188
|
}, items.map(function (group, index) {
|
|
191
|
-
return
|
|
189
|
+
return /*#__PURE__*/React.createElement(Section, {
|
|
192
190
|
hasSeparator: (section === null || section === void 0 ? void 0 : section.hasSeparator) && index > 0,
|
|
193
191
|
title: section === null || section === void 0 ? void 0 : section.title,
|
|
194
192
|
key: index
|
|
195
193
|
}, group.items.map(function (item) {
|
|
196
194
|
var _item$key;
|
|
197
|
-
return
|
|
195
|
+
return /*#__PURE__*/React.createElement(DropdownMenuItem, {
|
|
198
196
|
key: (_item$key = item.key) !== null && _item$key !== void 0 ? _item$key : String(item.content),
|
|
199
197
|
item: item,
|
|
200
198
|
onItemActivated: _this2.props.onItemActivated,
|
|
@@ -204,12 +202,12 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
204
202
|
});
|
|
205
203
|
}));
|
|
206
204
|
})), !getBooleanFF('platform.editor.menu.group-items') && items.map(function (group, index) {
|
|
207
|
-
return
|
|
205
|
+
return /*#__PURE__*/React.createElement(MenuGroup, {
|
|
208
206
|
key: index,
|
|
209
207
|
role: shouldUseDefaultRole ? 'group' : 'menu'
|
|
210
208
|
}, group.items.map(function (item) {
|
|
211
209
|
var _item$key2;
|
|
212
|
-
return
|
|
210
|
+
return /*#__PURE__*/React.createElement(DropdownMenuItem, {
|
|
213
211
|
key: (_item$key2 = item.key) !== null && _item$key2 !== void 0 ? _item$key2 : String(item.content),
|
|
214
212
|
item: item,
|
|
215
213
|
onItemActivated: _this2.props.onItemActivated,
|
|
@@ -226,9 +224,9 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
226
224
|
var _this$props2 = this.props,
|
|
227
225
|
children = _this$props2.children,
|
|
228
226
|
isOpen = _this$props2.isOpen;
|
|
229
|
-
return
|
|
227
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
230
228
|
css: wrapper
|
|
231
|
-
},
|
|
229
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
232
230
|
ref: this.handleRef
|
|
233
231
|
}, children), isOpen ? this.renderDropdownMenu() : null);
|
|
234
232
|
}
|
|
@@ -254,7 +252,7 @@ export { DropdownMenuWrapper as default };
|
|
|
254
252
|
var DropdownMenuItemCustomComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
255
253
|
var children = props.children,
|
|
256
254
|
rest = _objectWithoutProperties(props, _excluded);
|
|
257
|
-
return
|
|
255
|
+
return /*#__PURE__*/React.createElement("span", _extends({
|
|
258
256
|
ref: ref
|
|
259
257
|
}, rest, {
|
|
260
258
|
style: {
|
|
@@ -283,14 +281,14 @@ function DropdownMenuItem(_ref) {
|
|
|
283
281
|
// onClick and value.name are the action indicators in the handlers
|
|
284
282
|
// If neither are present, don't wrap in an Item.
|
|
285
283
|
if (!item.onClick && !(item.value && item.value.name)) {
|
|
286
|
-
return
|
|
284
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
287
285
|
key: String(item.content)
|
|
288
286
|
}, item.content);
|
|
289
287
|
}
|
|
290
288
|
var _handleSubmenuActive = function _handleSubmenuActive(event) {
|
|
291
289
|
setSubmenuActive(!!event.target.closest(".".concat(DropdownMenuSharedCssClassName.SUBMENU)));
|
|
292
290
|
};
|
|
293
|
-
var dropListItem =
|
|
291
|
+
var dropListItem = /*#__PURE__*/React.createElement("div", {
|
|
294
292
|
css: function css(theme) {
|
|
295
293
|
return buttonStyles(item.isActive, submenuActive)({
|
|
296
294
|
theme: theme
|
|
@@ -299,7 +297,7 @@ function DropdownMenuItem(_ref) {
|
|
|
299
297
|
tabIndex: -1,
|
|
300
298
|
"aria-disabled": item.isDisabled ? 'true' : 'false',
|
|
301
299
|
onMouseDown: _handleSubmenuActive
|
|
302
|
-
},
|
|
300
|
+
}, /*#__PURE__*/React.createElement(CustomItem, {
|
|
303
301
|
item: item,
|
|
304
302
|
key: (_item$key3 = item.key) !== null && _item$key3 !== void 0 ? _item$key3 : String(item.content),
|
|
305
303
|
testId: "dropdown-item__".concat(String(item.content)),
|
|
@@ -332,7 +330,7 @@ function DropdownMenuItem(_ref) {
|
|
|
332
330
|
}, item.content));
|
|
333
331
|
if (item.tooltipDescription) {
|
|
334
332
|
var _item$key4;
|
|
335
|
-
return
|
|
333
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
336
334
|
key: (_item$key4 = item.key) !== null && _item$key4 !== void 0 ? _item$key4 : String(item.content),
|
|
337
335
|
content: item.tooltipDescription,
|
|
338
336
|
position: item.tooltipPosition
|
|
@@ -345,7 +343,7 @@ export var DropdownMenuWithKeyboardNavigation = /*#__PURE__*/React.memo(function
|
|
|
345
343
|
var keyDownHandlerContext = useContext(KeyDownHandlerContext);
|
|
346
344
|
// This context is to handle the tab, Arrow Right/Left key events for dropdown.
|
|
347
345
|
// Default context has the void callbacks for above key events
|
|
348
|
-
return
|
|
346
|
+
return /*#__PURE__*/React.createElement(DropdownMenuWrapper, _extends({
|
|
349
347
|
arrowKeyNavigationProviderOptions: _objectSpread(_objectSpread({}, props.arrowKeyNavigationProviderOptions), {}, {
|
|
350
348
|
keyDownHandlerContext: keyDownHandlerContext
|
|
351
349
|
})
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
|
-
/** @jsx jsx */
|
|
4
3
|
/* eslint-disable no-console */
|
|
5
4
|
|
|
6
5
|
import React, { useCallback, useLayoutEffect, useRef } from 'react';
|
|
7
|
-
import { css
|
|
6
|
+
import { css } from '@emotion/react';
|
|
8
7
|
import { fullPageMessages as messages } from '../../messages';
|
|
9
8
|
import { EDIT_AREA_ID } from '../../ui';
|
|
10
9
|
/*
|
|
@@ -182,14 +181,14 @@ export var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigatio
|
|
|
182
181
|
}
|
|
183
182
|
};
|
|
184
183
|
}, [selectedItemIndex, wrapperRef, editorView, disableArrowKeyNavigation, handleEscape, childComponentSelector, incrementIndex, decrementIndex, isShortcutToFocusToolbar, editorAppearance, useStickyToolbar]);
|
|
185
|
-
return
|
|
184
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
186
185
|
css: editorAppearance === 'comment' && centeredToolbarContainer,
|
|
187
186
|
className: "custom-key-handler-wrapper",
|
|
188
187
|
ref: wrapperRef,
|
|
189
188
|
role: "toolbar",
|
|
190
189
|
"aria-label": intl.formatMessage(messages.toolbarLabel),
|
|
191
190
|
"aria-controls": EDIT_AREA_ID
|
|
192
|
-
},
|
|
191
|
+
}, /*#__PURE__*/React.createElement(KeyDownHandlerContext.Provider, {
|
|
193
192
|
value: submenuKeydownHandleContext
|
|
194
193
|
}, children));
|
|
195
194
|
};
|
|
@@ -6,9 +6,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
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
|
+
|
|
10
10
|
import React, { useCallback } from 'react';
|
|
11
|
-
import { css
|
|
11
|
+
import { css } from '@emotion/react';
|
|
12
12
|
import { FabricChannel } from '@atlaskit/analytics-listeners';
|
|
13
13
|
import Tooltip from '@atlaskit/tooltip';
|
|
14
14
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, TOOLBAR_ACTION_SUBJECT_ID } from '../../analytics';
|
|
@@ -63,7 +63,7 @@ var ToolbarButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
63
63
|
}
|
|
64
64
|
}, [disabled, onClick, onItemClick, item, buttonId]);
|
|
65
65
|
var id = buttonId ? "editor-toolbar__".concat(buttonId) : undefined;
|
|
66
|
-
var button =
|
|
66
|
+
var button = /*#__PURE__*/React.createElement(Button, {
|
|
67
67
|
id: id,
|
|
68
68
|
ref: ref,
|
|
69
69
|
appearance: "subtle",
|
|
@@ -89,11 +89,11 @@ var ToolbarButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
89
89
|
return button;
|
|
90
90
|
}
|
|
91
91
|
var tooltipContent = !hideTooltip ? title : null;
|
|
92
|
-
return
|
|
92
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
93
93
|
content: tooltipContent,
|
|
94
94
|
hideTooltipOnClick: true,
|
|
95
95
|
position: titlePosition
|
|
96
|
-
},
|
|
96
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
97
97
|
css: buttonWrapper
|
|
98
98
|
}, button));
|
|
99
99
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
1
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -9,7 +10,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
9
10
|
var _excluded = ["handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown", "closeOnTab"];
|
|
10
11
|
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); }; }
|
|
11
12
|
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; } }
|
|
12
|
-
import React, { PureComponent } from 'react';
|
|
13
|
+
import React, { PureComponent, useEffect, useState } from 'react';
|
|
13
14
|
import ReactDOM from 'react-dom';
|
|
14
15
|
import ReactEditorViewContext from './ReactEditorViewContext';
|
|
15
16
|
|
|
@@ -101,7 +102,16 @@ export default function withReactEditorViewOuterListeners(Component) {
|
|
|
101
102
|
handleEscapeKeydown = _ref.handleEscapeKeydown,
|
|
102
103
|
closeOnTab = _ref.closeOnTab,
|
|
103
104
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
104
|
-
var
|
|
105
|
+
var isActiveProp = hasIsOpen(props) ? props.isOpen : true;
|
|
106
|
+
var _useState = useState(false),
|
|
107
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
108
|
+
isActiveComponent = _useState2[0],
|
|
109
|
+
setActiveComponent = _useState2[1];
|
|
110
|
+
useEffect(function () {
|
|
111
|
+
requestAnimationFrame(function () {
|
|
112
|
+
setActiveComponent(isActiveProp);
|
|
113
|
+
});
|
|
114
|
+
}, [isActiveProp]);
|
|
105
115
|
return /*#__PURE__*/React.createElement(ReactEditorViewContext.Consumer, null, function (_ref2) {
|
|
106
116
|
var editorView = _ref2.editorView,
|
|
107
117
|
editorRef = _ref2.editorRef;
|
package/package.json
CHANGED