@atlaskit/editor-plugin-selection 15.0.1 → 15.0.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,35 @@
1
1
  # @atlaskit/editor-plugin-selection
2
2
 
3
+ ## 15.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 15.0.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`76e9f6152bf16`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/76e9f6152bf16) -
14
+ Enable launched synced block integrations and remove obsolete experiment scaffolding.
15
+
16
+ BREAKING: `@atlaskit/tmp-editor-statsig` no longer defines the `platform_synced_block` editor
17
+ experiment. Consumers that use `editorExperiment('platform_synced_block', ...)` to conditionally
18
+ enable synced-block integrations will no longer be able to look up that experiment; synced-block
19
+ integrations are now enabled by default. Remove each lookup and its conditional branch:
20
+
21
+ ```ts
22
+ // Before
23
+ if (editorExperiment('platform_synced_block', true)) {
24
+ enableSyncedBlocks();
25
+ }
26
+
27
+ // After
28
+ enableSyncedBlocks();
29
+ ```
30
+
31
+ - Updated dependencies
32
+
3
33
  ## 15.0.1
4
34
 
5
35
  ### Patch Changes
@@ -10,7 +10,6 @@ var _state = require("@atlaskit/editor-prosemirror/state");
10
10
  var _utils = require("@atlaskit/editor-prosemirror/utils");
11
11
  var _view2 = require("@atlaskit/editor-prosemirror/view");
12
12
  var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
13
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
14
13
  var _types = require("../types");
15
14
  var _gapCursorPluginKey = require("./gap-cursor-plugin-key");
16
15
  var _actions = require("./gap-cursor/actions");
@@ -53,36 +52,15 @@ var plugin = new _safePlugin.SafePlugin({
53
52
  _view.dispatch(_view.state.tr.setSelection(new _selection.GapCursorSelection(_view.state.doc.resolve(0), _selection.Side.LEFT)));
54
53
  });
55
54
  }
56
- return {
57
- update: function update(view) {
58
- if ((0, _experiments.editorExperiment)('platform_synced_block', true)) {
59
- // Caret visibility now handled directly via CSS selector in gapCursorStyles.ts
60
- return;
61
- }
62
- var _gapCursorPluginKey$g = _gapCursorPluginKey.gapCursorPluginKey.getState(view.state),
63
- selectionIsGapCursor = _gapCursorPluginKey$g.selectionIsGapCursor;
64
- /**
65
- * Starting with prosemirror-view 1.19.4, cursor wrapper that previously was hiding cursor doesn't exist:
66
- * https://github.com/ProseMirror/prosemirror-view/commit/4a56bc7b7e61e96ef879d1dae1014ede0fc09e43
67
- *
68
- * Because it was causing issues with RTL: https://github.com/ProseMirror/prosemirror/issues/948
69
- *
70
- * This is the work around which uses `caret-color: transparent` in order to hide regular caret,
71
- * when gap cursor is visible.
72
- *
73
- * Browser support is pretty good: https://caniuse.com/#feat=css-caret-color
74
- */
75
- view.dom.classList.toggle(_selection.hideCaretModifier, selectionIsGapCursor);
76
- }
77
- };
55
+ return {};
78
56
  },
79
57
  props: {
80
58
  decorations: function decorations(editorState) {
81
59
  var doc = editorState.doc,
82
60
  selection = editorState.selection;
83
- var _gapCursorPluginKey$g2 = _gapCursorPluginKey.gapCursorPluginKey.getState(editorState),
84
- displayGapCursor = _gapCursorPluginKey$g2.displayGapCursor,
85
- hideCursor = _gapCursorPluginKey$g2.hideCursor;
61
+ var _gapCursorPluginKey$g = _gapCursorPluginKey.gapCursorPluginKey.getState(editorState),
62
+ displayGapCursor = _gapCursorPluginKey$g.displayGapCursor,
63
+ hideCursor = _gapCursorPluginKey$g.hideCursor;
86
64
  if (selection instanceof _selection.GapCursorSelection && displayGapCursor && !hideCursor) {
87
65
  var $from = selection.$from,
88
66
  side = selection.side;
@@ -1,10 +1,9 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { GapCursorSelection, Side as GapCursorSide, hideCaretModifier, JSON_ID, setGapCursorAtPos, Side } from '@atlaskit/editor-common/selection';
2
+ import { GapCursorSelection, Side as GapCursorSide, JSON_ID, setGapCursorAtPos, Side } from '@atlaskit/editor-common/selection';
3
3
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
4
4
  import { findPositionOfNodeBefore } from '@atlaskit/editor-prosemirror/utils';
5
5
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
6
6
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
7
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
7
  import { selectionPluginKey } from '../types';
9
8
  import { gapCursorPluginKey } from './gap-cursor-plugin-key';
10
9
  import { deleteNode } from './gap-cursor/actions';
@@ -45,29 +44,7 @@ const plugin = new SafePlugin({
45
44
  view.dispatch(view.state.tr.setSelection(new GapCursorSelection(view.state.doc.resolve(0), GapCursorSide.LEFT)));
46
45
  });
47
46
  }
48
- return {
49
- update(view) {
50
- if (editorExperiment('platform_synced_block', true)) {
51
- // Caret visibility now handled directly via CSS selector in gapCursorStyles.ts
52
- return;
53
- }
54
- const {
55
- selectionIsGapCursor
56
- } = gapCursorPluginKey.getState(view.state);
57
- /**
58
- * Starting with prosemirror-view 1.19.4, cursor wrapper that previously was hiding cursor doesn't exist:
59
- * https://github.com/ProseMirror/prosemirror-view/commit/4a56bc7b7e61e96ef879d1dae1014ede0fc09e43
60
- *
61
- * Because it was causing issues with RTL: https://github.com/ProseMirror/prosemirror/issues/948
62
- *
63
- * This is the work around which uses `caret-color: transparent` in order to hide regular caret,
64
- * when gap cursor is visible.
65
- *
66
- * Browser support is pretty good: https://caniuse.com/#feat=css-caret-color
67
- */
68
- view.dom.classList.toggle(hideCaretModifier, selectionIsGapCursor);
69
- }
70
- };
47
+ return {};
71
48
  },
72
49
  props: {
73
50
  decorations: editorState => {
@@ -1,10 +1,9 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { GapCursorSelection, Side as GapCursorSide, hideCaretModifier, JSON_ID, setGapCursorAtPos, Side } from '@atlaskit/editor-common/selection';
2
+ import { GapCursorSelection, Side as GapCursorSide, JSON_ID, setGapCursorAtPos, Side } from '@atlaskit/editor-common/selection';
3
3
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
4
4
  import { findPositionOfNodeBefore } from '@atlaskit/editor-prosemirror/utils';
5
5
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
6
6
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
7
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
7
  import { selectionPluginKey } from '../types';
9
8
  import { gapCursorPluginKey } from './gap-cursor-plugin-key';
10
9
  import { deleteNode } from './gap-cursor/actions';
@@ -47,36 +46,15 @@ var plugin = new SafePlugin({
47
46
  _view.dispatch(_view.state.tr.setSelection(new GapCursorSelection(_view.state.doc.resolve(0), GapCursorSide.LEFT)));
48
47
  });
49
48
  }
50
- return {
51
- update: function update(view) {
52
- if (editorExperiment('platform_synced_block', true)) {
53
- // Caret visibility now handled directly via CSS selector in gapCursorStyles.ts
54
- return;
55
- }
56
- var _gapCursorPluginKey$g = gapCursorPluginKey.getState(view.state),
57
- selectionIsGapCursor = _gapCursorPluginKey$g.selectionIsGapCursor;
58
- /**
59
- * Starting with prosemirror-view 1.19.4, cursor wrapper that previously was hiding cursor doesn't exist:
60
- * https://github.com/ProseMirror/prosemirror-view/commit/4a56bc7b7e61e96ef879d1dae1014ede0fc09e43
61
- *
62
- * Because it was causing issues with RTL: https://github.com/ProseMirror/prosemirror/issues/948
63
- *
64
- * This is the work around which uses `caret-color: transparent` in order to hide regular caret,
65
- * when gap cursor is visible.
66
- *
67
- * Browser support is pretty good: https://caniuse.com/#feat=css-caret-color
68
- */
69
- view.dom.classList.toggle(hideCaretModifier, selectionIsGapCursor);
70
- }
71
- };
49
+ return {};
72
50
  },
73
51
  props: {
74
52
  decorations: function decorations(editorState) {
75
53
  var doc = editorState.doc,
76
54
  selection = editorState.selection;
77
- var _gapCursorPluginKey$g2 = gapCursorPluginKey.getState(editorState),
78
- displayGapCursor = _gapCursorPluginKey$g2.displayGapCursor,
79
- hideCursor = _gapCursorPluginKey$g2.hideCursor;
55
+ var _gapCursorPluginKey$g = gapCursorPluginKey.getState(editorState),
56
+ displayGapCursor = _gapCursorPluginKey$g.displayGapCursor,
57
+ hideCursor = _gapCursorPluginKey$g.hideCursor;
80
58
  if (selection instanceof GapCursorSelection && displayGapCursor && !hideCursor) {
81
59
  var $from = selection.$from,
82
60
  side = selection.side;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection",
3
- "version": "15.0.1",
3
+ "version": "15.0.3",
4
4
  "description": "Selection plugin for @atlaskit/editor-core",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -24,12 +24,12 @@
24
24
  "@atlaskit/editor-prosemirror": "^8.0.0",
25
25
  "@atlaskit/editor-shared-styles": "^4.0.0",
26
26
  "@atlaskit/editor-tables": "^3.0.0",
27
- "@atlaskit/tmp-editor-statsig": "^148.0.0",
27
+ "@atlaskit/tmp-editor-statsig": "^150.0.0",
28
28
  "@atlaskit/tokens": "^16.7.0",
29
29
  "@babel/runtime": "^7.0.0"
30
30
  },
31
31
  "peerDependencies": {
32
- "@atlaskit/editor-common": "^119.5.0",
32
+ "@atlaskit/editor-common": "^119.9.0",
33
33
  "react": "^18.2.0 || ^19.2.0"
34
34
  },
35
35
  "techstack": {