superdoc 2.0.0-next.44 → 2.0.0-next.46

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.
Files changed (34) hide show
  1. package/AGENTS.md +15 -8
  2. package/dist/chunks/{create-super-doc-ui-DYky1UEo.cjs → create-super-doc-ui-6FUZ9d-y.cjs} +204 -159
  3. package/dist/chunks/{create-super-doc-ui-BFz0iim0.es.js → create-super-doc-ui-DCFTmVRK.es.js} +205 -160
  4. package/dist/collaboration-upgrade-engine.cjs +1 -1
  5. package/dist/collaboration-upgrade-engine.es.js +1 -1
  6. package/dist/document-api/src/contract/command-catalog.d.ts +1 -1
  7. package/dist/document-api/src/contract/operation-definitions.d.ts +1 -1
  8. package/dist/public/ui-react.cjs +17 -14
  9. package/dist/public/ui-react.es.js +17 -14
  10. package/dist/public/ui.cjs +1 -1
  11. package/dist/public/ui.es.js +1 -1
  12. package/dist/style.css +28 -28
  13. package/dist/style.layered.css +28 -28
  14. package/dist/superdoc/src/components/surfaces/FindReplaceSurface.vue.d.ts +2 -2
  15. package/dist/superdoc/src/components/surfaces/PasswordPromptSurface.vue.d.ts +2 -2
  16. package/dist/superdoc/src/components/surfaces/SurfaceExternalMount.vue.d.ts +2 -2
  17. package/dist/superdoc/src/composables/use-find-replace.d.ts +2 -2
  18. package/dist/superdoc/src/core/SuperDoc.d.ts +41 -0
  19. package/dist/superdoc/src/core/types/index.d.ts +76 -30
  20. package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +5 -5
  21. package/dist/superdoc/src/public/browser-document-api.d.ts +53 -0
  22. package/dist/superdoc/src/public/index.d.cts +4 -0
  23. package/dist/superdoc/src/public/index.d.ts +2 -0
  24. package/dist/superdoc/src/public/ui/react.d.ts +18 -7
  25. package/dist/superdoc/src/public/ui/types.d.ts +81 -12
  26. package/dist/superdoc/src/public/ui-react.d.ts +4 -3
  27. package/dist/superdoc/src/public/ui.d.cts +8 -0
  28. package/dist/superdoc/src/public/ui.d.ts +1 -1
  29. package/dist/superdoc.cjs +85 -141
  30. package/dist/superdoc.es.js +85 -141
  31. package/dist-cdn/style.layered.css +1 -1
  32. package/dist-cdn/superdoc.min.css +1 -1
  33. package/dist-cdn/superdoc.min.js +36 -36
  34. package/package.json +2 -2
@@ -320,118 +320,6 @@ const isV2EditableTextMutationEvent = (event) => {
320
320
  if (event?.type !== "mutation:committed" || event.origin !== "command") return false;
321
321
  return V2_TYPING_COMMAND_KINDS.has(event.editableCommandKind);
322
322
  };
323
- function shallowEqual(a, b) {
324
- if (Object.is(a, b)) return true;
325
- if (typeof a !== "object" || a === null || typeof b !== "object" || b === null) return false;
326
- if (Array.isArray(a) !== Array.isArray(b)) return false;
327
- const aKeys = Object.keys(a);
328
- const bKeys = Object.keys(b);
329
- if (aKeys.length !== bKeys.length) return false;
330
- for (const key of aKeys) {
331
- if (!Object.prototype.hasOwnProperty.call(b, key)) return false;
332
- if (!Object.is(a[key], b[key])) return false;
333
- }
334
- return true;
335
- }
336
- function sdRunPropsToInlineRunPatch(props) {
337
- if (!props || typeof props !== "object") return {};
338
- const patch = {};
339
- if (props.fonts) patch.rFonts = {
340
- ascii: props.fonts.ascii,
341
- hAnsi: props.fonts.hAnsi,
342
- eastAsia: props.fonts.eastAsia,
343
- cs: props.fonts.cs,
344
- asciiTheme: props.fonts.asciiTheme,
345
- hAnsiTheme: props.fonts.hAnsiTheme,
346
- eastAsiaTheme: props.fonts.eastAsiaTheme,
347
- csTheme: props.fonts.csTheme,
348
- hint: props.fonts.hint
349
- };
350
- if (props.fontFamily != null) patch.fontFamily = props.fontFamily;
351
- if (props.lang) patch.lang = {
352
- val: props.lang.val,
353
- eastAsia: props.lang.eastAsia,
354
- bidi: props.lang.bidi
355
- };
356
- if (props.fontSize != null) patch.fontSize = props.fontSize;
357
- if (props.fontSizeCs != null) patch.fontSizeCs = props.fontSizeCs;
358
- const color = projectColorRefToInlineColor(props.color);
359
- if (color != null) patch.color = color;
360
- if (props.highlight != null) patch.highlight = props.highlight;
361
- const shading = projectShadingToInlinePatch(props.shading);
362
- if (shading) patch.shading = shading;
363
- if (props.cs != null) patch.cs = props.cs;
364
- if (props.rtl != null) patch.rtl = props.rtl;
365
- if (props.bold != null) patch.bold = props.bold;
366
- if (props.boldCs != null) patch.bCs = props.boldCs;
367
- if (props.italic != null) patch.italic = props.italic;
368
- if (props.italicCs != null) patch.iCs = props.italicCs;
369
- const underline = projectUnderlineToInlinePatch(props.underline);
370
- if (underline !== void 0) patch.underline = underline;
371
- if (props.strikethrough != null) patch.strike = props.strikethrough;
372
- if (props.doubleStrikethrough != null) patch.dstrike = props.doubleStrikethrough;
373
- if (props.caps != null) patch.caps = props.caps;
374
- if (props.smallCaps != null) patch.smallCaps = props.smallCaps;
375
- if (props.outline != null) patch.outline = props.outline;
376
- if (props.shadow != null) patch.shadow = props.shadow;
377
- if (props.emboss != null) patch.emboss = props.emboss;
378
- if (props.imprint != null) patch.imprint = props.imprint;
379
- if (props.verticalAlign != null) patch.vertAlign = props.verticalAlign;
380
- if (props.characterSpacing != null) patch.letterSpacing = props.characterSpacing;
381
- if (props.characterScale != null) patch.charScale = props.characterScale;
382
- if (props.kern != null) patch.kerning = props.kern;
383
- if (props.baselineShift != null) patch.position = props.baselineShift;
384
- if (props.fitTextWidth != null) patch.fitText = { val: props.fitTextWidth };
385
- if (props.vanish != null) patch.vanish = props.vanish;
386
- if (props.webHidden != null) patch.webHidden = props.webHidden;
387
- if (props.specVanish != null) patch.specVanish = props.specVanish;
388
- const border = projectBorderToInlinePatch(props.border);
389
- if (border) patch.border = border;
390
- return patch;
391
- }
392
- function projectColorRefToInlineColor(color) {
393
- if (!color) return void 0;
394
- if (typeof color === "string") return color;
395
- if (color.model === "rgb") return color.value;
396
- if (color.model === "auto") return "auto";
397
- }
398
- function projectUnderlineToInlinePatch(underline) {
399
- if (underline == null) return void 0;
400
- const patch = {};
401
- if (underline.style != null) patch.style = underline.style;
402
- if (underline.color?.model === "rgb") patch.color = underline.color.value;
403
- if (underline.color?.model === "theme") patch.themeColor = underline.color.theme;
404
- return Object.keys(patch).length > 0 ? patch : true;
405
- }
406
- function projectShadingToInlinePatch(shading) {
407
- if (!shading) return void 0;
408
- const patch = {};
409
- const fill = projectColorRefToInlineColor(shading.fill);
410
- if (fill != null) patch.fill = fill;
411
- const color = projectColorRefToInlineColor(shading.color);
412
- if (color != null) patch.color = color;
413
- if (shading.pattern != null) patch.val = shading.pattern;
414
- return Object.keys(patch).length > 0 ? patch : void 0;
415
- }
416
- function projectBorderToInlinePatch(border) {
417
- if (!border) return void 0;
418
- const patch = {};
419
- if (border.style != null) patch.val = border.style;
420
- if (border.width != null) patch.sz = border.width;
421
- if (border.space != null) patch.space = border.space;
422
- const color = projectColorRefToInlineColor(border.color);
423
- if (color != null) patch.color = color;
424
- return Object.keys(patch).length > 0 ? patch : void 0;
425
- }
426
- function selectionKey(selection) {
427
- const target = selection?.selectionTarget ?? selection?.target;
428
- if (!selection || !target) return "";
429
- try {
430
- return JSON.stringify(target);
431
- } catch {
432
- return String(target);
433
- }
434
- }
435
323
  const SUPERDOC_UI_REASONS = {
436
324
  notReady: "not-ready",
437
325
  documentApiUnavailable: "document-api-unavailable",
@@ -1094,6 +982,118 @@ const ALL_BUILT_IN_COMMAND_IDS = COMMAND_CATALOG.map((d) => d.id);
1094
982
  function getCommandDescriptor(id) {
1095
983
  return CATALOG_BY_ID.get(id) ?? null;
1096
984
  }
985
+ function shallowEqual(a, b) {
986
+ if (Object.is(a, b)) return true;
987
+ if (typeof a !== "object" || a === null || typeof b !== "object" || b === null) return false;
988
+ if (Array.isArray(a) !== Array.isArray(b)) return false;
989
+ const aKeys = Object.keys(a);
990
+ const bKeys = Object.keys(b);
991
+ if (aKeys.length !== bKeys.length) return false;
992
+ for (const key of aKeys) {
993
+ if (!Object.prototype.hasOwnProperty.call(b, key)) return false;
994
+ if (!Object.is(a[key], b[key])) return false;
995
+ }
996
+ return true;
997
+ }
998
+ function sdRunPropsToInlineRunPatch(props) {
999
+ if (!props || typeof props !== "object") return {};
1000
+ const patch = {};
1001
+ if (props.fonts) patch.rFonts = {
1002
+ ascii: props.fonts.ascii,
1003
+ hAnsi: props.fonts.hAnsi,
1004
+ eastAsia: props.fonts.eastAsia,
1005
+ cs: props.fonts.cs,
1006
+ asciiTheme: props.fonts.asciiTheme,
1007
+ hAnsiTheme: props.fonts.hAnsiTheme,
1008
+ eastAsiaTheme: props.fonts.eastAsiaTheme,
1009
+ csTheme: props.fonts.csTheme,
1010
+ hint: props.fonts.hint
1011
+ };
1012
+ if (props.fontFamily != null) patch.fontFamily = props.fontFamily;
1013
+ if (props.lang) patch.lang = {
1014
+ val: props.lang.val,
1015
+ eastAsia: props.lang.eastAsia,
1016
+ bidi: props.lang.bidi
1017
+ };
1018
+ if (props.fontSize != null) patch.fontSize = props.fontSize;
1019
+ if (props.fontSizeCs != null) patch.fontSizeCs = props.fontSizeCs;
1020
+ const color = projectColorRefToInlineColor(props.color);
1021
+ if (color != null) patch.color = color;
1022
+ if (props.highlight != null) patch.highlight = props.highlight;
1023
+ const shading = projectShadingToInlinePatch(props.shading);
1024
+ if (shading) patch.shading = shading;
1025
+ if (props.cs != null) patch.cs = props.cs;
1026
+ if (props.rtl != null) patch.rtl = props.rtl;
1027
+ if (props.bold != null) patch.bold = props.bold;
1028
+ if (props.boldCs != null) patch.bCs = props.boldCs;
1029
+ if (props.italic != null) patch.italic = props.italic;
1030
+ if (props.italicCs != null) patch.iCs = props.italicCs;
1031
+ const underline = projectUnderlineToInlinePatch(props.underline);
1032
+ if (underline !== void 0) patch.underline = underline;
1033
+ if (props.strikethrough != null) patch.strike = props.strikethrough;
1034
+ if (props.doubleStrikethrough != null) patch.dstrike = props.doubleStrikethrough;
1035
+ if (props.caps != null) patch.caps = props.caps;
1036
+ if (props.smallCaps != null) patch.smallCaps = props.smallCaps;
1037
+ if (props.outline != null) patch.outline = props.outline;
1038
+ if (props.shadow != null) patch.shadow = props.shadow;
1039
+ if (props.emboss != null) patch.emboss = props.emboss;
1040
+ if (props.imprint != null) patch.imprint = props.imprint;
1041
+ if (props.verticalAlign != null) patch.vertAlign = props.verticalAlign;
1042
+ if (props.characterSpacing != null) patch.letterSpacing = props.characterSpacing;
1043
+ if (props.characterScale != null) patch.charScale = props.characterScale;
1044
+ if (props.kern != null) patch.kerning = props.kern;
1045
+ if (props.baselineShift != null) patch.position = props.baselineShift;
1046
+ if (props.fitTextWidth != null) patch.fitText = { val: props.fitTextWidth };
1047
+ if (props.vanish != null) patch.vanish = props.vanish;
1048
+ if (props.webHidden != null) patch.webHidden = props.webHidden;
1049
+ if (props.specVanish != null) patch.specVanish = props.specVanish;
1050
+ const border = projectBorderToInlinePatch(props.border);
1051
+ if (border) patch.border = border;
1052
+ return patch;
1053
+ }
1054
+ function projectColorRefToInlineColor(color) {
1055
+ if (!color) return void 0;
1056
+ if (typeof color === "string") return color;
1057
+ if (color.model === "rgb") return color.value;
1058
+ if (color.model === "auto") return "auto";
1059
+ }
1060
+ function projectUnderlineToInlinePatch(underline) {
1061
+ if (underline == null) return void 0;
1062
+ const patch = {};
1063
+ if (underline.style != null) patch.style = underline.style;
1064
+ if (underline.color?.model === "rgb") patch.color = underline.color.value;
1065
+ if (underline.color?.model === "theme") patch.themeColor = underline.color.theme;
1066
+ return Object.keys(patch).length > 0 ? patch : true;
1067
+ }
1068
+ function projectShadingToInlinePatch(shading) {
1069
+ if (!shading) return void 0;
1070
+ const patch = {};
1071
+ const fill = projectColorRefToInlineColor(shading.fill);
1072
+ if (fill != null) patch.fill = fill;
1073
+ const color = projectColorRefToInlineColor(shading.color);
1074
+ if (color != null) patch.color = color;
1075
+ if (shading.pattern != null) patch.val = shading.pattern;
1076
+ return Object.keys(patch).length > 0 ? patch : void 0;
1077
+ }
1078
+ function projectBorderToInlinePatch(border) {
1079
+ if (!border) return void 0;
1080
+ const patch = {};
1081
+ if (border.style != null) patch.val = border.style;
1082
+ if (border.width != null) patch.sz = border.width;
1083
+ if (border.space != null) patch.space = border.space;
1084
+ const color = projectColorRefToInlineColor(border.color);
1085
+ if (color != null) patch.color = color;
1086
+ return Object.keys(patch).length > 0 ? patch : void 0;
1087
+ }
1088
+ function selectionKey(selection) {
1089
+ const target = selection?.selectionTarget ?? selection?.target;
1090
+ if (!selection || !target) return "";
1091
+ try {
1092
+ return JSON.stringify(target);
1093
+ } catch {
1094
+ return String(target);
1095
+ }
1096
+ }
1097
1097
  function parseCommaSeparatedIds(value) {
1098
1098
  return value.split(",").map((id) => id.trim()).filter(Boolean);
1099
1099
  }
@@ -1481,12 +1481,6 @@ const INLINE_PROPERTY_REGISTRY = [
1481
1481
  new Set(INLINE_PROPERTY_REGISTRY.map((entry) => entry.key));
1482
1482
  const INLINE_PROPERTY_BY_KEY = Object.fromEntries(INLINE_PROPERTY_REGISTRY.map((entry) => [entry.key, entry]));
1483
1483
  INLINE_PROPERTY_REGISTRY.filter((entry) => entry.storage === "mark").map((entry) => entry.key), INLINE_PROPERTY_REGISTRY.filter((entry) => entry.storage === "runAttribute").map((entry) => entry.key);
1484
- var POST_DECISION_TRACKED_CHANGES_LIST_OPTIONS = Object.freeze({
1485
- mode: "background-reconcile",
1486
- refreshReason: "post-decision-background",
1487
- blocking: false
1488
- });
1489
- var POST_DECISION_TRACKED_CHANGES_RECONCILE_DELAY_MS = 3e3;
1490
1484
  var SUPERDOC_UI_REASON_VALUES = new Set(Object.values(SUPERDOC_UI_REASONS));
1491
1485
  function coerceSuperDocUIReason(reason, fallback) {
1492
1486
  return typeof reason === "string" && SUPERDOC_UI_REASON_VALUES.has(reason) ? reason : fallback;
@@ -1509,6 +1503,7 @@ function normalizeHostSelectionApplyResult(result) {
1509
1503
  }
1510
1504
  var HOST_EVENTS = [
1511
1505
  "editorCreate",
1506
+ "active-editor-change",
1512
1507
  "document-mode-change",
1513
1508
  "zoomChange",
1514
1509
  "measurement-unit-change",
@@ -2911,7 +2906,6 @@ function createSuperDocUI(options) {
2911
2906
  let foregroundAsyncRetryTimer = null;
2912
2907
  let pendingSelectionSeedValidationToken = null;
2913
2908
  let typingContentInvalidationTimer = null;
2914
- let postDecisionTrackChangesReconcileTimer = null;
2915
2909
  const scheduleAsyncRefresh = () => {
2916
2910
  if (asyncRefreshScheduled || disposed) return;
2917
2911
  asyncRefreshScheduled = true;
@@ -2958,14 +2952,12 @@ function createSuperDocUI(options) {
2958
2952
  };
2959
2953
  let scheduleAuthoritativeTrackChangesRetry = (_reconcileToken) => void 0;
2960
2954
  let postDecisionTrackChangesToken = null;
2961
- let postDecisionTrackChangesReconcileToken = null;
2962
2955
  let postDecisionTrackChangeIds = /* @__PURE__ */ new Set();
2963
2956
  let selectionEpoch = 0;
2964
2957
  let lastCoordinatorEditor = null;
2965
2958
  const contentToken = () => `${editorIdentityId(getEditor())}|m${documentMutationRevision}`;
2966
2959
  const clearPostDecisionTrackChanges = () => {
2967
2960
  postDecisionTrackChangesToken = null;
2968
- postDecisionTrackChangesReconcileToken = null;
2969
2961
  postDecisionTrackChangeIds = /* @__PURE__ */ new Set();
2970
2962
  };
2971
2963
  const applyPostDecisionTrackChangesToCache = (ids) => {
@@ -2983,25 +2975,6 @@ function createSuperDocUI(options) {
2983
2975
  });
2984
2976
  }
2985
2977
  };
2986
- const schedulePostDecisionTrackChangesReconcile = () => {
2987
- if (disposed || postDecisionTrackChangesReconcileTimer) return;
2988
- postDecisionTrackChangesReconcileTimer = setTimeout(() => {
2989
- postDecisionTrackChangesReconcileTimer = null;
2990
- const run = () => {
2991
- if (disposed || postDecisionTrackChangeIds.size === 0) return;
2992
- invalidateDocumentContent({ preservePostDecisionTrackChanges: true });
2993
- postDecisionTrackChangesToken = contentToken();
2994
- postDecisionTrackChangesReconcileToken = postDecisionTrackChangesToken;
2995
- recompute();
2996
- };
2997
- const requestIdle = globalThis.requestIdleCallback;
2998
- if (typeof requestIdle === "function") {
2999
- requestIdle(run, { timeout: 2e3 });
3000
- return;
3001
- }
3002
- run();
3003
- }, POST_DECISION_TRACKED_CHANGES_RECONCILE_DELAY_MS);
3004
- };
3005
2978
  const notifyPostDecisionTrackChanges = (receipt) => {
3006
2979
  const notify = () => {
3007
2980
  if (disposed) return;
@@ -3067,7 +3040,6 @@ function createSuperDocUI(options) {
3067
3040
  postDecisionTrackChangesToken = token;
3068
3041
  postDecisionTrackChangeIds = new Set([...alreadyRemoved, ...newlyRemoved]);
3069
3042
  applyPostDecisionTrackChangesToCache(postDecisionTrackChangeIds);
3070
- schedulePostDecisionTrackChangesReconcile();
3071
3043
  publishPostDecisionTrackChanges(newlyRemoved, receipt);
3072
3044
  };
3073
3045
  const postDecisionTrackChangeIdsForToken = (token) => postDecisionTrackChangesToken === token && postDecisionTrackChangeIds.size > 0 ? postDecisionTrackChangeIds : null;
@@ -3736,11 +3708,11 @@ function createSuperDocUI(options) {
3736
3708
  sourceLoadingSubscriptionHost = null;
3737
3709
  clearPostDecisionTrackChanges();
3738
3710
  };
3739
- const invalidateDocumentContent = (options$1) => {
3711
+ const invalidateDocumentContent = () => {
3740
3712
  const carryAuthoritativeTrackChangesHold = authoritativeTrackChangesPendingToken !== null;
3741
3713
  documentMutationRevision += 1;
3742
3714
  if (carryAuthoritativeTrackChangesHold) authoritativeTrackChangesPendingToken = contentToken();
3743
- if (!options$1?.preservePostDecisionTrackChanges) clearPostDecisionTrackChanges();
3715
+ clearPostDecisionTrackChanges();
3744
3716
  };
3745
3717
  const insertText = (text) => {
3746
3718
  if (typeof text !== "string" || text.length === 0) return failedReceipt("insertText requires a non-empty string.", "INVALID_INPUT");
@@ -3951,10 +3923,9 @@ function createSuperDocUI(options) {
3951
3923
  value: heldEntry?.hasSettled ? heldEntry.value : null,
3952
3924
  status: heldEntry?.hasSettled ? "stale" : "pending"
3953
3925
  } : readAsync("trackChanges", token, () => {
3954
- if (listTrackedChanges) return postDecisionTrackChangesToken === token ? listTrackedChanges.call(v2TrackedChanges, POST_DECISION_TRACKED_CHANGES_LIST_OPTIONS) : listTrackedChanges.call(v2TrackedChanges);
3926
+ if (listTrackedChanges) return listTrackedChanges.call(v2TrackedChanges);
3955
3927
  return tcApi?.list ? tcApi.list() : void 0;
3956
3928
  }, (raw) => raw && Array.isArray(raw.items) ? raw.items : []);
3957
- if (listStatus === "ready" && postDecisionTrackChangesReconcileToken === token) clearPostDecisionTrackChanges();
3958
3929
  const items = (value ?? []).map(projectTrackChangesItem).filter((item) => item != null).filter((item) => {
3959
3930
  const id = readEntityId(item);
3960
3931
  return !id || !postDecisionIds?.has(id);
@@ -5758,11 +5729,20 @@ function createSuperDocUI(options) {
5758
5729
  state = nextState;
5759
5730
  for (const listener of [...listeners]) listener(state);
5760
5731
  };
5732
+ const activeEditorResetHooks = [];
5733
+ const runActiveEditorResetHooks = () => {
5734
+ for (const reset of activeEditorResetHooks) try {
5735
+ reset();
5736
+ } catch {}
5737
+ };
5761
5738
  const detachers = [];
5762
5739
  const attach = (source, events) => {
5763
5740
  if (!source || typeof source.on !== "function") return;
5764
5741
  for (const event of events) {
5765
- const handler = () => recompute();
5742
+ const handler = event === "active-editor-change" ? () => {
5743
+ runActiveEditorResetHooks();
5744
+ recompute();
5745
+ } : () => recompute();
5766
5746
  try {
5767
5747
  source.on(event, handler);
5768
5748
  detachers.push(() => {
@@ -8066,6 +8046,28 @@ function createSuperDocUI(options) {
8066
8046
  if (typeof xOrInput === "object") return pointEntityHits(xOrInput?.x, xOrInput?.y);
8067
8047
  return null;
8068
8048
  }
8049
+ const geometryObservers = /* @__PURE__ */ new Set();
8050
+ const bindGeometryObserver = (entry) => {
8051
+ const host = getHost();
8052
+ if (typeof host?.observeGeometry !== "function") return;
8053
+ const off = safeCall(() => host.observeGeometry(() => entry.schedule()), null);
8054
+ entry.detach = typeof off === "function" ? off : null;
8055
+ };
8056
+ const detachGeometryObserver = (entry) => {
8057
+ if (!entry.detach) return;
8058
+ try {
8059
+ entry.detach();
8060
+ } catch {}
8061
+ entry.detach = null;
8062
+ };
8063
+ const rebindGeometryObservers = () => {
8064
+ for (const entry of geometryObservers) {
8065
+ detachGeometryObserver(entry);
8066
+ bindGeometryObserver(entry);
8067
+ entry.schedule();
8068
+ }
8069
+ };
8070
+ activeEditorResetHooks.push(rebindGeometryObservers);
8069
8071
  const viewport = {
8070
8072
  getRect: (input) => {
8071
8073
  const host = getHost();
@@ -8101,12 +8103,15 @@ function createSuperDocUI(options) {
8101
8103
  zoom: s.zoom
8102
8104
  }));
8103
8105
  unsubs.push(sub.subscribe(() => schedule()));
8104
- const host = getHost();
8105
- if (typeof host?.observeGeometry === "function") {
8106
- const off = safeCall(() => host.observeGeometry(() => schedule()), null);
8107
- if (typeof off === "function") unsubs.push(off);
8108
- }
8106
+ const entry = {
8107
+ schedule,
8108
+ detach: null
8109
+ };
8110
+ bindGeometryObserver(entry);
8111
+ geometryObservers.add(entry);
8109
8112
  return () => {
8113
+ geometryObservers.delete(entry);
8114
+ detachGeometryObserver(entry);
8110
8115
  if (frame && typeof cancelAnimationFrame === "function") cancelAnimationFrame(frame);
8111
8116
  for (const unsub of unsubs.splice(0)) try {
8112
8117
  unsub();
@@ -8280,6 +8285,28 @@ function createSuperDocUI(options) {
8280
8285
  return searchState;
8281
8286
  };
8282
8287
  let searchRequestGeneration = 0;
8288
+ let releaseActiveSearchSession = null;
8289
+ const releaseSearchSession = () => {
8290
+ const release = releaseActiveSearchSession;
8291
+ releaseActiveSearchSession = null;
8292
+ if (!release) return;
8293
+ safeCall(() => {
8294
+ release();
8295
+ return null;
8296
+ }, null);
8297
+ };
8298
+ const resetSearchForActiveEditorChange = () => {
8299
+ searchRequestGeneration += 1;
8300
+ releaseSearchSession();
8301
+ const available = searchIsAvailable();
8302
+ searchState = {
8303
+ ...SEARCH_UNAVAILABLE_SLICE,
8304
+ available,
8305
+ reason: available ? void 0 : SUPERDOC_UI_REASONS.searchUnavailable
8306
+ };
8307
+ emitSearch();
8308
+ };
8309
+ activeEditorResetHooks.push(resetSearchForActiveEditorChange);
8283
8310
  const readSearchQueryError = (record) => {
8284
8311
  if (!record) return false;
8285
8312
  const queryError = record.queryError;
@@ -8431,11 +8458,14 @@ function createSuperDocUI(options) {
8431
8458
  },
8432
8459
  close: () => {
8433
8460
  searchRequestGeneration += 1;
8434
- const host = getHostSearch();
8435
- if (host && typeof host.clear === "function") safeCall(() => host.clear(), null);
8461
+ if (releaseActiveSearchSession) releaseSearchSession();
8436
8462
  else {
8437
- const editSearch = getEditCommandSearch();
8438
- if (editSearch && typeof editSearch.query === "function") safeCall(() => editSearch.query({ query: "" }), null);
8463
+ const host = getHostSearch();
8464
+ if (host && typeof host.clear === "function") safeCall(() => host.clear(), null);
8465
+ else {
8466
+ const editSearch = getEditCommandSearch();
8467
+ if (editSearch && typeof editSearch.query === "function") safeCall(() => editSearch.query({ query: "" }), null);
8468
+ }
8439
8469
  }
8440
8470
  searchState = {
8441
8471
  ...SEARCH_UNAVAILABLE_SLICE,
@@ -8463,6 +8493,9 @@ function createSuperDocUI(options) {
8463
8493
  open: true,
8464
8494
  reason: void 0
8465
8495
  });
8496
+ releaseActiveSearchSession = () => {
8497
+ editSearch.query({ query: "" });
8498
+ };
8466
8499
  const result = safeCall(() => editSearch.query({
8467
8500
  query,
8468
8501
  caseSensitive,
@@ -8503,6 +8536,9 @@ function createSuperDocUI(options) {
8503
8536
  open: true,
8504
8537
  reason: void 0
8505
8538
  });
8539
+ releaseActiveSearchSession = () => {
8540
+ if (typeof host.clear === "function") host.clear();
8541
+ };
8506
8542
  applyHostSearchResult(safeCall(() => host.setSession(query, {
8507
8543
  caseSensitive,
8508
8544
  includeDeletedText,
@@ -8512,6 +8548,11 @@ function createSuperDocUI(options) {
8512
8548
  if (query.length > 0 && searchState.total === 0 && searchState.reason !== SUPERDOC_UI_REASONS.searchInvalidPattern) {
8513
8549
  const editSearch = getEditCommandSearch();
8514
8550
  if (editSearch && typeof editSearch.query === "function" && typeof editSearch.getState === "function") {
8551
+ const releaseHostSession = releaseActiveSearchSession;
8552
+ releaseActiveSearchSession = () => {
8553
+ releaseHostSession?.();
8554
+ editSearch.query({ query: "" });
8555
+ };
8515
8556
  const commandResult = safeCall(() => editSearch.query({
8516
8557
  query,
8517
8558
  caseSensitive,
@@ -8752,10 +8793,6 @@ function createSuperDocUI(options) {
8752
8793
  clearTimeout(typingContentInvalidationTimer);
8753
8794
  typingContentInvalidationTimer = null;
8754
8795
  }
8755
- if (postDecisionTrackChangesReconcileTimer) {
8756
- clearTimeout(postDecisionTrackChangesReconcileTimer);
8757
- postDecisionTrackChangesReconcileTimer = null;
8758
- }
8759
8796
  if (heavyReadCompletionRecomputeTimer) {
8760
8797
  clearTimeout(heavyReadCompletionRecomputeTimer);
8761
8798
  heavyReadCompletionRecomputeTimer = null;
@@ -8780,6 +8817,8 @@ function createSuperDocUI(options) {
8780
8817
  currentDocumentSelectionSource = null;
8781
8818
  listeners.clear();
8782
8819
  searchListeners.clear();
8820
+ painterCaptureEpoch += 1;
8821
+ painterModeListeners.clear();
8783
8822
  customCommands.clear();
8784
8823
  };
8785
8824
  const controller = {
@@ -8803,12 +8842,14 @@ function createSuperDocUI(options) {
8803
8842
  styles,
8804
8843
  formatPainter: {
8805
8844
  setPointerSelecting(flag) {
8845
+ if (disposed) return;
8806
8846
  painter = {
8807
8847
  ...painter,
8808
8848
  pointerSelecting: flag
8809
8849
  };
8810
8850
  },
8811
8851
  notifyPointerUp() {
8852
+ if (disposed) return;
8812
8853
  painter = {
8813
8854
  ...painter,
8814
8855
  pointerSelecting: false
@@ -8816,12 +8857,14 @@ function createSuperDocUI(options) {
8816
8857
  maybeApply();
8817
8858
  },
8818
8859
  setKeyboardSelecting(flag) {
8860
+ if (disposed) return;
8819
8861
  painter = {
8820
8862
  ...painter,
8821
8863
  keyboardSelecting: flag
8822
8864
  };
8823
8865
  },
8824
8866
  notifyKeyUp() {
8867
+ if (disposed) return;
8825
8868
  painter = {
8826
8869
  ...painter,
8827
8870
  keyboardSelecting: false
@@ -8829,9 +8872,11 @@ function createSuperDocUI(options) {
8829
8872
  maybeApply();
8830
8873
  },
8831
8874
  cancel() {
8875
+ if (disposed) return;
8832
8876
  exitFormatPainter();
8833
8877
  },
8834
8878
  onModeChange(cb) {
8879
+ if (disposed) return () => {};
8835
8880
  painterModeListeners.add(cb);
8836
8881
  return () => painterModeListeners.delete(cb);
8837
8882
  }
@@ -8978,4 +9023,4 @@ var DEFAULT_FONT_SIZE_OPTIONS = [
8978
9023
  function commandIsActive(descriptor, selection) {
8979
9024
  return descriptor.activeMark ? selection.activeMarks.includes(descriptor.activeMark) : false;
8980
9025
  }
8981
- export { createV2ReviewMutationReconciler as a, isV2EditableTextMutationEvent as i, BUILT_IN_COMMAND_IDS as n, getV2TrackedChangeMutationImpact as o, shallowEqual as r, composeAuthorColorResolver as s, createSuperDocUI as t };
9026
+ export { createV2ReviewMutationReconciler as a, isV2EditableTextMutationEvent as i, shallowEqual as n, getV2TrackedChangeMutationImpact as o, BUILT_IN_COMMAND_IDS as r, composeAuthorColorResolver as s, createSuperDocUI as t };
@@ -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.44",
10
+ superdocVersion: "2.0.0-next.46",
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.44",
9
+ superdocVersion: "2.0.0-next.46",
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;