@printine/pod-editor 0.1.20 → 0.1.23
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/README.md +8 -0
- package/dist/components/context.d.ts +7 -0
- package/dist/components/menus/sca.d.ts +2 -4
- package/dist/components/personalization-background.d.ts +6 -0
- package/dist/components/personalization-controller.d.ts +2 -0
- package/dist/components/personalization-preview.d.ts +5 -0
- package/dist/components/personalization-shared.d.ts +3 -0
- package/dist/components/placement-texture-cache.d.ts +20 -0
- package/dist/components/preview/real-time/index.d.ts +2 -1
- package/dist/components/semi-deisgn-config.d.ts +8 -2
- package/dist/components/semi-renderer.d.ts +4 -0
- package/dist/{design-Ce0Lyr8f.js → design-D5jmLHez.js} +8687 -8449
- package/dist/designer-store-BZFMaojO.js +261 -0
- package/dist/engine/constants.js +1 -1
- package/dist/engine/events.d.ts +6 -0
- package/dist/engine/managers/event.js +1 -1
- package/dist/full-designer.js +2 -2
- package/dist/i18n/personalization.d.ts +3 -0
- package/dist/index.js +5 -5
- package/dist/lib/personalization.d.ts +78 -0
- package/dist/personalization-preview-BonjWg50.js +352 -0
- package/dist/semi-interact-editor-BUWPFgWU.js +1469 -0
- package/dist/semi-renderer.js +1 -1
- package/dist/state/designer-store.d.ts +2 -0
- package/dist/state/designer-store.js +1 -1
- package/dist/style.css +1 -1
- package/docs/BUYER_PERSONALIZATION.md +137 -0
- package/docs/SEMI_RENDERER.md +16 -0
- package/package.json +5 -3
- package/dist/designer-store-Da9fICz8.js +0 -153
- package/dist/semi-interact-editor-DpzQN5ZB.js +0 -1422
package/README.md
CHANGED
|
@@ -170,6 +170,14 @@ record, then initialize the editor with the loaded data. These are initial
|
|
|
170
170
|
values, not controlled canvas state; change the component `key` when switching
|
|
171
171
|
records or base plates.
|
|
172
172
|
|
|
173
|
+
### Buyer personalization
|
|
174
|
+
|
|
175
|
+
With `semiDesignPermission={true}`, merchants can manage buyer-editable layers
|
|
176
|
+
by print placement, configure rules from a selected canvas element, and open an
|
|
177
|
+
isolated desktop/phone buyer preview. Existing saved customization formats are
|
|
178
|
+
preserved. See [Buyer personalization](docs/BUYER_PERSONALIZATION.md) for the
|
|
179
|
+
supported rules, preview behavior and local validation page.
|
|
180
|
+
|
|
173
181
|
### Preview rendering
|
|
174
182
|
|
|
175
183
|
Base-plate `renders` and `td_renders` configure live 2D and 3D previews. The
|
|
@@ -3,6 +3,7 @@ import EventManager from '../engine/managers/event';
|
|
|
3
3
|
import { Product, BasePlate } from '../contracts/api-design';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import type { PersistImage } from './upload-types';
|
|
6
|
+
import type { ElementType } from '../contracts/design';
|
|
6
7
|
type DesignContextType = {
|
|
7
8
|
canvasEditor: React.RefObject<Editor | null>;
|
|
8
9
|
eventManager: React.RefObject<EventManager | null>;
|
|
@@ -14,6 +15,12 @@ type DesignContextType = {
|
|
|
14
15
|
onPersistImage: PersistImage;
|
|
15
16
|
onChangeView: (placement: string) => Promise<void>;
|
|
16
17
|
setCanvasLoading: React.Dispatch<React.SetStateAction<boolean>>;
|
|
18
|
+
semiDesignPermission: boolean;
|
|
19
|
+
activeMenu: ElementType;
|
|
20
|
+
personalizationTarget: 'element' | 'background';
|
|
21
|
+
setPersonalizationTarget: React.Dispatch<React.SetStateAction<'element' | 'background'>>;
|
|
22
|
+
getDesignData: () => Record<string, Record<string, any>>;
|
|
23
|
+
canvasLoading: boolean;
|
|
17
24
|
};
|
|
18
25
|
export declare const DesignContext: React.Context<DesignContextType | null>;
|
|
19
26
|
export declare const useDesignContext: () => DesignContextType;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Same settings surface as element rules: live inspector or narrow-screen draft. */
|
|
2
|
+
export default function PersonalizationBackground({ mode, open, onOpenChange }: {
|
|
3
|
+
mode: 'panel' | 'dialog';
|
|
4
|
+
open: boolean;
|
|
5
|
+
onOpenChange: (open: boolean) => void;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function usePersonalizationLayers(): import("../lib/personalization").PersonalizationLayer[];
|
|
2
|
+
/** Appears beside the normal editing tools as soon as one supported layer is selected. */
|
|
3
|
+
export declare function PersonalizationSelection(): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type PlacementTexture = string | ImageBitmap;
|
|
2
|
+
export declare function releasePlacementTexture(texture: PlacementTexture): void;
|
|
3
|
+
/** One renderer owns these textures; the compositor only borrows them. */
|
|
4
|
+
export declare class PlacementTextureCache {
|
|
5
|
+
private readonly maxEntries;
|
|
6
|
+
private readonly maxBytes;
|
|
7
|
+
private entries;
|
|
8
|
+
private pinned;
|
|
9
|
+
private bytes;
|
|
10
|
+
constructor(maxEntries?: number, maxBytes?: number);
|
|
11
|
+
get size(): number;
|
|
12
|
+
get estimatedBytes(): number;
|
|
13
|
+
/** Keep every texture used by the current composition alive until it settles. */
|
|
14
|
+
pin(key: string): void;
|
|
15
|
+
get(key: string): PlacementTexture | undefined;
|
|
16
|
+
set(key: string, texture: PlacementTexture): void;
|
|
17
|
+
releaseFrame(): void;
|
|
18
|
+
clear(): void;
|
|
19
|
+
private trim;
|
|
20
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Product, Render, TDRender } from '../../../contracts/api-design';
|
|
3
3
|
interface RealTimePreviewProps {
|
|
4
|
+
concealed?: boolean;
|
|
4
5
|
renderList: Render[];
|
|
5
6
|
tdRenderList: TDRender[];
|
|
6
7
|
designPreviewMap: Record<string, string | ImageBitmap | null>;
|
|
@@ -8,5 +9,5 @@ interface RealTimePreviewProps {
|
|
|
8
9
|
product: Product;
|
|
9
10
|
onPreview: (designLayers: string[], index?: number, models?: Render[]) => void;
|
|
10
11
|
}
|
|
11
|
-
export default function RealTimePreview({ renderList, tdRenderList, designPreviewMap, color, product, onPreview, }: RealTimePreviewProps): React.JSX.Element;
|
|
12
|
+
export default function RealTimePreview({ concealed, renderList, tdRenderList, designPreviewMap, color, product, onPreview, }: RealTimePreviewProps): React.JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
import { type PersonalizationKind } from '../lib/personalization';
|
|
1
2
|
export interface ElementConfig {
|
|
2
|
-
type:
|
|
3
|
+
type: PersonalizationKind;
|
|
3
4
|
id: string;
|
|
4
5
|
config: Record<string, any> | undefined;
|
|
6
|
+
defaultConfig?: Record<string, any>;
|
|
7
|
+
placementLabel?: string;
|
|
8
|
+
name?: string;
|
|
5
9
|
}
|
|
6
10
|
interface CustomDesignElementProps {
|
|
7
11
|
open: boolean;
|
|
8
12
|
onOpenChange: (open: boolean) => void;
|
|
9
13
|
elementConfig: ElementConfig | undefined;
|
|
10
14
|
onUpdate: (id: string, config: Record<string, any>) => void;
|
|
15
|
+
onDisable?: (id: string) => void;
|
|
16
|
+
mode?: 'dialog' | 'panel';
|
|
11
17
|
}
|
|
12
|
-
export default function CustomDesignElement({ open, onOpenChange, elementConfig, onUpdate }: CustomDesignElementProps): import("react").JSX.Element;
|
|
18
|
+
export default function CustomDesignElement({ open, onOpenChange, elementConfig, onUpdate, onDisable, mode }: CustomDesignElementProps): import("react").JSX.Element;
|
|
13
19
|
export {};
|
|
@@ -55,6 +55,10 @@ export interface PrintineSemiRendererProps {
|
|
|
55
55
|
backgroundColor?: string;
|
|
56
56
|
/** Resolution factor passed to the local Sticker renderer. */
|
|
57
57
|
scale?: number;
|
|
58
|
+
/** Retain unchanged placement textures between compositions. Default: true. */
|
|
59
|
+
reusePlacementTextures?: boolean;
|
|
60
|
+
/** Change this host-owned account/draft/model revision key to invalidate placement textures. */
|
|
61
|
+
textureCacheScope?: string;
|
|
58
62
|
/**
|
|
59
63
|
* `pixel-map` is the default OffscreenCanvas/WebGL2 Worker renderer.
|
|
60
64
|
* `pixi` remains available as an explicit fallback.
|