@atlaskit/editor-common 110.23.0 → 110.24.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 +19 -0
- package/dist/cjs/analytics/types/table-events.js +2 -0
- package/dist/cjs/messages/syncBlock.js +2 -2
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/nesting/utilities.js +29 -1
- package/dist/cjs/react-node-view/generateUniqueNodeKey.js +3 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/performance/hooks/use-component-render-tracking/index.js +3 -0
- package/dist/es2019/analytics/types/table-events.js +2 -0
- package/dist/es2019/messages/syncBlock.js +2 -2
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/nesting/utilities.js +29 -0
- package/dist/es2019/react-node-view/generateUniqueNodeKey.js +2 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/performance/hooks/use-component-render-tracking/index.js +3 -0
- package/dist/esm/analytics/types/table-events.js +2 -0
- package/dist/esm/messages/syncBlock.js +2 -2
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/nesting/utilities.js +28 -0
- package/dist/esm/react-node-view/generateUniqueNodeKey.js +2 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/performance/hooks/use-component-render-tracking/index.js +3 -0
- package/dist/types/analytics/types/table-events.d.ts +13 -2
- package/dist/types/nesting/utilities.d.ts +2 -1
- package/dist/types-ts4.5/analytics/types/table-events.d.ts +13 -2
- package/dist/types-ts4.5/nesting/utilities.d.ts +2 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 110.24.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`ca454ed251e1e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ca454ed251e1e) -
|
|
8
|
+
Add table height analytics
|
|
9
|
+
|
|
10
|
+
## 110.24.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [`c094becfaeeaa`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c094becfaeeaa) -
|
|
15
|
+
EDITOR-2476 Introduce new utility method to check if nested tables is supported in the schema to
|
|
16
|
+
facilitate removal of gate `platform_editor_use_nested_table_pm_nodes`
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 110.23.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
|
@@ -45,6 +45,8 @@ var TABLE_ACTION = exports.TABLE_ACTION = /*#__PURE__*/function (TABLE_ACTION) {
|
|
|
45
45
|
// Temporary to track usage of CONFCLOUD-78239 bug
|
|
46
46
|
TABLE_ACTION["TABLE_CELL_BACKGROUND_FIXED"] = "tableCellBackgroundFixed";
|
|
47
47
|
TABLE_ACTION["TABLE_WIDTH_INFO"] = "tableWidthInformation";
|
|
48
|
+
TABLE_ACTION["TABLE_EDITOR_HEIGHT_INFO"] = "tableEditorHeightInformation";
|
|
49
|
+
TABLE_ACTION["TABLE_RENDERER_HEIGHT_INFO"] = "tableRendererHeightInformation";
|
|
48
50
|
return TABLE_ACTION;
|
|
49
51
|
}({});
|
|
50
52
|
var TABLE_BREAKOUT = exports.TABLE_BREAKOUT = /*#__PURE__*/function (TABLE_BREAKOUT) {
|
|
@@ -93,12 +93,12 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
|
|
|
93
93
|
},
|
|
94
94
|
deleteConfirmationModalCancelButton: {
|
|
95
95
|
id: 'fabric.editor.deleteConfirmationModalCancelButton',
|
|
96
|
-
defaultMessage:
|
|
96
|
+
defaultMessage: 'Cancel',
|
|
97
97
|
description: 'Text on button which cancels deleting when user was trying to delete source synced block'
|
|
98
98
|
},
|
|
99
99
|
deleteConfirmationModalDeleteButton: {
|
|
100
100
|
id: 'fabric.editor.deleteConfirmationModalDeleteButton',
|
|
101
|
-
defaultMessage:
|
|
101
|
+
defaultMessage: 'Delete',
|
|
102
102
|
description: 'Text on button which confirms deleting the sync block when user was trying to delete source synced block'
|
|
103
103
|
},
|
|
104
104
|
deleteConfirmationModalDescription: {
|
|
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
16
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
17
17
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
18
18
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
19
|
-
var packageVersion = "110.
|
|
19
|
+
var packageVersion = "110.24.0";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// Ignored via go/ees007
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isSelectionTableNestedInTable = exports.getPositionAfterTopParentNodeOfType = exports.getParentOfTypeCount = void 0;
|
|
6
|
+
exports.isSelectionTableNestedInTable = exports.isNestedTablesSupported = exports.getPositionAfterTopParentNodeOfType = exports.getParentOfTypeCount = void 0;
|
|
7
7
|
var _editorTables = require("@atlaskit/editor-tables");
|
|
8
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
8
9
|
/*
|
|
9
10
|
* Returns the level of nesting of a given `nodeType` in the current position.
|
|
10
11
|
* eg. table > table is nested 1 level, table > table > table is nested 2 levels.
|
|
@@ -63,4 +64,31 @@ var isSelectionTableNestedInTable = exports.isSelectionTableNestedInTable = func
|
|
|
63
64
|
var parent = state.doc.resolve(table.pos).parent;
|
|
64
65
|
var nodeTypes = state.schema.nodes;
|
|
65
66
|
return [nodeTypes.tableHeader, nodeTypes.tableCell].includes(parent.type);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/*
|
|
70
|
+
* Returns true if the schema supports nesting tables inside table cells.
|
|
71
|
+
* This is determined by checking if table cells can contain table nodes in their content model.
|
|
72
|
+
*
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const supportsNestedTables = isNestedTablesSupported(state.schema);
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
var isNestedTablesSupported = exports.isNestedTablesSupported = function isNestedTablesSupported(schema) {
|
|
78
|
+
var _tableCell$contentMat, _tableHeader$contentM;
|
|
79
|
+
if (!(0, _expValEquals.expValEquals)('platform_editor_nested_table_detection', 'isEnabled', true)) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
var _schema$nodes = schema.nodes,
|
|
83
|
+
table = _schema$nodes.table,
|
|
84
|
+
tableCell = _schema$nodes.tableCell,
|
|
85
|
+
tableHeader = _schema$nodes.tableHeader;
|
|
86
|
+
if (!table || !tableCell || !tableHeader) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Check if table cells can contain table nodes by testing their content match
|
|
91
|
+
var tableCellCanContainTable = ((_tableCell$contentMat = tableCell.contentMatch.matchType(table)) === null || _tableCell$contentMat === void 0 ? void 0 : _tableCell$contentMat.validEnd) === true;
|
|
92
|
+
var tableHeaderCanContainTable = ((_tableHeader$contentM = tableHeader.contentMatch.matchType(table)) === null || _tableHeader$contentM === void 0 ? void 0 : _tableHeader$contentM.validEnd) === true;
|
|
93
|
+
return tableCellCanContainTable || tableHeaderCanContainTable;
|
|
66
94
|
};
|
|
@@ -6,6 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.generateUniqueNodeKey = void 0;
|
|
8
8
|
var _v = _interopRequireDefault(require("uuid/v4"));
|
|
9
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
10
|
+
|
|
9
11
|
var generateUniqueNodeKey = exports.generateUniqueNodeKey = function generateUniqueNodeKey() {
|
|
12
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
10
13
|
return (0, _v.default)();
|
|
11
14
|
};
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "110.
|
|
27
|
+
var packageVersion = "110.24.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -8,6 +8,8 @@ exports.useComponentRenderTracking = useComponentRenderTracking;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _v = _interopRequireDefault(require("uuid/v4"));
|
|
10
10
|
var _compareProps = require("../../../compare-props");
|
|
11
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
12
|
+
|
|
11
13
|
function useComponentRenderTracking(_ref) {
|
|
12
14
|
var onRender = _ref.onRender,
|
|
13
15
|
propsDiffingOptions = _ref.propsDiffingOptions,
|
|
@@ -15,6 +17,7 @@ function useComponentRenderTracking(_ref) {
|
|
|
15
17
|
zeroBasedCount = _ref$zeroBasedCount === void 0 ? true : _ref$zeroBasedCount;
|
|
16
18
|
var propsRef = (0, _react.useRef)();
|
|
17
19
|
var renderCountRef = (0, _react.useRef)(zeroBasedCount ? 0 : 1);
|
|
20
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
18
21
|
var _useRef = (0, _react.useRef)((0, _v.default)()),
|
|
19
22
|
componentId = _useRef.current;
|
|
20
23
|
(0, _react.useEffect)(function () {
|
|
@@ -39,6 +39,8 @@ export let TABLE_ACTION = /*#__PURE__*/function (TABLE_ACTION) {
|
|
|
39
39
|
// Temporary to track usage of CONFCLOUD-78239 bug
|
|
40
40
|
TABLE_ACTION["TABLE_CELL_BACKGROUND_FIXED"] = "tableCellBackgroundFixed";
|
|
41
41
|
TABLE_ACTION["TABLE_WIDTH_INFO"] = "tableWidthInformation";
|
|
42
|
+
TABLE_ACTION["TABLE_EDITOR_HEIGHT_INFO"] = "tableEditorHeightInformation";
|
|
43
|
+
TABLE_ACTION["TABLE_RENDERER_HEIGHT_INFO"] = "tableRendererHeightInformation";
|
|
42
44
|
return TABLE_ACTION;
|
|
43
45
|
}({});
|
|
44
46
|
export let TABLE_BREAKOUT = /*#__PURE__*/function (TABLE_BREAKOUT) {
|
|
@@ -87,12 +87,12 @@ export const syncBlockMessages = defineMessages({
|
|
|
87
87
|
},
|
|
88
88
|
deleteConfirmationModalCancelButton: {
|
|
89
89
|
id: 'fabric.editor.deleteConfirmationModalCancelButton',
|
|
90
|
-
defaultMessage:
|
|
90
|
+
defaultMessage: 'Cancel',
|
|
91
91
|
description: 'Text on button which cancels deleting when user was trying to delete source synced block'
|
|
92
92
|
},
|
|
93
93
|
deleteConfirmationModalDeleteButton: {
|
|
94
94
|
id: 'fabric.editor.deleteConfirmationModalDeleteButton',
|
|
95
|
-
defaultMessage:
|
|
95
|
+
defaultMessage: 'Delete',
|
|
96
96
|
description: 'Text on button which confirms deleting the sync block when user was trying to delete source synced block'
|
|
97
97
|
},
|
|
98
98
|
deleteConfirmationModalDescription: {
|
|
@@ -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 = "110.
|
|
4
|
+
const packageVersion = "110.24.0";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// Ignored via go/ees007
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { findTable } from '@atlaskit/editor-tables';
|
|
2
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
2
3
|
|
|
3
4
|
/*
|
|
4
5
|
* Returns the level of nesting of a given `nodeType` in the current position.
|
|
@@ -54,4 +55,32 @@ export const isSelectionTableNestedInTable = state => {
|
|
|
54
55
|
const parent = state.doc.resolve(table.pos).parent;
|
|
55
56
|
const nodeTypes = state.schema.nodes;
|
|
56
57
|
return [nodeTypes.tableHeader, nodeTypes.tableCell].includes(parent.type);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/*
|
|
61
|
+
* Returns true if the schema supports nesting tables inside table cells.
|
|
62
|
+
* This is determined by checking if table cells can contain table nodes in their content model.
|
|
63
|
+
*
|
|
64
|
+
* ```typescript
|
|
65
|
+
* const supportsNestedTables = isNestedTablesSupported(state.schema);
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export const isNestedTablesSupported = schema => {
|
|
69
|
+
var _tableCell$contentMat, _tableHeader$contentM;
|
|
70
|
+
if (!expValEquals('platform_editor_nested_table_detection', 'isEnabled', true)) {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
const {
|
|
74
|
+
table,
|
|
75
|
+
tableCell,
|
|
76
|
+
tableHeader
|
|
77
|
+
} = schema.nodes;
|
|
78
|
+
if (!table || !tableCell || !tableHeader) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Check if table cells can contain table nodes by testing their content match
|
|
83
|
+
const tableCellCanContainTable = ((_tableCell$contentMat = tableCell.contentMatch.matchType(table)) === null || _tableCell$contentMat === void 0 ? void 0 : _tableCell$contentMat.validEnd) === true;
|
|
84
|
+
const tableHeaderCanContainTable = ((_tableHeader$contentM = tableHeader.contentMatch.matchType(table)) === null || _tableHeader$contentM === void 0 ? void 0 : _tableHeader$contentM.validEnd) === true;
|
|
85
|
+
return tableCellCanContainTable || tableHeaderCanContainTable;
|
|
57
86
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
1
2
|
import uuid from 'uuid/v4';
|
|
2
3
|
export const generateUniqueNodeKey = () => {
|
|
4
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
3
5
|
return uuid();
|
|
4
6
|
};
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "110.
|
|
17
|
+
const packageVersion = "110.24.0";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
2
4
|
import uuidv4 from 'uuid/v4';
|
|
3
5
|
import { getPropsDifference, getShallowPropsDifference } from '../../../compare-props';
|
|
4
6
|
export function useComponentRenderTracking({
|
|
@@ -8,6 +10,7 @@ export function useComponentRenderTracking({
|
|
|
8
10
|
}) {
|
|
9
11
|
const propsRef = useRef();
|
|
10
12
|
const renderCountRef = useRef(zeroBasedCount ? 0 : 1);
|
|
13
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
11
14
|
const {
|
|
12
15
|
current: componentId
|
|
13
16
|
} = useRef(uuidv4());
|
|
@@ -39,6 +39,8 @@ export var TABLE_ACTION = /*#__PURE__*/function (TABLE_ACTION) {
|
|
|
39
39
|
// Temporary to track usage of CONFCLOUD-78239 bug
|
|
40
40
|
TABLE_ACTION["TABLE_CELL_BACKGROUND_FIXED"] = "tableCellBackgroundFixed";
|
|
41
41
|
TABLE_ACTION["TABLE_WIDTH_INFO"] = "tableWidthInformation";
|
|
42
|
+
TABLE_ACTION["TABLE_EDITOR_HEIGHT_INFO"] = "tableEditorHeightInformation";
|
|
43
|
+
TABLE_ACTION["TABLE_RENDERER_HEIGHT_INFO"] = "tableRendererHeightInformation";
|
|
42
44
|
return TABLE_ACTION;
|
|
43
45
|
}({});
|
|
44
46
|
export var TABLE_BREAKOUT = /*#__PURE__*/function (TABLE_BREAKOUT) {
|
|
@@ -87,12 +87,12 @@ export var syncBlockMessages = defineMessages({
|
|
|
87
87
|
},
|
|
88
88
|
deleteConfirmationModalCancelButton: {
|
|
89
89
|
id: 'fabric.editor.deleteConfirmationModalCancelButton',
|
|
90
|
-
defaultMessage:
|
|
90
|
+
defaultMessage: 'Cancel',
|
|
91
91
|
description: 'Text on button which cancels deleting when user was trying to delete source synced block'
|
|
92
92
|
},
|
|
93
93
|
deleteConfirmationModalDeleteButton: {
|
|
94
94
|
id: 'fabric.editor.deleteConfirmationModalDeleteButton',
|
|
95
|
-
defaultMessage:
|
|
95
|
+
defaultMessage: 'Delete',
|
|
96
96
|
description: 'Text on button which confirms deleting the sync block when user was trying to delete source synced block'
|
|
97
97
|
},
|
|
98
98
|
deleteConfirmationModalDescription: {
|
|
@@ -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 = "110.
|
|
10
|
+
var packageVersion = "110.24.0";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// Ignored via go/ees007
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { findTable } from '@atlaskit/editor-tables';
|
|
2
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
2
3
|
|
|
3
4
|
/*
|
|
4
5
|
* Returns the level of nesting of a given `nodeType` in the current position.
|
|
@@ -58,4 +59,31 @@ export var isSelectionTableNestedInTable = function isSelectionTableNestedInTabl
|
|
|
58
59
|
var parent = state.doc.resolve(table.pos).parent;
|
|
59
60
|
var nodeTypes = state.schema.nodes;
|
|
60
61
|
return [nodeTypes.tableHeader, nodeTypes.tableCell].includes(parent.type);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/*
|
|
65
|
+
* Returns true if the schema supports nesting tables inside table cells.
|
|
66
|
+
* This is determined by checking if table cells can contain table nodes in their content model.
|
|
67
|
+
*
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const supportsNestedTables = isNestedTablesSupported(state.schema);
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export var isNestedTablesSupported = function isNestedTablesSupported(schema) {
|
|
73
|
+
var _tableCell$contentMat, _tableHeader$contentM;
|
|
74
|
+
if (!expValEquals('platform_editor_nested_table_detection', 'isEnabled', true)) {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
var _schema$nodes = schema.nodes,
|
|
78
|
+
table = _schema$nodes.table,
|
|
79
|
+
tableCell = _schema$nodes.tableCell,
|
|
80
|
+
tableHeader = _schema$nodes.tableHeader;
|
|
81
|
+
if (!table || !tableCell || !tableHeader) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Check if table cells can contain table nodes by testing their content match
|
|
86
|
+
var tableCellCanContainTable = ((_tableCell$contentMat = tableCell.contentMatch.matchType(table)) === null || _tableCell$contentMat === void 0 ? void 0 : _tableCell$contentMat.validEnd) === true;
|
|
87
|
+
var tableHeaderCanContainTable = ((_tableHeader$contentM = tableHeader.contentMatch.matchType(table)) === null || _tableHeader$contentM === void 0 ? void 0 : _tableHeader$contentM.validEnd) === true;
|
|
88
|
+
return tableCellCanContainTable || tableHeaderCanContainTable;
|
|
61
89
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
1
2
|
import uuid from 'uuid/v4';
|
|
2
3
|
export var generateUniqueNodeKey = function generateUniqueNodeKey() {
|
|
4
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
3
5
|
return uuid();
|
|
4
6
|
};
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "110.
|
|
24
|
+
var packageVersion = "110.24.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
2
4
|
import uuidv4 from 'uuid/v4';
|
|
3
5
|
import { getPropsDifference, getShallowPropsDifference } from '../../../compare-props';
|
|
4
6
|
export function useComponentRenderTracking(_ref) {
|
|
@@ -8,6 +10,7 @@ export function useComponentRenderTracking(_ref) {
|
|
|
8
10
|
zeroBasedCount = _ref$zeroBasedCount === void 0 ? true : _ref$zeroBasedCount;
|
|
9
11
|
var propsRef = useRef();
|
|
10
12
|
var renderCountRef = useRef(zeroBasedCount ? 0 : 1);
|
|
13
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
11
14
|
var _useRef = useRef(uuidv4()),
|
|
12
15
|
componentId = _useRef.current;
|
|
13
16
|
useEffect(function () {
|
|
@@ -41,7 +41,9 @@ export declare enum TABLE_ACTION {
|
|
|
41
41
|
CHANGED_DISPLAY_MODE = "changedDisplayMode",
|
|
42
42
|
CHANGED_ALIGNMENT = "changedAlignment",
|
|
43
43
|
TABLE_CELL_BACKGROUND_FIXED = "tableCellBackgroundFixed",
|
|
44
|
-
TABLE_WIDTH_INFO = "tableWidthInformation"
|
|
44
|
+
TABLE_WIDTH_INFO = "tableWidthInformation",
|
|
45
|
+
TABLE_EDITOR_HEIGHT_INFO = "tableEditorHeightInformation",
|
|
46
|
+
TABLE_RENDERER_HEIGHT_INFO = "tableRendererHeightInformation"
|
|
45
47
|
}
|
|
46
48
|
export declare enum TABLE_BREAKOUT {
|
|
47
49
|
WIDE = "wide",
|
|
@@ -220,5 +222,14 @@ type TableWidthInfoAEP = TableAEP<TABLE_ACTION.TABLE_WIDTH_INFO, {
|
|
|
220
222
|
tableWidth: number;
|
|
221
223
|
}>;
|
|
222
224
|
}, undefined>;
|
|
223
|
-
|
|
225
|
+
type TableHeightInfoAEP = TableAEP<TABLE_ACTION.TABLE_EDITOR_HEIGHT_INFO, {
|
|
226
|
+
editorScrollParentClientHeight: number;
|
|
227
|
+
isEditorScrollable: boolean;
|
|
228
|
+
maxTableToEditorHeightRatio: number;
|
|
229
|
+
tableHeightInfo: Array<{
|
|
230
|
+
isNestedTable: boolean;
|
|
231
|
+
tableHeight: number;
|
|
232
|
+
}>;
|
|
233
|
+
}, undefined>;
|
|
234
|
+
export type TableEventPayload = TableDeleteAEP | TableClearAEP | TableMergeSplitAEP | TableColorAEP | TableToggleHeaderAEP | TableChangeBreakoutAEP | TableCopyAndCutAEP | TableAddRowOrColumnAEP | TableSortColumnAEP | TableDeleteRowOrColumnAEP | TableReplaceAEP | TableAttemptedResizeAEP | TableDistributeColumnsWidthsAEP | TableCollapsedAEP | TableFixedAEP | TableOverflowChangedAEP | TableInitialOverflowCapturedAEP | TableResizedAEP | TableResizePerfSamplingAEP | TableRowOrColumnMovedAEP | TableMovedRowOrColumnAEP | TableClonedRowOrColumnAEP | TableChangedDisplayModeAEP | TableColumnResizedAEP | TableBackgroundColorFixAEP | TableChangedAlignmentAEP | TableWidthInfoAEP | TableHeightInfoAEP;
|
|
224
235
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { NodeType, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
1
|
+
import type { NodeType, ResolvedPos, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { type EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare const getParentOfTypeCount: (nodeType: NodeType) => ($pos: ResolvedPos) => number;
|
|
4
4
|
export declare const getPositionAfterTopParentNodeOfType: (nodeType: NodeType) => ($pos: ResolvedPos) => number | undefined;
|
|
5
5
|
export declare const isSelectionTableNestedInTable: (state: EditorState) => boolean;
|
|
6
|
+
export declare const isNestedTablesSupported: (schema: Schema) => boolean;
|
|
@@ -41,7 +41,9 @@ export declare enum TABLE_ACTION {
|
|
|
41
41
|
CHANGED_DISPLAY_MODE = "changedDisplayMode",
|
|
42
42
|
CHANGED_ALIGNMENT = "changedAlignment",
|
|
43
43
|
TABLE_CELL_BACKGROUND_FIXED = "tableCellBackgroundFixed",
|
|
44
|
-
TABLE_WIDTH_INFO = "tableWidthInformation"
|
|
44
|
+
TABLE_WIDTH_INFO = "tableWidthInformation",
|
|
45
|
+
TABLE_EDITOR_HEIGHT_INFO = "tableEditorHeightInformation",
|
|
46
|
+
TABLE_RENDERER_HEIGHT_INFO = "tableRendererHeightInformation"
|
|
45
47
|
}
|
|
46
48
|
export declare enum TABLE_BREAKOUT {
|
|
47
49
|
WIDE = "wide",
|
|
@@ -220,5 +222,14 @@ type TableWidthInfoAEP = TableAEP<TABLE_ACTION.TABLE_WIDTH_INFO, {
|
|
|
220
222
|
tableWidth: number;
|
|
221
223
|
}>;
|
|
222
224
|
}, undefined>;
|
|
223
|
-
|
|
225
|
+
type TableHeightInfoAEP = TableAEP<TABLE_ACTION.TABLE_EDITOR_HEIGHT_INFO, {
|
|
226
|
+
editorScrollParentClientHeight: number;
|
|
227
|
+
isEditorScrollable: boolean;
|
|
228
|
+
maxTableToEditorHeightRatio: number;
|
|
229
|
+
tableHeightInfo: Array<{
|
|
230
|
+
isNestedTable: boolean;
|
|
231
|
+
tableHeight: number;
|
|
232
|
+
}>;
|
|
233
|
+
}, undefined>;
|
|
234
|
+
export type TableEventPayload = TableDeleteAEP | TableClearAEP | TableMergeSplitAEP | TableColorAEP | TableToggleHeaderAEP | TableChangeBreakoutAEP | TableCopyAndCutAEP | TableAddRowOrColumnAEP | TableSortColumnAEP | TableDeleteRowOrColumnAEP | TableReplaceAEP | TableAttemptedResizeAEP | TableDistributeColumnsWidthsAEP | TableCollapsedAEP | TableFixedAEP | TableOverflowChangedAEP | TableInitialOverflowCapturedAEP | TableResizedAEP | TableResizePerfSamplingAEP | TableRowOrColumnMovedAEP | TableMovedRowOrColumnAEP | TableClonedRowOrColumnAEP | TableChangedDisplayModeAEP | TableColumnResizedAEP | TableBackgroundColorFixAEP | TableChangedAlignmentAEP | TableWidthInfoAEP | TableHeightInfoAEP;
|
|
224
235
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { NodeType, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
1
|
+
import type { NodeType, ResolvedPos, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { type EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare const getParentOfTypeCount: (nodeType: NodeType) => ($pos: ResolvedPos) => number;
|
|
4
4
|
export declare const getPositionAfterTopParentNodeOfType: (nodeType: NodeType) => ($pos: ResolvedPos) => number | undefined;
|
|
5
5
|
export declare const isSelectionTableNestedInTable: (state: EditorState) => boolean;
|
|
6
|
+
export declare const isNestedTablesSupported: (schema: Schema) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "110.
|
|
3
|
+
"version": "110.24.1",
|
|
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/"
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@atlaskit/task-decision": "^19.2.0",
|
|
83
83
|
"@atlaskit/textfield": "^8.0.0",
|
|
84
84
|
"@atlaskit/theme": "^21.0.0",
|
|
85
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
85
|
+
"@atlaskit/tmp-editor-statsig": "^13.31.0",
|
|
86
86
|
"@atlaskit/tokens": "^7.1.0",
|
|
87
87
|
"@atlaskit/tooltip": "^20.7.0",
|
|
88
88
|
"@atlaskit/ufo": "^0.4.0",
|