@dlightjs/emotion
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -1,4 +0,4 @@ | ||
var Ae = Object.defineProperty; | ||
var Re = (e, r, n) => r in e ? Ae(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n; | ||
var V = (e, r, n) => (Re(e, typeof r != "symbol" ? r + "" : r, n), n); | ||
var _e = Object.defineProperty; | ||
var Re = (e, r, n) => r in e ? _e(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n; | ||
var Q = (e, r, n) => (Re(e, typeof r != "symbol" ? r + "" : r, n), n); | ||
import * as Ie from "@dlightjs/dlight"; | ||
@@ -51,3 +51,3 @@ import { View as ce } from "@dlightjs/dlight"; | ||
}, e; | ||
}(), x = "-ms-", K = "-moz-", l = "-webkit-", ne = "comm", se = "rule", ae = "decl", Te = "@import", ve = "@keyframes", Me = Math.abs, J = String.fromCharCode, je = Object.assign; | ||
}(), x = "-ms-", B = "-moz-", l = "-webkit-", ne = "comm", se = "rule", ae = "decl", Te = "@import", ve = "@keyframes", Me = Math.abs, H = String.fromCharCode, je = Object.assign; | ||
function Le(e, r) { | ||
@@ -59,6 +59,6 @@ return E(e, 0) ^ 45 ? (((r << 2 ^ E(e, 0)) << 2 ^ E(e, 1)) << 2 ^ E(e, 2)) << 2 ^ E(e, 3) : 0; | ||
} | ||
function We(e, r) { | ||
function qe(e, r) { | ||
return (e = r.exec(e)) ? e[0] : e; | ||
} | ||
function p(e, r, n) { | ||
function h(e, r, n) { | ||
return e.replace(r, n); | ||
@@ -72,3 +72,3 @@ } | ||
} | ||
function W(e, r, n) { | ||
function L(e, r, n) { | ||
return e.slice(r, n); | ||
@@ -82,14 +82,14 @@ } | ||
} | ||
function Y(e, r) { | ||
function G(e, r) { | ||
return r.push(e), e; | ||
} | ||
function qe(e, r) { | ||
function We(e, r) { | ||
return e.map(r).join(""); | ||
} | ||
var Z = 1, T = 1, Ee = 0, S = 0, g = 0, M = ""; | ||
function Q(e, r, n, s, i, a, o) { | ||
return { value: e, root: r, parent: n, type: s, props: i, children: a, line: Z, column: T, length: o, return: "" }; | ||
var J = 1, D = 1, Ee = 0, O = 0, g = 0, T = ""; | ||
function Z(e, r, n, s, i, a, o) { | ||
return { value: e, root: r, parent: n, type: s, props: i, children: a, line: J, column: D, length: o, return: "" }; | ||
} | ||
function L(e, r) { | ||
return je(Q("", null, null, "", null, null, 0), e, { length: -e.length }, r); | ||
function j(e, r) { | ||
return je(Z("", null, null, "", null, null, 0), e, { length: -e.length }, r); | ||
} | ||
@@ -100,15 +100,15 @@ function ze() { | ||
function Ge() { | ||
return g = S > 0 ? E(M, --S) : 0, T--, g === 10 && (T = 1, Z--), g; | ||
return g = O > 0 ? E(T, --O) : 0, D--, g === 10 && (D = 1, J--), g; | ||
} | ||
function O() { | ||
return g = S < Ee ? E(M, S++) : 0, T++, g === 10 && (T = 1, Z++), g; | ||
function k() { | ||
return g = O < Ee ? E(T, O++) : 0, D++, g === 10 && (D = 1, J++), g; | ||
} | ||
function I() { | ||
return E(M, S); | ||
return E(T, O); | ||
} | ||
function U() { | ||
return S; | ||
function Y() { | ||
return O; | ||
} | ||
function G(e, r) { | ||
return W(M, e, r); | ||
function z(e, r) { | ||
return L(T, e, r); | ||
} | ||
@@ -148,25 +148,25 @@ function q(e) { | ||
function xe(e) { | ||
return Z = T = 1, Ee = R(M = e), S = 0, []; | ||
return J = D = 1, Ee = R(T = e), O = 0, []; | ||
} | ||
function $e(e) { | ||
return M = "", e; | ||
function Ne(e) { | ||
return T = "", e; | ||
} | ||
function F(e) { | ||
return we(G(S - 1, te(e === 91 ? e + 2 : e === 40 ? e + 1 : e))); | ||
function U(e) { | ||
return we(z(O - 1, te(e === 91 ? e + 2 : e === 40 ? e + 1 : e))); | ||
} | ||
function Ye(e) { | ||
for (; (g = I()) && g < 33; ) | ||
O(); | ||
k(); | ||
return q(e) > 2 || q(g) > 3 ? "" : " "; | ||
} | ||
function Ue(e, r) { | ||
for (; --r && O() && !(g < 48 || g > 102 || g > 57 && g < 65 || g > 70 && g < 97); ) | ||
for (; --r && k() && !(g < 48 || g > 102 || g > 57 && g < 65 || g > 70 && g < 97); ) | ||
; | ||
return G(e, U() + (r < 6 && I() == 32 && O() == 32)); | ||
return z(e, Y() + (r < 6 && I() == 32 && k() == 32)); | ||
} | ||
function te(e) { | ||
for (; O(); ) | ||
for (; k(); ) | ||
switch (g) { | ||
case e: | ||
return S; | ||
return O; | ||
case 34: | ||
@@ -180,27 +180,27 @@ case 39: | ||
case 92: | ||
O(); | ||
k(); | ||
break; | ||
} | ||
return S; | ||
return O; | ||
} | ||
function Fe(e, r) { | ||
for (; O() && e + g !== 47 + 10; ) | ||
for (; k() && e + g !== 47 + 10; ) | ||
if (e + g === 42 + 42 && I() === 47) | ||
break; | ||
return "/*" + G(r, S - 1) + "*" + J(e === 47 ? e : O()); | ||
return "/*" + z(r, O - 1) + "*" + H(e === 47 ? e : k()); | ||
} | ||
function Be(e) { | ||
for (; !q(I()); ) | ||
O(); | ||
return G(e, S); | ||
k(); | ||
return z(e, O); | ||
} | ||
function Ke(e) { | ||
return $e(B("", null, null, null, [""], e = xe(e), 0, [0], e)); | ||
return Ne(F("", null, null, null, [""], e = xe(e), 0, [0], e)); | ||
} | ||
function B(e, r, n, s, i, a, o, c, u) { | ||
for (var d = 0, f = 0, h = o, v = 0, k = 0, $ = 0, m = 1, N = 1, y = 1, w = 0, C = "", j = i, P = a, A = s, b = C; N; ) | ||
switch ($ = w, w = O()) { | ||
function F(e, r, n, s, i, a, o, c, u) { | ||
for (var d = 0, f = 0, p = o, v = 0, $ = 0, N = 0, m = 1, S = 1, y = 1, w = 0, A = "", M = i, P = a, _ = s, b = A; S; ) | ||
switch (N = w, w = k()) { | ||
case 40: | ||
if ($ != 108 && E(b, h - 1) == 58) { | ||
re(b += p(F(w), "&", "&\f"), "&\f") != -1 && (y = -1); | ||
if (N != 108 && E(b, p - 1) == 58) { | ||
re(b += h(U(w), "&", "&\f"), "&\f") != -1 && (y = -1); | ||
break; | ||
@@ -211,3 +211,3 @@ } | ||
case 91: | ||
b += F(w); | ||
b += U(w); | ||
break; | ||
@@ -218,6 +218,6 @@ case 9: | ||
case 32: | ||
b += Ye($); | ||
b += Ye(N); | ||
break; | ||
case 92: | ||
b += Ue(U() - 1, 7); | ||
b += Ue(Y() - 1, 7); | ||
continue; | ||
@@ -228,3 +228,3 @@ case 47: | ||
case 47: | ||
Y(He(Fe(O(), U()), r, n), u); | ||
G(He(Fe(k(), Y()), r, n), u); | ||
break; | ||
@@ -243,5 +243,5 @@ default: | ||
case 125: | ||
N = 0; | ||
S = 0; | ||
case 59 + f: | ||
k > 0 && R(b) - h && Y(k > 32 ? ue(b + ";", s, n, h - 1) : ue(p(b, " ", "") + ";", s, n, h - 2), u); | ||
$ > 0 && R(b) - p && G($ > 32 ? ue(b + ";", s, n, p - 1) : ue(h(b, " ", "") + ";", s, n, p - 2), u); | ||
break; | ||
@@ -251,5 +251,5 @@ case 59: | ||
default: | ||
if (Y(A = fe(b, r, n, d, f, i, c, C, j = [], P = [], h), a), w === 123) | ||
if (G(_ = fe(b, r, n, d, f, i, c, A, M = [], P = [], p), a), w === 123) | ||
if (f === 0) | ||
B(b, r, A, A, j, a, h, c, P); | ||
F(b, r, _, _, M, a, p, c, P); | ||
else | ||
@@ -260,12 +260,12 @@ switch (v === 99 && E(b, 3) === 110 ? 100 : v) { | ||
case 115: | ||
B(e, A, A, s && Y(fe(e, A, A, 0, 0, i, c, C, i, j = [], h), P), i, P, h, c, s ? j : P); | ||
F(e, _, _, s && G(fe(e, _, _, 0, 0, i, c, A, i, M = [], p), P), i, P, p, c, s ? M : P); | ||
break; | ||
default: | ||
B(b, A, A, A, [""], P, 0, c, P); | ||
F(b, _, _, _, [""], P, 0, c, P); | ||
} | ||
} | ||
d = f = k = 0, m = y = 1, C = b = "", h = o; | ||
d = f = $ = 0, m = y = 1, A = b = "", p = o; | ||
break; | ||
case 58: | ||
h = 1 + R(b), k = $; | ||
p = 1 + R(b), $ = N; | ||
default: | ||
@@ -278,3 +278,3 @@ if (m < 1) { | ||
} | ||
switch (b += J(w), w * m) { | ||
switch (b += H(w), w * m) { | ||
case 38: | ||
@@ -287,6 +287,6 @@ y = f > 0 ? 1 : (b += "\f", -1); | ||
case 64: | ||
I() === 45 && (b += F(O())), v = I(), f = h = R(C = b += Be(U())), w++; | ||
I() === 45 && (b += U(k())), v = I(), f = p = R(A = b += Be(Y())), w++; | ||
break; | ||
case 45: | ||
$ === 45 && R(b) == 2 && (m = 0); | ||
N === 45 && R(b) == 2 && (m = 0); | ||
} | ||
@@ -297,14 +297,14 @@ } | ||
function fe(e, r, n, s, i, a, o, c, u, d, f) { | ||
for (var h = i - 1, v = i === 0 ? a : [""], k = ie(v), $ = 0, m = 0, N = 0; $ < s; ++$) | ||
for (var y = 0, w = W(e, h + 1, h = Me(m = o[$])), C = e; y < k; ++y) | ||
(C = we(m > 0 ? v[y] + " " + w : p(w, /&\f/g, v[y]))) && (u[N++] = C); | ||
return Q(e, r, n, i === 0 ? se : c, u, d, f); | ||
for (var p = i - 1, v = i === 0 ? a : [""], $ = ie(v), N = 0, m = 0, S = 0; N < s; ++N) | ||
for (var y = 0, w = L(e, p + 1, p = Me(m = o[N])), A = e; y < $; ++y) | ||
(A = we(m > 0 ? v[y] + " " + w : h(w, /&\f/g, v[y]))) && (u[S++] = A); | ||
return Z(e, r, n, i === 0 ? se : c, u, d, f); | ||
} | ||
function He(e, r, n) { | ||
return Q(e, r, n, ne, J(ze()), W(e, 2, -2), 0); | ||
return Z(e, r, n, ne, H(ze()), L(e, 2, -2), 0); | ||
} | ||
function ue(e, r, n, s) { | ||
return Q(e, r, n, ae, W(e, 0, s), W(e, s + 1, -1), s); | ||
return Z(e, r, n, ae, L(e, 0, s), L(e, s + 1, -1), s); | ||
} | ||
function D(e, r) { | ||
function V(e, r) { | ||
for (var n = "", s = ie(e), i = 0; i < s; i++) | ||
@@ -322,7 +322,7 @@ n += r(e[i], i, e, r) || ""; | ||
case ve: | ||
return e.return = e.value + "{" + D(e.children, s) + "}"; | ||
return e.return = e.value + "{" + V(e.children, s) + "}"; | ||
case se: | ||
e.value = e.props.join(","); | ||
} | ||
return R(n = D(e.children, s)) ? e.return = e.value + "{" + n + "}" : ""; | ||
return R(n = V(e.children, s)) ? e.return = e.value + "{" + n + "}" : ""; | ||
} | ||
@@ -350,4 +350,4 @@ function Ze(e) { | ||
for (var i = 0, a = 0; i = a, a = I(), i === 38 && a === 12 && (n[s] = 1), !q(a); ) | ||
O(); | ||
return G(r, S); | ||
k(); | ||
return z(r, O); | ||
}, rr = function(r, n) { | ||
@@ -358,6 +358,6 @@ var s = -1, i = 44; | ||
case 0: | ||
i === 38 && I() === 12 && (n[s] = 1), r[s] += er(S - 1, n, s); | ||
i === 38 && I() === 12 && (n[s] = 1), r[s] += er(O - 1, n, s); | ||
break; | ||
case 2: | ||
r[s] += F(i); | ||
r[s] += U(i); | ||
break; | ||
@@ -370,8 +370,8 @@ case 4: | ||
default: | ||
r[s] += J(i); | ||
r[s] += H(i); | ||
} | ||
while (i = O()); | ||
while (i = k()); | ||
return r; | ||
}, tr = function(r, n) { | ||
return $e(rr(xe(r), n)); | ||
return Ne(rr(xe(r), n)); | ||
}, de = /* @__PURE__ */ new WeakMap(), nr = function(r) { | ||
@@ -424,7 +424,7 @@ if (!(r.type !== "rule" || !r.parent || // positive .length indicates that this rule contains pseudo | ||
}; | ||
}, Ne = function(r) { | ||
}, Se = function(r) { | ||
return r.type.charCodeAt(1) === 105 && r.type.charCodeAt(0) === 64; | ||
}, cr = function(r, n) { | ||
for (var s = r - 1; s >= 0; s--) | ||
if (!Ne(n[s])) | ||
if (!Se(n[s])) | ||
return !0; | ||
@@ -435,5 +435,5 @@ return !1; | ||
}, fr = function(r, n, s) { | ||
Ne(r) && (r.parent ? (console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."), le(r)) : cr(n, s) && (console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."), le(r))); | ||
Se(r) && (r.parent ? (console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."), le(r)) : cr(n, s) && (console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."), le(r))); | ||
}; | ||
function Se(e, r) { | ||
function Oe(e, r) { | ||
switch (Le(e, r)) { | ||
@@ -473,3 +473,3 @@ case 5103: | ||
case 2756: | ||
return l + e + K + e + x + e + e; | ||
return l + e + B + e + x + e + e; | ||
case 6828: | ||
@@ -481,22 +481,22 @@ case 4268: | ||
case 5187: | ||
return l + e + p(e, /(\w+).+(:[^]+)/, l + "box-$1$2" + x + "flex-$1$2") + e; | ||
return l + e + h(e, /(\w+).+(:[^]+)/, l + "box-$1$2" + x + "flex-$1$2") + e; | ||
case 5443: | ||
return l + e + x + "flex-item-" + p(e, /flex-|-self/, "") + e; | ||
return l + e + x + "flex-item-" + h(e, /flex-|-self/, "") + e; | ||
case 4675: | ||
return l + e + x + "flex-line-pack" + p(e, /align-content|flex-|-self/, "") + e; | ||
return l + e + x + "flex-line-pack" + h(e, /align-content|flex-|-self/, "") + e; | ||
case 5548: | ||
return l + e + x + p(e, "shrink", "negative") + e; | ||
return l + e + x + h(e, "shrink", "negative") + e; | ||
case 5292: | ||
return l + e + x + p(e, "basis", "preferred-size") + e; | ||
return l + e + x + h(e, "basis", "preferred-size") + e; | ||
case 6060: | ||
return l + "box-" + p(e, "-grow", "") + l + e + x + p(e, "grow", "positive") + e; | ||
return l + "box-" + h(e, "-grow", "") + l + e + x + h(e, "grow", "positive") + e; | ||
case 4554: | ||
return l + p(e, /([^-])(transform)/g, "$1" + l + "$2") + e; | ||
return l + h(e, /([^-])(transform)/g, "$1" + l + "$2") + e; | ||
case 6187: | ||
return p(p(p(e, /(zoom-|grab)/, l + "$1"), /(image-set)/, l + "$1"), e, "") + e; | ||
return h(h(h(e, /(zoom-|grab)/, l + "$1"), /(image-set)/, l + "$1"), e, "") + e; | ||
case 5495: | ||
case 3959: | ||
return p(e, /(image-set\([^]*)/, l + "$1$`$1"); | ||
return h(e, /(image-set\([^]*)/, l + "$1$`$1"); | ||
case 4968: | ||
return p(p(e, /(.+:)(flex-)?(.*)/, l + "box-pack:$3" + x + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + l + e + e; | ||
return h(h(e, /(.+:)(flex-)?(.*)/, l + "box-pack:$3" + x + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + l + e + e; | ||
case 4095: | ||
@@ -506,3 +506,3 @@ case 3583: | ||
case 2532: | ||
return p(e, /(.+)-inline(.+)/, l + "$1$2") + e; | ||
return h(e, /(.+)-inline(.+)/, l + "$1$2") + e; | ||
case 8116: | ||
@@ -526,5 +526,5 @@ case 7059: | ||
case 102: | ||
return p(e, /(.+:)(.+)-([^]+)/, "$1" + l + "$2-$3$1" + K + (E(e, r + 3) == 108 ? "$3" : "$2-$3")) + e; | ||
return h(e, /(.+:)(.+)-([^]+)/, "$1" + l + "$2-$3$1" + B + (E(e, r + 3) == 108 ? "$3" : "$2-$3")) + e; | ||
case 115: | ||
return ~re(e, "stretch") ? Se(p(e, "stretch", "fill-available"), r) + e : e; | ||
return ~re(e, "stretch") ? Oe(h(e, "stretch", "fill-available"), r) + e : e; | ||
} | ||
@@ -538,5 +538,5 @@ break; | ||
case 107: | ||
return p(e, ":", ":" + l) + e; | ||
return h(e, ":", ":" + l) + e; | ||
case 101: | ||
return p(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + l + (E(e, 14) === 45 ? "inline-" : "") + "box$3$1" + l + "$2$3$1" + x + "$2box$3") + e; | ||
return h(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + l + (E(e, 14) === 45 ? "inline-" : "") + "box$3$1" + l + "$2$3$1" + x + "$2box$3") + e; | ||
} | ||
@@ -547,7 +547,7 @@ break; | ||
case 114: | ||
return l + e + x + p(e, /[svh]\w+-[tblr]{2}/, "tb") + e; | ||
return l + e + x + h(e, /[svh]\w+-[tblr]{2}/, "tb") + e; | ||
case 108: | ||
return l + e + x + p(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e; | ||
return l + e + x + h(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e; | ||
case 45: | ||
return l + e + x + p(e, /[svh]\w+-[tblr]{2}/, "lr") + e; | ||
return l + e + x + h(e, /[svh]\w+-[tblr]{2}/, "lr") + e; | ||
} | ||
@@ -562,24 +562,24 @@ return l + e + x + e + e; | ||
case ae: | ||
r.return = Se(r.value, r.length); | ||
r.return = Oe(r.value, r.length); | ||
break; | ||
case ve: | ||
return D([L(r, { | ||
value: p(r.value, "@", "@" + l) | ||
return V([j(r, { | ||
value: h(r.value, "@", "@" + l) | ||
})], i); | ||
case se: | ||
if (r.length) | ||
return qe(r.props, function(a) { | ||
switch (We(a, /(::plac\w+|:read-\w+)/)) { | ||
return We(r.props, function(a) { | ||
switch (qe(a, /(::plac\w+|:read-\w+)/)) { | ||
case ":read-only": | ||
case ":read-write": | ||
return D([L(r, { | ||
props: [p(a, /:(read-\w+)/, ":" + K + "$1")] | ||
return V([j(r, { | ||
props: [h(a, /:(read-\w+)/, ":" + B + "$1")] | ||
})], i); | ||
case "::placeholder": | ||
return D([L(r, { | ||
props: [p(a, /:(plac\w+)/, ":" + l + "input-$1")] | ||
}), L(r, { | ||
props: [p(a, /:(plac\w+)/, ":" + K + "$1")] | ||
}), L(r, { | ||
props: [p(a, /:(plac\w+)/, x + "input-$1")] | ||
return V([j(r, { | ||
props: [h(a, /:(plac\w+)/, ":" + l + "input-$1")] | ||
}), j(r, { | ||
props: [h(a, /:(plac\w+)/, ":" + B + "$1")] | ||
}), j(r, { | ||
props: [h(a, /:(plac\w+)/, x + "input-$1")] | ||
})], i); | ||
@@ -598,4 +598,4 @@ } | ||
Array.prototype.forEach.call(s, function(m) { | ||
var N = m.getAttribute("data-emotion"); | ||
N.indexOf(" ") !== -1 && (document.head.appendChild(m), m.setAttribute("data-s", "")); | ||
var S = m.getAttribute("data-emotion"); | ||
S.indexOf(" ") !== -1 && (document.head.appendChild(m), m.setAttribute("data-s", "")); | ||
}); | ||
@@ -612,4 +612,4 @@ } | ||
function(m) { | ||
for (var N = m.getAttribute("data-emotion").split(" "), y = 1; y < N.length; y++) | ||
a[N[y]] = !0; | ||
for (var S = m.getAttribute("data-emotion").split(" "), y = 1; y < S.length; y++) | ||
a[S[y]] = !0; | ||
c.push(m); | ||
@@ -621,14 +621,14 @@ } | ||
get compat() { | ||
return $.compat; | ||
return N.compat; | ||
} | ||
}), fr); | ||
{ | ||
var f, h = [Je, process.env.NODE_ENV !== "production" ? function(m) { | ||
var f, p = [Je, process.env.NODE_ENV !== "production" ? function(m) { | ||
m.root || (m.return ? f.insert(m.return) : m.value && m.type !== ne && f.insert(m.value + "{}")); | ||
} : Qe(function(m) { | ||
f.insert(m); | ||
})], v = Ze(d.concat(i, h)), k = function(N) { | ||
return D(Ke(N), v); | ||
})], v = Ze(d.concat(i, p)), $ = function(S) { | ||
return V(Ke(S), v); | ||
}; | ||
u = function(N, y, w, C) { | ||
u = function(S, y, w, A) { | ||
f = w, process.env.NODE_ENV !== "production" && y.map !== void 0 && (f = { | ||
@@ -638,6 +638,6 @@ insert: function(P) { | ||
} | ||
}), k(N ? N + "{" + y.styles + "}" : y.styles), C && ($.inserted[y.name] = !0); | ||
}), $(S ? S + "{" + y.styles + "}" : y.styles), A && (N.inserted[y.name] = !0); | ||
}; | ||
} | ||
var $ = { | ||
var N = { | ||
key: n, | ||
@@ -657,5 +657,5 @@ sheet: new De({ | ||
}; | ||
return $.sheet.hydrate(c), $; | ||
return N.sheet.hydrate(c), N; | ||
}; | ||
function pr(e) { | ||
function hr(e) { | ||
for (var r = 0, n, s = 0, i = e.length; i >= 4; ++s, i -= 4) | ||
@@ -679,3 +679,3 @@ n = e.charCodeAt(s) & 255 | (e.charCodeAt(++s) & 255) << 8 | (e.charCodeAt(++s) & 255) << 16 | (e.charCodeAt(++s) & 255) << 24, n = /* Math.imul(k, m): */ | ||
} | ||
var hr = { | ||
var pr = { | ||
animationIterationCount: 1, | ||
@@ -727,12 +727,12 @@ borderImageOutset: 1, | ||
strokeWidth: 1 | ||
}, pe = `You have illegal escape sequence in your template literal, most likely inside content's property value. | ||
}, he = `You have illegal escape sequence in your template literal, most likely inside content's property value. | ||
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';". | ||
You can read more about this here: | ||
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences`, mr = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).", br = /[A-Z]|^ms/g, Oe = /_EMO_([^_]+?)_([^]*?)_EMO_/g, oe = function(r) { | ||
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences`, mr = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).", br = /[A-Z]|^ms/g, ke = /_EMO_([^_]+?)_([^]*?)_EMO_/g, oe = function(r) { | ||
return r.charCodeAt(1) === 45; | ||
}, he = function(r) { | ||
}, pe = function(r) { | ||
return r != null && typeof r != "boolean"; | ||
}, X = /* @__PURE__ */ Xe(function(e) { | ||
return oe(e) ? e : e.replace(br, "-$&").toLowerCase(); | ||
}), H = function(r, n) { | ||
}), K = function(r, n) { | ||
switch (r) { | ||
@@ -742,15 +742,15 @@ case "animation": | ||
if (typeof n == "string") | ||
return n.replace(Oe, function(s, i, a) { | ||
return _ = { | ||
return n.replace(ke, function(s, i, a) { | ||
return C = { | ||
name: i, | ||
styles: a, | ||
next: _ | ||
next: C | ||
}, i; | ||
}); | ||
} | ||
return hr[r] !== 1 && !oe(r) && typeof n == "number" && n !== 0 ? n + "px" : n; | ||
return pr[r] !== 1 && !oe(r) && typeof n == "number" && n !== 0 ? n + "px" : n; | ||
}; | ||
if (process.env.NODE_ENV !== "production") { | ||
var yr = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/, gr = ["normal", "none", "initial", "inherit", "unset"], vr = H, wr = /^-ms-/, Er = /-(.)/g, me = {}; | ||
H = function(r, n) { | ||
var yr = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/, gr = ["normal", "none", "initial", "inherit", "unset"], vr = K, wr = /^-ms-/, Er = /-(.)/g, me = {}; | ||
K = function(r, n) { | ||
if (r === "content" && (typeof n != "string" || gr.indexOf(n) === -1 && !yr.test(n) && (n.charAt(0) !== n.charAt(n.length - 1) || n.charAt(0) !== '"' && n.charAt(0) !== "'"))) | ||
@@ -764,4 +764,4 @@ throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + n + "\"'`"); | ||
} | ||
var ke = "Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform."; | ||
function z(e, r, n) { | ||
var $e = "Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform."; | ||
function W(e, r, n) { | ||
if (n == null) | ||
@@ -771,3 +771,3 @@ return ""; | ||
if (process.env.NODE_ENV !== "production" && n.toString() === "NO_COMPONENT_SELECTOR") | ||
throw new Error(ke); | ||
throw new Error($e); | ||
return n; | ||
@@ -780,6 +780,6 @@ } | ||
if (n.anim === 1) | ||
return _ = { | ||
return C = { | ||
name: n.name, | ||
styles: n.styles, | ||
next: _ | ||
next: C | ||
}, n.name; | ||
@@ -790,6 +790,6 @@ if (n.styles !== void 0) { | ||
for (; s !== void 0; ) | ||
_ = { | ||
C = { | ||
name: s.name, | ||
styles: s.styles, | ||
next: _ | ||
next: C | ||
}, s = s.next; | ||
@@ -803,4 +803,4 @@ var i = n.styles + ";"; | ||
if (e !== void 0) { | ||
var a = _, o = n(e); | ||
return _ = a, z(e, r, o); | ||
var a = C, o = n(e); | ||
return C = a, W(e, r, o); | ||
} else | ||
@@ -812,5 +812,5 @@ process.env.NODE_ENV !== "production" && console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`"); | ||
if (process.env.NODE_ENV !== "production") { | ||
var c = [], u = n.replace(Oe, function(f, h, v) { | ||
var k = "animation" + c.length; | ||
return c.push("const " + k + " = keyframes`" + v.replace(/^@keyframes animation-\w+/, "") + "`"), "${" + k + "}"; | ||
var c = [], u = n.replace(ke, function(f, p, v) { | ||
var $ = "animation" + c.length; | ||
return c.push("const " + $ + " = keyframes`" + v.replace(/^@keyframes animation-\w+/, "") + "`"), "${" + $ + "}"; | ||
}); | ||
@@ -835,3 +835,3 @@ c.length && console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n" + [].concat(c, ["`" + u + "`"]).join(` | ||
for (var i = 0; i < n.length; i++) | ||
s += z(e, r, n[i]) + ";"; | ||
s += W(e, r, n[i]) + ";"; | ||
else | ||
@@ -841,11 +841,11 @@ for (var a in n) { | ||
if (typeof o != "object") | ||
r != null && r[o] !== void 0 ? s += a + "{" + r[o] + "}" : he(o) && (s += X(a) + ":" + H(a, o) + ";"); | ||
r != null && r[o] !== void 0 ? s += a + "{" + r[o] + "}" : pe(o) && (s += X(a) + ":" + K(a, o) + ";"); | ||
else { | ||
if (a === "NO_COMPONENT_SELECTOR" && process.env.NODE_ENV !== "production") | ||
throw new Error(ke); | ||
throw new Error($e); | ||
if (Array.isArray(o) && typeof o[0] == "string" && (r == null || r[o[0]] === void 0)) | ||
for (var c = 0; c < o.length; c++) | ||
he(o[c]) && (s += X(a) + ":" + H(a, o[c]) + ";"); | ||
pe(o[c]) && (s += X(a) + ":" + K(a, o[c]) + ";"); | ||
else { | ||
var u = z(e, r, o); | ||
var u = W(e, r, o); | ||
switch (a) { | ||
@@ -865,15 +865,15 @@ case "animation": | ||
} | ||
var be = /label:\s*([^\s;\n{]+)\s*(;|$)/g, _e; | ||
process.env.NODE_ENV !== "production" && (_e = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g); | ||
var _, ee = function(r, n, s) { | ||
var be = /label:\s*([^\s;\n{]+)\s*(;|$)/g, Ce; | ||
process.env.NODE_ENV !== "production" && (Ce = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g); | ||
var C, ee = function(r, n, s) { | ||
if (r.length === 1 && typeof r[0] == "object" && r[0] !== null && r[0].styles !== void 0) | ||
return r[0]; | ||
var i = !0, a = ""; | ||
_ = void 0; | ||
C = void 0; | ||
var o = r[0]; | ||
o == null || o.raw === void 0 ? (i = !1, a += z(s, n, o)) : (process.env.NODE_ENV !== "production" && o[0] === void 0 && console.error(pe), a += o[0]); | ||
o == null || o.raw === void 0 ? (i = !1, a += W(s, n, o)) : (process.env.NODE_ENV !== "production" && o[0] === void 0 && console.error(he), a += o[0]); | ||
for (var c = 1; c < r.length; c++) | ||
a += z(s, n, r[c]), i && (process.env.NODE_ENV !== "production" && o[c] === void 0 && console.error(pe), a += o[c]); | ||
a += W(s, n, r[c]), i && (process.env.NODE_ENV !== "production" && o[c] === void 0 && console.error(he), a += o[c]); | ||
var u; | ||
process.env.NODE_ENV !== "production" && (a = a.replace(_e, function(v) { | ||
process.env.NODE_ENV !== "production" && (a = a.replace(Ce, function(v) { | ||
return u = v, ""; | ||
@@ -884,8 +884,8 @@ })), be.lastIndex = 0; | ||
f[1]; | ||
var h = pr(a) + d; | ||
var p = hr(a) + d; | ||
return process.env.NODE_ENV !== "production" ? { | ||
name: h, | ||
name: p, | ||
styles: a, | ||
map: u, | ||
next: _, | ||
next: C, | ||
toString: function() { | ||
@@ -895,8 +895,8 @@ return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; | ||
} : { | ||
name: h, | ||
name: p, | ||
styles: a, | ||
next: _ | ||
next: C | ||
}; | ||
}, $r = !0; | ||
function Ce(e, r, n) { | ||
}, Nr = !0; | ||
function Ae(e, r, n) { | ||
var s = ""; | ||
@@ -907,3 +907,3 @@ return n.split(" ").forEach(function(i) { | ||
} | ||
var Nr = function(r, n, s) { | ||
var Sr = function(r, n, s) { | ||
var i = r.key + "-" + n.name; | ||
@@ -919,5 +919,5 @@ // we only need to add the styles to the registered cache if the | ||
// also, note that this check will be dead code eliminated in the browser | ||
$r === !1) && r.registered[i] === void 0 && (r.registered[i] = n.styles); | ||
}, Sr = function(r, n, s) { | ||
Nr(r, n, s); | ||
Nr === !1) && r.registered[i] === void 0 && (r.registered[i] = n.styles); | ||
}, Or = function(r, n, s) { | ||
Sr(r, n, s); | ||
var i = r.key + "-" + n.name; | ||
@@ -936,6 +936,6 @@ if (r.inserted[n.name] === void 0) { | ||
function ge(e, r, n) { | ||
var s = [], i = Ce(e, s, n); | ||
var s = [], i = Ae(e, s, n); | ||
return s.length < 2 ? n : i + r(s); | ||
} | ||
var Or = function(r) { | ||
var kr = function(r) { | ||
var n = lr(r); | ||
@@ -950,11 +950,11 @@ n.sheet.speedy = function(c) { | ||
d[f] = arguments[f]; | ||
var h = ee(d, n.registered, void 0); | ||
return Sr(n, h, !1), n.key + "-" + h.name; | ||
var p = ee(d, n.registered, void 0); | ||
return Or(n, p, !1), n.key + "-" + p.name; | ||
}, i = function() { | ||
for (var u = arguments.length, d = new Array(u), f = 0; f < u; f++) | ||
d[f] = arguments[f]; | ||
var h = ee(d, n.registered), v = "animation-" + h.name; | ||
var p = ee(d, n.registered), v = "animation-" + p.name; | ||
return ye(n, { | ||
name: h.name, | ||
styles: "@keyframes " + v + "{" + h.styles + "}" | ||
name: p.name, | ||
styles: "@keyframes " + v + "{" + p.styles + "}" | ||
}), v; | ||
@@ -964,8 +964,8 @@ }, a = function() { | ||
d[f] = arguments[f]; | ||
var h = ee(d, n.registered); | ||
ye(n, h); | ||
var p = ee(d, n.registered); | ||
ye(n, p); | ||
}, o = function() { | ||
for (var u = arguments.length, d = new Array(u), f = 0; f < u; f++) | ||
d[f] = arguments[f]; | ||
return ge(n.registered, s, kr(d)); | ||
return ge(n.registered, s, $r(d)); | ||
}; | ||
@@ -988,6 +988,6 @@ return { | ||
cache: n, | ||
getRegisteredStyles: Ce.bind(null, n.registered), | ||
getRegisteredStyles: Ae.bind(null, n.registered), | ||
merge: ge.bind(null, n.registered, s) | ||
}; | ||
}, kr = function e(r) { | ||
}, $r = function e(r) { | ||
for (var n = "", s = 0; s < r.length; s++) { | ||
@@ -1017,8 +1017,8 @@ var i = r[s]; | ||
return n; | ||
}, _r = Or({ | ||
}, Cr = kr({ | ||
key: "css" | ||
}), Cr = _r.css; | ||
}), Ar = Cr.css; | ||
const t = (e) => (r, ...n) => { | ||
const s = (i, a) => { | ||
const o = Object.getOwnPropertyNames(a).filter((c) => c.startsWith("_$$")).map((c) => c.slice(3)); | ||
const o = [...new Set(Object.getOwnPropertyNames(a).filter((c) => a[c] === "_$prop").map((c) => c.replace(/^_\$*/, "")))]; | ||
i._$addProp("className", () => { | ||
@@ -1032,3 +1032,3 @@ const c = {}; | ||
r[f] && (u += r[f]), n[f] && (typeof n[f] == "function" ? u += n[f](c) : u += n[f]); | ||
return Cr`${u}`; | ||
return Ar`${u}`; | ||
}, a, o); | ||
@@ -1039,9 +1039,3 @@ }; | ||
super(...arguments); | ||
V(this, "_$deps", { | ||
_$content: /* @__PURE__ */ new Map() | ||
}); | ||
V(this, "_$$_$content", "_$prop"); | ||
// @ts-expect-error | ||
V(this, "_$content", ""); | ||
V(this, "_$forwardProps", !0); | ||
Q(this, "_$forwardProps", !0); | ||
} | ||
@@ -1053,3 +1047,3 @@ Afterset() { | ||
const o = new Ie.HtmlNode(e); | ||
return o._$addProp("innerText", () => this._$content, this, ["_$content"]), this.forwardProps(o), ((c) => s(c, this))(o), [o]; | ||
return o._$addProp("innerText", this._$content), this.forwardProps(o), ((c) => s(c, this))(o), [o]; | ||
} | ||
@@ -1059,9 +1053,3 @@ } : class extends ce { | ||
super(...arguments); | ||
V(this, "_$deps", { | ||
_$content: /* @__PURE__ */ new Map() | ||
}); | ||
V(this, "_$$_$content", "_$prop"); | ||
// @ts-expect-error | ||
V(this, "_$content", ""); | ||
V(this, "_$forwardProps", !0); | ||
Q(this, "_$forwardProps", !0); | ||
} | ||
@@ -1187,4 +1175,4 @@ Body() { | ||
export { | ||
Cr as css, | ||
Ar as css, | ||
t as styled | ||
}; |
{ | ||
"name": "@dlightjs/emotion", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"type": "module", | ||
@@ -16,7 +16,7 @@ "files": [ | ||
"@dlightjs/types": "0.1.0", | ||
"vite-plugin-dlight-transpiler": "0.4.3" | ||
"vite-plugin-dlight-transpiler": "0.4.4" | ||
}, | ||
"dependencies": { | ||
"@emotion/css": "^11.10.6", | ||
"@dlightjs/dlight": "0.4.9" | ||
"@dlightjs/dlight": "0.4.11" | ||
}, | ||
@@ -23,0 +23,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
61182
1222
+ Added@dlightjs/dlight@0.4.11(transitive)
- Removed@dlightjs/dlight@0.4.9(transitive)
Updated@dlightjs/dlight@0.4.11