juxscript 1.1.130 → 1.1.133
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/dom-structure-map.json +1 -1
- package/index.d.ts +1 -2
- package/index.d.ts.map +1 -1
- package/index.js +8 -9
- package/lib/components/base/Animations.d.ts +36 -0
- package/lib/components/base/Animations.d.ts.map +1 -0
- package/lib/components/base/Animations.js +70 -0
- package/lib/components/base/Animations.ts +112 -0
- package/lib/components/base/BaseComponent.d.ts +3 -0
- package/lib/components/base/BaseComponent.d.ts.map +1 -1
- package/lib/components/base/BaseComponent.js +4 -8
- package/lib/components/base/BaseComponent.ts +6 -10
- package/lib/components/stack/BaseStack.d.ts +40 -56
- package/lib/components/stack/BaseStack.d.ts.map +1 -1
- package/lib/components/stack/BaseStack.js +101 -173
- package/lib/components/stack/BaseStack.ts +114 -229
- package/lib/components/stack/HStack.d.ts +14 -4
- package/lib/components/stack/HStack.d.ts.map +1 -1
- package/lib/components/stack/HStack.js +16 -15
- package/lib/components/stack/HStack.ts +17 -19
- package/lib/components/stack/VStack.d.ts +15 -7
- package/lib/components/stack/VStack.d.ts.map +1 -1
- package/lib/components/stack/VStack.js +17 -17
- package/lib/components/stack/VStack.ts +18 -22
- package/lib/components/stack/ZStack.d.ts +14 -4
- package/lib/components/stack/ZStack.d.ts.map +1 -1
- package/lib/components/stack/ZStack.js +16 -15
- package/lib/components/stack/ZStack.ts +17 -19
- package/lib/styles/shadcn.css +1106 -0
- package/machinery/compiler3.js +2 -2
- package/package.json +1 -1
- package/lib/components/base/LayoutExtensions.d.ts +0 -112
- package/lib/components/base/LayoutExtensions.d.ts.map +0 -1
- package/lib/components/base/LayoutExtensions.js +0 -187
- package/lib/components/base/LayoutExtensions.ts +0 -345
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
import { BaseComponent, BaseState } from '../base/BaseComponent.js';
|
|
2
|
-
import { LayoutExtensions } from '../base/LayoutExtensions.js';
|
|
3
2
|
|
|
4
|
-
// Event definitions
|
|
5
3
|
const TRIGGER_EVENTS = [] as const;
|
|
6
4
|
const CALLBACK_EVENTS = [] as const;
|
|
7
5
|
|
|
8
|
-
export interface StackOptions {
|
|
9
|
-
spacing?: 'none' | 'tight' | 'normal' | 'loose';
|
|
10
|
-
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
11
|
-
justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
|
|
12
|
-
divider?: boolean;
|
|
13
|
-
responsive?: boolean;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
6
|
export interface StackState extends BaseState {
|
|
17
|
-
spacing:
|
|
18
|
-
align:
|
|
19
|
-
justify:
|
|
7
|
+
spacing: 'none' | 'tight' | 'normal' | 'loose';
|
|
8
|
+
align: 'start' | 'center' | 'end' | 'stretch';
|
|
9
|
+
justify: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
|
|
20
10
|
divider: boolean;
|
|
21
11
|
responsive: boolean;
|
|
22
12
|
}
|
|
@@ -24,9 +14,12 @@ export interface StackState extends BaseState {
|
|
|
24
14
|
export abstract class BaseStack extends BaseComponent<StackState> {
|
|
25
15
|
protected abstract baseClassName: string;
|
|
26
16
|
protected _container: HTMLElement | null = null;
|
|
17
|
+
protected _children: any[] = [];
|
|
27
18
|
protected _childStyleFunction: ((index: number) => string) | null = null;
|
|
19
|
+
protected _autoRendered: boolean = false;
|
|
28
20
|
|
|
29
|
-
|
|
21
|
+
// ✅ ULTRA-MINIMAL: Only id required
|
|
22
|
+
constructor(id: string) {
|
|
30
23
|
super(id, {
|
|
31
24
|
visible: true,
|
|
32
25
|
disabled: false,
|
|
@@ -34,15 +27,20 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
34
27
|
class: '',
|
|
35
28
|
style: '',
|
|
36
29
|
attributes: {},
|
|
37
|
-
spacing:
|
|
38
|
-
align:
|
|
39
|
-
justify:
|
|
40
|
-
divider:
|
|
41
|
-
responsive:
|
|
30
|
+
spacing: 'normal',
|
|
31
|
+
align: 'start',
|
|
32
|
+
justify: 'start',
|
|
33
|
+
divider: false,
|
|
34
|
+
responsive: false
|
|
42
35
|
});
|
|
43
36
|
|
|
44
|
-
// ✅
|
|
45
|
-
|
|
37
|
+
// ✅ Auto-render on next tick
|
|
38
|
+
queueMicrotask(() => {
|
|
39
|
+
if (!this._autoRendered && !this.container) {
|
|
40
|
+
this._autoRendered = true;
|
|
41
|
+
this.render('app');
|
|
42
|
+
}
|
|
43
|
+
});
|
|
46
44
|
}
|
|
47
45
|
|
|
48
46
|
protected getTriggerEvents(): readonly string[] {
|
|
@@ -54,7 +52,76 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
54
52
|
}
|
|
55
53
|
|
|
56
54
|
/* ═════════════════════════════════════════════════════════════════
|
|
57
|
-
*
|
|
55
|
+
* CHILDREN MANAGEMENT (Fluent API)
|
|
56
|
+
* ═════════════════════════════════════════════════════════════════ */
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Set all children at once (replaces existing)
|
|
60
|
+
*/
|
|
61
|
+
items(children: any[]): this {
|
|
62
|
+
this._children = children;
|
|
63
|
+
this._refreshChildren();
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Add children to the end
|
|
69
|
+
*/
|
|
70
|
+
addItems(...children: any[]): this {
|
|
71
|
+
this._children.push(...children);
|
|
72
|
+
this._refreshChildren();
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Add a single child
|
|
78
|
+
*/
|
|
79
|
+
addItem(child: any): this {
|
|
80
|
+
this._children.push(child);
|
|
81
|
+
this._refreshChildren();
|
|
82
|
+
return this;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Replace child at index
|
|
87
|
+
*/
|
|
88
|
+
replaceItem(index: number, child: any): this {
|
|
89
|
+
if (index >= 0 && index < this._children.length) {
|
|
90
|
+
this._children[index] = child;
|
|
91
|
+
this._refreshChildren();
|
|
92
|
+
}
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Remove child at index
|
|
98
|
+
*/
|
|
99
|
+
removeItem(index: number): this {
|
|
100
|
+
if (index >= 0 && index < this._children.length) {
|
|
101
|
+
this._children.splice(index, 1);
|
|
102
|
+
this._refreshChildren();
|
|
103
|
+
}
|
|
104
|
+
return this;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Remove all children
|
|
109
|
+
*/
|
|
110
|
+
clearItems(): this {
|
|
111
|
+
this._children = [];
|
|
112
|
+
this._refreshChildren();
|
|
113
|
+
return this;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Get current children array (read-only)
|
|
118
|
+
*/
|
|
119
|
+
getItems(): readonly any[] {
|
|
120
|
+
return this._children;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* ═════════════════════════════════════════════════════════════════
|
|
124
|
+
* STACK LAYOUT API
|
|
58
125
|
* ═════════════════════════════════════════════════════════════════ */
|
|
59
126
|
|
|
60
127
|
spacing(value: 'none' | 'tight' | 'normal' | 'loose'): this {
|
|
@@ -81,7 +148,7 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
81
148
|
return this;
|
|
82
149
|
}
|
|
83
150
|
|
|
84
|
-
divider(value: boolean): this {
|
|
151
|
+
divider(value: boolean = true): this {
|
|
85
152
|
this.state.divider = value;
|
|
86
153
|
if (this._container) {
|
|
87
154
|
this._container.className = this.buildClasses();
|
|
@@ -89,7 +156,7 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
89
156
|
return this;
|
|
90
157
|
}
|
|
91
158
|
|
|
92
|
-
responsive(value: boolean): this {
|
|
159
|
+
responsive(value: boolean = true): this {
|
|
93
160
|
this.state.responsive = value;
|
|
94
161
|
if (this._container) {
|
|
95
162
|
this._container.className = this.buildClasses();
|
|
@@ -98,11 +165,12 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
98
165
|
}
|
|
99
166
|
|
|
100
167
|
/* ═════════════════════════════════════════════════════════════════
|
|
101
|
-
* CHILD STYLING
|
|
168
|
+
* CHILD STYLING
|
|
102
169
|
* ═════════════════════════════════════════════════════════════════ */
|
|
103
170
|
|
|
104
171
|
childStyle(fn: (index: number) => string): this {
|
|
105
172
|
this._childStyleFunction = fn;
|
|
173
|
+
this._refreshChildren();
|
|
106
174
|
return this;
|
|
107
175
|
}
|
|
108
176
|
|
|
@@ -116,6 +184,7 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
116
184
|
|
|
117
185
|
fade(topOpacity: number = 1, step: number = 0.2): this {
|
|
118
186
|
this._childStyleFunction = (index) => `opacity: ${Math.max(0, topOpacity - index * step)};`;
|
|
187
|
+
this._refreshChildren();
|
|
119
188
|
return this;
|
|
120
189
|
}
|
|
121
190
|
|
|
@@ -129,210 +198,18 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
129
198
|
return `margin-left: ${index * offset}px; margin-top: ${index * offset}px;`;
|
|
130
199
|
}
|
|
131
200
|
};
|
|
201
|
+
this._refreshChildren();
|
|
132
202
|
return this;
|
|
133
203
|
}
|
|
134
204
|
|
|
135
205
|
scaleProgressive(topScale: number = 1, step: number = 0.1): this {
|
|
136
206
|
this._childStyleFunction = (index) => `transform: scale(${Math.max(0.1, topScale - index * step)});`;
|
|
207
|
+
this._refreshChildren();
|
|
137
208
|
return this;
|
|
138
209
|
}
|
|
139
210
|
|
|
140
211
|
/* ═════════════════════════════════════════════════════════════════
|
|
141
|
-
*
|
|
142
|
-
* ═════════════════════════════════════════════════════════════════ */
|
|
143
|
-
|
|
144
|
-
/* Stack-Level Animations */
|
|
145
|
-
fadeIn(): this {
|
|
146
|
-
return this.addClass('jux-stack-fade-in');
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
slideIn(direction: 'up' | 'down' | 'left' | 'right' = 'up'): this {
|
|
150
|
-
return this.addClass(`jux-stack-slide-${direction}`);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
scaleIn(): this {
|
|
154
|
-
return this.addClass('jux-stack-scale-in');
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
zoomIn(): this {
|
|
158
|
-
return this.addClass('jux-stack-zoom-in');
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
rotateIn(): this {
|
|
162
|
-
return this.addClass('jux-stack-rotate-in');
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
flipIn(axis: 'x' | 'y' = 'x'): this {
|
|
166
|
-
return this.addClass(`jux-stack-flip-${axis}`);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
bounceIn(): this {
|
|
170
|
-
return this.addClass('jux-stack-bounce-in');
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
elasticIn(): this {
|
|
174
|
-
return this.addClass('jux-stack-elastic-in');
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
blurIn(): this {
|
|
178
|
-
return this.addClass('jux-stack-blur-in');
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
glow(): this {
|
|
182
|
-
return this.addClass('jux-stack-glow');
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/* Item-Level Animations */
|
|
186
|
-
fadeInItems(): this {
|
|
187
|
-
return this.addClass('jux-stack-fade-in-items');
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
slideInItems(direction: 'up' | 'down' | 'left' | 'right' = 'up'): this {
|
|
191
|
-
return this.addClass(`jux-stack-slide-${direction}-items`);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
scaleInItems(): this {
|
|
195
|
-
return this.addClass('jux-stack-scale-in-items');
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
zoomInItems(): this {
|
|
199
|
-
return this.addClass('jux-stack-zoom-in-items');
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
rotateInItems(): this {
|
|
203
|
-
return this.addClass('jux-stack-rotate-in-items');
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
flipInItems(axis: 'x' | 'y' = 'x'): this {
|
|
207
|
-
return this.addClass(`jux-stack-flip-${axis}-items`);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
bounceInItems(): this {
|
|
211
|
-
return this.addClass('jux-stack-bounce-in-items');
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
elasticInItems(): this {
|
|
215
|
-
return this.addClass('jux-stack-elastic-in-items');
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
blurInItems(): this {
|
|
219
|
-
return this.addClass('jux-stack-blur-in-items');
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
glowItems(): this {
|
|
223
|
-
return this.addClass('jux-stack-glow-items');
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/* Speed Modifiers */
|
|
227
|
-
instant(): this {
|
|
228
|
-
return this.addClass('jux-stack-instant');
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
fast(): this {
|
|
232
|
-
return this.addClass('jux-stack-fast');
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
normal(): this {
|
|
236
|
-
return this.addClass('jux-stack-normal');
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
slow(): this {
|
|
240
|
-
return this.addClass('jux-stack-slow');
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
slower(): this {
|
|
244
|
-
return this.addClass('jux-stack-slower');
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
/* Timing Functions */
|
|
248
|
-
linear(): this {
|
|
249
|
-
return this.addClass('jux-stack-linear');
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
ease(): this {
|
|
253
|
-
return this.addClass('jux-stack-ease');
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
easeIn(): this {
|
|
257
|
-
return this.addClass('jux-stack-ease-in');
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
easeOut(): this {
|
|
261
|
-
return this.addClass('jux-stack-ease-out');
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
easeInOut(): this {
|
|
265
|
-
return this.addClass('jux-stack-ease-in-out');
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
bounceTiming(): this {
|
|
269
|
-
return this.addClass('jux-stack-bounce-timing');
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
elasticTiming(): this {
|
|
273
|
-
return this.addClass('jux-stack-elastic-timing');
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/* Delay Control */
|
|
277
|
-
delay(ms: 100 | 200 | 300 | 500 | 1000): this {
|
|
278
|
-
return this.addClass(`jux-stack-delay-${ms}`);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
/* Stagger & Interactive */
|
|
282
|
-
staggered(): this {
|
|
283
|
-
return this.addClass('jux-stack-stagger');
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
stagger(delayMs: number = 100): this {
|
|
287
|
-
this.addClass('jux-stack-stagger');
|
|
288
|
-
|
|
289
|
-
if (delayMs !== 100 && this._container) {
|
|
290
|
-
const children = this._container.children;
|
|
291
|
-
for (let i = 0; i < Math.min(children.length, 10); i++) {
|
|
292
|
-
const child = children[i] as HTMLElement;
|
|
293
|
-
const currentStyle = child.getAttribute('style') || '';
|
|
294
|
-
const delay = i * delayMs;
|
|
295
|
-
|
|
296
|
-
const cleanedStyle = currentStyle
|
|
297
|
-
.split(';')
|
|
298
|
-
.filter(s => !s.trim().startsWith('animation-delay'))
|
|
299
|
-
.join(';');
|
|
300
|
-
|
|
301
|
-
child.setAttribute('style', `${cleanedStyle}; animation-delay: ${delay}ms`);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
return this;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
interactive(): this {
|
|
309
|
-
return this.addClass('jux-stack-interactive');
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
smooth(): this {
|
|
313
|
-
return this.addClass('jux-stack-smooth');
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
smoothItems(): this {
|
|
317
|
-
return this.addClass('jux-stack-smooth-items');
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
/* Convenience Combos */
|
|
321
|
-
animateStagger(animation: 'fade' | 'slide' | 'scale' | 'bounce' = 'fade', direction?: 'up' | 'down' | 'left' | 'right'): this {
|
|
322
|
-
if (animation === 'slide' && direction) {
|
|
323
|
-
this.slideIn(direction);
|
|
324
|
-
} else if (animation === 'fade') {
|
|
325
|
-
this.fadeIn();
|
|
326
|
-
} else if (animation === 'scale') {
|
|
327
|
-
this.scaleIn();
|
|
328
|
-
} else if (animation === 'bounce') {
|
|
329
|
-
this.bounceIn();
|
|
330
|
-
}
|
|
331
|
-
return this.staggered();
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
/* ═════════════════════════════════════════════════════════════════
|
|
335
|
-
* RENDER
|
|
212
|
+
* RENDER & UPDATE
|
|
336
213
|
* ═════════════════════════════════════════════════════════════════ */
|
|
337
214
|
|
|
338
215
|
protected buildClasses(): string {
|
|
@@ -405,6 +282,22 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
405
282
|
return childElement;
|
|
406
283
|
}
|
|
407
284
|
|
|
285
|
+
/**
|
|
286
|
+
* Refresh children when items change
|
|
287
|
+
*/
|
|
288
|
+
protected _refreshChildren(): void {
|
|
289
|
+
if (!this._container) return;
|
|
290
|
+
|
|
291
|
+
// Clear existing children
|
|
292
|
+
this._container.innerHTML = '';
|
|
293
|
+
|
|
294
|
+
// Re-render all children
|
|
295
|
+
this._children.forEach((child, index) => {
|
|
296
|
+
const childEl = this.renderChild(child, index);
|
|
297
|
+
this._container!.appendChild(childEl);
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
|
|
408
301
|
render(targetId?: string | HTMLElement | BaseComponent<any>): this {
|
|
409
302
|
const container = this._setupContainer(targetId);
|
|
410
303
|
|
|
@@ -412,16 +305,11 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
412
305
|
stackDiv.id = this._id;
|
|
413
306
|
stackDiv.className = this.buildClasses();
|
|
414
307
|
|
|
415
|
-
// ✅ THIS LINE - Does it capture inline styles from state.style?
|
|
416
308
|
if (this.state.style) {
|
|
417
309
|
stackDiv.setAttribute('style', this.state.style);
|
|
418
310
|
}
|
|
419
311
|
|
|
420
|
-
|
|
421
|
-
? this.children
|
|
422
|
-
: Object.values(this.children);
|
|
423
|
-
|
|
424
|
-
childArray.forEach((child, index) => {
|
|
312
|
+
this._children.forEach((child, index) => {
|
|
425
313
|
const childEl = this.renderChild(child, index);
|
|
426
314
|
stackDiv.appendChild(childEl);
|
|
427
315
|
});
|
|
@@ -438,6 +326,3 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
438
326
|
// Stacks don't need reactive updates
|
|
439
327
|
}
|
|
440
328
|
}
|
|
441
|
-
|
|
442
|
-
// ✅ Type assertion for LayoutExtensions (inherited from BaseComponent)
|
|
443
|
-
export interface BaseStack extends LayoutExtensions { }
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
import { BaseStack
|
|
1
|
+
import { BaseStack } from './BaseStack.js';
|
|
2
2
|
export declare class HStack extends BaseStack {
|
|
3
3
|
protected baseClassName: string;
|
|
4
|
-
constructor(id: string
|
|
5
|
-
static create(children: Record<string, any> | any[], options?: StackOptions): HStack;
|
|
4
|
+
constructor(id: string);
|
|
6
5
|
}
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Create a horizontal stack (auto-renders)
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* hstack('nav')
|
|
11
|
+
* .items([
|
|
12
|
+
* jux.link('home').text('Home'),
|
|
13
|
+
* jux.link('about').text('About')
|
|
14
|
+
* ])
|
|
15
|
+
* .spacing('tight');
|
|
16
|
+
*/
|
|
17
|
+
export declare function hstack(id: string): HStack;
|
|
8
18
|
//# sourceMappingURL=HStack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HStack.d.ts","sourceRoot":"","sources":["HStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"HStack.d.ts","sourceRoot":"","sources":["HStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,qBAAa,MAAO,SAAQ,SAAS;IACjC,SAAS,CAAC,aAAa,SAAgB;gBAG3B,EAAE,EAAE,MAAM;CAGzB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEzC"}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { BaseStack } from './BaseStack.js';
|
|
2
2
|
export class HStack extends BaseStack {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
// ✅ ULTRA-MINIMAL: Only id
|
|
4
|
+
constructor(id) {
|
|
5
|
+
super(id);
|
|
5
6
|
this.baseClassName = 'jux-hstack';
|
|
6
7
|
}
|
|
7
|
-
static create(children, options = {}) {
|
|
8
|
-
const id = `hstack-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
9
|
-
const instance = new HStack(id, children, options);
|
|
10
|
-
// ✅ Auto-render to 'app' on next tick
|
|
11
|
-
queueMicrotask(() => {
|
|
12
|
-
if (!instance._container) {
|
|
13
|
-
instance.render('app');
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
return instance;
|
|
17
|
-
}
|
|
18
8
|
}
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Create a horizontal stack (auto-renders)
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* hstack('nav')
|
|
14
|
+
* .items([
|
|
15
|
+
* jux.link('home').text('Home'),
|
|
16
|
+
* jux.link('about').text('About')
|
|
17
|
+
* ])
|
|
18
|
+
* .spacing('tight');
|
|
19
|
+
*/
|
|
20
|
+
export function hstack(id) {
|
|
21
|
+
return new HStack(id);
|
|
21
22
|
}
|
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
import { BaseStack
|
|
1
|
+
import { BaseStack } from './BaseStack.js';
|
|
2
2
|
|
|
3
3
|
export class HStack extends BaseStack {
|
|
4
4
|
protected baseClassName = 'jux-hstack';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
static create(children: Record<string, any> | any[], options: StackOptions = {}): HStack {
|
|
11
|
-
const id = `hstack-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
12
|
-
const instance = new HStack(id, children, options);
|
|
13
|
-
|
|
14
|
-
// ✅ Auto-render to 'app' on next tick
|
|
15
|
-
queueMicrotask(() => {
|
|
16
|
-
if (!instance._container) {
|
|
17
|
-
instance.render('app');
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
return instance;
|
|
6
|
+
// ✅ ULTRA-MINIMAL: Only id
|
|
7
|
+
constructor(id: string) {
|
|
8
|
+
super(id);
|
|
22
9
|
}
|
|
23
10
|
}
|
|
24
11
|
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Create a horizontal stack (auto-renders)
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* hstack('nav')
|
|
17
|
+
* .items([
|
|
18
|
+
* jux.link('home').text('Home'),
|
|
19
|
+
* jux.link('about').text('About')
|
|
20
|
+
* ])
|
|
21
|
+
* .spacing('tight');
|
|
22
|
+
*/
|
|
23
|
+
export function hstack(id: string): HStack {
|
|
24
|
+
return new HStack(id);
|
|
27
25
|
}
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import { BaseStack
|
|
1
|
+
import { BaseStack } from './BaseStack.js';
|
|
2
2
|
export declare class VStack extends BaseStack {
|
|
3
3
|
protected baseClassName: string;
|
|
4
|
-
constructor(id: string
|
|
5
|
-
/**
|
|
6
|
-
* ✅ Static create method with auto-render
|
|
7
|
-
*/
|
|
8
|
-
static create(children: Record<string, any> | any[], options?: StackOptions): VStack;
|
|
4
|
+
constructor(id: string);
|
|
9
5
|
}
|
|
10
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Create a vertical stack (auto-renders)
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* vstack('my-stack')
|
|
11
|
+
* .items([
|
|
12
|
+
* jux.heading('title').content('Hello'),
|
|
13
|
+
* jux.paragraph('text').text('World')
|
|
14
|
+
* ])
|
|
15
|
+
* .spacing('loose')
|
|
16
|
+
* .align('center');
|
|
17
|
+
*/
|
|
18
|
+
export declare function vstack(id: string): VStack;
|
|
11
19
|
//# sourceMappingURL=VStack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VStack.d.ts","sourceRoot":"","sources":["VStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"VStack.d.ts","sourceRoot":"","sources":["VStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,qBAAa,MAAO,SAAQ,SAAS;IACjC,SAAS,CAAC,aAAa,SAAgB;gBAG3B,EAAE,EAAE,MAAM;CAGzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEzC"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { BaseStack } from './BaseStack.js';
|
|
2
2
|
export class VStack extends BaseStack {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
// ✅ ULTRA-MINIMAL: Only id
|
|
4
|
+
constructor(id) {
|
|
5
|
+
super(id);
|
|
5
6
|
this.baseClassName = 'jux-vstack';
|
|
6
7
|
}
|
|
7
|
-
/**
|
|
8
|
-
* ✅ Static create method with auto-render
|
|
9
|
-
*/
|
|
10
|
-
static create(children, options = {}) {
|
|
11
|
-
const id = `vstack-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
12
|
-
const instance = new VStack(id, children, options);
|
|
13
|
-
setTimeout(() => {
|
|
14
|
-
if (!instance._container) {
|
|
15
|
-
instance.render('app');
|
|
16
|
-
}
|
|
17
|
-
}, 0); // Use setTimeout instead of queueMicrotask for safer timing
|
|
18
|
-
return instance;
|
|
19
|
-
}
|
|
20
8
|
}
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Create a vertical stack (auto-renders)
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* vstack('my-stack')
|
|
14
|
+
* .items([
|
|
15
|
+
* jux.heading('title').content('Hello'),
|
|
16
|
+
* jux.paragraph('text').text('World')
|
|
17
|
+
* ])
|
|
18
|
+
* .spacing('loose')
|
|
19
|
+
* .align('center');
|
|
20
|
+
*/
|
|
21
|
+
export function vstack(id) {
|
|
22
|
+
return new VStack(id);
|
|
23
23
|
}
|
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
import { BaseStack
|
|
1
|
+
import { BaseStack } from './BaseStack.js';
|
|
2
2
|
|
|
3
3
|
export class VStack extends BaseStack {
|
|
4
4
|
protected baseClassName = 'jux-vstack';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* ✅ Static create method with auto-render
|
|
12
|
-
*/
|
|
13
|
-
static create(children: Record<string, any> | any[], options: StackOptions = {}): VStack {
|
|
14
|
-
const id = `vstack-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
15
|
-
const instance = new VStack(id, children, options);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
setTimeout(() => {
|
|
19
|
-
if (!instance._container) {
|
|
20
|
-
instance.render('app');
|
|
21
|
-
}
|
|
22
|
-
}, 0); // Use setTimeout instead of queueMicrotask for safer timing
|
|
23
|
-
|
|
24
|
-
return instance;
|
|
6
|
+
// ✅ ULTRA-MINIMAL: Only id
|
|
7
|
+
constructor(id: string) {
|
|
8
|
+
super(id);
|
|
25
9
|
}
|
|
26
10
|
}
|
|
27
11
|
|
|
28
|
-
|
|
29
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Create a vertical stack (auto-renders)
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* vstack('my-stack')
|
|
17
|
+
* .items([
|
|
18
|
+
* jux.heading('title').content('Hello'),
|
|
19
|
+
* jux.paragraph('text').text('World')
|
|
20
|
+
* ])
|
|
21
|
+
* .spacing('loose')
|
|
22
|
+
* .align('center');
|
|
23
|
+
*/
|
|
24
|
+
export function vstack(id: string): VStack {
|
|
25
|
+
return new VStack(id);
|
|
30
26
|
}
|