@atlaskit/editor-core 172.0.4 → 172.1.1

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 (204) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/cjs/create-editor/ReactEditorView.js +11 -2
  3. package/dist/cjs/create-editor/ReactEditorViewContext.js +15 -0
  4. package/dist/cjs/create-editor/create-plugins-list.js +2 -1
  5. package/dist/cjs/editor.js +7 -1
  6. package/dist/cjs/labs/next/mobile.js +5 -3
  7. package/dist/cjs/messages.js +5 -0
  8. package/dist/cjs/plugins/analytics/types/enums.js +1 -0
  9. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +1 -1
  10. package/dist/cjs/plugins/card/nodeviews/inlineCard.js +8 -0
  11. package/dist/cjs/plugins/card/pm-plugins/doc.js +2 -26
  12. package/dist/cjs/plugins/card/toolbar.js +118 -86
  13. package/dist/cjs/plugins/code-block/nodeviews/code-block.js +9 -2
  14. package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +37 -1
  15. package/dist/cjs/plugins/code-block/toolbar.js +3 -1
  16. package/dist/cjs/plugins/code-block/ui/class-names.js +2 -0
  17. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +4 -3
  18. package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +3 -1
  19. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +42 -2
  20. package/dist/cjs/plugins/hyperlink/Toolbar.js +43 -8
  21. package/dist/cjs/plugins/media/commands/helpers.js +1 -8
  22. package/dist/cjs/plugins/media/index.js +1 -1
  23. package/dist/cjs/plugins/media/nodeviews/mediaNodeView/index.js +0 -10
  24. package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +2 -3
  25. package/dist/cjs/plugins/media/picker-facade.js +1 -0
  26. package/dist/cjs/plugins/media/pm-plugins/main.js +3 -13
  27. package/dist/cjs/plugins/panel/pm-plugins/keymaps.js +1 -1
  28. package/dist/cjs/plugins/paste/handlers.js +9 -20
  29. package/dist/cjs/plugins/paste/md.js +8 -2
  30. package/dist/cjs/plugins/paste/newline-md-plugin.js +67 -0
  31. package/dist/cjs/plugins/paste/paragraph-md-plugin.js +72 -0
  32. package/dist/cjs/plugins/table/commands/hover.js +4 -4
  33. package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
  34. package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
  35. package/dist/cjs/plugins/table/utils/decoration.js +53 -3
  36. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -0
  37. package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +3 -2
  38. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +78 -53
  39. package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +1 -1
  40. package/dist/cjs/ui/Addon/ClickAreaBlock/index.js +7 -2
  41. package/dist/cjs/ui/Addon/ClickAreaMobile/index.js +8 -2
  42. package/dist/cjs/ui/Appearance/Comment/Comment.js +13 -13
  43. package/dist/cjs/ui/Appearance/FullPage/FullPage.js +8 -7
  44. package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
  45. package/dist/cjs/ui/Appearance/Mobile.js +4 -2
  46. package/dist/cjs/ui/AppearanceComponents/Mobile.js +5 -4
  47. package/dist/cjs/ui/DropList/index.js +1 -1
  48. package/dist/cjs/ui/DropdownMenu/index.js +5 -5
  49. package/dist/cjs/ui/with-outer-listeners.js +105 -50
  50. package/dist/cjs/utils/deprecation-warnings.js +4 -0
  51. package/dist/cjs/utils/linking-utils.js +40 -1
  52. package/dist/cjs/version-wrapper.js +1 -1
  53. package/dist/cjs/version.json +1 -1
  54. package/dist/es2019/create-editor/ReactEditorView.js +11 -2
  55. package/dist/es2019/create-editor/ReactEditorViewContext.js +3 -0
  56. package/dist/es2019/create-editor/create-plugins-list.js +2 -1
  57. package/dist/es2019/editor.js +7 -1
  58. package/dist/es2019/labs/next/mobile.js +5 -3
  59. package/dist/es2019/messages.js +5 -0
  60. package/dist/es2019/plugins/analytics/types/enums.js +1 -0
  61. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +1 -1
  62. package/dist/es2019/plugins/card/nodeviews/inlineCard.js +10 -0
  63. package/dist/es2019/plugins/card/pm-plugins/doc.js +1 -24
  64. package/dist/es2019/plugins/card/toolbar.js +114 -86
  65. package/dist/es2019/plugins/code-block/nodeviews/code-block.js +9 -2
  66. package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +40 -2
  67. package/dist/es2019/plugins/code-block/toolbar.js +2 -1
  68. package/dist/es2019/plugins/code-block/ui/class-names.js +2 -0
  69. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +4 -3
  70. package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +3 -2
  71. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +37 -0
  72. package/dist/es2019/plugins/hyperlink/Toolbar.js +40 -9
  73. package/dist/es2019/plugins/media/commands/helpers.js +0 -2
  74. package/dist/es2019/plugins/media/index.js +1 -1
  75. package/dist/es2019/plugins/media/nodeviews/mediaNodeView/index.js +0 -7
  76. package/dist/es2019/plugins/media/nodeviews/mediaNodeView/media.js +2 -3
  77. package/dist/es2019/plugins/media/picker-facade.js +1 -0
  78. package/dist/es2019/plugins/media/pm-plugins/main.js +3 -13
  79. package/dist/es2019/plugins/panel/pm-plugins/keymaps.js +1 -1
  80. package/dist/es2019/plugins/paste/handlers.js +7 -19
  81. package/dist/es2019/plugins/paste/md.js +6 -2
  82. package/dist/es2019/plugins/paste/newline-md-plugin.js +56 -0
  83. package/dist/es2019/plugins/paste/paragraph-md-plugin.js +61 -0
  84. package/dist/es2019/plugins/table/commands/hover.js +4 -4
  85. package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
  86. package/dist/es2019/plugins/table/ui/common-styles.js +39 -2
  87. package/dist/es2019/plugins/table/utils/decoration.js +60 -24
  88. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -0
  89. package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +4 -3
  90. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +78 -59
  91. package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +2 -2
  92. package/dist/es2019/ui/Addon/ClickAreaBlock/index.js +6 -2
  93. package/dist/es2019/ui/Addon/ClickAreaMobile/index.js +7 -2
  94. package/dist/es2019/ui/Appearance/Comment/Comment.js +12 -6
  95. package/dist/es2019/ui/Appearance/FullPage/FullPage.js +7 -2
  96. package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
  97. package/dist/es2019/ui/Appearance/Mobile.js +4 -2
  98. package/dist/es2019/ui/AppearanceComponents/Mobile.js +5 -4
  99. package/dist/es2019/ui/DropList/index.js +1 -1
  100. package/dist/es2019/ui/DropdownMenu/index.js +10 -6
  101. package/dist/es2019/ui/with-outer-listeners.js +83 -33
  102. package/dist/es2019/utils/deprecation-warnings.js +4 -0
  103. package/dist/es2019/utils/linking-utils.js +37 -0
  104. package/dist/es2019/version-wrapper.js +1 -1
  105. package/dist/es2019/version.json +1 -1
  106. package/dist/esm/create-editor/ReactEditorView.js +11 -2
  107. package/dist/esm/create-editor/ReactEditorViewContext.js +3 -0
  108. package/dist/esm/create-editor/create-plugins-list.js +2 -1
  109. package/dist/esm/editor.js +7 -1
  110. package/dist/esm/labs/next/mobile.js +5 -3
  111. package/dist/esm/messages.js +5 -0
  112. package/dist/esm/plugins/analytics/types/enums.js +1 -0
  113. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +1 -1
  114. package/dist/esm/plugins/card/nodeviews/inlineCard.js +9 -0
  115. package/dist/esm/plugins/card/pm-plugins/doc.js +1 -20
  116. package/dist/esm/plugins/card/toolbar.js +108 -83
  117. package/dist/esm/plugins/code-block/nodeviews/code-block.js +9 -2
  118. package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +37 -2
  119. package/dist/esm/plugins/code-block/toolbar.js +2 -1
  120. package/dist/esm/plugins/code-block/ui/class-names.js +2 -0
  121. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +4 -3
  122. package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +3 -2
  123. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +41 -2
  124. package/dist/esm/plugins/hyperlink/Toolbar.js +43 -10
  125. package/dist/esm/plugins/media/commands/helpers.js +0 -4
  126. package/dist/esm/plugins/media/index.js +1 -1
  127. package/dist/esm/plugins/media/nodeviews/mediaNodeView/index.js +0 -8
  128. package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +2 -3
  129. package/dist/esm/plugins/media/picker-facade.js +1 -0
  130. package/dist/esm/plugins/media/pm-plugins/main.js +3 -15
  131. package/dist/esm/plugins/panel/pm-plugins/keymaps.js +1 -1
  132. package/dist/esm/plugins/paste/handlers.js +11 -22
  133. package/dist/esm/plugins/paste/md.js +6 -2
  134. package/dist/esm/plugins/paste/newline-md-plugin.js +58 -0
  135. package/dist/esm/plugins/paste/paragraph-md-plugin.js +63 -0
  136. package/dist/esm/plugins/table/commands/hover.js +4 -4
  137. package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
  138. package/dist/esm/plugins/table/ui/common-styles.js +1 -1
  139. package/dist/esm/plugins/table/utils/decoration.js +50 -3
  140. package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -0
  141. package/dist/esm/plugins/type-ahead/ui/InputQuery.js +4 -3
  142. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +77 -51
  143. package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +2 -2
  144. package/dist/esm/ui/Addon/ClickAreaBlock/index.js +7 -2
  145. package/dist/esm/ui/Addon/ClickAreaMobile/index.js +8 -2
  146. package/dist/esm/ui/Appearance/Comment/Comment.js +12 -12
  147. package/dist/esm/ui/Appearance/FullPage/FullPage.js +7 -6
  148. package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
  149. package/dist/esm/ui/Appearance/Mobile.js +4 -2
  150. package/dist/esm/ui/AppearanceComponents/Mobile.js +5 -4
  151. package/dist/esm/ui/DropList/index.js +1 -1
  152. package/dist/esm/ui/DropdownMenu/index.js +5 -5
  153. package/dist/esm/ui/with-outer-listeners.js +105 -51
  154. package/dist/esm/utils/deprecation-warnings.js +4 -0
  155. package/dist/esm/utils/linking-utils.js +37 -0
  156. package/dist/esm/version-wrapper.js +1 -1
  157. package/dist/esm/version.json +1 -1
  158. package/dist/types/create-editor/ReactEditorView.d.ts +3 -0
  159. package/dist/types/create-editor/ReactEditorViewContext.d.ts +8 -0
  160. package/dist/types/messages.d.ts +5 -0
  161. package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
  162. package/dist/types/plugins/analytics/types/events.d.ts +2 -2
  163. package/dist/types/plugins/analytics/types/link-tool-bar-events.d.ts +1 -0
  164. package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +3 -0
  165. package/dist/types/plugins/card/pm-plugins/doc.d.ts +1 -2
  166. package/dist/types/plugins/card/toolbar.d.ts +1 -0
  167. package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +1 -1
  168. package/dist/types/plugins/code-block/pm-plugins/ide-ux.d.ts +4 -1
  169. package/dist/types/plugins/code-block/ui/class-names.d.ts +2 -0
  170. package/dist/types/plugins/hyperlink/types.d.ts +1 -0
  171. package/dist/types/plugins/media/commands/helpers.d.ts +0 -1
  172. package/dist/types/plugins/media/nodeviews/mediaNodeView/index.d.ts +0 -1
  173. package/dist/types/plugins/media/nodeviews/mediaNodeView/media.d.ts +0 -1
  174. package/dist/types/plugins/media/pm-plugins/main.d.ts +0 -2
  175. package/dist/types/plugins/media/pm-plugins/types.d.ts +0 -2
  176. package/dist/types/plugins/media/ui/ResizableMediaSingle/index.d.ts +1 -1
  177. package/dist/types/plugins/paste/newline-md-plugin.d.ts +2 -0
  178. package/dist/types/plugins/paste/paragraph-md-plugin.d.ts +2 -0
  179. package/dist/types/plugins/table/utils/decoration.d.ts +1 -1
  180. package/dist/types/types/editor-appearance-component.d.ts +1 -0
  181. package/dist/types/types/feature-flags.d.ts +9 -0
  182. package/dist/types/ui/Addon/ClickAreaBlock/index.d.ts +1 -0
  183. package/dist/types/ui/Addon/ClickAreaMobile/index.d.ts +1 -0
  184. package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +1 -0
  185. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +3 -3
  186. package/dist/types/ui/Appearance/Mobile.d.ts +1 -1
  187. package/dist/types/ui/AppearanceComponents/Mobile.d.ts +2 -1
  188. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  189. package/dist/types/ui/Dropdown/index.d.ts +1 -1
  190. package/dist/types/ui/with-outer-listeners.d.ts +2 -1
  191. package/dist/types/utils/linking-utils.d.ts +1 -0
  192. package/package.json +37 -39
  193. package/dist/cjs/plugins/type-ahead/ui/DynamicHeightListItem.js +0 -77
  194. package/dist/cjs/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.js +0 -118
  195. package/dist/cjs/plugins/type-ahead/ui/hooks/use-resize-observer.js +0 -70
  196. package/dist/es2019/plugins/type-ahead/ui/DynamicHeightListItem.js +0 -51
  197. package/dist/es2019/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.js +0 -97
  198. package/dist/es2019/plugins/type-ahead/ui/hooks/use-resize-observer.js +0 -53
  199. package/dist/esm/plugins/type-ahead/ui/DynamicHeightListItem.js +0 -51
  200. package/dist/esm/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.js +0 -101
  201. package/dist/esm/plugins/type-ahead/ui/hooks/use-resize-observer.js +0 -48
  202. package/dist/types/plugins/type-ahead/ui/DynamicHeightListItem.d.ts +0 -21
  203. package/dist/types/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.d.ts +0 -25
  204. package/dist/types/plugins/type-ahead/ui/hooks/use-resize-observer.d.ts +0 -8
@@ -114,7 +114,8 @@ var CornerControls = /*#__PURE__*/function (_Component) {
114
114
  }),
115
115
  style: {
116
116
  top: this.props.stickyTop !== undefined ? "".concat(this.props.stickyTop, "px") : undefined
117
- }
117
+ },
118
+ contentEditable: false
118
119
  }, /*#__PURE__*/_react.default.createElement("button", {
119
120
  type: "button",
120
121
  className: (0, _classnames.default)(_types.TableCssClassName.CONTROLS_CORNER_BUTTON, {
@@ -38,7 +38,7 @@ var sentinelStyles = ".".concat(_types.TableCssClassName.TABLE_CONTAINER, " {\n
38
38
  var tableStyles = function tableStyles(props) {
39
39
  var _props$featureFlags;
40
40
 
41
- return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: ", " !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n td.", ", th.", " {\n position: relative;\n overflow: visible;\n }\n\n td.", " {\n background-color: ", ";\n }\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", "\n }\n\n /* Delete button */\n ", "\n /* Ends Delete button */\n\n /* sticky styles */\n .", " .", " .", ":first-of-type {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n box-shadow: 0px -", "px ", ";\n border-right: 0 none;\n /* top set by NumberColumn component */\n }\n\n .", " .", ".sticky {\n position: fixed !important;\n /* needs to be above row controls */\n z-index: ", " !important;\n background: ", ";\n\n width: ", "px;\n height: ", "px;\n }\n\n .", ".sticky .", " {\n border-bottom: 0px none;\n border-right: 0px none;\n\n height: ", "px;\n width: ", "px;\n }\n\n .", " .", " {\n z-index: 0;\n }\n\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid\n ", ";\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid ", ";\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection */\n z-index: ", ";\n\n overflow-y: visible;\n overflow-x: hidden;\n\n grid-auto-flow: column;\n\n /* background for where controls apply */\n background: ", ";\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\n z-index: ", ";\n }\n\n .", ".", "\n .", " {\n padding-bottom: ", "px;\n }\n\n tr.sticky th {\n border-bottom: ", "px solid\n ", ";\n margin-right: -1px;\n }\n\n .", " tr.sticky > th:last-child {\n border-right-width: 1px;\n }\n\n /* add left edge for first cell */\n .", " tr.sticky > th:first-of-type {\n margin-left: 0px;\n }\n\n /* add a little bit so the scroll lines up with the table */\n .", " tr.sticky::after {\n content: ' ';\n width: 1px;\n }\n\n /* To fix jumpiness caused in Chrome Browsers for sticky headers */\n .", " .sticky + tr {\n min-height: 0px;\n }\n\n /* move resize line a little in sticky bar */\n .", ".", " {\n tr.sticky\n td.", ",\n tr.sticky\n th.", " {\n .", "::after {\n right: ", "px;\n }\n }\n\n /* when selected put it back to normal -- :not selector would be nicer */\n tr.sticky\n td.", ".", ",\n tr.sticky\n th.", ".", " {\n .", "::after {\n right: ", "px;\n }\n }\n }\n\n tr.sticky\n .", ",\n tr.sticky\n .", " {\n z-index: 1;\n }\n\n .", " tr.sticky {\n padding-top: ", "px;\n }\n\n .", ".", "\n .", "\n .", ":first-of-type {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid\n ", ";\n }\n\n ", "\n ", "\n\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level */\n > * .", " .", " {\n margin-left: unset !important;\n width: 100% !important;\n }\n\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child:not(style),\n style:first-child + * {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: 1px;\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", " {\n cursor: pointer;\n }\n .", ":hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n // Fixes Chrome border clipping bug ED-15245\n background: ", ";\n\n .", " + * {\n margin-top: 0;\n }\n\n /*\n * Headings have a top margin by default, but we don't want this on the\n * first heading within table header cells.\n *\n * This specifically sets margin-top for the first heading within a header\n * cell when center/right aligned.\n */\n th.", " > .fabric-editor-block-mark {\n > h1:first-of-type,\n > h2:first-of-type,\n > h3:first-of-type,\n > h4:first-of-type,\n > h5:first-of-type,\n > h6:first-of-type {\n margin-top: 0;\n }\n }\n\n .", ", .", " {\n position: relative;\n }\n /* Give selected cells a blue overlay */\n .", "::after,\n .", "::after {\n z-index: ", ";\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n }\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n }\n th.", "::after,\n td.", "::after {\n background: ", ";\n }\n }\n .", " {\n position: absolute;\n /* top of corner control is table margin top - corner control height + 1 pixel of table border. */\n top: ", "px;\n }\n .", ".", " {\n z-index: ", ";\n }\n .", " {\n left: -", "px;\n }\n .", " {\n /*\n compensating for half of the insert column button\n that is aligned to the right edge initially on hover of the top right column control when table overflown,\n its center should be aligned with the edge\n */\n padding-right: ", "px;\n margin-right: -", "px;\n padding-bottom: ", "px;\n margin-bottom: -", "px;\n /* fixes gap cursor height */\n overflow: auto;\n position: relative;\n }\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n .ProseMirror .pm-table-cell-content-wrap ol[data-child-count='100+'] {\n padding-left: revert;\n }\n"])), _types.TableCssClassName.LAYOUT_BUTTON, (0, _tokens.token)('color.background.neutral', _colors.N20A), (0, _tokens.token)('color.icon', _colors.N300), _types.TableCssClassName.LAYOUT_BUTTON, _types.TableCssClassName.IS_RESIZING, (0, _tokens.token)('color.background.neutral.hovered', _colors.B300), (0, _tokens.token)('color.icon', 'white'), (0, _styles.tableSharedStyle)(props), (0, _uiStyles.columnControlsLineMarker)(props), _uiStyles.hoveredDeleteButton, _uiStyles.hoveredCell, _uiStyles.hoveredWarningCell, _uiStyles.resizeHandle, rangeSelectionStyles, _types.TableCssClassName.LAST_ITEM_IN_CELL, _types.TableCssClassName.TABLE_NODE_WRAPPER, _types.TableCssClassName.TABLE_CELL, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.TABLE_CELL, (0, _consts.tableCellBackgroundColor)(props), _types.TableCssClassName.CONTROLS_FLOATING_BUTTON_COLUMN, _uiStyles.insertColumnButtonWrapper, _types.TableCssClassName.CONTROLS_FLOATING_BUTTON_ROW, _uiStyles.insertRowButtonWrapper, _uiStyles.DeleteButton, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.stickyRowOffsetTop + 2, _editorSharedStyles.akEditorTableNumberColumnWidth, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.stickyRowOffsetTop, (0, _tokens.token)('elevation.surface', 'white'), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.CORNER_CONTROLS, _editorSharedStyles.akEditorSmallZIndex, (0, _tokens.token)('elevation.surface', 'white'), _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.tableToolbarSize, (0, _tokens.token)('elevation.surface', 'white'), _consts.tableToolbarSize, _types.TableCssClassName.TABLE_STICKY, (0, _tokens.token)('elevation.surface', 'green'), _consts.stickyRowOffsetTop, _consts.stickyRowZIndex, (0, _tokens.token)('elevation.surface', 'white'), (0, _tokens.token)('elevation.shadow.overflow', "0 6px 4px -4px ".concat(_colors.N40A)), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.stickyRowZIndex + 1, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.tableToolbarSize, _consts.stickyHeaderBorderBottomWidth, (0, _consts.tableBorderColor)(props), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, (_consts.resizeHandlerAreaWidth - _consts.resizeLineWidth) / 2 + 1, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, (_consts.resizeHandlerAreaWidth - _consts.resizeLineWidth) / 2, _types.TableCssClassName.HOVERED_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.WITH_CONTROLS, _consts.tableControlsSpacing, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.tableControlsSpacing + 2, _types.TableCssClassName.CORNER_CONTROLS, _consts.tableControlsSpacing - _consts.tableToolbarSize + 2, (0, _tokens.token)('elevation.surface', 'white'), (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.stickyHeadersOptimization ? sentinelStyles : '', (0, _uiStyles.OverflowShadow)(props), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.tablePadding, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _consts.tablePadding, _types.TableCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth + _consts.tablePadding - 1, _types.TableCssClassName.TABLE_LEFT_SHADOW, _types.TableCssClassName.TABLE_RIGHT_SHADOW, _types.TableCssClassName.NODEVIEW_WRAPPER, _types.TableCssClassName.NODEVIEW_WRAPPER, _types.TableCssClassName.TABLE_CONTAINER, (0, _uiStyles.columnControlsDecoration)(props), _types.TableCssClassName.CORNER_CONTROLS, _consts.tableToolbarSize + 1, cornerControlHeight, _types.TableCssClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, (0, _uiStyles.InsertMarker)(props, "\n left: -11px;\n top: 9px;\n "), _types.TableCssClassName.CORNER_CONTROLS_INSERT_COLUMN_MARKER, (0, _uiStyles.InsertMarker)(props, "\n right: -1px;\n top: -12px;\n "), _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableToolbarSize + 1, _consts.tableToolbarSize + 1, (0, _consts.tableBorderColor)(props), _consts.tableBorderRadiusSize, (0, _consts.tableToolbarColor)(props), _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableBorderSelectedColor, _consts.tableToolbarSelectedColor, _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _editorSharedStyles.akEditorTableToolbarSize + _editorSharedStyles.akEditorTableNumberColumnWidth, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.CONTROLS_BUTTON, _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableBorderSelectedColor, _consts.tableToolbarSelectedColor, _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _consts.tableBorderDeleteColor, _consts.tableToolbarDeleteColor, _types.TableCssClassName.ROW_CONTROLS, _consts.tableToolbarSize, (0, _uiStyles.InsertMarker)(props, "\n bottom: -1px;\n left: -11px;\n "), _types.TableCssClassName.ROW_CONTROLS_INNER, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _consts.tableBorderRadiusSize, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _types.TableCssClassName.CONTROLS_BUTTON, _editorSharedStyles.akEditorUnitZIndex, (0, _uiStyles.HeaderButton)(props, "\n border-bottom: 1px solid ".concat((0, _consts.tableBorderColor)(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(_consts.tableToolbarSize, "px;\n\n .").concat(_types.TableCssClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(_types.TableCssClassName.CONTROLS_BUTTON_OVERLAY, ":first-of-type {\n top: 0;\n }\n ")), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.ROW_CONTROLS, (0, _uiStyles.HeaderButtonHover)(), (0, _uiStyles.HeaderButtonDanger)(), _types.TableCssClassName.NUMBERED_COLUMN, _editorSharedStyles.akEditorTableToolbarSize - 1, _editorSharedStyles.akEditorTableToolbarSize, _editorSharedStyles.akEditorTableNumberColumnWidth + 1, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, (0, _consts.tableBorderColor)(props), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _consts.tableToolbarColor)(props), (0, _consts.tableTextColor)(props), (0, _consts.tableBorderColor)(props), (0, _consts.tableBorderColor)(props), _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.tableBorderSelectedColor, _consts.tableBorderSelectedColor, _consts.tableToolbarSelectedColor, _editorSharedStyles.akEditorUnitZIndex, (0, _tokens.token)('color.text.inverse', _colors.N0), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.tableBorderSelectedColor, _consts.tableBorderSelectedColor, _consts.tableToolbarSelectedColor, _editorSharedStyles.akEditorUnitZIndex, (0, _tokens.token)('color.text.inverse', _colors.N0), _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _consts.tableToolbarDeleteColor, _consts.tableBorderDeleteColor, (0, _tokens.token)('color.text.inverse', _colors.R500), _editorSharedStyles.akEditorUnitZIndex, _types.TableCssClassName.TABLE_NODE_WRAPPER, (0, _consts.tableBorderColor)(props), _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.SELECTED_CELL, _consts.tableBorderSelectedColor, _types.TableCssClassName.SELECTED_CELL, _consts.tableCellSelectedColor, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _consts.tableCellDeleteColor, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _styles.tableMarginTop - cornerControlHeight + 1, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _types.TableCssClassName.TABLE_LEFT_SHADOW, _editorSharedStyles.akEditorUnitZIndex, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _consts.tableToolbarSize, _types.TableCssClassName.TABLE_NODE_WRAPPER, _consts.tableInsertColumnButtonSize / 2, _consts.tableInsertColumnButtonSize / 2, _consts.tableScrollbarOffset, _consts.tableScrollbarOffset, _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.TABLE_NODE_WRAPPER, _styles2.scrollbarStyles, _types.TableCssClassName.RESIZE_CURSOR);
41
+ return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: ", " !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n td.", ", th.", " {\n position: relative;\n overflow: visible;\n }\n\n td.", " {\n background-color: ", ";\n\n // ED-15246: Trello card is visible through a border of a table border\n // This fixes a border issue caused by relative positioned table cells\n &::after {\n height: 100%;\n content: '';\n border-left: 1px solid ", ";\n border-bottom: 1px solid ", ";\n position: absolute;\n right: 0px;\n top: 0px;\n bottom: 0;\n width: 100%;\n display: inline-block;\n pointer-events: none;\n }\n }\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", "\n }\n\n /* Delete button */\n ", "\n /* Ends Delete button */\n\n /* sticky styles */\n .", " .", " .", ":first-of-type {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n box-shadow: 0px -", "px ", ";\n border-right: 0 none;\n /* top set by NumberColumn component */\n }\n\n .", " .", ".sticky {\n position: fixed !important;\n /* needs to be above row controls */\n z-index: ", " !important;\n background: ", ";\n\n width: ", "px;\n height: ", "px;\n }\n\n .", ".sticky .", " {\n border-bottom: 0px none;\n border-right: 0px none;\n\n height: ", "px;\n width: ", "px;\n }\n\n .", " .", " {\n z-index: 0;\n }\n\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid\n ", ";\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid ", ";\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection */\n z-index: ", ";\n\n overflow-y: visible;\n overflow-x: hidden;\n\n grid-auto-flow: column;\n\n /* background for where controls apply */\n background: ", ";\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\n z-index: ", ";\n }\n\n .", ".", "\n .", " {\n padding-bottom: ", "px;\n }\n\n tr.sticky th {\n border-bottom: ", "px solid\n ", ";\n margin-right: -1px;\n }\n\n .", " tr.sticky > th:last-child {\n border-right-width: 1px;\n }\n\n /* add left edge for first cell */\n .", " tr.sticky > th:first-of-type {\n margin-left: 0px;\n }\n\n /* add a little bit so the scroll lines up with the table */\n .", " tr.sticky::after {\n content: ' ';\n width: 1px;\n }\n\n /* To fix jumpiness caused in Chrome Browsers for sticky headers */\n .", " .sticky + tr {\n min-height: 0px;\n }\n\n /* move resize line a little in sticky bar */\n .", ".", " {\n tr.sticky\n td.", ",\n tr.sticky\n th.", " {\n .", "::after {\n right: ", "px;\n }\n }\n\n /* when selected put it back to normal -- :not selector would be nicer */\n tr.sticky\n td.", ".", ",\n tr.sticky\n th.", ".", " {\n .", "::after {\n right: ", "px;\n }\n }\n }\n\n tr.sticky\n .", ",\n tr.sticky\n .", " {\n z-index: 1;\n }\n\n .", " tr.sticky {\n padding-top: ", "px;\n }\n\n .", ".", "\n .", "\n .", ":first-of-type {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid\n ", ";\n }\n\n ", "\n ", "\n\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level */\n > * .", " .", " {\n margin-left: unset !important;\n width: 100% !important;\n }\n\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child:not(style),\n style:first-child + * {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: 1px;\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", " {\n cursor: pointer;\n }\n .", ":hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n\n .", " + * {\n margin-top: 0;\n }\n\n /*\n * Headings have a top margin by default, but we don't want this on the\n * first heading within table header cells.\n *\n * This specifically sets margin-top for the first heading within a header\n * cell when center/right aligned.\n */\n th.", " > .fabric-editor-block-mark {\n > h1:first-of-type,\n > h2:first-of-type,\n > h3:first-of-type,\n > h4:first-of-type,\n > h5:first-of-type,\n > h6:first-of-type {\n margin-top: 0;\n }\n }\n\n .", ", .", " {\n position: relative;\n }\n /* Give selected cells a blue overlay */\n .", "::after,\n .", "::after {\n z-index: ", ";\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n pointer-events: none;\n }\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n z-index: ", ";\n }\n th.", "::after,\n td.", "::after {\n background: ", ";\n z-index: ", ";\n }\n // ED-15246: Trello card is visible through a border of a table border\n td.", ", td.", " {\n &::after {\n height: 100%;\n width: 100%;\n border: 1px solid ", ";\n content: '';\n position: absolute;\n left: -1px;\n top: -1px;\n bottom: 0;\n z-index: ", ";\n display: inline-block;\n pointer-events: none;\n }\n &.", "::after {\n border: 1px solid ", ";\n z-index: ", ";\n }\n }\n }\n .", " {\n position: absolute;\n /* top of corner control is table margin top - corner control height + 1 pixel of table border. */\n top: ", "px;\n }\n .", ".", " {\n z-index: ", ";\n }\n .", " {\n left: -", "px;\n }\n .", " {\n /*\n compensating for half of the insert column button\n that is aligned to the right edge initially on hover of the top right column control when table overflown,\n its center should be aligned with the edge\n */\n padding-right: ", "px;\n margin-right: -", "px;\n padding-bottom: ", "px;\n margin-bottom: -", "px;\n /* fixes gap cursor height */\n overflow: auto;\n position: relative;\n }\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n .ProseMirror .pm-table-cell-content-wrap ol[data-child-count='100+'] {\n padding-left: revert;\n }\n"])), _types.TableCssClassName.LAYOUT_BUTTON, (0, _tokens.token)('color.background.neutral', _colors.N20A), (0, _tokens.token)('color.icon', _colors.N300), _types.TableCssClassName.LAYOUT_BUTTON, _types.TableCssClassName.IS_RESIZING, (0, _tokens.token)('color.background.neutral.hovered', _colors.B300), (0, _tokens.token)('color.icon', 'white'), (0, _styles.tableSharedStyle)(props), (0, _uiStyles.columnControlsLineMarker)(props), _uiStyles.hoveredDeleteButton, _uiStyles.hoveredCell, _uiStyles.hoveredWarningCell, _uiStyles.resizeHandle, rangeSelectionStyles, _types.TableCssClassName.LAST_ITEM_IN_CELL, _types.TableCssClassName.TABLE_NODE_WRAPPER, _types.TableCssClassName.TABLE_CELL, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.TABLE_CELL, (0, _consts.tableCellBackgroundColor)(props), (0, _consts.tableBorderColor)(props), (0, _consts.tableBorderColor)(props), _types.TableCssClassName.CONTROLS_FLOATING_BUTTON_COLUMN, _uiStyles.insertColumnButtonWrapper, _types.TableCssClassName.CONTROLS_FLOATING_BUTTON_ROW, _uiStyles.insertRowButtonWrapper, _uiStyles.DeleteButton, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.stickyRowOffsetTop + 2, _editorSharedStyles.akEditorTableNumberColumnWidth, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.stickyRowOffsetTop, (0, _tokens.token)('elevation.surface', 'white'), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.CORNER_CONTROLS, _editorSharedStyles.akEditorSmallZIndex, (0, _tokens.token)('elevation.surface', 'white'), _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.tableToolbarSize, (0, _tokens.token)('elevation.surface', 'white'), _consts.tableToolbarSize, _types.TableCssClassName.TABLE_STICKY, (0, _tokens.token)('elevation.surface', 'green'), _consts.stickyRowOffsetTop, _consts.stickyRowZIndex, (0, _tokens.token)('elevation.surface', 'white'), (0, _tokens.token)('elevation.shadow.overflow', "0 6px 4px -4px ".concat(_colors.N40A)), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.stickyRowZIndex + 1, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.tableToolbarSize, _consts.stickyHeaderBorderBottomWidth, (0, _consts.tableBorderColor)(props), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, (_consts.resizeHandlerAreaWidth - _consts.resizeLineWidth) / 2 + 1, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, (_consts.resizeHandlerAreaWidth - _consts.resizeLineWidth) / 2, _types.TableCssClassName.HOVERED_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.WITH_CONTROLS, _consts.tableControlsSpacing, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.tableControlsSpacing + 2, _types.TableCssClassName.CORNER_CONTROLS, _consts.tableControlsSpacing - _consts.tableToolbarSize + 2, (0, _tokens.token)('elevation.surface', 'white'), (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.stickyHeadersOptimization ? sentinelStyles : '', (0, _uiStyles.OverflowShadow)(props), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.tablePadding, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _consts.tablePadding, _types.TableCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth + _consts.tablePadding - 1, _types.TableCssClassName.TABLE_LEFT_SHADOW, _types.TableCssClassName.TABLE_RIGHT_SHADOW, _types.TableCssClassName.NODEVIEW_WRAPPER, _types.TableCssClassName.NODEVIEW_WRAPPER, _types.TableCssClassName.TABLE_CONTAINER, (0, _uiStyles.columnControlsDecoration)(props), _types.TableCssClassName.CORNER_CONTROLS, _consts.tableToolbarSize + 1, cornerControlHeight, _types.TableCssClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, (0, _uiStyles.InsertMarker)(props, "\n left: -11px;\n top: 9px;\n "), _types.TableCssClassName.CORNER_CONTROLS_INSERT_COLUMN_MARKER, (0, _uiStyles.InsertMarker)(props, "\n right: -1px;\n top: -12px;\n "), _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableToolbarSize + 1, _consts.tableToolbarSize + 1, (0, _consts.tableBorderColor)(props), _consts.tableBorderRadiusSize, (0, _consts.tableToolbarColor)(props), _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableBorderSelectedColor, _consts.tableToolbarSelectedColor, _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _editorSharedStyles.akEditorTableToolbarSize + _editorSharedStyles.akEditorTableNumberColumnWidth, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.CONTROLS_BUTTON, _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableBorderSelectedColor, _consts.tableToolbarSelectedColor, _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _consts.tableBorderDeleteColor, _consts.tableToolbarDeleteColor, _types.TableCssClassName.ROW_CONTROLS, _consts.tableToolbarSize, (0, _uiStyles.InsertMarker)(props, "\n bottom: -1px;\n left: -11px;\n "), _types.TableCssClassName.ROW_CONTROLS_INNER, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _consts.tableBorderRadiusSize, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _types.TableCssClassName.CONTROLS_BUTTON, _editorSharedStyles.akEditorUnitZIndex, (0, _uiStyles.HeaderButton)(props, "\n border-bottom: 1px solid ".concat((0, _consts.tableBorderColor)(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(_consts.tableToolbarSize, "px;\n\n .").concat(_types.TableCssClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(_types.TableCssClassName.CONTROLS_BUTTON_OVERLAY, ":first-of-type {\n top: 0;\n }\n ")), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.ROW_CONTROLS, (0, _uiStyles.HeaderButtonHover)(), (0, _uiStyles.HeaderButtonDanger)(), _types.TableCssClassName.NUMBERED_COLUMN, _editorSharedStyles.akEditorTableToolbarSize - 1, _editorSharedStyles.akEditorTableToolbarSize, _editorSharedStyles.akEditorTableNumberColumnWidth + 1, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, (0, _consts.tableBorderColor)(props), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _consts.tableToolbarColor)(props), (0, _consts.tableTextColor)(props), (0, _consts.tableBorderColor)(props), (0, _consts.tableBorderColor)(props), _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.tableBorderSelectedColor, _consts.tableBorderSelectedColor, _consts.tableToolbarSelectedColor, _editorSharedStyles.akEditorUnitZIndex, (0, _tokens.token)('color.text.inverse', _colors.N0), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.tableBorderSelectedColor, _consts.tableBorderSelectedColor, _consts.tableToolbarSelectedColor, _editorSharedStyles.akEditorUnitZIndex, (0, _tokens.token)('color.text.inverse', _colors.N0), _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _consts.tableToolbarDeleteColor, _consts.tableBorderDeleteColor, (0, _tokens.token)('color.text.inverse', _colors.R500), _editorSharedStyles.akEditorUnitZIndex, _types.TableCssClassName.TABLE_NODE_WRAPPER, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.SELECTED_CELL, _consts.tableBorderSelectedColor, _types.TableCssClassName.SELECTED_CELL, _consts.tableCellSelectedColor, _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _consts.tableCellDeleteColor, _editorSharedStyles.akEditorUnitZIndex * 100, _types.TableCssClassName.HOVERED_CELL, _types.TableCssClassName.SELECTED_CELL, _consts.tableBorderSelectedColor, _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _consts.tableBorderDeleteColor, _editorSharedStyles.akEditorUnitZIndex * 100, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _styles.tableMarginTop - cornerControlHeight + 1, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _types.TableCssClassName.TABLE_LEFT_SHADOW, _editorSharedStyles.akEditorUnitZIndex, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _consts.tableToolbarSize, _types.TableCssClassName.TABLE_NODE_WRAPPER, _consts.tableInsertColumnButtonSize / 2, _consts.tableInsertColumnButtonSize / 2, _consts.tableScrollbarOffset, _consts.tableScrollbarOffset, _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.TABLE_NODE_WRAPPER, _styles2.scrollbarStyles, _types.TableCssClassName.RESIZE_CURSOR);
42
42
  };
43
43
 
44
44
  exports.tableStyles = tableStyles;
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.updateDecorations = exports.findControlsHoverDecoration = exports.findColumnControlSelectedDecoration = exports.createResizeHandleDecoration = exports.createControlsHoverDecoration = exports.createColumnSelectedDecoration = exports.createColumnLineResize = exports.createColumnControlsDecoration = exports.createCellHoverDecoration = void 0;
7
9
 
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+
8
12
  var _tableMap = require("@atlaskit/editor-tables/table-map");
9
13
 
10
14
  var _utils = require("@atlaskit/editor-tables/utils");
@@ -45,8 +49,54 @@ var createCellHoverDecoration = function createCellHoverDecoration(cells, type)
45
49
 
46
50
  exports.createCellHoverDecoration = createCellHoverDecoration;
47
51
 
48
- var createControlsHoverDecoration = function createControlsHoverDecoration(cells, type, danger, selected) {
49
- return cells.map(function (cell) {
52
+ var createControlsHoverDecoration = function createControlsHoverDecoration(cells, type, tr, danger, selected) {
53
+ var table = (0, _utils.findTable)(tr.selection);
54
+
55
+ if (!table) {
56
+ return [];
57
+ }
58
+
59
+ var map = _tableMap.TableMap.get(table.node);
60
+
61
+ var _cells$reduce = cells.reduce(function (_ref, cell) {
62
+ var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
63
+ min = _ref2[0],
64
+ max = _ref2[1];
65
+
66
+ if (min === null || cell.pos < min) {
67
+ min = cell.pos;
68
+ }
69
+
70
+ if (max === null || cell.pos > max) {
71
+ max = cell.pos;
72
+ }
73
+
74
+ return [min, max];
75
+ }, [null, null]),
76
+ _cells$reduce2 = (0, _slicedToArray2.default)(_cells$reduce, 2),
77
+ min = _cells$reduce2[0],
78
+ max = _cells$reduce2[1];
79
+
80
+ if (min === null || max === null) {
81
+ return [];
82
+ }
83
+
84
+ var updatedCells = cells.map(function (x) {
85
+ return x.pos;
86
+ }); // ED-15246 fixed trello card table overflow issue
87
+ // If columns / rows have been merged the hovered selection is different to the actual selection
88
+ // So If the table cells are in danger we want to create a "rectangle" selection
89
+ // to match the "clicked" selection
90
+
91
+ if (danger) {
92
+ var rect = map.rectBetween(min - table.start, max - table.start);
93
+ updatedCells = map.cellsInRect(rect).map(function (x) {
94
+ return x + table.start;
95
+ });
96
+ }
97
+
98
+ return updatedCells.map(function (pos) {
99
+ var cell = tr.doc.nodeAt(pos);
50
100
  var classes = [_types.TableCssClassName.HOVERED_CELL];
51
101
 
52
102
  if (danger) {
@@ -74,7 +124,7 @@ var createControlsHoverDecoration = function createControlsHoverDecoration(cells
74
124
  break;
75
125
  }
76
126
 
77
- return _prosemirrorView.Decoration.node(cell.pos, cell.pos + cell.node.nodeSize, {
127
+ return _prosemirrorView.Decoration.node(pos, pos + cell.nodeSize, {
78
128
  class: classes.join(' ')
79
129
  }, {
80
130
  key: key
@@ -69,6 +69,7 @@ var Task = /*#__PURE__*/function (_ReactNodeView) {
69
69
  state: isChecked ? 'DONE' : 'TODO',
70
70
  localId: taskId
71
71
  });
72
+ tr.setMeta('scrollIntoView', false);
72
73
 
73
74
  _this.view.dispatch(tr);
74
75
  });
@@ -106,6 +106,7 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
106
106
  addPrefixTrigger: true,
107
107
  setSelectionAt: _constants.CloseSelectionOptions.AFTER_TEXT_INSERTED
108
108
  });
109
+ stopDefault = true;
109
110
  break;
110
111
 
111
112
  case 'Backspace':
@@ -167,7 +168,7 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
167
168
  (_ref$current3 = ref.current) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.focus();
168
169
  return false;
169
170
  }, [onQueryFocus]);
170
- (0, _react.useEffect)(function () {
171
+ (0, _react.useLayoutEffect)(function () {
171
172
  if (!ref.current) {
172
173
  return;
173
174
  }
@@ -320,7 +321,7 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
320
321
  }
321
322
  };
322
323
  }, [triggerQueryPrefix, cleanedInputContent, onQueryFocus, cancel, checkKeyEvent]);
323
- (0, _react.useEffect)(function () {
324
+ (0, _react.useLayoutEffect)(function () {
324
325
  var hasReopenQuery = typeof reopenQuery === 'string' && reopenQuery.trim().length > 0;
325
326
 
326
327
  if (ref.current && forceFocus) {
@@ -11,21 +11,19 @@ exports.TypeAheadList = void 0;
11
11
 
12
12
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
13
 
14
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
15
+
14
16
  var _react = _interopRequireWildcard(require("react"));
15
17
 
16
18
  var _react2 = require("@emotion/react");
17
19
 
18
20
  var _menu = require("@atlaskit/menu");
19
21
 
20
- var _TypeAheadListItem = require("./TypeAheadListItem");
21
-
22
- var _reactWindow = require("react-window");
22
+ var _CellMeasurer = require("react-virtualized/dist/commonjs/CellMeasurer");
23
23
 
24
- var _useResizeObserver = require("./hooks/use-resize-observer");
24
+ var _List = require("react-virtualized/dist/commonjs/List");
25
25
 
26
- var _useDynamicListHeightCalculation = require("./hooks/use-dynamic-list-height-calculation");
27
-
28
- var _DynamicHeightListItem = require("./DynamicHeightListItem");
26
+ var _TypeAheadListItem = require("./TypeAheadListItem");
29
27
 
30
28
  var _reactIntlNext = require("react-intl-next");
31
29
 
@@ -48,29 +46,26 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref) {
48
46
  intl = _ref.intl,
49
47
  fitHeight = _ref.fitHeight;
50
48
  var listRef = (0, _react.useRef)();
51
- var redrawListAtIndex = (0, _react.useCallback)(function (index) {
52
- listRef.current.resetAfterIndex(index);
53
- }, []);
54
49
  var lastVisibleIndexes = (0, _react.useRef)({
55
50
  overscanStartIndex: 0,
56
51
  overscanStopIndex: 0,
57
- visibleStartIndex: 0,
58
- visibleStopIndex: 0
52
+ startIndex: 0,
53
+ stopIndex: 0
59
54
  });
60
- var getFirstVisibleIndex = (0, _react.useCallback)(function () {
61
- return lastVisibleIndexes.current.overscanStartIndex;
62
- }, []);
55
+ var estimatedHeight = items.length * LIST_ITEM_ESTIMATED_HEIGHT;
63
56
 
64
- var _useDynamicListHeight = (0, _useDynamicListHeightCalculation.useDynamicListHeightCalculation)({
65
- redrawListAtIndex: redrawListAtIndex,
66
- getFirstVisibleIndex: getFirstVisibleIndex,
67
- listLength: items.length,
68
- listMaxHeight: fitHeight,
69
- listItemEstimatedHeight: LIST_ITEM_ESTIMATED_HEIGHT
70
- }),
71
- getListItemHeight = _useDynamicListHeight.getListItemHeight,
72
- setListItemHeight = _useDynamicListHeight.setListItemHeight,
73
- renderedListHeight = _useDynamicListHeight.renderedListHeight;
57
+ var _useState = (0, _react.useState)(Math.min(estimatedHeight, fitHeight)),
58
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
59
+ height = _useState2[0],
60
+ setHeight = _useState2[1];
61
+
62
+ var _useState3 = (0, _react.useState)(new _CellMeasurer.CellMeasurerCache({
63
+ fixedWidth: true,
64
+ defaultHeight: LIST_ITEM_ESTIMATED_HEIGHT
65
+ })),
66
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
67
+ cache = _useState4[0],
68
+ setCache = _useState4[1];
74
69
 
75
70
  var onItemsRendered = (0, _react.useCallback)(function (props) {
76
71
  lastVisibleIndexes.current = props;
@@ -101,58 +96,88 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref) {
101
96
  requestAnimationFrame(function () {
102
97
  requestAnimationFrame(function () {
103
98
  var indexes = lastVisibleIndexes.current;
104
- var isSelectedItemVisible = selectedIndex >= indexes.visibleStartIndex && selectedIndex <= indexes.visibleStopIndex;
99
+ var isSelectedItemVisible = selectedIndex >= indexes.startIndex && selectedIndex <= indexes.stopIndex;
105
100
 
106
101
  if (!isSelectedItemVisible) {
107
- listRef.current.scrollToItem(selectedIndex);
102
+ listRef.current.scrollToRow(selectedIndex);
108
103
  }
109
104
  });
110
105
  });
111
- }, [selectedIndex]);
112
- (0, _react.useEffect)(function () {
106
+ }, [selectedIndex, lastVisibleIndexes]);
107
+ (0, _react.useLayoutEffect)(function () {
113
108
  if (!listRef.current) {
114
109
  return;
115
110
  }
116
111
 
117
- listRef.current.scrollToItem(selectedIndex);
118
- }, [selectedIndex]);
112
+ var indexes = lastVisibleIndexes.current;
113
+ var isSelectedItemVisible = selectedIndex >= indexes.startIndex && selectedIndex <= indexes.stopIndex;
114
+
115
+ if (!isSelectedItemVisible) {
116
+ listRef.current.scrollToRow(selectedIndex);
117
+ }
118
+ }, [selectedIndex, lastVisibleIndexes]);
119
119
  (0, _react.useLayoutEffect)(function () {
120
- requestAnimationFrame(function () {
121
- listRef.current.resetAfterIndex(lastVisibleIndexes.current.overscanStartIndex);
122
- });
120
+ setCache(new _CellMeasurer.CellMeasurerCache({
121
+ fixedWidth: true,
122
+ defaultHeight: LIST_ITEM_ESTIMATED_HEIGHT
123
+ }));
123
124
  }, [items]);
125
+ (0, _react.useLayoutEffect)(function () {
126
+ var height = Math.min(items.reduce(function (prevValue, currentValue, index) {
127
+ return prevValue + cache.rowHeight({
128
+ index: index
129
+ });
130
+ }, 0), fitHeight);
131
+ setHeight(height);
132
+ }, [items, cache, fitHeight]);
133
+
134
+ var renderRow = function renderRow(_ref3) {
135
+ var index = _ref3.index,
136
+ key = _ref3.key,
137
+ style = _ref3.style,
138
+ parent = _ref3.parent;
139
+ return (0, _react2.jsx)(_CellMeasurer.CellMeasurer, {
140
+ key: key,
141
+ cache: cache,
142
+ parent: parent,
143
+ columnIndex: 0,
144
+ rowIndex: index
145
+ }, (0, _react2.jsx)("div", {
146
+ style: style,
147
+ "data-index": index
148
+ }, (0, _react2.jsx)("div", {
149
+ "data-testid": "list-item-height-observed-".concat(index)
150
+ }, (0, _react2.jsx)(_TypeAheadListItem.TypeAheadListItem, {
151
+ key: items[index].title,
152
+ item: items[index],
153
+ itemIndex: index,
154
+ selectedIndex: selectedIndex,
155
+ onItemClick: actions.onItemClick,
156
+ onItemHover: actions.onItemHover
157
+ }))));
158
+ };
124
159
 
125
160
  if (!Array.isArray(items)) {
126
161
  return null;
127
162
  }
128
163
 
129
- var estimatedHeight = items.length * LIST_ITEM_ESTIMATED_HEIGHT;
130
- var height = Math.min(typeof renderedListHeight === 'number' ? renderedListHeight : estimatedHeight, fitHeight);
131
164
  return (0, _react2.jsx)(_menu.MenuGroup, {
132
165
  role: "listbox",
133
166
  "aria-live": "polite",
134
167
  "aria-label": intl.formatMessage(_messages.typeAheadListMessages.typeAheadResultLabel),
135
168
  "aria-relevant": "additions removals"
136
- }, (0, _react2.jsx)(_useResizeObserver.ResizeObserverProvider, null, (0, _react2.jsx)(_DynamicHeightListItem.UpdateListItemHeightContext.Provider, {
137
- value: setListItemHeight
138
- }, (0, _react2.jsx)(_DynamicHeightListItem.ListItemActionsContext.Provider, {
139
- value: actions
140
- }, (0, _react2.jsx)(_DynamicHeightListItem.SelectedIndexContext.Provider, {
141
- value: selectedIndex
142
- }, (0, _react2.jsx)(_reactWindow.VariableSizeList, {
143
- useIsScrolling: true,
169
+ }, (0, _react2.jsx)(_List.List, {
170
+ rowRenderer: renderRow,
144
171
  ref: listRef,
145
- itemData: items,
146
- itemCount: items.length,
147
- estimatedItemSize: LIST_ITEM_ESTIMATED_HEIGHT,
148
- onScroll: onScroll,
149
- onItemsRendered: onItemsRendered,
150
- itemSize: getListItemHeight,
172
+ rowCount: items.length,
173
+ rowHeight: cache.rowHeight,
174
+ onRowsRendered: onItemsRendered,
151
175
  width: LIST_WIDTH,
176
+ onScroll: onScroll,
152
177
  height: height,
153
- overscanCount: 3,
154
- css: (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n button {\n padding: 12px 12px 11px;\n\n span:last-child span:last-child {\n white-space: normal;\n }\n }\n "])))
155
- }, _DynamicHeightListItem.DynamicHeightListItem))))));
178
+ overscanRowCount: 3,
179
+ css: (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n button {\n padding: 12px 12px 11px;\n span:last-child span:last-child {\n white-space: normal;\n }\n }\n "])))
180
+ }));
156
181
  });
157
182
 
158
183
  var TypeAheadList = (0, _reactIntlNext.injectIntl)(TypeAheadListComponent);
@@ -167,7 +167,7 @@ var TypeAheadPopup = /*#__PURE__*/_react.default.memo(function (props) {
167
167
  return setFitHeight(minFitHeight);
168
168
  }, [anchorElement, popupsMountPoint]);
169
169
  var getFitHeightDebounced = (0, _rafSchd.default)(getFitHeight);
170
- (0, _react.useEffect)(function () {
170
+ (0, _react.useLayoutEffect)(function () {
171
171
  var scrollableElement = popupsScrollableElement || (0, _ui.findOverflowScrollParent)(anchorElement);
172
172
  getFitHeight();
173
173
  window.addEventListener('resize', getFitHeightDebounced);
@@ -53,13 +53,18 @@ var ClickAreaBlock = /*#__PURE__*/function (_React$Component) {
53
53
 
54
54
  _this = _super.call.apply(_super, [this].concat(args));
55
55
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleClick", function (event) {
56
- var view = _this.props.editorView;
56
+ var _this$props = _this.props,
57
+ view = _this$props.editorView,
58
+ editorDisabled = _this$props.editorDisabled;
57
59
 
58
60
  if (!view) {
59
61
  return;
60
62
  }
61
63
 
62
- (0, _clickAreaHelper.clickAreaClickHandler)(view, event);
64
+ if (!editorDisabled) {
65
+ // if the editor is disabled -- we don't want to intercept any click events
66
+ (0, _clickAreaHelper.clickAreaClickHandler)(view, event);
67
+ }
63
68
  });
64
69
  return _this;
65
70
  }
@@ -77,13 +77,19 @@ var ClickAreaMobile = /*#__PURE__*/function (_React$Component) {
77
77
  _this = _super.call.apply(_super, [this].concat(args));
78
78
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "clickElementRef", /*#__PURE__*/_react.default.createRef());
79
79
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleClick", function (event) {
80
- var view = _this.props.editorView;
80
+ var _this$props = _this.props,
81
+ view = _this$props.editorView,
82
+ editorDisabled = _this$props.editorDisabled;
81
83
 
82
84
  if (!view) {
83
85
  return;
84
86
  }
85
87
 
86
- (0, _clickAreaHelper.clickAreaClickHandler)(view, event);
88
+ if (!editorDisabled) {
89
+ // if the editor is disabled -- we don't want to intercept any click events
90
+ (0, _clickAreaHelper.clickAreaClickHandler)(view, event);
91
+ }
92
+
87
93
  var scrollGutterClicked = event.clientY > view.dom.getBoundingClientRect().bottom; // Reset the default prosemirror scrollIntoView logic by
88
94
  // clamping the scroll position to the bottom of the viewport.
89
95
 
@@ -89,19 +89,15 @@ var Editor = /*#__PURE__*/function (_React$Component) {
89
89
 
90
90
  var _super = _createSuper(Editor);
91
91
 
92
- function Editor() {
92
+ // Wrapper container for toolbar and content area
93
+ function Editor(props) {
93
94
  var _this;
94
95
 
95
96
  (0, _classCallCheck2.default)(this, Editor);
96
-
97
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
98
- args[_key] = arguments[_key];
99
- }
100
-
101
- _this = _super.call.apply(_super, [this].concat(args));
97
+ _this = _super.call(this, props);
102
98
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "appearance", 'comment');
103
99
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "containerElement", null);
104
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "wrapperElement", null);
100
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "wrapperElementRef", /*#__PURE__*/_react.default.createRef());
105
101
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleSave", function () {
106
102
  if (_this.props.editorView && _this.props.onSave) {
107
103
  _this.props.onSave(_this.props.editorView);
@@ -145,9 +141,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
145
141
  }, (0, _react2.jsx)("div", {
146
142
  css: [commentEditorStyle, (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n min-height: ", "px;\n "])), minHeight)],
147
143
  className: "akEditor",
148
- ref: function ref(_ref4) {
149
- return _this.wrapperElement = _ref4;
150
- }
144
+ ref: _this.wrapperElementRef
151
145
  }, (0, _react2.jsx)(_Toolbar2.MainToolbar, {
152
146
  useStickyToolbar: useStickyToolbar
153
147
  }, (0, _react2.jsx)(_Toolbar.default, {
@@ -166,7 +160,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
166
160
  }), (0, _react2.jsx)("div", {
167
161
  css: _Toolbar2.mainToolbarCustomComponentsSlotStyle
168
162
  }, customPrimaryToolbarComponents)), (0, _react2.jsx)(_Addon.ClickAreaBlock, {
169
- editorView: editorView
163
+ editorView: editorView,
164
+ editorDisabled: disabled
170
165
  }, (0, _react2.jsx)(_ui.WidthConsumer, null, function (_ref2) {
171
166
  var width = _ref2.width;
172
167
  return (0, _react2.jsx)(ContentArea, {
@@ -190,7 +185,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
190
185
  popupsScrollableElement: popupsScrollableElement,
191
186
  containerElement: _this.containerElement,
192
187
  disabled: !!disabled,
193
- wrapperElement: _this.wrapperElement
188
+ wrapperElement: _this.wrapperElementRef.current
194
189
  }), editorDOMElement);
195
190
  })), (0, _react2.jsx)(_WidthEmitter.default, {
196
191
  editorView: editorView
@@ -212,6 +207,11 @@ var Editor = /*#__PURE__*/function (_React$Component) {
212
207
  }
213
208
  }), customSecondaryToolbarComponents));
214
209
  });
210
+
211
+ if (props.innerRef) {
212
+ _this.wrapperElementRef = props.innerRef;
213
+ }
214
+
215
215
  return _this;
216
216
  }
217
217
 
@@ -48,16 +48,12 @@ var FullPageEditor = /*#__PURE__*/function (_React$Component) {
48
48
 
49
49
  var _super = _createSuper(FullPageEditor);
50
50
 
51
- function FullPageEditor() {
51
+ // Wrapper container for toolbar and content area
52
+ function FullPageEditor(props) {
52
53
  var _this;
53
54
 
54
55
  (0, _classCallCheck2.default)(this, FullPageEditor);
55
-
56
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
57
- args[_key] = arguments[_key];
58
- }
59
-
60
- _this = _super.call.apply(_super, [this].concat(args));
56
+ _this = _super.call(this, props);
61
57
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
62
58
  showKeyline: false
63
59
  });
@@ -100,6 +96,11 @@ var FullPageEditor = /*#__PURE__*/function (_React$Component) {
100
96
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleResize", function () {
101
97
  _this.updateToolbarKeyline();
102
98
  });
99
+
100
+ if (props.innerRef) {
101
+ _this.wrapperElementRef = props.innerRef;
102
+ }
103
+
103
104
  return _this;
104
105
  }
105
106
 
@@ -47,7 +47,8 @@ var Content = /*#__PURE__*/_react2.default.memo(function (props) {
47
47
  ref: props.scrollContainerRef,
48
48
  className: "fabric-editor-popup-scroll-parent"
49
49
  }, (0, _react.jsx)(_Addon.ClickAreaBlock, {
50
- editorView: props.editorView
50
+ editorView: props.editorView,
51
+ editorDisabled: props.disabled
51
52
  }, (0, _react.jsx)("div", {
52
53
  css: (0, _StyledComponents.editorContentAreaStyle)({
53
54
  fullWidthMode: fullWidthMode,
@@ -17,11 +17,13 @@ function Mobile(_ref) {
17
17
  var editorView = _ref.editorView,
18
18
  maxHeight = _ref.maxHeight,
19
19
  persistScrollGutter = _ref.persistScrollGutter,
20
- editorDOMElement = _ref.editorDOMElement;
20
+ editorDOMElement = _ref.editorDOMElement,
21
+ disabled = _ref.disabled;
21
22
  return /*#__PURE__*/_react.default.createElement(_Mobile.MobileAppearance, {
22
23
  editorView: editorView || null,
23
24
  maxHeight: maxHeight,
24
- persistScrollGutter: persistScrollGutter
25
+ persistScrollGutter: persistScrollGutter,
26
+ editorDisabled: disabled
25
27
  }, editorDOMElement, editorView && /*#__PURE__*/_react.default.createElement(_WidthEmitter.default, {
26
28
  editorView: editorView
27
29
  }));
@@ -39,9 +39,9 @@ ContentArea.displayName = 'ContentArea';
39
39
 
40
40
  function MobileAppearance(_ref) {
41
41
  var editorView = _ref.editorView,
42
- maxHeight = _ref.maxHeight,
43
42
  persistScrollGutter = _ref.persistScrollGutter,
44
- children = _ref.children;
43
+ children = _ref.children,
44
+ editorDisabled = _ref.editorDisabled;
45
45
  var render = (0, _react.useCallback)(function (_ref2) {
46
46
  var maxContentSize = _ref2.maxContentSize,
47
47
  mobileDimensions = _ref2.mobileDimensions;
@@ -81,11 +81,12 @@ function MobileAppearance(_ref) {
81
81
  editorView: editorView || undefined,
82
82
  minHeight: minHeight,
83
83
  persistScrollGutter: persistScrollGutter,
84
- isExpanded: currentIsExpanded
84
+ isExpanded: currentIsExpanded,
85
+ editorDisabled: editorDisabled
85
86
  }, (0, _react2.jsx)(ContentArea, null, (0, _react2.jsx)("div", {
86
87
  className: "ak-editor-content-area"
87
88
  }, children)))));
88
- }, [children, editorView, persistScrollGutter]);
89
+ }, [children, editorView, persistScrollGutter, editorDisabled]);
89
90
  return (0, _react2.jsx)(_WithPluginState.default, {
90
91
  plugins: {
91
92
  maxContentSize: _maxContentSize.pluginKey,