@atlaskit/editor-plugin-copy-button 6.0.1 → 6.0.3
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-copy-button
|
|
2
2
|
|
|
3
|
+
## 6.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`38bdf0355311c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38bdf0355311c) -
|
|
8
|
+
upgrade use of browser util
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 6.0.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`f6863b5290fe8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f6863b5290fe8) -
|
|
16
|
+
[REMOVE FF] editor_a11y_aria_announcement_for_copied_status
|
|
17
|
+
|
|
3
18
|
## 6.0.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -55,7 +70,6 @@
|
|
|
55
70
|
shared context or singletons.
|
|
56
71
|
|
|
57
72
|
**HOW TO ADJUST:**
|
|
58
|
-
|
|
59
73
|
- Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
|
|
60
74
|
any of these editor plugins.
|
|
61
75
|
- Ensure the version you install matches the version required by the plugins.
|
|
@@ -13,7 +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
|
|
16
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
17
17
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
18
18
|
var _pluginKey = require("./plugin-key");
|
|
19
19
|
function createToolbarCopyCommandForMark(markType, editorAnalyticsApi) {
|
|
@@ -127,6 +127,7 @@ var createToolbarCopyCommandForNode = exports.createToolbarCopyCommandForNode =
|
|
|
127
127
|
} else {
|
|
128
128
|
if (domNode) {
|
|
129
129
|
var div = document.createElement('div');
|
|
130
|
+
var browser = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
|
|
130
131
|
div.appendChild(domNode);
|
|
131
132
|
|
|
132
133
|
// if copying inline content
|
|
@@ -147,7 +148,7 @@ var createToolbarCopyCommandForNode = exports.createToolbarCopyCommandForNode =
|
|
|
147
148
|
}
|
|
148
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
|
|
149
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
|
|
150
|
-
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)) {
|
|
151
152
|
(0, _clipboard.copyHTMLToClipboardPolyfill)(div);
|
|
152
153
|
} else {
|
|
153
154
|
(0, _clipboard.copyHTMLToClipboard)(div);
|
|
@@ -165,7 +166,7 @@ var createToolbarCopyCommandForNode = exports.createToolbarCopyCommandForNode =
|
|
|
165
166
|
*
|
|
166
167
|
* see thread https://atlassian.slack.com/archives/C02CDUS3SUS/p1744256326459569
|
|
167
168
|
*/
|
|
168
|
-
if (onClickMessage
|
|
169
|
+
if (onClickMessage) {
|
|
169
170
|
var _api$accessibilityUti;
|
|
170
171
|
api === null || api === void 0 || (_api$accessibilityUti = api.accessibilityUtils) === null || _api$accessibilityUti === void 0 || _api$accessibilityUti.actions.ariaNotify(onClickMessage, {
|
|
171
172
|
priority: 'important'
|
|
@@ -1,9 +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 {
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
7
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
8
8
|
import { copyButtonPluginKey } from './plugin-key';
|
|
9
9
|
export function createToolbarCopyCommandForMark(markType, editorAnalyticsApi) {
|
|
@@ -118,6 +118,7 @@ export const createToolbarCopyCommandForNode = (nodeType, editorAnalyticsApi, ap
|
|
|
118
118
|
} else {
|
|
119
119
|
if (domNode) {
|
|
120
120
|
const div = document.createElement('div');
|
|
121
|
+
const browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
|
|
121
122
|
div.appendChild(domNode);
|
|
122
123
|
|
|
123
124
|
// if copying inline content
|
|
@@ -156,7 +157,7 @@ export const createToolbarCopyCommandForNode = (nodeType, editorAnalyticsApi, ap
|
|
|
156
157
|
*
|
|
157
158
|
* see thread https://atlassian.slack.com/archives/C02CDUS3SUS/p1744256326459569
|
|
158
159
|
*/
|
|
159
|
-
if (onClickMessage
|
|
160
|
+
if (onClickMessage) {
|
|
160
161
|
var _api$accessibilityUti;
|
|
161
162
|
api === null || api === void 0 ? void 0 : (_api$accessibilityUti = api.accessibilityUtils) === null || _api$accessibilityUti === void 0 ? void 0 : _api$accessibilityUti.actions.ariaNotify(onClickMessage, {
|
|
162
163
|
priority: 'important'
|
|
@@ -1,9 +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 {
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
7
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
8
8
|
import { copyButtonPluginKey } from './plugin-key';
|
|
9
9
|
export function createToolbarCopyCommandForMark(markType, editorAnalyticsApi) {
|
|
@@ -117,6 +117,7 @@ export var createToolbarCopyCommandForNode = function createToolbarCopyCommandFo
|
|
|
117
117
|
} else {
|
|
118
118
|
if (domNode) {
|
|
119
119
|
var div = document.createElement('div');
|
|
120
|
+
var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
|
|
120
121
|
div.appendChild(domNode);
|
|
121
122
|
|
|
122
123
|
// if copying inline content
|
|
@@ -155,7 +156,7 @@ export var createToolbarCopyCommandForNode = function createToolbarCopyCommandFo
|
|
|
155
156
|
*
|
|
156
157
|
* see thread https://atlassian.slack.com/archives/C02CDUS3SUS/p1744256326459569
|
|
157
158
|
*/
|
|
158
|
-
if (onClickMessage
|
|
159
|
+
if (onClickMessage) {
|
|
159
160
|
var _api$accessibilityUti;
|
|
160
161
|
api === null || api === void 0 || (_api$accessibilityUti = api.accessibilityUtils) === null || _api$accessibilityUti === void 0 || _api$accessibilityUti.actions.ariaNotify(onClickMessage, {
|
|
161
162
|
priority: 'important'
|
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.3",
|
|
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": "^28.
|
|
34
|
+
"@atlaskit/icon": "^28.5.0",
|
|
35
35
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
36
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
36
|
+
"@atlaskit/tmp-editor-statsig": "^13.17.0",
|
|
37
37
|
"@babel/runtime": "^7.0.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@atlaskit/editor-common": "^110.
|
|
40
|
+
"@atlaskit/editor-common": "^110.16.0",
|
|
41
41
|
"react": "^18.2.0",
|
|
42
42
|
"react-dom": "^18.2.0"
|
|
43
43
|
},
|
|
@@ -80,10 +80,5 @@
|
|
|
80
80
|
"import-no-extraneous-disable-for-examples-and-docs"
|
|
81
81
|
]
|
|
82
82
|
}
|
|
83
|
-
},
|
|
84
|
-
"platform-feature-flags": {
|
|
85
|
-
"editor_a11y_aria_announcement_for_copied_status": {
|
|
86
|
-
"type": "boolean"
|
|
87
|
-
}
|
|
88
83
|
}
|
|
89
84
|
}
|