@atlaskit/editor-common 103.1.0 → 103.1.2
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/monitoring/error.js +1 -1
- package/dist/cjs/node-width/index.js +20 -47
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/node-width/index.js +18 -45
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/node-width/index.js +20 -47
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/types/floating-toolbar.d.ts +9 -0
- package/dist/types-ts4.5/types/floating-toolbar.d.ts +9 -0
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 103.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#137753](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/137753)
|
|
8
|
+
[`fe189a7e249e9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fe189a7e249e9) -
|
|
9
|
+
EDITOR-317 Cleans up feature gate `platform_editor_nested_tables_resizing`
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 103.1.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#138280](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/138280)
|
|
17
|
+
[`f2eac0d6772c2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2eac0d6772c2) -
|
|
18
|
+
[ux] Adds a new temporary floating toolbar's config option to hide any toolbars when any table's
|
|
19
|
+
menu is opened.
|
|
20
|
+
|
|
3
21
|
## 103.1.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
19
19
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
20
|
-
var packageVersion = "103.1.
|
|
20
|
+
var packageVersion = "103.1.2";
|
|
21
21
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
22
22
|
// Remove URL as it has UGC
|
|
23
23
|
// Ignored via go/ees007
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.layoutToWidth = exports.getTableWidthWithNumberColumn = exports.getTableContainerWidth = exports.getParentNodeWidth = void 0;
|
|
7
7
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
8
8
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
9
|
var _extension = require("../styles/shared/extension");
|
|
11
10
|
var _layout = require("../styles/shared/layout");
|
|
12
11
|
var _table = require("../styles/shared/table");
|
|
@@ -26,6 +25,7 @@ var layoutToWidth = exports.layoutToWidth = {
|
|
|
26
25
|
* If current node selection is not nested will return undefined
|
|
27
26
|
*/
|
|
28
27
|
var getParentNodeWidth = exports.getParentNodeWidth = function getParentNodeWidth(pos, state, containerWidth, isFullWidthModeEnabled) {
|
|
28
|
+
var _contextPanelPluginKe, _contextPanelPluginKe2;
|
|
29
29
|
if (!pos) {
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
@@ -51,40 +51,20 @@ var getParentNodeWidth = exports.getParentNodeWidth = function getParentNodeWidt
|
|
|
51
51
|
return state['contextPanelPluginKey$'];
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
-
if (node.type === schema.nodes.layoutSection && !(0, _platformFeatureFlags.fg)('platform_editor_nested_tables_resizing')) {
|
|
55
|
-
var _contextPanelPluginKe, _contextPanelPluginKe2;
|
|
56
|
-
parentWidth += _editorSharedStyles.akLayoutGutterOffset * 2; // extra width that gets added to layout
|
|
57
|
-
|
|
58
|
-
// Calculate width of parent layout column when
|
|
59
|
-
// Parallel layout with viewport greater than 1024px
|
|
60
|
-
// OR side panel of an extension is open and change the node width to smaller than containerWidth
|
|
61
|
-
if (containerWidth.width > _editorSharedStyles.gridMediumMaxWidth || ((_contextPanelPluginKe = contextPanelPluginKey.getState(state)) === null || _contextPanelPluginKe === void 0 ? void 0 : _contextPanelPluginKe.contents.length) > 0 && ((_contextPanelPluginKe2 = contextPanelPluginKey.getState(state)) === null || _contextPanelPluginKe2 === void 0 ? void 0 : _contextPanelPluginKe2.contents[0]) !== undefined) {
|
|
62
|
-
parentWidth -= (_layout.LAYOUT_SECTION_MARGIN + 2) * (node.childCount - 1); // margin between sections
|
|
63
|
-
var $pos = state.doc.resolve(pos);
|
|
64
|
-
var column = (0, _utils.findParentNodeOfTypeClosestToPos)($pos, [state.schema.nodes.layoutColumn]);
|
|
65
|
-
if (column && column.node && !isNaN(column.node.attrs.width)) {
|
|
66
|
-
// get exact width of parent layout column using node attrs
|
|
67
|
-
parentWidth = Math.round(parentWidth * column.node.attrs.width * 0.01);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
54
|
switch (node.type) {
|
|
72
55
|
case schema.nodes.layoutSection:
|
|
73
|
-
|
|
74
|
-
var _contextPanelPluginKe3, _contextPanelPluginKe4;
|
|
75
|
-
parentWidth += _editorSharedStyles.akLayoutGutterOffset * 2; // extra width that gets added to layout
|
|
56
|
+
parentWidth += _editorSharedStyles.akLayoutGutterOffset * 2; // extra width that gets added to layout
|
|
76
57
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
58
|
+
// Calculate width of parent layout column when
|
|
59
|
+
// Parallel layout with viewport greater than 1024px
|
|
60
|
+
// OR side panel of an extension is open and change the node width to smaller than containerWidth
|
|
61
|
+
if (containerWidth.width > _editorSharedStyles.gridMediumMaxWidth || ((_contextPanelPluginKe = contextPanelPluginKey.getState(state)) === null || _contextPanelPluginKe === void 0 ? void 0 : _contextPanelPluginKe.contents.length) > 0 && ((_contextPanelPluginKe2 = contextPanelPluginKey.getState(state)) === null || _contextPanelPluginKe2 === void 0 ? void 0 : _contextPanelPluginKe2.contents[0]) !== undefined) {
|
|
62
|
+
parentWidth -= (_layout.LAYOUT_SECTION_MARGIN + 2) * (node.childCount - 1); // margin between sections
|
|
63
|
+
var $pos = state.doc.resolve(pos);
|
|
64
|
+
var column = (0, _utils.findParentNodeOfTypeClosestToPos)($pos, [state.schema.nodes.layoutColumn]);
|
|
65
|
+
if (column && column.node && !isNaN(column.node.attrs.width)) {
|
|
66
|
+
// get exact width of parent layout column using node attrs
|
|
67
|
+
parentWidth = Math.round(parentWidth * column.node.attrs.width * 0.01);
|
|
88
68
|
}
|
|
89
69
|
}
|
|
90
70
|
|
|
@@ -109,16 +89,14 @@ var getParentNodeWidth = exports.getParentNodeWidth = function getParentNodeWidt
|
|
|
109
89
|
break;
|
|
110
90
|
case schema.nodes.tableCell:
|
|
111
91
|
case schema.nodes.tableHeader:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}, 0);
|
|
118
|
-
}
|
|
119
|
-
// Compensate for padding
|
|
120
|
-
parentWidth -= _table.tableCellPadding * 2;
|
|
92
|
+
// Calculate the available column width
|
|
93
|
+
if (Array.isArray(node.attrs.colwidth)) {
|
|
94
|
+
parentWidth = node.attrs.colwidth.slice(0, node.attrs.colspan).reduce(function (sum, width) {
|
|
95
|
+
return sum + width;
|
|
96
|
+
}, 0);
|
|
121
97
|
}
|
|
98
|
+
// Compensate for padding
|
|
99
|
+
parentWidth -= _table.tableCellPadding * 2;
|
|
122
100
|
break;
|
|
123
101
|
}
|
|
124
102
|
parentWidth -= 2; // border
|
|
@@ -130,12 +108,7 @@ var getNestedParentNode = function getNestedParentNode(tablePos, state) {
|
|
|
130
108
|
return null;
|
|
131
109
|
}
|
|
132
110
|
var $pos = state.doc.resolve(tablePos);
|
|
133
|
-
var parent;
|
|
134
|
-
if ((0, _platformFeatureFlags.fg)('platform_editor_nested_tables_resizing')) {
|
|
135
|
-
parent = (0, _utils.findParentNodeOfTypeClosestToPos)($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.extensionFrame, state.schema.nodes.layoutSection, state.schema.nodes.expand, state.schema.nodes.tableCell, state.schema.nodes.tableHeader]);
|
|
136
|
-
} else {
|
|
137
|
-
parent = (0, _utils.findParentNodeOfTypeClosestToPos)($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.extensionFrame, state.schema.nodes.layoutSection, state.schema.nodes.expand]);
|
|
138
|
-
}
|
|
111
|
+
var parent = (0, _utils.findParentNodeOfTypeClosestToPos)($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.extensionFrame, state.schema.nodes.layoutSection, state.schema.nodes.expand, state.schema.nodes.tableCell, state.schema.nodes.tableHeader]);
|
|
139
112
|
return parent ? parent.node : null;
|
|
140
113
|
};
|
|
141
114
|
var calcBreakoutNodeWidth = function calcBreakoutNodeWidth(layout, containerWidth, isFullWidthModeEnabled) {
|
|
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
23
23
|
* @jsx jsx
|
|
24
24
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
25
25
|
var packageName = "@atlaskit/editor-common";
|
|
26
|
-
var packageVersion = "103.1.
|
|
26
|
+
var packageVersion = "103.1.2";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
// Ignored via go/ees005
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isFedRamp } from './environment';
|
|
2
2
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
3
3
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
4
|
-
const packageVersion = "103.1.
|
|
4
|
+
const packageVersion = "103.1.2";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// Ignored via go/ees007
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
2
2
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorWideLayoutWidth, akLayoutGutterOffset, gridMediumMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { BODIED_EXT_PADDING } from '../styles/shared/extension';
|
|
5
4
|
import { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN } from '../styles/shared/layout';
|
|
6
5
|
import { tableCellPadding } from '../styles/shared/table';
|
|
@@ -20,6 +19,7 @@ export const layoutToWidth = {
|
|
|
20
19
|
* If current node selection is not nested will return undefined
|
|
21
20
|
*/
|
|
22
21
|
export const getParentNodeWidth = (pos, state, containerWidth, isFullWidthModeEnabled) => {
|
|
22
|
+
var _contextPanelPluginKe, _contextPanelPluginKe2;
|
|
23
23
|
if (!pos) {
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
@@ -47,40 +47,20 @@ export const getParentNodeWidth = (pos, state, containerWidth, isFullWidthModeEn
|
|
|
47
47
|
return state['contextPanelPluginKey$'];
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
if (node.type === schema.nodes.layoutSection && !fg('platform_editor_nested_tables_resizing')) {
|
|
51
|
-
var _contextPanelPluginKe, _contextPanelPluginKe2;
|
|
52
|
-
parentWidth += akLayoutGutterOffset * 2; // extra width that gets added to layout
|
|
53
|
-
|
|
54
|
-
// Calculate width of parent layout column when
|
|
55
|
-
// Parallel layout with viewport greater than 1024px
|
|
56
|
-
// OR side panel of an extension is open and change the node width to smaller than containerWidth
|
|
57
|
-
if (containerWidth.width > gridMediumMaxWidth || ((_contextPanelPluginKe = contextPanelPluginKey.getState(state)) === null || _contextPanelPluginKe === void 0 ? void 0 : _contextPanelPluginKe.contents.length) > 0 && ((_contextPanelPluginKe2 = contextPanelPluginKey.getState(state)) === null || _contextPanelPluginKe2 === void 0 ? void 0 : _contextPanelPluginKe2.contents[0]) !== undefined) {
|
|
58
|
-
parentWidth -= (LAYOUT_SECTION_MARGIN + 2) * (node.childCount - 1); // margin between sections
|
|
59
|
-
const $pos = state.doc.resolve(pos);
|
|
60
|
-
const column = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.layoutColumn]);
|
|
61
|
-
if (column && column.node && !isNaN(column.node.attrs.width)) {
|
|
62
|
-
// get exact width of parent layout column using node attrs
|
|
63
|
-
parentWidth = Math.round(parentWidth * column.node.attrs.width * 0.01);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
50
|
switch (node.type) {
|
|
68
51
|
case schema.nodes.layoutSection:
|
|
69
|
-
|
|
70
|
-
var _contextPanelPluginKe3, _contextPanelPluginKe4;
|
|
71
|
-
parentWidth += akLayoutGutterOffset * 2; // extra width that gets added to layout
|
|
52
|
+
parentWidth += akLayoutGutterOffset * 2; // extra width that gets added to layout
|
|
72
53
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
54
|
+
// Calculate width of parent layout column when
|
|
55
|
+
// Parallel layout with viewport greater than 1024px
|
|
56
|
+
// OR side panel of an extension is open and change the node width to smaller than containerWidth
|
|
57
|
+
if (containerWidth.width > gridMediumMaxWidth || ((_contextPanelPluginKe = contextPanelPluginKey.getState(state)) === null || _contextPanelPluginKe === void 0 ? void 0 : _contextPanelPluginKe.contents.length) > 0 && ((_contextPanelPluginKe2 = contextPanelPluginKey.getState(state)) === null || _contextPanelPluginKe2 === void 0 ? void 0 : _contextPanelPluginKe2.contents[0]) !== undefined) {
|
|
58
|
+
parentWidth -= (LAYOUT_SECTION_MARGIN + 2) * (node.childCount - 1); // margin between sections
|
|
59
|
+
const $pos = state.doc.resolve(pos);
|
|
60
|
+
const column = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.layoutColumn]);
|
|
61
|
+
if (column && column.node && !isNaN(column.node.attrs.width)) {
|
|
62
|
+
// get exact width of parent layout column using node attrs
|
|
63
|
+
parentWidth = Math.round(parentWidth * column.node.attrs.width * 0.01);
|
|
84
64
|
}
|
|
85
65
|
}
|
|
86
66
|
|
|
@@ -105,14 +85,12 @@ export const getParentNodeWidth = (pos, state, containerWidth, isFullWidthModeEn
|
|
|
105
85
|
break;
|
|
106
86
|
case schema.nodes.tableCell:
|
|
107
87
|
case schema.nodes.tableHeader:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
parentWidth = node.attrs.colwidth.slice(0, node.attrs.colspan).reduce((sum, width) => sum + width, 0);
|
|
112
|
-
}
|
|
113
|
-
// Compensate for padding
|
|
114
|
-
parentWidth -= tableCellPadding * 2;
|
|
88
|
+
// Calculate the available column width
|
|
89
|
+
if (Array.isArray(node.attrs.colwidth)) {
|
|
90
|
+
parentWidth = node.attrs.colwidth.slice(0, node.attrs.colspan).reduce((sum, width) => sum + width, 0);
|
|
115
91
|
}
|
|
92
|
+
// Compensate for padding
|
|
93
|
+
parentWidth -= tableCellPadding * 2;
|
|
116
94
|
break;
|
|
117
95
|
}
|
|
118
96
|
parentWidth -= 2; // border
|
|
@@ -124,12 +102,7 @@ const getNestedParentNode = (tablePos, state) => {
|
|
|
124
102
|
return null;
|
|
125
103
|
}
|
|
126
104
|
const $pos = state.doc.resolve(tablePos);
|
|
127
|
-
|
|
128
|
-
if (fg('platform_editor_nested_tables_resizing')) {
|
|
129
|
-
parent = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.extensionFrame, state.schema.nodes.layoutSection, state.schema.nodes.expand, state.schema.nodes.tableCell, state.schema.nodes.tableHeader]);
|
|
130
|
-
} else {
|
|
131
|
-
parent = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.extensionFrame, state.schema.nodes.layoutSection, state.schema.nodes.expand]);
|
|
132
|
-
}
|
|
105
|
+
const parent = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.extensionFrame, state.schema.nodes.layoutSection, state.schema.nodes.expand, state.schema.nodes.tableCell, state.schema.nodes.tableHeader]);
|
|
133
106
|
return parent ? parent.node : null;
|
|
134
107
|
};
|
|
135
108
|
const calcBreakoutNodeWidth = (layout, containerWidth, isFullWidthModeEnabled) => {
|
|
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
13
13
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
14
14
|
import Layer from '../Layer';
|
|
15
15
|
const packageName = "@atlaskit/editor-common";
|
|
16
|
-
const packageVersion = "103.1.
|
|
16
|
+
const packageVersion = "103.1.2";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
// Ignored via go/ees005
|
|
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import { isFedRamp } from './environment';
|
|
8
8
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
9
9
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
10
|
-
var packageVersion = "103.1.
|
|
10
|
+
var packageVersion = "103.1.2";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// Ignored via go/ees007
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
2
2
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorWideLayoutWidth, akLayoutGutterOffset, gridMediumMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { BODIED_EXT_PADDING } from '../styles/shared/extension';
|
|
5
4
|
import { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN } from '../styles/shared/layout';
|
|
6
5
|
import { tableCellPadding } from '../styles/shared/table';
|
|
@@ -20,6 +19,7 @@ export var layoutToWidth = {
|
|
|
20
19
|
* If current node selection is not nested will return undefined
|
|
21
20
|
*/
|
|
22
21
|
export var getParentNodeWidth = function getParentNodeWidth(pos, state, containerWidth, isFullWidthModeEnabled) {
|
|
22
|
+
var _contextPanelPluginKe, _contextPanelPluginKe2;
|
|
23
23
|
if (!pos) {
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
@@ -45,40 +45,20 @@ export var getParentNodeWidth = function getParentNodeWidth(pos, state, containe
|
|
|
45
45
|
return state['contextPanelPluginKey$'];
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
if (node.type === schema.nodes.layoutSection && !fg('platform_editor_nested_tables_resizing')) {
|
|
49
|
-
var _contextPanelPluginKe, _contextPanelPluginKe2;
|
|
50
|
-
parentWidth += akLayoutGutterOffset * 2; // extra width that gets added to layout
|
|
51
|
-
|
|
52
|
-
// Calculate width of parent layout column when
|
|
53
|
-
// Parallel layout with viewport greater than 1024px
|
|
54
|
-
// OR side panel of an extension is open and change the node width to smaller than containerWidth
|
|
55
|
-
if (containerWidth.width > gridMediumMaxWidth || ((_contextPanelPluginKe = contextPanelPluginKey.getState(state)) === null || _contextPanelPluginKe === void 0 ? void 0 : _contextPanelPluginKe.contents.length) > 0 && ((_contextPanelPluginKe2 = contextPanelPluginKey.getState(state)) === null || _contextPanelPluginKe2 === void 0 ? void 0 : _contextPanelPluginKe2.contents[0]) !== undefined) {
|
|
56
|
-
parentWidth -= (LAYOUT_SECTION_MARGIN + 2) * (node.childCount - 1); // margin between sections
|
|
57
|
-
var $pos = state.doc.resolve(pos);
|
|
58
|
-
var column = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.layoutColumn]);
|
|
59
|
-
if (column && column.node && !isNaN(column.node.attrs.width)) {
|
|
60
|
-
// get exact width of parent layout column using node attrs
|
|
61
|
-
parentWidth = Math.round(parentWidth * column.node.attrs.width * 0.01);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
48
|
switch (node.type) {
|
|
66
49
|
case schema.nodes.layoutSection:
|
|
67
|
-
|
|
68
|
-
var _contextPanelPluginKe3, _contextPanelPluginKe4;
|
|
69
|
-
parentWidth += akLayoutGutterOffset * 2; // extra width that gets added to layout
|
|
50
|
+
parentWidth += akLayoutGutterOffset * 2; // extra width that gets added to layout
|
|
70
51
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
52
|
+
// Calculate width of parent layout column when
|
|
53
|
+
// Parallel layout with viewport greater than 1024px
|
|
54
|
+
// OR side panel of an extension is open and change the node width to smaller than containerWidth
|
|
55
|
+
if (containerWidth.width > gridMediumMaxWidth || ((_contextPanelPluginKe = contextPanelPluginKey.getState(state)) === null || _contextPanelPluginKe === void 0 ? void 0 : _contextPanelPluginKe.contents.length) > 0 && ((_contextPanelPluginKe2 = contextPanelPluginKey.getState(state)) === null || _contextPanelPluginKe2 === void 0 ? void 0 : _contextPanelPluginKe2.contents[0]) !== undefined) {
|
|
56
|
+
parentWidth -= (LAYOUT_SECTION_MARGIN + 2) * (node.childCount - 1); // margin between sections
|
|
57
|
+
var $pos = state.doc.resolve(pos);
|
|
58
|
+
var column = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.layoutColumn]);
|
|
59
|
+
if (column && column.node && !isNaN(column.node.attrs.width)) {
|
|
60
|
+
// get exact width of parent layout column using node attrs
|
|
61
|
+
parentWidth = Math.round(parentWidth * column.node.attrs.width * 0.01);
|
|
82
62
|
}
|
|
83
63
|
}
|
|
84
64
|
|
|
@@ -103,16 +83,14 @@ export var getParentNodeWidth = function getParentNodeWidth(pos, state, containe
|
|
|
103
83
|
break;
|
|
104
84
|
case schema.nodes.tableCell:
|
|
105
85
|
case schema.nodes.tableHeader:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}, 0);
|
|
112
|
-
}
|
|
113
|
-
// Compensate for padding
|
|
114
|
-
parentWidth -= tableCellPadding * 2;
|
|
86
|
+
// Calculate the available column width
|
|
87
|
+
if (Array.isArray(node.attrs.colwidth)) {
|
|
88
|
+
parentWidth = node.attrs.colwidth.slice(0, node.attrs.colspan).reduce(function (sum, width) {
|
|
89
|
+
return sum + width;
|
|
90
|
+
}, 0);
|
|
115
91
|
}
|
|
92
|
+
// Compensate for padding
|
|
93
|
+
parentWidth -= tableCellPadding * 2;
|
|
116
94
|
break;
|
|
117
95
|
}
|
|
118
96
|
parentWidth -= 2; // border
|
|
@@ -124,12 +102,7 @@ var getNestedParentNode = function getNestedParentNode(tablePos, state) {
|
|
|
124
102
|
return null;
|
|
125
103
|
}
|
|
126
104
|
var $pos = state.doc.resolve(tablePos);
|
|
127
|
-
var parent;
|
|
128
|
-
if (fg('platform_editor_nested_tables_resizing')) {
|
|
129
|
-
parent = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.extensionFrame, state.schema.nodes.layoutSection, state.schema.nodes.expand, state.schema.nodes.tableCell, state.schema.nodes.tableHeader]);
|
|
130
|
-
} else {
|
|
131
|
-
parent = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.extensionFrame, state.schema.nodes.layoutSection, state.schema.nodes.expand]);
|
|
132
|
-
}
|
|
105
|
+
var parent = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.extensionFrame, state.schema.nodes.layoutSection, state.schema.nodes.expand, state.schema.nodes.tableCell, state.schema.nodes.tableHeader]);
|
|
133
106
|
return parent ? parent.node : null;
|
|
134
107
|
};
|
|
135
108
|
var calcBreakoutNodeWidth = function calcBreakoutNodeWidth(layout, containerWidth, isFullWidthModeEnabled) {
|
|
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
20
20
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
21
21
|
import Layer from '../Layer';
|
|
22
22
|
var packageName = "@atlaskit/editor-common";
|
|
23
|
-
var packageVersion = "103.1.
|
|
23
|
+
var packageVersion = "103.1.2";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
// Ignored via go/ees005
|
|
@@ -339,6 +339,15 @@ export interface FloatingToolbarConfig {
|
|
|
339
339
|
* @see clean up ticket ED-26803
|
|
340
340
|
*/
|
|
341
341
|
forceStaticToolbar?: boolean;
|
|
342
|
+
/**
|
|
343
|
+
* For internal use only, we will be depricating this API soon.
|
|
344
|
+
* If any config has __suppressAllToolbars set to true, no floating toolbar will be rendered.
|
|
345
|
+
* Use case:
|
|
346
|
+
* When a node is nested inside a table and the cursor is inside of the nested node.
|
|
347
|
+
* Nested node's toolbar is active. When table's menu opens, we provide table's config with
|
|
348
|
+
* __suppressAllToolbars set to true.
|
|
349
|
+
*/
|
|
350
|
+
__suppressAllToolbars?: boolean;
|
|
342
351
|
}
|
|
343
352
|
export type FloatingToolbarHandler = (state: EditorState, intl: IntlShape, providerFactory: ProviderFactory, processedConfigs?: Array<FloatingToolbarConfig>) => FloatingToolbarConfig | undefined;
|
|
344
353
|
export {};
|
|
@@ -342,6 +342,15 @@ export interface FloatingToolbarConfig {
|
|
|
342
342
|
* @see clean up ticket ED-26803
|
|
343
343
|
*/
|
|
344
344
|
forceStaticToolbar?: boolean;
|
|
345
|
+
/**
|
|
346
|
+
* For internal use only, we will be depricating this API soon.
|
|
347
|
+
* If any config has __suppressAllToolbars set to true, no floating toolbar will be rendered.
|
|
348
|
+
* Use case:
|
|
349
|
+
* When a node is nested inside a table and the cursor is inside of the nested node.
|
|
350
|
+
* Nested node's toolbar is active. When table's menu opens, we provide table's config with
|
|
351
|
+
* __suppressAllToolbars set to true.
|
|
352
|
+
*/
|
|
353
|
+
__suppressAllToolbars?: boolean;
|
|
345
354
|
}
|
|
346
355
|
export type FloatingToolbarHandler = (state: EditorState, intl: IntlShape, providerFactory: ProviderFactory, processedConfigs?: Array<FloatingToolbarConfig>) => FloatingToolbarConfig | undefined;
|
|
347
356
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "103.1.
|
|
3
|
+
"version": "103.1.2",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"@atlaskit/primitives": "^14.3.0",
|
|
157
157
|
"@atlaskit/profilecard": "^23.7.0",
|
|
158
158
|
"@atlaskit/section-message": "^8.2.0",
|
|
159
|
-
"@atlaskit/smart-card": "^36.
|
|
159
|
+
"@atlaskit/smart-card": "^36.3.0",
|
|
160
160
|
"@atlaskit/smart-user-picker": "^8.0.0",
|
|
161
161
|
"@atlaskit/spinner": "^18.0.0",
|
|
162
162
|
"@atlaskit/task-decision": "^19.1.0",
|
|
@@ -293,9 +293,6 @@
|
|
|
293
293
|
"platform_editor_multi_body_extension_extensibility": {
|
|
294
294
|
"type": "boolean"
|
|
295
295
|
},
|
|
296
|
-
"platform_editor_nested_tables_resizing": {
|
|
297
|
-
"type": "boolean"
|
|
298
|
-
},
|
|
299
296
|
"platform_editor_renderer_table_header_styles": {
|
|
300
297
|
"type": "boolean"
|
|
301
298
|
},
|