@atlaskit/editor-common 99.11.0 → 99.12.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/lazy-node-view/index.js +7 -2
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +15 -8
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/index.js +6 -0
- package/dist/cjs/utils/slice.js +20 -1
- package/dist/es2019/lazy-node-view/index.js +3 -2
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +15 -8
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/index.js +1 -1
- package/dist/es2019/utils/slice.js +15 -2
- package/dist/esm/lazy-node-view/index.js +3 -2
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/react-node-view/getInlineNodeViewProducer.js +15 -8
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/slice.js +19 -2
- package/dist/types/lazy-node-view/index.d.ts +2 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/slice.d.ts +3 -1
- package/dist/types-ts4.5/lazy-node-view/index.d.ts +2 -0
- package/dist/types-ts4.5/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/slice.d.ts +3 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 99.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#111831](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/111831)
|
|
8
|
+
[`66895944dfac9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/66895944dfac9) -
|
|
9
|
+
[ED-26430] Block drag-and-drop of legacy content macro extension
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 99.11.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -4,6 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
Object.defineProperty(exports, "LazyNodeView", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _nodeView.LazyNodeView;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
7
13
|
Object.defineProperty(exports, "convertToInlineCss", {
|
|
8
14
|
enumerable: true,
|
|
9
15
|
get: function get() {
|
|
@@ -126,7 +132,7 @@ var withLazyLoading = exports.withLazyLoading = function withLazyLoading(_ref) {
|
|
|
126
132
|
var nodeName = _ref.nodeName,
|
|
127
133
|
loader = _ref.loader,
|
|
128
134
|
getNodeViewOptions = _ref.getNodeViewOptions;
|
|
129
|
-
|
|
135
|
+
return function (node, view, getPos, decorations) {
|
|
130
136
|
var _node$type;
|
|
131
137
|
var requestedNodes = requestedNodesPerEditorView.get(view);
|
|
132
138
|
if (!requestedNodes) {
|
|
@@ -203,5 +209,4 @@ var withLazyLoading = exports.withLazyLoading = function withLazyLoading(_ref) {
|
|
|
203
209
|
}
|
|
204
210
|
return new _nodeView.LazyNodeView(node, view, getPos, decorations);
|
|
205
211
|
};
|
|
206
|
-
return createLazyNodeView;
|
|
207
212
|
};
|
|
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
19
19
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
20
|
-
var packageVersion = "99.
|
|
20
|
+
var packageVersion = "99.12.0";
|
|
21
21
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
22
22
|
// Remove URL as it has UGC
|
|
23
23
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -89,17 +89,24 @@ function createNodeView(_ref) {
|
|
|
89
89
|
}
|
|
90
90
|
function attachNodeViewObserver() {
|
|
91
91
|
var observer = (0, _onVisibleObserverFactory.getOrCreateOnVisibleObserver)(nodeViewParams.view);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
92
|
+
if (domRef) {
|
|
93
|
+
removeIntersectionObserver = observer.observe(domRef, function () {
|
|
94
|
+
if (!didRenderComponentWithIntersectionObserver && !destroyed) {
|
|
95
|
+
domRef.replaceChildren();
|
|
96
|
+
renderComponent();
|
|
97
|
+
didRenderComponentWithIntersectionObserver = true;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
99
101
|
}
|
|
100
102
|
if (shouldVirtualize) {
|
|
101
103
|
renderFallback();
|
|
102
|
-
|
|
104
|
+
// allow the fallback to render first before attaching the observer.
|
|
105
|
+
// Will tweak this in a follow up PR to optimise rendering of visible
|
|
106
|
+
// nodes without fallback rendering.
|
|
107
|
+
setTimeout(function () {
|
|
108
|
+
attachNodeViewObserver();
|
|
109
|
+
}, 0);
|
|
103
110
|
} else {
|
|
104
111
|
var _getPerformanceOption = (0, _utils.getPerformanceOptions)(nodeViewParams.view),
|
|
105
112
|
samplingRate = _getPerformanceOption.samplingRate,
|
|
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
23
23
|
* @jsx jsx
|
|
24
24
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
25
25
|
var packageName = "@atlaskit/editor-common";
|
|
26
|
-
var packageVersion = "99.
|
|
26
|
+
var packageVersion = "99.12.0";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
// Ignored via go/ees005
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -606,6 +606,12 @@ Object.defineProperty(exports, "hasMergedCell", {
|
|
|
606
606
|
return _table.hasMergedCell;
|
|
607
607
|
}
|
|
608
608
|
});
|
|
609
|
+
Object.defineProperty(exports, "hasNode", {
|
|
610
|
+
enumerable: true,
|
|
611
|
+
get: function get() {
|
|
612
|
+
return _slice.hasNode;
|
|
613
|
+
}
|
|
614
|
+
});
|
|
609
615
|
Object.defineProperty(exports, "hasVisibleContent", {
|
|
610
616
|
enumerable: true,
|
|
611
617
|
get: function get() {
|
package/dist/cjs/utils/slice.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.flatmap = flatmap;
|
|
8
8
|
exports.getFragmentBackingArray = getFragmentBackingArray;
|
|
9
|
+
exports.hasNode = void 0;
|
|
9
10
|
exports.mapChildren = mapChildren;
|
|
10
11
|
exports.mapFragment = mapFragment;
|
|
11
12
|
exports.mapSlice = mapSlice;
|
|
@@ -59,4 +60,22 @@ function mapChildren(node, callback) {
|
|
|
59
60
|
array.push(callback(node.child(i), i, node instanceof _model.Fragment ? node : node.content));
|
|
60
61
|
}
|
|
61
62
|
return array;
|
|
62
|
-
}
|
|
63
|
+
}
|
|
64
|
+
var findNode = function findNode(predicate) {
|
|
65
|
+
return function (slice) {
|
|
66
|
+
var foundNode = null;
|
|
67
|
+
slice.content.nodesBetween(0, slice.content.size, function (node) {
|
|
68
|
+
if (predicate(node)) {
|
|
69
|
+
foundNode = node;
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
73
|
+
});
|
|
74
|
+
return foundNode;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
var hasNode = exports.hasNode = function hasNode(predicate) {
|
|
78
|
+
return function (slice) {
|
|
79
|
+
return !!findNode(predicate)(slice);
|
|
80
|
+
};
|
|
81
|
+
};
|
|
@@ -5,6 +5,8 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
|
5
5
|
import { cancelCallback, scheduleCallback } from './lazy-scheduler';
|
|
6
6
|
import { LazyNodeView, makeNodePlaceholderId } from './node-view';
|
|
7
7
|
export { convertToInlineCss } from './css-helper';
|
|
8
|
+
export { LazyNodeView };
|
|
9
|
+
|
|
8
10
|
/**
|
|
9
11
|
* 📢 Public Plugin Key
|
|
10
12
|
*
|
|
@@ -111,7 +113,7 @@ export const withLazyLoading = ({
|
|
|
111
113
|
loader,
|
|
112
114
|
getNodeViewOptions
|
|
113
115
|
}) => {
|
|
114
|
-
|
|
116
|
+
return (node, view, getPos, decorations) => {
|
|
115
117
|
var _node$type, _node$type$spec;
|
|
116
118
|
let requestedNodes = requestedNodesPerEditorView.get(view);
|
|
117
119
|
if (!requestedNodes) {
|
|
@@ -185,5 +187,4 @@ export const withLazyLoading = ({
|
|
|
185
187
|
}
|
|
186
188
|
return new LazyNodeView(node, view, getPos, decorations);
|
|
187
189
|
};
|
|
188
|
-
return createLazyNodeView;
|
|
189
190
|
};
|
|
@@ -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 = "99.
|
|
4
|
+
const packageVersion = "99.12.0";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -82,17 +82,24 @@ function createNodeView({
|
|
|
82
82
|
}
|
|
83
83
|
function attachNodeViewObserver() {
|
|
84
84
|
const observer = getOrCreateOnVisibleObserver(nodeViewParams.view);
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
if (domRef) {
|
|
86
|
+
removeIntersectionObserver = observer.observe(domRef, () => {
|
|
87
|
+
if (!didRenderComponentWithIntersectionObserver && !destroyed) {
|
|
88
|
+
domRef.replaceChildren();
|
|
89
|
+
renderComponent();
|
|
90
|
+
didRenderComponentWithIntersectionObserver = true;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
92
94
|
}
|
|
93
95
|
if (shouldVirtualize) {
|
|
94
96
|
renderFallback();
|
|
95
|
-
|
|
97
|
+
// allow the fallback to render first before attaching the observer.
|
|
98
|
+
// Will tweak this in a follow up PR to optimise rendering of visible
|
|
99
|
+
// nodes without fallback rendering.
|
|
100
|
+
setTimeout(() => {
|
|
101
|
+
attachNodeViewObserver();
|
|
102
|
+
}, 0);
|
|
96
103
|
} else {
|
|
97
104
|
const {
|
|
98
105
|
samplingRate,
|
|
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
13
13
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
14
14
|
import Layer from '../Layer';
|
|
15
15
|
const packageName = "@atlaskit/editor-common";
|
|
16
|
-
const packageVersion = "99.
|
|
16
|
+
const packageVersion = "99.12.0";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
// Ignored via go/ees005
|
|
@@ -53,7 +53,7 @@ validNode,
|
|
|
53
53
|
*/
|
|
54
54
|
validateNodes, isType, isParagraph, isText, isLinkMark, SelectedState, isNodeSelectedOrInRange, isSupportedInParent, isMediaNode, isNodeBeforeMediaNode } from './nodes';
|
|
55
55
|
export { pluginFactory } from './plugin-state-factory';
|
|
56
|
-
export { getFragmentBackingArray, mapFragment, mapSlice, flatmap, mapChildren } from './slice';
|
|
56
|
+
export { getFragmentBackingArray, mapFragment, mapSlice, flatmap, mapChildren, hasNode } from './slice';
|
|
57
57
|
export { walkUpTreeUntil, unwrap, removeNestedEmptyEls, containsClassName, closest, closestElement, parsePx, mapElem, maphElem } from './dom';
|
|
58
58
|
export { default as ADFTraversor } from './traversor';
|
|
59
59
|
/**
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* A helper to get the underlying array of a fragment.
|
|
5
4
|
*/
|
|
@@ -47,4 +46,18 @@ export function mapChildren(node, callback) {
|
|
|
47
46
|
array.push(callback(node.child(i), i, node instanceof Fragment ? node : node.content));
|
|
48
47
|
}
|
|
49
48
|
return array;
|
|
50
|
-
}
|
|
49
|
+
}
|
|
50
|
+
const findNode = predicate => slice => {
|
|
51
|
+
let foundNode = null;
|
|
52
|
+
slice.content.nodesBetween(0, slice.content.size, node => {
|
|
53
|
+
if (predicate(node)) {
|
|
54
|
+
foundNode = node;
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return true;
|
|
58
|
+
});
|
|
59
|
+
return foundNode;
|
|
60
|
+
};
|
|
61
|
+
export const hasNode = predicate => slice => {
|
|
62
|
+
return !!findNode(predicate)(slice);
|
|
63
|
+
};
|
|
@@ -6,6 +6,8 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
|
6
6
|
import { cancelCallback, scheduleCallback } from './lazy-scheduler';
|
|
7
7
|
import { LazyNodeView, makeNodePlaceholderId } from './node-view';
|
|
8
8
|
export { convertToInlineCss } from './css-helper';
|
|
9
|
+
export { LazyNodeView };
|
|
10
|
+
|
|
9
11
|
/**
|
|
10
12
|
* 📢 Public Plugin Key
|
|
11
13
|
*
|
|
@@ -111,7 +113,7 @@ export var withLazyLoading = function withLazyLoading(_ref) {
|
|
|
111
113
|
var nodeName = _ref.nodeName,
|
|
112
114
|
loader = _ref.loader,
|
|
113
115
|
getNodeViewOptions = _ref.getNodeViewOptions;
|
|
114
|
-
|
|
116
|
+
return function (node, view, getPos, decorations) {
|
|
115
117
|
var _node$type;
|
|
116
118
|
var requestedNodes = requestedNodesPerEditorView.get(view);
|
|
117
119
|
if (!requestedNodes) {
|
|
@@ -188,5 +190,4 @@ export var withLazyLoading = function withLazyLoading(_ref) {
|
|
|
188
190
|
}
|
|
189
191
|
return new LazyNodeView(node, view, getPos, decorations);
|
|
190
192
|
};
|
|
191
|
-
return createLazyNodeView;
|
|
192
193
|
};
|
|
@@ -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 = "99.
|
|
10
|
+
var packageVersion = "99.12.0";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -84,17 +84,24 @@ function createNodeView(_ref) {
|
|
|
84
84
|
}
|
|
85
85
|
function attachNodeViewObserver() {
|
|
86
86
|
var observer = getOrCreateOnVisibleObserver(nodeViewParams.view);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
if (domRef) {
|
|
88
|
+
removeIntersectionObserver = observer.observe(domRef, function () {
|
|
89
|
+
if (!didRenderComponentWithIntersectionObserver && !destroyed) {
|
|
90
|
+
domRef.replaceChildren();
|
|
91
|
+
renderComponent();
|
|
92
|
+
didRenderComponentWithIntersectionObserver = true;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
94
96
|
}
|
|
95
97
|
if (shouldVirtualize) {
|
|
96
98
|
renderFallback();
|
|
97
|
-
|
|
99
|
+
// allow the fallback to render first before attaching the observer.
|
|
100
|
+
// Will tweak this in a follow up PR to optimise rendering of visible
|
|
101
|
+
// nodes without fallback rendering.
|
|
102
|
+
setTimeout(function () {
|
|
103
|
+
attachNodeViewObserver();
|
|
104
|
+
}, 0);
|
|
98
105
|
} else {
|
|
99
106
|
var _getPerformanceOption = getPerformanceOptions(nodeViewParams.view),
|
|
100
107
|
samplingRate = _getPerformanceOption.samplingRate,
|
|
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
20
20
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
21
21
|
import Layer from '../Layer';
|
|
22
22
|
var packageName = "@atlaskit/editor-common";
|
|
23
|
-
var packageVersion = "99.
|
|
23
|
+
var packageVersion = "99.12.0";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
// Ignored via go/ees005
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -53,7 +53,7 @@ validNode,
|
|
|
53
53
|
*/
|
|
54
54
|
validateNodes, isType, isParagraph, isText, isLinkMark, SelectedState, isNodeSelectedOrInRange, isSupportedInParent, isMediaNode, isNodeBeforeMediaNode } from './nodes';
|
|
55
55
|
export { pluginFactory } from './plugin-state-factory';
|
|
56
|
-
export { getFragmentBackingArray, mapFragment, mapSlice, flatmap, mapChildren } from './slice';
|
|
56
|
+
export { getFragmentBackingArray, mapFragment, mapSlice, flatmap, mapChildren, hasNode } from './slice';
|
|
57
57
|
export { walkUpTreeUntil, unwrap, removeNestedEmptyEls, containsClassName, closest, closestElement, parsePx, mapElem, maphElem } from './dom';
|
|
58
58
|
export { default as ADFTraversor } from './traversor';
|
|
59
59
|
/**
|
package/dist/esm/utils/slice.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
4
|
* A helper to get the underlying array of a fragment.
|
|
6
5
|
*/
|
|
@@ -49,4 +48,22 @@ export function mapChildren(node, callback) {
|
|
|
49
48
|
array.push(callback(node.child(i), i, node instanceof Fragment ? node : node.content));
|
|
50
49
|
}
|
|
51
50
|
return array;
|
|
52
|
-
}
|
|
51
|
+
}
|
|
52
|
+
var findNode = function findNode(predicate) {
|
|
53
|
+
return function (slice) {
|
|
54
|
+
var foundNode = null;
|
|
55
|
+
slice.content.nodesBetween(0, slice.content.size, function (node) {
|
|
56
|
+
if (predicate(node)) {
|
|
57
|
+
foundNode = node;
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
return true;
|
|
61
|
+
});
|
|
62
|
+
return foundNode;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
export var hasNode = function hasNode(predicate) {
|
|
66
|
+
return function (slice) {
|
|
67
|
+
return !!findNode(predicate)(slice);
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -2,9 +2,11 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { Decoration, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { DispatchAnalyticsEvent } from '../analytics';
|
|
5
|
+
import { LazyNodeView } from './node-view';
|
|
5
6
|
import type { LazyNodeViewToDOMConfiguration, NodeViewConstructor } from './types';
|
|
6
7
|
export { convertToInlineCss } from './css-helper';
|
|
7
8
|
export type { NodeViewConstructor, LazyNodeViewToDOMConfiguration };
|
|
9
|
+
export { LazyNodeView };
|
|
8
10
|
/**
|
|
9
11
|
* 📢 Public Plugin Key
|
|
10
12
|
*
|
|
@@ -55,7 +55,7 @@ validNode,
|
|
|
55
55
|
validateNodes, isType, isParagraph, isText, isLinkMark, SelectedState, isNodeSelectedOrInRange, isSupportedInParent, isMediaNode, isNodeBeforeMediaNode, } from './nodes';
|
|
56
56
|
export type { Reducer } from './plugin-state-factory';
|
|
57
57
|
export { pluginFactory } from './plugin-state-factory';
|
|
58
|
-
export { getFragmentBackingArray, mapFragment, mapSlice, flatmap, mapChildren } from './slice';
|
|
58
|
+
export { getFragmentBackingArray, mapFragment, mapSlice, flatmap, mapChildren, hasNode, } from './slice';
|
|
59
59
|
export type { FlatMapCallback, MapWithCallback } from './slice';
|
|
60
60
|
export { walkUpTreeUntil, unwrap, removeNestedEmptyEls, containsClassName, closest, closestElement, parsePx, mapElem, maphElem, } from './dom';
|
|
61
61
|
export type { MapCallback } from './dom';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Fragment,
|
|
1
|
+
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
3
|
/**
|
|
3
4
|
* A helper to get the underlying array of a fragment.
|
|
4
5
|
*/
|
|
@@ -9,3 +10,4 @@ export type FlatMapCallback = (node: Node, index: number, fragment: Fragment) =>
|
|
|
9
10
|
export declare function flatmap(fragment: Fragment, callback: FlatMapCallback): Fragment;
|
|
10
11
|
export type MapWithCallback<T> = (node: Node, index: number, fragment: Fragment) => T;
|
|
11
12
|
export declare function mapChildren<T>(node: Node | Fragment, callback: MapWithCallback<T>): Array<T>;
|
|
13
|
+
export declare const hasNode: (predicate: (node: Node) => boolean) => (slice: Slice) => boolean;
|
|
@@ -2,9 +2,11 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { Decoration, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { DispatchAnalyticsEvent } from '../analytics';
|
|
5
|
+
import { LazyNodeView } from './node-view';
|
|
5
6
|
import type { LazyNodeViewToDOMConfiguration, NodeViewConstructor } from './types';
|
|
6
7
|
export { convertToInlineCss } from './css-helper';
|
|
7
8
|
export type { NodeViewConstructor, LazyNodeViewToDOMConfiguration };
|
|
9
|
+
export { LazyNodeView };
|
|
8
10
|
/**
|
|
9
11
|
* 📢 Public Plugin Key
|
|
10
12
|
*
|
|
@@ -55,7 +55,7 @@ validNode,
|
|
|
55
55
|
validateNodes, isType, isParagraph, isText, isLinkMark, SelectedState, isNodeSelectedOrInRange, isSupportedInParent, isMediaNode, isNodeBeforeMediaNode, } from './nodes';
|
|
56
56
|
export type { Reducer } from './plugin-state-factory';
|
|
57
57
|
export { pluginFactory } from './plugin-state-factory';
|
|
58
|
-
export { getFragmentBackingArray, mapFragment, mapSlice, flatmap, mapChildren } from './slice';
|
|
58
|
+
export { getFragmentBackingArray, mapFragment, mapSlice, flatmap, mapChildren, hasNode, } from './slice';
|
|
59
59
|
export type { FlatMapCallback, MapWithCallback } from './slice';
|
|
60
60
|
export { walkUpTreeUntil, unwrap, removeNestedEmptyEls, containsClassName, closest, closestElement, parsePx, mapElem, maphElem, } from './dom';
|
|
61
61
|
export type { MapCallback } from './dom';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Fragment,
|
|
1
|
+
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
3
|
/**
|
|
3
4
|
* A helper to get the underlying array of a fragment.
|
|
4
5
|
*/
|
|
@@ -9,3 +10,4 @@ export type FlatMapCallback = (node: Node, index: number, fragment: Fragment) =>
|
|
|
9
10
|
export declare function flatmap(fragment: Fragment, callback: FlatMapCallback): Fragment;
|
|
10
11
|
export type MapWithCallback<T> = (node: Node, index: number, fragment: Fragment) => T;
|
|
11
12
|
export declare function mapChildren<T>(node: Node | Fragment, callback: MapWithCallback<T>): Array<T>;
|
|
13
|
+
export declare const hasNode: (predicate: (node: Node) => boolean) => (slice: Slice) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "99.
|
|
3
|
+
"version": "99.12.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/"
|
|
@@ -130,10 +130,10 @@
|
|
|
130
130
|
"@atlaskit/editor-shared-styles": "^3.2.0",
|
|
131
131
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
132
132
|
"@atlaskit/emoji": "^67.13.0",
|
|
133
|
-
"@atlaskit/icon": "^23.
|
|
133
|
+
"@atlaskit/icon": "^23.8.0",
|
|
134
134
|
"@atlaskit/icon-object": "^6.10.0",
|
|
135
135
|
"@atlaskit/link-datasource": "^3.19.0",
|
|
136
|
-
"@atlaskit/link-picker": "^1.
|
|
136
|
+
"@atlaskit/link-picker": "^1.49.0",
|
|
137
137
|
"@atlaskit/media-card": "^78.19.0",
|
|
138
138
|
"@atlaskit/media-client": "^31.1.0",
|
|
139
139
|
"@atlaskit/media-client-react": "^3.0.0",
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
"@atlaskit/spinner": "^17.1.0",
|
|
156
156
|
"@atlaskit/task-decision": "^17.12.0",
|
|
157
157
|
"@atlaskit/textfield": "^6.8.0",
|
|
158
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
158
|
+
"@atlaskit/tmp-editor-statsig": "^2.45.0",
|
|
159
159
|
"@atlaskit/tokens": "^3.3.0",
|
|
160
160
|
"@atlaskit/tooltip": "^19.1.0",
|
|
161
161
|
"@atlaskit/width-detector": "^4.4.0",
|