@bluepic/embed 0.6.22 → 0.6.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.
- package/dist/bluepic-embed.iife.js +1 -1
- package/dist/bluepic-embed.umd.js +1 -1
- package/dist/main.cjs +1 -1
- package/dist/main.mjs +115 -106
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/main.mjs
CHANGED
|
@@ -61025,112 +61025,121 @@ var JR = ["role", "aria-label"], YR = { class: "controls-layer" }, XR = {
|
|
|
61025
61025
|
],
|
|
61026
61026
|
setup(e, { expose: t, emit: n }) {
|
|
61027
61027
|
let r = e, i = n, o = l(() => r.fieldHitboxes ?? []), s = l(() => {
|
|
61028
|
-
if (
|
|
61028
|
+
if (y.value && O.value) return O.value.y * _.value.x + O.value.x + 1;
|
|
61029
61029
|
}), c = B({
|
|
61030
61030
|
translateX: 0,
|
|
61031
61031
|
translateY: 0,
|
|
61032
61032
|
scale: 1,
|
|
61033
61033
|
rotate: 0
|
|
61034
|
-
})
|
|
61034
|
+
});
|
|
61035
|
+
function u(e) {
|
|
61036
|
+
[
|
|
61037
|
+
e.translateX,
|
|
61038
|
+
e.translateY,
|
|
61039
|
+
e.scale,
|
|
61040
|
+
e.rotate
|
|
61041
|
+
].every(Number.isFinite) && (c.value = e);
|
|
61042
|
+
}
|
|
61043
|
+
let h = T("data"), g = B(), _ = l(() => r.serial?.frames ?? {
|
|
61035
61044
|
x: 1,
|
|
61036
61045
|
y: 1
|
|
61037
|
-
}),
|
|
61046
|
+
}), y = l(() => Object.values(_.value).reduce((e, t) => t * e, 1) > 1), b = B(), x = B(), { width: S, height: C } = io(x), { focusFrame: w, frameFocusScaleDiff: D, currentlyFocusedFrame: O, getFrameTransform: k, tiles: j } = qR(c, l(() => r.serial?.frames ?? {
|
|
61038
61047
|
x: 1,
|
|
61039
61048
|
y: 1
|
|
61040
|
-
}), l(() =>
|
|
61049
|
+
}), l(() => b.value?.canvasWidth ?? 0), l(() => b.value?.canvasHeight ?? 0), S, C), M = l(() => {
|
|
61041
61050
|
if (r.serial) return r.serial.width / r.serial.height;
|
|
61042
|
-
}), M = l(() => {
|
|
61043
|
-
if (y.value?.zoompinchEngine) return y.value.zoompinchEngine.wrapperBounds.width / y.value.zoompinchEngine.wrapperBounds.height;
|
|
61044
61051
|
}), N = l(() => {
|
|
61045
|
-
if (
|
|
61052
|
+
if (b.value?.zoompinchEngine) return b.value.zoompinchEngine.wrapperBounds.width / b.value.zoompinchEngine.wrapperBounds.height;
|
|
61053
|
+
}), P = l(() => {
|
|
61054
|
+
if (M.value && N.value) return M.value > N.value ? "width" : "height";
|
|
61046
61055
|
});
|
|
61047
61056
|
l(() => {
|
|
61048
|
-
if (
|
|
61057
|
+
if (b.value?.zoompinchEngine && M.value) return P.value === "height" ? 1 : b.value.zoompinchEngine.wrapperBounds.height / b.value.zoompinchEngine.wrapperBounds.width;
|
|
61049
61058
|
}), l(() => {
|
|
61050
|
-
if (
|
|
61059
|
+
if (b.value?.zoompinchEngine && M.value) return P.value === "width" ? 1 : b.value.zoompinchEngine.wrapperBounds.width / b.value.zoompinchEngine.wrapperBounds.height;
|
|
61051
61060
|
});
|
|
61052
|
-
let
|
|
61053
|
-
if (!
|
|
61054
|
-
let [e, t] =
|
|
61061
|
+
let F = l(() => {
|
|
61062
|
+
if (!b.value?.zoompinchEngine) return;
|
|
61063
|
+
let [e, t] = b.value.zoompinchEngine.calcProjectionTranslate(1, [.5, .5], [.5, .5]);
|
|
61055
61064
|
return c.value.scale !== 1 || c.value.translateX !== e || c.value.translateY !== t || c.value.rotate !== 0;
|
|
61056
|
-
}),
|
|
61057
|
-
|
|
61058
|
-
},
|
|
61059
|
-
function
|
|
61060
|
-
|
|
61065
|
+
}), I = () => {
|
|
61066
|
+
b.value?.applyTransform(1, [.5, .5], [.5, .5]);
|
|
61067
|
+
}, te;
|
|
61068
|
+
function R() {
|
|
61069
|
+
I(), requestAnimationFrame(I), clearTimeout(te), te = setTimeout(I, 160);
|
|
61061
61070
|
}
|
|
61062
|
-
ee(() => clearTimeout(
|
|
61063
|
-
!e &&
|
|
61071
|
+
ee(() => clearTimeout(te)), W(() => r.zoomAndPan, (e) => {
|
|
61072
|
+
!e && F.value && I();
|
|
61064
61073
|
});
|
|
61065
|
-
function R(e, t) {
|
|
61066
|
-
let n = D.value?.y ?? 0;
|
|
61067
|
-
C(e, n), t.stopPropagation();
|
|
61068
|
-
}
|
|
61069
61074
|
function ne(e, t) {
|
|
61070
|
-
let n =
|
|
61071
|
-
|
|
61075
|
+
let n = O.value?.y ?? 0;
|
|
61076
|
+
w(e, n), t.stopPropagation();
|
|
61077
|
+
}
|
|
61078
|
+
function V(e, t) {
|
|
61079
|
+
let n = O.value?.x ?? 0;
|
|
61080
|
+
w(n, e), t.stopPropagation();
|
|
61072
61081
|
}
|
|
61073
|
-
function
|
|
61082
|
+
function ie({ clientX: e, clientY: t }) {
|
|
61074
61083
|
if (r.editingElementId) return;
|
|
61075
|
-
let n =
|
|
61084
|
+
let n = b.value?.normalizeClientCoords(e, t);
|
|
61076
61085
|
if (!n) return console.error("no matrix coords. This should not happen");
|
|
61077
|
-
let i =
|
|
61078
|
-
if (
|
|
61079
|
-
let e =
|
|
61080
|
-
t && n && r ?
|
|
61081
|
-
} else
|
|
61082
|
-
}
|
|
61083
|
-
let
|
|
61084
|
-
|
|
61085
|
-
},
|
|
61086
|
+
let i = j.value.findIndex((e) => e.x <= n[0] && e.x + e.width >= n[0] && e.y <= n[1] && e.y + e.height >= n[1]), a = i % _.value.x, o = Math.floor(i / _.value.x);
|
|
61087
|
+
if (O.value) {
|
|
61088
|
+
let e = k(a, o), t = ja(e?.scale ?? 0, 6) === ja(c.value.scale, 6), n = ja(e?.x ?? 0, 6) === ja(c.value.translateX, 6), r = ja(e?.y ?? 0, 6) === ja(c.value.translateY, 6);
|
|
61089
|
+
t && n && r ? I() : (console.log(Math.min(Math.max(0, a), _.value.x - 1), Math.min(Math.max(0, o), _.value.y - 1)), w(Math.min(Math.max(0, a), _.value.x - 1), Math.min(Math.max(0, o), _.value.y - 1)));
|
|
61090
|
+
} else w(Math.min(Math.max(1, a), _.value.x), Math.min(Math.max(1, o), _.value.y));
|
|
61091
|
+
}
|
|
61092
|
+
let ae = B(), oe = B(0), se = (e) => {
|
|
61093
|
+
oe.value = Math.max(oe.value, e.touches.length);
|
|
61094
|
+
}, H = (e) => {
|
|
61086
61095
|
if (e.touches.length > 0) return;
|
|
61087
|
-
let t =
|
|
61088
|
-
if (
|
|
61089
|
-
|
|
61096
|
+
let t = oe.value > 1;
|
|
61097
|
+
if (oe.value = 0, t) {
|
|
61098
|
+
ae.value = void 0;
|
|
61090
61099
|
return;
|
|
61091
61100
|
}
|
|
61092
61101
|
let n = Date.now();
|
|
61093
|
-
if (
|
|
61094
|
-
|
|
61102
|
+
if (ae.value && n - ae.value < 300) {
|
|
61103
|
+
ie({
|
|
61095
61104
|
clientX: e.changedTouches[0].clientX,
|
|
61096
61105
|
clientY: e.changedTouches[0].clientY
|
|
61097
|
-
}),
|
|
61106
|
+
}), ae.value = void 0;
|
|
61098
61107
|
return;
|
|
61099
61108
|
}
|
|
61100
|
-
|
|
61101
|
-
},
|
|
61102
|
-
function
|
|
61103
|
-
|
|
61109
|
+
ae.value = n;
|
|
61110
|
+
}, ce, le;
|
|
61111
|
+
function ue() {
|
|
61112
|
+
ce = O.value?.x ?? 1, le = O.value?.y ?? 1;
|
|
61104
61113
|
}
|
|
61105
|
-
function
|
|
61106
|
-
if (
|
|
61107
|
-
let e =
|
|
61108
|
-
|
|
61114
|
+
function de(e) {
|
|
61115
|
+
if (y.value) {
|
|
61116
|
+
let e = O.value?.x, t = O.value?.y;
|
|
61117
|
+
w(e ?? ce, t ?? le);
|
|
61109
61118
|
}
|
|
61110
61119
|
}
|
|
61111
|
-
let
|
|
61112
|
-
console.log("INIT",
|
|
61120
|
+
let fe = () => {
|
|
61121
|
+
console.log("INIT", b.value?.zoompinchEngine?.canvasBounds), b.value?.applyTransform(1, [.5, .5], [.5, .5]);
|
|
61113
61122
|
};
|
|
61114
|
-
W([
|
|
61115
|
-
e && t && n && r &&
|
|
61123
|
+
W([S, C], ([e, t], [n, r]) => {
|
|
61124
|
+
e && t && n && r && R();
|
|
61116
61125
|
});
|
|
61117
|
-
let
|
|
61118
|
-
W(
|
|
61119
|
-
|
|
61120
|
-
|
|
61126
|
+
let pe = l(() => g.value?.ready ?? !1);
|
|
61127
|
+
W(pe, () => {
|
|
61128
|
+
pe.value && setTimeout(() => {
|
|
61129
|
+
b.value?.applyTransform(1, [.5, .5], [.5, .5]);
|
|
61121
61130
|
}, 50);
|
|
61122
61131
|
});
|
|
61123
|
-
function
|
|
61124
|
-
let t =
|
|
61132
|
+
function me(e) {
|
|
61133
|
+
let t = b.value?.normalizeClientCoords(e.clientX, e.clientY);
|
|
61125
61134
|
t && r.serial && (t[0] * r.serial.width, t[1] * r.serial.height);
|
|
61126
61135
|
}
|
|
61127
|
-
let
|
|
61128
|
-
...
|
|
61129
|
-
...
|
|
61130
|
-
})),
|
|
61136
|
+
let he = B({}), ge = l(() => ({
|
|
61137
|
+
...h?.value ?? {},
|
|
61138
|
+
...he.value
|
|
61139
|
+
})), _e = l(() => {
|
|
61131
61140
|
let e = r.accessibilityDescription;
|
|
61132
61141
|
if (!e) return;
|
|
61133
|
-
let t =
|
|
61142
|
+
let t = ge.value;
|
|
61134
61143
|
return e.replace(/\{\{([^}]+)\}\}/g, (e, n) => {
|
|
61135
61144
|
let r = String(n).trim();
|
|
61136
61145
|
if (Object.prototype.hasOwnProperty.call(t, r)) {
|
|
@@ -61146,33 +61155,33 @@ var JR = ["role", "aria-label"], YR = { class: "controls-layer" }, XR = {
|
|
|
61146
61155
|
}).replace(/\s+/g, " ").trim() || void 0;
|
|
61147
61156
|
});
|
|
61148
61157
|
return t({
|
|
61149
|
-
currentlyFocusedFrame:
|
|
61150
|
-
focusFrame:
|
|
61151
|
-
globalScope:
|
|
61152
|
-
bxLiveTemplateRef:
|
|
61153
|
-
ready:
|
|
61154
|
-
templateViewRootWidth:
|
|
61155
|
-
templateViewRootHeight:
|
|
61156
|
-
fit:
|
|
61157
|
-
needsToFit:
|
|
61158
|
+
currentlyFocusedFrame: O,
|
|
61159
|
+
focusFrame: w,
|
|
61160
|
+
globalScope: he,
|
|
61161
|
+
bxLiveTemplateRef: g,
|
|
61162
|
+
ready: pe,
|
|
61163
|
+
templateViewRootWidth: S,
|
|
61164
|
+
templateViewRootHeight: C,
|
|
61165
|
+
fit: I,
|
|
61166
|
+
needsToFit: F,
|
|
61158
61167
|
transform: c,
|
|
61159
|
-
zoompinchRef:
|
|
61160
|
-
isMultiFrame:
|
|
61168
|
+
zoompinchRef: b,
|
|
61169
|
+
isMultiFrame: y
|
|
61161
61170
|
}), (t, n) => (L(), p("div", {
|
|
61162
61171
|
ref_key: "templateViewRootRef",
|
|
61163
|
-
ref:
|
|
61172
|
+
ref: x,
|
|
61164
61173
|
class: "template-view",
|
|
61165
|
-
role:
|
|
61166
|
-
"aria-label":
|
|
61167
|
-
onClick:
|
|
61168
|
-
onDblclick:
|
|
61169
|
-
onTouchstart:
|
|
61170
|
-
onTouchend:
|
|
61174
|
+
role: _e.value ? "img" : void 0,
|
|
61175
|
+
"aria-label": _e.value || void 0,
|
|
61176
|
+
onClick: me,
|
|
61177
|
+
onDblclick: ie,
|
|
61178
|
+
onTouchstart: se,
|
|
61179
|
+
onTouchend: H
|
|
61171
61180
|
}, [v(U(hA), {
|
|
61172
61181
|
ref_key: "zoompinchRef",
|
|
61173
|
-
ref:
|
|
61182
|
+
ref: b,
|
|
61174
61183
|
transform: c.value,
|
|
61175
|
-
"onUpdate:transform":
|
|
61184
|
+
"onUpdate:transform": u,
|
|
61176
61185
|
offset: e.offset,
|
|
61177
61186
|
"min-scale": .1,
|
|
61178
61187
|
"max-scale": 10,
|
|
@@ -61182,9 +61191,9 @@ var JR = ["role", "aria-label"], YR = { class: "controls-layer" }, XR = {
|
|
|
61182
61191
|
touch: e.zoomAndPan,
|
|
61183
61192
|
wheel: e.zoomAndPan,
|
|
61184
61193
|
gesture: "",
|
|
61185
|
-
onDragGestureStart:
|
|
61186
|
-
onDragGestureEnd:
|
|
61187
|
-
onInit:
|
|
61194
|
+
onDragGestureStart: ue,
|
|
61195
|
+
onDragGestureEnd: de,
|
|
61196
|
+
onInit: fe
|
|
61188
61197
|
}, {
|
|
61189
61198
|
matrix: G(({ composePoint: t, canvasWidth: r, canvasHeight: l, normalizeClientCoords: u }) => [
|
|
61190
61199
|
e.imageOverlays?.length ? (L(), d(KR, {
|
|
@@ -61236,25 +61245,25 @@ var JR = ["role", "aria-label"], YR = { class: "controls-layer" }, XR = {
|
|
|
61236
61245
|
"normalize-client-coords"
|
|
61237
61246
|
])) : f("", !0),
|
|
61238
61247
|
m("div", YR, [
|
|
61239
|
-
|
|
61248
|
+
_.value.x > 1 ? (L(), p("div", XR, [m("div", ZR, [(L(!0), p(a, null, re(_.value.x, (e) => (L(), p("div", {
|
|
61240
61249
|
class: A(["frame-dot", {
|
|
61241
|
-
active: U(
|
|
61242
|
-
disabled: !U(
|
|
61250
|
+
active: U(O)?.x === e - 1,
|
|
61251
|
+
disabled: !U(O)
|
|
61243
61252
|
}]),
|
|
61244
|
-
onClick: (t) =>
|
|
61253
|
+
onClick: (t) => ne(e - 1, t)
|
|
61245
61254
|
}, null, 10, QR))), 256))])])) : f("", !0),
|
|
61246
|
-
|
|
61255
|
+
_.value.y > 1 ? (L(), p("div", $R, [m("div", ez, [(L(!0), p(a, null, re(_.value.y, (e) => (L(), p("div", {
|
|
61247
61256
|
class: A(["frame-dot", {
|
|
61248
|
-
active: U(
|
|
61249
|
-
disabled: !U(
|
|
61257
|
+
active: U(O)?.y === e - 1,
|
|
61258
|
+
disabled: !U(O)
|
|
61250
61259
|
}]),
|
|
61251
|
-
onClick: (t) =>
|
|
61260
|
+
onClick: (t) => V(e - 1, t)
|
|
61252
61261
|
}, null, 10, tz))), 256))])])) : f("", !0),
|
|
61253
61262
|
e.watermark ? (L(), p("svg", nz, [v(bR, {
|
|
61254
|
-
width: U(
|
|
61255
|
-
height: U(
|
|
61263
|
+
width: U(S),
|
|
61264
|
+
height: U(C)
|
|
61256
61265
|
}, null, 8, ["width", "height"])])) : f("", !0),
|
|
61257
|
-
|
|
61266
|
+
F.value ? (L(), p("div", {
|
|
61258
61267
|
key: 3,
|
|
61259
61268
|
class: "fit-btn-wrapper",
|
|
61260
61269
|
onTouchstart: n[10] ||= ye(() => {}, ["stop"]),
|
|
@@ -61264,7 +61273,7 @@ var JR = ["role", "aria-label"], YR = { class: "controls-layer" }, XR = {
|
|
|
61264
61273
|
}, [v(jx, {
|
|
61265
61274
|
circle: "",
|
|
61266
61275
|
tertiary: "",
|
|
61267
|
-
onClick:
|
|
61276
|
+
onClick: I
|
|
61268
61277
|
}, {
|
|
61269
61278
|
icon: G(() => [v(MC, null, {
|
|
61270
61279
|
default: G(() => [v(U(kS))]),
|
|
@@ -61276,7 +61285,7 @@ var JR = ["role", "aria-label"], YR = { class: "controls-layer" }, XR = {
|
|
|
61276
61285
|
]),
|
|
61277
61286
|
default: G(() => [v(wR, {
|
|
61278
61287
|
ref_key: "bxLiveTemplateRef",
|
|
61279
|
-
ref:
|
|
61288
|
+
ref: g,
|
|
61280
61289
|
"bx-core-version": e.bxCoreVersion,
|
|
61281
61290
|
"cloudflare-pages-hostname": e.cloudflarePagesHostname,
|
|
61282
61291
|
"asset-proxy": e.assetProxy,
|
|
@@ -61285,10 +61294,10 @@ var JR = ["role", "aria-label"], YR = { class: "controls-layer" }, XR = {
|
|
|
61285
61294
|
"serial-height": e.serialHeight,
|
|
61286
61295
|
preview: e.preview,
|
|
61287
61296
|
"personalized-preview-src": e.personalizedPreviewSrc,
|
|
61288
|
-
globalScope:
|
|
61289
|
-
"onUpdate:globalScope": n[0] ||= (e) =>
|
|
61290
|
-
data: U(
|
|
61291
|
-
"onUpdate:data": n[1] ||= (e) => E(
|
|
61297
|
+
globalScope: he.value,
|
|
61298
|
+
"onUpdate:globalScope": n[0] ||= (e) => he.value = e,
|
|
61299
|
+
data: U(h),
|
|
61300
|
+
"onUpdate:data": n[1] ||= (e) => E(h) ? h.value = e : null
|
|
61292
61301
|
}, null, 8, [
|
|
61293
61302
|
"bx-core-version",
|
|
61294
61303
|
"cloudflare-pages-hostname",
|
|
@@ -61310,7 +61319,7 @@ var JR = ["role", "aria-label"], YR = { class: "controls-layer" }, XR = {
|
|
|
61310
61319
|
"wheel"
|
|
61311
61320
|
])], 40, JR));
|
|
61312
61321
|
}
|
|
61313
|
-
}), [["__scopeId", "data-v-
|
|
61322
|
+
}), [["__scopeId", "data-v-897dcf0e"]]), iz = /*#__PURE__*/ q(/* @__PURE__ */ y({
|
|
61314
61323
|
__name: "SlidesNavigation",
|
|
61315
61324
|
props: /*@__PURE__*/ D({ length: {} }, {
|
|
61316
61325
|
index: { required: !0 },
|