@harbour-enterprises/superdoc 0.19.0-next.5 → 0.19.0-next.6
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/{PdfViewer-DaZtoNpm.cjs → PdfViewer-BlV8_l4e.cjs} +1 -1
- package/dist/chunks/{PdfViewer-C2898kqZ.es.js → PdfViewer-oqYWe1FJ.es.js} +1 -1
- package/dist/chunks/{index-CkJ5hnvC.es.js → index-CeockUQz.es.js} +35 -3
- package/dist/chunks/{index-Di9R4Aas.cjs → index-DHyh73q4.cjs} +35 -3
- package/dist/chunks/{super-editor.es-kuaVTS8t.es.js → super-editor.es-BRBU19lM.es.js} +115 -91
- package/dist/chunks/{super-editor.es-DG-S6GN9.cjs → super-editor.es-bu-RKSWh.cjs} +115 -91
- package/dist/core/SuperDoc.d.ts.map +1 -1
- package/dist/stores/superdoc-store.d.ts +3 -0
- package/dist/stores/superdoc-store.d.ts.map +1 -1
- package/dist/style.css +6 -6
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-CrJvpQ8J.js → converter-BFq1XXek.js} +18 -7
- package/dist/super-editor/chunks/{docx-zipper-CHHaFCfj.js → docx-zipper-BahUy6FS.js} +1 -1
- package/dist/super-editor/chunks/{editor-DlzGbfD-.js → editor-BdLd21gy.js} +92 -84
- package/dist/super-editor/chunks/{toolbar-DeKOVf4h.js → toolbar-DoJY1zlM.js} +2 -2
- 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 +6 -6
- package/dist/super-editor/super-editor.es.js +13 -8
- 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 +148 -92
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -26481,7 +26481,7 @@ function createMeasurementPropertyHandler(xmlName, sdName = null) {
|
|
|
26481
26481
|
encode: (_2, encodedAttrs) => {
|
|
26482
26482
|
return encodedAttrs["value"] != null ? encodedAttrs : void 0;
|
|
26483
26483
|
},
|
|
26484
|
-
decode: function({ node: node2 }
|
|
26484
|
+
decode: function({ node: node2 }) {
|
|
26485
26485
|
const decodedAttrs = this.decodeAttributes({ node: { ...node2, attrs: node2.attrs[sdName] || {} } });
|
|
26486
26486
|
return decodedAttrs["w:w"] != null ? decodedAttrs : void 0;
|
|
26487
26487
|
}
|
|
@@ -26499,7 +26499,10 @@ const createAttributeHandler = (xmlName, sdName = null, transformEncode = null,
|
|
|
26499
26499
|
};
|
|
26500
26500
|
};
|
|
26501
26501
|
function encodeProperties(node2, translatorsByXmlName, asArray = false) {
|
|
26502
|
-
|
|
26502
|
+
if (!node2?.elements || node2.elements.length === 0) {
|
|
26503
|
+
return asArray ? [] : {};
|
|
26504
|
+
}
|
|
26505
|
+
const attributes = asArray ? [] : {};
|
|
26503
26506
|
node2.elements.forEach((el) => {
|
|
26504
26507
|
const translator2 = translatorsByXmlName[el.name];
|
|
26505
26508
|
if (translator2) {
|
|
@@ -26516,6 +26519,9 @@ function encodeProperties(node2, translatorsByXmlName, asArray = false) {
|
|
|
26516
26519
|
return attributes;
|
|
26517
26520
|
}
|
|
26518
26521
|
function decodeProperties(translatorsBySdName, properties) {
|
|
26522
|
+
if (!properties || typeof properties !== "object") {
|
|
26523
|
+
return [];
|
|
26524
|
+
}
|
|
26519
26525
|
const elements = [];
|
|
26520
26526
|
Object.keys(properties).forEach((key) => {
|
|
26521
26527
|
const translator2 = translatorsBySdName[key];
|
|
@@ -27320,7 +27326,7 @@ const _resolveHref = (docx, encodedAttrs) => {
|
|
|
27320
27326
|
}
|
|
27321
27327
|
return href;
|
|
27322
27328
|
};
|
|
27323
|
-
function decode(params2
|
|
27329
|
+
function decode(params2) {
|
|
27324
27330
|
const { node: node2 } = params2;
|
|
27325
27331
|
const linkMark = node2.marks.find((m2) => m2.type === "link");
|
|
27326
27332
|
const linkAttrs = this.decodeAttributes({ ...params2, node: linkMark });
|
|
@@ -30708,7 +30714,7 @@ const createNodeListHandler = (nodeHandlers) => {
|
|
|
30708
30714
|
}
|
|
30709
30715
|
} catch (error) {
|
|
30710
30716
|
console.debug("Import error", error);
|
|
30711
|
-
editor?.emit("exception", { error });
|
|
30717
|
+
editor?.emit("exception", { error, editor });
|
|
30712
30718
|
converter?.telemetry?.trackStatistic("error", {
|
|
30713
30719
|
type: "processing_error",
|
|
30714
30720
|
message: error.message,
|
|
@@ -30721,7 +30727,7 @@ const createNodeListHandler = (nodeHandlers) => {
|
|
|
30721
30727
|
return processedElements;
|
|
30722
30728
|
} catch (error) {
|
|
30723
30729
|
console.debug("Error during import", error);
|
|
30724
|
-
editor?.emit("exception", { error });
|
|
30730
|
+
editor?.emit("exception", { error, editor });
|
|
30725
30731
|
converter?.telemetry?.trackStatistic("error", {
|
|
30726
30732
|
type: "fatal_error",
|
|
30727
30733
|
message: error.message,
|
|
@@ -31187,8 +31193,13 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
31187
31193
|
return { typeface, panose };
|
|
31188
31194
|
}
|
|
31189
31195
|
getSchema(editor) {
|
|
31190
|
-
|
|
31191
|
-
|
|
31196
|
+
let result;
|
|
31197
|
+
try {
|
|
31198
|
+
this.getDocumentInternalId();
|
|
31199
|
+
result = createDocumentJson({ ...this.convertedXml, media: this.media }, this, editor);
|
|
31200
|
+
} catch (error) {
|
|
31201
|
+
editor?.emit("exception", { error, editor });
|
|
31202
|
+
}
|
|
31192
31203
|
if (result) {
|
|
31193
31204
|
this.savedTagsToRestore.push({ ...result.savedTagsToRestore });
|
|
31194
31205
|
this.pageStyles = result.pageStyles;
|
|
@@ -47579,7 +47590,7 @@ function validateRelationshipsRoot(relsTree, relsKey, results) {
|
|
|
47579
47590
|
}
|
|
47580
47591
|
return { root: root2, wasFixed };
|
|
47581
47592
|
}
|
|
47582
|
-
function cleanupRootChildren(root2
|
|
47593
|
+
function cleanupRootChildren(root2) {
|
|
47583
47594
|
const validChildren = root2.elements?.filter((child) => child?.type === "element" && child.name === "Relationship") || [];
|
|
47584
47595
|
if (root2.elements?.length !== validChildren.length) {
|
|
47585
47596
|
root2.elements = validChildren;
|
|
@@ -48576,85 +48587,89 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
48576
48587
|
getUpdatedDocs = false,
|
|
48577
48588
|
fieldsHighlightColor = null
|
|
48578
48589
|
} = {}) {
|
|
48579
|
-
|
|
48580
|
-
|
|
48581
|
-
|
|
48582
|
-
|
|
48583
|
-
|
|
48584
|
-
|
|
48585
|
-
|
|
48586
|
-
|
|
48587
|
-
|
|
48588
|
-
|
|
48589
|
-
|
|
48590
|
-
|
|
48591
|
-
__privateMethod$1(this, _Editor_instances, validateDocumentExport_fn).call(this);
|
|
48592
|
-
if (exportXmlOnly || exportJsonOnly) return documentXml;
|
|
48593
|
-
const customXml = this.converter.schemaToXml(this.converter.convertedXml["docProps/custom.xml"].elements[0]);
|
|
48594
|
-
const styles = this.converter.schemaToXml(this.converter.convertedXml["word/styles.xml"].elements[0]);
|
|
48595
|
-
const customSettings = this.converter.schemaToXml(this.converter.convertedXml["word/settings.xml"].elements[0]);
|
|
48596
|
-
const rels = this.converter.schemaToXml(this.converter.convertedXml["word/_rels/document.xml.rels"].elements[0]);
|
|
48597
|
-
const media = this.converter.addedMedia;
|
|
48598
|
-
const updatedHeadersFooters = {};
|
|
48599
|
-
Object.entries(this.converter.convertedXml).forEach(([name, json2]) => {
|
|
48600
|
-
if (name.includes("header") || name.includes("footer")) {
|
|
48601
|
-
const resultXml = this.converter.schemaToXml(json2.elements[0]);
|
|
48602
|
-
updatedHeadersFooters[name] = String(resultXml);
|
|
48603
|
-
}
|
|
48604
|
-
});
|
|
48605
|
-
const numberingData = this.converter.convertedXml["word/numbering.xml"];
|
|
48606
|
-
const numbering = this.converter.schemaToXml(numberingData.elements[0]);
|
|
48607
|
-
const updatedDocs = {
|
|
48608
|
-
...this.options.customUpdatedFiles,
|
|
48609
|
-
"word/document.xml": String(documentXml),
|
|
48610
|
-
"docProps/custom.xml": String(customXml),
|
|
48611
|
-
"word/settings.xml": String(customSettings),
|
|
48612
|
-
"word/_rels/document.xml.rels": String(rels),
|
|
48613
|
-
"word/numbering.xml": String(numbering),
|
|
48614
|
-
// Replace & with & in styles.xml as DOCX viewers can't handle it
|
|
48615
|
-
"word/styles.xml": String(styles).replace(/&/gi, "&"),
|
|
48616
|
-
...updatedHeadersFooters
|
|
48617
|
-
};
|
|
48618
|
-
if (comments.length) {
|
|
48619
|
-
const commentsXml = this.converter.schemaToXml(this.converter.convertedXml["word/comments.xml"].elements[0]);
|
|
48620
|
-
const commentsExtendedXml = this.converter.schemaToXml(
|
|
48621
|
-
this.converter.convertedXml["word/commentsExtended.xml"].elements[0]
|
|
48622
|
-
);
|
|
48623
|
-
const commentsExtensibleXml = this.converter.schemaToXml(
|
|
48624
|
-
this.converter.convertedXml["word/commentsExtensible.xml"].elements[0]
|
|
48625
|
-
);
|
|
48626
|
-
const commentsIdsXml = this.converter.schemaToXml(
|
|
48627
|
-
this.converter.convertedXml["word/commentsIds.xml"].elements[0]
|
|
48590
|
+
try {
|
|
48591
|
+
const json = __privateMethod$1(this, _Editor_instances, prepareDocumentForExport_fn).call(this, comments);
|
|
48592
|
+
const documentXml = await this.converter.exportToDocx(
|
|
48593
|
+
json,
|
|
48594
|
+
this.schema,
|
|
48595
|
+
this.storage.image.media,
|
|
48596
|
+
isFinalDoc,
|
|
48597
|
+
commentsType,
|
|
48598
|
+
comments,
|
|
48599
|
+
this,
|
|
48600
|
+
exportJsonOnly,
|
|
48601
|
+
fieldsHighlightColor
|
|
48628
48602
|
);
|
|
48629
|
-
|
|
48630
|
-
|
|
48631
|
-
|
|
48632
|
-
|
|
48633
|
-
|
|
48634
|
-
|
|
48635
|
-
|
|
48636
|
-
|
|
48637
|
-
|
|
48638
|
-
|
|
48639
|
-
|
|
48603
|
+
__privateMethod$1(this, _Editor_instances, validateDocumentExport_fn).call(this);
|
|
48604
|
+
if (exportXmlOnly || exportJsonOnly) return documentXml;
|
|
48605
|
+
const customXml = this.converter.schemaToXml(this.converter.convertedXml["docProps/custom.xml"].elements[0]);
|
|
48606
|
+
const styles = this.converter.schemaToXml(this.converter.convertedXml["word/styles.xml"].elements[0]);
|
|
48607
|
+
const customSettings = this.converter.schemaToXml(this.converter.convertedXml["word/settings.xml"].elements[0]);
|
|
48608
|
+
const rels = this.converter.schemaToXml(this.converter.convertedXml["word/_rels/document.xml.rels"].elements[0]);
|
|
48609
|
+
const media = this.converter.addedMedia;
|
|
48610
|
+
const updatedHeadersFooters = {};
|
|
48611
|
+
Object.entries(this.converter.convertedXml).forEach(([name, json2]) => {
|
|
48612
|
+
if (name.includes("header") || name.includes("footer")) {
|
|
48613
|
+
const resultXml = this.converter.schemaToXml(json2.elements[0]);
|
|
48614
|
+
updatedHeadersFooters[name] = String(resultXml);
|
|
48615
|
+
}
|
|
48616
|
+
});
|
|
48617
|
+
const numberingData = this.converter.convertedXml["word/numbering.xml"];
|
|
48618
|
+
const numbering = this.converter.schemaToXml(numberingData.elements[0]);
|
|
48619
|
+
const updatedDocs = {
|
|
48620
|
+
...this.options.customUpdatedFiles,
|
|
48621
|
+
"word/document.xml": String(documentXml),
|
|
48622
|
+
"docProps/custom.xml": String(customXml),
|
|
48623
|
+
"word/settings.xml": String(customSettings),
|
|
48624
|
+
"word/_rels/document.xml.rels": String(rels),
|
|
48625
|
+
"word/numbering.xml": String(numbering),
|
|
48626
|
+
// Replace & with & in styles.xml as DOCX viewers can't handle it
|
|
48627
|
+
"word/styles.xml": String(styles).replace(/&/gi, "&"),
|
|
48628
|
+
...updatedHeadersFooters
|
|
48629
|
+
};
|
|
48630
|
+
if (comments.length) {
|
|
48631
|
+
const commentsXml = this.converter.schemaToXml(this.converter.convertedXml["word/comments.xml"].elements[0]);
|
|
48632
|
+
const commentsExtendedXml = this.converter.schemaToXml(
|
|
48633
|
+
this.converter.convertedXml["word/commentsExtended.xml"].elements[0]
|
|
48634
|
+
);
|
|
48635
|
+
const commentsExtensibleXml = this.converter.schemaToXml(
|
|
48636
|
+
this.converter.convertedXml["word/commentsExtensible.xml"].elements[0]
|
|
48637
|
+
);
|
|
48638
|
+
const commentsIdsXml = this.converter.schemaToXml(
|
|
48639
|
+
this.converter.convertedXml["word/commentsIds.xml"].elements[0]
|
|
48640
|
+
);
|
|
48641
|
+
updatedDocs["word/comments.xml"] = String(commentsXml);
|
|
48642
|
+
updatedDocs["word/commentsExtended.xml"] = String(commentsExtendedXml);
|
|
48643
|
+
updatedDocs["word/commentsExtensible.xml"] = String(commentsExtensibleXml);
|
|
48644
|
+
updatedDocs["word/commentsIds.xml"] = String(commentsIdsXml);
|
|
48645
|
+
}
|
|
48646
|
+
const zipper = new DocxZipper();
|
|
48647
|
+
if (getUpdatedDocs) {
|
|
48648
|
+
updatedDocs["[Content_Types].xml"] = await zipper.updateContentTypes(
|
|
48649
|
+
{
|
|
48650
|
+
files: this.options.content
|
|
48651
|
+
},
|
|
48652
|
+
media,
|
|
48653
|
+
true
|
|
48654
|
+
);
|
|
48655
|
+
return updatedDocs;
|
|
48656
|
+
}
|
|
48657
|
+
const result = await zipper.updateZip({
|
|
48658
|
+
docx: this.options.content,
|
|
48659
|
+
updatedDocs,
|
|
48660
|
+
originalDocxFile: this.options.fileSource,
|
|
48640
48661
|
media,
|
|
48641
|
-
|
|
48642
|
-
|
|
48643
|
-
|
|
48662
|
+
fonts: this.options.fonts,
|
|
48663
|
+
isHeadless: this.options.isHeadless
|
|
48664
|
+
});
|
|
48665
|
+
this.options.telemetry?.trackUsage("document_export", {
|
|
48666
|
+
documentType: "docx",
|
|
48667
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
48668
|
+
});
|
|
48669
|
+
return result;
|
|
48670
|
+
} catch (error) {
|
|
48671
|
+
this.emit("exception", { error, editor: this });
|
|
48644
48672
|
}
|
|
48645
|
-
const result = await zipper.updateZip({
|
|
48646
|
-
docx: this.options.content,
|
|
48647
|
-
updatedDocs,
|
|
48648
|
-
originalDocxFile: this.options.fileSource,
|
|
48649
|
-
media,
|
|
48650
|
-
fonts: this.options.fonts,
|
|
48651
|
-
isHeadless: this.options.isHeadless
|
|
48652
|
-
});
|
|
48653
|
-
this.options.telemetry?.trackUsage("document_export", {
|
|
48654
|
-
documentType: "docx",
|
|
48655
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
48656
|
-
});
|
|
48657
|
-
return result;
|
|
48658
48673
|
}
|
|
48659
48674
|
/**
|
|
48660
48675
|
* Destroy the editor and clean up resources
|
|
@@ -48675,7 +48690,8 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
48675
48690
|
}
|
|
48676
48691
|
this.converter.headerEditors.length = 0;
|
|
48677
48692
|
this.converter.footerEditors.length = 0;
|
|
48678
|
-
} catch {
|
|
48693
|
+
} catch (error) {
|
|
48694
|
+
this.emit("exception", { error, editor: this });
|
|
48679
48695
|
}
|
|
48680
48696
|
}
|
|
48681
48697
|
/**
|
|
@@ -48740,7 +48756,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
48740
48756
|
this.initDefaultStyles();
|
|
48741
48757
|
if (this.options.ydoc && this.options.collaborationProvider) {
|
|
48742
48758
|
updateYdocDocxData(this);
|
|
48743
|
-
this.initializeCollaborationData(
|
|
48759
|
+
this.initializeCollaborationData();
|
|
48744
48760
|
} else {
|
|
48745
48761
|
__privateMethod$1(this, _Editor_instances, insertNewFileData_fn).call(this);
|
|
48746
48762
|
}
|
|
@@ -48900,7 +48916,6 @@ init_fn = function() {
|
|
|
48900
48916
|
this.on("beforeCreate", this.options.onBeforeCreate);
|
|
48901
48917
|
this.emit("beforeCreate", { editor: this });
|
|
48902
48918
|
this.on("contentError", this.options.onContentError);
|
|
48903
|
-
this.on("exception", this.options.onException);
|
|
48904
48919
|
this.mount(this.options.element);
|
|
48905
48920
|
this.on("create", this.options.onCreate);
|
|
48906
48921
|
this.on("update", this.options.onUpdate);
|
|
@@ -48918,6 +48933,7 @@ init_fn = function() {
|
|
|
48918
48933
|
this.on("paginationUpdate", this.options.onPaginationUpdate);
|
|
48919
48934
|
this.on("comment-positions", this.options.onCommentLocationsUpdate);
|
|
48920
48935
|
this.on("list-definitions-change", this.options.onListDefinitionsChange);
|
|
48936
|
+
this.on("exception", this.options.onException);
|
|
48921
48937
|
if (!this.options.isHeadless) {
|
|
48922
48938
|
this.initializeCollaborationData();
|
|
48923
48939
|
this.initDefaultStyles();
|
|
@@ -49244,7 +49260,8 @@ endCollaboration_fn = function() {
|
|
|
49244
49260
|
console.debug("🔗 [super-editor] Ending collaboration");
|
|
49245
49261
|
if (this.options.collaborationProvider) this.options.collaborationProvider.disconnect();
|
|
49246
49262
|
if (this.options.ydoc) this.options.ydoc.destroy();
|
|
49247
|
-
} catch {
|
|
49263
|
+
} catch (error) {
|
|
49264
|
+
this.emit("exception", { error, editor: this });
|
|
49248
49265
|
}
|
|
49249
49266
|
};
|
|
49250
49267
|
validateDocumentInit_fn = function() {
|
|
@@ -58533,6 +58550,7 @@ const startImageUpload = async ({ editor, view, file }) => {
|
|
|
58533
58550
|
file = processedImageResult.file;
|
|
58534
58551
|
} catch (err) {
|
|
58535
58552
|
console.warn("Error processing image:", err);
|
|
58553
|
+
editor.emit("exception", { error: err, editor });
|
|
58536
58554
|
return;
|
|
58537
58555
|
}
|
|
58538
58556
|
await uploadImage({
|
|
@@ -58587,9 +58605,10 @@ async function uploadImage({ editor, view, file, size: size2, uploadHandler }) {
|
|
|
58587
58605
|
view.dispatch(
|
|
58588
58606
|
view.state.tr.replaceWith(placeholderPos, placeholderPos, imageNode).setMeta(ImagePlaceholderPluginKey, removeMeta)
|
|
58589
58607
|
);
|
|
58590
|
-
} catch {
|
|
58608
|
+
} catch (error) {
|
|
58591
58609
|
let removeMeta = { type: "remove", id };
|
|
58592
58610
|
view.dispatch(tr.setMeta(ImagePlaceholderPluginKey, removeMeta));
|
|
58611
|
+
editor.emit("exception", { error, editor });
|
|
58593
58612
|
}
|
|
58594
58613
|
}
|
|
58595
58614
|
function addImageRelationship({ editor, path }) {
|
|
@@ -80128,7 +80147,9 @@ class SuperToolbar extends EventEmitter2 {
|
|
|
80128
80147
|
} else if (typeof command2 === "function") {
|
|
80129
80148
|
command2({ item, argument, option });
|
|
80130
80149
|
} else {
|
|
80131
|
-
|
|
80150
|
+
const error = new Error(`[super-toolbar 🎨] Command not found: ${command2}`);
|
|
80151
|
+
this.emit("exception", { error, editor: this.activeEditor });
|
|
80152
|
+
throw error;
|
|
80132
80153
|
}
|
|
80133
80154
|
this.updateToolbarState();
|
|
80134
80155
|
}
|
|
@@ -81383,6 +81404,9 @@ const _sfc_main$1 = {
|
|
|
81383
81404
|
return { content: docx, media, mediaFiles, fonts };
|
|
81384
81405
|
} catch (err) {
|
|
81385
81406
|
console.debug("Error loading new file data:", err);
|
|
81407
|
+
if (typeof props.options.onException === "function") {
|
|
81408
|
+
props.options.onException({ error: err, editor: null });
|
|
81409
|
+
}
|
|
81386
81410
|
}
|
|
81387
81411
|
};
|
|
81388
81412
|
const initializeData = async () => {
|
|
@@ -81585,7 +81609,7 @@ const _sfc_main$1 = {
|
|
|
81585
81609
|
};
|
|
81586
81610
|
}
|
|
81587
81611
|
};
|
|
81588
|
-
const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
81612
|
+
const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-0c36dd72"]]);
|
|
81589
81613
|
const _hoisted_1 = ["innerHTML"];
|
|
81590
81614
|
const _sfc_main = {
|
|
81591
81615
|
__name: "SuperInput",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuperDoc.d.ts","sourceRoot":"","sources":["../../src/core/SuperDoc.js"],"names":[],"mappings":"AAgBA;;;;;GAKG;AAEH;;;;;;GAMG;AAEH;;;;;;;;;;GAUG;AAEH;;;;;;;;GAQG;AAEH,2EAA2E;AAE3E;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH;;;;;;GAMG;AACH;IACE,4BAA4B;IAC5B,qBADW,KAAK,CAAC,MAAM,CAAC,CACgB;IAwExC;;OAEG;IACH,oBAFW,MAAM,EAKhB;IA5ED,qBAAqB;IACrB,SADW,MAAM,CACT;IAER,qBAAqB;IACrB,OADW,IAAI,EAAE,CACX;IAEN,4CAA4C;IAC5C,MADW,OAAO,KAAK,EAAE,GAAG,GAAG,SAAS,CACnC;IAEL,4EAA4E;IAC5E,UADW,OAAO,sBAAsB,EAAE,kBAAkB,GAAG,SAAS,CAC/D;IAET,qBAAqB;IACrB,QADW,MAAM,CAwDf;IAiBA,4BAA6B;IAC7B,mBAAmB;IAMnB,gBAA+C;IAC/C,iBAAgC;IAehC,WAA4B;IAE5B,YAAkB;IAElB,eAAuC;IAEvC;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"SuperDoc.d.ts","sourceRoot":"","sources":["../../src/core/SuperDoc.js"],"names":[],"mappings":"AAgBA;;;;;GAKG;AAEH;;;;;;GAMG;AAEH;;;;;;;;;;GAUG;AAEH;;;;;;;;GAQG;AAEH,2EAA2E;AAE3E;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH;;;;;;GAMG;AACH;IACE,4BAA4B;IAC5B,qBADW,KAAK,CAAC,MAAM,CAAC,CACgB;IAwExC;;OAEG;IACH,oBAFW,MAAM,EAKhB;IA5ED,qBAAqB;IACrB,SADW,MAAM,CACT;IAER,qBAAqB;IACrB,OADW,IAAI,EAAE,CACX;IAEN,4CAA4C;IAC5C,MADW,OAAO,KAAK,EAAE,GAAG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C7C,iEAAiE"}
|
|
@@ -39,6 +39,7 @@ export const useSuperdocStore: import("pinia").StoreDefinition<"superdoc", Pick<
|
|
|
39
39
|
modules: {};
|
|
40
40
|
areDocumentsReady: import("vue").ComputedRef<boolean>;
|
|
41
41
|
init: (config: any) => Promise<void>;
|
|
42
|
+
setExceptionHandler: (handler: any) => void;
|
|
42
43
|
reset: () => void;
|
|
43
44
|
handlePageReady: (documentId: any, index: any, containerBounds: any) => void;
|
|
44
45
|
getDocument: (documentId: any) => any;
|
|
@@ -86,6 +87,7 @@ export const useSuperdocStore: import("pinia").StoreDefinition<"superdoc", Pick<
|
|
|
86
87
|
modules: {};
|
|
87
88
|
areDocumentsReady: import("vue").ComputedRef<boolean>;
|
|
88
89
|
init: (config: any) => Promise<void>;
|
|
90
|
+
setExceptionHandler: (handler: any) => void;
|
|
89
91
|
reset: () => void;
|
|
90
92
|
handlePageReady: (documentId: any, index: any, containerBounds: any) => void;
|
|
91
93
|
getDocument: (documentId: any) => any;
|
|
@@ -133,6 +135,7 @@ export const useSuperdocStore: import("pinia").StoreDefinition<"superdoc", Pick<
|
|
|
133
135
|
modules: {};
|
|
134
136
|
areDocumentsReady: import("vue").ComputedRef<boolean>;
|
|
135
137
|
init: (config: any) => Promise<void>;
|
|
138
|
+
setExceptionHandler: (handler: any) => void;
|
|
136
139
|
reset: () => void;
|
|
137
140
|
handlePageReady: (documentId: any, index: any, containerBounds: any) => void;
|
|
138
141
|
getDocument: (documentId: any) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"superdoc-store.d.ts","sourceRoot":"","sources":["../../src/stores/superdoc-store.js"],"names":[],"mappings":"AASA
|
|
1
|
+
{"version":3,"file":"superdoc-store.d.ts","sourceRoot":"","sources":["../../src/stores/superdoc-store.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAyQG"}
|
package/dist/style.css
CHANGED
|
@@ -2172,10 +2172,10 @@ on the right if it is inside shape textbox.
|
|
|
2172
2172
|
min-height: 40px;
|
|
2173
2173
|
}
|
|
2174
2174
|
|
|
2175
|
-
.editor-element[data-v-
|
|
2175
|
+
.editor-element[data-v-0c36dd72] {
|
|
2176
2176
|
position: relative;
|
|
2177
2177
|
}
|
|
2178
|
-
.super-editor-container[data-v-
|
|
2178
|
+
.super-editor-container[data-v-0c36dd72] {
|
|
2179
2179
|
width: auto;
|
|
2180
2180
|
height: auto;
|
|
2181
2181
|
min-width: 8in;
|
|
@@ -2184,13 +2184,13 @@ on the right if it is inside shape textbox.
|
|
|
2184
2184
|
display: flex;
|
|
2185
2185
|
flex-direction: column;
|
|
2186
2186
|
}
|
|
2187
|
-
.ruler[data-v-
|
|
2187
|
+
.ruler[data-v-0c36dd72] {
|
|
2188
2188
|
margin-bottom: 2px;
|
|
2189
2189
|
}
|
|
2190
|
-
.super-editor[data-v-
|
|
2190
|
+
.super-editor[data-v-0c36dd72] {
|
|
2191
2191
|
color: initial;
|
|
2192
2192
|
}
|
|
2193
|
-
.placeholder-editor[data-v-
|
|
2193
|
+
.placeholder-editor[data-v-0c36dd72] {
|
|
2194
2194
|
position: absolute;
|
|
2195
2195
|
top: 0;
|
|
2196
2196
|
left: 0;
|
|
@@ -2202,7 +2202,7 @@ on the right if it is inside shape textbox.
|
|
|
2202
2202
|
background-color: white;
|
|
2203
2203
|
box-sizing: border-box;
|
|
2204
2204
|
}
|
|
2205
|
-
.placeholder-title[data-v-
|
|
2205
|
+
.placeholder-title[data-v-0c36dd72] {
|
|
2206
2206
|
display: flex;
|
|
2207
2207
|
justify-content: center;
|
|
2208
2208
|
margin-bottom: 40px;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
|
|
2
|
-
import { T as TextSelection } from "./chunks/converter-
|
|
3
|
-
import { _ as _export_sfc } from "./chunks/editor-
|
|
2
|
+
import { T as TextSelection } from "./chunks/converter-BFq1XXek.js";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/editor-BdLd21gy.js";
|
|
4
4
|
const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
|
|
5
5
|
const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
|
|
6
6
|
async function baseInsightsFetch(payload, options = {}) {
|
|
@@ -26471,7 +26471,7 @@ function createMeasurementPropertyHandler(xmlName, sdName = null) {
|
|
|
26471
26471
|
encode: (_2, encodedAttrs) => {
|
|
26472
26472
|
return encodedAttrs["value"] != null ? encodedAttrs : void 0;
|
|
26473
26473
|
},
|
|
26474
|
-
decode: function({ node: node2 }
|
|
26474
|
+
decode: function({ node: node2 }) {
|
|
26475
26475
|
const decodedAttrs = this.decodeAttributes({ node: { ...node2, attrs: node2.attrs[sdName] || {} } });
|
|
26476
26476
|
return decodedAttrs["w:w"] != null ? decodedAttrs : void 0;
|
|
26477
26477
|
}
|
|
@@ -26489,7 +26489,10 @@ const createAttributeHandler = (xmlName, sdName = null, transformEncode = null,
|
|
|
26489
26489
|
};
|
|
26490
26490
|
};
|
|
26491
26491
|
function encodeProperties(node2, translatorsByXmlName, asArray = false) {
|
|
26492
|
-
|
|
26492
|
+
if (!node2?.elements || node2.elements.length === 0) {
|
|
26493
|
+
return asArray ? [] : {};
|
|
26494
|
+
}
|
|
26495
|
+
const attributes = asArray ? [] : {};
|
|
26493
26496
|
node2.elements.forEach((el) => {
|
|
26494
26497
|
const translator2 = translatorsByXmlName[el.name];
|
|
26495
26498
|
if (translator2) {
|
|
@@ -26506,6 +26509,9 @@ function encodeProperties(node2, translatorsByXmlName, asArray = false) {
|
|
|
26506
26509
|
return attributes;
|
|
26507
26510
|
}
|
|
26508
26511
|
function decodeProperties(translatorsBySdName, properties) {
|
|
26512
|
+
if (!properties || typeof properties !== "object") {
|
|
26513
|
+
return [];
|
|
26514
|
+
}
|
|
26509
26515
|
const elements = [];
|
|
26510
26516
|
Object.keys(properties).forEach((key) => {
|
|
26511
26517
|
const translator2 = translatorsBySdName[key];
|
|
@@ -27310,7 +27316,7 @@ const _resolveHref = (docx, encodedAttrs) => {
|
|
|
27310
27316
|
}
|
|
27311
27317
|
return href;
|
|
27312
27318
|
};
|
|
27313
|
-
function decode(params
|
|
27319
|
+
function decode(params) {
|
|
27314
27320
|
const { node: node2 } = params;
|
|
27315
27321
|
const linkMark = node2.marks.find((m2) => m2.type === "link");
|
|
27316
27322
|
const linkAttrs = this.decodeAttributes({ ...params, node: linkMark });
|
|
@@ -30698,7 +30704,7 @@ const createNodeListHandler = (nodeHandlers) => {
|
|
|
30698
30704
|
}
|
|
30699
30705
|
} catch (error) {
|
|
30700
30706
|
console.debug("Import error", error);
|
|
30701
|
-
editor?.emit("exception", { error });
|
|
30707
|
+
editor?.emit("exception", { error, editor });
|
|
30702
30708
|
converter?.telemetry?.trackStatistic("error", {
|
|
30703
30709
|
type: "processing_error",
|
|
30704
30710
|
message: error.message,
|
|
@@ -30711,7 +30717,7 @@ const createNodeListHandler = (nodeHandlers) => {
|
|
|
30711
30717
|
return processedElements;
|
|
30712
30718
|
} catch (error) {
|
|
30713
30719
|
console.debug("Error during import", error);
|
|
30714
|
-
editor?.emit("exception", { error });
|
|
30720
|
+
editor?.emit("exception", { error, editor });
|
|
30715
30721
|
converter?.telemetry?.trackStatistic("error", {
|
|
30716
30722
|
type: "fatal_error",
|
|
30717
30723
|
message: error.message,
|
|
@@ -31177,8 +31183,13 @@ const _SuperConverter = class _SuperConverter {
|
|
|
31177
31183
|
return { typeface, panose };
|
|
31178
31184
|
}
|
|
31179
31185
|
getSchema(editor) {
|
|
31180
|
-
|
|
31181
|
-
|
|
31186
|
+
let result;
|
|
31187
|
+
try {
|
|
31188
|
+
this.getDocumentInternalId();
|
|
31189
|
+
result = createDocumentJson({ ...this.convertedXml, media: this.media }, this, editor);
|
|
31190
|
+
} catch (error) {
|
|
31191
|
+
editor?.emit("exception", { error, editor });
|
|
31192
|
+
}
|
|
31182
31193
|
if (result) {
|
|
31183
31194
|
this.savedTagsToRestore.push({ ...result.savedTagsToRestore });
|
|
31184
31195
|
this.pageStyles = result.pageStyles;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as process$1, aw as commonjsGlobal, B as Buffer, ax as getDefaultExportFromCjs, ay as getContentTypesFromXml, az as xmljs } from "./converter-
|
|
1
|
+
import { p as process$1, aw as commonjsGlobal, B as Buffer, ax as getDefaultExportFromCjs, ay as getContentTypesFromXml, az as xmljs } from "./converter-BFq1XXek.js";
|
|
2
2
|
function commonjsRequire(path) {
|
|
3
3
|
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
4
4
|
}
|