@ai-matrx/print 0.7.0 → 0.8.0
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/CHANGELOG.md +63 -0
- package/README.md +12 -0
- package/dist/document.cjs +3028 -301
- package/dist/document.cjs.map +1 -1
- package/dist/document.d.cts +225 -55
- package/dist/document.d.ts +225 -55
- package/dist/document.js +3028 -301
- package/dist/document.js.map +1 -1
- package/dist/react.cjs +4 -4
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +34 -2
- package/dist/react.d.ts +34 -2
- package/dist/react.js +4 -4
- package/dist/react.js.map +1 -1
- package/package.json +14 -2
package/dist/react.cjs
CHANGED
|
@@ -1580,7 +1580,7 @@ var EXPORT_BUTTONS = [
|
|
|
1580
1580
|
{ format: "html", label: "HTML" },
|
|
1581
1581
|
{ format: "markdown", label: "Markdown" }
|
|
1582
1582
|
];
|
|
1583
|
-
function DocumentPrintPreview({ markdown, title, className, onNotice }) {
|
|
1583
|
+
function DocumentPrintPreview({ markdown, title, className, onNotice, resolveReferences }) {
|
|
1584
1584
|
const [view, setView] = (0, import_react.useState)("pages");
|
|
1585
1585
|
const [pdf, setPdf] = (0, import_react.useState)(null);
|
|
1586
1586
|
const [html, setHtml] = (0, import_react.useState)("");
|
|
@@ -1598,7 +1598,7 @@ function DocumentPrintPreview({ markdown, title, className, onNotice }) {
|
|
|
1598
1598
|
const timer = setTimeout(async () => {
|
|
1599
1599
|
try {
|
|
1600
1600
|
const doc = await import("@ai-matrx/print/document");
|
|
1601
|
-
const exp = await doc.exportDocument(markdown, "pdf", { title });
|
|
1601
|
+
const exp = await doc.exportDocument(markdown, "pdf", { title, resolveReferences });
|
|
1602
1602
|
if (cancelled) return;
|
|
1603
1603
|
url = URL.createObjectURL(new Blob([exp.bytes], { type: "application/pdf" }));
|
|
1604
1604
|
const images = await doc.resolveDocumentImages(exp.tree);
|
|
@@ -1629,12 +1629,12 @@ function DocumentPrintPreview({ markdown, title, className, onNotice }) {
|
|
|
1629
1629
|
clearTimeout(timer);
|
|
1630
1630
|
if (url) URL.revokeObjectURL(url);
|
|
1631
1631
|
};
|
|
1632
|
-
}, [markdown, title]);
|
|
1632
|
+
}, [markdown, title, resolveReferences]);
|
|
1633
1633
|
const download = async (format) => {
|
|
1634
1634
|
setBusy(format);
|
|
1635
1635
|
try {
|
|
1636
1636
|
const doc = await import("@ai-matrx/print/document");
|
|
1637
|
-
const exp = await doc.exportDocument(markdown, format, { title });
|
|
1637
|
+
const exp = await doc.exportDocument(markdown, format, { title, resolveReferences });
|
|
1638
1638
|
doc.downloadDocumentExport(exp);
|
|
1639
1639
|
setError(null);
|
|
1640
1640
|
} catch (err) {
|