@atlaskit/adf-schema 51.5.15 → 51.5.16

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/adf-schema
2
2
 
3
+ ## 51.5.16
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b56fac4df95b4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b56fac4df95b4) -
8
+ remove no-tscheck and fix safe url logic
9
+ - Updated dependencies
10
+
3
11
  ## 51.5.15
4
12
 
5
13
  ### Patch Changes
@@ -10,7 +10,7 @@ exports.isRootRelative = isRootRelative;
10
10
  exports.linkifyMatch = exports.linkify = exports.isSafeUrl = void 0;
11
11
  exports.normalizeUrl = normalizeUrl;
12
12
  var _linkifyIt = _interopRequireDefault(require("linkify-it"));
13
- // @ts-nocheck
13
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
14
14
  /**
15
15
  * This file has been partially duplicated in packages/linking-platform/linking-common/src/url.ts
16
16
  * Any changes made here should be mirrored there.
@@ -29,6 +29,11 @@ var whitelistedURLPatterns = [/^http[s\u017F]?:\/\//im, /^ftp[s\u017F]?:\/\//im,
29
29
  */
30
30
  var isSafeUrl = exports.isSafeUrl = function isSafeUrl(url) {
31
31
  var urlTrimmed = url === null || url === void 0 ? void 0 : url.trim();
32
+ if (urlTrimmed === undefined && (0, _expValEquals.expValEquals)('platform_editor_safe_url_trim_fix', 'isEnabled', true)) {
33
+ return true;
34
+ }
35
+
36
+ // remove cast to string once we remove the experiment, as urlTrimmed will never be undefined at that point
32
37
  if (urlTrimmed.length === 0) {
33
38
  return true;
34
39
  }
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  /**
3
2
  * This file has been partially duplicated in packages/linking-platform/linking-common/src/url.ts
4
3
  * Any changes made here should be mirrored there.
@@ -6,6 +5,7 @@
6
5
  * Ticket for fixing linkification of filename-like urls: https://product-fabric.atlassian.net/browse/EDM-7190
7
6
  */
8
7
  import LinkifyIt from 'linkify-it';
8
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
9
  const whitelistedURLPatterns = [/^https?:\/\//imu, /^ftps?:\/\//imu, /^gopher:\/\//imu, /^integrity:\/\//imu, /^file:\/\//imu, /^smb:\/\//imu, /^dynamicsnav:\/\//imu, /^jamfselfservice:\/\//imu, /^\//imu, /^mailto:/imu, /^skype:/imu, /^callto:/imu, /^facetime:/imu, /^git:/imu, /^irc6?:/imu, /^news:/imu, /^nntp:/imu, /^feed:/imu, /^cvs:/imu, /^svn:/imu, /^mvn:/imu, /^ssh:/imu, /^scp:\/\//imu, /^sftp:\/\//imu, /^itms:/imu,
10
10
  // This is not a valid notes link, but we support this pattern for backwards compatibility
11
11
  /^notes:/imu, /^notes:\/\//imu, /^hipchat:\/\//imu,
@@ -17,6 +17,11 @@ const whitelistedURLPatterns = [/^https?:\/\//imu, /^ftps?:\/\//imu, /^gopher:\/
17
17
  */
18
18
  export const isSafeUrl = url => {
19
19
  const urlTrimmed = url === null || url === void 0 ? void 0 : url.trim();
20
+ if (urlTrimmed === undefined && expValEquals('platform_editor_safe_url_trim_fix', 'isEnabled', true)) {
21
+ return true;
22
+ }
23
+
24
+ // remove cast to string once we remove the experiment, as urlTrimmed will never be undefined at that point
20
25
  if (urlTrimmed.length === 0) {
21
26
  return true;
22
27
  }
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  /**
3
2
  * This file has been partially duplicated in packages/linking-platform/linking-common/src/url.ts
4
3
  * Any changes made here should be mirrored there.
@@ -6,6 +5,7 @@
6
5
  * Ticket for fixing linkification of filename-like urls: https://product-fabric.atlassian.net/browse/EDM-7190
7
6
  */
8
7
  import LinkifyIt from 'linkify-it';
8
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
9
  var whitelistedURLPatterns = [/^http[s\u017F]?:\/\//im, /^ftp[s\u017F]?:\/\//im, /^gopher:\/\//im, /^integrity:\/\//im, /^file:\/\//im, /^[s\u017F]mb:\/\//im, /^dynamic[s\u017F]nav:\/\//im, /^jamf[s\u017F]elf[s\u017F]ervice:\/\//im, /^\//im, /^mailto:/im, /^[s\u017F][k\u212A]ype:/im, /^callto:/im, /^facetime:/im, /^git:/im, /^irc6?:/im, /^new[s\u017F]:/im, /^nntp:/im, /^feed:/im, /^cv[s\u017F]:/im, /^[s\u017F]vn:/im, /^mvn:/im, /^[s\u017F][s\u017F]h:/im, /^[s\u017F]cp:\/\//im, /^[s\u017F]ftp:\/\//im, /^itm[s\u017F]:/im,
10
10
  // This is not a valid notes link, but we support this pattern for backwards compatibility
11
11
  /^note[s\u017F]:/im, /^note[s\u017F]:\/\//im, /^hipchat:\/\//im,
@@ -17,6 +17,11 @@ var whitelistedURLPatterns = [/^http[s\u017F]?:\/\//im, /^ftp[s\u017F]?:\/\//im,
17
17
  */
18
18
  export var isSafeUrl = function isSafeUrl(url) {
19
19
  var urlTrimmed = url === null || url === void 0 ? void 0 : url.trim();
20
+ if (urlTrimmed === undefined && expValEquals('platform_editor_safe_url_trim_fix', 'isEnabled', true)) {
21
+ return true;
22
+ }
23
+
24
+ // remove cast to string once we remove the experiment, as urlTrimmed will never be undefined at that point
20
25
  if (urlTrimmed.length === 0) {
21
26
  return true;
22
27
  }
@@ -15,7 +15,7 @@ export interface Match {
15
15
  lastIndex: number;
16
16
  length?: number;
17
17
  raw: string;
18
- schema: any;
18
+ schema: string;
19
19
  text: string;
20
20
  url: string;
21
21
  }
@@ -15,7 +15,7 @@ export interface Match {
15
15
  lastIndex: number;
16
16
  length?: number;
17
17
  raw: string;
18
- schema: any;
18
+ schema: string;
19
19
  text: string;
20
20
  url: string;
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "51.5.15",
3
+ "version": "51.5.16",
4
4
  "description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -42,7 +42,7 @@
42
42
  "dependencies": {
43
43
  "@atlaskit/adf-schema-generator": "^2.1.0",
44
44
  "@atlaskit/editor-prosemirror": "^7.3.0",
45
- "@atlaskit/tmp-editor-statsig": "^24.0.0",
45
+ "@atlaskit/tmp-editor-statsig": "^25.0.0",
46
46
  "@babel/runtime": "^7.0.0",
47
47
  "css-color-names": "0.0.4",
48
48
  "linkify-it": "^3.0.3",