@atlaskit/editor-core 207.1.2 → 207.2.1

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 (36) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/afm-jira/tsconfig.json +3 -0
  3. package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +28 -234
  4. package/dist/cjs/ui/EditorContentContainer/styles/ai-panel.js +97 -0
  5. package/dist/cjs/ui/EditorContentContainer/styles/backgroundColorStyles.js +32 -0
  6. package/dist/cjs/ui/EditorContentContainer/styles/layout.js +126 -0
  7. package/dist/cjs/ui/EditorContentContainer/styles/link.js +32 -0
  8. package/dist/cjs/ui/EditorContentContainer/styles/rule.js +29 -0
  9. package/dist/cjs/version-wrapper.js +1 -1
  10. package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +21 -773
  11. package/dist/es2019/ui/EditorContentContainer/styles/ai-panel.js +213 -0
  12. package/dist/es2019/ui/EditorContentContainer/styles/backgroundColorStyles.js +26 -0
  13. package/dist/es2019/ui/EditorContentContainer/styles/layout.js +517 -0
  14. package/dist/es2019/ui/EditorContentContainer/styles/link.js +26 -0
  15. package/dist/es2019/ui/EditorContentContainer/styles/rule.js +22 -0
  16. package/dist/es2019/version-wrapper.js +1 -1
  17. package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +30 -237
  18. package/dist/esm/ui/EditorContentContainer/styles/ai-panel.js +91 -0
  19. package/dist/esm/ui/EditorContentContainer/styles/backgroundColorStyles.js +26 -0
  20. package/dist/esm/ui/EditorContentContainer/styles/layout.js +120 -0
  21. package/dist/esm/ui/EditorContentContainer/styles/link.js +26 -0
  22. package/dist/esm/ui/EditorContentContainer/styles/rule.js +21 -0
  23. package/dist/esm/version-wrapper.js +1 -1
  24. package/dist/types/ui/EditorContentContainer/EditorContentContainer.d.ts +0 -11
  25. package/dist/types/ui/EditorContentContainer/styles/ai-panel.d.ts +2 -0
  26. package/dist/types/ui/EditorContentContainer/styles/backgroundColorStyles.d.ts +1 -0
  27. package/dist/types/ui/EditorContentContainer/styles/layout.d.ts +2 -0
  28. package/dist/types/ui/EditorContentContainer/styles/link.d.ts +2 -0
  29. package/dist/types/ui/EditorContentContainer/styles/rule.d.ts +1 -0
  30. package/dist/types-ts4.5/ui/EditorContentContainer/EditorContentContainer.d.ts +0 -11
  31. package/dist/types-ts4.5/ui/EditorContentContainer/styles/ai-panel.d.ts +2 -0
  32. package/dist/types-ts4.5/ui/EditorContentContainer/styles/backgroundColorStyles.d.ts +1 -0
  33. package/dist/types-ts4.5/ui/EditorContentContainer/styles/layout.d.ts +2 -0
  34. package/dist/types-ts4.5/ui/EditorContentContainer/styles/link.d.ts +2 -0
  35. package/dist/types-ts4.5/ui/EditorContentContainer/styles/rule.d.ts +1 -0
  36. package/package.json +2 -6
@@ -8,22 +8,20 @@
8
8
  import React from 'react';
9
9
 
10
10
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
11
- import { css, jsx, keyframes, useTheme } from '@emotion/react';
11
+ import { css, jsx, useTheme } from '@emotion/react';
12
12
  import { browser } from '@atlaskit/editor-common/browser';
13
13
  import { telepointerStyle, telepointerStyleWithInitialOnly } from '@atlaskit/editor-common/collab';
14
14
  import { EmojiSharedCssClassName, defaultEmojiHeight } from '@atlaskit/editor-common/emoji';
15
15
  import { MentionSharedCssClassName } from '@atlaskit/editor-common/mention';
16
16
  import { PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
17
17
  import { gapCursorStyles } from '@atlaskit/editor-common/selection';
18
- import { CodeBlockSharedCssClassName, GRID_GUTTER, LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN, MediaSharedClassNames, SmartCardSharedCssClassName, annotationSharedStyles, backgroundColorStyles, blockMarksSharedStyles, codeBlockInListSafariFix, codeMarkSharedStyles, dateSharedStyle, embedCardStyles, expandClassNames, getSmartCardSharedStyles, gridStyles, indentationSharedStyles, linkSharedStyle, listsSharedStyles, paragraphSharedStyles, resizerStyles, pragmaticResizerStyles, ruleSharedStyles, shadowSharedStyle, smartCardSharedStyles, smartCardStyles, tasksAndDecisionsStyles, textColorStyles, unsupportedStyles, whitespaceSharedStyles } from '@atlaskit/editor-common/styles';
18
+ import { CodeBlockSharedCssClassName, GRID_GUTTER, MediaSharedClassNames, SmartCardSharedCssClassName, annotationSharedStyles, blockMarksSharedStyles, codeBlockInListSafariFix, codeMarkSharedStyles, dateSharedStyle, embedCardStyles, expandClassNames, getSmartCardSharedStyles, gridStyles, indentationSharedStyles, listsSharedStyles, paragraphSharedStyles, resizerStyles, pragmaticResizerStyles, shadowSharedStyle, smartCardSharedStyles, smartCardStyles, tasksAndDecisionsStyles, textColorStyles, unsupportedStyles, whitespaceSharedStyles } from '@atlaskit/editor-common/styles';
19
19
  import { blocktypeStyles } from '@atlaskit/editor-plugins/block-type/styles';
20
20
  import { findReplaceStyles } from '@atlaskit/editor-plugins/find-replace/styles';
21
21
  import { textHighlightStyle } from '@atlaskit/editor-plugins/paste-options-toolbar/styles';
22
22
  import { placeholderTextStyles } from '@atlaskit/editor-plugins/placeholder-text/styles';
23
- import { TableCssClassName } from '@atlaskit/editor-plugins/table/types';
24
23
  import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
25
- import { tableMarginFullWidthMode } from '@atlaskit/editor-plugins/table/ui/consts';
26
- import { SelectionStyle, akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorDefaultLayoutWidth, akEditorDeleteBackground, akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic, akEditorSelectedBorderColor, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, akEditorSwoopCubicBezier, akLayoutGutterOffset, blockNodesVerticalMargin, editorFontSize, getSelectionStyles, gridMediumMaxWidth } from '@atlaskit/editor-shared-styles';
24
+ import { SelectionStyle, akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorDefaultLayoutWidth, akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, blockNodesVerticalMargin, editorFontSize, getSelectionStyles } from '@atlaskit/editor-shared-styles';
27
25
  import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
28
26
  import { fg } from '@atlaskit/platform-feature-flags';
29
27
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
@@ -37,30 +35,11 @@ import { mediaStyles } from '../ContentStyles/media';
37
35
  import { panelStyles } from '../ContentStyles/panel';
38
36
  import { statusStyles, vanillaStatusStyles } from '../ContentStyles/status';
39
37
  import { taskDecisionStyles, vanillaTaskDecisionIconWithoutVisualRefresh as vanillaDecisionIconWithoutVisualRefresh, vanillaTaskDecisionIconWithVisualRefresh as vanillaDecisionIconWithVisualRefresh, vanillaTaskDecisionStyles as vanillaDecisionStyles, vanillaTaskItemStyles } from '../ContentStyles/tasks-and-decisions';
40
-
41
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
42
- export const linkStyles = css`
43
- .ProseMirror {
44
- ${linkSharedStyle()}
45
- }
46
- `;
47
- const ruleStyles = () => css`
48
- .ProseMirror {
49
- ${ruleSharedStyles()};
50
-
51
- hr {
52
- cursor: pointer;
53
- padding: ${"var(--ds-space-050, 4px)"} 0;
54
- margin: ${"var(--ds-space-300, 24px)"} 0;
55
- background-clip: content-box;
56
-
57
- &.${akEditorSelectedNodeClassName} {
58
- outline: none;
59
- background-color: ${`var(--ds-border-selected, ${akEditorSelectedBorderColor})`};
60
- }
61
- }
62
- }
63
- `;
38
+ import { aiPanelBaseStyles, aiPanelDarkStyles } from './styles/ai-panel';
39
+ import { backgroundColorStyles } from './styles/backgroundColorStyles';
40
+ import { layoutBaseStyles, layoutViewStyles } from './styles/layout';
41
+ import { linkStyles, linkStylesOld } from './styles/link';
42
+ import { ruleStyles } from './styles/rule';
64
43
  const vanillaMentionsStyles = css({
65
44
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
66
45
  '.editor-mention-primitive': {
@@ -293,735 +272,6 @@ export const fixBlockControlStylesSSR = () => {
293
272
  }
294
273
  return firstBlockNodeStyles;
295
274
  };
296
- const columnLayoutSharedStyle = css({
297
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
298
- '[data-layout-section]': {
299
- position: 'relative',
300
- display: 'flex',
301
- flexDirection: 'row',
302
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
303
- '& > *': {
304
- flex: 1,
305
- minWidth: 0
306
- },
307
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
308
- '& > .unsupportedBlockView-content-wrap': {
309
- minWidth: 'initial'
310
- },
311
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
312
- [`@media screen and (max-width: ${gridMediumMaxWidth}px)`]: {
313
- flexDirection: 'column'
314
- }
315
- }
316
- });
317
- const columnLayoutResponsiveSharedStyle = css({
318
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
319
- '[data-layout-section]': {
320
- display: 'flex',
321
- flexDirection: 'row',
322
- gap: "var(--ds-space-100, 8px)",
323
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
324
- '& > *': {
325
- flex: 1,
326
- minWidth: 0
327
- },
328
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
329
- '& > .unsupportedBlockView-content-wrap': {
330
- minWidth: 'initial'
331
- }
332
- },
333
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
334
- '.layout-section-container': {
335
- containerType: 'inline-size',
336
- containerName: 'layout-area'
337
- }
338
- });
339
-
340
- /**
341
- * layout styles
342
- * was imported from packages/editor/editor-core/src/ui/ContentStyles/layout.ts
343
- * @example
344
- * @returns {string}
345
- */
346
- const firstNodeWithNotMarginTop = () => fg('platform_editor_nested_dnd_styles_changes') ?
347
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
348
- css`
349
- > :nth-child(1 of :not(style, .ProseMirror-gapcursor, .ProseMirror-widget, span)) {
350
- margin-top: 0;
351
- }
352
- ` :
353
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
354
- css`
355
- > :not(style):first-child,
356
- > style:first-child + * {
357
- margin-top: 0;
358
- }
359
-
360
- > .ProseMirror-gapcursor:first-child + *,
361
- > style:first-child + .ProseMirror-gapcursor + * {
362
- margin-top: 0;
363
- }
364
-
365
- > .ProseMirror-gapcursor:first-child + span + * {
366
- margin-top: 0;
367
- }
368
- `;
369
- const layoutColumnStyles = () => editorExperiment('advanced_layouts', true) ?
370
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
371
- css`
372
- > [data-layout-column] {
373
- margin: 0 ${LAYOUT_SECTION_MARGIN / 2}px;
374
- }
375
-
376
- > [data-layout-column]:first-of-type {
377
- margin-left: 0;
378
- }
379
-
380
- > [data-layout-column]:last-of-type {
381
- margin-right: 0;
382
- }
383
-
384
- @media screen and (max-width: ${gridMediumMaxWidth}px) {
385
- [data-layout-column] + [data-layout-column] {
386
- margin: 0;
387
- }
388
- }
389
-
390
- > [data-layout-column].${akEditorSelectedNodeClassName}:not(.danger) {
391
- ${getSelectionStyles([SelectionStyle.Blanket])};
392
- /* layout column selection shorter after layout border has been removed */
393
- ::before {
394
- width: calc(100% - 8px);
395
- left: 4px;
396
- border-radius: ${"var(--ds-border-radius, 3px)"};
397
- }
398
- }
399
- ` :
400
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
401
- css`
402
- [data-layout-column] + [data-layout-column] {
403
- margin-left: ${LAYOUT_SECTION_MARGIN}px;
404
- }
405
-
406
- @media screen and (max-width: ${gridMediumMaxWidth}px) {
407
- [data-layout-column] + [data-layout-column] {
408
- margin-left: 0;
409
- }
410
- }
411
- `;
412
- const layoutSectionStyles = () => editorExperiment('advanced_layouts', true) ?
413
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
414
- css`
415
- ${columnLayoutResponsiveSharedStyle};
416
- .layout-section-container [data-layout-section] {
417
- > .ProseMirror-widget {
418
- flex: none;
419
- display: contents !important;
420
-
421
- &[data-blocks-drag-handle-container] div {
422
- display: contents !important;
423
- }
424
-
425
- &[data-blocks-drop-target-container] {
426
- display: block !important;
427
- margin: ${"var(--ds-space-negative-050, -4px)"};
428
-
429
- [data-drop-target-for-element] {
430
- position: absolute;
431
- }
432
- }
433
-
434
- & + [data-layout-column] {
435
- margin: 0;
436
- }
437
- }
438
-
439
- > [data-layout-column] {
440
- margin: 0;
441
- }
442
- }
443
- ` :
444
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
445
- css`
446
- ${columnLayoutSharedStyle}
447
- `;
448
-
449
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
450
- const layoutBorderBaseStyles = css`
451
- /* TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.
452
- This is because the default state already uses the same token and, as such, the hover style won't change anything.
453
- https://product-fabric.atlassian.net/browse/DSP-4441 */
454
- /* Shows the border when cursor is inside a layout */
455
- &.selected [data-layout-column],
456
- &:hover [data-layout-column] {
457
- border: ${akEditorSelectedBorderSize}px solid ${"var(--ds-border, #091E4224)"};
458
- }
459
-
460
- &.selected.danger [data-layout-column] {
461
- background-color: ${`var(--ds-background-danger, ${akEditorDeleteBackground})`};
462
- border-color: ${`var(--ds-border-danger, ${akEditorDeleteBorder})`};
463
- }
464
-
465
- &.${akEditorSelectedNodeClassName}:not(.danger) {
466
- [data-layout-column] {
467
- ${getSelectionStyles([SelectionStyle.Border, SelectionStyle.Blanket])}
468
- ::after {
469
- background-color: transparent;
470
- }
471
- }
472
- }
473
- `;
474
-
475
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
476
- const layoutBorderViewStyles = css`
477
- &.selected [data-layout-column],
478
- &:hover [data-layout-column] {
479
- border: 0;
480
- }
481
- `;
482
-
483
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
484
- const columnSeparatorBaseStyles = css`
485
- [data-layout-content]::before {
486
- content: '';
487
- border-left: ${akEditorSelectedBorderSize}px solid ${"var(--ds-border, #091E4224)"};
488
- position: absolute;
489
- height: calc(100% - 24px);
490
- margin-left: -25px;
491
- }
492
- `;
493
-
494
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
495
- const columnSeparatorViewStyles = css`
496
- [data-layout-content]::before {
497
- border-left: 0;
498
- }
499
- `;
500
-
501
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
502
- const rowSeparatorBaseStyles = css`
503
- [data-layout-content]::before {
504
- content: '';
505
- border-top: ${akEditorSelectedBorderSize}px solid ${"var(--ds-border, #091E4224)"};
506
- position: absolute;
507
- width: calc(100% - 32px);
508
- margin-top: -13px;
509
-
510
- /* clear styles for column separator */
511
- border-left: unset;
512
- margin-left: unset;
513
- height: unset;
514
- }
515
- `;
516
-
517
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
518
- const rowSeparatorViewStyles = css`
519
- [data-layout-content]::before {
520
- border-top: 0;
521
- }
522
- `;
523
-
524
- // jest warning: JSDOM version (22) doesn't support the new @container CSS rule
525
- const layoutWithSeparatorBorderResponsiveBaseStyles = (breakpoint
526
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
527
- ) => css`
528
- &.selected,
529
- &:hover,
530
- &.selected.danger,
531
- &.${akEditorSelectedNodeClassName}:not(.danger) {
532
- [data-layout-column]:not(:first-of-type) {
533
- @container editor-area (max-width:${breakpoint}px) {
534
- ${rowSeparatorBaseStyles}
535
- }
536
- }
537
- }
538
- `;
539
-
540
- // jest warning: JSDOM version (22) doesn't support the new @container CSS rule
541
- const layoutWithSeparatorBorderResponsiveViewStyles = (breakpoint
542
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
543
- ) => css`
544
- &.selected,
545
- &:hover,
546
- &.selected.danger,
547
- &.${akEditorSelectedNodeClassName}:not(.danger) {
548
- [data-layout-column]:not(:first-of-type) {
549
- @container editor-area (max-width:${breakpoint}px) {
550
- ${rowSeparatorViewStyles}
551
- }
552
- }
553
- }
554
- `;
555
-
556
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
557
- const layoutWithSeparatorBorderBaseStyles = css`
558
- &.selected [data-layout-column]:not(:first-of-type),
559
- [data-empty-layout='true'] [data-layout-column]:not(:first-of-type),
560
- &:hover [data-layout-column]:not(:first-of-type) {
561
- ${columnSeparatorBaseStyles}
562
- }
563
-
564
- &.selected.danger [data-layout-section] {
565
- background-color: ${`var(--ds-background-danger, ${akEditorDeleteBackground})`};
566
-
567
- box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px ${akEditorDeleteBorder};
568
- border-radius: 4px;
569
- [data-layout-column]:not(:first-of-type) {
570
- ${columnSeparatorBaseStyles}
571
- }
572
- }
573
-
574
- &.${akEditorSelectedNodeClassName}:not(.danger) [data-layout-section] {
575
- box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px ${"var(--ds-border-selected, #0C66E4)"};
576
- border-radius: 4px;
577
- background-color: ${"var(--ds-background-selected, #E9F2FF)"};
578
- [data-layout-column] {
579
- ${getSelectionStyles([SelectionStyle.Blanket])}
580
- border: 0px;
581
- ::before {
582
- background-color: transparent;
583
- }
584
- }
585
- [data-layout-column]:not(:first-of-type) {
586
- ${columnSeparatorBaseStyles}
587
- }
588
- }
589
- `;
590
-
591
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
592
- const layoutWithSeparatorBorderViewStyles = css`
593
- &.selected [data-layout-column]:not(:first-of-type),
594
- [data-empty-layout='true'] [data-layout-column]:not(:first-of-type),
595
- &:hover [data-layout-column]:not(:first-of-type) {
596
- ${columnSeparatorViewStyles}
597
- }
598
-
599
- &.selected.danger [data-layout-section] {
600
- box-shadow: 0 0 0 0 ${akEditorDeleteBorder};
601
- [data-layout-column]:not(:first-of-type) {
602
- ${columnSeparatorViewStyles}
603
- }
604
- }
605
-
606
- &.${akEditorSelectedNodeClassName}:not(.danger) [data-layout-section] {
607
- box-shadow: 0 0 0 0 ${"var(--ds-border-selected, #0C66E4)"};
608
- [data-layout-column]:not(:first-of-type) {
609
- ${columnSeparatorViewStyles}
610
- }
611
- }
612
- `;
613
-
614
- // jest warning: JSDOM version (22) doesn't support the new @container CSS rule
615
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
616
- const layoutResponsiveBaseStyles = css`
617
- /* chosen breakpoints in container queries are to make sure layout responsiveness in editor aligns with renderer */
618
- /* not resized layout in full-width editor */
619
- .fabric-editor--full-width-mode .ProseMirror {
620
- > .layoutSectionView-content-wrap {
621
- [data-layout-section] {
622
- @container editor-area (max-width:724px) {
623
- flex-direction: column;
624
- }
625
- }
626
-
627
- ${layoutWithSeparatorBorderResponsiveBaseStyles(724)}
628
- }
629
- }
630
-
631
- /* not resized layout in fixed-width editor */
632
- .ak-editor-content-area:not(.fabric-editor--full-width-mode) .ProseMirror {
633
- > .layoutSectionView-content-wrap {
634
- [data-layout-section] {
635
- @container editor-area (max-width:788px) {
636
- flex-direction: column;
637
- }
638
- }
639
-
640
- ${layoutWithSeparatorBorderResponsiveBaseStyles(788)}
641
- }
642
- }
643
-
644
- /* resized layout in full/fixed-width editor */
645
- .ProseMirror .fabric-editor-breakout-mark {
646
- .layoutSectionView-content-wrap {
647
- [data-layout-section] {
648
- @container editor-area (max-width:820px) {
649
- flex-direction: column;
650
- }
651
- }
652
-
653
- ${layoutWithSeparatorBorderResponsiveBaseStyles(820)}
654
- }
655
- }
656
- `;
657
-
658
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
659
- const layoutResponsiveViewStyles = css`
660
- /* chosen breakpoints in container queries are to make sure layout responsiveness in editor aligns with renderer */
661
- /* not resized layout in full-width editor */
662
- .fabric-editor--full-width-mode .ProseMirror {
663
- > .layoutSectionView-content-wrap {
664
- ${layoutWithSeparatorBorderResponsiveViewStyles(724)}
665
- }
666
- }
667
-
668
- /* not resized layout in fixed-width editor */
669
- .ak-editor-content-area:not(.fabric-editor--full-width-mode) .ProseMirror {
670
- > .layoutSectionView-content-wrap {
671
- ${layoutWithSeparatorBorderResponsiveViewStyles(788)}
672
- }
673
- }
674
-
675
- /* resized layout in full/fixed-width editor */
676
- .ProseMirror .fabric-editor-breakout-mark {
677
- .layoutSectionView-content-wrap {
678
- ${layoutWithSeparatorBorderResponsiveViewStyles(820)}
679
- }
680
- }
681
- `;
682
-
683
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
684
- const layoutBaseStyles = () => css`
685
- .ProseMirror {
686
- ${layoutSectionStyles()}
687
- [data-layout-section] {
688
- /* Ignored via go/ees007
689
- TODO: Migrate away from gridSize
690
- Recommendation: Replace directly with 7px */
691
- margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? 8 : 0)}px
692
- 0;
693
- transition: border-color 0.3s ${akEditorSwoopCubicBezier};
694
- cursor: pointer;
695
-
696
- /* Inner cursor located 26px from left */
697
- [data-layout-column] {
698
- flex: 1;
699
- position: relative;
700
-
701
- min-width: 0;
702
- /* disable 4 borders when in view mode and advanced layouts is on */
703
- border: ${editorExperiment('advanced_layouts', true) ? 0 : akEditorSelectedBorderSize}px
704
- solid ${"var(--ds-border, #091E4224)"};
705
- border-radius: 4px;
706
- padding: ${LAYOUT_COLUMN_PADDING}px
707
- ${LAYOUT_COLUMN_PADDING + (fg('platform_editor_nested_dnd_styles_changes') ? 8 : 0)}px;
708
- box-sizing: border-box;
709
-
710
- > div {
711
- ${firstNodeWithNotMarginTop()}
712
-
713
- > .embedCardView-content-wrap:first-of-type .rich-media-item {
714
- margin-top: 0;
715
- }
716
-
717
- > .mediaSingleView-content-wrap:first-of-type .rich-media-item {
718
- margin-top: 0;
719
- }
720
-
721
- > .ProseMirror-gapcursor.-right:first-child
722
- + .mediaSingleView-content-wrap
723
- .rich-media-item,
724
- > style:first-child
725
- + .ProseMirror-gapcursor.-right
726
- + .mediaSingleView-content-wrap
727
- .rich-media-item,
728
- > .ProseMirror-gapcursor.-right:first-of-type
729
- + .embedCardView-content-wrap
730
- .rich-media-item {
731
- margin-top: 0;
732
- }
733
-
734
- > .ProseMirror-gapcursor:first-child
735
- + span
736
- + .mediaSingleView-content-wrap
737
- .rich-media-item,
738
- > style:first-child
739
- + .ProseMirror-gapcursor
740
- + span
741
- + .mediaSingleView-content-wrap
742
- .rich-media-item {
743
- margin-top: 0;
744
- }
745
-
746
- /* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down
747
- and shrinking layout's node selectable area (leniency margin) */
748
- > [data-node-type='decisionList'] {
749
- li:first-of-type [data-decision-wrapper] {
750
- margin-top: 0;
751
- }
752
- }
753
- }
754
-
755
- /* Make the 'content' fill the entire height of the layout column to allow click
756
- handler of layout section nodeview to target only data-layout-column */
757
- [data-layout-content] {
758
- height: 100%;
759
- cursor: text;
760
- .mediaGroupView-content-wrap {
761
- clear: both;
762
- }
763
- }
764
- }
765
-
766
- ${layoutColumnStyles()}
767
- }
768
-
769
- /* styles to support borders for layout */
770
- [data-layout-section],
771
- .layoutSectionView-content-wrap {
772
- ${editorExperiment('advanced_layouts', true) ? layoutWithSeparatorBorderBaseStyles : layoutBorderBaseStyles}
773
- }
774
- }
775
-
776
- ${editorExperiment('advanced_layouts', true) && layoutResponsiveBaseStyles}
777
-
778
- /* hide separator when element is dragging on top of a layout column */
779
- [data-blocks-drop-target-container] ~ [data-layout-column] > [data-layout-content]::before {
780
- display: none;
781
- }
782
-
783
- .fabric-editor--full-width-mode .ProseMirror {
784
- [data-layout-section] {
785
- .${TableCssClassName.TABLE_CONTAINER} {
786
- margin: 0 ${tableMarginFullWidthMode}px;
787
- }
788
- }
789
- }
790
-
791
- ${editorExperiment('advanced_layouts', false) && fg('platform_editor_nested_dnd_styles_changes') && `.ak-editor-content-area.appearance-full-page .ProseMirror [data-layout-section] {
792
- margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset + 8}px 0;
793
- }`}
794
- `;
795
-
796
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
797
- const layoutViewStyles = css`
798
- .ProseMirror {
799
- [data-layout-section] {
800
- cursor: default;
801
- [data-layout-column] {
802
- border: 0;
803
- }
804
- }
805
- [data-layout-section],
806
- .layoutSectionView-content-wrap {
807
- ${editorExperiment('advanced_layouts', true) ? layoutWithSeparatorBorderViewStyles : layoutBorderViewStyles}
808
- }
809
- }
810
-
811
- ${editorExperiment('advanced_layouts', true) && layoutResponsiveViewStyles}
812
- `;
813
-
814
- /**
815
- * aiPanelStyles
816
- * was imported from packages/editor/editor-core/src/ui/ContentStyles/ai-panels.ts
817
- */
818
- const isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
819
- const rotationAnimation = keyframes({
820
- '0%': {
821
- '--panel-gradient-angle': '0deg',
822
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
823
- ...(isFirefox ? {
824
- backgroundPosition: '100%'
825
- } : {})
826
- },
827
- '100%': {
828
- '--panel-gradient-angle': '360deg',
829
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
830
- ...(isFirefox ? {
831
- backgroundPosition: '-100%'
832
- } : {})
833
- }
834
- });
835
- const aiPrismColor = {
836
- ['prism.border.step.1']: {
837
- light: '#0065FF',
838
- dark: '#0065FF80'
839
- },
840
- ['prism.border.step.2']: {
841
- light: '#0469FF',
842
- dark: '#0469FF80'
843
- },
844
- ['prism.border.step.3']: {
845
- light: '#BF63F3',
846
- dark: '#BF63F380'
847
- },
848
- ['prism.border.step.4']: {
849
- light: '#FFA900',
850
- dark: '#FFA90080'
851
- }
852
- };
853
- const prismBorderAnimationStyles = css({
854
- '&::before, &::after': {
855
- animationName: rotationAnimation,
856
- animationDuration: '2s',
857
- animationTimingFunction: 'linear',
858
- animationIterationCount: 'infinite',
859
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
860
- ...(isFirefox ? {
861
- animationDirection: 'normal',
862
- animationDuration: '1s'
863
- } : {}),
864
- '@media (prefers-reduced-motion)': {
865
- animation: 'none'
866
- }
867
- }
868
- });
869
- const prismBorderBaseStyles = css({
870
- content: "''",
871
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
872
- position: 'absolute',
873
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
874
- zIndex: -1,
875
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
876
- width: `calc(100% + 2px)`,
877
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
878
- height: `calc(100% + 2px)`,
879
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
880
- top: `-1px`,
881
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
882
- left: `-1px`,
883
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
884
- borderRadius: `calc(${"var(--ds-border-radius-100, 3px)"} + 1px)`,
885
- transform: 'translate3d(0, 0, 0)',
886
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
887
- ...(isFirefox ? {
888
- background: `linear-gradient(90deg,
889
- ${aiPrismColor['prism.border.step.1']['light']} 0%,
890
- ${aiPrismColor['prism.border.step.2']['light']} 12%,
891
- ${aiPrismColor['prism.border.step.3']['light']} 24%,
892
- ${aiPrismColor['prism.border.step.4']['light']} 48%,
893
- ${aiPrismColor['prism.border.step.3']['light']} 64%,
894
- ${aiPrismColor['prism.border.step.2']['light']} 80%,
895
- ${aiPrismColor['prism.border.step.1']['light']} 100%
896
- )`,
897
- backgroundSize: '200%'
898
- } : {
899
- background: `conic-gradient(
900
- from var(--panel-gradient-angle, 270deg),
901
- ${aiPrismColor['prism.border.step.1']['light']} 0%,
902
- ${aiPrismColor['prism.border.step.2']['light']} 20%,
903
- ${aiPrismColor['prism.border.step.3']['light']} 50%,
904
- ${aiPrismColor['prism.border.step.4']['light']} 56%,
905
- ${aiPrismColor['prism.border.step.1']['light']} 100%
906
- )`
907
- })
908
- });
909
- const prismBorderDarkStyles = css({
910
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
911
- ...(isFirefox ? {
912
- background: `linear-gradient(90deg,
913
- ${aiPrismColor['prism.border.step.1']['dark']} 0%,
914
- ${aiPrismColor['prism.border.step.2']['dark']} 12%,
915
- ${aiPrismColor['prism.border.step.3']['dark']} 24%,
916
- ${aiPrismColor['prism.border.step.4']['dark']} 48%,
917
- ${aiPrismColor['prism.border.step.3']['dark']} 64%,
918
- ${aiPrismColor['prism.border.step.2']['dark']} 80%,
919
- ${aiPrismColor['prism.border.step.1']['dark']} 100%
920
- )`,
921
- backgroundSize: '200%'
922
- } : {
923
- background: `conic-gradient(
924
- from var(--panel-gradient-angle, 270deg),
925
- ${aiPrismColor['prism.border.step.1']['dark']} 0%,
926
- ${aiPrismColor['prism.border.step.2']['dark']} 20%,
927
- ${aiPrismColor['prism.border.step.3']['dark']} 50%,
928
- ${aiPrismColor['prism.border.step.4']['dark']} 56%,
929
- ${aiPrismColor['prism.border.step.1']['dark']} 100%
930
- )`
931
- })
932
- });
933
- const prismBorderHoverStyles = css({
934
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
935
- background: "var(--ds-border-input, #8590A2)"
936
- });
937
-
938
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Ignored via go/DSP-18766
939
- const aiPanelBaseStyles = css`
940
- @property --panel-gradient-angle {
941
- syntax: '<angle>';
942
- initial-value: 270deg;
943
- inherits: false;
944
- }
945
-
946
- div[extensionType='com.atlassian.ai-blocks'] {
947
- /* This hides the label for the extension */
948
- .extension-label {
949
- display: none;
950
- }
951
-
952
- /* This styles the ai panel correctly when its just sitting on the page and there
953
- is no user interaction */
954
- .extension-container {
955
- position: relative;
956
- box-shadow: none;
957
- overflow: unset;
958
- background-color: ${"var(--ds-surface, #FFFFFF)"} !important;
959
- &::before,
960
- &::after {
961
- ${prismBorderBaseStyles}
962
- }
963
- &.with-hover-border {
964
- &::before,
965
- &::after {
966
- ${prismBorderHoverStyles}
967
- }
968
- }
969
- & .with-margin-styles {
970
- background-color: ${"var(--ds-surface, #FFFFFF)"} !important;
971
- border-radius: ${"var(--ds-border-radius-100, 3px)"};
972
- }
973
- }
974
- }
975
-
976
- /* This styles the ai panel correctly when its streaming */
977
- div[extensionType='com.atlassian.ai-blocks']:has(.streaming) {
978
- .extension-container {
979
- box-shadow: none;
980
- overflow: unset;
981
- ${prismBorderAnimationStyles}
982
- &::before,
983
- &::after {
984
- ${prismBorderBaseStyles}
985
- }
986
- }
987
- }
988
-
989
- /* This styles the ai panel correctly when a user is hovering over the delete button in the floating panel */
990
- div[extensionType='com.atlassian.ai-blocks'].danger {
991
- .extension-container {
992
- box-shadow: 0 0 0 1px ${"var(--ds-border-danger, #E2483D)"};
993
- }
994
- }
995
-
996
- /* This removes the margin from the action list when inside an ai panel */
997
- div[extensiontype='com.atlassian.ai-blocks'][extensionkey='ai-action-items-block:aiActionItemsBodiedExtension'] {
998
- div[data-node-type='actionList'] {
999
- margin: 0 !important;
1000
- }
1001
- }
1002
- `;
1003
-
1004
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Ignored via go/DSP-18766
1005
- const aiPanelDarkStyles = css`
1006
- div[extensionType='com.atlassian.ai-blocks'] {
1007
- .extension-container {
1008
- &::before,
1009
- &::after {
1010
- ${prismBorderDarkStyles}
1011
- }
1012
- }
1013
- }
1014
-
1015
- /* This styles the ai panel correctly when its streaming */
1016
- div[extensionType='com.atlassian.ai-blocks']:has(.streaming) {
1017
- .extension-container {
1018
- &::before,
1019
- &::after {
1020
- ${prismBorderDarkStyles}
1021
- }
1022
- }
1023
- }
1024
- `;
1025
275
 
1026
276
  // The breakpoint for small devices is 1266px, copied from getBreakpoint in platform/packages/editor/editor-common/src/ui/WidthProvider/index.tsx
1027
277
  const akEditorBreakpointForSmallDevice = `1266px`;
@@ -1149,11 +399,11 @@ const contentStyles = () => css`
1149
399
 
1150
400
  ${textColorStyles}
1151
401
 
1152
- ${backgroundColorStyles()}
402
+ ${backgroundColorStyles}
1153
403
 
1154
404
  ${listsStyles}
1155
405
 
1156
- ${ruleStyles()}
406
+ ${ruleStyles}
1157
407
 
1158
408
  ${mediaStyles()}
1159
409
 
@@ -1182,8 +432,6 @@ const contentStyles = () => css`
1182
432
 
1183
433
  ${gridStyles}
1184
434
 
1185
- ${linkStyles}
1186
-
1187
435
  ${blockMarksSharedStyles}
1188
436
 
1189
437
  ${dateSharedStyle}
@@ -1354,18 +602,8 @@ const listLayoutShiftFix = css({
1354
602
  * EditorContentStyles is a wrapper component that applies styles to its children
1355
603
  * based on the provided feature flags, view mode, and other props.
1356
604
  * It uses Emotion for styling and supports scrollable content.
1357
- * The component is memoized to optimize performance.
1358
605
  *
1359
606
  * This will be used in near future to replace the current editor content styles from index.tsx
1360
- *
1361
- * @param {EditorContentContainerProps} props - The props for the component.
1362
- * @param {string} props.className - Additional class name for the component.
1363
- * @param {React.ReactNode} props.children - The content to be rendered inside the component.
1364
- * @param {FeatureFlags} props.featureFlags - Feature flags to control the styles.
1365
- * @param {'view' | 'edit'} props.viewMode - The view mode of the editor.
1366
- * @param {boolean} props.isScrollable - Whether the content is scrollable.
1367
- * @param {'full-page' | 'full-width' | 'comment' | 'chromeless'} props.appearance - The appearance of the editor.
1368
- * @returns {JSX.Element} The styled content component.
1369
607
  */
1370
608
  const EditorContentContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
1371
609
  const {
@@ -1385,7 +623,17 @@ const EditorContentContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
1385
623
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
1386
624
  className: className,
1387
625
  ref: ref,
1388
- css: [contentStyles(), layoutBaseStyles(), aiPanelBaseStyles, colorMode === 'dark' && aiPanelDarkStyles, viewMode === 'view' && layoutViewStyles, isComment && commentEditorStyles, isFullPage && fullPageEditorStyles, fg('platform_editor_ssr_fix_lists') && listLayoutShiftFix],
626
+ css: [contentStyles(),
627
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
628
+ layoutBaseStyles(),
629
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
630
+ fg('platform_editor_hyperlink_underline') ? linkStyles : linkStylesOld,
631
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
632
+ aiPanelBaseStyles,
633
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
634
+ colorMode === 'dark' && aiPanelDarkStyles,
635
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
636
+ viewMode === 'view' && layoutViewStyles, isComment && commentEditorStyles, isFullPage && fullPageEditorStyles, fg('platform_editor_ssr_fix_lists') && listLayoutShiftFix],
1389
637
  "data-editor-scroll-container": isScrollable ? 'true' : undefined,
1390
638
  "data-testid": "editor-content-container",
1391
639
  style: {