@atlaskit/editor-plugin-table 7.4.3 → 7.4.4
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 +6 -0
- package/dist/cjs/utils/nodes.js +4 -3
- package/dist/es2019/utils/nodes.js +4 -3
- package/dist/esm/utils/nodes.js +4 -3
- package/package.json +1 -1
- package/src/utils/nodes.ts +10 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.4.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#75436](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75436) [`bfcf32bb4fa3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bfcf32bb4fa3) - [ux] ED-21941 Disable resize/layout options for table, media and extension when added to MBE. Table rendering fixed for Confluence editor
|
|
8
|
+
|
|
3
9
|
## 7.4.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/utils/nodes.js
CHANGED
|
@@ -63,8 +63,9 @@ var isLayoutSupported = exports.isLayoutSupported = function isLayoutSupported(s
|
|
|
63
63
|
var _state$schema$nodes = state.schema.nodes,
|
|
64
64
|
bodiedExtension = _state$schema$nodes.bodiedExtension,
|
|
65
65
|
layoutSection = _state$schema$nodes.layoutSection,
|
|
66
|
-
expand = _state$schema$nodes.expand
|
|
67
|
-
|
|
66
|
+
expand = _state$schema$nodes.expand,
|
|
67
|
+
extensionFrame = _state$schema$nodes.extensionFrame;
|
|
68
|
+
return !(0, _utils2.hasParentNodeOfType)([expand, layoutSection, bodiedExtension, extensionFrame])(state.selection) && !!permittedLayouts && (permittedLayouts === 'all' || permittedLayouts.indexOf('default') > -1 && permittedLayouts.indexOf('wide') > -1 && permittedLayouts.indexOf('full-width') > -1);
|
|
68
69
|
};
|
|
69
70
|
var getTableWidth = exports.getTableWidth = function getTableWidth(node) {
|
|
70
71
|
return getTableWidths(node).reduce(function (acc, current) {
|
|
@@ -111,7 +112,7 @@ var isTableNested = exports.isTableNested = function isTableNested(state) {
|
|
|
111
112
|
var tablePos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
112
113
|
var parent = state.doc.resolve(tablePos).parent;
|
|
113
114
|
var nodeTypes = state.schema.nodes;
|
|
114
|
-
return parent.type === nodeTypes.layoutColumn || parent.type === nodeTypes.expand || parent.type === nodeTypes.bodiedExtension;
|
|
115
|
+
return parent.type === nodeTypes.layoutColumn || parent.type === nodeTypes.expand || parent.type === nodeTypes.bodiedExtension || parent.type === nodeTypes.extensionFrame;
|
|
115
116
|
};
|
|
116
117
|
var anyChildCellMergedAcrossRow = exports.anyChildCellMergedAcrossRow = function anyChildCellMergedAcrossRow(node) {
|
|
117
118
|
return (0, _utils.mapChildren)(node, function (child) {
|
|
@@ -48,9 +48,10 @@ export const isLayoutSupported = state => {
|
|
|
48
48
|
const {
|
|
49
49
|
bodiedExtension,
|
|
50
50
|
layoutSection,
|
|
51
|
-
expand
|
|
51
|
+
expand,
|
|
52
|
+
extensionFrame
|
|
52
53
|
} = state.schema.nodes;
|
|
53
|
-
return !hasParentNodeOfType([expand, layoutSection, bodiedExtension])(state.selection) && !!permittedLayouts && (permittedLayouts === 'all' || permittedLayouts.indexOf('default') > -1 && permittedLayouts.indexOf('wide') > -1 && permittedLayouts.indexOf('full-width') > -1);
|
|
54
|
+
return !hasParentNodeOfType([expand, layoutSection, bodiedExtension, extensionFrame])(state.selection) && !!permittedLayouts && (permittedLayouts === 'all' || permittedLayouts.indexOf('default') > -1 && permittedLayouts.indexOf('wide') > -1 && permittedLayouts.indexOf('full-width') > -1);
|
|
54
55
|
};
|
|
55
56
|
export const getTableWidth = node => {
|
|
56
57
|
return getTableWidths(node).reduce((acc, current) => acc + current, 0);
|
|
@@ -94,7 +95,7 @@ function getTableWidths(node) {
|
|
|
94
95
|
export const isTableNested = (state, tablePos = 0) => {
|
|
95
96
|
const parent = state.doc.resolve(tablePos).parent;
|
|
96
97
|
const nodeTypes = state.schema.nodes;
|
|
97
|
-
return parent.type === nodeTypes.layoutColumn || parent.type === nodeTypes.expand || parent.type === nodeTypes.bodiedExtension;
|
|
98
|
+
return parent.type === nodeTypes.layoutColumn || parent.type === nodeTypes.expand || parent.type === nodeTypes.bodiedExtension || parent.type === nodeTypes.extensionFrame;
|
|
98
99
|
};
|
|
99
100
|
export const anyChildCellMergedAcrossRow = node => mapChildren(node, child => child.attrs.rowspan || 0).some(rowspan => rowspan > 1);
|
|
100
101
|
|
package/dist/esm/utils/nodes.js
CHANGED
|
@@ -56,8 +56,9 @@ export var isLayoutSupported = function isLayoutSupported(state) {
|
|
|
56
56
|
var _state$schema$nodes = state.schema.nodes,
|
|
57
57
|
bodiedExtension = _state$schema$nodes.bodiedExtension,
|
|
58
58
|
layoutSection = _state$schema$nodes.layoutSection,
|
|
59
|
-
expand = _state$schema$nodes.expand
|
|
60
|
-
|
|
59
|
+
expand = _state$schema$nodes.expand,
|
|
60
|
+
extensionFrame = _state$schema$nodes.extensionFrame;
|
|
61
|
+
return !hasParentNodeOfType([expand, layoutSection, bodiedExtension, extensionFrame])(state.selection) && !!permittedLayouts && (permittedLayouts === 'all' || permittedLayouts.indexOf('default') > -1 && permittedLayouts.indexOf('wide') > -1 && permittedLayouts.indexOf('full-width') > -1);
|
|
61
62
|
};
|
|
62
63
|
export var getTableWidth = function getTableWidth(node) {
|
|
63
64
|
return getTableWidths(node).reduce(function (acc, current) {
|
|
@@ -104,7 +105,7 @@ export var isTableNested = function isTableNested(state) {
|
|
|
104
105
|
var tablePos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
105
106
|
var parent = state.doc.resolve(tablePos).parent;
|
|
106
107
|
var nodeTypes = state.schema.nodes;
|
|
107
|
-
return parent.type === nodeTypes.layoutColumn || parent.type === nodeTypes.expand || parent.type === nodeTypes.bodiedExtension;
|
|
108
|
+
return parent.type === nodeTypes.layoutColumn || parent.type === nodeTypes.expand || parent.type === nodeTypes.bodiedExtension || parent.type === nodeTypes.extensionFrame;
|
|
108
109
|
};
|
|
109
110
|
export var anyChildCellMergedAcrossRow = function anyChildCellMergedAcrossRow(node) {
|
|
110
111
|
return mapChildren(node, function (child) {
|
package/package.json
CHANGED
package/src/utils/nodes.ts
CHANGED
|
@@ -65,12 +65,16 @@ export const checkIfNumberColumnEnabled = (selection: Selection): boolean =>
|
|
|
65
65
|
|
|
66
66
|
export const isLayoutSupported = (state: EditorState): boolean => {
|
|
67
67
|
const { permittedLayouts } = pluginKey.getState(state)?.pluginConfig || {};
|
|
68
|
-
const { bodiedExtension, layoutSection, expand } =
|
|
68
|
+
const { bodiedExtension, layoutSection, expand, extensionFrame } =
|
|
69
|
+
state.schema.nodes;
|
|
69
70
|
|
|
70
71
|
return (
|
|
71
|
-
!hasParentNodeOfType([
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
!hasParentNodeOfType([
|
|
73
|
+
expand,
|
|
74
|
+
layoutSection,
|
|
75
|
+
bodiedExtension,
|
|
76
|
+
extensionFrame,
|
|
77
|
+
])(state.selection) &&
|
|
74
78
|
!!permittedLayouts &&
|
|
75
79
|
(permittedLayouts === 'all' ||
|
|
76
80
|
(permittedLayouts.indexOf('default') > -1 &&
|
|
@@ -150,7 +154,8 @@ export const isTableNested = (state: EditorState, tablePos = 0): boolean => {
|
|
|
150
154
|
return (
|
|
151
155
|
parent.type === nodeTypes.layoutColumn ||
|
|
152
156
|
parent.type === nodeTypes.expand ||
|
|
153
|
-
parent.type === nodeTypes.bodiedExtension
|
|
157
|
+
parent.type === nodeTypes.bodiedExtension ||
|
|
158
|
+
parent.type === nodeTypes.extensionFrame
|
|
154
159
|
);
|
|
155
160
|
};
|
|
156
161
|
|