@tamagui/logo 1.123.2 → 1.123.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/LogoWords.cjs +1 -1
- package/dist/cjs/LogoWords.js +1 -1
- package/dist/cjs/LogoWords.js.map +1 -1
- package/dist/cjs/LogoWords.native.js +1 -1
- package/dist/cjs/LogoWords.native.js.map +1 -1
- package/dist/cjs/tints.cjs +1 -1
- package/dist/cjs/tints.js +1 -1
- package/dist/cjs/tints.native.js +1 -1
- package/dist/cjs/tints.native.js.map +1 -1
- package/dist/cjs/useTint.cjs +15 -7
- package/dist/cjs/useTint.js +12 -6
- package/dist/cjs/useTint.js.map +1 -1
- package/dist/cjs/useTint.native.js +12 -6
- package/dist/cjs/useTint.native.js.map +2 -2
- package/dist/esm/useTint.js +13 -6
- package/dist/esm/useTint.js.map +1 -1
- package/dist/esm/useTint.mjs +15 -7
- package/dist/esm/useTint.mjs.map +1 -1
- package/dist/esm/useTint.native.js +13 -6
- package/dist/esm/useTint.native.js.map +2 -2
- package/package.json +29 -4
- package/src/useTint.tsx +29 -5
- package/types/useTint.d.ts +1 -1
- package/types/useTint.d.ts.map +4 -3
package/dist/cjs/LogoWords.cjs
CHANGED
|
@@ -34,7 +34,7 @@ __export(LogoWords_exports, {
|
|
|
34
34
|
LogoWords: () => LogoWords
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(LogoWords_exports);
|
|
37
|
-
var import_react = __toESM(require("react")),
|
|
37
|
+
var import_react = __toESM(require("react"), 1),
|
|
38
38
|
import_tamagui = require("tamagui"),
|
|
39
39
|
import_useTint = require("./useTint.cjs"),
|
|
40
40
|
import_jsx_runtime = require("react/jsx-runtime");
|
package/dist/cjs/LogoWords.js
CHANGED
|
@@ -25,7 +25,7 @@ __export(LogoWords_exports, {
|
|
|
25
25
|
LogoWords: () => LogoWords
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(LogoWords_exports);
|
|
28
|
-
var import_react = __toESM(require("react")), import_tamagui = require("tamagui"), import_useTint = require("./useTint"), import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
+
var import_react = __toESM(require("react"), 1), import_tamagui = require("tamagui"), import_useTint = require("./useTint"), import_jsx_runtime = require("react/jsx-runtime");
|
|
29
29
|
const rgb = ["#ED0F0F", "#6BCF1A", "#6252F8"], LogoWords = import_react.default.memo(({ downscale = 1, animated, ...props }) => {
|
|
30
30
|
const Tint = (0, import_useTint.useTint)(), [hovered, setHovered] = import_react.default.useState(!1), [mounted, setMounted] = import_react.default.useState("start"), { tintIndex: index, tint } = Tint, hoveredTints = Tint.tints.map((x2) => `${x2}9`).map((t) => `var(--${t})`), tints = [
|
|
31
31
|
"var(--accent1)",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/LogoWords.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB,8BAElB,iBAA+B,oBAE/B,iBAAwB,sBAsEhB;AApER,MAAM,MAAM,CAAC,WAAW,WAAW,SAAS,GAE/B,YAST,aAAAA,QAAM,KAAK,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,MAAM;AACxD,QAAM,WAAO,wBAAQ,GACf,CAAC,SAAS,UAAU,IAAI,aAAAA,QAAM,SAAS,EAAK,GAC5C,CAAC,SAAS,UAAU,IAAI,aAAAA,QAAM,SAAuC,OAAO,GAE5E,EAAE,WAAW,OAAO,KAAK,IAAI,MAC7B,eAAe,KAAK,MAAM,IAAI,CAACC,OAAM,GAAGA,EAAC,GAAG,EAAE,IAAI,CAAC,MAAM,SAAS,CAAC,GAAG,GAEtE,QAAQ;AAAA,IACZ;AAAA,IAC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AAA,cACzC;AAAA;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF;AAEJ,CAAC;",
|
|
5
5
|
"names": ["React", "x"]
|
|
6
6
|
}
|
|
@@ -26,7 +26,7 @@ __export(LogoWords_exports, {
|
|
|
26
26
|
LogoWords: () => LogoWords
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(LogoWords_exports);
|
|
29
|
-
var import_jsx_runtime = require("react/jsx-runtime"), import_react = __toESM(require("react")), import_tamagui = require("tamagui"), import_useTint = require("./useTint"), rgb = [
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_react = __toESM(require("react"), 1), import_tamagui = require("tamagui"), import_useTint = require("./useTint"), rgb = [
|
|
30
30
|
"#ED0F0F",
|
|
31
31
|
"#6BCF1A",
|
|
32
32
|
"#6252F8"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/packages/logo/src/LogoWords.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,eAAkB,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,eAAkB,8BAElB,iBAA+B,oBAE/B,iBAAwB,sBAElBA,MAAM;EAAC;EAAW;EAAW;GAEtBC,YASTC,6BAAAA,QAAMC,KAAK,SAAA,OAAA;MAAC,EAAEC,YAAY,GAAGC,UAAU,GAAGC,MAAAA,IAAO,OAC7CC,WAAOC,wBAAAA,GACP,CAACC,SAASC,UAAAA,IAAcR,aAAAA,QAAMS,SAAS,EAAA,GACvC,CAACC,SAASC,UAAAA,IAAcX,aAAAA,QAAMS,SAAuC,OAAA,GAErE,EAAEG,WAAWC,OAAOC,KAAI,IAAKT,MAC7BU,eAAeV,KAAKW,MAAMC,IAAI,SAACC,IAAAA;WAAM,GAAGA,EAAAA;KAAMD,IAAI,SAACE,GAAAA;WAAM,SAASA,C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7B,SAAS,CAAA;YACf8B,QAAO;YACPC,cAAc,WAAA;qBAAMpD,KAAKqD,aAAa,CAAA;;;UAGxC,uCAAAjB,KAACkB,QAAAA;YACCL,gBAAe;YACfC,MAAM7B,SAAS,CAAA;YACfkC,GAAE;YACFC,UAAS;YACTJ,cAAc,WAAA;qBAAMpD,KAAKqD,aAAa,CAAA;;;UAGxC,uCAAAjB,KAACY,WAAAA;YACChB,0BAAsB;YACtBiB,gBAAe;YACfC,MAAM7B,SAAS,CAAA;YACf8B,QAAO;YACPC,cAAc,WAAA;qBAAMpD,KAAKqD,aAAa,CAAA;;;UAGxC,uCAAAjB,KAACkB,QAAAA;YACCJ,MAAM7B,SAAS,CAAA;YACfkC,GAAE;YACFC,UAAS;YACTJ,cAAc,WAAA;qBAAMpD,KAAKqD,aAAa,CAAA;;;UAGxC,uCAAAjB,KAACY,WAAAA;YACChB,0BAAsB;YACtBiB,gBAAe;YACfC,MAAM7B,SAAS,CAAA;YACf8B,QAAO;YACPC,cAAc,WAAA;qBAAMpD,KAAKqD,aAAa,CAAA;;;UAGxC,uCAAAjB,KAACY,WAAAA;YACChB,0BAAsB;YACtBiB,gBAAe;YACfC,MAAM7B,SAAS,CAAA;YACf8B,QAAO;YACPC,cAAc,WAAA;qBAAMpD,KAAKqD,aAAa,CAAA;;;UAGxC,uCAAAjB,KAACY,WAAAA;YACChB,0BAAsB;YACtBiB,gBAAe;YACfC,MAAM7B,SAAS,CAAA;YACf8B,QAAO;YACPC,cAAc,WAAA;qBAAMpD,KAAKqD,aAAa,CAAA;;;;;;;AAKhD,CAAA;",
|
|
5
5
|
"names": ["rgb", "LogoWords", "React", "memo", "downscale", "animated", "props", "Tint", "useTint", "hovered", "setHovered", "useState", "mounted", "setMounted", "tintIndex", "index", "tint", "hoveredTints", "tints", "map", "x", "t", "circleTints", "useEffect", "idle", "window", "requestIdleCallback", "setTimeout", "getColor", "i", "isActive", "Math", "round", "length", "_jsxs", "XStack", "onHoverIn", "onHoverOut", "paddingVertical", "data-tauri-drag-region", "marginVertical", "position", "className", "_jsx", "Circle", "animation", "top", "left", "y", "size", "backgroundColor", "svg", "width", "height", "viewBox", "polygon", "shapeRendering", "fill", "points", "onMouseEnter", "setTintIndex", "path", "d", "fillRule"]
|
|
6
6
|
}
|
package/dist/cjs/tints.cjs
CHANGED
|
@@ -38,7 +38,7 @@ __export(tints_exports, {
|
|
|
38
38
|
useTints: () => useTints
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(tints_exports);
|
|
41
|
-
var import_react = __toESM(require("react"));
|
|
41
|
+
var import_react = __toESM(require("react"), 1);
|
|
42
42
|
const listeners = /* @__PURE__ */new Set(),
|
|
43
43
|
familiesValues = {
|
|
44
44
|
tamagui: ["orange", "yellow", "pink", "gray", "red", "green", "blue"],
|
package/dist/cjs/tints.js
CHANGED
|
@@ -29,7 +29,7 @@ __export(tints_exports, {
|
|
|
29
29
|
useTints: () => useTints
|
|
30
30
|
});
|
|
31
31
|
module.exports = __toCommonJS(tints_exports);
|
|
32
|
-
var import_react = __toESM(require("react"));
|
|
32
|
+
var import_react = __toESM(require("react"), 1);
|
|
33
33
|
const listeners = /* @__PURE__ */ new Set(), familiesValues = {
|
|
34
34
|
tamagui: ["orange", "yellow", "pink", "gray", "red", "green", "blue"],
|
|
35
35
|
xmas: ["red", "green", "red", "green", "red", "green", "red"],
|
package/dist/cjs/tints.native.js
CHANGED
|
@@ -30,7 +30,7 @@ __export(tints_exports, {
|
|
|
30
30
|
useTints: () => useTints
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(tints_exports);
|
|
33
|
-
var import_react = __toESM(require("react")), listeners = /* @__PURE__ */ new Set(), familiesValues = {
|
|
33
|
+
var import_react = __toESM(require("react"), 1), listeners = /* @__PURE__ */ new Set(), familiesValues = {
|
|
34
34
|
tamagui: [
|
|
35
35
|
"orange",
|
|
36
36
|
"yellow",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version":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C,GAAAA;aAAMA,EAAEF,IAAAA;;EAC7B,CAAA;AACF;AAEO,IAAMG,oBAAoB,WAAA;AAC/BJ,gBAAchB,eAAeA,cAAcqB,QAAQjB,GAAAA,IAAO,KAAKJ,cAAcsB,MAAM,CAAC;AACtF,GAEaR,qBAAqB,SAACS,IAAAA;AACjCjC,mBAAUkC,IAAID,EAAAA,GACP,WAAA;AACLjC,cAAUmC,OAAOF,EAAAA;EACnB;AACF;",
|
|
5
5
|
"names": ["listeners", "Set", "familiesValues", "tamagui", "xmas", "easter", "halloween", "valentine", "lunar", "DEFAULT_FAMILY", "familiesNames", "Object", "keys", "families", "fam", "getTints", "name", "tints", "useTints", "val", "setVal", "React", "useState", "useEffect", "onTintFamilyChange", "startTransition", "setTintFamily", "next", "forEach", "l", "setNextTintFamily", "indexOf", "length", "cb", "add", "delete"]
|
|
6
6
|
}
|
package/dist/cjs/useTint.cjs
CHANGED
|
@@ -33,18 +33,18 @@ var useTint_exports = {};
|
|
|
33
33
|
__export(useTint_exports, {
|
|
34
34
|
ThemeTint: () => ThemeTint,
|
|
35
35
|
ThemeTintAlt: () => ThemeTintAlt,
|
|
36
|
-
|
|
36
|
+
getDocsSection: () => getDocsSection,
|
|
37
37
|
onTintChange: () => onTintChange,
|
|
38
38
|
setTintIndex: () => setTintIndex,
|
|
39
39
|
useTint: () => useTint
|
|
40
40
|
});
|
|
41
41
|
module.exports = __toCommonJS(useTint_exports);
|
|
42
|
-
var import_react = __toESM(require("react")),
|
|
42
|
+
var import_react = __toESM(require("react"), 1),
|
|
43
43
|
import_tamagui = require("tamagui"),
|
|
44
44
|
import_tints = require("./tints.cjs"),
|
|
45
|
+
import_one = require("one"),
|
|
45
46
|
import_jsx_runtime = require("react/jsx-runtime");
|
|
46
|
-
|
|
47
|
-
let current = initialTint;
|
|
47
|
+
let current = 3;
|
|
48
48
|
const listeners = /* @__PURE__ */new Set(),
|
|
49
49
|
onTintChange = listener => (listeners.add(listener), () => {
|
|
50
50
|
listeners.delete(listener);
|
|
@@ -53,9 +53,17 @@ const listeners = /* @__PURE__ */new Set(),
|
|
|
53
53
|
setTintIndex = next => {
|
|
54
54
|
const val = next % numTints;
|
|
55
55
|
val !== current && (current = val, listeners.forEach(x => x(val)));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
};
|
|
57
|
+
function getDocsSection(pathname) {
|
|
58
|
+
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;
|
|
59
|
+
}
|
|
60
|
+
const useTint = (altOffset = -1) => {
|
|
61
|
+
const pathname = (0, import_one.usePathname)(),
|
|
62
|
+
section = getDocsSection(pathname),
|
|
63
|
+
hydrated = (0, import_tamagui.useDidFinishSSR)();
|
|
64
|
+
let initial = current;
|
|
65
|
+
section && (initial = section === "compile" ? 5 : section === "core" ? 4 : 6, hydrated || (current = initial));
|
|
66
|
+
const index = import_react.default.useSyncExternalStore(onTintChange, () => current, () => initial),
|
|
59
67
|
tintsContext = (0, import_tints.useTints)(),
|
|
60
68
|
{
|
|
61
69
|
tints
|
package/dist/cjs/useTint.js
CHANGED
|
@@ -24,25 +24,31 @@ var useTint_exports = {};
|
|
|
24
24
|
__export(useTint_exports, {
|
|
25
25
|
ThemeTint: () => ThemeTint,
|
|
26
26
|
ThemeTintAlt: () => ThemeTintAlt,
|
|
27
|
-
|
|
27
|
+
getDocsSection: () => getDocsSection,
|
|
28
28
|
onTintChange: () => onTintChange,
|
|
29
29
|
setTintIndex: () => setTintIndex,
|
|
30
30
|
useTint: () => useTint
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(useTint_exports);
|
|
33
|
-
var import_react = __toESM(require("react")), import_tamagui = require("tamagui"), import_tints = require("./tints"), import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
-
|
|
35
|
-
let current = initialTint;
|
|
33
|
+
var import_react = __toESM(require("react"), 1), import_tamagui = require("tamagui"), import_tints = require("./tints"), import_one = require("one"), import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
let current = 3;
|
|
36
35
|
const listeners = /* @__PURE__ */ new Set(), onTintChange = (listener) => (listeners.add(listener), () => {
|
|
37
36
|
listeners.delete(listener);
|
|
38
37
|
}), numTints = (0, import_tints.getTints)().tints.length, setTintIndex = (next) => {
|
|
39
38
|
const val = next % numTints;
|
|
40
39
|
val !== current && (current = val, listeners.forEach((x) => x(val)));
|
|
41
|
-
}
|
|
40
|
+
};
|
|
41
|
+
function getDocsSection(pathname) {
|
|
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
|
+
}
|
|
44
|
+
const useTint = (altOffset = -1) => {
|
|
45
|
+
const pathname = (0, import_one.usePathname)(), section = getDocsSection(pathname), hydrated = (0, import_tamagui.useDidFinishSSR)();
|
|
46
|
+
let initial = current;
|
|
47
|
+
section && (initial = section === "compile" ? 5 : section === "core" ? 4 : 6, hydrated || (current = initial));
|
|
42
48
|
const index = import_react.default.useSyncExternalStore(
|
|
43
49
|
onTintChange,
|
|
44
50
|
() => current,
|
|
45
|
-
() =>
|
|
51
|
+
() => initial
|
|
46
52
|
), tintsContext = (0, import_tints.useTints)(), { tints } = tintsContext, tintAltIndex = Math.abs((index + altOffset) % tints.length);
|
|
47
53
|
return {
|
|
48
54
|
...tintsContext,
|
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": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB,
|
|
4
|
+
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Aa,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
|
}
|
|
@@ -25,13 +25,13 @@ var useTint_exports = {};
|
|
|
25
25
|
__export(useTint_exports, {
|
|
26
26
|
ThemeTint: () => ThemeTint,
|
|
27
27
|
ThemeTintAlt: () => ThemeTintAlt,
|
|
28
|
-
|
|
28
|
+
getDocsSection: () => getDocsSection,
|
|
29
29
|
onTintChange: () => onTintChange,
|
|
30
30
|
setTintIndex: () => setTintIndex,
|
|
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")), import_tamagui = require("tamagui"), import_tints = require("./tints"),
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_react = __toESM(require("react"), 1), import_tamagui = require("tamagui"), import_tints = require("./tints"), import_one = require("one"), current = 3, listeners = /* @__PURE__ */ new Set(), onTintChange = function(listener) {
|
|
35
35
|
return listeners.add(listener), function() {
|
|
36
36
|
listeners.delete(listener);
|
|
37
37
|
};
|
|
@@ -40,11 +40,17 @@ var import_jsx_runtime = require("react/jsx-runtime"), import_react = __toESM(re
|
|
|
40
40
|
val !== current && (current = val, listeners.forEach(function(x) {
|
|
41
41
|
return x(val);
|
|
42
42
|
}));
|
|
43
|
-
}
|
|
44
|
-
|
|
43
|
+
};
|
|
44
|
+
function getDocsSection(pathname) {
|
|
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
|
+
}
|
|
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), hydrated = (0, import_tamagui.useDidFinishSSR)(), initial = current;
|
|
49
|
+
section && (initial = section === "compile" ? 5 : section === "core" ? 4 : 6, hydrated || (current = initial));
|
|
50
|
+
var index = import_react.default.useSyncExternalStore(onTintChange, function() {
|
|
45
51
|
return current;
|
|
46
52
|
}, function() {
|
|
47
|
-
return
|
|
53
|
+
return initial;
|
|
48
54
|
}), tintsContext = (0, import_tints.useTints)(), { tints } = tintsContext, tintAltIndex = Math.abs((index + altOffset) % tints.length);
|
|
49
55
|
return {
|
|
50
56
|
...tintsContext,
|
|
@@ -80,7 +86,7 @@ var import_jsx_runtime = require("react/jsx-runtime"), import_react = __toESM(re
|
|
|
80
86
|
0 && (module.exports = {
|
|
81
87
|
ThemeTint,
|
|
82
88
|
ThemeTintAlt,
|
|
83
|
-
|
|
89
|
+
getDocsSection,
|
|
84
90
|
onTintChange,
|
|
85
91
|
setTintIndex,
|
|
86
92
|
useTint
|
|
@@ -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,
|
|
5
|
-
"names": ["
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,eAAk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Q,CAAA;MACvB,CAAA;IACF;EACF;AACF,GAEac,YAAY,SAAA,OAAA;MAAC,EACxBC,SACAC,UACA,GAAGC,KAAAA,IACgC,OAC7BC,UAAUzB,QAAAA,EAAUgB;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,UAAUzB,QAAQ8B,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", "hydrated", "useDidFinishSSR", "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,19 +1,26 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Theme } from "tamagui";
|
|
2
|
+
import { Theme, useDidFinishSSR } from "tamagui";
|
|
3
3
|
import { getTints, setNextTintFamily, useTints } from "./tints";
|
|
4
|
+
import { usePathname } from "one";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
let current = initialTint;
|
|
6
|
+
let current = 3;
|
|
7
7
|
const listeners = /* @__PURE__ */ new Set(), onTintChange = (listener) => (listeners.add(listener), () => {
|
|
8
8
|
listeners.delete(listener);
|
|
9
9
|
}), numTints = getTints().tints.length, setTintIndex = (next) => {
|
|
10
10
|
const val = next % numTints;
|
|
11
11
|
val !== current && (current = val, listeners.forEach((x) => x(val)));
|
|
12
|
-
}
|
|
12
|
+
};
|
|
13
|
+
function getDocsSection(pathname) {
|
|
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
|
+
}
|
|
16
|
+
const useTint = (altOffset = -1) => {
|
|
17
|
+
const pathname = usePathname(), section = getDocsSection(pathname), hydrated = useDidFinishSSR();
|
|
18
|
+
let initial = current;
|
|
19
|
+
section && (initial = section === "compile" ? 5 : section === "core" ? 4 : 6, hydrated || (current = initial));
|
|
13
20
|
const index = React.useSyncExternalStore(
|
|
14
21
|
onTintChange,
|
|
15
22
|
() => current,
|
|
16
|
-
() =>
|
|
23
|
+
() => initial
|
|
17
24
|
), tintsContext = useTints(), { tints } = tintsContext, tintAltIndex = Math.abs((index + altOffset) % tints.length);
|
|
18
25
|
return {
|
|
19
26
|
...tintsContext,
|
|
@@ -49,7 +56,7 @@ const listeners = /* @__PURE__ */ new Set(), onTintChange = (listener) => (liste
|
|
|
49
56
|
export {
|
|
50
57
|
ThemeTint,
|
|
51
58
|
ThemeTintAlt,
|
|
52
|
-
|
|
59
|
+
getDocsSection,
|
|
53
60
|
onTintChange,
|
|
54
61
|
setTintIndex,
|
|
55
62
|
useTint
|
package/dist/esm/useTint.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useTint.tsx"],
|
|
4
|
-
"mappings": "AAAA,OAAO,WAAW;AAGlB,SAAS,
|
|
4
|
+
"mappings": "AAAA,OAAO,WAAW;AAGlB,SAAS,OAAO,uBAAuB;AACvC,SAAS,UAAU,mBAAmB,gBAAgB;AACtD,SAAS,mBAAmB;AAwGxB;AAnGJ,IAAI,U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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,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Theme } from "tamagui";
|
|
2
|
+
import { Theme, useDidFinishSSR } from "tamagui";
|
|
3
3
|
import { getTints, setNextTintFamily, useTints } from "./tints.mjs";
|
|
4
|
+
import { usePathname } from "one";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
let current = initialTint;
|
|
6
|
+
let current = 3;
|
|
7
7
|
const listeners = /* @__PURE__ */new Set(),
|
|
8
8
|
onTintChange = listener => (listeners.add(listener), () => {
|
|
9
9
|
listeners.delete(listener);
|
|
@@ -12,9 +12,17 @@ const listeners = /* @__PURE__ */new Set(),
|
|
|
12
12
|
setTintIndex = next => {
|
|
13
13
|
const val = next % numTints;
|
|
14
14
|
val !== current && (current = val, listeners.forEach(x => x(val)));
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
};
|
|
16
|
+
function getDocsSection(pathname) {
|
|
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
|
+
}
|
|
19
|
+
const useTint = (altOffset = -1) => {
|
|
20
|
+
const pathname = usePathname(),
|
|
21
|
+
section = getDocsSection(pathname),
|
|
22
|
+
hydrated = useDidFinishSSR();
|
|
23
|
+
let initial = current;
|
|
24
|
+
section && (initial = section === "compile" ? 5 : section === "core" ? 4 : 6, hydrated || (current = initial));
|
|
25
|
+
const index = React.useSyncExternalStore(onTintChange, () => current, () => initial),
|
|
18
26
|
tintsContext = useTints(),
|
|
19
27
|
{
|
|
20
28
|
tints
|
|
@@ -61,5 +69,5 @@ const listeners = /* @__PURE__ */new Set(),
|
|
|
61
69
|
children
|
|
62
70
|
});
|
|
63
71
|
};
|
|
64
|
-
export { ThemeTint, ThemeTintAlt,
|
|
72
|
+
export { ThemeTint, ThemeTintAlt, getDocsSection, onTintChange, setTintIndex, useTint };
|
|
65
73
|
//# sourceMappingURL=useTint.mjs.map
|
package/dist/esm/useTint.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Theme","getTints","setNextTintFamily","useTints","
|
|
1
|
+
{"version":3,"names":["React","Theme","useDidFinishSSR","getTints","setNextTintFamily","useTints","usePathname","jsx","current","listeners","Set","onTintChange","listener","add","delete","numTints","tints","length","setTintIndex","next","val","forEach","x","getDocsSection","pathname","startsWith","useTint","altOffset","section","hydrated","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,OAAOA,KAAA,MAAW;AAGlB,SAASC,KAAA,EAAOC,eAAA,QAAuB;AACvC,SAASC,QAAA,EAAUC,iBAAA,EAAmBC,QAAA,QAAgB;AACtD,SAASC,WAAA,QAAmB;AAwGxB,SAAAC,GAAA;AAnGJ,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,GAAWZ,QAAA,CAAS,EAAEa,KAAA,CAAMC,M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,WAAA,EAAaA,CAAA,KAAM;QACjBxC,KAAA,CAAMyC,eAAA,CAAgB,MAAM;UAC1BvB,YAAA,CAAaa,KAAA,GAAQ,CAAC;QACxB,CAAC;MACH;IACF;EACF;EAEaW,SAAA,GAAYA,CAAC;IACxBC,OAAA;IACAC,QAAA;IACA,GAAGC;EACL,MAAuD;IACrD,MAAMC,OAAA,GAAUpB,OAAA,CAAQ,EAAEY,IAAA;IAC1B,OACE,eAAA/B,GAAA,CAACN,KAAA;MAAO,GAAG4C,IAAA;MAAME,IAAA,EAAMJ,OAAA,GAAU,OAAOG,OAAA;MACrCF;IAAA,CACH;EAEJ;EAEaI,YAAA,GAAeA,CAAC;IAC3BJ,QAAA;IACAD,OAAA;IACAM,MAAA,GAAS;IACT,GAAGJ;EACL,MAAwE;IACtE,MAAMC,OAAA,GAAUpB,OAAA,CAAQuB,MAAM,EAAEV,OAAA;IAEhC,OACE,eAAAhC,GAAA,CAACN,KAAA;MAAM8C,IAAA,EAFIJ,OAAA,GAAU,OAAOG,OAAA;MAER,GAAGD,IAAA;MACpBD;IAAA,CACH;EAEJ","ignoreList":[]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { Theme } from "tamagui";
|
|
3
|
+
import { Theme, useDidFinishSSR } from "tamagui";
|
|
4
4
|
import { getTints, setNextTintFamily, useTints } from "./tints";
|
|
5
|
-
|
|
5
|
+
import { usePathname } from "one";
|
|
6
|
+
var current = 3, listeners = /* @__PURE__ */ new Set(), onTintChange = function(listener) {
|
|
6
7
|
return listeners.add(listener), function() {
|
|
7
8
|
listeners.delete(listener);
|
|
8
9
|
};
|
|
@@ -11,11 +12,17 @@ var initialTint = 3, current = initialTint, listeners = /* @__PURE__ */ new Set(
|
|
|
11
12
|
val !== current && (current = val, listeners.forEach(function(x) {
|
|
12
13
|
return x(val);
|
|
13
14
|
}));
|
|
14
|
-
}
|
|
15
|
-
|
|
15
|
+
};
|
|
16
|
+
function getDocsSection(pathname) {
|
|
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
|
+
}
|
|
19
|
+
var useTint = function() {
|
|
20
|
+
var altOffset = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1, pathname = usePathname(), section = getDocsSection(pathname), hydrated = useDidFinishSSR(), initial = current;
|
|
21
|
+
section && (initial = section === "compile" ? 5 : section === "core" ? 4 : 6, hydrated || (current = initial));
|
|
22
|
+
var index = React.useSyncExternalStore(onTintChange, function() {
|
|
16
23
|
return current;
|
|
17
24
|
}, function() {
|
|
18
|
-
return
|
|
25
|
+
return initial;
|
|
19
26
|
}), tintsContext = useTints(), { tints } = tintsContext, tintAltIndex = Math.abs((index + altOffset) % tints.length);
|
|
20
27
|
return {
|
|
21
28
|
...tintsContext,
|
|
@@ -50,7 +57,7 @@ var initialTint = 3, current = initialTint, listeners = /* @__PURE__ */ new Set(
|
|
|
50
57
|
export {
|
|
51
58
|
ThemeTint,
|
|
52
59
|
ThemeTintAlt,
|
|
53
|
-
|
|
60
|
+
getDocsSection,
|
|
54
61
|
onTintChange,
|
|
55
62
|
setTintIndex,
|
|
56
63
|
useTint
|
|
@@ -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,OAAOA,WAAW;AAGlB,SAASC,
|
|
5
|
-
"names": ["React", "Theme", "getTints", "setNextTintFamily", "useTints", "
|
|
4
|
+
"mappings": ";AAAA,OAAOA,WAAW;AAGlB,SAASC,OAAOC,uBAAuB;AACvC,SAASC,UAAUC,mBAAmBC,gBAAgB;AACtD,SAASC,mBAAmB;AAK5B,IAAIC,UAAU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EACxBC,SACAC,UACA,GAAGC,KAAAA,IACgC,OAC7BC,UAAUpB,QAAAA,EAAUY;AAC1B,SACE,qBAACpC,OAAAA;IAAO,GAAG2C;IAAME,MAAMJ,UAAU,OAAOG;;;AAI5C,GAEaE,eAAe,SAAA,OAAA;MAAC,EAC3BJ,UACAD,SACAM,SAAS,GACT,GAAGJ,KAAAA,IACiD,OAC9CC,UAAUpB,QAAQuB,MAAAA,EAAQV,SAC1BQ,OAAOJ,UAAU,OAAOG;AAC9B,SACE,qBAAC5C,OAAAA;IAAM6C;IAAa,GAAGF;;;AAI3B;",
|
|
5
|
+
"names": ["React", "Theme", "useDidFinishSSR", "getTints", "setNextTintFamily", "useTints", "usePathname", "current", "listeners", "Set", "onTintChange", "listener", "add", "delete", "numTints", "tints", "length", "setTintIndex", "next", "val", "forEach", "x", "getDocsSection", "pathname", "startsWith", "useTint", "altOffset", "section", "hydrated", "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,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/logo",
|
|
3
|
-
"version": "1.123.
|
|
3
|
+
"version": "1.123.4",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"source": "src/index.tsx",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
7
8
|
"main": "dist/cjs",
|
|
8
9
|
"module": "dist/esm",
|
|
9
10
|
"files": [
|
|
@@ -11,6 +12,29 @@
|
|
|
11
12
|
"types",
|
|
12
13
|
"dist"
|
|
13
14
|
],
|
|
15
|
+
"exports": {
|
|
16
|
+
"./package.json": "./package.json",
|
|
17
|
+
".": {
|
|
18
|
+
"react-native": {
|
|
19
|
+
"import": "./dist/esm/index.native.js",
|
|
20
|
+
"require": "./dist/cjs/index.native.js"
|
|
21
|
+
},
|
|
22
|
+
"types": "./types/index.d.ts",
|
|
23
|
+
"import": "./dist/esm/index.mjs",
|
|
24
|
+
"require": "./dist/cjs/index.cjs",
|
|
25
|
+
"default": "./dist/cjs/index.native.js"
|
|
26
|
+
},
|
|
27
|
+
"./icon": {
|
|
28
|
+
"react-native": {
|
|
29
|
+
"import": "./dist/esm/LogoIcon.native.js",
|
|
30
|
+
"require": "./dist/cjs/LogoIcon.native.js"
|
|
31
|
+
},
|
|
32
|
+
"types": "./types/LogoIcon.d.ts",
|
|
33
|
+
"import": "./dist/esm/LogoIcon.mjs",
|
|
34
|
+
"require": "./dist/cjs/LogoIcon.cjs",
|
|
35
|
+
"default": "./dist/cjs/LogoIcon.native.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
14
38
|
"scripts": {
|
|
15
39
|
"build": "tamagui-build",
|
|
16
40
|
"watch": "tamagui-build --watch",
|
|
@@ -20,10 +44,11 @@
|
|
|
20
44
|
"clean:build": "tamagui-build clean:build"
|
|
21
45
|
},
|
|
22
46
|
"dependencies": {
|
|
23
|
-
"
|
|
47
|
+
"one": "1.1.412",
|
|
48
|
+
"tamagui": "1.123.4"
|
|
24
49
|
},
|
|
25
50
|
"devDependencies": {
|
|
26
|
-
"@tamagui/build": "1.123.
|
|
51
|
+
"@tamagui/build": "1.123.4",
|
|
27
52
|
"react": "*"
|
|
28
53
|
},
|
|
29
54
|
"peerDependencies": {
|
|
@@ -32,4 +57,4 @@
|
|
|
32
57
|
"publishConfig": {
|
|
33
58
|
"access": "public"
|
|
34
59
|
}
|
|
35
|
-
}
|
|
60
|
+
}
|
package/src/useTint.tsx
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import type { JSX } from 'react/jsx-runtime'
|
|
3
3
|
import type { ThemeName, ThemeProps } from 'tamagui'
|
|
4
|
-
import { Theme } from 'tamagui'
|
|
4
|
+
import { Theme, useDidFinishSSR } from 'tamagui'
|
|
5
5
|
import { getTints, setNextTintFamily, useTints } from './tints'
|
|
6
|
+
import { usePathname } from 'one'
|
|
6
7
|
|
|
7
8
|
// no localstorage because its not important to remember and causes a flicker
|
|
8
9
|
// const tintVal = typeof localStorage !== 'undefined' ? localStorage.getItem('tint') : 0
|
|
9
10
|
// const tint = tintVal ? +tintVal 0
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
let current = initialTint
|
|
11
|
+
let current = 3
|
|
13
12
|
|
|
14
13
|
const listeners = new Set<Function>()
|
|
15
14
|
|
|
@@ -29,6 +28,18 @@ export const setTintIndex = (next: number): void => {
|
|
|
29
28
|
listeners.forEach((x) => x(val))
|
|
30
29
|
}
|
|
31
30
|
|
|
31
|
+
export function getDocsSection(pathname: string): 'compile' | 'ui' | 'core' | null {
|
|
32
|
+
return pathname === '/docs/intro/compiler-install' ||
|
|
33
|
+
pathname === '/docs/intro/benchmarks' ||
|
|
34
|
+
pathname === '/docs/intro/why-a-compiler'
|
|
35
|
+
? 'compile'
|
|
36
|
+
: pathname.startsWith('/ui/')
|
|
37
|
+
? 'ui'
|
|
38
|
+
: pathname.startsWith('/docs/')
|
|
39
|
+
? 'core'
|
|
40
|
+
: null
|
|
41
|
+
}
|
|
42
|
+
|
|
32
43
|
export const useTint = (
|
|
33
44
|
altOffset = -1
|
|
34
45
|
): {
|
|
@@ -50,10 +61,23 @@ export const useTint = (
|
|
|
50
61
|
lunar: string[]
|
|
51
62
|
}
|
|
52
63
|
} => {
|
|
64
|
+
const pathname = usePathname()
|
|
65
|
+
const section = getDocsSection(pathname)
|
|
66
|
+
|
|
67
|
+
const hydrated = useDidFinishSSR()
|
|
68
|
+
|
|
69
|
+
let initial = current
|
|
70
|
+
if (section) {
|
|
71
|
+
initial = section === 'compile' ? 5 : section === 'core' ? 4 : 6
|
|
72
|
+
if (!hydrated) {
|
|
73
|
+
current = initial
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
53
77
|
const index = React.useSyncExternalStore(
|
|
54
78
|
onTintChange,
|
|
55
79
|
() => current,
|
|
56
|
-
() =>
|
|
80
|
+
() => initial
|
|
57
81
|
)
|
|
58
82
|
const tintsContext = useTints()
|
|
59
83
|
const { tints } = tintsContext
|
package/types/useTint.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { JSX } from "react/jsx-runtime";
|
|
2
2
|
import type { ThemeName, ThemeProps } from "tamagui";
|
|
3
|
-
export declare const initialTint = 3;
|
|
4
3
|
export declare const onTintChange: (listener: (cur: number) => void) => () => void;
|
|
5
4
|
export declare const setTintIndex: (next: number) => void;
|
|
5
|
+
export declare function getDocsSection(pathname: string): "compile" | "ui" | "core" | null;
|
|
6
6
|
export declare const useTint: (altOffset?: number) => {
|
|
7
7
|
tints: ThemeName[];
|
|
8
8
|
tintIndex: number;
|
package/types/useTint.d.ts.map
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mappings": "AACA,cAAc,WAAW,mBAAmB;AAC5C,cAAc,WAAW,kBAAkB,SAAS;
|
|
2
|
+
"mappings": "AACA,cAAc,WAAW,mBAAmB;AAC5C,cAAc,WAAW,kBAAkB,SAAS;AAYpD,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;AAwCD,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",
|
|
6
|
-
"next: number"
|
|
6
|
+
"next: number",
|
|
7
|
+
"pathname: string"
|
|
7
8
|
],
|
|
8
9
|
"sources": [
|
|
9
10
|
"src/useTint.tsx"
|
|
10
11
|
],
|
|
11
12
|
"sourcesContent": [
|
|
12
|
-
"import 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\
|
|
13
|
+
"import React from 'react'\nimport type { JSX } from 'react/jsx-runtime'\nimport type { ThemeName, ThemeProps } from 'tamagui'\nimport { Theme, useDidFinishSSR } from 'tamagui'\nimport { getTints, setNextTintFamily, useTints } from './tints'\nimport { usePathname } from 'one'\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 const hydrated = useDidFinishSSR()\n\n let initial = current\n if (section) {\n initial = section === 'compile' ? 5 : section === 'core' ? 4 : 6\n if (!hydrated) {\n current = initial\n }\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"
|
|
13
14
|
],
|
|
14
15
|
"version": 3
|
|
15
16
|
}
|