@atlaskit/editor-plugin-base 0.2.1 → 0.2.3

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/editor-plugin-base
2
2
 
3
+ ## 0.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#41047](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41047) [`8f0b00d165f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8f0b00d165f) - [ED-20003] Extract TypeAhead from editor-core to its own package @atlaskit/editor-plugin-type-ahead
8
+
9
+ ## 0.2.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#40750](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40750) [`fc19a7b9edd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fc19a7b9edd) - [ED-19875] Extraction of Editor Core's Selection Plugin into independent package '@atlaskit/editor-plugin-selection'.
14
+ - Updated dependencies
15
+
3
16
  ## 0.2.1
4
17
 
5
18
  ### Patch Changes
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.setKeyboardHeight = void 0;
7
7
  var _pluginKey = require("./pm-plugins/scroll-gutter/plugin-key");
8
- var setKeyboardHeight = function setKeyboardHeight(keyboardHeight) {
8
+ var setKeyboardHeight = exports.setKeyboardHeight = function setKeyboardHeight(keyboardHeight) {
9
9
  return function (state, dispatch) {
10
10
  var tr = state.tr;
11
11
  tr.setMeta(_pluginKey.scrollGutterPluginKey, {
@@ -16,5 +16,4 @@ var setKeyboardHeight = function setKeyboardHeight(keyboardHeight) {
16
16
  }
17
17
  return true;
18
18
  };
19
- };
20
- exports.setKeyboardHeight = setKeyboardHeight;
19
+ };
@@ -27,13 +27,12 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
27
27
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
28
28
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
29
29
  // Chrome >= 88
30
- var isChromeWithSelectionBug = _utils.browser.chrome && _utils.browser.chrome_version >= 88;
31
- exports.isChromeWithSelectionBug = isChromeWithSelectionBug;
30
+ var isChromeWithSelectionBug = exports.isChromeWithSelectionBug = _utils.browser.chrome && _utils.browser.chrome_version >= 88;
32
31
  var basePlugin = function basePlugin(_ref) {
33
32
  var _api$featureFlags;
34
33
  var options = _ref.config,
35
34
  api = _ref.api;
36
- var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
35
+ var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
37
36
  return {
38
37
  name: 'base',
39
38
  getSharedState: function getSharedState(editorState) {
@@ -143,5 +142,4 @@ var basePlugin = function basePlugin(_ref) {
143
142
  }
144
143
  };
145
144
  };
146
- var _default = basePlugin;
147
- exports.default = _default;
145
+ var _default = exports.default = basePlugin;
@@ -10,16 +10,14 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
10
10
  var _state = require("@atlaskit/editor-prosemirror/state");
11
11
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
12
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
- var stateKey = new _state.PluginKey('contextIdentiferPlugin');
14
- exports.stateKey = stateKey;
15
- var getContextIdentifier = function getContextIdentifier(state) {
13
+ var stateKey = exports.stateKey = new _state.PluginKey('contextIdentiferPlugin');
14
+ var getContextIdentifier = exports.getContextIdentifier = function getContextIdentifier(state) {
16
15
  if (state) {
17
16
  var _stateKey$getState;
18
17
  return (_stateKey$getState = stateKey.getState(state)) === null || _stateKey$getState === void 0 ? void 0 : _stateKey$getState.contextIdentifierProvider;
19
18
  }
20
19
  };
21
- exports.getContextIdentifier = getContextIdentifier;
22
- var _default = function _default(dispatch, providerFactory) {
20
+ var _default = exports.default = function _default(dispatch, providerFactory) {
23
21
  return new _safePlugin.SafePlugin({
24
22
  key: stateKey,
25
23
  state: {
@@ -54,5 +52,4 @@ var _default = function _default(dispatch, providerFactory) {
54
52
  };
55
53
  }
56
54
  });
57
- };
58
- exports.default = _default;
55
+ };
@@ -32,7 +32,7 @@ function getCurrentBrowserAndVersion() {
32
32
  }
33
33
  return undefined;
34
34
  }
35
- var _default = function _default(featureFlags) {
35
+ var _default = exports.default = function _default(featureFlags) {
36
36
  return new _safePlugin.SafePlugin({
37
37
  key: new _state.PluginKey('disableSpellchecking'),
38
38
  props: {
@@ -59,5 +59,4 @@ var _default = function _default(featureFlags) {
59
59
  }
60
60
  }
61
61
  });
62
- };
63
- exports.default = _default;
62
+ };
@@ -11,7 +11,7 @@ var hasInvalidSteps = function hasInvalidSteps(tr) {
11
11
  return step.from > step.to;
12
12
  });
13
13
  };
14
- var _default = function _default(dispatchAnalyticsEvent) {
14
+ var _default = exports.default = function _default(dispatchAnalyticsEvent) {
15
15
  return new _safePlugin.SafePlugin({
16
16
  filterTransaction: function filterTransaction(transaction) {
17
17
  if (hasInvalidSteps(transaction)) {
@@ -30,5 +30,4 @@ var _default = function _default(dispatchAnalyticsEvent) {
30
30
  return true;
31
31
  }
32
32
  });
33
- };
34
- exports.default = _default;
33
+ };
@@ -10,9 +10,8 @@ var _utils = require("@atlaskit/editor-prosemirror/utils");
10
10
  function isDivHTMLElement(elm) {
11
11
  return elm.tagName.toLowerCase() === 'div';
12
12
  }
13
- var fixChromeSelectionKey = new _state.PluginKey('fixChromeSelectionPlugin');
14
- exports.fixChromeSelectionKey = fixChromeSelectionKey;
15
- var _default = function _default() {
13
+ var fixChromeSelectionKey = exports.fixChromeSelectionKey = new _state.PluginKey('fixChromeSelectionPlugin');
14
+ var _default = exports.default = function _default() {
16
15
  return new _safePlugin.SafePlugin({
17
16
  key: fixChromeSelectionKey,
18
17
  props: {
@@ -30,5 +29,4 @@ var _default = function _default() {
30
29
  }
31
30
  }
32
31
  });
33
- };
34
- exports.default = _default;
32
+ };
@@ -16,21 +16,15 @@ var _inputLatencyTracking = _interopRequireDefault(require("../utils/input-laten
16
16
  var _contextIdentifier = require("./context-identifier");
17
17
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
18
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
- var frozenEditorPluginKey = new _state.PluginKey('frozenEditor');
20
- exports.frozenEditorPluginKey = frozenEditorPluginKey;
19
+ var frozenEditorPluginKey = exports.frozenEditorPluginKey = new _state.PluginKey('frozenEditor');
21
20
  var DEFAULT_KEYSTROKE_SAMPLING_LIMIT = 100;
22
21
  var DEFAULT_SLOW_THRESHOLD = 300;
23
- var DEFAULT_FREEZE_THRESHOLD = 600;
24
- exports.DEFAULT_FREEZE_THRESHOLD = DEFAULT_FREEZE_THRESHOLD;
25
- var NORMAL_SEVERITY_THRESHOLD = 2000;
26
- exports.NORMAL_SEVERITY_THRESHOLD = NORMAL_SEVERITY_THRESHOLD;
27
- var DEGRADED_SEVERITY_THRESHOLD = 3000;
28
- exports.DEGRADED_SEVERITY_THRESHOLD = DEGRADED_SEVERITY_THRESHOLD;
22
+ var DEFAULT_FREEZE_THRESHOLD = exports.DEFAULT_FREEZE_THRESHOLD = 600;
23
+ var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
24
+ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
29
25
  var DEFAULT_TRACK_SEVERITY_ENABLED = false;
30
- var DEFAULT_TRACK_SEVERITY_THRESHOLD_NORMAL = 100;
31
- exports.DEFAULT_TRACK_SEVERITY_THRESHOLD_NORMAL = DEFAULT_TRACK_SEVERITY_THRESHOLD_NORMAL;
32
- var DEFAULT_TRACK_SEVERITY_THRESHOLD_DEGRADED = 500;
33
- exports.DEFAULT_TRACK_SEVERITY_THRESHOLD_DEGRADED = DEFAULT_TRACK_SEVERITY_THRESHOLD_DEGRADED;
26
+ var DEFAULT_TRACK_SEVERITY_THRESHOLD_NORMAL = exports.DEFAULT_TRACK_SEVERITY_THRESHOLD_NORMAL = 100;
27
+ var DEFAULT_TRACK_SEVERITY_THRESHOLD_DEGRADED = exports.DEFAULT_TRACK_SEVERITY_THRESHOLD_DEGRADED = 500;
34
28
  var dispatchLongTaskEvent = function dispatchLongTaskEvent(dispatchAnalyticsEvent, view, time, getNodeCount, interactionType, severity) {
35
29
  var _getContextIdentifier;
36
30
  var state = view.state;
@@ -49,7 +43,7 @@ var dispatchLongTaskEvent = function dispatchLongTaskEvent(dispatchAnalyticsEven
49
43
  eventType: _analytics.EVENT_TYPE.OPERATIONAL
50
44
  });
51
45
  };
52
- var _default = function _default(dispatchAnalyticsEvent, inputTracking, browserFreezeTracking, ufo) {
46
+ var _default = exports.default = function _default(dispatchAnalyticsEvent, inputTracking, browserFreezeTracking, ufo) {
53
47
  var interactionType;
54
48
  var inputLatencyTracker = null;
55
49
  var inputLatencySingleKeyTracker = null;
@@ -174,7 +168,7 @@ var _default = function _default(dispatchAnalyticsEvent, inputTracking, browserF
174
168
  normalThreshold: severityThresholdNormal,
175
169
  degradedThreshold: severityThresholdDegraded,
176
170
  onSampleStart: function onSampleStart() {
177
- experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.start(_ufo.EditorExperience.typing);
171
+ experienceStore === null || experienceStore === void 0 || experienceStore.start(_ufo.EditorExperience.typing);
178
172
  },
179
173
  onSampleEnd: function onSampleEnd(time, _ref2) {
180
174
  var _getContextIdentifier4;
@@ -183,11 +177,11 @@ var _default = function _default(dispatchAnalyticsEvent, inputTracking, browserF
183
177
  var state = _view.state;
184
178
  var nodesCount = getNodeCount(state);
185
179
  if (isSlow) {
186
- experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.addMetadata(_ufo.EditorExperience.typing, {
180
+ experienceStore === null || experienceStore === void 0 || experienceStore.addMetadata(_ufo.EditorExperience.typing, {
187
181
  slowInput: true
188
182
  });
189
183
  }
190
- experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.success(_ufo.EditorExperience.typing, _objectSpread(_objectSpread({
184
+ experienceStore === null || experienceStore === void 0 || experienceStore.success(_ufo.EditorExperience.typing, _objectSpread(_objectSpread({
191
185
  nodeSize: state.doc.nodeSize
192
186
  }, nodesCount), {}, {
193
187
  objectId: (_getContextIdentifier4 = (0, _contextIdentifier.getContextIdentifier)(state)) === null || _getContextIdentifier4 === void 0 ? void 0 : _getContextIdentifier4.objectId,
@@ -255,11 +249,10 @@ var _default = function _default(dispatchAnalyticsEvent, inputTracking, browserF
255
249
  return {
256
250
  destroy: function destroy() {
257
251
  var _inputLatencyTracker;
258
- (_inputLatencyTracker = inputLatencyTracker) === null || _inputLatencyTracker === void 0 ? void 0 : _inputLatencyTracker.flush();
259
- observer === null || observer === void 0 ? void 0 : observer.disconnect();
252
+ (_inputLatencyTracker = inputLatencyTracker) === null || _inputLatencyTracker === void 0 || _inputLatencyTracker.flush();
253
+ observer === null || observer === void 0 || observer.disconnect();
260
254
  }
261
255
  };
262
256
  }
263
257
  });
264
- };
265
- exports.default = _default;
258
+ };
@@ -8,13 +8,11 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
8
8
  var _utils = require("@atlaskit/editor-common/utils");
9
9
  var _state = require("@atlaskit/editor-prosemirror/state");
10
10
  var _view = require("@atlaskit/editor-prosemirror/view");
11
- var inlineCursorTargetStateKey = new _state.PluginKey('inlineCursorTargetPlugin');
12
- exports.inlineCursorTargetStateKey = inlineCursorTargetStateKey;
13
- var isInlineNodeView = function isInlineNodeView(node) {
11
+ var inlineCursorTargetStateKey = exports.inlineCursorTargetStateKey = new _state.PluginKey('inlineCursorTargetPlugin');
12
+ var isInlineNodeView = exports.isInlineNodeView = function isInlineNodeView(node) {
14
13
  return node && node.type.isInline && !node.type.isText;
15
14
  };
16
- exports.isInlineNodeView = isInlineNodeView;
17
- var _default = function _default() {
15
+ var _default = exports.default = function _default() {
18
16
  return new _safePlugin.SafePlugin({
19
17
  key: inlineCursorTargetStateKey,
20
18
  state: {
@@ -149,7 +147,6 @@ var _default = function _default() {
149
147
  }
150
148
  });
151
149
  };
152
- exports.default = _default;
153
150
  function cursorTargetHasValidDecorations(cursorTarget) {
154
151
  if (!cursorTarget ||
155
152
  // Decorations can end up as null when the decorations prop is
@@ -8,8 +8,7 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
8
8
  var _utils = require("@atlaskit/editor-common/utils");
9
9
  var _keymap = require("@atlaskit/editor-prosemirror/keymap");
10
10
  var _state = require("@atlaskit/editor-prosemirror/state");
11
- var newlinePreserveMarksKey = new _state.PluginKey('newlinePreserveMarksPlugin');
12
- exports.newlinePreserveMarksKey = newlinePreserveMarksKey;
11
+ var newlinePreserveMarksKey = exports.newlinePreserveMarksKey = new _state.PluginKey('newlinePreserveMarksPlugin');
13
12
  var isSelectionAligned = function isSelectionAligned(state) {
14
13
  return !!state.selection.$to.parent.marks.find(function (m) {
15
14
  return m.type === state.schema.marks.alignment;
@@ -21,7 +20,7 @@ var splitBlockPreservingMarks = function splitBlockPreservingMarks(state, dispat
21
20
  }
22
21
  return true;
23
22
  };
24
- var _default = function _default() {
23
+ var _default = exports.default = function _default() {
25
24
  return new _safePlugin.SafePlugin({
26
25
  key: newlinePreserveMarksKey,
27
26
  props: {
@@ -30,5 +29,4 @@ var _default = function _default() {
30
29
  })
31
30
  }
32
31
  });
33
- };
34
- exports.default = _default;
32
+ };
@@ -7,13 +7,12 @@ exports.getKeyboardHeight = exports.default = void 0;
7
7
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
8
8
  var _utils = require("@atlaskit/editor-common/utils");
9
9
  var _pluginKey = require("./plugin-key");
10
- var getKeyboardHeight = function getKeyboardHeight(state) {
10
+ var getKeyboardHeight = exports.getKeyboardHeight = function getKeyboardHeight(state) {
11
11
  if (state) {
12
12
  var scrollGutterPluginState = (0, _pluginKey.getScrollGutterPluginState)(state);
13
13
  return scrollGutterPluginState ? scrollGutterPluginState.keyboardHeight : undefined;
14
14
  }
15
15
  };
16
- exports.getKeyboardHeight = getKeyboardHeight;
17
16
  var MIN_TAP_SIZE_IN_PX = 40;
18
17
  function supportsIntersectionObserver() {
19
18
  if (typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window && 'intersectionRatio' in
@@ -147,7 +146,7 @@ function scrollToGutterElement(scrollContainer, gutterElement, gutterSize) {
147
146
  // Mark scrolling as handled so that other plugin's don't override our position.
148
147
  return true;
149
148
  }
150
- var _default = function _default() {
149
+ var _default = exports.default = function _default() {
151
150
  var pluginOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
152
151
  var getScrollElement = pluginOptions.getScrollElement,
153
152
  allowCustomScrollHandler = pluginOptions.allowCustomScrollHandler,
@@ -260,5 +259,4 @@ var _default = function _default() {
260
259
  };
261
260
  })
262
261
  });
263
- };
264
- exports.default = _default;
262
+ };
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.scrollGutterPluginKey = exports.getScrollGutterPluginState = void 0;
7
7
  var _state = require("@atlaskit/editor-prosemirror/state");
8
- var scrollGutterPluginKey = new _state.PluginKey('scrollGutter');
9
- exports.scrollGutterPluginKey = scrollGutterPluginKey;
10
- var getScrollGutterPluginState = function getScrollGutterPluginState(state) {
8
+ var scrollGutterPluginKey = exports.scrollGutterPluginKey = new _state.PluginKey('scrollGutter');
9
+ var getScrollGutterPluginState = exports.getScrollGutterPluginState = function getScrollGutterPluginState(state) {
11
10
  if (state) {
12
11
  return scrollGutterPluginKey.getState(state);
13
12
  }
14
- };
15
- exports.getScrollGutterPluginState = getScrollGutterPluginState;
13
+ };
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.setInteractionType = void 0;
7
7
  /** Allows the possibility of overriding interaction type values in unit tests via jest.mock or spyOn. */
8
- var setInteractionType = function setInteractionType(value) {
8
+ var setInteractionType = exports.setInteractionType = function setInteractionType(value) {
9
9
  return value;
10
- };
11
- exports.setInteractionType = setInteractionType;
10
+ };
@@ -9,7 +9,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
  var _utils = require("@atlaskit/editor-common/utils");
12
- var InputLatencyTracker = /*#__PURE__*/function () {
12
+ var InputLatencyTracker = exports.default = /*#__PURE__*/function () {
13
13
  function InputLatencyTracker(_ref) {
14
14
  var samplingRate = _ref.samplingRate,
15
15
  slowThreshold = _ref.slowThreshold,
@@ -40,7 +40,7 @@ var InputLatencyTracker = /*#__PURE__*/function () {
40
40
  var currentStart = performance.now();
41
41
  if (this.samples.length + 1 === this.samplingRate) {
42
42
  var _this$onSampleStart;
43
- (_this$onSampleStart = this.onSampleStart) === null || _this$onSampleStart === void 0 ? void 0 : _this$onSampleStart.call(this);
43
+ (_this$onSampleStart = this.onSampleStart) === null || _this$onSampleStart === void 0 || _this$onSampleStart.call(this);
44
44
  }
45
45
  var end = function end() {
46
46
  if (currentStart === null) {
@@ -51,13 +51,13 @@ var InputLatencyTracker = /*#__PURE__*/function () {
51
51
  _this.push(time);
52
52
  if (time > _this.slowThreshold) {
53
53
  var _this$onSlowInput;
54
- (_this$onSlowInput = _this.onSlowInput) === null || _this$onSlowInput === void 0 ? void 0 : _this$onSlowInput.call(_this, time);
54
+ (_this$onSlowInput = _this.onSlowInput) === null || _this$onSlowInput === void 0 || _this$onSlowInput.call(_this, time);
55
55
  isSlow = true;
56
56
  }
57
57
  if (_this.samples.length === _this.samplingRate) {
58
58
  var _this$onSampleEnd;
59
59
  _this.flush();
60
- (_this$onSampleEnd = _this.onSampleEnd) === null || _this$onSampleEnd === void 0 ? void 0 : _this$onSampleEnd.call(_this, time, {
60
+ (_this$onSampleEnd = _this.onSampleEnd) === null || _this$onSampleEnd === void 0 || _this$onSampleEnd.call(_this, time, {
61
61
  isSlow: isSlow,
62
62
  severity: _this.severity(time)
63
63
  });
@@ -79,10 +79,10 @@ var InputLatencyTracker = /*#__PURE__*/function () {
79
79
  key: "dispatch",
80
80
  value: function dispatch() {
81
81
  var _this$dispatchSample, _this$dispatchAverage;
82
- (_this$dispatchSample = this.dispatchSample) === null || _this$dispatchSample === void 0 ? void 0 : _this$dispatchSample.call(this, this.getLast(), this.severity(this.getLast()));
82
+ (_this$dispatchSample = this.dispatchSample) === null || _this$dispatchSample === void 0 || _this$dispatchSample.call(this, this.getLast(), this.severity(this.getLast()));
83
83
  // cache
84
84
  var median = this.getMedian();
85
- (_this$dispatchAverage = this.dispatchAverage) === null || _this$dispatchAverage === void 0 ? void 0 : _this$dispatchAverage.call(this, {
85
+ (_this$dispatchAverage = this.dispatchAverage) === null || _this$dispatchAverage === void 0 || _this$dispatchAverage.call(this, {
86
86
  mean: this.getMean(),
87
87
  median: median,
88
88
  sampleSize: this.samples.length
@@ -130,5 +130,4 @@ var InputLatencyTracker = /*#__PURE__*/function () {
130
130
  }
131
131
  }]);
132
132
  return InputLatencyTracker;
133
- }();
134
- exports.default = InputLatencyTracker;
133
+ }();
@@ -22,7 +22,7 @@ var basePlugin = function basePlugin(_ref) {
22
22
  var _api$featureFlags;
23
23
  var options = _ref.config,
24
24
  api = _ref.api;
25
- var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
25
+ var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
26
26
  return {
27
27
  name: 'base',
28
28
  getSharedState: function getSharedState(editorState) {
@@ -161,7 +161,7 @@ export default (function (dispatchAnalyticsEvent, inputTracking, browserFreezeTr
161
161
  normalThreshold: severityThresholdNormal,
162
162
  degradedThreshold: severityThresholdDegraded,
163
163
  onSampleStart: function onSampleStart() {
164
- experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.start(EditorExperience.typing);
164
+ experienceStore === null || experienceStore === void 0 || experienceStore.start(EditorExperience.typing);
165
165
  },
166
166
  onSampleEnd: function onSampleEnd(time, _ref2) {
167
167
  var _getContextIdentifier4;
@@ -170,11 +170,11 @@ export default (function (dispatchAnalyticsEvent, inputTracking, browserFreezeTr
170
170
  var state = _view.state;
171
171
  var nodesCount = getNodeCount(state);
172
172
  if (isSlow) {
173
- experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.addMetadata(EditorExperience.typing, {
173
+ experienceStore === null || experienceStore === void 0 || experienceStore.addMetadata(EditorExperience.typing, {
174
174
  slowInput: true
175
175
  });
176
176
  }
177
- experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.success(EditorExperience.typing, _objectSpread(_objectSpread({
177
+ experienceStore === null || experienceStore === void 0 || experienceStore.success(EditorExperience.typing, _objectSpread(_objectSpread({
178
178
  nodeSize: state.doc.nodeSize
179
179
  }, nodesCount), {}, {
180
180
  objectId: (_getContextIdentifier4 = getContextIdentifier(state)) === null || _getContextIdentifier4 === void 0 ? void 0 : _getContextIdentifier4.objectId,
@@ -242,8 +242,8 @@ export default (function (dispatchAnalyticsEvent, inputTracking, browserFreezeTr
242
242
  return {
243
243
  destroy: function destroy() {
244
244
  var _inputLatencyTracker;
245
- (_inputLatencyTracker = inputLatencyTracker) === null || _inputLatencyTracker === void 0 ? void 0 : _inputLatencyTracker.flush();
246
- observer === null || observer === void 0 ? void 0 : observer.disconnect();
245
+ (_inputLatencyTracker = inputLatencyTracker) === null || _inputLatencyTracker === void 0 || _inputLatencyTracker.flush();
246
+ observer === null || observer === void 0 || observer.disconnect();
247
247
  }
248
248
  };
249
249
  }
@@ -33,7 +33,7 @@ var InputLatencyTracker = /*#__PURE__*/function () {
33
33
  var currentStart = performance.now();
34
34
  if (this.samples.length + 1 === this.samplingRate) {
35
35
  var _this$onSampleStart;
36
- (_this$onSampleStart = this.onSampleStart) === null || _this$onSampleStart === void 0 ? void 0 : _this$onSampleStart.call(this);
36
+ (_this$onSampleStart = this.onSampleStart) === null || _this$onSampleStart === void 0 || _this$onSampleStart.call(this);
37
37
  }
38
38
  var end = function end() {
39
39
  if (currentStart === null) {
@@ -44,13 +44,13 @@ var InputLatencyTracker = /*#__PURE__*/function () {
44
44
  _this.push(time);
45
45
  if (time > _this.slowThreshold) {
46
46
  var _this$onSlowInput;
47
- (_this$onSlowInput = _this.onSlowInput) === null || _this$onSlowInput === void 0 ? void 0 : _this$onSlowInput.call(_this, time);
47
+ (_this$onSlowInput = _this.onSlowInput) === null || _this$onSlowInput === void 0 || _this$onSlowInput.call(_this, time);
48
48
  isSlow = true;
49
49
  }
50
50
  if (_this.samples.length === _this.samplingRate) {
51
51
  var _this$onSampleEnd;
52
52
  _this.flush();
53
- (_this$onSampleEnd = _this.onSampleEnd) === null || _this$onSampleEnd === void 0 ? void 0 : _this$onSampleEnd.call(_this, time, {
53
+ (_this$onSampleEnd = _this.onSampleEnd) === null || _this$onSampleEnd === void 0 || _this$onSampleEnd.call(_this, time, {
54
54
  isSlow: isSlow,
55
55
  severity: _this.severity(time)
56
56
  });
@@ -72,10 +72,10 @@ var InputLatencyTracker = /*#__PURE__*/function () {
72
72
  key: "dispatch",
73
73
  value: function dispatch() {
74
74
  var _this$dispatchSample, _this$dispatchAverage;
75
- (_this$dispatchSample = this.dispatchSample) === null || _this$dispatchSample === void 0 ? void 0 : _this$dispatchSample.call(this, this.getLast(), this.severity(this.getLast()));
75
+ (_this$dispatchSample = this.dispatchSample) === null || _this$dispatchSample === void 0 || _this$dispatchSample.call(this, this.getLast(), this.severity(this.getLast()));
76
76
  // cache
77
77
  var median = this.getMedian();
78
- (_this$dispatchAverage = this.dispatchAverage) === null || _this$dispatchAverage === void 0 ? void 0 : _this$dispatchAverage.call(this, {
78
+ (_this$dispatchAverage = this.dispatchAverage) === null || _this$dispatchAverage === void 0 || _this$dispatchAverage.call(this, {
79
79
  mean: this.getMean(),
80
80
  median: median,
81
81
  sampleSize: this.samples.length
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-base",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Base plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^32.0.0",
35
- "@atlaskit/editor-common": "^76.1.0",
35
+ "@atlaskit/editor-common": "^76.10.0",
36
36
  "@atlaskit/editor-plugin-feature-flags": "^1.0.1",
37
37
  "@atlaskit/editor-prosemirror": "1.1.0",
38
38
  "@atlaskit/platform-feature-flags": "^0.2.0",
@@ -41,9 +41,11 @@
41
41
  "devDependencies": {
42
42
  "@atlaskit/editor-plugin-analytics": "^0.2.0",
43
43
  "@atlaskit/editor-plugin-content-insertion": "^0.1.0",
44
- "@atlaskit/editor-plugin-emoji": "^0.3.0",
44
+ "@atlaskit/editor-plugin-emoji": "^0.4.0",
45
45
  "@atlaskit/editor-plugin-guideline": "^0.5.0",
46
- "@atlaskit/editor-plugin-table": "^4.0.0",
46
+ "@atlaskit/editor-plugin-selection": "^0.1.0",
47
+ "@atlaskit/editor-plugin-table": "^5.2.0",
48
+ "@atlaskit/editor-plugin-type-ahead": "^0.7.0",
47
49
  "@atlaskit/editor-plugin-width": "^0.2.0",
48
50
  "@atlaskit/util-data-test": "^17.8.0",
49
51
  "@atlaskit/webdriver-runner": "*",
package/tsconfig.dev.json CHANGED
@@ -59,9 +59,15 @@
59
59
  {
60
60
  "path": "../editor-plugin-guideline/tsconfig.app.json"
61
61
  },
62
+ {
63
+ "path": "../editor-plugin-selection/tsconfig.app.json"
64
+ },
62
65
  {
63
66
  "path": "../editor-plugin-table/tsconfig.app.json"
64
67
  },
68
+ {
69
+ "path": "../editor-plugin-type-ahead/tsconfig.app.json"
70
+ },
65
71
  {
66
72
  "path": "../editor-plugin-width/tsconfig.app.json"
67
73
  },