@superdoc-dev/cli 0.15.0 → 0.16.0-next.1

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 (2) hide show
  1. package/dist/index.js +523 -235
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -68110,7 +68110,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
68110
68110
  emptyOptions2 = {};
68111
68111
  });
68112
68112
 
68113
- // ../../packages/superdoc/dist/chunks/SuperConverter-C6hKp29w.es.js
68113
+ // ../../packages/superdoc/dist/chunks/SuperConverter-DHtZjY65.es.js
68114
68114
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
68115
68115
  const fieldValue = extension$1.config[field];
68116
68116
  if (typeof fieldValue === "function")
@@ -98267,7 +98267,33 @@ function importCommentData({ docx, editor, converter }) {
98267
98267
  function isReplacementPair(previous$1, current) {
98268
98268
  return previous$1.type !== current.type && previous$1.author === current.author && previous$1.date === current.date;
98269
98269
  }
98270
- function assignInternalId(element, idMap, context, insideTrackedChange) {
98270
+ function trackedChangeEntryFromElement(element) {
98271
+ return {
98272
+ type: element.name,
98273
+ author: element.attributes?.["w:author"] ?? "",
98274
+ date: element.attributes?.["w:date"] ?? ""
98275
+ };
98276
+ }
98277
+ function findNextSiblingTrackedChange(elements, startIndex) {
98278
+ if (!Array.isArray(elements))
98279
+ return null;
98280
+ for (let i$1 = startIndex;i$1 < elements.length; i$1 += 1) {
98281
+ const element = elements[i$1];
98282
+ if (TRACKED_CHANGE_NAMES.has(element?.name))
98283
+ return trackedChangeEntryFromElement(element);
98284
+ if (!PAIRING_TRANSPARENT_NAMES.has(element?.name))
98285
+ return null;
98286
+ }
98287
+ return null;
98288
+ }
98289
+ function isChildReplacementInsideDeletion(beforePrevious, previous$1, current, next) {
98290
+ if (!isReplacementPair(previous$1, current))
98291
+ return false;
98292
+ const touchesDifferentAuthorDeletionBefore = beforePrevious?.type === "w:del" && beforePrevious.author !== previous$1.author;
98293
+ const touchesDifferentAuthorDeletionAfter = next?.type === "w:del" && next.author !== previous$1.author;
98294
+ return touchesDifferentAuthorDeletionBefore || touchesDifferentAuthorDeletionAfter;
98295
+ }
98296
+ function assignInternalId(element, idMap, context, insideTrackedChange, nextTrackedChange = null) {
98271
98297
  const wordId = String(element.attributes?.["w:id"] ?? "");
98272
98298
  if (!wordId)
98273
98299
  return;
@@ -98276,18 +98302,18 @@ function assignInternalId(element, idMap, context, insideTrackedChange) {
98276
98302
  idMap.set(wordId, v4_default());
98277
98303
  return;
98278
98304
  }
98279
- const current = {
98280
- type: element.name,
98281
- author: element.attributes?.["w:author"] ?? "",
98282
- date: element.attributes?.["w:date"] ?? ""
98283
- };
98284
- if (context.replacements === "paired" && context.lastTrackedChange && isReplacementPair(context.lastTrackedChange, current)) {
98305
+ const current = trackedChangeEntryFromElement(element);
98306
+ const shouldPair = context.replacements === "paired";
98307
+ const shouldKeepChildSides = context.lastTrackedChange && isChildReplacementInsideDeletion(context.beforeLastTrackedChange, context.lastTrackedChange, current, nextTrackedChange);
98308
+ if (shouldPair && context.lastTrackedChange && !shouldKeepChildSides && isReplacementPair(context.lastTrackedChange, current)) {
98285
98309
  if (!idMap.has(wordId))
98286
98310
  idMap.set(wordId, context.lastTrackedChange.internalId);
98287
98311
  context.lastTrackedChange = null;
98312
+ context.beforeLastTrackedChange = null;
98288
98313
  } else {
98289
98314
  const internalId = idMap.get(wordId) ?? v4_default();
98290
98315
  idMap.set(wordId, internalId);
98316
+ context.beforeLastTrackedChange = context.lastTrackedChange;
98291
98317
  context.lastTrackedChange = {
98292
98318
  ...current,
98293
98319
  internalId
@@ -98297,20 +98323,25 @@ function assignInternalId(element, idMap, context, insideTrackedChange) {
98297
98323
  function walkElements(elements, idMap, context, insideTrackedChange = false) {
98298
98324
  if (!Array.isArray(elements))
98299
98325
  return;
98300
- for (const element of elements)
98326
+ for (let index2 = 0;index2 < elements.length; index2 += 1) {
98327
+ const element = elements[index2];
98301
98328
  if (TRACKED_CHANGE_NAMES.has(element.name)) {
98302
- assignInternalId(element, idMap, context, insideTrackedChange);
98329
+ assignInternalId(element, idMap, context, insideTrackedChange, findNextSiblingTrackedChange(elements, index2 + 1));
98303
98330
  if (element.elements)
98304
98331
  walkElements(element.elements, idMap, {
98332
+ beforeLastTrackedChange: null,
98305
98333
  lastTrackedChange: null,
98306
98334
  replacements: context.replacements
98307
98335
  }, true);
98308
98336
  } else {
98309
- if (!PAIRING_TRANSPARENT_NAMES.has(element.name))
98337
+ if (!PAIRING_TRANSPARENT_NAMES.has(element.name)) {
98310
98338
  context.lastTrackedChange = null;
98339
+ context.beforeLastTrackedChange = null;
98340
+ }
98311
98341
  if (element.elements)
98312
98342
  walkElements(element.elements, idMap, context, insideTrackedChange);
98313
98343
  }
98344
+ }
98314
98345
  }
98315
98346
  function buildTrackedChangeIdMapForPart(part, options = {}) {
98316
98347
  const root2 = part?.elements?.[0];
@@ -98319,6 +98350,7 @@ function buildTrackedChangeIdMapForPart(part, options = {}) {
98319
98350
  const replacements = options.replacements === "independent" ? "independent" : "paired";
98320
98351
  const idMap = /* @__PURE__ */ new Map;
98321
98352
  walkElements(root2.elements, idMap, {
98353
+ beforeLastTrackedChange: null,
98322
98354
  lastTrackedChange: null,
98323
98355
  replacements
98324
98356
  });
@@ -101851,12 +101883,21 @@ function getInlineIndex(editor) {
101851
101883
  function clearIndexCache(editor) {
101852
101884
  cacheByEditor.delete(editor);
101853
101885
  }
101886
+ function isVisibleTextModel(options) {
101887
+ return options?.textModel === "visible";
101888
+ }
101889
+ function hasTrackDeleteMark(node3) {
101890
+ return node3.marks?.some((mark) => mark.type.name === "trackDelete") ?? false;
101891
+ }
101892
+ function shouldSkipTextNode(node3, options) {
101893
+ return isVisibleTextModel(options) && hasTrackDeleteMark(node3);
101894
+ }
101854
101895
  function resolveSegmentPosition(targetOffset, segmentStart, segmentLength, docFrom, docTo) {
101855
101896
  if (segmentLength <= 1)
101856
101897
  return targetOffset <= segmentStart ? docFrom : docTo;
101857
101898
  return docFrom + (targetOffset - segmentStart);
101858
101899
  }
101859
- function pmPositionToTextOffset(blockNode, blockPos, pmPos) {
101900
+ function pmPositionToTextOffset(blockNode, blockPos, pmPos, options) {
101860
101901
  const contentStart = blockPos + 1;
101861
101902
  if (pmPos <= contentStart)
101862
101903
  return 0;
@@ -101867,7 +101908,13 @@ function pmPositionToTextOffset(blockNode, blockPos, pmPos) {
101867
101908
  return;
101868
101909
  if (node3.isText) {
101869
101910
  const text$2 = node3.text ?? "";
101870
- if (pmPos >= docPos + text$2.length)
101911
+ const endPos = docPos + text$2.length;
101912
+ if (shouldSkipTextNode(node3, options)) {
101913
+ if (pmPos < endPos)
101914
+ done = true;
101915
+ return;
101916
+ }
101917
+ if (pmPos >= endPos)
101871
101918
  offset += text$2.length;
101872
101919
  else {
101873
101920
  offset += Math.max(0, pmPos - docPos);
@@ -101907,10 +101954,12 @@ function pmPositionToTextOffset(blockNode, blockPos, pmPos) {
101907
101954
  visitContent(blockNode, contentStart);
101908
101955
  return offset;
101909
101956
  }
101910
- function computeTextContentLength(blockNode) {
101957
+ function computeTextContentLength(blockNode, options) {
101911
101958
  let length3 = 0;
101912
101959
  const walk = (node3) => {
101913
101960
  if (node3.isText) {
101961
+ if (shouldSkipTextNode(node3, options))
101962
+ return;
101914
101963
  length3 += (node3.text ?? "").length;
101915
101964
  return;
101916
101965
  }
@@ -101937,7 +101986,7 @@ function computeTextContentLength(blockNode) {
101937
101986
  }
101938
101987
  return length3;
101939
101988
  }
101940
- function resolveTextRangeInBlock(blockNode, blockPos, range) {
101989
+ function resolveTextRangeInBlock(blockNode, blockPos, range, options) {
101941
101990
  if (range.start < 0 || range.end < range.start)
101942
101991
  return null;
101943
101992
  let offset = 0;
@@ -101969,7 +102018,7 @@ function resolveTextRangeInBlock(blockNode, blockPos, range) {
101969
102018
  const walkNode$1 = (node3, docPos) => {
101970
102019
  if (node3.isText) {
101971
102020
  const text$2 = node3.text ?? "";
101972
- if (text$2.length > 0)
102021
+ if (text$2.length > 0 && !shouldSkipTextNode(node3, options))
101973
102022
  advanceSegment(text$2.length, docPos, docPos + text$2.length);
101974
102023
  return;
101975
102024
  }
@@ -101996,6 +102045,39 @@ function resolveTextRangeInBlock(blockNode, blockPos, range) {
101996
102045
  to: toPos
101997
102046
  };
101998
102047
  }
102048
+ function textContentInBlock(blockNode, options) {
102049
+ let text$2 = "";
102050
+ const walkNode$1 = (node3) => {
102051
+ if (node3.isText) {
102052
+ if (!shouldSkipTextNode(node3, options))
102053
+ text$2 += node3.text ?? "";
102054
+ return;
102055
+ }
102056
+ if (node3.isLeaf) {
102057
+ text$2 += "";
102058
+ return;
102059
+ }
102060
+ let isFirstChild$1 = true;
102061
+ for (let i$1 = 0;i$1 < node3.childCount; i$1++) {
102062
+ const child = node3.child(i$1);
102063
+ if (child.isBlock && !isFirstChild$1)
102064
+ text$2 += `
102065
+ `;
102066
+ walkNode$1(child);
102067
+ isFirstChild$1 = false;
102068
+ }
102069
+ };
102070
+ let isFirstChild = true;
102071
+ for (let i$1 = 0;i$1 < blockNode.childCount; i$1++) {
102072
+ const child = blockNode.child(i$1);
102073
+ if (child.isBlock && !isFirstChild)
102074
+ text$2 += `
102075
+ `;
102076
+ walkNode$1(child);
102077
+ isFirstChild = false;
102078
+ }
102079
+ return text$2;
102080
+ }
101999
102081
  function buildTextWithTabs(schema, text$2, marks, opts = {}) {
102000
102082
  if (!text$2.includes("\t"))
102001
102083
  return schema.text(text$2, marks);
@@ -102019,7 +102101,7 @@ function parentAllowsNodeAt(tr, absPos, nodeType) {
102019
102101
  return true;
102020
102102
  return contentMatch.matchType(nodeType) != null;
102021
102103
  }
102022
- function textBetweenWithTabs(doc$2, from5, to, blockSeparator, leafFallback) {
102104
+ function textBetweenWithTabs(doc$2, from5, to, blockSeparator, leafFallback, options = {}) {
102023
102105
  const anyDoc = doc$2;
102024
102106
  if (typeof anyDoc.nodesBetween !== "function") {
102025
102107
  if (typeof anyDoc.textBetween === "function")
@@ -102040,6 +102122,8 @@ function textBetweenWithTabs(doc$2, from5, to, blockSeparator, leafFallback) {
102040
102122
  return false;
102041
102123
  }
102042
102124
  if (node3.isText) {
102125
+ if (options.textModel === "visible" && node3.marks?.some((mark) => mark.type.name === "trackDelete"))
102126
+ return false;
102043
102127
  const start = Math.max(from5, pos) - pos;
102044
102128
  const end = Math.min(to, pos + node3.nodeSize) - pos;
102045
102129
  const text$2 = typeof node3.text === "string" ? node3.text : "".repeat(node3.nodeSize);
@@ -102108,7 +102192,7 @@ function resolveTextTarget(editor, target) {
102108
102192
  const block = matches$1[0];
102109
102193
  if (!block)
102110
102194
  return null;
102111
- return resolveTextRangeInBlock(block.node, block.pos, target.range);
102195
+ return resolveTextRangeInBlock(block.node, block.pos, target.range, { textModel: "visible" });
102112
102196
  }
102113
102197
  function resolveInlineInsertPosition(editor, at, operationName) {
102114
102198
  const firstSegment = at.segments[0];
@@ -102147,11 +102231,11 @@ function resolveDefaultInsertTarget(editor) {
102147
102231
  for (let i$1 = index2.candidates.length - 1;i$1 >= 0; i$1--) {
102148
102232
  const candidate = index2.candidates[i$1];
102149
102233
  if (topLevelPositions.has(candidate.pos) && isTextBlockCandidate(candidate)) {
102150
- const textLength = computeTextContentLength(candidate.node);
102234
+ const textLength = computeTextContentLength(candidate.node, { textModel: "visible" });
102151
102235
  const range = resolveTextRangeInBlock(candidate.node, candidate.pos, {
102152
102236
  start: textLength,
102153
102237
  end: textLength
102154
- });
102238
+ }, { textModel: "visible" });
102155
102239
  if (!range)
102156
102240
  continue;
102157
102241
  return {
@@ -105112,7 +105196,7 @@ function getTextAdapter(editor, input) {
105112
105196
  const doc$2 = resolveStoryRuntime(editor, input.in).editor.state.doc;
105113
105197
  return textBetweenWithTabs(doc$2, 0, doc$2.content.size, `
105114
105198
  `, `
105115
- `);
105199
+ `, { textModel: "visible" });
105116
105200
  }
105117
105201
  function getRawTrackedMarks(editor) {
105118
105202
  try {
@@ -123831,7 +123915,7 @@ var isRegExp = (value) => {
123831
123915
  if (id2)
123832
123916
  return trackedChanges.filter(({ mark }) => mark.attrs.id === id2);
123833
123917
  return trackedChanges;
123834
- }, groupedCache, SDT_NODE_NAMES, SDT_BLOCK_NAME = "structuredContentBlock", SDT_INLINE_NAME = "structuredContent", SDT_NODE_TYPES, VALID_CONTROL_TYPES, VALID_LOCK_MODES2, VALID_APPEARANCES, FIELD_LIKE_SDT_TYPES, liveDocumentCountsCache, BIBLIOGRAPHY_NAMESPACE_URI = "http://schemas.openxmlformats.org/officeDocument/2006/bibliography", CUSTOM_XML_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml", CUSTOM_XML_PROPS_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps", DEFAULT_SELECTED_STYLE = "/APA.XSL", DEFAULT_STYLE_NAME = "APA", DEFAULT_VERSION = "6", API_TO_OOXML_SOURCE_TYPE, OOXML_TO_API_SOURCE_TYPE, SIMPLE_FIELD_TO_XML_TAG, XML_TAG_TO_SIMPLE_FIELD, import_lib2, FONT_FAMILY_FALLBACKS, DEFAULT_GENERIC_FALLBACK = "sans-serif", DEFAULT_FONT_SIZE_PT = 10, CURRENT_APP_VERSION = "1.37.0", SUPERDOC_DOCUMENT_ORIGIN_PROPERTY = "SuperdocDocumentOrigin", STORED_DOCUMENT_ORIGINS, collectRunDefaultProperties = (runProps, { allowOverrideTypeface = true, allowOverrideSize = true, themeResolver, state }) => {
123918
+ }, groupedCache, SDT_NODE_NAMES, SDT_BLOCK_NAME = "structuredContentBlock", SDT_INLINE_NAME = "structuredContent", SDT_NODE_TYPES, VALID_CONTROL_TYPES, VALID_LOCK_MODES2, VALID_APPEARANCES, FIELD_LIKE_SDT_TYPES, liveDocumentCountsCache, BIBLIOGRAPHY_NAMESPACE_URI = "http://schemas.openxmlformats.org/officeDocument/2006/bibliography", CUSTOM_XML_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml", CUSTOM_XML_PROPS_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps", DEFAULT_SELECTED_STYLE = "/APA.XSL", DEFAULT_STYLE_NAME = "APA", DEFAULT_VERSION = "6", API_TO_OOXML_SOURCE_TYPE, OOXML_TO_API_SOURCE_TYPE, SIMPLE_FIELD_TO_XML_TAG, XML_TAG_TO_SIMPLE_FIELD, import_lib2, FONT_FAMILY_FALLBACKS, DEFAULT_GENERIC_FALLBACK = "sans-serif", DEFAULT_FONT_SIZE_PT = 10, CURRENT_APP_VERSION = "1.38.0", SUPERDOC_DOCUMENT_ORIGIN_PROPERTY = "SuperdocDocumentOrigin", STORED_DOCUMENT_ORIGINS, collectRunDefaultProperties = (runProps, { allowOverrideTypeface = true, allowOverrideSize = true, themeResolver, state }) => {
123835
123919
  if (!runProps?.elements?.length || !state)
123836
123920
  return;
123837
123921
  const fontsNode = runProps.elements.find((el) => el.name === "w:rFonts");
@@ -123865,7 +123949,7 @@ var isRegExp = (value) => {
123865
123949
  state.kern = kernNode.attributes["w:val"];
123866
123950
  }
123867
123951
  }, SuperConverter;
123868
- var init_SuperConverter_C6hKp29w_es = __esm(() => {
123952
+ var init_SuperConverter_DHtZjY65_es = __esm(() => {
123869
123953
  init_rolldown_runtime_Bg48TavK_es();
123870
123954
  init_jszip_C49i9kUs_es();
123871
123955
  init_xml_js_CqGKpaft_es();
@@ -162181,7 +162265,7 @@ var init_SuperConverter_C6hKp29w_es = __esm(() => {
162181
162265
  };
162182
162266
  });
162183
162267
 
162184
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-ISx0N5AS.es.js
162268
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-lxRAue2X.es.js
162185
162269
  function parseSizeUnit(val = "0") {
162186
162270
  const length3 = val.toString() || "0";
162187
162271
  const value = Number.parseFloat(length3);
@@ -163316,7 +163400,7 @@ function applyDirectiveToMarks(marks, markKey2, directive, markType) {
163316
163400
  return otherMarks;
163317
163401
  }
163318
163402
  }
163319
- function captureRunsInRange(editor, blockPos, from5, to) {
163403
+ function captureRunsInRange(editor, blockPos, from5, to, options) {
163320
163404
  const blockNode = editor.state.doc.nodeAt(blockPos);
163321
163405
  if (!blockNode || from5 < 0 || to < from5 || from5 === to)
163322
163406
  return {
@@ -163341,9 +163425,12 @@ function captureRunsInRange(editor, blockPos, from5, to) {
163341
163425
  if (node3.isText) {
163342
163426
  const text4 = node3.text ?? "";
163343
163427
  if (text4.length > 0) {
163428
+ const marks = Array.isArray(node3.marks) ? node3.marks : [];
163429
+ if (options?.textModel === "visible" && marks.some((mark) => mark.type.name === "trackDelete"))
163430
+ return;
163344
163431
  const start = offset;
163345
163432
  const end = offset + text4.length;
163346
- maybePushRun(start, end, Array.isArray(node3.marks) ? node3.marks : []);
163433
+ maybePushRun(start, end, marks);
163347
163434
  offset = end;
163348
163435
  }
163349
163436
  return;
@@ -163624,6 +163711,12 @@ function applySetMarksToResolved(editor, existingMarks, setMarks) {
163624
163711
  }
163625
163712
  return marks;
163626
163713
  }
163714
+ function getCandidateText(editor, candidate, options) {
163715
+ if (candidate.node.childCount > 0)
163716
+ return textContentInBlock(candidate.node, options);
163717
+ return editor.state.doc.textBetween(candidate.pos + 1, candidate.end - 1, `
163718
+ `, "");
163719
+ }
163627
163720
  function resolveUnknownBlockId(attrs) {
163628
163721
  if (!attrs)
163629
163722
  return;
@@ -163637,7 +163730,38 @@ function getAddressStartPos(editor, index2, address2) {
163637
163730
  return findBlockById(index2, address2)?.pos ?? Number.MAX_SAFE_INTEGER;
163638
163731
  return findInlineByAnchor(getInlineIndex(editor), address2)?.pos ?? Number.MAX_SAFE_INTEGER;
163639
163732
  }
163640
- function buildTextContext(editor, address2, matchFrom, matchTo, textRanges) {
163733
+ function buildTextContext(editor, address2, matchFrom, matchTo, textRanges, options) {
163734
+ if (textRanges?.length) {
163735
+ const index2 = getBlockIndex(editor);
163736
+ const firstRange = textRanges[0];
163737
+ const lastRange = textRanges[textRanges.length - 1];
163738
+ const firstBlock = index2.candidates.find((candidate) => candidate.nodeId === firstRange.blockId);
163739
+ const lastBlock = index2.candidates.find((candidate) => candidate.nodeId === lastRange.blockId);
163740
+ if (firstBlock && lastBlock) {
163741
+ const matchText = textRanges.map((range) => {
163742
+ const block = index2.candidates.find((candidate) => candidate.nodeId === range.blockId);
163743
+ if (!block)
163744
+ return "";
163745
+ return getCandidateText(editor, block, options).slice(range.range.start, range.range.end);
163746
+ }).join(`
163747
+ `);
163748
+ const firstText = getCandidateText(editor, firstBlock, options);
163749
+ const lastText = getCandidateText(editor, lastBlock, options);
163750
+ const leftContext = firstText.slice(Math.max(0, firstRange.range.start - SNIPPET_PADDING), firstRange.range.start);
163751
+ const snippet$1 = `${leftContext}${matchText}${lastText.slice(lastRange.range.end, lastRange.range.end + SNIPPET_PADDING)}`.replace(/ {2,}/g, " ");
163752
+ const prefix$1 = leftContext.replace(/ {2,}/g, " ");
163753
+ const normalizedMatch = matchText.replace(/ {2,}/g, " ");
163754
+ return {
163755
+ address: address2,
163756
+ snippet: snippet$1,
163757
+ highlightRange: {
163758
+ start: prefix$1.length,
163759
+ end: prefix$1.length + normalizedMatch.length
163760
+ },
163761
+ textRanges
163762
+ };
163763
+ }
163764
+ }
163641
163765
  const docSize = editor.state.doc.content.size;
163642
163766
  const snippetFrom = Math.max(0, matchFrom - SNIPPET_PADDING);
163643
163767
  const snippetTo = Math.min(docSize, matchTo + SNIPPET_PADDING);
@@ -163656,14 +163780,14 @@ function buildTextContext(editor, address2, matchFrom, matchTo, textRanges) {
163656
163780
  textRanges: textRanges?.length ? textRanges : undefined
163657
163781
  };
163658
163782
  }
163659
- function toTextAddress$1(editor, block, range) {
163783
+ function toTextAddress$1(editor, block, range, options) {
163660
163784
  const blockStart = block.pos + 1;
163661
163785
  const blockEnd = block.end - 1;
163662
163786
  if (range.from < blockStart || range.to > blockEnd)
163663
163787
  return;
163664
- const start = editor.state.doc.textBetween(blockStart, range.from, `
163788
+ const start = block.node.childCount > 0 ? pmPositionToTextOffset(block.node, block.pos, range.from, options) : editor.state.doc.textBetween(blockStart, range.from, `
163665
163789
  `, "").length;
163666
- const end = editor.state.doc.textBetween(blockStart, range.to, `
163790
+ const end = block.node.childCount > 0 ? pmPositionToTextOffset(block.node, block.pos, range.to, options) : editor.state.doc.textBetween(blockStart, range.to, `
163667
163791
  `, "").length;
163668
163792
  return {
163669
163793
  kind: "text",
@@ -163742,7 +163866,7 @@ function buildSearchPattern(selector, diagnostics) {
163742
163866
  const flags = selector.caseSensitive ? "g" : "gi";
163743
163867
  return new RegExp(flexible, flags);
163744
163868
  }
163745
- function executeTextSelector(editor, index2, query2, diagnostics) {
163869
+ function executeTextSelector(editor, index2, query2, diagnostics, options = {}) {
163746
163870
  if (query2.select.type !== "text") {
163747
163871
  addDiagnostic(diagnostics, `Text strategy received a non-text selector (type="${query2.select.type}").`);
163748
163872
  return {
@@ -163770,16 +163894,20 @@ function executeTextSelector(editor, index2, query2, diagnostics) {
163770
163894
  matches: [],
163771
163895
  total: 0
163772
163896
  };
163773
- const rawResult = requireEditorCommand(editor.commands?.search, "find (search)")(pattern, {
163897
+ const search2 = requireEditorCommand(editor.commands?.search, "find (search)");
163898
+ const searchModel = options.searchModel ?? "visible";
163899
+ const textOffsetOptions = { textModel: searchModel };
163900
+ pattern.lastIndex = 0;
163901
+ const rawResult = search2(pattern, {
163774
163902
  highlight: false,
163775
163903
  caseSensitive: selector.caseSensitive ?? false,
163776
163904
  maxMatches: Infinity,
163777
- searchModel: "visible"
163905
+ searchModel
163778
163906
  });
163779
163907
  if (!Array.isArray(rawResult))
163780
163908
  throw new DocumentApiAdapterError("CAPABILITY_UNAVAILABLE", "Editor search command returned an unexpected result format.");
163781
- const allMatches = rawResult;
163782
163909
  const scopeRange = scope.range;
163910
+ const allMatches = rawResult;
163783
163911
  const matches2 = scopeRange ? allMatches.filter((m) => m.from >= scopeRange.start && m.to <= scopeRange.end) : allMatches;
163784
163912
  const textBlocks = index2.candidates.filter(isTextBlockCandidate);
163785
163913
  const contexts = [];
@@ -163796,7 +163924,7 @@ function executeTextSelector(editor, index2, query2, diagnostics) {
163796
163924
  return;
163797
163925
  if (!source)
163798
163926
  source = block;
163799
- return toTextAddress$1(editor, block, range);
163927
+ return toTextAddress$1(editor, block, range, textOffsetOptions);
163800
163928
  }).filter((range) => Boolean(range));
163801
163929
  if (!source)
163802
163930
  source = findCandidateByPos(textBlocks, match.from) ?? findBlockByPos(index2, match.from);
@@ -163804,7 +163932,7 @@ function executeTextSelector(editor, index2, query2, diagnostics) {
163804
163932
  continue;
163805
163933
  const address2 = toBlockAddress(source);
163806
163934
  addresses.push(address2);
163807
- contexts.push(buildTextContext(editor, address2, match.from, match.to, textRanges));
163935
+ contexts.push(buildTextContext(editor, address2, match.from, match.to, textRanges, textOffsetOptions));
163808
163936
  }
163809
163937
  const paged = paginate(addresses, query2.offset, query2.limit);
163810
163938
  const pagedContexts = paginate(contexts, query2.offset, query2.limit).items;
@@ -163855,7 +163983,7 @@ function resolveTextPoint(editor, index2, point3) {
163855
163983
  const resolved = resolveTextRangeInBlock(candidate.node, candidate.pos, {
163856
163984
  start: point3.offset,
163857
163985
  end: point3.offset
163858
- });
163986
+ }, { textModel: "visible" });
163859
163987
  if (!resolved)
163860
163988
  throw new DocumentApiAdapterError("INVALID_TARGET", `Offset ${point3.offset} is out of range in block "${point3.blockId}".`, {
163861
163989
  field: "offset",
@@ -164062,11 +164190,11 @@ function validateInsertionContext(editor, index2, step3, stepIndex, anchorBlockI
164062
164190
  });
164063
164191
  }
164064
164192
  }
164065
- function resolveAbsoluteRange(editor, candidate, from5, to, stepId) {
164193
+ function resolveAbsoluteRange(editor, candidate, from5, to, stepId, options) {
164066
164194
  const resolved = resolveTextRangeInBlock(candidate.node, candidate.pos, {
164067
164195
  start: from5,
164068
164196
  end: to
164069
- });
164197
+ }, options);
164070
164198
  if (!resolved)
164071
164199
  throw planError("INVALID_INPUT", `text offset [${from5}, ${to}) out of range in block`, stepId);
164072
164200
  return {
@@ -164150,8 +164278,9 @@ function coalesceBlockRanges(stepId, blockId, ranges) {
164150
164278
  };
164151
164279
  }
164152
164280
  function buildRangeTarget(editor, step3, addr, candidate) {
164153
- const abs2 = resolveAbsoluteRange(editor, candidate, addr.from, addr.to, step3.id);
164154
- const capturedStyle = step3.op === "text.rewrite" || step3.op === "format.apply" ? captureRunsInRange(editor, candidate.pos, addr.from, addr.to) : undefined;
164281
+ const textOffsetOptions = { textModel: addr.textModel };
164282
+ const abs2 = resolveAbsoluteRange(editor, candidate, addr.from, addr.to, step3.id, textOffsetOptions);
164283
+ const capturedStyle = step3.op === "text.rewrite" || step3.op === "format.apply" ? captureRunsInRange(editor, candidate.pos, addr.from, addr.to, textOffsetOptions) : undefined;
164155
164284
  return {
164156
164285
  kind: "range",
164157
164286
  stepId: step3.id,
@@ -164166,7 +164295,7 @@ function buildRangeTarget(editor, step3, addr, candidate) {
164166
164295
  capturedStyle
164167
164296
  };
164168
164297
  }
164169
- function buildSpanTarget(editor, index2, step3, segments, matchId) {
164298
+ function buildSpanTarget(editor, index2, step3, segments, matchId, textModel = "visible") {
164170
164299
  validateSegmentOrder(editor, index2, segments, step3.id);
164171
164300
  const compiledSegments = [];
164172
164301
  const capturedStyles = [];
@@ -164175,7 +164304,8 @@ function buildSpanTarget(editor, index2, step3, segments, matchId) {
164175
164304
  const candidate = index2.candidates.find((c) => c.nodeId === seg.blockId);
164176
164305
  if (!candidate)
164177
164306
  throw planError("INVALID_INPUT", `block "${seg.blockId}" not found for span segment`, step3.id);
164178
- const abs2 = resolveAbsoluteRange(editor, candidate, seg.from, seg.to, step3.id);
164307
+ const textOffsetOptions = { textModel };
164308
+ const abs2 = resolveAbsoluteRange(editor, candidate, seg.from, seg.to, step3.id, textOffsetOptions);
164179
164309
  compiledSegments.push({
164180
164310
  blockId: seg.blockId,
164181
164311
  from: seg.from,
@@ -164183,10 +164313,10 @@ function buildSpanTarget(editor, index2, step3, segments, matchId) {
164183
164313
  absFrom: abs2.absFrom,
164184
164314
  absTo: abs2.absTo
164185
164315
  });
164186
- const blockText = getBlockText(editor, candidate);
164316
+ const blockText = getBlockText(editor, candidate, textOffsetOptions);
164187
164317
  textParts.push(blockText.slice(seg.from, seg.to));
164188
164318
  if (step3.op === "text.rewrite" || step3.op === "format.apply")
164189
- capturedStyles.push(captureRunsInRange(editor, candidate.pos, seg.from, seg.to));
164319
+ capturedStyles.push(captureRunsInRange(editor, candidate.pos, seg.from, seg.to, textOffsetOptions));
164190
164320
  }
164191
164321
  return {
164192
164322
  kind: "span",
@@ -164224,12 +164354,14 @@ function validateSegmentOrder(_editor, index2, segments, stepId) {
164224
164354
  }
164225
164355
  }
164226
164356
  function resolveTextSelector(editor, index2, selector, within, stepId, options) {
164357
+ const textModel = options?.textModel ?? "visible";
164358
+ const textOffsetOptions = { textModel };
164227
164359
  if (selector.type === "text") {
164228
164360
  const result$1 = executeTextSelector(editor, index2, {
164229
164361
  select: selector,
164230
164362
  within,
164231
164363
  includeNodes: false
164232
- }, []);
164364
+ }, [], { searchModel: textModel });
164233
164365
  const addresses$1 = [];
164234
164366
  if (result$1.context)
164235
164367
  for (const ctx of result$1.context) {
@@ -164239,15 +164371,16 @@ function resolveTextSelector(editor, index2, selector, within, stepId, options)
164239
164371
  const candidate = index2.candidates.find((c) => c.nodeId === coalesced.blockId);
164240
164372
  if (!candidate)
164241
164373
  continue;
164242
- const matchText = getBlockText(editor, candidate).slice(coalesced.from, coalesced.to);
164243
- const captured = captureRunsInRange(editor, candidate.pos, coalesced.from, coalesced.to);
164374
+ const matchText = getBlockText(editor, candidate, textOffsetOptions).slice(coalesced.from, coalesced.to);
164375
+ const captured = captureRunsInRange(editor, candidate.pos, coalesced.from, coalesced.to, textOffsetOptions);
164244
164376
  addresses$1.push({
164245
164377
  blockId: coalesced.blockId,
164246
164378
  from: coalesced.from,
164247
164379
  to: coalesced.to,
164248
164380
  text: matchText,
164249
164381
  marks: captured.runs.length > 0 ? captured.runs[0].marks : [],
164250
- blockPos: candidate.pos
164382
+ blockPos: candidate.pos,
164383
+ textModel
164251
164384
  });
164252
164385
  }
164253
164386
  return { addresses: addresses$1 };
@@ -164266,14 +164399,15 @@ function resolveTextSelector(editor, index2, selector, within, stepId, options)
164266
164399
  if (!candidate)
164267
164400
  continue;
164268
164401
  if (isTextBlockCandidate(candidate)) {
164269
- const blockText = getBlockText(editor, candidate);
164402
+ const blockText = getBlockText(editor, candidate, textOffsetOptions);
164270
164403
  addresses.push({
164271
164404
  blockId: match.nodeId,
164272
164405
  from: 0,
164273
164406
  to: blockText.length,
164274
164407
  text: blockText,
164275
164408
  marks: [],
164276
- blockPos: candidate.pos
164409
+ blockPos: candidate.pos,
164410
+ textModel
164277
164411
  });
164278
164412
  } else
164279
164413
  addresses.push({
@@ -164282,12 +164416,15 @@ function resolveTextSelector(editor, index2, selector, within, stepId, options)
164282
164416
  to: 0,
164283
164417
  text: "",
164284
164418
  marks: [],
164285
- blockPos: candidate.pos
164419
+ blockPos: candidate.pos,
164420
+ textModel
164286
164421
  });
164287
164422
  }
164288
164423
  return { addresses };
164289
164424
  }
164290
- function getBlockText(editor, candidate) {
164425
+ function getBlockText(editor, candidate, options = { textModel: "visible" }) {
164426
+ if (candidate.node && candidate.node.childCount > 0)
164427
+ return textContentInBlock(candidate.node, options);
164291
164428
  const blockStart = candidate.pos + 1;
164292
164429
  const blockEnd = candidate.end - 1;
164293
164430
  return editor.state.doc.textBetween(blockStart, blockEnd, `
@@ -164323,12 +164460,13 @@ function resolveV3TextRef(editor, index2, step3, refData) {
164323
164460
  to: seg.to,
164324
164461
  text: matchText,
164325
164462
  marks: [],
164326
- blockPos: candidate.pos
164463
+ blockPos: candidate.pos,
164464
+ textModel: "visible"
164327
164465
  }, candidate);
164328
164466
  target.matchId = refData.matchId;
164329
164467
  return [target];
164330
164468
  }
164331
- return [buildSpanTarget(editor, index2, step3, segments, refData.matchId)];
164469
+ return [buildSpanTarget(editor, index2, step3, segments, refData.matchId, "visible")];
164332
164470
  }
164333
164471
  function resolveV4TextRef(editor, index2, step3, refData) {
164334
164472
  if (refData.scope === "node" && refData.node?.nodeId)
@@ -164361,13 +164499,14 @@ function resolveV4TextRef(editor, index2, step3, refData) {
164361
164499
  to: seg.to,
164362
164500
  text: matchText,
164363
164501
  marks: [],
164364
- blockPos: candidate.pos
164502
+ blockPos: candidate.pos,
164503
+ textModel: "visible"
164365
164504
  }, candidate);
164366
164505
  if (refData.matchId)
164367
164506
  target.matchId = refData.matchId;
164368
164507
  return [target];
164369
164508
  }
164370
- return [buildSpanTarget(editor, index2, step3, segments, refData.matchId ?? `v4:${step3.id}`)];
164509
+ return [buildSpanTarget(editor, index2, step3, segments, refData.matchId ?? `v4:${step3.id}`, "visible")];
164371
164510
  }
164372
164511
  function resolveTextRef(editor, index2, step3, ref3) {
164373
164512
  const decoded = decodeRef(ref3);
@@ -164394,7 +164533,8 @@ function resolveBlockRef(editor, index2, step3, ref3) {
164394
164533
  to: blockText.length,
164395
164534
  text: blockText,
164396
164535
  marks: [],
164397
- blockPos: candidate.pos
164536
+ blockPos: candidate.pos,
164537
+ textModel: "visible"
164398
164538
  }, candidate)];
164399
164539
  }
164400
164540
  function dispatchRefHandler(editor, index2, step3, ref3) {
@@ -164441,7 +164581,8 @@ function buildWholeBlockRangeTarget(editor, step3, candidate) {
164441
164581
  to: blockText.length,
164442
164582
  text: blockText,
164443
164583
  marks: [],
164444
- blockPos: candidate.pos
164584
+ blockPos: candidate.pos,
164585
+ textModel: "visible"
164445
164586
  }, candidate);
164446
164587
  }
164447
164588
  return {
@@ -164524,7 +164665,7 @@ function captureStyleAtAbsoluteRange(editor, absFrom, absTo) {
164524
164665
  isUniform: checkUniformity(allRuns)
164525
164666
  };
164526
164667
  }
164527
- function resolveStepTargets(editor, index2, step3) {
164668
+ function resolveStepTargets(editor, index2, step3, options = {}) {
164528
164669
  const where = step3.where;
164529
164670
  const refWhere = isRefWhere(where) ? where : undefined;
164530
164671
  const selectWhere = isSelectWhere(where) ? where : undefined;
@@ -164539,7 +164680,10 @@ function resolveStepTargets(editor, index2, step3) {
164539
164680
  targets = resolveRefTargets(editor, index2, step3, refWhere);
164540
164681
  else if (selectWhere) {
164541
164682
  const isStructuralOp = step3.op === "structural.insert" || step3.op === "structural.replace";
164542
- targets = resolveTextSelector(editor, index2, selectWhere.select, selectWhere.within, step3.id, { allBlockTypes: isStructuralOp }).addresses.map((addr) => {
164683
+ targets = resolveTextSelector(editor, index2, selectWhere.select, selectWhere.within, step3.id, {
164684
+ allBlockTypes: isStructuralOp,
164685
+ textModel: options.selectTextModel ?? "visible"
164686
+ }).addresses.map((addr) => {
164543
164687
  const candidate = index2.candidates.find((c) => c.nodeId === addr.blockId);
164544
164688
  if (!candidate)
164545
164689
  throw planError("TARGET_NOT_FOUND", `block "${addr.blockId}" not in index`, step3.id);
@@ -164804,7 +164948,7 @@ function assertSingleStoryKey(steps) {
164804
164948
  });
164805
164949
  }
164806
164950
  }
164807
- function compilePlan(editor, steps) {
164951
+ function compilePlan(editor, steps, options = {}) {
164808
164952
  if (steps.length > 200)
164809
164953
  throw planError("INVALID_INPUT", `plan contains ${steps.length} steps, maximum is 200`);
164810
164954
  const compiledRevision = getRevision(editor);
@@ -164835,7 +164979,7 @@ function compilePlan(editor, steps) {
164835
164979
  throw planError("INVALID_INPUT", `unknown step op "${step3.op}"`, step3.id);
164836
164980
  if (isCreateOp(step3.op))
164837
164981
  validateCreateStepPosition(step3);
164838
- const targets = resolveStepTargets(editor, index2, step3);
164982
+ const targets = resolveStepTargets(editor, index2, step3, options);
164839
164983
  if (isCreateOp(step3.op) && targets.length > 0) {
164840
164984
  const position2 = step3.args.position ?? "after";
164841
164985
  const anchorBlockId = resolveCreateAnchorFromTargets(targets, position2, step3.id);
@@ -166968,7 +167112,7 @@ function executeCompiledPlan(editor, compiled, options = {}) {
166968
167112
  function executePlan(editor, input) {
166969
167113
  if (!input.steps?.length)
166970
167114
  throw planError("INVALID_INPUT", "plan must contain at least one step");
166971
- return executeCompiledPlan(editor, compilePlan(editor, input.steps), {
167115
+ return executeCompiledPlan(editor, compilePlan(editor, input.steps, { selectTextModel: input.changeMode === "tracked" ? "raw" : "visible" }), {
166972
167116
  changeMode: input.changeMode ?? "direct",
166973
167117
  expectedRevision: input.expectedRevision
166974
167118
  });
@@ -172530,8 +172674,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
172530
172674
  }
172531
172675
  };
172532
172676
  };
172533
- var init_create_headless_toolbar_ISx0N5AS_es = __esm(() => {
172534
- init_SuperConverter_C6hKp29w_es();
172677
+ var init_create_headless_toolbar_lxRAue2X_es = __esm(() => {
172678
+ init_SuperConverter_DHtZjY65_es();
172535
172679
  init_uuid_qzgm05fK_es();
172536
172680
  init_constants_D_X7xF4s_es();
172537
172681
  init_dist_B8HfvhaK_es();
@@ -221759,7 +221903,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
221759
221903
  init_remark_gfm_BhnWr3yf_es();
221760
221904
  });
221761
221905
 
221762
- // ../../packages/superdoc/dist/chunks/src-Bm7Xq4ys.es.js
221906
+ // ../../packages/superdoc/dist/chunks/src-BlbgbalI.es.js
221763
221907
  function deleteProps(obj, propOrProps) {
221764
221908
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
221765
221909
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -221833,7 +221977,7 @@ function prosemirrorToYXmlFragment(doc$12, xmlFragment) {
221833
221977
  }
221834
221978
  function getSuperdocVersion() {
221835
221979
  try {
221836
- return "1.37.0";
221980
+ return "1.38.0";
221837
221981
  } catch {
221838
221982
  return "unknown";
221839
221983
  }
@@ -234777,11 +234921,20 @@ function buildSelectionClipboardHtml(view, editor) {
234777
234921
  annotateCopiedSectionMetadata(container, view);
234778
234922
  return serializeSelectionAsWordHtml(container) || container.innerHTML || null;
234779
234923
  }
234780
- function projectContentNode(pmNode) {
234781
- return projectBlock(pmNode);
234924
+ function isVisibleProjection(options) {
234925
+ return options?.textModel === "visible";
234782
234926
  }
234783
- function projectInlineNode(pmNode) {
234784
- return projectInline(pmNode);
234927
+ function hasTrackDeleteMark$1(pmNode) {
234928
+ return pmNode.marks?.some((mark2) => mark2.type.name === "trackDelete") ?? false;
234929
+ }
234930
+ function projectContentNode(pmNode, options) {
234931
+ return projectBlock(pmNode, options);
234932
+ }
234933
+ function projectInlineNode(pmNode, options) {
234934
+ return projectInline(pmNode, options) ?? {
234935
+ kind: "run",
234936
+ run: { text: "" }
234937
+ };
234785
234938
  }
234786
234939
  function projectMarkBasedInline(editor, candidate) {
234787
234940
  const { nodeType, anchor, attrs } = candidate;
@@ -234831,8 +234984,9 @@ function resolveTextByBlockId(editor, anchor) {
234831
234984
  function projectDocument(editor, options) {
234832
234985
  const doc$12 = editor.state.doc;
234833
234986
  const body = [];
234987
+ const projectionOptions = { textModel: "visible" };
234834
234988
  doc$12.forEach((child) => {
234835
- body.push(projectBlock(child));
234989
+ body.push(projectBlock(child, projectionOptions));
234836
234990
  });
234837
234991
  const sections = projectSections(editor);
234838
234992
  const numbering = projectNumberingCatalog(editor);
@@ -234918,27 +235072,27 @@ function projectNumberingCatalog(editor) {
234918
235072
  }
234919
235073
  return Object.keys(catalog.definitions).length > 0 ? catalog : undefined;
234920
235074
  }
234921
- function projectBlock(pmNode) {
235075
+ function projectBlock(pmNode, options) {
234922
235076
  const typeName = pmNode.type.name;
234923
235077
  switch (typeName) {
234924
235078
  case "paragraph":
234925
- return projectParagraphOrHeading(pmNode);
235079
+ return projectParagraphOrHeading(pmNode, options);
234926
235080
  case "heading":
234927
- return projectHeadingNode(pmNode);
235081
+ return projectHeadingNode(pmNode, options);
234928
235082
  case "table":
234929
- return projectTable(pmNode);
235083
+ return projectTable(pmNode, options);
234930
235084
  case "bulletList":
234931
235085
  case "orderedList":
234932
- return projectList(pmNode, typeName === "orderedList");
235086
+ return projectList(pmNode, typeName === "orderedList", options);
234933
235087
  case "listItem":
234934
- return projectListItemAsContent(pmNode);
235088
+ return projectListItemAsContent(pmNode, options);
234935
235089
  case "image":
234936
235090
  return projectBlockImage(pmNode);
234937
235091
  case "tableOfContents":
234938
235092
  return projectToc(pmNode);
234939
235093
  case "sdt":
234940
235094
  case "structuredContentBlock":
234941
- return projectBlockSdt(pmNode);
235095
+ return projectBlockSdt(pmNode, options);
234942
235096
  case "sectionBreak":
234943
235097
  return projectSectionBreak(pmNode);
234944
235098
  case "pageBreak":
@@ -234947,22 +235101,22 @@ function projectBlock(pmNode) {
234947
235101
  case "drawing":
234948
235102
  return projectBlockDrawing(pmNode);
234949
235103
  default:
234950
- return projectFallbackBlock(pmNode);
235104
+ return projectFallbackBlock(pmNode, options);
234951
235105
  }
234952
235106
  }
234953
- function projectParagraphOrHeading(pmNode) {
235107
+ function projectParagraphOrHeading(pmNode, options) {
234954
235108
  const attrs = pmNode.attrs;
234955
235109
  const headingLevel = getHeadingLevel(attrs?.paragraphProperties?.styleId);
234956
235110
  if (headingLevel && headingLevel >= 1 && headingLevel <= 6)
234957
- return buildHeading(pmNode, attrs, headingLevel);
234958
- return buildParagraph(pmNode, attrs);
235111
+ return buildHeading(pmNode, attrs, headingLevel, options);
235112
+ return buildParagraph(pmNode, attrs, options);
234959
235113
  }
234960
- function projectHeadingNode(pmNode) {
235114
+ function projectHeadingNode(pmNode, options) {
234961
235115
  const attrs = pmNode.attrs;
234962
- return buildHeading(pmNode, attrs, pmNode.attrs?.level ?? getHeadingLevel(attrs?.paragraphProperties?.styleId) ?? 1);
235116
+ return buildHeading(pmNode, attrs, pmNode.attrs?.level ?? getHeadingLevel(attrs?.paragraphProperties?.styleId) ?? 1, options);
234963
235117
  }
234964
- function buildParagraph(pmNode, attrs) {
234965
- const inlines = projectInlineChildren(pmNode);
235118
+ function buildParagraph(pmNode, attrs, options) {
235119
+ const inlines = projectInlineChildren(pmNode, options);
234966
235120
  const result = {
234967
235121
  kind: "paragraph",
234968
235122
  id: resolveNodeId(pmNode),
@@ -234976,8 +235130,8 @@ function buildParagraph(pmNode, attrs) {
234976
235130
  result.paragraph.props = props;
234977
235131
  return result;
234978
235132
  }
234979
- function buildHeading(pmNode, attrs, level) {
234980
- const inlines = projectInlineChildren(pmNode);
235133
+ function buildHeading(pmNode, attrs, level, options) {
235134
+ const inlines = projectInlineChildren(pmNode, options);
234981
235135
  const result = {
234982
235136
  kind: "heading",
234983
235137
  id: resolveNodeId(pmNode),
@@ -234994,13 +235148,13 @@ function buildHeading(pmNode, attrs, level) {
234994
235148
  result.heading.props = props;
234995
235149
  return result;
234996
235150
  }
234997
- function projectTable(pmNode) {
235151
+ function projectTable(pmNode, options) {
234998
235152
  const attrs = pmNode.attrs;
234999
235153
  const pmAttrs = pmNode.attrs;
235000
235154
  const rows = [];
235001
235155
  pmNode.forEach((child) => {
235002
235156
  if (child.type.name === "tableRow")
235003
- rows.push(projectTableRow(child));
235157
+ rows.push(projectTableRow(child, options));
235004
235158
  });
235005
235159
  const result = {
235006
235160
  kind: "table",
@@ -235030,11 +235184,11 @@ function projectTable(pmNode) {
235030
235184
  }
235031
235185
  return result;
235032
235186
  }
235033
- function projectTableRow(pmNode) {
235187
+ function projectTableRow(pmNode, options) {
235034
235188
  const cells = [];
235035
235189
  pmNode.forEach((child) => {
235036
235190
  if (child.type.name === "tableCell" || child.type.name === "tableHeader")
235037
- cells.push(projectTableCell(child));
235191
+ cells.push(projectTableCell(child, options));
235038
235192
  });
235039
235193
  const row2 = { cells };
235040
235194
  const attrs = pmNode.attrs;
@@ -235047,11 +235201,11 @@ function projectTableRow(pmNode) {
235047
235201
  }
235048
235202
  return row2;
235049
235203
  }
235050
- function projectTableCell(pmNode) {
235204
+ function projectTableCell(pmNode, options) {
235051
235205
  const attrs = pmNode.attrs;
235052
235206
  const content3 = [];
235053
235207
  pmNode.forEach((child) => {
235054
- content3.push(projectBlock(child));
235208
+ content3.push(projectBlock(child, options));
235055
235209
  });
235056
235210
  const cell2 = { content: content3 };
235057
235211
  if (attrs?.colspan && attrs.colspan > 1)
@@ -235063,11 +235217,11 @@ function projectTableCell(pmNode) {
235063
235217
  cell2.props = { verticalAlign: vAlign };
235064
235218
  return cell2;
235065
235219
  }
235066
- function projectList(pmNode, ordered) {
235220
+ function projectList(pmNode, ordered, options) {
235067
235221
  const items = [];
235068
235222
  pmNode.forEach((child) => {
235069
235223
  if (child.type.name === "listItem")
235070
- items.push(projectListItem(child));
235224
+ items.push(projectListItem(child, options));
235071
235225
  });
235072
235226
  const result = {
235073
235227
  kind: "list",
@@ -235085,18 +235239,18 @@ function projectList(pmNode, ordered) {
235085
235239
  result.list.styleRef = attrs.listStyleId;
235086
235240
  return result;
235087
235241
  }
235088
- function projectListItem(pmNode) {
235242
+ function projectListItem(pmNode, options) {
235089
235243
  const content3 = [];
235090
235244
  pmNode.forEach((child) => {
235091
- content3.push(projectBlock(child));
235245
+ content3.push(projectBlock(child, options));
235092
235246
  });
235093
235247
  return {
235094
235248
  level: pmNode.attrs?.level ?? 0,
235095
235249
  content: content3
235096
235250
  };
235097
235251
  }
235098
- function projectListItemAsContent(pmNode) {
235099
- const inlines = projectInlineChildren(pmNode);
235252
+ function projectListItemAsContent(pmNode, options) {
235253
+ const inlines = projectInlineChildren(pmNode, options);
235100
235254
  return {
235101
235255
  kind: "paragraph",
235102
235256
  id: resolveNodeId(pmNode),
@@ -235145,10 +235299,10 @@ function extractSdtMetadata(attrs) {
235145
235299
  ...lock && lock !== "none" ? { lock } : {}
235146
235300
  };
235147
235301
  }
235148
- function projectBlockSdt(pmNode) {
235302
+ function projectBlockSdt(pmNode, options) {
235149
235303
  const children = [];
235150
235304
  pmNode.forEach((child) => {
235151
- children.push(projectBlock(child));
235305
+ children.push(projectBlock(child, options));
235152
235306
  });
235153
235307
  return {
235154
235308
  kind: "sdt",
@@ -235160,8 +235314,8 @@ function projectBlockSdt(pmNode) {
235160
235314
  }
235161
235315
  };
235162
235316
  }
235163
- function projectInlineSdt(pmNode) {
235164
- const inlines = projectInlineChildren(pmNode);
235317
+ function projectInlineSdt(pmNode, options) {
235318
+ const inlines = projectInlineChildren(pmNode, options);
235165
235319
  return {
235166
235320
  kind: "sdt",
235167
235321
  id: resolveSdtNodeId(pmNode),
@@ -235198,28 +235352,29 @@ function projectBlockDrawing(pmNode) {
235198
235352
  }
235199
235353
  };
235200
235354
  }
235201
- function projectFallbackBlock(pmNode) {
235202
- const inlines = projectInlineChildren(pmNode);
235355
+ function projectFallbackBlock(pmNode, options) {
235356
+ const inlines = projectInlineChildren(pmNode, options);
235203
235357
  return {
235204
235358
  kind: "paragraph",
235205
235359
  id: resolveNodeId(pmNode),
235206
235360
  paragraph: { inlines }
235207
235361
  };
235208
235362
  }
235209
- function projectInlineChildren(pmNode) {
235363
+ function projectInlineChildren(pmNode, options) {
235210
235364
  const inlines = [];
235211
235365
  pmNode.forEach((child) => {
235212
- const projected = projectInline(child);
235213
- inlines.push(projected);
235366
+ const projected = projectInline(child, options);
235367
+ if (projected)
235368
+ inlines.push(projected);
235214
235369
  });
235215
235370
  return inlines;
235216
235371
  }
235217
- function projectInline(pmNode) {
235372
+ function projectInline(pmNode, options) {
235218
235373
  if (pmNode.isText)
235219
- return projectTextRun(pmNode);
235374
+ return projectTextRun(pmNode, options);
235220
235375
  switch (pmNode.type.name) {
235221
235376
  case "run":
235222
- return projectRunNode(pmNode);
235377
+ return projectRunNode(pmNode, options);
235223
235378
  case "image":
235224
235379
  return projectInlineImage(pmNode);
235225
235380
  case "tab":
@@ -235236,21 +235391,23 @@ function projectInline(pmNode) {
235236
235391
  case "field":
235237
235392
  return projectInlineField(pmNode);
235238
235393
  case "structuredContent":
235239
- return projectInlineSdt(pmNode);
235394
+ return projectInlineSdt(pmNode, options);
235240
235395
  default:
235241
- return projectInlineFallback(pmNode);
235396
+ return projectInlineFallback(pmNode, options);
235242
235397
  }
235243
235398
  }
235244
- function projectRunNode(pmNode) {
235399
+ function projectRunNode(pmNode, options) {
235245
235400
  const runProperties = (pmNode.attrs ?? {}).runProperties;
235246
- const text5 = pmNode.textContent;
235401
+ const text5 = isVisibleProjection(options) ? textContentInBlock(pmNode, options) : pmNode.textContent;
235402
+ if (isVisibleProjection(options) && text5.length === 0)
235403
+ return null;
235247
235404
  let linkMark;
235248
235405
  pmNode.forEach((child) => {
235249
235406
  if (!linkMark)
235250
235407
  linkMark = child.marks?.find((m$1) => m$1.type.name === "link");
235251
235408
  });
235252
235409
  if (linkMark)
235253
- return buildHyperlinkFromRunNode(pmNode, linkMark);
235410
+ return buildHyperlinkFromRunNode(pmNode, linkMark, options);
235254
235411
  const run2 = {
235255
235412
  kind: "run",
235256
235413
  run: { text: text5 }
@@ -235263,11 +235420,14 @@ function projectRunNode(pmNode) {
235263
235420
  run2.run.props = props;
235264
235421
  return run2;
235265
235422
  }
235266
- function buildHyperlinkFromRunNode(pmNode, linkMark) {
235423
+ function buildHyperlinkFromRunNode(pmNode, linkMark, options) {
235267
235424
  const attrs = linkMark.attrs;
235425
+ const text5 = isVisibleProjection(options) ? textContentInBlock(pmNode, options) : pmNode.textContent;
235426
+ if (isVisibleProjection(options) && text5.length === 0)
235427
+ return null;
235268
235428
  const childRun = {
235269
235429
  kind: "run",
235270
- run: { text: pmNode.textContent }
235430
+ run: { text: text5 }
235271
235431
  };
235272
235432
  const runProperties = pmNode.attrs?.runProperties;
235273
235433
  const props = extractRunPropsFromRunProperties(runProperties);
@@ -235381,7 +235541,9 @@ function extractRunPropsFromRunProperties(runProperties) {
235381
235541
  }
235382
235542
  return hasProps ? props : undefined;
235383
235543
  }
235384
- function projectTextRun(pmNode) {
235544
+ function projectTextRun(pmNode, options) {
235545
+ if (isVisibleProjection(options) && hasTrackDeleteMark$1(pmNode))
235546
+ return null;
235385
235547
  const marks = pmNode.marks;
235386
235548
  const linkMark = marks.find((m$1) => m$1.type.name === "link");
235387
235549
  if (linkMark)
@@ -235476,10 +235638,13 @@ function projectInlineField(pmNode) {
235476
235638
  }
235477
235639
  };
235478
235640
  }
235479
- function projectInlineFallback(pmNode) {
235641
+ function projectInlineFallback(pmNode, options) {
235642
+ const text5 = isVisibleProjection(options) ? textContentInBlock(pmNode, options) : pmNode.textContent ?? "";
235643
+ if (isVisibleProjection(options) && text5.length === 0)
235644
+ return null;
235480
235645
  return {
235481
235646
  kind: "run",
235482
- run: { text: pmNode.textContent ?? "" }
235647
+ run: { text: text5 }
235483
235648
  };
235484
235649
  }
235485
235650
  function resolveNodeId(pmNode) {
@@ -236532,6 +236697,13 @@ function buildSelectionTargetFromTextRanges(textRanges, story) {
236532
236697
  target.story = story;
236533
236698
  return target;
236534
236699
  }
236700
+ function readCandidateVisibleText(editor, candidate) {
236701
+ const maybeNode = candidate.node;
236702
+ if (maybeNode && typeof maybeNode.childCount === "number" && maybeNode.childCount > 0)
236703
+ return textContentInBlock(maybeNode, { textModel: "visible" });
236704
+ return editor.state.doc.textBetween(candidate.pos + 1, candidate.end - 1, `
236705
+ `, "");
236706
+ }
236535
236707
  function buildMatchBlocks(editor, textRanges, evaluatedRevision, matchId, storyKey, resolverParams) {
236536
236708
  const index2 = getBlockIndex(editor);
236537
236709
  const doc$12 = editor.state.doc;
@@ -236584,10 +236756,7 @@ function buildMatchBlocks(editor, textRanges, evaluatedRevision, matchId, storyK
236584
236756
  }
236585
236757
  });
236586
236758
  }
236587
- const blockStart = candidate.pos + 1;
236588
- const blockEnd = candidate.end - 1;
236589
- const blockText = doc$12.textBetween(blockStart, blockEnd, `
236590
- `, "");
236759
+ const blockText = readCandidateVisibleText(editor, candidate);
236591
236760
  const matchedText = blockText.slice(from$1, to);
236592
236761
  const node3 = doc$12.nodeAt(candidate.pos);
236593
236762
  const nodeType = node3?.type.name ?? "paragraph";
@@ -236596,7 +236765,7 @@ function buildMatchBlocks(editor, textRanges, evaluatedRevision, matchId, storyK
236596
236765
  resolverParams,
236597
236766
  paragraphProperties: node3?.attrs?.paragraphProperties ?? null
236598
236767
  } : undefined;
236599
- const coalesced = coalesceRuns(captureRunsInRange(editor, candidate.pos, from$1, to).runs);
236768
+ const coalesced = coalesceRuns(captureRunsInRange(editor, candidate.pos, from$1, to, { textModel: "visible" }).runs);
236600
236769
  const blockRange = {
236601
236770
  start: from$1,
236602
236771
  end: to
@@ -236660,7 +236829,6 @@ function buildBlocksSnippet(editor, blocks2) {
236660
236829
  if (!editor.state?.doc || blocks2.length === 0)
236661
236830
  return;
236662
236831
  const index2 = getBlockIndex(editor);
236663
- const doc$12 = editor.state.doc;
236664
236832
  const matchText = blocks2.map((b$1) => b$1.text).join(`
236665
236833
  `);
236666
236834
  if (matchText.length >= 500)
@@ -236677,10 +236845,7 @@ function buildBlocksSnippet(editor, blocks2) {
236677
236845
  const firstBlock = blocks2[0];
236678
236846
  const firstCandidate = index2.candidates.find((c) => c.nodeId === firstBlock.blockId);
236679
236847
  if (firstCandidate) {
236680
- const blockStart = firstCandidate.pos + 1;
236681
- const blockEnd = firstCandidate.end - 1;
236682
- const fullBlockText = doc$12.textBetween(blockStart, blockEnd, `
236683
- `, "");
236848
+ const fullBlockText = readCandidateVisibleText(editor, firstCandidate);
236684
236849
  const contextStart = Math.max(0, firstBlock.range.start - contextEachSide);
236685
236850
  leftContext = fullBlockText.slice(contextStart, firstBlock.range.start);
236686
236851
  }
@@ -236688,10 +236853,7 @@ function buildBlocksSnippet(editor, blocks2) {
236688
236853
  const lastBlock = blocks2[blocks2.length - 1];
236689
236854
  const lastCandidate = index2.candidates.find((c) => c.nodeId === lastBlock.blockId);
236690
236855
  if (lastCandidate) {
236691
- const blockStart = lastCandidate.pos + 1;
236692
- const blockEnd = lastCandidate.end - 1;
236693
- const fullBlockText = doc$12.textBetween(blockStart, blockEnd, `
236694
- `, "");
236856
+ const fullBlockText = readCandidateVisibleText(editor, lastCandidate);
236695
236857
  const contextEnd = Math.min(fullBlockText.length, lastBlock.range.end + contextEachSide);
236696
236858
  rightContext = fullBlockText.slice(lastBlock.range.end, contextEnd);
236697
236859
  }
@@ -237017,12 +237179,12 @@ function projectMatchToSDNodeResult(editor, address2, blockIndex) {
237017
237179
  if (!found2)
237018
237180
  return null;
237019
237181
  return {
237020
- node: projectContentNode(found2.node),
237182
+ node: projectContentNode(found2.node, { textModel: "visible" }),
237021
237183
  address: address2
237022
237184
  };
237023
237185
  }
237024
237186
  return {
237025
- node: projectContentNode(candidate.node),
237187
+ node: projectContentNode(candidate.node, { textModel: "visible" }),
237026
237188
  address: address2
237027
237189
  };
237028
237190
  }
@@ -258896,7 +259058,7 @@ function extractParagraphText(paraNode, paraPos) {
258896
259058
  return;
258897
259059
  }
258898
259060
  if (node3.isText && node3.text) {
258899
- if (hasTrackDeleteMark(node3))
259061
+ if (hasTrackDeleteMark2(node3))
258900
259062
  return;
258901
259063
  const text5 = node3.text;
258902
259064
  const pmFrom = pos;
@@ -258929,7 +259091,7 @@ function extractParagraphText(paraNode, paraPos) {
258929
259091
  }
258930
259092
  }
258931
259093
  }
258932
- function hasTrackDeleteMark(node3) {
259094
+ function hasTrackDeleteMark2(node3) {
258933
259095
  return node3.marks?.some((m$1) => m$1.type.name === "trackDelete") ?? false;
258934
259096
  }
258935
259097
  function isNonTextInlineNode(typeName) {
@@ -282480,7 +282642,7 @@ var Node$13 = class Node$14 {
282480
282642
  }, isToolbarInput = (target) => {
282481
282643
  return !!target?.closest(".button-text-input") || target?.classList?.contains("button-text-input");
282482
282644
  }, isToolbarButton = (target) => {
282483
- return !!target?.closest(".toolbar-button") || target?.classList?.contains("toolbar-button");
282645
+ return !!target?.closest(".sd-toolbar-button") || !!target?.closest(".toolbar-button") || target?.classList?.contains("sd-toolbar-button") || target?.classList?.contains("toolbar-button");
282484
282646
  }, CustomSelection, History, createUndoPlugin = () => {
282485
282647
  return yUndoPlugin();
282486
282648
  }, Color, FontFamily, FontSize, LetterSpacing, TextAlign, toggleMarkCascade = (markName, options = {}) => ({ state, chain, editor }) => {
@@ -290473,7 +290635,8 @@ var Node$13 = class Node$14 {
290473
290635
  replacementGroupId: "",
290474
290636
  replacementSideId: "",
290475
290637
  sharedDeletionId: intent.replacementGroupHint || null,
290476
- recordSharedDeletionId: Boolean(intent.replacementGroupHint)
290638
+ recordSharedDeletionId: Boolean(intent.replacementGroupHint),
290639
+ reassignExistingDeletions: intent.source !== "native" && !intent.preserveExistingReviewState ? "different-user" : false
290477
290640
  });
290478
290641
  if (result.ok === false)
290479
290642
  return result;
@@ -290544,12 +290707,17 @@ var Node$13 = class Node$14 {
290544
290707
  }
290545
290708
  if (existingDelete) {
290546
290709
  const allExistingDeletes = node3.marks.filter((m$1) => m$1.type.name === TrackDeleteMarkName);
290547
- if (reassignExistingDeletions) {
290710
+ const isDifferentUserDeletion = !isSameUserHighConfidence(classifyOwnership({
290711
+ currentUser: ctx$1.currentIdentity,
290712
+ change: getChangeAuthorIdentity(existingDelete.attrs)
290713
+ }));
290714
+ if (reassignExistingDeletions === "all" || reassignExistingDeletions === "different-user" && isDifferentUserDeletion) {
290548
290715
  ops.push({
290549
290716
  kind: "reassign",
290550
290717
  from: segFrom,
290551
290718
  to: segTo,
290552
290719
  node: node3,
290720
+ parentId: existingDelete.attrs.id || existingDelete.attrs.overlapParentId || "",
290553
290721
  existingDeleteMarks: allExistingDeletes
290554
290722
  });
290555
290723
  return;
@@ -290590,7 +290758,7 @@ var Node$13 = class Node$14 {
290590
290758
  if (op.kind === "reassign") {
290591
290759
  const mark2 = makeDeleteMark(ctx$1, {
290592
290760
  id: deletionId,
290593
- overlapParentId: "",
290761
+ overlapParentId: op.parentId || "",
290594
290762
  replacementGroupId,
290595
290763
  replacementSideId
290596
290764
  });
@@ -290704,11 +290872,11 @@ var Node$13 = class Node$14 {
290704
290872
  }, compileOrdinaryTextReplace = (ctx$1, intent, sanitizedSlice, replacementParentId) => {
290705
290873
  const sharedId = intent.replacements === "paired" && !replacementParentId ? intent.replacementGroupHint || v4_default() : null;
290706
290874
  const replacementGroupId = sharedId ?? "";
290707
- let positionTo = intent.to;
290875
+ let positionTo = replacementParentId ? intent.from : intent.to;
290708
290876
  if (intent.from !== intent.to && intent.probeForDeletionSpan) {
290709
290877
  const probePos = Math.max(intent.from, intent.to - 1);
290710
290878
  const deletionSpan = findMarkPosition(ctx$1.tr.doc, probePos, TrackDeleteMarkName);
290711
- if (deletionSpan && deletionSpan.to > positionTo)
290879
+ if (!replacementParentId && deletionSpan && deletionSpan.to > positionTo)
290712
290880
  positionTo = deletionSpan.to;
290713
290881
  }
290714
290882
  const baseParentIsTextblock = ctx$1.tr.doc.resolve(positionTo).parent?.isTextblock;
@@ -290801,11 +290969,11 @@ var Node$13 = class Node$14 {
290801
290969
  let deletionMark = null;
290802
290970
  if (intent.from !== intent.to) {
290803
290971
  const stepsBefore = ctx$1.tr.steps.length;
290804
- const delResult = applyTrackedDelete(ctx$1, intent.from, intent.to, {
290972
+ const delResult = applyTrackedDelete(ctx$1, insertedLength > 0 && positionTo <= intent.from ? intent.from + insertedLength : intent.from, insertedLength > 0 && positionTo <= intent.from ? intent.to + insertedLength : intent.to, {
290805
290973
  replacementGroupId,
290806
290974
  replacementSideId: sharedId ? `${sharedId}#deleted` : "",
290807
290975
  sharedDeletionId: sharedId,
290808
- reassignExistingDeletions: Boolean(sharedId)
290976
+ reassignExistingDeletions: sharedId || replacementParentId ? "all" : false
290809
290977
  });
290810
290978
  if (delResult.ok === false)
290811
290979
  return delResult;
@@ -291298,13 +291466,14 @@ var Node$13 = class Node$14 {
291298
291466
  let intent;
291299
291467
  try {
291300
291468
  const preserveExistingReviewState = tr.getMeta("protectTrackedReviewState") === true;
291469
+ const source = tr.getMeta("inputType") === "programmatic" ? "document-api" : "native";
291301
291470
  if (step3.from === step3.to && step3.slice.content.size > 0)
291302
291471
  intent = makeTextInsertIntent({
291303
291472
  at: step3.from,
291304
291473
  content: step3.slice,
291305
291474
  user,
291306
291475
  date,
291307
- source: "native",
291476
+ source,
291308
291477
  preserveExistingReviewState
291309
291478
  });
291310
291479
  else if (step3.from !== step3.to && step3.slice.content.size === 0)
@@ -291313,7 +291482,7 @@ var Node$13 = class Node$14 {
291313
291482
  to: step3.to,
291314
291483
  user,
291315
291484
  date,
291316
- source: "native",
291485
+ source,
291317
291486
  preserveExistingReviewState
291318
291487
  });
291319
291488
  else if (step3.from !== step3.to && step3.slice.content.size > 0) {
@@ -291324,7 +291493,7 @@ var Node$13 = class Node$14 {
291324
291493
  replacements,
291325
291494
  user,
291326
291495
  date,
291327
- source: "native",
291496
+ source,
291328
291497
  preserveExistingReviewState
291329
291498
  });
291330
291499
  if (tr.steps.length === 1)
@@ -292436,6 +292605,7 @@ var Node$13 = class Node$14 {
292436
292605
  else if (change.type === CanonicalChangeType.Replacement) {
292437
292606
  const repResult = planReplacementDecision({
292438
292607
  ops,
292608
+ graph,
292439
292609
  change,
292440
292610
  decision,
292441
292611
  removedRanges,
@@ -292580,7 +292750,7 @@ var Node$13 = class Node$14 {
292580
292750
  });
292581
292751
  if (isFull)
292582
292752
  retired.add(change.id);
292583
- }, planReplacementDecision = ({ ops, change, decision, removedRanges, retired }) => {
292753
+ }, planReplacementDecision = ({ ops, graph, change, decision, removedRanges, retired }) => {
292584
292754
  const inserted = change.insertedSegments;
292585
292755
  const deleted = change.deletedSegments;
292586
292756
  if (!inserted.length || !deleted.length)
@@ -292625,16 +292795,114 @@ var Node$13 = class Node$14 {
292625
292795
  cause: `reject-replacement-inserted:${change.id}`
292626
292796
  });
292627
292797
  }
292628
- for (const seg of deleted)
292798
+ const parentRestore = getParentRestoreContext({
292799
+ graph,
292800
+ change
292801
+ });
292802
+ for (const seg of deleted) {
292629
292803
  pushRemoveMarkOpsForSegment({
292630
292804
  ops,
292631
292805
  segment: seg,
292632
292806
  changeId: change.id,
292633
292807
  side: SegmentSide.Deleted
292634
292808
  });
292809
+ if (parentRestore?.mark)
292810
+ pushAddMarkOpsForSegment({
292811
+ ops,
292812
+ segment: seg,
292813
+ changeId: parentRestore.mark.attrs?.id || change.parent || change.id,
292814
+ side: parentRestore.mark.type.name === "trackInsert" ? SegmentSide.Inserted : SegmentSide.Deleted,
292815
+ mark: parentRestore.mark
292816
+ });
292817
+ }
292818
+ for (const sibling of parentRestore?.siblingSegments ?? []) {
292819
+ pushRemoveMarkOpsForSegment({
292820
+ ops,
292821
+ segment: sibling,
292822
+ changeId: sibling.changeId,
292823
+ side: sibling.side
292824
+ });
292825
+ pushAddMarkOpsForSegment({
292826
+ ops,
292827
+ segment: sibling,
292828
+ changeId: parentRestore.mark.attrs?.id || sibling.changeId,
292829
+ side: parentRestore.mark.type.name === "trackInsert" ? SegmentSide.Inserted : SegmentSide.Deleted,
292830
+ mark: parentRestore.mark
292831
+ });
292832
+ retired.add(sibling.changeId);
292833
+ }
292635
292834
  }
292636
292835
  retired.add(change.id);
292637
292836
  return { ok: true };
292837
+ }, getParentRestoreContext = ({ graph, change }) => {
292838
+ const explicit = getExplicitParentRestoreContext({
292839
+ graph,
292840
+ change
292841
+ });
292842
+ if (explicit)
292843
+ return explicit;
292844
+ return inferAdjacentParentRestoreContext({
292845
+ graph,
292846
+ change
292847
+ });
292848
+ }, getExplicitParentRestoreContext = ({ graph, change }) => {
292849
+ if (!change.parent)
292850
+ return null;
292851
+ const parent = graph.changes.get(change.parent);
292852
+ if (!parent)
292853
+ return null;
292854
+ if (parent.type === CanonicalChangeType.Insertion) {
292855
+ const mark2 = parent.insertedSegments[0]?.mark ?? null;
292856
+ return mark2 ? {
292857
+ mark: mark2,
292858
+ siblingSegments: []
292859
+ } : null;
292860
+ }
292861
+ if (parent.type === CanonicalChangeType.Deletion) {
292862
+ const mark2 = parent.deletedSegments[0]?.mark ?? null;
292863
+ return mark2 ? {
292864
+ mark: mark2,
292865
+ siblingSegments: []
292866
+ } : null;
292867
+ }
292868
+ return null;
292869
+ }, inferAdjacentParentRestoreContext = ({ graph, change }) => {
292870
+ if (!change.deletedSegments.length || !change.segments.length)
292871
+ return null;
292872
+ const from$1 = Math.min(...change.segments.map((segment) => segment.from));
292873
+ const to = Math.max(...change.segments.map((segment) => segment.to));
292874
+ const before2 = nearestSegmentBefore({
292875
+ graph,
292876
+ change,
292877
+ from: from$1
292878
+ });
292879
+ const after2 = nearestSegmentAfter({
292880
+ graph,
292881
+ change,
292882
+ to
292883
+ });
292884
+ if (!before2 || !after2)
292885
+ return null;
292886
+ if (!areParentRestorePeers(before2, after2))
292887
+ return null;
292888
+ return {
292889
+ mark: before2.mark,
292890
+ siblingSegments: after2.changeId === before2.changeId ? [] : [after2]
292891
+ };
292892
+ }, nearestSegmentBefore = ({ graph, change, from: from$1 }) => {
292893
+ return graph.segments.filter((segment) => segment.changeId !== change.id && segment.to <= from$1).sort((a2, b$1) => b$1.to - a2.to || b$1.from - a2.from)[0];
292894
+ }, nearestSegmentAfter = ({ graph, change, to }) => {
292895
+ return graph.segments.filter((segment) => segment.changeId !== change.id && segment.from >= to).sort((a2, b$1) => a2.from - b$1.from || a2.to - b$1.to)[0];
292896
+ }, areParentRestorePeers = (left$1, right$1) => {
292897
+ if (!left$1 || !right$1)
292898
+ return false;
292899
+ if (left$1.side !== right$1.side)
292900
+ return false;
292901
+ if (left$1.side !== SegmentSide.Inserted && left$1.side !== SegmentSide.Deleted)
292902
+ return false;
292903
+ if (left$1.markType !== right$1.markType)
292904
+ return false;
292905
+ return left$1.attrs.author === right$1.attrs.author && left$1.attrs.authorEmail === right$1.attrs.authorEmail && left$1.attrs.date === right$1.attrs.date;
292638
292906
  }, planFormattingDecision = ({ ops, change, decision, retired }) => {
292639
292907
  for (const seg of change.formattingSegments)
292640
292908
  if (decision === "accept")
@@ -292776,6 +293044,21 @@ var Node$13 = class Node$14 {
292776
293044
  mark: run2.mark
292777
293045
  });
292778
293046
  }
293047
+ }, pushAddMarkOpsForSegment = ({ ops, segment, changeId, side, mark: mark2, from: from$1 = segment.from, to = segment.to }) => {
293048
+ for (const run2 of getSegmentMarkRuns(segment)) {
293049
+ const clippedFrom = Math.max(from$1, run2.from);
293050
+ const clippedTo = Math.min(to, run2.to);
293051
+ if (clippedFrom >= clippedTo)
293052
+ continue;
293053
+ ops.push({
293054
+ kind: "addMark",
293055
+ from: clippedFrom,
293056
+ to: clippedTo,
293057
+ changeId,
293058
+ side,
293059
+ mark: mark2
293060
+ });
293061
+ }
292779
293062
  }, getSegmentMarkRuns = (segment) => {
292780
293063
  return segment.markRuns?.length ? segment.markRuns : [{
292781
293064
  from: segment.from,
@@ -293783,7 +294066,7 @@ var Node$13 = class Node$14 {
293783
294066
  this.deco = deco;
293784
294067
  }
293785
294068
  }, searchKey, BLOCK_SEPARATOR = `
293786
- `, ATOM_PLACEHOLDER = "", DELETION_BARRIER = "\x00", DEFAULT_SEARCH_MODEL$1 = "raw", hasTrackDeleteMark$1 = (node3) => node3?.marks?.some((mark2) => mark2?.type?.name === "trackDelete") ?? false, SearchIndex, customSearchHighlightsKey, isRegExp2 = (value) => Object.prototype.toString.call(value) === "[object RegExp]", SEARCH_POSITION_TRACKER_TYPE = "search-match", DEFAULT_SEARCH_MODEL = "raw", normalizeSearchModel = (value) => value === "visible" ? "visible" : DEFAULT_SEARCH_MODEL, mapIndexMatchesToDocMatches = ({ searchIndex, indexMatches, doc: doc$12, positionTracker }) => {
294069
+ `, ATOM_PLACEHOLDER = "", DELETION_BARRIER = "\x00", DEFAULT_SEARCH_MODEL$1 = "raw", hasTrackDeleteMark$2 = (node3) => node3?.marks?.some((mark2) => mark2?.type?.name === "trackDelete") ?? false, SearchIndex, customSearchHighlightsKey, isRegExp2 = (value) => Object.prototype.toString.call(value) === "[object RegExp]", SEARCH_POSITION_TRACKER_TYPE = "search-match", DEFAULT_SEARCH_MODEL = "raw", normalizeSearchModel = (value) => value === "visible" ? "visible" : DEFAULT_SEARCH_MODEL, mapIndexMatchesToDocMatches = ({ searchIndex, indexMatches, doc: doc$12, positionTracker }) => {
293787
294070
  const matches2 = [];
293788
294071
  for (const indexMatch of indexMatches) {
293789
294072
  const ranges = searchIndex.offsetRangeToDocRanges(indexMatch.start, indexMatch.end);
@@ -295880,7 +296163,7 @@ var Node$13 = class Node$14 {
295880
296163
  disabled: role !== "editor",
295881
296164
  attributes: {
295882
296165
  dropdownPosition: "right",
295883
- className: "toolbar-item--doc-mode",
296166
+ className: "sd-toolbar-item--doc-mode",
295884
296167
  ariaLabel: "Document mode"
295885
296168
  },
295886
296169
  options: [{
@@ -295968,7 +296251,7 @@ var Node$13 = class Node$14 {
295968
296251
  suppressActiveHighlight: true,
295969
296252
  disabled: false,
295970
296253
  attributes: {
295971
- className: "toolbar-item--linked-styles",
296254
+ className: "sd-toolbar-item--linked-styles",
295972
296255
  ariaLabel: "Linked styles"
295973
296256
  },
295974
296257
  options: [{
@@ -296051,8 +296334,7 @@ var Node$13 = class Node$14 {
296051
296334
  "clearFormatting",
296052
296335
  "copyFormat",
296053
296336
  "ruler",
296054
- "formattingMarks",
296055
- "tableOfContents"
296337
+ "formattingMarks"
296056
296338
  ];
296057
296339
  const itemsToHideSM = [
296058
296340
  "zoom",
@@ -296062,15 +296344,16 @@ var Node$13 = class Node$14 {
296062
296344
  ];
296063
296345
  const shouldUseLgCompactStyles = availableWidth <= RESPONSIVE_BREAKPOINTS.lg;
296064
296346
  const shouldIncludeFormattingMarks = superToolbar.config?.showFormattingMarksButton === true;
296347
+ const shouldIncludeTableOfContents = superToolbar.config?.showTableOfContentsButton === true;
296065
296348
  if (shouldUseLgCompactStyles)
296066
296349
  documentMode.attributes.value = {
296067
296350
  ...documentMode.attributes.value,
296068
- className: `${documentMode.attributes.value.className} toolbar-item--doc-mode-compact`
296351
+ className: `${documentMode.attributes.value.className} sd-toolbar-item--doc-mode-compact`
296069
296352
  };
296070
296353
  if (shouldUseLgCompactStyles)
296071
296354
  linkedStyles.attributes.value = {
296072
296355
  ...linkedStyles.attributes.value,
296073
- className: `${linkedStyles.attributes.value.className} toolbar-item--linked-styles-compact`
296356
+ className: `${linkedStyles.attributes.value.className} sd-toolbar-item--linked-styles-compact`
296074
296357
  };
296075
296358
  let toolbarItems = [
296076
296359
  undo$2,
@@ -296091,7 +296374,7 @@ var Node$13 = class Node$14 {
296091
296374
  separator,
296092
296375
  link2,
296093
296376
  image2,
296094
- tableOfContents,
296377
+ ...shouldIncludeTableOfContents ? [tableOfContents] : [],
296095
296378
  tableItem,
296096
296379
  tableActionsItem,
296097
296380
  separator,
@@ -297012,7 +297295,7 @@ var Node$13 = class Node$14 {
297012
297295
  domAvailabilityCache = false;
297013
297296
  return false;
297014
297297
  }
297015
- }, summaryVersion = "1.37.0", nodeKeys, markKeys, transformListsInCopiedContent = (html3) => {
297298
+ }, summaryVersion = "1.38.0", nodeKeys, markKeys, transformListsInCopiedContent = (html3) => {
297016
297299
  const container = document.createElement("div");
297017
297300
  container.innerHTML = html3;
297018
297301
  const result = [];
@@ -298197,7 +298480,7 @@ var Node$13 = class Node$14 {
298197
298480
  return () => {};
298198
298481
  const handle3 = setInterval(callback, intervalMs);
298199
298482
  return () => clearInterval(handle3);
298200
- }, HISTORY_UNSAFE_OPS, CANONICAL_COMMENT_IGNORED_KEYS, INITIAL_HASH, ROUND_CONSTANTS, V1_COVERAGE, V2_COVERAGE, SNAPSHOT_VERSION_V2 = "sd-diff-snapshot/v2", PAYLOAD_VERSION_V1 = "sd-diff-payload/v1", PAYLOAD_VERSION_V2 = "sd-diff-payload/v2", ENGINE_ID = "super-editor", STAGED_CONVERTER_KEYS, DiffServiceError, TC_LEVEL_MIN = 1, TC_LEVEL_MAX = 9, ALLOWED_WRAP_ATTRS, WRAP_TYPES_SUPPORTING_SIDE, WRAP_TYPES_SUPPORTING_DISTANCES, RELATIVE_HEIGHT_MIN = 0, RELATIVE_HEIGHT_MAX = 4294967295, FORBIDDEN_RAW_PATCH_NAMES, CONTROL_TYPE_SDT_PR_ELEMENTS, DEFAULT_CHECKBOX_SYMBOL_FONT2 = "MS Gothic", DEFAULT_CHECKBOX_CHECKED_HEX2 = "2612", DEFAULT_CHECKBOX_UNCHECKED_HEX2 = "2610", VARIANT_ORDER, KIND_ORDER, HEADER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", DOCUMENT_RELS_PATH2 = "word/_rels/document.xml.rels", HEADER_FILE_PATTERN2, FOOTER_FILE_PATTERN2, SPECIAL_NOTE_TYPES, BOOKMARK_SCAN_REVISION_PREFIX = "bookmark-scan:", import_lib4, CUSTOM_XML_DATA_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml", CUSTOM_XML_PROPS_RELATIONSHIP_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps", CUSTOM_XML_DATASTORE_NAMESPACE = "http://schemas.openxmlformats.org/officeDocument/2006/customXml", SETTINGS_PART, RESTART_POLICY_TO_OOXML, VALID_DISPLAYS, REFERENCE_BLOCK_PREFIX, CAPTION_STYLE_NAMES, CAPTION_PARAGRAPH_STYLE_ID = "Caption", CAPTION_FORMAT_TO_OOXML, DOCUMENT_STAT_FIELD_TYPES, TOA_LEADER_REVERSE_MAP, EDGE_NODE_TYPES, CONTENT_TYPES_PART_ID = "[Content_Types].xml", CONTENT_TYPES_NS = "http://schemas.openxmlformats.org/package/2006/content-types", contentTypesPartDescriptor, empty_exports, init_empty, CURRENT_APP_VERSION2 = "1.37.0", PIXELS_PER_INCH2 = 96, MAX_HEIGHT_BUFFER_PX = 50, MAX_WIDTH_BUFFER_PX = 20, TRACKED_REVIEW_MARK_NAMES2, isTrackedReviewMark = (mark2) => Boolean(mark2?.type?.name && TRACKED_REVIEW_MARK_NAMES2.has(mark2.type.name)), trackedReviewMarkKey = (mark2) => {
298483
+ }, HISTORY_UNSAFE_OPS, CANONICAL_COMMENT_IGNORED_KEYS, INITIAL_HASH, ROUND_CONSTANTS, V1_COVERAGE, V2_COVERAGE, SNAPSHOT_VERSION_V2 = "sd-diff-snapshot/v2", PAYLOAD_VERSION_V1 = "sd-diff-payload/v1", PAYLOAD_VERSION_V2 = "sd-diff-payload/v2", ENGINE_ID = "super-editor", STAGED_CONVERTER_KEYS, DiffServiceError, TC_LEVEL_MIN = 1, TC_LEVEL_MAX = 9, ALLOWED_WRAP_ATTRS, WRAP_TYPES_SUPPORTING_SIDE, WRAP_TYPES_SUPPORTING_DISTANCES, RELATIVE_HEIGHT_MIN = 0, RELATIVE_HEIGHT_MAX = 4294967295, FORBIDDEN_RAW_PATCH_NAMES, CONTROL_TYPE_SDT_PR_ELEMENTS, DEFAULT_CHECKBOX_SYMBOL_FONT2 = "MS Gothic", DEFAULT_CHECKBOX_CHECKED_HEX2 = "2612", DEFAULT_CHECKBOX_UNCHECKED_HEX2 = "2610", VARIANT_ORDER, KIND_ORDER, HEADER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", DOCUMENT_RELS_PATH2 = "word/_rels/document.xml.rels", HEADER_FILE_PATTERN2, FOOTER_FILE_PATTERN2, SPECIAL_NOTE_TYPES, BOOKMARK_SCAN_REVISION_PREFIX = "bookmark-scan:", import_lib4, CUSTOM_XML_DATA_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml", CUSTOM_XML_PROPS_RELATIONSHIP_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps", CUSTOM_XML_DATASTORE_NAMESPACE = "http://schemas.openxmlformats.org/officeDocument/2006/customXml", SETTINGS_PART, RESTART_POLICY_TO_OOXML, VALID_DISPLAYS, REFERENCE_BLOCK_PREFIX, CAPTION_STYLE_NAMES, CAPTION_PARAGRAPH_STYLE_ID = "Caption", CAPTION_FORMAT_TO_OOXML, DOCUMENT_STAT_FIELD_TYPES, TOA_LEADER_REVERSE_MAP, EDGE_NODE_TYPES, CONTENT_TYPES_PART_ID = "[Content_Types].xml", CONTENT_TYPES_NS = "http://schemas.openxmlformats.org/package/2006/content-types", contentTypesPartDescriptor, empty_exports, init_empty, CURRENT_APP_VERSION2 = "1.38.0", PIXELS_PER_INCH2 = 96, MAX_HEIGHT_BUFFER_PX = 50, MAX_WIDTH_BUFFER_PX = 20, TRACKED_REVIEW_MARK_NAMES2, isTrackedReviewMark = (mark2) => Boolean(mark2?.type?.name && TRACKED_REVIEW_MARK_NAMES2.has(mark2.type.name)), trackedReviewMarkKey = (mark2) => {
298201
298484
  if (!isTrackedReviewMark(mark2))
298202
298485
  return null;
298203
298486
  const id2 = typeof mark2.attrs?.id === "string" ? mark2.attrs.id : "";
@@ -318929,13 +319212,13 @@ menclose::after {
318929
319212
  return;
318930
319213
  console.log(...args$1);
318931
319214
  }, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions, TRACKED_MARK_NAMES;
318932
- var init_src_Bm7Xq4ys_es = __esm(() => {
319215
+ var init_src_BlbgbalI_es = __esm(() => {
318933
319216
  init_rolldown_runtime_Bg48TavK_es();
318934
- init_SuperConverter_C6hKp29w_es();
319217
+ init_SuperConverter_DHtZjY65_es();
318935
319218
  init_jszip_C49i9kUs_es();
318936
319219
  init_xml_js_CqGKpaft_es();
318937
319220
  init_uuid_qzgm05fK_es();
318938
- init_create_headless_toolbar_ISx0N5AS_es();
319221
+ init_create_headless_toolbar_lxRAue2X_es();
318939
319222
  init_constants_D_X7xF4s_es();
318940
319223
  init_dist_B8HfvhaK_es();
318941
319224
  init_unified_Dsuw2be5_es();
@@ -336674,12 +336957,12 @@ function print() { __p += __j.call(arguments, '') }
336674
336957
  onMouseenter: ($event) => activeUserIndex.value = index2,
336675
336958
  onMouseleave: _cache[0] || (_cache[0] = ($event) => activeUserIndex.value = null),
336676
336959
  key: user.email,
336677
- class: exports_vue.normalizeClass(["user-row", { selected: activeUserIndex.value === index2 }])
336960
+ class: exports_vue.normalizeClass(["user-row", { "sd-selected": activeUserIndex.value === index2 }])
336678
336961
  }, [user.name ? (exports_vue.openBlock(), exports_vue.createElementBlock("div", _hoisted_2$17, [user.name ? (exports_vue.openBlock(), exports_vue.createElementBlock("span", _hoisted_3$13, exports_vue.toDisplayString(user.name), 1)) : exports_vue.createCommentVNode("", true), user.name && user.email ? (exports_vue.openBlock(), exports_vue.createElementBlock("span", _hoisted_4$9, " (" + exports_vue.toDisplayString(user.email) + ")", 1)) : exports_vue.createCommentVNode("", true)])) : (exports_vue.openBlock(), exports_vue.createElementBlock("div", _hoisted_5$7, [exports_vue.createElementVNode("span", null, exports_vue.toDisplayString(user.email), 1)]))], 42, _hoisted_1$22);
336679
336962
  }), 128))], 544);
336680
336963
  };
336681
336964
  }
336682
- }, [["__scopeId", "data-v-dde587fd"]]);
336965
+ }, [["__scopeId", "data-v-b9684aad"]]);
336683
336966
  popoverPluginKey = new PluginKey("popoverPlugin");
336684
336967
  PopoverPlugin = Extension.create({
336685
336968
  name: "popoverPlugin",
@@ -336788,7 +337071,7 @@ function print() { __p += __j.call(arguments, '') }
336788
337071
  const text5 = node3.text || "";
336789
337072
  if (!text5.length)
336790
337073
  return;
336791
- if (hasTrackDeleteMark$1(node3)) {
337074
+ if (hasTrackDeleteMark$2(node3)) {
336792
337075
  appendDeletionBarrier();
336793
337076
  return;
336794
337077
  }
@@ -336830,7 +337113,7 @@ function print() { __p += __j.call(arguments, '') }
336830
337113
  }
336831
337114
  #walkNode(node3, docPos, offset$1, addSegment, searchModel = DEFAULT_SEARCH_MODEL$1, context = null) {
336832
337115
  if (node3.isText) {
336833
- if (searchModel === "visible" && hasTrackDeleteMark$1(node3)) {
337116
+ if (searchModel === "visible" && hasTrackDeleteMark$2(node3)) {
336834
337117
  if (context?.deletionBarrierActive)
336835
337118
  return offset$1;
336836
337119
  addSegment({
@@ -338146,7 +338429,7 @@ function print() { __p += __j.call(arguments, '') }
338146
338429
  }, null, 8, _hoisted_5$6)) : exports_vue.createCommentVNode("", true)])], 544);
338147
338430
  };
338148
338431
  }
338149
- }, [["__scopeId", "data-v-79953d57"]]);
338432
+ }, [["__scopeId", "data-v-5444b0c8"]]);
338150
338433
  isHighContrastMode = exports_vue.ref(false);
338151
338434
  toolbarIcons = {
338152
338435
  undo: rotate_left_solid_default,
@@ -338310,7 +338593,7 @@ function print() { __p += __j.call(arguments, '') }
338310
338593
  return exports_vue.openBlock(), exports_vue.createElementBlock("div", { class: exports_vue.normalizeClass(["alignment-buttons", { "high-contrast": exports_vue.unref(isHighContrastMode$1) }]) }, [(exports_vue.openBlock(), exports_vue.createElementBlock(exports_vue.Fragment, null, exports_vue.renderList(alignmentButtons, (button, index2) => {
338311
338594
  return exports_vue.createElementVNode("div", {
338312
338595
  key: button.key,
338313
- class: "button-icon",
338596
+ class: "sd-button-icon",
338314
338597
  onClick: ($event) => select2(button.key),
338315
338598
  innerHTML: button.icon,
338316
338599
  "data-item": "btn-textAlign-option",
@@ -338324,7 +338607,7 @@ function print() { __p += __j.call(arguments, '') }
338324
338607
  }), 64))], 2);
338325
338608
  };
338326
338609
  }
338327
- }, [["__scopeId", "data-v-3f7f0d98"]]);
338610
+ }, [["__scopeId", "data-v-ceb338e0"]]);
338328
338611
  _hoisted_1$19 = [
338329
338612
  "onClick",
338330
338613
  "innerHTML",
@@ -338404,7 +338687,7 @@ function print() { __p += __j.call(arguments, '') }
338404
338687
  return exports_vue.openBlock(), exports_vue.createElementBlock("div", { class: exports_vue.normalizeClass(["style-buttons-list", { "high-contrast": exports_vue.unref(isHighContrastMode$1) }]) }, [(exports_vue.openBlock(true), exports_vue.createElementBlock(exports_vue.Fragment, null, exports_vue.renderList(props.buttons, (button, index2) => {
338405
338688
  return exports_vue.openBlock(), exports_vue.createElementBlock("div", {
338406
338689
  key: button.key,
338407
- class: exports_vue.normalizeClass(["button-icon", { selected: props.selectedStyle === button.key }]),
338690
+ class: exports_vue.normalizeClass(["sd-button-icon", { "sd-selected": props.selectedStyle === button.key }]),
338408
338691
  style: exports_vue.normalizeStyle(iconStyle.value),
338409
338692
  onClick: ($event) => select2(button.key),
338410
338693
  innerHTML: button.icon,
@@ -338418,7 +338701,7 @@ function print() { __p += __j.call(arguments, '') }
338418
338701
  }), 128))], 2);
338419
338702
  };
338420
338703
  }
338421
- }, [["__scopeId", "data-v-d374ab76"]]);
338704
+ }, [["__scopeId", "data-v-701c1d54"]]);
338422
338705
  bulletStyleButtons = [
338423
338706
  {
338424
338707
  key: "disc",
@@ -338536,7 +338819,7 @@ function print() { __p += __j.call(arguments, '') }
338536
338819
  return (_ctx, _cache) => {
338537
338820
  return exports_vue.openBlock(), exports_vue.createElementBlock("div", { class: exports_vue.normalizeClass(["document-mode", { "high-contrast": exports_vue.unref(isHighContrastMode$1) }]) }, [(exports_vue.openBlock(true), exports_vue.createElementBlock(exports_vue.Fragment, null, exports_vue.renderList(__props.options, (option, index2) => {
338538
338821
  return exports_vue.openBlock(), exports_vue.createElementBlock("div", {
338539
- class: exports_vue.normalizeClass(["option-item", { disabled: option.disabled }]),
338822
+ class: exports_vue.normalizeClass(["sd-option-item", { "sd-disabled": option.disabled }]),
338540
338823
  onClick: ($event) => handleClick$1(option),
338541
338824
  "data-item": "btn-documentMode-option",
338542
338825
  role: "menuitem",
@@ -338551,7 +338834,7 @@ function print() { __p += __j.call(arguments, '') }
338551
338834
  }), 256))], 2);
338552
338835
  };
338553
338836
  }
338554
- }, [["__scopeId", "data-v-8587478e"]]);
338837
+ }, [["__scopeId", "data-v-abd514d9"]]);
338555
338838
  _hoisted_1$17 = {
338556
338839
  key: 0,
338557
338840
  class: "linked-style-buttons",
@@ -338853,13 +339136,13 @@ function print() { __p += __j.call(arguments, '') }
338853
339136
  type: "text",
338854
339137
  name: "link",
338855
339138
  placeholder: "Type or paste a link",
338856
- class: exports_vue.normalizeClass({ error: urlError.value }),
339139
+ class: exports_vue.normalizeClass({ "sd-error": urlError.value }),
338857
339140
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => rawUrl.value = $event),
338858
339141
  readonly: isViewingMode.value,
338859
339142
  onKeydown: [exports_vue.withKeys(exports_vue.withModifiers(handleSubmit, ["stop", "prevent"]), ["enter"]), _cache[3] || (_cache[3] = ($event) => urlError.value = false)]
338860
339143
  }, null, 42, _hoisted_10$1), [[exports_vue.vModelText, rawUrl.value]]),
338861
339144
  exports_vue.createElementVNode("div", {
338862
- class: exports_vue.normalizeClass(["open-link-icon", { disabled: !validUrl.value }]),
339145
+ class: exports_vue.normalizeClass(["open-link-icon", { "sd-disabled": !validUrl.value }]),
338863
339146
  innerHTML: exports_vue.unref(toolbarIcons).openLink,
338864
339147
  onClick: openLink,
338865
339148
  "data-item": "btn-link-open"
@@ -338874,14 +339157,14 @@ function print() { __p += __j.call(arguments, '') }
338874
339157
  class: "remove-btn__icon",
338875
339158
  innerHTML: exports_vue.unref(toolbarIcons).removeLink
338876
339159
  }, null, 8, _hoisted_13), _cache[6] || (_cache[6] = exports_vue.createTextVNode(" Remove ", -1))])) : exports_vue.createCommentVNode("", true), exports_vue.createElementVNode("button", {
338877
- class: exports_vue.normalizeClass(["submit-btn", { "disable-btn": isDisabled.value }]),
339160
+ class: exports_vue.normalizeClass(["sd-submit-btn", { "disable-btn": isDisabled.value }]),
338878
339161
  onClick: handleSubmit,
338879
339162
  "data-item": "btn-link-apply"
338880
339163
  }, " Apply ", 2)])) : exports_vue.createCommentVNode("", true)
338881
339164
  ])) : isAnchor.value ? (exports_vue.openBlock(), exports_vue.createElementBlock("div", _hoisted_14, [exports_vue.createElementVNode("a", { onClick: _cache[4] || (_cache[4] = exports_vue.withModifiers(($event) => navigateToAnchor(rawUrl.value), ["stop", "prevent"])) }, "Go to " + exports_vue.toDisplayString(rawUrl.value.startsWith("#_") ? rawUrl.value.substring(2) : rawUrl.value), 1)])) : exports_vue.createCommentVNode("", true)], 2);
338882
339165
  };
338883
339166
  }
338884
- }, [["__scopeId", "data-v-56a53c8c"]]);
339167
+ }, [["__scopeId", "data-v-c490d677"]]);
338885
339168
  _hoisted_1$15 = [
338886
339169
  "aria-label",
338887
339170
  "onClick",
@@ -338988,7 +339271,7 @@ function print() { __p += __j.call(arguments, '') }
338988
339271
  return (_ctx, _cache) => {
338989
339272
  return exports_vue.openBlock(true), exports_vue.createElementBlock(exports_vue.Fragment, null, exports_vue.renderList(__props.icons, (row2, rowIndex) => {
338990
339273
  return exports_vue.openBlock(), exports_vue.createElementBlock("div", {
338991
- class: "option-row",
339274
+ class: "sd-option-row",
338992
339275
  key: rowIndex,
338993
339276
  role: "group",
338994
339277
  ref_for: true,
@@ -338996,7 +339279,7 @@ function print() { __p += __j.call(arguments, '') }
338996
339279
  ref: rowRefs
338997
339280
  }, [(exports_vue.openBlock(true), exports_vue.createElementBlock(exports_vue.Fragment, null, exports_vue.renderList(row2, (option, optionIndex) => {
338998
339281
  return exports_vue.openBlock(), exports_vue.createElementBlock("div", {
338999
- class: "option",
339282
+ class: "sd-option",
339000
339283
  key: optionIndex,
339001
339284
  "aria-label": option.label,
339002
339285
  role: "menuitem",
@@ -339006,12 +339289,12 @@ function print() { __p += __j.call(arguments, '') }
339006
339289
  onClick: exports_vue.withModifiers(($event) => handleClick$1(option), ["stop", "prevent"]),
339007
339290
  onKeydown: exports_vue.withModifiers((event) => handleKeyDown$1(event, rowIndex, optionIndex, option), ["prevent"])
339008
339291
  }, [exports_vue.createElementVNode("div", {
339009
- class: "option__icon",
339292
+ class: "sd-option__icon",
339010
339293
  innerHTML: option.icon,
339011
339294
  style: exports_vue.normalizeStyle(option.style)
339012
339295
  }, null, 12, _hoisted_2$12), isActive$1.value(option) ? (exports_vue.openBlock(), exports_vue.createElementBlock("div", {
339013
339296
  key: 0,
339014
- class: "option__check",
339297
+ class: "sd-option__check",
339015
339298
  innerHTML: exports_vue.unref(toolbarIcons).colorOptionCheck,
339016
339299
  style: exports_vue.normalizeStyle(getCheckStyle(option.value, optionIndex))
339017
339300
  }, null, 12, _hoisted_3$9)) : exports_vue.createCommentVNode("", true)], 40, _hoisted_1$15);
@@ -339019,7 +339302,7 @@ function print() { __p += __j.call(arguments, '') }
339019
339302
  }), 128);
339020
339303
  };
339021
339304
  }
339022
- }, [["__scopeId", "data-v-59855ce7"]]);
339305
+ }, [["__scopeId", "data-v-30cad300"]]);
339023
339306
  _hoisted_1$14 = { class: "options-grid-wrap" };
339024
339307
  _hoisted_2$11 = ["innerHTML"];
339025
339308
  _hoisted_3$8 = { class: "option-grid-ctn" };
@@ -339175,9 +339458,9 @@ function print() { __p += __j.call(arguments, '') }
339175
339458
  let itemsCols = parseInt(item.dataset.cols, 10);
339176
339459
  let itemsRows = parseInt(item.dataset.rows, 10);
339177
339460
  if (itemsCols <= cols && itemsRows <= rows)
339178
- item.classList.add("selected");
339461
+ item.classList.add("sd-selected");
339179
339462
  else
339180
- item.classList.remove("selected");
339463
+ item.classList.remove("sd-selected");
339181
339464
  }
339182
339465
  };
339183
339466
  const handleClick$1 = ({ cols, rows }) => {
@@ -339270,7 +339553,7 @@ function print() { __p += __j.call(arguments, '') }
339270
339553
  }, exports_vue.toDisplayString(selectedRows.value) + " x " + exports_vue.toDisplayString(selectedCols.value), 9, _hoisted_2$10)], 2);
339271
339554
  };
339272
339555
  }
339273
- }, [["__scopeId", "data-v-5cefb109"]]);
339556
+ }, [["__scopeId", "data-v-168b91ce"]]);
339274
339557
  _hoisted_1$12 = { class: "toolbar-table-actions" };
339275
339558
  _hoisted_2$9 = [
339276
339559
  "onClick",
@@ -339306,7 +339589,7 @@ function print() { __p += __j.call(arguments, '') }
339306
339589
  }
339307
339590
  }, [["__scopeId", "data-v-652015c8"]]);
339308
339591
  _hoisted_1$11 = { class: "search-input-ctn" };
339309
- _hoisted_2$8 = { class: "row" };
339592
+ _hoisted_2$8 = { class: "sd-row" };
339310
339593
  _hoisted_3$6 = ["onKeydown"];
339311
339594
  SearchInput_default = /* @__PURE__ */ __plugin_vue_export_helper_default({
339312
339595
  __name: "SearchInput",
@@ -339327,13 +339610,13 @@ function print() { __p += __j.call(arguments, '') }
339327
339610
  name: "search",
339328
339611
  placeholder: "Type search string",
339329
339612
  onKeydown: exports_vue.withKeys(exports_vue.withModifiers(handleSubmit, ["stop", "prevent"]), ["enter"])
339330
- }, null, 40, _hoisted_3$6), [[exports_vue.vModelText, searchValue.value]])]), exports_vue.createElementVNode("div", { class: "row submit" }, [exports_vue.createElementVNode("button", {
339331
- class: "submit-btn",
339613
+ }, null, 40, _hoisted_3$6), [[exports_vue.vModelText, searchValue.value]])]), exports_vue.createElementVNode("div", { class: "sd-row sd-submit" }, [exports_vue.createElementVNode("button", {
339614
+ class: "sd-submit-btn",
339332
339615
  onClick: handleSubmit
339333
339616
  }, "Apply")])]);
339334
339617
  };
339335
339618
  }
339336
- }, [["__scopeId", "data-v-bfe34b7b"]]);
339619
+ }, [["__scopeId", "data-v-d25821a5"]]);
339337
339620
  TOOLBAR_FONTS = [
339338
339621
  {
339339
339622
  label: "Georgia",
@@ -339500,7 +339783,7 @@ function print() { __p += __j.call(arguments, '') }
339500
339783
  HEADLESS_TOOLBAR_COMMANDS = [...new Set([...Object.values(HEADLESS_ITEM_MAP), ...TABLE_ACTION_COMMAND_IDS])];
339501
339784
  NON_HEADLESS_EXECUTE_ITEM_NAMES = new Set(["link"]);
339502
339785
  HEADLESS_EXECUTE_ITEMS = new Set(Object.keys(HEADLESS_ITEM_MAP).filter((itemName) => !NON_HEADLESS_EXECUTE_ITEM_NAMES.has(itemName)));
339503
- _hoisted_1$10 = { class: "toolbar-icon" };
339786
+ _hoisted_1$10 = { class: "sd-toolbar-icon" };
339504
339787
  _hoisted_2$7 = ["innerHTML"];
339505
339788
  ToolbarButtonIcon_default = /* @__PURE__ */ __plugin_vue_export_helper_default({
339506
339789
  __name: "ToolbarButtonIcon",
@@ -339531,7 +339814,7 @@ function print() { __p += __j.call(arguments, '') }
339531
339814
  });
339532
339815
  return (_ctx, _cache) => {
339533
339816
  return exports_vue.openBlock(), exports_vue.createElementBlock("div", _hoisted_1$10, [exports_vue.createElementVNode("div", {
339534
- class: exports_vue.normalizeClass(["toolbar-icon__icon", [`toolbar-icon__icon--${props.name}`]]),
339817
+ class: exports_vue.normalizeClass(["sd-toolbar-icon__icon", [`sd-toolbar-icon__icon--${props.name}`]]),
339535
339818
  innerHTML: __props.icon
339536
339819
  }, null, 10, _hoisted_2$7), hasColorBar.value ? (exports_vue.openBlock(), exports_vue.createElementBlock("div", {
339537
339820
  key: 0,
@@ -339540,19 +339823,19 @@ function print() { __p += __j.call(arguments, '') }
339540
339823
  }, null, 4)) : exports_vue.createCommentVNode("", true)]);
339541
339824
  };
339542
339825
  }
339543
- }, [["__scopeId", "data-v-8c30c125"]]);
339826
+ }, [["__scopeId", "data-v-521c3d93"]]);
339544
339827
  _hoisted_1$9 = ["role", "aria-label"];
339545
339828
  _hoisted_2$6 = ["data-item"];
339546
339829
  _hoisted_3$5 = ["data-item"];
339547
339830
  _hoisted_4$4 = {
339548
339831
  key: 1,
339549
- class: "button-label"
339832
+ class: "sd-button-label"
339550
339833
  };
339551
339834
  _hoisted_5$2 = ["data-item", "aria-label"];
339552
339835
  _hoisted_6$1 = ["innerHTML"];
339553
339836
  _hoisted_7$1 = {
339554
339837
  key: 1,
339555
- class: "button-label"
339838
+ class: "sd-button-label"
339556
339839
  };
339557
339840
  _hoisted_8 = { key: 2 };
339558
339841
  _hoisted_9 = ["onKeydown", "id"];
@@ -339564,7 +339847,7 @@ function print() { __p += __j.call(arguments, '') }
339564
339847
  _hoisted_11 = ["innerHTML"];
339565
339848
  _hoisted_12 = {
339566
339849
  "aria-live": "polite",
339567
- class: "visually-hidden"
339850
+ class: "sd-visually-hidden"
339568
339851
  };
339569
339852
  ToolbarButton_default = /* @__PURE__ */ __plugin_vue_export_helper_default({
339570
339853
  __name: "ToolbarButton",
@@ -339662,17 +339945,18 @@ function print() { __p += __j.call(arguments, '') }
339662
339945
  });
339663
339946
  return (_ctx, _cache) => {
339664
339947
  return exports_vue.openBlock(), exports_vue.createElementBlock("div", {
339665
- class: exports_vue.normalizeClass(["toolbar-item", exports_vue.unref(attributes).className]),
339948
+ class: exports_vue.normalizeClass(["sd-toolbar-item", exports_vue.unref(attributes).className]),
339666
339949
  style: exports_vue.normalizeStyle(getStyle.value),
339667
339950
  role: __props.isOverflowItem ? "menuitem" : "button",
339668
339951
  "aria-label": exports_vue.unref(attributes).ariaLabel,
339952
+ "data-sd-part": "toolbar-item",
339669
339953
  onClick: handleOuterClick,
339670
339954
  onKeydown: _cache[3] || (_cache[3] = exports_vue.withKeys(($event) => onEnterKeydown($event), ["enter"])),
339671
339955
  tabindex: "0"
339672
339956
  }, [exports_vue.createElementVNode("div", {
339673
- class: exports_vue.normalizeClass(["toolbar-button", {
339674
- active: exports_vue.unref(active),
339675
- disabled: exports_vue.unref(disabled),
339957
+ class: exports_vue.normalizeClass(["sd-toolbar-button", {
339958
+ "sd-active": exports_vue.unref(active),
339959
+ "sd-disabled": exports_vue.unref(disabled),
339676
339960
  narrow: __props.isNarrow,
339677
339961
  wide: __props.isWide,
339678
339962
  split: isSplit.value,
@@ -339683,13 +339967,13 @@ function print() { __p += __j.call(arguments, '') }
339683
339967
  }, [
339684
339968
  isSplit.value ? (exports_vue.openBlock(), exports_vue.createElementBlock("div", {
339685
339969
  key: 0,
339686
- class: "toolbar-button__main",
339970
+ class: "sd-toolbar-button__main",
339687
339971
  "data-item": `btn-${exports_vue.unref(name) || ""}-main`,
339688
339972
  onClick: _cache[0] || (_cache[0] = ($event) => handleSplitMainClick($event))
339689
339973
  }, [exports_vue.unref(icon) ? (exports_vue.openBlock(), exports_vue.createBlock(ToolbarButtonIcon_default, {
339690
339974
  key: 0,
339691
339975
  color: exports_vue.unref(iconColor),
339692
- class: "toolbar-icon",
339976
+ class: "sd-toolbar-icon",
339693
339977
  icon: exports_vue.unref(icon),
339694
339978
  name: exports_vue.unref(name)
339695
339979
  }, null, 8, [
@@ -339699,19 +339983,19 @@ function print() { __p += __j.call(arguments, '') }
339699
339983
  ])) : exports_vue.createCommentVNode("", true), exports_vue.unref(label) && !exports_vue.unref(hideLabel) && !exports_vue.unref(inlineTextInputVisible) ? (exports_vue.openBlock(), exports_vue.createElementBlock("div", _hoisted_4$4, exports_vue.toDisplayString(exports_vue.unref(label)), 1)) : exports_vue.createCommentVNode("", true)], 8, _hoisted_3$5)) : exports_vue.createCommentVNode("", true),
339700
339984
  isSplit.value ? (exports_vue.openBlock(), exports_vue.createElementBlock("div", {
339701
339985
  key: 1,
339702
- class: "toolbar-button__caret",
339986
+ class: "sd-toolbar-button__caret",
339703
339987
  "data-item": `btn-${exports_vue.unref(name) || ""}-caret`,
339704
339988
  "aria-label": `${exports_vue.unref(attributes).ariaLabel} options`,
339705
339989
  role: "button"
339706
339990
  }, [exports_vue.createElementVNode("div", {
339707
- class: "dropdown-caret",
339991
+ class: "sd-dropdown-caret",
339708
339992
  innerHTML: caretIcon.value,
339709
339993
  style: exports_vue.normalizeStyle({ opacity: exports_vue.unref(disabled) ? 0.6 : 1 })
339710
339994
  }, null, 12, _hoisted_6$1)], 8, _hoisted_5$2)) : (exports_vue.openBlock(), exports_vue.createElementBlock(exports_vue.Fragment, { key: 2 }, [
339711
339995
  exports_vue.unref(icon) ? (exports_vue.openBlock(), exports_vue.createBlock(ToolbarButtonIcon_default, {
339712
339996
  key: 0,
339713
339997
  color: exports_vue.unref(iconColor),
339714
- class: "toolbar-icon",
339998
+ class: "sd-toolbar-icon",
339715
339999
  icon: exports_vue.unref(icon),
339716
340000
  name: exports_vue.unref(name)
339717
340001
  }, null, 8, [
@@ -339744,7 +340028,7 @@ function print() { __p += __j.call(arguments, '') }
339744
340028
  }, null, 40, _hoisted_10)), [[exports_vue.vModelText, inlineTextInput.value]])])) : exports_vue.createCommentVNode("", true),
339745
340029
  exports_vue.unref(hasCaret) ? (exports_vue.openBlock(), exports_vue.createElementBlock("div", {
339746
340030
  key: 3,
339747
- class: "dropdown-caret",
340031
+ class: "sd-dropdown-caret",
339748
340032
  innerHTML: caretIcon.value,
339749
340033
  style: exports_vue.normalizeStyle({ opacity: exports_vue.unref(disabled) ? 0.6 : 1 })
339750
340034
  }, null, 12, _hoisted_11)) : exports_vue.createCommentVNode("", true)
@@ -339753,7 +340037,7 @@ function print() { __p += __j.call(arguments, '') }
339753
340037
  ], 10, _hoisted_2$6)], 46, _hoisted_1$9);
339754
340038
  };
339755
340039
  }
339756
- }, [["__scopeId", "data-v-dcf6ef0b"]]);
340040
+ }, [["__scopeId", "data-v-360f6a95"]]);
339757
340041
  _hoisted_1$8 = {
339758
340042
  class: "toolbar-separator",
339759
340043
  role: "separator",
@@ -339990,11 +340274,11 @@ function print() { __p += __j.call(arguments, '') }
339990
340274
  if (!value)
339991
340275
  return false;
339992
340276
  if (typeof value === "string")
339993
- return value.split(/\s+/).includes("selected");
340277
+ return value.split(/\s+/).includes("sd-selected");
339994
340278
  if (Array.isArray(value))
339995
340279
  return value.some(classHasSelected);
339996
340280
  if (typeof value === "object")
339997
- return Boolean(value.selected);
340281
+ return Boolean(value["sd-selected"]);
339998
340282
  return false;
339999
340283
  };
340000
340284
  const isOptionSelected = (option) => {
@@ -340185,12 +340469,14 @@ function print() { __p += __j.call(arguments, '') }
340185
340469
  ref_key: "triggerRef",
340186
340470
  ref: triggerRef,
340187
340471
  class: "toolbar-dropdown-trigger",
340472
+ "data-sd-part": "dropdown-trigger",
340188
340473
  onClick: onTriggerClick
340189
340474
  }, [exports_vue.renderSlot(_ctx.$slots, "trigger", {}, undefined, true)], 512), (exports_vue.openBlock(), exports_vue.createBlock(exports_vue.Teleport, { to: "body" }, [exports_vue.createVNode(exports_vue.Transition, { name: "fade-in-scale-up-transition" }, {
340190
340475
  default: exports_vue.withCtx(() => [isOpen.value ? (exports_vue.openBlock(), exports_vue.createElementBlock("div", exports_vue.mergeProps({
340191
340476
  key: 0,
340192
340477
  ref_key: "menuRef",
340193
340478
  ref: menuRef,
340479
+ "data-sd-part": "dropdown-menu",
340194
340480
  class: mergedMenuClass.value,
340195
340481
  style: menuStyle.value
340196
340482
  }, computedMenuAttrs.value), [(exports_vue.openBlock(true), exports_vue.createElementBlock(exports_vue.Fragment, null, exports_vue.renderList(__props.options, (option, index2) => {
@@ -340202,8 +340488,8 @@ function print() { __p += __j.call(arguments, '') }
340202
340488
  option.class,
340203
340489
  option.props?.class,
340204
340490
  {
340205
- disabled: option.disabled,
340206
- render: isRenderOption(option)
340491
+ "sd-disabled": option.disabled,
340492
+ "sd-render": isRenderOption(option)
340207
340493
  }
340208
340494
  ]],
340209
340495
  tabindex: "-1",
@@ -340220,7 +340506,7 @@ function print() { __p += __j.call(arguments, '') }
340220
340506
  })]))]);
340221
340507
  };
340222
340508
  }
340223
- }, [["__scopeId", "data-v-261e2a66"]]);
340509
+ }, [["__scopeId", "data-v-302f7d86"]]);
340224
340510
  SdTooltip_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
340225
340511
  __name: "SdTooltip",
340226
340512
  props: {
@@ -340571,7 +340857,7 @@ function print() { __p += __j.call(arguments, '') }
340571
340857
  ...option,
340572
340858
  props: {
340573
340859
  ...option.props,
340574
- class: isSelected ? "selected" : ""
340860
+ class: isSelected ? "sd-selected" : ""
340575
340861
  }
340576
340862
  };
340577
340863
  });
@@ -340584,7 +340870,7 @@ function print() { __p += __j.call(arguments, '') }
340584
340870
  };
340585
340871
  const moveToNextButton = (e) => {
340586
340872
  const currentButton = e.target;
340587
- const nextButton = e.target.closest(".toolbar-item-ctn").nextElementSibling;
340873
+ const nextButton = e.target.closest(".sd-toolbar-item-ctn").nextElementSibling;
340588
340874
  if (nextButton) {
340589
340875
  currentButton.setAttribute("tabindex", "-1");
340590
340876
  nextButton.setAttribute("tabindex", "0");
@@ -340593,7 +340879,7 @@ function print() { __p += __j.call(arguments, '') }
340593
340879
  };
340594
340880
  const moveToPreviousButton = (e) => {
340595
340881
  const currentButton = e.target;
340596
- const previousButton = e.target.closest(".toolbar-item-ctn").previousElementSibling;
340882
+ const previousButton = e.target.closest(".sd-toolbar-item-ctn").previousElementSibling;
340597
340883
  if (previousButton) {
340598
340884
  currentButton.setAttribute("tabindex", "-1");
340599
340885
  previousButton.setAttribute("tabindex", "0");
@@ -340671,7 +340957,7 @@ function print() { __p += __j.call(arguments, '') }
340671
340957
  }
340672
340958
  };
340673
340959
  const handleFocus = (e) => {
340674
- const firstButton = toolbarItemRefs.value.find((item) => !item.classList.contains("disabled"));
340960
+ const firstButton = toolbarItemRefs.value.find((item) => !item.classList.contains("sd-disabled"));
340675
340961
  if (firstButton) {
340676
340962
  firstButton.setAttribute("tabindex", "0");
340677
340963
  firstButton.focus();
@@ -340727,8 +341013,8 @@ function print() { __p += __j.call(arguments, '') }
340727
341013
  class: exports_vue.normalizeClass([{
340728
341014
  narrow: item.isNarrow.value,
340729
341015
  wide: item.isWide.value,
340730
- disabled: item.disabled.value
340731
- }, "toolbar-item-ctn"]),
341016
+ "sd-disabled": item.disabled.value
341017
+ }, "sd-toolbar-item-ctn"]),
340732
341018
  onKeydown: (e) => handleKeyDown$1(e, item),
340733
341019
  ref_for: true,
340734
341020
  ref_key: "toolbarItemRefs",
@@ -340747,7 +341033,7 @@ function print() { __p += __j.call(arguments, '') }
340747
341033
  show: getExpanded(item),
340748
341034
  "content-style": { fontFamily: props.uiFontFamily },
340749
341035
  placement: "bottom-start",
340750
- class: "toolbar-button sd-editor-toolbar-dropdown",
341036
+ class: "sd-toolbar-button sd-editor-toolbar-dropdown",
340751
341037
  onSelect: (key2, option) => handleSelect(item, option),
340752
341038
  "onUpdate:show": (open2) => handleDropdownUpdateShowForItem(open2, item),
340753
341039
  style: exports_vue.normalizeStyle(item.dropdownStyles.value),
@@ -340824,7 +341110,7 @@ function print() { __p += __j.call(arguments, '') }
340824
341110
  }), 128))], 36);
340825
341111
  };
340826
341112
  }
340827
- }, [["__scopeId", "data-v-109576cd"]]);
341113
+ }, [["__scopeId", "data-v-9c3524ec"]]);
340828
341114
  Toolbar_default = /* @__PURE__ */ __plugin_vue_export_helper_default({
340829
341115
  __name: "Toolbar",
340830
341116
  emits: [
@@ -340918,6 +341204,7 @@ function print() { __p += __j.call(arguments, '') }
340918
341204
  key: exports_vue.unref(toolbarKey),
340919
341205
  role: "toolbar",
340920
341206
  "aria-label": "Toolbar",
341207
+ "data-sd-part": "toolbar",
340921
341208
  "data-editor-ui-surface": "",
340922
341209
  onMousedown: handleToolbarMousedown
340923
341210
  }, [
@@ -340969,7 +341256,7 @@ function print() { __p += __j.call(arguments, '') }
340969
341256
  ], 32);
340970
341257
  };
340971
341258
  }
340972
- }, [["__scopeId", "data-v-bae4cd8a"]]);
341259
+ }, [["__scopeId", "data-v-b83d488a"]]);
340973
341260
  toolbarTexts = {
340974
341261
  bold: "Bold",
340975
341262
  fontFamily: "Font",
@@ -341058,7 +341345,8 @@ function print() { __p += __j.call(arguments, '') }
341058
341345
  aiApiKey: null,
341059
341346
  aiEndpoint: null,
341060
341347
  customButtons: [],
341061
- showFormattingMarksButton: false
341348
+ showFormattingMarksButton: false,
341349
+ showTableOfContentsButton: false
341062
341350
  };
341063
341351
  toolbarItems = [];
341064
341352
  overflowItems = [];
@@ -353365,11 +353653,11 @@ function print() { __p += __j.call(arguments, '') }
353365
353653
  ]);
353366
353654
  });
353367
353655
 
353368
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-DKJYU_qM.es.js
353656
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-BKVodoDg.es.js
353369
353657
  var MOD_ALIASES, ALT_ALIASES, CTRL_ALIASES, SHIFT_ALIASES, BUILTIN_CONTEXT_MENU_GROUPS, BUILTIN_GROUP_ORDER, RESERVED_PROXY_PROPERTY_NAMES, ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS;
353370
- var init_create_super_doc_ui_DKJYU_qM_es = __esm(() => {
353371
- init_SuperConverter_C6hKp29w_es();
353372
- init_create_headless_toolbar_ISx0N5AS_es();
353658
+ var init_create_super_doc_ui_BKVodoDg_es = __esm(() => {
353659
+ init_SuperConverter_DHtZjY65_es();
353660
+ init_create_headless_toolbar_lxRAue2X_es();
353373
353661
  MOD_ALIASES = new Set([
353374
353662
  "Mod",
353375
353663
  "Meta",
@@ -353411,16 +353699,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
353411
353699
 
353412
353700
  // ../../packages/superdoc/dist/super-editor.es.js
353413
353701
  var init_super_editor_es = __esm(() => {
353414
- init_src_Bm7Xq4ys_es();
353415
- init_SuperConverter_C6hKp29w_es();
353702
+ init_src_BlbgbalI_es();
353703
+ init_SuperConverter_DHtZjY65_es();
353416
353704
  init_jszip_C49i9kUs_es();
353417
353705
  init_xml_js_CqGKpaft_es();
353418
- init_create_headless_toolbar_ISx0N5AS_es();
353706
+ init_create_headless_toolbar_lxRAue2X_es();
353419
353707
  init_constants_D_X7xF4s_es();
353420
353708
  init_dist_B8HfvhaK_es();
353421
353709
  init_unified_Dsuw2be5_es();
353422
353710
  init_DocxZipper_nv_KfOqb_es();
353423
- init_create_super_doc_ui_DKJYU_qM_es();
353711
+ init_create_super_doc_ui_BKVodoDg_es();
353424
353712
  init_ui_C5PAS9hY_es();
353425
353713
  init_eventemitter3_BnGqBE_Q_es();
353426
353714
  init_errors_CNaD6vcg_es();