@harbour-enterprises/superdoc 0.6.112 → 0.7.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/dist/chunks/{super-editor.es-B8fXoY6P.js → super-editor.es-C3EfxPkJ.js} +27 -15
- package/dist/chunks/super-editor.es-C3EfxPkJ.js.map +1 -0
- package/dist/super-editor/chunks/{converter-s9yhBEHO.js → converter-ei3PNE_E.js} +24 -13
- package/dist/super-editor/chunks/{converter-s9yhBEHO.js.map → converter-ei3PNE_E.js.map} +1 -1
- package/dist/super-editor/chunks/{docx-zipper-DEE6oGA6.js → docx-zipper-B7uIfmYn.js} +2 -2
- package/dist/super-editor/chunks/{docx-zipper-DEE6oGA6.js.map → docx-zipper-B7uIfmYn.js.map} +1 -1
- package/dist/super-editor/chunks/{editor-BkJfSOly.js → editor-Bggv0Jux.js} +6 -5
- package/dist/super-editor/chunks/editor-Bggv0Jux.js.map +1 -0
- package/dist/super-editor/chunks/{toolbar-Ib-MW1xa.js → toolbar-DLqRjwsa.js} +3 -3
- package/dist/super-editor/chunks/{toolbar-Ib-MW1xa.js.map → toolbar-DLqRjwsa.js.map} +1 -1
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/core/super-converter/exporter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/helpers.d.ts +1 -0
- package/dist/super-editor/core/super-converter/helpers.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/exporter/commentsExporter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/documentCommentsImporter.d.ts.map +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/extensions/comment/comments-helpers.d.ts.map +1 -1
- package/dist/super-editor/file-zipper.es.js +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.es.js +1 -1
- package/dist/superdoc.es.js +3 -3
- package/dist/superdoc.umd.js +27 -15
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/super-editor.es-B8fXoY6P.js.map +0 -1
- package/dist/super-editor/chunks/editor-BkJfSOly.js.map +0 -1
|
@@ -15978,6 +15978,13 @@ function isValidHexColor(color) {
|
|
|
15978
15978
|
return false;
|
|
15979
15979
|
}
|
|
15980
15980
|
}
|
|
15981
|
+
const componentToHex = (val) => {
|
|
15982
|
+
const a = Number(val).toString(16);
|
|
15983
|
+
return a.length === 1 ? "0" + a : a;
|
|
15984
|
+
};
|
|
15985
|
+
const rgbToHex = (rgb) => {
|
|
15986
|
+
return "#" + rgb.match(/\d+/g).map(componentToHex).join("");
|
|
15987
|
+
};
|
|
15981
15988
|
function generateDocxRandomId(length = 8) {
|
|
15982
15989
|
const characters = "0123456789abcdef";
|
|
15983
15990
|
let id = [];
|
|
@@ -17270,7 +17277,8 @@ const getCommentDefinition = (comment, commentId, allComments) => {
|
|
|
17270
17277
|
"w:date": toIsoNoFractional(comment.createdTime),
|
|
17271
17278
|
"w:initials": getInitials(comment.creatorName),
|
|
17272
17279
|
"w:done": comment.resolvedTime ? "1" : "0",
|
|
17273
|
-
"w15:paraId": comment.commentParaId
|
|
17280
|
+
"w15:paraId": comment.commentParaId,
|
|
17281
|
+
"custom:internalId": comment.commentId || comment.internalId
|
|
17274
17282
|
};
|
|
17275
17283
|
if (comment?.parentCommentId) {
|
|
17276
17284
|
const parentComment = allComments.find((c) => c.commentId === comment.parentCommentId);
|
|
@@ -17304,7 +17312,9 @@ const updateCommentsXml = (commentDefs = [], commentsXml) => {
|
|
|
17304
17312
|
"w:id": commentDef.attributes["w:id"],
|
|
17305
17313
|
"w:author": commentDef.attributes["w:author"],
|
|
17306
17314
|
"w:date": commentDef.attributes["w:date"],
|
|
17307
|
-
"w:initials": commentDef.attributes["w:initials"]
|
|
17315
|
+
"w:initials": commentDef.attributes["w:initials"],
|
|
17316
|
+
"custom:internalId": commentDef.attributes["custom:internalId"],
|
|
17317
|
+
"xmlns:custom": "http://schemas.openxmlformats.org/wordprocessingml/2006/main"
|
|
17308
17318
|
};
|
|
17309
17319
|
});
|
|
17310
17320
|
newCommentsXml.elements[0].elements = commentDefs;
|
|
@@ -17320,8 +17330,7 @@ const updateCommentsExtendedXml = (comments = [], commentsExtendedXml) => {
|
|
|
17320
17330
|
const parentId = comment.parentCommentId;
|
|
17321
17331
|
if (parentId) {
|
|
17322
17332
|
const parentComment = comments.find((c) => c.commentId === parentId);
|
|
17323
|
-
|
|
17324
|
-
attributes["w15:paraIdParent"] = parentParaId;
|
|
17333
|
+
attributes["w15:paraIdParent"] = parentComment.commentParaId;
|
|
17325
17334
|
}
|
|
17326
17335
|
return {
|
|
17327
17336
|
type: "element",
|
|
@@ -18132,6 +18141,9 @@ function translateMark(mark) {
|
|
|
18132
18141
|
break;
|
|
18133
18142
|
case "color":
|
|
18134
18143
|
let processedColor = attrs.color.replace(/^#/, "").replace(/;$/, "");
|
|
18144
|
+
if (processedColor.startsWith("rgb")) {
|
|
18145
|
+
processedColor = rgbToHex(processedColor);
|
|
18146
|
+
}
|
|
18135
18147
|
markElement.attributes["w:val"] = processedColor;
|
|
18136
18148
|
break;
|
|
18137
18149
|
case "textAlign":
|
|
@@ -20222,6 +20234,7 @@ function importCommentData({ docx }) {
|
|
|
20222
20234
|
const authorEmail = attributes["w:email"];
|
|
20223
20235
|
const initials = attributes["w:initials"];
|
|
20224
20236
|
const createdDate = attributes["w:date"];
|
|
20237
|
+
const internalId = attributes["custom:internalId"];
|
|
20225
20238
|
const date = new Date(createdDate);
|
|
20226
20239
|
const unixTimestampMs = date.getTime();
|
|
20227
20240
|
const { elements: elements2 } = el;
|
|
@@ -20235,7 +20248,7 @@ function importCommentData({ docx }) {
|
|
|
20235
20248
|
const { attrs } = parsedComment[0];
|
|
20236
20249
|
const paraId = attrs["w14:paraId"];
|
|
20237
20250
|
return {
|
|
20238
|
-
commentId: v4(),
|
|
20251
|
+
commentId: internalId || v4(),
|
|
20239
20252
|
importedId,
|
|
20240
20253
|
creatorName: authorName,
|
|
20241
20254
|
creatorEmail: authorEmail,
|
|
@@ -20257,14 +20270,13 @@ const generateCommentsWithExtendedData = ({ docx, comments }) => {
|
|
|
20257
20270
|
return comments.map((comment) => {
|
|
20258
20271
|
const extendedDef = commentEx.find((ce) => ce.attributes["w15:paraId"] === comment.paraId);
|
|
20259
20272
|
if (!extendedDef) return { ...comment };
|
|
20260
|
-
const { isDone, paraIdParent
|
|
20273
|
+
const { isDone, paraIdParent } = getExtendedDetails(extendedDef);
|
|
20261
20274
|
let parentComment;
|
|
20262
20275
|
if (paraIdParent) parentComment = comments.find((c) => c.paraId === paraIdParent);
|
|
20263
20276
|
const newComment = {
|
|
20264
20277
|
...comment,
|
|
20265
|
-
commentId: superdocCommentId || v4(),
|
|
20266
20278
|
isDone,
|
|
20267
|
-
parentCommentId: parentComment?.
|
|
20279
|
+
parentCommentId: parentComment?.commentId
|
|
20268
20280
|
};
|
|
20269
20281
|
return newComment;
|
|
20270
20282
|
});
|
|
@@ -20274,8 +20286,7 @@ const getExtendedDetails = (commentEx) => {
|
|
|
20274
20286
|
const paraId = attributes["w15:paraId"];
|
|
20275
20287
|
const isDone = attributes["w15:done"] === "1" ? true : false;
|
|
20276
20288
|
const paraIdParent = attributes["w15:paraIdParent"];
|
|
20277
|
-
|
|
20278
|
-
return { paraId, isDone, paraIdParent, superdocCommentId };
|
|
20289
|
+
return { paraId, isDone, paraIdParent };
|
|
20279
20290
|
};
|
|
20280
20291
|
const createDocumentJson = (docx, converter, editor) => {
|
|
20281
20292
|
const json = carbonCopy(getInitialJSON(docx));
|
|
@@ -20649,7 +20660,7 @@ const _SuperConverter = class _SuperConverter {
|
|
|
20649
20660
|
return;
|
|
20650
20661
|
}
|
|
20651
20662
|
}
|
|
20652
|
-
static updateDocumentVersion(docx = this.convertedXml, version = "0.
|
|
20663
|
+
static updateDocumentVersion(docx = this.convertedXml, version = "0.7.1") {
|
|
20653
20664
|
const customLocation = "docProps/custom.xml";
|
|
20654
20665
|
if (!docx[customLocation]) {
|
|
20655
20666
|
docx[customLocation] = generateCustomXml();
|
|
@@ -20925,7 +20936,7 @@ function storeSuperdocVersion(docx) {
|
|
|
20925
20936
|
function generateCustomXml() {
|
|
20926
20937
|
return DEFAULT_CUSTOM_XML;
|
|
20927
20938
|
}
|
|
20928
|
-
function generateSuperdocVersion(pid = 2, version = "0.
|
|
20939
|
+
function generateSuperdocVersion(pid = 2, version = "0.7.1") {
|
|
20929
20940
|
return {
|
|
20930
20941
|
type: "element",
|
|
20931
20942
|
name: "property",
|
|
@@ -20997,4 +21008,4 @@ export {
|
|
|
20997
21008
|
RemoveMarkStep as y,
|
|
20998
21009
|
twipsToLines as z
|
|
20999
21010
|
};
|
|
21000
|
-
//# sourceMappingURL=converter-
|
|
21011
|
+
//# sourceMappingURL=converter-ei3PNE_E.js.map
|