@harbour-enterprises/superdoc 0.21.0-RC2 → 0.21.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.
- package/README.md +4 -4
- package/dist/chunks/{PdfViewer-CbGuPQY8.es.js → PdfViewer-0jdn-cVx.es.js} +1 -1
- package/dist/chunks/{PdfViewer-DGbJ8_qc.cjs → PdfViewer-Bn3Lvd0m.cjs} +1 -1
- package/dist/chunks/{index-qjntJEk0.es.js → index-BiZcP3bK.es.js} +57 -15
- package/dist/chunks/{index-ecl0ZFNw.cjs → index-C0XOj4vH.cjs} +57 -15
- package/dist/chunks/{super-editor.es-CS5l-cVZ.cjs → super-editor.es-BWdUsCXq.cjs} +66 -39
- package/dist/chunks/{super-editor.es-BF_Xaucb.es.js → super-editor.es-DQx0kzCl.es.js} +66 -39
- package/dist/core/SuperDoc.d.ts.map +1 -1
- package/dist/stores/comments-store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-DUqGq6qj.js → converter-DMpIH4c0.js} +40 -24
- package/dist/super-editor/chunks/{docx-zipper-CQsQR8Zs.js → docx-zipper-CDrFfcVc.js} +1 -1
- package/dist/super-editor/chunks/{editor-gMF6aWiz.js → editor-DrzPfOIy.js} +9 -8
- package/dist/super-editor/chunks/{toolbar-BxsT1ZgG.js → toolbar-NxB-WhNb.js} +21 -11
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/style.css +1 -1
- package/dist/super-editor/super-editor.es.js +6 -6
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +121 -52
- package/dist/superdoc.umd.js.map +1 -1
- package/npm-deprecation-notice.cjs +10 -0
- package/package.json +11 -6
package/dist/superdoc.umd.js
CHANGED
|
@@ -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
|
|
32155
|
-
|
|
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) {
|
|
@@ -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 = {} },
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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
|
-
|
|
45758
|
-
|
|
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.
|
|
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.
|
|
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 = {
|
|
@@ -58668,7 +58685,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
58668
58685
|
* @returns {Object | void} Migration results
|
|
58669
58686
|
*/
|
|
58670
58687
|
processCollaborationMigrations() {
|
|
58671
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.
|
|
58688
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.20.2");
|
|
58672
58689
|
if (!this.options.ydoc) return;
|
|
58673
58690
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
58674
58691
|
let docVersion = metaMap.get("version");
|
|
@@ -79846,7 +79863,7 @@ ${style2}
|
|
|
79846
79863
|
if (typeof selector === "string") {
|
|
79847
79864
|
return document.querySelector(selector);
|
|
79848
79865
|
}
|
|
79849
|
-
return selector();
|
|
79866
|
+
return selector() || null;
|
|
79850
79867
|
}
|
|
79851
79868
|
const LazyTeleport$1 = /* @__PURE__ */ defineComponent({
|
|
79852
79869
|
name: "LazyTeleport",
|
|
@@ -79934,8 +79951,11 @@ ${style2}
|
|
|
79934
79951
|
};
|
|
79935
79952
|
const keepOffsetDirection$1 = {
|
|
79936
79953
|
top: true,
|
|
79954
|
+
// top++
|
|
79937
79955
|
bottom: false,
|
|
79956
|
+
// top--
|
|
79938
79957
|
left: true,
|
|
79958
|
+
// left++
|
|
79939
79959
|
right: false
|
|
79940
79960
|
// left--
|
|
79941
79961
|
};
|
|
@@ -81052,7 +81072,6 @@ ${style2}
|
|
|
81052
81072
|
return !!element.href && element.rel !== "ignore";
|
|
81053
81073
|
case "INPUT":
|
|
81054
81074
|
return element.type !== "hidden" && element.type !== "file";
|
|
81055
|
-
case "BUTTON":
|
|
81056
81075
|
case "SELECT":
|
|
81057
81076
|
case "TEXTAREA":
|
|
81058
81077
|
return true;
|
|
@@ -81071,8 +81090,8 @@ ${style2}
|
|
|
81071
81090
|
default: true
|
|
81072
81091
|
},
|
|
81073
81092
|
onEsc: Function,
|
|
81074
|
-
initialFocusTo: String,
|
|
81075
|
-
finalFocusTo: String,
|
|
81093
|
+
initialFocusTo: [String, Function],
|
|
81094
|
+
finalFocusTo: [String, Function],
|
|
81076
81095
|
returnFocusOnDeactivated: {
|
|
81077
81096
|
type: Boolean,
|
|
81078
81097
|
default: true
|
|
@@ -83170,6 +83189,7 @@ ${style2}
|
|
|
83170
83189
|
});
|
|
83171
83190
|
}
|
|
83172
83191
|
const scrollbarLight$1 = {
|
|
83192
|
+
name: "Scrollbar",
|
|
83173
83193
|
common: derived$1,
|
|
83174
83194
|
self: self$6$1
|
|
83175
83195
|
};
|
|
@@ -84685,11 +84705,14 @@ ${style2}
|
|
|
84685
84705
|
boxShadow: boxShadow2
|
|
84686
84706
|
});
|
|
84687
84707
|
}
|
|
84688
|
-
const popoverLight$1 = {
|
|
84708
|
+
const popoverLight$1 = createTheme$1({
|
|
84689
84709
|
name: "Popover",
|
|
84690
84710
|
common: derived$1,
|
|
84711
|
+
peers: {
|
|
84712
|
+
Scrollbar: scrollbarLight$1
|
|
84713
|
+
},
|
|
84691
84714
|
self: self$5$1
|
|
84692
|
-
};
|
|
84715
|
+
});
|
|
84693
84716
|
const oppositePlacement$1 = {
|
|
84694
84717
|
top: "bottom",
|
|
84695
84718
|
bottom: "top",
|
|
@@ -84909,9 +84932,11 @@ ${style2}
|
|
|
84909
84932
|
const {
|
|
84910
84933
|
namespaceRef,
|
|
84911
84934
|
mergedClsPrefixRef,
|
|
84912
|
-
inlineThemeDisabled
|
|
84935
|
+
inlineThemeDisabled,
|
|
84936
|
+
mergedRtlRef
|
|
84913
84937
|
} = useConfig$1(props);
|
|
84914
84938
|
const themeRef = useTheme$1("Popover", "-popover", style$3$1, popoverLight$1, props, mergedClsPrefixRef);
|
|
84939
|
+
const rtlEnabledRef = useRtl$1("Popover", mergedRtlRef, mergedClsPrefixRef);
|
|
84915
84940
|
const followerRef = ref$1(null);
|
|
84916
84941
|
const NPopover2 = inject("NPopover");
|
|
84917
84942
|
const bodyRef = ref$1(null);
|
|
@@ -85109,6 +85134,8 @@ ${style2}
|
|
|
85109
85134
|
style: props.contentStyle
|
|
85110
85135
|
}, slots);
|
|
85111
85136
|
const maybeScrollableBody = props.scrollable ? h$1(XScrollbar$1, {
|
|
85137
|
+
themeOverrides: themeRef.value.peerOverrides.Scrollbar,
|
|
85138
|
+
theme: themeRef.value.peers.Scrollbar,
|
|
85112
85139
|
contentClass: hasHeaderOrFooter ? void 0 : `${mergedClsPrefix}-popover__content ${(_b = props.contentClass) !== null && _b !== void 0 ? _b : ""}`,
|
|
85113
85140
|
contentStyle: hasHeaderOrFooter ? void 0 : props.contentStyle
|
|
85114
85141
|
}, {
|
|
@@ -85124,7 +85151,7 @@ ${style2}
|
|
|
85124
85151
|
return [maybeScrollableBody, arrow2];
|
|
85125
85152
|
};
|
|
85126
85153
|
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}`), {
|
|
85154
|
+
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
85155
|
[`${mergedClsPrefix}-popover--scrollable`]: props.scrollable,
|
|
85129
85156
|
[`${mergedClsPrefix}-popover--show-header-or-footer`]: hasHeaderOrFooter,
|
|
85130
85157
|
[`${mergedClsPrefix}-popover--raw`]: props.raw,
|
|
@@ -85148,7 +85175,7 @@ ${style2}
|
|
|
85148
85175
|
// The popover class and overlap class must exists, they will be used
|
|
85149
85176
|
// to place the body & transition animation.
|
|
85150
85177
|
// 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`],
|
|
85178
|
+
[`${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
85179
|
bodyRef,
|
|
85153
85180
|
styleRef.value,
|
|
85154
85181
|
handleMouseEnter,
|
|
@@ -96276,13 +96303,41 @@ ${reason}`);
|
|
|
96276
96303
|
});
|
|
96277
96304
|
return comments;
|
|
96278
96305
|
});
|
|
96306
|
+
const normalizeCommentForEditor = (node) => {
|
|
96307
|
+
if (!node || typeof node !== "object") return node;
|
|
96308
|
+
const cloneMarks = (marks) => Array.isArray(marks) ? marks.filter(Boolean).map((mark) => ({
|
|
96309
|
+
...mark,
|
|
96310
|
+
attrs: mark?.attrs ? { ...mark.attrs } : void 0
|
|
96311
|
+
})) : void 0;
|
|
96312
|
+
const cloneAttrs = (attrs) => attrs && typeof attrs === "object" ? { ...attrs } : void 0;
|
|
96313
|
+
if (!Array.isArray(node.content)) {
|
|
96314
|
+
return {
|
|
96315
|
+
type: node.type,
|
|
96316
|
+
...node.text !== void 0 ? { text: node.text } : {},
|
|
96317
|
+
...node.attrs ? { attrs: cloneAttrs(node.attrs) } : {},
|
|
96318
|
+
...node.marks ? { marks: cloneMarks(node.marks) } : {}
|
|
96319
|
+
};
|
|
96320
|
+
}
|
|
96321
|
+
const normalizedChildren = node.content.map((child) => normalizeCommentForEditor(child)).flat().filter(Boolean);
|
|
96322
|
+
if (node.type === "run") {
|
|
96323
|
+
return normalizedChildren;
|
|
96324
|
+
}
|
|
96325
|
+
return {
|
|
96326
|
+
type: node.type,
|
|
96327
|
+
...node.attrs ? { attrs: cloneAttrs(node.attrs) } : {},
|
|
96328
|
+
...node.marks ? { marks: cloneMarks(node.marks) } : {},
|
|
96329
|
+
content: normalizedChildren
|
|
96330
|
+
};
|
|
96331
|
+
};
|
|
96279
96332
|
const getHTmlFromComment = (commentTextJson) => {
|
|
96280
96333
|
if (!commentTextJson.content?.length) return;
|
|
96281
96334
|
try {
|
|
96335
|
+
const normalizedContent = normalizeCommentForEditor(commentTextJson);
|
|
96336
|
+
const schemaContent = Array.isArray(normalizedContent) ? normalizedContent[0] : normalizedContent;
|
|
96282
96337
|
const editor = new Editor({
|
|
96283
96338
|
mode: "text",
|
|
96284
96339
|
isHeadless: true,
|
|
96285
|
-
content:
|
|
96340
|
+
content: schemaContent,
|
|
96286
96341
|
loadFromSchema: true,
|
|
96287
96342
|
extensions: getRichTextExtensions()
|
|
96288
96343
|
});
|
|
@@ -98348,7 +98403,7 @@ ${style2}
|
|
|
98348
98403
|
if (typeof selector === "string") {
|
|
98349
98404
|
return document.querySelector(selector);
|
|
98350
98405
|
}
|
|
98351
|
-
return selector();
|
|
98406
|
+
return selector() || null;
|
|
98352
98407
|
}
|
|
98353
98408
|
const LazyTeleport = /* @__PURE__ */ defineComponent({
|
|
98354
98409
|
name: "LazyTeleport",
|
|
@@ -98436,8 +98491,11 @@ ${style2}
|
|
|
98436
98491
|
};
|
|
98437
98492
|
const keepOffsetDirection = {
|
|
98438
98493
|
top: true,
|
|
98494
|
+
// top++
|
|
98439
98495
|
bottom: false,
|
|
98496
|
+
// top--
|
|
98440
98497
|
left: true,
|
|
98498
|
+
// left++
|
|
98441
98499
|
right: false
|
|
98442
98500
|
// left--
|
|
98443
98501
|
};
|
|
@@ -99554,7 +99612,6 @@ ${style2}
|
|
|
99554
99612
|
return !!element.href && element.rel !== "ignore";
|
|
99555
99613
|
case "INPUT":
|
|
99556
99614
|
return element.type !== "hidden" && element.type !== "file";
|
|
99557
|
-
case "BUTTON":
|
|
99558
99615
|
case "SELECT":
|
|
99559
99616
|
case "TEXTAREA":
|
|
99560
99617
|
return true;
|
|
@@ -99573,8 +99630,8 @@ ${style2}
|
|
|
99573
99630
|
default: true
|
|
99574
99631
|
},
|
|
99575
99632
|
onEsc: Function,
|
|
99576
|
-
initialFocusTo: String,
|
|
99577
|
-
finalFocusTo: String,
|
|
99633
|
+
initialFocusTo: [String, Function],
|
|
99634
|
+
finalFocusTo: [String, Function],
|
|
99578
99635
|
returnFocusOnDeactivated: {
|
|
99579
99636
|
type: Boolean,
|
|
99580
99637
|
default: true
|
|
@@ -102349,6 +102406,7 @@ ${style2}
|
|
|
102349
102406
|
});
|
|
102350
102407
|
}
|
|
102351
102408
|
const scrollbarLight = {
|
|
102409
|
+
name: "Scrollbar",
|
|
102352
102410
|
common: derived,
|
|
102353
102411
|
self: self$7
|
|
102354
102412
|
};
|
|
@@ -103853,11 +103911,14 @@ ${style2}
|
|
|
103853
103911
|
boxShadow: boxShadow2
|
|
103854
103912
|
});
|
|
103855
103913
|
}
|
|
103856
|
-
const popoverLight = {
|
|
103914
|
+
const popoverLight = createTheme({
|
|
103857
103915
|
name: "Popover",
|
|
103858
103916
|
common: derived,
|
|
103917
|
+
peers: {
|
|
103918
|
+
Scrollbar: scrollbarLight
|
|
103919
|
+
},
|
|
103859
103920
|
self: self$6
|
|
103860
|
-
};
|
|
103921
|
+
});
|
|
103861
103922
|
const oppositePlacement = {
|
|
103862
103923
|
top: "bottom",
|
|
103863
103924
|
bottom: "top",
|
|
@@ -104077,9 +104138,11 @@ ${style2}
|
|
|
104077
104138
|
const {
|
|
104078
104139
|
namespaceRef,
|
|
104079
104140
|
mergedClsPrefixRef,
|
|
104080
|
-
inlineThemeDisabled
|
|
104141
|
+
inlineThemeDisabled,
|
|
104142
|
+
mergedRtlRef
|
|
104081
104143
|
} = useConfig(props);
|
|
104082
104144
|
const themeRef = useTheme("Popover", "-popover", style$5, popoverLight, props, mergedClsPrefixRef);
|
|
104145
|
+
const rtlEnabledRef = useRtl("Popover", mergedRtlRef, mergedClsPrefixRef);
|
|
104083
104146
|
const followerRef = ref$1(null);
|
|
104084
104147
|
const NPopover2 = inject("NPopover");
|
|
104085
104148
|
const bodyRef = ref$1(null);
|
|
@@ -104277,6 +104340,8 @@ ${style2}
|
|
|
104277
104340
|
style: props.contentStyle
|
|
104278
104341
|
}, slots);
|
|
104279
104342
|
const maybeScrollableBody = props.scrollable ? h$1(XScrollbar, {
|
|
104343
|
+
themeOverrides: themeRef.value.peerOverrides.Scrollbar,
|
|
104344
|
+
theme: themeRef.value.peers.Scrollbar,
|
|
104280
104345
|
contentClass: hasHeaderOrFooter ? void 0 : `${mergedClsPrefix}-popover__content ${(_b = props.contentClass) !== null && _b !== void 0 ? _b : ""}`,
|
|
104281
104346
|
contentStyle: hasHeaderOrFooter ? void 0 : props.contentStyle
|
|
104282
104347
|
}, {
|
|
@@ -104292,7 +104357,7 @@ ${style2}
|
|
|
104292
104357
|
return [maybeScrollableBody, arrow2];
|
|
104293
104358
|
};
|
|
104294
104359
|
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}`), {
|
|
104360
|
+
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
104361
|
[`${mergedClsPrefix}-popover--scrollable`]: props.scrollable,
|
|
104297
104362
|
[`${mergedClsPrefix}-popover--show-header-or-footer`]: hasHeaderOrFooter,
|
|
104298
104363
|
[`${mergedClsPrefix}-popover--raw`]: props.raw,
|
|
@@ -104316,7 +104381,7 @@ ${style2}
|
|
|
104316
104381
|
// The popover class and overlap class must exists, they will be used
|
|
104317
104382
|
// to place the body & transition animation.
|
|
104318
104383
|
// 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`],
|
|
104384
|
+
[`${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
104385
|
bodyRef,
|
|
104321
104386
|
styleRef.value,
|
|
104322
104387
|
handleMouseEnter,
|
|
@@ -106741,7 +106806,8 @@ ${style2}
|
|
|
106741
106806
|
closeIconColorPressedLoading: closeIconColorPressed,
|
|
106742
106807
|
loadingColor: primaryColor,
|
|
106743
106808
|
lineHeight: lineHeight2,
|
|
106744
|
-
borderRadius
|
|
106809
|
+
borderRadius,
|
|
106810
|
+
border: "0"
|
|
106745
106811
|
});
|
|
106746
106812
|
}
|
|
106747
106813
|
const messageLight = {
|
|
@@ -106792,6 +106858,7 @@ ${style2}
|
|
|
106792
106858
|
margin-bottom .3s var(--n-bezier);
|
|
106793
106859
|
padding: var(--n-padding);
|
|
106794
106860
|
border-radius: var(--n-border-radius);
|
|
106861
|
+
border: var(--n-border);
|
|
106795
106862
|
flex-wrap: nowrap;
|
|
106796
106863
|
overflow: hidden;
|
|
106797
106864
|
max-width: var(--n-max-width);
|
|
@@ -106910,6 +106977,7 @@ ${style2}
|
|
|
106910
106977
|
fontSize: fontSize2,
|
|
106911
106978
|
lineHeight: lineHeight2,
|
|
106912
106979
|
borderRadius,
|
|
106980
|
+
border,
|
|
106913
106981
|
iconColorInfo,
|
|
106914
106982
|
iconColorSuccess,
|
|
106915
106983
|
iconColorWarning,
|
|
@@ -106953,7 +107021,8 @@ ${style2}
|
|
|
106953
107021
|
"--n-close-icon-color-pressed": closeIconColorPressed,
|
|
106954
107022
|
"--n-close-icon-color-hover": closeIconColorHover,
|
|
106955
107023
|
"--n-line-height": lineHeight2,
|
|
106956
|
-
"--n-border-radius": borderRadius
|
|
107024
|
+
"--n-border-radius": borderRadius,
|
|
107025
|
+
"--n-border": border
|
|
106957
107026
|
};
|
|
106958
107027
|
});
|
|
106959
107028
|
const themeClassHandle = inlineThemeDisabled ? useThemeClass("message", computed(() => props.type[0]), cssVarsRef, {}) : void 0;
|
|
@@ -109914,7 +109983,7 @@ ${style2}
|
|
|
109914
109983
|
this.config.colors = shuffleArray(this.config.colors);
|
|
109915
109984
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
109916
109985
|
this.colorIndex = 0;
|
|
109917
|
-
this.version = "0.
|
|
109986
|
+
this.version = "0.20.2";
|
|
109918
109987
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
109919
109988
|
this.superdocId = config2.superdocId || v4();
|
|
109920
109989
|
this.colors = this.config.colors;
|