@atlaskit/editor-plugin-insert-block 0.3.1 → 0.3.3
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 +12 -0
- package/dist/cjs/ui/ToolbarInsertBlock/table-selector-popup-with-listeners.js +13 -3
- package/dist/es2019/ui/ToolbarInsertBlock/table-selector-popup-with-listeners.js +13 -3
- package/dist/esm/ui/ToolbarInsertBlock/table-selector-popup-with-listeners.js +13 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-insert-block
|
|
2
2
|
|
|
3
|
+
## 0.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#70300](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70300) [`9622d585a805`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9622d585a805) - [ux] decreased popup size when wrapping selection with arrowRight
|
|
8
|
+
|
|
9
|
+
## 0.3.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 0.3.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -136,7 +136,6 @@ var TableSelectorPopup = exports.TableSelectorPopup = function TableSelectorPopu
|
|
|
136
136
|
}
|
|
137
137
|
return prevSize.maxRow;
|
|
138
138
|
case 'ArrowUp':
|
|
139
|
-
// const moveToLastRow: boolean = prevSize.row === 1;
|
|
140
139
|
if (prevSize.row === 1) {
|
|
141
140
|
return DEFAULT_MAX_TABLE_SELECTOR_ROWS;
|
|
142
141
|
// Decrease the popup size when decreased row selection
|
|
@@ -144,6 +143,18 @@ var TableSelectorPopup = exports.TableSelectorPopup = function TableSelectorPopu
|
|
|
144
143
|
return prevSize.row;
|
|
145
144
|
}
|
|
146
145
|
return prevSize.maxRow;
|
|
146
|
+
case 'ArrowRight':
|
|
147
|
+
var moveToNextRow = prevSize.col === DEFAULT_TABLE_SELECTOR_COLS;
|
|
148
|
+
var increaseMaxRow = prevSize.maxRow < DEFAULT_MAX_TABLE_SELECTOR_ROWS && moveToNextRow && prevSize.row + 1 === prevSize.maxRow;
|
|
149
|
+
|
|
150
|
+
// Decrease popup size for wrap around to selection 1 x 1
|
|
151
|
+
if (prevSize.row === DEFAULT_MAX_TABLE_SELECTOR_ROWS && prevSize.col === DEFAULT_TABLE_SELECTOR_COLS) {
|
|
152
|
+
return DEFAULT_TABLE_SELECTOR_ROWS;
|
|
153
|
+
// Decrease the popup size when decreased row selection
|
|
154
|
+
} else if (increaseMaxRow) {
|
|
155
|
+
return prevSize.row + 1;
|
|
156
|
+
}
|
|
157
|
+
return prevSize.maxRow;
|
|
147
158
|
default:
|
|
148
159
|
return prevSize.maxRow;
|
|
149
160
|
}
|
|
@@ -168,11 +179,10 @@ var TableSelectorPopup = exports.TableSelectorPopup = function TableSelectorPopu
|
|
|
168
179
|
enableKeyboardMode();
|
|
169
180
|
setSize(function (prevSize) {
|
|
170
181
|
var moveToNextRow = prevSize.col === DEFAULT_TABLE_SELECTOR_COLS;
|
|
171
|
-
var increaseMaxRow = prevSize.maxRow < DEFAULT_MAX_TABLE_SELECTOR_ROWS && moveToNextRow && prevSize.row + 1 === prevSize.maxRow;
|
|
172
182
|
return _objectSpread(_objectSpread({}, prevSize), {}, {
|
|
173
183
|
col: prevSize.col % DEFAULT_TABLE_SELECTOR_COLS + 1,
|
|
174
184
|
row: moveToNextRow ? prevSize.row % prevSize.maxRow + 1 : prevSize.row,
|
|
175
|
-
maxRow:
|
|
185
|
+
maxRow: getMaxRow(prevSize, event.key)
|
|
176
186
|
});
|
|
177
187
|
});
|
|
178
188
|
}
|
|
@@ -122,7 +122,6 @@ export const TableSelectorPopup = props => {
|
|
|
122
122
|
}
|
|
123
123
|
return prevSize.maxRow;
|
|
124
124
|
case 'ArrowUp':
|
|
125
|
-
// const moveToLastRow: boolean = prevSize.row === 1;
|
|
126
125
|
if (prevSize.row === 1) {
|
|
127
126
|
return DEFAULT_MAX_TABLE_SELECTOR_ROWS;
|
|
128
127
|
// Decrease the popup size when decreased row selection
|
|
@@ -130,6 +129,18 @@ export const TableSelectorPopup = props => {
|
|
|
130
129
|
return prevSize.row;
|
|
131
130
|
}
|
|
132
131
|
return prevSize.maxRow;
|
|
132
|
+
case 'ArrowRight':
|
|
133
|
+
const moveToNextRow = prevSize.col === DEFAULT_TABLE_SELECTOR_COLS;
|
|
134
|
+
const increaseMaxRow = prevSize.maxRow < DEFAULT_MAX_TABLE_SELECTOR_ROWS && moveToNextRow && prevSize.row + 1 === prevSize.maxRow;
|
|
135
|
+
|
|
136
|
+
// Decrease popup size for wrap around to selection 1 x 1
|
|
137
|
+
if (prevSize.row === DEFAULT_MAX_TABLE_SELECTOR_ROWS && prevSize.col === DEFAULT_TABLE_SELECTOR_COLS) {
|
|
138
|
+
return DEFAULT_TABLE_SELECTOR_ROWS;
|
|
139
|
+
// Decrease the popup size when decreased row selection
|
|
140
|
+
} else if (increaseMaxRow) {
|
|
141
|
+
return prevSize.row + 1;
|
|
142
|
+
}
|
|
143
|
+
return prevSize.maxRow;
|
|
133
144
|
default:
|
|
134
145
|
return prevSize.maxRow;
|
|
135
146
|
}
|
|
@@ -155,12 +166,11 @@ export const TableSelectorPopup = props => {
|
|
|
155
166
|
enableKeyboardMode();
|
|
156
167
|
setSize(prevSize => {
|
|
157
168
|
const moveToNextRow = prevSize.col === DEFAULT_TABLE_SELECTOR_COLS;
|
|
158
|
-
const increaseMaxRow = prevSize.maxRow < DEFAULT_MAX_TABLE_SELECTOR_ROWS && moveToNextRow && prevSize.row + 1 === prevSize.maxRow;
|
|
159
169
|
return {
|
|
160
170
|
...prevSize,
|
|
161
171
|
col: prevSize.col % DEFAULT_TABLE_SELECTOR_COLS + 1,
|
|
162
172
|
row: moveToNextRow ? prevSize.row % prevSize.maxRow + 1 : prevSize.row,
|
|
163
|
-
maxRow:
|
|
173
|
+
maxRow: getMaxRow(prevSize, event.key)
|
|
164
174
|
};
|
|
165
175
|
});
|
|
166
176
|
}
|
|
@@ -128,7 +128,6 @@ export var TableSelectorPopup = function TableSelectorPopup(props) {
|
|
|
128
128
|
}
|
|
129
129
|
return prevSize.maxRow;
|
|
130
130
|
case 'ArrowUp':
|
|
131
|
-
// const moveToLastRow: boolean = prevSize.row === 1;
|
|
132
131
|
if (prevSize.row === 1) {
|
|
133
132
|
return DEFAULT_MAX_TABLE_SELECTOR_ROWS;
|
|
134
133
|
// Decrease the popup size when decreased row selection
|
|
@@ -136,6 +135,18 @@ export var TableSelectorPopup = function TableSelectorPopup(props) {
|
|
|
136
135
|
return prevSize.row;
|
|
137
136
|
}
|
|
138
137
|
return prevSize.maxRow;
|
|
138
|
+
case 'ArrowRight':
|
|
139
|
+
var moveToNextRow = prevSize.col === DEFAULT_TABLE_SELECTOR_COLS;
|
|
140
|
+
var increaseMaxRow = prevSize.maxRow < DEFAULT_MAX_TABLE_SELECTOR_ROWS && moveToNextRow && prevSize.row + 1 === prevSize.maxRow;
|
|
141
|
+
|
|
142
|
+
// Decrease popup size for wrap around to selection 1 x 1
|
|
143
|
+
if (prevSize.row === DEFAULT_MAX_TABLE_SELECTOR_ROWS && prevSize.col === DEFAULT_TABLE_SELECTOR_COLS) {
|
|
144
|
+
return DEFAULT_TABLE_SELECTOR_ROWS;
|
|
145
|
+
// Decrease the popup size when decreased row selection
|
|
146
|
+
} else if (increaseMaxRow) {
|
|
147
|
+
return prevSize.row + 1;
|
|
148
|
+
}
|
|
149
|
+
return prevSize.maxRow;
|
|
139
150
|
default:
|
|
140
151
|
return prevSize.maxRow;
|
|
141
152
|
}
|
|
@@ -160,11 +171,10 @@ export var TableSelectorPopup = function TableSelectorPopup(props) {
|
|
|
160
171
|
enableKeyboardMode();
|
|
161
172
|
setSize(function (prevSize) {
|
|
162
173
|
var moveToNextRow = prevSize.col === DEFAULT_TABLE_SELECTOR_COLS;
|
|
163
|
-
var increaseMaxRow = prevSize.maxRow < DEFAULT_MAX_TABLE_SELECTOR_ROWS && moveToNextRow && prevSize.row + 1 === prevSize.maxRow;
|
|
164
174
|
return _objectSpread(_objectSpread({}, prevSize), {}, {
|
|
165
175
|
col: prevSize.col % DEFAULT_TABLE_SELECTOR_COLS + 1,
|
|
166
176
|
row: moveToNextRow ? prevSize.row % prevSize.maxRow + 1 : prevSize.row,
|
|
167
|
-
maxRow:
|
|
177
|
+
maxRow: getMaxRow(prevSize, event.key)
|
|
168
178
|
});
|
|
169
179
|
});
|
|
170
180
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@atlaskit/editor-plugin-date": "^0.3.0",
|
|
41
41
|
"@atlaskit/editor-plugin-emoji": "^1.1.0",
|
|
42
42
|
"@atlaskit/editor-plugin-expand": "^0.4.0",
|
|
43
|
-
"@atlaskit/editor-plugin-extension": "^0.
|
|
43
|
+
"@atlaskit/editor-plugin-extension": "^0.7.0",
|
|
44
44
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
45
45
|
"@atlaskit/editor-plugin-hyperlink": "^0.8.0",
|
|
46
46
|
"@atlaskit/editor-plugin-image-upload": "^0.2.0",
|