@atlaskit/editor-core 207.2.0 → 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.
- package/CHANGELOG.md +9 -0
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +27 -234
- package/dist/cjs/ui/EditorContentContainer/styles/ai-panel.js +97 -0
- package/dist/cjs/ui/EditorContentContainer/styles/layout.js +126 -0
- package/dist/cjs/ui/EditorContentContainer/styles/link.js +32 -0
- package/dist/cjs/ui/EditorContentContainer/styles/rule.js +29 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +19 -771
- package/dist/es2019/ui/EditorContentContainer/styles/ai-panel.js +213 -0
- package/dist/es2019/ui/EditorContentContainer/styles/layout.js +517 -0
- package/dist/es2019/ui/EditorContentContainer/styles/link.js +26 -0
- package/dist/es2019/ui/EditorContentContainer/styles/rule.js +22 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +29 -237
- package/dist/esm/ui/EditorContentContainer/styles/ai-panel.js +91 -0
- package/dist/esm/ui/EditorContentContainer/styles/layout.js +120 -0
- package/dist/esm/ui/EditorContentContainer/styles/link.js +26 -0
- package/dist/esm/ui/EditorContentContainer/styles/rule.js +21 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/EditorContentContainer/EditorContentContainer.d.ts +0 -11
- package/dist/types/ui/EditorContentContainer/styles/ai-panel.d.ts +2 -0
- package/dist/types/ui/EditorContentContainer/styles/layout.d.ts +2 -0
- package/dist/types/ui/EditorContentContainer/styles/link.d.ts +2 -0
- package/dist/types/ui/EditorContentContainer/styles/rule.d.ts +1 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/EditorContentContainer.d.ts +0 -11
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/ai-panel.d.ts +2 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/layout.d.ts +2 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/link.d.ts +2 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/rule.d.ts +1 -0
- package/package.json +2 -2
|
@@ -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,
|
|
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,
|
|
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 {
|
|
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,31 +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';
|
|
38
|
+
import { aiPanelBaseStyles, aiPanelDarkStyles } from './styles/ai-panel';
|
|
40
39
|
import { backgroundColorStyles } from './styles/backgroundColorStyles';
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
.ProseMirror {
|
|
45
|
-
${linkSharedStyle()}
|
|
46
|
-
}
|
|
47
|
-
`;
|
|
48
|
-
const ruleStyles = () => css`
|
|
49
|
-
.ProseMirror {
|
|
50
|
-
${ruleSharedStyles()};
|
|
51
|
-
|
|
52
|
-
hr {
|
|
53
|
-
cursor: pointer;
|
|
54
|
-
padding: ${"var(--ds-space-050, 4px)"} 0;
|
|
55
|
-
margin: ${"var(--ds-space-300, 24px)"} 0;
|
|
56
|
-
background-clip: content-box;
|
|
57
|
-
|
|
58
|
-
&.${akEditorSelectedNodeClassName} {
|
|
59
|
-
outline: none;
|
|
60
|
-
background-color: ${`var(--ds-border-selected, ${akEditorSelectedBorderColor})`};
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
`;
|
|
40
|
+
import { layoutBaseStyles, layoutViewStyles } from './styles/layout';
|
|
41
|
+
import { linkStyles, linkStylesOld } from './styles/link';
|
|
42
|
+
import { ruleStyles } from './styles/rule';
|
|
65
43
|
const vanillaMentionsStyles = css({
|
|
66
44
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
67
45
|
'.editor-mention-primitive': {
|
|
@@ -294,734 +272,6 @@ export const fixBlockControlStylesSSR = () => {
|
|
|
294
272
|
}
|
|
295
273
|
return firstBlockNodeStyles;
|
|
296
274
|
};
|
|
297
|
-
const columnLayoutSharedStyle = css({
|
|
298
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
299
|
-
'[data-layout-section]': {
|
|
300
|
-
position: 'relative',
|
|
301
|
-
display: 'flex',
|
|
302
|
-
flexDirection: 'row',
|
|
303
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
304
|
-
'& > *': {
|
|
305
|
-
flex: 1,
|
|
306
|
-
minWidth: 0
|
|
307
|
-
},
|
|
308
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
309
|
-
'& > .unsupportedBlockView-content-wrap': {
|
|
310
|
-
minWidth: 'initial'
|
|
311
|
-
},
|
|
312
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
313
|
-
[`@media screen and (max-width: ${gridMediumMaxWidth}px)`]: {
|
|
314
|
-
flexDirection: 'column'
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
const columnLayoutResponsiveSharedStyle = css({
|
|
319
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
320
|
-
'[data-layout-section]': {
|
|
321
|
-
display: 'flex',
|
|
322
|
-
flexDirection: 'row',
|
|
323
|
-
gap: "var(--ds-space-100, 8px)",
|
|
324
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
325
|
-
'& > *': {
|
|
326
|
-
flex: 1,
|
|
327
|
-
minWidth: 0
|
|
328
|
-
},
|
|
329
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
330
|
-
'& > .unsupportedBlockView-content-wrap': {
|
|
331
|
-
minWidth: 'initial'
|
|
332
|
-
}
|
|
333
|
-
},
|
|
334
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
335
|
-
'.layout-section-container': {
|
|
336
|
-
containerType: 'inline-size',
|
|
337
|
-
containerName: 'layout-area'
|
|
338
|
-
}
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* layout styles
|
|
343
|
-
* was imported from packages/editor/editor-core/src/ui/ContentStyles/layout.ts
|
|
344
|
-
* @example
|
|
345
|
-
* @returns {string}
|
|
346
|
-
*/
|
|
347
|
-
const firstNodeWithNotMarginTop = () => fg('platform_editor_nested_dnd_styles_changes') ?
|
|
348
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
349
|
-
css`
|
|
350
|
-
> :nth-child(1 of :not(style, .ProseMirror-gapcursor, .ProseMirror-widget, span)) {
|
|
351
|
-
margin-top: 0;
|
|
352
|
-
}
|
|
353
|
-
` :
|
|
354
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
355
|
-
css`
|
|
356
|
-
> :not(style):first-child,
|
|
357
|
-
> style:first-child + * {
|
|
358
|
-
margin-top: 0;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
> .ProseMirror-gapcursor:first-child + *,
|
|
362
|
-
> style:first-child + .ProseMirror-gapcursor + * {
|
|
363
|
-
margin-top: 0;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
> .ProseMirror-gapcursor:first-child + span + * {
|
|
367
|
-
margin-top: 0;
|
|
368
|
-
}
|
|
369
|
-
`;
|
|
370
|
-
const layoutColumnStyles = () => editorExperiment('advanced_layouts', true) ?
|
|
371
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
372
|
-
css`
|
|
373
|
-
> [data-layout-column] {
|
|
374
|
-
margin: 0 ${LAYOUT_SECTION_MARGIN / 2}px;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
> [data-layout-column]:first-of-type {
|
|
378
|
-
margin-left: 0;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
> [data-layout-column]:last-of-type {
|
|
382
|
-
margin-right: 0;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
@media screen and (max-width: ${gridMediumMaxWidth}px) {
|
|
386
|
-
[data-layout-column] + [data-layout-column] {
|
|
387
|
-
margin: 0;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
> [data-layout-column].${akEditorSelectedNodeClassName}:not(.danger) {
|
|
392
|
-
${getSelectionStyles([SelectionStyle.Blanket])};
|
|
393
|
-
/* layout column selection shorter after layout border has been removed */
|
|
394
|
-
::before {
|
|
395
|
-
width: calc(100% - 8px);
|
|
396
|
-
left: 4px;
|
|
397
|
-
border-radius: ${"var(--ds-border-radius, 3px)"};
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
` :
|
|
401
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
402
|
-
css`
|
|
403
|
-
[data-layout-column] + [data-layout-column] {
|
|
404
|
-
margin-left: ${LAYOUT_SECTION_MARGIN}px;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
@media screen and (max-width: ${gridMediumMaxWidth}px) {
|
|
408
|
-
[data-layout-column] + [data-layout-column] {
|
|
409
|
-
margin-left: 0;
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
`;
|
|
413
|
-
const layoutSectionStyles = () => editorExperiment('advanced_layouts', true) ?
|
|
414
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
415
|
-
css`
|
|
416
|
-
${columnLayoutResponsiveSharedStyle};
|
|
417
|
-
.layout-section-container [data-layout-section] {
|
|
418
|
-
> .ProseMirror-widget {
|
|
419
|
-
flex: none;
|
|
420
|
-
display: contents !important;
|
|
421
|
-
|
|
422
|
-
&[data-blocks-drag-handle-container] div {
|
|
423
|
-
display: contents !important;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
&[data-blocks-drop-target-container] {
|
|
427
|
-
display: block !important;
|
|
428
|
-
margin: ${"var(--ds-space-negative-050, -4px)"};
|
|
429
|
-
|
|
430
|
-
[data-drop-target-for-element] {
|
|
431
|
-
position: absolute;
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
& + [data-layout-column] {
|
|
436
|
-
margin: 0;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
> [data-layout-column] {
|
|
441
|
-
margin: 0;
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
` :
|
|
445
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
446
|
-
css`
|
|
447
|
-
${columnLayoutSharedStyle}
|
|
448
|
-
`;
|
|
449
|
-
|
|
450
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
451
|
-
const layoutBorderBaseStyles = css`
|
|
452
|
-
/* TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.
|
|
453
|
-
This is because the default state already uses the same token and, as such, the hover style won't change anything.
|
|
454
|
-
https://product-fabric.atlassian.net/browse/DSP-4441 */
|
|
455
|
-
/* Shows the border when cursor is inside a layout */
|
|
456
|
-
&.selected [data-layout-column],
|
|
457
|
-
&:hover [data-layout-column] {
|
|
458
|
-
border: ${akEditorSelectedBorderSize}px solid ${"var(--ds-border, #091E4224)"};
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
&.selected.danger [data-layout-column] {
|
|
462
|
-
background-color: ${`var(--ds-background-danger, ${akEditorDeleteBackground})`};
|
|
463
|
-
border-color: ${`var(--ds-border-danger, ${akEditorDeleteBorder})`};
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
&.${akEditorSelectedNodeClassName}:not(.danger) {
|
|
467
|
-
[data-layout-column] {
|
|
468
|
-
${getSelectionStyles([SelectionStyle.Border, SelectionStyle.Blanket])}
|
|
469
|
-
::after {
|
|
470
|
-
background-color: transparent;
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
`;
|
|
475
|
-
|
|
476
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
477
|
-
const layoutBorderViewStyles = css`
|
|
478
|
-
&.selected [data-layout-column],
|
|
479
|
-
&:hover [data-layout-column] {
|
|
480
|
-
border: 0;
|
|
481
|
-
}
|
|
482
|
-
`;
|
|
483
|
-
|
|
484
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
485
|
-
const columnSeparatorBaseStyles = css`
|
|
486
|
-
[data-layout-content]::before {
|
|
487
|
-
content: '';
|
|
488
|
-
border-left: ${akEditorSelectedBorderSize}px solid ${"var(--ds-border, #091E4224)"};
|
|
489
|
-
position: absolute;
|
|
490
|
-
height: calc(100% - 24px);
|
|
491
|
-
margin-left: -25px;
|
|
492
|
-
}
|
|
493
|
-
`;
|
|
494
|
-
|
|
495
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
496
|
-
const columnSeparatorViewStyles = css`
|
|
497
|
-
[data-layout-content]::before {
|
|
498
|
-
border-left: 0;
|
|
499
|
-
}
|
|
500
|
-
`;
|
|
501
|
-
|
|
502
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
503
|
-
const rowSeparatorBaseStyles = css`
|
|
504
|
-
[data-layout-content]::before {
|
|
505
|
-
content: '';
|
|
506
|
-
border-top: ${akEditorSelectedBorderSize}px solid ${"var(--ds-border, #091E4224)"};
|
|
507
|
-
position: absolute;
|
|
508
|
-
width: calc(100% - 32px);
|
|
509
|
-
margin-top: -13px;
|
|
510
|
-
|
|
511
|
-
/* clear styles for column separator */
|
|
512
|
-
border-left: unset;
|
|
513
|
-
margin-left: unset;
|
|
514
|
-
height: unset;
|
|
515
|
-
}
|
|
516
|
-
`;
|
|
517
|
-
|
|
518
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
519
|
-
const rowSeparatorViewStyles = css`
|
|
520
|
-
[data-layout-content]::before {
|
|
521
|
-
border-top: 0;
|
|
522
|
-
}
|
|
523
|
-
`;
|
|
524
|
-
|
|
525
|
-
// jest warning: JSDOM version (22) doesn't support the new @container CSS rule
|
|
526
|
-
const layoutWithSeparatorBorderResponsiveBaseStyles = (breakpoint
|
|
527
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
528
|
-
) => css`
|
|
529
|
-
&.selected,
|
|
530
|
-
&:hover,
|
|
531
|
-
&.selected.danger,
|
|
532
|
-
&.${akEditorSelectedNodeClassName}:not(.danger) {
|
|
533
|
-
[data-layout-column]:not(:first-of-type) {
|
|
534
|
-
@container editor-area (max-width:${breakpoint}px) {
|
|
535
|
-
${rowSeparatorBaseStyles}
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
`;
|
|
540
|
-
|
|
541
|
-
// jest warning: JSDOM version (22) doesn't support the new @container CSS rule
|
|
542
|
-
const layoutWithSeparatorBorderResponsiveViewStyles = (breakpoint
|
|
543
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
544
|
-
) => css`
|
|
545
|
-
&.selected,
|
|
546
|
-
&:hover,
|
|
547
|
-
&.selected.danger,
|
|
548
|
-
&.${akEditorSelectedNodeClassName}:not(.danger) {
|
|
549
|
-
[data-layout-column]:not(:first-of-type) {
|
|
550
|
-
@container editor-area (max-width:${breakpoint}px) {
|
|
551
|
-
${rowSeparatorViewStyles}
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
`;
|
|
556
|
-
|
|
557
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
558
|
-
const layoutWithSeparatorBorderBaseStyles = css`
|
|
559
|
-
&.selected [data-layout-column]:not(:first-of-type),
|
|
560
|
-
[data-empty-layout='true'] [data-layout-column]:not(:first-of-type),
|
|
561
|
-
&:hover [data-layout-column]:not(:first-of-type) {
|
|
562
|
-
${columnSeparatorBaseStyles}
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
&.selected.danger [data-layout-section] {
|
|
566
|
-
background-color: ${`var(--ds-background-danger, ${akEditorDeleteBackground})`};
|
|
567
|
-
|
|
568
|
-
box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px ${akEditorDeleteBorder};
|
|
569
|
-
border-radius: 4px;
|
|
570
|
-
[data-layout-column]:not(:first-of-type) {
|
|
571
|
-
${columnSeparatorBaseStyles}
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
&.${akEditorSelectedNodeClassName}:not(.danger) [data-layout-section] {
|
|
576
|
-
box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px ${"var(--ds-border-selected, #0C66E4)"};
|
|
577
|
-
border-radius: 4px;
|
|
578
|
-
background-color: ${"var(--ds-background-selected, #E9F2FF)"};
|
|
579
|
-
[data-layout-column] {
|
|
580
|
-
${getSelectionStyles([SelectionStyle.Blanket])}
|
|
581
|
-
border: 0px;
|
|
582
|
-
::before {
|
|
583
|
-
background-color: transparent;
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
[data-layout-column]:not(:first-of-type) {
|
|
587
|
-
${columnSeparatorBaseStyles}
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
`;
|
|
591
|
-
|
|
592
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
593
|
-
const layoutWithSeparatorBorderViewStyles = css`
|
|
594
|
-
&.selected [data-layout-column]:not(:first-of-type),
|
|
595
|
-
[data-empty-layout='true'] [data-layout-column]:not(:first-of-type),
|
|
596
|
-
&:hover [data-layout-column]:not(:first-of-type) {
|
|
597
|
-
${columnSeparatorViewStyles}
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
&.selected.danger [data-layout-section] {
|
|
601
|
-
box-shadow: 0 0 0 0 ${akEditorDeleteBorder};
|
|
602
|
-
[data-layout-column]:not(:first-of-type) {
|
|
603
|
-
${columnSeparatorViewStyles}
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
&.${akEditorSelectedNodeClassName}:not(.danger) [data-layout-section] {
|
|
608
|
-
box-shadow: 0 0 0 0 ${"var(--ds-border-selected, #0C66E4)"};
|
|
609
|
-
[data-layout-column]:not(:first-of-type) {
|
|
610
|
-
${columnSeparatorViewStyles}
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
`;
|
|
614
|
-
|
|
615
|
-
// jest warning: JSDOM version (22) doesn't support the new @container CSS rule
|
|
616
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
617
|
-
const layoutResponsiveBaseStyles = css`
|
|
618
|
-
/* chosen breakpoints in container queries are to make sure layout responsiveness in editor aligns with renderer */
|
|
619
|
-
/* not resized layout in full-width editor */
|
|
620
|
-
.fabric-editor--full-width-mode .ProseMirror {
|
|
621
|
-
> .layoutSectionView-content-wrap {
|
|
622
|
-
[data-layout-section] {
|
|
623
|
-
@container editor-area (max-width:724px) {
|
|
624
|
-
flex-direction: column;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
${layoutWithSeparatorBorderResponsiveBaseStyles(724)}
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
/* not resized layout in fixed-width editor */
|
|
633
|
-
.ak-editor-content-area:not(.fabric-editor--full-width-mode) .ProseMirror {
|
|
634
|
-
> .layoutSectionView-content-wrap {
|
|
635
|
-
[data-layout-section] {
|
|
636
|
-
@container editor-area (max-width:788px) {
|
|
637
|
-
flex-direction: column;
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
${layoutWithSeparatorBorderResponsiveBaseStyles(788)}
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
/* resized layout in full/fixed-width editor */
|
|
646
|
-
.ProseMirror .fabric-editor-breakout-mark {
|
|
647
|
-
.layoutSectionView-content-wrap {
|
|
648
|
-
[data-layout-section] {
|
|
649
|
-
@container editor-area (max-width:820px) {
|
|
650
|
-
flex-direction: column;
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
${layoutWithSeparatorBorderResponsiveBaseStyles(820)}
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
`;
|
|
658
|
-
|
|
659
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
660
|
-
const layoutResponsiveViewStyles = css`
|
|
661
|
-
/* chosen breakpoints in container queries are to make sure layout responsiveness in editor aligns with renderer */
|
|
662
|
-
/* not resized layout in full-width editor */
|
|
663
|
-
.fabric-editor--full-width-mode .ProseMirror {
|
|
664
|
-
> .layoutSectionView-content-wrap {
|
|
665
|
-
${layoutWithSeparatorBorderResponsiveViewStyles(724)}
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
/* not resized layout in fixed-width editor */
|
|
670
|
-
.ak-editor-content-area:not(.fabric-editor--full-width-mode) .ProseMirror {
|
|
671
|
-
> .layoutSectionView-content-wrap {
|
|
672
|
-
${layoutWithSeparatorBorderResponsiveViewStyles(788)}
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
/* resized layout in full/fixed-width editor */
|
|
677
|
-
.ProseMirror .fabric-editor-breakout-mark {
|
|
678
|
-
.layoutSectionView-content-wrap {
|
|
679
|
-
${layoutWithSeparatorBorderResponsiveViewStyles(820)}
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
`;
|
|
683
|
-
|
|
684
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
685
|
-
const layoutBaseStyles = () => css`
|
|
686
|
-
.ProseMirror {
|
|
687
|
-
${layoutSectionStyles()}
|
|
688
|
-
[data-layout-section] {
|
|
689
|
-
/* Ignored via go/ees007
|
|
690
|
-
TODO: Migrate away from gridSize
|
|
691
|
-
Recommendation: Replace directly with 7px */
|
|
692
|
-
margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? 8 : 0)}px 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`;
|
|
@@ -1153,7 +403,7 @@ const contentStyles = () => css`
|
|
|
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(),
|
|
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: {
|