@atlaskit/editor-core 193.24.6 → 193.24.15

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 (113) hide show
  1. package/.eslintrc.js +37 -37
  2. package/CHANGELOG.md +8 -0
  3. package/architecture/0001-record-architecture-decisions.md +6 -3
  4. package/architecture/0002-deep-equality-check-for-getsharedstate.md +9 -8
  5. package/architecture/0003-explicit-plugin-dependencies.md +47 -18
  6. package/codemods/140.0.0-rc-kraken-fix-type-errors.ts +1 -3
  7. package/codemods/145.0.0-deprecate-props.ts +1 -3
  8. package/codemods/172.0.0-transform-smartlinks-prop.ts +1 -3
  9. package/codemods/175.0.0-rename-unsafe-allowUndoRedoButton-prop.ts +1 -1
  10. package/codemods/180.1.0-update-to-editor-migration-component.ts +1 -3
  11. package/codemods/__tests__/next-remove-allow-more-text-colors-prop.ts +29 -31
  12. package/codemods/__tests__/remove-config-panel-width-prop.ts +29 -31
  13. package/codemods/__tests__/rename-editor-to-editor-migration-component.ts +43 -45
  14. package/codemods/__tests__/rename-smartlinks-prop.ts +57 -59
  15. package/codemods/__tests__/rename-unsafe-allowUndoRedoButtons-prop.ts +43 -43
  16. package/codemods/__tests__/rename-unsafe-cards-prop.ts +43 -45
  17. package/codemods/migrates/next-remove-allow-more-text-colors-prop.ts +41 -45
  18. package/codemods/migrates/remove-config-panel-width-prop.ts +20 -29
  19. package/codemods/migrates/rename-editor-to-editor-migration-component.ts +20 -24
  20. package/codemods/migrates/rename-smartlinks-prop.ts +30 -38
  21. package/codemods/migrates/rename-unsafe-allowUndoRedoButtons-prop.ts +4 -5
  22. package/codemods/migrates/rename-unsafe-cards-prop.ts +1 -4
  23. package/codemods/utils.ts +62 -72
  24. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +3 -3
  25. package/dist/cjs/ui/AppearanceComponents/Mobile.js +5 -5
  26. package/dist/cjs/ui/ContentStyles/ai-panels.js +1 -1
  27. package/dist/cjs/ui/ContentStyles/code-block.js +2 -2
  28. package/dist/cjs/ui/ContentStyles/date.js +1 -1
  29. package/dist/cjs/ui/ContentStyles/expand.js +1 -1
  30. package/dist/cjs/ui/ContentStyles/extension.js +2 -2
  31. package/dist/cjs/ui/ContentStyles/index.js +6 -6
  32. package/dist/cjs/ui/ContentStyles/layout.js +1 -1
  33. package/dist/cjs/ui/ContentStyles/media.js +1 -1
  34. package/dist/cjs/ui/ContentStyles/panel.js +1 -1
  35. package/dist/cjs/ui/ContentStyles/status.js +1 -1
  36. package/dist/cjs/ui/ContentStyles/tasks-and-decisions.js +1 -1
  37. package/dist/cjs/version-wrapper.js +1 -1
  38. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +40 -40
  39. package/dist/es2019/ui/AppearanceComponents/Mobile.js +5 -5
  40. package/dist/es2019/ui/ContentStyles/ai-panels.js +80 -80
  41. package/dist/es2019/ui/ContentStyles/code-block.js +58 -58
  42. package/dist/es2019/ui/ContentStyles/date.js +19 -19
  43. package/dist/es2019/ui/ContentStyles/expand.js +98 -98
  44. package/dist/es2019/ui/ContentStyles/extension.js +154 -159
  45. package/dist/es2019/ui/ContentStyles/index.js +139 -144
  46. package/dist/es2019/ui/ContentStyles/layout.js +125 -125
  47. package/dist/es2019/ui/ContentStyles/media.js +179 -178
  48. package/dist/es2019/ui/ContentStyles/panel.js +29 -30
  49. package/dist/es2019/ui/ContentStyles/status.js +30 -32
  50. package/dist/es2019/ui/ContentStyles/tasks-and-decisions.js +18 -19
  51. package/dist/es2019/version-wrapper.js +1 -1
  52. package/dist/esm/ui/Appearance/Comment/Toolbar.js +3 -3
  53. package/dist/esm/ui/AppearanceComponents/Mobile.js +5 -5
  54. package/dist/esm/ui/ContentStyles/ai-panels.js +1 -1
  55. package/dist/esm/ui/ContentStyles/code-block.js +2 -2
  56. package/dist/esm/ui/ContentStyles/date.js +1 -1
  57. package/dist/esm/ui/ContentStyles/expand.js +1 -1
  58. package/dist/esm/ui/ContentStyles/extension.js +2 -2
  59. package/dist/esm/ui/ContentStyles/index.js +6 -6
  60. package/dist/esm/ui/ContentStyles/layout.js +1 -1
  61. package/dist/esm/ui/ContentStyles/media.js +1 -1
  62. package/dist/esm/ui/ContentStyles/panel.js +1 -1
  63. package/dist/esm/ui/ContentStyles/status.js +1 -1
  64. package/dist/esm/ui/ContentStyles/tasks-and-decisions.js +1 -1
  65. package/dist/esm/version-wrapper.js +1 -1
  66. package/dist/types/composable-editor/editor.d.ts +1 -1
  67. package/dist/types/composable-editor/hooks/useProviders.d.ts +1 -1
  68. package/dist/types/create-editor/create-preset.d.ts +135 -9
  69. package/dist/types/create-editor/sort-by-order.d.ts +1 -1
  70. package/dist/types/event-dispatcher/index.d.ts +2 -2
  71. package/dist/types/index.d.ts +2 -2
  72. package/dist/types/presets/default.d.ts +120 -8
  73. package/dist/types/presets/universal.d.ts +135 -9
  74. package/dist/types/presets/useUniversalPreset.d.ts +135 -9
  75. package/dist/types/test-utils.d.ts +1 -1
  76. package/dist/types/types/browser.d.ts +1 -1
  77. package/dist/types/types/editor-plugin.d.ts +1 -1
  78. package/dist/types/types/empty-state-handler.d.ts +1 -1
  79. package/dist/types/types/feature-flags.d.ts +1 -1
  80. package/dist/types/types/index.d.ts +3 -3
  81. package/dist/types/types/pm-config.d.ts +1 -1
  82. package/dist/types/types/ui-components.d.ts +1 -1
  83. package/dist/types/ui/Addon/ClickAreaBlock/index.d.ts +1 -1
  84. package/dist/types/ui/Toolbar/types.d.ts +1 -1
  85. package/dist/types/utils/action.d.ts +1 -4
  86. package/dist/types/utils/performance/plugin-performance-report.d.ts +1 -1
  87. package/dist/types/utils/slice.d.ts +1 -1
  88. package/dist/types-ts4.5/composable-editor/editor.d.ts +1 -1
  89. package/dist/types-ts4.5/composable-editor/hooks/useProviders.d.ts +1 -1
  90. package/dist/types-ts4.5/create-editor/create-preset.d.ts +153 -9
  91. package/dist/types-ts4.5/create-editor/sort-by-order.d.ts +1 -1
  92. package/dist/types-ts4.5/event-dispatcher/index.d.ts +2 -2
  93. package/dist/types-ts4.5/index.d.ts +2 -2
  94. package/dist/types-ts4.5/presets/default.d.ts +136 -8
  95. package/dist/types-ts4.5/presets/universal.d.ts +153 -9
  96. package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +153 -9
  97. package/dist/types-ts4.5/test-utils.d.ts +1 -1
  98. package/dist/types-ts4.5/types/browser.d.ts +1 -1
  99. package/dist/types-ts4.5/types/editor-plugin.d.ts +1 -1
  100. package/dist/types-ts4.5/types/empty-state-handler.d.ts +1 -1
  101. package/dist/types-ts4.5/types/feature-flags.d.ts +1 -1
  102. package/dist/types-ts4.5/types/index.d.ts +3 -3
  103. package/dist/types-ts4.5/types/pm-config.d.ts +1 -1
  104. package/dist/types-ts4.5/types/ui-components.d.ts +1 -1
  105. package/dist/types-ts4.5/ui/Addon/ClickAreaBlock/index.d.ts +1 -1
  106. package/dist/types-ts4.5/ui/Toolbar/types.d.ts +1 -1
  107. package/dist/types-ts4.5/utils/performance/plugin-performance-report.d.ts +1 -1
  108. package/dist/types-ts4.5/utils/slice.d.ts +1 -1
  109. package/docs/0-intro.tsx +13 -19
  110. package/docs/1-legacy-editor.tsx +13 -19
  111. package/docs/4-annotations.tsx +222 -223
  112. package/package.json +25 -12
  113. package/report.api.md +448 -473
@@ -34,97 +34,96 @@ import { taskDecisionStyles } from './tasks-and-decisions';
34
34
 
35
35
  // eslint-disable-next-line @atlaskit/design-system/no-exported-css
36
36
  export const linkStyles = css`
37
- .ProseMirror {
38
- ${linkSharedStyle}
39
- }
37
+ .ProseMirror {
38
+ ${linkSharedStyle}
39
+ }
40
40
  `;
41
41
  const ruleStyles = () => css`
42
- .ProseMirror {
43
- ${ruleSharedStyles()};
42
+ .ProseMirror {
43
+ ${ruleSharedStyles()};
44
44
 
45
- hr {
46
- cursor: pointer;
47
- padding: ${"var(--ds-space-050, 4px)"} 0;
48
- margin: ${"var(--ds-space-300, 24px)"} 0;
49
- background-clip: content-box;
45
+ hr {
46
+ cursor: pointer;
47
+ padding: ${"var(--ds-space-050, 4px)"} 0;
48
+ margin: ${"var(--ds-space-300, 24px)"} 0;
49
+ background-clip: content-box;
50
50
 
51
- &.${akEditorSelectedNodeClassName} {
52
- outline: none;
53
- background-color: ${`var(--ds-border-selected, ${akEditorSelectedBorderColor})`};
54
- }
55
- }
56
- }
51
+ &.${akEditorSelectedNodeClassName} {
52
+ outline: none;
53
+ background-color: ${`var(--ds-border-selected, ${akEditorSelectedBorderColor})`};
54
+ }
55
+ }
56
+ }
57
57
  `;
58
58
  const mentionsStyles = css`
59
- .${MentionSharedCssClassName.MENTION_CONTAINER} {
60
- &.${akEditorSelectedNodeClassName} [data-mention-id] > span {
61
- ${getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Background])}
59
+ .${MentionSharedCssClassName.MENTION_CONTAINER} {
60
+ &.${akEditorSelectedNodeClassName} [data-mention-id] > span {
61
+ ${getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Background])}
62
62
 
63
- /* need to specify dark text colour because personal mentions
63
+ /* need to specify dark text colour because personal mentions
64
64
  (in dark blue) have white text by default */
65
65
  color: ${`var(--ds-text-subtle, ${N500})`};
66
- }
67
- }
66
+ }
67
+ }
68
68
 
69
- .danger {
70
- .${MentionSharedCssClassName.MENTION_CONTAINER}.${akEditorSelectedNodeClassName}
71
- > span
72
- > span
73
- > span {
74
- box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px ${akEditorDeleteBorder};
75
- background-color: ${`var(--ds-background-danger, ${akEditorDeleteBackgroundWithOpacity})`};
76
- }
77
- .${MentionSharedCssClassName.MENTION_CONTAINER} > span > span > span {
78
- background-color: ${`var(--ds-background-neutral, ${N30A})`};
79
- color: ${`var(--ds-text-subtle, ${N500})`};
80
- }
81
- }
69
+ .danger {
70
+ .${MentionSharedCssClassName.MENTION_CONTAINER}.${akEditorSelectedNodeClassName}
71
+ > span
72
+ > span
73
+ > span {
74
+ box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px ${akEditorDeleteBorder};
75
+ background-color: ${`var(--ds-background-danger, ${akEditorDeleteBackgroundWithOpacity})`};
76
+ }
77
+ .${MentionSharedCssClassName.MENTION_CONTAINER} > span > span > span {
78
+ background-color: ${`var(--ds-background-neutral, ${N30A})`};
79
+ color: ${`var(--ds-text-subtle, ${N500})`};
80
+ }
81
+ }
82
82
  `;
83
83
  const listsStyles = css`
84
- .ProseMirror {
85
- li {
86
- position: relative;
84
+ .ProseMirror {
85
+ li {
86
+ position: relative;
87
87
 
88
- > p:not(:first-child) {
89
- margin: ${"var(--ds-space-050, 4px)"} 0 0 0;
90
- }
88
+ > p:not(:first-child) {
89
+ margin: ${"var(--ds-space-050, 4px)"} 0 0 0;
90
+ }
91
91
 
92
- // In SSR the above rule will apply to all p tags because first-child would be a style tag.
93
- // The following rule resets the first p tag back to its original margin
94
- // defined in packages/editor/editor-common/src/styles/shared/paragraph.ts
95
- > style:first-child + p {
96
- margin-top: ${blockNodesVerticalMargin};
97
- }
98
- }
92
+ // In SSR the above rule will apply to all p tags because first-child would be a style tag.
93
+ // The following rule resets the first p tag back to its original margin
94
+ // defined in packages/editor/editor-common/src/styles/shared/paragraph.ts
95
+ > style:first-child + p {
96
+ margin-top: ${blockNodesVerticalMargin};
97
+ }
98
+ }
99
99
 
100
- &:not([data-node-type='decisionList']) > li,
100
+ &:not([data-node-type='decisionList']) > li,
101
101
  // This prevents https://product-fabric.atlassian.net/browse/ED-20924
102
102
  &:not(.${SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER}) > li {
103
- ${browser.safari ? codeBlockInListSafariFix : ''}
104
- }
105
- }
103
+ ${browser.safari ? codeBlockInListSafariFix : ''}
104
+ }
105
+ }
106
106
  `;
107
107
  const emojiStyles = css`
108
- .${EmojiSharedCssClassName.EMOJI_CONTAINER} {
109
- display: inline-block;
108
+ .${EmojiSharedCssClassName.EMOJI_CONTAINER} {
109
+ display: inline-block;
110
110
 
111
- .${EmojiSharedCssClassName.EMOJI_NODE} {
112
- cursor: pointer;
111
+ .${EmojiSharedCssClassName.EMOJI_NODE} {
112
+ cursor: pointer;
113
113
 
114
- &.${EmojiSharedCssClassName.EMOJI_IMAGE} > span {
115
- /** needed for selection style to cover custom emoji image properly */
116
- display: flex;
117
- }
118
- }
114
+ &.${EmojiSharedCssClassName.EMOJI_IMAGE} > span {
115
+ /** needed for selection style to cover custom emoji image properly */
116
+ display: flex;
117
+ }
118
+ }
119
119
 
120
- &.${akEditorSelectedNodeClassName} {
121
- .${EmojiSharedCssClassName.EMOJI_SPRITE},
122
- .${EmojiSharedCssClassName.EMOJI_IMAGE} {
123
- border-radius: 2px;
124
- ${getSelectionStyles([SelectionStyle.Blanket, SelectionStyle.BoxShadow])}
125
- }
126
- }
127
- }
120
+ &.${akEditorSelectedNodeClassName} {
121
+ .${EmojiSharedCssClassName.EMOJI_SPRITE}, .${EmojiSharedCssClassName.EMOJI_IMAGE} {
122
+ border-radius: 2px;
123
+ ${getSelectionStyles([SelectionStyle.Blanket, SelectionStyle.BoxShadow])}
124
+ }
125
+ }
126
+ }
128
127
  `;
129
128
 
130
129
  // eslint-disable-next-line @atlaskit/design-system/no-exported-css
@@ -143,42 +142,42 @@ export const placeholderStyles = css({
143
142
  }
144
143
  });
145
144
  const contentStyles = props => css`
146
- .ProseMirror {
147
- outline: none;
148
- font-size: ${editorFontSize({
145
+ .ProseMirror {
146
+ outline: none;
147
+ font-size: ${editorFontSize({
149
148
  theme: props.theme
150
149
  })}px;
151
- ${whitespaceSharedStyles};
152
- ${paragraphSharedStyles};
153
- ${listsSharedStyles};
154
- ${indentationSharedStyles};
155
- ${shadowSharedStyle};
156
- ${InlineNodeViewSharedStyles};
157
- }
150
+ ${whitespaceSharedStyles};
151
+ ${paragraphSharedStyles};
152
+ ${listsSharedStyles};
153
+ ${indentationSharedStyles};
154
+ ${shadowSharedStyle};
155
+ ${InlineNodeViewSharedStyles};
156
+ }
158
157
 
159
- .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {
160
- pointer-events: none;
161
- opacity: 0.7;
162
- }
158
+ .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {
159
+ pointer-events: none;
160
+ opacity: 0.7;
161
+ }
163
162
 
164
- .ProseMirror-hideselection *::selection {
165
- background: transparent;
166
- }
163
+ .ProseMirror-hideselection *::selection {
164
+ background: transparent;
165
+ }
167
166
 
168
- .ProseMirror-hideselection *::-moz-selection {
169
- background: transparent;
170
- }
167
+ .ProseMirror-hideselection *::-moz-selection {
168
+ background: transparent;
169
+ }
171
170
 
172
- .ProseMirror-selectednode {
173
- outline: none;
174
- }
171
+ .ProseMirror-selectednode {
172
+ outline: none;
173
+ }
175
174
 
176
- .ProseMirror-selectednode:empty {
177
- outline: 2px solid ${"var(--ds-border-focused, #8cf)"};
178
- }
175
+ .ProseMirror-selectednode:empty {
176
+ outline: 2px solid ${"var(--ds-border-focused, #8cf)"};
177
+ }
179
178
 
180
- ${placeholderTextStyles}
181
- ${placeholderStyles}
179
+ ${placeholderTextStyles}
180
+ ${placeholderStyles}
182
181
  ${codeBlockStyles()}
183
182
 
184
183
  ${blocktypeStyles()}
@@ -191,8 +190,8 @@ const contentStyles = props => css`
191
190
  ${layoutStyles(props.viewMode)}
192
191
  ${telepointerStyle}
193
192
  ${gapCursorStyles};
194
- ${tableStyles(props)}
195
- ${panelStyles()}
193
+ ${tableStyles(props)}
194
+ ${panelStyles()}
196
195
  ${mentionsStyles}
197
196
  ${emojiStyles}
198
197
  ${tasksAndDecisionsStyles}
@@ -216,62 +215,58 @@ const contentStyles = props => css`
216
215
  ${aiPanelStyles(props.colorMode)}
217
216
 
218
217
  .panelView-content-wrap {
219
- box-sizing: border-box;
220
- }
218
+ box-sizing: border-box;
219
+ }
221
220
 
222
- .mediaGroupView-content-wrap ul {
223
- padding: 0;
224
- }
221
+ .mediaGroupView-content-wrap ul {
222
+ padding: 0;
223
+ }
225
224
 
226
- /** Needed to override any cleared floats, e.g. image wrapping */
225
+ /** Needed to override any cleared floats, e.g. image wrapping */
227
226
 
228
- div.fabric-editor-block-mark[class^='fabric-editor-align'] {
229
- clear: none !important;
230
- }
227
+ div.fabric-editor-block-mark[class^='fabric-editor-align'] {
228
+ clear: none !important;
229
+ }
231
230
 
232
- .fabric-editor-align-end {
233
- text-align: right;
234
- }
231
+ .fabric-editor-align-end {
232
+ text-align: right;
233
+ }
235
234
 
236
- .fabric-editor-align-start {
237
- text-align: left;
238
- }
235
+ .fabric-editor-align-start {
236
+ text-align: left;
237
+ }
239
238
 
240
- .fabric-editor-align-center {
241
- text-align: center;
242
- }
239
+ .fabric-editor-align-center {
240
+ text-align: center;
241
+ }
243
242
 
244
- .pm-table-header-content-wrap :not(.fabric-editor-alignment),
245
- .pm-table-header-content-wrap
246
- :not(p, .fabric-editor-block-mark)
247
- + div.fabric-editor-block-mark,
248
- .pm-table-cell-content-wrap
249
- :not(p, .fabric-editor-block-mark)
250
- + div.fabric-editor-block-mark {
251
- p:first-of-type {
252
- margin-top: 0;
253
- }
254
- }
255
- .pm-table-cell-content-wrap .mediaGroupView-content-wrap {
256
- clear: both;
257
- }
243
+ .pm-table-header-content-wrap :not(.fabric-editor-alignment),
244
+ .pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,
245
+ .pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {
246
+ p:first-of-type {
247
+ margin-top: 0;
248
+ }
249
+ }
250
+ .pm-table-cell-content-wrap .mediaGroupView-content-wrap {
251
+ clear: both;
252
+ }
258
253
 
259
- .hyperlink-floating-toolbar,
260
- .${MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT} {
261
- padding: 0;
262
- }
254
+ .hyperlink-floating-toolbar,
255
+ .${MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT} {
256
+ padding: 0;
257
+ }
263
258
 
264
- /* Link icon in the Atlaskit package
259
+ /* Link icon in the Atlaskit package
265
260
  is bigger than the others
266
261
  */
267
- .hyperlink-open-link {
268
- svg {
269
- max-width: 18px;
270
- }
271
- &[href] {
272
- padding: 0 4px;
273
- }
274
- }
262
+ .hyperlink-open-link {
263
+ svg {
264
+ max-width: 18px;
265
+ }
266
+ &[href] {
267
+ padding: 0 4px;
268
+ }
269
+ }
275
270
  `;
276
271
  export const createEditorContentStyle = styles => {
277
272
  return /*#__PURE__*/React.forwardRef((props, ref) => {
@@ -8,131 +8,131 @@ export { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN };
8
8
 
9
9
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
10
10
  export const layoutStyles = viewMode => css`
11
- .ProseMirror {
12
- ${columnLayoutSharedStyle} [data-layout-section] {
13
- // TODO: Migrate away from gridSize
14
- // Recommendation: Replace directly with 7px
15
- margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset}px 0;
16
- transition: border-color 0.3s ${akEditorSwoopCubicBezier};
17
- cursor: ${viewMode === 'view' ? 'default' : 'pointer'};
18
-
19
- /* Inner cursor located 26px from left */
20
- [data-layout-column] {
21
- flex: 1;
22
- min-width: 0;
23
- border: ${viewMode === 'view' ? 0 : akEditorSelectedBorderSize}px solid
24
- ${`var(--ds-border, ${N40A})`};
25
- border-radius: 4px;
26
- padding: ${LAYOUT_COLUMN_PADDING}px;
27
- box-sizing: border-box;
28
-
29
- > div {
30
- > :not(style):first-child,
31
- > style:first-child + * {
32
- margin-top: 0;
33
- }
34
-
35
- > .ProseMirror-gapcursor:first-child + *,
36
- > style:first-child + .ProseMirror-gapcursor + * {
37
- margin-top: 0;
38
- }
39
-
40
- > .ProseMirror-gapcursor:first-child + span + *,
41
- > style:first-child + .ProseMirror-gapcursor:first-child + span + * {
42
- margin-top: 0;
43
- }
44
-
45
- > .embedCardView-content-wrap:first-of-type .rich-media-item {
46
- margin-top: 0;
47
- }
48
-
49
- > .mediaSingleView-content-wrap:first-of-type .rich-media-item {
50
- margin-top: 0;
51
- }
52
-
53
- > .ProseMirror-gapcursor.-right:first-child
54
- + .mediaSingleView-content-wrap
55
- .rich-media-item,
56
- > style:first-child
57
- + .ProseMirror-gapcursor.-right
58
- + .mediaSingleView-content-wrap
59
- .rich-media-item,
60
- > .ProseMirror-gapcursor.-right:first-of-type
61
- + .embedCardView-content-wrap
62
- .rich-media-item {
63
- margin-top: 0;
64
- }
65
-
66
- > .ProseMirror-gapcursor:first-child
67
- + span
68
- + .mediaSingleView-content-wrap
69
- .rich-media-item,
70
- > style:first-child
71
- + .ProseMirror-gapcursor
72
- + span
73
- + .mediaSingleView-content-wrap
74
- .rich-media-item {
75
- margin-top: 0;
76
- }
77
-
78
- /* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down
11
+ .ProseMirror {
12
+ ${columnLayoutSharedStyle} [data-layout-section] {
13
+ // TODO: Migrate away from gridSize
14
+ // Recommendation: Replace directly with 7px
15
+ margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset}px 0;
16
+ transition: border-color 0.3s ${akEditorSwoopCubicBezier};
17
+ cursor: ${viewMode === 'view' ? 'default' : 'pointer'};
18
+
19
+ /* Inner cursor located 26px from left */
20
+ [data-layout-column] {
21
+ flex: 1;
22
+ min-width: 0;
23
+ border: ${viewMode === 'view' ? 0 : akEditorSelectedBorderSize}px solid
24
+ ${`var(--ds-border, ${N40A})`};
25
+ border-radius: 4px;
26
+ padding: ${LAYOUT_COLUMN_PADDING}px;
27
+ box-sizing: border-box;
28
+
29
+ > div {
30
+ > :not(style):first-child,
31
+ > style:first-child + * {
32
+ margin-top: 0;
33
+ }
34
+
35
+ > .ProseMirror-gapcursor:first-child + *,
36
+ > style:first-child + .ProseMirror-gapcursor + * {
37
+ margin-top: 0;
38
+ }
39
+
40
+ > .ProseMirror-gapcursor:first-child + span + *,
41
+ > style:first-child + .ProseMirror-gapcursor:first-child + span + * {
42
+ margin-top: 0;
43
+ }
44
+
45
+ > .embedCardView-content-wrap:first-of-type .rich-media-item {
46
+ margin-top: 0;
47
+ }
48
+
49
+ > .mediaSingleView-content-wrap:first-of-type .rich-media-item {
50
+ margin-top: 0;
51
+ }
52
+
53
+ > .ProseMirror-gapcursor.-right:first-child
54
+ + .mediaSingleView-content-wrap
55
+ .rich-media-item,
56
+ > style:first-child
57
+ + .ProseMirror-gapcursor.-right
58
+ + .mediaSingleView-content-wrap
59
+ .rich-media-item,
60
+ > .ProseMirror-gapcursor.-right:first-of-type
61
+ + .embedCardView-content-wrap
62
+ .rich-media-item {
63
+ margin-top: 0;
64
+ }
65
+
66
+ > .ProseMirror-gapcursor:first-child
67
+ + span
68
+ + .mediaSingleView-content-wrap
69
+ .rich-media-item,
70
+ > style:first-child
71
+ + .ProseMirror-gapcursor
72
+ + span
73
+ + .mediaSingleView-content-wrap
74
+ .rich-media-item {
75
+ margin-top: 0;
76
+ }
77
+
78
+ /* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down
79
79
  and shrinking layout's node selectable area (leniency margin) */
80
- > [data-node-type='decisionList'] {
81
- li:first-of-type [data-decision-wrapper] {
82
- margin-top: 0;
83
- }
84
- }
85
- }
86
-
87
- /* Make the 'content' fill the entire height of the layout column to allow click
80
+ > [data-node-type='decisionList'] {
81
+ li:first-of-type [data-decision-wrapper] {
82
+ margin-top: 0;
83
+ }
84
+ }
85
+ }
86
+
87
+ /* Make the 'content' fill the entire height of the layout column to allow click
88
88
  handler of layout section nodeview to target only data-layout-column */
89
- [data-layout-content] {
90
- height: 100%;
91
- cursor: text;
92
- .mediaGroupView-content-wrap {
93
- clear: both;
94
- }
95
- }
96
- }
97
-
98
- [data-layout-column] + [data-layout-column] {
99
- margin-left: ${LAYOUT_SECTION_MARGIN}px;
100
- }
101
-
102
- @media screen and (max-width: ${gridMediumMaxWidth}px) {
103
- [data-layout-column] + [data-layout-column] {
104
- margin-left: 0;
105
- }
106
- }
107
-
108
- // TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.
109
- // This is because the default state already uses the same token and, as such, the hover style won't change anything.
110
- // https://product-fabric.atlassian.net/browse/DSP-4441
111
- /* Shows the border when cursor is inside a layout */
112
- &.selected [data-layout-column],
113
- &:hover [data-layout-column] {
114
- border: ${viewMode === 'view' ? 0 : akEditorSelectedBorderSize}px solid
115
- ${`var(--ds-border, ${N50A})`};
116
- }
117
-
118
- &.selected.danger > [data-layout-column] {
119
- background-color: ${`var(--ds-background-danger, ${akEditorDeleteBackground})`};
120
- border-color: ${`var(--ds-border-danger, ${akEditorDeleteBorder})`};
121
- }
122
-
123
- &.${akEditorSelectedNodeClassName}:not(.danger) {
124
- [data-layout-column] {
125
- ${getSelectionStyles([SelectionStyle.Border, SelectionStyle.Blanket])}
126
- }
127
- }
128
- }
129
- }
130
-
131
- .fabric-editor--full-width-mode .ProseMirror {
132
- [data-layout-section] {
133
- .${TableCssClassName.TABLE_CONTAINER} {
134
- margin: 0 ${tableMarginFullWidthMode}px;
135
- }
136
- }
137
- }
89
+ [data-layout-content] {
90
+ height: 100%;
91
+ cursor: text;
92
+ .mediaGroupView-content-wrap {
93
+ clear: both;
94
+ }
95
+ }
96
+ }
97
+
98
+ [data-layout-column] + [data-layout-column] {
99
+ margin-left: ${LAYOUT_SECTION_MARGIN}px;
100
+ }
101
+
102
+ @media screen and (max-width: ${gridMediumMaxWidth}px) {
103
+ [data-layout-column] + [data-layout-column] {
104
+ margin-left: 0;
105
+ }
106
+ }
107
+
108
+ // TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.
109
+ // This is because the default state already uses the same token and, as such, the hover style won't change anything.
110
+ // https://product-fabric.atlassian.net/browse/DSP-4441
111
+ /* Shows the border when cursor is inside a layout */
112
+ &.selected [data-layout-column],
113
+ &:hover [data-layout-column] {
114
+ border: ${viewMode === 'view' ? 0 : akEditorSelectedBorderSize}px solid
115
+ ${`var(--ds-border, ${N50A})`};
116
+ }
117
+
118
+ &.selected.danger > [data-layout-column] {
119
+ background-color: ${`var(--ds-background-danger, ${akEditorDeleteBackground})`};
120
+ border-color: ${`var(--ds-border-danger, ${akEditorDeleteBorder})`};
121
+ }
122
+
123
+ &.${akEditorSelectedNodeClassName}:not(.danger) {
124
+ [data-layout-column] {
125
+ ${getSelectionStyles([SelectionStyle.Border, SelectionStyle.Blanket])}
126
+ }
127
+ }
128
+ }
129
+ }
130
+
131
+ .fabric-editor--full-width-mode .ProseMirror {
132
+ [data-layout-section] {
133
+ .${TableCssClassName.TABLE_CONTAINER} {
134
+ margin: 0 ${tableMarginFullWidthMode}px;
135
+ }
136
+ }
137
+ }
138
138
  `;