@atlaskit/editor-plugin-table 8.4.7 → 8.4.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 +18 -0
- package/dist/cjs/nodeviews/TableCell.js +1 -2
- package/dist/cjs/pm-plugins/utils/nodes.js +1 -1
- package/dist/es2019/nodeviews/TableCell.js +1 -2
- package/dist/es2019/pm-plugins/utils/nodes.js +1 -1
- package/dist/esm/nodeviews/TableCell.js +1 -2
- package/dist/esm/pm-plugins/utils/nodes.js +1 -1
- package/package.json +3 -6
- package/src/nodeviews/TableCell.ts +1 -5
- package/src/pm-plugins/utils/nodes.ts +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 8.4.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#180006](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/180006)
|
|
8
|
+
[`c9b58fd324e47`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c9b58fd324e47) -
|
|
9
|
+
Cleanup feature gate which cell backgrounds in dark mode.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 8.4.8
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#178631](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/178631)
|
|
17
|
+
[`2848916284e6e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2848916284e6e) -
|
|
18
|
+
[ux] [ED-25641] This change disables resizing and alignment options for tables nested inside of
|
|
19
|
+
tables.
|
|
20
|
+
|
|
3
21
|
## 8.4.7
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -14,7 +14,6 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
16
16
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
17
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
17
|
var _TableNodeViewBase = _interopRequireDefault(require("./TableNodeViewBase"));
|
|
19
18
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
20
19
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
@@ -66,7 +65,7 @@ var TableCell = exports.default = /*#__PURE__*/function (_TableNodeView) {
|
|
|
66
65
|
(_window2 = window) === null || _window2 === void 0 || (_window2$cancelAnimat = _window2.cancelAnimationFrame) === null || _window2$cancelAnimat === void 0 || _window2$cancelAnimat.call(_window2, _this.delayHandle);
|
|
67
66
|
}
|
|
68
67
|
});
|
|
69
|
-
if (cssVariablePattern.test(node.attrs.background)
|
|
68
|
+
if (cssVariablePattern.test(node.attrs.background)) {
|
|
70
69
|
_this.delayHandle = delayUntilIdle(function () {
|
|
71
70
|
var pos = getPos();
|
|
72
71
|
if (pos) {
|
|
@@ -104,7 +104,7 @@ var isTableNested = exports.isTableNested = function isTableNested(state) {
|
|
|
104
104
|
var tablePos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
105
105
|
var parent = state.doc.resolve(tablePos).parent;
|
|
106
106
|
var nodeTypes = state.schema.nodes;
|
|
107
|
-
return parent.type === nodeTypes.layoutColumn || parent.type === nodeTypes.expand || parent.type === nodeTypes.bodiedExtension || parent.type === nodeTypes.extensionFrame;
|
|
107
|
+
return parent.type === nodeTypes.layoutColumn || parent.type === nodeTypes.expand || parent.type === nodeTypes.bodiedExtension || parent.type === nodeTypes.extensionFrame || parent.type === nodeTypes.tableHeader || parent.type === nodeTypes.tableCell;
|
|
108
108
|
};
|
|
109
109
|
var isTableNestedInMoreThanOneNode = exports.isTableNestedInMoreThanOneNode = function isTableNestedInMoreThanOneNode(state) {
|
|
110
110
|
var tablePos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { getCellAttrs, getCellDomAttrs } from '@atlaskit/adf-schema';
|
|
3
3
|
import { ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import TableNodeView from './TableNodeViewBase';
|
|
6
5
|
const DEFAULT_COL_SPAN = 1;
|
|
7
6
|
const DEFAULT_ROW_SPAN = 1;
|
|
@@ -45,7 +44,7 @@ export default class TableCell extends TableNodeView {
|
|
|
45
44
|
(_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$cancelAnimat = _window2.cancelAnimationFrame) === null || _window2$cancelAnimat === void 0 ? void 0 : _window2$cancelAnimat.call(_window2, this.delayHandle);
|
|
46
45
|
}
|
|
47
46
|
});
|
|
48
|
-
if (cssVariablePattern.test(node.attrs.background)
|
|
47
|
+
if (cssVariablePattern.test(node.attrs.background)) {
|
|
49
48
|
this.delayHandle = delayUntilIdle(() => {
|
|
50
49
|
const pos = getPos();
|
|
51
50
|
if (pos) {
|
|
@@ -85,7 +85,7 @@ function getTableWidths(node) {
|
|
|
85
85
|
export const isTableNested = (state, tablePos = 0) => {
|
|
86
86
|
const parent = state.doc.resolve(tablePos).parent;
|
|
87
87
|
const nodeTypes = state.schema.nodes;
|
|
88
|
-
return parent.type === nodeTypes.layoutColumn || parent.type === nodeTypes.expand || parent.type === nodeTypes.bodiedExtension || parent.type === nodeTypes.extensionFrame;
|
|
88
|
+
return parent.type === nodeTypes.layoutColumn || parent.type === nodeTypes.expand || parent.type === nodeTypes.bodiedExtension || parent.type === nodeTypes.extensionFrame || parent.type === nodeTypes.tableHeader || parent.type === nodeTypes.tableCell;
|
|
89
89
|
};
|
|
90
90
|
export const isTableNestedInMoreThanOneNode = (state, tablePos = 0) => {
|
|
91
91
|
return state.doc.resolve(tablePos).depth > 2;
|
|
@@ -9,7 +9,6 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
|
|
|
9
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
10
|
import { getCellAttrs, getCellDomAttrs } from '@atlaskit/adf-schema';
|
|
11
11
|
import { ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
12
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
import TableNodeView from './TableNodeViewBase';
|
|
14
13
|
var DEFAULT_COL_SPAN = 1;
|
|
15
14
|
var DEFAULT_ROW_SPAN = 1;
|
|
@@ -59,7 +58,7 @@ var TableCell = /*#__PURE__*/function (_TableNodeView) {
|
|
|
59
58
|
(_window2 = window) === null || _window2 === void 0 || (_window2$cancelAnimat = _window2.cancelAnimationFrame) === null || _window2$cancelAnimat === void 0 || _window2$cancelAnimat.call(_window2, _this.delayHandle);
|
|
60
59
|
}
|
|
61
60
|
});
|
|
62
|
-
if (cssVariablePattern.test(node.attrs.background)
|
|
61
|
+
if (cssVariablePattern.test(node.attrs.background)) {
|
|
63
62
|
_this.delayHandle = delayUntilIdle(function () {
|
|
64
63
|
var pos = getPos();
|
|
65
64
|
if (pos) {
|
|
@@ -97,7 +97,7 @@ export var isTableNested = function isTableNested(state) {
|
|
|
97
97
|
var tablePos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
98
98
|
var parent = state.doc.resolve(tablePos).parent;
|
|
99
99
|
var nodeTypes = state.schema.nodes;
|
|
100
|
-
return parent.type === nodeTypes.layoutColumn || parent.type === nodeTypes.expand || parent.type === nodeTypes.bodiedExtension || parent.type === nodeTypes.extensionFrame;
|
|
100
|
+
return parent.type === nodeTypes.layoutColumn || parent.type === nodeTypes.expand || parent.type === nodeTypes.bodiedExtension || parent.type === nodeTypes.extensionFrame || parent.type === nodeTypes.tableHeader || parent.type === nodeTypes.tableCell;
|
|
101
101
|
};
|
|
102
102
|
export var isTableNestedInMoreThanOneNode = function isTableNestedInMoreThanOneNode(state) {
|
|
103
103
|
var tablePos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.9",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
|
|
52
52
|
"@atlaskit/primitives": "^13.3.0",
|
|
53
53
|
"@atlaskit/theme": "^14.0.0",
|
|
54
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
54
|
+
"@atlaskit/tmp-editor-statsig": "^2.27.0",
|
|
55
55
|
"@atlaskit/toggle": "^14.0.0",
|
|
56
|
-
"@atlaskit/tokens": "^2.
|
|
56
|
+
"@atlaskit/tokens": "^2.5.0",
|
|
57
57
|
"@atlaskit/tooltip": "^19.0.0",
|
|
58
58
|
"@babel/runtime": "^7.0.0",
|
|
59
59
|
"@emotion/react": "^11.7.1",
|
|
@@ -110,9 +110,6 @@
|
|
|
110
110
|
"platform_editor_batch_steps_table": {
|
|
111
111
|
"type": "boolean"
|
|
112
112
|
},
|
|
113
|
-
"platform_editor_dark_mode_cell_header_color_fix": {
|
|
114
|
-
"type": "boolean"
|
|
115
|
-
},
|
|
116
113
|
"platform_editor_breakout_use_css": {
|
|
117
114
|
"type": "boolean"
|
|
118
115
|
},
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
10
10
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
11
11
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
12
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
|
|
14
13
|
import TableNodeView from './TableNodeViewBase';
|
|
15
14
|
|
|
@@ -55,10 +54,7 @@ export default class TableCell extends TableNodeView<HTMLElement> implements Nod
|
|
|
55
54
|
// This is a workaround to fix those cases on the fly. Note it is super specific on purpose
|
|
56
55
|
// so that it just fixes the heading token (other tokens should be unaffected)
|
|
57
56
|
// At some point in the future
|
|
58
|
-
if (
|
|
59
|
-
cssVariablePattern.test(node.attrs.background) &&
|
|
60
|
-
fg('platform_editor_dark_mode_cell_header_color_fix')
|
|
61
|
-
) {
|
|
57
|
+
if (cssVariablePattern.test(node.attrs.background)) {
|
|
62
58
|
this.delayHandle = delayUntilIdle(() => {
|
|
63
59
|
const pos = getPos();
|
|
64
60
|
if (pos) {
|
|
@@ -132,7 +132,9 @@ export const isTableNested = (state: EditorState, tablePos = 0): boolean => {
|
|
|
132
132
|
parent.type === nodeTypes.layoutColumn ||
|
|
133
133
|
parent.type === nodeTypes.expand ||
|
|
134
134
|
parent.type === nodeTypes.bodiedExtension ||
|
|
135
|
-
parent.type === nodeTypes.extensionFrame
|
|
135
|
+
parent.type === nodeTypes.extensionFrame ||
|
|
136
|
+
parent.type === nodeTypes.tableHeader ||
|
|
137
|
+
parent.type === nodeTypes.tableCell
|
|
136
138
|
);
|
|
137
139
|
};
|
|
138
140
|
|