@webx-ui/module-media 0.1.0 → 0.3.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.js CHANGED
@@ -1,55 +1,55 @@
1
- import { defineComponent as R, useModel as L, ref as _, watch as H, openBlock as h, createBlock as k, unref as e, mergeModels as P, computed as C, resolveDirective as Se, withCtx as b, createElementBlock as W, Fragment as K, renderList as Q, withDirectives as Be, createCommentVNode as T, createVNode as y, createTextVNode as F, toDisplayString as z, isRef as te, useTemplateRef as Z, onMounted as ge, nextTick as Pe, createElementVNode as E, withKeys as qe, normalizeClass as Oe } from "vue";
2
- import { WxTree as Le, WxSelectionArea as Ne, WxFileCard as Ae, WxEmpty as Xe, toast as O, WxAction as M, WxInput as j, WxDropdown as ce, WxDropdownItem as me, WxActions as ee, useModal as ae, WxDialog as le, WxSelect as Ie, WxSpace as G, WxButton as N, useElementWidth as He, createModal as Y, WxPagination as Ke, WxDrawer as je, confirm as pe, openImageEditor as Ge, WxCard as Ye, WxImage as Je } from "@webx-ui/core";
3
- import { useTranslate as S, useAdmin as ye } from "@webx-ui/admin";
4
- const ve = /* @__PURE__ */ R({
1
+ import { defineComponent as E, useModel as A, ref as M, watch as q, openBlock as b, createBlock as k, unref as e, mergeModels as F, computed as W, resolveDirective as Pe, withCtx as w, createElementBlock as z, Fragment as Q, renderList as Z, withDirectives as Oe, createCommentVNode as L, createVNode as h, createTextVNode as S, toDisplayString as D, isRef as te, useTemplateRef as ee, onMounted as he, nextTick as qe, createElementVNode as $, withKeys as Ne, normalizeClass as Ae, normalizeStyle as me } from "vue";
2
+ import { WxTree as He, WxSelectionArea as Xe, WxFileCard as Ie, WxEmpty as Ke, toast as N, WxAction as T, WxInput as j, WxDropdown as pe, WxDropdownItem as fe, WxActions as G, useModal as ae, WxDialog as le, WxSelect as je, WxSpace as be, WxButton as X, useElementWidth as Ge, createModal as Y, WxPagination as Ye, WxDrawer as Je, confirm as ve, openImageEditor as Qe, WxCard as Ze, WxImage as et, WxPopover as tt, WxPopconfirm as at } from "@webx-ui/core";
3
+ import { useTranslate as B, useAdmin as ie } from "@webx-ui/admin";
4
+ const ge = /* @__PURE__ */ E({
5
5
  __name: "DirectoryTree",
6
- props: /* @__PURE__ */ P({
6
+ props: /* @__PURE__ */ F({
7
7
  directories: {}
8
8
  }, {
9
9
  selected: { default: null },
10
10
  selectedModifiers: {}
11
11
  }),
12
- emits: /* @__PURE__ */ P(["move"], ["update:selected"]),
13
- setup(t, { emit: r }) {
14
- const g = t, n = L(t, "selected"), c = r, i = S("webx-media"), a = _([]), u = _([]);
15
- H(
16
- () => g.directories,
17
- (l) => {
18
- a.value = l.map(x), u.value = p(l);
12
+ emits: /* @__PURE__ */ F(["move"], ["update:selected"]),
13
+ setup(a, { emit: c }) {
14
+ const m = a, l = A(a, "selected"), f = c, o = B("webx-media"), t = M([]), p = M([]);
15
+ q(
16
+ () => m.directories,
17
+ (r) => {
18
+ t.value = r.map(x), p.value = g(r);
19
19
  },
20
20
  { immediate: !0, deep: !0 }
21
21
  );
22
- function x(l) {
22
+ function x(r) {
23
23
  return {
24
- ...l,
25
- label: l.is_root ? i("manager.root") : l.title,
26
- children: (l.children ?? []).map(x)
24
+ ...r,
25
+ label: r.is_root ? o("manager.root") : r.title,
26
+ children: (r.children ?? []).map(x)
27
27
  };
28
28
  }
29
- function p(l) {
30
- return l.flatMap((f) => [f.id, ...p(f.children ?? [])]);
29
+ function g(r) {
30
+ return r.flatMap((v) => [v.id, ...g(v.children ?? [])]);
31
31
  }
32
- function d(l) {
33
- const f = l.zone === "inside" ? l.target : l.parent;
34
- f && c("move", l.node.id, f.id);
32
+ function u(r) {
33
+ const v = r.zone === "inside" ? r.target : r.parent;
34
+ v && f("move", r.node.id, v.id);
35
35
  }
36
- return (l, f) => (h(), k(e(Le), {
37
- selected: n.value,
38
- "onUpdate:selected": f[0] || (f[0] = (m) => n.value = m),
39
- expanded: u.value,
40
- "onUpdate:expanded": f[1] || (f[1] = (m) => u.value = m),
41
- modelValue: a.value,
42
- "onUpdate:modelValue": f[2] || (f[2] = (m) => a.value = m),
36
+ return (r, v) => (b(), k(e(He), {
37
+ selected: l.value,
38
+ "onUpdate:selected": v[0] || (v[0] = (i) => l.value = i),
39
+ expanded: p.value,
40
+ "onUpdate:expanded": v[1] || (v[1] = (i) => p.value = i),
41
+ modelValue: t.value,
42
+ "onUpdate:modelValue": v[2] || (v[2] = (i) => t.value = i),
43
43
  class: "wx-media-tree",
44
44
  "node-key": "id",
45
45
  draggable: "",
46
46
  "show-lines": "",
47
- onDrop: d
47
+ onDrop: u
48
48
  }, null, 8, ["selected", "expanded", "modelValue"]));
49
49
  }
50
- }), Qe = /* @__PURE__ */ R({
50
+ }), lt = /* @__PURE__ */ E({
51
51
  __name: "FileGrid",
52
- props: /* @__PURE__ */ P({
52
+ props: /* @__PURE__ */ F({
53
53
  files: {},
54
54
  api: {},
55
55
  query: {},
@@ -58,79 +58,83 @@ const ve = /* @__PURE__ */ R({
58
58
  selected: { default: () => [] },
59
59
  selectedModifiers: {}
60
60
  }),
61
- emits: /* @__PURE__ */ P(["open", "rename", "edit", "remove"], ["update:selected"]),
62
- setup(t, { emit: r }) {
63
- const g = t, n = L(t, "selected"), c = r, i = S("webx-media"), a = C(
64
- () => g.query ? i("manager.empty-search", { query: g.query }) : i("manager.empty")
61
+ emits: /* @__PURE__ */ F(["open", "rename", "edit", "remove"], ["update:selected"]),
62
+ setup(a, { emit: c }) {
63
+ const m = a, l = A(a, "selected"), f = c, o = B("webx-media"), t = W(
64
+ () => m.query ? o("manager.empty-search", { query: m.query }) : o("manager.empty")
65
65
  );
66
- function u() {
67
- O.success(i("manager.link-copied"));
66
+ function p() {
67
+ N.success(o("manager.link-copied"));
68
68
  }
69
- function x(p) {
70
- const d = document.createElement("textarea");
71
- d.value = p.url, d.setAttribute("readonly", ""), d.style.position = "fixed", d.style.opacity = "0", document.body.appendChild(d), d.select();
72
- let l = !1;
69
+ function x(g) {
70
+ const u = document.createElement("textarea");
71
+ u.value = g.url, u.setAttribute("readonly", ""), u.style.position = "fixed", u.style.opacity = "0", document.body.appendChild(u), u.select();
72
+ let r = !1;
73
73
  try {
74
- l = document.execCommand("copy");
74
+ r = document.execCommand("copy");
75
75
  } catch {
76
- l = !1;
76
+ r = !1;
77
77
  }
78
- if (d.remove(), l) {
79
- u();
78
+ if (u.remove(), r) {
79
+ p();
80
80
  return;
81
81
  }
82
- O.danger(`${i("errors.copy")} ${p.url}`, { duration: 0 });
82
+ N.danger(`${o("errors.copy")} ${g.url}`, { duration: 0 });
83
83
  }
84
- return (p, d) => {
85
- const l = Se("wx-select");
86
- return t.files.length > 0 ? (h(), k(e(Ne), {
84
+ return (g, u) => {
85
+ const r = Pe("wx-select");
86
+ return a.files.length > 0 ? (b(), k(e(Xe), {
87
87
  key: 0,
88
- modelValue: n.value,
89
- "onUpdate:modelValue": d[0] || (d[0] = (f) => n.value = f),
88
+ modelValue: l.value,
89
+ "onUpdate:modelValue": u[0] || (u[0] = (v) => l.value = v),
90
90
  class: "wx-media-grid",
91
- multiple: !t.single
91
+ multiple: !a.single
92
92
  }, {
93
- default: b(({ isSelected: f }) => [
94
- (h(!0), W(K, null, Q(t.files, (m) => Be((h(), k(e(Ae), {
95
- key: m.id,
93
+ default: w(({ isSelected: v }) => [
94
+ (b(!0), z(Q, null, Z(a.files, (i) => Oe((b(), k(e(Ie), {
95
+ key: i.id,
96
96
  class: "wx-media-grid__card",
97
- name: m.name,
98
- url: m.url,
99
- thumbnail: t.api.thumb(m, 320, 320) ?? void 0,
100
- type: m.mime,
101
- selected: f(m.id),
97
+ name: i.name,
98
+ url: i.url,
99
+ thumbnail: a.api.thumb(i, 320, 320) ?? void 0,
100
+ type: i.mime,
101
+ selected: v(i.id),
102
102
  renamable: "",
103
- editable: m.editable,
103
+ editable: i.editable,
104
104
  removable: "",
105
105
  copyable: "",
106
- "rename-label": e(i)("manager.rename"),
107
- "edit-label": e(i)("manager.edit"),
108
- "remove-label": e(i)("manager.delete"),
109
- "copy-label": e(i)("manager.copy-link"),
110
- "copied-label": e(i)("manager.link-copied"),
111
- onRename: (w) => c("rename", m, w),
112
- onEdit: (w) => c("edit", m),
113
- onRemove: (w) => c("remove", m),
114
- onCopy: u,
115
- onCopyError: (w) => x(m),
116
- onDblclick: (w) => c("open", m)
117
- }, null, 8, ["name", "url", "thumbnail", "type", "selected", "editable", "rename-label", "edit-label", "remove-label", "copy-label", "copied-label", "onRename", "onEdit", "onRemove", "onCopyError", "onDblclick"])), [
118
- [l, m.id]
106
+ "rename-label": e(o)("manager.rename"),
107
+ "edit-label": e(o)("manager.edit"),
108
+ "remove-label": e(o)("manager.delete"),
109
+ "remove-confirm-text": e(o)("dialogs.delete-file", { name: i.name }),
110
+ "cancel-label": e(o)("manager.cancel"),
111
+ "save-label": e(o)("manager.save"),
112
+ "copy-label": e(o)("manager.copy-link"),
113
+ "copied-label": e(o)("manager.link-copied"),
114
+ onRename: (d) => f("rename", i, d),
115
+ onEdit: (d) => f("edit", i),
116
+ onRemove: (d) => f("remove", i),
117
+ onCopy: p,
118
+ onCopyError: (d) => x(i),
119
+ onDblclick: (d) => f("open", i)
120
+ }, null, 8, ["name", "url", "thumbnail", "type", "selected", "editable", "rename-label", "edit-label", "remove-label", "remove-confirm-text", "cancel-label", "save-label", "copy-label", "copied-label", "onRename", "onEdit", "onRemove", "onCopyError", "onDblclick"])), [
121
+ [r, i.id]
119
122
  ])), 128))
120
123
  ]),
121
124
  _: 1
122
- }, 8, ["modelValue", "multiple"])) : (h(), k(e(Xe), {
125
+ }, 8, ["modelValue", "multiple"])) : (b(), k(e(Ke), {
123
126
  key: 1,
124
- description: a.value
127
+ description: t.value
125
128
  }, null, 8, ["description"]));
126
129
  };
127
130
  }
128
- }), Ze = { class: "wx-media-toolbar" }, et = /* @__PURE__ */ R({
131
+ }), it = { class: "wx-media-toolbar" }, ot = /* @__PURE__ */ E({
129
132
  __name: "MediaToolbar",
130
- props: /* @__PURE__ */ P({
133
+ props: /* @__PURE__ */ F({
131
134
  canUpload: { type: Boolean },
132
135
  canManage: { type: Boolean },
133
136
  selected: {},
137
+ fixedType: { type: Boolean },
134
138
  compact: { type: Boolean }
135
139
  }, {
136
140
  search: { default: "" },
@@ -140,155 +144,155 @@ const ve = /* @__PURE__ */ R({
140
144
  sort: { default: "-created_at" },
141
145
  sortModifiers: {}
142
146
  }),
143
- emits: /* @__PURE__ */ P(["upload", "move", "remove", "folders"], ["update:search", "update:type", "update:sort"]),
144
- setup(t, { emit: r }) {
145
- const g = t, n = L(t, "search"), c = L(t, "type"), i = L(t, "sort"), a = r, u = S("webx-media"), x = C(() => [
146
- { value: "all", label: u("manager.all-types") },
147
- ...["image", "video", "audio", "document", "other"].map((f) => ({
148
- value: f,
149
- label: u(`manager.${f}`)
147
+ emits: /* @__PURE__ */ F(["upload", "move", "remove", "folders"], ["update:search", "update:type", "update:sort"]),
148
+ setup(a, { emit: c }) {
149
+ const m = a, l = A(a, "search"), f = A(a, "type"), o = A(a, "sort"), t = c, p = B("webx-media"), x = W(() => [
150
+ { value: "all", label: p("manager.all-types") },
151
+ ...["image", "video", "audio", "document", "other"].map((v) => ({
152
+ value: v,
153
+ label: p(`manager.${v}`)
150
154
  }))
151
- ]), p = C(() => [
152
- { value: "-created_at", label: u("manager.sort-newest") },
153
- { value: "created_at", label: u("manager.sort-oldest") },
154
- { value: "name", label: u("manager.sort-name") },
155
- { value: "-size", label: u("manager.sort-size") }
156
- ]), d = C(() => x.value.find((f) => f.value === c.value)?.label ?? ""), l = C(() => p.value.find((f) => f.value === i.value)?.label ?? "");
157
- return (f, m) => (h(), W("header", Ze, [
158
- t.compact ? (h(), k(e(M), {
155
+ ]), g = W(() => [
156
+ { value: "-created_at", label: p("manager.sort-newest") },
157
+ { value: "created_at", label: p("manager.sort-oldest") },
158
+ { value: "name", label: p("manager.sort-name") },
159
+ { value: "-size", label: p("manager.sort-size") }
160
+ ]), u = W(() => x.value.find((v) => v.value === f.value)?.label ?? ""), r = W(() => g.value.find((v) => v.value === o.value)?.label ?? "");
161
+ return (v, i) => (b(), z("header", it, [
162
+ a.compact ? (b(), k(e(T), {
159
163
  key: 0,
160
164
  icon: "folder",
161
- title: e(u)("manager.folders"),
165
+ title: e(p)("manager.folders"),
162
166
  size: "sm",
163
- onClick: m[0] || (m[0] = (w) => a("folders"))
164
- }, null, 8, ["title"])) : T("", !0),
165
- y(e(j), {
166
- modelValue: n.value,
167
- "onUpdate:modelValue": m[1] || (m[1] = (w) => n.value = w),
167
+ onClick: i[0] || (i[0] = (d) => t("folders"))
168
+ }, null, 8, ["title"])) : L("", !0),
169
+ h(e(j), {
170
+ modelValue: l.value,
171
+ "onUpdate:modelValue": i[1] || (i[1] = (d) => l.value = d),
168
172
  class: "wx-media-toolbar__search",
169
- placeholder: e(u)("manager.search"),
173
+ placeholder: e(p)("manager.search"),
170
174
  clearable: "",
171
175
  size: "sm"
172
176
  }, null, 8, ["modelValue", "placeholder"]),
173
- y(e(ce), null, {
174
- trigger: b(() => [
175
- y(e(M), {
177
+ a.fixedType ? L("", !0) : (b(), k(e(pe), { key: 1 }, {
178
+ trigger: w(() => [
179
+ h(e(T), {
176
180
  icon: "filter",
177
- title: `${e(u)("manager.all-types")}: ${d.value}`,
181
+ title: `${e(p)("manager.all-types")}: ${u.value}`,
178
182
  size: "sm"
179
183
  }, null, 8, ["title"])
180
184
  ]),
181
- default: b(() => [
182
- (h(!0), W(K, null, Q(x.value, (w) => (h(), k(e(me), {
183
- key: String(w.value),
184
- active: w.value === c.value,
185
- onClick: (B) => c.value = w.value
185
+ default: w(() => [
186
+ (b(!0), z(Q, null, Z(x.value, (d) => (b(), k(e(fe), {
187
+ key: String(d.value),
188
+ active: d.value === f.value,
189
+ onClick: (_) => f.value = d.value
186
190
  }, {
187
- default: b(() => [
188
- F(z(w.label), 1)
191
+ default: w(() => [
192
+ S(D(d.label), 1)
189
193
  ]),
190
194
  _: 2
191
195
  }, 1032, ["active", "onClick"]))), 128))
192
196
  ]),
193
197
  _: 1
194
- }),
195
- y(e(ce), null, {
196
- trigger: b(() => [
197
- y(e(M), {
198
+ })),
199
+ h(e(pe), null, {
200
+ trigger: w(() => [
201
+ h(e(T), {
198
202
  icon: "arrow-down",
199
- title: l.value,
203
+ title: r.value,
200
204
  size: "sm"
201
205
  }, null, 8, ["title"])
202
206
  ]),
203
- default: b(() => [
204
- (h(!0), W(K, null, Q(p.value, (w) => (h(), k(e(me), {
205
- key: w.value,
206
- active: w.value === i.value,
207
- onClick: (B) => i.value = w.value
207
+ default: w(() => [
208
+ (b(!0), z(Q, null, Z(g.value, (d) => (b(), k(e(fe), {
209
+ key: d.value,
210
+ active: d.value === o.value,
211
+ onClick: (_) => o.value = d.value
208
212
  }, {
209
- default: b(() => [
210
- F(z(w.label), 1)
213
+ default: w(() => [
214
+ S(D(d.label), 1)
211
215
  ]),
212
216
  _: 2
213
217
  }, 1032, ["active", "onClick"]))), 128))
214
218
  ]),
215
219
  _: 1
216
220
  }),
217
- t.canUpload ? (h(), k(e(M), {
218
- key: 1,
221
+ a.canUpload ? (b(), k(e(T), {
222
+ key: 2,
219
223
  type: "upload",
220
- title: e(u)("manager.upload"),
224
+ title: e(p)("manager.upload"),
221
225
  size: "sm",
222
- onClick: m[2] || (m[2] = (w) => a("upload"))
223
- }, null, 8, ["title"])) : T("", !0),
224
- t.canManage ? (h(), k(e(ee), {
225
- key: 2,
226
+ onClick: i[2] || (i[2] = (d) => t("upload"))
227
+ }, null, 8, ["title"])) : L("", !0),
228
+ a.canManage ? (b(), k(e(G), {
229
+ key: 3,
226
230
  size: "sm"
227
231
  }, {
228
- default: b(() => [
229
- y(e(M), {
232
+ default: w(() => [
233
+ h(e(T), {
230
234
  icon: "folder",
231
- title: e(u)("manager.move"),
232
- disabled: g.selected === 0,
233
- onClick: m[3] || (m[3] = (w) => a("move"))
235
+ title: e(p)("manager.move"),
236
+ disabled: m.selected === 0,
237
+ onClick: i[3] || (i[3] = (d) => t("move"))
234
238
  }, null, 8, ["title", "disabled"]),
235
- y(e(M), {
239
+ h(e(T), {
236
240
  type: "remove",
237
- title: e(u)("manager.delete"),
238
- disabled: g.selected === 0,
239
- onClick: m[4] || (m[4] = (w) => a("remove"))
241
+ title: e(p)("manager.delete"),
242
+ disabled: m.selected === 0,
243
+ onClick: i[4] || (i[4] = (d) => t("remove"))
240
244
  }, null, 8, ["title", "disabled"])
241
245
  ]),
242
246
  _: 1
243
- })) : T("", !0)
247
+ })) : L("", !0)
244
248
  ]));
245
249
  }
246
- }), tt = /* @__PURE__ */ R({
250
+ }), nt = /* @__PURE__ */ E({
247
251
  __name: "MoveDialog",
248
252
  props: {
249
253
  directories: {},
250
254
  from: {},
251
255
  count: {}
252
256
  },
253
- setup(t) {
254
- const r = t, { open: g, resolve: n, dismiss: c } = ae(), i = S("webx-media"), a = C(
255
- () => x(r.directories).filter((p) => p.value !== r.from)
256
- ), u = _(a.value[0]?.value ?? null);
257
- function x(p) {
258
- return p.flatMap((d) => [
257
+ setup(a) {
258
+ const c = a, { open: m, resolve: l, dismiss: f } = ae(), o = B("webx-media"), t = W(
259
+ () => x(c.directories).filter((g) => g.value !== c.from)
260
+ ), p = M(t.value[0]?.value ?? null);
261
+ function x(g) {
262
+ return g.flatMap((u) => [
259
263
  {
260
- value: d.id,
264
+ value: u.id,
261
265
  // Indented, so the tree is still readable once it is a flat list.
262
- label: " ".repeat(d.depth * 3) + (d.is_root ? i("manager.root") : d.title)
266
+ label: " ".repeat(u.depth * 3) + (u.is_root ? o("manager.root") : u.title)
263
267
  },
264
- ...x(d.children ?? [])
268
+ ...x(u.children ?? [])
265
269
  ]);
266
270
  }
267
- return (p, d) => (h(), k(e(le), {
268
- open: e(g),
269
- "onUpdate:open": d[3] || (d[3] = (l) => te(g) ? g.value = l : null),
270
- title: e(i)("manager.move-to"),
271
+ return (g, u) => (b(), k(e(le), {
272
+ open: e(m),
273
+ "onUpdate:open": u[3] || (u[3] = (r) => te(m) ? m.value = r : null),
274
+ title: e(o)("manager.move-to"),
271
275
  width: 420
272
276
  }, {
273
- footer: b(() => [
274
- y(e(G), { size: "sm" }, {
275
- default: b(() => [
276
- y(e(N), {
277
+ footer: w(() => [
278
+ h(e(be), { size: "sm" }, {
279
+ default: w(() => [
280
+ h(e(X), {
277
281
  variant: "outline",
278
- onClick: d[1] || (d[1] = (l) => e(c)())
282
+ onClick: u[1] || (u[1] = (r) => e(f)())
279
283
  }, {
280
- default: b(() => [
281
- F(z(e(i)("manager.cancel")), 1)
284
+ default: w(() => [
285
+ S(D(e(o)("manager.cancel")), 1)
282
286
  ]),
283
287
  _: 1
284
288
  }),
285
- y(e(N), {
289
+ h(e(X), {
286
290
  type: "primary",
287
- disabled: u.value === null,
288
- onClick: d[2] || (d[2] = (l) => e(n)(u.value))
291
+ disabled: p.value === null,
292
+ onClick: u[2] || (u[2] = (r) => e(l)(p.value))
289
293
  }, {
290
- default: b(() => [
291
- F(z(e(i)("manager.move")), 1)
294
+ default: w(() => [
295
+ S(D(e(o)("manager.move")), 1)
292
296
  ]),
293
297
  _: 1
294
298
  }, 8, ["disabled"])
@@ -296,17 +300,17 @@ const ve = /* @__PURE__ */ R({
296
300
  _: 1
297
301
  })
298
302
  ]),
299
- default: b(() => [
300
- y(e(Ie), {
301
- modelValue: u.value,
302
- "onUpdate:modelValue": d[0] || (d[0] = (l) => u.value = l),
303
- options: a.value
303
+ default: w(() => [
304
+ h(e(je), {
305
+ modelValue: p.value,
306
+ "onUpdate:modelValue": u[0] || (u[0] = (r) => p.value = r),
307
+ options: t.value
304
308
  }, null, 8, ["modelValue", "options"])
305
309
  ]),
306
310
  _: 1
307
311
  }, 8, ["open", "title"]));
308
312
  }
309
- }), at = /* @__PURE__ */ R({
313
+ }), rt = /* @__PURE__ */ E({
310
314
  __name: "NameDialog",
311
315
  props: {
312
316
  title: {},
@@ -314,40 +318,40 @@ const ve = /* @__PURE__ */ R({
314
318
  value: { default: "" },
315
319
  confirmText: { default: void 0 }
316
320
  },
317
- setup(t) {
318
- const r = t, { open: g, resolve: n, dismiss: c } = ae(), i = S("webx-media"), a = _(r.value), u = Z("input");
319
- ge(async () => {
320
- await Pe(), u.value?.querySelector("input")?.focus();
321
+ setup(a) {
322
+ const c = a, { open: m, resolve: l, dismiss: f } = ae(), o = B("webx-media"), t = M(c.value), p = ee("input");
323
+ he(async () => {
324
+ await qe(), p.value?.querySelector("input")?.focus();
321
325
  });
322
326
  function x() {
323
- const p = a.value.trim();
324
- p !== "" && n(p);
327
+ const g = t.value.trim();
328
+ g !== "" && l(g);
325
329
  }
326
- return (p, d) => (h(), k(e(le), {
327
- open: e(g),
328
- "onUpdate:open": d[2] || (d[2] = (l) => te(g) ? g.value = l : null),
329
- title: t.title,
330
+ return (g, u) => (b(), k(e(le), {
331
+ open: e(m),
332
+ "onUpdate:open": u[2] || (u[2] = (r) => te(m) ? m.value = r : null),
333
+ title: a.title,
330
334
  width: 420
331
335
  }, {
332
- footer: b(() => [
333
- y(e(G), { size: "sm" }, {
334
- default: b(() => [
335
- y(e(N), {
336
+ footer: w(() => [
337
+ h(e(be), { size: "sm" }, {
338
+ default: w(() => [
339
+ h(e(X), {
336
340
  variant: "outline",
337
- onClick: d[1] || (d[1] = (l) => e(c)())
341
+ onClick: u[1] || (u[1] = (r) => e(f)())
338
342
  }, {
339
- default: b(() => [
340
- F(z(e(i)("manager.cancel")), 1)
343
+ default: w(() => [
344
+ S(D(e(o)("manager.cancel")), 1)
341
345
  ]),
342
346
  _: 1
343
347
  }),
344
- y(e(N), {
348
+ h(e(X), {
345
349
  type: "primary",
346
- disabled: a.value.trim() === "",
350
+ disabled: t.value.trim() === "",
347
351
  onClick: x
348
352
  }, {
349
- default: b(() => [
350
- F(z(t.confirmText ?? e(i)("manager.save")), 1)
353
+ default: w(() => [
354
+ S(D(a.confirmText ?? e(o)("manager.save")), 1)
351
355
  ]),
352
356
  _: 1
353
357
  }, 8, ["disabled"])
@@ -355,17 +359,17 @@ const ve = /* @__PURE__ */ R({
355
359
  _: 1
356
360
  })
357
361
  ]),
358
- default: b(() => [
359
- E("div", {
362
+ default: w(() => [
363
+ $("div", {
360
364
  ref_key: "input",
361
- ref: u
365
+ ref: p
362
366
  }, [
363
- y(e(j), {
364
- modelValue: a.value,
365
- "onUpdate:modelValue": d[0] || (d[0] = (l) => a.value = l),
366
- placeholder: t.label ?? e(i)("manager.folder-name"),
367
- "aria-label": t.label ?? e(i)("manager.folder-name"),
368
- onKeyup: qe(x, ["enter"])
367
+ h(e(j), {
368
+ modelValue: t.value,
369
+ "onUpdate:modelValue": u[0] || (u[0] = (r) => t.value = r),
370
+ placeholder: a.label ?? e(o)("manager.folder-name"),
371
+ "aria-label": a.label ?? e(o)("manager.folder-name"),
372
+ onKeyup: Ne(x, ["enter"])
369
373
  }, null, 8, ["modelValue", "placeholder", "aria-label"])
370
374
  ], 512)
371
375
  ]),
@@ -373,72 +377,73 @@ const ve = /* @__PURE__ */ R({
373
377
  }, 8, ["open", "title"]));
374
378
  }
375
379
  });
376
- function lt(t) {
377
- const r = `${t.apiPath}/media`, g = (n) => n.data;
380
+ function we(a) {
381
+ const c = `${a.apiPath}/media`, m = (l) => l.data;
378
382
  return {
379
- directories: () => t.http.get(`${r}/directories`).then(g),
380
- createDirectory: (n, c) => t.http.post(`${r}/directories`, { parent_id: n, title: c }).then(g),
381
- renameDirectory: (n, c) => t.http.patch(`${r}/directories/${n}`, { title: c }).then(g),
382
- moveDirectory: (n, c) => t.http.patch(`${r}/directories/${n}/move`, { parent_id: c }).then(g),
383
- deleteDirectory: (n, c = !1) => t.http.delete(`${r}/directories/${n}`, {
384
- query: { force: c ? 1 : void 0 }
383
+ directories: () => a.http.get(`${c}/directories`).then(m),
384
+ createDirectory: (l, f) => a.http.post(`${c}/directories`, { parent_id: l, title: f }).then(m),
385
+ renameDirectory: (l, f) => a.http.patch(`${c}/directories/${l}`, { title: f }).then(m),
386
+ moveDirectory: (l, f) => a.http.patch(`${c}/directories/${l}/move`, { parent_id: f }).then(m),
387
+ deleteDirectory: (l, f = !1) => a.http.delete(`${c}/directories/${l}`, {
388
+ query: { force: f ? 1 : void 0 }
385
389
  }),
386
- files: (n = {}) => t.http.get(`${r}/files`, {
390
+ files: (l = {}) => a.http.get(`${c}/files`, {
387
391
  query: {
388
- directory_id: n.directory_id ?? void 0,
389
- q: n.q || void 0,
390
- type: n.type ?? void 0,
391
- sort: n.sort,
392
- page: n.page,
393
- per_page: n.per_page
392
+ directory_id: l.directory_id ?? void 0,
393
+ q: l.q || void 0,
394
+ type: l.type ?? void 0,
395
+ sort: l.sort,
396
+ page: l.page,
397
+ per_page: l.per_page
394
398
  }
395
399
  }),
396
- file: (n) => t.http.get(`${r}/files/${n}`).then(g),
397
- async upload(n, c, i) {
398
- const a = new FormData();
399
- return a.append("directory_id", String(n)), c.forEach((u) => a.append("files[]", u)), new Promise((u, x) => {
400
- const p = new XMLHttpRequest();
401
- p.open("POST", `${r}/files`), p.responseType = "json", p.withCredentials = !0, p.setRequestHeader("Accept", "application/json"), p.setRequestHeader("X-Requested-With", "XMLHttpRequest"), p.setRequestHeader("X-Webx-Locale", t.i18n.state.locale);
402
- const d = nt();
403
- d && p.setRequestHeader("X-XSRF-TOKEN", d), p.upload.addEventListener("progress", (l) => {
404
- l.lengthComputable && i?.(Math.round(l.loaded / l.total * 100));
405
- }), p.addEventListener("load", () => {
406
- const l = p.response;
407
- if (p.status >= 200 && p.status < 300 && l?.data) {
408
- u(l.data);
400
+ file: (l) => a.http.get(`${c}/files/${l}`).then(m),
401
+ fileByPath: (l) => a.http.get(`${c}/files/by-path?path=${encodeURIComponent(l)}`).then(m).catch(() => null),
402
+ async upload(l, f, o) {
403
+ const t = new FormData();
404
+ return t.append("directory_id", String(l)), f.forEach((p) => t.append("files[]", p)), new Promise((p, x) => {
405
+ const g = new XMLHttpRequest();
406
+ g.open("POST", `${c}/files`), g.responseType = "json", g.withCredentials = !0, g.setRequestHeader("Accept", "application/json"), g.setRequestHeader("X-Requested-With", "XMLHttpRequest"), g.setRequestHeader("X-Webx-Locale", a.i18n.state.locale);
407
+ const u = st();
408
+ u && g.setRequestHeader("X-XSRF-TOKEN", u), g.upload.addEventListener("progress", (r) => {
409
+ r.lengthComputable && o?.(Math.round(r.loaded / r.total * 100));
410
+ }), g.addEventListener("load", () => {
411
+ const r = g.response;
412
+ if (g.status >= 200 && g.status < 300 && r?.data) {
413
+ p(r.data);
409
414
  return;
410
415
  }
411
416
  x(
412
- Object.assign(new Error(l?.message ?? "Upload failed"), {
413
- status: p.status,
414
- body: l
417
+ Object.assign(new Error(r?.message ?? "Upload failed"), {
418
+ status: g.status,
419
+ body: r
415
420
  })
416
421
  );
417
- }), p.addEventListener("error", () => x(new Error("Upload failed"))), p.send(a);
422
+ }), g.addEventListener("error", () => x(new Error("Upload failed"))), g.send(t);
418
423
  });
419
424
  },
420
- rename: (n, c) => t.http.patch(`${r}/files/${n}`, { name: c }).then(g),
421
- move: (n, c) => t.http.post(`${r}/files/move`, { ids: n, directory_id: c }).then((i) => i.data.moved),
425
+ rename: (l, f) => a.http.patch(`${c}/files/${l}`, { name: f }).then(m),
426
+ move: (l, f) => a.http.post(`${c}/files/move`, { ids: l, directory_id: f }).then((o) => o.data.moved),
422
427
  // A POST for the batch, not a DELETE: the panel's own client sends no body on DELETE, and
423
428
  // a list of ids in a query string is a worse answer than an honest verb.
424
- remove: (n) => t.http.post(`${r}/files/delete`, { ids: n }).then((c) => c.data.deleted),
425
- removeOne: (n) => t.http.delete(`${r}/files/${n}`),
426
- edit: (n, c) => t.http.post(`${r}/files/${n}/edit`, c).then(g),
427
- copy: (n) => t.http.post(`${r}/files/${n}/copy`).then(g),
428
- restoreOriginal: (n) => t.http.post(`${r}/files/${n}/restore-original`).then(g),
429
- thumb(n, c, i, a = "cover") {
430
- if (!n.thumb)
429
+ remove: (l) => a.http.post(`${c}/files/delete`, { ids: l }).then((f) => f.data.deleted),
430
+ removeOne: (l) => a.http.delete(`${c}/files/${l}`),
431
+ edit: (l, f) => a.http.post(`${c}/files/${l}/edit`, f).then(m),
432
+ copy: (l) => a.http.post(`${c}/files/${l}/copy`).then(m),
433
+ restoreOriginal: (l) => a.http.post(`${c}/files/${l}/restore-original`).then(m),
434
+ thumb(l, f, o, t = "cover") {
435
+ if (!l.thumb)
431
436
  return null;
432
- const u = new URL(n.thumb, window.location.origin);
433
- return u.searchParams.set("w", String(c)), i && u.searchParams.set("h", String(i)), u.searchParams.set("fit", a), u.pathname + u.search;
437
+ const p = new URL(l.thumb, window.location.origin);
438
+ return p.searchParams.set("w", String(f)), o && p.searchParams.set("h", String(o)), p.searchParams.set("fit", t), p.pathname + p.search;
434
439
  }
435
440
  };
436
441
  }
437
- function nt() {
438
- const t = document.cookie.split("; ").find((r) => r.startsWith("XSRF-TOKEN="));
439
- return t ? decodeURIComponent(t.slice(11)) : null;
442
+ function st() {
443
+ const a = document.cookie.split("; ").find((c) => c.startsWith("XSRF-TOKEN="));
444
+ return a ? decodeURIComponent(a.slice(11)) : null;
440
445
  }
441
- const ot = {
446
+ const dt = {
442
447
  module: {
443
448
  title: "Files"
444
449
  },
@@ -479,13 +484,48 @@ const ot = {
479
484
  "status-selected": "selected: :count",
480
485
  "status-size": "size: :size"
481
486
  },
487
+ // The picture field on a form, which is the module used from outside its own section.
488
+ field: {
489
+ select: "Choose a picture",
490
+ edit: "Captions",
491
+ replace: "Replace",
492
+ captions: "Captions",
493
+ "alt-hint": "What is on the picture, for a reader who cannot see it",
494
+ "title-hint": "A caption shown on hover",
495
+ "no-preview": "No preview",
496
+ "clear-title": "Clear the field?",
497
+ "clear-text": "The file stays in the library — only this record stops using it.",
498
+ "clear-confirm": "Clear"
499
+ },
500
+ // The image editor is a component of the design system, so its words are props rather than
501
+ // lines in the dictionary — the manager hands it these when it opens it.
502
+ editor: {
503
+ title: "Edit picture",
504
+ save: "Save",
505
+ cancel: "Cancel",
506
+ reset: "Reset",
507
+ "rotate-left": "Turn left",
508
+ "rotate-right": "Turn right",
509
+ "flip-horizontal": "Mirror across",
510
+ "flip-vertical": "Mirror down",
511
+ ratio: "Ratio",
512
+ crop: "Crop",
513
+ output: "Output",
514
+ "output-hint": "The size of the picture you will get",
515
+ width: "Width",
516
+ height: "Height",
517
+ free: "Free",
518
+ original: "Original",
519
+ error: "This picture could not be loaded"
520
+ },
482
521
  dialogs: {
483
522
  "delete-files-title": "Delete :count file(s)?",
484
523
  "delete-files-text": "Anywhere they are already used, they will stop opening.",
485
524
  "delete-folder-title": "Delete the folder :title?",
486
525
  "delete-folder-contents": "It holds :files file(s) and :directories folder(s).",
487
526
  "delete-folder-warning": "Everything inside goes too, and pictures already placed in content will stop opening.",
488
- confirm: "Delete"
527
+ confirm: "Delete",
528
+ "delete-file": "Delete :name?"
489
529
  },
490
530
  errors: {
491
531
  "directory-not-empty": "This folder is not empty.",
@@ -508,478 +548,604 @@ const ot = {
508
548
  directory_id: "folder",
509
549
  files: "files"
510
550
  }
511
- }, fe = /* @__PURE__ */ new WeakSet();
512
- function we() {
551
+ }, ye = /* @__PURE__ */ new WeakSet();
552
+ function xe() {
513
553
  try {
514
- const { i18n: t } = ye();
515
- fe.has(t) || (t.defaults("webx-media", ot), fe.add(t));
554
+ const { i18n: a } = ie();
555
+ ye.has(a) || (a.defaults("webx-media", dt), ye.add(a));
516
556
  } catch {
517
557
  }
518
558
  }
519
- const it = {
559
+ const ut = {
520
560
  key: 0,
521
561
  class: "wx-media__folders"
522
- }, rt = { class: "wx-media__files" }, st = { class: "wx-media__status" }, dt = { key: 0 }, ut = { class: "wx-media__drawer" }, he = /* @__PURE__ */ R({
562
+ }, ct = { class: "wx-media__files" }, mt = ["accept"], pt = { class: "wx-media__status" }, ft = { key: 0 }, vt = { class: "wx-media__drawer" }, ke = /* @__PURE__ */ E({
523
563
  __name: "MediaManager",
524
564
  props: {
525
565
  picking: { type: Boolean, default: !1 },
526
566
  accept: { default: null }
527
567
  },
528
568
  emits: ["pick"],
529
- setup(t, { emit: r }) {
530
- const g = t, n = r, c = ye(), i = lt(c);
531
- we();
532
- const a = S("webx-media"), u = Z("root"), x = He(u), p = C(() => x.value > 0 && x.value < 640), d = _([]), l = _(null), f = _(null), m = _([]), w = _(""), B = _(g.accept ?? "all"), X = _("-created_at"), J = _(!1), A = _(!1), ne = Z("picker"), xe = C(() => f.value?.data ?? []), I = C(() => c.can("media.manage")), ke = C(() => c.can("media.upload") || I.value), D = C(() => We(l.value));
533
- ge(V), H([l, B, X], () => U(1)), H(
534
- w,
535
- Re(() => U(1), 300)
536
- ), H(p, (s) => {
537
- s || (A.value = !1);
569
+ setup(a, { emit: c }) {
570
+ const m = a, l = c, f = ie(), o = we(f);
571
+ xe();
572
+ const t = B("webx-media");
573
+ function p() {
574
+ return {
575
+ title: t("editor.title"),
576
+ saveLabel: t("editor.save"),
577
+ cancelLabel: t("editor.cancel"),
578
+ resetLabel: t("editor.reset"),
579
+ rotateLeftLabel: t("editor.rotate-left"),
580
+ rotateRightLabel: t("editor.rotate-right"),
581
+ flipHorizontalLabel: t("editor.flip-horizontal"),
582
+ flipVerticalLabel: t("editor.flip-vertical"),
583
+ ratioLabel: t("editor.ratio"),
584
+ cropLabel: t("editor.crop"),
585
+ outputLabel: t("editor.output"),
586
+ outputHint: t("editor.output-hint"),
587
+ widthLabel: t("editor.width"),
588
+ heightLabel: t("editor.height"),
589
+ freeLabel: t("editor.free"),
590
+ originalLabel: t("editor.original"),
591
+ errorText: t("editor.error")
592
+ };
593
+ }
594
+ const x = ee("root"), g = Ge(x), u = W(() => g.value > 0 && g.value < 640), r = M([]), v = M(null), i = M(null), d = M([]), _ = M(""), P = M(m.accept ?? "all");
595
+ q(
596
+ () => m.accept,
597
+ (s) => {
598
+ P.value = s ?? "all";
599
+ }
600
+ );
601
+ const I = M("-created_at"), J = M(!1), H = M(!1), oe = ee("picker"), _e = W(() => i.value?.data ?? []), K = W(() => f.can("media.manage")), Ce = W(() => f.can("media.upload") || K.value), U = W(() => Ve(v.value));
602
+ he(V), q([v, P, I], () => R(1)), q(
603
+ _,
604
+ Fe(() => R(1), 300)
605
+ ), q(u, (s) => {
606
+ s || (H.value = !1);
538
607
  });
539
608
  async function V() {
540
- d.value = await i.directories(), l.value ??= d.value[0]?.id ?? null, await U(1);
609
+ r.value = await o.directories(), v.value ??= r.value[0]?.id ?? null, await R(1);
541
610
  }
542
- async function U(s = f.value?.meta.current_page ?? 1) {
611
+ async function R(s = i.value?.meta.current_page ?? 1) {
543
612
  J.value = !0;
544
613
  try {
545
- f.value = await i.files({
546
- directory_id: w.value ? null : l.value,
547
- q: w.value,
548
- type: B.value === "all" ? null : B.value,
549
- sort: X.value,
614
+ i.value = await o.files({
615
+ directory_id: _.value ? null : v.value,
616
+ q: _.value,
617
+ type: P.value === "all" ? null : P.value,
618
+ sort: I.value,
550
619
  page: s
551
- }), m.value = [];
620
+ }), d.value = [];
552
621
  } finally {
553
622
  J.value = !1;
554
623
  }
555
624
  }
556
- function $e() {
557
- ne.value?.click();
625
+ function Me() {
626
+ oe.value?.click();
558
627
  }
559
- async function _e(s) {
560
- const o = s.target, v = Array.from(o.files ?? []);
561
- if (o.value = "", !(v.length === 0 || l.value === null))
628
+ async function Te(s) {
629
+ const n = s.target, y = Array.from(n.files ?? []);
630
+ if (n.value = "", !(y.length === 0 || v.value === null))
562
631
  try {
563
- const $ = await i.upload(l.value, v), q = $.filter((Fe) => Fe.duplicate).length;
564
- $.length > q && O.success(a("manager.uploaded", { count: $.length - q })), q > 0 && O.info(a("manager.duplicate-added")), await Promise.all([V(), U(1)]);
565
- } catch ($) {
566
- O.danger(ue($) ?? a("errors.upload"));
632
+ const C = await o.upload(v.value, y), O = C.filter((Se) => Se.duplicate).length;
633
+ C.length > O && N.success(t("manager.uploaded", { count: C.length - O })), O > 0 && N.info(t("manager.duplicate-added")), await Promise.all([V(), R(1)]);
634
+ } catch (C) {
635
+ N.danger(ce(C) ?? t("errors.upload"));
567
636
  }
568
637
  }
569
- const oe = Y(at);
570
- async function ie() {
571
- const s = await oe({
572
- title: a("manager.new-folder"),
573
- confirmText: a("manager.new-folder")
638
+ const ne = Y(rt);
639
+ async function re() {
640
+ const s = await ne({
641
+ title: t("manager.new-folder"),
642
+ confirmText: t("manager.new-folder")
574
643
  });
575
- s === void 0 || l.value === null || (await i.createDirectory(l.value, s), await V());
644
+ s === void 0 || v.value === null || (await o.createDirectory(v.value, s), await V());
576
645
  }
577
- async function re() {
578
- const s = D.value;
646
+ async function se() {
647
+ const s = U.value;
579
648
  if (!s || s.is_root)
580
649
  return;
581
- const o = await oe({
582
- title: a("manager.rename"),
650
+ const n = await ne({
651
+ title: t("manager.rename"),
583
652
  value: s.title,
584
- confirmText: a("manager.save")
653
+ confirmText: t("manager.save")
585
654
  });
586
- o !== void 0 && (await i.renameDirectory(s.id, o), await V());
655
+ n !== void 0 && (await o.renameDirectory(s.id, n), await V());
587
656
  }
588
- async function se() {
589
- const s = D.value;
657
+ async function de() {
658
+ const s = U.value;
590
659
  if (!(!s || s.is_root)) {
591
660
  try {
592
- await i.deleteDirectory(s.id);
593
- } catch (o) {
594
- const v = Ve(o);
595
- if (!v)
596
- throw o;
597
- if (!await pe({
598
- title: a("dialogs.delete-folder-title", { title: s.title }),
599
- message: `${a("dialogs.delete-folder-contents", v)} ${a("dialogs.delete-folder-warning")}`,
600
- confirmText: a("dialogs.confirm"),
601
- cancelText: a("manager.cancel"),
661
+ await o.deleteDirectory(s.id);
662
+ } catch (n) {
663
+ const y = Ee(n);
664
+ if (!y)
665
+ throw n;
666
+ if (!await ve({
667
+ title: t("dialogs.delete-folder-title", { title: s.title }),
668
+ message: `${t("dialogs.delete-folder-contents", y)} ${t("dialogs.delete-folder-warning")}`,
669
+ confirmText: t("dialogs.confirm"),
670
+ cancelText: t("manager.cancel"),
602
671
  tone: "danger"
603
672
  }))
604
673
  return;
605
- await i.deleteDirectory(s.id, !0);
674
+ await o.deleteDirectory(s.id, !0);
606
675
  }
607
- l.value = null, await V();
676
+ v.value = null, await V();
608
677
  }
609
678
  }
610
- async function de(s, o) {
679
+ async function ue(s, n) {
611
680
  try {
612
- await i.moveDirectory(s, o);
613
- } catch (v) {
614
- O.danger(ue(v) ?? a("errors.directory-into-itself"));
681
+ await o.moveDirectory(s, n);
682
+ } catch (y) {
683
+ N.danger(ce(y) ?? t("errors.directory-into-itself"));
615
684
  }
616
685
  await V();
617
686
  }
618
- const Me = Y(tt);
619
- async function Ce() {
620
- const s = await Me({
621
- directories: d.value,
622
- from: l.value,
623
- count: m.value.length
687
+ const ze = Y(nt);
688
+ async function We() {
689
+ const s = await ze({
690
+ directories: r.value,
691
+ from: v.value,
692
+ count: d.value.length
624
693
  });
625
- s !== void 0 && (await i.move([...m.value], s), await Promise.all([V(), U()]));
694
+ s !== void 0 && (await o.move([...d.value], s), await Promise.all([V(), R()]));
626
695
  }
627
- async function Te() {
628
- const s = [...m.value];
629
- await pe({
630
- title: a("dialogs.delete-files-title", { count: s.length }),
631
- message: a("dialogs.delete-files-text"),
632
- confirmText: a("dialogs.confirm"),
633
- cancelText: a("manager.cancel"),
696
+ async function De() {
697
+ const s = [...d.value];
698
+ await ve({
699
+ title: t("dialogs.delete-files-title", { count: s.length }),
700
+ message: t("dialogs.delete-files-text"),
701
+ confirmText: t("dialogs.confirm"),
702
+ cancelText: t("manager.cancel"),
634
703
  tone: "danger"
635
- }) && (await i.remove(s), await Promise.all([V(), U()]));
636
- }
637
- async function ze(s, o) {
638
- await i.rename(s.id, o), await U();
704
+ }) && (await o.remove(s), await Promise.all([V(), R()]));
639
705
  }
640
- async function De(s) {
641
- await i.removeOne(s.id), await Promise.all([V(), U()]);
706
+ async function Le(s, n) {
707
+ await o.rename(s.id, n), await R();
642
708
  }
643
709
  async function Ue(s) {
644
- const o = await Ge({ src: s.url, fileName: s.file_name, filters: !1 });
645
- o && (await i.edit(s.id, {
710
+ await o.removeOne(s.id), await Promise.all([V(), R()]);
711
+ }
712
+ async function Re(s) {
713
+ const n = await Qe({
714
+ src: s.source ?? s.url,
715
+ fileName: s.file_name,
716
+ filters: !1,
717
+ // The editor is a component of the design system: its words are props with English
718
+ // defaults, not lines in the panel's dictionary. Whoever opens it is the one who knows
719
+ // what language the panel is being read in.
720
+ ...p()
721
+ });
722
+ n && (await o.edit(s.id, {
646
723
  // The editor's frame is read against the picture as it is on screen — already turned — and
647
724
  // the server applies the operations in that order for the same reason.
648
- crop: o.crop,
649
- rotate: (o.rotation % 360 + 360) % 360,
650
- flip: o.flipX ? "horizontal" : o.flipY ? "vertical" : void 0,
651
- resize: { width: o.width, height: o.height }
652
- }), await U());
725
+ crop: n.crop,
726
+ rotate: (n.rotation % 360 + 360) % 360,
727
+ flip: n.flipX ? "horizontal" : n.flipY ? "vertical" : void 0,
728
+ resize: { width: n.width, height: n.height }
729
+ }), await R());
653
730
  }
654
- function We(s) {
655
- const o = (v) => {
656
- for (const $ of v) {
657
- if ($.id === s)
658
- return $;
659
- const q = o($.children ?? []);
660
- if (q)
661
- return q;
731
+ function Ve(s) {
732
+ const n = (y) => {
733
+ for (const C of y) {
734
+ if (C.id === s)
735
+ return C;
736
+ const O = n(C.children ?? []);
737
+ if (O)
738
+ return O;
662
739
  }
663
740
  return null;
664
741
  };
665
- return s === null ? null : o(d.value);
742
+ return s === null ? null : n(r.value);
666
743
  }
667
- function Ve(s) {
668
- const o = s?.body;
669
- return o?.code === "directory_not_empty" ? o.counts ?? null : null;
744
+ function Ee(s) {
745
+ const n = s?.body;
746
+ return n?.code === "directory_not_empty" ? n.counts ?? null : null;
670
747
  }
671
- function ue(s) {
748
+ function ce(s) {
672
749
  return s?.message ?? null;
673
750
  }
674
- function Ee(s) {
675
- const o = ["B", "KB", "MB", "GB", "TB"];
676
- let v = s, $ = 0;
677
- for (; v >= 1024 && $ < o.length - 1; )
678
- v /= 1024, $++;
679
- return `${v >= 10 || $ === 0 ? Math.round(v) : v.toFixed(1)} ${o[$]}`;
751
+ function Be(s) {
752
+ const n = ["B", "KB", "MB", "GB", "TB"];
753
+ let y = s, C = 0;
754
+ for (; y >= 1024 && C < n.length - 1; )
755
+ y /= 1024, C++;
756
+ return `${y >= 10 || C === 0 ? Math.round(y) : y.toFixed(1)} ${n[C]}`;
680
757
  }
681
- function Re(s, o) {
682
- let v;
758
+ function Fe(s, n) {
759
+ let y;
683
760
  return () => {
684
- clearTimeout(v), v = setTimeout(s, o);
761
+ clearTimeout(y), y = setTimeout(s, n);
685
762
  };
686
763
  }
687
- return (s, o) => (h(), W("div", {
764
+ return (s, n) => (b(), z("div", {
688
765
  ref_key: "root",
689
- ref: u,
690
- class: Oe(["wx-media", { "wx-media--compact": p.value }])
766
+ ref: x,
767
+ class: Ae(["wx-media", { "wx-media--compact": u.value }])
691
768
  }, [
692
- p.value ? T("", !0) : (h(), W("aside", it, [
693
- y(ve, {
694
- selected: l.value,
695
- "onUpdate:selected": o[0] || (o[0] = (v) => l.value = v),
696
- directories: d.value,
697
- onMove: de
769
+ u.value ? L("", !0) : (b(), z("aside", ut, [
770
+ h(ge, {
771
+ selected: v.value,
772
+ "onUpdate:selected": n[0] || (n[0] = (y) => v.value = y),
773
+ directories: r.value,
774
+ onMove: ue
698
775
  }, null, 8, ["selected", "directories"]),
699
- I.value ? (h(), k(e(ee), {
776
+ K.value ? (b(), k(e(G), {
700
777
  key: 0,
701
778
  size: "sm",
702
779
  align: "start"
703
780
  }, {
704
- default: b(() => [
705
- y(e(M), {
781
+ default: w(() => [
782
+ h(e(T), {
706
783
  type: "add",
707
- title: e(a)("manager.new-folder"),
708
- onClick: ie
784
+ title: e(t)("manager.new-folder"),
785
+ onClick: re
709
786
  }, null, 8, ["title"]),
710
- y(e(M), {
787
+ h(e(T), {
711
788
  type: "edit",
712
- title: e(a)("manager.rename"),
713
- disabled: !D.value || D.value.is_root,
714
- onClick: re
789
+ title: e(t)("manager.rename"),
790
+ disabled: !U.value || U.value.is_root,
791
+ onClick: se
715
792
  }, null, 8, ["title", "disabled"]),
716
- y(e(M), {
793
+ h(e(T), {
717
794
  type: "remove",
718
- title: e(a)("manager.delete"),
719
- disabled: !D.value || D.value.is_root,
720
- onClick: se
795
+ title: e(t)("manager.delete"),
796
+ disabled: !U.value || U.value.is_root,
797
+ onClick: de
721
798
  }, null, 8, ["title", "disabled"])
722
799
  ]),
723
800
  _: 1
724
- })) : T("", !0)
801
+ })) : L("", !0)
725
802
  ])),
726
- E("section", rt, [
727
- y(et, {
728
- search: w.value,
729
- "onUpdate:search": o[1] || (o[1] = (v) => w.value = v),
730
- type: B.value,
731
- "onUpdate:type": o[2] || (o[2] = (v) => B.value = v),
732
- sort: X.value,
733
- "onUpdate:sort": o[3] || (o[3] = (v) => X.value = v),
734
- "can-upload": ke.value && !t.picking,
735
- "can-manage": I.value,
736
- selected: m.value.length,
737
- compact: p.value,
738
- onUpload: $e,
739
- onMove: Ce,
740
- onRemove: Te,
741
- onFolders: o[4] || (o[4] = (v) => A.value = !0)
742
- }, null, 8, ["search", "type", "sort", "can-upload", "can-manage", "selected", "compact"]),
743
- E("input", {
803
+ $("section", ct, [
804
+ h(ot, {
805
+ search: _.value,
806
+ "onUpdate:search": n[1] || (n[1] = (y) => _.value = y),
807
+ type: P.value,
808
+ "onUpdate:type": n[2] || (n[2] = (y) => P.value = y),
809
+ sort: I.value,
810
+ "onUpdate:sort": n[3] || (n[3] = (y) => I.value = y),
811
+ "can-upload": Ce.value,
812
+ "fixed-type": a.accept !== null,
813
+ "can-manage": K.value,
814
+ selected: d.value.length,
815
+ compact: u.value,
816
+ onUpload: Me,
817
+ onMove: We,
818
+ onRemove: De,
819
+ onFolders: n[4] || (n[4] = (y) => H.value = !0)
820
+ }, null, 8, ["search", "type", "sort", "can-upload", "fixed-type", "can-manage", "selected", "compact"]),
821
+ $("input", {
744
822
  ref_key: "picker",
745
- ref: ne,
823
+ ref: oe,
746
824
  type: "file",
747
825
  multiple: "",
748
826
  hidden: "",
749
- onChange: _e
750
- }, null, 544),
751
- y(Qe, {
752
- selected: m.value,
753
- "onUpdate:selected": o[5] || (o[5] = (v) => m.value = v),
754
- files: xe.value,
755
- api: e(i),
756
- query: w.value,
757
- single: t.picking,
758
- onRename: ze,
759
- onEdit: Ue,
760
- onRemove: De,
761
- onOpen: o[6] || (o[6] = (v) => n("pick", v))
827
+ accept: a.accept === null ? void 0 : `${a.accept}/*`,
828
+ onChange: Te
829
+ }, null, 40, mt),
830
+ h(lt, {
831
+ selected: d.value,
832
+ "onUpdate:selected": n[5] || (n[5] = (y) => d.value = y),
833
+ files: _e.value,
834
+ api: e(o),
835
+ query: _.value,
836
+ single: a.picking,
837
+ onRename: Le,
838
+ onEdit: Re,
839
+ onRemove: Ue,
840
+ onOpen: n[6] || (n[6] = (y) => l("pick", y))
762
841
  }, null, 8, ["selected", "files", "api", "query", "single"]),
763
- E("footer", st, [
764
- E("span", null, z(e(a)("manager.status-files", { count: f.value?.stats.files ?? 0 })), 1),
765
- m.value.length > 0 ? (h(), W("span", dt, z(e(a)("manager.status-selected", { count: m.value.length })), 1)) : T("", !0),
766
- E("span", null, z(e(a)("manager.status-size", { size: Ee(f.value?.stats.size ?? 0) })), 1)
842
+ $("footer", pt, [
843
+ $("span", null, D(e(t)("manager.status-files", { count: i.value?.stats.files ?? 0 })), 1),
844
+ d.value.length > 0 ? (b(), z("span", ft, D(e(t)("manager.status-selected", { count: d.value.length })), 1)) : L("", !0),
845
+ $("span", null, D(e(t)("manager.status-size", { size: Be(i.value?.stats.size ?? 0) })), 1)
767
846
  ]),
768
- f.value && f.value.meta.last_page > 1 ? (h(), k(e(Ke), {
847
+ i.value && i.value.meta.last_page > 1 ? (b(), k(e(Ye), {
769
848
  key: 0,
770
- page: f.value.meta.current_page,
771
- "per-page": f.value.meta.per_page,
772
- total: f.value.meta.total,
773
- "last-page": f.value.meta.last_page,
849
+ page: i.value.meta.current_page,
850
+ "per-page": i.value.meta.per_page,
851
+ total: i.value.meta.total,
852
+ "last-page": i.value.meta.last_page,
774
853
  disabled: J.value,
775
854
  size: "sm",
776
- onChange: o[7] || (o[7] = ({ page: v }) => U(v))
777
- }, null, 8, ["page", "per-page", "total", "last-page", "disabled"])) : T("", !0)
855
+ onChange: n[7] || (n[7] = ({ page: y }) => R(y))
856
+ }, null, 8, ["page", "per-page", "total", "last-page", "disabled"])) : L("", !0)
778
857
  ]),
779
- y(e(je), {
780
- open: A.value,
781
- "onUpdate:open": o[10] || (o[10] = (v) => A.value = v),
858
+ h(e(Je), {
859
+ open: H.value,
860
+ "onUpdate:open": n[10] || (n[10] = (y) => H.value = y),
782
861
  side: "left",
783
- title: e(a)("manager.folders"),
862
+ title: e(t)("manager.folders"),
784
863
  size: 280
785
864
  }, {
786
- default: b(() => [
787
- E("div", ut, [
788
- y(ve, {
789
- selected: l.value,
865
+ default: w(() => [
866
+ $("div", vt, [
867
+ h(ge, {
868
+ selected: v.value,
790
869
  "onUpdate:selected": [
791
- o[8] || (o[8] = (v) => l.value = v),
792
- o[9] || (o[9] = (v) => A.value = !1)
870
+ n[8] || (n[8] = (y) => v.value = y),
871
+ n[9] || (n[9] = (y) => H.value = !1)
793
872
  ],
794
- directories: d.value,
795
- onMove: de
873
+ directories: r.value,
874
+ onMove: ue
796
875
  }, null, 8, ["selected", "directories"]),
797
- I.value ? (h(), k(e(ee), {
876
+ K.value ? (b(), k(e(G), {
798
877
  key: 0,
799
878
  size: "sm",
800
879
  align: "start"
801
880
  }, {
802
- default: b(() => [
803
- y(e(M), {
881
+ default: w(() => [
882
+ h(e(T), {
804
883
  type: "add",
805
- title: e(a)("manager.new-folder"),
806
- onClick: ie
884
+ title: e(t)("manager.new-folder"),
885
+ onClick: re
807
886
  }, null, 8, ["title"]),
808
- y(e(M), {
887
+ h(e(T), {
809
888
  type: "edit",
810
- title: e(a)("manager.rename"),
811
- disabled: !D.value || D.value.is_root,
812
- onClick: re
889
+ title: e(t)("manager.rename"),
890
+ disabled: !U.value || U.value.is_root,
891
+ onClick: se
813
892
  }, null, 8, ["title", "disabled"]),
814
- y(e(M), {
893
+ h(e(T), {
815
894
  type: "remove",
816
- title: e(a)("manager.delete"),
817
- disabled: !D.value || D.value.is_root,
818
- onClick: se
895
+ title: e(t)("manager.delete"),
896
+ disabled: !U.value || U.value.is_root,
897
+ onClick: de
819
898
  }, null, 8, ["title", "disabled"])
820
899
  ]),
821
900
  _: 1
822
- })) : T("", !0)
901
+ })) : L("", !0)
823
902
  ])
824
903
  ]),
825
904
  _: 1
826
905
  }, 8, ["open", "title"])
827
906
  ], 2));
828
907
  }
829
- }), ct = /* @__PURE__ */ R({
908
+ }), gt = /* @__PURE__ */ E({
830
909
  __name: "MediaPage",
831
- setup(t) {
832
- return (r, g) => (h(), k(e(Ye), {
910
+ setup(a) {
911
+ return (c, m) => (b(), k(e(Ze), {
833
912
  class: "wx-media-page",
834
913
  padding: "md"
835
914
  }, {
836
- default: b(() => [
837
- y(he)
915
+ default: w(() => [
916
+ h(ke)
838
917
  ]),
839
918
  _: 1
840
919
  }));
841
920
  }
842
- }), mt = { class: "wx-media-picker" }, be = /* @__PURE__ */ R({
921
+ }), yt = { class: "wx-media-picker" }, $e = /* @__PURE__ */ E({
843
922
  __name: "MediaPicker",
844
923
  props: {
845
924
  accept: { default: "image" },
846
925
  title: { default: void 0 },
847
926
  manage: { type: Boolean, default: !1 }
848
927
  },
849
- setup(t) {
850
- const { open: r, resolve: g } = ae(), n = S("webx-media");
851
- return (c, i) => (h(), k(e(le), {
852
- open: e(r),
853
- "onUpdate:open": i[1] || (i[1] = (a) => te(r) ? r.value = a : null),
854
- title: t.title ?? e(n)("module.title"),
928
+ setup(a) {
929
+ const { open: c, resolve: m } = ae(), l = B("webx-media");
930
+ return (f, o) => (b(), k(e(le), {
931
+ open: e(c),
932
+ "onUpdate:open": o[1] || (o[1] = (t) => te(c) ? c.value = t : null),
933
+ title: a.title ?? e(l)("module.title"),
855
934
  width: 960
856
935
  }, {
857
- default: b(() => [
858
- E("div", mt, [
859
- y(he, {
860
- picking: !t.manage,
861
- accept: t.manage ? null : t.accept,
862
- onPick: i[0] || (i[0] = (a) => e(g)(a))
936
+ default: w(() => [
937
+ $("div", yt, [
938
+ h(ke, {
939
+ picking: !a.manage,
940
+ accept: a.manage ? null : a.accept,
941
+ onPick: o[0] || (o[0] = (t) => e(m)(t))
863
942
  }, null, 8, ["picking", "accept"])
864
943
  ])
865
944
  ]),
866
945
  _: 1
867
946
  }, 8, ["open", "title"]));
868
947
  }
869
- }), pt = Y(be), bt = Y(
870
- be,
948
+ }), ht = Y($e), Ut = Y(
949
+ $e,
871
950
  { props: { manage: !0 } }
872
- ), vt = { class: "wx-media-field" }, ft = {
951
+ ), bt = { class: "wx-media-field" }, wt = {
873
952
  key: 0,
874
953
  class: "wx-media-field__label"
875
- }, gt = { class: "wx-media-field__body" }, xt = /* @__PURE__ */ R({
954
+ }, xt = ["disabled"], kt = ["disabled", "title"], $t = {
955
+ key: 1,
956
+ class: "wx-media-field__missing"
957
+ }, _t = {
958
+ key: 0,
959
+ class: "wx-media-field__bar"
960
+ }, Ct = { class: "wx-media-field__captions" }, Mt = { class: "wx-media-field__caption" }, Tt = { class: "wx-media-field__caption" }, zt = { class: "wx-media-field__captions-footer" }, Rt = /* @__PURE__ */ E({
876
961
  __name: "MediaField",
877
- props: /* @__PURE__ */ P({
962
+ props: /* @__PURE__ */ F({
878
963
  label: { default: void 0 },
879
964
  accept: { default: "image" },
880
- captions: { type: Boolean, default: !0 }
965
+ captions: { type: Boolean, default: !0 },
966
+ height: { default: 220 },
967
+ disabled: { type: Boolean, default: !1 }
881
968
  }, {
882
969
  modelValue: { default: null },
883
970
  modelModifiers: {}
884
971
  }),
885
972
  emits: ["update:modelValue"],
886
- setup(t) {
887
- const r = L(t, "modelValue");
888
- we();
889
- const g = S("webx-media"), n = C(() => r.value?.url ?? null);
890
- async function c() {
891
- const a = await pt({ accept: "image" });
892
- a && (r.value = { ...r.value, path: a.path, url: a.url });
973
+ setup(a) {
974
+ const c = a, m = A(a, "modelValue");
975
+ xe();
976
+ const l = B("webx-media"), f = we(ie()), o = M(!1), t = M({});
977
+ q(
978
+ () => m.value?.path,
979
+ async (i) => {
980
+ if (!i || m.value?.url || t.value[i]) return;
981
+ const d = await f.fileByPath(i);
982
+ d && (t.value = { ...t.value, [i]: d.url });
983
+ },
984
+ { immediate: !0 }
985
+ );
986
+ const p = W(() => {
987
+ const i = m.value;
988
+ return i ? i.url ?? t.value[i.path] ?? null : null;
989
+ }), x = W(() => ({
990
+ height: typeof c.height == "number" ? `${c.height}px` : c.height
991
+ }));
992
+ function g(i) {
993
+ return m.value?.[i] ?? {};
893
994
  }
894
- function i() {
895
- r.value = null;
995
+ function u(i, d) {
996
+ m.value && (m.value = { ...m.value, [i]: d });
896
997
  }
897
- return (a, u) => (h(), W("div", vt, [
898
- t.label ? (h(), W("span", ft, z(t.label), 1)) : T("", !0),
899
- E("div", gt, [
900
- n.value ? (h(), k(e(Je), {
901
- key: 0,
902
- class: "wx-media-field__preview",
903
- src: n.value,
904
- fit: "cover"
905
- }, null, 8, ["src"])) : T("", !0),
906
- y(e(G), {
907
- direction: "vertical",
908
- size: "sm",
909
- class: "wx-media-field__controls"
910
- }, {
911
- default: b(() => [
912
- y(e(G), { size: "xs" }, {
913
- default: b(() => [
914
- y(e(N), {
915
- size: "sm",
916
- icon: "image",
917
- onClick: c
918
- }, {
919
- default: b(() => [
920
- F(z(e(g)("manager.select")), 1)
921
- ]),
922
- _: 1
923
- }),
924
- r.value ? (h(), k(e(N), {
925
- key: 0,
926
- size: "sm",
927
- variant: "text",
928
- type: "danger",
929
- onClick: i
930
- }, {
931
- default: b(() => [
932
- F(z(e(g)("manager.delete")), 1)
933
- ]),
934
- _: 1
935
- })) : T("", !0)
936
- ]),
937
- _: 1
938
- }),
939
- t.captions && r.value ? (h(), W(K, { key: 0 }, [
940
- y(e(j), {
941
- "model-value": r.value.alt ?? "",
942
- size: "sm",
943
- placeholder: "alt",
944
- "onUpdate:modelValue": u[0] || (u[0] = (x) => r.value = { ...r.value, alt: String(x) })
945
- }, null, 8, ["model-value"]),
946
- y(e(j), {
947
- "model-value": r.value.title ?? "",
948
- size: "sm",
949
- placeholder: "title",
950
- "onUpdate:modelValue": u[1] || (u[1] = (x) => r.value = { ...r.value, title: String(x) })
951
- }, null, 8, ["model-value"])
952
- ], 64)) : T("", !0)
953
- ]),
954
- _: 1
955
- })
956
- ])
998
+ async function r() {
999
+ if (c.disabled) return;
1000
+ const i = await ht({ accept: c.accept });
1001
+ i && (m.value = { ...m.value, path: i.path, url: i.url });
1002
+ }
1003
+ function v() {
1004
+ m.value = null, o.value = !1;
1005
+ }
1006
+ return (i, d) => (b(), z("div", bt, [
1007
+ a.label ? (b(), z("span", wt, D(a.label), 1)) : L("", !0),
1008
+ m.value ? (b(), z("div", {
1009
+ key: 2,
1010
+ class: "wx-media-field__frame",
1011
+ style: me(x.value)
1012
+ }, [
1013
+ $("button", {
1014
+ type: "button",
1015
+ class: "wx-media-field__picture",
1016
+ disabled: a.disabled,
1017
+ title: e(l)("field.replace"),
1018
+ onClick: r
1019
+ }, [
1020
+ p.value ? (b(), k(e(et), {
1021
+ key: 0,
1022
+ src: p.value,
1023
+ fit: "contain",
1024
+ width: "100%",
1025
+ height: "100%"
1026
+ }, null, 8, ["src"])) : (b(), z("span", $t, D(e(l)("field.no-preview")), 1))
1027
+ ], 8, kt),
1028
+ a.disabled ? L("", !0) : (b(), z("div", _t, [
1029
+ h(e(G), { size: "sm" }, {
1030
+ default: w(() => [
1031
+ a.captions ? (b(), k(e(tt), {
1032
+ key: 0,
1033
+ open: o.value,
1034
+ "onUpdate:open": d[3] || (d[3] = (_) => o.value = _),
1035
+ title: e(l)("field.captions"),
1036
+ width: 360,
1037
+ side: "top",
1038
+ teleport: ""
1039
+ }, {
1040
+ trigger: w(() => [
1041
+ h(e(T), {
1042
+ type: "edit",
1043
+ title: e(l)("field.edit")
1044
+ }, null, 8, ["title"])
1045
+ ]),
1046
+ default: w(() => [
1047
+ $("div", Ct, [
1048
+ $("div", Mt, [
1049
+ d[4] || (d[4] = $("label", {
1050
+ class: "wx-media-field__caption-label",
1051
+ for: "wx-media-alt"
1052
+ }, "alt", -1)),
1053
+ h(e(j), {
1054
+ id: "wx-media-alt",
1055
+ localized: "",
1056
+ "model-value": g("alt"),
1057
+ placeholder: e(l)("field.alt-hint"),
1058
+ "onUpdate:modelValue": d[0] || (d[0] = (_) => u("alt", _))
1059
+ }, null, 8, ["model-value", "placeholder"])
1060
+ ]),
1061
+ $("div", Tt, [
1062
+ d[5] || (d[5] = $("label", {
1063
+ class: "wx-media-field__caption-label",
1064
+ for: "wx-media-title"
1065
+ }, "title", -1)),
1066
+ h(e(j), {
1067
+ id: "wx-media-title",
1068
+ localized: "",
1069
+ "model-value": g("title"),
1070
+ placeholder: e(l)("field.title-hint"),
1071
+ "onUpdate:modelValue": d[1] || (d[1] = (_) => u("title", _))
1072
+ }, null, 8, ["model-value", "placeholder"])
1073
+ ]),
1074
+ $("div", zt, [
1075
+ h(e(X), {
1076
+ size: "sm",
1077
+ type: "primary",
1078
+ onClick: d[2] || (d[2] = (_) => o.value = !1)
1079
+ }, {
1080
+ default: w(() => [
1081
+ S(D(e(l)("manager.save")), 1)
1082
+ ]),
1083
+ _: 1
1084
+ })
1085
+ ])
1086
+ ])
1087
+ ]),
1088
+ _: 1
1089
+ }, 8, ["open", "title"])) : L("", !0),
1090
+ h(e(at), {
1091
+ title: e(l)("field.clear-title"),
1092
+ description: e(l)("field.clear-text"),
1093
+ "confirm-text": e(l)("field.clear-confirm"),
1094
+ "cancel-text": e(l)("manager.cancel"),
1095
+ "confirm-type": "danger",
1096
+ side: "top",
1097
+ onConfirm: v
1098
+ }, {
1099
+ trigger: w(() => [
1100
+ h(e(T), {
1101
+ type: "remove",
1102
+ title: e(l)("field.clear-confirm")
1103
+ }, null, 8, ["title"])
1104
+ ]),
1105
+ _: 1
1106
+ }, 8, ["title", "description", "confirm-text", "cancel-text"])
1107
+ ]),
1108
+ _: 1
1109
+ })
1110
+ ]))
1111
+ ], 4)) : (b(), z("div", {
1112
+ key: 1,
1113
+ class: "wx-media-field__frame is-empty",
1114
+ style: me(x.value)
1115
+ }, [
1116
+ $("button", {
1117
+ type: "button",
1118
+ class: "wx-media-field__pick",
1119
+ disabled: a.disabled,
1120
+ onClick: r
1121
+ }, D(e(l)("field.select")), 9, xt)
1122
+ ], 4))
957
1123
  ]));
958
1124
  }
959
1125
  });
960
- function kt(t = {}) {
961
- const r = t.path ?? "/media";
1126
+ function Vt(a = {}) {
1127
+ const c = a.path ?? "/media";
962
1128
  return {
963
1129
  id: "media",
964
- path: r,
1130
+ path: c,
965
1131
  routes: [
966
1132
  {
967
- path: r,
1133
+ path: c,
968
1134
  name: "webx.media",
969
- component: ct
1135
+ component: gt
970
1136
  }
971
1137
  ]
972
1138
  };
973
1139
  }
974
1140
  export {
975
- xt as WxMediaField,
976
- he as WxMediaManager,
977
- ct as WxMediaPage,
978
- be as WxMediaPicker,
979
- lt as createMediaApi,
980
- kt as media,
981
- ot as mediaMessages,
982
- bt as openMediaLibrary,
983
- pt as openMediaPicker
1141
+ Rt as WxMediaField,
1142
+ ke as WxMediaManager,
1143
+ gt as WxMediaPage,
1144
+ $e as WxMediaPicker,
1145
+ we as createMediaApi,
1146
+ Vt as media,
1147
+ dt as mediaMessages,
1148
+ Ut as openMediaLibrary,
1149
+ ht as openMediaPicker
984
1150
  };
985
1151
  //# sourceMappingURL=index.js.map