@printine/pod-editor 0.1.19 → 0.1.21

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.
Files changed (34) hide show
  1. package/README.md +8 -0
  2. package/dist/components/context.d.ts +7 -0
  3. package/dist/components/menus/sca.d.ts +2 -4
  4. package/dist/components/personalization-background.d.ts +6 -0
  5. package/dist/components/personalization-controller.d.ts +2 -0
  6. package/dist/components/personalization-preview.d.ts +5 -0
  7. package/dist/components/personalization-shared.d.ts +3 -0
  8. package/dist/components/preview/real-time/index.d.ts +2 -1
  9. package/dist/components/semi-deisgn-config.d.ts +8 -2
  10. package/dist/{design-BXbmX1Tb.js → design-zuaYzDgn.js} +8687 -8449
  11. package/dist/designer-store-BZFMaojO.js +261 -0
  12. package/dist/engine/constants.js +1 -1
  13. package/dist/engine/editor.js +120 -116
  14. package/dist/engine/events.d.ts +6 -0
  15. package/dist/engine/managers/event.js +1 -1
  16. package/dist/full-designer.js +3 -3
  17. package/dist/i18n/personalization.d.ts +3 -0
  18. package/dist/index.js +6 -6
  19. package/dist/lib/personalization.d.ts +78 -0
  20. package/dist/personalization-preview-D9z7Ketn.js +352 -0
  21. package/dist/pixel-map-CSpWvUYE.js +315 -0
  22. package/dist/{pixi-print-base-CKs4lF7h.js → pixi-print-base-DIvtSF7v.js} +1 -1
  23. package/dist/renderer/pixel-map.d.ts +9 -2
  24. package/dist/{semi-interact-editor-nZVBXXQn.js → semi-interact-editor-DpzQN5ZB.js} +2 -2
  25. package/dist/semi-renderer.js +1 -1
  26. package/dist/state/designer-store.d.ts +2 -0
  27. package/dist/state/designer-store.js +1 -1
  28. package/dist/style.css +1 -1
  29. package/docs/BUYER_PERSONALIZATION.md +137 -0
  30. package/docs/HOST_DATA_CONTRACT.md +1 -1
  31. package/docs/SEMI_RENDERER.md +37 -1
  32. package/package.json +3 -1
  33. package/dist/designer-store-Da9fICz8.js +0 -153
  34. package/dist/pixel-map-BvQ0VU_i.js +0 -199
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;
@@ -1,5 +1,3 @@
1
- interface SCAListProps {
1
+ export default function SCAList({ show }: {
2
2
  show: boolean;
3
- }
4
- export default function SCAList({ show }: SCAListProps): import("react").JSX.Element;
5
- export {};
3
+ }): import("react").JSX.Element;
@@ -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,2 @@
1
+ /** Dock settings beside the canvas in Personalization; keep dialogs elsewhere. */
2
+ export default function PersonalizationController(): import("react").JSX.Element | null;
@@ -0,0 +1,5 @@
1
+ import { type DesignDocuments } from '../lib/personalization';
2
+ export default function BuyerPersonalizationPreview({ initialData, onClose }: {
3
+ initialData: DesignDocuments;
4
+ onClose: () => void;
5
+ }): 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;
@@ -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: 'image' | 'text' | 'svg';
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 {};