@atlaskit/editor-core 207.15.1 → 207.16.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.
Files changed (26) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/ui/ContentStyles/index.js +10 -2
  3. package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +14 -6
  4. package/dist/cjs/ui/EditorContentContainer/styles/expandStyles.js +263 -0
  5. package/dist/cjs/ui/EditorContentContainer/styles/inlineNodeViewSharedStyles.js +46 -0
  6. package/dist/cjs/ui/EditorContentContainer/styles/placeholderTextStyles.js +72 -0
  7. package/dist/cjs/version-wrapper.js +1 -1
  8. package/dist/es2019/ui/ContentStyles/index.js +9 -0
  9. package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +16 -5
  10. package/dist/es2019/ui/EditorContentContainer/styles/expandStyles.js +256 -0
  11. package/dist/es2019/ui/EditorContentContainer/styles/inlineNodeViewSharedStyles.js +40 -0
  12. package/dist/es2019/ui/EditorContentContainer/styles/placeholderTextStyles.js +65 -0
  13. package/dist/es2019/version-wrapper.js +1 -1
  14. package/dist/esm/ui/ContentStyles/index.js +10 -2
  15. package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +14 -6
  16. package/dist/esm/ui/EditorContentContainer/styles/expandStyles.js +256 -0
  17. package/dist/esm/ui/EditorContentContainer/styles/inlineNodeViewSharedStyles.js +40 -0
  18. package/dist/esm/ui/EditorContentContainer/styles/placeholderTextStyles.js +65 -0
  19. package/dist/esm/version-wrapper.js +1 -1
  20. package/dist/types/ui/EditorContentContainer/styles/expandStyles.d.ts +4 -0
  21. package/dist/types/ui/EditorContentContainer/styles/inlineNodeViewSharedStyles.d.ts +1 -0
  22. package/dist/types/ui/EditorContentContainer/styles/placeholderTextStyles.d.ts +1 -0
  23. package/dist/types-ts4.5/ui/EditorContentContainer/styles/expandStyles.d.ts +4 -0
  24. package/dist/types-ts4.5/ui/EditorContentContainer/styles/inlineNodeViewSharedStyles.d.ts +1 -0
  25. package/dist/types-ts4.5/ui/EditorContentContainer/styles/placeholderTextStyles.d.ts +1 -0
  26. package/package.json +9 -7
@@ -12,14 +12,11 @@ import { css, jsx, useTheme } from '@emotion/react';
12
12
  import { browser } from '@atlaskit/editor-common/browser';
13
13
  import { gapCursorStyles } from '@atlaskit/editor-common/selection';
14
14
  import { GRID_GUTTER } from '@atlaskit/editor-common/styles';
15
- import { placeholderTextStyles } from '@atlaskit/editor-plugins/placeholder-text/styles';
16
15
  import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
17
16
  import { akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic, editorFontSize } from '@atlaskit/editor-shared-styles';
18
17
  import { fg } from '@atlaskit/platform-feature-flags';
19
18
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
20
19
  import { useThemeObserver } from '@atlaskit/tokens';
21
- import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewProducer.styles';
22
- import { expandStyles } from '../ContentStyles/expand';
23
20
  import { extensionStyles } from '../ContentStyles/extension';
24
21
  import { panelStyles } from '../ContentStyles/panel';
25
22
  import { statusStyles, vanillaStatusStyles } from '../ContentStyles/status';
@@ -34,16 +31,19 @@ import { dateStyles, dateVanillaStyles } from './styles/dateStyles';
34
31
  import { editorUGCTokensDefault, editorUGCTokensModernized, editorUGCTokensRefreshed } from './styles/editorUGCTokenStyles';
35
32
  import { embedCardStyles } from './styles/embedCardStyles';
36
33
  import { reactEmojiStyles, vanillaEmojiStyles } from './styles/emoji';
34
+ import { expandStyles, expandStylesMixin_fg_platform_editor_nested_dnd_styles_changes, expandStylesMixin_fg_platform_visual_refresh_icons, expandStylesMixin_without_fg_platform_editor_nested_dnd_styles_changes } from './styles/expandStyles';
37
35
  import { findReplaceStyles } from './styles/findReplaceStyles';
38
36
  import { firstBlockNodeStyles } from './styles/firstBlockNodeStyles';
39
37
  import { gridStyles } from './styles/gridStyles';
40
38
  import { indentationStyles } from './styles/indentationStyles';
39
+ import { InlineNodeViewSharedStyles } from './styles/inlineNodeViewSharedStyles';
41
40
  import { layoutBaseStyles, layoutViewStyles } from './styles/layout';
42
41
  import { linkStyles, linkStylesOld } from './styles/link';
43
42
  import { listsStyles, listsStylesSafariFix } from './styles/list';
44
43
  import { mediaStyles } from './styles/mediaStyles';
45
44
  import { mentionsStyles, vanillaMentionsStyles, vanillaMentionsSelectionStyles } from './styles/mentions';
46
45
  import { paragraphStylesOld, paragraphStylesUGCModernized, paragraphStylesUGCRefreshed } from './styles/paragraphStyles';
46
+ import { placeholderTextStyles } from './styles/placeholderTextStyles';
47
47
  import { resizerStyles, pragmaticResizerStyles } from './styles/resizerStyles';
48
48
  import { ruleStyles } from './styles/rule';
49
49
  import { shadowStyles } from './styles/shadowStyles';
@@ -252,7 +252,10 @@ fg('platform_editor_typography_ugc') && /* eslint-disable @atlaskit/platform/ens
252
252
 
253
253
  ${extensionStyles}
254
254
 
255
- ${expandStyles()}
255
+ ${expandStyles}
256
+ ${fg('platform_editor_nested_dnd_styles_changes') && expandStylesMixin_fg_platform_editor_nested_dnd_styles_changes}
257
+ ${!fg('platform_editor_nested_dnd_styles_changes') && expandStylesMixin_without_fg_platform_editor_nested_dnd_styles_changes}
258
+ ${fg('platform-visual-refresh-icons') && expandStylesMixin_fg_platform_visual_refresh_icons}
256
259
 
257
260
  ${findReplaceStyles}
258
261
 
@@ -423,6 +426,14 @@ const listLayoutShiftFix = css({
423
426
  }
424
427
  });
425
428
 
429
+ // Make sure the first floating toolbar button has focus ring when focused via .focus()
430
+ const firstFloatingToolbarButtonStyles = css({
431
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
432
+ 'button.first-floating-toolbar-button:focus': {
433
+ outline: `2px solid ${"var(--ds-border-focused, #2684FF)"}`
434
+ }
435
+ });
436
+
426
437
  /**
427
438
  * EditorContentStyles is a wrapper component that applies styles to its children
428
439
  * based on the provided feature flags, view mode, and other props.
@@ -500,7 +511,7 @@ const EditorContentContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
500
511
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
501
512
  vanillaEmojiStyles :
502
513
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
503
- reactEmojiStyles],
514
+ reactEmojiStyles, fg('platform_editor_fix_floating_toolbar_focus') && firstFloatingToolbarButtonStyles],
504
515
  "data-editor-scroll-container": isScrollable ? 'true' : undefined,
505
516
  "data-testid": "editor-content-container",
506
517
  style: {
@@ -0,0 +1,256 @@
1
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
2
+ import { css } from '@emotion/react';
3
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
4
+ export const expandStyles = css({
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
6
+ '.ak-editor-expand__icon > div': {
7
+ display: 'flex'
8
+ },
9
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
10
+ '.ak-editor-expand': {
11
+ // sharedExpandStyles.containerStyles({ expanded: false, focused: false })(),
12
+ borderWidth: '1px',
13
+ borderStyle: 'solid',
14
+ borderColor: 'transparent',
15
+ borderRadius: "var(--ds-border-radius-100, 4px)",
16
+ minHeight: '25px',
17
+ background: "var(--ds-background-neutral-subtle, transparent)",
18
+ margin: `${"var(--ds-space-050, 0.25rem)"} 0 0`,
19
+ transition: 'background 0.3s cubic-bezier(0.15, 1, 0.3, 1), border-color 0.3s cubic-bezier(0.15, 1, 0.3, 1)',
20
+ padding: "var(--ds-space-100, 8px)",
21
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
22
+ 'td > :not(style):first-child, td > style:first-child + *': {
23
+ marginTop: 0
24
+ },
25
+ cursor: 'pointer',
26
+ boxSizing: 'border-box',
27
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
28
+ 'td > &': {
29
+ marginTop: 0
30
+ },
31
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
32
+ '.ak-editor-expand__icon-container svg': {
33
+ color: "var(--ds-icon-subtle, #626F86)",
34
+ transform: 'rotate(90deg)'
35
+ },
36
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
37
+ '&.ak-editor-selected-node:not(.danger)': {
38
+ // SelectionStyle.Blanket
39
+ position: 'relative',
40
+ // Fixes ED-9263, where emoji or inline card in panel makes selection go outside the panel
41
+ // in Safari. Looks like it's caused by user-select: all in the emoji element
42
+ '-webkit-user-select': 'text',
43
+ '&::before': {
44
+ position: 'absolute',
45
+ content: "''",
46
+ left: 0,
47
+ right: 0,
48
+ top: 0,
49
+ bottom: 0,
50
+ width: '100%',
51
+ pointerEvents: 'none',
52
+ zIndex: 12,
53
+ // akEditorStickyheaderZIndex (11) + 1
54
+ backgroundColor: "var(--ds-blanket-selected, #388BFF14)"
55
+ },
56
+ // SelectionStyle.Border (common case)
57
+ border: `1px solid ${"var(--ds-border-selected, #0C66E4)"}`,
58
+ // If fg('platform_editor_nested_dnd_styles_changes') is true,
59
+ // then we'll also need the rest of the selection styles for blanket
60
+
61
+ // hideNativeBrowserTextSelectionStyles
62
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
63
+ '&::selection, *::selection': {
64
+ backgroundColor: 'transparent'
65
+ },
66
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
67
+ '&::-moz-selection, *::-moz-selection': {
68
+ backgroundColor: 'transparent'
69
+ }
70
+ },
71
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
72
+ '&.danger': {
73
+ background: "var(--ds-background-danger, #FFECEB)",
74
+ borderColor: "var(--ds-border-danger, #E2483D)"
75
+ }
76
+ },
77
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
78
+ '.ProseMirror > .ak-editor-expand__type-expand, .fabric-editor-breakout-mark-dom > .ak-editor-expand__type-expand': {
79
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
80
+ marginLeft: '-12px',
81
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
82
+ marginRight: '-12px'
83
+ },
84
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
85
+ '.ak-editor-expand__content': {
86
+ // sharedExpandStyles.contentStyles({ expanded: false, focused: false })(),
87
+ paddingTop: "var(--ds-space-0, 0px)",
88
+ paddingRight: "var(--ds-space-100, 8px)",
89
+ paddingLeft: "var(--ds-space-300, 24px)",
90
+ marginLeft: "var(--ds-space-050, 4px)",
91
+ display: 'flow-root',
92
+ /* The follow rules inside @supports block are added as a part of ED-8893
93
+ The fix is targeting mobile bridge on iOS 12 or below,
94
+ We should consider remove this fix when we no longer support iOS 12 */
95
+ '@supports not (display: flow-root)': {
96
+ width: '100%',
97
+ boxSizing: 'border-box'
98
+ },
99
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
100
+ '.expand-content-wrapper, .nestedExpand-content-wrapper': {
101
+ /* We visually hide the content here to preserve the content during copy+paste */
102
+ /* Do not add text nowrap here because inline comment navigation depends on the location of the text */
103
+ width: '100%',
104
+ display: 'block',
105
+ height: 0,
106
+ overflow: 'hidden',
107
+ clip: 'rect(1px, 1px, 1px, 1px)',
108
+ userSelect: 'none'
109
+ },
110
+ cursor: 'text'
111
+ },
112
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
113
+ '.ak-editor-expand__title-input': {
114
+ // sharedExpandStyles.titleInputStyles(),
115
+ outline: 'none',
116
+ border: 'none',
117
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
118
+ fontSize: 'calc(14rem / 16)',
119
+ // relativeFontSizeToBase16(14),
120
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
121
+ lineHeight: 1.714,
122
+ // If fg('platform-visual-refresh-icons') then this needs to be overridden
123
+ fontWeight: "var(--ds-font-weight-regular, 400)",
124
+ color: "var(--ds-text-subtlest, #626F86)",
125
+ background: 'transparent',
126
+ display: 'flex',
127
+ flex: 1,
128
+ padding: `0 0 0 ${"var(--ds-space-050, 4px)"}`,
129
+ width: '100%',
130
+ '&::placeholder': {
131
+ opacity: 1,
132
+ color: "var(--ds-text-subtlest, #626F86)"
133
+ }
134
+ },
135
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
136
+ '.ak-editor-expand__title-container': {
137
+ // sharedExpandStyles.titleContainerStyles(),
138
+ padding: 0,
139
+ display: 'flex',
140
+ // Omitting alignItems: 'flex-start' as it would be overridden
141
+ background: 'none',
142
+ border: 'none',
143
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
144
+ fontSize: 'calc(14rem / 16)',
145
+ // relativeFontSizeToBase16(14),
146
+ width: '100%',
147
+ color: "var(--ds-text-subtle, #44546F)",
148
+ // Omitting overflow: 'hidden' as it would be overridden
149
+ cursor: 'pointer',
150
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
151
+ '&:focus': {
152
+ outline: 0
153
+ },
154
+ alignItems: 'center',
155
+ overflow: 'visible'
156
+ },
157
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
158
+ '.ak-editor-expand__expanded': {
159
+ background: "var(--ds-background-neutral-subtle, #00000000)",
160
+ borderColor: "var(--ds-border, #091E4224)",
161
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
162
+ '.ak-editor-expand__content': {
163
+ paddingTop: "var(--ds-space-100, 8px)"
164
+ // If fg('platform_editor_nested_dnd_styles_changes') then this needs to be extended
165
+ }
166
+ },
167
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
168
+ '.ak-editor-expand__input-container': {
169
+ width: '100%'
170
+ },
171
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
172
+ '.ak-editor-expand:not(.ak-editor-expand__expanded)': {
173
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
174
+ '.ak-editor-expand__content': {
175
+ position: 'absolute',
176
+ height: '1px',
177
+ width: '1px',
178
+ overflow: 'hidden',
179
+ clip: 'rect(1px, 1px, 1px, 1px)',
180
+ whiteSpace: 'nowrap'
181
+ },
182
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
183
+ '.ak-editor-expand__icon-container svg': {
184
+ color: "var(--ds-icon-subtle, #626F86)",
185
+ transform: 'rotate(0deg)'
186
+ },
187
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
188
+ '&:not(.ak-editor-selected-node):not(.danger)': {
189
+ background: 'transparent',
190
+ borderColor: 'transparent',
191
+ '&:hover': {
192
+ borderColor: "var(--ds-border, #091E4224)",
193
+ background: "var(--ds-background-neutral-subtle, #00000000)"
194
+ }
195
+ }
196
+ }
197
+ });
198
+
199
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
200
+ export const expandStylesMixin_fg_platform_visual_refresh_icons = css({
201
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
202
+ '.ak-editor-expand__title-input': {
203
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
204
+ lineHeight: 1
205
+ }
206
+ });
207
+
208
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
209
+ export const expandStylesMixin_fg_platform_editor_nested_dnd_styles_changes = css({
210
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
211
+ '.ak-editor-content-area.appearance-full-page .ProseMirror > .ak-editor-expand__type-expand, .fabric-editor-breakout-mark-dom > .ak-editor-expand__type-expand': {
212
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
213
+ marginLeft: '-20px',
214
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
215
+ marginRight: '-20px'
216
+ },
217
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
218
+ '.ak-editor-expand__expanded': {
219
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
220
+ '.ak-editor-expand__content': {
221
+ // firstNodeWithNotMarginTop
222
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
223
+ '> :nth-child(1 of :not(style, .ProseMirror-gapcursor, .ProseMirror-widget, span))': {
224
+ marginTop: 0
225
+ },
226
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
227
+ '> div.ak-editor-expand[data-node-type="nestedExpand"]': {
228
+ marginTop: "var(--ds-space-050, 0.25rem)"
229
+ }
230
+ }
231
+ }
232
+ });
233
+
234
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
235
+ export const expandStylesMixin_without_fg_platform_editor_nested_dnd_styles_changes = css({
236
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
237
+ '.ak-editor-expand': {
238
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
239
+ '&.ak-editor-selected-node:not(.danger)': {
240
+ // SelectionStyle.Border (with fg('platform_editor_nested_dnd_styles_changes'))
241
+ // Fixes ED-15246: Trello card is visible through a border of a table border
242
+ '&::after': {
243
+ height: '100%',
244
+ content: "'\\00a0'",
245
+ background: "var(--ds-border-selected, #0C66E4)",
246
+ position: 'absolute',
247
+ right: '-1px',
248
+ top: 0,
249
+ bottom: 0,
250
+ width: '1px',
251
+ border: 'none',
252
+ display: 'inline-block'
253
+ }
254
+ }
255
+ }
256
+ });
@@ -0,0 +1,40 @@
1
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
2
+ import { css } from '@emotion/react';
3
+
4
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
5
+ export const InlineNodeViewSharedStyles = css({
6
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
7
+ '.inlineNodeView': {
8
+ display: 'inline',
9
+ userSelect: 'all',
10
+ whiteSpace: 'nowrap',
11
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
12
+ '& > *:not(.zeroWidthSpaceContainer)': {
13
+ whiteSpace: 'pre-wrap'
14
+ },
15
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
16
+ '& > .assistive': {
17
+ userSelect: 'none'
18
+ }
19
+ },
20
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
21
+ '&.ua-safari': {
22
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
23
+ '.inlineNodeView': {
24
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
25
+ '&::selection, *::selection': {
26
+ background: 'transparent'
27
+ }
28
+ }
29
+ },
30
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
31
+ '&.ua-chrome .inlineNodeView > span': {
32
+ userSelect: 'none'
33
+ },
34
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
35
+ '.inlineNodeViewAddZeroWidthSpace': {
36
+ '&::after': {
37
+ content: "'\u200b'" // ZERO_WIDTH_SPACE
38
+ }
39
+ }
40
+ });
@@ -0,0 +1,65 @@
1
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
2
+ import { css } from '@emotion/react';
3
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
4
+ export const placeholderTextStyles = css({
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
6
+ '.ProseMirror span[data-placeholder]': {
7
+ color: "var(--ds-text-subtlest, #626F86)",
8
+ display: 'inline'
9
+ },
10
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
11
+ '.ProseMirror span.pm-placeholder': {
12
+ display: 'inline',
13
+ color: "var(--ds-text-subtlest, #626F86)"
14
+ },
15
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
16
+ '.ProseMirror span.pm-placeholder__text': {
17
+ display: 'inline',
18
+ color: "var(--ds-text-subtlest, #626F86)"
19
+ },
20
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
21
+ '.ProseMirror span.pm-placeholder.ak-editor-selected-node': {
22
+ // ...backgroundSelectionStyles
23
+ backgroundColor: "var(--ds-background-selected, #E9F2FF)",
24
+ // ...backgroundSelectionStyles -> hideNativeBrowserTextSelectionStyles
25
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
26
+ '&::selection,*::selection': {
27
+ backgroundColor: 'transparent'
28
+ },
29
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors, @atlaskit/ui-styling-standard/no-nested-selectors
30
+ '&::-moz-selection,*::-moz-selection': {
31
+ backgroundColor: 'transparent'
32
+ }
33
+ },
34
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
35
+ '.ProseMirror span.pm-placeholder__text[data-placeholder]::after': {
36
+ color: "var(--ds-text-subtlest, #626F86)",
37
+ cursor: 'text',
38
+ content: 'attr(data-placeholder)',
39
+ display: 'inline'
40
+ },
41
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
42
+ '.ProseMirror': {
43
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
44
+ '.ProseMirror-fake-text-cursor': {
45
+ display: 'inline',
46
+ pointerEvents: 'none',
47
+ position: 'relative'
48
+ },
49
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
50
+ '.ProseMirror-fake-text-cursor::after': {
51
+ content: '""',
52
+ display: 'inline',
53
+ top: 0,
54
+ position: 'absolute',
55
+ borderRight: `1px solid ${"var(--ds-border, #091E4224)"}`
56
+ },
57
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
58
+ '.ProseMirror-fake-text-selection': {
59
+ display: 'inline',
60
+ pointerEvents: 'none',
61
+ position: 'relative',
62
+ backgroundColor: "var(--ds-background-selected, #B3D4FF)"
63
+ }
64
+ }
65
+ });
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "207.15.1";
2
+ export const version = "207.16.0";
@@ -129,6 +129,14 @@ var placeholderWrapStyles = css({
129
129
  });
130
130
  var firstBlockNodeStylesNew = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n\t.ProseMirror {\n\t\t> .", ",\n\t\t\t> .", ",\n\t\t\t> .", ",\n\t\t\t> div[data-task-list-local-id],\n\t\t> div[data-layout-section],\n\t\t> .", " {\n\t\t\t&:first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t}\n\n\t\t> hr:first-child,\n\t\t> .ProseMirror-widget:first-child + hr {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n"])), PanelSharedCssClassName.prefix, CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, expandClassNames.prefix);
131
131
 
132
+ // Make sure the first floating toolbar button has focus ring when focused via .focus()
133
+ var firstFloatingToolbarButtonStyles = css({
134
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
135
+ 'button.first-floating-toolbar-button:focus': {
136
+ outline: "2px solid ".concat("var(--ds-border-focused, #2684FF)")
137
+ }
138
+ });
139
+
132
140
  // The breakpoint for small devices is 1266px, copied from getBreakpoint in platform/packages/editor/editor-common/src/ui/WidthProvider/index.tsx
133
141
  var akEditorBreakpointForSmallDevice = "1266px";
134
142
 
@@ -137,9 +145,9 @@ var akEditorBreakpointForSmallDevice = "1266px";
137
145
  // Under editor experiment platform_editor_core_static_emotion
138
146
  // If you are making changes to this file, please make sure to update in EditorContentContainer.tsx as well
139
147
  var legacyContentStyles = function legacyContentStyles(props) {
140
- return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n\t--ak-editor--default-gutter-padding: ", "px;\n\t/* 52 is from akEditorGutterPaddingDynamic via editor-shared-styles */\n\t--ak-editor--large-gutter-padding: ", "px;\n\t--ak-editor--default-layout-width: ", "px;\n\t--ak-editor--full-width-layout-width: ", "px;\n\t/* calculate editor line length, 100cqw is the editor container width */\n\t--ak-editor--line-length: min(\n\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\tvar(--ak-editor--default-layout-width)\n\t);\n\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t--ak-editor--breakout-full-page-guttering-padding: calc(\n\t\tvar(--ak-editor--large-gutter-padding) * 2 + var(--ak-editor--default-gutter-padding)\n\t);\n\n\t.fabric-editor--full-width-mode {\n\t\t--ak-editor--line-length: min(\n\t\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\t\tvar(--ak-editor--full-width-layout-width)\n\t\t);\n\t}\n\n\t.ProseMirror {\n\t\t--ak-editor-max-container-width: calc(100cqw - var(--ak-editor--large-gutter-padding));\n\t}\n\n\t/* We can't allow nodes that are inside other nodes to bleed from the parent container */\n\t.ProseMirror > div[data-prosemirror-node-block] [data-prosemirror-node-block] {\n\t\t--ak-editor-max-container-width: 100%;\n\t}\n\n\t/* container editor-area is defined in platform/packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts */\n\t@container editor-area (width >= ", ") {\n\t\t.ProseMirror {\n\t\t\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t\t}\n\t}\n\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: ", "px;\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t}\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t/**\n\t * This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24\n\t *\n\t * 1. Merge and Release platform_editor_hide_cursor_when_pm_hideselection\n\t * 2. Cleanup duplicated style from platform_editor_advanced_code_blocks\n\t * https://product-fabric.atlassian.net/browse/ED-26331\n\t */\n\t", "\n\n\t/* This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24 */\n\t", "\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t.ProseMirror.ProseMirror-focused:has(.ProseMirror-mark-boundary-cursor) {\n\t\tcaret-color: transparent;\n\t}\n\t.ProseMirror:not(.ProseMirror-focused) .ProseMirror-mark-boundary-cursor {\n\t\tdisplay: none;\n\t}\n\n\t", "\n\t", "\n\t", "\n\t", "\n\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n\t", "\n\t", "\n\t", "\n\t", "\n\t", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n /* Switch between the two icons based on the visual refresh feature gate */\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\t", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.mediaGroupView-content-wrap ul {\n\t\tpadding: 0;\n\t}\n\n\t/** Needed to override any cleared floats, e.g. image wrapping */\n\n\tdiv.fabric-editor-block-mark[class^='fabric-editor-align'] {\n\t\tclear: none !important;\n\t}\n\n\t.fabric-editor-align-end {\n\t\ttext-align: right;\n\t}\n\n\t.fabric-editor-align-start {\n\t\ttext-align: left;\n\t}\n\n\t.fabric-editor-align-center {\n\t\ttext-align: center;\n\t}\n\n\t/* For FullPage only when inside a table\n\tRelated code all lives inside: packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts\n\tIn the \"editorContentAreaContainerStyle\" function */\n\t.fabric-editor--full-width-mode {\n\t\t.pm-table-container {\n\t\t\t.code-block,\n\t\t\t.extension-container,\n\t\t\t.multiBodiedExtension--container {\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\t}\n\n\t.pm-table-header-content-wrap :not(.fabric-editor-alignment),\n\t.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,\n\t.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {\n\t\tp:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n\t\tclear: both;\n\t}\n\n\t.hyperlink-floating-toolbar,\n\t.", " {\n\t\tpadding: 0;\n\t}\n\n\t/* Legacy Link icon in the Atlaskit package\n is bigger than the others, new ADS icon does not have this issue\n */\n\t", "\n"])), akEditorGutterPadding, akEditorGutterPaddingDynamic(), akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorBreakpointForSmallDevice, akEditorCalculatedWideLayoutWidth, editorFontSize({
148
+ return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n\t--ak-editor--default-gutter-padding: ", "px;\n\t/* 52 is from akEditorGutterPaddingDynamic via editor-shared-styles */\n\t--ak-editor--large-gutter-padding: ", "px;\n\t--ak-editor--default-layout-width: ", "px;\n\t--ak-editor--full-width-layout-width: ", "px;\n\t/* calculate editor line length, 100cqw is the editor container width */\n\t--ak-editor--line-length: min(\n\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\tvar(--ak-editor--default-layout-width)\n\t);\n\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t--ak-editor--breakout-full-page-guttering-padding: calc(\n\t\tvar(--ak-editor--large-gutter-padding) * 2 + var(--ak-editor--default-gutter-padding)\n\t);\n\n\t.fabric-editor--full-width-mode {\n\t\t--ak-editor--line-length: min(\n\t\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\t\tvar(--ak-editor--full-width-layout-width)\n\t\t);\n\t}\n\n\t.ProseMirror {\n\t\t--ak-editor-max-container-width: calc(100cqw - var(--ak-editor--large-gutter-padding));\n\t}\n\n\t/* We can't allow nodes that are inside other nodes to bleed from the parent container */\n\t.ProseMirror > div[data-prosemirror-node-block] [data-prosemirror-node-block] {\n\t\t--ak-editor-max-container-width: 100%;\n\t}\n\n\t/* container editor-area is defined in platform/packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts */\n\t@container editor-area (width >= ", ") {\n\t\t.ProseMirror {\n\t\t\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t\t}\n\t}\n\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: ", "px;\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t}\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t/**\n\t * This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24\n\t *\n\t * 1. Merge and Release platform_editor_hide_cursor_when_pm_hideselection\n\t * 2. Cleanup duplicated style from platform_editor_advanced_code_blocks\n\t * https://product-fabric.atlassian.net/browse/ED-26331\n\t */\n\t", "\n\n\t/* This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24 */\n\t", "\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t.ProseMirror.ProseMirror-focused:has(.ProseMirror-mark-boundary-cursor) {\n\t\tcaret-color: transparent;\n\t}\n\t.ProseMirror:not(.ProseMirror-focused) .ProseMirror-mark-boundary-cursor {\n\t\tdisplay: none;\n\t}\n\n\t", "\n\t", "\n\t", "\n\t", "\n\t", "\n\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n\t", "\n\t", "\n\t", "\n\t", "\n\t", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n /* Switch between the two icons based on the visual refresh feature gate */\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\t", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.mediaGroupView-content-wrap ul {\n\t\tpadding: 0;\n\t}\n\n\t/** Needed to override any cleared floats, e.g. image wrapping */\n\n\tdiv.fabric-editor-block-mark[class^='fabric-editor-align'] {\n\t\tclear: none !important;\n\t}\n\n\t.fabric-editor-align-end {\n\t\ttext-align: right;\n\t}\n\n\t.fabric-editor-align-start {\n\t\ttext-align: left;\n\t}\n\n\t.fabric-editor-align-center {\n\t\ttext-align: center;\n\t}\n\n\t/* For FullPage only when inside a table\n\tRelated code all lives inside: packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts\n\tIn the \"editorContentAreaContainerStyle\" function */\n\t.fabric-editor--full-width-mode {\n\t\t.pm-table-container {\n\t\t\t.code-block,\n\t\t\t.extension-container,\n\t\t\t.multiBodiedExtension--container {\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\t}\n\n\t.pm-table-header-content-wrap :not(.fabric-editor-alignment),\n\t.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,\n\t.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {\n\t\tp:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n\t\tclear: both;\n\t}\n\n\t.hyperlink-floating-toolbar,\n\t.", " {\n\t\tpadding: 0;\n\t}\n\n\t/* Legacy Link icon in the Atlaskit package\n is bigger than the others, new ADS icon does not have this issue\n */\n\t", "\n"])), akEditorGutterPadding, akEditorGutterPaddingDynamic(), akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorBreakpointForSmallDevice, akEditorCalculatedWideLayoutWidth, editorFontSize({
141
149
  theme: props.theme
142
- }), whitespaceSharedStyles, paragraphSharedStyles(props.typographyTheme), listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, fg('platform_editor_hide_cursor_when_pm_hideselection') ? css(_templateObject0 || (_templateObject0 = _taggedTemplateLiteral(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, editorExperiment('platform_editor_advanced_code_blocks', true) ? css(_templateObject1 || (_templateObject1 = _taggedTemplateLiteral(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, editorExperiment('platform_editor_controls', 'variant1') ? placeholderOverflowStyles : null, editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_quick_insert_placeholder') ? placeholderWrapStyles : null, codeBlockStyles(), blocktypeStyles(props.typographyTheme), codeMarkSharedStyles(), textColorStyles, backgroundColorStyles(), listsStyles, ruleStyles(), mediaStyles(), layoutStyles(props.viewMode), fg('confluence_team_presence_scroll_to_pointer') ? telepointerStyle : telepointerStyleWithInitialOnly, gapCursorStyles, panelStyles(), mentionsStyles, editorExperiment('platform_editor_vanilla_dom', true, {
150
+ }), whitespaceSharedStyles, paragraphSharedStyles(props.typographyTheme), listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, fg('platform_editor_hide_cursor_when_pm_hideselection') ? css(_templateObject0 || (_templateObject0 = _taggedTemplateLiteral(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, editorExperiment('platform_editor_advanced_code_blocks', true) ? css(_templateObject1 || (_templateObject1 = _taggedTemplateLiteral(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, "var(--ds-border-focused, #8cf)", fg('platform_editor_fix_floating_toolbar_focus') ? firstFloatingToolbarButtonStyles : null, placeholderTextStyles, placeholderStyles, editorExperiment('platform_editor_controls', 'variant1') ? placeholderOverflowStyles : null, editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_quick_insert_placeholder') ? placeholderWrapStyles : null, codeBlockStyles(), blocktypeStyles(props.typographyTheme), codeMarkSharedStyles(), textColorStyles, backgroundColorStyles(), listsStyles, ruleStyles(), mediaStyles(), layoutStyles(props.viewMode), fg('confluence_team_presence_scroll_to_pointer') ? telepointerStyle : telepointerStyleWithInitialOnly, gapCursorStyles, panelStyles(), mentionsStyles, editorExperiment('platform_editor_vanilla_dom', true, {
143
151
  exposure: false
144
152
  }) && vanillaMentionsStyles, editorExperiment('platform_editor_vanilla_dom', true, {
145
153
  exposure: false
@@ -14,14 +14,11 @@ import { css, jsx, useTheme } from '@emotion/react';
14
14
  import { browser } from '@atlaskit/editor-common/browser';
15
15
  import { gapCursorStyles } from '@atlaskit/editor-common/selection';
16
16
  import { GRID_GUTTER } from '@atlaskit/editor-common/styles';
17
- import { placeholderTextStyles } from '@atlaskit/editor-plugins/placeholder-text/styles';
18
17
  import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
19
18
  import { akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic, editorFontSize } from '@atlaskit/editor-shared-styles';
20
19
  import { fg } from '@atlaskit/platform-feature-flags';
21
20
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
22
21
  import { useThemeObserver } from '@atlaskit/tokens';
23
- import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewProducer.styles';
24
- import { expandStyles } from '../ContentStyles/expand';
25
22
  import { extensionStyles } from '../ContentStyles/extension';
26
23
  import { panelStyles } from '../ContentStyles/panel';
27
24
  import { statusStyles, vanillaStatusStyles } from '../ContentStyles/status';
@@ -36,16 +33,19 @@ import { dateStyles, dateVanillaStyles } from './styles/dateStyles';
36
33
  import { editorUGCTokensDefault, editorUGCTokensModernized, editorUGCTokensRefreshed } from './styles/editorUGCTokenStyles';
37
34
  import { embedCardStyles } from './styles/embedCardStyles';
38
35
  import { reactEmojiStyles, vanillaEmojiStyles } from './styles/emoji';
36
+ import { expandStyles, expandStylesMixin_fg_platform_editor_nested_dnd_styles_changes, expandStylesMixin_fg_platform_visual_refresh_icons, expandStylesMixin_without_fg_platform_editor_nested_dnd_styles_changes } from './styles/expandStyles';
39
37
  import { findReplaceStyles } from './styles/findReplaceStyles';
40
38
  import { firstBlockNodeStyles } from './styles/firstBlockNodeStyles';
41
39
  import { gridStyles } from './styles/gridStyles';
42
40
  import { indentationStyles } from './styles/indentationStyles';
41
+ import { InlineNodeViewSharedStyles } from './styles/inlineNodeViewSharedStyles';
43
42
  import { layoutBaseStyles, layoutViewStyles } from './styles/layout';
44
43
  import { linkStyles, linkStylesOld } from './styles/link';
45
44
  import { listsStyles, listsStylesSafariFix } from './styles/list';
46
45
  import { mediaStyles } from './styles/mediaStyles';
47
46
  import { mentionsStyles, vanillaMentionsStyles, vanillaMentionsSelectionStyles } from './styles/mentions';
48
47
  import { paragraphStylesOld, paragraphStylesUGCModernized, paragraphStylesUGCRefreshed } from './styles/paragraphStyles';
48
+ import { placeholderTextStyles } from './styles/placeholderTextStyles';
49
49
  import { resizerStyles, pragmaticResizerStyles } from './styles/resizerStyles';
50
50
  import { ruleStyles } from './styles/rule';
51
51
  import { shadowStyles } from './styles/shadowStyles';
@@ -97,7 +97,7 @@ var akEditorBreakpointForSmallDevice = "1266px";
97
97
 
98
98
  // jest warning: JSDOM version (22) doesn't support the new @container CSS rule
99
99
  var contentStyles = function contentStyles() {
100
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t--ak-editor--default-gutter-padding: ", "px;\n\t/* 52 is from akEditorGutterPaddingDynamic via editor-shared-styles */\n\t--ak-editor--large-gutter-padding: ", "px;\n\t--ak-editor--default-layout-width: ", "px;\n\t--ak-editor--full-width-layout-width: ", "px;\n\t/* calculate editor line length, 100cqw is the editor container width */\n\t--ak-editor--line-length: min(\n\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\tvar(--ak-editor--default-layout-width)\n\t);\n\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t--ak-editor--breakout-full-page-guttering-padding: calc(\n\t\tvar(--ak-editor--large-gutter-padding) * 2 + var(--ak-editor--default-gutter-padding)\n\t);\n\n\t.fabric-editor--full-width-mode {\n\t\t--ak-editor--line-length: min(\n\t\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\t\tvar(--ak-editor--full-width-layout-width)\n\t\t);\n\t}\n\n\t.ProseMirror {\n\t\t--ak-editor-max-container-width: calc(100cqw - var(--ak-editor--large-gutter-padding));\n\t}\n\n\t/* We can't allow nodes that are inside other nodes to bleed from the parent container */\n\t.ProseMirror > div[data-prosemirror-node-block] [data-prosemirror-node-block] {\n\t\t--ak-editor-max-container-width: 100%;\n\t}\n\n\t/* container editor-area is defined in platform/packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts */\n\t@container editor-area (width >= ", ") {\n\t\t.ProseMirror {\n\t\t\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t\t}\n\t}\n\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: var(--ak-editor-base-font-size);\n\n\t\t", ";\n\n\t\t", ";\n\n\t\t", ";\n\n\t\t", ";\n\t}\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t/**\n\t * This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24\n\t *\n\t * 1. Merge and Release platform_editor_hide_cursor_when_pm_hideselection\n\t * 2. Cleanup duplicated style from platform_editor_advanced_code_blocks\n\t * https://product-fabric.atlassian.net/browse/ED-26331\n\t */\n\t", "\n\n\t/* This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24 */\n\t", "\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t.ProseMirror.ProseMirror-focused:has(.ProseMirror-mark-boundary-cursor) {\n\t\tcaret-color: transparent;\n\t}\n\t.ProseMirror:not(.ProseMirror-focused) .ProseMirror-mark-boundary-cursor {\n\t\tdisplay: none;\n\t}\n\n\t", "\n\n\t", "\n\n\t", "\n\n\t", "\n\n\t", "\n\n\t", "\n\t", "\n \t", "\n\n\n \t", "\n\n\t", "\n\t", "\n\n\t", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n /* This needs to be after telepointer styles as some overlapping rules have equal specificity, and so the order is significant */\n ", "\n\n ", ";\n\n\t", "\n\n\t", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n // Switch between the two icons based on the visual refresh feature gate\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n\t.panelView-content-wrap {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.mediaGroupView-content-wrap ul {\n\t\tpadding: 0;\n\t}\n\n\t/** Needed to override any cleared floats, e.g. image wrapping */\n\n\tdiv.fabric-editor-block-mark[class^='fabric-editor-align'] {\n\t\tclear: none !important;\n\t}\n\n\t.fabric-editor-align-end {\n\t\ttext-align: right;\n\t}\n\n\t.fabric-editor-align-start {\n\t\ttext-align: left;\n\t}\n\n\t.fabric-editor-align-center {\n\t\ttext-align: center;\n\t}\n\n\t// For FullPage only when inside a table\n\t// Related code all lives inside: packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts\n\t// In the \"editorContentAreaContainerStyle\" function\n\t.fabric-editor--full-width-mode {\n\t\t.pm-table-container {\n\t\t\t.code-block,\n\t\t\t.extension-container,\n\t\t\t.multiBodiedExtension--container {\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\t}\n\n\t.pm-table-header-content-wrap :not(.fabric-editor-alignment),\n\t.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,\n\t.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {\n\t\tp:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n\t\tclear: both;\n\t}\n\n\t.hyperlink-floating-toolbar {\n\t\tpadding: 0;\n\t}\n\n\t/* Legacy Link icon in the Atlaskit package\n\t is bigger than the others, new ADS icon does not have this issue\n */\n\t", "\n"])), akEditorGutterPadding, akEditorGutterPaddingDynamic(), akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorBreakpointForSmallDevice, akEditorCalculatedWideLayoutWidth, whitespaceStyles, indentationStyles, shadowStyles, InlineNodeViewSharedStyles, fg('platform_editor_hide_cursor_when_pm_hideselection') ? css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, editorExperiment('platform_editor_advanced_code_blocks', true) ? css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, editorExperiment('platform_editor_controls', 'variant1') ? placeholderOverflowStyles : null, editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_quick_insert_placeholder') ? placeholderWrapStyles : null, codeBlockStyles, !fg('platform_editor_typography_ugc') && editorUGCTokensDefault,
100
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t--ak-editor--default-gutter-padding: ", "px;\n\t/* 52 is from akEditorGutterPaddingDynamic via editor-shared-styles */\n\t--ak-editor--large-gutter-padding: ", "px;\n\t--ak-editor--default-layout-width: ", "px;\n\t--ak-editor--full-width-layout-width: ", "px;\n\t/* calculate editor line length, 100cqw is the editor container width */\n\t--ak-editor--line-length: min(\n\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\tvar(--ak-editor--default-layout-width)\n\t);\n\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t--ak-editor--breakout-full-page-guttering-padding: calc(\n\t\tvar(--ak-editor--large-gutter-padding) * 2 + var(--ak-editor--default-gutter-padding)\n\t);\n\n\t.fabric-editor--full-width-mode {\n\t\t--ak-editor--line-length: min(\n\t\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\t\tvar(--ak-editor--full-width-layout-width)\n\t\t);\n\t}\n\n\t.ProseMirror {\n\t\t--ak-editor-max-container-width: calc(100cqw - var(--ak-editor--large-gutter-padding));\n\t}\n\n\t/* We can't allow nodes that are inside other nodes to bleed from the parent container */\n\t.ProseMirror > div[data-prosemirror-node-block] [data-prosemirror-node-block] {\n\t\t--ak-editor-max-container-width: 100%;\n\t}\n\n\t/* container editor-area is defined in platform/packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts */\n\t@container editor-area (width >= ", ") {\n\t\t.ProseMirror {\n\t\t\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t\t}\n\t}\n\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: var(--ak-editor-base-font-size);\n\n\t\t", ";\n\n\t\t", ";\n\n\t\t", ";\n\n\t\t", ";\n\t}\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t/**\n\t * This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24\n\t *\n\t * 1. Merge and Release platform_editor_hide_cursor_when_pm_hideselection\n\t * 2. Cleanup duplicated style from platform_editor_advanced_code_blocks\n\t * https://product-fabric.atlassian.net/browse/ED-26331\n\t */\n\t", "\n\n\t/* This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24 */\n\t", "\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t.ProseMirror.ProseMirror-focused:has(.ProseMirror-mark-boundary-cursor) {\n\t\tcaret-color: transparent;\n\t}\n\t.ProseMirror:not(.ProseMirror-focused) .ProseMirror-mark-boundary-cursor {\n\t\tdisplay: none;\n\t}\n\n\t", "\n\n\t", "\n\n\t", "\n\n\t", "\n\n\t", "\n\n\t", "\n\t", "\n \t", "\n\n\n \t", "\n\n\t", "\n\t", "\n\n\t", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n /* This needs to be after telepointer styles as some overlapping rules have equal specificity, and so the order is significant */\n ", "\n\n ", ";\n\n\t", "\n\n\t", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n ", "\n ", "\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n // Switch between the two icons based on the visual refresh feature gate\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n\t.panelView-content-wrap {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.mediaGroupView-content-wrap ul {\n\t\tpadding: 0;\n\t}\n\n\t/** Needed to override any cleared floats, e.g. image wrapping */\n\n\tdiv.fabric-editor-block-mark[class^='fabric-editor-align'] {\n\t\tclear: none !important;\n\t}\n\n\t.fabric-editor-align-end {\n\t\ttext-align: right;\n\t}\n\n\t.fabric-editor-align-start {\n\t\ttext-align: left;\n\t}\n\n\t.fabric-editor-align-center {\n\t\ttext-align: center;\n\t}\n\n\t// For FullPage only when inside a table\n\t// Related code all lives inside: packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts\n\t// In the \"editorContentAreaContainerStyle\" function\n\t.fabric-editor--full-width-mode {\n\t\t.pm-table-container {\n\t\t\t.code-block,\n\t\t\t.extension-container,\n\t\t\t.multiBodiedExtension--container {\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\t}\n\n\t.pm-table-header-content-wrap :not(.fabric-editor-alignment),\n\t.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,\n\t.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {\n\t\tp:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n\t\tclear: both;\n\t}\n\n\t.hyperlink-floating-toolbar {\n\t\tpadding: 0;\n\t}\n\n\t/* Legacy Link icon in the Atlaskit package\n\t is bigger than the others, new ADS icon does not have this issue\n */\n\t", "\n"])), akEditorGutterPadding, akEditorGutterPaddingDynamic(), akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorBreakpointForSmallDevice, akEditorCalculatedWideLayoutWidth, whitespaceStyles, indentationStyles, shadowStyles, InlineNodeViewSharedStyles, fg('platform_editor_hide_cursor_when_pm_hideselection') ? css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, editorExperiment('platform_editor_advanced_code_blocks', true) ? css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, editorExperiment('platform_editor_controls', 'variant1') ? placeholderOverflowStyles : null, editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_quick_insert_placeholder') ? placeholderWrapStyles : null, codeBlockStyles, !fg('platform_editor_typography_ugc') && editorUGCTokensDefault,
101
101
  // eslint-disable-next-line @atlaskit/platform/no-preconditioning
102
102
  fg('platform_editor_typography_ugc') && ( /* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
103
103
  fg('platform-dst-jira-web-fonts') || fg('confluence_typography_refreshed') || fg('atlas_editor_typography_refreshed')) && editorUGCTokensRefreshed
@@ -105,7 +105,7 @@ var contentStyles = function contentStyles() {
105
105
  // eslint-disable-next-line @atlaskit/platform/no-preconditioning
106
106
  fg('platform_editor_typography_ugc') && /* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
107
107
  !(fg('platform-dst-jira-web-fonts') || fg('confluence_typography_refreshed') || fg('atlas_editor_typography_refreshed')) && editorUGCTokensModernized
108
- /* eslint-enable @atlaskit/platform/ensure-feature-flag-prefix */, blocktypeStyles, fg('platform_editor_typography_ugc') && blocktypeStyles_fg_platform_editor_typography_ugc, !fg('platform_editor_typography_ugc') && blocktypeStyles_without_fg_platform_editor_typography_ugc, fg('platform_editor_nested_dnd_styles_changes') && blocktypeStyles_fg_platform_editor_nested_dnd_styles_changes, codeMarkStyles, textColorStyles, backgroundColorStyles, listsStyles, ruleStyles, mediaStyles, fg('confluence_team_presence_scroll_to_pointer') ? telepointerStyle : telepointerStyleWithInitialOnly, telepointerColorAndCommonStyle, gapCursorStyles, panelStyles(), mentionsStyles, tasksAndDecisionsStyles, gridStyles, blockMarksStyles, dateStyles, extensionStyles, expandStyles(), findReplaceStyles, textHighlightStyle, decisionStyles, editorExperiment('platform_editor_vanilla_dom', true, {
108
+ /* eslint-enable @atlaskit/platform/ensure-feature-flag-prefix */, blocktypeStyles, fg('platform_editor_typography_ugc') && blocktypeStyles_fg_platform_editor_typography_ugc, !fg('platform_editor_typography_ugc') && blocktypeStyles_without_fg_platform_editor_typography_ugc, fg('platform_editor_nested_dnd_styles_changes') && blocktypeStyles_fg_platform_editor_nested_dnd_styles_changes, codeMarkStyles, textColorStyles, backgroundColorStyles, listsStyles, ruleStyles, mediaStyles, fg('confluence_team_presence_scroll_to_pointer') ? telepointerStyle : telepointerStyleWithInitialOnly, telepointerColorAndCommonStyle, gapCursorStyles, panelStyles(), mentionsStyles, tasksAndDecisionsStyles, gridStyles, blockMarksStyles, dateStyles, extensionStyles, expandStyles, fg('platform_editor_nested_dnd_styles_changes') && expandStylesMixin_fg_platform_editor_nested_dnd_styles_changes, !fg('platform_editor_nested_dnd_styles_changes') && expandStylesMixin_without_fg_platform_editor_nested_dnd_styles_changes, fg('platform-visual-refresh-icons') && expandStylesMixin_fg_platform_visual_refresh_icons, findReplaceStyles, textHighlightStyle, decisionStyles, editorExperiment('platform_editor_vanilla_dom', true, {
109
109
  exposure: false
110
110
  }) && vanillaTaskItemStyles, editorExperiment('platform_editor_vanilla_dom', true, {
111
111
  exposure: false
@@ -181,6 +181,14 @@ var listLayoutShiftFix = css({
181
181
  }
182
182
  });
183
183
 
184
+ // Make sure the first floating toolbar button has focus ring when focused via .focus()
185
+ var firstFloatingToolbarButtonStyles = css({
186
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
187
+ 'button.first-floating-toolbar-button:focus': {
188
+ outline: "2px solid ".concat("var(--ds-border-focused, #2684FF)")
189
+ }
190
+ });
191
+
184
192
  /**
185
193
  * EditorContentStyles is a wrapper component that applies styles to its children
186
194
  * based on the provided feature flags, view mode, and other props.
@@ -255,7 +263,7 @@ var EditorContentContainer = /*#__PURE__*/React.forwardRef(function (props, ref)
255
263
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
256
264
  vanillaEmojiStyles :
257
265
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
258
- reactEmojiStyles],
266
+ reactEmojiStyles, fg('platform_editor_fix_floating_toolbar_focus') && firstFloatingToolbarButtonStyles],
259
267
  "data-editor-scroll-container": isScrollable ? 'true' : undefined,
260
268
  "data-testid": "editor-content-container",
261
269
  style: {