@atlaskit/editor-shared-styles 2.1.2 → 2.1.5
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 +20 -0
- package/dist/cjs/selection/utils.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/selection/utils.js +21 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/selection/utils.js +3 -3
- package/dist/esm/version.json +1 -1
- package/package.json +3 -3
- package/report.api.md +260 -0
- package/src/selection/__tests__/unit/utils.ts +1 -1
- package/src/selection/utils.ts +22 -2
- package/tsconfig.json +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-shared-styles
|
|
2
2
|
|
|
3
|
+
## 2.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a6df7e823d8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a6df7e823d8) - [ux] Fixed trello card overflow issue in table cells & fixed merged table cells selection / hover state
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 2.1.4
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
|
|
15
|
+
|
|
16
|
+
## 2.1.3
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`450a17a332a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/450a17a332a) - [ux] ED-14654: Lower z-index values on editor elements so they do not stick out of the editor and interfere with consuming products
|
|
21
|
+
- [`30c74c32783`](https://bitbucket.org/atlassian/atlassian-frontend/commits/30c74c32783) - [ux] ED-15234: reverts ED-14654 because causing header zindex issues
|
|
22
|
+
|
|
3
23
|
## 2.1.2
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -34,7 +34,7 @@ exports.hideNativeBrowserTextSelectionStyles = hideNativeBrowserTextSelectionSty
|
|
|
34
34
|
var getSelectionStyle = function getSelectionStyle(style) {
|
|
35
35
|
switch (style) {
|
|
36
36
|
case _types.SelectionStyle.Border:
|
|
37
|
-
return "border: ".concat(_consts.akEditorSelectedBorder, "
|
|
37
|
+
return "\n border: ".concat(_consts.akEditorSelectedBorder, ";\n\n // Fixes ED-15246: Trello card is visible through a border of a table border\n &::after {\n height: 100%;\n content: '\\00a0';\n background: ").concat(_consts.akEditorSelectedBorderColor, ";\n position: absolute;\n right: -1px;\n top: 0;\n bottom: 0;\n width: 1px;\n border: none;\n display: inline-block;\n }\n ");
|
|
38
38
|
|
|
39
39
|
case _types.SelectionStyle.BoxShadow:
|
|
40
40
|
return "\n box-shadow: ".concat(_consts.akEditorSelectedBoxShadow, ";\n border-color: transparent;\n ");
|
|
@@ -43,7 +43,7 @@ var getSelectionStyle = function getSelectionStyle(style) {
|
|
|
43
43
|
return "background-color: ".concat((0, _tokens.token)('color.background.selected', _consts.akEditorSelectedBgColor), ";");
|
|
44
44
|
|
|
45
45
|
case _types.SelectionStyle.Blanket:
|
|
46
|
-
return "\n position: relative;\n\n // Fixes ED-9263, where emoji or inline card in panel makes selection go outside the panel\n // in Safari. Looks like it's caused by user-select: all in the emoji element\n -webkit-user-select: text;\n\n ::
|
|
46
|
+
return "\n position: relative;\n\n // Fixes ED-9263, where emoji or inline card in panel makes selection go outside the panel\n // in Safari. Looks like it's caused by user-select: all in the emoji element\n -webkit-user-select: text;\n\n ::before {\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n pointer-events: none;\n z-index: ".concat(_consts.akEditorSmallZIndex, ";\n background-color: ").concat((0, _tokens.token)('color.blanket.selected', '#B3D4FF4C'), "\n }");
|
|
47
47
|
|
|
48
48
|
default:
|
|
49
49
|
return '';
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { token } from '@atlaskit/tokens';
|
|
2
|
-
import { akEditorSelectedBgColor, akEditorSelectedBorder, akEditorSelectedBoxShadow } from '../consts';
|
|
2
|
+
import { akEditorSelectedBgColor, akEditorSelectedBorder, akEditorSelectedBorderColor, akEditorSelectedBoxShadow, akEditorSmallZIndex } from '../consts';
|
|
3
3
|
import { SelectionStyle } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* Adds correct selection styling for a node
|
|
@@ -25,7 +25,23 @@ export const hideNativeBrowserTextSelectionStyles = `
|
|
|
25
25
|
const getSelectionStyle = style => {
|
|
26
26
|
switch (style) {
|
|
27
27
|
case SelectionStyle.Border:
|
|
28
|
-
return `
|
|
28
|
+
return `
|
|
29
|
+
border: ${akEditorSelectedBorder};
|
|
30
|
+
|
|
31
|
+
// Fixes ED-15246: Trello card is visible through a border of a table border
|
|
32
|
+
&::after {
|
|
33
|
+
height: 100%;
|
|
34
|
+
content: '\\00a0';
|
|
35
|
+
background: ${akEditorSelectedBorderColor};
|
|
36
|
+
position: absolute;
|
|
37
|
+
right: -1px;
|
|
38
|
+
top: 0;
|
|
39
|
+
bottom: 0;
|
|
40
|
+
width: 1px;
|
|
41
|
+
border: none;
|
|
42
|
+
display: inline-block;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
29
45
|
|
|
30
46
|
case SelectionStyle.BoxShadow:
|
|
31
47
|
return `
|
|
@@ -44,14 +60,16 @@ const getSelectionStyle = style => {
|
|
|
44
60
|
// in Safari. Looks like it's caused by user-select: all in the emoji element
|
|
45
61
|
-webkit-user-select: text;
|
|
46
62
|
|
|
47
|
-
::
|
|
63
|
+
::before {
|
|
48
64
|
position: absolute;
|
|
49
65
|
content: '';
|
|
50
66
|
left: 0;
|
|
51
67
|
right: 0;
|
|
52
68
|
top: 0;
|
|
53
69
|
bottom: 0;
|
|
70
|
+
width: 100%;
|
|
54
71
|
pointer-events: none;
|
|
72
|
+
z-index: ${akEditorSmallZIndex};
|
|
55
73
|
background-color: ${token('color.blanket.selected', '#B3D4FF4C')}
|
|
56
74
|
}`;
|
|
57
75
|
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { token } from '@atlaskit/tokens';
|
|
2
|
-
import { akEditorSelectedBgColor, akEditorSelectedBorder, akEditorSelectedBoxShadow } from '../consts';
|
|
2
|
+
import { akEditorSelectedBgColor, akEditorSelectedBorder, akEditorSelectedBorderColor, akEditorSelectedBoxShadow, akEditorSmallZIndex } from '../consts';
|
|
3
3
|
import { SelectionStyle } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* Adds correct selection styling for a node
|
|
@@ -22,7 +22,7 @@ export var hideNativeBrowserTextSelectionStyles = "\n ::selection,*::selection
|
|
|
22
22
|
var getSelectionStyle = function getSelectionStyle(style) {
|
|
23
23
|
switch (style) {
|
|
24
24
|
case SelectionStyle.Border:
|
|
25
|
-
return "border: ".concat(akEditorSelectedBorder, "
|
|
25
|
+
return "\n border: ".concat(akEditorSelectedBorder, ";\n\n // Fixes ED-15246: Trello card is visible through a border of a table border\n &::after {\n height: 100%;\n content: '\\00a0';\n background: ").concat(akEditorSelectedBorderColor, ";\n position: absolute;\n right: -1px;\n top: 0;\n bottom: 0;\n width: 1px;\n border: none;\n display: inline-block;\n }\n ");
|
|
26
26
|
|
|
27
27
|
case SelectionStyle.BoxShadow:
|
|
28
28
|
return "\n box-shadow: ".concat(akEditorSelectedBoxShadow, ";\n border-color: transparent;\n ");
|
|
@@ -31,7 +31,7 @@ var getSelectionStyle = function getSelectionStyle(style) {
|
|
|
31
31
|
return "background-color: ".concat(token('color.background.selected', akEditorSelectedBgColor), ";");
|
|
32
32
|
|
|
33
33
|
case SelectionStyle.Blanket:
|
|
34
|
-
return "\n position: relative;\n\n // Fixes ED-9263, where emoji or inline card in panel makes selection go outside the panel\n // in Safari. Looks like it's caused by user-select: all in the emoji element\n -webkit-user-select: text;\n\n ::
|
|
34
|
+
return "\n position: relative;\n\n // Fixes ED-9263, where emoji or inline card in panel makes selection go outside the panel\n // in Safari. Looks like it's caused by user-select: all in the emoji element\n -webkit-user-select: text;\n\n ::before {\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n pointer-events: none;\n z-index: ".concat(akEditorSmallZIndex, ";\n background-color: ").concat(token('color.blanket.selected', '#B3D4FF4C'), "\n }");
|
|
35
35
|
|
|
36
36
|
default:
|
|
37
37
|
return '';
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-shared-styles",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
4
4
|
"description": "Style values used in the editor/renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
".": "./src/index.ts"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@atlaskit/theme": "^12.
|
|
28
|
+
"@atlaskit/theme": "^12.2.0",
|
|
29
29
|
"@atlaskit/tokens": "^0.10.0",
|
|
30
30
|
"@babel/runtime": "^7.0.0",
|
|
31
31
|
"@emotion/react": "^11.7.1"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"peerDependencies": {},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
36
|
-
"typescript": "4.
|
|
36
|
+
"typescript": "4.3.5"
|
|
37
37
|
},
|
|
38
38
|
"techstack": {
|
|
39
39
|
"@atlassian/frontend": {
|
package/report.api.md
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/editor-shared-styles"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { SerializedStyles } from '@emotion/react';
|
|
7
|
+
|
|
8
|
+
export declare const akEditorActiveBackground = '#42526E';
|
|
9
|
+
|
|
10
|
+
export declare const akEditorActiveForeground = '#FFFFFF';
|
|
11
|
+
|
|
12
|
+
export declare const akEditorBlockquoteBorderColor = '#DFE1E6';
|
|
13
|
+
|
|
14
|
+
export declare const akEditorBreakoutPadding = 96;
|
|
15
|
+
|
|
16
|
+
export declare const akEditorCodeBackground = '#F4F5F7';
|
|
17
|
+
|
|
18
|
+
export declare const akEditorCodeBlockPadding = '12px';
|
|
19
|
+
|
|
20
|
+
export declare const akEditorCodeFontFamily: string;
|
|
21
|
+
|
|
22
|
+
export declare const akEditorCodeInlinePadding = '2px 4px';
|
|
23
|
+
|
|
24
|
+
export declare const akEditorContextPanelWidth = 320;
|
|
25
|
+
|
|
26
|
+
export declare const akEditorDefaultLayoutWidth = 760;
|
|
27
|
+
|
|
28
|
+
export declare const akEditorDeleteBackground = '#FFEBE6';
|
|
29
|
+
|
|
30
|
+
export declare const akEditorDeleteBackgroundShaded = '#FFEBE6';
|
|
31
|
+
|
|
32
|
+
export declare const akEditorDeleteBackgroundWithOpacity =
|
|
33
|
+
'rgba(255, 189, 173, 0.5)';
|
|
34
|
+
|
|
35
|
+
export declare const akEditorDeleteBorder = '#FF5630';
|
|
36
|
+
|
|
37
|
+
export declare const akEditorDeleteIconColor = '#DE350B';
|
|
38
|
+
|
|
39
|
+
export declare const akEditorDropdownActiveBackground = '#091E42';
|
|
40
|
+
|
|
41
|
+
export declare const akEditorFloatingDialogZIndex: number;
|
|
42
|
+
|
|
43
|
+
export declare const akEditorFloatingOverlapPanelZIndex: number;
|
|
44
|
+
|
|
45
|
+
export declare const akEditorFloatingPanelZIndex: 400;
|
|
46
|
+
|
|
47
|
+
export declare const akEditorFocus = '#4C9AFF';
|
|
48
|
+
|
|
49
|
+
export declare const akEditorFullPageDefaultFontSize = 16;
|
|
50
|
+
|
|
51
|
+
export declare const akEditorFullPageMaxWidth = 680;
|
|
52
|
+
|
|
53
|
+
export declare const akEditorFullWidthLayoutLineLength = 1792;
|
|
54
|
+
|
|
55
|
+
export declare const akEditorFullWidthLayoutWidth = 1800;
|
|
56
|
+
|
|
57
|
+
export declare const akEditorGridLineZIndex = 9999;
|
|
58
|
+
|
|
59
|
+
export declare const akEditorGutterPadding = 32;
|
|
60
|
+
|
|
61
|
+
export declare const akEditorInactiveForeground = '#42526E';
|
|
62
|
+
|
|
63
|
+
export declare const akEditorLineHeight = 1.714;
|
|
64
|
+
|
|
65
|
+
export declare const akEditorMediaResizeHandlerPadding = 4;
|
|
66
|
+
|
|
67
|
+
export declare const akEditorMediaResizeHandlerPaddingWide = 12;
|
|
68
|
+
|
|
69
|
+
export declare const akEditorMentionSelected = '#7A869A';
|
|
70
|
+
|
|
71
|
+
export declare const akEditorMenuZIndex: 500;
|
|
72
|
+
|
|
73
|
+
export declare const akEditorMobileBreakoutPoint = 720;
|
|
74
|
+
|
|
75
|
+
export declare const akEditorMobileMaxWidth = 0;
|
|
76
|
+
|
|
77
|
+
export declare const akEditorPopupBackground = '#253858';
|
|
78
|
+
|
|
79
|
+
export declare const akEditorPopupText = '#DEEBFF';
|
|
80
|
+
|
|
81
|
+
export declare const akEditorPrimaryButton = '#0052CC';
|
|
82
|
+
|
|
83
|
+
export declare const akEditorRuleBackground = '#EBECF0';
|
|
84
|
+
|
|
85
|
+
export declare const akEditorRuleBorderRadius = '1px';
|
|
86
|
+
|
|
87
|
+
export declare const akEditorSelectedBgColor = '#DEEBFF';
|
|
88
|
+
|
|
89
|
+
export declare const akEditorSelectedBlanketColor = '#B3D4FF';
|
|
90
|
+
|
|
91
|
+
export declare const akEditorSelectedBlanketOpacity = 0.3;
|
|
92
|
+
|
|
93
|
+
export declare const akEditorSelectedBorder: string;
|
|
94
|
+
|
|
95
|
+
export declare const akEditorSelectedBorderBoldSize = 2;
|
|
96
|
+
|
|
97
|
+
export declare const akEditorSelectedBorderColor = '#0065FF';
|
|
98
|
+
|
|
99
|
+
export declare const akEditorSelectedBorderSize = 1;
|
|
100
|
+
|
|
101
|
+
export declare const akEditorSelectedBoxShadow: string;
|
|
102
|
+
|
|
103
|
+
export declare const akEditorSelectedIconColor = '#0052CC';
|
|
104
|
+
|
|
105
|
+
export declare const akEditorSelectedNodeClassName = 'ak-editor-selected-node';
|
|
106
|
+
|
|
107
|
+
export declare const akEditorShadowZIndex = 2;
|
|
108
|
+
|
|
109
|
+
export declare const akEditorSmallZIndex: number;
|
|
110
|
+
|
|
111
|
+
export declare const akEditorStickyHeaderZIndex = 11;
|
|
112
|
+
|
|
113
|
+
export declare const akEditorSubtleAccent = '#DFE1E6';
|
|
114
|
+
|
|
115
|
+
export declare const akEditorSwoopCubicBezier = 'cubic-bezier(0.15, 1, 0.3, 1)';
|
|
116
|
+
|
|
117
|
+
export declare const akEditorTableBorder = '#C1C7D0';
|
|
118
|
+
|
|
119
|
+
export declare const akEditorTableBorderDark = '#3B475C';
|
|
120
|
+
|
|
121
|
+
export declare const akEditorTableBorderDelete = '#FF5630';
|
|
122
|
+
|
|
123
|
+
export declare const akEditorTableBorderRadius = '3px';
|
|
124
|
+
|
|
125
|
+
export declare const akEditorTableBorderSelected = '#0065FF';
|
|
126
|
+
|
|
127
|
+
export declare const akEditorTableCellBackgroundOpacity = 0.5;
|
|
128
|
+
|
|
129
|
+
export declare const akEditorTableCellDelete = '#FFEBE6';
|
|
130
|
+
|
|
131
|
+
export declare const akEditorTableCellMinWidth = 48;
|
|
132
|
+
|
|
133
|
+
export declare const akEditorTableCellSelected = '#B3D4FF';
|
|
134
|
+
|
|
135
|
+
export declare const akEditorTableFloatingControls = '#F4F5F7';
|
|
136
|
+
|
|
137
|
+
export declare const akEditorTableLegacyCellMinWidth = 128;
|
|
138
|
+
|
|
139
|
+
export declare const akEditorTableNumberColumnWidth = 42;
|
|
140
|
+
|
|
141
|
+
export declare const akEditorTableToolbar = '#F4F5F7';
|
|
142
|
+
|
|
143
|
+
export declare const akEditorTableToolbarDark = '#283447';
|
|
144
|
+
|
|
145
|
+
export declare const akEditorTableToolbarDelete = '#FFBDAD';
|
|
146
|
+
|
|
147
|
+
export declare const akEditorTableToolbarSelected = '#4C9AFF';
|
|
148
|
+
|
|
149
|
+
export declare const akEditorTableToolbarSize = 11;
|
|
150
|
+
|
|
151
|
+
export declare const akEditorToolbarKeylineHeight = 2;
|
|
152
|
+
|
|
153
|
+
export declare const akEditorUnitZIndex = 1;
|
|
154
|
+
|
|
155
|
+
export declare const akEditorWideLayoutWidth = 960;
|
|
156
|
+
|
|
157
|
+
export declare const akLayoutGutterOffset: number;
|
|
158
|
+
|
|
159
|
+
export declare const akRichMediaResizeZIndex: number;
|
|
160
|
+
|
|
161
|
+
export declare const ATLASSIAN_NAVIGATION_HEIGHT = '56px';
|
|
162
|
+
|
|
163
|
+
export declare const blockNodesVerticalMargin = '0.75rem';
|
|
164
|
+
|
|
165
|
+
export declare const breakoutWideScaleRatio = 1.33;
|
|
166
|
+
|
|
167
|
+
export declare const DEFAULT_EMBED_CARD_HEIGHT = 480;
|
|
168
|
+
|
|
169
|
+
export declare const DEFAULT_EMBED_CARD_WIDTH = 680;
|
|
170
|
+
|
|
171
|
+
export declare const editorFontSize: ({
|
|
172
|
+
theme,
|
|
173
|
+
}: {
|
|
174
|
+
theme: EditorTheme;
|
|
175
|
+
}) => number;
|
|
176
|
+
|
|
177
|
+
export declare type EditorTheme = {
|
|
178
|
+
baseFontSize?: number;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Adds correct selection styling for a node
|
|
183
|
+
* Pass in which selection style properties you want and it will return css string of necessary styles
|
|
184
|
+
*
|
|
185
|
+
* eg.
|
|
186
|
+
* .expand.ak-editor-selected-node {
|
|
187
|
+
* ${getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket])}
|
|
188
|
+
* }
|
|
189
|
+
*
|
|
190
|
+
*/
|
|
191
|
+
export declare const getSelectionStyles: (
|
|
192
|
+
selectionStyles: Array<SelectionStyle>,
|
|
193
|
+
) => string;
|
|
194
|
+
|
|
195
|
+
export declare const getTableCellBackgroundDarkModeColors: string;
|
|
196
|
+
|
|
197
|
+
export declare const gridMediumMaxWidth = 1024;
|
|
198
|
+
|
|
199
|
+
export declare const hideNativeBrowserTextSelectionStyles =
|
|
200
|
+
'\n ::selection,*::selection {\n background-color: transparent;\n }\n ::-moz-selection,*::-moz-selection {\n background-color: transparent;\n }\n';
|
|
201
|
+
|
|
202
|
+
export declare const overflowShadow: ({
|
|
203
|
+
background,
|
|
204
|
+
width,
|
|
205
|
+
}: {
|
|
206
|
+
background: string;
|
|
207
|
+
width: string;
|
|
208
|
+
}) => SerializedStyles;
|
|
209
|
+
|
|
210
|
+
export declare const relativeFontSizeToBase16: (px: number | string) => string;
|
|
211
|
+
|
|
212
|
+
export declare const relativeSize: (
|
|
213
|
+
multiplier: number,
|
|
214
|
+
) => ({ theme }: { theme: EditorTheme }) => number;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* These are generic selection styles for all nodes
|
|
218
|
+
* If you have custom behaviour needed for a node, add that in the plugin's styles
|
|
219
|
+
* file in editor-core
|
|
220
|
+
*/
|
|
221
|
+
export declare enum SelectionStyle {
|
|
222
|
+
Border = 0,
|
|
223
|
+
BoxShadow = 1,
|
|
224
|
+
Background = 2,
|
|
225
|
+
Blanket = 3,
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export declare const VIEWPORT_SIZES: {
|
|
229
|
+
laptopHiDPI: {
|
|
230
|
+
width: number;
|
|
231
|
+
height: number;
|
|
232
|
+
};
|
|
233
|
+
laptopMDPI: {
|
|
234
|
+
width: number;
|
|
235
|
+
height: number;
|
|
236
|
+
};
|
|
237
|
+
tabletL: {
|
|
238
|
+
width: number;
|
|
239
|
+
height: number;
|
|
240
|
+
};
|
|
241
|
+
tabletS: {
|
|
242
|
+
width: number;
|
|
243
|
+
height: number;
|
|
244
|
+
};
|
|
245
|
+
mobileM: {
|
|
246
|
+
width: number;
|
|
247
|
+
height: number;
|
|
248
|
+
};
|
|
249
|
+
mobileS: {
|
|
250
|
+
width: number;
|
|
251
|
+
height: number;
|
|
252
|
+
};
|
|
253
|
+
mobileXS: {
|
|
254
|
+
width: number;
|
|
255
|
+
height: number;
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
export {};
|
|
260
|
+
```
|
|
@@ -15,7 +15,7 @@ describe('selection plugin: utils', () => {
|
|
|
15
15
|
style: SelectionStyle.Background,
|
|
16
16
|
regex: /background\-color\:/,
|
|
17
17
|
},
|
|
18
|
-
{ name: 'blanket', style: SelectionStyle.Blanket, regex: /\:\:
|
|
18
|
+
{ name: 'blanket', style: SelectionStyle.Blanket, regex: /\:\:before/ },
|
|
19
19
|
];
|
|
20
20
|
|
|
21
21
|
for (const selectionStyle of selectionStyles) {
|
package/src/selection/utils.ts
CHANGED
|
@@ -3,7 +3,9 @@ import { token } from '@atlaskit/tokens';
|
|
|
3
3
|
import {
|
|
4
4
|
akEditorSelectedBgColor,
|
|
5
5
|
akEditorSelectedBorder,
|
|
6
|
+
akEditorSelectedBorderColor,
|
|
6
7
|
akEditorSelectedBoxShadow,
|
|
8
|
+
akEditorSmallZIndex,
|
|
7
9
|
} from '../consts';
|
|
8
10
|
|
|
9
11
|
import { SelectionStyle } from './types';
|
|
@@ -38,7 +40,23 @@ export const hideNativeBrowserTextSelectionStyles = `
|
|
|
38
40
|
const getSelectionStyle = (style: SelectionStyle): string => {
|
|
39
41
|
switch (style) {
|
|
40
42
|
case SelectionStyle.Border:
|
|
41
|
-
return `
|
|
43
|
+
return `
|
|
44
|
+
border: ${akEditorSelectedBorder};
|
|
45
|
+
|
|
46
|
+
// Fixes ED-15246: Trello card is visible through a border of a table border
|
|
47
|
+
&::after {
|
|
48
|
+
height: 100%;
|
|
49
|
+
content: '\\00a0';
|
|
50
|
+
background: ${akEditorSelectedBorderColor};
|
|
51
|
+
position: absolute;
|
|
52
|
+
right: -1px;
|
|
53
|
+
top: 0;
|
|
54
|
+
bottom: 0;
|
|
55
|
+
width: 1px;
|
|
56
|
+
border: none;
|
|
57
|
+
display: inline-block;
|
|
58
|
+
}
|
|
59
|
+
`;
|
|
42
60
|
case SelectionStyle.BoxShadow:
|
|
43
61
|
return `
|
|
44
62
|
box-shadow: ${akEditorSelectedBoxShadow};
|
|
@@ -57,14 +75,16 @@ const getSelectionStyle = (style: SelectionStyle): string => {
|
|
|
57
75
|
// in Safari. Looks like it's caused by user-select: all in the emoji element
|
|
58
76
|
-webkit-user-select: text;
|
|
59
77
|
|
|
60
|
-
::
|
|
78
|
+
::before {
|
|
61
79
|
position: absolute;
|
|
62
80
|
content: '';
|
|
63
81
|
left: 0;
|
|
64
82
|
right: 0;
|
|
65
83
|
top: 0;
|
|
66
84
|
bottom: 0;
|
|
85
|
+
width: 100%;
|
|
67
86
|
pointer-events: none;
|
|
87
|
+
z-index: ${akEditorSmallZIndex};
|
|
68
88
|
background-color: ${token('color.blanket.selected', '#B3D4FF4C')}
|
|
69
89
|
}`;
|
|
70
90
|
default:
|