@nextrap/nte-nav 1.1.22 → 1.1.24

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/index.js +87 -87
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 1.1.24 (2025-09-11)
2
+
3
+ This was a version bump only for nte-nav to align it with other projects, there were no code changes.
4
+
5
+ ## 1.1.23 (2025-09-11)
6
+
7
+ This was a version bump only for nte-nav to align it with other projects, there were no code changes.
8
+
1
9
  ## 1.1.22 (2025-09-11)
2
10
 
3
11
  This was a version bump only for nte-nav to align it with other projects, there were no code changes.
package/index.js CHANGED
@@ -3,28 +3,28 @@ import "@nextrap/nte-offcanvas";
3
3
  import { html as M, unsafeCSS as J, LitElement as K } from "lit";
4
4
  import { customElement as Q, property as N, state as V } from "lit/decorators.js";
5
5
  import { createRef as $t, ref as xt } from "lit/directives/ref.js";
6
- import { EventBindingsMixin as se, LoggingMixin as le, Listen as de, waitForLoad as ce } from "@trunkjs/browser-utils";
7
- import { styleMap as he } from "lit/directives/style-map.js";
6
+ import { EventBindingsMixin as se, LoggingMixin as le, Listen as de, waitForLoad as ce, sleep as he } from "@trunkjs/browser-utils";
7
+ import { styleMap as pe } from "lit/directives/style-map.js";
8
8
  import "@nextrap/nte-burger";
9
- const pe = ":host{--container-width: var(--nt-container-width);--text-color: var(--nt-text);--hover-color: var(--nt-primary);--hover-text-color: var(--nt-text-on-primary);--transition: .2s ease-in-out;--submenu-bg: var(--nt-light);--submenu-text-color: var(--nt-text);--justify-content: center;--sidemenu-bg: var(--nt-primary-subtle);--justify-sidebar-burger: flex-end;--height: auto;--default-alpha: .7;height:var(--height);display:block}nav{height:100%}#main{height:100%}#burger-wrapper{padding:15px}#text{padding-right:10px}#burger-default{cursor:pointer}#burger-default slot::slotted(span){color:rgb(from var(--text-color) r g b/var(--default-alpha));transition:color var(--transition)}#burger-default nte-burger{--color: rgb(from var(--text-color) r g b / var(--default-alpha))}#burger-default:hover slot::slotted(span){color:rgb(from var(--text-color) r g b/1)}#burger-default:hover nte-burger{--color: rgb(from var(--text-color) r g b / 1)}";
10
- var ve = Object.create, rt = Object.defineProperty, ue = Object.getOwnPropertyDescriptor, Mt = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), W = (t) => {
9
+ const ve = ":host{--container-width: var(--nt-container-width);--text-color: var(--nt-text);--hover-color: var(--nt-primary);--hover-text-color: var(--nt-text-on-primary);--transition: .2s ease-in-out;--submenu-bg: var(--nt-light);--submenu-text-color: var(--nt-text);--justify-content: center;--sidemenu-bg: var(--nt-primary-subtle);--justify-sidebar-burger: flex-end;--height: auto;--default-alpha: .7;height:var(--height);display:block}nav{height:100%}#main{height:100%}#burger-wrapper{padding:15px}#text{padding-right:10px}#burger-default{cursor:pointer}#burger-default slot::slotted(span){color:rgb(from var(--text-color) r g b/var(--default-alpha));transition:color var(--transition)}#burger-default nte-burger{--color: rgb(from var(--text-color) r g b / var(--default-alpha))}#burger-default:hover slot::slotted(span){color:rgb(from var(--text-color) r g b/1)}#burger-default:hover nte-burger{--color: rgb(from var(--text-color) r g b / 1)}";
10
+ var ue = Object.create, it = Object.defineProperty, _e = Object.getOwnPropertyDescriptor, Mt = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), W = (t) => {
11
11
  throw TypeError(t);
12
- }, _e = (t, e, r) => e in t ? rt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, kt = (t, e) => rt(t, "name", { value: e, configurable: !0 }), fe = (t) => [, , , ve((t == null ? void 0 : t[Mt("metadata")]) ?? null)], Lt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], F = (t) => t !== void 0 && typeof t != "function" ? W("Function expected") : t, ge = (t, e, r, o, a) => ({ kind: Lt[t], name: e, metadata: o, addInitializer: (n) => r._ ? W("Already initialized") : a.push(F(n || null)) }), be = (t, e) => _e(e, Mt("metadata"), t[3]), S = (t, e, r, o) => {
13
- for (var a = 0, n = t[e >> 1], h = n && n.length; a < h; a++) e & 1 ? n[a].call(r) : o = n[a].call(r, o);
12
+ }, fe = (t, e, i) => e in t ? it(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, kt = (t, e) => it(t, "name", { value: e, configurable: !0 }), ge = (t) => [, , , ue((t == null ? void 0 : t[Mt("metadata")]) ?? null)], Lt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], F = (t) => t !== void 0 && typeof t != "function" ? W("Function expected") : t, be = (t, e, i, o, a) => ({ kind: Lt[t], name: e, metadata: o, addInitializer: (n) => i._ ? W("Already initialized") : a.push(F(n || null)) }), me = (t, e) => fe(e, Mt("metadata"), t[3]), S = (t, e, i, o) => {
13
+ for (var a = 0, n = t[e >> 1], h = n && n.length; a < h; a++) e & 1 ? n[a].call(i) : o = n[a].call(i, o);
14
14
  return o;
15
- }, I = (t, e, r, o, a, n) => {
16
- var h, s, m, p, f, i = e & 7, g = !!(e & 8), d = !!(e & 16), _ = i > 3 ? t.length + 1 : i ? g ? 1 : 2 : 0, E = Lt[i + 5], z = i > 3 && (t[_ - 1] = []), A = t[_] || (t[_] = []), c = i && (!d && !g && (a = a.prototype), i < 5 && (i > 3 || !d) && ue(i < 4 ? a : { get [r]() {
15
+ }, B = (t, e, i, o, a, n) => {
16
+ var h, s, m, p, f, r = e & 7, g = !!(e & 8), d = !!(e & 16), _ = r > 3 ? t.length + 1 : r ? g ? 1 : 2 : 0, E = Lt[r + 5], z = r > 3 && (t[_ - 1] = []), A = t[_] || (t[_] = []), c = r && (!d && !g && (a = a.prototype), r < 5 && (r > 3 || !d) && _e(r < 4 ? a : { get [i]() {
17
17
  return Et(this, n);
18
- }, set [r](l) {
18
+ }, set [i](l) {
19
19
  return zt(this, n, l);
20
- } }, r));
21
- i ? d && i < 4 && kt(n, (i > 2 ? "set " : i > 1 ? "get " : "") + r) : kt(a, r);
20
+ } }, i));
21
+ r ? d && r < 4 && kt(n, (r > 2 ? "set " : r > 1 ? "get " : "") + i) : kt(a, i);
22
22
  for (var w = o.length - 1; w >= 0; w--)
23
- p = ge(i, r, m = {}, t[3], A), i && (p.static = g, p.private = d, f = p.access = { has: d ? (l) => me(a, l) : (l) => r in l }, i ^ 3 && (f.get = d ? (l) => (i ^ 1 ? Et : we)(l, a, i ^ 4 ? n : c.get) : (l) => l[r]), i > 2 && (f.set = d ? (l, y) => zt(l, a, y, i ^ 4 ? n : c.set) : (l, y) => l[r] = y)), s = (0, o[w])(i ? i < 4 ? d ? n : c[E] : i > 4 ? void 0 : { get: c.get, set: c.set } : a, p), m._ = 1, i ^ 4 || s === void 0 ? F(s) && (i > 4 ? z.unshift(s) : i ? d ? n = s : c[E] = s : a = s) : typeof s != "object" || s === null ? W("Object expected") : (F(h = s.get) && (c.get = h), F(h = s.set) && (c.set = h), F(h = s.init) && z.unshift(h));
24
- return i || be(t, a), c && rt(a, r, c), d ? i ^ 4 ? n : c : a;
25
- }, it = (t, e, r) => e.has(t) || W("Cannot " + r), me = (t, e) => Object(e) !== e ? W('Cannot use the "in" operator on this value') : t.has(e), Et = (t, e, r) => (it(t, e, "read from private field"), r ? r.call(t) : e.get(t)), D = (t, e, r) => e.has(t) ? W("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), zt = (t, e, r, o) => (it(t, e, "write to private field"), o ? o.call(t, r) : e.set(t, r), r), we = (t, e, r) => (it(t, e, "access private method"), r), Wt, It, Bt, Rt, At, X, Dt, u, at, nt, ot, st, lt;
23
+ p = be(r, i, m = {}, t[3], A), r && (p.static = g, p.private = d, f = p.access = { has: d ? (l) => we(a, l) : (l) => i in l }, r ^ 3 && (f.get = d ? (l) => (r ^ 1 ? Et : ye)(l, a, r ^ 4 ? n : c.get) : (l) => l[i]), r > 2 && (f.set = d ? (l, y) => zt(l, a, y, r ^ 4 ? n : c.set) : (l, y) => l[i] = y)), s = (0, o[w])(r ? r < 4 ? d ? n : c[E] : r > 4 ? void 0 : { get: c.get, set: c.set } : a, p), m._ = 1, r ^ 4 || s === void 0 ? F(s) && (r > 4 ? z.unshift(s) : r ? d ? n = s : c[E] = s : a = s) : typeof s != "object" || s === null ? W("Object expected") : (F(h = s.get) && (c.get = h), F(h = s.set) && (c.set = h), F(h = s.init) && z.unshift(h));
24
+ return r || me(t, a), c && it(a, i, c), d ? r ^ 4 ? n : c : a;
25
+ }, rt = (t, e, i) => e.has(t) || W("Cannot " + i), we = (t, e) => Object(e) !== e ? W('Cannot use the "in" operator on this value') : t.has(e), Et = (t, e, i) => (rt(t, e, "read from private field"), i ? i.call(t) : e.get(t)), D = (t, e, i) => e.has(t) ? W("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), zt = (t, e, i, o) => (rt(t, e, "write to private field"), o ? o.call(t, i) : e.set(t, i), i), ye = (t, e, i) => (rt(t, e, "access private method"), i), Wt, Bt, Rt, It, At, X, Dt, u, at, nt, ot, st, lt;
26
26
  Dt = [Q("nte-nav")];
27
- class k extends (X = K, At = [N({ type: String, reflect: !0 })], Rt = [N({ type: String, reflect: !0 })], Bt = [N({ type: String, reflect: !0, attribute: "transfer-to" })], It = [N({ type: String, reflect: !1, attribute: "data-group-name" })], Wt = [V()], X) {
27
+ class k extends (X = K, At = [N({ type: String, reflect: !0 })], It = [N({ type: String, reflect: !0 })], Rt = [N({ type: String, reflect: !0, attribute: "transfer-to" })], Bt = [N({ type: String, reflect: !1, attribute: "data-group-name" })], Wt = [V()], X) {
28
28
  constructor() {
29
29
  super(), D(this, at, S(u, 8, this, "slave")), S(u, 11, this), D(this, nt, S(u, 12, this, "99999px")), S(u, 15, this), D(this, ot, S(u, 16, this, "")), S(u, 19, this), D(this, st, S(u, 20, this, "")), S(u, 23, this), D(this, lt, S(u, 24, this, !1)), S(u, 27, this);
30
30
  }
@@ -68,25 +68,25 @@ class k extends (X = K, At = [N({ type: String, reflect: !0 })], Rt = [N({ type:
68
68
  }
69
69
  transferToElement(e) {
70
70
  var a;
71
- const r = (a = this.shadowRoot) == null ? void 0 : a.querySelector("#main-slot");
72
- if (r === null)
71
+ const i = (a = this.shadowRoot) == null ? void 0 : a.querySelector("#main-slot");
72
+ if (i === null)
73
73
  return;
74
- Array.from(r.assignedElements({ flatten: !0 })).forEach((n) => {
74
+ Array.from(i.assignedElements({ flatten: !0 })).forEach((n) => {
75
75
  n instanceof HTMLElement && e.appendChild(n);
76
76
  });
77
77
  }
78
78
  updated(e) {
79
- var r, o;
79
+ var i, o;
80
80
  super.updated(e), this._isTransferred ? this.transferToElement(
81
81
  this.getOffcanvasNav() ?? (() => {
82
82
  throw new Error("No offcanvas nav found");
83
83
  })()
84
- ) : ((r = this.getOffcanvasNav()) == null || r.transferToElement(this), (o = this.getOffcanvas()) == null || o.close());
84
+ ) : ((i = this.getOffcanvasNav()) == null || i.transferToElement(this), (o = this.getOffcanvas()) == null || o.close());
85
85
  }
86
86
  firstUpdated(e) {
87
87
  super.firstUpdated(e);
88
- const r = this.classList;
89
- !r.contains("nav-vertical") && !r.contains("nav-horizontal") && r.add(this.closest("nte-offcanvas") === null ? "nav-horizontal" : "nav-vertical");
88
+ const i = this.classList;
89
+ !i.contains("nav-vertical") && !i.contains("nav-horizontal") && i.add(this.closest("nte-offcanvas") === null ? "nav-horizontal" : "nav-vertical");
90
90
  }
91
91
  async connectedCallback() {
92
92
  await H(), super.connectedCallback(), this.mode !== "slave" && this.transferTo !== "" && (this._isTransferred = !1, this.breakpoint !== "" && (St(this.breakpoint) || (this._isTransferred = !0), window.addEventListener("breakpoint-changed", (e) => {
@@ -94,41 +94,41 @@ class k extends (X = K, At = [N({ type: String, reflect: !0 })], Rt = [N({ type:
94
94
  })));
95
95
  }
96
96
  }
97
- u = fe(X);
97
+ u = ge(X);
98
98
  at = /* @__PURE__ */ new WeakMap();
99
99
  nt = /* @__PURE__ */ new WeakMap();
100
100
  ot = /* @__PURE__ */ new WeakMap();
101
101
  st = /* @__PURE__ */ new WeakMap();
102
102
  lt = /* @__PURE__ */ new WeakMap();
103
- I(u, 4, "mode", At, k, at);
104
- I(u, 4, "breakpoint", Rt, k, nt);
105
- I(u, 4, "transferTo", Bt, k, ot);
106
- I(u, 4, "dataGroupName", It, k, st);
107
- I(u, 4, "_isTransferred", Wt, k, lt);
108
- k = I(u, 0, "NteNav", Dt, k);
109
- k.styles = [J(pe)];
103
+ B(u, 4, "mode", At, k, at);
104
+ B(u, 4, "breakpoint", It, k, nt);
105
+ B(u, 4, "transferTo", Rt, k, ot);
106
+ B(u, 4, "dataGroupName", Bt, k, st);
107
+ B(u, 4, "_isTransferred", Wt, k, lt);
108
+ k = B(u, 0, "NteNav", Dt, k);
109
+ k.styles = [J(ve)];
110
110
  S(u, 1, k);
111
- const ye = "*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body{height:100%;width:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit;color:inherit;background:none;border:none;outline:none}a,i{color:inherit;text-decoration:none}ul,ol{list-style:none}table{border-collapse:collapse;border-spacing:0}slot{display:contents}:host{--bg: transparent;--spacer-bg: transparent;--container-width: var(--nt-container-width, 100%);--brand-height: 80px;--spacer-height: 80px;width:100vw;margin:0}:host(a){height:85px;width:auto}#wrapper{position:relative;left:0;top:0;right:0;width:100%}#spacer{position:relative;top:0;left:0;width:100%;transition:height .3s ease-in-out;height:var(--spacer-height);background-color:var(--spacer-bg)}#navbar{position:absolute;top:0;width:100vw;height:auto;background-color:var(--bg);z-index:1000}#main{width:100vw;display:block}";
112
- var Se = Object.create, dt = Object.defineProperty, $e = Object.getOwnPropertyDescriptor, Ft = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), B = (t) => {
111
+ const Se = "*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body{height:100%;width:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit;color:inherit;background:none;border:none;outline:none}a,i{color:inherit;text-decoration:none}ul,ol{list-style:none}table{border-collapse:collapse;border-spacing:0}slot{display:contents}:host{--bg: transparent;--spacer-bg: transparent;--container-width: var(--nt-container-width, 100%);--brand-height: 80px;--spacer-height: 80px;width:100vw;margin:0}:host(a){height:85px;width:auto}#wrapper{position:relative;left:0;top:0;right:0;width:100%}#spacer{position:relative;top:0;left:0;width:100%;transition:height .3s ease-in-out;height:var(--spacer-height);background-color:var(--spacer-bg)}#navbar{position:absolute;top:0;width:100vw;height:auto;background-color:var(--bg);z-index:1000}#main{width:100vw;display:block}";
112
+ var $e = Object.create, dt = Object.defineProperty, xe = Object.getOwnPropertyDescriptor, Ft = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), R = (t) => {
113
113
  throw TypeError(t);
114
- }, xe = (t, e, r) => e in t ? dt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Nt = (t, e) => dt(t, "name", { value: e, configurable: !0 }), ke = (t) => [, , , Se((t == null ? void 0 : t[Ft("metadata")]) ?? null)], Yt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Y = (t) => t !== void 0 && typeof t != "function" ? B("Function expected") : t, Ee = (t, e, r, o, a) => ({ kind: Yt[t], name: e, metadata: o, addInitializer: (n) => r._ ? B("Already initialized") : a.push(Y(n || null)) }), ze = (t, e) => xe(e, Ft("metadata"), t[3]), Z = (t, e, r, o) => {
115
- for (var a = 0, n = t[e >> 1], h = n && n.length; a < h; a++) e & 1 ? n[a].call(r) : o = n[a].call(r, o);
114
+ }, ke = (t, e, i) => e in t ? dt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, Nt = (t, e) => dt(t, "name", { value: e, configurable: !0 }), Ee = (t) => [, , , $e((t == null ? void 0 : t[Ft("metadata")]) ?? null)], Yt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Y = (t) => t !== void 0 && typeof t != "function" ? R("Function expected") : t, ze = (t, e, i, o, a) => ({ kind: Yt[t], name: e, metadata: o, addInitializer: (n) => i._ ? R("Already initialized") : a.push(Y(n || null)) }), Ne = (t, e) => ke(e, Ft("metadata"), t[3]), Z = (t, e, i, o) => {
115
+ for (var a = 0, n = t[e >> 1], h = n && n.length; a < h; a++) e & 1 ? n[a].call(i) : o = n[a].call(i, o);
116
116
  return o;
117
- }, Ut = (t, e, r, o, a, n) => {
118
- var h, s, m, p, f, i = e & 7, g = !!(e & 8), d = !!(e & 16), _ = i > 3 ? t.length + 1 : i ? g ? 1 : 2 : 0, E = Yt[i + 5], z = i > 3 && (t[_ - 1] = []), A = t[_] || (t[_] = []), c = i && (!d && !g && (a = a.prototype), i < 5 && (i > 3 || !d) && $e(i < 4 ? a : { get [r]() {
117
+ }, Ut = (t, e, i, o, a, n) => {
118
+ var h, s, m, p, f, r = e & 7, g = !!(e & 8), d = !!(e & 16), _ = r > 3 ? t.length + 1 : r ? g ? 1 : 2 : 0, E = Yt[r + 5], z = r > 3 && (t[_ - 1] = []), A = t[_] || (t[_] = []), c = r && (!d && !g && (a = a.prototype), r < 5 && (r > 3 || !d) && xe(r < 4 ? a : { get [i]() {
119
119
  return Ot(this, n);
120
- }, set [r](l) {
120
+ }, set [i](l) {
121
121
  return Ct(this, n, l);
122
- } }, r));
123
- i ? d && i < 4 && Nt(n, (i > 2 ? "set " : i > 1 ? "get " : "") + r) : Nt(a, r);
122
+ } }, i));
123
+ r ? d && r < 4 && Nt(n, (r > 2 ? "set " : r > 1 ? "get " : "") + i) : Nt(a, i);
124
124
  for (var w = o.length - 1; w >= 0; w--)
125
- p = Ee(i, r, m = {}, t[3], A), i && (p.static = g, p.private = d, f = p.access = { has: d ? (l) => Ne(a, l) : (l) => r in l }, i ^ 3 && (f.get = d ? (l) => (i ^ 1 ? Ot : Ce)(l, a, i ^ 4 ? n : c.get) : (l) => l[r]), i > 2 && (f.set = d ? (l, y) => Ct(l, a, y, i ^ 4 ? n : c.set) : (l, y) => l[r] = y)), s = (0, o[w])(i ? i < 4 ? d ? n : c[E] : i > 4 ? void 0 : { get: c.get, set: c.set } : a, p), m._ = 1, i ^ 4 || s === void 0 ? Y(s) && (i > 4 ? z.unshift(s) : i ? d ? n = s : c[E] = s : a = s) : typeof s != "object" || s === null ? B("Object expected") : (Y(h = s.get) && (c.get = h), Y(h = s.set) && (c.set = h), Y(h = s.init) && z.unshift(h));
126
- return i || ze(t, a), c && dt(a, r, c), d ? i ^ 4 ? n : c : a;
127
- }, ct = (t, e, r) => e.has(t) || B("Cannot " + r), Ne = (t, e) => Object(e) !== e ? B('Cannot use the "in" operator on this value') : t.has(e), Ot = (t, e, r) => (ct(t, e, "read from private field"), r ? r.call(t) : e.get(t)), Oe = (t, e, r) => e.has(t) ? B("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), Ct = (t, e, r, o) => (ct(t, e, "write to private field"), o ? o.call(t, r) : e.set(t, r), r), Ce = (t, e, r) => (ct(t, e, "access private method"), r), Gt, tt, qt, L, ht;
125
+ p = ze(r, i, m = {}, t[3], A), r && (p.static = g, p.private = d, f = p.access = { has: d ? (l) => Oe(a, l) : (l) => i in l }, r ^ 3 && (f.get = d ? (l) => (r ^ 1 ? Ot : Te)(l, a, r ^ 4 ? n : c.get) : (l) => l[i]), r > 2 && (f.set = d ? (l, y) => Ct(l, a, y, r ^ 4 ? n : c.set) : (l, y) => l[i] = y)), s = (0, o[w])(r ? r < 4 ? d ? n : c[E] : r > 4 ? void 0 : { get: c.get, set: c.set } : a, p), m._ = 1, r ^ 4 || s === void 0 ? Y(s) && (r > 4 ? z.unshift(s) : r ? d ? n = s : c[E] = s : a = s) : typeof s != "object" || s === null ? R("Object expected") : (Y(h = s.get) && (c.get = h), Y(h = s.set) && (c.set = h), Y(h = s.init) && z.unshift(h));
126
+ return r || Ne(t, a), c && dt(a, i, c), d ? r ^ 4 ? n : c : a;
127
+ }, ct = (t, e, i) => e.has(t) || R("Cannot " + i), Oe = (t, e) => Object(e) !== e ? R('Cannot use the "in" operator on this value') : t.has(e), Ot = (t, e, i) => (ct(t, e, "read from private field"), i ? i.call(t) : e.get(t)), Ce = (t, e, i) => e.has(t) ? R("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), Ct = (t, e, i, o) => (ct(t, e, "write to private field"), o ? o.call(t, i) : e.set(t, i), i), Te = (t, e, i) => (ct(t, e, "access private method"), i), Gt, tt, qt, L, ht;
128
128
  qt = [Q("nte-navbar")];
129
129
  class G extends (tt = K, Gt = [N({ type: Number, attribute: "scroll-threshold", reflect: !0 })], tt) {
130
130
  constructor() {
131
- super(), this.navbarRef = $t(), this.spacerRef = $t(), Oe(this, ht, Z(L, 8, this, 0)), Z(L, 11, this), this._lastScrollY = window.scrollY, this._scrollUpPixels = 0, this._debouncer = void 0, this._debouncer = new oe(100, 300), document.addEventListener(
131
+ super(), this.navbarRef = $t(), this.spacerRef = $t(), Ce(this, ht, Z(L, 8, this, 0)), Z(L, 11, this), this._lastScrollY = window.scrollY, this._scrollUpPixels = 0, this._debouncer = void 0, this._debouncer = new oe(100, 300), document.addEventListener(
132
132
  "scroll",
133
133
  async () => {
134
134
  this.updateScrollState();
@@ -169,24 +169,24 @@ class G extends (tt = K, Gt = [N({ type: Number, attribute: "scroll-threshold",
169
169
  `;
170
170
  }
171
171
  }
172
- L = ke(tt);
172
+ L = Ee(tt);
173
173
  ht = /* @__PURE__ */ new WeakMap();
174
174
  Ut(L, 4, "scrollThreshold", Gt, G, ht);
175
175
  G = Ut(L, 0, "NteNavbar", qt, G);
176
- G.styles = [J(ye)];
176
+ G.styles = [J(Se)];
177
177
  Z(L, 1, G);
178
- const Te = "*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body{height:100%;width:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit;color:inherit;background:none;border:none;outline:none}a,i{color:inherit;text-decoration:none}ul,ol{list-style:none}table{border-collapse:collapse;border-spacing:0}slot{display:contents}:host{--container-width: var(--nt-container-width, 100%);--background: transparent;--text-color: var(--nt-text);--height: auto;--brand-height: 80px;display:block;height:100%;width:100vw}:host(.hide-on-scroll){transition:max-height .3s ease-in-out;max-height:100px}:host(.hide-on-scroll.is-scrolled){max-height:0;overflow:hidden}#main{height:var(--height);transition:height .2s ease-in-out;overflow:visible;width:100%;display:flex;background:var(--background)}#container{width:var(--container-width);margin:0 auto;display:flex}#container #brand:has(slot[empty]){display:none}#container #brand{min-width:0;flex-shrink:1;width:auto;align-items:start;display:flex;height:100%;justify-items:center}#container #nav{display:flex;flex-grow:1;justify-content:end;align-items:center;gap:1rem}";
179
- var Pe = Object.create, pt = Object.defineProperty, Me = Object.getOwnPropertyDescriptor, Ht = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), jt = (t) => {
178
+ const Pe = "*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body{height:100%;width:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit;color:inherit;background:none;border:none;outline:none}a,i{color:inherit;text-decoration:none}ul,ol{list-style:none}table{border-collapse:collapse;border-spacing:0}slot{display:contents}:host{--container-width: var(--nt-container-width, 100%);--background: transparent;--text-color: var(--nt-text);--height: auto;--brand-height: 80px;display:block;height:100%;width:100vw}:host(.hide-on-scroll){transition:max-height .3s ease-in-out;max-height:100px}:host(.hide-on-scroll.is-scrolled){max-height:0;overflow:hidden}#main{height:var(--height);transition:height .2s ease-in-out;overflow:visible;width:100%;display:flex;background:var(--background)}#container{width:var(--container-width);margin:0 auto;display:flex}#container #brand:has(slot[empty]){display:none}#container #brand{min-width:0;flex-shrink:1;width:auto;align-items:start;display:flex;height:100%;justify-items:center}#container #nav{display:flex;flex-grow:1;justify-content:end;align-items:center;gap:1rem}";
179
+ var Me = Object.create, pt = Object.defineProperty, Le = Object.getOwnPropertyDescriptor, Ht = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), jt = (t) => {
180
180
  throw TypeError(t);
181
- }, Le = (t, e, r) => e in t ? pt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, We = (t, e) => pt(t, "name", { value: e, configurable: !0 }), Ie = (t) => [, , , Pe((t == null ? void 0 : t[Ht("metadata")]) ?? null)], Be = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Jt = (t) => t !== void 0 && typeof t != "function" ? jt("Function expected") : t, Re = (t, e, r, o, a) => ({ kind: Be[t], name: e, metadata: o, addInitializer: (n) => r._ ? jt("Already initialized") : a.push(Jt(n || null)) }), Ae = (t, e) => Le(e, Ht("metadata"), t[3]), De = (t, e, r, o) => {
182
- for (var a = 0, n = t[e >> 1], h = n && n.length; a < h; a++) n[a].call(r);
181
+ }, We = (t, e, i) => e in t ? pt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, Be = (t, e) => pt(t, "name", { value: e, configurable: !0 }), Re = (t) => [, , , Me((t == null ? void 0 : t[Ht("metadata")]) ?? null)], Ie = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Jt = (t) => t !== void 0 && typeof t != "function" ? jt("Function expected") : t, Ae = (t, e, i, o, a) => ({ kind: Ie[t], name: e, metadata: o, addInitializer: (n) => i._ ? jt("Already initialized") : a.push(Jt(n || null)) }), De = (t, e) => We(e, Ht("metadata"), t[3]), Fe = (t, e, i, o) => {
182
+ for (var a = 0, n = t[e >> 1], h = n && n.length; a < h; a++) n[a].call(i);
183
183
  return o;
184
- }, Fe = (t, e, r, o, a, n) => {
185
- var h, s, m, p = e & 7, f = !1, i = 0, g = t[i] || (t[i] = []), d = p && (a = a.prototype, p < 5 && (p > 3 || !f) && Me(a, r));
186
- We(a, r);
184
+ }, Ye = (t, e, i, o, a, n) => {
185
+ var h, s, m, p = e & 7, f = !1, r = 0, g = t[r] || (t[r] = []), d = p && (a = a.prototype, p < 5 && (p > 3 || !f) && Le(a, i));
186
+ Be(a, i);
187
187
  for (var _ = o.length - 1; _ >= 0; _--)
188
- m = Re(p, r, s = {}, t[3], g), h = (0, o[_])(a, m), s._ = 1, Jt(h) && (a = h);
189
- return Ae(t, a), d && pt(a, r, d), f ? p ^ 4 ? n : d : a;
188
+ m = Ae(p, i, s = {}, t[3], g), h = (0, o[_])(a, m), s._ = 1, Jt(h) && (a = h);
189
+ return De(t, a), d && pt(a, i, d), f ? p ^ 4 ? n : d : a;
190
190
  }, Kt, vt, Qt;
191
191
  Kt = [Q("nte-navbar-line")];
192
192
  const yt = class yt extends (Qt = K) {
@@ -221,30 +221,30 @@ const yt = class yt extends (Qt = K) {
221
221
  `;
222
222
  }
223
223
  };
224
- yt.styles = [J(Te)];
224
+ yt.styles = [J(Pe)];
225
225
  let q = yt;
226
- vt = Ie(Qt);
227
- q = Fe(vt, 0, "NteNavbarLine", Kt, q);
228
- De(vt, 1, q);
229
- const Ye = ":host{display:block;--animation-duration: .3s;--auto-aspect-ratio: unset;aspect-ratio:var(--auto-aspect-ratio);height:auto;width:auto}.wrapper{--orig-top: 0;--orig-left: 0;--orig-width: 0;--orig-height: 0;--self-top: 0;--self-left: 0;--self-width: 100%;--self-height: 100%;display:inline-block;width:var(--self-width);height:var(--self-height);object-fit:contain;overflow:visible;position:fixed;opacity:0}.wrapper.initialized{opacity:1}.wrapper{top:var(--self-top);left:var(--self-left);transition:all var(--animation-duration) ease-in-out}.wrapper.inactive{z-index:99999;top:calc(var(--orig-top));left:calc(var(--orig-left));width:var(--orig-width);height:var(--orig-height)}.wrapper.inactive.done{z-index:inherit;visibility:hidden}.wrapper>slot{display:contents}.wrapper ::slotted(*){width:100%;height:100%;object-fit:contain;transition:all .3s ease-in-out}";
230
- var Ue = Object.create, ut = Object.defineProperty, Ge = Object.getOwnPropertyDescriptor, Vt = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), R = (t) => {
226
+ vt = Re(Qt);
227
+ q = Ye(vt, 0, "NteNavbarLine", Kt, q);
228
+ Fe(vt, 1, q);
229
+ const Ue = ":host{display:block;--animation-duration: .3s;--auto-aspect-ratio: unset;aspect-ratio:var(--auto-aspect-ratio);height:auto;width:auto}.wrapper{--orig-top: 0;--orig-left: 0;--orig-width: 0;--orig-height: 0;--self-top: 0;--self-left: 0;--self-width: 100%;--self-height: 100%;display:inline-block;width:var(--self-width);height:var(--self-height);object-fit:contain;overflow:visible;position:fixed;opacity:0}.wrapper.initialized{opacity:1}.wrapper{top:var(--self-top);left:var(--self-left);transition:all var(--animation-duration) ease-in-out}.wrapper.inactive{z-index:99999;top:calc(var(--orig-top));left:calc(var(--orig-left));width:var(--orig-width);height:var(--orig-height)}.wrapper.inactive.done{z-index:inherit;visibility:hidden}.wrapper>slot{display:contents}.wrapper ::slotted(*){width:100%;height:100%;object-fit:contain;transition:all .3s ease-in-out}";
230
+ var Ge = Object.create, ut = Object.defineProperty, qe = Object.getOwnPropertyDescriptor, Vt = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), I = (t) => {
231
231
  throw TypeError(t);
232
- }, qe = (t, e, r) => e in t ? ut(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Tt = (t, e) => ut(t, "name", { value: e, configurable: !0 }), He = (t) => [, , , Ue((t == null ? void 0 : t[Vt("metadata")]) ?? null)], Xt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], U = (t) => t !== void 0 && typeof t != "function" ? R("Function expected") : t, je = (t, e, r, o, a) => ({ kind: Xt[t], name: e, metadata: o, addInitializer: (n) => r._ ? R("Already initialized") : a.push(U(n || null)) }), Je = (t, e) => qe(e, Vt("metadata"), t[3]), b = (t, e, r, o) => {
233
- for (var a = 0, n = t[e >> 1], h = n && n.length; a < h; a++) e & 1 ? n[a].call(r) : o = n[a].call(r, o);
232
+ }, He = (t, e, i) => e in t ? ut(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, Tt = (t, e) => ut(t, "name", { value: e, configurable: !0 }), je = (t) => [, , , Ge((t == null ? void 0 : t[Vt("metadata")]) ?? null)], Xt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], U = (t) => t !== void 0 && typeof t != "function" ? I("Function expected") : t, Je = (t, e, i, o, a) => ({ kind: Xt[t], name: e, metadata: o, addInitializer: (n) => i._ ? I("Already initialized") : a.push(U(n || null)) }), Ke = (t, e) => He(e, Vt("metadata"), t[3]), b = (t, e, i, o) => {
233
+ for (var a = 0, n = t[e >> 1], h = n && n.length; a < h; a++) e & 1 ? n[a].call(i) : o = n[a].call(i, o);
234
234
  return o;
235
- }, T = (t, e, r, o, a, n) => {
236
- var h, s, m, p, f, i = e & 7, g = !!(e & 8), d = !!(e & 16), _ = i > 3 ? t.length + 1 : i ? g ? 1 : 2 : 0, E = Xt[i + 5], z = i > 3 && (t[_ - 1] = []), A = t[_] || (t[_] = []), c = i && (!d && !g && (a = a.prototype), i < 5 && (i > 3 || !d) && Ge(i < 4 ? a : { get [r]() {
235
+ }, T = (t, e, i, o, a, n) => {
236
+ var h, s, m, p, f, r = e & 7, g = !!(e & 8), d = !!(e & 16), _ = r > 3 ? t.length + 1 : r ? g ? 1 : 2 : 0, E = Xt[r + 5], z = r > 3 && (t[_ - 1] = []), A = t[_] || (t[_] = []), c = r && (!d && !g && (a = a.prototype), r < 5 && (r > 3 || !d) && qe(r < 4 ? a : { get [i]() {
237
237
  return x(this, n);
238
- }, set [r](l) {
238
+ }, set [i](l) {
239
239
  return j(this, n, l);
240
- } }, r));
241
- i ? d && i < 4 && Tt(n, (i > 2 ? "set " : i > 1 ? "get " : "") + r) : Tt(a, r);
240
+ } }, i));
241
+ r ? d && r < 4 && Tt(n, (r > 2 ? "set " : r > 1 ? "get " : "") + i) : Tt(a, i);
242
242
  for (var w = o.length - 1; w >= 0; w--)
243
- p = je(i, r, m = {}, t[3], A), i && (p.static = g, p.private = d, f = p.access = { has: d ? (l) => Ke(a, l) : (l) => r in l }, i ^ 3 && (f.get = d ? (l) => (i ^ 1 ? x : Qe)(l, a, i ^ 4 ? n : c.get) : (l) => l[r]), i > 2 && (f.set = d ? (l, y) => j(l, a, y, i ^ 4 ? n : c.set) : (l, y) => l[r] = y)), s = (0, o[w])(i ? i < 4 ? d ? n : c[E] : i > 4 ? void 0 : { get: c.get, set: c.set } : a, p), m._ = 1, i ^ 4 || s === void 0 ? U(s) && (i > 4 ? z.unshift(s) : i ? d ? n = s : c[E] = s : a = s) : typeof s != "object" || s === null ? R("Object expected") : (U(h = s.get) && (c.get = h), U(h = s.set) && (c.set = h), U(h = s.init) && z.unshift(h));
244
- return i || Je(t, a), c && ut(a, r, c), d ? i ^ 4 ? n : c : a;
245
- }, _t = (t, e, r) => e.has(t) || R("Cannot " + r), Ke = (t, e) => Object(e) !== e ? R('Cannot use the "in" operator on this value') : t.has(e), x = (t, e, r) => (_t(t, e, "read from private field"), r ? r.call(t) : e.get(t)), O = (t, e, r) => e.has(t) ? R("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), j = (t, e, r, o) => (_t(t, e, "write to private field"), o ? o.call(t, r) : e.set(t, r), r), Qe = (t, e, r) => (_t(t, e, "access private method"), r), Zt, te, ee, re, ie, ae, et, ne, v, ft, gt, bt, mt, wt, P, C;
243
+ p = Je(r, i, m = {}, t[3], A), r && (p.static = g, p.private = d, f = p.access = { has: d ? (l) => Qe(a, l) : (l) => i in l }, r ^ 3 && (f.get = d ? (l) => (r ^ 1 ? x : Ve)(l, a, r ^ 4 ? n : c.get) : (l) => l[i]), r > 2 && (f.set = d ? (l, y) => j(l, a, y, r ^ 4 ? n : c.set) : (l, y) => l[i] = y)), s = (0, o[w])(r ? r < 4 ? d ? n : c[E] : r > 4 ? void 0 : { get: c.get, set: c.set } : a, p), m._ = 1, r ^ 4 || s === void 0 ? U(s) && (r > 4 ? z.unshift(s) : r ? d ? n = s : c[E] = s : a = s) : typeof s != "object" || s === null ? I("Object expected") : (U(h = s.get) && (c.get = h), U(h = s.set) && (c.set = h), U(h = s.init) && z.unshift(h));
244
+ return r || Ke(t, a), c && ut(a, i, c), d ? r ^ 4 ? n : c : a;
245
+ }, _t = (t, e, i) => e.has(t) || I("Cannot " + i), Qe = (t, e) => Object(e) !== e ? I('Cannot use the "in" operator on this value') : t.has(e), x = (t, e, i) => (_t(t, e, "read from private field"), i ? i.call(t) : e.get(t)), O = (t, e, i) => e.has(t) ? I("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), j = (t, e, i, o) => (_t(t, e, "write to private field"), o ? o.call(t, i) : e.set(t, i), i), Ve = (t, e, i) => (_t(t, e, "access private method"), i), Zt, te, ee, ie, re, ae, et, ne, v, ft, gt, bt, mt, wt, P, C;
246
246
  ne = [Q("nte-nav-brand-relocator")];
247
- class $ extends (et = se(le(K)), ae = [N({ type: String, reflect: !0 })], ie = [N({ type: Boolean, reflect: !0 })], re = [N({ type: String, reflect: !0 })], ee = [V()], te = [V()], Zt = [de("scroll", { target: "window", options: { passive: !0 } })], et) {
247
+ class $ extends (et = se(le(K)), ae = [N({ type: String, reflect: !0 })], re = [N({ type: Boolean, reflect: !0 })], ie = [N({ type: String, reflect: !0 })], ee = [V()], te = [V()], Zt = [de("scroll", { target: "window", options: { passive: !0 } })], et) {
248
248
  constructor() {
249
249
  super(...arguments), b(v, 5, this), O(this, ft, b(v, 8, this, ".brand-image")), b(v, 11, this), O(this, gt, b(v, 12, this, null)), b(v, 15, this), O(this, bt, b(v, 16, this, "auto")), b(v, 19, this), O(this, mt, b(v, 20, this, !1)), b(v, 23, this), O(this, wt, b(v, 24, this, !1)), b(v, 27, this), O(this, P, null), O(this, C, null);
250
250
  }
@@ -263,35 +263,35 @@ class $ extends (et = se(le(K)), ae = [N({ type: String, reflect: !0 })], ie = [
263
263
  return x(this, C) || (j(this, C, document.querySelector(this.brandSelector)), x(this, C) || this.warn(`Brand element not found using selector: ${this.brandSelector}`)), x(this, C);
264
264
  }
265
265
  render() {
266
- const e = this.brandElement.getBoundingClientRect(), r = e.width / e.height;
267
- this.log("Setting Aspect ratio:", r), this.style.setProperty("--auto-aspect-ratio", r.toString());
268
- const o = this.getBoundingClientRect();
266
+ const e = this.brandElement.getBoundingClientRect(), i = this.getBoundingClientRect();
269
267
  if (!e)
270
268
  return M`<div>No brand element found</div>`;
271
- const a = {
269
+ const o = {
272
270
  "--orig-top": e.top + "px",
273
271
  "--orig-left": e.left + "px",
274
272
  "--orig-width": e.width + "px",
275
273
  "--orig-height": e.height + "px",
276
- "--self-top": o.top + "px",
277
- "--self-left": o.left + "px",
278
- "--self-width": o.width + "px",
279
- "--self-height": o.height + "px"
274
+ "--self-top": i.top + "px",
275
+ "--self-left": i.left + "px",
276
+ "--self-width": i.width + "px",
277
+ "--self-height": i.height + "px"
280
278
  };
281
279
  return M`<div
282
280
  class="wrapper ${this.active ? "" : "inactive"} ${this.done ? "done" : ""} ${this.initialized ? "initialized" : ""}"
283
- style=${he(a)}
281
+ style=${pe(o)}
284
282
  @transitionend=${() => this.onanimationEnd()}
285
283
  >
286
284
  <slot></slot>
287
285
  </div>`;
288
286
  }
289
287
  update(e) {
290
- var r;
291
- e.has("active") && this.active === !0 && ((r = x(this, C)) == null || r.style.setProperty("visibility", "hidden"), this.done = !1), super.update(e);
288
+ var i;
289
+ e.has("active") && this.active === !0 && ((i = x(this, C)) == null || i.style.setProperty("visibility", "hidden"), this.done = !1), super.update(e);
292
290
  }
293
291
  async firstUpdated() {
294
- this.log("Waiting for Brand element loading...", this.brandElement), await ce(this.brandElement), this.log("Brand element is now loaded:", this.brandElement), this.initialized = !0, this.onScroll();
292
+ this.log("Waiting for Brand element loading...", this.brandElement), await ce(this.brandElement), await he(1);
293
+ const e = this.brandElement.getBoundingClientRect(), i = e.width / e.height;
294
+ this.log("Brand element rect:", e), this.log("Setting Aspect ratio:", i), this.style.setProperty("--auto-aspect-ratio", i.toString()), this.log("Brand element is now loaded:", this.brandElement), this.initialized = !0, this.onScroll();
295
295
  }
296
296
  async connectedCallback() {
297
297
  if (await H(), super.connectedCallback(), x(this, P) === null) {
@@ -304,7 +304,7 @@ class $ extends (et = se(le(K)), ae = [N({ type: String, reflect: !0 })], ie = [
304
304
  }
305
305
  }
306
306
  }
307
- v = He(et);
307
+ v = je(et);
308
308
  ft = /* @__PURE__ */ new WeakMap();
309
309
  gt = /* @__PURE__ */ new WeakMap();
310
310
  bt = /* @__PURE__ */ new WeakMap();
@@ -313,13 +313,13 @@ wt = /* @__PURE__ */ new WeakMap();
313
313
  P = /* @__PURE__ */ new WeakMap();
314
314
  C = /* @__PURE__ */ new WeakMap();
315
315
  T(v, 4, "brandSelector", ae, $, ft);
316
- T(v, 4, "active", ie, $, gt);
317
- T(v, 4, "mode", re, $, bt);
316
+ T(v, 4, "active", re, $, gt);
317
+ T(v, 4, "mode", ie, $, bt);
318
318
  T(v, 4, "done", ee, $, mt);
319
319
  T(v, 4, "initialized", te, $, wt);
320
320
  T(v, 1, "onScroll", Zt, $);
321
321
  $ = T(v, 0, "NteNavBrandRelocator", ne, $);
322
- $.styles = [J(Ye)];
322
+ $.styles = [J(Ue)];
323
323
  b(v, 1, $);
324
324
  console.log("Loading nte-nav...");
325
325
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextrap/nte-nav",
3
- "version": "1.1.22",
3
+ "version": "1.1.24",
4
4
  "main": "./index.js",
5
5
  "dependencies": {
6
6
  "@nextrap/nt-framework": "^1.1.1",