@atlaskit/editor-core 167.0.1 → 167.0.4

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 (117) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/i18n/cs.js +1 -23
  3. package/dist/cjs/i18n/da.js +1 -23
  4. package/dist/cjs/i18n/de.js +1 -23
  5. package/dist/cjs/i18n/es.js +1 -23
  6. package/dist/cjs/i18n/et.js +1 -23
  7. package/dist/cjs/i18n/fr.js +1 -23
  8. package/dist/cjs/i18n/hu.js +1 -23
  9. package/dist/cjs/i18n/is.js +1 -23
  10. package/dist/cjs/i18n/it.js +1 -23
  11. package/dist/cjs/i18n/ko.js +1 -23
  12. package/dist/cjs/i18n/nb.js +1 -9
  13. package/dist/cjs/i18n/nl.js +0 -3
  14. package/dist/cjs/i18n/pl.js +0 -1
  15. package/dist/cjs/i18n/pt_BR.js +1 -8
  16. package/dist/cjs/i18n/pt_PT.js +1 -11
  17. package/dist/cjs/i18n/ro.js +1 -23
  18. package/dist/cjs/i18n/sk.js +1 -23
  19. package/dist/cjs/i18n/sv.js +0 -1
  20. package/dist/cjs/plugins/card/styles.js +1 -1
  21. package/dist/cjs/plugins/date/actions.js +1 -1
  22. package/dist/cjs/plugins/layout/styles.js +1 -1
  23. package/dist/cjs/plugins/list/styles.js +3 -1
  24. package/dist/cjs/plugins/paste/handlers.js +40 -14
  25. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +1 -1
  26. package/dist/cjs/plugins/paste/pm-plugins/main.js +17 -0
  27. package/dist/cjs/plugins/quick-insert/search.js +3 -1
  28. package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
  29. package/dist/cjs/plugins/table/utils/paste.js +16 -3
  30. package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +7 -0
  31. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +1 -1
  32. package/dist/cjs/version-wrapper.js +1 -1
  33. package/dist/cjs/version.json +1 -1
  34. package/dist/es2019/i18n/cs.js +1 -23
  35. package/dist/es2019/i18n/da.js +1 -23
  36. package/dist/es2019/i18n/de.js +1 -23
  37. package/dist/es2019/i18n/es.js +1 -23
  38. package/dist/es2019/i18n/et.js +1 -23
  39. package/dist/es2019/i18n/fr.js +1 -23
  40. package/dist/es2019/i18n/hu.js +1 -23
  41. package/dist/es2019/i18n/is.js +1 -23
  42. package/dist/es2019/i18n/it.js +1 -23
  43. package/dist/es2019/i18n/ko.js +1 -23
  44. package/dist/es2019/i18n/nb.js +1 -9
  45. package/dist/es2019/i18n/nl.js +0 -3
  46. package/dist/es2019/i18n/pl.js +0 -1
  47. package/dist/es2019/i18n/pt_BR.js +1 -8
  48. package/dist/es2019/i18n/pt_PT.js +1 -11
  49. package/dist/es2019/i18n/ro.js +1 -23
  50. package/dist/es2019/i18n/sk.js +1 -23
  51. package/dist/es2019/i18n/sv.js +0 -1
  52. package/dist/es2019/plugins/card/styles.js +3 -0
  53. package/dist/es2019/plugins/date/actions.js +1 -1
  54. package/dist/es2019/plugins/layout/styles.js +2 -1
  55. package/dist/es2019/plugins/list/styles.js +8 -0
  56. package/dist/es2019/plugins/paste/handlers.js +39 -12
  57. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +2 -2
  58. package/dist/es2019/plugins/paste/pm-plugins/main.js +14 -0
  59. package/dist/es2019/plugins/quick-insert/search.js +1 -1
  60. package/dist/es2019/plugins/table/ui/common-styles.js +4 -1
  61. package/dist/es2019/plugins/table/utils/paste.js +16 -3
  62. package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +7 -0
  63. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +5 -2
  64. package/dist/es2019/version-wrapper.js +1 -1
  65. package/dist/es2019/version.json +1 -1
  66. package/dist/esm/i18n/cs.js +1 -23
  67. package/dist/esm/i18n/da.js +1 -23
  68. package/dist/esm/i18n/de.js +1 -23
  69. package/dist/esm/i18n/es.js +1 -23
  70. package/dist/esm/i18n/et.js +1 -23
  71. package/dist/esm/i18n/fr.js +1 -23
  72. package/dist/esm/i18n/hu.js +1 -23
  73. package/dist/esm/i18n/is.js +1 -23
  74. package/dist/esm/i18n/it.js +1 -23
  75. package/dist/esm/i18n/ko.js +1 -23
  76. package/dist/esm/i18n/nb.js +1 -9
  77. package/dist/esm/i18n/nl.js +0 -3
  78. package/dist/esm/i18n/pl.js +0 -1
  79. package/dist/esm/i18n/pt_BR.js +1 -8
  80. package/dist/esm/i18n/pt_PT.js +1 -11
  81. package/dist/esm/i18n/ro.js +1 -23
  82. package/dist/esm/i18n/sk.js +1 -23
  83. package/dist/esm/i18n/sv.js +0 -1
  84. package/dist/esm/plugins/card/styles.js +1 -1
  85. package/dist/esm/plugins/date/actions.js +1 -1
  86. package/dist/esm/plugins/layout/styles.js +1 -1
  87. package/dist/esm/plugins/list/styles.js +2 -1
  88. package/dist/esm/plugins/paste/handlers.js +40 -13
  89. package/dist/esm/plugins/paste/pm-plugins/analytics.js +2 -2
  90. package/dist/esm/plugins/paste/pm-plugins/main.js +16 -0
  91. package/dist/esm/plugins/quick-insert/search.js +3 -1
  92. package/dist/esm/plugins/table/ui/common-styles.js +1 -1
  93. package/dist/esm/plugins/table/utils/paste.js +16 -3
  94. package/dist/esm/plugins/type-ahead/ui/InputQuery.js +7 -0
  95. package/dist/esm/ui/Appearance/Comment/Toolbar.js +1 -1
  96. package/dist/esm/version-wrapper.js +1 -1
  97. package/dist/esm/version.json +1 -1
  98. package/dist/types/i18n/cs.d.ts +0 -22
  99. package/dist/types/i18n/da.d.ts +0 -22
  100. package/dist/types/i18n/de.d.ts +0 -22
  101. package/dist/types/i18n/es.d.ts +0 -22
  102. package/dist/types/i18n/et.d.ts +0 -22
  103. package/dist/types/i18n/fr.d.ts +0 -22
  104. package/dist/types/i18n/hu.d.ts +0 -22
  105. package/dist/types/i18n/is.d.ts +0 -22
  106. package/dist/types/i18n/it.d.ts +0 -22
  107. package/dist/types/i18n/ko.d.ts +0 -22
  108. package/dist/types/i18n/nb.d.ts +0 -8
  109. package/dist/types/i18n/nl.d.ts +0 -3
  110. package/dist/types/i18n/pl.d.ts +0 -1
  111. package/dist/types/i18n/pt_BR.d.ts +0 -7
  112. package/dist/types/i18n/pt_PT.d.ts +0 -10
  113. package/dist/types/i18n/ro.d.ts +0 -22
  114. package/dist/types/i18n/sk.d.ts +0 -22
  115. package/dist/types/i18n/sv.d.ts +0 -1
  116. package/dist/types/plugins/paste/handlers.d.ts +1 -1
  117. package/package.json +11 -11
@@ -293,27 +293,5 @@ export default {
293
293
  'fabric.editor.warningPanel': '경고 패널',
294
294
  'fabric.editor.warningPanel.description': '색상 있는 패널에 주의 사항 메모 추가',
295
295
  'fabric.editor.wrapLeft': '왼쪽에서 줄 바꿈',
296
- 'fabric.editor.wrapRight': '오른쪽에서 줄 바꿈',
297
- 'fabric.theme.blue': 'Blue',
298
- 'fabric.theme.dark-blue': 'Dark blue',
299
- 'fabric.theme.dark-green': 'Dark green',
300
- 'fabric.theme.dark-purple': 'Dark purple',
301
- 'fabric.theme.dark-red': 'Dark red',
302
- 'fabric.theme.dark-teal': 'Dark teal',
303
- 'fabric.theme.dark-yellow': 'Dark yellow',
304
- 'fabric.theme.gray': 'Gray',
305
- 'fabric.theme.green': 'Green',
306
- 'fabric.theme.light-blue': 'Light blue',
307
- 'fabric.theme.light-gray': 'Light gray',
308
- 'fabric.theme.light-green': 'Light green',
309
- 'fabric.theme.light-purple': 'Light purple',
310
- 'fabric.theme.light-red': 'Light red',
311
- 'fabric.theme.light-teal': 'Light teal',
312
- 'fabric.theme.light-yellow': 'Light yellow',
313
- 'fabric.theme.orange': 'Orange',
314
- 'fabric.theme.purple': 'Purple',
315
- 'fabric.theme.red': 'Red',
316
- 'fabric.theme.teal': 'Teal',
317
- 'fabric.theme.white': 'White',
318
- 'fabric.theme.yellow': 'Yellow'
296
+ 'fabric.editor.wrapRight': '오른쪽에서 줄 바꿈'
319
297
  };
@@ -294,26 +294,18 @@ export default {
294
294
  'fabric.editor.warningPanel.description': 'Legg til en advarsel i et farget panel',
295
295
  'fabric.editor.wrapLeft': 'Juster til venstre',
296
296
  'fabric.editor.wrapRight': 'Juster til høyre',
297
- 'fabric.theme.blue': 'Blue',
298
297
  'fabric.theme.dark-blue': 'Mørk blå',
299
298
  'fabric.theme.dark-green': 'Mørk grønn',
300
299
  'fabric.theme.dark-purple': 'Mørk lilla',
301
300
  'fabric.theme.dark-red': 'Mørkerød',
302
301
  'fabric.theme.dark-teal': 'Mørk blågrønn',
303
- 'fabric.theme.dark-yellow': 'Dark yellow',
304
- 'fabric.theme.gray': 'Gray',
305
- 'fabric.theme.green': 'Green',
306
- 'fabric.theme.light-blue': 'Light blue',
307
- 'fabric.theme.light-gray': 'Light gray',
308
302
  'fabric.theme.light-green': 'Lysegrønn',
309
303
  'fabric.theme.light-purple': 'Lys lilla',
310
304
  'fabric.theme.light-red': 'Lyserød',
311
305
  'fabric.theme.light-teal': 'Lys blågrønn',
312
- 'fabric.theme.light-yellow': 'Light yellow',
313
306
  'fabric.theme.orange': 'Oransje',
314
307
  'fabric.theme.purple': 'Lilla',
315
308
  'fabric.theme.red': 'Rød',
316
309
  'fabric.theme.teal': 'Blågrønn',
317
- 'fabric.theme.white': 'Hvit',
318
- 'fabric.theme.yellow': 'Yellow'
310
+ 'fabric.theme.white': 'Hvit'
319
311
  };
@@ -312,8 +312,5 @@ export default {
312
312
  'fabric.theme.light-yellow': 'Lichtgeel',
313
313
  'fabric.theme.orange': 'Oranje',
314
314
  'fabric.theme.purple': 'Paars',
315
- 'fabric.theme.red': 'Red',
316
- 'fabric.theme.teal': 'Teal',
317
- 'fabric.theme.white': 'White',
318
315
  'fabric.theme.yellow': 'Geel'
319
316
  };
@@ -313,7 +313,6 @@ export default {
313
313
  'fabric.theme.orange': 'Pomarańczowy',
314
314
  'fabric.theme.purple': 'Fioletowy',
315
315
  'fabric.theme.red': 'Czerwony',
316
- 'fabric.theme.teal': 'Teal',
317
316
  'fabric.theme.white': 'Biały',
318
317
  'fabric.theme.yellow': 'Żółty'
319
318
  };
@@ -294,26 +294,19 @@ export default {
294
294
  'fabric.editor.warningPanel.description': 'Adicionar uma nota de atenção em um painel colorido',
295
295
  'fabric.editor.wrapLeft': 'Ajustar à esquerda',
296
296
  'fabric.editor.wrapRight': 'Ajustar à direita',
297
- 'fabric.theme.blue': 'Blue',
298
297
  'fabric.theme.dark-blue': 'Azul-escuro',
299
298
  'fabric.theme.dark-green': 'Verde-escuro',
300
299
  'fabric.theme.dark-purple': 'Roxo-escuro',
301
300
  'fabric.theme.dark-red': 'Vermelho-escuro',
302
301
  'fabric.theme.dark-teal': 'Azul-petróleo escuro',
303
302
  'fabric.theme.dark-yellow': 'Amarelo-escuro',
304
- 'fabric.theme.gray': 'Gray',
305
303
  'fabric.theme.green': 'Verde',
306
- 'fabric.theme.light-blue': 'Light blue',
307
- 'fabric.theme.light-gray': 'Light gray',
308
304
  'fabric.theme.light-green': 'Verde claro',
309
305
  'fabric.theme.light-purple': 'Roxo claro',
310
306
  'fabric.theme.light-red': 'Vermelho claro',
311
307
  'fabric.theme.light-teal': 'Verde-petróleo claro',
312
308
  'fabric.theme.light-yellow': 'Amarelo claro',
313
- 'fabric.theme.orange': 'Orange',
314
309
  'fabric.theme.purple': 'Roxo',
315
- 'fabric.theme.red': 'Red',
316
310
  'fabric.theme.teal': 'Azul-petróleo',
317
- 'fabric.theme.white': 'Branco',
318
- 'fabric.theme.yellow': 'Yellow'
311
+ 'fabric.theme.white': 'Branco'
319
312
  };
@@ -165,26 +165,16 @@ export default {
165
165
  'fabric.editor.warningPanel.description': 'Adicionar uma nota de advertência a um painel colorido',
166
166
  'fabric.editor.wrapLeft': 'Alinhar à esquerda',
167
167
  'fabric.editor.wrapRight': 'Alinhar à direita',
168
- 'fabric.theme.blue': 'Blue',
169
168
  'fabric.theme.dark-blue': 'Azul-escuro',
170
169
  'fabric.theme.dark-green': 'Verde-escuro',
171
170
  'fabric.theme.dark-purple': 'Roxo-escuro',
172
171
  'fabric.theme.dark-red': 'Dark red',
173
172
  'fabric.theme.dark-teal': 'Verde-azulado-escuro',
174
173
  'fabric.theme.dark-yellow': 'Amarelo-escuro',
175
- 'fabric.theme.gray': 'Gray',
176
- 'fabric.theme.green': 'Green',
177
- 'fabric.theme.light-blue': 'Light blue',
178
- 'fabric.theme.light-gray': 'Light gray',
179
174
  'fabric.theme.light-green': 'Verde-claro',
180
175
  'fabric.theme.light-purple': 'Roxo-claro',
181
176
  'fabric.theme.light-red': 'Vermelho-claro',
182
177
  'fabric.theme.light-teal': 'Verde-azulado-claro',
183
178
  'fabric.theme.light-yellow': 'Amarelo claro',
184
- 'fabric.theme.orange': 'Orange',
185
- 'fabric.theme.purple': 'Purple',
186
- 'fabric.theme.red': 'Red',
187
- 'fabric.theme.teal': 'Teal',
188
- 'fabric.theme.white': 'Branco',
189
- 'fabric.theme.yellow': 'Yellow'
179
+ 'fabric.theme.white': 'Branco'
190
180
  };
@@ -149,27 +149,5 @@ export default {
149
149
  'fabric.editor.moreFormatting': 'Mai multe opțiuni formatare',
150
150
  'fabric.editor.bold': 'Bold',
151
151
  'fabric.editor.italic': 'Italic',
152
- 'fabric.editor.selected': 'Selectate',
153
- 'fabric.theme.white': 'White',
154
- 'fabric.theme.light-blue': 'Light blue',
155
- 'fabric.theme.light-teal': 'Light teal',
156
- 'fabric.theme.light-green': 'Light green',
157
- 'fabric.theme.light-yellow': 'Light yellow',
158
- 'fabric.theme.light-red': 'Light red',
159
- 'fabric.theme.light-purple': 'Light purple',
160
- 'fabric.theme.light-gray': 'Light gray',
161
- 'fabric.theme.blue': 'Blue',
162
- 'fabric.theme.teal': 'Teal',
163
- 'fabric.theme.green': 'Green',
164
- 'fabric.theme.yellow': 'Yellow',
165
- 'fabric.theme.red': 'Red',
166
- 'fabric.theme.orange': 'Orange',
167
- 'fabric.theme.purple': 'Purple',
168
- 'fabric.theme.gray': 'Gray',
169
- 'fabric.theme.dark-blue': 'Dark blue',
170
- 'fabric.theme.dark-teal': 'Dark teal',
171
- 'fabric.theme.dark-green': 'Dark green',
172
- 'fabric.theme.dark-yellow': 'Dark yellow',
173
- 'fabric.theme.dark-red': 'Dark red',
174
- 'fabric.theme.dark-purple': 'Dark purple'
152
+ 'fabric.editor.selected': 'Selectate'
175
153
  };
@@ -164,27 +164,5 @@ export default {
164
164
  'fabric.editor.warningPanel': 'Panel výstrah',
165
165
  'fabric.editor.warningPanel.description': 'Pridať upozornenie do farebného panela',
166
166
  'fabric.editor.wrapLeft': 'Zbaliť vľavo',
167
- 'fabric.editor.wrapRight': 'Zbaliť vpravo',
168
- 'fabric.theme.blue': 'Blue',
169
- 'fabric.theme.dark-blue': 'Dark blue',
170
- 'fabric.theme.dark-green': 'Dark green',
171
- 'fabric.theme.dark-purple': 'Dark purple',
172
- 'fabric.theme.dark-red': 'Dark red',
173
- 'fabric.theme.dark-teal': 'Dark teal',
174
- 'fabric.theme.dark-yellow': 'Dark yellow',
175
- 'fabric.theme.gray': 'Gray',
176
- 'fabric.theme.green': 'Green',
177
- 'fabric.theme.light-blue': 'Light blue',
178
- 'fabric.theme.light-gray': 'Light gray',
179
- 'fabric.theme.light-green': 'Light green',
180
- 'fabric.theme.light-purple': 'Light purple',
181
- 'fabric.theme.light-red': 'Light red',
182
- 'fabric.theme.light-teal': 'Light teal',
183
- 'fabric.theme.light-yellow': 'Light yellow',
184
- 'fabric.theme.orange': 'Orange',
185
- 'fabric.theme.purple': 'Purple',
186
- 'fabric.theme.red': 'Red',
187
- 'fabric.theme.teal': 'Teal',
188
- 'fabric.theme.white': 'White',
189
- 'fabric.theme.yellow': 'Yellow'
167
+ 'fabric.editor.wrapRight': 'Zbaliť vpravo'
190
168
  };
@@ -310,7 +310,6 @@ export default {
310
310
  'fabric.theme.light-red': 'Ljusröd',
311
311
  'fabric.theme.light-teal': 'Ljust blågrön',
312
312
  'fabric.theme.light-yellow': 'Ljusgul',
313
- 'fabric.theme.orange': 'Orange',
314
313
  'fabric.theme.purple': 'Lila',
315
314
  'fabric.theme.red': 'Röd',
316
315
  'fabric.theme.teal': 'Blågrön',
@@ -13,6 +13,9 @@ export const smartCardStyles = css`
13
13
  .card {
14
14
  padding-left: 2px;
15
15
  padding-right: 2px;
16
+ padding-top: 0.5em;
17
+ padding-bottom: 0.5em;
18
+ margin-bottom: -0.5em;
16
19
 
17
20
  .${SmartCardSharedCssClassName.LOADER_WRAPPER} > a:focus {
18
21
  ${getSelectionStyles([SelectionStyle.BoxShadow])}
@@ -149,7 +149,7 @@ export const insertDate = (date, inputMethod, commitMethod, enterPressed = true)
149
149
  timestamp
150
150
  }).setMeta(pluginKey, {
151
151
  isNew: false
152
- }).scrollIntoView(); // Used to keep the date node selected on mobile after changing it
152
+ }).scrollIntoView();
153
153
 
154
154
  if (!enterPressed) {
155
155
  tr = tr.setSelection(NodeSelection.create(tr.doc, showDatePickerAt));
@@ -27,7 +27,8 @@ export const layoutStyles = css`
27
27
  box-sizing: border-box;
28
28
 
29
29
  > div {
30
- > *:first-child {
30
+ > :not(style):first-child,
31
+ > style:first-child + * {
31
32
  margin-top: 0;
32
33
  }
33
34
 
@@ -1,4 +1,5 @@
1
1
  import { css } from '@emotion/react';
2
+ import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
2
3
  export const listsStyles = css`
3
4
  .ProseMirror li {
4
5
  position: relative;
@@ -6,5 +7,12 @@ export const listsStyles = css`
6
7
  > p:not(:first-child) {
7
8
  margin: 4px 0 0 0;
8
9
  }
10
+
11
+ // In SSR the above rule will apply to all p tags because first-child would be a style tag.
12
+ // The following rule resets the first p tag back to its original margin
13
+ // defined in packages/editor/editor-common/src/styles/shared/paragraph.ts
14
+ > style:first-child + p {
15
+ margin-top: ${blockNodesVerticalMargin};
16
+ }
9
17
  }
10
18
  `;
@@ -30,8 +30,10 @@ export function handleMention(slice, schema) {
30
30
  return node;
31
31
  });
32
32
  }
33
- export function handlePasteIntoTaskAndDecision(slice) {
33
+ export function handlePasteIntoTaskOrDecisionOrPanel(slice) {
34
34
  return (state, dispatch) => {
35
+ var _slice$content$firstC, _slice$content$firstC2, _transformedSlice$con;
36
+
35
37
  const {
36
38
  schema,
37
39
  tr: {
@@ -44,20 +46,32 @@ export function handlePasteIntoTaskAndDecision(slice) {
44
46
  },
45
47
  nodes: {
46
48
  decisionItem,
47
- decisionList,
48
49
  emoji,
49
50
  hardBreak,
50
51
  mention,
51
52
  paragraph,
52
- taskList,
53
53
  taskItem,
54
- text
54
+ text,
55
+ panel,
56
+ bulletList,
57
+ orderedList,
58
+ expand,
59
+ heading
55
60
  }
56
61
  } = schema;
57
- const isDecisionOrTaskNodeSelection = state.selection instanceof NodeSelection && ['decisionList', 'decisionItem', 'taskList', 'taskItem'].includes(state.selection.node.type.name);
58
- const hasParentDecisionOrTaskItem = hasParentNodeOfType([decisionItem, taskItem])(state.selection);
62
+ const selectionIsValidNode = state.selection instanceof NodeSelection && ['decisionList', 'decisionItem', 'taskList', 'taskItem'].includes(state.selection.node.type.name);
63
+ const selectionHasValidParentNode = hasParentNodeOfType([decisionItem, taskItem, panel])(state.selection);
64
+ const selectionIsPanel = hasParentNodeOfType([panel])(state.selection); // Some types of content should be handled by the default handler, not this function.
65
+
66
+ const sliceFirstNodeType = (_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type;
67
+ const sliceIsInvalid = sliceFirstNodeType === bulletList || sliceFirstNodeType === orderedList || sliceFirstNodeType === expand || sliceFirstNodeType === heading; // If the selection is a panel,
68
+ // and the slice's first node is a paragraph
69
+ // and it is not from a depth that would indicate it being from inside from another node (e.g. text from a decision)
70
+ // then we can rely on the default behaviour.
71
+
72
+ const sliceIsAPanelReceivingLowDepthText = selectionIsPanel && ((_slice$content$firstC2 = slice.content.firstChild) === null || _slice$content$firstC2 === void 0 ? void 0 : _slice$content$firstC2.type) === paragraph && slice.openEnd < 2;
59
73
 
60
- if (!decisionItem || !decisionList || !taskList || !taskItem || !hasParentDecisionOrTaskItem && !isDecisionOrTaskNodeSelection) {
74
+ if (sliceIsInvalid || sliceIsAPanelReceivingLowDepthText || !selectionIsValidNode && !selectionHasValidParentNode) {
61
75
  return false;
62
76
  }
63
77
 
@@ -72,11 +86,15 @@ export function handlePasteIntoTaskAndDecision(slice) {
72
86
 
73
87
  const transformedSlice = compose.apply(null, filters)(slice);
74
88
  const tr = closeHistory(state.tr);
75
- const transformedSliceIsValidNode = transformedSlice.content.firstChild.type.inlineContent || ['decisionList', 'decisionItem', 'taskList', 'taskItem'].includes(transformedSlice.content.firstChild.type.name);
89
+ const transformedSliceIsValidNode = transformedSlice.content.firstChild.type.inlineContent || ['decisionList', 'decisionItem', 'taskList', 'taskItem', 'panel'].includes(transformedSlice.content.firstChild.type.name); // If the slice or the selection are valid nodes to handle,
90
+ // and the slice is not a whole node (i.e. openStart is 1 and openEnd is 0)
91
+ // or the slice's first node is a paragraph,
92
+ // then we can replace the selection with our slice.
76
93
 
77
- if (transformedSliceIsValidNode || isDecisionOrTaskNodeSelection) {
94
+ if ((transformedSliceIsValidNode || selectionIsValidNode) && !(transformedSlice.openStart === 1 && transformedSlice.openEnd === 0) || ((_transformedSlice$con = transformedSlice.content.firstChild) === null || _transformedSlice$con === void 0 ? void 0 : _transformedSlice$con.type) === paragraph) {
78
95
  tr.replaceSelection(transformedSlice).scrollIntoView();
79
96
  } else {
97
+ // This maintains both the selection (destination) and the slice (paste content).
80
98
  safeInsert(transformedSlice.content)(tr).scrollIntoView();
81
99
  }
82
100
 
@@ -381,13 +399,22 @@ export function handleMediaSingle(inputMethod) {
381
399
  };
382
400
  };
383
401
  }
402
+
403
+ const checkExpand = slice => {
404
+ let hasExpand = false;
405
+ slice.content.forEach(node => {
406
+ if (node.type.name === 'expand') {
407
+ hasExpand = true;
408
+ }
409
+ });
410
+ return hasExpand;
411
+ };
412
+
384
413
  export function handleExpandPasteInTable(slice) {
385
414
  return (state, dispatch) => {
386
- var _slice$content$firstC;
387
-
388
415
  // Do not handle expand if it's not being pasted into a table
389
416
  // OR if it's nested within another node when being pasted into a table
390
- if (!insideTable(state) || ((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type.name) !== 'expand') {
417
+ if (!insideTable(state) || !checkExpand(slice)) {
391
418
  return false;
392
419
  }
393
420
 
@@ -1,6 +1,6 @@
1
1
  import { ACTION, INPUT_METHOD, EVENT_TYPE, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, PasteTypes, PasteContents, withAnalytics } from '../../analytics';
2
2
  import { getPasteSource } from '../util';
3
- import { handlePasteAsPlainText, handlePasteIntoTaskAndDecision, handleCodeBlock, handleMediaSingle, handlePastePreservingMarks, handleMarkdown, handleRichText, handleExpandPasteInTable, handleSelectedTable, handlePasteLinkOnSelectedText, handlePasteIntoCaption } from '../handlers';
3
+ import { handlePasteAsPlainText, handlePasteIntoTaskOrDecisionOrPanel, handleCodeBlock, handleMediaSingle, handlePastePreservingMarks, handleMarkdown, handleRichText, handleExpandPasteInTable, handleSelectedTable, handlePasteLinkOnSelectedText, handlePasteIntoCaption } from '../handlers';
4
4
  import { pipe } from '../../../utils';
5
5
  import { findParentNode } from 'prosemirror-utils';
6
6
  import { mapSlice } from '../../../utils/slice';
@@ -219,7 +219,7 @@ export const handlePasteAsPlainTextWithAnalytics = (view, event, slice) => pipe(
219
219
  type: PasteTypes.plain,
220
220
  asPlain: true
221
221
  }))(slice, event);
222
- export const handlePasteIntoTaskAndDecisionWithAnalytics = (view, event, slice, type) => pipe(handlePasteIntoTaskAndDecision, pasteCommandWithAnalytics(view, event, slice, {
222
+ export const handlePasteIntoTaskAndDecisionWithAnalytics = (view, event, slice, type) => pipe(handlePasteIntoTaskOrDecisionOrPanel, pasteCommandWithAnalytics(view, event, slice, {
223
223
  type: type
224
224
  }))(slice);
225
225
  export const handlePasteIntoCaptionWithAnalytics = (view, event, slice, type) => pipe(handlePasteIntoCaption, pasteCommandWithAnalytics(view, event, slice, {
@@ -291,6 +291,20 @@ export function createPlugin(schema, dispatchAnalyticsEvent, plainTextPasteLinki
291
291
 
292
292
  if (handlePastePreservingMarksWithAnalytics(view, event, slice, PasteTypes.richText)(state, dispatch)) {
293
293
  return true;
294
+ } // Check that we are pasting in a location that does not accept
295
+ // breakout marks, if so we strip the mark and paste. Note that
296
+ // breakout marks are only valid in the root document.
297
+
298
+
299
+ if (selectionParentType !== state.schema.nodes.doc) {
300
+ const sliceCopy = Slice.fromJSON(state.schema, slice.toJSON() || {});
301
+ sliceCopy.content.descendants(node => {
302
+ node.marks = node.marks.filter(mark => mark.type.name !== 'breakout'); // as breakout marks should only be on top level nodes,
303
+ // we don't traverse the entire document
304
+
305
+ return false;
306
+ });
307
+ slice = sliceCopy;
294
308
  }
295
309
 
296
310
  if (handleExpandWithAnalytics(view, event, slice)(state, dispatch)) {
@@ -28,7 +28,7 @@ export function find(query, items) {
28
28
  return items.slice(0).sort((a, b) => (a.priority || Number.POSITIVE_INFINITY) - (b.priority || Number.POSITIVE_INFINITY));
29
29
  }
30
30
 
31
- return fuse.search(query);
31
+ return fuse.search(query).map(result => result.item);
32
32
  }
33
33
  export const searchQuickInsertItems = (quickInsertState, options) => (query, category) => {
34
34
  const defaultItems = options && options.disableDefaultItems ? [] : quickInsertState.lazyDefaultItems();
@@ -446,7 +446,8 @@ export const tableStyles = props => {
446
446
  color: ${tableTextColor(props)};
447
447
  border-color: ${tableBorderColor(props)};
448
448
 
449
- :first-child {
449
+ :first-child:not(style),
450
+ style:first-child + * {
450
451
  margin-top: 0;
451
452
  }
452
453
  :last-child {
@@ -499,6 +500,8 @@ export const tableStyles = props => {
499
500
  /* Table */
500
501
  .${ClassName.TABLE_NODE_WRAPPER} > table {
501
502
  table-layout: fixed;
503
+ // Fixes Chrome border clipping bug ED-15245
504
+ background: ${tableBorderColor(props)};
502
505
 
503
506
  .${ClassName.COLUMN_CONTROLS_DECORATIONS} + * {
504
507
  margin-top: 0;
@@ -62,7 +62,7 @@ export const transformSliceToFixHardBreakProblemOnCopyFromCell = (slice, schema)
62
62
  return slice;
63
63
  };
64
64
  export const transformSliceToRemoveOpenTable = (slice, schema) => {
65
- var _slice$content$firstC;
65
+ var _slice$content$firstC6;
66
66
 
67
67
  // we're removing the table, tableRow and tableCell reducing the open depth by 3
68
68
  const depthDecrement = 3; // Case 1: A slice entirely within a single CELL
@@ -70,13 +70,26 @@ export const transformSliceToRemoveOpenTable = (slice, schema) => {
70
70
  if ( // starts and ends inside of a cell
71
71
  slice.openStart >= 4 && slice.openEnd >= 4 && // slice is a table node
72
72
  slice.content.childCount === 1 && slice.content.firstChild.type === schema.nodes.table) {
73
- return new Slice(flatmap(slice.content, unwrapContentFromTable), slice.openStart - depthDecrement, slice.openEnd - depthDecrement);
73
+ var _slice$content$firstC, _slice$content$firstC2, _slice$content$firstC3, _slice$content$firstC4, _slice$content$firstC5;
74
+
75
+ // prosemirror-view has a bug that it duplicates table entry when selecting multiple paragraphs in a table cell.
76
+ // https://github.com/ProseMirror/prosemirror/issues/1270
77
+ // The structure becomes
78
+ // table(genuine) > tableRow(genuine) > table(duplicated) > tableRow(duplicated) > tableCell/tableHeader(genuine) > contents(genuine)
79
+ // As we are removing wrapping table anyway, we keep duplicated table and tableRow for simplicity
80
+ let cleaned = slice;
81
+
82
+ if (((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : (_slice$content$firstC2 = _slice$content$firstC.content) === null || _slice$content$firstC2 === void 0 ? void 0 : (_slice$content$firstC3 = _slice$content$firstC2.firstChild) === null || _slice$content$firstC3 === void 0 ? void 0 : (_slice$content$firstC4 = _slice$content$firstC3.content) === null || _slice$content$firstC4 === void 0 ? void 0 : (_slice$content$firstC5 = _slice$content$firstC4.firstChild) === null || _slice$content$firstC5 === void 0 ? void 0 : _slice$content$firstC5.type) === schema.nodes.table) {
83
+ cleaned = new Slice(slice.content.firstChild.content.firstChild.content, slice.openStart - 2, slice.openEnd - 2);
84
+ }
85
+
86
+ return new Slice(flatmap(cleaned.content, unwrapContentFromTable), cleaned.openStart - depthDecrement, cleaned.openEnd - depthDecrement);
74
87
  } // Case 2: A slice starting within a CELL and ending outside the table
75
88
 
76
89
 
77
90
  if ( // starts inside of a cell but ends outside of the starting table
78
91
  slice.openStart >= 4 && // slice starts from a table node (and spans across more than one node)
79
- slice.content.childCount > 1 && ((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type) === schema.nodes.table) {
92
+ slice.content.childCount > 1 && ((_slice$content$firstC6 = slice.content.firstChild) === null || _slice$content$firstC6 === void 0 ? void 0 : _slice$content$firstC6.type) === schema.nodes.table) {
80
93
  // repoint the slice's cutting depth so that cell content where the slice starts
81
94
  // does not get lifted out of the cell on paste
82
95
  return new Slice(slice.content, 1, slice.openEnd);
@@ -102,6 +102,13 @@ export const InputQuery = /*#__PURE__*/React.memo(({
102
102
  break;
103
103
 
104
104
  case 'Enter':
105
+ // ED-14758 - Under the W3C specification, any keycode sent under IME would return a keycode 229
106
+ // event.isComposing can't be used alone as this also included a virtual keyboard under a keyboardless device, therefore, it seems the best practice would be intercepting the event as below.
107
+ // Some suggested the other workaround maybe listen on`keypress` instead of `keydown`
108
+ if (event.isComposing && (event.which === 229 || event.keyCode === 229)) {
109
+ break;
110
+ }
111
+
105
112
  onItemSelect(event.shiftKey ? SelectItemMode.SHIFT_ENTER : SelectItemMode.ENTER);
106
113
  break;
107
114
 
@@ -16,8 +16,11 @@ const mainToolbarWrapperStyle = css`
16
16
  box-shadow: none;
17
17
  padding-left: ${TableControlsPadding}px;
18
18
 
19
- & > div > *:first-child {
20
- margin-left: 0;
19
+ & > div {
20
+ > :first-child:not(style),
21
+ > style:first-child + * {
22
+ margin-left: 0;
23
+ }
21
24
  }
22
25
 
23
26
  .block-type-btn {
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "167.0.1";
2
+ export const version = "167.0.4";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "167.0.1",
3
+ "version": "167.0.4",
4
4
  "sideEffects": false
5
5
  }
@@ -293,27 +293,5 @@ export default {
293
293
  'fabric.editor.warningPanel': 'Panel upozornění',
294
294
  'fabric.editor.warningPanel.description': 'Přidat poznámku s varováním do barevného panelu',
295
295
  'fabric.editor.wrapLeft': 'Sbalit vpravo',
296
- 'fabric.editor.wrapRight': 'Sbalit vlevo',
297
- 'fabric.theme.blue': 'Blue',
298
- 'fabric.theme.dark-blue': 'Dark blue',
299
- 'fabric.theme.dark-green': 'Dark green',
300
- 'fabric.theme.dark-purple': 'Dark purple',
301
- 'fabric.theme.dark-red': 'Dark red',
302
- 'fabric.theme.dark-teal': 'Dark teal',
303
- 'fabric.theme.dark-yellow': 'Dark yellow',
304
- 'fabric.theme.gray': 'Gray',
305
- 'fabric.theme.green': 'Green',
306
- 'fabric.theme.light-blue': 'Light blue',
307
- 'fabric.theme.light-gray': 'Light gray',
308
- 'fabric.theme.light-green': 'Light green',
309
- 'fabric.theme.light-purple': 'Light purple',
310
- 'fabric.theme.light-red': 'Light red',
311
- 'fabric.theme.light-teal': 'Light teal',
312
- 'fabric.theme.light-yellow': 'Light yellow',
313
- 'fabric.theme.orange': 'Orange',
314
- 'fabric.theme.purple': 'Purple',
315
- 'fabric.theme.red': 'Red',
316
- 'fabric.theme.teal': 'Teal',
317
- 'fabric.theme.white': 'White',
318
- 'fabric.theme.yellow': 'Yellow'
296
+ 'fabric.editor.wrapRight': 'Sbalit vlevo'
319
297
  };
@@ -293,27 +293,5 @@ export default {
293
293
  'fabric.editor.warningPanel': 'Advarselspanel',
294
294
  'fabric.editor.warningPanel.description': 'Tilføj en advarselsnote i et farvet panel',
295
295
  'fabric.editor.wrapLeft': 'Skub til venstre',
296
- 'fabric.editor.wrapRight': 'Skub til højre',
297
- 'fabric.theme.blue': 'Blue',
298
- 'fabric.theme.dark-blue': 'Dark blue',
299
- 'fabric.theme.dark-green': 'Dark green',
300
- 'fabric.theme.dark-purple': 'Dark purple',
301
- 'fabric.theme.dark-red': 'Dark red',
302
- 'fabric.theme.dark-teal': 'Dark teal',
303
- 'fabric.theme.dark-yellow': 'Dark yellow',
304
- 'fabric.theme.gray': 'Gray',
305
- 'fabric.theme.green': 'Green',
306
- 'fabric.theme.light-blue': 'Light blue',
307
- 'fabric.theme.light-gray': 'Light gray',
308
- 'fabric.theme.light-green': 'Light green',
309
- 'fabric.theme.light-purple': 'Light purple',
310
- 'fabric.theme.light-red': 'Light red',
311
- 'fabric.theme.light-teal': 'Light teal',
312
- 'fabric.theme.light-yellow': 'Light yellow',
313
- 'fabric.theme.orange': 'Orange',
314
- 'fabric.theme.purple': 'Purple',
315
- 'fabric.theme.red': 'Red',
316
- 'fabric.theme.teal': 'Teal',
317
- 'fabric.theme.white': 'White',
318
- 'fabric.theme.yellow': 'Yellow'
296
+ 'fabric.editor.wrapRight': 'Skub til højre'
319
297
  };
@@ -293,27 +293,5 @@ export default {
293
293
  'fabric.editor.warningPanel': 'Warn-Panel',
294
294
  'fabric.editor.warningPanel.description': 'Hinweis zur Vorsicht in einem farbigen Panel einfügen',
295
295
  'fabric.editor.wrapLeft': 'Links umwickeln',
296
- 'fabric.editor.wrapRight': 'Rechts umwickeln',
297
- 'fabric.theme.blue': 'Blue',
298
- 'fabric.theme.dark-blue': 'Dark blue',
299
- 'fabric.theme.dark-green': 'Dark green',
300
- 'fabric.theme.dark-purple': 'Dark purple',
301
- 'fabric.theme.dark-red': 'Dark red',
302
- 'fabric.theme.dark-teal': 'Dark teal',
303
- 'fabric.theme.dark-yellow': 'Dark yellow',
304
- 'fabric.theme.gray': 'Gray',
305
- 'fabric.theme.green': 'Green',
306
- 'fabric.theme.light-blue': 'Light blue',
307
- 'fabric.theme.light-gray': 'Light gray',
308
- 'fabric.theme.light-green': 'Light green',
309
- 'fabric.theme.light-purple': 'Light purple',
310
- 'fabric.theme.light-red': 'Light red',
311
- 'fabric.theme.light-teal': 'Light teal',
312
- 'fabric.theme.light-yellow': 'Light yellow',
313
- 'fabric.theme.orange': 'Orange',
314
- 'fabric.theme.purple': 'Purple',
315
- 'fabric.theme.red': 'Red',
316
- 'fabric.theme.teal': 'Teal',
317
- 'fabric.theme.white': 'White',
318
- 'fabric.theme.yellow': 'Yellow'
296
+ 'fabric.editor.wrapRight': 'Rechts umwickeln'
319
297
  };
@@ -293,27 +293,5 @@ export default {
293
293
  'fabric.editor.warningPanel': 'Panel de advertencias',
294
294
  'fabric.editor.warningPanel.description': 'Añadir una nota de precaución en un panel de color',
295
295
  'fabric.editor.wrapLeft': 'Ajustar a la izquierda',
296
- 'fabric.editor.wrapRight': 'Ajustar a la derecha',
297
- 'fabric.theme.blue': 'Blue',
298
- 'fabric.theme.dark-blue': 'Dark blue',
299
- 'fabric.theme.dark-green': 'Dark green',
300
- 'fabric.theme.dark-purple': 'Dark purple',
301
- 'fabric.theme.dark-red': 'Dark red',
302
- 'fabric.theme.dark-teal': 'Dark teal',
303
- 'fabric.theme.dark-yellow': 'Dark yellow',
304
- 'fabric.theme.gray': 'Gray',
305
- 'fabric.theme.green': 'Green',
306
- 'fabric.theme.light-blue': 'Light blue',
307
- 'fabric.theme.light-gray': 'Light gray',
308
- 'fabric.theme.light-green': 'Light green',
309
- 'fabric.theme.light-purple': 'Light purple',
310
- 'fabric.theme.light-red': 'Light red',
311
- 'fabric.theme.light-teal': 'Light teal',
312
- 'fabric.theme.light-yellow': 'Light yellow',
313
- 'fabric.theme.orange': 'Orange',
314
- 'fabric.theme.purple': 'Purple',
315
- 'fabric.theme.red': 'Red',
316
- 'fabric.theme.teal': 'Teal',
317
- 'fabric.theme.white': 'White',
318
- 'fabric.theme.yellow': 'Yellow'
296
+ 'fabric.editor.wrapRight': 'Ajustar a la derecha'
319
297
  };