@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.
Files changed (55) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/nodeviews/ExternalDropTargets.js +1 -2
  3. package/dist/cjs/nodeviews/TableComponent.js +47 -47
  4. package/dist/cjs/nodeviews/TableContainer.js +1 -2
  5. package/dist/cjs/nodeviews/TableResizer.js +1 -2
  6. package/dist/cjs/nodeviews/table-node-views.js +34 -0
  7. package/dist/cjs/pm-plugins/commands/commands-with-analytics.js +14 -14
  8. package/dist/cjs/pm-plugins/main.js +5 -5
  9. package/dist/cjs/pm-plugins/view-mode-sort/index.js +10 -10
  10. package/dist/cjs/tablePlugin.js +57 -58
  11. package/dist/cjs/ui/DragHandle/index.js +1 -2
  12. package/dist/cjs/ui/FloatingContextualButton/FixedButton.js +1 -2
  13. package/dist/cjs/ui/FloatingContextualButton/index.js +1 -2
  14. package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +45 -46
  15. package/dist/cjs/ui/FloatingDeleteButton/index.js +1 -2
  16. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +1 -2
  17. package/dist/cjs/ui/FloatingDragMenu/DropdownMenu.js +1 -2
  18. package/dist/cjs/ui/FloatingInsertButton/index.js +1 -2
  19. package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +1 -2
  20. package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +1 -2
  21. package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +1 -2
  22. package/dist/cjs/ui/TableFloatingColumnControls/index.js +1 -2
  23. package/dist/cjs/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +1 -2
  24. package/dist/cjs/ui/TableFloatingControls/CornerControls/DragCornerControls.js +1 -2
  25. package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +1 -2
  26. package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -2
  27. package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +1 -2
  28. package/dist/cjs/ui/TableFloatingControls/RowDropTarget/index.js +1 -2
  29. package/dist/cjs/ui/TableFloatingControls/index.js +1 -2
  30. package/dist/cjs/ui/event-handlers.js +12 -12
  31. package/dist/cjs/ui/toolbar.js +1 -2
  32. package/dist/cjs/ui/ui-styles.js +16 -16
  33. package/dist/es2019/nodeviews/TableComponent.js +5 -5
  34. package/dist/es2019/nodeviews/table-node-views.js +26 -0
  35. package/dist/es2019/pm-plugins/main.js +5 -5
  36. package/dist/esm/nodeviews/TableComponent.js +47 -47
  37. package/dist/esm/nodeviews/table-node-views.js +26 -0
  38. package/dist/esm/pm-plugins/commands/commands-with-analytics.js +14 -14
  39. package/dist/esm/pm-plugins/main.js +5 -5
  40. package/dist/esm/pm-plugins/view-mode-sort/index.js +10 -10
  41. package/dist/esm/tablePlugin.js +56 -56
  42. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +44 -44
  43. package/dist/esm/ui/event-handlers.js +12 -12
  44. package/dist/esm/ui/ui-styles.js +16 -16
  45. package/dist/{types-ts4.5/nodeviews/lazy-node-views.d.ts → types/nodeviews/table-node-views.d.ts} +4 -4
  46. package/dist/{types/nodeviews/lazy-node-views.d.ts → types-ts4.5/nodeviews/table-node-views.d.ts} +4 -4
  47. package/package.json +3 -9
  48. package/src/nodeviews/TableComponent.tsx +3 -3
  49. package/src/nodeviews/TableRow.ts +2 -2
  50. package/src/nodeviews/table-node-views.ts +76 -0
  51. package/src/pm-plugins/main.ts +9 -9
  52. package/dist/cjs/nodeviews/lazy-node-views.js +0 -149
  53. package/dist/es2019/nodeviews/lazy-node-views.js +0 -132
  54. package/dist/esm/nodeviews/lazy-node-views.js +0 -132
  55. package/src/nodeviews/lazy-node-views.ts +0 -246
@@ -17,12 +17,12 @@ type TableViewOptions = {
17
17
  isCommentEditor?: boolean;
18
18
  isChromelessEditor?: boolean;
19
19
  };
20
- export declare const lazyTableView: (options: TableViewOptions) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor;
20
+ export declare const tableView: (options: TableViewOptions) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => import("prosemirror-view").NodeView;
21
21
  type TableCellViewOptions = {
22
22
  eventDispatcher: EventDispatcher;
23
23
  pluginInjectionApi?: PluginInjectionAPI;
24
24
  };
25
- export declare const lazyTableCellView: (options: TableCellViewOptions) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor | ((node: PMNode, view: EditorView, getPos: () => number | undefined) => TableCell);
26
- export declare const lazyTableHeaderView: (options: TableCellViewOptions) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor | ((node: PMNode, view: EditorView, getPos: () => number | undefined) => TableCell);
27
- export declare const lazyTableRowView: (options: TableCellViewOptions) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor | ((node: PMNode, view: EditorView, getPos: () => number | undefined) => TableRow);
25
+ export declare const tableCellView: (options: TableCellViewOptions) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => TableCell;
26
+ export declare const tableHeaderView: (options: TableCellViewOptions) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => TableCell;
27
+ export declare const tableRowView: (options: TableCellViewOptions) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => TableRow;
28
28
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "10.11.4",
3
+ "version": "10.11.6",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -39,7 +39,7 @@
39
39
  "@atlaskit/editor-plugin-batch-attribute-updates": "^2.1.0",
40
40
  "@atlaskit/editor-plugin-content-insertion": "^2.1.0",
41
41
  "@atlaskit/editor-plugin-editor-viewmode": "^4.0.0",
42
- "@atlaskit/editor-plugin-extension": "5.5.0",
42
+ "@atlaskit/editor-plugin-extension": "5.5.1",
43
43
  "@atlaskit/editor-plugin-guideline": "^2.0.0",
44
44
  "@atlaskit/editor-plugin-interaction": "^1.1.0",
45
45
  "@atlaskit/editor-plugin-selection": "^2.2.0",
@@ -55,7 +55,7 @@
55
55
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
56
56
  "@atlaskit/primitives": "^14.8.0",
57
57
  "@atlaskit/theme": "^18.0.0",
58
- "@atlaskit/tmp-editor-statsig": "^5.5.0",
58
+ "@atlaskit/tmp-editor-statsig": "^5.7.0",
59
59
  "@atlaskit/toggle": "^15.0.0",
60
60
  "@atlaskit/tokens": "^4.9.0",
61
61
  "@atlaskit/tooltip": "^20.2.0",
@@ -136,12 +136,6 @@
136
136
  "platform_editor_live_page_prevent_table_recreation": {
137
137
  "type": "boolean"
138
138
  },
139
- "platform_editor_disable_table_lnv": {
140
- "type": "boolean"
141
- },
142
- "platform_editor_enable_table_lnv": {
143
- "type": "boolean"
144
- },
145
139
  "nested_table_control_padding_with_css": {
146
140
  "type": "boolean"
147
141
  },
@@ -195,7 +195,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
195
195
  this.isNestedInTable = tablePos
196
196
  ? getParentOfTypeCount(props.view.state.schema.nodes.table)(
197
197
  props.view.state.doc.resolve(tablePos),
198
- ) > 0
198
+ ) > 0
199
199
  : false;
200
200
 
201
201
  this.isInitialOverflowSent = false;
@@ -221,7 +221,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
221
221
  ...prev,
222
222
  tableWrapperWidth: entry.contentRect.width,
223
223
  tableWrapperHeight: entry.contentRect.height,
224
- };
224
+ };
225
225
  });
226
226
  }
227
227
  });
@@ -932,7 +932,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
932
932
  const shadowPadding = allowControls && tableActive ? -tableToolbarSize : tableMarginSides;
933
933
 
934
934
  const shadowStyle = memoizeOne(
935
- (visible) => ({ visibility: visible ? 'visible' : 'hidden' } as CSSProperties),
935
+ (visible) => ({ visibility: visible ? 'visible' : 'hidden' }) as CSSProperties,
936
936
  );
937
937
 
938
938
  /**
@@ -438,8 +438,8 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
438
438
  const newHeight = entry.contentRect
439
439
  ? entry.contentRect.height
440
440
  : // Ignored via go/ees005
441
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
442
- (entry.target as HTMLElement).offsetHeight;
441
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
442
+ (entry.target as HTMLElement).offsetHeight;
443
443
 
444
444
  if (
445
445
  this.sentinels.bottom &&
@@ -0,0 +1,76 @@
1
+ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
2
+ import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
3
+ import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
4
+ import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
5
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
6
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
7
+
8
+ import type { PluginInjectionAPI } from '../types';
9
+
10
+ // TODO: ED-23976 - Clean up
11
+ import { createTableView } from './table';
12
+ import TableCell from './TableCell';
13
+ import TableRow from './TableRow';
14
+
15
+ type TableViewOptions = {
16
+ portalProviderAPI: PortalProviderAPI;
17
+ eventDispatcher: EventDispatcher;
18
+ getEditorContainerWidth: GetEditorContainerWidth;
19
+ getEditorFeatureFlags: GetEditorFeatureFlags;
20
+ dispatchAnalyticsEvent: DispatchAnalyticsEvent;
21
+ pluginInjectionApi?: PluginInjectionAPI;
22
+ isCommentEditor?: boolean;
23
+ isChromelessEditor?: boolean;
24
+ };
25
+
26
+ export const tableView = (options: TableViewOptions) => {
27
+ return (node: PMNode, view: EditorView, getPos: () => number | undefined) => {
28
+ return createTableView(
29
+ node,
30
+ view,
31
+ getPos,
32
+ options.portalProviderAPI,
33
+ options.eventDispatcher,
34
+ options.getEditorContainerWidth,
35
+ options.getEditorFeatureFlags,
36
+ options.dispatchAnalyticsEvent,
37
+ options.pluginInjectionApi,
38
+ options.isCommentEditor,
39
+ options.isChromelessEditor,
40
+ );
41
+ };
42
+ };
43
+
44
+ type TableCellViewOptions = {
45
+ eventDispatcher: EventDispatcher;
46
+ pluginInjectionApi?: PluginInjectionAPI;
47
+ };
48
+ export const tableCellView = (options: TableCellViewOptions) => {
49
+ return (node: PMNode, view: EditorView, getPos: () => number | undefined) => {
50
+ return new TableCell(
51
+ node,
52
+ view,
53
+ getPos,
54
+ options.eventDispatcher,
55
+ options.pluginInjectionApi?.analytics?.actions,
56
+ );
57
+ };
58
+ };
59
+
60
+ export const tableHeaderView = (options: TableCellViewOptions) => {
61
+ return (node: PMNode, view: EditorView, getPos: () => number | undefined) => {
62
+ return new TableCell(
63
+ node,
64
+ view,
65
+ getPos,
66
+ options.eventDispatcher,
67
+ options.pluginInjectionApi?.analytics?.actions,
68
+ );
69
+ };
70
+ };
71
+
72
+ export const tableRowView = (options: TableCellViewOptions) => {
73
+ return (node: PMNode, view: EditorView, getPos: () => number | undefined) => {
74
+ return new TableRow(node, view, getPos, options.eventDispatcher);
75
+ };
76
+ };
@@ -28,11 +28,11 @@ import { findTable } from '@atlaskit/editor-tables/utils';
28
28
  import { fg } from '@atlaskit/platform-feature-flags';
29
29
 
30
30
  import {
31
- lazyTableCellView,
32
- lazyTableHeaderView,
33
- lazyTableRowView,
34
- lazyTableView,
35
- } from '../nodeviews/lazy-node-views';
31
+ tableCellView,
32
+ tableHeaderView,
33
+ tableRowView,
34
+ tableView,
35
+ } from '../nodeviews/table-node-views';
36
36
  import { pluginKey as decorationsPluginKey } from '../pm-plugins/decorations/plugin';
37
37
  import type {
38
38
  InvalidNodeAttr,
@@ -135,7 +135,7 @@ export const createPlugin = (
135
135
  isSSR() && fg('platform_editor_table_fallback_to_dom_on_ssr')
136
136
  ? undefined
137
137
  : {
138
- table: lazyTableView({
138
+ table: tableView({
139
139
  portalProviderAPI,
140
140
  eventDispatcher,
141
141
  getEditorContainerWidth,
@@ -145,9 +145,9 @@ export const createPlugin = (
145
145
  isCommentEditor,
146
146
  isChromelessEditor,
147
147
  }),
148
- tableRow: lazyTableRowView({ eventDispatcher }),
149
- tableCell: lazyTableCellView({ eventDispatcher, pluginInjectionApi }),
150
- tableHeader: lazyTableHeaderView({ eventDispatcher, pluginInjectionApi }),
148
+ tableRow: tableRowView({ eventDispatcher }),
149
+ tableCell: tableCellView({ eventDispatcher, pluginInjectionApi }),
150
+ tableHeader: tableHeaderView({ eventDispatcher, pluginInjectionApi }),
151
151
  };
152
152
  return new SafePlugin({
153
153
  state: state,
@@ -1,149 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.lazyTableView = exports.lazyTableRowView = exports.lazyTableHeaderView = exports.lazyTableCellView = void 0;
8
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
- var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
10
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
12
- var _table = require("./table");
13
- var _TableCell = _interopRequireDefault(require("./TableCell"));
14
- var _TableRow = _interopRequireDefault(require("./TableRow"));
15
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
16
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } // TODO: ED-23976 - Clean up
17
- var lazyTableView = exports.lazyTableView = function lazyTableView(options) {
18
- // LNV tables were broken in concurrent mode - they were temporarily disabled to unblock concurrent mode.
19
- // Enabling them again via the platform_editor_enable_table_lnv flag.
20
- if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false) || !(0, _platformFeatureFlags.fg)('platform_editor_enable_table_lnv') && (0, _platformFeatureFlags.fg)('platform_editor_disable_table_lnv')) {
21
- return function (node, view, getPos) {
22
- return (0, _table.createTableView)(node, view, getPos, options.portalProviderAPI, options.eventDispatcher, options.getEditorContainerWidth, options.getEditorFeatureFlags, options.dispatchAnalyticsEvent, options.pluginInjectionApi, options.isCommentEditor, options.isChromelessEditor);
23
- };
24
- }
25
- var loader = function loader() {
26
- var result = Promise.resolve().then(function () {
27
- return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table_nodeview" */
28
- './table'));
29
- }).then(function (_ref) {
30
- var createTableView = _ref.createTableView;
31
- return function (node, view, getPos, decorations, getNodeViewOptions) {
32
- var _getNodeViewOptions = getNodeViewOptions(),
33
- portalProviderAPI = _getNodeViewOptions.portalProviderAPI,
34
- eventDispatcher = _getNodeViewOptions.eventDispatcher,
35
- getEditorContainerWidth = _getNodeViewOptions.getEditorContainerWidth,
36
- getEditorFeatureFlags = _getNodeViewOptions.getEditorFeatureFlags,
37
- dispatchAnalyticsEvent = _getNodeViewOptions.dispatchAnalyticsEvent,
38
- pluginInjectionApi = _getNodeViewOptions.pluginInjectionApi,
39
- isCommentEditor = _getNodeViewOptions.isCommentEditor,
40
- isChromelessEditor = _getNodeViewOptions.isChromelessEditor;
41
- return createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isCommentEditor, isChromelessEditor);
42
- };
43
- });
44
- return result;
45
- };
46
- return (0, _lazyNodeView.withLazyLoading)({
47
- nodeName: 'table',
48
- getNodeViewOptions: function getNodeViewOptions() {
49
- return options;
50
- },
51
- loader: loader
52
- });
53
- };
54
- var lazyTableCellView = exports.lazyTableCellView = function lazyTableCellView(options) {
55
- // LNV tables were broken in concurrent mode - they were temporarily disabled to unblock concurrent mode.
56
- // Enabling them again via the platform_editor_enable_table_lnv flag.
57
- if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false) || !(0, _platformFeatureFlags.fg)('platform_editor_enable_table_lnv') && (0, _platformFeatureFlags.fg)('platform_editor_disable_table_lnv')) {
58
- return function (node, view, getPos) {
59
- var _options$pluginInject;
60
- return new _TableCell.default(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);
61
- };
62
- }
63
- var loader = function loader() {
64
- var result = Promise.resolve().then(function () {
65
- return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table_nodeview" */
66
- './TableCell'));
67
- }).then(function (_ref2) {
68
- var TableCell = _ref2.default;
69
- return function (node, view, getPos, decorations, getNodeViewOptions) {
70
- var _pluginInjectionApi$a;
71
- var _getNodeViewOptions2 = getNodeViewOptions(),
72
- eventDispatcher = _getNodeViewOptions2.eventDispatcher,
73
- pluginInjectionApi = _getNodeViewOptions2.pluginInjectionApi;
74
- 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);
75
- };
76
- });
77
- return result;
78
- };
79
- return (0, _lazyNodeView.withLazyLoading)({
80
- nodeName: 'tableCell',
81
- getNodeViewOptions: function getNodeViewOptions() {
82
- return options;
83
- },
84
- loader: loader
85
- });
86
- };
87
- var lazyTableHeaderView = exports.lazyTableHeaderView = function lazyTableHeaderView(options) {
88
- // LNV tables were broken in concurrent mode - they were temporarily disabled to unblock concurrent mode.
89
- // Enabling them again via the platform_editor_enable_table_lnv flag.
90
- if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false) || !(0, _platformFeatureFlags.fg)('platform_editor_enable_table_lnv') && (0, _platformFeatureFlags.fg)('platform_editor_disable_table_lnv')) {
91
- return function (node, view, getPos) {
92
- var _options$pluginInject2;
93
- return new _TableCell.default(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);
94
- };
95
- }
96
- var loader = function loader() {
97
- var result = Promise.resolve().then(function () {
98
- return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table-cell_nodeview" */
99
- './TableCell'));
100
- }).then(function (_ref3) {
101
- var TableCell = _ref3.default;
102
- return function (node, view, getPos, decorations, getNodeViewOptions) {
103
- var _pluginInjectionApi$a2;
104
- var _getNodeViewOptions3 = getNodeViewOptions(),
105
- eventDispatcher = _getNodeViewOptions3.eventDispatcher,
106
- pluginInjectionApi = _getNodeViewOptions3.pluginInjectionApi;
107
- 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);
108
- };
109
- });
110
- return result;
111
- };
112
- return (0, _lazyNodeView.withLazyLoading)({
113
- nodeName: 'tableHeader',
114
- getNodeViewOptions: function getNodeViewOptions() {
115
- return options;
116
- },
117
- loader: loader
118
- });
119
- };
120
- var lazyTableRowView = exports.lazyTableRowView = function lazyTableRowView(options) {
121
- // LNV tables were broken in concurrent mode - they were temporarily disabled to unblock concurrent mode.
122
- // Enabling them again via the platform_editor_enable_table_lnv flag.
123
- if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false) || !(0, _platformFeatureFlags.fg)('platform_editor_enable_table_lnv') && (0, _platformFeatureFlags.fg)('platform_editor_disable_table_lnv')) {
124
- return function (node, view, getPos) {
125
- return new _TableRow.default(node, view, getPos, options.eventDispatcher);
126
- };
127
- }
128
- var loader = function loader() {
129
- var result = Promise.resolve().then(function () {
130
- return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table-row_nodeview" */
131
- './TableRow'));
132
- }).then(function (_ref4) {
133
- var TableRow = _ref4.default;
134
- return function (node, view, getPos, decorations, getNodeViewOptions) {
135
- var _getNodeViewOptions4 = getNodeViewOptions(),
136
- eventDispatcher = _getNodeViewOptions4.eventDispatcher;
137
- return new TableRow(node, view, getPos, eventDispatcher);
138
- };
139
- });
140
- return result;
141
- };
142
- return (0, _lazyNodeView.withLazyLoading)({
143
- nodeName: 'tableRow',
144
- getNodeViewOptions: function getNodeViewOptions() {
145
- return options;
146
- },
147
- loader: loader
148
- });
149
- };
@@ -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
- };