@atlaskit/editor-plugin-paste 9.1.17 → 9.1.18
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,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste
|
|
2
2
|
|
|
3
|
+
## 9.1.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`bfe80c5eaf923`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bfe80c5eaf923) -
|
|
8
|
+
Enable onedrive and MS teams links to render as smartlinks
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 9.1.17
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -48,6 +48,13 @@ var isInsideBlockQuote = exports.isInsideBlockQuote = function isInsideBlockQuot
|
|
|
48
48
|
var blockquote = state.schema.nodes.blockquote;
|
|
49
49
|
return (0, _utils2.hasParentNodeOfType)(blockquote)(state.selection);
|
|
50
50
|
};
|
|
51
|
+
var enableNewDomainCheckToImproveSmartLinkResolveRate = function enableNewDomainCheckToImproveSmartLinkResolveRate(hostname) {
|
|
52
|
+
return (0, _expValEquals.expValEquals)('improve_3p_smart_link_resolve_rate', 'isEnabled', true) && (
|
|
53
|
+
// OneDrive Shortlinks
|
|
54
|
+
hostname.endsWith('1drv.ms') ||
|
|
55
|
+
// MS Teams links
|
|
56
|
+
hostname.endsWith('teams.live.com') || hostname.endsWith('teams.cloud.microsoft') || hostname.endsWith('teams.microsoft.com'));
|
|
57
|
+
};
|
|
51
58
|
var PASTE = 'Editor Paste Plugin Paste Duration';
|
|
52
59
|
function isSharePointUrl(url) {
|
|
53
60
|
if (!url) {
|
|
@@ -64,7 +71,7 @@ function isSharePointUrl(url) {
|
|
|
64
71
|
}
|
|
65
72
|
|
|
66
73
|
// Check if hostname ends with the trusted domains (not just contains them)
|
|
67
|
-
return hostname.endsWith('sharepoint.com') || hostname.endsWith('onedrive.com') || hostname.endsWith('onedrive.live.com');
|
|
74
|
+
return hostname.endsWith('sharepoint.com') || hostname.endsWith('onedrive.com') || hostname.endsWith('onedrive.live.com') || enableNewDomainCheckToImproveSmartLinkResolveRate(hostname);
|
|
68
75
|
} catch (_unused) {
|
|
69
76
|
// If URL parsing fails, return false for safety
|
|
70
77
|
return false;
|
|
@@ -37,6 +37,13 @@ export const isInsideBlockQuote = state => {
|
|
|
37
37
|
} = state.schema.nodes;
|
|
38
38
|
return hasParentNodeOfType(blockquote)(state.selection);
|
|
39
39
|
};
|
|
40
|
+
const enableNewDomainCheckToImproveSmartLinkResolveRate = hostname => {
|
|
41
|
+
return expValEquals('improve_3p_smart_link_resolve_rate', 'isEnabled', true) && (
|
|
42
|
+
// OneDrive Shortlinks
|
|
43
|
+
hostname.endsWith('1drv.ms') ||
|
|
44
|
+
// MS Teams links
|
|
45
|
+
hostname.endsWith('teams.live.com') || hostname.endsWith('teams.cloud.microsoft') || hostname.endsWith('teams.microsoft.com'));
|
|
46
|
+
};
|
|
40
47
|
const PASTE = 'Editor Paste Plugin Paste Duration';
|
|
41
48
|
export function isSharePointUrl(url) {
|
|
42
49
|
if (!url) {
|
|
@@ -53,7 +60,7 @@ export function isSharePointUrl(url) {
|
|
|
53
60
|
}
|
|
54
61
|
|
|
55
62
|
// Check if hostname ends with the trusted domains (not just contains them)
|
|
56
|
-
return hostname.endsWith('sharepoint.com') || hostname.endsWith('onedrive.com') || hostname.endsWith('onedrive.live.com');
|
|
63
|
+
return hostname.endsWith('sharepoint.com') || hostname.endsWith('onedrive.com') || hostname.endsWith('onedrive.live.com') || enableNewDomainCheckToImproveSmartLinkResolveRate(hostname);
|
|
57
64
|
} catch {
|
|
58
65
|
// If URL parsing fails, return false for safety
|
|
59
66
|
return false;
|
|
@@ -40,6 +40,13 @@ export var isInsideBlockQuote = function isInsideBlockQuote(state) {
|
|
|
40
40
|
var blockquote = state.schema.nodes.blockquote;
|
|
41
41
|
return hasParentNodeOfType(blockquote)(state.selection);
|
|
42
42
|
};
|
|
43
|
+
var enableNewDomainCheckToImproveSmartLinkResolveRate = function enableNewDomainCheckToImproveSmartLinkResolveRate(hostname) {
|
|
44
|
+
return expValEquals('improve_3p_smart_link_resolve_rate', 'isEnabled', true) && (
|
|
45
|
+
// OneDrive Shortlinks
|
|
46
|
+
hostname.endsWith('1drv.ms') ||
|
|
47
|
+
// MS Teams links
|
|
48
|
+
hostname.endsWith('teams.live.com') || hostname.endsWith('teams.cloud.microsoft') || hostname.endsWith('teams.microsoft.com'));
|
|
49
|
+
};
|
|
43
50
|
var PASTE = 'Editor Paste Plugin Paste Duration';
|
|
44
51
|
export function isSharePointUrl(url) {
|
|
45
52
|
if (!url) {
|
|
@@ -56,7 +63,7 @@ export function isSharePointUrl(url) {
|
|
|
56
63
|
}
|
|
57
64
|
|
|
58
65
|
// Check if hostname ends with the trusted domains (not just contains them)
|
|
59
|
-
return hostname.endsWith('sharepoint.com') || hostname.endsWith('onedrive.com') || hostname.endsWith('onedrive.live.com');
|
|
66
|
+
return hostname.endsWith('sharepoint.com') || hostname.endsWith('onedrive.com') || hostname.endsWith('onedrive.live.com') || enableNewDomainCheckToImproveSmartLinkResolveRate(hostname);
|
|
60
67
|
} catch (_unused) {
|
|
61
68
|
// If URL parsing fails, return false for safety
|
|
62
69
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.18",
|
|
4
4
|
"description": "Paste plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/media-common": "^13.0.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
50
50
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^62.
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^62.3.0",
|
|
52
52
|
"@atlaskit/tokens": "^13.0.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"lodash": "^4.17.21",
|