@atlaskit/editor-core 187.47.6 → 187.48.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 (124) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/editor-next/index.js +2 -2
  3. package/dist/cjs/index.js +7 -7
  4. package/dist/cjs/labs/next/presets/default.js +2 -2
  5. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +8 -20
  6. package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +4 -4
  7. package/dist/cjs/plugins/index.js +0 -7
  8. package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +1 -2
  9. package/dist/cjs/test-utils.js +2 -2
  10. package/dist/cjs/version-wrapper.js +1 -1
  11. package/dist/es2019/editor-next/index.js +1 -1
  12. package/dist/es2019/index.js +1 -1
  13. package/dist/es2019/labs/next/presets/default.js +1 -1
  14. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +9 -19
  15. package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +5 -5
  16. package/dist/es2019/plugins/index.js +0 -1
  17. package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +1 -1
  18. package/dist/es2019/test-utils.js +1 -1
  19. package/dist/es2019/version-wrapper.js +1 -1
  20. package/dist/esm/editor-next/index.js +1 -1
  21. package/dist/esm/index.js +1 -1
  22. package/dist/esm/labs/next/presets/default.js +1 -1
  23. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +9 -21
  24. package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +5 -5
  25. package/dist/esm/plugins/index.js +0 -1
  26. package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +1 -1
  27. package/dist/esm/test-utils.js +1 -1
  28. package/dist/esm/version-wrapper.js +1 -1
  29. package/dist/types/create-editor/create-plugins-list.d.ts +1 -1
  30. package/dist/types/index.d.ts +1 -1
  31. package/dist/types/labs/next/presets/default.d.ts +1 -1
  32. package/dist/types/plugins/alignment/ui/ToolbarAlignment/index.d.ts +0 -1
  33. package/dist/types/plugins/code-block/ide-ux/quote-handling.d.ts +1 -1
  34. package/dist/types/plugins/index.d.ts +0 -1
  35. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
  36. package/dist/types/ui/ConfigPanel/FormErrorBoundary.d.ts +1 -1
  37. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  38. package/dist/types-ts4.5/create-editor/create-plugins-list.d.ts +1 -1
  39. package/dist/types-ts4.5/index.d.ts +1 -1
  40. package/dist/types-ts4.5/labs/next/presets/default.d.ts +1 -1
  41. package/dist/types-ts4.5/plugins/alignment/ui/ToolbarAlignment/index.d.ts +0 -1
  42. package/dist/types-ts4.5/plugins/code-block/ide-ux/quote-handling.d.ts +1 -1
  43. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  44. package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
  45. package/dist/types-ts4.5/ui/ConfigPanel/FormErrorBoundary.d.ts +1 -1
  46. package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
  47. package/package.json +8 -9
  48. package/report.api.md +3 -26
  49. package/tmp/api-report-tmp.d.ts +3 -26
  50. package/dist/cjs/plugins/base/commands.js +0 -20
  51. package/dist/cjs/plugins/base/index.js +0 -13
  52. package/dist/cjs/plugins/base/plugin.js +0 -143
  53. package/dist/cjs/plugins/base/pm-plugins/context-identifier.js +0 -58
  54. package/dist/cjs/plugins/base/pm-plugins/disable-spell-checking.js +0 -63
  55. package/dist/cjs/plugins/base/pm-plugins/filter-steps.js +0 -34
  56. package/dist/cjs/plugins/base/pm-plugins/fix-chrome-88-selection.js +0 -34
  57. package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +0 -265
  58. package/dist/cjs/plugins/base/pm-plugins/inline-cursor-target.js +0 -183
  59. package/dist/cjs/plugins/base/pm-plugins/newline-preserve-marks.js +0 -34
  60. package/dist/cjs/plugins/base/pm-plugins/scroll-gutter/index.js +0 -262
  61. package/dist/cjs/plugins/base/pm-plugins/scroll-gutter/plugin-key.js +0 -15
  62. package/dist/cjs/plugins/base/utils/frozen-editor.js +0 -11
  63. package/dist/cjs/plugins/base/utils/input-latency-tracking.js +0 -134
  64. package/dist/cjs/ui/Dropdown/index.js +0 -9
  65. package/dist/es2019/plugins/base/commands.js +0 -13
  66. package/dist/es2019/plugins/base/index.js +0 -2
  67. package/dist/es2019/plugins/base/plugin.js +0 -113
  68. package/dist/es2019/plugins/base/pm-plugins/context-identifier.js +0 -43
  69. package/dist/es2019/plugins/base/pm-plugins/disable-spell-checking.js +0 -54
  70. package/dist/es2019/plugins/base/pm-plugins/filter-steps.js +0 -23
  71. package/dist/es2019/plugins/base/pm-plugins/fix-chrome-88-selection.js +0 -24
  72. package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +0 -258
  73. package/dist/es2019/plugins/base/pm-plugins/inline-cursor-target.js +0 -186
  74. package/dist/es2019/plugins/base/pm-plugins/newline-preserve-marks.js +0 -20
  75. package/dist/es2019/plugins/base/pm-plugins/scroll-gutter/index.js +0 -242
  76. package/dist/es2019/plugins/base/pm-plugins/scroll-gutter/plugin-key.js +0 -7
  77. package/dist/es2019/plugins/base/utils/frozen-editor.js +0 -2
  78. package/dist/es2019/plugins/base/utils/input-latency-tracking.js +0 -104
  79. package/dist/es2019/ui/Dropdown/index.js +0 -2
  80. package/dist/esm/plugins/base/commands.js +0 -13
  81. package/dist/esm/plugins/base/index.js +0 -2
  82. package/dist/esm/plugins/base/plugin.js +0 -131
  83. package/dist/esm/plugins/base/pm-plugins/context-identifier.js +0 -48
  84. package/dist/esm/plugins/base/pm-plugins/disable-spell-checking.js +0 -56
  85. package/dist/esm/plugins/base/pm-plugins/filter-steps.js +0 -27
  86. package/dist/esm/plugins/base/pm-plugins/fix-chrome-88-selection.js +0 -26
  87. package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +0 -251
  88. package/dist/esm/plugins/base/pm-plugins/inline-cursor-target.js +0 -174
  89. package/dist/esm/plugins/base/pm-plugins/newline-preserve-marks.js +0 -26
  90. package/dist/esm/plugins/base/pm-plugins/scroll-gutter/index.js +0 -254
  91. package/dist/esm/plugins/base/pm-plugins/scroll-gutter/plugin-key.js +0 -7
  92. package/dist/esm/plugins/base/utils/frozen-editor.js +0 -4
  93. package/dist/esm/plugins/base/utils/input-latency-tracking.js +0 -128
  94. package/dist/esm/ui/Dropdown/index.js +0 -2
  95. package/dist/types/plugins/base/commands.d.ts +0 -2
  96. package/dist/types/plugins/base/index.d.ts +0 -5
  97. package/dist/types/plugins/base/plugin.d.ts +0 -25
  98. package/dist/types/plugins/base/pm-plugins/context-identifier.d.ts +0 -13
  99. package/dist/types/plugins/base/pm-plugins/disable-spell-checking.d.ts +0 -4
  100. package/dist/types/plugins/base/pm-plugins/filter-steps.d.ts +0 -4
  101. package/dist/types/plugins/base/pm-plugins/fix-chrome-88-selection.d.ts +0 -5
  102. package/dist/types/plugins/base/pm-plugins/frozen-editor.d.ts +0 -12
  103. package/dist/types/plugins/base/pm-plugins/inline-cursor-target.d.ts +0 -17
  104. package/dist/types/plugins/base/pm-plugins/newline-preserve-marks.d.ts +0 -5
  105. package/dist/types/plugins/base/pm-plugins/scroll-gutter/index.d.ts +0 -22
  106. package/dist/types/plugins/base/pm-plugins/scroll-gutter/plugin-key.d.ts +0 -7
  107. package/dist/types/plugins/base/utils/frozen-editor.d.ts +0 -2
  108. package/dist/types/plugins/base/utils/input-latency-tracking.d.ts +0 -42
  109. package/dist/types/ui/Dropdown/index.d.ts +0 -3
  110. package/dist/types-ts4.5/plugins/base/commands.d.ts +0 -2
  111. package/dist/types-ts4.5/plugins/base/index.d.ts +0 -5
  112. package/dist/types-ts4.5/plugins/base/plugin.d.ts +0 -27
  113. package/dist/types-ts4.5/plugins/base/pm-plugins/context-identifier.d.ts +0 -13
  114. package/dist/types-ts4.5/plugins/base/pm-plugins/disable-spell-checking.d.ts +0 -4
  115. package/dist/types-ts4.5/plugins/base/pm-plugins/filter-steps.d.ts +0 -4
  116. package/dist/types-ts4.5/plugins/base/pm-plugins/fix-chrome-88-selection.d.ts +0 -5
  117. package/dist/types-ts4.5/plugins/base/pm-plugins/frozen-editor.d.ts +0 -12
  118. package/dist/types-ts4.5/plugins/base/pm-plugins/inline-cursor-target.d.ts +0 -17
  119. package/dist/types-ts4.5/plugins/base/pm-plugins/newline-preserve-marks.d.ts +0 -5
  120. package/dist/types-ts4.5/plugins/base/pm-plugins/scroll-gutter/index.d.ts +0 -22
  121. package/dist/types-ts4.5/plugins/base/pm-plugins/scroll-gutter/plugin-key.d.ts +0 -7
  122. package/dist/types-ts4.5/plugins/base/utils/frozen-editor.d.ts +0 -2
  123. package/dist/types-ts4.5/plugins/base/utils/input-latency-tracking.d.ts +0 -42
  124. package/dist/types-ts4.5/ui/Dropdown/index.d.ts +0 -3
package/report.api.md CHANGED
@@ -29,8 +29,8 @@ import type { AnalyticsEventPayload as AnalyticsEventPayload_2 } from '@atlaskit
29
29
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
30
30
  import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
31
31
  import type { AnnotationTypes } from '@atlaskit/adf-schema';
32
+ import type { BasePluginOptions } from '@atlaskit/editor-plugin-base';
32
33
  import type { BlockTypePluginOptions } from '@atlaskit/editor-plugin-block-type';
33
- import { BrowserFreezetracking } from '@atlaskit/editor-common/types';
34
34
  import type { CardOptions } from '@atlaskit/editor-common/card';
35
35
  import { CardProvider } from '@atlaskit/editor-common/provider-factory';
36
36
  import { clearEditorContent } from '@atlaskit/editor-common/commands';
@@ -90,7 +90,6 @@ import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
90
90
  import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
91
91
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
92
92
  import type { InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
93
- import { InputTracking } from '@atlaskit/editor-common/types';
94
93
  import { JSONDocNode } from '@atlaskit/editor-json-transformer/types';
95
94
  import { jsx } from '@emotion/react';
96
95
  import { lightModeStatusColorPalette } from '@atlaskit/editor-common/ui-color';
@@ -146,6 +145,7 @@ import type { Schema } from '@atlaskit/editor-prosemirror/model';
146
145
  import type { SearchProvider } from '@atlaskit/editor-common/provider-factory';
147
146
  import type { SelectionPluginOptions } from '@atlaskit/editor-common/selection';
148
147
  import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
148
+ import { setKeyboardHeight } from '@atlaskit/editor-plugin-base';
149
149
  import { setTextSelection } from '@atlaskit/editor-common/utils';
150
150
  import type { SEVERITY } from '@atlaskit/editor-common/utils';
151
151
  import type { TaskDecisionProvider } from '@atlaskit/task-decision';
@@ -258,20 +258,6 @@ export class AnnotationUpdateEmitter extends EventEmitter_2 {
258
258
  on(event: UpdateEvent, listener: (annotationId: string) => void): this;
259
259
  }
260
260
 
261
- // @public (undocumented)
262
- interface BasePluginOptions {
263
- // (undocumented)
264
- allowInlineCursorTarget?: boolean;
265
- // (undocumented)
266
- allowScrollGutter?: ScrollGutterPluginOptions;
267
- // (undocumented)
268
- browserFreezeTracking?: BrowserFreezetracking;
269
- // (undocumented)
270
- inputTracking?: InputTracking;
271
- // (undocumented)
272
- ufo?: boolean;
273
- }
274
-
275
261
  // @public (undocumented)
276
262
  export class BaseReactEditorView<T = {}> extends ReactEditorView_2<T> {}
277
263
 
@@ -1820,14 +1806,6 @@ interface RectData {
1820
1806
  // @public (undocumented)
1821
1807
  export const removeStatus: (showStatusPickerAt: number) => Command;
1822
1808
 
1823
- // @public (undocumented)
1824
- type ScrollGutterPluginOptions = {
1825
- getScrollElement?: (view: EditorView) => HTMLElement | null;
1826
- allowCustomScrollHandler?: boolean;
1827
- persistScrollGutter?: boolean;
1828
- gutterSize?: number;
1829
- };
1830
-
1831
1809
  // @public (undocumented)
1832
1810
  export type SelectionData =
1833
1811
  | AllSelectionData
@@ -1857,8 +1835,7 @@ type SetEditorAPI = (editorApi: PublicPluginAPI<any>) => void;
1857
1835
  // @public (undocumented)
1858
1836
  export const setIsExpanded: (isExpanded: boolean) => Command_2;
1859
1837
 
1860
- // @public (undocumented)
1861
- export const setKeyboardHeight: (keyboardHeight: number) => Command_2;
1838
+ export { setKeyboardHeight };
1862
1839
 
1863
1840
  // @public (undocumented)
1864
1841
  export const setMobilePaddingTop: (paddingTop: number) => Command_2;
@@ -18,8 +18,8 @@ import type { AnalyticsEventPayload as AnalyticsEventPayload_2 } from '@atlaskit
18
18
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
19
19
  import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
20
20
  import type { AnnotationTypes } from '@atlaskit/adf-schema';
21
+ import type { BasePluginOptions } from '@atlaskit/editor-plugin-base';
21
22
  import type { BlockTypePluginOptions } from '@atlaskit/editor-plugin-block-type';
22
- import { BrowserFreezetracking } from '@atlaskit/editor-common/types';
23
23
  import type { CardOptions } from '@atlaskit/editor-common/card';
24
24
  import { CardProvider } from '@atlaskit/editor-common/provider-factory';
25
25
  import { clearEditorContent } from '@atlaskit/editor-common/commands';
@@ -79,7 +79,6 @@ import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
79
79
  import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
80
80
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
81
81
  import type { InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
82
- import { InputTracking } from '@atlaskit/editor-common/types';
83
82
  import { JSONDocNode } from '@atlaskit/editor-json-transformer/types';
84
83
  import { jsx } from '@emotion/react';
85
84
  import { lightModeStatusColorPalette } from '@atlaskit/editor-common/ui-color';
@@ -135,6 +134,7 @@ import type { Schema } from '@atlaskit/editor-prosemirror/model';
135
134
  import type { SearchProvider } from '@atlaskit/editor-common/provider-factory';
136
135
  import type { SelectionPluginOptions } from '@atlaskit/editor-common/selection';
137
136
  import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
137
+ import { setKeyboardHeight } from '@atlaskit/editor-plugin-base';
138
138
  import { setTextSelection } from '@atlaskit/editor-common/utils';
139
139
  import type { SEVERITY } from '@atlaskit/editor-common/utils';
140
140
  import type { TaskDecisionProvider } from '@atlaskit/task-decision';
@@ -243,20 +243,6 @@ export class AnnotationUpdateEmitter extends EventEmitter_2 {
243
243
  on(event: UpdateEvent, listener: (annotationId: string) => void): this;
244
244
  }
245
245
 
246
- // @public (undocumented)
247
- interface BasePluginOptions {
248
- // (undocumented)
249
- allowInlineCursorTarget?: boolean;
250
- // (undocumented)
251
- allowScrollGutter?: ScrollGutterPluginOptions;
252
- // (undocumented)
253
- browserFreezeTracking?: BrowserFreezetracking;
254
- // (undocumented)
255
- inputTracking?: InputTracking;
256
- // (undocumented)
257
- ufo?: boolean;
258
- }
259
-
260
246
  // @public (undocumented)
261
247
  export class BaseReactEditorView<T = {}> extends ReactEditorView_2<T> {
262
248
  }
@@ -1636,14 +1622,6 @@ interface RectData {
1636
1622
  // @public (undocumented)
1637
1623
  export const removeStatus: (showStatusPickerAt: number) => Command;
1638
1624
 
1639
- // @public (undocumented)
1640
- type ScrollGutterPluginOptions = {
1641
- getScrollElement?: (view: EditorView) => HTMLElement | null;
1642
- allowCustomScrollHandler?: boolean;
1643
- persistScrollGutter?: boolean;
1644
- gutterSize?: number;
1645
- };
1646
-
1647
1625
  // @public (undocumented)
1648
1626
  export type SelectionData = AllSelectionData | CellSelectionData | GapSelectionData | NodeSelectionData | TextSelectionData;
1649
1627
 
@@ -1668,8 +1646,7 @@ type SetEditorAPI = (editorApi: PublicPluginAPI<any>) => void;
1668
1646
  // @public (undocumented)
1669
1647
  export const setIsExpanded: (isExpanded: boolean) => Command_2;
1670
1648
 
1671
- // @public (undocumented)
1672
- export const setKeyboardHeight: (keyboardHeight: number) => Command_2;
1649
+ export { setKeyboardHeight }
1673
1650
 
1674
1651
  // @public (undocumented)
1675
1652
  export const setMobilePaddingTop: (paddingTop: number) => Command_2;
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.setKeyboardHeight = void 0;
7
- var _pluginKey = require("./pm-plugins/scroll-gutter/plugin-key");
8
- var setKeyboardHeight = function setKeyboardHeight(keyboardHeight) {
9
- return function (state, dispatch) {
10
- var tr = state.tr;
11
- tr.setMeta(_pluginKey.scrollGutterPluginKey, {
12
- keyboardHeight: keyboardHeight
13
- });
14
- if (dispatch) {
15
- dispatch(tr);
16
- }
17
- return true;
18
- };
19
- };
20
- exports.setKeyboardHeight = setKeyboardHeight;
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- Object.defineProperty(exports, "basePlugin", {
8
- enumerable: true,
9
- get: function get() {
10
- return _plugin.default;
11
- }
12
- });
13
- var _plugin = _interopRequireDefault(require("./plugin"));
@@ -1,143 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.isChromeWithSelectionBug = exports.default = void 0;
9
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
- var _commands = require("@atlaskit/editor-prosemirror/commands");
11
- var _history = require("@atlaskit/editor-prosemirror/history");
12
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
- var _utils = require("@atlaskit/editor-common/utils");
14
- var _adfSchema = require("@atlaskit/adf-schema");
15
- var _filterSteps = _interopRequireDefault(require("./pm-plugins/filter-steps"));
16
- var _fixChrome88Selection = _interopRequireDefault(require("./pm-plugins/fix-chrome-88-selection"));
17
- var _disableSpellChecking = _interopRequireDefault(require("./pm-plugins/disable-spell-checking"));
18
- var _contextIdentifier = _interopRequireWildcard(require("./pm-plugins/context-identifier"));
19
- var _newlinePreserveMarks = _interopRequireDefault(require("./pm-plugins/newline-preserve-marks"));
20
- var _inlineCursorTarget = _interopRequireDefault(require("./pm-plugins/inline-cursor-target"));
21
- var _scrollGutter = _interopRequireWildcard(require("./pm-plugins/scroll-gutter"));
22
- var _keymaps = require("@atlaskit/editor-common/keymaps");
23
- var _frozenEditor = _interopRequireDefault(require("./pm-plugins/frozen-editor"));
24
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
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; }
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; }
28
- // Chrome >= 88
29
- var isChromeWithSelectionBug = _utils.browser.chrome && _utils.browser.chrome_version >= 88;
30
- exports.isChromeWithSelectionBug = isChromeWithSelectionBug;
31
- var basePlugin = function basePlugin(_ref) {
32
- var _api$featureFlags;
33
- var options = _ref.config,
34
- api = _ref.api;
35
- var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
36
- return {
37
- name: 'base',
38
- getSharedState: function getSharedState(editorState) {
39
- return {
40
- contextIdentifier: (0, _contextIdentifier.getContextIdentifier)(editorState),
41
- keyboardHeight: (0, _scrollGutter.getKeyboardHeight)(editorState)
42
- };
43
- },
44
- pmPlugins: function pmPlugins() {
45
- var plugins = [{
46
- name: 'filterStepsPlugin',
47
- plugin: function plugin(_ref2) {
48
- var dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent;
49
- return (0, _filterSteps.default)(dispatchAnalyticsEvent);
50
- }
51
- }];
52
-
53
- // In Chrome, when the selection is placed between adjacent nodes which are not contenteditatble
54
- // the cursor appears at the right most point of the parent container.
55
- // In Firefox, when the selection is placed between adjacent nodes which are not contenteditatble
56
- // no cursor is presented to users.
57
- // In Safari, when the selection is placed between adjacent nodes which are not contenteditatble
58
- // it is not possible to navigate with arrow keys.
59
- // This plugin works around the issues by inserting decorations between
60
- // inline nodes which are set as contenteditable, and have a zero width space.
61
- plugins.push({
62
- name: 'inlineCursorTargetPlugin',
63
- plugin: function plugin() {
64
- return options && options.allowInlineCursorTarget ? (0, _inlineCursorTarget.default)() : undefined;
65
- }
66
- });
67
- plugins.push({
68
- name: 'newlinePreserveMarksPlugin',
69
- plugin: _newlinePreserveMarks.default
70
- }, {
71
- name: 'frozenEditor',
72
- plugin: function plugin(_ref3) {
73
- var _options$inputTrackin;
74
- var dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent;
75
- return options !== null && options !== void 0 && (_options$inputTrackin = options.inputTracking) !== null && _options$inputTrackin !== void 0 && _options$inputTrackin.enabled || options !== null && options !== void 0 && options.ufo ? (0, _frozenEditor.default)(dispatchAnalyticsEvent, options.inputTracking, options.browserFreezeTracking, options.ufo) : undefined;
76
- }
77
- }, {
78
- name: 'history',
79
- plugin: function plugin() {
80
- return (0, _history.history)();
81
- }
82
- },
83
- // should be last :(
84
- {
85
- name: 'codeBlockIndent',
86
- plugin: function plugin() {
87
- return (0, _keymaps.keymap)(_objectSpread(_objectSpread({}, _commands.baseKeymap), {}, {
88
- 'Mod-[': function Mod() {
89
- return true;
90
- },
91
- 'Mod-]': function Mod() {
92
- return true;
93
- }
94
- }));
95
- }
96
- }, {
97
- name: 'contextIdentifier',
98
- plugin: function plugin(_ref4) {
99
- var dispatch = _ref4.dispatch,
100
- providerFactory = _ref4.providerFactory;
101
- return (0, _contextIdentifier.default)(dispatch, providerFactory);
102
- }
103
- });
104
- if (options && options.allowScrollGutter) {
105
- plugins.push({
106
- name: 'scrollGutterPlugin',
107
- plugin: function plugin() {
108
- return (0, _scrollGutter.default)(options.allowScrollGutter);
109
- }
110
- });
111
- }
112
- if (isChromeWithSelectionBug && !(0, _platformFeatureFlags.getBooleanFF)('platform.editor.disable-chrome-88-selection-fix_uk53m')) {
113
- plugins.push({
114
- name: 'fixChrome88SelectionPlugin',
115
- plugin: function plugin() {
116
- return (0, _fixChrome88Selection.default)();
117
- }
118
- });
119
- }
120
- plugins.push({
121
- name: 'disableSpellcheckingPlugin',
122
- plugin: function plugin() {
123
- return (0, _disableSpellChecking.default)(featureFlags);
124
- }
125
- });
126
- return plugins;
127
- },
128
- nodes: function nodes() {
129
- return [{
130
- name: 'doc',
131
- node: _adfSchema.doc
132
- }, {
133
- name: 'paragraph',
134
- node: _adfSchema.paragraph
135
- }, {
136
- name: 'text',
137
- node: _adfSchema.text
138
- }];
139
- }
140
- };
141
- };
142
- var _default = basePlugin;
143
- exports.default = _default;
@@ -1,58 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.stateKey = exports.getContextIdentifier = exports.default = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
10
- var _state = require("@atlaskit/editor-prosemirror/state");
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
- 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) {
16
- if (state) {
17
- var _stateKey$getState;
18
- return (_stateKey$getState = stateKey.getState(state)) === null || _stateKey$getState === void 0 ? void 0 : _stateKey$getState.contextIdentifierProvider;
19
- }
20
- };
21
- exports.getContextIdentifier = getContextIdentifier;
22
- var _default = function _default(dispatch, providerFactory) {
23
- return new _safePlugin.SafePlugin({
24
- key: stateKey,
25
- state: {
26
- init: function init() {
27
- return {};
28
- },
29
- apply: function apply(tr, pluginState) {
30
- if (tr.getMeta(stateKey)) {
31
- return tr.getMeta(stateKey);
32
- }
33
- return pluginState;
34
- }
35
- },
36
- view: function view(_view) {
37
- var providerPromiseHandler = function providerPromiseHandler(name, providerPromise) {
38
- if (providerPromise && name === 'contextIdentifierProvider') {
39
- providerPromise.then(function (provider) {
40
- var tr = _view.state.tr.setMeta(stateKey, {
41
- contextIdentifierProvider: _objectSpread({}, provider)
42
- });
43
- _view.dispatch(tr);
44
- });
45
- }
46
- };
47
- if (providerFactory) {
48
- providerFactory.subscribe('contextIdentifierProvider', providerPromiseHandler);
49
- }
50
- return {
51
- destroy: function destroy() {
52
- providerFactory && providerFactory.unsubscribe('contextIdentifierProvider', providerPromiseHandler);
53
- }
54
- };
55
- }
56
- });
57
- };
58
- exports.default = _default;
@@ -1,63 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
8
- var _state = require("@atlaskit/editor-prosemirror/state");
9
- var _utils = require("@atlaskit/editor-common/utils");
10
- function getCurrentBrowserAndVersion() {
11
- switch (true) {
12
- case _utils.browser.chrome === true:
13
- return {
14
- browser: 'chrome',
15
- version: _utils.browser.chrome_version
16
- };
17
- case _utils.browser.ie === true:
18
- return {
19
- browser: 'ie',
20
- version: _utils.browser.ie_version
21
- };
22
- case _utils.browser.gecko === true:
23
- return {
24
- browser: 'gecko',
25
- version: _utils.browser.gecko_version
26
- };
27
- case _utils.browser.safari === true:
28
- return {
29
- browser: 'safari',
30
- version: _utils.browser.safari_version
31
- };
32
- }
33
- return undefined;
34
- }
35
- var _default = function _default(featureFlags) {
36
- return new _safePlugin.SafePlugin({
37
- key: new _state.PluginKey('disableSpellchecking'),
38
- props: {
39
- attributes: function attributes(editorState) {
40
- if (!featureFlags) {
41
- return {};
42
- }
43
- var browserConfigFeatureFlag = featureFlags.disableSpellcheckByBrowser;
44
- var userCurrentBrowserAndVersion = getCurrentBrowserAndVersion();
45
- if (!userCurrentBrowserAndVersion || !browserConfigFeatureFlag) {
46
- return {};
47
- }
48
- var browserVersionDisableRange = browserConfigFeatureFlag[userCurrentBrowserAndVersion.browser];
49
- if (!browserVersionDisableRange || !_utils.browser[userCurrentBrowserAndVersion.browser]) {
50
- return {};
51
- }
52
- var shouldDisableSpellcheck = !!browserVersionDisableRange.maximum ? userCurrentBrowserAndVersion.version >= browserVersionDisableRange.minimum && userCurrentBrowserAndVersion.version <= browserVersionDisableRange.maximum : _utils.browser[userCurrentBrowserAndVersion.browser] && userCurrentBrowserAndVersion.version >= browserVersionDisableRange.minimum;
53
- if (shouldDisableSpellcheck) {
54
- return {
55
- spellcheck: 'false'
56
- };
57
- }
58
- return {};
59
- }
60
- }
61
- });
62
- };
63
- exports.default = _default;
@@ -1,34 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
8
- var _analytics = require("@atlaskit/editor-common/analytics");
9
- var hasInvalidSteps = function hasInvalidSteps(tr) {
10
- return (tr.steps || []).some(function (step) {
11
- return step.from > step.to;
12
- });
13
- };
14
- var _default = function _default(dispatchAnalyticsEvent) {
15
- return new _safePlugin.SafePlugin({
16
- filterTransaction: function filterTransaction(transaction) {
17
- if (hasInvalidSteps(transaction)) {
18
- // eslint-disable-next-line no-console
19
- console.warn('The transaction was blocked because it contains invalid steps', transaction.steps);
20
- dispatchAnalyticsEvent({
21
- action: _analytics.ACTION.DISCARDED_INVALID_STEPS_FROM_TRANSACTION,
22
- actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
23
- attributes: {
24
- analyticsEventPayloads: (0, _analytics.getAnalyticsEventsFromTransaction)(transaction)
25
- },
26
- eventType: _analytics.EVENT_TYPE.OPERATIONAL
27
- });
28
- return false;
29
- }
30
- return true;
31
- }
32
- });
33
- };
34
- exports.default = _default;
@@ -1,34 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.fixChromeSelectionKey = exports.default = void 0;
7
- var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
8
- var _state = require("@atlaskit/editor-prosemirror/state");
9
- var _utils = require("@atlaskit/editor-prosemirror/utils");
10
- function isDivHTMLElement(elm) {
11
- return elm.tagName.toLowerCase() === 'div';
12
- }
13
- var fixChromeSelectionKey = new _state.PluginKey('fixChromeSelectionPlugin');
14
- exports.fixChromeSelectionKey = fixChromeSelectionKey;
15
- var _default = function _default() {
16
- return new _safePlugin.SafePlugin({
17
- key: fixChromeSelectionKey,
18
- props: {
19
- handleDOMEvents: {
20
- focus: function focus(view) {
21
- // We don't need to reset when there's a NodeSelection
22
- // It creates other problem. @see HOT-94478
23
- if (isDivHTMLElement(view.dom) && !(0, _utils.isNodeSelection)(view.state.selection)) {
24
- view.dom.style.display = 'inline-block';
25
- view.dom.offsetHeight;
26
- view.dom.style.display = 'block';
27
- }
28
- return false;
29
- }
30
- }
31
- }
32
- });
33
- };
34
- exports.default = _default;