@atlaskit/editor-plugin-table 22.2.7 → 22.2.9
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 +16 -0
- package/dist/cjs/nodeviews/TableContainer.js +3 -3
- package/dist/cjs/nodeviews/TableResizer.js +8 -8
- package/dist/cjs/pm-plugins/analytics/plugin-factory.js +4 -4
- package/dist/cjs/pm-plugins/drag-and-drop/plugin-factory.js +19 -19
- package/dist/cjs/pm-plugins/plugin-factory.js +30 -30
- package/dist/cjs/pm-plugins/sticky-headers/plugin-state.js +16 -16
- package/dist/es2019/nodeviews/TableContainer.js +3 -3
- package/dist/es2019/nodeviews/TableResizer.js +8 -8
- package/dist/es2019/pm-plugins/analytics/plugin-factory.js +4 -5
- package/dist/es2019/pm-plugins/drag-and-drop/plugin-factory.js +6 -9
- package/dist/es2019/pm-plugins/plugin-factory.js +5 -6
- package/dist/es2019/pm-plugins/sticky-headers/plugin-state.js +3 -4
- package/dist/esm/nodeviews/TableContainer.js +3 -3
- package/dist/esm/nodeviews/TableResizer.js +8 -8
- package/dist/esm/pm-plugins/analytics/plugin-factory.js +4 -5
- package/dist/esm/pm-plugins/drag-and-drop/plugin-factory.js +19 -20
- package/dist/esm/pm-plugins/plugin-factory.js +30 -31
- package/dist/esm/pm-plugins/sticky-headers/plugin-state.js +16 -16
- package/dist/types/pm-plugins/analytics/plugin-factory.d.ts +8 -1
- package/dist/types/pm-plugins/drag-and-drop/plugin-factory.d.ts +8 -1
- package/dist/types/pm-plugins/plugin-factory.d.ts +7 -1
- package/dist/types/pm-plugins/sticky-headers/plugin-state.d.ts +5 -1
- package/dist/types/pm-plugins/table-width-in-comment-fix.d.ts +1 -3
- package/dist/types/pm-plugins/table-width.d.ts +1 -5
- package/dist/types/pm-plugins/view-mode-sort/index.d.ts +4 -2
- package/dist/types/ui/FloatingContextualButton/index.d.ts +1 -2
- package/dist/types/ui/FloatingContextualMenu/index.d.ts +1 -6
- package/dist/types-ts4.5/pm-plugins/analytics/plugin-factory.d.ts +8 -1
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/plugin-factory.d.ts +8 -1
- package/dist/types-ts4.5/pm-plugins/plugin-factory.d.ts +7 -1
- package/dist/types-ts4.5/pm-plugins/sticky-headers/plugin-state.d.ts +5 -1
- package/dist/types-ts4.5/pm-plugins/table-width-in-comment-fix.d.ts +1 -3
- package/dist/types-ts4.5/pm-plugins/table-width.d.ts +1 -5
- package/dist/types-ts4.5/pm-plugins/view-mode-sort/index.d.ts +5 -3
- package/dist/types-ts4.5/ui/FloatingContextualButton/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/FloatingContextualMenu/index.d.ts +1 -6
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 22.2.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 22.2.8
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`bc415f8eb86a9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bc415f8eb86a9) -
|
|
14
|
+
Add OR check with create_work_item_modernization_exp experiment to
|
|
15
|
+
platform_editor_fix_scrolling_popup_position, platform_editor_table_resize_chromeless, and
|
|
16
|
+
platform_editor_chromeless_akeditor_class usages
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 22.2.7
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -238,7 +238,7 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
|
|
|
238
238
|
}
|
|
239
239
|
} else if (isCommentEditor) {
|
|
240
240
|
responsiveContainerWidth = containerWidth - _consts.TABLE_OFFSET_IN_COMMENT_EDITOR;
|
|
241
|
-
} else if (isChromelessEditor && (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true)) {
|
|
241
|
+
} else if (isChromelessEditor && ((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true))) {
|
|
242
242
|
// there's no padding included in chromeless appearance, so we need to reduce table
|
|
243
243
|
// width to ensure all controls are visible.
|
|
244
244
|
// use lineLength as the value is updated by scrollbar visibility changes
|
|
@@ -255,13 +255,13 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
|
|
|
255
255
|
// For wide tables, ensure they don't exceed container width and can be scrolled
|
|
256
256
|
var calculatedWidth =
|
|
257
257
|
// remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
|
|
258
|
-
!node.attrs.width && ((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor) ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
|
|
258
|
+
!node.attrs.width && (((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor) ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
|
|
259
259
|
|
|
260
260
|
// Ensure minimum width for usability while respecting container constraints
|
|
261
261
|
var width = Math.max(calculatedWidth, Math.min(responsiveContainerWidth * 0.5, 300));
|
|
262
262
|
|
|
263
263
|
// remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
|
|
264
|
-
var maxResizerWidth = (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? responsiveContainerWidth : Math.min(responsiveContainerWidth, (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true) ? _consts.TABLE_MAX_WIDTH : _consts.TABLE_FULL_WIDTH);
|
|
264
|
+
var maxResizerWidth = ((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? responsiveContainerWidth : Math.min(responsiveContainerWidth, (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true) ? _consts.TABLE_MAX_WIDTH : _consts.TABLE_FULL_WIDTH);
|
|
265
265
|
return {
|
|
266
266
|
width: width,
|
|
267
267
|
maxResizerWidth: maxResizerWidth
|
|
@@ -305,7 +305,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
305
305
|
var editorContainerWidth = isFullWidthModeEnabled ? lineLength + 2 * getPadding(containerWidth) : containerWidth;
|
|
306
306
|
var closestSnap =
|
|
307
307
|
// remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
|
|
308
|
-
((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) && isFullPageAppearance || !isCommentEditor) && (0, _snapping.findClosestSnap)(newWidth, isTableScalingEnabled ? (0, _snapping.defaultTablePreserveSnappingWidths)(_snapping.PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : _snapping.defaultSnappingWidths, isTableScalingEnabled ? (0, _guidelines.defaultGuidelinesForPreserveTable)(_guidelines.PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : _guidelines.defaultGuidelines, _consts2.TABLE_HIGHLIGHT_GAP, _consts2.TABLE_HIGHLIGHT_TOLERANCE);
|
|
308
|
+
(((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true)) && isFullPageAppearance || !isCommentEditor) && (0, _snapping.findClosestSnap)(newWidth, isTableScalingEnabled ? (0, _snapping.defaultTablePreserveSnappingWidths)(_snapping.PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : _snapping.defaultSnappingWidths, isTableScalingEnabled ? (0, _guidelines.defaultGuidelinesForPreserveTable)(_guidelines.PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : _guidelines.defaultGuidelines, _consts2.TABLE_HIGHLIGHT_GAP, _consts2.TABLE_HIGHLIGHT_TOLERANCE);
|
|
309
309
|
closestSnap && updateActiveGuidelines(closestSnap);
|
|
310
310
|
|
|
311
311
|
// When snapping to the full width guideline, resize the table to be 1800px
|
|
@@ -316,15 +316,15 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
316
316
|
return guideline.isFullWidth;
|
|
317
317
|
})[0];
|
|
318
318
|
var isFullWidthGuidelineActive = (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true) ? closestSnap && fullWidthGuideline && closestSnap.keys.includes(fullWidthGuideline.key) : closestSnap && closestSnap.keys.includes(fullWidthGuideline.key);
|
|
319
|
-
var tableMaxWidth = (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) ? getTableMaxWidth(containerWidth, lineLength, isCommentEditor, isChromelessEditor) : isCommentEditor ? Math.floor(containerWidth - _consts.TABLE_OFFSET_IN_COMMENT_EDITOR) : (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true) ? _consts.TABLE_MAX_WIDTH : _consts.TABLE_FULL_WIDTH;
|
|
320
|
-
var shouldUpdateWidthToWidest = (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? tableMaxWidth <= newWidth : !!isTableScalingEnabled && isFullWidthGuidelineActive;
|
|
321
|
-
var previewParentWidth = ((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor) && shouldUpdateWidthToWidest ? tableMaxWidth : newWidth;
|
|
319
|
+
var tableMaxWidth = (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true) ? getTableMaxWidth(containerWidth, lineLength, isCommentEditor, isChromelessEditor) : isCommentEditor ? Math.floor(containerWidth - _consts.TABLE_OFFSET_IN_COMMENT_EDITOR) : (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true) ? _consts.TABLE_MAX_WIDTH : _consts.TABLE_FULL_WIDTH;
|
|
320
|
+
var shouldUpdateWidthToWidest = ((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? tableMaxWidth <= newWidth : !!isTableScalingEnabled && isFullWidthGuidelineActive;
|
|
321
|
+
var previewParentWidth = (((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor) && shouldUpdateWidthToWidest ? tableMaxWidth : newWidth;
|
|
322
322
|
(0, _scaleTable.previewScaleTable)(tableRef, {
|
|
323
323
|
node: node,
|
|
324
324
|
prevNode: node,
|
|
325
325
|
start: pos + 1,
|
|
326
326
|
parentWidth: previewParentWidth
|
|
327
|
-
}, editorView.domAtPos.bind(editorView), isTableScalingEnabled, allowFixedColumnWidthOption, (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor);
|
|
327
|
+
}, editorView.domAtPos.bind(editorView), isTableScalingEnabled, allowFixedColumnWidthOption, (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor);
|
|
328
328
|
(0, _commands.chainCommands)(function (state, dispatch) {
|
|
329
329
|
return switchToCenterAlignment(pos, node, newWidth, state, dispatch);
|
|
330
330
|
}, (0, _misc.updateWidthToWidest)((0, _defineProperty2.default)({}, currentTableNodeLocalId, shouldUpdateWidthToWidest)))(state, dispatch);
|
|
@@ -343,7 +343,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
343
343
|
dispatch = editorView.dispatch;
|
|
344
344
|
var pos = getPos();
|
|
345
345
|
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 : '';
|
|
346
|
-
var tableMaxWidth = (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? undefined // Table's full-width in comment appearance inherit the width of the Editor/Renderer
|
|
346
|
+
var tableMaxWidth = ((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? undefined // Table's full-width in comment appearance inherit the width of the Editor/Renderer
|
|
347
347
|
: (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true) ? _consts.TABLE_MAX_WIDTH : _consts.TABLE_FULL_WIDTH;
|
|
348
348
|
newWidth = widthToWidest && currentTableNodeLocalId && widthToWidest[currentTableNodeLocalId] ? tableMaxWidth : newWidth;
|
|
349
349
|
var tr = state.tr.setMeta(_tableWidth.pluginKey, {
|
|
@@ -385,8 +385,8 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
385
385
|
// newWidth can be underined when table is resized to 'full-width'
|
|
386
386
|
// scaleTable function needs number value to work correctly.
|
|
387
387
|
// remove isCommentEditor check when platform_editor_table_resize_chromeless is removed
|
|
388
|
-
parentWidth: (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? originalNewWidth : newWidth
|
|
389
|
-
}, editorView.domAtPos.bind(editorView), pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent || false, (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor)(tr);
|
|
388
|
+
parentWidth: ((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? originalNewWidth : newWidth
|
|
389
|
+
}, editorView.domAtPos.bind(editorView), pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent || false, (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor)(tr);
|
|
390
390
|
|
|
391
391
|
// Ignored via go/ees005
|
|
392
392
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -7,7 +7,7 @@ exports.getPluginState = exports.createPluginState = exports.createCommand = voi
|
|
|
7
7
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
8
8
|
var _pluginKey = require("./plugin-key");
|
|
9
9
|
var _reducer = require("./reducer");
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
var dest = (0, _utils.pluginFactory)(_pluginKey.pluginKey, _reducer.reducer);
|
|
11
|
+
var createPluginState = exports.createPluginState = dest.createPluginState;
|
|
12
|
+
var createCommand = exports.createCommand = dest.createCommand;
|
|
13
|
+
var getPluginState = exports.getPluginState = dest.getPluginState;
|
|
@@ -12,24 +12,24 @@ var _pluginKey2 = require("./plugin-key");
|
|
|
12
12
|
var _reducer = _interopRequireDefault(require("./reducer"));
|
|
13
13
|
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; }
|
|
14
14
|
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; }
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
if (decorationSet) {
|
|
24
|
-
decorationSet = decorationSet.map(tr.mapping, tr.doc);
|
|
25
|
-
}
|
|
26
|
-
return _objectSpread(_objectSpread({}, pluginState), {
|
|
27
|
-
decorationSet: decorationSet
|
|
28
|
-
});
|
|
15
|
+
var dest = (0, _utils.pluginFactory)(_pluginKey2.pluginKey, _reducer.default, {
|
|
16
|
+
mapping: function mapping(tr, pluginState) {
|
|
17
|
+
if (tr.docChanged) {
|
|
18
|
+
var decorationSet = pluginState.decorationSet;
|
|
19
|
+
var meta = tr.getMeta(_pluginKey.pluginKey);
|
|
20
|
+
if (meta && meta.data && meta.data.decorationSet) {
|
|
21
|
+
decorationSet = meta.data.decorationSet;
|
|
29
22
|
}
|
|
30
|
-
|
|
23
|
+
if (decorationSet) {
|
|
24
|
+
decorationSet = decorationSet.map(tr.mapping, tr.doc);
|
|
25
|
+
}
|
|
26
|
+
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
27
|
+
decorationSet: decorationSet
|
|
28
|
+
});
|
|
31
29
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
return pluginState;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
var createPluginState = exports.createPluginState = dest.createPluginState;
|
|
34
|
+
var createCommand = exports.createCommand = dest.createCommand;
|
|
35
|
+
var getPluginState = exports.getPluginState = dest.getPluginState;
|
|
@@ -12,34 +12,34 @@ var _pluginKey = require("./plugin-key");
|
|
|
12
12
|
var _reducer = _interopRequireDefault(require("./reducer"));
|
|
13
13
|
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; }
|
|
14
14
|
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; }
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
var updatedTablePos = {};
|
|
28
|
-
if (pluginState.tablePos) {
|
|
29
|
-
var _tr$mapping$mapResult2 = tr.mapping.mapResult(pluginState.tablePos, -1),
|
|
30
|
-
_pos = _tr$mapping$mapResult2.pos,
|
|
31
|
-
_deleted = _tr$mapping$mapResult2.deleted;
|
|
32
|
-
updatedTablePos = {
|
|
33
|
-
tablePos: _deleted ? undefined : _pos
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
return _objectSpread(_objectSpread(_objectSpread({}, pluginState), updatedTargetCell), updatedTablePos);
|
|
15
|
+
var dest = (0, _utils.pluginFactory)(_pluginKey.pluginKey, _reducer.default, {
|
|
16
|
+
mapping: function mapping(tr, pluginState) {
|
|
17
|
+
if (tr.docChanged) {
|
|
18
|
+
var updatedTargetCell = {};
|
|
19
|
+
if (pluginState.targetCellPosition) {
|
|
20
|
+
var _tr$mapping$mapResult = tr.mapping.mapResult(pluginState.targetCellPosition),
|
|
21
|
+
pos = _tr$mapping$mapResult.pos,
|
|
22
|
+
deleted = _tr$mapping$mapResult.deleted;
|
|
23
|
+
updatedTargetCell = {
|
|
24
|
+
targetCellPosition: deleted ? undefined : pos
|
|
25
|
+
};
|
|
37
26
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
27
|
+
var updatedTablePos = {};
|
|
28
|
+
if (pluginState.tablePos) {
|
|
29
|
+
var _tr$mapping$mapResult2 = tr.mapping.mapResult(pluginState.tablePos, -1),
|
|
30
|
+
_pos = _tr$mapping$mapResult2.pos,
|
|
31
|
+
_deleted = _tr$mapping$mapResult2.deleted;
|
|
32
|
+
updatedTablePos = {
|
|
33
|
+
tablePos: _deleted ? undefined : _pos
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return _objectSpread(_objectSpread(_objectSpread({}, pluginState), updatedTargetCell), updatedTablePos);
|
|
37
|
+
}
|
|
38
|
+
return pluginState;
|
|
39
|
+
},
|
|
40
|
+
onDocChanged: _handlers.handleDocOrSelectionChanged,
|
|
41
|
+
onSelectionChanged: _handlers.handleDocOrSelectionChanged
|
|
42
|
+
});
|
|
43
|
+
var createPluginState = exports.createPluginState = dest.createPluginState;
|
|
44
|
+
var createCommand = exports.createCommand = dest.createCommand;
|
|
45
|
+
var getPluginState = exports.getPluginState = dest.getPluginState;
|
|
@@ -32,20 +32,20 @@ var reducer = function reducer(pluginState, action) {
|
|
|
32
32
|
}
|
|
33
33
|
return pluginState;
|
|
34
34
|
};
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
return pluginState;
|
|
35
|
+
var dest = (0, _utils.pluginFactory)(_pluginKey.pluginKey, reducer, {
|
|
36
|
+
mapping: function mapping(tr, pluginState) {
|
|
37
|
+
if (tr.docChanged) {
|
|
38
|
+
return pluginState.map(function (rowInfo) {
|
|
39
|
+
var remapped = tr.mapping.mapResult(rowInfo.pos);
|
|
40
|
+
return remapped ? _objectSpread(_objectSpread({}, rowInfo), {}, {
|
|
41
|
+
pos: remapped.pos
|
|
42
|
+
}) : undefined;
|
|
43
|
+
}).filter(function (f) {
|
|
44
|
+
return f !== undefined;
|
|
45
|
+
});
|
|
48
46
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
return pluginState;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
var createPluginState = exports.createPluginState = dest.createPluginState;
|
|
51
|
+
var createCommand = exports.createCommand = dest.createCommand;
|
|
@@ -234,7 +234,7 @@ export const ResizableTableContainer = /*#__PURE__*/React.memo(({
|
|
|
234
234
|
}
|
|
235
235
|
} else if (isCommentEditor) {
|
|
236
236
|
responsiveContainerWidth = containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR;
|
|
237
|
-
} else if (isChromelessEditor && expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true)) {
|
|
237
|
+
} else if (isChromelessEditor && (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true))) {
|
|
238
238
|
// there's no padding included in chromeless appearance, so we need to reduce table
|
|
239
239
|
// width to ensure all controls are visible.
|
|
240
240
|
// use lineLength as the value is updated by scrollbar visibility changes
|
|
@@ -251,13 +251,13 @@ export const ResizableTableContainer = /*#__PURE__*/React.memo(({
|
|
|
251
251
|
// For wide tables, ensure they don't exceed container width and can be scrolled
|
|
252
252
|
const calculatedWidth =
|
|
253
253
|
// remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
|
|
254
|
-
!node.attrs.width && (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor) ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
|
|
254
|
+
!node.attrs.width && ((expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor) ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
|
|
255
255
|
|
|
256
256
|
// Ensure minimum width for usability while respecting container constraints
|
|
257
257
|
const width = Math.max(calculatedWidth, Math.min(responsiveContainerWidth * 0.5, 300));
|
|
258
258
|
|
|
259
259
|
// remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
|
|
260
|
-
const maxResizerWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? responsiveContainerWidth : Math.min(responsiveContainerWidth, expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH);
|
|
260
|
+
const maxResizerWidth = (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? responsiveContainerWidth : Math.min(responsiveContainerWidth, expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH);
|
|
261
261
|
return {
|
|
262
262
|
width,
|
|
263
263
|
maxResizerWidth
|
|
@@ -298,7 +298,7 @@ export const TableResizer = ({
|
|
|
298
298
|
const editorContainerWidth = isFullWidthModeEnabled ? lineLength + 2 * getPadding(containerWidth) : containerWidth;
|
|
299
299
|
const closestSnap =
|
|
300
300
|
// remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
|
|
301
|
-
(expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && isFullPageAppearance || !isCommentEditor) && findClosestSnap(newWidth, isTableScalingEnabled ? defaultTablePreserveSnappingWidths(PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : defaultSnappingWidths, isTableScalingEnabled ? defaultGuidelinesForPreserveTable(PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : defaultGuidelines, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGHT_TOLERANCE);
|
|
301
|
+
((expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && isFullPageAppearance || !isCommentEditor) && findClosestSnap(newWidth, isTableScalingEnabled ? defaultTablePreserveSnappingWidths(PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : defaultSnappingWidths, isTableScalingEnabled ? defaultGuidelinesForPreserveTable(PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : defaultGuidelines, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGHT_TOLERANCE);
|
|
302
302
|
closestSnap && updateActiveGuidelines(closestSnap);
|
|
303
303
|
|
|
304
304
|
// When snapping to the full width guideline, resize the table to be 1800px
|
|
@@ -309,15 +309,15 @@ export const TableResizer = ({
|
|
|
309
309
|
const currentTableNodeLocalId = (_node$attrs$localId = node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) !== null && _node$attrs$localId !== void 0 ? _node$attrs$localId : '';
|
|
310
310
|
const fullWidthGuideline = defaultGuidelinesForPreserveTable(PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig).filter(guideline => guideline.isFullWidth)[0];
|
|
311
311
|
const isFullWidthGuidelineActive = expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? closestSnap && fullWidthGuideline && closestSnap.keys.includes(fullWidthGuideline.key) : closestSnap && closestSnap.keys.includes(fullWidthGuideline.key);
|
|
312
|
-
const tableMaxWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) ? getTableMaxWidth(containerWidth, lineLength, isCommentEditor, isChromelessEditor) : isCommentEditor ? Math.floor(containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR) : expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH;
|
|
313
|
-
const shouldUpdateWidthToWidest = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? tableMaxWidth <= newWidth : !!isTableScalingEnabled && isFullWidthGuidelineActive;
|
|
314
|
-
const previewParentWidth = (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor) && shouldUpdateWidthToWidest ? tableMaxWidth : newWidth;
|
|
312
|
+
const tableMaxWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true) ? getTableMaxWidth(containerWidth, lineLength, isCommentEditor, isChromelessEditor) : isCommentEditor ? Math.floor(containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR) : expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH;
|
|
313
|
+
const shouldUpdateWidthToWidest = (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? tableMaxWidth <= newWidth : !!isTableScalingEnabled && isFullWidthGuidelineActive;
|
|
314
|
+
const previewParentWidth = ((expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor) && shouldUpdateWidthToWidest ? tableMaxWidth : newWidth;
|
|
315
315
|
previewScaleTable(tableRef, {
|
|
316
316
|
node,
|
|
317
317
|
prevNode: node,
|
|
318
318
|
start: pos + 1,
|
|
319
319
|
parentWidth: previewParentWidth
|
|
320
|
-
}, editorView.domAtPos.bind(editorView), isTableScalingEnabled, allowFixedColumnWidthOption, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor);
|
|
320
|
+
}, editorView.domAtPos.bind(editorView), isTableScalingEnabled, allowFixedColumnWidthOption, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor);
|
|
321
321
|
chainCommands((state, dispatch) => {
|
|
322
322
|
return switchToCenterAlignment(pos, node, newWidth, state, dispatch);
|
|
323
323
|
}, updateWidthToWidest({
|
|
@@ -338,7 +338,7 @@ export const TableResizer = ({
|
|
|
338
338
|
} = editorView;
|
|
339
339
|
const pos = getPos();
|
|
340
340
|
const currentTableNodeLocalId = (_node$attrs$localId2 = node === null || node === void 0 ? 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 : '';
|
|
341
|
-
const tableMaxWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? undefined // Table's full-width in comment appearance inherit the width of the Editor/Renderer
|
|
341
|
+
const tableMaxWidth = (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? undefined // Table's full-width in comment appearance inherit the width of the Editor/Renderer
|
|
342
342
|
: expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH;
|
|
343
343
|
newWidth = widthToWidest && currentTableNodeLocalId && widthToWidest[currentTableNodeLocalId] ? tableMaxWidth : newWidth;
|
|
344
344
|
let tr = state.tr.setMeta(tableWidthPluginKey, {
|
|
@@ -381,8 +381,8 @@ export const TableResizer = ({
|
|
|
381
381
|
// newWidth can be underined when table is resized to 'full-width'
|
|
382
382
|
// scaleTable function needs number value to work correctly.
|
|
383
383
|
// remove isCommentEditor check when platform_editor_table_resize_chromeless is removed
|
|
384
|
-
parentWidth: expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? originalNewWidth : newWidth
|
|
385
|
-
}, editorView.domAtPos.bind(editorView), pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent || false, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor)(tr);
|
|
384
|
+
parentWidth: (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? originalNewWidth : newWidth
|
|
385
|
+
}, editorView.domAtPos.bind(editorView), pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent || false, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor)(tr);
|
|
386
386
|
|
|
387
387
|
// Ignored via go/ees005
|
|
388
388
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
2
2
|
import { pluginKey } from './plugin-key';
|
|
3
3
|
import { reducer } from './reducer';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} = pluginFactory(pluginKey, reducer);
|
|
4
|
+
const dest = pluginFactory(pluginKey, reducer);
|
|
5
|
+
export const createPluginState = dest.createPluginState;
|
|
6
|
+
export const createCommand = dest.createCommand;
|
|
7
|
+
export const getPluginState = dest.getPluginState;
|
|
@@ -2,11 +2,7 @@ import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
|
2
2
|
import { pluginKey as tablePluginKey } from '../plugin-key';
|
|
3
3
|
import { pluginKey } from './plugin-key';
|
|
4
4
|
import reducer from './reducer';
|
|
5
|
-
|
|
6
|
-
createPluginState,
|
|
7
|
-
createCommand,
|
|
8
|
-
getPluginState
|
|
9
|
-
} = pluginFactory(pluginKey, reducer, {
|
|
5
|
+
const dest = pluginFactory(pluginKey, reducer, {
|
|
10
6
|
mapping: (tr, pluginState) => {
|
|
11
7
|
if (tr.docChanged) {
|
|
12
8
|
let decorationSet = pluginState.decorationSet;
|
|
@@ -19,11 +15,12 @@ export const {
|
|
|
19
15
|
}
|
|
20
16
|
return {
|
|
21
17
|
...pluginState,
|
|
22
|
-
|
|
23
|
-
decorationSet
|
|
24
|
-
}
|
|
18
|
+
decorationSet
|
|
25
19
|
};
|
|
26
20
|
}
|
|
27
21
|
return pluginState;
|
|
28
22
|
}
|
|
29
|
-
});
|
|
23
|
+
});
|
|
24
|
+
export const createPluginState = dest.createPluginState;
|
|
25
|
+
export const createCommand = dest.createCommand;
|
|
26
|
+
export const getPluginState = dest.getPluginState;
|
|
@@ -2,11 +2,7 @@ import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
|
2
2
|
import { handleDocOrSelectionChanged } from './handlers';
|
|
3
3
|
import { pluginKey } from './plugin-key';
|
|
4
4
|
import reducer from './reducer';
|
|
5
|
-
|
|
6
|
-
createPluginState,
|
|
7
|
-
createCommand,
|
|
8
|
-
getPluginState
|
|
9
|
-
} = pluginFactory(pluginKey, reducer, {
|
|
5
|
+
const dest = pluginFactory(pluginKey, reducer, {
|
|
10
6
|
mapping: (tr, pluginState) => {
|
|
11
7
|
if (tr.docChanged) {
|
|
12
8
|
let updatedTargetCell = {};
|
|
@@ -39,4 +35,7 @@ export const {
|
|
|
39
35
|
},
|
|
40
36
|
onDocChanged: handleDocOrSelectionChanged,
|
|
41
37
|
onSelectionChanged: handleDocOrSelectionChanged
|
|
42
|
-
});
|
|
38
|
+
});
|
|
39
|
+
export const createPluginState = dest.createPluginState;
|
|
40
|
+
export const createCommand = dest.createCommand;
|
|
41
|
+
export const getPluginState = dest.getPluginState;
|
|
@@ -20,10 +20,7 @@ const reducer = (pluginState, action) => {
|
|
|
20
20
|
}
|
|
21
21
|
return pluginState;
|
|
22
22
|
};
|
|
23
|
-
const {
|
|
24
|
-
createPluginState,
|
|
25
|
-
createCommand
|
|
26
|
-
} = pluginFactory(pluginKey, reducer, {
|
|
23
|
+
const dest = pluginFactory(pluginKey, reducer, {
|
|
27
24
|
mapping: (tr, pluginState) => {
|
|
28
25
|
if (tr.docChanged) {
|
|
29
26
|
return pluginState.map(rowInfo => {
|
|
@@ -37,4 +34,6 @@ const {
|
|
|
37
34
|
return pluginState;
|
|
38
35
|
}
|
|
39
36
|
});
|
|
37
|
+
const createPluginState = dest.createPluginState;
|
|
38
|
+
const createCommand = dest.createCommand;
|
|
40
39
|
export { createPluginState, createCommand };
|
|
@@ -229,7 +229,7 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
229
229
|
}
|
|
230
230
|
} else if (isCommentEditor) {
|
|
231
231
|
responsiveContainerWidth = containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR;
|
|
232
|
-
} else if (isChromelessEditor && expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true)) {
|
|
232
|
+
} else if (isChromelessEditor && (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true))) {
|
|
233
233
|
// there's no padding included in chromeless appearance, so we need to reduce table
|
|
234
234
|
// width to ensure all controls are visible.
|
|
235
235
|
// use lineLength as the value is updated by scrollbar visibility changes
|
|
@@ -246,13 +246,13 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
246
246
|
// For wide tables, ensure they don't exceed container width and can be scrolled
|
|
247
247
|
var calculatedWidth =
|
|
248
248
|
// remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
|
|
249
|
-
!node.attrs.width && (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor) ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
|
|
249
|
+
!node.attrs.width && ((expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor) ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
|
|
250
250
|
|
|
251
251
|
// Ensure minimum width for usability while respecting container constraints
|
|
252
252
|
var width = Math.max(calculatedWidth, Math.min(responsiveContainerWidth * 0.5, 300));
|
|
253
253
|
|
|
254
254
|
// remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
|
|
255
|
-
var maxResizerWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? responsiveContainerWidth : Math.min(responsiveContainerWidth, expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH);
|
|
255
|
+
var maxResizerWidth = (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? responsiveContainerWidth : Math.min(responsiveContainerWidth, expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH);
|
|
256
256
|
return {
|
|
257
257
|
width: width,
|
|
258
258
|
maxResizerWidth: maxResizerWidth
|
|
@@ -296,7 +296,7 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
296
296
|
var editorContainerWidth = isFullWidthModeEnabled ? lineLength + 2 * getPadding(containerWidth) : containerWidth;
|
|
297
297
|
var closestSnap =
|
|
298
298
|
// remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
|
|
299
|
-
(expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && isFullPageAppearance || !isCommentEditor) && findClosestSnap(newWidth, isTableScalingEnabled ? defaultTablePreserveSnappingWidths(PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : defaultSnappingWidths, isTableScalingEnabled ? defaultGuidelinesForPreserveTable(PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : defaultGuidelines, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGHT_TOLERANCE);
|
|
299
|
+
((expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && isFullPageAppearance || !isCommentEditor) && findClosestSnap(newWidth, isTableScalingEnabled ? defaultTablePreserveSnappingWidths(PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : defaultSnappingWidths, isTableScalingEnabled ? defaultGuidelinesForPreserveTable(PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : defaultGuidelines, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGHT_TOLERANCE);
|
|
300
300
|
closestSnap && updateActiveGuidelines(closestSnap);
|
|
301
301
|
|
|
302
302
|
// When snapping to the full width guideline, resize the table to be 1800px
|
|
@@ -307,15 +307,15 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
307
307
|
return guideline.isFullWidth;
|
|
308
308
|
})[0];
|
|
309
309
|
var isFullWidthGuidelineActive = expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? closestSnap && fullWidthGuideline && closestSnap.keys.includes(fullWidthGuideline.key) : closestSnap && closestSnap.keys.includes(fullWidthGuideline.key);
|
|
310
|
-
var tableMaxWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) ? getTableMaxWidth(containerWidth, lineLength, isCommentEditor, isChromelessEditor) : isCommentEditor ? Math.floor(containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR) : expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH;
|
|
311
|
-
var shouldUpdateWidthToWidest = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? tableMaxWidth <= newWidth : !!isTableScalingEnabled && isFullWidthGuidelineActive;
|
|
312
|
-
var previewParentWidth = (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor) && shouldUpdateWidthToWidest ? tableMaxWidth : newWidth;
|
|
310
|
+
var tableMaxWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true) ? getTableMaxWidth(containerWidth, lineLength, isCommentEditor, isChromelessEditor) : isCommentEditor ? Math.floor(containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR) : expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH;
|
|
311
|
+
var shouldUpdateWidthToWidest = (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? tableMaxWidth <= newWidth : !!isTableScalingEnabled && isFullWidthGuidelineActive;
|
|
312
|
+
var previewParentWidth = ((expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor) && shouldUpdateWidthToWidest ? tableMaxWidth : newWidth;
|
|
313
313
|
previewScaleTable(tableRef, {
|
|
314
314
|
node: node,
|
|
315
315
|
prevNode: node,
|
|
316
316
|
start: pos + 1,
|
|
317
317
|
parentWidth: previewParentWidth
|
|
318
|
-
}, editorView.domAtPos.bind(editorView), isTableScalingEnabled, allowFixedColumnWidthOption, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor);
|
|
318
|
+
}, editorView.domAtPos.bind(editorView), isTableScalingEnabled, allowFixedColumnWidthOption, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor);
|
|
319
319
|
chainCommands(function (state, dispatch) {
|
|
320
320
|
return switchToCenterAlignment(pos, node, newWidth, state, dispatch);
|
|
321
321
|
}, updateWidthToWidest(_defineProperty({}, currentTableNodeLocalId, shouldUpdateWidthToWidest)))(state, dispatch);
|
|
@@ -334,7 +334,7 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
334
334
|
dispatch = editorView.dispatch;
|
|
335
335
|
var pos = getPos();
|
|
336
336
|
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 : '';
|
|
337
|
-
var tableMaxWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? undefined // Table's full-width in comment appearance inherit the width of the Editor/Renderer
|
|
337
|
+
var tableMaxWidth = (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? undefined // Table's full-width in comment appearance inherit the width of the Editor/Renderer
|
|
338
338
|
: expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH;
|
|
339
339
|
newWidth = widthToWidest && currentTableNodeLocalId && widthToWidest[currentTableNodeLocalId] ? tableMaxWidth : newWidth;
|
|
340
340
|
var tr = state.tr.setMeta(tableWidthPluginKey, {
|
|
@@ -376,8 +376,8 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
376
376
|
// newWidth can be underined when table is resized to 'full-width'
|
|
377
377
|
// scaleTable function needs number value to work correctly.
|
|
378
378
|
// remove isCommentEditor check when platform_editor_table_resize_chromeless is removed
|
|
379
|
-
parentWidth: expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? originalNewWidth : newWidth
|
|
380
|
-
}, editorView.domAtPos.bind(editorView), pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent || false, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor)(tr);
|
|
379
|
+
parentWidth: (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? originalNewWidth : newWidth
|
|
380
|
+
}, editorView.domAtPos.bind(editorView), pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent || false, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor)(tr);
|
|
381
381
|
|
|
382
382
|
// Ignored via go/ees005
|
|
383
383
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
2
2
|
import { pluginKey } from './plugin-key';
|
|
3
3
|
import { reducer } from './reducer';
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export { createPluginState, createCommand, getPluginState };
|
|
4
|
+
var dest = pluginFactory(pluginKey, reducer);
|
|
5
|
+
export var createPluginState = dest.createPluginState;
|
|
6
|
+
export var createCommand = dest.createCommand;
|
|
7
|
+
export var getPluginState = dest.getPluginState;
|
|
@@ -5,25 +5,24 @@ import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
|
5
5
|
import { pluginKey as tablePluginKey } from '../plugin-key';
|
|
6
6
|
import { pluginKey } from './plugin-key';
|
|
7
7
|
import reducer from './reducer';
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
if (decorationSet) {
|
|
17
|
-
decorationSet = decorationSet.map(tr.mapping, tr.doc);
|
|
18
|
-
}
|
|
19
|
-
return _objectSpread(_objectSpread({}, pluginState), {
|
|
20
|
-
decorationSet: decorationSet
|
|
21
|
-
});
|
|
8
|
+
var dest = pluginFactory(pluginKey, reducer, {
|
|
9
|
+
mapping: function mapping(tr, pluginState) {
|
|
10
|
+
if (tr.docChanged) {
|
|
11
|
+
var decorationSet = pluginState.decorationSet;
|
|
12
|
+
var meta = tr.getMeta(tablePluginKey);
|
|
13
|
+
if (meta && meta.data && meta.data.decorationSet) {
|
|
14
|
+
decorationSet = meta.data.decorationSet;
|
|
22
15
|
}
|
|
23
|
-
|
|
16
|
+
if (decorationSet) {
|
|
17
|
+
decorationSet = decorationSet.map(tr.mapping, tr.doc);
|
|
18
|
+
}
|
|
19
|
+
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
20
|
+
decorationSet: decorationSet
|
|
21
|
+
});
|
|
24
22
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export
|
|
23
|
+
return pluginState;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
export var createPluginState = dest.createPluginState;
|
|
27
|
+
export var createCommand = dest.createCommand;
|
|
28
|
+
export var getPluginState = dest.getPluginState;
|
|
@@ -5,35 +5,34 @@ import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
|
5
5
|
import { handleDocOrSelectionChanged } from './handlers';
|
|
6
6
|
import { pluginKey } from './plugin-key';
|
|
7
7
|
import reducer from './reducer';
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
var updatedTablePos = {};
|
|
21
|
-
if (pluginState.tablePos) {
|
|
22
|
-
var _tr$mapping$mapResult2 = tr.mapping.mapResult(pluginState.tablePos, -1),
|
|
23
|
-
_pos = _tr$mapping$mapResult2.pos,
|
|
24
|
-
_deleted = _tr$mapping$mapResult2.deleted;
|
|
25
|
-
updatedTablePos = {
|
|
26
|
-
tablePos: _deleted ? undefined : _pos
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
return _objectSpread(_objectSpread(_objectSpread({}, pluginState), updatedTargetCell), updatedTablePos);
|
|
8
|
+
var dest = pluginFactory(pluginKey, reducer, {
|
|
9
|
+
mapping: function mapping(tr, pluginState) {
|
|
10
|
+
if (tr.docChanged) {
|
|
11
|
+
var updatedTargetCell = {};
|
|
12
|
+
if (pluginState.targetCellPosition) {
|
|
13
|
+
var _tr$mapping$mapResult = tr.mapping.mapResult(pluginState.targetCellPosition),
|
|
14
|
+
pos = _tr$mapping$mapResult.pos,
|
|
15
|
+
deleted = _tr$mapping$mapResult.deleted;
|
|
16
|
+
updatedTargetCell = {
|
|
17
|
+
targetCellPosition: deleted ? undefined : pos
|
|
18
|
+
};
|
|
30
19
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
20
|
+
var updatedTablePos = {};
|
|
21
|
+
if (pluginState.tablePos) {
|
|
22
|
+
var _tr$mapping$mapResult2 = tr.mapping.mapResult(pluginState.tablePos, -1),
|
|
23
|
+
_pos = _tr$mapping$mapResult2.pos,
|
|
24
|
+
_deleted = _tr$mapping$mapResult2.deleted;
|
|
25
|
+
updatedTablePos = {
|
|
26
|
+
tablePos: _deleted ? undefined : _pos
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return _objectSpread(_objectSpread(_objectSpread({}, pluginState), updatedTargetCell), updatedTablePos);
|
|
30
|
+
}
|
|
31
|
+
return pluginState;
|
|
32
|
+
},
|
|
33
|
+
onDocChanged: handleDocOrSelectionChanged,
|
|
34
|
+
onSelectionChanged: handleDocOrSelectionChanged
|
|
35
|
+
});
|
|
36
|
+
export var createPluginState = dest.createPluginState;
|
|
37
|
+
export var createCommand = dest.createCommand;
|
|
38
|
+
export var getPluginState = dest.getPluginState;
|
|
@@ -25,21 +25,21 @@ var reducer = function reducer(pluginState, action) {
|
|
|
25
25
|
}
|
|
26
26
|
return pluginState;
|
|
27
27
|
};
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
return pluginState;
|
|
28
|
+
var dest = pluginFactory(pluginKey, reducer, {
|
|
29
|
+
mapping: function mapping(tr, pluginState) {
|
|
30
|
+
if (tr.docChanged) {
|
|
31
|
+
return pluginState.map(function (rowInfo) {
|
|
32
|
+
var remapped = tr.mapping.mapResult(rowInfo.pos);
|
|
33
|
+
return remapped ? _objectSpread(_objectSpread({}, rowInfo), {}, {
|
|
34
|
+
pos: remapped.pos
|
|
35
|
+
}) : undefined;
|
|
36
|
+
}).filter(function (f) {
|
|
37
|
+
return f !== undefined;
|
|
38
|
+
});
|
|
41
39
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
return pluginState;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
var createPluginState = dest.createPluginState;
|
|
44
|
+
var createCommand = dest.createCommand;
|
|
45
45
|
export { createPluginState, createCommand };
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { EditorState, SafeStateField, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { AnalyticPluginAction } from './actions';
|
|
5
|
+
import type { AnalyticPluginState } from './types';
|
|
6
|
+
export declare const createPluginState: (dispatch: Dispatch, initialState: AnalyticPluginState | ((state: EditorState) => AnalyticPluginState)) => SafeStateField<AnalyticPluginState>;
|
|
7
|
+
export declare const createCommand: <A = AnalyticPluginAction>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
|
|
8
|
+
export declare const getPluginState: (state: EditorState) => AnalyticPluginState;
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { EditorState, SafeStateField, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { DragAndDropPluginAction } from './actions';
|
|
5
|
+
import type { DragAndDropPluginState } from './types';
|
|
6
|
+
export declare const createPluginState: (dispatch: Dispatch, initialState: DragAndDropPluginState | ((state: EditorState) => DragAndDropPluginState)) => SafeStateField<DragAndDropPluginState>;
|
|
7
|
+
export declare const createCommand: <A = DragAndDropPluginAction>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
|
|
8
|
+
export declare const getPluginState: (state: EditorState) => DragAndDropPluginState;
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { EditorState, SafeStateField, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { TablePluginState, TablePluginAction } from '../types';
|
|
5
|
+
export declare const createPluginState: (dispatch: Dispatch, initialState: TablePluginState | ((state: EditorState) => TablePluginState)) => SafeStateField<TablePluginState>;
|
|
6
|
+
export declare const createCommand: <A = TablePluginAction>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
|
|
7
|
+
export declare const getPluginState: (state: EditorState) => TablePluginState;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { EditorState, SafeStateField, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
1
4
|
import type { StickyPluginAction, StickyPluginState } from './types';
|
|
2
|
-
declare const createPluginState: (dispatch:
|
|
5
|
+
declare const createPluginState: (dispatch: Dispatch, initialState: StickyPluginState | ((state: EditorState) => StickyPluginState)) => SafeStateField<StickyPluginState>;
|
|
6
|
+
declare const createCommand: <A = StickyPluginAction>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
|
|
3
7
|
export { createPluginState, createCommand };
|
|
@@ -5,7 +5,5 @@ type TableWidthInCommentFixPluginState = {
|
|
|
5
5
|
documentHasLoadedOnce: boolean;
|
|
6
6
|
};
|
|
7
7
|
export declare const pluginKey: PluginKey<TableWidthInCommentFixPluginState>;
|
|
8
|
-
declare const createPlugin: (dispatch: Dispatch, isTableAlignmentEnabled: boolean) => SafePlugin<
|
|
9
|
-
documentHasLoadedOnce: boolean;
|
|
10
|
-
}>;
|
|
8
|
+
declare const createPlugin: (dispatch: Dispatch, isTableAlignmentEnabled: boolean) => SafePlugin<TableWidthInCommentFixPluginState>;
|
|
11
9
|
export { createPlugin };
|
|
@@ -13,9 +13,5 @@ type TableWidthPluginState = {
|
|
|
13
13
|
tableRef: HTMLTableElement | null;
|
|
14
14
|
};
|
|
15
15
|
export declare const pluginKey: PluginKey<TableWidthPluginState>;
|
|
16
|
-
declare const createPlugin: (dispatch: Dispatch, dispatchAnalyticsEvent: DispatchAnalyticsEvent, fullWidthEnabled: boolean, maxWidthEnabled: boolean, isTableScalingEnabled: boolean, isTableAlignmentEnabled: boolean, isCommentEditor: boolean) => SafePlugin<
|
|
17
|
-
resizing: boolean;
|
|
18
|
-
tableLocalId: string;
|
|
19
|
-
tableRef: null;
|
|
20
|
-
}>;
|
|
16
|
+
declare const createPlugin: (dispatch: Dispatch, dispatchAnalyticsEvent: DispatchAnalyticsEvent, fullWidthEnabled: boolean, maxWidthEnabled: boolean, isTableScalingEnabled: boolean, isTableAlignmentEnabled: boolean, isCommentEditor: boolean) => SafePlugin<TableWidthPluginState>;
|
|
21
17
|
export { createPlugin };
|
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
7
7
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
8
8
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
9
|
+
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
9
10
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
10
11
|
import type tablePlugin from '../../tablePlugin';
|
|
12
|
+
import type { TableSortMeta } from './types';
|
|
11
13
|
export declare const createPlugin: (api: ExtractInjectionAPI<typeof tablePlugin>, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<{
|
|
14
|
+
allTables: [string, Node, number][];
|
|
12
15
|
decorations: DecorationSet;
|
|
13
|
-
|
|
14
|
-
sort: import("./types").TableSortMeta;
|
|
16
|
+
sort: TableSortMeta;
|
|
15
17
|
}>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx } from '@emotion/react';
|
|
2
1
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
3
2
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -18,4 +17,4 @@ export interface Props {
|
|
|
18
17
|
tableWrapper?: HTMLElement;
|
|
19
18
|
targetCellPosition: number;
|
|
20
19
|
}
|
|
21
|
-
export default function (props: Props):
|
|
20
|
+
export default function (props: Props): JSX.Element;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import { jsx } from '@emotion/react';
|
|
6
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
7
2
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
8
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -24,7 +19,7 @@ interface Props {
|
|
|
24
19
|
targetCellPosition?: number;
|
|
25
20
|
}
|
|
26
21
|
declare const FloatingContextualMenu: {
|
|
27
|
-
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, isCommentEditor, api, isDragMenuOpen, }: Props):
|
|
22
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, isCommentEditor, api, isDragMenuOpen, }: Props): JSX.Element | null;
|
|
28
23
|
displayName: string;
|
|
29
24
|
};
|
|
30
25
|
export default FloatingContextualMenu;
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { EditorState, SafeStateField, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { AnalyticPluginAction } from './actions';
|
|
5
|
+
import type { AnalyticPluginState } from './types';
|
|
6
|
+
export declare const createPluginState: (dispatch: Dispatch, initialState: AnalyticPluginState | ((state: EditorState) => AnalyticPluginState)) => SafeStateField<AnalyticPluginState>;
|
|
7
|
+
export declare const createCommand: <A = AnalyticPluginAction>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
|
|
8
|
+
export declare const getPluginState: (state: EditorState) => AnalyticPluginState;
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { EditorState, SafeStateField, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { DragAndDropPluginAction } from './actions';
|
|
5
|
+
import type { DragAndDropPluginState } from './types';
|
|
6
|
+
export declare const createPluginState: (dispatch: Dispatch, initialState: DragAndDropPluginState | ((state: EditorState) => DragAndDropPluginState)) => SafeStateField<DragAndDropPluginState>;
|
|
7
|
+
export declare const createCommand: <A = DragAndDropPluginAction>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
|
|
8
|
+
export declare const getPluginState: (state: EditorState) => DragAndDropPluginState;
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { EditorState, SafeStateField, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { TablePluginState, TablePluginAction } from '../types';
|
|
5
|
+
export declare const createPluginState: (dispatch: Dispatch, initialState: TablePluginState | ((state: EditorState) => TablePluginState)) => SafeStateField<TablePluginState>;
|
|
6
|
+
export declare const createCommand: <A = TablePluginAction>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
|
|
7
|
+
export declare const getPluginState: (state: EditorState) => TablePluginState;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { EditorState, SafeStateField, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
1
4
|
import type { StickyPluginAction, StickyPluginState } from './types';
|
|
2
|
-
declare const createPluginState: (dispatch:
|
|
5
|
+
declare const createPluginState: (dispatch: Dispatch, initialState: StickyPluginState | ((state: EditorState) => StickyPluginState)) => SafeStateField<StickyPluginState>;
|
|
6
|
+
declare const createCommand: <A = StickyPluginAction>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
|
|
3
7
|
export { createPluginState, createCommand };
|
|
@@ -5,7 +5,5 @@ type TableWidthInCommentFixPluginState = {
|
|
|
5
5
|
documentHasLoadedOnce: boolean;
|
|
6
6
|
};
|
|
7
7
|
export declare const pluginKey: PluginKey<TableWidthInCommentFixPluginState>;
|
|
8
|
-
declare const createPlugin: (dispatch: Dispatch, isTableAlignmentEnabled: boolean) => SafePlugin<
|
|
9
|
-
documentHasLoadedOnce: boolean;
|
|
10
|
-
}>;
|
|
8
|
+
declare const createPlugin: (dispatch: Dispatch, isTableAlignmentEnabled: boolean) => SafePlugin<TableWidthInCommentFixPluginState>;
|
|
11
9
|
export { createPlugin };
|
|
@@ -13,9 +13,5 @@ type TableWidthPluginState = {
|
|
|
13
13
|
tableRef: HTMLTableElement | null;
|
|
14
14
|
};
|
|
15
15
|
export declare const pluginKey: PluginKey<TableWidthPluginState>;
|
|
16
|
-
declare const createPlugin: (dispatch: Dispatch, dispatchAnalyticsEvent: DispatchAnalyticsEvent, fullWidthEnabled: boolean, maxWidthEnabled: boolean, isTableScalingEnabled: boolean, isTableAlignmentEnabled: boolean, isCommentEditor: boolean) => SafePlugin<
|
|
17
|
-
resizing: boolean;
|
|
18
|
-
tableLocalId: string;
|
|
19
|
-
tableRef: null;
|
|
20
|
-
}>;
|
|
16
|
+
declare const createPlugin: (dispatch: Dispatch, dispatchAnalyticsEvent: DispatchAnalyticsEvent, fullWidthEnabled: boolean, maxWidthEnabled: boolean, isTableScalingEnabled: boolean, isTableAlignmentEnabled: boolean, isCommentEditor: boolean) => SafePlugin<TableWidthPluginState>;
|
|
21
17
|
export { createPlugin };
|
|
@@ -6,14 +6,16 @@
|
|
|
6
6
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
7
7
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
8
8
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
9
|
+
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
9
10
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
10
11
|
import type tablePlugin from '../../tablePlugin';
|
|
12
|
+
import type { TableSortMeta } from './types';
|
|
11
13
|
export declare const createPlugin: (api: ExtractInjectionAPI<typeof tablePlugin>, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<{
|
|
12
|
-
decorations: DecorationSet;
|
|
13
14
|
allTables: [
|
|
14
15
|
string,
|
|
15
|
-
|
|
16
|
+
Node,
|
|
16
17
|
number
|
|
17
18
|
][];
|
|
18
|
-
|
|
19
|
+
decorations: DecorationSet;
|
|
20
|
+
sort: TableSortMeta;
|
|
19
21
|
}>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx } from '@emotion/react';
|
|
2
1
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
3
2
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -18,4 +17,4 @@ export interface Props {
|
|
|
18
17
|
tableWrapper?: HTMLElement;
|
|
19
18
|
targetCellPosition: number;
|
|
20
19
|
}
|
|
21
|
-
export default function (props: Props):
|
|
20
|
+
export default function (props: Props): JSX.Element;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import { jsx } from '@emotion/react';
|
|
6
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
7
2
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
8
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -24,7 +19,7 @@ interface Props {
|
|
|
24
19
|
targetCellPosition?: number;
|
|
25
20
|
}
|
|
26
21
|
declare const FloatingContextualMenu: {
|
|
27
|
-
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, isCommentEditor, api, isDragMenuOpen, }: Props):
|
|
22
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, isCommentEditor, api, isDragMenuOpen, }: Props): JSX.Element | null;
|
|
28
23
|
displayName: string;
|
|
29
24
|
};
|
|
30
25
|
export default FloatingContextualMenu;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "22.2.
|
|
3
|
+
"version": "22.2.9",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/editor-plugin-batch-attribute-updates": "^10.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-content-insertion": "^10.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-viewmode": "^12.0.0",
|
|
40
|
-
"@atlaskit/editor-plugin-extension": "13.1.
|
|
40
|
+
"@atlaskit/editor-plugin-extension": "13.1.5",
|
|
41
41
|
"@atlaskit/editor-plugin-guideline": "^10.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-interaction": "^19.0.0",
|
|
43
43
|
"@atlaskit/editor-plugin-limited-mode": "^7.1.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
57
57
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
|
|
58
58
|
"@atlaskit/primitives": "^19.0.0",
|
|
59
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
59
|
+
"@atlaskit/tmp-editor-statsig": "^71.0.0",
|
|
60
60
|
"@atlaskit/toggle": "^15.6.0",
|
|
61
61
|
"@atlaskit/tokens": "^13.0.0",
|
|
62
62
|
"@atlaskit/tooltip": "^21.2.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"uuid": "^3.1.0"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@atlaskit/editor-common": "^114.
|
|
73
|
+
"@atlaskit/editor-common": "^114.12.0",
|
|
74
74
|
"react": "^18.2.0",
|
|
75
75
|
"react-dom": "^18.2.0",
|
|
76
76
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|