@atlaskit/editor-plugin-table 24.5.7 → 24.6.1
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 +20 -0
- package/dist/cjs/nodeviews/toDOM.js +2 -4
- package/dist/cjs/ui/TableMenu/shared/items/BackgroundColorItem.js +7 -2
- package/dist/es2019/nodeviews/toDOM.js +2 -4
- package/dist/es2019/ui/TableMenu/shared/items/BackgroundColorItem.js +7 -2
- package/dist/esm/nodeviews/toDOM.js +2 -4
- package/dist/esm/ui/TableMenu/shared/items/BackgroundColorItem.js +7 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 24.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 24.6.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`509b29022dde2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/509b29022dde2) -
|
|
14
|
+
cleanup platform_editor_table_display_mode_in_to_dom
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`399ca50adb668`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/399ca50adb668) -
|
|
19
|
+
[ux] [EDITOR-8377] Fix the table cell background colour palette so the current colour is shown as
|
|
20
|
+
selected.
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 24.5.7
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -51,14 +51,12 @@ var tableNodeSpecWithFixedToDOM = exports.tableNodeSpecWithFixedToDOM = function
|
|
|
51
51
|
'data-table-local-id': node.attrs.localId,
|
|
52
52
|
'data-table-width': node.attrs.width,
|
|
53
53
|
'data-ssr-placeholder': "table-".concat(node.attrs.localId),
|
|
54
|
-
'data-ssr-placeholder-replace': "table-".concat(node.attrs.localId)
|
|
54
|
+
'data-ssr-placeholder-replace': "table-".concat(node.attrs.localId),
|
|
55
|
+
'data-table-display-mode': node.attrs.displayMode
|
|
55
56
|
};
|
|
56
57
|
if (isInContentMode) {
|
|
57
58
|
attrs['data-initial-width-mode'] = 'content';
|
|
58
59
|
}
|
|
59
|
-
if ((0, _expValEquals.expValEquals)('platform_editor_table_display_mode_in_to_dom', 'isEnabled', true)) {
|
|
60
|
-
attrs['data-table-display-mode'] = node.attrs.displayMode;
|
|
61
|
-
}
|
|
62
60
|
|
|
63
61
|
// This would be used for table scaling in colgroup CSS
|
|
64
62
|
// cqw, or px is well supported
|
|
@@ -16,6 +16,7 @@ var _uiColor = require("@atlaskit/editor-common/ui-color");
|
|
|
16
16
|
var _editorPalette = require("@atlaskit/editor-palette");
|
|
17
17
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
18
18
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
19
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
19
20
|
var _commands = require("../../../../pm-plugins/commands");
|
|
20
21
|
var _commandsWithAnalytics = require("../../../../pm-plugins/commands/commands-with-analytics");
|
|
21
22
|
var _pluginFactory = require("../../../../pm-plugins/plugin-factory");
|
|
@@ -35,14 +36,18 @@ var BackgroundColorItem = exports.BackgroundColorItem = function BackgroundColor
|
|
|
35
36
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
36
37
|
formatMessage = _useIntl.formatMessage;
|
|
37
38
|
var selectedColor = (0, _react.useMemo)(function () {
|
|
38
|
-
var _node$
|
|
39
|
+
var _node$attrs2;
|
|
39
40
|
if (!editorView) {
|
|
40
41
|
return '#ffffff';
|
|
41
42
|
}
|
|
42
43
|
var _getPluginState = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
43
44
|
targetCellPosition = _getPluginState.targetCellPosition;
|
|
44
45
|
var node = targetCellPosition ? editorView.state.doc.nodeAt(targetCellPosition) : null;
|
|
45
|
-
|
|
46
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_table_menu_updates_patch_3', 'isEnabled', true)) {
|
|
47
|
+
var _node$attrs;
|
|
48
|
+
return (node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff';
|
|
49
|
+
}
|
|
50
|
+
return (0, _editorPalette.hexToEditorBackgroundPaletteColor)((node === null || node === void 0 || (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.background) || '#ffffff');
|
|
46
51
|
}, [editorView]);
|
|
47
52
|
var onClick = (0, _react.useCallback)(function (color) {
|
|
48
53
|
var _api$analytics;
|
|
@@ -35,14 +35,12 @@ export const tableNodeSpecWithFixedToDOM = config => {
|
|
|
35
35
|
'data-table-local-id': node.attrs.localId,
|
|
36
36
|
'data-table-width': node.attrs.width,
|
|
37
37
|
'data-ssr-placeholder': `table-${node.attrs.localId}`,
|
|
38
|
-
'data-ssr-placeholder-replace': `table-${node.attrs.localId}
|
|
38
|
+
'data-ssr-placeholder-replace': `table-${node.attrs.localId}`,
|
|
39
|
+
'data-table-display-mode': node.attrs.displayMode
|
|
39
40
|
};
|
|
40
41
|
if (isInContentMode) {
|
|
41
42
|
attrs['data-initial-width-mode'] = 'content';
|
|
42
43
|
}
|
|
43
|
-
if (expValEquals('platform_editor_table_display_mode_in_to_dom', 'isEnabled', true)) {
|
|
44
|
-
attrs['data-table-display-mode'] = node.attrs.displayMode;
|
|
45
|
-
}
|
|
46
44
|
|
|
47
45
|
// This would be used for table scaling in colgroup CSS
|
|
48
46
|
// cqw, or px is well supported
|
|
@@ -9,6 +9,7 @@ import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, ColorPale
|
|
|
9
9
|
import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
10
10
|
import { NestedDropdownRightIcon, PaintBucketIcon, ToolbarNestedDropdownMenu } from '@atlaskit/editor-toolbar';
|
|
11
11
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
12
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
12
13
|
import { closeActiveTableMenu } from '../../../../pm-plugins/commands';
|
|
13
14
|
import { setColorWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
|
|
14
15
|
import { getPluginState } from '../../../../pm-plugins/plugin-factory';
|
|
@@ -30,7 +31,7 @@ export const BackgroundColorItem = ({
|
|
|
30
31
|
formatMessage
|
|
31
32
|
} = useIntl();
|
|
32
33
|
const selectedColor = useMemo(() => {
|
|
33
|
-
var _node$
|
|
34
|
+
var _node$attrs2;
|
|
34
35
|
if (!editorView) {
|
|
35
36
|
return '#ffffff';
|
|
36
37
|
}
|
|
@@ -38,7 +39,11 @@ export const BackgroundColorItem = ({
|
|
|
38
39
|
targetCellPosition
|
|
39
40
|
} = getPluginState(editorView.state);
|
|
40
41
|
const node = targetCellPosition ? editorView.state.doc.nodeAt(targetCellPosition) : null;
|
|
41
|
-
|
|
42
|
+
if (expValEquals('platform_editor_table_menu_updates_patch_3', 'isEnabled', true)) {
|
|
43
|
+
var _node$attrs;
|
|
44
|
+
return (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff';
|
|
45
|
+
}
|
|
46
|
+
return hexToEditorBackgroundPaletteColor((node === null || node === void 0 ? void 0 : (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.background) || '#ffffff');
|
|
42
47
|
}, [editorView]);
|
|
43
48
|
const onClick = useCallback(color => {
|
|
44
49
|
var _api$analytics;
|
|
@@ -44,14 +44,12 @@ export var tableNodeSpecWithFixedToDOM = function tableNodeSpecWithFixedToDOM(co
|
|
|
44
44
|
'data-table-local-id': node.attrs.localId,
|
|
45
45
|
'data-table-width': node.attrs.width,
|
|
46
46
|
'data-ssr-placeholder': "table-".concat(node.attrs.localId),
|
|
47
|
-
'data-ssr-placeholder-replace': "table-".concat(node.attrs.localId)
|
|
47
|
+
'data-ssr-placeholder-replace': "table-".concat(node.attrs.localId),
|
|
48
|
+
'data-table-display-mode': node.attrs.displayMode
|
|
48
49
|
};
|
|
49
50
|
if (isInContentMode) {
|
|
50
51
|
attrs['data-initial-width-mode'] = 'content';
|
|
51
52
|
}
|
|
52
|
-
if (expValEquals('platform_editor_table_display_mode_in_to_dom', 'isEnabled', true)) {
|
|
53
|
-
attrs['data-table-display-mode'] = node.attrs.displayMode;
|
|
54
|
-
}
|
|
55
53
|
|
|
56
54
|
// This would be used for table scaling in colgroup CSS
|
|
57
55
|
// cqw, or px is well supported
|
|
@@ -9,6 +9,7 @@ import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, ColorPale
|
|
|
9
9
|
import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
10
10
|
import { NestedDropdownRightIcon, PaintBucketIcon, ToolbarNestedDropdownMenu } from '@atlaskit/editor-toolbar';
|
|
11
11
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
12
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
12
13
|
import { closeActiveTableMenu } from '../../../../pm-plugins/commands';
|
|
13
14
|
import { setColorWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
|
|
14
15
|
import { getPluginState } from '../../../../pm-plugins/plugin-factory';
|
|
@@ -27,14 +28,18 @@ export var BackgroundColorItem = function BackgroundColorItem(_ref) {
|
|
|
27
28
|
var _useIntl = useIntl(),
|
|
28
29
|
formatMessage = _useIntl.formatMessage;
|
|
29
30
|
var selectedColor = useMemo(function () {
|
|
30
|
-
var _node$
|
|
31
|
+
var _node$attrs2;
|
|
31
32
|
if (!editorView) {
|
|
32
33
|
return '#ffffff';
|
|
33
34
|
}
|
|
34
35
|
var _getPluginState = getPluginState(editorView.state),
|
|
35
36
|
targetCellPosition = _getPluginState.targetCellPosition;
|
|
36
37
|
var node = targetCellPosition ? editorView.state.doc.nodeAt(targetCellPosition) : null;
|
|
37
|
-
|
|
38
|
+
if (expValEquals('platform_editor_table_menu_updates_patch_3', 'isEnabled', true)) {
|
|
39
|
+
var _node$attrs;
|
|
40
|
+
return (node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff';
|
|
41
|
+
}
|
|
42
|
+
return hexToEditorBackgroundPaletteColor((node === null || node === void 0 || (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.background) || '#ffffff');
|
|
38
43
|
}, [editorView]);
|
|
39
44
|
var onClick = useCallback(function (color) {
|
|
40
45
|
var _api$analytics;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.6.1",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"singleton": true
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@atlaskit/adf-schema": "^56.
|
|
23
|
+
"@atlaskit/adf-schema": "^56.5.0",
|
|
24
24
|
"@atlaskit/button": "^25.0.0",
|
|
25
25
|
"@atlaskit/custom-steps": "^1.0.0",
|
|
26
26
|
"@atlaskit/editor-palette": "^3.4.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@atlaskit/editor-plugin-batch-attribute-updates": "^12.1.0",
|
|
30
30
|
"@atlaskit/editor-plugin-content-insertion": "^12.1.0",
|
|
31
31
|
"@atlaskit/editor-plugin-editor-viewmode": "^14.1.0",
|
|
32
|
-
"@atlaskit/editor-plugin-extension": "15.1.
|
|
32
|
+
"@atlaskit/editor-plugin-extension": "15.1.3",
|
|
33
33
|
"@atlaskit/editor-plugin-guideline": "^12.1.0",
|
|
34
34
|
"@atlaskit/editor-plugin-interaction": "^23.1.0",
|
|
35
35
|
"@atlaskit/editor-plugin-limited-mode": "^9.1.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.0.0",
|
|
54
54
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^2.0.0",
|
|
55
55
|
"@atlaskit/primitives": "^22.2.0",
|
|
56
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
56
|
+
"@atlaskit/tmp-editor-statsig": "^137.0.0",
|
|
57
57
|
"@atlaskit/toggle": "^17.1.0",
|
|
58
58
|
"@atlaskit/tokens": "^16.3.0",
|
|
59
59
|
"@atlaskit/tooltip": "^24.0.0",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"uuid": "^3.1.0"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@atlaskit/editor-common": "^116.
|
|
71
|
+
"@atlaskit/editor-common": "^116.51.0",
|
|
72
72
|
"react": "^18.2.0 || ^19.2.0",
|
|
73
73
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
74
74
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|