@atlaskit/editor-core 151.3.0 → 152.0.0

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 (294) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/dist/cjs/create-editor/ReactEditorView.js +22 -8
  3. package/dist/cjs/create-editor/create-plugins-list.js +25 -9
  4. package/dist/cjs/labs/next/presets/cxhtml.js +1 -2
  5. package/dist/cjs/nodeviews/ReactNodeView.js +2 -2
  6. package/dist/cjs/nodeviews/SelectionBasedNodeView.js +6 -0
  7. package/dist/cjs/plugins/analytics/types/enums.js +1 -0
  8. package/dist/cjs/plugins/annotation/utils.js +19 -8
  9. package/dist/cjs/plugins/avatar-group/index.js +2 -1
  10. package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +5 -2
  11. package/dist/cjs/plugins/before-primaryToolbar/index.js +26 -0
  12. package/dist/cjs/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +28 -0
  13. package/dist/cjs/plugins/extension/extension-api.js +10 -2
  14. package/dist/cjs/plugins/extension/ui/styles.js +1 -1
  15. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
  16. package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +172 -0
  17. package/dist/cjs/plugins/find-replace/index.js +14 -137
  18. package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +10 -4
  19. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +1 -1
  20. package/dist/cjs/plugins/fragment/index.js +34 -0
  21. package/dist/cjs/plugins/fragment/plugin-key.js +11 -0
  22. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
  23. package/dist/cjs/plugins/index.js +16 -0
  24. package/dist/cjs/plugins/list/actions/conversions.js +39 -71
  25. package/dist/cjs/plugins/list/transforms.js +7 -1
  26. package/dist/cjs/plugins/media/index.js +2 -3
  27. package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +3 -1
  28. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +12 -5
  29. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +6 -4
  30. package/dist/cjs/plugins/media/nodeviews/styles.js +6 -1
  31. package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
  32. package/dist/cjs/plugins/media/pm-plugins/main.js +49 -15
  33. package/dist/cjs/plugins/media/toolbar/commands.js +59 -0
  34. package/dist/cjs/plugins/media/toolbar/filePreviewItem.js +7 -2
  35. package/dist/cjs/plugins/media/toolbar/index.js +90 -3
  36. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +9 -1
  37. package/dist/cjs/plugins/media/utils/media-common.js +1 -1
  38. package/dist/cjs/plugins/media/utils/media-files.js +5 -1
  39. package/dist/cjs/plugins/panel/actions.js +2 -2
  40. package/dist/cjs/plugins/panel/index.js +3 -3
  41. package/dist/cjs/plugins/panel/nodeviews/panel.js +2 -2
  42. package/dist/cjs/plugins/panel/toolbar.js +10 -5
  43. package/dist/cjs/plugins/panel/utils.js +15 -0
  44. package/dist/cjs/plugins/rank.js +3 -2
  45. package/dist/cjs/plugins/selection/pm-plugins/selection-main.js +49 -1
  46. package/dist/cjs/plugins/status/ui/statusPicker.js +4 -2
  47. package/dist/cjs/plugins/table/commands/insert.js +1 -0
  48. package/dist/cjs/plugins/table/index.js +3 -2
  49. package/dist/cjs/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -3
  50. package/dist/cjs/plugins/table/pm-plugins/main.js +26 -3
  51. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  52. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
  53. package/dist/cjs/plugins/table/transforms/column-width.js +14 -5
  54. package/dist/cjs/plugins/table/transforms/fix-tables.js +43 -6
  55. package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +3 -2
  56. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
  57. package/dist/cjs/plugins/table/ui/common-styles.css.js +1 -1
  58. package/dist/cjs/plugins/table/ui/consts.js +1 -1
  59. package/dist/cjs/plugins/table/ui/messages.js +1 -1
  60. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  61. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  62. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/main.js +2 -2
  63. package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
  64. package/dist/cjs/plugins/text-formatting/index.js +2 -1
  65. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +1 -0
  66. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +77 -26
  67. package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +32 -9
  68. package/dist/cjs/ui/ColorPalette/Color/index.js +8 -18
  69. package/dist/cjs/ui/ColorPalette/index.js +7 -4
  70. package/dist/cjs/ui/ColorPickerButton/index.js +1 -1
  71. package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +114 -61
  72. package/dist/cjs/ui/ConfigPanel/FormContent.js +39 -26
  73. package/dist/cjs/ui/ConfigPanel/transformers.js +490 -248
  74. package/dist/cjs/ui/ConfigPanel/utils.js +2 -10
  75. package/dist/cjs/ui/DropdownMenu/index.js +3 -1
  76. package/dist/cjs/ui/LinkSearch/LinkSearchListItem.js +1 -1
  77. package/dist/cjs/ui/Resizer/index.js +9 -1
  78. package/dist/cjs/version-wrapper.js +1 -1
  79. package/dist/cjs/version.json +1 -1
  80. package/dist/es2019/create-editor/ReactEditorView.js +19 -8
  81. package/dist/es2019/create-editor/create-plugins-list.js +26 -10
  82. package/dist/es2019/labs/next/presets/cxhtml.js +1 -2
  83. package/dist/es2019/nodeviews/ReactNodeView.js +1 -1
  84. package/dist/es2019/nodeviews/SelectionBasedNodeView.js +11 -0
  85. package/dist/es2019/plugins/analytics/types/enums.js +1 -0
  86. package/dist/es2019/plugins/annotation/utils.js +18 -7
  87. package/dist/es2019/plugins/avatar-group/index.js +2 -1
  88. package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +3 -2
  89. package/dist/es2019/plugins/before-primaryToolbar/index.js +15 -0
  90. package/dist/es2019/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +12 -0
  91. package/dist/es2019/plugins/extension/extension-api.js +9 -2
  92. package/dist/es2019/plugins/extension/ui/styles.js +6 -0
  93. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
  94. package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +152 -0
  95. package/dist/es2019/plugins/find-replace/index.js +15 -128
  96. package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
  97. package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +10 -2
  98. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +1 -1
  99. package/dist/es2019/plugins/fragment/index.js +22 -0
  100. package/dist/es2019/plugins/fragment/plugin-key.js +2 -0
  101. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
  102. package/dist/es2019/plugins/index.js +2 -0
  103. package/dist/es2019/plugins/list/actions/conversions.js +38 -69
  104. package/dist/es2019/plugins/list/transforms.js +5 -1
  105. package/dist/es2019/plugins/media/index.js +2 -2
  106. package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +2 -1
  107. package/dist/es2019/plugins/media/nodeviews/mediaInline.js +8 -4
  108. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +7 -5
  109. package/dist/es2019/plugins/media/nodeviews/styles.js +2 -0
  110. package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
  111. package/dist/es2019/plugins/media/pm-plugins/main.js +32 -17
  112. package/dist/es2019/plugins/media/toolbar/commands.js +47 -0
  113. package/dist/es2019/plugins/media/toolbar/filePreviewItem.js +6 -2
  114. package/dist/es2019/plugins/media/toolbar/index.js +90 -3
  115. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +7 -1
  116. package/dist/es2019/plugins/media/utils/media-common.js +1 -1
  117. package/dist/es2019/plugins/media/utils/media-files.js +6 -1
  118. package/dist/es2019/plugins/panel/actions.js +2 -2
  119. package/dist/es2019/plugins/panel/index.js +5 -5
  120. package/dist/es2019/plugins/panel/nodeviews/panel.js +2 -2
  121. package/dist/es2019/plugins/panel/toolbar.js +10 -5
  122. package/dist/es2019/plugins/panel/utils.js +8 -1
  123. package/dist/es2019/plugins/rank.js +3 -2
  124. package/dist/es2019/plugins/selection/pm-plugins/selection-main.js +48 -1
  125. package/dist/es2019/plugins/status/ui/statusPicker.js +4 -2
  126. package/dist/es2019/plugins/table/commands/insert.js +1 -2
  127. package/dist/es2019/plugins/table/index.js +2 -1
  128. package/dist/es2019/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -2
  129. package/dist/es2019/plugins/table/pm-plugins/main.js +25 -4
  130. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  131. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
  132. package/dist/es2019/plugins/table/transforms/column-width.js +13 -3
  133. package/dist/es2019/plugins/table/transforms/fix-tables.js +43 -5
  134. package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +3 -2
  135. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
  136. package/dist/es2019/plugins/table/ui/common-styles.css.js +5 -1
  137. package/dist/es2019/plugins/table/ui/consts.js +2 -2
  138. package/dist/es2019/plugins/table/ui/messages.js +1 -1
  139. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  140. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  141. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
  142. package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
  143. package/dist/es2019/plugins/text-formatting/index.js +3 -2
  144. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +2 -1
  145. package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +2 -1
  146. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +60 -27
  147. package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +51 -7
  148. package/dist/es2019/ui/ColorPalette/Color/index.js +9 -18
  149. package/dist/es2019/ui/ColorPalette/index.js +7 -4
  150. package/dist/es2019/ui/ColorPickerButton/index.js +1 -1
  151. package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +101 -49
  152. package/dist/es2019/ui/ConfigPanel/FormContent.js +35 -26
  153. package/dist/es2019/ui/ConfigPanel/transformers.js +243 -72
  154. package/dist/es2019/ui/ConfigPanel/utils.js +1 -2
  155. package/dist/es2019/ui/Dropdown/index.js +2 -1
  156. package/dist/es2019/ui/DropdownMenu/index.js +7 -3
  157. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +1 -0
  158. package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
  159. package/dist/es2019/ui/LinkSearch/LinkSearchListItem.js +2 -2
  160. package/dist/es2019/ui/Resizer/index.js +9 -1
  161. package/dist/es2019/version-wrapper.js +1 -1
  162. package/dist/es2019/version.json +1 -1
  163. package/dist/esm/create-editor/ReactEditorView.js +22 -8
  164. package/dist/esm/create-editor/create-plugins-list.js +26 -10
  165. package/dist/esm/labs/next/presets/cxhtml.js +1 -2
  166. package/dist/esm/nodeviews/ReactNodeView.js +2 -2
  167. package/dist/esm/nodeviews/SelectionBasedNodeView.js +7 -0
  168. package/dist/esm/plugins/analytics/types/enums.js +1 -0
  169. package/dist/esm/plugins/annotation/utils.js +18 -7
  170. package/dist/esm/plugins/avatar-group/index.js +2 -1
  171. package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +5 -2
  172. package/dist/esm/plugins/before-primaryToolbar/index.js +15 -0
  173. package/dist/esm/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +12 -0
  174. package/dist/esm/plugins/extension/extension-api.js +9 -2
  175. package/dist/esm/plugins/extension/ui/styles.js +1 -1
  176. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
  177. package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +155 -0
  178. package/dist/esm/plugins/find-replace/index.js +14 -131
  179. package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
  180. package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +9 -4
  181. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +1 -1
  182. package/dist/esm/plugins/fragment/index.js +22 -0
  183. package/dist/esm/plugins/fragment/plugin-key.js +2 -0
  184. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
  185. package/dist/esm/plugins/index.js +2 -0
  186. package/dist/esm/plugins/list/actions/conversions.js +38 -71
  187. package/dist/esm/plugins/list/transforms.js +7 -1
  188. package/dist/esm/plugins/media/index.js +2 -3
  189. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +2 -1
  190. package/dist/esm/plugins/media/nodeviews/mediaInline.js +11 -6
  191. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +7 -5
  192. package/dist/esm/plugins/media/nodeviews/styles.js +2 -0
  193. package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
  194. package/dist/esm/plugins/media/pm-plugins/main.js +47 -16
  195. package/dist/esm/plugins/media/toolbar/commands.js +45 -0
  196. package/dist/esm/plugins/media/toolbar/filePreviewItem.js +6 -2
  197. package/dist/esm/plugins/media/toolbar/index.js +88 -3
  198. package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +9 -1
  199. package/dist/esm/plugins/media/utils/media-common.js +1 -1
  200. package/dist/esm/plugins/media/utils/media-files.js +6 -1
  201. package/dist/esm/plugins/panel/actions.js +2 -2
  202. package/dist/esm/plugins/panel/index.js +5 -5
  203. package/dist/esm/plugins/panel/nodeviews/panel.js +2 -2
  204. package/dist/esm/plugins/panel/toolbar.js +9 -4
  205. package/dist/esm/plugins/panel/utils.js +13 -0
  206. package/dist/esm/plugins/rank.js +3 -2
  207. package/dist/esm/plugins/selection/pm-plugins/selection-main.js +50 -1
  208. package/dist/esm/plugins/status/ui/statusPicker.js +4 -2
  209. package/dist/esm/plugins/table/commands/insert.js +1 -2
  210. package/dist/esm/plugins/table/index.js +3 -2
  211. package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -2
  212. package/dist/esm/plugins/table/pm-plugins/main.js +27 -4
  213. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  214. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
  215. package/dist/esm/plugins/table/transforms/column-width.js +13 -3
  216. package/dist/esm/plugins/table/transforms/fix-tables.js +42 -4
  217. package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +3 -2
  218. package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
  219. package/dist/esm/plugins/table/ui/common-styles.css.js +1 -1
  220. package/dist/esm/plugins/table/ui/consts.js +2 -2
  221. package/dist/esm/plugins/table/ui/messages.js +1 -1
  222. package/dist/esm/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  223. package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  224. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
  225. package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
  226. package/dist/esm/plugins/text-formatting/index.js +3 -2
  227. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +2 -1
  228. package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +2 -1
  229. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +67 -27
  230. package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +20 -7
  231. package/dist/esm/ui/ColorPalette/Color/index.js +9 -16
  232. package/dist/esm/ui/ColorPalette/index.js +7 -4
  233. package/dist/esm/ui/ColorPickerButton/index.js +1 -1
  234. package/dist/esm/ui/ConfigPanel/ConfigPanel.js +113 -62
  235. package/dist/esm/ui/ConfigPanel/FormContent.js +39 -26
  236. package/dist/esm/ui/ConfigPanel/transformers.js +488 -248
  237. package/dist/esm/ui/ConfigPanel/utils.js +1 -6
  238. package/dist/esm/ui/Dropdown/index.js +2 -1
  239. package/dist/esm/ui/DropdownMenu/index.js +7 -3
  240. package/dist/esm/ui/ElementBrowser/InsertMenu.js +1 -0
  241. package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
  242. package/dist/esm/ui/LinkSearch/LinkSearchListItem.js +2 -2
  243. package/dist/esm/ui/Resizer/index.js +9 -1
  244. package/dist/esm/version-wrapper.js +1 -1
  245. package/dist/esm/version.json +1 -1
  246. package/dist/types/labs/next/full-page.d.ts +1 -1
  247. package/dist/types/nodeviews/ReactNodeView.d.ts +1 -1
  248. package/dist/types/nodeviews/SelectionBasedNodeView.d.ts +1 -0
  249. package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
  250. package/dist/types/plugins/analytics/types/events.d.ts +7 -1
  251. package/dist/types/plugins/annotation/utils.d.ts +1 -1
  252. package/dist/types/plugins/avatar-group/index.d.ts +1 -0
  253. package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +1 -0
  254. package/dist/types/plugins/before-primaryToolbar/index.d.ts +5 -0
  255. package/dist/types/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.d.ts +5 -0
  256. package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -1
  257. package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +15 -0
  258. package/dist/types/plugins/find-replace/index.d.ts +1 -0
  259. package/dist/types/plugins/floating-toolbar/ui/EmojiPickerButton.d.ts +1 -1
  260. package/dist/types/plugins/fragment/index.d.ts +5 -0
  261. package/dist/types/plugins/fragment/plugin-key.d.ts +2 -0
  262. package/dist/types/plugins/index.d.ts +2 -0
  263. package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +3 -2
  264. package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
  265. package/dist/types/plugins/media/nodeviews/styles.d.ts +2 -0
  266. package/dist/types/plugins/media/toolbar/commands.d.ts +3 -0
  267. package/dist/types/plugins/media/toolbar/filePreviewItem.d.ts +2 -0
  268. package/dist/types/plugins/media/types.d.ts +0 -1
  269. package/dist/types/plugins/panel/actions.d.ts +1 -1
  270. package/dist/types/plugins/panel/types.d.ts +8 -2
  271. package/dist/types/plugins/quick-insert/index.d.ts +2 -1
  272. package/dist/types/plugins/table/commands/insert.d.ts +3 -0
  273. package/dist/types/plugins/table/pm-plugins/main.d.ts +2 -1
  274. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -0
  275. package/dist/types/plugins/table/transforms/column-width.d.ts +4 -1
  276. package/dist/types/plugins/table/transforms/fix-tables.d.ts +3 -2
  277. package/dist/types/plugins/table/types.d.ts +8 -0
  278. package/dist/types/plugins/table/ui/consts.d.ts +1 -1
  279. package/dist/types/types/editor-appearance-component.d.ts +2 -2
  280. package/dist/types/types/editor-props.d.ts +11 -1
  281. package/dist/types/types/feature-flags.d.ts +13 -0
  282. package/dist/types/types/index.d.ts +1 -1
  283. package/dist/types/ui/Appearance/FullPage/FullPageToolbar.d.ts +2 -2
  284. package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +10 -1
  285. package/dist/types/ui/ColorPalette/Color/index.d.ts +8 -5
  286. package/dist/types/ui/ColorPalette/index.d.ts +1 -0
  287. package/dist/types/ui/ConfigPanel/transformers.d.ts +7 -1
  288. package/dist/types/ui/ConfigPanel/utils.d.ts +0 -1
  289. package/dist/types/ui/Resizer/index.d.ts +1 -0
  290. package/package.json +32 -29
  291. package/dist/cjs/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -38
  292. package/dist/es2019/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -28
  293. package/dist/esm/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -28
  294. package/dist/types/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.d.ts +0 -1
@@ -21,7 +21,7 @@ var _warning = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/warni
21
21
 
22
22
  var _error = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/error"));
23
23
 
24
- var _EditorRemoveEmojiIcon = _interopRequireDefault(require("../floating-toolbar/ui/EditorRemoveEmojiIcon"));
24
+ var _removeEmoji = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove-emoji"));
25
25
 
26
26
  var _messages = _interopRequireDefault(require("../../messages"));
27
27
 
@@ -51,7 +51,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
51
51
 
52
52
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
53
53
 
54
- var panelIconMap = (_panelIconMap = {}, (0, _defineProperty2.default)(_panelIconMap, _adfSchema.PanelType.INFO, ':info:'), (0, _defineProperty2.default)(_panelIconMap, _adfSchema.PanelType.NOTE, ':note:'), (0, _defineProperty2.default)(_panelIconMap, _adfSchema.PanelType.WARNING, ':warning:'), (0, _defineProperty2.default)(_panelIconMap, _adfSchema.PanelType.ERROR, ':error:'), (0, _defineProperty2.default)(_panelIconMap, _adfSchema.PanelType.SUCCESS, ':success:'), (0, _defineProperty2.default)(_panelIconMap, _adfSchema.PanelType.TIP, ':tip:'), _panelIconMap);
54
+ var panelIconMap = (_panelIconMap = {}, (0, _defineProperty2.default)(_panelIconMap, _adfSchema.PanelType.INFO, ':info:'), (0, _defineProperty2.default)(_panelIconMap, _adfSchema.PanelType.NOTE, ':note:'), (0, _defineProperty2.default)(_panelIconMap, _adfSchema.PanelType.WARNING, ':warning:'), (0, _defineProperty2.default)(_panelIconMap, _adfSchema.PanelType.ERROR, ':cross_mark:'), (0, _defineProperty2.default)(_panelIconMap, _adfSchema.PanelType.SUCCESS, ':check_mark:'), (0, _defineProperty2.default)(_panelIconMap, _adfSchema.PanelType.TIP, ':tip:'), _panelIconMap);
55
55
  exports.panelIconMap = panelIconMap;
56
56
 
57
57
  var getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, activePanelType, activePanelColor, activePanelIcon) {
@@ -229,7 +229,7 @@ var getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isC
229
229
  var removeEmojiButton = {
230
230
  id: 'editor.panel.removeEmoji',
231
231
  type: 'button',
232
- icon: _EditorRemoveEmojiIcon.default,
232
+ icon: _removeEmoji.default,
233
233
  onClick: removeEmoji(),
234
234
  title: formatMessage(_messages.default.removeEmoji),
235
235
  disabled: activePanelIcon ? false : true
@@ -270,9 +270,14 @@ var getToolbarConfig = function getToolbarConfig(state, intl) {
270
270
  var _panelObject$node$att = panelObject.node.attrs,
271
271
  panelType = _panelObject$node$att.panelType,
272
272
  panelColor = _panelObject$node$att.panelColor,
273
- panelIcon = _panelObject$node$att.panelIcon; // force toolbar to be turned on
273
+ panelIcon = _panelObject$node$att.panelIcon;
274
274
 
275
- var items = getToolbarItems(formatMessage, nodeType, options.UNSAFE_allowCustomPanel || false, options.UNSAFE_allowCustomPanel && options.UNSAFE_allowCustomPanelEdit || false, providerFactory, panelType, options.UNSAFE_allowCustomPanel ? panelColor : undefined, options.UNSAFE_allowCustomPanel ? panelIcon : undefined);
275
+ var isStandardPanel = function isStandardPanel(panelType) {
276
+ return panelType !== _adfSchema.PanelType.CUSTOM ? panelType : undefined;
277
+ }; // force toolbar to be turned on
278
+
279
+
280
+ var items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined);
276
281
 
277
282
  var getDomRef = function getDomRef(editorView) {
278
283
  var domAtPos = editorView.domAtPos.bind(editorView);
@@ -1,16 +1,24 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.panelAttrsToDom = exports.findPanel = void 0;
7
9
 
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+
8
12
  var _prosemirrorUtils = require("prosemirror-utils");
9
13
 
10
14
  var _adfSchema = require("@atlaskit/adf-schema");
11
15
 
12
16
  var _editorCommon = require("@atlaskit/editor-common");
13
17
 
18
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
19
+
20
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
21
+
14
22
  var findPanel = function findPanel(state, selection) {
15
23
  var panel = state.schema.nodes.panel;
16
24
  return (0, _prosemirrorUtils.findSelectedNodeOfType)(panel)(selection || state.selection) || (0, _prosemirrorUtils.findParentNodeOfType)(panel)(selection || state.selection);
@@ -30,6 +38,13 @@ var panelAttrsToDom = function panelAttrsToDom(attrs, allowCustomPanel) {
30
38
  'data-panel-type': panelType || _adfSchema.PanelType.INFO,
31
39
  style: style
32
40
  };
41
+
42
+ if (panelColor && isCustomPanel) {
43
+ panelAttrs = _objectSpread(_objectSpread({}, panelAttrs), {}, {
44
+ 'data-panel-color': panelColor
45
+ });
46
+ }
47
+
33
48
  var iconDiv = ['div', {
34
49
  class: _editorCommon.PanelSharedCssClassName.icon
35
50
  }];
@@ -12,9 +12,10 @@ var _default = {
12
12
  // https://product-fabric.atlassian.net/wiki/spaces/E/pages/1113098008/Selection+Guide#Special-Cases
13
13
  'expandKeymap', 'tableSelectionKeymap', 'tableKeymap', 'captionKeymap', // selection keymap needs to be above gap cursor keymap so it can set node selections from
14
14
  // left/right arrows
15
- 'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaKeymap', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'fakeTextCursor', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription', 'inlineCode'],
15
+ 'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaKeymap', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'fakeTextCursor', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription', 'beforePrimaryToolbar', 'inlineCode'],
16
16
  nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'rule', 'panel', 'mention', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'unsupportedBlock', 'unsupportedInline', 'confluenceJiraIssue', 'hardBreak', 'emoji', 'placeholder', 'mediaSingle', 'mediaGroup', 'table', 'expand', 'nestedExpand', 'media', 'tableHeader', 'decisionList', 'tableRow', 'decisionItem', 'tableCell', 'taskList', 'taskItem', 'extension', 'bodiedExtension', 'inlineExtension', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard'],
17
- marks: [// Inline marks
17
+ marks: [// Fragment mark is both for inline and block elements
18
+ 'fragment', // Inline marks
18
19
  'link', 'em', 'strong', 'textColor', 'strike', 'subsup', 'underline', 'code', 'typeAheadQuery', // Block marks
19
20
  'alignment', 'breakout', 'indentation', 'annotation', //Unsupported mark
20
21
  'unsupportedMark', 'unsupportedNodeAttribute']
@@ -26,6 +26,28 @@ var getInitialState = function getInitialState(state) {
26
26
 
27
27
  exports.getInitialState = getInitialState;
28
28
 
29
+ var toggleContentEditable = function toggleContentEditable(node) {
30
+ var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
31
+
32
+ if (root || node.getAttribute('contenteditable') === 'true') {
33
+ var wasTrue = node.getAttribute('contenteditable') === 'true';
34
+ node.setAttribute('contenteditable', 'false');
35
+ requestAnimationFrame(function () {
36
+ if (wasTrue) {
37
+ node.setAttribute('contenteditable', 'true');
38
+ } else {
39
+ node.removeAttribute('contenteditable');
40
+ }
41
+ });
42
+ } // any children with contenteditable = true block selection from proceeding
43
+
44
+
45
+ var children = Array.from(node.children);
46
+ children.forEach(function (child) {
47
+ return toggleContentEditable(child);
48
+ });
49
+ };
50
+
29
51
  var createPlugin = function createPlugin(dispatch, dispatchAnalyticsEvent) {
30
52
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
31
53
  return new _prosemirrorState.Plugin({
@@ -108,10 +130,11 @@ var createPlugin = function createPlugin(dispatch, dispatchAnalyticsEvent) {
108
130
  return false;
109
131
  },
110
132
  keydown: function keydown(editorView, event) {
111
- // Firefox bugfix to bypass issue with editing text adjacent to a DOM node with
133
+ var state = editorView.state; // Firefox bugfix to bypass issue with editing text adjacent to a DOM node with
112
134
  // contenteditable="false". (See https://product-fabric.atlassian.net/browse/ED-9452)
113
135
  // On keypress, if the head of cursor selection touches a node with contenteditable="false",
114
136
  // we temporarily remove the attribute, wait one tick, then restore it with its original value.
137
+
115
138
  if (_editorCommon.browser.gecko) {
116
139
  var node = editorView.nodeDOM(editorView.state.selection.head);
117
140
 
@@ -121,6 +144,31 @@ var createPlugin = function createPlugin(dispatch, dispatchAnalyticsEvent) {
121
144
  node.setAttribute('contenteditable', 'false');
122
145
  });
123
146
  }
147
+ } // Bugfix for block ReactNodeViews like table and extension
148
+ // They could not be selected with Shift + ArrowDown/ArrowUp
149
+ // Fixed when contenteditable = false, but then you couldn't edit their contents
150
+ // Therefore, briefly set contenteditable=false to allow the selection through, then set it back to true
151
+
152
+
153
+ if (event instanceof KeyboardEvent && event.shiftKey && (event.key === 'ArrowDown' || event.key === 'ArrowUp')) {
154
+ var pos;
155
+
156
+ if (event.key === 'ArrowDown') {
157
+ pos = state.selection.$head.after();
158
+ } else {
159
+ pos = state.selection.$head.before() - 1; // block extensions only take up one position, dont need to get before()
160
+
161
+ if (!editorView.nodeDOM(pos)) {
162
+ pos = state.doc.resolve(pos).before();
163
+ }
164
+ }
165
+
166
+ var _node = editorView.nodeDOM(pos);
167
+
168
+ if (_node instanceof HTMLDivElement && _node.className.includes('View-content-wrap') // class added by ReactNodeView
169
+ ) {
170
+ toggleContentEditable(_node, true);
171
+ }
124
172
  }
125
173
 
126
174
  return false;
@@ -248,7 +248,8 @@ var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component) {
248
248
  target = _this$props.target;
249
249
  var _this$state3 = this.state,
250
250
  color = _this$state3.color,
251
- text = _this$state3.text;
251
+ text = _this$state3.text,
252
+ localId = _this$state3.localId;
252
253
  return target && /*#__PURE__*/_react.default.createElement(PopupWithListeners, {
253
254
  target: target,
254
255
  offset: [0, 8],
@@ -265,7 +266,8 @@ var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component) {
265
266
  onColorClick: this.onColorClick,
266
267
  onColorHover: this.onColorHover,
267
268
  onTextChanged: this.onTextChanged,
268
- onEnter: this.onEnter
269
+ onEnter: this.onEnter,
270
+ localId: localId
269
271
  })));
270
272
  }
271
273
  }]);
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.addColumnAt = addColumnAt;
6
7
  exports.createTable = exports.insertRow = exports.insertColumn = exports.addColumnAfter = exports.addColumnBefore = void 0;
7
8
 
8
9
  var _prosemirrorState = require("prosemirror-state");
@@ -83,7 +83,8 @@ var tablesPlugin = function tablesPlugin(options) {
83
83
  return [{
84
84
  name: 'table',
85
85
  plugin: function plugin(_ref) {
86
- var dispatch = _ref.dispatch,
86
+ var dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
87
+ dispatch = _ref.dispatch,
87
88
  portalProviderAPI = _ref.portalProviderAPI,
88
89
  eventDispatcher = _ref.eventDispatcher;
89
90
 
@@ -94,7 +95,7 @@ var tablesPlugin = function tablesPlugin(options) {
94
95
  breakoutEnabled = _ref2.breakoutEnabled,
95
96
  tableOptions = _ref2.tableOptions;
96
97
 
97
- return (0, _main.createPlugin)(dispatch, portalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), breakoutEnabled && dynamicSizingEnabled, breakoutEnabled, fullWidthEnabled, wasFullWidthEnabled);
98
+ return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), breakoutEnabled && dynamicSizingEnabled, breakoutEnabled, fullWidthEnabled, wasFullWidthEnabled);
98
99
  }
99
100
  }, {
100
101
  name: 'tablePMColResizing',
@@ -13,8 +13,6 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
13
13
 
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
15
 
16
- var _editorCommon = require("@atlaskit/editor-common");
17
-
18
16
  var _types = require("../types");
19
17
 
20
18
  var _consts = require("../ui/consts");
@@ -72,7 +70,7 @@ var OverflowShadowsObserver = /*#__PURE__*/function () {
72
70
  }, {
73
71
  threshold: [0, 1],
74
72
  root: _this.wrapper,
75
- rootMargin: "0px ".concat(_consts.tableInsertColumnButtonSize / 2 - _editorCommon.tableCellBorderWidth, "px 0px 0px")
73
+ rootMargin: "0px ".concat(_consts.tableInsertColumnButtonSize / 2, "px 0px 0px")
76
74
  });
77
75
  return;
78
76
  }
@@ -50,7 +50,7 @@ var isDynamicTextSizingEnabled;
50
50
  var isFullWidthModeEnabled;
51
51
  var wasFullWidthModeEnabled;
52
52
 
53
- var createPlugin = function createPlugin(dispatch, portalProviderAPI, eventDispatcher, pluginConfig, dynamicTextSizing, breakoutEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled) {
53
+ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, dynamicTextSizing, breakoutEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled) {
54
54
  var _window;
55
55
 
56
56
  isBreakoutEnabled = breakoutEnabled;
@@ -82,7 +82,9 @@ var createPlugin = function createPlugin(dispatch, portalProviderAPI, eventDispa
82
82
  tableHeader: function tableHeader(node, view, getPos) {
83
83
  return new _tableCell.default(node, view, getPos, observer);
84
84
  }
85
- } : {};
85
+ } : {}; // Used to prevent invalid table cell spans being reported more than once per editor/document
86
+
87
+ var invalidTableIds = [];
86
88
  return new _prosemirrorState.Plugin({
87
89
  state: state,
88
90
  key: _pluginFactory.pluginKey,
@@ -91,6 +93,27 @@ var createPlugin = function createPlugin(dispatch, portalProviderAPI, eventDispa
91
93
  return tr.getMeta('uiEvent') === 'cut';
92
94
  });
93
95
 
96
+ function reportInvalidTableCellSpanAttrs(invalidNodeAttr) {
97
+ if (invalidTableIds.find(function (id) {
98
+ return id === invalidNodeAttr.tableLocalId;
99
+ })) {
100
+ return;
101
+ }
102
+
103
+ invalidTableIds.push(invalidNodeAttr.tableLocalId);
104
+ dispatchAnalyticsEvent({
105
+ action: _analytics.ACTION.INVALID_DOCUMENT_ENCOUNTERED,
106
+ actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
107
+ eventType: _analytics.EVENT_TYPE.OPERATIONAL,
108
+ attributes: {
109
+ nodeType: invalidNodeAttr.nodeType,
110
+ reason: "".concat(invalidNodeAttr.attribute, ": ").concat(invalidNodeAttr.reason),
111
+ tableLocalId: invalidNodeAttr.tableLocalId,
112
+ spanValue: invalidNodeAttr.spanValue
113
+ }
114
+ });
115
+ }
116
+
94
117
  if (tr) {
95
118
  // "fixTables" removes empty rows as we don't allow that in schema
96
119
  var updatedTr = (0, _eventHandlers.handleCut)(tr, oldState, newState);
@@ -100,7 +123,7 @@ var createPlugin = function createPlugin(dispatch, portalProviderAPI, eventDispa
100
123
  if (transactions.find(function (tr) {
101
124
  return tr.docChanged;
102
125
  })) {
103
- return (0, _transforms.fixTables)(newState.tr);
126
+ return (0, _transforms.fixTables)(newState.tr, reportInvalidTableCellSpanAttrs);
104
127
  }
105
128
  },
106
129
  view: function view(editorView) {
@@ -22,9 +22,9 @@ var generateColgroup = function generateColgroup(table) {
22
22
  // We slice here to guard against our colwidth array having more entries
23
23
  // Than the we actually span. We'll patch the document at a later point.
24
24
  cell.attrs.colwidth.slice(0, colspan).forEach(function (width) {
25
- cols.push(['col', {
25
+ cols.push(['col', width ? {
26
26
  style: "width: ".concat(width, "px;")
27
- }]);
27
+ } : {}]);
28
28
  });
29
29
  } else {
30
30
  // When we have merged cells on the first row (firstChild),
@@ -56,6 +56,7 @@ var getResizeState = function getResizeState(_ref) {
56
56
  cols: _cols,
57
57
  widths: _widths,
58
58
  maxSize: maxSize,
59
+ tableWidth: _tableWidth,
59
60
  overflow: _overflow
60
61
  };
61
62
  } // Getting the resize state from DOM
@@ -77,6 +78,7 @@ var getResizeState = function getResizeState(_ref) {
77
78
  cols: cols,
78
79
  widths: widths,
79
80
  maxSize: maxSize,
81
+ tableWidth: tableWidth,
80
82
  overflow: overflow
81
83
  };
82
84
  }; // updates Colgroup DOM node with new widths
@@ -11,6 +11,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
11
11
 
12
12
  var _tableMap = require("@atlaskit/editor-tables/table-map");
13
13
 
14
+ var _editorCommon = require("@atlaskit/editor-common");
15
+
14
16
  var _utils = require("../pm-plugins/table-resizing/utils");
15
17
 
16
18
  var _metadata = require("./metadata");
@@ -19,8 +21,6 @@ var _resizeState = require("../pm-plugins/table-resizing/utils/resize-state");
19
21
 
20
22
  var _misc = require("../pm-plugins/table-resizing/utils/misc");
21
23
 
22
- var _editorCommon = require("@atlaskit/editor-common");
23
-
24
24
  var _scaleTable = require("../pm-plugins/table-resizing/utils/scale-table");
25
25
 
26
26
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
@@ -132,7 +132,10 @@ var updateColumnWidths = function updateColumnWidths(resizeState, table, start)
132
132
  };
133
133
  };
134
134
  /**
135
- * This function is called when user inserts/deletes a column in a table to rescale all columns.
135
+ * This function is called when user inserts/deletes a column in a table to;
136
+ * - rescale all columns (if the table did not overflow before the insertion)
137
+ * - and update column widths.
138
+ *
136
139
  * This is done manually to avoid a multi-dispatch in TableComponent. See [ED-8288].
137
140
  * @param table
138
141
  * @param view
@@ -144,6 +147,8 @@ exports.updateColumnWidths = updateColumnWidths;
144
147
 
145
148
  var rescaleColumns = function rescaleColumns(table, view) {
146
149
  return function (tr) {
150
+ // If the table has been not been resized we skip updating the size
151
+ // of columns here.
147
152
  if (!view || !(0, _utils.hasTableBeenResized)(table.node)) {
148
153
  return tr;
149
154
  }
@@ -157,7 +162,8 @@ var rescaleColumns = function rescaleColumns(table, view) {
157
162
  return tr;
158
163
  }
159
164
 
160
- var layout = (0, _resizeState.normaliseTableLayout)(tableRef === null || tableRef === void 0 ? void 0 : tableRef.dataset.layout);
165
+ var layout = (0, _resizeState.normaliseTableLayout)(tableRef === null || tableRef === void 0 ? void 0 : tableRef.dataset.layout); // The is the width the table can reach before overflowing
166
+
161
167
  var maxSize = (0, _misc.getTableMaxWidth)({
162
168
  table: table.node,
163
169
  tableStart: table.start,
@@ -173,8 +179,11 @@ var rescaleColumns = function rescaleColumns(table, view) {
173
179
  domAtPos: domAtPos,
174
180
  maxSize: maxSize
175
181
  });
182
+ var previousTableWidth = resizeState.tableWidth - _editorCommon.tableNewColumnMinWidth;
183
+ var tableDidntPreviouslyOverflow = previousTableWidth <= maxSize; // If the new table width will result in the table going into an overflow state
184
+ // we resize the cells to avoid the overflow occuring
176
185
 
177
- if (resizeState.overflow) {
186
+ if (tableDidntPreviouslyOverflow && resizeState.overflow) {
178
187
  resizeState = (0, _scaleTable.scaleTableTo)(resizeState, maxSize);
179
188
  }
180
189
 
@@ -33,6 +33,36 @@ var fireAnalytics = function fireAnalytics() {
33
33
  user: '-'
34
34
  }]
35
35
  });
36
+ };
37
+
38
+ exports.fireAnalytics = fireAnalytics;
39
+
40
+ var validateTableCellNodeAttrs = function validateTableCellNodeAttrs(_ref, reportInvalidTableCellSpanAttrs) {
41
+ var colspan = _ref.colspan,
42
+ rowspan = _ref.rowspan,
43
+ tableLocalId = _ref.tableLocalId;
44
+
45
+ if (colspan && colspan < 0) {
46
+ reportInvalidTableCellSpanAttrs({
47
+ nodeType: 'tableCell',
48
+ attribute: 'colspan',
49
+ reason: 'negative value',
50
+ tableLocalId: tableLocalId,
51
+ spanValue: colspan
52
+ });
53
+ }
54
+
55
+ if (rowspan && rowspan < 0) {
56
+ reportInvalidTableCellSpanAttrs({
57
+ nodeType: 'tableCell',
58
+ attribute: 'rowspan',
59
+ reason: 'negative value',
60
+ tableLocalId: tableLocalId,
61
+ spanValue: rowspan
62
+ });
63
+ }
64
+
65
+ return;
36
66
  }; // We attempt to patch the document when we have extra, unneeded, column widths
37
67
  // Take this node for example:
38
68
  //
@@ -42,14 +72,21 @@ var fireAnalytics = function fireAnalytics() {
42
72
  // We remove the third width here, assumed duplicate content.
43
73
 
44
74
 
45
- exports.fireAnalytics = fireAnalytics;
46
-
47
- var removeExtraneousColumnWidths = function removeExtraneousColumnWidths(node, basePos, tr) {
75
+ var removeExtraneousColumnWidths = function removeExtraneousColumnWidths(node, basePos, tr, reportInvalidTableCellSpanAttrs) {
48
76
  var hasProblems = false;
49
77
  tr = replaceCells(tr, node, basePos, function (cell) {
50
78
  var _cell$attrs = cell.attrs,
51
79
  colwidth = _cell$attrs.colwidth,
52
- colspan = _cell$attrs.colspan;
80
+ colspan = _cell$attrs.colspan,
81
+ rowspan = _cell$attrs.rowspan;
82
+
83
+ if (reportInvalidTableCellSpanAttrs) {
84
+ validateTableCellNodeAttrs({
85
+ colspan: colspan,
86
+ rowspan: rowspan,
87
+ tableLocalId: node.attrs.localId
88
+ }, reportInvalidTableCellSpanAttrs);
89
+ }
53
90
 
54
91
  if (colwidth && colwidth.length > colspan) {
55
92
  hasProblems = true;
@@ -73,12 +110,12 @@ var removeExtraneousColumnWidths = function removeExtraneousColumnWidths(node, b
73
110
 
74
111
  exports.removeExtraneousColumnWidths = removeExtraneousColumnWidths;
75
112
 
76
- var fixTables = function fixTables(tr) {
113
+ var fixTables = function fixTables(tr, reportInvalidTableCellSpanAttrs) {
77
114
  var hasProblems = false;
78
115
  tr.doc.descendants(function (node, pos) {
79
116
  if (node.type.name === 'table') {
80
117
  // in the unlikely event of having to fix multiple tables at the same time
81
- hasProblems = removeExtraneousColumnWidths(node, tr.mapping.map(pos), tr);
118
+ hasProblems = removeExtraneousColumnWidths(node, tr.mapping.map(pos), tr, reportInvalidTableCellSpanAttrs);
82
119
  }
83
120
  });
84
121
 
@@ -147,8 +147,9 @@ var FloatingContextualButtonInner = /*#__PURE__*/function (_React$Component) {
147
147
  title: labelCellOptions,
148
148
  onClick: this.handleClick,
149
149
  iconBefore: /*#__PURE__*/_react.default.createElement(_chevronDown.default, {
150
- label: labelCellOptions
151
- })
150
+ label: ""
151
+ }),
152
+ "aria-label": labelCellOptions
152
153
  }));
153
154
 
154
155
  var parentSticky = targetCellRef.parentElement && targetCellRef.parentElement.className.indexOf('sticky') > -1;
@@ -491,6 +491,7 @@ var ContextualMenu = /*#__PURE__*/function (_Component) {
491
491
  }
492
492
 
493
493
  return /*#__PURE__*/_react.default.createElement("div", {
494
+ "data-testid": "table-cell-contextual-menu",
494
495
  onMouseLeave: this.closeSubmenu
495
496
  }, /*#__PURE__*/_react.default.createElement(_DropdownMenu.default, {
496
497
  mountTo: mountPoint,
@@ -30,7 +30,7 @@ var _uiStyles = require("./ui-styles.css");
30
30
  var _templateObject, _templateObject2, _templateObject3;
31
31
 
32
32
  var rangeSelectionStyles = "\n.".concat(_types.TableCssClassName.NODEVIEW_WRAPPER, ".").concat(_editorSharedStyles.akEditorSelectedNodeClassName, " table tbody tr {\n th,td {\n ").concat((0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket, _editorSharedStyles.SelectionStyle.Border]), "\n }\n}\n");
33
- var sentinelStyles = ".".concat(_types.TableCssClassName.TABLE_CONTAINER, " {\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, ", > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n position: absolute;\n width: 100%;\n height: 0px;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: ").concat(_consts.columnControlsDecorationHeight, "px;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n bottom: ").concat(_consts.tableScrollbarOffset + _consts.stickyRowOffsetTop + _consts.tablePadding * 2 + 23, "px;\n }\n &.").concat(_types.TableCssClassName.WITH_CONTROLS, " {\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: 0px;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n margin-bottom: ").concat(_consts.columnControlsDecorationHeight, "px;\n }\n }\n}");
33
+ var sentinelStyles = ".".concat(_types.TableCssClassName.TABLE_CONTAINER, " {\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, ", > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n position: absolute;\n width: 100%;\n height: 1px;\n margin-top: -1px;\n // need this to avoid sentinel being focused via keyboard\n // this still allows it to be detected by intersection observer\n visibility: hidden;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: ").concat(_consts.columnControlsDecorationHeight, "px;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n bottom: ").concat(_consts.tableScrollbarOffset + _consts.stickyRowOffsetTop + _consts.tablePadding * 2 + 23, "px;\n }\n &.").concat(_types.TableCssClassName.WITH_CONTROLS, " {\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: 0px;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n margin-bottom: ").concat(_consts.columnControlsDecorationHeight, "px;\n }\n }\n}");
34
34
  var tableStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: white !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n td.", ", th.", " {\n position: relative;\n overflow: visible;\n }\n\n td.", " {\n background-color: ", ";\n }\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", "\n }\n\n /* Delete button*/\n ", "\n /* Ends Delete button*/\n\n /* sticky styles */\n .", " .", " .", ":first-child {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n\n box-shadow: 0px -", "px white;\n border-right: 0 none;\n /* top set by NumberColumn component */\n }\n\n .", " .", ".sticky {\n position: fixed !important;\n /* needs to be above row controls */\n z-index: ", " !important;\n background: white;\n\n width: ", "px;\n height: ", "px;\n }\n\n .", ".sticky .", " {\n border-bottom: 0px none;\n border-right: 0px none;\n\n height: ", "px;\n width: ", "px;\n }\n\n .", " .", " {\n z-index: 0;\n }\n\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid white;\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid green;\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection */\n z-index: ", ";\n\n overflow-y: visible;\n overflow-x: hidden;\n\n grid-auto-flow: column;\n\n /* background for where controls apply */\n background: white;\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: 0 6px 4px -4px ", ";\n margin-left: -1px;\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\n z-index: ", ";\n }\n\n .", ".", "\n .", " {\n padding-bottom: ", "px;\n }\n\n tr.sticky th {\n border-bottom: ", "px solid\n ", ";\n margin-right: -1px;\n }\n\n .", " tr.sticky > th:last-child {\n border-right-width: 1px;\n }\n\n /* add left edge for first cell */\n .", " tr.sticky > th:first-child {\n margin-left: 0px;\n }\n\n /* add a little bit so the scroll lines up with the table */\n .", " tr.sticky::after {\n content: ' ';\n width: 1px;\n }\n\n /* To fix jumpiness caused in Chrome Browsers for sticky headers */\n .", " .sticky + tr {\n min-height: 0px;\n }\n\n /* move resize line a little in sticky bar */\n .", ".", " {\n tr.sticky\n td.", ",\n tr.sticky\n th.", " {\n .", "::after {\n right: ", "px;\n }\n }\n\n /* when selected put it back to normal -- :not selector would be nicer */\n tr.sticky\n td.", ".", ",\n tr.sticky\n th.", ".", " {\n .", "::after {\n right: ", "px;\n }\n }\n }\n\n tr.sticky\n .", ",\n tr.sticky\n .", " {\n z-index: 1;\n }\n\n .", " tr.sticky {\n padding-top: ", "px;\n }\n\n .", ".", "\n .", "\n .", ":first-child {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid white;\n }\n\n ", "\n\n ", "\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level */\n > * .", " .", " {\n margin-left: unset !important;\n width: 100% !important;\n }\n\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: 1px;\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", " {\n cursor: pointer;\n }\n .", ":hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n\n .", " + * {\n margin-top: 0;\n }\n\n .", ", .", " {\n position: relative;\n }\n /* Give selected cells a blue overlay */\n .", "::after,\n .", "::after {\n z-index: ", ";\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n opacity: 0.3;\n pointer-events: none;\n }\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n }\n th.", "::after,\n td.", "::after {\n background: ", ";\n }\n }\n .", " {\n position: absolute;\n top: ", "px;\n }\n .", ".", " {\n z-index: ", ";\n }\n .", " {\n left: -", "px;\n }\n .", " {\n /* \n compensating for half of the insert column button\n that is aligned to the right edge initially on hover of the top right column control when table overflown,\n its center should be aligned with the edge\n */\n padding-right: ", "px;\n margin-right: -", "px;\n padding-top: ", "px;\n margin-top: -", "px;\n padding-bottom: ", "px;\n margin-bottom: -", "px;\n /* fixes gap cursor height */\n overflow: auto;\n position: relative;\n }\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n"])), _types.TableCssClassName.LAYOUT_BUTTON, _colors.N20A, _colors.N300, _types.TableCssClassName.LAYOUT_BUTTON, _types.TableCssClassName.IS_RESIZING, _colors.B300, _editorCommon.tableSharedStyle, _uiStyles.columnControlsLineMarker, _uiStyles.hoveredDeleteButton, _uiStyles.hoveredCell, _uiStyles.hoveredWarningCell, _uiStyles.resizeHandle, rangeSelectionStyles, _types.TableCssClassName.LAST_ITEM_IN_CELL, _types.TableCssClassName.TABLE_NODE_WRAPPER, _types.TableCssClassName.TABLE_CELL, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.TABLE_CELL, _consts.tableCellBackgroundColor, _types.TableCssClassName.CONTROLS_FLOATING_BUTTON_COLUMN, _uiStyles.insertColumnButtonWrapper, _types.TableCssClassName.CONTROLS_FLOATING_BUTTON_ROW, _uiStyles.insertRowButtonWrapper, _uiStyles.DeleteButton, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.stickyRowOffsetTop + 2, _editorSharedStyles.akEditorTableNumberColumnWidth, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.stickyRowOffsetTop, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.CORNER_CONTROLS, _editorSharedStyles.akEditorSmallZIndex, _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.TABLE_STICKY, _consts.stickyRowOffsetTop, _consts.stickyRowZIndex, _colors.N40A, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.stickyRowZIndex + 1, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.tableToolbarSize, _consts.stickyHeaderBorderBottomWidth, _consts.tableBorderColor, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, (_consts.resizeHandlerAreaWidth - _consts.resizeLineWidth) / 2 + 1, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, (_consts.resizeHandlerAreaWidth - _consts.resizeLineWidth) / 2, _types.TableCssClassName.HOVERED_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.WITH_CONTROLS, _consts.tableControlsSpacing, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.tableControlsSpacing + 2, _types.TableCssClassName.CORNER_CONTROLS, _consts.tableControlsSpacing - _consts.tableToolbarSize + 2, function (props) {
35
35
  var _props$featureFlags;
36
36
 
@@ -48,7 +48,7 @@ var tableBorderSelectedColor = _colors.B300;
48
48
  exports.tableBorderSelectedColor = tableBorderSelectedColor;
49
49
  var tableCellDeleteColor = _colors.R50;
50
50
  exports.tableCellDeleteColor = tableCellDeleteColor;
51
- var tableBorderDeleteColor = _colors.R300;
51
+ var tableBorderDeleteColor = _colors.R400;
52
52
  exports.tableBorderDeleteColor = tableBorderDeleteColor;
53
53
  var tableToolbarDeleteColor = _colors.R75;
54
54
  exports.tableToolbarDeleteColor = tableToolbarDeleteColor;
@@ -40,7 +40,7 @@ var _default = (0, _reactIntl.defineMessages)({
40
40
  },
41
41
  confirmDeleteLinkedModalMessage: {
42
42
  id: 'fabric.editor.tables.confirmDeleteLinkedModalMessage',
43
- defaultMessage: 'Removing this table will also remove all of the data contained in any connected charts.',
43
+ defaultMessage: 'Removing this table will break all the charts connected to it.',
44
44
  description: 'Message for confirm modal when deleting a table linked to an extension.'
45
45
  }
46
46
  });
@@ -87,7 +87,7 @@ var Decision = /*#__PURE__*/function (_ReactNodeView) {
87
87
  value: function update(node, decorations) {
88
88
  var _this = this;
89
89
 
90
- return (0, _get2.default)((0, _getPrototypeOf2.default)(Decision.prototype), "update", this).call(this, node, decorations, // Toggle the placeholder based on whether user input exists.
90
+ return (0, _get2.default)((0, _getPrototypeOf2.default)(Decision.prototype), "update", this).call(this, node, decorations, undefined, // Toggle the placeholder based on whether user input exists.
91
91
  function (_currentNode, _newNode) {
92
92
  return !_this.isContentEmpty(_newNode);
93
93
  });
@@ -170,7 +170,7 @@ var Task = /*#__PURE__*/function (_ReactNodeView) {
170
170
  value: function update(node, decorations) {
171
171
  var _this3 = this;
172
172
 
173
- return (0, _get2.default)((0, _getPrototypeOf2.default)(Task.prototype), "update", this).call(this, node, decorations, function (currentNode, newNode) {
173
+ return (0, _get2.default)((0, _getPrototypeOf2.default)(Task.prototype), "update", this).call(this, node, decorations, undefined, function (currentNode, newNode) {
174
174
  return (// Toggle the placeholder based on whether user input exists
175
175
  !_this3.isContentEmpty(newNode) && !!(currentNode.attrs.state === newNode.attrs.state)
176
176
  );
@@ -162,9 +162,9 @@ function createPlugin(portalProviderAPI, eventDispatcher, providerFactory, dispa
162
162
  rest = (0, _objectWithoutProperties2.default)(_node$attrs, ["localId"]);
163
163
 
164
164
  if (localId === undefined || localId === null || localId === '') {
165
- tr.setNodeMarkup(pos, undefined, _objectSpread({
165
+ tr.step(new _utils.SetAttrsStep(pos, _objectSpread({
166
166
  localId: _adfSchema.uuid.generate()
167
- }, rest));
167
+ }, rest)));
168
168
  modified = true;
169
169
  }
170
170
  }
@@ -267,7 +267,8 @@ var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
267
267
  onClick: function onClick(color) {
268
268
  return _this2.changeTextColor(color, pluginState.disabled);
269
269
  },
270
- selectedColor: pluginState.color
270
+ selectedColor: pluginState.color,
271
+ isShowingMoreColors: isShowingMoreColors
271
272
  })), showMoreColorsToggle && /*#__PURE__*/_react.default.createElement(_styles2.ShowMoreWrapper, null, /*#__PURE__*/_react.default.createElement(_customThemeButton.default, {
272
273
  appearance: "subtle",
273
274
  onClick: this.handleShowMoreToggle,
@@ -107,7 +107,8 @@ var textFormatting = function textFormatting() {
107
107
  disabled = _ref6.disabled;
108
108
  return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
109
109
  plugins: {
110
- textFormattingState: _main.pluginKey
110
+ textFormattingState: _main.pluginKey,
111
+ clearFormattingPluginState: _clearFormatting.pluginKey
111
112
  },
112
113
  render: function render() {
113
114
  return /*#__PURE__*/_react.default.createElement(_Toolbar.default, {
@@ -35,6 +35,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
35
35
 
36
36
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
37
37
 
38
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
38
39
  var ITEM_PADDING = 12;
39
40
  var LIST_ITEM_ESTIMATED_HEIGHT = _TypeAheadListItem.ICON_HEIGHT + ITEM_PADDING * 2;
40
41
  var LIST_MAX_HEIGHT = 380;