@atlaskit/editor-plugin-floating-toolbar 3.1.1 → 3.1.3
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 +18 -0
- package/dist/cjs/ui/DropdownMenu.js +6 -5
- package/dist/cjs/ui/Input.js +6 -68
- package/dist/cjs/ui/ScrollButtons.js +4 -9
- package/dist/cjs/ui/Toolbar.js +1 -16
- package/dist/es2019/ui/DropdownMenu.js +5 -4
- package/dist/es2019/ui/Input.js +2 -54
- package/dist/es2019/ui/ScrollButtons.js +2 -7
- package/dist/es2019/ui/Toolbar.js +2 -13
- package/dist/esm/ui/DropdownMenu.js +5 -4
- package/dist/esm/ui/Input.js +2 -68
- package/dist/esm/ui/ScrollButtons.js +2 -7
- package/dist/esm/ui/Toolbar.js +2 -17
- package/dist/types/ui/Input.d.ts +1 -14
- package/dist/types-ts4.5/ui/Input.d.ts +1 -14
- package/package.json +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 3.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#122186](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/122186)
|
|
8
|
+
[`c629cdfe00a84`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c629cdfe00a84) -
|
|
9
|
+
migrated icons to new design systems library
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 3.1.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#122243](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/122243)
|
|
17
|
+
[`cd1572955dd3b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cd1572955dd3b) -
|
|
18
|
+
FD-80149: cleans up platform_editor_react18_phase2_v2 in floating toolbar
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 3.1.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -10,7 +10,7 @@ var _react = require("react");
|
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _reactIntlNext = require("react-intl-next");
|
|
12
12
|
var _floatingToolbar = require("@atlaskit/editor-common/floating-toolbar");
|
|
13
|
-
var
|
|
13
|
+
var _checkMarkEditorDone = _interopRequireDefault(require("@atlaskit/icon/core/migration/check-mark--editor-done"));
|
|
14
14
|
var _menu = require("@atlaskit/menu");
|
|
15
15
|
var _colors = require("@atlaskit/theme/colors");
|
|
16
16
|
var _constants = require("@atlaskit/theme/constants");
|
|
@@ -223,10 +223,11 @@ var SelectedIconBefore = function SelectedIconBefore(_ref) {
|
|
|
223
223
|
if (showSelected && itemSelected) {
|
|
224
224
|
return (0, _react2.jsx)("span", {
|
|
225
225
|
"aria-hidden": "true"
|
|
226
|
-
}, (0, _react2.jsx)(
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
label: intl.formatMessage(_floatingToolbar.messages.confirmModalOK)
|
|
226
|
+
}, (0, _react2.jsx)(_checkMarkEditorDone.default, {
|
|
227
|
+
LEGACY_primaryColor: "var(--ds-icon-selected, ".concat(_colors.B400, ")"),
|
|
228
|
+
LEGACY_size: "small",
|
|
229
|
+
label: intl.formatMessage(_floatingToolbar.messages.confirmModalOK),
|
|
230
|
+
spacing: "none"
|
|
230
231
|
}));
|
|
231
232
|
}
|
|
232
233
|
return (0, _react2.jsx)("span", {
|
package/dist/cjs/ui/Input.js
CHANGED
|
@@ -5,83 +5,21 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.Input = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
11
|
var _react2 = require("@emotion/react");
|
|
18
12
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
19
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
|
-
|
|
22
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
|
|
15
|
+
/**
|
|
23
16
|
* @jsxRuntime classic
|
|
24
17
|
* @jsx jsx
|
|
25
|
-
*/
|
|
26
|
-
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
27
|
-
var InputOld = exports.InputOld = /*#__PURE__*/function (_Component) {
|
|
28
|
-
function InputOld(props) {
|
|
29
|
-
var _this;
|
|
30
|
-
(0, _classCallCheck2.default)(this, InputOld);
|
|
31
|
-
_this = _callSuper(this, InputOld, [props]);
|
|
32
|
-
(0, _defineProperty2.default)(_this, "handleChange", function (e) {
|
|
33
|
-
_this.setState({
|
|
34
|
-
text: e.target.value
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
(0, _defineProperty2.default)(_this, "handleSubmit", function (e) {
|
|
38
|
-
e.preventDefault();
|
|
39
|
-
if (_this.props.onSubmit) {
|
|
40
|
-
_this.props.onSubmit(_this.state.text);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
(0, _defineProperty2.default)(_this, "handleBlur", function (e) {
|
|
44
|
-
e.preventDefault();
|
|
45
|
-
if (_this.props.onBlur) {
|
|
46
|
-
_this.props.onBlur(_this.state.text);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
_this.state = {
|
|
50
|
-
text: props.defaultValue || ''
|
|
51
|
-
};
|
|
52
|
-
return _this;
|
|
53
|
-
}
|
|
18
|
+
*/
|
|
54
19
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return (0, _createClass2.default)(InputOld, [{
|
|
59
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
60
|
-
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
61
|
-
if (this.state.text !== nextProps.defaultValue) {
|
|
62
|
-
this.setState({
|
|
63
|
-
text: nextProps.defaultValue || ''
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}, {
|
|
68
|
-
key: "render",
|
|
69
|
-
value: function render() {
|
|
70
|
-
var placeholder = this.props.placeholder;
|
|
71
|
-
return (0, _react2.jsx)("form", {
|
|
72
|
-
onSubmit: this.handleSubmit
|
|
73
|
-
}, (0, _react2.jsx)("input", {
|
|
74
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
75
|
-
css: _ui.panelTextInput,
|
|
76
|
-
value: this.state.text,
|
|
77
|
-
onChange: this.handleChange,
|
|
78
|
-
placeholder: placeholder,
|
|
79
|
-
onBlur: this.handleBlur
|
|
80
|
-
}));
|
|
81
|
-
}
|
|
82
|
-
}]);
|
|
83
|
-
}(_react.Component);
|
|
84
|
-
var InputNew = exports.InputNew = function InputNew(props) {
|
|
20
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
21
|
+
|
|
22
|
+
var Input = exports.Input = function Input(props) {
|
|
85
23
|
var defaultValue = props.defaultValue,
|
|
86
24
|
onBlur = props.onBlur,
|
|
87
25
|
onSubmit = props.onSubmit,
|
|
@@ -12,8 +12,8 @@ var _react2 = require("@emotion/react");
|
|
|
12
12
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
13
13
|
var _floatingToolbar = require("@atlaskit/editor-common/floating-toolbar");
|
|
14
14
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
15
|
-
var
|
|
16
|
-
var
|
|
15
|
+
var _chevronLeftChevronLeftLarge = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-left--chevron-left-large"));
|
|
16
|
+
var _chevronRightChevronRightLarge = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-right--chevron-right-large"));
|
|
17
17
|
var _colors = require("@atlaskit/theme/colors");
|
|
18
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -34,13 +34,8 @@ var toolbarScrollButtons = (0, _react2.css)({
|
|
|
34
34
|
flexShrink: 0,
|
|
35
35
|
alignItems: 'center'
|
|
36
36
|
});
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
-
var LeftIcon = _chevronLeftLarge.default;
|
|
41
|
-
// Ignored via go/ees005
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
|
-
var RightIcon = _chevronRightLarge.default;
|
|
37
|
+
var LeftIcon = _chevronLeftChevronLeftLarge.default;
|
|
38
|
+
var RightIcon = _chevronRightChevronRightLarge.default;
|
|
44
39
|
var ScrollButtons = exports.ScrollButtons = function ScrollButtons(_ref) {
|
|
45
40
|
var intl = _ref.intl,
|
|
46
41
|
scrollContainerRef = _ref.scrollContainerRef,
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -164,22 +164,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
164
164
|
spotlightConfig: item.spotlightConfig
|
|
165
165
|
}, item.showTitle && item.title);
|
|
166
166
|
case 'input':
|
|
167
|
-
|
|
168
|
-
return (0, _react2.jsx)(_Input.InputNew, {
|
|
169
|
-
key: idx,
|
|
170
|
-
mountPoint: popupsMountPoint,
|
|
171
|
-
boundariesElement: popupsBoundariesElement,
|
|
172
|
-
defaultValue: item.defaultValue,
|
|
173
|
-
placeholder: item.placeholder,
|
|
174
|
-
onSubmit: function onSubmit(value) {
|
|
175
|
-
return dispatchCommand(item.onSubmit(value));
|
|
176
|
-
},
|
|
177
|
-
onBlur: function onBlur(value) {
|
|
178
|
-
return dispatchCommand(item.onBlur(value));
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
return (0, _react2.jsx)(_Input.InputOld, {
|
|
167
|
+
return (0, _react2.jsx)(_Input.Input, {
|
|
183
168
|
key: idx,
|
|
184
169
|
mountPoint: popupsMountPoint,
|
|
185
170
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -10,7 +10,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
10
10
|
|
|
11
11
|
import { injectIntl } from 'react-intl-next';
|
|
12
12
|
import { messages } from '@atlaskit/editor-common/floating-toolbar';
|
|
13
|
-
import EditorDoneIcon from '@atlaskit/icon/
|
|
13
|
+
import EditorDoneIcon from '@atlaskit/icon/core/migration/check-mark--editor-done';
|
|
14
14
|
import { ButtonItem, HeadingItem } from '@atlaskit/menu';
|
|
15
15
|
import { B400 } from '@atlaskit/theme/colors';
|
|
16
16
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
@@ -216,9 +216,10 @@ const SelectedIconBefore = ({
|
|
|
216
216
|
return jsx("span", {
|
|
217
217
|
"aria-hidden": "true"
|
|
218
218
|
}, jsx(EditorDoneIcon, {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
label: intl.formatMessage(messages.confirmModalOK)
|
|
219
|
+
LEGACY_primaryColor: `var(--ds-icon-selected, ${B400})`,
|
|
220
|
+
LEGACY_size: "small",
|
|
221
|
+
label: intl.formatMessage(messages.confirmModalOK),
|
|
222
|
+
spacing: "none"
|
|
222
223
|
}));
|
|
223
224
|
}
|
|
224
225
|
return jsx("span", {
|
package/dist/es2019/ui/Input.js
CHANGED
|
@@ -1,65 +1,13 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
/**
|
|
3
2
|
* @jsxRuntime classic
|
|
4
3
|
* @jsx jsx
|
|
5
4
|
*/
|
|
6
|
-
import React, {
|
|
5
|
+
import React, { useState } from 'react';
|
|
7
6
|
|
|
8
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
8
|
import { jsx } from '@emotion/react';
|
|
10
9
|
import { panelTextInput } from '@atlaskit/editor-common/ui';
|
|
11
|
-
|
|
12
|
-
export class InputOld extends Component {
|
|
13
|
-
constructor(props) {
|
|
14
|
-
super(props);
|
|
15
|
-
_defineProperty(this, "handleChange", e => {
|
|
16
|
-
this.setState({
|
|
17
|
-
text: e.target.value
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
_defineProperty(this, "handleSubmit", e => {
|
|
21
|
-
e.preventDefault();
|
|
22
|
-
if (this.props.onSubmit) {
|
|
23
|
-
this.props.onSubmit(this.state.text);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
_defineProperty(this, "handleBlur", e => {
|
|
27
|
-
e.preventDefault();
|
|
28
|
-
if (this.props.onBlur) {
|
|
29
|
-
this.props.onBlur(this.state.text);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
this.state = {
|
|
33
|
-
text: props.defaultValue || ''
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Ignored via go/ees005
|
|
38
|
-
// eslint-disable-next-line react/no-unsafe
|
|
39
|
-
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
40
|
-
if (this.state.text !== nextProps.defaultValue) {
|
|
41
|
-
this.setState({
|
|
42
|
-
text: nextProps.defaultValue || ''
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
render() {
|
|
47
|
-
const {
|
|
48
|
-
placeholder
|
|
49
|
-
} = this.props;
|
|
50
|
-
return jsx("form", {
|
|
51
|
-
onSubmit: this.handleSubmit
|
|
52
|
-
}, jsx("input", {
|
|
53
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
54
|
-
css: panelTextInput,
|
|
55
|
-
value: this.state.text,
|
|
56
|
-
onChange: this.handleChange,
|
|
57
|
-
placeholder: placeholder,
|
|
58
|
-
onBlur: this.handleBlur
|
|
59
|
-
}));
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
export const InputNew = props => {
|
|
10
|
+
export const Input = props => {
|
|
63
11
|
const {
|
|
64
12
|
defaultValue,
|
|
65
13
|
onBlur,
|
|
@@ -9,8 +9,8 @@ import { css, jsx } from '@emotion/react';
|
|
|
9
9
|
import rafSchedule from 'raf-schd';
|
|
10
10
|
import { messages } from '@atlaskit/editor-common/floating-toolbar';
|
|
11
11
|
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
12
|
-
import ChevronLeftLargeIcon from '@atlaskit/icon/
|
|
13
|
-
import ChevronRightLargeIcon from '@atlaskit/icon/
|
|
12
|
+
import ChevronLeftLargeIcon from '@atlaskit/icon/utility/migration/chevron-left--chevron-left-large';
|
|
13
|
+
import ChevronRightLargeIcon from '@atlaskit/icon/utility/migration/chevron-right--chevron-right-large';
|
|
14
14
|
import { N30 } from '@atlaskit/theme/colors';
|
|
15
15
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
16
16
|
const toolbarScrollButtons = css({
|
|
@@ -22,12 +22,7 @@ const toolbarScrollButtons = css({
|
|
|
22
22
|
flexShrink: 0,
|
|
23
23
|
alignItems: 'center'
|
|
24
24
|
});
|
|
25
|
-
|
|
26
|
-
// Ignored via go/ees005
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
25
|
const LeftIcon = ChevronLeftLargeIcon;
|
|
29
|
-
// Ignored via go/ees005
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
26
|
const RightIcon = ChevronRightLargeIcon;
|
|
32
27
|
export const ScrollButtons = ({
|
|
33
28
|
intl,
|
|
@@ -25,7 +25,7 @@ import { showConfirmDialog } from '../pm-plugins/toolbar-data/commands';
|
|
|
25
25
|
import Dropdown from './Dropdown';
|
|
26
26
|
import { EmojiPickerButton } from './EmojiPickerButton';
|
|
27
27
|
import { ExtensionsPlaceholder } from './ExtensionsPlaceholder';
|
|
28
|
-
import {
|
|
28
|
+
import { Input } from './Input';
|
|
29
29
|
import { ScrollButtons } from './ScrollButtons';
|
|
30
30
|
import Select from './Select';
|
|
31
31
|
export function groupItems(items) {
|
|
@@ -145,18 +145,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
145
145
|
spotlightConfig: item.spotlightConfig
|
|
146
146
|
}, item.showTitle && item.title);
|
|
147
147
|
case 'input':
|
|
148
|
-
|
|
149
|
-
return jsx(InputNew, {
|
|
150
|
-
key: idx,
|
|
151
|
-
mountPoint: popupsMountPoint,
|
|
152
|
-
boundariesElement: popupsBoundariesElement,
|
|
153
|
-
defaultValue: item.defaultValue,
|
|
154
|
-
placeholder: item.placeholder,
|
|
155
|
-
onSubmit: value => dispatchCommand(item.onSubmit(value)),
|
|
156
|
-
onBlur: value => dispatchCommand(item.onBlur(value))
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
return jsx(InputOld, {
|
|
148
|
+
return jsx(Input, {
|
|
160
149
|
key: idx,
|
|
161
150
|
mountPoint: popupsMountPoint,
|
|
162
151
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -11,7 +11,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
11
11
|
|
|
12
12
|
import { injectIntl } from 'react-intl-next';
|
|
13
13
|
import { messages } from '@atlaskit/editor-common/floating-toolbar';
|
|
14
|
-
import EditorDoneIcon from '@atlaskit/icon/
|
|
14
|
+
import EditorDoneIcon from '@atlaskit/icon/core/migration/check-mark--editor-done';
|
|
15
15
|
import { ButtonItem, HeadingItem } from '@atlaskit/menu';
|
|
16
16
|
import { B400 } from '@atlaskit/theme/colors';
|
|
17
17
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
@@ -215,9 +215,10 @@ var SelectedIconBefore = function SelectedIconBefore(_ref) {
|
|
|
215
215
|
return jsx("span", {
|
|
216
216
|
"aria-hidden": "true"
|
|
217
217
|
}, jsx(EditorDoneIcon, {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
label: intl.formatMessage(messages.confirmModalOK)
|
|
218
|
+
LEGACY_primaryColor: "var(--ds-icon-selected, ".concat(B400, ")"),
|
|
219
|
+
LEGACY_size: "small",
|
|
220
|
+
label: intl.formatMessage(messages.confirmModalOK),
|
|
221
|
+
spacing: "none"
|
|
221
222
|
}));
|
|
222
223
|
}
|
|
223
224
|
return jsx("span", {
|
package/dist/esm/ui/Input.js
CHANGED
|
@@ -1,80 +1,14 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
2
|
/**
|
|
11
3
|
* @jsxRuntime classic
|
|
12
4
|
* @jsx jsx
|
|
13
5
|
*/
|
|
14
|
-
import React, {
|
|
6
|
+
import React, { useState } from 'react';
|
|
15
7
|
|
|
16
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
17
9
|
import { jsx } from '@emotion/react';
|
|
18
10
|
import { panelTextInput } from '@atlaskit/editor-common/ui';
|
|
19
|
-
|
|
20
|
-
export var InputOld = /*#__PURE__*/function (_Component) {
|
|
21
|
-
function InputOld(props) {
|
|
22
|
-
var _this;
|
|
23
|
-
_classCallCheck(this, InputOld);
|
|
24
|
-
_this = _callSuper(this, InputOld, [props]);
|
|
25
|
-
_defineProperty(_this, "handleChange", function (e) {
|
|
26
|
-
_this.setState({
|
|
27
|
-
text: e.target.value
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
_defineProperty(_this, "handleSubmit", function (e) {
|
|
31
|
-
e.preventDefault();
|
|
32
|
-
if (_this.props.onSubmit) {
|
|
33
|
-
_this.props.onSubmit(_this.state.text);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
_defineProperty(_this, "handleBlur", function (e) {
|
|
37
|
-
e.preventDefault();
|
|
38
|
-
if (_this.props.onBlur) {
|
|
39
|
-
_this.props.onBlur(_this.state.text);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
_this.state = {
|
|
43
|
-
text: props.defaultValue || ''
|
|
44
|
-
};
|
|
45
|
-
return _this;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Ignored via go/ees005
|
|
49
|
-
// eslint-disable-next-line react/no-unsafe
|
|
50
|
-
_inherits(InputOld, _Component);
|
|
51
|
-
return _createClass(InputOld, [{
|
|
52
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
53
|
-
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
54
|
-
if (this.state.text !== nextProps.defaultValue) {
|
|
55
|
-
this.setState({
|
|
56
|
-
text: nextProps.defaultValue || ''
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}, {
|
|
61
|
-
key: "render",
|
|
62
|
-
value: function render() {
|
|
63
|
-
var placeholder = this.props.placeholder;
|
|
64
|
-
return jsx("form", {
|
|
65
|
-
onSubmit: this.handleSubmit
|
|
66
|
-
}, jsx("input", {
|
|
67
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
68
|
-
css: panelTextInput,
|
|
69
|
-
value: this.state.text,
|
|
70
|
-
onChange: this.handleChange,
|
|
71
|
-
placeholder: placeholder,
|
|
72
|
-
onBlur: this.handleBlur
|
|
73
|
-
}));
|
|
74
|
-
}
|
|
75
|
-
}]);
|
|
76
|
-
}(Component);
|
|
77
|
-
export var InputNew = function InputNew(props) {
|
|
11
|
+
export var Input = function Input(props) {
|
|
78
12
|
var defaultValue = props.defaultValue,
|
|
79
13
|
onBlur = props.onBlur,
|
|
80
14
|
onSubmit = props.onSubmit,
|
|
@@ -10,8 +10,8 @@ import { css, jsx } from '@emotion/react';
|
|
|
10
10
|
import rafSchedule from 'raf-schd';
|
|
11
11
|
import { messages } from '@atlaskit/editor-common/floating-toolbar';
|
|
12
12
|
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
13
|
-
import ChevronLeftLargeIcon from '@atlaskit/icon/
|
|
14
|
-
import ChevronRightLargeIcon from '@atlaskit/icon/
|
|
13
|
+
import ChevronLeftLargeIcon from '@atlaskit/icon/utility/migration/chevron-left--chevron-left-large';
|
|
14
|
+
import ChevronRightLargeIcon from '@atlaskit/icon/utility/migration/chevron-right--chevron-right-large';
|
|
15
15
|
import { N30 } from '@atlaskit/theme/colors';
|
|
16
16
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
17
17
|
var toolbarScrollButtons = css({
|
|
@@ -23,12 +23,7 @@ var toolbarScrollButtons = css({
|
|
|
23
23
|
flexShrink: 0,
|
|
24
24
|
alignItems: 'center'
|
|
25
25
|
});
|
|
26
|
-
|
|
27
|
-
// Ignored via go/ees005
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
26
|
var LeftIcon = ChevronLeftLargeIcon;
|
|
30
|
-
// Ignored via go/ees005
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
27
|
var RightIcon = ChevronRightLargeIcon;
|
|
33
28
|
export var ScrollButtons = function ScrollButtons(_ref) {
|
|
34
29
|
var intl = _ref.intl,
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -32,7 +32,7 @@ import { showConfirmDialog } from '../pm-plugins/toolbar-data/commands';
|
|
|
32
32
|
import Dropdown from './Dropdown';
|
|
33
33
|
import { EmojiPickerButton } from './EmojiPickerButton';
|
|
34
34
|
import { ExtensionsPlaceholder } from './ExtensionsPlaceholder';
|
|
35
|
-
import {
|
|
35
|
+
import { Input } from './Input';
|
|
36
36
|
import { ScrollButtons } from './ScrollButtons';
|
|
37
37
|
import Select from './Select';
|
|
38
38
|
export function groupItems(items) {
|
|
@@ -157,22 +157,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
157
157
|
spotlightConfig: item.spotlightConfig
|
|
158
158
|
}, item.showTitle && item.title);
|
|
159
159
|
case 'input':
|
|
160
|
-
|
|
161
|
-
return jsx(InputNew, {
|
|
162
|
-
key: idx,
|
|
163
|
-
mountPoint: popupsMountPoint,
|
|
164
|
-
boundariesElement: popupsBoundariesElement,
|
|
165
|
-
defaultValue: item.defaultValue,
|
|
166
|
-
placeholder: item.placeholder,
|
|
167
|
-
onSubmit: function onSubmit(value) {
|
|
168
|
-
return dispatchCommand(item.onSubmit(value));
|
|
169
|
-
},
|
|
170
|
-
onBlur: function onBlur(value) {
|
|
171
|
-
return dispatchCommand(item.onBlur(value));
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
return jsx(InputOld, {
|
|
160
|
+
return jsx(Input, {
|
|
176
161
|
key: idx,
|
|
177
162
|
mountPoint: popupsMountPoint,
|
|
178
163
|
boundariesElement: popupsBoundariesElement,
|
package/dist/types/ui/Input.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React, { Component } from 'react';
|
|
6
1
|
import { jsx } from '@emotion/react';
|
|
7
2
|
export interface Props {
|
|
8
3
|
mountPoint?: HTMLElement;
|
|
@@ -15,12 +10,4 @@ export interface Props {
|
|
|
15
10
|
export interface State {
|
|
16
11
|
text: string;
|
|
17
12
|
}
|
|
18
|
-
export declare
|
|
19
|
-
constructor(props: Props);
|
|
20
|
-
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
21
|
-
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
22
|
-
handleSubmit: (e: React.FormEvent) => void;
|
|
23
|
-
handleBlur: (e: React.FocusEvent<Object>) => void;
|
|
24
|
-
render(): jsx.JSX.Element;
|
|
25
|
-
}
|
|
26
|
-
export declare const InputNew: (props: Props) => jsx.JSX.Element;
|
|
13
|
+
export declare const Input: (props: Props) => jsx.JSX.Element;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React, { Component } from 'react';
|
|
6
1
|
import { jsx } from '@emotion/react';
|
|
7
2
|
export interface Props {
|
|
8
3
|
mountPoint?: HTMLElement;
|
|
@@ -15,12 +10,4 @@ export interface Props {
|
|
|
15
10
|
export interface State {
|
|
16
11
|
text: string;
|
|
17
12
|
}
|
|
18
|
-
export declare
|
|
19
|
-
constructor(props: Props);
|
|
20
|
-
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
21
|
-
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
22
|
-
handleSubmit: (e: React.FormEvent) => void;
|
|
23
|
-
handleBlur: (e: React.FocusEvent<Object>) => void;
|
|
24
|
-
render(): jsx.JSX.Element;
|
|
25
|
-
}
|
|
26
|
-
export declare const InputNew: (props: Props) => jsx.JSX.Element;
|
|
13
|
+
export declare const Input: (props: Props) => jsx.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.3",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"@atlaskit/adf-utils": "^19.19.0",
|
|
29
29
|
"@atlaskit/button": "^21.1.0",
|
|
30
30
|
"@atlaskit/checkbox": "^17.0.0",
|
|
31
|
-
"@atlaskit/editor-common": "^101.
|
|
31
|
+
"@atlaskit/editor-common": "^101.1.0",
|
|
32
32
|
"@atlaskit/editor-palette": "2.0.0",
|
|
33
|
-
"@atlaskit/editor-plugin-block-controls": "^3.
|
|
33
|
+
"@atlaskit/editor-plugin-block-controls": "^3.3.0",
|
|
34
34
|
"@atlaskit/editor-plugin-context-panel": "^3.0.0",
|
|
35
35
|
"@atlaskit/editor-plugin-copy-button": "^2.0.0",
|
|
36
36
|
"@atlaskit/editor-plugin-decorations": "^2.0.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
48
48
|
"@atlaskit/primitives": "^14.1.0",
|
|
49
49
|
"@atlaskit/select": "^20.0.0",
|
|
50
|
-
"@atlaskit/theme": "^
|
|
50
|
+
"@atlaskit/theme": "^18.0.0",
|
|
51
51
|
"@atlaskit/tmp-editor-statsig": "^3.4.0",
|
|
52
52
|
"@atlaskit/tokens": "^4.3.0",
|
|
53
53
|
"@atlaskit/tooltip": "^20.0.0",
|
|
@@ -113,9 +113,6 @@
|
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
115
|
"platform-feature-flags": {
|
|
116
|
-
"platform_editor_react18_phase2_v2": {
|
|
117
|
-
"type": "boolean"
|
|
118
|
-
},
|
|
119
116
|
"platform_editor_floating_toolbar_padding_fix": {
|
|
120
117
|
"type": "boolean"
|
|
121
118
|
},
|