@tamagui/logo 1.123.17 → 1.124.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/useTint.cjs +4 -5
- package/dist/cjs/useTint.js +3 -3
- package/dist/cjs/useTint.js.map +1 -1
- package/dist/cjs/useTint.native.js +3 -3
- package/dist/cjs/useTint.native.js.map +2 -2
- package/dist/esm/useTint.js +4 -4
- package/dist/esm/useTint.js.map +1 -1
- package/dist/esm/useTint.mjs +4 -5
- package/dist/esm/useTint.mjs.map +1 -1
- package/dist/esm/useTint.native.js +4 -4
- package/dist/esm/useTint.native.js.map +2 -2
- package/package.json +4 -4
- package/src/useTint.tsx +2 -7
- package/types/useTint.d.ts.map +2 -2
package/dist/cjs/useTint.cjs
CHANGED
|
@@ -39,10 +39,10 @@ __export(useTint_exports, {
|
|
|
39
39
|
useTint: () => useTint
|
|
40
40
|
});
|
|
41
41
|
module.exports = __toCommonJS(useTint_exports);
|
|
42
|
-
var
|
|
42
|
+
var import_one = require("one"),
|
|
43
|
+
import_react = __toESM(require("react"), 1),
|
|
43
44
|
import_tamagui = require("tamagui"),
|
|
44
45
|
import_tints = require("./tints.cjs"),
|
|
45
|
-
import_one = require("one"),
|
|
46
46
|
import_jsx_runtime = require("react/jsx-runtime");
|
|
47
47
|
let current = 3;
|
|
48
48
|
const listeners = /* @__PURE__ */new Set(),
|
|
@@ -59,10 +59,9 @@ function getDocsSection(pathname) {
|
|
|
59
59
|
}
|
|
60
60
|
const useTint = (altOffset = -1) => {
|
|
61
61
|
const pathname = (0, import_one.usePathname)(),
|
|
62
|
-
section = getDocsSection(pathname)
|
|
63
|
-
hydrated = (0, import_tamagui.useDidFinishSSR)();
|
|
62
|
+
section = getDocsSection(pathname);
|
|
64
63
|
let initial = current;
|
|
65
|
-
section && (initial = section === "compile" ? 5 : section === "core" ? 4 : 6
|
|
64
|
+
section && (initial = section === "compile" ? 5 : section === "core" ? 4 : 6);
|
|
66
65
|
const index = import_react.default.useSyncExternalStore(onTintChange, () => current, () => initial),
|
|
67
66
|
tintsContext = (0, import_tints.useTints)(),
|
|
68
67
|
{
|
package/dist/cjs/useTint.js
CHANGED
|
@@ -30,7 +30,7 @@ __export(useTint_exports, {
|
|
|
30
30
|
useTint: () => useTint
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(useTint_exports);
|
|
33
|
-
var import_react = __toESM(require("react"), 1), import_tamagui = require("tamagui"), import_tints = require("./tints"),
|
|
33
|
+
var import_one = require("one"), import_react = __toESM(require("react"), 1), import_tamagui = require("tamagui"), import_tints = require("./tints"), import_jsx_runtime = require("react/jsx-runtime");
|
|
34
34
|
let current = 3;
|
|
35
35
|
const listeners = /* @__PURE__ */ new Set(), onTintChange = (listener) => (listeners.add(listener), () => {
|
|
36
36
|
listeners.delete(listener);
|
|
@@ -42,9 +42,9 @@ function getDocsSection(pathname) {
|
|
|
42
42
|
return pathname === "/docs/intro/compiler-install" || pathname === "/docs/intro/benchmarks" || pathname === "/docs/intro/why-a-compiler" ? "compile" : pathname.startsWith("/ui/") ? "ui" : pathname.startsWith("/docs/") ? "core" : null;
|
|
43
43
|
}
|
|
44
44
|
const useTint = (altOffset = -1) => {
|
|
45
|
-
const pathname = (0, import_one.usePathname)(), section = getDocsSection(pathname)
|
|
45
|
+
const pathname = (0, import_one.usePathname)(), section = getDocsSection(pathname);
|
|
46
46
|
let initial = current;
|
|
47
|
-
section && (initial = section === "compile" ? 5 : section === "core" ? 4 : 6
|
|
47
|
+
section && (initial = section === "compile" ? 5 : section === "core" ? 4 : 6);
|
|
48
48
|
const index = import_react.default.useSyncExternalStore(
|
|
49
49
|
onTintChange,
|
|
50
50
|
() => current,
|
package/dist/cjs/useTint.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useTint.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;A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B,mBAAAA,QAAM,gBAAgB,MAAM;AAC1B,qBAAa,QAAQ,CAAC;AAAA,MACxB,CAAC;AAAA,IACH;AAAA,EACF;AACF,GAEa,YAAY,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAuD;AACrD,QAAM,UAAU,QAAQ,EAAE;AAC1B,SACE,4CAAC,wBAAO,GAAG,MAAM,MAAM,UAAU,OAAO,SACrC,UACH;AAEJ,GAEa,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,GAAG;AACL,MAAwE;AACtE,QAAM,UAAU,QAAQ,MAAM,EAAE;AAEhC,SACE,4CAAC,wBAAM,MAFI,UAAU,OAAO,SAER,GAAG,MACpB,UACH;AAEJ;",
|
|
5
5
|
"names": ["React"]
|
|
6
6
|
}
|
|
@@ -31,7 +31,7 @@ __export(useTint_exports, {
|
|
|
31
31
|
useTint: () => useTint
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(useTint_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime"), import_react = __toESM(require("react"), 1), import_tamagui = require("tamagui"), import_tints = require("./tints"),
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_one = require("one"), import_react = __toESM(require("react"), 1), import_tamagui = require("tamagui"), import_tints = require("./tints"), current = 3, listeners = /* @__PURE__ */ new Set(), onTintChange = function(listener) {
|
|
35
35
|
return listeners.add(listener), function() {
|
|
36
36
|
listeners.delete(listener);
|
|
37
37
|
};
|
|
@@ -45,8 +45,8 @@ function getDocsSection(pathname) {
|
|
|
45
45
|
return pathname === "/docs/intro/compiler-install" || pathname === "/docs/intro/benchmarks" || pathname === "/docs/intro/why-a-compiler" ? "compile" : pathname.startsWith("/ui/") ? "ui" : pathname.startsWith("/docs/") ? "core" : null;
|
|
46
46
|
}
|
|
47
47
|
var useTint = function() {
|
|
48
|
-
var altOffset = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1, pathname = (0, import_one.usePathname)(), section = getDocsSection(pathname),
|
|
49
|
-
section && (initial = section === "compile" ? 5 : section === "core" ? 4 : 6
|
|
48
|
+
var altOffset = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1, pathname = (0, import_one.usePathname)(), section = getDocsSection(pathname), initial = current;
|
|
49
|
+
section && (initial = section === "compile" ? 5 : section === "core" ? 4 : 6);
|
|
50
50
|
var index = import_react.default.useSyncExternalStore(onTintChange, function() {
|
|
51
51
|
return current;
|
|
52
52
|
}, function() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/packages/logo/src/useTint.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,eAAkB,8BAGlB,
|
|
5
|
-
"names": ["current", "listeners", "Set", "onTintChange", "listener", "add", "delete", "numTints", "getTints", "tints", "length", "setTintIndex", "next", "val", "forEach", "x", "getDocsSection", "pathname", "startsWith", "useTint", "altOffset", "usePathname", "section", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,aAA4B,gBAC5B,eAAkB,8BAGlB,iBAAsB,oBACtB,eAAsD,oBAKlDA,UAAU,GAERC,YAAY,oBAAIC,IAAAA,GAETC,eAAe,SAACC,UAAAA;AAC3BH,mBAAUI,IAAID,QAAAA,GACP,WAAA;AACLH,cAAUK,OAAOF,QAAAA;EACnB;AACF,GAEMG,eAAWC,uBAAAA,EAAWC,MAAMC,QAErBC,eAAe,SAACC,MAAAA;AAC3B,MAAMC,MAAMD,OAAOL;AACnB,EAAIM,QAAQb,YACZA,UAAUa,KACVZ,UAAUa,QAAQ,SAACC,GAAAA;WAAMA,EAAEF,GAAAA;;AAC7B;AAEO,SAASG,eAAeC,UAAgB;AAC7C,SAAOA,aAAa,kCAClBA,aAAa,4BACbA,aAAa,+BACX,YACAA,SAASC,WAAW,MAAA,IAClB,OACAD,SAASC,WAAW,QAAA,IAClB,SACA;AACV;AAEO,IAAMC,UAAU,WAAA;MACrBC,YAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAY,IAoBNH,eAAWI,wBAAAA,GACXC,UAAUN,eAAeC,QAAAA,GAE3BM,UAAUvB;AACd,EAAIsB,YACFC,UAAUD,YAAY,YAAY,IAAIA,YAAY,SAAS,IAAI;AAGjE,MAAME,QAAQC,aAAAA,QAAMC,qBAClBvB,cACA,WAAA;WAAMH;KACN,WAAA;WAAMuB;MAEFI,mBAAeC,uBAAAA,GACf,EAAEnB,MAAK,IAAKkB,cACZE,eAAeC,KAAKC,KAAKP,QAAQJ,aAAaX,MAAMC,MAAM;AAEhE,SAAO;IACL,GAAGiB;IACHlB,OAAOkB,aAAalB;IACpBuB,WAAWR;IACXK;IACAI,MAAMxB,MAAMe,KAAAA;IACZU,SAASzB,MAAMoB,YAAAA;IACflB;IACAwB;IACAC,aAAa,WAAA;AACXX,mBAAAA,QAAMY,gBAAgB,WAAA;AACpB1B,qBAAaa,QAAQ,CAAA;MACvB,CAAA;IACF;EACF;AACF,GAEac,YAAY,SAAA,OAAA;MAAC,EACxBC,SACAC,UACA,GAAGC,KAAAA,IACgC,OAC7BC,UAAUvB,QAAAA,EAAUc;AAC1B,SACE,uCAAAU,KAACC,sBAAAA;IAAO,GAAGH;IAAMI,MAAMN,UAAU,OAAOG;;;AAI5C,GAEaI,eAAe,SAAA,OAAA;MAAC,EAC3BN,UACAD,SACAQ,SAAS,GACT,GAAGN,KAAAA,IACiD,OAC9CC,UAAUvB,QAAQ4B,MAAAA,EAAQb,SAC1BW,OAAON,UAAU,OAAOG;AAC9B,SACE,uCAAAC,KAACC,sBAAAA;IAAMC;IAAa,GAAGJ;;;AAI3B;",
|
|
5
|
+
"names": ["current", "listeners", "Set", "onTintChange", "listener", "add", "delete", "numTints", "getTints", "tints", "length", "setTintIndex", "next", "val", "forEach", "x", "getDocsSection", "pathname", "startsWith", "useTint", "altOffset", "usePathname", "section", "initial", "index", "React", "useSyncExternalStore", "tintsContext", "useTints", "tintAltIndex", "Math", "abs", "tintIndex", "tint", "tintAlt", "setNextTintFamily", "setNextTint", "startTransition", "ThemeTint", "disable", "children", "rest", "curTint", "_jsx", "Theme", "name", "ThemeTintAlt", "offset"]
|
|
6
6
|
}
|
package/dist/esm/useTint.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { usePathname } from "one";
|
|
1
2
|
import React from "react";
|
|
2
|
-
import { Theme
|
|
3
|
+
import { Theme } from "tamagui";
|
|
3
4
|
import { getTints, setNextTintFamily, useTints } from "./tints";
|
|
4
|
-
import { usePathname } from "one";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
let current = 3;
|
|
7
7
|
const listeners = /* @__PURE__ */ new Set(), onTintChange = (listener) => (listeners.add(listener), () => {
|
|
@@ -14,9 +14,9 @@ function getDocsSection(pathname) {
|
|
|
14
14
|
return pathname === "/docs/intro/compiler-install" || pathname === "/docs/intro/benchmarks" || pathname === "/docs/intro/why-a-compiler" ? "compile" : pathname.startsWith("/ui/") ? "ui" : pathname.startsWith("/docs/") ? "core" : null;
|
|
15
15
|
}
|
|
16
16
|
const useTint = (altOffset = -1) => {
|
|
17
|
-
const pathname = usePathname(), section = getDocsSection(pathname)
|
|
17
|
+
const pathname = usePathname(), section = getDocsSection(pathname);
|
|
18
18
|
let initial = current;
|
|
19
|
-
section && (initial = section === "compile" ? 5 : section === "core" ? 4 : 6
|
|
19
|
+
section && (initial = section === "compile" ? 5 : section === "core" ? 4 : 6);
|
|
20
20
|
const index = React.useSyncExternalStore(
|
|
21
21
|
onTintChange,
|
|
22
22
|
() => current,
|
package/dist/esm/useTint.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useTint.tsx"],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AAA,EACF;AACF,GAEa,YAAY,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAuD;AACrD,QAAM,UAAU,QAAQ,EAAE;AAC1B,SACE,oBAAC,SAAO,GAAG,MAAM,MAAM,UAAU,OAAO,SACrC,UACH;AAEJ,GAEa,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,GAAG;AACL,MAAwE;AACtE,QAAM,UAAU,QAAQ,MAAM,EAAE;AAEhC,SACE,oBAAC,SAAM,MAFI,UAAU,OAAO,SAER,GAAG,MACpB,UACH;AAEJ;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/esm/useTint.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { usePathname } from "one";
|
|
1
2
|
import React from "react";
|
|
2
|
-
import { Theme
|
|
3
|
+
import { Theme } from "tamagui";
|
|
3
4
|
import { getTints, setNextTintFamily, useTints } from "./tints.mjs";
|
|
4
|
-
import { usePathname } from "one";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
let current = 3;
|
|
7
7
|
const listeners = /* @__PURE__ */new Set(),
|
|
@@ -18,10 +18,9 @@ function getDocsSection(pathname) {
|
|
|
18
18
|
}
|
|
19
19
|
const useTint = (altOffset = -1) => {
|
|
20
20
|
const pathname = usePathname(),
|
|
21
|
-
section = getDocsSection(pathname)
|
|
22
|
-
hydrated = useDidFinishSSR();
|
|
21
|
+
section = getDocsSection(pathname);
|
|
23
22
|
let initial = current;
|
|
24
|
-
section && (initial = section === "compile" ? 5 : section === "core" ? 4 : 6
|
|
23
|
+
section && (initial = section === "compile" ? 5 : section === "core" ? 4 : 6);
|
|
25
24
|
const index = React.useSyncExternalStore(onTintChange, () => current, () => initial),
|
|
26
25
|
tintsContext = useTints(),
|
|
27
26
|
{
|
package/dist/esm/useTint.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["usePathname","React","Theme","getTints","setNextTintFamily","useTints","jsx","current","listeners","Set","onTintChange","listener","add","delete","numTints","tints","length","setTintIndex","next","val","forEach","x","getDocsSection","pathname","startsWith","useTint","altOffset","section","initial","index","useSyncExternalStore","tintsContext","tintAltIndex","Math","abs","tintIndex","tint","tintAlt","setNextTint","startTransition","ThemeTint","disable","children","rest","curTint","name","ThemeTintAlt","offset"],"sources":["../../src/useTint.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,WAAA,QAAmB;AAC5B,OAAOC,KAAA,MAAW;AAGlB,SAASC,KAAA,QAAa;AACtB,SAASC,QAAA,EAAUC,iBAAA,EAAmBC,QAAA,QAAgB;AAmGlD,SAAAC,GAAA;AA9FJ,IAAIC,OAAA,GAAU;AAEd,MAAMC,SAAA,GAAY,mBAAIC,GAAA,CAAc;EAEvBC,YAAA,GAAgBC,QAAA,KAC3BH,SAAA,CAAUI,GAAA,CAAID,QAAQ,GACf,MAAY;IACjBH,SAAA,CAAUK,MAAA,CAAOF,QAAQ;EAC3B;EAGIG,QAAA,GAAWX,QAAA,CAAS,EAAEY,KAAA,CAAMC,MAAA;EAErBC,YAAA,GAAgBC,IAAA,IAAuB;IAClD,MAAMC,GAAA,GAAMD,IAAA,GAAOJ,QAAA;IACfK,GAAA,KAAQZ,OAAA,KACZA,OAAA,GAAUY,GAAA,EACVX,SAAA,CAAUY,OAAA,CAASC,CAAA,IAAMA,CAAA,CAAEF,GAAG,CAAC;EACjC;AAEO,SAASG,eAAeC,QAAA,EAAoD;EACjF,OAAOA,QAAA,KAAa,kCAClBA,QAAA,KAAa,4BACbA,QAAA,KAAa,+BACX,YACAA,QAAA,CAASC,UAAA,CAAW,MAAM,IACxB,OACAD,QAAA,CAASC,UAAA,CAAW,QAAQ,IAC1B,SACA;AACV;AAEO,MAAMC,OAAA,GAAUA,CACrBC,SAAA,GAAY,OAmBT;IACH,MAAMH,QAAA,GAAWvB,WAAA,CAAY;MACvB2B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AA;MAAM2C,IAAA,EAFIJ,OAAA,GAAU,OAAOG,OAAA;MAER,GAAGD,IAAA;MACpBD;IAAA,CACH;EAEJ","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { usePathname } from "one";
|
|
2
3
|
import React from "react";
|
|
3
|
-
import { Theme
|
|
4
|
+
import { Theme } from "tamagui";
|
|
4
5
|
import { getTints, setNextTintFamily, useTints } from "./tints";
|
|
5
|
-
import { usePathname } from "one";
|
|
6
6
|
var current = 3, listeners = /* @__PURE__ */ new Set(), onTintChange = function(listener) {
|
|
7
7
|
return listeners.add(listener), function() {
|
|
8
8
|
listeners.delete(listener);
|
|
@@ -17,8 +17,8 @@ function getDocsSection(pathname) {
|
|
|
17
17
|
return pathname === "/docs/intro/compiler-install" || pathname === "/docs/intro/benchmarks" || pathname === "/docs/intro/why-a-compiler" ? "compile" : pathname.startsWith("/ui/") ? "ui" : pathname.startsWith("/docs/") ? "core" : null;
|
|
18
18
|
}
|
|
19
19
|
var useTint = function() {
|
|
20
|
-
var altOffset = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1, pathname = usePathname(), section = getDocsSection(pathname),
|
|
21
|
-
section && (initial = section === "compile" ? 5 : section === "core" ? 4 : 6
|
|
20
|
+
var altOffset = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1, pathname = usePathname(), section = getDocsSection(pathname), initial = current;
|
|
21
|
+
section && (initial = section === "compile" ? 5 : section === "core" ? 4 : 6);
|
|
22
22
|
var index = React.useSyncExternalStore(onTintChange, function() {
|
|
23
23
|
return current;
|
|
24
24
|
}, function() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/packages/logo/src/useTint.tsx"],
|
|
4
|
-
"mappings": ";AAAA,
|
|
5
|
-
"names": ["
|
|
4
|
+
"mappings": ";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AAA;MACvB,CAAA;IACF;EACF;AACF,GAEaW,YAAY,SAAA,OAAA;MAAC,EACxBC,SACAC,UACA,GAAGC,KAAAA,IACgC,OAC7BC,UAAUnB,QAAAA,EAAUW;AAC1B,SACE,qBAACjC,OAAAA;IAAO,GAAGwC;IAAME,MAAMJ,UAAU,OAAOG;;;AAI5C,GAEaE,eAAe,SAAA,OAAA;MAAC,EAC3BJ,UACAD,SACAM,SAAS,GACT,GAAGJ,KAAAA,IACiD,OAC9CC,UAAUnB,QAAQsB,MAAAA,EAAQV,SAC1BQ,OAAOJ,UAAU,OAAOG;AAC9B,SACE,qBAACzC,OAAAA;IAAM0C;IAAa,GAAGF;;;AAI3B;",
|
|
5
|
+
"names": ["usePathname", "React", "Theme", "getTints", "setNextTintFamily", "useTints", "current", "listeners", "Set", "onTintChange", "listener", "add", "delete", "numTints", "tints", "length", "setTintIndex", "next", "val", "forEach", "x", "getDocsSection", "pathname", "startsWith", "useTint", "altOffset", "section", "initial", "index", "useSyncExternalStore", "tintsContext", "tintAltIndex", "Math", "abs", "tintIndex", "tint", "tintAlt", "setNextTint", "startTransition", "ThemeTint", "disable", "children", "rest", "curTint", "name", "ThemeTintAlt", "offset"]
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/logo",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.124.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"source": "src/index.tsx",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"clean:build": "tamagui-build clean:build"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"one": "1.1.
|
|
48
|
-
"tamagui": "1.
|
|
47
|
+
"one": "1.1.436",
|
|
48
|
+
"tamagui": "1.124.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@tamagui/build": "1.
|
|
51
|
+
"@tamagui/build": "1.124.0",
|
|
52
52
|
"react": "*"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
package/src/useTint.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { usePathname } from 'one'
|
|
1
2
|
import React from 'react'
|
|
2
3
|
import type { JSX } from 'react/jsx-runtime'
|
|
3
4
|
import type { ThemeName, ThemeProps } from 'tamagui'
|
|
4
|
-
import { Theme
|
|
5
|
+
import { Theme } from 'tamagui'
|
|
5
6
|
import { getTints, setNextTintFamily, useTints } from './tints'
|
|
6
|
-
import { usePathname } from 'one'
|
|
7
7
|
|
|
8
8
|
// no localstorage because its not important to remember and causes a flicker
|
|
9
9
|
// const tintVal = typeof localStorage !== 'undefined' ? localStorage.getItem('tint') : 0
|
|
@@ -64,14 +64,9 @@ export const useTint = (
|
|
|
64
64
|
const pathname = usePathname()
|
|
65
65
|
const section = getDocsSection(pathname)
|
|
66
66
|
|
|
67
|
-
const hydrated = useDidFinishSSR()
|
|
68
|
-
|
|
69
67
|
let initial = current
|
|
70
68
|
if (section) {
|
|
71
69
|
initial = section === 'compile' ? 5 : section === 'core' ? 4 : 6
|
|
72
|
-
if (!hydrated) {
|
|
73
|
-
current = initial
|
|
74
|
-
}
|
|
75
70
|
}
|
|
76
71
|
|
|
77
72
|
const index = React.useSyncExternalStore(
|
package/types/useTint.d.ts.map
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mappings": "
|
|
2
|
+
"mappings": "AAEA,cAAc,WAAW,mBAAmB;AAC5C,cAAc,WAAW,kBAAkB,SAAS;AAWpD,OAAO,cAAM,eAAgBA,WAAWC;AASxC,OAAO,cAAM,eAAgBC;AAO7B,OAAO,iBAAS,eAAeC,mBAAmB,YAAY,OAAO,SAAS;AAY9E,OAAO,cAAM,UACX,uBACC;CACD,OAAO;CACP;CACA;CACA,MAAM;CACN,SAAS;CACT,eAAeD;CACf;CACA;CACA;CACA,UAAU;EACR;EACA;EACA;EACA;EACA;EACA;CACD;AACF;AAmCD,OAAO,cAAM,YAAa,EACxB,SACA,SACA,GAAG,MACgC,EAAlC,aAAa,EAAE,kBAAmB,MAAG,IAAI;AAS5C,OAAO,cAAM,eAAgB,EAC3B,UACA,SACA,OACA,GAAG,MACiD,EAAnD,aAAa;CAAE;CAAmB;AAAiB,MAAG,IAAI",
|
|
3
3
|
"names": [
|
|
4
4
|
"listener: (cur: number) => void",
|
|
5
5
|
"cur: number",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"src/useTint.tsx"
|
|
11
11
|
],
|
|
12
12
|
"sourcesContent": [
|
|
13
|
-
"import React from 'react'\nimport type { JSX } from 'react/jsx-runtime'\nimport type { ThemeName, ThemeProps } from 'tamagui'\nimport { Theme
|
|
13
|
+
"import { usePathname } from 'one'\nimport React from 'react'\nimport type { JSX } from 'react/jsx-runtime'\nimport type { ThemeName, ThemeProps } from 'tamagui'\nimport { Theme } from 'tamagui'\nimport { getTints, setNextTintFamily, useTints } from './tints'\n\n// no localstorage because its not important to remember and causes a flicker\n// const tintVal = typeof localStorage !== 'undefined' ? localStorage.getItem('tint') : 0\n// const tint = tintVal ? +tintVal 0\nlet current = 3\n\nconst listeners = new Set<Function>()\n\nexport const onTintChange = (listener: (cur: number) => void) => {\n listeners.add(listener)\n return (): void => {\n listeners.delete(listener)\n }\n}\n\nconst numTints = getTints().tints.length\n\nexport const setTintIndex = (next: number): void => {\n const val = next % numTints\n if (val === current) return\n current = val\n listeners.forEach((x) => x(val))\n}\n\nexport function getDocsSection(pathname: string): 'compile' | 'ui' | 'core' | null {\n return pathname === '/docs/intro/compiler-install' ||\n pathname === '/docs/intro/benchmarks' ||\n pathname === '/docs/intro/why-a-compiler'\n ? 'compile'\n : pathname.startsWith('/ui/')\n ? 'ui'\n : pathname.startsWith('/docs/')\n ? 'core'\n : null\n}\n\nexport const useTint = (\n altOffset = -1\n): {\n tints: ThemeName[]\n tintIndex: number\n tintAltIndex: number\n tint: ThemeName\n tintAlt: ThemeName\n setTintIndex: (next: number) => void\n setNextTintFamily: () => void\n setNextTint: () => void\n name: string\n families: {\n tamagui: string[]\n xmas: string[]\n easter: string[]\n halloween: string[]\n valentine: string[]\n lunar: string[]\n }\n} => {\n const pathname = usePathname()\n const section = getDocsSection(pathname)\n\n let initial = current\n if (section) {\n initial = section === 'compile' ? 5 : section === 'core' ? 4 : 6\n }\n\n const index = React.useSyncExternalStore(\n onTintChange,\n () => current,\n () => initial\n )\n const tintsContext = useTints()\n const { tints } = tintsContext\n const tintAltIndex = Math.abs((index + altOffset) % tints.length)\n\n return {\n ...tintsContext,\n tints: tintsContext.tints as ThemeName[],\n tintIndex: index,\n tintAltIndex,\n tint: tints[index] as ThemeName,\n tintAlt: tints[tintAltIndex] as ThemeName,\n setTintIndex,\n setNextTintFamily,\n setNextTint: () => {\n React.startTransition(() => {\n setTintIndex(index + 1)\n })\n },\n } as const\n}\n\nexport const ThemeTint = ({\n disable,\n children,\n ...rest\n}: ThemeProps & { disable?: boolean }): JSX.Element => {\n const curTint = useTint().tint\n return (\n <Theme {...rest} name={disable ? null : curTint}>\n {children}\n </Theme>\n )\n}\n\nexport const ThemeTintAlt = ({\n children,\n disable,\n offset = 1,\n ...rest\n}: ThemeProps & { disable?: boolean; offset?: number }): JSX.Element => {\n const curTint = useTint(offset).tintAlt\n const name = disable ? null : curTint\n return (\n <Theme name={name} {...rest}>\n {children}\n </Theme>\n )\n}\n"
|
|
14
14
|
],
|
|
15
15
|
"version": 3
|
|
16
16
|
}
|