@atlaskit/prosemirror-input-rules 3.6.0 → 3.6.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 +16 -0
- package/dist/cjs/plugin.js +7 -1
- package/dist/es2019/plugin.js +7 -1
- package/dist/esm/plugin.js +7 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/prosemirror-input-rules
|
|
2
2
|
|
|
3
|
+
## 3.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4d676bbdb3ce6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4d676bbdb3ce6) -
|
|
8
|
+
ts-ignore added temporarily to unblock local consumption for help-center, will be removed once
|
|
9
|
+
project refs are setup
|
|
10
|
+
|
|
11
|
+
## 3.6.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`483638368fadb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/483638368fadb) -
|
|
16
|
+
[ux] [EDITOR-2675] add test coverage and prevent range selections after inline formatting
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 3.6.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -27,6 +27,7 @@ function createInputRulePlugin(pluginName, rules) {
|
|
|
27
27
|
init: function init() {
|
|
28
28
|
return null;
|
|
29
29
|
},
|
|
30
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
30
31
|
apply: function apply(tr, prev) {
|
|
31
32
|
var stored = tr.getMeta(pluginKey);
|
|
32
33
|
if (stored) {
|
|
@@ -35,7 +36,9 @@ function createInputRulePlugin(pluginName, rules) {
|
|
|
35
36
|
return tr.selectionSet || tr.docChanged ? null : prev;
|
|
36
37
|
}
|
|
37
38
|
},
|
|
39
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
38
40
|
appendTransaction: function appendTransaction(transactions, oldState, newState) {
|
|
41
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
39
42
|
var transactionWithInputRuleMeta = transactions.find(function (tr) {
|
|
40
43
|
return tr.getMeta(pluginKey);
|
|
41
44
|
});
|
|
@@ -62,11 +65,12 @@ function createInputRulePlugin(pluginName, rules) {
|
|
|
62
65
|
// else, we set the selection at the end of the inline code which doesn't make sense if we are closing the inline code from R to L
|
|
63
66
|
if (isBackwardMatch && (0, _expValEquals.expValEquals)('platform_editor_lovability_inline_code', 'isEnabled', true)) {
|
|
64
67
|
var prevSelection = oldState.selection.map(tr.doc, tr.mapping);
|
|
65
|
-
tr.setSelection(prevSelection);
|
|
68
|
+
tr.setSelection(new _state.TextSelection(prevSelection.$from));
|
|
66
69
|
}
|
|
67
70
|
return tr;
|
|
68
71
|
},
|
|
69
72
|
props: {
|
|
73
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
70
74
|
handleTextInput: function handleTextInput(view, from, to, text) {
|
|
71
75
|
return inputEvent({
|
|
72
76
|
view: view,
|
|
@@ -76,6 +80,7 @@ function createInputRulePlugin(pluginName, rules) {
|
|
|
76
80
|
});
|
|
77
81
|
},
|
|
78
82
|
handleDOMEvents: {
|
|
83
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
79
84
|
blur: function blur(view) {
|
|
80
85
|
if (!(options !== null && options !== void 0 && options.checkOnBlur)) {
|
|
81
86
|
return false;
|
|
@@ -96,6 +101,7 @@ function createInputRulePlugin(pluginName, rules) {
|
|
|
96
101
|
}
|
|
97
102
|
return false;
|
|
98
103
|
},
|
|
104
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
99
105
|
compositionend: function compositionend(view) {
|
|
100
106
|
setTimeout(function () {
|
|
101
107
|
var selection = view.state.selection;
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -20,6 +20,7 @@ export function createInputRulePlugin(pluginName, rules, options = {}) {
|
|
|
20
20
|
init() {
|
|
21
21
|
return null;
|
|
22
22
|
},
|
|
23
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
23
24
|
apply(tr, prev) {
|
|
24
25
|
const stored = tr.getMeta(pluginKey);
|
|
25
26
|
if (stored) {
|
|
@@ -28,7 +29,9 @@ export function createInputRulePlugin(pluginName, rules, options = {}) {
|
|
|
28
29
|
return tr.selectionSet || tr.docChanged ? null : prev;
|
|
29
30
|
}
|
|
30
31
|
},
|
|
32
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
31
33
|
appendTransaction: (transactions, oldState, newState) => {
|
|
34
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
32
35
|
const transactionWithInputRuleMeta = transactions.find(tr => tr.getMeta(pluginKey));
|
|
33
36
|
const pluginState = transactionWithInputRuleMeta === null || transactionWithInputRuleMeta === void 0 ? void 0 : transactionWithInputRuleMeta.getMeta(pluginKey);
|
|
34
37
|
if (!pluginState || !transactionWithInputRuleMeta) {
|
|
@@ -57,11 +60,12 @@ export function createInputRulePlugin(pluginName, rules, options = {}) {
|
|
|
57
60
|
// else, we set the selection at the end of the inline code which doesn't make sense if we are closing the inline code from R to L
|
|
58
61
|
if (isBackwardMatch && expValEquals('platform_editor_lovability_inline_code', 'isEnabled', true)) {
|
|
59
62
|
const prevSelection = oldState.selection.map(tr.doc, tr.mapping);
|
|
60
|
-
tr.setSelection(prevSelection);
|
|
63
|
+
tr.setSelection(new TextSelection(prevSelection.$from));
|
|
61
64
|
}
|
|
62
65
|
return tr;
|
|
63
66
|
},
|
|
64
67
|
props: {
|
|
68
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
65
69
|
handleTextInput(view, from, to, text) {
|
|
66
70
|
return inputEvent({
|
|
67
71
|
view,
|
|
@@ -71,6 +75,7 @@ export function createInputRulePlugin(pluginName, rules, options = {}) {
|
|
|
71
75
|
});
|
|
72
76
|
},
|
|
73
77
|
handleDOMEvents: {
|
|
78
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
74
79
|
blur: view => {
|
|
75
80
|
if (!(options !== null && options !== void 0 && options.checkOnBlur)) {
|
|
76
81
|
return false;
|
|
@@ -93,6 +98,7 @@ export function createInputRulePlugin(pluginName, rules, options = {}) {
|
|
|
93
98
|
}
|
|
94
99
|
return false;
|
|
95
100
|
},
|
|
101
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
96
102
|
compositionend: view => {
|
|
97
103
|
setTimeout(() => {
|
|
98
104
|
const selection = view.state.selection;
|
package/dist/esm/plugin.js
CHANGED
|
@@ -21,6 +21,7 @@ export function createInputRulePlugin(pluginName, rules) {
|
|
|
21
21
|
init: function init() {
|
|
22
22
|
return null;
|
|
23
23
|
},
|
|
24
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
24
25
|
apply: function apply(tr, prev) {
|
|
25
26
|
var stored = tr.getMeta(pluginKey);
|
|
26
27
|
if (stored) {
|
|
@@ -29,7 +30,9 @@ export function createInputRulePlugin(pluginName, rules) {
|
|
|
29
30
|
return tr.selectionSet || tr.docChanged ? null : prev;
|
|
30
31
|
}
|
|
31
32
|
},
|
|
33
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
32
34
|
appendTransaction: function appendTransaction(transactions, oldState, newState) {
|
|
35
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
33
36
|
var transactionWithInputRuleMeta = transactions.find(function (tr) {
|
|
34
37
|
return tr.getMeta(pluginKey);
|
|
35
38
|
});
|
|
@@ -56,11 +59,12 @@ export function createInputRulePlugin(pluginName, rules) {
|
|
|
56
59
|
// else, we set the selection at the end of the inline code which doesn't make sense if we are closing the inline code from R to L
|
|
57
60
|
if (isBackwardMatch && expValEquals('platform_editor_lovability_inline_code', 'isEnabled', true)) {
|
|
58
61
|
var prevSelection = oldState.selection.map(tr.doc, tr.mapping);
|
|
59
|
-
tr.setSelection(prevSelection);
|
|
62
|
+
tr.setSelection(new TextSelection(prevSelection.$from));
|
|
60
63
|
}
|
|
61
64
|
return tr;
|
|
62
65
|
},
|
|
63
66
|
props: {
|
|
67
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
64
68
|
handleTextInput: function handleTextInput(view, from, to, text) {
|
|
65
69
|
return inputEvent({
|
|
66
70
|
view: view,
|
|
@@ -70,6 +74,7 @@ export function createInputRulePlugin(pluginName, rules) {
|
|
|
70
74
|
});
|
|
71
75
|
},
|
|
72
76
|
handleDOMEvents: {
|
|
77
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
73
78
|
blur: function blur(view) {
|
|
74
79
|
if (!(options !== null && options !== void 0 && options.checkOnBlur)) {
|
|
75
80
|
return false;
|
|
@@ -90,6 +95,7 @@ export function createInputRulePlugin(pluginName, rules) {
|
|
|
90
95
|
}
|
|
91
96
|
return false;
|
|
92
97
|
},
|
|
98
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
93
99
|
compositionend: function compositionend(view) {
|
|
94
100
|
setTimeout(function () {
|
|
95
101
|
var selection = view.state.selection;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/prosemirror-input-rules",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.2",
|
|
4
4
|
"description": "A package that contains helpers to create autoformatting rules for ProseMirror",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
31
31
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
32
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
32
|
+
"@atlaskit/tmp-editor-statsig": "^13.42.0",
|
|
33
33
|
"@babel/runtime": "^7.0.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@atlaskit/editor-common": "^110.
|
|
36
|
+
"@atlaskit/editor-common": "^110.34.0"
|
|
37
37
|
},
|
|
38
38
|
"techstack": {
|
|
39
39
|
"@atlassian/frontend": {
|