@pixldocs/canvas-renderer 0.5.36 → 0.5.38
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 +38 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -217,6 +217,12 @@ export declare function loadGoogleFontCSS(rawFontFamily: string): Promise<void>;
|
|
|
217
217
|
*/
|
|
218
218
|
export declare function normalizeFontFamily(fontStack: string): string;
|
|
219
219
|
|
|
220
|
+
/**
|
|
221
|
+
* Package version banner. Bump alongside package.json so we can confirm
|
|
222
|
+
* (via browser:log) that the deployed bundle matches the expected build.
|
|
223
|
+
*/
|
|
224
|
+
export declare const PACKAGE_VERSION = "0.5.37";
|
|
225
|
+
|
|
220
226
|
export declare interface PageSettings {
|
|
221
227
|
backgroundColor?: string;
|
|
222
228
|
backgroundGradient?: any;
|
package/dist/index.js
CHANGED
|
@@ -12053,10 +12053,47 @@ function PixldocsPreview(props) {
|
|
|
12053
12053
|
!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..." }) })
|
|
12054
12054
|
] });
|
|
12055
12055
|
}
|
|
12056
|
+
const PACKAGE_VERSION = "0.5.37";
|
|
12057
|
+
let __underlineFixInstalled = false;
|
|
12058
|
+
function installUnderlineFix(fab) {
|
|
12059
|
+
var _a;
|
|
12060
|
+
if (__underlineFixInstalled) return;
|
|
12061
|
+
const TextProto = (_a = fab.Text) == null ? void 0 : _a.prototype;
|
|
12062
|
+
if (!TextProto || typeof TextProto._renderTextDecoration !== "function") return;
|
|
12063
|
+
const original = TextProto._renderTextDecoration;
|
|
12064
|
+
TextProto._renderTextDecoration = function patchedRenderTextDecoration(ctx, type) {
|
|
12065
|
+
try {
|
|
12066
|
+
const hasOwn = !!this[type];
|
|
12067
|
+
const hasStyled = typeof this.styleHas === "function" && this.styleHas(type);
|
|
12068
|
+
if (!hasOwn && !hasStyled) {
|
|
12069
|
+
return original.call(this, ctx, type);
|
|
12070
|
+
}
|
|
12071
|
+
const lines = this._textLines;
|
|
12072
|
+
if (Array.isArray(lines)) {
|
|
12073
|
+
this.__charBounds = [];
|
|
12074
|
+
for (let i = 0; i < lines.length; i++) {
|
|
12075
|
+
try {
|
|
12076
|
+
this.getLineWidth(i);
|
|
12077
|
+
} catch {
|
|
12078
|
+
}
|
|
12079
|
+
}
|
|
12080
|
+
}
|
|
12081
|
+
} catch {
|
|
12082
|
+
}
|
|
12083
|
+
return original.call(this, ctx, type);
|
|
12084
|
+
};
|
|
12085
|
+
__underlineFixInstalled = true;
|
|
12086
|
+
console.log(`[canvas-renderer] underline-fix monkey patch installed (v${PACKAGE_VERSION})`);
|
|
12087
|
+
}
|
|
12056
12088
|
class PixldocsRenderer {
|
|
12057
12089
|
constructor(config) {
|
|
12058
12090
|
__publicField(this, "config");
|
|
12059
12091
|
this.config = config;
|
|
12092
|
+
installUnderlineFix(fabric);
|
|
12093
|
+
try {
|
|
12094
|
+
console.log(`[canvas-renderer] PixldocsRenderer v${PACKAGE_VERSION} initialized`);
|
|
12095
|
+
} catch {
|
|
12096
|
+
}
|
|
12060
12097
|
}
|
|
12061
12098
|
/**
|
|
12062
12099
|
* Render a pre-resolved template config to an image using the full PageCanvas engine.
|
|
@@ -14863,6 +14900,7 @@ export {
|
|
|
14863
14900
|
FONT_FALLBACK_DEVANAGARI,
|
|
14864
14901
|
FONT_FALLBACK_SYMBOLS,
|
|
14865
14902
|
FONT_FILES,
|
|
14903
|
+
PACKAGE_VERSION,
|
|
14866
14904
|
PixldocsPreview,
|
|
14867
14905
|
PixldocsRenderer,
|
|
14868
14906
|
applyThemeToConfig,
|