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