@superdoc-dev/mcp 0.10.0-next.6 → 0.10.0-next.7
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/index.js +98 -5
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -211378,7 +211378,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
211378
211378
|
init_remark_gfm_BhnWr3yf_es();
|
|
211379
211379
|
});
|
|
211380
211380
|
|
|
211381
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
211381
|
+
// ../../packages/superdoc/dist/chunks/src-CYzfdR4C.es.js
|
|
211382
211382
|
function deleteProps(obj, propOrProps) {
|
|
211383
211383
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
211384
211384
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -287872,7 +287872,7 @@ var Node$13 = class Node$14 {
|
|
|
287872
287872
|
return false;
|
|
287873
287873
|
const docs = tr.docs ?? [];
|
|
287874
287874
|
return tr.steps.some((step2, index2) => stepTouchesTrackedReviewState(step2, docs[index2] ?? state.doc));
|
|
287875
|
-
}, cloneExtensionInstance = (extension2) => {
|
|
287875
|
+
}, CONTENT_CONTROL_POINTER_WINDOW_MS = 800, cloneExtensionInstance = (extension2) => {
|
|
287876
287876
|
const extensionLike = extension2;
|
|
287877
287877
|
const config3 = extensionLike?.config;
|
|
287878
287878
|
const ExtensionCtor = extensionLike?.constructor;
|
|
@@ -304453,7 +304453,7 @@ menclose::after {
|
|
|
304453
304453
|
nextSelection = TextSelection.create(doc$12, hit.pos);
|
|
304454
304454
|
if (!nextSelection.$from.parent.inlineContent)
|
|
304455
304455
|
nextSelection = Selection.near(doc$12.resolve(hit.pos), 1);
|
|
304456
|
-
let tr = editor.state.tr.setSelection(nextSelection);
|
|
304456
|
+
let tr = editor.state.tr.setSelection(nextSelection).setMeta("uiEvent", "click");
|
|
304457
304457
|
if (inlineSdtBoundaryPos != null && inlineSdtBoundaryDirection) {
|
|
304458
304458
|
tr = applyEditableSlotAtInlineBoundary(tr, inlineSdtBoundaryPos, inlineSdtBoundaryDirection);
|
|
304459
304459
|
nextSelection = tr.selection;
|
|
@@ -308429,7 +308429,7 @@ menclose::after {
|
|
|
308429
308429
|
return;
|
|
308430
308430
|
console.log(...args$1);
|
|
308431
308431
|
}, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions, TRACKED_MARK_NAMES;
|
|
308432
|
-
var
|
|
308432
|
+
var init_src_CYzfdR4C_es = __esm(() => {
|
|
308433
308433
|
init_rolldown_runtime_Bg48TavK_es();
|
|
308434
308434
|
init_SuperConverter_C6hKp29w_es();
|
|
308435
308435
|
init_jszip_C49i9kUs_es();
|
|
@@ -332629,6 +332629,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
332629
332629
|
}
|
|
332630
332630
|
#telemetry = null;
|
|
332631
332631
|
#documentOpenTracked = false;
|
|
332632
|
+
#lastActiveContentControlRef = null;
|
|
332633
|
+
#lastPointerDownAt = 0;
|
|
332632
332634
|
#constructorFragment = null;
|
|
332633
332635
|
constructor(options) {
|
|
332634
332636
|
super();
|
|
@@ -332850,9 +332852,15 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
332850
332852
|
this.on("fonts-resolved", this.options.onFontsResolved);
|
|
332851
332853
|
this.on("exception", this.options.onException);
|
|
332852
332854
|
this.on("pointerDown", this.options.onPointerDown);
|
|
332855
|
+
this.#trackContentControlPointer();
|
|
332853
332856
|
this.on("pointerUp", this.options.onPointerUp);
|
|
332854
332857
|
this.on("rightClick", this.options.onRightClick);
|
|
332855
332858
|
}
|
|
332859
|
+
#trackContentControlPointer() {
|
|
332860
|
+
this.on("pointerDown", () => {
|
|
332861
|
+
this.#lastPointerDownAt = Date.now();
|
|
332862
|
+
});
|
|
332863
|
+
}
|
|
332856
332864
|
async#loadDocument(source, options) {
|
|
332857
332865
|
try {
|
|
332858
332866
|
const resolvedMode = options?.mode ?? this.options.mode ?? "docx";
|
|
@@ -333003,6 +333011,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
333003
333011
|
this.options.fileSource = null;
|
|
333004
333012
|
this.options.fragment = null;
|
|
333005
333013
|
this._state = undefined;
|
|
333014
|
+
this.#lastActiveContentControlRef = null;
|
|
333015
|
+
this.#lastPointerDownAt = 0;
|
|
333006
333016
|
}
|
|
333007
333017
|
#initProtectionState() {
|
|
333008
333018
|
const protStorage = getProtectionStorage(this);
|
|
@@ -333062,6 +333072,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
333062
333072
|
this.on("fonts-resolved", this.options.onFontsResolved);
|
|
333063
333073
|
this.on("exception", this.options.onException);
|
|
333064
333074
|
this.on("pointerDown", this.options.onPointerDown);
|
|
333075
|
+
this.#trackContentControlPointer();
|
|
333065
333076
|
this.on("pointerUp", this.options.onPointerUp);
|
|
333066
333077
|
this.on("rightClick", this.options.onRightClick);
|
|
333067
333078
|
if (!shouldMountRenderer)
|
|
@@ -333110,6 +333121,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
333110
333121
|
this.on("locked", this.options.onDocumentLocked);
|
|
333111
333122
|
this.on("list-definitions-change", this.options.onListDefinitionsChange);
|
|
333112
333123
|
this.on("pointerDown", this.options.onPointerDown);
|
|
333124
|
+
this.#trackContentControlPointer();
|
|
333113
333125
|
this.on("pointerUp", this.options.onPointerUp);
|
|
333114
333126
|
this.on("rightClick", this.options.onRightClick);
|
|
333115
333127
|
if (!shouldMountRenderer)
|
|
@@ -333929,6 +333941,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
333929
333941
|
editor: this,
|
|
333930
333942
|
transaction: transactionToApply
|
|
333931
333943
|
});
|
|
333944
|
+
this.#emitContentControlEvents({
|
|
333945
|
+
transaction: transactionToApply,
|
|
333946
|
+
nextState,
|
|
333947
|
+
selectionHasChanged
|
|
333948
|
+
});
|
|
333932
333949
|
const focus = transactionToApply.getMeta("focus");
|
|
333933
333950
|
if (focus)
|
|
333934
333951
|
this.emit("focus", {
|
|
@@ -333957,6 +333974,82 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
333957
333974
|
});
|
|
333958
333975
|
}
|
|
333959
333976
|
}
|
|
333977
|
+
#emitContentControlEvents({ transaction, nextState, selectionHasChanged }) {
|
|
333978
|
+
const uiEvent = transaction.getMeta("uiEvent");
|
|
333979
|
+
const recentPointerDown = Date.now() - this.#lastPointerDownAt <= CONTENT_CONTROL_POINTER_WINDOW_MS;
|
|
333980
|
+
const source = uiEvent === "click" || recentPointerDown ? "pointer" : "keyboard";
|
|
333981
|
+
const activePath = nextState.selection ? this.#collectActiveSdtRefs(nextState.selection) : [];
|
|
333982
|
+
const activeContentControl = activePath[0] ?? null;
|
|
333983
|
+
if (selectionHasChanged) {
|
|
333984
|
+
const previous3 = this.#lastActiveContentControlRef;
|
|
333985
|
+
if (previous3?.id !== activeContentControl?.id) {
|
|
333986
|
+
if (activeContentControl)
|
|
333987
|
+
this.emit("contentControlFocus", {
|
|
333988
|
+
active: activeContentControl,
|
|
333989
|
+
previous: previous3,
|
|
333990
|
+
activePath,
|
|
333991
|
+
source
|
|
333992
|
+
});
|
|
333993
|
+
else if (previous3)
|
|
333994
|
+
this.emit("contentControlBlur", {
|
|
333995
|
+
active: null,
|
|
333996
|
+
previous: previous3,
|
|
333997
|
+
activePath: [],
|
|
333998
|
+
source
|
|
333999
|
+
});
|
|
334000
|
+
this.#lastActiveContentControlRef = activeContentControl;
|
|
334001
|
+
}
|
|
334002
|
+
}
|
|
334003
|
+
if (uiEvent === "click" && activeContentControl)
|
|
334004
|
+
this.emit("contentControlClick", {
|
|
334005
|
+
target: activeContentControl,
|
|
334006
|
+
source: "pointer"
|
|
334007
|
+
});
|
|
334008
|
+
}
|
|
334009
|
+
#collectActiveSdtRefs(selection) {
|
|
334010
|
+
const refs = [];
|
|
334011
|
+
const seenIds = /* @__PURE__ */ new Set;
|
|
334012
|
+
const selectedNode = selection instanceof NodeSelection ? selection.node : null;
|
|
334013
|
+
if (selectedNode && (selectedNode.type?.name === "structuredContent" || selectedNode.type?.name === "structuredContentBlock")) {
|
|
334014
|
+
const ref$1 = this.#toSdtRef(selectedNode);
|
|
334015
|
+
if (ref$1) {
|
|
334016
|
+
refs.push(ref$1);
|
|
334017
|
+
seenIds.add(ref$1.id);
|
|
334018
|
+
}
|
|
334019
|
+
}
|
|
334020
|
+
const anchor = selection.$anchor;
|
|
334021
|
+
if (anchor && typeof anchor.depth === "number" && typeof anchor.node === "function")
|
|
334022
|
+
for (let depth = anchor.depth;depth >= 0; depth -= 1) {
|
|
334023
|
+
const node2 = anchor.node(depth);
|
|
334024
|
+
if (!node2)
|
|
334025
|
+
continue;
|
|
334026
|
+
const typeName = node2?.type?.name;
|
|
334027
|
+
if (typeName !== "structuredContent" && typeName !== "structuredContentBlock")
|
|
334028
|
+
continue;
|
|
334029
|
+
const ref$1 = this.#toSdtRef(node2);
|
|
334030
|
+
if (!ref$1)
|
|
334031
|
+
continue;
|
|
334032
|
+
if (seenIds.has(ref$1.id))
|
|
334033
|
+
continue;
|
|
334034
|
+
refs.push(ref$1);
|
|
334035
|
+
seenIds.add(ref$1.id);
|
|
334036
|
+
}
|
|
334037
|
+
return refs;
|
|
334038
|
+
}
|
|
334039
|
+
#toSdtRef(node2) {
|
|
334040
|
+
const attrs = node2.attrs;
|
|
334041
|
+
const id2 = attrs?.id;
|
|
334042
|
+
if (typeof id2 !== "string" || id2.length === 0)
|
|
334043
|
+
return null;
|
|
334044
|
+
const scope = node2.type.name === "structuredContent" ? "inline" : "block";
|
|
334045
|
+
return {
|
|
334046
|
+
id: id2,
|
|
334047
|
+
tag: typeof attrs.tag === "string" ? attrs.tag : undefined,
|
|
334048
|
+
alias: typeof attrs.alias === "string" ? attrs.alias : undefined,
|
|
334049
|
+
controlType: typeof attrs.controlType === "string" ? attrs.controlType : "unknown",
|
|
334050
|
+
scope
|
|
334051
|
+
};
|
|
334052
|
+
}
|
|
333960
334053
|
dispatch(tr) {
|
|
333961
334054
|
this.#dispatchTransaction(tr);
|
|
333962
334055
|
}
|
|
@@ -342684,7 +342777,7 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
|
|
|
342684
342777
|
|
|
342685
342778
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
342686
342779
|
var init_super_editor_es = __esm(() => {
|
|
342687
|
-
|
|
342780
|
+
init_src_CYzfdR4C_es();
|
|
342688
342781
|
init_SuperConverter_C6hKp29w_es();
|
|
342689
342782
|
init_jszip_C49i9kUs_es();
|
|
342690
342783
|
init_xml_js_CqGKpaft_es();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/mcp",
|
|
3
|
-
"version": "0.10.0-next.
|
|
3
|
+
"version": "0.10.0-next.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20"
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"@types/node": "22.19.2",
|
|
21
21
|
"typescript": "^5.9.2",
|
|
22
22
|
"@superdoc/document-api": "0.0.1",
|
|
23
|
-
"superdoc": "
|
|
24
|
-
"
|
|
23
|
+
"@superdoc/super-editor": "0.0.1",
|
|
24
|
+
"superdoc": "1.37.0"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|