@snowcone-app/canvas 0.43.6 → 0.43.7
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/{CanvasRenderer-DnYgiWjt.js → CanvasRenderer-DIug_mjX.js} +4 -4
- package/dist/{CanvasRenderer-DnYgiWjt.js.map → CanvasRenderer-DIug_mjX.js.map} +1 -1
- package/dist/{CanvasStateV1-B51bXTyy.js → CanvasStateV1-BWd358xJ.js} +3 -3
- package/dist/{CanvasStateV1-B51bXTyy.js.map → CanvasStateV1-BWd358xJ.js.map} +1 -1
- package/dist/{ContextualToolbars-DtlxDatY.js → ContextualToolbars-CspkC1T3.js} +6 -6
- package/dist/{ContextualToolbars-DtlxDatY.js.map → ContextualToolbars-CspkC1T3.js.map} +1 -1
- package/dist/{EditorCanvasImpl-B5IEg9tq.js → EditorCanvasImpl-DpssZT6w.js} +8 -8
- package/dist/{EditorCanvasImpl-B5IEg9tq.js.map → EditorCanvasImpl-DpssZT6w.js.map} +1 -1
- package/dist/{ExportManager-vAuaoF5Q.js → ExportManager-BDH9jW4Q.js} +3 -3
- package/dist/{ExportManager-vAuaoF5Q.js.map → ExportManager-BDH9jW4Q.js.map} +1 -1
- package/dist/{FontAnalyzer-D9R2PYsy.js → FontAnalyzer-CyhywbAM.js} +336 -325
- package/dist/FontAnalyzer-CyhywbAM.js.map +1 -0
- package/dist/{ImagePanel-kybrF6yT.js → ImagePanel-CIGpLY3B.js} +6 -6
- package/dist/{ImagePanel-kybrF6yT.js.map → ImagePanel-CIGpLY3B.js.map} +1 -1
- package/dist/{SnowconeCanvas-rAUrO9PR.js → SnowconeCanvas-Bs34CUv5.js} +10 -10
- package/dist/{SnowconeCanvas-rAUrO9PR.js.map → SnowconeCanvas-Bs34CUv5.js.map} +1 -1
- package/dist/advanced.mjs +15 -15
- package/dist/{custom-icons-Dlfrg3A_.js → custom-icons-sT5sNRcG.js} +2 -2
- package/dist/{custom-icons-Dlfrg3A_.js.map → custom-icons-sT5sNRcG.js.map} +1 -1
- package/dist/{design-builder-C8s1r4MF.js → design-builder-CwfefZJC.js} +2 -2
- package/dist/{design-builder-C8s1r4MF.js.map → design-builder-CwfefZJC.js.map} +1 -1
- package/dist/{embed-BXa1jr7S.js → embed-BcYaDLRo.js} +10 -10
- package/dist/{embed-BXa1jr7S.js.map → embed-BcYaDLRo.js.map} +1 -1
- package/dist/embed.mjs +7 -7
- package/dist/{export-worker.bundle.string-C6Zm9Wt-.js → export-worker.bundle.string-BL30CYzH.js} +18 -3
- package/dist/{export-worker.bundle.string-C6Zm9Wt-.js.map → export-worker.bundle.string-BL30CYzH.js.map} +1 -1
- package/dist/fonts/fontWeights.d.ts +6 -0
- package/dist/{guards-B0PNEbK6.js → guards-Dvw7Qch0.js} +2 -2
- package/dist/{guards-B0PNEbK6.js.map → guards-Dvw7Qch0.js.map} +1 -1
- package/dist/index.mjs +9 -9
- package/dist/internals.mjs +6 -6
- package/dist/{template-fields-ZZEdYB5H.js → template-fields-DF1ijCl9.js} +5 -5
- package/dist/{template-fields-ZZEdYB5H.js.map → template-fields-DF1ijCl9.js.map} +1 -1
- package/dist/testing.mjs +3 -3
- package/dist/{useCommands-d5UM6Cnc.js → useCommands-wwGeWCn6.js} +7 -7
- package/dist/{useCommands-d5UM6Cnc.js.map → useCommands-wwGeWCn6.js.map} +1 -1
- package/dist/{usePieceGuideBundle-BPVWvChD.js → usePieceGuideBundle-BWQINIJR.js} +2 -2
- package/dist/{usePieceGuideBundle-BPVWvChD.js.map → usePieceGuideBundle-BWQINIJR.js.map} +1 -1
- package/dist/{validation-C8qNtk6j.js → validation-B6sLZULE.js} +11 -11
- package/dist/{validation-C8qNtk6j.js.map → validation-B6sLZULE.js.map} +1 -1
- package/dist/workers/export-worker.bundle.string.d.ts +1 -1
- package/example/package.json +1 -1
- package/package.json +2 -2
- package/dist/FontAnalyzer-D9R2PYsy.js.map +0 -1
package/dist/embed.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { C as a, g as t, h as o, K as r, N as i, O as n, P as d, Q as m, R as u, b as l, a as E, j as c, k as p, l as g } from "./useCommands-
|
|
2
|
-
import { E as x, R as C, a as S, b as T, S as P, c as R, d as b, e as B, f as v, g as y, i as F, h as k, p as h, s as D, j as I, k as K, l as L, v as w } from "./embed-
|
|
3
|
-
import { t as M, Y as j } from "./FontAnalyzer-
|
|
4
|
-
import { D as N, f as Y, n as _, m as z, b as H } from "./design-builder-
|
|
5
|
-
import { D as O, T as Q, r as V, u as q, a as U, b as W, c as X, d as Z, e as $, w as ee } from "./template-fields-
|
|
6
|
-
import { G as ae, H as te, J as oe, K as re } from "./ExportManager-
|
|
7
|
-
import { s as ne } from "./CanvasStateV1-
|
|
1
|
+
import { C as a, g as t, h as o, K as r, N as i, O as n, P as d, Q as m, R as u, b as l, a as E, j as c, k as p, l as g } from "./useCommands-wwGeWCn6.js";
|
|
2
|
+
import { E as x, R as C, a as S, b as T, S as P, c as R, d as b, e as B, f as v, g as y, i as F, h as k, p as h, s as D, j as I, k as K, l as L, v as w } from "./embed-BcYaDLRo.js";
|
|
3
|
+
import { t as M, Y as j } from "./FontAnalyzer-CyhywbAM.js";
|
|
4
|
+
import { D as N, f as Y, n as _, m as z, b as H } from "./design-builder-CwfefZJC.js";
|
|
5
|
+
import { D as O, T as Q, r as V, u as q, a as U, b as W, c as X, d as Z, e as $, w as ee } from "./template-fields-DF1ijCl9.js";
|
|
6
|
+
import { G as ae, H as te, J as oe, K as re } from "./ExportManager-BDH9jW4Q.js";
|
|
7
|
+
import { s as ne } from "./CanvasStateV1-BWd358xJ.js";
|
|
8
8
|
export {
|
|
9
9
|
a as CanvasServicesProvider,
|
|
10
10
|
N as DesignBuilder,
|
package/dist/{export-worker.bundle.string-C6Zm9Wt-.js → export-worker.bundle.string-BL30CYzH.js}
RENAMED
|
@@ -20267,6 +20267,21 @@ const n = `"use strict";
|
|
|
20267
20267
|
ctx.restore();
|
|
20268
20268
|
}
|
|
20269
20269
|
|
|
20270
|
+
// src/fonts/fontWeights.ts
|
|
20271
|
+
var byName = null;
|
|
20272
|
+
function catalogueWeights(family) {
|
|
20273
|
+
byName ?? (byName = new Map(TSHIRT_FONTS.filter((f) => f.weights?.length).map((f) => [f.name, f.weights])));
|
|
20274
|
+
return byName.get(family);
|
|
20275
|
+
}
|
|
20276
|
+
function servedWeight(family, weight) {
|
|
20277
|
+
const ws = catalogueWeights(family);
|
|
20278
|
+
if (!ws || ws.includes(weight)) return weight;
|
|
20279
|
+
return ws.reduce((best, w) => Math.abs(w - weight) < Math.abs(best - weight) ? w : best, ws[0]);
|
|
20280
|
+
}
|
|
20281
|
+
function servedWeights(family, wanted) {
|
|
20282
|
+
return [...new Set(wanted.map((w) => servedWeight(family, w)))];
|
|
20283
|
+
}
|
|
20284
|
+
|
|
20270
20285
|
// src/utils/logger.ts
|
|
20271
20286
|
var Logger = class {
|
|
20272
20287
|
constructor() {
|
|
@@ -20405,7 +20420,7 @@ const n = `"use strict";
|
|
|
20405
20420
|
*/
|
|
20406
20421
|
getGoogleFontUrl(fontFamily, weight = 400) {
|
|
20407
20422
|
const formattedFamily = fontFamily.replace(/\\s+/g, "+");
|
|
20408
|
-
return \`https://fonts.googleapis.com/css2?family=\${formattedFamily}:wght@\${weight}&display=swap\`;
|
|
20423
|
+
return \`https://fonts.googleapis.com/css2?family=\${formattedFamily}:wght@\${servedWeight(fontFamily, weight)}&display=swap\`;
|
|
20409
20424
|
}
|
|
20410
20425
|
/**
|
|
20411
20426
|
* Extract actual font file URL from Google Fonts CSS
|
|
@@ -23613,7 +23628,7 @@ const n = `"use strict";
|
|
|
23613
23628
|
}
|
|
23614
23629
|
async function fetchGoogleFontCss(family, fetchImpl = fetch) {
|
|
23615
23630
|
const cssParts = await Promise.all(
|
|
23616
|
-
WEIGHTS_TO_REQUEST.map((weight) => fetchOneWeightCss(family, weight, fetchImpl))
|
|
23631
|
+
servedWeights(family, WEIGHTS_TO_REQUEST).map((weight) => fetchOneWeightCss(family, weight, fetchImpl))
|
|
23617
23632
|
);
|
|
23618
23633
|
return cssParts.join("\\n");
|
|
23619
23634
|
}
|
|
@@ -24473,4 +24488,4 @@ const n = `"use strict";
|
|
|
24473
24488
|
export {
|
|
24474
24489
|
n as default
|
|
24475
24490
|
};
|
|
24476
|
-
//# sourceMappingURL=export-worker.bundle.string-
|
|
24491
|
+
//# sourceMappingURL=export-worker.bundle.string-BL30CYzH.js.map
|