@bluepic/embed 0.1.50 → 0.1.52
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/lib/bluepic-embed.es.js +21 -21
- package/lib/bluepic-embed.umd.js +4 -4
- package/lib/components/BluepicEmbeddedEditor.vue.d.ts +0 -11
- package/lib/components/BluepicEmbeddedEditor.vue.d.ts.map +1 -1
- package/lib/components/CollectionEntryFields.vue.d.ts +0 -1
- package/lib/components/CollectionEntryFields.vue.d.ts.map +1 -1
- package/lib/components/CollectionFieldPopup.vue.d.ts +0 -1
- package/lib/components/CollectionFieldPopup.vue.d.ts.map +1 -1
- package/lib/components/Fields.vue.d.ts +0 -1
- package/lib/components/Fields.vue.d.ts.map +1 -1
- package/lib/components/ImportData.vue.d.ts +0 -8
- package/lib/components/ImportData.vue.d.ts.map +1 -1
- package/lib/components/KioskField.vue.d.ts +0 -1
- package/lib/components/KioskField.vue.d.ts.map +1 -1
- package/lib/components/MobileFieldsSlide.vue.d.ts +0 -1
- package/lib/components/MobileFieldsSlide.vue.d.ts.map +1 -1
- package/lib/components/TableDataMatcher.vue.d.ts +0 -8
- package/lib/components/TableDataMatcher.vue.d.ts.map +1 -1
- package/lib/components/fields/Collection.vue.d.ts +0 -1
- package/lib/components/fields/Collection.vue.d.ts.map +1 -1
- package/lib/components/fields/Group.vue.d.ts +0 -1
- package/lib/components/fields/Group.vue.d.ts.map +1 -1
- package/lib/style.css +1 -1
- package/lib/util/RenderService.d.ts.map +1 -1
- package/lib/util/cloudflareImages.d.ts +1 -2
- package/lib/util/cloudflareImages.d.ts.map +1 -1
- package/package.json +2 -2
package/lib/bluepic-embed.es.js
CHANGED
|
@@ -71690,7 +71690,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
71690
71690
|
], 6))), 256))
|
|
71691
71691
|
], 2));
|
|
71692
71692
|
}
|
|
71693
|
-
}),
|
|
71693
|
+
}), FieldsList_vue_vue_type_style_index_0_scoped_d180b0a4_lang = "", FieldsList = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-d180b0a4"]]), _hoisted_1$i = { class: "bx-fields" }, _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
71694
71694
|
__name: "Fields",
|
|
71695
71695
|
props: {
|
|
71696
71696
|
fields: {}
|
|
@@ -94757,7 +94757,6 @@ async function rasterize(m) {
|
|
|
94757
94757
|
async function applyColorMatrix(m, c) {
|
|
94758
94758
|
return m;
|
|
94759
94759
|
}
|
|
94760
|
-
pLimit(1);
|
|
94761
94760
|
async function renderRemote(m, c, ne, we, $e, Me, Ze, ie, ii, di, li) {
|
|
94762
94761
|
const mi = `${m}/api/export/${c}?${new URLSearchParams({
|
|
94763
94762
|
env: "prod"
|
|
@@ -98489,7 +98488,7 @@ list should be an Array.`), er.length === 0)
|
|
|
98489
98488
|
}, { buffer: 3, lYpoI2: 11 }] }, {}, [1])(1);
|
|
98490
98489
|
});
|
|
98491
98490
|
})(object_hash);
|
|
98492
|
-
const hash = object_hash.exports,
|
|
98491
|
+
const hash = object_hash.exports, IMAGE_TTL_IN_SECONDS = 60 * 60 * 24 * 1;
|
|
98493
98492
|
function parseCloudflareImagesDeliveryUrl(m) {
|
|
98494
98493
|
try {
|
|
98495
98494
|
const c = new URL(m);
|
|
@@ -98508,20 +98507,20 @@ function parseCloudflareImagesDeliveryUrl(m) {
|
|
|
98508
98507
|
throw new Error("Invalid URL");
|
|
98509
98508
|
}
|
|
98510
98509
|
}
|
|
98511
|
-
async function uploadImage(m, c, ne, we, $e) {
|
|
98512
|
-
const
|
|
98513
|
-
key: hash({ field:
|
|
98510
|
+
async function uploadImage(m, c, ne, we, $e, Me) {
|
|
98511
|
+
const Ze = `${m}/api/image/session?${new URLSearchParams({
|
|
98512
|
+
key: hash({ field: ne.field, templateId: c }),
|
|
98514
98513
|
ttl: String(IMAGE_TTL_IN_SECONDS)
|
|
98515
|
-
})}`,
|
|
98516
|
-
|
|
98517
|
-
const
|
|
98518
|
-
url:
|
|
98514
|
+
})}`, ie = new FormData();
|
|
98515
|
+
ie.append("file", we, $e);
|
|
98516
|
+
const ii = await fetchWithProgressV1({
|
|
98517
|
+
url: Ze,
|
|
98519
98518
|
method: "POST",
|
|
98520
|
-
data:
|
|
98521
|
-
onUploadProgress:
|
|
98519
|
+
data: ie,
|
|
98520
|
+
onUploadProgress: Me
|
|
98522
98521
|
});
|
|
98523
|
-
if (
|
|
98524
|
-
return JSON.parse(await
|
|
98522
|
+
if (ii.type === "application/json")
|
|
98523
|
+
return JSON.parse(await ii.text());
|
|
98525
98524
|
throw new Error("Invalid response from Cloudflare Images");
|
|
98526
98525
|
}
|
|
98527
98526
|
const colorNames = {
|
|
@@ -99688,17 +99687,17 @@ class BluepicEmbed extends EventTarget {
|
|
|
99688
99687
|
stripeEnv = ref$1("prod");
|
|
99689
99688
|
init() {
|
|
99690
99689
|
const c = `bluepic-app-${nanoid()}`;
|
|
99691
|
-
this.embedProjectId && getProjectWithRetries("live.bluepic.io", this.embedProjectId, 3, 2e3, this.stripeEnv.value).then(({ embedProject: $e }) => {
|
|
99692
|
-
const
|
|
99693
|
-
this.darkmode.value =
|
|
99690
|
+
this.embedProjectId && getProjectWithRetries("live.bluepic.io", this.embedProjectId, 3, 2e3, this.stripeEnv.value).then(({ embedProject: $e, isAllowedToDisableBranding: Me }) => {
|
|
99691
|
+
const Ze = Color($e.config.backgroundColor).isDark();
|
|
99692
|
+
this.darkmode.value = Ze, this.displayMode.value = $e.config.layout, this.allowPanAndZoom.value = $e.config.allowPanAndZoom, this.theme.value = (() => {
|
|
99694
99693
|
if ($e.config.backgroundColor) {
|
|
99695
|
-
const
|
|
99694
|
+
const ie = $e.config.backgroundColor, ii = Ze ? Color(ie).darken(0.1).hex() : Color(ie).lighten(0.1).hex();
|
|
99696
99695
|
return {
|
|
99697
|
-
fieldsViewBackgroundColor:
|
|
99698
|
-
editorViewBackgroundColor:
|
|
99696
|
+
fieldsViewBackgroundColor: ie,
|
|
99697
|
+
editorViewBackgroundColor: ii
|
|
99699
99698
|
};
|
|
99700
99699
|
}
|
|
99701
|
-
})(), this.branding.value =
|
|
99700
|
+
})(), this.branding.value = Me ? $e.config.bluepicBranding : !0, this.templateId.value = $e.templates[0];
|
|
99702
99701
|
});
|
|
99703
99702
|
const ne = document.createElement("style");
|
|
99704
99703
|
ne.textContent = `
|
|
@@ -99754,6 +99753,7 @@ class BluepicEmbed extends EventTarget {
|
|
|
99754
99753
|
bridge: {
|
|
99755
99754
|
async handleUpload({ blob: Me, context: Ze, width: ie, height: ii, name: di, onProgress: li }) {
|
|
99756
99755
|
const { variants: mi, filename: Ci, id: Ai } = await uploadImage(
|
|
99756
|
+
"https://embed-api-v2.bluepic.workers.dev",
|
|
99757
99757
|
we.templateId.value,
|
|
99758
99758
|
Ze,
|
|
99759
99759
|
Me,
|