@atlaskit/editor-common 59.1.0 → 60.3.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 (163) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/cjs/i18n/cs.js +1 -0
  3. package/dist/cjs/i18n/da.js +1 -0
  4. package/dist/cjs/i18n/de.js +1 -0
  5. package/dist/cjs/i18n/es.js +1 -0
  6. package/dist/cjs/i18n/fi.js +1 -0
  7. package/dist/cjs/i18n/fr.js +1 -0
  8. package/dist/cjs/i18n/hu.js +1 -0
  9. package/dist/cjs/i18n/it.js +1 -0
  10. package/dist/cjs/i18n/ja.js +1 -0
  11. package/dist/cjs/i18n/ko.js +1 -0
  12. package/dist/cjs/i18n/nb.js +1 -0
  13. package/dist/cjs/i18n/nl.js +1 -0
  14. package/dist/cjs/i18n/pl.js +1 -0
  15. package/dist/cjs/i18n/pt_BR.js +1 -0
  16. package/dist/cjs/i18n/ru.js +1 -0
  17. package/dist/cjs/i18n/sv.js +1 -0
  18. package/dist/cjs/i18n/th.js +1 -0
  19. package/dist/cjs/i18n/tr.js +1 -0
  20. package/dist/cjs/i18n/uk.js +1 -0
  21. package/dist/cjs/i18n/vi.js +1 -0
  22. package/dist/cjs/i18n/zh.js +1 -1
  23. package/dist/cjs/i18n/zh_TW.js +1 -0
  24. package/dist/cjs/index.js +6 -0
  25. package/dist/cjs/messages/codeBidiWarning.js +21 -0
  26. package/dist/cjs/messages/index.js +8 -0
  27. package/dist/cjs/styles/shared/panel.js +12 -2
  28. package/dist/cjs/styles/shared/table.js +1 -1
  29. package/dist/cjs/type-ahead/index.js +25 -0
  30. package/dist/cjs/types/{typeAhead.js → type-ahead.js} +0 -0
  31. package/dist/cjs/ufo/experience-store.js +159 -0
  32. package/dist/cjs/ufo/index.js +25 -0
  33. package/dist/cjs/ui/Messages/index.js +1 -3
  34. package/dist/cjs/utils/browser.js +7 -1
  35. package/dist/cjs/utils/index.js +9 -1
  36. package/dist/cjs/utils/profiler/render-count.js +135 -0
  37. package/dist/cjs/utils/validator.js +34 -11
  38. package/dist/cjs/version.json +1 -1
  39. package/dist/es2019/i18n/cs.js +1 -0
  40. package/dist/es2019/i18n/da.js +1 -0
  41. package/dist/es2019/i18n/de.js +1 -0
  42. package/dist/es2019/i18n/es.js +1 -0
  43. package/dist/es2019/i18n/fi.js +1 -0
  44. package/dist/es2019/i18n/fr.js +1 -0
  45. package/dist/es2019/i18n/hu.js +1 -0
  46. package/dist/es2019/i18n/it.js +1 -0
  47. package/dist/es2019/i18n/ja.js +1 -0
  48. package/dist/es2019/i18n/ko.js +1 -0
  49. package/dist/es2019/i18n/nb.js +1 -0
  50. package/dist/es2019/i18n/nl.js +1 -0
  51. package/dist/es2019/i18n/pl.js +1 -0
  52. package/dist/es2019/i18n/pt_BR.js +1 -0
  53. package/dist/es2019/i18n/ru.js +1 -0
  54. package/dist/es2019/i18n/sv.js +1 -0
  55. package/dist/es2019/i18n/th.js +1 -0
  56. package/dist/es2019/i18n/tr.js +1 -0
  57. package/dist/es2019/i18n/uk.js +1 -0
  58. package/dist/es2019/i18n/vi.js +1 -0
  59. package/dist/es2019/i18n/zh.js +1 -1
  60. package/dist/es2019/i18n/zh_TW.js +1 -0
  61. package/dist/es2019/index.js +1 -1
  62. package/dist/es2019/messages/codeBidiWarning.js +12 -0
  63. package/dist/es2019/messages/index.js +1 -0
  64. package/dist/es2019/styles/shared/panel.js +19 -2
  65. package/dist/es2019/styles/shared/table.js +1 -1
  66. package/dist/es2019/type-ahead/index.js +17 -0
  67. package/dist/es2019/types/{typeAhead.js → type-ahead.js} +0 -0
  68. package/dist/es2019/ufo/experience-store.js +115 -0
  69. package/dist/es2019/ufo/index.js +1 -0
  70. package/dist/es2019/ui/Messages/index.js +1 -2
  71. package/dist/es2019/utils/browser.js +7 -1
  72. package/dist/es2019/utils/index.js +2 -1
  73. package/dist/es2019/utils/profiler/render-count.js +107 -0
  74. package/dist/es2019/utils/validator.js +25 -0
  75. package/dist/es2019/version.json +1 -1
  76. package/dist/esm/i18n/cs.js +1 -0
  77. package/dist/esm/i18n/da.js +1 -0
  78. package/dist/esm/i18n/de.js +1 -0
  79. package/dist/esm/i18n/es.js +1 -0
  80. package/dist/esm/i18n/fi.js +1 -0
  81. package/dist/esm/i18n/fr.js +1 -0
  82. package/dist/esm/i18n/hu.js +1 -0
  83. package/dist/esm/i18n/it.js +1 -0
  84. package/dist/esm/i18n/ja.js +1 -0
  85. package/dist/esm/i18n/ko.js +1 -0
  86. package/dist/esm/i18n/nb.js +1 -0
  87. package/dist/esm/i18n/nl.js +1 -0
  88. package/dist/esm/i18n/pl.js +1 -0
  89. package/dist/esm/i18n/pt_BR.js +1 -0
  90. package/dist/esm/i18n/ru.js +1 -0
  91. package/dist/esm/i18n/sv.js +1 -0
  92. package/dist/esm/i18n/th.js +1 -0
  93. package/dist/esm/i18n/tr.js +1 -0
  94. package/dist/esm/i18n/uk.js +1 -0
  95. package/dist/esm/i18n/vi.js +1 -0
  96. package/dist/esm/i18n/zh.js +1 -1
  97. package/dist/esm/i18n/zh_TW.js +1 -0
  98. package/dist/esm/index.js +1 -1
  99. package/dist/esm/messages/codeBidiWarning.js +12 -0
  100. package/dist/esm/messages/index.js +1 -0
  101. package/dist/esm/styles/shared/panel.js +10 -2
  102. package/dist/esm/styles/shared/table.js +1 -1
  103. package/dist/esm/type-ahead/index.js +17 -0
  104. package/dist/esm/types/{typeAhead.js → type-ahead.js} +0 -0
  105. package/dist/esm/ufo/experience-store.js +143 -0
  106. package/dist/esm/ufo/index.js +1 -0
  107. package/dist/esm/ui/Messages/index.js +1 -2
  108. package/dist/esm/utils/browser.js +7 -1
  109. package/dist/esm/utils/index.js +2 -1
  110. package/dist/esm/utils/profiler/render-count.js +123 -0
  111. package/dist/esm/utils/validator.js +34 -11
  112. package/dist/esm/version.json +1 -1
  113. package/dist/types/collab/types.d.ts +6 -0
  114. package/dist/types/extensions/extension-handlers.d.ts +3 -3
  115. package/dist/types/extensions/index.d.ts +1 -1
  116. package/dist/types/extensions/types/extension-handler.d.ts +2 -0
  117. package/dist/types/extensions/types/index.d.ts +1 -1
  118. package/dist/types/extensions.d.ts +1 -1
  119. package/dist/types/i18n/cs.d.ts +1 -0
  120. package/dist/types/i18n/da.d.ts +1 -0
  121. package/dist/types/i18n/de.d.ts +1 -0
  122. package/dist/types/i18n/es.d.ts +1 -0
  123. package/dist/types/i18n/fi.d.ts +1 -0
  124. package/dist/types/i18n/fr.d.ts +1 -0
  125. package/dist/types/i18n/hu.d.ts +1 -0
  126. package/dist/types/i18n/it.d.ts +1 -0
  127. package/dist/types/i18n/ja.d.ts +1 -0
  128. package/dist/types/i18n/ko.d.ts +1 -0
  129. package/dist/types/i18n/nb.d.ts +1 -0
  130. package/dist/types/i18n/nl.d.ts +1 -0
  131. package/dist/types/i18n/pl.d.ts +1 -0
  132. package/dist/types/i18n/pt_BR.d.ts +1 -0
  133. package/dist/types/i18n/ru.d.ts +1 -0
  134. package/dist/types/i18n/sv.d.ts +1 -0
  135. package/dist/types/i18n/th.d.ts +1 -0
  136. package/dist/types/i18n/tr.d.ts +1 -0
  137. package/dist/types/i18n/uk.d.ts +1 -0
  138. package/dist/types/i18n/vi.d.ts +1 -0
  139. package/dist/types/i18n/zh.d.ts +1 -0
  140. package/dist/types/i18n/zh_TW.d.ts +1 -0
  141. package/dist/types/index.d.ts +2 -2
  142. package/dist/types/messages/codeBidiWarning.d.ts +11 -0
  143. package/dist/types/messages/index.d.ts +1 -0
  144. package/dist/types/provider-factory/quick-insert-provider.d.ts +2 -2
  145. package/dist/types/provider-factory.d.ts +1 -1
  146. package/dist/types/styles/shared/panel.d.ts +5 -0
  147. package/dist/types/type-ahead/index.d.ts +12 -0
  148. package/dist/types/types/index.d.ts +1 -1
  149. package/dist/types/types/{typeAhead.d.ts → type-ahead.d.ts} +0 -0
  150. package/dist/types/ufo/experience-store.d.ts +32 -0
  151. package/dist/types/ufo/index.d.ts +1 -0
  152. package/dist/types/utils/browser.d.ts +3 -0
  153. package/dist/types/utils/index.d.ts +1 -0
  154. package/dist/types/utils/profiler/render-count.d.ts +50 -0
  155. package/package.json +20 -17
  156. package/type-ahead/package.json +7 -0
  157. package/ufo/package.json +7 -0
  158. package/dist/cjs/ui/Caption/index.test.js +0 -82
  159. package/dist/cjs/utils/performance/measure-tti.test.js +0 -183
  160. package/dist/es2019/ui/Caption/index.test.js +0 -73
  161. package/dist/es2019/utils/performance/measure-tti.test.js +0 -124
  162. package/dist/esm/ui/Caption/index.test.js +0 -73
  163. package/dist/esm/utils/performance/measure-tti.test.js +0 -174
@@ -0,0 +1,143 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
+ import { ExperiencePerformanceTypes, ExperienceTypes, UFOExperience } from '@atlaskit/ufo';
5
+ export var experienceConfig = {
6
+ type: ExperienceTypes.Operation,
7
+ performanceType: ExperiencePerformanceTypes.Custom,
8
+ platform: {
9
+ component: 'editor'
10
+ }
11
+ };
12
+ export var EditorExperience;
13
+
14
+ (function (EditorExperience) {
15
+ EditorExperience["loadEditor"] = "load";
16
+ EditorExperience["typing"] = "type";
17
+ EditorExperience["interaction"] = "interact";
18
+ })(EditorExperience || (EditorExperience = {}));
19
+
20
+ export var RELIABILITY_INTERVAL = 30000;
21
+ export var ExperienceStore = /*#__PURE__*/function () {
22
+ function ExperienceStore() {
23
+ _classCallCheck(this, ExperienceStore);
24
+
25
+ this.experiences = new Map();
26
+
27
+ for (var _i = 0, _Object$values = Object.values(EditorExperience); _i < _Object$values.length; _i++) {
28
+ var experienceId = _Object$values[_i];
29
+ var experience = new UFOExperience(experienceId, experienceConfig);
30
+ this.experiences.set(experienceId, experience);
31
+ }
32
+ }
33
+
34
+ _createClass(ExperienceStore, [{
35
+ key: "get",
36
+ value: function get(experienceId) {
37
+ return this.experiences.get(experienceId);
38
+ }
39
+ }, {
40
+ key: "getActive",
41
+ value: function getActive(experienceId) {
42
+ var experience = this.experiences.get(experienceId);
43
+
44
+ if (!(experience !== null && experience !== void 0 && experience.state.final)) {
45
+ return experience;
46
+ }
47
+ }
48
+ }, {
49
+ key: "getAll",
50
+ value: function getAll() {
51
+ return Array.from(this.experiences.values());
52
+ }
53
+ }, {
54
+ key: "start",
55
+ value: function start(experienceId, startTime) {
56
+ var _this$get;
57
+
58
+ (_this$get = this.get(experienceId)) === null || _this$get === void 0 ? void 0 : _this$get.start(startTime);
59
+ }
60
+ }, {
61
+ key: "addMetadata",
62
+ value: function addMetadata(experienceId, metadata) {
63
+ var _this$get2;
64
+
65
+ (_this$get2 = this.get(experienceId)) === null || _this$get2 === void 0 ? void 0 : _this$get2.addMetadata(metadata);
66
+ }
67
+ }, {
68
+ key: "mark",
69
+ value: function mark(experienceId, _mark, value) {
70
+ var _this$get3;
71
+
72
+ (_this$get3 = this.get(experienceId)) === null || _this$get3 === void 0 ? void 0 : _this$get3.mark(_mark, value);
73
+ }
74
+ }, {
75
+ key: "success",
76
+ value: function success(experienceId, metadata) {
77
+ var _this$getActive;
78
+
79
+ (_this$getActive = this.getActive(experienceId)) === null || _this$getActive === void 0 ? void 0 : _this$getActive.success({
80
+ metadata: metadata
81
+ });
82
+ }
83
+ }, {
84
+ key: "fail",
85
+ value: function fail(experienceId, metadata) {
86
+ var _this$getActive2;
87
+
88
+ (_this$getActive2 = this.getActive(experienceId)) === null || _this$getActive2 === void 0 ? void 0 : _this$getActive2.failure({
89
+ metadata: metadata
90
+ });
91
+ }
92
+ }, {
93
+ key: "abort",
94
+ value: function abort(experienceId, metadata) {
95
+ var _this = this;
96
+
97
+ // We add this wait in here because when React catches an error it unmounts the component
98
+ // before the error boundary's componentDidCatch is called
99
+ // In this case we want to fail the experience, but without this wait, abort is called first
100
+ setTimeout(function () {
101
+ var _this$getActive3;
102
+
103
+ (_this$getActive3 = _this.getActive(experienceId)) === null || _this$getActive3 === void 0 ? void 0 : _this$getActive3.abort({
104
+ metadata: metadata
105
+ });
106
+ }, 0);
107
+ }
108
+ }, {
109
+ key: "abortAll",
110
+ value: function abortAll(metadata) {
111
+ var _this2 = this;
112
+
113
+ this.experiences.forEach(function (experience) {
114
+ _this2.abort(experience.id, metadata);
115
+ });
116
+ }
117
+ }, {
118
+ key: "failAll",
119
+ value: function failAll(metadata) {
120
+ var _this3 = this;
121
+
122
+ this.experiences.forEach(function (experience) {
123
+ _this3.fail(experience.id, metadata);
124
+ });
125
+ }
126
+ }], [{
127
+ key: "getInstance",
128
+ value: function getInstance(view) {
129
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
130
+
131
+ if (!this.stores.get(view) || options !== null && options !== void 0 && options.forceNewInstance) {
132
+ var store = new ExperienceStore();
133
+ this.stores.set(view, store);
134
+ }
135
+
136
+ return this.stores.get(view);
137
+ }
138
+ }]);
139
+
140
+ return ExperienceStore;
141
+ }();
142
+
143
+ _defineProperty(ExperienceStore, "stores", new WeakMap());
@@ -0,0 +1 @@
1
+ export { ExperienceStore, EditorExperience, RELIABILITY_INTERVAL } from './experience-store';
@@ -8,7 +8,6 @@ import SuccessIcon from '@atlaskit/icon/glyph/editor/success';
8
8
  import ErrorIcon from '@atlaskit/icon/glyph/error';
9
9
  import { G400, N200, R400 } from '@atlaskit/theme/colors';
10
10
  import { gridSize } from '@atlaskit/theme/constants';
11
- import { multiply } from '@atlaskit/theme/math';
12
11
  import { h200 } from '@atlaskit/theme/typography';
13
12
  var Message = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", " font-weight: normal;\n color: ", ";\n margin-top: ", "px;\n display: flex;\n justify-content: baseline;\n"])), h200, function (props) {
14
13
  if (props.error) {
@@ -20,7 +19,7 @@ var Message = styled.div(_templateObject || (_templateObject = _taggedTemplateLi
20
19
  }
21
20
 
22
21
  return N200;
23
- }, multiply(gridSize, 0.5));
22
+ }, gridSize() / 2);
24
23
  var IconWrapper = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n margin-right: 4px;\n"])));
25
24
  export var HelperMessage = function HelperMessage(_ref) {
26
25
  var children = _ref.children;
@@ -7,7 +7,10 @@ var result = {
7
7
  chrome_version: 0,
8
8
  android: false,
9
9
  ios: false,
10
- webkit: false
10
+ webkit: false,
11
+ safari: false,
12
+ supportsIntersectionObserver: false,
13
+ supportsResizeObserver: false
11
14
  };
12
15
 
13
16
  if (typeof navigator !== 'undefined') {
@@ -23,6 +26,9 @@ if (typeof navigator !== 'undefined') {
23
26
  result.android = /Android \d/.test(navigator.userAgent);
24
27
  result.ios = !ie && /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent);
25
28
  result.webkit = !ie && !!document.documentElement && 'WebkitAppearance' in document.documentElement.style;
29
+ result.safari = Boolean(navigator.vendor && navigator.vendor.indexOf('Apple') > -1 && navigator.userAgent && navigator.userAgent.indexOf('CriOS') === -1 && navigator.userAgent.indexOf('FxiOS') === -1);
30
+ result.supportsIntersectionObserver = typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window && 'intersectionRatio' in window.IntersectionObserverEntry.prototype;
31
+ result.supportsResizeObserver = typeof window !== 'undefined' && 'ResizeObserver' in window && 'ResizeObserverEntry' in window;
26
32
  }
27
33
 
28
34
  export default result;
@@ -21,4 +21,5 @@ export { compose } from './compose';
21
21
  export { ZERO_WIDTH_SPACE } from './whitespace';
22
22
  export { shouldForceTracking } from './should-force-tracking';
23
23
  export { getModeFromTheme } from './getModeFromTheme';
24
- export { sniffUserBrowserExtensions } from './browser-extensions';
24
+ export { sniffUserBrowserExtensions } from './browser-extensions';
25
+ export { RenderCountProfiler } from './profiler/render-count';
@@ -0,0 +1,123 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/createClass";
4
+
5
+ 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; }
6
+
7
+ 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; }
8
+
9
+ export var PROFILER_KEY = '__editorRenderCountProfiler';
10
+ export var RenderCountProfiler = /*#__PURE__*/function () {
11
+ /**
12
+ * The singleton/cached instance of RenderCountProfiler that will be shared
13
+ * betweenRenderCountProfiler.getInstance() calls
14
+ */
15
+ function RenderCountProfiler(_ref) {
16
+ var store = _ref.store;
17
+
18
+ _classCallCheck(this, RenderCountProfiler);
19
+
20
+ this.store = store;
21
+ }
22
+ /**
23
+ * Returns the singleton/cached instance of RenderCountProfiler that
24
+ * currently exists. If it hasn't been instantiated yet, the singleton
25
+ * instance will be created using the given params. Returns the latest
26
+ * singleton/instance.
27
+ */
28
+
29
+
30
+ _createClass(RenderCountProfiler, [{
31
+ key: "getData",
32
+ value: function getData(profilerKey) {
33
+ var _this$store;
34
+
35
+ return (_this$store = this.store) === null || _this$store === void 0 ? void 0 : _this$store[profilerKey];
36
+ }
37
+ }, {
38
+ key: "enable",
39
+ value: function enable() {
40
+ this.store[PROFILER_KEY] = _objectSpread(_objectSpread({}, this.store[PROFILER_KEY]), {}, {
41
+ enabled: true
42
+ });
43
+ }
44
+ }, {
45
+ key: "remove",
46
+ value: function remove() {
47
+ delete this.store[PROFILER_KEY];
48
+ }
49
+ }, {
50
+ key: "isEnabled",
51
+ value: function isEnabled() {
52
+ var _this$store2, _this$store2$PROFILER;
53
+
54
+ return Boolean((_this$store2 = this.store) === null || _this$store2 === void 0 ? void 0 : (_this$store2$PROFILER = _this$store2[PROFILER_KEY]) === null || _this$store2$PROFILER === void 0 ? void 0 : _this$store2$PROFILER.enabled);
55
+ }
56
+ }, {
57
+ key: "setRenderCount",
58
+ value: function setRenderCount(_ref2) {
59
+ var componentId = _ref2.componentId,
60
+ renderCount = _ref2.renderCount,
61
+ instanceId = _ref2.instanceId;
62
+ var profilerData = this.store[PROFILER_KEY];
63
+ var instance = {
64
+ count: renderCount
65
+ };
66
+ var existingComponents = profilerData === null || profilerData === void 0 ? void 0 : profilerData.components;
67
+ var existingInstances = existingComponents === null || existingComponents === void 0 ? void 0 : existingComponents[componentId];
68
+
69
+ var updatedComponent = _objectSpread(_objectSpread({}, existingInstances), {}, _defineProperty({}, instanceId, instance));
70
+
71
+ this.store[PROFILER_KEY] = _objectSpread(_objectSpread({}, profilerData), {}, {
72
+ components: _objectSpread(_objectSpread({}, existingComponents), {}, _defineProperty({}, componentId, updatedComponent))
73
+ });
74
+ }
75
+ }, {
76
+ key: "getInstanceRenderCounters",
77
+ value: function getInstanceRenderCounters(_ref3) {
78
+ var _this$store$PROFILER_, _this$store3, _this$store3$PROFILER, _this$store3$PROFILER2;
79
+
80
+ var componentId = _ref3.componentId;
81
+ var component = (_this$store$PROFILER_ = (_this$store3 = this.store) === null || _this$store3 === void 0 ? void 0 : (_this$store3$PROFILER = _this$store3[PROFILER_KEY]) === null || _this$store3$PROFILER === void 0 ? void 0 : (_this$store3$PROFILER2 = _this$store3$PROFILER.components) === null || _this$store3$PROFILER2 === void 0 ? void 0 : _this$store3$PROFILER2[componentId]) !== null && _this$store$PROFILER_ !== void 0 ? _this$store$PROFILER_ : {};
82
+ var counters = [];
83
+
84
+ for (var _instanceId in component) {
85
+ var counter = {
86
+ instanceId: _instanceId,
87
+ count: component[_instanceId].count
88
+ };
89
+ counters.push(counter);
90
+ }
91
+
92
+ return counters;
93
+ }
94
+ }, {
95
+ key: "getRenderCount",
96
+ value: function getRenderCount(_ref4) {
97
+ var _this$store$PROFILER_2, _this$store4, _this$store4$PROFILER, _this$store4$PROFILER2;
98
+
99
+ var componentId = _ref4.componentId;
100
+ var component = (_this$store$PROFILER_2 = (_this$store4 = this.store) === null || _this$store4 === void 0 ? void 0 : (_this$store4$PROFILER = _this$store4[PROFILER_KEY]) === null || _this$store4$PROFILER === void 0 ? void 0 : (_this$store4$PROFILER2 = _this$store4$PROFILER.components) === null || _this$store4$PROFILER2 === void 0 ? void 0 : _this$store4$PROFILER2[componentId]) !== null && _this$store$PROFILER_2 !== void 0 ? _this$store$PROFILER_2 : {};
101
+ var total = 0;
102
+
103
+ for (var _instanceId2 in component) {
104
+ total += component[_instanceId2].count;
105
+ }
106
+
107
+ return total;
108
+ }
109
+ }], [{
110
+ key: "getInstance",
111
+ value: function getInstance(params) {
112
+ if (!RenderCountProfiler.instance) {
113
+ RenderCountProfiler.instance = new RenderCountProfiler({
114
+ store: params.store
115
+ });
116
+ }
117
+
118
+ return RenderCountProfiler.instance;
119
+ }
120
+ }]);
121
+
122
+ return RenderCountProfiler;
123
+ }();
@@ -358,21 +358,44 @@ export var getValidNode = function getValidNode(originalNode) {
358
358
  break;
359
359
  }
360
360
 
361
- case 'media':
361
+ case 'mediaInline':
362
362
  {
363
363
  var mediaId = '';
364
- var mediaType = '';
365
364
  var mediaCollection = [];
366
- var mediaUrl = '';
367
365
 
368
366
  if (attrs) {
369
367
  var id = attrs.id,
370
- collection = attrs.collection,
368
+ collection = attrs.collection;
369
+ mediaId = id;
370
+ mediaCollection = collection;
371
+ }
372
+
373
+ if (mediaId && mediaCollection && adfStage === 'stage0') {
374
+ return {
375
+ type: type,
376
+ attrs: attrs,
377
+ marks: marks
378
+ };
379
+ }
380
+
381
+ break;
382
+ }
383
+
384
+ case 'media':
385
+ {
386
+ var _mediaId = '';
387
+ var mediaType = '';
388
+ var _mediaCollection = [];
389
+ var mediaUrl = '';
390
+
391
+ if (attrs) {
392
+ var _id = attrs.id,
393
+ _collection = attrs.collection,
371
394
  _type = attrs.type,
372
395
  url = attrs.url;
373
- mediaId = id;
396
+ _mediaId = _id;
374
397
  mediaType = _type;
375
- mediaCollection = collection;
398
+ _mediaCollection = _collection;
376
399
  mediaUrl = url;
377
400
  }
378
401
 
@@ -392,11 +415,11 @@ export var getValidNode = function getValidNode(originalNode) {
392
415
  type: type,
393
416
  attrs: mediaAttrs
394
417
  };
395
- } else if (mediaId && mediaType) {
418
+ } else if (_mediaId && mediaType) {
396
419
  var _mediaAttrs = {
397
420
  type: mediaType,
398
- id: mediaId,
399
- collection: mediaCollection
421
+ id: _mediaId,
422
+ collection: _mediaCollection
400
423
  };
401
424
 
402
425
  if (attrs.width) {
@@ -465,10 +488,10 @@ export var getValidNode = function getValidNode(originalNode) {
465
488
  if (attrs) {
466
489
  var _text = attrs.text,
467
490
  displayName = attrs.displayName,
468
- _id = attrs.id,
491
+ _id2 = attrs.id,
469
492
  accessLevel = attrs.accessLevel;
470
493
  mentionText = _text || displayName;
471
- mentionId = _id;
494
+ mentionId = _id2;
472
495
  mentionAccess = accessLevel;
473
496
  }
474
497
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "59.1.0",
3
+ "version": "60.3.0",
4
4
  "sideEffects": false
5
5
  }
@@ -6,6 +6,7 @@ export interface CollabParticipant {
6
6
  avatar: string;
7
7
  name: string;
8
8
  email: string;
9
+ cursorPos?: number;
9
10
  }
10
11
  export interface CollabEventInitData {
11
12
  doc?: any;
@@ -22,6 +23,10 @@ export interface CollabEventRemoteData {
22
23
  export interface CollabEventConnectionData {
23
24
  sid: string;
24
25
  }
26
+ export interface CollabEventDisonnectedData {
27
+ sid: string;
28
+ reason: 'CLIENT_DISCONNECT' | 'SERVER_DISCONNECT' | 'SOCKET_CLOSED' | 'SOCKET_ERROR' | 'SOCKET_TIMEOUT' | 'UNKNOWN_DISCONNECT';
29
+ }
25
30
  export interface CollabEventPresenceData {
26
31
  joined?: CollabParticipant[];
27
32
  left?: {
@@ -45,6 +50,7 @@ export declare type CollabEvent = keyof CollabEventData;
45
50
  export interface CollabEventData {
46
51
  init: CollabEventInitData;
47
52
  connected: CollabEventConnectionData;
53
+ disconnected: CollabEventDisonnectedData;
48
54
  data: CollabEventRemoteData;
49
55
  telepointer: CollabEventTelepointerData;
50
56
  presence: CollabEventPresenceData;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import Loadable from 'react-loadable';
3
- import { ADFEntity } from '@atlaskit/adf-utils';
4
3
  import { ExtensionKey, ExtensionParams, ExtensionProvider, ExtensionType } from './types';
4
+ import { ReferenceEntity } from './types/extension-handler';
5
5
  export declare function getExtensionModuleNode(extensionProvider: ExtensionProvider, extensionType: ExtensionType, extensionKey: ExtensionKey): Promise<import("./types").ExtensionModuleNode<any>>;
6
6
  /**
7
7
  * Gets `__` prefixed properties from an extension node module definition
@@ -9,8 +9,8 @@ export declare function getExtensionModuleNode(extensionProvider: ExtensionProvi
9
9
  export declare function getExtensionModuleNodePrivateProps(extensionProvider: ExtensionProvider, extensionType: ExtensionType, extensionKey: ExtensionKey): Promise<any>;
10
10
  export declare function getNodeRenderer<T>(extensionProvider: ExtensionProvider, extensionType: ExtensionType, extensionKey: ExtensionKey): (React.ComponentClass<{
11
11
  node: ExtensionParams<T>;
12
- refNode?: ADFEntity | undefined;
12
+ references?: ReferenceEntity[] | undefined;
13
13
  }, any> & Loadable.LoadableComponent) | (React.FunctionComponent<{
14
14
  node: ExtensionParams<T>;
15
- refNode?: ADFEntity | undefined;
15
+ references?: ReferenceEntity[] | undefined;
16
16
  }> & Loadable.LoadableComponent);
@@ -1,5 +1,5 @@
1
1
  export { isFieldset, isTabGroup, isExpand, isDateRange } from './types';
2
- export type { Extension, ExtensionAutoConvertHandler, ExtensionComponentProps, ExtensionHandler, ExtensionHandlers, ExtensionKey, ExtensionManifest, ExtensionModule, ExtensionModuleAction, ExtensionModuleActionHandler, ExtensionModuleActionObject, ExtensionModuleNode, ExtensionModuleNodes, ExtensionModules, ExtensionParams, ExtensionProvider, ExtensionQuickInsertModule, ExtensionType, ExtensionToolbarButton, ContextualToolbar, ToolbarItem, Icon, MaybeADFEntity, MenuItem, MenuItemMap, UpdateExtension, Parameters, ParametersWithDuplicateFields, BooleanField, CustomField, CustomFieldResolver, UserFieldContext, UserField, UserFieldContextProvider, ColorField, DateField, DateRangeField, DateRangeResult, EnumField, EnumCheckboxField, EnumRadioField, EnumSelectField, ExpandField, FieldDefinition, DynamicFieldDefinitions, Fieldset, GroupingField, NativeField, NestedFieldDefinition, NumberField, Option, StringField, StringOneLineField, StringMultilineField, TabGroupField, TabField, FieldHandlerLink, OnSaveCallback, ExtensionAPI, TransformBefore, TransformAfter, ParametersGetter, AsyncParametersGetter, } from './types';
2
+ export type { Extension, ExtensionAutoConvertHandler, ExtensionComponentProps, ExtensionHandler, ExtensionHandlers, ExtensionKey, ExtensionManifest, ExtensionModule, ExtensionModuleAction, ExtensionModuleActionHandler, ExtensionModuleActionObject, ExtensionModuleNode, ExtensionModuleNodes, ExtensionModules, ExtensionParams, ExtensionProvider, ExtensionQuickInsertModule, ExtensionType, ExtensionToolbarButton, ContextualToolbar, ToolbarItem, Icon, MaybeADFEntity, MenuItem, MenuItemMap, UpdateExtension, Parameters, ParametersWithDuplicateFields, BooleanField, CustomField, CustomFieldResolver, UserFieldContext, UserField, UserFieldContextProvider, ColorField, DateField, DateRangeField, DateRangeResult, EnumField, EnumCheckboxField, EnumRadioField, EnumSelectField, ExpandField, FieldDefinition, DynamicFieldDefinitions, Fieldset, GroupingField, NativeField, NestedFieldDefinition, NumberField, Option, StringField, StringOneLineField, StringMultilineField, TabGroupField, TabField, FieldHandlerLink, OnSaveCallback, ExtensionAPI, TransformBefore, TransformAfter, ReferenceEntity, ParametersGetter, AsyncParametersGetter, } from './types';
3
3
  export { getExtensionKeyAndNodeKey, resolveImport } from './manifest-helpers';
4
4
  export { default as DefaultExtensionProvider } from './default-extension-provider';
5
5
  export { createAutoConverterRunner, getExtensionAutoConvertersFromProvider, getQuickInsertItemsFromModule, getContextualToolbarItemsFromModule, buildMenuItem, } from './module-helpers';
@@ -6,6 +6,7 @@ export interface ExtensionParams<T extends Parameters> {
6
6
  type?: 'extension' | 'inlineExtension' | 'bodiedExtension';
7
7
  parameters?: T;
8
8
  content?: object | string;
9
+ localId?: string;
9
10
  }
10
11
  export declare type ExtensionHandler<T extends Parameters = Parameters> = (ext: ExtensionParams<T>, doc: object) => JSX.Element | null;
11
12
  export declare type OnSaveCallback<T extends Parameters = Parameters> = (params: T) => void;
@@ -27,5 +28,6 @@ export interface Extension<T extends Parameters = Parameters> {
27
28
  export interface ExtensionHandlers<T extends Parameters = any> {
28
29
  [key: string]: Extension<T> | ExtensionHandler<T>;
29
30
  }
31
+ export declare type ReferenceEntity = ADFEntity | Object;
30
32
  export declare type ParametersGetter<T extends Parameters = Parameters> = TransformBefore<T>;
31
33
  export declare type AsyncParametersGetter<T extends Parameters = Parameters> = TransformAfter<T>;
@@ -1,4 +1,4 @@
1
- export type { ExtensionParams, ExtensionHandler, UpdateExtension, Extension, ExtensionHandlers, ExtensionAPI, OnSaveCallback, TransformBefore, TransformAfter, ParametersGetter, AsyncParametersGetter, } from './extension-handler';
1
+ export type { ExtensionParams, ExtensionHandler, UpdateExtension, Extension, ExtensionHandlers, ExtensionAPI, OnSaveCallback, TransformBefore, TransformAfter, ReferenceEntity, ParametersGetter, AsyncParametersGetter, } from './extension-handler';
2
2
  export type { ExtensionProvider } from './extension-provider';
3
3
  export type { ExtensionAutoConvertHandler, ExtensionComponentProps, ExtensionKey, ExtensionManifest, ExtensionModule, ExtensionModuleAction, ExtensionModuleActionHandler, ExtensionModuleActionObject, ExtensionModuleAutoConvert, ExtensionModuleNode, ExtensionModuleNodes, ExtensionModuleType, ExtensionModules, ExtensionQuickInsertModule, ExtensionType, CustomFieldResolver, UserFieldContextProvider, Icon, MaybeADFEntity, Deserializer, Serializer, DynamicFieldDefinitions, } from './extension-manifest';
4
4
  export type { ContextualToolbar, ToolbarItem, ExtensionToolbarButton, } from './extension-manifest-toolbar-item';
@@ -1,2 +1,2 @@
1
1
  export { DefaultExtensionProvider, combineExtensionProviders, createAutoConverterRunner, getExtensionAutoConvertersFromProvider, getExtensionKeyAndNodeKey, getExtensionModuleNode, getQuickInsertItemsFromModule, getNodeRenderer, getExtensionModuleNodePrivateProps, getContextualToolbarItemsFromModule, resolveImport, getCustomFieldResolver, getFieldSerializer, getFieldDeserializer, isFieldset, isTabGroup, isExpand, isDateRange, getUserFieldContextProvider, buildMenuItem, } from './extensions/index';
2
- export type { ExtensionAutoConvertHandler, Extension, ExtensionComponentProps, ExtensionHandler, ExtensionHandlers, ExtensionKey, ExtensionManifest, ExtensionModule, ExtensionModuleAction, ExtensionModuleActionHandler, ExtensionModuleActionObject, ExtensionModuleNode, ExtensionModuleNodes, ExtensionQuickInsertModule, ExtensionModules, ExtensionParams, ExtensionProvider, ExtensionType, ExtensionToolbarButton, ToolbarItem, ContextualToolbar, Icon, MaybeADFEntity, MenuItem, MenuItemMap, UpdateExtension, Parameters, ParametersWithDuplicateFields, BooleanField, CustomField, CustomFieldResolver, ColorField, DateField, DateRangeField, DateRangeResult, EnumField, EnumCheckboxField, EnumRadioField, EnumSelectField, ExpandField, FieldDefinition, DynamicFieldDefinitions, Fieldset, GroupingField, NativeField, NestedFieldDefinition, NumberField, Option, StringField, StringOneLineField, StringMultilineField, TabGroupField, TabField, UserField, UserFieldContext, UserFieldContextProvider, FieldHandlerLink, OnSaveCallback, ExtensionAPI, TransformBefore, TransformAfter, ParametersGetter, AsyncParametersGetter, } from './extensions/index';
2
+ export type { ExtensionAutoConvertHandler, Extension, ExtensionComponentProps, ExtensionHandler, ExtensionHandlers, ExtensionKey, ExtensionManifest, ExtensionModule, ExtensionModuleAction, ExtensionModuleActionHandler, ExtensionModuleActionObject, ExtensionModuleNode, ExtensionModuleNodes, ExtensionQuickInsertModule, ExtensionModules, ExtensionParams, ExtensionProvider, ExtensionType, ExtensionToolbarButton, ToolbarItem, ContextualToolbar, Icon, MaybeADFEntity, MenuItem, MenuItemMap, UpdateExtension, Parameters, ParametersWithDuplicateFields, BooleanField, CustomField, CustomFieldResolver, ColorField, DateField, DateRangeField, DateRangeResult, EnumField, EnumCheckboxField, EnumRadioField, EnumSelectField, ExpandField, FieldDefinition, DynamicFieldDefinitions, Fieldset, GroupingField, NativeField, NestedFieldDefinition, NumberField, Option, StringField, StringOneLineField, StringMultilineField, TabGroupField, TabField, UserField, UserFieldContext, UserFieldContextProvider, FieldHandlerLink, OnSaveCallback, ExtensionAPI, TransformBefore, TransformAfter, ReferenceEntity, ParametersGetter, AsyncParametersGetter, } from './extensions/index';
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'fabric.editor.codeBidiWarningLabel': string;
2
3
  'fabric.editor.captionPlaceholder': string;
3
4
  'fabric.editor.collapseNode': string;
4
5
  'fabric.editor.expandDefaultTitle': string;