@harbour-enterprises/superdoc 0.21.0-RC2 → 0.21.0-next.2

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 (32) hide show
  1. package/README.md +4 -4
  2. package/dist/chunks/{PdfViewer-DGbJ8_qc.cjs → PdfViewer-1mNuyy3m.cjs} +1 -1
  3. package/dist/chunks/{PdfViewer-CbGuPQY8.es.js → PdfViewer-BkXBRXPs.es.js} +1 -1
  4. package/dist/chunks/{index-ecl0ZFNw.cjs → index-BB3Qn69u.cjs} +57 -15
  5. package/dist/chunks/{index-qjntJEk0.es.js → index-C-44kxYe.es.js} +57 -15
  6. package/dist/chunks/{super-editor.es-BF_Xaucb.es.js → super-editor.es-CKw7iZcz.es.js} +217 -128
  7. package/dist/chunks/{super-editor.es-CS5l-cVZ.cjs → super-editor.es-Dd0joLAR.cjs} +217 -128
  8. package/dist/core/SuperDoc.d.ts.map +1 -1
  9. package/dist/stores/comments-store.d.ts.map +1 -1
  10. package/dist/style.css +1 -1
  11. package/dist/super-editor/ai-writer.es.js +2 -2
  12. package/dist/super-editor/chunks/{converter-DUqGq6qj.js → converter-FESR2WO7.js} +41 -25
  13. package/dist/super-editor/chunks/{docx-zipper-CQsQR8Zs.js → docx-zipper-BWZ2o1H5.js} +1 -1
  14. package/dist/super-editor/chunks/{editor-gMF6aWiz.js → editor-XsrBXzy-.js} +156 -93
  15. package/dist/super-editor/chunks/{toolbar-BxsT1ZgG.js → toolbar-tBWlOBPh.js} +21 -11
  16. package/dist/super-editor/converter.es.js +1 -1
  17. package/dist/super-editor/docx-zipper.es.js +2 -2
  18. package/dist/super-editor/editor.es.js +3 -3
  19. package/dist/super-editor/file-zipper.es.js +1 -1
  20. package/dist/super-editor/src/extensions/comment/comment-import-helpers.d.ts +15 -0
  21. package/dist/super-editor/src/extensions/search/prosemirror-search-patched.d.ts +110 -0
  22. package/dist/super-editor/style.css +1 -1
  23. package/dist/super-editor/super-editor.es.js +6 -6
  24. package/dist/super-editor/toolbar.es.js +2 -2
  25. package/dist/super-editor.cjs +1 -1
  26. package/dist/super-editor.es.js +1 -1
  27. package/dist/superdoc.cjs +2 -2
  28. package/dist/superdoc.es.js +2 -2
  29. package/dist/superdoc.umd.js +272 -141
  30. package/dist/superdoc.umd.js.map +1 -1
  31. package/npm-deprecation-notice.cjs +10 -0
  32. package/package.json +11 -6
@@ -19126,7 +19126,7 @@
19126
19126
  navigator.platform
19127
19127
  );
19128
19128
  };
19129
- const isRegExp = (value) => {
19129
+ const isRegExp$1 = (value) => {
19130
19130
  return Object.prototype.toString.call(value) === "[object RegExp]";
19131
19131
  };
19132
19132
  function objectIncludes(obj1, obj2, options = { strict: true }) {
@@ -19134,7 +19134,7 @@
19134
19134
  if (!keys2.length) return true;
19135
19135
  return keys2.every((key2) => {
19136
19136
  if (options.strict) return obj2[key2] === obj1[key2];
19137
- if (isRegExp(obj2[key2])) return obj2[key2].test(obj1[key2]);
19137
+ if (isRegExp$1(obj2[key2])) return obj2[key2].test(obj1[key2]);
19138
19138
  return obj2[key2] === obj1[key2];
19139
19139
  });
19140
19140
  }
@@ -31938,6 +31938,18 @@ Please report this to https://github.com/markedjs/marked.`, e) {
31938
31938
  }
31939
31939
  ]
31940
31940
  };
31941
+ const sanitizeDocxMediaName = (value, fallback = "image") => {
31942
+ if (!value) return fallback;
31943
+ const sanitized = value.replace(/[^a-zA-Z0-9_-]/g, "_");
31944
+ return sanitized || fallback;
31945
+ };
31946
+ const getFallbackImageNameFromDataUri = (src = "", fallback = "image") => {
31947
+ if (!src || typeof src !== "string") return fallback;
31948
+ const [prefix2] = src.split(";");
31949
+ const [, maybeType] = prefix2.split("/");
31950
+ const extension = maybeType?.toLowerCase();
31951
+ return extension ? `${fallback}.${extension}` : fallback;
31952
+ };
31941
31953
  const TranslatorTypes = Object.freeze({
31942
31954
  NODE: "node",
31943
31955
  ATTRIBUTE: "attribute"
@@ -32135,6 +32147,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32135
32147
  const validXmlAttributes$k = [attrConfig$D];
32136
32148
  const XML_NODE_NAME$s = "w:highlight";
32137
32149
  const SD_ATTR_KEY$f = "highlight";
32150
+ const DISABLED_TOKENS = /* @__PURE__ */ new Set(["transparent", "none", "inherit"]);
32138
32151
  const encode$13 = (params2, encodedAttrs = {}) => {
32139
32152
  const { nodes } = params2;
32140
32153
  const node = nodes?.[0];
@@ -32151,8 +32164,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32151
32164
  const highlightValue = attrs.highlight ?? attrs.color ?? null;
32152
32165
  if (!highlightValue) return void 0;
32153
32166
  const normalizedValue = String(highlightValue).trim().toLowerCase();
32154
- if (!normalizedValue || normalizedValue === "transparent" || normalizedValue === "none") {
32155
- return void 0;
32167
+ if (!normalizedValue) return void 0;
32168
+ if (DISABLED_TOKENS.has(normalizedValue)) {
32169
+ return {
32170
+ name: XML_NODE_NAME$s,
32171
+ attributes: { "w:val": "none" }
32172
+ };
32156
32173
  }
32157
32174
  const keyword = getDocxHighlightKeywordFromHex(highlightValue);
32158
32175
  if (keyword) {
@@ -35544,7 +35561,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35544
35561
  if (filteredMarks.length !== existingMarks2.length) {
35545
35562
  if (filteredMarks.length) child = { ...child, marks: filteredMarks };
35546
35563
  else {
35547
- const { marks, ...rest } = child;
35564
+ const { marks: _removedMarks, ...rest } = child;
35548
35565
  child = rest;
35549
35566
  }
35550
35567
  }
@@ -36054,18 +36071,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36054
36071
  }
36055
36072
  return handleImageNode(node, params2, true);
36056
36073
  }
36057
- const sanitizeDocxMediaName = (value, fallback = "image") => {
36058
- if (!value) return fallback;
36059
- const sanitized = value.replace(/[^a-zA-Z0-9_-]/g, "_");
36060
- return sanitized || fallback;
36061
- };
36062
- const getFallbackImageNameFromDataUri = (src = "", fallback = "image") => {
36063
- if (!src || typeof src !== "string") return fallback;
36064
- const [prefix2] = src.split(";");
36065
- const [, maybeType] = prefix2.split("/");
36066
- const extension = maybeType?.toLowerCase();
36067
- return extension ? `${fallback}.${extension}` : fallback;
36068
- };
36069
36074
  const translateImageNode = (params2) => {
36070
36075
  const {
36071
36076
  node: { attrs = {} },
@@ -37273,7 +37278,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
37273
37278
  }
37274
37279
  }
37275
37280
  const inputRuleMatcherHandler = (text, match) => {
37276
- if (isRegExp(match)) {
37281
+ if (isRegExp$1(match)) {
37277
37282
  return match.exec(text);
37278
37283
  }
37279
37284
  const inputRuleMatch = match(text);
@@ -38994,13 +38999,21 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38994
38999
  markElement.name = "w:rStyle";
38995
39000
  markElement.attributes["w:val"] = attrs.styleId;
38996
39001
  break;
38997
- case "color":
38998
- let processedColor = attrs.color.replace(/^#/, "").replace(/;$/, "");
39002
+ case "color": {
39003
+ const rawColor = attrs.color;
39004
+ if (!rawColor) break;
39005
+ const normalized = String(rawColor).trim().toLowerCase();
39006
+ if (normalized === "inherit") {
39007
+ markElement.attributes["w:val"] = "auto";
39008
+ break;
39009
+ }
39010
+ let processedColor = String(rawColor).replace(/^#/, "").replace(/;$/, "");
38999
39011
  if (processedColor.startsWith("rgb")) {
39000
39012
  processedColor = rgbToHex(processedColor);
39001
39013
  }
39002
39014
  markElement.attributes["w:val"] = processedColor;
39003
39015
  break;
39016
+ }
39004
39017
  case "textAlign":
39005
39018
  markElement.attributes["w:val"] = attrs.textAlign;
39006
39019
  break;
@@ -39991,27 +40004,30 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39991
40004
  trackedChange,
39992
40005
  trackedChangeText,
39993
40006
  trackedChangeType,
39994
- trackedDeletedText
40007
+ trackedDeletedText,
40008
+ isDone: false
39995
40009
  };
39996
40010
  });
39997
40011
  const extendedComments = generateCommentsWithExtendedData({ docx, comments: extractedComments });
39998
40012
  return extendedComments;
39999
40013
  }
40000
40014
  const generateCommentsWithExtendedData = ({ docx, comments }) => {
40015
+ if (!comments?.length) return [];
40001
40016
  const commentsExtended = docx["word/commentsExtended.xml"];
40002
- if (!commentsExtended) return [];
40003
- const { elements: initialElements } = commentsExtended;
40004
- const { elements } = initialElements[0];
40017
+ if (!commentsExtended) return comments.map((comment) => ({ ...comment, isDone: comment.isDone ?? false }));
40018
+ const { elements: initialElements = [] } = commentsExtended;
40019
+ if (!initialElements?.length) return comments.map((comment) => ({ ...comment, isDone: comment.isDone ?? false }));
40020
+ const { elements = [] } = initialElements[0] ?? {};
40005
40021
  const commentEx = elements.filter((el) => el.name === "w15:commentEx");
40006
40022
  return comments.map((comment) => {
40007
40023
  const extendedDef = commentEx.find((ce2) => ce2.attributes["w15:paraId"] === comment.paraId);
40008
- if (!extendedDef) return { ...comment };
40024
+ if (!extendedDef) return { ...comment, isDone: comment.isDone ?? false };
40009
40025
  const { isDone, paraIdParent } = getExtendedDetails(extendedDef);
40010
40026
  let parentComment;
40011
40027
  if (paraIdParent) parentComment = comments.find((c2) => c2.paraId === paraIdParent);
40012
40028
  const newComment = {
40013
40029
  ...comment,
40014
- isDone,
40030
+ isDone: isDone ?? false,
40015
40031
  parentCommentId: parentComment?.commentId
40016
40032
  };
40017
40033
  return newComment;
@@ -40820,7 +40836,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
40820
40836
  return;
40821
40837
  }
40822
40838
  }
40823
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.21.0-RC2") {
40839
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.20.2") {
40824
40840
  const customLocation = "docProps/custom.xml";
40825
40841
  if (!docx[customLocation]) {
40826
40842
  docx[customLocation] = generateCustomXml();
@@ -41313,7 +41329,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
41313
41329
  function generateCustomXml() {
41314
41330
  return DEFAULT_CUSTOM_XML;
41315
41331
  }
41316
- function generateSuperdocVersion(pid = 2, version2 = "0.21.0-RC2") {
41332
+ function generateSuperdocVersion(pid = 2, version2 = "0.20.2") {
41317
41333
  return {
41318
41334
  type: "element",
41319
41335
  name: "property",
@@ -45752,17 +45768,18 @@ Please report this to https://github.com/markedjs/marked.`, e) {
45752
45768
  }
45753
45769
  // Mark this node as being the selected node.
45754
45770
  selectNode() {
45755
- if (this.nodeDOM.nodeType == 1)
45771
+ if (this.nodeDOM.nodeType == 1) {
45756
45772
  this.nodeDOM.classList.add("ProseMirror-selectednode");
45757
- if (this.contentDOM || !this.node.type.spec.draggable)
45758
- this.dom.draggable = true;
45773
+ if (this.contentDOM || !this.node.type.spec.draggable)
45774
+ this.nodeDOM.draggable = true;
45775
+ }
45759
45776
  }
45760
45777
  // Remove selected node marking from this node.
45761
45778
  deselectNode() {
45762
45779
  if (this.nodeDOM.nodeType == 1) {
45763
45780
  this.nodeDOM.classList.remove("ProseMirror-selectednode");
45764
45781
  if (this.contentDOM || !this.node.type.spec.draggable)
45765
- this.dom.removeAttribute("draggable");
45782
+ this.nodeDOM.removeAttribute("draggable");
45766
45783
  }
45767
45784
  }
45768
45785
  get domAtom() {
@@ -47422,7 +47439,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
47422
47439
  }
47423
47440
  const target = flushed ? null : event.target;
47424
47441
  const targetDesc = target ? view.docView.nearestDesc(target, true) : null;
47425
- this.target = targetDesc && targetDesc.dom.nodeType == 1 ? targetDesc.dom : null;
47442
+ this.target = targetDesc && targetDesc.nodeDOM.nodeType == 1 ? targetDesc.nodeDOM : null;
47426
47443
  let { selection } = view.state;
47427
47444
  if (event.button == 0 && targetNode.type.spec.draggable && targetNode.type.spec.selectable !== false || selection instanceof NodeSelection && selection.from <= targetPos && selection.to > targetPos)
47428
47445
  this.mightDrag = {
@@ -55149,6 +55166,33 @@ Please report this to https://github.com/markedjs/marked.`, e) {
55149
55166
  return DecorationSet.create(state2.doc, decorations);
55150
55167
  };
55151
55168
  const CommentMarkName = "commentMark";
55169
+ const resolveCommentMeta = ({ converter, importedId }) => {
55170
+ const comments = converter?.comments || [];
55171
+ const matchingImportedComment = comments.find((c2) => c2.importedId == importedId);
55172
+ const resolvedCommentId = matchingImportedComment?.commentId ?? (importedId ? String(importedId) : v4$1());
55173
+ const internal = matchingImportedComment?.internal ?? matchingImportedComment?.isInternal ?? false;
55174
+ return {
55175
+ resolvedCommentId,
55176
+ importedId,
55177
+ internal,
55178
+ matchingImportedComment
55179
+ };
55180
+ };
55181
+ const ensureFallbackComment = ({ converter, matchingImportedComment, commentId, importedId }) => {
55182
+ if (matchingImportedComment || !converter) return;
55183
+ converter.comments = converter.comments || [];
55184
+ const alreadyExists = converter.comments.some((comment) => comment.commentId === commentId);
55185
+ if (alreadyExists) return;
55186
+ converter.comments.push({
55187
+ commentId,
55188
+ importedId,
55189
+ textJson: null,
55190
+ creatorName: null,
55191
+ creatorEmail: null,
55192
+ createdTime: null,
55193
+ isDone: false
55194
+ });
55195
+ };
55152
55196
  const removeCommentsById = ({ commentId, state: state2, tr, dispatch }) => {
55153
55197
  const positions = getCommentPositionsById(commentId, state2.doc);
55154
55198
  positions.forEach(({ from: from2, to }) => {
@@ -55242,24 +55286,31 @@ Please report this to https://github.com/markedjs/marked.`, e) {
55242
55286
  const { type: type2 } = node;
55243
55287
  const commentNodes = ["commentRangeStart", "commentRangeEnd", "commentReference"];
55244
55288
  if (!commentNodes.includes(type2.name)) return;
55245
- const matchingImportedComment = converter.comments?.find((c2) => c2.importedId == node.attrs["w:id"]) || {};
55246
- const { commentId } = matchingImportedComment;
55247
- if (!commentId) return;
55289
+ const { resolvedCommentId, importedId, internal, matchingImportedComment } = resolveCommentMeta({
55290
+ converter,
55291
+ importedId: node.attrs["w:id"]
55292
+ });
55248
55293
  if (type2.name === "commentRangeStart") {
55249
55294
  toMark.push({
55250
- "w:id": commentId,
55251
- importedId: node.attrs["w:id"],
55252
- internal: false,
55295
+ commentId: resolvedCommentId,
55296
+ importedId,
55297
+ internal,
55253
55298
  start: pos
55254
55299
  });
55300
+ ensureFallbackComment({
55301
+ converter,
55302
+ matchingImportedComment,
55303
+ commentId: resolvedCommentId,
55304
+ importedId
55305
+ });
55255
55306
  toDelete.push({ start: pos, end: pos + 1 });
55256
55307
  } else if (type2.name === "commentRangeEnd") {
55257
- const itemToMark = toMark.find((p2) => p2.importedId === node.attrs["w:id"]);
55308
+ const itemToMark = toMark.find((p2) => p2.importedId === importedId);
55258
55309
  if (!itemToMark) return;
55259
55310
  const { start: start2 } = itemToMark;
55260
55311
  const markAttrs = {
55261
- commentId,
55262
- importedId: node.attrs["w:id"],
55312
+ commentId: itemToMark.commentId,
55313
+ importedId,
55263
55314
  internal: itemToMark.internal
55264
55315
  };
55265
55316
  tr.addMark(start2, pos + 1, schema.marks[CommentMarkName].create(markAttrs));
@@ -58668,7 +58719,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
58668
58719
  * @returns {Object | void} Migration results
58669
58720
  */
58670
58721
  processCollaborationMigrations() {
58671
- console.debug("[checkVersionMigrations] Current editor version", "0.21.0-RC2");
58722
+ console.debug("[checkVersionMigrations] Current editor version", "0.20.2");
58672
58723
  if (!this.options.ydoc) return;
58673
58724
  const metaMap = this.options.ydoc.getMap("meta");
58674
58725
  let docVersion = metaMap.get("version");
@@ -76546,8 +76597,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
76546
76597
  }
76547
76598
  class SearchQuery {
76548
76599
  /**
76549
- Create a query object.
76550
- */
76600
+ Create a query object.
76601
+ */
76551
76602
  constructor(config2) {
76552
76603
  this.search = config2.search;
76553
76604
  this.caseSensitive = !!config2.caseSensitive;
@@ -76560,72 +76611,70 @@ Please report this to https://github.com/markedjs/marked.`, e) {
76560
76611
  this.impl = !this.valid ? nullQuery : this.regexp ? new RegExpQuery(this) : new StringQuery(this);
76561
76612
  }
76562
76613
  /**
76563
- Compare this query to another query.
76564
- */
76614
+ Compare this query to another query.
76615
+ */
76565
76616
  eq(other) {
76566
76617
  return this.search == other.search && this.replace == other.replace && this.caseSensitive == other.caseSensitive && this.regexp == other.regexp && this.wholeWord == other.wholeWord;
76567
76618
  }
76568
76619
  /**
76569
- Find the next occurrence of this query in the given range.
76570
- */
76620
+ Find the next occurrence of this query in the given range.
76621
+ */
76571
76622
  findNext(state2, from2 = 0, to = state2.doc.content.size) {
76572
76623
  for (; ; ) {
76573
- if (from2 >= to)
76574
- return null;
76624
+ if (from2 >= to) return null;
76575
76625
  let result = this.impl.findNext(state2, from2, to);
76576
- if (!result || this.checkResult(state2, result))
76577
- return result;
76626
+ if (!result || this.checkResult(state2, result)) return result;
76578
76627
  from2 = result.from + 1;
76579
76628
  }
76580
76629
  }
76581
76630
  /**
76582
- Find the previous occurrence of this query in the given range.
76583
- Note that, if `to` is given, it should be _less_ than `from`.
76584
- */
76631
+ Find the previous occurrence of this query in the given range.
76632
+ Note that, if `to` is given, it should be _less_ than `from`.
76633
+ */
76585
76634
  findPrev(state2, from2 = state2.doc.content.size, to = 0) {
76586
76635
  for (; ; ) {
76587
- if (from2 <= to)
76588
- return null;
76636
+ if (from2 <= to) return null;
76589
76637
  let result = this.impl.findPrev(state2, from2, to);
76590
- if (!result || this.checkResult(state2, result))
76591
- return result;
76638
+ if (!result || this.checkResult(state2, result)) return result;
76592
76639
  from2 = result.to - 1;
76593
76640
  }
76594
76641
  }
76595
76642
  /**
76596
- @internal
76597
- */
76643
+ @internal
76644
+ */
76598
76645
  checkResult(state2, result) {
76599
76646
  return (!this.wholeWord || checkWordBoundary(state2, result.from) && checkWordBoundary(state2, result.to)) && (!this.filter || this.filter(state2, result));
76600
76647
  }
76601
76648
  /**
76602
- @internal
76603
- */
76649
+ @internal
76650
+ */
76604
76651
  unquote(string) {
76605
76652
  return this.literal ? string : string.replace(/\\([nrt\\])/g, (_2, ch) => ch == "n" ? "\n" : ch == "r" ? "\r" : ch == "t" ? " " : "\\");
76606
76653
  }
76607
76654
  /**
76608
- Get the ranges that should be replaced for this result. This can
76609
- return multiple ranges when `this.replace` contains
76610
- `$1`/`$&`-style placeholders, in which case the preserved
76611
- content is skipped by the replacements.
76612
-
76613
- Ranges are sorted by position, and `from`/`to` positions all
76614
- refer to positions in `state.doc`. When applying these, you'll
76615
- want to either apply them from back to front, or map these
76616
- positions through your transaction's current mapping.
76617
- */
76655
+ Get the ranges that should be replaced for this result. This can
76656
+ return multiple ranges when `this.replace` contains
76657
+ `$1`/`$&`-style placeholders, in which case the preserved
76658
+ content is skipped by the replacements.
76659
+
76660
+ Ranges are sorted by position, and `from`/`to` positions all
76661
+ refer to positions in `state.doc`. When applying these, you'll
76662
+ want to either apply them from back to front, or map these
76663
+ positions through your transaction's current mapping.
76664
+ */
76618
76665
  getReplacements(state2, result) {
76619
76666
  let $from = state2.doc.resolve(result.from);
76620
76667
  let marks = $from.marksAcross(state2.doc.resolve(result.to));
76621
76668
  let ranges = [];
76622
76669
  let frag = Fragment.empty, pos = result.from, { match } = result;
76623
76670
  let groups = match ? getGroupIndices(match) : [[0, result.to - result.from]];
76624
- let replParts = parseReplacement(this.unquote(this.replace)), groupSpan;
76671
+ let replParts = parseReplacement(this.unquote(this.replace));
76625
76672
  for (let part of replParts) {
76626
76673
  if (typeof part == "string") {
76627
76674
  frag = frag.addToEnd(state2.schema.text(part, marks));
76628
- } else if (groupSpan = groups[part.group]) {
76675
+ } else {
76676
+ const groupSpan = groups[part.group];
76677
+ if (!groupSpan) continue;
76629
76678
  let from2 = result.matchStart + groupSpan[0], to = result.matchStart + groupSpan[1];
76630
76679
  if (part.copy) {
76631
76680
  frag = frag.append(state2.doc.slice(from2, to).content);
@@ -76655,8 +76704,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
76655
76704
  constructor(query) {
76656
76705
  this.query = query;
76657
76706
  let string = query.unquote(query.search);
76658
- if (!query.caseSensitive)
76659
- string = string.toLowerCase();
76707
+ if (!query.caseSensitive) string = string.toLowerCase();
76660
76708
  this.string = string;
76661
76709
  }
76662
76710
  findNext(state2, from2, to) {
@@ -76664,17 +76712,26 @@ Please report this to https://github.com/markedjs/marked.`, e) {
76664
76712
  let off2 = Math.max(from2, start2);
76665
76713
  let content = textContent(node).slice(off2 - start2, Math.min(node.content.size, to - start2));
76666
76714
  let index2 = (this.query.caseSensitive ? content : content.toLowerCase()).indexOf(this.string);
76667
- return index2 < 0 ? null : { from: off2 + index2, to: off2 + index2 + this.string.length, match: null, matchStart: start2 };
76715
+ if (index2 < 0) return null;
76716
+ const startOffset = off2 - start2;
76717
+ const absoluteIndex = startOffset + index2;
76718
+ const fromPos = mapIndexToDocPos(node, start2, absoluteIndex);
76719
+ const toPos = mapIndexToDocPos(node, start2, absoluteIndex + this.string.length);
76720
+ return { from: fromPos, to: toPos, match: null, matchStart: start2 };
76668
76721
  });
76669
76722
  }
76670
76723
  findPrev(state2, from2, to) {
76671
76724
  return scanTextblocks(state2.doc, from2, to, (node, start2) => {
76672
76725
  let off2 = Math.max(start2, to);
76673
76726
  let content = textContent(node).slice(off2 - start2, Math.min(node.content.size, from2 - start2));
76674
- if (!this.query.caseSensitive)
76675
- content = content.toLowerCase();
76727
+ if (!this.query.caseSensitive) content = content.toLowerCase();
76676
76728
  let index2 = content.lastIndexOf(this.string);
76677
- return index2 < 0 ? null : { from: off2 + index2, to: off2 + index2 + this.string.length, match: null, matchStart: start2 };
76729
+ if (index2 < 0) return null;
76730
+ const startOffset = off2 - start2;
76731
+ const absoluteIndex = startOffset + index2;
76732
+ const fromPos = mapIndexToDocPos(node, start2, absoluteIndex);
76733
+ const toPos = mapIndexToDocPos(node, start2, absoluteIndex + this.string.length);
76734
+ return { from: fromPos, to: toPos, match: null, matchStart: start2 };
76678
76735
  });
76679
76736
  }
76680
76737
  }
@@ -76689,7 +76746,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
76689
76746
  let content = textContent(node).slice(0, Math.min(node.content.size, to - start2));
76690
76747
  this.regexp.lastIndex = from2 - start2;
76691
76748
  let match = this.regexp.exec(content);
76692
- return match ? { from: start2 + match.index, to: start2 + match.index + match[0].length, match, matchStart: start2 } : null;
76749
+ if (!match) return null;
76750
+ const absoluteIndex = match.index;
76751
+ const fromPos = mapIndexToDocPos(node, start2, absoluteIndex);
76752
+ const toPos = mapIndexToDocPos(node, start2, absoluteIndex + match[0].length);
76753
+ return { from: fromPos, to: toPos, match, matchStart: start2 };
76693
76754
  });
76694
76755
  }
76695
76756
  findPrev(state2, from2, to) {
@@ -76699,18 +76760,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
76699
76760
  for (let off2 = 0; ; ) {
76700
76761
  this.regexp.lastIndex = off2;
76701
76762
  let next = this.regexp.exec(content);
76702
- if (!next)
76703
- break;
76763
+ if (!next) break;
76704
76764
  match = next;
76705
76765
  off2 = next.index + 1;
76706
76766
  }
76707
- return match ? { from: start2 + match.index, to: start2 + match.index + match[0].length, match, matchStart: start2 } : null;
76767
+ if (!match) return null;
76768
+ const absoluteIndex = match.index;
76769
+ const fromPos = mapIndexToDocPos(node, start2, absoluteIndex);
76770
+ const toPos = mapIndexToDocPos(node, start2, absoluteIndex + match[0].length);
76771
+ return { from: fromPos, to: toPos, match, matchStart: start2 };
76708
76772
  });
76709
76773
  }
76710
76774
  }
76711
76775
  function getGroupIndices(match) {
76712
- if (match.indices)
76713
- return match.indices;
76776
+ if (match.indices) return match.indices;
76714
76777
  let result = [[0, match[0].length]];
76715
76778
  for (let i2 = 1, pos = 0; i2 < match.length; i2++) {
76716
76779
  let found2 = match[i2] ? match[0].indexOf(match[i2], pos) : -1;
@@ -76722,10 +76785,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
76722
76785
  let result = [], highestSeen = -1;
76723
76786
  function add(text2) {
76724
76787
  let last = result.length - 1;
76725
- if (last > -1 && typeof result[last] == "string")
76726
- result[last] += text2;
76727
- else
76728
- result.push(text2);
76788
+ if (last > -1 && typeof result[last] == "string") result[last] += text2;
76789
+ else result.push(text2);
76729
76790
  }
76730
76791
  while (text.length) {
76731
76792
  let m2 = /\$([$&\d+])/.exec(text);
@@ -76733,8 +76794,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
76733
76794
  add(text);
76734
76795
  return result;
76735
76796
  }
76736
- if (m2.index > 0)
76737
- add(text.slice(0, m2.index + (m2[1] == "$" ? 1 : 0)));
76797
+ if (m2.index > 0) add(text.slice(0, m2.index + (m2[1] == "$" ? 1 : 0)));
76738
76798
  if (m2[1] != "$") {
76739
76799
  let n = m2[1] == "&" ? 0 : +m2[1];
76740
76800
  if (highestSeen >= n) {
@@ -76752,30 +76812,50 @@ Please report this to https://github.com/markedjs/marked.`, e) {
76752
76812
  try {
76753
76813
  new RegExp(source, baseFlags);
76754
76814
  return true;
76755
- } catch (_a2) {
76815
+ } catch {
76756
76816
  return false;
76757
76817
  }
76758
76818
  }
76759
76819
  const TextContentCache = /* @__PURE__ */ new WeakMap();
76760
76820
  function textContent(node) {
76761
76821
  let cached = TextContentCache.get(node);
76762
- if (cached)
76763
- return cached;
76822
+ if (cached) return cached;
76764
76823
  let content = "";
76765
76824
  for (let i2 = 0; i2 < node.childCount; i2++) {
76766
76825
  let child = node.child(i2);
76767
- if (child.isText)
76768
- content += child.text;
76769
- else if (child.isLeaf)
76770
- content += "";
76771
- else
76772
- content += " " + textContent(child) + " ";
76826
+ if (child.isText) content += child.text;
76827
+ else if (child.isLeaf) content += "";
76828
+ else if (child.type && child.type.name === "run") content += textContent(child);
76829
+ else content += " " + textContent(child) + " ";
76773
76830
  }
76774
76831
  TextContentCache.set(node, content);
76775
76832
  return content;
76776
76833
  }
76834
+ function mapIndexToDocPos(node, start2, index2) {
76835
+ if (index2 <= 0) return start2;
76836
+ const fullText = textContent(node);
76837
+ if (index2 >= fullText.length) return start2 + node.content.size;
76838
+ let target = start2;
76839
+ let remaining = index2;
76840
+ let found2 = false;
76841
+ node.descendants((child, pos) => {
76842
+ if (found2) return false;
76843
+ if (!child.isText) return true;
76844
+ const len2 = child.text.length;
76845
+ if (remaining <= len2) {
76846
+ target = start2 + pos + remaining;
76847
+ found2 = true;
76848
+ return false;
76849
+ }
76850
+ remaining -= len2;
76851
+ return true;
76852
+ });
76853
+ return found2 ? target : start2 + node.content.size;
76854
+ }
76855
+ const transparentInlineNodes = /* @__PURE__ */ new Set(["run"]);
76777
76856
  function scanTextblocks(node, from2, to, f, nodeStart = 0) {
76778
- if (node.inlineContent) {
76857
+ const isTransparentInline = node.inlineContent && node.type && transparentInlineNodes.has(node.type.name);
76858
+ if (node.inlineContent && !isTransparentInline) {
76779
76859
  return f(node, nodeStart);
76780
76860
  } else if (!node.isLeaf) {
76781
76861
  if (from2 > to) {
@@ -76784,8 +76864,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
76784
76864
  pos -= child.nodeSize;
76785
76865
  if (pos < from2) {
76786
76866
  let result = scanTextblocks(child, from2, to, f, pos + 1);
76787
- if (result != null)
76788
- return result;
76867
+ if (result != null) return result;
76789
76868
  }
76790
76869
  }
76791
76870
  } else {
@@ -76794,8 +76873,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
76794
76873
  pos += child.nodeSize;
76795
76874
  if (pos > from2) {
76796
76875
  let result = scanTextblocks(child, from2, to, f, start2 + 1);
76797
- if (result != null)
76798
- return result;
76876
+ if (result != null) return result;
76799
76877
  }
76800
76878
  }
76801
76879
  }
@@ -76805,8 +76883,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
76805
76883
  function checkWordBoundary(state2, pos) {
76806
76884
  let $pos = state2.doc.resolve(pos);
76807
76885
  let before = $pos.nodeBefore, after = $pos.nodeAfter;
76808
- if (!before || !after || !before.isText || !after.isText)
76809
- return true;
76886
+ if (!before || !after || !before.isText || !after.isText) return true;
76810
76887
  return !/\p{L}$/u.test(before.text) || !/^\p{L}/u.test(after.text);
76811
76888
  }
76812
76889
  class SearchState {
@@ -76817,14 +76894,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
76817
76894
  }
76818
76895
  }
76819
76896
  function buildMatchDeco(state2, query, range2) {
76820
- if (!query.valid)
76821
- return DecorationSet.empty;
76897
+ if (!query.valid) return DecorationSet.empty;
76822
76898
  let deco = [];
76823
76899
  let sel = state2.selection;
76824
76900
  for (let pos = range2 ? range2.from : 0, end2 = range2 ? range2.to : state2.doc.content.size; ; ) {
76825
76901
  let next = query.findNext(state2, pos, end2);
76826
- if (!next)
76827
- break;
76902
+ if (!next) break;
76828
76903
  let cls = next.from == sel.from && next.to == sel.to ? "ProseMirror-active-search-match" : "ProseMirror-search-match";
76829
76904
  deco.push(Decoration.inline(next.from, next.to, { class: cls }));
76830
76905
  pos = next.to;
@@ -76843,8 +76918,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
76843
76918
  },
76844
76919
  apply(tr, search2, _oldState, state2) {
76845
76920
  let set = tr.getMeta(searchKey);
76846
- if (set)
76847
- return new SearchState(set.query, set.range, buildMatchDeco(state2, set.query, set.range));
76921
+ if (set) return new SearchState(set.query, set.range, buildMatchDeco(state2, set.query, set.range));
76848
76922
  if (tr.docChanged || tr.selectionSet) {
76849
76923
  let range2 = search2.range;
76850
76924
  if (range2) {
@@ -76869,6 +76943,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
76869
76943
  function setSearchState(tr, query, range2 = null) {
76870
76944
  return tr.setMeta(searchKey, { query, range: range2 });
76871
76945
  }
76946
+ const isRegExp = (value) => Object.prototype.toString.call(value) === "[object RegExp]";
76872
76947
  const Search = Extension.create({
76873
76948
  addStorage() {
76874
76949
  return {
@@ -76938,10 +77013,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
76938
77013
  let caseSensitive = false;
76939
77014
  let regexp = false;
76940
77015
  const wholeWord = false;
76941
- if (patternInput instanceof RegExp) {
77016
+ if (isRegExp(patternInput)) {
77017
+ const regexPattern = (
77018
+ /** @type {RegExp} */
77019
+ patternInput
77020
+ );
76942
77021
  regexp = true;
76943
- pattern = patternInput.source;
76944
- caseSensitive = !patternInput.flags.includes("i");
77022
+ pattern = regexPattern.source;
77023
+ caseSensitive = !regexPattern.flags.includes("i");
76945
77024
  } else if (typeof patternInput === "string" && /^\/(.+)\/([gimsuy]*)$/.test(patternInput)) {
76946
77025
  const [, body, flags] = patternInput.match(/^\/(.+)\/([gimsuy]*)$/);
76947
77026
  regexp = true;
@@ -79846,7 +79925,7 @@ ${style2}
79846
79925
  if (typeof selector === "string") {
79847
79926
  return document.querySelector(selector);
79848
79927
  }
79849
- return selector();
79928
+ return selector() || null;
79850
79929
  }
79851
79930
  const LazyTeleport$1 = /* @__PURE__ */ defineComponent({
79852
79931
  name: "LazyTeleport",
@@ -79934,8 +80013,11 @@ ${style2}
79934
80013
  };
79935
80014
  const keepOffsetDirection$1 = {
79936
80015
  top: true,
80016
+ // top++
79937
80017
  bottom: false,
80018
+ // top--
79938
80019
  left: true,
80020
+ // left++
79939
80021
  right: false
79940
80022
  // left--
79941
80023
  };
@@ -81052,7 +81134,6 @@ ${style2}
81052
81134
  return !!element.href && element.rel !== "ignore";
81053
81135
  case "INPUT":
81054
81136
  return element.type !== "hidden" && element.type !== "file";
81055
- case "BUTTON":
81056
81137
  case "SELECT":
81057
81138
  case "TEXTAREA":
81058
81139
  return true;
@@ -81071,8 +81152,8 @@ ${style2}
81071
81152
  default: true
81072
81153
  },
81073
81154
  onEsc: Function,
81074
- initialFocusTo: String,
81075
- finalFocusTo: String,
81155
+ initialFocusTo: [String, Function],
81156
+ finalFocusTo: [String, Function],
81076
81157
  returnFocusOnDeactivated: {
81077
81158
  type: Boolean,
81078
81159
  default: true
@@ -83170,6 +83251,7 @@ ${style2}
83170
83251
  });
83171
83252
  }
83172
83253
  const scrollbarLight$1 = {
83254
+ name: "Scrollbar",
83173
83255
  common: derived$1,
83174
83256
  self: self$6$1
83175
83257
  };
@@ -84685,11 +84767,14 @@ ${style2}
84685
84767
  boxShadow: boxShadow2
84686
84768
  });
84687
84769
  }
84688
- const popoverLight$1 = {
84770
+ const popoverLight$1 = createTheme$1({
84689
84771
  name: "Popover",
84690
84772
  common: derived$1,
84773
+ peers: {
84774
+ Scrollbar: scrollbarLight$1
84775
+ },
84691
84776
  self: self$5$1
84692
- };
84777
+ });
84693
84778
  const oppositePlacement$1 = {
84694
84779
  top: "bottom",
84695
84780
  bottom: "top",
@@ -84909,9 +84994,11 @@ ${style2}
84909
84994
  const {
84910
84995
  namespaceRef,
84911
84996
  mergedClsPrefixRef,
84912
- inlineThemeDisabled
84997
+ inlineThemeDisabled,
84998
+ mergedRtlRef
84913
84999
  } = useConfig$1(props);
84914
85000
  const themeRef = useTheme$1("Popover", "-popover", style$3$1, popoverLight$1, props, mergedClsPrefixRef);
85001
+ const rtlEnabledRef = useRtl$1("Popover", mergedRtlRef, mergedClsPrefixRef);
84915
85002
  const followerRef = ref$1(null);
84916
85003
  const NPopover2 = inject("NPopover");
84917
85004
  const bodyRef = ref$1(null);
@@ -85109,6 +85196,8 @@ ${style2}
85109
85196
  style: props.contentStyle
85110
85197
  }, slots);
85111
85198
  const maybeScrollableBody = props.scrollable ? h$1(XScrollbar$1, {
85199
+ themeOverrides: themeRef.value.peerOverrides.Scrollbar,
85200
+ theme: themeRef.value.peers.Scrollbar,
85112
85201
  contentClass: hasHeaderOrFooter ? void 0 : `${mergedClsPrefix}-popover__content ${(_b = props.contentClass) !== null && _b !== void 0 ? _b : ""}`,
85113
85202
  contentStyle: hasHeaderOrFooter ? void 0 : props.contentStyle
85114
85203
  }, {
@@ -85124,7 +85213,7 @@ ${style2}
85124
85213
  return [maybeScrollableBody, arrow2];
85125
85214
  };
85126
85215
  contentNode = h$1("div", mergeProps({
85127
- class: [`${mergedClsPrefix}-popover`, `${mergedClsPrefix}-popover-shared`, themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass.value, extraClass.map((v2) => `${mergedClsPrefix}-${v2}`), {
85216
+ class: [`${mergedClsPrefix}-popover`, `${mergedClsPrefix}-popover-shared`, (rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value) && `${mergedClsPrefix}-popover--rtl`, themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass.value, extraClass.map((v2) => `${mergedClsPrefix}-${v2}`), {
85128
85217
  [`${mergedClsPrefix}-popover--scrollable`]: props.scrollable,
85129
85218
  [`${mergedClsPrefix}-popover--show-header-or-footer`]: hasHeaderOrFooter,
85130
85219
  [`${mergedClsPrefix}-popover--raw`]: props.raw,
@@ -85148,7 +85237,7 @@ ${style2}
85148
85237
  // The popover class and overlap class must exists, they will be used
85149
85238
  // to place the body & transition animation.
85150
85239
  // Shadow class exists for reuse box-shadow.
85151
- [`${mergedClsPrefix}-popover-shared`, themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass.value, props.overlap && `${mergedClsPrefix}-popover-shared--overlap`, props.showArrow && `${mergedClsPrefix}-popover-shared--show-arrow`, props.arrowPointToCenter && `${mergedClsPrefix}-popover-shared--center-arrow`],
85240
+ [`${mergedClsPrefix}-popover-shared`, (rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value) && `${mergedClsPrefix}-popover--rtl`, themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass.value, props.overlap && `${mergedClsPrefix}-popover-shared--overlap`, props.showArrow && `${mergedClsPrefix}-popover-shared--show-arrow`, props.arrowPointToCenter && `${mergedClsPrefix}-popover-shared--center-arrow`],
85152
85241
  bodyRef,
85153
85242
  styleRef.value,
85154
85243
  handleMouseEnter,
@@ -96276,13 +96365,41 @@ ${reason}`);
96276
96365
  });
96277
96366
  return comments;
96278
96367
  });
96368
+ const normalizeCommentForEditor = (node) => {
96369
+ if (!node || typeof node !== "object") return node;
96370
+ const cloneMarks = (marks) => Array.isArray(marks) ? marks.filter(Boolean).map((mark) => ({
96371
+ ...mark,
96372
+ attrs: mark?.attrs ? { ...mark.attrs } : void 0
96373
+ })) : void 0;
96374
+ const cloneAttrs = (attrs) => attrs && typeof attrs === "object" ? { ...attrs } : void 0;
96375
+ if (!Array.isArray(node.content)) {
96376
+ return {
96377
+ type: node.type,
96378
+ ...node.text !== void 0 ? { text: node.text } : {},
96379
+ ...node.attrs ? { attrs: cloneAttrs(node.attrs) } : {},
96380
+ ...node.marks ? { marks: cloneMarks(node.marks) } : {}
96381
+ };
96382
+ }
96383
+ const normalizedChildren = node.content.map((child) => normalizeCommentForEditor(child)).flat().filter(Boolean);
96384
+ if (node.type === "run") {
96385
+ return normalizedChildren;
96386
+ }
96387
+ return {
96388
+ type: node.type,
96389
+ ...node.attrs ? { attrs: cloneAttrs(node.attrs) } : {},
96390
+ ...node.marks ? { marks: cloneMarks(node.marks) } : {},
96391
+ content: normalizedChildren
96392
+ };
96393
+ };
96279
96394
  const getHTmlFromComment = (commentTextJson) => {
96280
96395
  if (!commentTextJson.content?.length) return;
96281
96396
  try {
96397
+ const normalizedContent = normalizeCommentForEditor(commentTextJson);
96398
+ const schemaContent = Array.isArray(normalizedContent) ? normalizedContent[0] : normalizedContent;
96282
96399
  const editor = new Editor({
96283
96400
  mode: "text",
96284
96401
  isHeadless: true,
96285
- content: commentTextJson,
96402
+ content: schemaContent,
96286
96403
  loadFromSchema: true,
96287
96404
  extensions: getRichTextExtensions()
96288
96405
  });
@@ -98348,7 +98465,7 @@ ${style2}
98348
98465
  if (typeof selector === "string") {
98349
98466
  return document.querySelector(selector);
98350
98467
  }
98351
- return selector();
98468
+ return selector() || null;
98352
98469
  }
98353
98470
  const LazyTeleport = /* @__PURE__ */ defineComponent({
98354
98471
  name: "LazyTeleport",
@@ -98436,8 +98553,11 @@ ${style2}
98436
98553
  };
98437
98554
  const keepOffsetDirection = {
98438
98555
  top: true,
98556
+ // top++
98439
98557
  bottom: false,
98558
+ // top--
98440
98559
  left: true,
98560
+ // left++
98441
98561
  right: false
98442
98562
  // left--
98443
98563
  };
@@ -99554,7 +99674,6 @@ ${style2}
99554
99674
  return !!element.href && element.rel !== "ignore";
99555
99675
  case "INPUT":
99556
99676
  return element.type !== "hidden" && element.type !== "file";
99557
- case "BUTTON":
99558
99677
  case "SELECT":
99559
99678
  case "TEXTAREA":
99560
99679
  return true;
@@ -99573,8 +99692,8 @@ ${style2}
99573
99692
  default: true
99574
99693
  },
99575
99694
  onEsc: Function,
99576
- initialFocusTo: String,
99577
- finalFocusTo: String,
99695
+ initialFocusTo: [String, Function],
99696
+ finalFocusTo: [String, Function],
99578
99697
  returnFocusOnDeactivated: {
99579
99698
  type: Boolean,
99580
99699
  default: true
@@ -102349,6 +102468,7 @@ ${style2}
102349
102468
  });
102350
102469
  }
102351
102470
  const scrollbarLight = {
102471
+ name: "Scrollbar",
102352
102472
  common: derived,
102353
102473
  self: self$7
102354
102474
  };
@@ -103853,11 +103973,14 @@ ${style2}
103853
103973
  boxShadow: boxShadow2
103854
103974
  });
103855
103975
  }
103856
- const popoverLight = {
103976
+ const popoverLight = createTheme({
103857
103977
  name: "Popover",
103858
103978
  common: derived,
103979
+ peers: {
103980
+ Scrollbar: scrollbarLight
103981
+ },
103859
103982
  self: self$6
103860
- };
103983
+ });
103861
103984
  const oppositePlacement = {
103862
103985
  top: "bottom",
103863
103986
  bottom: "top",
@@ -104077,9 +104200,11 @@ ${style2}
104077
104200
  const {
104078
104201
  namespaceRef,
104079
104202
  mergedClsPrefixRef,
104080
- inlineThemeDisabled
104203
+ inlineThemeDisabled,
104204
+ mergedRtlRef
104081
104205
  } = useConfig(props);
104082
104206
  const themeRef = useTheme("Popover", "-popover", style$5, popoverLight, props, mergedClsPrefixRef);
104207
+ const rtlEnabledRef = useRtl("Popover", mergedRtlRef, mergedClsPrefixRef);
104083
104208
  const followerRef = ref$1(null);
104084
104209
  const NPopover2 = inject("NPopover");
104085
104210
  const bodyRef = ref$1(null);
@@ -104277,6 +104402,8 @@ ${style2}
104277
104402
  style: props.contentStyle
104278
104403
  }, slots);
104279
104404
  const maybeScrollableBody = props.scrollable ? h$1(XScrollbar, {
104405
+ themeOverrides: themeRef.value.peerOverrides.Scrollbar,
104406
+ theme: themeRef.value.peers.Scrollbar,
104280
104407
  contentClass: hasHeaderOrFooter ? void 0 : `${mergedClsPrefix}-popover__content ${(_b = props.contentClass) !== null && _b !== void 0 ? _b : ""}`,
104281
104408
  contentStyle: hasHeaderOrFooter ? void 0 : props.contentStyle
104282
104409
  }, {
@@ -104292,7 +104419,7 @@ ${style2}
104292
104419
  return [maybeScrollableBody, arrow2];
104293
104420
  };
104294
104421
  contentNode = h$1("div", mergeProps({
104295
- class: [`${mergedClsPrefix}-popover`, `${mergedClsPrefix}-popover-shared`, themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass.value, extraClass.map((v2) => `${mergedClsPrefix}-${v2}`), {
104422
+ class: [`${mergedClsPrefix}-popover`, `${mergedClsPrefix}-popover-shared`, (rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value) && `${mergedClsPrefix}-popover--rtl`, themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass.value, extraClass.map((v2) => `${mergedClsPrefix}-${v2}`), {
104296
104423
  [`${mergedClsPrefix}-popover--scrollable`]: props.scrollable,
104297
104424
  [`${mergedClsPrefix}-popover--show-header-or-footer`]: hasHeaderOrFooter,
104298
104425
  [`${mergedClsPrefix}-popover--raw`]: props.raw,
@@ -104316,7 +104443,7 @@ ${style2}
104316
104443
  // The popover class and overlap class must exists, they will be used
104317
104444
  // to place the body & transition animation.
104318
104445
  // Shadow class exists for reuse box-shadow.
104319
- [`${mergedClsPrefix}-popover-shared`, themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass.value, props.overlap && `${mergedClsPrefix}-popover-shared--overlap`, props.showArrow && `${mergedClsPrefix}-popover-shared--show-arrow`, props.arrowPointToCenter && `${mergedClsPrefix}-popover-shared--center-arrow`],
104446
+ [`${mergedClsPrefix}-popover-shared`, (rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value) && `${mergedClsPrefix}-popover--rtl`, themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass.value, props.overlap && `${mergedClsPrefix}-popover-shared--overlap`, props.showArrow && `${mergedClsPrefix}-popover-shared--show-arrow`, props.arrowPointToCenter && `${mergedClsPrefix}-popover-shared--center-arrow`],
104320
104447
  bodyRef,
104321
104448
  styleRef.value,
104322
104449
  handleMouseEnter,
@@ -106741,7 +106868,8 @@ ${style2}
106741
106868
  closeIconColorPressedLoading: closeIconColorPressed,
106742
106869
  loadingColor: primaryColor,
106743
106870
  lineHeight: lineHeight2,
106744
- borderRadius
106871
+ borderRadius,
106872
+ border: "0"
106745
106873
  });
106746
106874
  }
106747
106875
  const messageLight = {
@@ -106792,6 +106920,7 @@ ${style2}
106792
106920
  margin-bottom .3s var(--n-bezier);
106793
106921
  padding: var(--n-padding);
106794
106922
  border-radius: var(--n-border-radius);
106923
+ border: var(--n-border);
106795
106924
  flex-wrap: nowrap;
106796
106925
  overflow: hidden;
106797
106926
  max-width: var(--n-max-width);
@@ -106910,6 +107039,7 @@ ${style2}
106910
107039
  fontSize: fontSize2,
106911
107040
  lineHeight: lineHeight2,
106912
107041
  borderRadius,
107042
+ border,
106913
107043
  iconColorInfo,
106914
107044
  iconColorSuccess,
106915
107045
  iconColorWarning,
@@ -106953,7 +107083,8 @@ ${style2}
106953
107083
  "--n-close-icon-color-pressed": closeIconColorPressed,
106954
107084
  "--n-close-icon-color-hover": closeIconColorHover,
106955
107085
  "--n-line-height": lineHeight2,
106956
- "--n-border-radius": borderRadius
107086
+ "--n-border-radius": borderRadius,
107087
+ "--n-border": border
106957
107088
  };
106958
107089
  });
106959
107090
  const themeClassHandle = inlineThemeDisabled ? useThemeClass("message", computed(() => props.type[0]), cssVarsRef, {}) : void 0;
@@ -109914,7 +110045,7 @@ ${style2}
109914
110045
  this.config.colors = shuffleArray(this.config.colors);
109915
110046
  this.userColorMap = /* @__PURE__ */ new Map();
109916
110047
  this.colorIndex = 0;
109917
- this.version = "0.21.0-RC2";
110048
+ this.version = "0.20.2";
109918
110049
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
109919
110050
  this.superdocId = config2.superdocId || v4();
109920
110051
  this.colors = this.config.colors;