@atlaskit/editor-common 72.7.3 → 72.9.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/.eslintrc.js +13 -0
- package/CHANGELOG.md +44 -0
- package/dist/cjs/card/index.js +20 -1
- package/dist/cjs/card/utils.js +54 -0
- package/dist/cjs/keymaps/index.js +5 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/MediaSingle/styled.js +4 -4
- package/dist/cjs/ui-color/ColorPalette/Palettes/index.js +6 -0
- package/dist/cjs/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +199 -1
- package/dist/cjs/ui-color/index.js +6 -0
- package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.js +10 -4
- package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +8 -4
- package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/index.js +19 -7
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/card/index.js +1 -1
- package/dist/es2019/card/utils.js +47 -0
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/keymaps/index.js +2 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/MediaSingle/styled.js +3 -0
- package/dist/es2019/ui-color/ColorPalette/Palettes/index.js +1 -1
- package/dist/es2019/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +198 -0
- package/dist/es2019/ui-color/index.js +1 -1
- package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.js +7 -5
- package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +6 -4
- package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/index.js +14 -4
- package/dist/es2019/version.json +1 -1
- package/dist/esm/card/index.js +1 -1
- package/dist/esm/card/utils.js +45 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/keymaps/index.js +2 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/MediaSingle/styled.js +4 -4
- package/dist/esm/ui-color/ColorPalette/Palettes/index.js +1 -1
- package/dist/esm/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +196 -0
- package/dist/esm/ui-color/index.js +1 -1
- package/dist/esm/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.js +10 -5
- package/dist/esm/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +8 -4
- package/dist/esm/ui-menu/ArrowKeyNavigationProvider/index.js +19 -7
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/types/smart-links.d.ts +1 -1
- package/dist/types/card/cardOptions.d.ts +2 -0
- package/dist/types/card/index.d.ts +1 -0
- package/dist/types/card/utils.d.ts +18 -0
- package/dist/types/keymaps/index.d.ts +2 -0
- package/dist/types/types/feature-flags.d.ts +7 -0
- package/dist/types/ui-color/ColorPalette/Palettes/index.d.ts +1 -1
- package/dist/types/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.d.ts +548 -0
- package/dist/types/ui-color/index.d.ts +1 -1
- package/dist/types/ui-menu/ArrowKeyNavigationProvider/types.d.ts +4 -1
- package/package.json +8 -8
|
@@ -4,6 +4,8 @@ import { css, jsx } from '@emotion/react';
|
|
|
4
4
|
import { N400 } from '@atlaskit/theme/colors';
|
|
5
5
|
import { browser } from '../utils';
|
|
6
6
|
export const addAltText = makeKeyMapWithCommon('Add Alt Text', 'Mod-Alt-y');
|
|
7
|
+
export const navToEditorToolbar = makeKeyMapWithCommon('Navigate to editor toolbar', 'Alt-F9');
|
|
8
|
+
export const navToFloatingToolbar = makeKeyMapWithCommon('Navigate to floating toolbar', 'Alt-F10');
|
|
7
9
|
export const toggleBold = makeKeyMapWithCommon('Bold', 'Mod-b');
|
|
8
10
|
export const toggleItalic = makeKeyMapWithCommon('Italic', 'Mod-i');
|
|
9
11
|
export const toggleUnderline = makeKeyMapWithCommon('Underline', 'Mod-u');
|
|
@@ -8,7 +8,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
8
8
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
9
9
|
import Layer from '../Layer';
|
|
10
10
|
const packageName = "@atlaskit/editor-common";
|
|
11
|
-
const packageVersion = "72.
|
|
11
|
+
const packageVersion = "72.9.0";
|
|
12
12
|
const halfFocusRing = 1;
|
|
13
13
|
const dropOffset = `0, ${gridSize()}px`;
|
|
14
14
|
class DropList extends Component {
|
|
@@ -109,6 +109,9 @@ export const MediaSingleDimensionHelper = ({
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
width: ${pctWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized)};
|
|
112
|
+
${layout === 'full-width' && css`
|
|
113
|
+
min-width: 100%;
|
|
114
|
+
`}
|
|
112
115
|
max-width: ${calcMaxWidth(layout, containerWidth)};
|
|
113
116
|
float: ${float(layout)};
|
|
114
117
|
margin: ${calcMargin(layout)};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { DEFAULT_BORDER_COLOR } from './common';
|
|
2
|
-
export {
|
|
2
|
+
export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages } from './paletteMessagesTokenModeNames';
|
|
@@ -250,6 +250,204 @@ export const backgroundPaletteTooltipMessages = {
|
|
|
250
250
|
light: lightBackgroundPaletteTooltipMessages,
|
|
251
251
|
dark: darkBackgroundPaletteTooltipMessages
|
|
252
252
|
};
|
|
253
|
+
export const lightChartsColorPaletteTooltipMessages = defineMessages({
|
|
254
|
+
// Blue color
|
|
255
|
+
'#7AB2FF': {
|
|
256
|
+
id: 'fabric.theme.subtle-blue',
|
|
257
|
+
defaultMessage: 'Subtle blue',
|
|
258
|
+
description: 'Name of a color'
|
|
259
|
+
},
|
|
260
|
+
'#247FFF': {
|
|
261
|
+
id: 'fabric.theme.blue',
|
|
262
|
+
defaultMessage: 'Blue',
|
|
263
|
+
description: 'Name of a color'
|
|
264
|
+
},
|
|
265
|
+
'#0055CC': {
|
|
266
|
+
id: 'fabric.theme.bold-blue',
|
|
267
|
+
defaultMessage: 'Bold blue',
|
|
268
|
+
description: 'Name of a color'
|
|
269
|
+
},
|
|
270
|
+
'#003884': {
|
|
271
|
+
id: 'fabric.theme.bolder-blue',
|
|
272
|
+
defaultMessage: 'Bolder blue',
|
|
273
|
+
description: 'Name of a color'
|
|
274
|
+
},
|
|
275
|
+
// Teal color
|
|
276
|
+
'#60C6D2': {
|
|
277
|
+
id: 'fabric.theme.subtle-teal',
|
|
278
|
+
defaultMessage: 'Subtle teal',
|
|
279
|
+
description: 'Name of a color'
|
|
280
|
+
},
|
|
281
|
+
'#1D9AAA': {
|
|
282
|
+
id: 'fabric.theme.teal',
|
|
283
|
+
defaultMessage: 'Teal',
|
|
284
|
+
description: 'Name of a color'
|
|
285
|
+
},
|
|
286
|
+
'#1D7F8C': {
|
|
287
|
+
id: 'fabric.theme.bold-teal',
|
|
288
|
+
defaultMessage: 'Bold teal',
|
|
289
|
+
description: 'Name of a color'
|
|
290
|
+
},
|
|
291
|
+
'#206B74': {
|
|
292
|
+
id: 'fabric.theme.bolder-teal',
|
|
293
|
+
defaultMessage: 'Bolder teal',
|
|
294
|
+
description: 'Name of a color'
|
|
295
|
+
},
|
|
296
|
+
// Green color
|
|
297
|
+
'#6BE1B0': {
|
|
298
|
+
id: 'fabric.theme.subtle-green',
|
|
299
|
+
defaultMessage: 'Subtle green',
|
|
300
|
+
description: 'Name of a color'
|
|
301
|
+
},
|
|
302
|
+
'#23A971': {
|
|
303
|
+
id: 'fabric.theme.green',
|
|
304
|
+
defaultMessage: 'Green',
|
|
305
|
+
description: 'Name of a color'
|
|
306
|
+
},
|
|
307
|
+
'#177D52': {
|
|
308
|
+
id: 'fabric.theme.bold-green',
|
|
309
|
+
defaultMessage: 'Bold green',
|
|
310
|
+
description: 'Name of a color'
|
|
311
|
+
},
|
|
312
|
+
'#055C3F': {
|
|
313
|
+
id: 'fabric.theme.bolder-green',
|
|
314
|
+
defaultMessage: 'Bolder green',
|
|
315
|
+
description: 'Name of a color'
|
|
316
|
+
},
|
|
317
|
+
// Yellow color
|
|
318
|
+
'#FFDB57': {
|
|
319
|
+
id: 'fabric.theme.subtle-yellow',
|
|
320
|
+
defaultMessage: 'Subtle yellow',
|
|
321
|
+
description: 'Name of a color'
|
|
322
|
+
},
|
|
323
|
+
'#FFBE33': {
|
|
324
|
+
id: 'fabric.theme.yellow',
|
|
325
|
+
defaultMessage: 'Yellow',
|
|
326
|
+
description: 'Name of a color'
|
|
327
|
+
},
|
|
328
|
+
'#FF9D00': {
|
|
329
|
+
id: 'fabric.theme.bold-yellow',
|
|
330
|
+
defaultMessage: 'Bold yellow',
|
|
331
|
+
description: 'Name of a color'
|
|
332
|
+
},
|
|
333
|
+
'#946104': {
|
|
334
|
+
id: 'fabric.theme.bolder-yellow',
|
|
335
|
+
defaultMessage: 'Bolder yellow',
|
|
336
|
+
description: 'Name of a color'
|
|
337
|
+
},
|
|
338
|
+
// Red color
|
|
339
|
+
'#FF8F73': {
|
|
340
|
+
id: 'fabric.theme.subtle-red',
|
|
341
|
+
defaultMessage: 'Subtle red',
|
|
342
|
+
description: 'Name of a color'
|
|
343
|
+
},
|
|
344
|
+
'#FC552C': {
|
|
345
|
+
id: 'fabric.theme.red',
|
|
346
|
+
defaultMessage: 'Red',
|
|
347
|
+
description: 'Name of a color.'
|
|
348
|
+
},
|
|
349
|
+
'#D32D03': {
|
|
350
|
+
id: 'fabric.theme.bold-red',
|
|
351
|
+
defaultMessage: 'Bold red',
|
|
352
|
+
description: 'Name of a color'
|
|
353
|
+
},
|
|
354
|
+
'#A32000': {
|
|
355
|
+
id: 'fabric.theme.bolder-red',
|
|
356
|
+
defaultMessage: 'Bolder red',
|
|
357
|
+
description: 'Name of a color'
|
|
358
|
+
},
|
|
359
|
+
// Orange color
|
|
360
|
+
'#FAA53D': {
|
|
361
|
+
id: 'fabric.theme.subtle-orange',
|
|
362
|
+
defaultMessage: 'Subtle orange',
|
|
363
|
+
description: 'Name of a color'
|
|
364
|
+
},
|
|
365
|
+
'#D97008': {
|
|
366
|
+
id: 'fabric.theme.orange',
|
|
367
|
+
defaultMessage: 'Orange',
|
|
368
|
+
description: 'Name of a color.'
|
|
369
|
+
},
|
|
370
|
+
'#B65C02': {
|
|
371
|
+
id: 'fabric.theme.bold-orange',
|
|
372
|
+
defaultMessage: 'Bold orange',
|
|
373
|
+
description: 'Name of a color'
|
|
374
|
+
},
|
|
375
|
+
'#974F0C': {
|
|
376
|
+
id: 'fabric.theme.bolder-orange',
|
|
377
|
+
defaultMessage: 'Bolder orange',
|
|
378
|
+
description: 'Name of a color'
|
|
379
|
+
},
|
|
380
|
+
// Magenta color
|
|
381
|
+
'#E774BB': {
|
|
382
|
+
id: 'fabric.theme.subtle-magenta',
|
|
383
|
+
defaultMessage: 'Subtle magenta',
|
|
384
|
+
description: 'Name of a color'
|
|
385
|
+
},
|
|
386
|
+
'#DA62AC': {
|
|
387
|
+
id: 'fabric.theme.magenta',
|
|
388
|
+
defaultMessage: 'Magenta',
|
|
389
|
+
description: 'Name of a color'
|
|
390
|
+
},
|
|
391
|
+
'#CD519D': {
|
|
392
|
+
id: 'fabric.theme.bold-magenta',
|
|
393
|
+
defaultMessage: 'Bold magenta',
|
|
394
|
+
description: 'Name of a color'
|
|
395
|
+
},
|
|
396
|
+
'#943D73': {
|
|
397
|
+
id: 'fabric.theme.bolder-magenta',
|
|
398
|
+
defaultMessage: 'Bolder magenta',
|
|
399
|
+
description: 'Name of a color'
|
|
400
|
+
},
|
|
401
|
+
// Purple color
|
|
402
|
+
'#B5A7FB': {
|
|
403
|
+
id: 'fabric.theme.subtle-purple',
|
|
404
|
+
defaultMessage: 'Subtle purple',
|
|
405
|
+
description: 'Name of a color'
|
|
406
|
+
},
|
|
407
|
+
'#8B77EE': {
|
|
408
|
+
id: 'fabric.theme.purple',
|
|
409
|
+
defaultMessage: 'Purple',
|
|
410
|
+
description: 'Name of a color'
|
|
411
|
+
},
|
|
412
|
+
'#5A43D0': {
|
|
413
|
+
id: 'fabric.theme.bold-purple',
|
|
414
|
+
defaultMessage: 'Bold purple',
|
|
415
|
+
description: 'Name of a color'
|
|
416
|
+
},
|
|
417
|
+
'#44368B': {
|
|
418
|
+
id: 'fabric.theme.bolder-purple',
|
|
419
|
+
defaultMessage: 'Bolder purple',
|
|
420
|
+
description: 'Name of a color'
|
|
421
|
+
},
|
|
422
|
+
// Gray color
|
|
423
|
+
'#8993A5': {
|
|
424
|
+
id: 'fabric.theme.subtle-gray',
|
|
425
|
+
defaultMessage: 'Subtle gray',
|
|
426
|
+
description: 'Name of a color'
|
|
427
|
+
},
|
|
428
|
+
'#8590A2': {
|
|
429
|
+
id: 'fabric.theme.gray',
|
|
430
|
+
defaultMessage: 'Gray',
|
|
431
|
+
description: 'Name of a color'
|
|
432
|
+
},
|
|
433
|
+
'#758195': {
|
|
434
|
+
id: 'fabric.theme.bold-gray',
|
|
435
|
+
defaultMessage: 'Bold gray',
|
|
436
|
+
description: 'Name of a color'
|
|
437
|
+
},
|
|
438
|
+
'#44546F': {
|
|
439
|
+
id: 'fabric.theme.bolder-gray',
|
|
440
|
+
defaultMessage: 'Bolder gray',
|
|
441
|
+
description: 'Name of a color'
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
const darkChartsColorPaletteTooltipMessages = {
|
|
445
|
+
...lightChartsColorPaletteTooltipMessages
|
|
446
|
+
};
|
|
447
|
+
export const chartsColorPaletteTooltipMessages = {
|
|
448
|
+
light: lightChartsColorPaletteTooltipMessages,
|
|
449
|
+
dark: darkChartsColorPaletteTooltipMessages
|
|
450
|
+
};
|
|
253
451
|
const lightBorderPaletteTooltipMessages = defineMessages({
|
|
254
452
|
'#091E4224': {
|
|
255
453
|
id: 'fabric.theme.subtle-gray',
|
|
@@ -6,6 +6,6 @@ export { default as colorPaletteMessages } from './ColorPalette/Palettes/palette
|
|
|
6
6
|
export { panelBackgroundPalette, panelDarkModeBackgroundPalette } from './ColorPalette/Palettes/panelBackgroundPalette';
|
|
7
7
|
export { lightModeStatusColorPalette, darkModeStatusColorPalette } from './ColorPalette/Palettes/statusColorPalette';
|
|
8
8
|
export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
|
|
9
|
-
export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, textPaletteTooltipMessages } from './ColorPalette/Palettes';
|
|
9
|
+
export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages } from './ColorPalette/Palettes';
|
|
10
10
|
export { DEFAULT_BORDER_COLOR } from './ColorPalette/Palettes/common';
|
|
11
11
|
export { default as borderColorPalette } from './ColorPalette/Palettes/borderColorPalette';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useLayoutEffect, useRef } from 'react';
|
|
1
|
+
import React, { useLayoutEffect, useRef, useState } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* This component is a wrapper for color picker which listens to keydown events of children
|
|
4
4
|
* and handles arrow key navigation
|
|
@@ -10,11 +10,13 @@ export const ColorPaletteArrowKeyNavigationProvider = ({
|
|
|
10
10
|
isOpenedByKeyboard,
|
|
11
11
|
isPopupPositioned,
|
|
12
12
|
handleClose,
|
|
13
|
-
closeOnTab
|
|
13
|
+
closeOnTab,
|
|
14
|
+
editorRef
|
|
14
15
|
}) => {
|
|
15
16
|
const wrapperRef = useRef(null);
|
|
16
17
|
const currentSelectedColumnIndex = useRef(selectedColumnIndex === -1 ? 0 : selectedColumnIndex);
|
|
17
18
|
const currentSelectedRowIndex = useRef(selectedRowIndex === -1 ? 0 : selectedRowIndex);
|
|
19
|
+
const [listenerTargetElement] = useState(editorRef.current);
|
|
18
20
|
const incrementRowIndex = (rowElements, columnElements) => {
|
|
19
21
|
if (currentSelectedRowIndex.current === rowElements.length - 1) {
|
|
20
22
|
currentSelectedRowIndex.current = 0;
|
|
@@ -97,7 +99,7 @@ export const ColorPaletteArrowKeyNavigationProvider = ({
|
|
|
97
99
|
return;
|
|
98
100
|
}
|
|
99
101
|
};
|
|
100
|
-
|
|
102
|
+
listenerTargetElement && listenerTargetElement.addEventListener('keydown', handleKeyDown);
|
|
101
103
|
// set focus to current selected color swatch if only opened by keyboard
|
|
102
104
|
if (isOpenedByKeyboard && isPopupPositioned) {
|
|
103
105
|
// Using timeout because, we need to wait till color palette is rendered
|
|
@@ -108,9 +110,9 @@ export const ColorPaletteArrowKeyNavigationProvider = ({
|
|
|
108
110
|
});
|
|
109
111
|
}
|
|
110
112
|
return () => {
|
|
111
|
-
|
|
113
|
+
listenerTargetElement && listenerTargetElement.removeEventListener('keydown', handleKeyDown);
|
|
112
114
|
};
|
|
113
|
-
}, [currentSelectedColumnIndex, isOpenedByKeyboard, isPopupPositioned, wrapperRef, handleClose, closeOnTab]);
|
|
115
|
+
}, [currentSelectedColumnIndex, isOpenedByKeyboard, isPopupPositioned, wrapperRef, handleClose, closeOnTab, listenerTargetElement]);
|
|
114
116
|
return /*#__PURE__*/React.createElement("div", {
|
|
115
117
|
className: "custom-key-handler-wrapper",
|
|
116
118
|
ref: wrapperRef
|
package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js
CHANGED
|
@@ -9,10 +9,12 @@ export const MenuArrowKeyNavigationProvider = ({
|
|
|
9
9
|
disableArrowKeyNavigation,
|
|
10
10
|
keyDownHandlerContext,
|
|
11
11
|
closeOnTab,
|
|
12
|
-
onSelection
|
|
12
|
+
onSelection,
|
|
13
|
+
editorRef
|
|
13
14
|
}) => {
|
|
14
15
|
const wrapperRef = useRef(null);
|
|
15
16
|
const [currentSelectedItemIndex, setCurrentSelectedItemIndex] = useState(-1);
|
|
17
|
+
const [listenerTargetElement] = useState(editorRef.current);
|
|
16
18
|
const incrementIndex = useCallback(list => {
|
|
17
19
|
const currentIndex = currentSelectedItemIndex;
|
|
18
20
|
let nextIndex = (currentIndex + 1) % list.length;
|
|
@@ -128,11 +130,11 @@ export const MenuArrowKeyNavigationProvider = ({
|
|
|
128
130
|
return;
|
|
129
131
|
}
|
|
130
132
|
};
|
|
131
|
-
|
|
133
|
+
listenerTargetElement && listenerTargetElement.addEventListener('keydown', handleKeyDown);
|
|
132
134
|
return () => {
|
|
133
|
-
|
|
135
|
+
listenerTargetElement && listenerTargetElement.removeEventListener('keydown', handleKeyDown);
|
|
134
136
|
};
|
|
135
|
-
}, [currentSelectedItemIndex, wrapperRef, handleClose, disableArrowKeyNavigation, keyDownHandlerContext, closeOnTab, onSelection, incrementIndex, decrementIndex]);
|
|
137
|
+
}, [currentSelectedItemIndex, wrapperRef, handleClose, disableArrowKeyNavigation, keyDownHandlerContext, closeOnTab, onSelection, incrementIndex, decrementIndex, listenerTargetElement]);
|
|
136
138
|
return /*#__PURE__*/React.createElement("div", {
|
|
137
139
|
className: "menu-key-handler-wrapper custom-key-handler-wrapper",
|
|
138
140
|
ref: wrapperRef
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { ReactEditorViewContext } from '../../ui-react';
|
|
3
4
|
import { ColorPaletteArrowKeyNavigationProvider } from './ColorPaletteArrowKeyNavigationProvider';
|
|
4
5
|
import { MenuArrowKeyNavigationProvider } from './MenuArrowKeyNavigationProvider';
|
|
5
6
|
import { ArrowKeyNavigationType } from './types';
|
|
@@ -10,12 +11,21 @@ export const ArrowKeyNavigationProvider = props => {
|
|
|
10
11
|
...restProps
|
|
11
12
|
} = props;
|
|
12
13
|
if (type === ArrowKeyNavigationType.COLOR) {
|
|
13
|
-
return /*#__PURE__*/React.createElement(
|
|
14
|
+
return /*#__PURE__*/React.createElement(ReactEditorViewContext.Consumer, null, ({
|
|
15
|
+
editorView,
|
|
16
|
+
editorRef
|
|
17
|
+
}) => editorRef && /*#__PURE__*/React.createElement(ColorPaletteArrowKeyNavigationProvider, _extends({
|
|
14
18
|
selectedRowIndex: props.selectedRowIndex,
|
|
15
19
|
selectedColumnIndex: props.selectedColumnIndex,
|
|
16
20
|
isOpenedByKeyboard: props.isOpenedByKeyboard,
|
|
17
|
-
isPopupPositioned: props.isPopupPositioned
|
|
18
|
-
|
|
21
|
+
isPopupPositioned: props.isPopupPositioned,
|
|
22
|
+
editorRef: editorRef
|
|
23
|
+
}, restProps), children));
|
|
19
24
|
}
|
|
20
|
-
return /*#__PURE__*/React.createElement(
|
|
25
|
+
return /*#__PURE__*/React.createElement(ReactEditorViewContext.Consumer, null, ({
|
|
26
|
+
editorView,
|
|
27
|
+
editorRef
|
|
28
|
+
}) => editorRef && /*#__PURE__*/React.createElement(MenuArrowKeyNavigationProvider, _extends({
|
|
29
|
+
editorRef: editorRef
|
|
30
|
+
}, restProps), children));
|
|
21
31
|
};
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/card/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { addLinkMetadata, getLinkMetadataFromTransaction, commandWithMetadata } from './utils';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
import { LinkMetaStep } from '@atlaskit/adf-schema/steps';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Records metadata about the user action and input method relating to a transaction
|
|
8
|
+
* as a custom LinkStepMetadata prosemirror step so that it is preserved in
|
|
9
|
+
* the history for undo/redo
|
|
10
|
+
*/
|
|
11
|
+
export function addLinkMetadata(initialSelection, tr, metadata) {
|
|
12
|
+
var storedMarks = tr.storedMarks;
|
|
13
|
+
var pos = tr.mapping.map(initialSelection.$from.pos);
|
|
14
|
+
tr.step(new LinkMetaStep(pos, metadata));
|
|
15
|
+
|
|
16
|
+
// When you add a new step all the storedMarks are removed it
|
|
17
|
+
if (storedMarks) {
|
|
18
|
+
tr.setStoredMarks(storedMarks);
|
|
19
|
+
}
|
|
20
|
+
return tr;
|
|
21
|
+
}
|
|
22
|
+
export function getLinkMetadataFromTransaction(tr) {
|
|
23
|
+
return tr.steps.reduce(function (metadata, step) {
|
|
24
|
+
if (!(step instanceof LinkMetaStep)) {
|
|
25
|
+
return metadata;
|
|
26
|
+
}
|
|
27
|
+
return _objectSpread(_objectSpread({}, metadata), step.getMetadata());
|
|
28
|
+
}, {});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Adds metadata to the transaction created from a command
|
|
32
|
+
* The metadata describes the user intent and input method
|
|
33
|
+
* for executing the command
|
|
34
|
+
*/
|
|
35
|
+
export var commandWithMetadata = function commandWithMetadata(command, metadata) {
|
|
36
|
+
return function (state, dispatch, view) {
|
|
37
|
+
if (!dispatch) {
|
|
38
|
+
return command(state, dispatch, view);
|
|
39
|
+
}
|
|
40
|
+
return command(state, function (tr) {
|
|
41
|
+
addLinkMetadata(state.selection, tr, metadata);
|
|
42
|
+
dispatch(tr);
|
|
43
|
+
}, view);
|
|
44
|
+
};
|
|
45
|
+
};
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// DO NOT EMPORT ANYTHING FROM THIS FILE. USE CHILD ENTRY POINTS
|
|
1
|
+
// DO NOT EMPORT ANYTHING FROM THIS FILE. USE CHILD ENTRY POINTS.
|
|
2
2
|
export {};
|
|
@@ -7,6 +7,8 @@ import { css, jsx } from '@emotion/react';
|
|
|
7
7
|
import { N400 } from '@atlaskit/theme/colors';
|
|
8
8
|
import { browser } from '../utils';
|
|
9
9
|
export var addAltText = makeKeyMapWithCommon('Add Alt Text', 'Mod-Alt-y');
|
|
10
|
+
export var navToEditorToolbar = makeKeyMapWithCommon('Navigate to editor toolbar', 'Alt-F9');
|
|
11
|
+
export var navToFloatingToolbar = makeKeyMapWithCommon('Navigate to floating toolbar', 'Alt-F10');
|
|
10
12
|
export var toggleBold = makeKeyMapWithCommon('Bold', 'Mod-b');
|
|
11
13
|
export var toggleItalic = makeKeyMapWithCommon('Italic', 'Mod-i');
|
|
12
14
|
export var toggleUnderline = makeKeyMapWithCommon('Underline', 'Mod-u');
|
|
@@ -18,7 +18,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
18
18
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
19
19
|
import Layer from '../Layer';
|
|
20
20
|
var packageName = "@atlaskit/editor-common";
|
|
21
|
-
var packageVersion = "72.
|
|
21
|
+
var packageVersion = "72.9.0";
|
|
22
22
|
var halfFocusRing = 1;
|
|
23
23
|
var dropOffset = "0, ".concat(gridSize(), "px");
|
|
24
24
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
var _excluded = ["children"];
|
|
4
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
4
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
5
5
|
/** @jsx jsx */
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
@@ -109,16 +109,16 @@ export var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref
|
|
|
109
109
|
layout = _ref.layout,
|
|
110
110
|
pctWidth = _ref.pctWidth,
|
|
111
111
|
width = _ref.width;
|
|
112
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* For nested rich media items, set max-width to 100% */\n tr &,\n [data-layout-column] &,\n [data-node-type='expand'] & {\n max-width: 100%;\n }\n\n width: ", ";\n max-width: ", ";\n float: ", ";\n margin: ", ";\n ", ";\n\n &:not(.is-resizing) {\n transition: width 100ms ease-in;\n }\n"])), pctWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized), calcMaxWidth(layout, containerWidth), float(layout), calcMargin(layout), isImageAligned(layout));
|
|
112
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* For nested rich media items, set max-width to 100% */\n tr &,\n [data-layout-column] &,\n [data-node-type='expand'] & {\n max-width: 100%;\n }\n\n width: ", ";\n ", "\n max-width: ", ";\n float: ", ";\n margin: ", ";\n ", ";\n\n &:not(.is-resizing) {\n transition: width 100ms ease-in;\n }\n"])), pctWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized), layout === 'full-width' && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n min-width: 100%;\n "]))), calcMaxWidth(layout, containerWidth), float(layout), calcMargin(layout), isImageAligned(layout));
|
|
113
113
|
};
|
|
114
114
|
var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
|
|
115
115
|
var hasFallbackContainer = _ref2.hasFallbackContainer,
|
|
116
116
|
paddingBottom = _ref2.paddingBottom,
|
|
117
117
|
height = _ref2.height;
|
|
118
|
-
return css(
|
|
118
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n"])), hasFallbackContainer ? "\n &::after {\n content: '';\n display: block;\n ".concat(height ? "height: ".concat(height, "px;") : paddingBottom ? "padding-bottom: ".concat(paddingBottom, ";") : '', "\n\n /* Fixes extra padding problem in Firefox */\n font-size: 0;\n line-height: 0;\n }\n ") : '');
|
|
119
119
|
};
|
|
120
120
|
export var mediaWrapperStyle = function mediaWrapperStyle(props) {
|
|
121
|
-
return css(
|
|
121
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n\n ", "\n\n /* Editor */\n & > figure {\n position: ", ";\n height: 100%;\n width: 100%;\n }\n\n & > div {\n position: ", ";\n height: 100%;\n width: 100%;\n }\n\n &[data-node-type='embedCard'] > div {\n width: 100%;\n }\n\n /* Renderer */\n [data-node-type='media'] {\n position: static !important;\n\n > div {\n position: absolute;\n height: 100%;\n }\n }\n"])), RenderFallbackContainer(props), props.hasFallbackContainer ? 'absolute' : 'relative', props.hasFallbackContainer ? 'absolute' : 'relative');
|
|
122
122
|
};
|
|
123
123
|
export var MediaWrapper = function MediaWrapper(_ref3) {
|
|
124
124
|
var children = _ref3.children,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { DEFAULT_BORDER_COLOR } from './common';
|
|
2
|
-
export {
|
|
2
|
+
export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages } from './paletteMessagesTokenModeNames';
|