@atlaskit/editor-plugin-table 6.1.1 → 7.0.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 +12 -0
- package/dist/cjs/commands/insert.js +13 -0
- package/dist/cjs/toolbar.js +1 -0
- package/dist/es2019/commands/insert.js +14 -1
- package/dist/es2019/toolbar.js +1 -0
- package/dist/esm/commands/insert.js +14 -1
- package/dist/esm/toolbar.js +1 -0
- package/dist/types/commands/insert.d.ts +1 -1
- package/dist/types/plugin.d.ts +1 -1
- package/dist/types-ts4.5/commands/insert.d.ts +1 -1
- package/dist/types-ts4.5/plugin.d.ts +1 -1
- package/package.json +1 -1
- package/src/commands/insert.ts +21 -5
- package/src/plugin.tsx +1 -4
- package/src/toolbar.tsx +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#67948](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67948) [`28fcdf6793a4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/28fcdf6793a4) - Expand/collapse for panel and table color pickers
|
|
8
|
+
|
|
9
|
+
## 7.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- [#67703](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67703) [`d5303cb0f0cb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d5303cb0f0cb) - When a table is inserted via the table selector popup, an analytics event should be sent with the totalRowCount and totalColumnCount and the input method picker. Removed ASCII and TYPEAHEAD inputMethod from table selector command.
|
|
14
|
+
|
|
3
15
|
## 6.1.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -166,6 +166,19 @@ var insertTableWithSize = exports.insertTableWithSize = function insertTableWith
|
|
|
166
166
|
colsCount: colsCount
|
|
167
167
|
});
|
|
168
168
|
var newTr = (0, _utils.safeInsert)(tableNode)(tr).scrollIntoView();
|
|
169
|
+
if (inputMethod) {
|
|
170
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
171
|
+
action: _analytics.ACTION.INSERTED,
|
|
172
|
+
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
173
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.TABLE,
|
|
174
|
+
attributes: {
|
|
175
|
+
inputMethod: inputMethod,
|
|
176
|
+
totalRowCount: rowsCount,
|
|
177
|
+
totalColumnCount: colsCount
|
|
178
|
+
},
|
|
179
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
180
|
+
})(newTr);
|
|
181
|
+
}
|
|
169
182
|
return newTr;
|
|
170
183
|
};
|
|
171
184
|
};
|
package/dist/cjs/toolbar.js
CHANGED
|
@@ -485,6 +485,7 @@ var getColorPicker = function getColorPicker(state, menu, _ref5, editorAnalytics
|
|
|
485
485
|
id: 'editor.table.colorPicker',
|
|
486
486
|
title: formatMessage(_messages.tableMessages.cellBackground),
|
|
487
487
|
type: 'select',
|
|
488
|
+
isAriaExpanded: true,
|
|
488
489
|
selectType: 'color',
|
|
489
490
|
defaultValue: defaultPalette,
|
|
490
491
|
options: _uiColor.cellBackgroundColorPalette,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// #region Imports
|
|
2
2
|
import { AddColumnStep } from '@atlaskit/custom-steps';
|
|
3
|
-
import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
@@ -145,6 +145,19 @@ export const insertTableWithSize = editorAnalyticsAPI => (rowsCount, colsCount,
|
|
|
145
145
|
colsCount: colsCount
|
|
146
146
|
});
|
|
147
147
|
const newTr = safeInsert(tableNode)(tr).scrollIntoView();
|
|
148
|
+
if (inputMethod) {
|
|
149
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
|
|
150
|
+
action: ACTION.INSERTED,
|
|
151
|
+
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
152
|
+
actionSubjectId: ACTION_SUBJECT_ID.TABLE,
|
|
153
|
+
attributes: {
|
|
154
|
+
inputMethod: inputMethod,
|
|
155
|
+
totalRowCount: rowsCount,
|
|
156
|
+
totalColumnCount: colsCount
|
|
157
|
+
},
|
|
158
|
+
eventType: EVENT_TYPE.TRACK
|
|
159
|
+
})(newTr);
|
|
160
|
+
}
|
|
148
161
|
return newTr;
|
|
149
162
|
};
|
|
150
163
|
};
|
package/dist/es2019/toolbar.js
CHANGED
|
@@ -462,6 +462,7 @@ const getColorPicker = (state, menu, {
|
|
|
462
462
|
id: 'editor.table.colorPicker',
|
|
463
463
|
title: formatMessage(messages.cellBackground),
|
|
464
464
|
type: 'select',
|
|
465
|
+
isAriaExpanded: true,
|
|
465
466
|
selectType: 'color',
|
|
466
467
|
defaultValue: defaultPalette,
|
|
467
468
|
options: cellBackgroundColorPalette,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// #region Imports
|
|
2
2
|
import { AddColumnStep } from '@atlaskit/custom-steps';
|
|
3
|
-
import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
@@ -157,6 +157,19 @@ export var insertTableWithSize = function insertTableWithSize(editorAnalyticsAPI
|
|
|
157
157
|
colsCount: colsCount
|
|
158
158
|
});
|
|
159
159
|
var newTr = safeInsert(tableNode)(tr).scrollIntoView();
|
|
160
|
+
if (inputMethod) {
|
|
161
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
162
|
+
action: ACTION.INSERTED,
|
|
163
|
+
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
164
|
+
actionSubjectId: ACTION_SUBJECT_ID.TABLE,
|
|
165
|
+
attributes: {
|
|
166
|
+
inputMethod: inputMethod,
|
|
167
|
+
totalRowCount: rowsCount,
|
|
168
|
+
totalColumnCount: colsCount
|
|
169
|
+
},
|
|
170
|
+
eventType: EVENT_TYPE.TRACK
|
|
171
|
+
})(newTr);
|
|
172
|
+
}
|
|
160
173
|
return newTr;
|
|
161
174
|
};
|
|
162
175
|
};
|
package/dist/esm/toolbar.js
CHANGED
|
@@ -474,6 +474,7 @@ var getColorPicker = function getColorPicker(state, menu, _ref5, editorAnalytics
|
|
|
474
474
|
id: 'editor.table.colorPicker',
|
|
475
475
|
title: formatMessage(messages.cellBackground),
|
|
476
476
|
type: 'select',
|
|
477
|
+
isAriaExpanded: true,
|
|
477
478
|
selectType: 'color',
|
|
478
479
|
defaultValue: defaultPalette,
|
|
479
480
|
options: cellBackgroundColorPalette,
|
|
@@ -8,4 +8,4 @@ export declare const addColumnAfter: (getEditorContainerWidth: GetEditorContaine
|
|
|
8
8
|
export declare const insertColumn: (getEditorContainerWidth: GetEditorContainerWidth) => (column: number) => Command;
|
|
9
9
|
export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean) => Command;
|
|
10
10
|
export declare const createTable: () => Command;
|
|
11
|
-
export declare const insertTableWithSize: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER
|
|
11
|
+
export declare const insertTableWithSize: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export type TablePlugin = NextEditorPlugin<'table', {
|
|
|
24
24
|
insertTable: InsertTableAction;
|
|
25
25
|
};
|
|
26
26
|
commands: {
|
|
27
|
-
insertTableWithSize: (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER
|
|
27
|
+
insertTableWithSize: (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
|
|
28
28
|
};
|
|
29
29
|
dependencies: [
|
|
30
30
|
AnalyticsPlugin,
|
|
@@ -8,4 +8,4 @@ export declare const addColumnAfter: (getEditorContainerWidth: GetEditorContaine
|
|
|
8
8
|
export declare const insertColumn: (getEditorContainerWidth: GetEditorContainerWidth) => (column: number) => Command;
|
|
9
9
|
export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean) => Command;
|
|
10
10
|
export declare const createTable: () => Command;
|
|
11
|
-
export declare const insertTableWithSize: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER
|
|
11
|
+
export declare const insertTableWithSize: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
|
|
@@ -24,7 +24,7 @@ export type TablePlugin = NextEditorPlugin<'table', {
|
|
|
24
24
|
insertTable: InsertTableAction;
|
|
25
25
|
};
|
|
26
26
|
commands: {
|
|
27
|
-
insertTableWithSize: (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER
|
|
27
|
+
insertTableWithSize: (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
|
|
28
28
|
};
|
|
29
29
|
dependencies: [
|
|
30
30
|
AnalyticsPlugin,
|
package/package.json
CHANGED
package/src/commands/insert.ts
CHANGED
|
@@ -4,7 +4,13 @@ import type {
|
|
|
4
4
|
EditorAnalyticsAPI,
|
|
5
5
|
INPUT_METHOD,
|
|
6
6
|
} from '@atlaskit/editor-common/analytics';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
ACTION,
|
|
9
|
+
ACTION_SUBJECT,
|
|
10
|
+
ACTION_SUBJECT_ID,
|
|
11
|
+
EVENT_TYPE,
|
|
12
|
+
TABLE_OVERFLOW_CHANGE_TRIGGER,
|
|
13
|
+
} from '@atlaskit/editor-common/analytics';
|
|
8
14
|
import type {
|
|
9
15
|
Command,
|
|
10
16
|
EditorCommand,
|
|
@@ -210,10 +216,7 @@ export const insertTableWithSize =
|
|
|
210
216
|
(
|
|
211
217
|
rowsCount: number,
|
|
212
218
|
colsCount: number,
|
|
213
|
-
inputMethod?:
|
|
214
|
-
| INPUT_METHOD.PICKER
|
|
215
|
-
| INPUT_METHOD.ASCII
|
|
216
|
-
| INPUT_METHOD.TYPEAHEAD,
|
|
219
|
+
inputMethod?: INPUT_METHOD.PICKER,
|
|
217
220
|
): EditorCommand => {
|
|
218
221
|
return ({ tr }) => {
|
|
219
222
|
const tableNode = createTableNode({
|
|
@@ -222,6 +225,19 @@ export const insertTableWithSize =
|
|
|
222
225
|
colsCount: colsCount,
|
|
223
226
|
});
|
|
224
227
|
const newTr = safeInsert(tableNode)(tr).scrollIntoView();
|
|
228
|
+
if (inputMethod) {
|
|
229
|
+
editorAnalyticsAPI?.attachAnalyticsEvent({
|
|
230
|
+
action: ACTION.INSERTED,
|
|
231
|
+
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
232
|
+
actionSubjectId: ACTION_SUBJECT_ID.TABLE,
|
|
233
|
+
attributes: {
|
|
234
|
+
inputMethod: inputMethod,
|
|
235
|
+
totalRowCount: rowsCount,
|
|
236
|
+
totalColumnCount: colsCount,
|
|
237
|
+
},
|
|
238
|
+
eventType: EVENT_TYPE.TRACK,
|
|
239
|
+
})(newTr);
|
|
240
|
+
}
|
|
225
241
|
return newTr;
|
|
226
242
|
};
|
|
227
243
|
};
|
package/src/plugin.tsx
CHANGED
|
@@ -110,10 +110,7 @@ export type TablePlugin = NextEditorPlugin<
|
|
|
110
110
|
insertTableWithSize: (
|
|
111
111
|
rowsCount: number,
|
|
112
112
|
colsCount: number,
|
|
113
|
-
inputMethod?:
|
|
114
|
-
| INPUT_METHOD.PICKER
|
|
115
|
-
| INPUT_METHOD.ASCII
|
|
116
|
-
| INPUT_METHOD.TYPEAHEAD,
|
|
113
|
+
inputMethod?: INPUT_METHOD.PICKER,
|
|
117
114
|
) => EditorCommand;
|
|
118
115
|
};
|
|
119
116
|
dependencies: [
|
package/src/toolbar.tsx
CHANGED
|
@@ -727,6 +727,7 @@ const getColorPicker = (
|
|
|
727
727
|
id: 'editor.table.colorPicker',
|
|
728
728
|
title: formatMessage(messages.cellBackground),
|
|
729
729
|
type: 'select',
|
|
730
|
+
isAriaExpanded: true,
|
|
730
731
|
selectType: 'color',
|
|
731
732
|
defaultValue: defaultPalette,
|
|
732
733
|
options: cellBackgroundColorPalette,
|