@atlaskit/editor-core 165.0.0 → 166.0.2

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 (244) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/cjs/actions/index.js +9 -0
  3. package/dist/cjs/create-editor/ReactEditorView.js +14 -6
  4. package/dist/cjs/create-editor/create-plugins-list.js +1 -2
  5. package/dist/cjs/editor.js +13 -0
  6. package/dist/cjs/event-dispatcher/index.js +9 -0
  7. package/dist/cjs/nodeviews/ReactNodeView.js +1 -11
  8. package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  9. package/dist/cjs/plugins/analytics/types/enums.js +1 -0
  10. package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +2 -2
  11. package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +128 -79
  12. package/dist/cjs/plugins/base/utils/input-latency-tracking.js +157 -0
  13. package/dist/cjs/plugins/card/styles.js +3 -1
  14. package/dist/cjs/plugins/code-block/styles.js +6 -4
  15. package/dist/cjs/plugins/collab-edit/index.js +2 -2
  16. package/dist/cjs/plugins/collab-edit/plugin-state.js +23 -5
  17. package/dist/cjs/plugins/collab-edit/provider/channel.js +2 -2
  18. package/dist/cjs/plugins/date/styles.js +3 -1
  19. package/dist/cjs/plugins/emoji/index.js +30 -34
  20. package/dist/cjs/plugins/emoji/nodeviews/emoji.js +12 -66
  21. package/dist/cjs/plugins/emoji/styles.js +3 -17
  22. package/dist/cjs/plugins/expand/ui/styles.js +2 -2
  23. package/dist/cjs/plugins/extension/context-panel.js +2 -2
  24. package/dist/cjs/plugins/extension/pm-plugins/main.js +2 -2
  25. package/dist/cjs/plugins/extension/ui/styles.js +3 -1
  26. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
  27. package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +2 -2
  28. package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +1 -9
  29. package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +1 -9
  30. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
  31. package/dist/cjs/plugins/layout/styles.js +3 -1
  32. package/dist/cjs/plugins/list/commands/indent-list.js +5 -1
  33. package/dist/cjs/plugins/list/commands/outdent-list.js +5 -1
  34. package/dist/cjs/plugins/list/transforms.js +11 -3
  35. package/dist/cjs/plugins/macro/actions.js +2 -2
  36. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +2 -2
  37. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
  38. package/dist/cjs/plugins/media/styles.js +3 -1
  39. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
  40. package/dist/cjs/plugins/mentions/index.js +10 -14
  41. package/dist/cjs/plugins/mentions/nodeviews/mention.js +15 -67
  42. package/dist/cjs/plugins/mentions/pm-plugins/main.js +19 -10
  43. package/dist/cjs/plugins/mentions/type-ahead/index.js +7 -2
  44. package/dist/cjs/plugins/panel/styles.js +3 -1
  45. package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
  46. package/dist/cjs/plugins/rule/styles.js +3 -1
  47. package/dist/cjs/plugins/selection/utils.js +39 -23
  48. package/dist/cjs/plugins/table/event-handlers.js +3 -3
  49. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +24 -0
  50. package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
  51. package/dist/cjs/plugins/table/ui/consts.js +6 -4
  52. package/dist/cjs/plugins/tasks-and-decisions/styles.js +3 -1
  53. package/dist/cjs/plugins/text-formatting/utils.js +1 -1
  54. package/dist/cjs/plugins/type-ahead/index.js +6 -2
  55. package/dist/cjs/plugins/unsupported-content/index.js +22 -10
  56. package/dist/cjs/plugins/unsupported-content/styles.js +4 -2
  57. package/dist/cjs/plugins/unsupported-content/unsupported-inline-node-view.js +21 -0
  58. package/dist/cjs/ui/Appearance/Chromeless.js +6 -3
  59. package/dist/cjs/ui/Appearance/Comment/Comment.js +6 -4
  60. package/dist/cjs/ui/ChromeCollapsed/styles.js +3 -1
  61. package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +2 -2
  62. package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +2 -2
  63. package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +2 -2
  64. package/dist/cjs/ui/ConfigPanel/transformers.js +2 -2
  65. package/dist/cjs/ui/ContentStyles/index.js +2 -2
  66. package/dist/cjs/version-wrapper.js +1 -1
  67. package/dist/cjs/version.json +1 -1
  68. package/dist/es2019/actions/index.js +12 -1
  69. package/dist/es2019/create-editor/ReactEditorView.js +14 -6
  70. package/dist/es2019/create-editor/create-plugins-list.js +1 -2
  71. package/dist/es2019/editor.js +14 -0
  72. package/dist/es2019/event-dispatcher/index.js +8 -0
  73. package/dist/es2019/nodeviews/ReactNodeView.js +1 -10
  74. package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +9 -0
  75. package/dist/es2019/plugins/analytics/types/enums.js +1 -0
  76. package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +138 -80
  77. package/dist/es2019/plugins/base/utils/input-latency-tracking.js +128 -0
  78. package/dist/es2019/plugins/card/styles.js +9 -5
  79. package/dist/es2019/plugins/code-block/styles.js +11 -8
  80. package/dist/es2019/plugins/collab-edit/plugin-state.js +23 -8
  81. package/dist/es2019/plugins/date/styles.js +3 -1
  82. package/dist/es2019/plugins/emoji/index.js +16 -21
  83. package/dist/es2019/plugins/emoji/nodeviews/emoji.js +12 -31
  84. package/dist/es2019/plugins/emoji/styles.js +1 -82
  85. package/dist/es2019/plugins/expand/ui/styles.js +2 -2
  86. package/dist/es2019/plugins/extension/ui/styles.js +4 -2
  87. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
  88. package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +1 -8
  89. package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +1 -8
  90. package/dist/es2019/plugins/layout/styles.js +3 -2
  91. package/dist/es2019/plugins/list/commands/indent-list.js +4 -1
  92. package/dist/es2019/plugins/list/commands/outdent-list.js +4 -1
  93. package/dist/es2019/plugins/list/transforms.js +9 -4
  94. package/dist/es2019/plugins/media/styles.js +9 -7
  95. package/dist/es2019/plugins/mentions/index.js +1 -6
  96. package/dist/es2019/plugins/mentions/nodeviews/mention.js +16 -35
  97. package/dist/es2019/plugins/mentions/pm-plugins/main.js +18 -10
  98. package/dist/es2019/plugins/mentions/type-ahead/index.js +7 -2
  99. package/dist/es2019/plugins/panel/styles.js +5 -4
  100. package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
  101. package/dist/es2019/plugins/rule/styles.js +2 -1
  102. package/dist/es2019/plugins/selection/utils.js +35 -20
  103. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +22 -0
  104. package/dist/es2019/plugins/table/ui/common-styles.js +4 -0
  105. package/dist/es2019/plugins/table/ui/consts.js +5 -4
  106. package/dist/es2019/plugins/tasks-and-decisions/styles.js +4 -2
  107. package/dist/es2019/plugins/text-formatting/utils.js +1 -1
  108. package/dist/es2019/plugins/type-ahead/index.js +5 -1
  109. package/dist/es2019/plugins/unsupported-content/index.js +23 -12
  110. package/dist/es2019/plugins/unsupported-content/styles.js +5 -3
  111. package/dist/es2019/plugins/unsupported-content/unsupported-inline-node-view.js +7 -0
  112. package/dist/es2019/ui/Appearance/Chromeless.js +5 -2
  113. package/dist/es2019/ui/Appearance/Comment/Comment.js +5 -2
  114. package/dist/es2019/ui/ChromeCollapsed/styles.js +2 -1
  115. package/dist/es2019/ui/ContentStyles/index.js +3 -3
  116. package/dist/es2019/version-wrapper.js +1 -1
  117. package/dist/es2019/version.json +1 -1
  118. package/dist/esm/actions/index.js +9 -1
  119. package/dist/esm/create-editor/ErrorBoundary.js +1 -1
  120. package/dist/esm/create-editor/ReactEditorView.js +14 -6
  121. package/dist/esm/create-editor/create-plugins-list.js +1 -2
  122. package/dist/esm/editor.js +16 -1
  123. package/dist/esm/event-dispatcher/index.js +9 -0
  124. package/dist/esm/nodeviews/ReactNodeView.js +1 -10
  125. package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  126. package/dist/esm/plugins/analytics/types/enums.js +1 -0
  127. package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +1 -1
  128. package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +128 -79
  129. package/dist/esm/plugins/base/utils/input-latency-tracking.js +149 -0
  130. package/dist/esm/plugins/card/styles.js +2 -1
  131. package/dist/esm/plugins/code-block/styles.js +5 -4
  132. package/dist/esm/plugins/collab-edit/index.js +1 -1
  133. package/dist/esm/plugins/collab-edit/plugin-state.js +21 -6
  134. package/dist/esm/plugins/collab-edit/provider/channel.js +1 -1
  135. package/dist/esm/plugins/custom-autoformat/doc.js +1 -1
  136. package/dist/esm/plugins/custom-autoformat/index.js +1 -1
  137. package/dist/esm/plugins/date/styles.js +2 -1
  138. package/dist/esm/plugins/emoji/index.js +26 -29
  139. package/dist/esm/plugins/emoji/nodeviews/emoji.js +11 -56
  140. package/dist/esm/plugins/emoji/styles.js +3 -14
  141. package/dist/esm/plugins/expand/ui/styles.js +2 -2
  142. package/dist/esm/plugins/extension/actions.js +1 -1
  143. package/dist/esm/plugins/extension/context-panel.js +1 -1
  144. package/dist/esm/plugins/extension/pm-plugins/main.js +1 -1
  145. package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +1 -1
  146. package/dist/esm/plugins/extension/ui/styles.js +2 -1
  147. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
  148. package/dist/esm/plugins/feedback-dialog/index.js +1 -1
  149. package/dist/esm/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +1 -1
  150. package/dist/esm/plugins/find-replace/utils/batch-decorations.js +1 -1
  151. package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -1
  152. package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -1
  153. package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +1 -8
  154. package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +1 -8
  155. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -1
  156. package/dist/esm/plugins/image-upload/pm-plugins/main.js +1 -1
  157. package/dist/esm/plugins/layout/styles.js +2 -1
  158. package/dist/esm/plugins/list/commands/indent-list.js +4 -1
  159. package/dist/esm/plugins/list/commands/outdent-list.js +4 -1
  160. package/dist/esm/plugins/list/transforms.js +9 -4
  161. package/dist/esm/plugins/macro/actions.js +1 -1
  162. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +1 -1
  163. package/dist/esm/plugins/media/nodeviews/mediaInline.js +2 -1
  164. package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +1 -1
  165. package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +1 -1
  166. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
  167. package/dist/esm/plugins/media/picker-facade.js +1 -1
  168. package/dist/esm/plugins/media/pm-plugins/main.js +1 -1
  169. package/dist/esm/plugins/media/styles.js +2 -1
  170. package/dist/esm/plugins/media/toolbar/utils.js +1 -1
  171. package/dist/esm/plugins/media/ui/MediaPicker/PickerFacadeProvider.js +1 -1
  172. package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +1 -1
  173. package/dist/esm/plugins/media/utils/check-media-type.js +1 -1
  174. package/dist/esm/plugins/mentions/index.js +10 -14
  175. package/dist/esm/plugins/mentions/nodeviews/mention.js +13 -58
  176. package/dist/esm/plugins/mentions/pm-plugins/main.js +18 -10
  177. package/dist/esm/plugins/mentions/type-ahead/index.js +7 -2
  178. package/dist/esm/plugins/panel/styles.js +2 -1
  179. package/dist/esm/plugins/paste/handlers.js +1 -1
  180. package/dist/esm/plugins/paste/pm-plugins/main.js +1 -1
  181. package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
  182. package/dist/esm/plugins/quick-insert/index.js +1 -1
  183. package/dist/esm/plugins/rule/styles.js +2 -1
  184. package/dist/esm/plugins/selection/utils.js +35 -20
  185. package/dist/esm/plugins/table/event-handlers.js +3 -3
  186. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +23 -0
  187. package/dist/esm/plugins/table/ui/common-styles.js +1 -1
  188. package/dist/esm/plugins/table/ui/consts.js +5 -4
  189. package/dist/esm/plugins/tasks-and-decisions/styles.js +2 -1
  190. package/dist/esm/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +1 -1
  191. package/dist/esm/plugins/text-formatting/utils.js +1 -1
  192. package/dist/esm/plugins/type-ahead/index.js +6 -2
  193. package/dist/esm/plugins/unsupported-content/index.js +21 -11
  194. package/dist/esm/plugins/unsupported-content/styles.js +3 -2
  195. package/dist/esm/plugins/unsupported-content/unsupported-inline-node-view.js +7 -0
  196. package/dist/esm/ui/Appearance/Chromeless.js +6 -3
  197. package/dist/esm/ui/Appearance/Comment/Comment.js +6 -4
  198. package/dist/esm/ui/ChromeCollapsed/styles.js +2 -1
  199. package/dist/esm/ui/ConfigPanel/ConfigPanel.js +1 -1
  200. package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +1 -1
  201. package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +1 -1
  202. package/dist/esm/ui/ConfigPanel/FormErrorBoundary.js +1 -1
  203. package/dist/esm/ui/ConfigPanel/transformers.js +1 -1
  204. package/dist/esm/ui/ContentStyles/index.js +3 -3
  205. package/dist/esm/ui/LinkSearch/index.js +1 -1
  206. package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
  207. package/dist/esm/utils/action.js +1 -1
  208. package/dist/esm/utils/clipboard.js +1 -1
  209. package/dist/esm/utils/extensions.js +1 -1
  210. package/dist/esm/version-wrapper.js +1 -1
  211. package/dist/esm/version.json +1 -1
  212. package/dist/types/actions/index.d.ts +3 -1
  213. package/dist/types/editor.d.ts +3 -0
  214. package/dist/types/event-dispatcher/index.d.ts +1 -0
  215. package/dist/types/nodeviews/ReactNodeView.d.ts +1 -5
  216. package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
  217. package/dist/types/plugins/analytics/types/events.d.ts +2 -2
  218. package/dist/types/plugins/analytics/types/general-events.d.ts +10 -1
  219. package/dist/types/plugins/base/utils/input-latency-tracking.d.ts +44 -0
  220. package/dist/types/plugins/collab-edit/plugin-state.d.ts +4 -0
  221. package/dist/types/plugins/emoji/index.d.ts +2 -6
  222. package/dist/types/plugins/emoji/nodeviews/emoji.d.ts +4 -14
  223. package/dist/types/plugins/emoji/styles.d.ts +0 -1
  224. package/dist/types/plugins/emoji/types.d.ts +0 -1
  225. package/dist/types/plugins/list/transforms.d.ts +10 -1
  226. package/dist/types/plugins/mentions/nodeviews/mention.d.ts +6 -14
  227. package/dist/types/plugins/mentions/pm-plugins/main.d.ts +2 -5
  228. package/dist/types/plugins/selection/utils.d.ts +7 -15
  229. package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +3 -0
  230. package/dist/types/plugins/table/ui/consts.d.ts +2 -2
  231. package/dist/types/plugins/type-ahead/types.d.ts +1 -0
  232. package/dist/types/plugins/unsupported-content/unsupported-inline-node-view.d.ts +11 -0
  233. package/dist/types/types/editor-appearance-component.d.ts +1 -0
  234. package/dist/types/types/editor-props.d.ts +1 -0
  235. package/dist/types/types/feature-flags.d.ts +0 -14
  236. package/dist/types/ui/Appearance/Chromeless.d.ts +1 -0
  237. package/dist/types/ui/Appearance/Comment/Comment.d.ts +1 -0
  238. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +4 -4
  239. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  240. package/package.json +23 -23
  241. package/dist/cjs/plugins/emoji/nodeviews/emoji-next.js +0 -250
  242. package/dist/es2019/plugins/emoji/nodeviews/emoji-next.js +0 -177
  243. package/dist/esm/plugins/emoji/nodeviews/emoji-next.js +0 -234
  244. package/dist/types/plugins/emoji/nodeviews/emoji-next.d.ts +0 -31
@@ -12,7 +12,7 @@ const safeNumberFeatureFlag = value => {
12
12
 
13
13
 
14
14
  export function createFeatureFlagsFromProps(props) {
15
- var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$collabEdit, _props$collabEdit2, _props$featureFlags37, _props$featureFlags38;
15
+ var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$allowTables, _props$featureFlags3, _props$featureFlags4, _props$allowTables2, _props$featureFlags5, _props$featureFlags6, _props$allowTables3, _props$featureFlags7, _props$featureFlags8, _props$allowTables4, _props$featureFlags9, _props$featureFlags10, _props$allowTables5, _props$allowExtension, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$collabEdit, _props$collabEdit2, _props$featureFlags34, _props$featureFlags35;
16
16
 
17
17
  const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
18
18
  return { ...normalizedFeatureFlags,
@@ -28,29 +28,27 @@ export function createFeatureFlagsFromProps(props) {
28
28
  singleLayout: typeof props.allowLayouts === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
29
29
  undoRedoButtons: props.UNSAFE_allowUndoRedoButtons,
30
30
  catchAllTracking: (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : (_props$performanceTra2 = _props$performanceTra.catchAllTracking) === null || _props$performanceTra2 === void 0 ? void 0 : _props$performanceTra2.enabled,
31
- nextEmojiNodeView: ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.nextEmojiNodeView) === true,
32
- stickyHeadersOptimization: typeof ((_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.stickyHeadersOptimization) === 'boolean' ? !!((_props$featureFlags3 = props.featureFlags) !== null && _props$featureFlags3 !== void 0 && _props$featureFlags3.stickyHeadersOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables = props.allowTables) !== null && _props$allowTables !== void 0 && _props$allowTables.stickyHeadersOptimization),
33
- initialRenderOptimization: typeof ((_props$featureFlags4 = props.featureFlags) === null || _props$featureFlags4 === void 0 ? void 0 : _props$featureFlags4.initialRenderOptimization) === 'boolean' ? !!((_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.initialRenderOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables2 = props.allowTables) !== null && _props$allowTables2 !== void 0 && _props$allowTables2.initialRenderOptimization),
34
- mouseMoveOptimization: typeof ((_props$featureFlags6 = props.featureFlags) === null || _props$featureFlags6 === void 0 ? void 0 : _props$featureFlags6.mouseMoveOptimization) === 'boolean' ? !!((_props$featureFlags7 = props.featureFlags) !== null && _props$featureFlags7 !== void 0 && _props$featureFlags7.mouseMoveOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables3 = props.allowTables) !== null && _props$allowTables3 !== void 0 && _props$allowTables3.mouseMoveOptimization),
35
- tableRenderOptimization: typeof ((_props$featureFlags8 = props.featureFlags) === null || _props$featureFlags8 === void 0 ? void 0 : _props$featureFlags8.tableRenderOptimization) === 'boolean' ? !!((_props$featureFlags9 = props.featureFlags) !== null && _props$featureFlags9 !== void 0 && _props$featureFlags9.tableRenderOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables4 = props.allowTables) !== null && _props$allowTables4 !== void 0 && _props$allowTables4.tableRenderOptimization),
36
- tableOverflowShadowsOptimization: typeof ((_props$featureFlags10 = props.featureFlags) === null || _props$featureFlags10 === void 0 ? void 0 : _props$featureFlags10.tableOverflowShadowsOptimization) === 'boolean' ? !!((_props$featureFlags11 = props.featureFlags) !== null && _props$featureFlags11 !== void 0 && _props$featureFlags11.tableOverflowShadowsOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables5 = props.allowTables) !== null && _props$allowTables5 !== void 0 && _props$allowTables5.tableOverflowShadowsOptimization),
31
+ stickyHeadersOptimization: typeof ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.stickyHeadersOptimization) === 'boolean' ? !!((_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.stickyHeadersOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables = props.allowTables) !== null && _props$allowTables !== void 0 && _props$allowTables.stickyHeadersOptimization),
32
+ initialRenderOptimization: typeof ((_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.initialRenderOptimization) === 'boolean' ? !!((_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.initialRenderOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables2 = props.allowTables) !== null && _props$allowTables2 !== void 0 && _props$allowTables2.initialRenderOptimization),
33
+ mouseMoveOptimization: typeof ((_props$featureFlags5 = props.featureFlags) === null || _props$featureFlags5 === void 0 ? void 0 : _props$featureFlags5.mouseMoveOptimization) === 'boolean' ? !!((_props$featureFlags6 = props.featureFlags) !== null && _props$featureFlags6 !== void 0 && _props$featureFlags6.mouseMoveOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables3 = props.allowTables) !== null && _props$allowTables3 !== void 0 && _props$allowTables3.mouseMoveOptimization),
34
+ tableRenderOptimization: typeof ((_props$featureFlags7 = props.featureFlags) === null || _props$featureFlags7 === void 0 ? void 0 : _props$featureFlags7.tableRenderOptimization) === 'boolean' ? !!((_props$featureFlags8 = props.featureFlags) !== null && _props$featureFlags8 !== void 0 && _props$featureFlags8.tableRenderOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables4 = props.allowTables) !== null && _props$allowTables4 !== void 0 && _props$allowTables4.tableRenderOptimization),
35
+ tableOverflowShadowsOptimization: typeof ((_props$featureFlags9 = props.featureFlags) === null || _props$featureFlags9 === void 0 ? void 0 : _props$featureFlags9.tableOverflowShadowsOptimization) === 'boolean' ? !!((_props$featureFlags10 = props.featureFlags) !== null && _props$featureFlags10 !== void 0 && _props$featureFlags10.tableOverflowShadowsOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables5 = props.allowTables) !== null && _props$allowTables5 !== void 0 && _props$allowTables5.tableOverflowShadowsOptimization),
37
36
  extendFloatingToolbar: Boolean(typeof props.allowExtension === 'object' && ((_props$allowExtension = props.allowExtension) === null || _props$allowExtension === void 0 ? void 0 : _props$allowExtension.allowExtendFloatingToolbars)),
38
- displayInlineBlockForInlineNodes: Boolean(typeof ((_props$featureFlags12 = props.featureFlags) === null || _props$featureFlags12 === void 0 ? void 0 : _props$featureFlags12.displayInlineBlockForInlineNodes) === 'boolean' ? !!((_props$featureFlags13 = props.featureFlags) !== null && _props$featureFlags13 !== void 0 && _props$featureFlags13.displayInlineBlockForInlineNodes) : false),
39
- useUnpredictableInputRule: Boolean(typeof ((_props$featureFlags14 = props.featureFlags) === null || _props$featureFlags14 === void 0 ? void 0 : _props$featureFlags14.useUnpredictableInputRule) === 'boolean' ? !!((_props$featureFlags15 = props.featureFlags) !== null && _props$featureFlags15 !== void 0 && _props$featureFlags15.useUnpredictableInputRule) : props.UNSAFE_allowUndoRedoButtons ? false : true),
40
- showAvatarGroupAsPlugin: Boolean(typeof ((_props$featureFlags16 = props.featureFlags) === null || _props$featureFlags16 === void 0 ? void 0 : _props$featureFlags16.showAvatarGroupAsPlugin) === 'boolean' ? !!((_props$featureFlags17 = props.featureFlags) !== null && _props$featureFlags17 !== void 0 && _props$featureFlags17.showAvatarGroupAsPlugin) : false),
41
- errorBoundaryDocStructure: Boolean(typeof ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.useErrorBoundaryDocStructure) === 'boolean' ? !!((_props$featureFlags19 = props.featureFlags) !== null && _props$featureFlags19 !== void 0 && _props$featureFlags19.useErrorBoundaryDocStructure) : false),
42
- synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.synchronyErrorDocStructure) : false),
43
- enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.enableViewUpdateSubscription) : false),
44
- plainTextPasteLinkification: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.plainTextPasteLinkification) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.plainTextPasteLinkification) : false),
45
- collabAvatarScroll: Boolean(typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.collabAvatarScroll) : false),
46
- ufo: Boolean(typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.ufo) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.ufo) : false),
37
+ useUnpredictableInputRule: Boolean(typeof ((_props$featureFlags11 = props.featureFlags) === null || _props$featureFlags11 === void 0 ? void 0 : _props$featureFlags11.useUnpredictableInputRule) === 'boolean' ? !!((_props$featureFlags12 = props.featureFlags) !== null && _props$featureFlags12 !== void 0 && _props$featureFlags12.useUnpredictableInputRule) : props.UNSAFE_allowUndoRedoButtons ? false : true),
38
+ showAvatarGroupAsPlugin: Boolean(typeof ((_props$featureFlags13 = props.featureFlags) === null || _props$featureFlags13 === void 0 ? void 0 : _props$featureFlags13.showAvatarGroupAsPlugin) === 'boolean' ? !!((_props$featureFlags14 = props.featureFlags) !== null && _props$featureFlags14 !== void 0 && _props$featureFlags14.showAvatarGroupAsPlugin) : false),
39
+ errorBoundaryDocStructure: Boolean(typeof ((_props$featureFlags15 = props.featureFlags) === null || _props$featureFlags15 === void 0 ? void 0 : _props$featureFlags15.useErrorBoundaryDocStructure) === 'boolean' ? !!((_props$featureFlags16 = props.featureFlags) !== null && _props$featureFlags16 !== void 0 && _props$featureFlags16.useErrorBoundaryDocStructure) : false),
40
+ synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags17 = props.featureFlags) === null || _props$featureFlags17 === void 0 ? void 0 : _props$featureFlags17.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags18 = props.featureFlags) !== null && _props$featureFlags18 !== void 0 && _props$featureFlags18.synchronyErrorDocStructure) : false),
41
+ enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags19 = props.featureFlags) === null || _props$featureFlags19 === void 0 ? void 0 : _props$featureFlags19.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags20 = props.featureFlags) !== null && _props$featureFlags20 !== void 0 && _props$featureFlags20.enableViewUpdateSubscription) : false),
42
+ plainTextPasteLinkification: Boolean(typeof ((_props$featureFlags21 = props.featureFlags) === null || _props$featureFlags21 === void 0 ? void 0 : _props$featureFlags21.plainTextPasteLinkification) === 'boolean' ? !!((_props$featureFlags22 = props.featureFlags) !== null && _props$featureFlags22 !== void 0 && _props$featureFlags22.plainTextPasteLinkification) : false),
43
+ collabAvatarScroll: Boolean(typeof ((_props$featureFlags23 = props.featureFlags) === null || _props$featureFlags23 === void 0 ? void 0 : _props$featureFlags23.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags24 = props.featureFlags) !== null && _props$featureFlags24 !== void 0 && _props$featureFlags24.collabAvatarScroll) : false),
44
+ ufo: Boolean(typeof ((_props$featureFlags25 = props.featureFlags) === null || _props$featureFlags25 === void 0 ? void 0 : _props$featureFlags25.ufo) === 'boolean' ? !!((_props$featureFlags26 = props.featureFlags) !== null && _props$featureFlags26 !== void 0 && _props$featureFlags26.ufo) : false),
47
45
  codeBlockSyntaxHighlighting: Boolean(typeof normalizedFeatureFlags.codeBlockSyntaxHighlighting === 'boolean' ? !!normalizedFeatureFlags.codeBlockSyntaxHighlighting && !browser.safari : false),
48
- twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags31 = props.featureFlags) !== null && _props$featureFlags31 !== void 0 && _props$featureFlags31.twoLineEditorToolbar) : false),
49
- codeBidiWarnings: Boolean(typeof ((_props$featureFlags32 = props.featureFlags) === null || _props$featureFlags32 === void 0 ? void 0 : _props$featureFlags32.codeBidiWarnings) === 'boolean' ? !!((_props$featureFlags33 = props.featureFlags) !== null && _props$featureFlags33 !== void 0 && _props$featureFlags33.codeBidiWarnings) : true),
50
- saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags34 = props.featureFlags) === null || _props$featureFlags34 === void 0 ? void 0 : _props$featureFlags34.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags35 = props.featureFlags) !== null && _props$featureFlags35 !== void 0 && _props$featureFlags35.saferDispatchedTransactions) : false)),
51
- maxUnsafeChromeSpellcheckingVersion: safeNumberFeatureFlag((_props$featureFlags36 = props.featureFlags) === null || _props$featureFlags36 === void 0 ? void 0 : _props$featureFlags36.maxUnsafeChromeSpellcheckingVersion),
46
+ twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags27 = props.featureFlags) === null || _props$featureFlags27 === void 0 ? void 0 : _props$featureFlags27.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags28 = props.featureFlags) !== null && _props$featureFlags28 !== void 0 && _props$featureFlags28.twoLineEditorToolbar) : false),
47
+ codeBidiWarnings: Boolean(typeof ((_props$featureFlags29 = props.featureFlags) === null || _props$featureFlags29 === void 0 ? void 0 : _props$featureFlags29.codeBidiWarnings) === 'boolean' ? !!((_props$featureFlags30 = props.featureFlags) !== null && _props$featureFlags30 !== void 0 && _props$featureFlags30.codeBidiWarnings) : true),
48
+ saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags31 = props.featureFlags) === null || _props$featureFlags31 === void 0 ? void 0 : _props$featureFlags31.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags32 = props.featureFlags) !== null && _props$featureFlags32 !== void 0 && _props$featureFlags32.saferDispatchedTransactions) : false)),
49
+ maxUnsafeChromeSpellcheckingVersion: safeNumberFeatureFlag((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.maxUnsafeChromeSpellcheckingVersion),
52
50
  useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
53
- chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
54
- viewChangingExperimentToolbarStyle: typeof ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38['view-changing-experiment-toolbar-style']) === 'string' ? props.featureFlags['view-changing-experiment-toolbar-style'] || undefined : undefined
51
+ chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags34 = props.featureFlags) === null || _props$featureFlags34 === void 0 ? void 0 : _props$featureFlags34.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
52
+ viewChangingExperimentToolbarStyle: typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35['view-changing-experiment-toolbar-style']) === 'string' ? props.featureFlags['view-changing-experiment-toolbar-style'] || undefined : undefined
55
53
  };
56
54
  }
@@ -1,6 +1,5 @@
1
1
  import { createRule, createPlugin } from '../../../utils/input-rules';
2
2
  import { LinkMatcher, normalizeUrl } from '../utils';
3
- import { queueCards } from '../../card/pm-plugins/actions';
4
3
  import { INPUT_METHOD, addAnalytics } from '../../analytics';
5
4
  import { getLinkCreationAnalyticsEvent } from '../analytics';
6
5
  export function createLinkInputRule(regexp, skipAnalytics = false, useUnpredictableInputRule = true) {
@@ -21,13 +20,7 @@ export function createLinkInputRule(regexp, skipAnalytics = false, useUnpredicta
21
20
  });
22
21
  const from = start;
23
22
  const to = Math.min(start + link.text.length, state.doc.content.size);
24
- const tr = queueCards([{
25
- url: link.url,
26
- pos: from,
27
- appearance: 'inline',
28
- compareLinkText: true,
29
- source: INPUT_METHOD.AUTO_DETECT
30
- }])(state.tr.addMark(from, to, markType)); // Keep old behavior that will delete the space after the link
23
+ const tr = state.tr.addMark(from, to, markType); // Keep old behavior that will delete the space after the link
31
24
 
32
25
  if (useUnpredictableInputRule || to === end) {
33
26
  tr.insertText(' ');
@@ -3,7 +3,6 @@ import { getLinkMatch } from '@atlaskit/adf-schema';
3
3
  import * as keymaps from '../../../keymaps';
4
4
  import { stateKey } from '../pm-plugins/main';
5
5
  import { showLinkToolbar, hideLinkToolbar } from '../commands';
6
- import { queueCards } from '../../card/pm-plugins/actions';
7
6
  import { INPUT_METHOD, addAnalytics } from '../../analytics';
8
7
  import { getLinkCreationAnalyticsEvent } from '../analytics';
9
8
  export function createKeymapPlugin(skipAnalytics = false) {
@@ -54,13 +53,7 @@ const mayConvertLastWordToHyperlink = skipAnalytics => {
54
53
  const markType = state.schema.mark('link', {
55
54
  href: url
56
55
  });
57
- const tr = queueCards([{
58
- url,
59
- pos: start,
60
- appearance: 'inline',
61
- compareLinkText: true,
62
- source: INPUT_METHOD.AUTO_DETECT
63
- }])(state.tr.addMark(start, end, markType));
56
+ const tr = state.tr.addMark(start, end, markType);
64
57
 
65
58
  if (dispatch) {
66
59
  if (skipAnalytics) {
@@ -3,6 +3,7 @@ import { gridSize } from '@atlaskit/theme/constants';
3
3
  import { N40A, N50A } from '@atlaskit/theme/colors';
4
4
  import { columnLayoutSharedStyle } from '@atlaskit/editor-common/styles';
5
5
  import { gridMediumMaxWidth, akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akLayoutGutterOffset, akEditorSwoopCubicBezier, SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
6
+ import { token } from '@atlaskit/tokens';
6
7
  import { TableCssClassName } from '../table/types';
7
8
  import { tableMarginFullWidthMode } from '../table/ui/consts';
8
9
  export const LAYOUT_SECTION_MARGIN = gridSize();
@@ -91,8 +92,8 @@ export const layoutStyles = css`
91
92
  }
92
93
 
93
94
  &.selected.danger > [data-layout-column] {
94
- background-color: ${akEditorDeleteBackground};
95
- border-color: ${akEditorDeleteBorder};
95
+ background-color: ${token('color.background.danger', akEditorDeleteBackground)};
96
+ border-color: ${token('color.border.danger', akEditorDeleteBorder)};
96
97
  }
97
98
 
98
99
  &.${akEditorSelectedNodeClassName}:not(.danger) {
@@ -6,6 +6,7 @@ import { findFirstParentListNode } from '../utils/find';
6
6
  import { MAX_NESTED_LIST_INDENTATION } from '../types';
7
7
  import { isInsideListItem, isInsideTableCell, getListItemAttributes } from '../utils/selection';
8
8
  import { getCommonListAnalyticsAttributes } from '../utils/analytics';
9
+ import { closeHistory } from 'prosemirror-history';
9
10
  export function indentList(inputMethod = INPUT_METHOD.KEYBOARD) {
10
11
  return function (state, dispatch) {
11
12
  const {
@@ -17,8 +18,10 @@ export function indentList(inputMethod = INPUT_METHOD.KEYBOARD) {
17
18
 
18
19
  if (!isInsideListItem(state)) {
19
20
  return false;
20
- }
21
+ } // Save the history, so it could undo/revert to the same state before the indent, see https://product-fabric.atlassian.net/browse/ED-14753
22
+
21
23
 
24
+ closeHistory(tr);
22
25
  const firstListItemSelectedAttributes = getListItemAttributes($from);
23
26
  const parentListNode = findFirstParentListNode($from);
24
27
 
@@ -4,6 +4,7 @@ import { isBulletList } from '../utils/node';
4
4
  import { findFirstParentListNode } from '../utils/find';
5
5
  import { getCommonListAnalyticsAttributes } from '../utils/analytics';
6
6
  import { outdentListItemsSelected as outdentListAction } from '../actions/outdent-list-items-selected';
7
+ import { closeHistory } from 'prosemirror-history';
7
8
  export function outdentList(inputMethod = INPUT_METHOD.KEYBOARD) {
8
9
  return function (state, dispatch) {
9
10
  if (!isInsideListItem(state)) {
@@ -18,8 +19,10 @@ export function outdentList(inputMethod = INPUT_METHOD.KEYBOARD) {
18
19
  if (!parentListNode) {
19
20
  // Even though this is a non-operation, we don't want to send this event to the browser. Because if we return false, the browser will move the focus to another place
20
21
  return true;
21
- }
22
+ } // Save the history, so it could undo/revert to the same state before the outdent, see https://product-fabric.atlassian.net/browse/ED-14753
23
+
22
24
 
25
+ closeHistory(state.tr);
23
26
  const actionSubjectId = isBulletList(parentListNode.node) ? ACTION_SUBJECT_ID.FORMAT_LIST_BULLET : ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
24
27
  let customTr = state.tr;
25
28
  outdentListAction(customTr);
@@ -227,7 +227,7 @@ const extractListFromParagraph = (node, parent, schema) => {
227
227
  */
228
228
 
229
229
 
230
- const splitIntoParagraphs = ({
230
+ export const splitIntoParagraphs = ({
231
231
  fragment,
232
232
  blockMarks = [],
233
233
  schema
@@ -239,8 +239,14 @@ const splitIntoParagraphs = ({
239
239
  hardBreak,
240
240
  paragraph
241
241
  } = schema.nodes;
242
- fragment.forEach(node => {
243
- if (lastNode && lastNode.type === hardBreak && node.type === hardBreak) {
242
+ fragment.forEach((node, i) => {
243
+ // ED-14725 Fixed the issue that it make duplicated line
244
+ // when pasting <br /> from google docs.
245
+ if (i === 0 && node.type === hardBreak) {
246
+ paragraphs.push(paragraph.createChecked(undefined, curChildren, [...blockMarks]));
247
+ lastNode = node;
248
+ return;
249
+ } else if (lastNode && lastNode.type === hardBreak && node.type === hardBreak) {
244
250
  // double hardbreak
245
251
  // backtrack a little; remove the trailing hardbreak we added last loop
246
252
  curChildren.pop(); // create a new paragraph
@@ -261,7 +267,6 @@ const splitIntoParagraphs = ({
261
267
 
262
268
  return Fragment.from(paragraphs.length ? paragraphs : [paragraph.createAndFill(undefined, undefined, [...blockMarks])]);
263
269
  };
264
-
265
270
  export const splitParagraphs = (slice, schema) => {
266
271
  // exclude Text nodes with a code mark, since we transform those later
267
272
  // into a codeblock
@@ -3,6 +3,7 @@ import { mediaSingleSharedStyle, richMediaClassName } from '@atlaskit/editor-com
3
3
  import { akEditorDeleteBorder, akEditorDeleteBackground, akEditorSelectedBorderBoldSize, akEditorMediaResizeHandlerPaddingWide, akEditorMediaResizeHandlerPadding, akEditorSelectedNodeClassName, akEditorDeleteIconColor } from '@atlaskit/editor-shared-styles';
4
4
  import { N60, B200 } from '@atlaskit/theme/colors';
5
5
  import { fileCardImageViewSelector, fileCardImageViewSelectedSelector, inlinePlayerClassName, newFileExperienceClassName } from '@atlaskit/media-card';
6
+ import { token } from '@atlaskit/tokens';
6
7
  export const mediaStyles = css`
7
8
  .ProseMirror {
8
9
  ${mediaSingleSharedStyle} & [layout='full-width'] .${richMediaClassName},
@@ -115,35 +116,36 @@ export const mediaStyles = css`
115
116
  /* Danger when top level node for smart cards / inline links */
116
117
  .danger > div > div > .media-card-frame,
117
118
  .danger > span > a {
118
- background-color: ${akEditorDeleteBackground};
119
+ background-color: ${token('color.background.danger', akEditorDeleteBackground)};
119
120
  box-shadow: 0px 0px 0px ${akEditorSelectedBorderBoldSize}px
120
- ${akEditorDeleteBorder};
121
+ ${token('color.border.danger', akEditorDeleteBorder)};
121
122
  transition: background-color 0s, box-shadow 0s;
122
123
  }
123
124
  .mediaGroupView-content-wrap.danger {
124
125
  /* Media inline */
125
126
  .${fileCardImageViewSelectedSelector}::after {
126
- border: 1px solid ${akEditorDeleteIconColor};
127
+ border: 1px solid ${token('color.border.danger', akEditorDeleteIconColor)};
127
128
  }
128
129
  }
129
130
  /* Danger when nested node or common */
130
131
  .danger {
131
132
  /* Media single */
132
133
  .${richMediaClassName} .${fileCardImageViewSelector}::after {
133
- border: 1px solid ${akEditorDeleteIconColor};
134
+ border: 1px solid ${token('color.border.danger', akEditorDeleteIconColor)};
134
135
  }
135
136
  /* Media single video player */
136
137
  .${richMediaClassName} .${inlinePlayerClassName}::after {
137
- border: 1px solid ${akEditorDeleteIconColor};
138
+ border: 1px solid ${token('color.border.danger', akEditorDeleteIconColor)};
138
139
  }
139
140
  /* New file experience */
140
141
  .${richMediaClassName} .${newFileExperienceClassName} {
141
- box-shadow: 0 0 0 1px ${akEditorDeleteIconColor} !important;
142
+ box-shadow: 0 0 0 1px
143
+ ${token('color.border.danger', akEditorDeleteIconColor)} !important;
142
144
  }
143
145
  /* Media resize handlers */
144
146
  .richMedia-resize-handle-right::after,
145
147
  .richMedia-resize-handle-left::after {
146
- background: ${akEditorDeleteIconColor};
148
+ background: ${token('color.icon.danger', akEditorDeleteIconColor)};
147
149
  }
148
150
 
149
151
  /* Smart cards */
@@ -52,12 +52,7 @@ const mentionsPlugin = options => {
52
52
  pmPlugins() {
53
53
  return [{
54
54
  name: 'mention',
55
- plugin: ({
56
- providerFactory,
57
- dispatch,
58
- portalProviderAPI,
59
- eventDispatcher
60
- }) => createMentionPlugin(dispatch, providerFactory, portalProviderAPI, eventDispatcher, fireEvent, options)
55
+ plugin: pmPluginFactoryParams => createMentionPlugin(pmPluginFactoryParams, fireEvent, options)
61
56
  }];
62
57
  },
63
58
 
@@ -1,37 +1,18 @@
1
1
  import React from 'react';
2
- import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
3
2
  import Mention from '../ui/Mention';
4
- import { ReactNodeView } from '../../../nodeviews';
5
- export class MentionNodeView extends ReactNodeView {
6
- createDomRef() {
7
- return super.createDomRef();
8
- }
9
-
10
- render(props) {
11
- const {
12
- providerFactory,
13
- options
14
- } = props;
15
- const {
16
- id,
17
- text,
18
- accessLevel
19
- } = this.node.attrs;
20
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Mention, {
21
- id: id,
22
- text: text,
23
- accessLevel: accessLevel,
24
- providers: providerFactory
25
- }), options && options.allowZeroWidthSpaceAfter && ZERO_WIDTH_SPACE);
26
- }
27
-
28
- }
29
- export default function mentionNodeView(portalProviderAPI, eventDispatcher, providerFactory, options) {
30
- return (node, view, getPos) => {
31
- const hasIntlContext = true;
32
- return new MentionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
33
- providerFactory,
34
- options
35
- }, undefined, undefined, undefined, hasIntlContext).init();
36
- };
37
- }
3
+ export const MentionNodeView = props => {
4
+ const {
5
+ providerFactory
6
+ } = props;
7
+ const {
8
+ id,
9
+ text,
10
+ accessLevel
11
+ } = props.node.attrs;
12
+ return /*#__PURE__*/React.createElement(Mention, {
13
+ id: id,
14
+ text: text,
15
+ accessLevel: accessLevel,
16
+ providers: providerFactory
17
+ });
18
+ };
@@ -1,6 +1,7 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { SLI_EVENT_TYPE, SMART_EVENT_TYPE, buildSliPayload } from '@atlaskit/mention/resource';
3
- import mentionNodeView from '../nodeviews/mention';
3
+ import { getInlineNodeViewProducer } from '../../../nodeviews/getInlineNodeViewProducer';
4
+ import { MentionNodeView } from '../nodeviews/mention';
4
5
  import { mentionPluginKey } from './key';
5
6
  const ACTIONS = {
6
7
  SET_PROVIDER: 'SET_PROVIDER',
@@ -32,7 +33,7 @@ export const setContext = context => (state, dispatch) => {
32
33
 
33
34
  return true;
34
35
  };
35
- export function createMentionPlugin(dispatch, providerFactory, portalProviderAPI, eventDispatcher, fireEvent, options) {
36
+ export function createMentionPlugin(pmPluginFactoryParams, fireEvent, options) {
36
37
  let mentionProvider;
37
38
 
38
39
  const sendAnalytics = (event, actionSubject, action, attributes) => {
@@ -63,14 +64,14 @@ export function createMentionPlugin(dispatch, providerFactory, portalProviderAPI
63
64
  newPluginState = { ...pluginState,
64
65
  mentionProvider: params.provider
65
66
  };
66
- dispatch(mentionPluginKey, newPluginState);
67
+ pmPluginFactoryParams.dispatch(mentionPluginKey, newPluginState);
67
68
  return newPluginState;
68
69
 
69
70
  case ACTIONS.SET_CONTEXT:
70
71
  newPluginState = { ...pluginState,
71
72
  contextIdentifierProvider: params.context
72
73
  };
73
- dispatch(mentionPluginKey, newPluginState);
74
+ pmPluginFactoryParams.dispatch(mentionPluginKey, newPluginState);
74
75
  return newPluginState;
75
76
  }
76
77
 
@@ -80,7 +81,14 @@ export function createMentionPlugin(dispatch, providerFactory, portalProviderAPI
80
81
  },
81
82
  props: {
82
83
  nodeViews: {
83
- mention: mentionNodeView(portalProviderAPI, eventDispatcher, providerFactory, options)
84
+ mention: getInlineNodeViewProducer({
85
+ pmPluginFactoryParams,
86
+ Component: MentionNodeView,
87
+ extraComponentProps: {
88
+ providerFactory: pmPluginFactoryParams.providerFactory,
89
+ options
90
+ }
91
+ })
84
92
  }
85
93
  },
86
94
 
@@ -117,13 +125,13 @@ export function createMentionPlugin(dispatch, providerFactory, portalProviderAPI
117
125
  return;
118
126
  };
119
127
 
120
- providerFactory.subscribe('mentionProvider', providerHandler);
121
- providerFactory.subscribe('contextIdentifierProvider', providerHandler);
128
+ pmPluginFactoryParams.providerFactory.subscribe('mentionProvider', providerHandler);
129
+ pmPluginFactoryParams.providerFactory.subscribe('contextIdentifierProvider', providerHandler);
122
130
  return {
123
131
  destroy() {
124
- if (providerFactory) {
125
- providerFactory.unsubscribe('mentionProvider', providerHandler);
126
- providerFactory.unsubscribe('contextIdentifierProvider', providerHandler);
132
+ if (pmPluginFactoryParams.providerFactory) {
133
+ pmPluginFactoryParams.providerFactory.unsubscribe('mentionProvider', providerHandler);
134
+ pmPluginFactoryParams.providerFactory.unsubscribe('contextIdentifierProvider', providerHandler);
127
135
  }
128
136
 
129
137
  if (mentionProvider) {
@@ -364,11 +364,16 @@ export const createTypeAheadConfig = ({
364
364
  dismiss({
365
365
  editorState,
366
366
  query,
367
- stats
367
+ stats,
368
+ wasItemInserted
368
369
  }) {
369
370
  firstQueryWithoutResults = null;
370
371
  const pickerElapsedTime = stats.startedAt ? Date.now() - stats.startedAt : 0;
371
- fireEvent(buildTypeAheadCancelPayload(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, query || ''));
372
+
373
+ if (!wasItemInserted) {
374
+ fireEvent(buildTypeAheadCancelPayload(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, query || ''));
375
+ }
376
+
372
377
  const pluginState = getMentionPluginState(editorState);
373
378
 
374
379
  if (pluginState !== null && pluginState !== void 0 && pluginState.mentionProvider) {
@@ -1,6 +1,7 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { panelSharedStyles, PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
3
3
  import { SelectionStyle, getSelectionStyles, akEditorDeleteBackground, akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorDeleteIconColor, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
4
+ import { token } from '@atlaskit/tokens';
4
5
  export const panelStyles = props => css`
5
6
  .ProseMirror {
6
7
  .${PanelSharedCssClassName.prefix} {
@@ -10,10 +11,10 @@ export const panelStyles = props => css`
10
11
  &.danger {
11
12
  box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px
12
13
  ${akEditorDeleteBorder};
13
- background-color: ${akEditorDeleteBackground} !important;
14
+ background-color: ${token('color.background.danger', akEditorDeleteBackground)} !important;
14
15
 
15
16
  .${PanelSharedCssClassName.icon} {
16
- color: ${akEditorDeleteIconColor} !important;
17
+ color: ${token('color.icon.danger', akEditorDeleteIconColor)} !important;
17
18
  }
18
19
  }
19
20
  }
@@ -25,10 +26,10 @@ export const panelStyles = props => css`
25
26
  /* Danger when nested node */
26
27
  .danger .${PanelSharedCssClassName.prefix} {
27
28
  &[data-panel-type] {
28
- background-color: ${akEditorDeleteBackgroundWithOpacity};
29
+ background-color: ${token('color.blanket.danger', akEditorDeleteBackgroundWithOpacity)};
29
30
 
30
31
  .${PanelSharedCssClassName.icon} {
31
- color: ${akEditorDeleteIconColor};
32
+ color: ${token('color.icon.danger', akEditorDeleteIconColor)};
32
33
  }
33
34
  }
34
35
  }
@@ -3,7 +3,9 @@ import { browser, ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
3
3
 
4
4
  const serializePlaceholderNode = node => {
5
5
  const element = document.createElement('span');
6
- element.classList.add('pm-placeholder');
6
+ element.classList.add('pm-placeholder'); // the inline node api test suite requires the following class name
7
+
8
+ element.classList.add('placeholderView-content-wrap');
7
9
 
8
10
  if (browser.gecko) {
9
11
  element.setAttribute('contenteditable', 'true');
@@ -1,6 +1,7 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { ruleSharedStyles } from '@atlaskit/editor-common/styles';
3
3
  import { akEditorLineHeight, akEditorSelectedBorderColor, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
4
+ import { token } from '@atlaskit/tokens';
4
5
  export const ruleStyles = props => css`
5
6
  .ProseMirror {
6
7
  ${ruleSharedStyles(props)};
@@ -13,7 +14,7 @@ export const ruleStyles = props => css`
13
14
 
14
15
  &.${akEditorSelectedNodeClassName} {
15
16
  outline: none;
16
- background-color: ${akEditorSelectedBorderColor};
17
+ background-color: ${token('color.border.selected', akEditorSelectedBorderColor)};
17
18
  }
18
19
  }
19
20
  }
@@ -39,7 +39,7 @@ export const getDecorations = tr => {
39
39
  }
40
40
 
41
41
  if (tr.selection instanceof TextSelection || tr.selection instanceof AllSelection) {
42
- const decorations = getTopLevelNodesFromSelection(tr.selection, tr.doc).map(({
42
+ const decorations = getNodesToDecorateFromSelection(tr.selection, tr.doc).map(({
43
43
  node,
44
44
  pos
45
45
  }) => {
@@ -92,24 +92,17 @@ export function getCellSelectionAnalyticsPayload(state) {
92
92
  };
93
93
  }
94
94
  }
95
+ const topLevelBlockNodesThatHaveSelectionStyles = ['table', 'panel', 'expand', 'layoutSection', 'decisionList', 'decisionItem', 'codeBlock'];
95
96
  /**
96
- * Use `getTopLevelNodesFromSelection` to collect and return
97
- * a list of only the outermost nodes of the given/passed `Selection`. This
98
- * function will ignore `paragraph` and `text` node types when collecting
99
- * top-level nodes. It will also ignore any top-level nodes that don't
100
- * completely sit within the given `Selection`.
101
- *
102
- * For example, using the following document:
103
- * ```
104
- * doc(p('{<}one'), blockquote(p('hello')), p(expand({ title: 'two' })(p('three'))), p('four{>}'))))
105
- * ```
106
- * we would expect `getTopLevelNodesFromSelection` to return:
107
- * ```
108
- * [blockquote(p('hello')), expand({ title: 'two' })(p('three')))]
109
- * ```
97
+ * Use `getNodesToDecorateFromSelection` to collect and return
98
+ * a list of nodes within the Selection that should have Selection
99
+ * decorations applied. This allows selection styles to be added to
100
+ * nested nodes. It will ignore text nodes as decorations are
101
+ * applied natively and also ignore nodes that don't completely
102
+ * sit within the given `Selection`.
110
103
  */
111
104
 
112
- export const getTopLevelNodesFromSelection = (selection, doc) => {
105
+ export const getNodesToDecorateFromSelection = (selection, doc) => {
113
106
  const nodes = [];
114
107
 
115
108
  if (selection.from !== selection.to) {
@@ -118,14 +111,36 @@ export const getTopLevelNodesFromSelection = (selection, doc) => {
118
111
  to
119
112
  } = selection;
120
113
  doc.nodesBetween(from, to, (node, pos) => {
121
- const withinSelection = from <= pos && pos + node.nodeSize <= to;
122
-
123
- if (node && node.type.name !== 'paragraph' && !node.isText && withinSelection) {
114
+ const withinSelection = from <= pos && pos + node.nodeSize <= to; // The reason we need to check for these nodes is to stop
115
+ // traversing their children if they are within a selection -
116
+ // this is to prevent selection styles from being added to
117
+ // the children as well as the parent node.
118
+ // Example scenario is if an entire table has been selected
119
+ // we should not traverse its children so we can apply the
120
+ // selection styles to the table. But if an entire tableRow
121
+ // has been selected (but the parent table has not) we should
122
+ // traverse it as it could contain other nodes that need
123
+ // selection styles. I couldn’t see a clear way to differentiate
124
+ // without explicitly stating which nodes should be traversed
125
+ // and which shouldn’t.
126
+
127
+ const isTopLevelNodeThatHasSelectionStyles = topLevelBlockNodesThatHaveSelectionStyles.includes(node.type.name); // If the node is a top-level block node and completely sits within
128
+ // the selection, we do not recurse it's children to prevent selection
129
+ // styles being added to its child nodes. The expected behaviour
130
+ // is that selection styles are only added to the parent.
131
+
132
+ if (node && withinSelection && isTopLevelNodeThatHasSelectionStyles) {
133
+ nodes.push({
134
+ node,
135
+ pos
136
+ });
137
+ return false; // Otherwise we recurse the children and return them so we can apply
138
+ // selection styles. Text is handled by the browser.
139
+ } else if (node && withinSelection && !node.isText) {
124
140
  nodes.push({
125
141
  node,
126
142
  pos
127
143
  });
128
- return false;
129
144
  }
130
145
 
131
146
  return true;