juxscript 1.0.126 → 1.0.128

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.
@@ -4,6 +4,8 @@ export interface GridTrackConfig {
4
4
  size?: string;
5
5
  style?: string;
6
6
  class?: string;
7
+ width?: string;
8
+ height?: string;
7
9
  }
8
10
  export type GridInput = number | GridTrackConfig[];
9
11
  export interface GridState extends BaseState {
@@ -74,11 +74,17 @@ export class GridEngine extends BaseEngine {
74
74
  // Default to '1fr' for equal distribution
75
75
  return Array(input).fill({ size: '1fr' });
76
76
  }
77
- return input.map(t => ({
78
- size: t.size || '1fr',
79
- style: t.style,
80
- class: t.class
81
- }));
77
+ return input.map(t => {
78
+ // Engine Responsibility: Normalize API aliases (width/height) into standard CSS 'size'
79
+ const size = t.size || t.width || t.height || '1fr';
80
+ return {
81
+ size,
82
+ style: t.style,
83
+ class: t.class,
84
+ width: t.width,
85
+ height: t.height
86
+ };
87
+ });
82
88
  }
83
89
  // --- State-Aligned Methods ---
84
90
  /**
@@ -28,10 +28,9 @@ export class GridSkin extends BaseSkin {
28
28
  this.root.style.height = state.height;
29
29
  this.root.style.gap = state.gap;
30
30
  // CSS Grid Definitions
31
- // We accept 'size', but also semantically valid 'height' (rows) and 'width' (cols)
32
- // This allows mixing units: 1fr, 200px, 20%, auto, etc.
33
- const rowSizes = state.rows.map(r => r.size || r.height || 'auto').join(' ');
34
- const colSizes = state.columns.map(c => c.size || c.width || 'auto').join(' ');
31
+ // Engine normalizes 'width'/'height' inputs into 'size', so we trust correct CSS values here.
32
+ const rowSizes = state.rows.map(r => r.size || 'auto').join(' ');
33
+ const colSizes = state.columns.map(c => c.size || 'auto').join(' ');
35
34
  this.root.style.gridTemplateRows = rowSizes;
36
35
  this.root.style.gridTemplateColumns = colSizes;
37
36
  // 2. Structural Reconciliation
@@ -17,41 +17,10 @@
17
17
  flex-direction: column;
18
18
  }
19
19
 
20
- /*
21
- ✨ GRIDDER: The Blueprint Mode
22
- Visualizes the Ordinal System
23
- */
24
20
  .jux-grid-ordinal-label {
25
21
  display: none; /* Hidden by default */
26
22
  }
27
23
 
28
- .jux-gridder-active {
29
- background-color: var(--color-surface-base);
30
- outline: 2px dashed var(--color-brand-subtle);
31
- gap: 4px !important; /* Force visible gap for inspection */
32
- }
33
-
34
- .jux-gridder-active .jux-grid-cell {
35
- border: 1px dashed var(--color-border);
36
- background-color: rgba(255, 255, 255, 0.5);
37
- align-items: center;
38
- justify-content: center;
39
- }
40
-
41
- .jux-gridder-active .jux-grid-ordinal-label {
42
- display: block;
43
- position: absolute;
44
- top: 0;
45
- left: 0;
46
- background: var(--color-brand);
47
- color: #fff;
48
- font-family: monospace;
49
- font-size: 10px;
50
- padding: 2px 4px;
51
- opacity: 0.8;
52
- z-index: 10;
53
- border-bottom-right-radius: 4px;
54
- }
55
24
 
56
25
  .jux-grid:hover {
57
26
  background-color: var(--color-surface-hover);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juxscript",
3
- "version": "1.0.126",
3
+ "version": "1.0.128",
4
4
  "type": "module",
5
5
  "description": "A JavaScript UX authorship platform",
6
6
  "main": "./index.js",