@atlaskit/editor-plugin-copy-button 6.0.2 → 6.0.4
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,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-copy-button
|
|
2
2
|
|
|
3
|
+
## 6.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 6.0.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`38bdf0355311c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38bdf0355311c) -
|
|
14
|
+
upgrade use of browser util
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 6.0.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -62,7 +76,6 @@
|
|
|
62
76
|
shared context or singletons.
|
|
63
77
|
|
|
64
78
|
**HOW TO ADJUST:**
|
|
65
|
-
|
|
66
79
|
- Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
|
|
67
80
|
any of these editor plugins.
|
|
68
81
|
- Ensure the version you install matches the version required by the plugins.
|
|
@@ -13,6 +13,7 @@ var _browser = require("@atlaskit/editor-common/browser");
|
|
|
13
13
|
var _clipboard = require("@atlaskit/editor-common/clipboard");
|
|
14
14
|
var _copyButton = require("@atlaskit/editor-common/copy-button");
|
|
15
15
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
16
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
17
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
17
18
|
var _pluginKey = require("./plugin-key");
|
|
18
19
|
function createToolbarCopyCommandForMark(markType, editorAnalyticsApi) {
|
|
@@ -126,6 +127,7 @@ var createToolbarCopyCommandForNode = exports.createToolbarCopyCommandForNode =
|
|
|
126
127
|
} else {
|
|
127
128
|
if (domNode) {
|
|
128
129
|
var div = document.createElement('div');
|
|
130
|
+
var browser = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
|
|
129
131
|
div.appendChild(domNode);
|
|
130
132
|
|
|
131
133
|
// if copying inline content
|
|
@@ -146,7 +148,7 @@ var createToolbarCopyCommandForNode = exports.createToolbarCopyCommandForNode =
|
|
|
146
148
|
}
|
|
147
149
|
// 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
|
|
148
150
|
// MEX-2528 safari has a bug related to the mediaSingle node with border or link. The image tag within the clipboard is not recognized as HTML when using the ClipboardItem API. To address this, we have to switch to ClipboardPolyfill
|
|
149
|
-
if (
|
|
151
|
+
if (browser.safari && state.selection instanceof _state.NodeSelection && (state.selection.node.type === state.schema.nodes.extension || state.selection.node.type === state.schema.nodes.mediaSingle)) {
|
|
150
152
|
(0, _clipboard.copyHTMLToClipboardPolyfill)(div);
|
|
151
153
|
} else {
|
|
152
154
|
(0, _clipboard.copyHTMLToClipboard)(div);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ACTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { browser } from '@atlaskit/editor-common/browser';
|
|
2
|
+
import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
3
3
|
import { copyHTMLToClipboard, copyHTMLToClipboardPolyfill, getAnalyticsPayload } from '@atlaskit/editor-common/clipboard';
|
|
4
4
|
import { copyDomNode, getSelectedNodeOrNodeParentByNodeType, toDOM } from '@atlaskit/editor-common/copy-button';
|
|
5
5
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
7
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
7
8
|
import { copyButtonPluginKey } from './plugin-key';
|
|
8
9
|
export function createToolbarCopyCommandForMark(markType, editorAnalyticsApi) {
|
|
@@ -117,6 +118,7 @@ export const createToolbarCopyCommandForNode = (nodeType, editorAnalyticsApi, ap
|
|
|
117
118
|
} else {
|
|
118
119
|
if (domNode) {
|
|
119
120
|
const div = document.createElement('div');
|
|
121
|
+
const browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
|
|
120
122
|
div.appendChild(domNode);
|
|
121
123
|
|
|
122
124
|
// if copying inline content
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ACTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { browser } from '@atlaskit/editor-common/browser';
|
|
2
|
+
import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
3
3
|
import { copyHTMLToClipboard, copyHTMLToClipboardPolyfill, getAnalyticsPayload } from '@atlaskit/editor-common/clipboard';
|
|
4
4
|
import { copyDomNode, getSelectedNodeOrNodeParentByNodeType, toDOM } from '@atlaskit/editor-common/copy-button';
|
|
5
5
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
7
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
7
8
|
import { copyButtonPluginKey } from './plugin-key';
|
|
8
9
|
export function createToolbarCopyCommandForMark(markType, editorAnalyticsApi) {
|
|
@@ -116,6 +117,7 @@ export var createToolbarCopyCommandForNode = function createToolbarCopyCommandFo
|
|
|
116
117
|
} else {
|
|
117
118
|
if (domNode) {
|
|
118
119
|
var div = document.createElement('div');
|
|
120
|
+
var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
|
|
119
121
|
div.appendChild(domNode);
|
|
120
122
|
|
|
121
123
|
// if copying inline content
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-copy-button",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.4",
|
|
4
4
|
"description": "editor-plugin-copy-button for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,16 +28,16 @@
|
|
|
28
28
|
"atlaskit:src": "src/index.ts",
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@atlaskit/editor-plugin-accessibility-utils": "^6.0.0",
|
|
31
|
-
"@atlaskit/editor-plugin-analytics": "^6.
|
|
31
|
+
"@atlaskit/editor-plugin-analytics": "^6.2.0",
|
|
32
32
|
"@atlaskit/editor-plugin-decorations": "^6.1.0",
|
|
33
33
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
34
|
-
"@atlaskit/icon": "^
|
|
34
|
+
"@atlaskit/icon": "^29.0.0",
|
|
35
35
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
36
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
36
|
+
"@atlaskit/tmp-editor-statsig": "^13.35.0",
|
|
37
37
|
"@babel/runtime": "^7.0.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@atlaskit/editor-common": "^110.
|
|
40
|
+
"@atlaskit/editor-common": "^110.27.0",
|
|
41
41
|
"react": "^18.2.0",
|
|
42
42
|
"react-dom": "^18.2.0"
|
|
43
43
|
},
|