@atlaskit/editor-core 187.31.1 → 187.31.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 187.31.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`0debfab882f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0debfab882f) - ED-17959 prevent redundant rerenders on insert block component and due to typeahead state changes
8
+
9
+ ## 187.31.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`dbccd831543`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dbccd831543) - [ux] tokenize ColorPicker, make charts package compatible with tokens, make check mark compatible with tokens
14
+
3
15
  ## 187.31.1
4
16
 
5
17
  ### Patch Changes
@@ -34,15 +34,6 @@ var toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize) {
34
34
  return 0;
35
35
  }
36
36
  };
37
- /**
38
- * Wrapper over insertBlockTypeWithAnalytics to autobind toolbar input method
39
- * @param name Block name
40
- */
41
- function handleInsertBlockType(editorAnalyticsApi) {
42
- return function (name) {
43
- return (0, _commands.insertBlockTypesWithAnalytics)(name, _analytics.INPUT_METHOD.TOOLBAR, editorAnalyticsApi);
44
- };
45
- }
46
37
  var insertBlockPlugin = function insertBlockPlugin() {
47
38
  var _api$dependencies, _api$dependencies$fea;
48
39
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -68,6 +59,7 @@ var insertBlockPlugin = function insertBlockPlugin() {
68
59
  return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
69
60
  plugins: {
70
61
  typeAheadState: _key.pluginKey,
62
+ // needed to check isTypeAheadAllowed in ToolbarInsertBlock
71
63
  blockTypeState: _main.pluginKey,
72
64
  mediaState: _pluginKey.stateKey,
73
65
  macroState: _pluginKey3.pluginKey,
@@ -115,7 +107,7 @@ var insertBlockPlugin = function insertBlockPlugin() {
115
107
  };
116
108
  };
117
109
  function ToolbarInsertBlockWithInjectionApi(_ref3) {
118
- var _pluginInjectionApi$d, _pluginInjectionApi$d2;
110
+ var _pluginInjectionApi$d2, _pluginInjectionApi$d3;
119
111
  var editorView = _ref3.editorView,
120
112
  editorActions = _ref3.editorActions,
121
113
  dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
@@ -143,6 +135,15 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
143
135
  imageUploadState = _useSharedPluginState.imageUploadState,
144
136
  mentionState = _useSharedPluginState.mentionState,
145
137
  emojiState = _useSharedPluginState.emojiState;
138
+
139
+ /**
140
+ * Wrapper over insertBlockTypeWithAnalytics to autobind toolbar input method
141
+ * @param name Block name
142
+ */
143
+ var handleInsertBlockType = _react.default.useCallback(function (name) {
144
+ var _pluginInjectionApi$d;
145
+ return (0, _commands.insertBlockTypesWithAnalytics)(name, _analytics.INPUT_METHOD.TOOLBAR, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.analytics) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.actions);
146
+ }, [pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.dependencies.analytics) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.actions]);
146
147
  return /*#__PURE__*/_react.default.createElement(_ToolbarInsertBlock.default, {
147
148
  pluginInjectionApi: pluginInjectionApi,
148
149
  buttons: buttons,
@@ -164,7 +165,7 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
164
165
  mediaSupported: !!mediaState,
165
166
  imageUploadSupported: !!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.dependencies.imageUpload),
166
167
  imageUploadEnabled: imageUploadState === null || imageUploadState === void 0 ? void 0 : imageUploadState.enabled,
167
- handleImageUpload: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.imageUpload) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.actions.startUpload,
168
+ handleImageUpload: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d3 = pluginInjectionApi.dependencies.imageUpload) === null || _pluginInjectionApi$d3 === void 0 ? void 0 : _pluginInjectionApi$d3.actions.startUpload,
168
169
  availableWrapperBlockTypes: blockTypeState && blockTypeState.availableWrapperBlockTypes,
169
170
  linkSupported: !!hyperlinkState,
170
171
  linkDisabled: !hyperlinkState || !hyperlinkState.canInsertLink || !!hyperlinkState.activeLinkMark,
@@ -172,7 +173,7 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
172
173
  emojiProvider: providers.emojiProvider,
173
174
  nativeStatusSupported: options.nativeStatusSupported,
174
175
  horizontalRuleEnabled: options.horizontalRuleEnabled,
175
- onInsertBlockType: handleInsertBlockType(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.dependencies.analytics) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.actions),
176
+ onInsertBlockType: handleInsertBlockType,
176
177
  onInsertMacroFromMacroBrowser: _macro.insertMacroFromMacroBrowser,
177
178
  macroProvider: macroState.macroProvider,
178
179
  popupsMountPoint: popupsMountPoint,
@@ -144,6 +144,11 @@ var createReducer = function createReducer(_ref) {
144
144
  var mappedDecorationSet = decorationSet.map(tr.mapping, tr.doc, {
145
145
  onRemove: onRemove
146
146
  });
147
+
148
+ // return same pluginState if decorationSet did not change
149
+ if (mappedDecorationSet === currentPluginState.decorationSet) {
150
+ return currentPluginState;
151
+ }
147
152
  return _objectSpread(_objectSpread({}, currentPluginState), {}, {
148
153
  decorationSet: mappedDecorationSet
149
154
  });
@@ -10,7 +10,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
10
10
  var _react = require("@emotion/react");
11
11
  var _react2 = require("react");
12
12
  var _form = require("@atlaskit/form");
13
- var _editorPalette = require("@atlaskit/editor-palette");
14
13
  var _common = require("../../../ui/ColorPalette/Palettes/common");
15
14
  var _utils = require("../utils");
16
15
  var _RequiredIndicator = require("./common/RequiredIndicator");
@@ -31,105 +30,105 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
31
30
 
32
31
  var colorPalette = [{
33
32
  label: 'Light Blue',
34
- value: '#7AB2FFFF'
33
+ value: "var(--ds-background-accent-blue-subtle, #7AB2FF)"
35
34
  },
36
35
  // 400
37
36
  {
38
37
  label: 'Light Green',
39
- value: '#6BE1B0FF'
38
+ value: "var(--ds-background-accent-green-subtle, #6BE1B0)"
40
39
  },
41
40
  // 400
42
41
  {
43
42
  label: 'Light Yellow',
44
- value: '#FFDB57FF'
43
+ value: "var(--ds-background-accent-yellow-subtle, #FFDB57)"
45
44
  },
46
45
  // 400
47
46
  {
48
47
  label: 'Light Red',
49
- value: '#FF8F73FF'
48
+ value: "var(--ds-background-accent-red-subtle, #FF8F73)"
50
49
  },
51
50
  // 400
52
51
  {
53
52
  label: 'Light Purple',
54
- value: '#B5A7FBFF'
53
+ value: "var(--ds-background-accent-purple-subtle, #B5A7FB)"
55
54
  },
56
55
  // 400
57
56
 
58
57
  {
59
58
  label: 'Blue',
60
- value: '#247FFFFF'
59
+ value: "var(--ds-chart-blue-bold, #247FFF)"
61
60
  },
62
61
  // 600
63
62
  {
64
63
  label: 'Green',
65
- value: '#23A971FF'
64
+ value: "var(--ds-chart-green-bold, #23A971)"
66
65
  },
67
66
  // 600
68
67
  {
69
68
  label: 'Yellow',
70
- value: '#FFBE33FF'
69
+ value: "var(--ds-chart-yellow-bold, #FFBE33)"
71
70
  },
72
71
  // 600
73
72
  {
74
73
  label: 'Red',
75
- value: '#FC552CFF'
74
+ value: "var(--ds-chart-red-bold, #FC552C)"
76
75
  },
77
76
  // 600
78
77
  {
79
78
  label: 'Purple',
80
- value: '#8B77EEFF'
79
+ value: "var(--ds-chart-purple-bold, #8B77EE)"
81
80
  },
82
81
  // 600
83
82
 
84
83
  {
85
84
  label: 'Dark Blue',
86
- value: '#0055CCFF'
85
+ value: "var(--ds-chart-blue-bolder, #0055CC)"
87
86
  },
88
87
  // 800
89
88
  {
90
89
  label: 'Dark Green',
91
- value: '#177D52FF'
90
+ value: "var(--ds-chart-green-bolder, #177D52)"
92
91
  },
93
92
  // 800
94
93
  {
95
94
  label: 'Dark Yellow',
96
- value: '#FF9D00FF'
95
+ value: "var(--ds-chart-yellow-bolder, #FF9D00)"
97
96
  },
98
97
  // 800
99
98
  {
100
99
  label: 'Dark Red',
101
- value: '#D32D03FF'
100
+ value: "var(--ds-chart-red-bolder, #D32D03)"
102
101
  },
103
102
  // 800
104
103
  {
105
104
  label: 'Dark Purple',
106
- value: '#5A43D0FF'
105
+ value: "var(--ds-chart-purple-bolder, #5A43D0)"
107
106
  },
108
107
  // 800
109
108
 
110
109
  {
111
110
  label: 'Darker Blue',
112
- value: '#003884FF'
111
+ value: "var(--ds-chart-blue-boldest, #003884)"
113
112
  },
114
113
  // 1000
115
114
  {
116
115
  label: 'Darker Green',
117
- value: '#055C3FFF'
116
+ value: "var(--ds-chart-green-boldest, #055C3F)"
118
117
  },
119
118
  // 1000
120
119
  {
121
120
  label: 'Darker Yellow',
122
- value: '#946104FF'
121
+ value: "var(--ds-chart-yellow-boldest, #946104)"
123
122
  },
124
123
  // 1000
125
124
  {
126
125
  label: 'Darker Red',
127
- value: '#A32000FF'
126
+ value: "var(--ds-chart-red-boldest, #A32000)"
128
127
  },
129
128
  // 1000
130
129
  {
131
130
  label: 'Darker Purple',
132
- value: '#44368BFF'
131
+ value: "var(--ds-chart-purple-boldest, #44368B)"
133
132
  } // 1000
134
133
  ].map(function (color) {
135
134
  return _objectSpread(_objectSpread({}, color), {}, {
@@ -144,185 +143,185 @@ var colorPalette = [{
144
143
  exports.colorPalette = colorPalette;
145
144
  var extendedColorPalette = [{
146
145
  label: 'Darker Blue',
147
- value: '#003884'
146
+ value: "var(--ds-chart-blue-boldest, #003884)"
148
147
  },
149
148
  // 1000
150
149
  {
151
150
  label: 'Darker Teal',
152
- value: '#206B74'
151
+ value: "var(--ds-chart-teal-boldest, #206B74)"
153
152
  },
154
153
  // 1000
155
154
  {
156
155
  label: 'Darker Green',
157
- value: '#055C3F'
156
+ value: "var(--ds-chart-green-boldest, #055C3F)"
158
157
  },
159
158
  // 1000
160
159
  {
161
160
  label: 'Darker Yellow',
162
- value: '#946104'
161
+ value: "var(--ds-chart-yellow-boldest, #946104)"
163
162
  },
164
163
  // 1000
165
164
  {
166
165
  label: 'Darker Orange',
167
- value: '#974F0C'
166
+ value: "var(--ds-chart-orange-boldest, #974F0C)"
168
167
  },
169
168
  // 1000
170
169
  {
171
170
  label: 'Darker Red',
172
- value: '#A32000'
171
+ value: "var(--ds-chart-red-boldest, #A32000)"
173
172
  },
174
173
  // 1000
175
174
  {
176
175
  label: 'Darker Magenta',
177
- value: '#943D73'
176
+ value: "var(--ds-chart-magenta-boldest, #943D73)"
178
177
  },
179
178
  // 1000
180
179
  {
181
180
  label: 'Darker Purple',
182
- value: '#44368B'
181
+ value: "var(--ds-chart-purple-boldest, #44368B)"
183
182
  },
184
183
  // 1000
185
184
  {
186
185
  label: 'Darker Gray',
187
- value: '#44546F'
186
+ value: "var(--ds-chart-gray-boldest, #44546F)"
188
187
  },
189
188
  // 1000
190
189
 
191
190
  {
192
191
  label: 'Dark Blue',
193
- value: '#0055CC'
192
+ value: "var(--ds-chart-blue-bolder, #0055CC)"
194
193
  },
195
194
  // 800
196
195
  {
197
196
  label: 'Dark Teal',
198
- value: '#1D7F8C'
197
+ value: "var(--ds-chart-teal-bolder, #1D7F8C)"
199
198
  },
200
199
  // 800
201
200
  {
202
201
  label: 'Dark Green',
203
- value: '#177D52'
202
+ value: "var(--ds-chart-green-bolder, #177D52)"
204
203
  },
205
204
  // 800
206
205
  {
207
206
  label: 'Dark Yellow',
208
- value: '#FF9D00'
207
+ value: "var(--ds-chart-yellow-bolder, #FF9D00)"
209
208
  },
210
209
  // 800
211
210
  {
212
211
  label: 'Dark Orange',
213
- value: '#B65C02'
212
+ value: "var(--ds-chart-orange-bolder, #B65C02)"
214
213
  },
215
214
  // 800
216
215
  {
217
216
  label: 'Dark Red',
218
- value: '#D32D03'
217
+ value: "var(--ds-chart-red-bolder, #D32D03)"
219
218
  },
220
219
  // 800
221
220
  {
222
221
  label: 'Dark Magenta',
223
- value: '#CD519D'
222
+ value: "var(--ds-chart-magenta-bolder, #CD519D)"
224
223
  },
225
224
  // 800
226
225
  {
227
226
  label: 'Dark Purple',
228
- value: '#5A43D0'
227
+ value: "var(--ds-chart-purple-bolder, #5A43D0)"
229
228
  },
230
229
  // 800
231
230
  {
232
231
  label: 'Dark Gray',
233
- value: '#758195'
232
+ value: "var(--ds-chart-gray-bolder, #758195)"
234
233
  },
235
234
  // 800
236
235
 
237
236
  {
238
237
  label: 'Blue',
239
- value: '#247FFF'
238
+ value: "var(--ds-chart-blue-bold, #247FFF)"
240
239
  },
241
240
  // 600
242
241
  {
243
242
  label: 'Teal',
244
- value: '#1D9AAA'
243
+ value: "var(--ds-chart-teal-bold, #1D9AAA)"
245
244
  },
246
245
  // 600
247
246
  {
248
247
  label: 'Green',
249
- value: '#23A971'
248
+ value: "var(--ds-chart-green-bold, #23A971)"
250
249
  },
251
250
  // 600
252
251
  {
253
252
  label: 'Yellow',
254
- value: '#FFBE33'
253
+ value: "var(--ds-chart-yellow-bold, #FFBE33)"
255
254
  },
256
255
  // 600
257
256
  {
258
257
  label: 'Orange',
259
- value: '#D97008'
258
+ value: "var(--ds-chart-orange-bold, #D97008)"
260
259
  },
261
260
  // 600
262
261
  {
263
262
  label: 'Red',
264
- value: '#FC552C'
263
+ value: "var(--ds-chart-red-bold, #FC552C)"
265
264
  },
266
265
  // 600
267
266
  {
268
267
  label: 'Magenta',
269
- value: '#DA62AC'
268
+ value: "var(--ds-chart-magenta-bold, #DA62AC)"
270
269
  },
271
270
  // 600
272
271
  {
273
272
  label: 'Purple',
274
- value: '#8B77EE'
273
+ value: "var(--ds-chart-purple-bold, #8B77EE)"
275
274
  },
276
275
  // 600
277
276
  {
278
277
  label: 'Gray',
279
- value: '#8590A2'
278
+ value: "var(--ds-chart-gray-bold, #8590A2)"
280
279
  },
281
280
  // 600
282
281
 
283
282
  {
284
283
  label: 'Light Blue',
285
- value: '#7AB2FF'
284
+ value: "var(--ds-background-accent-blue-subtle, #7AB2FF)"
286
285
  },
287
286
  // 400
288
287
  {
289
288
  label: 'Light Teal',
290
- value: '#60C6D2'
289
+ value: "var(--ds-background-accent-teal-subtle, #60C6D2)"
291
290
  },
292
291
  // 400
293
292
  {
294
293
  label: 'Light Green',
295
- value: '#6BE1B0'
294
+ value: "var(--ds-background-accent-green-subtle, #6BE1B0)"
296
295
  },
297
296
  // 400
298
297
  {
299
298
  label: 'Light Yellow',
300
- value: '#FFDB57'
299
+ value: "var(--ds-background-accent-yellow-subtle, #FFDB57)"
301
300
  },
302
301
  // 400
303
302
  {
304
303
  label: 'Light Orange',
305
- value: '#FAA53D'
304
+ value: "var(--ds-background-accent-orange-subtle, #FAA53D)"
306
305
  },
307
306
  // 400
308
307
  {
309
308
  label: 'Light Red',
310
- value: '#FF8F73'
309
+ value: "var(--ds-background-accent-red-subtle, #FF8F73)"
311
310
  },
312
311
  // 400
313
312
  {
314
313
  label: 'Light Magenta',
315
- value: '#E774BB'
314
+ value: "var(--ds-background-accent-magenta-subtle, #E774BB)"
316
315
  },
317
316
  // 400
318
317
  {
319
318
  label: 'Light Purple',
320
- value: '#B5A7FB'
319
+ value: "var(--ds-background-accent-purple-subtle, #B5A7FB)"
321
320
  },
322
321
  // 400
323
322
  {
324
323
  label: 'Light Gray',
325
- value: '#8993A5'
324
+ value: "var(--ds-background-accent-gray-subtle, #8993A5)"
326
325
  } // 400
327
326
  ].map(function (color) {
328
327
  return _objectSpread(_objectSpread({}, color), {}, {
@@ -355,16 +354,10 @@ var ColorPicker = function ColorPicker(props) {
355
354
  useSomewhatSemanticTextColorNames = _ref.useSomewhatSemanticTextColorNames,
356
355
  expandedChartColors = _ref.expandedChartColors;
357
356
  return expandedChartColors ? (0, _react.jsx)(_ColorPickerButton.default, {
358
- title: title
359
- // Original color palette had hex code with alpha channel.
360
- // However, alpha channel was always FF, and it was not used
361
- // Expanded color palette does not have alpha channel, so
362
- // removing last two characters from hex code with alpha here.
363
- ,
364
- currentColor: currentColor.substring(0, 7),
357
+ title: title,
358
+ currentColor: currentColor,
365
359
  onChange: onColorChange,
366
360
  colorPalette: extendedColorPalette,
367
- hexToPaletteColor: _editorPalette.hexToEditorTableChartsPaletteColor,
368
361
  paletteColorTooltipMessages: _ColorPalette.chartsColorPaletteTooltipMessages
369
362
  // We did not want to create new FF or update
370
363
  // useSomewhatSemanticTextColorNames name
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = "@atlaskit/editor-core";
8
8
  exports.name = name;
9
- var version = "187.31.1";
9
+ var version = "187.31.3";
10
10
  exports.version = version;
11
11
  var nextMajorVersion = function nextMajorVersion() {
12
12
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
@@ -27,13 +27,6 @@ const toolbarSizeToButtons = toolbarSize => {
27
27
  return 0;
28
28
  }
29
29
  };
30
- /**
31
- * Wrapper over insertBlockTypeWithAnalytics to autobind toolbar input method
32
- * @param name Block name
33
- */
34
- function handleInsertBlockType(editorAnalyticsApi) {
35
- return name => insertBlockTypesWithAnalytics(name, INPUT_METHOD.TOOLBAR, editorAnalyticsApi);
36
- }
37
30
  const insertBlockPlugin = (options = {}, api) => {
38
31
  var _api$dependencies, _api$dependencies$fea;
39
32
  const featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies = api.dependencies) === null || _api$dependencies === void 0 ? void 0 : (_api$dependencies$fea = _api$dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
@@ -58,6 +51,7 @@ const insertBlockPlugin = (options = {}, api) => {
58
51
  return /*#__PURE__*/React.createElement(WithPluginState, {
59
52
  plugins: {
60
53
  typeAheadState: typeAheadPluginKey,
54
+ // needed to check isTypeAheadAllowed in ToolbarInsertBlock
61
55
  blockTypeState: blockTypeStateKey,
62
56
  mediaState: mediaStateKey,
63
57
  macroState: macroStateKey,
@@ -124,7 +118,7 @@ function ToolbarInsertBlockWithInjectionApi({
124
118
  layoutState,
125
119
  featureFlags
126
120
  }) {
127
- var _pluginInjectionApi$d, _pluginInjectionApi$d2;
121
+ var _pluginInjectionApi$d2, _pluginInjectionApi$d3;
128
122
  const buttons = toolbarSizeToButtons(toolbarSize);
129
123
  const {
130
124
  dateState,
@@ -133,6 +127,15 @@ function ToolbarInsertBlockWithInjectionApi({
133
127
  mentionState,
134
128
  emojiState
135
129
  } = useSharedPluginState(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji']);
130
+
131
+ /**
132
+ * Wrapper over insertBlockTypeWithAnalytics to autobind toolbar input method
133
+ * @param name Block name
134
+ */
135
+ const handleInsertBlockType = React.useCallback(name => {
136
+ var _pluginInjectionApi$d;
137
+ return insertBlockTypesWithAnalytics(name, INPUT_METHOD.TOOLBAR, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.analytics) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.actions);
138
+ }, [pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.dependencies.analytics) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.actions]);
136
139
  return /*#__PURE__*/React.createElement(ToolbarInsertBlock, {
137
140
  pluginInjectionApi: pluginInjectionApi,
138
141
  buttons: buttons,
@@ -154,7 +157,7 @@ function ToolbarInsertBlockWithInjectionApi({
154
157
  mediaSupported: !!mediaState,
155
158
  imageUploadSupported: !!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.dependencies.imageUpload),
156
159
  imageUploadEnabled: imageUploadState === null || imageUploadState === void 0 ? void 0 : imageUploadState.enabled,
157
- handleImageUpload: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.imageUpload) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.actions.startUpload,
160
+ handleImageUpload: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d3 = pluginInjectionApi.dependencies.imageUpload) === null || _pluginInjectionApi$d3 === void 0 ? void 0 : _pluginInjectionApi$d3.actions.startUpload,
158
161
  availableWrapperBlockTypes: blockTypeState && blockTypeState.availableWrapperBlockTypes,
159
162
  linkSupported: !!hyperlinkState,
160
163
  linkDisabled: !hyperlinkState || !hyperlinkState.canInsertLink || !!hyperlinkState.activeLinkMark,
@@ -162,7 +165,7 @@ function ToolbarInsertBlockWithInjectionApi({
162
165
  emojiProvider: providers.emojiProvider,
163
166
  nativeStatusSupported: options.nativeStatusSupported,
164
167
  horizontalRuleEnabled: options.horizontalRuleEnabled,
165
- onInsertBlockType: handleInsertBlockType(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.dependencies.analytics) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.actions),
168
+ onInsertBlockType: handleInsertBlockType,
166
169
  onInsertMacroFromMacroBrowser: insertMacroFromMacroBrowser,
167
170
  macroProvider: macroState.macroProvider,
168
171
  popupsMountPoint: popupsMountPoint,
@@ -145,6 +145,11 @@ export const createReducer = ({
145
145
  const mappedDecorationSet = decorationSet.map(tr.mapping, tr.doc, {
146
146
  onRemove
147
147
  });
148
+
149
+ // return same pluginState if decorationSet did not change
150
+ if (mappedDecorationSet === currentPluginState.decorationSet) {
151
+ return currentPluginState;
152
+ }
148
153
  return {
149
154
  ...currentPluginState,
150
155
  decorationSet: mappedDecorationSet