@atlaskit/editor-plugin-table 12.1.15 → 12.2.0
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/afm-cc/tsconfig.json +3 -0
- package/afm-dev-agents/tsconfig.json +3 -0
- package/afm-jira/tsconfig.json +3 -0
- package/afm-passionfruit/tsconfig.json +3 -0
- package/afm-post-office/tsconfig.json +3 -0
- package/afm-rovo-extension/tsconfig.json +3 -0
- package/afm-townsquare/tsconfig.json +3 -0
- package/dist/cjs/nodeviews/TableComponent.js +73 -22
- package/dist/cjs/nodeviews/TableContainer.js +270 -10
- package/dist/cjs/nodeviews/TableResizer.js +9 -2
- package/dist/cjs/nodeviews/table.js +12 -2
- package/dist/cjs/nodeviews/toDOM.js +23 -7
- package/dist/cjs/pm-plugins/main.js +57 -23
- package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +72 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +70 -1
- package/dist/cjs/tablePlugin.js +17 -3
- package/dist/es2019/nodeviews/TableComponent.js +76 -22
- package/dist/es2019/nodeviews/TableContainer.js +256 -2
- package/dist/es2019/nodeviews/TableResizer.js +9 -2
- package/dist/es2019/nodeviews/table.js +12 -2
- package/dist/es2019/nodeviews/toDOM.js +24 -8
- package/dist/es2019/pm-plugins/main.js +57 -23
- package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +72 -3
- package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +70 -1
- package/dist/es2019/tablePlugin.js +17 -3
- package/dist/esm/nodeviews/TableComponent.js +73 -22
- package/dist/esm/nodeviews/TableContainer.js +270 -10
- package/dist/esm/nodeviews/TableResizer.js +9 -2
- package/dist/esm/nodeviews/table.js +12 -2
- package/dist/esm/nodeviews/toDOM.js +24 -8
- package/dist/esm/pm-plugins/main.js +57 -23
- package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +74 -3
- package/dist/esm/pm-plugins/table-resizing/utils/misc.js +70 -1
- package/dist/esm/tablePlugin.js +17 -3
- package/dist/types/nodeviews/TableContainer.d.ts +7 -2
- package/dist/types/nodeviews/TableResizer.d.ts +1 -1
- package/dist/types/nodeviews/toDOM.d.ts +5 -0
- package/dist/types/nodeviews/types.d.ts +1 -0
- package/dist/types/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -0
- package/dist/types/pm-plugins/table-resizing/utils/misc.d.ts +41 -0
- package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +7 -2
- package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/toDOM.d.ts +5 -0
- package/dist/types-ts4.5/nodeviews/types.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/misc.d.ts +41 -0
- package/package.json +8 -7
- package/src/nodeviews/TableComponent.tsx +105 -19
- package/src/nodeviews/TableContainer.tsx +331 -2
- package/src/nodeviews/TableResizer.tsx +10 -5
- package/src/nodeviews/table.tsx +14 -0
- package/src/nodeviews/toDOM.ts +75 -9
- package/src/nodeviews/types.ts +1 -0
- package/src/pm-plugins/main.ts +41 -18
- package/src/pm-plugins/table-resizing/utils/colgroup.ts +139 -6
- package/src/pm-plugins/table-resizing/utils/misc.ts +87 -0
- package/src/tablePlugin.tsx +21 -0
- package/tsconfig.app.json +3 -0
- package/types/package.json +1 -1
- package/ui/common-styles/package.json +1 -1
|
@@ -3,14 +3,17 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
import React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { CHANGE_ALIGNMENT_REASON, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
|
+
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
6
7
|
import { sharedPluginStateHookMigratorFactory, useSharedPluginState, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
7
8
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
8
9
|
import { akEditorDefaultLayoutWidth, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout, akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
9
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
|
+
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
10
12
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
13
|
import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../pm-plugins/commands/commands-with-analytics';
|
|
12
14
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
13
15
|
import { TABLE_MAX_WIDTH, TABLE_OFFSET_IN_COMMENT_EDITOR } from '../pm-plugins/table-resizing/utils/consts';
|
|
16
|
+
import { getTableResizerContainerMaxWidthInCSS, getTableResizerContainerForFullPageWidthInCSS } from '../pm-plugins/table-resizing/utils/misc';
|
|
14
17
|
import { ALIGN_CENTER, ALIGN_START } from '../pm-plugins/utils/alignment';
|
|
15
18
|
import { TableCssClassName as ClassName } from '../types';
|
|
16
19
|
import { getAlignmentStyle } from './table-container-styles';
|
|
@@ -152,7 +155,7 @@ var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
|
152
155
|
var getPadding = function getPadding(containerWidth) {
|
|
153
156
|
return containerWidth <= akEditorFullPageNarrowBreakout && expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true) ? akEditorGutterPaddingReduced : akEditorGutterPaddingDynamic();
|
|
154
157
|
};
|
|
155
|
-
|
|
158
|
+
var ResizableTableContainerLegacy = /*#__PURE__*/React.memo(function (_ref4) {
|
|
156
159
|
var children = _ref4.children,
|
|
157
160
|
className = _ref4.className,
|
|
158
161
|
node = _ref4.node,
|
|
@@ -346,28 +349,283 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
346
349
|
node: node
|
|
347
350
|
}, children)) : null));
|
|
348
351
|
});
|
|
349
|
-
|
|
352
|
+
var ResizableTableContainerNext = /*#__PURE__*/React.memo(function (_ref5) {
|
|
350
353
|
var children = _ref5.children,
|
|
351
|
-
node = _ref5.node,
|
|
352
354
|
className = _ref5.className,
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
lineLength = _ref5
|
|
355
|
+
node = _ref5.node,
|
|
356
|
+
containerWidth = _ref5.containerWidth,
|
|
357
|
+
lineLength = _ref5.lineLength,
|
|
356
358
|
editorView = _ref5.editorView,
|
|
357
359
|
getPos = _ref5.getPos,
|
|
358
360
|
tableRef = _ref5.tableRef,
|
|
359
|
-
isNested = _ref5.isNested,
|
|
360
|
-
tableWrapperHeight = _ref5.tableWrapperHeight,
|
|
361
361
|
isResizing = _ref5.isResizing,
|
|
362
|
+
isWindowResized = _ref5.isWindowResized,
|
|
362
363
|
pluginInjectionApi = _ref5.pluginInjectionApi,
|
|
364
|
+
tableWrapperHeight = _ref5.tableWrapperHeight,
|
|
363
365
|
isWholeTableInDanger = _ref5.isWholeTableInDanger,
|
|
364
|
-
isTableResizingEnabled = _ref5.isTableResizingEnabled,
|
|
365
366
|
isTableScalingEnabled = _ref5.isTableScalingEnabled,
|
|
366
367
|
isTableWithFixedColumnWidthsOptionEnabled = _ref5.isTableWithFixedColumnWidthsOptionEnabled,
|
|
367
368
|
isTableAlignmentEnabled = _ref5.isTableAlignmentEnabled,
|
|
368
369
|
shouldUseIncreasedScalingPercent = _ref5.shouldUseIncreasedScalingPercent,
|
|
369
370
|
isCommentEditor = _ref5.isCommentEditor,
|
|
370
371
|
isChromelessEditor = _ref5.isChromelessEditor;
|
|
372
|
+
var tableWidth = getTableContainerWidth(node);
|
|
373
|
+
var containerRef = useRef(null);
|
|
374
|
+
var tableWidthRef = useRef(akEditorDefaultLayoutWidth);
|
|
375
|
+
var _useState3 = useState(false),
|
|
376
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
377
|
+
resizing = _useState4[0],
|
|
378
|
+
setIsResizing = _useState4[1];
|
|
379
|
+
var _useState5 = useState(tableWidth),
|
|
380
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
381
|
+
tableMaxWidthForFullPageOnLoad = _useState6[0],
|
|
382
|
+
setTableMaxWidthForFullPageOnLoad = _useState6[1];
|
|
383
|
+
var _useSharedState2 = useSharedState(pluginInjectionApi),
|
|
384
|
+
tableState = _useSharedState2.tableState,
|
|
385
|
+
editorViewModeState = _useSharedState2.editorViewModeState;
|
|
386
|
+
var isFullWidthModeEnabled = tableState === null || tableState === void 0 ? void 0 : tableState.isFullWidthModeEnabled;
|
|
387
|
+
var mode = editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode;
|
|
388
|
+
var updateContainerHeight = useCallback(function (height) {
|
|
389
|
+
var _containerRef$current3;
|
|
390
|
+
// current StickyHeader State is not stable to be fetch.
|
|
391
|
+
// we need to update stickyHeader plugin to make sure state can be
|
|
392
|
+
// consistently fetch and refactor below
|
|
393
|
+
var stickyHeaders = (_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.getElementsByClassName('pm-table-sticky');
|
|
394
|
+
if (!stickyHeaders || stickyHeaders.length < 1) {
|
|
395
|
+
// when starting to drag, we need to keep the original space,
|
|
396
|
+
// -- When sticky header not appear, margin top(24px) and margin bottom(16px), should be 40px,
|
|
397
|
+
// 1px is border width but collapse make it 0.5.
|
|
398
|
+
// -- When sticky header appear, we should add first row height but reduce
|
|
399
|
+
// collapsed border
|
|
400
|
+
return typeof height === 'number' ? "".concat(height + 40.5, "px") : 'auto';
|
|
401
|
+
} else {
|
|
402
|
+
var _containerRef$current4;
|
|
403
|
+
var stickyHeaderHeight = ((_containerRef$current4 = containerRef.current) === null || _containerRef$current4 === void 0 ? void 0 : _containerRef$current4.getElementsByTagName('th')[0].getBoundingClientRect().height) || 0;
|
|
404
|
+
return typeof height === 'number' ? "".concat(height + stickyHeaderHeight + 39.5, "px") : 'auto';
|
|
405
|
+
}
|
|
406
|
+
}, []);
|
|
407
|
+
var onResizeStart = useCallback(function () {
|
|
408
|
+
setIsResizing(true);
|
|
409
|
+
}, []);
|
|
410
|
+
var onResizeStop = useCallback(function () {
|
|
411
|
+
setIsResizing(false);
|
|
412
|
+
}, []);
|
|
413
|
+
var updateWidth = useCallback(function (width) {
|
|
414
|
+
if (!containerRef.current) {
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// make sure during resizing
|
|
419
|
+
// the pm-table-resizer-container width is the same as its child div resizer-item
|
|
420
|
+
// otherwise when resize table from wider to narrower , pm-table-resizer-container stays wider
|
|
421
|
+
// and cause the fabric-editor-popup-scroll-parent to overflow
|
|
422
|
+
if (containerRef.current.style.width !== "".concat(width, "px")) {
|
|
423
|
+
containerRef.current.style.width = "".concat(width, "px");
|
|
424
|
+
}
|
|
425
|
+
}, []);
|
|
426
|
+
var displayGuideline = useCallback(function (guidelines) {
|
|
427
|
+
var _pluginInjectionApi$g3, _pluginInjectionApi$g4;
|
|
428
|
+
return (_pluginInjectionApi$g3 = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$g4 = pluginInjectionApi.guideline) === null || _pluginInjectionApi$g4 === void 0 || (_pluginInjectionApi$g4 = _pluginInjectionApi$g4.actions) === null || _pluginInjectionApi$g4 === void 0 ? void 0 : _pluginInjectionApi$g4.displayGuideline(editorView)({
|
|
429
|
+
guidelines: guidelines
|
|
430
|
+
})) !== null && _pluginInjectionApi$g3 !== void 0 ? _pluginInjectionApi$g3 : false;
|
|
431
|
+
}, [pluginInjectionApi, editorView]);
|
|
432
|
+
var attachAnalyticsEvent = useCallback(function (payload) {
|
|
433
|
+
var _pluginInjectionApi$a3;
|
|
434
|
+
return pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions.attachAnalyticsEvent(payload);
|
|
435
|
+
}, [pluginInjectionApi]);
|
|
436
|
+
var displayGapCursor = useCallback(function (toggle) {
|
|
437
|
+
var _pluginInjectionApi$c3, _pluginInjectionApi$c4, _pluginInjectionApi$s2;
|
|
438
|
+
return (_pluginInjectionApi$c3 = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c4 = pluginInjectionApi.core) === null || _pluginInjectionApi$c4 === void 0 ? void 0 : _pluginInjectionApi$c4.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$s2 = pluginInjectionApi.selection) === null || _pluginInjectionApi$s2 === void 0 ? void 0 : _pluginInjectionApi$s2.commands.displayGapCursor(toggle))) !== null && _pluginInjectionApi$c3 !== void 0 ? _pluginInjectionApi$c3 : false;
|
|
439
|
+
}, [pluginInjectionApi]);
|
|
440
|
+
var isFullPageAppearance = !isCommentEditor && !isChromelessEditor;
|
|
441
|
+
var responsiveContainerWidth = 0;
|
|
442
|
+
var resizeHandleSpacing = 12;
|
|
443
|
+
var padding = getPadding(containerWidth);
|
|
444
|
+
// When Full width editor enabled, a Mac OS user can change "ak-editor-content-area" width by
|
|
445
|
+
// updating Settings -> Appearance -> Show scroll bars from "When scrolling" to "Always". It causes
|
|
446
|
+
// issues when viwport width is less than full width Editor's width. To detect avoid them
|
|
447
|
+
// we need to use lineLength to defined responsiveWidth instead of containerWidth
|
|
448
|
+
// (which does not get updated when Mac setting changes) in Full-width editor.
|
|
449
|
+
if (isFullWidthModeEnabled) {
|
|
450
|
+
// When: Show scroll bars -> containerWidth = akEditorGutterPadding * 2 + lineLength;
|
|
451
|
+
// When: Always -> containerWidth = akEditorGutterPadding * 2 + lineLength + scrollbarWidth;
|
|
452
|
+
// scrollbarWidth can vary. Values can be 14, 15, 16 and up to 20px;
|
|
453
|
+
responsiveContainerWidth = isTableScalingEnabled ? lineLength : containerWidth - padding * 2 - resizeHandleSpacing;
|
|
454
|
+
|
|
455
|
+
// platform_editor_table_fw_numcol_overflow_fix:
|
|
456
|
+
// lineLength is undefined on first paint → width: NaN → wrapper expands to page
|
|
457
|
+
// width. rAF col-sizing then runs before the number-column padding and
|
|
458
|
+
// the final shrink, so column widths are locked in wrong.
|
|
459
|
+
// With the flag ON, if the value isn’t finite we fall back to gutterWidth
|
|
460
|
+
// for that first frame—no flash, no premature rAF.
|
|
461
|
+
//
|
|
462
|
+
// Type clean-up comes later:
|
|
463
|
+
// 1) ship this runtime guard (quick fix, no breakage);
|
|
464
|
+
// 2) TODO: widen lineLength to `number|undefined` and remove this block.
|
|
465
|
+
if (fg('platform_editor_table_fw_numcol_overflow_fix')) {
|
|
466
|
+
if (isTableScalingEnabled && !Number.isFinite(responsiveContainerWidth)) {
|
|
467
|
+
responsiveContainerWidth = containerWidth - padding * 2 - resizeHandleSpacing;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
} else if (isCommentEditor) {
|
|
471
|
+
responsiveContainerWidth = containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR;
|
|
472
|
+
} else {
|
|
473
|
+
// 76 is currently an accepted padding value considering the spacing for resizer handle
|
|
474
|
+
// containerWidth = width of a DIV with test id="ak-editor-fp-content-area". It is a parent of
|
|
475
|
+
// a DIV with className="ak-editor-content-area". This DIV has padding left and padding right.
|
|
476
|
+
// padding left = padding right = akEditorGutterPadding = 32
|
|
477
|
+
responsiveContainerWidth = isTableScalingEnabled ? containerWidth - padding * 2 : containerWidth - padding * 2 - resizeHandleSpacing;
|
|
478
|
+
}
|
|
479
|
+
var width = !node.attrs.width && isCommentEditor ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
|
|
480
|
+
if (!isResizing) {
|
|
481
|
+
tableWidthRef.current = width;
|
|
482
|
+
}
|
|
483
|
+
var maxResizerWidth = isCommentEditor ? responsiveContainerWidth : Math.min(responsiveContainerWidth, TABLE_MAX_WIDTH);
|
|
484
|
+
|
|
485
|
+
// CSS solution for table resizer item width
|
|
486
|
+
// The `width` is used for .resizer-item in <TableResizer>, and it has to be a number
|
|
487
|
+
// So we can't use min(var(--ak-editor-table-width), ${tableWidth}px) here
|
|
488
|
+
// We get the correct width from CSS value on page load
|
|
489
|
+
// After window resize, we use the width from plugin state
|
|
490
|
+
// After table resize, the table width attribute is used
|
|
491
|
+
var tableResizerItemWidth = useMemo(function () {
|
|
492
|
+
// if not on full page editor, we just rely on the width calculated from plugin state
|
|
493
|
+
// if on full page editor and after window resize, we use the width from plugin state
|
|
494
|
+
if (!isFullPageAppearance || isFullPageAppearance && isWindowResized) {
|
|
495
|
+
return width;
|
|
496
|
+
}
|
|
497
|
+
if (isResizing) {
|
|
498
|
+
return tableWidth;
|
|
499
|
+
}
|
|
500
|
+
// if on full page editor and on page load, we use the computed value from CSS
|
|
501
|
+
return Math.min(tableWidth, tableMaxWidthForFullPageOnLoad);
|
|
502
|
+
}, [isWindowResized, isResizing, isFullPageAppearance, tableMaxWidthForFullPageOnLoad, tableWidth, width]);
|
|
503
|
+
|
|
504
|
+
// CSS Solution for table resizer container width
|
|
505
|
+
var tableResizerContainerWidth = useMemo(function () {
|
|
506
|
+
return getTableResizerContainerForFullPageWidthInCSS(node, isTableScalingEnabled);
|
|
507
|
+
}, [node, isTableScalingEnabled]);
|
|
508
|
+
|
|
509
|
+
// CSS Solution for table resizer max width
|
|
510
|
+
var tableResizerMaxWidth = React.useMemo(function () {
|
|
511
|
+
var isFullPageAppearance = !isCommentEditor && !isChromelessEditor;
|
|
512
|
+
var nonResizingMaxWidth = isFullPageAppearance ? getTableResizerContainerMaxWidthInCSS(isCommentEditor, isChromelessEditor, isTableScalingEnabled) : maxResizerWidth;
|
|
513
|
+
// isResizing is needed, otherwise we can't resize table.
|
|
514
|
+
// when not resizing, maxWidth is calculated based on the container width via CSS
|
|
515
|
+
return !isResizing ? nonResizingMaxWidth : maxResizerWidth;
|
|
516
|
+
}, [isCommentEditor, isChromelessEditor, isTableScalingEnabled, isResizing, maxResizerWidth]);
|
|
517
|
+
|
|
518
|
+
// on SSR, the width would be the default state, which is tableWidth
|
|
519
|
+
// but because we have maxWidth set to the editor container width via CSS
|
|
520
|
+
// So it would work just fine
|
|
521
|
+
useEffect(function () {
|
|
522
|
+
var _containerRef$current5;
|
|
523
|
+
if (!isSSR() && isFullPageAppearance && (_containerRef$current5 = containerRef.current) !== null && _containerRef$current5 !== void 0 && _containerRef$current5.firstElementChild) {
|
|
524
|
+
// get the computed value of max-width from '.resizer-item', because it uses `cqw` unit in CSS
|
|
525
|
+
var computedStyle = window.getComputedStyle(containerRef.current.firstElementChild);
|
|
526
|
+
var _containerWidth = computedStyle.maxWidth ? parseFloat(computedStyle.maxWidth) : tableWidth;
|
|
527
|
+
setTableMaxWidthForFullPageOnLoad(Math.min(_containerWidth, tableWidth));
|
|
528
|
+
}
|
|
529
|
+
}, [tableWidthRef, tableWidth, isFullPageAppearance]);
|
|
530
|
+
var tableResizerProps = {
|
|
531
|
+
width: tableResizerItemWidth,
|
|
532
|
+
maxWidth: tableResizerMaxWidth,
|
|
533
|
+
containerWidth: containerWidth,
|
|
534
|
+
lineLength: lineLength,
|
|
535
|
+
updateWidth: updateWidth,
|
|
536
|
+
editorView: editorView,
|
|
537
|
+
getPos: getPos,
|
|
538
|
+
node: node,
|
|
539
|
+
tableRef: tableRef,
|
|
540
|
+
displayGuideline: displayGuideline,
|
|
541
|
+
attachAnalyticsEvent: attachAnalyticsEvent,
|
|
542
|
+
displayGapCursor: displayGapCursor,
|
|
543
|
+
isTableAlignmentEnabled: isTableAlignmentEnabled,
|
|
544
|
+
isFullWidthModeEnabled: isFullWidthModeEnabled,
|
|
545
|
+
isTableScalingEnabled: isTableScalingEnabled,
|
|
546
|
+
isTableWithFixedColumnWidthsOptionEnabled: isTableWithFixedColumnWidthsOptionEnabled,
|
|
547
|
+
isWholeTableInDanger: isWholeTableInDanger,
|
|
548
|
+
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
|
|
549
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
550
|
+
onResizeStart: onResizeStart,
|
|
551
|
+
onResizeStop: onResizeStop,
|
|
552
|
+
isCommentEditor: isCommentEditor
|
|
553
|
+
};
|
|
554
|
+
var isLivePageViewMode = mode === 'view';
|
|
555
|
+
return /*#__PURE__*/React.createElement(AlignmentTableContainerWrapper, {
|
|
556
|
+
isTableAlignmentEnabled: isTableAlignmentEnabled,
|
|
557
|
+
node: node,
|
|
558
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
559
|
+
getPos: getPos,
|
|
560
|
+
editorView: editorView
|
|
561
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
562
|
+
style: {
|
|
563
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
564
|
+
'--ak-editor-table-gutter-padding': 'calc(var(--ak-editor--large-gutter-padding) * 2)',
|
|
565
|
+
'--ak-editor-table-width': isFullPageAppearance ? tableResizerContainerWidth : "".concat(tableWidthRef.current, "px"),
|
|
566
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
567
|
+
width: 'var(--ak-editor-table-width)',
|
|
568
|
+
height: resizing ? updateContainerHeight(tableWrapperHeight !== null && tableWrapperHeight !== void 0 ? tableWrapperHeight : 'auto') : 'auto',
|
|
569
|
+
position: isLivePageViewMode ? 'relative' : 'unset'
|
|
570
|
+
}
|
|
571
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
572
|
+
,
|
|
573
|
+
className: ClassName.TABLE_RESIZER_CONTAINER,
|
|
574
|
+
ref: containerRef
|
|
575
|
+
}, fg('platform_editor_live_page_prevent_table_recreation') ? null : isLivePageViewMode ? /*#__PURE__*/React.createElement(InnerContainer
|
|
576
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
577
|
+
, {
|
|
578
|
+
className: className,
|
|
579
|
+
node: node
|
|
580
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
581
|
+
,
|
|
582
|
+
style: {
|
|
583
|
+
width: 'inherit'
|
|
584
|
+
}
|
|
585
|
+
}, children) :
|
|
586
|
+
/*#__PURE__*/
|
|
587
|
+
// Ignored via go/ees005
|
|
588
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
589
|
+
React.createElement(TableResizer, tableResizerProps, /*#__PURE__*/React.createElement(InnerContainer, {
|
|
590
|
+
className: className,
|
|
591
|
+
node: node
|
|
592
|
+
}, children)), fg('platform_editor_live_page_prevent_table_recreation') ?
|
|
593
|
+
/*#__PURE__*/
|
|
594
|
+
// Ignored via go/ees005
|
|
595
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
596
|
+
React.createElement(TableResizer, _extends({}, tableResizerProps, {
|
|
597
|
+
disabled: isLivePageViewMode
|
|
598
|
+
}), /*#__PURE__*/React.createElement(InnerContainer, {
|
|
599
|
+
className: className,
|
|
600
|
+
node: node
|
|
601
|
+
}, children)) : null));
|
|
602
|
+
});
|
|
603
|
+
export var ResizableTableContainer = componentWithCondition(function () {
|
|
604
|
+
return expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true);
|
|
605
|
+
}, ResizableTableContainerNext, ResizableTableContainerLegacy);
|
|
606
|
+
export var TableContainer = function TableContainer(_ref6) {
|
|
607
|
+
var children = _ref6.children,
|
|
608
|
+
node = _ref6.node,
|
|
609
|
+
className = _ref6.className,
|
|
610
|
+
_ref6$containerWidth = _ref6.containerWidth,
|
|
611
|
+
editorWidth = _ref6$containerWidth.width,
|
|
612
|
+
lineLength = _ref6$containerWidth.lineLength,
|
|
613
|
+
editorView = _ref6.editorView,
|
|
614
|
+
getPos = _ref6.getPos,
|
|
615
|
+
tableRef = _ref6.tableRef,
|
|
616
|
+
isNested = _ref6.isNested,
|
|
617
|
+
tableWrapperHeight = _ref6.tableWrapperHeight,
|
|
618
|
+
isResizing = _ref6.isResizing,
|
|
619
|
+
isWindowResized = _ref6.isWindowResized,
|
|
620
|
+
pluginInjectionApi = _ref6.pluginInjectionApi,
|
|
621
|
+
isWholeTableInDanger = _ref6.isWholeTableInDanger,
|
|
622
|
+
isTableResizingEnabled = _ref6.isTableResizingEnabled,
|
|
623
|
+
isTableScalingEnabled = _ref6.isTableScalingEnabled,
|
|
624
|
+
isTableWithFixedColumnWidthsOptionEnabled = _ref6.isTableWithFixedColumnWidthsOptionEnabled,
|
|
625
|
+
isTableAlignmentEnabled = _ref6.isTableAlignmentEnabled,
|
|
626
|
+
shouldUseIncreasedScalingPercent = _ref6.shouldUseIncreasedScalingPercent,
|
|
627
|
+
isCommentEditor = _ref6.isCommentEditor,
|
|
628
|
+
isChromelessEditor = _ref6.isChromelessEditor;
|
|
371
629
|
if (isTableResizingEnabled && !isNested) {
|
|
372
630
|
return /*#__PURE__*/React.createElement(ResizableTableContainer
|
|
373
631
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -387,13 +645,15 @@ export var TableContainer = function TableContainer(_ref5) {
|
|
|
387
645
|
tableRef: tableRef,
|
|
388
646
|
tableWrapperHeight: tableWrapperHeight,
|
|
389
647
|
isResizing: isResizing,
|
|
648
|
+
isWindowResized: isWindowResized,
|
|
390
649
|
pluginInjectionApi: pluginInjectionApi,
|
|
391
650
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
392
651
|
isTableWithFixedColumnWidthsOptionEnabled: isTableWithFixedColumnWidthsOptionEnabled,
|
|
393
652
|
isWholeTableInDanger: isWholeTableInDanger,
|
|
394
653
|
isTableAlignmentEnabled: isTableAlignmentEnabled,
|
|
395
654
|
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
|
|
396
|
-
isCommentEditor: isCommentEditor
|
|
655
|
+
isCommentEditor: isCommentEditor,
|
|
656
|
+
isChromelessEditor: isChromelessEditor
|
|
397
657
|
}, children);
|
|
398
658
|
}
|
|
399
659
|
var _getPluginState = getPluginState(editorView.state),
|
|
@@ -397,8 +397,15 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
397
397
|
}, [editorView, getPos, node, isCommentEditor, widthToWidest, endMeasure, displayGapCursor, displayGuideline, updateWidth, scheduleResize, onResizeStop, attachAnalyticsEvent, tableRef, pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent, formatMessage]);
|
|
398
398
|
var handleTableSizeChangeOnKeypress = useCallback(function (step) {
|
|
399
399
|
var newWidth = width + step;
|
|
400
|
-
if (
|
|
401
|
-
|
|
400
|
+
if (expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true)) {
|
|
401
|
+
if (newWidth < resizerMinWidth) {
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
} else {
|
|
405
|
+
// maxWidth when platform_editor_tables_scaling_css off is always a number
|
|
406
|
+
if (newWidth > maxWidth || newWidth < resizerMinWidth) {
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
402
409
|
}
|
|
403
410
|
handleResizeStop({
|
|
404
411
|
width: width,
|
|
@@ -82,10 +82,17 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
82
82
|
return _createClass(TableView, [{
|
|
83
83
|
key: "getContentDOM",
|
|
84
84
|
value: function getContentDOM() {
|
|
85
|
+
var _this$reactComponentP, _this$reactComponentP2, _this$reactComponentP3, _this$reactComponentP4;
|
|
86
|
+
var isNested = isTableNested(this.view.state, this.getPos());
|
|
85
87
|
var tableDOMStructure = tableNodeSpecWithFixedToDOM({
|
|
86
88
|
allowColumnResizing: !!this.reactComponentProps.allowColumnResizing,
|
|
87
89
|
tableResizingEnabled: !!this.reactComponentProps.allowTableResizing,
|
|
88
|
-
getEditorContainerWidth: this.reactComponentProps.getEditorContainerWidth
|
|
90
|
+
getEditorContainerWidth: this.reactComponentProps.getEditorContainerWidth,
|
|
91
|
+
isTableScalingEnabled: (_this$reactComponentP = this.reactComponentProps.options) === null || _this$reactComponentP === void 0 ? void 0 : _this$reactComponentP.isTableScalingEnabled,
|
|
92
|
+
shouldUseIncreasedScalingPercent: (_this$reactComponentP2 = this.reactComponentProps.options) === null || _this$reactComponentP2 === void 0 ? void 0 : _this$reactComponentP2.shouldUseIncreasedScalingPercent,
|
|
93
|
+
isCommentEditor: (_this$reactComponentP3 = this.reactComponentProps.options) === null || _this$reactComponentP3 === void 0 ? void 0 : _this$reactComponentP3.isCommentEditor,
|
|
94
|
+
isChromelessEditor: (_this$reactComponentP4 = this.reactComponentProps.options) === null || _this$reactComponentP4 === void 0 ? void 0 : _this$reactComponentP4.isChromelessEditor,
|
|
95
|
+
isNested: isNested
|
|
89
96
|
}).toDOM(this.node);
|
|
90
97
|
var rendered = DOMSerializer.renderSpec(document, tableDOMStructure);
|
|
91
98
|
if (rendered.dom) {
|
|
@@ -403,6 +410,8 @@ export var createTableView = function createTableView(node, view, getPos, portal
|
|
|
403
410
|
allowControls = _getPluginConfig.allowControls,
|
|
404
411
|
allowTableResizing = _getPluginConfig.allowTableResizing,
|
|
405
412
|
allowTableAlignment = _getPluginConfig.allowTableAlignment;
|
|
413
|
+
var isTableFixedColumnWidthsOptionEnabled = (getEditorFeatureFlags === null || getEditorFeatureFlags === void 0 ? void 0 : getEditorFeatureFlags().tableWithFixedColumnWidthsOption) || false;
|
|
414
|
+
var shouldUseIncreasedScalingPercent = isTableScalingEnabled && (isTableFixedColumnWidthsOptionEnabled || isCommentEditor);
|
|
406
415
|
return new TableView({
|
|
407
416
|
node: node,
|
|
408
417
|
view: view,
|
|
@@ -420,7 +429,8 @@ export var createTableView = function createTableView(node, view, getPos, portal
|
|
|
420
429
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
421
430
|
// same as options.isTableScalingEnabled
|
|
422
431
|
isCommentEditor: isCommentEditor,
|
|
423
|
-
isChromelessEditor: isChromelessEditor
|
|
432
|
+
isChromelessEditor: isChromelessEditor,
|
|
433
|
+
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent
|
|
424
434
|
},
|
|
425
435
|
getEditorContainerWidth: getEditorContainerWidth,
|
|
426
436
|
getEditorFeatureFlags: getEditorFeatureFlags,
|
|
@@ -8,13 +8,15 @@ import { table, tableWithNestedTable } from '@atlaskit/adf-schema';
|
|
|
8
8
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
9
9
|
import { akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
|
|
10
10
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
|
-
import { generateColgroup, getResizerMinWidth } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
11
|
+
import { generateColgroup, generateColgroupFromNode, getResizerMinWidth } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
12
12
|
import { TABLE_MAX_WIDTH } from '../pm-plugins/table-resizing/utils/consts';
|
|
13
|
+
import { getTableResizerContainerMaxWidthInCSS, getTableResizerContainerForFullPageWidthInCSS, getTableResizerItemWidthInCSS } from '../pm-plugins/table-resizing/utils/misc';
|
|
13
14
|
import { getAlignmentStyle } from './table-container-styles';
|
|
14
15
|
export var tableNodeSpecWithFixedToDOM = function tableNodeSpecWithFixedToDOM(config) {
|
|
15
16
|
var tableNode = config.isNestingSupported ? tableWithNestedTable : table;
|
|
16
17
|
return _objectSpread(_objectSpread({}, tableNode), {}, {
|
|
17
18
|
toDOM: function toDOM(node) {
|
|
19
|
+
var _node$attrs$width;
|
|
18
20
|
var gutterPadding = function gutterPadding() {
|
|
19
21
|
if (expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true)) {
|
|
20
22
|
return 'calc(var(--ak-editor--large-gutter-padding) * 2)';
|
|
@@ -29,6 +31,8 @@ export var tableNodeSpecWithFixedToDOM = function tableNodeSpecWithFixedToDOM(co
|
|
|
29
31
|
return "".concat(kebabCase(k), ": ").concat(kebabCase(v));
|
|
30
32
|
}).join(';');
|
|
31
33
|
var tableMinWidth = getResizerMinWidth(node);
|
|
34
|
+
var tableWidthAttribute = node.attrs.width ? "".concat(node.attrs.width, "px") : "100%";
|
|
35
|
+
var isFullPageEditor = !config.isChromelessEditor && !config.isCommentEditor;
|
|
32
36
|
var attrs = {
|
|
33
37
|
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
34
38
|
'data-layout': node.attrs.layout,
|
|
@@ -36,10 +40,20 @@ export var tableNodeSpecWithFixedToDOM = function tableNodeSpecWithFixedToDOM(co
|
|
|
36
40
|
'data-table-local-id': node.attrs.localId,
|
|
37
41
|
'data-table-width': node.attrs.width
|
|
38
42
|
};
|
|
43
|
+
|
|
44
|
+
// This would be used for table scaling in colgroup CSS
|
|
45
|
+
// cqw, or px is well supported
|
|
46
|
+
var resizableTableWidth = expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true) ? isFullPageEditor ? getTableResizerContainerForFullPageWidthInCSS(node, config.isTableScalingEnabled) : "calc(100cqw - calc(var(--ak-editor--large-gutter-padding) * 2))" : "min(calc(100cqw - calc(var(--ak-editor--large-gutter-padding) * 2)), ".concat((_node$attrs$width = node.attrs.width) !== null && _node$attrs$width !== void 0 ? _node$attrs$width : '100%', ")");
|
|
39
47
|
var colgroup = '';
|
|
40
48
|
if (config.allowColumnResizing) {
|
|
41
|
-
|
|
49
|
+
if (expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true)) {
|
|
50
|
+
colgroup = ['colgroup', {}].concat(_toConsumableArray(generateColgroupFromNode(node, config.isCommentEditor, config.isChromelessEditor, config.isNested, config.isTableScalingEnabled, config.shouldUseIncreasedScalingPercent)));
|
|
51
|
+
} else {
|
|
52
|
+
colgroup = ['colgroup', {}].concat(_toConsumableArray(generateColgroup(node)));
|
|
53
|
+
}
|
|
42
54
|
}
|
|
55
|
+
|
|
56
|
+
// For Chromeless editor, and nested tables in full page editor
|
|
43
57
|
var tableContainerDiv = ['div', {
|
|
44
58
|
class: 'pm-table-container',
|
|
45
59
|
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
@@ -66,31 +80,33 @@ export var tableNodeSpecWithFixedToDOM = function tableNodeSpecWithFixedToDOM(co
|
|
|
66
80
|
class: 'pm-table-sticky-sentinel-bottom',
|
|
67
81
|
'data-testid': 'sticky-sentinel-bottom'
|
|
68
82
|
}]];
|
|
69
|
-
if (!config.tableResizingEnabled) {
|
|
83
|
+
if (!config.tableResizingEnabled || expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true) && config.isNested) {
|
|
70
84
|
return ['div', {
|
|
71
85
|
class: 'tableView-content-wrap',
|
|
72
86
|
'data-prosemirror-initial-toDOM-render': 'true'
|
|
73
87
|
}, tableContainerDiv];
|
|
74
88
|
}
|
|
75
|
-
var tableWidthAttribute = node.attrs.width ? "".concat(node.attrs.width, "px") : "100%";
|
|
76
89
|
var tableResizingDiv = ['div', {
|
|
77
90
|
'data-testid': 'table-alignment-container',
|
|
78
91
|
style: alignmentStyle
|
|
79
92
|
}, ['div', {
|
|
80
93
|
class: 'pm-table-resizer-container',
|
|
81
|
-
style:
|
|
94
|
+
style: convertToInlineCss({
|
|
95
|
+
'--ak-editor-table-gutter-padding': config.isTableScalingEnabled ? 'calc(var(--ak-editor--large-gutter-padding) * 2)' : 'calc(var(--ak-editor--large-gutter-padding) * 2 - var(--ak-editor-resizer-handle-spacing))',
|
|
96
|
+
'--ak-editor-table-width': resizableTableWidth,
|
|
97
|
+
width: expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true) ? "var(--ak-editor-table-width)" : "min(calc(100cqw - ".concat(gutterPadding(), "), ").concat(tableWidthAttribute, ")")
|
|
98
|
+
})
|
|
82
99
|
}, ['div', {
|
|
83
100
|
class: 'resizer-item display-handle',
|
|
84
101
|
style: convertToInlineCss({
|
|
85
102
|
position: 'relative',
|
|
86
103
|
userSelect: 'auto',
|
|
87
104
|
boxSizing: 'border-box',
|
|
88
|
-
'--ak-editor-table-gutter-padding': "".concat(gutterPadding()),
|
|
89
105
|
'--ak-editor-table-max-width': "".concat(TABLE_MAX_WIDTH, "px"),
|
|
90
106
|
'--ak-editor-table-min-width': "".concat(tableMinWidth, "px"),
|
|
91
107
|
minWidth: 'var(--ak-editor-table-min-width)',
|
|
92
|
-
maxWidth: "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), var(--ak-editor-table-max-width))",
|
|
93
|
-
width: "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ".concat(tableWidthAttribute, ")")
|
|
108
|
+
maxWidth: expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true) ? getTableResizerContainerMaxWidthInCSS(config.isCommentEditor, config.isChromelessEditor, config.isTableScalingEnabled) : "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), var(--ak-editor-table-max-width))",
|
|
109
|
+
width: expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true) ? getTableResizerItemWidthInCSS(node, config.isCommentEditor, config.isChromelessEditor) : "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ".concat(tableWidthAttribute, ")")
|
|
94
110
|
})
|
|
95
111
|
}, ['span', {
|
|
96
112
|
class: 'resizer-hover-zone'
|
|
@@ -10,6 +10,7 @@ import { findParentDomRefOfType, findParentNodeOfType } from '@atlaskit/editor-p
|
|
|
10
10
|
import { TableMap } from '@atlaskit/editor-tables';
|
|
11
11
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
14
|
import { tableCellView, tableHeaderView, tableRowView, tableView } from '../nodeviews/table-node-views';
|
|
14
15
|
import { pluginKey as decorationsPluginKey } from '../pm-plugins/decorations/plugin';
|
|
15
16
|
import { TableCssClassName as ClassName } from '../types';
|
|
@@ -52,30 +53,63 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
52
53
|
}
|
|
53
54
|
return editorView.state;
|
|
54
55
|
};
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
56
|
+
var getNodeView = function getNodeView() {
|
|
57
|
+
// Because the layout shift issues has been fixed under experiment platform_editor_tables_scaling_css, so still want to load nodeview on SSR if experiment is enabled
|
|
58
|
+
if (expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true)) {
|
|
59
|
+
return {
|
|
60
|
+
table: tableView({
|
|
61
|
+
portalProviderAPI: portalProviderAPI,
|
|
62
|
+
eventDispatcher: eventDispatcher,
|
|
63
|
+
getEditorContainerWidth: getEditorContainerWidth,
|
|
64
|
+
getEditorFeatureFlags: getEditorFeatureFlags,
|
|
65
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
66
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
67
|
+
isCommentEditor: isCommentEditor,
|
|
68
|
+
isChromelessEditor: isChromelessEditor
|
|
69
|
+
}),
|
|
70
|
+
tableRow: tableRowView({
|
|
71
|
+
eventDispatcher: eventDispatcher,
|
|
72
|
+
pluginInjectionApi: pluginInjectionApi
|
|
73
|
+
}),
|
|
74
|
+
tableCell: tableCellView({
|
|
75
|
+
eventDispatcher: eventDispatcher,
|
|
76
|
+
pluginInjectionApi: pluginInjectionApi
|
|
77
|
+
}),
|
|
78
|
+
tableHeader: tableHeaderView({
|
|
79
|
+
eventDispatcher: eventDispatcher,
|
|
80
|
+
pluginInjectionApi: pluginInjectionApi
|
|
81
|
+
})
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
if (isSSR() && fg('platform_editor_table_fallback_to_dom_on_ssr')) {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
table: tableView({
|
|
89
|
+
portalProviderAPI: portalProviderAPI,
|
|
90
|
+
eventDispatcher: eventDispatcher,
|
|
91
|
+
getEditorContainerWidth: getEditorContainerWidth,
|
|
92
|
+
getEditorFeatureFlags: getEditorFeatureFlags,
|
|
93
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
94
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
95
|
+
isCommentEditor: isCommentEditor,
|
|
96
|
+
isChromelessEditor: isChromelessEditor
|
|
97
|
+
}),
|
|
98
|
+
tableRow: tableRowView({
|
|
99
|
+
eventDispatcher: eventDispatcher,
|
|
100
|
+
pluginInjectionApi: pluginInjectionApi
|
|
101
|
+
}),
|
|
102
|
+
tableCell: tableCellView({
|
|
103
|
+
eventDispatcher: eventDispatcher,
|
|
104
|
+
pluginInjectionApi: pluginInjectionApi
|
|
105
|
+
}),
|
|
106
|
+
tableHeader: tableHeaderView({
|
|
107
|
+
eventDispatcher: eventDispatcher,
|
|
108
|
+
pluginInjectionApi: pluginInjectionApi
|
|
109
|
+
})
|
|
110
|
+
};
|
|
78
111
|
};
|
|
112
|
+
var nodeViews = getNodeView();
|
|
79
113
|
return new SafePlugin({
|
|
80
114
|
state: state,
|
|
81
115
|
key: pluginKey,
|