@tachui/responsive 0.8.5-alpha → 0.8.10-alpha.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.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { globalModifierRegistry as W } from "@tachui/registry";
2
2
  import { BaseModifier as se } from "@tachui/modifiers";
3
3
  import { createSignal as E, createEffect as V, isSignal as T, isComputed as j, getThemeSignal as me, createComputed as m, createMemo as ge } from "@tachui/core";
4
- const b = {
4
+ const g = {
5
5
  Clean: 0,
6
6
  Check: 1,
7
7
  Dirty: 2,
@@ -40,13 +40,13 @@ class we {
40
40
  // Signals this computation depends on
41
41
  observers = /* @__PURE__ */ new Set();
42
42
  // Computations that depend on this
43
- state = b.Dirty;
43
+ state = g.Dirty;
44
44
  value = void 0;
45
45
  constructor(e, t = null) {
46
46
  this.id = ++be, this.fn = e, this.owner = t, t && !t.disposed && t.sources.add(this);
47
47
  }
48
48
  execute() {
49
- if (this.state === b.Disposed)
49
+ if (this.state === g.Disposed)
50
50
  return this.value;
51
51
  for (const t of this.sources)
52
52
  t && typeof t == "object" && "removeObserver" in t && t.removeObserver(this);
@@ -54,16 +54,16 @@ class we {
54
54
  const e = D.currentComputation;
55
55
  D.currentComputation = this;
56
56
  try {
57
- return this.state = b.Clean, this.value = this.fn(), this.value;
57
+ return this.state = g.Clean, this.value = this.fn(), this.value;
58
58
  } catch (t) {
59
- throw this.state = b.Disposed, (typeof process > "u" || process.env.NODE_ENV !== "test") && console.error("Error in computation:", t), t;
59
+ throw this.state = g.Disposed, (typeof process > "u" || process.env.NODE_ENV !== "test") && console.error("Error in computation:", t), t;
60
60
  } finally {
61
61
  D.currentComputation = e;
62
62
  }
63
63
  }
64
64
  dispose() {
65
- if (this.state !== b.Disposed) {
66
- this.state = b.Disposed;
65
+ if (this.state !== g.Disposed) {
66
+ this.state = g.Disposed;
67
67
  for (const e of this.sources)
68
68
  e && typeof e == "object" && "removeObserver" in e && e.removeObserver(this);
69
69
  this.sources.clear();
@@ -91,19 +91,24 @@ class Ce extends we {
91
91
  */
92
92
  getValue() {
93
93
  const e = ne();
94
- return e && e.state !== b.Disposed && (this.observers.add(e), e.sources.add(this)), (this.state === b.Dirty || !this._hasValue) && (this.execute(), this._hasValue = !0), this.value;
94
+ return e && e.state !== g.Disposed && (this.observers.add(e), e.sources.add(this)), (this.state === g.Dirty || !this._hasValue) && (this.execute(), this._hasValue = !0), this.value;
95
95
  }
96
96
  /**
97
97
  * Get the current value without tracking dependency
98
98
  */
99
99
  peek() {
100
- return (this.state === b.Dirty || !this._hasValue) && (this.execute(), this._hasValue = !0), this.value;
100
+ return (this.state === g.Dirty || !this._hasValue) && (this.execute(), this._hasValue = !0), this.value;
101
101
  }
102
102
  /**
103
103
  * Remove an observer (cleanup)
104
104
  */
105
105
  removeObserver(e) {
106
- this.observers.delete(e);
106
+ this.observers.delete(e), this.options.releaseOnNoObservers === !0 && this.observers.size === 0 && e.state === g.Disposed && this.releaseSources();
107
+ }
108
+ releaseSources() {
109
+ for (const e of this.sources)
110
+ "removeObserver" in e && e.removeObserver(this);
111
+ this.sources.clear(), this._hasValue = !1, this.state = g.Dirty;
107
112
  }
108
113
  /**
109
114
  * Execute the computation and notify observers
@@ -112,8 +117,8 @@ class Ce extends we {
112
117
  const e = this._hasValue ? this.value : void 0, t = super.execute();
113
118
  if (!this._hasValue || !this.equalsFn(e, t))
114
119
  for (const i of this.observers)
115
- i.state !== b.Disposed && (i.state = b.Dirty, "execute" in i && typeof i.execute == "function" && queueMicrotask(() => {
116
- i.state === b.Dirty && i.execute();
120
+ i.state !== g.Disposed && (i.state = g.Dirty, "execute" in i && typeof i.execute == "function" && queueMicrotask(() => {
121
+ i.state === g.Dirty && i.execute();
117
122
  }));
118
123
  return t;
119
124
  }
@@ -132,7 +137,7 @@ class Ce extends we {
132
137
  this.sources.clear();
133
138
  for (const e of this.observers)
134
139
  e.sources.delete(this);
135
- this.observers.clear(), this._hasValue = !1, this._error = null, this.state = b.Disposed;
140
+ this.observers.clear(), this._hasValue = !1, this._error = null, this.state = g.Disposed;
136
141
  }
137
142
  /**
138
143
  * Dispose the computed value
@@ -182,7 +187,7 @@ class ke {
182
187
  */
183
188
  getValue() {
184
189
  const e = ne();
185
- return e && e.state !== b.Disposed && (this.observers.add(e), e.sources.add(this)), this._value;
190
+ return e && e.state !== g.Disposed && (this.observers.add(e), e.sources.add(this)), this._value;
186
191
  }
187
192
  /**
188
193
  * Get the current value without tracking dependency
@@ -202,7 +207,7 @@ class ke {
202
207
  */
203
208
  notify() {
204
209
  for (const e of this.observers)
205
- e.state !== b.Disposed && (e.state = b.Dirty, Re(e));
210
+ e.state !== g.Disposed && (e.state = g.Dirty, Re(e));
206
211
  }
207
212
  /**
208
213
  * Remove an observer (cleanup)
@@ -222,23 +227,23 @@ class ke {
222
227
  };
223
228
  }
224
229
  }
225
- const L = /* @__PURE__ */ new Set();
226
- let N = !1;
230
+ const q = /* @__PURE__ */ new Set();
231
+ let L = !1;
227
232
  function Re(s) {
228
- L.add(s), N || queueMicrotask(Me);
233
+ q.add(s), L || queueMicrotask(Me);
229
234
  }
230
235
  function Me() {
231
- if (!N) {
232
- N = !0;
236
+ if (!L) {
237
+ L = !0;
233
238
  try {
234
- for (; L.size > 0; ) {
235
- const s = Array.from(L).sort((e, t) => e.id - t.id);
236
- L.clear();
239
+ for (; q.size > 0; ) {
240
+ const s = Array.from(q).sort((e, t) => e.id - t.id);
241
+ q.clear();
237
242
  for (const e of s)
238
- e.state === b.Dirty && e.execute();
243
+ e.state === g.Dirty && e.execute();
239
244
  }
240
245
  } finally {
241
- N = !1;
246
+ L = !1;
242
247
  }
243
248
  }
244
249
  }
@@ -264,7 +269,7 @@ process.env.NODE_ENV === "development" && console.log("📤 Created RegistryAdap
264
269
  registryId: W.instanceId,
265
270
  currentSize: W.list().length
266
271
  });
267
- const Ie = "0.8.1-alpha", Te = Ie, Y = /* @__PURE__ */ new WeakSet(), X = /* @__PURE__ */ new WeakMap(), je = {
272
+ const Ie = "0.8.10-alpha.0", Te = Ie, Y = /* @__PURE__ */ new WeakSet(), X = /* @__PURE__ */ new WeakMap(), je = {
268
273
  name: "@tachui/core",
269
274
  version: Te,
270
275
  author: "TachUI Team",
@@ -286,7 +291,7 @@ function _e(s, e, t, i = W, r = je) {
286
291
  plugin: r.name
287
292
  });
288
293
  }
289
- const ze = "0.8.0-alpha", qe = ze, oe = {
294
+ const ze = "0.8.10-alpha.0", Ne = ze, oe = {
290
295
  base: "0px",
291
296
  // Mobile-first base
292
297
  sm: "640px",
@@ -311,7 +316,7 @@ function J(s) {
311
316
  let z = {
312
317
  ...oe
313
318
  };
314
- const [ae, ee] = E("base"), [ce, Le] = E({
319
+ const [ae, ee] = E("base"), [ce, qe] = E({
315
320
  width: 0,
316
321
  height: 0
317
322
  });
@@ -364,7 +369,7 @@ function te(s, e) {
364
369
  function ie(s, e) {
365
370
  return y(s) < y(e);
366
371
  }
367
- function Ne(s) {
372
+ function Le(s) {
368
373
  return s === "base" ? "" : `(min-width: ${z[s]})`;
369
374
  }
370
375
  function ct(s, e) {
@@ -401,7 +406,7 @@ function _() {
401
406
  ee("base");
402
407
  }
403
408
  function H() {
404
- typeof window < "u" && Le({
409
+ typeof window < "u" && qe({
405
410
  width: window.innerWidth,
406
411
  height: window.innerHeight
407
412
  });
@@ -510,7 +515,7 @@ class de {
510
515
  if (n === "base")
511
516
  r[c] = d;
512
517
  else {
513
- const l = Ne(n), p = { [c]: d };
518
+ const l = Le(n), p = { [c]: d };
514
519
  i.push({
515
520
  breakpoint: n,
516
521
  query: l,
@@ -1593,7 +1598,7 @@ function wt(s, e) {
1593
1598
  t[`--${s}-${i}`] = r.toString();
1594
1599
  return t;
1595
1600
  }
1596
- const g = {
1601
+ const b = {
1597
1602
  // Viewport size queries
1598
1603
  mobile: "(max-width: 767px)",
1599
1604
  tablet: "(min-width: 768px) and (max-width: 1023px)",
@@ -1720,12 +1725,12 @@ function We() {
1720
1725
  const s = S();
1721
1726
  console.group("🔍 tachUI Responsive State"), console.log("Current breakpoint:", s.current), console.log("Viewport dimensions:", `${s.width}x${s.height}`), console.log("Available breakpoints:", ["base", "sm", "md", "lg", "xl", "2xl"]);
1722
1727
  const e = {
1723
- Mobile: g.mobile,
1724
- Tablet: g.tablet,
1725
- Desktop: g.desktop,
1726
- "Dark mode": g.darkMode,
1727
- "Reduced motion": g.reducedMotion,
1728
- "Can hover": g.canHover
1728
+ Mobile: b.mobile,
1729
+ Tablet: b.tablet,
1730
+ Desktop: b.desktop,
1731
+ "Dark mode": b.darkMode,
1732
+ "Reduced motion": b.reducedMotion,
1733
+ "Can hover": b.canHover
1729
1734
  };
1730
1735
  console.log("Media query matches:");
1731
1736
  for (const [t, i] of Object.entries(e))
@@ -2483,10 +2488,10 @@ class M {
2483
2488
  }
2484
2489
  r += '<div style="margin: 8px 0; font-weight: bold; color: #ba68c8;">Media Queries:</div>';
2485
2490
  const o = {
2486
- Touch: g.touchDevice,
2487
- Dark: g.darkMode,
2488
- "Reduced Motion": g.reducedMotion,
2489
- "High Contrast": g.highContrast
2491
+ Touch: b.touchDevice,
2492
+ Dark: b.darkMode,
2493
+ "Reduced Motion": b.reducedMotion,
2494
+ "High Contrast": b.highContrast
2490
2495
  };
2491
2496
  for (const [n, a] of Object.entries(o)) {
2492
2497
  const c = window.matchMedia(a).matches;
@@ -2583,12 +2588,12 @@ class M {
2583
2588
  const e = S(), t = P();
2584
2589
  if (console.group("🔍 TachUI Responsive State"), console.log("Current breakpoint:", e.current), console.log("Viewport:", `${e.width}×${e.height}`), console.log("Configuration:", t), typeof window < "u" && window.matchMedia) {
2585
2590
  const i = {
2586
- Mobile: g.mobile,
2587
- Tablet: g.tablet,
2588
- Desktop: g.desktop,
2589
- "Touch Device": g.touchDevice,
2590
- "Dark Mode": g.darkMode,
2591
- "Reduced Motion": g.reducedMotion
2591
+ Mobile: b.mobile,
2592
+ Tablet: b.tablet,
2593
+ Desktop: b.desktop,
2594
+ "Touch Device": b.touchDevice,
2595
+ "Dark Mode": b.darkMode,
2596
+ "Reduced Motion": b.reducedMotion
2592
2597
  };
2593
2598
  console.log("Media Query Results:");
2594
2599
  for (const [r, o] of Object.entries(i))
@@ -2651,7 +2656,7 @@ class M {
2651
2656
  static exportConfiguration() {
2652
2657
  const e = S(), t = P(), i = A.getStats(), r = R.getStats(), o = {};
2653
2658
  if (typeof window < "u" && window.matchMedia) {
2654
- for (const [n, a] of Object.entries(g))
2659
+ for (const [n, a] of Object.entries(b))
2655
2660
  if (typeof a == "string")
2656
2661
  try {
2657
2662
  o[n] = window.matchMedia(a).matches;
@@ -2744,16 +2749,16 @@ typeof window < "u" && process.env.NODE_ENV !== "production" && (window.tachUIRe
2744
2749
  });
2745
2750
  const Xe = {
2746
2751
  name: "@tachui/responsive",
2747
- version: qe,
2752
+ version: Ne,
2748
2753
  author: "TachUI Team",
2749
2754
  verified: !0
2750
- }, q = 80, Je = [
2755
+ }, N = 80, Je = [
2751
2756
  [
2752
2757
  "responsive",
2753
2758
  h,
2754
2759
  {
2755
2760
  category: "layout",
2756
- priority: q,
2761
+ priority: N,
2757
2762
  signature: "(config: ResponsiveStyleConfig) => Modifier",
2758
2763
  description: "Applies responsive style mappings across configured breakpoints."
2759
2764
  }
@@ -2763,7 +2768,7 @@ const Xe = {
2763
2768
  $,
2764
2769
  {
2765
2770
  category: "layout",
2766
- priority: q,
2771
+ priority: N,
2767
2772
  signature: "(query: string, styles: Record<string, any>) => Modifier",
2768
2773
  description: "Attaches custom CSS rules for a media query to a component."
2769
2774
  }
@@ -2773,7 +2778,7 @@ const Xe = {
2773
2778
  u,
2774
2779
  {
2775
2780
  category: "layout",
2776
- priority: q,
2781
+ priority: N,
2777
2782
  signature: "(property: string, value: ResponsiveValue<any>) => Modifier",
2778
2783
  description: "Creates a responsive modifier from a single style property/value map."
2779
2784
  }
@@ -2783,7 +2788,7 @@ const Xe = {
2783
2788
  pe,
2784
2789
  {
2785
2790
  category: "layout",
2786
- priority: q,
2791
+ priority: N,
2787
2792
  signature: "(config: ResponsiveLayoutConfig) => Modifier",
2788
2793
  description: "Configures responsive flexbox layout properties such as direction, wrap, and gap."
2789
2794
  }
@@ -2812,7 +2817,7 @@ export {
2812
2817
  oe as DEFAULT_BREAKPOINTS,
2813
2818
  kt as Flex,
2814
2819
  Et as LayoutPatterns,
2815
- g as MediaQueries,
2820
+ b as MediaQueries,
2816
2821
  He as MediaQueryModifier,
2817
2822
  ft as OptimizedCSSGenerator,
2818
2823
  le as RESPONSIVE_MODIFIER_PRIORITY,
@@ -2849,7 +2854,7 @@ export {
2849
2854
  R as cssRuleCache,
2850
2855
  Bt as enableResponsiveDebugOverlay,
2851
2856
  ht as generateCustomMediaQuery,
2852
- Ne as generateMediaQuery,
2857
+ Le as generateMediaQuery,
2853
2858
  ct as generateRangeMediaQuery,
2854
2859
  pt as generateResponsiveProperty,
2855
2860
  y as getBreakpointIndex,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tachui/responsive",
3
- "version": "0.8.5-alpha",
3
+ "version": "0.8.10-alpha.0",
4
4
  "description": "Advanced responsive design patterns and utilities for tachUI framework",
5
5
  "homepage": "https://tachui.dev/",
6
6
  "main": "./dist/index.js",
@@ -22,9 +22,9 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@tachui/core": "0.8.5-alpha",
26
- "@tachui/modifiers": "0.8.5-alpha",
27
- "@tachui/registry": "0.8.5-alpha"
25
+ "@tachui/core": "0.8.10-alpha.0",
26
+ "@tachui/modifiers": "0.8.10-alpha.0",
27
+ "@tachui/registry": "0.8.10-alpha.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "^20.0.0",