@atlaskit/adf-schema 57.1.0 → 57.1.2

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/adf-schema
2
2
 
3
+ ## 57.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 57.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`f53997ccf546a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f53997ccf546a) -
14
+ [ux] Fix a bug where the Editor parses invalid URLs (e.g. "File: C:\ProgramData") as link marks in
15
+ ADF. The feature gate is platform_bugfix_invalid_urls_parsing_in_editor.
16
+
3
17
  ## 57.1.0
4
18
 
5
19
  ### Minor Changes
@@ -37,6 +37,7 @@ Object.defineProperty(exports, "normalizeUrl", {
37
37
  }
38
38
  });
39
39
  var _linkifyIt = _interopRequireDefault(require("linkify-it"));
40
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
40
41
  var _isSafeUrl = require("./is-safe-url");
41
42
  var _linkifyMatch = require("./linkify-match");
42
43
  var _getLinkMatch = require("./get-link-match");
@@ -51,8 +52,15 @@ var _isRootRelative = require("./is-root-relative");
51
52
  */
52
53
 
53
54
  var linkify = exports.linkify = new _linkifyIt.default();
55
+ var URI_WITHOUT_SPACES = /(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+/;
56
+ var URI_WITHOUT_SPACES_ANCHORED = /^(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+/;
54
57
  var urlWithoutSpacesValidator = {
55
- validate: /(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+/
58
+ validate: function validate(text, pos) {
59
+ var tail = text.slice(pos);
60
+ var pattern = (0, _platformFeatureFlags.fg)('platform_bugfix_invalid_urls_parsing_in_editor') ? URI_WITHOUT_SPACES_ANCHORED : URI_WITHOUT_SPACES;
61
+ var match = tail.match(pattern);
62
+ return match ? match[0].length : 0;
63
+ }
56
64
  };
57
65
  var tlds = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
58
66
  var tlds2Char = 'a[cdefgilmnoqrtuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrtuvwxyz]|n[acefgilopruz]|om|p[aefghkmnrtw]|qa|r[eosuw]|s[abcdegijklmnrtuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';
@@ -7,9 +7,17 @@
7
7
  */
8
8
 
9
9
  import LinkifyIt from 'linkify-it';
10
+ import { fg } from '@atlaskit/platform-feature-flags';
10
11
  export const linkify = new LinkifyIt();
12
+ const URI_WITHOUT_SPACES = /[^\s]+/u;
13
+ const URI_WITHOUT_SPACES_ANCHORED = /^[^\s]+/u;
11
14
  const urlWithoutSpacesValidator = {
12
- validate: /[^\s]+/u
15
+ validate: (text, pos) => {
16
+ const tail = text.slice(pos);
17
+ const pattern = fg('platform_bugfix_invalid_urls_parsing_in_editor') ? URI_WITHOUT_SPACES_ANCHORED : URI_WITHOUT_SPACES;
18
+ const match = tail.match(pattern);
19
+ return match ? match[0].length : 0;
20
+ }
13
21
  };
14
22
  const tlds = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
15
23
  const tlds2Char = 'a[cdefgilmnoqrtuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrtuvwxyz]|n[acefgilopruz]|om|p[aefghkmnrtw]|qa|r[eosuw]|s[abcdegijklmnrtuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';
@@ -7,9 +7,17 @@
7
7
  */
8
8
 
9
9
  import LinkifyIt from 'linkify-it';
10
+ import { fg } from '@atlaskit/platform-feature-flags';
10
11
  export var linkify = new LinkifyIt();
12
+ var URI_WITHOUT_SPACES = /(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+/;
13
+ var URI_WITHOUT_SPACES_ANCHORED = /^(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+/;
11
14
  var urlWithoutSpacesValidator = {
12
- validate: /(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+/
15
+ validate: function validate(text, pos) {
16
+ var tail = text.slice(pos);
17
+ var pattern = fg('platform_bugfix_invalid_urls_parsing_in_editor') ? URI_WITHOUT_SPACES_ANCHORED : URI_WITHOUT_SPACES;
18
+ var match = tail.match(pattern);
19
+ return match ? match[0].length : 0;
20
+ }
13
21
  };
14
22
  var tlds = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
15
23
  var tlds2Char = 'a[cdefgilmnoqrtuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrtuvwxyz]|n[acefgilopruz]|om|p[aefghkmnrtw]|qa|r[eosuw]|s[abcdegijklmnrtuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "57.1.0",
3
+ "version": "57.1.2",
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/"
@@ -40,13 +40,16 @@
40
40
  "@atlaskit/adf-schema-generator": "^4.0.0",
41
41
  "@atlaskit/editor-prosemirror": "^8.0.0",
42
42
  "@atlaskit/platform-feature-flags": "^2.1.0",
43
- "@atlaskit/tmp-editor-statsig": "^160.0.0",
43
+ "@atlaskit/tmp-editor-statsig": "^161.0.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "css-color-names": "0.0.4",
46
46
  "linkify-it": "^5.0.2",
47
47
  "memoize-one": "^6.0.0"
48
48
  },
49
49
  "platform-feature-flags": {
50
+ "platform_bugfix_invalid_urls_parsing_in_editor": {
51
+ "type": "boolean"
52
+ },
50
53
  "platform_editor_lovability_text_bg_color_patch_1": {
51
54
  "type": "boolean"
52
55
  }