@atlaskit/editor-plugin-help-dialog 1.2.4 → 1.2.6
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 +10 -10
- package/CHANGELOG.md +90 -68
- package/LICENSE.md +6 -8
- package/dist/cjs/ui/ModalContent.js +17 -9
- package/dist/cjs/ui/ModalFooter.js +10 -7
- package/dist/cjs/ui/ModalHeader.js +21 -15
- package/dist/cjs/ui/formatting.js +158 -79
- package/dist/cjs/ui/styles.js +42 -1
- package/dist/cjs/ui/utils.js +53 -34
- package/dist/es2019/ui/ModalContent.js +9 -3
- package/dist/es2019/ui/ModalFooter.js +3 -1
- package/dist/es2019/ui/ModalHeader.js +22 -16
- package/dist/es2019/ui/formatting.js +81 -15
- package/dist/es2019/ui/styles.js +42 -1
- package/dist/es2019/ui/utils.js +53 -34
- package/dist/esm/ui/ModalContent.js +17 -9
- package/dist/esm/ui/ModalFooter.js +10 -7
- package/dist/esm/ui/ModalHeader.js +22 -16
- package/dist/esm/ui/formatting.js +159 -80
- package/dist/esm/ui/styles.js +42 -1
- package/dist/esm/ui/utils.js +53 -34
- package/dist/types/types.d.ts +1 -4
- package/dist/types/ui/styles.d.ts +1 -0
- package/dist/types-ts4.5/ui/styles.d.ts +1 -0
- package/package.json +8 -7
- package/report.api.md +14 -19
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
|
-
import { addInlineComment, addLink, alignCenter, alignLeft, alignRight, clearFormatting, decreaseMediaSize, focusTableResizer, increaseMediaSize, insertRule, navToEditorToolbar, navToFloatingToolbar, pastePlainText, redo, setNormalText, toggleBlockQuote, toggleBold, toggleBulletList, toggleCode, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleItalic, toggleOrderedList, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleTaskItemCheckbox, toggleUnderline, undo } from '@atlaskit/editor-common/keymaps';
|
|
4
|
+
import { addInlineComment, addLink, alignCenter, alignLeft, alignRight, clearFormatting, decreaseMediaSize, focusTableResizer, increaseMediaSize, insertRule, navToEditorToolbar, navToFloatingToolbar, pastePlainText, redo, setNormalText, toggleBlockQuote, toggleBold, toggleBulletList, toggleCode, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleHighlightPalette, toggleItalic, toggleOrderedList, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleTaskItemCheckbox, toggleUnderline, undo } from '@atlaskit/editor-common/keymaps';
|
|
5
5
|
import { alignmentMessages, annotationMessages, blockTypeMessages, listMessages, helpDialogMessages as messages, toolbarInsertBlockMessages, toolbarMessages, undoRedoMessages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
@@ -234,7 +234,9 @@ const otherFormatting = ({
|
|
|
234
234
|
}, {
|
|
235
235
|
name: formatMessage(messages.selectTableRow),
|
|
236
236
|
type: 'table',
|
|
237
|
-
autoFormatting: () =>
|
|
237
|
+
autoFormatting: () =>
|
|
238
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
239
|
+
jsx("span", {
|
|
238
240
|
css: shortcutsArray
|
|
239
241
|
}, jsx("span", null, jsx("span", {
|
|
240
242
|
css: browser.mac ? codeSm : codeMd
|
|
@@ -256,7 +258,9 @@ const otherFormatting = ({
|
|
|
256
258
|
}, {
|
|
257
259
|
name: formatMessage(messages.selectTableColumn),
|
|
258
260
|
type: 'table',
|
|
259
|
-
autoFormatting: () =>
|
|
261
|
+
autoFormatting: () =>
|
|
262
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
263
|
+
jsx("span", {
|
|
260
264
|
css: shortcutsArray
|
|
261
265
|
}, jsx("span", null, jsx("span", {
|
|
262
266
|
css: browser.mac ? codeSm : codeMd
|
|
@@ -275,36 +279,92 @@ const otherFormatting = ({
|
|
|
275
279
|
}, "Shift"), ' + ', jsx("span", {
|
|
276
280
|
css: codeSm
|
|
277
281
|
}, "\u2193")))
|
|
278
|
-
}, ...(getBooleanFF('platform.editor.a11y-
|
|
279
|
-
name: formatMessage(messages.
|
|
282
|
+
}, ...(getBooleanFF('platform.editor.a11y-help-dialog-shortcut-keys-position_aghfg') ? [{
|
|
283
|
+
name: formatMessage(messages.InsertTableColumn),
|
|
280
284
|
type: 'table',
|
|
281
|
-
autoFormatting: () =>
|
|
285
|
+
autoFormatting: () =>
|
|
286
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
287
|
+
jsx("span", {
|
|
282
288
|
css: shortcutsArray
|
|
283
289
|
}, jsx("span", null, jsx("span", {
|
|
284
290
|
css: browser.mac ? codeSm : codeMd
|
|
285
291
|
}, browser.mac ? '⌘' : 'Ctrl'), ' + ', jsx("span", {
|
|
286
292
|
css: codeMd
|
|
287
293
|
}, browser.mac ? 'Opt' : 'Alt'), ' + ', jsx("span", {
|
|
294
|
+
css: codeSm
|
|
295
|
+
}, "=")), jsx("span", null, jsx("span", {
|
|
296
|
+
css: browser.mac ? codeSm : codeMd
|
|
297
|
+
}, browser.mac ? '⌘' : 'Ctrl'), ' + ', jsx("span", {
|
|
288
298
|
css: codeMd
|
|
289
|
-
},
|
|
299
|
+
}, browser.mac ? 'Opt' : 'Alt'), ' + ', jsx("span", {
|
|
290
300
|
css: codeSm
|
|
291
|
-
}, "
|
|
301
|
+
}, "-")))
|
|
292
302
|
}, {
|
|
293
|
-
name: formatMessage(messages.
|
|
303
|
+
name: formatMessage(messages.InsertTableRow),
|
|
294
304
|
type: 'table',
|
|
295
|
-
autoFormatting: () =>
|
|
305
|
+
autoFormatting: () =>
|
|
306
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
307
|
+
jsx("span", {
|
|
296
308
|
css: shortcutsArray
|
|
297
309
|
}, jsx("span", null, jsx("span", {
|
|
298
310
|
css: browser.mac ? codeSm : codeMd
|
|
299
311
|
}, browser.mac ? '⌘' : 'Ctrl'), ' + ', jsx("span", {
|
|
300
312
|
css: codeMd
|
|
301
313
|
}, browser.mac ? 'Opt' : 'Alt'), ' + ', jsx("span", {
|
|
314
|
+
css: codeSm
|
|
315
|
+
}, "]")), jsx("span", null, jsx("span", {
|
|
316
|
+
css: browser.mac ? codeSm : codeMd
|
|
317
|
+
}, browser.mac ? '⌘' : 'Ctrl'), ' + ', jsx("span", {
|
|
302
318
|
css: codeMd
|
|
319
|
+
}, browser.mac ? 'Opt' : 'Alt'), ' + ', jsx("span", {
|
|
320
|
+
css: codeSm
|
|
303
321
|
}, "[")))
|
|
322
|
+
}] : [{
|
|
323
|
+
name: formatMessage(messages.InsertTableColumn),
|
|
324
|
+
type: 'table',
|
|
325
|
+
autoFormatting: () =>
|
|
326
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
327
|
+
jsx("span", {
|
|
328
|
+
css: shortcutsArray
|
|
329
|
+
}, jsx("span", null, jsx("span", {
|
|
330
|
+
css: codeSm
|
|
331
|
+
}, browser.mac ? '⌃' : 'Ctrl'), ' + ', jsx("span", {
|
|
332
|
+
css: codeMd
|
|
333
|
+
}, browser.mac ? 'Opt' : 'Alt'), ' + ', jsx("span", {
|
|
334
|
+
css: codeSm
|
|
335
|
+
}, "\u2192")), jsx("span", null, jsx("span", {
|
|
336
|
+
css: codeSm
|
|
337
|
+
}, browser.mac ? '⌃' : 'Ctrl'), ' + ', jsx("span", {
|
|
338
|
+
css: codeMd
|
|
339
|
+
}, browser.mac ? 'Opt' : 'Alt'), ' + ', jsx("span", {
|
|
340
|
+
css: codeSm
|
|
341
|
+
}, "\u2190")))
|
|
304
342
|
}, {
|
|
305
|
-
name: formatMessage(messages.
|
|
343
|
+
name: formatMessage(messages.InsertTableRow),
|
|
344
|
+
type: 'table',
|
|
345
|
+
autoFormatting: () =>
|
|
346
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
347
|
+
jsx("span", {
|
|
348
|
+
css: shortcutsArray
|
|
349
|
+
}, jsx("span", null, jsx("span", {
|
|
350
|
+
css: codeSm
|
|
351
|
+
}, browser.mac ? '⌃' : 'Ctrl'), ' + ', jsx("span", {
|
|
352
|
+
css: codeMd
|
|
353
|
+
}, browser.mac ? 'Opt' : 'Alt'), ' + ', jsx("span", {
|
|
354
|
+
css: codeSm
|
|
355
|
+
}, "\u2193")), jsx("span", null, jsx("span", {
|
|
356
|
+
css: codeSm
|
|
357
|
+
}, browser.mac ? '⌃' : 'Ctrl'), ' + ', jsx("span", {
|
|
358
|
+
css: codeMd
|
|
359
|
+
}, browser.mac ? 'Opt' : 'Alt'), ' + ', jsx("span", {
|
|
360
|
+
css: codeSm
|
|
361
|
+
}, "\u2191")))
|
|
362
|
+
}]), ...(getBooleanFF('platform.editor.a11y-column-resizing_emcvz') ? [{
|
|
363
|
+
name: formatMessage(messages.selectColumnResize),
|
|
306
364
|
type: 'table',
|
|
307
|
-
autoFormatting: () =>
|
|
365
|
+
autoFormatting: () =>
|
|
366
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
367
|
+
jsx("span", {
|
|
308
368
|
css: shortcutsArray
|
|
309
369
|
}, jsx("span", null, jsx("span", {
|
|
310
370
|
css: browser.mac ? codeSm : codeMd
|
|
@@ -312,8 +372,14 @@ const otherFormatting = ({
|
|
|
312
372
|
css: codeMd
|
|
313
373
|
}, browser.mac ? 'Opt' : 'Alt'), ' + ', jsx("span", {
|
|
314
374
|
css: codeMd
|
|
315
|
-
}, "
|
|
316
|
-
|
|
375
|
+
}, "Shift"), ' + ', jsx("span", {
|
|
376
|
+
css: codeSm
|
|
377
|
+
}, "C")))
|
|
378
|
+
}] : []), {
|
|
379
|
+
name: formatMessage(messages.highlightColor),
|
|
380
|
+
type: 'highlight',
|
|
381
|
+
keymap: () => toggleHighlightPalette
|
|
382
|
+
}];
|
|
317
383
|
const resizeInformationFormatting = ({
|
|
318
384
|
formatMessage
|
|
319
385
|
}) => [{
|
|
@@ -351,5 +417,5 @@ const quickInsertAutoFormat = ({
|
|
|
351
417
|
const isAnyA11yResizeFeatureFlagEnabled = getBooleanFF('platform.editor.a11y-media-resizing_b5v0o') || getBooleanFF('platform.editor.a11y-table-resizing_uapcv');
|
|
352
418
|
export const getSupportedFormatting = (schema, intl, imageEnabled, quickInsertEnabled) => {
|
|
353
419
|
const supportedBySchema = formatting(intl).filter(format => schema.nodes[format.type] || schema.marks[format.type]);
|
|
354
|
-
return [...navigationKeymaps(intl), ...supportedBySchema, ...(imageEnabled ? [imageAutoFormat] : []), ...(quickInsertEnabled ? [quickInsertAutoFormat(intl)] : []), ...
|
|
420
|
+
return [...navigationKeymaps(intl), ...otherFormatting(intl), ...supportedBySchema, ...(imageEnabled ? [imageAutoFormat] : []), ...(quickInsertEnabled ? [quickInsertAutoFormat(intl)] : []), ...(getBooleanFF('platform.editor.a11y-table-resizing_uapcv') ? focusTableResizeHandleFormatting(intl) : []), ...(isAnyA11yResizeFeatureFlagEnabled ? resizeInformationFormatting(intl) : [])];
|
|
355
421
|
};
|
package/dist/es2019/ui/styles.js
CHANGED
|
@@ -1,37 +1,53 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { akEditorUnitZIndex, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
3
3
|
import * as colors from '@atlaskit/theme/colors';
|
|
4
|
-
import { N400 } from '@atlaskit/theme/colors';
|
|
4
|
+
import { B300, N400 } from '@atlaskit/theme/colors';
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
5
6
|
export const header = css({
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
6
8
|
zIndex: akEditorUnitZIndex,
|
|
7
9
|
minHeight: "var(--ds-space-300, 24px)",
|
|
8
10
|
padding: `${"var(--ds-space-250, 20px)"} ${"var(--ds-space-500, 40px)"}`,
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
9
12
|
fontSize: relativeFontSizeToBase16(24),
|
|
10
13
|
display: 'flex',
|
|
11
14
|
justifyContent: 'space-between',
|
|
12
15
|
alignItems: 'center',
|
|
13
16
|
boxShadow: "'none'",
|
|
17
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
14
18
|
color: `var(--ds-text, ${colors.N400})`,
|
|
19
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
15
20
|
backgroundColor: `var(--ds-background-neutral-subtle, ${colors.N0})`,
|
|
16
21
|
borderRadius: "var(--ds-border-radius, 3px)"
|
|
17
22
|
});
|
|
23
|
+
|
|
24
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
18
25
|
export const footer = css({
|
|
26
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
19
27
|
zIndex: akEditorUnitZIndex,
|
|
28
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
20
29
|
fontSize: relativeFontSizeToBase16(14),
|
|
21
30
|
lineHeight: "var(--ds-space-250, 20px)",
|
|
31
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
22
32
|
color: `var(--ds-text-subtlest, ${colors.N300})`,
|
|
23
33
|
padding: "var(--ds-space-300, 24px)",
|
|
24
34
|
textAlign: 'right',
|
|
25
35
|
boxShadow: "'none'"
|
|
26
36
|
});
|
|
37
|
+
|
|
38
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
27
39
|
export const contentWrapper = css({
|
|
28
40
|
padding: `${"var(--ds-space-250, 20px)"} ${"var(--ds-space-500, 40px)"}`,
|
|
29
41
|
borderBottomRightRadius: "var(--ds-border-radius, 3px)",
|
|
30
42
|
overflow: 'auto',
|
|
31
43
|
position: 'relative',
|
|
44
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
32
45
|
color: `var(--ds-text-subtle, ${colors.N400})`,
|
|
46
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
33
47
|
backgroundColor: `var(--ds-background-neutral-subtle, ${colors.N0})`
|
|
34
48
|
});
|
|
49
|
+
|
|
50
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
35
51
|
export const line = css({
|
|
36
52
|
background: "var(--ds-background-neutral-subtle, #fff)",
|
|
37
53
|
content: "''",
|
|
@@ -44,6 +60,8 @@ export const line = css({
|
|
|
44
60
|
width: '100%',
|
|
45
61
|
minWidth: '604px'
|
|
46
62
|
});
|
|
63
|
+
|
|
64
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
47
65
|
export const content = css({
|
|
48
66
|
minWidth: '524px',
|
|
49
67
|
width: '100%',
|
|
@@ -57,6 +75,8 @@ export const column = {
|
|
|
57
75
|
padding: 0
|
|
58
76
|
}
|
|
59
77
|
};
|
|
78
|
+
|
|
79
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
60
80
|
export const row = css({
|
|
61
81
|
margin: `${"var(--ds-space-250, 20px)"} 0`,
|
|
62
82
|
display: 'flex',
|
|
@@ -80,7 +100,10 @@ export const title = {
|
|
|
80
100
|
lineHeight: 1.42857142857143
|
|
81
101
|
}
|
|
82
102
|
};
|
|
103
|
+
|
|
104
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
83
105
|
export const codeSm = css({
|
|
106
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
84
107
|
backgroundColor: `var(--ds-background-neutral, ${colors.N20})`,
|
|
85
108
|
borderRadius: "var(--ds-border-radius, 3px)",
|
|
86
109
|
width: "var(--ds-space-300, 24px)",
|
|
@@ -89,7 +112,10 @@ export const codeSm = css({
|
|
|
89
112
|
lineHeight: '24px',
|
|
90
113
|
textAlign: 'center'
|
|
91
114
|
});
|
|
115
|
+
|
|
116
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
92
117
|
export const codeMd = css({
|
|
118
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
93
119
|
backgroundColor: `var(--ds-background-neutral, ${colors.N20})`,
|
|
94
120
|
borderRadius: "var(--ds-border-radius, 3px)",
|
|
95
121
|
display: 'inline-block',
|
|
@@ -98,7 +124,10 @@ export const codeMd = css({
|
|
|
98
124
|
width: '50px',
|
|
99
125
|
textAlign: 'center'
|
|
100
126
|
});
|
|
127
|
+
|
|
128
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
101
129
|
export const codeLg = css({
|
|
130
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
102
131
|
backgroundColor: `var(--ds-background-neutral, ${colors.N20})`,
|
|
103
132
|
borderRadius: "var(--ds-border-radius, 3px)",
|
|
104
133
|
display: 'inline-block',
|
|
@@ -107,12 +136,24 @@ export const codeLg = css({
|
|
|
107
136
|
padding: `0 ${"var(--ds-space-150, 12px)"}`,
|
|
108
137
|
textAlign: 'center'
|
|
109
138
|
});
|
|
139
|
+
|
|
140
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
110
141
|
export const shortcutsArray = css({
|
|
111
142
|
display: 'flex',
|
|
112
143
|
flexDirection: 'column',
|
|
113
144
|
flexShrink: 0,
|
|
114
145
|
gap: "var(--ds-space-150, 12px)"
|
|
115
146
|
});
|
|
147
|
+
|
|
148
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
116
149
|
export const componentFromKeymapWrapperStyles = css({
|
|
117
150
|
flexShrink: 0
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
154
|
+
export const toolbarButton = css({
|
|
155
|
+
'&:focus': {
|
|
156
|
+
outline: `2px solid ${`var(--ds-border-focused, ${B300})`}`,
|
|
157
|
+
outlineOffset: "var(--ds-space-025, 2px)"
|
|
158
|
+
}
|
|
118
159
|
});
|
package/dist/es2019/ui/utils.js
CHANGED
|
@@ -9,40 +9,59 @@ const getKeyParts = keymap => {
|
|
|
9
9
|
}
|
|
10
10
|
return shortcut.replace(/\-(?=.)/g, ' + ').split(' ');
|
|
11
11
|
};
|
|
12
|
-
export const shortcutNamesWithoutKeymap = ['emoji', 'mention', 'quickInsert'];
|
|
12
|
+
export const shortcutNamesWithoutKeymap = ['table', 'emoji', 'mention', 'quickInsert'];
|
|
13
13
|
export const getComponentFromKeymap = keymap => {
|
|
14
14
|
const keyParts = getKeyParts(keymap);
|
|
15
|
-
return
|
|
16
|
-
css
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
15
|
+
return (
|
|
16
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
17
|
+
jsx("span", {
|
|
18
|
+
css: componentFromKeymapWrapperStyles
|
|
19
|
+
}, keyParts.map((part, index) => {
|
|
20
|
+
if (part === '+') {
|
|
21
|
+
return jsx("span", {
|
|
22
|
+
key: `${keyParts}-${index}`
|
|
23
|
+
}, ' + ');
|
|
24
|
+
} else if (part === 'Cmd') {
|
|
25
|
+
return (
|
|
26
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
27
|
+
jsx("span", {
|
|
28
|
+
css: codeSm,
|
|
29
|
+
key: `${keyParts}-${index}`
|
|
30
|
+
}, "\u2318")
|
|
31
|
+
);
|
|
32
|
+
} else if (['ctrl', 'alt', 'opt', 'shift'].indexOf(part.toLowerCase()) >= 0) {
|
|
33
|
+
return (
|
|
34
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
35
|
+
jsx("span", {
|
|
36
|
+
css: codeMd,
|
|
37
|
+
key: `${keyParts}-${index}`
|
|
38
|
+
}, part)
|
|
39
|
+
);
|
|
40
|
+
} else if (['f9', 'f10'].indexOf(part.toLowerCase()) >= 0) {
|
|
41
|
+
return (
|
|
42
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
43
|
+
jsx("span", {
|
|
44
|
+
css: codeLg,
|
|
45
|
+
key: `${keyParts}-${index}`
|
|
46
|
+
}, part)
|
|
47
|
+
);
|
|
48
|
+
} else if (part.toLowerCase() === 'enter') {
|
|
49
|
+
return (
|
|
50
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
51
|
+
jsx("span", {
|
|
52
|
+
className: "enter-keymap",
|
|
53
|
+
css: codeSm,
|
|
54
|
+
key: `${keyParts}-${index}`
|
|
55
|
+
}, '⏎')
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
return (
|
|
59
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
60
|
+
jsx("span", {
|
|
61
|
+
css: codeSm,
|
|
62
|
+
key: `${keyParts}-${index}`
|
|
63
|
+
}, part.toUpperCase())
|
|
64
|
+
);
|
|
65
|
+
}))
|
|
66
|
+
);
|
|
48
67
|
};
|
|
@@ -28,19 +28,25 @@ export var ModalContent = function ModalContent(_ref) {
|
|
|
28
28
|
var keymap = form.keymap && form.keymap();
|
|
29
29
|
return keymap && keymap[browser.mac ? 'mac' : 'windows'];
|
|
30
30
|
}).map(function (form) {
|
|
31
|
-
return
|
|
32
|
-
css
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
return (
|
|
32
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
33
|
+
jsx("li", {
|
|
34
|
+
css: row,
|
|
35
|
+
key: "textFormatting-".concat(form.name)
|
|
36
|
+
}, jsx("span", null, form.name), getComponentFromKeymap(form.keymap()))
|
|
37
|
+
);
|
|
35
38
|
}), formatting.filter(function (form) {
|
|
36
39
|
return shortcutNamesWithoutKeymap.indexOf(form.type) !== -1;
|
|
37
40
|
}).filter(function (form) {
|
|
38
41
|
return form.autoFormatting;
|
|
39
42
|
}).map(function (form) {
|
|
40
|
-
return
|
|
41
|
-
css
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
return (
|
|
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
|
+
jsx("li", {
|
|
46
|
+
css: row,
|
|
47
|
+
key: "autoFormatting-".concat(form.name)
|
|
48
|
+
}, jsx("span", null, form.name), form.autoFormatting())
|
|
49
|
+
);
|
|
44
50
|
}))), jsx("div", {
|
|
45
51
|
css: line
|
|
46
52
|
}), jsx("div", {
|
|
@@ -50,7 +56,9 @@ export var ModalContent = function ModalContent(_ref) {
|
|
|
50
56
|
}, jsx(FormattedMessage, messages.markdown)), jsx("ul", null, formatting.filter(function (form) {
|
|
51
57
|
return shortcutNamesWithoutKeymap.indexOf(form.type) === -1;
|
|
52
58
|
}).map(function (form) {
|
|
53
|
-
return form.autoFormatting &&
|
|
59
|
+
return form.autoFormatting &&
|
|
60
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
61
|
+
jsx("li", {
|
|
54
62
|
key: "autoFormatting-".concat(form.name),
|
|
55
63
|
css: row
|
|
56
64
|
}, jsx("span", null, form.name), form.autoFormatting());
|
|
@@ -7,12 +7,15 @@ import { helpDialogMessages as messages } from '@atlaskit/editor-common/messages
|
|
|
7
7
|
import { footer } from './styles';
|
|
8
8
|
import { getComponentFromKeymap } from './utils';
|
|
9
9
|
var ModalFooter = function ModalFooter() {
|
|
10
|
-
return
|
|
11
|
-
css
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
return (
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
12
|
+
jsx("div", {
|
|
13
|
+
css: footer
|
|
14
|
+
}, jsx(FormattedMessage, _extends({}, messages.helpDialogTips, {
|
|
15
|
+
values: {
|
|
16
|
+
keyMap: getComponentFromKeymap(openHelp)
|
|
17
|
+
}
|
|
18
|
+
})))
|
|
19
|
+
);
|
|
17
20
|
};
|
|
18
21
|
export default ModalFooter;
|
|
@@ -4,24 +4,30 @@ import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
|
4
4
|
import { helpDialogMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
6
6
|
import CrossIcon from '@atlaskit/icon/glyph/cross';
|
|
7
|
-
import { dialogHeader, header } from './styles';
|
|
7
|
+
import { dialogHeader, header, toolbarButton } from './styles';
|
|
8
8
|
var ModalHeader = injectIntl(function (_ref) {
|
|
9
9
|
var formatMessage = _ref.intl.formatMessage,
|
|
10
10
|
onClose = _ref.onClose;
|
|
11
|
-
return
|
|
12
|
-
css
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
return (
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
13
|
+
jsx("div", {
|
|
14
|
+
css: header
|
|
15
|
+
}, jsx("h1", {
|
|
16
|
+
css: dialogHeader
|
|
17
|
+
}, jsx(FormattedMessage, messages.editorHelp)), jsx("div", null, jsx(ToolbarButton
|
|
18
|
+
// @ts-expect-error modal onClose handler requires second parameter of UIAnalyticsEvent, which we don't want to pass
|
|
19
|
+
, {
|
|
20
|
+
onClick: onClose,
|
|
21
|
+
title: formatMessage(messages.closeHelpDialog),
|
|
22
|
+
spacing: "compact",
|
|
23
|
+
iconBefore: jsx(CrossIcon, {
|
|
24
|
+
label: formatMessage(messages.closeHelpDialog),
|
|
25
|
+
size: "medium"
|
|
26
|
+
})
|
|
27
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
28
|
+
,
|
|
29
|
+
css: toolbarButton
|
|
30
|
+
})))
|
|
31
|
+
);
|
|
26
32
|
});
|
|
27
33
|
export default ModalHeader;
|