@tarsis/toolkit 0.4.0 → 0.4.2-beta.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/index.cjs CHANGED
@@ -14,6 +14,7 @@ const react = require('@use-gesture/react');
14
14
  const html2canvas = require('html2canvas');
15
15
  const THREE = require('three');
16
16
  const confetti = require('canvas-confetti');
17
+ const server = require('./server.cjs');
17
18
  const reactFlipToolkit = require('react-flip-toolkit');
18
19
  const tooltip = require('@reach/tooltip');
19
20
  const Bowser = require('bowser');
@@ -669,11 +670,11 @@ const BubblyParticlesButton = () => {
669
670
  );
670
671
  };
671
672
 
672
- const root$4k = "_root_acp94_1";
673
- const button$o = "_button_acp94_13";
674
- const p = "_p_acp94_26";
675
- const text$z = "_text_acp94_26";
676
- const effects = "_effects_acp94_240";
673
+ const root$4k = "_root_ayg4k_1";
674
+ const button$o = "_button_ayg4k_13";
675
+ const p = "_p_ayg4k_26";
676
+ const text$z = "_text_ayg4k_26";
677
+ const effects = "_effects_ayg4k_240";
677
678
  const styles$4H = {
678
679
  root: root$4k,
679
680
  button: button$o,
@@ -1923,148 +1924,6 @@ const styles$4y = {
1923
1924
  content: content$p
1924
1925
  };
1925
1926
 
1926
- const move = (source, start, end) => {
1927
- const item = source[start];
1928
- const result = source.slice(0);
1929
- result.splice(start, 1);
1930
- result.splice(end, 0, item);
1931
- return result;
1932
- };
1933
-
1934
- const times = (fn, size) => Array.from({ length: size }, (_, index) => fn(index));
1935
-
1936
- const logRank = {
1937
- silent: 0,
1938
- error: 1,
1939
- warn: 2,
1940
- info: 3,
1941
- debug: 4
1942
- };
1943
- const getEnvLogLevel = () => {
1944
- if (typeof process === "undefined") return "info";
1945
- const envLevel = process.env.LOG_LEVEL?.toLowerCase();
1946
- return envLevel && Object.prototype.hasOwnProperty.call(logRank, envLevel) ? envLevel : "info";
1947
- };
1948
- let currentLevel = getEnvLogLevel();
1949
- const setLogLevel = (level) => {
1950
- if (Object.prototype.hasOwnProperty.call(logRank, level)) {
1951
- currentLevel = level;
1952
- }
1953
- };
1954
- const getTimestamp = () => {
1955
- const now = /* @__PURE__ */ new Date();
1956
- return now.toTimeString().split(" ")[0] + "." + now.getMilliseconds().toString().padStart(3, "0");
1957
- };
1958
- const shouldLog = (level) => {
1959
- return logRank[level] <= logRank[currentLevel];
1960
- };
1961
- let sessionId = null;
1962
- let requestId = null;
1963
- const setSessionId = (id) => {
1964
- sessionId = id;
1965
- };
1966
- const setRequestId = (id) => {
1967
- requestId = id;
1968
- };
1969
- const clearSession = () => {
1970
- sessionId = null;
1971
- requestId = null;
1972
- };
1973
- const getSessionInfo = () => {
1974
- const parts = [];
1975
- if (sessionId) parts.push(`session:${sessionId}`);
1976
- if (requestId) parts.push(`req:${requestId}`);
1977
- return parts.length > 0 ? `[${parts.join("|")}]` : "";
1978
- };
1979
- class BaseLogger {
1980
- prefix;
1981
- emoji;
1982
- constructor(prefix, emoji) {
1983
- this.prefix = prefix;
1984
- this.emoji = emoji;
1985
- }
1986
- log(level, emoji, msg, fn = console.log, data) {
1987
- if (shouldLog(level)) {
1988
- const sessionInfo = getSessionInfo();
1989
- const logMessage = `[${getTimestamp()}] ${emoji} ${this.prefix ? `[${this.prefix}] ` : ""}${msg}${sessionInfo}`;
1990
- fn(logMessage);
1991
- if (data && shouldLog(level)) {
1992
- console.dir(data, { depth: null });
1993
- }
1994
- }
1995
- }
1996
- info(msg, data) {
1997
- this.log("info", this.emoji, msg, console.log, data);
1998
- }
1999
- debug(msg, data) {
2000
- this.log("debug", this.emoji, msg, console.debug, data);
2001
- }
2002
- success(msg, data) {
2003
- this.log("info", "✅", msg, console.log, data);
2004
- }
2005
- warn(msg, data) {
2006
- this.log("warn", "⚠️", msg, console.warn, data);
2007
- }
2008
- error(msg, detail) {
2009
- this.log("error", "❌", msg, console.error, detail);
2010
- }
2011
- scope(msg, data) {
2012
- this.log("debug", "🔹", msg, console.debug, data);
2013
- }
2014
- dir(data) {
2015
- if (shouldLog("debug")) {
2016
- this.log("debug", "📦", "Object:", console.debug);
2017
- console.dir(data, { depth: null });
2018
- }
2019
- }
2020
- time(label) {
2021
- const start = performance.now();
2022
- return {
2023
- end: (data) => {
2024
- const duration = performance.now() - start;
2025
- this.info(`${label} completed in ${duration.toFixed(2)}ms`, data);
2026
- }
2027
- };
2028
- }
2029
- }
2030
- const logger = new BaseLogger("", "ℹ️");
2031
- const componentLogger = new BaseLogger("Component", "🧩");
2032
- const hookLogger = new BaseLogger("Hook", "🪝");
2033
- const animationLogger = new BaseLogger("Animation", "🎬");
2034
- const eventLogger = new BaseLogger("Event", "⚡");
2035
- const apiLogger = new BaseLogger("API", "🌐");
2036
- const storageLogger = new BaseLogger("Storage", "💾");
2037
- const utilsLogger = new BaseLogger("Utils", "🔧");
2038
- const getCurrentLogLevel = () => currentLevel;
2039
- const isDebugEnabled = () => shouldLog("debug");
2040
-
2041
- const noop = (..._args) => {
2042
- };
2043
-
2044
- const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
2045
-
2046
- const is = (type) => (x) => Object(x) instanceof type;
2047
-
2048
- const isNonNullable = (value) => value !== void 0 && value !== null;
2049
-
2050
- const notReachable = (arg) => {
2051
- throw new Error(`"${arg}" should never be reached`);
2052
- };
2053
-
2054
- const keys = (value) => {
2055
- const primitiveKeys = Object.keys(
2056
- value
2057
- );
2058
- const symbolKeys = Object.getOwnPropertySymbols(value).filter(
2059
- (sym) => Object.getOwnPropertyDescriptor(value, sym)?.enumerable
2060
- );
2061
- return [...primitiveKeys, ...symbolKeys];
2062
- };
2063
-
2064
- const values = (input) => {
2065
- return keys(input).map((key) => input[key]);
2066
- };
2067
-
2068
1927
  const chain = (...elements) => {
2069
1928
  return elements.map((element, index) => /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
2070
1929
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: element }),
@@ -2074,7 +1933,7 @@ const chain = (...elements) => {
2074
1933
 
2075
1934
  const DDDButton = ({
2076
1935
  children,
2077
- onClick = noop,
1936
+ onClick = server.noop,
2078
1937
  className = ""
2079
1938
  }) => /* @__PURE__ */ jsxRuntime.jsx(
2080
1939
  "button",
@@ -3822,7 +3681,7 @@ const HeartFoldButton = () => {
3822
3681
  };
3823
3682
 
3824
3683
  const root$3Y = "_root_fusir_1";
3825
- const process$1 = "_process_fusir_29";
3684
+ const process = "_process_fusir_29";
3826
3685
  const success$3 = "_success_fusir_34";
3827
3686
  const progress$1 = "_progress_fusir_63";
3828
3687
  const tick$1 = "_tick_fusir_107";
@@ -3830,7 +3689,7 @@ const icons = "_icons_fusir_67";
3830
3689
  const states = "_states_fusir_123";
3831
3690
  const styles$4g = {
3832
3691
  root: root$3Y,
3833
- process: process$1,
3692
+ process: process,
3834
3693
  success: success$3,
3835
3694
  progress: progress$1,
3836
3695
  tick: tick$1,
@@ -4630,9 +4489,9 @@ const NeonButton = ({ className = "", ...rest }) => {
4630
4489
  return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", ...rest, className: cn(styles$49.root, className), children: "Neon" });
4631
4490
  };
4632
4491
 
4633
- const root$3R = "_root_1178p_2";
4634
- const i$1 = "_i_1178p_22";
4635
- const text$s = "_text_1178p_482";
4492
+ const root$3R = "_root_1w6mm_2";
4493
+ const i$1 = "_i_1w6mm_22";
4494
+ const text$s = "_text_1w6mm_482";
4636
4495
  const styles$48 = {
4637
4496
  root: root$3R,
4638
4497
  i: i$1,
@@ -5131,7 +4990,7 @@ const styles$41 = {
5131
4990
  const ProgressButton = ({
5132
4991
  children,
5133
4992
  className = "",
5134
- onClick = noop,
4993
+ onClick = server.noop,
5135
4994
  ...props
5136
4995
  }) => {
5137
4996
  const [isLoading, setIsLoading] = React.useState(true);
@@ -6556,17 +6415,17 @@ const CONFIG$2 = {
6556
6415
  "border-spot-opacity": 1,
6557
6416
  "border-light-opacity": 1
6558
6417
  };
6559
- const cards$4 = [
6560
- {
6561
- id: crypto.randomUUID(),
6562
- spread: gsap$1.utils.random(0, 1e3),
6563
- outer: true,
6564
- control: false,
6565
- base: gsap$1.utils.random(0, 359)
6566
- }
6567
- ];
6568
6418
  const CardGlow = () => {
6569
6419
  useGlowPointer();
6420
+ const cards = React.useMemo(() => [
6421
+ {
6422
+ id: `card-${Math.random().toString(36).substr(2, 9)}`,
6423
+ spread: gsap$1.utils.random(0, 1e3),
6424
+ outer: true,
6425
+ control: false,
6426
+ base: gsap$1.utils.random(0, 359)
6427
+ }
6428
+ ], []);
6570
6429
  React.useEffect(() => {
6571
6430
  for (const key of Object.keys(CONFIG$2)) {
6572
6431
  if (key === "card") {
@@ -6585,7 +6444,7 @@ const CardGlow = () => {
6585
6444
  }
6586
6445
  }
6587
6446
  }, []);
6588
- return /* @__PURE__ */ jsxRuntime.jsx("main", { className: styles$3D.root, children: cards$4.map((card, index) => {
6447
+ return /* @__PURE__ */ jsxRuntime.jsx("main", { className: styles$3D.root, children: cards.map((card, index) => {
6589
6448
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$3D.wrapper, children: /* @__PURE__ */ jsxRuntime.jsxs(
6590
6449
  "article",
6591
6450
  {
@@ -6708,7 +6567,7 @@ const styles$3C = {
6708
6567
 
6709
6568
  const CardTile = ({
6710
6569
  children,
6711
- onClick = noop,
6570
+ onClick = server.noop,
6712
6571
  className = ""
6713
6572
  }) => /* @__PURE__ */ jsxRuntime.jsx(
6714
6573
  "button",
@@ -7145,7 +7004,7 @@ const styles$3s = {
7145
7004
 
7146
7005
  const ProductTile = ({
7147
7006
  children,
7148
- onClick = noop,
7007
+ onClick = server.noop,
7149
7008
  className = ""
7150
7009
  }) => /* @__PURE__ */ jsxRuntime.jsx(
7151
7010
  "button",
@@ -9638,7 +9497,7 @@ const styles$30 = {
9638
9497
  root: root$2P
9639
9498
  };
9640
9499
 
9641
- const SplashCursor = ({ onClick = noop }) => {
9500
+ const SplashCursor = ({ onClick = server.noop }) => {
9642
9501
  const ref = React.useRef(null);
9643
9502
  const onClickRef = useLiveRef(onClick);
9644
9503
  React.useEffect(() => {
@@ -10529,8 +10388,8 @@ const DockMotionItem = ({
10529
10388
  const originX = { originX: "center" };
10530
10389
  const DockMotion$1 = ({
10531
10390
  children,
10532
- onMouseEnter = noop,
10533
- onMouseLeave = noop,
10391
+ onMouseEnter = server.noop,
10392
+ onMouseLeave = server.noop,
10534
10393
  className = ""
10535
10394
  }) => {
10536
10395
  const mouseX = framerMotion.useMotionValue(null);
@@ -11086,7 +10945,7 @@ const styles$2J = {
11086
10945
  isOpen: isOpen
11087
10946
  };
11088
10947
 
11089
- const HamburgerX = ({ isOpen, onClick = noop }) => /* @__PURE__ */ jsxRuntime.jsx(
10948
+ const HamburgerX = ({ isOpen, onClick = server.noop }) => /* @__PURE__ */ jsxRuntime.jsx(
11090
10949
  "button",
11091
10950
  {
11092
10951
  type: "button",
@@ -13347,7 +13206,7 @@ const styles$1$ = {
13347
13206
 
13348
13207
  const SpinningClickAnimation = ({
13349
13208
  children = null,
13350
- onClick = noop,
13209
+ onClick = server.noop,
13351
13210
  className = ""
13352
13211
  }) => {
13353
13212
  const ref = React.useRef(null);
@@ -18584,11 +18443,11 @@ const ScrambledText = ({ children, reveal = false }) => {
18584
18443
  );
18585
18444
  };
18586
18445
 
18587
- const root$_ = "_root_75uzi_1";
18588
- const line = "_line_75uzi_9";
18589
- const word$1 = "_word_75uzi_14";
18590
- const link = "_link_75uzi_18";
18591
- const letter = "_letter_75uzi_22";
18446
+ const root$_ = "_root_1td1d_1";
18447
+ const line = "_line_1td1d_9";
18448
+ const word$1 = "_word_1td1d_14";
18449
+ const link = "_link_1td1d_18";
18450
+ const letter = "_letter_1td1d_22";
18592
18451
  const styles$13 = {
18593
18452
  root: root$_,
18594
18453
  line: line,
@@ -24897,9 +24756,9 @@ const styles$E = {
24897
24756
 
24898
24757
  const DIGITS = [0, 3, 4, 8, 7, 2];
24899
24758
  const PROXIMITY_RADIUS = 200;
24900
- const DISTANCE_MAPPER = gsap$1.utils.mapRange(250, 50, 0, 90);
24901
24759
  const GlidingReveal = () => {
24902
24760
  const codeRef = React.useRef(null);
24761
+ const DISTANCE_MAPPER = gsap$1.utils.mapRange(250, 50, 0, 90);
24903
24762
  const update = React.useCallback((x, y) => {
24904
24763
  if (!codeRef.current) return;
24905
24764
  const CENTER_POINT = codeRef.current.getBoundingClientRect();
@@ -30441,6 +30300,30 @@ const ViewTransitionImageGallery = () => {
30441
30300
  ] });
30442
30301
  };
30443
30302
 
30303
+ exports.BaseLogger = server.BaseLogger;
30304
+ exports.animationLogger = server.animationLogger;
30305
+ exports.apiLogger = server.apiLogger;
30306
+ exports.clearSession = server.clearSession;
30307
+ exports.componentLogger = server.componentLogger;
30308
+ exports.eventLogger = server.eventLogger;
30309
+ exports.getCurrentLogLevel = server.getCurrentLogLevel;
30310
+ exports.hookLogger = server.hookLogger;
30311
+ exports.is = server.is;
30312
+ exports.isDebugEnabled = server.isDebugEnabled;
30313
+ exports.isNonNullable = server.isNonNullable;
30314
+ exports.keys = server.keys;
30315
+ exports.logger = server.logger;
30316
+ exports.move = server.move;
30317
+ exports.noop = server.noop;
30318
+ exports.notReachable = server.notReachable;
30319
+ exports.setLogLevel = server.setLogLevel;
30320
+ exports.setRequestId = server.setRequestId;
30321
+ exports.setSessionId = server.setSessionId;
30322
+ exports.storageLogger = server.storageLogger;
30323
+ exports.times = server.times;
30324
+ exports.utilsLogger = server.utilsLogger;
30325
+ exports.values = server.values;
30326
+ exports.wait = server.wait;
30444
30327
  exports.AccentShardCard = AccentShardCard;
30445
30328
  exports.AcrobaticPreloader = AcrobaticPreloader;
30446
30329
  exports.ActivateButton = ActivateButton;
@@ -30461,7 +30344,6 @@ exports.AutoMasonryGrid = AutoMasonryGrid;
30461
30344
  exports.AvatarHover = AvatarHover;
30462
30345
  exports.BackgroundCircles = BackgroundCircles;
30463
30346
  exports.BackgroundSlider = BackgroundSlider;
30464
- exports.BaseLogger = BaseLogger;
30465
30347
  exports.BlurVignette = BlurVignette;
30466
30348
  exports.BlurredBackground = BlurredBackground;
30467
30349
  exports.BoldHamburger = BoldHamburger;
@@ -30760,28 +30642,8 @@ exports.VoiceAnimation = VoiceAnimation;
30760
30642
  exports.WavyMenu = WavyMenu;
30761
30643
  exports.WebGLSmoke = WebGLSmoke;
30762
30644
  exports.WeightText = WeightText;
30763
- exports.animationLogger = animationLogger;
30764
- exports.apiLogger = apiLogger;
30765
30645
  exports.chain = chain;
30766
- exports.clearSession = clearSession;
30767
- exports.componentLogger = componentLogger;
30768
- exports.eventLogger = eventLogger;
30769
- exports.getCurrentLogLevel = getCurrentLogLevel;
30770
30646
  exports.getDockTooltipPosition = getDockTooltipPosition;
30771
- exports.hookLogger = hookLogger;
30772
- exports.is = is;
30773
- exports.isDebugEnabled = isDebugEnabled;
30774
- exports.isNonNullable = isNonNullable;
30775
- exports.keys = keys;
30776
- exports.logger = logger;
30777
- exports.move = move;
30778
- exports.noop = noop;
30779
- exports.notReachable = notReachable;
30780
- exports.setLogLevel = setLogLevel;
30781
- exports.setRequestId = setRequestId;
30782
- exports.setSessionId = setSessionId;
30783
- exports.storageLogger = storageLogger;
30784
- exports.times = times;
30785
30647
  exports.useAnimatedText = useAnimatedText;
30786
30648
  exports.useBowser = useBowser;
30787
30649
  exports.useDebounce = useDebounce;
@@ -30796,6 +30658,3 @@ exports.useRaf = useRaf;
30796
30658
  exports.useThrottle = useThrottle;
30797
30659
  exports.useUniversalLayoutEffect = useUniversalLayoutEffect;
30798
30660
  exports.useWindowReady = useWindowReady;
30799
- exports.utilsLogger = utilsLogger;
30800
- exports.values = values;
30801
- exports.wait = wait;