@atlaskit/editor-plugin-floating-toolbar 0.7.13 → 0.7.15
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 +13 -0
- package/dist/cjs/plugin.js +5 -2
- package/dist/cjs/ui/Dropdown.js +11 -10
- package/dist/cjs/ui/DropdownMenu.js +10 -8
- package/dist/cjs/ui/EmojiPickerButton.js +8 -7
- package/dist/cjs/ui/Input.js +4 -3
- package/dist/cjs/ui/ScrollButtons.js +6 -5
- package/dist/cjs/ui/Toolbar.js +24 -21
- package/dist/es2019/plugin.js +4 -2
- package/dist/es2019/ui/Dropdown.js +13 -11
- package/dist/es2019/ui/DropdownMenu.js +9 -8
- package/dist/es2019/ui/EmojiPickerButton.js +9 -8
- package/dist/es2019/ui/Input.js +4 -2
- package/dist/es2019/ui/ScrollButtons.js +7 -6
- package/dist/es2019/ui/Toolbar.js +23 -21
- package/dist/esm/plugin.js +5 -2
- package/dist/esm/ui/Dropdown.js +13 -11
- package/dist/esm/ui/DropdownMenu.js +9 -8
- package/dist/esm/ui/EmojiPickerButton.js +9 -8
- package/dist/esm/ui/Input.js +4 -2
- package/dist/esm/ui/ScrollButtons.js +7 -6
- package/dist/esm/ui/Toolbar.js +23 -21
- package/dist/types/ui/Toolbar.d.ts +1 -0
- package/dist/types-ts4.5/ui/Toolbar.d.ts +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 0.7.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#60029](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/60029) [`b9826ea49c47`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b9826ea49c47) - Update dependencies that were impacted by HOT-106483 to latest.
|
|
8
|
+
|
|
9
|
+
## 0.7.14
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#59147](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59147) [`f12e489f23b0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f12e489f23b0) - Re-build and deploy packages to NPM to resolve React/Compiled not found error (HOT-106483).
|
|
14
|
+
- [#56822](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/56822) [`77f4fbf44e93`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77f4fbf44e93) - ECA11Y-78: Added announce for the selected file
|
|
15
|
+
|
|
3
16
|
## 0.7.13
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -228,7 +228,9 @@ function ContentComponent(_ref5) {
|
|
|
228
228
|
right: 0,
|
|
229
229
|
bottom: 0
|
|
230
230
|
} : _config$absoluteOffse,
|
|
231
|
-
focusTrap = config.focusTrap
|
|
231
|
+
focusTrap = config.focusTrap,
|
|
232
|
+
_config$mediaAssistiv = config.mediaAssistiveMessage,
|
|
233
|
+
mediaAssistiveMessage = _config$mediaAssistiv === void 0 ? '' : _config$mediaAssistiv;
|
|
232
234
|
var targetRef = getDomRef(editorView, dispatchAnalyticsEvent);
|
|
233
235
|
if (!targetRef || editorDisabledState && editorDisabledState.editorDisabled) {
|
|
234
236
|
return null;
|
|
@@ -298,7 +300,8 @@ function ContentComponent(_ref5) {
|
|
|
298
300
|
extensionsProvider: providers.extensionProvider,
|
|
299
301
|
scrollable: scrollable,
|
|
300
302
|
featureFlags: featureFlags,
|
|
301
|
-
api: pluginInjectionApi
|
|
303
|
+
api: pluginInjectionApi,
|
|
304
|
+
mediaAssistiveMessage: mediaAssistiveMessage
|
|
302
305
|
});
|
|
303
306
|
}
|
|
304
307
|
})), /*#__PURE__*/_react.default.createElement(_ConfirmationModal.ConfirmationModal, {
|
package/dist/cjs/ui/Dropdown.js
CHANGED
|
@@ -21,6 +21,7 @@ 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 */
|
|
24
25
|
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); }
|
|
25
26
|
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; }
|
|
26
27
|
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; }
|
|
@@ -34,11 +35,11 @@ var dropdownExpandContainer = (0, _react2.css)(_templateObject || (_templateObje
|
|
|
34
35
|
var iconGroup = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n"])));
|
|
35
36
|
var CompositeIcon = function CompositeIcon(_ref) {
|
|
36
37
|
var icon = _ref.icon;
|
|
37
|
-
return
|
|
38
|
+
return (0, _react2.jsx)("div", {
|
|
38
39
|
css: iconGroup
|
|
39
|
-
}, icon,
|
|
40
|
+
}, icon, (0, _react2.jsx)("span", {
|
|
40
41
|
css: dropdownExpandContainer
|
|
41
|
-
},
|
|
42
|
+
}, (0, _react2.jsx)(_chevronDown.default, {
|
|
42
43
|
label: "Expand dropdown menu"
|
|
43
44
|
})));
|
|
44
45
|
};
|
|
@@ -63,7 +64,7 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
63
64
|
showSelected = _this$props.showSelected,
|
|
64
65
|
dispatchCommand = _this$props.dispatchCommand,
|
|
65
66
|
editorView = _this$props.editorView;
|
|
66
|
-
return
|
|
67
|
+
return (0, _react2.jsx)(_DropdownMenu.default, {
|
|
67
68
|
hide: _this.hide,
|
|
68
69
|
dispatchCommand: dispatchCommand,
|
|
69
70
|
items: options,
|
|
@@ -134,10 +135,10 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
134
135
|
alignDropdownWithToolbar = _this$props2.alignDropdownWithToolbar;
|
|
135
136
|
var trigger;
|
|
136
137
|
if (icon) {
|
|
137
|
-
var TriggerIcon = hideExpandIcon ? icon :
|
|
138
|
+
var TriggerIcon = hideExpandIcon ? icon : (0, _react2.jsx)(CompositeIcon, {
|
|
138
139
|
icon: icon
|
|
139
140
|
});
|
|
140
|
-
trigger =
|
|
141
|
+
trigger = (0, _react2.jsx)(_ui.FloatingToolbarButton, {
|
|
141
142
|
testId: buttonTestId,
|
|
142
143
|
title: title,
|
|
143
144
|
icon: TriggerIcon,
|
|
@@ -148,11 +149,11 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
148
149
|
tooltipContent: tooltip
|
|
149
150
|
});
|
|
150
151
|
} else {
|
|
151
|
-
trigger =
|
|
152
|
+
trigger = (0, _react2.jsx)(_ui.FloatingToolbarButton, {
|
|
152
153
|
testId: buttonTestId,
|
|
153
|
-
iconAfter:
|
|
154
|
+
iconAfter: (0, _react2.jsx)("span", {
|
|
154
155
|
css: dropdownExpandContainer
|
|
155
|
-
},
|
|
156
|
+
}, (0, _react2.jsx)(_chevronDown.default, {
|
|
156
157
|
label: "Expand dropdown menu"
|
|
157
158
|
})),
|
|
158
159
|
onClick: this.toggleOpen,
|
|
@@ -172,7 +173,7 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
172
173
|
var fitTolerance = 10;
|
|
173
174
|
var fitWidth = Array.isArray(options) ? dropdownWidth || _DropdownMenu.menuItemDimensions.width : options.width;
|
|
174
175
|
var fitHeight = Array.isArray(options) ? options.length * _DropdownMenu.menuItemDimensions.height + _DropdownMenu.itemSpacing * 2 : options.height;
|
|
175
|
-
return
|
|
176
|
+
return (0, _react2.jsx)(_uiMenu.DropdownContainer, {
|
|
176
177
|
mountTo: mountPoint,
|
|
177
178
|
boundariesElement: boundariesElement,
|
|
178
179
|
scrollableElement: scrollableElement,
|
|
@@ -21,7 +21,9 @@ 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;
|
|
24
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
25
|
+
/** @jsx jsx */
|
|
26
|
+
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
25
27
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
26
28
|
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); }; }
|
|
27
29
|
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; } }
|
|
@@ -133,7 +135,7 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
133
135
|
labelRefCurrent === null || labelRefCurrent === void 0 || labelRefCurrent.removeEventListener('mousedown', handleTitleWrapperMouseEvent);
|
|
134
136
|
};
|
|
135
137
|
});
|
|
136
|
-
var itemContent =
|
|
138
|
+
var itemContent = (0, _react2.jsx)(DropdownButtonItem, {
|
|
137
139
|
iconBefore: iconBefore,
|
|
138
140
|
iconAfter: item.elemAfter,
|
|
139
141
|
onClick: handleItemClick,
|
|
@@ -146,12 +148,12 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
146
148
|
onMouseOut: handleItemMouseOut,
|
|
147
149
|
onFocus: handleItemOnFocus,
|
|
148
150
|
onBlur: handleItemOnBlur
|
|
149
|
-
},
|
|
151
|
+
}, (0, _react2.jsx)("span", {
|
|
150
152
|
ref: labelRef,
|
|
151
153
|
css: label
|
|
152
154
|
}, item.title));
|
|
153
155
|
if (tooltipContent) {
|
|
154
|
-
return
|
|
156
|
+
return (0, _react2.jsx)(_tooltip.default, {
|
|
155
157
|
content: tooltipContent
|
|
156
158
|
}, itemContent);
|
|
157
159
|
}
|
|
@@ -176,12 +178,12 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
176
178
|
items = _this$props.items,
|
|
177
179
|
intl = _this$props.intl,
|
|
178
180
|
editorView = _this$props.editorView;
|
|
179
|
-
return
|
|
181
|
+
return (0, _react2.jsx)("div", {
|
|
180
182
|
css: menuContainer
|
|
181
183
|
}, items.filter(function (item) {
|
|
182
184
|
return !item.hidden;
|
|
183
185
|
}).map(function (item, idx) {
|
|
184
|
-
return
|
|
186
|
+
return (0, _react2.jsx)(DropdownMenuItem, {
|
|
185
187
|
key: idx,
|
|
186
188
|
item: item,
|
|
187
189
|
hide: hide,
|
|
@@ -198,13 +200,13 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
198
200
|
showSelected = _this$props$showSelec === void 0 ? true : _this$props$showSelec;
|
|
199
201
|
var selected = item.selected;
|
|
200
202
|
if (showSelected && selected) {
|
|
201
|
-
return
|
|
203
|
+
return (0, _react2.jsx)(_done.default, {
|
|
202
204
|
primaryColor: "var(--ds-icon-selected, ".concat(_colors.B400, ")"),
|
|
203
205
|
size: "small",
|
|
204
206
|
label: intl.formatMessage(_messages.default.confirmModalOK)
|
|
205
207
|
});
|
|
206
208
|
}
|
|
207
|
-
return
|
|
209
|
+
return (0, _react2.jsx)("span", {
|
|
208
210
|
css: spacer
|
|
209
211
|
});
|
|
210
212
|
}
|
|
@@ -17,6 +17,7 @@ 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 */
|
|
20
21
|
// helps adjusts position of popup
|
|
21
22
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
22
23
|
var emojiPickerButtonWrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n"])));
|
|
@@ -65,7 +66,7 @@ var EmojiPickerButton = exports.EmojiPickerButton = function EmojiPickerButton(p
|
|
|
65
66
|
if (!providers.emojiProvider) {
|
|
66
67
|
return null;
|
|
67
68
|
}
|
|
68
|
-
return
|
|
69
|
+
return (0, _react2.jsx)(EmojiPickerWithListener, {
|
|
69
70
|
emojiProvider: providers.emojiProvider,
|
|
70
71
|
onSelection: updateEmoji,
|
|
71
72
|
onPickerRef: function onPickerRef() {},
|
|
@@ -77,7 +78,7 @@ var EmojiPickerButton = exports.EmojiPickerButton = function EmojiPickerButton(p
|
|
|
77
78
|
if (!buttonRef.current || !isPopupOpen) {
|
|
78
79
|
return;
|
|
79
80
|
}
|
|
80
|
-
return
|
|
81
|
+
return (0, _react2.jsx)(_ui.Popup, {
|
|
81
82
|
target: buttonRef.current,
|
|
82
83
|
mountTo: props.setDisableParentScroll ? props.mountPoint : buttonRef.current.parentElement,
|
|
83
84
|
fitHeight: 350,
|
|
@@ -89,19 +90,19 @@ var EmojiPickerButton = exports.EmojiPickerButton = function EmojiPickerButton(p
|
|
|
89
90
|
,
|
|
90
91
|
zIndex: props.setDisableParentScroll ? 600 : undefined,
|
|
91
92
|
focusTrap: true
|
|
92
|
-
},
|
|
93
|
+
}, (0, _react2.jsx)(_providerFactory.WithProviders, {
|
|
93
94
|
providers: ['emojiProvider'],
|
|
94
95
|
providerFactory: props.providerFactory,
|
|
95
96
|
renderNode: renderPicker
|
|
96
97
|
}));
|
|
97
98
|
};
|
|
98
99
|
var title = props.title || '';
|
|
99
|
-
return
|
|
100
|
+
return (0, _react2.jsx)("div", {
|
|
100
101
|
css: emojiPickerButtonWrapper
|
|
101
|
-
},
|
|
102
|
+
}, (0, _react2.jsx)(_tooltip.default, {
|
|
102
103
|
content: title,
|
|
103
104
|
position: "top"
|
|
104
|
-
},
|
|
105
|
+
}, (0, _react2.jsx)(_button.default, {
|
|
105
106
|
appearance: 'subtle',
|
|
106
107
|
key: props.idx,
|
|
107
108
|
style: {
|
|
@@ -115,6 +116,6 @@ var EmojiPickerButton = exports.EmojiPickerButton = function EmojiPickerButton(p
|
|
|
115
116
|
ref: buttonRef,
|
|
116
117
|
isSelected: props.isSelected,
|
|
117
118
|
"aria-label": title,
|
|
118
|
-
iconBefore:
|
|
119
|
+
iconBefore: (0, _react2.jsx)(_EditorEmojiAddIcon.default, null)
|
|
119
120
|
})), renderPopup());
|
|
120
121
|
};
|
package/dist/cjs/ui/Input.js
CHANGED
|
@@ -14,11 +14,12 @@ 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");
|
|
17
18
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
18
19
|
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); }
|
|
19
20
|
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; }
|
|
20
21
|
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); }; }
|
|
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; } }
|
|
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; } } /** @jsx jsx */
|
|
22
23
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
23
24
|
var TextField = exports.default = /*#__PURE__*/function (_Component) {
|
|
24
25
|
(0, _inherits2.default)(TextField, _Component);
|
|
@@ -62,9 +63,9 @@ var TextField = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
62
63
|
key: "render",
|
|
63
64
|
value: function render() {
|
|
64
65
|
var placeholder = this.props.placeholder;
|
|
65
|
-
return
|
|
66
|
+
return (0, _react2.jsx)("form", {
|
|
66
67
|
onSubmit: this.handleSubmit
|
|
67
|
-
},
|
|
68
|
+
}, (0, _react2.jsx)("input", {
|
|
68
69
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
69
70
|
css: _ui.panelTextInput,
|
|
70
71
|
value: this.state.text,
|
|
@@ -17,6 +17,7 @@ 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 */
|
|
20
21
|
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); }
|
|
21
22
|
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; }
|
|
22
23
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
@@ -131,20 +132,20 @@ var ScrollButtons = exports.ScrollButtons = function ScrollButtons(_ref) {
|
|
|
131
132
|
}
|
|
132
133
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
133
134
|
}, [node.type]);
|
|
134
|
-
return needScroll ?
|
|
135
|
+
return needScroll ? (0, _react2.jsx)("div", {
|
|
135
136
|
ref: buttonsContainerRef,
|
|
136
137
|
css: toolbarScrollButtons,
|
|
137
138
|
className: "scroll-buttons"
|
|
138
|
-
},
|
|
139
|
+
}, (0, _react2.jsx)(_ui.FloatingToolbarButton, {
|
|
139
140
|
title: intl.formatMessage(_messages.default.floatingToolbarScrollLeft),
|
|
140
|
-
icon:
|
|
141
|
+
icon: (0, _react2.jsx)(LeftIcon, {
|
|
141
142
|
label: intl.formatMessage(_messages.default.floatingToolbarScrollLeft)
|
|
142
143
|
}),
|
|
143
144
|
onClick: scrollLeft,
|
|
144
145
|
disabled: !canScrollLeft || disabled
|
|
145
|
-
}),
|
|
146
|
+
}), (0, _react2.jsx)(_ui.FloatingToolbarButton, {
|
|
146
147
|
title: intl.formatMessage(_messages.default.floatingToolbarScrollRight),
|
|
147
|
-
icon:
|
|
148
|
+
icon: (0, _react2.jsx)(RightIcon, {
|
|
148
149
|
label: intl.formatMessage(_messages.default.floatingToolbarScrollRight)
|
|
149
150
|
}),
|
|
150
151
|
onClick: scrollRight,
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -38,7 +38,9 @@ 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;
|
|
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
|
|
42
44
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
43
45
|
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); }
|
|
44
46
|
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; }
|
|
@@ -61,7 +63,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
61
63
|
featureFlags = _ref.featureFlags,
|
|
62
64
|
api = _ref.api;
|
|
63
65
|
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;
|
|
64
|
-
return
|
|
66
|
+
return (0, _react2.jsx)(_buttonGroup.default, null, items.filter(function (item) {
|
|
65
67
|
return !item.hidden;
|
|
66
68
|
}).map(function (item, idx) {
|
|
67
69
|
var _api$contextPanel, _api$extension;
|
|
@@ -78,12 +80,12 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
82
|
};
|
|
81
|
-
return
|
|
83
|
+
return (0, _react2.jsx)(_ui.FloatingToolbarButton, {
|
|
82
84
|
className: item.className,
|
|
83
85
|
key: idx,
|
|
84
86
|
title: item.title,
|
|
85
87
|
href: item.href,
|
|
86
|
-
icon: item.icon ?
|
|
88
|
+
icon: item.icon ? (0, _react2.jsx)(ButtonIcon, {
|
|
87
89
|
label: item.title
|
|
88
90
|
}) : undefined,
|
|
89
91
|
appearance: item.appearance,
|
|
@@ -110,7 +112,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
110
112
|
tabIndex: item.tabIndex
|
|
111
113
|
}, item.showTitle && item.title);
|
|
112
114
|
case 'input':
|
|
113
|
-
return
|
|
115
|
+
return (0, _react2.jsx)(_Input.default, {
|
|
114
116
|
key: idx,
|
|
115
117
|
mountPoint: popupsMountPoint,
|
|
116
118
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -129,10 +131,10 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
129
131
|
}
|
|
130
132
|
case 'dropdown':
|
|
131
133
|
var DropdownIcon = item.icon;
|
|
132
|
-
return
|
|
134
|
+
return (0, _react2.jsx)(_Dropdown.default, {
|
|
133
135
|
key: idx,
|
|
134
136
|
title: item.title,
|
|
135
|
-
icon: DropdownIcon &&
|
|
137
|
+
icon: DropdownIcon && (0, _react2.jsx)(DropdownIcon, {
|
|
136
138
|
label: item.title
|
|
137
139
|
}),
|
|
138
140
|
dispatchCommand: dispatchCommand,
|
|
@@ -155,7 +157,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
155
157
|
case 'select':
|
|
156
158
|
if (item.selectType === 'list') {
|
|
157
159
|
var ariaLabel = item.title || item.placeholder;
|
|
158
|
-
return
|
|
160
|
+
return (0, _react2.jsx)(_Select.default, {
|
|
159
161
|
key: idx,
|
|
160
162
|
dispatchCommand: dispatchCommand,
|
|
161
163
|
options: item.options,
|
|
@@ -175,7 +177,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
175
177
|
});
|
|
176
178
|
}
|
|
177
179
|
if (item.selectType === 'color') {
|
|
178
|
-
return
|
|
180
|
+
return (0, _react2.jsx)(_uiMenu.ColorPickerButton, {
|
|
179
181
|
skipFocusButtonAfterPick: true,
|
|
180
182
|
key: idx,
|
|
181
183
|
title: item.title,
|
|
@@ -201,7 +203,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
201
203
|
});
|
|
202
204
|
}
|
|
203
205
|
if (item.selectType === 'emoji') {
|
|
204
|
-
return
|
|
206
|
+
return (0, _react2.jsx)(_EmojiPickerButton.EmojiPickerButton, {
|
|
205
207
|
key: idx,
|
|
206
208
|
editorView: editorView,
|
|
207
209
|
title: item.title,
|
|
@@ -224,7 +226,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
224
226
|
if (!extendFloatingToolbar) {
|
|
225
227
|
return null;
|
|
226
228
|
}
|
|
227
|
-
return
|
|
229
|
+
return (0, _react2.jsx)(_ExtensionsPlaceholder.ExtensionsPlaceholder, {
|
|
228
230
|
key: idx,
|
|
229
231
|
node: node,
|
|
230
232
|
editorView: editorView,
|
|
@@ -234,7 +236,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
234
236
|
extensionApi: api === null || api === void 0 || (_api$extension = api.extension) === null || _api$extension === void 0 ? void 0 : _api$extension.actions.api()
|
|
235
237
|
});
|
|
236
238
|
case 'separator':
|
|
237
|
-
return
|
|
239
|
+
return (0, _react2.jsx)(_Separator.default, {
|
|
238
240
|
key: idx
|
|
239
241
|
});
|
|
240
242
|
}
|
|
@@ -373,7 +375,8 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
373
375
|
className = _this$props2.className,
|
|
374
376
|
node = _this$props2.node,
|
|
375
377
|
intl = _this$props2.intl,
|
|
376
|
-
scrollable = _this$props2.scrollable
|
|
378
|
+
scrollable = _this$props2.scrollable,
|
|
379
|
+
mediaAssistiveMessage = _this$props2.mediaAssistiveMessage;
|
|
377
380
|
if (!items || !items.length) {
|
|
378
381
|
return null;
|
|
379
382
|
}
|
|
@@ -387,14 +390,14 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
387
390
|
//Alt + F10 to reach first element in this floating toolbar
|
|
388
391
|
return event.altKey && (event.key === 'F10' || event.keyCode === 121);
|
|
389
392
|
};
|
|
390
|
-
return
|
|
393
|
+
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_uiMenu.ToolbarArrowKeyNavigationProvider, {
|
|
391
394
|
editorView: this.props.editorView,
|
|
392
395
|
handleEscape: this.handleEscape,
|
|
393
396
|
disableArrowKeyNavigation: !this.shouldHandleArrowKeys(),
|
|
394
397
|
childComponentSelector: "[data-testid='editor-floating-toolbar']",
|
|
395
398
|
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
396
399
|
intl: intl
|
|
397
|
-
},
|
|
400
|
+
}, (0, _react2.jsx)("div", {
|
|
398
401
|
ref: this.toolbarContainerRef,
|
|
399
402
|
css: function css(theme) {
|
|
400
403
|
return [toolbarContainer({
|
|
@@ -405,26 +408,26 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
405
408
|
role: "toolbar",
|
|
406
409
|
"data-testid": "editor-floating-toolbar",
|
|
407
410
|
className: className
|
|
408
|
-
},
|
|
409
|
-
text: intl.formatMessage(_messages.default.floatingToolbarAnnouncer),
|
|
411
|
+
}, (0, _react2.jsx)(_ui.Announcer, {
|
|
412
|
+
text: mediaAssistiveMessage ? "".concat(mediaAssistiveMessage, ", ").concat(intl.formatMessage(_messages.default.floatingToolbarAnnouncer)) : intl.formatMessage(_messages.default.floatingToolbarAnnouncer),
|
|
410
413
|
delay: 250
|
|
411
|
-
}),
|
|
414
|
+
}), (0, _react2.jsx)("div", {
|
|
412
415
|
"data-testid": "floating-toolbar-items",
|
|
413
416
|
ref: this.scrollContainerRef
|
|
414
417
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
415
418
|
,
|
|
416
419
|
css: toolbarOverflow(scrollable, this.state.scrollDisabled, firstElementIsSelect)
|
|
417
|
-
},
|
|
420
|
+
}, (0, _react2.jsx)(ToolbarItems, (0, _extends2.default)({}, this.props, {
|
|
418
421
|
setDisableScroll: this.setDisableScroll.bind(this),
|
|
419
422
|
mountRef: this.mountRef,
|
|
420
423
|
mounted: this.state.mounted,
|
|
421
424
|
featureFlags: this.props.featureFlags
|
|
422
|
-
}))), scrollable &&
|
|
425
|
+
}))), scrollable && (0, _react2.jsx)(_ScrollButtons.ScrollButtons, {
|
|
423
426
|
intl: intl,
|
|
424
427
|
scrollContainerRef: this.scrollContainerRef,
|
|
425
428
|
node: node,
|
|
426
429
|
disabled: this.state.scrollDisabled
|
|
427
|
-
})),
|
|
430
|
+
})), (0, _react2.jsx)("div", {
|
|
428
431
|
ref: this.mountRef
|
|
429
432
|
})));
|
|
430
433
|
}
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -216,7 +216,8 @@ function ContentComponent({
|
|
|
216
216
|
right: 0,
|
|
217
217
|
bottom: 0
|
|
218
218
|
},
|
|
219
|
-
focusTrap
|
|
219
|
+
focusTrap,
|
|
220
|
+
mediaAssistiveMessage = ''
|
|
220
221
|
} = config;
|
|
221
222
|
const targetRef = getDomRef(editorView, dispatchAnalyticsEvent);
|
|
222
223
|
if (!targetRef || editorDisabledState && editorDisabledState.editorDisabled) {
|
|
@@ -284,7 +285,8 @@ function ContentComponent({
|
|
|
284
285
|
extensionsProvider: providers.extensionProvider,
|
|
285
286
|
scrollable: scrollable,
|
|
286
287
|
featureFlags: featureFlags,
|
|
287
|
-
api: pluginInjectionApi
|
|
288
|
+
api: pluginInjectionApi,
|
|
289
|
+
mediaAssistiveMessage: mediaAssistiveMessage
|
|
288
290
|
});
|
|
289
291
|
}
|
|
290
292
|
})), /*#__PURE__*/React.createElement(ConfirmationModal, {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
|
|
2
4
|
import React, { Component } from 'react';
|
|
3
|
-
import { css } from '@emotion/react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
4
6
|
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
5
7
|
import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
6
8
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
@@ -17,11 +19,11 @@ const iconGroup = css`
|
|
|
17
19
|
`;
|
|
18
20
|
const CompositeIcon = ({
|
|
19
21
|
icon
|
|
20
|
-
}) =>
|
|
22
|
+
}) => jsx("div", {
|
|
21
23
|
css: iconGroup
|
|
22
|
-
}, icon,
|
|
24
|
+
}, icon, jsx("span", {
|
|
23
25
|
css: dropdownExpandContainer
|
|
24
|
-
},
|
|
26
|
+
}, jsx(ExpandIcon, {
|
|
25
27
|
label: "Expand dropdown menu"
|
|
26
28
|
})));
|
|
27
29
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
@@ -39,7 +41,7 @@ export default class Dropdown extends Component {
|
|
|
39
41
|
dispatchCommand,
|
|
40
42
|
editorView
|
|
41
43
|
} = this.props;
|
|
42
|
-
return
|
|
44
|
+
return jsx(DropdownMenu, {
|
|
43
45
|
hide: this.hide,
|
|
44
46
|
dispatchCommand: dispatchCommand,
|
|
45
47
|
items: options,
|
|
@@ -111,10 +113,10 @@ export default class Dropdown extends Component {
|
|
|
111
113
|
} = this.props;
|
|
112
114
|
let trigger;
|
|
113
115
|
if (icon) {
|
|
114
|
-
const TriggerIcon = hideExpandIcon ? icon :
|
|
116
|
+
const TriggerIcon = hideExpandIcon ? icon : jsx(CompositeIcon, {
|
|
115
117
|
icon: icon
|
|
116
118
|
});
|
|
117
|
-
trigger =
|
|
119
|
+
trigger = jsx(Button, {
|
|
118
120
|
testId: buttonTestId,
|
|
119
121
|
title: title,
|
|
120
122
|
icon: TriggerIcon,
|
|
@@ -125,11 +127,11 @@ export default class Dropdown extends Component {
|
|
|
125
127
|
tooltipContent: tooltip
|
|
126
128
|
});
|
|
127
129
|
} else {
|
|
128
|
-
trigger =
|
|
130
|
+
trigger = jsx(Button, {
|
|
129
131
|
testId: buttonTestId,
|
|
130
|
-
iconAfter:
|
|
132
|
+
iconAfter: jsx("span", {
|
|
131
133
|
css: dropdownExpandContainer
|
|
132
|
-
},
|
|
134
|
+
}, jsx(ExpandIcon, {
|
|
133
135
|
label: "Expand dropdown menu"
|
|
134
136
|
})),
|
|
135
137
|
onClick: this.toggleOpen,
|
|
@@ -149,7 +151,7 @@ export default class Dropdown extends Component {
|
|
|
149
151
|
const fitTolerance = 10;
|
|
150
152
|
const fitWidth = Array.isArray(options) ? dropdownWidth || menuItemDimensions.width : options.width;
|
|
151
153
|
const fitHeight = Array.isArray(options) ? options.length * menuItemDimensions.height + itemSpacing * 2 : options.height;
|
|
152
|
-
return
|
|
154
|
+
return jsx(UiDropdown, {
|
|
153
155
|
mountTo: mountPoint,
|
|
154
156
|
boundariesElement: boundariesElement,
|
|
155
157
|
scrollableElement: scrollableElement,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import { createRef, useCallback, useEffect, useState } from 'react';
|
|
2
3
|
import { Component } from 'react';
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
4
5
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
5
6
|
|
|
6
7
|
import { injectIntl } from 'react-intl-next';
|
|
@@ -136,7 +137,7 @@ const DropdownMenuItem = ({
|
|
|
136
137
|
labelRefCurrent === null || labelRefCurrent === void 0 ? void 0 : labelRefCurrent.removeEventListener('mousedown', handleTitleWrapperMouseEvent);
|
|
137
138
|
};
|
|
138
139
|
});
|
|
139
|
-
const itemContent =
|
|
140
|
+
const itemContent = jsx(DropdownButtonItem, {
|
|
140
141
|
iconBefore: iconBefore,
|
|
141
142
|
iconAfter: item.elemAfter,
|
|
142
143
|
onClick: handleItemClick,
|
|
@@ -149,12 +150,12 @@ const DropdownMenuItem = ({
|
|
|
149
150
|
onMouseOut: handleItemMouseOut,
|
|
150
151
|
onFocus: handleItemOnFocus,
|
|
151
152
|
onBlur: handleItemOnBlur
|
|
152
|
-
},
|
|
153
|
+
}, jsx("span", {
|
|
153
154
|
ref: labelRef,
|
|
154
155
|
css: label
|
|
155
156
|
}, item.title));
|
|
156
157
|
if (tooltipContent) {
|
|
157
|
-
return
|
|
158
|
+
return jsx(Tooltip, {
|
|
158
159
|
content: tooltipContent
|
|
159
160
|
}, itemContent);
|
|
160
161
|
}
|
|
@@ -171,9 +172,9 @@ class Dropdown extends Component {
|
|
|
171
172
|
intl,
|
|
172
173
|
editorView
|
|
173
174
|
} = this.props;
|
|
174
|
-
return
|
|
175
|
+
return jsx("div", {
|
|
175
176
|
css: menuContainer
|
|
176
|
-
}, items.filter(item => !item.hidden).map((item, idx) =>
|
|
177
|
+
}, items.filter(item => !item.hidden).map((item, idx) => jsx(DropdownMenuItem, {
|
|
177
178
|
key: idx,
|
|
178
179
|
item: item,
|
|
179
180
|
hide: hide,
|
|
@@ -190,13 +191,13 @@ class Dropdown extends Component {
|
|
|
190
191
|
selected
|
|
191
192
|
} = item;
|
|
192
193
|
if (showSelected && selected) {
|
|
193
|
-
return
|
|
194
|
+
return jsx(EditorDoneIcon, {
|
|
194
195
|
primaryColor: `var(--ds-icon-selected, ${B400})`,
|
|
195
196
|
size: "small",
|
|
196
197
|
label: intl.formatMessage(messages.confirmModalOK)
|
|
197
198
|
});
|
|
198
199
|
}
|
|
199
|
-
return
|
|
200
|
+
return jsx("span", {
|
|
200
201
|
css: spacer
|
|
201
202
|
});
|
|
202
203
|
}
|