@atlaskit/prosemirror-input-rules 3.1.1 → 3.2.1
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 +141 -126
- package/afm-jira/tsconfig.json +20 -0
- package/dist/cjs/utils.js +2 -1
- package/dist/es2019/utils.js +3 -2
- package/dist/esm/utils.js +3 -2
- package/dist/types/types.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +1 -1
- package/package.json +53 -55
- package/report.api.md +14 -17
- package/src/__tests__/unit/handler.ts +372 -374
- package/src/__tests__/unit/plugin.ts +154 -165
- package/src/editor-common.ts +13 -17
- package/src/handler.ts +121 -135
- package/src/index.ts +3 -3
- package/src/plugin.ts +106 -108
- package/src/types.ts +12 -23
- package/src/utils.ts +49 -56
- package/tsconfig.app.json +33 -33
- package/tsconfig.dev.json +43 -43
package/CHANGELOG.md
CHANGED
|
@@ -1,324 +1,339 @@
|
|
|
1
1
|
# @atlaskit/prosemirror-input-rules
|
|
2
2
|
|
|
3
|
+
## 3.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#132619](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/132619)
|
|
8
|
+
[`492710c431738`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/492710c431738) -
|
|
9
|
+
[ux] [EO2024-22] Fix typeahead interaction when node or table selection
|
|
10
|
+
|
|
11
|
+
## 3.2.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#124209](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/124209)
|
|
16
|
+
[`8aa1792f12ed3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8aa1792f12ed3) -
|
|
17
|
+
bump @atlaskit/editor-prosemirror to 5.0.0, bump @atlaskit/adf-schema to 40.1.0
|
|
18
|
+
|
|
3
19
|
## 3.1.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
6
22
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
23
|
+
- [#97698](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97698)
|
|
24
|
+
[`1c7b378c0d3b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1c7b378c0d3b) -
|
|
25
|
+
[HOT-108999] We had an incident where the cursor jumps back a character in table headers for any
|
|
26
|
+
language triggering composition on an empty line.This was fixed in a patch bump of
|
|
27
|
+
prosemirror-view. https://github.com/ProseMirror/prosemirror-view/compare/1.33.4...1.33.5
|
|
12
28
|
|
|
13
29
|
## 3.1.0
|
|
14
30
|
|
|
15
31
|
### Minor Changes
|
|
16
32
|
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
33
|
+
- [#91934](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91934)
|
|
34
|
+
[`b76a78c6a199`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b76a78c6a199) -
|
|
35
|
+
bumped editor-prosemirror version to 4.0.0
|
|
20
36
|
|
|
21
37
|
## 3.0.0
|
|
22
38
|
|
|
23
39
|
### Major Changes
|
|
24
40
|
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
41
|
+
- [#75482](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75482)
|
|
42
|
+
[`18b5a6fb910a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/18b5a6fb910a) - #
|
|
43
|
+
MAJOR CHANGE to `@atlaskit/prosemirror-input-rules` package.
|
|
28
44
|
|
|
29
|
-
|
|
45
|
+
## WHY?
|
|
30
46
|
|
|
31
|
-
|
|
47
|
+
Removing editor-common dependencies from prosemirror-input-rules package.
|
|
32
48
|
|
|
33
|
-
|
|
49
|
+
This makes it easier for editor updates because it simplifies our dependency graph.
|
|
34
50
|
|
|
35
|
-
|
|
51
|
+
## WHAT and HOW?
|
|
36
52
|
|
|
37
|
-
|
|
38
|
-
|
|
53
|
+
These are no longer available via `@atlaskit/prosemirror-input-rules` but are available from
|
|
54
|
+
`@atlaskit/editor-common/types`:
|
|
39
55
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
56
|
+
- InputRuleWrapper
|
|
57
|
+
- InputRuleHandler
|
|
58
|
+
- OnHandlerApply
|
|
59
|
+
- createRule
|
|
44
60
|
|
|
45
|
-
|
|
46
|
-
|
|
61
|
+
These have changed from a `SafePlugin` to a `SafePluginSpec`. In order to update your code you
|
|
62
|
+
need to instantiate a `SafePlugin` (ie. `new SafePlugin(createPlugin( ... ))`).
|
|
47
63
|
|
|
48
|
-
|
|
64
|
+
`SafePlugin` exists in `@atlaskit/editor-common/safe-plugin`.
|
|
49
65
|
|
|
50
|
-
|
|
51
|
-
|
|
66
|
+
- createPlugin
|
|
67
|
+
- createInputRulePlugin
|
|
52
68
|
|
|
53
69
|
## 2.4.6
|
|
54
70
|
|
|
55
71
|
### Patch Changes
|
|
56
72
|
|
|
57
|
-
-
|
|
73
|
+
- Updated dependencies
|
|
58
74
|
|
|
59
75
|
## 2.4.5
|
|
60
76
|
|
|
61
77
|
### Patch Changes
|
|
62
78
|
|
|
63
|
-
-
|
|
64
|
-
|
|
65
|
-
|
|
79
|
+
- [#68572](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68572)
|
|
80
|
+
[`15d407fe5143`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/15d407fe5143) -
|
|
81
|
+
Upgrading @atlaskit/editor-prosemirror dependency
|
|
66
82
|
|
|
67
83
|
## 2.4.4
|
|
68
84
|
|
|
69
85
|
### Patch Changes
|
|
70
86
|
|
|
71
|
-
-
|
|
87
|
+
- Updated dependencies
|
|
72
88
|
|
|
73
89
|
## 2.4.3
|
|
74
90
|
|
|
75
91
|
### Patch Changes
|
|
76
92
|
|
|
77
|
-
-
|
|
93
|
+
- Updated dependencies
|
|
78
94
|
|
|
79
95
|
## 2.4.2
|
|
80
96
|
|
|
81
97
|
### Patch Changes
|
|
82
98
|
|
|
83
|
-
-
|
|
99
|
+
- Updated dependencies
|
|
84
100
|
|
|
85
101
|
## 2.4.1
|
|
86
102
|
|
|
87
103
|
### Patch Changes
|
|
88
104
|
|
|
89
|
-
-
|
|
105
|
+
- Updated dependencies
|
|
90
106
|
|
|
91
107
|
## 2.4.0
|
|
92
108
|
|
|
93
109
|
### Minor Changes
|
|
94
110
|
|
|
95
|
-
-
|
|
96
|
-
|
|
97
|
-
|
|
111
|
+
- [#37964](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37964)
|
|
112
|
+
[`1944b35b538`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1944b35b538) - move
|
|
113
|
+
common utilities to editor-common, to help with decoupling block-type plugin
|
|
98
114
|
|
|
99
115
|
### Patch Changes
|
|
100
116
|
|
|
101
|
-
-
|
|
117
|
+
- Updated dependencies
|
|
102
118
|
|
|
103
119
|
## 2.3.2
|
|
104
120
|
|
|
105
121
|
### Patch Changes
|
|
106
122
|
|
|
107
|
-
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
-
|
|
123
|
+
- [#37821](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37821)
|
|
124
|
+
[`d2ecb6bf1a3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d2ecb6bf1a3) -
|
|
125
|
+
[ED-19203] Moved input rule types to editor-common to avoid circular dependencies
|
|
126
|
+
- Updated dependencies
|
|
111
127
|
|
|
112
128
|
## 2.3.1
|
|
113
129
|
|
|
114
130
|
### Patch Changes
|
|
115
131
|
|
|
116
|
-
-
|
|
117
|
-
|
|
118
|
-
|
|
132
|
+
- [#37785](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37785)
|
|
133
|
+
[`4e6f1bf8511`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e6f1bf8511) -
|
|
134
|
+
[ED-19233] Import prosemirror libraries from internal facade package
|
|
119
135
|
|
|
120
136
|
## 2.3.0
|
|
121
137
|
|
|
122
138
|
### Minor Changes
|
|
123
139
|
|
|
124
|
-
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
140
|
+
- [#36631](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36631)
|
|
141
|
+
[`8b891bf3590`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8b891bf3590) - This
|
|
142
|
+
change introduces `editor-plugin-hyperlink` which separates the hyperlink plugin from
|
|
143
|
+
`editor-core`. In order to enable this change there are now new entry points on `editor-common`
|
|
144
|
+
(such as `/link`, `/quick-insert`) in order to separate common code. Further
|
|
145
|
+
`prosemirror-input-rules` now has new exports of `createPlugin` and `createRule` which are used in
|
|
146
|
+
many plugins in `editor-core`.
|
|
131
147
|
|
|
132
148
|
### Patch Changes
|
|
133
149
|
|
|
134
|
-
-
|
|
150
|
+
- Updated dependencies
|
|
135
151
|
|
|
136
152
|
## 2.2.5
|
|
137
153
|
|
|
138
154
|
### Patch Changes
|
|
139
155
|
|
|
140
|
-
-
|
|
141
|
-
|
|
142
|
-
|
|
156
|
+
- [#36241](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36241)
|
|
157
|
+
[`5f5ba16de66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f5ba16de66) -
|
|
158
|
+
[ED-13910] Fix prosemirror types
|
|
143
159
|
|
|
144
160
|
## 2.2.4
|
|
145
161
|
|
|
146
162
|
### Patch Changes
|
|
147
163
|
|
|
148
|
-
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
-
|
|
164
|
+
- [#35782](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35782)
|
|
165
|
+
[`73b5128036b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73b5128036b) -
|
|
166
|
+
[ED-17082] Mark package as a singleton one
|
|
167
|
+
- Updated dependencies
|
|
152
168
|
|
|
153
169
|
## 2.2.3
|
|
154
170
|
|
|
155
171
|
### Patch Changes
|
|
156
172
|
|
|
157
|
-
-
|
|
158
|
-
|
|
159
|
-
|
|
173
|
+
- [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793)
|
|
174
|
+
[`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure
|
|
175
|
+
legacy types are published for TS 4.5-4.8
|
|
160
176
|
|
|
161
177
|
## 2.2.2
|
|
162
178
|
|
|
163
179
|
### Patch Changes
|
|
164
180
|
|
|
165
|
-
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
-
|
|
181
|
+
- [#33771](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33771)
|
|
182
|
+
[`a142ba1aa28`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a142ba1aa28) -
|
|
183
|
+
[ED17172] Bump prosemirror-model to 1.16.0 and prosemirror-view to 1.23.7 and removed work-arounds
|
|
184
|
+
for fixed issues
|
|
185
|
+
- Updated dependencies
|
|
170
186
|
|
|
171
187
|
## 2.2.1
|
|
172
188
|
|
|
173
189
|
### Patch Changes
|
|
174
190
|
|
|
175
|
-
-
|
|
176
|
-
|
|
177
|
-
|
|
191
|
+
- [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649)
|
|
192
|
+
[`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade
|
|
193
|
+
Typescript from `4.5.5` to `4.9.5`
|
|
178
194
|
|
|
179
195
|
## 2.2.0
|
|
180
196
|
|
|
181
197
|
### Minor Changes
|
|
182
198
|
|
|
183
|
-
-
|
|
184
|
-
|
|
185
|
-
|
|
199
|
+
- [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258)
|
|
200
|
+
[`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip
|
|
201
|
+
minor dependency bump
|
|
186
202
|
|
|
187
203
|
### Patch Changes
|
|
188
204
|
|
|
189
|
-
-
|
|
205
|
+
- Updated dependencies
|
|
190
206
|
|
|
191
207
|
## 2.1.12
|
|
192
208
|
|
|
193
209
|
### Patch Changes
|
|
194
210
|
|
|
195
|
-
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
-
|
|
211
|
+
- [#33004](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33004)
|
|
212
|
+
[`0ffb55018c9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0ffb55018c9) - Revert
|
|
213
|
+
"[ED-17172] Bumped prosemirror-view from 1.23.2 to 1.23.7 and removed work-around for fixed
|
|
214
|
+
issues"
|
|
215
|
+
- Updated dependencies
|
|
200
216
|
|
|
201
217
|
## 2.1.11
|
|
202
218
|
|
|
203
219
|
### Patch Changes
|
|
204
220
|
|
|
205
|
-
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
-
|
|
221
|
+
- [#32424](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32424)
|
|
222
|
+
[`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY
|
|
223
|
+
remove before merging to master; dupe adf-schema via adf-utils
|
|
224
|
+
- Updated dependencies
|
|
209
225
|
|
|
210
226
|
## 2.1.10
|
|
211
227
|
|
|
212
228
|
### Patch Changes
|
|
213
229
|
|
|
214
|
-
-
|
|
230
|
+
- Updated dependencies
|
|
215
231
|
|
|
216
232
|
## 2.1.9
|
|
217
233
|
|
|
218
234
|
### Patch Changes
|
|
219
235
|
|
|
220
|
-
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
-
|
|
236
|
+
- [#26712](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/26712)
|
|
237
|
+
[`0606572f9b8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0606572f9b8) - [ux]
|
|
238
|
+
ED-15348 docs(changeset): ED-15348 Fix a bug preventing typeahead actions to be fired from a gap
|
|
239
|
+
cursor. Typing a typeahead trigger key (/, : or @) should pop-up a typeahead menu. However, if the
|
|
240
|
+
current selection is inside a gap cursor, the trigger character is inserted and the pop-up menu
|
|
241
|
+
doesn't open. This changeset fixes that.
|
|
242
|
+
- Updated dependencies
|
|
227
243
|
|
|
228
244
|
## 2.1.8
|
|
229
245
|
|
|
230
246
|
### Patch Changes
|
|
231
247
|
|
|
232
|
-
-
|
|
248
|
+
- Updated dependencies
|
|
233
249
|
|
|
234
250
|
## 2.1.7
|
|
235
251
|
|
|
236
252
|
### Patch Changes
|
|
237
253
|
|
|
238
|
-
-
|
|
254
|
+
- Updated dependencies
|
|
239
255
|
|
|
240
256
|
## 2.1.6
|
|
241
257
|
|
|
242
258
|
### Patch Changes
|
|
243
259
|
|
|
244
|
-
-
|
|
260
|
+
- Updated dependencies
|
|
245
261
|
|
|
246
262
|
## 2.1.5
|
|
247
263
|
|
|
248
264
|
### Patch Changes
|
|
249
265
|
|
|
250
|
-
-
|
|
266
|
+
- Updated dependencies
|
|
251
267
|
|
|
252
268
|
## 2.1.4
|
|
253
269
|
|
|
254
270
|
### Patch Changes
|
|
255
271
|
|
|
256
|
-
-
|
|
272
|
+
- Updated dependencies
|
|
257
273
|
|
|
258
274
|
## 2.1.3
|
|
259
275
|
|
|
260
276
|
### Patch Changes
|
|
261
277
|
|
|
262
|
-
-
|
|
278
|
+
- Updated dependencies
|
|
263
279
|
|
|
264
280
|
## 2.1.2
|
|
265
281
|
|
|
266
282
|
### Patch Changes
|
|
267
283
|
|
|
268
|
-
-
|
|
269
|
-
|
|
270
|
-
|
|
284
|
+
- [#18526](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/18526)
|
|
285
|
+
[`4e6fbaf5898`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e6fbaf5898) - ED-14117
|
|
286
|
+
Change EditorState.apply type to receive readonly transaction
|
|
271
287
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
compile-time safeguard.
|
|
288
|
+
Transactions should not be mutated after being dispatched as it can lead to unexpected behaviour.
|
|
289
|
+
This change patches the relevant types declared in prosemirror-state as a compile-time safeguard.
|
|
275
290
|
|
|
276
|
-
-
|
|
291
|
+
- Updated dependencies
|
|
277
292
|
|
|
278
293
|
## 2.1.1
|
|
279
294
|
|
|
280
295
|
### Patch Changes
|
|
281
296
|
|
|
282
|
-
-
|
|
283
|
-
|
|
284
|
-
|
|
297
|
+
- [#16752](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/16752)
|
|
298
|
+
[`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - ED-13025
|
|
299
|
+
Bump prosemirror-view 1.23.1 -> 1.23.2
|
|
285
300
|
|
|
286
301
|
## 2.1.0
|
|
287
302
|
|
|
288
303
|
### Minor Changes
|
|
289
304
|
|
|
290
|
-
-
|
|
291
|
-
|
|
292
|
-
|
|
305
|
+
- [#15998](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/15998)
|
|
306
|
+
[`b230f366971`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b230f366971) -
|
|
307
|
+
[ED-14008] Bump prosemirror-view from 1.20.2 to 1.23.1
|
|
293
308
|
|
|
294
309
|
### Patch Changes
|
|
295
310
|
|
|
296
|
-
-
|
|
297
|
-
|
|
311
|
+
- [`c6feed82071`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c6feed82071) -
|
|
312
|
+
ED-11632: Bump prosemirror packages;
|
|
298
313
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
314
|
+
- prosmirror-commands 1.1.4 -> 1.1.11,
|
|
315
|
+
- prosemirror-model 1.11.0 -> 1.14.3,
|
|
316
|
+
- prosemirror-state 1.3.3 -> 1.3.4,
|
|
317
|
+
- prosemirror-transform 1.2.8 -> 1.3.2,
|
|
318
|
+
- prosemirror-view 1.15.4 + 1.18.8 -> 1.20.2.
|
|
304
319
|
|
|
305
320
|
## 2.0.1
|
|
306
321
|
|
|
307
322
|
### Patch Changes
|
|
308
323
|
|
|
309
|
-
-
|
|
310
|
-
|
|
311
|
-
|
|
324
|
+
- [#10943](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/10943)
|
|
325
|
+
[`312a2810b0b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/312a2810b0b) - [ux]
|
|
326
|
+
ED-12931 Fix input rules replacing text outside of matched word in a long paragraph
|
|
312
327
|
|
|
313
328
|
## 2.0.0
|
|
314
329
|
|
|
315
330
|
### Major Changes
|
|
316
331
|
|
|
317
|
-
-
|
|
318
|
-
|
|
319
|
-
|
|
332
|
+
- [#10230](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/10230)
|
|
333
|
+
[`d989a24dd88`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d989a24dd88) -
|
|
334
|
+
[ED-11915] New package to manage auto formatting rules without a undoInputRules
|
|
320
335
|
|
|
321
336
|
### Minor Changes
|
|
322
337
|
|
|
323
|
-
-
|
|
324
|
-
|
|
338
|
+
- [`54ec986ebff`](https://bitbucket.org/atlassian/atlassian-frontend/commits/54ec986ebff) -
|
|
339
|
+
[ED-11915] Export editor/input-rules OnHandlerApply type
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.jira.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"outDir": "../../../../../tsDist/@atlaskit__prosemirror-input-rules/app",
|
|
7
|
+
"composite": true,
|
|
8
|
+
"rootDir": "../"
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"../src/**/*.ts",
|
|
12
|
+
"../src/**/*.tsx"
|
|
13
|
+
],
|
|
14
|
+
"exclude": [
|
|
15
|
+
"../src/**/__tests__/*",
|
|
16
|
+
"../src/**/*.test.*",
|
|
17
|
+
"../src/**/test.*"
|
|
18
|
+
],
|
|
19
|
+
"references": []
|
|
20
|
+
}
|
package/dist/cjs/utils.js
CHANGED
|
@@ -41,7 +41,8 @@ var createPlugin = exports.createPlugin = function createPlugin(pluginName, rule
|
|
|
41
41
|
to = _ref.to;
|
|
42
42
|
var unsupportedMarks = isBlockNodeRule ? ['code', 'link', 'typeAheadQuery'] : ['code'];
|
|
43
43
|
var $from = state.selection.$from;
|
|
44
|
-
|
|
44
|
+
var isInline = state.selection instanceof _state.NodeSelection && state.selection.node.type.isInline;
|
|
45
|
+
if ($from.parent.type.spec.code || !(state.selection instanceof _state.TextSelection) && !(0, _editorCommon.isGapCursorSelection)(state.selection) && !isInline || hasUnsupportedMarks(state, from, to, unsupportedMarks) || isBlockNodeRule && isCursorInsideUnsupportedMarks(state, unsupportedMarks)) {
|
|
45
46
|
return false;
|
|
46
47
|
}
|
|
47
48
|
return true;
|
package/dist/es2019/utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { closeHistory } from '@atlaskit/editor-prosemirror/history';
|
|
2
|
-
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { isGapCursorSelection } from './editor-common';
|
|
4
4
|
import { createInputRulePlugin } from './plugin';
|
|
5
5
|
const hasUnsupportedMarks = (state, start, end, marksNameUnsupported) => {
|
|
@@ -35,7 +35,8 @@ export const createPlugin = (pluginName, rules, options = {}) => {
|
|
|
35
35
|
}) => {
|
|
36
36
|
const unsupportedMarks = isBlockNodeRule ? ['code', 'link', 'typeAheadQuery'] : ['code'];
|
|
37
37
|
const $from = state.selection.$from;
|
|
38
|
-
|
|
38
|
+
const isInline = state.selection instanceof NodeSelection && state.selection.node.type.isInline;
|
|
39
|
+
if ($from.parent.type.spec.code || !(state.selection instanceof TextSelection) && !isGapCursorSelection(state.selection) && !isInline || hasUnsupportedMarks(state, from, to, unsupportedMarks) || isBlockNodeRule && isCursorInsideUnsupportedMarks(state, unsupportedMarks)) {
|
|
39
40
|
return false;
|
|
40
41
|
}
|
|
41
42
|
return true;
|
package/dist/esm/utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { closeHistory } from '@atlaskit/editor-prosemirror/history';
|
|
2
|
-
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { isGapCursorSelection } from './editor-common';
|
|
4
4
|
import { createInputRulePlugin } from './plugin';
|
|
5
5
|
var hasUnsupportedMarks = function hasUnsupportedMarks(state, start, end, marksNameUnsupported) {
|
|
@@ -35,7 +35,8 @@ export var createPlugin = function createPlugin(pluginName, rules) {
|
|
|
35
35
|
to = _ref.to;
|
|
36
36
|
var unsupportedMarks = isBlockNodeRule ? ['code', 'link', 'typeAheadQuery'] : ['code'];
|
|
37
37
|
var $from = state.selection.$from;
|
|
38
|
-
|
|
38
|
+
var isInline = state.selection instanceof NodeSelection && state.selection.node.type.isInline;
|
|
39
|
+
if ($from.parent.type.spec.code || !(state.selection instanceof TextSelection) && !isGapCursorSelection(state.selection) && !isInline || hasUnsupportedMarks(state, from, to, unsupportedMarks) || isBlockNodeRule && isCursorInsideUnsupportedMarks(state, unsupportedMarks)) {
|
|
39
40
|
return false;
|
|
40
41
|
}
|
|
41
42
|
return true;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { InputRuleWrapper } from './editor-common';
|
|
4
|
-
export type { InputRuleHandler, InputRuleWrapper, OnHandlerApply
|
|
4
|
+
export type { InputRuleHandler, InputRuleWrapper, OnHandlerApply } from './editor-common';
|
|
5
5
|
export type HandleInputEvent = (props: {
|
|
6
6
|
view: EditorView;
|
|
7
7
|
from: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { InputRuleWrapper } from './editor-common';
|
|
4
|
-
export type { InputRuleHandler, InputRuleWrapper, OnHandlerApply
|
|
4
|
+
export type { InputRuleHandler, InputRuleWrapper, OnHandlerApply } from './editor-common';
|
|
5
5
|
export type HandleInputEvent = (props: {
|
|
6
6
|
view: EditorView;
|
|
7
7
|
from: number;
|