@m3ui-vue/electron 0.2.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,41 +1,41 @@
1
- import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as ee, createVNode as te, defineComponent as o, getCurrentScope as s, guardReactiveProps as ne, nextTick as re, normalizeClass as c, normalizeProps as ie, normalizeStyle as l, onBeforeUnmount as u, onMounted as d, onScopeDispose as f, openBlock as p, readonly as m, ref as h, renderList as ae, renderSlot as g, toDisplayString as oe, unref as _, watch as v } from "vue";
2
- import { MIcon as y, MMenuBar as b, useLocale as se, useTheme as ce } from "@m3ui-vue/m3ui-vue";
3
- import { t as x } from "./shared-OD5t8cpt.js";
1
+ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, getCurrentScope as l, guardReactiveProps as ee, nextTick as te, normalizeClass as u, normalizeProps as ne, normalizeStyle as d, onBeforeUnmount as f, onMounted as re, onScopeDispose as p, openBlock as m, readonly as h, ref as g, renderList as ie, renderSlot as _, toDisplayString as ae, unref as v, watch as y } from "vue";
2
+ import { MIcon as oe, MMenuBar as se, useLocale as ce, useTheme as le } from "@m3ui-vue/m3ui-vue";
3
+ import { t as b } from "./shared-CmmPhgMH.js";
4
4
  // src/renderer/useElectronWindow.ts
5
- function S() {
6
- return typeof window < "u" ? window[x] : void 0;
5
+ function x() {
6
+ return typeof window < "u" ? window[b] : void 0;
7
7
  }
8
- var C = h(!1), w = h("native"), T = h(""), E = h(40), D = h(!1), O = h(!1), k = h(!0), A = h(null), j = 0, M = null, N = null, P = null;
9
- function F(e) {
10
- D.value = e.maximized, O.value = e.fullscreen, k.value = e.focused;
8
+ var S = g(!1), C = g("native"), w = g(""), T = g(40), E = g(!1), D = g(!1), O = g(!0), k = g(null), A = 0, j = null, M = null, N = null;
9
+ function P(e) {
10
+ E.value = e.maximized, D.value = e.fullscreen, O.value = e.focused;
11
11
  }
12
- function I(e) {
13
- M ||= e.onState(F), N ||= e.onAccent?.((e) => {
14
- A.value = e;
15
- }) ?? null, P ??= e.info().then((e) => {
16
- e && (w.value = e.controls, T.value = e.platform, E.value = e.titleBarHeight, A.value = e.accentColor ?? null, F(e.state), C.value = !0);
12
+ function F(e) {
13
+ j ||= e.onState(P), M ||= e.onAccent?.((e) => {
14
+ k.value = e;
15
+ }) ?? null, N ??= e.info().then((e) => {
16
+ e && (C.value = e.controls, w.value = e.platform, T.value = e.titleBarHeight, k.value = e.accentColor ?? null, P(e.state), S.value = !0);
17
17
  }).catch(() => {
18
- P = null;
18
+ N = null;
19
19
  });
20
20
  }
21
- function L() {
22
- M?.(), M = null, N?.(), N = null;
21
+ function I() {
22
+ j?.(), j = null, M?.(), M = null;
23
23
  }
24
- function R() {
25
- let e = S();
26
- return e && (j++, I(e), s() && f(() => {
27
- --j === 0 && L();
24
+ function ue() {
25
+ let e = x();
26
+ return e && (A++, F(e), l() && p(() => {
27
+ --A === 0 && I();
28
28
  })), {
29
29
  isElectron: !!e,
30
- ready: m(C),
31
- controls: m(w),
32
- platform: m(T),
33
- isMac: t(() => T.value === "darwin"),
34
- titleBarHeight: m(E),
35
- maximized: m(D),
36
- fullscreen: m(O),
37
- focused: m(k),
38
- accentColor: m(A),
30
+ ready: h(S),
31
+ controls: h(C),
32
+ platform: h(w),
33
+ isMac: t(() => w.value === "darwin"),
34
+ titleBarHeight: h(T),
35
+ maximized: h(E),
36
+ fullscreen: h(D),
37
+ focused: h(O),
38
+ accentColor: h(k),
39
39
  minimize: () => e?.action("minimize"),
40
40
  toggleMaximize: () => e?.action("toggle-maximize"),
41
41
  close: () => e?.action("close"),
@@ -43,34 +43,79 @@ function R() {
43
43
  setTheme: (t) => e?.setTheme?.(t),
44
44
  setProgress: (t) => e?.setProgress?.(t),
45
45
  setBadge: (t) => e?.setBadge?.(t),
46
- requestAttention: () => e?.attention?.()
46
+ requestAttention: () => e?.attention?.(),
47
+ canSetNativeMenu: typeof e?.setMenu == "function",
48
+ setNativeMenu: (t) => e?.setMenu?.(t),
49
+ onNativeMenuClick: (t) => e?.onMenuClick?.(t) ?? (() => {})
50
+ };
51
+ }
52
+ // src/renderer/_nativeMenu.ts
53
+ function L(e) {
54
+ if (!e) return;
55
+ let t = e.replace(/([⌘⇧⌥⌃])/g, "$1+").split("+").map((e) => e.trim()).filter(Boolean), n = {
56
+ "⌘": "CmdOrCtrl",
57
+ "⌃": "CmdOrCtrl",
58
+ "⇧": "Shift",
59
+ "⌥": "Alt"
60
+ };
61
+ return t.map((e) => n[e] ?? (/^(ctrl|control|cmd|command)$/i.test(e) ? "CmdOrCtrl" : /^option$/i.test(e) ? "Alt" : e)).join("+");
62
+ }
63
+ function de(e) {
64
+ let t = /* @__PURE__ */ new Map(), n = 1, r = (e, i) => e.map((e) => {
65
+ if (e.divider) return { type: "separator" };
66
+ let a = e.label ?? "";
67
+ if (e.children) return {
68
+ type: "submenu",
69
+ label: a,
70
+ enabled: !e.disabled,
71
+ items: r(e.children, i)
72
+ };
73
+ let o = n++;
74
+ t.set(o, [e, i]);
75
+ let s = e.checked !== void 0 || e.selected !== void 0;
76
+ return {
77
+ type: s ? "checkbox" : "normal",
78
+ id: o,
79
+ label: a,
80
+ enabled: !e.disabled,
81
+ ...s ? { checked: !!(e.checked ?? e.selected) } : {},
82
+ accelerator: L(e.shortcut)
83
+ };
84
+ });
85
+ return {
86
+ data: e.map((e, t) => ({
87
+ label: e.label,
88
+ enabled: !e.disabled,
89
+ items: r(e.items, t)
90
+ })),
91
+ picks: t
47
92
  };
48
93
  }
49
94
  // src/renderer/MTitleBar.vue?vue&type=script&setup=true&lang.ts
50
- var le = ["data-controls"], ue = { class: "m3-title-bar-area" }, de = {
95
+ var fe = ["data-controls"], pe = { class: "m3-title-bar-area" }, me = {
51
96
  key: 0,
52
97
  class: "m3-title-bar-icon"
53
- }, fe = ["src"], pe = { class: "m3-title-bar-start" }, me = { class: "m3-title-bar-title" }, he = { class: "m3-title-bar-text" }, ge = { class: "m3-title-bar-end" }, _e = [
98
+ }, he = ["src"], ge = { class: "m3-title-bar-start" }, _e = { class: "m3-title-bar-title" }, ve = { class: "m3-title-bar-text" }, ye = { class: "m3-title-bar-end" }, be = [
54
99
  "aria-label",
55
100
  "title",
56
101
  "onClick"
57
- ], ve = {
102
+ ], xe = {
58
103
  key: 1,
59
104
  viewBox: "0 0 12 12",
60
105
  "aria-hidden": "true"
61
- }, ye = {
106
+ }, Se = {
62
107
  key: 0,
63
108
  d: "M3.5 3.5l5 5M8.5 3.5l-5 5"
64
- }, be = {
109
+ }, Ce = {
65
110
  key: 1,
66
111
  d: "M3 6h6"
67
- }, xe = {
112
+ }, we = {
68
113
  key: 2,
69
114
  d: "M6 3v6M3 6h6"
70
- }, Se = {
115
+ }, Te = {
71
116
  key: 0,
72
117
  class: "m3-title-bar-menu-row"
73
- }, z = /* @__PURE__ */ o({
118
+ }, R = /* @__PURE__ */ c({
74
119
  __name: "MTitleBar",
75
120
  props: {
76
121
  title: {},
@@ -93,11 +138,11 @@ var le = ["data-controls"], ue = { class: "m3-title-bar-area" }, de = {
93
138
  }
94
139
  },
95
140
  emits: ["menu-select"],
96
- setup(o, { emit: s }) {
97
- let f = o, m = s, x = se(), S = h(!1), C = t(() => {
98
- let e = f.menus ?? [];
99
- return !e.length || f.menusVisibility === "hidden" || f.menusVisibility === "toggle" && !S.value ? [] : f.menusVisibility === "compact" ? [{
100
- label: x.appMenuLabel,
141
+ setup(c, { emit: l }) {
142
+ let p = c, h = l, b = ce(), x = g(!1), S = t(() => {
143
+ let e = p.menus ?? [];
144
+ return V.value || !e.length || p.menusVisibility === "hidden" || p.menusVisibility === "toggle" && !x.value ? [] : p.menusVisibility === "compact" ? [{
145
+ label: b.appMenuLabel,
101
146
  icon: "menu",
102
147
  items: e.map((e) => ({
103
148
  label: e.label,
@@ -105,52 +150,64 @@ var le = ["data-controls"], ue = { class: "m3-title-bar-area" }, de = {
105
150
  children: e.items
106
151
  }))
107
152
  }] : e;
108
- }), w = t(() => f.menusPosition === "below" && f.menusVisibility !== "compact"), T = (e, t) => e.some((e) => e === t || !!e.children && T(e.children, t));
109
- function E(e) {
110
- m("menu-select", e, Math.max(0, (f.menus ?? []).findIndex((t) => T(t.items, e)))), f.menusVisibility === "toggle" && (S.value = !1);
153
+ }), C = t(() => p.menusPosition === "below" && p.menusVisibility !== "compact"), w = (e, t) => e.some((e) => e === t || !!e.children && w(e.children, t));
154
+ function T(e) {
155
+ h("menu-select", e, Math.max(0, (p.menus ?? []).findIndex((t) => w(t.items, e)))), p.menusVisibility === "toggle" && (x.value = !1);
111
156
  }
112
- let D = !1;
113
- function O(e) {
114
- D = e.key === "Alt" && !e.repeat && !e.ctrlKey && !e.shiftKey && !e.metaKey;
157
+ let E = !1;
158
+ function D(e) {
159
+ E = e.key === "Alt" && !e.repeat && !e.ctrlKey && !e.shiftKey && !e.metaKey;
115
160
  }
116
- function k(e) {
117
- e.key === "Alt" && D && f.menusVisibility === "toggle" && f.menus?.length && (D = !1, e.preventDefault(), S.value = !S.value, S.value && re(() => K.value?.querySelector(".m3-menu-bar [role=\"menuitem\"]")?.focus()));
161
+ function O(e) {
162
+ e.key === "Alt" && E && p.menusVisibility === "toggle" && p.menus?.length && (E = !1, e.preventDefault(), x.value = !x.value, x.value && te(() => K.value?.querySelector(".m3-menu-bar [role=\"menuitem\"]")?.focus()));
118
163
  }
119
- function A() {
120
- S.value && setTimeout(() => {
164
+ function k() {
165
+ x.value && setTimeout(() => {
121
166
  let e = K.value?.querySelector(".m3-menu-bar");
122
- e && (e.querySelector("[aria-expanded=\"true\"]") || e.contains(document.activeElement) || (S.value = !1));
167
+ e && (e.querySelector("[aria-expanded=\"true\"]") || e.contains(document.activeElement) || (x.value = !1));
123
168
  }, 0);
124
169
  }
125
- function j(e) {
126
- if (e.key !== "Escape" || !S.value) return;
170
+ function A(e) {
171
+ if (e.key !== "Escape" || !x.value) return;
127
172
  let t = e.target;
128
- t.closest(".m3-menu-bar") && t.getAttribute("aria-expanded") !== "true" && (S.value = !1);
173
+ t.closest(".m3-menu-bar") && t.getAttribute("aria-expanded") !== "true" && (x.value = !1);
129
174
  }
130
- v(() => f.menusVisibility, () => {
131
- S.value = !1;
132
- }), d(() => {
133
- window.addEventListener("keydown", O, !0), window.addEventListener("keyup", k, !0), document.addEventListener("pointerdown", A, !0), document.addEventListener("focusin", A);
134
- }), u(() => {
135
- window.removeEventListener("keydown", O, !0), window.removeEventListener("keyup", k, !0), document.removeEventListener("pointerdown", A, !0), document.removeEventListener("focusin", A);
175
+ y(() => p.menusVisibility, () => {
176
+ x.value = !1;
177
+ }), re(() => {
178
+ window.addEventListener("keydown", D, !0), window.addEventListener("keyup", O, !0), document.addEventListener("pointerdown", k, !0), document.addEventListener("focusin", k);
179
+ }), f(() => {
180
+ window.removeEventListener("keydown", D, !0), window.removeEventListener("keyup", O, !0), document.removeEventListener("pointerdown", k, !0), document.removeEventListener("focusin", k);
181
+ });
182
+ let j = t(() => !!p.icon && /[/.:]/.test(p.icon)), M = ue(), { controls: N, maximized: P, focused: F, fullscreen: I, isMac: L, titleBarHeight: R } = M, Ee = /^[a-z]+(-[a-z]+)*$/, De = t(() => Ee.test(p.color) ? `var(--color-${p.color})` : p.color), z = t(() => M.isElectron && N.value === "custom"), B = t(() => M.isElectron && N.value === "native"), V = t(() => B.value && L.value && M.canSetNativeMenu && !!p.menus?.length), H = /* @__PURE__ */ new Map(), U = !1, Oe = M.onNativeMenuClick((e) => {
183
+ let t = H.get(e);
184
+ t && (t[0].onSelect?.(), h("menu-select", t[0], t[1]));
185
+ });
186
+ y([V, () => p.menus], () => {
187
+ if (V.value) {
188
+ let { data: e, picks: t } = de(p.menus);
189
+ H = t, M.setNativeMenu(e), U = !0;
190
+ } else U &&= (M.setNativeMenu(null), !1);
191
+ }, { immediate: !0 }), f(() => {
192
+ Oe(), U && M.setNativeMenu(null);
136
193
  });
137
- let M = t(() => !!f.icon && /[/.:]/.test(f.icon)), N = R(), { controls: P, maximized: F, focused: I, fullscreen: L, isMac: z, titleBarHeight: B } = N, Ce = /^[a-z]+(-[a-z]+)*$/, we = t(() => Ce.test(f.color) ? `var(--color-${f.color})` : f.color), V = t(() => N.isElectron && P.value === "custom"), H = t(() => N.isElectron && P.value === "native"), U = t(() => f.side === "auto" ? z.value : f.side === "start"), W = t(() => f.look === "auto" ? z.value : f.look === "traffic-lights"), Te = t(() => {
138
- let e = f.buttons.filter((e, t, n) => n.indexOf(e) === t);
139
- return W.value ? [
194
+ let W = t(() => p.side === "auto" ? L.value : p.side === "start"), G = t(() => p.look === "auto" ? L.value : p.look === "traffic-lights"), ke = t(() => {
195
+ let e = p.buttons.filter((e, t, n) => n.indexOf(e) === t);
196
+ return G.value ? [
140
197
  "close",
141
198
  "minimize",
142
199
  "maximize"
143
- ].filter((t) => e.includes(t)) : U.value ? [...e].reverse() : e;
144
- }), Ee = t(() => F.value || L.value ? x.windowRestore : x.windowMaximize), G = t(() => ({
145
- minimize: x.windowMinimize,
146
- maximize: Ee.value,
147
- close: x.close
148
- })), De = (e) => e === "minimize" ? N.minimize() : e === "maximize" ? N.toggleMaximize() : N.close();
149
- function Oe(e) {
150
- V.value && (e.target.closest("button, a, input, select, textarea, [role=\"button\"], [data-no-drag]") || N.toggleMaximize());
200
+ ].filter((t) => e.includes(t)) : W.value ? [...e].reverse() : e;
201
+ }), Ae = t(() => P.value || I.value ? b.windowRestore : b.windowMaximize), je = t(() => ({
202
+ minimize: b.windowMinimize,
203
+ maximize: Ae.value,
204
+ close: b.close
205
+ })), Me = (e) => e === "minimize" ? M.minimize() : e === "maximize" ? M.toggleMaximize() : M.close();
206
+ function Ne(e) {
207
+ z.value && (e.target.closest("button, a, input, select, textarea, [role=\"button\"], [data-no-drag]") || M.toggleMaximize());
151
208
  }
152
- let K = h(), q = h(), J = 0, Y = 0, X = null, Z = null;
153
- function Q(e, t) {
209
+ let K = g(), q = g(), J = 0, Pe = 0, Y = null, X = null;
210
+ function Z(e, t) {
154
211
  let n = /rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+%?))?/.exec(e);
155
212
  if (!n) return null;
156
213
  let r = n[4] == null ? 1 : n[4].endsWith("%") ? parseFloat(n[4]) / 100 : parseFloat(n[4]), i = [
@@ -160,32 +217,32 @@ var le = ["data-controls"], ue = { class: "m3-title-bar-area" }, de = {
160
217
  ];
161
218
  return r < 1 && t ? i.forEach((e, n) => i[n] = e * r + t[n] * (1 - r)) : r = 1, `#${i.map((e) => Math.round(Math.min(255, Math.max(0, e))).toString(16).padStart(2, "0")).join("")}`;
162
219
  }
163
- function ke() {
164
- let e = Q(getComputedStyle(document.body).backgroundColor) ?? Q(getComputedStyle(document.documentElement).backgroundColor) ?? "#ffffff";
220
+ function Fe() {
221
+ let e = Z(getComputedStyle(document.body).backgroundColor) ?? Z(getComputedStyle(document.documentElement).backgroundColor) ?? "#ffffff";
165
222
  return [
166
223
  1,
167
224
  3,
168
225
  5
169
226
  ].map((t) => parseInt(e.slice(t, t + 2), 16));
170
227
  }
171
- function Ae() {
228
+ function Ie() {
172
229
  if (!K.value || !q.value) return;
173
- let e = Q(getComputedStyle(K.value).backgroundColor, ke()), t = Q(getComputedStyle(q.value).color);
174
- e && t && N.setOverlay({
230
+ let e = Z(getComputedStyle(K.value).backgroundColor, Fe()), t = Z(getComputedStyle(q.value).color);
231
+ e && t && M.setOverlay({
175
232
  color: e,
176
233
  symbolColor: t
177
234
  });
178
235
  }
179
- function $(e = 600) {
180
- if (!H.value || z.value || (Y = performance.now() + e, J)) return;
236
+ function Q(e = 600) {
237
+ if (!B.value || L.value || (Pe = performance.now() + e, J)) return;
181
238
  let t = () => {
182
- Ae(), J = performance.now() < Y ? requestAnimationFrame(t) : 0;
239
+ Ie(), J = performance.now() < Pe ? requestAnimationFrame(t) : 0;
183
240
  };
184
241
  t();
185
242
  }
186
- let je = () => $();
187
- function Me() {
188
- X || !H.value || z.value || ($(), X = new MutationObserver(() => $()), X.observe(document.documentElement, {
243
+ let Le = () => Q();
244
+ function Re() {
245
+ Y || !B.value || L.value || (Q(), Y = new MutationObserver(() => Q()), Y.observe(document.documentElement, {
189
246
  attributes: !0,
190
247
  attributeFilter: [
191
248
  "class",
@@ -193,37 +250,37 @@ var le = ["data-controls"], ue = { class: "m3-title-bar-area" }, de = {
193
250
  "data-palette",
194
251
  "data-theme"
195
252
  ]
196
- }), Z = window.matchMedia?.("(prefers-color-scheme: dark)") ?? null, Z?.addEventListener?.("change", je));
253
+ }), X = window.matchMedia?.("(prefers-color-scheme: dark)") ?? null, X?.addEventListener?.("change", Le));
197
254
  }
198
- function Ne() {
199
- X?.disconnect(), X = null, Z?.removeEventListener?.("change", je), Z = null, cancelAnimationFrame(J), J = 0;
255
+ function ze() {
256
+ Y?.disconnect(), Y = null, X?.removeEventListener?.("change", Le), X = null, cancelAnimationFrame(J), J = 0;
200
257
  }
201
- d(() => {
202
- N.ready.value && Me();
203
- }), v([
204
- N.ready,
205
- H,
206
- z
258
+ re(() => {
259
+ M.ready.value && Re();
260
+ }), y([
261
+ M.ready,
262
+ B,
263
+ L
207
264
  ], () => {
208
- Ne(), N.ready.value && Me();
209
- }), v(() => f.color, () => $());
210
- let { theme: Pe } = ce();
211
- return v([
212
- Pe,
213
- () => f.syncNativeTheme,
214
- N.ready
265
+ ze(), M.ready.value && Re();
266
+ }), y(() => p.color, () => Q());
267
+ let { theme: $ } = le();
268
+ return y([
269
+ $,
270
+ () => p.syncNativeTheme,
271
+ M.ready
215
272
  ], () => {
216
- f.syncNativeTheme && N.ready.value && N.setTheme(Pe.value);
217
- }, { immediate: !0 }), u(Ne), (t, s) => (p(), i("header", {
273
+ p.syncNativeTheme && M.ready.value && M.setTheme($.value);
274
+ }, { immediate: !0 }), f(ze), (t, l) => (m(), i("header", {
218
275
  ref_key: "bar",
219
276
  ref: K,
220
- class: c(["m3-title-bar", {
221
- "m3-title-bar-native": H.value,
222
- "m3-title-bar-blurred": !_(I),
223
- "m3-title-bar-center": o.titleAlign === "center"
277
+ class: u(["m3-title-bar", {
278
+ "m3-title-bar-native": B.value,
279
+ "m3-title-bar-blurred": !v(F),
280
+ "m3-title-bar-center": c.titleAlign === "center"
224
281
  }]),
225
- style: l({ background: we.value }),
226
- "data-controls": _(N).isElectron ? _(P) : void 0
282
+ style: d({ background: De.value }),
283
+ "data-controls": v(M).isElectron ? v(N) : void 0
227
284
  }, [
228
285
  a("span", {
229
286
  ref_key: "probe",
@@ -233,61 +290,61 @@ var le = ["data-controls"], ue = { class: "m3-title-bar-area" }, de = {
233
290
  }, null, 512),
234
291
  a("div", {
235
292
  class: "m3-title-bar-row",
236
- style: l({ height: `${_(B)}px` }),
237
- onDblclick: Oe
238
- }, [a("div", ue, [
239
- o.icon || t.$slots.icon ? (p(), i("div", de, [g(t.$slots, "icon", {}, () => [M.value ? (p(), i("img", {
293
+ style: d({ height: `${v(R)}px` }),
294
+ onDblclick: Ne
295
+ }, [a("div", pe, [
296
+ c.icon || t.$slots.icon ? (m(), i("div", me, [_(t.$slots, "icon", {}, () => [j.value ? (m(), i("img", {
240
297
  key: 0,
241
- src: o.icon,
298
+ src: c.icon,
242
299
  alt: "",
243
300
  draggable: "false"
244
- }, null, 8, fe)) : (p(), n(_(y), {
301
+ }, null, 8, he)) : (m(), n(v(oe), {
245
302
  key: 1,
246
- name: o.icon,
303
+ name: c.icon,
247
304
  size: 20
248
305
  }, null, 8, ["name"]))])])) : r("", !0),
249
- C.value.length && !w.value ? (p(), n(_(b), {
306
+ S.value.length && !C.value ? (m(), n(v(se), {
250
307
  key: 1,
251
- menus: C.value,
252
- height: Math.min(32, _(B) - 8),
308
+ menus: S.value,
309
+ height: Math.min(32, v(R) - 8),
253
310
  class: "m3-title-bar-menus",
254
- onSelect: E,
255
- onKeydown: j
311
+ onSelect: T,
312
+ onKeydown: A
256
313
  }, null, 8, ["menus", "height"])) : r("", !0),
257
- a("div", pe, [g(t.$slots, "start")]),
258
- a("div", me, [a("span", he, [g(t.$slots, "default", {}, () => [ee(oe(o.title), 1)])])]),
259
- a("div", ge, [g(t.$slots, "end")]),
260
- V.value ? (p(), i("div", {
314
+ a("div", ge, [_(t.$slots, "start")]),
315
+ a("div", _e, [a("span", ve, [_(t.$slots, "default", {}, () => [o(ae(c.title), 1)])])]),
316
+ a("div", ye, [_(t.$slots, "end")]),
317
+ z.value ? (m(), i("div", {
261
318
  key: 2,
262
- class: c(["m3-title-bar-side", U.value && "m3-title-bar-controls-start"])
263
- }, [g(t.$slots, "controls", ie(ne({
264
- minimize: _(N).minimize,
265
- toggleMaximize: _(N).toggleMaximize,
266
- close: _(N).close,
267
- maximized: _(F),
268
- focused: _(I)
269
- })), () => [a("div", { class: c(["m3-title-bar-controls", W.value && "m3-title-bar-lights"]) }, [(p(!0), i(e, null, ae(Te.value, (e) => (p(), i("button", {
319
+ class: u(["m3-title-bar-side", W.value && "m3-title-bar-controls-start"])
320
+ }, [_(t.$slots, "controls", ne(ee({
321
+ minimize: v(M).minimize,
322
+ toggleMaximize: v(M).toggleMaximize,
323
+ close: v(M).close,
324
+ maximized: v(P),
325
+ focused: v(F)
326
+ })), () => [a("div", { class: u(["m3-title-bar-controls", G.value && "m3-title-bar-lights"]) }, [(m(!0), i(e, null, ie(ke.value, (e) => (m(), i("button", {
270
327
  key: e,
271
328
  type: "button",
272
- class: c(["m3-title-bar-btn", `m3-title-bar-btn-${e}`]),
273
- "aria-label": G.value[e],
274
- title: G.value[e],
275
- onClick: (t) => De(e)
276
- }, [W.value ? (p(), i("svg", ve, [e === "close" ? (p(), i("path", ye)) : e === "minimize" ? (p(), i("path", be)) : (p(), i("path", xe))])) : (p(), n(_(y), {
329
+ class: u(["m3-title-bar-btn", `m3-title-bar-btn-${e}`]),
330
+ "aria-label": je.value[e],
331
+ title: je.value[e],
332
+ onClick: (t) => Me(e)
333
+ }, [G.value ? (m(), i("svg", xe, [e === "close" ? (m(), i("path", Se)) : e === "minimize" ? (m(), i("path", Ce)) : (m(), i("path", we))])) : (m(), n(v(oe), {
277
334
  key: 0,
278
- name: e === "minimize" ? "minimize" : e === "close" ? "close" : _(F) || _(L) ? "close_fullscreen" : "open_in_full",
335
+ name: e === "minimize" ? "minimize" : e === "close" ? "close" : v(P) || v(I) ? "close_fullscreen" : "open_in_full",
279
336
  size: e === "maximize" ? 16 : 18
280
- }, null, 8, ["name", "size"]))], 10, _e))), 128))], 2)])], 2)) : r("", !0)
337
+ }, null, 8, ["name", "size"]))], 10, be))), 128))], 2)])], 2)) : r("", !0)
281
338
  ])], 36),
282
- C.value.length && w.value ? (p(), i("div", Se, [te(_(b), {
283
- menus: C.value,
339
+ S.value.length && C.value ? (m(), i("div", Te, [s(v(se), {
340
+ menus: S.value,
284
341
  height: 32,
285
- onSelect: E,
286
- onKeydown: j
342
+ onSelect: T,
343
+ onKeydown: A
287
344
  }, null, 8, ["menus"])])) : r("", !0)
288
- ], 14, le));
345
+ ], 14, fe));
289
346
  }
290
347
  });
291
- export { z as MTitleBar, R as useElectronWindow };
348
+ export { R as MTitleBar, ue as useElectronWindow };
292
349
 
293
350
  //# sourceMappingURL=index.js.map