@atlaskit/editor-common 114.40.0 → 114.41.0
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 +12 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/rank.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/index.js +13 -0
- package/dist/cjs/utils/node-type-utils.js +27 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/rank.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/index.js +2 -1
- package/dist/es2019/utils/node-type-utils.js +20 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/rank.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/index.js +2 -1
- package/dist/esm/utils/node-type-utils.js +20 -0
- package/dist/types/rank.d.ts +2 -2
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/node-type-utils.d.ts +9 -0
- package/dist/types-ts4.5/rank.d.ts +2 -2
- package/dist/types-ts4.5/utils/index.d.ts +1 -0
- package/dist/types-ts4.5/utils/node-type-utils.d.ts +9 -0
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 114.41.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`ad45394a4fed6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ad45394a4fed6) -
|
|
8
|
+
[ux] EDITOR-7171 add panel plugin support for new panel_c1 node variant which can have tables
|
|
9
|
+
nested inside
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 114.40.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
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); }
|
|
20
20
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
21
21
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
22
|
-
var packageVersion = "114.
|
|
22
|
+
var packageVersion = "114.40.0";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
package/dist/cjs/rank.js
CHANGED
|
@@ -25,7 +25,7 @@ var rankEditorPlugins = exports.rankEditorPlugins = {
|
|
|
25
25
|
// selection keymap needs to be above gap cursor keymap so it can set node selections from
|
|
26
26
|
// left/right arrows
|
|
27
27
|
'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'selectionToolbar', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription', 'beforePrimaryToolbar', 'inlineCode'],
|
|
28
|
-
nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'rule', 'panel', 'mention', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'unsupportedBlock', 'unsupportedInline', 'confluenceJiraIssue', 'hardBreak', 'emoji', 'placeholder', 'mediaSingle', 'mediaGroup', 'table', 'expand', 'nestedExpand', 'media', 'tableHeader', 'decisionList', 'tableRow', 'decisionItem', 'tableCell', 'taskList', 'taskItem', 'extension', 'bodiedExtension', 'multiBodiedExtension', 'inlineExtension', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard'],
|
|
28
|
+
nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'rule', 'panel', 'panel_c1', 'mention', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'unsupportedBlock', 'unsupportedInline', 'confluenceJiraIssue', 'hardBreak', 'emoji', 'placeholder', 'mediaSingle', 'mediaGroup', 'table', 'expand', 'nestedExpand', 'media', 'tableHeader', 'decisionList', 'tableRow', 'decisionItem', 'tableCell', 'taskList', 'taskItem', 'extension', 'bodiedExtension', 'multiBodiedExtension', 'inlineExtension', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard'],
|
|
29
29
|
marks: [
|
|
30
30
|
// Fragment mark is both for inline and block elements
|
|
31
31
|
'fragment',
|
|
@@ -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 = "114.
|
|
27
|
+
var packageVersion = "114.40.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -426,6 +426,12 @@ Object.defineProperty(exports, "getAnnotationMarksForPos", {
|
|
|
426
426
|
return _annotation.getAnnotationMarksForPos;
|
|
427
427
|
}
|
|
428
428
|
});
|
|
429
|
+
Object.defineProperty(exports, "getBaseNodeTypeName", {
|
|
430
|
+
enumerable: true,
|
|
431
|
+
get: function get() {
|
|
432
|
+
return _nodeTypeUtils.getBaseNodeTypeName;
|
|
433
|
+
}
|
|
434
|
+
});
|
|
429
435
|
Object.defineProperty(exports, "getBreakoutResizableNodeTypes", {
|
|
430
436
|
enumerable: true,
|
|
431
437
|
get: function get() {
|
|
@@ -767,6 +773,12 @@ Object.defineProperty(exports, "isNodeBeforeMediaNode", {
|
|
|
767
773
|
}
|
|
768
774
|
});
|
|
769
775
|
exports.isNodeEmpty = isNodeEmpty;
|
|
776
|
+
Object.defineProperty(exports, "isNodeOfSameBaseType", {
|
|
777
|
+
enumerable: true,
|
|
778
|
+
get: function get() {
|
|
779
|
+
return _nodeTypeUtils.isNodeOfSameBaseType;
|
|
780
|
+
}
|
|
781
|
+
});
|
|
770
782
|
Object.defineProperty(exports, "isNodeSelectedOrInRange", {
|
|
771
783
|
enumerable: true,
|
|
772
784
|
get: function get() {
|
|
@@ -1243,6 +1255,7 @@ var _calculateToolbarPosition = require("./calculate-toolbar-position");
|
|
|
1243
1255
|
var _nodesByLocalIds = require("./nodes-by-localIds");
|
|
1244
1256
|
var _pageElementCounts = require("./page-element-counts");
|
|
1245
1257
|
var _withFeatureFlaggedComponent = require("./withFeatureFlaggedComponent");
|
|
1258
|
+
var _nodeTypeUtils = require("./node-type-utils");
|
|
1246
1259
|
// Disable no-re-export rule for entry point files
|
|
1247
1260
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
1248
1261
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getBaseNodeTypeName = getBaseNodeTypeName;
|
|
7
|
+
exports.isNodeOfSameBaseType = isNodeOfSameBaseType;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the base name of a node type, stripping known variant suffixes.
|
|
10
|
+
*/
|
|
11
|
+
var variantToBaseNameMap = {
|
|
12
|
+
panel_c1: 'panel'
|
|
13
|
+
};
|
|
14
|
+
function getBaseNodeTypeName(nodeType) {
|
|
15
|
+
var _variantToBaseNameMap;
|
|
16
|
+
return (_variantToBaseNameMap = variantToBaseNameMap[nodeType.name]) !== null && _variantToBaseNameMap !== void 0 ? _variantToBaseNameMap : nodeType.name;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Returns true if two node types share the same base type name.
|
|
21
|
+
*
|
|
22
|
+
* Useful for comparing nodes that may exist as schema variants
|
|
23
|
+
* (e.g. `panel` and `panel_c1` are considered the same base type).
|
|
24
|
+
*/
|
|
25
|
+
function isNodeOfSameBaseType(a, b) {
|
|
26
|
+
return getBaseNodeTypeName(a) === getBaseNodeTypeName(b);
|
|
27
|
+
}
|
|
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
|
|
|
4
4
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
5
5
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
6
6
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
7
|
-
const packageVersion = "114.
|
|
7
|
+
const packageVersion = "114.40.0";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
package/dist/es2019/rank.js
CHANGED
|
@@ -17,7 +17,7 @@ export const rankEditorPlugins = {
|
|
|
17
17
|
// selection keymap needs to be above gap cursor keymap so it can set node selections from
|
|
18
18
|
// left/right arrows
|
|
19
19
|
'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'selectionToolbar', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription', 'beforePrimaryToolbar', 'inlineCode'],
|
|
20
|
-
nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'rule', 'panel', 'mention', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'unsupportedBlock', 'unsupportedInline', 'confluenceJiraIssue', 'hardBreak', 'emoji', 'placeholder', 'mediaSingle', 'mediaGroup', 'table', 'expand', 'nestedExpand', 'media', 'tableHeader', 'decisionList', 'tableRow', 'decisionItem', 'tableCell', 'taskList', 'taskItem', 'extension', 'bodiedExtension', 'multiBodiedExtension', 'inlineExtension', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard'],
|
|
20
|
+
nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'rule', 'panel', 'panel_c1', 'mention', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'unsupportedBlock', 'unsupportedInline', 'confluenceJiraIssue', 'hardBreak', 'emoji', 'placeholder', 'mediaSingle', 'mediaGroup', 'table', 'expand', 'nestedExpand', 'media', 'tableHeader', 'decisionList', 'tableRow', 'decisionItem', 'tableCell', 'taskList', 'taskItem', 'extension', 'bodiedExtension', 'multiBodiedExtension', 'inlineExtension', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard'],
|
|
21
21
|
marks: [
|
|
22
22
|
// Fragment mark is both for inline and block elements
|
|
23
23
|
'fragment',
|
|
@@ -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 = "114.
|
|
17
|
+
const packageVersion = "114.40.0";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -362,4 +362,5 @@ export { toJSON, nodeToJSON } from './nodes';
|
|
|
362
362
|
export { calculateToolbarPositionAboveSelection, calculateToolbarPositionOnCellSelection, calculateToolbarPositionTrackHead } from './calculate-toolbar-position';
|
|
363
363
|
export { findNodePosByLocalIds } from './nodes-by-localIds';
|
|
364
364
|
export { getPageElementCounts } from './page-element-counts';
|
|
365
|
-
export { withFeatureFlaggedComponent } from './withFeatureFlaggedComponent';
|
|
365
|
+
export { withFeatureFlaggedComponent } from './withFeatureFlaggedComponent';
|
|
366
|
+
export { isNodeOfSameBaseType, getBaseNodeTypeName } from './node-type-utils';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the base name of a node type, stripping known variant suffixes.
|
|
3
|
+
*/
|
|
4
|
+
const variantToBaseNameMap = {
|
|
5
|
+
panel_c1: 'panel'
|
|
6
|
+
};
|
|
7
|
+
export function getBaseNodeTypeName(nodeType) {
|
|
8
|
+
var _variantToBaseNameMap;
|
|
9
|
+
return (_variantToBaseNameMap = variantToBaseNameMap[nodeType.name]) !== null && _variantToBaseNameMap !== void 0 ? _variantToBaseNameMap : nodeType.name;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Returns true if two node types share the same base type name.
|
|
14
|
+
*
|
|
15
|
+
* Useful for comparing nodes that may exist as schema variants
|
|
16
|
+
* (e.g. `panel` and `panel_c1` are considered the same base type).
|
|
17
|
+
*/
|
|
18
|
+
export function isNodeOfSameBaseType(a, b) {
|
|
19
|
+
return getBaseNodeTypeName(a) === getBaseNodeTypeName(b);
|
|
20
|
+
}
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "114.
|
|
13
|
+
var packageVersion = "114.40.0";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
package/dist/esm/rank.js
CHANGED
|
@@ -17,7 +17,7 @@ export var rankEditorPlugins = {
|
|
|
17
17
|
// selection keymap needs to be above gap cursor keymap so it can set node selections from
|
|
18
18
|
// left/right arrows
|
|
19
19
|
'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'selectionToolbar', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription', 'beforePrimaryToolbar', 'inlineCode'],
|
|
20
|
-
nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'rule', 'panel', 'mention', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'unsupportedBlock', 'unsupportedInline', 'confluenceJiraIssue', 'hardBreak', 'emoji', 'placeholder', 'mediaSingle', 'mediaGroup', 'table', 'expand', 'nestedExpand', 'media', 'tableHeader', 'decisionList', 'tableRow', 'decisionItem', 'tableCell', 'taskList', 'taskItem', 'extension', 'bodiedExtension', 'multiBodiedExtension', 'inlineExtension', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard'],
|
|
20
|
+
nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'rule', 'panel', 'panel_c1', 'mention', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'unsupportedBlock', 'unsupportedInline', 'confluenceJiraIssue', 'hardBreak', 'emoji', 'placeholder', 'mediaSingle', 'mediaGroup', 'table', 'expand', 'nestedExpand', 'media', 'tableHeader', 'decisionList', 'tableRow', 'decisionItem', 'tableCell', 'taskList', 'taskItem', 'extension', 'bodiedExtension', 'multiBodiedExtension', 'inlineExtension', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard'],
|
|
21
21
|
marks: [
|
|
22
22
|
// Fragment mark is both for inline and block elements
|
|
23
23
|
'fragment',
|
|
@@ -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 = "114.
|
|
24
|
+
var packageVersion = "114.40.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -365,4 +365,5 @@ export { toJSON, nodeToJSON } from './nodes';
|
|
|
365
365
|
export { calculateToolbarPositionAboveSelection, calculateToolbarPositionOnCellSelection, calculateToolbarPositionTrackHead } from './calculate-toolbar-position';
|
|
366
366
|
export { findNodePosByLocalIds } from './nodes-by-localIds';
|
|
367
367
|
export { getPageElementCounts } from './page-element-counts';
|
|
368
|
-
export { withFeatureFlaggedComponent } from './withFeatureFlaggedComponent';
|
|
368
|
+
export { withFeatureFlaggedComponent } from './withFeatureFlaggedComponent';
|
|
369
|
+
export { isNodeOfSameBaseType, getBaseNodeTypeName } from './node-type-utils';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the base name of a node type, stripping known variant suffixes.
|
|
3
|
+
*/
|
|
4
|
+
var variantToBaseNameMap = {
|
|
5
|
+
panel_c1: 'panel'
|
|
6
|
+
};
|
|
7
|
+
export function getBaseNodeTypeName(nodeType) {
|
|
8
|
+
var _variantToBaseNameMap;
|
|
9
|
+
return (_variantToBaseNameMap = variantToBaseNameMap[nodeType.name]) !== null && _variantToBaseNameMap !== void 0 ? _variantToBaseNameMap : nodeType.name;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Returns true if two node types share the same base type name.
|
|
14
|
+
*
|
|
15
|
+
* Useful for comparing nodes that may exist as schema variants
|
|
16
|
+
* (e.g. `panel` and `panel_c1` are considered the same base type).
|
|
17
|
+
*/
|
|
18
|
+
export function isNodeOfSameBaseType(a, b) {
|
|
19
|
+
return getBaseNodeTypeName(a) === getBaseNodeTypeName(b);
|
|
20
|
+
}
|
package/dist/types/rank.d.ts
CHANGED
|
@@ -214,3 +214,4 @@ export { findNodePosByLocalIds } from './nodes-by-localIds';
|
|
|
214
214
|
export { getPageElementCounts } from './page-element-counts';
|
|
215
215
|
export type { PageElementCounts } from './page-element-counts';
|
|
216
216
|
export { withFeatureFlaggedComponent } from './withFeatureFlaggedComponent';
|
|
217
|
+
export { isNodeOfSameBaseType, getBaseNodeTypeName } from './node-type-utils';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
export declare function getBaseNodeTypeName(nodeType: NodeType): string;
|
|
3
|
+
/**
|
|
4
|
+
* Returns true if two node types share the same base type name.
|
|
5
|
+
*
|
|
6
|
+
* Useful for comparing nodes that may exist as schema variants
|
|
7
|
+
* (e.g. `panel` and `panel_c1` are considered the same base type).
|
|
8
|
+
*/
|
|
9
|
+
export declare function isNodeOfSameBaseType(a: NodeType, b: NodeType): boolean;
|
|
@@ -214,3 +214,4 @@ export { findNodePosByLocalIds } from './nodes-by-localIds';
|
|
|
214
214
|
export { getPageElementCounts } from './page-element-counts';
|
|
215
215
|
export type { PageElementCounts } from './page-element-counts';
|
|
216
216
|
export { withFeatureFlaggedComponent } from './withFeatureFlaggedComponent';
|
|
217
|
+
export { isNodeOfSameBaseType, getBaseNodeTypeName } from './node-type-utils';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
export declare function getBaseNodeTypeName(nodeType: NodeType): string;
|
|
3
|
+
/**
|
|
4
|
+
* Returns true if two node types share the same base type name.
|
|
5
|
+
*
|
|
6
|
+
* Useful for comparing nodes that may exist as schema variants
|
|
7
|
+
* (e.g. `panel` and `panel_c1` are considered the same base type).
|
|
8
|
+
*/
|
|
9
|
+
export declare function isNodeOfSameBaseType(a: NodeType, b: NodeType): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "114.
|
|
3
|
+
"version": "114.41.0",
|
|
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/"
|
|
@@ -81,13 +81,13 @@
|
|
|
81
81
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
82
82
|
"@atlaskit/react-ufo": "^6.0.0",
|
|
83
83
|
"@atlaskit/section-message": "^8.13.0",
|
|
84
|
-
"@atlaskit/smart-card": "^44.
|
|
84
|
+
"@atlaskit/smart-card": "^44.14.0",
|
|
85
85
|
"@atlaskit/smart-user-picker": "^10.1.0",
|
|
86
86
|
"@atlaskit/spinner": "^19.1.0",
|
|
87
87
|
"@atlaskit/task-decision": "^20.1.0",
|
|
88
88
|
"@atlaskit/teams-app-config": "^1.12.0",
|
|
89
89
|
"@atlaskit/textfield": "^8.3.0",
|
|
90
|
-
"@atlaskit/tmp-editor-statsig": "^82.
|
|
90
|
+
"@atlaskit/tmp-editor-statsig": "^82.3.0",
|
|
91
91
|
"@atlaskit/tokens": "^13.0.0",
|
|
92
92
|
"@atlaskit/tooltip": "^22.2.0",
|
|
93
93
|
"@atlaskit/width-detector": "^5.1.0",
|
|
@@ -141,6 +141,7 @@
|
|
|
141
141
|
"enzyme": "^3.10.0",
|
|
142
142
|
"raf-stub": "^2.0.1",
|
|
143
143
|
"react": "^18.2.0",
|
|
144
|
+
"react-dom": "^18.2.0",
|
|
144
145
|
"react-intl": "^6.6.2",
|
|
145
146
|
"react-test-renderer": "^18.2.0",
|
|
146
147
|
"sinon": "^2.2.0"
|