@atlaskit/editor-plugin-synced-block 4.8.0 → 4.8.1

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,12 @@
1
1
  # @atlaskit/editor-plugin-synced-block
2
2
 
3
+ ## 4.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`36f3146f35457`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/36f3146f35457) -
8
+ Early return on transformCopied when action is not copy
9
+
3
10
  ## 4.8.0
4
11
 
5
12
  ### Minor Changes
@@ -141,14 +141,12 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
141
141
  var schema = state.schema;
142
142
  var isCopy = isCopyEvent;
143
143
  isCopyEvent = false;
144
- if (!syncBlockStore) {
144
+ if (!syncBlockStore || !isCopy) {
145
145
  return slice;
146
146
  }
147
147
  return (0, _utils.mapSlice)(slice, function (node) {
148
148
  if (node.type.name === 'syncBlock') {
149
- if (isCopy) {
150
- showCopiedFlag(api);
151
- }
149
+ showCopiedFlag(api);
152
150
  return node;
153
151
  }
154
152
  if (node.type.name === 'bodiedSyncBlock' && node.attrs.resourceId) {
@@ -157,9 +155,7 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
157
155
  if (!(0, _utils2.sliceFullyContainsNode)(slice, node)) {
158
156
  return node.content;
159
157
  }
160
- if (isCopy) {
161
- showCopiedFlag(api);
162
- }
158
+ showCopiedFlag(api);
163
159
  var newResourceId = syncBlockStore.referenceManager.generateResourceIdForReference(node.attrs.resourceId);
164
160
  // Convert bodiedSyncBlock to syncBlock
165
161
  // The paste transformation will regenrate the localId
@@ -132,14 +132,12 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
132
132
  } = state;
133
133
  const isCopy = isCopyEvent;
134
134
  isCopyEvent = false;
135
- if (!syncBlockStore) {
135
+ if (!syncBlockStore || !isCopy) {
136
136
  return slice;
137
137
  }
138
138
  return mapSlice(slice, node => {
139
139
  if (node.type.name === 'syncBlock') {
140
- if (isCopy) {
141
- showCopiedFlag(api);
142
- }
140
+ showCopiedFlag(api);
143
141
  return node;
144
142
  }
145
143
  if (node.type.name === 'bodiedSyncBlock' && node.attrs.resourceId) {
@@ -148,9 +146,7 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
148
146
  if (!sliceFullyContainsNode(slice, node)) {
149
147
  return node.content;
150
148
  }
151
- if (isCopy) {
152
- showCopiedFlag(api);
153
- }
149
+ showCopiedFlag(api);
154
150
  const newResourceId = syncBlockStore.referenceManager.generateResourceIdForReference(node.attrs.resourceId);
155
151
  // Convert bodiedSyncBlock to syncBlock
156
152
  // The paste transformation will regenrate the localId
@@ -134,14 +134,12 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
134
134
  var schema = state.schema;
135
135
  var isCopy = isCopyEvent;
136
136
  isCopyEvent = false;
137
- if (!syncBlockStore) {
137
+ if (!syncBlockStore || !isCopy) {
138
138
  return slice;
139
139
  }
140
140
  return mapSlice(slice, function (node) {
141
141
  if (node.type.name === 'syncBlock') {
142
- if (isCopy) {
143
- showCopiedFlag(api);
144
- }
142
+ showCopiedFlag(api);
145
143
  return node;
146
144
  }
147
145
  if (node.type.name === 'bodiedSyncBlock' && node.attrs.resourceId) {
@@ -150,9 +148,7 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
150
148
  if (!sliceFullyContainsNode(slice, node)) {
151
149
  return node.content;
152
150
  }
153
- if (isCopy) {
154
- showCopiedFlag(api);
155
- }
151
+ showCopiedFlag(api);
156
152
  var newResourceId = syncBlockStore.referenceManager.generateResourceIdForReference(node.attrs.resourceId);
157
153
  // Convert bodiedSyncBlock to syncBlock
158
154
  // The paste transformation will regenrate the localId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-synced-block",
3
- "version": "4.8.0",
3
+ "version": "4.8.1",
4
4
  "description": "SyncedBlock plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",