@atlaskit/editor-core 161.0.0 → 162.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 (295) hide show
  1. package/CHANGELOG.md +44 -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 +1 -1
  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/FloatingContextualMenu/index.js +3 -1
  61. package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +1 -1
  62. package/dist/cjs/plugins/table/ui/LayoutButton/index.js +1 -2
  63. package/dist/cjs/plugins/table/ui/common-styles.css.js +17 -8
  64. package/dist/cjs/plugins/table/ui/ui-styles.css.js +39 -25
  65. package/dist/cjs/plugins/table/utils/nodes.js +15 -15
  66. package/dist/cjs/plugins/tasks-and-decisions/commands.js +15 -1
  67. package/dist/cjs/plugins/text-formatting/styles.js +5 -2
  68. package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +71 -1
  69. package/dist/cjs/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
  70. package/dist/cjs/plugins/text-formatting/utils.js +30 -2
  71. package/dist/cjs/plugins/type-ahead/api.js +32 -1
  72. package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +20 -5
  73. package/dist/cjs/plugins/type-ahead/utils.js +22 -4
  74. package/dist/cjs/ui/Appearance/Comment/Comment.js +1 -1
  75. package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +1 -1
  76. package/dist/cjs/ui/ContentStyles/index.js +32 -9
  77. package/dist/cjs/utils/index.js +1 -8
  78. package/dist/cjs/utils/insert.js +1 -9
  79. package/dist/cjs/utils/selection.js +2 -9
  80. package/dist/cjs/version-wrapper.js +1 -1
  81. package/dist/cjs/version.json +1 -1
  82. package/dist/es2019/actions/index.js +20 -23
  83. package/dist/es2019/extensibility.js +1 -1
  84. package/dist/es2019/labs/next/full-page.js +2 -2
  85. package/dist/es2019/plugins/block-type/styles.js +3 -3
  86. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +15 -12
  87. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +19 -14
  88. package/dist/es2019/plugins/card/messages.js +4 -4
  89. package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +21 -9
  90. package/dist/es2019/plugins/card/ui/LinkToolbarButtonGroup.js +54 -3
  91. package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +145 -3
  92. package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +10 -6
  93. package/dist/es2019/plugins/card/ui/assets/card.js +1 -1
  94. package/dist/es2019/plugins/card/ui/assets/embed.js +1 -1
  95. package/dist/es2019/plugins/card/ui/assets/inline.js +1 -1
  96. package/dist/es2019/plugins/card/ui/assets/url.js +1 -1
  97. package/dist/es2019/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
  98. package/dist/es2019/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
  99. package/dist/es2019/plugins/card/ui/styled.js +2 -2
  100. package/dist/es2019/plugins/card/ui/types.js +1 -0
  101. package/dist/es2019/plugins/clipboard/pm-plugins/main.js +91 -9
  102. package/dist/es2019/plugins/code-block/styles.js +14 -14
  103. package/dist/es2019/plugins/extension/plugin-factory.js +3 -1
  104. package/dist/es2019/plugins/extension/pm-plugins/main.js +38 -12
  105. package/dist/es2019/plugins/extension/utils.js +37 -2
  106. package/dist/es2019/plugins/find-replace/ui/Find.js +1 -1
  107. package/dist/es2019/plugins/find-replace/ui/FindReplace.js +1 -1
  108. package/dist/es2019/plugins/find-replace/ui/Replace.js +1 -1
  109. package/dist/es2019/plugins/find-replace/ui/styles.js +14 -9
  110. package/dist/es2019/plugins/layout/styles.js +5 -1
  111. package/dist/es2019/plugins/list/actions/wrap-and-join-lists.js +163 -0
  112. package/dist/es2019/plugins/list/commands/index.js +29 -28
  113. package/dist/es2019/plugins/list/utils/replace-content.js +22 -0
  114. package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
  115. package/dist/es2019/plugins/media/styles.js +1 -1
  116. package/dist/es2019/plugins/media/utils/media-single.js +14 -1
  117. package/dist/es2019/plugins/paste/handlers.js +19 -5
  118. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +2 -2
  119. package/dist/es2019/plugins/placeholder-text/index.js +46 -1
  120. package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +66 -20
  121. package/dist/es2019/plugins/placeholder-text/selection-utils.js +9 -0
  122. package/dist/es2019/plugins/placeholder-text/styles.js +22 -0
  123. package/dist/es2019/plugins/table/commands/index.js +1 -1
  124. package/dist/es2019/plugins/table/commands/insert.js +1 -1
  125. package/dist/es2019/plugins/table/commands/misc.js +5 -11
  126. package/dist/es2019/plugins/table/commands-with-analytics.js +1 -1
  127. package/dist/es2019/plugins/table/handlers.js +6 -2
  128. package/dist/es2019/plugins/table/index.js +4 -8
  129. package/dist/es2019/plugins/table/nodeviews/TableComponent.js +2 -2
  130. package/dist/es2019/plugins/table/nodeviews/table.js +2 -16
  131. package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +1 -1
  132. package/dist/es2019/plugins/table/pm-plugins/main.js +2 -1
  133. package/dist/es2019/plugins/table/pm-plugins/plugin-factory.js +1 -2
  134. package/dist/es2019/plugins/table/pm-plugins/plugin-key.js +2 -0
  135. package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
  136. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
  137. package/dist/es2019/plugins/table/reducer.js +0 -9
  138. package/dist/es2019/plugins/table/toolbar.js +1 -4
  139. package/dist/es2019/plugins/table/transforms/metadata.js +1 -1
  140. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +2 -1
  141. package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +1 -1
  142. package/dist/es2019/plugins/table/ui/LayoutButton/index.js +1 -2
  143. package/dist/es2019/plugins/table/ui/common-styles.css.js +51 -26
  144. package/dist/es2019/plugins/table/ui/ui-styles.css.js +57 -56
  145. package/dist/es2019/plugins/table/utils/nodes.js +11 -11
  146. package/dist/es2019/plugins/tasks-and-decisions/commands.js +13 -1
  147. package/dist/es2019/plugins/text-formatting/styles.js +3 -3
  148. package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +61 -2
  149. package/dist/es2019/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
  150. package/dist/es2019/plugins/text-formatting/utils.js +13 -1
  151. package/dist/es2019/plugins/type-ahead/api.js +31 -2
  152. package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +17 -5
  153. package/dist/es2019/plugins/type-ahead/utils.js +15 -0
  154. package/dist/es2019/ui/Appearance/Comment/Comment.js +2 -2
  155. package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +2 -2
  156. package/dist/es2019/ui/ContentStyles/index.js +45 -23
  157. package/dist/es2019/utils/index.js +1 -1
  158. package/dist/es2019/utils/insert.js +2 -10
  159. package/dist/es2019/utils/selection.js +1 -6
  160. package/dist/es2019/version-wrapper.js +1 -1
  161. package/dist/es2019/version.json +1 -1
  162. package/dist/esm/actions/index.js +76 -48
  163. package/dist/esm/extensibility.js +1 -1
  164. package/dist/esm/labs/next/full-page.js +2 -2
  165. package/dist/esm/plugins/block-type/styles.js +4 -2
  166. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +14 -12
  167. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +9 -5
  168. package/dist/esm/plugins/card/messages.js +4 -4
  169. package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +25 -9
  170. package/dist/esm/plugins/card/ui/LinkToolbarButtonGroup.js +57 -5
  171. package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +154 -5
  172. package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +9 -6
  173. package/dist/esm/plugins/card/ui/assets/card.js +1 -1
  174. package/dist/esm/plugins/card/ui/assets/embed.js +1 -1
  175. package/dist/esm/plugins/card/ui/assets/inline.js +1 -1
  176. package/dist/esm/plugins/card/ui/assets/url.js +1 -1
  177. package/dist/esm/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
  178. package/dist/esm/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
  179. package/dist/esm/plugins/card/ui/styled.js +2 -2
  180. package/dist/esm/plugins/card/ui/types.js +1 -0
  181. package/dist/esm/plugins/clipboard/pm-plugins/main.js +91 -2
  182. package/dist/esm/plugins/code-block/styles.js +42 -38
  183. package/dist/esm/plugins/extension/plugin-factory.js +3 -1
  184. package/dist/esm/plugins/extension/pm-plugins/main.js +34 -11
  185. package/dist/esm/plugins/extension/utils.js +51 -9
  186. package/dist/esm/plugins/find-replace/ui/Find.js +1 -1
  187. package/dist/esm/plugins/find-replace/ui/FindReplace.js +1 -1
  188. package/dist/esm/plugins/find-replace/ui/Replace.js +1 -1
  189. package/dist/esm/plugins/find-replace/ui/styles.js +6 -10
  190. package/dist/esm/plugins/layout/styles.js +2 -2
  191. package/dist/esm/plugins/list/actions/wrap-and-join-lists.js +168 -0
  192. package/dist/esm/plugins/list/commands/index.js +33 -34
  193. package/dist/esm/plugins/list/utils/replace-content.js +21 -0
  194. package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
  195. package/dist/esm/plugins/media/styles.js +1 -1
  196. package/dist/esm/plugins/media/utils/media-single.js +12 -1
  197. package/dist/esm/plugins/paste/handlers.js +19 -5
  198. package/dist/esm/plugins/paste/pm-plugins/analytics.js +2 -2
  199. package/dist/esm/plugins/placeholder-text/index.js +44 -1
  200. package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +67 -20
  201. package/dist/esm/plugins/placeholder-text/selection-utils.js +9 -0
  202. package/dist/esm/plugins/placeholder-text/styles.js +2 -1
  203. package/dist/esm/plugins/table/commands/index.js +1 -1
  204. package/dist/esm/plugins/table/commands/insert.js +1 -1
  205. package/dist/esm/plugins/table/commands/misc.js +5 -15
  206. package/dist/esm/plugins/table/commands-with-analytics.js +1 -1
  207. package/dist/esm/plugins/table/handlers.js +6 -2
  208. package/dist/esm/plugins/table/index.js +6 -11
  209. package/dist/esm/plugins/table/nodeviews/TableComponent.js +2 -2
  210. package/dist/esm/plugins/table/nodeviews/table.js +6 -37
  211. package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +1 -1
  212. package/dist/esm/plugins/table/pm-plugins/main.js +2 -1
  213. package/dist/esm/plugins/table/pm-plugins/plugin-factory.js +1 -2
  214. package/dist/esm/plugins/table/pm-plugins/plugin-key.js +2 -0
  215. package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
  216. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
  217. package/dist/esm/plugins/table/reducer.js +0 -7
  218. package/dist/esm/plugins/table/toolbar.js +1 -10
  219. package/dist/esm/plugins/table/transforms/metadata.js +1 -1
  220. package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +2 -1
  221. package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +1 -1
  222. package/dist/esm/plugins/table/ui/LayoutButton/index.js +1 -2
  223. package/dist/esm/plugins/table/ui/common-styles.css.js +10 -6
  224. package/dist/esm/plugins/table/ui/ui-styles.css.js +20 -11
  225. package/dist/esm/plugins/table/utils/nodes.js +14 -14
  226. package/dist/esm/plugins/tasks-and-decisions/commands.js +13 -1
  227. package/dist/esm/plugins/text-formatting/styles.js +4 -2
  228. package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +69 -2
  229. package/dist/esm/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
  230. package/dist/esm/plugins/text-formatting/utils.js +18 -0
  231. package/dist/esm/plugins/type-ahead/api.js +30 -2
  232. package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +16 -4
  233. package/dist/esm/plugins/type-ahead/utils.js +17 -3
  234. package/dist/esm/ui/Appearance/Comment/Comment.js +2 -2
  235. package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +2 -2
  236. package/dist/esm/ui/ContentStyles/index.js +27 -9
  237. package/dist/esm/utils/index.js +1 -1
  238. package/dist/esm/utils/insert.js +2 -10
  239. package/dist/esm/utils/selection.js +1 -6
  240. package/dist/esm/version-wrapper.js +1 -1
  241. package/dist/esm/version.json +1 -1
  242. package/dist/types/actions/index.d.ts +2 -2
  243. package/dist/types/extensibility.d.ts +1 -1
  244. package/dist/types/plugins/analytics/types/list-events.d.ts +0 -1
  245. package/dist/types/plugins/block-type/styles.d.ts +2 -1
  246. package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -0
  247. package/dist/types/plugins/block-type/ui/ToolbarBlockType/styled.d.ts +2 -7
  248. package/dist/types/plugins/card/messages.d.ts +2 -2
  249. package/dist/types/plugins/card/ui/LinkToolbarButtonGroup.d.ts +18 -2
  250. package/dist/types/plugins/card/ui/LinkToolbarIconDropdown.d.ts +23 -3
  251. package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +3 -1
  252. package/dist/types/plugins/card/ui/link-toolbar-button-group-options.d.ts +5 -0
  253. package/dist/types/plugins/card/ui/link-toolbar-icon-dropdown-options.d.ts +5 -0
  254. package/dist/types/plugins/card/ui/styled.d.ts +2 -3
  255. package/dist/types/plugins/card/ui/types.d.ts +12 -0
  256. package/dist/types/plugins/clipboard/pm-plugins/main.d.ts +10 -1
  257. package/dist/types/plugins/code-block/styles.d.ts +3 -2
  258. package/dist/types/plugins/extension/pm-plugins/main.d.ts +2 -1
  259. package/dist/types/plugins/extension/types.d.ts +1 -0
  260. package/dist/types/plugins/extension/utils.d.ts +3 -1
  261. package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +2 -1
  262. package/dist/types/plugins/find-replace/ui/styles.d.ts +5 -5
  263. package/dist/types/plugins/layout/styles.d.ts +1 -1
  264. package/dist/types/plugins/list/actions/wrap-and-join-lists.d.ts +25 -0
  265. package/dist/types/plugins/list/commands/index.d.ts +0 -1
  266. package/dist/types/plugins/list/utils/replace-content.d.ts +8 -0
  267. package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -2
  268. package/dist/types/plugins/media/styles.d.ts +1 -1
  269. package/dist/types/plugins/media/utils/media-single.d.ts +1 -0
  270. package/dist/types/plugins/panel/styles.d.ts +1 -1
  271. package/dist/types/plugins/paste/handlers.d.ts +1 -1
  272. package/dist/types/plugins/placeholder-text/placeholder-text-nodeview.d.ts +3 -2
  273. package/dist/types/plugins/placeholder-text/selection-utils.d.ts +2 -0
  274. package/dist/types/plugins/rule/styles.d.ts +1 -1
  275. package/dist/types/plugins/table/commands/index.d.ts +1 -1
  276. package/dist/types/plugins/table/commands/misc.d.ts +0 -1
  277. package/dist/types/plugins/table/nodeviews/table.d.ts +0 -1
  278. package/dist/types/plugins/table/pm-plugins/plugin-factory.d.ts +1 -4
  279. package/dist/types/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
  280. package/dist/types/plugins/table/types.d.ts +1 -8
  281. package/dist/types/plugins/table/ui/LayoutButton/index.d.ts +0 -1
  282. package/dist/types/plugins/table/ui/common-styles.css.d.ts +6 -3
  283. package/dist/types/plugins/table/ui/ui-styles.css.d.ts +15 -14
  284. package/dist/types/plugins/table/utils/nodes.d.ts +6 -6
  285. package/dist/types/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +1 -1
  286. package/dist/types/plugins/text-formatting/styles.d.ts +2 -1
  287. package/dist/types/plugins/text-formatting/ui/Toolbar/toolbar-messages.d.ts +30 -0
  288. package/dist/types/plugins/text-formatting/utils.d.ts +4 -0
  289. package/dist/types/plugins/type-ahead/api.d.ts +11 -1
  290. package/dist/types/plugins/type-ahead/transforms/open-typeahead-at-cursor.d.ts +1 -0
  291. package/dist/types/plugins/type-ahead/utils.d.ts +4 -0
  292. package/dist/types/ui/ContentStyles/index.d.ts +1 -0
  293. package/dist/types/utils/index.d.ts +1 -1
  294. package/dist/types/utils/selection.d.ts +0 -1
  295. package/package.json +28 -26
@@ -1,10 +1,159 @@
1
- import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ var _excluded = ["options"];
4
+
5
+ /** @jsx jsx */
2
6
  import React from 'react';
7
+ import { css, jsx } from '@emotion/react';
8
+ import { MenuGroup, Section, CustomItem } from '@atlaskit/menu';
9
+ import { borderRadius } from '@atlaskit/theme/constants';
10
+ import { B50, N20, B400 } from '@atlaskit/theme/colors';
11
+ import { token } from '@atlaskit/tokens';
12
+ import Tooltip from '@atlaskit/tooltip';
13
+ import Dropdown from '../../floating-toolbar/ui/Dropdown';
14
+ export var ICON_HEIGHT = 40;
15
+ export var ICON_WIDTH = 40;
16
+ var iconBoxStyles = css({
17
+ width: ICON_HEIGHT,
18
+ height: ICON_WIDTH,
19
+ overflow: 'hidden',
20
+ border: '1px solid rgba(223, 225, 229, 0.5)'
21
+ /* N60 at 50% */
22
+ ,
23
+ borderRadius: borderRadius(),
24
+ boxSizing: 'border-box',
25
+ display: 'flex',
26
+ justifyContent: 'center',
27
+ alignItems: 'center',
28
+ backgroundColor: token('color.background.default', 'white')
29
+ });
30
+ var primitiveStyles = css({
31
+ padding: '0.75rem',
32
+ alignItems: 'flex-start'
33
+ });
34
+ var interactiveStyles = css({
35
+ '&:active': {
36
+ backgroundColor: token('color.background.brand.pressed', B50),
37
+ color: token('color.text.accent.blue', B400)
38
+ }
39
+ });
40
+ var unselectedStyles = css({
41
+ '&:hover': {
42
+ backgroundColor: token('color.background.neutral.subtle.hovered', N20),
43
+ color: token('color.text.brand', 'currentColor')
44
+ }
45
+ });
46
+ var selectedOptionStyles = css({
47
+ backgroundColor: token('color.background.brand.pressed', B50),
48
+ color: token('color.text.brand', 'currentColor'),
49
+ '&:hover': {
50
+ backgroundColor: token('color.background.brand.pressed', B50),
51
+ color: token('color.text.brand', 'currentColor')
52
+ }
53
+ });
54
+ var titleOffsetStyles = css({
55
+ marginTop: '0.125rem'
56
+ });
57
+
58
+ var getCustomStyles = function getCustomStyles(selected, disabled) {
59
+ if (disabled) {
60
+ return [primitiveStyles];
61
+ }
3
62
 
4
- var LinkToolbarIconDropdown = function LinkToolbarIconDropdown(_ref) {
5
- _objectDestructuringEmpty(_ref);
63
+ if (selected) {
64
+ return [primitiveStyles, selectedOptionStyles, interactiveStyles];
65
+ }
66
+
67
+ return [primitiveStyles, unselectedStyles, interactiveStyles];
68
+ };
6
69
 
7
- return /*#__PURE__*/React.createElement("span", null);
70
+ var OptionRoot = function OptionRoot(props) {
71
+ return jsx("div", _extends({}, props, {
72
+ tabIndex: 0
73
+ }));
8
74
  };
9
75
 
10
- export default LinkToolbarIconDropdown;
76
+ var Option = function Option(_ref) {
77
+ var title = _ref.title,
78
+ description = _ref.description,
79
+ selected = _ref.selected,
80
+ disabled = _ref.disabled,
81
+ _onClick = _ref.onClick,
82
+ Icon = _ref.icon,
83
+ testId = _ref.testId,
84
+ tooltipContent = _ref.tooltipContent,
85
+ hide = _ref.hide;
86
+ var option = jsx(CustomItem, {
87
+ "aria-label": title,
88
+ component: OptionRoot,
89
+ iconBefore: jsx("div", {
90
+ css: iconBoxStyles
91
+ }, jsx(Icon, {
92
+ width: 38,
93
+ height: 38,
94
+ label: title
95
+ })),
96
+ css: getCustomStyles(selected, disabled),
97
+ description: description,
98
+ testId: testId,
99
+ onClick: function onClick(event) {
100
+ event.preventDefault();
101
+
102
+ if (!disabled) {
103
+ _onClick();
104
+
105
+ hide();
106
+ }
107
+ },
108
+ onKeyDown: function onKeyDown(event) {
109
+ if (event.key === 'Enter' || event.key === 'Space') {
110
+ event.preventDefault();
111
+
112
+ if (!disabled) {
113
+ _onClick();
114
+
115
+ hide();
116
+ }
117
+ }
118
+ },
119
+ role: "option",
120
+ "aria-selected": selected,
121
+ isSelected: selected,
122
+ isDisabled: disabled,
123
+ shouldDescriptionWrap: true
124
+ }, jsx("div", {
125
+ css: titleOffsetStyles
126
+ }, title));
127
+
128
+ if (tooltipContent) {
129
+ return jsx(Tooltip, {
130
+ content: tooltipContent
131
+ }, option);
132
+ }
133
+
134
+ return option;
135
+ };
136
+
137
+ export var LinkToolbarIconDropdown = function LinkToolbarIconDropdown(_ref2) {
138
+ var options = _ref2.options,
139
+ rest = _objectWithoutProperties(_ref2, _excluded);
140
+
141
+ return jsx(Dropdown, _extends({}, rest, {
142
+ options: {
143
+ render: function render(_ref3) {
144
+ var hide = _ref3.hide;
145
+ return jsx(MenuGroup, null, jsx("div", {
146
+ role: "listbox"
147
+ }, jsx(Section, null, options.map(function (props) {
148
+ return jsx(Option, _extends({
149
+ key: props.testId
150
+ }, props, {
151
+ hide: hide
152
+ }));
153
+ }))));
154
+ },
155
+ width: 320,
156
+ height: 200
157
+ }
158
+ }));
159
+ };
@@ -15,16 +15,18 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
15
15
 
16
16
  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; } }
17
17
 
18
+ /** @jsx jsx */
18
19
  import React from 'react';
20
+ import { jsx } from '@emotion/react';
19
21
  import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from 'prosemirror-utils';
20
22
  import { calcColumnsFromPx, calcPctFromPx, calcPxFromColumns, wrappedLayouts } from '@atlaskit/editor-common/ui';
21
23
  import { akEditorMediaResizeHandlerPaddingWide, akEditorBreakoutPadding, akEditorWideLayoutWidth, breakoutWideScaleRatio, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
22
- import { embedHeaderHeight } from '@atlaskit/media-ui/embeds';
24
+ import { embedHeaderHeight } from '@atlaskit/smart-card';
23
25
  import { Wrapper } from '../../../ui/Resizer/styled';
24
26
  import Resizer from '../../../ui/Resizer';
25
27
  import { handleSides, imageAlignmentMap, snapTo } from '../../../ui/Resizer/utils';
26
28
  import { calcMediaPxWidth } from '../../../plugins/media/utils/media-single';
27
- import { EmbedSpacing } from './styled';
29
+ import { embedSpacingStyles } from './styled';
28
30
 
29
31
  var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
30
32
  _inherits(ResizableEmbedCard, _React$Component);
@@ -344,7 +346,7 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
344
346
  };
345
347
  }
346
348
 
347
- return /*#__PURE__*/React.createElement("span", {
349
+ return jsx("span", {
348
350
  "data-testid": 'resizable-embed-card-height-definer',
349
351
  style: _objectSpread({
350
352
  display: 'block',
@@ -376,9 +378,10 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
376
378
  enable[side] = false;
377
379
  }
378
380
  });
379
- return /*#__PURE__*/React.createElement(EmbedSpacing, {
381
+ return jsx("div", {
382
+ css: embedSpacingStyles,
380
383
  "data-testid": "resizable-embed-card-spacing"
381
- }, /*#__PURE__*/React.createElement(Wrapper, {
384
+ }, jsx(Wrapper, {
382
385
  layout: layout,
383
386
  isResized: !!pctWidth,
384
387
  containerWidth: containerWidth || DEFAULT_EMBED_CARD_WIDTH,
@@ -386,7 +389,7 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
386
389
  return _this2.wrapper = elem;
387
390
  },
388
391
  fullWidthMode: fullWidthMode
389
- }, /*#__PURE__*/React.createElement(Resizer, _extends({}, this.props, {
392
+ }, jsx(Resizer, _extends({}, this.props, {
390
393
  width: initialWidth // Starting or initial width of embed <iframe> itself.
391
394
  ,
392
395
  enable: enable,
@@ -13,7 +13,7 @@ var IconCardGlyph = function IconCardGlyph(props) {
13
13
  fillRule: "evenodd",
14
14
  clipRule: "evenodd",
15
15
  d: "M8 9c-1.10457 0-2 .89543-2 2v10c0 1.1046.89543 2 2 2h16c1.1046 0 2-.8954 2-2V11c0-1.10457-.8954-2-2-2H8Zm0 3c0-.5523.44772-1 1-1h2c.5523 0 1 .4477 1 1v2c0 .5523-.4477 1-1 1H9c-.55228 0-1-.4477-1-1v-2Zm5 1c0-.2761.2239-.5.5-.5h10c.2761 0 .5.2239.5.5s-.2239.5-.5.5h-10c-.2761 0-.5-.2239-.5-.5Zm-4 3c-.55228 0-1 .4477-1 1s.44772 1 1 1h14c.5523 0 1-.4477 1-1s-.4477-1-1-1H9Zm-1 4c0-.5523.44772-1 1-1h6c.5523 0 1 .4477 1 1s-.4477 1-1 1H9c-.55228 0-1-.4477-1-1Z",
16
- fill: "#42526E"
16
+ fill: "currentColor"
17
17
  }));
18
18
  };
19
19
 
@@ -13,7 +13,7 @@ var IconEmbedGlyph = function IconEmbedGlyph(props) {
13
13
  fillRule: "evenodd",
14
14
  clipRule: "evenodd",
15
15
  d: "M8 6c-1.10457 0-2 .89543-2 2v16c0 1.1046.89543 2 2 2h16c1.1046 0 2-.8954 2-2V8c0-1.10457-.8954-2-2-2H8Zm1 2c-.55228 0-1 .44772-1 1v2c0 .5523.44772 1 1 1h2c.5523 0 1-.4477 1-1V9c0-.55228-.4477-1-1-1H9Zm4.5 1.5c-.2761 0-.5.22386-.5.5 0 .2761.2239.5.5.5h10c.2761 0 .5-.2239.5-.5 0-.27614-.2239-.5-.5-.5h-10ZM9 14c-.55228 0-1 .4477-1 1v8c0 .5523.44772 1 1 1h14c.5523 0 1-.4477 1-1v-8c0-.5523-.4477-1-1-1H9Zm6 2.5c0 .8284-.6716 1.5-1.5 1.5s-1.5-.6716-1.5-1.5.6716-1.5 1.5-1.5 1.5.6716 1.5 1.5Zm0 5.5-1-1-2 2h8v-1.8L18 19l-3 3Z",
16
- fill: "#42526E"
16
+ fill: "currentColor"
17
17
  }));
18
18
  };
19
19
 
@@ -13,7 +13,7 @@ var IconInlineGlyph = function IconInlineGlyph(props) {
13
13
  fillRule: "evenodd",
14
14
  clipRule: "evenodd",
15
15
  d: "M8 12c-1.10457 0-2 .8954-2 2v4c0 1.1046.89543 2 2 2h16c1.1046 0 2-.8954 2-2v-4c0-1.1046-.8954-2-2-2H8Zm0 3c0-.5523.44772-1 1-1h2c.5523 0 1 .4477 1 1v2c0 .5523-.4477 1-1 1H9c-.55228 0-1-.4477-1-1v-2Zm5 1c0-.2761.2239-.5.5-.5h10c.2761 0 .5.2239.5.5s-.2239.5-.5.5h-10c-.2761 0-.5-.2239-.5-.5Z",
16
- fill: "#42526E"
16
+ fill: "currentColor"
17
17
  }));
18
18
  };
19
19
 
@@ -15,7 +15,7 @@ var IconUrlGlyph = function IconUrlGlyph(props) {
15
15
  width: "20",
16
16
  height: "2",
17
17
  rx: "1",
18
- fill: "#42526E"
18
+ fill: "currentColor"
19
19
  }));
20
20
  };
21
21
 
@@ -0,0 +1,45 @@
1
+ import { messages } from '../messages';
2
+ import { IconCard } from './assets/card';
3
+ import { IconEmbed } from './assets/embed';
4
+ import { IconInline } from './assets/inline';
5
+ import { IconUrl } from './assets/url';
6
+ var appearancePropsMap = {
7
+ url: {
8
+ title: messages.urlTitle,
9
+ icon: IconUrl
10
+ },
11
+ inline: {
12
+ title: messages.inlineTitle,
13
+ icon: IconInline
14
+ },
15
+ block: {
16
+ title: messages.blockTitle,
17
+ icon: IconCard
18
+ },
19
+ embed: {
20
+ title: messages.embedTitle,
21
+ icon: IconEmbed
22
+ }
23
+ };
24
+ export var getButtonGroupOption = function getButtonGroupOption(intl, dispatchCommand, _ref) {
25
+ var disabled = _ref.disabled,
26
+ _onClick = _ref.onClick,
27
+ selected = _ref.selected,
28
+ appearance = _ref.appearance,
29
+ testId = _ref.testId,
30
+ tooltip = _ref.tooltip;
31
+ var _appearancePropsMap = appearancePropsMap[appearance !== null && appearance !== void 0 ? appearance : 'url'],
32
+ title = _appearancePropsMap.title,
33
+ icon = _appearancePropsMap.icon;
34
+ return {
35
+ title: intl.formatMessage(title),
36
+ icon: icon,
37
+ onClick: function onClick() {
38
+ return dispatchCommand(_onClick);
39
+ },
40
+ disabled: Boolean(disabled),
41
+ tooltipContent: tooltip || null,
42
+ testId: testId,
43
+ selected: selected
44
+ };
45
+ };
@@ -0,0 +1,51 @@
1
+ import { messages } from '../messages';
2
+ import { IconCard } from './assets/card';
3
+ import { IconEmbed } from './assets/embed';
4
+ import { IconInline } from './assets/inline';
5
+ import { IconUrl } from './assets/url';
6
+ var appearancePropsMap = {
7
+ url: {
8
+ title: messages.urlTitle,
9
+ description: messages.urlDescription,
10
+ icon: IconUrl
11
+ },
12
+ inline: {
13
+ title: messages.inlineTitle,
14
+ description: messages.inlineDescription,
15
+ icon: IconInline
16
+ },
17
+ block: {
18
+ title: messages.blockTitle,
19
+ description: messages.blockDescription,
20
+ icon: IconCard
21
+ },
22
+ embed: {
23
+ title: messages.embedTitle,
24
+ description: messages.embedDescription,
25
+ icon: IconEmbed
26
+ }
27
+ };
28
+ export var getIconDropdownOption = function getIconDropdownOption(intl, dispatchCommand, _ref) {
29
+ var disabled = _ref.disabled,
30
+ _onClick = _ref.onClick,
31
+ selected = _ref.selected,
32
+ appearance = _ref.appearance,
33
+ testId = _ref.testId,
34
+ tooltip = _ref.tooltip;
35
+ var _appearancePropsMap = appearancePropsMap[appearance !== null && appearance !== void 0 ? appearance : 'url'],
36
+ title = _appearancePropsMap.title,
37
+ description = _appearancePropsMap.description,
38
+ icon = _appearancePropsMap.icon;
39
+ return {
40
+ title: intl.formatMessage(title),
41
+ description: intl.formatMessage(description),
42
+ icon: icon,
43
+ onClick: function onClick() {
44
+ return dispatchCommand(_onClick);
45
+ },
46
+ selected: Boolean(selected),
47
+ disabled: Boolean(disabled),
48
+ tooltipContent: tooltip,
49
+ testId: testId
50
+ };
51
+ };
@@ -2,6 +2,6 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
 
3
3
  var _templateObject, _templateObject2;
4
4
 
5
- import styled, { css } from 'styled-components';
5
+ import { css } from '@emotion/react';
6
6
  export var embedCardStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n .embedCardView-content-wrap[layout^='wrap-'] {\n max-width: 100%;\n }\n\n .embedCardView-content-wrap[layout='wrap-left'] {\n float: left;\n }\n\n .embedCardView-content-wrap[layout='wrap-right'] {\n float: right;\n }\n\n .embedCardView-content-wrap[layout='wrap-right']\n + .embedCardView-content-wrap[layout='wrap-left'] {\n clear: both;\n }\n }\n"])));
7
- export var EmbedSpacing = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin: 0 10px;\n"])));
7
+ export var embedSpacingStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin: 0 10px;\n"])));
@@ -0,0 +1 @@
1
+ export {};
@@ -1,13 +1,37 @@
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
+
2
8
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
9
  import { TextSelection } from 'prosemirror-state';
4
10
  import { clipboardPluginKey } from '../plugin-key';
5
11
  import { getNodeSelectionAnalyticsPayload, getAllSelectionAnalyticsPayload, getRangeSelectionAnalyticsPayload, getCellSelectionAnalyticsPayload } from '../../selection/utils';
6
12
  import { EVENT_TYPE, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../../analytics/types/enums';
13
+ import { DOMSerializer } from 'prosemirror-model';
14
+ import { findParentNodeOfType } from 'prosemirror-utils';
15
+ import { Fragment } from 'prosemirror-model';
7
16
  export var createPlugin = function createPlugin(_ref) {
8
- var dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
17
+ var dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
18
+ schema = _ref.schema;
19
+ var editorView;
20
+
21
+ var getEditorView = function getEditorView() {
22
+ return editorView;
23
+ };
24
+
9
25
  return new SafePlugin({
10
26
  key: clipboardPluginKey,
27
+ view: function view(_view) {
28
+ editorView = _view;
29
+ return {
30
+ update: function update(view) {
31
+ editorView = view;
32
+ }
33
+ };
34
+ },
11
35
  props: {
12
36
  handleDOMEvents: {
13
37
  cut: function cut(view) {
@@ -16,10 +40,75 @@ export var createPlugin = function createPlugin(_ref) {
16
40
  copy: function copy(view) {
17
41
  return sendClipboardAnalytics(view, dispatchAnalyticsEvent, ACTION.COPIED);
18
42
  }
19
- }
43
+ },
44
+ clipboardSerializer: createClipboardSerializer(schema, getEditorView)
20
45
  }
21
46
  });
22
47
  };
48
+ /**
49
+ * Overrides Prosemirror's default clipboardSerializer, in order to fix table row copy/paste bug raised in ED-13003.
50
+ * This allows us to store the original table’s attributes on the new table that the row is wrapped with when it is being copied.
51
+ * e.g. keeping the layout on a row that is copied.
52
+ * We store the default serializer in order to call it after we handle the table row case.
53
+ */
54
+
55
+ export var createClipboardSerializer = function createClipboardSerializer(schema, getEditorView) {
56
+ var oldSerializer = DOMSerializer.fromSchema(schema);
57
+ var newSerializer = new DOMSerializer(oldSerializer.nodes, oldSerializer.marks);
58
+ var originalSerializeFragment = newSerializer.serializeFragment.bind(newSerializer);
59
+
60
+ newSerializer.serializeFragment = function (content) {
61
+ var _content$firstChild;
62
+
63
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
64
+ var target = arguments.length > 2 ? arguments[2] : undefined;
65
+ var editorView = getEditorView();
66
+ var selection = editorView.state.selection; // We do not need to handle when a user copies a tableRow + other content.
67
+ // In that scenario it already wraps the Row with correct Table and attributes.
68
+
69
+ if (!options.tableWrapperExists) {
70
+ var i = 0;
71
+
72
+ while (i < content.childCount) {
73
+ var _content$maybeChild;
74
+
75
+ if (((_content$maybeChild = content.maybeChild(i)) === null || _content$maybeChild === void 0 ? void 0 : _content$maybeChild.type.name) === 'table') {
76
+ options.tableWrapperExists = true;
77
+ break;
78
+ }
79
+
80
+ i++;
81
+ }
82
+ } // When the content being copied includes a tableRow that is not already wrapped with a table,
83
+ // We will wrap it with one ourselves, while preserving the parent table's attributes.
84
+
85
+
86
+ if (((_content$firstChild = content.firstChild) === null || _content$firstChild === void 0 ? void 0 : _content$firstChild.type.name) === 'tableRow' && !options.tableWrapperExists) {
87
+ // We only want 1 table wrapping the rows.
88
+ // tableWrapperExist is a custom prop added solely for the purposes of this recursive algorithm.
89
+ // The function is recursively called for each node in the tree captured in the fragment.
90
+ // For recursive logic see the bind call above and the prosemirror-model (https://github.com/ProseMirror/prosemirror-model/blob/master/src/to_dom.js#L44
91
+ // and https://github.com/ProseMirror/prosemirror-model/blob/master/src/to_dom.js#L87)
92
+ options.tableWrapperExists = true;
93
+ var parentTable = findParentNodeOfType(schema.nodes.table)(selection);
94
+ var attributes = parentTable === null || parentTable === void 0 ? void 0 : parentTable.node.attrs;
95
+ var newTable = schema.nodes.table;
96
+ var newTableNode = newTable.createChecked(_objectSpread({}, attributes), content);
97
+ var newContent = Fragment.from(newTableNode); // Pass updated content into original ProseMirror serializeFragment function.
98
+ // Currently incorrectly typed in @Types. See this GitHub thread: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/57668
99
+ //@ts-ignore
100
+
101
+ return originalSerializeFragment(newContent, options, target);
102
+ } // If we're not copying any rows, just run default serializeFragment function.
103
+ // Currently incorrectly typed in @Types. See this GitHub thread: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/57668
104
+ //@ts-ignore
105
+
106
+
107
+ return originalSerializeFragment(content, options, target);
108
+ };
109
+
110
+ return newSerializer;
111
+ };
23
112
  export var sendClipboardAnalytics = function sendClipboardAnalytics(view, dispatchAnalyticsEvent, action) {
24
113
  var clipboardAnalyticsPayload = getAnalyticsPayload(view.state, action);
25
114
 
@@ -2,50 +2,54 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
 
3
3
  var _templateObject, _templateObject2;
4
4
 
5
- import { css } from 'styled-components';
5
+ import { css } from '@emotion/react';
6
6
  import { themed } from '@atlaskit/theme/components';
7
7
  import { borderRadius, fontSize, gridSize } from '@atlaskit/theme/constants';
8
8
  import * as colors from '@atlaskit/theme/colors';
9
9
  import { blockNodesVerticalMargin, akEditorTableCellMinWidth, akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorDeleteIconColor, SelectionStyle, getSelectionStyles, akEditorCodeFontFamily, akEditorSelectedNodeClassName, overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
10
10
  import { codeBlockClassNames } from './ui/class-names';
11
- export var highlightingCodeBlockStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror .code-block {\n position: relative;\n background-image: ", ";\n background-repeat: no-repeat;\n background-color: ", ";\n --ds--code--bg-color: transparent;\n background-attachment: local, scroll, scroll;\n background-size: 8px 100%, 8px 100%, 8px 100%;\n background-position: 100% 0, 100% 0, 0 0;\n font-family: ", ";\n border-radius: ", "px;\n margin: ", " 0 0 0;\n counter-reset: line;\n display: flex;\n min-width: ", "px;\n cursor: pointer;\n overflow-x: auto;\n\n .", " {\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/develop/packages/design-system/code/src/themes/themeBuilder.ts#packages/design-system/code/src/themes/themeBuilder.ts-19:28 */\n flex-shrink: 0;\n text-align: right;\n background-color: ", ";\n padding: ", "px;\n color: ", ";\n\n span {\n display: block;\n line-height: 0;\n font-size: 0;\n\n &::before {\n display: inline-block;\n content: counter(line);\n counter-increment: line;\n font-size: ", ";\n line-height: 1.5rem;\n color: ", ";\n }\n }\n }\n\n .", " {\n position: absolute;\n z-index: 2;\n width: 100%;\n height: 100%;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n overflow: hidden;\n tab-size: 4;\n\n & [data-ds--code--code-block] {\n font-size: ", ";\n line-height: 1.5rem;\n }\n }\n\n .", " {\n position: relative;\n z-index: 1;\n display: flex;\n flex: 1;\n\n > code {\n flex-grow: 1;\n tab-size: 4;\n cursor: text;\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/218202daeaf527262c21841e6f88fa058d349ad4/packages/design-system/code/src/themes/themeBuilder.ts#lines-12:17 */\n font-size: ", ";\n line-height: 1.5rem;\n border-radius: ", "px;\n margin: ", "px;\n white-space: pre;\n }\n\n &[data-debounce='true'] {\n .", " {\n display: none;\n }\n }\n\n &:not([data-debounce='true']) {\n > code:not([data-language='plaintext']):not([data-language='none']):not([data-language='']) {\n color: transparent;\n caret-color: ", ";\n }\n }\n }\n }\n\n .ProseMirror li > .code-block {\n margin: 0;\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: rgba(255, 143, 115, 0.5);\n color: ", ";\n }\n\n .", " {\n background-color: rgba(255, 189, 173, 0.5);\n }\n }\n"])), overflowShadow({
12
- background: themed({
11
+ export var highlightingCodeBlockStyles = function highlightingCodeBlockStyles(props) {
12
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror .code-block {\n position: relative;\n background-image: ", ";\n background-repeat: no-repeat;\n background-color: ", ";\n --ds--code--bg-color: transparent;\n background-attachment: local, scroll, scroll;\n background-size: 8px 100%, 8px 100%, 8px 100%;\n background-position: 100% 0, 100% 0, 0 0;\n font-family: ", ";\n border-radius: ", "px;\n margin: ", " 0 0 0;\n counter-reset: line;\n display: flex;\n min-width: ", "px;\n cursor: pointer;\n overflow-x: auto;\n\n .", " {\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/develop/packages/design-system/code/src/themes/themeBuilder.ts#packages/design-system/code/src/themes/themeBuilder.ts-19:28 */\n flex-shrink: 0;\n text-align: right;\n background-color: ", ";\n padding: ", "px;\n color: ", ";\n\n span {\n display: block;\n line-height: 0;\n font-size: 0;\n\n &::before {\n display: inline-block;\n content: counter(line);\n counter-increment: line;\n font-size: ", ";\n line-height: 1.5rem;\n color: ", ";\n }\n }\n }\n\n .", " {\n position: absolute;\n z-index: 2;\n width: 100%;\n height: 100%;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n overflow: hidden;\n tab-size: 4;\n\n & [data-ds--code--code-block] {\n font-size: ", ";\n line-height: 1.5rem;\n }\n }\n\n .", " {\n position: relative;\n z-index: 1;\n display: flex;\n flex: 1;\n\n > code {\n flex-grow: 1;\n tab-size: 4;\n cursor: text;\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/218202daeaf527262c21841e6f88fa058d349ad4/packages/design-system/code/src/themes/themeBuilder.ts#lines-12:17 */\n font-size: ", ";\n line-height: 1.5rem;\n border-radius: ", "px;\n margin: ", "px;\n white-space: pre;\n }\n\n &[data-debounce='true'] {\n .", " {\n display: none;\n }\n }\n\n &:not([data-debounce='true']) {\n > code:not([data-language='plaintext']):not([data-language='none']):not([data-language='']) {\n color: transparent;\n caret-color: ", ";\n }\n }\n }\n }\n\n .ProseMirror li > .code-block {\n margin: 0;\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: rgba(255, 143, 115, 0.5);\n color: ", ";\n }\n\n .", " {\n background-color: rgba(255, 189, 173, 0.5);\n }\n }\n"])), overflowShadow({
13
+ background: themed({
14
+ light: colors.N20,
15
+ dark: colors.DN50
16
+ })(props),
17
+ width: '8px'
18
+ }), themed({
13
19
  light: colors.N20,
14
20
  dark: colors.DN50
15
- }),
16
- width: '8px'
17
- }), themed({
18
- light: colors.N20,
19
- dark: colors.DN50
20
- }), akEditorCodeFontFamily, borderRadius(), blockNodesVerticalMargin, akEditorTableCellMinWidth, codeBlockClassNames.gutter, themed({
21
- light: colors.N30,
22
- dark: colors.DN20
23
- }), gridSize(), themed({
24
- light: colors.N90,
25
- dark: colors.DN90
26
- }), relativeFontSizeToBase16(fontSize()), themed({
27
- light: colors.N400,
28
- dark: colors.DN400
29
- }), codeBlockClassNames.highlighting, relativeFontSizeToBase16(fontSize()), codeBlockClassNames.content, relativeFontSizeToBase16(fontSize()), borderRadius(), gridSize(), codeBlockClassNames.highlighting, themed({
30
- light: colors.N800,
31
- dark: colors.DN500
32
- }), akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]), akEditorSelectedBorderSize, akEditorDeleteBorder, codeBlockClassNames.gutter, colors.R75, akEditorDeleteIconColor, codeBlockClassNames.content, akEditorDeleteBackground, codeBlockClassNames.gutter, akEditorDeleteIconColor, codeBlockClassNames.content);
33
- export var codeBlockStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ProseMirror .code-block {\n position: relative;\n background-image: ", ";\n --ds--code--bg-color: transparent;\n background-repeat: no-repeat;\n background-color: ", ";\n background-attachment: local, scroll, scroll;\n background-size: 8px 100%, 8px 100%, 8px 100%;\n background-position: 100% 0, 100% 0, 0 0;\n font-family: ", ";\n border-radius: ", "px;\n margin: ", " 0 0 0;\n counter-reset: line;\n display: flex;\n min-width: ", "px;\n cursor: pointer;\n overflow-x: auto;\n\n .", " {\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/develop/packages/design-system/code/src/themes/themeBuilder.ts#packages/design-system/code/src/themes/themeBuilder.ts-19:28 */\n flex-shrink: 0;\n text-align: right;\n background-color: ", ";\n padding: ", "px;\n\n span {\n display: block;\n line-height: 0;\n font-size: 0;\n\n &::before {\n display: inline-block;\n content: counter(line);\n counter-increment: line;\n font-size: ", ";\n line-height: 1.5rem;\n color: ", ";\n }\n }\n }\n\n .", " {\n display: flex;\n flex: 1;\n\n code {\n flex-grow: 1;\n tab-size: 4;\n cursor: text;\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/218202daeaf527262c21841e6f88fa058d349ad4/packages/design-system/code/src/themes/themeBuilder.ts#lines-12:17 */\n font-size: ", ";\n line-height: 1.5rem;\n color: ", ";\n border-radius: ", "px;\n margin: ", "px;\n white-space: pre;\n }\n }\n }\n\n .ProseMirror li > .code-block {\n margin: 0;\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: rgba(255, 143, 115, 0.5);\n color: ", ";\n }\n\n .", " {\n background-color: rgba(255, 189, 173, 0.5);\n }\n }\n"])), overflowShadow({
34
- background: themed({
21
+ })(props), akEditorCodeFontFamily, borderRadius(), blockNodesVerticalMargin, akEditorTableCellMinWidth, codeBlockClassNames.gutter, themed({
22
+ light: colors.N30,
23
+ dark: colors.DN20
24
+ })(props), gridSize(), themed({
25
+ light: colors.N90,
26
+ dark: colors.DN90
27
+ })(props), relativeFontSizeToBase16(fontSize()), themed({
28
+ light: colors.N400,
29
+ dark: colors.DN400
30
+ })(props), codeBlockClassNames.highlighting, relativeFontSizeToBase16(fontSize()), codeBlockClassNames.content, relativeFontSizeToBase16(fontSize()), borderRadius(), gridSize(), codeBlockClassNames.highlighting, themed({
31
+ light: colors.N800,
32
+ dark: colors.DN500
33
+ })(props), akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]), akEditorSelectedBorderSize, akEditorDeleteBorder, codeBlockClassNames.gutter, colors.R75, akEditorDeleteIconColor, codeBlockClassNames.content, akEditorDeleteBackground, codeBlockClassNames.gutter, akEditorDeleteIconColor, codeBlockClassNames.content);
34
+ };
35
+ export var codeBlockStyles = function codeBlockStyles(props) {
36
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ProseMirror .code-block {\n position: relative;\n background-image: ", ";\n --ds--code--bg-color: transparent;\n background-repeat: no-repeat;\n background-color: ", ";\n background-attachment: local, scroll, scroll;\n background-size: 8px 100%, 8px 100%, 8px 100%;\n background-position: 100% 0, 100% 0, 0 0;\n font-family: ", ";\n border-radius: ", "px;\n margin: ", " 0 0 0;\n counter-reset: line;\n display: flex;\n min-width: ", "px;\n cursor: pointer;\n overflow-x: auto;\n\n .", " {\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/develop/packages/design-system/code/src/themes/themeBuilder.ts#packages/design-system/code/src/themes/themeBuilder.ts-19:28 */\n flex-shrink: 0;\n text-align: right;\n background-color: ", ";\n padding: ", "px;\n\n span {\n display: block;\n line-height: 0;\n font-size: 0;\n\n &::before {\n display: inline-block;\n content: counter(line);\n counter-increment: line;\n font-size: ", ";\n line-height: 1.5rem;\n color: ", ";\n }\n }\n }\n\n .", " {\n display: flex;\n flex: 1;\n\n code {\n flex-grow: 1;\n tab-size: 4;\n cursor: text;\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/218202daeaf527262c21841e6f88fa058d349ad4/packages/design-system/code/src/themes/themeBuilder.ts#lines-12:17 */\n font-size: ", ";\n line-height: 1.5rem;\n color: ", ";\n border-radius: ", "px;\n margin: ", "px;\n white-space: pre;\n }\n }\n }\n\n .ProseMirror li > .code-block {\n margin: 0;\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: rgba(255, 143, 115, 0.5);\n color: ", ";\n }\n\n .", " {\n background-color: rgba(255, 189, 173, 0.5);\n }\n }\n"])), overflowShadow({
37
+ background: themed({
38
+ light: colors.N20,
39
+ dark: colors.DN50
40
+ })(props),
41
+ width: '8px'
42
+ }), themed({
35
43
  light: colors.N20,
36
44
  dark: colors.DN50
37
- }),
38
- width: '8px'
39
- }), themed({
40
- light: colors.N20,
41
- dark: colors.DN50
42
- }), akEditorCodeFontFamily, borderRadius(), blockNodesVerticalMargin, akEditorTableCellMinWidth, codeBlockClassNames.gutter, themed({
43
- light: colors.N30,
44
- dark: colors.DN20
45
- }), gridSize(), relativeFontSizeToBase16(fontSize()), themed({
46
- light: colors.N400,
47
- dark: colors.DN400
48
- }), codeBlockClassNames.content, relativeFontSizeToBase16(fontSize()), themed({
49
- light: colors.N800,
50
- dark: colors.DN800
51
- }), borderRadius(), gridSize(), akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]), akEditorSelectedBorderSize, akEditorDeleteBorder, codeBlockClassNames.gutter, colors.R75, akEditorDeleteIconColor, codeBlockClassNames.content, akEditorDeleteBackground, codeBlockClassNames.gutter, akEditorDeleteIconColor, codeBlockClassNames.content);
45
+ })(props), akEditorCodeFontFamily, borderRadius(), blockNodesVerticalMargin, akEditorTableCellMinWidth, codeBlockClassNames.gutter, themed({
46
+ light: colors.N30,
47
+ dark: colors.DN20
48
+ })(props), gridSize(), relativeFontSizeToBase16(fontSize()), themed({
49
+ light: colors.N400,
50
+ dark: colors.DN400
51
+ })(props), codeBlockClassNames.content, relativeFontSizeToBase16(fontSize()), themed({
52
+ light: colors.N800,
53
+ dark: colors.DN800
54
+ })(props), borderRadius(), gridSize(), akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]), akEditorSelectedBorderSize, akEditorDeleteBorder, codeBlockClassNames.gutter, colors.R75, akEditorDeleteIconColor, codeBlockClassNames.content, akEditorDeleteBackground, codeBlockClassNames.gutter, akEditorDeleteIconColor, codeBlockClassNames.content);
55
+ };
@@ -7,6 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
7
7
  import { pluginFactory } from '../../utils/plugin-state-factory';
8
8
  import reducer from './reducer';
9
9
  import { pluginKey } from './plugin-key';
10
+ import { onSelectionChanged } from './utils';
10
11
  var factory = pluginFactory(pluginKey, reducer, {
11
12
  mapping: function mapping(tr, state) {
12
13
  var _ref = state,
@@ -25,7 +26,8 @@ var factory = pluginFactory(pluginKey, reducer, {
25
26
  return _objectSpread(_objectSpread({}, state), {}, {
26
27
  positions: positions
27
28
  });
28
- }
29
+ },
30
+ onSelectionChanged: onSelectionChanged
29
31
  });
30
32
  export var createPluginState = factory.createPluginState;
31
33
  export var createCommand = factory.createCommand;