@atlaskit/editor-core 207.11.0 → 207.11.2
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 +22 -0
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +23 -63
- package/dist/cjs/ui/EditorContentContainer/styles/emoji.js +61 -0
- package/dist/cjs/ui/EditorContentContainer/styles/mentions.js +107 -0
- package/dist/cjs/ui/EditorContentContainer/styles/resizerStyles.js +54 -5
- package/dist/cjs/ui/EditorContentContainer/styles/telepointerStyles.js +207 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +24 -151
- package/dist/es2019/ui/EditorContentContainer/styles/emoji.js +74 -0
- package/dist/es2019/ui/EditorContentContainer/styles/mentions.js +115 -0
- package/dist/es2019/ui/EditorContentContainer/styles/resizerStyles.js +54 -5
- package/dist/es2019/ui/EditorContentContainer/styles/telepointerStyles.js +200 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +23 -63
- package/dist/esm/ui/EditorContentContainer/styles/emoji.js +53 -0
- package/dist/esm/ui/EditorContentContainer/styles/mentions.js +100 -0
- package/dist/esm/ui/EditorContentContainer/styles/resizerStyles.js +54 -5
- package/dist/esm/ui/EditorContentContainer/styles/telepointerStyles.js +200 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/EditorContentContainer/EditorContentContainer.d.ts +0 -1
- package/dist/types/ui/EditorContentContainer/styles/emoji.d.ts +2 -0
- package/dist/types/ui/EditorContentContainer/styles/mentions.d.ts +3 -0
- package/dist/types/ui/EditorContentContainer/styles/telepointerStyles.d.ts +3 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/EditorContentContainer.d.ts +0 -1
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/emoji.d.ts +2 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/mentions.d.ts +3 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/telepointerStyles.d.ts +3 -0
- package/package.json +12 -11
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.telepointerStyleWithInitialOnly = exports.telepointerStyle = exports.telepointerColorAndCommonStyle = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors */
|
|
9
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-exported-styles */
|
|
10
|
+
/* eslint-disable @atlaskit/ui-styling-standard/use-compiled */
|
|
11
|
+
|
|
12
|
+
var pulseIn = (0, _react.keyframes)({
|
|
13
|
+
'0%, 100%': {
|
|
14
|
+
transform: 'scaleX(0)',
|
|
15
|
+
opacity: 0
|
|
16
|
+
},
|
|
17
|
+
'13%': {
|
|
18
|
+
transform: 'scaleX(1.4) scaleY(1.4)',
|
|
19
|
+
opacity: 1
|
|
20
|
+
},
|
|
21
|
+
'20%, 85%': {
|
|
22
|
+
transform: 'scaleX(1) scaleY(1)',
|
|
23
|
+
opacity: 1
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
var pulseOut = (0, _react.keyframes)({
|
|
27
|
+
'0%, 90%, 100%': {
|
|
28
|
+
transform: 'scaleX(1)',
|
|
29
|
+
opacity: 1
|
|
30
|
+
},
|
|
31
|
+
'10%, 80%': {
|
|
32
|
+
transform: 'scaleX(0)',
|
|
33
|
+
opacity: 0
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
var telepointerColorAndCommonStyle = exports.telepointerColorAndCommonStyle = (0, _react.css)({
|
|
37
|
+
'.ProseMirror .telepointer': {
|
|
38
|
+
position: 'relative',
|
|
39
|
+
transition: 'opacity 200ms',
|
|
40
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
41
|
+
'&.telepointer-selection:not(.inlineNodeView)': {
|
|
42
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
43
|
+
lineHeight: 1.2,
|
|
44
|
+
pointerEvents: 'none',
|
|
45
|
+
userSelect: 'none'
|
|
46
|
+
},
|
|
47
|
+
'&.telepointer-dim': {
|
|
48
|
+
opacity: 0.2
|
|
49
|
+
},
|
|
50
|
+
'&.color-0': {
|
|
51
|
+
'--telepointer-participant-text-color': "var(--ds-text-inverse, #FFFFFF)",
|
|
52
|
+
'--telepointer-participant-bg-color': "var(--ds-background-accent-red-bolder, #C9372C)"
|
|
53
|
+
},
|
|
54
|
+
'&.color-1': {
|
|
55
|
+
'--telepointer-participant-text-color': "var(--ds-text-inverse, #FFFFFF)",
|
|
56
|
+
'--telepointer-participant-bg-color': "var(--ds-background-accent-blue-bolder, #0C66E4)"
|
|
57
|
+
},
|
|
58
|
+
'&.color-2': {
|
|
59
|
+
'--telepointer-participant-text-color': "var(--ds-text-inverse, #FFFFFF)",
|
|
60
|
+
'--telepointer-participant-bg-color': "var(--ds-background-accent-green-bolder, #1F845A)"
|
|
61
|
+
},
|
|
62
|
+
'&.color-3': {
|
|
63
|
+
'--telepointer-participant-text-color': "var(--ds-text-inverse, #FFFFFF)",
|
|
64
|
+
'--telepointer-participant-bg-color': "var(--ds-background-accent-yellow-bolder, #946F00)"
|
|
65
|
+
},
|
|
66
|
+
'&.color-4': {
|
|
67
|
+
'--telepointer-participant-text-color': "var(--ds-text-inverse, #FFFFFF)",
|
|
68
|
+
'--telepointer-participant-bg-color': "var(--ds-background-accent-purple-bolder, #6E5DC6)"
|
|
69
|
+
},
|
|
70
|
+
'&.color-5': {
|
|
71
|
+
'--telepointer-participant-text-color': "var(--ds-text-inverse, #FFFFFF)",
|
|
72
|
+
'--telepointer-participant-bg-color': "var(--ds-background-accent-magenta-bolder, #AE4787)"
|
|
73
|
+
},
|
|
74
|
+
'&.color-6': {
|
|
75
|
+
'--telepointer-participant-text-color': "var(--ds-text-inverse, #FFFFFF)",
|
|
76
|
+
'--telepointer-participant-bg-color': "var(--ds-background-accent-teal-bolder, #227D9B)"
|
|
77
|
+
},
|
|
78
|
+
'&.color-7': {
|
|
79
|
+
'--telepointer-participant-text-color': "var(--ds-text-inverse, #FFFFFF)",
|
|
80
|
+
'--telepointer-participant-bg-color': "var(--ds-background-accent-orange-bolder, #C25100)"
|
|
81
|
+
},
|
|
82
|
+
'&.color-8': {
|
|
83
|
+
'--telepointer-participant-text-color': "var(--ds-text-inverse, #FFFFFF)",
|
|
84
|
+
'--telepointer-participant-bg-color': "var(--ds-background-accent-lime-bolder, #5B7F24)"
|
|
85
|
+
},
|
|
86
|
+
'&.color-9': {
|
|
87
|
+
'--telepointer-participant-text-color': "var(--ds-text-inverse, #FFFFFF)",
|
|
88
|
+
'--telepointer-participant-bg-color': "var(--ds-background-accent-gray-bolder, #626F86)"
|
|
89
|
+
},
|
|
90
|
+
'&.color-10': {
|
|
91
|
+
'--telepointer-participant-text-color': "var(--ds-text-accent-gray-bolder, #091E42)",
|
|
92
|
+
'--telepointer-participant-bg-color': "var(--ds-background-accent-blue-subtle, #579DFF)"
|
|
93
|
+
},
|
|
94
|
+
'&.color-11': {
|
|
95
|
+
'--telepointer-participant-text-color': "var(--ds-text-accent-gray-bolder, #091E42)",
|
|
96
|
+
'--telepointer-participant-bg-color': "var(--ds-background-accent-red-subtle, #F87168)"
|
|
97
|
+
},
|
|
98
|
+
'&.color-12': {
|
|
99
|
+
'--telepointer-participant-text-color': "var(--ds-text-accent-gray-bolder, #091E42)",
|
|
100
|
+
'--telepointer-participant-bg-color': "var(--ds-background-accent-orange-subtle, #FEA362)"
|
|
101
|
+
},
|
|
102
|
+
'&.color-13': {
|
|
103
|
+
'--telepointer-participant-text-color': "var(--ds-text-accent-gray-bolder, #091E42)",
|
|
104
|
+
'--telepointer-participant-bg-color': "var(--ds-background-accent-yellow-subtle, #F5CD47)"
|
|
105
|
+
},
|
|
106
|
+
'&.color-14': {
|
|
107
|
+
'--telepointer-participant-text-color': "var(--ds-text-accent-gray-bolder, #091E42)",
|
|
108
|
+
'--telepointer-participant-bg-color': "var(--ds-background-accent-green-subtle, #4BCE97)"
|
|
109
|
+
},
|
|
110
|
+
'&.color-15': {
|
|
111
|
+
'--telepointer-participant-text-color': "var(--ds-text-accent-gray-bolder, #091E42)",
|
|
112
|
+
'--telepointer-participant-bg-color': "var(--ds-background-accent-teal-subtle, #6CC3E0)"
|
|
113
|
+
},
|
|
114
|
+
'&.color-16': {
|
|
115
|
+
'--telepointer-participant-text-color': "var(--ds-text-accent-gray-bolder, #091E42)",
|
|
116
|
+
'--telepointer-participant-bg-color': "var(--ds-background-accent-purple-subtle, #9F8FEF)"
|
|
117
|
+
},
|
|
118
|
+
'&.color-17': {
|
|
119
|
+
'--telepointer-participant-text-color': "var(--ds-text-accent-gray-bolder, #091E42)",
|
|
120
|
+
'--telepointer-participant-bg-color': "var(--ds-background-accent-magenta-subtle, #E774BB)"
|
|
121
|
+
},
|
|
122
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
123
|
+
'html:not([data-color-mode=dark]) &': {
|
|
124
|
+
'--telepointer-participant-background-first-stop': '-850000%',
|
|
125
|
+
'--telepointer-participant-background-second-stop': '150000%'
|
|
126
|
+
},
|
|
127
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
128
|
+
'html[data-color-mode=dark] &': {
|
|
129
|
+
'--telepointer-participant-background-first-stop': '-800000%',
|
|
130
|
+
'--telepointer-participant-background-second-stop': '200000%'
|
|
131
|
+
},
|
|
132
|
+
'&[class*="color-"]': {
|
|
133
|
+
background: 'linear-gradient(to bottom, var(--telepointer-participant-bg-color) var(--telepointer-participant-background-first-stop), transparent var(--telepointer-participant-background-second-stop))',
|
|
134
|
+
'&::after': {
|
|
135
|
+
backgroundColor: 'var(--telepointer-participant-bg-color)',
|
|
136
|
+
color: 'var(--telepointer-participant-text-color)',
|
|
137
|
+
borderColor: 'var(--telepointer-participant-bg-color)'
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
var telepointerStyle = exports.telepointerStyle = (0, _react.css)({
|
|
143
|
+
'.ProseMirror .telepointer': {
|
|
144
|
+
'&.telepointer-selection-badge': {
|
|
145
|
+
'.telepointer-initial, .telepointer-fullname': {
|
|
146
|
+
position: 'absolute',
|
|
147
|
+
display: 'block',
|
|
148
|
+
userSelect: 'none',
|
|
149
|
+
whiteSpace: 'pre',
|
|
150
|
+
top: -14,
|
|
151
|
+
left: 0,
|
|
152
|
+
font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
153
|
+
paddingLeft: "var(--ds-space-050, 4px)",
|
|
154
|
+
paddingRight: "var(--ds-space-050, 4px)",
|
|
155
|
+
color: "var(--ds-text-inverse, #FFFFFF)",
|
|
156
|
+
borderRadius: '0 2px 2px 0'
|
|
157
|
+
},
|
|
158
|
+
'.telepointer-initial': {
|
|
159
|
+
opacity: 1,
|
|
160
|
+
transition: 'opacity 0.15s ease-out'
|
|
161
|
+
},
|
|
162
|
+
'.telepointer-fullname': {
|
|
163
|
+
opacity: 0,
|
|
164
|
+
transform: 'scaleX(0)',
|
|
165
|
+
transformOrigin: 'top left',
|
|
166
|
+
transition: 'transform 0.15s ease-out, opacity 0.15s ease-out'
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
'&.telepointer-pulse-animate': {
|
|
170
|
+
'.telepointer-initial': {
|
|
171
|
+
animation: "".concat(pulseOut, " 2s ease-in-out")
|
|
172
|
+
},
|
|
173
|
+
'.telepointer-fullname': {
|
|
174
|
+
animation: "".concat(pulseIn, " 2s ease-in-out")
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
'&:hover': {
|
|
178
|
+
'.telepointer-initial': {
|
|
179
|
+
opacity: 0,
|
|
180
|
+
transitionDelay: '150ms'
|
|
181
|
+
},
|
|
182
|
+
'.telepointer-fullname': {
|
|
183
|
+
transform: 'scaleX(1)',
|
|
184
|
+
opacity: 1,
|
|
185
|
+
zIndex: 1
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
var telepointerStyleWithInitialOnly = exports.telepointerStyleWithInitialOnly = (0, _react.css)({
|
|
191
|
+
'.ProseMirror .telepointer': {
|
|
192
|
+
'&.telepointer-selection-badge::after': {
|
|
193
|
+
content: 'attr(data-initial)',
|
|
194
|
+
position: 'absolute',
|
|
195
|
+
display: 'block',
|
|
196
|
+
top: -14,
|
|
197
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
198
|
+
fontSize: '0.5625rem',
|
|
199
|
+
padding: "var(--ds-space-025, 2px)",
|
|
200
|
+
color: "var(--ds-text-inverse, #FFFFFF)",
|
|
201
|
+
left: 0,
|
|
202
|
+
borderRadius: '2px 2px 2px 0',
|
|
203
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
204
|
+
lineHeight: 'initial'
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
});
|
|
@@ -10,9 +10,6 @@ import React from 'react';
|
|
|
10
10
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
11
|
import { css, jsx, useTheme } from '@emotion/react';
|
|
12
12
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
13
|
-
import { telepointerStyle, telepointerStyleWithInitialOnly } from '@atlaskit/editor-common/collab';
|
|
14
|
-
import { EmojiSharedCssClassName, defaultEmojiHeight } from '@atlaskit/editor-common/emoji';
|
|
15
|
-
import { MentionSharedCssClassName } from '@atlaskit/editor-common/mention';
|
|
16
13
|
import { gapCursorStyles } from '@atlaskit/editor-common/selection';
|
|
17
14
|
import { GRID_GUTTER, listsSharedStyles } from '@atlaskit/editor-common/styles';
|
|
18
15
|
import { blocktypeStyles } from '@atlaskit/editor-plugins/block-type/styles';
|
|
@@ -20,7 +17,7 @@ import { findReplaceStyles } from '@atlaskit/editor-plugins/find-replace/styles'
|
|
|
20
17
|
import { textHighlightStyle } from '@atlaskit/editor-plugins/paste-options-toolbar/styles';
|
|
21
18
|
import { placeholderTextStyles } from '@atlaskit/editor-plugins/placeholder-text/styles';
|
|
22
19
|
import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
|
|
23
|
-
import {
|
|
20
|
+
import { akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic, editorFontSize } from '@atlaskit/editor-shared-styles';
|
|
24
21
|
import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
25
22
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
26
23
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
@@ -39,6 +36,7 @@ import { codeBlockStyles, firstCodeBlockWithNoMargin, firstCodeBlockWithNoMargin
|
|
|
39
36
|
import { codeMarkStyles } from './styles/codeMarkStyles';
|
|
40
37
|
import { dateStyles, dateVanillaStyles } from './styles/dateStyles';
|
|
41
38
|
import { embedCardStyles } from './styles/embedCardStyles';
|
|
39
|
+
import { reactEmojiStyles, vanillaEmojiStyles } from './styles/emoji';
|
|
42
40
|
import { firstBlockNodeStyles, firstBlockNodeStylesOld } from './styles/firstBlockNodeStyles';
|
|
43
41
|
import { gridStyles } from './styles/gridStyles';
|
|
44
42
|
import { indentationStyles } from './styles/indentationStyles';
|
|
@@ -46,147 +44,18 @@ import { layoutBaseStyles, layoutViewStyles } from './styles/layout';
|
|
|
46
44
|
import { linkStyles, linkStylesOld } from './styles/link';
|
|
47
45
|
import { listsStyles, listsStylesSafariFix } from './styles/list';
|
|
48
46
|
import { mediaStyles } from './styles/mediaStyles';
|
|
47
|
+
import { mentionsStyles, vanillaMentionsStyles, vanillaMentionsSelectionStyles } from './styles/mentions';
|
|
49
48
|
import { paragraphStylesOld, paragraphStylesUGCModernized, paragraphStylesUGCRefreshed } from './styles/paragraphStyles';
|
|
50
49
|
import { resizerStyles, pragmaticResizerStyles } from './styles/resizerStyles';
|
|
51
50
|
import { ruleStyles } from './styles/rule';
|
|
52
51
|
import { shadowStyles } from './styles/shadowStyles';
|
|
53
52
|
import { linkingVisualRefreshV1Styles, smartCardStyles, smartLinksInLivePagesStyles, smartLinksInLivePagesStylesOld } from './styles/smartCardStyles';
|
|
54
53
|
import { tasksAndDecisionsStyles } from './styles/tasksAndDecisionsStyles';
|
|
54
|
+
import { telepointerColorAndCommonStyle, telepointerStyle, telepointerStyleWithInitialOnly } from './styles/telepointerStyles';
|
|
55
55
|
import { textColorStyles } from './styles/textColorStyles';
|
|
56
56
|
import { unsupportedStyles } from './styles/unsupportedStyles';
|
|
57
57
|
import { whitespaceStyles } from './styles/whitespaceStyles';
|
|
58
|
-
|
|
59
|
-
const vanillaMentionsStyles = css({
|
|
60
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
61
|
-
'.editor-mention-primitive': {
|
|
62
|
-
display: 'inline',
|
|
63
|
-
borderRadius: '20px',
|
|
64
|
-
cursor: 'pointer',
|
|
65
|
-
padding: '0 0.3em 2px 0.23em',
|
|
66
|
-
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
67
|
-
wordBreak: 'break-word',
|
|
68
|
-
background: "var(--ds-background-neutral, #091E420F)",
|
|
69
|
-
border: '1px solid transparent',
|
|
70
|
-
color: "var(--ds-text-subtle, #44546F)",
|
|
71
|
-
'&:hover': {
|
|
72
|
-
background: "var(--ds-background-neutral-hovered, #091E4224)"
|
|
73
|
-
},
|
|
74
|
-
'&:active': {
|
|
75
|
-
background: "var(--ds-background-neutral-pressed, #091E424F)"
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
79
|
-
'.editor-mention-primitive.mention-restricted': {
|
|
80
|
-
background: 'transparent',
|
|
81
|
-
border: `1px solid ${"var(--ds-border-bold, #758195)"}`,
|
|
82
|
-
color: "var(--ds-text, #172B4D)",
|
|
83
|
-
'&:hover': {
|
|
84
|
-
background: 'transparent'
|
|
85
|
-
},
|
|
86
|
-
'&:active': {
|
|
87
|
-
background: 'transparent'
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
91
|
-
'.editor-mention-primitive.mention-self': {
|
|
92
|
-
background: "var(--ds-background-brand-bold, #0C66E4)",
|
|
93
|
-
border: '1px solid transparent',
|
|
94
|
-
color: "var(--ds-text-inverse, #FFFFFF)",
|
|
95
|
-
'&:hover': {
|
|
96
|
-
background: "var(--ds-background-brand-bold-hovered, #0055CC)"
|
|
97
|
-
},
|
|
98
|
-
'&:active': {
|
|
99
|
-
background: "var(--ds-background-brand-bold-pressed, #09326C)"
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
const vanillaSelectionStyles = css`
|
|
104
|
-
.danger {
|
|
105
|
-
.editor-mention-primitive {
|
|
106
|
-
box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px ${akEditorDeleteBorder};
|
|
107
|
-
background-color: ${`var(--ds-background-danger, ${akEditorDeleteBackgroundWithOpacity})`};
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.${akEditorSelectedNodeClassName} > .editor-mention-primitive,
|
|
112
|
-
.${akEditorSelectedNodeClassName} > .editor-mention-primitive.mention-self,
|
|
113
|
-
.${akEditorSelectedNodeClassName} > .editor-mention-primitive.mention-restricted {
|
|
114
|
-
${getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Background])}
|
|
115
|
-
/* need to specify dark text colour because personal mentions
|
|
116
|
-
(in dark blue) have white text by default */
|
|
117
|
-
color: ${"var(--ds-text-subtle, #44546F)"}
|
|
118
|
-
}
|
|
119
|
-
`;
|
|
120
|
-
const mentionsStyles = css`
|
|
121
|
-
.${MentionSharedCssClassName.MENTION_CONTAINER} {
|
|
122
|
-
&.${akEditorSelectedNodeClassName} [data-mention-id] > span {
|
|
123
|
-
${getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Background])}
|
|
124
|
-
|
|
125
|
-
/* need to specify dark text colour because personal mentions
|
|
126
|
-
(in dark blue) have white text by default */
|
|
127
|
-
color: ${"var(--ds-text-subtle, #44546F)"};
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.danger {
|
|
132
|
-
.${MentionSharedCssClassName.MENTION_CONTAINER}.${akEditorSelectedNodeClassName}
|
|
133
|
-
> span
|
|
134
|
-
> span
|
|
135
|
-
> span {
|
|
136
|
-
box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px ${akEditorDeleteBorder};
|
|
137
|
-
background-color: ${`var(--ds-background-danger, ${akEditorDeleteBackgroundWithOpacity})`};
|
|
138
|
-
}
|
|
139
|
-
.${MentionSharedCssClassName.MENTION_CONTAINER} > span > span > span {
|
|
140
|
-
background-color: ${"var(--ds-background-neutral, #091E420F)"};
|
|
141
|
-
color: ${"var(--ds-text-subtle, #44546F)"};
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
`;
|
|
145
|
-
const reactEmojiStyles = css`
|
|
146
|
-
.${EmojiSharedCssClassName.EMOJI_CONTAINER} {
|
|
147
|
-
display: inline-block;
|
|
148
|
-
|
|
149
|
-
.${EmojiSharedCssClassName.EMOJI_NODE} {
|
|
150
|
-
cursor: pointer;
|
|
151
|
-
|
|
152
|
-
&.${EmojiSharedCssClassName.EMOJI_IMAGE} > span {
|
|
153
|
-
/** needed for selection style to cover custom emoji image properly */
|
|
154
|
-
display: flex;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
&.${akEditorSelectedNodeClassName} {
|
|
159
|
-
.${EmojiSharedCssClassName.EMOJI_SPRITE}, .${EmojiSharedCssClassName.EMOJI_IMAGE} {
|
|
160
|
-
border-radius: 2px;
|
|
161
|
-
${getSelectionStyles([SelectionStyle.Blanket, SelectionStyle.BoxShadow])}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
`;
|
|
166
|
-
const emojiStyles = css`
|
|
167
|
-
[data-prosemirror-node-view-type='vanilla'] {
|
|
168
|
-
.${EmojiSharedCssClassName.EMOJI_CONTAINER} {
|
|
169
|
-
display: inline-block;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.${EmojiSharedCssClassName.EMOJI_SPRITE}, .${EmojiSharedCssClassName.EMOJI_IMAGE} {
|
|
173
|
-
background: no-repeat transparent;
|
|
174
|
-
display: inline-block;
|
|
175
|
-
height: ${defaultEmojiHeight}px;
|
|
176
|
-
max-height: ${defaultEmojiHeight}px;
|
|
177
|
-
cursor: pointer;
|
|
178
|
-
vertical-align: middle;
|
|
179
|
-
user-select: all;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
&.${akEditorSelectedNodeClassName} {
|
|
183
|
-
.${EmojiSharedCssClassName.EMOJI_SPRITE}, .${EmojiSharedCssClassName.EMOJI_IMAGE} {
|
|
184
|
-
border-radius: 2px;
|
|
185
|
-
${getSelectionStyles([SelectionStyle.Blanket, SelectionStyle.BoxShadow])}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
`;
|
|
58
|
+
const isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
190
59
|
|
|
191
60
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
192
61
|
export const placeholderStyles = css({
|
|
@@ -355,26 +224,16 @@ const contentStyles = () => css`
|
|
|
355
224
|
${mediaStyles}
|
|
356
225
|
|
|
357
226
|
${fg('confluence_team_presence_scroll_to_pointer') ? telepointerStyle : telepointerStyleWithInitialOnly}
|
|
227
|
+
|
|
228
|
+
/* This needs to be after telepointer styles as some overlapping rules have equal specificity, and so the order is significant */
|
|
229
|
+
${telepointerColorAndCommonStyle}
|
|
230
|
+
|
|
358
231
|
${gapCursorStyles};
|
|
359
232
|
|
|
360
233
|
${panelStyles()}
|
|
361
234
|
|
|
362
235
|
${mentionsStyles}
|
|
363
236
|
|
|
364
|
-
${editorExperiment('platform_editor_vanilla_dom', true, {
|
|
365
|
-
exposure: false
|
|
366
|
-
}) && vanillaMentionsStyles}
|
|
367
|
-
|
|
368
|
-
${editorExperiment('platform_editor_vanilla_dom', true, {
|
|
369
|
-
exposure: false
|
|
370
|
-
}) && vanillaSelectionStyles}
|
|
371
|
-
|
|
372
|
-
${editorExperiment('platform_editor_vanilla_dom', true, {
|
|
373
|
-
exposure: false
|
|
374
|
-
}) ? emojiStyles : reactEmojiStyles}
|
|
375
|
-
|
|
376
|
-
${emojiStyles}
|
|
377
|
-
|
|
378
237
|
${tasksAndDecisionsStyles}
|
|
379
238
|
|
|
380
239
|
${gridStyles}
|
|
@@ -599,7 +458,21 @@ const EditorContentContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
599
458
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
600
459
|
firstBlockNodeStyles :
|
|
601
460
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
602
|
-
firstBlockNodeStylesOld
|
|
461
|
+
firstBlockNodeStylesOld, editorExperiment('platform_editor_vanilla_dom', true, {
|
|
462
|
+
exposure: false
|
|
463
|
+
}) &&
|
|
464
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
465
|
+
vanillaMentionsStyles, editorExperiment('platform_editor_vanilla_dom', true, {
|
|
466
|
+
exposure: false
|
|
467
|
+
}) &&
|
|
468
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
469
|
+
vanillaMentionsSelectionStyles, editorExperiment('platform_editor_vanilla_dom', true, {
|
|
470
|
+
exposure: false
|
|
471
|
+
}) ?
|
|
472
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
473
|
+
vanillaEmojiStyles :
|
|
474
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
475
|
+
reactEmojiStyles],
|
|
603
476
|
"data-editor-scroll-container": isScrollable ? 'true' : undefined,
|
|
604
477
|
"data-testid": "editor-content-container",
|
|
605
478
|
style: {
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
import { defaultEmojiHeight, EmojiSharedCssClassName } from '@atlaskit/editor-common/emoji';
|
|
4
|
+
import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
5
|
+
import { blanketSelectionStyles, boxShadowSelectionStyles, hideNativeBrowserTextSelectionStyles } from './selectionStyles';
|
|
6
|
+
const reactEmojiSelectionStyles = css({
|
|
7
|
+
borderRadius: '2px'
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
11
|
+
export const reactEmojiStyles = css({
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
13
|
+
[`.${EmojiSharedCssClassName.EMOJI_CONTAINER}`]: {
|
|
14
|
+
display: 'inline-block',
|
|
15
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
16
|
+
[`.${EmojiSharedCssClassName.EMOJI_NODE}`]: {
|
|
17
|
+
cursor: 'pointer',
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
19
|
+
[`&.${EmojiSharedCssClassName.EMOJI_IMAGE} > span`]: {
|
|
20
|
+
/** needed for selection style to cover custom emoji image properly */
|
|
21
|
+
display: 'flex'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
25
|
+
[`&.${akEditorSelectedNodeClassName}`]: {
|
|
26
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
27
|
+
[`.${EmojiSharedCssClassName.EMOJI_SPRITE}, .${EmojiSharedCssClassName.EMOJI_IMAGE}`]: [
|
|
28
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
29
|
+
blanketSelectionStyles,
|
|
30
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
31
|
+
boxShadowSelectionStyles,
|
|
32
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
33
|
+
hideNativeBrowserTextSelectionStyles, reactEmojiSelectionStyles]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const vanillaEmojiSelectionStyles = css({
|
|
38
|
+
borderRadius: '2px'
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Emoji styles from Emoji vanilla node view
|
|
42
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
43
|
+
export const vanillaEmojiStyles = css({
|
|
44
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
45
|
+
'[data-prosemirror-node-view-type="vanilla"]': {
|
|
46
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
47
|
+
[`.${EmojiSharedCssClassName.EMOJI_CONTAINER}`]: {
|
|
48
|
+
display: 'inline-block'
|
|
49
|
+
},
|
|
50
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
51
|
+
[`.${EmojiSharedCssClassName.EMOJI_SPRITE}, .${EmojiSharedCssClassName.EMOJI_IMAGE}`]: {
|
|
52
|
+
background: 'no-repeat transparent',
|
|
53
|
+
display: 'inline-block',
|
|
54
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
55
|
+
height: `${defaultEmojiHeight}px`,
|
|
56
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
57
|
+
maxHeight: `${defaultEmojiHeight}px`,
|
|
58
|
+
cursor: 'pointer',
|
|
59
|
+
verticalAlign: 'middle',
|
|
60
|
+
userSelect: 'all'
|
|
61
|
+
},
|
|
62
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
63
|
+
[`&.${akEditorSelectedNodeClassName}`]: {
|
|
64
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
65
|
+
[`.${EmojiSharedCssClassName.EMOJI_SPRITE}, .${EmojiSharedCssClassName.EMOJI_IMAGE}`]: [vanillaEmojiSelectionStyles,
|
|
66
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
67
|
+
blanketSelectionStyles,
|
|
68
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
69
|
+
boxShadowSelectionStyles,
|
|
70
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
71
|
+
hideNativeBrowserTextSelectionStyles]
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
import { MentionSharedCssClassName } from '@atlaskit/editor-common/mention';
|
|
4
|
+
import { akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
5
|
+
import { backgroundSelectionStyles, boxShadowSelectionStyles, hideNativeBrowserTextSelectionStyles } from './selectionStyles';
|
|
6
|
+
|
|
7
|
+
/* need to specify dark text colour because personal mentions
|
|
8
|
+
(in dark blue) have white text by default */
|
|
9
|
+
const mentionsSelectedColor = css({
|
|
10
|
+
color: "var(--ds-text-subtle, #44546F)"
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
14
|
+
export const mentionsStyles = css({
|
|
15
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
16
|
+
[`.${MentionSharedCssClassName.MENTION_CONTAINER}`]: {
|
|
17
|
+
// TODO: ED-28075 - refactor selection styles to unblock Compiled CSS migration
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
19
|
+
[`&.${akEditorSelectedNodeClassName} [data-mention-id] > span`]: [
|
|
20
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
21
|
+
boxShadowSelectionStyles,
|
|
22
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
23
|
+
backgroundSelectionStyles, mentionsSelectedColor]
|
|
24
|
+
},
|
|
25
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
26
|
+
'.danger': {
|
|
27
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
28
|
+
[`.${MentionSharedCssClassName.MENTION_CONTAINER}.${akEditorSelectedNodeClassName}`]: {
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
30
|
+
'> span > span > span': {
|
|
31
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
32
|
+
boxShadow: `0 0 0 ${akEditorSelectedBorderSize}px ${akEditorDeleteBorder}`,
|
|
33
|
+
backgroundColor: "var(--ds-background-danger, #FFECEB)"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
37
|
+
[`.${MentionSharedCssClassName.MENTION_CONTAINER} > span > span > span`]: {
|
|
38
|
+
backgroundColor: "var(--ds-background-neutral, #091E420F)",
|
|
39
|
+
color: "var(--ds-text-subtle, #44546F)"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
45
|
+
export const vanillaMentionsStyles = css({
|
|
46
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
47
|
+
'.editor-mention-primitive': {
|
|
48
|
+
display: 'inline',
|
|
49
|
+
borderRadius: '20px',
|
|
50
|
+
cursor: 'pointer',
|
|
51
|
+
padding: '0 0.3em 2px 0.23em',
|
|
52
|
+
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
53
|
+
wordBreak: 'break-word',
|
|
54
|
+
background: "var(--ds-background-neutral, #091E420F)",
|
|
55
|
+
border: '1px solid transparent',
|
|
56
|
+
color: "var(--ds-text-subtle, #44546F)",
|
|
57
|
+
'&:hover': {
|
|
58
|
+
background: "var(--ds-background-neutral-hovered, #091E4224)"
|
|
59
|
+
},
|
|
60
|
+
'&:active': {
|
|
61
|
+
background: "var(--ds-background-neutral-pressed, #091E424F)"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
65
|
+
'.editor-mention-primitive.mention-restricted': {
|
|
66
|
+
background: 'transparent',
|
|
67
|
+
border: `1px solid ${"var(--ds-border-bold, #758195)"}`,
|
|
68
|
+
color: "var(--ds-text, #172B4D)",
|
|
69
|
+
'&:hover': {
|
|
70
|
+
background: 'transparent'
|
|
71
|
+
},
|
|
72
|
+
'&:active': {
|
|
73
|
+
background: 'transparent'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
77
|
+
'.editor-mention-primitive.mention-self': {
|
|
78
|
+
background: "var(--ds-background-brand-bold, #0C66E4)",
|
|
79
|
+
border: '1px solid transparent',
|
|
80
|
+
color: "var(--ds-text-inverse, #FFFFFF)",
|
|
81
|
+
'&:hover': {
|
|
82
|
+
background: "var(--ds-background-brand-bold-hovered, #0055CC)"
|
|
83
|
+
},
|
|
84
|
+
'&:active': {
|
|
85
|
+
background: "var(--ds-background-brand-bold-pressed, #09326C)"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// This is mentions styles for mentions selection styles based on the vanilla node view
|
|
91
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
92
|
+
export const vanillaMentionsSelectionStyles = css({
|
|
93
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
94
|
+
'.danger': {
|
|
95
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
96
|
+
'.editor-mention-primitive': {
|
|
97
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
98
|
+
boxShadow: `0 0 0 ${akEditorSelectedBorderSize}px ${akEditorDeleteBorder}`,
|
|
99
|
+
backgroundColor: "var(--ds-background-danger, #FFECEB)"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
103
|
+
[`.${akEditorSelectedNodeClassName}`]: {
|
|
104
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
105
|
+
'> .editor-mention-primitive, > .editor-mention-primitive.mention-self, > .editor-mention-primitive.mention-restricted':
|
|
106
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values,
|
|
107
|
+
[
|
|
108
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
109
|
+
boxShadowSelectionStyles,
|
|
110
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
111
|
+
backgroundSelectionStyles,
|
|
112
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
113
|
+
hideNativeBrowserTextSelectionStyles, mentionsSelectedColor]
|
|
114
|
+
}
|
|
115
|
+
});
|