@atlaskit/editor-plugin-table 10.11.5 → 10.11.7

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.
@@ -1,132 +0,0 @@
1
- import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
- // TODO: ED-23976 - Clean up
5
- import { createTableView } from './table';
6
- import TableCell from './TableCell';
7
- import TableRow from './TableRow';
8
- export const lazyTableView = options => {
9
- // LNV tables were broken in concurrent mode - they were temporarily disabled to unblock concurrent mode.
10
- // Enabling them again via the platform_editor_enable_table_lnv flag.
11
- if (editorExperiment('platform_editor_exp_lazy_node_views', false) || !fg('platform_editor_enable_table_lnv') && fg('platform_editor_disable_table_lnv')) {
12
- return (node, view, getPos) => {
13
- return createTableView(node, view, getPos, options.portalProviderAPI, options.eventDispatcher, options.getEditorContainerWidth, options.getEditorFeatureFlags, options.dispatchAnalyticsEvent, options.pluginInjectionApi, options.isCommentEditor, options.isChromelessEditor);
14
- };
15
- }
16
- const loader = () => {
17
- const result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table_nodeview" */
18
- './table').then(({
19
- createTableView
20
- }) => {
21
- return (node, view, getPos, decorations, getNodeViewOptions) => {
22
- const {
23
- portalProviderAPI,
24
- eventDispatcher,
25
- getEditorContainerWidth,
26
- getEditorFeatureFlags,
27
- dispatchAnalyticsEvent,
28
- pluginInjectionApi,
29
- isCommentEditor,
30
- isChromelessEditor
31
- } = getNodeViewOptions();
32
- return createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isCommentEditor, isChromelessEditor);
33
- };
34
- });
35
- return result;
36
- };
37
- return withLazyLoading({
38
- nodeName: 'table',
39
- getNodeViewOptions: () => options,
40
- loader
41
- });
42
- };
43
- export const lazyTableCellView = options => {
44
- // LNV tables were broken in concurrent mode - they were temporarily disabled to unblock concurrent mode.
45
- // Enabling them again via the platform_editor_enable_table_lnv flag.
46
- if (editorExperiment('platform_editor_exp_lazy_node_views', false) || !fg('platform_editor_enable_table_lnv') && fg('platform_editor_disable_table_lnv')) {
47
- return (node, view, getPos) => {
48
- var _options$pluginInject, _options$pluginInject2;
49
- return new TableCell(node, view, getPos, options.eventDispatcher, (_options$pluginInject = options.pluginInjectionApi) === null || _options$pluginInject === void 0 ? void 0 : (_options$pluginInject2 = _options$pluginInject.analytics) === null || _options$pluginInject2 === void 0 ? void 0 : _options$pluginInject2.actions);
50
- };
51
- }
52
- const loader = () => {
53
- const result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table_nodeview" */
54
- './TableCell').then(({
55
- default: TableCell
56
- }) => {
57
- return (node, view, getPos, decorations, getNodeViewOptions) => {
58
- var _pluginInjectionApi$a;
59
- const {
60
- eventDispatcher,
61
- pluginInjectionApi
62
- } = getNodeViewOptions();
63
- return new TableCell(node, view, getPos, eventDispatcher, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions);
64
- };
65
- });
66
- return result;
67
- };
68
- return withLazyLoading({
69
- nodeName: 'tableCell',
70
- getNodeViewOptions: () => options,
71
- loader
72
- });
73
- };
74
- export const lazyTableHeaderView = options => {
75
- // LNV tables were broken in concurrent mode - they were temporarily disabled to unblock concurrent mode.
76
- // Enabling them again via the platform_editor_enable_table_lnv flag.
77
- if (editorExperiment('platform_editor_exp_lazy_node_views', false) || !fg('platform_editor_enable_table_lnv') && fg('platform_editor_disable_table_lnv')) {
78
- return (node, view, getPos) => {
79
- var _options$pluginInject3, _options$pluginInject4;
80
- return new TableCell(node, view, getPos, options.eventDispatcher, (_options$pluginInject3 = options.pluginInjectionApi) === null || _options$pluginInject3 === void 0 ? void 0 : (_options$pluginInject4 = _options$pluginInject3.analytics) === null || _options$pluginInject4 === void 0 ? void 0 : _options$pluginInject4.actions);
81
- };
82
- }
83
- const loader = () => {
84
- const result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table-cell_nodeview" */
85
- './TableCell').then(({
86
- default: TableCell
87
- }) => {
88
- return (node, view, getPos, decorations, getNodeViewOptions) => {
89
- var _pluginInjectionApi$a2;
90
- const {
91
- eventDispatcher,
92
- pluginInjectionApi
93
- } = getNodeViewOptions();
94
- return new TableCell(node, view, getPos, eventDispatcher, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions);
95
- };
96
- });
97
- return result;
98
- };
99
- return withLazyLoading({
100
- nodeName: 'tableHeader',
101
- getNodeViewOptions: () => options,
102
- loader
103
- });
104
- };
105
- export const lazyTableRowView = options => {
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 (editorExperiment('platform_editor_exp_lazy_node_views', false) || !fg('platform_editor_enable_table_lnv') && fg('platform_editor_disable_table_lnv')) {
109
- return (node, view, getPos) => {
110
- return new TableRow(node, view, getPos, options.eventDispatcher);
111
- };
112
- }
113
- const loader = () => {
114
- const result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table-row_nodeview" */
115
- './TableRow').then(({
116
- default: TableRow
117
- }) => {
118
- return (node, view, getPos, decorations, getNodeViewOptions) => {
119
- const {
120
- eventDispatcher
121
- } = getNodeViewOptions();
122
- return new TableRow(node, view, getPos, eventDispatcher);
123
- };
124
- });
125
- return result;
126
- };
127
- return withLazyLoading({
128
- nodeName: 'tableRow',
129
- getNodeViewOptions: () => options,
130
- loader
131
- });
132
- };
@@ -1,132 +0,0 @@
1
- import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
- // TODO: ED-23976 - Clean up
5
- import { createTableView } from './table';
6
- import TableCell from './TableCell';
7
- import TableRow from './TableRow';
8
- export var lazyTableView = function lazyTableView(options) {
9
- // LNV tables were broken in concurrent mode - they were temporarily disabled to unblock concurrent mode.
10
- // Enabling them again via the platform_editor_enable_table_lnv flag.
11
- if (editorExperiment('platform_editor_exp_lazy_node_views', false) || !fg('platform_editor_enable_table_lnv') && fg('platform_editor_disable_table_lnv')) {
12
- return function (node, view, getPos) {
13
- return createTableView(node, view, getPos, options.portalProviderAPI, options.eventDispatcher, options.getEditorContainerWidth, options.getEditorFeatureFlags, options.dispatchAnalyticsEvent, options.pluginInjectionApi, options.isCommentEditor, options.isChromelessEditor);
14
- };
15
- }
16
- var loader = function loader() {
17
- var result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table_nodeview" */
18
- './table').then(function (_ref) {
19
- var createTableView = _ref.createTableView;
20
- return function (node, view, getPos, decorations, getNodeViewOptions) {
21
- var _getNodeViewOptions = getNodeViewOptions(),
22
- portalProviderAPI = _getNodeViewOptions.portalProviderAPI,
23
- eventDispatcher = _getNodeViewOptions.eventDispatcher,
24
- getEditorContainerWidth = _getNodeViewOptions.getEditorContainerWidth,
25
- getEditorFeatureFlags = _getNodeViewOptions.getEditorFeatureFlags,
26
- dispatchAnalyticsEvent = _getNodeViewOptions.dispatchAnalyticsEvent,
27
- pluginInjectionApi = _getNodeViewOptions.pluginInjectionApi,
28
- isCommentEditor = _getNodeViewOptions.isCommentEditor,
29
- isChromelessEditor = _getNodeViewOptions.isChromelessEditor;
30
- return createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isCommentEditor, isChromelessEditor);
31
- };
32
- });
33
- return result;
34
- };
35
- return withLazyLoading({
36
- nodeName: 'table',
37
- getNodeViewOptions: function getNodeViewOptions() {
38
- return options;
39
- },
40
- loader: loader
41
- });
42
- };
43
- export var lazyTableCellView = function lazyTableCellView(options) {
44
- // LNV tables were broken in concurrent mode - they were temporarily disabled to unblock concurrent mode.
45
- // Enabling them again via the platform_editor_enable_table_lnv flag.
46
- if (editorExperiment('platform_editor_exp_lazy_node_views', false) || !fg('platform_editor_enable_table_lnv') && fg('platform_editor_disable_table_lnv')) {
47
- return function (node, view, getPos) {
48
- var _options$pluginInject;
49
- return new TableCell(node, view, getPos, options.eventDispatcher, (_options$pluginInject = options.pluginInjectionApi) === null || _options$pluginInject === void 0 || (_options$pluginInject = _options$pluginInject.analytics) === null || _options$pluginInject === void 0 ? void 0 : _options$pluginInject.actions);
50
- };
51
- }
52
- var loader = function loader() {
53
- var result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table_nodeview" */
54
- './TableCell').then(function (_ref2) {
55
- var TableCell = _ref2.default;
56
- return function (node, view, getPos, decorations, getNodeViewOptions) {
57
- var _pluginInjectionApi$a;
58
- var _getNodeViewOptions2 = getNodeViewOptions(),
59
- eventDispatcher = _getNodeViewOptions2.eventDispatcher,
60
- pluginInjectionApi = _getNodeViewOptions2.pluginInjectionApi;
61
- return new TableCell(node, view, getPos, eventDispatcher, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions);
62
- };
63
- });
64
- return result;
65
- };
66
- return withLazyLoading({
67
- nodeName: 'tableCell',
68
- getNodeViewOptions: function getNodeViewOptions() {
69
- return options;
70
- },
71
- loader: loader
72
- });
73
- };
74
- export var lazyTableHeaderView = function lazyTableHeaderView(options) {
75
- // LNV tables were broken in concurrent mode - they were temporarily disabled to unblock concurrent mode.
76
- // Enabling them again via the platform_editor_enable_table_lnv flag.
77
- if (editorExperiment('platform_editor_exp_lazy_node_views', false) || !fg('platform_editor_enable_table_lnv') && fg('platform_editor_disable_table_lnv')) {
78
- return function (node, view, getPos) {
79
- var _options$pluginInject2;
80
- return new TableCell(node, view, getPos, options.eventDispatcher, (_options$pluginInject2 = options.pluginInjectionApi) === null || _options$pluginInject2 === void 0 || (_options$pluginInject2 = _options$pluginInject2.analytics) === null || _options$pluginInject2 === void 0 ? void 0 : _options$pluginInject2.actions);
81
- };
82
- }
83
- var loader = function loader() {
84
- var result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table-cell_nodeview" */
85
- './TableCell').then(function (_ref3) {
86
- var TableCell = _ref3.default;
87
- return function (node, view, getPos, decorations, getNodeViewOptions) {
88
- var _pluginInjectionApi$a2;
89
- var _getNodeViewOptions3 = getNodeViewOptions(),
90
- eventDispatcher = _getNodeViewOptions3.eventDispatcher,
91
- pluginInjectionApi = _getNodeViewOptions3.pluginInjectionApi;
92
- return new TableCell(node, view, getPos, eventDispatcher, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions);
93
- };
94
- });
95
- return result;
96
- };
97
- return withLazyLoading({
98
- nodeName: 'tableHeader',
99
- getNodeViewOptions: function getNodeViewOptions() {
100
- return options;
101
- },
102
- loader: loader
103
- });
104
- };
105
- export var lazyTableRowView = function lazyTableRowView(options) {
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 (editorExperiment('platform_editor_exp_lazy_node_views', false) || !fg('platform_editor_enable_table_lnv') && fg('platform_editor_disable_table_lnv')) {
109
- return function (node, view, getPos) {
110
- return new TableRow(node, view, getPos, options.eventDispatcher);
111
- };
112
- }
113
- var loader = function loader() {
114
- var result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table-row_nodeview" */
115
- './TableRow').then(function (_ref4) {
116
- var TableRow = _ref4.default;
117
- return function (node, view, getPos, decorations, getNodeViewOptions) {
118
- var _getNodeViewOptions4 = getNodeViewOptions(),
119
- eventDispatcher = _getNodeViewOptions4.eventDispatcher;
120
- return new TableRow(node, view, getPos, eventDispatcher);
121
- };
122
- });
123
- return result;
124
- };
125
- return withLazyLoading({
126
- nodeName: 'tableRow',
127
- getNodeViewOptions: function getNodeViewOptions() {
128
- return options;
129
- },
130
- loader: loader
131
- });
132
- };
@@ -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
- };