@atlaskit/editor-plugin-table 7.25.17 → 7.25.19
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 +18 -0
- package/dist/cjs/nodeviews/TableResizer.js +12 -12
- package/dist/cjs/plugin.js +10 -6
- package/dist/cjs/pm-plugins/drag-and-drop/utils/getDragBehaviour.js +2 -2
- package/dist/cjs/ui/DragHandle/index.js +8 -8
- package/dist/cjs/ui/TableFloatingControls/index.js +5 -5
- package/dist/cjs/ui/common-styles.js +2 -2
- package/dist/cjs/ui/global-styles.js +23 -0
- package/dist/es2019/nodeviews/TableResizer.js +1 -1
- package/dist/es2019/plugin.js +6 -2
- package/dist/es2019/pm-plugins/drag-and-drop/utils/getDragBehaviour.js +1 -1
- package/dist/es2019/ui/DragHandle/index.js +1 -1
- package/dist/es2019/ui/TableFloatingControls/index.js +1 -1
- package/dist/es2019/ui/common-styles.js +1 -1
- package/dist/es2019/ui/global-styles.js +17 -0
- package/dist/esm/nodeviews/TableResizer.js +1 -1
- package/dist/esm/plugin.js +6 -2
- package/dist/esm/pm-plugins/drag-and-drop/utils/getDragBehaviour.js +1 -1
- package/dist/esm/ui/DragHandle/index.js +1 -1
- package/dist/esm/ui/TableFloatingControls/index.js +1 -1
- package/dist/esm/ui/common-styles.js +1 -1
- package/dist/esm/ui/global-styles.js +16 -0
- package/dist/types/ui/global-styles.d.ts +9 -0
- package/dist/types-ts4.5/ui/global-styles.d.ts +9 -0
- package/package.json +5 -2
- package/src/nodeviews/TableResizer.tsx +1 -1
- package/src/plugin.tsx +3 -1
- package/src/pm-plugins/drag-and-drop/utils/getDragBehaviour.ts +1 -1
- package/src/ui/DragHandle/index.tsx +1 -1
- package/src/ui/TableFloatingControls/index.tsx +1 -1
- package/src/ui/common-styles.ts +1 -1
- package/src/ui/global-styles.tsx +21 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.25.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#136485](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136485)
|
|
8
|
+
[`96d4b8a73c2ea`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/96d4b8a73c2ea) -
|
|
9
|
+
Refactored table styles so that it is inside the tables plugin and not in the editors critical
|
|
10
|
+
path.
|
|
11
|
+
|
|
12
|
+
## 7.25.18
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#136348](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136348)
|
|
17
|
+
[`fb4fb56f1da7c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fb4fb56f1da7c) -
|
|
18
|
+
Use optimised entry-points on editor-common for browser.
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 7.25.17
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -12,20 +12,20 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
13
13
|
var _reactIntlNext = require("react-intl-next");
|
|
14
14
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
15
|
+
var _browser = require("@atlaskit/editor-common/browser");
|
|
15
16
|
var _guideline = require("@atlaskit/editor-common/guideline");
|
|
16
17
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
17
18
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
18
19
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
19
20
|
var _monitoring = require("@atlaskit/editor-common/monitoring");
|
|
20
21
|
var _resizer = require("@atlaskit/editor-common/resizer");
|
|
21
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
22
22
|
var _commands = require("@atlaskit/editor-prosemirror/commands");
|
|
23
23
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
24
|
-
var
|
|
24
|
+
var _utils = require("@atlaskit/editor-tables/utils");
|
|
25
25
|
var _commandsWithAnalytics = require("../commands-with-analytics");
|
|
26
26
|
var _misc = require("../commands/misc");
|
|
27
27
|
var _tableAnalytics = require("../pm-plugins/table-analytics");
|
|
28
|
-
var
|
|
28
|
+
var _utils2 = require("../pm-plugins/table-resizing/utils");
|
|
29
29
|
var _tableWidth = require("../pm-plugins/table-width");
|
|
30
30
|
var _consts = require("../ui/consts");
|
|
31
31
|
var _alignment = require("../utils/alignment");
|
|
@@ -67,8 +67,8 @@ var getResizerHandleHeight = function getResizerHandleHeight(tableRef) {
|
|
|
67
67
|
return 'small';
|
|
68
68
|
};
|
|
69
69
|
var getResizerMinWidth = function getResizerMinWidth(node) {
|
|
70
|
-
var currentColumnCount = (0,
|
|
71
|
-
var minColumnWidth = Math.min(3, currentColumnCount) *
|
|
70
|
+
var currentColumnCount = (0, _utils2.getColgroupChildrenLength)(node);
|
|
71
|
+
var minColumnWidth = Math.min(3, currentColumnCount) * _utils2.COLUMN_MIN_WIDTH;
|
|
72
72
|
// add an extra pixel as the scale table logic will scale columns to be tableContainerWidth - 1
|
|
73
73
|
// the table can't scale past its min-width, so instead restrict table container min width to avoid that situation
|
|
74
74
|
return minColumnWidth + 1;
|
|
@@ -146,7 +146,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
146
146
|
formatMessage = _useIntl.formatMessage;
|
|
147
147
|
var currentSelection = (_editorView$state = editorView.state) === null || _editorView$state === void 0 ? void 0 : _editorView$state.selection;
|
|
148
148
|
var tableFromSelection = (0, _react.useMemo)(function () {
|
|
149
|
-
return (0,
|
|
149
|
+
return (0, _utils.findTable)(currentSelection);
|
|
150
150
|
}, [currentSelection]);
|
|
151
151
|
var tableFromSelectionPosition = tableFromSelection === null || tableFromSelection === void 0 ? void 0 : tableFromSelection.pos;
|
|
152
152
|
var isTableSelected = (0, _react.useMemo)(function () {
|
|
@@ -260,7 +260,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
260
260
|
if (typeof pos !== 'number') {
|
|
261
261
|
return;
|
|
262
262
|
}
|
|
263
|
-
(0,
|
|
263
|
+
(0, _utils2.previewScaleTable)(tableRef, {
|
|
264
264
|
node: node,
|
|
265
265
|
prevNode: node,
|
|
266
266
|
start: pos + 1,
|
|
@@ -278,7 +278,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
278
278
|
return guideline.isFullWidth;
|
|
279
279
|
})[0];
|
|
280
280
|
var isFullWidthGuidelineActive = closestSnap.keys.includes(fullWidthGuideline.key);
|
|
281
|
-
var tableMaxWidth = isCommentEditor ? containerWidth -
|
|
281
|
+
var tableMaxWidth = isCommentEditor ? containerWidth - _utils2.TABLE_OFFSET_IN_COMMENT_EDITOR : _utils2.TABLE_MAX_WIDTH;
|
|
282
282
|
var shouldUpdateWidthToWidest = isCommentEditor && tableMaxWidth === newWidth || !!isTableScalingEnabled && isFullWidthGuidelineActive;
|
|
283
283
|
(0, _commands.chainCommands)(function (state, dispatch) {
|
|
284
284
|
return switchToCenterAlignment(pos, node, newWidth, state, dispatch);
|
|
@@ -298,7 +298,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
298
298
|
var pos = getPos();
|
|
299
299
|
var currentTableNodeLocalId = (_node$attrs$localId2 = node === null || node === void 0 || (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.localId) !== null && _node$attrs$localId2 !== void 0 ? _node$attrs$localId2 : '';
|
|
300
300
|
var tableMaxWidth = isCommentEditor ? undefined // Table's full-width in comment appearance inherit the width of the Editor/Renderer
|
|
301
|
-
:
|
|
301
|
+
: _utils2.TABLE_MAX_WIDTH;
|
|
302
302
|
newWidth = widthToWidest && currentTableNodeLocalId && widthToWidest[currentTableNodeLocalId] ? tableMaxWidth : newWidth;
|
|
303
303
|
var tr = state.tr.setMeta(_tableWidth.pluginKey, {
|
|
304
304
|
resizing: false,
|
|
@@ -324,7 +324,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
324
324
|
width: newWidth
|
|
325
325
|
}));
|
|
326
326
|
var newNode = tr.doc.nodeAt(pos);
|
|
327
|
-
tr = (0,
|
|
327
|
+
tr = (0, _utils2.scaleTable)(tableRef, {
|
|
328
328
|
node: newNode,
|
|
329
329
|
prevNode: node,
|
|
330
330
|
start: pos + 1,
|
|
@@ -379,7 +379,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
379
379
|
}, [editorView]);
|
|
380
380
|
var handleKeyDown = (0, _react.useCallback)(function (event) {
|
|
381
381
|
var isBracketKey = event.code === 'BracketRight' || event.code === 'BracketLeft';
|
|
382
|
-
var metaKey =
|
|
382
|
+
var metaKey = _browser.browser.mac ? event.metaKey : event.ctrlKey;
|
|
383
383
|
if (event.altKey || metaKey || event.shiftKey) {
|
|
384
384
|
areResizeMetaKeysPressed.current = true;
|
|
385
385
|
}
|
|
@@ -404,7 +404,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
404
404
|
}
|
|
405
405
|
var resizeHandleThumbEl = resizerRef.current.getResizerThumbEl();
|
|
406
406
|
var globalKeyDownHandler = function globalKeyDownHandler(event) {
|
|
407
|
-
var metaKey =
|
|
407
|
+
var metaKey = _browser.browser.mac ? event.metaKey : event.ctrlKey;
|
|
408
408
|
if (!isTableSelected) {
|
|
409
409
|
return;
|
|
410
410
|
}
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -9,12 +9,12 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
11
11
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
12
|
+
var _browser = require("@atlaskit/editor-common/browser");
|
|
12
13
|
var _errorBoundary = require("@atlaskit/editor-common/error-boundary");
|
|
13
14
|
var _icons = require("@atlaskit/editor-common/icons");
|
|
14
15
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
15
16
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
16
17
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
17
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
18
18
|
var _withPluginState = require("@atlaskit/editor-common/with-plugin-state");
|
|
19
19
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
20
20
|
var _pmPlugins = require("@atlaskit/editor-tables/pm-plugins");
|
|
@@ -45,8 +45,9 @@ var _FloatingDeleteButton = _interopRequireDefault(require("./ui/FloatingDeleteB
|
|
|
45
45
|
var _FloatingDragMenu = _interopRequireDefault(require("./ui/FloatingDragMenu"));
|
|
46
46
|
var _FloatingInsertButton = _interopRequireDefault(require("./ui/FloatingInsertButton"));
|
|
47
47
|
var _FloatingToolbarLabel = require("./ui/FloatingToolbarLabel/FloatingToolbarLabel");
|
|
48
|
+
var _globalStyles = require("./ui/global-styles");
|
|
48
49
|
var _TableFullWidthLabel = require("./ui/TableFullWidthLabel");
|
|
49
|
-
var
|
|
50
|
+
var _utils = require("./utils");
|
|
50
51
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
51
52
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
52
53
|
var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
|
|
@@ -112,7 +113,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
112
113
|
insertTable: function insertTable(analyticsPayload) {
|
|
113
114
|
return function (state, dispatch) {
|
|
114
115
|
var _api$contentInsertion, _api$contentInsertion2;
|
|
115
|
-
var node = (0,
|
|
116
|
+
var node = (0, _utils.createTableWithWidth)({
|
|
116
117
|
isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
|
|
117
118
|
isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled,
|
|
118
119
|
isFullWidthModeEnabled: options === null || options === void 0 ? void 0 : options.fullWidthEnabled,
|
|
@@ -324,7 +325,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
324
325
|
|
|
325
326
|
// Workaround for table element breaking issue caused by composition event with an inputType of deleteCompositionText.
|
|
326
327
|
// https://github.com/ProseMirror/prosemirror/issues/934
|
|
327
|
-
if (
|
|
328
|
+
if (_browser.browser.safari) {
|
|
328
329
|
plugins.push({
|
|
329
330
|
name: 'tableSafariDeleteCompositionTextIssueWorkaround',
|
|
330
331
|
plugin: function plugin() {
|
|
@@ -335,6 +336,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
335
336
|
return plugins;
|
|
336
337
|
},
|
|
337
338
|
contentComponent: function contentComponent(_ref17) {
|
|
339
|
+
var _api$featureFlags;
|
|
338
340
|
var editorView = _ref17.editorView,
|
|
339
341
|
popupsMountPoint = _ref17.popupsMountPoint,
|
|
340
342
|
popupsBoundariesElement = _ref17.popupsBoundariesElement,
|
|
@@ -344,7 +346,9 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
344
346
|
component: _analytics.ACTION_SUBJECT.TABLES_PLUGIN,
|
|
345
347
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
346
348
|
fallbackComponent: null
|
|
347
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
349
|
+
}, /*#__PURE__*/_react.default.createElement(_globalStyles.GlobalStylesWrapper, {
|
|
350
|
+
featureFlags: api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()
|
|
351
|
+
}), /*#__PURE__*/_react.default.createElement(_withPluginState.WithPluginState, {
|
|
348
352
|
plugins: {
|
|
349
353
|
tableAnalyticsPluginState: _pluginKey.pluginKey,
|
|
350
354
|
tablePluginState: _pluginKey2.pluginKey,
|
|
@@ -487,7 +491,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
487
491
|
var _api$table;
|
|
488
492
|
// see comment on tablesPlugin.getSharedState on usage
|
|
489
493
|
var tableState = api === null || api === void 0 || (_api$table = api.table) === null || _api$table === void 0 ? void 0 : _api$table.sharedState.currentState();
|
|
490
|
-
var tableNode = (0,
|
|
494
|
+
var tableNode = (0, _utils.createTableWithWidth)({
|
|
491
495
|
isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
|
|
492
496
|
isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled,
|
|
493
497
|
isFullWidthModeEnabled: tableState === null || tableState === void 0 ? void 0 : tableState.isFullWidthModeEnabled,
|
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getDragBehaviour = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _browser = require("@atlaskit/editor-common/browser");
|
|
8
8
|
var getDragBehaviour = exports.getDragBehaviour = function getDragBehaviour(_ref) {
|
|
9
9
|
var altKey = _ref.altKey,
|
|
10
10
|
ctrlKey = _ref.ctrlKey;
|
|
11
|
-
var isCloneModifierKeyPressed =
|
|
11
|
+
var isCloneModifierKeyPressed = _browser.browser.mac ? altKey : ctrlKey;
|
|
12
12
|
return isCloneModifierKeyPressed ? 'clone' : 'move';
|
|
13
13
|
};
|
|
@@ -12,8 +12,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
13
13
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
14
14
|
var _reactIntlNext = require("react-intl-next");
|
|
15
|
+
var _browser = require("@atlaskit/editor-common/browser");
|
|
15
16
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
16
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
17
17
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
18
18
|
var _editorTables = require("@atlaskit/editor-tables");
|
|
19
19
|
var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
@@ -21,7 +21,7 @@ var _setCustomNativeDragPreview = require("@atlaskit/pragmatic-drag-and-drop/ele
|
|
|
21
21
|
var _pluginFactory = require("../../pm-plugins/drag-and-drop/plugin-factory");
|
|
22
22
|
var _pluginFactory2 = require("../../pm-plugins/plugin-factory");
|
|
23
23
|
var _types = require("../../types");
|
|
24
|
-
var
|
|
24
|
+
var _utils = require("../../utils");
|
|
25
25
|
var _consts = require("../consts");
|
|
26
26
|
var _DragPreview = require("../DragPreview");
|
|
27
27
|
var _HandleIconComponent = require("./HandleIconComponent");
|
|
@@ -82,8 +82,8 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
82
82
|
if (hoveredCell && hoveredCell.rowIndex !== undefined && hoveredCell.colIndex !== undefined && selection instanceof _state.TextSelection) {
|
|
83
83
|
var rowIndex = hoveredCell.rowIndex,
|
|
84
84
|
colIndex = hoveredCell.colIndex;
|
|
85
|
-
var mergedPositionInRow = (0,
|
|
86
|
-
var mergedPositionInCol = (0,
|
|
85
|
+
var mergedPositionInRow = (0, _utils.findDuplicatePosition)(mapByRow[rowIndex]);
|
|
86
|
+
var mergedPositionInCol = (0, _utils.findDuplicatePosition)(mapByColumn[colIndex]);
|
|
87
87
|
var hasMergedCellsInFirstRowOrColumn = direction === 'column' ? mergedPositionInRow.includes(mapByRow[0][colIndex]) : mergedPositionInCol.includes(mapByColumn[0][rowIndex]);
|
|
88
88
|
var isHoveredOnFirstRowOrColumn = direction === 'column' ? hoveredCell.rowIndex === 0 && hasMergedCellsInFirstRowOrColumn : hoveredCell.colIndex === 0 && hasMergedCellsInFirstRowOrColumn;
|
|
89
89
|
if (isHoveredOnFirstRowOrColumn) {
|
|
@@ -92,11 +92,11 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
92
92
|
}).length : mapByColumn[0].filter(function (el) {
|
|
93
93
|
return el === mapByColumn[0][rowIndex];
|
|
94
94
|
}).length;
|
|
95
|
-
var mergedSelection = (0,
|
|
95
|
+
var mergedSelection = (0, _utils.hasMergedCellsInSelection)(direction === 'column' ? [colIndex, colIndex + mergedSizes - 1] : [rowIndex, rowIndex + mergedSizes - 1], direction)(selection);
|
|
96
96
|
return mergedSelection;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
return (0,
|
|
99
|
+
return (0, _utils.hasMergedCellsInSelection)(indexes, direction)(selection);
|
|
100
100
|
}, [indexes, selection, direction, hoveredCell]);
|
|
101
101
|
var handleIconProps = {
|
|
102
102
|
forceDefaultHandle: forceDefaultHandle,
|
|
@@ -124,7 +124,7 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
124
124
|
getOffset: function getOffset(_ref3) {
|
|
125
125
|
var container = _ref3.container;
|
|
126
126
|
var rect = container.getBoundingClientRect();
|
|
127
|
-
if (
|
|
127
|
+
if (_browser.browser.safari) {
|
|
128
128
|
// See: https://product-fabric.atlassian.net/browse/ED-21442
|
|
129
129
|
// We need to ensure that the preview is not overlaying screen content when the snapshot is taken, otherwise
|
|
130
130
|
// safari will composite the screen text elements into the bitmap snapshot. The container is a wrapper which is already
|
|
@@ -220,7 +220,7 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
220
220
|
}
|
|
221
221
|
}, appearance !== 'placeholder' ?
|
|
222
222
|
// cannot block pointer events in Firefox as it breaks Dragging functionality
|
|
223
|
-
|
|
223
|
+
_browser.browser.gecko ? /*#__PURE__*/_react.default.createElement(_HandleIconComponent.HandleIconComponent, handleIconProps) :
|
|
224
224
|
/*#__PURE__*/
|
|
225
225
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
226
226
|
_react.default.createElement("span", {
|
|
@@ -7,9 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = exports.TableFloatingControls = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _browser = require("@atlaskit/editor-common/browser");
|
|
10
11
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
11
|
-
var _utils = require("@atlaskit/editor-
|
|
12
|
-
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
12
|
+
var _utils = require("@atlaskit/editor-tables/utils");
|
|
13
13
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
14
|
var _commands = require("../../commands");
|
|
15
15
|
var _types = require("../../types");
|
|
@@ -44,7 +44,7 @@ var TableFloatingControls = exports.TableFloatingControls = function TableFloati
|
|
|
44
44
|
var state = editorView.state,
|
|
45
45
|
dispatch = editorView.dispatch;
|
|
46
46
|
// fix for issue ED-4665
|
|
47
|
-
if (
|
|
47
|
+
if (_browser.browser.ie_version === 11) {
|
|
48
48
|
editorView.dom.blur();
|
|
49
49
|
}
|
|
50
50
|
(0, _commands.selectRow)(row, expand)(state, dispatch);
|
|
@@ -53,7 +53,7 @@ var TableFloatingControls = exports.TableFloatingControls = function TableFloati
|
|
|
53
53
|
var state = editorView.state,
|
|
54
54
|
dispatch = editorView.dispatch;
|
|
55
55
|
// fix for issue ED-4665
|
|
56
|
-
if (
|
|
56
|
+
if (_browser.browser.ie_version === 11) {
|
|
57
57
|
editorView.dom.blur();
|
|
58
58
|
}
|
|
59
59
|
(0, _commands.selectRows)(rowIndexes)(state, dispatch);
|
|
@@ -83,7 +83,7 @@ var TableFloatingControls = exports.TableFloatingControls = function TableFloati
|
|
|
83
83
|
}
|
|
84
84
|
var stickyTop = stickyHeader && stickyHeader.sticky && hasHeaderRow ? stickyHeader.top : undefined;
|
|
85
85
|
var wrapperClassName = isDragAndDropEnabled ? isChromelessEditor ? _types.TableCssClassName.DRAG_ROW_CONTROLS_WRAPPER + ' ' + _types.TableCssClassName.TABLE_CHROMELESS : _types.TableCssClassName.DRAG_ROW_CONTROLS_WRAPPER : _types.TableCssClassName.ROW_CONTROLS_WRAPPER;
|
|
86
|
-
var tablePos = (_findTable = (0,
|
|
86
|
+
var tablePos = (_findTable = (0, _utils.findTable)(editorView.state.selection)) === null || _findTable === void 0 ? void 0 : _findTable.pos;
|
|
87
87
|
var isNested = tablePos !== undefined && (0, _nodes.isTableNested)(editorView.state, tablePos);
|
|
88
88
|
var shouldShowCornerControls = !(featureFlagsState !== null && featureFlagsState !== void 0 && featureFlagsState.elementDragAndDrop) || isNested;
|
|
89
89
|
return (
|
|
@@ -7,9 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.tableStyles = exports.tableRowHeight = exports.tableFullPageEditorStyles = exports.tableCommentEditorStyles = exports.insertColumnButtonOffset = exports.baseTableStyles = void 0;
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
|
+
var _browser = require("@atlaskit/editor-common/browser");
|
|
10
11
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
11
12
|
var _table = require("@atlaskit/editor-common/table");
|
|
12
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
14
|
var _scrollbar = require("@atlaskit/editor-shared-styles/scrollbar");
|
|
15
15
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
@@ -68,7 +68,7 @@ var tableStickyHeaderFirefoxFixStyle = function tableStickyHeaderFirefoxFixStyle
|
|
|
68
68
|
This fixes a bug which occurs in firefox when the first row becomes sticky.
|
|
69
69
|
see https://product-fabric.atlassian.net/browse/ED-19177
|
|
70
70
|
*/
|
|
71
|
-
if (
|
|
71
|
+
if (_browser.browser.gecko) {
|
|
72
72
|
return (0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t.", " > tbody::before {\n\t\t\t\tcontent: '';\n\t\t\t}\n\t\t"])), _types.TableCssClassName.TABLE_STICKY);
|
|
73
73
|
}
|
|
74
74
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.GlobalStylesWrapper = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
|
+
var _commonStyles = require("./common-styles");
|
|
10
|
+
/**
|
|
11
|
+
* @jsxRuntime classic
|
|
12
|
+
* @jsx jsx
|
|
13
|
+
*/
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
|
+
|
|
16
|
+
var GlobalStylesWrapper = exports.GlobalStylesWrapper = function GlobalStylesWrapper(_ref) {
|
|
17
|
+
var featureFlags = _ref.featureFlags;
|
|
18
|
+
return (0, _platformFeatureFlags.fg)('platform_editor_move_table_styles_to_plugin') ? (0, _react.jsx)(_react.Global, {
|
|
19
|
+
styles: (0, _commonStyles.tableStyles)({
|
|
20
|
+
featureFlags: featureFlags
|
|
21
|
+
})
|
|
22
|
+
}) : null;
|
|
23
|
+
};
|
|
@@ -2,13 +2,13 @@ import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useSta
|
|
|
2
2
|
import rafSchd from 'raf-schd';
|
|
3
3
|
import { useIntl } from 'react-intl-next';
|
|
4
4
|
import { CHANGE_ALIGNMENT_REASON, INPUT_METHOD, TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
5
6
|
import { getGuidelinesWithHighlights } from '@atlaskit/editor-common/guideline';
|
|
6
7
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
7
8
|
import { focusTableResizer, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
8
9
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
9
10
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
10
11
|
import { ResizerNext } from '@atlaskit/editor-common/resizer';
|
|
11
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
12
12
|
import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
|
|
13
13
|
import { akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
|
|
14
14
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { tableCell, tableHeader, tableRow } from '@atlaskit/adf-schema';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
4
5
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
5
6
|
import { IconTable } from '@atlaskit/editor-common/icons';
|
|
6
7
|
import { toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
7
8
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
8
9
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
9
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
10
10
|
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
11
11
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
12
12
|
import { tableEditing } from '@atlaskit/editor-tables/pm-plugins';
|
|
@@ -37,6 +37,7 @@ import FloatingDeleteButton from './ui/FloatingDeleteButton';
|
|
|
37
37
|
import FloatingDragMenu from './ui/FloatingDragMenu';
|
|
38
38
|
import FloatingInsertButton from './ui/FloatingInsertButton';
|
|
39
39
|
import { FloatingToolbarLabel } from './ui/FloatingToolbarLabel/FloatingToolbarLabel';
|
|
40
|
+
import { GlobalStylesWrapper } from './ui/global-styles';
|
|
40
41
|
import { FullWidthDisplay } from './ui/TableFullWidthLabel';
|
|
41
42
|
import { createTableWithWidth } from './utils';
|
|
42
43
|
const defaultGetEditorFeatureFlags = () => ({});
|
|
@@ -329,11 +330,14 @@ const tablesPlugin = ({
|
|
|
329
330
|
popupsScrollableElement,
|
|
330
331
|
dispatchAnalyticsEvent
|
|
331
332
|
}) {
|
|
333
|
+
var _api$featureFlags;
|
|
332
334
|
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
333
335
|
component: ACTION_SUBJECT.TABLES_PLUGIN,
|
|
334
336
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
335
337
|
fallbackComponent: null
|
|
336
|
-
}, /*#__PURE__*/React.createElement(
|
|
338
|
+
}, /*#__PURE__*/React.createElement(GlobalStylesWrapper, {
|
|
339
|
+
featureFlags: api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()
|
|
340
|
+
}), /*#__PURE__*/React.createElement(WithPluginState, {
|
|
337
341
|
plugins: {
|
|
338
342
|
tableAnalyticsPluginState: tableAnalyticsPluginKey,
|
|
339
343
|
tablePluginState: pluginKey,
|
|
@@ -2,8 +2,8 @@ import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import ReactDOM from 'react-dom';
|
|
4
4
|
import { injectIntl } from 'react-intl-next';
|
|
5
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
5
6
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
8
8
|
import { findTable, TableMap } from '@atlaskit/editor-tables';
|
|
9
9
|
import { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
2
3
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
3
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
6
|
import { hoverCell, hoverRows, selectRow, selectRows } from '../../commands';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
4
|
import { css } from '@emotion/react';
|
|
5
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
5
6
|
import { tableMarginTop, tableSharedStyle } from '@atlaskit/editor-common/styles';
|
|
6
7
|
import { SORTABLE_COLUMN_ICON_CLASSNAME } from '@atlaskit/editor-common/table';
|
|
7
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
8
8
|
import { akEditorSelectedNodeClassName, akEditorSmallZIndex, akEditorStickyHeaderZIndex, akEditorTableCellOnStickyHeaderZIndex, akEditorTableNumberColumnWidth, akEditorTableToolbarSize, akEditorUnitZIndex, getSelectionStyles, MAX_BROWSER_SCROLLBAR_HEIGHT, relativeFontSizeToBase16, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
10
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
|
+
import { Global, jsx } from '@emotion/react';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { tableStyles } from './common-styles';
|
|
9
|
+
export const GlobalStylesWrapper = ({
|
|
10
|
+
featureFlags
|
|
11
|
+
}) => {
|
|
12
|
+
return fg('platform_editor_move_table_styles_to_plugin') ? jsx(Global, {
|
|
13
|
+
styles: tableStyles({
|
|
14
|
+
featureFlags
|
|
15
|
+
})
|
|
16
|
+
}) : null;
|
|
17
|
+
};
|
|
@@ -6,13 +6,13 @@ import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useSta
|
|
|
6
6
|
import rafSchd from 'raf-schd';
|
|
7
7
|
import { useIntl } from 'react-intl-next';
|
|
8
8
|
import { CHANGE_ALIGNMENT_REASON, INPUT_METHOD, TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
9
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
9
10
|
import { getGuidelinesWithHighlights } from '@atlaskit/editor-common/guideline';
|
|
10
11
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
11
12
|
import { focusTableResizer, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
12
13
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
13
14
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
14
15
|
import { ResizerNext } from '@atlaskit/editor-common/resizer';
|
|
15
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
16
16
|
import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
|
|
17
17
|
import { akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
|
|
18
18
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
package/dist/esm/plugin.js
CHANGED
|
@@ -4,12 +4,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { tableCell, tableHeader, tableRow } from '@atlaskit/adf-schema';
|
|
6
6
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
7
8
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
8
9
|
import { IconTable } from '@atlaskit/editor-common/icons';
|
|
9
10
|
import { toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
10
11
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
12
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
12
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
13
13
|
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
14
14
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
15
15
|
import { tableEditing } from '@atlaskit/editor-tables/pm-plugins';
|
|
@@ -40,6 +40,7 @@ import FloatingDeleteButton from './ui/FloatingDeleteButton';
|
|
|
40
40
|
import FloatingDragMenu from './ui/FloatingDragMenu';
|
|
41
41
|
import FloatingInsertButton from './ui/FloatingInsertButton';
|
|
42
42
|
import { FloatingToolbarLabel } from './ui/FloatingToolbarLabel/FloatingToolbarLabel';
|
|
43
|
+
import { GlobalStylesWrapper } from './ui/global-styles';
|
|
43
44
|
import { FullWidthDisplay } from './ui/TableFullWidthLabel';
|
|
44
45
|
import { createTableWithWidth } from './utils';
|
|
45
46
|
var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
|
|
@@ -328,6 +329,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
328
329
|
return plugins;
|
|
329
330
|
},
|
|
330
331
|
contentComponent: function contentComponent(_ref17) {
|
|
332
|
+
var _api$featureFlags;
|
|
331
333
|
var editorView = _ref17.editorView,
|
|
332
334
|
popupsMountPoint = _ref17.popupsMountPoint,
|
|
333
335
|
popupsBoundariesElement = _ref17.popupsBoundariesElement,
|
|
@@ -337,7 +339,9 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
337
339
|
component: ACTION_SUBJECT.TABLES_PLUGIN,
|
|
338
340
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
339
341
|
fallbackComponent: null
|
|
340
|
-
}, /*#__PURE__*/React.createElement(
|
|
342
|
+
}, /*#__PURE__*/React.createElement(GlobalStylesWrapper, {
|
|
343
|
+
featureFlags: api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()
|
|
344
|
+
}), /*#__PURE__*/React.createElement(WithPluginState, {
|
|
341
345
|
plugins: {
|
|
342
346
|
tableAnalyticsPluginState: tableAnalyticsPluginKey,
|
|
343
347
|
tablePluginState: pluginKey,
|
|
@@ -4,8 +4,8 @@ import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import ReactDOM from 'react-dom';
|
|
6
6
|
import { injectIntl } from 'react-intl-next';
|
|
7
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
7
8
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
8
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
9
9
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
10
10
|
import { findTable, TableMap } from '@atlaskit/editor-tables';
|
|
11
11
|
import { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
2
3
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
3
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
6
|
import { hoverCell, hoverRows, selectRow, selectRows } from '../../commands';
|
|
@@ -4,9 +4,9 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
|
|
|
4
4
|
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
6
|
import { css } from '@emotion/react';
|
|
7
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
7
8
|
import { tableMarginTop, tableSharedStyle } from '@atlaskit/editor-common/styles';
|
|
8
9
|
import { SORTABLE_COLUMN_ICON_CLASSNAME } from '@atlaskit/editor-common/table';
|
|
9
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
10
10
|
import { akEditorSelectedNodeClassName, akEditorSmallZIndex, akEditorStickyHeaderZIndex, akEditorTableCellOnStickyHeaderZIndex, akEditorTableNumberColumnWidth, akEditorTableToolbarSize, akEditorUnitZIndex, getSelectionStyles, MAX_BROWSER_SCROLLBAR_HEIGHT, relativeFontSizeToBase16, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
11
11
|
import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
|
+
import { Global, jsx } from '@emotion/react';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { tableStyles } from './common-styles';
|
|
9
|
+
export var GlobalStylesWrapper = function GlobalStylesWrapper(_ref) {
|
|
10
|
+
var featureFlags = _ref.featureFlags;
|
|
11
|
+
return fg('platform_editor_move_table_styles_to_plugin') ? jsx(Global, {
|
|
12
|
+
styles: tableStyles({
|
|
13
|
+
featureFlags: featureFlags
|
|
14
|
+
})
|
|
15
|
+
}) : null;
|
|
16
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import { jsx } from '@emotion/react';
|
|
6
|
+
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
|
+
export declare const GlobalStylesWrapper: ({ featureFlags, }: {
|
|
8
|
+
featureFlags: FeatureFlags | undefined;
|
|
9
|
+
}) => jsx.JSX.Element | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import { jsx } from '@emotion/react';
|
|
6
|
+
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
|
+
export declare const GlobalStylesWrapper: ({ featureFlags, }: {
|
|
8
|
+
featureFlags: FeatureFlags | undefined;
|
|
9
|
+
}) => jsx.JSX.Element | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "7.25.
|
|
3
|
+
"version": "7.25.19",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@atlaskit/adf-schema": "^40.9.0",
|
|
31
31
|
"@atlaskit/button": "^20.1.0",
|
|
32
32
|
"@atlaskit/custom-steps": "^0.7.0",
|
|
33
|
-
"@atlaskit/editor-common": "^88.
|
|
33
|
+
"@atlaskit/editor-common": "^88.8.0",
|
|
34
34
|
"@atlaskit/editor-palette": "1.6.0",
|
|
35
35
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.2.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
@@ -117,6 +117,9 @@
|
|
|
117
117
|
"platform_editor_dark_mode_cell_header_color_fix": {
|
|
118
118
|
"type": "boolean"
|
|
119
119
|
},
|
|
120
|
+
"platform_editor_move_table_styles_to_plugin": {
|
|
121
|
+
"type": "boolean"
|
|
122
|
+
},
|
|
120
123
|
"platform_editor_a11y_table_context_menu": {
|
|
121
124
|
"type": "boolean"
|
|
122
125
|
},
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
INPUT_METHOD,
|
|
11
11
|
TABLE_OVERFLOW_CHANGE_TRIGGER,
|
|
12
12
|
} from '@atlaskit/editor-common/analytics';
|
|
13
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
13
14
|
import { getGuidelinesWithHighlights } from '@atlaskit/editor-common/guideline';
|
|
14
15
|
import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
|
|
15
16
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
@@ -18,7 +19,6 @@ import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
|
18
19
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
19
20
|
import type { HandleResize, HandleSize } from '@atlaskit/editor-common/resizer';
|
|
20
21
|
import { ResizerNext } from '@atlaskit/editor-common/resizer';
|
|
21
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
22
22
|
import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
|
|
23
23
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
24
24
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
package/src/plugin.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
INPUT_METHOD,
|
|
11
11
|
TABLE_ACTION,
|
|
12
12
|
} from '@atlaskit/editor-common/analytics';
|
|
13
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
13
14
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
14
15
|
import { IconTable } from '@atlaskit/editor-common/icons';
|
|
15
16
|
import { toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
@@ -24,7 +25,6 @@ import type {
|
|
|
24
25
|
NextEditorPlugin,
|
|
25
26
|
OptionalPlugin,
|
|
26
27
|
} from '@atlaskit/editor-common/types';
|
|
27
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
28
28
|
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
29
29
|
import type { AccessibilityUtilsPlugin } from '@atlaskit/editor-plugin-accessibility-utils';
|
|
30
30
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
@@ -82,6 +82,7 @@ import FloatingDeleteButton from './ui/FloatingDeleteButton';
|
|
|
82
82
|
import FloatingDragMenu from './ui/FloatingDragMenu';
|
|
83
83
|
import FloatingInsertButton from './ui/FloatingInsertButton';
|
|
84
84
|
import { FloatingToolbarLabel } from './ui/FloatingToolbarLabel/FloatingToolbarLabel';
|
|
85
|
+
import { GlobalStylesWrapper } from './ui/global-styles';
|
|
85
86
|
import { FullWidthDisplay } from './ui/TableFullWidthLabel';
|
|
86
87
|
import { createTableWithWidth } from './utils';
|
|
87
88
|
|
|
@@ -515,6 +516,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
515
516
|
dispatchAnalyticsEvent={dispatchAnalyticsEvent}
|
|
516
517
|
fallbackComponent={null}
|
|
517
518
|
>
|
|
519
|
+
<GlobalStylesWrapper featureFlags={api?.featureFlags?.sharedState.currentState()} />
|
|
518
520
|
<WithPluginState
|
|
519
521
|
plugins={{
|
|
520
522
|
tableAnalyticsPluginState: tableAnalyticsPluginKey,
|
|
@@ -6,8 +6,8 @@ import ReactDOM from 'react-dom';
|
|
|
6
6
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
7
7
|
import { injectIntl } from 'react-intl-next';
|
|
8
8
|
|
|
9
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
9
10
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
10
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
11
11
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
12
12
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
13
13
|
import { findTable, TableMap } from '@atlaskit/editor-tables';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
|
|
3
3
|
import type { TableColumnOrdering } from '@atlaskit/custom-steps';
|
|
4
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
4
5
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
5
6
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
8
8
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
package/src/ui/common-styles.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
4
|
import { css } from '@emotion/react';
|
|
5
5
|
|
|
6
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
6
7
|
import { tableMarginTop, tableSharedStyle } from '@atlaskit/editor-common/styles';
|
|
7
8
|
import { SORTABLE_COLUMN_ICON_CLASSNAME } from '@atlaskit/editor-common/table';
|
|
8
9
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
9
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
10
10
|
import {
|
|
11
11
|
akEditorSelectedNodeClassName,
|
|
12
12
|
akEditorSmallZIndex,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
|
+
import { Global, jsx } from '@emotion/react';
|
|
7
|
+
|
|
8
|
+
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
+
|
|
11
|
+
import { tableStyles } from './common-styles';
|
|
12
|
+
|
|
13
|
+
export const GlobalStylesWrapper = ({
|
|
14
|
+
featureFlags,
|
|
15
|
+
}: {
|
|
16
|
+
featureFlags: FeatureFlags | undefined;
|
|
17
|
+
}) => {
|
|
18
|
+
return fg('platform_editor_move_table_styles_to_plugin') ? (
|
|
19
|
+
<Global styles={tableStyles({ featureFlags })} />
|
|
20
|
+
) : null;
|
|
21
|
+
};
|