@templatical/media-library 0.12.1 → 0.14.0

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/index.d.ts CHANGED
@@ -225,6 +225,14 @@ export declare const MediaLibraryModal: typeof __VLS_export;
225
225
 
226
226
  export declare interface MediaRequestContext {
227
227
  accept?: MediaCategory[];
228
+ /**
229
+ * Image files dragged directly onto an image block/field (issue #229).
230
+ * Present only on drag-and-drop requests; absent for click → Browse Media.
231
+ * The media handler should upload these and return the resulting
232
+ * `MediaResult`. Plural for forward-compat, but the editor currently sends
233
+ * a single file per drop.
234
+ */
235
+ files?: File[];
228
236
  }
229
237
 
230
238
  declare type MediaTranslations = typeof en;
@@ -242,7 +242,8 @@ function fe(e) {
242
242
  total: r.length
243
243
  };
244
244
  try {
245
- n.value = [await t.uploadMedia(r[a], i.value), ...n.value];
245
+ let e = await t.uploadMedia(r[a], i.value);
246
+ n.value = [e, ...n.value];
246
247
  } catch (t) {
247
248
  e.onError?.(t);
248
249
  }
@@ -371,7 +372,8 @@ function fe(e) {
371
372
  async function re(n) {
372
373
  E.value = n, C.value = null;
373
374
  try {
374
- D.value = (await t.checkMediaUsage([n.id])).data[n.id] ?? null, T.value = !0;
375
+ let e = await t.checkMediaUsage([n.id]);
376
+ D.value = e.data[n.id] ?? null, T.value = !0;
375
377
  } catch (t) {
376
378
  e.onError?.(t);
377
379
  }
@@ -2182,11 +2184,11 @@ var Xn = ["data-tpl-theme"], Zn = {
2182
2184
  }
2183
2185
  function J() {
2184
2186
  if (q()) {
2185
- let e = B.previewItem.value;
2186
- r("select", {
2187
+ let e = B.previewItem.value, t = {
2187
2188
  ...e,
2188
2189
  url: W.selectedUrl.value || e.url
2189
- }), r("close");
2190
+ };
2191
+ r("select", t), r("close");
2190
2192
  }
2191
2193
  }
2192
2194
  return (t, n) => (S(), l(a, { to: e.popoverTarget || "body" }, [m(o, {
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@templatical/media-library",
3
3
  "description": "Media library management for Templatical email editor",
4
- "version": "0.12.1",
4
+ "version": "0.14.0",
5
5
  "bugs": "https://github.com/templatical/sdk/issues",
6
6
  "dependencies": {
7
- "@lucide/vue": "^1.21.0",
7
+ "@lucide/vue": "^1.23.0",
8
8
  "@vueuse/core": "^14.3.0",
9
9
  "vue-advanced-cropper": "^2.8.9",
10
- "@templatical/core": "0.12.1",
11
- "@templatical/types": "0.12.1"
10
+ "@templatical/core": "0.14.0",
11
+ "@templatical/types": "0.14.0"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@vitejs/plugin-vue": "^6.0.7",
15
15
  "@vue/test-utils": "^2.4.11",
16
16
  "typescript": "^6.0.3",
17
- "vite": "^8.1.0",
17
+ "vite": "^8.1.3",
18
18
  "vitest": "^4.1.9",
19
19
  "vue": "^3.5.39",
20
- "vue-tsc": "^3.3.5"
20
+ "vue-tsc": "^3.3.6"
21
21
  },
22
22
  "exports": {
23
23
  ".": {
@@ -41,7 +41,7 @@
41
41
  "license": "SEE LICENSE IN LICENSE",
42
42
  "module": "./dist/templatical-media-library.js",
43
43
  "peerDependencies": {
44
- "tailwindcss": "^4.3.1",
44
+ "tailwindcss": "^4.3.2",
45
45
  "vue": "^3.5.39"
46
46
  },
47
47
  "publishConfig": {