@atlaskit/editor-core 207.2.0 → 207.3.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 (64) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/cjs/ui/Appearance/Chromeless.js +27 -11
  3. package/dist/cjs/ui/Appearance/Comment/Comment.js +25 -5
  4. package/dist/cjs/ui/Appearance/FullPage/FullPage.js +26 -4
  5. package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +2 -2
  6. package/dist/cjs/ui/ContentStyles/layout.js +2 -2
  7. package/dist/cjs/ui/ContextPanel/index.js +10 -4
  8. package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +29 -234
  9. package/dist/cjs/ui/EditorContentContainer/styles/ai-panel.js +97 -0
  10. package/dist/cjs/ui/EditorContentContainer/styles/annotationStyles.js +45 -0
  11. package/dist/cjs/ui/EditorContentContainer/styles/embedCardStyles.js +34 -0
  12. package/dist/cjs/ui/EditorContentContainer/styles/layout.js +126 -0
  13. package/dist/cjs/ui/EditorContentContainer/styles/link.js +32 -0
  14. package/dist/cjs/ui/EditorContentContainer/styles/rule.js +29 -0
  15. package/dist/cjs/version-wrapper.js +1 -1
  16. package/dist/es2019/ui/Appearance/Chromeless.js +28 -10
  17. package/dist/es2019/ui/Appearance/Comment/Comment.js +24 -3
  18. package/dist/es2019/ui/Appearance/FullPage/FullPage.js +24 -2
  19. package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +2 -2
  20. package/dist/es2019/ui/ContentStyles/layout.js +3 -2
  21. package/dist/es2019/ui/ContextPanel/index.js +11 -5
  22. package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +23 -773
  23. package/dist/es2019/ui/EditorContentContainer/styles/ai-panel.js +213 -0
  24. package/dist/es2019/ui/EditorContentContainer/styles/annotationStyles.js +47 -0
  25. package/dist/es2019/ui/EditorContentContainer/styles/embedCardStyles.js +27 -0
  26. package/dist/es2019/ui/EditorContentContainer/styles/layout.js +517 -0
  27. package/dist/es2019/ui/EditorContentContainer/styles/link.js +26 -0
  28. package/dist/es2019/ui/EditorContentContainer/styles/rule.js +22 -0
  29. package/dist/es2019/version-wrapper.js +1 -1
  30. package/dist/esm/ui/Appearance/Chromeless.js +28 -12
  31. package/dist/esm/ui/Appearance/Comment/Comment.js +26 -6
  32. package/dist/esm/ui/Appearance/FullPage/FullPage.js +27 -5
  33. package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +2 -2
  34. package/dist/esm/ui/ContentStyles/layout.js +2 -2
  35. package/dist/esm/ui/ContextPanel/index.js +11 -5
  36. package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +31 -237
  37. package/dist/esm/ui/EditorContentContainer/styles/ai-panel.js +91 -0
  38. package/dist/esm/ui/EditorContentContainer/styles/annotationStyles.js +37 -0
  39. package/dist/esm/ui/EditorContentContainer/styles/embedCardStyles.js +27 -0
  40. package/dist/esm/ui/EditorContentContainer/styles/layout.js +120 -0
  41. package/dist/esm/ui/EditorContentContainer/styles/link.js +26 -0
  42. package/dist/esm/ui/EditorContentContainer/styles/rule.js +21 -0
  43. package/dist/esm/version-wrapper.js +1 -1
  44. package/dist/types/ui/Appearance/Chromeless.d.ts +0 -4
  45. package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +1 -1
  46. package/dist/types/ui/Appearance/FullPage/getEditorViewModeSync.d.ts +1 -1
  47. package/dist/types/ui/EditorContentContainer/EditorContentContainer.d.ts +0 -11
  48. package/dist/types/ui/EditorContentContainer/styles/ai-panel.d.ts +2 -0
  49. package/dist/types/ui/EditorContentContainer/styles/annotationStyles.d.ts +1 -0
  50. package/dist/types/ui/EditorContentContainer/styles/embedCardStyles.d.ts +1 -0
  51. package/dist/types/ui/EditorContentContainer/styles/layout.d.ts +2 -0
  52. package/dist/types/ui/EditorContentContainer/styles/link.d.ts +2 -0
  53. package/dist/types/ui/EditorContentContainer/styles/rule.d.ts +1 -0
  54. package/dist/types-ts4.5/ui/Appearance/Chromeless.d.ts +0 -4
  55. package/dist/types-ts4.5/ui/Appearance/FullPage/FullPage.d.ts +1 -1
  56. package/dist/types-ts4.5/ui/Appearance/FullPage/getEditorViewModeSync.d.ts +1 -1
  57. package/dist/types-ts4.5/ui/EditorContentContainer/EditorContentContainer.d.ts +0 -11
  58. package/dist/types-ts4.5/ui/EditorContentContainer/styles/ai-panel.d.ts +2 -0
  59. package/dist/types-ts4.5/ui/EditorContentContainer/styles/annotationStyles.d.ts +1 -0
  60. package/dist/types-ts4.5/ui/EditorContentContainer/styles/embedCardStyles.d.ts +1 -0
  61. package/dist/types-ts4.5/ui/EditorContentContainer/styles/layout.d.ts +2 -0
  62. package/dist/types-ts4.5/ui/EditorContentContainer/styles/link.d.ts +2 -0
  63. package/dist/types-ts4.5/ui/EditorContentContainer/styles/rule.d.ts +1 -0
  64. package/package.json +2 -2
@@ -0,0 +1,517 @@
1
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
2
+ import { css } from "@emotion/react";
3
+ import { LAYOUT_SECTION_MARGIN, LAYOUT_COLUMN_PADDING } from "@atlaskit/editor-common/styles";
4
+ import { TableCssClassName } from "@atlaskit/editor-plugins/table/types";
5
+ import { tableMarginFullWidthMode } from "@atlaskit/editor-plugins/table/ui/consts";
6
+ import { gridMediumMaxWidth, akEditorSelectedNodeClassName, getSelectionStyles, SelectionStyle, akEditorSelectedBorderSize, akEditorDeleteBackground, akEditorDeleteBorder, akLayoutGutterOffset, akEditorSwoopCubicBezier } from "@atlaskit/editor-shared-styles";
7
+ import { fg } from "@atlaskit/platform-feature-flags";
8
+ import { editorExperiment } from "@atlaskit/tmp-editor-statsig/experiments";
9
+ const columnLayoutSharedStyle = css({
10
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
11
+ '[data-layout-section]': {
12
+ position: 'relative',
13
+ display: 'flex',
14
+ flexDirection: 'row',
15
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
16
+ '& > *': {
17
+ flex: 1,
18
+ minWidth: 0
19
+ },
20
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
21
+ '& > .unsupportedBlockView-content-wrap': {
22
+ minWidth: 'initial'
23
+ },
24
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
25
+ [`@media screen and (max-width: ${gridMediumMaxWidth}px)`]: {
26
+ flexDirection: 'column'
27
+ }
28
+ }
29
+ });
30
+ const columnLayoutResponsiveSharedStyle = css({
31
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
32
+ '[data-layout-section]': {
33
+ display: 'flex',
34
+ flexDirection: 'row',
35
+ gap: "var(--ds-space-100, 8px)",
36
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
37
+ '& > *': {
38
+ flex: 1,
39
+ minWidth: 0
40
+ },
41
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
42
+ '& > .unsupportedBlockView-content-wrap': {
43
+ minWidth: 'initial'
44
+ }
45
+ },
46
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
47
+ '.layout-section-container': {
48
+ containerType: 'inline-size',
49
+ containerName: 'layout-area'
50
+ }
51
+ });
52
+ const firstNodeWithNotMarginTop = () => fg('platform_editor_nested_dnd_styles_changes') ?
53
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
54
+ css`
55
+ > :nth-child(1 of :not(style, .ProseMirror-gapcursor, .ProseMirror-widget, span)) {
56
+ margin-top: 0;
57
+ }
58
+ ` :
59
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
60
+ css`
61
+ > :not(style):first-child,
62
+ > style:first-child + * {
63
+ margin-top: 0;
64
+ }
65
+
66
+ > .ProseMirror-gapcursor:first-child + *,
67
+ > style:first-child + .ProseMirror-gapcursor + * {
68
+ margin-top: 0;
69
+ }
70
+
71
+ > .ProseMirror-gapcursor:first-child + span + * {
72
+ margin-top: 0;
73
+ }
74
+ `;
75
+ const layoutColumnStyles = () => editorExperiment('advanced_layouts', true) ?
76
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
77
+ css`
78
+ > [data-layout-column] {
79
+ margin: 0 ${LAYOUT_SECTION_MARGIN / 2}px;
80
+ }
81
+
82
+ > [data-layout-column]:first-of-type {
83
+ margin-left: 0;
84
+ }
85
+
86
+ > [data-layout-column]:last-of-type {
87
+ margin-right: 0;
88
+ }
89
+
90
+ @media screen and (max-width: ${gridMediumMaxWidth}px) {
91
+ [data-layout-column] + [data-layout-column] {
92
+ margin: 0;
93
+ }
94
+ }
95
+
96
+ > [data-layout-column].${akEditorSelectedNodeClassName}:not(.danger) {
97
+ ${getSelectionStyles([SelectionStyle.Blanket])};
98
+ /* layout column selection shorter after layout border has been removed */
99
+ ::before {
100
+ width: calc(100% - 8px);
101
+ left: 4px;
102
+ border-radius: ${"var(--ds-border-radius, 3px)"};
103
+ }
104
+ }
105
+ ` :
106
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
107
+ css`
108
+ [data-layout-column] + [data-layout-column] {
109
+ margin-left: ${LAYOUT_SECTION_MARGIN}px;
110
+ }
111
+
112
+ @media screen and (max-width: ${gridMediumMaxWidth}px) {
113
+ [data-layout-column] + [data-layout-column] {
114
+ margin-left: 0;
115
+ }
116
+ }
117
+ `;
118
+ const layoutSectionStyles = () => editorExperiment('advanced_layouts', true) ?
119
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
120
+ css`
121
+ ${columnLayoutResponsiveSharedStyle};
122
+ .layout-section-container [data-layout-section] {
123
+ > .ProseMirror-widget {
124
+ flex: none;
125
+ display: contents !important;
126
+
127
+ &[data-blocks-drag-handle-container] div {
128
+ display: contents !important;
129
+ }
130
+
131
+ &[data-blocks-drop-target-container] {
132
+ display: block !important;
133
+ margin: ${"var(--ds-space-negative-050, -4px)"};
134
+
135
+ [data-drop-target-for-element] {
136
+ position: absolute;
137
+ }
138
+ }
139
+
140
+ & + [data-layout-column] {
141
+ margin: 0;
142
+ }
143
+ }
144
+
145
+ > [data-layout-column] {
146
+ margin: 0;
147
+ }
148
+ }
149
+ ` :
150
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
151
+ css`
152
+ ${columnLayoutSharedStyle}
153
+ `;
154
+
155
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
156
+ const layoutBorderBaseStyles = css`
157
+ /* TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.
158
+ This is because the default state already uses the same token and, as such, the hover style won't change anything.
159
+ https://product-fabric.atlassian.net/browse/DSP-4441 */
160
+ /* Shows the border when cursor is inside a layout */
161
+ &.selected [data-layout-column],
162
+ &:hover [data-layout-column] {
163
+ border: ${akEditorSelectedBorderSize}px solid ${"var(--ds-border, #091E4224)"};
164
+ }
165
+
166
+ &.selected.danger [data-layout-column] {
167
+ background-color: ${`var(--ds-background-danger, ${akEditorDeleteBackground})`};
168
+ border-color: ${`var(--ds-border-danger, ${akEditorDeleteBorder})`};
169
+ }
170
+
171
+ &.${akEditorSelectedNodeClassName}:not(.danger) {
172
+ [data-layout-column] {
173
+ ${getSelectionStyles([SelectionStyle.Border, SelectionStyle.Blanket])}
174
+ ::after {
175
+ background-color: transparent;
176
+ }
177
+ }
178
+ }
179
+ `;
180
+
181
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
182
+ const layoutBorderViewStyles = css`
183
+ &.selected [data-layout-column],
184
+ &:hover [data-layout-column] {
185
+ border: 0;
186
+ }
187
+ `;
188
+
189
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
190
+ const columnSeparatorBaseStyles = css`
191
+ [data-layout-content]::before {
192
+ content: '';
193
+ border-left: ${akEditorSelectedBorderSize}px solid ${"var(--ds-border, #091E4224)"};
194
+ position: absolute;
195
+ height: calc(100% - 24px);
196
+ margin-left: -25px;
197
+ }
198
+ `;
199
+
200
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
201
+ const columnSeparatorViewStyles = css`
202
+ [data-layout-content]::before {
203
+ border-left: 0;
204
+ }
205
+ `;
206
+
207
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
208
+ const rowSeparatorBaseStyles = css`
209
+ [data-layout-content]::before {
210
+ content: '';
211
+ border-top: ${akEditorSelectedBorderSize}px solid ${"var(--ds-border, #091E4224)"};
212
+ position: absolute;
213
+ width: calc(100% - 32px);
214
+ margin-top: -13px;
215
+
216
+ /* clear styles for column separator */
217
+ border-left: unset;
218
+ margin-left: unset;
219
+ height: unset;
220
+ }
221
+ `;
222
+
223
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
224
+ const rowSeparatorViewStyles = css`
225
+ [data-layout-content]::before {
226
+ border-top: 0;
227
+ }
228
+ `;
229
+
230
+ // jest warning: JSDOM version (22) doesn't support the new @container CSS rule
231
+ const layoutWithSeparatorBorderResponsiveBaseStyles = (breakpoint
232
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
233
+ ) => css`
234
+ &.selected,
235
+ &:hover,
236
+ &.selected.danger,
237
+ &.${akEditorSelectedNodeClassName}:not(.danger) {
238
+ [data-layout-column]:not(:first-of-type) {
239
+ @container editor-area (max-width:${breakpoint}px) {
240
+ ${rowSeparatorBaseStyles}
241
+ }
242
+ }
243
+ }
244
+ `;
245
+
246
+ // jest warning: JSDOM version (22) doesn't support the new @container CSS rule
247
+ const layoutWithSeparatorBorderResponsiveViewStyles = (breakpoint
248
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
249
+ ) => css`
250
+ &.selected,
251
+ &:hover,
252
+ &.selected.danger,
253
+ &.${akEditorSelectedNodeClassName}:not(.danger) {
254
+ [data-layout-column]:not(:first-of-type) {
255
+ @container editor-area (max-width:${breakpoint}px) {
256
+ ${rowSeparatorViewStyles}
257
+ }
258
+ }
259
+ }
260
+ `;
261
+
262
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
263
+ const layoutWithSeparatorBorderBaseStyles = css`
264
+ &.selected [data-layout-column]:not(:first-of-type),
265
+ [data-empty-layout='true'] [data-layout-column]:not(:first-of-type),
266
+ &:hover [data-layout-column]:not(:first-of-type) {
267
+ ${columnSeparatorBaseStyles}
268
+ }
269
+
270
+ &.selected.danger [data-layout-section] {
271
+ background-color: ${`var(--ds-background-danger, ${akEditorDeleteBackground})`};
272
+
273
+ box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px ${akEditorDeleteBorder};
274
+ border-radius: 4px;
275
+ [data-layout-column]:not(:first-of-type) {
276
+ ${columnSeparatorBaseStyles}
277
+ }
278
+ }
279
+
280
+ &.${akEditorSelectedNodeClassName}:not(.danger) [data-layout-section] {
281
+ box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px ${"var(--ds-border-selected, #0C66E4)"};
282
+ border-radius: 4px;
283
+ background-color: ${"var(--ds-background-selected, #E9F2FF)"};
284
+ [data-layout-column] {
285
+ ${getSelectionStyles([SelectionStyle.Blanket])}
286
+ border: 0px;
287
+ ::before {
288
+ background-color: transparent;
289
+ }
290
+ }
291
+ [data-layout-column]:not(:first-of-type) {
292
+ ${columnSeparatorBaseStyles}
293
+ }
294
+ }
295
+ `;
296
+
297
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
298
+ const layoutWithSeparatorBorderViewStyles = css`
299
+ &.selected [data-layout-column]:not(:first-of-type),
300
+ [data-empty-layout='true'] [data-layout-column]:not(:first-of-type),
301
+ &:hover [data-layout-column]:not(:first-of-type) {
302
+ ${columnSeparatorViewStyles}
303
+ }
304
+
305
+ &.selected.danger [data-layout-section] {
306
+ box-shadow: 0 0 0 0 ${akEditorDeleteBorder};
307
+ [data-layout-column]:not(:first-of-type) {
308
+ ${columnSeparatorViewStyles}
309
+ }
310
+ }
311
+
312
+ &.${akEditorSelectedNodeClassName}:not(.danger) [data-layout-section] {
313
+ box-shadow: 0 0 0 0 ${"var(--ds-border-selected, #0C66E4)"};
314
+ [data-layout-column]:not(:first-of-type) {
315
+ ${columnSeparatorViewStyles}
316
+ }
317
+ }
318
+ `;
319
+
320
+ // jest warning: JSDOM version (22) doesn't support the new @container CSS rule
321
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
322
+ const layoutResponsiveBaseStyles = css`
323
+ /* chosen breakpoints in container queries are to make sure layout responsiveness in editor aligns with renderer */
324
+ /* not resized layout in full-width editor */
325
+ .fabric-editor--full-width-mode .ProseMirror {
326
+ > .layoutSectionView-content-wrap {
327
+ [data-layout-section] {
328
+ @container editor-area (max-width:724px) {
329
+ flex-direction: column;
330
+ }
331
+ }
332
+
333
+ ${layoutWithSeparatorBorderResponsiveBaseStyles(724)}
334
+ }
335
+ }
336
+
337
+ /* not resized layout in fixed-width editor */
338
+ .ak-editor-content-area:not(.fabric-editor--full-width-mode) .ProseMirror {
339
+ > .layoutSectionView-content-wrap {
340
+ [data-layout-section] {
341
+ @container editor-area (max-width:788px) {
342
+ flex-direction: column;
343
+ }
344
+ }
345
+
346
+ ${layoutWithSeparatorBorderResponsiveBaseStyles(788)}
347
+ }
348
+ }
349
+
350
+ /* resized layout in full/fixed-width editor */
351
+ .ProseMirror .fabric-editor-breakout-mark {
352
+ .layoutSectionView-content-wrap {
353
+ [data-layout-section] {
354
+ @container editor-area (max-width:820px) {
355
+ flex-direction: column;
356
+ }
357
+ }
358
+
359
+ ${layoutWithSeparatorBorderResponsiveBaseStyles(820)}
360
+ }
361
+ }
362
+ `;
363
+
364
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
365
+ const layoutResponsiveViewStyles = css`
366
+ /* chosen breakpoints in container queries are to make sure layout responsiveness in editor aligns with renderer */
367
+ /* not resized layout in full-width editor */
368
+ .fabric-editor--full-width-mode .ProseMirror {
369
+ > .layoutSectionView-content-wrap {
370
+ ${layoutWithSeparatorBorderResponsiveViewStyles(724)}
371
+ }
372
+ }
373
+
374
+ /* not resized layout in fixed-width editor */
375
+ .ak-editor-content-area:not(.fabric-editor--full-width-mode) .ProseMirror {
376
+ > .layoutSectionView-content-wrap {
377
+ ${layoutWithSeparatorBorderResponsiveViewStyles(788)}
378
+ }
379
+ }
380
+
381
+ /* resized layout in full/fixed-width editor */
382
+ .ProseMirror .fabric-editor-breakout-mark {
383
+ .layoutSectionView-content-wrap {
384
+ ${layoutWithSeparatorBorderResponsiveViewStyles(820)}
385
+ }
386
+ }
387
+ `;
388
+
389
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
390
+ export const layoutBaseStyles = () => css`
391
+ .ProseMirror {
392
+ ${layoutSectionStyles()}
393
+ [data-layout-section] {
394
+ /* Ignored via go/ees007
395
+ TODO: Migrate away from gridSize
396
+ Recommendation: Replace directly with 7px */
397
+ margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? 8 : 0)}px 0;
398
+ transition: border-color 0.3s ${akEditorSwoopCubicBezier};
399
+ cursor: pointer;
400
+
401
+ /* Inner cursor located 26px from left */
402
+ [data-layout-column] {
403
+ flex: 1;
404
+ position: relative;
405
+
406
+ min-width: 0;
407
+ /* disable 4 borders when in view mode and advanced layouts is on */
408
+ border: ${editorExperiment('advanced_layouts', true) ? 0 : akEditorSelectedBorderSize}px
409
+ solid ${"var(--ds-border, #091E4224)"};
410
+ border-radius: 4px;
411
+ padding: ${LAYOUT_COLUMN_PADDING}px
412
+ ${LAYOUT_COLUMN_PADDING + (fg('platform_editor_nested_dnd_styles_changes') ? 8 : 0)}px;
413
+ box-sizing: border-box;
414
+
415
+ > div {
416
+ ${firstNodeWithNotMarginTop()}
417
+
418
+ > .embedCardView-content-wrap:first-of-type .rich-media-item {
419
+ margin-top: 0;
420
+ }
421
+
422
+ > .mediaSingleView-content-wrap:first-of-type .rich-media-item {
423
+ margin-top: 0;
424
+ }
425
+
426
+ > .ProseMirror-gapcursor.-right:first-child
427
+ + .mediaSingleView-content-wrap
428
+ .rich-media-item,
429
+ > style:first-child
430
+ + .ProseMirror-gapcursor.-right
431
+ + .mediaSingleView-content-wrap
432
+ .rich-media-item,
433
+ > .ProseMirror-gapcursor.-right:first-of-type
434
+ + .embedCardView-content-wrap
435
+ .rich-media-item {
436
+ margin-top: 0;
437
+ }
438
+
439
+ > .ProseMirror-gapcursor:first-child
440
+ + span
441
+ + .mediaSingleView-content-wrap
442
+ .rich-media-item,
443
+ > style:first-child
444
+ + .ProseMirror-gapcursor
445
+ + span
446
+ + .mediaSingleView-content-wrap
447
+ .rich-media-item {
448
+ margin-top: 0;
449
+ }
450
+
451
+ /* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down
452
+ and shrinking layout's node selectable area (leniency margin) */
453
+ > [data-node-type='decisionList'] {
454
+ li:first-of-type [data-decision-wrapper] {
455
+ margin-top: 0;
456
+ }
457
+ }
458
+ }
459
+
460
+ /* Make the 'content' fill the entire height of the layout column to allow click
461
+ handler of layout section nodeview to target only data-layout-column */
462
+ [data-layout-content] {
463
+ height: 100%;
464
+ cursor: text;
465
+ .mediaGroupView-content-wrap {
466
+ clear: both;
467
+ }
468
+ }
469
+ }
470
+
471
+ ${layoutColumnStyles()}
472
+ }
473
+
474
+ /* styles to support borders for layout */
475
+ [data-layout-section],
476
+ .layoutSectionView-content-wrap {
477
+ ${editorExperiment('advanced_layouts', true) ? layoutWithSeparatorBorderBaseStyles : layoutBorderBaseStyles}
478
+ }
479
+ }
480
+
481
+ ${editorExperiment('advanced_layouts', true) && layoutResponsiveBaseStyles}
482
+
483
+ /* hide separator when element is dragging on top of a layout column */
484
+ [data-blocks-drop-target-container] ~ [data-layout-column] > [data-layout-content]::before {
485
+ display: none;
486
+ }
487
+
488
+ .fabric-editor--full-width-mode .ProseMirror {
489
+ [data-layout-section] {
490
+ .${TableCssClassName.TABLE_CONTAINER} {
491
+ margin: 0 ${tableMarginFullWidthMode}px;
492
+ }
493
+ }
494
+ }
495
+
496
+ ${editorExperiment('advanced_layouts', false) && fg('platform_editor_nested_dnd_styles_changes') && `.ak-editor-content-area.appearance-full-page .ProseMirror [data-layout-section] {
497
+ margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset + 8}px 0;
498
+ }`}
499
+ `;
500
+
501
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/ui-styling-standard/no-exported-styles -- Needs manual remediation
502
+ export const layoutViewStyles = css`
503
+ .ProseMirror {
504
+ [data-layout-section] {
505
+ cursor: default;
506
+ [data-layout-column] {
507
+ border: 0;
508
+ }
509
+ }
510
+ [data-layout-section],
511
+ .layoutSectionView-content-wrap {
512
+ ${editorExperiment('advanced_layouts', true) ? layoutWithSeparatorBorderViewStyles : layoutBorderViewStyles}
513
+ }
514
+ }
515
+
516
+ ${editorExperiment('advanced_layouts', true) && layoutResponsiveViewStyles}
517
+ `;
@@ -0,0 +1,26 @@
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 linkStyles = css({
6
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
7
+ '.ProseMirror a.blockLink': {
8
+ display: 'block'
9
+ },
10
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
11
+ '.ProseMirror a[data-prosemirror-mark-name="link"]': {
12
+ textDecoration: 'underline'
13
+ },
14
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
15
+ '.ProseMirror a[data-prosemirror-mark-name="link"]:hover': {
16
+ textDecoration: 'none'
17
+ }
18
+ });
19
+
20
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
21
+ export const linkStylesOld = css({
22
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
23
+ '.ProseMirror a.blockLink': {
24
+ display: 'block'
25
+ }
26
+ });
@@ -0,0 +1,22 @@
1
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
2
+ import { css } from "@emotion/react";
3
+ import { akEditorSelectedNodeClassName } from "@atlaskit/editor-shared-styles";
4
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
5
+ export const ruleStyles = css({
6
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
7
+ '.ProseMirror hr': {
8
+ border: 'none',
9
+ backgroundColor: "var(--ds-border, #091E4224)",
10
+ height: '2px',
11
+ borderRadius: '1px',
12
+ cursor: 'pointer',
13
+ padding: `${"var(--ds-space-050, 4px)"} 0`,
14
+ margin: `${"var(--ds-space-300, 24px)"} 0`,
15
+ backgroundClip: 'content-box'
16
+ },
17
+ // 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
18
+ [`.ProseMirror hr.${akEditorSelectedNodeClassName}`]: {
19
+ outline: 'none',
20
+ backgroundColor: "var(--ds-border-selected, #0C66E4)"
21
+ }
22
+ });
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "207.2.0";
2
+ export const version = "207.3.0";
@@ -14,7 +14,8 @@ import React, { Fragment } from 'react';
14
14
 
15
15
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
16
16
  import { css, jsx } from '@emotion/react';
17
- import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
17
+ import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
18
+ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
18
19
  import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
19
20
  import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
20
21
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
@@ -53,6 +54,13 @@ var EditorContainer = componentWithCondition(function () {
53
54
  exposure: true
54
55
  });
55
56
  }, EditorContentContainer, ContentArea);
57
+ var useEditorViewModePluginState = sharedPluginStateHookMigratorFactory(function (pluginInjectionApi) {
58
+ var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['editorViewMode']),
59
+ editorViewModeState = _useSharedPluginState.editorViewModeState;
60
+ return editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode;
61
+ }, function (pluginInjectionApi) {
62
+ return useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.mode');
63
+ });
56
64
 
57
65
  /**
58
66
  * Render the editor in a chromeless appearance.
@@ -91,8 +99,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
91
99
  pluginHooks = _this$props.pluginHooks,
92
100
  featureFlags = _this$props.featureFlags;
93
101
  var maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
94
- var _useSharedPluginState = useSharedPluginState(_this.props.editorAPI, ['editorViewMode']),
95
- editorViewModeState = _useSharedPluginState.editorViewModeState;
102
+ var editorViewMode = useEditorViewModePluginState(_this.props.editorAPI);
96
103
  return jsx(WithFlash, {
97
104
  animate: maxContentSizeReached
98
105
  }, jsx("div", {
@@ -116,7 +123,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
116
123
  , {
117
124
  className: "ak-editor-content-area",
118
125
  featureFlags: featureFlags,
119
- viewMode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode,
126
+ viewMode: editorViewMode,
120
127
  appearance: _this.appearance
121
128
  }, customContentComponents && 'before' in customContentComponents ? customContentComponents.before : customContentComponents, jsx(PluginSlot, {
122
129
  editorView: editorView,
@@ -140,12 +147,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
140
147
  _inherits(Editor, _React$Component);
141
148
  return _createClass(Editor, [{
142
149
  key: "render",
143
- value:
144
- /**
145
- *
146
- * @example
147
- */
148
- function render() {
150
+ value: function render() {
149
151
  return jsx(RenderWithPluginState, {
150
152
  editorAPI: this.props.editorAPI,
151
153
  renderChrome: this.renderChrome
@@ -155,11 +157,25 @@ var Editor = /*#__PURE__*/function (_React$Component) {
155
157
  }(React.Component);
156
158
  _defineProperty(Editor, "displayName", 'ChromelessEditorAppearance');
157
159
  export { Editor as default };
160
+ var useMaxContentSizePluginState = sharedPluginStateHookMigratorFactory(function (pluginInjectionApi) {
161
+ var _useSharedPluginState2 = useSharedPluginState(pluginInjectionApi, ['maxContentSize']),
162
+ maxContentSizeState = _useSharedPluginState2.maxContentSizeState;
163
+ return {
164
+ maxContentSizeState: maxContentSizeState
165
+ };
166
+ }, function (pluginInjectionApi) {
167
+ var maxContentSizeReached = useSharedPluginStateSelector(pluginInjectionApi, 'maxContentSize.maxContentSizeReached');
168
+ return {
169
+ maxContentSizeState: maxContentSizeReached === undefined ? undefined : {
170
+ maxContentSizeReached: maxContentSizeReached
171
+ }
172
+ };
173
+ });
158
174
  function RenderWithPluginState(_ref3) {
159
175
  var renderChrome = _ref3.renderChrome,
160
176
  editorAPI = _ref3.editorAPI;
161
- var _useSharedPluginState2 = useSharedPluginState(editorAPI, ['maxContentSize']),
162
- maxContentSizeState = _useSharedPluginState2.maxContentSizeState;
177
+ var _useMaxContentSizePlu = useMaxContentSizePluginState(editorAPI),
178
+ maxContentSizeState = _useMaxContentSizePlu.maxContentSizeState;
163
179
  return jsx(Fragment, null, renderChrome({
164
180
  maxContentSize: maxContentSizeState
165
181
  }));