ov25-setup 0.1.13 → 0.1.14

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.
@@ -2,6 +2,7 @@ import type { SerializableInjectConfig } from '../preview-config-serializable';
2
2
  interface PreviewAreaProps {
3
3
  serializableConfig: SerializableInjectConfig;
4
4
  previewBaseUrl?: string;
5
+ useLocalPreview?: boolean;
5
6
  }
6
- export declare function PreviewArea({ serializableConfig, previewBaseUrl }: PreviewAreaProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function PreviewArea({ serializableConfig, previewBaseUrl, useLocalPreview }: PreviewAreaProps): import("react/jsx-runtime").JSX.Element;
7
8
  export {};
@@ -3,6 +3,8 @@ export interface ConfiguratorSetupProps {
3
3
  apiKey?: string;
4
4
  productLink?: string;
5
5
  previewBaseUrl?: string;
6
+ /** Only set to true during local OV25 development to use localhost preview */
7
+ useLocalPreview?: boolean;
6
8
  initialConfig?: ConfiguratorSetupPayload;
7
9
  onSave?: (payload: ConfiguratorSetupPayload) => void;
8
10
  hidePreview?: boolean;
package/dist/index.js CHANGED
@@ -5398,7 +5398,7 @@ wd.displayName = yd;
5398
5398
  function sa(n) {
5399
5399
  return n ? "open" : "closed";
5400
5400
  }
5401
- var xd = "DialogTitleWarning", [J2, Sd] = Mb(xd, {
5401
+ var xd = "DialogTitleWarning", [eA, Sd] = Mb(xd, {
5402
5402
  contentName: Sn,
5403
5403
  titleName: oa,
5404
5404
  docsSlug: "dialog"
@@ -24338,40 +24338,40 @@ function U2({ formState: n, currentSettings: e, setLayout: t, updateSettings: r,
24338
24338
  ] }) })
24339
24339
  ] });
24340
24340
  }
24341
- const j2 = "OV25_CONFIG";
24342
- function X2() {
24343
- return typeof window < "u" && window.location.hostname === "localhost" ? `http://localhost:${window.location.port}/configurator-preview` : "https://configurator.ov25.ai";
24341
+ const j2 = "OV25_CONFIG", X2 = "https://configurator.ov25.ai";
24342
+ function G2(n) {
24343
+ return n && typeof window < "u" && window.location.hostname === "localhost" ? `http://localhost:${window.location.port}/configurator-preview` : X2;
24344
24344
  }
24345
24345
  const qu = {
24346
24346
  desktop: { width: "100%", label: "Desktop" },
24347
24347
  mobile: { width: "375px", label: "Mobile" }
24348
24348
  };
24349
- function G2(n, e) {
24349
+ function Y2(n, e) {
24350
24350
  n != null && n.contentWindow && n.contentWindow.postMessage({ type: j2, config: e }, "*");
24351
24351
  }
24352
- function Y2({ serializableConfig: n, previewBaseUrl: e }) {
24353
- const t = _e(null), r = _e(n), [i, o] = xe("desktop"), [s, l] = xe(0);
24354
- r.current = n;
24355
- const a = e || X2(), c = me(() => {
24356
- G2(t.current, r.current);
24352
+ function q2({ serializableConfig: n, previewBaseUrl: e, useLocalPreview: t }) {
24353
+ const r = _e(null), i = _e(n), [o, s] = xe("desktop"), [l, a] = xe(0);
24354
+ i.current = n;
24355
+ const c = e || G2(t), u = me(() => {
24356
+ Y2(r.current, i.current);
24357
24357
  }, []);
24358
24358
  return Je(() => {
24359
- l((u) => u + 1);
24359
+ a((h) => h + 1);
24360
24360
  }, [n]), /* @__PURE__ */ T("div", { className: "flex-1 min-h-0 flex flex-col h-full", children: [
24361
24361
  /* @__PURE__ */ T("div", { className: "flex items-center justify-between px-1 pb-3", children: [
24362
24362
  /* @__PURE__ */ T("span", { className: "text-sm font-medium text-muted-foreground", children: [
24363
24363
  "Preview — ",
24364
- qu[i].label
24364
+ qu[o].label
24365
24365
  ] }),
24366
24366
  /* @__PURE__ */ T("div", { className: "inline-flex items-center rounded-full bg-muted p-1 gap-0.5", children: [
24367
24367
  /* @__PURE__ */ T(
24368
24368
  "button",
24369
24369
  {
24370
24370
  type: "button",
24371
- onClick: () => o("desktop"),
24371
+ onClick: () => s("desktop"),
24372
24372
  className: Z(
24373
24373
  "inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium transition-all",
24374
- i === "desktop" ? "bg-background text-foreground shadow" : "text-muted-foreground hover:text-foreground"
24374
+ o === "desktop" ? "bg-background text-foreground shadow" : "text-muted-foreground hover:text-foreground"
24375
24375
  ),
24376
24376
  children: [
24377
24377
  /* @__PURE__ */ v(ob, { className: "h-3.5 w-3.5" }),
@@ -24383,10 +24383,10 @@ function Y2({ serializableConfig: n, previewBaseUrl: e }) {
24383
24383
  "button",
24384
24384
  {
24385
24385
  type: "button",
24386
- onClick: () => o("mobile"),
24386
+ onClick: () => s("mobile"),
24387
24387
  className: Z(
24388
24388
  "inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium transition-all",
24389
- i === "mobile" ? "bg-background text-foreground shadow" : "text-muted-foreground hover:text-foreground"
24389
+ o === "mobile" ? "bg-background text-foreground shadow" : "text-muted-foreground hover:text-foreground"
24390
24390
  ),
24391
24391
  children: [
24392
24392
  /* @__PURE__ */ v(bb, { className: "h-3.5 w-3.5" }),
@@ -24400,34 +24400,34 @@ function Y2({ serializableConfig: n, previewBaseUrl: e }) {
24400
24400
  "div",
24401
24401
  {
24402
24402
  className: "flex-1 min-h-0 flex items-center justify-center bg-muted/30 rounded-lg overflow-hidden p-4 pb-20",
24403
- onWheel: (u) => u.stopPropagation(),
24403
+ onWheel: (h) => h.stopPropagation(),
24404
24404
  children: /* @__PURE__ */ v(
24405
24405
  "div",
24406
24406
  {
24407
24407
  className: Z(
24408
24408
  "h-full transition-all duration-300 ease-in-out p-[3px] shadow-xl",
24409
- i === "mobile" ? "rounded-[2rem]" : "rounded-xl"
24409
+ o === "mobile" ? "rounded-[2rem]" : "rounded-xl"
24410
24410
  ),
24411
24411
  style: {
24412
- width: qu[i].width,
24412
+ width: qu[o].width,
24413
24413
  maxWidth: "100%",
24414
- maxHeight: i === "mobile" ? "812px" : "900px",
24414
+ maxHeight: o === "mobile" ? "812px" : "900px",
24415
24415
  background: "#333333"
24416
24416
  },
24417
24417
  children: /* @__PURE__ */ v(
24418
24418
  "iframe",
24419
24419
  {
24420
- ref: t,
24421
- src: a,
24420
+ ref: r,
24421
+ src: c,
24422
24422
  title: "Configurator preview",
24423
24423
  className: Z(
24424
24424
  "w-full h-full border-0 bg-white",
24425
- i === "mobile" ? "rounded-[1.6rem]" : "rounded-[0.65rem]"
24425
+ o === "mobile" ? "rounded-[1.6rem]" : "rounded-[0.65rem]"
24426
24426
  ),
24427
24427
  sandbox: "allow-scripts allow-same-origin",
24428
- onLoad: c
24428
+ onLoad: u
24429
24429
  },
24430
- s
24430
+ l
24431
24431
  )
24432
24432
  }
24433
24433
  )
@@ -24435,7 +24435,7 @@ function Y2({ serializableConfig: n, previewBaseUrl: e }) {
24435
24435
  )
24436
24436
  ] });
24437
24437
  }
24438
- function rA(n) {
24438
+ function iA(n) {
24439
24439
  const e = {
24440
24440
  apiKey: n.apiKey,
24441
24441
  productLink: n.productLink,
@@ -24454,8 +24454,8 @@ function rA(n) {
24454
24454
  getExportJson: a
24455
24455
  } = jm(e);
24456
24456
  return /* @__PURE__ */ T("div", { className: "h-screen flex", children: [
24457
- !n.hidePreview && /* @__PURE__ */ v("main", { className: "flex-1 min-h-0 p-4", children: /* @__PURE__ */ v(Y2, { serializableConfig: l, previewBaseUrl: n.previewBaseUrl }) }),
24458
- /* @__PURE__ */ v("aside", { className: n.hidePreview ? "w-full" : "w-[370px] shrink-0 border-l bg-white px-4 pt-4 pb-4 overflow-hidden", children: /* @__PURE__ */ v(
24457
+ !n.hidePreview && /* @__PURE__ */ v("main", { className: "flex-1 min-h-0 p-4", children: /* @__PURE__ */ v(q2, { serializableConfig: l, previewBaseUrl: n.previewBaseUrl, useLocalPreview: n.useLocalPreview }) }),
24458
+ /* @__PURE__ */ v("aside", { className: n.hidePreview ? "w-full h-full flex flex-col" : "w-[370px] shrink-0 border-l bg-white px-4 pt-4 pb-4 h-full flex flex-col overflow-hidden", children: /* @__PURE__ */ v(
24459
24459
  U2,
24460
24460
  {
24461
24461
  formState: t,
@@ -24472,8 +24472,8 @@ function rA(n) {
24472
24472
  }
24473
24473
  export {
24474
24474
  U2 as ConfigPanel,
24475
- rA as ConfiguratorSetup,
24476
- Y2 as PreviewArea,
24475
+ iA as ConfiguratorSetup,
24476
+ q2 as PreviewArea,
24477
24477
  Xa as STYLE_GROUPS,
24478
24478
  Qs as buildSerializableConfig,
24479
24479
  eh as generateElementCSS,