@atlaskit/editor-common 74.15.0 → 74.15.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 +6 -0
- package/dist/cjs/card/MediaAndEmbedsToolbar/index.js +4 -1
- package/dist/cjs/insert/index.js +3 -3
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/react-node-view/index.js +1 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/annotation/index.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/card/MediaAndEmbedsToolbar/index.js +4 -1
- package/dist/es2019/insert/index.js +3 -3
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/react-node-view/index.js +1 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/annotation/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/card/MediaAndEmbedsToolbar/index.js +4 -1
- package/dist/esm/insert/index.js +3 -3
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/react-node-view/index.js +1 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/annotation/index.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/card/utils.d.ts +1 -1
- package/dist/types/insert/index.d.ts +5 -5
- package/dist/types/react-node-view/getInlineNodeViewProducer.d.ts +1 -1
- package/dist/types/react-node-view/index.d.ts +6 -6
- package/dist/types/safe-plugin/index.d.ts +2 -3
- package/dist/types/selection/gap-cursor/selection.d.ts +1 -1
- package/dist/types/transforms/expand.d.ts +1 -1
- package/dist/types/transforms/extension.d.ts +1 -1
- package/dist/types/transforms/layout.d.ts +3 -3
- package/dist/types/types/editor-plugin.d.ts +1 -1
- package/dist/types/utils/document.d.ts +1 -1
- package/dist/types/utils/editor-core-utils.d.ts +2 -2
- package/dist/types/utils/referentiality.d.ts +3 -1
- package/dist/types/utils/slice.d.ts +1 -1
- package/dist/types/utils/validator.d.ts +1 -1
- package/dist/types-ts4.5/card/utils.d.ts +1 -1
- package/dist/types-ts4.5/insert/index.d.ts +5 -5
- package/dist/types-ts4.5/react-node-view/getInlineNodeViewProducer.d.ts +1 -1
- package/dist/types-ts4.5/react-node-view/index.d.ts +6 -6
- package/dist/types-ts4.5/safe-plugin/index.d.ts +2 -3
- package/dist/types-ts4.5/selection/gap-cursor/selection.d.ts +1 -1
- package/dist/types-ts4.5/transforms/expand.d.ts +1 -1
- package/dist/types-ts4.5/transforms/extension.d.ts +1 -1
- package/dist/types-ts4.5/transforms/layout.d.ts +3 -3
- package/dist/types-ts4.5/types/editor-plugin.d.ts +1 -1
- package/dist/types-ts4.5/utils/document.d.ts +1 -1
- package/dist/types-ts4.5/utils/editor-core-utils.d.ts +2 -2
- package/dist/types-ts4.5/utils/referentiality.d.ts +3 -1
- package/dist/types-ts4.5/utils/slice.d.ts +1 -1
- package/dist/types-ts4.5/utils/validator.d.ts +1 -1
- package/package.json +3 -7
package/CHANGELOG.md
CHANGED
|
@@ -94,7 +94,10 @@ var makeAlign = function makeAlign(layout, nodeType, widthPluginDependencyApi, a
|
|
|
94
94
|
|
|
95
95
|
// see https://product-fabric.atlassian.net/browse/ED-15518 insert a new paragraph when an embedded card is wrapped left or right
|
|
96
96
|
if (layout.startsWith('wrap') && paragraph && !tr.doc.nodeAt(state.selection.to) && ((0, _coreUtils.insideTable)(state) || (0, _utils.isInLayoutColumn)(state))) {
|
|
97
|
-
|
|
97
|
+
var emptyParaghraph = paragraph.createAndFill();
|
|
98
|
+
if (emptyParaghraph) {
|
|
99
|
+
tr.insert(state.selection.to, emptyParaghraph);
|
|
100
|
+
}
|
|
98
101
|
}
|
|
99
102
|
analyticsApi === null || analyticsApi === void 0 ? void 0 : analyticsApi.attachAnalyticsEvent({
|
|
100
103
|
eventType: _analytics.EVENT_TYPE.TRACK,
|
package/dist/cjs/insert/index.js
CHANGED
|
@@ -211,7 +211,7 @@ var insertSelectedItem = function insertSelectedItem(maybeNode) {
|
|
|
211
211
|
console.error(e);
|
|
212
212
|
return tr;
|
|
213
213
|
}
|
|
214
|
-
if (node.isText) {
|
|
214
|
+
if (node instanceof _prosemirrorModel.Node && node.isText) {
|
|
215
215
|
tr = tr.replaceWith(start, start, node);
|
|
216
216
|
|
|
217
217
|
/**
|
|
@@ -219,7 +219,7 @@ var insertSelectedItem = function insertSelectedItem(maybeNode) {
|
|
|
219
219
|
* Replacing a type ahead query mark with a block node.
|
|
220
220
|
*
|
|
221
221
|
*/
|
|
222
|
-
} else if (node.isBlock) {
|
|
222
|
+
} else if (node instanceof _prosemirrorModel.Node && node.isBlock) {
|
|
223
223
|
/**
|
|
224
224
|
*
|
|
225
225
|
* Rule has unique insertion behaviour
|
|
@@ -241,7 +241,7 @@ var insertSelectedItem = function insertSelectedItem(maybeNode) {
|
|
|
241
241
|
* Replacing a type ahead query mark with an inline node.
|
|
242
242
|
*
|
|
243
243
|
*/
|
|
244
|
-
} else if (node.isInline || isInputFragment) {
|
|
244
|
+
} else if (node instanceof _prosemirrorModel.Node && node.isInline || isInputFragment) {
|
|
245
245
|
var fragment = isInputFragment ? node : _prosemirrorModel.Fragment.fromArray([node, state.schema.text(' ')]);
|
|
246
246
|
tr = tr.replaceWith(start, start, fragment);
|
|
247
247
|
if (opts.selectInlineNode) {
|
|
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
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 = "74.15.
|
|
19
|
+
var packageVersion = "74.15.1";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -179,6 +179,7 @@ var ReactNodeView = /*#__PURE__*/function () {
|
|
|
179
179
|
|
|
180
180
|
// View should not process a re-render if this is false.
|
|
181
181
|
// We dont want to destroy the view, so we return true.
|
|
182
|
+
// TODO: ED-13910 Fix viewShouldUpdate readonly decoration array
|
|
182
183
|
if (!this.viewShouldUpdate(node, decorations)) {
|
|
183
184
|
this.node = node;
|
|
184
185
|
return true;
|
|
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
24
24
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
25
25
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "74.15.
|
|
27
|
+
var packageVersion = "74.15.1";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -20,7 +20,7 @@ var canApplyAnnotationOnRange = function canApplyAnnotationOnRange(rangeSelectio
|
|
|
20
20
|
// For block elements or text nodes, we want to check
|
|
21
21
|
// if annotations are allowed inside this tree
|
|
22
22
|
// or if we're leaf and not text
|
|
23
|
-
if (node.isInline && !node.isText || node.isLeaf && !node.isText || node.isText && !parent.type.allowsMarkType(schema.marks.annotation)) {
|
|
23
|
+
if (node.isInline && !node.isText || node.isLeaf && !node.isText || node.isText && !(parent !== null && parent !== void 0 && parent.type.allowsMarkType(schema.marks.annotation))) {
|
|
24
24
|
foundInvalid = true;
|
|
25
25
|
return false;
|
|
26
26
|
}
|
package/dist/cjs/version.json
CHANGED
|
@@ -101,7 +101,10 @@ const makeAlign = (layout, nodeType, widthPluginDependencyApi, analyticsApi) =>
|
|
|
101
101
|
|
|
102
102
|
// see https://product-fabric.atlassian.net/browse/ED-15518 insert a new paragraph when an embedded card is wrapped left or right
|
|
103
103
|
if (layout.startsWith('wrap') && paragraph && !tr.doc.nodeAt(state.selection.to) && (insideTable(state) || isInLayoutColumn(state))) {
|
|
104
|
-
|
|
104
|
+
const emptyParaghraph = paragraph.createAndFill();
|
|
105
|
+
if (emptyParaghraph) {
|
|
106
|
+
tr.insert(state.selection.to, emptyParaghraph);
|
|
107
|
+
}
|
|
105
108
|
}
|
|
106
109
|
analyticsApi === null || analyticsApi === void 0 ? void 0 : analyticsApi.attachAnalyticsEvent({
|
|
107
110
|
eventType: EVENT_TYPE.TRACK,
|
|
@@ -203,7 +203,7 @@ export const insertSelectedItem = (maybeNode, opts = {}) => (state, tr, start) =
|
|
|
203
203
|
console.error(e);
|
|
204
204
|
return tr;
|
|
205
205
|
}
|
|
206
|
-
if (node.isText) {
|
|
206
|
+
if (node instanceof Node && node.isText) {
|
|
207
207
|
tr = tr.replaceWith(start, start, node);
|
|
208
208
|
|
|
209
209
|
/**
|
|
@@ -211,7 +211,7 @@ export const insertSelectedItem = (maybeNode, opts = {}) => (state, tr, start) =
|
|
|
211
211
|
* Replacing a type ahead query mark with a block node.
|
|
212
212
|
*
|
|
213
213
|
*/
|
|
214
|
-
} else if (node.isBlock) {
|
|
214
|
+
} else if (node instanceof Node && node.isBlock) {
|
|
215
215
|
/**
|
|
216
216
|
*
|
|
217
217
|
* Rule has unique insertion behaviour
|
|
@@ -233,7 +233,7 @@ export const insertSelectedItem = (maybeNode, opts = {}) => (state, tr, start) =
|
|
|
233
233
|
* Replacing a type ahead query mark with an inline node.
|
|
234
234
|
*
|
|
235
235
|
*/
|
|
236
|
-
} else if (node.isInline || isInputFragment) {
|
|
236
|
+
} else if (node instanceof Node && node.isInline || isInputFragment) {
|
|
237
237
|
const fragment = isInputFragment ? node : Fragment.fromArray([node, state.schema.text(' ')]);
|
|
238
238
|
tr = tr.replaceWith(start, start, fragment);
|
|
239
239
|
if (opts.selectInlineNode) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
2
2
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
3
|
-
const packageVersion = "74.15.
|
|
3
|
+
const packageVersion = "74.15.1";
|
|
4
4
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
5
5
|
// Remove URL as it has UGC
|
|
6
6
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -131,6 +131,7 @@ export default class ReactNodeView {
|
|
|
131
131
|
|
|
132
132
|
// View should not process a re-render if this is false.
|
|
133
133
|
// We dont want to destroy the view, so we return true.
|
|
134
|
+
// TODO: ED-13910 Fix viewShouldUpdate readonly decoration array
|
|
134
135
|
if (!this.viewShouldUpdate(node, decorations)) {
|
|
135
136
|
this.node = node;
|
|
136
137
|
return true;
|
|
@@ -8,7 +8,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
8
8
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
9
9
|
import Layer from '../Layer';
|
|
10
10
|
const packageName = "@atlaskit/editor-common";
|
|
11
|
-
const packageVersion = "74.15.
|
|
11
|
+
const packageVersion = "74.15.1";
|
|
12
12
|
const halfFocusRing = 1;
|
|
13
13
|
const dropOffset = '0, 8';
|
|
14
14
|
class DropList extends Component {
|
|
@@ -16,7 +16,7 @@ export const canApplyAnnotationOnRange = (rangeSelection, doc, schema) => {
|
|
|
16
16
|
// For block elements or text nodes, we want to check
|
|
17
17
|
// if annotations are allowed inside this tree
|
|
18
18
|
// or if we're leaf and not text
|
|
19
|
-
if (node.isInline && !node.isText || node.isLeaf && !node.isText || node.isText && !parent.type.allowsMarkType(schema.marks.annotation)) {
|
|
19
|
+
if (node.isInline && !node.isText || node.isLeaf && !node.isText || node.isText && !(parent !== null && parent !== void 0 && parent.type.allowsMarkType(schema.marks.annotation))) {
|
|
20
20
|
foundInvalid = true;
|
|
21
21
|
return false;
|
|
22
22
|
}
|
package/dist/es2019/version.json
CHANGED
|
@@ -85,7 +85,10 @@ var makeAlign = function makeAlign(layout, nodeType, widthPluginDependencyApi, a
|
|
|
85
85
|
|
|
86
86
|
// see https://product-fabric.atlassian.net/browse/ED-15518 insert a new paragraph when an embedded card is wrapped left or right
|
|
87
87
|
if (layout.startsWith('wrap') && paragraph && !tr.doc.nodeAt(state.selection.to) && (insideTable(state) || isInLayoutColumn(state))) {
|
|
88
|
-
|
|
88
|
+
var emptyParaghraph = paragraph.createAndFill();
|
|
89
|
+
if (emptyParaghraph) {
|
|
90
|
+
tr.insert(state.selection.to, emptyParaghraph);
|
|
91
|
+
}
|
|
89
92
|
}
|
|
90
93
|
analyticsApi === null || analyticsApi === void 0 ? void 0 : analyticsApi.attachAnalyticsEvent({
|
|
91
94
|
eventType: EVENT_TYPE.TRACK,
|
package/dist/esm/insert/index.js
CHANGED
|
@@ -201,7 +201,7 @@ export var insertSelectedItem = function insertSelectedItem(maybeNode) {
|
|
|
201
201
|
console.error(e);
|
|
202
202
|
return tr;
|
|
203
203
|
}
|
|
204
|
-
if (node.isText) {
|
|
204
|
+
if (node instanceof Node && node.isText) {
|
|
205
205
|
tr = tr.replaceWith(start, start, node);
|
|
206
206
|
|
|
207
207
|
/**
|
|
@@ -209,7 +209,7 @@ export var insertSelectedItem = function insertSelectedItem(maybeNode) {
|
|
|
209
209
|
* Replacing a type ahead query mark with a block node.
|
|
210
210
|
*
|
|
211
211
|
*/
|
|
212
|
-
} else if (node.isBlock) {
|
|
212
|
+
} else if (node instanceof Node && node.isBlock) {
|
|
213
213
|
/**
|
|
214
214
|
*
|
|
215
215
|
* Rule has unique insertion behaviour
|
|
@@ -231,7 +231,7 @@ export var insertSelectedItem = function insertSelectedItem(maybeNode) {
|
|
|
231
231
|
* Replacing a type ahead query mark with an inline node.
|
|
232
232
|
*
|
|
233
233
|
*/
|
|
234
|
-
} else if (node.isInline || isInputFragment) {
|
|
234
|
+
} else if (node instanceof Node && node.isInline || isInputFragment) {
|
|
235
235
|
var fragment = isInputFragment ? node : Fragment.fromArray([node, state.schema.text(' ')]);
|
|
236
236
|
tr = tr.replaceWith(start, start, fragment);
|
|
237
237
|
if (opts.selectInlineNode) {
|
|
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
8
8
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
9
|
-
var packageVersion = "74.15.
|
|
9
|
+
var packageVersion = "74.15.1";
|
|
10
10
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
11
11
|
// Remove URL as it has UGC
|
|
12
12
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -160,6 +160,7 @@ var ReactNodeView = /*#__PURE__*/function () {
|
|
|
160
160
|
|
|
161
161
|
// View should not process a re-render if this is false.
|
|
162
162
|
// We dont want to destroy the view, so we return true.
|
|
163
|
+
// TODO: ED-13910 Fix viewShouldUpdate readonly decoration array
|
|
163
164
|
if (!this.viewShouldUpdate(node, decorations)) {
|
|
164
165
|
this.node = node;
|
|
165
166
|
return true;
|
|
@@ -18,7 +18,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
18
18
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
19
19
|
import Layer from '../Layer';
|
|
20
20
|
var packageName = "@atlaskit/editor-common";
|
|
21
|
-
var packageVersion = "74.15.
|
|
21
|
+
var packageVersion = "74.15.1";
|
|
22
22
|
var halfFocusRing = 1;
|
|
23
23
|
var dropOffset = '0, 8';
|
|
24
24
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -14,7 +14,7 @@ export var canApplyAnnotationOnRange = function canApplyAnnotationOnRange(rangeS
|
|
|
14
14
|
// For block elements or text nodes, we want to check
|
|
15
15
|
// if annotations are allowed inside this tree
|
|
16
16
|
// or if we're leaf and not text
|
|
17
|
-
if (node.isInline && !node.isText || node.isLeaf && !node.isText || node.isText && !parent.type.allowsMarkType(schema.marks.annotation)) {
|
|
17
|
+
if (node.isInline && !node.isText || node.isLeaf && !node.isText || node.isText && !(parent !== null && parent !== void 0 && parent.type.allowsMarkType(schema.marks.annotation))) {
|
|
18
18
|
foundInvalid = true;
|
|
19
19
|
return false;
|
|
20
20
|
}
|
package/dist/esm/version.json
CHANGED
|
@@ -6,7 +6,7 @@ import { LinkStepMetadata } from '@atlaskit/adf-schema/steps';
|
|
|
6
6
|
* as a custom LinkStepMetadata prosemirror step so that it is preserved in
|
|
7
7
|
* the history for undo/redo
|
|
8
8
|
*/
|
|
9
|
-
export declare function addLinkMetadata(initialSelection: Selection, tr: Transaction, metadata: LinkStepMetadata): Transaction
|
|
9
|
+
export declare function addLinkMetadata(initialSelection: Selection, tr: Transaction, metadata: LinkStepMetadata): Transaction;
|
|
10
10
|
export declare function getLinkMetadataFromTransaction(tr: Transaction | ReadonlyTransaction): LinkStepMetadata;
|
|
11
11
|
export type CommandDispatch = (tr: Transaction) => void;
|
|
12
12
|
export type Command = (state: EditorState, dispatch?: CommandDispatch, view?: EditorView) => boolean;
|
|
@@ -5,21 +5,21 @@ export declare enum LookDirection {
|
|
|
5
5
|
Before = "before",
|
|
6
6
|
After = "after"
|
|
7
7
|
}
|
|
8
|
-
export declare const normaliseNestedLayout: ({ selection, doc }: EditorState | Transaction, node: Node) => Node
|
|
9
|
-
export declare const safeInsert: (content: InsertableContent, position?: number) => (tr: Transaction) => Transaction
|
|
8
|
+
export declare const normaliseNestedLayout: ({ selection, doc }: EditorState | Transaction, node: Node) => Node;
|
|
9
|
+
export declare const safeInsert: (content: InsertableContent, position?: number) => (tr: Transaction) => Transaction | null;
|
|
10
10
|
/**
|
|
11
11
|
* Method extracted from typeahed plugin to be shared with the element browser on handling element insertion.
|
|
12
12
|
*/
|
|
13
13
|
export declare const insertSelectedItem: (maybeNode?: Node | Object | string | Fragment, opts?: {
|
|
14
14
|
selectInlineNode?: boolean;
|
|
15
|
-
}) => (state: EditorState, tr: Transaction
|
|
15
|
+
}) => (state: EditorState, tr: Transaction, start: number) => Transaction;
|
|
16
16
|
/**
|
|
17
17
|
* ED-14584: Util to check if the destination node is a paragraph & the
|
|
18
18
|
* content being inserted is a valid child of the grandparent node.
|
|
19
19
|
* In this case, the destination node should split
|
|
20
20
|
*/
|
|
21
21
|
export declare const shouldSplitSelectedNodeOnNodeInsertion: ({ parentNodeType, grandParentNodeType, content, }: {
|
|
22
|
-
parentNodeType: NodeType
|
|
23
|
-
grandParentNodeType: NodeType
|
|
22
|
+
parentNodeType: NodeType;
|
|
23
|
+
grandParentNodeType: NodeType;
|
|
24
24
|
content: Node;
|
|
25
25
|
}) => boolean;
|
|
@@ -10,7 +10,7 @@ export type InlineNodeViewComponentProps = {
|
|
|
10
10
|
};
|
|
11
11
|
type InlineNodeViewComponent<ExtraComponentProps> = React.ComponentType<InlineNodeViewComponentProps & ExtraComponentProps>;
|
|
12
12
|
export declare const inlineNodeViewClassname = "inlineNodeView";
|
|
13
|
-
type NodeViewProducer = (node: PMNode, view: EditorView, getPos: (
|
|
13
|
+
type NodeViewProducer = (node: PMNode, view: EditorView, getPos: () => GetPosReturn, decorations: readonly Decoration[]) => NodeView;
|
|
14
14
|
type GetPosReturn = number | undefined;
|
|
15
15
|
export declare function getInlineNodeViewProducer<ExtraComponentProps>({ pmPluginFactoryParams, Component, extraComponentProps, }: {
|
|
16
16
|
pmPluginFactoryParams: PMPluginFactoryParams;
|
|
@@ -16,11 +16,11 @@ export default class ReactNodeView<P = ReactComponentProps> implements NodeView
|
|
|
16
16
|
private _viewShouldUpdate?;
|
|
17
17
|
protected eventDispatcher?: EventDispatcher;
|
|
18
18
|
private hasIntlContext;
|
|
19
|
-
protected decorations: Decoration
|
|
19
|
+
protected decorations: ReadonlyArray<Decoration>;
|
|
20
20
|
reactComponentProps: P;
|
|
21
21
|
view: EditorView;
|
|
22
22
|
getPos: getPosHandler;
|
|
23
|
-
contentDOM:
|
|
23
|
+
contentDOM: HTMLElement | null | undefined;
|
|
24
24
|
node: PMNode;
|
|
25
25
|
constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, reactComponentProps?: P, reactComponent?: React.ComponentType<any>, hasAnalyticsContext?: boolean, viewShouldUpdate?: shouldUpdate, hasIntlContext?: boolean);
|
|
26
26
|
/**
|
|
@@ -36,20 +36,20 @@ export default class ReactNodeView<P = ReactComponentProps> implements NodeView
|
|
|
36
36
|
private renderReactComponent;
|
|
37
37
|
createDomRef(): HTMLElement;
|
|
38
38
|
getContentDOM(): {
|
|
39
|
-
dom:
|
|
40
|
-
contentDOM?:
|
|
39
|
+
dom: HTMLElement;
|
|
40
|
+
contentDOM?: HTMLElement | null | undefined;
|
|
41
41
|
} | undefined;
|
|
42
42
|
handleRef: (node: HTMLElement | null) => void;
|
|
43
43
|
private _handleRef;
|
|
44
44
|
render(props: P, forwardRef?: ForwardRef): React.ReactElement<any> | null;
|
|
45
|
-
update(node: PMNode, decorations:
|
|
45
|
+
update(node: PMNode, decorations: ReadonlyArray<Decoration>, _innerDecorations?: Array<Decoration>, validUpdate?: (currentNode: PMNode, newNode: PMNode) => boolean): boolean;
|
|
46
46
|
viewShouldUpdate(nextNode: PMNode, decorations?: Array<Decoration>): boolean;
|
|
47
47
|
/**
|
|
48
48
|
* Copies the attributes from a ProseMirror Node to a DOM node.
|
|
49
49
|
* @param node The Prosemirror Node from which to source the attributes
|
|
50
50
|
*/
|
|
51
51
|
setDomAttrs(node: PMNode, element: HTMLElement): void;
|
|
52
|
-
get dom(): HTMLElement
|
|
52
|
+
get dom(): HTMLElement;
|
|
53
53
|
destroy(): void;
|
|
54
54
|
private dispatchAnalyticsEvent;
|
|
55
55
|
static fromComponent(component: React.ComponentType<any>, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, props?: ReactComponentProps, viewShouldUpdate?: (nextNode: PMNode) => boolean, hasIntlContext?: boolean): (node: PMNode, view: EditorView, getPos: getPosHandler) => ReactNodeView<ReactComponentProps>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { Schema } from 'prosemirror-model';
|
|
2
1
|
import { Plugin, SafePluginSpec } from 'prosemirror-state';
|
|
3
|
-
export declare class SafePlugin<T = any
|
|
2
|
+
export declare class SafePlugin<T = any> extends Plugin<T> {
|
|
4
3
|
_isATypeSafePlugin: never;
|
|
5
|
-
constructor(spec: SafePluginSpec<T
|
|
4
|
+
constructor(spec: SafePluginSpec<T>);
|
|
6
5
|
}
|
|
@@ -24,7 +24,7 @@ export declare class GapCursorSelection extends Selection {
|
|
|
24
24
|
}): GapCursorSelection;
|
|
25
25
|
map(doc: PMNode, mapping: Mapping): Selection;
|
|
26
26
|
eq(other: Selection): boolean;
|
|
27
|
-
content(): Slice
|
|
27
|
+
content(): Slice;
|
|
28
28
|
getBookmark(): GapBookmark;
|
|
29
29
|
toJSON(): {
|
|
30
30
|
pos: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema, Slice } from 'prosemirror-model';
|
|
2
2
|
import type { EditorState, Selection } from 'prosemirror-state';
|
|
3
|
-
export declare const findExpand: (state: EditorState, selection?: Selection
|
|
3
|
+
export declare const findExpand: (state: EditorState, selection?: Selection | null) => import("prosemirror-utils").ContentNodeWithPos | undefined;
|
|
4
4
|
export declare const transformSliceToRemoveOpenExpand: (slice: Slice, schema: Schema) => Slice;
|
|
5
5
|
export declare const transformSliceNestedExpandToExpand: (slice: Slice, schema: Schema) => Slice;
|
|
@@ -3,4 +3,4 @@ import { Schema, Slice } from 'prosemirror-model';
|
|
|
3
3
|
* Lift content out of "open" top-level bodiedExtensions.
|
|
4
4
|
* Will not work if bodiedExtensions are nested, or when bodiedExtensions are not in the top level
|
|
5
5
|
*/
|
|
6
|
-
export declare const transformSliceToRemoveOpenBodiedExtension: (slice: Slice, schema: Schema) => Slice
|
|
6
|
+
export declare const transformSliceToRemoveOpenBodiedExtension: (slice: Slice, schema: Schema) => Slice;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment, Node, Schema, Slice } from 'prosemirror-model';
|
|
2
2
|
export declare function unwrapContentFromLayout(maybeLayoutSection: Node): Node | Node[];
|
|
3
|
-
export declare function removeLayoutFromFirstChild(node: Node, i: number): Node
|
|
4
|
-
export declare function removeLayoutFromLastChild(node: Node, i: number, fragment: Fragment): Node
|
|
3
|
+
export declare function removeLayoutFromFirstChild(node: Node, i: number): Node | Node[];
|
|
4
|
+
export declare function removeLayoutFromLastChild(node: Node, i: number, fragment: Fragment): Node | Node[];
|
|
5
5
|
/**
|
|
6
6
|
* When we have a slice that cuts across a layoutSection/layoutColumn
|
|
7
7
|
* we can end up with unexpected behaviour on paste/drop where a user
|
|
@@ -12,4 +12,4 @@ export declare function removeLayoutFromLastChild(node: Node, i: number, fragmen
|
|
|
12
12
|
* We only care about slices with non-zero openStart / openEnd's here
|
|
13
13
|
* as we're totally fine for people to copy/paste a full layoutSection
|
|
14
14
|
*/
|
|
15
|
-
export declare function transformSliceToRemoveOpenLayoutNodes(slice: Slice, schema: Schema): Slice
|
|
15
|
+
export declare function transformSliceToRemoveOpenLayoutNodes(slice: Slice, schema: Schema): Slice;
|
|
@@ -27,7 +27,7 @@ export type PluginsOptions = {
|
|
|
27
27
|
};
|
|
28
28
|
type EditorViewStateUpdatedCallbackProps = {
|
|
29
29
|
readonly originalTransaction: Readonly<Transaction>;
|
|
30
|
-
readonly transactions: Transaction[];
|
|
30
|
+
readonly transactions: readonly Transaction[];
|
|
31
31
|
readonly oldEditorState: Readonly<EditorState>;
|
|
32
32
|
readonly newEditorState: Readonly<EditorState>;
|
|
33
33
|
};
|
|
@@ -3,7 +3,7 @@ import type { EditorState, ReadonlyTransaction, Transaction } from 'prosemirror-
|
|
|
3
3
|
import { DispatchAnalyticsEvent } from '../analytics';
|
|
4
4
|
import type { ProviderFactory } from '../provider-factory';
|
|
5
5
|
import type { ReplaceRawValue, Transformer } from '../types';
|
|
6
|
-
type ChangedFn = (node: Node
|
|
6
|
+
type ChangedFn = (node: Node, pos: number, parent: Node | null, index: number) => boolean | void;
|
|
7
7
|
export declare const getStepRange: (transaction: Transaction | ReadonlyTransaction) => {
|
|
8
8
|
from: number;
|
|
9
9
|
to: number;
|
|
@@ -6,7 +6,7 @@ import { EditorView } from 'prosemirror-view';
|
|
|
6
6
|
* Checks if node is an empty paragraph.
|
|
7
7
|
*/
|
|
8
8
|
export declare function isEmptyParagraph(node?: Node | null): boolean;
|
|
9
|
-
export declare const stepHasSlice: (step: Step) => step is Step
|
|
9
|
+
export declare const stepHasSlice: (step: Step) => step is Step & {
|
|
10
10
|
from: number;
|
|
11
11
|
to: number;
|
|
12
12
|
slice: Slice;
|
|
@@ -19,7 +19,7 @@ export declare const stepHasSlice: (step: Step) => step is Step<any> & {
|
|
|
19
19
|
*/
|
|
20
20
|
export declare function stepAddsOneOf(step: Step, nodeTypes: Set<NodeType>): boolean;
|
|
21
21
|
export declare const extractSliceFromStep: (step: Step) => Slice | null;
|
|
22
|
-
export declare const isTextSelection: (selection: Selection) => selection is TextSelection
|
|
22
|
+
export declare const isTextSelection: (selection: Selection) => selection is TextSelection;
|
|
23
23
|
export declare const isElementInTableCell: (element: HTMLElement | null) => HTMLElement | null;
|
|
24
24
|
export declare const isLastItemMediaGroup: (node: Node) => boolean;
|
|
25
25
|
export declare const setNodeSelection: (view: EditorView, pos: number) => void;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference path="../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
+
/// <reference path="../../../../../../typings/prosemirror-state.d.ts" />
|
|
1
3
|
import { Node as PMNode } from 'prosemirror-model';
|
|
2
4
|
import type { EditorState } from 'prosemirror-state';
|
|
3
5
|
import type { FragmentAttributes } from '@atlaskit/adf-schema/schema';
|
|
@@ -12,7 +14,7 @@ type NodeAndTargetLinkages = {
|
|
|
12
14
|
};
|
|
13
15
|
export declare const isReferencedSource: (state: EditorState, node?: PMNode) => boolean;
|
|
14
16
|
export declare const getConnections: (state: EditorState) => Record<string, NodeAndTargetLinkages>;
|
|
15
|
-
export declare const removeConnectedNodes: (state: EditorState, node?: PMNode) => import("prosemirror-state").Transaction
|
|
17
|
+
export declare const removeConnectedNodes: (state: EditorState, node?: PMNode) => import("prosemirror-state").Transaction;
|
|
16
18
|
export declare const getChildrenInfo: (state: EditorState, node?: PMNode) => ConfirmDialogChildInfo[];
|
|
17
19
|
export declare const getNodeName: (state: EditorState, node?: PMNode) => string;
|
|
18
20
|
export {};
|
|
@@ -3,7 +3,7 @@ import { Fragment, Node, Slice } from 'prosemirror-model';
|
|
|
3
3
|
* A helper to get the underlying array of a fragment.
|
|
4
4
|
*/
|
|
5
5
|
export declare function getFragmentBackingArray(fragment: Fragment): ReadonlyArray<Node>;
|
|
6
|
-
export declare function mapFragment(content: Fragment, callback: (node: Node, parent: Node | null, index: number) => Node | Node[] | Fragment | null, parent?: Node | null): Fragment
|
|
6
|
+
export declare function mapFragment(content: Fragment, callback: (node: Node, parent: Node | null, index: number) => Node | Node[] | Fragment | null, parent?: Node | null): Fragment;
|
|
7
7
|
export declare function mapSlice(slice: Slice, callback: (node: Node, parent: Node | null, index: number) => Node | Node[] | Fragment | null): Slice;
|
|
8
8
|
export type FlatMapCallback = (node: Node, index: number, fragment: Fragment) => Node | Node[];
|
|
9
9
|
export declare function flatmap(fragment: Fragment, callback: FlatMapCallback): Fragment;
|
|
@@ -28,7 +28,7 @@ export interface ADMarkSimple {
|
|
|
28
28
|
}
|
|
29
29
|
export declare const markOrder: string[];
|
|
30
30
|
export declare const isSubSupType: (type: string) => type is "sub" | "sup";
|
|
31
|
-
export declare const getMarksByOrder: (marks: PMMark[]) => PMMark
|
|
31
|
+
export declare const getMarksByOrder: (marks: readonly PMMark[]) => PMMark[];
|
|
32
32
|
export declare const isSameMark: (mark: PMMark | null, otherMark: PMMark | null) => boolean;
|
|
33
33
|
export declare const getValidDocument: (doc: ADDoc, schema?: Schema, adfStage?: ADFStage) => ADDoc | null;
|
|
34
34
|
export declare const getValidContent: (content: ADNode[], schema?: Schema, adfStage?: ADFStage) => ADNode[];
|
|
@@ -6,7 +6,7 @@ import { LinkStepMetadata } from '@atlaskit/adf-schema/steps';
|
|
|
6
6
|
* as a custom LinkStepMetadata prosemirror step so that it is preserved in
|
|
7
7
|
* the history for undo/redo
|
|
8
8
|
*/
|
|
9
|
-
export declare function addLinkMetadata(initialSelection: Selection, tr: Transaction, metadata: LinkStepMetadata): Transaction
|
|
9
|
+
export declare function addLinkMetadata(initialSelection: Selection, tr: Transaction, metadata: LinkStepMetadata): Transaction;
|
|
10
10
|
export declare function getLinkMetadataFromTransaction(tr: Transaction | ReadonlyTransaction): LinkStepMetadata;
|
|
11
11
|
export type CommandDispatch = (tr: Transaction) => void;
|
|
12
12
|
export type Command = (state: EditorState, dispatch?: CommandDispatch, view?: EditorView) => boolean;
|
|
@@ -5,21 +5,21 @@ export declare enum LookDirection {
|
|
|
5
5
|
Before = "before",
|
|
6
6
|
After = "after"
|
|
7
7
|
}
|
|
8
|
-
export declare const normaliseNestedLayout: ({ selection, doc }: EditorState | Transaction, node: Node) => Node
|
|
9
|
-
export declare const safeInsert: (content: InsertableContent, position?: number) => (tr: Transaction) => Transaction
|
|
8
|
+
export declare const normaliseNestedLayout: ({ selection, doc }: EditorState | Transaction, node: Node) => Node;
|
|
9
|
+
export declare const safeInsert: (content: InsertableContent, position?: number) => (tr: Transaction) => Transaction | null;
|
|
10
10
|
/**
|
|
11
11
|
* Method extracted from typeahed plugin to be shared with the element browser on handling element insertion.
|
|
12
12
|
*/
|
|
13
13
|
export declare const insertSelectedItem: (maybeNode?: Node | Object | string | Fragment, opts?: {
|
|
14
14
|
selectInlineNode?: boolean;
|
|
15
|
-
}) => (state: EditorState, tr: Transaction
|
|
15
|
+
}) => (state: EditorState, tr: Transaction, start: number) => Transaction;
|
|
16
16
|
/**
|
|
17
17
|
* ED-14584: Util to check if the destination node is a paragraph & the
|
|
18
18
|
* content being inserted is a valid child of the grandparent node.
|
|
19
19
|
* In this case, the destination node should split
|
|
20
20
|
*/
|
|
21
21
|
export declare const shouldSplitSelectedNodeOnNodeInsertion: ({ parentNodeType, grandParentNodeType, content, }: {
|
|
22
|
-
parentNodeType: NodeType
|
|
23
|
-
grandParentNodeType: NodeType
|
|
22
|
+
parentNodeType: NodeType;
|
|
23
|
+
grandParentNodeType: NodeType;
|
|
24
24
|
content: Node;
|
|
25
25
|
}) => boolean;
|
|
@@ -10,7 +10,7 @@ export type InlineNodeViewComponentProps = {
|
|
|
10
10
|
};
|
|
11
11
|
type InlineNodeViewComponent<ExtraComponentProps> = React.ComponentType<InlineNodeViewComponentProps & ExtraComponentProps>;
|
|
12
12
|
export declare const inlineNodeViewClassname = "inlineNodeView";
|
|
13
|
-
type NodeViewProducer = (node: PMNode, view: EditorView, getPos: (
|
|
13
|
+
type NodeViewProducer = (node: PMNode, view: EditorView, getPos: () => GetPosReturn, decorations: readonly Decoration[]) => NodeView;
|
|
14
14
|
type GetPosReturn = number | undefined;
|
|
15
15
|
export declare function getInlineNodeViewProducer<ExtraComponentProps>({ pmPluginFactoryParams, Component, extraComponentProps, }: {
|
|
16
16
|
pmPluginFactoryParams: PMPluginFactoryParams;
|
|
@@ -16,11 +16,11 @@ export default class ReactNodeView<P = ReactComponentProps> implements NodeView
|
|
|
16
16
|
private _viewShouldUpdate?;
|
|
17
17
|
protected eventDispatcher?: EventDispatcher;
|
|
18
18
|
private hasIntlContext;
|
|
19
|
-
protected decorations: Decoration
|
|
19
|
+
protected decorations: ReadonlyArray<Decoration>;
|
|
20
20
|
reactComponentProps: P;
|
|
21
21
|
view: EditorView;
|
|
22
22
|
getPos: getPosHandler;
|
|
23
|
-
contentDOM:
|
|
23
|
+
contentDOM: HTMLElement | null | undefined;
|
|
24
24
|
node: PMNode;
|
|
25
25
|
constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, reactComponentProps?: P, reactComponent?: React.ComponentType<any>, hasAnalyticsContext?: boolean, viewShouldUpdate?: shouldUpdate, hasIntlContext?: boolean);
|
|
26
26
|
/**
|
|
@@ -36,20 +36,20 @@ export default class ReactNodeView<P = ReactComponentProps> implements NodeView
|
|
|
36
36
|
private renderReactComponent;
|
|
37
37
|
createDomRef(): HTMLElement;
|
|
38
38
|
getContentDOM(): {
|
|
39
|
-
dom:
|
|
40
|
-
contentDOM?:
|
|
39
|
+
dom: HTMLElement;
|
|
40
|
+
contentDOM?: HTMLElement | null | undefined;
|
|
41
41
|
} | undefined;
|
|
42
42
|
handleRef: (node: HTMLElement | null) => void;
|
|
43
43
|
private _handleRef;
|
|
44
44
|
render(props: P, forwardRef?: ForwardRef): React.ReactElement<any> | null;
|
|
45
|
-
update(node: PMNode, decorations:
|
|
45
|
+
update(node: PMNode, decorations: ReadonlyArray<Decoration>, _innerDecorations?: Array<Decoration>, validUpdate?: (currentNode: PMNode, newNode: PMNode) => boolean): boolean;
|
|
46
46
|
viewShouldUpdate(nextNode: PMNode, decorations?: Array<Decoration>): boolean;
|
|
47
47
|
/**
|
|
48
48
|
* Copies the attributes from a ProseMirror Node to a DOM node.
|
|
49
49
|
* @param node The Prosemirror Node from which to source the attributes
|
|
50
50
|
*/
|
|
51
51
|
setDomAttrs(node: PMNode, element: HTMLElement): void;
|
|
52
|
-
get dom(): HTMLElement
|
|
52
|
+
get dom(): HTMLElement;
|
|
53
53
|
destroy(): void;
|
|
54
54
|
private dispatchAnalyticsEvent;
|
|
55
55
|
static fromComponent(component: React.ComponentType<any>, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, props?: ReactComponentProps, viewShouldUpdate?: (nextNode: PMNode) => boolean, hasIntlContext?: boolean): (node: PMNode, view: EditorView, getPos: getPosHandler) => ReactNodeView<ReactComponentProps>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { Schema } from 'prosemirror-model';
|
|
2
1
|
import { Plugin, SafePluginSpec } from 'prosemirror-state';
|
|
3
|
-
export declare class SafePlugin<T = any
|
|
2
|
+
export declare class SafePlugin<T = any> extends Plugin<T> {
|
|
4
3
|
_isATypeSafePlugin: never;
|
|
5
|
-
constructor(spec: SafePluginSpec<T
|
|
4
|
+
constructor(spec: SafePluginSpec<T>);
|
|
6
5
|
}
|
|
@@ -24,7 +24,7 @@ export declare class GapCursorSelection extends Selection {
|
|
|
24
24
|
}): GapCursorSelection;
|
|
25
25
|
map(doc: PMNode, mapping: Mapping): Selection;
|
|
26
26
|
eq(other: Selection): boolean;
|
|
27
|
-
content(): Slice
|
|
27
|
+
content(): Slice;
|
|
28
28
|
getBookmark(): GapBookmark;
|
|
29
29
|
toJSON(): {
|
|
30
30
|
pos: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema, Slice } from 'prosemirror-model';
|
|
2
2
|
import type { EditorState, Selection } from 'prosemirror-state';
|
|
3
|
-
export declare const findExpand: (state: EditorState, selection?: Selection
|
|
3
|
+
export declare const findExpand: (state: EditorState, selection?: Selection | null) => import("prosemirror-utils").ContentNodeWithPos | undefined;
|
|
4
4
|
export declare const transformSliceToRemoveOpenExpand: (slice: Slice, schema: Schema) => Slice;
|
|
5
5
|
export declare const transformSliceNestedExpandToExpand: (slice: Slice, schema: Schema) => Slice;
|
|
@@ -3,4 +3,4 @@ import { Schema, Slice } from 'prosemirror-model';
|
|
|
3
3
|
* Lift content out of "open" top-level bodiedExtensions.
|
|
4
4
|
* Will not work if bodiedExtensions are nested, or when bodiedExtensions are not in the top level
|
|
5
5
|
*/
|
|
6
|
-
export declare const transformSliceToRemoveOpenBodiedExtension: (slice: Slice, schema: Schema) => Slice
|
|
6
|
+
export declare const transformSliceToRemoveOpenBodiedExtension: (slice: Slice, schema: Schema) => Slice;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment, Node, Schema, Slice } from 'prosemirror-model';
|
|
2
2
|
export declare function unwrapContentFromLayout(maybeLayoutSection: Node): Node | Node[];
|
|
3
|
-
export declare function removeLayoutFromFirstChild(node: Node, i: number): Node
|
|
4
|
-
export declare function removeLayoutFromLastChild(node: Node, i: number, fragment: Fragment): Node
|
|
3
|
+
export declare function removeLayoutFromFirstChild(node: Node, i: number): Node | Node[];
|
|
4
|
+
export declare function removeLayoutFromLastChild(node: Node, i: number, fragment: Fragment): Node | Node[];
|
|
5
5
|
/**
|
|
6
6
|
* When we have a slice that cuts across a layoutSection/layoutColumn
|
|
7
7
|
* we can end up with unexpected behaviour on paste/drop where a user
|
|
@@ -12,4 +12,4 @@ export declare function removeLayoutFromLastChild(node: Node, i: number, fragmen
|
|
|
12
12
|
* We only care about slices with non-zero openStart / openEnd's here
|
|
13
13
|
* as we're totally fine for people to copy/paste a full layoutSection
|
|
14
14
|
*/
|
|
15
|
-
export declare function transformSliceToRemoveOpenLayoutNodes(slice: Slice, schema: Schema): Slice
|
|
15
|
+
export declare function transformSliceToRemoveOpenLayoutNodes(slice: Slice, schema: Schema): Slice;
|
|
@@ -27,7 +27,7 @@ export type PluginsOptions = {
|
|
|
27
27
|
};
|
|
28
28
|
type EditorViewStateUpdatedCallbackProps = {
|
|
29
29
|
readonly originalTransaction: Readonly<Transaction>;
|
|
30
|
-
readonly transactions: Transaction[];
|
|
30
|
+
readonly transactions: readonly Transaction[];
|
|
31
31
|
readonly oldEditorState: Readonly<EditorState>;
|
|
32
32
|
readonly newEditorState: Readonly<EditorState>;
|
|
33
33
|
};
|
|
@@ -3,7 +3,7 @@ import type { EditorState, ReadonlyTransaction, Transaction } from 'prosemirror-
|
|
|
3
3
|
import { DispatchAnalyticsEvent } from '../analytics';
|
|
4
4
|
import type { ProviderFactory } from '../provider-factory';
|
|
5
5
|
import type { ReplaceRawValue, Transformer } from '../types';
|
|
6
|
-
type ChangedFn = (node: Node
|
|
6
|
+
type ChangedFn = (node: Node, pos: number, parent: Node | null, index: number) => boolean | void;
|
|
7
7
|
export declare const getStepRange: (transaction: Transaction | ReadonlyTransaction) => {
|
|
8
8
|
from: number;
|
|
9
9
|
to: number;
|
|
@@ -6,7 +6,7 @@ import { EditorView } from 'prosemirror-view';
|
|
|
6
6
|
* Checks if node is an empty paragraph.
|
|
7
7
|
*/
|
|
8
8
|
export declare function isEmptyParagraph(node?: Node | null): boolean;
|
|
9
|
-
export declare const stepHasSlice: (step: Step) => step is Step
|
|
9
|
+
export declare const stepHasSlice: (step: Step) => step is Step & {
|
|
10
10
|
from: number;
|
|
11
11
|
to: number;
|
|
12
12
|
slice: Slice;
|
|
@@ -19,7 +19,7 @@ export declare const stepHasSlice: (step: Step) => step is Step<any> & {
|
|
|
19
19
|
*/
|
|
20
20
|
export declare function stepAddsOneOf(step: Step, nodeTypes: Set<NodeType>): boolean;
|
|
21
21
|
export declare const extractSliceFromStep: (step: Step) => Slice | null;
|
|
22
|
-
export declare const isTextSelection: (selection: Selection) => selection is TextSelection
|
|
22
|
+
export declare const isTextSelection: (selection: Selection) => selection is TextSelection;
|
|
23
23
|
export declare const isElementInTableCell: (element: HTMLElement | null) => HTMLElement | null;
|
|
24
24
|
export declare const isLastItemMediaGroup: (node: Node) => boolean;
|
|
25
25
|
export declare const setNodeSelection: (view: EditorView, pos: number) => void;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference path="../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
+
/// <reference path="../../../../../../typings/prosemirror-state.d.ts" />
|
|
1
3
|
import { Node as PMNode } from 'prosemirror-model';
|
|
2
4
|
import type { EditorState } from 'prosemirror-state';
|
|
3
5
|
import type { FragmentAttributes } from '@atlaskit/adf-schema/schema';
|
|
@@ -12,7 +14,7 @@ type NodeAndTargetLinkages = {
|
|
|
12
14
|
};
|
|
13
15
|
export declare const isReferencedSource: (state: EditorState, node?: PMNode) => boolean;
|
|
14
16
|
export declare const getConnections: (state: EditorState) => Record<string, NodeAndTargetLinkages>;
|
|
15
|
-
export declare const removeConnectedNodes: (state: EditorState, node?: PMNode) => import("prosemirror-state").Transaction
|
|
17
|
+
export declare const removeConnectedNodes: (state: EditorState, node?: PMNode) => import("prosemirror-state").Transaction;
|
|
16
18
|
export declare const getChildrenInfo: (state: EditorState, node?: PMNode) => ConfirmDialogChildInfo[];
|
|
17
19
|
export declare const getNodeName: (state: EditorState, node?: PMNode) => string;
|
|
18
20
|
export {};
|
|
@@ -3,7 +3,7 @@ import { Fragment, Node, Slice } from 'prosemirror-model';
|
|
|
3
3
|
* A helper to get the underlying array of a fragment.
|
|
4
4
|
*/
|
|
5
5
|
export declare function getFragmentBackingArray(fragment: Fragment): ReadonlyArray<Node>;
|
|
6
|
-
export declare function mapFragment(content: Fragment, callback: (node: Node, parent: Node | null, index: number) => Node | Node[] | Fragment | null, parent?: Node | null): Fragment
|
|
6
|
+
export declare function mapFragment(content: Fragment, callback: (node: Node, parent: Node | null, index: number) => Node | Node[] | Fragment | null, parent?: Node | null): Fragment;
|
|
7
7
|
export declare function mapSlice(slice: Slice, callback: (node: Node, parent: Node | null, index: number) => Node | Node[] | Fragment | null): Slice;
|
|
8
8
|
export type FlatMapCallback = (node: Node, index: number, fragment: Fragment) => Node | Node[];
|
|
9
9
|
export declare function flatmap(fragment: Fragment, callback: FlatMapCallback): Fragment;
|
|
@@ -28,7 +28,7 @@ export interface ADMarkSimple {
|
|
|
28
28
|
}
|
|
29
29
|
export declare const markOrder: string[];
|
|
30
30
|
export declare const isSubSupType: (type: string) => type is "sub" | "sup";
|
|
31
|
-
export declare const getMarksByOrder: (marks: PMMark[]) => PMMark
|
|
31
|
+
export declare const getMarksByOrder: (marks: readonly PMMark[]) => PMMark[];
|
|
32
32
|
export declare const isSameMark: (mark: PMMark | null, otherMark: PMMark | null) => boolean;
|
|
33
33
|
export declare const getValidDocument: (doc: ADDoc, schema?: Schema, adfStage?: ADFStage) => ADDoc | null;
|
|
34
34
|
export declare const getValidContent: (content: ADNode[], schema?: Schema, adfStage?: ADFStage) => ADNode[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "74.15.
|
|
3
|
+
"version": "74.15.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/"
|
|
@@ -106,10 +106,6 @@
|
|
|
106
106
|
"@emotion/react": "^11.7.1",
|
|
107
107
|
"@sentry/browser": "^6.18.2",
|
|
108
108
|
"@sentry/integrations": "^6.18.2",
|
|
109
|
-
"@types/prosemirror-model": "^1.11.0",
|
|
110
|
-
"@types/prosemirror-state": "^1.2.0",
|
|
111
|
-
"@types/prosemirror-transform": "^1.1.0",
|
|
112
|
-
"@types/prosemirror-view": "^1.9.0",
|
|
113
109
|
"chromatism": "^2.6.0",
|
|
114
110
|
"classnames": "^2.2.5",
|
|
115
111
|
"date-fns": "^2.17.0",
|
|
@@ -139,8 +135,8 @@
|
|
|
139
135
|
"devDependencies": {
|
|
140
136
|
"@atlaskit/editor-core": "^185.8.0",
|
|
141
137
|
"@atlaskit/editor-json-transformer": "^8.9.0",
|
|
142
|
-
"@atlaskit/editor-plugin-analytics": "^0.0.
|
|
143
|
-
"@atlaskit/editor-plugin-content-insertion": "^0.0.
|
|
138
|
+
"@atlaskit/editor-plugin-analytics": "^0.0.5",
|
|
139
|
+
"@atlaskit/editor-plugin-content-insertion": "^0.0.5",
|
|
144
140
|
"@atlaskit/editor-plugin-decorations": "^0.1.0",
|
|
145
141
|
"@atlaskit/editor-plugin-feature-flags": "^0.1.0",
|
|
146
142
|
"@atlaskit/editor-plugin-grid": "^0.1.0",
|