@atlaskit/editor-plugin-card 3.0.5 → 3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 3.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#143055](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/143055)
8
+ [`1580619590f3e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1580619590f3e) -
9
+ [ux] Adds a filterTransaction to the editor-card plugin to ignore bug-causing click transaction
10
+ when inline editing is active and user clicks on scroll gutter of the editor, ignoring the
11
+ transaction coming from editor-core click-area-helper in this edge case.
12
+
3
13
  ## 3.0.5
4
14
 
5
15
  ### Patch Changes
@@ -160,6 +160,20 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
160
160
  return newState;
161
161
  }
162
162
  },
163
+ filterTransaction: function filterTransaction(tr) {
164
+ if ((0, _platformFeatureFlags.fg)('platform_linking_enable_transaction_filtering')) {
165
+ var isOutsideClicked = tr.getMeta('outsideProsemirrorEditorClicked');
166
+ if (isOutsideClicked) {
167
+ var isInlineEditingActive = document.getElementById('sllv-active-inline-edit');
168
+ if (isInlineEditingActive) {
169
+ return false;
170
+ }
171
+ }
172
+ return true;
173
+ } else {
174
+ return true;
175
+ }
176
+ },
163
177
  view: function view(_view) {
164
178
  var domAtPos = _view.domAtPos.bind(_view);
165
179
  var rafCancellationCallbacks = [];
@@ -147,6 +147,20 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
147
147
  return newState;
148
148
  }
149
149
  },
150
+ filterTransaction(tr) {
151
+ if (fg('platform_linking_enable_transaction_filtering')) {
152
+ const isOutsideClicked = tr.getMeta('outsideProsemirrorEditorClicked');
153
+ if (isOutsideClicked) {
154
+ const isInlineEditingActive = document.getElementById('sllv-active-inline-edit');
155
+ if (isInlineEditingActive) {
156
+ return false;
157
+ }
158
+ }
159
+ return true;
160
+ } else {
161
+ return true;
162
+ }
163
+ },
150
164
  view(view) {
151
165
  const domAtPos = view.domAtPos.bind(view);
152
166
  const rafCancellationCallbacks = [];
@@ -147,6 +147,20 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
147
147
  return newState;
148
148
  }
149
149
  },
150
+ filterTransaction: function filterTransaction(tr) {
151
+ if (fg('platform_linking_enable_transaction_filtering')) {
152
+ var isOutsideClicked = tr.getMeta('outsideProsemirrorEditorClicked');
153
+ if (isOutsideClicked) {
154
+ var isInlineEditingActive = document.getElementById('sllv-active-inline-edit');
155
+ if (isInlineEditingActive) {
156
+ return false;
157
+ }
158
+ }
159
+ return true;
160
+ } else {
161
+ return true;
162
+ }
163
+ },
150
164
  view: function view(_view) {
151
165
  var domAtPos = _view.domAtPos.bind(_view);
152
166
  var rafCancellationCallbacks = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -137,6 +137,9 @@
137
137
  },
138
138
  "hardcoded-embeds-only-on-new-line": {
139
139
  "type": "boolean"
140
+ },
141
+ "platform_linking_enable_transaction_filtering": {
142
+ "type": "boolean"
140
143
  }
141
144
  },
142
145
  "stricter": {