@atlaskit/editor-plugin-paste 9.1.16 → 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,19 @@
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
+
11
+ ## 9.1.17
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 9.1.16
4
18
 
5
19
  ### 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.16",
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",
@@ -33,7 +33,7 @@
33
33
  "@atlaskit/editor-plugin-analytics": "^8.0.0",
34
34
  "@atlaskit/editor-plugin-annotation": "^8.0.0",
35
35
  "@atlaskit/editor-plugin-better-type-history": "^8.0.0",
36
- "@atlaskit/editor-plugin-card": "^14.0.0",
36
+ "@atlaskit/editor-plugin-card": "^14.1.0",
37
37
  "@atlaskit/editor-plugin-expand": "^9.1.0",
38
38
  "@atlaskit/editor-plugin-feature-flags": "^7.0.0",
39
39
  "@atlaskit/editor-plugin-list": "^10.2.0",
@@ -42,13 +42,13 @@
42
42
  "@atlaskit/editor-prosemirror": "^7.3.0",
43
43
  "@atlaskit/editor-tables": "^2.9.0",
44
44
  "@atlaskit/flag": "^17.9.0",
45
- "@atlaskit/icon": "^34.0.0",
45
+ "@atlaskit/icon": "^34.1.0",
46
46
  "@atlaskit/insm": "^0.4.0",
47
47
  "@atlaskit/media-client": "^36.0.0",
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": "^61.0.0",
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",
@@ -56,7 +56,7 @@
56
56
  "uuid": "^3.1.0"
57
57
  },
58
58
  "peerDependencies": {
59
- "@atlaskit/editor-common": "^112.20.0",
59
+ "@atlaskit/editor-common": "^112.21.0",
60
60
  "react": "^18.2.0",
61
61
  "react-dom": "^18.2.0"
62
62
  },