superdoc 2.0.0-next.45 → 2.0.0-next.47
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/AGENTS.md +15 -8
- package/dist/chunks/{create-super-doc-ui-BTOlZen9.es.js → create-super-doc-ui-CKyCKKdl.es.js} +244 -143
- package/dist/chunks/{create-super-doc-ui-DDxbK_M7.cjs → create-super-doc-ui-Dk6T01KE.cjs} +243 -142
- package/dist/collaboration-upgrade-engine.cjs +1 -1
- package/dist/collaboration-upgrade-engine.es.js +1 -1
- package/dist/document-api/src/contract/command-catalog.d.ts +1 -1
- package/dist/document-api/src/contract/operation-definitions.d.ts +1 -1
- package/dist/public/ui-react.cjs +17 -14
- package/dist/public/ui-react.es.js +17 -14
- package/dist/public/ui.cjs +1 -1
- package/dist/public/ui.es.js +1 -1
- package/dist/style.css +23 -23
- package/dist/style.layered.css +23 -23
- package/dist/superdoc/src/components/surfaces/FindReplaceSurface.vue.d.ts +2 -2
- package/dist/superdoc/src/components/surfaces/PasswordPromptSurface.vue.d.ts +2 -2
- package/dist/superdoc/src/components/surfaces/SurfaceExternalMount.vue.d.ts +2 -2
- package/dist/superdoc/src/composables/replace-continuation.d.ts +37 -0
- package/dist/superdoc/src/composables/use-find-replace.d.ts +2 -2
- package/dist/superdoc/src/core/SuperDoc.d.ts +41 -0
- package/dist/superdoc/src/core/types/index.d.ts +2 -14
- package/dist/superdoc/src/internal/toolbar/built-in/default-items.d.ts +11 -0
- package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +5 -5
- package/dist/superdoc/src/public/browser-document-api.d.ts +53 -0
- package/dist/superdoc/src/public/index.d.cts +4 -0
- package/dist/superdoc/src/public/index.d.ts +2 -0
- package/dist/superdoc/src/public/ui/react.d.ts +18 -7
- package/dist/superdoc/src/public/ui/types.d.ts +81 -12
- package/dist/superdoc/src/public/ui-react.d.ts +4 -3
- package/dist/superdoc/src/public/ui.d.cts +8 -0
- package/dist/superdoc/src/public/ui.d.ts +1 -1
- package/dist/superdoc.cjs +84 -59
- package/dist/superdoc.es.js +84 -59
- package/dist-cdn/style.layered.css +1 -1
- package/dist-cdn/superdoc.min.css +1 -1
- package/dist-cdn/superdoc.min.js +35 -35
- package/package.json +1 -1
|
@@ -539,118 +539,6 @@ const isV2EditableTextMutationEvent = (event) => {
|
|
|
539
539
|
if (event?.type !== "mutation:committed" || event.origin !== "command") return false;
|
|
540
540
|
return V2_TYPING_COMMAND_KINDS.has(event.editableCommandKind);
|
|
541
541
|
};
|
|
542
|
-
function shallowEqual(a, b) {
|
|
543
|
-
if (Object.is(a, b)) return true;
|
|
544
|
-
if (typeof a !== "object" || a === null || typeof b !== "object" || b === null) return false;
|
|
545
|
-
if (Array.isArray(a) !== Array.isArray(b)) return false;
|
|
546
|
-
const aKeys = Object.keys(a);
|
|
547
|
-
const bKeys = Object.keys(b);
|
|
548
|
-
if (aKeys.length !== bKeys.length) return false;
|
|
549
|
-
for (const key of aKeys) {
|
|
550
|
-
if (!Object.prototype.hasOwnProperty.call(b, key)) return false;
|
|
551
|
-
if (!Object.is(a[key], b[key])) return false;
|
|
552
|
-
}
|
|
553
|
-
return true;
|
|
554
|
-
}
|
|
555
|
-
function sdRunPropsToInlineRunPatch(props) {
|
|
556
|
-
if (!props || typeof props !== "object") return {};
|
|
557
|
-
const patch = {};
|
|
558
|
-
if (props.fonts) patch.rFonts = {
|
|
559
|
-
ascii: props.fonts.ascii,
|
|
560
|
-
hAnsi: props.fonts.hAnsi,
|
|
561
|
-
eastAsia: props.fonts.eastAsia,
|
|
562
|
-
cs: props.fonts.cs,
|
|
563
|
-
asciiTheme: props.fonts.asciiTheme,
|
|
564
|
-
hAnsiTheme: props.fonts.hAnsiTheme,
|
|
565
|
-
eastAsiaTheme: props.fonts.eastAsiaTheme,
|
|
566
|
-
csTheme: props.fonts.csTheme,
|
|
567
|
-
hint: props.fonts.hint
|
|
568
|
-
};
|
|
569
|
-
if (props.fontFamily != null) patch.fontFamily = props.fontFamily;
|
|
570
|
-
if (props.lang) patch.lang = {
|
|
571
|
-
val: props.lang.val,
|
|
572
|
-
eastAsia: props.lang.eastAsia,
|
|
573
|
-
bidi: props.lang.bidi
|
|
574
|
-
};
|
|
575
|
-
if (props.fontSize != null) patch.fontSize = props.fontSize;
|
|
576
|
-
if (props.fontSizeCs != null) patch.fontSizeCs = props.fontSizeCs;
|
|
577
|
-
const color = projectColorRefToInlineColor(props.color);
|
|
578
|
-
if (color != null) patch.color = color;
|
|
579
|
-
if (props.highlight != null) patch.highlight = props.highlight;
|
|
580
|
-
const shading = projectShadingToInlinePatch(props.shading);
|
|
581
|
-
if (shading) patch.shading = shading;
|
|
582
|
-
if (props.cs != null) patch.cs = props.cs;
|
|
583
|
-
if (props.rtl != null) patch.rtl = props.rtl;
|
|
584
|
-
if (props.bold != null) patch.bold = props.bold;
|
|
585
|
-
if (props.boldCs != null) patch.bCs = props.boldCs;
|
|
586
|
-
if (props.italic != null) patch.italic = props.italic;
|
|
587
|
-
if (props.italicCs != null) patch.iCs = props.italicCs;
|
|
588
|
-
const underline = projectUnderlineToInlinePatch(props.underline);
|
|
589
|
-
if (underline !== void 0) patch.underline = underline;
|
|
590
|
-
if (props.strikethrough != null) patch.strike = props.strikethrough;
|
|
591
|
-
if (props.doubleStrikethrough != null) patch.dstrike = props.doubleStrikethrough;
|
|
592
|
-
if (props.caps != null) patch.caps = props.caps;
|
|
593
|
-
if (props.smallCaps != null) patch.smallCaps = props.smallCaps;
|
|
594
|
-
if (props.outline != null) patch.outline = props.outline;
|
|
595
|
-
if (props.shadow != null) patch.shadow = props.shadow;
|
|
596
|
-
if (props.emboss != null) patch.emboss = props.emboss;
|
|
597
|
-
if (props.imprint != null) patch.imprint = props.imprint;
|
|
598
|
-
if (props.verticalAlign != null) patch.vertAlign = props.verticalAlign;
|
|
599
|
-
if (props.characterSpacing != null) patch.letterSpacing = props.characterSpacing;
|
|
600
|
-
if (props.characterScale != null) patch.charScale = props.characterScale;
|
|
601
|
-
if (props.kern != null) patch.kerning = props.kern;
|
|
602
|
-
if (props.baselineShift != null) patch.position = props.baselineShift;
|
|
603
|
-
if (props.fitTextWidth != null) patch.fitText = { val: props.fitTextWidth };
|
|
604
|
-
if (props.vanish != null) patch.vanish = props.vanish;
|
|
605
|
-
if (props.webHidden != null) patch.webHidden = props.webHidden;
|
|
606
|
-
if (props.specVanish != null) patch.specVanish = props.specVanish;
|
|
607
|
-
const border = projectBorderToInlinePatch(props.border);
|
|
608
|
-
if (border) patch.border = border;
|
|
609
|
-
return patch;
|
|
610
|
-
}
|
|
611
|
-
function projectColorRefToInlineColor(color) {
|
|
612
|
-
if (!color) return void 0;
|
|
613
|
-
if (typeof color === "string") return color;
|
|
614
|
-
if (color.model === "rgb") return color.value;
|
|
615
|
-
if (color.model === "auto") return "auto";
|
|
616
|
-
}
|
|
617
|
-
function projectUnderlineToInlinePatch(underline) {
|
|
618
|
-
if (underline == null) return void 0;
|
|
619
|
-
const patch = {};
|
|
620
|
-
if (underline.style != null) patch.style = underline.style;
|
|
621
|
-
if (underline.color?.model === "rgb") patch.color = underline.color.value;
|
|
622
|
-
if (underline.color?.model === "theme") patch.themeColor = underline.color.theme;
|
|
623
|
-
return Object.keys(patch).length > 0 ? patch : true;
|
|
624
|
-
}
|
|
625
|
-
function projectShadingToInlinePatch(shading) {
|
|
626
|
-
if (!shading) return void 0;
|
|
627
|
-
const patch = {};
|
|
628
|
-
const fill = projectColorRefToInlineColor(shading.fill);
|
|
629
|
-
if (fill != null) patch.fill = fill;
|
|
630
|
-
const color = projectColorRefToInlineColor(shading.color);
|
|
631
|
-
if (color != null) patch.color = color;
|
|
632
|
-
if (shading.pattern != null) patch.val = shading.pattern;
|
|
633
|
-
return Object.keys(patch).length > 0 ? patch : void 0;
|
|
634
|
-
}
|
|
635
|
-
function projectBorderToInlinePatch(border) {
|
|
636
|
-
if (!border) return void 0;
|
|
637
|
-
const patch = {};
|
|
638
|
-
if (border.style != null) patch.val = border.style;
|
|
639
|
-
if (border.width != null) patch.sz = border.width;
|
|
640
|
-
if (border.space != null) patch.space = border.space;
|
|
641
|
-
const color = projectColorRefToInlineColor(border.color);
|
|
642
|
-
if (color != null) patch.color = color;
|
|
643
|
-
return Object.keys(patch).length > 0 ? patch : void 0;
|
|
644
|
-
}
|
|
645
|
-
function selectionKey(selection) {
|
|
646
|
-
const target = selection?.selectionTarget ?? selection?.target;
|
|
647
|
-
if (!selection || !target) return "";
|
|
648
|
-
try {
|
|
649
|
-
return JSON.stringify(target);
|
|
650
|
-
} catch {
|
|
651
|
-
return String(target);
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
542
|
const SUPERDOC_UI_REASONS = {
|
|
655
543
|
notReady: "not-ready",
|
|
656
544
|
documentApiUnavailable: "document-api-unavailable",
|
|
@@ -1313,6 +1201,118 @@ const ALL_BUILT_IN_COMMAND_IDS = COMMAND_CATALOG.map((d) => d.id);
|
|
|
1313
1201
|
function getCommandDescriptor(id) {
|
|
1314
1202
|
return CATALOG_BY_ID.get(id) ?? null;
|
|
1315
1203
|
}
|
|
1204
|
+
function shallowEqual(a, b) {
|
|
1205
|
+
if (Object.is(a, b)) return true;
|
|
1206
|
+
if (typeof a !== "object" || a === null || typeof b !== "object" || b === null) return false;
|
|
1207
|
+
if (Array.isArray(a) !== Array.isArray(b)) return false;
|
|
1208
|
+
const aKeys = Object.keys(a);
|
|
1209
|
+
const bKeys = Object.keys(b);
|
|
1210
|
+
if (aKeys.length !== bKeys.length) return false;
|
|
1211
|
+
for (const key of aKeys) {
|
|
1212
|
+
if (!Object.prototype.hasOwnProperty.call(b, key)) return false;
|
|
1213
|
+
if (!Object.is(a[key], b[key])) return false;
|
|
1214
|
+
}
|
|
1215
|
+
return true;
|
|
1216
|
+
}
|
|
1217
|
+
function sdRunPropsToInlineRunPatch(props) {
|
|
1218
|
+
if (!props || typeof props !== "object") return {};
|
|
1219
|
+
const patch = {};
|
|
1220
|
+
if (props.fonts) patch.rFonts = {
|
|
1221
|
+
ascii: props.fonts.ascii,
|
|
1222
|
+
hAnsi: props.fonts.hAnsi,
|
|
1223
|
+
eastAsia: props.fonts.eastAsia,
|
|
1224
|
+
cs: props.fonts.cs,
|
|
1225
|
+
asciiTheme: props.fonts.asciiTheme,
|
|
1226
|
+
hAnsiTheme: props.fonts.hAnsiTheme,
|
|
1227
|
+
eastAsiaTheme: props.fonts.eastAsiaTheme,
|
|
1228
|
+
csTheme: props.fonts.csTheme,
|
|
1229
|
+
hint: props.fonts.hint
|
|
1230
|
+
};
|
|
1231
|
+
if (props.fontFamily != null) patch.fontFamily = props.fontFamily;
|
|
1232
|
+
if (props.lang) patch.lang = {
|
|
1233
|
+
val: props.lang.val,
|
|
1234
|
+
eastAsia: props.lang.eastAsia,
|
|
1235
|
+
bidi: props.lang.bidi
|
|
1236
|
+
};
|
|
1237
|
+
if (props.fontSize != null) patch.fontSize = props.fontSize;
|
|
1238
|
+
if (props.fontSizeCs != null) patch.fontSizeCs = props.fontSizeCs;
|
|
1239
|
+
const color = projectColorRefToInlineColor(props.color);
|
|
1240
|
+
if (color != null) patch.color = color;
|
|
1241
|
+
if (props.highlight != null) patch.highlight = props.highlight;
|
|
1242
|
+
const shading = projectShadingToInlinePatch(props.shading);
|
|
1243
|
+
if (shading) patch.shading = shading;
|
|
1244
|
+
if (props.cs != null) patch.cs = props.cs;
|
|
1245
|
+
if (props.rtl != null) patch.rtl = props.rtl;
|
|
1246
|
+
if (props.bold != null) patch.bold = props.bold;
|
|
1247
|
+
if (props.boldCs != null) patch.bCs = props.boldCs;
|
|
1248
|
+
if (props.italic != null) patch.italic = props.italic;
|
|
1249
|
+
if (props.italicCs != null) patch.iCs = props.italicCs;
|
|
1250
|
+
const underline = projectUnderlineToInlinePatch(props.underline);
|
|
1251
|
+
if (underline !== void 0) patch.underline = underline;
|
|
1252
|
+
if (props.strikethrough != null) patch.strike = props.strikethrough;
|
|
1253
|
+
if (props.doubleStrikethrough != null) patch.dstrike = props.doubleStrikethrough;
|
|
1254
|
+
if (props.caps != null) patch.caps = props.caps;
|
|
1255
|
+
if (props.smallCaps != null) patch.smallCaps = props.smallCaps;
|
|
1256
|
+
if (props.outline != null) patch.outline = props.outline;
|
|
1257
|
+
if (props.shadow != null) patch.shadow = props.shadow;
|
|
1258
|
+
if (props.emboss != null) patch.emboss = props.emboss;
|
|
1259
|
+
if (props.imprint != null) patch.imprint = props.imprint;
|
|
1260
|
+
if (props.verticalAlign != null) patch.vertAlign = props.verticalAlign;
|
|
1261
|
+
if (props.characterSpacing != null) patch.letterSpacing = props.characterSpacing;
|
|
1262
|
+
if (props.characterScale != null) patch.charScale = props.characterScale;
|
|
1263
|
+
if (props.kern != null) patch.kerning = props.kern;
|
|
1264
|
+
if (props.baselineShift != null) patch.position = props.baselineShift;
|
|
1265
|
+
if (props.fitTextWidth != null) patch.fitText = { val: props.fitTextWidth };
|
|
1266
|
+
if (props.vanish != null) patch.vanish = props.vanish;
|
|
1267
|
+
if (props.webHidden != null) patch.webHidden = props.webHidden;
|
|
1268
|
+
if (props.specVanish != null) patch.specVanish = props.specVanish;
|
|
1269
|
+
const border = projectBorderToInlinePatch(props.border);
|
|
1270
|
+
if (border) patch.border = border;
|
|
1271
|
+
return patch;
|
|
1272
|
+
}
|
|
1273
|
+
function projectColorRefToInlineColor(color) {
|
|
1274
|
+
if (!color) return void 0;
|
|
1275
|
+
if (typeof color === "string") return color;
|
|
1276
|
+
if (color.model === "rgb") return color.value;
|
|
1277
|
+
if (color.model === "auto") return "auto";
|
|
1278
|
+
}
|
|
1279
|
+
function projectUnderlineToInlinePatch(underline) {
|
|
1280
|
+
if (underline == null) return void 0;
|
|
1281
|
+
const patch = {};
|
|
1282
|
+
if (underline.style != null) patch.style = underline.style;
|
|
1283
|
+
if (underline.color?.model === "rgb") patch.color = underline.color.value;
|
|
1284
|
+
if (underline.color?.model === "theme") patch.themeColor = underline.color.theme;
|
|
1285
|
+
return Object.keys(patch).length > 0 ? patch : true;
|
|
1286
|
+
}
|
|
1287
|
+
function projectShadingToInlinePatch(shading) {
|
|
1288
|
+
if (!shading) return void 0;
|
|
1289
|
+
const patch = {};
|
|
1290
|
+
const fill = projectColorRefToInlineColor(shading.fill);
|
|
1291
|
+
if (fill != null) patch.fill = fill;
|
|
1292
|
+
const color = projectColorRefToInlineColor(shading.color);
|
|
1293
|
+
if (color != null) patch.color = color;
|
|
1294
|
+
if (shading.pattern != null) patch.val = shading.pattern;
|
|
1295
|
+
return Object.keys(patch).length > 0 ? patch : void 0;
|
|
1296
|
+
}
|
|
1297
|
+
function projectBorderToInlinePatch(border) {
|
|
1298
|
+
if (!border) return void 0;
|
|
1299
|
+
const patch = {};
|
|
1300
|
+
if (border.style != null) patch.val = border.style;
|
|
1301
|
+
if (border.width != null) patch.sz = border.width;
|
|
1302
|
+
if (border.space != null) patch.space = border.space;
|
|
1303
|
+
const color = projectColorRefToInlineColor(border.color);
|
|
1304
|
+
if (color != null) patch.color = color;
|
|
1305
|
+
return Object.keys(patch).length > 0 ? patch : void 0;
|
|
1306
|
+
}
|
|
1307
|
+
function selectionKey(selection) {
|
|
1308
|
+
const target = selection?.selectionTarget ?? selection?.target;
|
|
1309
|
+
if (!selection || !target) return "";
|
|
1310
|
+
try {
|
|
1311
|
+
return JSON.stringify(target);
|
|
1312
|
+
} catch {
|
|
1313
|
+
return String(target);
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
1316
|
function parseCommaSeparatedIds(value) {
|
|
1317
1317
|
return value.split(",").map((id) => id.trim()).filter(Boolean);
|
|
1318
1318
|
}
|
|
@@ -1725,6 +1725,7 @@ function normalizeHostSelectionApplyResult(result) {
|
|
|
1725
1725
|
}
|
|
1726
1726
|
var HOST_EVENTS = [
|
|
1727
1727
|
"editorCreate",
|
|
1728
|
+
"active-editor-change",
|
|
1728
1729
|
"document-mode-change",
|
|
1729
1730
|
"zoomChange",
|
|
1730
1731
|
"measurement-unit-change",
|
|
@@ -5950,11 +5951,20 @@ function createSuperDocUI(options) {
|
|
|
5950
5951
|
state = nextState;
|
|
5951
5952
|
for (const listener of [...listeners]) listener(state);
|
|
5952
5953
|
};
|
|
5954
|
+
const activeEditorResetHooks = [];
|
|
5955
|
+
const runActiveEditorResetHooks = () => {
|
|
5956
|
+
for (const reset of activeEditorResetHooks) try {
|
|
5957
|
+
reset();
|
|
5958
|
+
} catch {}
|
|
5959
|
+
};
|
|
5953
5960
|
const detachers = [];
|
|
5954
5961
|
const attach = (source, events) => {
|
|
5955
5962
|
if (!source || typeof source.on !== "function") return;
|
|
5956
5963
|
for (const event of events) {
|
|
5957
|
-
const handler = () =>
|
|
5964
|
+
const handler = event === "active-editor-change" ? () => {
|
|
5965
|
+
runActiveEditorResetHooks();
|
|
5966
|
+
recompute();
|
|
5967
|
+
} : () => recompute();
|
|
5958
5968
|
try {
|
|
5959
5969
|
source.on(event, handler);
|
|
5960
5970
|
detachers.push(() => {
|
|
@@ -8258,6 +8268,28 @@ function createSuperDocUI(options) {
|
|
|
8258
8268
|
if (typeof xOrInput === "object") return pointEntityHits(xOrInput?.x, xOrInput?.y);
|
|
8259
8269
|
return null;
|
|
8260
8270
|
}
|
|
8271
|
+
const geometryObservers = /* @__PURE__ */ new Set();
|
|
8272
|
+
const bindGeometryObserver = (entry) => {
|
|
8273
|
+
const host = getHost();
|
|
8274
|
+
if (typeof host?.observeGeometry !== "function") return;
|
|
8275
|
+
const off = safeCall(() => host.observeGeometry(() => entry.schedule()), null);
|
|
8276
|
+
entry.detach = typeof off === "function" ? off : null;
|
|
8277
|
+
};
|
|
8278
|
+
const detachGeometryObserver = (entry) => {
|
|
8279
|
+
if (!entry.detach) return;
|
|
8280
|
+
try {
|
|
8281
|
+
entry.detach();
|
|
8282
|
+
} catch {}
|
|
8283
|
+
entry.detach = null;
|
|
8284
|
+
};
|
|
8285
|
+
const rebindGeometryObservers = () => {
|
|
8286
|
+
for (const entry of geometryObservers) {
|
|
8287
|
+
detachGeometryObserver(entry);
|
|
8288
|
+
bindGeometryObserver(entry);
|
|
8289
|
+
entry.schedule();
|
|
8290
|
+
}
|
|
8291
|
+
};
|
|
8292
|
+
activeEditorResetHooks.push(rebindGeometryObservers);
|
|
8261
8293
|
const viewport = {
|
|
8262
8294
|
getRect: (input) => {
|
|
8263
8295
|
const host = getHost();
|
|
@@ -8293,12 +8325,15 @@ function createSuperDocUI(options) {
|
|
|
8293
8325
|
zoom: s.zoom
|
|
8294
8326
|
}));
|
|
8295
8327
|
unsubs.push(sub.subscribe(() => schedule()));
|
|
8296
|
-
const
|
|
8297
|
-
|
|
8298
|
-
|
|
8299
|
-
|
|
8300
|
-
|
|
8328
|
+
const entry = {
|
|
8329
|
+
schedule,
|
|
8330
|
+
detach: null
|
|
8331
|
+
};
|
|
8332
|
+
bindGeometryObserver(entry);
|
|
8333
|
+
geometryObservers.add(entry);
|
|
8301
8334
|
return () => {
|
|
8335
|
+
geometryObservers.delete(entry);
|
|
8336
|
+
detachGeometryObserver(entry);
|
|
8302
8337
|
if (frame && typeof cancelAnimationFrame === "function") cancelAnimationFrame(frame);
|
|
8303
8338
|
for (const unsub of unsubs.splice(0)) try {
|
|
8304
8339
|
unsub();
|
|
@@ -8472,6 +8507,28 @@ function createSuperDocUI(options) {
|
|
|
8472
8507
|
return searchState;
|
|
8473
8508
|
};
|
|
8474
8509
|
let searchRequestGeneration = 0;
|
|
8510
|
+
let releaseActiveSearchSession = null;
|
|
8511
|
+
const releaseSearchSession = () => {
|
|
8512
|
+
const release = releaseActiveSearchSession;
|
|
8513
|
+
releaseActiveSearchSession = null;
|
|
8514
|
+
if (!release) return;
|
|
8515
|
+
safeCall(() => {
|
|
8516
|
+
release();
|
|
8517
|
+
return null;
|
|
8518
|
+
}, null);
|
|
8519
|
+
};
|
|
8520
|
+
const resetSearchForActiveEditorChange = () => {
|
|
8521
|
+
searchRequestGeneration += 1;
|
|
8522
|
+
releaseSearchSession();
|
|
8523
|
+
const available = searchIsAvailable();
|
|
8524
|
+
searchState = {
|
|
8525
|
+
...SEARCH_UNAVAILABLE_SLICE,
|
|
8526
|
+
available,
|
|
8527
|
+
reason: available ? void 0 : SUPERDOC_UI_REASONS.searchUnavailable
|
|
8528
|
+
};
|
|
8529
|
+
emitSearch();
|
|
8530
|
+
};
|
|
8531
|
+
activeEditorResetHooks.push(resetSearchForActiveEditorChange);
|
|
8475
8532
|
const readSearchQueryError = (record) => {
|
|
8476
8533
|
if (!record) return false;
|
|
8477
8534
|
const queryError = record.queryError;
|
|
@@ -8623,11 +8680,14 @@ function createSuperDocUI(options) {
|
|
|
8623
8680
|
},
|
|
8624
8681
|
close: () => {
|
|
8625
8682
|
searchRequestGeneration += 1;
|
|
8626
|
-
|
|
8627
|
-
if (host && typeof host.clear === "function") safeCall(() => host.clear(), null);
|
|
8683
|
+
if (releaseActiveSearchSession) releaseSearchSession();
|
|
8628
8684
|
else {
|
|
8629
|
-
const
|
|
8630
|
-
if (
|
|
8685
|
+
const host = getHostSearch();
|
|
8686
|
+
if (host && typeof host.clear === "function") safeCall(() => host.clear(), null);
|
|
8687
|
+
else {
|
|
8688
|
+
const editSearch = getEditCommandSearch();
|
|
8689
|
+
if (editSearch && typeof editSearch.query === "function") safeCall(() => editSearch.query({ query: "" }), null);
|
|
8690
|
+
}
|
|
8631
8691
|
}
|
|
8632
8692
|
searchState = {
|
|
8633
8693
|
...SEARCH_UNAVAILABLE_SLICE,
|
|
@@ -8655,6 +8715,9 @@ function createSuperDocUI(options) {
|
|
|
8655
8715
|
open: true,
|
|
8656
8716
|
reason: void 0
|
|
8657
8717
|
});
|
|
8718
|
+
releaseActiveSearchSession = () => {
|
|
8719
|
+
editSearch.query({ query: "" });
|
|
8720
|
+
};
|
|
8658
8721
|
const result = safeCall(() => editSearch.query({
|
|
8659
8722
|
query,
|
|
8660
8723
|
caseSensitive,
|
|
@@ -8695,6 +8758,9 @@ function createSuperDocUI(options) {
|
|
|
8695
8758
|
open: true,
|
|
8696
8759
|
reason: void 0
|
|
8697
8760
|
});
|
|
8761
|
+
releaseActiveSearchSession = () => {
|
|
8762
|
+
if (typeof host.clear === "function") host.clear();
|
|
8763
|
+
};
|
|
8698
8764
|
applyHostSearchResult(safeCall(() => host.setSession(query, {
|
|
8699
8765
|
caseSensitive,
|
|
8700
8766
|
includeDeletedText,
|
|
@@ -8704,6 +8770,11 @@ function createSuperDocUI(options) {
|
|
|
8704
8770
|
if (query.length > 0 && searchState.total === 0 && searchState.reason !== SUPERDOC_UI_REASONS.searchInvalidPattern) {
|
|
8705
8771
|
const editSearch = getEditCommandSearch();
|
|
8706
8772
|
if (editSearch && typeof editSearch.query === "function" && typeof editSearch.getState === "function") {
|
|
8773
|
+
const releaseHostSession = releaseActiveSearchSession;
|
|
8774
|
+
releaseActiveSearchSession = () => {
|
|
8775
|
+
releaseHostSession?.();
|
|
8776
|
+
editSearch.query({ query: "" });
|
|
8777
|
+
};
|
|
8707
8778
|
const commandResult = safeCall(() => editSearch.query({
|
|
8708
8779
|
query,
|
|
8709
8780
|
caseSensitive,
|
|
@@ -8739,13 +8810,19 @@ function createSuperDocUI(options) {
|
|
|
8739
8810
|
reason: SUPERDOC_UI_REASONS.operationUnavailable
|
|
8740
8811
|
};
|
|
8741
8812
|
const result = safeCall(() => editSearch.next(), null);
|
|
8742
|
-
if (isPromiseLike(result))
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8813
|
+
if (isPromiseLike(result)) {
|
|
8814
|
+
const generation = searchRequestGeneration;
|
|
8815
|
+
Promise.resolve(result).then((resolved) => {
|
|
8816
|
+
if (generation !== searchRequestGeneration) return;
|
|
8817
|
+
applyHostSearchResult(resolved, readEditCommandCanReplace());
|
|
8818
|
+
}).catch(() => {
|
|
8819
|
+
if (generation !== searchRequestGeneration) return;
|
|
8820
|
+
setSearchState({
|
|
8821
|
+
available: false,
|
|
8822
|
+
reason: SUPERDOC_UI_REASONS.searchUnavailable
|
|
8823
|
+
});
|
|
8746
8824
|
});
|
|
8747
|
-
});
|
|
8748
|
-
else applyHostSearchResult(result, readEditCommandCanReplace());
|
|
8825
|
+
} else applyHostSearchResult(result, readEditCommandCanReplace());
|
|
8749
8826
|
applyHostSearchResult(safeCall(() => editSearch.getState(), null), readEditCommandCanReplace());
|
|
8750
8827
|
return { ok: true };
|
|
8751
8828
|
}
|
|
@@ -8769,13 +8846,19 @@ function createSuperDocUI(options) {
|
|
|
8769
8846
|
reason: SUPERDOC_UI_REASONS.operationUnavailable
|
|
8770
8847
|
};
|
|
8771
8848
|
const result = safeCall(() => editSearch.previous(), null);
|
|
8772
|
-
if (isPromiseLike(result))
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8849
|
+
if (isPromiseLike(result)) {
|
|
8850
|
+
const generation = searchRequestGeneration;
|
|
8851
|
+
Promise.resolve(result).then((resolved) => {
|
|
8852
|
+
if (generation !== searchRequestGeneration) return;
|
|
8853
|
+
applyHostSearchResult(resolved, readEditCommandCanReplace());
|
|
8854
|
+
}).catch(() => {
|
|
8855
|
+
if (generation !== searchRequestGeneration) return;
|
|
8856
|
+
setSearchState({
|
|
8857
|
+
available: false,
|
|
8858
|
+
reason: SUPERDOC_UI_REASONS.searchUnavailable
|
|
8859
|
+
});
|
|
8776
8860
|
});
|
|
8777
|
-
});
|
|
8778
|
-
else applyHostSearchResult(result, readEditCommandCanReplace());
|
|
8861
|
+
} else applyHostSearchResult(result, readEditCommandCanReplace());
|
|
8779
8862
|
applyHostSearchResult(safeCall(() => editSearch.getState(), null), readEditCommandCanReplace());
|
|
8780
8863
|
return { ok: true };
|
|
8781
8864
|
}
|
|
@@ -8787,6 +8870,7 @@ function createSuperDocUI(options) {
|
|
|
8787
8870
|
return { ok: true };
|
|
8788
8871
|
},
|
|
8789
8872
|
clear: () => {
|
|
8873
|
+
searchRequestGeneration += 1;
|
|
8790
8874
|
const host = getHostSearch();
|
|
8791
8875
|
if (host && typeof host.clear === "function") safeCall(() => host.clear(), null);
|
|
8792
8876
|
if (!host || typeof host.clear !== "function") {
|
|
@@ -8814,15 +8898,19 @@ function createSuperDocUI(options) {
|
|
|
8814
8898
|
};
|
|
8815
8899
|
const result$1 = safeCall(() => editSearch.replace({ replacement: typeof replacement === "string" ? replacement : "" }), null);
|
|
8816
8900
|
if (isPromiseLike(result$1)) {
|
|
8901
|
+
const generation = searchRequestGeneration;
|
|
8817
8902
|
syncSearchStateFromHost();
|
|
8818
8903
|
emitSearch();
|
|
8904
|
+
const isCurrent = () => generation === searchRequestGeneration;
|
|
8819
8905
|
return Promise.resolve(result$1).then((resolved) => {
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8906
|
+
if (isCurrent()) {
|
|
8907
|
+
applyHostSearchResult(resolved, readEditCommandCanReplace());
|
|
8908
|
+
syncSearchStateFromHost();
|
|
8909
|
+
emitSearch();
|
|
8910
|
+
}
|
|
8823
8911
|
return mapHostReplaceResult(resolved);
|
|
8824
8912
|
}, () => {
|
|
8825
|
-
setSearchState({
|
|
8913
|
+
if (isCurrent()) setSearchState({
|
|
8826
8914
|
available: false,
|
|
8827
8915
|
reason: SUPERDOC_UI_REASONS.searchUnavailable
|
|
8828
8916
|
});
|
|
@@ -8859,15 +8947,19 @@ function createSuperDocUI(options) {
|
|
|
8859
8947
|
};
|
|
8860
8948
|
const result$1 = safeCall(() => editSearch.replaceAll({ replacement: typeof replacement === "string" ? replacement : "" }), null);
|
|
8861
8949
|
if (isPromiseLike(result$1)) {
|
|
8950
|
+
const generation = searchRequestGeneration;
|
|
8862
8951
|
syncSearchStateFromHost();
|
|
8863
8952
|
emitSearch();
|
|
8953
|
+
const isCurrent = () => generation === searchRequestGeneration;
|
|
8864
8954
|
return Promise.resolve(result$1).then((resolved) => {
|
|
8865
|
-
|
|
8866
|
-
|
|
8867
|
-
|
|
8955
|
+
if (isCurrent()) {
|
|
8956
|
+
applyHostSearchResult(resolved, readEditCommandCanReplace());
|
|
8957
|
+
syncSearchStateFromHost();
|
|
8958
|
+
emitSearch();
|
|
8959
|
+
}
|
|
8868
8960
|
return mapHostReplaceResult(resolved);
|
|
8869
8961
|
}, () => {
|
|
8870
|
-
setSearchState({
|
|
8962
|
+
if (isCurrent()) setSearchState({
|
|
8871
8963
|
available: false,
|
|
8872
8964
|
reason: SUPERDOC_UI_REASONS.searchUnavailable
|
|
8873
8965
|
});
|
|
@@ -8968,6 +9060,9 @@ function createSuperDocUI(options) {
|
|
|
8968
9060
|
currentDocumentSelectionSource = null;
|
|
8969
9061
|
listeners.clear();
|
|
8970
9062
|
searchListeners.clear();
|
|
9063
|
+
painterCaptureEpoch += 1;
|
|
9064
|
+
painterModeListeners.clear();
|
|
9065
|
+
searchRequestGeneration += 1;
|
|
8971
9066
|
customCommands.clear();
|
|
8972
9067
|
};
|
|
8973
9068
|
const controller = {
|
|
@@ -8991,12 +9086,14 @@ function createSuperDocUI(options) {
|
|
|
8991
9086
|
styles,
|
|
8992
9087
|
formatPainter: {
|
|
8993
9088
|
setPointerSelecting(flag) {
|
|
9089
|
+
if (disposed) return;
|
|
8994
9090
|
painter = {
|
|
8995
9091
|
...painter,
|
|
8996
9092
|
pointerSelecting: flag
|
|
8997
9093
|
};
|
|
8998
9094
|
},
|
|
8999
9095
|
notifyPointerUp() {
|
|
9096
|
+
if (disposed) return;
|
|
9000
9097
|
painter = {
|
|
9001
9098
|
...painter,
|
|
9002
9099
|
pointerSelecting: false
|
|
@@ -9004,12 +9101,14 @@ function createSuperDocUI(options) {
|
|
|
9004
9101
|
maybeApply();
|
|
9005
9102
|
},
|
|
9006
9103
|
setKeyboardSelecting(flag) {
|
|
9104
|
+
if (disposed) return;
|
|
9007
9105
|
painter = {
|
|
9008
9106
|
...painter,
|
|
9009
9107
|
keyboardSelecting: flag
|
|
9010
9108
|
};
|
|
9011
9109
|
},
|
|
9012
9110
|
notifyKeyUp() {
|
|
9111
|
+
if (disposed) return;
|
|
9013
9112
|
painter = {
|
|
9014
9113
|
...painter,
|
|
9015
9114
|
keyboardSelecting: false
|
|
@@ -9017,9 +9116,11 @@ function createSuperDocUI(options) {
|
|
|
9017
9116
|
maybeApply();
|
|
9018
9117
|
},
|
|
9019
9118
|
cancel() {
|
|
9119
|
+
if (disposed) return;
|
|
9020
9120
|
exitFormatPainter();
|
|
9021
9121
|
},
|
|
9022
9122
|
onModeChange(cb) {
|
|
9123
|
+
if (disposed) return () => {};
|
|
9023
9124
|
painterModeListeners.add(cb);
|
|
9024
9125
|
return () => painterModeListeners.delete(cb);
|
|
9025
9126
|
}
|
|
@@ -7,7 +7,7 @@ const COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
|
|
|
7
7
|
var PRIVATE_ENGINE_INFO = (0, __superdoc_docx_engine_collaboration_upgrade_engine.getCollaborationUpgradeEngineInfo)();
|
|
8
8
|
var ENGINE_INFO = Object.freeze({
|
|
9
9
|
...PRIVATE_ENGINE_INFO,
|
|
10
|
-
superdocVersion: "2.0.0-next.
|
|
10
|
+
superdocVersion: "2.0.0-next.47",
|
|
11
11
|
roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
|
|
12
12
|
supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
|
|
13
13
|
supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
|
|
@@ -6,7 +6,7 @@ const COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
|
|
|
6
6
|
var PRIVATE_ENGINE_INFO = getCollaborationUpgradeEngineInfo$1();
|
|
7
7
|
var ENGINE_INFO = Object.freeze({
|
|
8
8
|
...PRIVATE_ENGINE_INFO,
|
|
9
|
-
superdocVersion: "2.0.0-next.
|
|
9
|
+
superdocVersion: "2.0.0-next.47",
|
|
10
10
|
roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
|
|
11
11
|
supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
|
|
12
12
|
supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CommandCatalog, CommandStaticMetadata, OperationId } from './types.js';
|
|
2
2
|
export declare const COMMAND_CATALOG: CommandCatalog;
|
|
3
3
|
/** Operation IDs whose catalog entry has `mutates: true`. */
|
|
4
|
-
export declare const MUTATING_OPERATION_IDS: ("replace" | "find" | "delete" | "get" | "insert" | "info" | "format.apply" | "blocks.split" | "blocks.merge" | "blocks.move" | "lists.getState" | "lists.apply" | "lists.continue" | "lists.restart" | "lists.remove" | "format.paragraph.setMarkRunProps" | "tables.moveRow" | "format.bold" | "format.strike" | "format.color" | "format.rtl" | "format.cs" | "format.shading" | "format.fontFamily" | "format.lang" | "format.fontSize" | "format.fontSizeCs" | "format.highlight" | "format.italic" | "format.underline" | "format.caps" | "format.smallCaps" | "format.outline" | "format.shadow" | "format.emboss" | "format.imprint" | "format.vanish" | "format.webHidden" | "format.specVanish" | "format.border" | "format.fitText" | "format.dstrike" | "format.vertAlign" | "format.position" | "format.bCs" | "format.iCs" | "format.snapToGrid" | "format.oMath" | "format.letterSpacing" | "format.charScale" | "format.kerning" | "format.rStyle" | "format.rFonts" | "format.eastAsianLayout" | "format.em" | "format.ligatures" | "format.numForm" | "format.numSpacing" | "format.stylisticSets" | "format.contextualAlternates" | "getNode" | "getNodeById" | "getText" | "getMarkdown" | "getHtml" | "markdownToFragment" | "extract" | "clearContent" | "formatRange" | "blocks.list" | "blocks.delete" | "blocks.deleteRange" | "styles.apply" | "styles.getCatalog" | "templates.apply" | "create.paragraph" | "create.heading" | "create.sectionBreak" | "sections.list" | "sections.get" | "sections.setBreakType" | "sections.setPageMargins" | "sections.setHeaderFooterMargins" | "sections.setPageSetup" | "sections.setColumns" | "sections.setLineNumbering" | "sections.setPageNumbering" | "sections.setTitlePage" | "sections.setOddEvenHeadersFooters" | "sections.setVerticalAlign" | "sections.setSectionDirection" | "sections.setHeaderFooterRef" | "sections.clearHeaderFooterRef" | "sections.setLinkToPrevious" | "sections.setPageBorders" | "sections.clearPageBorders" | "styles.paragraph.setStyle" | "styles.paragraph.setStyleRef" | "styles.paragraph.clearStyle" | "format.paragraph.resetDirectFormatting" | "format.paragraph.setAlignment" | "format.paragraph.clearAlignment" | "format.paragraph.setIndentation" | "format.paragraph.clearIndentation" | "format.paragraph.setSpacing" | "format.paragraph.clearSpacing" | "format.paragraph.setKeepOptions" | "format.paragraph.setOutlineLevel" | "format.paragraph.setFlowOptions" | "format.paragraph.setTabStop" | "format.paragraph.clearTabStop" | "format.paragraph.clearAllTabStops" | "format.paragraph.setBorder" | "format.paragraph.clearBorder" | "format.paragraph.setShading" | "format.paragraph.clearShading" | "format.paragraph.setDirection" | "format.paragraph.clearDirection" | "format.paragraph.setNumbering" | "lists.list" | "lists.get" | "lists.insert" | "lists.create" | "lists.attach" | "lists.detach" | "lists.delete" | "lists.indent" | "lists.outdent" | "lists.join" | "lists.canJoin" | "lists.separate" | "lists.merge" | "lists.split" | "lists.setLevel" | "lists.setValue" | "lists.continuePrevious" | "lists.canContinuePrevious" | "lists.setLevelRestart" | "lists.convertToText" | "lists.applyTemplate" | "lists.applyPreset" | "lists.setType" | "lists.captureTemplate" | "lists.setLevelNumbering" | "lists.setLevelBullet" | "lists.setLevelPictureBullet" | "lists.setLevelAlignment" | "lists.setLevelIndents" | "lists.setLevelTrailingCharacter" | "lists.setLevelMarkerFont" | "lists.clearLevelOverrides" | "lists.getStyle" | "lists.applyStyle" | "lists.restartAt" | "lists.setLevelNumberStyle" | "lists.setLevelText" | "lists.setLevelStart" | "lists.setLevelLayout" | "comments.create" | "comments.patch" | "comments.delete" | "comments.get" | "comments.list" | "trackChanges.list" | "trackChanges.get" | "trackChanges.decide" | "query.match" | "ranges.resolve" | "selection.current" | "mutations.preview" | "mutations.apply" | "plan.execute" | "capabilities.get" | "create.table" | "tables.convertFromText" | "tables.delete" | "tables.clearContents" | "tables.move" | "tables.split" | "tables.convertToText" | "tables.setLayout" | "tables.insertRow" | "tables.deleteRow" | "tables.setRowHeight" | "tables.distributeRows" | "tables.setRowOptions" | "tables.insertColumn" | "tables.deleteColumn" | "tables.setColumnWidth" | "tables.distributeColumns" | "tables.insertCell" | "tables.deleteCell" | "tables.mergeCells" | "tables.unmergeCells" | "tables.splitCell" | "tables.setCellProperties" | "tables.setCellText" | "tables.sort" | "tables.setAltText" | "tables.setStyle" | "tables.clearStyle" | "tables.setStyleOption" | "tables.setBorder" | "tables.clearBorder" | "tables.applyBorderPreset" | "tables.setShading" | "tables.clearShading" | "tables.setTablePadding" | "tables.setCellPadding" | "tables.setCellSpacing" | "tables.clearCellSpacing" | "tables.applyStyle" | "tables.setBorders" | "tables.setTableOptions" | "tables.applyPreset" | "tables.get" | "tables.getCells" | "tables.getProperties" | "tables.getStyles" | "tables.setDefaultStyle" | "tables.clearDefaultStyle" | "create.tableOfContents" | "toc.list" | "toc.get" | "toc.configure" | "toc.update" | "toc.remove" | "toc.markEntry" | "toc.unmarkEntry" | "toc.listEntries" | "toc.getEntry" | "toc.editEntry" | "history.get" | "history.undo" | "history.redo" | "create.image" | "images.list" | "images.get" | "images.delete" | "images.move" | "images.convertToInline" | "images.convertToFloating" | "images.setSize" | "images.setWrapType" | "images.setWrapSide" | "images.setWrapDistances" | "images.setPosition" | "images.setAnchorOptions" | "images.setZOrder" | "images.scale" | "images.setLockAspectRatio" | "images.rotate" | "images.flip" | "images.crop" | "images.resetCrop" | "images.replaceSource" | "images.setAltText" | "images.setDecorative" | "images.setName" | "images.setHyperlink" | "images.insertCaption" | "images.updateCaption" | "images.removeCaption" | "hyperlinks.list" | "hyperlinks.get" | "hyperlinks.wrap" | "hyperlinks.insert" | "hyperlinks.patch" | "hyperlinks.remove" | "headerFooters.list" | "headerFooters.get" | "headerFooters.resolve" | "headerFooters.refs.set" | "headerFooters.refs.clear" | "headerFooters.refs.setLinkedToPrevious" | "headerFooters.parts.list" | "headerFooters.parts.create" | "headerFooters.parts.delete" | "create.contentControl" | "contentControls.list" | "contentControls.get" | "contentControls.listInRange" | "contentControls.selectByTag" | "contentControls.selectByTitle" | "contentControls.listChildren" | "contentControls.getParent" | "contentControls.wrap" | "contentControls.unwrap" | "contentControls.delete" | "contentControls.copy" | "contentControls.move" | "contentControls.patch" | "contentControls.setLockMode" | "contentControls.setType" | "contentControls.getContent" | "contentControls.replaceContent" | "contentControls.clearContent" | "contentControls.appendContent" | "contentControls.prependContent" | "contentControls.insertBefore" | "contentControls.insertAfter" | "contentControls.getBinding" | "contentControls.setBinding" | "contentControls.clearBinding" | "contentControls.getRawProperties" | "contentControls.patchRawProperties" | "contentControls.validateWordCompatibility" | "contentControls.normalizeWordCompatibility" | "contentControls.normalizeTagPayload" | "contentControls.text.setMultiline" | "contentControls.text.setValue" | "contentControls.text.clearValue" | "contentControls.date.setValue" | "contentControls.date.clearValue" | "contentControls.date.setDisplayFormat" | "contentControls.date.setDisplayLocale" | "contentControls.date.setStorageFormat" | "contentControls.date.setCalendar" | "contentControls.checkbox.getState" | "contentControls.checkbox.setState" | "contentControls.checkbox.toggle" | "contentControls.checkbox.setSymbolPair" | "contentControls.choiceList.getItems" | "contentControls.choiceList.setItems" | "contentControls.choiceList.setSelected" | "contentControls.repeatingSection.listItems" | "contentControls.repeatingSection.insertItemBefore" | "contentControls.repeatingSection.insertItemAfter" | "contentControls.repeatingSection.cloneItem" | "contentControls.repeatingSection.deleteItem" | "contentControls.repeatingSection.setAllowInsertDelete" | "contentControls.group.wrap" | "contentControls.group.ungroup" | "bookmarks.list" | "bookmarks.get" | "bookmarks.insert" | "bookmarks.rename" | "bookmarks.remove" | "footnotes.list" | "footnotes.get" | "footnotes.insert" | "footnotes.update" | "footnotes.remove" | "footnotes.configure" | "clipboard.parse" | "clipboard.insert" | "clipboard.serializeSelection" | "crossRefs.list" | "crossRefs.get" | "crossRefs.insert" | "crossRefs.rebuild" | "crossRefs.remove" | "index.list" | "index.get" | "index.insert" | "index.configure" | "index.rebuild" | "index.remove" | "index.entries.list" | "index.entries.get" | "index.entries.insert" | "index.entries.update" | "index.entries.remove" | "captions.list" | "captions.get" | "captions.insert" | "captions.update" | "captions.remove" | "captions.configure" | "fields.list" | "fields.get" | "fields.insert" | "fields.rebuild" | "fields.remove" | "citations.list" | "citations.get" | "citations.insert" | "citations.update" | "citations.remove" | "citations.sources.list" | "citations.sources.get" | "citations.sources.insert" | "citations.sources.update" | "citations.sources.remove" | "citations.bibliography.get" | "citations.bibliography.insert" | "citations.bibliography.rebuild" | "citations.bibliography.configure" | "citations.bibliography.remove" | "authorities.list" | "authorities.get" | "authorities.insert" | "authorities.configure" | "authorities.rebuild" | "authorities.remove" | "authorities.entries.list" | "authorities.entries.get" | "authorities.entries.insert" | "authorities.entries.update" | "authorities.entries.remove" | "diff.capture" | "diff.compare" | "diff.apply" | "export.toDocx" | "protection.get" | "protection.setEditingRestriction" | "protection.clearEditingRestriction" | "permissionRanges.list" | "permissionRanges.get" | "permissionRanges.create" | "permissionRanges.remove" | "permissionRanges.updatePrincipal" | "customXml.parts.list" | "customXml.parts.get" | "customXml.parts.create" | "customXml.parts.patch" | "customXml.parts.remove" | "metadata.attach" | "metadata.list" | "metadata.get" | "metadata.update" | "metadata.remove" | "metadata.resolve")[];
|
|
4
|
+
export declare const MUTATING_OPERATION_IDS: ("replace" | "find" | "delete" | "get" | "insert" | "info" | "format.apply" | "blocks.split" | "blocks.merge" | "blocks.move" | "lists.getState" | "lists.apply" | "lists.continue" | "lists.restart" | "lists.remove" | "format.paragraph.setMarkRunProps" | "tables.moveRow" | "format.bold" | "format.strike" | "format.color" | "format.italic" | "format.rtl" | "format.cs" | "format.shading" | "format.fontFamily" | "format.lang" | "format.fontSize" | "format.fontSizeCs" | "format.highlight" | "format.underline" | "format.caps" | "format.smallCaps" | "format.outline" | "format.shadow" | "format.emboss" | "format.imprint" | "format.vanish" | "format.webHidden" | "format.specVanish" | "format.border" | "format.fitText" | "format.dstrike" | "format.vertAlign" | "format.position" | "format.bCs" | "format.iCs" | "format.snapToGrid" | "format.oMath" | "format.letterSpacing" | "format.charScale" | "format.kerning" | "format.rStyle" | "format.rFonts" | "format.eastAsianLayout" | "format.em" | "format.ligatures" | "format.numForm" | "format.numSpacing" | "format.stylisticSets" | "format.contextualAlternates" | "getNode" | "getNodeById" | "getText" | "getMarkdown" | "getHtml" | "markdownToFragment" | "extract" | "clearContent" | "formatRange" | "blocks.list" | "blocks.delete" | "blocks.deleteRange" | "styles.apply" | "styles.getCatalog" | "templates.apply" | "create.paragraph" | "create.heading" | "create.sectionBreak" | "sections.list" | "sections.get" | "sections.setBreakType" | "sections.setPageMargins" | "sections.setHeaderFooterMargins" | "sections.setPageSetup" | "sections.setColumns" | "sections.setLineNumbering" | "sections.setPageNumbering" | "sections.setTitlePage" | "sections.setOddEvenHeadersFooters" | "sections.setVerticalAlign" | "sections.setSectionDirection" | "sections.setHeaderFooterRef" | "sections.clearHeaderFooterRef" | "sections.setLinkToPrevious" | "sections.setPageBorders" | "sections.clearPageBorders" | "styles.paragraph.setStyle" | "styles.paragraph.setStyleRef" | "styles.paragraph.clearStyle" | "format.paragraph.resetDirectFormatting" | "format.paragraph.setAlignment" | "format.paragraph.clearAlignment" | "format.paragraph.setIndentation" | "format.paragraph.clearIndentation" | "format.paragraph.setSpacing" | "format.paragraph.clearSpacing" | "format.paragraph.setKeepOptions" | "format.paragraph.setOutlineLevel" | "format.paragraph.setFlowOptions" | "format.paragraph.setTabStop" | "format.paragraph.clearTabStop" | "format.paragraph.clearAllTabStops" | "format.paragraph.setBorder" | "format.paragraph.clearBorder" | "format.paragraph.setShading" | "format.paragraph.clearShading" | "format.paragraph.setDirection" | "format.paragraph.clearDirection" | "format.paragraph.setNumbering" | "lists.list" | "lists.get" | "lists.insert" | "lists.create" | "lists.attach" | "lists.detach" | "lists.delete" | "lists.indent" | "lists.outdent" | "lists.join" | "lists.canJoin" | "lists.separate" | "lists.merge" | "lists.split" | "lists.setLevel" | "lists.setValue" | "lists.continuePrevious" | "lists.canContinuePrevious" | "lists.setLevelRestart" | "lists.convertToText" | "lists.applyTemplate" | "lists.applyPreset" | "lists.setType" | "lists.captureTemplate" | "lists.setLevelNumbering" | "lists.setLevelBullet" | "lists.setLevelPictureBullet" | "lists.setLevelAlignment" | "lists.setLevelIndents" | "lists.setLevelTrailingCharacter" | "lists.setLevelMarkerFont" | "lists.clearLevelOverrides" | "lists.getStyle" | "lists.applyStyle" | "lists.restartAt" | "lists.setLevelNumberStyle" | "lists.setLevelText" | "lists.setLevelStart" | "lists.setLevelLayout" | "comments.create" | "comments.patch" | "comments.delete" | "comments.get" | "comments.list" | "trackChanges.list" | "trackChanges.get" | "trackChanges.decide" | "query.match" | "ranges.resolve" | "selection.current" | "mutations.preview" | "mutations.apply" | "plan.execute" | "capabilities.get" | "create.table" | "tables.convertFromText" | "tables.delete" | "tables.clearContents" | "tables.move" | "tables.split" | "tables.convertToText" | "tables.setLayout" | "tables.insertRow" | "tables.deleteRow" | "tables.setRowHeight" | "tables.distributeRows" | "tables.setRowOptions" | "tables.insertColumn" | "tables.deleteColumn" | "tables.setColumnWidth" | "tables.distributeColumns" | "tables.insertCell" | "tables.deleteCell" | "tables.mergeCells" | "tables.unmergeCells" | "tables.splitCell" | "tables.setCellProperties" | "tables.setCellText" | "tables.sort" | "tables.setAltText" | "tables.setStyle" | "tables.clearStyle" | "tables.setStyleOption" | "tables.setBorder" | "tables.clearBorder" | "tables.applyBorderPreset" | "tables.setShading" | "tables.clearShading" | "tables.setTablePadding" | "tables.setCellPadding" | "tables.setCellSpacing" | "tables.clearCellSpacing" | "tables.applyStyle" | "tables.setBorders" | "tables.setTableOptions" | "tables.applyPreset" | "tables.get" | "tables.getCells" | "tables.getProperties" | "tables.getStyles" | "tables.setDefaultStyle" | "tables.clearDefaultStyle" | "create.tableOfContents" | "toc.list" | "toc.get" | "toc.configure" | "toc.update" | "toc.remove" | "toc.markEntry" | "toc.unmarkEntry" | "toc.listEntries" | "toc.getEntry" | "toc.editEntry" | "history.get" | "history.undo" | "history.redo" | "create.image" | "images.list" | "images.get" | "images.delete" | "images.move" | "images.convertToInline" | "images.convertToFloating" | "images.setSize" | "images.setWrapType" | "images.setWrapSide" | "images.setWrapDistances" | "images.setPosition" | "images.setAnchorOptions" | "images.setZOrder" | "images.scale" | "images.setLockAspectRatio" | "images.rotate" | "images.flip" | "images.crop" | "images.resetCrop" | "images.replaceSource" | "images.setAltText" | "images.setDecorative" | "images.setName" | "images.setHyperlink" | "images.insertCaption" | "images.updateCaption" | "images.removeCaption" | "hyperlinks.list" | "hyperlinks.get" | "hyperlinks.wrap" | "hyperlinks.insert" | "hyperlinks.patch" | "hyperlinks.remove" | "headerFooters.list" | "headerFooters.get" | "headerFooters.resolve" | "headerFooters.refs.set" | "headerFooters.refs.clear" | "headerFooters.refs.setLinkedToPrevious" | "headerFooters.parts.list" | "headerFooters.parts.create" | "headerFooters.parts.delete" | "create.contentControl" | "contentControls.list" | "contentControls.get" | "contentControls.listInRange" | "contentControls.selectByTag" | "contentControls.selectByTitle" | "contentControls.listChildren" | "contentControls.getParent" | "contentControls.wrap" | "contentControls.unwrap" | "contentControls.delete" | "contentControls.copy" | "contentControls.move" | "contentControls.patch" | "contentControls.setLockMode" | "contentControls.setType" | "contentControls.getContent" | "contentControls.replaceContent" | "contentControls.clearContent" | "contentControls.appendContent" | "contentControls.prependContent" | "contentControls.insertBefore" | "contentControls.insertAfter" | "contentControls.getBinding" | "contentControls.setBinding" | "contentControls.clearBinding" | "contentControls.getRawProperties" | "contentControls.patchRawProperties" | "contentControls.validateWordCompatibility" | "contentControls.normalizeWordCompatibility" | "contentControls.normalizeTagPayload" | "contentControls.text.setMultiline" | "contentControls.text.setValue" | "contentControls.text.clearValue" | "contentControls.date.setValue" | "contentControls.date.clearValue" | "contentControls.date.setDisplayFormat" | "contentControls.date.setDisplayLocale" | "contentControls.date.setStorageFormat" | "contentControls.date.setCalendar" | "contentControls.checkbox.getState" | "contentControls.checkbox.setState" | "contentControls.checkbox.toggle" | "contentControls.checkbox.setSymbolPair" | "contentControls.choiceList.getItems" | "contentControls.choiceList.setItems" | "contentControls.choiceList.setSelected" | "contentControls.repeatingSection.listItems" | "contentControls.repeatingSection.insertItemBefore" | "contentControls.repeatingSection.insertItemAfter" | "contentControls.repeatingSection.cloneItem" | "contentControls.repeatingSection.deleteItem" | "contentControls.repeatingSection.setAllowInsertDelete" | "contentControls.group.wrap" | "contentControls.group.ungroup" | "bookmarks.list" | "bookmarks.get" | "bookmarks.insert" | "bookmarks.rename" | "bookmarks.remove" | "footnotes.list" | "footnotes.get" | "footnotes.insert" | "footnotes.update" | "footnotes.remove" | "footnotes.configure" | "clipboard.parse" | "clipboard.insert" | "clipboard.serializeSelection" | "crossRefs.list" | "crossRefs.get" | "crossRefs.insert" | "crossRefs.rebuild" | "crossRefs.remove" | "index.list" | "index.get" | "index.insert" | "index.configure" | "index.rebuild" | "index.remove" | "index.entries.list" | "index.entries.get" | "index.entries.insert" | "index.entries.update" | "index.entries.remove" | "captions.list" | "captions.get" | "captions.insert" | "captions.update" | "captions.remove" | "captions.configure" | "fields.list" | "fields.get" | "fields.insert" | "fields.rebuild" | "fields.remove" | "citations.list" | "citations.get" | "citations.insert" | "citations.update" | "citations.remove" | "citations.sources.list" | "citations.sources.get" | "citations.sources.insert" | "citations.sources.update" | "citations.sources.remove" | "citations.bibliography.get" | "citations.bibliography.insert" | "citations.bibliography.rebuild" | "citations.bibliography.configure" | "citations.bibliography.remove" | "authorities.list" | "authorities.get" | "authorities.insert" | "authorities.configure" | "authorities.rebuild" | "authorities.remove" | "authorities.entries.list" | "authorities.entries.get" | "authorities.entries.insert" | "authorities.entries.update" | "authorities.entries.remove" | "diff.capture" | "diff.compare" | "diff.apply" | "export.toDocx" | "protection.get" | "protection.setEditingRestriction" | "protection.clearEditingRestriction" | "permissionRanges.list" | "permissionRanges.get" | "permissionRanges.create" | "permissionRanges.remove" | "permissionRanges.updatePrincipal" | "customXml.parts.list" | "customXml.parts.get" | "customXml.parts.create" | "customXml.parts.patch" | "customXml.parts.remove" | "metadata.attach" | "metadata.list" | "metadata.get" | "metadata.update" | "metadata.remove" | "metadata.resolve")[];
|
|
5
5
|
/** Maps each operation to its human-readable description. */
|
|
6
6
|
export declare const OPERATION_DESCRIPTION_MAP: Record<OperationId, string>;
|
|
7
7
|
/** Maps each operation to whether it requires an open document to execute. */
|
|
@@ -3371,6 +3371,7 @@ export declare const OPERATION_DEFINITIONS: {
|
|
|
3371
3371
|
readonly "format.bold": OperationDefinitionEntry;
|
|
3372
3372
|
readonly "format.strike": OperationDefinitionEntry;
|
|
3373
3373
|
readonly "format.color": OperationDefinitionEntry;
|
|
3374
|
+
readonly "format.italic": OperationDefinitionEntry;
|
|
3374
3375
|
readonly "format.rtl": OperationDefinitionEntry;
|
|
3375
3376
|
readonly "format.cs": OperationDefinitionEntry;
|
|
3376
3377
|
readonly "format.shading": OperationDefinitionEntry;
|
|
@@ -3379,7 +3380,6 @@ export declare const OPERATION_DEFINITIONS: {
|
|
|
3379
3380
|
readonly "format.fontSize": OperationDefinitionEntry;
|
|
3380
3381
|
readonly "format.fontSizeCs": OperationDefinitionEntry;
|
|
3381
3382
|
readonly "format.highlight": OperationDefinitionEntry;
|
|
3382
|
-
readonly "format.italic": OperationDefinitionEntry;
|
|
3383
3383
|
readonly "format.underline": OperationDefinitionEntry;
|
|
3384
3384
|
readonly "format.caps": OperationDefinitionEntry;
|
|
3385
3385
|
readonly "format.smallCaps": OperationDefinitionEntry;
|