@pixldocs/canvas-renderer 0.5.24 → 0.5.25
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/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9613,10 +9613,6 @@ function PreviewCanvas({
|
|
|
9613
9613
|
}
|
|
9614
9614
|
);
|
|
9615
9615
|
}
|
|
9616
|
-
const PreviewCanvas$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9617
|
-
__proto__: null,
|
|
9618
|
-
PreviewCanvas
|
|
9619
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
9620
9616
|
function applyThemeToConfig(config, themeOverrides) {
|
|
9621
9617
|
var _a, _b, _c;
|
|
9622
9618
|
if (!themeOverrides || Object.keys(themeOverrides).length === 0) return config;
|
|
@@ -12049,6 +12045,10 @@ function PixldocsPreview(props) {
|
|
|
12049
12045
|
!canvasSettled && /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", minHeight: 200 }, children: /* @__PURE__ */ jsx("div", { style: { color: "#888", fontSize: 14 }, children: "Loading preview..." }) })
|
|
12050
12046
|
] });
|
|
12051
12047
|
}
|
|
12048
|
+
const PixldocsPreview$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12049
|
+
__proto__: null,
|
|
12050
|
+
PixldocsPreview
|
|
12051
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
12052
12052
|
const inlinedAssetCache = /* @__PURE__ */ new Map();
|
|
12053
12053
|
function shouldInlineImageUrl(url) {
|
|
12054
12054
|
if (!url || url.startsWith("data:")) return false;
|
|
@@ -12529,7 +12529,7 @@ class PixldocsRenderer {
|
|
|
12529
12529
|
}
|
|
12530
12530
|
}
|
|
12531
12531
|
async renderPageViaPreviewCanvas(config, pageIndex, pixelRatio, format, quality) {
|
|
12532
|
-
const {
|
|
12532
|
+
const { PixldocsPreview: PixldocsPreview2 } = await Promise.resolve().then(() => PixldocsPreview$1);
|
|
12533
12533
|
const canvasWidth = config.canvas.width;
|
|
12534
12534
|
const canvasHeight = config.canvas.height;
|
|
12535
12535
|
return new Promise((resolve, reject) => {
|
|
@@ -12596,7 +12596,7 @@ class PixldocsRenderer {
|
|
|
12596
12596
|
};
|
|
12597
12597
|
const root = createRoot(container);
|
|
12598
12598
|
root.render(
|
|
12599
|
-
createElement(
|
|
12599
|
+
createElement(PixldocsPreview2, {
|
|
12600
12600
|
config,
|
|
12601
12601
|
pageIndex,
|
|
12602
12602
|
zoom: 1,
|
|
@@ -12617,7 +12617,7 @@ class PixldocsRenderer {
|
|
|
12617
12617
|
// document space (e.g. 612x792) instead of inflated pixel space.
|
|
12618
12618
|
captureSvgViaPreviewCanvas(config, pageIndex, canvasWidth, canvasHeight) {
|
|
12619
12619
|
return new Promise(async (resolve, reject) => {
|
|
12620
|
-
const {
|
|
12620
|
+
const { PixldocsPreview: PixldocsPreview2 } = await Promise.resolve().then(() => PixldocsPreview$1);
|
|
12621
12621
|
const container = document.createElement("div");
|
|
12622
12622
|
container.style.cssText = `
|
|
12623
12623
|
position: fixed; left: -99999px; top: -99999px;
|
|
@@ -12698,7 +12698,7 @@ class PixldocsRenderer {
|
|
|
12698
12698
|
};
|
|
12699
12699
|
const root = createRoot(container);
|
|
12700
12700
|
root.render(
|
|
12701
|
-
createElement(
|
|
12701
|
+
createElement(PixldocsPreview2, {
|
|
12702
12702
|
config,
|
|
12703
12703
|
pageIndex,
|
|
12704
12704
|
zoom: 1,
|