@atlaskit/editor-common 76.27.9 → 76.28.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 +14 -0
- package/dist/cjs/media-inline/constants.js +23 -2
- package/dist/cjs/media-inline/inline-image-wrapper.js +11 -21
- package/dist/cjs/media-inline/media-inline-image-card.js +8 -5
- package/dist/cjs/media-inline/styles.js +36 -4
- package/dist/cjs/media-inline/views/icon-wrapper.js +1 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/styles/shared/annotation.js +5 -22
- package/dist/cjs/styles/shared/code-block.js +4 -20
- package/dist/cjs/styles/shared/code-mark.js +2 -6
- package/dist/cjs/styles/shared/panel.js +9 -62
- package/dist/cjs/styles/shared/rule.js +2 -8
- package/dist/cjs/ui/BaseTheme/index.js +8 -15
- package/dist/cjs/ui/DropList/index.js +4 -17
- package/dist/cjs/ui/Expand/index.js +13 -38
- package/dist/cjs/ui/Messages/index.js +6 -6
- package/dist/cjs/ui/PortalProvider/index.js +7 -21
- package/dist/cjs/ui-menu/ColorPickerButton/index.js +5 -13
- package/dist/cjs/ui-menu/DropdownMenu/index.js +10 -27
- package/dist/es2019/media-inline/constants.js +22 -1
- package/dist/es2019/media-inline/inline-image-wrapper.js +16 -21
- package/dist/es2019/media-inline/media-inline-image-card.js +8 -5
- package/dist/es2019/media-inline/styles.js +55 -11
- package/dist/es2019/media-inline/views/icon-wrapper.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/styles/shared/annotation.js +9 -28
- package/dist/es2019/styles/shared/code-block.js +11 -27
- package/dist/es2019/styles/shared/code-mark.js +3 -7
- package/dist/es2019/styles/shared/panel.js +24 -83
- package/dist/es2019/styles/shared/rule.js +3 -9
- package/dist/es2019/ui/BaseTheme/index.js +3 -11
- package/dist/es2019/ui/DropList/index.js +7 -17
- package/dist/es2019/ui/Expand/index.js +18 -44
- package/dist/es2019/ui/Messages/index.js +6 -6
- package/dist/es2019/ui/PortalProvider/index.js +7 -21
- package/dist/es2019/ui-menu/ColorPickerButton/index.js +7 -15
- package/dist/es2019/ui-menu/DropdownMenu/index.js +34 -49
- package/dist/esm/media-inline/constants.js +22 -1
- package/dist/esm/media-inline/inline-image-wrapper.js +13 -21
- package/dist/esm/media-inline/media-inline-image-card.js +8 -5
- package/dist/esm/media-inline/styles.js +35 -3
- package/dist/esm/media-inline/views/icon-wrapper.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/styles/shared/annotation.js +5 -22
- package/dist/esm/styles/shared/code-block.js +6 -22
- package/dist/esm/styles/shared/code-mark.js +3 -7
- package/dist/esm/styles/shared/panel.js +10 -63
- package/dist/esm/styles/shared/rule.js +3 -9
- package/dist/esm/ui/BaseTheme/index.js +9 -15
- package/dist/esm/ui/DropList/index.js +5 -18
- package/dist/esm/ui/Expand/index.js +14 -39
- package/dist/esm/ui/Messages/index.js +6 -6
- package/dist/esm/ui/PortalProvider/index.js +7 -21
- package/dist/esm/ui-menu/ColorPickerButton/index.js +6 -14
- package/dist/esm/ui-menu/DropdownMenu/index.js +11 -28
- package/dist/types/media-inline/constants.d.ts +19 -0
- package/dist/types/media-inline/inline-image-wrapper.d.ts +2 -0
- package/dist/types/media-inline/media-inline-image-card.d.ts +4 -0
- package/dist/types/media-inline/styles.d.ts +11 -0
- package/dist/types/media-inline/types.d.ts +2 -0
- package/dist/types/styles/shared/annotation.d.ts +2 -3
- package/dist/types/styles/shared/code-block.d.ts +1 -2
- package/dist/types/styles/shared/code-mark.d.ts +1 -2
- package/dist/types/styles/shared/panel.d.ts +4 -5
- package/dist/types/styles/shared/rule.d.ts +1 -2
- package/dist/types/ui/BaseTheme/index.d.ts +1 -1
- package/dist/types/ui/Expand/index.d.ts +4 -5
- package/dist/types/ui/Messages/index.d.ts +1 -1
- package/dist/types/ui/PortalProvider/index.d.ts +4 -8
- package/dist/types/utils/getModeFromTheme.d.ts +1 -1
- package/dist/types-ts4.5/media-inline/constants.d.ts +19 -0
- package/dist/types-ts4.5/media-inline/inline-image-wrapper.d.ts +2 -0
- package/dist/types-ts4.5/media-inline/media-inline-image-card.d.ts +4 -0
- package/dist/types-ts4.5/media-inline/styles.d.ts +11 -0
- package/dist/types-ts4.5/media-inline/types.d.ts +2 -0
- package/dist/types-ts4.5/styles/shared/annotation.d.ts +2 -3
- package/dist/types-ts4.5/styles/shared/code-block.d.ts +1 -2
- package/dist/types-ts4.5/styles/shared/code-mark.d.ts +1 -2
- package/dist/types-ts4.5/styles/shared/panel.d.ts +4 -5
- package/dist/types-ts4.5/styles/shared/rule.d.ts +1 -2
- package/dist/types-ts4.5/ui/BaseTheme/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/Expand/index.d.ts +4 -5
- package/dist/types-ts4.5/ui/Messages/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/PortalProvider/index.d.ts +4 -8
- package/dist/types-ts4.5/utils/getModeFromTheme.d.ts +1 -1
- package/package.json +2 -2
- package/dist/cjs/ui/PortalProvider/PortalProviderThemesProvider.js +0 -43
- package/dist/es2019/ui/PortalProvider/PortalProviderThemesProvider.js +0 -37
- package/dist/esm/ui/PortalProvider/PortalProviderThemesProvider.js +0 -36
- package/dist/types/ui/PortalProvider/PortalProviderThemesProvider.d.ts +0 -6
- package/dist/types-ts4.5/ui/PortalProvider/PortalProviderThemesProvider.d.ts +0 -6
|
@@ -1,62 +1,43 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { N60A, Y300, Y75 } from '@atlaskit/theme/colors';
|
|
3
|
-
import { themed } from '@atlaskit/theme/components';
|
|
4
3
|
export const annotationPrefix = 'ak-editor-annotation';
|
|
5
4
|
export const AnnotationSharedClassNames = {
|
|
6
5
|
focus: `${annotationPrefix}-focus`,
|
|
7
6
|
blur: `${annotationPrefix}-blur`,
|
|
8
7
|
draft: `${annotationPrefix}-draft`
|
|
9
8
|
};
|
|
10
|
-
const DY75 = 'rgb(111, 92, 37)';
|
|
11
|
-
const DY300 = '#ffd557';
|
|
12
9
|
const Y75a = 'rgba(255, 240, 179, 0.5)';
|
|
13
10
|
const Y200a = 'rgba(255, 196, 0, 0.82)';
|
|
14
|
-
const
|
|
15
|
-
const DY200 = '#82641c';
|
|
16
|
-
export const AnnotationSharedCSSByState = props => ({
|
|
11
|
+
export const AnnotationSharedCSSByState = () => ({
|
|
17
12
|
focus: css`
|
|
18
13
|
// Background is not coming through in confluence, suspecting to be caused by some specific combination of
|
|
19
14
|
// emotion and token look up
|
|
20
15
|
|
|
21
|
-
background: ${
|
|
22
|
-
|
|
23
|
-
dark: `var(--ds-background-accent-yellow-subtler, ${DY75})`
|
|
24
|
-
})(props)};
|
|
25
|
-
border-bottom: 2px solid
|
|
26
|
-
${themed({
|
|
27
|
-
light: `var(--ds-border-accent-yellow, ${Y300})`,
|
|
28
|
-
dark: `var(--ds-border-accent-yellow, ${DY300})`
|
|
29
|
-
})(props)};
|
|
16
|
+
background: ${`var(--ds-background-accent-yellow-subtler, ${Y75})`};
|
|
17
|
+
border-bottom: 2px solid ${`var(--ds-border-accent-yellow, ${Y300})`};
|
|
30
18
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4147
|
|
31
19
|
box-shadow: ${`var(--ds-shadow-overlay, ${`1px 2px 3px ${N60A}, -1px 2px 3px ${N60A}`})`};
|
|
32
20
|
cursor: pointer;
|
|
33
21
|
`,
|
|
34
22
|
blur: css`
|
|
35
|
-
background: ${
|
|
36
|
-
|
|
37
|
-
dark: `var(--ds-background-accent-yellow-subtlest, ${DY75a})`
|
|
38
|
-
})(props)};
|
|
39
|
-
border-bottom: 2px solid
|
|
40
|
-
${themed({
|
|
41
|
-
light: `var(--ds-border-accent-yellow, ${Y200a})`,
|
|
42
|
-
dark: `var(--ds-border-accent-yellow, ${DY200})`
|
|
43
|
-
})(props)};
|
|
23
|
+
background: ${`var(--ds-background-accent-yellow-subtlest, ${Y75a})`};
|
|
24
|
+
border-bottom: 2px solid ${`var(--ds-border-accent-yellow, ${Y200a})`};
|
|
44
25
|
cursor: pointer;
|
|
45
26
|
`
|
|
46
27
|
});
|
|
47
|
-
export const annotationSharedStyles =
|
|
28
|
+
export const annotationSharedStyles = () => css`
|
|
48
29
|
.ProseMirror {
|
|
49
30
|
.${AnnotationSharedClassNames.focus} {
|
|
50
|
-
${AnnotationSharedCSSByState(
|
|
31
|
+
${AnnotationSharedCSSByState().focus};
|
|
51
32
|
}
|
|
52
33
|
|
|
53
34
|
.${AnnotationSharedClassNames.draft} {
|
|
54
|
-
${AnnotationSharedCSSByState(
|
|
35
|
+
${AnnotationSharedCSSByState().focus};
|
|
55
36
|
cursor: initial;
|
|
56
37
|
}
|
|
57
38
|
|
|
58
39
|
.${AnnotationSharedClassNames.blur} {
|
|
59
|
-
${AnnotationSharedCSSByState(
|
|
40
|
+
${AnnotationSharedCSSByState().blur};
|
|
60
41
|
}
|
|
61
42
|
}
|
|
62
43
|
`;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { akEditorCodeFontFamily, akEditorLineHeight, akEditorTableCellMinWidth, blockNodesVerticalMargin, overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { borderRadius, fontSize } from '@atlaskit/theme/constants';
|
|
3
|
+
import { N20, N30, N400, N800 } from '@atlaskit/theme/colors';
|
|
4
|
+
import { fontSize } from '@atlaskit/theme/constants';
|
|
6
5
|
export const CodeBlockSharedCssClassName = {
|
|
7
6
|
CODEBLOCK_CONTAINER: 'code-block',
|
|
8
7
|
CODEBLOCK_START: 'code-block--start',
|
|
@@ -12,11 +11,11 @@ export const CodeBlockSharedCssClassName = {
|
|
|
12
11
|
CODEBLOCK_CONTENT: 'code-content',
|
|
13
12
|
DS_CODEBLOCK: '[data-ds--code--code-block]'
|
|
14
13
|
};
|
|
15
|
-
export const codeBlockSharedStyles =
|
|
14
|
+
export const codeBlockSharedStyles = () => css`
|
|
16
15
|
.${CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER} {
|
|
17
16
|
position: relative;
|
|
18
17
|
background-color: ${"var(--ds-surface-raised, transparent)"};
|
|
19
|
-
border-radius: ${
|
|
18
|
+
border-radius: ${"var(--ds-border-radius, 3px)"};
|
|
20
19
|
margin: ${blockNodesVerticalMargin} 0 0 0;
|
|
21
20
|
font-family: ${akEditorCodeFontFamily};
|
|
22
21
|
min-width: ${akEditorTableCellMinWidth}px;
|
|
@@ -44,21 +43,15 @@ export const codeBlockSharedStyles = props => css`
|
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
.${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER} {
|
|
47
|
-
background-color: ${
|
|
48
|
-
light: `var(--ds-background-neutral, ${N20})`,
|
|
49
|
-
dark: `var(--ds-background-neutral, ${DN50})`
|
|
50
|
-
})(props)};
|
|
46
|
+
background-color: ${`var(--ds-background-neutral, ${N20})`};
|
|
51
47
|
display: flex;
|
|
52
|
-
border-radius: ${
|
|
48
|
+
border-radius: ${"var(--ds-border-radius, 3px)"};
|
|
53
49
|
width: 100%;
|
|
54
50
|
counter-reset: line;
|
|
55
51
|
overflow-x: auto;
|
|
56
52
|
|
|
57
53
|
background-image: ${overflowShadow({
|
|
58
|
-
background:
|
|
59
|
-
light: `var(--ds-background-neutral, ${N20})`,
|
|
60
|
-
dark: `var(--ds-background-neutral, ${DN50})`
|
|
61
|
-
})(props),
|
|
54
|
+
background: `var(--ds-background-neutral, ${N20})`,
|
|
62
55
|
leftCoverWidth: "var(--ds-space-300, 24px)"
|
|
63
56
|
})};
|
|
64
57
|
|
|
@@ -78,10 +71,7 @@ export const codeBlockSharedStyles = props => css`
|
|
|
78
71
|
.${CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER} {
|
|
79
72
|
flex-shrink: 0;
|
|
80
73
|
text-align: right;
|
|
81
|
-
background-color: ${
|
|
82
|
-
light: `var(--ds-background-neutral, ${N30})`,
|
|
83
|
-
dark: `var(--ds-background-neutral, ${DN20})`
|
|
84
|
-
})(props)};
|
|
74
|
+
background-color: ${`var(--ds-background-neutral, ${N30})`};
|
|
85
75
|
padding: ${"var(--ds-space-100, 8px)"};
|
|
86
76
|
position: relative;
|
|
87
77
|
|
|
@@ -94,10 +84,7 @@ export const codeBlockSharedStyles = props => css`
|
|
|
94
84
|
display: inline-block;
|
|
95
85
|
content: counter(line);
|
|
96
86
|
counter-increment: line;
|
|
97
|
-
color: ${
|
|
98
|
-
light: `var(--ds-text-subtlest, ${N400})`,
|
|
99
|
-
dark: `var(--ds-text-subtlest, ${DN400})`
|
|
100
|
-
})(props)};
|
|
87
|
+
color: ${`var(--ds-text-subtlest, ${N400})`};
|
|
101
88
|
font-size: ${relativeFontSizeToBase16(fontSize())};
|
|
102
89
|
line-height: 1.5rem;
|
|
103
90
|
}
|
|
@@ -112,11 +99,8 @@ export const codeBlockSharedStyles = props => css`
|
|
|
112
99
|
flex-grow: 1;
|
|
113
100
|
tab-size: 4;
|
|
114
101
|
cursor: text;
|
|
115
|
-
color: ${
|
|
116
|
-
|
|
117
|
-
dark: `var(--ds-text, ${DN800})`
|
|
118
|
-
})(props)};
|
|
119
|
-
border-radius: ${borderRadius()}px;
|
|
102
|
+
color: ${`var(--ds-text, ${N800})`};
|
|
103
|
+
border-radius: ${"var(--ds-border-radius, 3px)"};
|
|
120
104
|
margin: ${"var(--ds-space-100, 8px)"};
|
|
121
105
|
white-space: pre;
|
|
122
106
|
font-size: ${relativeFontSizeToBase16(fontSize())};
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { getCodeStyles } from '@atlaskit/code/inline';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export const codeMarkSharedStyles = props => {
|
|
3
|
+
import { N30A } from '@atlaskit/theme/colors';
|
|
4
|
+
export const codeMarkSharedStyles = () => {
|
|
6
5
|
return css`
|
|
7
6
|
.code {
|
|
8
|
-
--ds--code--bg-color: ${
|
|
9
|
-
light: `var(--ds-background-neutral, ${N30A})`,
|
|
10
|
-
dark: `var(--ds-background-neutral, ${DN70})`
|
|
11
|
-
})(props)};
|
|
7
|
+
--ds--code--bg-color: ${`var(--ds-background-neutral, ${N30A})`};
|
|
12
8
|
${getCodeStyles()}
|
|
13
9
|
}
|
|
14
10
|
`;
|
|
@@ -5,10 +5,7 @@ import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
|
5
5
|
import { akEditorTableCellMinWidth, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
|
|
7
7
|
import { emojiImage, emojiSprite } from '@atlaskit/emoji';
|
|
8
|
-
import { B100, B400, B50, B75, G200, G400, G50, G75, N0, N20, N60, P100, P400, P50, P75, R100,
|
|
9
|
-
import { themed } from '@atlaskit/theme/components';
|
|
10
|
-
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
11
|
-
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
8
|
+
import { B100, B400, B50, B75, G200, G400, G50, G75, N0, N20, N60, P100, P400, P50, P75, R100, R400, R50, R75, T100, T50, T75, Y200, Y400, Y50, Y75 } from '@atlaskit/theme/colors';
|
|
12
9
|
const lightPanelColors = {
|
|
13
10
|
info: B50,
|
|
14
11
|
note: P50,
|
|
@@ -87,28 +84,10 @@ const lightIconColor = {
|
|
|
87
84
|
warning: `var(--ds-icon-warning, ${Y400})`,
|
|
88
85
|
error: `var(--ds-icon-danger, ${R400})`
|
|
89
86
|
};
|
|
90
|
-
const darkIconColor = {
|
|
91
|
-
info: `var(--ds-icon-information, ${B100})`,
|
|
92
|
-
note: `var(--ds-icon-discovery, ${P100})`,
|
|
93
|
-
tip: `var(--ds-icon-success, ${G200})`,
|
|
94
|
-
success: `var(--ds-icon-success, ${G200})`,
|
|
95
|
-
warning: `var(--ds-icon-warning, ${Y100})`,
|
|
96
|
-
error: `var(--ds-icon-danger, ${R200})`
|
|
97
|
-
};
|
|
98
|
-
const tokenDarkPanelColors = {
|
|
99
|
-
info: `var(--ds-background-information, ${darkPanelColors['info']})`,
|
|
100
|
-
note: `var(--ds-background-discovery, ${darkPanelColors['note']})`,
|
|
101
|
-
tip: `var(--ds-background-success, ${darkPanelColors['tip']})`,
|
|
102
|
-
success: `var(--ds-background-success, ${darkPanelColors['success']})`,
|
|
103
|
-
warning: `var(--ds-background-warning, ${darkPanelColors['warning']})`,
|
|
104
|
-
error: `var(--ds-background-danger, ${darkPanelColors['error']})`
|
|
105
|
-
};
|
|
106
87
|
|
|
107
|
-
// TODO: Migrate away from gridSize
|
|
108
|
-
// Recommendation: Replace gridSize with 8
|
|
109
88
|
// New custom icons are a little smaller than predefined icons.
|
|
110
89
|
// To fix alignment issues with custom icons, vertical alignment is updated.
|
|
111
|
-
const panelEmojiSpriteVerticalAlignment = -(
|
|
90
|
+
const panelEmojiSpriteVerticalAlignment = -(8 * 3 - akEditorCustomIconSize) / 2;
|
|
112
91
|
const panelEmojiImageVerticalAlignment = panelEmojiSpriteVerticalAlignment - 1;
|
|
113
92
|
|
|
114
93
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4066
|
|
@@ -159,51 +138,19 @@ export const PanelSharedSelectors = {
|
|
|
159
138
|
yellowWarningIcon: `[aria-label=":warning:"] span:nth-child(1)`,
|
|
160
139
|
copyButton: `button[aria-label="Copy"]`
|
|
161
140
|
};
|
|
162
|
-
const iconDynamicStyles = panelType =>
|
|
163
|
-
const light = lightIconColor[panelType];
|
|
164
|
-
const dark = darkIconColor[panelType];
|
|
165
|
-
const color = themed({
|
|
166
|
-
light,
|
|
167
|
-
dark
|
|
168
|
-
})(props);
|
|
169
|
-
return `
|
|
170
|
-
color: ${color};
|
|
171
|
-
`;
|
|
172
|
-
};
|
|
141
|
+
const iconDynamicStyles = panelType => `color: ${lightIconColor[panelType]};`;
|
|
173
142
|
|
|
174
143
|
// Provides the color without tokens, used when converting to a custom panel
|
|
175
|
-
export const getPanelTypeBackgroundNoTokens =
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
const background = themed({
|
|
179
|
-
light,
|
|
180
|
-
dark
|
|
181
|
-
})(props);
|
|
182
|
-
return background || 'none';
|
|
183
|
-
};
|
|
184
|
-
export const getPanelTypeBackground = (panelType, props = {}) => {
|
|
185
|
-
const light = hexToEditorBackgroundPaletteColor(lightPanelColors[panelType]);
|
|
186
|
-
// hexToEditorBackgroundPaletteColor has a light mode as a fallback color - for legacy dark mode we define the tokens locally
|
|
187
|
-
const dark = tokenDarkPanelColors[panelType];
|
|
188
|
-
const background = themed({
|
|
189
|
-
light,
|
|
190
|
-
dark
|
|
191
|
-
})(props);
|
|
192
|
-
return background || 'none';
|
|
193
|
-
};
|
|
194
|
-
const mainDynamicStyles = panelType => props => {
|
|
195
|
-
const background = getPanelTypeBackground(panelType, props);
|
|
196
|
-
const text = themed({
|
|
197
|
-
light: 'inherit',
|
|
198
|
-
dark: darkPanelColors.TextColor
|
|
199
|
-
})(props);
|
|
144
|
+
export const getPanelTypeBackgroundNoTokens = panelType => lightPanelColors[panelType] || 'none';
|
|
145
|
+
export const getPanelTypeBackground = panelType => hexToEditorBackgroundPaletteColor(lightPanelColors[panelType]) || 'none';
|
|
146
|
+
const mainDynamicStyles = panelType => {
|
|
200
147
|
return `
|
|
201
|
-
background-color: ${
|
|
202
|
-
color:
|
|
148
|
+
background-color: ${getPanelTypeBackground(panelType)};
|
|
149
|
+
color: inherit;
|
|
203
150
|
`;
|
|
204
151
|
};
|
|
205
|
-
export const panelSharedStylesWithoutPrefix =
|
|
206
|
-
border-radius: ${
|
|
152
|
+
export const panelSharedStylesWithoutPrefix = () => css`
|
|
153
|
+
border-radius: ${"var(--ds-border-radius, 3px)"};
|
|
207
154
|
margin: ${blockNodesVerticalMargin} 0 0;
|
|
208
155
|
padding: ${"var(--ds-space-100, 8px)"};
|
|
209
156
|
min-width: ${akEditorTableCellMinWidth}px;
|
|
@@ -212,7 +159,7 @@ export const panelSharedStylesWithoutPrefix = props => css`
|
|
|
212
159
|
align-items: baseline;
|
|
213
160
|
word-break: break-word;
|
|
214
161
|
|
|
215
|
-
${mainDynamicStyles(PanelType.INFO)
|
|
162
|
+
${mainDynamicStyles(PanelType.INFO)}
|
|
216
163
|
|
|
217
164
|
.${PanelSharedCssClassName.icon} {
|
|
218
165
|
flex-shrink: 0;
|
|
@@ -225,7 +172,7 @@ export const panelSharedStylesWithoutPrefix = props => css`
|
|
|
225
172
|
-moz-user-select: none;
|
|
226
173
|
-webkit-user-select: none;
|
|
227
174
|
-ms-user-select: none;
|
|
228
|
-
${iconDynamicStyles(PanelType.INFO)
|
|
175
|
+
${iconDynamicStyles(PanelType.INFO)}
|
|
229
176
|
|
|
230
177
|
> span {
|
|
231
178
|
vertical-align: middle;
|
|
@@ -259,53 +206,47 @@ export const panelSharedStylesWithoutPrefix = props => css`
|
|
|
259
206
|
}
|
|
260
207
|
|
|
261
208
|
&[data-panel-type='${PanelType.NOTE}'] {
|
|
262
|
-
${mainDynamicStyles(PanelType.NOTE)
|
|
209
|
+
${mainDynamicStyles(PanelType.NOTE)}
|
|
263
210
|
|
|
264
211
|
.${PanelSharedCssClassName.icon} {
|
|
265
|
-
${iconDynamicStyles(PanelType.NOTE)
|
|
212
|
+
${iconDynamicStyles(PanelType.NOTE)}
|
|
266
213
|
}
|
|
267
214
|
}
|
|
268
215
|
|
|
269
216
|
&[data-panel-type='${PanelType.TIP}'] {
|
|
270
|
-
${mainDynamicStyles(PanelType.TIP)
|
|
217
|
+
${mainDynamicStyles(PanelType.TIP)}
|
|
271
218
|
|
|
272
219
|
.${PanelSharedCssClassName.icon} {
|
|
273
|
-
${iconDynamicStyles(PanelType.TIP)
|
|
220
|
+
${iconDynamicStyles(PanelType.TIP)}
|
|
274
221
|
}
|
|
275
222
|
}
|
|
276
223
|
|
|
277
224
|
&[data-panel-type='${PanelType.WARNING}'] {
|
|
278
|
-
${mainDynamicStyles(PanelType.WARNING)
|
|
225
|
+
${mainDynamicStyles(PanelType.WARNING)}
|
|
279
226
|
|
|
280
227
|
.${PanelSharedCssClassName.icon} {
|
|
281
|
-
${iconDynamicStyles(PanelType.WARNING)
|
|
228
|
+
${iconDynamicStyles(PanelType.WARNING)}
|
|
282
229
|
}
|
|
283
230
|
}
|
|
284
231
|
|
|
285
232
|
&[data-panel-type='${PanelType.ERROR}'] {
|
|
286
|
-
${mainDynamicStyles(PanelType.ERROR)
|
|
233
|
+
${mainDynamicStyles(PanelType.ERROR)}
|
|
287
234
|
|
|
288
235
|
.${PanelSharedCssClassName.icon} {
|
|
289
|
-
${iconDynamicStyles(PanelType.ERROR)
|
|
236
|
+
${iconDynamicStyles(PanelType.ERROR)}
|
|
290
237
|
}
|
|
291
238
|
}
|
|
292
239
|
|
|
293
240
|
&[data-panel-type='${PanelType.SUCCESS}'] {
|
|
294
|
-
${mainDynamicStyles(PanelType.SUCCESS)
|
|
241
|
+
${mainDynamicStyles(PanelType.SUCCESS)}
|
|
295
242
|
|
|
296
243
|
.${PanelSharedCssClassName.icon} {
|
|
297
|
-
${iconDynamicStyles(PanelType.SUCCESS)
|
|
244
|
+
${iconDynamicStyles(PanelType.SUCCESS)}
|
|
298
245
|
}
|
|
299
246
|
}
|
|
300
|
-
|
|
301
|
-
&[data-panel-type='${PanelType.CUSTOM}'] {
|
|
302
|
-
${themed({
|
|
303
|
-
dark: getPanelBackgroundDarkModeColors
|
|
304
|
-
})(props)};
|
|
305
|
-
}
|
|
306
247
|
`;
|
|
307
|
-
export const panelSharedStyles =
|
|
248
|
+
export const panelSharedStyles = () => css`
|
|
308
249
|
.${PanelSharedCssClassName.prefix} {
|
|
309
|
-
${panelSharedStylesWithoutPrefix(
|
|
250
|
+
${panelSharedStylesWithoutPrefix()}
|
|
310
251
|
}
|
|
311
252
|
`;
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { akEditorLineHeight } from '@atlaskit/editor-shared-styles';
|
|
3
|
-
import {
|
|
4
|
-
import { themed } from '@atlaskit/theme/components';
|
|
5
|
-
const divider = themed({
|
|
6
|
-
light: `var(--ds-border, ${N30A})`,
|
|
7
|
-
dark: `var(--ds-border, ${DN50})`
|
|
8
|
-
});
|
|
9
|
-
|
|
3
|
+
import { N30A } from '@atlaskit/theme/colors';
|
|
10
4
|
// @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
|
|
11
|
-
export const ruleSharedStyles =
|
|
5
|
+
export const ruleSharedStyles = () => css`
|
|
12
6
|
& hr {
|
|
13
7
|
border: none;
|
|
14
|
-
background-color: ${
|
|
8
|
+
background-color: ${`var(--ds-border, ${N30A})`};
|
|
15
9
|
margin: ${akEditorLineHeight}em 0;
|
|
16
10
|
height: 2px;
|
|
17
11
|
border-radius: 1px;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { ThemeProvider } from '@emotion/react';
|
|
3
3
|
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
4
|
-
import {
|
|
5
|
-
import { CHANNEL, fontSize } from '@atlaskit/theme/constants';
|
|
4
|
+
import { fontSize } from '@atlaskit/theme/constants';
|
|
6
5
|
import { WidthConsumer } from '../WidthProvider';
|
|
7
6
|
export function mapBreakpointToLayoutMaxWidth(breakpoint) {
|
|
8
7
|
switch (breakpoint) {
|
|
@@ -17,17 +16,10 @@ export function BaseThemeWrapper({
|
|
|
17
16
|
baseFontSize,
|
|
18
17
|
children
|
|
19
18
|
}) {
|
|
20
|
-
const {
|
|
21
|
-
mode
|
|
22
|
-
} = useGlobalTheme();
|
|
23
19
|
const memoizedTheme = useMemo(() => ({
|
|
24
20
|
baseFontSize: baseFontSize || fontSize(),
|
|
25
|
-
layoutMaxWidth: akEditorDefaultLayoutWidth
|
|
26
|
-
|
|
27
|
-
[CHANNEL]: {
|
|
28
|
-
mode
|
|
29
|
-
}
|
|
30
|
-
}), [baseFontSize, mode]);
|
|
21
|
+
layoutMaxWidth: akEditorDefaultLayoutWidth
|
|
22
|
+
}), [baseFontSize]);
|
|
31
23
|
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
32
24
|
theme: memoizedTheme
|
|
33
25
|
}, children);
|
|
@@ -4,12 +4,10 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
4
4
|
import { Component } from 'react';
|
|
5
5
|
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
|
-
import {
|
|
8
|
-
import { themed } from '@atlaskit/theme/components';
|
|
9
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
7
|
+
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
10
8
|
import Layer from '../Layer';
|
|
11
9
|
const packageName = "@atlaskit/editor-common";
|
|
12
|
-
const packageVersion = "76.
|
|
10
|
+
const packageVersion = "76.28.0";
|
|
13
11
|
const halfFocusRing = 1;
|
|
14
12
|
const dropOffset = '0, 8';
|
|
15
13
|
class DropList extends Component {
|
|
@@ -26,17 +24,11 @@ class DropList extends Component {
|
|
|
26
24
|
${this.props.shouldFitContainer ? 'display: block; box-sizing: border-box;' : 'display: inline-flex;'}
|
|
27
25
|
`);
|
|
28
26
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
29
|
-
_defineProperty(this, "menuWrapper",
|
|
27
|
+
_defineProperty(this, "menuWrapper", () => {
|
|
30
28
|
return css`
|
|
31
|
-
color: ${
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
})(theme)};
|
|
35
|
-
background-color: ${themed({
|
|
36
|
-
light: `var(--ds-surface-overlay, ${N0})`,
|
|
37
|
-
dark: `var(--ds-surface-overlay, ${DN50})`
|
|
38
|
-
})(theme)};
|
|
39
|
-
border-radius: ${borderRadius()}px;
|
|
29
|
+
color: ${`var(--ds-text, ${N900})`};
|
|
30
|
+
background-color: ${`var(--ds-surface-overlay, ${N0})`};
|
|
31
|
+
border-radius: ${"var(--ds-border-radius, 3px)"};
|
|
40
32
|
box-shadow: ${`var(--ds-shadow-overlay, ${`0 4px 8px calc(-1 * 2px) ${N50A}, 0 0 1px ${N60A}`})`};
|
|
41
33
|
box-sizing: border-box;
|
|
42
34
|
overflow: auto;
|
|
@@ -128,9 +120,7 @@ class DropList extends Component {
|
|
|
128
120
|
id
|
|
129
121
|
} = this.props;
|
|
130
122
|
let layerContent = isOpen ? jsx("div", {
|
|
131
|
-
css:
|
|
132
|
-
theme: theme
|
|
133
|
-
}),
|
|
123
|
+
css: this.menuWrapper,
|
|
134
124
|
"data-role": "droplistContent",
|
|
135
125
|
"data-testid": testId && `${testId}--content`,
|
|
136
126
|
ref: this.handleContentRef,
|
|
@@ -5,8 +5,7 @@ import React, { forwardRef } from 'react';
|
|
|
5
5
|
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import { defineMessages } from 'react-intl-next';
|
|
7
7
|
import { akEditorLineHeight, akEditorSwoopCubicBezier, akLayoutGutterOffset, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
8
|
-
import { B300,
|
|
9
|
-
import { themed } from '@atlaskit/theme/components';
|
|
8
|
+
import { B300, N200, N200A, N300A, N30A, N40A, N50A, N90 } from '@atlaskit/theme/colors';
|
|
10
9
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
11
10
|
import { fontSize, gridSize } from '@atlaskit/theme/constants';
|
|
12
11
|
export const messages = defineMessages({
|
|
@@ -33,31 +32,22 @@ export const messages = defineMessages({
|
|
|
33
32
|
});
|
|
34
33
|
const BORDER_RADIUS = "var(--ds-border-radius-100, 4px)";
|
|
35
34
|
const EXPAND_COLLAPSED_BACKGROUND = "var(--ds-background-neutral-subtle, transparent)";
|
|
36
|
-
const EXPAND_SELECTED_BACKGROUND =
|
|
37
|
-
light: "var(--ds-surface, rgba(255, 255, 255, 0.6))",
|
|
38
|
-
dark: "var(--ds-surface, rgba(9, 10, 11, 0.29))"
|
|
39
|
-
});
|
|
35
|
+
const EXPAND_SELECTED_BACKGROUND = "var(--ds-surface, rgba(255, 255, 255, 0.6))";
|
|
40
36
|
const EXPAND_FOCUSED_BORDER_COLOR = `var(--ds-border-focused, ${B300})`;
|
|
41
37
|
const EXPAND_COLLAPSED_BORDER_COLOR = 'transparent';
|
|
42
|
-
const EXPAND_EXPANDED_BORDER_COLOR =
|
|
43
|
-
light: `var(--ds-border, ${N40A})`,
|
|
44
|
-
dark: `var(--ds-border, ${DN50})`
|
|
45
|
-
});
|
|
38
|
+
const EXPAND_EXPANDED_BORDER_COLOR = `var(--ds-border, ${N40A})`;
|
|
46
39
|
export const ExpandIconWrapper = ({
|
|
47
40
|
children,
|
|
48
41
|
expanded
|
|
49
42
|
}) => {
|
|
50
43
|
return jsx("div", {
|
|
51
|
-
css:
|
|
44
|
+
css: () => expanded ? [expandIconWrapperStyle(), expandIconWrapperExpandedStyle] : expandIconWrapperStyle()
|
|
52
45
|
}, children);
|
|
53
46
|
};
|
|
54
|
-
const expandIconWrapperStyle =
|
|
47
|
+
const expandIconWrapperStyle = () => css`
|
|
55
48
|
cursor: pointer;
|
|
56
49
|
display: flex;
|
|
57
|
-
color: ${
|
|
58
|
-
light: `var(--ds-icon, ${N90})`,
|
|
59
|
-
dark: "var(--ds-icon, #d9dde3)"
|
|
60
|
-
})(props)};
|
|
50
|
+
color: ${`var(--ds-icon, ${N90})`};
|
|
61
51
|
border-radius: ${"var(--ds-border-radius-100, 4px)"};
|
|
62
52
|
width: 24px;
|
|
63
53
|
height: 24px;
|
|
@@ -101,13 +91,13 @@ const containerStyles = styleProps => {
|
|
|
101
91
|
// and is the root level expand.
|
|
102
92
|
const marginHorizontal = styleProps['data-node-type'] === 'expand' ? `-${akLayoutGutterOffset}px` : 0;
|
|
103
93
|
const margin = `${marginTop} ${marginHorizontal} ${marginBottom}`;
|
|
104
|
-
return
|
|
94
|
+
return () => css`
|
|
105
95
|
border-width: 1px;
|
|
106
96
|
border-style: solid;
|
|
107
|
-
border-color: ${focused ? EXPAND_FOCUSED_BORDER_COLOR : expanded ? EXPAND_EXPANDED_BORDER_COLOR
|
|
97
|
+
border-color: ${focused ? EXPAND_FOCUSED_BORDER_COLOR : expanded ? EXPAND_EXPANDED_BORDER_COLOR : EXPAND_COLLAPSED_BORDER_COLOR};
|
|
108
98
|
border-radius: ${BORDER_RADIUS};
|
|
109
99
|
min-height: 25px;
|
|
110
|
-
background: ${!expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND
|
|
100
|
+
background: ${!expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND};
|
|
111
101
|
margin: ${margin};
|
|
112
102
|
|
|
113
103
|
transition: background 0.3s ${akEditorSwoopCubicBezier},
|
|
@@ -118,12 +108,8 @@ const containerStyles = styleProps => {
|
|
|
118
108
|
// TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.
|
|
119
109
|
// This is because the default state already uses the same token and, as such, the hover style won't change anything.
|
|
120
110
|
// https://product-fabric.atlassian.net/browse/DSP-4152
|
|
121
|
-
border: 1px solid
|
|
122
|
-
|
|
123
|
-
light: `var(--ds-border, ${N50A})`,
|
|
124
|
-
dark: `var(--ds-border, ${DN50})`
|
|
125
|
-
})(themeProps)};
|
|
126
|
-
background: ${EXPAND_SELECTED_BACKGROUND(themeProps)};
|
|
111
|
+
border: 1px solid ${`var(--ds-border, ${N50A})`};
|
|
112
|
+
background: ${EXPAND_SELECTED_BACKGROUND};
|
|
127
113
|
}
|
|
128
114
|
|
|
129
115
|
td > :not(style):first-child,
|
|
@@ -132,7 +118,7 @@ const containerStyles = styleProps => {
|
|
|
132
118
|
}
|
|
133
119
|
`;
|
|
134
120
|
};
|
|
135
|
-
const contentStyles = styleProps =>
|
|
121
|
+
const contentStyles = styleProps => () => css`
|
|
136
122
|
padding-top: ${styleProps.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)"};
|
|
137
123
|
padding-right: ${"var(--ds-space-100, 8px)"};
|
|
138
124
|
// TODO: Migrate away from gridSize
|
|
@@ -161,16 +147,13 @@ const contentStyles = styleProps => themeProps => css`
|
|
|
161
147
|
}
|
|
162
148
|
` : ''}
|
|
163
149
|
`;
|
|
164
|
-
const titleInputStyles =
|
|
150
|
+
const titleInputStyles = () => css`
|
|
165
151
|
outline: none;
|
|
166
152
|
border: none;
|
|
167
153
|
font-size: ${relativeFontSizeToBase16(fontSize())};
|
|
168
154
|
line-height: ${akEditorLineHeight};
|
|
169
155
|
font-weight: normal;
|
|
170
|
-
color: ${
|
|
171
|
-
light: `var(--ds-text-subtlest, ${N200A})`,
|
|
172
|
-
dark: `var(--ds-text-subtlest, ${DN600})`
|
|
173
|
-
})(props)};
|
|
156
|
+
color: ${`var(--ds-text-subtlest, ${N200A})`};
|
|
174
157
|
background: transparent;
|
|
175
158
|
display: flex;
|
|
176
159
|
flex: 1;
|
|
@@ -178,17 +161,11 @@ const titleInputStyles = props => css`
|
|
|
178
161
|
width: 100%;
|
|
179
162
|
|
|
180
163
|
&::placeholder {
|
|
181
|
-
opacity:
|
|
182
|
-
|
|
183
|
-
dark: 0.6
|
|
184
|
-
})(props)};
|
|
185
|
-
color: ${themed({
|
|
186
|
-
light: `var(--ds-text-subtlest, ${N200})`,
|
|
187
|
-
dark: `var(--ds-text-subtlest, ${DN600})`
|
|
188
|
-
})(props)};
|
|
164
|
+
opacity: 1;
|
|
165
|
+
color: ${`var(--ds-text-subtlest, ${N200})`};
|
|
189
166
|
}
|
|
190
167
|
`;
|
|
191
|
-
const titleContainerStyles =
|
|
168
|
+
const titleContainerStyles = () => css`
|
|
192
169
|
padding: 0;
|
|
193
170
|
display: flex;
|
|
194
171
|
align-items: flex-start;
|
|
@@ -196,10 +173,7 @@ const titleContainerStyles = props => css`
|
|
|
196
173
|
border: none;
|
|
197
174
|
font-size: ${relativeFontSizeToBase16(fontSize())};
|
|
198
175
|
width: 100%;
|
|
199
|
-
color: ${
|
|
200
|
-
light: `var(--ds-text-subtle, ${N300A})`,
|
|
201
|
-
dark: `var(--ds-text-subtle, ${DN600})`
|
|
202
|
-
})(props)};
|
|
176
|
+
color: ${`var(--ds-text-subtle, ${N300A})`};
|
|
203
177
|
overflow: hidden;
|
|
204
178
|
cursor: pointer;
|
|
205
179
|
|
|
@@ -11,8 +11,8 @@ const errorColor = css`
|
|
|
11
11
|
const validColor = css`
|
|
12
12
|
color: ${`var(--ds-text-success, ${G400})`};
|
|
13
13
|
`;
|
|
14
|
-
const messageStyle =
|
|
15
|
-
${h200(
|
|
14
|
+
const messageStyle = () => css`
|
|
15
|
+
${h200()} font-weight: normal;
|
|
16
16
|
color: ${`var(--ds-text-subtlest, ${N200})`};
|
|
17
17
|
margin-top: ${"var(--ds-space-050, 4px)"};
|
|
18
18
|
display: flex;
|
|
@@ -30,8 +30,8 @@ export const HelperMessage = ({
|
|
|
30
30
|
export const ErrorMessage = ({
|
|
31
31
|
children
|
|
32
32
|
}) => jsx("div", {
|
|
33
|
-
css:
|
|
34
|
-
return [messageStyle(
|
|
33
|
+
css: () => {
|
|
34
|
+
return [messageStyle(), errorColor];
|
|
35
35
|
}
|
|
36
36
|
}, jsx("span", {
|
|
37
37
|
css: iconWrapperStyle
|
|
@@ -43,8 +43,8 @@ export const ErrorMessage = ({
|
|
|
43
43
|
export const ValidMessage = ({
|
|
44
44
|
children
|
|
45
45
|
}) => jsx("div", {
|
|
46
|
-
css:
|
|
47
|
-
return [messageStyle(
|
|
46
|
+
css: () => {
|
|
47
|
+
return [messageStyle(), validColor];
|
|
48
48
|
}
|
|
49
49
|
}, jsx("span", {
|
|
50
50
|
css: iconWrapperStyle
|