@startinblox/boilerplate 6.0.3 → 6.0.4
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 +125 -119
- package/package.json +8 -8
- package/src/helpers/i18n/configureLocalization.ts +12 -5
- package/vite.config.ts +7 -7
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const D = globalThis, tt = D.ShadowRoot && (D.ShadyCSS === void 0 || D.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, et = /* @__PURE__ */ Symbol(), ut = /* @__PURE__ */ new WeakMap();
|
|
2
|
-
let
|
|
2
|
+
let xt = class {
|
|
3
3
|
constructor(t, e, i) {
|
|
4
4
|
if (this._$cssResult$ = !0, i !== et) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
5
|
this.cssText = t, this.t = e;
|
|
@@ -17,14 +17,14 @@ let Rt = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const st = (s) => new
|
|
20
|
+
const st = (s) => new xt(typeof s == "string" ? s : s + "", void 0, et), rt = (s, ...t) => {
|
|
21
21
|
const e = s.length === 1 ? s[0] : t.reduce((i, r, o) => i + ((n) => {
|
|
22
22
|
if (n._$cssResult$ === !0) return n.cssText;
|
|
23
23
|
if (typeof n == "number") return n;
|
|
24
24
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
25
|
})(r) + s[o + 1], s[0]);
|
|
26
|
-
return new
|
|
27
|
-
},
|
|
26
|
+
return new xt(e, s, et);
|
|
27
|
+
}, Wt = (s, t) => {
|
|
28
28
|
if (tt) s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
29
29
|
else for (const e of t) {
|
|
30
30
|
const i = document.createElement("style"), r = D.litNonce;
|
|
@@ -35,10 +35,10 @@ const st = (s) => new Rt(typeof s == "string" ? s : s + "", void 0, et), rt = (s
|
|
|
35
35
|
for (const i of t.cssRules) e += i.cssText;
|
|
36
36
|
return st(e);
|
|
37
37
|
})(s) : s;
|
|
38
|
-
const { is:
|
|
38
|
+
const { is: Ft, defineProperty: Kt, getOwnPropertyDescriptor: Zt, getOwnPropertyNames: Jt, getOwnPropertySymbols: Xt, getPrototypeOf: Gt } = Object, W = globalThis, pt = W.trustedTypes, Qt = pt ? pt.emptyScript : "", Yt = W.reactiveElementPolyfillSupport, O = (s, t) => s, q = { toAttribute(s, t) {
|
|
39
39
|
switch (t) {
|
|
40
40
|
case Boolean:
|
|
41
|
-
s = s ?
|
|
41
|
+
s = s ? Qt : null;
|
|
42
42
|
break;
|
|
43
43
|
case Object:
|
|
44
44
|
case Array:
|
|
@@ -63,7 +63,7 @@ const { is: Wt, defineProperty: Ft, getOwnPropertyDescriptor: Kt, getOwnProperty
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return e;
|
|
66
|
-
} }, F = (s, t) => !
|
|
66
|
+
} }, F = (s, t) => !Ft(s, t), ft = { attribute: !0, type: String, converter: q, reflect: !1, useDefault: !1, hasChanged: F };
|
|
67
67
|
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), W.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
68
|
let E = class extends HTMLElement {
|
|
69
69
|
static addInitializer(t) {
|
|
@@ -75,11 +75,11 @@ let E = class extends HTMLElement {
|
|
|
75
75
|
static createProperty(t, e = ft) {
|
|
76
76
|
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
77
77
|
const i = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(t, i, e);
|
|
78
|
-
r !== void 0 &&
|
|
78
|
+
r !== void 0 && Kt(this.prototype, t, r);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
static getPropertyDescriptor(t, e, i) {
|
|
82
|
-
const { get: r, set: o } =
|
|
82
|
+
const { get: r, set: o } = Zt(this.prototype, t) ?? { get() {
|
|
83
83
|
return this[e];
|
|
84
84
|
}, set(n) {
|
|
85
85
|
this[e] = n;
|
|
@@ -94,13 +94,13 @@ let E = class extends HTMLElement {
|
|
|
94
94
|
}
|
|
95
95
|
static _$Ei() {
|
|
96
96
|
if (this.hasOwnProperty(O("elementProperties"))) return;
|
|
97
|
-
const t =
|
|
97
|
+
const t = Gt(this);
|
|
98
98
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
99
99
|
}
|
|
100
100
|
static finalize() {
|
|
101
101
|
if (this.hasOwnProperty(O("finalized"))) return;
|
|
102
102
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(O("properties"))) {
|
|
103
|
-
const e = this.properties, i = [...
|
|
103
|
+
const e = this.properties, i = [...Jt(e), ...Xt(e)];
|
|
104
104
|
for (const r of i) this.createProperty(r, e[r]);
|
|
105
105
|
}
|
|
106
106
|
const t = this[Symbol.metadata];
|
|
@@ -146,7 +146,7 @@ let E = class extends HTMLElement {
|
|
|
146
146
|
}
|
|
147
147
|
createRenderRoot() {
|
|
148
148
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
149
|
-
return
|
|
149
|
+
return Wt(t, this.constructor.elementStyles), t;
|
|
150
150
|
}
|
|
151
151
|
connectedCallback() {
|
|
152
152
|
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.());
|
|
@@ -246,9 +246,9 @@ let E = class extends HTMLElement {
|
|
|
246
246
|
firstUpdated(t) {
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[O("elementProperties")] = /* @__PURE__ */ new Map(), E[O("finalized")] = /* @__PURE__ */ new Map(),
|
|
250
|
-
const
|
|
251
|
-
let
|
|
249
|
+
E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[O("elementProperties")] = /* @__PURE__ */ new Map(), E[O("finalized")] = /* @__PURE__ */ new Map(), Yt?.({ ReactiveElement: E }), (W.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
+
const te = /* @__PURE__ */ Symbol();
|
|
251
|
+
let ee = class {
|
|
252
252
|
get taskComplete() {
|
|
253
253
|
return this.t || (this.i === 1 ? this.t = new Promise(((t, e) => {
|
|
254
254
|
this.o = t, this.h = e;
|
|
@@ -257,7 +257,7 @@ let te = class {
|
|
|
257
257
|
constructor(t, e, i) {
|
|
258
258
|
this.p = 0, this.i = 0, (this._ = t).addController(this);
|
|
259
259
|
const r = typeof e == "object" ? e : { task: e, args: i };
|
|
260
|
-
this.v = r.task, this.j = r.args, this.m = r.argsEqual ??
|
|
260
|
+
this.v = r.task, this.j = r.args, this.m = r.argsEqual ?? se, this.k = r.onComplete, this.A = r.onError, this.autoRun = r.autoRun ?? !0, "initialValue" in r && (this.u = r.initialValue, this.i = 2, this.O = this.T?.());
|
|
261
261
|
}
|
|
262
262
|
hostUpdate() {
|
|
263
263
|
this.autoRun === !0 && this.S();
|
|
@@ -287,7 +287,7 @@ let te = class {
|
|
|
287
287
|
o = !0, i = n;
|
|
288
288
|
}
|
|
289
289
|
if (this.p === r) {
|
|
290
|
-
if (e ===
|
|
290
|
+
if (e === te) this.i = 0;
|
|
291
291
|
else {
|
|
292
292
|
if (o === !1) {
|
|
293
293
|
try {
|
|
@@ -334,43 +334,43 @@ let te = class {
|
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
};
|
|
337
|
-
const
|
|
338
|
-
const it = globalThis, _t = (s) => s, k = it.trustedTypes, $t = k ? k.createPolicy("lit-html", { createHTML: (s) => s }) : void 0,
|
|
337
|
+
const se = (s, t) => s === t || s.length === t.length && s.every(((e, i) => !F(e, t[i])));
|
|
338
|
+
const it = globalThis, _t = (s) => s, k = it.trustedTypes, $t = k ? k.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, Ot = "$lit$", v = `lit$${Math.random().toFixed(9).slice(2)}$`, jt = "?" + v, re = `<${jt}>`, S = document, j = () => S.createComment(""), T = (s) => s === null || typeof s != "object" && typeof s != "function", ot = Array.isArray, ie = (s) => ot(s) || typeof s?.[Symbol.iterator] == "function", Z = `[
|
|
339
339
|
\f\r]`, x = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, gt = /-->/g, yt = />/g, m = RegExp(`>|${Z}(?:([^\\s"'>=/]+)(${Z}*=${Z}*(?:[^
|
|
340
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), vt = /'/g, mt = /"/g,
|
|
341
|
-
function
|
|
340
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), vt = /'/g, mt = /"/g, Tt = /^(?:script|style|textarea|title)$/i, oe = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), L = oe(1), C = /* @__PURE__ */ Symbol.for("lit-noChange"), d = /* @__PURE__ */ Symbol.for("lit-nothing"), bt = /* @__PURE__ */ new WeakMap(), A = S.createTreeWalker(S, 129);
|
|
341
|
+
function Lt(s, t) {
|
|
342
342
|
if (!ot(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
343
343
|
return $t !== void 0 ? $t.createHTML(t) : t;
|
|
344
344
|
}
|
|
345
|
-
const
|
|
345
|
+
const ne = (s, t) => {
|
|
346
346
|
const e = s.length - 1, i = [];
|
|
347
347
|
let r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = x;
|
|
348
348
|
for (let c = 0; c < e; c++) {
|
|
349
349
|
const a = s[c];
|
|
350
350
|
let l, u, h = -1, p = 0;
|
|
351
|
-
for (; p < a.length && (n.lastIndex = p, u = n.exec(a), u !== null); ) p = n.lastIndex, n === x ? u[1] === "!--" ? n = gt : u[1] !== void 0 ? n = yt : u[2] !== void 0 ? (
|
|
351
|
+
for (; p < a.length && (n.lastIndex = p, u = n.exec(a), u !== null); ) p = n.lastIndex, n === x ? u[1] === "!--" ? n = gt : u[1] !== void 0 ? n = yt : u[2] !== void 0 ? (Tt.test(u[2]) && (r = RegExp("</" + u[2], "g")), n = m) : u[3] !== void 0 && (n = m) : n === m ? u[0] === ">" ? (n = r ?? x, h = -1) : u[1] === void 0 ? h = -2 : (h = n.lastIndex - u[2].length, l = u[1], n = u[3] === void 0 ? m : u[3] === '"' ? mt : vt) : n === mt || n === vt ? n = m : n === gt || n === yt ? n = x : (n = m, r = void 0);
|
|
352
352
|
const y = n === m && s[c + 1].startsWith("/>") ? " " : "";
|
|
353
|
-
o += n === x ? a +
|
|
353
|
+
o += n === x ? a + re : h >= 0 ? (i.push(l), a.slice(0, h) + Ot + a.slice(h) + v + y) : a + v + (h === -2 ? c : y);
|
|
354
354
|
}
|
|
355
|
-
return [
|
|
355
|
+
return [Lt(s, o + (s[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
|
|
356
356
|
};
|
|
357
357
|
class U {
|
|
358
358
|
constructor({ strings: t, _$litType$: e }, i) {
|
|
359
359
|
let r;
|
|
360
360
|
this.parts = [];
|
|
361
361
|
let o = 0, n = 0;
|
|
362
|
-
const c = t.length - 1, a = this.parts, [l, u] =
|
|
362
|
+
const c = t.length - 1, a = this.parts, [l, u] = ne(t, e);
|
|
363
363
|
if (this.el = U.createElement(l, i), A.currentNode = this.el.content, e === 2 || e === 3) {
|
|
364
364
|
const h = this.el.content.firstChild;
|
|
365
365
|
h.replaceWith(...h.childNodes);
|
|
366
366
|
}
|
|
367
367
|
for (; (r = A.nextNode()) !== null && a.length < c; ) {
|
|
368
368
|
if (r.nodeType === 1) {
|
|
369
|
-
if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(
|
|
369
|
+
if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(Ot)) {
|
|
370
370
|
const p = u[n++], y = r.getAttribute(h).split(v), N = /([.?@])?(.*)/.exec(p);
|
|
371
|
-
a.push({ type: 1, index: o, name: N[2], strings: y, ctor: N[1] === "." ?
|
|
371
|
+
a.push({ type: 1, index: o, name: N[2], strings: y, ctor: N[1] === "." ? ce : N[1] === "?" ? le : N[1] === "@" ? he : K }), r.removeAttribute(h);
|
|
372
372
|
} else h.startsWith(v) && (a.push({ type: 6, index: o }), r.removeAttribute(h));
|
|
373
|
-
if (
|
|
373
|
+
if (Tt.test(r.tagName)) {
|
|
374
374
|
const h = r.textContent.split(v), p = h.length - 1;
|
|
375
375
|
if (p > 0) {
|
|
376
376
|
r.textContent = k ? k.emptyScript : "";
|
|
@@ -378,7 +378,7 @@ class U {
|
|
|
378
378
|
r.append(h[p], j());
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
|
-
} else if (r.nodeType === 8) if (r.data ===
|
|
381
|
+
} else if (r.nodeType === 8) if (r.data === jt) a.push({ type: 2, index: o });
|
|
382
382
|
else {
|
|
383
383
|
let h = -1;
|
|
384
384
|
for (; (h = r.data.indexOf(v, h + 1)) !== -1; ) a.push({ type: 7, index: o }), h += v.length - 1;
|
|
@@ -397,7 +397,7 @@ function R(s, t, e = s, i) {
|
|
|
397
397
|
const o = T(t) ? void 0 : t._$litDirective$;
|
|
398
398
|
return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(s), r._$AT(s, e, i)), i !== void 0 ? (e._$Co ??= [])[i] = r : e._$Cl = r), r !== void 0 && (t = R(s, r._$AS(s, t.values), r, i)), t;
|
|
399
399
|
}
|
|
400
|
-
class
|
|
400
|
+
class ae {
|
|
401
401
|
constructor(t, e) {
|
|
402
402
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
403
403
|
}
|
|
@@ -414,7 +414,7 @@ class ne {
|
|
|
414
414
|
for (; a !== void 0; ) {
|
|
415
415
|
if (n === a.index) {
|
|
416
416
|
let l;
|
|
417
|
-
a.type === 2 ? l = new M(o, o.nextSibling, this, t) : a.type === 1 ? l = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (l = new
|
|
417
|
+
a.type === 2 ? l = new M(o, o.nextSibling, this, t) : a.type === 1 ? l = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (l = new ue(o, this, t)), this._$AV.push(l), a = i[++c];
|
|
418
418
|
}
|
|
419
419
|
n !== a?.index && (o = A.nextNode(), n++);
|
|
420
420
|
}
|
|
@@ -444,7 +444,7 @@ class M {
|
|
|
444
444
|
return this._$AB;
|
|
445
445
|
}
|
|
446
446
|
_$AI(t, e = this) {
|
|
447
|
-
t = R(this, t, e), T(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== C && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) :
|
|
447
|
+
t = R(this, t, e), T(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== C && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : ie(t) ? this.k(t) : this._(t);
|
|
448
448
|
}
|
|
449
449
|
O(t) {
|
|
450
450
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -456,10 +456,10 @@ class M {
|
|
|
456
456
|
this._$AH !== d && T(this._$AH) ? this._$AA.nextSibling.data = t : this.T(S.createTextNode(t)), this._$AH = t;
|
|
457
457
|
}
|
|
458
458
|
$(t) {
|
|
459
|
-
const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = U.createElement(
|
|
459
|
+
const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = U.createElement(Lt(i.h, i.h[0]), this.options)), i);
|
|
460
460
|
if (this._$AH?._$AD === r) this._$AH.p(e);
|
|
461
461
|
else {
|
|
462
|
-
const o = new
|
|
462
|
+
const o = new ae(r, this), n = o.u(this.options);
|
|
463
463
|
o.p(e), this.T(n), this._$AH = o;
|
|
464
464
|
}
|
|
465
465
|
}
|
|
@@ -509,7 +509,7 @@ class K {
|
|
|
509
509
|
t === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
class
|
|
512
|
+
class ce extends K {
|
|
513
513
|
constructor() {
|
|
514
514
|
super(...arguments), this.type = 3;
|
|
515
515
|
}
|
|
@@ -517,7 +517,7 @@ class ae extends K {
|
|
|
517
517
|
this.element[this.name] = t === d ? void 0 : t;
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
|
-
class
|
|
520
|
+
class le extends K {
|
|
521
521
|
constructor() {
|
|
522
522
|
super(...arguments), this.type = 4;
|
|
523
523
|
}
|
|
@@ -525,7 +525,7 @@ class ce extends K {
|
|
|
525
525
|
this.element.toggleAttribute(this.name, !!t && t !== d);
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
class
|
|
528
|
+
class he extends K {
|
|
529
529
|
constructor(t, e, i, r, o) {
|
|
530
530
|
super(t, e, i, r, o), this.type = 5;
|
|
531
531
|
}
|
|
@@ -538,7 +538,7 @@ class le extends K {
|
|
|
538
538
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
539
539
|
}
|
|
540
540
|
}
|
|
541
|
-
class
|
|
541
|
+
class ue {
|
|
542
542
|
constructor(t, e, i) {
|
|
543
543
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
|
|
544
544
|
}
|
|
@@ -549,9 +549,9 @@ class he {
|
|
|
549
549
|
R(this, t);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
|
-
const
|
|
553
|
-
|
|
554
|
-
const
|
|
552
|
+
const de = it.litHtmlPolyfillSupport;
|
|
553
|
+
de?.(U, M), (it.litHtmlVersions ??= []).push("3.3.2");
|
|
554
|
+
const pe = (s, t, e) => {
|
|
555
555
|
const i = e?.renderBefore ?? t;
|
|
556
556
|
let r = i._$litPart$;
|
|
557
557
|
if (r === void 0) {
|
|
@@ -571,7 +571,7 @@ class P extends E {
|
|
|
571
571
|
}
|
|
572
572
|
update(t) {
|
|
573
573
|
const e = this.render();
|
|
574
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
|
574
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = pe(e, this.renderRoot, this.renderOptions);
|
|
575
575
|
}
|
|
576
576
|
connectedCallback() {
|
|
577
577
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -584,15 +584,15 @@ class P extends E {
|
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
586
|
P._$litElement$ = !0, P.finalized = !0, nt.litElementHydrateSupport?.({ LitElement: P });
|
|
587
|
-
const
|
|
588
|
-
|
|
587
|
+
const fe = nt.litElementPolyfillSupport;
|
|
588
|
+
fe?.({ LitElement: P });
|
|
589
589
|
(nt.litElementVersions ??= []).push("4.2.2");
|
|
590
590
|
const at = (s) => (t, e) => {
|
|
591
591
|
e !== void 0 ? e.addInitializer(() => {
|
|
592
592
|
customElements.define(s, t);
|
|
593
593
|
}) : customElements.define(s, t);
|
|
594
594
|
};
|
|
595
|
-
const
|
|
595
|
+
const _e = { attribute: !0, type: String, converter: q, reflect: !1, hasChanged: F }, $e = (s = _e, t, e) => {
|
|
596
596
|
const { kind: i, metadata: r } = e;
|
|
597
597
|
let o = globalThis.litPropertyMetadata.get(r);
|
|
598
598
|
if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), i === "setter" && ((s = Object.create(s)).wrapped = !0), o.set(e.name, s), i === "accessor") {
|
|
@@ -614,7 +614,7 @@ const fe = { attribute: !0, type: String, converter: q, reflect: !1, hasChanged:
|
|
|
614
614
|
throw Error("Unsupported decorator location: " + i);
|
|
615
615
|
};
|
|
616
616
|
function f(s) {
|
|
617
|
-
return (t, e) => typeof e == "object" ?
|
|
617
|
+
return (t, e) => typeof e == "object" ? $e(s, t, e) : ((i, r, o) => {
|
|
618
618
|
const n = r.hasOwnProperty(o);
|
|
619
619
|
return r.constructor.createProperty(o, i), n ? Object.getOwnPropertyDescriptor(r, o) : void 0;
|
|
620
620
|
})(s, t, e);
|
|
@@ -627,7 +627,7 @@ function ct(s) {
|
|
|
627
627
|
s(!0);
|
|
628
628
|
});
|
|
629
629
|
});
|
|
630
|
-
class
|
|
630
|
+
class ge extends P {
|
|
631
631
|
constructor() {
|
|
632
632
|
super(...arguments), this.object = {
|
|
633
633
|
"@id": ""
|
|
@@ -637,10 +637,10 @@ class $e extends P {
|
|
|
637
637
|
};
|
|
638
638
|
}
|
|
639
639
|
}
|
|
640
|
-
var
|
|
640
|
+
var ye = Object.defineProperty, ve = (s, t, e, i) => {
|
|
641
641
|
for (var r = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
642
642
|
(n = s[o]) && (r = n(t, e, r) || r);
|
|
643
|
-
return r &&
|
|
643
|
+
return r && ye(t, e, r), r;
|
|
644
644
|
};
|
|
645
645
|
class lt extends P {
|
|
646
646
|
constructor() {
|
|
@@ -650,13 +650,13 @@ class lt extends P {
|
|
|
650
650
|
});
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
|
-
|
|
653
|
+
ve([
|
|
654
654
|
f({ attribute: !1 })
|
|
655
655
|
], lt.prototype, "objects");
|
|
656
|
-
var
|
|
656
|
+
var me = Object.defineProperty, g = (s, t, e, i) => {
|
|
657
657
|
for (var r = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
658
658
|
(n = s[o]) && (r = n(t, e, r) || r);
|
|
659
|
-
return r &&
|
|
659
|
+
return r && me(t, e, r), r;
|
|
660
660
|
};
|
|
661
661
|
class _ extends lt {
|
|
662
662
|
constructor({
|
|
@@ -676,7 +676,7 @@ class _ extends lt {
|
|
|
676
676
|
}
|
|
677
677
|
async _attach(t, e, i) {
|
|
678
678
|
if (!this.orbit && window.orbit && (this.orbit = window.orbit, e)) {
|
|
679
|
-
if (
|
|
679
|
+
if (Ae({
|
|
680
680
|
component: this,
|
|
681
681
|
defaultRoute: t,
|
|
682
682
|
ignoreRouter: i
|
|
@@ -707,7 +707,7 @@ class _ extends lt {
|
|
|
707
707
|
);
|
|
708
708
|
c && (i = c[0]?.uniq);
|
|
709
709
|
}
|
|
710
|
-
i &&
|
|
710
|
+
i && Ee(
|
|
711
711
|
(window.orbit ? window.orbit.getRoute(i, !0) : i) + (r ? `-${r}` : ""),
|
|
712
712
|
o
|
|
713
713
|
), t.preventDefault();
|
|
@@ -803,7 +803,7 @@ g([
|
|
|
803
803
|
g([
|
|
804
804
|
ct()
|
|
805
805
|
], _.prototype, "currentRoute");
|
|
806
|
-
const
|
|
806
|
+
const be = (s, { keywords: t = [], attributes: e = ["dataSrc"] } = {}) => {
|
|
807
807
|
const i = () => {
|
|
808
808
|
if (!t.length || !e.length) return;
|
|
809
809
|
s.caching === void 0 && (s.caching = 0), s.hasCachedDatas === void 0 && (s.hasCachedDatas = !1);
|
|
@@ -831,15 +831,15 @@ const me = (s, { keywords: t = [], attributes: e = ["dataSrc"] } = {}) => {
|
|
|
831
831
|
} else
|
|
832
832
|
i();
|
|
833
833
|
};
|
|
834
|
-
function
|
|
834
|
+
function we() {
|
|
835
835
|
return `${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
836
836
|
}
|
|
837
|
-
const
|
|
837
|
+
const Ae = ({
|
|
838
838
|
component: s,
|
|
839
839
|
defaultRoute: t = !1,
|
|
840
840
|
ignoreRouter: e = !1
|
|
841
841
|
}) => {
|
|
842
|
-
if (s.uniq || (s.uniq =
|
|
842
|
+
if (s.uniq || (s.uniq = we(), t && !s.route && !e && (s.route = t)), s._subscriptions = /* @__PURE__ */ new Set(), !e) {
|
|
843
843
|
s.route || (s.route = s.uniq, window.orbit && (s.route = window.orbit.getRoute(s.uniq))), s.noRouter = !0;
|
|
844
844
|
let i = document.querySelector("solid-router");
|
|
845
845
|
const r = window.sibRouter.currentResource;
|
|
@@ -875,7 +875,7 @@ const we = ({
|
|
|
875
875
|
else
|
|
876
876
|
return;
|
|
877
877
|
return e;
|
|
878
|
-
},
|
|
878
|
+
}, Se = (s, t, e = "asc") => {
|
|
879
879
|
const i = Array.isArray(t) ? t : [t], r = e !== "asc", o = [...s], c = (() => {
|
|
880
880
|
const a = b(o[0], i);
|
|
881
881
|
if (typeof a == "number")
|
|
@@ -899,7 +899,7 @@ const we = ({
|
|
|
899
899
|
const u = c(a, l);
|
|
900
900
|
return r ? -u : u;
|
|
901
901
|
}), o;
|
|
902
|
-
},
|
|
902
|
+
}, Ee = (s, t = !1) => {
|
|
903
903
|
window.dispatchEvent(
|
|
904
904
|
new CustomEvent("requestNavigation", {
|
|
905
905
|
detail: {
|
|
@@ -909,28 +909,28 @@ const we = ({
|
|
|
909
909
|
})
|
|
910
910
|
);
|
|
911
911
|
}, wt = {};
|
|
912
|
-
var
|
|
913
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
912
|
+
var Pe = Object.getOwnPropertyDescriptor, Ce = (s, t, e, i) => {
|
|
913
|
+
for (var r = i > 1 ? void 0 : i ? Pe(t, e) : t, o = s.length - 1, n; o >= 0; o--)
|
|
914
914
|
(n = s[o]) && (r = n(r) || r);
|
|
915
915
|
return r;
|
|
916
916
|
};
|
|
917
917
|
let G = class extends _ {
|
|
918
918
|
constructor() {
|
|
919
|
-
super(...arguments), this.cherryPickedProperties = [{ key: "name", value: "name" }], this._getResource = new
|
|
919
|
+
super(...arguments), this.cherryPickedProperties = [{ key: "name", value: "name" }], this._getResource = new ee(this, {
|
|
920
920
|
task: async ([s]) => {
|
|
921
921
|
if (!(!s || !this.orbit || !this.noRouter && this.route && this.currentRoute && !this.route.startsWith(this.currentRoute))) {
|
|
922
922
|
if (!this.hasCachedDatas || this.oldDataSrc !== s) {
|
|
923
923
|
if (!s) return;
|
|
924
924
|
this.datas = await this._getProxyValue(s), this.hasCachedDatas = !0;
|
|
925
925
|
}
|
|
926
|
-
return this.oldDataSrc !== s && (this.oldDataSrc = s),
|
|
926
|
+
return this.oldDataSrc !== s && (this.oldDataSrc = s), Se(this.datas, "name", "asc");
|
|
927
927
|
}
|
|
928
928
|
},
|
|
929
929
|
args: () => [this.dataSrc, this.caching, this.currentRoute]
|
|
930
930
|
});
|
|
931
931
|
}
|
|
932
932
|
async _afterAttach() {
|
|
933
|
-
return
|
|
933
|
+
return be(this, {
|
|
934
934
|
keywords: ["some-keyword", "for-invalidating", "cache"]
|
|
935
935
|
}), Promise.resolve();
|
|
936
936
|
}
|
|
@@ -953,28 +953,28 @@ G.styles = rt`
|
|
|
953
953
|
bottom: 0;
|
|
954
954
|
}
|
|
955
955
|
`;
|
|
956
|
-
G =
|
|
956
|
+
G = Ce([
|
|
957
957
|
at("solid-boilerplate")
|
|
958
958
|
], G);
|
|
959
959
|
const Q = "lit-localize-status";
|
|
960
|
-
const
|
|
960
|
+
const Re = (s, ...t) => ({
|
|
961
961
|
strTag: !0,
|
|
962
962
|
strings: s,
|
|
963
963
|
values: t
|
|
964
|
-
}),
|
|
964
|
+
}), Ut = Re, xe = (s) => typeof s != "string" && "strTag" in s, Mt = (s, t, e) => {
|
|
965
965
|
let i = s[0];
|
|
966
966
|
for (let r = 1; r < s.length; r++)
|
|
967
967
|
i += t[e ? e[r - 1] : r - 1], i += s[r];
|
|
968
968
|
return i;
|
|
969
969
|
};
|
|
970
|
-
const
|
|
971
|
-
let ht =
|
|
972
|
-
function
|
|
970
|
+
const Nt = ((s) => xe(s) ? Mt(s.strings, s.values) : s);
|
|
971
|
+
let ht = Nt, At = !1;
|
|
972
|
+
function Oe(s) {
|
|
973
973
|
if (At)
|
|
974
974
|
throw new Error("lit-localize can only be configured once");
|
|
975
975
|
ht = s, At = !0;
|
|
976
976
|
}
|
|
977
|
-
class
|
|
977
|
+
class je {
|
|
978
978
|
constructor(t) {
|
|
979
979
|
this.__litLocalizeEventHandler = (e) => {
|
|
980
980
|
e.detail.status === "ready" && this.host.requestUpdate();
|
|
@@ -987,9 +987,9 @@ class Oe {
|
|
|
987
987
|
window.removeEventListener(Q, this.__litLocalizeEventHandler);
|
|
988
988
|
}
|
|
989
989
|
}
|
|
990
|
-
const
|
|
991
|
-
const
|
|
992
|
-
class
|
|
990
|
+
const Te = (s) => s.addController(new je(s)), Le = Te;
|
|
991
|
+
const Ht = () => (s, t) => (s.addInitializer(Le), s);
|
|
992
|
+
class Dt {
|
|
993
993
|
constructor() {
|
|
994
994
|
this.settled = !1, this.promise = new Promise((t, e) => {
|
|
995
995
|
this._resolve = t, this._reject = e;
|
|
@@ -1005,25 +1005,25 @@ class Ht {
|
|
|
1005
1005
|
const $ = [];
|
|
1006
1006
|
for (let s = 0; s < 256; s++)
|
|
1007
1007
|
$[s] = (s >> 4 & 15).toString(16) + (s & 15).toString(16);
|
|
1008
|
-
function
|
|
1008
|
+
function Ue(s) {
|
|
1009
1009
|
let t = 0, e = 8997, i = 0, r = 33826, o = 0, n = 40164, c = 0, a = 52210;
|
|
1010
1010
|
for (let l = 0; l < s.length; l++)
|
|
1011
1011
|
e ^= s.charCodeAt(l), t = e * 435, i = r * 435, o = n * 435, c = a * 435, o += e << 8, c += r << 8, i += t >>> 16, e = t & 65535, o += i >>> 16, r = i & 65535, a = c + (o >>> 16) & 65535, n = o & 65535;
|
|
1012
1012
|
return $[a >> 8] + $[a & 255] + $[n >> 8] + $[n & 255] + $[r >> 8] + $[r & 255] + $[e >> 8] + $[e & 255];
|
|
1013
1013
|
}
|
|
1014
|
-
const
|
|
1015
|
-
function
|
|
1016
|
-
return (t ?
|
|
1014
|
+
const Me = "", Ne = "h", He = "s";
|
|
1015
|
+
function De(s, t) {
|
|
1016
|
+
return (t ? Ne : He) + Ue(typeof s == "string" ? s : s.join(Me));
|
|
1017
1017
|
}
|
|
1018
1018
|
const St = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new Map();
|
|
1019
|
-
function
|
|
1019
|
+
function qe(s, t, e) {
|
|
1020
1020
|
if (s) {
|
|
1021
|
-
const i = e?.id ??
|
|
1021
|
+
const i = e?.id ?? ke(t), r = s[i];
|
|
1022
1022
|
if (r) {
|
|
1023
1023
|
if (typeof r == "string")
|
|
1024
1024
|
return r;
|
|
1025
1025
|
if ("strTag" in r)
|
|
1026
|
-
return
|
|
1026
|
+
return Mt(
|
|
1027
1027
|
r.strings,
|
|
1028
1028
|
// Cast `template` because its type wasn't automatically narrowed (but
|
|
1029
1029
|
// we know it must be the same type as `localized`).
|
|
@@ -1039,20 +1039,20 @@ function De(s, t, e) {
|
|
|
1039
1039
|
}
|
|
1040
1040
|
}
|
|
1041
1041
|
}
|
|
1042
|
-
return
|
|
1042
|
+
return Nt(t);
|
|
1043
1043
|
}
|
|
1044
|
-
function
|
|
1044
|
+
function ke(s) {
|
|
1045
1045
|
const t = typeof s == "string" ? s : s.strings;
|
|
1046
1046
|
let e = Et.get(t);
|
|
1047
|
-
return e === void 0 && (e =
|
|
1047
|
+
return e === void 0 && (e = De(t, typeof s != "string" && !("strTag" in s)), Et.set(t, e)), e;
|
|
1048
1048
|
}
|
|
1049
1049
|
function J(s) {
|
|
1050
1050
|
window.dispatchEvent(new CustomEvent(Q, { detail: s }));
|
|
1051
1051
|
}
|
|
1052
|
-
let z = "", X,
|
|
1052
|
+
let z = "", X, qt, I, Y, kt, w = new Dt();
|
|
1053
1053
|
w.resolve();
|
|
1054
1054
|
let H = 0;
|
|
1055
|
-
const
|
|
1055
|
+
const ze = (s) => (Oe(((t, e) => qe(kt, t, e))), z = qt = s.sourceLocale, I = new Set(s.targetLocales), I.add(s.sourceLocale), Y = s.loadLocale, { getLocale: Ie, setLocale: Ve }), Ie = () => z, Ve = (s) => {
|
|
1056
1056
|
if (s === (X ?? z))
|
|
1057
1057
|
return w.promise;
|
|
1058
1058
|
if (!I || !Y)
|
|
@@ -1061,13 +1061,13 @@ const ke = (s) => (xe(((t, e) => De(qt, t, e))), z = Dt = s.sourceLocale, I = ne
|
|
|
1061
1061
|
throw new Error("Invalid locale code");
|
|
1062
1062
|
H++;
|
|
1063
1063
|
const t = H;
|
|
1064
|
-
return X = s, w.settled && (w = new
|
|
1064
|
+
return X = s, w.settled && (w = new Dt()), J({ status: "loading", loadingLocale: s }), (s === qt ? (
|
|
1065
1065
|
// We could switch to the source locale synchronously, but we prefer to
|
|
1066
1066
|
// queue it on a microtask so that switching locales is consistently
|
|
1067
1067
|
// asynchronous.
|
|
1068
1068
|
Promise.resolve({ templates: void 0 })
|
|
1069
1069
|
) : Y(s)).then((i) => {
|
|
1070
|
-
H === t && (z = s, X = void 0,
|
|
1070
|
+
H === t && (z = s, X = void 0, kt = i.templates, J({ status: "ready", readyLocale: s }), w.resolve());
|
|
1071
1071
|
}, (i) => {
|
|
1072
1072
|
H === t && (J({
|
|
1073
1073
|
status: "error",
|
|
@@ -1075,36 +1075,36 @@ const ke = (s) => (xe(((t, e) => De(qt, t, e))), z = Dt = s.sourceLocale, I = ne
|
|
|
1075
1075
|
errorMessage: i.toString()
|
|
1076
1076
|
}), w.reject(i));
|
|
1077
1077
|
}), w.promise;
|
|
1078
|
-
},
|
|
1079
|
-
var
|
|
1080
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1078
|
+
}, zt = ":host{background-color:pink;user-select:none}";
|
|
1079
|
+
var Be = Object.defineProperty, We = Object.getOwnPropertyDescriptor, It = (s, t, e, i) => {
|
|
1080
|
+
for (var r = i > 1 ? void 0 : i ? We(t, e) : t, o = s.length - 1, n; o >= 0; o--)
|
|
1081
1081
|
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
|
|
1082
|
-
return i && r &&
|
|
1082
|
+
return i && r && Be(t, e, r), r;
|
|
1083
1083
|
};
|
|
1084
|
-
let V = class extends
|
|
1084
|
+
let V = class extends ge {
|
|
1085
1085
|
constructor() {
|
|
1086
1086
|
super(...arguments), this.object = { "@id": "" };
|
|
1087
1087
|
}
|
|
1088
1088
|
render() {
|
|
1089
1089
|
return this.isType("some:Type") ? d : L`<li>
|
|
1090
|
-
${ht(
|
|
1090
|
+
${ht(Ut`Sample object named: ${this.object.name}`)}
|
|
1091
1091
|
</li>`;
|
|
1092
1092
|
}
|
|
1093
1093
|
};
|
|
1094
1094
|
V.styles = rt`
|
|
1095
|
-
${st(
|
|
1095
|
+
${st(zt)}
|
|
1096
1096
|
`;
|
|
1097
|
-
|
|
1097
|
+
It([
|
|
1098
1098
|
f({ attribute: !1, type: Object })
|
|
1099
1099
|
], V.prototype, "object", 2);
|
|
1100
|
-
V =
|
|
1100
|
+
V = It([
|
|
1101
1101
|
at("sample-object"),
|
|
1102
|
-
|
|
1102
|
+
Ht()
|
|
1103
1103
|
], V);
|
|
1104
|
-
var
|
|
1105
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1104
|
+
var Fe = Object.defineProperty, Ke = Object.getOwnPropertyDescriptor, Vt = (s, t, e, i) => {
|
|
1105
|
+
for (var r = i > 1 ? void 0 : i ? Ke(t, e) : t, o = s.length - 1, n; o >= 0; o--)
|
|
1106
1106
|
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
|
|
1107
|
-
return i && r &&
|
|
1107
|
+
return i && r && Fe(t, e, r), r;
|
|
1108
1108
|
};
|
|
1109
1109
|
let B = class extends lt {
|
|
1110
1110
|
constructor() {
|
|
@@ -1120,32 +1120,38 @@ let B = class extends lt {
|
|
|
1120
1120
|
}
|
|
1121
1121
|
};
|
|
1122
1122
|
B.styles = rt`
|
|
1123
|
-
${st(
|
|
1123
|
+
${st(zt)}
|
|
1124
1124
|
`;
|
|
1125
|
-
|
|
1125
|
+
Vt([
|
|
1126
1126
|
f({ attribute: !1, type: Object })
|
|
1127
1127
|
], B.prototype, "objects", 2);
|
|
1128
|
-
B =
|
|
1128
|
+
B = Vt([
|
|
1129
1129
|
at("sample-objects"),
|
|
1130
|
-
|
|
1130
|
+
Ht()
|
|
1131
1131
|
], B);
|
|
1132
|
-
const
|
|
1133
|
-
s9cb0b52fd65ea225:
|
|
1132
|
+
const Ze = {
|
|
1133
|
+
s9cb0b52fd65ea225: Ut`Sample object named: ${0}`,
|
|
1134
1134
|
se975788b1544119d: "Here are all of our objects:"
|
|
1135
|
-
},
|
|
1135
|
+
}, Je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1136
1136
|
__proto__: null,
|
|
1137
|
-
templates:
|
|
1138
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1137
|
+
templates: Ze
|
|
1138
|
+
}, Symbol.toStringTag, { value: "Module" })), Pt = "en", Bt = [
|
|
1139
1139
|
"en"
|
|
1140
|
-
], Xe = /* @__PURE__ */ Object.assign({ "../../generated/locales/en.ts":
|
|
1141
|
-
|
|
1140
|
+
], Xe = /* @__PURE__ */ Object.assign({ "../../generated/locales/en.ts": Je }), Ge = new Map(
|
|
1141
|
+
Bt.map((s) => [
|
|
1142
1142
|
s,
|
|
1143
1143
|
Xe[`../../generated/locales/${s}.ts`]
|
|
1144
1144
|
])
|
|
1145
|
-
), { getLocale:
|
|
1146
|
-
|
|
1147
|
-
|
|
1145
|
+
), { getLocale: Ct, setLocale: Rt } = "/".includes(
|
|
1146
|
+
"cypress"
|
|
1147
|
+
) ? {
|
|
1148
|
+
getLocale: () => Pt,
|
|
1149
|
+
setLocale: () => {
|
|
1150
|
+
}
|
|
1151
|
+
} : ze({
|
|
1152
|
+
sourceLocale: Pt,
|
|
1153
|
+
targetLocales: Bt,
|
|
1148
1154
|
loadLocale: async (s) => Ge.get(s)
|
|
1149
1155
|
});
|
|
1150
|
-
window.getLocale = window.getLocale ? window.getLocale.push(
|
|
1151
|
-
window.setLocale = window.setLocale ? window.setLocale.push(
|
|
1156
|
+
window.getLocale = window.getLocale ? window.getLocale.push(Ct) : [Ct];
|
|
1157
|
+
window.setLocale = window.setLocale ? window.setLocale.push(Rt) : [Rt];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startinblox/boilerplate",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.4",
|
|
4
4
|
"description": "Startin'blox Boilerplate",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -67,14 +67,14 @@
|
|
|
67
67
|
"last 2 Chrome versions"
|
|
68
68
|
],
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@inquirer/prompts": "^8.
|
|
70
|
+
"@inquirer/prompts": "^8.3.0",
|
|
71
71
|
"@lit/localize": "^0.12.2",
|
|
72
72
|
"@lit/task": "^1.0.3",
|
|
73
|
-
"autoprefixer": "^10.4.
|
|
73
|
+
"autoprefixer": "^10.4.27",
|
|
74
74
|
"cssnano": "^7.1.2",
|
|
75
75
|
"lit": "^3.3.2",
|
|
76
76
|
"postcss": "^8.5.6",
|
|
77
|
-
"postcss-preset-env": "^11.
|
|
77
|
+
"postcss-preset-env": "^11.2.0",
|
|
78
78
|
"postcss-scss": "^4.0.9",
|
|
79
79
|
"sass": "^1.97.3",
|
|
80
80
|
"unplugin-icons": "^23.0.1",
|
|
@@ -82,11 +82,11 @@
|
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@lit/localize-tools": "^0.8.1",
|
|
85
|
-
"@storybook/addon-docs": "^10.2.
|
|
86
|
-
"@storybook/web-components-vite": "^10.2.
|
|
87
|
-
"cypress": "^15.
|
|
85
|
+
"@storybook/addon-docs": "^10.2.13",
|
|
86
|
+
"@storybook/web-components-vite": "^10.2.13",
|
|
87
|
+
"cypress": "^15.11.0",
|
|
88
88
|
"cypress-ct-lit": "^1.0.0",
|
|
89
89
|
"lorem-ipsum": "^2.0.8",
|
|
90
|
-
"storybook": "^10.2.
|
|
90
|
+
"storybook": "^10.2.13"
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -10,8 +10,15 @@ const localizedTemplates: Map<string, any> = new Map(
|
|
|
10
10
|
]),
|
|
11
11
|
);
|
|
12
12
|
|
|
13
|
-
export const { getLocale, setLocale } =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
export const { getLocale, setLocale } = !import.meta.env.BASE_URL.includes(
|
|
14
|
+
"cypress",
|
|
15
|
+
)
|
|
16
|
+
? configureLocalization({
|
|
17
|
+
sourceLocale,
|
|
18
|
+
targetLocales,
|
|
19
|
+
loadLocale: async (locale) => localizedTemplates.get(locale),
|
|
20
|
+
})
|
|
21
|
+
: {
|
|
22
|
+
getLocale: () => sourceLocale,
|
|
23
|
+
setLocale: () => {},
|
|
24
|
+
};
|
package/vite.config.ts
CHANGED
|
@@ -31,13 +31,13 @@ export default defineConfig({
|
|
|
31
31
|
],
|
|
32
32
|
resolve: {
|
|
33
33
|
alias: {
|
|
34
|
-
"@components": "
|
|
35
|
-
"@cypress": "
|
|
36
|
-
"@helpers": "
|
|
37
|
-
"@mocks": "
|
|
38
|
-
"@stories": "
|
|
39
|
-
"@styles": "
|
|
40
|
-
"@src": "
|
|
34
|
+
"@components": resolve(__dirname, "./src/components"),
|
|
35
|
+
"@cypress": resolve(__dirname, "./cypress"),
|
|
36
|
+
"@helpers": resolve(__dirname, "./src/helpers"),
|
|
37
|
+
"@mocks": resolve(__dirname, "./src/mocks"),
|
|
38
|
+
"@stories": resolve(__dirname, "./stories"),
|
|
39
|
+
"@styles": resolve(__dirname, "./src/styles"),
|
|
40
|
+
"@src": resolve(__dirname, "./src"),
|
|
41
41
|
},
|
|
42
42
|
},
|
|
43
43
|
});
|