@snowcone-app/canvas 0.46.10 → 0.46.11
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-CmIQSVCK.js → CanvasRenderer-CLL5V71e.js} +4 -4
- package/dist/{CanvasRenderer-CmIQSVCK.js.map → CanvasRenderer-CLL5V71e.js.map} +1 -1
- package/dist/{ContextualToolbars-BG90V6-s.js → ContextualToolbars-DnsfOy7x.js} +138 -137
- package/dist/ContextualToolbars-DnsfOy7x.js.map +1 -0
- package/dist/{EditorCanvasImpl-C7y7UNl1.js → EditorCanvasImpl-DDBa3pvE.js} +8 -8
- package/dist/{EditorCanvasImpl-C7y7UNl1.js.map → EditorCanvasImpl-DDBa3pvE.js.map} +1 -1
- package/dist/ExportManager-BR5uca6R.js +5579 -0
- package/dist/ExportManager-BR5uca6R.js.map +1 -0
- package/dist/{ImagePanel-BaEJnUvS.js → ImagePanel-Bez-5INu.js} +6 -6
- package/dist/{ImagePanel-BaEJnUvS.js.map → ImagePanel-Bez-5INu.js.map} +1 -1
- package/dist/{SnowconeCanvas-C6FmL0pj.js → SnowconeCanvas-Cjnp1ztd.js} +10 -10
- package/dist/{SnowconeCanvas-C6FmL0pj.js.map → SnowconeCanvas-Cjnp1ztd.js.map} +1 -1
- package/dist/advanced.mjs +16 -16
- package/dist/{compose-Ce53EW1v.js → compose-CZslfDUm.js} +3 -3
- package/dist/{compose-Ce53EW1v.js.map → compose-CZslfDUm.js.map} +1 -1
- package/dist/constants.d.ts +0 -1
- package/dist/{custom-icons-BA-MX7Y2.js → custom-icons-DIqddGX1.js} +2 -2
- package/dist/{custom-icons-BA-MX7Y2.js.map → custom-icons-DIqddGX1.js.map} +1 -1
- package/dist/{design-builder-HKRo18WT.js → design-builder-CCPB3WRx.js} +4 -4
- package/dist/design-builder-CCPB3WRx.js.map +1 -0
- package/dist/{embed-CYlEe_Xv.js → embed-BydDaNDy.js} +9 -9
- package/dist/{embed-CYlEe_Xv.js.map → embed-BydDaNDy.js.map} +1 -1
- package/dist/embed.mjs +6 -6
- package/dist/{export-worker.bundle.string-CyMb_XjB.js → export-worker.bundle.string-DG2f-C1t.js} +1490 -1487
- package/dist/{export-worker.bundle.string-CyMb_XjB.js.map → export-worker.bundle.string-DG2f-C1t.js.map} +1 -1
- package/dist/{FontAnalyzer-CLMJi2Sw.js → fontAnalysisCache-B2lh7X-_.js} +1408 -3329
- package/dist/fontAnalysisCache-B2lh7X-_.js.map +1 -0
- package/dist/{guards-Dk86a-kH.js → guards-2oykBUel.js} +2 -2
- package/dist/{guards-Dk86a-kH.js.map → guards-2oykBUel.js.map} +1 -1
- package/dist/index.mjs +9 -9
- package/dist/internals.mjs +5 -5
- package/dist/{template-fields-3CH15MFC.js → template-fields-cNoo8zDC.js} +6 -6
- package/dist/template-fields-cNoo8zDC.js.map +1 -0
- package/dist/testing.mjs +3 -3
- package/dist/{useCommands-C6nE770t.js → useCommands-mpsd0_l5.js} +17 -17
- package/dist/{useCommands-C6nE770t.js.map → useCommands-mpsd0_l5.js.map} +1 -1
- package/dist/{usePieceGuideBundle-DJfjOVEd.js → usePieceGuideBundle-BuxwVcb5.js} +2 -2
- package/dist/{usePieceGuideBundle-DJfjOVEd.js.map → usePieceGuideBundle-BuxwVcb5.js.map} +1 -1
- package/dist/utils/fontAnalysisCache.d.ts +14 -0
- package/dist/{validation-C3FHoCbQ.js → validation-DjdrFk2P.js} +11 -11
- package/dist/{validation-C3FHoCbQ.js.map → validation-DjdrFk2P.js.map} +1 -1
- package/dist/workers/export-worker.bundle.string.d.ts +1 -1
- package/example/package.json +1 -1
- package/package.json +4 -4
- package/dist/ContextualToolbars-BG90V6-s.js.map +0 -1
- package/dist/ExportManager-DEJgxB0S.js +0 -3647
- package/dist/ExportManager-DEJgxB0S.js.map +0 -1
- package/dist/FontAnalyzer-CLMJi2Sw.js.map +0 -1
- package/dist/design-builder-HKRo18WT.js.map +0 -1
- package/dist/template-fields-3CH15MFC.js.map +0 -1
package/dist/testing.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { E as A, f as y } from "./design-builder-
|
|
2
|
-
import { g as ie, h as oe, r as ae } from "./design-builder-
|
|
1
|
+
import { E as A, f as y } from "./design-builder-CCPB3WRx.js";
|
|
2
|
+
import { g as ie, h as oe, r as ae } from "./design-builder-CCPB3WRx.js";
|
|
3
3
|
import { fetchMockupImage as S, isSnowconeSdkError as b, RenderSession as _, mintRealtimeGrant as R } from "@snowcone-app/sdk";
|
|
4
|
-
import { e as I, A as D, o as T, I as k, q as m } from "./
|
|
4
|
+
import { e as I, A as D, o as T, I as k, q as m } from "./fontAnalysisCache-B2lh7X-_.js";
|
|
5
5
|
import { serializeStateForServer as F } from "@snowcone-app/design/wire";
|
|
6
6
|
import { jsx as u } from "react/jsx-runtime";
|
|
7
7
|
import { useState as x } from "react";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as f, jsxs as j, Fragment as an } from "react/jsx-runtime";
|
|
2
2
|
import * as F from "react";
|
|
3
3
|
import ne, { useRef as V, useState as B, useCallback as N, useMemo as X, useEffect as q, forwardRef as Pn, createElement as Sn, useLayoutEffect as $n, memo as Qo, useReducer as Zo, useContext as Be, createContext as Je, cloneElement as ei, useId as Pr, useSyncExternalStore as $r } from "react";
|
|
4
|
-
import { b as Yt, w as ti, o as ni, x as Hr, m as ri, q as oi } from "./design-builder-
|
|
5
|
-
import { G as Ie, c as Qe, q as rt, Z as ii,
|
|
6
|
-
import { R as gi, I as
|
|
4
|
+
import { b as Yt, w as ti, o as ni, x as Hr, m as ri, q as oi } from "./design-builder-CCPB3WRx.js";
|
|
5
|
+
import { G as Ie, c as Qe, q as rt, Z as ii, I as si, P as ai, S as li, T as ci, aX as di, N as ui, aY as fi, aZ as hi, U as sr } from "./fontAnalysisCache-B2lh7X-_.js";
|
|
6
|
+
import { R as gi, I as ln, a as cn, S as dn } from "./ExportManager-BR5uca6R.js";
|
|
7
7
|
import { createPortal as Hn, unstable_batchedUpdates as Ft } from "react-dom";
|
|
8
8
|
import { clsx as Br } from "clsx";
|
|
9
9
|
import { extendTailwindMerge as Vr } from "tailwind-merge";
|
|
@@ -7036,7 +7036,7 @@ const Dl = ({
|
|
|
7036
7036
|
var E;
|
|
7037
7037
|
const { get: a } = Hr(), [l, c] = B(!1), [u, d] = B(!1), [h, p] = B(!1), k = V(null), y = async () => {
|
|
7038
7038
|
try {
|
|
7039
|
-
const { ExportManager: v } = await import("./ExportManager-
|
|
7039
|
+
const { ExportManager: v } = await import("./ExportManager-BR5uca6R.js").then((T) => T.a2), { artboardManager: D, elements: w } = a(), A = D.getAllArtboards();
|
|
7040
7040
|
v.exportToJSON(A, w, D), c(!1);
|
|
7041
7041
|
} catch (v) {
|
|
7042
7042
|
bn.error("Failed to save workspace:", v), alert("Failed to save workspace. Please try again.");
|
|
@@ -7049,9 +7049,9 @@ const Dl = ({
|
|
|
7049
7049
|
const D = (w = v.target.files) == null ? void 0 : w[0];
|
|
7050
7050
|
if (D) {
|
|
7051
7051
|
try {
|
|
7052
|
-
const A = await
|
|
7052
|
+
const A = await ln.importFromJSON(D);
|
|
7053
7053
|
if (A.success && A.artboards && A.elements) {
|
|
7054
|
-
const T =
|
|
7054
|
+
const T = ln.validateImportedData(A.artboards, A.elements);
|
|
7055
7055
|
if (!T.valid && !confirm(
|
|
7056
7056
|
`Found ${T.errors.length} issue(s) in the file:
|
|
7057
7057
|
|
|
@@ -7062,7 +7062,7 @@ const Dl = ({
|
|
|
7062
7062
|
Do you want to load anyway?`
|
|
7063
7063
|
))
|
|
7064
7064
|
return;
|
|
7065
|
-
const O =
|
|
7065
|
+
const O = ln.getImportSummary(A.artboards, A.elements);
|
|
7066
7066
|
confirm(
|
|
7067
7067
|
`Load workspace with:
|
|
7068
7068
|
|
|
@@ -7090,7 +7090,7 @@ This will replace your current workspace. Continue?`
|
|
|
7090
7090
|
return;
|
|
7091
7091
|
}
|
|
7092
7092
|
try {
|
|
7093
|
-
const { ExportManager: T } = await import("./ExportManager-
|
|
7093
|
+
const { ExportManager: T } = await import("./ExportManager-BR5uca6R.js").then((O) => O.a2);
|
|
7094
7094
|
await T.exportArtboardToImage(A, D, w.current, {
|
|
7095
7095
|
format: "png",
|
|
7096
7096
|
scale: 2,
|
|
@@ -7226,7 +7226,7 @@ function Go({
|
|
|
7226
7226
|
return q(() => {
|
|
7227
7227
|
if (!t || o) return;
|
|
7228
7228
|
let s = !1;
|
|
7229
|
-
return import("./ImagePanel-
|
|
7229
|
+
return import("./ImagePanel-Bez-5INu.js").then(
|
|
7230
7230
|
(a) => {
|
|
7231
7231
|
s || i(() => a.ImagePanel);
|
|
7232
7232
|
},
|
|
@@ -7354,7 +7354,7 @@ function yc() {
|
|
|
7354
7354
|
totalExports: 0,
|
|
7355
7355
|
avgExportTime: 0,
|
|
7356
7356
|
isWorkerActive: !1
|
|
7357
|
-
}), k = V(0), y = V(null), g =
|
|
7357
|
+
}), k = V(0), y = V(null), g = cn.supportsWorkerExport(), m = N(async (v, D = {}) => {
|
|
7358
7358
|
const w = e.find((T) => T.id === v);
|
|
7359
7359
|
if (!w)
|
|
7360
7360
|
throw new Error(`[useExport] Artboard ${v} not found`);
|
|
@@ -7370,7 +7370,7 @@ function yc() {
|
|
|
7370
7370
|
};
|
|
7371
7371
|
c((T) => [...T, A]);
|
|
7372
7372
|
try {
|
|
7373
|
-
const T = Date.now(), O = M.current, W = t.getElementsOnArtboard(v), ae = O.filter((Y) => W.includes(Y.id)), _ = await
|
|
7373
|
+
const T = Date.now(), O = M.current, W = t.getElementsOnArtboard(v), ae = O.filter((Y) => W.includes(Y.id)), _ = await cn.exportArtboardToDataURL(
|
|
7374
7374
|
w,
|
|
7375
7375
|
ae,
|
|
7376
7376
|
r.current,
|
|
@@ -7419,7 +7419,7 @@ function yc() {
|
|
|
7419
7419
|
i(!0);
|
|
7420
7420
|
try {
|
|
7421
7421
|
const A = M.current, T = t.getElementsOnArtboard(v), O = A.filter((ae) => T.includes(ae.id));
|
|
7422
|
-
return await
|
|
7422
|
+
return await cn.exportArtboardToBlob(
|
|
7423
7423
|
w,
|
|
7424
7424
|
O,
|
|
7425
7425
|
r.current,
|
|
@@ -7683,14 +7683,14 @@ class Vl {
|
|
|
7683
7683
|
* Returns system fonts + Google Fonts (deduplicated)
|
|
7684
7684
|
*/
|
|
7685
7685
|
getAllFonts() {
|
|
7686
|
-
const t =
|
|
7686
|
+
const t = dn.filter((r) => !r.googleFont), n = this.mapGoogleFonts(wn());
|
|
7687
7687
|
return this.mergeFonts([...t, ...n]);
|
|
7688
7688
|
}
|
|
7689
7689
|
/**
|
|
7690
7690
|
* Get recommended fonts (TSHIRT_FONTS curated list)
|
|
7691
7691
|
*/
|
|
7692
7692
|
getRecommendedFonts() {
|
|
7693
|
-
return
|
|
7693
|
+
return dn;
|
|
7694
7694
|
}
|
|
7695
7695
|
// ========================================
|
|
7696
7696
|
// Dual Search Strategy
|
|
@@ -7712,7 +7712,7 @@ class Vl {
|
|
|
7712
7712
|
*/
|
|
7713
7713
|
async filterFontsByCategory(t) {
|
|
7714
7714
|
if (t === "system")
|
|
7715
|
-
return
|
|
7715
|
+
return dn.filter((i) => !i.googleFont);
|
|
7716
7716
|
const n = `category:${t}`;
|
|
7717
7717
|
if (this.searchCache.has(n))
|
|
7718
7718
|
return this.searchCache.get(n);
|
|
@@ -8000,7 +8000,7 @@ function Zl(e, t) {
|
|
|
8000
8000
|
function ec(e, t) {
|
|
8001
8001
|
let n = !1;
|
|
8002
8002
|
if (t.x !== void 0 && (e.x = t.x), t.y !== void 0 && (e.y = t.y), t.rotation !== void 0 && e.setRotation(t.rotation), t.opacity !== void 0 && (e.opacity = t.opacity), t.name !== void 0 && (e.name = t.name), t.visible !== void 0 && (e.visible = t.visible), t.locked !== void 0 && (e.locked = t.locked), Yo(e))
|
|
8003
|
-
return t.text !== void 0 && e.setText(t.text), t.fontSize !== void 0 && e.setFontSize(t.fontSize), t.color !== void 0 && e.setColor(t.color), t.fontFamily !== void 0 && t.fontFamily !== e.fontFamily && (ui
|
|
8003
|
+
return t.text !== void 0 && e.setText(t.text), t.fontSize !== void 0 && e.setFontSize(t.fontSize), t.color !== void 0 && e.setColor(t.color), t.fontFamily !== void 0 && t.fontFamily !== e.fontFamily && (ui(e.fontFamily), e.fontFamily = t.fontFamily), t.bold !== void 0 && (e.bold = t.bold), t.italic !== void 0 && (e.italic = t.italic), t.textAlign !== void 0 && (e.textAlign = t.textAlign), { needsImageLoad: n };
|
|
8004
8004
|
const r = e;
|
|
8005
8005
|
if (t.width !== void 0 && (r.transformData.width = t.width), t.height !== void 0 && (r.transformData.height = t.height), t.fillColor !== void 0) {
|
|
8006
8006
|
const o = e.transformData;
|
|
@@ -8150,4 +8150,4 @@ export {
|
|
|
8150
8150
|
or as y,
|
|
8151
8151
|
rn as z
|
|
8152
8152
|
};
|
|
8153
|
-
//# sourceMappingURL=useCommands-
|
|
8153
|
+
//# sourceMappingURL=useCommands-mpsd0_l5.js.map
|