@atlaskit/editor-plugin-copy-button 1.3.15 → 1.3.17

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,17 @@
1
1
  # @atlaskit/editor-plugin-copy-button
2
2
 
3
+ ## 1.3.17
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 1.3.16
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 1.3.15
4
16
 
5
17
  ### Patch Changes
@@ -33,9 +33,13 @@ function createToolbarCopyCommandForMark(markType, editorAnalyticsApi) {
33
33
  // The "1 1" refers to the start and end depth of the slice
34
34
  // since we're copying the text inside a paragraph, it will always be 1 1
35
35
  // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
36
+ // Ignored via go/ees005
37
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
36
38
  div.firstChild.setAttribute('data-pm-slice', '1 1 []');
37
39
 
38
40
  // If we're copying a hyperlink, we'd copy the url as the fallback plain text
41
+ // Ignored via go/ees005
42
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
39
43
  var linkUrl = domNode.getAttribute('href');
40
44
  (0, _clipboard.copyHTMLToClipboard)(div, markType.name === 'link' && linkUrl ? linkUrl : undefined);
41
45
  }
@@ -125,11 +129,15 @@ var createToolbarCopyCommandForNode = exports.createToolbarCopyCommandForNode =
125
129
  // The "1 1" refers to the start and end depth of the slice
126
130
  // since we're copying the text inside a paragraph, it will always be 1 1
127
131
  // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
132
+ // Ignored via go/ees005
133
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
128
134
  div.firstChild.setAttribute('data-pm-slice', '1 1 []');
129
135
  } else {
130
136
  // The "0 0" refers to the start and end depth of the slice
131
137
  // since we're copying the block node only, it will always be 0 0
132
138
  // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
139
+ // Ignored via go/ees005
140
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
133
141
  div.firstChild.setAttribute('data-pm-slice', '0 0 []');
134
142
  }
135
143
  // ED-17083 safari seems have bugs for extension copy because exntension do not have a child text(innerText) and it will not recognized as html in clipboard, this could be merge into one if this extension fixed children issue or safari fix the copy bug
@@ -1 +1,4 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ // Entry file in package.json
3
+
1
4
  export { copyButtonPlugin } from './copyButtonPlugin';
@@ -23,9 +23,13 @@ export function createToolbarCopyCommandForMark(markType, editorAnalyticsApi) {
23
23
  // The "1 1" refers to the start and end depth of the slice
24
24
  // since we're copying the text inside a paragraph, it will always be 1 1
25
25
  // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
26
+ // Ignored via go/ees005
27
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
26
28
  div.firstChild.setAttribute('data-pm-slice', '1 1 []');
27
29
 
28
30
  // If we're copying a hyperlink, we'd copy the url as the fallback plain text
31
+ // Ignored via go/ees005
32
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
29
33
  const linkUrl = domNode.getAttribute('href');
30
34
  copyHTMLToClipboard(div, markType.name === 'link' && linkUrl ? linkUrl : undefined);
31
35
  }
@@ -84,7 +88,7 @@ export const createToolbarCopyCommandForNode = (nodeType, editorAnalyticsApi) =>
84
88
 
85
89
  // This command should only be triggered by the Copy button in the floating toolbar
86
90
  // which is only visible when selection is inside the target node
87
- let contentNodeWithPos = getSelectedNodeOrNodeParentByNodeType({
91
+ const contentNodeWithPos = getSelectedNodeOrNodeParentByNodeType({
88
92
  nodeType,
89
93
  selection: tr.selection
90
94
  });
@@ -116,11 +120,15 @@ export const createToolbarCopyCommandForNode = (nodeType, editorAnalyticsApi) =>
116
120
  // The "1 1" refers to the start and end depth of the slice
117
121
  // since we're copying the text inside a paragraph, it will always be 1 1
118
122
  // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
123
+ // Ignored via go/ees005
124
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
119
125
  div.firstChild.setAttribute('data-pm-slice', '1 1 []');
120
126
  } else {
121
127
  // The "0 0" refers to the start and end depth of the slice
122
128
  // since we're copying the block node only, it will always be 0 0
123
129
  // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
130
+ // Ignored via go/ees005
131
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
124
132
  div.firstChild.setAttribute('data-pm-slice', '0 0 []');
125
133
  }
126
134
  // ED-17083 safari seems have bugs for extension copy because exntension do not have a child text(innerText) and it will not recognized as html in clipboard, this could be merge into one if this extension fixed children issue or safari fix the copy bug
package/dist/esm/index.js CHANGED
@@ -1 +1,4 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ // Entry file in package.json
3
+
1
4
  export { copyButtonPlugin } from './copyButtonPlugin';
@@ -23,9 +23,13 @@ export function createToolbarCopyCommandForMark(markType, editorAnalyticsApi) {
23
23
  // The "1 1" refers to the start and end depth of the slice
24
24
  // since we're copying the text inside a paragraph, it will always be 1 1
25
25
  // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
26
+ // Ignored via go/ees005
27
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
26
28
  div.firstChild.setAttribute('data-pm-slice', '1 1 []');
27
29
 
28
30
  // If we're copying a hyperlink, we'd copy the url as the fallback plain text
31
+ // Ignored via go/ees005
32
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
29
33
  var linkUrl = domNode.getAttribute('href');
30
34
  copyHTMLToClipboard(div, markType.name === 'link' && linkUrl ? linkUrl : undefined);
31
35
  }
@@ -115,11 +119,15 @@ export var createToolbarCopyCommandForNode = function createToolbarCopyCommandFo
115
119
  // The "1 1" refers to the start and end depth of the slice
116
120
  // since we're copying the text inside a paragraph, it will always be 1 1
117
121
  // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
122
+ // Ignored via go/ees005
123
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
118
124
  div.firstChild.setAttribute('data-pm-slice', '1 1 []');
119
125
  } else {
120
126
  // The "0 0" refers to the start and end depth of the slice
121
127
  // since we're copying the block node only, it will always be 0 0
122
128
  // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
129
+ // Ignored via go/ees005
130
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
123
131
  div.firstChild.setAttribute('data-pm-slice', '0 0 []');
124
132
  }
125
133
  // ED-17083 safari seems have bugs for extension copy because exntension do not have a child text(innerText) and it will not recognized as html in clipboard, this could be merge into one if this extension fixed children issue or safari fix the copy bug
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-copy-button",
3
- "version": "1.3.15",
3
+ "version": "1.3.17",
4
4
  "description": "editor-plugin-copy-button for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,11 +31,11 @@
31
31
  ".": "./src/index.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/editor-common": "^96.0.0",
34
+ "@atlaskit/editor-common": "^98.0.0",
35
35
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
36
36
  "@atlaskit/editor-plugin-decorations": "^1.3.0",
37
37
  "@atlaskit/editor-prosemirror": "6.2.1",
38
- "@atlaskit/icon": "^23.0.0",
38
+ "@atlaskit/icon": "^23.1.0",
39
39
  "@babel/runtime": "^7.0.0"
40
40
  },
41
41
  "peerDependencies": {
@@ -43,7 +43,7 @@
43
43
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.2.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@atlaskit/analytics-next": "^10.1.0",
46
+ "@atlaskit/analytics-next": "^10.2.0",
47
47
  "@testing-library/react": "^12.1.5",
48
48
  "typescript": "~5.4.2"
49
49
  },