@atlaskit/editor-plugin-base 0.2.13 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-plugin-base
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#63522](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63522) [`906d43c5bb6d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/906d43c5bb6d) - Remove hack for chrome 88 selection bug
8
+
3
9
  ## 0.2.13
4
10
 
5
11
  ### Patch Changes
@@ -5,19 +5,16 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.isChromeWithSelectionBug = exports.default = void 0;
8
+ exports.default = void 0;
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _adfSchema = require("@atlaskit/adf-schema");
11
11
  var _keymaps = require("@atlaskit/editor-common/keymaps");
12
- var _utils = require("@atlaskit/editor-common/utils");
13
12
  var _commands = require("@atlaskit/editor-prosemirror/commands");
14
13
  var _history = require("@atlaskit/editor-prosemirror/history");
15
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
14
  var _commands2 = require("./commands");
17
15
  var _contextIdentifier = _interopRequireWildcard(require("./pm-plugins/context-identifier"));
18
16
  var _disableSpellChecking = _interopRequireDefault(require("./pm-plugins/disable-spell-checking"));
19
17
  var _filterSteps = _interopRequireDefault(require("./pm-plugins/filter-steps"));
20
- var _fixChrome88Selection = _interopRequireDefault(require("./pm-plugins/fix-chrome-88-selection"));
21
18
  var _frozenEditor = _interopRequireDefault(require("./pm-plugins/frozen-editor"));
22
19
  var _inlineCursorTarget = _interopRequireDefault(require("./pm-plugins/inline-cursor-target"));
23
20
  var _newlinePreserveMarks = _interopRequireDefault(require("./pm-plugins/newline-preserve-marks"));
@@ -26,8 +23,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
26
23
  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; }
27
24
  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
25
  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
- // Chrome >= 88
30
- var isChromeWithSelectionBug = exports.isChromeWithSelectionBug = _utils.browser.chrome && _utils.browser.chrome_version >= 88;
31
26
  var basePlugin = function basePlugin(_ref) {
32
27
  var _api$featureFlags;
33
28
  var options = _ref.config,
@@ -112,14 +107,6 @@ var basePlugin = function basePlugin(_ref) {
112
107
  }
113
108
  });
114
109
  }
115
- if (isChromeWithSelectionBug && !(0, _platformFeatureFlags.getBooleanFF)('platform.editor.disable-chrome-88-selection-fix_uk53m')) {
116
- plugins.push({
117
- name: 'fixChrome88SelectionPlugin',
118
- plugin: function plugin() {
119
- return (0, _fixChrome88Selection.default)();
120
- }
121
- });
122
- }
123
110
  plugins.push({
124
111
  name: 'disableSpellcheckingPlugin',
125
112
  plugin: function plugin() {
@@ -1,20 +1,15 @@
1
1
  import { doc, paragraph, text } from '@atlaskit/adf-schema';
2
2
  import { keymap } from '@atlaskit/editor-common/keymaps';
3
- import { browser } from '@atlaskit/editor-common/utils';
4
3
  import { baseKeymap } from '@atlaskit/editor-prosemirror/commands';
5
4
  import { history } from '@atlaskit/editor-prosemirror/history';
6
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
7
5
  import { setKeyboardHeight } from './commands';
8
6
  import contextIdentifierPlugin, { getContextIdentifier } from './pm-plugins/context-identifier';
9
7
  import disableSpellcheckingPlugin from './pm-plugins/disable-spell-checking';
10
8
  import filterStepsPlugin from './pm-plugins/filter-steps';
11
- import fixChrome88SelectionPlugin from './pm-plugins/fix-chrome-88-selection';
12
9
  import frozenEditor from './pm-plugins/frozen-editor';
13
10
  import inlineCursorTargetPlugin from './pm-plugins/inline-cursor-target';
14
11
  import newlinePreserveMarksPlugin from './pm-plugins/newline-preserve-marks';
15
12
  import scrollGutter, { getKeyboardHeight } from './pm-plugins/scroll-gutter';
16
- // Chrome >= 88
17
- export const isChromeWithSelectionBug = browser.chrome && browser.chrome_version >= 88;
18
13
  const basePlugin = ({
19
14
  config: options,
20
15
  api
@@ -88,12 +83,6 @@ const basePlugin = ({
88
83
  plugin: () => scrollGutter(options.allowScrollGutter)
89
84
  });
90
85
  }
91
- if (isChromeWithSelectionBug && !getBooleanFF('platform.editor.disable-chrome-88-selection-fix_uk53m')) {
92
- plugins.push({
93
- name: 'fixChrome88SelectionPlugin',
94
- plugin: () => fixChrome88SelectionPlugin()
95
- });
96
- }
97
86
  plugins.push({
98
87
  name: 'disableSpellcheckingPlugin',
99
88
  plugin: () => disableSpellcheckingPlugin(featureFlags)
@@ -3,21 +3,16 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
3
3
  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) { _defineProperty(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; }
4
4
  import { doc, paragraph, text } from '@atlaskit/adf-schema';
5
5
  import { keymap } from '@atlaskit/editor-common/keymaps';
6
- import { browser } from '@atlaskit/editor-common/utils';
7
6
  import { baseKeymap } from '@atlaskit/editor-prosemirror/commands';
8
7
  import { history } from '@atlaskit/editor-prosemirror/history';
9
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
10
8
  import { setKeyboardHeight } from './commands';
11
9
  import contextIdentifierPlugin, { getContextIdentifier } from './pm-plugins/context-identifier';
12
10
  import disableSpellcheckingPlugin from './pm-plugins/disable-spell-checking';
13
11
  import filterStepsPlugin from './pm-plugins/filter-steps';
14
- import fixChrome88SelectionPlugin from './pm-plugins/fix-chrome-88-selection';
15
12
  import frozenEditor from './pm-plugins/frozen-editor';
16
13
  import inlineCursorTargetPlugin from './pm-plugins/inline-cursor-target';
17
14
  import newlinePreserveMarksPlugin from './pm-plugins/newline-preserve-marks';
18
15
  import scrollGutter, { getKeyboardHeight } from './pm-plugins/scroll-gutter';
19
- // Chrome >= 88
20
- export var isChromeWithSelectionBug = browser.chrome && browser.chrome_version >= 88;
21
16
  var basePlugin = function basePlugin(_ref) {
22
17
  var _api$featureFlags;
23
18
  var options = _ref.config,
@@ -102,14 +97,6 @@ var basePlugin = function basePlugin(_ref) {
102
97
  }
103
98
  });
104
99
  }
105
- if (isChromeWithSelectionBug && !getBooleanFF('platform.editor.disable-chrome-88-selection-fix_uk53m')) {
106
- plugins.push({
107
- name: 'fixChrome88SelectionPlugin',
108
- plugin: function plugin() {
109
- return fixChrome88SelectionPlugin();
110
- }
111
- });
112
- }
113
100
  plugins.push({
114
101
  name: 'disableSpellcheckingPlugin',
115
102
  plugin: function plugin() {
@@ -23,6 +23,5 @@ export type BasePlugin = NextEditorPlugin<'base', {
23
23
  setKeyboardHeight: typeof setKeyboardHeight;
24
24
  };
25
25
  }>;
26
- export declare const isChromeWithSelectionBug: any;
27
26
  declare const basePlugin: BasePlugin;
28
27
  export default basePlugin;
@@ -25,6 +25,5 @@ export type BasePlugin = NextEditorPlugin<'base', {
25
25
  setKeyboardHeight: typeof setKeyboardHeight;
26
26
  };
27
27
  }>;
28
- export declare const isChromeWithSelectionBug: any;
29
28
  declare const basePlugin: BasePlugin;
30
29
  export default basePlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-base",
3
- "version": "0.2.13",
3
+ "version": "0.3.0",
4
4
  "description": "Base plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -10,7 +10,8 @@
10
10
  "atlassian": {
11
11
  "team": "Editor",
12
12
  "singleton": true,
13
- "releaseModel": "continuous"
13
+ "releaseModel": "continuous",
14
+ "runReact18": false
14
15
  },
15
16
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
16
17
  "main": "dist/cjs/index.js",
@@ -32,10 +33,9 @@
32
33
  },
33
34
  "dependencies": {
34
35
  "@atlaskit/adf-schema": "^35.2.0",
35
- "@atlaskit/editor-common": "^76.27.0",
36
+ "@atlaskit/editor-common": "^76.29.0",
36
37
  "@atlaskit/editor-plugin-feature-flags": "^1.0.1",
37
38
  "@atlaskit/editor-prosemirror": "1.1.0",
38
- "@atlaskit/platform-feature-flags": "^0.2.0",
39
39
  "@babel/runtime": "^7.0.0"
40
40
  },
41
41
  "devDependencies": {
@@ -44,7 +44,7 @@
44
44
  "@atlaskit/editor-plugin-emoji": "^1.0.0",
45
45
  "@atlaskit/editor-plugin-guideline": "^0.5.0",
46
46
  "@atlaskit/editor-plugin-selection": "^0.1.0",
47
- "@atlaskit/editor-plugin-table": "^5.6.0",
47
+ "@atlaskit/editor-plugin-table": "^5.7.0",
48
48
  "@atlaskit/editor-plugin-type-ahead": "^0.8.0",
49
49
  "@atlaskit/editor-plugin-width": "^0.2.0",
50
50
  "@atlaskit/util-data-test": "^17.8.0",
@@ -85,10 +85,5 @@
85
85
  ]
86
86
  }
87
87
  },
88
- "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0",
89
- "platform-feature-flags": {
90
- "platform.editor.disable-chrome-88-selection-fix_uk53m": {
91
- "type": "boolean"
92
- }
93
- }
88
+ "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
94
89
  }
package/tsconfig.app.json CHANGED
@@ -37,9 +37,6 @@
37
37
  },
38
38
  {
39
39
  "path": "../editor-plugin-feature-flags/tsconfig.app.json"
40
- },
41
- {
42
- "path": "../../platform/feature-flags/tsconfig.app.json"
43
40
  }
44
41
  ]
45
42
  }
@@ -1,32 +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 = exports.fixChromeSelectionKey = new _state.PluginKey('fixChromeSelectionPlugin');
14
- var _default = exports.default = function _default() {
15
- return new _safePlugin.SafePlugin({
16
- key: fixChromeSelectionKey,
17
- props: {
18
- handleDOMEvents: {
19
- focus: function focus(view) {
20
- // We don't need to reset when there's a NodeSelection
21
- // It creates other problem. @see HOT-94478
22
- if (isDivHTMLElement(view.dom) && !(0, _utils.isNodeSelection)(view.state.selection)) {
23
- view.dom.style.display = 'inline-block';
24
- view.dom.offsetHeight;
25
- view.dom.style.display = 'block';
26
- }
27
- return false;
28
- }
29
- }
30
- }
31
- });
32
- };
@@ -1,24 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
- import { isNodeSelection } from '@atlaskit/editor-prosemirror/utils';
4
- function isDivHTMLElement(elm) {
5
- return elm.tagName.toLowerCase() === 'div';
6
- }
7
- export const fixChromeSelectionKey = new PluginKey('fixChromeSelectionPlugin');
8
- export default (() => new SafePlugin({
9
- key: fixChromeSelectionKey,
10
- props: {
11
- handleDOMEvents: {
12
- focus: view => {
13
- // We don't need to reset when there's a NodeSelection
14
- // It creates other problem. @see HOT-94478
15
- if (isDivHTMLElement(view.dom) && !isNodeSelection(view.state.selection)) {
16
- view.dom.style.display = 'inline-block';
17
- view.dom.offsetHeight;
18
- view.dom.style.display = 'block';
19
- }
20
- return false;
21
- }
22
- }
23
- }
24
- }));
@@ -1,26 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
- import { isNodeSelection } from '@atlaskit/editor-prosemirror/utils';
4
- function isDivHTMLElement(elm) {
5
- return elm.tagName.toLowerCase() === 'div';
6
- }
7
- export var fixChromeSelectionKey = new PluginKey('fixChromeSelectionPlugin');
8
- export default (function () {
9
- return new SafePlugin({
10
- key: fixChromeSelectionKey,
11
- props: {
12
- handleDOMEvents: {
13
- focus: function focus(view) {
14
- // We don't need to reset when there's a NodeSelection
15
- // It creates other problem. @see HOT-94478
16
- if (isDivHTMLElement(view.dom) && !isNodeSelection(view.state.selection)) {
17
- view.dom.style.display = 'inline-block';
18
- view.dom.offsetHeight;
19
- view.dom.style.display = 'block';
20
- }
21
- return false;
22
- }
23
- }
24
- }
25
- });
26
- });
@@ -1,5 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
- export declare const fixChromeSelectionKey: PluginKey<any>;
4
- declare const _default: () => SafePlugin<any>;
5
- export default _default;
@@ -1,5 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
- export declare const fixChromeSelectionKey: PluginKey<any>;
4
- declare const _default: () => SafePlugin<any>;
5
- export default _default;