@bigbinary/neeto-editor 1.45.27 → 1.45.28
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/dist/Editor.js +268 -41
- package/dist/Editor.js.map +1 -1
- package/dist/FormikEditor.js +1 -1
- package/dist/Menu.js +1 -1
- package/dist/{chunk-B_ypvaUL.js → chunk-C0xZGEez.js} +53 -2
- package/dist/{chunk-B_ypvaUL.js.map → chunk-C0xZGEez.js.map} +1 -1
- package/dist/cjs/Editor.cjs.js +268 -41
- package/dist/cjs/Editor.cjs.js.map +1 -1
- package/dist/cjs/FormikEditor.cjs.js +1 -1
- package/dist/cjs/Menu.cjs.js +1 -1
- package/dist/cjs/{chunk-DZ7EK7nf.cjs.js → chunk-C-KwpuWA.cjs.js} +57 -2
- package/dist/cjs/{chunk-DZ7EK7nf.cjs.js.map → chunk-C-KwpuWA.cjs.js.map} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/editor-stats.html +19 -1
- package/dist/index.js +1 -1
- package/package.json +2 -1
package/dist/FormikEditor.js
CHANGED
|
@@ -8,7 +8,7 @@ import Editor from './Editor.js';
|
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
9
9
|
import '@babel/runtime/helpers/toConsumableArray';
|
|
10
10
|
import '@babel/runtime/helpers/slicedToArray';
|
|
11
|
-
import './chunk-
|
|
11
|
+
import './chunk-C0xZGEez.js';
|
|
12
12
|
import './chunk-DmrvuTKK.js';
|
|
13
13
|
import 'i18next';
|
|
14
14
|
import './chunk-BQZagJsZ.js';
|
package/dist/Menu.js
CHANGED
|
@@ -3,7 +3,7 @@ import '@babel/runtime/helpers/toConsumableArray';
|
|
|
3
3
|
import '@babel/runtime/helpers/slicedToArray';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'ramda';
|
|
6
|
-
export { M as default } from './chunk-
|
|
6
|
+
export { M as default } from './chunk-C0xZGEez.js';
|
|
7
7
|
import './chunk-CftSm0ZU.js';
|
|
8
8
|
import 'react/jsx-runtime';
|
|
9
9
|
import './chunk-DmrvuTKK.js';
|
|
@@ -12270,6 +12270,30 @@ function getMarksBetween(from, to, doc) {
|
|
|
12270
12270
|
return marks;
|
|
12271
12271
|
}
|
|
12272
12272
|
|
|
12273
|
+
/**
|
|
12274
|
+
* Finds the first node of a given type or name in the current selection.
|
|
12275
|
+
* @param state The editor state.
|
|
12276
|
+
* @param typeOrName The node type or name.
|
|
12277
|
+
* @param pos The position to start searching from.
|
|
12278
|
+
* @param maxDepth The maximum depth to search.
|
|
12279
|
+
* @returns The node and the depth as an array.
|
|
12280
|
+
*/
|
|
12281
|
+
const getNodeAtPosition = (state, typeOrName, pos, maxDepth = 20) => {
|
|
12282
|
+
const $pos = state.doc.resolve(pos);
|
|
12283
|
+
let currentDepth = maxDepth;
|
|
12284
|
+
let node = null;
|
|
12285
|
+
while (currentDepth > 0 && node === null) {
|
|
12286
|
+
const currentNode = $pos.node(currentDepth);
|
|
12287
|
+
if ((currentNode === null || currentNode === void 0 ? void 0 : currentNode.type.name) === typeOrName) {
|
|
12288
|
+
node = currentNode;
|
|
12289
|
+
}
|
|
12290
|
+
else {
|
|
12291
|
+
currentDepth -= 1;
|
|
12292
|
+
}
|
|
12293
|
+
}
|
|
12294
|
+
return [node, currentDepth];
|
|
12295
|
+
};
|
|
12296
|
+
|
|
12273
12297
|
/**
|
|
12274
12298
|
* Return attributes of an extension that should be splitted by keepOnSplit flag
|
|
12275
12299
|
* @param extensionAttributes Array of extension attributes
|
|
@@ -12367,6 +12391,33 @@ function isActive(state, name, attributes = {}) {
|
|
|
12367
12391
|
return false;
|
|
12368
12392
|
}
|
|
12369
12393
|
|
|
12394
|
+
const isAtEndOfNode = (state, nodeType) => {
|
|
12395
|
+
const { $from, $to, $anchor } = state.selection;
|
|
12396
|
+
if (nodeType) {
|
|
12397
|
+
const parentNode = findParentNode(node => node.type.name === nodeType)(state.selection);
|
|
12398
|
+
if (!parentNode) {
|
|
12399
|
+
return false;
|
|
12400
|
+
}
|
|
12401
|
+
const $parentPos = state.doc.resolve(parentNode.pos + 1);
|
|
12402
|
+
if ($anchor.pos + 1 === $parentPos.end()) {
|
|
12403
|
+
return true;
|
|
12404
|
+
}
|
|
12405
|
+
return false;
|
|
12406
|
+
}
|
|
12407
|
+
if ($to.parentOffset < $to.parent.nodeSize - 2 || $from.pos !== $to.pos) {
|
|
12408
|
+
return false;
|
|
12409
|
+
}
|
|
12410
|
+
return true;
|
|
12411
|
+
};
|
|
12412
|
+
|
|
12413
|
+
const isAtStartOfNode = (state) => {
|
|
12414
|
+
const { $from, $to } = state.selection;
|
|
12415
|
+
if ($from.parentOffset > 0 || $from.pos !== $to.pos) {
|
|
12416
|
+
return false;
|
|
12417
|
+
}
|
|
12418
|
+
return true;
|
|
12419
|
+
};
|
|
12420
|
+
|
|
12370
12421
|
function isList(name, extensions) {
|
|
12371
12422
|
const { nodeExtensions } = splitExtensions(extensions);
|
|
12372
12423
|
const extension = nodeExtensions.find(item => item.name === name);
|
|
@@ -19405,5 +19456,5 @@ var Menu = function Menu(props) {
|
|
|
19405
19456
|
}));
|
|
19406
19457
|
};
|
|
19407
19458
|
|
|
19408
|
-
export {
|
|
19409
|
-
//# sourceMappingURL=chunk-
|
|
19459
|
+
export { combineTransactionSteps as A, getChangedRanges as B, findChildrenInRange as C, DecorationSet as D, Extension as E, getMarksBetween as F, getAttributes as G, highlightFocussedNode as H, InputRule as I, resetFocussedNode as J, findParentNodeClosestToPos as K, BubbleMenu as L, Menu as M, Node as N, getLinkPopoverPosition as O, PasteRule as P, getMarkType as Q, ReactNodeViewRenderer as R, getMarkRange as S, useEditor as T, useEditorState$1 as U, EditorContent as V, MediaUploader as W, EmbedOption as X, EditorView as Y, Mark as a, markInputRule as b, markPasteRule as c, Decoration as d, isAtStartOfNode as e, isAtEndOfNode as f, getMarkAttributes as g, getNodeType$1 as h, isNodeActive as i, getNodeAtPosition as j, keydownHandler as k, callOrReturn as l, mergeAttributes as m, getExtensionField as n, isNodeSelection as o, nodeInputRule as p, findChildren as q, NodeViewWrapper as r, NodeViewContent as s, textblockTypeInputRule as t, escapeForRegEx as u, validateUrl as v, wrappingInputRule as w, ReactRenderer as x, EmojiPickerMenu as y, emojiPickerApi as z };
|
|
19460
|
+
//# sourceMappingURL=chunk-C0xZGEez.js.map
|