@atlaskit/editor-common 115.7.1 → 115.7.2
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 +8 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/index.js +0 -20
- package/dist/cjs/utils/node-type-utils.js +51 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/index.js +1 -3
- package/dist/es2019/utils/node-type-utils.js +50 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/index.js +1 -3
- package/dist/esm/utils/node-type-utils.js +49 -1
- package/dist/types/utils/index.d.ts +6 -8
- package/dist/types/utils/node-type-utils.d.ts +15 -1
- package/dist/types-ts4.5/utils/index.d.ts +6 -8
- package/dist/types-ts4.5/utils/node-type-utils.d.ts +15 -1
- package/package.json +3 -3
- package/utils/node-type-utils/package.json +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 115.7.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4c2645b77929d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4c2645b77929d) -
|
|
8
|
+
[ux] EDITOR-7346 add ai and diff plugin support for panel_c1
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 115.7.1
|
|
4
12
|
|
|
5
13
|
### Patch 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 _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); 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 = "115.7.
|
|
22
|
+
var packageVersion = "115.7.1";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -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 = "115.7.
|
|
27
|
+
var packageVersion = "115.7.1";
|
|
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,12 +426,6 @@ 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
|
-
});
|
|
435
429
|
Object.defineProperty(exports, "getBreakoutResizableNodeTypes", {
|
|
436
430
|
enumerable: true,
|
|
437
431
|
get: function get() {
|
|
@@ -773,24 +767,12 @@ Object.defineProperty(exports, "isNodeBeforeMediaNode", {
|
|
|
773
767
|
}
|
|
774
768
|
});
|
|
775
769
|
exports.isNodeEmpty = isNodeEmpty;
|
|
776
|
-
Object.defineProperty(exports, "isNodeOfSameBaseType", {
|
|
777
|
-
enumerable: true,
|
|
778
|
-
get: function get() {
|
|
779
|
-
return _nodeTypeUtils.isNodeOfSameBaseType;
|
|
780
|
-
}
|
|
781
|
-
});
|
|
782
770
|
Object.defineProperty(exports, "isNodeSelectedOrInRange", {
|
|
783
771
|
enumerable: true,
|
|
784
772
|
get: function get() {
|
|
785
773
|
return _nodes.isNodeSelectedOrInRange;
|
|
786
774
|
}
|
|
787
775
|
});
|
|
788
|
-
Object.defineProperty(exports, "isNodeTypeValidChildOf", {
|
|
789
|
-
enumerable: true,
|
|
790
|
-
get: function get() {
|
|
791
|
-
return _isNodeTypeValidChildOf.isNodeTypeValidChildOf;
|
|
792
|
-
}
|
|
793
|
-
});
|
|
794
776
|
Object.defineProperty(exports, "isParagraph", {
|
|
795
777
|
enumerable: true,
|
|
796
778
|
get: function get() {
|
|
@@ -1326,8 +1308,6 @@ var _calculateToolbarPosition = require("./calculate-toolbar-position");
|
|
|
1326
1308
|
var _nodesByLocalIds = require("./nodes-by-localIds");
|
|
1327
1309
|
var _pageElementCounts = require("./page-element-counts");
|
|
1328
1310
|
var _withFeatureFlaggedComponent = require("./withFeatureFlaggedComponent");
|
|
1329
|
-
var _isNodeTypeValidChildOf = require("./isNodeTypeValidChildOf");
|
|
1330
|
-
var _nodeTypeUtils = require("./node-type-utils");
|
|
1331
1311
|
// Disable no-re-export rule for entry point files
|
|
1332
1312
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
1333
1313
|
|
|
@@ -5,6 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getBaseNodeTypeName = getBaseNodeTypeName;
|
|
7
7
|
exports.isNodeOfSameBaseType = isNodeOfSameBaseType;
|
|
8
|
+
exports.isNodeTypeValidChildOf = isNodeTypeValidChildOf;
|
|
9
|
+
exports.pickPanelTypeForInsertion = pickPanelTypeForInsertion;
|
|
10
|
+
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
8
11
|
/**
|
|
9
12
|
* Returns the base name of a node type, stripping known variant suffixes.
|
|
10
13
|
*/
|
|
@@ -25,4 +28,51 @@ function getBaseNodeTypeName(nodeType) {
|
|
|
25
28
|
function isNodeOfSameBaseType(a, b) {
|
|
26
29
|
return getBaseNodeTypeName(a) === getBaseNodeTypeName(b);
|
|
27
30
|
}
|
|
28
|
-
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Checks if a node type is a valid child of a parent node by creating a minimal valid
|
|
34
|
+
* instance and validating it against the parent's content expression. Unlike ProseMirror's
|
|
35
|
+
* canReplaceWith, this checks general type compatibility without requiring a specific insertion index.
|
|
36
|
+
*/
|
|
37
|
+
function isNodeTypeValidChildOf(childTypeName, parentNode, schema) {
|
|
38
|
+
var childType = schema.nodes[childTypeName];
|
|
39
|
+
if (!childType) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
var candidate = childType.createAndFill();
|
|
43
|
+
if (!candidate) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
return parentNode.type.validContent(_model.Fragment.from(candidate));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Picks the appropriate panel NodeType for insertion at the current selection
|
|
51
|
+
* or resolved position.
|
|
52
|
+
*
|
|
53
|
+
* Prefers `panel_c1` when the parent can accept it (e.g. when table-in-panel
|
|
54
|
+
* is supported), falls back to `panel` otherwise or at isolating boundaries.
|
|
55
|
+
*/
|
|
56
|
+
function pickPanelTypeForInsertion($from) {
|
|
57
|
+
var schema = $from.doc.type.schema;
|
|
58
|
+
var _schema$nodes = schema.nodes,
|
|
59
|
+
panel = _schema$nodes.panel,
|
|
60
|
+
panel_c1 = _schema$nodes.panel_c1;
|
|
61
|
+
if (!panel_c1) {
|
|
62
|
+
return panel;
|
|
63
|
+
}
|
|
64
|
+
for (var depth = $from.depth; depth >= 0; depth--) {
|
|
65
|
+
var parent = $from.node(depth);
|
|
66
|
+
var index = $from.index(depth);
|
|
67
|
+
if (parent.canReplaceWith(index, index, panel_c1)) {
|
|
68
|
+
return panel_c1;
|
|
69
|
+
}
|
|
70
|
+
var spec = parent.type.spec;
|
|
71
|
+
// Stop at isolating containers (e.g. expand, tableCell) — hard walls where
|
|
72
|
+
// the panel stays inside and should use the regular panel type.
|
|
73
|
+
if (spec.isolating) {
|
|
74
|
+
return panel;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return panel;
|
|
78
|
+
}
|
|
@@ -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 = "115.7.
|
|
7
|
+
const packageVersion = "115.7.1";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -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 = "115.7.
|
|
17
|
+
const packageVersion = "115.7.1";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -379,6 +379,4 @@ export { toJSON, nodeToJSON } from './nodes';
|
|
|
379
379
|
export { calculateToolbarPositionAboveSelection, calculateToolbarPositionOnCellSelection, calculateToolbarPositionTrackHead } from './calculate-toolbar-position';
|
|
380
380
|
export { findNodePosByLocalIds } from './nodes-by-localIds';
|
|
381
381
|
export { getPageElementCounts } from './page-element-counts';
|
|
382
|
-
export { withFeatureFlaggedComponent } from './withFeatureFlaggedComponent';
|
|
383
|
-
export { isNodeTypeValidChildOf } from './isNodeTypeValidChildOf';
|
|
384
|
-
export { isNodeOfSameBaseType, getBaseNodeTypeName } from './node-type-utils';
|
|
382
|
+
export { withFeatureFlaggedComponent } from './withFeatureFlaggedComponent';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
1
2
|
/**
|
|
2
3
|
* Returns the base name of a node type, stripping known variant suffixes.
|
|
3
4
|
*/
|
|
@@ -18,4 +19,52 @@ export function getBaseNodeTypeName(nodeType) {
|
|
|
18
19
|
export function isNodeOfSameBaseType(a, b) {
|
|
19
20
|
return getBaseNodeTypeName(a) === getBaseNodeTypeName(b);
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Checks if a node type is a valid child of a parent node by creating a minimal valid
|
|
25
|
+
* instance and validating it against the parent's content expression. Unlike ProseMirror's
|
|
26
|
+
* canReplaceWith, this checks general type compatibility without requiring a specific insertion index.
|
|
27
|
+
*/
|
|
28
|
+
export function isNodeTypeValidChildOf(childTypeName, parentNode, schema) {
|
|
29
|
+
const childType = schema.nodes[childTypeName];
|
|
30
|
+
if (!childType) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
const candidate = childType.createAndFill();
|
|
34
|
+
if (!candidate) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
return parentNode.type.validContent(Fragment.from(candidate));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Picks the appropriate panel NodeType for insertion at the current selection
|
|
42
|
+
* or resolved position.
|
|
43
|
+
*
|
|
44
|
+
* Prefers `panel_c1` when the parent can accept it (e.g. when table-in-panel
|
|
45
|
+
* is supported), falls back to `panel` otherwise or at isolating boundaries.
|
|
46
|
+
*/
|
|
47
|
+
export function pickPanelTypeForInsertion($from) {
|
|
48
|
+
const schema = $from.doc.type.schema;
|
|
49
|
+
const {
|
|
50
|
+
panel,
|
|
51
|
+
panel_c1
|
|
52
|
+
} = schema.nodes;
|
|
53
|
+
if (!panel_c1) {
|
|
54
|
+
return panel;
|
|
55
|
+
}
|
|
56
|
+
for (let depth = $from.depth; depth >= 0; depth--) {
|
|
57
|
+
const parent = $from.node(depth);
|
|
58
|
+
const index = $from.index(depth);
|
|
59
|
+
if (parent.canReplaceWith(index, index, panel_c1)) {
|
|
60
|
+
return panel_c1;
|
|
61
|
+
}
|
|
62
|
+
const spec = parent.type.spec;
|
|
63
|
+
// Stop at isolating containers (e.g. expand, tableCell) — hard walls where
|
|
64
|
+
// the panel stays inside and should use the regular panel type.
|
|
65
|
+
if (spec.isolating) {
|
|
66
|
+
return panel;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return panel;
|
|
70
|
+
}
|
|
@@ -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 = "115.7.
|
|
13
|
+
var packageVersion = "115.7.1";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -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 = "115.7.
|
|
24
|
+
var packageVersion = "115.7.1";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -382,6 +382,4 @@ export { toJSON, nodeToJSON } from './nodes';
|
|
|
382
382
|
export { calculateToolbarPositionAboveSelection, calculateToolbarPositionOnCellSelection, calculateToolbarPositionTrackHead } from './calculate-toolbar-position';
|
|
383
383
|
export { findNodePosByLocalIds } from './nodes-by-localIds';
|
|
384
384
|
export { getPageElementCounts } from './page-element-counts';
|
|
385
|
-
export { withFeatureFlaggedComponent } from './withFeatureFlaggedComponent';
|
|
386
|
-
export { isNodeTypeValidChildOf } from './isNodeTypeValidChildOf';
|
|
387
|
-
export { isNodeOfSameBaseType, getBaseNodeTypeName } from './node-type-utils';
|
|
385
|
+
export { withFeatureFlaggedComponent } from './withFeatureFlaggedComponent';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
1
2
|
/**
|
|
2
3
|
* Returns the base name of a node type, stripping known variant suffixes.
|
|
3
4
|
*/
|
|
@@ -18,4 +19,51 @@ export function getBaseNodeTypeName(nodeType) {
|
|
|
18
19
|
export function isNodeOfSameBaseType(a, b) {
|
|
19
20
|
return getBaseNodeTypeName(a) === getBaseNodeTypeName(b);
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Checks if a node type is a valid child of a parent node by creating a minimal valid
|
|
25
|
+
* instance and validating it against the parent's content expression. Unlike ProseMirror's
|
|
26
|
+
* canReplaceWith, this checks general type compatibility without requiring a specific insertion index.
|
|
27
|
+
*/
|
|
28
|
+
export function isNodeTypeValidChildOf(childTypeName, parentNode, schema) {
|
|
29
|
+
var childType = schema.nodes[childTypeName];
|
|
30
|
+
if (!childType) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
var candidate = childType.createAndFill();
|
|
34
|
+
if (!candidate) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
return parentNode.type.validContent(Fragment.from(candidate));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Picks the appropriate panel NodeType for insertion at the current selection
|
|
42
|
+
* or resolved position.
|
|
43
|
+
*
|
|
44
|
+
* Prefers `panel_c1` when the parent can accept it (e.g. when table-in-panel
|
|
45
|
+
* is supported), falls back to `panel` otherwise or at isolating boundaries.
|
|
46
|
+
*/
|
|
47
|
+
export function pickPanelTypeForInsertion($from) {
|
|
48
|
+
var schema = $from.doc.type.schema;
|
|
49
|
+
var _schema$nodes = schema.nodes,
|
|
50
|
+
panel = _schema$nodes.panel,
|
|
51
|
+
panel_c1 = _schema$nodes.panel_c1;
|
|
52
|
+
if (!panel_c1) {
|
|
53
|
+
return panel;
|
|
54
|
+
}
|
|
55
|
+
for (var depth = $from.depth; depth >= 0; depth--) {
|
|
56
|
+
var parent = $from.node(depth);
|
|
57
|
+
var index = $from.index(depth);
|
|
58
|
+
if (parent.canReplaceWith(index, index, panel_c1)) {
|
|
59
|
+
return panel_c1;
|
|
60
|
+
}
|
|
61
|
+
var spec = parent.type.spec;
|
|
62
|
+
// Stop at isolating containers (e.g. expand, tableCell) — hard walls where
|
|
63
|
+
// the panel stays inside and should use the regular panel type.
|
|
64
|
+
if (spec.isolating) {
|
|
65
|
+
return panel;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return panel;
|
|
69
|
+
}
|
|
@@ -33,7 +33,7 @@ export { setTextSelection } from './setTextSelection';
|
|
|
33
33
|
export { stepHasSlice } from './stepHasSlice';
|
|
34
34
|
export { withImageLoader } from './imageLoader';
|
|
35
35
|
export type { ImageLoaderProps, ImageLoaderState, ImageStatus } from './imageLoader';
|
|
36
|
-
export { absoluteBreakoutWidth, calcBreakoutWidth, calcWideWidth, breakoutConsts, calculateBreakoutStyles, calcBreakoutWidthPx, calcBreakoutWithCustomWidth } from './breakout';
|
|
36
|
+
export { absoluteBreakoutWidth, calcBreakoutWidth, calcWideWidth, breakoutConsts, calculateBreakoutStyles, calcBreakoutWidthPx, calcBreakoutWithCustomWidth, } from './breakout';
|
|
37
37
|
export { breakoutResizableNodes } from './breakoutResizableNodes';
|
|
38
38
|
export { getBreakoutResizableNodeTypes } from './getBreakoutResizableNodeTypes';
|
|
39
39
|
export { getNextBreakoutMode } from './getNextBreakoutMode';
|
|
@@ -44,7 +44,7 @@ export { findChangedNodesFromTransaction } from './findChangedNodesFromTransacti
|
|
|
44
44
|
export { isMediaNode } from './isMediaNode';
|
|
45
45
|
export { isNodeBeforeMediaNode } from './isNodeBeforeMediaNode';
|
|
46
46
|
export { isSupportedInParent } from './isSupportedInParent';
|
|
47
|
-
export { validateNodes, isType, isParagraph, isText, isLinkMark, isNodeSelectedOrInRange } from './nodes';
|
|
47
|
+
export { validateNodes, isType, isParagraph, isText, isLinkMark, isNodeSelectedOrInRange, } from './nodes';
|
|
48
48
|
export { validNode } from './validNode';
|
|
49
49
|
export type { Reducer } from './plugin-state-factory';
|
|
50
50
|
export { pluginFactory } from './plugin-state-factory';
|
|
@@ -66,11 +66,11 @@ export { default as ADFTraversor } from './traversor';
|
|
|
66
66
|
* Use entry-point `@atlaskit/editor-common/utils/analytics` instead
|
|
67
67
|
*/
|
|
68
68
|
export { SEVERITY } from './SEVERITY';
|
|
69
|
-
export { analyticsEventKey, getAnalyticsEditorAppearance, getAnalyticsEventSeverity } from './analytics';
|
|
69
|
+
export { analyticsEventKey, getAnalyticsEditorAppearance, getAnalyticsEventSeverity, } from './analytics';
|
|
70
70
|
export { getAnalyticsAppearance } from './getAnalyticsAppearance';
|
|
71
71
|
export { UNSUPPORTED_CONTENT_LEVEL_SEVERITY } from './unsupportedContent/UNSUPPORTED_CONTENT_LEVEL_SEVERITY';
|
|
72
72
|
export { UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS } from './unsupportedContent/UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS';
|
|
73
|
-
export { getUnsupportedContentLevelData, type UnsupportedContentLevelsTracking } from './unsupportedContent/get-unsupported-content-level-data';
|
|
73
|
+
export { getUnsupportedContentLevelData, type UnsupportedContentLevelsTracking, } from './unsupportedContent/get-unsupported-content-level-data';
|
|
74
74
|
export type { UnsupportedContentTooltipPayload, UnsupportedContentPayload, } from './unsupportedContent/types';
|
|
75
75
|
export { findAndTrackUnsupportedContentNodes } from './track-unsupported-content';
|
|
76
76
|
export {
|
|
@@ -160,7 +160,7 @@ export { FILEPATH_REGEXP } from './FILEPATH_REGEXP';
|
|
|
160
160
|
export { LinkMatcher } from './LinkMatcher';
|
|
161
161
|
export { canLinkBeCreatedInRange } from './canLinkBeCreatedInRange';
|
|
162
162
|
export { getLinkDomain } from './getLinkDomain';
|
|
163
|
-
export { isFromCurrentDomain, linkifyContent, findFilepaths, isLinkInMatches, DONTLINKIFY_REGEXP, getLinkCreationAnalyticsEvent } from './hyperlink';
|
|
163
|
+
export { isFromCurrentDomain, linkifyContent, findFilepaths, isLinkInMatches, DONTLINKIFY_REGEXP, getLinkCreationAnalyticsEvent, } from './hyperlink';
|
|
164
164
|
export { normalizeUrl } from './normalizeUrl';
|
|
165
165
|
export declare const pmHistoryPluginKey = "history$";
|
|
166
166
|
export { gridTypeForLayout } from './grid';
|
|
@@ -191,7 +191,7 @@ export { alignAttributes } from './rich-media-utils';
|
|
|
191
191
|
export { sanitizeNodeForPrivacy } from './filter/privacy-filter';
|
|
192
192
|
export { canRenderDatasource } from './datasource';
|
|
193
193
|
export { getDatasourceType } from './getDatasourceType';
|
|
194
|
-
export { filterCommand, isEmptySelectionAtStart, isEmptySelectionAtEnd, deleteEmptyParagraphAndMoveBlockUp, insertNewLineWithAnalytics, createNewParagraphAbove, createNewParagraphBelow, createParagraphNear, walkNextNode, walkPrevNode } from './commands';
|
|
194
|
+
export { filterCommand, isEmptySelectionAtStart, isEmptySelectionAtEnd, deleteEmptyParagraphAndMoveBlockUp, insertNewLineWithAnalytics, createNewParagraphAbove, createNewParagraphBelow, createParagraphNear, walkNextNode, walkPrevNode, } from './commands';
|
|
195
195
|
export { insertContentDeleteRange } from './insertContentDeleteRange';
|
|
196
196
|
export type { WalkNode } from './commands';
|
|
197
197
|
export { GUTTER_SELECTOR, GUTTER_SIZE_IN_PX, GUTTER_SIZE_MOBILE_IN_PX } from './scroll-gutter';
|
|
@@ -231,5 +231,3 @@ export { findNodePosByLocalIds } from './nodes-by-localIds';
|
|
|
231
231
|
export { getPageElementCounts } from './page-element-counts';
|
|
232
232
|
export type { PageElementCounts } from './page-element-counts';
|
|
233
233
|
export { withFeatureFlaggedComponent } from './withFeatureFlaggedComponent';
|
|
234
|
-
export { isNodeTypeValidChildOf } from './isNodeTypeValidChildOf';
|
|
235
|
-
export { isNodeOfSameBaseType, getBaseNodeTypeName } from './node-type-utils';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
1
|
+
import type { NodeType, Node as PMNode, ResolvedPos, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export declare function getBaseNodeTypeName(nodeType: NodeType): string;
|
|
3
3
|
/**
|
|
4
4
|
* Returns true if two node types share the same base type name.
|
|
@@ -7,3 +7,17 @@ export declare function getBaseNodeTypeName(nodeType: NodeType): string;
|
|
|
7
7
|
* (e.g. `panel` and `panel_c1` are considered the same base type).
|
|
8
8
|
*/
|
|
9
9
|
export declare function isNodeOfSameBaseType(a: NodeType, b: NodeType): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Checks if a node type is a valid child of a parent node by creating a minimal valid
|
|
12
|
+
* instance and validating it against the parent's content expression. Unlike ProseMirror's
|
|
13
|
+
* canReplaceWith, this checks general type compatibility without requiring a specific insertion index.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isNodeTypeValidChildOf(childTypeName: string, parentNode: PMNode, schema: Schema): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Picks the appropriate panel NodeType for insertion at the current selection
|
|
18
|
+
* or resolved position.
|
|
19
|
+
*
|
|
20
|
+
* Prefers `panel_c1` when the parent can accept it (e.g. when table-in-panel
|
|
21
|
+
* is supported), falls back to `panel` otherwise or at isolating boundaries.
|
|
22
|
+
*/
|
|
23
|
+
export declare function pickPanelTypeForInsertion($from: ResolvedPos): NodeType;
|
|
@@ -33,7 +33,7 @@ export { setTextSelection } from './setTextSelection';
|
|
|
33
33
|
export { stepHasSlice } from './stepHasSlice';
|
|
34
34
|
export { withImageLoader } from './imageLoader';
|
|
35
35
|
export type { ImageLoaderProps, ImageLoaderState, ImageStatus } from './imageLoader';
|
|
36
|
-
export { absoluteBreakoutWidth, calcBreakoutWidth, calcWideWidth, breakoutConsts, calculateBreakoutStyles, calcBreakoutWidthPx, calcBreakoutWithCustomWidth } from './breakout';
|
|
36
|
+
export { absoluteBreakoutWidth, calcBreakoutWidth, calcWideWidth, breakoutConsts, calculateBreakoutStyles, calcBreakoutWidthPx, calcBreakoutWithCustomWidth, } from './breakout';
|
|
37
37
|
export { breakoutResizableNodes } from './breakoutResizableNodes';
|
|
38
38
|
export { getBreakoutResizableNodeTypes } from './getBreakoutResizableNodeTypes';
|
|
39
39
|
export { getNextBreakoutMode } from './getNextBreakoutMode';
|
|
@@ -44,7 +44,7 @@ export { findChangedNodesFromTransaction } from './findChangedNodesFromTransacti
|
|
|
44
44
|
export { isMediaNode } from './isMediaNode';
|
|
45
45
|
export { isNodeBeforeMediaNode } from './isNodeBeforeMediaNode';
|
|
46
46
|
export { isSupportedInParent } from './isSupportedInParent';
|
|
47
|
-
export { validateNodes, isType, isParagraph, isText, isLinkMark, isNodeSelectedOrInRange } from './nodes';
|
|
47
|
+
export { validateNodes, isType, isParagraph, isText, isLinkMark, isNodeSelectedOrInRange, } from './nodes';
|
|
48
48
|
export { validNode } from './validNode';
|
|
49
49
|
export type { Reducer } from './plugin-state-factory';
|
|
50
50
|
export { pluginFactory } from './plugin-state-factory';
|
|
@@ -66,11 +66,11 @@ export { default as ADFTraversor } from './traversor';
|
|
|
66
66
|
* Use entry-point `@atlaskit/editor-common/utils/analytics` instead
|
|
67
67
|
*/
|
|
68
68
|
export { SEVERITY } from './SEVERITY';
|
|
69
|
-
export { analyticsEventKey, getAnalyticsEditorAppearance, getAnalyticsEventSeverity } from './analytics';
|
|
69
|
+
export { analyticsEventKey, getAnalyticsEditorAppearance, getAnalyticsEventSeverity, } from './analytics';
|
|
70
70
|
export { getAnalyticsAppearance } from './getAnalyticsAppearance';
|
|
71
71
|
export { UNSUPPORTED_CONTENT_LEVEL_SEVERITY } from './unsupportedContent/UNSUPPORTED_CONTENT_LEVEL_SEVERITY';
|
|
72
72
|
export { UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS } from './unsupportedContent/UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS';
|
|
73
|
-
export { getUnsupportedContentLevelData, type UnsupportedContentLevelsTracking } from './unsupportedContent/get-unsupported-content-level-data';
|
|
73
|
+
export { getUnsupportedContentLevelData, type UnsupportedContentLevelsTracking, } from './unsupportedContent/get-unsupported-content-level-data';
|
|
74
74
|
export type { UnsupportedContentTooltipPayload, UnsupportedContentPayload, } from './unsupportedContent/types';
|
|
75
75
|
export { findAndTrackUnsupportedContentNodes } from './track-unsupported-content';
|
|
76
76
|
export {
|
|
@@ -160,7 +160,7 @@ export { FILEPATH_REGEXP } from './FILEPATH_REGEXP';
|
|
|
160
160
|
export { LinkMatcher } from './LinkMatcher';
|
|
161
161
|
export { canLinkBeCreatedInRange } from './canLinkBeCreatedInRange';
|
|
162
162
|
export { getLinkDomain } from './getLinkDomain';
|
|
163
|
-
export { isFromCurrentDomain, linkifyContent, findFilepaths, isLinkInMatches, DONTLINKIFY_REGEXP, getLinkCreationAnalyticsEvent } from './hyperlink';
|
|
163
|
+
export { isFromCurrentDomain, linkifyContent, findFilepaths, isLinkInMatches, DONTLINKIFY_REGEXP, getLinkCreationAnalyticsEvent, } from './hyperlink';
|
|
164
164
|
export { normalizeUrl } from './normalizeUrl';
|
|
165
165
|
export declare const pmHistoryPluginKey = "history$";
|
|
166
166
|
export { gridTypeForLayout } from './grid';
|
|
@@ -191,7 +191,7 @@ export { alignAttributes } from './rich-media-utils';
|
|
|
191
191
|
export { sanitizeNodeForPrivacy } from './filter/privacy-filter';
|
|
192
192
|
export { canRenderDatasource } from './datasource';
|
|
193
193
|
export { getDatasourceType } from './getDatasourceType';
|
|
194
|
-
export { filterCommand, isEmptySelectionAtStart, isEmptySelectionAtEnd, deleteEmptyParagraphAndMoveBlockUp, insertNewLineWithAnalytics, createNewParagraphAbove, createNewParagraphBelow, createParagraphNear, walkNextNode, walkPrevNode } from './commands';
|
|
194
|
+
export { filterCommand, isEmptySelectionAtStart, isEmptySelectionAtEnd, deleteEmptyParagraphAndMoveBlockUp, insertNewLineWithAnalytics, createNewParagraphAbove, createNewParagraphBelow, createParagraphNear, walkNextNode, walkPrevNode, } from './commands';
|
|
195
195
|
export { insertContentDeleteRange } from './insertContentDeleteRange';
|
|
196
196
|
export type { WalkNode } from './commands';
|
|
197
197
|
export { GUTTER_SELECTOR, GUTTER_SIZE_IN_PX, GUTTER_SIZE_MOBILE_IN_PX } from './scroll-gutter';
|
|
@@ -231,5 +231,3 @@ export { findNodePosByLocalIds } from './nodes-by-localIds';
|
|
|
231
231
|
export { getPageElementCounts } from './page-element-counts';
|
|
232
232
|
export type { PageElementCounts } from './page-element-counts';
|
|
233
233
|
export { withFeatureFlaggedComponent } from './withFeatureFlaggedComponent';
|
|
234
|
-
export { isNodeTypeValidChildOf } from './isNodeTypeValidChildOf';
|
|
235
|
-
export { isNodeOfSameBaseType, getBaseNodeTypeName } from './node-type-utils';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
1
|
+
import type { NodeType, Node as PMNode, ResolvedPos, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export declare function getBaseNodeTypeName(nodeType: NodeType): string;
|
|
3
3
|
/**
|
|
4
4
|
* Returns true if two node types share the same base type name.
|
|
@@ -7,3 +7,17 @@ export declare function getBaseNodeTypeName(nodeType: NodeType): string;
|
|
|
7
7
|
* (e.g. `panel` and `panel_c1` are considered the same base type).
|
|
8
8
|
*/
|
|
9
9
|
export declare function isNodeOfSameBaseType(a: NodeType, b: NodeType): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Checks if a node type is a valid child of a parent node by creating a minimal valid
|
|
12
|
+
* instance and validating it against the parent's content expression. Unlike ProseMirror's
|
|
13
|
+
* canReplaceWith, this checks general type compatibility without requiring a specific insertion index.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isNodeTypeValidChildOf(childTypeName: string, parentNode: PMNode, schema: Schema): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Picks the appropriate panel NodeType for insertion at the current selection
|
|
18
|
+
* or resolved position.
|
|
19
|
+
*
|
|
20
|
+
* Prefers `panel_c1` when the parent can accept it (e.g. when table-in-panel
|
|
21
|
+
* is supported), falls back to `panel` otherwise or at isolating boundaries.
|
|
22
|
+
*/
|
|
23
|
+
export declare function pickPanelTypeForInsertion($from: ResolvedPos): NodeType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "115.7.
|
|
3
|
+
"version": "115.7.2",
|
|
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/"
|
|
@@ -87,7 +87,7 @@
|
|
|
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": "^90.
|
|
90
|
+
"@atlaskit/tmp-editor-statsig": "^90.2.0",
|
|
91
91
|
"@atlaskit/tokens": "^13.3.0",
|
|
92
92
|
"@atlaskit/tooltip": "^22.6.0",
|
|
93
93
|
"@atlaskit/width-detector": "^5.1.0",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
},
|
|
129
129
|
"devDependencies": {
|
|
130
130
|
"@atlaskit/media-core": "^37.1.0",
|
|
131
|
-
"@atlassian/a11y-jest-testing": "^0.
|
|
131
|
+
"@atlassian/a11y-jest-testing": "^0.12.0",
|
|
132
132
|
"@atlassian/react-compiler-gating": "workspace:^",
|
|
133
133
|
"@testing-library/dom": "^10.1.0",
|
|
134
134
|
"@testing-library/jest-dom": "^6.4.5",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-common/utils/node-type-utils",
|
|
3
|
+
"main": "../../dist/cjs/utils/node-type-utils.js",
|
|
4
|
+
"module": "../../dist/esm/utils/node-type-utils.js",
|
|
5
|
+
"module:es2019": "../../dist/es2019/utils/node-type-utils.js",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"**/*.compiled.css"
|
|
8
|
+
],
|
|
9
|
+
"types": "../../dist/types/utils/node-type-utils.d.ts",
|
|
10
|
+
"typesVersions": {
|
|
11
|
+
">=4.5 <5.9": {
|
|
12
|
+
"*": [
|
|
13
|
+
"../../dist/types-ts4.5/utils/node-type-utils.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|