@paroicms/public-menu-plugin 0.1.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/README.md +9 -0
- package/backend/dist/plugin.js +17 -0
- package/package.json +52 -0
- package/public-front/dist/public-front-plugin.mjs +497 -0
- package/public-front/dist/style.css +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# @paroicms/public-menu-plugin
|
|
2
|
+
|
|
3
|
+
Public menu plugin for ParoiCMS.
|
|
4
|
+
|
|
5
|
+
This package is part of [ParoiCMS](https://www.npmjs.com/package/@paroicms/server).
|
|
6
|
+
|
|
7
|
+
## License
|
|
8
|
+
|
|
9
|
+
Released under the [MIT license](https://gitlab.com/paroi/opensource/paroicms/-/blob/main/LICENSE.md).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
4
|
+
const public_server_lib_1 = require("@paroicms/public-server-lib");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const projectDir = (0, node_path_1.dirname)(__dirname);
|
|
7
|
+
const packageDir = (0, node_path_1.dirname)(projectDir);
|
|
8
|
+
const version = (0, data_formatters_lib_1.strVal)(require((0, node_path_1.join)(packageDir, "package.json")).version);
|
|
9
|
+
const plugin = {
|
|
10
|
+
version,
|
|
11
|
+
slug: "public-menu",
|
|
12
|
+
async siteInit(service) {
|
|
13
|
+
service.setPublicAssetsDirectory((0, node_path_1.join)(packageDir, "public-front", "dist"));
|
|
14
|
+
service.addHeadTag(`<link rel="stylesheet" href="${(0, public_server_lib_1.escapeHtml)(`${service.pluginAssetsUrl}/style.css`)}">`, `<script type="module" src="${(0, public_server_lib_1.escapeHtml)(`${service.pluginAssetsUrl}/public-front-plugin.mjs`)}"></script>`);
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
exports.default = plugin;
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@paroicms/public-menu-plugin",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Public menu plugin for ParoiCMS",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"paroicms",
|
|
7
|
+
"plugin",
|
|
8
|
+
"public",
|
|
9
|
+
"menu"
|
|
10
|
+
],
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://gitlab.com/paroi/opensource/paroicms.git",
|
|
14
|
+
"directory": "plugins/@paroicms/public-menu-plugin"
|
|
15
|
+
},
|
|
16
|
+
"author": "Paroi Team",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev:public": "(cd public-front && vite)",
|
|
20
|
+
"build": "npm run build:backend && npm run build:public",
|
|
21
|
+
"build:backend": "(cd backend && tsc)",
|
|
22
|
+
"build:public": "(cd public-front && tsc && vite build)",
|
|
23
|
+
"build:public:watch": "(cd public-front && tsc && vite build --watch)",
|
|
24
|
+
"clear": "rimraf backend/dist/* public-front/dist/*"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@paroi/data-formatters-lib": "~0.4.0"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"@paroicms/public-anywhere-lib": "0",
|
|
31
|
+
"@paroicms/public-server-lib": "0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@paroicms/public-anywhere-lib": "0.7.0",
|
|
35
|
+
"@paroicms/public-server-lib": "0.13.0",
|
|
36
|
+
"@types/node": "~20.14.8",
|
|
37
|
+
"@types/micromodal": "~0.3.5",
|
|
38
|
+
"micromodal": "~0.4.10",
|
|
39
|
+
"rimraf": "~6.0.1",
|
|
40
|
+
"sass": "~1.77.8",
|
|
41
|
+
"solid-devtools": "~0.30.1",
|
|
42
|
+
"solid-js": "~1.8.20",
|
|
43
|
+
"typescript": "~5.5.4",
|
|
44
|
+
"vite": "~5.4.0",
|
|
45
|
+
"vite-plugin-solid": "~2.10.2"
|
|
46
|
+
},
|
|
47
|
+
"main": "backend/dist/plugin.js",
|
|
48
|
+
"files": [
|
|
49
|
+
"backend/dist",
|
|
50
|
+
"public-front/dist"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
function le(e) {
|
|
2
|
+
const n = e.dataset.activateMenuItems?.trim();
|
|
3
|
+
if (!n) return;
|
|
4
|
+
const { id: t, parents: o } = JSON.parse(n), i = new Set(o);
|
|
5
|
+
i.add(t);
|
|
6
|
+
const s = e.querySelectorAll("[data-menu-item-id]");
|
|
7
|
+
for (const l of s) {
|
|
8
|
+
const r = l.dataset.menuItemId;
|
|
9
|
+
r !== void 0 && i.has(r) && l.classList.add("active");
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
let re = J;
|
|
13
|
+
const v = 1, A = 2, ae = {
|
|
14
|
+
owned: null,
|
|
15
|
+
cleanups: null,
|
|
16
|
+
context: null,
|
|
17
|
+
owner: null
|
|
18
|
+
};
|
|
19
|
+
var d = null;
|
|
20
|
+
let k = null, ce = null, g = null, f = null, p = null, C = 0;
|
|
21
|
+
function B(e, n, t) {
|
|
22
|
+
const o = he(e, n, !1, v);
|
|
23
|
+
R(o);
|
|
24
|
+
}
|
|
25
|
+
function ue(e) {
|
|
26
|
+
if (g === null) return e();
|
|
27
|
+
const n = g;
|
|
28
|
+
g = null;
|
|
29
|
+
try {
|
|
30
|
+
return e();
|
|
31
|
+
} finally {
|
|
32
|
+
g = n;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function fe(e, n, t) {
|
|
36
|
+
let o = e.value;
|
|
37
|
+
return (!e.comparator || !e.comparator(o, n)) && (e.value = n, e.observers && e.observers.length && $(() => {
|
|
38
|
+
for (let i = 0; i < e.observers.length; i += 1) {
|
|
39
|
+
const s = e.observers[i], l = k && k.running;
|
|
40
|
+
l && k.disposed.has(s), (l ? !s.tState : !s.state) && (s.pure ? f.push(s) : p.push(s), s.observers && Q(s)), l || (s.state = v);
|
|
41
|
+
}
|
|
42
|
+
if (f.length > 1e6)
|
|
43
|
+
throw f = [], new Error();
|
|
44
|
+
})), n;
|
|
45
|
+
}
|
|
46
|
+
function R(e) {
|
|
47
|
+
if (!e.fn) return;
|
|
48
|
+
O(e);
|
|
49
|
+
const n = C;
|
|
50
|
+
de(
|
|
51
|
+
e,
|
|
52
|
+
e.value,
|
|
53
|
+
n
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
function de(e, n, t) {
|
|
57
|
+
let o;
|
|
58
|
+
const i = d, s = g;
|
|
59
|
+
g = d = e;
|
|
60
|
+
try {
|
|
61
|
+
o = e.fn(n);
|
|
62
|
+
} catch (l) {
|
|
63
|
+
return e.pure && (e.state = v, e.owned && e.owned.forEach(O), e.owned = null), e.updatedAt = t + 1, X(l);
|
|
64
|
+
} finally {
|
|
65
|
+
g = s, d = i;
|
|
66
|
+
}
|
|
67
|
+
(!e.updatedAt || e.updatedAt <= t) && (e.updatedAt != null && "observers" in e ? fe(e, o) : e.value = o, e.updatedAt = t);
|
|
68
|
+
}
|
|
69
|
+
function he(e, n, t, o = v, i) {
|
|
70
|
+
const s = {
|
|
71
|
+
fn: e,
|
|
72
|
+
state: o,
|
|
73
|
+
updatedAt: null,
|
|
74
|
+
owned: null,
|
|
75
|
+
sources: null,
|
|
76
|
+
sourceSlots: null,
|
|
77
|
+
cleanups: null,
|
|
78
|
+
value: n,
|
|
79
|
+
owner: d,
|
|
80
|
+
context: d ? d.context : null,
|
|
81
|
+
pure: t
|
|
82
|
+
};
|
|
83
|
+
return d === null || d !== ae && (d.owned ? d.owned.push(s) : d.owned = [s]), s;
|
|
84
|
+
}
|
|
85
|
+
function W(e) {
|
|
86
|
+
if (e.state === 0) return;
|
|
87
|
+
if (e.state === A) return I(e);
|
|
88
|
+
if (e.suspense && ue(e.suspense.inFallback)) return e.suspense.effects.push(e);
|
|
89
|
+
const n = [e];
|
|
90
|
+
for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < C); )
|
|
91
|
+
e.state && n.push(e);
|
|
92
|
+
for (let t = n.length - 1; t >= 0; t--)
|
|
93
|
+
if (e = n[t], e.state === v)
|
|
94
|
+
R(e);
|
|
95
|
+
else if (e.state === A) {
|
|
96
|
+
const o = f;
|
|
97
|
+
f = null, $(() => I(e, n[0])), f = o;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function $(e, n) {
|
|
101
|
+
if (f) return e();
|
|
102
|
+
let t = !1;
|
|
103
|
+
f = [], p ? t = !0 : p = [], C++;
|
|
104
|
+
try {
|
|
105
|
+
const o = e();
|
|
106
|
+
return me(t), o;
|
|
107
|
+
} catch (o) {
|
|
108
|
+
t || (p = null), f = null, X(o);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function me(e) {
|
|
112
|
+
if (f && (J(f), f = null), e) return;
|
|
113
|
+
const n = p;
|
|
114
|
+
p = null, n.length && $(() => re(n));
|
|
115
|
+
}
|
|
116
|
+
function J(e) {
|
|
117
|
+
for (let n = 0; n < e.length; n++) W(e[n]);
|
|
118
|
+
}
|
|
119
|
+
function I(e, n) {
|
|
120
|
+
e.state = 0;
|
|
121
|
+
for (let t = 0; t < e.sources.length; t += 1) {
|
|
122
|
+
const o = e.sources[t];
|
|
123
|
+
if (o.sources) {
|
|
124
|
+
const i = o.state;
|
|
125
|
+
i === v ? o !== n && (!o.updatedAt || o.updatedAt < C) && W(o) : i === A && I(o, n);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function Q(e) {
|
|
130
|
+
for (let n = 0; n < e.observers.length; n += 1) {
|
|
131
|
+
const t = e.observers[n];
|
|
132
|
+
t.state || (t.state = A, t.pure ? f.push(t) : p.push(t), t.observers && Q(t));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function O(e) {
|
|
136
|
+
let n;
|
|
137
|
+
if (e.sources)
|
|
138
|
+
for (; e.sources.length; ) {
|
|
139
|
+
const t = e.sources.pop(), o = e.sourceSlots.pop(), i = t.observers;
|
|
140
|
+
if (i && i.length) {
|
|
141
|
+
const s = i.pop(), l = t.observerSlots.pop();
|
|
142
|
+
o < i.length && (s.sourceSlots[l] = o, i[o] = s, t.observerSlots[o] = l);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (e.owned) {
|
|
146
|
+
for (n = e.owned.length - 1; n >= 0; n--) O(e.owned[n]);
|
|
147
|
+
e.owned = null;
|
|
148
|
+
}
|
|
149
|
+
if (e.cleanups) {
|
|
150
|
+
for (n = e.cleanups.length - 1; n >= 0; n--) e.cleanups[n]();
|
|
151
|
+
e.cleanups = null;
|
|
152
|
+
}
|
|
153
|
+
e.state = 0;
|
|
154
|
+
}
|
|
155
|
+
function ge(e) {
|
|
156
|
+
return e instanceof Error ? e : new Error(typeof e == "string" ? e : "Unknown error", {
|
|
157
|
+
cause: e
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
function X(e, n = d) {
|
|
161
|
+
throw ge(e);
|
|
162
|
+
}
|
|
163
|
+
function pe(e, n, t) {
|
|
164
|
+
let o = t.length, i = n.length, s = o, l = 0, r = 0, a = n[i - 1].nextSibling, u = null;
|
|
165
|
+
for (; l < i || r < s; ) {
|
|
166
|
+
if (n[l] === t[r]) {
|
|
167
|
+
l++, r++;
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
for (; n[i - 1] === t[s - 1]; )
|
|
171
|
+
i--, s--;
|
|
172
|
+
if (i === l) {
|
|
173
|
+
const c = s < o ? r ? t[r - 1].nextSibling : t[s - r] : a;
|
|
174
|
+
for (; r < s; ) e.insertBefore(t[r++], c);
|
|
175
|
+
} else if (s === r)
|
|
176
|
+
for (; l < i; )
|
|
177
|
+
(!u || !u.has(n[l])) && n[l].remove(), l++;
|
|
178
|
+
else if (n[l] === t[s - 1] && t[r] === n[i - 1]) {
|
|
179
|
+
const c = n[--i].nextSibling;
|
|
180
|
+
e.insertBefore(t[r++], n[l++].nextSibling), e.insertBefore(t[--s], c), n[i] = t[s];
|
|
181
|
+
} else {
|
|
182
|
+
if (!u) {
|
|
183
|
+
u = /* @__PURE__ */ new Map();
|
|
184
|
+
let h = r;
|
|
185
|
+
for (; h < s; ) u.set(t[h], h++);
|
|
186
|
+
}
|
|
187
|
+
const c = u.get(n[l]);
|
|
188
|
+
if (c != null)
|
|
189
|
+
if (r < c && c < s) {
|
|
190
|
+
let h = l, y = 1, b;
|
|
191
|
+
for (; ++h < i && h < s && !((b = u.get(n[h])) == null || b !== c + y); )
|
|
192
|
+
y++;
|
|
193
|
+
if (y > c - r) {
|
|
194
|
+
const S = n[l];
|
|
195
|
+
for (; r < c; ) e.insertBefore(t[r++], S);
|
|
196
|
+
} else e.replaceChild(t[r++], n[l++]);
|
|
197
|
+
} else l++;
|
|
198
|
+
else n[l++].remove();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
const U = "_$DX_DELEGATE";
|
|
203
|
+
function Y(e, n, t) {
|
|
204
|
+
let o;
|
|
205
|
+
const i = () => {
|
|
206
|
+
const l = document.createElement("template");
|
|
207
|
+
return l.innerHTML = e, l.content.firstChild;
|
|
208
|
+
}, s = () => (o || (o = i())).cloneNode(!0);
|
|
209
|
+
return s.cloneNode = s, s;
|
|
210
|
+
}
|
|
211
|
+
function ve(e, n = window.document) {
|
|
212
|
+
const t = n[U] || (n[U] = /* @__PURE__ */ new Set());
|
|
213
|
+
for (let o = 0, i = e.length; o < i; o++) {
|
|
214
|
+
const s = e[o];
|
|
215
|
+
t.has(s) || (t.add(s), n.addEventListener(s, be));
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function ye(e, n, t, o) {
|
|
219
|
+
if (o || (o = []), typeof n != "function") return M(e, n, o, t);
|
|
220
|
+
B((i) => M(e, n(), i, t), o);
|
|
221
|
+
}
|
|
222
|
+
function be(e) {
|
|
223
|
+
const n = `$$${e.type}`;
|
|
224
|
+
let t = e.composedPath && e.composedPath()[0] || e.target;
|
|
225
|
+
for (e.target !== t && Object.defineProperty(e, "target", {
|
|
226
|
+
configurable: !0,
|
|
227
|
+
value: t
|
|
228
|
+
}), Object.defineProperty(e, "currentTarget", {
|
|
229
|
+
configurable: !0,
|
|
230
|
+
get() {
|
|
231
|
+
return t || document;
|
|
232
|
+
}
|
|
233
|
+
}); t; ) {
|
|
234
|
+
const o = t[n];
|
|
235
|
+
if (o && !t.disabled) {
|
|
236
|
+
const i = t[`${n}Data`];
|
|
237
|
+
if (i !== void 0 ? o.call(t, i, e) : o.call(t, e), e.cancelBubble) return;
|
|
238
|
+
}
|
|
239
|
+
t = t._$host || t.parentNode || t.host;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
function M(e, n, t, o, i) {
|
|
243
|
+
for (; typeof t == "function"; ) t = t();
|
|
244
|
+
if (n === t) return t;
|
|
245
|
+
const s = typeof n;
|
|
246
|
+
if (e = t[0] && t[0].parentNode || e, s === "string" || s === "number") {
|
|
247
|
+
if (s === "number" && (n = n.toString(), n === t))
|
|
248
|
+
return t;
|
|
249
|
+
{
|
|
250
|
+
let l = t[0];
|
|
251
|
+
l && l.nodeType === 3 ? l.data !== n && (l.data = n) : l = document.createTextNode(n), t = w(e, t, o, l);
|
|
252
|
+
}
|
|
253
|
+
} else if (n == null || s === "boolean")
|
|
254
|
+
t = w(e, t, o);
|
|
255
|
+
else {
|
|
256
|
+
if (s === "function")
|
|
257
|
+
return B(() => {
|
|
258
|
+
let l = n();
|
|
259
|
+
for (; typeof l == "function"; ) l = l();
|
|
260
|
+
t = M(e, l, t, o);
|
|
261
|
+
}), () => t;
|
|
262
|
+
if (Array.isArray(n)) {
|
|
263
|
+
const l = [], r = t && Array.isArray(t);
|
|
264
|
+
if (N(l, n, t, i))
|
|
265
|
+
return B(() => t = M(e, l, t, o, !0)), () => t;
|
|
266
|
+
if (l.length === 0)
|
|
267
|
+
return t = w(e, t, o), t;
|
|
268
|
+
r ? t.length === 0 ? H(e, l, o) : pe(e, t, l) : (t && w(e), H(e, l)), t = l;
|
|
269
|
+
} else if (n.nodeType) {
|
|
270
|
+
if (Array.isArray(t))
|
|
271
|
+
return t = w(e, t, o, n);
|
|
272
|
+
t == null || t === "" || !e.firstChild ? e.appendChild(n) : e.replaceChild(n, e.firstChild), t = n;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return t;
|
|
276
|
+
}
|
|
277
|
+
function N(e, n, t, o) {
|
|
278
|
+
let i = !1;
|
|
279
|
+
for (let s = 0, l = n.length; s < l; s++) {
|
|
280
|
+
let r = n[s], a = t && t[e.length], u;
|
|
281
|
+
if (!(r == null || r === !0 || r === !1)) if ((u = typeof r) == "object" && r.nodeType)
|
|
282
|
+
e.push(r);
|
|
283
|
+
else if (Array.isArray(r))
|
|
284
|
+
i = N(e, r, a) || i;
|
|
285
|
+
else if (u === "function")
|
|
286
|
+
if (o) {
|
|
287
|
+
for (; typeof r == "function"; ) r = r();
|
|
288
|
+
i = N(
|
|
289
|
+
e,
|
|
290
|
+
Array.isArray(r) ? r : [r],
|
|
291
|
+
Array.isArray(a) ? a : [a]
|
|
292
|
+
) || i;
|
|
293
|
+
} else
|
|
294
|
+
e.push(r), i = !0;
|
|
295
|
+
else {
|
|
296
|
+
const c = String(r);
|
|
297
|
+
a && a.nodeType === 3 && a.data === c ? e.push(a) : e.push(document.createTextNode(c));
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return i;
|
|
301
|
+
}
|
|
302
|
+
function H(e, n, t = null) {
|
|
303
|
+
for (let o = 0, i = n.length; o < i; o++) e.insertBefore(n[o], t);
|
|
304
|
+
}
|
|
305
|
+
function w(e, n, t, o) {
|
|
306
|
+
if (t === void 0) return e.textContent = "";
|
|
307
|
+
const i = o || document.createTextNode("");
|
|
308
|
+
if (n.length) {
|
|
309
|
+
let s = !1;
|
|
310
|
+
for (let l = n.length - 1; l >= 0; l--) {
|
|
311
|
+
const r = n[l];
|
|
312
|
+
if (i !== r) {
|
|
313
|
+
const a = r.parentNode === e;
|
|
314
|
+
!s && !l ? a ? e.replaceChild(i, r) : e.insertBefore(i, t) : a && r.remove();
|
|
315
|
+
} else s = !0;
|
|
316
|
+
}
|
|
317
|
+
} else e.insertBefore(i, t);
|
|
318
|
+
return [i];
|
|
319
|
+
}
|
|
320
|
+
function we(e, n) {
|
|
321
|
+
for (var t = 0; t < n.length; t++) {
|
|
322
|
+
var o = n[t];
|
|
323
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
function E(e) {
|
|
327
|
+
return function(n) {
|
|
328
|
+
if (Array.isArray(n)) return T(n);
|
|
329
|
+
}(e) || function(n) {
|
|
330
|
+
if (typeof Symbol < "u" && Symbol.iterator in Object(n)) return Array.from(n);
|
|
331
|
+
}(e) || function(n, t) {
|
|
332
|
+
if (n) {
|
|
333
|
+
if (typeof n == "string") return T(n, t);
|
|
334
|
+
var o = Object.prototype.toString.call(n).slice(8, -1);
|
|
335
|
+
if (o === "Object" && n.constructor && (o = n.constructor.name), o === "Map" || o === "Set") return Array.from(n);
|
|
336
|
+
if (o === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)) return T(n, t);
|
|
337
|
+
}
|
|
338
|
+
}(e) || function() {
|
|
339
|
+
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
340
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
341
|
+
}();
|
|
342
|
+
}
|
|
343
|
+
function T(e, n) {
|
|
344
|
+
(n == null || n > e.length) && (n = e.length);
|
|
345
|
+
for (var t = 0, o = new Array(n); t < n; t++) o[t] = e[t];
|
|
346
|
+
return o;
|
|
347
|
+
}
|
|
348
|
+
var V, x, m, L, G, _ = (V = ["a[href]", "area[href]", 'input:not([disabled]):not([type="hidden"]):not([aria-hidden])', "select:not([disabled]):not([aria-hidden])", "textarea:not([disabled]):not([aria-hidden])", "button:not([disabled]):not([aria-hidden])", "iframe", "object", "embed", "[contenteditable]", '[tabindex]:not([tabindex^="-"])'], x = function() {
|
|
349
|
+
function e(o) {
|
|
350
|
+
var i = o.targetModal, s = o.triggers, l = s === void 0 ? [] : s, r = o.onShow, a = r === void 0 ? function() {
|
|
351
|
+
} : r, u = o.onClose, c = u === void 0 ? function() {
|
|
352
|
+
} : u, h = o.openTrigger, y = h === void 0 ? "data-micromodal-trigger" : h, b = o.closeTrigger, S = b === void 0 ? "data-micromodal-close" : b, j = o.openClass, Z = j === void 0 ? "is-open" : j, F = o.disableScroll, z = F !== void 0 && F, P = o.disableFocus, ee = P !== void 0 && P, D = o.awaitCloseAnimation, te = D !== void 0 && D, q = o.awaitOpenAnimation, ne = q !== void 0 && q, K = o.debugMode, oe = K !== void 0 && K;
|
|
353
|
+
(function(ie, se) {
|
|
354
|
+
if (!(ie instanceof se)) throw new TypeError("Cannot call a class as a function");
|
|
355
|
+
})(this, e), this.modal = document.getElementById(i), this.config = { debugMode: oe, disableScroll: z, openTrigger: y, closeTrigger: S, openClass: Z, onShow: a, onClose: c, awaitCloseAnimation: te, awaitOpenAnimation: ne, disableFocus: ee }, l.length > 0 && this.registerTriggers.apply(this, E(l)), this.onClick = this.onClick.bind(this), this.onKeydown = this.onKeydown.bind(this);
|
|
356
|
+
}
|
|
357
|
+
var n, t;
|
|
358
|
+
return n = e, (t = [{ key: "registerTriggers", value: function() {
|
|
359
|
+
for (var o = this, i = arguments.length, s = new Array(i), l = 0; l < i; l++) s[l] = arguments[l];
|
|
360
|
+
s.filter(Boolean).forEach(function(r) {
|
|
361
|
+
r.addEventListener("click", function(a) {
|
|
362
|
+
return o.showModal(a);
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
} }, { key: "showModal", value: function() {
|
|
366
|
+
var o = this, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
|
|
367
|
+
if (this.activeElement = document.activeElement, this.modal.setAttribute("aria-hidden", "false"), this.modal.classList.add(this.config.openClass), this.scrollBehaviour("disable"), this.addEventListeners(), this.config.awaitOpenAnimation) {
|
|
368
|
+
var s = function l() {
|
|
369
|
+
o.modal.removeEventListener("animationend", l, !1), o.setFocusToFirstNode();
|
|
370
|
+
};
|
|
371
|
+
this.modal.addEventListener("animationend", s, !1);
|
|
372
|
+
} else this.setFocusToFirstNode();
|
|
373
|
+
this.config.onShow(this.modal, this.activeElement, i);
|
|
374
|
+
} }, { key: "closeModal", value: function() {
|
|
375
|
+
var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null, i = this.modal;
|
|
376
|
+
if (this.modal.setAttribute("aria-hidden", "true"), this.removeEventListeners(), this.scrollBehaviour("enable"), this.activeElement && this.activeElement.focus && this.activeElement.focus(), this.config.onClose(this.modal, this.activeElement, o), this.config.awaitCloseAnimation) {
|
|
377
|
+
var s = this.config.openClass;
|
|
378
|
+
this.modal.addEventListener("animationend", function l() {
|
|
379
|
+
i.classList.remove(s), i.removeEventListener("animationend", l, !1);
|
|
380
|
+
}, !1);
|
|
381
|
+
} else i.classList.remove(this.config.openClass);
|
|
382
|
+
} }, { key: "closeModalById", value: function(o) {
|
|
383
|
+
this.modal = document.getElementById(o), this.modal && this.closeModal();
|
|
384
|
+
} }, { key: "scrollBehaviour", value: function(o) {
|
|
385
|
+
if (this.config.disableScroll) {
|
|
386
|
+
var i = document.querySelector("body");
|
|
387
|
+
switch (o) {
|
|
388
|
+
case "enable":
|
|
389
|
+
Object.assign(i.style, { overflow: "" });
|
|
390
|
+
break;
|
|
391
|
+
case "disable":
|
|
392
|
+
Object.assign(i.style, { overflow: "hidden" });
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
} }, { key: "addEventListeners", value: function() {
|
|
396
|
+
this.modal.addEventListener("touchstart", this.onClick), this.modal.addEventListener("click", this.onClick), document.addEventListener("keydown", this.onKeydown);
|
|
397
|
+
} }, { key: "removeEventListeners", value: function() {
|
|
398
|
+
this.modal.removeEventListener("touchstart", this.onClick), this.modal.removeEventListener("click", this.onClick), document.removeEventListener("keydown", this.onKeydown);
|
|
399
|
+
} }, { key: "onClick", value: function(o) {
|
|
400
|
+
(o.target.hasAttribute(this.config.closeTrigger) || o.target.parentNode.hasAttribute(this.config.closeTrigger)) && (o.preventDefault(), o.stopPropagation(), this.closeModal(o));
|
|
401
|
+
} }, { key: "onKeydown", value: function(o) {
|
|
402
|
+
o.keyCode === 27 && this.closeModal(o), o.keyCode === 9 && this.retainFocus(o);
|
|
403
|
+
} }, { key: "getFocusableNodes", value: function() {
|
|
404
|
+
var o = this.modal.querySelectorAll(V);
|
|
405
|
+
return Array.apply(void 0, E(o));
|
|
406
|
+
} }, { key: "setFocusToFirstNode", value: function() {
|
|
407
|
+
var o = this;
|
|
408
|
+
if (!this.config.disableFocus) {
|
|
409
|
+
var i = this.getFocusableNodes();
|
|
410
|
+
if (i.length !== 0) {
|
|
411
|
+
var s = i.filter(function(l) {
|
|
412
|
+
return !l.hasAttribute(o.config.closeTrigger);
|
|
413
|
+
});
|
|
414
|
+
s.length > 0 && s[0].focus(), s.length === 0 && i[0].focus();
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
} }, { key: "retainFocus", value: function(o) {
|
|
418
|
+
var i = this.getFocusableNodes();
|
|
419
|
+
if (i.length !== 0) if (i = i.filter(function(l) {
|
|
420
|
+
return l.offsetParent !== null;
|
|
421
|
+
}), this.modal.contains(document.activeElement)) {
|
|
422
|
+
var s = i.indexOf(document.activeElement);
|
|
423
|
+
o.shiftKey && s === 0 && (i[i.length - 1].focus(), o.preventDefault()), !o.shiftKey && i.length > 0 && s === i.length - 1 && (i[0].focus(), o.preventDefault());
|
|
424
|
+
} else i[0].focus();
|
|
425
|
+
} }]) && we(n.prototype, t), e;
|
|
426
|
+
}(), m = null, L = function(e) {
|
|
427
|
+
if (!document.getElementById(e)) return console.warn("MicroModal: ❗Seems like you have missed %c'".concat(e, "'"), "background-color: #f8f9fa;color: #50596c;font-weight: bold;", "ID somewhere in your code. Refer example below to resolve it."), console.warn("%cExample:", "background-color: #f8f9fa;color: #50596c;font-weight: bold;", '<div class="modal" id="'.concat(e, '"></div>')), !1;
|
|
428
|
+
}, G = function(e, n) {
|
|
429
|
+
if (function(o) {
|
|
430
|
+
o.length <= 0 && (console.warn("MicroModal: ❗Please specify at least one %c'micromodal-trigger'", "background-color: #f8f9fa;color: #50596c;font-weight: bold;", "data attribute."), console.warn("%cExample:", "background-color: #f8f9fa;color: #50596c;font-weight: bold;", '<a href="#" data-micromodal-trigger="my-modal"></a>'));
|
|
431
|
+
}(e), !n) return !0;
|
|
432
|
+
for (var t in n) L(t);
|
|
433
|
+
return !0;
|
|
434
|
+
}, { init: function(e) {
|
|
435
|
+
var n = Object.assign({}, { openTrigger: "data-micromodal-trigger" }, e), t = E(document.querySelectorAll("[".concat(n.openTrigger, "]"))), o = function(l, r) {
|
|
436
|
+
var a = [];
|
|
437
|
+
return l.forEach(function(u) {
|
|
438
|
+
var c = u.attributes[r].value;
|
|
439
|
+
a[c] === void 0 && (a[c] = []), a[c].push(u);
|
|
440
|
+
}), a;
|
|
441
|
+
}(t, n.openTrigger);
|
|
442
|
+
if (n.debugMode !== !0 || G(t, o) !== !1) for (var i in o) {
|
|
443
|
+
var s = o[i];
|
|
444
|
+
n.targetModal = i, n.triggers = E(s), m = new x(n);
|
|
445
|
+
}
|
|
446
|
+
}, show: function(e, n) {
|
|
447
|
+
var t = n || {};
|
|
448
|
+
t.targetModal = e, t.debugMode === !0 && L(e) === !1 || (m && m.removeEventListeners(), (m = new x(t)).showModal());
|
|
449
|
+
}, close: function(e) {
|
|
450
|
+
e ? m.closeModalById(e) : m.closeModal();
|
|
451
|
+
} });
|
|
452
|
+
typeof window < "u" && (window.MicroModal = _);
|
|
453
|
+
var Ee = /* @__PURE__ */ Y('<div class="modal micromodal-slide"id=mobileMenu><div class=modal__overlay tabindex=-1 data-micromodal-close><div class="modal__container MobileMenu"role=dialog><button type=button class="modal__close MobileMenu-closeBtn"data-micromodal-close>×'), Ae = /* @__PURE__ */ Y('<button class=MobileMenuBtn type=button><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor data-testid=IconBurger width=35 height=35><title>IconBurger</title><path d="M4 18h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zm0-5h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zM3 7c0 .55.45 1 1 1h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1z">');
|
|
454
|
+
function Me(e, n) {
|
|
455
|
+
const o = window.getComputedStyle(e).getPropertyValue("--siteAppMobileMenuMaxWidth");
|
|
456
|
+
if (!window.matchMedia(`(max-width: ${o})`).matches) return;
|
|
457
|
+
const s = document.querySelector('[data-mobile-menu="button"]');
|
|
458
|
+
if (!s) return;
|
|
459
|
+
_.init(), Se(e);
|
|
460
|
+
const l = (() => {
|
|
461
|
+
var a = Ee(), u = a.firstChild, c = u.firstChild;
|
|
462
|
+
return c.firstChild, ye(c, e, null), a;
|
|
463
|
+
})();
|
|
464
|
+
e.style.display === "none" && e.style.removeProperty("display"), document.body.appendChild(l);
|
|
465
|
+
const r = (() => {
|
|
466
|
+
var a = Ae();
|
|
467
|
+
return a.$$click = Ce, a;
|
|
468
|
+
})();
|
|
469
|
+
s.appendChild(r);
|
|
470
|
+
}
|
|
471
|
+
function Ce() {
|
|
472
|
+
_.show("mobileMenu");
|
|
473
|
+
}
|
|
474
|
+
function Se(e) {
|
|
475
|
+
const n = document.querySelectorAll("[data-mobile-menu-part]");
|
|
476
|
+
for (const t of n) {
|
|
477
|
+
const o = t.dataset.mobileMenuPart, i = t.dataset.mobileMenuAction !== "move", s = e.querySelector(`[data-inject="${o}"]`);
|
|
478
|
+
s && s.appendChild(i ? t.cloneNode(!0) : t);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
ve(["click"]);
|
|
482
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
483
|
+
const e = document.documentElement.lang, n = {
|
|
484
|
+
mobileMenu: Me
|
|
485
|
+
}, t = document.querySelectorAll("[data-effect]");
|
|
486
|
+
for (const i of t) {
|
|
487
|
+
const s = i.dataset.effect;
|
|
488
|
+
if (!s) continue;
|
|
489
|
+
const l = n[s];
|
|
490
|
+
l && l(i, {
|
|
491
|
+
language: e
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
const o = document.querySelectorAll("[data-activate-menu-items]");
|
|
495
|
+
for (const i of o)
|
|
496
|
+
le(i);
|
|
497
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.modal{font-family:-apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif}.modal__overlay{background:#0009;inset:0;position:fixed;z-index:1001}.modal__container{background-color:#fff;border-radius:4px;box-sizing:border-box;max-height:100vh;max-width:500px;overflow-y:auto}.modal__header{align-items:center;display:flex;justify-content:space-between}.modal__title{box-sizing:border-box;color:#00449e;font-size:1.25rem;font-weight:600;line-height:1.25;margin-bottom:0;margin-top:0}.modal__close{background:transparent;border:0}.modal__header .modal__close:before{content:"✕"}.modal__content{color:#000c;line-height:1.5;width:100%}.modal__btn{backface-visibility:hidden;background-color:#e6e6e6;border-radius:.25rem;border-style:none;border-width:0;color:#000c;cursor:pointer;font-size:.875rem;line-height:1.15;margin:0;overflow:visible;padding:.5rem 1rem;text-transform:none;transform:translateZ(0);transition:transform .25s ease-out;will-change:transform}.modal__btn:focus,.modal__btn:hover{transform:scale(1.05)}.modal__btn-primary{background-color:#00449e;color:#fff}@keyframes mmfadeIn{0%{opacity:0}to{opacity:1}}@keyframes mmfadeOut{0%{opacity:1}to{opacity:0}}@keyframes mmslideIn{0%{transform:translateY(15%)}to{transform:translateY(0)}}@keyframes mmslideOut{0%{transform:translateY(0)}to{transform:translateY(-10%)}}.micromodal-slide{display:none}.micromodal-slide.is-open{display:block}.micromodal-slide[aria-hidden=false] .modal__overlay{animation:mmfadeIn .3s cubic-bezier(0,0,.2,1)}.micromodal-slide[aria-hidden=false] .modal__container{animation:mmslideIn .3s cubic-bezier(0,0,.2,1)}.micromodal-slide[aria-hidden=true] .modal__overlay{animation:mmfadeOut .3s cubic-bezier(0,0,.2,1)}.micromodal-slide[aria-hidden=true] .modal__container{animation:mmslideOut .3s cubic-bezier(0,0,.2,1)}.micromodal-slide .modal__container,.micromodal-slide .modal__overlay{will-change:transform}.MobileMenu{height:100%;padding:20px;position:relative;width:100%}.MobileMenu-closeBtn{display:block;font-size:32px;height:50px;position:absolute;right:10px;top:10px;width:50px}
|