@atlaskit/editor-core 166.0.2 → 167.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 (548) hide show
  1. package/.eslintrc.js +46 -1
  2. package/CHANGELOG.md +99 -0
  3. package/dist/cjs/actions/index.js +26 -2
  4. package/dist/cjs/create-editor/ReactEditorView.js +2 -0
  5. package/dist/cjs/create-editor/create-plugins-list.js +1 -2
  6. package/dist/cjs/editor.js +5 -2
  7. package/dist/cjs/keymaps/index.js +5 -1
  8. package/dist/cjs/labs/next/ContentComponents.js +8 -4
  9. package/dist/cjs/labs/next/full-page.js +14 -8
  10. package/dist/cjs/nodeviews/getInlineNodeViewProducer.js +7 -3
  11. package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +3 -1
  12. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/styles.js +3 -1
  13. package/dist/cjs/plugins/analytics/types/enums.js +3 -0
  14. package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +2 -2
  15. package/dist/cjs/plugins/annotation/pm-plugins/plugin-factory.js +0 -1
  16. package/dist/cjs/plugins/base/index.js +8 -17
  17. package/dist/cjs/plugins/base/pm-plugins/better-type-history.js +3 -12
  18. package/dist/cjs/plugins/base/pm-plugins/inline-cursor-target.js +71 -16
  19. package/dist/cjs/plugins/block-type/commands/block-type.js +32 -22
  20. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +4 -2
  21. package/dist/cjs/plugins/breakout/ui/LayoutButton.js +4 -11
  22. package/dist/cjs/plugins/card/styles.js +1 -1
  23. package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
  24. package/dist/cjs/plugins/code-block/actions.js +36 -2
  25. package/dist/cjs/plugins/code-block/nodeviews/code-block.js +70 -1
  26. package/dist/cjs/plugins/code-block/pm-plugins/actions.js +2 -1
  27. package/dist/cjs/plugins/code-block/pm-plugins/main.js +46 -8
  28. package/dist/cjs/plugins/code-block/styles.js +28 -24
  29. package/dist/cjs/plugins/collab-edit/index.js +2 -2
  30. package/dist/cjs/plugins/collab-edit/provider/channel.js +2 -2
  31. package/dist/cjs/plugins/collab-edit/styles.js +4 -2
  32. package/dist/cjs/plugins/collab-edit/ui/styles.js +4 -2
  33. package/dist/cjs/plugins/collab-edit/utils.js +1 -0
  34. package/dist/cjs/plugins/date/ui/DatePicker/index.js +3 -1
  35. package/dist/cjs/plugins/expand/ui/styles.js +16 -14
  36. package/dist/cjs/plugins/extension/commands.js +3 -2
  37. package/dist/cjs/plugins/extension/context-panel.js +23 -9
  38. package/dist/cjs/plugins/extension/plugin-factory.js +1 -4
  39. package/dist/cjs/plugins/extension/pm-plugins/main.js +13 -36
  40. package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +6 -4
  41. package/dist/cjs/plugins/extension/ui/Extension/InlineExtension/styles.js +3 -1
  42. package/dist/cjs/plugins/extension/ui/Extension/styles.js +7 -5
  43. package/dist/cjs/plugins/extension/ui/SaveIndicator/SaveIndicator.js +4 -2
  44. package/dist/cjs/plugins/extension/utils.js +12 -57
  45. package/dist/cjs/plugins/fake-text-cursor/styles.js +3 -1
  46. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
  47. package/dist/cjs/plugins/feedback-dialog/index.js +0 -1
  48. package/dist/cjs/plugins/find-replace/styles.js +2 -6
  49. package/dist/cjs/plugins/find-replace/ui/styles.js +4 -2
  50. package/dist/cjs/plugins/find-replace/utils/batch-decorations.js +0 -1
  51. package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +3 -1
  52. package/dist/cjs/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +3 -1
  53. package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +2 -2
  54. package/dist/cjs/plugins/floating-toolbar/ui/Separator.js +3 -1
  55. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +6 -4
  56. package/dist/cjs/plugins/floating-toolbar/ui/styles.js +12 -10
  57. package/dist/cjs/plugins/grid/styles.js +3 -1
  58. package/dist/cjs/plugins/help-dialog/ui/styles.js +9 -7
  59. package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +23 -1
  60. package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +10 -1
  61. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -5
  62. package/dist/cjs/plugins/hyperlink/utils.js +53 -2
  63. package/dist/cjs/plugins/jira-issue/nodeviews/jira-issue.js +4 -2
  64. package/dist/cjs/plugins/layout/styles.js +1 -1
  65. package/dist/cjs/plugins/macro/actions.js +2 -2
  66. package/dist/cjs/plugins/media/commands/helpers.js +10 -9
  67. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +25 -6
  68. package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +6 -0
  69. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
  70. package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -3
  71. package/dist/cjs/plugins/media/pm-plugins/main.js +1 -0
  72. package/dist/cjs/plugins/media/styles.js +1 -1
  73. package/dist/cjs/plugins/media/ui/CaptionPlaceholder/index.js +3 -1
  74. package/dist/cjs/plugins/media/ui/Media/DropPlaceholder.js +4 -2
  75. package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +3 -1
  76. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
  77. package/dist/cjs/plugins/mentions/styles.js +3 -1
  78. package/dist/cjs/plugins/mentions/ui/InviteItem/index.js +3 -1
  79. package/dist/cjs/plugins/mentions/ui/InviteItem/styles.js +4 -2
  80. package/dist/cjs/plugins/panel/index.js +1 -0
  81. package/dist/cjs/plugins/panel/nodeviews/panel.js +4 -1
  82. package/dist/cjs/plugins/panel/pm-plugins/keymaps.js +21 -3
  83. package/dist/cjs/plugins/paste/handlers.js +44 -6
  84. package/dist/cjs/plugins/paste/linkify-md-plugin.js +7 -0
  85. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +9 -1
  86. package/dist/cjs/plugins/paste/pm-plugins/main.js +27 -1
  87. package/dist/cjs/plugins/placeholder/index.js +15 -3
  88. package/dist/cjs/plugins/placeholder/styles.js +3 -1
  89. package/dist/cjs/plugins/placeholder-text/styles.js +3 -1
  90. package/dist/cjs/plugins/selection/gap-cursor/styles.js +1 -1
  91. package/dist/cjs/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
  92. package/dist/cjs/plugins/status/ui/statusPicker.js +3 -3
  93. package/dist/cjs/plugins/table/index.js +14 -4
  94. package/dist/cjs/plugins/table/nodeviews/TableComponent.js +6 -6
  95. package/dist/cjs/plugins/table/nodeviews/table.js +9 -4
  96. package/dist/cjs/plugins/table/pm-plugins/main.js +1 -4
  97. package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +118 -0
  98. package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
  99. package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin.js +2 -5
  100. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +4 -8
  101. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
  102. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
  103. package/dist/cjs/plugins/table/transforms/column-width.js +1 -2
  104. package/dist/cjs/plugins/table/transforms/fix-tables.js +1 -3
  105. package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +4 -1
  106. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +3 -1
  107. package/dist/cjs/plugins/table/ui/common-styles.js +4 -2
  108. package/dist/cjs/plugins/table/ui/consts.js +14 -11
  109. package/dist/cjs/plugins/table/ui/ui-styles.js +17 -10
  110. package/dist/cjs/plugins/table/utils/decoration.js +3 -4
  111. package/dist/cjs/plugins/table/utils/paste.js +9 -9
  112. package/dist/cjs/plugins/type-ahead/index.js +4 -3
  113. package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +3 -1
  114. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +4 -4
  115. package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +11 -9
  116. package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +73 -3
  117. package/dist/cjs/plugins/unsupported-content/styles.js +1 -1
  118. package/dist/cjs/ui/Addon/Dropdown/styles.js +3 -1
  119. package/dist/cjs/ui/Addon/DropdownItem/styles.js +3 -1
  120. package/dist/cjs/ui/Appearance/Chromeless.js +2 -1
  121. package/dist/cjs/ui/Appearance/Comment/Comment.js +10 -3
  122. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +4 -2
  123. package/dist/cjs/ui/Appearance/FullPage/FullPage.js +5 -2
  124. package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
  125. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
  126. package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +6 -3
  127. package/dist/cjs/ui/ChromeCollapsed/styles.js +1 -1
  128. package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +23 -16
  129. package/dist/cjs/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
  130. package/dist/cjs/ui/ConfigPanel/Fields/CheckboxGroup.js +3 -1
  131. package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +2 -2
  132. package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +3 -1
  133. package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +3 -1
  134. package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +2 -2
  135. package/dist/cjs/ui/ConfigPanel/Fields/common/RequiredIndicator.js +3 -1
  136. package/dist/cjs/ui/ConfigPanel/Header.js +4 -2
  137. package/dist/cjs/ui/ConfigPanel/NestedForms/RemovableField.js +4 -8
  138. package/dist/cjs/ui/ConfigPanel/transformers.js +2 -2
  139. package/dist/cjs/ui/ContentStyles/index.js +4 -2
  140. package/dist/cjs/ui/ContextPanel/index.js +3 -1
  141. package/dist/cjs/ui/DropdownMenu/index.js +5 -0
  142. package/dist/cjs/ui/ElementBrowser/InsertMenu.js +6 -4
  143. package/dist/cjs/ui/ElementBrowser/ModalElementBrowser.js +4 -2
  144. package/dist/cjs/ui/ElementBrowser/components/CategoryList.js +4 -2
  145. package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +12 -5
  146. package/dist/cjs/ui/ElementBrowser/components/ElementList/EmptyState.js +3 -1
  147. package/dist/cjs/ui/ElementBrowser/components/ElementSearch.js +3 -1
  148. package/dist/cjs/ui/ElementBrowser/constants.js +3 -1
  149. package/dist/cjs/ui/FloatingToolbar/styles.js +2 -2
  150. package/dist/cjs/ui/LinkSearch/LinkSearchListItem.js +5 -3
  151. package/dist/cjs/ui/PanelTextInput/styles.js +3 -1
  152. package/dist/cjs/ui/PluginSlot/index.js +7 -4
  153. package/dist/cjs/ui/Toolbar/ToolbarInner.js +2 -1
  154. package/dist/cjs/ui/Toolbar/ToolbarWithSizeDetector.js +5 -2
  155. package/dist/cjs/ui/ToolbarFeedback/styles.js +5 -3
  156. package/dist/cjs/ui/WithFlash/index.js +4 -2
  157. package/dist/cjs/ui/styles.js +6 -4
  158. package/dist/cjs/utils/document.js +62 -6
  159. package/dist/cjs/utils/filter/privacy-filter.js +2 -2
  160. package/dist/cjs/utils/step.js +17 -1
  161. package/dist/cjs/version-wrapper.js +1 -1
  162. package/dist/cjs/version.json +1 -1
  163. package/dist/es2019/actions/index.js +25 -1
  164. package/dist/es2019/create-editor/ReactEditorView.js +2 -0
  165. package/dist/es2019/create-editor/create-plugins-list.js +1 -2
  166. package/dist/es2019/editor.js +5 -2
  167. package/dist/es2019/keymaps/index.js +5 -1
  168. package/dist/es2019/labs/next/ContentComponents.js +7 -2
  169. package/dist/es2019/labs/next/full-page.js +11 -8
  170. package/dist/es2019/nodeviews/getInlineNodeViewProducer.js +4 -3
  171. package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +16 -4
  172. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/styles.js +2 -1
  173. package/dist/es2019/plugins/analytics/types/enums.js +3 -0
  174. package/dist/es2019/plugins/base/index.js +6 -15
  175. package/dist/es2019/plugins/base/pm-plugins/better-type-history.js +1 -11
  176. package/dist/es2019/plugins/base/pm-plugins/inline-cursor-target.js +72 -17
  177. package/dist/es2019/plugins/block-type/commands/block-type.js +25 -16
  178. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -2
  179. package/dist/es2019/plugins/breakout/ui/LayoutButton.js +6 -10
  180. package/dist/es2019/plugins/card/styles.js +1 -1
  181. package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
  182. package/dist/es2019/plugins/code-block/actions.js +32 -0
  183. package/dist/es2019/plugins/code-block/nodeviews/code-block.js +61 -1
  184. package/dist/es2019/plugins/code-block/pm-plugins/actions.js +2 -1
  185. package/dist/es2019/plugins/code-block/pm-plugins/main.js +37 -3
  186. package/dist/es2019/plugins/code-block/styles.js +30 -27
  187. package/dist/es2019/plugins/collab-edit/styles.js +3 -2
  188. package/dist/es2019/plugins/collab-edit/ui/styles.js +4 -3
  189. package/dist/es2019/plugins/collab-edit/utils.js +1 -0
  190. package/dist/es2019/plugins/date/ui/DatePicker/index.js +3 -2
  191. package/dist/es2019/plugins/expand/ui/styles.js +15 -14
  192. package/dist/es2019/plugins/extension/commands.js +3 -2
  193. package/dist/es2019/plugins/extension/context-panel.js +11 -3
  194. package/dist/es2019/plugins/extension/plugin-factory.js +1 -3
  195. package/dist/es2019/plugins/extension/pm-plugins/main.js +12 -38
  196. package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +5 -4
  197. package/dist/es2019/plugins/extension/ui/Extension/InlineExtension/styles.js +2 -1
  198. package/dist/es2019/plugins/extension/ui/Extension/styles.js +7 -6
  199. package/dist/es2019/plugins/extension/ui/SaveIndicator/SaveIndicator.js +4 -4
  200. package/dist/es2019/plugins/extension/utils.js +2 -37
  201. package/dist/es2019/plugins/fake-text-cursor/styles.js +3 -2
  202. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
  203. package/dist/es2019/plugins/find-replace/styles.js +4 -4
  204. package/dist/es2019/plugins/find-replace/ui/styles.js +3 -2
  205. package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
  206. package/dist/es2019/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +2 -1
  207. package/dist/es2019/plugins/floating-toolbar/ui/Separator.js +2 -1
  208. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +4 -4
  209. package/dist/es2019/plugins/floating-toolbar/ui/styles.js +11 -10
  210. package/dist/es2019/plugins/grid/styles.js +4 -2
  211. package/dist/es2019/plugins/help-dialog/ui/styles.js +10 -9
  212. package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +24 -2
  213. package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +9 -1
  214. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +5 -4
  215. package/dist/es2019/plugins/hyperlink/utils.js +43 -2
  216. package/dist/es2019/plugins/jira-issue/nodeviews/jira-issue.js +6 -5
  217. package/dist/es2019/plugins/layout/styles.js +10 -7
  218. package/dist/es2019/plugins/media/commands/helpers.js +6 -8
  219. package/dist/es2019/plugins/media/nodeviews/mediaInline.js +21 -5
  220. package/dist/es2019/plugins/media/nodeviews/mediaNodeView/media.js +7 -0
  221. package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -4
  222. package/dist/es2019/plugins/media/pm-plugins/main.js +2 -0
  223. package/dist/es2019/plugins/media/styles.js +3 -3
  224. package/dist/es2019/plugins/media/ui/CaptionPlaceholder/index.js +2 -1
  225. package/dist/es2019/plugins/media/ui/Media/DropPlaceholder.js +4 -3
  226. package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +2 -1
  227. package/dist/es2019/plugins/mentions/styles.js +5 -4
  228. package/dist/es2019/plugins/mentions/ui/InviteItem/index.js +2 -1
  229. package/dist/es2019/plugins/mentions/ui/InviteItem/styles.js +3 -2
  230. package/dist/es2019/plugins/panel/index.js +1 -0
  231. package/dist/es2019/plugins/panel/nodeviews/panel.js +4 -1
  232. package/dist/es2019/plugins/panel/pm-plugins/keymaps.js +22 -4
  233. package/dist/es2019/plugins/paste/handlers.js +45 -7
  234. package/dist/es2019/plugins/paste/linkify-md-plugin.js +7 -1
  235. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +4 -1
  236. package/dist/es2019/plugins/paste/pm-plugins/main.js +27 -2
  237. package/dist/es2019/plugins/placeholder/index.js +12 -1
  238. package/dist/es2019/plugins/placeholder/styles.js +3 -1
  239. package/dist/es2019/plugins/placeholder-text/styles.js +5 -4
  240. package/dist/es2019/plugins/selection/gap-cursor/styles.js +9 -9
  241. package/dist/es2019/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
  242. package/dist/es2019/plugins/status/ui/statusPicker.js +3 -3
  243. package/dist/es2019/plugins/table/index.js +13 -4
  244. package/dist/es2019/plugins/table/nodeviews/TableComponent.js +6 -6
  245. package/dist/es2019/plugins/table/nodeviews/table.js +6 -2
  246. package/dist/es2019/plugins/table/pm-plugins/main.js +1 -4
  247. package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +106 -0
  248. package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
  249. package/dist/es2019/plugins/table/pm-plugins/table-resizing/plugin.js +2 -4
  250. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +3 -7
  251. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
  252. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
  253. package/dist/es2019/plugins/table/transforms/column-width.js +1 -2
  254. package/dist/es2019/plugins/table/transforms/fix-tables.js +1 -3
  255. package/dist/es2019/plugins/table/ui/FloatingContextualButton/styles.js +4 -2
  256. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/styles.js +4 -3
  257. package/dist/es2019/plugins/table/ui/common-styles.js +29 -27
  258. package/dist/es2019/plugins/table/ui/consts.js +15 -12
  259. package/dist/es2019/plugins/table/ui/ui-styles.js +28 -23
  260. package/dist/es2019/plugins/table/utils/decoration.js +1 -4
  261. package/dist/es2019/plugins/table/utils/paste.js +9 -9
  262. package/dist/es2019/plugins/type-ahead/index.js +4 -3
  263. package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +2 -1
  264. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +4 -4
  265. package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +10 -9
  266. package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +64 -6
  267. package/dist/es2019/plugins/unsupported-content/styles.js +1 -1
  268. package/dist/es2019/ui/Addon/Dropdown/styles.js +3 -2
  269. package/dist/es2019/ui/Addon/DropdownItem/styles.js +3 -2
  270. package/dist/es2019/ui/Appearance/Chromeless.js +2 -1
  271. package/dist/es2019/ui/Appearance/Comment/Comment.js +9 -4
  272. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +4 -2
  273. package/dist/es2019/ui/Appearance/FullPage/FullPage.js +6 -2
  274. package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
  275. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
  276. package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +7 -3
  277. package/dist/es2019/ui/ChromeCollapsed/styles.js +4 -3
  278. package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +10 -2
  279. package/dist/es2019/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
  280. package/dist/es2019/ui/ConfigPanel/ErrorMessage/ErrorImage.js +3 -0
  281. package/dist/es2019/ui/ConfigPanel/Fields/CheckboxGroup.js +2 -1
  282. package/dist/es2019/ui/ConfigPanel/Fields/Expand.js +2 -1
  283. package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +2 -1
  284. package/dist/es2019/ui/ConfigPanel/Fields/common/RequiredIndicator.js +2 -1
  285. package/dist/es2019/ui/ConfigPanel/Header.js +3 -2
  286. package/dist/es2019/ui/ConfigPanel/NestedForms/RemovableField.js +4 -3
  287. package/dist/es2019/ui/ContentStyles/index.js +3 -2
  288. package/dist/es2019/ui/ContextPanel/index.js +2 -1
  289. package/dist/es2019/ui/DropdownMenu/index.js +5 -0
  290. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +6 -3
  291. package/dist/es2019/ui/ElementBrowser/ModalElementBrowser.js +3 -2
  292. package/dist/es2019/ui/ElementBrowser/components/CategoryList.js +3 -2
  293. package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +12 -5
  294. package/dist/es2019/ui/ElementBrowser/components/ElementList/EmptyState.js +2 -1
  295. package/dist/es2019/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +3 -0
  296. package/dist/es2019/ui/ElementBrowser/components/ElementSearch.js +2 -1
  297. package/dist/es2019/ui/ElementBrowser/constants.js +3 -1
  298. package/dist/es2019/ui/FloatingToolbar/styles.js +4 -4
  299. package/dist/es2019/ui/LinkSearch/LinkSearchListItem.js +4 -3
  300. package/dist/es2019/ui/PanelTextInput/styles.js +5 -5
  301. package/dist/es2019/ui/PluginSlot/index.js +7 -4
  302. package/dist/es2019/ui/Toolbar/ToolbarInner.js +2 -1
  303. package/dist/es2019/ui/Toolbar/ToolbarWithSizeDetector.js +4 -2
  304. package/dist/es2019/ui/ToolbarFeedback/styles.js +5 -4
  305. package/dist/es2019/ui/WithFlash/index.js +4 -3
  306. package/dist/es2019/ui/styles.js +10 -9
  307. package/dist/es2019/utils/document.js +58 -5
  308. package/dist/es2019/utils/filter/privacy-filter.js +1 -1
  309. package/dist/es2019/utils/step.js +12 -1
  310. package/dist/es2019/version-wrapper.js +1 -1
  311. package/dist/es2019/version.json +1 -1
  312. package/dist/esm/actions/index.js +27 -2
  313. package/dist/esm/create-editor/ErrorBoundary.js +1 -1
  314. package/dist/esm/create-editor/ReactEditorView.js +2 -0
  315. package/dist/esm/create-editor/create-plugins-list.js +1 -2
  316. package/dist/esm/editor.js +6 -4
  317. package/dist/esm/keymaps/index.js +5 -1
  318. package/dist/esm/labs/next/ContentComponents.js +8 -4
  319. package/dist/esm/labs/next/full-page.js +11 -8
  320. package/dist/esm/nodeviews/getInlineNodeViewProducer.js +4 -3
  321. package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +3 -2
  322. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/styles.js +2 -1
  323. package/dist/esm/plugins/analytics/types/enums.js +3 -0
  324. package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +1 -1
  325. package/dist/esm/plugins/annotation/pm-plugins/plugin-factory.js +0 -1
  326. package/dist/esm/plugins/base/index.js +8 -17
  327. package/dist/esm/plugins/base/pm-plugins/better-type-history.js +1 -11
  328. package/dist/esm/plugins/base/pm-plugins/inline-cursor-target.js +72 -17
  329. package/dist/esm/plugins/block-type/commands/block-type.js +31 -22
  330. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -2
  331. package/dist/esm/plugins/breakout/ui/LayoutButton.js +3 -5
  332. package/dist/esm/plugins/card/styles.js +1 -1
  333. package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
  334. package/dist/esm/plugins/code-block/actions.js +28 -0
  335. package/dist/esm/plugins/code-block/nodeviews/code-block.js +67 -1
  336. package/dist/esm/plugins/code-block/pm-plugins/actions.js +2 -1
  337. package/dist/esm/plugins/code-block/pm-plugins/main.js +39 -3
  338. package/dist/esm/plugins/code-block/styles.js +27 -23
  339. package/dist/esm/plugins/collab-edit/index.js +1 -1
  340. package/dist/esm/plugins/collab-edit/provider/channel.js +1 -1
  341. package/dist/esm/plugins/collab-edit/styles.js +3 -2
  342. package/dist/esm/plugins/collab-edit/ui/styles.js +3 -2
  343. package/dist/esm/plugins/collab-edit/utils.js +2 -0
  344. package/dist/esm/plugins/custom-autoformat/doc.js +1 -1
  345. package/dist/esm/plugins/custom-autoformat/index.js +1 -1
  346. package/dist/esm/plugins/date/ui/DatePicker/index.js +2 -1
  347. package/dist/esm/plugins/expand/ui/styles.js +15 -14
  348. package/dist/esm/plugins/extension/actions.js +1 -1
  349. package/dist/esm/plugins/extension/commands.js +3 -2
  350. package/dist/esm/plugins/extension/context-panel.js +22 -8
  351. package/dist/esm/plugins/extension/plugin-factory.js +1 -3
  352. package/dist/esm/plugins/extension/pm-plugins/main.js +12 -35
  353. package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +5 -4
  354. package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +1 -1
  355. package/dist/esm/plugins/extension/ui/Extension/InlineExtension/styles.js +2 -1
  356. package/dist/esm/plugins/extension/ui/Extension/styles.js +6 -5
  357. package/dist/esm/plugins/extension/ui/SaveIndicator/SaveIndicator.js +3 -2
  358. package/dist/esm/plugins/extension/utils.js +9 -51
  359. package/dist/esm/plugins/fake-text-cursor/styles.js +2 -1
  360. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
  361. package/dist/esm/plugins/feedback-dialog/index.js +1 -2
  362. package/dist/esm/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +1 -1
  363. package/dist/esm/plugins/find-replace/styles.js +3 -3
  364. package/dist/esm/plugins/find-replace/ui/styles.js +3 -2
  365. package/dist/esm/plugins/find-replace/utils/batch-decorations.js +1 -2
  366. package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
  367. package/dist/esm/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +2 -1
  368. package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -1
  369. package/dist/esm/plugins/floating-toolbar/ui/Separator.js +2 -1
  370. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +5 -4
  371. package/dist/esm/plugins/floating-toolbar/ui/styles.js +11 -10
  372. package/dist/esm/plugins/grid/styles.js +2 -1
  373. package/dist/esm/plugins/help-dialog/ui/styles.js +8 -7
  374. package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -1
  375. package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +24 -2
  376. package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +9 -1
  377. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +5 -5
  378. package/dist/esm/plugins/hyperlink/utils.js +44 -2
  379. package/dist/esm/plugins/image-upload/pm-plugins/main.js +1 -1
  380. package/dist/esm/plugins/jira-issue/nodeviews/jira-issue.js +3 -2
  381. package/dist/esm/plugins/layout/styles.js +1 -1
  382. package/dist/esm/plugins/macro/actions.js +1 -1
  383. package/dist/esm/plugins/media/commands/helpers.js +6 -8
  384. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +1 -1
  385. package/dist/esm/plugins/media/nodeviews/mediaInline.js +23 -6
  386. package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +1 -1
  387. package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +8 -1
  388. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
  389. package/dist/esm/plugins/media/picker-facade.js +1 -1
  390. package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +4 -3
  391. package/dist/esm/plugins/media/pm-plugins/main.js +3 -1
  392. package/dist/esm/plugins/media/styles.js +1 -1
  393. package/dist/esm/plugins/media/toolbar/utils.js +1 -1
  394. package/dist/esm/plugins/media/ui/CaptionPlaceholder/index.js +2 -1
  395. package/dist/esm/plugins/media/ui/Media/DropPlaceholder.js +3 -2
  396. package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +2 -1
  397. package/dist/esm/plugins/media/ui/MediaPicker/PickerFacadeProvider.js +1 -1
  398. package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +1 -1
  399. package/dist/esm/plugins/media/utils/check-media-type.js +1 -1
  400. package/dist/esm/plugins/mentions/styles.js +2 -1
  401. package/dist/esm/plugins/mentions/ui/InviteItem/index.js +2 -1
  402. package/dist/esm/plugins/mentions/ui/InviteItem/styles.js +3 -2
  403. package/dist/esm/plugins/panel/index.js +1 -0
  404. package/dist/esm/plugins/panel/nodeviews/panel.js +4 -1
  405. package/dist/esm/plugins/panel/pm-plugins/keymaps.js +22 -4
  406. package/dist/esm/plugins/paste/handlers.js +44 -8
  407. package/dist/esm/plugins/paste/linkify-md-plugin.js +7 -1
  408. package/dist/esm/plugins/paste/pm-plugins/analytics.js +6 -1
  409. package/dist/esm/plugins/paste/pm-plugins/main.js +28 -3
  410. package/dist/esm/plugins/placeholder/index.js +12 -1
  411. package/dist/esm/plugins/placeholder/styles.js +2 -1
  412. package/dist/esm/plugins/placeholder-text/styles.js +2 -1
  413. package/dist/esm/plugins/quick-insert/index.js +1 -1
  414. package/dist/esm/plugins/selection/gap-cursor/styles.js +1 -1
  415. package/dist/esm/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
  416. package/dist/esm/plugins/status/ui/statusPicker.js +2 -2
  417. package/dist/esm/plugins/table/index.js +13 -4
  418. package/dist/esm/plugins/table/nodeviews/TableComponent.js +6 -6
  419. package/dist/esm/plugins/table/nodeviews/table.js +6 -2
  420. package/dist/esm/plugins/table/pm-plugins/main.js +1 -4
  421. package/dist/esm/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +102 -0
  422. package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
  423. package/dist/esm/plugins/table/pm-plugins/table-resizing/plugin.js +2 -5
  424. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +4 -8
  425. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
  426. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
  427. package/dist/esm/plugins/table/transforms/column-width.js +1 -2
  428. package/dist/esm/plugins/table/transforms/fix-tables.js +1 -3
  429. package/dist/esm/plugins/table/ui/FloatingContextualButton/styles.js +3 -1
  430. package/dist/esm/plugins/table/ui/FloatingContextualMenu/styles.js +2 -1
  431. package/dist/esm/plugins/table/ui/common-styles.js +4 -2
  432. package/dist/esm/plugins/table/ui/consts.js +15 -12
  433. package/dist/esm/plugins/table/ui/ui-styles.js +15 -10
  434. package/dist/esm/plugins/table/utils/decoration.js +3 -4
  435. package/dist/esm/plugins/table/utils/paste.js +9 -9
  436. package/dist/esm/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +1 -1
  437. package/dist/esm/plugins/type-ahead/index.js +4 -3
  438. package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +2 -1
  439. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +4 -4
  440. package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +10 -9
  441. package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +71 -5
  442. package/dist/esm/plugins/unsupported-content/styles.js +1 -1
  443. package/dist/esm/ui/Addon/Dropdown/styles.js +2 -1
  444. package/dist/esm/ui/Addon/DropdownItem/styles.js +2 -1
  445. package/dist/esm/ui/Appearance/Chromeless.js +2 -1
  446. package/dist/esm/ui/Appearance/Comment/Comment.js +10 -3
  447. package/dist/esm/ui/Appearance/Comment/Toolbar.js +3 -2
  448. package/dist/esm/ui/Appearance/FullPage/FullPage.js +6 -2
  449. package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
  450. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
  451. package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +5 -3
  452. package/dist/esm/ui/ChromeCollapsed/styles.js +1 -1
  453. package/dist/esm/ui/ConfigPanel/ConfigPanel.js +22 -15
  454. package/dist/esm/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
  455. package/dist/esm/ui/ConfigPanel/ErrorMessage/ErrorImage.js +3 -0
  456. package/dist/esm/ui/ConfigPanel/Fields/CheckboxGroup.js +2 -1
  457. package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +1 -1
  458. package/dist/esm/ui/ConfigPanel/Fields/Expand.js +2 -1
  459. package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +2 -1
  460. package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +1 -1
  461. package/dist/esm/ui/ConfigPanel/Fields/common/RequiredIndicator.js +2 -1
  462. package/dist/esm/ui/ConfigPanel/FormErrorBoundary.js +1 -1
  463. package/dist/esm/ui/ConfigPanel/Header.js +3 -2
  464. package/dist/esm/ui/ConfigPanel/NestedForms/RemovableField.js +3 -2
  465. package/dist/esm/ui/ConfigPanel/transformers.js +1 -1
  466. package/dist/esm/ui/ContentStyles/index.js +3 -2
  467. package/dist/esm/ui/ContextPanel/index.js +2 -1
  468. package/dist/esm/ui/DropdownMenu/index.js +5 -0
  469. package/dist/esm/ui/ElementBrowser/InsertMenu.js +5 -4
  470. package/dist/esm/ui/ElementBrowser/ModalElementBrowser.js +3 -2
  471. package/dist/esm/ui/ElementBrowser/components/CategoryList.js +3 -2
  472. package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +11 -5
  473. package/dist/esm/ui/ElementBrowser/components/ElementList/EmptyState.js +2 -1
  474. package/dist/esm/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +3 -0
  475. package/dist/esm/ui/ElementBrowser/components/ElementSearch.js +2 -1
  476. package/dist/esm/ui/ElementBrowser/constants.js +3 -1
  477. package/dist/esm/ui/FloatingToolbar/styles.js +3 -3
  478. package/dist/esm/ui/LinkSearch/LinkSearchListItem.js +4 -3
  479. package/dist/esm/ui/LinkSearch/index.js +1 -1
  480. package/dist/esm/ui/PanelTextInput/styles.js +4 -3
  481. package/dist/esm/ui/PluginSlot/index.js +7 -4
  482. package/dist/esm/ui/Toolbar/ToolbarInner.js +2 -1
  483. package/dist/esm/ui/Toolbar/ToolbarWithSizeDetector.js +4 -2
  484. package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
  485. package/dist/esm/ui/ToolbarFeedback/styles.js +4 -3
  486. package/dist/esm/ui/WithFlash/index.js +3 -2
  487. package/dist/esm/ui/styles.js +5 -4
  488. package/dist/esm/utils/action.js +1 -1
  489. package/dist/esm/utils/clipboard.js +1 -1
  490. package/dist/esm/utils/document.js +59 -5
  491. package/dist/esm/utils/extensions.js +1 -1
  492. package/dist/esm/utils/filter/privacy-filter.js +1 -1
  493. package/dist/esm/utils/step.js +12 -1
  494. package/dist/esm/version-wrapper.js +1 -1
  495. package/dist/esm/version.json +1 -1
  496. package/dist/types/actions/index.d.ts +6 -0
  497. package/dist/types/labs/next/ContentComponents.d.ts +7 -1
  498. package/dist/types/nodeviews/getInlineNodeViewProducer.d.ts +1 -0
  499. package/dist/types/plugins/analytics/types/enums.d.ts +3 -0
  500. package/dist/types/plugins/analytics/types/general-events.d.ts +7 -1
  501. package/dist/types/plugins/base/pm-plugins/inline-cursor-target.d.ts +1 -1
  502. package/dist/types/plugins/code-block/actions.d.ts +2 -0
  503. package/dist/types/plugins/code-block/nodeviews/code-block.d.ts +2 -0
  504. package/dist/types/plugins/code-block/pm-plugins/actions.d.ts +1 -0
  505. package/dist/types/plugins/code-block/pm-plugins/main-state.d.ts +1 -0
  506. package/dist/types/plugins/extension/commands.d.ts +1 -1
  507. package/dist/types/plugins/extension/pm-plugins/main.d.ts +1 -2
  508. package/dist/types/plugins/extension/types.d.ts +1 -1
  509. package/dist/types/plugins/extension/ui/Extension/Extension/index.d.ts +6 -0
  510. package/dist/types/plugins/extension/utils.d.ts +1 -3
  511. package/dist/types/plugins/find-replace/styles.d.ts +0 -2
  512. package/dist/types/plugins/hyperlink/utils.d.ts +8 -0
  513. package/dist/types/plugins/media/commands/helpers.d.ts +2 -0
  514. package/dist/types/plugins/media/nodeviews/mediaNodeView/media.d.ts +1 -0
  515. package/dist/types/plugins/media/pm-plugins/main.d.ts +2 -1
  516. package/dist/types/plugins/media/pm-plugins/types.d.ts +2 -1
  517. package/dist/types/plugins/paste/handlers.d.ts +1 -0
  518. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +1 -0
  519. package/dist/types/plugins/table/commands/misc.d.ts +0 -1
  520. package/dist/types/plugins/table/index.d.ts +0 -1
  521. package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +1 -0
  522. package/dist/types/plugins/table/nodeviews/types.d.ts +0 -1
  523. package/dist/types/plugins/table/pm-plugins/main.d.ts +1 -1
  524. package/dist/types/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +15 -0
  525. package/dist/types/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +1 -1
  526. package/dist/types/plugins/table/pm-plugins/table-resizing/plugin.d.ts +1 -1
  527. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +1 -2
  528. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
  529. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +0 -1
  530. package/dist/types/plugins/table/transforms/fix-tables.d.ts +0 -1
  531. package/dist/types/plugins/table/types.d.ts +0 -1
  532. package/dist/types/plugins/table/ui/consts.d.ts +9 -9
  533. package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +2 -0
  534. package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +4 -4
  535. package/dist/types/types/editor-appearance-component.d.ts +0 -1
  536. package/dist/types/types/editor-props.d.ts +4 -0
  537. package/dist/types/types/feature-flags.d.ts +8 -0
  538. package/dist/types/types/ui-components.d.ts +1 -0
  539. package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +1 -0
  540. package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +1 -0
  541. package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +3 -2
  542. package/dist/types/ui/ConfigPanel/ConfigPanelFieldsLoader.d.ts +3 -2
  543. package/dist/types/ui/PluginSlot/index.d.ts +1 -0
  544. package/dist/types/ui/Toolbar/toolbar-types.d.ts +1 -0
  545. package/dist/types/utils/document.d.ts +1 -0
  546. package/dist/types/utils/step.d.ts +1 -0
  547. package/docs/0-intro.tsx +12 -4
  548. package/package.json +22 -22
@@ -125,9 +125,7 @@ export var fixAutoSizedTable = function fixAutoSizedTable(view, tableNode, table
125
125
  return acc + current;
126
126
  }, 0);
127
127
  var tableLayout = getLayoutBasedOnWidth(totalContentWidth);
128
- var maxLayoutSize = getLayoutSize(tableLayout, opts.containerWidth, {
129
- dynamicTextSizing: opts.dynamicTextSizing
130
- }); // Content width will generally not meet the constraints of the layout
128
+ var maxLayoutSize = getLayoutSize(tableLayout, opts.containerWidth, {}); // Content width will generally not meet the constraints of the layout
131
129
  // whether it be below or above, so we scale our columns widths
132
130
  // to meet these requirements
133
131
 
@@ -6,4 +6,6 @@ import { css } from '@emotion/react';
6
6
  import { N0, N20 } from '@atlaskit/theme/colors';
7
7
  import { borderRadius } from '@atlaskit/theme/constants';
8
8
  import { contextualMenuTriggerSize } from '../consts';
9
- export var tableFloatingCellButtonStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n > div {\n background: ", ";\n border-radius: ", "px;\n border: 2px solid ", ";\n display: flex;\n height: ", "px;\n flex-direction: column;\n }\n && button {\n flex-direction: column;\n padding: 0;\n height: 100%;\n display: flex;\n }\n && button > span {\n margin: 0px -4px;\n }\n && span {\n pointer-events: none;\n }\n"])), N20, borderRadius(), N0, contextualMenuTriggerSize - 2);
9
+ import { token } from '@atlaskit/tokens'; // TODO: https://product-fabric.atlassian.net/browse/DSP-4462
10
+
11
+ export var tableFloatingCellButtonStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n > div {\n background: ", ";\n border-radius: ", "px;\n border: 2px solid ", ";\n display: flex;\n height: ", "px;\n flex-direction: column;\n }\n && button {\n flex-direction: column;\n padding: 0;\n height: 100%;\n display: flex;\n }\n && button > span {\n margin: 0px -4px;\n }\n && span {\n pointer-events: none;\n }\n"])), token('color.background.neutral', N20), borderRadius(), token('color.border.inverse', N0), contextualMenuTriggerSize - 2);
@@ -8,4 +8,5 @@ import { N60A, N90 } from '@atlaskit/theme/colors';
8
8
  import { contextualMenuDropdownWidth } from '../consts';
9
9
  import { TableCssClassName as ClassName } from '../../types';
10
10
  import { borderRadius } from '@atlaskit/theme/constants';
11
- export var tablePopupStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n border-radius: ", "px;\n background: white;\n box-shadow: 0 4px 8px -2px ", ", 0 0 1px ", ";\n display: block;\n position: absolute;\n top: 0;\n left: ", "px;\n padding: 8px;\n\n > div {\n padding: 0;\n }\n }\n\n .", " {\n display: flex;\n\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", "px;\n width: 20px;\n height: 20px;\n }\n\n &::after {\n content: '\u203A';\n margin-left: 4px;\n line-height: 20px;\n color: ", ";\n }\n }\n"])), ClassName.CONTEXTUAL_SUBMENU, borderRadius(), N60A, N60A, contextualMenuDropdownWidth, ClassName.CONTEXTUAL_MENU_ICON, tableBackgroundBorderColor, borderRadius(), N90);
11
+ import { token } from '@atlaskit/tokens';
12
+ export var tablePopupStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n border-radius: ", "px;\n background: ", ";\n box-shadow: ", ";\n display: block;\n position: absolute;\n top: 0;\n left: ", "px;\n padding: 8px;\n\n > div {\n padding: 0;\n }\n }\n\n .", " {\n display: flex;\n\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", "px;\n width: 20px;\n height: 20px;\n }\n\n &::after {\n content: '\u203A';\n margin-left: 4px;\n line-height: 20px;\n color: ", ";\n }\n }\n"])), ClassName.CONTEXTUAL_SUBMENU, borderRadius(), token('elevation.surface.overlay', 'white'), token('elevation.shadow.overlay', "0 4px 8px -2px ".concat(N60A, ", 0 0 1px ").concat(N60A)), contextualMenuDropdownWidth, ClassName.CONTEXTUAL_MENU_ICON, tableBackgroundBorderColor, borderRadius(), token('color.icon', N90));
@@ -11,13 +11,15 @@ import { scrollbarStyles } from '../../../ui/styles';
11
11
  import { TableCssClassName as ClassName } from '../types';
12
12
  import { tableCellBackgroundColor, tableToolbarColor, tableBorderColor, tableCellSelectedColor, tableToolbarSelectedColor, tableBorderSelectedColor, tableCellDeleteColor, tableBorderDeleteColor, tableToolbarDeleteColor, tableBorderRadiusSize, tablePadding, tableScrollbarOffset, resizeHandlerAreaWidth, resizeLineWidth, tableToolbarSize, tableInsertColumnButtonSize, tableControlsSpacing, tableTextColor, stickyRowZIndex, columnControlsDecorationHeight, stickyRowOffsetTop, stickyHeaderBorderBottomWidth } from './consts';
13
13
  import { HeaderButton, HeaderButtonHover, HeaderButtonDanger, insertColumnButtonWrapper, insertRowButtonWrapper, columnControlsLineMarker, DeleteButton, OverflowShadow, columnControlsDecoration, hoveredDeleteButton, hoveredCell, hoveredWarningCell, resizeHandle, InsertMarker } from './ui-styles';
14
+ import { token } from '@atlaskit/tokens';
14
15
  var cornerControlHeight = tableToolbarSize + 1;
15
16
  var rangeSelectionStyles = "\n.".concat(ClassName.NODEVIEW_WRAPPER, ".").concat(akEditorSelectedNodeClassName, " table tbody tr {\n th,td {\n ").concat(getSelectionStyles([SelectionStyle.Blanket, SelectionStyle.Border]), "\n }\n}\n");
16
- var sentinelStyles = ".".concat(ClassName.TABLE_CONTAINER, " {\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_TOP, ", > .").concat(ClassName.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(ClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: ").concat(columnControlsDecorationHeight, "px;\n }\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n bottom: ").concat(tableScrollbarOffset + stickyRowOffsetTop + tablePadding * 2 + 23, "px;\n }\n &.").concat(ClassName.WITH_CONTROLS, " {\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: 0px;\n }\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n margin-bottom: ").concat(columnControlsDecorationHeight, "px;\n }\n }\n}");
17
+ var sentinelStyles = ".".concat(ClassName.TABLE_CONTAINER, " {\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_TOP, ", > .").concat(ClassName.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(ClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: ").concat(columnControlsDecorationHeight, "px;\n }\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n bottom: ").concat(tableScrollbarOffset + stickyRowOffsetTop + tablePadding * 2 + 23, "px;\n }\n &.").concat(ClassName.WITH_CONTROLS, " {\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: 0px;\n }\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n margin-bottom: ").concat(columnControlsDecorationHeight, "px;\n }\n }\n}"); // TODO: https://product-fabric.atlassian.net/browse/DSP-4139
18
+
17
19
  export var tableStyles = function tableStyles(props) {
18
20
  var _props$featureFlags;
19
21
 
20
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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 &.no-pointer-events {\n pointer-events: none;\n }\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\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\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\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\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\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\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 .", " {\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 .", ", .", " {\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 * Headings have a top margin by default, but we don't want this on the\n * first heading within table header cells.\n *\n * This specifically sets margin-top for the first heading within a header\n * cell when center/right aligned.\n */\n th.", " > .fabric-editor-block-mark {\n > h1:first-child,\n > h2:first-child,\n > h3:first-child,\n > h4:first-child,\n > h5:first-child,\n > h6:first-child {\n margin-top: 0;\n }\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 of corner control is table margin top - corner control height + 1 pixel of table border. */\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-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\n .ProseMirror .pm-table-cell-content-wrap ol[data-child-count='100+'] {\n padding-left: revert;\n }\n"])), ClassName.LAYOUT_BUTTON, N20A, N300, ClassName.LAYOUT_BUTTON, ClassName.IS_RESIZING, B300, tableSharedStyle(props), columnControlsLineMarker(props), hoveredDeleteButton, hoveredCell, hoveredWarningCell, resizeHandle, rangeSelectionStyles, ClassName.LAST_ITEM_IN_CELL, ClassName.TABLE_NODE_WRAPPER, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.TABLE_CELL, tableCellBackgroundColor(props), ClassName.CONTROLS_FLOATING_BUTTON_COLUMN, insertColumnButtonWrapper, ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper, DeleteButton, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, stickyRowOffsetTop + 2, akEditorTableNumberColumnWidth, akEditorStickyHeaderZIndex, stickyRowOffsetTop, ClassName.TABLE_STICKY, ClassName.CORNER_CONTROLS, akEditorSmallZIndex, tableToolbarSize, tableToolbarSize, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize, tableToolbarSize, ClassName.TABLE_STICKY, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_STICKY, ClassName.ROW_CONTROLS, ClassName.ROW_CONTROLS_BUTTON_WRAP, akEditorStickyHeaderZIndex, tableToolbarSize, tableToolbarSize, ClassName.TABLE_STICKY, stickyRowOffsetTop, stickyRowZIndex, N40A, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, stickyRowZIndex + 1, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tableToolbarSize, stickyHeaderBorderBottomWidth, tableBorderColor(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY, ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.WITH_CONTROLS, tableControlsSpacing, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, tableControlsSpacing + 2, ClassName.CORNER_CONTROLS, tableControlsSpacing - tableToolbarSize + 2, (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.stickyHeadersOptimization ? sentinelStyles : '', OverflowShadow(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, ClassName.NODEVIEW_WRAPPER, ClassName.TABLE_CONTAINER, columnControlsDecoration(props), ClassName.CORNER_CONTROLS, tableToolbarSize + 1, cornerControlHeight, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, InsertMarker(props, "\n left: -11px;\n top: 9px;\n "), ClassName.CORNER_CONTROLS_INSERT_COLUMN_MARKER, InsertMarker(props, "\n right: -1px;\n top: -12px;\n "), ClassName.CORNER_CONTROLS, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize + 1, tableToolbarSize + 1, tableBorderColor(props), tableBorderRadiusSize, tableToolbarColor(props), ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor, tableToolbarDeleteColor, ClassName.ROW_CONTROLS, tableToolbarSize, InsertMarker(props, "\n bottom: -1px;\n left: -11px;\n "), ClassName.ROW_CONTROLS_INNER, ClassName.ROW_CONTROLS_BUTTON_WRAP, tableBorderRadiusSize, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.CONTROLS_BUTTON, akEditorUnitZIndex, HeaderButton(props, "\n border-bottom: 1px solid ".concat(tableBorderColor(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(tableToolbarSize, "px;\n\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, ":first-child {\n top: 0;\n }\n ")), ClassName.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(), HeaderButtonDanger(), ClassName.NUMBERED_COLUMN, akEditorTableToolbarSize - 1, akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableToolbarColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, N0, ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, N0, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableToolbarDeleteColor, tableBorderDeleteColor, R500, akEditorUnitZIndex, ClassName.TABLE_NODE_WRAPPER, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, akEditorSmallZIndex, ClassName.SELECTED_CELL, tableBorderSelectedColor, ClassName.SELECTED_CELL, tableCellSelectedColor, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor, ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.ROW_CONTROLS_WRAPPER, tableToolbarSize, ClassName.TABLE_NODE_WRAPPER, tableInsertColumnButtonSize / 2, tableInsertColumnButtonSize / 2, tableScrollbarOffset, tableScrollbarOffset, ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR);
22
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: ", " !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-of-type {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n box-shadow: 0px -", "px ", ";\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: ", ";\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\n ", ";\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 ", ";\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: ", ";\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\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-of-type {\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-of-type {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid\n ", ";\n }\n\n ", "\n ", "\n\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\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\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\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\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\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\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 .", " {\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 .", ", .", " {\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 * Headings have a top margin by default, but we don't want this on the\n * first heading within table header cells.\n *\n * This specifically sets margin-top for the first heading within a header\n * cell when center/right aligned.\n */\n th.", " > .fabric-editor-block-mark {\n > h1:first-of-type,\n > h2:first-of-type,\n > h3:first-of-type,\n > h4:first-of-type,\n > h5:first-of-type,\n > h6:first-of-type {\n margin-top: 0;\n }\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 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 of corner control is table margin top - corner control height + 1 pixel of table border. */\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-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\n .ProseMirror .pm-table-cell-content-wrap ol[data-child-count='100+'] {\n padding-left: revert;\n }\n"])), ClassName.LAYOUT_BUTTON, token('color.background.neutral', N20A), token('color.icon', N300), ClassName.LAYOUT_BUTTON, ClassName.IS_RESIZING, token('color.background.neutral.hovered', B300), token('color.icon', 'white'), tableSharedStyle(props), columnControlsLineMarker(props), hoveredDeleteButton, hoveredCell, hoveredWarningCell, resizeHandle, rangeSelectionStyles, ClassName.LAST_ITEM_IN_CELL, ClassName.TABLE_NODE_WRAPPER, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.TABLE_CELL, tableCellBackgroundColor(props), ClassName.CONTROLS_FLOATING_BUTTON_COLUMN, insertColumnButtonWrapper, ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper, DeleteButton, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, stickyRowOffsetTop + 2, akEditorTableNumberColumnWidth, akEditorStickyHeaderZIndex, stickyRowOffsetTop, token('elevation.surface', 'white'), ClassName.TABLE_STICKY, ClassName.CORNER_CONTROLS, akEditorSmallZIndex, token('elevation.surface', 'white'), tableToolbarSize, tableToolbarSize, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize, tableToolbarSize, ClassName.TABLE_STICKY, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_STICKY, ClassName.ROW_CONTROLS, ClassName.ROW_CONTROLS_BUTTON_WRAP, akEditorStickyHeaderZIndex, tableToolbarSize, token('elevation.surface', 'white'), tableToolbarSize, ClassName.TABLE_STICKY, token('elevation.surface', 'green'), stickyRowOffsetTop, stickyRowZIndex, token('elevation.surface', 'white'), token('elevation.shadow.overflow', "0 6px 4px -4px ".concat(N40A)), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, stickyRowZIndex + 1, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tableToolbarSize, stickyHeaderBorderBottomWidth, tableBorderColor(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY, ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.WITH_CONTROLS, tableControlsSpacing, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, tableControlsSpacing + 2, ClassName.CORNER_CONTROLS, tableControlsSpacing - tableToolbarSize + 2, token('elevation.surface', 'white'), (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.stickyHeadersOptimization ? sentinelStyles : '', OverflowShadow(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, ClassName.NODEVIEW_WRAPPER, ClassName.TABLE_CONTAINER, columnControlsDecoration(props), ClassName.CORNER_CONTROLS, tableToolbarSize + 1, cornerControlHeight, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, InsertMarker(props, "\n left: -11px;\n top: 9px;\n "), ClassName.CORNER_CONTROLS_INSERT_COLUMN_MARKER, InsertMarker(props, "\n right: -1px;\n top: -12px;\n "), ClassName.CORNER_CONTROLS, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize + 1, tableToolbarSize + 1, tableBorderColor(props), tableBorderRadiusSize, tableToolbarColor(props), ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor, tableToolbarDeleteColor, ClassName.ROW_CONTROLS, tableToolbarSize, InsertMarker(props, "\n bottom: -1px;\n left: -11px;\n "), ClassName.ROW_CONTROLS_INNER, ClassName.ROW_CONTROLS_BUTTON_WRAP, tableBorderRadiusSize, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.CONTROLS_BUTTON, akEditorUnitZIndex, HeaderButton(props, "\n border-bottom: 1px solid ".concat(tableBorderColor(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(tableToolbarSize, "px;\n\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, ":first-of-type {\n top: 0;\n }\n ")), ClassName.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(), HeaderButtonDanger(), ClassName.NUMBERED_COLUMN, akEditorTableToolbarSize - 1, akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableToolbarColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, token('color.text.inverse', N0), ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, token('color.text.inverse', N0), ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableToolbarDeleteColor, tableBorderDeleteColor, token('color.text.inverse', R500), akEditorUnitZIndex, ClassName.TABLE_NODE_WRAPPER, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, akEditorSmallZIndex, ClassName.SELECTED_CELL, tableBorderSelectedColor, ClassName.SELECTED_CELL, tableCellSelectedColor, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor, ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.ROW_CONTROLS_WRAPPER, tableToolbarSize, ClassName.TABLE_NODE_WRAPPER, tableInsertColumnButtonSize / 2, tableInsertColumnButtonSize / 2, tableScrollbarOffset, tableScrollbarOffset, ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR);
21
23
  };
22
24
  export var tableFullPageEditorStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n width: 100%;\n }\n"])), ClassName.TABLE_NODE_WRAPPER);
23
25
  export var tableCommentEditorStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n ", ";\n }\n"])), ClassName.TABLE_NODE_WRAPPER, scrollbarStyles);
@@ -1,4 +1,4 @@
1
- import { B200, B300, B75, N0, N20, R50, R400, R75, DN400, N200, DN30 } from '@atlaskit/theme/colors';
1
+ import { B200, B300, N0, N20, R400, R75, DN400, N200, DN30 } from '@atlaskit/theme/colors';
2
2
  import { tableCellBorderWidth, tableMarginTop } from '@atlaskit/editor-common/styles';
3
3
  import { akEditorTableBorder, akEditorTableBorderDark, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableToolbarSize, akEditorUnitZIndex, akRichMediaResizeZIndex } from '@atlaskit/editor-shared-styles';
4
4
  import { token } from '@atlaskit/tokens';
@@ -7,30 +7,33 @@ import { themed } from '@atlaskit/theme/components';
7
7
  /**
8
8
  * Basic colors added to prevent content overflow in table cells.
9
9
  */
10
+ // TODO: https://product-fabric.atlassian.net/browse/DSP-4135
11
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
10
12
 
11
13
  export var tableCellBackgroundColor = themed({
12
14
  light: N0,
13
15
  dark: DN30
14
16
  });
15
17
  export var tableToolbarColor = themed({
16
- light: token('color.background.neutral', akEditorTableToolbar),
17
- dark: token('color.background.neutral', akEditorTableToolbarDark)
18
+ light: akEditorTableToolbar,
19
+ dark: akEditorTableToolbarDark
18
20
  });
19
21
  export var tableTextColor = themed({
20
- light: N200,
21
- dark: DN400
22
+ light: token('color.text.subtlest', N200),
23
+ dark: token('color.text.subtlest', DN400)
22
24
  });
23
25
  export var tableBorderColor = themed({
24
26
  light: token('color.border', akEditorTableBorder),
25
27
  dark: token('color.border', akEditorTableBorderDark)
26
28
  });
27
- export var tableFloatingControlsColor = N20;
28
- export var tableCellSelectedColor = B75;
29
- export var tableToolbarSelectedColor = B200;
30
- export var tableBorderSelectedColor = B300;
31
- export var tableCellDeleteColor = R50;
32
- export var tableBorderDeleteColor = R400;
33
- export var tableToolbarDeleteColor = R75;
29
+ export var tableFloatingControlsColor = token('color.background.neutral', N20); // TODO: https://product-fabric.atlassian.net/browse/DSP-4461
30
+
31
+ export var tableCellSelectedColor = token('color.blanket.selected', 'rgba(179, 212, 255, 0.3)');
32
+ export var tableToolbarSelectedColor = token('color.background.selected.bold', B200);
33
+ export var tableBorderSelectedColor = token('color.border.selected', B300);
34
+ export var tableCellDeleteColor = token('color.blanket.danger', 'rgba(255, 235, 230, 0.3)');
35
+ export var tableBorderDeleteColor = token('color.border.danger', R400);
36
+ export var tableToolbarDeleteColor = token('color.background.danger.bold', R75);
34
37
  export var tableBorderRadiusSize = 3;
35
38
  export var tablePadding = 8;
36
39
  export var tableScrollbarOffset = 15;
@@ -9,6 +9,7 @@ import { N40A, B300, N300, R300, N20A, N60A, N0, Y50, Y200 } from '@atlaskit/the
9
9
  import { tableToolbarColor, tableBorderColor, tableToolbarSelectedColor, tableBorderSelectedColor, tableCellDeleteColor, tableBorderDeleteColor, tableToolbarDeleteColor, lineMarkerOffsetFromColumnControls, lineMarkerSize, columnControlsDecorationHeight, columnControlsZIndex, columnControlsSelectedZIndex, resizeHandlerAreaWidth, resizeLineWidth, resizeHandlerZIndex, tableToolbarSize, tableInsertColumnButtonSize, tableDeleteButtonSize, tableControlsSpacing } from './consts';
10
10
  import { TableCssClassName as ClassName } from '../types';
11
11
  import { borderRadius } from '@atlaskit/theme/constants';
12
+ import { token } from '@atlaskit/tokens';
12
13
 
13
14
  var InsertLine = function InsertLine(cssString) {
14
15
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n background: ", ";\n display: none;\n position: absolute;\n z-index: ", ";\n ", "\n }\n"])), ClassName.CONTROLS_INSERT_LINE, tableBorderSelectedColor, akEditorUnitZIndex, cssString);
@@ -27,42 +28,46 @@ var Button = function Button(cssString) {
27
28
  };
28
29
 
29
30
  export var HeaderButton = function HeaderButton(props, cssString) {
30
- return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n .", " {\n background: ", ";\n border: 1px solid ", ";\n display: block;\n box-sizing: border-box;\n padding: 0;\n\n :focus {\n outline: none;\n }\n ", "\n }\n\n .", "::after {\n content: ' ';\n background-color: transparent;\n left: -15px;\n top: 0;\n position: absolute;\n width: 15px;\n height: 100%;\n z-index: 1;\n }\n\n .active .", " {\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n }\n"])), ClassName.CONTROLS_BUTTON, tableToolbarColor(props), tableBorderColor(props), cssString, ClassName.ROW_CONTROLS_BUTTON, ClassName.CONTROLS_BUTTON, N0, tableToolbarSelectedColor, tableBorderSelectedColor);
31
+ return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n .", " {\n background: ", ";\n border: 1px solid ", ";\n display: block;\n box-sizing: border-box;\n padding: 0;\n\n :focus {\n outline: none;\n }\n ", "\n }\n\n .", "::after {\n content: ' ';\n background-color: transparent;\n left: -15px;\n top: 0;\n position: absolute;\n width: 15px;\n height: 100%;\n z-index: 1;\n }\n\n .active .", " {\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n }\n"])), ClassName.CONTROLS_BUTTON, tableToolbarColor(props), tableBorderColor(props), cssString, ClassName.ROW_CONTROLS_BUTTON, ClassName.CONTROLS_BUTTON, token('color.icon.inverse', N0), tableToolbarSelectedColor, tableBorderSelectedColor);
31
32
  };
32
33
  export var HeaderButtonHover = function HeaderButtonHover() {
33
- return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n .", ":hover {\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n cursor: pointer;\n }\n"])), ClassName.CONTROLS_BUTTON, N0, tableToolbarSelectedColor, tableBorderSelectedColor);
34
+ return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n .", ":hover {\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n cursor: pointer;\n }\n"])), ClassName.CONTROLS_BUTTON, token('color.icon.inverse', N0), tableToolbarSelectedColor, tableBorderSelectedColor);
34
35
  };
35
36
  export var HeaderButtonDanger = function HeaderButtonDanger() {
36
37
  return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n .", " .", " {\n background-color: ", ";\n border-color: ", ";\n position: relative;\n z-index: ", ";\n }\n"])), ClassName.HOVERED_CELL_IN_DANGER, ClassName.CONTROLS_BUTTON, tableToolbarDeleteColor, tableBorderDeleteColor, akEditorUnitZIndex);
37
38
  };
38
39
 
39
40
  var InsertButton = function InsertButton() {
40
- return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n .", " {\n position: absolute;\n z-index: ", ";\n bottom: 0;\n }\n .", ",\n .", " {\n height: ", "px;\n width: ", "px;\n }\n .", " {\n ", "\n }\n .", " {\n display: none;\n }\n &:hover .", " {\n display: flex;\n }\n"])), ClassName.CONTROLS_INSERT_BUTTON_INNER, akEditorUnitZIndex + 10, ClassName.CONTROLS_INSERT_BUTTON_INNER, ClassName.CONTROLS_INSERT_BUTTON, tableInsertColumnButtonSize, tableInsertColumnButtonSize, ClassName.CONTROLS_INSERT_BUTTON, Button("\n background: white;\n box-shadow: 0 4px 8px -2px ".concat(N60A, ", 0 0 1px ").concat(N60A, ";\n color: ").concat(N300, ";\n ")), ClassName.CONTROLS_INSERT_LINE, ClassName.CONTROLS_INSERT_LINE);
41
+ return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n .", " {\n position: absolute;\n z-index: ", ";\n bottom: 0;\n }\n .", ",\n .", " {\n height: ", "px;\n width: ", "px;\n }\n .", " {\n ", "\n }\n .", " {\n display: none;\n }\n &:hover .", " {\n display: flex;\n }\n"])), ClassName.CONTROLS_INSERT_BUTTON_INNER, akEditorUnitZIndex + 10, ClassName.CONTROLS_INSERT_BUTTON_INNER, ClassName.CONTROLS_INSERT_BUTTON, tableInsertColumnButtonSize, tableInsertColumnButtonSize, ClassName.CONTROLS_INSERT_BUTTON, Button("\n background: ".concat(token('elevation.surface.overlay', 'white'), ";\n box-shadow: ").concat(token('elevation.shadow.overlay', "0 4px 8px -2px ".concat(N60A, ", 0 0 1px ").concat(N60A)), ";\n color: ").concat(token('color.icon', N300), ";\n ")), ClassName.CONTROLS_INSERT_LINE, ClassName.CONTROLS_INSERT_LINE);
41
42
  };
42
43
 
43
44
  var InsertButtonHover = function InsertButtonHover() {
44
- return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n .", ":hover {\n background: ", ";\n color: white;\n cursor: pointer;\n }\n"])), ClassName.CONTROLS_INSERT_BUTTON, B300);
45
+ return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n .", ":hover {\n background: ", ";\n color: ", ";\n cursor: pointer;\n }\n"])), ClassName.CONTROLS_INSERT_BUTTON, token('color.background.brand.bold', B300), token('color.icon.inverse', 'white'));
45
46
  };
46
47
 
47
48
  export var insertColumnButtonWrapper = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n"])), InsertButton(), InsertButtonHover(), InsertLine("\n width: 2px;\n left: 9px;\n "));
48
49
  export var insertRowButtonWrapper = css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n"])), InsertButton(), InsertButtonHover(), InsertLine("\n height: 2px;\n top: -11px;\n left: ".concat(tableInsertColumnButtonSize - 1, "px;\n ")));
49
50
  export var columnControlsLineMarker = function columnControlsLineMarker(props) {
50
- return css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n .", ".", "\n table\n tr:first-child\n td,\n .", ".", "\n table\n tr:first-child\n th {\n position: relative;\n\n &::before {\n content: ' ';\n ", ";\n top: -", "px;\n right: -", "px;\n }\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.WITH_CONTROLS, ClassName.TABLE_CONTAINER, ClassName.WITH_CONTROLS, Marker(props), tableToolbarSize + lineMarkerOffsetFromColumnControls, lineMarkerSize / 2);
51
+ return css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n .", ".", "\n table\n tr:first-of-type\n td,\n .", ".", "\n table\n tr:first-of-type\n th {\n position: relative;\n\n &::before {\n content: ' ';\n ", ";\n top: -", "px;\n right: -", "px;\n }\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.WITH_CONTROLS, ClassName.TABLE_CONTAINER, ClassName.WITH_CONTROLS, Marker(props), tableToolbarSize + lineMarkerOffsetFromColumnControls, lineMarkerSize / 2);
51
52
  };
52
- export var DeleteButton = css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n .", ",\n .", " {\n height: ", "px;\n width: ", "px;\n }\n .", " {\n .", " {\n ", "\n }\n }\n\n .", ":hover {\n background: ", ";\n color: white;\n cursor: pointer;\n }\n"])), ClassName.CONTROLS_DELETE_BUTTON_WRAP, ClassName.CONTROLS_DELETE_BUTTON, tableDeleteButtonSize, tableDeleteButtonSize, ClassName.CONTROLS_DELETE_BUTTON_WRAP, ClassName.CONTROLS_DELETE_BUTTON, Button("\n background: ".concat(N20A, ";\n color: ").concat(N300, ";\n ")), ClassName.CONTROLS_DELETE_BUTTON, R300);
53
+ export var DeleteButton = css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n .", ",\n .", " {\n height: ", "px;\n width: ", "px;\n }\n .", " {\n .", " {\n ", "\n }\n }\n\n .", ":hover {\n background: ", ";\n color: ", ";\n cursor: pointer;\n }\n"])), ClassName.CONTROLS_DELETE_BUTTON_WRAP, ClassName.CONTROLS_DELETE_BUTTON, tableDeleteButtonSize, tableDeleteButtonSize, ClassName.CONTROLS_DELETE_BUTTON_WRAP, ClassName.CONTROLS_DELETE_BUTTON, Button("\n background: ".concat(token('color.background.neutral', N20A), ";\n color: ").concat(token('color.icon', N300), ";\n ")), ClassName.CONTROLS_DELETE_BUTTON, token('color.background.danger.bold', R300), token('color.icon.inverse', 'white')); // TODO: https://product-fabric.atlassian.net/browse/DSP-4451
54
+
55
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
56
+
53
57
  export var OverflowShadow = function OverflowShadow(props) {
54
58
  return css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n .", ", .", " {\n display: block;\n height: calc(\n 100% - ", "px\n );\n position: absolute;\n pointer-events: none;\n top: ", "px;\n z-index: ", ";\n width: 8px;\n }\n .", " {\n background: linear-gradient(to left, rgba(99, 114, 130, 0) 0, ", " 100%);\n left: 0px;\n }\n .", "[data-number-column='true'] > :not(.", ").", " {\n left: ", "px;\n }\n .", " {\n background: linear-gradient(\n to right,\n rgba(99, 114, 130, 0) 0,\n ", " 100%\n );\n left: calc(100% + 2px);\n }\n .", " {\n .", ", .", " {\n height: calc(100% - ", "px);\n top: ", "px;\n }\n .", " {\n border-left: 1px solid ", ";\n }\n }\n .", ".", " {\n .", ", .", " {\n top: ", "px;\n }\n }\n"])), ClassName.TABLE_RIGHT_SHADOW, ClassName.TABLE_LEFT_SHADOW, tableMarginTop + tableMarginBottom + tableToolbarSize - 2, tableMarginTop + tableToolbarSize - 1, akEditorShadowZIndex, ClassName.TABLE_LEFT_SHADOW, N40A, ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY_SHADOW, ClassName.TABLE_LEFT_SHADOW, akEditorTableNumberColumnWidth - 1, ClassName.TABLE_RIGHT_SHADOW, N40A, ClassName.WITH_CONTROLS, ClassName.TABLE_RIGHT_SHADOW, ClassName.TABLE_LEFT_SHADOW, tableMarginTop + tableMarginBottom - 2, tableMarginTop - 1, ClassName.TABLE_LEFT_SHADOW, tableBorderColor(props), ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.TABLE_RIGHT_SHADOW, ClassName.TABLE_LEFT_SHADOW, tableControlsSpacing);
55
59
  };
60
+ /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
56
61
 
57
62
  var columnHeaderButton = function columnHeaderButton(props, cssString) {
58
63
  return css(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n background: ", ";\n border: 1px solid ", ";\n display: block;\n box-sizing: border-box;\n padding: 0;\n\n :focus {\n outline: none;\n }\n\n ", "\n"])), tableToolbarColor(props), tableBorderColor(props), cssString);
59
64
  };
60
65
 
61
- var columnHeaderButtonSelected = css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n z-index: ", ";\n"])), N0, tableToolbarSelectedColor, tableBorderSelectedColor, columnControlsSelectedZIndex);
66
+ var columnHeaderButtonSelected = css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n z-index: ", ";\n"])), token('color.text.inverse', N0), tableToolbarSelectedColor, tableBorderSelectedColor, columnControlsSelectedZIndex);
62
67
  export var columnControlsDecoration = function columnControlsDecoration(props) {
63
- return css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n .", " {\n display: none;\n cursor: pointer;\n position: absolute;\n width: calc(100% + ", "px);\n left: -1px;\n top: -", "px;\n height: ", "px;\n\n &::after {\n content: ' ';\n\n ", "\n }\n }\n\n .", " .", " {\n display: block;\n }\n\n table\n tr:first-child\n td.", ",\n table\n tr:first-child\n th.", " {\n &.", ",\n &.", ",\n &.", " {\n .", "::after {\n ", ";\n }\n\n &.", "\n .", "::after {\n background-color: ", ";\n border: 1px solid ", ";\n border-bottom: none;\n z-index: ", ";\n }\n }\n }\n\n .", "\n table\n tr:first-child\n td.", ",\n .", "\n table\n tr:first-child\n th.", " {\n .", "::after {\n ", ";\n }\n }\n"])), ClassName.COLUMN_CONTROLS_DECORATIONS, tableCellBorderWidth * 2, columnControlsDecorationHeight + tableCellBorderWidth, columnControlsDecorationHeight, columnHeaderButton(props, "\n border-right: ".concat(tableCellBorderWidth, "px solid ").concat(tableBorderColor(props), ";\n border-bottom: none;\n height: ").concat(tableToolbarSize, "px;\n width: 100%;\n position: absolute;\n top: ").concat(columnControlsDecorationHeight - tableToolbarSize, "px;\n left: 0px;\n z-index: ").concat(columnControlsZIndex, ";\n ")), ClassName.WITH_CONTROLS, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.COLUMN_SELECTED, ClassName.HOVERED_COLUMN, ClassName.HOVERED_TABLE, ClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected, ClassName.HOVERED_CELL_IN_DANGER, ClassName.COLUMN_CONTROLS_DECORATIONS, tableToolbarDeleteColor, tableBorderDeleteColor, akEditorUnitZIndex * 100, ClassName.TABLE_SELECTED, ClassName.TABLE_CELL, ClassName.TABLE_SELECTED, ClassName.TABLE_HEADER_CELL, ClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected);
68
+ return css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n .", " {\n display: none;\n cursor: pointer;\n position: absolute;\n width: calc(100% + ", "px);\n left: -1px;\n top: -", "px;\n height: ", "px;\n\n &::after {\n content: ' ';\n\n ", "\n }\n }\n\n .", " .", " {\n display: block;\n }\n\n table\n tr:first-of-type\n td.", ",\n table\n tr:first-of-type\n th.", " {\n &.", ",\n &.", ",\n &.", " {\n .", "::after {\n ", ";\n }\n\n &.", "\n .", "::after {\n background-color: ", ";\n border: 1px solid ", ";\n border-bottom: none;\n z-index: ", ";\n }\n }\n }\n\n .", "\n table\n tr:first-of-type\n td.", ",\n .", "\n table\n tr:first-of-type\n th.", " {\n .", "::after {\n ", ";\n }\n }\n"])), ClassName.COLUMN_CONTROLS_DECORATIONS, tableCellBorderWidth * 2, columnControlsDecorationHeight + tableCellBorderWidth, columnControlsDecorationHeight, columnHeaderButton(props, "\n border-right: ".concat(tableCellBorderWidth, "px solid ").concat(tableBorderColor(props), ";\n border-bottom: none;\n height: ").concat(tableToolbarSize, "px;\n width: 100%;\n position: absolute;\n top: ").concat(columnControlsDecorationHeight - tableToolbarSize, "px;\n left: 0px;\n z-index: ").concat(columnControlsZIndex, ";\n ")), ClassName.WITH_CONTROLS, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.COLUMN_SELECTED, ClassName.HOVERED_COLUMN, ClassName.HOVERED_TABLE, ClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected, ClassName.HOVERED_CELL_IN_DANGER, ClassName.COLUMN_CONTROLS_DECORATIONS, tableToolbarDeleteColor, tableBorderDeleteColor, akEditorUnitZIndex * 100, ClassName.TABLE_SELECTED, ClassName.TABLE_CELL, ClassName.TABLE_SELECTED, ClassName.TABLE_HEADER_CELL, ClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected);
64
69
  };
65
70
  export var hoveredDeleteButton = css(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n .", ".", " {\n .", ",\n .", ",\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n }\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.HOVERED_DELETE_BUTTON, ClassName.SELECTED_CELL, ClassName.COLUMN_SELECTED, ClassName.HOVERED_CELL, tableBorderDeleteColor, ClassName.SELECTED_CELL, tableCellDeleteColor);
66
71
  export var hoveredCell = css(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n :not(.", ")\n .", ":not(.", ") {\n .", " {\n position: relative;\n border: 1px solid ", ";\n }\n }\n"])), ClassName.IS_RESIZING, ClassName.TABLE_CONTAINER, ClassName.HOVERED_DELETE_BUTTON, ClassName.HOVERED_CELL, tableBorderSelectedColor);
67
- export var hoveredWarningCell = css(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n :not(.", ")\n .", ":not(.", ") {\n td.", " {\n background-color: ", " !important; // We need to override the background-color added to the cell\n border: 1px solid ", ";\n }\n }\n"])), ClassName.IS_RESIZING, ClassName.TABLE_CONTAINER, ClassName.HOVERED_DELETE_BUTTON, ClassName.HOVERED_CELL_WARNING, Y50, Y200);
68
- export var resizeHandle = css(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n .", " {\n .", " {\n background-color: transparent;\n position: absolute;\n width: ", "px;\n height: 100%;\n top: 0;\n right: -", "px;\n cursor: col-resize;\n z-index: ", ";\n }\n\n td.", ", th.", " {\n .", "::after {\n content: ' ';\n right: ", "px;\n position: absolute;\n width: ", "px;\n height: calc(100% + 1px);\n background-color: ", ";\n z-index: ", ";\n top: 0;\n }\n }\n\n table\n tr:first-child\n th.", "\n .", "::after,\n table\n tr:first-child\n td.", "\n .", "::after {\n top: -", "px;\n height: calc(100% + ", "px);\n }\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.RESIZE_HANDLE_DECORATION, resizeHandlerAreaWidth, resizeHandlerAreaWidth / 2, resizeHandlerZIndex, ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2, resizeLineWidth, tableBorderSelectedColor, columnControlsZIndex * 2, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, tableToolbarSize + tableCellBorderWidth, tableToolbarSize + tableCellBorderWidth);
72
+ export var hoveredWarningCell = css(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n :not(.", ")\n .", ":not(.", ") {\n td.", " {\n background-color: ", " !important; // We need to override the background-color added to the cell\n border: 1px solid ", ";\n }\n }\n"])), ClassName.IS_RESIZING, ClassName.TABLE_CONTAINER, ClassName.HOVERED_DELETE_BUTTON, ClassName.HOVERED_CELL_WARNING, token('color.background.warning', Y50), token('color.border.warning', Y200));
73
+ export var resizeHandle = css(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n .", " {\n .", " {\n background-color: transparent;\n position: absolute;\n width: ", "px;\n height: 100%;\n top: 0;\n right: -", "px;\n cursor: col-resize;\n z-index: ", ";\n }\n\n td.", ", th.", " {\n .", "::after {\n content: ' ';\n right: ", "px;\n position: absolute;\n width: ", "px;\n height: calc(100% + 1px);\n background-color: ", ";\n z-index: ", ";\n top: 0;\n }\n }\n\n table\n tr:first-of-type\n th.", "\n .", "::after,\n table\n tr:first-of-type\n td.", "\n .", "::after {\n top: -", "px;\n height: calc(100% + ", "px);\n }\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.RESIZE_HANDLE_DECORATION, resizeHandlerAreaWidth, resizeHandlerAreaWidth / 2, resizeHandlerZIndex, ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2, resizeLineWidth, tableBorderSelectedColor, columnControlsZIndex * 2, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, tableToolbarSize + tableCellBorderWidth, tableToolbarSize + tableCellBorderWidth);
@@ -88,10 +88,9 @@ export var createColumnControlsDecoration = function createColumnControlsDecorat
88
88
  element.dataset.startIndex = "".concat(index);
89
89
  index += colspan;
90
90
  element.dataset.endIndex = "".concat(index);
91
- return Decoration.widget(cell.pos + 1, // Do not delay the rendering for this Decoration
92
- // because we need to always render all controls
93
- // to keep the order safe
94
- element, {
91
+ return Decoration.widget(cell.pos + 1, function () {
92
+ return element;
93
+ }, {
95
94
  key: "".concat(TableDecorations.COLUMN_CONTROLS_DECORATIONS, "_").concat(index),
96
95
  // this decoration should be the first one, even before gap cursor.
97
96
  side: -100
@@ -61,6 +61,8 @@ export var transformSliceToFixHardBreakProblemOnCopyFromCell = function transfor
61
61
  return slice;
62
62
  };
63
63
  export var transformSliceToRemoveOpenTable = function transformSliceToRemoveOpenTable(slice, schema) {
64
+ var _slice$content$firstC;
65
+
64
66
  // we're removing the table, tableRow and tableCell reducing the open depth by 3
65
67
  var depthDecrement = 3; // Case 1: A slice entirely within a single CELL
66
68
 
@@ -68,17 +70,15 @@ export var transformSliceToRemoveOpenTable = function transformSliceToRemoveOpen
68
70
  slice.openStart >= 4 && slice.openEnd >= 4 && // slice is a table node
69
71
  slice.content.childCount === 1 && slice.content.firstChild.type === schema.nodes.table) {
70
72
  return new Slice(flatmap(slice.content, unwrapContentFromTable), slice.openStart - depthDecrement, slice.openEnd - depthDecrement);
71
- } // Case 2: A slice starting inside a table and finishing outside
72
- // slice.openStart can only be >= 4 if its a TextSelection. CellSelection would give openStart = 1
73
-
74
-
75
- if (slice.openStart >= 4 && slice.content.firstChild.type === schema.nodes.table) {
76
- return new Slice(flatmap(slice.content, removeTableFromFirstChild), slice.openStart - depthDecrement, slice.openEnd);
77
- } // Case 3: A slice starting outside a table and finishing inside
73
+ } // Case 2: A slice starting within a CELL and ending outside the table
78
74
 
79
75
 
80
- if (slice.openEnd >= 4 && slice.content.lastChild.type === schema.nodes.table) {
81
- return new Slice(flatmap(slice.content, removeTableFromLastChild), slice.openStart, slice.openEnd - depthDecrement);
76
+ if ( // starts inside of a cell but ends outside of the starting table
77
+ slice.openStart >= 4 && // slice starts from a table node (and spans across more than one node)
78
+ slice.content.childCount > 1 && ((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type) === schema.nodes.table) {
79
+ // repoint the slice's cutting depth so that cell content where the slice starts
80
+ // does not get lifted out of the cell on paste
81
+ return new Slice(slice.content, 1, slice.openEnd);
82
82
  }
83
83
 
84
84
  return slice;
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
4
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
5
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
5
6
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -9,7 +10,6 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
9
10
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
10
11
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
11
12
  var _excluded = ["contextIdentifierProvider"];
12
- import _regeneratorRuntime from "@babel/runtime/regenerator";
13
13
 
14
14
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
15
15
 
@@ -156,11 +156,12 @@ var typeAheadPlugin = function typeAheadPlugin(options) {
156
156
  containerElement = _ref5.containerElement,
157
157
  popupsMountPoint = _ref5.popupsMountPoint,
158
158
  popupsBoundariesElement = _ref5.popupsBoundariesElement,
159
- popupsScrollableElement = _ref5.popupsScrollableElement;
159
+ popupsScrollableElement = _ref5.popupsScrollableElement,
160
+ wrapperElement = _ref5.wrapperElement;
160
161
  popupMountRef.current = {
161
- popupsMountPoint: popupsMountPoint || containerElement || undefined,
162
+ popupsMountPoint: popupsMountPoint || wrapperElement || undefined,
162
163
  popupsBoundariesElement: popupsBoundariesElement,
163
- popupsScrollableElement: popupsScrollableElement
164
+ popupsScrollableElement: popupsScrollableElement || containerElement || undefined
164
165
  };
165
166
  return /*#__PURE__*/React.createElement(WithPluginState, {
166
167
  plugins: {
@@ -12,6 +12,7 @@ import { WrapperTypeAhead } from '../ui/WrapperTypeAhead';
12
12
  import { StatsModifier } from '../stats-modifier';
13
13
  import { getTypeAheadQuery } from '../utils';
14
14
  import { closeTypeAhead } from '../transforms/close-type-ahead';
15
+ import { token } from '@atlaskit/tokens';
15
16
  export var factoryDecorations = function factoryDecorations(_ref) {
16
17
  var intl = _ref.intl,
17
18
  popupMountRef = _ref.popupMountRef,
@@ -51,7 +52,7 @@ export var factoryDecorations = function factoryDecorations(_ref) {
51
52
 
52
53
  typeaheadComponent.dataset.editorPopup = 'true';
53
54
  typeaheadComponent.dataset.typeAhead = TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE;
54
- typeaheadComponent.style.color = B400;
55
+ typeaheadComponent.style.color = token('color.text.accent.blue', B400);
55
56
  typeaheadComponent.style.backgroundColor = 'transparent';
56
57
 
57
58
  var onUndoRedo = function onUndoRedo(inputType) {
@@ -15,14 +15,14 @@ import { DynamicHeightListItem, SelectedIndexContext, ListItemActionsContext, Up
15
15
  import { injectIntl } from 'react-intl-next';
16
16
  import { typeAheadListMessages } from '../messages';
17
17
  var LIST_ITEM_ESTIMATED_HEIGHT = ICON_HEIGHT + ITEM_PADDING * 2;
18
- var LIST_MAX_HEIGHT = 380;
19
18
  var LIST_WIDTH = 320;
20
19
  var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref) {
21
20
  var items = _ref.items,
22
21
  selectedIndex = _ref.selectedIndex,
23
22
  onItemHover = _ref.onItemHover,
24
23
  onItemClick = _ref.onItemClick,
25
- intl = _ref.intl;
24
+ intl = _ref.intl,
25
+ fitHeight = _ref.fitHeight;
26
26
  var listRef = useRef();
27
27
  var redrawListAtIndex = useCallback(function (index) {
28
28
  listRef.current.resetAfterIndex(index);
@@ -41,7 +41,7 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref) {
41
41
  redrawListAtIndex: redrawListAtIndex,
42
42
  getFirstVisibleIndex: getFirstVisibleIndex,
43
43
  listLength: items.length,
44
- listMaxHeight: LIST_MAX_HEIGHT,
44
+ listMaxHeight: fitHeight,
45
45
  listItemEstimatedHeight: LIST_ITEM_ESTIMATED_HEIGHT
46
46
  }),
47
47
  getListItemHeight = _useDynamicListHeight.getListItemHeight,
@@ -103,7 +103,7 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref) {
103
103
  }
104
104
 
105
105
  var estimatedHeight = items.length * LIST_ITEM_ESTIMATED_HEIGHT;
106
- var height = Math.min(typeof renderedListHeight === 'number' ? renderedListHeight : estimatedHeight, LIST_MAX_HEIGHT);
106
+ var height = Math.min(typeof renderedListHeight === 'number' ? renderedListHeight : estimatedHeight, fitHeight);
107
107
  return jsx(ItemGroup, {
108
108
  role: "listbox",
109
109
  "aria-live": "polite",
@@ -15,6 +15,7 @@ import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
15
15
  import IconFallback from '../../quick-insert/assets/fallback';
16
16
  import { shortcutStyle } from '../../../ui/styles';
17
17
  import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
18
+ import { token } from '@atlaskit/tokens';
18
19
  export var ICON_HEIGHT = 40;
19
20
  export var ICON_WIDTH = 40;
20
21
  export var ITEM_PADDING = 12;
@@ -38,26 +39,26 @@ export var itemTheme = _defineProperty({}, itemThemeNamespace, {
38
39
  hover: {
39
40
  // background: colors.transparent, transparent is not a thing
40
41
  text: colorsText,
41
- secondaryText: N200
42
+ secondaryText: token('color.text.subtlest', N200)
42
43
  },
43
44
  selected: {
44
45
  background: themed({
45
- light: N20,
46
- dark: DN70
46
+ light: token('color.background.neutral.subtle.hovered', N20),
47
+ dark: token('color.background.neutral.subtle.hovered', DN70)
47
48
  }),
48
49
  text: themed({
49
- light: N800,
50
- dark: DN600
50
+ light: token('color.text', N800),
51
+ dark: token('color.text', DN600)
51
52
  }),
52
53
  secondaryText: themed({
53
- light: N200,
54
- dark: DN300
54
+ light: token('color.text.subtlest', N200),
55
+ dark: token('color.text.subtlest', DN300)
55
56
  })
56
57
  }
57
58
  });
58
- export var itemIcon = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", "px;\n height: ", "px;\n overflow: hidden;\n border: 1px solid rgba(223, 225, 229, 0.5); /* N60 at 50% */\n border-radius: ", "px;\n box-sizing: border-box;\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n div {\n width: ", "px;\n height: ", "px;\n }\n"])), ICON_WIDTH, ICON_HEIGHT, borderRadius(), ICON_WIDTH, ICON_HEIGHT);
59
+ export var itemIcon = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", "px;\n height: ", "px;\n overflow: hidden;\n border: 1px solid ", "; /* N60 at 50% */\n border-radius: ", "px;\n box-sizing: border-box;\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n div {\n width: ", "px;\n height: ", "px;\n }\n"])), ICON_WIDTH, ICON_HEIGHT, token('color.border', 'rgba(223, 225, 229, 0.5)'), borderRadius(), ICON_WIDTH, ICON_HEIGHT);
59
60
  var itemBody = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n line-height: 1.4;\n"])));
60
- var itemText = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n white-space: initial;\n .item-description {\n font-size: ", ";\n color: ", ";\n margin-top: 4px;\n }\n"])), relativeFontSizeToBase16(11.67), N200);
61
+ var itemText = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n white-space: initial;\n .item-description {\n font-size: ", ";\n color: ", ";\n margin-top: 4px;\n }\n"])), relativeFontSizeToBase16(11.67), token('color.text.subtlest', N200));
61
62
  var itemAfter = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n flex: 0 0 auto;\n"])));
62
63
  var hidden = {
63
64
  overflow: 'hidden'
@@ -1,18 +1,23 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
1
2
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
3
 
3
4
  var _templateObject;
4
5
 
5
6
  /** @jsx jsx */
6
- import React, { useEffect, useMemo } from 'react';
7
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
7
8
  import { css, jsx } from '@emotion/react';
9
+ import rafSchedule from 'raf-schd';
8
10
  import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
9
- import { Popup } from '@atlaskit/editor-common/ui';
11
+ import { findOverflowScrollParent, Popup } from '@atlaskit/editor-common/ui';
10
12
  import { borderRadius, gridSize } from '@atlaskit/theme/constants';
11
13
  import { N0, N60A, N50A } from '@atlaskit/theme/colors';
12
14
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../analytics';
13
15
  import { TYPE_AHEAD_POPUP_CONTENT_CLASS } from '../constants';
14
16
  import { TypeAheadList } from './TypeAheadList';
15
- var typeAheadContent = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", "px;\n box-shadow: 0 0 1px ", ", 0 4px 8px -2px ", ";\n padding: ", "px 0;\n width: 320px;\n max-height: 380px; /* ~5.5 visibile items */\n overflow-y: auto;\n -ms-overflow-style: -ms-autohiding-scrollbar;\n position: relative;\n"])), N0, borderRadius(), N60A, N50A, gridSize() / 2);
17
+ import { ITEM_PADDING } from './TypeAheadListItem';
18
+ import { token } from '@atlaskit/tokens';
19
+ var DEFAULT_TYPEAHEAD_MENU_HEIGHT = 380;
20
+ var typeAheadContent = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", "px;\n box-shadow: ", ";\n padding: ", "px 0;\n width: 320px;\n max-height: 380px; /* ~5.5 visibile items */\n overflow-y: auto;\n -ms-overflow-style: -ms-autohiding-scrollbar;\n position: relative;\n"])), token('elevation.surface.overlay', N0), borderRadius(), token('elevation.shadow.overlay', "0 0 1px ".concat(N60A, ", 0 4px 8px -2px ").concat(N50A)), gridSize() / 2);
16
21
 
17
22
  var Highlight = function Highlight(_ref) {
18
23
  var state = _ref.state,
@@ -91,13 +96,73 @@ export var TypeAheadPopup = /*#__PURE__*/React.memo(function (props) {
91
96
  // we need to send the event again
92
97
  // eslint-disable-next-line react-hooks/exhaustive-deps
93
98
  triggerHandler]);
99
+
100
+ var _useState = useState(DEFAULT_TYPEAHEAD_MENU_HEIGHT),
101
+ _useState2 = _slicedToArray(_useState, 2),
102
+ fitHeight = _useState2[0],
103
+ setFitHeight = _useState2[1];
104
+
105
+ var getFitHeight = useCallback(function () {
106
+ if (!anchorElement || !popupsMountPoint) {
107
+ return;
108
+ }
109
+
110
+ var target = anchorElement;
111
+
112
+ var _target$getBoundingCl = target.getBoundingClientRect(),
113
+ targetTop = _target$getBoundingCl.top,
114
+ targetHeight = _target$getBoundingCl.height;
115
+
116
+ var boundariesElement = document.body;
117
+
118
+ var _boundariesElement$ge = boundariesElement.getBoundingClientRect(),
119
+ boundariesHeight = _boundariesElement$ge.height,
120
+ boundariesTop = _boundariesElement$ge.top; // Calculating the space above and space below our decoration
121
+
122
+
123
+ var spaceAbove = targetTop - (boundariesTop - boundariesElement.scrollTop);
124
+ var spaceBelow = boundariesTop + boundariesHeight - (targetTop + targetHeight); // Keep default height if more than enough space
125
+
126
+ if (spaceBelow >= DEFAULT_TYPEAHEAD_MENU_HEIGHT) {
127
+ return setFitHeight(DEFAULT_TYPEAHEAD_MENU_HEIGHT);
128
+ } // Determines whether typeahead will fit above or below decoration
129
+ // and return the space available.
130
+
131
+
132
+ var newFitHeight = spaceBelow >= spaceAbove ? spaceBelow : spaceAbove; // Each typeahead item has some padding
133
+ // We want to leave some space at the top so first item
134
+ // is not partially cropped
135
+
136
+ var fitHeightWithSpace = newFitHeight - ITEM_PADDING * 2; // Ensure typeahead height is max its default height
137
+
138
+ var minFitHeight = Math.min(DEFAULT_TYPEAHEAD_MENU_HEIGHT, fitHeightWithSpace);
139
+ return setFitHeight(minFitHeight);
140
+ }, [anchorElement, popupsMountPoint]);
141
+ var getFitHeightDebounced = rafSchedule(getFitHeight);
142
+ useEffect(function () {
143
+ var scrollableElement = popupsScrollableElement || findOverflowScrollParent(anchorElement);
144
+ getFitHeight();
145
+ window.addEventListener('resize', getFitHeightDebounced);
146
+
147
+ if (scrollableElement) {
148
+ scrollableElement.addEventListener('scroll', getFitHeightDebounced);
149
+ }
150
+
151
+ return function () {
152
+ window.removeEventListener('resize', getFitHeightDebounced);
153
+
154
+ if (scrollableElement) {
155
+ scrollableElement.removeEventListener('scroll', getFitHeightDebounced);
156
+ }
157
+ };
158
+ }, [anchorElement, popupsScrollableElement, getFitHeightDebounced, getFitHeight]);
94
159
  return jsx(Popup, {
95
160
  zIndex: akEditorFloatingDialogZIndex,
96
161
  target: anchorElement,
97
162
  mountTo: popupsMountPoint,
98
163
  boundariesElement: popupsBoundariesElement,
99
164
  scrollableElement: popupsScrollableElement,
100
- fitHeight: 300,
165
+ fitHeight: fitHeight,
101
166
  fitWidth: 340,
102
167
  offset: OFFSET
103
168
  }, jsx("div", {
@@ -111,7 +176,8 @@ export var TypeAheadPopup = /*#__PURE__*/React.memo(function (props) {
111
176
  items: items,
112
177
  selectedIndex: selectedIndex,
113
178
  onItemHover: setSelectedItem,
114
- onItemClick: onItemInsert
179
+ onItemClick: onItemInsert,
180
+ fitHeight: fitHeight
115
181
  })));
116
182
  });
117
183
  TypeAheadPopup.displayName = 'TypeAheadPopup';