@atlaskit/editor-plugin-paste 1.12.10 → 1.14.0

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,27 @@
1
1
  # @atlaskit/editor-plugin-paste
2
2
 
3
+ ## 1.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#151190](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/151190)
8
+ [`a3723b1cdede2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a3723b1cdede2) -
9
+ [ux] [ED-25037] this change bumps @atlaskit/adf-schema from 40.9.0 to 40.9.4 which makes the
10
+ blockquote selectable, adds missing marks to the PM node spec and fixes a bug that converted
11
+ pasted external images to media groups.
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
17
+ ## 1.13.0
18
+
19
+ ### Minor Changes
20
+
21
+ - [#149901](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/149901)
22
+ [`0a87dbe9678bf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0a87dbe9678bf) -
23
+ [ux] EDM-10373 Fix link pasting with quotes
24
+
3
25
  ## 1.12.10
4
26
 
5
27
  ### Patch Changes
@@ -75,11 +75,24 @@ function getPasteSource(event) {
75
75
  return 'uncategorized';
76
76
  }
77
77
 
78
- // @see https://product-fabric.atlassian.net/browse/ED-3159
79
- // @see https://github.com/markdown-it/markdown-it/issues/38
78
+ /**
79
+ * Wrap link with angle brackets if they are not already contained in markdown url syntax (e.g. [text](url))
80
+ *
81
+ * This mitigate some issues in the markdown-it parser (or linkify where it would not parse the link correctly if it contains some characters.
82
+ * @see https://product-fabric.atlassian.net/browse/ED-3159
83
+ * @see https://github.com/markdown-it/markdown-it/issues/38
84
+ *
85
+ * This function was introduced in
86
+ * https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/commits/64d0f30bbe7014#platform%2Fpackages%2Ffabric%2Feditor-core%2Fsrc%2Fplugins%2Fpaste%2Futil.ts
87
+ *
88
+ * If a right angle bracket or double quote is present in the url, the url will only be escaped up to the character before the right angle bracket (this is the same behaviour as in Google Docs).
89
+ *
90
+ * Tests in platform/packages/editor/editor-plugin-paste-tests/src/__tests__/playwright/paste.spec.ts
91
+ * check behaviour of double quotes in url strings
92
+ */
80
93
  function escapeLinks(text) {
81
- return text.replace(/(\[([^\]]+)\]\()?((https?|ftp|jamfselfservice):\/\/[^\s"'>]+)/g, function (str) {
82
- return str.match(/^(https?|ftp|jamfselfservice):\/\/[^\s"'>]+$/) ? "<".concat(str, ">") : str;
94
+ return text.replace(/(\[([^\]]+)\]\()?((https?|ftp|jamfselfservice):\/\/[^\s>"]+)/g, function (str) {
95
+ return str.match(/^(https?|ftp|jamfselfservice):\/\/[^\s>"]+$/) ? "<".concat(str, ">") : str;
83
96
  });
84
97
  }
85
98
  function hasOnlyNodesOfType() {
@@ -54,11 +54,24 @@ export function getPasteSource(event) {
54
54
  return 'uncategorized';
55
55
  }
56
56
 
57
- // @see https://product-fabric.atlassian.net/browse/ED-3159
58
- // @see https://github.com/markdown-it/markdown-it/issues/38
57
+ /**
58
+ * Wrap link with angle brackets if they are not already contained in markdown url syntax (e.g. [text](url))
59
+ *
60
+ * This mitigate some issues in the markdown-it parser (or linkify where it would not parse the link correctly if it contains some characters.
61
+ * @see https://product-fabric.atlassian.net/browse/ED-3159
62
+ * @see https://github.com/markdown-it/markdown-it/issues/38
63
+ *
64
+ * This function was introduced in
65
+ * https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/commits/64d0f30bbe7014#platform%2Fpackages%2Ffabric%2Feditor-core%2Fsrc%2Fplugins%2Fpaste%2Futil.ts
66
+ *
67
+ * If a right angle bracket or double quote is present in the url, the url will only be escaped up to the character before the right angle bracket (this is the same behaviour as in Google Docs).
68
+ *
69
+ * Tests in platform/packages/editor/editor-plugin-paste-tests/src/__tests__/playwright/paste.spec.ts
70
+ * check behaviour of double quotes in url strings
71
+ */
59
72
  export function escapeLinks(text) {
60
- return text.replace(/(\[([^\]]+)\]\()?((https?|ftp|jamfselfservice):\/\/[^\s"'>]+)/g, str => {
61
- return str.match(/^(https?|ftp|jamfselfservice):\/\/[^\s"'>]+$/) ? `<${str}>` : str;
73
+ return text.replace(/(\[([^\]]+)\]\()?((https?|ftp|jamfselfservice):\/\/[^\s>"]+)/g, str => {
74
+ return str.match(/^(https?|ftp|jamfselfservice):\/\/[^\s>"]+$/) ? `<${str}>` : str;
62
75
  });
63
76
  }
64
77
  export function hasOnlyNodesOfType(...nodeTypes) {
@@ -55,11 +55,24 @@ export function getPasteSource(event) {
55
55
  return 'uncategorized';
56
56
  }
57
57
 
58
- // @see https://product-fabric.atlassian.net/browse/ED-3159
59
- // @see https://github.com/markdown-it/markdown-it/issues/38
58
+ /**
59
+ * Wrap link with angle brackets if they are not already contained in markdown url syntax (e.g. [text](url))
60
+ *
61
+ * This mitigate some issues in the markdown-it parser (or linkify where it would not parse the link correctly if it contains some characters.
62
+ * @see https://product-fabric.atlassian.net/browse/ED-3159
63
+ * @see https://github.com/markdown-it/markdown-it/issues/38
64
+ *
65
+ * This function was introduced in
66
+ * https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/commits/64d0f30bbe7014#platform%2Fpackages%2Ffabric%2Feditor-core%2Fsrc%2Fplugins%2Fpaste%2Futil.ts
67
+ *
68
+ * If a right angle bracket or double quote is present in the url, the url will only be escaped up to the character before the right angle bracket (this is the same behaviour as in Google Docs).
69
+ *
70
+ * Tests in platform/packages/editor/editor-plugin-paste-tests/src/__tests__/playwright/paste.spec.ts
71
+ * check behaviour of double quotes in url strings
72
+ */
60
73
  export function escapeLinks(text) {
61
- return text.replace(/(\[([^\]]+)\]\()?((https?|ftp|jamfselfservice):\/\/[^\s"'>]+)/g, function (str) {
62
- return str.match(/^(https?|ftp|jamfselfservice):\/\/[^\s"'>]+$/) ? "<".concat(str, ">") : str;
74
+ return text.replace(/(\[([^\]]+)\]\()?((https?|ftp|jamfselfservice):\/\/[^\s>"]+)/g, function (str) {
75
+ return str.match(/^(https?|ftp|jamfselfservice):\/\/[^\s>"]+$/) ? "<".concat(str, ">") : str;
63
76
  });
64
77
  }
65
78
  export function hasOnlyNodesOfType() {
@@ -8,6 +8,21 @@ export declare function isPastedFromExcel(html?: string): boolean;
8
8
  export declare const isSingleLine: (text: string) => boolean;
9
9
  export declare function htmlContainsSingleFile(html: string): boolean;
10
10
  export declare function getPasteSource(event: ClipboardEvent): PasteSource;
11
+ /**
12
+ * Wrap link with angle brackets if they are not already contained in markdown url syntax (e.g. [text](url))
13
+ *
14
+ * This mitigate some issues in the markdown-it parser (or linkify where it would not parse the link correctly if it contains some characters.
15
+ * @see https://product-fabric.atlassian.net/browse/ED-3159
16
+ * @see https://github.com/markdown-it/markdown-it/issues/38
17
+ *
18
+ * This function was introduced in
19
+ * https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/commits/64d0f30bbe7014#platform%2Fpackages%2Ffabric%2Feditor-core%2Fsrc%2Fplugins%2Fpaste%2Futil.ts
20
+ *
21
+ * If a right angle bracket or double quote is present in the url, the url will only be escaped up to the character before the right angle bracket (this is the same behaviour as in Google Docs).
22
+ *
23
+ * Tests in platform/packages/editor/editor-plugin-paste-tests/src/__tests__/playwright/paste.spec.ts
24
+ * check behaviour of double quotes in url strings
25
+ */
11
26
  export declare function escapeLinks(text: string): string;
12
27
  export declare function hasOnlyNodesOfType(...nodeTypes: NodeType[]): (slice: Slice) => boolean;
13
28
  export declare function applyTextMarksToSlice(schema: Schema, marks?: readonly Mark[]): (slice: Slice) => Slice;
@@ -8,6 +8,21 @@ export declare function isPastedFromExcel(html?: string): boolean;
8
8
  export declare const isSingleLine: (text: string) => boolean;
9
9
  export declare function htmlContainsSingleFile(html: string): boolean;
10
10
  export declare function getPasteSource(event: ClipboardEvent): PasteSource;
11
+ /**
12
+ * Wrap link with angle brackets if they are not already contained in markdown url syntax (e.g. [text](url))
13
+ *
14
+ * This mitigate some issues in the markdown-it parser (or linkify where it would not parse the link correctly if it contains some characters.
15
+ * @see https://product-fabric.atlassian.net/browse/ED-3159
16
+ * @see https://github.com/markdown-it/markdown-it/issues/38
17
+ *
18
+ * This function was introduced in
19
+ * https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/commits/64d0f30bbe7014#platform%2Fpackages%2Ffabric%2Feditor-core%2Fsrc%2Fplugins%2Fpaste%2Futil.ts
20
+ *
21
+ * If a right angle bracket or double quote is present in the url, the url will only be escaped up to the character before the right angle bracket (this is the same behaviour as in Google Docs).
22
+ *
23
+ * Tests in platform/packages/editor/editor-plugin-paste-tests/src/__tests__/playwright/paste.spec.ts
24
+ * check behaviour of double quotes in url strings
25
+ */
11
26
  export declare function escapeLinks(text: string): string;
12
27
  export declare function hasOnlyNodesOfType(...nodeTypes: NodeType[]): (slice: Slice) => boolean;
13
28
  export declare function applyTextMarksToSlice(schema: Schema, marks?: readonly Mark[]): (slice: Slice) => Slice;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-paste",
3
- "version": "1.12.10",
3
+ "version": "1.14.0",
4
4
  "description": "Paste plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,16 +31,16 @@
31
31
  ".": "./src/index.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/editor-common": "^93.1.0",
35
- "@atlaskit/editor-markdown-transformer": "^5.12.0",
36
- "@atlaskit/editor-plugin-analytics": "^1.8.0",
37
- "@atlaskit/editor-plugin-annotation": "^1.19.0",
38
- "@atlaskit/editor-plugin-better-type-history": "^1.8.0",
39
- "@atlaskit/editor-plugin-card": "^4.0.0",
34
+ "@atlaskit/editor-common": "^93.3.0",
35
+ "@atlaskit/editor-markdown-transformer": "^5.13.0",
36
+ "@atlaskit/editor-plugin-analytics": "^1.9.0",
37
+ "@atlaskit/editor-plugin-annotation": "^1.20.0",
38
+ "@atlaskit/editor-plugin-better-type-history": "^1.9.0",
39
+ "@atlaskit/editor-plugin-card": "^4.3.0",
40
40
  "@atlaskit/editor-plugin-feature-flags": "^1.2.0",
41
- "@atlaskit/editor-plugin-list": "^3.8.0",
42
- "@atlaskit/editor-plugin-media": "^1.34.0",
43
- "@atlaskit/editor-plugin-mentions": "^2.7.0",
41
+ "@atlaskit/editor-plugin-list": "^3.9.0",
42
+ "@atlaskit/editor-plugin-media": "^1.35.0",
43
+ "@atlaskit/editor-plugin-mentions": "^2.8.0",
44
44
  "@atlaskit/editor-prosemirror": "6.0.0",
45
45
  "@atlaskit/editor-tables": "^2.8.0",
46
46
  "@atlaskit/media-client": "^28.0.0",
@@ -56,10 +56,10 @@
56
56
  },
57
57
  "devDependencies": {
58
58
  "@af/visual-regression": "*",
59
- "@atlaskit/adf-schema": "^40.9.0",
60
- "@atlaskit/editor-plugin-block-type": "^3.15.0",
59
+ "@atlaskit/adf-schema": "^40.9.4",
60
+ "@atlaskit/editor-plugin-block-type": "^3.16.0",
61
61
  "@atlaskit/editor-plugin-history": "^1.3.0",
62
- "@atlaskit/editor-plugin-type-ahead": "^1.8.0",
62
+ "@atlaskit/editor-plugin-type-ahead": "^1.9.0",
63
63
  "@atlaskit/ssr": "*",
64
64
  "@atlaskit/visual-regression": "*",
65
65
  "@testing-library/react": "^12.1.5",