@bluepic/embed 0.6.0 → 0.6.2

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/main.mjs CHANGED
@@ -16201,7 +16201,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16201
16201
  return `https://${u}/${r ? `${encodeURIComponent(r)}/${m}` : m}${l && Object.keys(l).length > 0 ? `?${new URLSearchParams(l).toString()}` : ""}`;
16202
16202
  }
16203
16203
  })), Xr = /* @__PURE__ */ i(((e) => {
16204
- Object.defineProperty(e, "__esModule", { value: !0 }), e.PREPOPULATE_RECIPIENT_COLUMN = e.PREPOPULATE_RESERVED_BINDINGS = e.prepopulateColumnSchema = e.PREPOPULATE_TYPE_PREFIX = e.prepopulateColumnTypeSchema = e.publicCampaignPrepopulatedSchema = e.prepopulateValidationErrorSchema = e.putCampaignPrepopulateResponseSchema = e.putCampaignPrepopulateRequestPayloadSchema = e.getCampaignPrepopulateResponseSchema = e.prepopulateRowInputSchema = e.prepopulateRowSchema = e.prepopulateDataSchema = e.PREPOPULATE_TOKEN_QUERY_KEY = e.PREPOPULATE_QUERY_KEY = e.PREPOPULATE_LIMITS = void 0, e.prepopulateColumnTypeFromBinding = r, e.prepopulateColumnsFromBindings = i, e.validatePrepopulateRows = a;
16204
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.PREPOPULATE_DATA_QUERY_KEY = e.PREPOPULATE_RECIPIENT_COLUMN = e.PREPOPULATE_RESERVED_BINDINGS = e.prepopulateColumnSchema = e.PREPOPULATE_TYPE_PREFIX = e.prepopulateColumnTypeSchema = e.publicCampaignPrepopulatedSchema = e.prepopulateValidationErrorSchema = e.putCampaignPrepopulateResponseSchema = e.putCampaignPrepopulateRequestPayloadSchema = e.getCampaignPrepopulateResponseSchema = e.prepopulateRowInputSchema = e.prepopulateRowSchema = e.prepopulateDataSchema = e.PREPOPULATE_TOKEN_QUERY_KEY = e.PREPOPULATE_QUERY_KEY = e.PREPOPULATE_LIMITS = void 0, e.prepopulateColumnTypeFromBinding = r, e.prepopulateColumnsFromBindings = i, e.validatePrepopulateRows = a, e.prepopulationQueryData = o;
16205
16205
  var t = Br(), n = Yr();
16206
16206
  e.PREPOPULATE_LIMITS = {
16207
16207
  rows: 5e3,
@@ -16281,6 +16281,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16281
16281
  }
16282
16282
  return null;
16283
16283
  }
16284
+ e.PREPOPULATE_DATA_QUERY_KEY = "data";
16285
+ function o(e) {
16286
+ let t = {};
16287
+ for (let [r, i] of Object.entries(e)) {
16288
+ let e = (0, n.isImageBindingValue)(i), a = e ? i.src : i;
16289
+ a != null && typeof a != "object" && (t[e ? `${r}.src` : r] = String(a));
16290
+ }
16291
+ return t;
16292
+ }
16284
16293
  })), Zr = /* @__PURE__ */ i(((e) => {
16285
16294
  Object.defineProperty(e, "__esModule", { value: !0 }), e.exportActionSchema = void 0;
16286
16295
  var t = Br();
@@ -16843,8 +16852,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16843
16852
  y: t.z.number().int().min(1)
16844
16853
  }),
16845
16854
  label: t.z.string().nullable().optional(),
16846
- preview: t.z.string().nullable(),
16847
- personalizedPreview: t.z.string().nullable().optional(),
16855
+ preview: t.z.object({
16856
+ default: t.z.string().nullable(),
16857
+ prepopulated: t.z.string().nullable().optional()
16858
+ }),
16848
16859
  hash: t.z.string(),
16849
16860
  serial: t.z.any().nullable()
16850
16861
  }), e.publicCampaignTemplateDescriptor = t.z.object({
@@ -72582,7 +72593,12 @@ var tJ = "https://bx-studio-api-production.bluepic.workers.dev", nJ = "https://r
72582
72593
  }
72583
72594
  this.templateId.value = c;
72584
72595
  let l = o?.[c], u = l?.canvases?.[0];
72585
- if (l && (this.templateName.value = l.name ?? "", this.preview.value = u?.preview ?? void 0, u?.serial && (this.serial.value = u.serial)), !this.serial.value) try {
72596
+ if (l) {
72597
+ this.templateName.value = l.name ?? "";
72598
+ let e = u?.preview;
72599
+ this.preview.value = (typeof e == "string" ? e : e?.placeholder ?? e?.src ?? e?.default) ?? void 0, u?.serial && (this.serial.value = u.serial);
72600
+ }
72601
+ if (!this.serial.value) try {
72586
72602
  let e = u ? `${this.apiBaseUrl.value}/api/public/campaign/serial/${c}/${na.Template.canvasSizeToken(u.width, u.height)}?${new URLSearchParams({
72587
72603
  env: this.stripeEnv.value,
72588
72604
  ...u.hash ? { h: u.hash } : {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluepic/embed",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Bluepic embed sdk",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "devDependencies": {
52
52
  "@auth0/auth0-vue": "^2.4.0",
53
- "@bluepic/types": "^0.9.3",
53
+ "@bluepic/types": "^0.9.4",
54
54
  "@hono/zod-openapi": "^1.1.4",
55
55
  "@types/css": "^0.0.38",
56
56
  "@types/downloadjs": "^1.4.6",