@atlaskit/editor-plugin-base 2.0.3 → 2.0.5

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,20 @@
1
1
  # @atlaskit/editor-plugin-base
2
2
 
3
+ ## 2.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#165765](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/165765)
8
+ [`3f441f30e6507`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3f441f30e6507) -
9
+ Bump adf-schema to 46.0.0
10
+ - Updated dependencies
11
+
12
+ ## 2.0.4
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 2.0.3
4
19
 
5
20
  ### Patch Changes
@@ -3,16 +3,22 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.isInlineNodeView = exports.inlineCursorTargetStateKey = exports.default = void 0;
6
+ exports.inlineCursorTargetStateKey = exports.default = void 0;
7
7
  var _browser = require("@atlaskit/editor-common/browser");
8
8
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
9
9
  var _utils = require("@atlaskit/editor-common/utils");
10
10
  var _whitespace = require("@atlaskit/editor-common/whitespace");
11
11
  var _state = require("@atlaskit/editor-prosemirror/state");
12
12
  var _view = require("@atlaskit/editor-prosemirror/view");
13
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
14
  var inlineCursorTargetStateKey = exports.inlineCursorTargetStateKey = new _state.PluginKey('inlineCursorTargetPlugin');
14
- var isInlineNodeView = exports.isInlineNodeView = function isInlineNodeView(node) {
15
- return node && node.type.isInline && !node.type.isText;
15
+ var isInlineNodeView = function isInlineNodeView(node) {
16
+ /**
17
+ * If inlineNodeView is a hardbreak we don't want to add decorations
18
+ * as it breaks soft line breaks for Japanese/Chinese keyboards.
19
+ */
20
+ var isHardBreak = (0, _platformFeatureFlags.fg)('platform_editor_prevent_decorations_on_hardbreak') && (node === null || node === void 0 ? void 0 : node.type) === (node === null || node === void 0 ? void 0 : node.type.schema.nodes.hardBreak);
21
+ return node && node.type.isInline && !node.type.isText && !isHardBreak;
16
22
  };
17
23
  var _default = exports.default = function _default() {
18
24
  return new _safePlugin.SafePlugin({
@@ -4,9 +4,15 @@ import { isTextSelection } from '@atlaskit/editor-common/utils';
4
4
  import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace';
5
5
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
6
6
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  export const inlineCursorTargetStateKey = new PluginKey('inlineCursorTargetPlugin');
8
- export const isInlineNodeView = node => {
9
- return node && node.type.isInline && !node.type.isText;
9
+ const isInlineNodeView = node => {
10
+ /**
11
+ * If inlineNodeView is a hardbreak we don't want to add decorations
12
+ * as it breaks soft line breaks for Japanese/Chinese keyboards.
13
+ */
14
+ const isHardBreak = fg('platform_editor_prevent_decorations_on_hardbreak') && (node === null || node === void 0 ? void 0 : node.type) === (node === null || node === void 0 ? void 0 : node.type.schema.nodes.hardBreak);
15
+ return node && node.type.isInline && !node.type.isText && !isHardBreak;
10
16
  };
11
17
  export default (() => {
12
18
  return new SafePlugin({
@@ -4,9 +4,15 @@ import { isTextSelection } from '@atlaskit/editor-common/utils';
4
4
  import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace';
5
5
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
6
6
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  export var inlineCursorTargetStateKey = new PluginKey('inlineCursorTargetPlugin');
8
- export var isInlineNodeView = function isInlineNodeView(node) {
9
- return node && node.type.isInline && !node.type.isText;
9
+ var isInlineNodeView = function isInlineNodeView(node) {
10
+ /**
11
+ * If inlineNodeView is a hardbreak we don't want to add decorations
12
+ * as it breaks soft line breaks for Japanese/Chinese keyboards.
13
+ */
14
+ var isHardBreak = fg('platform_editor_prevent_decorations_on_hardbreak') && (node === null || node === void 0 ? void 0 : node.type) === (node === null || node === void 0 ? void 0 : node.type.schema.nodes.hardBreak);
15
+ return node && node.type.isInline && !node.type.isText && !isHardBreak;
10
16
  };
11
17
  export default (function () {
12
18
  return new SafePlugin({
@@ -1,9 +1,7 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { Node } from '@atlaskit/editor-prosemirror/model';
3
2
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
4
3
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
5
4
  export declare const inlineCursorTargetStateKey: PluginKey<any>;
6
- export declare const isInlineNodeView: (node: Node | null | undefined) => boolean | null | undefined;
7
5
  export interface InlineCursorTargetState {
8
6
  cursorTarget?: {
9
7
  decorations: (Decoration | null)[];
@@ -1,9 +1,7 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { Node } from '@atlaskit/editor-prosemirror/model';
3
2
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
4
3
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
5
4
  export declare const inlineCursorTargetStateKey: PluginKey<any>;
6
- export declare const isInlineNodeView: (node: Node | null | undefined) => boolean | null | undefined;
7
5
  export interface InlineCursorTargetState {
8
6
  cursorTarget?: {
9
7
  decorations: (Decoration | null)[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-base",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "Base plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,13 +31,13 @@
31
31
  ".": "./src/index.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/adf-schema": "^44.2.0",
35
- "@atlaskit/editor-common": "^94.9.0",
34
+ "@atlaskit/adf-schema": "^46.1.0",
35
+ "@atlaskit/editor-common": "^95.7.0",
36
36
  "@atlaskit/editor-plugin-context-identifier": "^1.3.0",
37
37
  "@atlaskit/editor-plugin-feature-flags": "^1.2.0",
38
38
  "@atlaskit/editor-prosemirror": "6.0.0",
39
39
  "@atlaskit/platform-feature-flags": "^0.3.0",
40
- "@atlaskit/tmp-editor-statsig": "^2.10.0",
40
+ "@atlaskit/tmp-editor-statsig": "^2.21.0",
41
41
  "@babel/runtime": "^7.0.0"
42
42
  },
43
43
  "techstack": {
@@ -78,6 +78,9 @@
78
78
  "platform-feature-flags": {
79
79
  "platform_editor_improved_scroll_gutter": {
80
80
  "type": "boolean"
81
+ },
82
+ "platform_editor_prevent_decorations_on_hardbreak": {
83
+ "type": "boolean"
81
84
  }
82
85
  }
83
86
  }