@templatical/media-library 0.43.1 → 0.43.3
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/{MediaEditModal-g37o1fP4.js → MediaEditModal-CO_AVnsB.js} +140 -100
- package/dist/{cdn/chunks/ca-B1Ig3u8O.js → ca-DyHL0z4N.js} +6 -4
- package/dist/cdn/chunks/{MediaEditModal-984aDCxg.js → MediaEditModal-CdquYw2S.js} +317 -277
- package/dist/cdn/chunks/MediaEditModal-CdquYw2S.js.map +1 -0
- package/dist/{ca-B1Ig3u8O.js → cdn/chunks/ca-DyHL0z4N.js} +8 -2
- package/dist/cdn/chunks/ca-DyHL0z4N.js.map +1 -0
- package/dist/cdn/chunks/{de-BNbyJubD.js → de-Dcy8LcNQ.js} +7 -3
- package/dist/cdn/chunks/de-Dcy8LcNQ.js.map +1 -0
- package/dist/{en-CQxhpwqd.js → cdn/chunks/en-w2ihxIL6.js} +8 -2
- package/dist/cdn/chunks/en-w2ihxIL6.js.map +1 -0
- package/dist/cdn/chunks/{es-B2EH-TdJ.js → es-B43D0gmB.js} +7 -3
- package/dist/cdn/chunks/es-B43D0gmB.js.map +1 -0
- package/dist/cdn/chunks/{fr-9SWy_n9K.js → fr-DsxaRm09.js} +7 -3
- package/dist/cdn/chunks/fr-DsxaRm09.js.map +1 -0
- package/dist/cdn/chunks/{icons-4_7522gN.js → icons-DEo4BnEe.js} +6 -6
- package/dist/cdn/chunks/{icons-4_7522gN.js.map → icons-DEo4BnEe.js.map} +1 -1
- package/dist/{ja-CJeeGmVQ.js → cdn/chunks/ja-DDI6z0aO.js} +8 -2
- package/dist/cdn/chunks/ja-DDI6z0aO.js.map +1 -0
- package/dist/{nl-DJasgSvI.js → cdn/chunks/nl-CHa6u0cR.js} +8 -2
- package/dist/cdn/chunks/nl-CHa6u0cR.js.map +1 -0
- package/dist/cdn/chunks/{pt-BR-BtCfbqSj.js → pt-BR-CZmeAVC3.js} +7 -3
- package/dist/cdn/chunks/pt-BR-CZmeAVC3.js.map +1 -0
- package/dist/cdn/chunks/{useFocusTrap-5U5Mu8Hj.js → useFocusTrap-D2cf_o5B.js} +14 -13
- package/dist/cdn/chunks/useFocusTrap-D2cf_o5B.js.map +1 -0
- package/dist/cdn/media-library.css +1 -1
- package/dist/cdn/media-library.js +488 -449
- package/dist/cdn/media-library.js.map +1 -1
- package/dist/{de-BNbyJubD.js → de-Dcy8LcNQ.js} +6 -2
- package/dist/{cdn/chunks/en-CQxhpwqd.js → en-w2ihxIL6.js} +6 -4
- package/dist/{es-B2EH-TdJ.js → es-B43D0gmB.js} +6 -2
- package/dist/{fr-9SWy_n9K.js → fr-DsxaRm09.js} +6 -2
- package/dist/index.d.ts +8 -2
- package/dist/{cdn/chunks/ja-CJeeGmVQ.js → ja-DDI6z0aO.js} +6 -4
- package/dist/{cdn/chunks/nl-DJasgSvI.js → nl-CHa6u0cR.js} +6 -4
- package/dist/{pt-BR-BtCfbqSj.js → pt-BR-CZmeAVC3.js} +6 -2
- package/dist/templatical-media-library.css +1 -1
- package/dist/templatical-media-library.js +426 -387
- package/dist/{useFocusTrap-6eIRXtCA.js → useFocusTrap-CIacOa9R.js} +12 -11
- package/package.json +6 -6
- package/dist/cdn/chunks/MediaEditModal-984aDCxg.js.map +0 -1
- package/dist/cdn/chunks/ca-B1Ig3u8O.js.map +0 -1
- package/dist/cdn/chunks/de-BNbyJubD.js.map +0 -1
- package/dist/cdn/chunks/en-CQxhpwqd.js.map +0 -1
- package/dist/cdn/chunks/es-B2EH-TdJ.js.map +0 -1
- package/dist/cdn/chunks/fr-9SWy_n9K.js.map +0 -1
- package/dist/cdn/chunks/ja-CJeeGmVQ.js.map +0 -1
- package/dist/cdn/chunks/nl-DJasgSvI.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-BtCfbqSj.js.map +0 -1
- package/dist/cdn/chunks/useFocusTrap-5U5Mu8Hj.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as e, l as t, n, o as r, r as i, t as a } from "./useFocusTrap-
|
|
1
|
+
import { i as e, l as t, n, o as r, r as i, t as a } from "./useFocusTrap-CIacOa9R.js";
|
|
2
2
|
import { Fragment as o, Teleport as s, Transition as c, computed as l, createBlock as ee, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, inject as g, normalizeClass as _, normalizeStyle as te, openBlock as v, ref as y, renderList as ne, toDisplayString as b, unref as x, vModelText as S, watch as re, withCtx as ie, withDirectives as C, withModifiers as ae } from "vue";
|
|
3
3
|
import { Cropper as oe } from "vue-advanced-cropper";
|
|
4
4
|
//#region src/composables/useImageCrop.ts
|
|
@@ -81,106 +81,143 @@ var fe = ["data-tpl-theme"], pe = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, me
|
|
|
81
81
|
}, ve = { class: "tpl:space-y-3" }, ye = {
|
|
82
82
|
class: "tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium",
|
|
83
83
|
style: { color: "var(--tpl-text-muted)" }
|
|
84
|
-
}, be = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, xe = ["onClick"], Se = { class: "tpl:flex tpl:gap-3" }, Ce = { class: "tpl:flex-1" },
|
|
84
|
+
}, be = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, xe = ["onClick"], Se = { class: "tpl:flex tpl:gap-3" }, Ce = { class: "tpl:flex-1" }, we = {
|
|
85
85
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
86
86
|
style: { color: "var(--tpl-text-muted)" }
|
|
87
|
-
},
|
|
87
|
+
}, Te = {
|
|
88
88
|
class: "tpl:font-normal",
|
|
89
89
|
style: { color: "var(--tpl-text-dim)" }
|
|
90
|
-
},
|
|
90
|
+
}, Ee = { class: "tpl:relative" }, De = ["value", "placeholder"], w = {
|
|
91
91
|
class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
|
|
92
92
|
style: { color: "var(--tpl-text-dim)" }
|
|
93
|
-
},
|
|
93
|
+
}, T = { class: "tpl:flex-1" }, E = {
|
|
94
94
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
95
95
|
style: { color: "var(--tpl-text-muted)" }
|
|
96
|
-
},
|
|
96
|
+
}, Oe = {
|
|
97
97
|
class: "tpl:font-normal",
|
|
98
98
|
style: { color: "var(--tpl-text-dim)" }
|
|
99
|
-
},
|
|
99
|
+
}, ke = { class: "tpl:relative" }, Ae = ["value", "placeholder"], je = {
|
|
100
100
|
class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
|
|
101
101
|
style: { color: "var(--tpl-text-dim)" }
|
|
102
|
-
},
|
|
102
|
+
}, Me = {
|
|
103
103
|
key: 0,
|
|
104
104
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
|
|
105
105
|
style: { color: "var(--tpl-text-muted)" }
|
|
106
|
-
},
|
|
106
|
+
}, Ne = {
|
|
107
107
|
class: "tpl:font-medium",
|
|
108
108
|
style: { color: "var(--tpl-text)" }
|
|
109
|
-
},
|
|
109
|
+
}, Pe = { class: "tpl:mb-3" }, Fe = {
|
|
110
110
|
for: "tpl-media-filename",
|
|
111
111
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
112
112
|
style: { color: "var(--tpl-text-muted)" }
|
|
113
|
-
},
|
|
113
|
+
}, Ie = ["autofocus"], Le = {
|
|
114
114
|
key: 1,
|
|
115
115
|
class: "tpl:mb-4"
|
|
116
|
-
},
|
|
116
|
+
}, Re = {
|
|
117
117
|
for: "tpl-media-alt",
|
|
118
118
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
119
119
|
style: { color: "var(--tpl-text-muted)" }
|
|
120
|
-
},
|
|
120
|
+
}, ze = ["placeholder"], Be = {
|
|
121
|
+
key: 0,
|
|
122
|
+
id: "tpl-media-edit-error",
|
|
123
|
+
role: "alert",
|
|
124
|
+
class: "tpl:shrink-0 tpl:px-5 tpl:pt-3 tpl:text-xs",
|
|
125
|
+
style: { color: "var(--tpl-danger)" }
|
|
126
|
+
}, Ve = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, He = ["disabled"], Ue = ["disabled"], D = /*#__PURE__*/ n(/* @__PURE__ */ h({
|
|
121
127
|
__name: "MediaEditModal",
|
|
122
128
|
props: {
|
|
123
129
|
visible: { type: Boolean },
|
|
124
|
-
item: {}
|
|
130
|
+
item: {},
|
|
131
|
+
save: { type: Function },
|
|
132
|
+
canCrop: { type: Boolean }
|
|
125
133
|
},
|
|
126
|
-
emits: ["
|
|
134
|
+
emits: ["close"],
|
|
127
135
|
setup(n, { emit: h }) {
|
|
128
|
-
let
|
|
136
|
+
let D = n, O = h, { t: k } = e(), We = g(t, null), A = g(r, y(null)), Ge = k.mediaLibrary, { isImageMimeType: j } = i(), M = y(""), N = y(""), P = y(null), F = y("free"), I = y(void 0), L = y(void 0), R = y(""), z = y(""), B = y(void 0), V = y(null), H = y(!1), U = y(!1), W = y(!1), G = y(null), K = null, Ke = [
|
|
129
137
|
"image/jpeg",
|
|
130
138
|
"image/png",
|
|
131
|
-
"image/webp"
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
e && M.item && (L.value = M.item.filename ?? "", R.value = M.item.alt ?? "", B.value = "free", V.value = void 0, H.value = void 0, U.value = "", W.value = "", G.value = void 0, K.value = null, q.value = !1, Y.value = !1, M.item.width && M.item.height && (G.value = M.item.width / M.item.height));
|
|
139
|
+
"image/webp"
|
|
140
|
+
], q = l(() => !D.item || !D.canCrop ? !1 : Ke.includes(D.item.mimeType ?? "")), qe = l(() => I.value !== void 0 || L.value !== void 0), Je = l(() => F.value === "original" ? B.value : se[F.value]), J = l(() => V.value ? de(V.value.width, V.value.height, I.value, L.value) : null);
|
|
141
|
+
re(() => D.visible, (e) => {
|
|
142
|
+
e && D.item && (M.value = D.item.filename ?? "", N.value = D.item.alt ?? "", F.value = "free", I.value = void 0, L.value = void 0, R.value = "", z.value = "", B.value = void 0, V.value = null, H.value = !1, W.value = !1, G.value = null, K = null, D.item.width && D.item.height && (B.value = D.item.width / D.item.height));
|
|
136
143
|
}, { immediate: !0 });
|
|
137
|
-
function
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
144
|
+
function Y(e) {
|
|
145
|
+
return {
|
|
146
|
+
left: Math.round(e.left),
|
|
147
|
+
top: Math.round(e.top),
|
|
148
|
+
width: Math.round(e.width),
|
|
149
|
+
height: Math.round(e.height)
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function Ye(e, t) {
|
|
153
|
+
return e.left === t.left && e.top === t.top && e.width === t.width && e.height === t.height;
|
|
154
|
+
}
|
|
155
|
+
function Xe(e) {
|
|
156
|
+
if (!e.coordinates) return;
|
|
157
|
+
let t = Y(e.coordinates);
|
|
158
|
+
if (V.value = {
|
|
159
|
+
width: t.width,
|
|
160
|
+
height: t.height
|
|
161
|
+
}, !K) {
|
|
162
|
+
K = t;
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
W.value = !Ye(t, K);
|
|
166
|
+
}
|
|
167
|
+
function Ze({ imageSize: e }) {
|
|
168
|
+
return {
|
|
169
|
+
width: e.width,
|
|
170
|
+
height: e.height
|
|
171
|
+
};
|
|
142
172
|
}
|
|
143
|
-
function
|
|
144
|
-
|
|
173
|
+
function Qe() {
|
|
174
|
+
H.value = !0, !B.value && D.item?.width && D.item?.height && (B.value = D.item.width / D.item.height);
|
|
145
175
|
}
|
|
146
|
-
function
|
|
176
|
+
function $e(e) {
|
|
147
177
|
let t = e.target.value;
|
|
148
|
-
|
|
178
|
+
R.value = t, I.value = t && parseInt(t, 10) || void 0;
|
|
149
179
|
}
|
|
150
|
-
function
|
|
180
|
+
function X(e) {
|
|
151
181
|
let t = e.target.value;
|
|
152
|
-
|
|
182
|
+
z.value = t, L.value = t && parseInt(t, 10) || void 0;
|
|
153
183
|
}
|
|
154
|
-
async function
|
|
155
|
-
let e =
|
|
156
|
-
if (!e || !
|
|
157
|
-
let t =
|
|
158
|
-
if (
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
184
|
+
async function Z() {
|
|
185
|
+
let e = M.value.trim();
|
|
186
|
+
if (!e || !D.item || U.value) return;
|
|
187
|
+
let t = D.item, n = j(t.mimeType ?? ""), r;
|
|
188
|
+
if (U.value = !0, G.value = null, q.value && P.value && (W.value || qe.value)) try {
|
|
189
|
+
let { canvas: e } = P.value.getResult();
|
|
190
|
+
if (!e) throw Error("The cropper returned no canvas");
|
|
191
|
+
let n = le(e, I.value, L.value);
|
|
192
|
+
(W.value || n !== e) && (r = { file: await ue(n, t.filename ?? "image", ce(t.mimeType ?? "")) });
|
|
193
|
+
} catch {
|
|
194
|
+
G.value = "crop", U.value = !1;
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
let i = await D.save(t.id, e, n ? N.value : void 0, r);
|
|
198
|
+
if (U.value = !1, i === "saved") {
|
|
199
|
+
O("close");
|
|
200
|
+
return;
|
|
171
201
|
}
|
|
172
|
-
|
|
202
|
+
i === "replaced" && et(), G.value = "save";
|
|
203
|
+
}
|
|
204
|
+
function et() {
|
|
205
|
+
let e = P.value?.getResult().coordinates;
|
|
206
|
+
e && (K = Y(e)), W.value = !1, I.value = void 0, L.value = void 0, R.value = "", z.value = "";
|
|
173
207
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
208
|
+
function Q() {
|
|
209
|
+
U.value || O("close");
|
|
210
|
+
}
|
|
211
|
+
let $ = y(null), tt = l(() => D.visible && D.item !== null);
|
|
212
|
+
a($, tt);
|
|
213
|
+
function nt(e) {
|
|
214
|
+
if (e.stopPropagation(), e.key === "Enter" && !U.value) {
|
|
178
215
|
if (e.target?.closest("textarea, [contenteditable]")) return;
|
|
179
|
-
e.preventDefault(),
|
|
216
|
+
e.preventDefault(), Z();
|
|
180
217
|
}
|
|
181
|
-
e.key === "Escape" &&
|
|
218
|
+
e.key === "Escape" && Q();
|
|
182
219
|
}
|
|
183
|
-
return (e, t) => (v(), ee(s, { to: x(
|
|
220
|
+
return (e, t) => (v(), ee(s, { to: x(A) || "body" }, [m(c, {
|
|
184
221
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
185
222
|
"enter-from-class": "tpl:opacity-0",
|
|
186
223
|
"enter-to-class": "tpl:opacity-100",
|
|
@@ -190,33 +227,34 @@ var fe = ["data-tpl-theme"], pe = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, me
|
|
|
190
227
|
}, {
|
|
191
228
|
default: ie(() => [n.visible && n.item ? (v(), d("div", {
|
|
192
229
|
key: 0,
|
|
193
|
-
"data-tpl-theme": x(
|
|
194
|
-
class: _([x(
|
|
230
|
+
"data-tpl-theme": x(We),
|
|
231
|
+
class: _([x(A) ? void 0 : "tpl", "tpl:fixed tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:p-4"]),
|
|
195
232
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
196
|
-
onClick:
|
|
197
|
-
onKeydown:
|
|
233
|
+
onClick: ae(Q, ["self"]),
|
|
234
|
+
onKeydown: nt
|
|
198
235
|
}, [f("div", {
|
|
199
236
|
ref_key: "dialogRef",
|
|
200
237
|
ref: $,
|
|
201
238
|
role: "dialog",
|
|
202
239
|
"aria-modal": "true",
|
|
203
240
|
"aria-labelledby": "tpl-media-edit-title",
|
|
204
|
-
class: _(["tpl:flex tpl:max-h-[90%] tpl:w-full tpl:flex-col tpl:overflow-hidden tpl:rounded-lg tpl:shadow-xl",
|
|
241
|
+
class: _(["tpl:flex tpl:max-h-[90%] tpl:w-full tpl:flex-col tpl:overflow-hidden tpl:rounded-lg tpl:shadow-xl", q.value ? "tpl:max-w-2xl" : "tpl:max-w-sm"]),
|
|
205
242
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
206
243
|
}, [
|
|
207
|
-
f("div", pe, [f("h3", me, b(x(
|
|
244
|
+
f("div", pe, [f("h3", me, b(x(k).mediaLibrary.editFile), 1)]),
|
|
208
245
|
f("div", he, [
|
|
209
|
-
|
|
246
|
+
q.value ? (v(), d("div", ge, [f("div", _e, [m(x(oe), {
|
|
210
247
|
ref_key: "cropperRef",
|
|
211
|
-
ref:
|
|
248
|
+
ref: P,
|
|
212
249
|
src: n.item.url,
|
|
213
|
-
"stencil-props": { aspectRatio:
|
|
250
|
+
"stencil-props": { aspectRatio: Je.value },
|
|
214
251
|
class: "tpl:h-full tpl:w-full",
|
|
215
252
|
"background-class": "tpl-cropper-background",
|
|
216
|
-
|
|
217
|
-
|
|
253
|
+
"default-size": Ze,
|
|
254
|
+
onChange: Xe,
|
|
255
|
+
onReady: Qe
|
|
218
256
|
}, null, 8, ["src", "stencil-props"])]), f("div", ve, [
|
|
219
|
-
f("div", null, [f("label", ye, b(x(
|
|
257
|
+
f("div", null, [f("label", ye, b(x(k).mediaLibrary.cropAspectRatio), 1), f("div", be, [(v(), d(o, null, ne([
|
|
220
258
|
"free",
|
|
221
259
|
"square",
|
|
222
260
|
"landscape43",
|
|
@@ -227,14 +265,14 @@ var fe = ["data-tpl-theme"], pe = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, me
|
|
|
227
265
|
type: "button",
|
|
228
266
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
229
267
|
style: te({
|
|
230
|
-
borderColor:
|
|
231
|
-
backgroundColor:
|
|
232
|
-
color:
|
|
268
|
+
borderColor: F.value === e ? "var(--tpl-primary)" : "var(--tpl-border)",
|
|
269
|
+
backgroundColor: F.value === e ? "var(--tpl-primary-light)" : "var(--tpl-bg)",
|
|
270
|
+
color: F.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
233
271
|
}),
|
|
234
|
-
onClick: (t) =>
|
|
235
|
-
}, b(x(
|
|
236
|
-
f("div", Se, [f("div", Ce, [f("label",
|
|
237
|
-
value:
|
|
272
|
+
onClick: (t) => F.value = e
|
|
273
|
+
}, b(x(Ge)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, xe)), 64))])]),
|
|
274
|
+
f("div", Se, [f("div", Ce, [f("label", we, [p(b(x(k).mediaLibrary.cropMaxWidth) + " ", 1), f("span", Te, b(x(k).mediaLibrary.cropOptional), 1)]), f("div", Ee, [f("input", {
|
|
275
|
+
value: R.value,
|
|
238
276
|
type: "number",
|
|
239
277
|
min: "1",
|
|
240
278
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-8 tpl:pl-3 tpl:text-xs tpl:outline-none",
|
|
@@ -243,10 +281,10 @@ var fe = ["data-tpl-theme"], pe = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, me
|
|
|
243
281
|
"background-color": "var(--tpl-bg)",
|
|
244
282
|
color: "var(--tpl-text)"
|
|
245
283
|
},
|
|
246
|
-
placeholder:
|
|
247
|
-
onInput:
|
|
248
|
-
}, null, 40,
|
|
249
|
-
value:
|
|
284
|
+
placeholder: V.value?.width?.toString() || "",
|
|
285
|
+
onInput: $e
|
|
286
|
+
}, null, 40, De), f("span", w, b(x(k).mediaLibrary.cropPixels), 1)])]), f("div", T, [f("label", E, [p(b(x(k).mediaLibrary.cropMaxHeight) + " ", 1), f("span", Oe, b(x(k).mediaLibrary.cropOptional), 1)]), f("div", ke, [f("input", {
|
|
287
|
+
value: z.value,
|
|
250
288
|
type: "number",
|
|
251
289
|
min: "1",
|
|
252
290
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-8 tpl:pl-3 tpl:text-xs tpl:outline-none",
|
|
@@ -255,14 +293,14 @@ var fe = ["data-tpl-theme"], pe = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, me
|
|
|
255
293
|
"background-color": "var(--tpl-bg)",
|
|
256
294
|
color: "var(--tpl-text)"
|
|
257
295
|
},
|
|
258
|
-
placeholder:
|
|
259
|
-
onInput:
|
|
260
|
-
}, null, 40,
|
|
261
|
-
|
|
296
|
+
placeholder: V.value?.height?.toString() || "",
|
|
297
|
+
onInput: X
|
|
298
|
+
}, null, 40, Ae), f("span", je, b(x(k).mediaLibrary.cropPixels), 1)])])]),
|
|
299
|
+
J.value ? (v(), d("div", Me, [f("span", null, b(x(k).mediaLibrary.cropOutputSize) + ": ", 1), f("span", Ne, b(J.value.width) + " x " + b(J.value.height) + " " + b(x(k).mediaLibrary.cropPixels), 1)])) : u("", !0)
|
|
262
300
|
])])) : u("", !0),
|
|
263
|
-
f("div",
|
|
301
|
+
f("div", Pe, [f("label", Fe, b(x(k).mediaLibrary.fileName), 1), C(f("input", {
|
|
264
302
|
id: "tpl-media-filename",
|
|
265
|
-
"onUpdate:modelValue": t[0] ||= (e) =>
|
|
303
|
+
"onUpdate:modelValue": t[0] ||= (e) => M.value = e,
|
|
266
304
|
type: "text",
|
|
267
305
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
268
306
|
style: {
|
|
@@ -270,11 +308,11 @@ var fe = ["data-tpl-theme"], pe = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, me
|
|
|
270
308
|
"background-color": "var(--tpl-bg)",
|
|
271
309
|
color: "var(--tpl-text)"
|
|
272
310
|
},
|
|
273
|
-
autofocus: !
|
|
274
|
-
}, null, 8,
|
|
275
|
-
x(
|
|
311
|
+
autofocus: !q.value
|
|
312
|
+
}, null, 8, Ie), [[S, M.value]])]),
|
|
313
|
+
x(j)(n.item.mimeType ?? "") ? (v(), d("div", Le, [f("label", Re, b(x(k).mediaLibrary.altText), 1), C(f("input", {
|
|
276
314
|
id: "tpl-media-alt",
|
|
277
|
-
"onUpdate:modelValue": t[1] ||= (e) =>
|
|
315
|
+
"onUpdate:modelValue": t[1] ||= (e) => N.value = e,
|
|
278
316
|
type: "text",
|
|
279
317
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
280
318
|
style: {
|
|
@@ -282,30 +320,32 @@ var fe = ["data-tpl-theme"], pe = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, me
|
|
|
282
320
|
"background-color": "var(--tpl-bg)",
|
|
283
321
|
color: "var(--tpl-text)"
|
|
284
322
|
},
|
|
285
|
-
placeholder: x(
|
|
286
|
-
}, null, 8,
|
|
323
|
+
placeholder: x(k).mediaLibrary.altTextPlaceholder
|
|
324
|
+
}, null, 8, ze), [[S, N.value]])])) : u("", !0)
|
|
287
325
|
]),
|
|
288
|
-
|
|
326
|
+
G.value ? (v(), d("p", Be, b(G.value === "crop" ? x(k).mediaLibrary.editCropError : x(k).mediaLibrary.editSaveError), 1)) : u("", !0),
|
|
327
|
+
f("div", Ve, [f("button", {
|
|
289
328
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
290
329
|
style: {
|
|
291
330
|
"border-color": "var(--tpl-border)",
|
|
292
331
|
color: "var(--tpl-text)",
|
|
293
332
|
"background-color": "var(--tpl-bg)"
|
|
294
333
|
},
|
|
295
|
-
|
|
296
|
-
|
|
334
|
+
disabled: U.value,
|
|
335
|
+
onClick: Q
|
|
336
|
+
}, b(x(k).mediaLibrary.cancel), 9, He), f("button", {
|
|
297
337
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-primary-hover)] tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
298
338
|
style: {
|
|
299
339
|
"background-color": "var(--tpl-primary)",
|
|
300
340
|
color: "var(--tpl-on-primary)"
|
|
301
341
|
},
|
|
302
|
-
disabled:
|
|
303
|
-
onClick:
|
|
304
|
-
}, b(
|
|
342
|
+
disabled: U.value,
|
|
343
|
+
onClick: Z
|
|
344
|
+
}, b(U.value ? x(k).mediaLibrary.saving : x(k).mediaLibrary.saveChanges), 9, Ue)])
|
|
305
345
|
], 2)], 42, fe)) : u("", !0)]),
|
|
306
346
|
_: 1
|
|
307
347
|
})], 8, ["to"]));
|
|
308
348
|
}
|
|
309
|
-
}), [["__scopeId", "data-v-
|
|
349
|
+
}), [["__scopeId", "data-v-defcfd87"]]);
|
|
310
350
|
//#endregion
|
|
311
|
-
export {
|
|
351
|
+
export { D as default };
|
|
@@ -13,7 +13,9 @@ var e = { mediaLibrary: {
|
|
|
13
13
|
noFiles: "No s'ha trobat cap fitxer",
|
|
14
14
|
noSearchResults: "Cap fitxer no coincideix amb la cerca",
|
|
15
15
|
dropOrClick: "Deixa anar els fitxers aquí o fes clic per pujar-los",
|
|
16
|
-
|
|
16
|
+
acceptedAnyType: "Qualsevol tipus de fitxer",
|
|
17
|
+
acceptedFormatsMaxSize: "{formats} (màx. {size})",
|
|
18
|
+
uploadRejected: "No s'ha pujat, tipus o mida no acceptats: {files}",
|
|
17
19
|
uploading: "S'està pujant...",
|
|
18
20
|
uploadingProgress: "S'està pujant {current} de {total}...",
|
|
19
21
|
selectImage: "Selecciona una imatge",
|
|
@@ -60,12 +62,14 @@ var e = { mediaLibrary: {
|
|
|
60
62
|
replaceFile: "Substitueix el fitxer",
|
|
61
63
|
replaceWarningTitle: "Substitueix el fitxer",
|
|
62
64
|
replaceWarningMessage: "Estàs a punt de substituir aquest fitxer. El fitxer de substitució ha de tenir la mateixa extensió ({extension}).",
|
|
63
|
-
replaceWarningUsageNote: "Aquest fitxer s'utilitza en {count} plantilla(es).
|
|
65
|
+
replaceWarningUsageNote: "Aquest fitxer s'utilitza en {count} plantilla(es). Revisa-les després de substituir-lo.",
|
|
64
66
|
replaceSelectFile: "Selecciona el fitxer de substitució",
|
|
65
67
|
replace: "Substitueix",
|
|
66
68
|
replacing: "S'està substituint...",
|
|
67
69
|
replaceError: "No s'ha pogut substituir el fitxer",
|
|
68
70
|
saving: "S'està desant...",
|
|
71
|
+
editSaveError: "No s'han pogut desar els canvis. Torna-ho a provar.",
|
|
72
|
+
editCropError: "No s'ha pogut processar la imatge editada. Torna-ho a provar.",
|
|
69
73
|
cropAspectRatio: "Relació d'aspecte",
|
|
70
74
|
cropFree: "Lliure",
|
|
71
75
|
cropSquare: "1:1",
|
|
@@ -90,5 +94,3 @@ var e = { mediaLibrary: {
|
|
|
90
94
|
} };
|
|
91
95
|
//#endregion
|
|
92
96
|
export { e as default };
|
|
93
|
-
|
|
94
|
-
//# sourceMappingURL=ca-B1Ig3u8O.js.map
|