@dlightjs/components
Advanced tools
Comparing version 0.9.1 to 0.9.2
@@ -1,7 +0,7 @@ | ||
var L = Object.defineProperty; | ||
var T = (r, a, t) => a in r ? L(r, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[a] = t; | ||
var e = (r, a, t) => (T(r, typeof a != "symbol" ? a + "" : a, t), t); | ||
import p, { View as l, DLNodeType as N } from "@dlightjs/dlight"; | ||
var U = Object.defineProperty; | ||
var L = (r, a, t) => a in r ? U(r, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[a] = t; | ||
var e = (r, a, t) => (L(r, typeof a != "symbol" ? a + "" : a, t), t); | ||
import p, { View as l, DLNodeType as P } from "@dlightjs/dlight"; | ||
import { css as $ } from "@dlightjs/emotion"; | ||
class H extends l { | ||
class F extends l { | ||
constructor() { | ||
@@ -19,3 +19,3 @@ super(...arguments); | ||
function w(r) { | ||
if (![N.HTML, N.Text].includes(r._$nodeType)) { | ||
if (![P.HTML, P.Text].includes(r._$nodeType)) { | ||
if (r.isSpacer) | ||
@@ -29,3 +29,3 @@ return !0; | ||
} | ||
class W extends l { | ||
class H extends l { | ||
constructor() { | ||
@@ -115,3 +115,3 @@ super(...arguments); | ||
} | ||
class k extends l { | ||
class W extends l { | ||
constructor() { | ||
@@ -201,3 +201,3 @@ super(...arguments); | ||
} | ||
class M extends l { | ||
class k extends l { | ||
constructor() { | ||
@@ -270,3 +270,3 @@ super(...arguments); | ||
} | ||
function P() { | ||
function N() { | ||
return location.hash.slice(2); | ||
@@ -294,3 +294,3 @@ } | ||
} | ||
class U { | ||
class T { | ||
constructor() { | ||
@@ -326,6 +326,6 @@ e(this, "mode", "hash"); | ||
const f = history.pushState; | ||
let g = []; | ||
let u = []; | ||
class O extends l { | ||
constructor() { | ||
super(...arguments); | ||
super(); | ||
e(this, "_$derivedPairs", { | ||
@@ -341,3 +341,3 @@ currUrl: ["mode"], | ||
}); | ||
e(this, "_$$currUrl", () => this.mode === "hash" ? P() : S()); | ||
e(this, "_$$currUrl", () => this.mode === "hash" ? N() : S()); | ||
e(this, "_$$currUrlDeps", /* @__PURE__ */ new Set()); | ||
@@ -347,3 +347,3 @@ e(this, "baseUrl", ""); | ||
e(this, "prevRoutes", []); | ||
e(this, "_$$navigator", new U()); | ||
e(this, "_$$navigator", new T()); | ||
e(this, "_$$navigatorDeps", /* @__PURE__ */ new Set()); | ||
@@ -360,4 +360,4 @@ e(this, "_$$showedRoute", () => function() { | ||
n = n.replace(/^(\.\/)+/, ""); | ||
const d = n === "." && i === "", _ = (i + "/").startsWith(n + "/"); | ||
h = d || _ || n === " none"; | ||
const d = n === "." && i === "", g = (i + "/").startsWith(n + "/"); | ||
h = d || g || n === " none"; | ||
} else | ||
@@ -379,4 +379,5 @@ n instanceof RegExp && (h = n.test(i)); | ||
e(this, "hashChangeListen", () => { | ||
this.currUrl = P(); | ||
this.currUrl = N(); | ||
}); | ||
this.willMount = this.willMount.bind(this), this.didMount = this.didMount.bind(this), this.willUnmount = this.willUnmount.bind(this); | ||
} | ||
@@ -418,6 +419,6 @@ get mode() { | ||
} | ||
addEventListener("load", this.historyChangeListen), addEventListener("popstate", this.historyChangeListen), g.push(this.historyChangeListen), history.pushState = new Proxy(f, { | ||
addEventListener("load", this.historyChangeListen), addEventListener("popstate", this.historyChangeListen), u.push(this.historyChangeListen), history.pushState = new Proxy(f, { | ||
apply: (t, i, s) => { | ||
const o = t.apply(i, s); | ||
for (const n of g) | ||
for (const n of u) | ||
n(); | ||
@@ -433,6 +434,6 @@ return o; | ||
} | ||
removeEventListener("load", this.historyChangeListen), removeEventListener("popstate", this.historyChangeListen), g = g.filter((t) => t !== this.historyChangeListen), g.length > 0 ? history.pushState = new Proxy(f, { | ||
removeEventListener("load", this.historyChangeListen), removeEventListener("popstate", this.historyChangeListen), u = u.filter((t) => t !== this.historyChangeListen), u.length > 0 ? history.pushState = new Proxy(f, { | ||
apply: (t, i, s) => { | ||
const o = t.apply(i, s); | ||
for (const n of g) | ||
for (const n of u) | ||
n(); | ||
@@ -488,3 +489,3 @@ return o; | ||
constructor() { | ||
super(...arguments); | ||
super(); | ||
e(this, "_$derivedPairs", { | ||
@@ -526,2 +527,3 @@ transition: ["_duration", "_easing", "_delay"] | ||
e(this, "removeStores"); | ||
this.parseProp = this.parseProp.bind(this), this.resolveDisappear = this.resolveDisappear.bind(this), this.willUnmount = this.willUnmount.bind(this), this.didUnmount = this.didUnmount.bind(this); | ||
} | ||
@@ -659,12 +661,12 @@ parseProp(t, i) { | ||
function b(r, a, t, i, s, o, n) { | ||
let h, d, _ = !1; | ||
let h, d, g = !1; | ||
const c = `all ${a}s ${t} ${i}s`; | ||
function v(u) { | ||
h === void 0 && (h = u, r.style.transition = c + ", transform 0s"); | ||
const E = u - h; | ||
if (d !== u) { | ||
function v(_) { | ||
h === void 0 && (h = _, r.style.transition = c + ", transform 0s"); | ||
const E = _ - h; | ||
if (d !== _) { | ||
const m = Math.max(E / (a * 1e3) - i, 0), R = m * s, C = m * o; | ||
m >= 1 ? (r.style.transform = "", _ = !0) : r.style.transform = `translate(${s - R}px, ${o - C}px)`, n.rect = r.getBoundingClientRect(); | ||
m >= 1 ? (r.style.transform = "", g = !0) : r.style.transform = `translate(${s - R}px, ${o - C}px)`, n.rect = r.getBoundingClientRect(); | ||
} | ||
d = u, !_ && !n.stopTrigger ? requestAnimationFrame(v) : r.style.transition = c; | ||
d = _, !g && !n.stopTrigger ? requestAnimationFrame(v) : r.style.transition = c; | ||
} | ||
@@ -674,11 +676,11 @@ requestAnimationFrame(v); | ||
export { | ||
W as HStack, | ||
U as Navigator, | ||
H as HStack, | ||
T as Navigator, | ||
q as Route, | ||
O as RouterSpace, | ||
H as Spacer, | ||
F as Spacer, | ||
j as Transition, | ||
V as TransitionGroup, | ||
k as VStack, | ||
M as ZStack | ||
W as VStack, | ||
k as ZStack | ||
}; |
{ | ||
"name": "@dlightjs/components", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"type": "module", | ||
@@ -15,8 +15,8 @@ "files": [ | ||
"vite-plugin-dts": "^1.7.1", | ||
"vite-plugin-dlight": "0.9.1", | ||
"@dlightjs/types": "0.9.1" | ||
"vite-plugin-dlight": "0.9.2", | ||
"@dlightjs/types": "0.9.2" | ||
}, | ||
"dependencies": { | ||
"@dlightjs/dlight": "0.9.1", | ||
"@dlightjs/emotion": "0.9.1" | ||
"@dlightjs/emotion": "0.9.2", | ||
"@dlightjs/dlight": "0.9.2" | ||
}, | ||
@@ -23,0 +23,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
51607
909
+ Added@dlightjs/dlight@0.9.2(transitive)
+ Added@dlightjs/emotion@0.9.2(transitive)
+ Added@dlightjs/types@0.9.2(transitive)
- Removed@dlightjs/dlight@0.9.1(transitive)
- Removed@dlightjs/emotion@0.9.1(transitive)
- Removed@dlightjs/types@0.9.1(transitive)
Updated@dlightjs/dlight@0.9.2
Updated@dlightjs/emotion@0.9.2