@aiquants/menu-bar 1.18.2 → 1.18.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/MenuBar.d.ts +2 -29
- package/dist/components/SessionInfo.d.ts +1 -26
- package/dist/contents/MenuContent.d.ts +2 -14
- package/dist/contents/MenuList.d.ts +0 -38
- package/dist/contents/OverlayShadow.d.ts +0 -19
- package/dist/elements/MenuSwitch.d.ts +1 -10
- package/dist/events/pinEvent.d.ts +2 -37
- package/dist/hooks/useMenuPinState.d.ts +1 -16
- package/dist/index.d.ts +11 -21
- package/dist/index.es.js +170 -170
- package/dist/index.umd.js +2 -2
- package/dist/types/user.d.ts +0 -7
- package/dist/types.d.ts +1 -15
- package/package.json +2 -3
- package/dist/__tests__/pinEvent.test.d.ts +0 -1
- package/src/MenuBar.tsx +0 -248
- package/src/__tests__/pinEvent.test.tsx +0 -68
- package/src/components/SessionInfo.tsx +0 -95
- package/src/contents/MenuContent.tsx +0 -79
- package/src/contents/MenuList.tsx +0 -400
- package/src/contents/OverlayShadow.tsx +0 -30
- package/src/elements/MenuSwitch.tsx +0 -134
- package/src/events/pinEvent.ts +0 -129
- package/src/hooks/useMenuPinState.ts +0 -58
- package/src/index.ts +0 -29
- package/src/lucide-icons.d.ts +0 -6
- package/src/styles/components.entry.css +0 -11
- package/src/styles/menu-bar.css +0 -224
- package/src/styles/standalone.entry.css +0 -12
- package/src/types/user.ts +0 -12
- package/src/types.ts +0 -24
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Ee, { forwardRef as be, createElement as re, useCallback as
|
|
2
|
-
import { useLocation as
|
|
1
|
+
import Ee, { forwardRef as be, createElement as re, useCallback as S, useSyncExternalStore as Se, useMemo as oe, useState as J, useRef as M, useEffect as $, useLayoutEffect as xe } from "react";
|
|
2
|
+
import { useLocation as _e, Link as ve } from "react-router-dom";
|
|
3
3
|
var Z = { exports: {} }, V = {};
|
|
4
4
|
var ie;
|
|
5
5
|
function Ce() {
|
|
@@ -10,8 +10,8 @@ function Ce() {
|
|
|
10
10
|
var u = null;
|
|
11
11
|
if (o !== void 0 && (u = "" + o), l.key !== void 0 && (u = "" + l.key), "key" in l) {
|
|
12
12
|
o = {};
|
|
13
|
-
for (var
|
|
14
|
-
|
|
13
|
+
for (var m in l)
|
|
14
|
+
m !== "key" && (o[m] = l[m]);
|
|
15
15
|
} else o = l;
|
|
16
16
|
return l = o.ref, {
|
|
17
17
|
$$typeof: n,
|
|
@@ -35,7 +35,7 @@ function Pe() {
|
|
|
35
35
|
switch (e) {
|
|
36
36
|
case f:
|
|
37
37
|
return "Fragment";
|
|
38
|
-
case
|
|
38
|
+
case I:
|
|
39
39
|
return "Profiler";
|
|
40
40
|
case P:
|
|
41
41
|
return "StrictMode";
|
|
@@ -52,9 +52,9 @@ function Pe() {
|
|
|
52
52
|
), e.$$typeof) {
|
|
53
53
|
case i:
|
|
54
54
|
return "Portal";
|
|
55
|
-
case
|
|
55
|
+
case T:
|
|
56
56
|
return e.displayName || "Context";
|
|
57
|
-
case
|
|
57
|
+
case x:
|
|
58
58
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
59
59
|
case L:
|
|
60
60
|
var c = e.render;
|
|
@@ -82,8 +82,8 @@ function Pe() {
|
|
|
82
82
|
}
|
|
83
83
|
if (c) {
|
|
84
84
|
c = console;
|
|
85
|
-
var
|
|
86
|
-
return
|
|
85
|
+
var v = c.error, j = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
86
|
+
return v.call(
|
|
87
87
|
c,
|
|
88
88
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
89
89
|
j
|
|
@@ -102,7 +102,7 @@ function Pe() {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
function l() {
|
|
105
|
-
var e =
|
|
105
|
+
var e = O.A;
|
|
106
106
|
return e === null ? null : e.getOwner();
|
|
107
107
|
}
|
|
108
108
|
function o() {
|
|
@@ -115,35 +115,35 @@ function Pe() {
|
|
|
115
115
|
}
|
|
116
116
|
return e.key !== void 0;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
function
|
|
118
|
+
function m(e, c) {
|
|
119
|
+
function v() {
|
|
120
120
|
H || (H = !0, console.error(
|
|
121
121
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
122
122
|
c
|
|
123
123
|
));
|
|
124
124
|
}
|
|
125
|
-
|
|
126
|
-
get:
|
|
125
|
+
v.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
126
|
+
get: v,
|
|
127
127
|
configurable: !0
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function h() {
|
|
131
131
|
var e = n(this.type);
|
|
132
|
-
return
|
|
132
|
+
return y[e] || (y[e] = !0, console.error(
|
|
133
133
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
134
134
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
var N =
|
|
136
|
+
function p(e, c, v, j, G, ee) {
|
|
137
|
+
var N = v.ref;
|
|
138
138
|
return e = {
|
|
139
|
-
$$typeof:
|
|
139
|
+
$$typeof: b,
|
|
140
140
|
type: e,
|
|
141
141
|
key: c,
|
|
142
|
-
props:
|
|
142
|
+
props: v,
|
|
143
143
|
_owner: j
|
|
144
144
|
}, (N !== void 0 ? N : null) !== null ? Object.defineProperty(e, "ref", {
|
|
145
145
|
enumerable: !1,
|
|
146
|
-
get:
|
|
146
|
+
get: h
|
|
147
147
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
148
148
|
configurable: !1,
|
|
149
149
|
enumerable: !1,
|
|
@@ -166,7 +166,7 @@ function Pe() {
|
|
|
166
166
|
value: ee
|
|
167
167
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
168
168
|
}
|
|
169
|
-
function d(e, c,
|
|
169
|
+
function d(e, c, v, j, G, ee) {
|
|
170
170
|
var N = c.children;
|
|
171
171
|
if (N !== void 0)
|
|
172
172
|
if (j)
|
|
@@ -197,60 +197,60 @@ React keys must be passed directly to JSX without using spread:
|
|
|
197
197
|
N
|
|
198
198
|
), U[N + j] = !0);
|
|
199
199
|
}
|
|
200
|
-
if (N = null,
|
|
201
|
-
|
|
200
|
+
if (N = null, v !== void 0 && (s(v), N = "" + v), u(c) && (s(c.key), N = "" + c.key), "key" in c) {
|
|
201
|
+
v = {};
|
|
202
202
|
for (var te in c)
|
|
203
|
-
te !== "key" && (
|
|
204
|
-
} else
|
|
205
|
-
return N &&
|
|
206
|
-
|
|
203
|
+
te !== "key" && (v[te] = c[te]);
|
|
204
|
+
} else v = c;
|
|
205
|
+
return N && m(
|
|
206
|
+
v,
|
|
207
207
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
208
|
-
),
|
|
208
|
+
), p(
|
|
209
209
|
e,
|
|
210
210
|
N,
|
|
211
|
-
|
|
211
|
+
v,
|
|
212
212
|
l(),
|
|
213
213
|
G,
|
|
214
214
|
ee
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
217
|
function w(e) {
|
|
218
|
-
|
|
218
|
+
k(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === D && (e._payload.status === "fulfilled" ? k(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
220
|
+
function k(e) {
|
|
221
|
+
return typeof e == "object" && e !== null && e.$$typeof === b;
|
|
222
222
|
}
|
|
223
|
-
var
|
|
223
|
+
var g = Ee, b = /* @__PURE__ */ Symbol.for("react.transitional.element"), i = /* @__PURE__ */ Symbol.for("react.portal"), f = /* @__PURE__ */ Symbol.for("react.fragment"), P = /* @__PURE__ */ Symbol.for("react.strict_mode"), I = /* @__PURE__ */ Symbol.for("react.profiler"), x = /* @__PURE__ */ Symbol.for("react.consumer"), T = /* @__PURE__ */ Symbol.for("react.context"), L = /* @__PURE__ */ Symbol.for("react.forward_ref"), z = /* @__PURE__ */ Symbol.for("react.suspense"), B = /* @__PURE__ */ Symbol.for("react.suspense_list"), Q = /* @__PURE__ */ Symbol.for("react.memo"), D = /* @__PURE__ */ Symbol.for("react.lazy"), Y = /* @__PURE__ */ Symbol.for("react.activity"), X = /* @__PURE__ */ Symbol.for("react.client.reference"), O = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, K = Array.isArray, A = console.createTask ? console.createTask : function() {
|
|
224
224
|
return null;
|
|
225
225
|
};
|
|
226
|
-
|
|
226
|
+
g = {
|
|
227
227
|
react_stack_bottom_frame: function(e) {
|
|
228
228
|
return e();
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
|
-
var H,
|
|
232
|
-
|
|
231
|
+
var H, y = {}, _ = g.react_stack_bottom_frame.bind(
|
|
232
|
+
g,
|
|
233
233
|
o
|
|
234
|
-
)(),
|
|
235
|
-
W.Fragment = f, W.jsx = function(e, c,
|
|
236
|
-
var j = 1e4 >
|
|
234
|
+
)(), R = A(a(o)), U = {};
|
|
235
|
+
W.Fragment = f, W.jsx = function(e, c, v) {
|
|
236
|
+
var j = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
237
237
|
return d(
|
|
238
238
|
e,
|
|
239
239
|
c,
|
|
240
|
-
|
|
240
|
+
v,
|
|
241
241
|
!1,
|
|
242
242
|
j ? Error("react-stack-top-frame") : _,
|
|
243
|
-
j ?
|
|
243
|
+
j ? A(a(e)) : R
|
|
244
244
|
);
|
|
245
|
-
}, W.jsxs = function(e, c,
|
|
246
|
-
var j = 1e4 >
|
|
245
|
+
}, W.jsxs = function(e, c, v) {
|
|
246
|
+
var j = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
247
247
|
return d(
|
|
248
248
|
e,
|
|
249
249
|
c,
|
|
250
|
-
|
|
250
|
+
v,
|
|
251
251
|
!0,
|
|
252
252
|
j ? Error("react-stack-top-frame") : _,
|
|
253
|
-
j ?
|
|
253
|
+
j ? A(a(e)) : R
|
|
254
254
|
);
|
|
255
255
|
};
|
|
256
256
|
})()), W;
|
|
@@ -266,7 +266,7 @@ const Te = (n) => n.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Re = (
|
|
|
266
266
|
), ue = (n) => {
|
|
267
267
|
const t = Re(n);
|
|
268
268
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
269
|
-
},
|
|
269
|
+
}, ge = (...n) => n.filter((t, s, a) => !!t && t.trim() !== "" && a.indexOf(t) === s).join(" ").trim(), Oe = (n) => {
|
|
270
270
|
for (const t in n)
|
|
271
271
|
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
272
272
|
return !0;
|
|
@@ -291,22 +291,22 @@ const Ie = be(
|
|
|
291
291
|
className: l = "",
|
|
292
292
|
children: o,
|
|
293
293
|
iconNode: u,
|
|
294
|
-
...
|
|
295
|
-
},
|
|
294
|
+
...m
|
|
295
|
+
}, h) => re(
|
|
296
296
|
"svg",
|
|
297
297
|
{
|
|
298
|
-
ref:
|
|
298
|
+
ref: h,
|
|
299
299
|
...Ae,
|
|
300
300
|
width: t,
|
|
301
301
|
height: t,
|
|
302
302
|
stroke: n,
|
|
303
303
|
strokeWidth: a ? Number(s) * 24 / Number(t) : s,
|
|
304
|
-
className:
|
|
305
|
-
...!o && !Oe(
|
|
306
|
-
...
|
|
304
|
+
className: ge("lucide", l),
|
|
305
|
+
...!o && !Oe(m) && { "aria-hidden": "true" },
|
|
306
|
+
...m
|
|
307
307
|
},
|
|
308
308
|
[
|
|
309
|
-
...u.map(([
|
|
309
|
+
...u.map(([p, d]) => re(p, d)),
|
|
310
310
|
...Array.isArray(o) ? o : [o]
|
|
311
311
|
]
|
|
312
312
|
)
|
|
@@ -316,7 +316,7 @@ const C = (n, t) => {
|
|
|
316
316
|
({ className: a, ...l }, o) => re(Ie, {
|
|
317
317
|
ref: o,
|
|
318
318
|
iconNode: t,
|
|
319
|
-
className:
|
|
319
|
+
className: ge(
|
|
320
320
|
`lucide-${Te(ue(n))}`,
|
|
321
321
|
`lucide-${n}`,
|
|
322
322
|
a
|
|
@@ -373,41 +373,41 @@ const $e = [
|
|
|
373
373
|
] })
|
|
374
374
|
] }) : /* @__PURE__ */ r.jsx("div", { className: "aiquants-session-card flex items-center justify-between rounded-xl border border-white/20 bg-white/10 p-2.5 shadow-xs dark:border-slate-700/60 dark:bg-slate-800/60", children: /* @__PURE__ */ r.jsx("span", { className: "font-medium text-white/90 text-xs dark:text-slate-200", children: "ログインしてください" }) }) });
|
|
375
375
|
}, se = "aiquants-menu-pin-change";
|
|
376
|
-
let
|
|
377
|
-
const
|
|
376
|
+
let E = { pinned: !1, width: 0, active: !1 };
|
|
377
|
+
const ye = (n = 240) => {
|
|
378
378
|
if (typeof window > "u" || typeof document > "u")
|
|
379
|
-
return { pinned: !1, width: 0 };
|
|
379
|
+
return { pinned: !1, width: 0, active: !1 };
|
|
380
380
|
try {
|
|
381
381
|
const t = getComputedStyle(document.documentElement).getPropertyValue("--aiquants-menu-pinned-width").trim();
|
|
382
382
|
if (t) {
|
|
383
|
-
const
|
|
384
|
-
if (!Number.isNaN(
|
|
385
|
-
const
|
|
386
|
-
return
|
|
383
|
+
const u = Number.parseInt(t, 10);
|
|
384
|
+
if (!Number.isNaN(u)) {
|
|
385
|
+
const m = u > 0, h = m ? u || n : 0, p = E.active ?? m;
|
|
386
|
+
return E.pinned === m && E.width === h && E.active === p || (E = { pinned: m, width: h, active: p }), E;
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
|
-
const a = localStorage.getItem("aiquants-menu-pinned") === "true", l = a ? n : 0;
|
|
390
|
-
return
|
|
389
|
+
const a = localStorage.getItem("aiquants-menu-pinned") === "true", l = a ? n : 0, o = E.active ?? a;
|
|
390
|
+
return E.pinned === a && E.width === l && E.active === o || (E = { pinned: a, width: l, active: o }), E;
|
|
391
391
|
} catch {
|
|
392
|
-
return { pinned: !1, width: 0 };
|
|
392
|
+
return { pinned: !1, width: 0, active: !1 };
|
|
393
393
|
}
|
|
394
|
-
}, de = (n, t) => {
|
|
394
|
+
}, de = (n, t, s) => {
|
|
395
395
|
if (typeof window > "u") return;
|
|
396
|
-
const s = { pinned: n, width: t };
|
|
397
|
-
(
|
|
398
|
-
const
|
|
399
|
-
detail:
|
|
396
|
+
const a = s ?? n, l = { pinned: n, width: t, active: a };
|
|
397
|
+
(E.pinned !== n || E.width !== t || E.active !== a) && (E = l);
|
|
398
|
+
const o = new CustomEvent(se, {
|
|
399
|
+
detail: l,
|
|
400
400
|
bubbles: !0,
|
|
401
401
|
cancelable: !1
|
|
402
402
|
});
|
|
403
|
-
window.dispatchEvent(
|
|
403
|
+
window.dispatchEvent(o);
|
|
404
404
|
}, He = (n, t) => {
|
|
405
405
|
if (typeof window > "u")
|
|
406
406
|
return () => {
|
|
407
407
|
};
|
|
408
408
|
const { immediate: s = !0, defaultPinnedWidth: a = 240 } = t ?? {};
|
|
409
409
|
if (s) {
|
|
410
|
-
const o =
|
|
410
|
+
const o = ye(a);
|
|
411
411
|
n(o);
|
|
412
412
|
}
|
|
413
413
|
const l = (o) => {
|
|
@@ -418,7 +418,7 @@ const ve = (n = 240) => {
|
|
|
418
418
|
window.removeEventListener(se, l);
|
|
419
419
|
};
|
|
420
420
|
}, pt = (n) => {
|
|
421
|
-
const t = n?.defaultPinnedWidth ?? 240, s = n?.initialPinned ?? !1, a =
|
|
421
|
+
const t = n?.defaultPinnedWidth ?? 240, s = n?.initialPinned ?? !1, a = S(
|
|
422
422
|
(u) => He(
|
|
423
423
|
() => {
|
|
424
424
|
u();
|
|
@@ -426,11 +426,11 @@ const ve = (n = 240) => {
|
|
|
426
426
|
{ immediate: !1, defaultPinnedWidth: t }
|
|
427
427
|
),
|
|
428
428
|
[t]
|
|
429
|
-
), l =
|
|
429
|
+
), l = S(() => ye(t), [t]), o = S(() => ({
|
|
430
430
|
pinned: s,
|
|
431
431
|
width: s ? t : 0
|
|
432
432
|
}), [s, t]);
|
|
433
|
-
return
|
|
433
|
+
return Se(a, l, o);
|
|
434
434
|
};
|
|
435
435
|
const Ve = [
|
|
436
436
|
["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }],
|
|
@@ -536,7 +536,7 @@ const nt = [
|
|
|
536
536
|
s && s(ae(t, n));
|
|
537
537
|
}
|
|
538
538
|
};
|
|
539
|
-
return n.new ? /* @__PURE__ */ r.jsx("a", { href: n.href, rel: "noopener noreferrer", target: "_blank", ...l, children: a }) : je.test(n.href) ? /* @__PURE__ */ r.jsx("a", { href: n.href, ...l, children: a }) : /* @__PURE__ */ r.jsx(
|
|
539
|
+
return n.new ? /* @__PURE__ */ r.jsx("a", { href: n.href, rel: "noopener noreferrer", target: "_blank", ...l, children: a }) : je.test(n.href) ? /* @__PURE__ */ r.jsx("a", { href: n.href, ...l, children: a }) : /* @__PURE__ */ r.jsx(ve, { to: n.href, ...l, children: a });
|
|
540
540
|
}, me = (n) => n ? n.split(/[?#]/)[0].replace(/(?!^\/)\/$/, "") : "", pe = (n, t) => {
|
|
541
541
|
const s = t !== "/" && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
542
542
|
for (const a of n) {
|
|
@@ -553,25 +553,25 @@ const nt = [
|
|
|
553
553
|
const { menuList: t, onMenuSelected: s, pinnedSubmenuIds: a = [], onToggleSubmenuPin: l } = n;
|
|
554
554
|
let o = "";
|
|
555
555
|
try {
|
|
556
|
-
o =
|
|
556
|
+
o = _e().pathname;
|
|
557
557
|
} catch {
|
|
558
558
|
typeof window < "u" && (o = window.location.pathname);
|
|
559
559
|
}
|
|
560
|
-
const u = oe(() => pe(t, o), [t, o]), [
|
|
560
|
+
const u = oe(() => pe(t, o), [t, o]), [m, h] = J(u), p = M(o), d = M(u !== null);
|
|
561
561
|
$(() => {
|
|
562
|
-
if (
|
|
562
|
+
if (p.current !== o && (p.current = o, d.current = !1), !d.current) {
|
|
563
563
|
const i = pe(t, o);
|
|
564
|
-
i !== null && (
|
|
564
|
+
i !== null && (h(i), d.current = !0);
|
|
565
565
|
}
|
|
566
566
|
}, [o, t]);
|
|
567
|
-
const w =
|
|
567
|
+
const w = S(
|
|
568
568
|
(i) => {
|
|
569
|
-
a.includes(i) ||
|
|
569
|
+
a.includes(i) || h((P) => P === i ? null : i);
|
|
570
570
|
},
|
|
571
571
|
[a]
|
|
572
|
-
),
|
|
572
|
+
), k = M(null);
|
|
573
573
|
st(() => {
|
|
574
|
-
const i =
|
|
574
|
+
const i = k.current;
|
|
575
575
|
if (i)
|
|
576
576
|
try {
|
|
577
577
|
const f = sessionStorage.getItem(he);
|
|
@@ -582,14 +582,14 @@ const nt = [
|
|
|
582
582
|
} catch {
|
|
583
583
|
}
|
|
584
584
|
}, []);
|
|
585
|
-
const
|
|
586
|
-
const i =
|
|
585
|
+
const g = S(() => {
|
|
586
|
+
const i = k.current;
|
|
587
587
|
if (i)
|
|
588
588
|
try {
|
|
589
589
|
sessionStorage.setItem(he, String(i.scrollTop));
|
|
590
590
|
} catch {
|
|
591
591
|
}
|
|
592
|
-
}, []),
|
|
592
|
+
}, []), b = oe(() => /* @__PURE__ */ r.jsx(r.Fragment, { children: t.map((i) => /* @__PURE__ */ r.jsx("div", { children: i.href ? /* @__PURE__ */ r.jsx("div", { className: "aiquants-menu-list-item relative mb-0.5 ml-1 flex items-center rounded-l-xl px-2.5 py-1 text-xs before:mr-2 before:inline-block before:h-2 before:w-2 before:shrink-0 before:rounded-full before:content-[''] sm:text-sm", children: je.test(i.href) ? /* @__PURE__ */ r.jsx(
|
|
593
593
|
"a",
|
|
594
594
|
{
|
|
595
595
|
href: i.href,
|
|
@@ -599,7 +599,7 @@ const nt = [
|
|
|
599
599
|
children: /* @__PURE__ */ r.jsx("span", { className: "aiquants-menu-link hover:underline", children: i.title })
|
|
600
600
|
}
|
|
601
601
|
) : /* @__PURE__ */ r.jsx(
|
|
602
|
-
|
|
602
|
+
ve,
|
|
603
603
|
{
|
|
604
604
|
to: i.href,
|
|
605
605
|
onClick: () => {
|
|
@@ -607,7 +607,7 @@ const nt = [
|
|
|
607
607
|
},
|
|
608
608
|
children: /* @__PURE__ */ r.jsx("span", { className: "aiquants-menu-link hover:underline", children: i.title })
|
|
609
609
|
}
|
|
610
|
-
) }) : /* @__PURE__ */ r.jsxs("details", { className: "aiquants-menu-accordion-details", open: i.id ===
|
|
610
|
+
) }) : /* @__PURE__ */ r.jsxs("details", { className: "aiquants-menu-accordion-details", open: i.id === m || a.includes(i.id), children: [
|
|
611
611
|
/* @__PURE__ */ r.jsxs(
|
|
612
612
|
"summary",
|
|
613
613
|
{
|
|
@@ -636,10 +636,10 @@ const nt = [
|
|
|
636
636
|
}
|
|
637
637
|
),
|
|
638
638
|
/* @__PURE__ */ r.jsx("div", { className: "aiquants-menu-submenu pointer-events-auto my-0.5 mr-1 ml-3.5 rounded-lg px-2 py-1 shadow-sm", children: i.submenu.map((f) => /* @__PURE__ */ r.jsx("div", { className: "aiquants-menu-accordion-container block w-full whitespace-nowrap py-0.5 text-xs", children: /* @__PURE__ */ r.jsx(it, { item: f, parentMenu: i, onMenuSelected: s }) }, f.subid)) })
|
|
639
|
-
] }) }, i.id)) }), [t, s,
|
|
640
|
-
return /* @__PURE__ */ r.jsx("div", { ref:
|
|
639
|
+
] }) }, i.id)) }), [t, s, m, w, a]);
|
|
640
|
+
return /* @__PURE__ */ r.jsx("div", { ref: k, onScroll: g, className: "hidden-scrollbar h-0 grow overflow-y-scroll", children: b });
|
|
641
641
|
}, ct = (n) => {
|
|
642
|
-
const { menuList: t, menuHeader: s, open: a, onMenuSelected: l, onClickSignout: o, theme: u, toggleTheme:
|
|
642
|
+
const { menuList: t, menuHeader: s, open: a, onMenuSelected: l, onClickSignout: o, theme: u, toggleTheme: m, isPinned: h, onTogglePin: p, pinnedSubmenuIds: d, onToggleSubmenuPin: w } = n;
|
|
643
643
|
return /* @__PURE__ */ r.jsxs("div", { className: `aiquants-menu-content fixed top-0 right-0 z-2147483642 flex min-h-dvh w-[240px] select-none flex-col transition-transform duration-500 ${a ? "aiquants-menu-translate-x-0" : "aiquants-menu-translate-x-250"}`, children: [
|
|
644
644
|
/* @__PURE__ */ r.jsx("div", { className: "flex shrink-0 flex-col justify-center border-white/15 border-b px-2.5 py-2 dark:border-slate-700/60", children: s }),
|
|
645
645
|
/* @__PURE__ */ r.jsx("div", { className: "flex grow flex-col overflow-y-auto", children: /* @__PURE__ */ r.jsx(lt, { menuList: t, onMenuSelected: l, pinnedSubmenuIds: d, onToggleSubmenuPin: w }) }),
|
|
@@ -648,19 +648,19 @@ const nt = [
|
|
|
648
648
|
"button",
|
|
649
649
|
{
|
|
650
650
|
type: "button",
|
|
651
|
-
onClick:
|
|
651
|
+
onClick: p,
|
|
652
652
|
"data-aqmb-pin-button": !0,
|
|
653
|
-
className: `flex h-7 items-center justify-center rounded-md px-2 text-[11px] text-white shadow-2xs transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-300/60 ${
|
|
654
|
-
title:
|
|
655
|
-
"aria-label":
|
|
656
|
-
children:
|
|
653
|
+
className: `flex h-7 items-center justify-center rounded-md px-2 text-[11px] text-white shadow-2xs transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-300/60 ${h ? "bg-amber-500 hover:bg-amber-600 dark:bg-amber-600 dark:hover:bg-amber-500" : "border border-white/20 bg-white/10 hover:bg-white/20 dark:border-slate-600/60 dark:bg-slate-700/60 dark:hover:bg-slate-600"}`,
|
|
654
|
+
title: h ? "ピン留め解除" : "ピン留め",
|
|
655
|
+
"aria-label": h ? "ピン留め解除" : "ピン留め",
|
|
656
|
+
children: h ? /* @__PURE__ */ r.jsx(ke, { size: 12 }) : /* @__PURE__ */ r.jsx(we, { size: 12 })
|
|
657
657
|
}
|
|
658
658
|
),
|
|
659
659
|
/* @__PURE__ */ r.jsx(
|
|
660
660
|
"button",
|
|
661
661
|
{
|
|
662
662
|
type: "button",
|
|
663
|
-
onClick:
|
|
663
|
+
onClick: m,
|
|
664
664
|
"data-aqmb-theme-button": !0,
|
|
665
665
|
className: "group relative flex h-7 items-center justify-center rounded-md border border-white/20 bg-white/10 px-2 text-[11px] text-white shadow-2xs backdrop-blur-xs transition-all duration-200 hover:bg-white/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40 dark:border-slate-600/60 dark:bg-slate-700/60 dark:hover:bg-slate-600",
|
|
666
666
|
title: u === "dark" ? "ライトモードに切り替え" : "ダークモードに切り替え",
|
|
@@ -687,35 +687,35 @@ const nt = [
|
|
|
687
687
|
const { isOverlay: t, onOverlayClick: s } = n;
|
|
688
688
|
return /* @__PURE__ */ r.jsx("button", { type: "button", className: `fixed inset-0 z-2147483640 cursor-default bg-black/50 transition-opacity duration-500 ${t ? "opacity-100" : "pointer-events-none opacity-0"}`, onClick: s });
|
|
689
689
|
}, dt = (n) => {
|
|
690
|
-
const { open: t, isOpen: s, onMenuOpen: a, onMenuClose: l, onToggle: o, theme: u = "light", className:
|
|
691
|
-
if (d.current && w.current &&
|
|
692
|
-
const
|
|
693
|
-
d.current.style.backgroundColor =
|
|
690
|
+
const { open: t, isOpen: s, onMenuOpen: a, onMenuClose: l, onToggle: o, theme: u = "light", className: m } = n, h = t ?? (s !== void 0 ? !s : !0), p = M(h), d = M(null), w = M(null), k = M(null), g = M(null), b = M(null), i = S(() => {
|
|
691
|
+
if (d.current && w.current && k.current && g.current && b.current) {
|
|
692
|
+
const x = u === "dark" ? "#fff" : "#000";
|
|
693
|
+
d.current.style.backgroundColor = x, d.current.style.width = "100%", d.current.style.height = "3px", d.current.style.transform = "none", w.current.style.opacity = "1", w.current.style.backgroundColor = x, k.current.style.opacity = "1", k.current.style.backgroundColor = x, g.current.style.backgroundColor = x, g.current.style.width = "100%", g.current.style.height = "3px", g.current.style.transform = "none", b.current.style.color = x, b.current.classList.remove("after:content-['close']"), b.current.classList.remove("after:ml-0.5"), b.current.classList.add("after:content-['menu']"), b.current.classList.add("after:-ml-0.5"), p.current = !0;
|
|
694
694
|
}
|
|
695
|
-
}, [u]), f =
|
|
696
|
-
d.current && w.current &&
|
|
695
|
+
}, [u]), f = S(() => {
|
|
696
|
+
d.current && w.current && k.current && g.current && b.current && (d.current.style.backgroundColor = "#fff", d.current.style.width = "32px", d.current.style.height = "4px", d.current.style.transform = "translateY(9px) rotate(-45deg)", w.current.style.opacity = "0", k.current.style.opacity = "0", g.current.style.backgroundColor = "#fff", g.current.style.width = "32px", g.current.style.height = "4px", g.current.style.transform = "translateY(-9px) rotate(45deg)", b.current.style.color = "#fff", b.current.classList.remove("after:content-['menu']"), b.current.classList.remove("after:-ml-0.5"), b.current.classList.add("after:content-['close']"), b.current.classList.add("after:ml-0.5"), p.current = !1);
|
|
697
697
|
}, []);
|
|
698
698
|
$(() => {
|
|
699
|
-
|
|
700
|
-
}, [
|
|
701
|
-
const P =
|
|
702
|
-
|
|
703
|
-
}, [f, i, a, l, o]),
|
|
699
|
+
h ? i() : f();
|
|
700
|
+
}, [h, i, f]);
|
|
701
|
+
const P = S(() => {
|
|
702
|
+
p.current ? (f(), a?.(), o?.(!0)) : (i(), l?.(), o?.(!1));
|
|
703
|
+
}, [f, i, a, l, o]), I = !h;
|
|
704
704
|
return /* @__PURE__ */ r.jsxs(
|
|
705
705
|
"button",
|
|
706
706
|
{
|
|
707
707
|
type: "button",
|
|
708
708
|
"data-aqmb-menu-switch": "true",
|
|
709
|
-
"aria-label":
|
|
710
|
-
"aria-expanded":
|
|
711
|
-
className: `aiquants-menu-switch z-[2147483647] inline-block h-[27px] w-[27px] cursor-pointer align-middle outline-hidden ${
|
|
709
|
+
"aria-label": I ? "Close menu" : "Open menu",
|
|
710
|
+
"aria-expanded": I,
|
|
711
|
+
className: `aiquants-menu-switch z-[2147483647] inline-block h-[27px] w-[27px] cursor-pointer align-middle outline-hidden ${m || ""}`,
|
|
712
712
|
onClick: P,
|
|
713
713
|
children: [
|
|
714
714
|
/* @__PURE__ */ r.jsx("span", { ref: d, className: "absolute top-0 left-0 box-border inline-block h-[3px] w-full select-none transition-all duration-500" }),
|
|
715
715
|
/* @__PURE__ */ r.jsx("span", { ref: w, className: "absolute top-[6px] left-0 box-border inline-block h-[3px] w-full select-none transition-all duration-500" }),
|
|
716
|
-
/* @__PURE__ */ r.jsx("span", { ref:
|
|
717
|
-
/* @__PURE__ */ r.jsx("span", { ref:
|
|
718
|
-
/* @__PURE__ */ r.jsx("div", { ref:
|
|
716
|
+
/* @__PURE__ */ r.jsx("span", { ref: k, className: "absolute top-[12px] left-0 box-border inline-block h-[3px] w-full select-none transition-all duration-500" }),
|
|
717
|
+
/* @__PURE__ */ r.jsx("span", { ref: g, className: "absolute top-[18px] left-0 box-border inline-block h-[3px] w-full select-none transition-all duration-500" }),
|
|
718
|
+
/* @__PURE__ */ r.jsx("div", { ref: b, className: "absolute w-full text-xs transition-all duration-500 after:mt-2 after:block" })
|
|
719
719
|
]
|
|
720
720
|
}
|
|
721
721
|
);
|
|
@@ -727,96 +727,96 @@ const nt = [
|
|
|
727
727
|
isMenuhide: l,
|
|
728
728
|
isMenuHide: o,
|
|
729
729
|
theme: u,
|
|
730
|
-
toggleTheme:
|
|
731
|
-
onMenuNavigate:
|
|
732
|
-
isPinned:
|
|
730
|
+
toggleTheme: m,
|
|
731
|
+
onMenuNavigate: h,
|
|
732
|
+
isPinned: p,
|
|
733
733
|
pinnedWidth: d = 240,
|
|
734
734
|
onPinChange: w,
|
|
735
|
-
pinnedSubmenuIds:
|
|
736
|
-
initialPinnedSubmenuIds:
|
|
737
|
-
onSubmenuPinChange:
|
|
735
|
+
pinnedSubmenuIds: k,
|
|
736
|
+
initialPinnedSubmenuIds: g,
|
|
737
|
+
onSubmenuPinChange: b,
|
|
738
738
|
closeOnEscape: i = "auto"
|
|
739
|
-
} = n, f = o ?? l ?? !1, [P,
|
|
739
|
+
} = n, f = o ?? l ?? !1, [P, I] = J(() => {
|
|
740
740
|
try {
|
|
741
741
|
return localStorage.getItem("aiquants-menu-pinned") === "true";
|
|
742
742
|
} catch {
|
|
743
743
|
return !1;
|
|
744
744
|
}
|
|
745
|
-
}),
|
|
745
|
+
}), x = p !== void 0 ? p : P, [T, L] = J(x);
|
|
746
746
|
$(() => {
|
|
747
|
-
|
|
748
|
-
}, [
|
|
747
|
+
x && L(!0);
|
|
748
|
+
}, [x]);
|
|
749
749
|
const [z, B] = J(() => {
|
|
750
|
-
if (
|
|
751
|
-
return
|
|
750
|
+
if (g)
|
|
751
|
+
return g;
|
|
752
752
|
try {
|
|
753
|
-
const
|
|
754
|
-
if (
|
|
755
|
-
const _ = JSON.parse(
|
|
753
|
+
const y = localStorage.getItem("aiquants-submenu-pinned");
|
|
754
|
+
if (y) {
|
|
755
|
+
const _ = JSON.parse(y);
|
|
756
756
|
if (Array.isArray(_))
|
|
757
|
-
return _.filter((
|
|
757
|
+
return _.filter((R) => typeof R == "number");
|
|
758
758
|
}
|
|
759
759
|
} catch {
|
|
760
760
|
}
|
|
761
761
|
return [];
|
|
762
|
-
}), Q =
|
|
763
|
-
(
|
|
764
|
-
const _ =
|
|
765
|
-
if (
|
|
766
|
-
B(
|
|
762
|
+
}), Q = k !== void 0 ? k : z, D = S(
|
|
763
|
+
(y) => {
|
|
764
|
+
const _ = k !== void 0 ? k : z, R = _.includes(y) ? _.filter((U) => U !== y) : [..._, y];
|
|
765
|
+
if (k === void 0) {
|
|
766
|
+
B(R);
|
|
767
767
|
try {
|
|
768
|
-
localStorage.setItem("aiquants-submenu-pinned", JSON.stringify(
|
|
768
|
+
localStorage.setItem("aiquants-submenu-pinned", JSON.stringify(R));
|
|
769
769
|
} catch {
|
|
770
770
|
}
|
|
771
771
|
}
|
|
772
|
-
|
|
772
|
+
b && b(R);
|
|
773
773
|
},
|
|
774
|
-
[
|
|
774
|
+
[k, z, b]
|
|
775
775
|
), Y = M(w);
|
|
776
776
|
ne(() => {
|
|
777
777
|
Y.current = w;
|
|
778
778
|
}, [w]), ne(() => {
|
|
779
|
-
const
|
|
780
|
-
document.documentElement.style.setProperty("--aiquants-menu-pinned-width", _), de(
|
|
781
|
-
}, [
|
|
779
|
+
const y = x ? d : 0, _ = `${y}px`;
|
|
780
|
+
document.documentElement.style.setProperty("--aiquants-menu-pinned-width", _), de(x, y, T || x);
|
|
781
|
+
}, [x, d, T]), ne(() => () => {
|
|
782
782
|
document.documentElement.style.setProperty("--aiquants-menu-pinned-width", "0px"), de(!1, 0);
|
|
783
783
|
}, []);
|
|
784
|
-
const X =
|
|
784
|
+
const X = S(() => {
|
|
785
785
|
L(!0);
|
|
786
|
-
}, []),
|
|
787
|
-
if (L(!1),
|
|
788
|
-
|
|
786
|
+
}, []), O = S(() => {
|
|
787
|
+
if (L(!1), p === void 0) {
|
|
788
|
+
I(!1);
|
|
789
789
|
try {
|
|
790
790
|
localStorage.removeItem("aiquants-menu-pinned");
|
|
791
791
|
} catch {
|
|
792
792
|
}
|
|
793
793
|
}
|
|
794
794
|
Y.current?.(!1, 0);
|
|
795
|
-
}, [
|
|
796
|
-
const
|
|
797
|
-
if (
|
|
798
|
-
|
|
795
|
+
}, [p]), F = S(() => {
|
|
796
|
+
const y = !x, _ = y ? d : 0;
|
|
797
|
+
if (p === void 0) {
|
|
798
|
+
I(y);
|
|
799
799
|
try {
|
|
800
|
-
|
|
800
|
+
y ? localStorage.setItem("aiquants-menu-pinned", "true") : localStorage.removeItem("aiquants-menu-pinned");
|
|
801
801
|
} catch {
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
|
-
Y.current?.(
|
|
805
|
-
}, [
|
|
806
|
-
(
|
|
807
|
-
|
|
804
|
+
Y.current?.(y, _);
|
|
805
|
+
}, [x, p, d]), K = S(
|
|
806
|
+
(y) => {
|
|
807
|
+
h && h(y), x || L(!1);
|
|
808
808
|
},
|
|
809
|
-
[
|
|
810
|
-
),
|
|
811
|
-
(
|
|
812
|
-
|
|
809
|
+
[h, x]
|
|
810
|
+
), A = S(
|
|
811
|
+
(y) => {
|
|
812
|
+
y.key === "Escape" && O();
|
|
813
813
|
},
|
|
814
|
-
[
|
|
815
|
-
), H = i === !0 || i === "auto" && !
|
|
816
|
-
return $(() => (
|
|
817
|
-
window.removeEventListener("keydown",
|
|
818
|
-
}), [
|
|
819
|
-
/* @__PURE__ */ r.jsx(dt, { onMenuClose:
|
|
814
|
+
[O]
|
|
815
|
+
), H = i === !0 || i === "auto" && !x;
|
|
816
|
+
return $(() => (T && H ? window.addEventListener("keydown", A) : window.removeEventListener("keydown", A), () => {
|
|
817
|
+
window.removeEventListener("keydown", A);
|
|
818
|
+
}), [T, H, A]), f ? null : /* @__PURE__ */ r.jsxs("div", { className: `aiquants-menu-bar ${u}`, children: [
|
|
819
|
+
/* @__PURE__ */ r.jsx(dt, { onMenuClose: O, onMenuOpen: X, open: !T, theme: u }),
|
|
820
820
|
/* @__PURE__ */ r.jsx(
|
|
821
821
|
ct,
|
|
822
822
|
{
|
|
@@ -824,16 +824,16 @@ const nt = [
|
|
|
824
824
|
menuHeader: s,
|
|
825
825
|
onClickSignout: a,
|
|
826
826
|
onMenuSelected: K,
|
|
827
|
-
open:
|
|
827
|
+
open: T,
|
|
828
828
|
theme: u,
|
|
829
|
-
toggleTheme:
|
|
830
|
-
isPinned:
|
|
829
|
+
toggleTheme: m,
|
|
830
|
+
isPinned: x,
|
|
831
831
|
onTogglePin: F,
|
|
832
832
|
pinnedSubmenuIds: Q,
|
|
833
833
|
onToggleSubmenuPin: D
|
|
834
834
|
}
|
|
835
835
|
),
|
|
836
|
-
/* @__PURE__ */ r.jsx(ut, { isOverlay:
|
|
836
|
+
/* @__PURE__ */ r.jsx(ut, { isOverlay: T && !x, onOverlayClick: O })
|
|
837
837
|
] });
|
|
838
838
|
};
|
|
839
839
|
export {
|
|
@@ -842,7 +842,7 @@ export {
|
|
|
842
842
|
bt as MenuBar,
|
|
843
843
|
mt as SessionInfo,
|
|
844
844
|
de as dispatchMenuPinChange,
|
|
845
|
-
|
|
845
|
+
ye as getInitialPinState,
|
|
846
846
|
He as subscribeMenuPinChange,
|
|
847
847
|
pt as useMenuPinState
|
|
848
848
|
};
|