@jetprint/editor-sdk 1.2.15 → 1.2.17
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/components/Editor/components/PreviewPanel.vue.d.ts +1 -0
- package/dist/components/Editor/composables/useDiecutScreenshot.d.ts +6 -0
- package/dist/components/Editor/composables/usePreviewRenderer.d.ts +3 -0
- package/dist/components/Editor/composables/useProductData.d.ts +2 -0
- package/dist/components/Editor/index.vue.d.ts +11 -3
- package/dist/components/Editor/utils/pillow3dPreview.d.ts +14 -0
- package/dist/editor-sdk.es.js +42783 -42472
- package/dist/index.d.ts +20 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +7 -0
- package/dist/utils/protection/encryptedModules.generated.d.ts +1 -1
- package/dist/utils/renderedImagesDB.d.ts +3 -0
- package/package.json +1 -1
- package/dist/headless.global.js +0 -504
|
@@ -176,6 +176,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
176
176
|
getCurrentPreviewImageBlob: (opts?: PreviewBlobOptions) => Promise<Blob | null>;
|
|
177
177
|
getPreviewImageBlobByIndex: (index: number, opts?: PreviewBlobOptions) => Promise<Blob | null>;
|
|
178
178
|
clearPreviewImageCache: () => void;
|
|
179
|
+
invalidateMockupGroupCache: () => void;
|
|
179
180
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
180
181
|
"update:selectedColor": (...args: any[]) => void;
|
|
181
182
|
"prev-template": (...args: any[]) => void;
|
|
@@ -43,12 +43,18 @@ export declare function useDiecutScreenshot(options: {
|
|
|
43
43
|
* 避免在切换中途截到下一分片/空画布。**不要**在此等预览构建(会与调用方预览构建死锁)。
|
|
44
44
|
*/
|
|
45
45
|
awaitCanvasIdle?: () => Promise<void>;
|
|
46
|
+
/** 特殊设计模式:'pillow3d' 时生成截图即【烘焙】缝份描边 + 伪立体(异形抱枕),一处出图、缓存/预览/效果图一致。 */
|
|
47
|
+
getSpecialMode?: () => string;
|
|
48
|
+
/** 异形抱枕缝份描边颜色(默认白):烘焙时沿设计外轮廓描一圈 ≈5cm 缝份边 */
|
|
49
|
+
getPillowSeamColor?: () => string;
|
|
46
50
|
}): {
|
|
47
51
|
generateDiecutScreenshot: (diecutId: string, snapshotOpts?: FabricMainCanvasSnapshotOptions, precapturedBaseBlob?: Blob | null) => Promise<void>;
|
|
48
52
|
generateDiecutScreenshotsForIds: (diecutIds: string[]) => Promise<void>;
|
|
53
|
+
waitForPendingScreenshots: () => Promise<void>;
|
|
49
54
|
getInverseMaskUrl: (groupId: string) => string;
|
|
50
55
|
getInverseMaskBlob: (groupId: string) => Blob | undefined;
|
|
51
56
|
getInverseMaskVersion: (groupId: string) => number;
|
|
57
|
+
invalidateInverseMaskForGroups: (groupIds: Array<string | number>) => void;
|
|
52
58
|
clearCache: () => void;
|
|
53
59
|
dispose: () => void;
|
|
54
60
|
};
|
|
@@ -49,6 +49,8 @@ export declare function usePreviewRenderer(options: {
|
|
|
49
49
|
getSelectedSize?: () => string;
|
|
50
50
|
/** 特殊设计模式(none|embroidery|pillow3d)。pillow3d 时把设计截图过伪立体效果,作为预览效果图的设计纹理 */
|
|
51
51
|
getSpecialMode?: () => string;
|
|
52
|
+
/** 异形抱枕缝份描边颜色(默认白 #ffffff);pillow3d 预览沿设计外轮廓描一圈 ≈5cm 缝份边 */
|
|
53
|
+
getPillowSeamColor?: () => string;
|
|
52
54
|
saveCanvasState: (diecutId: string) => Promise<void>;
|
|
53
55
|
generateDiecutScreenshot: (diecutId: string, opts?: {
|
|
54
56
|
multiplier?: number;
|
|
@@ -107,6 +109,7 @@ export declare function usePreviewRenderer(options: {
|
|
|
107
109
|
prewarmZonesPreviewQuick: (target?: any) => Promise<void>;
|
|
108
110
|
endZonesPreviewQuick: () => void;
|
|
109
111
|
clearZoneScreenshotCache: () => void;
|
|
112
|
+
clearPillowBakeCache: () => void;
|
|
110
113
|
disposeZoneScreenshotWorker: () => void;
|
|
111
114
|
getPreviewBuildInFlight: () => Promise<void> | null;
|
|
112
115
|
};
|
|
@@ -34,6 +34,7 @@ export declare function useProductData(props: any, options?: {
|
|
|
34
34
|
colorsZh?: string[] | undefined;
|
|
35
35
|
coverImg?: string | undefined;
|
|
36
36
|
sku?: string | undefined;
|
|
37
|
+
designCode?: string | number | undefined;
|
|
37
38
|
} | null, BasicInfo | {
|
|
38
39
|
id?: number | string | undefined;
|
|
39
40
|
name?: string | undefined;
|
|
@@ -45,6 +46,7 @@ export declare function useProductData(props: any, options?: {
|
|
|
45
46
|
colorsZh?: string[] | undefined;
|
|
46
47
|
coverImg?: string | undefined;
|
|
47
48
|
sku?: string | undefined;
|
|
49
|
+
designCode?: string | number | undefined;
|
|
48
50
|
} | null>;
|
|
49
51
|
diecutDataState: import("vue").Ref<{
|
|
50
52
|
msg?: string | undefined;
|
|
@@ -43,15 +43,15 @@ type EditorProps = {
|
|
|
43
43
|
/** 左侧栏额外 Tab(竖条 + 内容区由宿主传入 Vue 组件) */
|
|
44
44
|
customSidebarTabs?: CustomSidebarTabDef[];
|
|
45
45
|
};
|
|
46
|
-
declare var __VLS_25: {}, __VLS_31: {},
|
|
46
|
+
declare var __VLS_25: {}, __VLS_31: {}, __VLS_145: {}, __VLS_151: {};
|
|
47
47
|
type __VLS_Slots = {} & {
|
|
48
48
|
'topbar-left'?: (props: typeof __VLS_25) => any;
|
|
49
49
|
} & {
|
|
50
50
|
'topbar-right'?: (props: typeof __VLS_31) => any;
|
|
51
51
|
} & {
|
|
52
|
-
'topbar-left'?: (props: typeof
|
|
52
|
+
'topbar-left'?: (props: typeof __VLS_145) => any;
|
|
53
53
|
} & {
|
|
54
|
-
'topbar-right'?: (props: typeof
|
|
54
|
+
'topbar-right'?: (props: typeof __VLS_151) => any;
|
|
55
55
|
};
|
|
56
56
|
declare const __VLS_component: import("vue").DefineComponent<EditorProps, {
|
|
57
57
|
renderAllTemplates: () => Promise<Array<{
|
|
@@ -144,9 +144,17 @@ declare const __VLS_component: import("vue").DefineComponent<EditorProps, {
|
|
|
144
144
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
145
145
|
"update:locale": (value: "zh-CN" | "en-US" | "ja-JP" | "ko-KR" | "vi-VN") => any;
|
|
146
146
|
"update:uiTheme": (value: EditorUiTheme) => any;
|
|
147
|
+
"product-change": (payload: {
|
|
148
|
+
id: string | number;
|
|
149
|
+
name?: string;
|
|
150
|
+
}) => any;
|
|
147
151
|
}, string, import("vue").PublicProps, Readonly<EditorProps> & Readonly<{
|
|
148
152
|
"onUpdate:locale"?: ((value: "zh-CN" | "en-US" | "ja-JP" | "ko-KR" | "vi-VN") => any) | undefined;
|
|
149
153
|
"onUpdate:uiTheme"?: ((value: EditorUiTheme) => any) | undefined;
|
|
154
|
+
"onProduct-change"?: ((payload: {
|
|
155
|
+
id: string | number;
|
|
156
|
+
name?: string;
|
|
157
|
+
}) => any) | undefined;
|
|
150
158
|
}>, {
|
|
151
159
|
product: ProductItem | null;
|
|
152
160
|
fileToken: string | null;
|
|
@@ -31,6 +31,20 @@ export interface Pillow3dOptions {
|
|
|
31
31
|
/** 剪影圆角半径(px):把直角等尖角磨圆,更像抱枕。默认按尺寸自适应(≈minSide*0.04);0 = 不圆角 */
|
|
32
32
|
cornerRound?: number;
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* 异形抱枕 5cm 缝份描边:沿设计非透明外轮廓向外膨胀 strokePx 描一圈纯色环,环落在设计【下层】,
|
|
36
|
+
* 返回四周扩了 strokePx 的新 canvas(设计居中 + 外圈缝份边)。供 buildPillow3dPreview 前置调用,
|
|
37
|
+
* 使抱枕整体带上这圈缝份边。膨胀用「剪影按圆盘半径多角度偏移重绘叠成膨胀块 → 抠原剪影 → 外环」实现。
|
|
38
|
+
* 与生产渲染 composeProductionImage.drawSilhouetteOutline 同思路,保证编辑器预览与切图一致。
|
|
39
|
+
*/
|
|
40
|
+
export declare function addPillowSeamOutline(source: HTMLImageElement | HTMLCanvasElement, strokePx: number, color: string, cornerRoundPx?: number): HTMLImageElement | HTMLCanvasElement;
|
|
41
|
+
/**
|
|
42
|
+
* 缝份描边【同尺寸就地】版:输出与输入等尺寸的 canvas(不外扩画布),沿设计非透明轮廓向外膨胀 strokePx
|
|
43
|
+
* 描一圈缝份(缝份落在设计【下层】)。用于「烘焙进固定尺寸设计截图(inverseMask)」——因为设计已被约束在
|
|
44
|
+
* 固定 clippath(mask) 内、四周留白 ≥ 缝份宽,外扩的缝份不会超出画布/被裁;改色时重出图即换新色。
|
|
45
|
+
* 与 addPillowSeamOutline 同思路,唯一区别是不加 padding、设计画在 (0,0)。
|
|
46
|
+
*/
|
|
47
|
+
export declare function addPillowSeamOutlineInPlace(source: HTMLImageElement | HTMLCanvasElement, strokePx: number, color: string, cornerRoundPx?: number): HTMLCanvasElement;
|
|
34
48
|
/**
|
|
35
49
|
* 生成伪立体抱枕预览。返回离屏 canvas(含投影 padding)。
|
|
36
50
|
*/
|