@atlaskit/editor-plugin-clipboard 5.0.0 → 6.0.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,20 @@
1
1
  # @atlaskit/editor-plugin-clipboard
2
2
 
3
+ ## 6.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4d676bbdb3ce6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4d676bbdb3ce6) -
8
+ ts-ignore added temporarily to unblock local consumption for help-center, will be removed once
9
+ project refs are setup
10
+ - Updated dependencies
11
+
12
+ ## 6.0.0
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 5.0.0
4
19
 
5
20
  ### Patch Changes
@@ -29,7 +44,6 @@
29
44
  shared context or singletons.
30
45
 
31
46
  **HOW TO ADJUST:**
32
-
33
47
  - Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
34
48
  any of these editor plugins.
35
49
  - Ensure the version you install matches the version required by the plugins.
@@ -40,11 +40,17 @@ var createPlugin = exports.createPlugin = function createPlugin(_ref) {
40
40
  };
41
41
  },
42
42
  props: {
43
+ // @ts-ignore - Workaround for help-center local consumption
44
+
43
45
  handleDOMEvents: {
46
+ // @ts-ignore - Workaround for help-center local consumption
47
+
44
48
  cut: function cut(view) {
45
49
  setLastEventType(ClipboardEventType.CUT);
46
50
  return sendClipboardAnalytics(view, dispatchAnalyticsEvent, _analytics.ACTION.CUT);
47
51
  },
52
+ // @ts-ignore - Workaround for help-center local consumption
53
+
48
54
  copy: function copy(view) {
49
55
  setLastEventType(ClipboardEventType.COPY);
50
56
  return sendClipboardAnalytics(view, dispatchAnalyticsEvent, _analytics.ACTION.COPIED);
@@ -115,13 +121,16 @@ var createClipboardSerializer = exports.createClipboardSerializer = function cre
115
121
  if (lastEventType === ClipboardEventType.COPY && ((_content$firstChild2 = content.firstChild) === null || _content$firstChild2 === void 0 ? void 0 : _content$firstChild2.type.name) === 'media') {
116
122
  var _mediaNode$marks;
117
123
  var mediaNode = content.firstChild;
118
- var strippedMediaNode = schema.nodes.media.createChecked(mediaNode.attrs, mediaNode.content, (_mediaNode$marks = mediaNode.marks) === null || _mediaNode$marks === void 0 ? void 0 : _mediaNode$marks.filter(function (mark) {
124
+ var strippedMediaNode = schema.nodes.media.createChecked(mediaNode.attrs, mediaNode.content, // @ts-ignore - Workaround for help-center local consumption
125
+ (_mediaNode$marks = mediaNode.marks) === null || _mediaNode$marks === void 0 ? void 0 : _mediaNode$marks.filter(function (mark) {
119
126
  return mark.type.name !== 'annotation';
120
127
  }));
121
128
  if ((0, _platformFeatureFlags.fg)('platform_editor_fix_captions_on_copy')) {
122
129
  // Content for media parents can include multiple content nodes (media and captions). We now take that
123
130
  // into consideration when we are stripping annotations
124
131
  var contentArray = [strippedMediaNode];
132
+ // @ts-ignore - Workaround for help-center local consumption
133
+
125
134
  content.forEach(function (node) {
126
135
  if (node.type.name !== 'media') {
127
136
  contentArray = [].concat((0, _toConsumableArray2.default)(contentArray), [node]);
@@ -28,11 +28,17 @@ export const createPlugin = ({
28
28
  };
29
29
  },
30
30
  props: {
31
+ // @ts-ignore - Workaround for help-center local consumption
32
+
31
33
  handleDOMEvents: {
34
+ // @ts-ignore - Workaround for help-center local consumption
35
+
32
36
  cut: view => {
33
37
  setLastEventType(ClipboardEventType.CUT);
34
38
  return sendClipboardAnalytics(view, dispatchAnalyticsEvent, ACTION.CUT);
35
39
  },
40
+ // @ts-ignore - Workaround for help-center local consumption
41
+
36
42
  copy: view => {
37
43
  setLastEventType(ClipboardEventType.COPY);
38
44
  return sendClipboardAnalytics(view, dispatchAnalyticsEvent, ACTION.COPIED);
@@ -105,11 +111,14 @@ export const createClipboardSerializer = (schema, getEditorView) => {
105
111
  if (lastEventType === ClipboardEventType.COPY && ((_content$firstChild2 = content.firstChild) === null || _content$firstChild2 === void 0 ? void 0 : _content$firstChild2.type.name) === 'media') {
106
112
  var _mediaNode$marks;
107
113
  const mediaNode = content.firstChild;
108
- const strippedMediaNode = schema.nodes.media.createChecked(mediaNode.attrs, mediaNode.content, (_mediaNode$marks = mediaNode.marks) === null || _mediaNode$marks === void 0 ? void 0 : _mediaNode$marks.filter(mark => mark.type.name !== 'annotation'));
114
+ const strippedMediaNode = schema.nodes.media.createChecked(mediaNode.attrs, mediaNode.content, // @ts-ignore - Workaround for help-center local consumption
115
+ (_mediaNode$marks = mediaNode.marks) === null || _mediaNode$marks === void 0 ? void 0 : _mediaNode$marks.filter(mark => mark.type.name !== 'annotation'));
109
116
  if (fg('platform_editor_fix_captions_on_copy')) {
110
117
  // Content for media parents can include multiple content nodes (media and captions). We now take that
111
118
  // into consideration when we are stripping annotations
112
119
  let contentArray = [strippedMediaNode];
120
+ // @ts-ignore - Workaround for help-center local consumption
121
+
113
122
  content.forEach(node => {
114
123
  if (node.type.name !== 'media') {
115
124
  contentArray = [...contentArray, node];
@@ -33,11 +33,17 @@ export var createPlugin = function createPlugin(_ref) {
33
33
  };
34
34
  },
35
35
  props: {
36
+ // @ts-ignore - Workaround for help-center local consumption
37
+
36
38
  handleDOMEvents: {
39
+ // @ts-ignore - Workaround for help-center local consumption
40
+
37
41
  cut: function cut(view) {
38
42
  setLastEventType(ClipboardEventType.CUT);
39
43
  return sendClipboardAnalytics(view, dispatchAnalyticsEvent, ACTION.CUT);
40
44
  },
45
+ // @ts-ignore - Workaround for help-center local consumption
46
+
41
47
  copy: function copy(view) {
42
48
  setLastEventType(ClipboardEventType.COPY);
43
49
  return sendClipboardAnalytics(view, dispatchAnalyticsEvent, ACTION.COPIED);
@@ -108,13 +114,16 @@ export var createClipboardSerializer = function createClipboardSerializer(schema
108
114
  if (lastEventType === ClipboardEventType.COPY && ((_content$firstChild2 = content.firstChild) === null || _content$firstChild2 === void 0 ? void 0 : _content$firstChild2.type.name) === 'media') {
109
115
  var _mediaNode$marks;
110
116
  var mediaNode = content.firstChild;
111
- var strippedMediaNode = schema.nodes.media.createChecked(mediaNode.attrs, mediaNode.content, (_mediaNode$marks = mediaNode.marks) === null || _mediaNode$marks === void 0 ? void 0 : _mediaNode$marks.filter(function (mark) {
117
+ var strippedMediaNode = schema.nodes.media.createChecked(mediaNode.attrs, mediaNode.content, // @ts-ignore - Workaround for help-center local consumption
118
+ (_mediaNode$marks = mediaNode.marks) === null || _mediaNode$marks === void 0 ? void 0 : _mediaNode$marks.filter(function (mark) {
112
119
  return mark.type.name !== 'annotation';
113
120
  }));
114
121
  if (fg('platform_editor_fix_captions_on_copy')) {
115
122
  // Content for media parents can include multiple content nodes (media and captions). We now take that
116
123
  // into consideration when we are stripping annotations
117
124
  var contentArray = [strippedMediaNode];
125
+ // @ts-ignore - Workaround for help-center local consumption
126
+
118
127
  content.forEach(function (node) {
119
128
  if (node.type.name !== 'media') {
120
129
  contentArray = [].concat(_toConsumableArray(contentArray), [node]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-clipboard",
3
- "version": "5.0.0",
3
+ "version": "6.0.1",
4
4
  "description": "Clipboard plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  "@babel/runtime": "^7.0.0"
33
33
  },
34
34
  "peerDependencies": {
35
- "@atlaskit/editor-common": "^109.0.0",
35
+ "@atlaskit/editor-common": "^110.34.0",
36
36
  "react": "^18.2.0",
37
37
  "react-dom": "^18.2.0"
38
38
  },