@atlaskit/editor-plugin-floating-toolbar 1.9.2 → 1.10.0

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/editor-plugin-floating-toolbar
2
2
 
3
+ ## 1.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`3ac0ae73c0d52`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3ac0ae73c0d52) -
8
+ [ED-24499] Add Turn into dropdown button to text selection toolbar for
9
+ platform_editor_basic_text_transformations experiment. This button will be used to provide options
10
+ to transform selected texts/inline nodes into other elements (e.g. expand) containing the content.
11
+
12
+ ### Patch Changes
13
+
14
+ - [#126418](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/126418)
15
+ [`dc10688cd20b6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/dc10688cd20b6) -
16
+ [ux] Migrate typography with new ADS token and primitive
17
+ - Updated dependencies
18
+
3
19
  ## 1.9.2
4
20
 
5
21
  ### Patch Changes
@@ -125,6 +125,7 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
125
125
  var _this$props2 = this.props,
126
126
  title = _this$props2.title,
127
127
  icon = _this$props2.icon,
128
+ iconBefore = _this$props2.iconBefore,
128
129
  options = _this$props2.options,
129
130
  dispatchCommand = _this$props2.dispatchCommand,
130
131
  mountPoint = _this$props2.mountPoint,
@@ -160,6 +161,7 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
160
161
  }, (0, _react2.jsx)(_chevronDown.default, {
161
162
  label: "Expand dropdown menu"
162
163
  })),
164
+ icon: iconBefore,
163
165
  onClick: this.toggleOpen,
164
166
  onKeyDown: this.toggleOpenByKeyboard,
165
167
  selected: isOpen,
@@ -10,6 +10,7 @@ var _react = _interopRequireDefault(require("react"));
10
10
  var _new = _interopRequireDefault(require("@atlaskit/button/new"));
11
11
  var _floatingToolbar = require("@atlaskit/editor-common/floating-toolbar");
12
12
  var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
13
+ var _primitives = require("@atlaskit/primitives");
13
14
  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); }
14
15
  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 && Object.prototype.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; }
15
16
  var SimpleModal = exports.SimpleModal = function SimpleModal(props) {
@@ -26,7 +27,9 @@ var SimpleModal = exports.SimpleModal = function SimpleModal(props) {
26
27
  testId: testId
27
28
  }, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalHeader, null, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTitle, {
28
29
  appearance: "warning"
29
- }, heading)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement("p", null, options === null || options === void 0 ? void 0 : options.message)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalFooter, null, /*#__PURE__*/_react.default.createElement(_new.default, {
30
+ }, heading)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement(_primitives.Text, {
31
+ as: "p"
32
+ }, options === null || options === void 0 ? void 0 : options.message)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalFooter, null, /*#__PURE__*/_react.default.createElement(_new.default, {
30
33
  appearance: "default",
31
34
  onClick: onClose,
32
35
  testId: testId ? "".concat(testId, "-cancel-button") : undefined
@@ -157,12 +157,16 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
157
157
  }
158
158
  case 'dropdown':
159
159
  var DropdownIcon = item.icon;
160
+ var BeforeIcon = item.iconBefore;
160
161
  return (0, _react2.jsx)(_Dropdown.default, {
161
162
  key: idx,
162
163
  title: item.title,
163
164
  icon: DropdownIcon && (0, _react2.jsx)(DropdownIcon, {
164
165
  label: item.title
165
166
  }),
167
+ iconBefore: BeforeIcon && (0, _react2.jsx)(BeforeIcon, {
168
+ label: ""
169
+ }),
166
170
  dispatchCommand: dispatchCommand,
167
171
  options: item.options,
168
172
  disabled: item.disabled,
@@ -103,6 +103,7 @@ export default class Dropdown extends Component {
103
103
  const {
104
104
  title,
105
105
  icon,
106
+ iconBefore,
106
107
  options,
107
108
  dispatchCommand,
108
109
  mountPoint,
@@ -139,6 +140,7 @@ export default class Dropdown extends Component {
139
140
  }, jsx(ExpandIcon, {
140
141
  label: "Expand dropdown menu"
141
142
  })),
143
+ icon: iconBefore,
142
144
  onClick: this.toggleOpen,
143
145
  onKeyDown: this.toggleOpenByKeyboard,
144
146
  selected: isOpen,
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import Button from '@atlaskit/button/new';
3
3
  import { messages } from '@atlaskit/editor-common/floating-toolbar';
4
4
  import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
5
+ import { Text } from '@atlaskit/primitives';
5
6
  export const SimpleModal = props => {
6
7
  const {
7
8
  onConfirm,
@@ -20,7 +21,9 @@ export const SimpleModal = props => {
20
21
  testId: testId
21
22
  }, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, {
22
23
  appearance: "warning"
23
- }, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("p", null, options === null || options === void 0 ? void 0 : options.message)), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
24
+ }, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(Text, {
25
+ as: "p"
26
+ }, options === null || options === void 0 ? void 0 : options.message)), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
24
27
  appearance: "default",
25
28
  onClick: onClose,
26
29
  testId: testId ? `${testId}-cancel-button` : undefined
@@ -133,12 +133,16 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
133
133
  }
134
134
  case 'dropdown':
135
135
  const DropdownIcon = item.icon;
136
+ const BeforeIcon = item.iconBefore;
136
137
  return jsx(Dropdown, {
137
138
  key: idx,
138
139
  title: item.title,
139
140
  icon: DropdownIcon && jsx(DropdownIcon, {
140
141
  label: item.title
141
142
  }),
143
+ iconBefore: BeforeIcon && jsx(BeforeIcon, {
144
+ label: ""
145
+ }),
142
146
  dispatchCommand: dispatchCommand,
143
147
  options: item.options,
144
148
  disabled: item.disabled,
@@ -120,6 +120,7 @@ var Dropdown = /*#__PURE__*/function (_Component) {
120
120
  var _this$props2 = this.props,
121
121
  title = _this$props2.title,
122
122
  icon = _this$props2.icon,
123
+ iconBefore = _this$props2.iconBefore,
123
124
  options = _this$props2.options,
124
125
  dispatchCommand = _this$props2.dispatchCommand,
125
126
  mountPoint = _this$props2.mountPoint,
@@ -155,6 +156,7 @@ var Dropdown = /*#__PURE__*/function (_Component) {
155
156
  }, jsx(ExpandIcon, {
156
157
  label: "Expand dropdown menu"
157
158
  })),
159
+ icon: iconBefore,
158
160
  onClick: this.toggleOpen,
159
161
  onKeyDown: this.toggleOpenByKeyboard,
160
162
  selected: isOpen,
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import Button from '@atlaskit/button/new';
3
3
  import { messages } from '@atlaskit/editor-common/floating-toolbar';
4
4
  import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
5
+ import { Text } from '@atlaskit/primitives';
5
6
  export var SimpleModal = function SimpleModal(props) {
6
7
  var onConfirm = props.onConfirm,
7
8
  onClose = props.onClose,
@@ -16,7 +17,9 @@ export var SimpleModal = function SimpleModal(props) {
16
17
  testId: testId
17
18
  }, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, {
18
19
  appearance: "warning"
19
- }, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("p", null, options === null || options === void 0 ? void 0 : options.message)), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
20
+ }, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(Text, {
21
+ as: "p"
22
+ }, options === null || options === void 0 ? void 0 : options.message)), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
20
23
  appearance: "default",
21
24
  onClick: onClose,
22
25
  testId: testId ? "".concat(testId, "-cancel-button") : undefined
@@ -150,12 +150,16 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
150
150
  }
151
151
  case 'dropdown':
152
152
  var DropdownIcon = item.icon;
153
+ var BeforeIcon = item.iconBefore;
153
154
  return jsx(Dropdown, {
154
155
  key: idx,
155
156
  title: item.title,
156
157
  icon: DropdownIcon && jsx(DropdownIcon, {
157
158
  label: item.title
158
159
  }),
160
+ iconBefore: BeforeIcon && jsx(BeforeIcon, {
161
+ label: ""
162
+ }),
159
163
  dispatchCommand: dispatchCommand,
160
164
  options: item.options,
161
165
  disabled: item.disabled,
@@ -11,6 +11,7 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
11
11
  export interface Props {
12
12
  title: string;
13
13
  icon?: ReactElement<any>;
14
+ iconBefore?: ReactElement<any>;
14
15
  hideExpandIcon?: boolean;
15
16
  options: DropdownOptions<Function>;
16
17
  dispatchCommand: (command: Function) => void;
@@ -11,6 +11,7 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
11
11
  export interface Props {
12
12
  title: string;
13
13
  icon?: ReactElement<any>;
14
+ iconBefore?: ReactElement<any>;
14
15
  hideExpandIcon?: boolean;
15
16
  options: DropdownOptions<Function>;
16
17
  dispatchCommand: (command: Function) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-floating-toolbar",
3
- "version": "1.9.2",
3
+ "version": "1.10.0",
4
4
  "description": "Floating toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -26,8 +26,8 @@
26
26
  "dependencies": {
27
27
  "@atlaskit/adf-utils": "^19.6.0",
28
28
  "@atlaskit/button": "^19.1.0",
29
- "@atlaskit/checkbox": "^13.5.0",
30
- "@atlaskit/editor-common": "^87.2.0",
29
+ "@atlaskit/checkbox": "^13.6.0",
30
+ "@atlaskit/editor-common": "^87.4.0",
31
31
  "@atlaskit/editor-palette": "1.6.0",
32
32
  "@atlaskit/editor-plugin-block-controls": "^1.10.0",
33
33
  "@atlaskit/editor-plugin-context-panel": "^1.2.0",
@@ -39,12 +39,13 @@
39
39
  "@atlaskit/editor-plugin-table": "^7.24.0",
40
40
  "@atlaskit/editor-prosemirror": "5.0.1",
41
41
  "@atlaskit/emoji": "^67.7.0",
42
- "@atlaskit/icon": "^22.9.0",
42
+ "@atlaskit/icon": "^22.10.0",
43
43
  "@atlaskit/menu": "^2.9.0",
44
44
  "@atlaskit/modal-dialog": "^12.14.0",
45
+ "@atlaskit/primitives": "^11.1.0",
45
46
  "@atlaskit/select": "^17.11.0",
46
47
  "@atlaskit/theme": "^12.11.0",
47
- "@atlaskit/tokens": "^1.56.0",
48
+ "@atlaskit/tokens": "^1.57.0",
48
49
  "@atlaskit/tooltip": "^18.5.0",
49
50
  "@babel/runtime": "^7.0.0",
50
51
  "@emotion/react": "^11.7.1",