@atlaskit/editor-plugin-base 2.0.5 → 2.0.6

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 (65) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/{plugin.js → basePlugin.js} +9 -11
  3. package/dist/cjs/{commands.js → editor-commands/set-keyboard-height.js} +1 -1
  4. package/dist/cjs/index.js +2 -2
  5. package/dist/cjs/pm-plugins/frozen-editor.js +2 -2
  6. package/dist/cjs/pm-plugins/scroll-gutter/{next.js → plugin-next.js} +1 -7
  7. package/dist/cjs/pm-plugins/scroll-gutter/{index.js → plugin.js} +3 -8
  8. package/dist/cjs/pm-plugins/scroll-gutter/util/get-keyboard-height.js +13 -0
  9. package/dist/cjs/types/command.js +5 -0
  10. package/dist/es2019/{plugin.js → basePlugin.js} +5 -4
  11. package/dist/es2019/{commands.js → editor-commands/set-keyboard-height.js} +1 -1
  12. package/dist/es2019/index.js +1 -1
  13. package/dist/es2019/pm-plugins/frozen-editor.js +2 -2
  14. package/dist/es2019/pm-plugins/scroll-gutter/{next.js → plugin-next.js} +1 -7
  15. package/dist/es2019/pm-plugins/scroll-gutter/{index.js → plugin.js} +2 -7
  16. package/dist/es2019/pm-plugins/scroll-gutter/util/get-keyboard-height.js +7 -0
  17. package/dist/esm/{plugin.js → basePlugin.js} +5 -4
  18. package/dist/esm/basePluginType.js +1 -0
  19. package/dist/esm/{commands.js → editor-commands/set-keyboard-height.js} +1 -1
  20. package/dist/esm/index.js +1 -1
  21. package/dist/esm/pm-plugins/frozen-editor.js +2 -2
  22. package/dist/esm/pm-plugins/scroll-gutter/{next.js → plugin-next.js} +1 -7
  23. package/dist/esm/pm-plugins/scroll-gutter/{index.js → plugin.js} +2 -7
  24. package/dist/esm/pm-plugins/scroll-gutter/util/get-keyboard-height.js +7 -0
  25. package/dist/esm/types/command.js +1 -0
  26. package/dist/types/basePlugin.d.ts +3 -0
  27. package/dist/types/{plugin.d.ts → basePluginType.d.ts} +2 -4
  28. package/dist/types/index.d.ts +3 -3
  29. package/dist/types/pm-plugins/scroll-gutter/{next.d.ts → plugin-next.d.ts} +0 -2
  30. package/dist/types/pm-plugins/scroll-gutter/{index.d.ts → plugin.d.ts} +0 -2
  31. package/dist/types/pm-plugins/scroll-gutter/util/get-keyboard-height.d.ts +2 -0
  32. package/dist/types-ts4.5/basePlugin.d.ts +3 -0
  33. package/dist/types-ts4.5/{plugin.d.ts → basePluginType.d.ts} +2 -4
  34. package/dist/types-ts4.5/index.d.ts +3 -3
  35. package/dist/types-ts4.5/pm-plugins/scroll-gutter/{next.d.ts → plugin-next.d.ts} +0 -2
  36. package/dist/types-ts4.5/pm-plugins/scroll-gutter/{index.d.ts → plugin.d.ts} +0 -2
  37. package/dist/types-ts4.5/pm-plugins/scroll-gutter/util/get-keyboard-height.d.ts +2 -0
  38. package/package.json +6 -3
  39. /package/dist/cjs/{types.js → basePluginType.js} +0 -0
  40. /package/dist/cjs/{utils → pm-plugins/utils}/frozen-editor.js +0 -0
  41. /package/dist/cjs/{utils → pm-plugins/utils}/getTimeSince.js +0 -0
  42. /package/dist/cjs/{utils → pm-plugins/utils}/input-latency-tracking.js +0 -0
  43. /package/dist/cjs/{utils → pm-plugins/utils}/inputTrackingConfig.js +0 -0
  44. /package/dist/es2019/{types.js → basePluginType.js} +0 -0
  45. /package/dist/es2019/{utils → pm-plugins/utils}/frozen-editor.js +0 -0
  46. /package/dist/es2019/{utils → pm-plugins/utils}/getTimeSince.js +0 -0
  47. /package/dist/es2019/{utils → pm-plugins/utils}/input-latency-tracking.js +0 -0
  48. /package/dist/es2019/{utils → pm-plugins/utils}/inputTrackingConfig.js +0 -0
  49. /package/dist/{esm/types.js → es2019/types/command.js} +0 -0
  50. /package/dist/esm/{utils → pm-plugins/utils}/frozen-editor.js +0 -0
  51. /package/dist/esm/{utils → pm-plugins/utils}/getTimeSince.js +0 -0
  52. /package/dist/esm/{utils → pm-plugins/utils}/input-latency-tracking.js +0 -0
  53. /package/dist/esm/{utils → pm-plugins/utils}/inputTrackingConfig.js +0 -0
  54. /package/dist/types/{commands.d.ts → editor-commands/set-keyboard-height.d.ts} +0 -0
  55. /package/dist/types/{utils → pm-plugins/utils}/frozen-editor.d.ts +0 -0
  56. /package/dist/types/{utils → pm-plugins/utils}/getTimeSince.d.ts +0 -0
  57. /package/dist/types/{utils → pm-plugins/utils}/input-latency-tracking.d.ts +0 -0
  58. /package/dist/types/{utils → pm-plugins/utils}/inputTrackingConfig.d.ts +0 -0
  59. /package/dist/types/{types.d.ts → types/command.d.ts} +0 -0
  60. /package/dist/types-ts4.5/{commands.d.ts → editor-commands/set-keyboard-height.d.ts} +0 -0
  61. /package/dist/types-ts4.5/{utils → pm-plugins/utils}/frozen-editor.d.ts +0 -0
  62. /package/dist/types-ts4.5/{utils → pm-plugins/utils}/getTimeSince.d.ts +0 -0
  63. /package/dist/types-ts4.5/{utils → pm-plugins/utils}/input-latency-tracking.d.ts +0 -0
  64. /package/dist/types-ts4.5/{utils → pm-plugins/utils}/inputTrackingConfig.d.ts +0 -0
  65. /package/dist/types-ts4.5/{types.d.ts → types/command.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/editor-plugin-base
2
2
 
3
+ ## 2.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#170774](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/170774)
8
+ [`641b4dbf79095`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/641b4dbf79095) -
9
+ ED-25806: migrates editor plugins to folder standards
10
+ - Updated dependencies
11
+
3
12
  ## 2.0.5
4
13
 
5
14
  ### Patch Changes
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -13,18 +12,17 @@ var _commands = require("@atlaskit/editor-prosemirror/commands");
13
12
  var _history = require("@atlaskit/editor-prosemirror/history");
14
13
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
14
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
16
- var _commands2 = require("./commands");
15
+ var _setKeyboardHeight = require("./editor-commands/set-keyboard-height");
17
16
  var _disableSpellChecking = _interopRequireDefault(require("./pm-plugins/disable-spell-checking"));
18
17
  var _filterSteps = _interopRequireDefault(require("./pm-plugins/filter-steps"));
19
18
  var _frozenEditor = _interopRequireDefault(require("./pm-plugins/frozen-editor"));
20
19
  var _inlineCursorTarget = _interopRequireDefault(require("./pm-plugins/inline-cursor-target"));
21
20
  var _lazyNodeViewDecoration = require("./pm-plugins/lazy-node-view-decoration");
22
21
  var _newlinePreserveMarks = _interopRequireDefault(require("./pm-plugins/newline-preserve-marks"));
23
- var _scrollGutter = _interopRequireWildcard(require("./pm-plugins/scroll-gutter"));
24
- var _next = _interopRequireDefault(require("./pm-plugins/scroll-gutter/next"));
25
- var _inputTrackingConfig = require("./utils/inputTrackingConfig");
26
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
27
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
22
+ var _plugin = _interopRequireDefault(require("./pm-plugins/scroll-gutter/plugin"));
23
+ var _pluginNext = _interopRequireDefault(require("./pm-plugins/scroll-gutter/plugin-next"));
24
+ var _getKeyboardHeight = require("./pm-plugins/scroll-gutter/util/get-keyboard-height");
25
+ var _inputTrackingConfig = require("./pm-plugins/utils/inputTrackingConfig");
28
26
  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; }
29
27
  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; }
30
28
  var basePlugin = function basePlugin(_ref) {
@@ -36,11 +34,11 @@ var basePlugin = function basePlugin(_ref) {
36
34
  name: 'base',
37
35
  getSharedState: function getSharedState(editorState) {
38
36
  return {
39
- keyboardHeight: (0, _scrollGutter.getKeyboardHeight)(editorState)
37
+ keyboardHeight: (0, _getKeyboardHeight.getKeyboardHeight)(editorState)
40
38
  };
41
39
  },
42
40
  actions: {
43
- setKeyboardHeight: _commands2.setKeyboardHeight
41
+ setKeyboardHeight: _setKeyboardHeight.setKeyboardHeight
44
42
  },
45
43
  pmPlugins: function pmPlugins() {
46
44
  var plugins = [{
@@ -112,14 +110,14 @@ var basePlugin = function basePlugin(_ref) {
112
110
  plugins.push({
113
111
  name: 'scrollGutterPlugin',
114
112
  plugin: function plugin() {
115
- return (0, _next.default)(options.allowScrollGutter);
113
+ return (0, _pluginNext.default)(options.allowScrollGutter);
116
114
  }
117
115
  });
118
116
  } else {
119
117
  plugins.push({
120
118
  name: 'scrollGutterPlugin',
121
119
  plugin: function plugin() {
122
- return (0, _scrollGutter.default)(options.allowScrollGutter);
120
+ return (0, _plugin.default)(options.allowScrollGutter);
123
121
  }
124
122
  });
125
123
  }
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.setKeyboardHeight = void 0;
7
- var _pluginKey = require("./pm-plugins/scroll-gutter/plugin-key");
7
+ var _pluginKey = require("../pm-plugins/scroll-gutter/plugin-key");
8
8
  var setKeyboardHeight = exports.setKeyboardHeight = function setKeyboardHeight(keyboardHeight) {
9
9
  return function (state, dispatch) {
10
10
  var tr = state.tr;
package/dist/cjs/index.js CHANGED
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  Object.defineProperty(exports, "basePlugin", {
8
8
  enumerable: true,
9
9
  get: function get() {
10
- return _plugin.default;
10
+ return _basePlugin.default;
11
11
  }
12
12
  });
13
- var _plugin = _interopRequireDefault(require("./plugin"));
13
+ var _basePlugin = _interopRequireDefault(require("./basePlugin"));
@@ -12,8 +12,8 @@ var _isPerformanceApiAvailable = require("@atlaskit/editor-common/is-performance
12
12
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
13
13
  var _analytics2 = require("@atlaskit/editor-common/utils/analytics");
14
14
  var _state = require("@atlaskit/editor-prosemirror/state");
15
- var _frozenEditor = require("../utils/frozen-editor");
16
- var _inputLatencyTracking = _interopRequireDefault(require("../utils/input-latency-tracking"));
15
+ var _frozenEditor = require("./utils/frozen-editor");
16
+ var _inputLatencyTracking = _interopRequireDefault(require("./utils/input-latency-tracking"));
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
19
  var frozenEditorPluginKey = exports.frozenEditorPluginKey = new _state.PluginKey('frozenEditor');
@@ -3,17 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getKeyboardHeight = exports.default = void 0;
6
+ exports.default = void 0;
7
7
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
8
8
  var _pluginKey = require("./plugin-key");
9
9
  var GUTTER_SIZE_IN_PX = 120;
10
10
  var GUTTER_SELECTOR_NAME = 'editor-scroll-gutter';
11
- var getKeyboardHeight = exports.getKeyboardHeight = function getKeyboardHeight(state) {
12
- if (state) {
13
- var scrollGutterPluginState = (0, _pluginKey.getScrollGutterPluginState)(state);
14
- return scrollGutterPluginState ? scrollGutterPluginState.keyboardHeight : undefined;
15
- }
16
- };
17
11
 
18
12
  /**
19
13
  * Create a gutter element that can be added or removed from the DOM.
@@ -3,19 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getKeyboardHeight = exports.default = void 0;
6
+ 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 _getKeyboardHeight2 = require("./util/get-keyboard-height");
10
11
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
11
12
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
13
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
- var getKeyboardHeight = exports.getKeyboardHeight = function getKeyboardHeight(state) {
14
- if (state) {
15
- var scrollGutterPluginState = (0, _pluginKey.getScrollGutterPluginState)(state);
16
- return scrollGutterPluginState ? scrollGutterPluginState.keyboardHeight : undefined;
17
- }
18
- };
19
14
  var MIN_TAP_SIZE_IN_PX = 40;
20
15
  function supportsIntersectionObserver() {
21
16
  if (typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window && 'intersectionRatio' in
@@ -241,7 +236,7 @@ var _default = exports.default = function _default() {
241
236
  var elementHeight = Math.round(entry.contentRect.height);
242
237
  if (entry.target === scrollElement) {
243
238
  var _getKeyboardHeight;
244
- var keyboardHeight = (_getKeyboardHeight = getKeyboardHeight(_view === null || _view === void 0 ? void 0 : _view.state)) !== null && _getKeyboardHeight !== void 0 ? _getKeyboardHeight : 0;
239
+ var keyboardHeight = (_getKeyboardHeight = (0, _getKeyboardHeight2.getKeyboardHeight)(_view === null || _view === void 0 ? void 0 : _view.state)) !== null && _getKeyboardHeight !== void 0 ? _getKeyboardHeight : 0;
245
240
  viewportElementHeight = elementHeight - keyboardHeight;
246
241
  } else if (entry.target === editorParentElement) {
247
242
  contentElementHeight = elementHeight - (gutter.isMounted() ? gutterSize : 0);
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getKeyboardHeight = void 0;
7
+ var _pluginKey = require("../plugin-key");
8
+ var getKeyboardHeight = exports.getKeyboardHeight = function getKeyboardHeight(state) {
9
+ if (state) {
10
+ var scrollGutterPluginState = (0, _pluginKey.getScrollGutterPluginState)(state);
11
+ return scrollGutterPluginState ? scrollGutterPluginState.keyboardHeight : undefined;
12
+ }
13
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -4,16 +4,17 @@ import { baseKeymap } from '@atlaskit/editor-prosemirror/commands';
4
4
  import { history } from '@atlaskit/editor-prosemirror/history';
5
5
  import { fg } from '@atlaskit/platform-feature-flags';
6
6
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
- import { setKeyboardHeight } from './commands';
7
+ import { setKeyboardHeight } from './editor-commands/set-keyboard-height';
8
8
  import disableSpellcheckingPlugin from './pm-plugins/disable-spell-checking';
9
9
  import filterStepsPlugin from './pm-plugins/filter-steps';
10
10
  import frozenEditor from './pm-plugins/frozen-editor';
11
11
  import inlineCursorTargetPlugin from './pm-plugins/inline-cursor-target';
12
12
  import { createLazyNodeViewDecorationPlugin } from './pm-plugins/lazy-node-view-decoration';
13
13
  import newlinePreserveMarksPlugin from './pm-plugins/newline-preserve-marks';
14
- import scrollGutter, { getKeyboardHeight } from './pm-plugins/scroll-gutter';
15
- import scrollGutterNext from './pm-plugins/scroll-gutter/next';
16
- import { inputTracking } from './utils/inputTrackingConfig';
14
+ import scrollGutter from './pm-plugins/scroll-gutter/plugin';
15
+ import scrollGutterNext from './pm-plugins/scroll-gutter/plugin-next';
16
+ import { getKeyboardHeight } from './pm-plugins/scroll-gutter/util/get-keyboard-height';
17
+ import { inputTracking } from './pm-plugins/utils/inputTrackingConfig';
17
18
  const basePlugin = ({
18
19
  config: options,
19
20
  api
@@ -1,4 +1,4 @@
1
- import { scrollGutterPluginKey } from './pm-plugins/scroll-gutter/plugin-key';
1
+ import { scrollGutterPluginKey } from '../pm-plugins/scroll-gutter/plugin-key';
2
2
  export const setKeyboardHeight = keyboardHeight => (state, dispatch) => {
3
3
  const {
4
4
  tr
@@ -1,2 +1,2 @@
1
- import basePlugin from './plugin';
1
+ import basePlugin from './basePlugin';
2
2
  export { basePlugin };
@@ -4,8 +4,8 @@ import { isPerformanceAPIAvailable, isPerformanceObserverAvailable } from '@atla
4
4
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
5
  import { getAnalyticsEventSeverity } from '@atlaskit/editor-common/utils/analytics';
6
6
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
7
- import { setInteractionType } from '../utils/frozen-editor';
8
- import InputLatencyTracker from '../utils/input-latency-tracking';
7
+ import { setInteractionType } from './utils/frozen-editor';
8
+ import InputLatencyTracker from './utils/input-latency-tracking';
9
9
  export const frozenEditorPluginKey = new PluginKey('frozenEditor');
10
10
  const DEFAULT_KEYSTROKE_SAMPLING_LIMIT = 100;
11
11
  const DEFAULT_SLOW_THRESHOLD = 300;
@@ -1,13 +1,7 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { getScrollGutterPluginState, scrollGutterPluginKey } from './plugin-key';
2
+ import { scrollGutterPluginKey } from './plugin-key';
3
3
  const GUTTER_SIZE_IN_PX = 120;
4
4
  const GUTTER_SELECTOR_NAME = 'editor-scroll-gutter';
5
- export const getKeyboardHeight = state => {
6
- if (state) {
7
- const scrollGutterPluginState = getScrollGutterPluginState(state);
8
- return scrollGutterPluginState ? scrollGutterPluginState.keyboardHeight : undefined;
9
- }
10
- };
11
5
 
12
6
  /**
13
7
  * Create a gutter element that can be added or removed from the DOM.
@@ -1,12 +1,7 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { GUTTER_SELECTOR, GUTTER_SIZE_IN_PX, isEmptyDocument } from '@atlaskit/editor-common/utils';
3
- import { getScrollGutterPluginState, scrollGutterPluginKey } from './plugin-key';
4
- export const getKeyboardHeight = state => {
5
- if (state) {
6
- const scrollGutterPluginState = getScrollGutterPluginState(state);
7
- return scrollGutterPluginState ? scrollGutterPluginState.keyboardHeight : undefined;
8
- }
9
- };
3
+ import { scrollGutterPluginKey } from './plugin-key';
4
+ import { getKeyboardHeight } from './util/get-keyboard-height';
10
5
  const MIN_TAP_SIZE_IN_PX = 40;
11
6
  function supportsIntersectionObserver() {
12
7
  if (typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window && 'intersectionRatio' in
@@ -0,0 +1,7 @@
1
+ import { getScrollGutterPluginState } from '../plugin-key';
2
+ export const getKeyboardHeight = state => {
3
+ if (state) {
4
+ const scrollGutterPluginState = getScrollGutterPluginState(state);
5
+ return scrollGutterPluginState ? scrollGutterPluginState.keyboardHeight : undefined;
6
+ }
7
+ };
@@ -7,16 +7,17 @@ import { baseKeymap } from '@atlaskit/editor-prosemirror/commands';
7
7
  import { history } from '@atlaskit/editor-prosemirror/history';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
9
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
10
- import { setKeyboardHeight } from './commands';
10
+ import { setKeyboardHeight } from './editor-commands/set-keyboard-height';
11
11
  import disableSpellcheckingPlugin from './pm-plugins/disable-spell-checking';
12
12
  import filterStepsPlugin from './pm-plugins/filter-steps';
13
13
  import frozenEditor from './pm-plugins/frozen-editor';
14
14
  import inlineCursorTargetPlugin from './pm-plugins/inline-cursor-target';
15
15
  import { createLazyNodeViewDecorationPlugin } from './pm-plugins/lazy-node-view-decoration';
16
16
  import newlinePreserveMarksPlugin from './pm-plugins/newline-preserve-marks';
17
- import scrollGutter, { getKeyboardHeight } from './pm-plugins/scroll-gutter';
18
- import scrollGutterNext from './pm-plugins/scroll-gutter/next';
19
- import { inputTracking } from './utils/inputTrackingConfig';
17
+ import scrollGutter from './pm-plugins/scroll-gutter/plugin';
18
+ import scrollGutterNext from './pm-plugins/scroll-gutter/plugin-next';
19
+ import { getKeyboardHeight } from './pm-plugins/scroll-gutter/util/get-keyboard-height';
20
+ import { inputTracking } from './pm-plugins/utils/inputTrackingConfig';
20
21
  var basePlugin = function basePlugin(_ref) {
21
22
  var _api$featureFlags;
22
23
  var options = _ref.config,
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { scrollGutterPluginKey } from './pm-plugins/scroll-gutter/plugin-key';
1
+ import { scrollGutterPluginKey } from '../pm-plugins/scroll-gutter/plugin-key';
2
2
  export var setKeyboardHeight = function setKeyboardHeight(keyboardHeight) {
3
3
  return function (state, dispatch) {
4
4
  var tr = state.tr;
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import basePlugin from './plugin';
1
+ import basePlugin from './basePlugin';
2
2
  export { basePlugin };
@@ -7,8 +7,8 @@ import { isPerformanceAPIAvailable, isPerformanceObserverAvailable } from '@atla
7
7
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
8
8
  import { getAnalyticsEventSeverity } from '@atlaskit/editor-common/utils/analytics';
9
9
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
10
- import { setInteractionType } from '../utils/frozen-editor';
11
- import InputLatencyTracker from '../utils/input-latency-tracking';
10
+ import { setInteractionType } from './utils/frozen-editor';
11
+ import InputLatencyTracker from './utils/input-latency-tracking';
12
12
  export var frozenEditorPluginKey = new PluginKey('frozenEditor');
13
13
  var DEFAULT_KEYSTROKE_SAMPLING_LIMIT = 100;
14
14
  var DEFAULT_SLOW_THRESHOLD = 300;
@@ -1,13 +1,7 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { getScrollGutterPluginState, scrollGutterPluginKey } from './plugin-key';
2
+ import { scrollGutterPluginKey } from './plugin-key';
3
3
  var GUTTER_SIZE_IN_PX = 120;
4
4
  var GUTTER_SELECTOR_NAME = 'editor-scroll-gutter';
5
- export var getKeyboardHeight = function getKeyboardHeight(state) {
6
- if (state) {
7
- var scrollGutterPluginState = getScrollGutterPluginState(state);
8
- return scrollGutterPluginState ? scrollGutterPluginState.keyboardHeight : undefined;
9
- }
10
- };
11
5
 
12
6
  /**
13
7
  * Create a gutter element that can be added or removed from the DOM.
@@ -3,13 +3,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
3
3
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
4
4
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
5
  import { GUTTER_SELECTOR, GUTTER_SIZE_IN_PX, isEmptyDocument } from '@atlaskit/editor-common/utils';
6
- import { getScrollGutterPluginState, scrollGutterPluginKey } from './plugin-key';
7
- export var getKeyboardHeight = function getKeyboardHeight(state) {
8
- if (state) {
9
- var scrollGutterPluginState = getScrollGutterPluginState(state);
10
- return scrollGutterPluginState ? scrollGutterPluginState.keyboardHeight : undefined;
11
- }
12
- };
6
+ import { scrollGutterPluginKey } from './plugin-key';
7
+ import { getKeyboardHeight } from './util/get-keyboard-height';
13
8
  var MIN_TAP_SIZE_IN_PX = 40;
14
9
  function supportsIntersectionObserver() {
15
10
  if (typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window && 'intersectionRatio' in
@@ -0,0 +1,7 @@
1
+ import { getScrollGutterPluginState } from '../plugin-key';
2
+ export var getKeyboardHeight = function getKeyboardHeight(state) {
3
+ if (state) {
4
+ var scrollGutterPluginState = getScrollGutterPluginState(state);
5
+ return scrollGutterPluginState ? scrollGutterPluginState.keyboardHeight : undefined;
6
+ }
7
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { type BasePlugin } from './basePluginType';
2
+ declare const basePlugin: BasePlugin;
3
+ export default basePlugin;
@@ -1,8 +1,8 @@
1
1
  import type { BrowserFreezetracking, InputTracking, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
3
3
  import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
4
- import { setKeyboardHeight } from './commands';
5
- import type { ScrollGutterPluginOptions } from './pm-plugins/scroll-gutter';
4
+ import { type setKeyboardHeight } from './editor-commands/set-keyboard-height';
5
+ import type { ScrollGutterPluginOptions } from './pm-plugins/scroll-gutter/plugin';
6
6
  export interface BasePluginOptions {
7
7
  allowScrollGutter?: ScrollGutterPluginOptions;
8
8
  allowInlineCursorTarget?: boolean;
@@ -27,5 +27,3 @@ export type BasePlugin = NextEditorPlugin<'base', {
27
27
  setKeyboardHeight: typeof setKeyboardHeight;
28
28
  };
29
29
  }>;
30
- declare const basePlugin: BasePlugin;
31
- export default basePlugin;
@@ -1,5 +1,5 @@
1
- import basePlugin from './plugin';
2
- import type { BasePlugin, BasePluginOptions, BasePluginState } from './plugin';
3
- import type { ScrollGutterPluginOptions } from './pm-plugins/scroll-gutter';
1
+ import basePlugin from './basePlugin';
2
+ import type { BasePlugin, BasePluginOptions, BasePluginState } from './basePluginType';
3
+ import type { ScrollGutterPluginOptions } from './pm-plugins/scroll-gutter/plugin';
4
4
  export { basePlugin };
5
5
  export type { BasePlugin, BasePluginState, BasePluginOptions, ScrollGutterPluginOptions };
@@ -1,7 +1,5 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- export declare const getKeyboardHeight: (state?: EditorState) => number | undefined;
5
3
  export type ScrollGutterPluginOptions = {
6
4
  /** Element the page uses for scrolling */
7
5
  getScrollElement?: (view: EditorView) => HTMLElement | null;
@@ -1,7 +1,5 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- export declare const getKeyboardHeight: (state?: EditorState) => number | undefined;
5
3
  export type ScrollGutterPluginOptions = {
6
4
  /** Element the page uses for scrolling */
7
5
  getScrollElement?: (view: EditorView) => HTMLElement | null;
@@ -0,0 +1,2 @@
1
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
+ export declare const getKeyboardHeight: (state?: EditorState) => number | undefined;
@@ -0,0 +1,3 @@
1
+ import { type BasePlugin } from './basePluginType';
2
+ declare const basePlugin: BasePlugin;
3
+ export default basePlugin;
@@ -1,8 +1,8 @@
1
1
  import type { BrowserFreezetracking, InputTracking, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
3
3
  import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
4
- import { setKeyboardHeight } from './commands';
5
- import type { ScrollGutterPluginOptions } from './pm-plugins/scroll-gutter';
4
+ import { type setKeyboardHeight } from './editor-commands/set-keyboard-height';
5
+ import type { ScrollGutterPluginOptions } from './pm-plugins/scroll-gutter/plugin';
6
6
  export interface BasePluginOptions {
7
7
  allowScrollGutter?: ScrollGutterPluginOptions;
8
8
  allowInlineCursorTarget?: boolean;
@@ -30,5 +30,3 @@ export type BasePlugin = NextEditorPlugin<'base', {
30
30
  setKeyboardHeight: typeof setKeyboardHeight;
31
31
  };
32
32
  }>;
33
- declare const basePlugin: BasePlugin;
34
- export default basePlugin;
@@ -1,5 +1,5 @@
1
- import basePlugin from './plugin';
2
- import type { BasePlugin, BasePluginOptions, BasePluginState } from './plugin';
3
- import type { ScrollGutterPluginOptions } from './pm-plugins/scroll-gutter';
1
+ import basePlugin from './basePlugin';
2
+ import type { BasePlugin, BasePluginOptions, BasePluginState } from './basePluginType';
3
+ import type { ScrollGutterPluginOptions } from './pm-plugins/scroll-gutter/plugin';
4
4
  export { basePlugin };
5
5
  export type { BasePlugin, BasePluginState, BasePluginOptions, ScrollGutterPluginOptions };
@@ -1,7 +1,5 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- export declare const getKeyboardHeight: (state?: EditorState) => number | undefined;
5
3
  export type ScrollGutterPluginOptions = {
6
4
  /** Element the page uses for scrolling */
7
5
  getScrollElement?: (view: EditorView) => HTMLElement | null;
@@ -1,7 +1,5 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- export declare const getKeyboardHeight: (state?: EditorState) => number | undefined;
5
3
  export type ScrollGutterPluginOptions = {
6
4
  /** Element the page uses for scrolling */
7
5
  getScrollElement?: (view: EditorView) => HTMLElement | null;
@@ -0,0 +1,2 @@
1
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
+ export declare const getKeyboardHeight: (state?: EditorState) => number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-base",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "Base plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,10 +32,10 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^46.1.0",
35
- "@atlaskit/editor-common": "^95.7.0",
35
+ "@atlaskit/editor-common": "^95.10.0",
36
36
  "@atlaskit/editor-plugin-context-identifier": "^1.3.0",
37
37
  "@atlaskit/editor-plugin-feature-flags": "^1.2.0",
38
- "@atlaskit/editor-prosemirror": "6.0.0",
38
+ "@atlaskit/editor-prosemirror": "6.2.1",
39
39
  "@atlaskit/platform-feature-flags": "^0.3.0",
40
40
  "@atlaskit/tmp-editor-statsig": "^2.21.0",
41
41
  "@babel/runtime": "^7.0.0"
@@ -47,6 +47,9 @@
47
47
  ],
48
48
  "circular-dependencies": [
49
49
  "file-and-folder-level"
50
+ ],
51
+ "code-structure": [
52
+ "editor-plugin"
50
53
  ]
51
54
  },
52
55
  "@repo/internal": {
File without changes
File without changes
File without changes
File without changes