@atlaskit/editor-plugin-paste-options-toolbar 13.0.11 → 13.0.12
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 +8 -0
- package/dist/cjs/pm-plugins/util/format-handlers.js +4 -4
- package/dist/cjs/pm-plugins/util/index.js +4 -3
- package/dist/es2019/pm-plugins/util/format-handlers.js +5 -4
- package/dist/es2019/pm-plugins/util/index.js +4 -3
- package/dist/esm/pm-plugins/util/format-handlers.js +5 -4
- package/dist/esm/pm-plugins/util/index.js +4 -3
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste-options-toolbar
|
|
2
2
|
|
|
3
|
+
## 13.0.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`346f91cfe1997`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/346f91cfe1997) -
|
|
8
|
+
Clean up prefer static regex violations
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 13.0.11
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -13,6 +13,9 @@ var _model = require("@atlaskit/editor-prosemirror/model");
|
|
|
13
13
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
14
14
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
15
15
|
var _index = require("./index");
|
|
16
|
+
// Ignored via go/ees005
|
|
17
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
18
|
+
var CODE_BLOCK_FENCE_REGEX = /```/;
|
|
16
19
|
var formatMarkdown = exports.formatMarkdown = function formatMarkdown(tr, pluginState) {
|
|
17
20
|
var pasteStartPos = pluginState.pasteStartPos;
|
|
18
21
|
var pasteEndPos = pluginState.pasteEndPos;
|
|
@@ -151,10 +154,7 @@ function getMarkdownSlice(text, schema, selection) {
|
|
|
151
154
|
try {
|
|
152
155
|
var _doc$content$firstChi, _doc$content$lastChil;
|
|
153
156
|
var textInput = text;
|
|
154
|
-
|
|
155
|
-
// Ignored via go/ees005
|
|
156
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
157
|
-
var textSplitByCodeBlock = textInput.split(/```/);
|
|
157
|
+
var textSplitByCodeBlock = textInput.split(CODE_BLOCK_FENCE_REGEX);
|
|
158
158
|
for (var i = 0; i < textSplitByCodeBlock.length; i++) {
|
|
159
159
|
if (i % 2 === 0) {
|
|
160
160
|
// Ignored via go/ees005
|
|
@@ -6,6 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.escapeLinks = escapeLinks;
|
|
7
7
|
exports.hasRuleNode = exports.hasMediaNode = exports.hasLinkMark = void 0;
|
|
8
8
|
exports.isPastedFromFabricEditor = isPastedFromFabricEditor;
|
|
9
|
+
// Ignored via go/ees005
|
|
10
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
11
|
+
var ESCAPE_LINKS_URL_REGEX = /^(https?|ftp|jamfselfservice):\/\/[^\s"'>]+$/;
|
|
9
12
|
function isPastedFromFabricEditor(pastedFrom) {
|
|
10
13
|
return pastedFrom === 'fabric-editor';
|
|
11
14
|
}
|
|
@@ -16,9 +19,7 @@ function escapeLinks(text) {
|
|
|
16
19
|
// Ignored via go/ees005
|
|
17
20
|
// eslint-disable-next-line require-unicode-regexp
|
|
18
21
|
return text.replace(/(\[([^\]]+)\]\()?((https?|ftp|jamfselfservice):\/\/[^\s"'>]+)/g, function (str) {
|
|
19
|
-
|
|
20
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
21
|
-
return str.match(/^(https?|ftp|jamfselfservice):\/\/[^\s"'>]+$/) ? "<".concat(str, ">") : str;
|
|
22
|
+
return str.match(ESCAPE_LINKS_URL_REGEX) ? "<".concat(str, ">") : str;
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
25
|
var hasMediaNode = exports.hasMediaNode = function hasMediaNode(slice) {
|
|
@@ -6,6 +6,10 @@ import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
|
6
6
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
8
8
|
import { escapeLinks } from './index';
|
|
9
|
+
|
|
10
|
+
// Ignored via go/ees005
|
|
11
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
12
|
+
const CODE_BLOCK_FENCE_REGEX = /```/;
|
|
9
13
|
export const formatMarkdown = (tr, pluginState) => {
|
|
10
14
|
let pasteStartPos = pluginState.pasteStartPos;
|
|
11
15
|
const pasteEndPos = pluginState.pasteEndPos;
|
|
@@ -146,10 +150,7 @@ export function getMarkdownSlice(text, schema, selection) {
|
|
|
146
150
|
try {
|
|
147
151
|
var _doc$content$firstChi, _doc$content$lastChil;
|
|
148
152
|
let textInput = text;
|
|
149
|
-
|
|
150
|
-
// Ignored via go/ees005
|
|
151
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
152
|
-
const textSplitByCodeBlock = textInput.split(/```/);
|
|
153
|
+
const textSplitByCodeBlock = textInput.split(CODE_BLOCK_FENCE_REGEX);
|
|
153
154
|
for (let i = 0; i < textSplitByCodeBlock.length; i++) {
|
|
154
155
|
if (i % 2 === 0) {
|
|
155
156
|
// Ignored via go/ees005
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// Ignored via go/ees005
|
|
2
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
3
|
+
const ESCAPE_LINKS_URL_REGEX = /^(https?|ftp|jamfselfservice):\/\/[^\s"'>]+$/;
|
|
1
4
|
export function isPastedFromFabricEditor(pastedFrom) {
|
|
2
5
|
return pastedFrom === 'fabric-editor';
|
|
3
6
|
}
|
|
@@ -8,9 +11,7 @@ export function escapeLinks(text) {
|
|
|
8
11
|
// Ignored via go/ees005
|
|
9
12
|
// eslint-disable-next-line require-unicode-regexp
|
|
10
13
|
return text.replace(/(\[([^\]]+)\]\()?((https?|ftp|jamfselfservice):\/\/[^\s"'>]+)/g, str => {
|
|
11
|
-
|
|
12
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
13
|
-
return str.match(/^(https?|ftp|jamfselfservice):\/\/[^\s"'>]+$/) ? `<${str}>` : str;
|
|
14
|
+
return str.match(ESCAPE_LINKS_URL_REGEX) ? `<${str}>` : str;
|
|
14
15
|
});
|
|
15
16
|
}
|
|
16
17
|
export const hasMediaNode = slice => {
|
|
@@ -6,6 +6,10 @@ import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
|
6
6
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
8
8
|
import { escapeLinks } from './index';
|
|
9
|
+
|
|
10
|
+
// Ignored via go/ees005
|
|
11
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
12
|
+
var CODE_BLOCK_FENCE_REGEX = /```/;
|
|
9
13
|
export var formatMarkdown = function formatMarkdown(tr, pluginState) {
|
|
10
14
|
var pasteStartPos = pluginState.pasteStartPos;
|
|
11
15
|
var pasteEndPos = pluginState.pasteEndPos;
|
|
@@ -144,10 +148,7 @@ export function getMarkdownSlice(text, schema, selection) {
|
|
|
144
148
|
try {
|
|
145
149
|
var _doc$content$firstChi, _doc$content$lastChil;
|
|
146
150
|
var textInput = text;
|
|
147
|
-
|
|
148
|
-
// Ignored via go/ees005
|
|
149
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
150
|
-
var textSplitByCodeBlock = textInput.split(/```/);
|
|
151
|
+
var textSplitByCodeBlock = textInput.split(CODE_BLOCK_FENCE_REGEX);
|
|
151
152
|
for (var i = 0; i < textSplitByCodeBlock.length; i++) {
|
|
152
153
|
if (i % 2 === 0) {
|
|
153
154
|
// Ignored via go/ees005
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// Ignored via go/ees005
|
|
2
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
3
|
+
var ESCAPE_LINKS_URL_REGEX = /^(https?|ftp|jamfselfservice):\/\/[^\s"'>]+$/;
|
|
1
4
|
export function isPastedFromFabricEditor(pastedFrom) {
|
|
2
5
|
return pastedFrom === 'fabric-editor';
|
|
3
6
|
}
|
|
@@ -8,9 +11,7 @@ export function escapeLinks(text) {
|
|
|
8
11
|
// Ignored via go/ees005
|
|
9
12
|
// eslint-disable-next-line require-unicode-regexp
|
|
10
13
|
return text.replace(/(\[([^\]]+)\]\()?((https?|ftp|jamfselfservice):\/\/[^\s"'>]+)/g, function (str) {
|
|
11
|
-
|
|
12
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
13
|
-
return str.match(/^(https?|ftp|jamfselfservice):\/\/[^\s"'>]+$/) ? "<".concat(str, ">") : str;
|
|
14
|
+
return str.match(ESCAPE_LINKS_URL_REGEX) ? "<".concat(str, ">") : str;
|
|
14
15
|
});
|
|
15
16
|
}
|
|
16
17
|
export var hasMediaNode = function hasMediaNode(slice) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste-options-toolbar",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.12",
|
|
4
4
|
"description": "Paste options toolbar for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,26 +22,26 @@
|
|
|
22
22
|
"atlaskit:src": "src/index.ts",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@atlaskit/css": "^1.0.0",
|
|
25
|
-
"@atlaskit/dropdown-menu": "^17.
|
|
25
|
+
"@atlaskit/dropdown-menu": "^17.1.0",
|
|
26
26
|
"@atlaskit/editor-markdown-transformer": "^6.0.0",
|
|
27
27
|
"@atlaskit/editor-plugin-analytics": "^12.0.0",
|
|
28
|
-
"@atlaskit/editor-plugin-paste": "^13.
|
|
28
|
+
"@atlaskit/editor-plugin-paste": "^13.3.0",
|
|
29
29
|
"@atlaskit/editor-plugin-ui-control-registry": "^6.0.0",
|
|
30
30
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
31
31
|
"@atlaskit/editor-shared-styles": "^4.0.0",
|
|
32
|
-
"@atlaskit/editor-toolbar": "^2.
|
|
33
|
-
"@atlaskit/editor-ui-control-model": "^2.
|
|
34
|
-
"@atlaskit/icon": "^36.
|
|
32
|
+
"@atlaskit/editor-toolbar": "^2.1.0",
|
|
33
|
+
"@atlaskit/editor-ui-control-model": "^2.1.0",
|
|
34
|
+
"@atlaskit/icon": "^36.1.0",
|
|
35
35
|
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
36
|
-
"@atlaskit/primitives": "^20.
|
|
37
|
-
"@atlaskit/tmp-editor-statsig": "^114.
|
|
38
|
-
"@atlaskit/tokens": "^15.
|
|
36
|
+
"@atlaskit/primitives": "^20.2.0",
|
|
37
|
+
"@atlaskit/tmp-editor-statsig": "^114.4.0",
|
|
38
|
+
"@atlaskit/tokens": "^15.2.0",
|
|
39
39
|
"@babel/runtime": "^7.0.0",
|
|
40
40
|
"@compiled/react": "^0.20.0",
|
|
41
41
|
"@emotion/react": "^11.7.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@atlaskit/editor-common": "^116.
|
|
44
|
+
"@atlaskit/editor-common": "^116.17.0",
|
|
45
45
|
"react": "^18.2.0",
|
|
46
46
|
"react-dom": "^18.2.0",
|
|
47
47
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|