@printine/pod-editor 0.1.21 → 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.
@@ -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
+ }
@@ -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.
@@ -21026,7 +21026,7 @@ function Hl({ mode: e, open: t, onOpenChange: n }) {
21026
21026
  }
21027
21027
  );
21028
21028
  }
21029
- const _6 = f1(() => import("./personalization-preview-D9z7Ketn.js"));
21029
+ const _6 = f1(() => import("./personalization-preview-BonjWg50.js"));
21030
21030
  function D6() {
21031
21031
  const e = Se("design"), { semiDesignPermission: t, activeMenu: n, getDesignData: r, plateData: o, currentViewName: a, canvasEditor: i, onChangeView: s, canvasLoading: l, personalizationTarget: d, setPersonalizationTarget: u } = $e(), f = Un(1100), p = t && n === "sca" && !f, g = nf(), m = Ce((I) => I.activeObjects), v = Ce((I) => I.semiCustom), b = Ce((I) => I.semiCustomDrafts), x = Ce((I) => I.semiCustomBackground), k = d === "background", y = m.length === 1 ? g.find((I) => I.placement === a && I.id === String(m[0].id)) : void 0, w = ve(() => y?.kind ? {
21032
21032
  id: y.id,
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { c as s } from "./design-zuaYzDgn.js";
3
+ import { c as s } from "./design-D5jmLHez.js";
4
4
  import "./engine/events.js";
5
5
  import "zustand/react/shallow";
6
6
  import "./engine/history.js";
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { AdvancedIText as G } from "./engine/fabric.js";
2
- import { a as S, s as f, D as L, b as _, c as C, C as F } from "./design-zuaYzDgn.js";
3
- import { F as K, S as V, u as X } from "./design-zuaYzDgn.js";
2
+ import { a as S, s as f, D as L, b as _, c as C, C as F } from "./design-D5jmLHez.js";
3
+ import { F as K, S as V, u as X } from "./design-D5jmLHez.js";
4
4
  import { jsx as r, jsxs as R } from "react/jsx-runtime";
5
5
  import { useMemo as b, useEffect as a } from "react";
6
6
  import { DEFAULT_PRINTINE_ASSET_BASE_URL as U, createAssetCenterApiClient as B } from "./api/asset-client.js";
7
7
  import { s as d } from "./designer-store-BZFMaojO.js";
8
8
  import { A as $, u as q } from "./designer-store-BZFMaojO.js";
9
9
  import { d as y, s as M } from "./config-D2qm60gf.js";
10
- import { P as Q, a as ee } from "./semi-interact-editor-DpzQN5ZB.js";
10
+ import { P as Q, a as ee } from "./semi-interact-editor-BUWPFgWU.js";
11
11
  import { P as te } from "./pixel-map-CSpWvUYE.js";
12
12
  import { CanvasDesigner as ae, renderPlacementPreviews as ne } from "./engine/canvas-designer.js";
13
13
  import { Editor as ie } from "./engine/editor.js";
@@ -1,8 +1,8 @@
1
1
  import { jsx as r, jsxs as c, Fragment as ke } from "react/jsx-runtime";
2
2
  import { useMemo as me, useState as f, useRef as C, useEffect as pe } from "react";
3
- import { d as V, e as Ce, u as Pe, f as Ee, g as Se, h as je, i as a, j as Le, k as Re, A as $e, L as Ie, l as Me } from "./design-zuaYzDgn.js";
3
+ import { d as V, e as Ce, u as Pe, f as Ee, g as Se, h as je, i as a, j as Le, k as Re, A as $e, L as Ie, l as Me } from "./design-D5jmLHez.js";
4
4
  import { a as he, p as Te, b as Fe, c as K, d as ze } from "./designer-store-BZFMaojO.js";
5
- import { a as Be, P as _e } from "./semi-interact-editor-DpzQN5ZB.js";
5
+ import { a as Be, P as _e } from "./semi-interact-editor-BUWPFgWU.js";
6
6
  /**
7
7
  * @license lucide-react v0.545.0 - ISC
8
8
  *