@atlaskit/editor-tables 2.3.10 → 2.3.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +47 -35
  2. package/dist/cjs/cell-bookmark.js +2 -3
  3. package/dist/cjs/cell-selection.js +1 -2
  4. package/dist/cjs/pm-plugins/input.js +2 -3
  5. package/dist/cjs/pm-plugins/plugin-key.js +2 -4
  6. package/dist/cjs/table-map.js +4 -8
  7. package/dist/cjs/utils/add-column-at.js +2 -3
  8. package/dist/cjs/utils/add-row-at.js +3 -5
  9. package/dist/cjs/utils/clone-tr.js +2 -3
  10. package/dist/cjs/utils/create-table.js +2 -3
  11. package/dist/cjs/utils/empty-cells.js +2 -3
  12. package/dist/cjs/utils/find.js +5 -9
  13. package/dist/cjs/utils/for-each-cell.js +3 -5
  14. package/dist/cjs/utils/get-cells-in-column.js +2 -3
  15. package/dist/cjs/utils/get-cells-in-row.js +2 -3
  16. package/dist/cjs/utils/get-cells-in-table.js +2 -3
  17. package/dist/cjs/utils/get-selection-range-in-column.js +2 -3
  18. package/dist/cjs/utils/get-selection-range-in-row.js +2 -3
  19. package/dist/cjs/utils/get-selection-rect.js +2 -3
  20. package/dist/cjs/utils/is-selected.js +5 -9
  21. package/dist/cjs/utils/move-column.js +2 -3
  22. package/dist/cjs/utils/move-row.js +2 -3
  23. package/dist/cjs/utils/remove-column.js +4 -7
  24. package/dist/cjs/utils/remove-row.js +4 -7
  25. package/dist/cjs/utils/remove-table.js +2 -3
  26. package/dist/cjs/utils/reorder-utils.js +7 -13
  27. package/dist/cjs/utils/replace-table.js +2 -3
  28. package/dist/cjs/utils/select-nodes.js +54 -10
  29. package/dist/cjs/utils/set-cell-attrs.js +2 -3
  30. package/dist/cjs/utils/split-cell.js +2 -3
  31. package/dist/cjs/utils/test-utils.js +5 -9
  32. package/dist/cjs/utils/uuid.js +4 -5
  33. package/dist/es2019/utils/select-nodes.js +49 -1
  34. package/dist/esm/pm-plugins/input.js +1 -1
  35. package/dist/esm/utils/select-nodes.js +49 -1
  36. package/dist/types/utils/select-nodes.d.ts +2 -2
  37. package/dist/types-ts4.5/utils/select-nodes.d.ts +2 -2
  38. package/package.json +7 -3
package/CHANGELOG.md CHANGED
@@ -1,16 +1,28 @@
1
1
  # @atlaskit/editor-tables
2
2
 
3
+ ## 2.3.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [#41991](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41991) [`28a7171e7e3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/28a7171e7e3) - [ux] add shift click select backward feature to expand selection
8
+
9
+ ## 2.3.11
10
+
11
+ ### Patch Changes
12
+
13
+ - [#39749](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39749) [`e6b69f455c3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e6b69f455c3) - Connect yarn changeset to packages, upgrade adf-schema
14
+
3
15
  ## 2.3.10
4
16
 
5
17
  ### Patch Changes
6
18
 
7
- - [`37c62369dae`](https://bitbucket.org/atlassian/atlassian-frontend/commits/37c62369dae) - NO-ISSUE Import doc builder types from editor-common
19
+ - [#39984](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39984) [`37c62369dae`](https://bitbucket.org/atlassian/atlassian-frontend/commits/37c62369dae) - NO-ISSUE Import doc builder types from editor-common
8
20
 
9
21
  ## 2.3.9
10
22
 
11
23
  ### Patch Changes
12
24
 
13
- - [`35242fb367a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/35242fb367a) - Add custom-table-width feature flag and add width to table node when inserted
25
+ - [#39381](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39381) [`35242fb367a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/35242fb367a) - Add custom-table-width feature flag and add width to table node when inserted
14
26
 
15
27
  ## 2.3.8
16
28
 
@@ -22,67 +34,67 @@
22
34
 
23
35
  ### Patch Changes
24
36
 
25
- - [`4e6f1bf8511`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e6f1bf8511) - [ED-19233] Import prosemirror libraries from internal facade package
37
+ - [#37785](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37785) [`4e6f1bf8511`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e6f1bf8511) - [ED-19233] Import prosemirror libraries from internal facade package
26
38
 
27
39
  ## 2.3.6
28
40
 
29
41
  ### Patch Changes
30
42
 
31
- - [`5f5ba16de66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f5ba16de66) - [ED-13910] Fix prosemirror types
43
+ - [#36241](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36241) [`5f5ba16de66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f5ba16de66) - [ED-13910] Fix prosemirror types
32
44
 
33
45
  ## 2.3.5
34
46
 
35
47
  ### Patch Changes
36
48
 
37
- - [`73b5128036b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73b5128036b) - [ED-17082] Mark package as a singleton one
49
+ - [#35782](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35782) [`73b5128036b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73b5128036b) - [ED-17082] Mark package as a singleton one
38
50
 
39
51
  ## 2.3.4
40
52
 
41
53
  ### Patch Changes
42
54
 
43
- - [`fa1f53e0ae7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fa1f53e0ae7) - [ED-18167] Remove dependency of editor-tables on adf schema library to avoid a circular dependency
55
+ - [#35533](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35533) [`fa1f53e0ae7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fa1f53e0ae7) - [ED-18167] Remove dependency of editor-tables on adf schema library to avoid a circular dependency
44
56
 
45
57
  ## 2.3.3
46
58
 
47
59
  ### Patch Changes
48
60
 
49
- - [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
61
+ - [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793) [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
50
62
 
51
63
  ## 2.3.2
52
64
 
53
65
  ### Patch Changes
54
66
 
55
- - [`a142ba1aa28`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a142ba1aa28) - [ED17172] Bump prosemirror-model to 1.16.0 and prosemirror-view to 1.23.7 and removed work-arounds for fixed issues
67
+ - [#33771](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33771) [`a142ba1aa28`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a142ba1aa28) - [ED17172] Bump prosemirror-model to 1.16.0 and prosemirror-view to 1.23.7 and removed work-arounds for fixed issues
56
68
 
57
69
  ## 2.3.1
58
70
 
59
71
  ### Patch Changes
60
72
 
61
- - [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
73
+ - [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649) [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
62
74
 
63
75
  ## 2.3.0
64
76
 
65
77
  ### Minor Changes
66
78
 
67
- - [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
79
+ - [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258) [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
68
80
 
69
81
  ## 2.2.6
70
82
 
71
83
  ### Patch Changes
72
84
 
73
- - [`0ffb55018c9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0ffb55018c9) - Revert "[ED-17172] Bumped prosemirror-view from 1.23.2 to 1.23.7 and removed work-around for fixed issues"
85
+ - [#33004](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33004) [`0ffb55018c9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0ffb55018c9) - Revert "[ED-17172] Bumped prosemirror-view from 1.23.2 to 1.23.7 and removed work-around for fixed issues"
74
86
 
75
87
  ## 2.2.5
76
88
 
77
89
  ### Patch Changes
78
90
 
79
- - [`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY remove before merging to master; dupe adf-schema via adf-utils
91
+ - [#32424](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32424) [`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY remove before merging to master; dupe adf-schema via adf-utils
80
92
 
81
93
  ## 2.2.4
82
94
 
83
95
  ### Patch Changes
84
96
 
85
- - [`4080eb013ef`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4080eb013ef) - [ux] Fix bug where pasting inside a table did not respect the table's headers. Pasted cells are formatted based on the table they are being pasted into.
97
+ - [#28932](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/28932) [`4080eb013ef`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4080eb013ef) - [ux] Fix bug where pasting inside a table did not respect the table's headers. Pasted cells are formatted based on the table they are being pasted into.
86
98
  - [`4f6a895f1d5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4f6a895f1d5) - Set selectable property for selectable nodes
87
99
  - [`4f6a895f1d5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4f6a895f1d5) - Fix arrow shift selection coming from outside of the table
88
100
 
@@ -90,44 +102,44 @@
90
102
 
91
103
  ### Patch Changes
92
104
 
93
- - [`dbef481f7df`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dbef481f7df) - [ux] ED-15724: fix the merged row(2nd row or later) cannot been recongnized as row selection and cannot be deleted.
105
+ - [#28090](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/28090) [`dbef481f7df`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dbef481f7df) - [ux] ED-15724: fix the merged row(2nd row or later) cannot been recongnized as row selection and cannot be deleted.
94
106
 
95
107
  ## 2.2.2
96
108
 
97
109
  ### Patch Changes
98
110
 
99
- - [`47f1f76cb80`](https://bitbucket.org/atlassian/atlassian-frontend/commits/47f1f76cb80) - Add selectTableClosestToPos function
111
+ - [#26712](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/26712) [`47f1f76cb80`](https://bitbucket.org/atlassian/atlassian-frontend/commits/47f1f76cb80) - Add selectTableClosestToPos function
100
112
  - [`755d7bf5c2a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/755d7bf5c2a) - [ux] ED-12527 Prevents editor-tables handleMouseDown() from creating a cell selection when right clicking in a table cell.
101
113
 
102
114
  ## 2.2.1
103
115
 
104
116
  ### Patch Changes
105
117
 
106
- - [`403e0d2d291`](https://bitbucket.org/atlassian/atlassian-frontend/commits/403e0d2d291) - ED-16246 fix prevent @types/prosemirror-commands @types/prosemirror-keymap updating to incompatible version.
118
+ - [#27511](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/27511) [`403e0d2d291`](https://bitbucket.org/atlassian/atlassian-frontend/commits/403e0d2d291) - ED-16246 fix prevent @types/prosemirror-commands @types/prosemirror-keymap updating to incompatible version.
107
119
 
108
120
  ## 2.2.0
109
121
 
110
122
  ### Minor Changes
111
123
 
112
- - [`d8acf7254db`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d8acf7254db) - ED-8567 added tracking for fixTables()
124
+ - [#24710](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24710) [`d8acf7254db`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d8acf7254db) - ED-8567 added tracking for fixTables()
113
125
 
114
126
  ## 2.1.6
115
127
 
116
128
  ### Patch Changes
117
129
 
118
- - [`95f007063cf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/95f007063cf) - Decoupling paste plugin and table plugin, copied `replaceSelectedTable` and `getSelectedTableInfo` utils to editor-tables utils package and analytics dependency shifted to paste plugin.
130
+ - [#24607](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24607) [`95f007063cf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/95f007063cf) - Decoupling paste plugin and table plugin, copied `replaceSelectedTable` and `getSelectedTableInfo` utils to editor-tables utils package and analytics dependency shifted to paste plugin.
119
131
 
120
132
  ## 2.1.5
121
133
 
122
134
  ### Patch Changes
123
135
 
124
- - [`e6f25536fe3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e6f25536fe3) - [ux][ed-15168] Fixes a bug where a width-less column was created when pasting table cells into a table that had columns with set widths.
136
+ - [#23381](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/23381) [`e6f25536fe3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e6f25536fe3) - [ux][ed-15168] Fixes a bug where a width-less column was created when pasting table cells into a table that had columns with set widths.
125
137
 
126
138
  ## 2.1.4
127
139
 
128
140
  ### Patch Changes
129
141
 
130
- - [`b29ce16dad8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b29ce16dad8) - [ED-14606] Move bitbucket schema, confluence schema, jira schema, and default schema from @atlaskit/adf-schema to their own entry points. These new entry points are as follows
142
+ - [#20033](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/20033) [`b29ce16dad8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b29ce16dad8) - [ED-14606] Move bitbucket schema, confluence schema, jira schema, and default schema from @atlaskit/adf-schema to their own entry points. These new entry points are as follows
131
143
 
132
144
  @atlaskit/adf-schema/schema-bitbucket for:
133
145
 
@@ -165,13 +177,13 @@
165
177
 
166
178
  ### Patch Changes
167
179
 
168
- - [`cbfbaab61bb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cbfbaab61bb) - [ux][ed-14300] Remove column width from table cells being pasted into another table as it should take the formatting of the destination table.
180
+ - [#19618](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/19618) [`cbfbaab61bb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cbfbaab61bb) - [ux][ed-14300] Remove column width from table cells being pasted into another table as it should take the formatting of the destination table.
169
181
 
170
182
  ## 2.1.2
171
183
 
172
184
  ### Patch Changes
173
185
 
174
- - [`4e6fbaf5898`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e6fbaf5898) - ED-14117 Change EditorState.apply type to receive readonly transaction
186
+ - [#18526](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/18526) [`4e6fbaf5898`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e6fbaf5898) - ED-14117 Change EditorState.apply type to receive readonly transaction
175
187
 
176
188
  Transactions should not be mutated after being dispatched as it can lead to
177
189
  unexpected behaviour. This change patches the relevant types declared in
@@ -181,13 +193,13 @@
181
193
 
182
194
  ### Patch Changes
183
195
 
184
- - [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - ED-13025 Bump prosemirror-view 1.23.1 -> 1.23.2
196
+ - [#16752](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/16752) [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - ED-13025 Bump prosemirror-view 1.23.1 -> 1.23.2
185
197
 
186
198
  ## 2.1.0
187
199
 
188
200
  ### Minor Changes
189
201
 
190
- - [`b230f366971`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b230f366971) - [ED-14008] Bump prosemirror-view from 1.20.2 to 1.23.1
202
+ - [#15998](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/15998) [`b230f366971`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b230f366971) - [ED-14008] Bump prosemirror-view from 1.20.2 to 1.23.1
191
203
 
192
204
  ### Patch Changes
193
205
 
@@ -203,52 +215,52 @@
203
215
 
204
216
  ### Patch Changes
205
217
 
206
- - [`96c6146eef1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/96c6146eef1) - ED-13187: localId optional & empty values filtered
218
+ - [#13302](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/13302) [`96c6146eef1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/96c6146eef1) - ED-13187: localId optional & empty values filtered
207
219
 
208
220
  ## 2.0.0
209
221
 
210
222
  ### Major Changes
211
223
 
212
- - [`71318e96b5d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/71318e96b5d) - NO-ISSUE Force bump editor-tables
224
+ - [#9847](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/9847) [`71318e96b5d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/71318e96b5d) - NO-ISSUE Force bump editor-tables
213
225
 
214
226
  ## 1.1.5
215
227
 
216
228
  ### Patch Changes
217
229
 
218
- - [`5089bd2544d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5089bd2544d) - ED-11919: generate localId for tables
230
+ - [#9510](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/9510) [`5089bd2544d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5089bd2544d) - ED-11919: generate localId for tables
219
231
  - [`58b170725be`](https://bitbucket.org/atlassian/atlassian-frontend/commits/58b170725be) - Renamed @atlaskit/editor-test-helpers/schema-builder to @atlaskit/editor-test-helpers/doc-builder
220
232
 
221
233
  ## 1.1.4
222
234
 
223
235
  ### Patch Changes
224
236
 
225
- - [`d2e70ebaaa9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d2e70ebaaa9) - NO-ISSUE: updated editor tests to use 'doc: DocBuilder' instead of 'doc: any'
237
+ - [#9083](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/9083) [`d2e70ebaaa9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d2e70ebaaa9) - NO-ISSUE: updated editor tests to use 'doc: DocBuilder' instead of 'doc: any'
226
238
  - [`fe1c96a3d28`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fe1c96a3d28) - added DocBuilder type to @atlaskit/editor-test-helpers, replaced duplicate definitions and DocumentType
227
239
 
228
240
  ## 1.1.3
229
241
 
230
242
  ### Patch Changes
231
243
 
232
- - [`d3265f19be`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d3265f19be) - Transpile packages using babel rather than tsc
244
+ - [#5857](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5857) [`d3265f19be`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d3265f19be) - Transpile packages using babel rather than tsc
233
245
 
234
246
  ## 1.1.2
235
247
 
236
248
  ### Patch Changes
237
249
 
238
- - [`703752d487`](https://bitbucket.org/atlassian/atlassian-frontend/commits/703752d487) - ED-10647 Remove caret from prosemirror-model, prosemirror-keymap, prosemirror-state, prosemirror-transform to lock them down to an explicit version
250
+ - [#5860](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5860) [`703752d487`](https://bitbucket.org/atlassian/atlassian-frontend/commits/703752d487) - ED-10647 Remove caret from prosemirror-model, prosemirror-keymap, prosemirror-state, prosemirror-transform to lock them down to an explicit version
239
251
 
240
252
  ## 1.1.1
241
253
 
242
254
  ### Patch Changes
243
255
 
244
- - [`e4abda244e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e4abda244e) - ED-9912: replace prosemirror-tables with editor-tables
256
+ - [#5516](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5516) [`e4abda244e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e4abda244e) - ED-9912: replace prosemirror-tables with editor-tables
245
257
  - [`d39fa49905`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d39fa49905) - ED-10420: remove utils copied from prosemirror-utils
246
258
 
247
259
  ## 1.1.0
248
260
 
249
261
  ### Minor Changes
250
262
 
251
- - [`111eac563c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/111eac563c) - ED-9915: added table utils from prosemirror-utils
263
+ - [#4749](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/4749) [`111eac563c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/111eac563c) - ED-9915: added table utils from prosemirror-utils
252
264
  - [`9a39500244`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9a39500244) - Bump ProseMirror packages
253
265
 
254
266
  Read more: https://product-fabric.atlassian.net/wiki/spaces/E/pages/1671956531/2020-08
@@ -266,7 +278,7 @@
266
278
 
267
279
  ### Patch Changes
268
280
 
269
- - [`e485167c47`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e485167c47) - ED-10018: bump prosemirror-tables to fix copy-pasting merged rows
281
+ - [#4424](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/4424) [`e485167c47`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e485167c47) - ED-10018: bump prosemirror-tables to fix copy-pasting merged rows
270
282
  - [`7325aff6d3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7325aff6d3) - ED-9626: added unit tests for CellSelection and tableEditing plugin to editor-tables
271
283
  - Updated dependencies
272
284
 
@@ -274,7 +286,7 @@
274
286
 
275
287
  ### Patch Changes
276
288
 
277
- - [`6c525a8229`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6c525a8229) - Upgraded to TypeScript 3.9.6 and tslib to 2.0.0
289
+ - [#3885](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/3885) [`6c525a8229`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6c525a8229) - Upgraded to TypeScript 3.9.6 and tslib to 2.0.0
278
290
 
279
291
  Since tslib is a dependency for all our packages we recommend that products also follow this tslib upgrade
280
292
  to prevent duplicates of tslib being bundled.
@@ -283,4 +295,4 @@
283
295
 
284
296
  ### Major Changes
285
297
 
286
- - [`b00bfbe3f3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b00bfbe3f3) - ED-9627 Added new @atlaskit/editor-tables package to include common editor tables related code. Included TableMap class from prosemirror-tables package with it.
298
+ - [#3428](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/3428) [`b00bfbe3f3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b00bfbe3f3) - ED-9627 Added new @atlaskit/editor-tables package to include common editor tables related code. Included TableMap class from prosemirror-tables package with it.
@@ -9,7 +9,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
10
  var _state = require("@atlaskit/editor-prosemirror/state");
11
11
  var _tables = require("./utils/tables");
12
- var CellBookmark = /*#__PURE__*/function () {
12
+ var CellBookmark = exports.CellBookmark = /*#__PURE__*/function () {
13
13
  function CellBookmark(anchor, head) {
14
14
  (0, _classCallCheck2.default)(this, CellBookmark);
15
15
  this.anchor = anchor;
@@ -37,5 +37,4 @@ var CellBookmark = /*#__PURE__*/function () {
37
37
  }
38
38
  }]);
39
39
  return CellBookmark;
40
- }();
41
- exports.CellBookmark = CellBookmark;
40
+ }();
@@ -32,7 +32,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
32
32
  // With the plugin enabled, these will be created when the user
33
33
  // selects across cells, and will be drawn by giving selected cells a
34
34
  // `selectedCell` CSS class.
35
- var CellSelection = /*#__PURE__*/function (_Selection) {
35
+ var CellSelection = exports.CellSelection = /*#__PURE__*/function (_Selection) {
36
36
  (0, _inherits2.default)(CellSelection, _Selection);
37
37
  var _super = _createSuper(CellSelection);
38
38
  // :: (ResolvedPos, ?ResolvedPos)
@@ -337,5 +337,4 @@ var CellSelection = /*#__PURE__*/function (_Selection) {
337
337
  }]);
338
338
  return CellSelection;
339
339
  }(_state.Selection);
340
- exports.CellSelection = CellSelection;
341
340
  _state.Selection.jsonID('cell', CellSelection);
@@ -17,7 +17,7 @@ var _pluginKey = require("./plugin-key");
17
17
  // This file defines a number of helpers for wiring up user input to
18
18
  // table-related functionality.
19
19
 
20
- var handleKeyDown = (0, _keymap.keydownHandler)({
20
+ var handleKeyDown = exports.handleKeyDown = (0, _keymap.keydownHandler)({
21
21
  ArrowLeft: arrow('horiz', -1),
22
22
  ArrowRight: arrow('horiz', 1),
23
23
  ArrowUp: arrow('vert', -1),
@@ -31,7 +31,6 @@ var handleKeyDown = (0, _keymap.keydownHandler)({
31
31
  Delete: deleteCellSelection,
32
32
  'Mod-Delete': deleteCellSelection
33
33
  });
34
- exports.handleKeyDown = handleKeyDown;
35
34
  function maybeSetSelection(state, dispatch, selection) {
36
35
  if (selection.eq(state.selection)) {
37
36
  return false;
@@ -88,7 +87,7 @@ function shiftArrow(axis, dir) {
88
87
  var maybeTableCell = _$head.blockRange($anchor);
89
88
 
90
89
  // Make sure the selection is coming from the same cell
91
- var sameCell = ['tableCell', 'tableHeader'].includes((maybeTableCell === null || maybeTableCell === void 0 ? void 0 : (_maybeTableCell$paren = maybeTableCell.parent) === null || _maybeTableCell$paren === void 0 ? void 0 : _maybeTableCell$paren.type.name) || '');
90
+ var sameCell = ['tableCell', 'tableHeader'].includes((maybeTableCell === null || maybeTableCell === void 0 || (_maybeTableCell$paren = maybeTableCell.parent) === null || _maybeTableCell$paren === void 0 ? void 0 : _maybeTableCell$paren.type.name) || '');
92
91
  if (!sameCell) {
93
92
  return false;
94
93
  }
@@ -5,7 +5,5 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.tableEditingKey = exports.fixTablesKey = void 0;
7
7
  var _state = require("@atlaskit/editor-prosemirror/state");
8
- var tableEditingKey = new _state.PluginKey('selectingCells');
9
- exports.tableEditingKey = tableEditingKey;
10
- var fixTablesKey = new _state.PluginKey('fix-tables');
11
- exports.fixTablesKey = fixTablesKey;
8
+ var tableEditingKey = exports.tableEditingKey = new _state.PluginKey('selectingCells');
9
+ var fixTablesKey = exports.fixTablesKey = new _state.PluginKey('fix-tables');
@@ -48,34 +48,31 @@ if (typeof WeakMap !== 'undefined') {
48
48
  return _cache[cachePos++] = value;
49
49
  };
50
50
  }
51
- var Rect = /*#__PURE__*/(0, _createClass2.default)(function Rect(left, top, right, bottom) {
51
+ var Rect = exports.Rect = /*#__PURE__*/(0, _createClass2.default)(function Rect(left, top, right, bottom) {
52
52
  (0, _classCallCheck2.default)(this, Rect);
53
53
  this.left = left;
54
54
  this.top = top;
55
55
  this.right = right;
56
56
  this.bottom = bottom;
57
57
  });
58
- exports.Rect = Rect;
59
- var TableProblemTypes = /*#__PURE__*/function (TableProblemTypes) {
58
+ var TableProblemTypes = exports.TableProblemTypes = /*#__PURE__*/function (TableProblemTypes) {
60
59
  TableProblemTypes["COLLISION"] = "collision";
61
60
  TableProblemTypes["OVERLONG_ROWSPAN"] = "overlong_rowspan";
62
61
  TableProblemTypes["MISSING"] = "missing";
63
62
  TableProblemTypes["COLWIDTH_MISMATCH"] = "colwidth mismatch";
64
63
  return TableProblemTypes;
65
64
  }({});
66
- exports.TableProblemTypes = TableProblemTypes;
67
65
  // Ideally tableNewColumnMinWidth should be imported
68
66
  // from '@atlaskit/editor-common/styles';
69
67
  // We don't want to introduce a new dependency.
70
68
  // Thus we define the constant here.
71
- var tableNewColumnMinWidth = 140;
69
+ var tableNewColumnMinWidth = exports.tableNewColumnMinWidth = 140;
72
70
 
73
71
  // ::- A table map describes the structore of a given table. To avoid
74
72
  // recomputing them all the time, they are cached per table node. To
75
73
  // be able to do that, positions saved in the map are relative to the
76
74
  // start of the table, rather than the start of the document.
77
- exports.tableNewColumnMinWidth = tableNewColumnMinWidth;
78
- var TableMap = /*#__PURE__*/function () {
75
+ var TableMap = exports.TableMap = /*#__PURE__*/function () {
79
76
  // The width of the table
80
77
 
81
78
  // The table's height
@@ -256,7 +253,6 @@ var TableMap = /*#__PURE__*/function () {
256
253
  }]);
257
254
  return TableMap;
258
255
  }(); // Compute a table map.
259
- exports.TableMap = TableMap;
260
256
  function computeMap(table) {
261
257
  if (table.type.spec.tableRole !== 'table') {
262
258
  throw new RangeError('Not a table node: ' + table.type.name);
@@ -9,7 +9,7 @@ var _addColumn = require("./add-column");
9
9
  var _cloneTr = require("./clone-tr");
10
10
  var _find = require("./find");
11
11
  // Returns a new transaction that adds a new column at index `columnIndex`.
12
- var addColumnAt = function addColumnAt(columnIndex) {
12
+ var addColumnAt = exports.addColumnAt = function addColumnAt(columnIndex) {
13
13
  return function (tr) {
14
14
  var table = (0, _find.findTable)(tr.selection);
15
15
  if (table) {
@@ -24,5 +24,4 @@ var addColumnAt = function addColumnAt(columnIndex) {
24
24
  }
25
25
  return tr;
26
26
  };
27
- };
28
- exports.addColumnAt = addColumnAt;
27
+ };
@@ -30,7 +30,7 @@ var filterCellsInRow = function filterCellsInRow(rowIndex, predicate) {
30
30
  };
31
31
 
32
32
  // Returns a new transaction that adds a new row after `cloneRowIndex`, cloning the row attributes at `cloneRowIndex`.
33
- var cloneRowAt = function cloneRowAt(rowIndex) {
33
+ var cloneRowAt = exports.cloneRowAt = function cloneRowAt(rowIndex) {
34
34
  return function (tr) {
35
35
  var table = (0, _find.findTable)(tr.selection);
36
36
  if (table) {
@@ -88,8 +88,7 @@ var cloneRowAt = function cloneRowAt(rowIndex) {
88
88
  };
89
89
 
90
90
  // Returns a new transaction that adds a new row at index `rowIndex`. Optionally clone the previous row.
91
- exports.cloneRowAt = cloneRowAt;
92
- var addRowAt = function addRowAt(rowIndex, clonePreviousRow) {
91
+ var addRowAt = exports.addRowAt = function addRowAt(rowIndex, clonePreviousRow) {
93
92
  return function (tr) {
94
93
  var table = (0, _find.findTable)(tr.selection);
95
94
  if (table) {
@@ -108,5 +107,4 @@ var addRowAt = function addRowAt(rowIndex, clonePreviousRow) {
108
107
  }
109
108
  return tr;
110
109
  };
111
- };
112
- exports.addRowAt = addRowAt;
110
+ };
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.cloneTr = void 0;
7
7
  // Creates a new transaction object from a given transaction
8
- var cloneTr = function cloneTr(tr) {
8
+ var cloneTr = exports.cloneTr = function cloneTr(tr) {
9
9
  return Object.assign(Object.create(tr), tr).setTime(Date.now());
10
- };
11
- exports.cloneTr = cloneTr;
10
+ };
@@ -17,7 +17,7 @@ var createCell = function createCell(cellType, cellContent) {
17
17
  // Returns a table node of a given size.
18
18
  // `withHeaderRow` defines whether the first row of the table will be a header row.
19
19
  // `cellContent` defines the content of each cell.
20
- var createTable = function createTable(_ref) {
20
+ var createTable = exports.createTable = function createTable(_ref) {
21
21
  var schema = _ref.schema,
22
22
  _ref$rowsCount = _ref.rowsCount,
23
23
  rowsCount = _ref$rowsCount === void 0 ? 3 : _ref$rowsCount,
@@ -58,5 +58,4 @@ var createTable = function createTable(_ref) {
58
58
  return table.createChecked({
59
59
  localId: _uuid.uuid.generate()
60
60
  }, rows);
61
- };
62
- exports.createTable = createTable;
61
+ };
@@ -7,7 +7,7 @@ exports.emptyCell = void 0;
7
7
  var _cloneTr = require("./clone-tr");
8
8
  var _tableNodeTypes = require("./table-node-types");
9
9
  // Returns a new transaction that clears the content of a given `cell`.
10
- var emptyCell = function emptyCell(cell, schema) {
10
+ var emptyCell = exports.emptyCell = function emptyCell(cell, schema) {
11
11
  return function (tr) {
12
12
  if (cell) {
13
13
  var node = (0, _tableNodeTypes.tableNodeTypes)(schema).cell.createAndFill();
@@ -18,5 +18,4 @@ var emptyCell = function emptyCell(cell, schema) {
18
18
  }
19
19
  return tr;
20
20
  };
21
- };
22
- exports.emptyCell = emptyCell;
21
+ };
@@ -7,15 +7,14 @@ exports.findTableClosestToPos = exports.findTable = exports.findCellRectClosestT
7
7
  var _utils = require("@atlaskit/editor-prosemirror/utils");
8
8
  var _tableMap = require("../table-map");
9
9
  // Iterates over parent nodes, returning the closest table node.
10
- var findTable = function findTable(selection) {
10
+ var findTable = exports.findTable = function findTable(selection) {
11
11
  return (0, _utils.findParentNode)(function (node) {
12
12
  return node.type.spec.tableRole && node.type.spec.tableRole === 'table';
13
13
  })(selection);
14
14
  };
15
15
 
16
16
  // Iterates over parent nodes, returning a table node closest to a given `$pos`.
17
- exports.findTable = findTable;
18
- var findTableClosestToPos = function findTableClosestToPos($pos) {
17
+ var findTableClosestToPos = exports.findTableClosestToPos = function findTableClosestToPos($pos) {
19
18
  var predicate = function predicate(node) {
20
19
  return node.type.spec.tableRole && node.type.spec.tableRole === 'table';
21
20
  };
@@ -23,8 +22,7 @@ var findTableClosestToPos = function findTableClosestToPos($pos) {
23
22
  };
24
23
 
25
24
  // Iterates over parent nodes, returning a table cell or a table header node closest to a given `$pos`.
26
- exports.findTableClosestToPos = findTableClosestToPos;
27
- var findCellClosestToPos = function findCellClosestToPos($pos) {
25
+ var findCellClosestToPos = exports.findCellClosestToPos = function findCellClosestToPos($pos) {
28
26
  var predicate = function predicate(node) {
29
27
  return node.type.spec.tableRole && /cell/i.test(node.type.spec.tableRole);
30
28
  };
@@ -32,8 +30,7 @@ var findCellClosestToPos = function findCellClosestToPos($pos) {
32
30
  };
33
31
 
34
32
  // Returns the rectangle spanning a cell closest to a given `$pos`.
35
- exports.findCellClosestToPos = findCellClosestToPos;
36
- var findCellRectClosestToPos = function findCellRectClosestToPos($pos) {
33
+ var findCellRectClosestToPos = exports.findCellRectClosestToPos = function findCellRectClosestToPos($pos) {
37
34
  var cell = findCellClosestToPos($pos);
38
35
  if (cell) {
39
36
  var table = findTableClosestToPos($pos);
@@ -43,5 +40,4 @@ var findCellRectClosestToPos = function findCellRectClosestToPos($pos) {
43
40
  return map.rectBetween(cellPos, cellPos);
44
41
  }
45
42
  }
46
- };
47
- exports.findCellRectClosestToPos = findCellRectClosestToPos;
43
+ };
@@ -10,7 +10,7 @@ var _getCellsInColumn = require("./get-cells-in-column");
10
10
  var _getCellsInRow = require("./get-cells-in-row");
11
11
  // Returns a new transaction that maps a given `cellTransform` function to each cell in a column at a given `columnIndex`.
12
12
  // It will set the selection into the last cell of the column if `setCursorToLastCell` param is set to `true`.
13
- var forEachCellInColumn = function forEachCellInColumn(columnIndex, cellTransform, setCursorToLastCell) {
13
+ var forEachCellInColumn = exports.forEachCellInColumn = function forEachCellInColumn(columnIndex, cellTransform, setCursorToLastCell) {
14
14
  return function (tr) {
15
15
  var cells = (0, _getCellsInColumn.getCellsInColumn)(columnIndex)(tr.selection);
16
16
  if (cells) {
@@ -29,8 +29,7 @@ var forEachCellInColumn = function forEachCellInColumn(columnIndex, cellTransfor
29
29
 
30
30
  // Returns a new transaction that maps a given `cellTransform` function to each cell in a row at a given `rowIndex`.
31
31
  // It will set the selection into the last cell of the row if `setCursorToLastCell` param is set to `true`.
32
- exports.forEachCellInColumn = forEachCellInColumn;
33
- var forEachCellInRow = function forEachCellInRow(rowIndex, cellTransform, setCursorToLastCell) {
32
+ var forEachCellInRow = exports.forEachCellInRow = function forEachCellInRow(rowIndex, cellTransform, setCursorToLastCell) {
34
33
  return function (tr) {
35
34
  var cells = (0, _getCellsInRow.getCellsInRow)(rowIndex)(tr.selection);
36
35
  if (cells) {
@@ -44,5 +43,4 @@ var forEachCellInRow = function forEachCellInRow(rowIndex, cellTransform, setCur
44
43
  }
45
44
  return tr;
46
45
  };
47
- };
48
- exports.forEachCellInRow = forEachCellInRow;
46
+ };
@@ -7,7 +7,7 @@ exports.getCellsInColumn = void 0;
7
7
  var _tableMap = require("../table-map");
8
8
  var _find = require("./find");
9
9
  // Returns an array of cells in a column(s), where `columnIndex` could be a column index or an array of column indexes.
10
- var getCellsInColumn = function getCellsInColumn(columnIndexes) {
10
+ var getCellsInColumn = exports.getCellsInColumn = function getCellsInColumn(columnIndexes) {
11
11
  return function (selection) {
12
12
  var table = (0, _find.findTable)(selection);
13
13
  if (!table) {
@@ -36,5 +36,4 @@ var getCellsInColumn = function getCellsInColumn(columnIndexes) {
36
36
  }));
37
37
  }, []);
38
38
  };
39
- };
40
- exports.getCellsInColumn = getCellsInColumn;
39
+ };
@@ -7,7 +7,7 @@ exports.getCellsInRow = void 0;
7
7
  var _tableMap = require("../table-map");
8
8
  var _find = require("./find");
9
9
  // Returns an array of cells in a row(s), where `rowIndex` could be a row index or an array of row indexes.
10
- var getCellsInRow = function getCellsInRow(rowIndex) {
10
+ var getCellsInRow = exports.getCellsInRow = function getCellsInRow(rowIndex) {
11
11
  return function (selection) {
12
12
  var table = (0, _find.findTable)(selection);
13
13
  if (!table) {
@@ -36,5 +36,4 @@ var getCellsInRow = function getCellsInRow(rowIndex) {
36
36
  }));
37
37
  }, []);
38
38
  };
39
- };
40
- exports.getCellsInRow = getCellsInRow;
39
+ };
@@ -7,7 +7,7 @@ exports.getCellsInTable = void 0;
7
7
  var _tableMap = require("../table-map");
8
8
  var _find = require("./find");
9
9
  // Returns an array of all cells in a table.
10
- var getCellsInTable = function getCellsInTable(selection) {
10
+ var getCellsInTable = exports.getCellsInTable = function getCellsInTable(selection) {
11
11
  var table = (0, _find.findTable)(selection);
12
12
  if (!table) {
13
13
  return;
@@ -33,5 +33,4 @@ var getCellsInTable = function getCellsInTable(selection) {
33
33
  }).filter(function (cell) {
34
34
  return typeof cell !== 'undefined';
35
35
  });
36
- };
37
- exports.getCellsInTable = getCellsInTable;
36
+ };
@@ -7,7 +7,7 @@ exports.getSelectionRangeInColumn = void 0;
7
7
  var _getCellsInColumn = require("./get-cells-in-column");
8
8
  var _getCellsInRow = require("./get-cells-in-row");
9
9
  // Returns a range of rectangular selection spanning all merged cells around a column at index `columnIndex`.
10
- var getSelectionRangeInColumn = function getSelectionRangeInColumn(columnIndex) {
10
+ var getSelectionRangeInColumn = exports.getSelectionRangeInColumn = function getSelectionRangeInColumn(columnIndex) {
11
11
  return function (tr) {
12
12
  var startIndex = columnIndex;
13
13
  var endIndex = columnIndex;
@@ -87,5 +87,4 @@ var getSelectionRangeInColumn = function getSelectionRangeInColumn(columnIndex)
87
87
  indexes: indexes
88
88
  };
89
89
  };
90
- };
91
- exports.getSelectionRangeInColumn = getSelectionRangeInColumn;
90
+ };
@@ -7,7 +7,7 @@ exports.getSelectionRangeInRow = void 0;
7
7
  var _getCellsInColumn = require("./get-cells-in-column");
8
8
  var _getCellsInRow = require("./get-cells-in-row");
9
9
  // Returns a range of rectangular selection spanning all merged cells around a row at index `rowIndex`.
10
- var getSelectionRangeInRow = function getSelectionRangeInRow(rowIndex) {
10
+ var getSelectionRangeInRow = exports.getSelectionRangeInRow = function getSelectionRangeInRow(rowIndex) {
11
11
  return function (tr) {
12
12
  var startIndex = rowIndex;
13
13
  var endIndex = rowIndex;
@@ -87,5 +87,4 @@ var getSelectionRangeInRow = function getSelectionRangeInRow(rowIndex) {
87
87
  indexes: indexes
88
88
  };
89
89
  };
90
- };
91
- exports.getSelectionRangeInRow = getSelectionRangeInRow;
90
+ };