@bluepic/embed 0.1.162 → 0.1.164

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.
@@ -96632,7 +96632,9 @@ const BluepicLogo = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_re
96632
96632
  }),
96633
96633
  emits: /* @__PURE__ */ mergeModels(["update:data", "update:globalScope", "handle-export-action"], ["update:serial", "update:ready"]),
96634
96634
  setup(m, { expose: c, emit: ne }) {
96635
- const we = m, $e = ne, Me = ref$1(we.data ?? {}), Ze = useModel(m, "serial"), ie = useModel(m, "ready"), rr = ref$1(), { width: gr, height: or } = useElementBounding(rr);
96635
+ const we = m, $e = ne, Me = ref$1(we.data ?? {});
96636
+ console.log("<BluepicEmbeddedEditor> DATA", Me.value);
96637
+ const Ze = useModel(m, "serial"), ie = useModel(m, "ready"), rr = ref$1(), { width: gr, height: or } = useElementBounding(rr);
96636
96638
  watchEffect(() => {
96637
96639
  $e("update:data", Me.value);
96638
96640
  }), onMounted(() => {
@@ -96707,8 +96709,8 @@ const BluepicLogo = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_re
96707
96709
  ));
96708
96710
  const Oi = useSlots(), qi = (nn) => {
96709
96711
  !nn || (Vr.value = (nn.fields ?? nn?.meta.fields.map(convertDeprecatedField).filter(($n) => $n !== void 0)).map(realizeField).filter(($n) => ei.value && Wr.value !== "mobile" ? ($n.frameIndex ?? 1) === Zr.value : !0), Me.value = {
96710
- ...Me.value,
96711
- ...nn.bindings
96712
+ ...nn.bindings,
96713
+ ...Me.value
96712
96714
  }, console.log("INITIALIZED FIELDS", Vr.value, Me.value));
96713
96715
  };
96714
96716
  we.baseSerial && qi(we.baseSerial);
@@ -97450,7 +97452,7 @@ const BluepicLogo = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_re
97450
97452
  ])
97451
97453
  ], 2));
97452
97454
  }
97453
- }), BluepicEmbeddedEditor_vue_vue_type_style_index_0_scoped_6347f0ba_lang = "", BluepicEmbeddedEditor = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-6347f0ba"]]), _hoisted_1$a = { class: "collection-field-popup" }, _sfc_main$e = /* @__PURE__ */ defineComponent({
97455
+ }), BluepicEmbeddedEditor_vue_vue_type_style_index_0_scoped_b117d8c2_lang = "", BluepicEmbeddedEditor = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-b117d8c2"]]), _hoisted_1$a = { class: "collection-field-popup" }, _sfc_main$e = /* @__PURE__ */ defineComponent({
97454
97456
  __name: "CollectionFieldPopup",
97455
97457
  props: /* @__PURE__ */ mergeModels({
97456
97458
  layout: {},
@@ -100441,7 +100443,7 @@ class BluepicEmbed extends EventTarget {
100441
100443
  this.element = c;
100442
100444
  else
100443
100445
  throw new Error("Invalid element or selector provided");
100444
- this.init(), this.displayMode.value = $e?.displayMode ?? this.displayMode.value, this.allowPanAndZoom.value = $e?.allowPanAndZoom ?? this.allowPanAndZoom.value, this.studioResourcesBaseUrl.value = $e?.studioResourcesBaseUrl ?? this.studioResourcesBaseUrl.value, this.cloudflarePagesHostname.value = $e?.cloudflarePagesHostname ?? this.cloudflarePagesHostname.value, this.bxCoreVersion.value = $e?.bxCoreVersion ?? this.bxCoreVersion.value, this.branding.value = $e?.branding ?? this.branding.value, this.stripeEnv.value = $e?.stripeEnv ?? this.stripeEnv.value, this.data.value = $e?.initData ?? this.data.value, watch(this.ready, (Me, Ze) => {
100446
+ this.init(), this.displayMode.value = $e?.displayMode ?? this.displayMode.value, this.allowPanAndZoom.value = $e?.allowPanAndZoom ?? this.allowPanAndZoom.value, this.studioResourcesBaseUrl.value = $e?.studioResourcesBaseUrl ?? this.studioResourcesBaseUrl.value, this.cloudflarePagesHostname.value = $e?.cloudflarePagesHostname ?? this.cloudflarePagesHostname.value, this.bxCoreVersion.value = $e?.bxCoreVersion ?? this.bxCoreVersion.value, this.branding.value = $e?.branding ?? this.branding.value, this.embedV2Server.value = $e?.embedV2Server ?? this.embedV2Server.value, this.stripeEnv.value = $e?.stripeEnv ?? this.stripeEnv.value, this.data.value = $e?.initData ?? this.data.value, watch(this.ready, (Me, Ze) => {
100445
100447
  if (Me && !Ze) {
100446
100448
  const ie = new CustomEvent("ready", {
100447
100449
  detail: { templateId: this.templateId.value, data: unref(this.data.value) }
@@ -100466,6 +100468,8 @@ class BluepicEmbed extends EventTarget {
100466
100468
  element;
100467
100469
  studioResourcesBaseUrl = ref$1("https://studio-resources.c2.bluepic.io");
100468
100470
  cloudflarePagesHostname = ref$1("bluepic-core-sandbox.pages.dev");
100471
+ embedV2Server = ref$1("https://embed-api-v2.bluepic.workers.dev");
100472
+ stripeEnv = ref$1("prod");
100469
100473
  editorRef = ref$1();
100470
100474
  templateId = ref$1();
100471
100475
  data = ref$1();
@@ -100475,7 +100479,6 @@ class BluepicEmbed extends EventTarget {
100475
100479
  displayMode = ref$1("auto");
100476
100480
  bxCoreVersion = ref$1("auto");
100477
100481
  branding = ref$1(!0);
100478
- stripeEnv = ref$1("prod");
100479
100482
  bxThemeStyleVars;
100480
100483
  embedProject = ref$1();
100481
100484
  baseSerial = ref$1();
@@ -100525,7 +100528,8 @@ class BluepicEmbed extends EventTarget {
100525
100528
  :zoom-and-pan="allowPanAndZoom"
100526
100529
  v-model:ready="ready"
100527
100530
  :branding="branding"
100528
- embedV2Server="https://embed-api-v2.bluepic.workers.dev"
100531
+ :embed-v2-server="embedV2Server"
100532
+ :stripe-env="stripeEnv"
100529
100533
  :embed-project-id="embedProject?.id"
100530
100534
  :base-serial="baseSerial"
100531
100535
  :preview="basePreview"
@@ -100598,7 +100602,9 @@ class BluepicEmbed extends EventTarget {
100598
100602
  borderColor: computed(() => {
100599
100603
  const Me = Color$1(we.bxThemeStyleVars.value["editor-view-background-color"]);
100600
100604
  return Me.isDark() ? Me.lighten(0.8).hex() : Me.darken(0.1).hex();
100601
- })
100605
+ }),
100606
+ embedV2Server: we.embedV2Server,
100607
+ stripeEnv: we.stripeEnv
100602
100608
  };
100603
100609
  }
100604
100610
  }).mount(`#${c}`);
@@ -100647,18 +100653,18 @@ const initEmbeds = async () => {
100647
100653
  const m = document.querySelectorAll(".bluepic-embed");
100648
100654
  console.log("Auto-BluepicEmbed elements", m);
100649
100655
  for (const c of m) {
100650
- const ne = c.getAttribute("data-embed-project-id"), we = c.getAttribute("data-template-id");
100651
- c.getAttribute("data-stripe-env");
100652
- const $e = c.getAttribute("data-init-data"), Me = c.getAttribute("data-studio-resources-base-url") ?? void 0, Ze = c.getAttribute("data-cloudflare-pages-hostname") ?? void 0, ie = c.getAttribute("data-display-mode"), rr = c.getAttribute("data-allow-pan-and-zoom"), gr = c.getAttribute("data-bx-core-version") ?? void 0, or = $e ? JSON.parse($e) : void 0, _r = rr === "true", Lr = ie === "mobile" ? "mobile" : ie === "stack" ? "stack" : "auto", Ir = c.getAttribute("data-branding") === "false", Ar = new BluepicEmbed(c, we, ne, {
100653
- initData: or,
100654
- displayMode: Lr,
100655
- allowPanAndZoom: _r,
100656
- studioResourcesBaseUrl: Me,
100657
- cloudflarePagesHostname: Ze,
100658
- bxCoreVersion: gr,
100659
- branding: Ir
100656
+ const ne = c.getAttribute("data-embed-project-id"), we = c.getAttribute("data-template-id"), $e = c.getAttribute("data-embed-v2-server") ?? void 0, Me = { dev: "dev", prod: "prod" }[c.getAttribute("data-stripe-env") ?? ""], Ze = c.getAttribute("data-init-data"), ie = c.getAttribute("data-studio-resources-base-url") ?? void 0, rr = c.getAttribute("data-cloudflare-pages-hostname") ?? void 0, gr = c.getAttribute("data-display-mode"), or = c.getAttribute("data-allow-pan-and-zoom"), _r = c.getAttribute("data-bx-core-version") ?? void 0, Lr = Ze ? JSON.parse(Ze) : void 0, Ir = or === "true", Ar = gr === "mobile" ? "mobile" : gr === "stack" ? "stack" : "auto", Rr = c.getAttribute("data-branding") === "false", Fr = new BluepicEmbed(c, we, ne, {
100657
+ initData: Lr,
100658
+ displayMode: Ar,
100659
+ allowPanAndZoom: Ir,
100660
+ studioResourcesBaseUrl: ie,
100661
+ cloudflarePagesHostname: rr,
100662
+ bxCoreVersion: _r,
100663
+ branding: Rr,
100664
+ embedV2Server: $e,
100665
+ stripeEnv: Me
100660
100666
  });
100661
- console.log("!", c, Ar);
100667
+ console.log("!", c, Fr);
100662
100668
  }
100663
100669
  };
100664
100670
  window.addEventListener("load", initEmbeds);