@atlaskit/renderer 84.0.0 → 86.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 (200) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/dist/cjs/actions/index.js +3 -3
  3. package/dist/cjs/analytics/enums.js +2 -0
  4. package/dist/cjs/analytics/unsupported-content.js +3 -3
  5. package/dist/cjs/messages.js +47 -1
  6. package/dist/cjs/react/hooks/use-observed-width.js +94 -0
  7. package/dist/cjs/react/index.js +15 -9
  8. package/dist/cjs/react/marks/annotation.js +2 -2
  9. package/dist/cjs/react/marks/breakout.js +5 -3
  10. package/dist/cjs/react/marks/textColor.js +15 -4
  11. package/dist/cjs/react/nodes/blockCard.js +2 -2
  12. package/dist/cjs/react/nodes/caption.js +2 -2
  13. package/dist/cjs/react/nodes/copy-text-provider.js +2 -1
  14. package/dist/cjs/react/nodes/date.js +6 -4
  15. package/dist/cjs/react/nodes/embedCard.js +5 -5
  16. package/dist/cjs/react/nodes/emoji.js +2 -2
  17. package/dist/cjs/react/nodes/extension.js +6 -4
  18. package/dist/cjs/react/nodes/heading-anchor.js +11 -3
  19. package/dist/cjs/react/nodes/index.js +80 -55
  20. package/dist/cjs/react/nodes/inlineCard.js +14 -3
  21. package/dist/cjs/react/nodes/layoutColumn.js +2 -2
  22. package/dist/cjs/react/nodes/media.js +5 -3
  23. package/dist/cjs/react/nodes/mediaGroup.js +2 -2
  24. package/dist/cjs/react/nodes/mediaInline.js +2 -2
  25. package/dist/cjs/react/nodes/mediaSingle/index.js +146 -152
  26. package/dist/cjs/react/nodes/mediaSingle/styles.js +2 -2
  27. package/dist/cjs/react/nodes/mention.js +2 -4
  28. package/dist/cjs/react/nodes/panel.js +18 -20
  29. package/dist/cjs/react/nodes/status.js +2 -1
  30. package/dist/cjs/react/nodes/table/colgroup.js +2 -2
  31. package/dist/cjs/react/nodes/table/sticky.js +4 -4
  32. package/dist/cjs/react/nodes/table.js +19 -13
  33. package/dist/cjs/react/nodes/tableCell.js +34 -21
  34. package/dist/cjs/react/nodes/tableRow.js +6 -4
  35. package/dist/cjs/react/nodes/task-item-with-providers.js +6 -2
  36. package/dist/cjs/react/nodes/taskItem.js +4 -3
  37. package/dist/cjs/render-document.js +40 -4
  38. package/dist/cjs/text/nodes/date.js +3 -3
  39. package/dist/cjs/types/smartLinksOptions.js +5 -0
  40. package/dist/cjs/ui/Expand.js +9 -9
  41. package/dist/cjs/ui/ExtensionRenderer.js +8 -4
  42. package/dist/cjs/ui/MediaCard.js +4 -4
  43. package/dist/cjs/ui/Renderer/breakout-ssr.js +50 -7
  44. package/dist/cjs/ui/Renderer/index.js +23 -18
  45. package/dist/cjs/ui/Renderer/style.js +8 -6
  46. package/dist/cjs/ui/SortingIcon.js +30 -17
  47. package/dist/cjs/ui/annotations/draft/component.js +2 -2
  48. package/dist/cjs/ui/annotations/element/index.js +2 -2
  49. package/dist/cjs/ui/annotations/element/mark.js +4 -4
  50. package/dist/cjs/ui/annotations/hooks/use-events.js +11 -11
  51. package/dist/cjs/ui/annotations/hooks/use-load-annotations.js +4 -4
  52. package/dist/cjs/utils.js +4 -3
  53. package/dist/cjs/version.json +1 -1
  54. package/dist/es2019/actions/index.js +1 -1
  55. package/dist/es2019/analytics/enums.js +2 -0
  56. package/dist/es2019/analytics/unsupported-content.js +1 -1
  57. package/dist/es2019/messages.js +44 -0
  58. package/dist/es2019/react/hooks/use-observed-width.js +59 -0
  59. package/dist/es2019/react/index.js +4 -1
  60. package/dist/es2019/react/marks/breakout.js +2 -1
  61. package/dist/es2019/react/marks/textColor.js +7 -4
  62. package/dist/es2019/react/nodes/blockCard.js +1 -1
  63. package/dist/es2019/react/nodes/caption.js +1 -1
  64. package/dist/es2019/react/nodes/copy-text-provider.js +2 -1
  65. package/dist/es2019/react/nodes/date.js +2 -1
  66. package/dist/es2019/react/nodes/embedCard.js +1 -1
  67. package/dist/es2019/react/nodes/emoji.js +1 -1
  68. package/dist/es2019/react/nodes/extension.js +2 -1
  69. package/dist/es2019/react/nodes/heading-anchor.js +11 -2
  70. package/dist/es2019/react/nodes/index.js +32 -7
  71. package/dist/es2019/react/nodes/inlineCard.js +12 -2
  72. package/dist/es2019/react/nodes/layoutColumn.js +1 -1
  73. package/dist/es2019/react/nodes/media.js +2 -1
  74. package/dist/es2019/react/nodes/mediaInline.js +1 -1
  75. package/dist/es2019/react/nodes/mediaSingle/index.js +132 -112
  76. package/dist/es2019/react/nodes/mediaSingle/styles.js +1 -1
  77. package/dist/es2019/react/nodes/mention.js +1 -3
  78. package/dist/es2019/react/nodes/panel.js +14 -12
  79. package/dist/es2019/react/nodes/status.js +2 -1
  80. package/dist/es2019/react/nodes/table/colgroup.js +1 -1
  81. package/dist/es2019/react/nodes/table/sticky.js +1 -1
  82. package/dist/es2019/react/nodes/table.js +4 -1
  83. package/dist/es2019/react/nodes/tableCell.js +22 -10
  84. package/dist/es2019/react/nodes/tableRow.js +2 -1
  85. package/dist/es2019/react/nodes/task-item-with-providers.js +3 -1
  86. package/dist/es2019/react/nodes/taskItem.js +2 -1
  87. package/dist/es2019/render-document.js +37 -3
  88. package/dist/es2019/text/nodes/date.js +1 -1
  89. package/dist/es2019/types/smartLinksOptions.js +1 -0
  90. package/dist/es2019/ui/Expand.js +1 -1
  91. package/dist/es2019/ui/ExtensionRenderer.js +3 -1
  92. package/dist/es2019/ui/MediaCard.js +1 -1
  93. package/dist/es2019/ui/Renderer/breakout-ssr.js +46 -5
  94. package/dist/es2019/ui/Renderer/index.js +4 -1
  95. package/dist/es2019/ui/Renderer/style.js +3 -1
  96. package/dist/es2019/ui/SortingIcon.js +23 -11
  97. package/dist/es2019/ui/annotations/draft/component.js +1 -1
  98. package/dist/es2019/ui/annotations/element/index.js +1 -1
  99. package/dist/es2019/ui/annotations/element/mark.js +1 -1
  100. package/dist/es2019/ui/annotations/hooks/use-events.js +1 -1
  101. package/dist/es2019/ui/annotations/hooks/use-load-annotations.js +1 -1
  102. package/dist/es2019/version.json +1 -1
  103. package/dist/esm/actions/index.js +1 -1
  104. package/dist/esm/analytics/enums.js +2 -0
  105. package/dist/esm/analytics/unsupported-content.js +1 -1
  106. package/dist/esm/messages.js +44 -0
  107. package/dist/esm/react/hooks/use-observed-width.js +80 -0
  108. package/dist/esm/react/index.js +8 -4
  109. package/dist/esm/react/marks/annotation.js +2 -2
  110. package/dist/esm/react/marks/breakout.js +2 -1
  111. package/dist/esm/react/marks/textColor.js +8 -4
  112. package/dist/esm/react/nodes/blockCard.js +1 -1
  113. package/dist/esm/react/nodes/caption.js +1 -1
  114. package/dist/esm/react/nodes/copy-text-provider.js +2 -1
  115. package/dist/esm/react/nodes/date.js +2 -1
  116. package/dist/esm/react/nodes/embedCard.js +1 -1
  117. package/dist/esm/react/nodes/emoji.js +1 -1
  118. package/dist/esm/react/nodes/extension.js +2 -1
  119. package/dist/esm/react/nodes/heading-anchor.js +12 -3
  120. package/dist/esm/react/nodes/index.js +62 -7
  121. package/dist/esm/react/nodes/inlineCard.js +12 -2
  122. package/dist/esm/react/nodes/layoutColumn.js +1 -1
  123. package/dist/esm/react/nodes/media.js +2 -1
  124. package/dist/esm/react/nodes/mediaGroup.js +2 -2
  125. package/dist/esm/react/nodes/mediaInline.js +1 -1
  126. package/dist/esm/react/nodes/mediaSingle/index.js +140 -141
  127. package/dist/esm/react/nodes/mediaSingle/styles.js +1 -1
  128. package/dist/esm/react/nodes/mention.js +1 -3
  129. package/dist/esm/react/nodes/panel.js +14 -12
  130. package/dist/esm/react/nodes/status.js +2 -1
  131. package/dist/esm/react/nodes/table/colgroup.js +1 -1
  132. package/dist/esm/react/nodes/table/sticky.js +1 -1
  133. package/dist/esm/react/nodes/table.js +4 -1
  134. package/dist/esm/react/nodes/tableCell.js +19 -9
  135. package/dist/esm/react/nodes/tableRow.js +2 -1
  136. package/dist/esm/react/nodes/task-item-with-providers.js +5 -2
  137. package/dist/esm/react/nodes/taskItem.js +2 -1
  138. package/dist/esm/render-document.js +36 -3
  139. package/dist/esm/text/nodes/date.js +1 -1
  140. package/dist/esm/types/smartLinksOptions.js +1 -0
  141. package/dist/esm/ui/Expand.js +1 -1
  142. package/dist/esm/ui/ExtensionRenderer.js +3 -1
  143. package/dist/esm/ui/MediaCard.js +3 -3
  144. package/dist/esm/ui/Renderer/breakout-ssr.js +48 -5
  145. package/dist/esm/ui/Renderer/index.js +6 -3
  146. package/dist/esm/ui/Renderer/style.js +4 -3
  147. package/dist/esm/ui/SortingIcon.js +21 -11
  148. package/dist/esm/ui/annotations/draft/component.js +1 -1
  149. package/dist/esm/ui/annotations/element/index.js +1 -1
  150. package/dist/esm/ui/annotations/element/mark.js +3 -3
  151. package/dist/esm/ui/annotations/hooks/use-events.js +3 -3
  152. package/dist/esm/ui/annotations/hooks/use-load-annotations.js +3 -3
  153. package/dist/esm/utils.js +3 -2
  154. package/dist/esm/version.json +1 -1
  155. package/dist/types/actions/index.d.ts +1 -1
  156. package/dist/types/analytics/enums.d.ts +3 -1
  157. package/dist/types/analytics/events.d.ts +9 -2
  158. package/dist/types/analytics/unsupported-content.d.ts +1 -1
  159. package/dist/types/messages.d.ts +44 -0
  160. package/dist/types/react/hooks/use-observed-width.d.ts +3 -0
  161. package/dist/types/react/index.d.ts +6 -1
  162. package/dist/types/react/nodes/blockCard.d.ts +1 -1
  163. package/dist/types/react/nodes/bodiedExtension.d.ts +2 -1
  164. package/dist/types/react/nodes/codeBlock.d.ts +3 -3
  165. package/dist/types/react/nodes/embedCard.d.ts +1 -1
  166. package/dist/types/react/nodes/emoji.d.ts +1 -1
  167. package/dist/types/react/nodes/extension.d.ts +14 -13
  168. package/dist/types/react/nodes/index.d.ts +39 -15
  169. package/dist/types/react/nodes/inlineCard.d.ts +23 -21
  170. package/dist/types/react/nodes/inlineExtension.d.ts +2 -1
  171. package/dist/types/react/nodes/media.d.ts +2 -2
  172. package/dist/types/react/nodes/mediaGroup.d.ts +1 -1
  173. package/dist/types/react/nodes/mediaInline.d.ts +1 -1
  174. package/dist/types/react/nodes/mediaSingle/index.d.ts +3 -7
  175. package/dist/types/react/nodes/mediaSingle/styles.d.ts +1 -1
  176. package/dist/types/react/nodes/mention.d.ts +2 -2
  177. package/dist/types/react/nodes/panel.d.ts +3 -1
  178. package/dist/types/react/nodes/table/sticky.d.ts +1 -1
  179. package/dist/types/react/nodes/table.d.ts +22 -21
  180. package/dist/types/react/nodes/tableCell.d.ts +7 -60
  181. package/dist/types/react/nodes/tableRow.d.ts +1 -1
  182. package/dist/types/react/nodes/task-item-with-providers.d.ts +2 -1
  183. package/dist/types/react/nodes/taskItem.d.ts +1 -1
  184. package/dist/types/react/types.d.ts +3 -1
  185. package/dist/types/react/utils/getCardClickHandler.d.ts +1 -1
  186. package/dist/types/render-document.d.ts +1 -1
  187. package/dist/types/types/smartLinksOptions.d.ts +3 -0
  188. package/dist/types/ui/ExtensionRenderer.d.ts +3 -1
  189. package/dist/types/ui/MediaCard.d.ts +3 -2
  190. package/dist/types/ui/SortingIcon.d.ts +7 -4
  191. package/dist/types/ui/annotations/context.d.ts +1 -1
  192. package/dist/types/ui/annotations/element/mark.d.ts +1 -1
  193. package/dist/types/ui/annotations/hooks/use-events.d.ts +2 -1
  194. package/dist/types/ui/annotations/hooks/use-inline-comment-subscriber.d.ts +1 -1
  195. package/dist/types/ui/annotations/selection/mounter.d.ts +1 -1
  196. package/dist/types/ui/annotations/selection/range-validator.d.ts +1 -1
  197. package/dist/types/ui/annotations/types.d.ts +1 -1
  198. package/dist/types/ui/renderer-props.d.ts +8 -1
  199. package/dist/types/utils.d.ts +3 -1
  200. package/package.json +21 -22
@@ -9,7 +9,7 @@ import styled from 'styled-components';
9
9
  import { gridSize, fontSize } from '@atlaskit/theme/constants';
10
10
  import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
11
11
  import Tooltip from '@atlaskit/tooltip';
12
- import { expandMessages, sharedExpandStyles, WidthProvider, ExpandIconWrapper, ExpandLayoutWrapper, ClearNextSiblingMarginTop } from '@atlaskit/editor-common';
12
+ import { expandMessages, sharedExpandStyles, WidthProvider, ExpandIconWrapper, ExpandLayoutWrapper, ClearNextSiblingMarginTop } from '@atlaskit/editor-common/ui';
13
13
  import { akEditorLineHeight, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
14
14
  import { PLATFORM, MODE } from '../analytics/events';
15
15
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics/enums';
@@ -12,7 +12,9 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
12
12
 
13
13
  import React from 'react';
14
14
  import memoizeOne from 'memoize-one';
15
- import { getExtensionRenderer, WithProviders, getNodeRenderer } from '@atlaskit/editor-common';
15
+ import { getNodeRenderer } from '@atlaskit/editor-common/extensions';
16
+ import { WithProviders } from '@atlaskit/editor-common/provider-factory';
17
+ import { getExtensionRenderer } from '@atlaskit/editor-common/utils';
16
18
 
17
19
  var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
18
20
  _inherits(ExtensionRenderer, _React$Component);
@@ -11,9 +11,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
11
11
 
12
12
  var _templateObject;
13
13
 
14
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
14
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
15
 
16
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
16
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17
17
 
18
18
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
19
19
 
@@ -24,7 +24,7 @@ import { Component } from 'react';
24
24
  import { filter } from '@atlaskit/adf-utils';
25
25
  import { Card, CardLoading, CardError } from '@atlaskit/media-card';
26
26
  import { getMediaClient } from '@atlaskit/media-client';
27
- import { withImageLoader } from '@atlaskit/editor-common';
27
+ import { withImageLoader } from '@atlaskit/editor-common/utils';
28
28
  import styled from 'styled-components';
29
29
  var mediaIdentifierMap = new Map();
30
30
  export var getListOfIdentifiersFromDoc = function getListOfIdentifiersFromDoc(doc) {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { breakoutConsts } from '@atlaskit/editor-common';
2
+ import { breakoutConsts } from '@atlaskit/editor-common/utils';
3
3
  /**
4
4
  * Inline Script that updates breakout node width on client side,
5
5
  * before main JavaScript bundle is ready.
@@ -33,13 +33,16 @@ export function createBreakoutInlineScript(id, allowDynamicTextSizing) {
33
33
  export var breakoutInlineScriptContext = "\n var breakoutConsts = ".concat(JSON.stringify(breakoutConsts), ";\n breakoutConsts.mapBreakpointToLayoutMaxWidth = ").concat(breakoutConsts.mapBreakpointToLayoutMaxWidth.toString(), ";\n breakoutConsts.getBreakpoint = ").concat(breakoutConsts.getBreakpoint.toString(), ";\n breakoutConsts.calcBreakoutWidth = ").concat(breakoutConsts.calcBreakoutWidth.toString(), ";\n breakoutConsts.calcLineLength = ").concat(breakoutConsts.calcLineLength.toString(), ";\n breakoutConsts.calcWideWidth = ").concat(breakoutConsts.calcWideWidth.toString(), ";\n");
34
34
 
35
35
  function applyBreakoutAfterSSR(id, allowDynamicTextSizing, breakoutConsts) {
36
- function findUp(element, selector) {
36
+ var MEDIA_NODE_TYPE = 'mediaSingle';
37
+ var WIDE_LAYOUT_MODES = ['full-width', 'wide'];
38
+
39
+ function findUp(element, condition) {
37
40
  if (!element) {
38
41
  return;
39
42
  }
40
43
 
41
44
  while (element.parentElement) {
42
- if (element.parentElement.classList.contains(selector)) {
45
+ if (condition(element)) {
43
46
  return element.parentElement;
44
47
  }
45
48
 
@@ -47,7 +50,11 @@ function applyBreakoutAfterSSR(id, allowDynamicTextSizing, breakoutConsts) {
47
50
  }
48
51
  }
49
52
 
50
- var renderer = findUp(document.querySelector('[data-breakout-script-id="' + id + '"]'), 'ak-renderer-wrapper');
53
+ var renderer = findUp(document.querySelector('[data-breakout-script-id="' + id + '"]'), function (elem) {
54
+ var _elem$parentElement;
55
+
56
+ return !!((_elem$parentElement = elem.parentElement) !== null && _elem$parentElement !== void 0 && _elem$parentElement.classList.contains('ak-renderer-wrapper'));
57
+ });
51
58
 
52
59
  if (!renderer) {
53
60
  return;
@@ -64,7 +71,7 @@ function applyBreakoutAfterSSR(id, allowDynamicTextSizing, breakoutConsts) {
64
71
  var node = maybeNode;
65
72
  var mode = node.dataset.mode || node.dataset.layout || '';
66
73
 
67
- if (!mode || !['full-width', 'wide'].includes(mode)) {
74
+ if (!mode || !WIDE_LAYOUT_MODES.includes(mode)) {
68
75
  return;
69
76
  }
70
77
 
@@ -87,9 +94,45 @@ function applyBreakoutAfterSSR(id, allowDynamicTextSizing, breakoutConsts) {
87
94
  }
88
95
  }
89
96
  });
97
+ } else if (
98
+ /**
99
+ * The mutation observer is only called once per added node.
100
+ * The above condition only deals with direct children of <div class="ak-renderer-document" />
101
+ * When it is initially called on the direct children, not all the sub children have loaded.
102
+ * So nested media elements which are not immediately loaded as sub children are not availabe in the above conditional.
103
+ * Thus adding this conditional to deal with all meida elements directly.
104
+ */
105
+ item.target.dataset.nodeType === MEDIA_NODE_TYPE) {
106
+ applyMediaBreakout(item.target);
90
107
  }
91
108
  });
92
109
  });
110
+
111
+ var applyMediaBreakout = function applyMediaBreakout(card) {
112
+ // width was already set by another breakout script
113
+ if (card.style.width) {
114
+ return;
115
+ }
116
+
117
+ var tableParent = findUp(card, function (elem) {
118
+ return elem instanceof HTMLTableCellElement;
119
+ }); // only apply the breakout to media elements not nested inside table
120
+ // table sizing is not based on percentage width
121
+
122
+ if (tableParent) {
123
+ return;
124
+ }
125
+
126
+ var mode = card.dataset.mode || card.dataset.layout || '';
127
+ var width = card.dataset.width;
128
+
129
+ if (WIDE_LAYOUT_MODES.includes(mode)) {
130
+ card.style.width = '100%';
131
+ } else if (width) {
132
+ card.style.width = "".concat(width, "%");
133
+ }
134
+ };
135
+
93
136
  observer.observe(renderer, {
94
137
  childList: true,
95
138
  subtree: true
@@ -7,9 +7,9 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
7
7
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
9
 
10
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
10
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
11
 
12
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
12
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
13
 
14
14
  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); }; }
15
15
 
@@ -19,7 +19,9 @@ import React, { useContext, useLayoutEffect, useRef } from 'react';
19
19
  import { PureComponent } from 'react';
20
20
  import { getSchemaBasedOnStage } from '@atlaskit/adf-schema';
21
21
  import { reduce } from '@atlaskit/adf-utils';
22
- import { UnsupportedBlock, ProviderFactory, BaseTheme, WidthProvider, getAnalyticsAppearance, getAnalyticsEventSeverity, WithCreateAnalyticsEvent, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking, IntlNextErrorBoundary, LegacyToNextIntlProvider, IntlLegacyFallbackProvider } from '@atlaskit/editor-common';
22
+ import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
23
+ import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent, LegacyToNextIntlProvider, IntlLegacyFallbackProvider, IntlNextErrorBoundary } from '@atlaskit/editor-common/ui';
24
+ import { getAnalyticsAppearance, getAnalyticsEventSeverity, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking } from '@atlaskit/editor-common/utils';
23
25
  import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
24
26
  import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
25
27
  import { IframeWidthObserverFallbackWrapper, IframeWrapperConsumer } from '@atlaskit/width-detector';
@@ -206,6 +208,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
206
208
  allowMediaLinking: props.media && props.media.allowLinking,
207
209
  surroundTextNodesWithTextWrapper: allowAnnotationsDraftMode,
208
210
  media: props.media,
211
+ smartLinks: props.smartLinks,
209
212
  allowCopyToClipboard: props.allowCopyToClipboard,
210
213
  allowCustomPanels: props.allowCustomPanels,
211
214
  allowAnnotations: props.allowAnnotations,
@@ -7,7 +7,8 @@ import { themed } from '@atlaskit/theme/components';
7
7
  import { gridSize, fontFamily, fontSize, borderRadius } from '@atlaskit/theme/constants';
8
8
  import * as colors from '@atlaskit/theme/colors';
9
9
  import { headingSizes as headingSizesImport } from '@atlaskit/theme/typography';
10
- import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, panelSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, shadowClassNames, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, smartCardSharedStyles, tableCellPadding } from '@atlaskit/editor-common';
10
+ import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, panelSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, smartCardSharedStyles, tableCellPadding, textColorStyles } from '@atlaskit/editor-common/styles';
11
+ import { shadowClassNames } from '@atlaskit/editor-common/ui';
11
12
  import { editorFontSize, blockNodesVerticalMargin, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableBorder, akEditorTableBorderDark, akEditorTableNumberColumnWidth, gridMediumMaxWidth, akEditorFullWidthLayoutWidth, akEditorStickyHeaderZIndex, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
12
13
  import { RendererCssClassName } from '../../consts';
13
14
  import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
@@ -91,10 +92,10 @@ var fullWidthStyles = function fullWidthStyles(_ref4) {
91
92
  }; // prettier-ignore
92
93
 
93
94
 
94
- export var Wrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + .rich-media-wrapped + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n\n ", "\n\n .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after, &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-child {\n height: 100%;\n\n td, th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid ", ";\n border-bottom: 1px solid ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th, .sticky td {\n box-shadow: 0px 1px ", ", 0px -0.5px ", ", inset -1px 0px ", ", 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n\n &:hover button.copy-to-clipboard, .copy-to-clipboard:focus{\n opacity: 1;\n position: absolute;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n }\n }\n\n ", ";\n & [data-layout-section] {\n margin-top: ", "px;\n & > div + div {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n }\n"])), editorFontSize, themed({
95
+ export var Wrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + .rich-media-wrapped + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n\n ", "\n\n .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after, &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-child {\n height: 100%;\n\n td, th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid ", ";\n border-bottom: 1px solid ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th, .sticky td {\n box-shadow: 0px 1px ", ", 0px -0.5px ", ", inset -1px 0px ", ", 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n\n &:hover button.copy-to-clipboard, .copy-to-clipboard:focus{\n opacity: 1;\n position: absolute;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n }\n }\n\n ", ";\n & [data-layout-section] {\n margin-top: ", "px;\n & > div + div {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n }\n"])), editorFontSize, themed({
95
96
  light: colors.N800,
96
97
  dark: '#B8C7E0'
97
- }), fullPageStyles, fullWidthStyles, headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), colors.B400, colors.B300, colors.placeholderText, whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles, panelSharedStyles, ruleSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, tasksAndDecisionsStyles, smartCardSharedStyles, fontFamily(), relativeFontSizeToBase16(fontSize()), themed({
98
+ }), fullPageStyles, fullWidthStyles, headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), colors.B400, colors.B300, colors.placeholderText, whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles, panelSharedStyles, ruleSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, tasksAndDecisionsStyles, smartCardSharedStyles, fontFamily(), relativeFontSizeToBase16(fontSize()), themed({
98
99
  light: colors.N30A,
99
100
  dark: colors.DN70
100
101
  }), borderRadius(), themed({
@@ -4,10 +4,12 @@ var _templateObject, _templateObject2;
4
4
 
5
5
  import React from 'react';
6
6
  import styled from 'styled-components';
7
- import { SortOrder } from '@atlaskit/editor-common';
8
7
  import Tooltip from '@atlaskit/tooltip';
9
8
  import { gridSize } from '@atlaskit/theme/constants';
10
- import { N20, N30 } from '@atlaskit/theme/colors'; // We use data url here because of this issue:
9
+ import { N20, N30 } from '@atlaskit/theme/colors';
10
+ import { SortOrder } from '@atlaskit/editor-common/types';
11
+ import { sortingIconMessages } from '../messages';
12
+ import { injectIntl } from 'react-intl-next'; // We use data url here because of this issue:
11
13
  // https://product-fabric.atlassian.net/browse/ED-8001
12
14
  // Remove this workaround if Firefox has fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=1664350
13
15
 
@@ -38,29 +40,37 @@ var getClassName = function getClassName(status) {
38
40
  }
39
41
  };
40
42
 
41
- var getTooltipTitle = function getTooltipTitle(status) {
43
+ var getTooltipTitle = function getTooltipTitle(intl, isSortingAllowed, status) {
44
+ var noOrderLabel = sortingIconMessages.noOrderLabel,
45
+ ascOrderLabel = sortingIconMessages.ascOrderLabel,
46
+ descOrderLabel = sortingIconMessages.descOrderLabel,
47
+ invalidLabel = sortingIconMessages.invalidLabel;
48
+
49
+ if (!isSortingAllowed) {
50
+ return intl.formatMessage(invalidLabel);
51
+ }
52
+
42
53
  switch (status) {
43
54
  case SortOrder.NO_ORDER:
44
- return 'Sort column A to Z';
55
+ return intl.formatMessage(noOrderLabel);
45
56
 
46
57
  case SortOrder.ASC:
47
- return 'Sort column Z to A';
58
+ return intl.formatMessage(ascOrderLabel);
48
59
 
49
60
  case SortOrder.DESC:
50
- return 'Clear sorting';
61
+ return intl.formatMessage(descOrderLabel);
51
62
  }
52
63
 
53
64
  return '';
54
65
  };
55
66
 
56
- var notAllowedTooltip = "\u26A0\uFE0F You can't sort a table with merged cell";
57
-
58
67
  var SortingIcon = function SortingIcon(_ref) {
59
68
  var isSortingAllowed = _ref.isSortingAllowed,
60
- sortOrdered = _ref.sortOrdered;
69
+ sortOrdered = _ref.sortOrdered,
70
+ intl = _ref.intl;
61
71
  var activated = sortOrdered !== SortOrder.NO_ORDER;
62
72
  var wrapperClassName = !isSortingAllowed ? StatusClassNames.SORTING_NOT_ALLOWED : '';
63
- var content = isSortingAllowed ? getTooltipTitle(sortOrdered) : notAllowedTooltip;
73
+ var content = getTooltipTitle(intl, isSortingAllowed, sortOrdered);
64
74
  return /*#__PURE__*/React.createElement(Tooltip, {
65
75
  delay: 0,
66
76
  content: content,
@@ -72,4 +82,4 @@ var SortingIcon = function SortingIcon(_ref) {
72
82
  })));
73
83
  };
74
84
 
75
- export default SortingIcon;
85
+ export default injectIntl(SortingIcon);
@@ -10,7 +10,7 @@ import { splitText, calcTextSplitOffset } from './text';
10
10
  import { calcInsertDraftPositionOnText } from './position';
11
11
  import { dataAttributes } from './dom';
12
12
  import styled from 'styled-components';
13
- import { AnnotationSharedCSSByState } from '@atlaskit/editor-common';
13
+ import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
14
14
  var DraftAnnotation = styled.mark(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n\n ", ";\n"])), AnnotationSharedCSSByState.focus);
15
15
  export var AnnotationDraft = function AnnotationDraft(_ref) {
16
16
  var draftPosition = _ref.draftPosition,
@@ -3,7 +3,7 @@ import { AnnotationMarkStates } from '@atlaskit/adf-schema';
3
3
  import { MarkComponent } from './mark';
4
4
  import { useInlineCommentSubscriberContext, useHasFocusEvent, useInlineCommentsFilter } from '../hooks';
5
5
  import { InlineCommentsStateContext } from '../context';
6
- import { AnnotationUpdateEvent } from '@atlaskit/editor-common';
6
+ import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
7
7
 
8
8
  var MarkElement = function MarkElement(_ref) {
9
9
  var annotationParentIds = _ref.annotationParentIds,
@@ -5,12 +5,12 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
5
5
 
6
6
  var _templateObject;
7
7
 
8
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
8
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
9
 
10
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
10
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
11
 
12
12
  import React, { useMemo, useCallback } from 'react';
13
- import { AnnotationSharedCSSByState } from '@atlaskit/editor-common';
13
+ import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
14
14
  import { AnnotationMarkStates } from '@atlaskit/adf-schema';
15
15
  import styled from 'styled-components';
16
16
  var MarkStyled = styled.mark(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n\n &[data-mark-annotation-state='", "'] {\n ", ";\n\n &:focus,\n &[data-has-focus='true'] {\n ", ";\n }\n }\n"])), AnnotationMarkStates.ACTIVE, AnnotationSharedCSSByState.blur, AnnotationSharedCSSByState.focus);
@@ -1,12 +1,12 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
 
4
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
4
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
5
 
6
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
7
 
8
8
  import { useLayoutEffect, useState } from 'react';
9
- import { AnnotationUpdateEvent } from '@atlaskit/editor-common';
9
+ import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
10
10
  import { AnnotationTypes } from '@atlaskit/adf-schema';
11
11
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '../../../analytics/enums';
12
12
  import { FabricChannel } from '@atlaskit/analytics-listeners';
@@ -1,11 +1,11 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
 
3
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
4
 
5
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
5
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
6
 
7
7
  import { useContext, useEffect } from 'react';
8
- import { AnnotationUpdateEvent } from '@atlaskit/editor-common';
8
+ import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
9
9
  import { ProvidersContext } from '../context';
10
10
  import { RendererContext as ActionsContext } from '../../RendererActionsContext';
11
11
  export var useLoadAnnotations = function useLoadAnnotations(_ref) {
package/dist/esm/utils.js CHANGED
@@ -1,3 +1,4 @@
1
+ import _createClass from "@babel/runtime/helpers/createClass";
1
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
3
  import { defaultSchema } from '@atlaskit/adf-schema';
3
4
  import { JSONTransformer } from '@atlaskit/editor-json-transformer';
@@ -8,12 +9,12 @@ function createEncoder(parser, encoder) {
8
9
  };
9
10
  }
10
11
 
11
- export var ADFEncoder = function ADFEncoder(createTransformerWithSchema) {
12
+ export var ADFEncoder = /*#__PURE__*/_createClass(function ADFEncoder(createTransformerWithSchema) {
12
13
  _classCallCheck(this, ADFEncoder);
13
14
 
14
15
  var transformer = createTransformerWithSchema(defaultSchema);
15
16
  this.encode = createEncoder(transformer, new JSONTransformer());
16
- };
17
+ });
17
18
  export var getText = function getText(node) {
18
19
  return node.text || node.attrs && (node.attrs.text || node.attrs.shortName) || "[".concat(typeof node.type === 'string' ? node.type : node.type.name, "]");
19
20
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "84.0.0",
3
+ "version": "86.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { JSONDocNode } from '@atlaskit/editor-json-transformer';
3
- import { AnnotationActionResult, AnnotationByMatches } from '@atlaskit/editor-common';
3
+ import type { AnnotationActionResult, AnnotationByMatches } from '@atlaskit/editor-common/types';
4
4
  import { AnnotationTypes } from '@atlaskit/adf-schema';
5
5
  import { Node, Schema, Mark } from 'prosemirror-model';
6
6
  import { Step, RemoveMarkStep } from 'prosemirror-transform';
@@ -8,6 +8,7 @@ export declare enum ACTION {
8
8
  STARTED = "started",
9
9
  RENDERED = "rendered",
10
10
  CRASHED = "unhandledErrorCaught",
11
+ INVALID_PROSEMIRROR_DOCUMENT = "invalidProsemirrorDocument",
11
12
  SELECT_ALL_CAUGHT = "selectAllCaught",
12
13
  SELECT_ALL_ESCAPED = "selectAllEscaped",
13
14
  CLICKED = "clicked",
@@ -24,7 +25,8 @@ export declare enum ACTION {
24
25
  RESOLVED = "resolved",
25
26
  CREATE_NOT_ALLOWED = "createNotAllowed",
26
27
  UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED = "unsupportedContentLevelsTrackingSucceeded",
27
- UNSUPPORTED_CONTENT_LEVELS_TRACKING_ERRORED = "unsupportedContentLevelsTrackingErrored"
28
+ UNSUPPORTED_CONTENT_LEVELS_TRACKING_ERRORED = "unsupportedContentLevelsTrackingErrored",
29
+ MEDIA_LINK_TRANSFORMED = "mediaLinkTransformed"
28
30
  }
29
31
  export declare enum ACTION_SUBJECT {
30
32
  RENDERER = "renderer",
@@ -1,5 +1,7 @@
1
1
  import { ACTION, ACTION_SUBJECT, AEP, EVENT_TYPE, ACTION_SUBJECT_ID } from './enums';
2
- import { SortOrder, UnsupportedContentPayload, SEVERITY, UNSUPPORTED_CONTENT_LEVEL_SEVERITY } from '@atlaskit/editor-common';
2
+ import { SEVERITY, UNSUPPORTED_CONTENT_LEVEL_SEVERITY } from '@atlaskit/editor-common/utils';
3
+ import type { UnsupportedContentPayload } from '@atlaskit/editor-common/utils';
4
+ import { SortOrder } from '@atlaskit/editor-common/types';
3
5
  import { UnsupportedContentTooltipPayload } from '@atlaskit/editor-common/src/utils/analytics';
4
6
  export declare enum PLATFORM {
5
7
  NATIVE = "mobileNative",
@@ -27,6 +29,10 @@ export declare type ComponentCrashErrorAEP = AEP<ACTION.CRASHED, ACTION_SUBJECT.
27
29
  componentStack?: string;
28
30
  errorRethrown?: boolean;
29
31
  }, EVENT_TYPE.OPERATIONAL>;
32
+ declare type InvalidProsemirrorDocumentErrorAEP = AEP<ACTION.INVALID_PROSEMIRROR_DOCUMENT, ACTION_SUBJECT.RENDERER, ACTION_SUBJECT_ID, {
33
+ platform: PLATFORM.WEB;
34
+ errorStack?: string;
35
+ }, EVENT_TYPE.OPERATIONAL>;
30
36
  declare type RendererUnsupportedContentLevelsTrackingSucceeded = AEP<ACTION.UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED, ACTION_SUBJECT.RENDERER, undefined, {
31
37
  appearance?: string;
32
38
  platform: PLATFORM.WEB;
@@ -90,5 +96,6 @@ export declare enum RESOLVE_METHOD {
90
96
  ORPHANED = "orphaned"
91
97
  }
92
98
  export declare type AnnotationAEP = AEP<AnnotationActionType, ACTION_SUBJECT.ANNOTATION, ACTION_SUBJECT_ID.INLINE_COMMENT, AnnotationAEPAttributes, undefined>;
93
- export declare type AnalyticsEventPayload = RendererStartAEP | RendererRenderedAEP | ComponentCrashErrorAEP | RendererUnsupportedContentLevelsTrackingSucceeded | RendererUnsupportedContentLevelsTrackingErrored | RendererSelectAllCaughtAEP | RendererSelectAllEscapedAEP | HeadingAnchorLinkButtonAEP | AnchorLinkAEP | TableSortColumnNotAllowedAEP | TableSortColumnAEP | VisitLinkAEP | VisitMediaLinkAEP | ExpandAEP | UnsupportedContentPayload | UnsupportedContentTooltipPayload | AnnotationAEP | AnnotationDeleteAEP;
99
+ declare type MediaLnkTransformedAEP = AEP<ACTION.MEDIA_LINK_TRANSFORMED, ACTION_SUBJECT.RENDERER, undefined, undefined, EVENT_TYPE.OPERATIONAL>;
100
+ export declare type AnalyticsEventPayload = RendererStartAEP | RendererRenderedAEP | ComponentCrashErrorAEP | RendererUnsupportedContentLevelsTrackingSucceeded | RendererUnsupportedContentLevelsTrackingErrored | RendererSelectAllCaughtAEP | RendererSelectAllEscapedAEP | HeadingAnchorLinkButtonAEP | AnchorLinkAEP | TableSortColumnNotAllowedAEP | TableSortColumnAEP | VisitLinkAEP | VisitMediaLinkAEP | ExpandAEP | UnsupportedContentPayload | UnsupportedContentTooltipPayload | AnnotationAEP | AnnotationDeleteAEP | MediaLnkTransformedAEP | InvalidProsemirrorDocumentErrorAEP;
94
101
  export {};
@@ -1,4 +1,4 @@
1
- import { UnsupportedContentLevelsTracking } from '@atlaskit/editor-common';
1
+ import type { UnsupportedContentLevelsTracking } from '@atlaskit/editor-common/utils';
2
2
  import { AnalyticsEventPayload } from './events';
3
3
  declare type DispatchAnalyticsEvent = (event: AnalyticsEventPayload) => void;
4
4
  declare type DocumentData = {
@@ -14,6 +14,50 @@ export declare const headingAnchorLinkMessages: {
14
14
  defaultMessage: string;
15
15
  description: string;
16
16
  };
17
+ copyAriaLabel: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
22
+ };
23
+ export declare const tableCellMessages: {
24
+ noneSortingLabel: {
25
+ id: string;
26
+ defaultMessage: string;
27
+ description: string;
28
+ };
29
+ ascSortingLabel: {
30
+ id: string;
31
+ defaultMessage: string;
32
+ description: string;
33
+ };
34
+ descSortingLabel: {
35
+ id: string;
36
+ defaultMessage: string;
37
+ description: string;
38
+ };
39
+ };
40
+ export declare const sortingIconMessages: {
41
+ noOrderLabel: {
42
+ id: string;
43
+ defaultMessage: string;
44
+ description: string;
45
+ };
46
+ ascOrderLabel: {
47
+ id: string;
48
+ defaultMessage: string;
49
+ description: string;
50
+ };
51
+ descOrderLabel: {
52
+ id: string;
53
+ defaultMessage: string;
54
+ description: string;
55
+ };
56
+ invalidLabel: {
57
+ id: string;
58
+ defaultMessage: string;
59
+ description: string;
60
+ };
17
61
  };
18
62
  export declare const codeBlockCopyButtonMessages: {
19
63
  copyCodeToClipboard: {
@@ -0,0 +1,3 @@
1
+ declare type Rectangle = Omit<DOMRectReadOnly, 'toJSON'>;
2
+ export declare const useObservedWidth: (node?: Element | null | undefined, useObservedWidthFlag?: boolean | undefined) => Rectangle;
3
+ export {};
@@ -4,9 +4,12 @@ import { Serializer } from '../';
4
4
  import { RendererAppearance, StickyHeaderConfig, HeadingAnchorLinksProps } from '../ui/Renderer/types';
5
5
  import { AnalyticsEventPayload } from '../analytics/events';
6
6
  import { TextWrapper } from './nodes';
7
- import { ProviderFactory, EventHandlers, ExtensionHandlers } from '@atlaskit/editor-common';
7
+ import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
8
+ import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
9
+ import type { EventHandlers } from '@atlaskit/editor-common/ui';
8
10
  import { RendererContext } from './types';
9
11
  import { MediaOptions } from '../types/mediaOptions';
12
+ import { SmartLinksOptions } from '../types/smartLinksOptions';
10
13
  export interface ReactSerializerInit {
11
14
  providers?: ProviderFactory;
12
15
  eventHandlers?: EventHandlers;
@@ -26,6 +29,7 @@ export interface ReactSerializerInit {
26
29
  allowMediaLinking?: boolean;
27
30
  surroundTextNodesWithTextWrapper?: boolean;
28
31
  media?: MediaOptions;
32
+ smartLinks?: SmartLinksOptions;
29
33
  allowCopyToClipboard?: boolean;
30
34
  allowPlaceholderText?: boolean;
31
35
  allowCustomPanels?: boolean;
@@ -70,6 +74,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
70
74
  private startPos;
71
75
  private surroundTextNodesWithTextWrapper;
72
76
  private media?;
77
+ private smartLinks?;
73
78
  private allowAnnotations;
74
79
  private allowSelectAllTrap?;
75
80
  constructor(init: ReactSerializerInit);
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { EventHandlers } from '@atlaskit/editor-common';
2
+ import type { EventHandlers } from '@atlaskit/editor-common/ui';
3
3
  import { RendererAppearance } from '../../ui/Renderer/types';
4
4
  export default function BlockCard(props: {
5
5
  url?: string;
@@ -3,7 +3,8 @@ import { Node as PMNode } from 'prosemirror-model';
3
3
  import { RendererContext } from '../types';
4
4
  import { Serializer } from '../..';
5
5
  import { ExtensionLayout } from '@atlaskit/adf-schema';
6
- import { ExtensionHandlers, ProviderFactory } from '@atlaskit/editor-common';
6
+ import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
7
+ import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
7
8
  export interface Props {
8
9
  serializer: Serializer<any>;
9
10
  extensionHandlers?: ExtensionHandlers;
@@ -14,11 +14,11 @@ declare const _default: import("styled-components").StyledComponentClass<(Pick<P
14
14
  forwardedRef?: ((instance: any) => void) | React.RefObject<any> | null | undefined;
15
15
  } & import("@atlaskit/theme").CustomThemeProps) | (Pick<Props & WrappedComponentProps<"intl">, "text" | "className" | "language" | "allowCopyToClipboard" | "codeBidiWarningTooltipEnabled"> & {
16
16
  forwardedRef?: ((instance: any) => void) | React.RefObject<any> | null | undefined;
17
- } & import("@atlaskit/theme").NoThemeProps), any, (Pick<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>, "text" | "className" | "forwardedRef" | "language" | "allowCopyToClipboard" | "codeBidiWarningTooltipEnabled"> & {
17
+ } & import("@atlaskit/theme").NoThemeProps), any, (Pick<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>, "text" | "className" | "language" | "allowCopyToClipboard" | "codeBidiWarningTooltipEnabled" | "forwardedRef"> & {
18
18
  theme?: any;
19
- } & import("@atlaskit/theme").AtlaskitThemeProps) | (Pick<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>, "text" | "className" | "forwardedRef" | "language" | "allowCopyToClipboard" | "codeBidiWarningTooltipEnabled"> & {
19
+ } & import("@atlaskit/theme").AtlaskitThemeProps) | (Pick<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>, "text" | "className" | "language" | "allowCopyToClipboard" | "codeBidiWarningTooltipEnabled" | "forwardedRef"> & {
20
20
  theme?: any;
21
- } & import("@atlaskit/theme").CustomThemeProps) | (Pick<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>, "text" | "className" | "forwardedRef" | "language" | "allowCopyToClipboard" | "codeBidiWarningTooltipEnabled"> & {
21
+ } & import("@atlaskit/theme").CustomThemeProps) | (Pick<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>, "text" | "className" | "language" | "allowCopyToClipboard" | "codeBidiWarningTooltipEnabled" | "forwardedRef"> & {
22
22
  theme?: any;
23
23
  } & import("@atlaskit/theme").NoThemeProps)>;
24
24
  export default _default;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { EventHandlers } from '@atlaskit/editor-common';
2
+ import type { EventHandlers } from '@atlaskit/editor-common/ui';
3
3
  import { RichMediaLayout } from '@atlaskit/adf-schema';
4
4
  import { RendererAppearance } from '../../ui/Renderer/types';
5
5
  export default function EmbedCard(props: {
@@ -1,6 +1,6 @@
1
1
  import { EmojiAttributes } from '@atlaskit/adf-schema';
2
2
  import { PureComponent } from 'react';
3
- import { ProviderFactory } from '@atlaskit/editor-common';
3
+ import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
4
4
  export interface EmojiProps extends EmojiAttributes {
5
5
  providers?: ProviderFactory;
6
6
  fitToHeight?: number;