@atlaskit/editor-core 161.0.0 → 162.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/cjs/actions/index.js +76 -48
  3. package/dist/cjs/extensibility.js +2 -2
  4. package/dist/cjs/labs/next/full-page.js +2 -2
  5. package/dist/cjs/plugins/block-type/styles.js +5 -2
  6. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +13 -11
  7. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +11 -7
  8. package/dist/cjs/plugins/card/messages.js +4 -4
  9. package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +29 -11
  10. package/dist/cjs/plugins/card/ui/LinkToolbarButtonGroup.js +66 -7
  11. package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +166 -7
  12. package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +9 -6
  13. package/dist/cjs/plugins/card/ui/assets/card.js +1 -1
  14. package/dist/cjs/plugins/card/ui/assets/embed.js +1 -1
  15. package/dist/cjs/plugins/card/ui/assets/inline.js +1 -1
  16. package/dist/cjs/plugins/card/ui/assets/url.js +1 -1
  17. package/dist/cjs/plugins/card/ui/link-toolbar-button-group-options.js +60 -0
  18. package/dist/cjs/plugins/card/ui/link-toolbar-icon-dropdown-options.js +66 -0
  19. package/dist/cjs/plugins/card/ui/styled.js +5 -13
  20. package/dist/cjs/plugins/card/ui/types.js +5 -0
  21. package/dist/cjs/plugins/clipboard/pm-plugins/main.js +99 -3
  22. package/dist/cjs/plugins/code-block/styles.js +45 -38
  23. package/dist/cjs/plugins/extension/plugin-factory.js +4 -1
  24. package/dist/cjs/plugins/extension/pm-plugins/main.js +34 -11
  25. package/dist/cjs/plugins/extension/utils.js +57 -12
  26. package/dist/cjs/plugins/find-replace/ui/Find.js +12 -12
  27. package/dist/cjs/plugins/find-replace/ui/FindReplace.js +5 -5
  28. package/dist/cjs/plugins/find-replace/ui/Replace.js +5 -5
  29. package/dist/cjs/plugins/find-replace/ui/styles.js +12 -15
  30. package/dist/cjs/plugins/layout/styles.js +2 -2
  31. package/dist/cjs/plugins/list/actions/wrap-and-join-lists.js +180 -0
  32. package/dist/cjs/plugins/list/commands/index.js +35 -38
  33. package/dist/cjs/plugins/list/utils/replace-content.js +31 -0
  34. package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
  35. package/dist/cjs/plugins/media/styles.js +2 -2
  36. package/dist/cjs/plugins/media/utils/media-single.js +15 -2
  37. package/dist/cjs/plugins/paste/handlers.js +19 -5
  38. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +1 -1
  39. package/dist/cjs/plugins/placeholder-text/index.js +45 -1
  40. package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +66 -22
  41. package/dist/cjs/plugins/placeholder-text/selection-utils.js +19 -0
  42. package/dist/cjs/plugins/placeholder-text/styles.js +3 -1
  43. package/dist/cjs/plugins/table/commands/index.js +0 -6
  44. package/dist/cjs/plugins/table/commands/insert.js +1 -1
  45. package/dist/cjs/plugins/table/commands/misc.js +5 -18
  46. package/dist/cjs/plugins/table/commands-with-analytics.js +1 -1
  47. package/dist/cjs/plugins/table/handlers.js +6 -2
  48. package/dist/cjs/plugins/table/index.js +7 -13
  49. package/dist/cjs/plugins/table/nodeviews/TableComponent.js +2 -2
  50. package/dist/cjs/plugins/table/nodeviews/table.js +7 -38
  51. package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +2 -2
  52. package/dist/cjs/plugins/table/pm-plugins/main.js +3 -1
  53. package/dist/cjs/plugins/table/pm-plugins/plugin-factory.js +4 -7
  54. package/dist/cjs/plugins/table/pm-plugins/plugin-key.js +11 -0
  55. package/dist/cjs/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
  56. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +3 -3
  57. package/dist/cjs/plugins/table/reducer.js +0 -7
  58. package/dist/cjs/plugins/table/toolbar.js +5 -15
  59. package/dist/cjs/plugins/table/transforms/metadata.js +2 -2
  60. package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +1 -1
  61. package/dist/cjs/plugins/table/ui/FloatingContextualButton/{styles.css.js → styles.js} +0 -0
  62. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +4 -2
  63. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/{styles.css.js → styles.js} +0 -0
  64. package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +1 -1
  65. package/dist/cjs/plugins/table/ui/LayoutButton/index.js +1 -2
  66. package/dist/cjs/plugins/table/ui/common-styles.js +53 -0
  67. package/dist/cjs/plugins/table/ui/ui-styles.js +109 -0
  68. package/dist/cjs/plugins/table/utils/nodes.js +15 -15
  69. package/dist/cjs/plugins/tasks-and-decisions/commands.js +15 -1
  70. package/dist/cjs/plugins/text-formatting/styles.js +5 -2
  71. package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +71 -1
  72. package/dist/cjs/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
  73. package/dist/cjs/plugins/text-formatting/utils.js +30 -2
  74. package/dist/cjs/plugins/type-ahead/api.js +32 -1
  75. package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +20 -5
  76. package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +12 -0
  77. package/dist/cjs/plugins/type-ahead/utils.js +22 -4
  78. package/dist/cjs/ui/Appearance/Comment/Comment.js +2 -2
  79. package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +2 -2
  80. package/dist/cjs/ui/ContentStyles/index.js +33 -10
  81. package/dist/cjs/utils/index.js +1 -8
  82. package/dist/cjs/utils/insert.js +1 -9
  83. package/dist/cjs/utils/selection.js +2 -9
  84. package/dist/cjs/version-wrapper.js +1 -1
  85. package/dist/cjs/version.json +1 -1
  86. package/dist/es2019/actions/index.js +20 -23
  87. package/dist/es2019/extensibility.js +1 -1
  88. package/dist/es2019/labs/next/full-page.js +2 -2
  89. package/dist/es2019/plugins/block-type/styles.js +3 -3
  90. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +15 -12
  91. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +19 -14
  92. package/dist/es2019/plugins/card/messages.js +4 -4
  93. package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +21 -9
  94. package/dist/es2019/plugins/card/ui/LinkToolbarButtonGroup.js +54 -3
  95. package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +145 -3
  96. package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +10 -6
  97. package/dist/es2019/plugins/card/ui/assets/card.js +1 -1
  98. package/dist/es2019/plugins/card/ui/assets/embed.js +1 -1
  99. package/dist/es2019/plugins/card/ui/assets/inline.js +1 -1
  100. package/dist/es2019/plugins/card/ui/assets/url.js +1 -1
  101. package/dist/es2019/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
  102. package/dist/es2019/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
  103. package/dist/es2019/plugins/card/ui/styled.js +2 -2
  104. package/dist/es2019/plugins/card/ui/types.js +1 -0
  105. package/dist/es2019/plugins/clipboard/pm-plugins/main.js +91 -9
  106. package/dist/es2019/plugins/code-block/styles.js +14 -14
  107. package/dist/es2019/plugins/extension/plugin-factory.js +3 -1
  108. package/dist/es2019/plugins/extension/pm-plugins/main.js +38 -12
  109. package/dist/es2019/plugins/extension/utils.js +37 -2
  110. package/dist/es2019/plugins/find-replace/ui/Find.js +1 -1
  111. package/dist/es2019/plugins/find-replace/ui/FindReplace.js +1 -1
  112. package/dist/es2019/plugins/find-replace/ui/Replace.js +1 -1
  113. package/dist/es2019/plugins/find-replace/ui/styles.js +14 -9
  114. package/dist/es2019/plugins/layout/styles.js +5 -1
  115. package/dist/es2019/plugins/list/actions/wrap-and-join-lists.js +163 -0
  116. package/dist/es2019/plugins/list/commands/index.js +29 -28
  117. package/dist/es2019/plugins/list/utils/replace-content.js +22 -0
  118. package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
  119. package/dist/es2019/plugins/media/styles.js +1 -1
  120. package/dist/es2019/plugins/media/utils/media-single.js +14 -1
  121. package/dist/es2019/plugins/paste/handlers.js +19 -5
  122. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +2 -2
  123. package/dist/es2019/plugins/placeholder-text/index.js +46 -1
  124. package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +66 -20
  125. package/dist/es2019/plugins/placeholder-text/selection-utils.js +9 -0
  126. package/dist/es2019/plugins/placeholder-text/styles.js +22 -0
  127. package/dist/es2019/plugins/table/commands/index.js +1 -1
  128. package/dist/es2019/plugins/table/commands/insert.js +1 -1
  129. package/dist/es2019/plugins/table/commands/misc.js +5 -11
  130. package/dist/es2019/plugins/table/commands-with-analytics.js +1 -1
  131. package/dist/es2019/plugins/table/handlers.js +6 -2
  132. package/dist/es2019/plugins/table/index.js +4 -8
  133. package/dist/es2019/plugins/table/nodeviews/TableComponent.js +2 -2
  134. package/dist/es2019/plugins/table/nodeviews/table.js +2 -16
  135. package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +1 -1
  136. package/dist/es2019/plugins/table/pm-plugins/main.js +2 -1
  137. package/dist/es2019/plugins/table/pm-plugins/plugin-factory.js +1 -2
  138. package/dist/es2019/plugins/table/pm-plugins/plugin-key.js +2 -0
  139. package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
  140. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
  141. package/dist/es2019/plugins/table/reducer.js +0 -9
  142. package/dist/es2019/plugins/table/toolbar.js +1 -4
  143. package/dist/es2019/plugins/table/transforms/metadata.js +1 -1
  144. package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +1 -1
  145. package/dist/es2019/plugins/table/ui/FloatingContextualButton/{styles.css.js → styles.js} +0 -0
  146. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +3 -2
  147. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/{styles.css.js → styles.js} +0 -0
  148. package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +1 -1
  149. package/dist/es2019/plugins/table/ui/LayoutButton/index.js +1 -2
  150. package/dist/es2019/plugins/table/ui/{common-styles.css.js → common-styles.js} +57 -27
  151. package/dist/es2019/plugins/table/ui/{ui-styles.css.js → ui-styles.js} +99 -78
  152. package/dist/es2019/plugins/table/utils/nodes.js +11 -11
  153. package/dist/es2019/plugins/tasks-and-decisions/commands.js +13 -1
  154. package/dist/es2019/plugins/text-formatting/styles.js +3 -3
  155. package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +61 -2
  156. package/dist/es2019/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
  157. package/dist/es2019/plugins/text-formatting/utils.js +13 -1
  158. package/dist/es2019/plugins/type-ahead/api.js +31 -2
  159. package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +17 -5
  160. package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +12 -0
  161. package/dist/es2019/plugins/type-ahead/utils.js +15 -0
  162. package/dist/es2019/ui/Appearance/Comment/Comment.js +2 -2
  163. package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +2 -2
  164. package/dist/es2019/ui/ContentStyles/index.js +46 -24
  165. package/dist/es2019/utils/index.js +1 -1
  166. package/dist/es2019/utils/insert.js +2 -10
  167. package/dist/es2019/utils/selection.js +1 -6
  168. package/dist/es2019/version-wrapper.js +1 -1
  169. package/dist/es2019/version.json +1 -1
  170. package/dist/esm/actions/index.js +76 -48
  171. package/dist/esm/extensibility.js +1 -1
  172. package/dist/esm/labs/next/full-page.js +2 -2
  173. package/dist/esm/plugins/block-type/styles.js +4 -2
  174. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +14 -12
  175. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +9 -5
  176. package/dist/esm/plugins/card/messages.js +4 -4
  177. package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +25 -9
  178. package/dist/esm/plugins/card/ui/LinkToolbarButtonGroup.js +57 -5
  179. package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +154 -5
  180. package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +9 -6
  181. package/dist/esm/plugins/card/ui/assets/card.js +1 -1
  182. package/dist/esm/plugins/card/ui/assets/embed.js +1 -1
  183. package/dist/esm/plugins/card/ui/assets/inline.js +1 -1
  184. package/dist/esm/plugins/card/ui/assets/url.js +1 -1
  185. package/dist/esm/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
  186. package/dist/esm/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
  187. package/dist/esm/plugins/card/ui/styled.js +2 -2
  188. package/dist/esm/plugins/card/ui/types.js +1 -0
  189. package/dist/esm/plugins/clipboard/pm-plugins/main.js +91 -2
  190. package/dist/esm/plugins/code-block/styles.js +42 -38
  191. package/dist/esm/plugins/extension/plugin-factory.js +3 -1
  192. package/dist/esm/plugins/extension/pm-plugins/main.js +34 -11
  193. package/dist/esm/plugins/extension/utils.js +51 -9
  194. package/dist/esm/plugins/find-replace/ui/Find.js +1 -1
  195. package/dist/esm/plugins/find-replace/ui/FindReplace.js +1 -1
  196. package/dist/esm/plugins/find-replace/ui/Replace.js +1 -1
  197. package/dist/esm/plugins/find-replace/ui/styles.js +6 -10
  198. package/dist/esm/plugins/layout/styles.js +2 -2
  199. package/dist/esm/plugins/list/actions/wrap-and-join-lists.js +168 -0
  200. package/dist/esm/plugins/list/commands/index.js +33 -34
  201. package/dist/esm/plugins/list/utils/replace-content.js +21 -0
  202. package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
  203. package/dist/esm/plugins/media/styles.js +1 -1
  204. package/dist/esm/plugins/media/utils/media-single.js +12 -1
  205. package/dist/esm/plugins/paste/handlers.js +19 -5
  206. package/dist/esm/plugins/paste/pm-plugins/analytics.js +2 -2
  207. package/dist/esm/plugins/placeholder-text/index.js +44 -1
  208. package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +67 -20
  209. package/dist/esm/plugins/placeholder-text/selection-utils.js +9 -0
  210. package/dist/esm/plugins/placeholder-text/styles.js +2 -1
  211. package/dist/esm/plugins/table/commands/index.js +1 -1
  212. package/dist/esm/plugins/table/commands/insert.js +1 -1
  213. package/dist/esm/plugins/table/commands/misc.js +5 -15
  214. package/dist/esm/plugins/table/commands-with-analytics.js +1 -1
  215. package/dist/esm/plugins/table/handlers.js +6 -2
  216. package/dist/esm/plugins/table/index.js +6 -11
  217. package/dist/esm/plugins/table/nodeviews/TableComponent.js +2 -2
  218. package/dist/esm/plugins/table/nodeviews/table.js +6 -37
  219. package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +1 -1
  220. package/dist/esm/plugins/table/pm-plugins/main.js +2 -1
  221. package/dist/esm/plugins/table/pm-plugins/plugin-factory.js +1 -2
  222. package/dist/esm/plugins/table/pm-plugins/plugin-key.js +2 -0
  223. package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
  224. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
  225. package/dist/esm/plugins/table/reducer.js +0 -7
  226. package/dist/esm/plugins/table/toolbar.js +1 -10
  227. package/dist/esm/plugins/table/transforms/metadata.js +1 -1
  228. package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +1 -1
  229. package/dist/esm/plugins/table/ui/FloatingContextualButton/{styles.css.js → styles.js} +0 -0
  230. package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +3 -2
  231. package/dist/esm/plugins/table/ui/FloatingContextualMenu/{styles.css.js → styles.js} +0 -0
  232. package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +1 -1
  233. package/dist/esm/plugins/table/ui/LayoutButton/index.js +1 -2
  234. package/dist/esm/plugins/table/ui/common-styles.js +27 -0
  235. package/dist/esm/plugins/table/ui/ui-styles.js +68 -0
  236. package/dist/esm/plugins/table/utils/nodes.js +14 -14
  237. package/dist/esm/plugins/tasks-and-decisions/commands.js +13 -1
  238. package/dist/esm/plugins/text-formatting/styles.js +4 -2
  239. package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +69 -2
  240. package/dist/esm/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
  241. package/dist/esm/plugins/text-formatting/utils.js +18 -0
  242. package/dist/esm/plugins/type-ahead/api.js +30 -2
  243. package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +16 -4
  244. package/dist/esm/plugins/type-ahead/ui/InputQuery.js +12 -0
  245. package/dist/esm/plugins/type-ahead/utils.js +17 -3
  246. package/dist/esm/ui/Appearance/Comment/Comment.js +2 -2
  247. package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +2 -2
  248. package/dist/esm/ui/ContentStyles/index.js +28 -10
  249. package/dist/esm/utils/index.js +1 -1
  250. package/dist/esm/utils/insert.js +2 -10
  251. package/dist/esm/utils/selection.js +1 -6
  252. package/dist/esm/version-wrapper.js +1 -1
  253. package/dist/esm/version.json +1 -1
  254. package/dist/types/actions/index.d.ts +2 -2
  255. package/dist/types/extensibility.d.ts +1 -1
  256. package/dist/types/plugins/analytics/types/list-events.d.ts +0 -1
  257. package/dist/types/plugins/block-type/styles.d.ts +2 -1
  258. package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -0
  259. package/dist/types/plugins/block-type/ui/ToolbarBlockType/styled.d.ts +2 -7
  260. package/dist/types/plugins/card/messages.d.ts +2 -2
  261. package/dist/types/plugins/card/ui/LinkToolbarButtonGroup.d.ts +18 -2
  262. package/dist/types/plugins/card/ui/LinkToolbarIconDropdown.d.ts +23 -3
  263. package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +3 -1
  264. package/dist/types/plugins/card/ui/link-toolbar-button-group-options.d.ts +5 -0
  265. package/dist/types/plugins/card/ui/link-toolbar-icon-dropdown-options.d.ts +5 -0
  266. package/dist/types/plugins/card/ui/styled.d.ts +2 -3
  267. package/dist/types/plugins/card/ui/types.d.ts +12 -0
  268. package/dist/types/plugins/clipboard/pm-plugins/main.d.ts +10 -1
  269. package/dist/types/plugins/code-block/styles.d.ts +3 -2
  270. package/dist/types/plugins/extension/pm-plugins/main.d.ts +2 -1
  271. package/dist/types/plugins/extension/types.d.ts +1 -0
  272. package/dist/types/plugins/extension/utils.d.ts +3 -1
  273. package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +2 -1
  274. package/dist/types/plugins/find-replace/ui/styles.d.ts +5 -5
  275. package/dist/types/plugins/layout/styles.d.ts +1 -1
  276. package/dist/types/plugins/list/actions/wrap-and-join-lists.d.ts +25 -0
  277. package/dist/types/plugins/list/commands/index.d.ts +0 -1
  278. package/dist/types/plugins/list/utils/replace-content.d.ts +8 -0
  279. package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -2
  280. package/dist/types/plugins/media/styles.d.ts +1 -1
  281. package/dist/types/plugins/media/utils/media-single.d.ts +1 -0
  282. package/dist/types/plugins/panel/styles.d.ts +1 -1
  283. package/dist/types/plugins/paste/handlers.d.ts +1 -1
  284. package/dist/types/plugins/placeholder-text/placeholder-text-nodeview.d.ts +3 -2
  285. package/dist/types/plugins/placeholder-text/selection-utils.d.ts +2 -0
  286. package/dist/types/plugins/rule/styles.d.ts +1 -1
  287. package/dist/types/plugins/table/commands/index.d.ts +1 -1
  288. package/dist/types/plugins/table/commands/misc.d.ts +0 -1
  289. package/dist/types/plugins/table/nodeviews/table.d.ts +0 -1
  290. package/dist/types/plugins/table/pm-plugins/plugin-factory.d.ts +1 -4
  291. package/dist/types/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
  292. package/dist/types/plugins/table/types.d.ts +1 -8
  293. package/dist/types/plugins/table/ui/FloatingContextualButton/{styles.css.d.ts → styles.d.ts} +0 -0
  294. package/dist/types/plugins/table/ui/FloatingContextualMenu/{styles.css.d.ts → styles.d.ts} +0 -0
  295. package/dist/types/plugins/table/ui/LayoutButton/index.d.ts +0 -1
  296. package/dist/types/plugins/table/ui/common-styles.d.ts +6 -0
  297. package/dist/types/plugins/table/ui/ui-styles.d.ts +15 -0
  298. package/dist/types/plugins/table/utils/nodes.d.ts +6 -6
  299. package/dist/types/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +1 -1
  300. package/dist/types/plugins/text-formatting/styles.d.ts +2 -1
  301. package/dist/types/plugins/text-formatting/ui/Toolbar/toolbar-messages.d.ts +30 -0
  302. package/dist/types/plugins/text-formatting/utils.d.ts +4 -0
  303. package/dist/types/plugins/type-ahead/api.d.ts +11 -1
  304. package/dist/types/plugins/type-ahead/transforms/open-typeahead-at-cursor.d.ts +1 -0
  305. package/dist/types/plugins/type-ahead/utils.d.ts +4 -0
  306. package/dist/types/ui/ContentStyles/index.d.ts +1 -0
  307. package/dist/types/utils/index.d.ts +1 -1
  308. package/dist/types/utils/selection.d.ts +0 -1
  309. package/package.json +28 -26
  310. package/dist/cjs/plugins/table/ui/common-styles.css.js +0 -44
  311. package/dist/cjs/plugins/table/ui/ui-styles.css.js +0 -95
  312. package/dist/esm/plugins/table/ui/common-styles.css.js +0 -23
  313. package/dist/esm/plugins/table/ui/ui-styles.css.js +0 -59
  314. package/dist/types/plugins/table/ui/common-styles.css.d.ts +0 -3
  315. package/dist/types/plugins/table/ui/ui-styles.css.d.ts +0 -14
@@ -432,7 +432,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
432
432
  if (this.overflowShadowsObserver) {
433
433
  var _this$state$stickyHea;
434
434
 
435
- this.overflowShadowsObserver.observeCells((_this$state$stickyHea = this.state.stickyHeader) === null || _this$state$stickyHea === void 0 ? void 0 : _this$state$stickyHea.sticky, containsHeaderRow(view.state, getNode()));
435
+ this.overflowShadowsObserver.observeCells((_this$state$stickyHea = this.state.stickyHeader) === null || _this$state$stickyHea === void 0 ? void 0 : _this$state$stickyHea.sticky, containsHeaderRow(getNode()));
436
436
  }
437
437
  }
438
438
 
@@ -507,7 +507,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
507
507
  var headerRow = tableRef ? tableRef.querySelector('tr[data-header-row]') : undefined; //dont need to change tableHeight with tableRenderOptimization because it will be observed inside floating components
508
508
 
509
509
  var tableHeight = tableRef && !tableRenderOptimization ? tableRef.offsetHeight : undefined;
510
- var hasHeaderRow = containsHeaderRow(view.state, node);
510
+ var hasHeaderRow = containsHeaderRow(node);
511
511
  var rowControls = /*#__PURE__*/React.createElement("div", {
512
512
  className: ClassName.ROW_CONTROLS_WRAPPER
513
513
  }, /*#__PURE__*/React.createElement(TableFloatingControls, {
@@ -9,12 +9,6 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
10
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
11
11
 
12
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
13
-
14
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15
-
16
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
17
-
18
12
  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); }; }
19
13
 
20
14
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
@@ -25,12 +19,12 @@ import ReactNodeView from '../../../nodeviews/ReactNodeView';
25
19
  import WithPluginState from '../../../ui/WithPluginState';
26
20
  import { pluginKey as widthPluginKey } from '../../width';
27
21
  import { pluginConfig as getPluginConfig } from '../create-plugin-config';
28
- import { getPluginState, pluginKey } from '../pm-plugins/plugin-factory';
22
+ import { getPluginState } from '../pm-plugins/plugin-factory';
23
+ import { pluginKey } from '../pm-plugins/plugin-key';
29
24
  import { pluginKey as tableResizingPluginKey } from '../pm-plugins/table-resizing';
30
25
  import { generateColgroup } from '../pm-plugins/table-resizing/utils';
31
26
  import { TableMap } from '@atlaskit/editor-tables/table-map';
32
27
  import TableComponent from './TableComponent';
33
- import { setTableSize } from '../commands';
34
28
  import { getFeatureFlags } from '../../feature-flags-context';
35
29
  import { EmitterEvents } from '../../../extensibility';
36
30
 
@@ -72,7 +66,6 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
72
66
  _defineProperty(_assertThisInitialized(_this), "hasHoveredRows", false);
73
67
 
74
68
  _this.getPos = props.getPos;
75
- _this.editorView = props.view;
76
69
  _this.tableRenderOptimization = props.tableRenderOptimization;
77
70
  _this.eventDispatcher = props.eventDispatcher;
78
71
  return _this;
@@ -81,42 +74,18 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
81
74
  _createClass(TableView, [{
82
75
  key: "getContentDOM",
83
76
  value: function getContentDOM() {
84
- var _window,
85
- _this2 = this;
86
-
87
77
  var rendered = DOMSerializer.renderSpec(document, toDOM(this.node, this.reactComponentProps));
88
78
 
89
79
  if (rendered.dom) {
90
80
  this.table = rendered.dom;
91
81
  }
92
82
 
93
- if (this.tableRenderOptimization && this.table && !this.resizeObserver && (_window = window) !== null && _window !== void 0 && _window.ResizeObserver) {
94
- this.resizeObserver = new ResizeObserver(function (entries) {
95
- var _iterator = _createForOfIteratorHelper(entries),
96
- _step;
97
-
98
- try {
99
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
100
- var entry = _step.value;
101
- var height = entry.contentRect ? entry.contentRect.height : entry.target.offsetHeight;
102
- var width = entry.contentRect ? entry.contentRect.width : entry.target.offsetWidth;
103
- setTableSize(height, width)(_this2.editorView.state, _this2.editorView.dispatch);
104
- }
105
- } catch (err) {
106
- _iterator.e(err);
107
- } finally {
108
- _iterator.f();
109
- }
110
- });
111
- this.resizeObserver.observe(this.table);
112
- }
113
-
114
83
  return rendered;
115
84
  }
116
85
  }, {
117
86
  key: "setDomAttrs",
118
87
  value: function setDomAttrs(node) {
119
- var _this3 = this;
88
+ var _this2 = this;
120
89
 
121
90
  if (!this.table) {
122
91
  return;
@@ -124,13 +93,13 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
124
93
 
125
94
  var attrs = tableAttributes(node);
126
95
  Object.keys(attrs).forEach(function (attr) {
127
- _this3.table.setAttribute(attr, attrs[attr]);
96
+ _this2.table.setAttribute(attr, attrs[attr]);
128
97
  });
129
98
  }
130
99
  }, {
131
100
  key: "render",
132
101
  value: function render(props, forwardRef) {
133
- var _this4 = this;
102
+ var _this3 = this;
134
103
 
135
104
  return /*#__PURE__*/React.createElement(WithPluginState, {
136
105
  plugins: {
@@ -156,7 +125,7 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
156
125
  tableActive: tableActive,
157
126
  ordering: pluginState.ordering,
158
127
  tableResizingPluginState: tableResizingPluginState,
159
- getNode: _this4.getNode,
128
+ getNode: _this3.getNode,
160
129
  containerWidth: containerWidth,
161
130
  contentDOM: forwardRef
162
131
  });
@@ -2,7 +2,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { PluginKey } from 'prosemirror-state';
3
3
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
4
4
  import { DecorationSet } from 'prosemirror-view';
5
- import { pluginKey as tablePluginKey } from '../plugin-factory';
5
+ import { pluginKey as tablePluginKey } from '../plugin-key';
6
6
  import { buildColumnControlsDecorations, maybeUpdateColumnControlsSelectedDecoration } from './utils';
7
7
  export var pluginKey = new PluginKey('tableDecorationsPlugin');
8
8
  export var getDecorations = function getDecorations(state) {
@@ -18,7 +18,8 @@ import { TableCssClassName as ClassName } from '../types';
18
18
  import { findControlsHoverDecoration, updateResizeHandles } from '../utils';
19
19
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '../../analytics';
20
20
  import { defaultTableSelection } from './default-table-selection';
21
- import { createPluginState, getPluginState, pluginKey } from './plugin-factory';
21
+ import { createPluginState, getPluginState } from './plugin-factory';
22
+ import { pluginKey } from './plugin-key';
22
23
  import TableCellNodeView from '../nodeviews/tableCell';
23
24
  var isBreakoutEnabled;
24
25
  var isDynamicTextSizingEnabled;
@@ -4,11 +4,10 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
4
4
 
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
6
 
7
- import { PluginKey } from 'prosemirror-state';
8
7
  import { pluginFactory } from '../../../utils/plugin-state-factory';
9
8
  import { handleDocOrSelectionChanged } from '../handlers';
10
9
  import reducer from '../reducer';
11
- export var pluginKey = new PluginKey('tablePlugin');
10
+ import { pluginKey } from './plugin-key';
12
11
 
13
12
  var _pluginFactory = pluginFactory(pluginKey, reducer, {
14
13
  mapping: function mapping(tr, pluginState) {
@@ -0,0 +1,2 @@
1
+ import { PluginKey } from 'prosemirror-state';
2
+ export var pluginKey = new PluginKey('tablePlugin');
@@ -22,6 +22,8 @@ export var createPlugin = function createPlugin() {
22
22
  // DOM selection syncing during pointer drag.
23
23
  //
24
24
  // https://github.com/ProseMirror/prosemirror-view/commit/885258b80551ac87b81601d3ed25f552aeb22293
25
+ // NOTE: this workaround can be removed when next upgrading prosemirror as the issue will be fixed
26
+ // https://github.com/ProseMirror/prosemirror-view/pull/116
25
27
  // This fix removes the selectionToDOM from the view
26
28
  // prior to selectionToDOM being called.
27
29
  // selectionToDOM checks if there is an "active"
@@ -6,7 +6,7 @@ import { pluginKey as widthPluginKey } from '../../../../../plugins/width';
6
6
  import { mapChildren } from '../../../../../utils/slice';
7
7
  import { TableCssClassName as ClassName, TableCssClassName } from '../../../types';
8
8
  import { stickyHeaderBorderBottomWidth, stickyRowOffsetTop, tableControlsSpacing, tableScrollbarOffset } from '../../../ui/consts';
9
- import { pluginKey as tablePluginKey } from '../../plugin-factory';
9
+ import { pluginKey as tablePluginKey } from '../../plugin-key';
10
10
  import { syncStickyRowToTable, updateStickyMargins as updateTableMargin } from '../../table-resizing/utils/dom';
11
11
  import { updateStickyState } from '../commands';
12
12
  import { getTop, getTree } from './dom';
@@ -80,13 +80,6 @@ export default (function (pluginState, action) {
80
80
 
81
81
  return _objectSpread(_objectSpread({}, pluginState), action.data);
82
82
 
83
- case 'SET_TABLE_SIZE':
84
- if (pluginState.tableWidth !== action.data.tableWidth || pluginState.tableHeight !== action.data.tableHeight) {
85
- return _objectSpread(_objectSpread({}, pluginState), action.data);
86
- }
87
-
88
- return pluginState;
89
-
90
83
  case 'SET_TABLE_REF':
91
84
  case 'HOVER_ROWS':
92
85
  case 'HOVER_COLUMNS':
@@ -1,10 +1,4 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
-
4
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
-
6
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
-
8
2
  import { defineMessages } from 'react-intl-next';
9
3
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
10
4
  import commonMessages from '../../messages';
@@ -13,7 +7,6 @@ import { deleteTableWithAnalytics, toggleHeaderColumnWithAnalytics, toggleHeader
13
7
  import { getPluginState } from './pm-plugins/plugin-factory';
14
8
  import { pluginKey as tableResizingPluginKey } from './pm-plugins/table-resizing';
15
9
  import { TableCssClassName } from './types';
16
- import { checkIfNumberColumnEnabled } from './utils';
17
10
  import { isReferencedSource } from './utils/referentiality';
18
11
  import { INPUT_METHOD } from '../analytics';
19
12
  import { findCellRectClosestToPos, findTable, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
@@ -214,9 +207,7 @@ export var getToolbarConfig = function getToolbarConfig(config) {
214
207
 
215
208
  if (tableObject && pluginState.editorHasFocus) {
216
209
  var nodeType = state.schema.nodes.table;
217
- var menu = getToolbarMenuConfig(config, _objectSpread(_objectSpread({}, pluginState), {}, {
218
- isNumberColumnEnabled: checkIfNumberColumnEnabled(state)
219
- }), intl);
210
+ var menu = getToolbarMenuConfig(config, pluginState, intl);
220
211
  var cellItems = getCellItems(config, state, intl); // Check if we need to show confirm dialog for delete button
221
212
 
222
213
  var confirmDialog;
@@ -1,4 +1,4 @@
1
- import { pluginKey } from '../pm-plugins/plugin-factory';
1
+ import { pluginKey } from '../pm-plugins/plugin-key';
2
2
  import { fireAnalytics } from './fix-tables'; // Set metadata on a ProseMirror transaction for debugging purposes in Synchrony
3
3
 
4
4
  export var setMeta = function setMeta(meta) {
@@ -27,7 +27,7 @@ import { TableCssClassName as ClassName } from '../../types';
27
27
  import messages from '../../ui/messages';
28
28
  import { CONTENT_COMPONENT } from '../../../analytics/types';
29
29
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../../analytics';
30
- import { tableFloatingCellButtonStyles } from './styles.css';
30
+ import { tableFloatingCellButtonStyles } from './styles';
31
31
  import { ErrorBoundary } from '../../../../ui/ErrorBoundary';
32
32
  var ButtonWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n"])), tableFloatingCellButtonStyles);
33
33
  export var FloatingContextualButtonInner = /*#__PURE__*/function (_React$Component) {
@@ -8,9 +8,10 @@ import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@at
8
8
  import styled from 'styled-components';
9
9
  import { Popup } from '@atlaskit/editor-common/ui';
10
10
  import { akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
11
- import { getPluginState, pluginKey } from '../../pm-plugins/plugin-factory';
11
+ import { getPluginState } from '../../pm-plugins/plugin-factory';
12
+ import { pluginKey } from '../../pm-plugins/plugin-key';
12
13
  import { contextualMenuDropdownWidth, contextualMenuTriggerSize } from '../consts';
13
- import { tablePopupStyles } from './styles.css';
14
+ import { tablePopupStyles } from './styles';
14
15
  import ContextualMenu from './ContextualMenu';
15
16
  var MenuWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n"])), tablePopupStyles); // offset of the contextual menu dropdown
16
17
 
@@ -127,7 +127,7 @@ export var FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
127
127
  var tableContainerWrapper = closestElement(targetCellRef, ".".concat(ClassName.TABLE_CONTAINER));
128
128
  var tableWrapper = closestElement(targetCellRef, ".".concat(ClassName.TABLE_NODE_WRAPPER));
129
129
  var index = type === 'column' ? insertColumnButtonIndex : insertRowButtonIndex;
130
- var hasNumberedColumns = checkIfNumberColumnEnabled(editorView.state);
130
+ var hasNumberedColumns = checkIfNumberColumnEnabled(editorView.state.selection);
131
131
  return /*#__PURE__*/React.createElement(Popup, _extends({
132
132
  target: targetCellRef,
133
133
  mountTo: tableContainerWrapper || mountPoint,
@@ -212,9 +212,8 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
212
212
  targetRef = _this$props4.targetRef,
213
213
  layout = _this$props4.layout,
214
214
  isResizing = _this$props4.isResizing,
215
- tableWidth = _this$props4.tableWidth,
216
215
  stickyHeader = _this$props4.stickyHeader;
217
- return stickyHeader !== nextProps.stickyHeader || targetRef !== nextProps.targetRef || layout !== nextProps.layout || isResizing !== nextProps.isResizing || tableWidth !== nextProps.tableWidth;
216
+ return stickyHeader !== nextProps.stickyHeader || targetRef !== nextProps.targetRef || layout !== nextProps.layout || isResizing !== nextProps.isResizing;
218
217
  }
219
218
  }]);
220
219
 
@@ -0,0 +1,27 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+
3
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
4
+
5
+ import { css } from '@emotion/react';
6
+ import { css as deprecatedCss } from 'styled-components';
7
+ import { tableMarginTop, tableSharedStyle } from '@atlaskit/editor-common/styles';
8
+ import { fontSize } from '@atlaskit/theme/constants';
9
+ import { N40A, B300, N300, N20A, N0, R500 } from '@atlaskit/theme/colors';
10
+ import { SelectionStyle, getSelectionStyles, akEditorSmallZIndex, akEditorTableNumberColumnWidth, akEditorStickyHeaderZIndex, akEditorTableToolbarSize, akEditorUnitZIndex, akEditorSelectedNodeClassName, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
11
+ import { scrollbarStyles } from '../../../ui/styles';
12
+ import { TableCssClassName as ClassName } from '../types';
13
+ 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';
14
+ import { HeaderButton, HeaderButtonHover, HeaderButtonDanger, insertColumnButtonWrapper, insertRowButtonWrapper, columnControlsLineMarker, DeleteButton, OverflowShadow, columnControlsDecoration, hoveredDeleteButton, hoveredCell, hoveredWarningCell, resizeHandle, InsertMarker } from './ui-styles';
15
+ var cornerControlHeight = tableToolbarSize + 1;
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");
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}");
18
+ export var tableStyles = function tableStyles(props) {
19
+ var _props$featureFlags;
20
+
21
+ 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\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"])), 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
+ };
23
+ 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);
24
+ export var deprecatedTableFullPageEditorStyles = deprecatedCss(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n width: 100%;\n }\n"])), ClassName.TABLE_NODE_WRAPPER);
25
+ export var tableCommentEditorStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n ", ";\n }\n"])), ClassName.TABLE_NODE_WRAPPER, scrollbarStyles); // TODO remove this after migrated off styled-component
26
+
27
+ export var deprecatedTableCommentEditorStyles = deprecatedCss(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n ", ";\n }\n"])), ClassName.TABLE_NODE_WRAPPER, scrollbarStyles);
@@ -0,0 +1,68 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+
3
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21;
4
+
5
+ import { css } from '@emotion/react';
6
+ import { tableCellBorderWidth, tableMarginBottom, tableMarginTop } from '@atlaskit/editor-common/styles';
7
+ import { akEditorShadowZIndex, akEditorTableNumberColumnWidth, akEditorUnitZIndex } from '@atlaskit/editor-shared-styles';
8
+ import { N40A, B300, N300, R300, N20A, N60A, N0, Y50, Y200 } from '@atlaskit/theme/colors';
9
+ import { tableToolbarColor, tableBorderColor, tableToolbarSelectedColor, tableBorderSelectedColor, tableCellDeleteColor, tableBorderDeleteColor, tableToolbarDeleteColor, lineMarkerOffsetFromColumnControls, lineMarkerSize, columnControlsDecorationHeight, columnControlsZIndex, columnControlsSelectedZIndex, resizeHandlerAreaWidth, resizeLineWidth, resizeHandlerZIndex, tableToolbarSize, tableInsertColumnButtonSize, tableDeleteButtonSize, tableControlsSpacing } from './consts';
10
+ import { TableCssClassName as ClassName } from '../types';
11
+ import { borderRadius } from '@atlaskit/theme/constants';
12
+
13
+ var InsertLine = function InsertLine(cssString) {
14
+ 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);
15
+ };
16
+
17
+ var Marker = function Marker(props) {
18
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-color: ", ";\n position: absolute;\n height: ", "px;\n width: ", "px;\n border-radius: 50%;\n pointer-events: none;\n"])), tableBorderColor(props), lineMarkerSize, lineMarkerSize);
19
+ };
20
+
21
+ export var InsertMarker = function InsertMarker(props, cssString) {
22
+ return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .", " {\n ", ";\n ", "\n }\n"])), ClassName.CONTROLS_INSERT_MARKER, Marker(props), cssString);
23
+ };
24
+
25
+ var Button = function Button(cssString) {
26
+ return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border-radius: ", "px;\n border-width: 0px;\n display: inline-flex;\n max-width: 100%;\n text-align: center;\n margin: 0px;\n padding: 0px;\n text-decoration: none;\n transition: background 0.1s ease-out 0s,\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\n outline: none !important;\n cursor: none;\n\n > .", " {\n display: inline-flex;\n max-height: 100%;\n max-width: 100%;\n }\n ", "\n"])), borderRadius(), ClassName.CONTROLS_BUTTON_ICON, cssString);
27
+ };
28
+
29
+ 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
+ };
32
+ 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
+ };
35
+ export var HeaderButtonDanger = function HeaderButtonDanger() {
36
+ 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
+
39
+ 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
+ };
42
+
43
+ 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
+ };
46
+
47
+ export var insertColumnButtonWrapper = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n"])), InsertButton(), InsertButtonHover(), InsertLine("\n width: 2px;\n left: 9px;\n "));
48
+ 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
+ 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
+ };
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 OverflowShadow = function OverflowShadow(props) {
54
+ 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
+ };
56
+
57
+ var columnHeaderButton = function columnHeaderButton(props, cssString) {
58
+ 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
+ };
60
+
61
+ var columnHeaderButtonSelected = css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n z-index: ", ";\n"])), N0, tableToolbarSelectedColor, tableBorderSelectedColor, columnControlsSelectedZIndex);
62
+ 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);
64
+ };
65
+ 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
+ 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);
@@ -2,11 +2,11 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import { TableMap } from '@atlaskit/editor-tables/table-map';
3
3
  import { hasParentNodeOfType } from 'prosemirror-utils';
4
4
  import { findTable } from '@atlaskit/editor-tables/utils';
5
- import { pluginKey } from '../pm-plugins/plugin-factory';
5
+ import { pluginKey } from '../pm-plugins/plugin-key';
6
6
  export var isIsolating = function isIsolating(node) {
7
7
  return !!node.type.spec.isolating;
8
8
  };
9
- export var containsHeaderColumn = function containsHeaderColumn(state, table) {
9
+ export var containsHeaderColumn = function containsHeaderColumn(table) {
10
10
  var map = TableMap.get(table); // Get cell positions for first column.
11
11
 
12
12
  var cellPositions = map.cellsInRect({
@@ -20,7 +20,7 @@ export var containsHeaderColumn = function containsHeaderColumn(state, table) {
20
20
  try {
21
21
  var cell = table.nodeAt(cellPositions[i]);
22
22
 
23
- if (cell && cell.type !== state.schema.nodes.tableHeader) {
23
+ if (cell && cell.type !== table.type.schema.nodes.tableHeader) {
24
24
  return false;
25
25
  }
26
26
  } catch (e) {
@@ -30,27 +30,27 @@ export var containsHeaderColumn = function containsHeaderColumn(state, table) {
30
30
 
31
31
  return true;
32
32
  };
33
- export var containsHeaderRow = function containsHeaderRow(state, table) {
33
+ export var containsHeaderRow = function containsHeaderRow(table) {
34
34
  var map = TableMap.get(table);
35
35
 
36
36
  for (var i = 0; i < map.width; i++) {
37
37
  var cell = table.nodeAt(map.map[i]);
38
38
 
39
- if (cell && cell.type !== state.schema.nodes.tableHeader) {
39
+ if (cell && cell.type !== table.type.schema.nodes.tableHeader) {
40
40
  return false;
41
41
  }
42
42
  }
43
43
 
44
44
  return true;
45
45
  };
46
- export var checkIfHeaderColumnEnabled = function checkIfHeaderColumnEnabled(state) {
47
- return filterNearSelection(state, findTable, containsHeaderColumn, false);
46
+ export var checkIfHeaderColumnEnabled = function checkIfHeaderColumnEnabled(selection) {
47
+ return filterNearSelection(selection, findTable, containsHeaderColumn, false);
48
48
  };
49
- export var checkIfHeaderRowEnabled = function checkIfHeaderRowEnabled(state) {
50
- return filterNearSelection(state, findTable, containsHeaderRow, false);
49
+ export var checkIfHeaderRowEnabled = function checkIfHeaderRowEnabled(selection) {
50
+ return filterNearSelection(selection, findTable, containsHeaderRow, false);
51
51
  };
52
- export var checkIfNumberColumnEnabled = function checkIfNumberColumnEnabled(state) {
53
- return filterNearSelection(state, findTable, function (_, table) {
52
+ export var checkIfNumberColumnEnabled = function checkIfNumberColumnEnabled(selection) {
53
+ return filterNearSelection(selection, findTable, function (table) {
54
54
  return !!table.attrs.isNumberColumnEnabled;
55
55
  }, false);
56
56
  };
@@ -86,14 +86,14 @@ export var tablesHaveDifferentNoOfColumns = function tablesHaveDifferentNoOfColu
86
86
  return prevMap.width !== currentMap.width;
87
87
  };
88
88
 
89
- function filterNearSelection(state, findNode, predicate, defaultValue) {
90
- var found = findNode(state.selection);
89
+ function filterNearSelection(selection, findNode, predicate, defaultValue) {
90
+ var found = findNode(selection);
91
91
 
92
92
  if (!found) {
93
93
  return defaultValue;
94
94
  }
95
95
 
96
- return predicate(state, found.node, found.pos);
96
+ return predicate(found.node, found.pos);
97
97
  }
98
98
 
99
99
  function getTableWidths(node) {
@@ -1,6 +1,8 @@
1
1
  import { autoJoin } from 'prosemirror-commands';
2
+ import { NodeRange } from 'prosemirror-model';
2
3
  import { TextSelection } from 'prosemirror-state';
3
4
  import { findParentNodeOfType, hasParentNodeOfType, replaceParentNodeOfType, safeInsert, setTextSelection } from 'prosemirror-utils';
5
+ import { liftTarget } from 'prosemirror-transform';
4
6
  import { uuid } from '@atlaskit/adf-schema';
5
7
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, EVENT_TYPE, INPUT_METHOD, USER_CONTEXT } from '../analytics';
6
8
  import { GapCursorSelection } from '../selection/gap-cursor-selection';
@@ -220,6 +222,14 @@ export var createListAtSelection = function createListAtSelection(tr, list, item
220
222
  }, [item.create({
221
223
  localId: uuid.generate()
222
224
  }, $from.node($from.depth).content)]);
225
+ var hasBlockquoteParent = findParentNodeOfType(blockquote)(selection);
226
+
227
+ if (hasBlockquoteParent) {
228
+ var liftedDepth = $from.depth - 1;
229
+ var range = new NodeRange($from, $to, liftedDepth);
230
+ tr.lift(range, liftTarget(range));
231
+ }
232
+
223
233
  var listParent = findParentNodeOfType(taskList)(selection) || findParentNodeOfType(decisionList)(selection);
224
234
  var listItem = findParentNodeOfType(taskItem)(selection) || findParentNodeOfType(decisionItem)(selection); // For a selection inside a task/decision list, we can't just simply replace the
225
235
  // node type as it will mess up lists with > 1 item
@@ -251,10 +261,12 @@ export var createListAtSelection = function createListAtSelection(tr, list, item
251
261
 
252
262
  var nodeTypesToReplace = [blockquote];
253
263
 
254
- if (nodeType === paragraph && childCount > 0) {
264
+ if (nodeType === paragraph && childCount > 0 || hasBlockquoteParent) {
255
265
  // Only convert paragraphs containing content.
256
266
  // Empty paragraphs use the default flow.
257
267
  // This distinction ensures the text selection remains in the correct location.
268
+ // We also want to replace the paragraph type when we are inside a blockQuote
269
+ // to avoid inserting an extra taskList whilst keeping the paragraph
258
270
  nodeTypesToReplace.push(paragraph);
259
271
  }
260
272
 
@@ -2,6 +2,8 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
 
3
3
  var _templateObject;
4
4
 
5
- import { css } from 'styled-components';
5
+ import { css } from '@emotion/react';
6
6
  import { codeMarkSharedStyles } from '@atlaskit/editor-common/styles';
7
- export var textFormattingStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n"])), codeMarkSharedStyles);
7
+ export var textFormattingStyles = function textFormattingStyles(props) {
8
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n"])), codeMarkSharedStyles(props));
9
+ };