@atlaskit/editor-plugin-insert-block 1.7.0 → 1.8.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,26 @@
1
1
  # @atlaskit/editor-plugin-insert-block
2
2
 
3
+ ## 1.8.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
+ - Updated dependencies
15
+
16
+ ## 1.7.1
17
+
18
+ ### Patch Changes
19
+
20
+ - [#126987](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/126987)
21
+ [`e2759b19623a1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e2759b19623a1) -
22
+ [ux] Migrate icons in Editor toolbar insert block
23
+
3
24
  ## 1.7.0
4
25
 
5
26
  ### Minor Changes
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = SwitchIcon;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _svg = _interopRequireDefault(require("@atlaskit/icon/svg"));
10
+ function SwitchIcon() {
11
+ return /*#__PURE__*/_react.default.createElement(_svg.default, {
12
+ label: ""
13
+ }, /*#__PURE__*/_react.default.createElement("path", {
14
+ d: "M6.003 16H8.998C9.26322 16 9.51757 15.8947 9.70511 15.7071C9.89264 15.5196 9.998 15.2652 9.998 15C9.998 14.7348 9.89264 14.4805 9.70511 14.2929C9.51757 14.1054 9.26322 14 8.998 14H5.102C4.494 14 4 14.493 4 15.1V19C4 19.2656 4.10551 19.5204 4.29333 19.7082C4.48115 19.896 4.73589 20.0015 5.0015 20.0015C5.26711 20.0015 5.52185 19.896 5.70967 19.7082C5.89748 19.5204 6.003 19.2656 6.003 19V16Z",
15
+ fill: "var(--ds-icon, #44546F)"
16
+ }), /*#__PURE__*/_react.default.createElement("path", {
17
+ d: "M18.018 14.572C16.989 16.649 14.807 18 12.37 18C10.104 18 8.051 16.833 6.945 14.98C6.659 14.5 6.023 14.334 5.524 14.609C5.40677 14.6709 5.30331 14.7559 5.21991 14.8589C5.13651 14.9619 5.0749 15.0808 5.0388 15.2083C5.00271 15.3359 4.99289 15.4694 5.00994 15.6009C5.027 15.7323 5.07056 15.8589 5.138 15.973C6.611 18.443 9.35 20 12.37 20C15.618 20 18.528 18.198 19.899 15.43C20.146 14.932 19.925 14.335 19.406 14.098C18.886 13.861 18.265 14.073 18.018 14.572Z",
18
+ fill: "var(--ds-icon, #44546F)"
19
+ }), /*#__PURE__*/_react.default.createElement("path", {
20
+ fillRule: "evenodd",
21
+ clipRule: "evenodd",
22
+ d: "M15.002 10L18.898 10C19.506 10 20 9.50703 20 8.90003V5.00003C20 4.73441 19.8945 4.47968 19.7067 4.29186C19.5188 4.10404 19.2641 3.99853 18.9985 3.99853C18.7329 3.99853 18.4782 4.10404 18.2903 4.29186C18.1025 4.47968 17.997 4.73441 17.997 5.00003V8.00003H15.002C14.7368 8.00003 14.4824 8.10538 14.2949 8.29292C14.1074 8.48046 14.002 8.73481 14.002 9.00003C14.002 9.26524 14.1074 9.5196 14.2949 9.70713C14.4824 9.89467 14.7368 10 15.002 10Z",
23
+ fill: "var(--ds-icon, #44546F)"
24
+ }), /*#__PURE__*/_react.default.createElement("path", {
25
+ fillRule: "evenodd",
26
+ clipRule: "evenodd",
27
+ d: "M4.596 9.90303C5.116 10.14 5.736 9.92803 5.983 9.42903C7.012 7.35203 9.193 6.00103 11.63 6.00103C13.896 6.00103 15.95 7.16803 17.055 9.02203C17.1988 9.25438 17.4265 9.42245 17.6909 9.49135C17.9553 9.56024 18.2361 9.52468 18.475 9.39203C18.975 9.11803 19.148 8.50703 18.862 8.02803C17.389 5.55803 14.65 4.00103 11.63 4.00103C8.382 4.00103 5.472 5.80303 4.102 8.57103C4.03537 8.70353 4.00045 8.84971 4 8.99803C4.00188 9.1902 4.05909 9.37775 4.16479 9.53825C4.27049 9.69875 4.4202 9.8254 4.596 9.90303Z",
28
+ fill: "var(--ds-icon, #44546F)"
29
+ }));
30
+ }
@@ -9,9 +9,11 @@ exports.insertBlockPlugin = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _analytics = require("@atlaskit/editor-common/analytics");
11
11
  var _hooks = require("@atlaskit/editor-common/hooks");
12
+ var _messages = require("@atlaskit/editor-common/messages");
12
13
  var _providerFactory = require("@atlaskit/editor-common/provider-factory");
13
14
  var _types = require("@atlaskit/editor-common/types");
14
15
  var _consts = require("@atlaskit/editor-plugin-block-type/consts");
16
+ var _switch = _interopRequireDefault(require("./assets/switch"));
15
17
  var _ToolbarInsertBlock = _interopRequireDefault(require("./ui/ToolbarInsertBlock"));
16
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); }
17
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 && 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; }
@@ -114,6 +116,28 @@ var insertBlockPlugin = exports.insertBlockPlugin = function insertBlockPlugin(_
114
116
  toggle();
115
117
  }
116
118
  },
119
+ pluginsOptions: {
120
+ // This is added for basic text transformations experiment.
121
+ // This may not be the most ideal plugin to add this to, but it is suitable for experiment purpose
122
+ // as relevant plugin dependencies are already set up.
123
+ // If we decide to ship the feature, we will consider a separate plugin if needed.
124
+ // Experiment one-pager: https://hello.atlassian.net/wiki/spaces/ETM/pages/3931754727/Experiment+Elements+Basic+Text+Transformations
125
+ selectionToolbar: function selectionToolbar(_, intl) {
126
+ var _api$featureFlags;
127
+ if (!(api !== null && api !== void 0 && (_api$featureFlags = api.featureFlags) !== null && _api$featureFlags !== void 0 && (_api$featureFlags = _api$featureFlags.sharedState.currentState()) !== null && _api$featureFlags !== void 0 && _api$featureFlags.basicTextTransformations)) {
128
+ return;
129
+ }
130
+ return {
131
+ items: [{
132
+ type: 'dropdown',
133
+ title: intl.formatMessage(_messages.toolbarInsertBlockMessages.turnInto),
134
+ iconBefore: _switch.default,
135
+ options: []
136
+ }],
137
+ rank: -9
138
+ };
139
+ }
140
+ },
117
141
  usePluginHook: function usePluginHook() {
118
142
  (0, _react.useLayoutEffect)(function () {
119
143
  return function () {
@@ -10,8 +10,11 @@ var _react2 = require("@emotion/react");
10
10
  var _keymaps = require("@atlaskit/editor-common/keymaps");
11
11
  var _styles = require("@atlaskit/editor-common/styles");
12
12
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
13
+ var _addEditorAdd = _interopRequireDefault(require("@atlaskit/icon/core/migration/add--editor-add"));
13
14
  var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
14
15
  var _add = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/add"));
16
+ var _chevronDown2 = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-down"));
17
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
18
  var _styles2 = require("./styles");
16
19
  /**
17
20
  * @jsxRuntime classic
@@ -25,9 +28,21 @@ var DropDownButtonIcon = /*#__PURE__*/_react.default.memo(function (props) {
25
28
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
26
29
  (0, _react2.jsx)("span", {
27
30
  css: _styles2.triggerWrapper
28
- }, (0, _react2.jsx)(_add.default, {
31
+ }, (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? (0, _react2.jsx)(_addEditorAdd.default, {
32
+ label: props.label,
33
+ color: "currentColor"
34
+ }) : (0, _react2.jsx)(_add.default, {
29
35
  label: props.label
30
- }), (0, _react2.jsx)("span", {
36
+ }), (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ?
37
+ //eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
38
+ (0, _react2.jsx)("span", {
39
+ css: _styles2.expandWrapperStyle
40
+ }, (0, _react2.jsx)(_chevronDown2.default, {
41
+ label: "",
42
+ color: "currentColor"
43
+ })) :
44
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
45
+ (0, _react2.jsx)("span", {
31
46
  css: _styles.expandIconWrapperStyle
32
47
  }, (0, _react2.jsx)(_chevronDown.default, {
33
48
  label: ""
@@ -10,6 +10,17 @@ var _react2 = require("@emotion/react");
10
10
  var _memoizeOne = _interopRequireDefault(require("memoize-one"));
11
11
  var _keymaps = require("@atlaskit/editor-common/keymaps");
12
12
  var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
13
+ var _angleBracketsEditorCode = _interopRequireDefault(require("@atlaskit/icon/core/migration/angle-brackets--editor-code"));
14
+ var _calendarEditorDate = _interopRequireDefault(require("@atlaskit/icon/core/migration/calendar--editor-date"));
15
+ var _checkboxCheckedEditorTask = _interopRequireDefault(require("@atlaskit/icon/core/migration/checkbox-checked--editor-task"));
16
+ var _decisionEditorDecision = _interopRequireDefault(require("@atlaskit/icon/core/migration/decision--editor-decision"));
17
+ var _emojiEditorEmoji = _interopRequireDefault(require("@atlaskit/icon/core/migration/emoji--editor-emoji"));
18
+ var _imageEditorImage = _interopRequireDefault(require("@atlaskit/icon/core/migration/image--editor-image"));
19
+ var _informationEditorInfo = _interopRequireDefault(require("@atlaskit/icon/core/migration/information--editor-info"));
20
+ var _linkEditorLink = _interopRequireDefault(require("@atlaskit/icon/core/migration/link--editor-link"));
21
+ var _mentionEditorMention = _interopRequireDefault(require("@atlaskit/icon/core/migration/mention--editor-mention"));
22
+ var _quotationMarkQuote = _interopRequireDefault(require("@atlaskit/icon/core/migration/quotation-mark--quote"));
23
+ var _showMoreHorizontalEditorMore = _interopRequireDefault(require("@atlaskit/icon/core/migration/show-more-horizontal--editor-more"));
13
24
  var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
14
25
  var _chevronRightCircle = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-right-circle"));
15
26
  var _code = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/code"));
@@ -28,6 +39,8 @@ var _task = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/task"));
28
39
  var _text = _interopRequireDefault(require("@atlaskit/icon/glyph/media-services/text"));
29
40
  var _quote = _interopRequireDefault(require("@atlaskit/icon/glyph/quote"));
30
41
  var _status = _interopRequireDefault(require("@atlaskit/icon/glyph/status"));
42
+ var _chevronDown2 = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-down"));
43
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
31
44
  var _shallowEquals = require("./shallow-equals");
32
45
  /**
33
46
  * @jsxRuntime classic
@@ -68,7 +81,7 @@ var action = exports.action = mem(function (init) {
68
81
  disabled: init.disabled,
69
82
  name: 'action',
70
83
  shortcut: '[]',
71
- Icon: _task.default,
84
+ Icon: (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? _checkboxCheckedEditorTask.default : _task.default,
72
85
  'aria-keyshortcuts': '[ ] Space'
73
86
  });
74
87
  });
@@ -79,7 +92,7 @@ var link = exports.link = mem(function (init) {
79
92
  disabled: init.disabled,
80
93
  name: 'link',
81
94
  shortcut: (0, _keymaps.tooltip)(_keymaps.addLink),
82
- Icon: _link.default,
95
+ Icon: (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? _linkEditorLink.default : _link.default,
83
96
  'aria-haspopup': init['aria-haspopup'],
84
97
  'aria-keyshortcuts': (0, _keymaps.getAriaKeyshortcuts)(_keymaps.addLink)
85
98
  });
@@ -90,7 +103,7 @@ var media = exports.media = mem(function (init) {
90
103
  tooltipDescription: init.tooltipDescription,
91
104
  disabled: init.disabled,
92
105
  name: 'media',
93
- Icon: _image.default
106
+ Icon: (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? _imageEditorImage.default : _image.default
94
107
  });
95
108
  });
96
109
  var imageUpload = exports.imageUpload = mem(function (init) {
@@ -99,7 +112,7 @@ var imageUpload = exports.imageUpload = mem(function (init) {
99
112
  tooltipDescription: init.tooltipDescription,
100
113
  disabled: init.disabled,
101
114
  name: 'image upload',
102
- Icon: _image.default
115
+ Icon: (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? _imageEditorImage.default : _image.default
103
116
  });
104
117
  });
105
118
  var mention = exports.mention = mem(function (init) {
@@ -108,7 +121,7 @@ var mention = exports.mention = mem(function (init) {
108
121
  tooltipDescription: init.tooltipDescription,
109
122
  disabled: init.disabled,
110
123
  name: 'mention',
111
- Icon: _mention.default,
124
+ Icon: (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? _mentionEditorMention.default : _mention.default,
112
125
  shortcut: '@',
113
126
  'aria-haspopup': init['aria-haspopup'],
114
127
  'aria-keyshortcuts': 'Shift+2 Space'
@@ -120,7 +133,7 @@ var emoji = exports.emoji = mem(function (init) {
120
133
  tooltipDescription: init.tooltipDescription,
121
134
  disabled: init.disabled,
122
135
  name: 'emoji',
123
- Icon: _emoji.default,
136
+ Icon: (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? _emojiEditorEmoji.default : _emoji.default,
124
137
  shortcut: ':',
125
138
  'aria-haspopup': init['aria-haspopup'],
126
139
  'aria-keyshortcuts': 'Shift+;'
@@ -143,7 +156,12 @@ var tableSelector = exports.tableSelector = mem(function (init) {
143
156
  tooltipDescription: init.tooltipDescription,
144
157
  disabled: init.disabled,
145
158
  name: 'table selector',
146
- Icon: _chevronDown.default
159
+ Icon: (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? function () {
160
+ return (0, _react2.jsx)(_chevronDown2.default, {
161
+ label: "",
162
+ color: "currentColor"
163
+ });
164
+ } : _chevronDown.default
147
165
  });
148
166
  });
149
167
  var layout = exports.layout = mem(function (init) {
@@ -161,7 +179,7 @@ var codeblock = exports.codeblock = mem(function (init) {
161
179
  tooltipDescription: init.tooltipDescription,
162
180
  disabled: init.disabled,
163
181
  name: 'codeblock',
164
- Icon: _code.default,
182
+ Icon: (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? _angleBracketsEditorCode.default : _code.default,
165
183
  shortcut: init.shortcut,
166
184
  'aria-keyshortcuts': (0, _keymaps.getAriaKeyshortcuts)(init.shortcut)
167
185
  });
@@ -172,7 +190,7 @@ var panel = exports.panel = mem(function (init) {
172
190
  tooltipDescription: init.tooltipDescription,
173
191
  disabled: init.disabled,
174
192
  name: 'panel',
175
- Icon: _info.default,
193
+ Icon: (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? _informationEditorInfo.default : _info.default,
176
194
  shortcut: init.shortcut,
177
195
  'aria-keyshortcuts': (0, _keymaps.getAriaKeyshortcuts)(init.shortcut)
178
196
  });
@@ -183,7 +201,7 @@ var blockquote = exports.blockquote = mem(function (init) {
183
201
  tooltipDescription: init.tooltipDescription,
184
202
  disabled: init.disabled,
185
203
  name: 'blockquote',
186
- Icon: _quote.default,
204
+ Icon: (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? _quotationMarkQuote.default : _quote.default,
187
205
  shortcut: init.shortcut,
188
206
  'aria-keyshortcuts': 'Shift+. Space'
189
207
  });
@@ -194,7 +212,7 @@ var decision = exports.decision = mem(function (init) {
194
212
  tooltipDescription: init.tooltipDescription,
195
213
  disabled: init.disabled,
196
214
  name: 'decision',
197
- Icon: _decision.default,
215
+ Icon: (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? _decisionEditorDecision.default : _decision.default,
198
216
  shortcut: '<>',
199
217
  'aria-keyshortcuts': 'Shift+, Shift+. Space'
200
218
  });
@@ -225,7 +243,7 @@ var date = exports.date = mem(function (init) {
225
243
  tooltipDescription: init.tooltipDescription,
226
244
  disabled: init.disabled,
227
245
  name: 'date',
228
- Icon: _date.default,
246
+ Icon: (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? _calendarEditorDate.default : _date.default,
229
247
  shortcut: '//',
230
248
  'aria-keyshortcuts': '/ / Enter'
231
249
  });
@@ -259,7 +277,10 @@ var more = exports.more = mem(function (init) {
259
277
  disabled: init.disabled,
260
278
  name: 'macro',
261
279
  Icon: function Icon() {
262
- return (0, _react2.jsx)(_more.default, {
280
+ return (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? (0, _react2.jsx)(_showMoreHorizontalEditorMore.default, {
281
+ label: "",
282
+ color: "currentColor"
283
+ }) : (0, _react2.jsx)(_more.default, {
263
284
  label: ""
264
285
  });
265
286
  }
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.triggerWrapper = void 0;
6
+ exports.triggerWrapper = exports.expandWrapperStyle = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
9
 
@@ -20,4 +20,9 @@ var triggerWrapper = exports.triggerWrapper = (0, _react.css)({
20
20
  '> div > div': {
21
21
  display: 'flex'
22
22
  }
23
+ });
24
+
25
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
26
+ var expandWrapperStyle = exports.expandWrapperStyle = (0, _react.css)({
27
+ marginLeft: "var(--ds-space-050, 4px)"
23
28
  });
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import SVG from '@atlaskit/icon/svg';
3
+ export default function SwitchIcon() {
4
+ return /*#__PURE__*/React.createElement(SVG, {
5
+ label: ""
6
+ }, /*#__PURE__*/React.createElement("path", {
7
+ d: "M6.003 16H8.998C9.26322 16 9.51757 15.8947 9.70511 15.7071C9.89264 15.5196 9.998 15.2652 9.998 15C9.998 14.7348 9.89264 14.4805 9.70511 14.2929C9.51757 14.1054 9.26322 14 8.998 14H5.102C4.494 14 4 14.493 4 15.1V19C4 19.2656 4.10551 19.5204 4.29333 19.7082C4.48115 19.896 4.73589 20.0015 5.0015 20.0015C5.26711 20.0015 5.52185 19.896 5.70967 19.7082C5.89748 19.5204 6.003 19.2656 6.003 19V16Z",
8
+ fill: "var(--ds-icon, #44546F)"
9
+ }), /*#__PURE__*/React.createElement("path", {
10
+ d: "M18.018 14.572C16.989 16.649 14.807 18 12.37 18C10.104 18 8.051 16.833 6.945 14.98C6.659 14.5 6.023 14.334 5.524 14.609C5.40677 14.6709 5.30331 14.7559 5.21991 14.8589C5.13651 14.9619 5.0749 15.0808 5.0388 15.2083C5.00271 15.3359 4.99289 15.4694 5.00994 15.6009C5.027 15.7323 5.07056 15.8589 5.138 15.973C6.611 18.443 9.35 20 12.37 20C15.618 20 18.528 18.198 19.899 15.43C20.146 14.932 19.925 14.335 19.406 14.098C18.886 13.861 18.265 14.073 18.018 14.572Z",
11
+ fill: "var(--ds-icon, #44546F)"
12
+ }), /*#__PURE__*/React.createElement("path", {
13
+ fillRule: "evenodd",
14
+ clipRule: "evenodd",
15
+ d: "M15.002 10L18.898 10C19.506 10 20 9.50703 20 8.90003V5.00003C20 4.73441 19.8945 4.47968 19.7067 4.29186C19.5188 4.10404 19.2641 3.99853 18.9985 3.99853C18.7329 3.99853 18.4782 4.10404 18.2903 4.29186C18.1025 4.47968 17.997 4.73441 17.997 5.00003V8.00003H15.002C14.7368 8.00003 14.4824 8.10538 14.2949 8.29292C14.1074 8.48046 14.002 8.73481 14.002 9.00003C14.002 9.26524 14.1074 9.5196 14.2949 9.70713C14.4824 9.89467 14.7368 10 15.002 10Z",
16
+ fill: "var(--ds-icon, #44546F)"
17
+ }), /*#__PURE__*/React.createElement("path", {
18
+ fillRule: "evenodd",
19
+ clipRule: "evenodd",
20
+ d: "M4.596 9.90303C5.116 10.14 5.736 9.92803 5.983 9.42903C7.012 7.35203 9.193 6.00103 11.63 6.00103C13.896 6.00103 15.95 7.16803 17.055 9.02203C17.1988 9.25438 17.4265 9.42245 17.6909 9.49135C17.9553 9.56024 18.2361 9.52468 18.475 9.39203C18.975 9.11803 19.148 8.50703 18.862 8.02803C17.389 5.55803 14.65 4.00103 11.63 4.00103C8.382 4.00103 5.472 5.80303 4.102 8.57103C4.03537 8.70353 4.00045 8.84971 4 8.99803C4.00188 9.1902 4.05909 9.37775 4.16479 9.53825C4.27049 9.69875 4.4202 9.8254 4.596 9.90303Z",
21
+ fill: "var(--ds-icon, #44546F)"
22
+ }));
23
+ }
@@ -1,9 +1,11 @@
1
1
  import React, { useLayoutEffect } from 'react';
2
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
4
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
4
5
  import { WithProviders } from '@atlaskit/editor-common/provider-factory';
5
6
  import { ToolbarSize } from '@atlaskit/editor-common/types';
6
7
  import { BLOCK_QUOTE, CODE_BLOCK, PANEL } from '@atlaskit/editor-plugin-block-type/consts';
8
+ import SwitchIcon from './assets/switch';
7
9
  import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
8
10
  const toolbarSizeToButtons = toolbarSize => {
9
11
  switch (toolbarSize) {
@@ -103,6 +105,28 @@ export const insertBlockPlugin = ({
103
105
  toggle();
104
106
  }
105
107
  },
108
+ pluginsOptions: {
109
+ // This is added for basic text transformations experiment.
110
+ // This may not be the most ideal plugin to add this to, but it is suitable for experiment purpose
111
+ // as relevant plugin dependencies are already set up.
112
+ // If we decide to ship the feature, we will consider a separate plugin if needed.
113
+ // Experiment one-pager: https://hello.atlassian.net/wiki/spaces/ETM/pages/3931754727/Experiment+Elements+Basic+Text+Transformations
114
+ selectionToolbar: (_, intl) => {
115
+ var _api$featureFlags, _api$featureFlags$sha;
116
+ if (!(api !== null && api !== void 0 && (_api$featureFlags = api.featureFlags) !== null && _api$featureFlags !== void 0 && (_api$featureFlags$sha = _api$featureFlags.sharedState.currentState()) !== null && _api$featureFlags$sha !== void 0 && _api$featureFlags$sha.basicTextTransformations)) {
117
+ return;
118
+ }
119
+ return {
120
+ items: [{
121
+ type: 'dropdown',
122
+ title: intl.formatMessage(messages.turnInto),
123
+ iconBefore: SwitchIcon,
124
+ options: []
125
+ }],
126
+ rank: -9
127
+ };
128
+ }
129
+ },
106
130
  usePluginHook: () => {
107
131
  useLayoutEffect(() => {
108
132
  return () => {
@@ -9,16 +9,31 @@ import { jsx } from '@emotion/react';
9
9
  import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
10
10
  import { expandIconWrapperStyle } from '@atlaskit/editor-common/styles';
11
11
  import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
12
+ import AddIcon from '@atlaskit/icon/core/migration/add--editor-add';
12
13
  import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
13
- import AddIcon from '@atlaskit/icon/glyph/editor/add';
14
- import { triggerWrapper } from './styles';
14
+ import { default as AddIconLegacy } from '@atlaskit/icon/glyph/editor/add';
15
+ import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
16
+ import { fg } from '@atlaskit/platform-feature-flags';
17
+ import { expandWrapperStyle, triggerWrapper } from './styles';
15
18
  const DropDownButtonIcon = /*#__PURE__*/React.memo(props =>
16
19
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
17
20
  jsx("span", {
18
21
  css: triggerWrapper
19
- }, jsx(AddIcon, {
22
+ }, fg('platform_editor_migration_icon_and_typography') ? jsx(AddIcon, {
23
+ label: props.label,
24
+ color: "currentColor"
25
+ }) : jsx(AddIconLegacy, {
20
26
  label: props.label
21
- }), jsx("span", {
27
+ }), fg('platform_editor_migration_icon_and_typography') ?
28
+ //eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
29
+ jsx("span", {
30
+ css: expandWrapperStyle
31
+ }, jsx(ChevronDownIcon, {
32
+ label: "",
33
+ color: "currentColor"
34
+ })) :
35
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
36
+ jsx("span", {
22
37
  css: expandIconWrapperStyle
23
38
  }, jsx(ExpandIcon, {
24
39
  label: ""
@@ -9,24 +9,37 @@ import { jsx } from '@emotion/react';
9
9
  import memoizeOne from 'memoize-one';
10
10
  import { addLink, getAriaKeyshortcuts, toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
11
11
  import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
12
+ import AngleBracketsIcon from '@atlaskit/icon/core/migration/angle-brackets--editor-code';
13
+ import CalendarIcon from '@atlaskit/icon/core/migration/calendar--editor-date';
14
+ import CheckboxCheckedIcon from '@atlaskit/icon/core/migration/checkbox-checked--editor-task';
15
+ import DecisionIcon from '@atlaskit/icon/core/migration/decision--editor-decision';
16
+ import EmojiIcon from '@atlaskit/icon/core/migration/emoji--editor-emoji';
17
+ import ImageIcon from '@atlaskit/icon/core/migration/image--editor-image';
18
+ import InformationIcon from '@atlaskit/icon/core/migration/information--editor-info';
19
+ import LinkIcon from '@atlaskit/icon/core/migration/link--editor-link';
20
+ import MentionIcon from '@atlaskit/icon/core/migration/mention--editor-mention';
21
+ import QuotationMarkIcon from '@atlaskit/icon/core/migration/quotation-mark--quote';
22
+ import ShowMoreHorizontalIcon from '@atlaskit/icon/core/migration/show-more-horizontal--editor-more';
12
23
  import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
13
24
  import ExpandNodeIcon from '@atlaskit/icon/glyph/chevron-right-circle';
14
25
  import CodeIcon from '@atlaskit/icon/glyph/editor/code';
15
26
  import DateIcon from '@atlaskit/icon/glyph/editor/date';
16
- import DecisionIcon from '@atlaskit/icon/glyph/editor/decision';
17
- import EmojiIcon from '@atlaskit/icon/glyph/editor/emoji';
27
+ import { default as DecisionIconLegacy } from '@atlaskit/icon/glyph/editor/decision';
28
+ import { default as EmojiIconLegacy } from '@atlaskit/icon/glyph/editor/emoji';
18
29
  import HorizontalRuleIcon from '@atlaskit/icon/glyph/editor/horizontal-rule';
19
30
  import EditorImageIcon from '@atlaskit/icon/glyph/editor/image';
20
31
  import InfoIcon from '@atlaskit/icon/glyph/editor/info';
21
32
  import LayoutTwoEqualIcon from '@atlaskit/icon/glyph/editor/layout-two-equal';
22
- import LinkIcon from '@atlaskit/icon/glyph/editor/link';
23
- import MentionIcon from '@atlaskit/icon/glyph/editor/mention';
33
+ import { default as LinkIconLegacy } from '@atlaskit/icon/glyph/editor/link';
34
+ import { default as MentionIconLegacy } from '@atlaskit/icon/glyph/editor/mention';
24
35
  import EditorMoreIcon from '@atlaskit/icon/glyph/editor/more';
25
36
  import TableIcon from '@atlaskit/icon/glyph/editor/table';
26
37
  import TaskIcon from '@atlaskit/icon/glyph/editor/task';
27
38
  import PlaceholderTextIcon from '@atlaskit/icon/glyph/media-services/text';
28
39
  import QuoteIcon from '@atlaskit/icon/glyph/quote';
29
40
  import StatusIcon from '@atlaskit/icon/glyph/status';
41
+ import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
42
+ import { fg } from '@atlaskit/platform-feature-flags';
30
43
  import { shallowEquals } from './shallow-equals';
31
44
  const from = init => ({
32
45
  content: init.content,
@@ -56,7 +69,7 @@ export const action = mem(init => {
56
69
  disabled: init.disabled,
57
70
  name: 'action',
58
71
  shortcut: '[]',
59
- Icon: TaskIcon,
72
+ Icon: fg('platform_editor_migration_icon_and_typography') ? CheckboxCheckedIcon : TaskIcon,
60
73
  'aria-keyshortcuts': '[ ] Space'
61
74
  });
62
75
  });
@@ -66,7 +79,7 @@ export const link = mem(init => from({
66
79
  disabled: init.disabled,
67
80
  name: 'link',
68
81
  shortcut: tooltip(addLink),
69
- Icon: LinkIcon,
82
+ Icon: fg('platform_editor_migration_icon_and_typography') ? LinkIcon : LinkIconLegacy,
70
83
  'aria-haspopup': init['aria-haspopup'],
71
84
  'aria-keyshortcuts': getAriaKeyshortcuts(addLink)
72
85
  }));
@@ -75,21 +88,21 @@ export const media = mem(init => from({
75
88
  tooltipDescription: init.tooltipDescription,
76
89
  disabled: init.disabled,
77
90
  name: 'media',
78
- Icon: EditorImageIcon
91
+ Icon: fg('platform_editor_migration_icon_and_typography') ? ImageIcon : EditorImageIcon
79
92
  }));
80
93
  export const imageUpload = mem(init => from({
81
94
  content: init.content,
82
95
  tooltipDescription: init.tooltipDescription,
83
96
  disabled: init.disabled,
84
97
  name: 'image upload',
85
- Icon: EditorImageIcon
98
+ Icon: fg('platform_editor_migration_icon_and_typography') ? ImageIcon : EditorImageIcon
86
99
  }));
87
100
  export const mention = mem(init => from({
88
101
  content: init.content,
89
102
  tooltipDescription: init.tooltipDescription,
90
103
  disabled: init.disabled,
91
104
  name: 'mention',
92
- Icon: MentionIcon,
105
+ Icon: fg('platform_editor_migration_icon_and_typography') ? MentionIcon : MentionIconLegacy,
93
106
  shortcut: '@',
94
107
  'aria-haspopup': init['aria-haspopup'],
95
108
  'aria-keyshortcuts': 'Shift+2 Space'
@@ -99,7 +112,7 @@ export const emoji = mem(init => from({
99
112
  tooltipDescription: init.tooltipDescription,
100
113
  disabled: init.disabled,
101
114
  name: 'emoji',
102
- Icon: EmojiIcon,
115
+ Icon: fg('platform_editor_migration_icon_and_typography') ? EmojiIcon : EmojiIconLegacy,
103
116
  shortcut: ':',
104
117
  'aria-haspopup': init['aria-haspopup'],
105
118
  'aria-keyshortcuts': 'Shift+;'
@@ -118,7 +131,10 @@ export const tableSelector = mem(init => from({
118
131
  tooltipDescription: init.tooltipDescription,
119
132
  disabled: init.disabled,
120
133
  name: 'table selector',
121
- Icon: ExpandIcon
134
+ Icon: fg('platform_editor_migration_icon_and_typography') ? () => jsx(ChevronDownIcon, {
135
+ label: "",
136
+ color: "currentColor"
137
+ }) : ExpandIcon
122
138
  }));
123
139
  export const layout = mem(init => from({
124
140
  content: init.content,
@@ -132,7 +148,7 @@ export const codeblock = mem(init => from({
132
148
  tooltipDescription: init.tooltipDescription,
133
149
  disabled: init.disabled,
134
150
  name: 'codeblock',
135
- Icon: CodeIcon,
151
+ Icon: fg('platform_editor_migration_icon_and_typography') ? AngleBracketsIcon : CodeIcon,
136
152
  shortcut: init.shortcut,
137
153
  'aria-keyshortcuts': getAriaKeyshortcuts(init.shortcut)
138
154
  }));
@@ -141,7 +157,7 @@ export const panel = mem(init => from({
141
157
  tooltipDescription: init.tooltipDescription,
142
158
  disabled: init.disabled,
143
159
  name: 'panel',
144
- Icon: InfoIcon,
160
+ Icon: fg('platform_editor_migration_icon_and_typography') ? InformationIcon : InfoIcon,
145
161
  shortcut: init.shortcut,
146
162
  'aria-keyshortcuts': getAriaKeyshortcuts(init.shortcut)
147
163
  }));
@@ -150,7 +166,7 @@ export const blockquote = mem(init => from({
150
166
  tooltipDescription: init.tooltipDescription,
151
167
  disabled: init.disabled,
152
168
  name: 'blockquote',
153
- Icon: QuoteIcon,
169
+ Icon: fg('platform_editor_migration_icon_and_typography') ? QuotationMarkIcon : QuoteIcon,
154
170
  shortcut: init.shortcut,
155
171
  'aria-keyshortcuts': 'Shift+. Space'
156
172
  }));
@@ -159,7 +175,7 @@ export const decision = mem(init => from({
159
175
  tooltipDescription: init.tooltipDescription,
160
176
  disabled: init.disabled,
161
177
  name: 'decision',
162
- Icon: DecisionIcon,
178
+ Icon: fg('platform_editor_migration_icon_and_typography') ? DecisionIcon : DecisionIconLegacy,
163
179
  shortcut: '<>',
164
180
  'aria-keyshortcuts': 'Shift+, Shift+. Space'
165
181
  }));
@@ -184,7 +200,7 @@ export const date = mem(init => from({
184
200
  tooltipDescription: init.tooltipDescription,
185
201
  disabled: init.disabled,
186
202
  name: 'date',
187
- Icon: DateIcon,
203
+ Icon: fg('platform_editor_migration_icon_and_typography') ? CalendarIcon : DateIcon,
188
204
  shortcut: '//',
189
205
  'aria-keyshortcuts': '/ / Enter'
190
206
  }));
@@ -209,7 +225,10 @@ export const more = mem(init => from({
209
225
  tooltipDescription: init.tooltipDescription,
210
226
  disabled: init.disabled,
211
227
  name: 'macro',
212
- Icon: () => jsx(EditorMoreIcon, {
228
+ Icon: () => fg('platform_editor_migration_icon_and_typography') ? jsx(ShowMoreHorizontalIcon, {
229
+ label: "",
230
+ color: "currentColor"
231
+ }) : jsx(EditorMoreIcon, {
213
232
  label: ""
214
233
  })
215
234
  }));
@@ -1,6 +1,5 @@
1
1
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
2
  import { css } from '@emotion/react';
3
-
4
3
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
5
4
  export const triggerWrapper = css({
6
5
  width: '42px',
@@ -14,4 +13,9 @@ export const triggerWrapper = css({
14
13
  '> div > div': {
15
14
  display: 'flex'
16
15
  }
16
+ });
17
+
18
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
19
+ export const expandWrapperStyle = css({
20
+ marginLeft: "var(--ds-space-050, 4px)"
17
21
  });
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import SVG from '@atlaskit/icon/svg';
3
+ export default function SwitchIcon() {
4
+ return /*#__PURE__*/React.createElement(SVG, {
5
+ label: ""
6
+ }, /*#__PURE__*/React.createElement("path", {
7
+ d: "M6.003 16H8.998C9.26322 16 9.51757 15.8947 9.70511 15.7071C9.89264 15.5196 9.998 15.2652 9.998 15C9.998 14.7348 9.89264 14.4805 9.70511 14.2929C9.51757 14.1054 9.26322 14 8.998 14H5.102C4.494 14 4 14.493 4 15.1V19C4 19.2656 4.10551 19.5204 4.29333 19.7082C4.48115 19.896 4.73589 20.0015 5.0015 20.0015C5.26711 20.0015 5.52185 19.896 5.70967 19.7082C5.89748 19.5204 6.003 19.2656 6.003 19V16Z",
8
+ fill: "var(--ds-icon, #44546F)"
9
+ }), /*#__PURE__*/React.createElement("path", {
10
+ d: "M18.018 14.572C16.989 16.649 14.807 18 12.37 18C10.104 18 8.051 16.833 6.945 14.98C6.659 14.5 6.023 14.334 5.524 14.609C5.40677 14.6709 5.30331 14.7559 5.21991 14.8589C5.13651 14.9619 5.0749 15.0808 5.0388 15.2083C5.00271 15.3359 4.99289 15.4694 5.00994 15.6009C5.027 15.7323 5.07056 15.8589 5.138 15.973C6.611 18.443 9.35 20 12.37 20C15.618 20 18.528 18.198 19.899 15.43C20.146 14.932 19.925 14.335 19.406 14.098C18.886 13.861 18.265 14.073 18.018 14.572Z",
11
+ fill: "var(--ds-icon, #44546F)"
12
+ }), /*#__PURE__*/React.createElement("path", {
13
+ fillRule: "evenodd",
14
+ clipRule: "evenodd",
15
+ d: "M15.002 10L18.898 10C19.506 10 20 9.50703 20 8.90003V5.00003C20 4.73441 19.8945 4.47968 19.7067 4.29186C19.5188 4.10404 19.2641 3.99853 18.9985 3.99853C18.7329 3.99853 18.4782 4.10404 18.2903 4.29186C18.1025 4.47968 17.997 4.73441 17.997 5.00003V8.00003H15.002C14.7368 8.00003 14.4824 8.10538 14.2949 8.29292C14.1074 8.48046 14.002 8.73481 14.002 9.00003C14.002 9.26524 14.1074 9.5196 14.2949 9.70713C14.4824 9.89467 14.7368 10 15.002 10Z",
16
+ fill: "var(--ds-icon, #44546F)"
17
+ }), /*#__PURE__*/React.createElement("path", {
18
+ fillRule: "evenodd",
19
+ clipRule: "evenodd",
20
+ d: "M4.596 9.90303C5.116 10.14 5.736 9.92803 5.983 9.42903C7.012 7.35203 9.193 6.00103 11.63 6.00103C13.896 6.00103 15.95 7.16803 17.055 9.02203C17.1988 9.25438 17.4265 9.42245 17.6909 9.49135C17.9553 9.56024 18.2361 9.52468 18.475 9.39203C18.975 9.11803 19.148 8.50703 18.862 8.02803C17.389 5.55803 14.65 4.00103 11.63 4.00103C8.382 4.00103 5.472 5.80303 4.102 8.57103C4.03537 8.70353 4.00045 8.84971 4 8.99803C4.00188 9.1902 4.05909 9.37775 4.16479 9.53825C4.27049 9.69875 4.4202 9.8254 4.596 9.90303Z",
21
+ fill: "var(--ds-icon, #44546F)"
22
+ }));
23
+ }
@@ -1,9 +1,11 @@
1
1
  import React, { useLayoutEffect } from 'react';
2
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
4
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
4
5
  import { WithProviders } from '@atlaskit/editor-common/provider-factory';
5
6
  import { ToolbarSize } from '@atlaskit/editor-common/types';
6
7
  import { BLOCK_QUOTE, CODE_BLOCK, PANEL } from '@atlaskit/editor-plugin-block-type/consts';
8
+ import SwitchIcon from './assets/switch';
7
9
  import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
8
10
  var toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize) {
9
11
  switch (toolbarSize) {
@@ -104,6 +106,28 @@ export var insertBlockPlugin = function insertBlockPlugin(_ref) {
104
106
  toggle();
105
107
  }
106
108
  },
109
+ pluginsOptions: {
110
+ // This is added for basic text transformations experiment.
111
+ // This may not be the most ideal plugin to add this to, but it is suitable for experiment purpose
112
+ // as relevant plugin dependencies are already set up.
113
+ // If we decide to ship the feature, we will consider a separate plugin if needed.
114
+ // Experiment one-pager: https://hello.atlassian.net/wiki/spaces/ETM/pages/3931754727/Experiment+Elements+Basic+Text+Transformations
115
+ selectionToolbar: function selectionToolbar(_, intl) {
116
+ var _api$featureFlags;
117
+ if (!(api !== null && api !== void 0 && (_api$featureFlags = api.featureFlags) !== null && _api$featureFlags !== void 0 && (_api$featureFlags = _api$featureFlags.sharedState.currentState()) !== null && _api$featureFlags !== void 0 && _api$featureFlags.basicTextTransformations)) {
118
+ return;
119
+ }
120
+ return {
121
+ items: [{
122
+ type: 'dropdown',
123
+ title: intl.formatMessage(messages.turnInto),
124
+ iconBefore: SwitchIcon,
125
+ options: []
126
+ }],
127
+ rank: -9
128
+ };
129
+ }
130
+ },
107
131
  usePluginHook: function usePluginHook() {
108
132
  useLayoutEffect(function () {
109
133
  return function () {
@@ -9,17 +9,32 @@ import { jsx } from '@emotion/react';
9
9
  import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
10
10
  import { expandIconWrapperStyle } from '@atlaskit/editor-common/styles';
11
11
  import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
12
+ import AddIcon from '@atlaskit/icon/core/migration/add--editor-add';
12
13
  import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
13
- import AddIcon from '@atlaskit/icon/glyph/editor/add';
14
- import { triggerWrapper } from './styles';
14
+ import { default as AddIconLegacy } from '@atlaskit/icon/glyph/editor/add';
15
+ import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
16
+ import { fg } from '@atlaskit/platform-feature-flags';
17
+ import { expandWrapperStyle, triggerWrapper } from './styles';
15
18
  var DropDownButtonIcon = /*#__PURE__*/React.memo(function (props) {
16
19
  return (
17
20
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
18
21
  jsx("span", {
19
22
  css: triggerWrapper
20
- }, jsx(AddIcon, {
23
+ }, fg('platform_editor_migration_icon_and_typography') ? jsx(AddIcon, {
24
+ label: props.label,
25
+ color: "currentColor"
26
+ }) : jsx(AddIconLegacy, {
21
27
  label: props.label
22
- }), jsx("span", {
28
+ }), fg('platform_editor_migration_icon_and_typography') ?
29
+ //eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
30
+ jsx("span", {
31
+ css: expandWrapperStyle
32
+ }, jsx(ChevronDownIcon, {
33
+ label: "",
34
+ color: "currentColor"
35
+ })) :
36
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
37
+ jsx("span", {
23
38
  css: expandIconWrapperStyle
24
39
  }, jsx(ExpandIcon, {
25
40
  label: ""
@@ -9,24 +9,37 @@ import { jsx } from '@emotion/react';
9
9
  import memoizeOne from 'memoize-one';
10
10
  import { addLink, getAriaKeyshortcuts, toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
11
11
  import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
12
+ import AngleBracketsIcon from '@atlaskit/icon/core/migration/angle-brackets--editor-code';
13
+ import CalendarIcon from '@atlaskit/icon/core/migration/calendar--editor-date';
14
+ import CheckboxCheckedIcon from '@atlaskit/icon/core/migration/checkbox-checked--editor-task';
15
+ import DecisionIcon from '@atlaskit/icon/core/migration/decision--editor-decision';
16
+ import EmojiIcon from '@atlaskit/icon/core/migration/emoji--editor-emoji';
17
+ import ImageIcon from '@atlaskit/icon/core/migration/image--editor-image';
18
+ import InformationIcon from '@atlaskit/icon/core/migration/information--editor-info';
19
+ import LinkIcon from '@atlaskit/icon/core/migration/link--editor-link';
20
+ import MentionIcon from '@atlaskit/icon/core/migration/mention--editor-mention';
21
+ import QuotationMarkIcon from '@atlaskit/icon/core/migration/quotation-mark--quote';
22
+ import ShowMoreHorizontalIcon from '@atlaskit/icon/core/migration/show-more-horizontal--editor-more';
12
23
  import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
13
24
  import ExpandNodeIcon from '@atlaskit/icon/glyph/chevron-right-circle';
14
25
  import CodeIcon from '@atlaskit/icon/glyph/editor/code';
15
26
  import DateIcon from '@atlaskit/icon/glyph/editor/date';
16
- import DecisionIcon from '@atlaskit/icon/glyph/editor/decision';
17
- import EmojiIcon from '@atlaskit/icon/glyph/editor/emoji';
27
+ import { default as DecisionIconLegacy } from '@atlaskit/icon/glyph/editor/decision';
28
+ import { default as EmojiIconLegacy } from '@atlaskit/icon/glyph/editor/emoji';
18
29
  import HorizontalRuleIcon from '@atlaskit/icon/glyph/editor/horizontal-rule';
19
30
  import EditorImageIcon from '@atlaskit/icon/glyph/editor/image';
20
31
  import InfoIcon from '@atlaskit/icon/glyph/editor/info';
21
32
  import LayoutTwoEqualIcon from '@atlaskit/icon/glyph/editor/layout-two-equal';
22
- import LinkIcon from '@atlaskit/icon/glyph/editor/link';
23
- import MentionIcon from '@atlaskit/icon/glyph/editor/mention';
33
+ import { default as LinkIconLegacy } from '@atlaskit/icon/glyph/editor/link';
34
+ import { default as MentionIconLegacy } from '@atlaskit/icon/glyph/editor/mention';
24
35
  import EditorMoreIcon from '@atlaskit/icon/glyph/editor/more';
25
36
  import TableIcon from '@atlaskit/icon/glyph/editor/table';
26
37
  import TaskIcon from '@atlaskit/icon/glyph/editor/task';
27
38
  import PlaceholderTextIcon from '@atlaskit/icon/glyph/media-services/text';
28
39
  import QuoteIcon from '@atlaskit/icon/glyph/quote';
29
40
  import StatusIcon from '@atlaskit/icon/glyph/status';
41
+ import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
42
+ import { fg } from '@atlaskit/platform-feature-flags';
30
43
  import { shallowEquals } from './shallow-equals';
31
44
  var from = function from(init) {
32
45
  return {
@@ -60,7 +73,7 @@ export var action = mem(function (init) {
60
73
  disabled: init.disabled,
61
74
  name: 'action',
62
75
  shortcut: '[]',
63
- Icon: TaskIcon,
76
+ Icon: fg('platform_editor_migration_icon_and_typography') ? CheckboxCheckedIcon : TaskIcon,
64
77
  'aria-keyshortcuts': '[ ] Space'
65
78
  });
66
79
  });
@@ -71,7 +84,7 @@ export var link = mem(function (init) {
71
84
  disabled: init.disabled,
72
85
  name: 'link',
73
86
  shortcut: tooltip(addLink),
74
- Icon: LinkIcon,
87
+ Icon: fg('platform_editor_migration_icon_and_typography') ? LinkIcon : LinkIconLegacy,
75
88
  'aria-haspopup': init['aria-haspopup'],
76
89
  'aria-keyshortcuts': getAriaKeyshortcuts(addLink)
77
90
  });
@@ -82,7 +95,7 @@ export var media = mem(function (init) {
82
95
  tooltipDescription: init.tooltipDescription,
83
96
  disabled: init.disabled,
84
97
  name: 'media',
85
- Icon: EditorImageIcon
98
+ Icon: fg('platform_editor_migration_icon_and_typography') ? ImageIcon : EditorImageIcon
86
99
  });
87
100
  });
88
101
  export var imageUpload = mem(function (init) {
@@ -91,7 +104,7 @@ export var imageUpload = mem(function (init) {
91
104
  tooltipDescription: init.tooltipDescription,
92
105
  disabled: init.disabled,
93
106
  name: 'image upload',
94
- Icon: EditorImageIcon
107
+ Icon: fg('platform_editor_migration_icon_and_typography') ? ImageIcon : EditorImageIcon
95
108
  });
96
109
  });
97
110
  export var mention = mem(function (init) {
@@ -100,7 +113,7 @@ export var mention = mem(function (init) {
100
113
  tooltipDescription: init.tooltipDescription,
101
114
  disabled: init.disabled,
102
115
  name: 'mention',
103
- Icon: MentionIcon,
116
+ Icon: fg('platform_editor_migration_icon_and_typography') ? MentionIcon : MentionIconLegacy,
104
117
  shortcut: '@',
105
118
  'aria-haspopup': init['aria-haspopup'],
106
119
  'aria-keyshortcuts': 'Shift+2 Space'
@@ -112,7 +125,7 @@ export var emoji = mem(function (init) {
112
125
  tooltipDescription: init.tooltipDescription,
113
126
  disabled: init.disabled,
114
127
  name: 'emoji',
115
- Icon: EmojiIcon,
128
+ Icon: fg('platform_editor_migration_icon_and_typography') ? EmojiIcon : EmojiIconLegacy,
116
129
  shortcut: ':',
117
130
  'aria-haspopup': init['aria-haspopup'],
118
131
  'aria-keyshortcuts': 'Shift+;'
@@ -135,7 +148,12 @@ export var tableSelector = mem(function (init) {
135
148
  tooltipDescription: init.tooltipDescription,
136
149
  disabled: init.disabled,
137
150
  name: 'table selector',
138
- Icon: ExpandIcon
151
+ Icon: fg('platform_editor_migration_icon_and_typography') ? function () {
152
+ return jsx(ChevronDownIcon, {
153
+ label: "",
154
+ color: "currentColor"
155
+ });
156
+ } : ExpandIcon
139
157
  });
140
158
  });
141
159
  export var layout = mem(function (init) {
@@ -153,7 +171,7 @@ export var codeblock = mem(function (init) {
153
171
  tooltipDescription: init.tooltipDescription,
154
172
  disabled: init.disabled,
155
173
  name: 'codeblock',
156
- Icon: CodeIcon,
174
+ Icon: fg('platform_editor_migration_icon_and_typography') ? AngleBracketsIcon : CodeIcon,
157
175
  shortcut: init.shortcut,
158
176
  'aria-keyshortcuts': getAriaKeyshortcuts(init.shortcut)
159
177
  });
@@ -164,7 +182,7 @@ export var panel = mem(function (init) {
164
182
  tooltipDescription: init.tooltipDescription,
165
183
  disabled: init.disabled,
166
184
  name: 'panel',
167
- Icon: InfoIcon,
185
+ Icon: fg('platform_editor_migration_icon_and_typography') ? InformationIcon : InfoIcon,
168
186
  shortcut: init.shortcut,
169
187
  'aria-keyshortcuts': getAriaKeyshortcuts(init.shortcut)
170
188
  });
@@ -175,7 +193,7 @@ export var blockquote = mem(function (init) {
175
193
  tooltipDescription: init.tooltipDescription,
176
194
  disabled: init.disabled,
177
195
  name: 'blockquote',
178
- Icon: QuoteIcon,
196
+ Icon: fg('platform_editor_migration_icon_and_typography') ? QuotationMarkIcon : QuoteIcon,
179
197
  shortcut: init.shortcut,
180
198
  'aria-keyshortcuts': 'Shift+. Space'
181
199
  });
@@ -186,7 +204,7 @@ export var decision = mem(function (init) {
186
204
  tooltipDescription: init.tooltipDescription,
187
205
  disabled: init.disabled,
188
206
  name: 'decision',
189
- Icon: DecisionIcon,
207
+ Icon: fg('platform_editor_migration_icon_and_typography') ? DecisionIcon : DecisionIconLegacy,
190
208
  shortcut: '<>',
191
209
  'aria-keyshortcuts': 'Shift+, Shift+. Space'
192
210
  });
@@ -217,7 +235,7 @@ export var date = mem(function (init) {
217
235
  tooltipDescription: init.tooltipDescription,
218
236
  disabled: init.disabled,
219
237
  name: 'date',
220
- Icon: DateIcon,
238
+ Icon: fg('platform_editor_migration_icon_and_typography') ? CalendarIcon : DateIcon,
221
239
  shortcut: '//',
222
240
  'aria-keyshortcuts': '/ / Enter'
223
241
  });
@@ -251,7 +269,10 @@ export var more = mem(function (init) {
251
269
  disabled: init.disabled,
252
270
  name: 'macro',
253
271
  Icon: function Icon() {
254
- return jsx(EditorMoreIcon, {
272
+ return fg('platform_editor_migration_icon_and_typography') ? jsx(ShowMoreHorizontalIcon, {
273
+ label: "",
274
+ color: "currentColor"
275
+ }) : jsx(EditorMoreIcon, {
255
276
  label: ""
256
277
  });
257
278
  }
@@ -1,6 +1,5 @@
1
1
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
2
  import { css } from '@emotion/react';
3
-
4
3
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
5
4
  export var triggerWrapper = css({
6
5
  width: '42px',
@@ -14,4 +13,9 @@ export var triggerWrapper = css({
14
13
  '> div > div': {
15
14
  display: 'flex'
16
15
  }
16
+ });
17
+
18
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
19
+ export var expandWrapperStyle = css({
20
+ marginLeft: "var(--ds-space-050, 4px)"
17
21
  });
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function SwitchIcon(): JSX.Element;
@@ -6,6 +6,7 @@ import type { DatePlugin } from '@atlaskit/editor-plugin-date';
6
6
  import type { EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
7
7
  import type { ExpandPlugin } from '@atlaskit/editor-plugin-expand';
8
8
  import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
9
+ import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
9
10
  import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
10
11
  import type { ImageUploadPlugin } from '@atlaskit/editor-plugin-image-upload';
11
12
  import type { LayoutPlugin } from '@atlaskit/editor-plugin-layout';
@@ -41,5 +42,6 @@ export type InsertBlockPluginDependencies = [
41
42
  OptionalPlugin<PlaceholderTextPlugin>,
42
43
  OptionalPlugin<ExtensionPlugin>,
43
44
  OptionalPlugin<TasksAndDecisionsPlugin>,
44
- OptionalPlugin<PrimaryToolbarPlugin>
45
+ OptionalPlugin<PrimaryToolbarPlugin>,
46
+ OptionalPlugin<FeatureFlagsPlugin>
45
47
  ];
@@ -1 +1,2 @@
1
1
  export declare const triggerWrapper: import("@emotion/react").SerializedStyles;
2
+ export declare const expandWrapperStyle: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function SwitchIcon(): JSX.Element;
@@ -6,6 +6,7 @@ import type { DatePlugin } from '@atlaskit/editor-plugin-date';
6
6
  import type { EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
7
7
  import type { ExpandPlugin } from '@atlaskit/editor-plugin-expand';
8
8
  import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
9
+ import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
9
10
  import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
10
11
  import type { ImageUploadPlugin } from '@atlaskit/editor-plugin-image-upload';
11
12
  import type { LayoutPlugin } from '@atlaskit/editor-plugin-layout';
@@ -41,5 +42,6 @@ export type InsertBlockPluginDependencies = [
41
42
  OptionalPlugin<PlaceholderTextPlugin>,
42
43
  OptionalPlugin<ExtensionPlugin>,
43
44
  OptionalPlugin<TasksAndDecisionsPlugin>,
44
- OptionalPlugin<PrimaryToolbarPlugin>
45
+ OptionalPlugin<PrimaryToolbarPlugin>,
46
+ OptionalPlugin<FeatureFlagsPlugin>
45
47
  ];
@@ -1 +1,2 @@
1
1
  export declare const triggerWrapper: import("@emotion/react").SerializedStyles;
2
+ export declare const expandWrapperStyle: import("@emotion/react").SerializedStyles;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-insert-block",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "Insert block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  ".": "./src/index.ts"
34
34
  },
35
35
  "dependencies": {
36
- "@atlaskit/editor-common": "^87.3.0",
36
+ "@atlaskit/editor-common": "^87.4.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.6.0",
38
38
  "@atlaskit/editor-plugin-block-type": "^3.11.0",
39
39
  "@atlaskit/editor-plugin-code-block": "^3.2.0",
@@ -41,6 +41,7 @@
41
41
  "@atlaskit/editor-plugin-emoji": "^2.2.0",
42
42
  "@atlaskit/editor-plugin-expand": "^2.2.0",
43
43
  "@atlaskit/editor-plugin-extension": "^1.12.0",
44
+ "@atlaskit/editor-plugin-feature-flags": "^1.2.0",
44
45
  "@atlaskit/editor-plugin-hyperlink": "^2.7.0",
45
46
  "@atlaskit/editor-plugin-image-upload": "^1.2.0",
46
47
  "@atlaskit/editor-plugin-layout": "^1.6.0",
@@ -58,10 +59,11 @@
58
59
  "@atlaskit/editor-prosemirror": "5.0.1",
59
60
  "@atlaskit/editor-shared-styles": "^2.13.0",
60
61
  "@atlaskit/emoji": "^67.7.0",
61
- "@atlaskit/icon": "^22.9.0",
62
+ "@atlaskit/icon": "^22.10.0",
63
+ "@atlaskit/platform-feature-flags": "^0.3.0",
62
64
  "@atlaskit/primitives": "^11.1.0",
63
65
  "@atlaskit/theme": "^12.11.0",
64
- "@atlaskit/tokens": "^1.56.0",
66
+ "@atlaskit/tokens": "^1.57.0",
65
67
  "@babel/runtime": "^7.0.0",
66
68
  "@emotion/react": "^11.7.1",
67
69
  "bind-event-listener": "^3.0.0",
@@ -114,5 +116,10 @@
114
116
  "import-no-extraneous-disable-for-examples-and-docs"
115
117
  ]
116
118
  }
119
+ },
120
+ "platform-feature-flags": {
121
+ "platform_editor_migration_icon_and_typography": {
122
+ "type": "boolean"
123
+ }
117
124
  }
118
125
  }