@atlaskit/editor-core 166.0.4 → 167.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (489) hide show
  1. package/.eslintrc.js +46 -1
  2. package/CHANGELOG.md +87 -0
  3. package/dist/cjs/actions/index.js +26 -2
  4. package/dist/cjs/create-editor/ReactEditorView.js +2 -0
  5. package/dist/cjs/create-editor/create-plugins-list.js +1 -2
  6. package/dist/cjs/editor.js +5 -2
  7. package/dist/cjs/keymaps/index.js +5 -1
  8. package/dist/cjs/labs/next/ContentComponents.js +8 -4
  9. package/dist/cjs/labs/next/full-page.js +14 -8
  10. package/dist/cjs/nodeviews/getInlineNodeViewProducer.js +7 -3
  11. package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +3 -1
  12. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/styles.js +3 -1
  13. package/dist/cjs/plugins/analytics/types/enums.js +3 -0
  14. package/dist/cjs/plugins/base/index.js +8 -17
  15. package/dist/cjs/plugins/base/pm-plugins/better-type-history.js +3 -12
  16. package/dist/cjs/plugins/base/pm-plugins/inline-cursor-target.js +71 -16
  17. package/dist/cjs/plugins/block-type/commands/block-type.js +32 -22
  18. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +4 -2
  19. package/dist/cjs/plugins/breakout/ui/LayoutButton.js +4 -11
  20. package/dist/cjs/plugins/card/styles.js +1 -1
  21. package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
  22. package/dist/cjs/plugins/code-block/actions.js +36 -2
  23. package/dist/cjs/plugins/code-block/nodeviews/code-block.js +70 -1
  24. package/dist/cjs/plugins/code-block/pm-plugins/actions.js +2 -1
  25. package/dist/cjs/plugins/code-block/pm-plugins/main.js +46 -8
  26. package/dist/cjs/plugins/code-block/styles.js +28 -24
  27. package/dist/cjs/plugins/collab-edit/styles.js +4 -2
  28. package/dist/cjs/plugins/collab-edit/ui/styles.js +4 -2
  29. package/dist/cjs/plugins/collab-edit/utils.js +1 -0
  30. package/dist/cjs/plugins/date/ui/DatePicker/index.js +3 -1
  31. package/dist/cjs/plugins/expand/ui/styles.js +16 -14
  32. package/dist/cjs/plugins/extension/commands.js +3 -2
  33. package/dist/cjs/plugins/extension/context-panel.js +21 -7
  34. package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +6 -4
  35. package/dist/cjs/plugins/extension/ui/Extension/InlineExtension/styles.js +3 -1
  36. package/dist/cjs/plugins/extension/ui/Extension/styles.js +7 -5
  37. package/dist/cjs/plugins/extension/ui/SaveIndicator/SaveIndicator.js +4 -2
  38. package/dist/cjs/plugins/fake-text-cursor/styles.js +3 -1
  39. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
  40. package/dist/cjs/plugins/find-replace/styles.js +2 -6
  41. package/dist/cjs/plugins/find-replace/ui/styles.js +4 -2
  42. package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +3 -1
  43. package/dist/cjs/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +3 -1
  44. package/dist/cjs/plugins/floating-toolbar/ui/Separator.js +3 -1
  45. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +6 -4
  46. package/dist/cjs/plugins/floating-toolbar/ui/styles.js +12 -10
  47. package/dist/cjs/plugins/grid/styles.js +3 -1
  48. package/dist/cjs/plugins/help-dialog/ui/styles.js +9 -7
  49. package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +23 -1
  50. package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +10 -1
  51. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +5 -3
  52. package/dist/cjs/plugins/hyperlink/utils.js +53 -2
  53. package/dist/cjs/plugins/jira-issue/nodeviews/jira-issue.js +4 -2
  54. package/dist/cjs/plugins/layout/styles.js +1 -1
  55. package/dist/cjs/plugins/media/commands/helpers.js +10 -9
  56. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +23 -4
  57. package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +6 -0
  58. package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -3
  59. package/dist/cjs/plugins/media/pm-plugins/main.js +1 -0
  60. package/dist/cjs/plugins/media/styles.js +1 -1
  61. package/dist/cjs/plugins/media/ui/CaptionPlaceholder/index.js +3 -1
  62. package/dist/cjs/plugins/media/ui/Media/DropPlaceholder.js +4 -2
  63. package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +3 -1
  64. package/dist/cjs/plugins/mentions/styles.js +3 -1
  65. package/dist/cjs/plugins/mentions/ui/InviteItem/index.js +3 -1
  66. package/dist/cjs/plugins/mentions/ui/InviteItem/styles.js +4 -2
  67. package/dist/cjs/plugins/panel/index.js +1 -0
  68. package/dist/cjs/plugins/panel/nodeviews/panel.js +4 -1
  69. package/dist/cjs/plugins/panel/pm-plugins/keymaps.js +21 -3
  70. package/dist/cjs/plugins/paste/handlers.js +23 -0
  71. package/dist/cjs/plugins/paste/linkify-md-plugin.js +7 -0
  72. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +9 -1
  73. package/dist/cjs/plugins/paste/pm-plugins/main.js +27 -1
  74. package/dist/cjs/plugins/placeholder/index.js +15 -3
  75. package/dist/cjs/plugins/placeholder/styles.js +3 -1
  76. package/dist/cjs/plugins/placeholder-text/styles.js +3 -1
  77. package/dist/cjs/plugins/selection/gap-cursor/styles.js +1 -1
  78. package/dist/cjs/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
  79. package/dist/cjs/plugins/status/ui/statusPicker.js +3 -3
  80. package/dist/cjs/plugins/table/index.js +14 -4
  81. package/dist/cjs/plugins/table/nodeviews/TableComponent.js +6 -6
  82. package/dist/cjs/plugins/table/nodeviews/table.js +9 -4
  83. package/dist/cjs/plugins/table/pm-plugins/main.js +1 -4
  84. package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +118 -0
  85. package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
  86. package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin.js +2 -5
  87. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +4 -8
  88. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
  89. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
  90. package/dist/cjs/plugins/table/transforms/column-width.js +1 -2
  91. package/dist/cjs/plugins/table/transforms/fix-tables.js +1 -3
  92. package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +4 -1
  93. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +3 -1
  94. package/dist/cjs/plugins/table/ui/common-styles.js +4 -2
  95. package/dist/cjs/plugins/table/ui/consts.js +14 -11
  96. package/dist/cjs/plugins/table/ui/ui-styles.js +17 -10
  97. package/dist/cjs/plugins/table/utils/decoration.js +3 -4
  98. package/dist/cjs/plugins/table/utils/paste.js +9 -9
  99. package/dist/cjs/plugins/type-ahead/index.js +4 -3
  100. package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +3 -1
  101. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +4 -4
  102. package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +11 -9
  103. package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +73 -3
  104. package/dist/cjs/plugins/unsupported-content/styles.js +1 -1
  105. package/dist/cjs/ui/Addon/Dropdown/styles.js +3 -1
  106. package/dist/cjs/ui/Addon/DropdownItem/styles.js +3 -1
  107. package/dist/cjs/ui/Appearance/Chromeless.js +2 -1
  108. package/dist/cjs/ui/Appearance/Comment/Comment.js +10 -3
  109. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +4 -2
  110. package/dist/cjs/ui/Appearance/FullPage/FullPage.js +5 -2
  111. package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
  112. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
  113. package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +6 -3
  114. package/dist/cjs/ui/ChromeCollapsed/styles.js +1 -1
  115. package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +21 -14
  116. package/dist/cjs/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
  117. package/dist/cjs/ui/ConfigPanel/Fields/CheckboxGroup.js +3 -1
  118. package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +3 -1
  119. package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +3 -1
  120. package/dist/cjs/ui/ConfigPanel/Fields/common/RequiredIndicator.js +3 -1
  121. package/dist/cjs/ui/ConfigPanel/Header.js +4 -2
  122. package/dist/cjs/ui/ConfigPanel/NestedForms/RemovableField.js +4 -8
  123. package/dist/cjs/ui/ContentStyles/index.js +4 -2
  124. package/dist/cjs/ui/ContextPanel/index.js +3 -1
  125. package/dist/cjs/ui/DropdownMenu/index.js +5 -0
  126. package/dist/cjs/ui/ElementBrowser/InsertMenu.js +6 -4
  127. package/dist/cjs/ui/ElementBrowser/ModalElementBrowser.js +4 -2
  128. package/dist/cjs/ui/ElementBrowser/components/CategoryList.js +4 -2
  129. package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +12 -5
  130. package/dist/cjs/ui/ElementBrowser/components/ElementList/EmptyState.js +3 -1
  131. package/dist/cjs/ui/ElementBrowser/components/ElementSearch.js +3 -1
  132. package/dist/cjs/ui/ElementBrowser/constants.js +3 -1
  133. package/dist/cjs/ui/FloatingToolbar/styles.js +2 -2
  134. package/dist/cjs/ui/LinkSearch/LinkSearchListItem.js +5 -3
  135. package/dist/cjs/ui/PanelTextInput/styles.js +3 -1
  136. package/dist/cjs/ui/PluginSlot/index.js +7 -4
  137. package/dist/cjs/ui/Toolbar/ToolbarInner.js +2 -1
  138. package/dist/cjs/ui/Toolbar/ToolbarWithSizeDetector.js +5 -2
  139. package/dist/cjs/ui/ToolbarFeedback/styles.js +5 -3
  140. package/dist/cjs/ui/WithFlash/index.js +4 -2
  141. package/dist/cjs/ui/styles.js +6 -4
  142. package/dist/cjs/utils/document.js +62 -6
  143. package/dist/cjs/utils/filter/privacy-filter.js +2 -2
  144. package/dist/cjs/utils/step.js +17 -1
  145. package/dist/cjs/version-wrapper.js +1 -1
  146. package/dist/cjs/version.json +1 -1
  147. package/dist/es2019/actions/index.js +25 -1
  148. package/dist/es2019/create-editor/ReactEditorView.js +2 -0
  149. package/dist/es2019/create-editor/create-plugins-list.js +1 -2
  150. package/dist/es2019/editor.js +5 -2
  151. package/dist/es2019/keymaps/index.js +5 -1
  152. package/dist/es2019/labs/next/ContentComponents.js +7 -2
  153. package/dist/es2019/labs/next/full-page.js +11 -8
  154. package/dist/es2019/nodeviews/getInlineNodeViewProducer.js +4 -3
  155. package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +16 -4
  156. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/styles.js +2 -1
  157. package/dist/es2019/plugins/analytics/types/enums.js +3 -0
  158. package/dist/es2019/plugins/base/index.js +6 -15
  159. package/dist/es2019/plugins/base/pm-plugins/better-type-history.js +1 -11
  160. package/dist/es2019/plugins/base/pm-plugins/inline-cursor-target.js +72 -17
  161. package/dist/es2019/plugins/block-type/commands/block-type.js +25 -16
  162. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -2
  163. package/dist/es2019/plugins/breakout/ui/LayoutButton.js +6 -10
  164. package/dist/es2019/plugins/card/styles.js +1 -1
  165. package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
  166. package/dist/es2019/plugins/code-block/actions.js +32 -0
  167. package/dist/es2019/plugins/code-block/nodeviews/code-block.js +61 -1
  168. package/dist/es2019/plugins/code-block/pm-plugins/actions.js +2 -1
  169. package/dist/es2019/plugins/code-block/pm-plugins/main.js +37 -3
  170. package/dist/es2019/plugins/code-block/styles.js +30 -27
  171. package/dist/es2019/plugins/collab-edit/styles.js +3 -2
  172. package/dist/es2019/plugins/collab-edit/ui/styles.js +4 -3
  173. package/dist/es2019/plugins/collab-edit/utils.js +1 -0
  174. package/dist/es2019/plugins/date/ui/DatePicker/index.js +3 -2
  175. package/dist/es2019/plugins/expand/ui/styles.js +15 -14
  176. package/dist/es2019/plugins/extension/commands.js +3 -2
  177. package/dist/es2019/plugins/extension/context-panel.js +11 -3
  178. package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +5 -4
  179. package/dist/es2019/plugins/extension/ui/Extension/InlineExtension/styles.js +2 -1
  180. package/dist/es2019/plugins/extension/ui/Extension/styles.js +7 -6
  181. package/dist/es2019/plugins/extension/ui/SaveIndicator/SaveIndicator.js +4 -4
  182. package/dist/es2019/plugins/fake-text-cursor/styles.js +3 -2
  183. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
  184. package/dist/es2019/plugins/find-replace/styles.js +4 -4
  185. package/dist/es2019/plugins/find-replace/ui/styles.js +3 -2
  186. package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
  187. package/dist/es2019/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +2 -1
  188. package/dist/es2019/plugins/floating-toolbar/ui/Separator.js +2 -1
  189. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +4 -4
  190. package/dist/es2019/plugins/floating-toolbar/ui/styles.js +11 -10
  191. package/dist/es2019/plugins/grid/styles.js +4 -2
  192. package/dist/es2019/plugins/help-dialog/ui/styles.js +10 -9
  193. package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +24 -2
  194. package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +9 -1
  195. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +5 -4
  196. package/dist/es2019/plugins/hyperlink/utils.js +43 -2
  197. package/dist/es2019/plugins/jira-issue/nodeviews/jira-issue.js +6 -5
  198. package/dist/es2019/plugins/layout/styles.js +10 -7
  199. package/dist/es2019/plugins/media/commands/helpers.js +6 -8
  200. package/dist/es2019/plugins/media/nodeviews/mediaInline.js +21 -5
  201. package/dist/es2019/plugins/media/nodeviews/mediaNodeView/media.js +7 -0
  202. package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -4
  203. package/dist/es2019/plugins/media/pm-plugins/main.js +2 -0
  204. package/dist/es2019/plugins/media/styles.js +3 -3
  205. package/dist/es2019/plugins/media/ui/CaptionPlaceholder/index.js +2 -1
  206. package/dist/es2019/plugins/media/ui/Media/DropPlaceholder.js +4 -3
  207. package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +2 -1
  208. package/dist/es2019/plugins/mentions/styles.js +5 -4
  209. package/dist/es2019/plugins/mentions/ui/InviteItem/index.js +2 -1
  210. package/dist/es2019/plugins/mentions/ui/InviteItem/styles.js +3 -2
  211. package/dist/es2019/plugins/panel/index.js +1 -0
  212. package/dist/es2019/plugins/panel/nodeviews/panel.js +4 -1
  213. package/dist/es2019/plugins/panel/pm-plugins/keymaps.js +22 -4
  214. package/dist/es2019/plugins/paste/handlers.js +23 -0
  215. package/dist/es2019/plugins/paste/linkify-md-plugin.js +7 -1
  216. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +4 -1
  217. package/dist/es2019/plugins/paste/pm-plugins/main.js +27 -2
  218. package/dist/es2019/plugins/placeholder/index.js +12 -1
  219. package/dist/es2019/plugins/placeholder/styles.js +3 -1
  220. package/dist/es2019/plugins/placeholder-text/styles.js +5 -4
  221. package/dist/es2019/plugins/selection/gap-cursor/styles.js +9 -9
  222. package/dist/es2019/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
  223. package/dist/es2019/plugins/status/ui/statusPicker.js +3 -3
  224. package/dist/es2019/plugins/table/index.js +13 -4
  225. package/dist/es2019/plugins/table/nodeviews/TableComponent.js +6 -6
  226. package/dist/es2019/plugins/table/nodeviews/table.js +6 -2
  227. package/dist/es2019/plugins/table/pm-plugins/main.js +1 -4
  228. package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +106 -0
  229. package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
  230. package/dist/es2019/plugins/table/pm-plugins/table-resizing/plugin.js +2 -4
  231. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +3 -7
  232. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
  233. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
  234. package/dist/es2019/plugins/table/transforms/column-width.js +1 -2
  235. package/dist/es2019/plugins/table/transforms/fix-tables.js +1 -3
  236. package/dist/es2019/plugins/table/ui/FloatingContextualButton/styles.js +4 -2
  237. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/styles.js +4 -3
  238. package/dist/es2019/plugins/table/ui/common-styles.js +29 -27
  239. package/dist/es2019/plugins/table/ui/consts.js +15 -12
  240. package/dist/es2019/plugins/table/ui/ui-styles.js +28 -23
  241. package/dist/es2019/plugins/table/utils/decoration.js +1 -4
  242. package/dist/es2019/plugins/table/utils/paste.js +9 -9
  243. package/dist/es2019/plugins/type-ahead/index.js +4 -3
  244. package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +2 -1
  245. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +4 -4
  246. package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +10 -9
  247. package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +64 -6
  248. package/dist/es2019/plugins/unsupported-content/styles.js +1 -1
  249. package/dist/es2019/ui/Addon/Dropdown/styles.js +3 -2
  250. package/dist/es2019/ui/Addon/DropdownItem/styles.js +3 -2
  251. package/dist/es2019/ui/Appearance/Chromeless.js +2 -1
  252. package/dist/es2019/ui/Appearance/Comment/Comment.js +9 -4
  253. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +4 -2
  254. package/dist/es2019/ui/Appearance/FullPage/FullPage.js +6 -2
  255. package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
  256. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
  257. package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +7 -3
  258. package/dist/es2019/ui/ChromeCollapsed/styles.js +4 -3
  259. package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +10 -2
  260. package/dist/es2019/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
  261. package/dist/es2019/ui/ConfigPanel/ErrorMessage/ErrorImage.js +3 -0
  262. package/dist/es2019/ui/ConfigPanel/Fields/CheckboxGroup.js +2 -1
  263. package/dist/es2019/ui/ConfigPanel/Fields/Expand.js +2 -1
  264. package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +2 -1
  265. package/dist/es2019/ui/ConfigPanel/Fields/common/RequiredIndicator.js +2 -1
  266. package/dist/es2019/ui/ConfigPanel/Header.js +3 -2
  267. package/dist/es2019/ui/ConfigPanel/NestedForms/RemovableField.js +4 -3
  268. package/dist/es2019/ui/ContentStyles/index.js +3 -2
  269. package/dist/es2019/ui/ContextPanel/index.js +2 -1
  270. package/dist/es2019/ui/DropdownMenu/index.js +5 -0
  271. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +6 -3
  272. package/dist/es2019/ui/ElementBrowser/ModalElementBrowser.js +3 -2
  273. package/dist/es2019/ui/ElementBrowser/components/CategoryList.js +3 -2
  274. package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +12 -5
  275. package/dist/es2019/ui/ElementBrowser/components/ElementList/EmptyState.js +2 -1
  276. package/dist/es2019/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +3 -0
  277. package/dist/es2019/ui/ElementBrowser/components/ElementSearch.js +2 -1
  278. package/dist/es2019/ui/ElementBrowser/constants.js +3 -1
  279. package/dist/es2019/ui/FloatingToolbar/styles.js +4 -4
  280. package/dist/es2019/ui/LinkSearch/LinkSearchListItem.js +4 -3
  281. package/dist/es2019/ui/PanelTextInput/styles.js +5 -5
  282. package/dist/es2019/ui/PluginSlot/index.js +7 -4
  283. package/dist/es2019/ui/Toolbar/ToolbarInner.js +2 -1
  284. package/dist/es2019/ui/Toolbar/ToolbarWithSizeDetector.js +4 -2
  285. package/dist/es2019/ui/ToolbarFeedback/styles.js +5 -4
  286. package/dist/es2019/ui/WithFlash/index.js +4 -3
  287. package/dist/es2019/ui/styles.js +10 -9
  288. package/dist/es2019/utils/document.js +58 -5
  289. package/dist/es2019/utils/filter/privacy-filter.js +1 -1
  290. package/dist/es2019/utils/step.js +12 -1
  291. package/dist/es2019/version-wrapper.js +1 -1
  292. package/dist/es2019/version.json +1 -1
  293. package/dist/esm/actions/index.js +26 -1
  294. package/dist/esm/create-editor/ReactEditorView.js +2 -0
  295. package/dist/esm/create-editor/create-plugins-list.js +1 -2
  296. package/dist/esm/editor.js +5 -2
  297. package/dist/esm/keymaps/index.js +5 -1
  298. package/dist/esm/labs/next/ContentComponents.js +8 -4
  299. package/dist/esm/labs/next/full-page.js +11 -8
  300. package/dist/esm/nodeviews/getInlineNodeViewProducer.js +4 -3
  301. package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +3 -2
  302. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/styles.js +2 -1
  303. package/dist/esm/plugins/analytics/types/enums.js +3 -0
  304. package/dist/esm/plugins/base/index.js +8 -17
  305. package/dist/esm/plugins/base/pm-plugins/better-type-history.js +1 -11
  306. package/dist/esm/plugins/base/pm-plugins/inline-cursor-target.js +72 -17
  307. package/dist/esm/plugins/block-type/commands/block-type.js +31 -22
  308. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -2
  309. package/dist/esm/plugins/breakout/ui/LayoutButton.js +3 -5
  310. package/dist/esm/plugins/card/styles.js +1 -1
  311. package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
  312. package/dist/esm/plugins/code-block/actions.js +28 -0
  313. package/dist/esm/plugins/code-block/nodeviews/code-block.js +67 -1
  314. package/dist/esm/plugins/code-block/pm-plugins/actions.js +2 -1
  315. package/dist/esm/plugins/code-block/pm-plugins/main.js +39 -3
  316. package/dist/esm/plugins/code-block/styles.js +27 -23
  317. package/dist/esm/plugins/collab-edit/styles.js +3 -2
  318. package/dist/esm/plugins/collab-edit/ui/styles.js +3 -2
  319. package/dist/esm/plugins/collab-edit/utils.js +2 -0
  320. package/dist/esm/plugins/date/ui/DatePicker/index.js +2 -1
  321. package/dist/esm/plugins/expand/ui/styles.js +15 -14
  322. package/dist/esm/plugins/extension/commands.js +3 -2
  323. package/dist/esm/plugins/extension/context-panel.js +21 -7
  324. package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +5 -4
  325. package/dist/esm/plugins/extension/ui/Extension/InlineExtension/styles.js +2 -1
  326. package/dist/esm/plugins/extension/ui/Extension/styles.js +6 -5
  327. package/dist/esm/plugins/extension/ui/SaveIndicator/SaveIndicator.js +3 -2
  328. package/dist/esm/plugins/fake-text-cursor/styles.js +2 -1
  329. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
  330. package/dist/esm/plugins/find-replace/styles.js +3 -3
  331. package/dist/esm/plugins/find-replace/ui/styles.js +3 -2
  332. package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
  333. package/dist/esm/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +2 -1
  334. package/dist/esm/plugins/floating-toolbar/ui/Separator.js +2 -1
  335. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +5 -4
  336. package/dist/esm/plugins/floating-toolbar/ui/styles.js +11 -10
  337. package/dist/esm/plugins/grid/styles.js +2 -1
  338. package/dist/esm/plugins/help-dialog/ui/styles.js +8 -7
  339. package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +24 -2
  340. package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +9 -1
  341. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +4 -3
  342. package/dist/esm/plugins/hyperlink/utils.js +44 -2
  343. package/dist/esm/plugins/jira-issue/nodeviews/jira-issue.js +3 -2
  344. package/dist/esm/plugins/layout/styles.js +1 -1
  345. package/dist/esm/plugins/media/commands/helpers.js +6 -8
  346. package/dist/esm/plugins/media/nodeviews/mediaInline.js +22 -4
  347. package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +7 -0
  348. package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +4 -3
  349. package/dist/esm/plugins/media/pm-plugins/main.js +2 -0
  350. package/dist/esm/plugins/media/styles.js +1 -1
  351. package/dist/esm/plugins/media/ui/CaptionPlaceholder/index.js +2 -1
  352. package/dist/esm/plugins/media/ui/Media/DropPlaceholder.js +3 -2
  353. package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +2 -1
  354. package/dist/esm/plugins/mentions/styles.js +2 -1
  355. package/dist/esm/plugins/mentions/ui/InviteItem/index.js +2 -1
  356. package/dist/esm/plugins/mentions/ui/InviteItem/styles.js +3 -2
  357. package/dist/esm/plugins/panel/index.js +1 -0
  358. package/dist/esm/plugins/panel/nodeviews/panel.js +4 -1
  359. package/dist/esm/plugins/panel/pm-plugins/keymaps.js +22 -4
  360. package/dist/esm/plugins/paste/handlers.js +21 -0
  361. package/dist/esm/plugins/paste/linkify-md-plugin.js +7 -1
  362. package/dist/esm/plugins/paste/pm-plugins/analytics.js +6 -1
  363. package/dist/esm/plugins/paste/pm-plugins/main.js +27 -2
  364. package/dist/esm/plugins/placeholder/index.js +12 -1
  365. package/dist/esm/plugins/placeholder/styles.js +2 -1
  366. package/dist/esm/plugins/placeholder-text/styles.js +2 -1
  367. package/dist/esm/plugins/selection/gap-cursor/styles.js +1 -1
  368. package/dist/esm/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
  369. package/dist/esm/plugins/status/ui/statusPicker.js +2 -2
  370. package/dist/esm/plugins/table/index.js +13 -4
  371. package/dist/esm/plugins/table/nodeviews/TableComponent.js +6 -6
  372. package/dist/esm/plugins/table/nodeviews/table.js +6 -2
  373. package/dist/esm/plugins/table/pm-plugins/main.js +1 -4
  374. package/dist/esm/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +102 -0
  375. package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
  376. package/dist/esm/plugins/table/pm-plugins/table-resizing/plugin.js +2 -5
  377. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +4 -8
  378. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
  379. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
  380. package/dist/esm/plugins/table/transforms/column-width.js +1 -2
  381. package/dist/esm/plugins/table/transforms/fix-tables.js +1 -3
  382. package/dist/esm/plugins/table/ui/FloatingContextualButton/styles.js +3 -1
  383. package/dist/esm/plugins/table/ui/FloatingContextualMenu/styles.js +2 -1
  384. package/dist/esm/plugins/table/ui/common-styles.js +4 -2
  385. package/dist/esm/plugins/table/ui/consts.js +15 -12
  386. package/dist/esm/plugins/table/ui/ui-styles.js +15 -10
  387. package/dist/esm/plugins/table/utils/decoration.js +3 -4
  388. package/dist/esm/plugins/table/utils/paste.js +9 -9
  389. package/dist/esm/plugins/type-ahead/index.js +4 -3
  390. package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +2 -1
  391. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +4 -4
  392. package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +10 -9
  393. package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +71 -5
  394. package/dist/esm/plugins/unsupported-content/styles.js +1 -1
  395. package/dist/esm/ui/Addon/Dropdown/styles.js +2 -1
  396. package/dist/esm/ui/Addon/DropdownItem/styles.js +2 -1
  397. package/dist/esm/ui/Appearance/Chromeless.js +2 -1
  398. package/dist/esm/ui/Appearance/Comment/Comment.js +10 -3
  399. package/dist/esm/ui/Appearance/Comment/Toolbar.js +3 -2
  400. package/dist/esm/ui/Appearance/FullPage/FullPage.js +6 -2
  401. package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
  402. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
  403. package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +5 -3
  404. package/dist/esm/ui/ChromeCollapsed/styles.js +1 -1
  405. package/dist/esm/ui/ConfigPanel/ConfigPanel.js +21 -14
  406. package/dist/esm/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
  407. package/dist/esm/ui/ConfigPanel/ErrorMessage/ErrorImage.js +3 -0
  408. package/dist/esm/ui/ConfigPanel/Fields/CheckboxGroup.js +2 -1
  409. package/dist/esm/ui/ConfigPanel/Fields/Expand.js +2 -1
  410. package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +2 -1
  411. package/dist/esm/ui/ConfigPanel/Fields/common/RequiredIndicator.js +2 -1
  412. package/dist/esm/ui/ConfigPanel/Header.js +3 -2
  413. package/dist/esm/ui/ConfigPanel/NestedForms/RemovableField.js +3 -2
  414. package/dist/esm/ui/ContentStyles/index.js +3 -2
  415. package/dist/esm/ui/ContextPanel/index.js +2 -1
  416. package/dist/esm/ui/DropdownMenu/index.js +5 -0
  417. package/dist/esm/ui/ElementBrowser/InsertMenu.js +5 -4
  418. package/dist/esm/ui/ElementBrowser/ModalElementBrowser.js +3 -2
  419. package/dist/esm/ui/ElementBrowser/components/CategoryList.js +3 -2
  420. package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +11 -5
  421. package/dist/esm/ui/ElementBrowser/components/ElementList/EmptyState.js +2 -1
  422. package/dist/esm/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +3 -0
  423. package/dist/esm/ui/ElementBrowser/components/ElementSearch.js +2 -1
  424. package/dist/esm/ui/ElementBrowser/constants.js +3 -1
  425. package/dist/esm/ui/FloatingToolbar/styles.js +3 -3
  426. package/dist/esm/ui/LinkSearch/LinkSearchListItem.js +4 -3
  427. package/dist/esm/ui/PanelTextInput/styles.js +4 -3
  428. package/dist/esm/ui/PluginSlot/index.js +7 -4
  429. package/dist/esm/ui/Toolbar/ToolbarInner.js +2 -1
  430. package/dist/esm/ui/Toolbar/ToolbarWithSizeDetector.js +4 -2
  431. package/dist/esm/ui/ToolbarFeedback/styles.js +4 -3
  432. package/dist/esm/ui/WithFlash/index.js +3 -2
  433. package/dist/esm/ui/styles.js +5 -4
  434. package/dist/esm/utils/document.js +59 -5
  435. package/dist/esm/utils/filter/privacy-filter.js +1 -1
  436. package/dist/esm/utils/step.js +12 -1
  437. package/dist/esm/version-wrapper.js +1 -1
  438. package/dist/esm/version.json +1 -1
  439. package/dist/types/actions/index.d.ts +6 -0
  440. package/dist/types/labs/next/ContentComponents.d.ts +7 -1
  441. package/dist/types/nodeviews/getInlineNodeViewProducer.d.ts +1 -0
  442. package/dist/types/plugins/analytics/types/enums.d.ts +3 -0
  443. package/dist/types/plugins/analytics/types/general-events.d.ts +7 -1
  444. package/dist/types/plugins/base/pm-plugins/inline-cursor-target.d.ts +1 -1
  445. package/dist/types/plugins/code-block/actions.d.ts +2 -0
  446. package/dist/types/plugins/code-block/nodeviews/code-block.d.ts +2 -0
  447. package/dist/types/plugins/code-block/pm-plugins/actions.d.ts +1 -0
  448. package/dist/types/plugins/code-block/pm-plugins/main-state.d.ts +1 -0
  449. package/dist/types/plugins/extension/commands.d.ts +1 -1
  450. package/dist/types/plugins/extension/types.d.ts +1 -0
  451. package/dist/types/plugins/extension/ui/Extension/Extension/index.d.ts +6 -0
  452. package/dist/types/plugins/find-replace/styles.d.ts +0 -2
  453. package/dist/types/plugins/hyperlink/utils.d.ts +8 -0
  454. package/dist/types/plugins/media/commands/helpers.d.ts +2 -0
  455. package/dist/types/plugins/media/nodeviews/mediaNodeView/media.d.ts +1 -0
  456. package/dist/types/plugins/media/pm-plugins/main.d.ts +2 -1
  457. package/dist/types/plugins/media/pm-plugins/types.d.ts +2 -1
  458. package/dist/types/plugins/paste/handlers.d.ts +1 -0
  459. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +1 -0
  460. package/dist/types/plugins/table/commands/misc.d.ts +0 -1
  461. package/dist/types/plugins/table/index.d.ts +0 -1
  462. package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +1 -0
  463. package/dist/types/plugins/table/nodeviews/types.d.ts +0 -1
  464. package/dist/types/plugins/table/pm-plugins/main.d.ts +1 -1
  465. package/dist/types/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +15 -0
  466. package/dist/types/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +1 -1
  467. package/dist/types/plugins/table/pm-plugins/table-resizing/plugin.d.ts +1 -1
  468. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +1 -2
  469. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
  470. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +0 -1
  471. package/dist/types/plugins/table/transforms/fix-tables.d.ts +0 -1
  472. package/dist/types/plugins/table/types.d.ts +0 -1
  473. package/dist/types/plugins/table/ui/consts.d.ts +9 -9
  474. package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +2 -0
  475. package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +4 -4
  476. package/dist/types/types/editor-appearance-component.d.ts +0 -1
  477. package/dist/types/types/editor-props.d.ts +4 -0
  478. package/dist/types/types/feature-flags.d.ts +8 -0
  479. package/dist/types/types/ui-components.d.ts +1 -0
  480. package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +1 -0
  481. package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +1 -0
  482. package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +3 -2
  483. package/dist/types/ui/ConfigPanel/ConfigPanelFieldsLoader.d.ts +3 -2
  484. package/dist/types/ui/PluginSlot/index.d.ts +1 -0
  485. package/dist/types/ui/Toolbar/toolbar-types.d.ts +1 -0
  486. package/dist/types/utils/document.d.ts +1 -0
  487. package/dist/types/utils/step.d.ts +1 -0
  488. package/docs/0-intro.tsx +12 -4
  489. package/package.json +20 -20
@@ -33,6 +33,8 @@ var _styles = require("../../../ui/styles");
33
33
 
34
34
  var _typeAhead = require("@atlaskit/editor-common/type-ahead");
35
35
 
36
+ var _tokens = require("@atlaskit/tokens");
37
+
36
38
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
37
39
 
38
40
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -65,28 +67,28 @@ var itemTheme = (0, _defineProperty2.default)({}, _item.itemThemeNamespace, {
65
67
  hover: {
66
68
  // background: colors.transparent, transparent is not a thing
67
69
  text: _colors.text,
68
- secondaryText: _colors.N200
70
+ secondaryText: (0, _tokens.token)('color.text.subtlest', _colors.N200)
69
71
  },
70
72
  selected: {
71
73
  background: (0, _components.themed)({
72
- light: _colors.N20,
73
- dark: _colors.DN70
74
+ light: (0, _tokens.token)('color.background.neutral.subtle.hovered', _colors.N20),
75
+ dark: (0, _tokens.token)('color.background.neutral.subtle.hovered', _colors.DN70)
74
76
  }),
75
77
  text: (0, _components.themed)({
76
- light: _colors.N800,
77
- dark: _colors.DN600
78
+ light: (0, _tokens.token)('color.text', _colors.N800),
79
+ dark: (0, _tokens.token)('color.text', _colors.DN600)
78
80
  }),
79
81
  secondaryText: (0, _components.themed)({
80
- light: _colors.N200,
81
- dark: _colors.DN300
82
+ light: (0, _tokens.token)('color.text.subtlest', _colors.N200),
83
+ dark: (0, _tokens.token)('color.text.subtlest', _colors.DN300)
82
84
  })
83
85
  }
84
86
  });
85
87
  exports.itemTheme = itemTheme;
86
- var itemIcon = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", "px;\n height: ", "px;\n overflow: hidden;\n border: 1px solid rgba(223, 225, 229, 0.5); /* N60 at 50% */\n border-radius: ", "px;\n box-sizing: border-box;\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n div {\n width: ", "px;\n height: ", "px;\n }\n"])), ICON_WIDTH, ICON_HEIGHT, (0, _constants.borderRadius)(), ICON_WIDTH, ICON_HEIGHT);
88
+ var itemIcon = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", "px;\n height: ", "px;\n overflow: hidden;\n border: 1px solid ", "; /* N60 at 50% */\n border-radius: ", "px;\n box-sizing: border-box;\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n div {\n width: ", "px;\n height: ", "px;\n }\n"])), ICON_WIDTH, ICON_HEIGHT, (0, _tokens.token)('color.border', 'rgba(223, 225, 229, 0.5)'), (0, _constants.borderRadius)(), ICON_WIDTH, ICON_HEIGHT);
87
89
  exports.itemIcon = itemIcon;
88
90
  var itemBody = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n line-height: 1.4;\n"])));
89
- var itemText = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n white-space: initial;\n .item-description {\n font-size: ", ";\n color: ", ";\n margin-top: 4px;\n }\n"])), (0, _editorSharedStyles.relativeFontSizeToBase16)(11.67), _colors.N200);
91
+ var itemText = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n white-space: initial;\n .item-description {\n font-size: ", ";\n color: ", ";\n margin-top: 4px;\n }\n"])), (0, _editorSharedStyles.relativeFontSizeToBase16)(11.67), (0, _tokens.token)('color.text.subtlest', _colors.N200));
90
92
  var itemAfter = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n flex: 0 0 auto;\n"])));
91
93
  var hidden = {
92
94
  overflow: 'hidden'
@@ -9,12 +9,16 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports.TypeAheadPopup = void 0;
11
11
 
12
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
+
12
14
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
15
 
14
16
  var _react = _interopRequireWildcard(require("react"));
15
17
 
16
18
  var _react2 = require("@emotion/react");
17
19
 
20
+ var _rafSchd = _interopRequireDefault(require("raf-schd"));
21
+
18
22
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
19
23
 
20
24
  var _ui = require("@atlaskit/editor-common/ui");
@@ -29,13 +33,18 @@ var _constants2 = require("../constants");
29
33
 
30
34
  var _TypeAheadList = require("./TypeAheadList");
31
35
 
36
+ var _TypeAheadListItem = require("./TypeAheadListItem");
37
+
38
+ var _tokens = require("@atlaskit/tokens");
39
+
32
40
  var _templateObject;
33
41
 
34
42
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
35
43
 
36
44
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
37
45
 
38
- var typeAheadContent = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: ", ";\n border-radius: ", "px;\n box-shadow: 0 0 1px ", ", 0 4px 8px -2px ", ";\n padding: ", "px 0;\n width: 320px;\n max-height: 380px; /* ~5.5 visibile items */\n overflow-y: auto;\n -ms-overflow-style: -ms-autohiding-scrollbar;\n position: relative;\n"])), _colors.N0, (0, _constants.borderRadius)(), _colors.N60A, _colors.N50A, (0, _constants.gridSize)() / 2);
46
+ var DEFAULT_TYPEAHEAD_MENU_HEIGHT = 380;
47
+ var typeAheadContent = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: ", ";\n border-radius: ", "px;\n box-shadow: ", ";\n padding: ", "px 0;\n width: 320px;\n max-height: 380px; /* ~5.5 visibile items */\n overflow-y: auto;\n -ms-overflow-style: -ms-autohiding-scrollbar;\n position: relative;\n"])), (0, _tokens.token)('elevation.surface.overlay', _colors.N0), (0, _constants.borderRadius)(), (0, _tokens.token)('elevation.shadow.overlay', "0 0 1px ".concat(_colors.N60A, ", 0 4px 8px -2px ").concat(_colors.N50A)), (0, _constants.gridSize)() / 2);
39
48
 
40
49
  var Highlight = function Highlight(_ref) {
41
50
  var state = _ref.state,
@@ -115,13 +124,73 @@ var TypeAheadPopup = /*#__PURE__*/_react.default.memo(function (props) {
115
124
  // we need to send the event again
116
125
  // eslint-disable-next-line react-hooks/exhaustive-deps
117
126
  triggerHandler]);
127
+
128
+ var _useState = (0, _react.useState)(DEFAULT_TYPEAHEAD_MENU_HEIGHT),
129
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
130
+ fitHeight = _useState2[0],
131
+ setFitHeight = _useState2[1];
132
+
133
+ var getFitHeight = (0, _react.useCallback)(function () {
134
+ if (!anchorElement || !popupsMountPoint) {
135
+ return;
136
+ }
137
+
138
+ var target = anchorElement;
139
+
140
+ var _target$getBoundingCl = target.getBoundingClientRect(),
141
+ targetTop = _target$getBoundingCl.top,
142
+ targetHeight = _target$getBoundingCl.height;
143
+
144
+ var boundariesElement = document.body;
145
+
146
+ var _boundariesElement$ge = boundariesElement.getBoundingClientRect(),
147
+ boundariesHeight = _boundariesElement$ge.height,
148
+ boundariesTop = _boundariesElement$ge.top; // Calculating the space above and space below our decoration
149
+
150
+
151
+ var spaceAbove = targetTop - (boundariesTop - boundariesElement.scrollTop);
152
+ var spaceBelow = boundariesTop + boundariesHeight - (targetTop + targetHeight); // Keep default height if more than enough space
153
+
154
+ if (spaceBelow >= DEFAULT_TYPEAHEAD_MENU_HEIGHT) {
155
+ return setFitHeight(DEFAULT_TYPEAHEAD_MENU_HEIGHT);
156
+ } // Determines whether typeahead will fit above or below decoration
157
+ // and return the space available.
158
+
159
+
160
+ var newFitHeight = spaceBelow >= spaceAbove ? spaceBelow : spaceAbove; // Each typeahead item has some padding
161
+ // We want to leave some space at the top so first item
162
+ // is not partially cropped
163
+
164
+ var fitHeightWithSpace = newFitHeight - _TypeAheadListItem.ITEM_PADDING * 2; // Ensure typeahead height is max its default height
165
+
166
+ var minFitHeight = Math.min(DEFAULT_TYPEAHEAD_MENU_HEIGHT, fitHeightWithSpace);
167
+ return setFitHeight(minFitHeight);
168
+ }, [anchorElement, popupsMountPoint]);
169
+ var getFitHeightDebounced = (0, _rafSchd.default)(getFitHeight);
170
+ (0, _react.useEffect)(function () {
171
+ var scrollableElement = popupsScrollableElement || (0, _ui.findOverflowScrollParent)(anchorElement);
172
+ getFitHeight();
173
+ window.addEventListener('resize', getFitHeightDebounced);
174
+
175
+ if (scrollableElement) {
176
+ scrollableElement.addEventListener('scroll', getFitHeightDebounced);
177
+ }
178
+
179
+ return function () {
180
+ window.removeEventListener('resize', getFitHeightDebounced);
181
+
182
+ if (scrollableElement) {
183
+ scrollableElement.removeEventListener('scroll', getFitHeightDebounced);
184
+ }
185
+ };
186
+ }, [anchorElement, popupsScrollableElement, getFitHeightDebounced, getFitHeight]);
118
187
  return (0, _react2.jsx)(_ui.Popup, {
119
188
  zIndex: _editorSharedStyles.akEditorFloatingDialogZIndex,
120
189
  target: anchorElement,
121
190
  mountTo: popupsMountPoint,
122
191
  boundariesElement: popupsBoundariesElement,
123
192
  scrollableElement: popupsScrollableElement,
124
- fitHeight: 300,
193
+ fitHeight: fitHeight,
125
194
  fitWidth: 340,
126
195
  offset: OFFSET
127
196
  }, (0, _react2.jsx)("div", {
@@ -135,7 +204,8 @@ var TypeAheadPopup = /*#__PURE__*/_react.default.memo(function (props) {
135
204
  items: items,
136
205
  selectedIndex: selectedIndex,
137
206
  onItemHover: setSelectedItem,
138
- onItemClick: onItemInsert
207
+ onItemClick: onItemInsert,
208
+ fitHeight: fitHeight
139
209
  })));
140
210
  });
141
211
 
@@ -22,7 +22,7 @@ var UnsupportedSharedCssClassName = {
22
22
  INLINE_CONTAINER: 'unsupportedInlineView-content-wrap'
23
23
  };
24
24
  exports.UnsupportedSharedCssClassName = UnsupportedSharedCssClassName;
25
- var inlineUnsupportedSelector = ".".concat(UnsupportedSharedCssClassName.INLINE_CONTAINER, " > span:nth-child(2)");
25
+ var inlineUnsupportedSelector = ".".concat(UnsupportedSharedCssClassName.INLINE_CONTAINER, " > span:nth-of-type(2)");
26
26
  var blockUnsupportedSelector = ".".concat(UnsupportedSharedCssClassName.BLOCK_CONTAINER, " > div");
27
27
  var unsupportedStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", ", ", " {\n cursor: pointer;\n }\n\n .", "", ",\n .", "", " {\n ", "\n }\n\n .danger {\n .", "", ",\n .", "", " {\n border: ", "px solid\n ", ";\n background-color: ", ";\n }\n }\n"])), blockUnsupportedSelector, inlineUnsupportedSelector, _editorSharedStyles.akEditorSelectedNodeClassName, blockUnsupportedSelector, _editorSharedStyles.akEditorSelectedNodeClassName, inlineUnsupportedSelector, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Background, _editorSharedStyles.SelectionStyle.Border]), _editorSharedStyles.akEditorSelectedNodeClassName, blockUnsupportedSelector, _editorSharedStyles.akEditorSelectedNodeClassName, inlineUnsupportedSelector, _editorSharedStyles.akEditorSelectedBorderSize, (0, _tokens.token)('color.border.danger', _editorSharedStyles.akEditorDeleteBorder), (0, _tokens.token)('color.blanket.danger', _editorSharedStyles.akEditorDeleteBackgroundWithOpacity));
28
28
  exports.unsupportedStyles = unsupportedStyles;
@@ -15,7 +15,9 @@ var _constants = require("@atlaskit/theme/constants");
15
15
 
16
16
  var _colors = require("@atlaskit/theme/colors");
17
17
 
18
+ var _tokens = require("@atlaskit/tokens");
19
+
18
20
  var _templateObject;
19
21
 
20
- var dropdown = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n background: white;\n border-radius: ", "px;\n box-shadow: 0 4px 8px -2px ", ", 0 0 1px ", ";\n box-sizing: border-box;\n padding: 4px 0;\n"])), (0, _constants.borderRadius)(), _colors.N60A, _colors.N60A);
22
+ var dropdown = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n background: ", ";\n border-radius: ", "px;\n box-shadow: ", ";\n box-sizing: border-box;\n padding: 4px 0;\n"])), (0, _tokens.token)('elevation.surface.overlay', 'white'), (0, _constants.borderRadius)(), (0, _tokens.token)('elevation.shadow.overlay', "0 4px 8px -2px ".concat(_colors.N60A, ", 0 0 1px ").concat(_colors.N60A)));
21
23
  exports.dropdown = dropdown;
@@ -13,7 +13,9 @@ var _react = require("@emotion/react");
13
13
 
14
14
  var _colors = require("@atlaskit/theme/colors");
15
15
 
16
+ var _tokens = require("@atlaskit/tokens");
17
+
16
18
  var _templateObject;
17
19
 
18
- var dropdownItem = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n cursor: pointer;\n text-decoration: none;\n padding: 8px 32px 8px 12px;\n color: ", ";\n > span {\n display: flex;\n margin-right: 8px;\n }\n &:hover {\n background-color: ", ";\n }\n"])), _colors.N800, _colors.N20);
20
+ var dropdownItem = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n cursor: pointer;\n text-decoration: none;\n padding: 8px 32px 8px 12px;\n color: ", ";\n > span {\n display: flex;\n margin-right: 8px;\n }\n &:hover {\n background-color: ", ";\n }\n"])), (0, _tokens.token)('color.text', _colors.N800), (0, _tokens.token)('color.background.neutral.subtle.hovered', _colors.N20));
19
21
  exports.dropdownItem = dropdownItem;
@@ -105,7 +105,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
105
105
  popupsScrollableElement: popupsScrollableElement,
106
106
  containerElement: _this.containerElement,
107
107
  disabled: !!disabled,
108
- dispatchAnalyticsEvent: dispatchAnalyticsEvent
108
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
109
+ wrapperElement: _this.containerElement
109
110
  }), editorDOMElement)));
110
111
  });
111
112
  return _this;
@@ -35,6 +35,8 @@ var _constants = require("@atlaskit/theme/constants");
35
35
 
36
36
  var _colors = require("@atlaskit/theme/colors");
37
37
 
38
+ var _tokens = require("@atlaskit/tokens");
39
+
38
40
  var _Toolbar = _interopRequireDefault(require("../../Toolbar"));
39
41
 
40
42
  var _PluginSlot = _interopRequireDefault(require("../../PluginSlot"));
@@ -77,7 +79,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
77
79
 
78
80
  var CommentEditorMargin = 14;
79
81
  var CommentEditorSmallerMargin = 8;
80
- var commentEditorStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n\n .less-margin .ProseMirror {\n margin: 12px ", "px ", "px;\n }\n\n min-width: 272px;\n /* Border + Toolbar + Footer + (Paragraph + ((Parahraph + Margin) * (DefaultLines - 1)) */\n /* calc(2px + 40px + 24px + ( 20px + (32px * 2))) */\n\n height: auto;\n background-color: white;\n border: 1px solid ", ";\n box-sizing: border-box;\n border-radius: ", "px;\n\n max-width: inherit;\n word-wrap: break-word;\n"])), CommentEditorSmallerMargin, CommentEditorSmallerMargin, _colors.N40, (0, _constants.borderRadius)());
82
+ var commentEditorStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n\n .less-margin .ProseMirror {\n margin: 12px ", "px ", "px;\n }\n\n min-width: 272px;\n /* Border + Toolbar + Footer + (Paragraph + ((Parahraph + Margin) * (DefaultLines - 1)) */\n /* calc(2px + 40px + 24px + ( 20px + (32px * 2))) */\n\n height: auto;\n background-color: ", ";\n border: 1px solid ", ";\n box-sizing: border-box;\n border-radius: ", "px;\n\n max-width: inherit;\n word-wrap: break-word;\n"])), CommentEditorSmallerMargin, CommentEditorSmallerMargin, (0, _tokens.token)('color.background.input', 'white'), (0, _tokens.token)('color.border', _colors.N40), (0, _constants.borderRadius)());
81
83
  var ContentArea = (0, _ContentStyles.createEditorContentStyle)((0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n flex-grow: 1;\n overflow-x: hidden;\n overflow-y: auto;\n line-height: 24px;\n\n /** Hack for Bitbucket to ensure entire editorView gets drop event; see ED-3294 **/\n /** Hack for tables controlls. Otherwise marging collapse and controlls are misplaced. **/\n .ProseMirror {\n margin: 12px ", "px ", "px;\n }\n\n .gridParent {\n margin-left: ", "px;\n margin-right: ", "px;\n width: calc(100% + ", "px);\n }\n\n padding: ", "px;\n\n ", ";\n"])), CommentEditorMargin, CommentEditorMargin, CommentEditorMargin - _grid.GRID_GUTTER, CommentEditorMargin - _grid.GRID_GUTTER, CommentEditorMargin - _grid.GRID_GUTTER, _Toolbar2.TableControlsPadding, _commonStyles.tableCommentEditorStyles));
82
84
  ContentArea.displayName = 'ContentArea';
83
85
  var secondaryToolbarStyle = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n box-sizing: border-box;\n justify-content: flex-end;\n align-items: center;\n display: flex;\n padding: 12px 1px;\n"])));
@@ -99,6 +101,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
99
101
  _this = _super.call.apply(_super, [this].concat(args));
100
102
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "appearance", 'comment');
101
103
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "containerElement", null);
104
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "wrapperElement", null);
102
105
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleSave", function () {
103
106
  if (_this.props.editorView && _this.props.onSave) {
104
107
  _this.props.onSave(_this.props.editorView);
@@ -141,7 +144,10 @@ var Editor = /*#__PURE__*/function (_React$Component) {
141
144
  animate: maxContentSizeReached
142
145
  }, (0, _react2.jsx)("div", {
143
146
  css: [commentEditorStyle, (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n min-height: ", "px;\n "])), minHeight)],
144
- className: "akEditor"
147
+ className: "akEditor",
148
+ ref: function ref(_ref4) {
149
+ return _this.wrapperElement = _ref4;
150
+ }
145
151
  }, (0, _react2.jsx)(_Toolbar2.MainToolbar, {
146
152
  useStickyToolbar: useStickyToolbar
147
153
  }, (0, _react2.jsx)(_Toolbar.default, {
@@ -183,7 +189,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
183
189
  popupsBoundariesElement: popupsBoundariesElement,
184
190
  popupsScrollableElement: popupsScrollableElement,
185
191
  containerElement: _this.containerElement,
186
- disabled: !!disabled
192
+ disabled: !!disabled,
193
+ wrapperElement: _this.wrapperElement
187
194
  }), editorDOMElement);
188
195
  })), (0, _react2.jsx)(_WidthEmitter.default, {
189
196
  editorView: editorView
@@ -21,6 +21,8 @@ var _constants = require("@atlaskit/theme/constants");
21
21
 
22
22
  var _colors = require("@atlaskit/theme/colors");
23
23
 
24
+ var _tokens = require("@atlaskit/tokens");
25
+
24
26
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
25
27
 
26
28
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
@@ -31,8 +33,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
31
33
 
32
34
  var TableControlsPadding = 20;
33
35
  exports.TableControlsPadding = TableControlsPadding;
34
- var mainToolbarWrapperStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n align-items: center;\n padding: ", "px ", "px 0;\n display: flex;\n height: auto;\n background-color: white;\n box-shadow: none;\n padding-left: ", "px;\n\n & > div > *:first-child {\n margin-left: 0;\n }\n\n .block-type-btn {\n padding-left: 0;\n }\n"])), (0, _constants.gridSize)(), (0, _constants.gridSize)(), TableControlsPadding);
35
- var stickyToolbarWrapperStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n /* stylelint-disable declaration-block-no-duplicate-properties */\n position: relative;\n position: sticky;\n /* stylelint-enable declaration-block-no-duplicate-properties */\n padding-bottom: ", "px;\n z-index: ", ";\n transition: box-shadow ease-in-out 0.2s;\n &.show-keyline {\n box-shadow: 0 ", "px 0 0 ", ";\n }\n"])), (0, _constants.gridSize)(), _editorSharedStyles.akEditorGridLineZIndex + _editorSharedStyles.akEditorMenuZIndex, _editorSharedStyles.akEditorToolbarKeylineHeight, _colors.N30);
36
+ var mainToolbarWrapperStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n align-items: center;\n padding: ", "px ", "px 0;\n display: flex;\n height: auto;\n background-color: ", ";\n box-shadow: none;\n padding-left: ", "px;\n\n & > div > *:first-child {\n margin-left: 0;\n }\n\n .block-type-btn {\n padding-left: 0;\n }\n"])), (0, _constants.gridSize)(), (0, _constants.gridSize)(), (0, _tokens.token)('elevation.surface', 'white'), TableControlsPadding);
37
+ var stickyToolbarWrapperStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n /* stylelint-disable declaration-block-no-duplicate-properties */\n position: relative;\n position: sticky;\n /* stylelint-enable declaration-block-no-duplicate-properties */\n padding-bottom: ", "px;\n z-index: ", ";\n transition: box-shadow ease-in-out 0.2s;\n &.show-keyline {\n box-shadow: 0 ", "px 0 0\n ", ";\n }\n"])), (0, _constants.gridSize)(), _editorSharedStyles.akEditorGridLineZIndex + _editorSharedStyles.akEditorMenuZIndex, _editorSharedStyles.akEditorToolbarKeylineHeight, (0, _tokens.token)('color.border', _colors.N30));
36
38
 
37
39
  var StickyToolbar = function StickyToolbar(props) {
38
40
  var _useState = (0, _react.useState)(0),
@@ -62,6 +62,7 @@ var FullPageEditor = /*#__PURE__*/function (_React$Component) {
62
62
  showKeyline: false
63
63
  });
64
64
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "scrollContainer", null);
65
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "wrapperElementRef", /*#__PURE__*/_react.default.createRef());
65
66
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "contentAreaRef", function (contentArea) {
66
67
  _this.contentArea = contentArea;
67
68
  });
@@ -123,7 +124,8 @@ var FullPageEditor = /*#__PURE__*/function (_React$Component) {
123
124
  var featureFlags = (_props$editorView = props.editorView) !== null && _props$editorView !== void 0 && _props$editorView.state ? (0, _featureFlagsContext.getFeatureFlags)(props.editorView.state) : undefined;
124
125
  return (0, _react2.jsx)(_context.ContextPanelWidthProvider, null, (0, _react2.jsx)("div", {
125
126
  css: _StyledComponents.fullPageEditorWrapper,
126
- className: "akEditor"
127
+ className: "akEditor",
128
+ ref: this.wrapperElementRef
127
129
  }, (0, _react2.jsx)(_FullPageToolbar.FullPageToolbar, {
128
130
  appearance: props.appearance,
129
131
  beforeIcon: props.primaryToolbarIconBefore,
@@ -162,7 +164,8 @@ var FullPageEditor = /*#__PURE__*/function (_React$Component) {
162
164
  popupsScrollableElement: props.popupsScrollableElement,
163
165
  providerFactory: props.providerFactory,
164
166
  scrollContainer: this.scrollContainer,
165
- scrollContainerRef: this.scrollContainerRef
167
+ scrollContainerRef: this.scrollContainerRef,
168
+ wrapperElement: this.wrapperElementRef.current
166
169
  })));
167
170
  }
168
171
  }]);
@@ -73,7 +73,8 @@ var Content = /*#__PURE__*/_react2.default.memo(function (props) {
73
73
  popupsScrollableElement: props.popupsScrollableElement,
74
74
  disabled: !!props.disabled,
75
75
  containerElement: props.scrollContainer,
76
- dispatchAnalyticsEvent: props.dispatchAnalyticsEvent
76
+ dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
77
+ wrapperElement: props.wrapperElement
77
78
  }), props.editorDOMElement)))), (0, _react.jsx)("div", {
78
79
  css: _StyledComponents.sidebarArea
79
80
  }, props.contextPanel || (0, _react.jsx)(_ContextPanel.default, {
@@ -37,7 +37,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
37
37
 
38
38
  /** @jsx jsx */
39
39
  var EditorToolbar = /*#__PURE__*/_react.default.memo(function (props) {
40
- var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _props$featureFlags4, _props$featureFlags5;
40
+ var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _props$featureFlags5, _props$featureFlags6;
41
41
 
42
42
  var _useState = (0, _react.useState)(false),
43
43
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -61,19 +61,20 @@ var EditorToolbar = /*#__PURE__*/_react.default.memo(function (props) {
61
61
  disabled: props.disabled,
62
62
  dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
63
63
  containerElement: props.containerElement,
64
- hasMinWidth: props.hasMinWidth
64
+ hasMinWidth: props.hasMinWidth,
65
+ twoLineEditorToolbar: !!((_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.twoLineEditorToolbar)
65
66
  }));
66
67
  var customToolbar = (0, _react2.jsx)("div", {
67
68
  css: _MainToolbar.customToolbarWrapperStyle
68
- }, (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.twoLineEditorToolbar && !!props.customPrimaryToolbarComponents && 'before' in props.customPrimaryToolbarComponents ? (0, _react2.jsx)(_BeforePrimaryToolbarWrapper.BeforePrimaryToolbarWrapper, {
69
+ }, (_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.twoLineEditorToolbar && !!props.customPrimaryToolbarComponents && 'before' in props.customPrimaryToolbarComponents ? (0, _react2.jsx)(_BeforePrimaryToolbarWrapper.BeforePrimaryToolbarWrapper, {
69
70
  beforePrimaryToolbarComponents: props.customPrimaryToolbarComponents.before
70
- }) : null, (props === null || props === void 0 ? void 0 : (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.showAvatarGroupAsPlugin) === true && !((_props$featureFlags3 = props.featureFlags) !== null && _props$featureFlags3 !== void 0 && _props$featureFlags3.twoLineEditorToolbar) ? null : (0, _react2.jsx)(_ui.default, {
71
+ }) : null, (props === null || props === void 0 ? void 0 : (_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.showAvatarGroupAsPlugin) === true && !((_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.twoLineEditorToolbar) ? null : (0, _react2.jsx)(_ui.default, {
71
72
  editorView: props.editorView,
72
73
  eventDispatcher: props.eventDispatcher,
73
74
  inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
74
75
  inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
75
76
  isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected
76
- }), (_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.findReplace && (_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.twoLineEditorToolbar ? (0, _react2.jsx)(_FindReplaceToolbarButtonWithState.default, {
77
+ }), (_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.findReplace && (_props$featureFlags6 = props.featureFlags) !== null && _props$featureFlags6 !== void 0 && _props$featureFlags6.twoLineEditorToolbar ? (0, _react2.jsx)(_FindReplaceToolbarButtonWithState.default, {
77
78
  popupsBoundariesElement: props.popupsBoundariesElement,
78
79
  popupsMountPoint: props.popupsMountPoint,
79
80
  popupsScrollableElement: props.popupsScrollableElement,
@@ -82,9 +83,9 @@ var EditorToolbar = /*#__PURE__*/_react.default.memo(function (props) {
82
83
  dispatchAnalyticsEvent: props.dispatchAnalyticsEvent
83
84
  }) : null, !!props.customPrimaryToolbarComponents && 'after' in props.customPrimaryToolbarComponents ? props.customPrimaryToolbarComponents.after : props.customPrimaryToolbarComponents);
84
85
  (0, _react.useEffect)(function () {
85
- var _props$featureFlags6;
86
+ var _props$featureFlags7;
86
87
 
87
- if ((_props$featureFlags6 = props.featureFlags) !== null && _props$featureFlags6 !== void 0 && _props$featureFlags6.twoLineEditorToolbar) {
88
+ if ((_props$featureFlags7 = props.featureFlags) !== null && _props$featureFlags7 !== void 0 && _props$featureFlags7.twoLineEditorToolbar) {
88
89
  var updateOnResize = function updateOnResize() {
89
90
  setShouldSplitToolbar(window.innerWidth <= _MainToolbar.MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT);
90
91
  };
@@ -97,18 +98,18 @@ var EditorToolbar = /*#__PURE__*/_react.default.memo(function (props) {
97
98
  }
98
99
  });
99
100
  return (0, _react2.jsx)(_context.ContextPanelConsumer, null, function (_ref) {
100
- var _props$featureFlags7, _props$featureFlags8, _props$featureFlags9;
101
+ var _props$featureFlags8, _props$featureFlags9, _props$featureFlags10;
101
102
 
102
103
  var contextPanelWidth = _ref.width;
103
104
  return (0, _react2.jsx)("div", {
104
- css: (0, _MainToolbar.mainToolbarStyle)(props.showKeyline || contextPanelWidth > 0, !!((_props$featureFlags7 = props.featureFlags) !== null && _props$featureFlags7 !== void 0 && _props$featureFlags7.twoLineEditorToolbar)),
105
+ css: (0, _MainToolbar.mainToolbarStyle)(props.showKeyline || contextPanelWidth > 0, !!((_props$featureFlags8 = props.featureFlags) !== null && _props$featureFlags8 !== void 0 && _props$featureFlags8.twoLineEditorToolbar)),
105
106
  "data-testid": "ak-editor-main-toolbar"
106
107
  }, (0, _react2.jsx)("div", {
107
- css: (0, _MainToolbar.mainToolbarFirstChildStyle)(!!((_props$featureFlags8 = props.featureFlags) !== null && _props$featureFlags8 !== void 0 && _props$featureFlags8.twoLineEditorToolbar)),
108
+ css: (0, _MainToolbar.mainToolbarFirstChildStyle)(!!((_props$featureFlags9 = props.featureFlags) !== null && _props$featureFlags9 !== void 0 && _props$featureFlags9.twoLineEditorToolbar)),
108
109
  role: "region",
109
110
  "aria-label": props.intl.formatMessage(_messages.default.toolbarLabel)
110
111
  }, shouldSplitToolbar ? customToolbar : nonCustomToolbar), (0, _react2.jsx)("div", {
111
- css: (0, _MainToolbar.mainToolbarSecondChildStyle)(!!((_props$featureFlags9 = props.featureFlags) !== null && _props$featureFlags9 !== void 0 && _props$featureFlags9.twoLineEditorToolbar)),
112
+ css: (0, _MainToolbar.mainToolbarSecondChildStyle)(!!((_props$featureFlags10 = props.featureFlags) !== null && _props$featureFlags10 !== void 0 && _props$featureFlags10.twoLineEditorToolbar)),
112
113
  "data-testid": 'avatar-group-outside-plugin',
113
114
  role: "region",
114
115
  "aria-label": props.intl.formatMessage(_messages.default.pageActionsLabel)
@@ -13,6 +13,8 @@ var _react = require("@emotion/react");
13
13
 
14
14
  var _colors = require("@atlaskit/theme/colors");
15
15
 
16
+ var _tokens = require("@atlaskit/tokens");
17
+
16
18
  var _constants = require("@atlaskit/theme/constants");
17
19
 
18
20
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
@@ -21,10 +23,11 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
21
23
 
22
24
  var MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 868;
23
25
  exports.MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT;
24
- var toolbarLineHeight = 56;
25
- var mainToolbarWithKeyline = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n box-shadow: 0 ", "px 0 0 ", ";\n"])), _editorSharedStyles.akEditorToolbarKeylineHeight, _colors.N30);
26
+ var toolbarLineHeight = 56; // box-shadow is overriden by the mainToolbar
27
+
28
+ var mainToolbarWithKeyline = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n box-shadow: 0 ", "px 0 0\n ", ";\n"])), _editorSharedStyles.akEditorToolbarKeylineHeight, (0, _tokens.token)('color.border', _colors.N30));
26
29
  var mainToolbarTwoLineStyle = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n @media (max-width: ", "px) {\n flex-wrap: wrap;\n height: calc(", "px * 2);\n }\n"])), MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, toolbarLineHeight);
27
- var mainToolbar = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n align-items: center;\n box-shadow: none;\n transition: box-shadow 200ms ", ";\n z-index: ", ";\n display: flex;\n height: ", "px;\n flex-shrink: 0;\n background-color: white;\n\n & object {\n height: 0 !important;\n }\n\n @media (max-width: ", "px) {\n display: grid;\n height: calc(", "px * 2);\n }\n"])), _editorSharedStyles.akEditorSwoopCubicBezier, _editorSharedStyles.akEditorMenuZIndex, toolbarLineHeight, _editorSharedStyles.akEditorMobileMaxWidth, toolbarLineHeight);
30
+ var mainToolbar = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n align-items: center;\n box-shadow: none;\n transition: box-shadow 200ms ", ";\n z-index: ", ";\n display: flex;\n height: ", "px;\n flex-shrink: 0;\n // TODO: https://product-fabric.atlassian.net/browse/DSP-4456\n background-color: ", ";\n\n & object {\n height: 0 !important;\n }\n\n @media (max-width: ", "px) {\n display: grid;\n height: calc(", "px * 2);\n }\n"])), _editorSharedStyles.akEditorSwoopCubicBezier, _editorSharedStyles.akEditorMenuZIndex, toolbarLineHeight, (0, _tokens.token)('elevation.surface', 'white'), _editorSharedStyles.akEditorMobileMaxWidth, toolbarLineHeight);
28
31
 
29
32
  var mainToolbarStyle = function mainToolbarStyle(showKeyline, twoLineEditorToolbar) {
30
33
  return [mainToolbar, showKeyline && mainToolbarWithKeyline, twoLineEditorToolbar && mainToolbarTwoLineStyle];
@@ -21,5 +21,5 @@ var _tokens = require("@atlaskit/tokens");
21
21
 
22
22
  var _templateObject;
23
23
 
24
- var inputStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* Normal .className gets overridden by input[type=text] hence this hack to produce input.className */\n input& {\n background-color: white;\n border: 1px solid ", ";\n border-radius: ", "px;\n box-sizing: border-box;\n height: 40px;\n padding-left: 20px;\n padding-top: 12px;\n padding-bottom: 12px;\n font-size: ", ";\n width: 100%;\n font-weight: 400;\n line-height: 1.42857142857143;\n letter-spacing: -0.005em;\n color: ", ";\n\n &:hover {\n border-color: ", ";\n cursor: text;\n }\n }\n"])), (0, _tokens.token)('color.border.input', _editorSharedStyles.akEditorSubtleAccent), (0, _constants.borderRadius)(), (0, _editorSharedStyles.relativeFontSizeToBase16)(14), _colors.N300, _colors.N50);
24
+ var inputStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* Normal .className gets overridden by input[type=text] hence this hack to produce input.className */\n input& {\n background-color: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n box-sizing: border-box;\n height: 40px;\n padding-left: 20px;\n padding-top: 12px;\n padding-bottom: 12px;\n font-size: ", ";\n width: 100%;\n font-weight: 400;\n line-height: 1.42857142857143;\n letter-spacing: -0.005em;\n color: ", ";\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n cursor: text;\n }\n }\n"])), (0, _tokens.token)('color.background.input', 'white'), (0, _tokens.token)('color.border.input', _editorSharedStyles.akEditorSubtleAccent), (0, _constants.borderRadius)(), (0, _editorSharedStyles.relativeFontSizeToBase16)(14), (0, _tokens.token)('color.text.subtlest', _colors.N300), (0, _tokens.token)('color.background.input.hovered', 'white'), (0, _tokens.token)('color.border.input', _colors.N50));
25
25
  exports.inputStyle = inputStyle;
@@ -237,44 +237,51 @@ var ConfigPanel = /*#__PURE__*/function (_React$Component) {
237
237
  });
238
238
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleSubmit", /*#__PURE__*/function () {
239
239
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(formData) {
240
- var _this$props, fields, extensionManifest, onChange, serializedData;
240
+ var _this$props, fields, extensionManifest, onChange, autoSaveReject, serializedData;
241
241
 
242
242
  return _regenerator.default.wrap(function _callee$(_context) {
243
243
  while (1) {
244
244
  switch (_context.prev = _context.next) {
245
245
  case 0:
246
- _this$props = _this.props, fields = _this$props.fields, extensionManifest = _this$props.extensionManifest, onChange = _this$props.onChange;
246
+ _this$props = _this.props, fields = _this$props.fields, extensionManifest = _this$props.extensionManifest, onChange = _this$props.onChange, autoSaveReject = _this$props.autoSaveReject;
247
247
 
248
248
  if (!(!extensionManifest || !fields)) {
249
- _context.next = 3;
249
+ _context.next = 4;
250
250
  break;
251
251
  }
252
252
 
253
+ if (!extensionManifest) {
254
+ autoSaveReject === null || autoSaveReject === void 0 ? void 0 : autoSaveReject(new Error('Extension manifest not loaded'));
255
+ } else if (!fields) {
256
+ autoSaveReject === null || autoSaveReject === void 0 ? void 0 : autoSaveReject(new Error('Config fields not loaded'));
257
+ }
258
+
253
259
  return _context.abrupt("return");
254
260
 
255
- case 3:
256
- _context.prev = 3;
257
- _context.next = 6;
261
+ case 4:
262
+ _context.prev = 4;
263
+ _context.next = 7;
258
264
  return (0, _transformers.serialize)(extensionManifest, _this.backfillTabFormData(fields, formData, _this.state.currentParameters), fields);
259
265
 
260
- case 6:
266
+ case 7:
261
267
  serializedData = _context.sent;
262
268
  onChange(serializedData);
263
- _context.next = 13;
269
+ _context.next = 15;
264
270
  break;
265
271
 
266
- case 10:
267
- _context.prev = 10;
268
- _context.t0 = _context["catch"](3);
269
- // eslint-disable-next-line no-console
272
+ case 11:
273
+ _context.prev = 11;
274
+ _context.t0 = _context["catch"](4);
275
+ autoSaveReject === null || autoSaveReject === void 0 ? void 0 : autoSaveReject(_context.t0); // eslint-disable-next-line no-console
276
+
270
277
  console.error("Error serializing parameters", _context.t0);
271
278
 
272
- case 13:
279
+ case 15:
273
280
  case "end":
274
281
  return _context.stop();
275
282
  }
276
283
  }
277
- }, _callee, null, [[3, 10]]);
284
+ }, _callee, null, [[4, 11]]);
278
285
  }));
279
286
 
280
287
  return function (_x) {
@@ -99,6 +99,7 @@ function FieldsLoader(_ref) {
99
99
  parameters = _ref$parameters === void 0 ? defaultEmptyObject : _ref$parameters,
100
100
  autoSave = _ref.autoSave,
101
101
  autoSaveTrigger = _ref.autoSaveTrigger,
102
+ autoSaveReject = _ref.autoSaveReject,
102
103
  closeOnEsc = _ref.closeOnEsc,
103
104
  showHeader = _ref.showHeader,
104
105
  onChange = _ref.onChange,
@@ -128,6 +129,7 @@ function FieldsLoader(_ref) {
128
129
  parameters: parameters,
129
130
  autoSave: autoSave,
130
131
  autoSaveTrigger: autoSaveTrigger,
132
+ autoSaveReject: autoSaveReject,
131
133
  closeOnEsc: closeOnEsc,
132
134
  showHeader: showHeader,
133
135
  onChange: onChange,
@@ -23,6 +23,8 @@ var _checkbox = require("@atlaskit/checkbox");
23
23
 
24
24
  var _form = require("@atlaskit/form");
25
25
 
26
+ var _tokens = require("@atlaskit/tokens");
27
+
26
28
  var _types = require("../types");
27
29
 
28
30
  var _FieldMessages = _interopRequireDefault(require("../FieldMessages"));
@@ -37,7 +39,7 @@ function _validate(value, isRequired) {
37
39
  }
38
40
  }
39
41
 
40
- var requiredIndicator = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: #bf2600;\n"])));
42
+ var requiredIndicator = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), (0, _tokens.token)('color.text.danger', '#bf2600'));
41
43
 
42
44
  function CheckboxGroupInner(_ref) {
43
45
  var label = _ref.label,
@@ -21,6 +21,8 @@ var _reactIntlNext = require("react-intl-next");
21
21
 
22
22
  var _colors = require("@atlaskit/theme/colors");
23
23
 
24
+ var _tokens = require("@atlaskit/tokens");
25
+
24
26
  var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
25
27
 
26
28
  var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-right"));
@@ -37,7 +39,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
37
39
 
38
40
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
41
 
40
- var expandContainer = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border-bottom: 1px solid ", ";\n"])), _colors.N40);
42
+ var expandContainer = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border-bottom: 1px solid ", ";\n"])), (0, _tokens.token)('color.border', _colors.N40));
41
43
  exports.expandContainer = expandContainer;
42
44
  var expandControl = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n height: ", "px;\n justify-content: center;\n padding-right: ", "px;\n"])), (0, _constants.gridSize)() * 6, (0, _constants.gridSize)());
43
45
  exports.expandControl = expandControl;
@@ -53,6 +53,8 @@ var _constants = require("@atlaskit/theme/constants");
53
53
 
54
54
  var _colors = require("@atlaskit/theme/colors");
55
55
 
56
+ var _tokens = require("@atlaskit/tokens");
57
+
56
58
  var _templateObject, _templateObject2;
57
59
 
58
60
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -67,7 +69,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
67
69
 
68
70
  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; } }
69
71
 
70
- var actionsWrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border-top: 1px solid ", ";\n margin-top: ", "px;\n padding-top: ", "px;\n"])), _colors.N40A, (0, _constants.gridSize)() * 2, (0, _constants.gridSize)() * 2);
72
+ var actionsWrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border-top: 1px solid ", ";\n margin-top: ", "px;\n padding-top: ", "px;\n"])), (0, _tokens.token)('color.border', _colors.N40A), (0, _constants.gridSize)() * 2, (0, _constants.gridSize)() * 2);
71
73
 
72
74
  var populateFromParameters = function populateFromParameters(parameters, fields) {
73
75
  if (Object.keys(parameters).length) {
@@ -13,7 +13,9 @@ var _react = require("@emotion/react");
13
13
 
14
14
  var _colors = require("@atlaskit/theme/colors");
15
15
 
16
+ var _tokens = require("@atlaskit/tokens");
17
+
16
18
  var _templateObject;
17
19
 
18
- var requiredIndicator = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), _colors.R500);
20
+ var requiredIndicator = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), (0, _tokens.token)('color.text.danger', _colors.R500));
19
21
  exports.requiredIndicator = requiredIndicator;