@prosekit/extensions 0.11.7 → 0.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/dist/{drop-indicator-E7nCfdnR.js → drop-indicator-BMvWUDXz.js} +2 -2
- package/dist/{drop-indicator-E7nCfdnR.js.map → drop-indicator-BMvWUDXz.js.map} +1 -1
- package/dist/{enter-rule-5tkoU2Ir.js → enter-rule-D-p4ykfv.js} +2 -2
- package/dist/{enter-rule-5tkoU2Ir.js.map → enter-rule-D-p4ykfv.js.map} +1 -1
- package/dist/{file-nRyo7PMB.js → file-DKoIIa7q.js} +2 -2
- package/dist/{file-nRyo7PMB.js.map → file-DKoIIa7q.js.map} +1 -1
- package/dist/{index-DY6lIIYV.d.ts → index-DdjnBeho.d.ts} +2 -2
- package/dist/index-DdjnBeho.d.ts.map +1 -0
- package/dist/{input-rule-DO_iy2aT.js → input-rule-COGr_GBb.js} +2 -2
- package/dist/{input-rule-DO_iy2aT.js.map → input-rule-COGr_GBb.js.map} +1 -1
- package/dist/{mark-rule-CGmswjQ_.js → mark-rule-v2E7B4C0.js} +2 -2
- package/dist/{mark-rule-CGmswjQ_.js.map → mark-rule-v2E7B4C0.js.map} +1 -1
- package/dist/{paste-rule-Brej6cWi.js → paste-rule-qSz46pqD.js} +2 -2
- package/dist/{paste-rule-Brej6cWi.js.map → paste-rule-qSz46pqD.js.map} +1 -1
- package/dist/prosekit-extensions-autocomplete.d.ts.map +1 -1
- package/dist/prosekit-extensions-blockquote.d.ts.map +1 -1
- package/dist/prosekit-extensions-blockquote.js +1 -1
- package/dist/prosekit-extensions-bold.d.ts.map +1 -1
- package/dist/prosekit-extensions-bold.js +1 -1
- package/dist/prosekit-extensions-code-block.d.ts +1 -1
- package/dist/prosekit-extensions-code-block.d.ts.map +1 -1
- package/dist/prosekit-extensions-code-block.js +2 -2
- package/dist/prosekit-extensions-code.d.ts.map +1 -1
- package/dist/prosekit-extensions-code.js +1 -1
- package/dist/prosekit-extensions-commit.d.ts.map +1 -1
- package/dist/prosekit-extensions-doc.d.ts.map +1 -1
- package/dist/prosekit-extensions-drop-cursor.d.ts.map +1 -1
- package/dist/prosekit-extensions-drop-indicator.d.ts.map +1 -1
- package/dist/prosekit-extensions-drop-indicator.js +1 -1
- package/dist/prosekit-extensions-enter-rule.d.ts.map +1 -1
- package/dist/prosekit-extensions-enter-rule.js +1 -1
- package/dist/prosekit-extensions-file.d.ts +1 -1
- package/dist/prosekit-extensions-file.js +1 -1
- package/dist/prosekit-extensions-hard-break.d.ts.map +1 -1
- package/dist/prosekit-extensions-heading.d.ts.map +1 -1
- package/dist/prosekit-extensions-heading.js +1 -1
- package/dist/prosekit-extensions-horizontal-rule.d.ts.map +1 -1
- package/dist/prosekit-extensions-horizontal-rule.js +1 -1
- package/dist/prosekit-extensions-image.d.ts +1 -1
- package/dist/prosekit-extensions-image.d.ts.map +1 -1
- package/dist/prosekit-extensions-image.js +1 -1
- package/dist/prosekit-extensions-input-rule.d.ts.map +1 -1
- package/dist/prosekit-extensions-input-rule.js +1 -1
- package/dist/prosekit-extensions-italic.d.ts.map +1 -1
- package/dist/prosekit-extensions-italic.js +1 -1
- package/dist/prosekit-extensions-link.d.ts.map +1 -1
- package/dist/prosekit-extensions-link.js +4 -4
- package/dist/prosekit-extensions-list.d.ts.map +1 -1
- package/dist/prosekit-extensions-list.js +36 -7
- package/dist/prosekit-extensions-list.js.map +1 -1
- package/dist/prosekit-extensions-loro.d.ts.map +1 -1
- package/dist/prosekit-extensions-mark-rule.d.ts.map +1 -1
- package/dist/prosekit-extensions-mark-rule.js +1 -1
- package/dist/prosekit-extensions-mention.d.ts.map +1 -1
- package/dist/prosekit-extensions-paragraph.d.ts.map +1 -1
- package/dist/prosekit-extensions-paste-rule.d.ts.map +1 -1
- package/dist/prosekit-extensions-paste-rule.js +1 -1
- package/dist/prosekit-extensions-placeholder.d.ts.map +1 -1
- package/dist/prosekit-extensions-placeholder.js +2 -2
- package/dist/prosekit-extensions-search.d.ts.map +1 -1
- package/dist/prosekit-extensions-strike.d.ts.map +1 -1
- package/dist/prosekit-extensions-strike.js +1 -1
- package/dist/prosekit-extensions-table.d.ts.map +1 -1
- package/dist/prosekit-extensions-table.js +2 -2
- package/dist/prosekit-extensions-text-align.d.ts.map +1 -1
- package/dist/prosekit-extensions-text.d.ts.map +1 -1
- package/dist/prosekit-extensions-underline.d.ts.map +1 -1
- package/dist/prosekit-extensions-yjs.d.ts.map +1 -1
- package/dist/{shiki-highlighter-chunk-Cwu1Jr9o.d.ts → shiki-highlighter-chunk-DcY3Ud8v.d.ts} +2 -2
- package/dist/shiki-highlighter-chunk-DcY3Ud8v.d.ts.map +1 -0
- package/dist/shiki-highlighter-chunk.d.ts +1 -1
- package/dist/{table-DND_1127.js → table-BLjD91VB.js} +3 -3
- package/dist/{table-DND_1127.js.map → table-BLjD91VB.js.map} +1 -1
- package/package.json +14 -14
- package/src/link/index.spec.ts +1 -1
- package/src/list/list-serializer.ts +57 -3
- package/src/list/list.spec.ts +129 -0
- package/src/testing/keyboard.ts +1 -1
- package/src/testing/markdown.ts +3 -0
- package/dist/index-DY6lIIYV.d.ts.map +0 -1
- package/dist/shiki-highlighter-chunk-Cwu1Jr9o.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-italic.d.ts","names":[],"sources":["../src/italic/italic-commands.ts","../src/italic/italic-spec.ts","../src/italic/italic.ts","../src/italic/italic-input-rule.ts","../src/italic/italic-keymap.ts"],"sourcesContent":[],"mappings":";;;;;;;AASY,KAAA,uBAAA,GAA0B,SAAA,CAAA;EAStB,QAAA,EAAA;;;;ACThB
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-italic.d.ts","names":[],"sources":["../src/italic/italic-commands.ts","../src/italic/italic-spec.ts","../src/italic/italic.ts","../src/italic/italic-input-rule.ts","../src/italic/italic-keymap.ts"],"sourcesContent":[],"mappings":";;;;;;;AASY,KAAA,uBAAA,GAA0B,SAAA,CAAA;EAStB,QAAA,EAAA;;;;ACThB;AASA;;iBDAgB,oBAAA,CAAA,GAAwB;;;;;AATxC;AASgB,KCTJ,mBAAA,GAAsB,SDSM,CAAA;;YCP5B;;AAFZ,CAAA,CAAA;AASA;;;iBAAgB,gBAAA,CAAA,GAAoB;;;;ADTpC;AASA;KECY,eAAA,GAAkB,OAC3B,qBAAqB,wBDXxB,CAAA;AASA;;;iBCQgB,YAAA,CAAA,GAAgB;;;;;;AFjBpB,iBGCI,qBAAA,CAAA,CHDsB,EGCG,cHDM;;;;;;AAAnC,iBIAI,kBAAA,CAAA,CJAsB,EIAA,cJAS"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineMarkInputRule } from "./input-rule-
|
|
1
|
+
import { r as defineMarkInputRule } from "./input-rule-COGr_GBb.js";
|
|
2
2
|
import { canUseRegexLookbehind, defineCommands, defineKeymap, defineMarkSpec, toggleMark, union } from "@prosekit/core";
|
|
3
3
|
|
|
4
4
|
//#region src/italic/italic-commands.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-link.d.ts","names":[],"sources":["../src/link/link-paste-rule.ts","../src/link/link-types.ts","../src/link/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAUA;iBAAgB,mBAAA,CAAA,GAAuB;;;;;;AAAvB,UCPC,SAAA,CDOkB;;;;ACPnC;;;;;AAAA;KC6BY,iBAAA,GAAoB;;UAEtB;EAFE,CAAA;
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-link.d.ts","names":[],"sources":["../src/link/link-paste-rule.ts","../src/link/link-types.ts","../src/link/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAUA;iBAAgB,mBAAA,CAAA,GAAuB;;;;;;AAAvB,UCPC,SAAA,CDOkB;;;;ACPnC;;;;;AAAA;KC6BY,iBAAA,GAAoB;;UAEtB;EAFE,CAAA;AASZ,CAAA,CAAA;AA+BA;;;AAAoC,iBA/BpB,cAAA,CAAA,CA+BoB,EA/BF,iBA+BE;;AASpC;AAcA;AAiBgB,KAxCJ,qBAAA,GAAwB,SAwCG,CAAA;EAmBvB,QAAA,EAAA;IAWJ,OAAA,EAAA,CAAA,KAAa,EApEJ,SAoEI,CAAA;IAAU,UAAA,EAAA,EAAA;IAAmB,UAAA,EAAA,CAAA,KAAA,EAlE9B,SAkE8B,CAAA;IAA1B,UAAA,EAAA,EAAA;EAAK,CAAA;AAKjC,CAAA,CAAA;iBAlEgB,kBAAA,CAAA,GAAsB;;;;;;iBActB,mBAAA,CAAA,GAAuB;;;;;;iBAiBvB,mBAAA,CAAA,GAAuB;;;;;;iBAmBvB,kBAAA,CAAA,GAAsB;;;;KAW1B,aAAA,GAAgB,OAAO,mBAAmB;;;;iBAKtC,UAAA,CAAA,GAAc"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineInputRule } from "./input-rule-
|
|
2
|
-
import { defineEnterRule } from "./enter-rule-
|
|
3
|
-
import { defineMarkRule } from "./mark-rule-
|
|
4
|
-
import { defineMarkPasteRule } from "./paste-rule-
|
|
1
|
+
import { n as defineInputRule } from "./input-rule-COGr_GBb.js";
|
|
2
|
+
import { t as defineEnterRule } from "./enter-rule-D-p4ykfv.js";
|
|
3
|
+
import { t as defineMarkRule } from "./mark-rule-v2E7B4C0.js";
|
|
4
|
+
import { t as defineMarkPasteRule } from "./paste-rule-qSz46pqD.js";
|
|
5
5
|
import { addMark, defineCommands, defineMarkSpec, expandMark, removeMark, toggleMark, union } from "@prosekit/core";
|
|
6
6
|
import { InputRule } from "@prosekit/pm/inputrules";
|
|
7
7
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-list.d.ts","names":[],"sources":["../src/list/list-commands.ts","../src/list/list-types.ts","../src/list/list-spec.ts","../src/list/list.ts","../src/list/list-input-rules.ts","../src/list/list-keymap.ts","../src/list/list-plugins.ts","../src/list/list-serializer.ts"],"sourcesContent":[],"mappings":";;;;;;;AA6BA;
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-list.d.ts","names":[],"sources":["../src/list/list-commands.ts","../src/list/list-types.ts","../src/list/list-spec.ts","../src/list/list.ts","../src/list/list-input-rules.ts","../src/list/list-keymap.ts","../src/list/list-plugins.ts","../src/list/list-serializer.ts"],"sourcesContent":[],"mappings":";;;;;;;AA6BA;AAE2B,KAFf,qBAAA,GAAwB,SAET,CAAA;EACA,QAAA,EAAA;IAGK,UAAA,EAAA,CAAA,OAAA,GAJL,mBAIK,CAAA;IACL,UAAA,EAAA,CAAA,OAAA,GAJA,mBAIA,CAAA;IACF,QAAA,EAAA,CAAA,SAAA,EAAA,IAAA,GAAA,MAAA,CAAA;IACA,SAAA,EAAA,EAAA;IACA,eAAA,EAAA,CAAA,OAAA,GAJO,wBAIP,CAAA;IAVW,UAAA,EAAA,CAAA,OAAA,GAOT,mBAPS,CAAA;IAAS,UAAA,EAAA,CAAA,KAAA,GAQpB,cARoB,CAAA;IAmB7B,UAAA,EAAA,CAAA,KAAkB,GAVT,cAUa,CAAA;yBATb;;;AClCzB;;;;ACcA;AA8BgB,iBFDA,kBAAA,CAAA,CECkB,EFDI,qBECa;;;;;;;AFpBnD;AAE2B,UC1BV,SAAA,CD0BU;EACA;;;EAKF,IAAA,CAAA,EAAA,QAAA,GAAA,SAAA,GAAA,MAAA,GAAA,QAAA;EACA;;;EAToB,KAAA,CAAA,EAAA,MAAA,GAAA,IAAA;EAmB7B;;;;EC3CC;;;;ACcjB;;;;;AFUA;AAE2B,KEZf,iBAAA,GAAoB,SFYL,CAAA;EACA,KAAA,EAAA;IAGK,IAAA,EEdtB,SFcsB;EACL,CAAA;CACF,CAAA;;;;AARoB,iBEoB7B,cAAA,CAAA,CFpB6B,EEoBX,iBFpBW;;;;AAA7C;;AAG2B,KGVf,aAAA,GAAgB,KHUD,CAAA,CGVQ,iBHUR,EGV2B,qBHU3B,CAAA,CAAA;;;;AAMF,iBGXT,UAAA,CAAA,CHWS,EGXK,aHWL;;;;;;AATb,iBIlBI,oBAAA,CAAA,CJkBiB,EIlBO,SJkBP;;;;;;AAAjC;;AAG2B,iBKaX,gBAAA,CAAA,CLbW,EKaS,cLbT;;;;;;AAHf,iBMGI,iBAAA,CAAA,CNHiB,EMGI,cNHJ;;;;;;AAArB,iBOfI,oBAAA,CAAA,CPeiB,EOfO,cPeP"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineInputRule } from "./input-rule-
|
|
2
|
-
import { defineDropIndicator } from "./drop-indicator-
|
|
1
|
+
import { n as defineInputRule } from "./input-rule-COGr_GBb.js";
|
|
2
|
+
import { t as defineDropIndicator } from "./drop-indicator-BMvWUDXz.js";
|
|
3
3
|
import { defineClipboardSerializer, defineCommands, defineKeymap, defineNodeSpec, definePlugin, insertNode, union } from "@prosekit/core";
|
|
4
4
|
import { Plugin } from "@prosekit/pm/state";
|
|
5
5
|
import { chainCommands, deleteSelection } from "@prosekit/pm/commands";
|
|
6
|
-
import { ListDOMSerializer, createDedentListCommand, createIndentListCommand, createListEventPlugin, createListRenderingPlugin, createListSpec, createMoveListCommand, createSafariInputMethodWorkaroundPlugin, createSplitListCommand, createToggleCollapsedCommand, createToggleListCommand, createUnwrapListCommand, createWrapInListCommand, deleteCommand, enterCommand, joinCollapsedListBackward, joinListElements, joinListUp, listInputRules, listToDOM, protectCollapsed, unwrapListSlice } from "prosemirror-flat-list";
|
|
6
|
+
import { ListDOMSerializer, createDedentListCommand, createIndentListCommand, createListEventPlugin, createListRenderingPlugin, createListSpec, createMoveListCommand, createSafariInputMethodWorkaroundPlugin, createSplitListCommand, createToggleCollapsedCommand, createToggleListCommand, createUnwrapListCommand, createWrapInListCommand, deleteCommand, enterCommand, findCheckboxInListItem, joinCollapsedListBackward, joinListElements, joinListUp, listInputRules, listToDOM, protectCollapsed, unwrapListSlice } from "prosemirror-flat-list";
|
|
7
7
|
import { isElementLike } from "@ocavue/utils";
|
|
8
8
|
|
|
9
9
|
//#region src/list/list-commands.ts
|
|
@@ -117,13 +117,13 @@ function defineListSerializer() {
|
|
|
117
117
|
return defineClipboardSerializer({
|
|
118
118
|
serializeFragmentWrapper: (fn) => {
|
|
119
119
|
return (...args) => {
|
|
120
|
-
return joinListElements(fn(...args));
|
|
120
|
+
return normalizeElementTree(joinListElements(fn(...args)));
|
|
121
121
|
};
|
|
122
122
|
},
|
|
123
123
|
serializeNodeWrapper: (fn) => {
|
|
124
124
|
return (...args) => {
|
|
125
125
|
const dom = fn(...args);
|
|
126
|
-
return isElementLike(dom) ? joinListElements(dom) : dom;
|
|
126
|
+
return isElementLike(dom) ? normalizeElementTree(joinListElements(dom)) : dom;
|
|
127
127
|
};
|
|
128
128
|
},
|
|
129
129
|
nodesFromSchemaWrapper: (fn) => {
|
|
@@ -132,14 +132,43 @@ function defineListSerializer() {
|
|
|
132
132
|
...fn(...args),
|
|
133
133
|
list: (node) => listToDOM({
|
|
134
134
|
node,
|
|
135
|
-
nativeList: true
|
|
136
|
-
getMarkers: () => null
|
|
135
|
+
nativeList: true
|
|
137
136
|
})
|
|
138
137
|
};
|
|
139
138
|
};
|
|
140
139
|
}
|
|
141
140
|
});
|
|
142
141
|
}
|
|
142
|
+
function normalizeElementTree(node) {
|
|
143
|
+
if (isElementLike(node)) normalizeTaskList(node);
|
|
144
|
+
for (const child of node.children) normalizeElementTree(child);
|
|
145
|
+
return node;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Modifies the DOM tree for task lists to ensure that the output HTML can be
|
|
149
|
+
* parsed by rehype-remark.
|
|
150
|
+
*/
|
|
151
|
+
function normalizeTaskList(node) {
|
|
152
|
+
if (!node.classList.contains("prosemirror-flat-list") || node.getAttribute("data-list-kind") !== "task" || node.children.length !== 2) return;
|
|
153
|
+
const marker = node.children.item(0);
|
|
154
|
+
if (!marker || !marker.classList.contains("list-marker")) return;
|
|
155
|
+
const checkbox = findCheckboxInListItem(marker);
|
|
156
|
+
if (!checkbox) return;
|
|
157
|
+
const content = node.children.item(1);
|
|
158
|
+
if (!content || !content.classList.contains("list-content")) return;
|
|
159
|
+
const textBlock = content.children.item(0);
|
|
160
|
+
if (!textBlock || ![
|
|
161
|
+
"P",
|
|
162
|
+
"H1",
|
|
163
|
+
"H2",
|
|
164
|
+
"H3",
|
|
165
|
+
"H4",
|
|
166
|
+
"H5",
|
|
167
|
+
"H6"
|
|
168
|
+
].includes(textBlock.tagName)) return;
|
|
169
|
+
node.replaceChildren(...content.children);
|
|
170
|
+
textBlock.prepend(checkbox);
|
|
171
|
+
}
|
|
143
172
|
|
|
144
173
|
//#endregion
|
|
145
174
|
//#region src/list/list-spec.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-list.js","names":["onDrag: DragEventHandler"],"sources":["../src/list/list-commands.ts","../src/list/list-drop-indicator.ts","../src/list/list-input-rules.ts","../src/list/list-keymap.ts","../src/list/list-plugins.ts","../src/list/list-serializer.ts","../src/list/list-spec.ts","../src/list/list.ts"],"sourcesContent":["import {\n defineCommands,\n insertNode,\n type Extension,\n} from '@prosekit/core'\nimport type { Command } from '@prosekit/pm/state'\nimport {\n createDedentListCommand as dedentList,\n createIndentListCommand as indentList,\n createMoveListCommand as moveList,\n createSplitListCommand as splitList,\n createToggleCollapsedCommand as toggleCollapsed,\n createToggleListCommand as toggleList,\n createUnwrapListCommand as unwrapList,\n createWrapInListCommand as wrapInList,\n type DedentListOptions,\n type IndentListOptions,\n type ListAttributes,\n type ToggleCollapsedOptions,\n type UnwrapListOptions,\n} from 'prosemirror-flat-list'\n\nfunction insertList(attrs?: ListAttributes): Command {\n return insertNode({ type: 'list', attrs })\n}\n\n/**\n * @internal\n */\nexport type ListCommandsExtension = Extension<{\n Commands: {\n dedentList: [options?: DedentListOptions]\n indentList: [options?: IndentListOptions]\n moveList: [direction: 'up' | 'down']\n splitList: []\n toggleCollapsed: [options?: ToggleCollapsedOptions]\n unwrapList: [options?: UnwrapListOptions]\n toggleList: [attrs?: ListAttributes]\n wrapInList: [attrs?: ListAttributes]\n insertList: [attrs?: ListAttributes]\n }\n}>\n\n/**\n * Defines list commands.\n *\n * @internal\n */\nexport function defineListCommands(): ListCommandsExtension {\n return defineCommands({\n dedentList,\n indentList,\n moveList,\n splitList,\n toggleCollapsed,\n unwrapList,\n toggleList,\n wrapInList,\n insertList,\n })\n}\n","import type { PlainExtension } from '@prosekit/core'\n\nimport type { DragEventHandler } from '../drop-indicator'\nimport { defineDropIndicator } from '../drop-indicator'\n\n/**\n * Configures drop indicator to avoid unexpected drop point.\n *\n * We don't want to drag a list node and drop it as the first\n * child of another list node.\n *\n * @internal\n */\nexport function defineListDropIndicator(): PlainExtension {\n return defineDropIndicator({\n onDrag,\n })\n}\n\nconst onDrag: DragEventHandler = ({ view, pos }): boolean => {\n const slice = view.dragging?.slice\n if (\n slice\n && slice.openStart === 0\n && slice.openEnd === 0\n && slice.content.childCount === 1\n ) {\n const node = slice.content.child(0)\n if (node.type.name === 'list') {\n const $pos = view.state.doc.resolve(pos)\n if ($pos.parent.type.name === 'list' && $pos.index() === 0) {\n return false\n }\n }\n }\n return true\n}\n","import {\n union,\n type Extension,\n} from '@prosekit/core'\nimport { listInputRules } from 'prosemirror-flat-list'\n\nimport { defineInputRule } from '../input-rule'\n\n/**\n * @internal\n */\nexport function defineListInputRules(): Extension {\n return union(listInputRules.map(defineInputRule))\n}\n","import {\n defineKeymap,\n type PlainExtension,\n} from '@prosekit/core'\nimport {\n chainCommands,\n deleteSelection,\n} from '@prosekit/pm/commands'\nimport {\n createDedentListCommand,\n createIndentListCommand,\n deleteCommand,\n enterCommand,\n joinCollapsedListBackward,\n joinListUp,\n protectCollapsed,\n} from 'prosemirror-flat-list'\n\n// This is different from the one exported by prosemirror-flat-list, because\n// some commands are moved to `defineBaseKeymap` in `prosekit/core`.\nconst backspaceCommand = chainCommands(\n protectCollapsed,\n deleteSelection,\n joinListUp,\n joinCollapsedListBackward,\n)\n\nconst dedentListCommand = createDedentListCommand()\nconst indentListCommand = createIndentListCommand()\n\nconst listKeymap = {\n 'Enter': enterCommand,\n 'Backspace': backspaceCommand,\n 'Delete': deleteCommand,\n 'Mod-]': indentListCommand,\n 'Mod-[': dedentListCommand,\n 'Tab': indentListCommand,\n 'Shift-Tab': dedentListCommand,\n}\n\n/**\n * Returns a extension that adds key bindings for list.\n *\n * @internal\n */\nexport function defineListKeymap(): PlainExtension {\n return defineKeymap(listKeymap)\n}\n","import {\n definePlugin,\n type PlainExtension,\n} from '@prosekit/core'\nimport { Plugin } from '@prosekit/pm/state'\nimport {\n createListEventPlugin,\n createListRenderingPlugin,\n createSafariInputMethodWorkaroundPlugin,\n unwrapListSlice,\n} from 'prosemirror-flat-list'\n\nfunction createListClipboardPlugin(): Plugin {\n return new Plugin({\n props: {\n transformCopied: unwrapListSlice,\n },\n })\n}\n\nfunction createListPlugins(): Plugin[] {\n return [\n createListEventPlugin(),\n createListRenderingPlugin(),\n createListClipboardPlugin(),\n createSafariInputMethodWorkaroundPlugin(),\n ]\n}\n\n/**\n * @internal\n */\nexport function defineListPlugins(): PlainExtension {\n return definePlugin(createListPlugins)\n}\n","import { isElementLike } from '@ocavue/utils'\nimport {\n defineClipboardSerializer,\n type PlainExtension,\n} from '@prosekit/core'\nimport {\n joinListElements,\n listToDOM,\n} from 'prosemirror-flat-list'\n\n/**\n * @internal\n */\nexport function defineListSerializer(): PlainExtension {\n return defineClipboardSerializer({\n serializeFragmentWrapper: (fn) => {\n return (...args) => {\n const dom = fn(...args)\n return joinListElements(dom)\n }\n },\n serializeNodeWrapper: (fn) => {\n return (...args) => {\n const dom = fn(...args)\n return isElementLike(dom) ? joinListElements(dom) : dom\n }\n },\n nodesFromSchemaWrapper: (fn) => {\n return (...args) => {\n const nodes = fn(...args)\n return {\n ...nodes,\n list: (node) => listToDOM({ node, nativeList: true, getMarkers: () => null }),\n }\n }\n },\n })\n}\n","import {\n defineNodeSpec,\n type Extension,\n} from '@prosekit/core'\nimport type {\n DOMOutputSpec,\n ProseMirrorNode,\n} from '@prosekit/pm/model'\nimport {\n createListSpec,\n listToDOM,\n type ListAttributes,\n} from 'prosemirror-flat-list'\n\nimport type { ListAttrs } from './list-types'\n\n/**\n * @internal\n */\nexport type ListSpecExtension = Extension<{\n Nodes: {\n list: ListAttrs\n }\n}>\n\nfunction getMarkers(node: ProseMirrorNode): DOMOutputSpec[] {\n const attrs = node.attrs as ListAttributes\n switch (attrs.kind) {\n case 'task':\n // Use a `label` element here so that the area around the checkbox is also checkable.\n return [\n [\n 'label',\n [\n 'input',\n { type: 'checkbox', checked: attrs.checked ? '' : undefined },\n ],\n ],\n ]\n default:\n // Always return an empty array so that the marker element is rendered. This\n // is required to make the drop indicator locate the correct position.\n return []\n }\n}\n\n/**\n * @internal\n */\nexport function defineListSpec(): ListSpecExtension {\n const spec = createListSpec()\n\n return defineNodeSpec<'list', ListAttrs>({\n ...spec,\n toDOM: (node) => {\n return listToDOM({ node, getMarkers })\n },\n name: 'list',\n })\n}\n","import {\n union,\n type Union,\n} from '@prosekit/core'\n\nimport {\n defineListCommands,\n type ListCommandsExtension,\n} from './list-commands'\nimport { defineListDropIndicator } from './list-drop-indicator'\nimport { defineListInputRules } from './list-input-rules'\nimport { defineListKeymap } from './list-keymap'\nimport { defineListPlugins } from './list-plugins'\nimport { defineListSerializer } from './list-serializer'\nimport {\n defineListSpec,\n type ListSpecExtension,\n} from './list-spec'\n\n/**\n * @internal\n */\nexport type ListExtension = Union<[ListSpecExtension, ListCommandsExtension]>\n\n/**\n * @public\n */\nexport function defineList(): ListExtension {\n return union(\n defineListSpec(),\n defineListPlugins(),\n defineListKeymap(),\n defineListInputRules(),\n defineListCommands(),\n defineListSerializer(),\n defineListDropIndicator(),\n )\n}\n"],"mappings":";;;;;;;;;AAsBA,SAAS,WAAW,OAAiC;AACnD,QAAO,WAAW;EAAE,MAAM;EAAQ;EAAO,CAAC;;;;;;;AAyB5C,SAAgB,qBAA4C;AAC1D,QAAO,eAAe;EACpB;EACA;EACA;EACA;EACA;EACA;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ClB,MAAM,MAAM,GAAG,GAAG,KAAK;AACvB,WAAO,cAAc,IAAI,GAAG,iBAAiB,IAAI,GAAG;;;EAGxD,yBAAyB,OAAO;AAC9B,WAAQ,GAAG,SAAS;AAElB,WAAO;KACL,GAFY,GAAG,GAAG,KAAK;KAGvB,OAAO,SAAS,UAAU;MAAE;MAAM,YAAY;MAAM,kBAAkB;MAAM,CAAC;KAC9E;;;EAGN,CAAC;;;;;ACXJ,SAAS,WAAW,MAAwC;CAC1D,MAAM,QAAQ,KAAK;AACnB,SAAQ,MAAM,MAAd;EACE,KAAK,OAEH,QAAO,CACL,CACE,SACA,CACE,SACA;GAAE,MAAM;GAAY,SAAS,MAAM,UAAU,KAAK;GAAW,CAC9D,CACF,CACF;EACH,QAGE,QAAO,EAAE;;;;;;AAOf,SAAgB,iBAAoC;AAGlD,QAAO,eAAkC;EACvC,GAHW,gBAAgB;EAI3B,QAAQ,SAAS;AACf,UAAO,UAAU;IAAE;IAAM;IAAY,CAAC;;EAExC,MAAM;EACP,CAAC;;;;;;;;AC/BJ,SAAgB,aAA4B;AAC1C,QAAO,MACL,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,yBAAyB,CAC1B"}
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-list.js","names":["onDrag: DragEventHandler"],"sources":["../src/list/list-commands.ts","../src/list/list-drop-indicator.ts","../src/list/list-input-rules.ts","../src/list/list-keymap.ts","../src/list/list-plugins.ts","../src/list/list-serializer.ts","../src/list/list-spec.ts","../src/list/list.ts"],"sourcesContent":["import {\n defineCommands,\n insertNode,\n type Extension,\n} from '@prosekit/core'\nimport type { Command } from '@prosekit/pm/state'\nimport {\n createDedentListCommand as dedentList,\n createIndentListCommand as indentList,\n createMoveListCommand as moveList,\n createSplitListCommand as splitList,\n createToggleCollapsedCommand as toggleCollapsed,\n createToggleListCommand as toggleList,\n createUnwrapListCommand as unwrapList,\n createWrapInListCommand as wrapInList,\n type DedentListOptions,\n type IndentListOptions,\n type ListAttributes,\n type ToggleCollapsedOptions,\n type UnwrapListOptions,\n} from 'prosemirror-flat-list'\n\nfunction insertList(attrs?: ListAttributes): Command {\n return insertNode({ type: 'list', attrs })\n}\n\n/**\n * @internal\n */\nexport type ListCommandsExtension = Extension<{\n Commands: {\n dedentList: [options?: DedentListOptions]\n indentList: [options?: IndentListOptions]\n moveList: [direction: 'up' | 'down']\n splitList: []\n toggleCollapsed: [options?: ToggleCollapsedOptions]\n unwrapList: [options?: UnwrapListOptions]\n toggleList: [attrs?: ListAttributes]\n wrapInList: [attrs?: ListAttributes]\n insertList: [attrs?: ListAttributes]\n }\n}>\n\n/**\n * Defines list commands.\n *\n * @internal\n */\nexport function defineListCommands(): ListCommandsExtension {\n return defineCommands({\n dedentList,\n indentList,\n moveList,\n splitList,\n toggleCollapsed,\n unwrapList,\n toggleList,\n wrapInList,\n insertList,\n })\n}\n","import type { PlainExtension } from '@prosekit/core'\n\nimport type { DragEventHandler } from '../drop-indicator'\nimport { defineDropIndicator } from '../drop-indicator'\n\n/**\n * Configures drop indicator to avoid unexpected drop point.\n *\n * We don't want to drag a list node and drop it as the first\n * child of another list node.\n *\n * @internal\n */\nexport function defineListDropIndicator(): PlainExtension {\n return defineDropIndicator({\n onDrag,\n })\n}\n\nconst onDrag: DragEventHandler = ({ view, pos }): boolean => {\n const slice = view.dragging?.slice\n if (\n slice\n && slice.openStart === 0\n && slice.openEnd === 0\n && slice.content.childCount === 1\n ) {\n const node = slice.content.child(0)\n if (node.type.name === 'list') {\n const $pos = view.state.doc.resolve(pos)\n if ($pos.parent.type.name === 'list' && $pos.index() === 0) {\n return false\n }\n }\n }\n return true\n}\n","import {\n union,\n type Extension,\n} from '@prosekit/core'\nimport { listInputRules } from 'prosemirror-flat-list'\n\nimport { defineInputRule } from '../input-rule'\n\n/**\n * @internal\n */\nexport function defineListInputRules(): Extension {\n return union(listInputRules.map(defineInputRule))\n}\n","import {\n defineKeymap,\n type PlainExtension,\n} from '@prosekit/core'\nimport {\n chainCommands,\n deleteSelection,\n} from '@prosekit/pm/commands'\nimport {\n createDedentListCommand,\n createIndentListCommand,\n deleteCommand,\n enterCommand,\n joinCollapsedListBackward,\n joinListUp,\n protectCollapsed,\n} from 'prosemirror-flat-list'\n\n// This is different from the one exported by prosemirror-flat-list, because\n// some commands are moved to `defineBaseKeymap` in `prosekit/core`.\nconst backspaceCommand = chainCommands(\n protectCollapsed,\n deleteSelection,\n joinListUp,\n joinCollapsedListBackward,\n)\n\nconst dedentListCommand = createDedentListCommand()\nconst indentListCommand = createIndentListCommand()\n\nconst listKeymap = {\n 'Enter': enterCommand,\n 'Backspace': backspaceCommand,\n 'Delete': deleteCommand,\n 'Mod-]': indentListCommand,\n 'Mod-[': dedentListCommand,\n 'Tab': indentListCommand,\n 'Shift-Tab': dedentListCommand,\n}\n\n/**\n * Returns a extension that adds key bindings for list.\n *\n * @internal\n */\nexport function defineListKeymap(): PlainExtension {\n return defineKeymap(listKeymap)\n}\n","import {\n definePlugin,\n type PlainExtension,\n} from '@prosekit/core'\nimport { Plugin } from '@prosekit/pm/state'\nimport {\n createListEventPlugin,\n createListRenderingPlugin,\n createSafariInputMethodWorkaroundPlugin,\n unwrapListSlice,\n} from 'prosemirror-flat-list'\n\nfunction createListClipboardPlugin(): Plugin {\n return new Plugin({\n props: {\n transformCopied: unwrapListSlice,\n },\n })\n}\n\nfunction createListPlugins(): Plugin[] {\n return [\n createListEventPlugin(),\n createListRenderingPlugin(),\n createListClipboardPlugin(),\n createSafariInputMethodWorkaroundPlugin(),\n ]\n}\n\n/**\n * @internal\n */\nexport function defineListPlugins(): PlainExtension {\n return definePlugin(createListPlugins)\n}\n","import { isElementLike } from '@ocavue/utils'\nimport {\n defineClipboardSerializer,\n type PlainExtension,\n} from '@prosekit/core'\nimport {\n findCheckboxInListItem,\n joinListElements,\n listToDOM,\n} from 'prosemirror-flat-list'\n\n/**\n * @internal\n */\nexport function defineListSerializer(): PlainExtension {\n return defineClipboardSerializer({\n serializeFragmentWrapper: (fn) => {\n return (...args) => {\n const dom = fn(...args)\n return normalizeElementTree(joinListElements(dom))\n }\n },\n serializeNodeWrapper: (fn) => {\n return (...args) => {\n const dom = fn(...args)\n return isElementLike(dom)\n ? normalizeElementTree(joinListElements(dom))\n : dom\n }\n },\n nodesFromSchemaWrapper: (fn) => {\n return (...args) => {\n const nodes = fn(...args)\n return {\n ...nodes,\n list: (node) => listToDOM({ node, nativeList: true }),\n }\n }\n },\n })\n}\n\nfunction normalizeElementTree<T extends Element | DocumentFragment>(\n node: T,\n): T {\n if (isElementLike(node)) {\n normalizeTaskList(node)\n }\n\n for (const child of node.children) {\n normalizeElementTree(child)\n }\n\n return node\n}\n\n/**\n * Modifies the DOM tree for task lists to ensure that the output HTML can be\n * parsed by rehype-remark.\n */\nfunction normalizeTaskList(node: Element): void {\n if (\n !node.classList.contains('prosemirror-flat-list')\n || node.getAttribute('data-list-kind') !== 'task'\n || node.children.length !== 2\n ) {\n return\n }\n\n const marker = node.children.item(0)\n if (!marker || !marker.classList.contains('list-marker')) {\n return\n }\n\n const checkbox = findCheckboxInListItem(marker)\n if (!checkbox) {\n return\n }\n\n const content = node.children.item(1)\n if (!content || !content.classList.contains('list-content')) {\n return\n }\n\n const textBlock = content.children.item(0)\n if (!textBlock || !['P', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6'].includes(textBlock.tagName)) {\n return\n }\n\n node.replaceChildren(...content.children)\n textBlock.prepend(checkbox)\n}\n","import {\n defineNodeSpec,\n type Extension,\n} from '@prosekit/core'\nimport type {\n DOMOutputSpec,\n ProseMirrorNode,\n} from '@prosekit/pm/model'\nimport {\n createListSpec,\n listToDOM,\n type ListAttributes,\n} from 'prosemirror-flat-list'\n\nimport type { ListAttrs } from './list-types'\n\n/**\n * @internal\n */\nexport type ListSpecExtension = Extension<{\n Nodes: {\n list: ListAttrs\n }\n}>\n\nfunction getMarkers(node: ProseMirrorNode): DOMOutputSpec[] {\n const attrs = node.attrs as ListAttributes\n switch (attrs.kind) {\n case 'task':\n // Use a `label` element here so that the area around the checkbox is also checkable.\n return [\n [\n 'label',\n [\n 'input',\n { type: 'checkbox', checked: attrs.checked ? '' : undefined },\n ],\n ],\n ]\n default:\n // Always return an empty array so that the marker element is rendered. This\n // is required to make the drop indicator locate the correct position.\n return []\n }\n}\n\n/**\n * @internal\n */\nexport function defineListSpec(): ListSpecExtension {\n const spec = createListSpec()\n\n return defineNodeSpec<'list', ListAttrs>({\n ...spec,\n toDOM: (node) => {\n return listToDOM({ node, getMarkers })\n },\n name: 'list',\n })\n}\n","import {\n union,\n type Union,\n} from '@prosekit/core'\n\nimport {\n defineListCommands,\n type ListCommandsExtension,\n} from './list-commands'\nimport { defineListDropIndicator } from './list-drop-indicator'\nimport { defineListInputRules } from './list-input-rules'\nimport { defineListKeymap } from './list-keymap'\nimport { defineListPlugins } from './list-plugins'\nimport { defineListSerializer } from './list-serializer'\nimport {\n defineListSpec,\n type ListSpecExtension,\n} from './list-spec'\n\n/**\n * @internal\n */\nexport type ListExtension = Union<[ListSpecExtension, ListCommandsExtension]>\n\n/**\n * @public\n */\nexport function defineList(): ListExtension {\n return union(\n defineListSpec(),\n defineListPlugins(),\n defineListKeymap(),\n defineListInputRules(),\n defineListCommands(),\n defineListSerializer(),\n defineListDropIndicator(),\n )\n}\n"],"mappings":";;;;;;;;;AAsBA,SAAS,WAAW,OAAiC;AACnD,QAAO,WAAW;EAAE,MAAM;EAAQ;EAAO,CAAC;;;;;;;AAyB5C,SAAgB,qBAA4C;AAC1D,QAAO,eAAe;EACpB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;;;;;;;;;;;;;AC9CJ,SAAgB,0BAA0C;AACxD,QAAO,oBAAoB,EACzB,QACD,CAAC;;AAGJ,MAAMA,UAA4B,EAAE,MAAM,UAAmB;CAC3D,MAAM,QAAQ,KAAK,UAAU;AAC7B,KACE,SACG,MAAM,cAAc,KACp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AA4B;AAC1C,QAAO,MACL,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,yBAAyB,CAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-loro.d.ts","names":[],"sources":["../src/loro/loro-commands.ts","../src/loro/loro-cursor-plugin.ts","../src/loro/loro.ts","../src/loro/loro-keymap.ts","../src/loro/loro-sync-plugin.ts","../src/loro/loro-undo-plugin.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;KAiBY,qBAAA,GAAwB;;;IAAxB,IAAA,EAAA,EAAA;EAOI,CAAA;;iBAAA,kBAAA,CAAA,GAAsB;;;UCTrB,iBAAA;aACJ;EDCD,YAAA,CAAA,EAAA,CAAA,KAAA,ECAa,WDAQ,
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-loro.d.ts","names":[],"sources":["../src/loro/loro-commands.ts","../src/loro/loro-cursor-plugin.ts","../src/loro/loro.ts","../src/loro/loro-keymap.ts","../src/loro/loro-sync-plugin.ts","../src/loro/loro-undo-plugin.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;KAiBY,qBAAA,GAAwB;;;IAAxB,IAAA,EAAA,EAAA;EAOI,CAAA;;iBAAA,kBAAA,CAAA,GAAsB;;;UCTrB,iBAAA;aACJ;EDCD,YAAA,CAAA,EAAA,CAAA,KAAA,ECAa,WDAQ,EAAA,GCAQ,SDAI;EAO7B,YAAA,CAAA,EAAA,CAAA,IAAA,ECNQ,MDMU,EAAA,GCNC,ODMG;2BCLX,WAAW;;iBAGtB,sBAAA,UACL,oBACR;;;UCEc,WAAA;;;AFTjB;EAOgB,GAAA,EEMT,WFNS;;;;ECTC,SAAA,ECoBJ,eDpBqB;EACrB;;;EAEW,IAAA,CAAA,ECsBf,IDtBe,CCsBV,qBDtBU,EAAA,KAAA,CAAA;EAAW;;;EACkB,IAAA,CAAA,EC0B5C,ID1B4C,CC0BvC,qBD1BuC,EAAA,KAAA,CAAA;EAGrC;;;WC4BL,KAAK;AAxBhB;;;;AAcS,KAgBG,aAAA,GAAgB,KAhBnB,CAAA,CAgB0B,qBAhB1B,EAgBiD,cAhBjD,CAAA,CAAA;;;;AAUE,iBAWK,UAAA,CAXL,OAAA,EAWyB,WAXzB,CAAA,EAWuC,aAXvC;;;iBC9BK,gBAAA,CAAA,GAAoB;;;iBCXpB,oBAAA,UACL,wBACR;;;iBCFa,oBAAA,UAA8B,wBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-mark-rule.d.ts","names":[],"sources":["../src/mark-rule/types.ts","../src/mark-rule/mark-rule.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAUA;;
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-mark-rule.d.ts","names":[],"sources":["../src/mark-rule/types.ts","../src/mark-rule/mark-rule.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAUA;;AAUiB,UAVA,eAAA,CAUA;EAQP;;;;SAbD;;;ACMT;iBDDiB;;;;;;;UAQP,wBAAwB,qBAAqB;;;;;;AAlBvD;;AAUiB,iBCCD,cAAA,CDDC,OAAA,ECCuB,eDDvB,CAAA,ECCyC,cDDzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-mention.d.ts","names":[],"sources":["../src/mention/index.ts"],"sourcesContent":[],"mappings":";;;UASiB,YAAA;;EAAA,KAAA,EAAA,MAAA;EASL,IAAA,EAAA,MAAA
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-mention.d.ts","names":[],"sources":["../src/mention/index.ts"],"sourcesContent":[],"mappings":";;;UASiB,YAAA;;EAAA,KAAA,EAAA,MAAA;EASL,IAAA,EAAA,MAAA;AASZ;AAsCA;AAMA;AAWA;AAAsC,KAhE1B,oBAAA,GAAuB,SAgEG,CAAA;EAAsB,KAAA,EAAA;IAA7B,OAAA,EA9DlB,YA8DkB;EAAK,CAAA;AAKpC,CAAA,CAAA;;;;iBA5DgB,iBAAA,CAAA,GAAqB;;;;KAsCzB,wBAAA,GAA2B;;2BAEZ;;;iBAIX,qBAAA,CAAA,GAAyB;;;;KAW7B,gBAAA,GAAmB,OAAO,sBAAsB;;;;iBAK5C,aAAA,CAAA,GAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-paragraph.d.ts","names":[],"sources":["../src/paragraph/paragraph-commands.ts","../src/paragraph/paragraph-spec.ts","../src/paragraph/paragraph.ts","../src/paragraph/paragraph-keymap.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAUY,KAAA,0BAAA,GAA6B,SAAA,CAAA;EAgBzB,QAAA,EAAA;;;;;
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-paragraph.d.ts","names":[],"sources":["../src/paragraph/paragraph-commands.ts","../src/paragraph/paragraph-spec.ts","../src/paragraph/paragraph.ts","../src/paragraph/paragraph-keymap.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAUY,KAAA,0BAAA,GAA6B,SAAA,CAAA;EAgBzB,QAAA,EAAA;;;;;AENhB;;AAAgE,iBFMhD,uBAAA,CAAA,CENgD,EFMrB,0BENqB;;;;;;AFVpD,KCDA,sBAAA,GAAyB,SDCI,CAAA;EAgBzB,KAAA,EAAA;eCfD;;;AAFf;AAWA;;;;ACAY,iBDAI,mBAAA,CAAA,CCAc,EDAS,sBCAT;;;;;AFV9B;AAgBgB,KENJ,kBAAA,GAAqB,KFMM,CAAA,CENC,sBFMG,EENqB,0BFMK,CAAA,CAAA;;;;ACjBrE;AAWA;;;;ACAY,iBAUI,eAAA,CAAA,CAVc,EAUK,kBAVL;;;;;;iBCVd,qBAAA,CAAA,GAAyB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-paste-rule.d.ts","names":[],"sources":["../src/paste-rule/mark-paste-rule.ts","../src/paste-rule/paste-rule.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAsBA;;
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-paste-rule.d.ts","names":[],"sources":["../src/paste-rule/mark-paste-rule.ts","../src/paste-rule/paste-rule.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAsBA;;AAUiB,UAVA,oBAAA,CAUA;EAQI;;;;EAcL,KAAA,EA3BP,MA2BO;;;;EC3CC,IAAA,EAAA,MAAA,GDqBA,QCrBA;EAwBL;AAOZ;AAeA;;;;EAA8E,QAAA,CAAA,EAAA,CAAA,KAAA,EDjBzD,eCiByD,EAAA,GDjBrC,KCiBqC,GAAA,IAAA,GAAA,SAAA,GAAA,KAAA;;;;;sBDXxD;;;;;;;iBAQN,mBAAA,UAA6B,uBAAuB;;;;;AAhCpE;;;AAkBqB,UC7BJ,uBAAA,CD6BI;EAAoB;;;EAczB,KAAA,ECvCP,KDuCO;;;;EC3CC,IAAA,EAST,UATS;EAwBL;AAOZ;AAeA;;EAA6C,KAAA,EAAA,OAAA;;;;;;;;KAtBjC,gBAAA,aAA6B,4BAA4B;;;;;;UAOpD,gBAAA;;;;WAIN;;;;;;;;;;iBAWK,eAAA;;GAA6B,mBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-placeholder.d.ts","names":[],"sources":["../src/placeholder/index.ts"],"sourcesContent":[],"mappings":";;;;UAmBiB,kBAAA;;AAAjB
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-placeholder.d.ts","names":[],"sources":["../src/placeholder/index.ts"],"sourcesContent":[],"mappings":";;;;UAmBiB,kBAAA;;AAAjB;AA4BA;;iCAvBiC;;;;;;;;;;;;;;;wCAgBO;;;;;;iBAOxB,iBAAA,UAA2B,qBAAqB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./drop-indicator-
|
|
2
|
-
import { findTable } from "./table-
|
|
1
|
+
import "./drop-indicator-BMvWUDXz.js";
|
|
2
|
+
import { p as findTable } from "./table-BLjD91VB.js";
|
|
3
3
|
import { definePlugin, isInCodeBlock, maybeRun } from "@prosekit/core";
|
|
4
4
|
import { Plugin, PluginKey } from "@prosekit/pm/state";
|
|
5
5
|
import { Decoration, DecorationSet } from "@prosekit/pm/view";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-search.d.ts","names":[],"sources":["../src/search/index.ts"],"sourcesContent":[],"mappings":";;;;;;AA0BA;AA+CA
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-search.d.ts","names":[],"sources":["../src/search/index.ts"],"sourcesContent":[],"mappings":";;;;;;AA0BA;AA+CA;AAqCA;AAkBgB,UAtGC,kBAAA,CAsGmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAvDpB,iBAAA,UAA2B,qBAAqB;;;;KAqCpD,uBAAA,GAA0B;;;;;;;;;;;;;;;;;iBAkBtB,oBAAA,CAAA,GAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-strike.d.ts","names":[],"sources":["../src/strike/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkBA;
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-strike.d.ts","names":[],"sources":["../src/strike/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkBA;AASgB,KATJ,mBAAA,GAAsB,SASE,CAAA;EAmBxB,KAAA,EAAA;IASI,MAAA,EAnCJ,KAmCI;EASA,CAAA;AAUhB,CAAA,CAAA;AAYA;;;AAA8B,iBA3Dd,gBAAA,CAAA,CA2Dc,EA3DM,mBA2DN;;AAO9B;;KA/CY,uBAAA,GAA0B;;;;;;;;iBAStB,oBAAA,CAAA,GAAwB;;;;iBASxB,kBAAA,CAAA,GAAsB;;;;iBAUtB,qBAAA,CAAA,GAAyB;;;;KAY7B,eAAA,GAAkB,OAC3B,qBAAqB;;;;iBAMR,YAAA,CAAA,GAAgB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineMarkInputRule } from "./input-rule-
|
|
1
|
+
import { r as defineMarkInputRule } from "./input-rule-COGr_GBb.js";
|
|
2
2
|
import { canUseRegexLookbehind, defineCommands, defineKeymap, defineMarkSpec, toggleMark, union } from "@prosekit/core";
|
|
3
3
|
|
|
4
4
|
//#region src/strike/index.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-table.d.ts","names":[],"sources":["../src/table/table-commands/insert-table.ts","../src/table/table-commands/select-table.ts","../src/table/table-commands/select-table-cell.ts","../src/table/table-commands/select-table-column.ts","../src/table/table-commands/select-table-row.ts","../src/table/table-commands.ts","../src/table/table-spec.ts","../src/table/table.ts","../src/table/table-commands/exit-table.ts","../src/table/table-drop-indicator.ts","../src/table/table-plugins.ts","../src/table/table-utils.ts"],"sourcesContent":[],"mappings":";;;;;;;;;UA8CiB,kBAAA;;AAAjB;AA2BA;
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-table.d.ts","names":[],"sources":["../src/table/table-commands/insert-table.ts","../src/table/table-commands/select-table.ts","../src/table/table-commands/select-table-cell.ts","../src/table/table-commands/select-table-column.ts","../src/table/table-commands/select-table-row.ts","../src/table/table-commands.ts","../src/table/table-spec.ts","../src/table/table.ts","../src/table/table-commands/exit-table.ts","../src/table/table-drop-indicator.ts","../src/table/table-plugins.ts","../src/table/table-utils.ts"],"sourcesContent":[],"mappings":";;;;;;;;;UA8CiB,kBAAA;;AAAjB;AA2BA;;;;AC9DA;EAWgB,GAAA,EAAA,MAAA;;;;ACdhB;AAWA;;;;ACXA;AAiBA;;;;ACjBA;AAiBA;iBJgDgB,WAAA,UAAqB,qBAAqB;;;;;;UC9DzC,kBAAA;;ADmCjB;AA2BA;;;;AC9DA;AAWA;;iBAAgB,WAAA,WAAsB,qBAAqB;;;;;;UCd1C,sBAAA;;AFsCjB;AA2BA;;;;AC9DA;AAWA;;iBCHgB,eAAA,WAA0B,yBAAyB;;;;;;UCXlD,wBAAA;;AHsCjB;AA2BA;;;;AC9DA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CAAA,CAAA;iBAAgB,yBAAA,CAAA,GAA6B;;;;;;ANxD5B,KOrBL,cAAA,GAAiB,KPqBM,CAAA,COnB/B,kBP8CuB,EO7CvB,uBACA,wBACA,8BACA,sBNpB+B,CAWnC,CAAA;;;;ACdiB,iBK8BD,WAAA,CAAA,CL9BuB,EK8BR,cL9BQ;;;;;;;;AFsCvC;AA2BgB,cQ9DH,SR8Dc,EQ9DH,OR8Da;;;;;;;;AA3BrC;AA2BgB,iBS9DA,wBAAA,CAAA,CT8DqB,ES9DO,cT8DqB;;;;;;iBU7DjD,kBAAA,CAAA,GAAsB;;;;;;;AVkCtC;AA2BgB,iBW5DA,eAAA,CX4DqB,KAAA,EAAA,OAAqB,CAAA,EAAA,KAAO,IW5DP,aX4DO"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./drop-indicator-
|
|
2
|
-
import {
|
|
1
|
+
import "./drop-indicator-BMvWUDXz.js";
|
|
2
|
+
import { _ as insertTable, a as defineTableSpec, c as defineTableCommands, d as selectTableCell, f as selectTable, g as moveTableColumn, h as moveTableRow, i as defineTableRowSpec, l as selectTableRow, m as isCellSelection, n as defineTableCellSpec, o as defineTablePlugins, p as findTable, r as defineTableHeaderCellSpec, s as defineTableDropIndicator, t as defineTable, u as selectTableColumn, v as exitTable } from "./table-BLjD91VB.js";
|
|
3
3
|
|
|
4
4
|
export { defineTable, defineTableCellSpec, defineTableCommands, defineTableDropIndicator, defineTableHeaderCellSpec, defineTablePlugins, defineTableRowSpec, defineTableSpec, exitTable, findTable, insertTable, isCellSelection, moveTableColumn, moveTableRow, selectTable, selectTableCell, selectTableColumn, selectTableRow };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-text-align.d.ts","names":[],"sources":["../src/text-align/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AAeA;AAqCY,UArCK,gBAqCkB,CAAA,
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-text-align.d.ts","names":[],"sources":["../src/text-align/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AAeA;AAqCY,UArCK,gBAqCkB,CAAA,iBAClB,MAAA,GAD8C,MAAA,CAAA,CAAA;EAiB/C;;;;;AAahB;AASA;EAWgB,KAAA,EA/EP,QA+EO,EAAA;EAYJ;;;;;EAAmD,OAAA,CAAA,EAAA,MAAA;AAU/D;;;;AAEG,KA1ES,uBA0ET,CAAA,iBAAA,MAAA,CAAA,GA1E4D,SA0E5D,CAAA;EAAkB,KAAA,EAAA,QAzEJ;;;;;;;iBAgBD,YAAA;;;;;;IAMZ;;;;KAOQ,0BAAA,GAA6B;;;;;;;;iBASzB,uBAAA,mBAEb;;;;iBASa,qBAAA,mBAAwC;;;;KAY5C,8CAA8C,OACvD,wBAAwB,WAAW;;;;;;;iBAStB,2DACL,iBAAiB,YACzB,mBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-text.d.ts","names":[],"sources":["../src/text/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AASA;
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-text.d.ts","names":[],"sources":["../src/text/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AASA;AASgB,KATJ,aAAA,GAAgB,SASE,CAAA;;UAPpB;;;;;;iBAOM,UAAA,CAAA,GAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-underline.d.ts","names":[],"sources":["../src/underline/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AAeA;
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-underline.d.ts","names":[],"sources":["../src/underline/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AAeA;AASgB,KATJ,sBAAA,GAAyB,SASE,CAAA;EAkB3B,KAAA,EAAA;IASI,SAAA,EAlCD,KAkCC;EASA,CAAA;AAShB,CAAA,CAAA;;;;AAAsC,iBA7CtB,mBAAA,CAAA,CA6CsB,EA7CC,sBA6CD;AAOtC;;;KAlCY,0BAAA,GAA6B;;;;;;;;iBASzB,uBAAA,CAAA,GAA2B;;;;iBAS3B,qBAAA,CAAA,GAAyB;;;;KAS7B,kBAAA,GAAqB,OAC9B,wBAAwB;;;;iBAMX,eAAA,CAAA,GAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-yjs.d.ts","names":[],"sources":["../src/yjs/yjs-commands.ts","../src/yjs/yjs-cursor-plugin.ts","../src/yjs/yjs-sync-plugin.ts","../src/yjs/yjs-undo-plugin.ts","../src/yjs/yjs.ts","../src/yjs/yjs-keymap.ts"],"sourcesContent":[],"mappings":";;;;;;;;;KAiBY,oBAAA,GAAuB;;IAAvB,IAAA,EAAA,EAAA;IAOI,IAAA,EAAA,EAAA;;;iBAAA,iBAAA,CAAA,GAAqB;;;;;;AAPzB,KCNA,sBAAA,GAAyB,WDMF,CCLjC,UDK0C,CAAA,OCLxB,aDKwB,CAAA,CAAA,CAAA,CAAA,CAAA;AAO5B,UCTC,gBAAA,SAAyB,sBDSe,CAAA;aCR5C;;iBAGG,qBAAA,UACL,mBACR;;;;;;ADJS,KENA,oBAAA,GAAuB,WFMA,CELjC,UFK0C,CAAA,OELxB,WFKwB,CAAA,CAAA,CAAA,CAAA,CAAA;AAO5B,UETC,cAAA,SAAuB,oBFSiB,CAAA;YER7C,CAAA,CAAE;;iBAGE,mBAAA,UAA6B,iBAAiB;;;;;;KC+ClD,oBAAA,GAAuB,YACjC,kBAAkB;AHlDR,UGqDK,cAAA,SAAuB,oBHrDI,CAAA,CAO5C;;;;ACbY,iBEyEI,mBAAA,CFzEkB,OAAA,EEyEW,cFzEX,CAAA,EEyE4B,cFzE5B;;;ADalB,UIIC,UAAA,CJJgB;;;;ECbrB,GAAA,EGqBL,CAAA,CAAE,GHrBG;
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-yjs.d.ts","names":[],"sources":["../src/yjs/yjs-commands.ts","../src/yjs/yjs-cursor-plugin.ts","../src/yjs/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ighter-chunk-Cwu1Jr9o.d.ts → shiki-highlighter-chunk-DcY3Ud8v.d.ts}
RENAMED
|
@@ -15,5 +15,5 @@ type HighlighterResult = {
|
|
|
15
15
|
};
|
|
16
16
|
declare function createOrGetHighlighter(options: HighlighterOptions): HighlighterResult;
|
|
17
17
|
//#endregion
|
|
18
|
-
export {
|
|
19
|
-
//# sourceMappingURL=shiki-highlighter-chunk-
|
|
18
|
+
export { createOrGetHighlighter as i, HighlighterResult as n, ShikiHighlighterOptions as r, HighlighterOptions as t };
|
|
19
|
+
//# sourceMappingURL=shiki-highlighter-chunk-DcY3Ud8v.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shiki-highlighter-chunk-DcY3Ud8v.d.ts","names":[],"sources":["../src/code-block/shiki-highlighter-chunk.ts"],"sourcesContent":[],"mappings":";;;UAeiB,uBAAA,SAAgC,0BAA0B,iBAAiB;AAA3E,UAEA,kBAAA,SAA2B,IAFH,CAEQ,uBAFR,EAAA,OAAA,GAAA,QAAA,CAAA,CAAA;EAAkC,MAAA,EAGjE,YAHiE,EAAA;EAAiB,KAAA,EAAA,CAIlF,eAJkF,GAIhE,eAJgE,CAAA,EAAA;;AAAlB,KAwC9D,iBAAA,GAxC8D;EAEzD,WAAA,EAwCA,WAxCmB;EAAa,OAAA,CAAA,EAAA,SAAA;CACvC,GAAA;EACA,WAAA,CAAA,EAAA,SAAA;EAAkB,OAAA,EA2Cf,OA3Ce,CAAA,IAAA,CAAA;CAFgB;AAAI,iBAgDhC,sBAAA,CAhDgC,OAAA,EAiDrC,kBAjDqC,CAAA,EAkD7C,iBAlD6C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as createOrGetHighlighter, n as HighlighterResult, r as ShikiHighlighterOptions, t as HighlighterOptions } from "./shiki-highlighter-chunk-DcY3Ud8v.js";
|
|
2
2
|
export { HighlighterOptions, HighlighterResult, ShikiHighlighterOptions, createOrGetHighlighter };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineDropIndicator } from "./drop-indicator-
|
|
1
|
+
import { t as defineDropIndicator } from "./drop-indicator-BMvWUDXz.js";
|
|
2
2
|
import { defaultBlockAt, defineCommands, defineNodeSpec, definePlugin, getNodeType, insertNode, union } from "@prosekit/core";
|
|
3
3
|
import { TextSelection } from "@prosekit/pm/state";
|
|
4
4
|
import { CellSelection, TableMap, addColumnAfter, addColumnBefore, addRowAfter, addRowBefore, columnResizing, deleteCellSelection, deleteColumn, deleteRow, deleteTable, findCellPos, findCellRange, findTable, mergeCells, moveTableColumn, moveTableRow, splitCell, tableEditing, tableNodes } from "prosemirror-tables";
|
|
@@ -284,5 +284,5 @@ function defineTable() {
|
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
//#endregion
|
|
287
|
-
export {
|
|
288
|
-
//# sourceMappingURL=table-
|
|
287
|
+
export { insertTable as _, defineTableSpec as a, defineTableCommands as c, selectTableCell as d, selectTable as f, moveTableColumn as g, moveTableRow as h, defineTableRowSpec as i, selectTableRow as l, isCellSelection as m, defineTableCellSpec as n, defineTablePlugins as o, findTable as p, defineTableHeaderCellSpec as r, defineTableDropIndicator as s, defineTable as t, selectTableColumn as u, exitTable as v };
|
|
288
|
+
//# sourceMappingURL=table-BLjD91VB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-DND_1127.js","names":["exitTable: Command","onDrag: DragEventHandler","match: boolean"],"sources":["../src/table/table-commands/exit-table.ts","../src/table/table-commands/insert-table.ts","../src/table/table-utils.ts","../src/table/table-commands/select-table.ts","../src/table/table-commands/select-table-cell.ts","../src/table/table-commands/select-table-column.ts","../src/table/table-commands/select-table-row.ts","../src/table/table-commands.ts","../src/table/table-drop-indicator.ts","../src/table/table-plugins.ts","../src/table/table-spec.ts","../src/table/table.ts"],"sourcesContent":["import { defaultBlockAt } from '@prosekit/core'\nimport { TextSelection } from '@prosekit/pm/state'\nimport type { Command } from '@prosekit/pm/state'\nimport type { TableRole } from 'prosemirror-tables'\n\n/**\n * When the selection is in a table node, create a default block after the table\n * table, and move the cursor there.\n *\n * @public\n */\nexport const exitTable: Command = (state, dispatch) => {\n const { $head, $anchor } = state.selection\n\n if (!$head.sameParent($anchor)) {\n return false\n }\n\n let tableStart = -1\n let tableDepth = -1\n for (let depth = $head.depth; depth >= 0; depth--) {\n const node = $head.node(depth)\n if ((node.type.spec.tableRole as TableRole) === 'table') {\n tableStart = $head.before(depth)\n tableDepth = depth\n }\n }\n\n if (tableStart < 0 || tableDepth <= 0) {\n return false\n }\n\n const above = $head.node(tableDepth - 1)\n const after = $head.indexAfter(tableDepth - 1)\n const type = defaultBlockAt(above.contentMatchAt(after))\n const node = type?.createAndFill()\n\n if (!type || !node || !above.canReplaceWith(after, after, type)) {\n return false\n }\n\n if (dispatch) {\n const pos = $head.after(tableDepth)\n const tr = state.tr.replaceWith(pos, pos, node)\n tr.setSelection(TextSelection.near(tr.doc.resolve(pos), 1))\n dispatch(tr.scrollIntoView())\n }\n return true\n}\n","import {\n getNodeType,\n insertNode,\n} from '@prosekit/core'\nimport type { Schema } from '@prosekit/pm/model'\nimport type { Command } from '@prosekit/pm/state'\n\nfunction createEmptyTable(\n schema: Schema,\n row: number,\n col: number,\n header: boolean,\n) {\n const tableType = getNodeType(schema, 'table')\n const tableRowType = getNodeType(schema, 'tableRow')\n const tableCellType = getNodeType(schema, 'tableCell')\n const tableHeaderCellType = getNodeType(schema, 'tableHeaderCell')\n\n if (header) {\n const headerCell = tableHeaderCellType.createAndFill()!\n const headerCells = repeat(headerCell, col)\n const headerRow = tableRowType.createAndFill(null, headerCells)!\n\n const bodyCell = tableCellType.createAndFill()!\n const bodyCells = repeat(bodyCell, col)\n const bodyRow = tableRowType.createAndFill(null, bodyCells)!\n const bodyRows = repeat(bodyRow, row - 1)\n\n return tableType.createAndFill(null, [headerRow, ...bodyRows])!\n } else {\n const bodyCell = tableCellType.createAndFill()!\n const bodyCells = repeat(bodyCell, col)\n const bodyRow = tableRowType.createAndFill(null, bodyCells)!\n const bodyRows = repeat(bodyRow, row)\n\n return tableType.createAndFill(null, bodyRows)!\n }\n}\n\nfunction repeat<T>(node: T, length: number): T[] {\n return Array<T>(length).fill(node)\n}\n\n/**\n * @public\n */\nexport interface InsertTableOptions {\n /**\n * The number of rows in the table.\n */\n row: number\n\n /**\n * The number of columns in the table.\n */\n col: number\n\n /**\n * Whether the table has a header row.\n *\n * @default false\n */\n header?: boolean\n}\n\n/**\n * Insert a table node with the given number of rows and columns, and optionally\n * a header row.\n *\n * @param options\n *\n * @public\n */\nexport function insertTable(options: InsertTableOptions): Command {\n return (state, dispatch, view) => {\n const { row, col, header = false } = options\n const table = createEmptyTable(state.schema, row, col, header)\n return insertNode({ node: table })(state, dispatch, view)\n }\n}\n","import { CellSelection } from 'prosemirror-tables'\n\nexport {\n findCellPos,\n findCellRange,\n findTable,\n} from 'prosemirror-tables'\n\n/**\n * Checks if the given object is a `CellSelection` instance.\n *\n * @public\n */\nexport function isCellSelection(value: unknown): value is CellSelection {\n return value instanceof CellSelection\n}\n","import type { Command } from '@prosekit/pm/state'\nimport {\n CellSelection,\n TableMap,\n} from 'prosemirror-tables'\n\nimport { findTable } from '../table-utils'\n\n/**\n * @public\n */\nexport interface SelectTableOptions {\n /**\n * A hit position of the table to select from. By default, the selection\n * anchor will be used.\n */\n pos?: number\n}\n\n/**\n * @public\n */\nexport function selectTable(options?: SelectTableOptions): Command {\n return (state, dispatch) => {\n const $pos = options?.pos\n ? state.doc.resolve(options.pos)\n : state.selection.$anchor\n const table = findTable($pos)\n if (!table) {\n return false\n }\n const map = TableMap.get(table.node)\n if (map.map.length === 0) {\n return false\n }\n if (dispatch) {\n let tr = state.tr\n const firstCellPosInTable = map.map[0]\n const lastCellPosInTable = map.map[map.map.length - 1]\n const firstCellPos = table.pos + firstCellPosInTable + 1\n const lastCellPos = table.pos + lastCellPosInTable + 1\n const $firstCellPos = tr.doc.resolve(firstCellPos)\n const $lastCellPos = tr.doc.resolve(lastCellPos)\n const selection = new CellSelection($firstCellPos, $lastCellPos)\n tr = tr.setSelection(selection)\n dispatch?.(tr)\n }\n return true\n }\n}\n","import type { Command } from '@prosekit/pm/state'\nimport { CellSelection } from 'prosemirror-tables'\n\nimport { findCellPos } from '../table-utils'\n\n/**\n * @public\n */\nexport interface SelectTableCellOptions {\n /**\n * A hit position of the table cell to select from. By default, the selection\n * anchor will be used.\n */\n pos?: number\n}\n\n/**\n * @public\n */\nexport function selectTableCell(options?: SelectTableCellOptions): Command {\n return (state, dispatch) => {\n const $cellPos = findCellPos(\n state.doc,\n options?.pos ?? state.selection.anchor,\n )\n if (!$cellPos) {\n return false\n }\n if (dispatch) {\n const selection = new CellSelection($cellPos)\n dispatch(state.tr.setSelection(selection))\n }\n return true\n }\n}\n","import type { Command } from '@prosekit/pm/state'\nimport { CellSelection } from 'prosemirror-tables'\n\nimport { findCellRange } from '../table-utils'\n\n/**\n * @public\n */\nexport interface SelectTableColumnOptions {\n /**\n * A hit position of the table cell to select from. By default, the selection\n * anchor will be used.\n */\n anchor?: number\n\n /**\n * A hit position of the table cell to select to. By default, the selection\n * head will be used.\n */\n head?: number\n}\n\n/**\n * @public\n */\nexport function selectTableColumn(options?: SelectTableColumnOptions): Command {\n return (state, dispatch) => {\n const range = findCellRange(state.selection, options?.anchor, options?.head)\n if (!range) {\n return false\n }\n if (dispatch) {\n const [$anchorCell, $headCell] = range\n const selection = CellSelection.colSelection($anchorCell, $headCell)\n dispatch(state.tr.setSelection(selection))\n }\n return true\n }\n}\n","import type { Command } from '@prosekit/pm/state'\nimport { CellSelection } from 'prosemirror-tables'\n\nimport { findCellRange } from '../table-utils'\n\n/**\n * @public\n */\nexport interface SelectTableRowOptions {\n /**\n * A hit position of the table cell to select from. By default, the selection\n * anchor will be used.\n */\n anchor?: number\n\n /**\n * A hit position of the table cell to select to. By default, the selection\n * head will be used.\n */\n head?: number\n}\n\n/**\n * @public\n */\nexport function selectTableRow(options?: SelectTableRowOptions): Command {\n return (state, dispatch) => {\n const range = findCellRange(state.selection, options?.anchor, options?.head)\n if (!range) {\n return false\n }\n if (dispatch) {\n const [$anchorCell, $headCell] = range\n const selection = CellSelection.rowSelection($anchorCell, $headCell)\n dispatch(state.tr.setSelection(selection))\n }\n return true\n }\n}\n","import {\n defineCommands,\n type Extension,\n} from '@prosekit/core'\nimport {\n addColumnAfter,\n addColumnBefore,\n addRowAfter,\n addRowBefore,\n deleteColumn,\n deleteRow,\n deleteTable,\n mergeCells,\n splitCell,\n} from 'prosemirror-tables'\n\nimport { deleteCellSelection } from './table-commands/delete-cell-selection'\nimport { exitTable } from './table-commands/exit-table'\nimport {\n insertTable,\n type InsertTableOptions,\n} from './table-commands/insert-table'\nimport {\n moveTableColumn,\n type MoveTableColumnOptions,\n} from './table-commands/move-table-column'\nimport {\n moveTableRow,\n type MoveTableRowOptions,\n} from './table-commands/move-table-row'\nimport {\n selectTable,\n type SelectTableOptions,\n} from './table-commands/select-table'\nimport {\n selectTableCell,\n type SelectTableCellOptions,\n} from './table-commands/select-table-cell'\nimport {\n selectTableColumn,\n type SelectTableColumnOptions,\n} from './table-commands/select-table-column'\nimport {\n selectTableRow,\n type SelectTableRowOptions,\n} from './table-commands/select-table-row'\n\n/**\n * @internal\n */\nexport type TableCommandsExtension = Extension<{\n Commands: {\n insertTable: [options: InsertTableOptions]\n exitTable: []\n\n selectTable: [options?: SelectTableOptions]\n selectTableCell: [options?: SelectTableCellOptions]\n selectTableColumn: [options?: SelectTableColumnOptions]\n selectTableRow: [options?: SelectTableRowOptions]\n\n addTableColumnBefore: []\n addTableColumnAfter: []\n addTableRowAbove: []\n addTableRowBelow: []\n\n deleteTable: []\n deleteTableColumn: []\n deleteTableRow: []\n deleteCellSelection: []\n\n mergeTableCells: []\n splitTableCell: []\n\n moveTableRow: [options: MoveTableRowOptions]\n moveTableColumn: [options: MoveTableColumnOptions]\n }\n}>\n\n/**\n * Adds commands for working with `table` nodes.\n *\n * @public\n */\nexport function defineTableCommands(): TableCommandsExtension {\n return defineCommands({\n insertTable,\n exitTable: () => exitTable,\n\n selectTable,\n selectTableCell,\n selectTableColumn,\n selectTableRow,\n\n addTableColumnBefore: () => addColumnBefore,\n addTableColumnAfter: () => addColumnAfter,\n addTableRowAbove: () => addRowBefore,\n addTableRowBelow: () => addRowAfter,\n\n deleteTable: () => deleteTable,\n deleteTableColumn: () => deleteColumn,\n deleteTableRow: () => deleteRow,\n deleteCellSelection: () => deleteCellSelection,\n\n mergeTableCells: () => mergeCells,\n splitTableCell: () => splitCell,\n\n moveTableRow,\n moveTableColumn,\n })\n}\n","import type { PlainExtension } from '@prosekit/core'\n\nimport type { DragEventHandler } from '../drop-indicator'\nimport { defineDropIndicator } from '../drop-indicator'\n\n/**\n * Hides the drop indicator when dragging a table column or row by using the\n * table handle.\n *\n * @internal\n */\nexport function defineTableDropIndicator(): PlainExtension {\n return defineDropIndicator({\n onDrag,\n })\n}\n\nconst matchMap = new WeakMap<DataTransfer, boolean>()\n\nconst onDrag: DragEventHandler = ({ event }): boolean => {\n const dataTransfer = event.dataTransfer\n if (!dataTransfer) return true\n\n let match: boolean\n\n if (matchMap.has(dataTransfer)) {\n match = matchMap.get(dataTransfer)!\n } else {\n // On Safari, accessing `dataTransfer.types` is more than 10x slower than in\n // Chrome. This becomes a bottleneck when `onDrag` is called frequently, so\n // we cache the result in a WeakMap.\n const types = dataTransfer.types\n match = types.includes('application/x-prosekit-table-handle-drag')\n matchMap.set(dataTransfer, match)\n }\n\n // Don't show the drop indicator when the drag event has\n // \"application/x-prosekit-table-handle-drag\" type.\n return !match\n}\n","import {\n definePlugin,\n type PlainExtension,\n} from '@prosekit/core'\nimport {\n columnResizing,\n tableEditing,\n} from 'prosemirror-tables'\n\n/**\n * @public\n */\nexport function defineTablePlugins(): PlainExtension {\n return definePlugin([tableEditing(), columnResizing()])\n}\n","import {\n defineNodeSpec,\n type Extension,\n} from '@prosekit/core'\nimport type {\n AttributeSpec,\n Attrs,\n} from '@prosekit/pm/model'\nimport { tableNodes } from 'prosemirror-tables'\n\nconst cellContent = 'block+'\n\n/**\n * @public\n */\nexport interface CellAttrs {\n colspan?: number\n rowspan?: number\n colwidth?: number[] | null\n}\n\nconst cellAttrs = {\n colspan: { default: 1 },\n rowspan: { default: 1 },\n colwidth: { default: null },\n} satisfies Record<string, AttributeSpec>\n\n/**\n * @internal\n */\nexport type TableSpecExtension = Extension<{\n Nodes: {\n table: Attrs\n }\n}>\n\nconst specs = tableNodes({\n tableGroup: 'block',\n cellContent,\n cellAttributes: {},\n})\n\n/**\n * @internal\n */\nexport function defineTableSpec(): TableSpecExtension {\n return defineNodeSpec({\n ...specs['table'],\n content: 'tableRow+',\n name: 'table',\n })\n}\n\n/**\n * @internal\n */\nexport type TableRowSpecExtension = Extension<{\n Nodes: {\n tableRow: Attrs\n }\n}>\n\n/**\n * @internal\n */\nexport function defineTableRowSpec(): TableRowSpecExtension {\n return defineNodeSpec({\n ...specs['table_row'],\n content: '(tableCell | tableHeaderCell)*',\n name: 'tableRow',\n })\n}\n\n/**\n * @internal\n */\nexport type TableCellSpecExtension = Extension<{\n Nodes: {\n tableCell: CellAttrs\n }\n}>\n\n/**\n * @internal\n */\nexport function defineTableCellSpec(): TableCellSpecExtension {\n return defineNodeSpec({\n ...specs['table_cell'],\n name: 'tableCell',\n attrs: cellAttrs,\n })\n}\n\n/**\n * @internal\n */\nexport type TableHeaderCellSpecExtension = Extension<{\n Nodes: {\n tableHeaderCell: CellAttrs\n }\n}>\n\nexport function defineTableHeaderCellSpec(): TableHeaderCellSpecExtension {\n return defineNodeSpec({\n ...specs['table_header'],\n name: 'tableHeaderCell',\n attrs: cellAttrs,\n })\n}\n","import {\n union,\n type Union,\n} from '@prosekit/core'\n\nimport {\n defineTableCommands,\n type TableCommandsExtension,\n} from './table-commands'\nimport { defineTableDropIndicator } from './table-drop-indicator'\nimport { defineTablePlugins } from './table-plugins'\nimport {\n defineTableCellSpec,\n defineTableHeaderCellSpec,\n defineTableRowSpec,\n defineTableSpec,\n type TableCellSpecExtension,\n type TableHeaderCellSpecExtension,\n type TableRowSpecExtension,\n type TableSpecExtension,\n} from './table-spec'\n\n/**\n * @internal\n */\nexport type TableExtension = Union<\n [\n TableSpecExtension,\n TableRowSpecExtension,\n TableCellSpecExtension,\n TableHeaderCellSpecExtension,\n TableCommandsExtension,\n ]\n>\n\n/**\n * @public\n */\nexport function defineTable(): TableExtension {\n return union(\n defineTableSpec(),\n defineTableRowSpec(),\n defineTableCellSpec(),\n defineTableHeaderCellSpec(),\n defineTablePlugins(),\n defineTableCommands(),\n defineTableDropIndicator(),\n )\n}\n"],"mappings":";;;;;;;;;;;;AAWA,MAAaA,aAAsB,OAAO,aAAa;CACrD,MAAM,EAAE,OAAO,YAAY,MAAM;AAEjC,KAAI,CAAC,MAAM,WAAW,QAAQ,CAC5B,QAAO;CAGT,IAAI,aAAa;CACjB,IAAI,aAAa;AACjB,MAAK,IAAI,QAAQ,MAAM,OAAO,SAAS,GAAG,QAExC,KADa,MAAM,KAAK,MAAM,CACpB,KAAK,KAAK,cAA4B,SAAS;AACvD,eAAa,MAAM,OAAO,MAAM;AAChC,eAAa;;AAIjB,KAAI,aAAa,KAAK,cAAc,EAClC,QAAO;CAGT,MAAM,QAAQ,MAAM,KAAK,aAAa,EAAE;CACxC,MAAM,QAAQ,MAAM,WAAW,aAAa,EAAE;CAC9C,MAAM,OAAO,eAAe,MAAM,eAAe,MAAM,CAAC;CACxD,MAAM,OAAO,MAAM,eAAe;AAElC,KAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,eAAe,OAAO,OAAO,KAAK,CAC7D,QAAO;AAGT,KAAI,UAAU;EACZ,MAAM,MAAM,MAAM,MAAM,WAAW;EACnC,MAAM,KAAK,MAAM,GAAG,YAAY,KAAK,KAAK,KAAK;AAC/C,KAAG,aAAa,cAAc,KAAK,GAAG,IAAI,QAAQ,IAAI,EAAE,EAAE,CAAC;AAC3D,WAAS,GAAG,gBAAgB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;EACpB,GAAG,MAAM;EACT,MAAM;EACN,OAAO;EACR,CAAC;;AAYJ,SAAgB,4BAA0D;AACxE,QAAO,eAAe;EACpB,GAAG,MAAM;EACT,MAAM;EACN,OAAO;EACR,CAAC;;;;;;;;ACrEJ,SAAgB,cAA8B;AAC5C,QAAO,MACL,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,CAC3B"}
|
|
1
|
+
{"version":3,"file":"table-BLjD91VB.js","names":["exitTable: Command","onDrag: DragEventHandler","match: boolean"],"sources":["../src/table/table-commands/exit-table.ts","../src/table/table-commands/insert-table.ts","../src/table/table-utils.ts","../src/table/table-commands/select-table.ts","../src/table/table-commands/select-table-cell.ts","../src/table/table-commands/select-table-column.ts","../src/table/table-commands/select-table-row.ts","../src/table/table-commands.ts","../src/table/table-drop-indicator.ts","../src/table/table-plugins.ts","../src/table/table-spec.ts","../src/table/table.ts"],"sourcesContent":["import { defaultBlockAt } from '@prosekit/core'\nimport { TextSelection } from '@prosekit/pm/state'\nimport type { Command } from '@prosekit/pm/state'\nimport type { TableRole } from 'prosemirror-tables'\n\n/**\n * When the selection is in a table node, create a default block after the table\n * table, and move the cursor there.\n *\n * @public\n */\nexport const exitTable: Command = (state, dispatch) => {\n const { $head, $anchor } = state.selection\n\n if (!$head.sameParent($anchor)) {\n return false\n }\n\n let tableStart = -1\n let tableDepth = -1\n for (let depth = $head.depth; depth >= 0; depth--) {\n const node = $head.node(depth)\n if ((node.type.spec.tableRole as TableRole) === 'table') {\n tableStart = $head.before(depth)\n tableDepth = depth\n }\n }\n\n if (tableStart < 0 || tableDepth <= 0) {\n return false\n }\n\n const above = $head.node(tableDepth - 1)\n const after = $head.indexAfter(tableDepth - 1)\n const type = defaultBlockAt(above.contentMatchAt(after))\n const node = type?.createAndFill()\n\n if (!type || !node || !above.canReplaceWith(after, after, type)) {\n return false\n }\n\n if (dispatch) {\n const pos = $head.after(tableDepth)\n const tr = state.tr.replaceWith(pos, pos, node)\n tr.setSelection(TextSelection.near(tr.doc.resolve(pos), 1))\n dispatch(tr.scrollIntoView())\n }\n return true\n}\n","import {\n getNodeType,\n insertNode,\n} from '@prosekit/core'\nimport type { Schema } from '@prosekit/pm/model'\nimport type { Command } from '@prosekit/pm/state'\n\nfunction createEmptyTable(\n schema: Schema,\n row: number,\n col: number,\n header: boolean,\n) {\n const tableType = getNodeType(schema, 'table')\n const tableRowType = getNodeType(schema, 'tableRow')\n const tableCellType = getNodeType(schema, 'tableCell')\n const tableHeaderCellType = getNodeType(schema, 'tableHeaderCell')\n\n if (header) {\n const headerCell = tableHeaderCellType.createAndFill()!\n const headerCells = repeat(headerCell, col)\n const headerRow = tableRowType.createAndFill(null, headerCells)!\n\n const bodyCell = tableCellType.createAndFill()!\n const bodyCells = repeat(bodyCell, col)\n const bodyRow = tableRowType.createAndFill(null, bodyCells)!\n const bodyRows = repeat(bodyRow, row - 1)\n\n return tableType.createAndFill(null, [headerRow, ...bodyRows])!\n } else {\n const bodyCell = tableCellType.createAndFill()!\n const bodyCells = repeat(bodyCell, col)\n const bodyRow = tableRowType.createAndFill(null, bodyCells)!\n const bodyRows = repeat(bodyRow, row)\n\n return tableType.createAndFill(null, bodyRows)!\n }\n}\n\nfunction repeat<T>(node: T, length: number): T[] {\n return Array<T>(length).fill(node)\n}\n\n/**\n * @public\n */\nexport interface InsertTableOptions {\n /**\n * The number of rows in the table.\n */\n row: number\n\n /**\n * The number of columns in the table.\n */\n col: number\n\n /**\n * Whether the table has a header row.\n *\n * @default false\n */\n header?: boolean\n}\n\n/**\n * Insert a table node with the given number of rows and columns, and optionally\n * a header row.\n *\n * @param options\n *\n * @public\n */\nexport function insertTable(options: InsertTableOptions): Command {\n return (state, dispatch, view) => {\n const { row, col, header = false } = options\n const table = createEmptyTable(state.schema, row, col, header)\n return insertNode({ node: table })(state, dispatch, view)\n }\n}\n","import { CellSelection } from 'prosemirror-tables'\n\nexport {\n findCellPos,\n findCellRange,\n findTable,\n} from 'prosemirror-tables'\n\n/**\n * Checks if the given object is a `CellSelection` instance.\n *\n * @public\n */\nexport function isCellSelection(value: unknown): value is CellSelection {\n return value instanceof CellSelection\n}\n","import type { Command } from '@prosekit/pm/state'\nimport {\n CellSelection,\n TableMap,\n} from 'prosemirror-tables'\n\nimport { findTable } from '../table-utils'\n\n/**\n * @public\n */\nexport interface SelectTableOptions {\n /**\n * A hit position of the table to select from. By default, the selection\n * anchor will be used.\n */\n pos?: number\n}\n\n/**\n * @public\n */\nexport function selectTable(options?: SelectTableOptions): Command {\n return (state, dispatch) => {\n const $pos = options?.pos\n ? state.doc.resolve(options.pos)\n : state.selection.$anchor\n const table = findTable($pos)\n if (!table) {\n return false\n }\n const map = TableMap.get(table.node)\n if (map.map.length === 0) {\n return false\n }\n if (dispatch) {\n let tr = state.tr\n const firstCellPosInTable = map.map[0]\n const lastCellPosInTable = map.map[map.map.length - 1]\n const firstCellPos = table.pos + firstCellPosInTable + 1\n const lastCellPos = table.pos + lastCellPosInTable + 1\n const $firstCellPos = tr.doc.resolve(firstCellPos)\n const $lastCellPos = tr.doc.resolve(lastCellPos)\n const selection = new CellSelection($firstCellPos, $lastCellPos)\n tr = tr.setSelection(selection)\n dispatch?.(tr)\n }\n return true\n }\n}\n","import type { Command } from '@prosekit/pm/state'\nimport { CellSelection } from 'prosemirror-tables'\n\nimport { findCellPos } from '../table-utils'\n\n/**\n * @public\n */\nexport interface SelectTableCellOptions {\n /**\n * A hit position of the table cell to select from. By default, the selection\n * anchor will be used.\n */\n pos?: number\n}\n\n/**\n * @public\n */\nexport function selectTableCell(options?: SelectTableCellOptions): Command {\n return (state, dispatch) => {\n const $cellPos = findCellPos(\n state.doc,\n options?.pos ?? state.selection.anchor,\n )\n if (!$cellPos) {\n return false\n }\n if (dispatch) {\n const selection = new CellSelection($cellPos)\n dispatch(state.tr.setSelection(selection))\n }\n return true\n }\n}\n","import type { Command } from '@prosekit/pm/state'\nimport { CellSelection } from 'prosemirror-tables'\n\nimport { findCellRange } from '../table-utils'\n\n/**\n * @public\n */\nexport interface SelectTableColumnOptions {\n /**\n * A hit position of the table cell to select from. By default, the selection\n * anchor will be used.\n */\n anchor?: number\n\n /**\n * A hit position of the table cell to select to. By default, the selection\n * head will be used.\n */\n head?: number\n}\n\n/**\n * @public\n */\nexport function selectTableColumn(options?: SelectTableColumnOptions): Command {\n return (state, dispatch) => {\n const range = findCellRange(state.selection, options?.anchor, options?.head)\n if (!range) {\n return false\n }\n if (dispatch) {\n const [$anchorCell, $headCell] = range\n const selection = CellSelection.colSelection($anchorCell, $headCell)\n dispatch(state.tr.setSelection(selection))\n }\n return true\n }\n}\n","import type { Command } from '@prosekit/pm/state'\nimport { CellSelection } from 'prosemirror-tables'\n\nimport { findCellRange } from '../table-utils'\n\n/**\n * @public\n */\nexport interface SelectTableRowOptions {\n /**\n * A hit position of the table cell to select from. By default, the selection\n * anchor will be used.\n */\n anchor?: number\n\n /**\n * A hit position of the table cell to select to. By default, the selection\n * head will be used.\n */\n head?: number\n}\n\n/**\n * @public\n */\nexport function selectTableRow(options?: SelectTableRowOptions): Command {\n return (state, dispatch) => {\n const range = findCellRange(state.selection, options?.anchor, options?.head)\n if (!range) {\n return false\n }\n if (dispatch) {\n const [$anchorCell, $headCell] = range\n const selection = CellSelection.rowSelection($anchorCell, $headCell)\n dispatch(state.tr.setSelection(selection))\n }\n return true\n }\n}\n","import {\n defineCommands,\n type Extension,\n} from '@prosekit/core'\nimport {\n addColumnAfter,\n addColumnBefore,\n addRowAfter,\n addRowBefore,\n deleteColumn,\n deleteRow,\n deleteTable,\n mergeCells,\n splitCell,\n} from 'prosemirror-tables'\n\nimport { deleteCellSelection } from './table-commands/delete-cell-selection'\nimport { exitTable } from './table-commands/exit-table'\nimport {\n insertTable,\n type InsertTableOptions,\n} from './table-commands/insert-table'\nimport {\n moveTableColumn,\n type MoveTableColumnOptions,\n} from './table-commands/move-table-column'\nimport {\n moveTableRow,\n type MoveTableRowOptions,\n} from './table-commands/move-table-row'\nimport {\n selectTable,\n type SelectTableOptions,\n} from './table-commands/select-table'\nimport {\n selectTableCell,\n type SelectTableCellOptions,\n} from './table-commands/select-table-cell'\nimport {\n selectTableColumn,\n type SelectTableColumnOptions,\n} from './table-commands/select-table-column'\nimport {\n selectTableRow,\n type SelectTableRowOptions,\n} from './table-commands/select-table-row'\n\n/**\n * @internal\n */\nexport type TableCommandsExtension = Extension<{\n Commands: {\n insertTable: [options: InsertTableOptions]\n exitTable: []\n\n selectTable: [options?: SelectTableOptions]\n selectTableCell: [options?: SelectTableCellOptions]\n selectTableColumn: [options?: SelectTableColumnOptions]\n selectTableRow: [options?: SelectTableRowOptions]\n\n addTableColumnBefore: []\n addTableColumnAfter: []\n addTableRowAbove: []\n addTableRowBelow: []\n\n deleteTable: []\n deleteTableColumn: []\n deleteTableRow: []\n deleteCellSelection: []\n\n mergeTableCells: []\n splitTableCell: []\n\n moveTableRow: [options: MoveTableRowOptions]\n moveTableColumn: [options: MoveTableColumnOptions]\n }\n}>\n\n/**\n * Adds commands for working with `table` nodes.\n *\n * @public\n */\nexport function defineTableCommands(): TableCommandsExtension {\n return defineCommands({\n insertTable,\n exitTable: () => exitTable,\n\n selectTable,\n selectTableCell,\n selectTableColumn,\n selectTableRow,\n\n addTableColumnBefore: () => addColumnBefore,\n addTableColumnAfter: () => addColumnAfter,\n addTableRowAbove: () => addRowBefore,\n addTableRowBelow: () => addRowAfter,\n\n deleteTable: () => deleteTable,\n deleteTableColumn: () => deleteColumn,\n deleteTableRow: () => deleteRow,\n deleteCellSelection: () => deleteCellSelection,\n\n mergeTableCells: () => mergeCells,\n splitTableCell: () => splitCell,\n\n moveTableRow,\n moveTableColumn,\n })\n}\n","import type { PlainExtension } from '@prosekit/core'\n\nimport type { DragEventHandler } from '../drop-indicator'\nimport { defineDropIndicator } from '../drop-indicator'\n\n/**\n * Hides the drop indicator when dragging a table column or row by using the\n * table handle.\n *\n * @internal\n */\nexport function defineTableDropIndicator(): PlainExtension {\n return defineDropIndicator({\n onDrag,\n })\n}\n\nconst matchMap = new WeakMap<DataTransfer, boolean>()\n\nconst onDrag: DragEventHandler = ({ event }): boolean => {\n const dataTransfer = event.dataTransfer\n if (!dataTransfer) return true\n\n let match: boolean\n\n if (matchMap.has(dataTransfer)) {\n match = matchMap.get(dataTransfer)!\n } else {\n // On Safari, accessing `dataTransfer.types` is more than 10x slower than in\n // Chrome. This becomes a bottleneck when `onDrag` is called frequently, so\n // we cache the result in a WeakMap.\n const types = dataTransfer.types\n match = types.includes('application/x-prosekit-table-handle-drag')\n matchMap.set(dataTransfer, match)\n }\n\n // Don't show the drop indicator when the drag event has\n // \"application/x-prosekit-table-handle-drag\" type.\n return !match\n}\n","import {\n definePlugin,\n type PlainExtension,\n} from '@prosekit/core'\nimport {\n columnResizing,\n tableEditing,\n} from 'prosemirror-tables'\n\n/**\n * @public\n */\nexport function defineTablePlugins(): PlainExtension {\n return definePlugin([tableEditing(), columnResizing()])\n}\n","import {\n defineNodeSpec,\n type Extension,\n} from '@prosekit/core'\nimport type {\n AttributeSpec,\n Attrs,\n} from '@prosekit/pm/model'\nimport { tableNodes } from 'prosemirror-tables'\n\nconst cellContent = 'block+'\n\n/**\n * @public\n */\nexport interface CellAttrs {\n colspan?: number\n rowspan?: number\n colwidth?: number[] | null\n}\n\nconst cellAttrs = {\n colspan: { default: 1 },\n rowspan: { default: 1 },\n colwidth: { default: null },\n} satisfies Record<string, AttributeSpec>\n\n/**\n * @internal\n */\nexport type TableSpecExtension = Extension<{\n Nodes: {\n table: Attrs\n }\n}>\n\nconst specs = tableNodes({\n tableGroup: 'block',\n cellContent,\n cellAttributes: {},\n})\n\n/**\n * @internal\n */\nexport function defineTableSpec(): TableSpecExtension {\n return defineNodeSpec({\n ...specs['table'],\n content: 'tableRow+',\n name: 'table',\n })\n}\n\n/**\n * @internal\n */\nexport type TableRowSpecExtension = Extension<{\n Nodes: {\n tableRow: Attrs\n }\n}>\n\n/**\n * @internal\n */\nexport function defineTableRowSpec(): TableRowSpecExtension {\n return defineNodeSpec({\n ...specs['table_row'],\n content: '(tableCell | tableHeaderCell)*',\n name: 'tableRow',\n })\n}\n\n/**\n * @internal\n */\nexport type TableCellSpecExtension = Extension<{\n Nodes: {\n tableCell: CellAttrs\n }\n}>\n\n/**\n * @internal\n */\nexport function defineTableCellSpec(): TableCellSpecExtension {\n return defineNodeSpec({\n ...specs['table_cell'],\n name: 'tableCell',\n attrs: cellAttrs,\n })\n}\n\n/**\n * @internal\n */\nexport type TableHeaderCellSpecExtension = Extension<{\n Nodes: {\n tableHeaderCell: CellAttrs\n }\n}>\n\nexport function defineTableHeaderCellSpec(): TableHeaderCellSpecExtension {\n return defineNodeSpec({\n ...specs['table_header'],\n name: 'tableHeaderCell',\n attrs: cellAttrs,\n })\n}\n","import {\n union,\n type Union,\n} from '@prosekit/core'\n\nimport {\n defineTableCommands,\n type TableCommandsExtension,\n} from './table-commands'\nimport { defineTableDropIndicator } from './table-drop-indicator'\nimport { defineTablePlugins } from './table-plugins'\nimport {\n defineTableCellSpec,\n defineTableHeaderCellSpec,\n defineTableRowSpec,\n defineTableSpec,\n type TableCellSpecExtension,\n type TableHeaderCellSpecExtension,\n type TableRowSpecExtension,\n type TableSpecExtension,\n} from './table-spec'\n\n/**\n * @internal\n */\nexport type TableExtension = Union<\n [\n TableSpecExtension,\n TableRowSpecExtension,\n TableCellSpecExtension,\n TableHeaderCellSpecExtension,\n TableCommandsExtension,\n ]\n>\n\n/**\n * @public\n */\nexport function defineTable(): TableExtension {\n return union(\n defineTableSpec(),\n defineTableRowSpec(),\n defineTableCellSpec(),\n defineTableHeaderCellSpec(),\n defineTablePlugins(),\n defineTableCommands(),\n defineTableDropIndicator(),\n )\n}\n"],"mappings":";;;;;;;;;;;;AAWA,MAAaA,aAAsB,OAAO,aAAa;CACrD,MAAM,EAAE,OAAO,YAAY,MAAM;AAEjC,KAAI,CAAC,MAAM,WAAW,QAAQ,CAC5B,QAA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AAEJ,KAAI,SAAS,IAAI,aAAa,CAC5B,SAAQ,SAAS,IAAI,aAAa;MAC7B;AAKL,UADc,aAAa,MACb,SAAS,2CAA2C;AAClE,WAAS,IAAI,cAAc,MAAM;;AAKnC,QAAO,CAAC;;;;;;;;AC1BV,SAAgB,qBAAqC;AACnD,QAAO,aAAa,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;;;;;ACHzD,MAAM,cAAc;AAWpB,MAAM,YAAY;CAChB,SAAS,EAAE,SAAS,GAAG;CACvB,SAAS,EAAE,SAAS,GAAG;CACvB,UAAU,EAAE,SAAS,MAAM;CAC5B;AAWD,MAAM,QAAQ,WAAW;CACvB,YAAY;CACZ;CACA,gBAAgB,EAAE;CACnB,CAAC;;;;AAKF,SAAgB,kBAAsC;AACpD,QAAO,eAAe;EACpB,GAAG,MAAM;EACT,SAAS;EACT,MAAM;EACP,CAAC;;;;;AAeJ,SAAgB,qBAA4C;AAC1D,QAAO,eAAe;EACpB,GAAG,MAAM;EACT,SAAS;EACT,MAAM;EACP,CAAC;;;;;AAeJ,SAAgB,sBAA8C;AAC5D,QAAO,eAAe;EACpB,GAAG,MAAM;EACT,MAAM;EACN,OAAO;EACR,CAAC;;AAYJ,SAAgB,4BAA0D;AACxE,QAAO,eAAe;EACpB,GAAG,MAAM;EACT,MAAM;EACN,OAAO;EACR,CAAC;;;;;;;;ACrEJ,SAAgB,cAA8B;AAC5C,QAAO,MACL,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,CAC3B"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosekit/extensions",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.12.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "A collection of common extensions for ProseKit",
|
|
7
7
|
"author": {
|
|
@@ -207,18 +207,18 @@
|
|
|
207
207
|
"src"
|
|
208
208
|
],
|
|
209
209
|
"dependencies": {
|
|
210
|
-
"@ocavue/utils": "^0.
|
|
210
|
+
"@ocavue/utils": "^0.8.1",
|
|
211
211
|
"prosemirror-changeset": "^2.3.1",
|
|
212
|
+
"prosemirror-drop-indicator": "^0.1.2",
|
|
212
213
|
"prosemirror-dropcursor": "^1.8.2",
|
|
213
|
-
"prosemirror-flat-list": "^0.5.
|
|
214
|
-
"prosemirror-gapcursor": "^1.
|
|
214
|
+
"prosemirror-flat-list": "^0.5.8",
|
|
215
|
+
"prosemirror-gapcursor": "^1.4.0",
|
|
215
216
|
"prosemirror-highlight": "^0.13.0",
|
|
216
217
|
"prosemirror-search": "^1.1.0",
|
|
217
218
|
"prosemirror-tables": "^1.8.1",
|
|
218
|
-
"shiki": "^3.
|
|
219
|
+
"shiki": "^3.14.0",
|
|
219
220
|
"@prosekit/core": "^0.8.4",
|
|
220
|
-
"@prosekit/pm": "^0.1.
|
|
221
|
-
"prosemirror-drop-indicator": "^0.1.0"
|
|
221
|
+
"@prosekit/pm": "^0.1.13"
|
|
222
222
|
},
|
|
223
223
|
"peerDependencies": {
|
|
224
224
|
"loro-crdt": ">= 0.16.7",
|
|
@@ -242,21 +242,21 @@
|
|
|
242
242
|
},
|
|
243
243
|
"devDependencies": {
|
|
244
244
|
"@types/diffable-html": "^5.0.2",
|
|
245
|
-
"@vitest/browser": "^3.2.4",
|
|
246
245
|
"diffable-html": "^6.0.1",
|
|
247
246
|
"just-pick": "^4.2.0",
|
|
248
|
-
"loro-crdt": "^1.8.
|
|
249
|
-
"loro-prosemirror": "^0.3.
|
|
247
|
+
"loro-crdt": "^1.8.8",
|
|
248
|
+
"loro-prosemirror": "^0.3.6",
|
|
250
249
|
"rehype-parse": "^9.0.1",
|
|
251
250
|
"rehype-remark": "^10.0.1",
|
|
251
|
+
"remark-gfm": "^4.0.1",
|
|
252
252
|
"remark-html": "^16.0.1",
|
|
253
253
|
"remark-parse": "^11.0.0",
|
|
254
254
|
"remark-stringify": "^11.0.0",
|
|
255
|
-
"tsdown": "^0.15.
|
|
256
|
-
"type-fest": "^5.0
|
|
257
|
-
"typescript": "~5.9.
|
|
255
|
+
"tsdown": "^0.15.12",
|
|
256
|
+
"type-fest": "^5.1.0",
|
|
257
|
+
"typescript": "~5.9.3",
|
|
258
258
|
"unified": "^11.0.5",
|
|
259
|
-
"vitest": "^
|
|
259
|
+
"vitest": "^4.0.5",
|
|
260
260
|
"y-prosemirror": "^1.3.7",
|
|
261
261
|
"y-protocols": "^1.0.6",
|
|
262
262
|
"yjs": "^13.6.27",
|