superdoc 2.0.0-next.45 → 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-DDxbK_M7.cjs → create-super-doc-ui-6FUZ9d-y.cjs} +201 -122
  3. package/dist/chunks/{create-super-doc-ui-BTOlZen9.es.js → create-super-doc-ui-DCFTmVRK.es.js} +202 -123
  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 +23 -23
  13. package/dist/style.layered.css +23 -23
  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 +2 -14
  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 +53 -43
  30. package/dist/superdoc.es.js +53 -43
  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 +35 -35
  34. package/package.json +1 -1
@@ -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
  }
@@ -1503,6 +1503,7 @@ function normalizeHostSelectionApplyResult(result) {
1503
1503
  }
1504
1504
  var HOST_EVENTS = [
1505
1505
  "editorCreate",
1506
+ "active-editor-change",
1506
1507
  "document-mode-change",
1507
1508
  "zoomChange",
1508
1509
  "measurement-unit-change",
@@ -5728,11 +5729,20 @@ function createSuperDocUI(options) {
5728
5729
  state = nextState;
5729
5730
  for (const listener of [...listeners]) listener(state);
5730
5731
  };
5732
+ const activeEditorResetHooks = [];
5733
+ const runActiveEditorResetHooks = () => {
5734
+ for (const reset of activeEditorResetHooks) try {
5735
+ reset();
5736
+ } catch {}
5737
+ };
5731
5738
  const detachers = [];
5732
5739
  const attach = (source, events) => {
5733
5740
  if (!source || typeof source.on !== "function") return;
5734
5741
  for (const event of events) {
5735
- const handler = () => recompute();
5742
+ const handler = event === "active-editor-change" ? () => {
5743
+ runActiveEditorResetHooks();
5744
+ recompute();
5745
+ } : () => recompute();
5736
5746
  try {
5737
5747
  source.on(event, handler);
5738
5748
  detachers.push(() => {
@@ -8036,6 +8046,28 @@ function createSuperDocUI(options) {
8036
8046
  if (typeof xOrInput === "object") return pointEntityHits(xOrInput?.x, xOrInput?.y);
8037
8047
  return null;
8038
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);
8039
8071
  const viewport = {
8040
8072
  getRect: (input) => {
8041
8073
  const host = getHost();
@@ -8071,12 +8103,15 @@ function createSuperDocUI(options) {
8071
8103
  zoom: s.zoom
8072
8104
  }));
8073
8105
  unsubs.push(sub.subscribe(() => schedule()));
8074
- const host = getHost();
8075
- if (typeof host?.observeGeometry === "function") {
8076
- const off = safeCall(() => host.observeGeometry(() => schedule()), null);
8077
- if (typeof off === "function") unsubs.push(off);
8078
- }
8106
+ const entry = {
8107
+ schedule,
8108
+ detach: null
8109
+ };
8110
+ bindGeometryObserver(entry);
8111
+ geometryObservers.add(entry);
8079
8112
  return () => {
8113
+ geometryObservers.delete(entry);
8114
+ detachGeometryObserver(entry);
8080
8115
  if (frame && typeof cancelAnimationFrame === "function") cancelAnimationFrame(frame);
8081
8116
  for (const unsub of unsubs.splice(0)) try {
8082
8117
  unsub();
@@ -8250,6 +8285,28 @@ function createSuperDocUI(options) {
8250
8285
  return searchState;
8251
8286
  };
8252
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);
8253
8310
  const readSearchQueryError = (record) => {
8254
8311
  if (!record) return false;
8255
8312
  const queryError = record.queryError;
@@ -8401,11 +8458,14 @@ function createSuperDocUI(options) {
8401
8458
  },
8402
8459
  close: () => {
8403
8460
  searchRequestGeneration += 1;
8404
- const host = getHostSearch();
8405
- if (host && typeof host.clear === "function") safeCall(() => host.clear(), null);
8461
+ if (releaseActiveSearchSession) releaseSearchSession();
8406
8462
  else {
8407
- const editSearch = getEditCommandSearch();
8408
- 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
+ }
8409
8469
  }
8410
8470
  searchState = {
8411
8471
  ...SEARCH_UNAVAILABLE_SLICE,
@@ -8433,6 +8493,9 @@ function createSuperDocUI(options) {
8433
8493
  open: true,
8434
8494
  reason: void 0
8435
8495
  });
8496
+ releaseActiveSearchSession = () => {
8497
+ editSearch.query({ query: "" });
8498
+ };
8436
8499
  const result = safeCall(() => editSearch.query({
8437
8500
  query,
8438
8501
  caseSensitive,
@@ -8473,6 +8536,9 @@ function createSuperDocUI(options) {
8473
8536
  open: true,
8474
8537
  reason: void 0
8475
8538
  });
8539
+ releaseActiveSearchSession = () => {
8540
+ if (typeof host.clear === "function") host.clear();
8541
+ };
8476
8542
  applyHostSearchResult(safeCall(() => host.setSession(query, {
8477
8543
  caseSensitive,
8478
8544
  includeDeletedText,
@@ -8482,6 +8548,11 @@ function createSuperDocUI(options) {
8482
8548
  if (query.length > 0 && searchState.total === 0 && searchState.reason !== SUPERDOC_UI_REASONS.searchInvalidPattern) {
8483
8549
  const editSearch = getEditCommandSearch();
8484
8550
  if (editSearch && typeof editSearch.query === "function" && typeof editSearch.getState === "function") {
8551
+ const releaseHostSession = releaseActiveSearchSession;
8552
+ releaseActiveSearchSession = () => {
8553
+ releaseHostSession?.();
8554
+ editSearch.query({ query: "" });
8555
+ };
8485
8556
  const commandResult = safeCall(() => editSearch.query({
8486
8557
  query,
8487
8558
  caseSensitive,
@@ -8746,6 +8817,8 @@ function createSuperDocUI(options) {
8746
8817
  currentDocumentSelectionSource = null;
8747
8818
  listeners.clear();
8748
8819
  searchListeners.clear();
8820
+ painterCaptureEpoch += 1;
8821
+ painterModeListeners.clear();
8749
8822
  customCommands.clear();
8750
8823
  };
8751
8824
  const controller = {
@@ -8769,12 +8842,14 @@ function createSuperDocUI(options) {
8769
8842
  styles,
8770
8843
  formatPainter: {
8771
8844
  setPointerSelecting(flag) {
8845
+ if (disposed) return;
8772
8846
  painter = {
8773
8847
  ...painter,
8774
8848
  pointerSelecting: flag
8775
8849
  };
8776
8850
  },
8777
8851
  notifyPointerUp() {
8852
+ if (disposed) return;
8778
8853
  painter = {
8779
8854
  ...painter,
8780
8855
  pointerSelecting: false
@@ -8782,12 +8857,14 @@ function createSuperDocUI(options) {
8782
8857
  maybeApply();
8783
8858
  },
8784
8859
  setKeyboardSelecting(flag) {
8860
+ if (disposed) return;
8785
8861
  painter = {
8786
8862
  ...painter,
8787
8863
  keyboardSelecting: flag
8788
8864
  };
8789
8865
  },
8790
8866
  notifyKeyUp() {
8867
+ if (disposed) return;
8791
8868
  painter = {
8792
8869
  ...painter,
8793
8870
  keyboardSelecting: false
@@ -8795,9 +8872,11 @@ function createSuperDocUI(options) {
8795
8872
  maybeApply();
8796
8873
  },
8797
8874
  cancel() {
8875
+ if (disposed) return;
8798
8876
  exitFormatPainter();
8799
8877
  },
8800
8878
  onModeChange(cb) {
8879
+ if (disposed) return () => {};
8801
8880
  painterModeListeners.add(cb);
8802
8881
  return () => painterModeListeners.delete(cb);
8803
8882
  }
@@ -8944,4 +9023,4 @@ var DEFAULT_FONT_SIZE_OPTIONS = [
8944
9023
  function commandIsActive(descriptor, selection) {
8945
9024
  return descriptor.activeMark ? selection.activeMarks.includes(descriptor.activeMark) : false;
8946
9025
  }
8947
- 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.45",
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.45",
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;
@@ -1,27 +1,30 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("../chunks/rolldown-runtime-_dR15c8t.cjs");
3
- const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DDxbK_M7.cjs");
3
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-6FUZ9d-y.cjs");
4
4
  let react = require("react");
5
5
  var SuperDocUIContext = (0, react.createContext)(null);
6
+ function disposeOwnedUi(ref) {
7
+ const ui = ref.current;
8
+ if (!ui) return;
9
+ ui.destroy();
10
+ ref.current = null;
11
+ }
6
12
  function SuperDocUIProvider(props) {
7
13
  const [ui, setUi] = (0, react.useState)(null);
8
14
  const [host, setHost] = (0, react.useState)(null);
9
- const uiRef = (0, react.useRef)(null);
15
+ const ownedUiRef = (0, react.useRef)(null);
10
16
  const setSuperDoc = (0, react.useCallback)((superdoc) => {
11
- if (uiRef.current) uiRef.current.destroy();
12
- const next = require_create_super_doc_ui.createSuperDocUI({ superdoc });
13
- uiRef.current = next;
14
- setUi(next);
17
+ const hostUi = superdoc.ui;
18
+ disposeOwnedUi(ownedUiRef);
19
+ if (hostUi) setUi(hostUi);
20
+ else {
21
+ const created = require_create_super_doc_ui.createSuperDocUI({ superdoc });
22
+ ownedUiRef.current = created;
23
+ setUi(created);
24
+ }
15
25
  setHost(superdoc);
16
26
  }, []);
17
- (0, react.useEffect)(() => {
18
- return () => {
19
- if (uiRef.current) {
20
- uiRef.current.destroy();
21
- uiRef.current = null;
22
- }
23
- };
24
- }, []);
27
+ (0, react.useEffect)(() => () => disposeOwnedUi(ownedUiRef), []);
25
28
  const value = {
26
29
  ui,
27
30
  host,
@@ -1,25 +1,28 @@
1
- import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-BTOlZen9.es.js";
1
+ import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-DCFTmVRK.es.js";
2
2
  import { createContext, createElement, useCallback, useContext, useEffect, useRef, useState } from "react";
3
3
  var SuperDocUIContext = createContext(null);
4
+ function disposeOwnedUi(ref) {
5
+ const ui = ref.current;
6
+ if (!ui) return;
7
+ ui.destroy();
8
+ ref.current = null;
9
+ }
4
10
  function SuperDocUIProvider(props) {
5
11
  const [ui, setUi] = useState(null);
6
12
  const [host, setHost] = useState(null);
7
- const uiRef = useRef(null);
13
+ const ownedUiRef = useRef(null);
8
14
  const setSuperDoc = useCallback((superdoc) => {
9
- if (uiRef.current) uiRef.current.destroy();
10
- const next = createSuperDocUI({ superdoc });
11
- uiRef.current = next;
12
- setUi(next);
15
+ const hostUi = superdoc.ui;
16
+ disposeOwnedUi(ownedUiRef);
17
+ if (hostUi) setUi(hostUi);
18
+ else {
19
+ const created = createSuperDocUI({ superdoc });
20
+ ownedUiRef.current = created;
21
+ setUi(created);
22
+ }
13
23
  setHost(superdoc);
14
24
  }, []);
15
- useEffect(() => {
16
- return () => {
17
- if (uiRef.current) {
18
- uiRef.current.destroy();
19
- uiRef.current = null;
20
- }
21
- };
22
- }, []);
25
+ useEffect(() => () => disposeOwnedUi(ownedUiRef), []);
23
26
  const value = {
24
27
  ui,
25
28
  host,
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DDxbK_M7.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-6FUZ9d-y.cjs");
3
3
  exports.BUILT_IN_COMMAND_IDS = require_create_super_doc_ui.BUILT_IN_COMMAND_IDS;
4
4
  exports.createSuperDocUI = require_create_super_doc_ui.createSuperDocUI;
5
5
  exports.shallowEqual = require_create_super_doc_ui.shallowEqual;
@@ -1,2 +1,2 @@
1
- import { n as BUILT_IN_COMMAND_IDS, r as shallowEqual, t as createSuperDocUI } from "../chunks/create-super-doc-ui-BTOlZen9.es.js";
1
+ import { n as shallowEqual, r as BUILT_IN_COMMAND_IDS, t as createSuperDocUI } from "../chunks/create-super-doc-ui-DCFTmVRK.es.js";
2
2
  export { BUILT_IN_COMMAND_IDS, createSuperDocUI, shallowEqual };