@atlaskit/editor-plugin-table 10.11.4 → 10.11.6
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 +15 -0
- package/dist/cjs/nodeviews/ExternalDropTargets.js +1 -2
- package/dist/cjs/nodeviews/TableComponent.js +47 -47
- package/dist/cjs/nodeviews/TableContainer.js +1 -2
- package/dist/cjs/nodeviews/TableResizer.js +1 -2
- package/dist/cjs/nodeviews/table-node-views.js +34 -0
- package/dist/cjs/pm-plugins/commands/commands-with-analytics.js +14 -14
- package/dist/cjs/pm-plugins/main.js +5 -5
- package/dist/cjs/pm-plugins/view-mode-sort/index.js +10 -10
- package/dist/cjs/tablePlugin.js +57 -58
- package/dist/cjs/ui/DragHandle/index.js +1 -2
- package/dist/cjs/ui/FloatingContextualButton/FixedButton.js +1 -2
- package/dist/cjs/ui/FloatingContextualButton/index.js +1 -2
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +45 -46
- package/dist/cjs/ui/FloatingDeleteButton/index.js +1 -2
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +1 -2
- package/dist/cjs/ui/FloatingDragMenu/DropdownMenu.js +1 -2
- package/dist/cjs/ui/FloatingInsertButton/index.js +1 -2
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +1 -2
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +1 -2
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +1 -2
- package/dist/cjs/ui/TableFloatingColumnControls/index.js +1 -2
- package/dist/cjs/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +1 -2
- package/dist/cjs/ui/TableFloatingControls/CornerControls/DragCornerControls.js +1 -2
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +1 -2
- package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -2
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +1 -2
- package/dist/cjs/ui/TableFloatingControls/RowDropTarget/index.js +1 -2
- package/dist/cjs/ui/TableFloatingControls/index.js +1 -2
- package/dist/cjs/ui/event-handlers.js +12 -12
- package/dist/cjs/ui/toolbar.js +1 -2
- package/dist/cjs/ui/ui-styles.js +16 -16
- package/dist/es2019/nodeviews/TableComponent.js +5 -5
- package/dist/es2019/nodeviews/table-node-views.js +26 -0
- package/dist/es2019/pm-plugins/main.js +5 -5
- package/dist/esm/nodeviews/TableComponent.js +47 -47
- package/dist/esm/nodeviews/table-node-views.js +26 -0
- package/dist/esm/pm-plugins/commands/commands-with-analytics.js +14 -14
- package/dist/esm/pm-plugins/main.js +5 -5
- package/dist/esm/pm-plugins/view-mode-sort/index.js +10 -10
- package/dist/esm/tablePlugin.js +56 -56
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +44 -44
- package/dist/esm/ui/event-handlers.js +12 -12
- package/dist/esm/ui/ui-styles.js +16 -16
- package/dist/{types-ts4.5/nodeviews/lazy-node-views.d.ts → types/nodeviews/table-node-views.d.ts} +4 -4
- package/dist/{types/nodeviews/lazy-node-views.d.ts → types-ts4.5/nodeviews/table-node-views.d.ts} +4 -4
- package/package.json +3 -9
- package/src/nodeviews/TableComponent.tsx +3 -3
- package/src/nodeviews/TableRow.ts +2 -2
- package/src/nodeviews/table-node-views.ts +76 -0
- package/src/pm-plugins/main.ts +9 -9
- package/dist/cjs/nodeviews/lazy-node-views.js +0 -149
- package/dist/es2019/nodeviews/lazy-node-views.js +0 -132
- package/dist/esm/nodeviews/lazy-node-views.js +0 -132
- package/src/nodeviews/lazy-node-views.ts +0 -246
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
-
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
4
|
-
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
5
|
-
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
6
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
-
import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
10
|
-
|
|
11
|
-
import type { PluginInjectionAPI } from '../types';
|
|
12
|
-
|
|
13
|
-
// TODO: ED-23976 - Clean up
|
|
14
|
-
import { createTableView } from './table';
|
|
15
|
-
import TableCell from './TableCell';
|
|
16
|
-
import TableRow from './TableRow';
|
|
17
|
-
|
|
18
|
-
type TableViewOptions = {
|
|
19
|
-
portalProviderAPI: PortalProviderAPI;
|
|
20
|
-
eventDispatcher: EventDispatcher;
|
|
21
|
-
getEditorContainerWidth: GetEditorContainerWidth;
|
|
22
|
-
getEditorFeatureFlags: GetEditorFeatureFlags;
|
|
23
|
-
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
24
|
-
pluginInjectionApi?: PluginInjectionAPI;
|
|
25
|
-
isCommentEditor?: boolean;
|
|
26
|
-
isChromelessEditor?: boolean;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const lazyTableView = (options: TableViewOptions) => {
|
|
30
|
-
// LNV tables were broken in concurrent mode - they were temporarily disabled to unblock concurrent mode.
|
|
31
|
-
// Enabling them again via the platform_editor_enable_table_lnv flag.
|
|
32
|
-
if (
|
|
33
|
-
editorExperiment('platform_editor_exp_lazy_node_views', false) ||
|
|
34
|
-
(!fg('platform_editor_enable_table_lnv') && fg('platform_editor_disable_table_lnv'))
|
|
35
|
-
) {
|
|
36
|
-
return (node: PMNode, view: EditorView, getPos: () => number | undefined) => {
|
|
37
|
-
return createTableView(
|
|
38
|
-
node,
|
|
39
|
-
view,
|
|
40
|
-
getPos,
|
|
41
|
-
options.portalProviderAPI,
|
|
42
|
-
options.eventDispatcher,
|
|
43
|
-
options.getEditorContainerWidth,
|
|
44
|
-
options.getEditorFeatureFlags,
|
|
45
|
-
options.dispatchAnalyticsEvent,
|
|
46
|
-
options.pluginInjectionApi,
|
|
47
|
-
options.isCommentEditor,
|
|
48
|
-
options.isChromelessEditor,
|
|
49
|
-
);
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const loader = () => {
|
|
54
|
-
const result = import(
|
|
55
|
-
/* webpackChunkName: "@atlaskit-internal_editor-plugin-table_nodeview" */
|
|
56
|
-
'./table'
|
|
57
|
-
).then(({ createTableView }) => {
|
|
58
|
-
return (
|
|
59
|
-
node: PMNode,
|
|
60
|
-
view: EditorView,
|
|
61
|
-
getPos: () => number | undefined,
|
|
62
|
-
decorations: readonly Decoration[],
|
|
63
|
-
getNodeViewOptions: () => TableViewOptions,
|
|
64
|
-
) => {
|
|
65
|
-
const {
|
|
66
|
-
portalProviderAPI,
|
|
67
|
-
eventDispatcher,
|
|
68
|
-
getEditorContainerWidth,
|
|
69
|
-
getEditorFeatureFlags,
|
|
70
|
-
dispatchAnalyticsEvent,
|
|
71
|
-
pluginInjectionApi,
|
|
72
|
-
isCommentEditor,
|
|
73
|
-
isChromelessEditor,
|
|
74
|
-
} = getNodeViewOptions();
|
|
75
|
-
|
|
76
|
-
return createTableView(
|
|
77
|
-
node,
|
|
78
|
-
view,
|
|
79
|
-
getPos,
|
|
80
|
-
portalProviderAPI,
|
|
81
|
-
eventDispatcher,
|
|
82
|
-
getEditorContainerWidth,
|
|
83
|
-
getEditorFeatureFlags,
|
|
84
|
-
dispatchAnalyticsEvent,
|
|
85
|
-
pluginInjectionApi,
|
|
86
|
-
isCommentEditor,
|
|
87
|
-
isChromelessEditor,
|
|
88
|
-
);
|
|
89
|
-
};
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
return result;
|
|
93
|
-
};
|
|
94
|
-
return withLazyLoading({
|
|
95
|
-
nodeName: 'table',
|
|
96
|
-
getNodeViewOptions: () => options,
|
|
97
|
-
loader,
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
type TableCellViewOptions = {
|
|
102
|
-
eventDispatcher: EventDispatcher;
|
|
103
|
-
pluginInjectionApi?: PluginInjectionAPI;
|
|
104
|
-
};
|
|
105
|
-
export const lazyTableCellView = (options: TableCellViewOptions) => {
|
|
106
|
-
// LNV tables were broken in concurrent mode - they were temporarily disabled to unblock concurrent mode.
|
|
107
|
-
// Enabling them again via the platform_editor_enable_table_lnv flag.
|
|
108
|
-
if (
|
|
109
|
-
editorExperiment('platform_editor_exp_lazy_node_views', false) ||
|
|
110
|
-
(!fg('platform_editor_enable_table_lnv') && fg('platform_editor_disable_table_lnv'))
|
|
111
|
-
) {
|
|
112
|
-
return (node: PMNode, view: EditorView, getPos: () => number | undefined) => {
|
|
113
|
-
return new TableCell(
|
|
114
|
-
node,
|
|
115
|
-
view,
|
|
116
|
-
getPos,
|
|
117
|
-
options.eventDispatcher,
|
|
118
|
-
options.pluginInjectionApi?.analytics?.actions,
|
|
119
|
-
);
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
const loader = () => {
|
|
124
|
-
const result = import(
|
|
125
|
-
/* webpackChunkName: "@atlaskit-internal_editor-plugin-table_nodeview" */
|
|
126
|
-
'./TableCell'
|
|
127
|
-
).then(({ default: TableCell }) => {
|
|
128
|
-
return (
|
|
129
|
-
node: PMNode,
|
|
130
|
-
view: EditorView,
|
|
131
|
-
getPos: () => number | undefined,
|
|
132
|
-
decorations: readonly Decoration[],
|
|
133
|
-
getNodeViewOptions: () => TableCellViewOptions,
|
|
134
|
-
) => {
|
|
135
|
-
const { eventDispatcher, pluginInjectionApi } = getNodeViewOptions();
|
|
136
|
-
|
|
137
|
-
return new TableCell(
|
|
138
|
-
node,
|
|
139
|
-
view,
|
|
140
|
-
getPos,
|
|
141
|
-
eventDispatcher,
|
|
142
|
-
pluginInjectionApi?.analytics?.actions,
|
|
143
|
-
);
|
|
144
|
-
};
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
return result;
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
return withLazyLoading({
|
|
151
|
-
nodeName: 'tableCell',
|
|
152
|
-
getNodeViewOptions: () => options,
|
|
153
|
-
loader,
|
|
154
|
-
});
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
export const lazyTableHeaderView = (options: TableCellViewOptions) => {
|
|
158
|
-
// LNV tables were broken in concurrent mode - they were temporarily disabled to unblock concurrent mode.
|
|
159
|
-
// Enabling them again via the platform_editor_enable_table_lnv flag.
|
|
160
|
-
if (
|
|
161
|
-
editorExperiment('platform_editor_exp_lazy_node_views', false) ||
|
|
162
|
-
(!fg('platform_editor_enable_table_lnv') && fg('platform_editor_disable_table_lnv'))
|
|
163
|
-
) {
|
|
164
|
-
return (node: PMNode, view: EditorView, getPos: () => number | undefined) => {
|
|
165
|
-
return new TableCell(
|
|
166
|
-
node,
|
|
167
|
-
view,
|
|
168
|
-
getPos,
|
|
169
|
-
options.eventDispatcher,
|
|
170
|
-
options.pluginInjectionApi?.analytics?.actions,
|
|
171
|
-
);
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
const loader = () => {
|
|
176
|
-
const result = import(
|
|
177
|
-
/* webpackChunkName: "@atlaskit-internal_editor-plugin-table-cell_nodeview" */
|
|
178
|
-
'./TableCell'
|
|
179
|
-
).then(({ default: TableCell }) => {
|
|
180
|
-
return (
|
|
181
|
-
node: PMNode,
|
|
182
|
-
view: EditorView,
|
|
183
|
-
getPos: () => number | undefined,
|
|
184
|
-
decorations: readonly Decoration[],
|
|
185
|
-
getNodeViewOptions: () => TableCellViewOptions,
|
|
186
|
-
) => {
|
|
187
|
-
const { eventDispatcher, pluginInjectionApi } = getNodeViewOptions();
|
|
188
|
-
|
|
189
|
-
return new TableCell(
|
|
190
|
-
node,
|
|
191
|
-
view,
|
|
192
|
-
getPos,
|
|
193
|
-
eventDispatcher,
|
|
194
|
-
pluginInjectionApi?.analytics?.actions,
|
|
195
|
-
);
|
|
196
|
-
};
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
return result;
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
return withLazyLoading({
|
|
203
|
-
nodeName: 'tableHeader',
|
|
204
|
-
getNodeViewOptions: () => options,
|
|
205
|
-
loader,
|
|
206
|
-
});
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
export const lazyTableRowView = (options: TableCellViewOptions) => {
|
|
210
|
-
// LNV tables were broken in concurrent mode - they were temporarily disabled to unblock concurrent mode.
|
|
211
|
-
// Enabling them again via the platform_editor_enable_table_lnv flag.
|
|
212
|
-
if (
|
|
213
|
-
editorExperiment('platform_editor_exp_lazy_node_views', false) ||
|
|
214
|
-
(!fg('platform_editor_enable_table_lnv') && fg('platform_editor_disable_table_lnv'))
|
|
215
|
-
) {
|
|
216
|
-
return (node: PMNode, view: EditorView, getPos: () => number | undefined) => {
|
|
217
|
-
return new TableRow(node, view, getPos, options.eventDispatcher);
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
const loader = () => {
|
|
222
|
-
const result = import(
|
|
223
|
-
/* webpackChunkName: "@atlaskit-internal_editor-plugin-table-row_nodeview" */
|
|
224
|
-
'./TableRow'
|
|
225
|
-
).then(({ default: TableRow }) => {
|
|
226
|
-
return (
|
|
227
|
-
node: PMNode,
|
|
228
|
-
view: EditorView,
|
|
229
|
-
getPos: () => number | undefined,
|
|
230
|
-
decorations: readonly Decoration[],
|
|
231
|
-
getNodeViewOptions: () => TableCellViewOptions,
|
|
232
|
-
) => {
|
|
233
|
-
const { eventDispatcher } = getNodeViewOptions();
|
|
234
|
-
|
|
235
|
-
return new TableRow(node, view, getPos, eventDispatcher);
|
|
236
|
-
};
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
return result;
|
|
240
|
-
};
|
|
241
|
-
return withLazyLoading({
|
|
242
|
-
nodeName: 'tableRow',
|
|
243
|
-
getNodeViewOptions: () => options,
|
|
244
|
-
loader,
|
|
245
|
-
});
|
|
246
|
-
};
|