@atlaskit/editor-plugin-floating-toolbar 0.7.12 → 0.7.13
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/ui/Dropdown.js +10 -11
- package/dist/cjs/ui/DropdownMenu.js +8 -10
- package/dist/cjs/ui/EmojiPickerButton.js +7 -8
- package/dist/cjs/ui/Input.js +3 -4
- package/dist/cjs/ui/ScrollButtons.js +5 -6
- package/dist/cjs/ui/Toolbar.js +19 -21
- package/dist/es2019/ui/Dropdown.js +11 -13
- package/dist/es2019/ui/DropdownMenu.js +8 -9
- package/dist/es2019/ui/EmojiPickerButton.js +8 -9
- package/dist/es2019/ui/Input.js +2 -4
- package/dist/es2019/ui/ScrollButtons.js +6 -7
- package/dist/es2019/ui/Toolbar.js +19 -20
- package/dist/esm/ui/Dropdown.js +11 -13
- package/dist/esm/ui/DropdownMenu.js +8 -9
- package/dist/esm/ui/EmojiPickerButton.js +8 -9
- package/dist/esm/ui/Input.js +2 -4
- package/dist/esm/ui/ScrollButtons.js +6 -7
- package/dist/esm/ui/Toolbar.js +19 -20
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 0.7.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#58763](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58763) [`0fdbd64522bf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0fdbd64522bf) - update ADF schema
|
|
8
|
+
|
|
3
9
|
## 0.7.12
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/ui/Dropdown.js
CHANGED
|
@@ -21,7 +21,6 @@ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
|
21
21
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
|
|
22
22
|
var _DropdownMenu = _interopRequireWildcard(require("./DropdownMenu"));
|
|
23
23
|
var _templateObject, _templateObject2;
|
|
24
|
-
/** @jsx jsx */
|
|
25
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
26
25
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
26
|
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; }
|
|
@@ -35,11 +34,11 @@ var dropdownExpandContainer = (0, _react2.css)(_templateObject || (_templateObje
|
|
|
35
34
|
var iconGroup = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n"])));
|
|
36
35
|
var CompositeIcon = function CompositeIcon(_ref) {
|
|
37
36
|
var icon = _ref.icon;
|
|
38
|
-
return
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
39
38
|
css: iconGroup
|
|
40
|
-
}, icon,
|
|
39
|
+
}, icon, /*#__PURE__*/_react.default.createElement("span", {
|
|
41
40
|
css: dropdownExpandContainer
|
|
42
|
-
},
|
|
41
|
+
}, /*#__PURE__*/_react.default.createElement(_chevronDown.default, {
|
|
43
42
|
label: "Expand dropdown menu"
|
|
44
43
|
})));
|
|
45
44
|
};
|
|
@@ -64,7 +63,7 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
64
63
|
showSelected = _this$props.showSelected,
|
|
65
64
|
dispatchCommand = _this$props.dispatchCommand,
|
|
66
65
|
editorView = _this$props.editorView;
|
|
67
|
-
return
|
|
66
|
+
return /*#__PURE__*/_react.default.createElement(_DropdownMenu.default, {
|
|
68
67
|
hide: _this.hide,
|
|
69
68
|
dispatchCommand: dispatchCommand,
|
|
70
69
|
items: options,
|
|
@@ -135,10 +134,10 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
135
134
|
alignDropdownWithToolbar = _this$props2.alignDropdownWithToolbar;
|
|
136
135
|
var trigger;
|
|
137
136
|
if (icon) {
|
|
138
|
-
var TriggerIcon = hideExpandIcon ? icon :
|
|
137
|
+
var TriggerIcon = hideExpandIcon ? icon : /*#__PURE__*/_react.default.createElement(CompositeIcon, {
|
|
139
138
|
icon: icon
|
|
140
139
|
});
|
|
141
|
-
trigger =
|
|
140
|
+
trigger = /*#__PURE__*/_react.default.createElement(_ui.FloatingToolbarButton, {
|
|
142
141
|
testId: buttonTestId,
|
|
143
142
|
title: title,
|
|
144
143
|
icon: TriggerIcon,
|
|
@@ -149,11 +148,11 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
149
148
|
tooltipContent: tooltip
|
|
150
149
|
});
|
|
151
150
|
} else {
|
|
152
|
-
trigger =
|
|
151
|
+
trigger = /*#__PURE__*/_react.default.createElement(_ui.FloatingToolbarButton, {
|
|
153
152
|
testId: buttonTestId,
|
|
154
|
-
iconAfter:
|
|
153
|
+
iconAfter: /*#__PURE__*/_react.default.createElement("span", {
|
|
155
154
|
css: dropdownExpandContainer
|
|
156
|
-
},
|
|
155
|
+
}, /*#__PURE__*/_react.default.createElement(_chevronDown.default, {
|
|
157
156
|
label: "Expand dropdown menu"
|
|
158
157
|
})),
|
|
159
158
|
onClick: this.toggleOpen,
|
|
@@ -173,7 +172,7 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
173
172
|
var fitTolerance = 10;
|
|
174
173
|
var fitWidth = Array.isArray(options) ? dropdownWidth || _DropdownMenu.menuItemDimensions.width : options.width;
|
|
175
174
|
var fitHeight = Array.isArray(options) ? options.length * _DropdownMenu.menuItemDimensions.height + _DropdownMenu.itemSpacing * 2 : options.height;
|
|
176
|
-
return
|
|
175
|
+
return /*#__PURE__*/_react.default.createElement(_uiMenu.DropdownContainer, {
|
|
177
176
|
mountTo: mountPoint,
|
|
178
177
|
boundariesElement: boundariesElement,
|
|
179
178
|
scrollableElement: scrollableElement,
|
|
@@ -21,9 +21,7 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
21
21
|
var _constants = require("@atlaskit/theme/constants");
|
|
22
22
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
23
23
|
var _messages = _interopRequireDefault(require("./messages"));
|
|
24
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
25
|
-
/** @jsx jsx */
|
|
26
|
-
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
24
|
+
var _templateObject, _templateObject2, _templateObject3; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
27
25
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
28
26
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
29
27
|
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; } }
|
|
@@ -135,7 +133,7 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
135
133
|
labelRefCurrent === null || labelRefCurrent === void 0 || labelRefCurrent.removeEventListener('mousedown', handleTitleWrapperMouseEvent);
|
|
136
134
|
};
|
|
137
135
|
});
|
|
138
|
-
var itemContent =
|
|
136
|
+
var itemContent = /*#__PURE__*/React.createElement(DropdownButtonItem, {
|
|
139
137
|
iconBefore: iconBefore,
|
|
140
138
|
iconAfter: item.elemAfter,
|
|
141
139
|
onClick: handleItemClick,
|
|
@@ -148,12 +146,12 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
148
146
|
onMouseOut: handleItemMouseOut,
|
|
149
147
|
onFocus: handleItemOnFocus,
|
|
150
148
|
onBlur: handleItemOnBlur
|
|
151
|
-
},
|
|
149
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
152
150
|
ref: labelRef,
|
|
153
151
|
css: label
|
|
154
152
|
}, item.title));
|
|
155
153
|
if (tooltipContent) {
|
|
156
|
-
return
|
|
154
|
+
return /*#__PURE__*/React.createElement(_tooltip.default, {
|
|
157
155
|
content: tooltipContent
|
|
158
156
|
}, itemContent);
|
|
159
157
|
}
|
|
@@ -178,12 +176,12 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
178
176
|
items = _this$props.items,
|
|
179
177
|
intl = _this$props.intl,
|
|
180
178
|
editorView = _this$props.editorView;
|
|
181
|
-
return
|
|
179
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
182
180
|
css: menuContainer
|
|
183
181
|
}, items.filter(function (item) {
|
|
184
182
|
return !item.hidden;
|
|
185
183
|
}).map(function (item, idx) {
|
|
186
|
-
return
|
|
184
|
+
return /*#__PURE__*/React.createElement(DropdownMenuItem, {
|
|
187
185
|
key: idx,
|
|
188
186
|
item: item,
|
|
189
187
|
hide: hide,
|
|
@@ -200,13 +198,13 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
200
198
|
showSelected = _this$props$showSelec === void 0 ? true : _this$props$showSelec;
|
|
201
199
|
var selected = item.selected;
|
|
202
200
|
if (showSelected && selected) {
|
|
203
|
-
return
|
|
201
|
+
return /*#__PURE__*/React.createElement(_done.default, {
|
|
204
202
|
primaryColor: "var(--ds-icon-selected, ".concat(_colors.B400, ")"),
|
|
205
203
|
size: "small",
|
|
206
204
|
label: intl.formatMessage(_messages.default.confirmModalOK)
|
|
207
205
|
});
|
|
208
206
|
}
|
|
209
|
-
return
|
|
207
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
210
208
|
css: spacer
|
|
211
209
|
});
|
|
212
210
|
}
|
|
@@ -17,7 +17,6 @@ var _emoji = require("@atlaskit/emoji");
|
|
|
17
17
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
18
18
|
var _EditorEmojiAddIcon = _interopRequireDefault(require("./EditorEmojiAddIcon"));
|
|
19
19
|
var _templateObject;
|
|
20
|
-
/** @jsx jsx */
|
|
21
20
|
// helps adjusts position of popup
|
|
22
21
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
23
22
|
var emojiPickerButtonWrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n"])));
|
|
@@ -66,7 +65,7 @@ var EmojiPickerButton = exports.EmojiPickerButton = function EmojiPickerButton(p
|
|
|
66
65
|
if (!providers.emojiProvider) {
|
|
67
66
|
return null;
|
|
68
67
|
}
|
|
69
|
-
return
|
|
68
|
+
return /*#__PURE__*/_react.default.createElement(EmojiPickerWithListener, {
|
|
70
69
|
emojiProvider: providers.emojiProvider,
|
|
71
70
|
onSelection: updateEmoji,
|
|
72
71
|
onPickerRef: function onPickerRef() {},
|
|
@@ -78,7 +77,7 @@ var EmojiPickerButton = exports.EmojiPickerButton = function EmojiPickerButton(p
|
|
|
78
77
|
if (!buttonRef.current || !isPopupOpen) {
|
|
79
78
|
return;
|
|
80
79
|
}
|
|
81
|
-
return
|
|
80
|
+
return /*#__PURE__*/_react.default.createElement(_ui.Popup, {
|
|
82
81
|
target: buttonRef.current,
|
|
83
82
|
mountTo: props.setDisableParentScroll ? props.mountPoint : buttonRef.current.parentElement,
|
|
84
83
|
fitHeight: 350,
|
|
@@ -90,19 +89,19 @@ var EmojiPickerButton = exports.EmojiPickerButton = function EmojiPickerButton(p
|
|
|
90
89
|
,
|
|
91
90
|
zIndex: props.setDisableParentScroll ? 600 : undefined,
|
|
92
91
|
focusTrap: true
|
|
93
|
-
},
|
|
92
|
+
}, /*#__PURE__*/_react.default.createElement(_providerFactory.WithProviders, {
|
|
94
93
|
providers: ['emojiProvider'],
|
|
95
94
|
providerFactory: props.providerFactory,
|
|
96
95
|
renderNode: renderPicker
|
|
97
96
|
}));
|
|
98
97
|
};
|
|
99
98
|
var title = props.title || '';
|
|
100
|
-
return
|
|
99
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
101
100
|
css: emojiPickerButtonWrapper
|
|
102
|
-
},
|
|
101
|
+
}, /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
103
102
|
content: title,
|
|
104
103
|
position: "top"
|
|
105
|
-
},
|
|
104
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
106
105
|
appearance: 'subtle',
|
|
107
106
|
key: props.idx,
|
|
108
107
|
style: {
|
|
@@ -116,6 +115,6 @@ var EmojiPickerButton = exports.EmojiPickerButton = function EmojiPickerButton(p
|
|
|
116
115
|
ref: buttonRef,
|
|
117
116
|
isSelected: props.isSelected,
|
|
118
117
|
"aria-label": title,
|
|
119
|
-
iconBefore:
|
|
118
|
+
iconBefore: /*#__PURE__*/_react.default.createElement(_EditorEmojiAddIcon.default, null)
|
|
120
119
|
})), renderPopup());
|
|
121
120
|
};
|
package/dist/cjs/ui/Input.js
CHANGED
|
@@ -14,12 +14,11 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
14
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
var _react2 = require("@emotion/react");
|
|
18
17
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
19
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
19
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
20
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
22
|
-
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; } }
|
|
21
|
+
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; } }
|
|
23
22
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
24
23
|
var TextField = exports.default = /*#__PURE__*/function (_Component) {
|
|
25
24
|
(0, _inherits2.default)(TextField, _Component);
|
|
@@ -63,9 +62,9 @@ var TextField = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
63
62
|
key: "render",
|
|
64
63
|
value: function render() {
|
|
65
64
|
var placeholder = this.props.placeholder;
|
|
66
|
-
return
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement("form", {
|
|
67
66
|
onSubmit: this.handleSubmit
|
|
68
|
-
},
|
|
67
|
+
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
69
68
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
70
69
|
css: _ui.panelTextInput,
|
|
71
70
|
value: this.state.text,
|
|
@@ -17,7 +17,6 @@ var _chevronRightLarge = _interopRequireDefault(require("@atlaskit/icon/glyph/ch
|
|
|
17
17
|
var _colors = require("@atlaskit/theme/colors");
|
|
18
18
|
var _messages = _interopRequireDefault(require("./messages"));
|
|
19
19
|
var _templateObject;
|
|
20
|
-
/** @jsx jsx */
|
|
21
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
22
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
@@ -132,20 +131,20 @@ var ScrollButtons = exports.ScrollButtons = function ScrollButtons(_ref) {
|
|
|
132
131
|
}
|
|
133
132
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
134
133
|
}, [node.type]);
|
|
135
|
-
return needScroll ?
|
|
134
|
+
return needScroll ? /*#__PURE__*/_react.default.createElement("div", {
|
|
136
135
|
ref: buttonsContainerRef,
|
|
137
136
|
css: toolbarScrollButtons,
|
|
138
137
|
className: "scroll-buttons"
|
|
139
|
-
},
|
|
138
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.FloatingToolbarButton, {
|
|
140
139
|
title: intl.formatMessage(_messages.default.floatingToolbarScrollLeft),
|
|
141
|
-
icon:
|
|
140
|
+
icon: /*#__PURE__*/_react.default.createElement(LeftIcon, {
|
|
142
141
|
label: intl.formatMessage(_messages.default.floatingToolbarScrollLeft)
|
|
143
142
|
}),
|
|
144
143
|
onClick: scrollLeft,
|
|
145
144
|
disabled: !canScrollLeft || disabled
|
|
146
|
-
}),
|
|
145
|
+
}), /*#__PURE__*/_react.default.createElement(_ui.FloatingToolbarButton, {
|
|
147
146
|
title: intl.formatMessage(_messages.default.floatingToolbarScrollRight),
|
|
148
|
-
icon:
|
|
147
|
+
icon: /*#__PURE__*/_react.default.createElement(RightIcon, {
|
|
149
148
|
label: intl.formatMessage(_messages.default.floatingToolbarScrollRight)
|
|
150
149
|
}),
|
|
151
150
|
onClick: scrollRight,
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -38,9 +38,7 @@ var _messages = _interopRequireDefault(require("./messages"));
|
|
|
38
38
|
var _ScrollButtons = require("./ScrollButtons");
|
|
39
39
|
var _Select = _interopRequireDefault(require("./Select"));
|
|
40
40
|
var _Separator = _interopRequireDefault(require("./Separator"));
|
|
41
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
|
|
42
|
-
/** @jsx jsx */
|
|
43
|
-
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
41
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
44
42
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
45
43
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
46
44
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -63,7 +61,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
63
61
|
featureFlags = _ref.featureFlags,
|
|
64
62
|
api = _ref.api;
|
|
65
63
|
var emojiAndColourPickerMountPoint = scrollable ? popupsMountPoint || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.fabric-editor-popup-scroll-parent')) || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.ak-editor-content-area')) || undefined : popupsMountPoint;
|
|
66
|
-
return
|
|
64
|
+
return /*#__PURE__*/_react.default.createElement(_buttonGroup.default, null, items.filter(function (item) {
|
|
67
65
|
return !item.hidden;
|
|
68
66
|
}).map(function (item, idx) {
|
|
69
67
|
var _api$contextPanel, _api$extension;
|
|
@@ -80,12 +78,12 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
80
78
|
}
|
|
81
79
|
}
|
|
82
80
|
};
|
|
83
|
-
return
|
|
81
|
+
return /*#__PURE__*/_react.default.createElement(_ui.FloatingToolbarButton, {
|
|
84
82
|
className: item.className,
|
|
85
83
|
key: idx,
|
|
86
84
|
title: item.title,
|
|
87
85
|
href: item.href,
|
|
88
|
-
icon: item.icon ?
|
|
86
|
+
icon: item.icon ? /*#__PURE__*/_react.default.createElement(ButtonIcon, {
|
|
89
87
|
label: item.title
|
|
90
88
|
}) : undefined,
|
|
91
89
|
appearance: item.appearance,
|
|
@@ -112,7 +110,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
112
110
|
tabIndex: item.tabIndex
|
|
113
111
|
}, item.showTitle && item.title);
|
|
114
112
|
case 'input':
|
|
115
|
-
return
|
|
113
|
+
return /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
116
114
|
key: idx,
|
|
117
115
|
mountPoint: popupsMountPoint,
|
|
118
116
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -131,10 +129,10 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
131
129
|
}
|
|
132
130
|
case 'dropdown':
|
|
133
131
|
var DropdownIcon = item.icon;
|
|
134
|
-
return
|
|
132
|
+
return /*#__PURE__*/_react.default.createElement(_Dropdown.default, {
|
|
135
133
|
key: idx,
|
|
136
134
|
title: item.title,
|
|
137
|
-
icon: DropdownIcon &&
|
|
135
|
+
icon: DropdownIcon && /*#__PURE__*/_react.default.createElement(DropdownIcon, {
|
|
138
136
|
label: item.title
|
|
139
137
|
}),
|
|
140
138
|
dispatchCommand: dispatchCommand,
|
|
@@ -157,7 +155,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
157
155
|
case 'select':
|
|
158
156
|
if (item.selectType === 'list') {
|
|
159
157
|
var ariaLabel = item.title || item.placeholder;
|
|
160
|
-
return
|
|
158
|
+
return /*#__PURE__*/_react.default.createElement(_Select.default, {
|
|
161
159
|
key: idx,
|
|
162
160
|
dispatchCommand: dispatchCommand,
|
|
163
161
|
options: item.options,
|
|
@@ -177,7 +175,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
177
175
|
});
|
|
178
176
|
}
|
|
179
177
|
if (item.selectType === 'color') {
|
|
180
|
-
return
|
|
178
|
+
return /*#__PURE__*/_react.default.createElement(_uiMenu.ColorPickerButton, {
|
|
181
179
|
skipFocusButtonAfterPick: true,
|
|
182
180
|
key: idx,
|
|
183
181
|
title: item.title,
|
|
@@ -203,7 +201,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
203
201
|
});
|
|
204
202
|
}
|
|
205
203
|
if (item.selectType === 'emoji') {
|
|
206
|
-
return
|
|
204
|
+
return /*#__PURE__*/_react.default.createElement(_EmojiPickerButton.EmojiPickerButton, {
|
|
207
205
|
key: idx,
|
|
208
206
|
editorView: editorView,
|
|
209
207
|
title: item.title,
|
|
@@ -226,7 +224,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
226
224
|
if (!extendFloatingToolbar) {
|
|
227
225
|
return null;
|
|
228
226
|
}
|
|
229
|
-
return
|
|
227
|
+
return /*#__PURE__*/_react.default.createElement(_ExtensionsPlaceholder.ExtensionsPlaceholder, {
|
|
230
228
|
key: idx,
|
|
231
229
|
node: node,
|
|
232
230
|
editorView: editorView,
|
|
@@ -236,7 +234,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
236
234
|
extensionApi: api === null || api === void 0 || (_api$extension = api.extension) === null || _api$extension === void 0 ? void 0 : _api$extension.actions.api()
|
|
237
235
|
});
|
|
238
236
|
case 'separator':
|
|
239
|
-
return
|
|
237
|
+
return /*#__PURE__*/_react.default.createElement(_Separator.default, {
|
|
240
238
|
key: idx
|
|
241
239
|
});
|
|
242
240
|
}
|
|
@@ -389,14 +387,14 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
389
387
|
//Alt + F10 to reach first element in this floating toolbar
|
|
390
388
|
return event.altKey && (event.key === 'F10' || event.keyCode === 121);
|
|
391
389
|
};
|
|
392
|
-
return
|
|
390
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_uiMenu.ToolbarArrowKeyNavigationProvider, {
|
|
393
391
|
editorView: this.props.editorView,
|
|
394
392
|
handleEscape: this.handleEscape,
|
|
395
393
|
disableArrowKeyNavigation: !this.shouldHandleArrowKeys(),
|
|
396
394
|
childComponentSelector: "[data-testid='editor-floating-toolbar']",
|
|
397
395
|
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
398
396
|
intl: intl
|
|
399
|
-
},
|
|
397
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
400
398
|
ref: this.toolbarContainerRef,
|
|
401
399
|
css: function css(theme) {
|
|
402
400
|
return [toolbarContainer({
|
|
@@ -407,26 +405,26 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
407
405
|
role: "toolbar",
|
|
408
406
|
"data-testid": "editor-floating-toolbar",
|
|
409
407
|
className: className
|
|
410
|
-
},
|
|
408
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.Announcer, {
|
|
411
409
|
text: intl.formatMessage(_messages.default.floatingToolbarAnnouncer),
|
|
412
410
|
delay: 250
|
|
413
|
-
}),
|
|
411
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
414
412
|
"data-testid": "floating-toolbar-items",
|
|
415
413
|
ref: this.scrollContainerRef
|
|
416
414
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
417
415
|
,
|
|
418
416
|
css: toolbarOverflow(scrollable, this.state.scrollDisabled, firstElementIsSelect)
|
|
419
|
-
},
|
|
417
|
+
}, /*#__PURE__*/_react.default.createElement(ToolbarItems, (0, _extends2.default)({}, this.props, {
|
|
420
418
|
setDisableScroll: this.setDisableScroll.bind(this),
|
|
421
419
|
mountRef: this.mountRef,
|
|
422
420
|
mounted: this.state.mounted,
|
|
423
421
|
featureFlags: this.props.featureFlags
|
|
424
|
-
}))), scrollable &&
|
|
422
|
+
}))), scrollable && /*#__PURE__*/_react.default.createElement(_ScrollButtons.ScrollButtons, {
|
|
425
423
|
intl: intl,
|
|
426
424
|
scrollContainerRef: this.scrollContainerRef,
|
|
427
425
|
node: node,
|
|
428
426
|
disabled: this.state.scrollDisabled
|
|
429
|
-
})),
|
|
427
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
430
428
|
ref: this.mountRef
|
|
431
429
|
})));
|
|
432
430
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
/** @jsx jsx */
|
|
3
|
-
|
|
4
2
|
import React, { Component } from 'react';
|
|
5
|
-
import { css
|
|
3
|
+
import { css } from '@emotion/react';
|
|
6
4
|
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
7
5
|
import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
8
6
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
@@ -19,11 +17,11 @@ const iconGroup = css`
|
|
|
19
17
|
`;
|
|
20
18
|
const CompositeIcon = ({
|
|
21
19
|
icon
|
|
22
|
-
}) =>
|
|
20
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
23
21
|
css: iconGroup
|
|
24
|
-
}, icon,
|
|
22
|
+
}, icon, /*#__PURE__*/React.createElement("span", {
|
|
25
23
|
css: dropdownExpandContainer
|
|
26
|
-
},
|
|
24
|
+
}, /*#__PURE__*/React.createElement(ExpandIcon, {
|
|
27
25
|
label: "Expand dropdown menu"
|
|
28
26
|
})));
|
|
29
27
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
@@ -41,7 +39,7 @@ export default class Dropdown extends Component {
|
|
|
41
39
|
dispatchCommand,
|
|
42
40
|
editorView
|
|
43
41
|
} = this.props;
|
|
44
|
-
return
|
|
42
|
+
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
45
43
|
hide: this.hide,
|
|
46
44
|
dispatchCommand: dispatchCommand,
|
|
47
45
|
items: options,
|
|
@@ -113,10 +111,10 @@ export default class Dropdown extends Component {
|
|
|
113
111
|
} = this.props;
|
|
114
112
|
let trigger;
|
|
115
113
|
if (icon) {
|
|
116
|
-
const TriggerIcon = hideExpandIcon ? icon :
|
|
114
|
+
const TriggerIcon = hideExpandIcon ? icon : /*#__PURE__*/React.createElement(CompositeIcon, {
|
|
117
115
|
icon: icon
|
|
118
116
|
});
|
|
119
|
-
trigger =
|
|
117
|
+
trigger = /*#__PURE__*/React.createElement(Button, {
|
|
120
118
|
testId: buttonTestId,
|
|
121
119
|
title: title,
|
|
122
120
|
icon: TriggerIcon,
|
|
@@ -127,11 +125,11 @@ export default class Dropdown extends Component {
|
|
|
127
125
|
tooltipContent: tooltip
|
|
128
126
|
});
|
|
129
127
|
} else {
|
|
130
|
-
trigger =
|
|
128
|
+
trigger = /*#__PURE__*/React.createElement(Button, {
|
|
131
129
|
testId: buttonTestId,
|
|
132
|
-
iconAfter:
|
|
130
|
+
iconAfter: /*#__PURE__*/React.createElement("span", {
|
|
133
131
|
css: dropdownExpandContainer
|
|
134
|
-
},
|
|
132
|
+
}, /*#__PURE__*/React.createElement(ExpandIcon, {
|
|
135
133
|
label: "Expand dropdown menu"
|
|
136
134
|
})),
|
|
137
135
|
onClick: this.toggleOpen,
|
|
@@ -151,7 +149,7 @@ export default class Dropdown extends Component {
|
|
|
151
149
|
const fitTolerance = 10;
|
|
152
150
|
const fitWidth = Array.isArray(options) ? dropdownWidth || menuItemDimensions.width : options.width;
|
|
153
151
|
const fitHeight = Array.isArray(options) ? options.length * menuItemDimensions.height + itemSpacing * 2 : options.height;
|
|
154
|
-
return
|
|
152
|
+
return /*#__PURE__*/React.createElement(UiDropdown, {
|
|
155
153
|
mountTo: mountPoint,
|
|
156
154
|
boundariesElement: boundariesElement,
|
|
157
155
|
scrollableElement: scrollableElement,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import { createRef, useCallback, useEffect, useState } from 'react';
|
|
3
2
|
import { Component } from 'react';
|
|
4
|
-
import { css
|
|
3
|
+
import { css } from '@emotion/react';
|
|
5
4
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
6
5
|
|
|
7
6
|
import { injectIntl } from 'react-intl-next';
|
|
@@ -137,7 +136,7 @@ const DropdownMenuItem = ({
|
|
|
137
136
|
labelRefCurrent === null || labelRefCurrent === void 0 ? void 0 : labelRefCurrent.removeEventListener('mousedown', handleTitleWrapperMouseEvent);
|
|
138
137
|
};
|
|
139
138
|
});
|
|
140
|
-
const itemContent =
|
|
139
|
+
const itemContent = /*#__PURE__*/React.createElement(DropdownButtonItem, {
|
|
141
140
|
iconBefore: iconBefore,
|
|
142
141
|
iconAfter: item.elemAfter,
|
|
143
142
|
onClick: handleItemClick,
|
|
@@ -150,12 +149,12 @@ const DropdownMenuItem = ({
|
|
|
150
149
|
onMouseOut: handleItemMouseOut,
|
|
151
150
|
onFocus: handleItemOnFocus,
|
|
152
151
|
onBlur: handleItemOnBlur
|
|
153
|
-
},
|
|
152
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
154
153
|
ref: labelRef,
|
|
155
154
|
css: label
|
|
156
155
|
}, item.title));
|
|
157
156
|
if (tooltipContent) {
|
|
158
|
-
return
|
|
157
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
159
158
|
content: tooltipContent
|
|
160
159
|
}, itemContent);
|
|
161
160
|
}
|
|
@@ -172,9 +171,9 @@ class Dropdown extends Component {
|
|
|
172
171
|
intl,
|
|
173
172
|
editorView
|
|
174
173
|
} = this.props;
|
|
175
|
-
return
|
|
174
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
176
175
|
css: menuContainer
|
|
177
|
-
}, items.filter(item => !item.hidden).map((item, idx) =>
|
|
176
|
+
}, items.filter(item => !item.hidden).map((item, idx) => /*#__PURE__*/React.createElement(DropdownMenuItem, {
|
|
178
177
|
key: idx,
|
|
179
178
|
item: item,
|
|
180
179
|
hide: hide,
|
|
@@ -191,13 +190,13 @@ class Dropdown extends Component {
|
|
|
191
190
|
selected
|
|
192
191
|
} = item;
|
|
193
192
|
if (showSelected && selected) {
|
|
194
|
-
return
|
|
193
|
+
return /*#__PURE__*/React.createElement(EditorDoneIcon, {
|
|
195
194
|
primaryColor: `var(--ds-icon-selected, ${B400})`,
|
|
196
195
|
size: "small",
|
|
197
196
|
label: intl.formatMessage(messages.confirmModalOK)
|
|
198
197
|
});
|
|
199
198
|
}
|
|
200
|
-
return
|
|
199
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
201
200
|
css: spacer
|
|
202
201
|
});
|
|
203
202
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import { css
|
|
2
|
+
import { css } from '@emotion/react';
|
|
4
3
|
import Button from '@atlaskit/button';
|
|
5
4
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
6
5
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
@@ -54,7 +53,7 @@ export const EmojiPickerButton = props => {
|
|
|
54
53
|
if (!providers.emojiProvider) {
|
|
55
54
|
return null;
|
|
56
55
|
}
|
|
57
|
-
return
|
|
56
|
+
return /*#__PURE__*/React.createElement(EmojiPickerWithListener, {
|
|
58
57
|
emojiProvider: providers.emojiProvider,
|
|
59
58
|
onSelection: updateEmoji,
|
|
60
59
|
onPickerRef: () => {},
|
|
@@ -66,7 +65,7 @@ export const EmojiPickerButton = props => {
|
|
|
66
65
|
if (!buttonRef.current || !isPopupOpen) {
|
|
67
66
|
return;
|
|
68
67
|
}
|
|
69
|
-
return
|
|
68
|
+
return /*#__PURE__*/React.createElement(Popup, {
|
|
70
69
|
target: buttonRef.current,
|
|
71
70
|
mountTo: props.setDisableParentScroll ? props.mountPoint : buttonRef.current.parentElement,
|
|
72
71
|
fitHeight: 350,
|
|
@@ -78,19 +77,19 @@ export const EmojiPickerButton = props => {
|
|
|
78
77
|
,
|
|
79
78
|
zIndex: props.setDisableParentScroll ? 600 : undefined,
|
|
80
79
|
focusTrap: true
|
|
81
|
-
},
|
|
80
|
+
}, /*#__PURE__*/React.createElement(WithProviders, {
|
|
82
81
|
providers: ['emojiProvider'],
|
|
83
82
|
providerFactory: props.providerFactory,
|
|
84
83
|
renderNode: renderPicker
|
|
85
84
|
}));
|
|
86
85
|
};
|
|
87
86
|
const title = props.title || '';
|
|
88
|
-
return
|
|
87
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
89
88
|
css: emojiPickerButtonWrapper
|
|
90
|
-
},
|
|
89
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
91
90
|
content: title,
|
|
92
91
|
position: "top"
|
|
93
|
-
},
|
|
92
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
94
93
|
appearance: 'subtle',
|
|
95
94
|
key: props.idx,
|
|
96
95
|
style: {
|
|
@@ -104,6 +103,6 @@ export const EmojiPickerButton = props => {
|
|
|
104
103
|
ref: buttonRef,
|
|
105
104
|
isSelected: props.isSelected,
|
|
106
105
|
"aria-label": title,
|
|
107
|
-
iconBefore:
|
|
106
|
+
iconBefore: /*#__PURE__*/React.createElement(EditorEmojiAddIcon, null)
|
|
108
107
|
})), renderPopup());
|
|
109
108
|
};
|
package/dist/es2019/ui/Input.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
/** @jsx jsx */
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import { Component } from 'react';
|
|
5
|
-
import { jsx } from '@emotion/react';
|
|
6
4
|
import { panelTextInput } from '@atlaskit/editor-common/ui';
|
|
7
5
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
8
6
|
export default class TextField extends Component {
|
|
@@ -40,9 +38,9 @@ export default class TextField extends Component {
|
|
|
40
38
|
const {
|
|
41
39
|
placeholder
|
|
42
40
|
} = this.props;
|
|
43
|
-
return
|
|
41
|
+
return /*#__PURE__*/React.createElement("form", {
|
|
44
42
|
onSubmit: this.handleSubmit
|
|
45
|
-
},
|
|
43
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
46
44
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
47
45
|
css: panelTextInput,
|
|
48
46
|
value: this.state.text,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { css
|
|
2
|
+
import { css } from '@emotion/react';
|
|
4
3
|
import rafSchedule from 'raf-schd';
|
|
5
4
|
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
6
5
|
import ChevronLeftLargeIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
@@ -119,20 +118,20 @@ export const ScrollButtons = ({
|
|
|
119
118
|
}
|
|
120
119
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
121
120
|
}, [node.type]);
|
|
122
|
-
return needScroll ?
|
|
121
|
+
return needScroll ? /*#__PURE__*/React.createElement("div", {
|
|
123
122
|
ref: buttonsContainerRef,
|
|
124
123
|
css: toolbarScrollButtons,
|
|
125
124
|
className: "scroll-buttons"
|
|
126
|
-
},
|
|
125
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
127
126
|
title: intl.formatMessage(messages.floatingToolbarScrollLeft),
|
|
128
|
-
icon:
|
|
127
|
+
icon: /*#__PURE__*/React.createElement(LeftIcon, {
|
|
129
128
|
label: intl.formatMessage(messages.floatingToolbarScrollLeft)
|
|
130
129
|
}),
|
|
131
130
|
onClick: scrollLeft,
|
|
132
131
|
disabled: !canScrollLeft || disabled
|
|
133
|
-
}),
|
|
132
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
134
133
|
title: intl.formatMessage(messages.floatingToolbarScrollRight),
|
|
135
|
-
icon:
|
|
134
|
+
icon: /*#__PURE__*/React.createElement(RightIcon, {
|
|
136
135
|
label: intl.formatMessage(messages.floatingToolbarScrollRight)
|
|
137
136
|
}),
|
|
138
137
|
onClick: scrollRight,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
/** @jsx jsx */
|
|
4
3
|
import React, { Component } from 'react';
|
|
5
|
-
import { css
|
|
4
|
+
import { css } from '@emotion/react';
|
|
6
5
|
import { injectIntl } from 'react-intl-next';
|
|
7
6
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
8
7
|
import { areSameItems } from '@atlaskit/editor-common/floating-toolbar';
|
|
@@ -45,7 +44,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
45
44
|
api
|
|
46
45
|
}) => {
|
|
47
46
|
const emojiAndColourPickerMountPoint = scrollable ? popupsMountPoint || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.fabric-editor-popup-scroll-parent')) || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.ak-editor-content-area')) || undefined : popupsMountPoint;
|
|
48
|
-
return
|
|
47
|
+
return /*#__PURE__*/React.createElement(ButtonGroup, null, items.filter(item => !item.hidden).map((item, idx) => {
|
|
49
48
|
var _api$contextPanel, _api$extension;
|
|
50
49
|
switch (item.type) {
|
|
51
50
|
case 'button':
|
|
@@ -60,12 +59,12 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
};
|
|
63
|
-
return
|
|
62
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
64
63
|
className: item.className,
|
|
65
64
|
key: idx,
|
|
66
65
|
title: item.title,
|
|
67
66
|
href: item.href,
|
|
68
|
-
icon: item.icon ?
|
|
67
|
+
icon: item.icon ? /*#__PURE__*/React.createElement(ButtonIcon, {
|
|
69
68
|
label: item.title
|
|
70
69
|
}) : undefined,
|
|
71
70
|
appearance: item.appearance,
|
|
@@ -84,7 +83,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
84
83
|
tabIndex: item.tabIndex
|
|
85
84
|
}, item.showTitle && item.title);
|
|
86
85
|
case 'input':
|
|
87
|
-
return
|
|
86
|
+
return /*#__PURE__*/React.createElement(Input, {
|
|
88
87
|
key: idx,
|
|
89
88
|
mountPoint: popupsMountPoint,
|
|
90
89
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -99,10 +98,10 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
99
98
|
}
|
|
100
99
|
case 'dropdown':
|
|
101
100
|
const DropdownIcon = item.icon;
|
|
102
|
-
return
|
|
101
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
103
102
|
key: idx,
|
|
104
103
|
title: item.title,
|
|
105
|
-
icon: DropdownIcon &&
|
|
104
|
+
icon: DropdownIcon && /*#__PURE__*/React.createElement(DropdownIcon, {
|
|
106
105
|
label: item.title
|
|
107
106
|
}),
|
|
108
107
|
dispatchCommand: dispatchCommand,
|
|
@@ -125,7 +124,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
125
124
|
case 'select':
|
|
126
125
|
if (item.selectType === 'list') {
|
|
127
126
|
const ariaLabel = item.title || item.placeholder;
|
|
128
|
-
return
|
|
127
|
+
return /*#__PURE__*/React.createElement(Select, {
|
|
129
128
|
key: idx,
|
|
130
129
|
dispatchCommand: dispatchCommand,
|
|
131
130
|
options: item.options,
|
|
@@ -143,7 +142,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
143
142
|
});
|
|
144
143
|
}
|
|
145
144
|
if (item.selectType === 'color') {
|
|
146
|
-
return
|
|
145
|
+
return /*#__PURE__*/React.createElement(ColorPickerButton, {
|
|
147
146
|
skipFocusButtonAfterPick: true,
|
|
148
147
|
key: idx,
|
|
149
148
|
title: item.title,
|
|
@@ -169,7 +168,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
169
168
|
});
|
|
170
169
|
}
|
|
171
170
|
if (item.selectType === 'emoji') {
|
|
172
|
-
return
|
|
171
|
+
return /*#__PURE__*/React.createElement(EmojiPickerButton, {
|
|
173
172
|
key: idx,
|
|
174
173
|
editorView: editorView,
|
|
175
174
|
title: item.title,
|
|
@@ -191,7 +190,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
191
190
|
if (!extendFloatingToolbar) {
|
|
192
191
|
return null;
|
|
193
192
|
}
|
|
194
|
-
return
|
|
193
|
+
return /*#__PURE__*/React.createElement(ExtensionsPlaceholder, {
|
|
195
194
|
key: idx,
|
|
196
195
|
node: node,
|
|
197
196
|
editorView: editorView,
|
|
@@ -201,7 +200,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
201
200
|
extensionApi: api === null || api === void 0 ? void 0 : (_api$extension = api.extension) === null || _api$extension === void 0 ? void 0 : _api$extension.actions.api()
|
|
202
201
|
});
|
|
203
202
|
case 'separator':
|
|
204
|
-
return
|
|
203
|
+
return /*#__PURE__*/React.createElement(Separator, {
|
|
205
204
|
key: idx
|
|
206
205
|
});
|
|
207
206
|
}
|
|
@@ -386,14 +385,14 @@ class Toolbar extends Component {
|
|
|
386
385
|
//Alt + F10 to reach first element in this floating toolbar
|
|
387
386
|
return event.altKey && (event.key === 'F10' || event.keyCode === 121);
|
|
388
387
|
};
|
|
389
|
-
return
|
|
388
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ToolbarArrowKeyNavigationProvider, {
|
|
390
389
|
editorView: this.props.editorView,
|
|
391
390
|
handleEscape: this.handleEscape,
|
|
392
391
|
disableArrowKeyNavigation: !this.shouldHandleArrowKeys(),
|
|
393
392
|
childComponentSelector: "[data-testid='editor-floating-toolbar']",
|
|
394
393
|
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
395
394
|
intl: intl
|
|
396
|
-
},
|
|
395
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
397
396
|
ref: this.toolbarContainerRef,
|
|
398
397
|
css: theme => [toolbarContainer({
|
|
399
398
|
theme
|
|
@@ -402,26 +401,26 @@ class Toolbar extends Component {
|
|
|
402
401
|
role: "toolbar",
|
|
403
402
|
"data-testid": "editor-floating-toolbar",
|
|
404
403
|
className: className
|
|
405
|
-
},
|
|
404
|
+
}, /*#__PURE__*/React.createElement(Announcer, {
|
|
406
405
|
text: intl.formatMessage(messages.floatingToolbarAnnouncer),
|
|
407
406
|
delay: 250
|
|
408
|
-
}),
|
|
407
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
409
408
|
"data-testid": "floating-toolbar-items",
|
|
410
409
|
ref: this.scrollContainerRef
|
|
411
410
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
412
411
|
,
|
|
413
412
|
css: toolbarOverflow(scrollable, this.state.scrollDisabled, firstElementIsSelect)
|
|
414
|
-
},
|
|
413
|
+
}, /*#__PURE__*/React.createElement(ToolbarItems, _extends({}, this.props, {
|
|
415
414
|
setDisableScroll: this.setDisableScroll.bind(this),
|
|
416
415
|
mountRef: this.mountRef,
|
|
417
416
|
mounted: this.state.mounted,
|
|
418
417
|
featureFlags: this.props.featureFlags
|
|
419
|
-
}))), scrollable &&
|
|
418
|
+
}))), scrollable && /*#__PURE__*/React.createElement(ScrollButtons, {
|
|
420
419
|
intl: intl,
|
|
421
420
|
scrollContainerRef: this.scrollContainerRef,
|
|
422
421
|
node: node,
|
|
423
422
|
disabled: this.state.scrollDisabled
|
|
424
|
-
})),
|
|
423
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
425
424
|
ref: this.mountRef
|
|
426
425
|
})));
|
|
427
426
|
}
|
package/dist/esm/ui/Dropdown.js
CHANGED
|
@@ -11,10 +11,8 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
11
11
|
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; }
|
|
12
12
|
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); }; }
|
|
13
13
|
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; } }
|
|
14
|
-
/** @jsx jsx */
|
|
15
|
-
|
|
16
14
|
import React, { Component } from 'react';
|
|
17
|
-
import { css
|
|
15
|
+
import { css } from '@emotion/react';
|
|
18
16
|
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
19
17
|
import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
20
18
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
@@ -27,11 +25,11 @@ var dropdownExpandContainer = css(_templateObject || (_templateObject = _taggedT
|
|
|
27
25
|
var iconGroup = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
28
26
|
var CompositeIcon = function CompositeIcon(_ref) {
|
|
29
27
|
var icon = _ref.icon;
|
|
30
|
-
return
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31
29
|
css: iconGroup
|
|
32
|
-
}, icon,
|
|
30
|
+
}, icon, /*#__PURE__*/React.createElement("span", {
|
|
33
31
|
css: dropdownExpandContainer
|
|
34
|
-
},
|
|
32
|
+
}, /*#__PURE__*/React.createElement(ExpandIcon, {
|
|
35
33
|
label: "Expand dropdown menu"
|
|
36
34
|
})));
|
|
37
35
|
};
|
|
@@ -56,7 +54,7 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
56
54
|
showSelected = _this$props.showSelected,
|
|
57
55
|
dispatchCommand = _this$props.dispatchCommand,
|
|
58
56
|
editorView = _this$props.editorView;
|
|
59
|
-
return
|
|
57
|
+
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
60
58
|
hide: _this.hide,
|
|
61
59
|
dispatchCommand: dispatchCommand,
|
|
62
60
|
items: options,
|
|
@@ -127,10 +125,10 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
127
125
|
alignDropdownWithToolbar = _this$props2.alignDropdownWithToolbar;
|
|
128
126
|
var trigger;
|
|
129
127
|
if (icon) {
|
|
130
|
-
var TriggerIcon = hideExpandIcon ? icon :
|
|
128
|
+
var TriggerIcon = hideExpandIcon ? icon : /*#__PURE__*/React.createElement(CompositeIcon, {
|
|
131
129
|
icon: icon
|
|
132
130
|
});
|
|
133
|
-
trigger =
|
|
131
|
+
trigger = /*#__PURE__*/React.createElement(Button, {
|
|
134
132
|
testId: buttonTestId,
|
|
135
133
|
title: title,
|
|
136
134
|
icon: TriggerIcon,
|
|
@@ -141,11 +139,11 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
141
139
|
tooltipContent: tooltip
|
|
142
140
|
});
|
|
143
141
|
} else {
|
|
144
|
-
trigger =
|
|
142
|
+
trigger = /*#__PURE__*/React.createElement(Button, {
|
|
145
143
|
testId: buttonTestId,
|
|
146
|
-
iconAfter:
|
|
144
|
+
iconAfter: /*#__PURE__*/React.createElement("span", {
|
|
147
145
|
css: dropdownExpandContainer
|
|
148
|
-
},
|
|
146
|
+
}, /*#__PURE__*/React.createElement(ExpandIcon, {
|
|
149
147
|
label: "Expand dropdown menu"
|
|
150
148
|
})),
|
|
151
149
|
onClick: this.toggleOpen,
|
|
@@ -165,7 +163,7 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
165
163
|
var fitTolerance = 10;
|
|
166
164
|
var fitWidth = Array.isArray(options) ? dropdownWidth || menuItemDimensions.width : options.width;
|
|
167
165
|
var fitHeight = Array.isArray(options) ? options.length * menuItemDimensions.height + itemSpacing * 2 : options.height;
|
|
168
|
-
return
|
|
166
|
+
return /*#__PURE__*/React.createElement(UiDropdown, {
|
|
169
167
|
mountTo: mountPoint,
|
|
170
168
|
boundariesElement: boundariesElement,
|
|
171
169
|
scrollableElement: scrollableElement,
|
|
@@ -8,10 +8,9 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
8
8
|
var _templateObject, _templateObject2, _templateObject3;
|
|
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
11
|
import { createRef, useCallback, useEffect, useState } from 'react';
|
|
13
12
|
import { Component } from 'react';
|
|
14
|
-
import { css
|
|
13
|
+
import { css } from '@emotion/react';
|
|
15
14
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
16
15
|
|
|
17
16
|
import { injectIntl } from 'react-intl-next';
|
|
@@ -130,7 +129,7 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
130
129
|
labelRefCurrent === null || labelRefCurrent === void 0 || labelRefCurrent.removeEventListener('mousedown', handleTitleWrapperMouseEvent);
|
|
131
130
|
};
|
|
132
131
|
});
|
|
133
|
-
var itemContent =
|
|
132
|
+
var itemContent = /*#__PURE__*/React.createElement(DropdownButtonItem, {
|
|
134
133
|
iconBefore: iconBefore,
|
|
135
134
|
iconAfter: item.elemAfter,
|
|
136
135
|
onClick: handleItemClick,
|
|
@@ -143,12 +142,12 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
143
142
|
onMouseOut: handleItemMouseOut,
|
|
144
143
|
onFocus: handleItemOnFocus,
|
|
145
144
|
onBlur: handleItemOnBlur
|
|
146
|
-
},
|
|
145
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
147
146
|
ref: labelRef,
|
|
148
147
|
css: label
|
|
149
148
|
}, item.title));
|
|
150
149
|
if (tooltipContent) {
|
|
151
|
-
return
|
|
150
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
152
151
|
content: tooltipContent
|
|
153
152
|
}, itemContent);
|
|
154
153
|
}
|
|
@@ -173,12 +172,12 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
173
172
|
items = _this$props.items,
|
|
174
173
|
intl = _this$props.intl,
|
|
175
174
|
editorView = _this$props.editorView;
|
|
176
|
-
return
|
|
175
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
177
176
|
css: menuContainer
|
|
178
177
|
}, items.filter(function (item) {
|
|
179
178
|
return !item.hidden;
|
|
180
179
|
}).map(function (item, idx) {
|
|
181
|
-
return
|
|
180
|
+
return /*#__PURE__*/React.createElement(DropdownMenuItem, {
|
|
182
181
|
key: idx,
|
|
183
182
|
item: item,
|
|
184
183
|
hide: hide,
|
|
@@ -195,13 +194,13 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
195
194
|
showSelected = _this$props$showSelec === void 0 ? true : _this$props$showSelec;
|
|
196
195
|
var selected = item.selected;
|
|
197
196
|
if (showSelected && selected) {
|
|
198
|
-
return
|
|
197
|
+
return /*#__PURE__*/React.createElement(EditorDoneIcon, {
|
|
199
198
|
primaryColor: "var(--ds-icon-selected, ".concat(B400, ")"),
|
|
200
199
|
size: "small",
|
|
201
200
|
label: intl.formatMessage(messages.confirmModalOK)
|
|
202
201
|
});
|
|
203
202
|
}
|
|
204
|
-
return
|
|
203
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
205
204
|
css: spacer
|
|
206
205
|
});
|
|
207
206
|
}
|
|
@@ -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;
|
|
4
|
-
/** @jsx jsx */
|
|
5
4
|
import React from 'react';
|
|
6
|
-
import { css
|
|
5
|
+
import { css } from '@emotion/react';
|
|
7
6
|
import Button from '@atlaskit/button';
|
|
8
7
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
9
8
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
@@ -60,7 +59,7 @@ export var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
60
59
|
if (!providers.emojiProvider) {
|
|
61
60
|
return null;
|
|
62
61
|
}
|
|
63
|
-
return
|
|
62
|
+
return /*#__PURE__*/React.createElement(EmojiPickerWithListener, {
|
|
64
63
|
emojiProvider: providers.emojiProvider,
|
|
65
64
|
onSelection: updateEmoji,
|
|
66
65
|
onPickerRef: function onPickerRef() {},
|
|
@@ -72,7 +71,7 @@ export var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
72
71
|
if (!buttonRef.current || !isPopupOpen) {
|
|
73
72
|
return;
|
|
74
73
|
}
|
|
75
|
-
return
|
|
74
|
+
return /*#__PURE__*/React.createElement(Popup, {
|
|
76
75
|
target: buttonRef.current,
|
|
77
76
|
mountTo: props.setDisableParentScroll ? props.mountPoint : buttonRef.current.parentElement,
|
|
78
77
|
fitHeight: 350,
|
|
@@ -84,19 +83,19 @@ export var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
84
83
|
,
|
|
85
84
|
zIndex: props.setDisableParentScroll ? 600 : undefined,
|
|
86
85
|
focusTrap: true
|
|
87
|
-
},
|
|
86
|
+
}, /*#__PURE__*/React.createElement(WithProviders, {
|
|
88
87
|
providers: ['emojiProvider'],
|
|
89
88
|
providerFactory: props.providerFactory,
|
|
90
89
|
renderNode: renderPicker
|
|
91
90
|
}));
|
|
92
91
|
};
|
|
93
92
|
var title = props.title || '';
|
|
94
|
-
return
|
|
93
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
95
94
|
css: emojiPickerButtonWrapper
|
|
96
|
-
},
|
|
95
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
97
96
|
content: title,
|
|
98
97
|
position: "top"
|
|
99
|
-
},
|
|
98
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
100
99
|
appearance: 'subtle',
|
|
101
100
|
key: props.idx,
|
|
102
101
|
style: {
|
|
@@ -110,6 +109,6 @@ export var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
110
109
|
ref: buttonRef,
|
|
111
110
|
isSelected: props.isSelected,
|
|
112
111
|
"aria-label": title,
|
|
113
|
-
iconBefore:
|
|
112
|
+
iconBefore: /*#__PURE__*/React.createElement(EditorEmojiAddIcon, null)
|
|
114
113
|
})), renderPopup());
|
|
115
114
|
};
|
package/dist/esm/ui/Input.js
CHANGED
|
@@ -7,10 +7,8 @@ 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 from 'react';
|
|
12
11
|
import { Component } from 'react';
|
|
13
|
-
import { jsx } from '@emotion/react';
|
|
14
12
|
import { panelTextInput } from '@atlaskit/editor-common/ui';
|
|
15
13
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
16
14
|
var TextField = /*#__PURE__*/function (_Component) {
|
|
@@ -55,9 +53,9 @@ var TextField = /*#__PURE__*/function (_Component) {
|
|
|
55
53
|
key: "render",
|
|
56
54
|
value: function render() {
|
|
57
55
|
var placeholder = this.props.placeholder;
|
|
58
|
-
return
|
|
56
|
+
return /*#__PURE__*/React.createElement("form", {
|
|
59
57
|
onSubmit: this.handleSubmit
|
|
60
|
-
},
|
|
58
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
61
59
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
62
60
|
css: panelTextInput,
|
|
63
61
|
value: this.state.text,
|
|
@@ -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;
|
|
4
|
-
/** @jsx jsx */
|
|
5
4
|
import React, { useEffect, useRef, useState } from 'react';
|
|
6
|
-
import { css
|
|
5
|
+
import { css } from '@emotion/react';
|
|
7
6
|
import rafSchedule from 'raf-schd';
|
|
8
7
|
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
9
8
|
import ChevronLeftLargeIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
@@ -123,20 +122,20 @@ export var ScrollButtons = function ScrollButtons(_ref) {
|
|
|
123
122
|
}
|
|
124
123
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
125
124
|
}, [node.type]);
|
|
126
|
-
return needScroll ?
|
|
125
|
+
return needScroll ? /*#__PURE__*/React.createElement("div", {
|
|
127
126
|
ref: buttonsContainerRef,
|
|
128
127
|
css: toolbarScrollButtons,
|
|
129
128
|
className: "scroll-buttons"
|
|
130
|
-
},
|
|
129
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
131
130
|
title: intl.formatMessage(messages.floatingToolbarScrollLeft),
|
|
132
|
-
icon:
|
|
131
|
+
icon: /*#__PURE__*/React.createElement(LeftIcon, {
|
|
133
132
|
label: intl.formatMessage(messages.floatingToolbarScrollLeft)
|
|
134
133
|
}),
|
|
135
134
|
onClick: scrollLeft,
|
|
136
135
|
disabled: !canScrollLeft || disabled
|
|
137
|
-
}),
|
|
136
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
138
137
|
title: intl.formatMessage(messages.floatingToolbarScrollRight),
|
|
139
|
-
icon:
|
|
138
|
+
icon: /*#__PURE__*/React.createElement(RightIcon, {
|
|
140
139
|
label: intl.formatMessage(messages.floatingToolbarScrollRight)
|
|
141
140
|
}),
|
|
142
141
|
onClick: scrollRight,
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -10,9 +10,8 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
10
10
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
|
|
11
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); }; }
|
|
12
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; } }
|
|
13
|
-
/** @jsx jsx */
|
|
14
13
|
import React, { Component } from 'react';
|
|
15
|
-
import { css
|
|
14
|
+
import { css } from '@emotion/react';
|
|
16
15
|
import { injectIntl } from 'react-intl-next';
|
|
17
16
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
18
17
|
import { areSameItems } from '@atlaskit/editor-common/floating-toolbar';
|
|
@@ -54,7 +53,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
54
53
|
featureFlags = _ref.featureFlags,
|
|
55
54
|
api = _ref.api;
|
|
56
55
|
var emojiAndColourPickerMountPoint = scrollable ? popupsMountPoint || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.fabric-editor-popup-scroll-parent')) || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.ak-editor-content-area')) || undefined : popupsMountPoint;
|
|
57
|
-
return
|
|
56
|
+
return /*#__PURE__*/React.createElement(ButtonGroup, null, items.filter(function (item) {
|
|
58
57
|
return !item.hidden;
|
|
59
58
|
}).map(function (item, idx) {
|
|
60
59
|
var _api$contextPanel, _api$extension;
|
|
@@ -71,12 +70,12 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
72
|
};
|
|
74
|
-
return
|
|
73
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
75
74
|
className: item.className,
|
|
76
75
|
key: idx,
|
|
77
76
|
title: item.title,
|
|
78
77
|
href: item.href,
|
|
79
|
-
icon: item.icon ?
|
|
78
|
+
icon: item.icon ? /*#__PURE__*/React.createElement(ButtonIcon, {
|
|
80
79
|
label: item.title
|
|
81
80
|
}) : undefined,
|
|
82
81
|
appearance: item.appearance,
|
|
@@ -103,7 +102,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
103
102
|
tabIndex: item.tabIndex
|
|
104
103
|
}, item.showTitle && item.title);
|
|
105
104
|
case 'input':
|
|
106
|
-
return
|
|
105
|
+
return /*#__PURE__*/React.createElement(Input, {
|
|
107
106
|
key: idx,
|
|
108
107
|
mountPoint: popupsMountPoint,
|
|
109
108
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -122,10 +121,10 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
122
121
|
}
|
|
123
122
|
case 'dropdown':
|
|
124
123
|
var DropdownIcon = item.icon;
|
|
125
|
-
return
|
|
124
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
126
125
|
key: idx,
|
|
127
126
|
title: item.title,
|
|
128
|
-
icon: DropdownIcon &&
|
|
127
|
+
icon: DropdownIcon && /*#__PURE__*/React.createElement(DropdownIcon, {
|
|
129
128
|
label: item.title
|
|
130
129
|
}),
|
|
131
130
|
dispatchCommand: dispatchCommand,
|
|
@@ -148,7 +147,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
148
147
|
case 'select':
|
|
149
148
|
if (item.selectType === 'list') {
|
|
150
149
|
var ariaLabel = item.title || item.placeholder;
|
|
151
|
-
return
|
|
150
|
+
return /*#__PURE__*/React.createElement(Select, {
|
|
152
151
|
key: idx,
|
|
153
152
|
dispatchCommand: dispatchCommand,
|
|
154
153
|
options: item.options,
|
|
@@ -168,7 +167,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
168
167
|
});
|
|
169
168
|
}
|
|
170
169
|
if (item.selectType === 'color') {
|
|
171
|
-
return
|
|
170
|
+
return /*#__PURE__*/React.createElement(ColorPickerButton, {
|
|
172
171
|
skipFocusButtonAfterPick: true,
|
|
173
172
|
key: idx,
|
|
174
173
|
title: item.title,
|
|
@@ -194,7 +193,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
194
193
|
});
|
|
195
194
|
}
|
|
196
195
|
if (item.selectType === 'emoji') {
|
|
197
|
-
return
|
|
196
|
+
return /*#__PURE__*/React.createElement(EmojiPickerButton, {
|
|
198
197
|
key: idx,
|
|
199
198
|
editorView: editorView,
|
|
200
199
|
title: item.title,
|
|
@@ -217,7 +216,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
217
216
|
if (!extendFloatingToolbar) {
|
|
218
217
|
return null;
|
|
219
218
|
}
|
|
220
|
-
return
|
|
219
|
+
return /*#__PURE__*/React.createElement(ExtensionsPlaceholder, {
|
|
221
220
|
key: idx,
|
|
222
221
|
node: node,
|
|
223
222
|
editorView: editorView,
|
|
@@ -227,7 +226,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
227
226
|
extensionApi: api === null || api === void 0 || (_api$extension = api.extension) === null || _api$extension === void 0 ? void 0 : _api$extension.actions.api()
|
|
228
227
|
});
|
|
229
228
|
case 'separator':
|
|
230
|
-
return
|
|
229
|
+
return /*#__PURE__*/React.createElement(Separator, {
|
|
231
230
|
key: idx
|
|
232
231
|
});
|
|
233
232
|
}
|
|
@@ -380,14 +379,14 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
380
379
|
//Alt + F10 to reach first element in this floating toolbar
|
|
381
380
|
return event.altKey && (event.key === 'F10' || event.keyCode === 121);
|
|
382
381
|
};
|
|
383
|
-
return
|
|
382
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ToolbarArrowKeyNavigationProvider, {
|
|
384
383
|
editorView: this.props.editorView,
|
|
385
384
|
handleEscape: this.handleEscape,
|
|
386
385
|
disableArrowKeyNavigation: !this.shouldHandleArrowKeys(),
|
|
387
386
|
childComponentSelector: "[data-testid='editor-floating-toolbar']",
|
|
388
387
|
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
389
388
|
intl: intl
|
|
390
|
-
},
|
|
389
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
391
390
|
ref: this.toolbarContainerRef,
|
|
392
391
|
css: function css(theme) {
|
|
393
392
|
return [toolbarContainer({
|
|
@@ -398,26 +397,26 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
398
397
|
role: "toolbar",
|
|
399
398
|
"data-testid": "editor-floating-toolbar",
|
|
400
399
|
className: className
|
|
401
|
-
},
|
|
400
|
+
}, /*#__PURE__*/React.createElement(Announcer, {
|
|
402
401
|
text: intl.formatMessage(messages.floatingToolbarAnnouncer),
|
|
403
402
|
delay: 250
|
|
404
|
-
}),
|
|
403
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
405
404
|
"data-testid": "floating-toolbar-items",
|
|
406
405
|
ref: this.scrollContainerRef
|
|
407
406
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
408
407
|
,
|
|
409
408
|
css: toolbarOverflow(scrollable, this.state.scrollDisabled, firstElementIsSelect)
|
|
410
|
-
},
|
|
409
|
+
}, /*#__PURE__*/React.createElement(ToolbarItems, _extends({}, this.props, {
|
|
411
410
|
setDisableScroll: this.setDisableScroll.bind(this),
|
|
412
411
|
mountRef: this.mountRef,
|
|
413
412
|
mounted: this.state.mounted,
|
|
414
413
|
featureFlags: this.props.featureFlags
|
|
415
|
-
}))), scrollable &&
|
|
414
|
+
}))), scrollable && /*#__PURE__*/React.createElement(ScrollButtons, {
|
|
416
415
|
intl: intl,
|
|
417
416
|
scrollContainerRef: this.scrollContainerRef,
|
|
418
417
|
node: node,
|
|
419
418
|
disabled: this.state.scrollDisabled
|
|
420
|
-
})),
|
|
419
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
421
420
|
ref: this.mountRef
|
|
422
421
|
})));
|
|
423
422
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.13",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
".": "./src/index.ts"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@atlaskit/adf-schema": "^
|
|
26
|
+
"@atlaskit/adf-schema": "^35.0.0",
|
|
27
27
|
"@atlaskit/adf-utils": "^19.0.0",
|
|
28
28
|
"@atlaskit/button": "^16.17.0",
|
|
29
29
|
"@atlaskit/checkbox": "^13.0.0",
|
|
30
|
-
"@atlaskit/editor-common": "^76.
|
|
30
|
+
"@atlaskit/editor-common": "^76.24.0",
|
|
31
31
|
"@atlaskit/editor-palette": "1.5.2",
|
|
32
32
|
"@atlaskit/editor-plugin-context-panel": "^0.2.0",
|
|
33
33
|
"@atlaskit/editor-plugin-copy-button": "^1.0.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@atlaskit/emoji": "^67.6.0",
|
|
41
41
|
"@atlaskit/icon": "^22.0.0",
|
|
42
42
|
"@atlaskit/menu": "^2.1.0",
|
|
43
|
-
"@atlaskit/modal-dialog": "^12.
|
|
43
|
+
"@atlaskit/modal-dialog": "^12.10.0",
|
|
44
44
|
"@atlaskit/select": "^17.0.0",
|
|
45
45
|
"@atlaskit/theme": "^12.6.0",
|
|
46
46
|
"@atlaskit/tokens": "^1.29.0",
|