@atlaskit/editor-core 164.0.3 → 166.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 (194) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/cjs/actions/index.js +9 -0
  3. package/dist/cjs/create-editor/ReactEditorView.js +14 -6
  4. package/dist/cjs/create-editor/create-plugins-list.js +1 -2
  5. package/dist/cjs/editor.js +32 -1
  6. package/dist/cjs/event-dispatcher/index.js +9 -0
  7. package/dist/cjs/nodeviews/ReactNodeView.js +1 -11
  8. package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  9. package/dist/cjs/nodeviews/getPerformanceOptions.js +1 -1
  10. package/dist/cjs/plugins/analytics/types/enums.js +1 -0
  11. package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +128 -79
  12. package/dist/cjs/plugins/base/utils/input-latency-tracking.js +157 -0
  13. package/dist/cjs/plugins/card/styles.js +3 -1
  14. package/dist/cjs/plugins/code-block/styles.js +6 -4
  15. package/dist/cjs/plugins/collab-edit/plugin-state.js +23 -5
  16. package/dist/cjs/plugins/date/styles.js +3 -1
  17. package/dist/cjs/plugins/emoji/index.js +30 -34
  18. package/dist/cjs/plugins/emoji/nodeviews/emoji.js +12 -66
  19. package/dist/cjs/plugins/emoji/styles.js +3 -17
  20. package/dist/cjs/plugins/expand/ui/styles.js +2 -2
  21. package/dist/cjs/plugins/extension/ui/styles.js +3 -1
  22. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
  23. package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +1 -9
  24. package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +1 -9
  25. package/dist/cjs/plugins/layout/styles.js +3 -1
  26. package/dist/cjs/plugins/list/commands/indent-list.js +5 -1
  27. package/dist/cjs/plugins/list/commands/outdent-list.js +5 -1
  28. package/dist/cjs/plugins/list/transforms.js +11 -3
  29. package/dist/cjs/plugins/media/styles.js +3 -1
  30. package/dist/cjs/plugins/mentions/index.js +10 -14
  31. package/dist/cjs/plugins/mentions/nodeviews/mention.js +15 -67
  32. package/dist/cjs/plugins/mentions/pm-plugins/main.js +19 -10
  33. package/dist/cjs/plugins/mentions/type-ahead/index.js +7 -2
  34. package/dist/cjs/plugins/panel/styles.js +3 -1
  35. package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
  36. package/dist/cjs/plugins/rule/styles.js +3 -1
  37. package/dist/cjs/plugins/selection/utils.js +39 -23
  38. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +24 -0
  39. package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
  40. package/dist/cjs/plugins/table/ui/consts.js +6 -4
  41. package/dist/cjs/plugins/tasks-and-decisions/styles.js +3 -1
  42. package/dist/cjs/plugins/type-ahead/index.js +6 -2
  43. package/dist/cjs/plugins/unsupported-content/index.js +22 -10
  44. package/dist/cjs/plugins/unsupported-content/styles.js +4 -2
  45. package/dist/cjs/plugins/unsupported-content/unsupported-inline-node-view.js +21 -0
  46. package/dist/cjs/ui/Appearance/Chromeless.js +6 -3
  47. package/dist/cjs/ui/Appearance/Comment/Comment.js +6 -4
  48. package/dist/cjs/ui/ChromeCollapsed/styles.js +3 -1
  49. package/dist/cjs/ui/ContentStyles/index.js +2 -2
  50. package/dist/cjs/ui/PortalProvider/PortalProviderThemesProvider.js +57 -0
  51. package/dist/cjs/ui/PortalProvider/index.js +66 -19
  52. package/dist/cjs/utils/check-if-mobile-bridge.js +19 -0
  53. package/dist/cjs/version-wrapper.js +1 -1
  54. package/dist/cjs/version.json +1 -1
  55. package/dist/es2019/actions/index.js +12 -1
  56. package/dist/es2019/create-editor/ReactEditorView.js +14 -6
  57. package/dist/es2019/create-editor/create-plugins-list.js +1 -2
  58. package/dist/es2019/editor.js +33 -2
  59. package/dist/es2019/event-dispatcher/index.js +8 -0
  60. package/dist/es2019/nodeviews/ReactNodeView.js +1 -10
  61. package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +9 -0
  62. package/dist/es2019/plugins/analytics/types/enums.js +1 -0
  63. package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +138 -80
  64. package/dist/es2019/plugins/base/utils/input-latency-tracking.js +128 -0
  65. package/dist/es2019/plugins/card/styles.js +9 -5
  66. package/dist/es2019/plugins/code-block/styles.js +11 -8
  67. package/dist/es2019/plugins/collab-edit/plugin-state.js +23 -8
  68. package/dist/es2019/plugins/date/styles.js +3 -1
  69. package/dist/es2019/plugins/emoji/index.js +16 -21
  70. package/dist/es2019/plugins/emoji/nodeviews/emoji.js +12 -31
  71. package/dist/es2019/plugins/emoji/styles.js +1 -82
  72. package/dist/es2019/plugins/expand/ui/styles.js +2 -2
  73. package/dist/es2019/plugins/extension/ui/styles.js +4 -2
  74. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
  75. package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +1 -8
  76. package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +1 -8
  77. package/dist/es2019/plugins/layout/styles.js +3 -2
  78. package/dist/es2019/plugins/list/commands/indent-list.js +4 -1
  79. package/dist/es2019/plugins/list/commands/outdent-list.js +4 -1
  80. package/dist/es2019/plugins/list/transforms.js +9 -4
  81. package/dist/es2019/plugins/media/styles.js +9 -7
  82. package/dist/es2019/plugins/mentions/index.js +1 -6
  83. package/dist/es2019/plugins/mentions/nodeviews/mention.js +16 -35
  84. package/dist/es2019/plugins/mentions/pm-plugins/main.js +18 -10
  85. package/dist/es2019/plugins/mentions/type-ahead/index.js +7 -2
  86. package/dist/es2019/plugins/panel/styles.js +5 -4
  87. package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
  88. package/dist/es2019/plugins/rule/styles.js +2 -1
  89. package/dist/es2019/plugins/selection/utils.js +35 -20
  90. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +22 -0
  91. package/dist/es2019/plugins/table/ui/common-styles.js +4 -0
  92. package/dist/es2019/plugins/table/ui/consts.js +5 -4
  93. package/dist/es2019/plugins/tasks-and-decisions/styles.js +4 -2
  94. package/dist/es2019/plugins/type-ahead/index.js +5 -1
  95. package/dist/es2019/plugins/unsupported-content/index.js +23 -12
  96. package/dist/es2019/plugins/unsupported-content/styles.js +5 -3
  97. package/dist/es2019/plugins/unsupported-content/unsupported-inline-node-view.js +7 -0
  98. package/dist/es2019/ui/Appearance/Chromeless.js +5 -2
  99. package/dist/es2019/ui/Appearance/Comment/Comment.js +5 -2
  100. package/dist/es2019/ui/ChromeCollapsed/styles.js +2 -1
  101. package/dist/es2019/ui/ContentStyles/index.js +3 -3
  102. package/dist/es2019/ui/PortalProvider/PortalProviderThemesProvider.js +39 -0
  103. package/dist/es2019/ui/PortalProvider/index.js +39 -3
  104. package/dist/es2019/utils/check-if-mobile-bridge.js +12 -0
  105. package/dist/es2019/version-wrapper.js +1 -1
  106. package/dist/es2019/version.json +1 -1
  107. package/dist/esm/actions/index.js +8 -0
  108. package/dist/esm/create-editor/ReactEditorView.js +14 -6
  109. package/dist/esm/create-editor/create-plugins-list.js +1 -2
  110. package/dist/esm/editor.js +33 -2
  111. package/dist/esm/event-dispatcher/index.js +9 -0
  112. package/dist/esm/nodeviews/ReactNodeView.js +1 -10
  113. package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  114. package/dist/esm/plugins/analytics/types/enums.js +1 -0
  115. package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +128 -79
  116. package/dist/esm/plugins/base/utils/input-latency-tracking.js +149 -0
  117. package/dist/esm/plugins/card/styles.js +2 -1
  118. package/dist/esm/plugins/code-block/styles.js +5 -4
  119. package/dist/esm/plugins/collab-edit/plugin-state.js +21 -6
  120. package/dist/esm/plugins/date/styles.js +2 -1
  121. package/dist/esm/plugins/emoji/index.js +26 -29
  122. package/dist/esm/plugins/emoji/nodeviews/emoji.js +11 -56
  123. package/dist/esm/plugins/emoji/styles.js +3 -14
  124. package/dist/esm/plugins/expand/ui/styles.js +2 -2
  125. package/dist/esm/plugins/extension/ui/styles.js +2 -1
  126. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
  127. package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +1 -8
  128. package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +1 -8
  129. package/dist/esm/plugins/layout/styles.js +2 -1
  130. package/dist/esm/plugins/list/commands/indent-list.js +4 -1
  131. package/dist/esm/plugins/list/commands/outdent-list.js +4 -1
  132. package/dist/esm/plugins/list/transforms.js +9 -4
  133. package/dist/esm/plugins/media/styles.js +2 -1
  134. package/dist/esm/plugins/mentions/index.js +10 -14
  135. package/dist/esm/plugins/mentions/nodeviews/mention.js +13 -58
  136. package/dist/esm/plugins/mentions/pm-plugins/main.js +18 -10
  137. package/dist/esm/plugins/mentions/type-ahead/index.js +7 -2
  138. package/dist/esm/plugins/panel/styles.js +2 -1
  139. package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
  140. package/dist/esm/plugins/rule/styles.js +2 -1
  141. package/dist/esm/plugins/selection/utils.js +35 -20
  142. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +23 -0
  143. package/dist/esm/plugins/table/ui/common-styles.js +1 -1
  144. package/dist/esm/plugins/table/ui/consts.js +5 -4
  145. package/dist/esm/plugins/tasks-and-decisions/styles.js +2 -1
  146. package/dist/esm/plugins/type-ahead/index.js +6 -2
  147. package/dist/esm/plugins/unsupported-content/index.js +21 -11
  148. package/dist/esm/plugins/unsupported-content/styles.js +3 -2
  149. package/dist/esm/plugins/unsupported-content/unsupported-inline-node-view.js +7 -0
  150. package/dist/esm/ui/Appearance/Chromeless.js +6 -3
  151. package/dist/esm/ui/Appearance/Comment/Comment.js +6 -4
  152. package/dist/esm/ui/ChromeCollapsed/styles.js +2 -1
  153. package/dist/esm/ui/ContentStyles/index.js +3 -3
  154. package/dist/esm/ui/PortalProvider/PortalProviderThemesProvider.js +39 -0
  155. package/dist/esm/ui/PortalProvider/index.js +61 -19
  156. package/dist/esm/utils/check-if-mobile-bridge.js +12 -0
  157. package/dist/esm/version-wrapper.js +1 -1
  158. package/dist/esm/version.json +1 -1
  159. package/dist/types/actions/index.d.ts +3 -1
  160. package/dist/types/editor.d.ts +3 -0
  161. package/dist/types/event-dispatcher/index.d.ts +1 -0
  162. package/dist/types/nodeviews/ReactNodeView.d.ts +1 -5
  163. package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
  164. package/dist/types/plugins/analytics/types/events.d.ts +2 -2
  165. package/dist/types/plugins/analytics/types/general-events.d.ts +10 -1
  166. package/dist/types/plugins/base/utils/input-latency-tracking.d.ts +44 -0
  167. package/dist/types/plugins/collab-edit/plugin-state.d.ts +4 -0
  168. package/dist/types/plugins/emoji/index.d.ts +2 -6
  169. package/dist/types/plugins/emoji/nodeviews/emoji.d.ts +4 -14
  170. package/dist/types/plugins/emoji/styles.d.ts +0 -1
  171. package/dist/types/plugins/emoji/types.d.ts +0 -1
  172. package/dist/types/plugins/list/transforms.d.ts +10 -1
  173. package/dist/types/plugins/mentions/nodeviews/mention.d.ts +6 -14
  174. package/dist/types/plugins/mentions/pm-plugins/main.d.ts +2 -5
  175. package/dist/types/plugins/selection/utils.d.ts +7 -15
  176. package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +3 -0
  177. package/dist/types/plugins/table/ui/consts.d.ts +2 -2
  178. package/dist/types/plugins/type-ahead/types.d.ts +1 -0
  179. package/dist/types/plugins/unsupported-content/unsupported-inline-node-view.d.ts +11 -0
  180. package/dist/types/types/editor-appearance-component.d.ts +1 -0
  181. package/dist/types/types/editor-props.d.ts +1 -0
  182. package/dist/types/types/feature-flags.d.ts +0 -14
  183. package/dist/types/ui/Appearance/Chromeless.d.ts +1 -0
  184. package/dist/types/ui/Appearance/Comment/Comment.d.ts +1 -0
  185. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +5 -5
  186. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  187. package/dist/types/ui/PortalProvider/PortalProviderThemesProvider.d.ts +6 -0
  188. package/dist/types/ui/PortalProvider/index.d.ts +5 -1
  189. package/dist/types/utils/check-if-mobile-bridge.d.ts +1 -0
  190. package/package.json +24 -23
  191. package/dist/cjs/plugins/emoji/nodeviews/emoji-next.js +0 -250
  192. package/dist/es2019/plugins/emoji/nodeviews/emoji-next.js +0 -177
  193. package/dist/esm/plugins/emoji/nodeviews/emoji-next.js +0 -234
  194. package/dist/types/plugins/emoji/nodeviews/emoji-next.d.ts +0 -31
@@ -11,6 +11,13 @@ import { syncStickyRowToTable, updateStickyMargins as updateTableMargin } from '
11
11
  import { updateStickyState } from '../commands';
12
12
  import { getTop, getTree } from './dom';
13
13
  import { getFeatureFlags } from '../../../../feature-flags-context';
14
+ import debounce from 'lodash/debounce';
15
+ import throttle from 'lodash/throttle'; // limit scroll event calls
16
+
17
+ var HEADER_ROW_SCROLL_THROTTLE_TIMEOUT = 200; // timeout for resetting the scroll class - if it’s too long then users won’t be able to click on the header cells,
18
+ // if too short it would trigger too many dom udpates.
19
+
20
+ var HEADER_ROW_SCROLL_RESET_DEBOUNCE_TIMEOUT = 400;
14
21
  export var supportedHeaderRow = function supportedHeaderRow(node) {
15
22
  var allHeaders = mapChildren(node, function (child) {
16
23
  return child.type.name === 'tableHeader';
@@ -40,6 +47,18 @@ export var TableRowNodeView = /*#__PURE__*/function () {
40
47
 
41
48
  _defineProperty(this, "listening", false);
42
49
 
50
+ _defineProperty(this, "headerRowMouseScrollEnd", debounce(function () {
51
+ _this.dom.classList.remove('no-pointer-events');
52
+ }, HEADER_ROW_SCROLL_RESET_DEBOUNCE_TIMEOUT));
53
+
54
+ _defineProperty(this, "headerRowMouseScroll", throttle(function () {
55
+ if (_this.isSticky) {
56
+ _this.dom.classList.add('no-pointer-events');
57
+
58
+ _this.headerRowMouseScrollEnd();
59
+ }
60
+ }, HEADER_ROW_SCROLL_THROTTLE_TIMEOUT));
61
+
43
62
  _defineProperty(this, "onScroll", function () {
44
63
  if (!_this.tree) {
45
64
  return;
@@ -350,6 +369,8 @@ export var TableRowNodeView = /*#__PURE__*/function () {
350
369
  this.eventDispatcher.on(widthPluginKey.key, this.onWidthPluginState);
351
370
  this.eventDispatcher.on(tablePluginKey.key, this.onTablePluginState);
352
371
  this.listening = true;
372
+ this.dom.addEventListener('wheel', this.headerRowMouseScroll.bind(this));
373
+ this.dom.addEventListener('touchmove', this.headerRowMouseScroll.bind(this));
353
374
  }
354
375
  }, {
355
376
  key: "unsubscribe",
@@ -373,6 +394,8 @@ export var TableRowNodeView = /*#__PURE__*/function () {
373
394
  this.eventDispatcher.off(widthPluginKey.key, this.onWidthPluginState);
374
395
  this.eventDispatcher.off(tablePluginKey.key, this.onTablePluginState);
375
396
  this.listening = false;
397
+ this.dom.removeEventListener('wheel', this.headerRowMouseScroll);
398
+ this.dom.removeEventListener('touchmove', this.headerRowMouseScroll);
376
399
  } // initialize intersection observer to track if table is within scroll area
377
400
 
378
401
  }, {
@@ -17,7 +17,7 @@ var sentinelStyles = ".".concat(ClassName.TABLE_CONTAINER, " {\n > .").concat(C
17
17
  export var tableStyles = function tableStyles(props) {
18
18
  var _props$featureFlags;
19
19
 
20
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: white !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n td.", ", th.", " {\n position: relative;\n overflow: visible;\n }\n\n td.", " {\n background-color: ", ";\n }\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", "\n }\n\n /* Delete button */\n ", "\n /* Ends Delete button */\n\n /* sticky styles */\n .", " .", " .", ":first-child {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n\n box-shadow: 0px -", "px white;\n border-right: 0 none;\n /* top set by NumberColumn component */\n }\n\n .", " .", ".sticky {\n position: fixed !important;\n /* needs to be above row controls */\n z-index: ", " !important;\n background: white;\n\n width: ", "px;\n height: ", "px;\n }\n\n .", ".sticky .", " {\n border-bottom: 0px none;\n border-right: 0px none;\n\n height: ", "px;\n width: ", "px;\n }\n\n .", " .", " {\n z-index: 0;\n }\n\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid white;\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid green;\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection */\n z-index: ", ";\n\n overflow-y: visible;\n overflow-x: hidden;\n\n grid-auto-flow: column;\n\n /* background for where controls apply */\n background: white;\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: 0 6px 4px -4px ", ";\n margin-left: -1px;\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\n z-index: ", ";\n }\n\n .", ".", "\n .", " {\n padding-bottom: ", "px;\n }\n\n tr.sticky th {\n border-bottom: ", "px solid\n ", ";\n margin-right: -1px;\n }\n\n .", " tr.sticky > th:last-child {\n border-right-width: 1px;\n }\n\n /* add left edge for first cell */\n .", " tr.sticky > th:first-child {\n margin-left: 0px;\n }\n\n /* add a little bit so the scroll lines up with the table */\n .", " tr.sticky::after {\n content: ' ';\n width: 1px;\n }\n\n /* To fix jumpiness caused in Chrome Browsers for sticky headers */\n .", " .sticky + tr {\n min-height: 0px;\n }\n\n /* move resize line a little in sticky bar */\n .", ".", " {\n tr.sticky\n td.", ",\n tr.sticky\n th.", " {\n .", "::after {\n right: ", "px;\n }\n }\n\n /* when selected put it back to normal -- :not selector would be nicer */\n tr.sticky\n td.", ".", ",\n tr.sticky\n th.", ".", " {\n .", "::after {\n right: ", "px;\n }\n }\n }\n\n tr.sticky\n .", ",\n tr.sticky\n .", " {\n z-index: 1;\n }\n\n .", " tr.sticky {\n padding-top: ", "px;\n }\n\n .", ".", "\n .", "\n .", ":first-child {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid white;\n }\n\n ", "\n ", "\n\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level */\n > * .", " .", " {\n margin-left: unset !important;\n width: 100% !important;\n }\n\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: 1px;\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", " {\n cursor: pointer;\n }\n .", ":hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n\n .", " + * {\n margin-top: 0;\n }\n\n /*\n * Headings have a top margin by default, but we don't want this on the\n * first heading within table header cells.\n *\n * This specifically sets margin-top for the first heading within a header\n * cell when center/right aligned.\n */\n th.", " > .fabric-editor-block-mark {\n > h1:first-child,\n > h2:first-child,\n > h3:first-child,\n > h4:first-child,\n > h5:first-child,\n > h6:first-child {\n margin-top: 0;\n }\n }\n\n .", ", .", " {\n position: relative;\n }\n /* Give selected cells a blue overlay */\n .", "::after,\n .", "::after {\n z-index: ", ";\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n opacity: 0.3;\n pointer-events: none;\n }\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n }\n th.", "::after,\n td.", "::after {\n background: ", ";\n }\n }\n .", " {\n position: absolute;\n /* top of corner control is table margin top - corner control height + 1 pixel of table border. */\n top: ", "px;\n }\n .", ".", " {\n z-index: ", ";\n }\n .", " {\n left: -", "px;\n }\n .", " {\n /*\n compensating for half of the insert column button\n that is aligned to the right edge initially on hover of the top right column control when table overflown,\n its center should be aligned with the edge\n */\n padding-right: ", "px;\n margin-right: -", "px;\n padding-bottom: ", "px;\n margin-bottom: -", "px;\n /* fixes gap cursor height */\n overflow: auto;\n position: relative;\n }\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n .ProseMirror .pm-table-cell-content-wrap ol[data-child-count='100+'] {\n padding-left: revert;\n }\n"])), ClassName.LAYOUT_BUTTON, N20A, N300, ClassName.LAYOUT_BUTTON, ClassName.IS_RESIZING, B300, tableSharedStyle(props), columnControlsLineMarker(props), hoveredDeleteButton, hoveredCell, hoveredWarningCell, resizeHandle, rangeSelectionStyles, ClassName.LAST_ITEM_IN_CELL, ClassName.TABLE_NODE_WRAPPER, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.TABLE_CELL, tableCellBackgroundColor(props), ClassName.CONTROLS_FLOATING_BUTTON_COLUMN, insertColumnButtonWrapper, ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper, DeleteButton, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, stickyRowOffsetTop + 2, akEditorTableNumberColumnWidth, akEditorStickyHeaderZIndex, stickyRowOffsetTop, ClassName.TABLE_STICKY, ClassName.CORNER_CONTROLS, akEditorSmallZIndex, tableToolbarSize, tableToolbarSize, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize, tableToolbarSize, ClassName.TABLE_STICKY, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_STICKY, ClassName.ROW_CONTROLS, ClassName.ROW_CONTROLS_BUTTON_WRAP, akEditorStickyHeaderZIndex, tableToolbarSize, tableToolbarSize, ClassName.TABLE_STICKY, stickyRowOffsetTop, stickyRowZIndex, N40A, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, stickyRowZIndex + 1, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tableToolbarSize, stickyHeaderBorderBottomWidth, tableBorderColor(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY, ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.WITH_CONTROLS, tableControlsSpacing, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, tableControlsSpacing + 2, ClassName.CORNER_CONTROLS, tableControlsSpacing - tableToolbarSize + 2, (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.stickyHeadersOptimization ? sentinelStyles : '', OverflowShadow(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, ClassName.NODEVIEW_WRAPPER, ClassName.TABLE_CONTAINER, columnControlsDecoration(props), ClassName.CORNER_CONTROLS, tableToolbarSize + 1, cornerControlHeight, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, InsertMarker(props, "\n left: -11px;\n top: 9px;\n "), ClassName.CORNER_CONTROLS_INSERT_COLUMN_MARKER, InsertMarker(props, "\n right: -1px;\n top: -12px;\n "), ClassName.CORNER_CONTROLS, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize + 1, tableToolbarSize + 1, tableBorderColor(props), tableBorderRadiusSize, tableToolbarColor(props), ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor, tableToolbarDeleteColor, ClassName.ROW_CONTROLS, tableToolbarSize, InsertMarker(props, "\n bottom: -1px;\n left: -11px;\n "), ClassName.ROW_CONTROLS_INNER, ClassName.ROW_CONTROLS_BUTTON_WRAP, tableBorderRadiusSize, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.CONTROLS_BUTTON, akEditorUnitZIndex, HeaderButton(props, "\n border-bottom: 1px solid ".concat(tableBorderColor(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(tableToolbarSize, "px;\n\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, ":first-child {\n top: 0;\n }\n ")), ClassName.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(), HeaderButtonDanger(), ClassName.NUMBERED_COLUMN, akEditorTableToolbarSize - 1, akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableToolbarColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, N0, ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, N0, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableToolbarDeleteColor, tableBorderDeleteColor, R500, akEditorUnitZIndex, ClassName.TABLE_NODE_WRAPPER, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, akEditorSmallZIndex, ClassName.SELECTED_CELL, tableBorderSelectedColor, ClassName.SELECTED_CELL, tableCellSelectedColor, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor, ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.ROW_CONTROLS_WRAPPER, tableToolbarSize, ClassName.TABLE_NODE_WRAPPER, tableInsertColumnButtonSize / 2, tableInsertColumnButtonSize / 2, tableScrollbarOffset, tableScrollbarOffset, ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR);
20
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: white !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n td.", ", th.", " {\n position: relative;\n overflow: visible;\n }\n\n td.", " {\n background-color: ", ";\n }\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", "\n }\n\n /* Delete button */\n ", "\n /* Ends Delete button */\n\n /* sticky styles */\n .", " .", " .", ":first-child {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n\n box-shadow: 0px -", "px white;\n border-right: 0 none;\n /* top set by NumberColumn component */\n }\n\n .", " .", ".sticky {\n position: fixed !important;\n /* needs to be above row controls */\n z-index: ", " !important;\n background: white;\n\n width: ", "px;\n height: ", "px;\n }\n\n .", ".sticky .", " {\n border-bottom: 0px none;\n border-right: 0px none;\n\n height: ", "px;\n width: ", "px;\n }\n\n .", " .", " {\n z-index: 0;\n }\n\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid white;\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid green;\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection */\n z-index: ", ";\n\n overflow-y: visible;\n overflow-x: hidden;\n\n grid-auto-flow: column;\n\n /* background for where controls apply */\n background: white;\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: 0 6px 4px -4px ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\n z-index: ", ";\n }\n\n .", ".", "\n .", " {\n padding-bottom: ", "px;\n }\n\n tr.sticky th {\n border-bottom: ", "px solid\n ", ";\n margin-right: -1px;\n }\n\n .", " tr.sticky > th:last-child {\n border-right-width: 1px;\n }\n\n /* add left edge for first cell */\n .", " tr.sticky > th:first-child {\n margin-left: 0px;\n }\n\n /* add a little bit so the scroll lines up with the table */\n .", " tr.sticky::after {\n content: ' ';\n width: 1px;\n }\n\n /* To fix jumpiness caused in Chrome Browsers for sticky headers */\n .", " .sticky + tr {\n min-height: 0px;\n }\n\n /* move resize line a little in sticky bar */\n .", ".", " {\n tr.sticky\n td.", ",\n tr.sticky\n th.", " {\n .", "::after {\n right: ", "px;\n }\n }\n\n /* when selected put it back to normal -- :not selector would be nicer */\n tr.sticky\n td.", ".", ",\n tr.sticky\n th.", ".", " {\n .", "::after {\n right: ", "px;\n }\n }\n }\n\n tr.sticky\n .", ",\n tr.sticky\n .", " {\n z-index: 1;\n }\n\n .", " tr.sticky {\n padding-top: ", "px;\n }\n\n .", ".", "\n .", "\n .", ":first-child {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid white;\n }\n\n ", "\n ", "\n\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level */\n > * .", " .", " {\n margin-left: unset !important;\n width: 100% !important;\n }\n\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: 1px;\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", " {\n cursor: pointer;\n }\n .", ":hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n\n .", " + * {\n margin-top: 0;\n }\n\n /*\n * Headings have a top margin by default, but we don't want this on the\n * first heading within table header cells.\n *\n * This specifically sets margin-top for the first heading within a header\n * cell when center/right aligned.\n */\n th.", " > .fabric-editor-block-mark {\n > h1:first-child,\n > h2:first-child,\n > h3:first-child,\n > h4:first-child,\n > h5:first-child,\n > h6:first-child {\n margin-top: 0;\n }\n }\n\n .", ", .", " {\n position: relative;\n }\n /* Give selected cells a blue overlay */\n .", "::after,\n .", "::after {\n z-index: ", ";\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n opacity: 0.3;\n pointer-events: none;\n }\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n }\n th.", "::after,\n td.", "::after {\n background: ", ";\n }\n }\n .", " {\n position: absolute;\n /* top of corner control is table margin top - corner control height + 1 pixel of table border. */\n top: ", "px;\n }\n .", ".", " {\n z-index: ", ";\n }\n .", " {\n left: -", "px;\n }\n .", " {\n /*\n compensating for half of the insert column button\n that is aligned to the right edge initially on hover of the top right column control when table overflown,\n its center should be aligned with the edge\n */\n padding-right: ", "px;\n margin-right: -", "px;\n padding-bottom: ", "px;\n margin-bottom: -", "px;\n /* fixes gap cursor height */\n overflow: auto;\n position: relative;\n }\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n .ProseMirror .pm-table-cell-content-wrap ol[data-child-count='100+'] {\n padding-left: revert;\n }\n"])), ClassName.LAYOUT_BUTTON, N20A, N300, ClassName.LAYOUT_BUTTON, ClassName.IS_RESIZING, B300, tableSharedStyle(props), columnControlsLineMarker(props), hoveredDeleteButton, hoveredCell, hoveredWarningCell, resizeHandle, rangeSelectionStyles, ClassName.LAST_ITEM_IN_CELL, ClassName.TABLE_NODE_WRAPPER, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.TABLE_CELL, tableCellBackgroundColor(props), ClassName.CONTROLS_FLOATING_BUTTON_COLUMN, insertColumnButtonWrapper, ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper, DeleteButton, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, stickyRowOffsetTop + 2, akEditorTableNumberColumnWidth, akEditorStickyHeaderZIndex, stickyRowOffsetTop, ClassName.TABLE_STICKY, ClassName.CORNER_CONTROLS, akEditorSmallZIndex, tableToolbarSize, tableToolbarSize, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize, tableToolbarSize, ClassName.TABLE_STICKY, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_STICKY, ClassName.ROW_CONTROLS, ClassName.ROW_CONTROLS_BUTTON_WRAP, akEditorStickyHeaderZIndex, tableToolbarSize, tableToolbarSize, ClassName.TABLE_STICKY, stickyRowOffsetTop, stickyRowZIndex, N40A, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, stickyRowZIndex + 1, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tableToolbarSize, stickyHeaderBorderBottomWidth, tableBorderColor(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY, ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.WITH_CONTROLS, tableControlsSpacing, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, tableControlsSpacing + 2, ClassName.CORNER_CONTROLS, tableControlsSpacing - tableToolbarSize + 2, (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.stickyHeadersOptimization ? sentinelStyles : '', OverflowShadow(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, ClassName.NODEVIEW_WRAPPER, ClassName.TABLE_CONTAINER, columnControlsDecoration(props), ClassName.CORNER_CONTROLS, tableToolbarSize + 1, cornerControlHeight, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, InsertMarker(props, "\n left: -11px;\n top: 9px;\n "), ClassName.CORNER_CONTROLS_INSERT_COLUMN_MARKER, InsertMarker(props, "\n right: -1px;\n top: -12px;\n "), ClassName.CORNER_CONTROLS, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize + 1, tableToolbarSize + 1, tableBorderColor(props), tableBorderRadiusSize, tableToolbarColor(props), ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor, tableToolbarDeleteColor, ClassName.ROW_CONTROLS, tableToolbarSize, InsertMarker(props, "\n bottom: -1px;\n left: -11px;\n "), ClassName.ROW_CONTROLS_INNER, ClassName.ROW_CONTROLS_BUTTON_WRAP, tableBorderRadiusSize, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.CONTROLS_BUTTON, akEditorUnitZIndex, HeaderButton(props, "\n border-bottom: 1px solid ".concat(tableBorderColor(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(tableToolbarSize, "px;\n\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, ":first-child {\n top: 0;\n }\n ")), ClassName.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(), HeaderButtonDanger(), ClassName.NUMBERED_COLUMN, akEditorTableToolbarSize - 1, akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableToolbarColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, N0, ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, N0, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableToolbarDeleteColor, tableBorderDeleteColor, R500, akEditorUnitZIndex, ClassName.TABLE_NODE_WRAPPER, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, akEditorSmallZIndex, ClassName.SELECTED_CELL, tableBorderSelectedColor, ClassName.SELECTED_CELL, tableCellSelectedColor, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor, ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.ROW_CONTROLS_WRAPPER, tableToolbarSize, ClassName.TABLE_NODE_WRAPPER, tableInsertColumnButtonSize / 2, tableInsertColumnButtonSize / 2, tableScrollbarOffset, tableScrollbarOffset, ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR);
21
21
  };
22
22
  export var tableFullPageEditorStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n width: 100%;\n }\n"])), ClassName.TABLE_NODE_WRAPPER);
23
23
  export var tableCommentEditorStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n ", ";\n }\n"])), ClassName.TABLE_NODE_WRAPPER, scrollbarStyles);
@@ -1,6 +1,7 @@
1
1
  import { B200, B300, B75, N0, N20, R50, R400, R75, DN400, N200, DN30 } from '@atlaskit/theme/colors';
2
2
  import { tableCellBorderWidth, tableMarginTop } from '@atlaskit/editor-common/styles';
3
3
  import { akEditorTableBorder, akEditorTableBorderDark, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableToolbarSize, akEditorUnitZIndex, akRichMediaResizeZIndex } from '@atlaskit/editor-shared-styles';
4
+ import { token } from '@atlaskit/tokens';
4
5
  import { RESIZE_HANDLE_AREA_DECORATION_GAP } from '../types';
5
6
  import { themed } from '@atlaskit/theme/components';
6
7
  /**
@@ -12,16 +13,16 @@ export var tableCellBackgroundColor = themed({
12
13
  dark: DN30
13
14
  });
14
15
  export var tableToolbarColor = themed({
15
- light: akEditorTableToolbar,
16
- dark: akEditorTableToolbarDark
16
+ light: token('color.background.neutral', akEditorTableToolbar),
17
+ dark: token('color.background.neutral', akEditorTableToolbarDark)
17
18
  });
18
19
  export var tableTextColor = themed({
19
20
  light: N200,
20
21
  dark: DN400
21
22
  });
22
23
  export var tableBorderColor = themed({
23
- light: akEditorTableBorder,
24
- dark: akEditorTableBorderDark
24
+ light: token('color.border', akEditorTableBorder),
25
+ dark: token('color.border', akEditorTableBorderDark)
25
26
  });
26
27
  export var tableFloatingControlsColor = N20;
27
28
  export var tableCellSelectedColor = B75;
@@ -5,4 +5,5 @@ var _templateObject;
5
5
  import { css } from '@emotion/react';
6
6
  import { TaskDecisionSharedCssClassName } from '@atlaskit/editor-common/styles';
7
7
  import { SelectionStyle, getSelectionStyles, akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
8
- export var taskDecisionStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n [data-decision-wrapper] {\n cursor: pointer;\n }\n\n .", " > [data-decision-wrapper],\n ol[data-node-type='decisionList'].", " {\n border-radius: 4px;\n ", "\n }\n\n .danger {\n .", ".", "\n > div {\n box-shadow: 0 0 0 ", "px ", ";\n background-color: ", ";\n &::after {\n content: none; /* reset the Blanket selection style */\n }\n }\n }\n"])), akEditorSelectedNodeClassName, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]), TaskDecisionSharedCssClassName.DECISION_CONTAINER, akEditorSelectedNodeClassName, akEditorSelectedBorderSize, akEditorDeleteBorder, akEditorDeleteBackgroundWithOpacity);
8
+ import { token } from '@atlaskit/tokens';
9
+ export var taskDecisionStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n [data-decision-wrapper] {\n cursor: pointer;\n }\n\n .", " > [data-decision-wrapper],\n ol[data-node-type='decisionList'].", " {\n border-radius: 4px;\n ", "\n }\n\n .danger {\n .", ".", "\n > div {\n box-shadow: 0 0 0 ", "px\n ", ";\n background-color: ", ";\n &::after {\n content: none; /* reset the Blanket selection style */\n }\n }\n }\n"])), akEditorSelectedNodeClassName, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]), TaskDecisionSharedCssClassName.DECISION_CONTAINER, akEditorSelectedNodeClassName, akEditorSelectedBorderSize, token('color.border.danger', akEditorDeleteBorder), token('color.blanket.danger', akEditorDeleteBackgroundWithOpacity));
@@ -183,7 +183,8 @@ var typeAheadPlugin = function typeAheadPlugin(options) {
183
183
  });
184
184
  },
185
185
  onEditorViewStateUpdated: function onEditorViewStateUpdated(_ref7) {
186
- var oldEditorState = _ref7.oldEditorState,
186
+ var originalTransaction = _ref7.originalTransaction,
187
+ oldEditorState = _ref7.oldEditorState,
187
188
  newEditorState = _ref7.newEditorState;
188
189
  var oldPluginState = getPluginState(oldEditorState);
189
190
  var newPluginState = getPluginState(newEditorState);
@@ -197,10 +198,13 @@ var typeAheadPlugin = function typeAheadPlugin(options) {
197
198
  var isANewHandler = oldTriggerHandler !== newTriggerHandler;
198
199
 
199
200
  if (oldTriggerHandler !== null && oldTriggerHandler !== void 0 && oldTriggerHandler.dismiss && isANewHandler) {
201
+ var typeAheadMessage = originalTransaction.getMeta(typeAheadPluginKey);
202
+ var wasItemInserted = typeAheadMessage && typeAheadMessage.action === 'INSERT_RAW_QUERY';
200
203
  oldTriggerHandler.dismiss({
201
204
  editorState: newEditorState,
202
205
  query: oldPluginState.query,
203
- stats: (oldPluginState.stats || new StatsModifier()).serialize()
206
+ stats: (oldPluginState.stats || new StatsModifier()).serialize(),
207
+ wasItemInserted: wasItemInserted
204
208
  });
205
209
  }
206
210
 
@@ -1,15 +1,17 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { PluginKey } from 'prosemirror-state';
3
3
  import { confluenceUnsupportedBlock, confluenceUnsupportedInline, unsupportedBlock, unsupportedInline, unsupportedMark, unsupportedNodeAttribute } from '@atlaskit/adf-schema';
4
- import { UnsupportedBlock, UnsupportedInline } from '@atlaskit/editor-common/ui';
4
+ import { UnsupportedBlock } from '@atlaskit/editor-common/ui';
5
+ import { UnsupportedInlineNodeView } from './unsupported-inline-node-view';
5
6
  import { ReactNodeView } from '../../nodeviews';
7
+ import { getInlineNodeViewProducer } from '../../nodeviews/getInlineNodeViewProducer';
6
8
  export var pluginKey = new PluginKey('unsupportedContentPlugin');
7
9
 
8
- var createPlugin = function createPlugin(_ref) {
9
- var portalProviderAPI = _ref.portalProviderAPI,
10
- eventDispatcher = _ref.eventDispatcher,
11
- dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
10
+ var createPlugin = function createPlugin(pmPluginFactoryParams) {
12
11
  var hasIntlContext = true;
12
+ var portalProviderAPI = pmPluginFactoryParams.portalProviderAPI,
13
+ eventDispatcher = pmPluginFactoryParams.eventDispatcher,
14
+ dispatchAnalyticsEvent = pmPluginFactoryParams.dispatchAnalyticsEvent;
13
15
  return new SafePlugin({
14
16
  key: pluginKey,
15
17
  props: {
@@ -17,15 +19,23 @@ var createPlugin = function createPlugin(_ref) {
17
19
  confluenceUnsupportedBlock: ReactNodeView.fromComponent(UnsupportedBlock, portalProviderAPI, eventDispatcher, {
18
20
  dispatchAnalyticsEvent: dispatchAnalyticsEvent
19
21
  }, undefined, hasIntlContext),
20
- confluenceUnsupportedInline: ReactNodeView.fromComponent(UnsupportedInline, portalProviderAPI, eventDispatcher, {
21
- dispatchAnalyticsEvent: dispatchAnalyticsEvent
22
- }, undefined, hasIntlContext),
22
+ confluenceUnsupportedInline: getInlineNodeViewProducer({
23
+ pmPluginFactoryParams: pmPluginFactoryParams,
24
+ Component: UnsupportedInlineNodeView,
25
+ extraComponentProps: {
26
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent
27
+ }
28
+ }),
23
29
  unsupportedBlock: ReactNodeView.fromComponent(UnsupportedBlock, portalProviderAPI, eventDispatcher, {
24
30
  dispatchAnalyticsEvent: dispatchAnalyticsEvent
25
31
  }, undefined, hasIntlContext),
26
- unsupportedInline: ReactNodeView.fromComponent(UnsupportedInline, portalProviderAPI, eventDispatcher, {
27
- dispatchAnalyticsEvent: dispatchAnalyticsEvent
28
- }, undefined, hasIntlContext)
32
+ unsupportedInline: getInlineNodeViewProducer({
33
+ pmPluginFactoryParams: pmPluginFactoryParams,
34
+ Component: UnsupportedInlineNodeView,
35
+ extraComponentProps: {
36
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent
37
+ }
38
+ })
29
39
  }
30
40
  }
31
41
  });
@@ -4,10 +4,11 @@ var _templateObject;
4
4
 
5
5
  import { css } from '@emotion/react';
6
6
  import { SelectionStyle, getSelectionStyles, akEditorDeleteBackgroundWithOpacity, akEditorSelectedBorderSize, akEditorDeleteBorder, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
7
+ import { token } from '@atlaskit/tokens';
7
8
  export var UnsupportedSharedCssClassName = {
8
9
  BLOCK_CONTAINER: 'unsupportedBlockView-content-wrap',
9
10
  INLINE_CONTAINER: 'unsupportedInlineView-content-wrap'
10
11
  };
11
- var inlineUnsupportedSelector = ".".concat(UnsupportedSharedCssClassName.INLINE_CONTAINER, " > span");
12
+ var inlineUnsupportedSelector = ".".concat(UnsupportedSharedCssClassName.INLINE_CONTAINER, " > span:nth-child(2)");
12
13
  var blockUnsupportedSelector = ".".concat(UnsupportedSharedCssClassName.BLOCK_CONTAINER, " > div");
13
- export var unsupportedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ", ", " {\n cursor: pointer;\n }\n\n .", "", ",\n .", "", " {\n ", "\n }\n\n .danger {\n .", "", ",\n .", "", " {\n border: ", "px solid ", ";\n background-color: ", ";\n }\n }\n"])), blockUnsupportedSelector, inlineUnsupportedSelector, akEditorSelectedNodeClassName, blockUnsupportedSelector, akEditorSelectedNodeClassName, inlineUnsupportedSelector, getSelectionStyles([SelectionStyle.Background, SelectionStyle.Border]), akEditorSelectedNodeClassName, blockUnsupportedSelector, akEditorSelectedNodeClassName, inlineUnsupportedSelector, akEditorSelectedBorderSize, akEditorDeleteBorder, akEditorDeleteBackgroundWithOpacity);
14
+ export var unsupportedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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, akEditorSelectedNodeClassName, blockUnsupportedSelector, akEditorSelectedNodeClassName, inlineUnsupportedSelector, getSelectionStyles([SelectionStyle.Background, SelectionStyle.Border]), akEditorSelectedNodeClassName, blockUnsupportedSelector, akEditorSelectedNodeClassName, inlineUnsupportedSelector, akEditorSelectedBorderSize, token('color.border.danger', akEditorDeleteBorder), token('color.blanket.danger', akEditorDeleteBackgroundWithOpacity));
@@ -0,0 +1,7 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ import { UnsupportedInline } from '@atlaskit/editor-common/ui';
5
+ export var UnsupportedInlineNodeView = function UnsupportedInlineNodeView(props) {
6
+ return jsx(UnsupportedInline, props);
7
+ };
@@ -7,7 +7,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
8
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
9
9
 
10
- var _templateObject, _templateObject2;
10
+ var _templateObject, _templateObject2, _templateObject3;
11
11
 
12
12
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
13
13
 
@@ -22,7 +22,7 @@ import { createEditorContentStyle } from '../ContentStyles';
22
22
  import { pluginKey as maxContentSizePluginKey } from '../../plugins/max-content-size';
23
23
  import { scrollbarStyles } from '../styles';
24
24
  import WithFlash from '../WithFlash';
25
- var chromelessEditor = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n line-height: 20px;\n height: auto;\n min-height: 30px;\n\n overflow-x: hidden;\n overflow-y: auto;\n ", ";\n max-width: inherit;\n box-sizing: border-box;\n word-wrap: break-word;\n\n div > .ProseMirror {\n outline: none;\n white-space: pre-wrap;\n padding: 0;\n margin: 0;\n }\n"])), scrollbarStyles);
25
+ var chromelessEditor = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n line-height: 20px;\n height: auto;\n\n overflow-x: hidden;\n overflow-y: auto;\n ", ";\n max-width: inherit;\n box-sizing: border-box;\n word-wrap: break-word;\n\n div > .ProseMirror {\n outline: none;\n white-space: pre-wrap;\n padding: 0;\n margin: 0;\n }\n"])), scrollbarStyles);
26
26
  var ContentArea = createEditorContentStyle();
27
27
  ContentArea.displayName = 'ContentArea';
28
28
 
@@ -57,6 +57,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
57
57
  contentComponents = _this$props.contentComponents,
58
58
  customContentComponents = _this$props.customContentComponents,
59
59
  maxHeight = _this$props.maxHeight,
60
+ _this$props$minHeight = _this$props.minHeight,
61
+ minHeight = _this$props$minHeight === void 0 ? 30 : _this$props$minHeight,
60
62
  popupsMountPoint = _this$props.popupsMountPoint,
61
63
  popupsBoundariesElement = _this$props.popupsBoundariesElement,
62
64
  popupsScrollableElement = _this$props.popupsScrollableElement,
@@ -66,7 +68,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
66
68
  return jsx(WithFlash, {
67
69
  animate: maxContentSizeReached
68
70
  }, jsx("div", {
69
- css: [chromelessEditor, maxHeight && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n max-height: ", "px;\n "])), maxHeight)],
71
+ css: [chromelessEditor, maxHeight && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n max-height: ", "px;\n "])), maxHeight), css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n min-height: ", "px;\n "])), minHeight)],
72
+ "data-testid": "chromeless-editor",
70
73
  ref: function ref(_ref2) {
71
74
  return _this.containerElement = _ref2;
72
75
  }
@@ -7,7 +7,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
8
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
9
9
 
10
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
10
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
11
11
 
12
12
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
13
13
 
@@ -39,7 +39,7 @@ import { TableControlsPadding, MainToolbar, mainToolbarCustomComponentsSlotStyle
39
39
  import { createEditorContentStyle } from '../../ContentStyles';
40
40
  var CommentEditorMargin = 14;
41
41
  var CommentEditorSmallerMargin = 8;
42
- var commentEditorStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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 min-height: 150px;\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, N40, borderRadius());
42
+ var commentEditorStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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, N40, borderRadius());
43
43
  var ContentArea = createEditorContentStyle(css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\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_GUTTER, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, TableControlsPadding, tableCommentEditorStyles));
44
44
  ContentArea.displayName = 'ContentArea';
45
45
  var secondaryToolbarStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n box-sizing: border-box;\n justify-content: flex-end;\n align-items: center;\n display: flex;\n padding: 12px 1px;\n"])));
@@ -94,6 +94,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
94
94
  popupsBoundariesElement = _this$props.popupsBoundariesElement,
95
95
  popupsScrollableElement = _this$props.popupsScrollableElement,
96
96
  maxHeight = _this$props.maxHeight,
97
+ _this$props$minHeight = _this$props.minHeight,
98
+ minHeight = _this$props$minHeight === void 0 ? 150 : _this$props$minHeight,
97
99
  onSave = _this$props.onSave,
98
100
  onCancel = _this$props.onCancel,
99
101
  disabled = _this$props.disabled,
@@ -105,7 +107,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
105
107
  return jsx(WithFlash, {
106
108
  animate: maxContentSizeReached
107
109
  }, jsx("div", {
108
- css: commentEditorStyle,
110
+ css: [commentEditorStyle, css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n min-height: ", "px;\n "])), minHeight)],
109
111
  className: "akEditor"
110
112
  }, jsx(MainToolbar, {
111
113
  useStickyToolbar: useStickyToolbar
@@ -132,7 +134,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
132
134
  ref: function ref(_ref3) {
133
135
  return _this.containerElement = _ref3;
134
136
  },
135
- css: maxHeight ? css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n max-height: ", "px;\n "])), maxHeight) : null,
137
+ css: maxHeight ? css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n max-height: ", "px;\n "])), maxHeight) : null,
136
138
  className: classnames('ak-editor-content-area', {
137
139
  'less-margin': width < akEditorMobileBreakoutPoint
138
140
  })
@@ -6,4 +6,5 @@ import { css } from '@emotion/react';
6
6
  import { akEditorSubtleAccent, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
7
7
  import { borderRadius } from '@atlaskit/theme/constants';
8
8
  import { N300, N50 } from '@atlaskit/theme/colors';
9
- export var inputStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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"])), akEditorSubtleAccent, borderRadius(), relativeFontSizeToBase16(14), N300, N50);
9
+ import { token } from '@atlaskit/tokens';
10
+ export var inputStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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"])), token('color.border.input', akEditorSubtleAccent), borderRadius(), relativeFontSizeToBase16(14), N300, N50);
@@ -21,7 +21,7 @@ import { layoutStyles } from '../../plugins/layout/styles';
21
21
  import { panelStyles } from '../../plugins/panel/styles';
22
22
  import { fakeCursorStyles } from '../../plugins/fake-text-cursor/styles';
23
23
  import { mentionsStyles } from '../../plugins/mentions/styles';
24
- import { emojiStyles, emojiStylesNext } from '../../plugins/emoji/styles';
24
+ import { emojiStyles } from '../../plugins/emoji/styles';
25
25
  import { textFormattingStyles } from '../../plugins/text-formatting/styles';
26
26
  import { placeholderTextStyles } from '../../plugins/placeholder-text/styles';
27
27
  import { gridStyles } from '../../plugins/grid/styles';
@@ -39,11 +39,11 @@ import { useFeatureFlags } from '../../plugins/feature-flags-context';
39
39
  import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewProducer.styles';
40
40
 
41
41
  var contentStyles = function contentStyles(props) {
42
- var _props$featureFlags, _props$featureFlags2;
42
+ var _props$featureFlags;
43
43
 
44
44
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid #8cf;\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap,\n .pm-table-cell-content-wrap div.fabric-editor-block-mark {\n p:first-child {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), editorFontSize({
45
45
  theme: props.theme
46
- }), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, placeholderTextStyles, placeholderStyles, (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.codeBlockSyntaxHighlighting ? highlightingCodeBlockStyles(props) : codeBlockStyles(props), blocktypeStyles(props), textFormattingStyles(props), textColorStyles, listsStyles, ruleStyles(props), mediaStyles, layoutStyles, telepointerStyle, gapCursorStyles, tableStyles(props), panelStyles(props), fakeCursorStyles, mentionsStyles, (_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.nextEmojiNodeView ? emojiStylesNext : emojiStyles, tasksAndDecisionsStyles, gridStyles, linkStyles, blockMarksSharedStyles, dateSharedStyle, extensionStyles, expandStyles(props), findReplaceStyles, taskDecisionStyles, statusStyles, annotationSharedStyles(props), smartCardStyles, smartCardSharedStyles, dateStyles, embedCardStyles, unsupportedStyles, ClassNames.FLOATING_TOOLBAR_COMPONENT);
46
+ }), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, placeholderTextStyles, placeholderStyles, (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.codeBlockSyntaxHighlighting ? highlightingCodeBlockStyles(props) : codeBlockStyles(props), blocktypeStyles(props), textFormattingStyles(props), textColorStyles, listsStyles, ruleStyles(props), mediaStyles, layoutStyles, telepointerStyle, gapCursorStyles, tableStyles(props), panelStyles(props), fakeCursorStyles, mentionsStyles, emojiStyles, tasksAndDecisionsStyles, gridStyles, linkStyles, blockMarksSharedStyles, dateSharedStyle, extensionStyles, expandStyles(props), findReplaceStyles, taskDecisionStyles, statusStyles, annotationSharedStyles(props), smartCardStyles, smartCardSharedStyles, dateStyles, embedCardStyles, unsupportedStyles, ClassNames.FLOATING_TOOLBAR_COMPONENT);
47
47
  };
48
48
 
49
49
  export var createEditorContentStyle = function createEditorContentStyle(styles) {
@@ -0,0 +1,39 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import React from 'react';
3
+ import AtlaskitTheme from '@atlaskit/theme/components';
4
+ import { CHANNEL } from '@atlaskit/theme/constants';
5
+ import { ThemeProvider } from '@emotion/react';
6
+ import { ThemeProvider as DeprectateStyledComponentsProvider } from 'styled-components';
7
+ export function PortalProviderThemeProviders(props) {
8
+ var children = props.children,
9
+ mode = props.mode;
10
+ var styledComponentsAndEmotionTheme = React.useMemo( // This return value should only be one of the following
11
+ // - { [CHANNEL]: { mode },
12
+ // - { theme: { [CHANNEL]: { mode } }
13
+ // However, it appears that consumers have inconsistent expectations
14
+ // regarding the shape.
15
+ // This can be revisited in future work, and for the purposes of
16
+ // fixing https://product-fabric.atlassian.net/browse/ED-14956
17
+ // we are merging the two shapes consumers expect.
18
+ function () {
19
+ var _ref;
20
+
21
+ return _ref = {}, _defineProperty(_ref, CHANNEL, {
22
+ mode: mode
23
+ }), _defineProperty(_ref, "theme", _defineProperty({}, CHANNEL, {
24
+ mode: mode
25
+ })), _ref;
26
+ }, [mode]);
27
+ var atlaskitTheme = React.useCallback(function () {
28
+ return {
29
+ mode: mode
30
+ };
31
+ }, [mode]);
32
+ return /*#__PURE__*/React.createElement(DeprectateStyledComponentsProvider, {
33
+ theme: styledComponentsAndEmotionTheme
34
+ }, /*#__PURE__*/React.createElement(ThemeProvider, {
35
+ theme: styledComponentsAndEmotionTheme
36
+ }, /*#__PURE__*/React.createElement(AtlaskitTheme.Provider, {
37
+ value: atlaskitTheme
38
+ }, children)));
39
+ }
@@ -19,13 +19,15 @@ import PropTypes from 'prop-types';
19
19
  import { default as AnalyticsReactContext } from '@atlaskit/analytics-next-stable-react-context';
20
20
  import { EventDispatcher } from '../../event-dispatcher';
21
21
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../plugins/analytics/types/enums';
22
- import { injectIntl, RawIntlProvider } from 'react-intl-next';
22
+ import { useIntl, RawIntlProvider, injectIntl } from 'react-intl-next';
23
+ import { useGlobalTheme } from '@atlaskit/theme/components';
24
+ import { PortalProviderThemeProviders } from './PortalProviderThemesProvider';
23
25
  export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
24
26
  _inherits(PortalProviderAPI, _EventDispatcher);
25
27
 
26
28
  var _super = _createSuper(PortalProviderAPI);
27
29
 
28
- function PortalProviderAPI(intl, onAnalyticsEvent, analyticsContext) {
30
+ function PortalProviderAPI(intl, onAnalyticsEvent, analyticsContext, themeMode) {
29
31
  var _this;
30
32
 
31
33
  _classCallCheck(this, PortalProviderAPI);
@@ -41,14 +43,43 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
41
43
  _this.intl = intl;
42
44
  _this.onAnalyticsEvent = onAnalyticsEvent;
43
45
  _this.useAnalyticsContext = analyticsContext;
46
+ _this.themeMode = themeMode;
44
47
  return _this;
45
48
  }
46
49
 
47
50
  _createClass(PortalProviderAPI, [{
48
51
  key: "render",
49
52
  value: function render(children, container) {
53
+ var _this2 = this;
54
+
50
55
  var hasAnalyticsContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
51
56
  var hasIntlContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
57
+
58
+ if (this.themeMode) {
59
+ var childrenWithThemeProviders = function childrenWithThemeProviders() {
60
+ return /*#__PURE__*/React.createElement(PortalProviderThemeProviders, {
61
+ mode: _this2.themeMode
62
+ }, children());
63
+ };
64
+
65
+ this.portals.set(container, {
66
+ children: childrenWithThemeProviders,
67
+ hasAnalyticsContext: hasAnalyticsContext,
68
+ hasIntlContext: hasIntlContext
69
+ });
70
+
71
+ var _wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders()) : childrenWithThemeProviders();
72
+
73
+ if (hasIntlContext) {
74
+ _wrappedChildren = /*#__PURE__*/React.createElement(RawIntlProvider, {
75
+ value: this.intl
76
+ }, _wrappedChildren);
77
+ }
78
+
79
+ unstable_renderSubtreeIntoContainer(this.context, _wrappedChildren, container);
80
+ return;
81
+ }
82
+
52
83
  this.portals.set(container, {
53
84
  children: children,
54
85
  hasAnalyticsContext: hasAnalyticsContext,
@@ -70,28 +101,28 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
70
101
  }, {
71
102
  key: "forceUpdate",
72
103
  value: function forceUpdate(_ref) {
73
- var _this2 = this;
104
+ var _this3 = this;
74
105
 
75
106
  var intl = _ref.intl;
76
107
  this.intl = intl;
77
108
  this.portals.forEach(function (portal, container) {
78
- if (!portal.hasAnalyticsContext && !_this2.useAnalyticsContext && !portal.hasIntlContext) {
109
+ if (!portal.hasAnalyticsContext && !_this3.useAnalyticsContext && !portal.hasIntlContext) {
79
110
  return;
80
111
  }
81
112
 
82
113
  var wrappedChildren = portal.children();
83
114
 
84
- if (portal.hasAnalyticsContext && _this2.useAnalyticsContext) {
115
+ if (portal.hasAnalyticsContext && _this3.useAnalyticsContext) {
85
116
  wrappedChildren = /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, wrappedChildren);
86
117
  }
87
118
 
88
119
  if (portal.hasIntlContext) {
89
120
  wrappedChildren = /*#__PURE__*/React.createElement(RawIntlProvider, {
90
- value: _this2.intl
121
+ value: _this3.intl
91
122
  }, wrappedChildren);
92
123
  }
93
124
 
94
- unstable_renderSubtreeIntoContainer(_this2.context, wrappedChildren, container);
125
+ unstable_renderSubtreeIntoContainer(_this3.context, wrappedChildren, container);
95
126
  });
96
127
  }
97
128
  }, {
@@ -137,13 +168,13 @@ var BasePortalProvider = /*#__PURE__*/function (_React$Component) {
137
168
  var _super2 = _createSuper(BasePortalProvider);
138
169
 
139
170
  function BasePortalProvider(props) {
140
- var _this3;
171
+ var _this4;
141
172
 
142
173
  _classCallCheck(this, BasePortalProvider);
143
174
 
144
- _this3 = _super2.call(this, props);
145
- _this3.portalProviderAPI = new PortalProviderAPI(props.intl, props.onAnalyticsEvent, props.useAnalyticsContext);
146
- return _this3;
175
+ _this4 = _super2.call(this, props);
176
+ _this4.portalProviderAPI = new PortalProviderAPI(props.intl, props.onAnalyticsEvent, props.useAnalyticsContext, props.themeMode);
177
+ return _this4;
147
178
  }
148
179
 
149
180
  _createClass(BasePortalProvider, [{
@@ -166,30 +197,41 @@ var BasePortalProvider = /*#__PURE__*/function (_React$Component) {
166
197
  _defineProperty(BasePortalProvider, "displayName", 'PortalProvider');
167
198
 
168
199
  export var PortalProvider = injectIntl(BasePortalProvider);
200
+ export var PortalProviderWithThemeProviders = function PortalProviderWithThemeProviders(props) {
201
+ var intl = useIntl();
202
+ var globalTheme = useGlobalTheme();
203
+ return /*#__PURE__*/React.createElement(BasePortalProvider, {
204
+ intl: intl,
205
+ themeMode: globalTheme.mode,
206
+ onAnalyticsEvent: props.onAnalyticsEvent,
207
+ useAnalyticsContext: props.useAnalyticsContext,
208
+ render: props.render
209
+ });
210
+ };
169
211
  export var PortalRenderer = /*#__PURE__*/function (_React$Component2) {
170
212
  _inherits(PortalRenderer, _React$Component2);
171
213
 
172
214
  var _super3 = _createSuper(PortalRenderer);
173
215
 
174
216
  function PortalRenderer(props) {
175
- var _this4;
217
+ var _this5;
176
218
 
177
219
  _classCallCheck(this, PortalRenderer);
178
220
 
179
- _this4 = _super3.call(this, props);
221
+ _this5 = _super3.call(this, props);
180
222
 
181
- _defineProperty(_assertThisInitialized(_this4), "handleUpdate", function (portals) {
182
- return _this4.setState({
223
+ _defineProperty(_assertThisInitialized(_this5), "handleUpdate", function (portals) {
224
+ return _this5.setState({
183
225
  portals: portals
184
226
  });
185
227
  });
186
228
 
187
- props.portalProviderAPI.setContext(_assertThisInitialized(_this4));
188
- props.portalProviderAPI.on('update', _this4.handleUpdate);
189
- _this4.state = {
229
+ props.portalProviderAPI.setContext(_assertThisInitialized(_this5));
230
+ props.portalProviderAPI.on('update', _this5.handleUpdate);
231
+ _this5.state = {
190
232
  portals: new Map()
191
233
  };
192
- return _this4;
234
+ return _this5;
193
235
  }
194
236
 
195
237
  _createClass(PortalRenderer, [{