@superdoc-dev/mcp 0.10.0-next.10 → 0.10.0-next.12
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 +68 -32
- package/package.json +1 -1
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-Bm7Xq4ys.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) => {
|
|
@@ -281070,7 +281070,7 @@ var Node$13 = class Node$14 {
|
|
|
281070
281070
|
}
|
|
281071
281071
|
});
|
|
281072
281072
|
}
|
|
281073
|
-
}, COMPOSITION_INPUT_TYPES, COMBINING_MARK_REGEX, graphemeSegmenter, DEAD_KEY_PLACEHOLDER_MARKS, getTextNodeAtPos = ({ doc: doc$12, pos }) => {
|
|
281073
|
+
}, COMPOSITION_INPUT_TYPES, COMBINING_MARK_REGEX, graphemeSegmenter, DEAD_KEY_PLACEHOLDER_MARKS, TRACKABLE_META_KEYS, PASSTHROUGH_META_KEYS, ALLOWED_META_KEYS, getTextNodeAtPos = ({ doc: doc$12, pos }) => {
|
|
281074
281074
|
let found2 = null;
|
|
281075
281075
|
doc$12.nodesBetween(Math.max(0, pos - 1), Math.min(doc$12.content.size, pos + 1), (node2, nodePos) => {
|
|
281076
281076
|
if (found2 || !node2.isText || !node2.text)
|
|
@@ -281261,6 +281261,12 @@ var Node$13 = class Node$14 {
|
|
|
281261
281261
|
...existingMeta,
|
|
281262
281262
|
...extraMeta
|
|
281263
281263
|
});
|
|
281264
|
+
}, copyPassthroughMeta = (sourceTr, targetTr) => {
|
|
281265
|
+
PASSTHROUGH_META_KEYS.forEach((key2) => {
|
|
281266
|
+
const value = sourceTr.getMeta(key2);
|
|
281267
|
+
if (value !== undefined)
|
|
281268
|
+
targetTr.setMeta(key2, value);
|
|
281269
|
+
});
|
|
281264
281270
|
}, getPendingDeadKeyPlaceholder = ({ tr, newTr, user }) => {
|
|
281265
281271
|
if (!isCompositionTransaction(tr) || tr.steps.length !== 1)
|
|
281266
281272
|
return null;
|
|
@@ -281290,13 +281296,6 @@ var Node$13 = class Node$14 {
|
|
|
281290
281296
|
authorEmail: user.email
|
|
281291
281297
|
};
|
|
281292
281298
|
}, trackedTransaction = ({ tr, state, user, replacements = "paired" }) => {
|
|
281293
|
-
const onlyInputTypeMeta = [
|
|
281294
|
-
"inputType",
|
|
281295
|
-
"uiEvent",
|
|
281296
|
-
"paste",
|
|
281297
|
-
"pointer",
|
|
281298
|
-
"composition"
|
|
281299
|
-
];
|
|
281300
281299
|
const notAllowedMeta = [
|
|
281301
281300
|
"historyUndo",
|
|
281302
281301
|
"historyRedo",
|
|
@@ -281305,13 +281304,7 @@ var Node$13 = class Node$14 {
|
|
|
281305
281304
|
const isProgrammaticInput = tr.getMeta("inputType") === "programmatic";
|
|
281306
281305
|
const ySyncMeta = tr.getMeta(ySyncPluginKey);
|
|
281307
281306
|
const pendingDeadKeyPlaceholder = TrackChangesBasePluginKey.getState(state)?.pendingDeadKeyPlaceholder ?? null;
|
|
281308
|
-
const
|
|
281309
|
-
...onlyInputTypeMeta,
|
|
281310
|
-
ySyncPluginKey.key,
|
|
281311
|
-
"forceTrackChanges",
|
|
281312
|
-
"protectTrackedReviewState"
|
|
281313
|
-
]);
|
|
281314
|
-
const hasDisallowedMeta = tr.meta && Object.keys(tr.meta).some((meta4) => !allowedMeta.has(meta4));
|
|
281307
|
+
const hasDisallowedMeta = tr.meta && Object.keys(tr.meta).some((meta4) => !ALLOWED_META_KEYS.has(meta4));
|
|
281315
281308
|
if (ySyncMeta?.isChangeOrigin || !tr.steps.length || hasDisallowedMeta && !isProgrammaticInput || notAllowedMeta.includes(tr.getMeta("inputType")) || tr.getMeta(CommentsPluginKey)) {
|
|
281316
281309
|
if (pendingDeadKeyPlaceholder && !isCompositionTransaction(tr))
|
|
281317
281310
|
mergeTrackChangesMeta(tr, { pendingDeadKeyPlaceholder: null });
|
|
@@ -281386,14 +281379,7 @@ var Node$13 = class Node$14 {
|
|
|
281386
281379
|
else
|
|
281387
281380
|
newTr.step(step2);
|
|
281388
281381
|
});
|
|
281389
|
-
|
|
281390
|
-
newTr.setMeta("inputType", tr.getMeta("inputType"));
|
|
281391
|
-
if (tr.getMeta("uiEvent"))
|
|
281392
|
-
newTr.setMeta("uiEvent", tr.getMeta("uiEvent"));
|
|
281393
|
-
if (tr.getMeta("composition") !== undefined)
|
|
281394
|
-
newTr.setMeta("composition", tr.getMeta("composition"));
|
|
281395
|
-
if (tr.getMeta("addToHistory") !== undefined)
|
|
281396
|
-
newTr.setMeta("addToHistory", tr.getMeta("addToHistory"));
|
|
281382
|
+
copyPassthroughMeta(tr, newTr);
|
|
281397
281383
|
mergeTrackChangesMeta(newTr, { pendingDeadKeyPlaceholder: getPendingDeadKeyPlaceholder({
|
|
281398
281384
|
tr,
|
|
281399
281385
|
newTr,
|
|
@@ -308429,7 +308415,7 @@ menclose::after {
|
|
|
308429
308415
|
return;
|
|
308430
308416
|
console.log(...args$1);
|
|
308431
308417
|
}, 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
|
|
308418
|
+
var init_src_Bm7Xq4ys_es = __esm(() => {
|
|
308433
308419
|
init_rolldown_runtime_Bg48TavK_es();
|
|
308434
308420
|
init_SuperConverter_C6hKp29w_es();
|
|
308435
308421
|
init_jszip_C49i9kUs_es();
|
|
@@ -325420,6 +325406,26 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
325420
325406
|
["~", "̃"],
|
|
325421
325407
|
["¨", "̈"]
|
|
325422
325408
|
]);
|
|
325409
|
+
TRACKABLE_META_KEYS = [
|
|
325410
|
+
"inputType",
|
|
325411
|
+
"uiEvent",
|
|
325412
|
+
"paste",
|
|
325413
|
+
"pointer",
|
|
325414
|
+
"composition",
|
|
325415
|
+
"superdocSlicePaste",
|
|
325416
|
+
"forceTrackChanges",
|
|
325417
|
+
"protectTrackedReviewState"
|
|
325418
|
+
];
|
|
325419
|
+
PASSTHROUGH_META_KEYS = [
|
|
325420
|
+
"inputType",
|
|
325421
|
+
"uiEvent",
|
|
325422
|
+
"paste",
|
|
325423
|
+
"pointer",
|
|
325424
|
+
"composition",
|
|
325425
|
+
"addToHistory",
|
|
325426
|
+
"superdocSlicePaste"
|
|
325427
|
+
];
|
|
325428
|
+
ALLOWED_META_KEYS = new Set([...TRACKABLE_META_KEYS, ySyncPluginKey.key]);
|
|
325423
325429
|
TrackFormat = Mark3.create({
|
|
325424
325430
|
name: TrackFormatMarkName,
|
|
325425
325431
|
group: "track",
|
|
@@ -326698,8 +326704,13 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
326698
326704
|
if (dispatch)
|
|
326699
326705
|
dispatch(tr);
|
|
326700
326706
|
const presentationEditor = editor.presentationEditor;
|
|
326701
|
-
|
|
326702
|
-
|
|
326707
|
+
const scrollOpts = {
|
|
326708
|
+
block: "center",
|
|
326709
|
+
ifNeeded: true,
|
|
326710
|
+
suppressSelectionSyncScroll: true
|
|
326711
|
+
};
|
|
326712
|
+
if (!(presentationEditor?.scrollToPosition?.(from$1, scrollOpts) ?? false)) {
|
|
326713
|
+
Promise.resolve(presentationEditor?.scrollToPositionAsync?.(from$1, scrollOpts)).catch(() => {});
|
|
326703
326714
|
const { node: node2 } = editor.view.domAtPos(from$1);
|
|
326704
326715
|
if (node2?.scrollIntoView)
|
|
326705
326716
|
node2.scrollIntoView({
|
|
@@ -336559,6 +336570,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
336559
336570
|
#isRerendering = false;
|
|
336560
336571
|
#selectionSync = new SelectionSyncCoordinator;
|
|
336561
336572
|
#shouldScrollSelectionIntoView = false;
|
|
336573
|
+
#suppressSelectionScrollUntilRaf = false;
|
|
336562
336574
|
#dragDropIndicatorPos = null;
|
|
336563
336575
|
#epochMapper = new EpochPositionMapper;
|
|
336564
336576
|
#layoutEpoch = 0;
|
|
@@ -338231,6 +338243,19 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
338231
338243
|
}
|
|
338232
338244
|
return null;
|
|
338233
338245
|
}
|
|
338246
|
+
#isElementFullyVisibleInScrollContainer(el) {
|
|
338247
|
+
const rect = el.getBoundingClientRect();
|
|
338248
|
+
const viewport$1 = this.#scrollContainer instanceof Window ? {
|
|
338249
|
+
top: 0,
|
|
338250
|
+
bottom: this.#scrollContainer.innerHeight
|
|
338251
|
+
} : this.#scrollContainer instanceof Element ? this.#scrollContainer.getBoundingClientRect() : this.#visibleHost?.ownerDocument?.defaultView ? {
|
|
338252
|
+
top: 0,
|
|
338253
|
+
bottom: this.#visibleHost.ownerDocument.defaultView.innerHeight
|
|
338254
|
+
} : null;
|
|
338255
|
+
if (!viewport$1)
|
|
338256
|
+
return false;
|
|
338257
|
+
return rect.top >= viewport$1.top && rect.bottom <= viewport$1.bottom;
|
|
338258
|
+
}
|
|
338234
338259
|
scrollToPosition(pos, options = {}) {
|
|
338235
338260
|
if (this.#focusScrollRafId != null) {
|
|
338236
338261
|
const win = this.#visibleHost.ownerDocument?.defaultView;
|
|
@@ -338245,7 +338270,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
338245
338270
|
return false;
|
|
338246
338271
|
const clampedPos = Math.max(0, Math.min(pos, doc$12.content.size));
|
|
338247
338272
|
const behavior = options.behavior ?? "auto";
|
|
338248
|
-
const
|
|
338273
|
+
const requestedBlock = options.block ?? "center";
|
|
338249
338274
|
const layout = this.#layoutState.layout;
|
|
338250
338275
|
const sessionMode = this.#headerFooterSession?.session?.mode ?? "body";
|
|
338251
338276
|
if (layout && sessionMode === "body") {
|
|
@@ -338265,7 +338290,9 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
338265
338290
|
if (pageIndex != null) {
|
|
338266
338291
|
const pageEl = getPageElementByIndex(this.#viewportHost, pageIndex);
|
|
338267
338292
|
if (pageEl) {
|
|
338268
|
-
const
|
|
338293
|
+
const targetEl = this.#findElementAtPosition(pageEl, clampedPos);
|
|
338294
|
+
const elToScroll = targetEl ?? pageEl;
|
|
338295
|
+
const block = options.ifNeeded && targetEl && this.#isElementFullyVisibleInScrollContainer(targetEl) ? "nearest" : requestedBlock;
|
|
338269
338296
|
elToScroll.scrollIntoView({
|
|
338270
338297
|
block,
|
|
338271
338298
|
inline: "nearest",
|
|
@@ -338273,7 +338300,9 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
338273
338300
|
});
|
|
338274
338301
|
this.#shouldScrollSelectionIntoView = false;
|
|
338275
338302
|
const win = this.#visibleHost.ownerDocument?.defaultView;
|
|
338276
|
-
if (win)
|
|
338303
|
+
if (win) {
|
|
338304
|
+
if (options.suppressSelectionSyncScroll)
|
|
338305
|
+
this.#suppressSelectionScrollUntilRaf = true;
|
|
338277
338306
|
win.requestAnimationFrame(() => {
|
|
338278
338307
|
elToScroll.scrollIntoView({
|
|
338279
338308
|
block,
|
|
@@ -338281,7 +338310,9 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
338281
338310
|
behavior
|
|
338282
338311
|
});
|
|
338283
338312
|
this.#shouldScrollSelectionIntoView = false;
|
|
338313
|
+
this.#suppressSelectionScrollUntilRaf = false;
|
|
338284
338314
|
});
|
|
338315
|
+
}
|
|
338285
338316
|
return true;
|
|
338286
338317
|
}
|
|
338287
338318
|
}
|
|
@@ -338415,7 +338446,10 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
338415
338446
|
console.warn(`[PresentationEditor] scrollToPositionAsync: Page ${pageIndex} failed to mount within timeout`);
|
|
338416
338447
|
return false;
|
|
338417
338448
|
}
|
|
338418
|
-
return this.scrollToPosition(pos,
|
|
338449
|
+
return this.scrollToPosition(pos, {
|
|
338450
|
+
...options,
|
|
338451
|
+
ifNeeded: false
|
|
338452
|
+
});
|
|
338419
338453
|
}
|
|
338420
338454
|
async scrollContentControlIntoView(entityId, options = {}) {
|
|
338421
338455
|
const pos = this.#resolveContentControlCaretPos(entityId);
|
|
@@ -340689,6 +340723,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
340689
340723
|
}
|
|
340690
340724
|
}
|
|
340691
340725
|
#scrollActiveEndIntoView(pageIndex) {
|
|
340726
|
+
if (this.#suppressSelectionScrollUntilRaf)
|
|
340727
|
+
return;
|
|
340692
340728
|
if (!!!this.#painterHost.querySelector(`[data-page-index="${pageIndex}"]`)) {
|
|
340693
340729
|
this.#scrollPageIntoView(pageIndex);
|
|
340694
340730
|
return;
|
|
@@ -342861,7 +342897,7 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
|
|
|
342861
342897
|
|
|
342862
342898
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
342863
342899
|
var init_super_editor_es = __esm(() => {
|
|
342864
|
-
|
|
342900
|
+
init_src_Bm7Xq4ys_es();
|
|
342865
342901
|
init_SuperConverter_C6hKp29w_es();
|
|
342866
342902
|
init_jszip_C49i9kUs_es();
|
|
342867
342903
|
init_xml_js_CqGKpaft_es();
|