@atlaskit/editor-plugin-table 0.2.0 → 0.2.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 +21 -0
- package/commands/package.json +1 -0
- package/dist/cjs/plugins/table/create-plugin-config.js +0 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/dom.js +3 -5
- package/dist/cjs/plugins/table/ui/common-styles.js +8 -1
- package/dist/cjs/plugins/table/ui/ui-styles.js +1 -1
- package/dist/cjs/plugins/table/utils/column-controls.js +1 -1
- package/dist/cjs/version.json +2 -1
- package/dist/es2019/plugins/table/create-plugin-config.js +0 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/dom.js +3 -8
- package/dist/es2019/plugins/table/ui/common-styles.js +16 -8
- package/dist/es2019/plugins/table/ui/ui-styles.js +1 -6
- package/dist/es2019/plugins/table/utils/column-controls.js +1 -1
- package/dist/es2019/version.json +2 -1
- package/dist/esm/plugins/table/create-plugin-config.js +0 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/dom.js +3 -8
- package/dist/esm/plugins/table/ui/common-styles.js +8 -1
- package/dist/esm/plugins/table/ui/ui-styles.js +2 -2
- package/dist/esm/plugins/table/utils/column-controls.js +1 -1
- package/dist/esm/version.json +2 -1
- package/dist/types/plugins/table/types.d.ts +0 -1
- package/package.json +2 -1
- package/plugin-key/package.json +1 -0
- package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +8 -0
- package/src/__tests__/visual-regression/__fixtures__/sticky-header-with-horizontal-scroll.json +5228 -0
- package/src/__tests__/visual-regression/__image_snapshots__/sticky-header-ts-snapshot-test-table-sticky-header-should-align-with-table-cell-when-active-1-snap.png +3 -0
- package/src/__tests__/visual-regression/__image_snapshots__/sticky-header-ts-snapshot-test-table-sticky-header-should-align-with-table-cell-when-active-2-snap.png +3 -0
- package/src/__tests__/visual-regression/cell-options-menu.ts +110 -99
- package/src/__tests__/visual-regression/index.ts +56 -44
- package/src/__tests__/visual-regression/sticky-header.ts +55 -0
- package/src/plugins/table/create-plugin-config.ts +0 -1
- package/src/plugins/table/pm-plugins/table-resizing/utils/dom.ts +5 -11
- package/src/plugins/table/types.ts +0 -1
- package/src/plugins/table/ui/common-styles.ts +16 -8
- package/src/plugins/table/ui/ui-styles.ts +0 -6
- package/src/plugins/table/utils/column-controls.ts +1 -1
- package/types/package.json +1 -0
- package/ui/common-styles/package.json +1 -0
- package/ui/consts/package.json +1 -0
|
@@ -134,28 +134,36 @@ describe('Floating Delete Button', () => {
|
|
|
134
134
|
expect(screen.getAllByLabelText('Delete row').length).toBe(1);
|
|
135
135
|
});
|
|
136
136
|
});
|
|
137
|
+
|
|
137
138
|
describe('when deleting with the delete button', () => {
|
|
138
139
|
describe('Columns', () => {
|
|
139
140
|
it('should move cursor within the table after delete', () => {
|
|
140
141
|
selectColumns([0, 1])(editorView.state, editorView.dispatch);
|
|
141
142
|
component({ selection: editorView.state.selection, editorView });
|
|
143
|
+
|
|
142
144
|
const { tr } = editorView.state;
|
|
143
145
|
const { pos } = getCellsInColumn(2)(tr.selection)![2];
|
|
144
146
|
const lastCellPos = tr.doc.resolve(pos).pos + 1;
|
|
147
|
+
|
|
145
148
|
fireEvent.click(screen.getByLabelText('Delete column'));
|
|
149
|
+
|
|
146
150
|
expect(editorView.state.selection.from).toBeLessThanOrEqual(
|
|
147
151
|
lastCellPos,
|
|
148
152
|
);
|
|
149
153
|
});
|
|
150
154
|
});
|
|
155
|
+
|
|
151
156
|
describe('Rows', () => {
|
|
152
157
|
it('should move cursor within the table after delete', () => {
|
|
153
158
|
selectRows([0, 1])(editorView.state, editorView.dispatch);
|
|
154
159
|
component({ selection: editorView.state.selection, editorView });
|
|
160
|
+
|
|
155
161
|
const { tr } = editorView.state;
|
|
156
162
|
const { pos } = getCellsInColumn(2)(tr.selection)![2];
|
|
157
163
|
const lastCellPos = tr.doc.resolve(pos).pos + 1;
|
|
164
|
+
|
|
158
165
|
fireEvent.click(screen.getByLabelText('Delete row'));
|
|
166
|
+
|
|
159
167
|
expect(editorView.state.selection.from).toBeLessThanOrEqual(
|
|
160
168
|
lastCellPos,
|
|
161
169
|
);
|