@prosekit/core 0.8.1 → 0.8.3
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-BOiNwODb.js → editor-DlGlYOp-.js} +179 -95
- package/dist/{editor-BP9kgR6R.d.ts → editor-OUH5V8BA.d.ts} +30 -26
- package/dist/prosekit-core-test.d.ts +2 -6
- package/dist/prosekit-core-test.js +1 -1
- package/dist/prosekit-core.d.ts +35 -101
- package/dist/prosekit-core.js +9 -20
- package/package.json +6 -6
package/dist/prosekit-core.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import { Editor, EditorNotFoundError, Priority, ProseKitError, assert, createEditor, defineDefaultState, defineFacet, defineFacetPayload, elementFromJSON, elementFromNode, getMarkType, getNodeType, htmlFromJSON, htmlFromNode, isAllSelection, isFragment, isMark, isMarkAbsent, isMarkActive, isNodeActive, isNodeSelection, isNotNullish, isProseMirrorNode, isSelection, isSlice, isTextSelection, jsonFromHTML, jsonFromNode, jsonFromState, nodeFromElement, nodeFromHTML, nodeFromJSON, rootFacet, schemaFacet, stateFacet, stateFromJSON, toReversed, union } from "./editor-
|
1
|
+
import { Editor, EditorNotFoundError, Priority, ProseKitError, assert, createEditor, defineDefaultState, defineFacet, defineFacetPayload, elementFromJSON, elementFromNode, getMarkType, getNodeType, htmlFromJSON, htmlFromNode, isAllSelection, isFragment, isMark, isMarkAbsent, isMarkActive, isNodeActive, isNodeSelection, isNotNullish, isProseMirrorNode, isSelection, isSlice, isTextSelection, jsonFromHTML, jsonFromNode, jsonFromState, nodeFromElement, nodeFromHTML, nodeFromJSON, rootFacet, schemaFacet, stateFacet, stateFromJSON, toReversed, union } from "./editor-DlGlYOp-.js";
|
2
2
|
import { AllSelection, Plugin, PluginKey, ProseMirrorPlugin, TextSelection } from "@prosekit/pm/state";
|
3
3
|
import { ReplaceAroundStep, findWrapping, insertPoint } from "@prosekit/pm/transform";
|
4
4
|
import { baseKeymap, chainCommands, createParagraphNear, deleteSelection, joinTextblockBackward, lift, liftEmptyBlock, newlineInCode, selectNodeBackward, setBlockType as setBlockType$1, toggleMark as toggleMark$1 } from "@prosekit/pm/commands";
|
5
5
|
import { DOMSerializer, Fragment, ProseMirrorFragment, ProseMirrorNode, Slice } from "@prosekit/pm/model";
|
6
|
-
import { isElementLike } from "@ocavue/utils";
|
6
|
+
import { isElementLike, once } from "@ocavue/utils";
|
7
7
|
import OrderedMap from "orderedmap";
|
8
8
|
import mapValues from "just-map-values";
|
9
9
|
import clone from "just-clone";
|
@@ -375,7 +375,7 @@ function wrap(options) {
|
|
375
375
|
//#region src/commands/toggle-wrap.ts
|
376
376
|
/**
|
377
377
|
* Toggle between wrapping an inactive node with the provided node type, and
|
378
|
-
* lifting it up into
|
378
|
+
* lifting it up into its parent.
|
379
379
|
*
|
380
380
|
* @param options
|
381
381
|
*
|
@@ -1208,10 +1208,7 @@ const keymapFacet = defineFacet({
|
|
1208
1208
|
props: { handleKeyDown: handlerWrapper }
|
1209
1209
|
});
|
1210
1210
|
return (keymaps) => {
|
1211
|
-
handler = keydownHandler(mergeKeymaps(
|
1212
|
-
// The keymap at the end have a higher priority.
|
1213
|
-
toReversed(keymaps)
|
1214
|
-
));
|
1211
|
+
handler = keydownHandler(mergeKeymaps(toReversed(keymaps)));
|
1215
1212
|
return plugin;
|
1216
1213
|
};
|
1217
1214
|
},
|
@@ -1486,19 +1483,9 @@ function defineText() {
|
|
1486
1483
|
});
|
1487
1484
|
}
|
1488
1485
|
|
1489
|
-
//#endregion
|
1490
|
-
//#region src/utils/cache.ts
|
1491
|
-
function cache(fn) {
|
1492
|
-
let result = void 0;
|
1493
|
-
return () => {
|
1494
|
-
if (result === void 0) result = fn();
|
1495
|
-
return result;
|
1496
|
-
};
|
1497
|
-
}
|
1498
|
-
|
1499
1486
|
//#endregion
|
1500
1487
|
//#region src/utils/can-use-regex-lookbehind.ts
|
1501
|
-
const canUseRegexLookbehind =
|
1488
|
+
const canUseRegexLookbehind = once(() => {
|
1502
1489
|
try {
|
1503
1490
|
return "ab".replace(new RegExp("(?<=a)b", "g"), "c") === "ac";
|
1504
1491
|
} catch {
|
@@ -1522,7 +1509,9 @@ const clsx = clsxLite;
|
|
1522
1509
|
/**
|
1523
1510
|
* Collects all children of a node or a fragment, and returns them as an array.
|
1524
1511
|
*
|
1525
|
-
* @
|
1512
|
+
* @deprecated Use `node.children` or `fragment.content` instead.
|
1513
|
+
*
|
1514
|
+
* @hidden
|
1526
1515
|
*/
|
1527
1516
|
function collectChildren(parent) {
|
1528
1517
|
const children = [];
|
@@ -1537,7 +1526,7 @@ function collectChildren(parent) {
|
|
1537
1526
|
*
|
1538
1527
|
* @deprecated Use `collectChildren` instead.
|
1539
1528
|
*
|
1540
|
-
* @
|
1529
|
+
* @hidden
|
1541
1530
|
*/
|
1542
1531
|
function collectNodes(content) {
|
1543
1532
|
if (Array.isArray(content)) return content.flatMap(collectNodes);
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@prosekit/core",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.8.
|
4
|
+
"version": "0.8.3",
|
5
5
|
"private": false,
|
6
6
|
"description": "Core features for ProseKit",
|
7
7
|
"author": {
|
@@ -39,20 +39,20 @@
|
|
39
39
|
"dist"
|
40
40
|
],
|
41
41
|
"dependencies": {
|
42
|
-
"@ocavue/utils": "^0.
|
42
|
+
"@ocavue/utils": "^0.5.0",
|
43
43
|
"clsx": "^2.1.1",
|
44
44
|
"just-clone": "^6.2.0",
|
45
45
|
"just-map-values": "^3.2.0",
|
46
46
|
"orderedmap": "^2.1.1",
|
47
47
|
"prosemirror-splittable": "^0.1.1",
|
48
48
|
"type-fest": "^4.41.0",
|
49
|
-
"@prosekit/pm": "^0.1.
|
49
|
+
"@prosekit/pm": "^0.1.11"
|
50
50
|
},
|
51
51
|
"devDependencies": {
|
52
|
-
"@vitest/browser": "^3.
|
53
|
-
"tsdown": "^0.
|
52
|
+
"@vitest/browser": "^3.2.4",
|
53
|
+
"tsdown": "^0.12.9",
|
54
54
|
"typescript": "~5.8.3",
|
55
|
-
"vitest": "^3.
|
55
|
+
"vitest": "^3.2.4",
|
56
56
|
"@prosekit/config-tsdown": "0.0.0",
|
57
57
|
"@prosekit/config-vitest": "0.0.0"
|
58
58
|
},
|